progress towards sales.

This commit is contained in:
2023-09-26 14:30:21 -07:00
parent 94ef7ebf03
commit 160c289f03
12 changed files with 299 additions and 73 deletions

View File

@@ -46,3 +46,31 @@
(svg/spinner {:class "inline w-4 h-4 text-white"})
[:div.ml-3 "Loading..."]]
(into [:div.htmx-indicator-hidden ] children)])
(defn group-button- [{:keys [size] :or {size :normal} :as params} & children]
(into [:button (cond-> params
true (assoc :type (or (:type params) "button"))
true (update :class (fn [c]
(cond-> c
true (str " font-medium text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:ring-2 focus:ring-green-700 focus:text-green-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-green-500 dark:focus:text-white")
(= :small size)
(str " text-xs px-3 py-2")
(= :normal size)
(str " text-sm px-4 py-2")
)
))
true (dissoc :size))] children ))
(defn group- [{:keys [name]} & children]
(let [children (-> children
vec
(update-in [0 1 :class] str " rounded-l-lg")
(update-in [(dec (count children)) 1 :class] str " rounded-r-lg"))]
(into [:div {:class "inline-flex rounded-md shadow-sm", :role "group"
:hx-on:click "this.querySelector(\"input\").value = event.target.value; this.querySelector(\"input\").dispatchEvent(new Event('change', {bubbles: true}));"}
[:input {:type "hidden" :name name}]]
children)))