Makes appear logic work right

This commit is contained in:
2023-10-21 13:25:00 -07:00
parent 9ddbd31cc8
commit 34f4a12b2e
5 changed files with 107 additions and 72 deletions

View File

@@ -193,7 +193,8 @@ c.clearChoices();
[:p.mt-2.text-xs.text-red-600.dark:text-red-500.h-4 (str/join ", " errors)]))
(defn field- [params & rest]
[:div {:id (:id params) :class (hh/add-class "group" (:class params))}
[:div (-> params
(update :class #(hh/add-class (or % "") "group" )))
(when (:label params)
[:label {:class "block mb-2 text-sm font-medium text-gray-900 dark:text-white"} (:label params)])
rest

View File

@@ -1,5 +1,6 @@
(ns auto-ap.ssr.components.radio
(:require [auto-ap.ssr.hiccup-helper :as hh]))
(:require [auto-ap.ssr.hiccup-helper :as hh]
[auto-ap.ssr.hx :as hx]))
(defn radio- [{:keys [options name title size orientation] :or {size :medium} selected-value :value}]
[:h3 {:class "mb-4 font-semibold text-gray-900 dark:text-white"} title]
@@ -10,7 +11,8 @@
[:li {:class (cond-> "w-full border-b border-gray-200 rounded-t-lg dark:border-gray-600"
(= orientation :horizontal) (-> (hh/remove-wildcard ["w-full" "rounded-"])
(hh/add-class "w-auto shrink-0 block rounded-lg border border-gray-200 dark:border-gray-600 px-3")))}
[:div {:class "flex items-center pl-3"}
[:div {:class (cond-> "flex items-center"
(not= orientation :horizontal) (hh/add-class "pl-3"))}
[:input (cond-> {:id (str "list-" name "-" value)
:type "radio",
:value value