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

@@ -1,33 +1,30 @@
(ns auto-ap.ssr.admin.excel-invoice
(:require
[auto-ap.datomic :refer [audit-transact remove-nils conn]]
[auto-ap.datomic.accounts :as a]
[auto-ap.datomic.invoices :as d-invoices]
[auto-ap.import.manual.common :as c]
[auto-ap.logging :as alog]
[auto-ap.routes.admin.excel-invoices :as route]
[auto-ap.routes.utils
(:require [auto-ap.datomic :refer [audit-transact conn remove-nils]]
[auto-ap.datomic.accounts :as a]
[auto-ap.datomic.invoices :as d-invoices]
[auto-ap.import.manual.common :as c]
[auto-ap.logging :as alog]
[auto-ap.routes.admin.excel-invoices :as route]
[auto-ap.routes.utils
:refer [wrap-admin wrap-client-redirect-unauthenticated]]
[auto-ap.ssr-routes :as ssr-routes]
[auto-ap.ssr.components :as com]
[auto-ap.ssr.components.inputs :as inputs]
[auto-ap.ssr.form-cursor :as fc]
[auto-ap.ssr.hiccup-helper :as hh]
[auto-ap.ssr.nested-form-params :refer [wrap-nested-form-params]]
[auto-ap.ssr.ui :refer [base-page]]
[auto-ap.ssr.utils
:refer [apply-middleware-to-all-handlers
html-response
wrap-form-4xx-2
[auto-ap.ssr-routes :as ssr-routes]
[auto-ap.ssr.components :as com]
[auto-ap.ssr.components.inputs :as inputs]
[auto-ap.ssr.form-cursor :as fc]
[auto-ap.ssr.hiccup-helper :as hh]
[auto-ap.ssr.hx :as hx]
[auto-ap.ssr.nested-form-params :refer [wrap-nested-form-params]]
[auto-ap.ssr.ui :refer [base-page]]
[auto-ap.ssr.utils
:refer [apply-middleware-to-all-handlers html-response wrap-form-4xx-2
wrap-schema-enforce]]
[auto-ap.utils :refer [by]]
[bidi.bidi :as bidi]
[clj-time.coerce :as coerce]
[clojure.string :as str]
[datomic.api :as dc]
[digest]
[hiccup2.core :as hiccup]
[auto-ap.ssr.hx :as hx]))
[auto-ap.utils :refer [by]]
[bidi.bidi :as bidi]
[clj-time.coerce :as coerce]
[clojure.string :as str]
[datomic.api :as dc]
[digest]
[hiccup2.core :as hiccup :refer [raw]]))
(defn validate-invoice [invoice]
(when-not (:invoice/client invoice)
@@ -268,9 +265,6 @@
(form* {:form-params form-params
:form-errors form-errors}
[:div.flex.space-x-4
{:x-init (when (seq (:vendors-not-found result))
"popper = Popper.createPopper($refs.pill, $refs.tooltip, {placement: 'bottom', strategy: 'fixed', modifiers: {name: 'offset', options: {offset: [0, 10]}}});")
:x-data (hx/json {:show false})}
(com/pill {:color :primary}
(format "%d imported" (:imported result)))
(com/pill {:color :secondary}
@@ -280,10 +274,11 @@
(com/pill {:color :yellow
"@mouseover" "show=true"
"@mouseout" "show=false"
:x-ref "pill"}
"x-tooltip" "{content: ()=>$refs.tooltip.innerHTML ,
allowHTML: true}" }
(format "%d vendors not found" (count (:vendors-not-found result))))
[:div {:x-ref "tooltip" :x-show "show" :class "bg-gray-100 dark:bg-gray-600 rounded-lg shadow-2xl w-max z-50 ring-1 p-4"}
[:template {:x-ref "tooltip"}
[:ul
(for [n (take 5 (:vendors-not-found result))]
[:li n])]]))]