popper to tippy

This commit is contained in:
2024-10-15 06:45:33 -07:00
parent ca5d90b17f
commit 631ee905da
10 changed files with 125 additions and 142 deletions

View File

@@ -185,12 +185,10 @@
first
:bank-account/integration-status)]
[:div
(when bad-integration
{ :x-data "popper()" })
[:div.cursor-pointer (com/pill {:color (if bad-integration
:red
:primary)
:x-ref "source"}
[:div.cursor-pointer (com/pill (cond-> {:color :primary}
bad-integration (assoc :color :red
:x-tooltip "{content: ()=>$refs.tooltip.innerHTML, theme: 'light', allowHTML: true}"))
[:div.inline-flex.gap-2
(or
@@ -204,10 +202,9 @@
(when bad-integration
(com/tooltip {:x-bind "tooltip"
:x-ref "tooltip"}
[:div.text-red-700
(:integration-status/message bad-integration)]))])]
[:template {:x-ref "tooltip"}
[:div.text-red-700
(:integration-status/message bad-integration)]])])]
[:div.grid.grid-cols-2.gap-1.auto-cols-min.grid-flow-row.shrink
[:div "Attempted: "] [:div (atime/unparse-local (coerce/to-date-time (:integration-status/last-attempt e)) atime/normal-date)]
[:div "Last Updated: "] [:div (atime/unparse-local (coerce/to-date-time (:integration-status/last-updated e)) atime/normal-date)]]]))}

View File

@@ -52,19 +52,12 @@
(:requires-feedback-count row))
(com/data-grid-cell {:class class}
(when (> (count (:missing-transactions row)) 0)
[:div { :x-data (hx/json {:popper nil
:hovering false})
"x-init" "popper = Popper.createPopper($refs.hover_target, $refs.tooltip, {placement: 'bottom', strategy:'fixed', modifiers: [{name: 'preventOverflow'}, {name: 'offset', options: {offset: [0, 10]}}]});"}
(com/button {"x-ref" "hover_target"
"@click.prevent" "hovering=!hovering; $nextTick(() => popper.update())"}
[:div
(com/button { :x-tooltip.on.click "{content: ()=>$refs.tooltip.innerHTML, theme: 'light', allowHTML: true}" }
[:div.flex.gap-2.items-center
(count (:missing-transactions row))
[:div.w-4.h-4 svg/question]
])
[:div (hx/alpine-appear {:x-ref "tooltip"
:x-show "hovering"
:class "bg-gray-100 dark:bg-gray-600 rounded-lg shadow-2xl w-max z-50 p-4"})
[:div.w-4.h-4 svg/question]])
[:template {:x-ref "tooltip"}
(com/data-grid {:headers [(com/data-grid-header {} "Date")
(com/data-grid-header {} "Amount")]}
(for [r (:missing-transactions row)]
@@ -72,7 +65,7 @@
(com/data-grid-cell {}
(atime/unparse-local (coerce/to-date-time (:transaction/date r)) atime/normal-date))
(com/data-grid-cell {}
(format "$%,.2f" (:transaction/amount r)))))) ] ]))))))])
(format "$%,.2f" (:transaction/amount r))))))]]))))))])
(defn reconciliation-card* [{:keys [request report]}]