tweaks
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,15 +1,16 @@
|
|||||||
(ns auto-ap.ssr.components.data-grid
|
(ns auto-ap.ssr.components.data-grid
|
||||||
(:require
|
(:require
|
||||||
|
[auto-ap.logging :as alog]
|
||||||
[auto-ap.ssr-routes :as ssr-routes]
|
[auto-ap.ssr-routes :as ssr-routes]
|
||||||
[auto-ap.ssr.components.card :refer [content-card-]]
|
|
||||||
[auto-ap.ssr.components.paginator :refer [paginator-]]
|
|
||||||
[auto-ap.ssr.components.buttons :refer [a-button-]]
|
[auto-ap.ssr.components.buttons :refer [a-button-]]
|
||||||
[bidi.bidi :as bidi]
|
[auto-ap.ssr.components.card :refer [content-card-]]
|
||||||
[hiccup2.core :as hiccup]
|
|
||||||
[auto-ap.ssr.hx :as hx]
|
|
||||||
[auto-ap.ssr.components.inputs :as inputs]
|
[auto-ap.ssr.components.inputs :as inputs]
|
||||||
|
[auto-ap.ssr.components.paginator :refer [paginator-]]
|
||||||
[auto-ap.ssr.hiccup-helper :as hh]
|
[auto-ap.ssr.hiccup-helper :as hh]
|
||||||
[hiccup.util :as hu]))
|
[auto-ap.ssr.hx :as hx]
|
||||||
|
[bidi.bidi :as bidi]
|
||||||
|
[hiccup.util :as hu]
|
||||||
|
[hiccup2.core :as hiccup]))
|
||||||
|
|
||||||
(defn header- [params & rest]
|
(defn header- [params & rest]
|
||||||
(into [:th.px-4.py-3 {:scope "col" :class (:class params)
|
(into [:th.px-4.py-3 {:scope "col" :class (:class params)
|
||||||
@@ -26,10 +27,13 @@
|
|||||||
|
|
||||||
(defn row- [params & rest]
|
(defn row- [params & rest]
|
||||||
(into [:tr (update params
|
(into [:tr (update params
|
||||||
:class str " border-b dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700")] rest))
|
:class str " border-b dark:border-gray-600 group hover:bg-gray-100 dark:hover:bg-gray-700")] rest))
|
||||||
|
|
||||||
(defn cell- [params & rest]
|
(defn cell- [params & rest]
|
||||||
(into [:td.px-4.py-2 params ] rest))
|
(into [:td.px-4.py-2 (update params
|
||||||
|
:class #(str (-> "first:border-l-4 first:box-content first:group-[.live-added]:border-green-500 "
|
||||||
|
(hh/add-class (or % ""))))) ]
|
||||||
|
rest))
|
||||||
|
|
||||||
(defn right-stack-cell- [params & rest]
|
(defn right-stack-cell- [params & rest]
|
||||||
(cell- params (into [:div.flex.flex-row-reverse.items-center.justify-between
|
(cell- params (into [:div.flex.flex-row-reverse.items-center.justify-between
|
||||||
|
|||||||
@@ -56,12 +56,11 @@
|
|||||||
[:input {:type :hidden :name "id" :value ((:id-fn gridspec) entity)}]]
|
[:input {:type :hidden :name "id" :value ((:id-fn gridspec) entity)}]]
|
||||||
((:row-buttons gridspec) request entity))))] ;; TODO double check usage of row buttons user and identity in callers
|
((:row-buttons gridspec) request entity))))] ;; TODO double check usage of row buttons user and identity in callers
|
||||||
(apply com/data-grid-row
|
(apply com/data-grid-row
|
||||||
{:class (cond-> (or class "")
|
(cond-> {:class (cond-> (or class "")
|
||||||
flash? (hh/add-class "live-added"))
|
flash? (hh/add-class "live-added group"))
|
||||||
"_" (hiccup/raw (when delete-after-settle?
|
:data-id ((:id-fn gridspec) entity)}
|
||||||
" on htmx:afterSettle wait 400ms then remove me"))
|
delete-after-settle?
|
||||||
|
(assoc "@htmx:after-settle.camel" "setTimeout(() => $el.remove(), 400)"))
|
||||||
:data-id ((:id-fn gridspec) entity)}
|
|
||||||
cells)))
|
cells)))
|
||||||
|
|
||||||
(defn sort-icon [sort key]
|
(defn sort-icon [sort key]
|
||||||
|
|||||||
Reference in New Issue
Block a user