Proper validations and total row.
This commit is contained in:
@@ -123,10 +123,11 @@
|
||||
[:div {:class "flex items-center justify-center w-full h-full border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-800 dark:border-gray-700 bg-opacity-50" }
|
||||
[:div {:class "px-3 py-1 text-xs font-medium leading-none text-center text-blue-800 bg-blue-200 rounded-full animate-pulse dark:bg-blue-900 dark:text-blue-200"} "loading..."]]])])
|
||||
|
||||
(defn new-row- [{:keys [index colspan tr-params] :as params} & content]
|
||||
(defn new-row- [{:keys [index colspan tr-params row-offset] :as params} & content]
|
||||
(row-
|
||||
(merge {:class "new-row"
|
||||
:x-data (hx/json {:newRowIndex index})
|
||||
:x-data (hx/json {:newRowIndex index
|
||||
:offset (or row-offset 0)})
|
||||
}
|
||||
tr-params)
|
||||
(cell- {:colspan colspan
|
||||
@@ -135,10 +136,10 @@
|
||||
(a-button- (merge
|
||||
(dissoc params :index :colspan)
|
||||
{
|
||||
"@click" "$dispatch('newRow', {index: newRowIndex++})"
|
||||
"@click" "$dispatch('newRow', {index: (newRowIndex++)})"
|
||||
:color :secondary
|
||||
:hx-trigger "newRow"
|
||||
:hx-vals (hiccup/raw "js:{index: event.detail.index}")
|
||||
:hx-vals (hiccup/raw "js:{index: event.detail.index }")
|
||||
:hx-target "closest .new-row"
|
||||
:hx-swap "beforebegin"})
|
||||
content)])))
|
||||
|
||||
Reference in New Issue
Block a user