Nearly able to create invoices manually
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
(ns auto-ap.ssr.components.multi-modal
|
||||
(:require [auto-ap.ssr.components :as com]
|
||||
[auto-ap.ssr.form-cursor :as fc]
|
||||
|
||||
[auto-ap.ssr.nested-form-params :refer [wrap-nested-form-params]]
|
||||
[auto-ap.ssr.utils
|
||||
:refer [html-response
|
||||
assert-schema
|
||||
main-transformer
|
||||
modal-response
|
||||
wrap-form-4xx-2
|
||||
wrap-schema-enforce]]
|
||||
(:require [auto-ap.cursor :as cursor]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[auto-ap.ssr.components :as com]
|
||||
[auto-ap.ssr.components.timeline :as timeline]
|
||||
[auto-ap.ssr.form-cursor :as fc]
|
||||
[auto-ap.ssr.hx :as hx]
|
||||
[auto-ap.ssr.nested-form-params :refer [wrap-nested-form-params]]
|
||||
[auto-ap.ssr.svg :as svg]
|
||||
[auto-ap.ssr.utils
|
||||
:refer [assert-schema html-response main-transformer
|
||||
modal-response wrap-form-4xx-2 wrap-schema-enforce]]
|
||||
[bidi.bidi :as bidi]
|
||||
[hiccup.util :as hu]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[auto-ap.ssr.svg :as svg]
|
||||
[auto-ap.ssr.hx :as hx]
|
||||
[malli.core :as mc]
|
||||
[hiccup2.core :as hiccup2]
|
||||
[hiccup2.core :as hiccup]
|
||||
[auto-ap.cursor :as cursor]
|
||||
[malli.core :as m]
|
||||
[auto-ap.logging :as alog])
|
||||
(:import [auto_ap.cursor VecCursor]))
|
||||
[malli.core :as m]))
|
||||
|
||||
|
||||
(def default-form-props {:hx-ext "response-targets"
|
||||
@@ -40,18 +31,12 @@
|
||||
(step-name [this]))
|
||||
|
||||
(defprotocol Initializable
|
||||
(init-step-params [this request]))
|
||||
(init-step-params [this multi-form-state request]))
|
||||
|
||||
(defprotocol Discardable
|
||||
(can-discard? [this step-params])
|
||||
(discard-changes [this request]))
|
||||
|
||||
|
||||
(defn- init-step-params- [step request]
|
||||
(if (satisfies? Initializable step)
|
||||
(init-step-params step request)
|
||||
{}))
|
||||
|
||||
(defprotocol LinearModalWizard
|
||||
(hydrate-from-request [this request])
|
||||
(get-current-step [this])
|
||||
@@ -175,7 +160,7 @@
|
||||
(com/modal-card-advanced
|
||||
{"@keydown.enter.prevent.stop" "$refs.next.click()"
|
||||
:class (str
|
||||
"w-[750px] h-[600px]
|
||||
"w-full h-full md:w-[750px] md:h-[600px]
|
||||
group-[.forward]/transition:htmx-swapping:opacity-0
|
||||
group-[.forward]/transition:htmx-swapping:-translate-x-1/4
|
||||
group-[.forward]/transition:htmx-swapping:scale-75
|
||||
@@ -207,7 +192,7 @@
|
||||
head)
|
||||
#_(com/modal-header-attachment {})
|
||||
[:div.flex.shrink.overflow-auto.grow
|
||||
[:div.grow-0.pr-6.pt-2.bg-gray-100.self-stretch #_{:style "margin-left:-20px"} (render-timeline linear-wizard step validation-route)]
|
||||
[:div.grow-0.pr-6.pt-2.bg-gray-100.self-stretch.hidden.md:block #_{:style "margin-left:-20px"} (render-timeline linear-wizard step validation-route)]
|
||||
(com/modal-body {}
|
||||
body)]
|
||||
|
||||
@@ -253,9 +238,11 @@
|
||||
(-> request
|
||||
(assoc :multi-form-state (-> (:multi-form-state request)
|
||||
(merge-multi-form-state)
|
||||
(select-state
|
||||
(edit-path new-step request)
|
||||
(init-step-params- new-step request))))))
|
||||
(select-state (edit-path new-step request) {})
|
||||
(#(cond-> %
|
||||
(satisfies? Initializable new-step)
|
||||
(assoc :step-params
|
||||
(init-step-params new-step % request))))))))
|
||||
:headers {"HX-reswap" (when transition-type "outerHTML swap:0.16s")
|
||||
"x-transition-type" (or transition-type "none")})))
|
||||
(wrap-ensure-step)
|
||||
|
||||
Reference in New Issue
Block a user