@stonecrop/aform 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/aform.js CHANGED
@@ -1,13 +1,57 @@
1
- import { install as _e } from "@stonecrop/atable";
2
- import { defineComponent as R, computed as I, useModel as Y, openBlock as d, createElementBlock as f, Fragment as p, createElementVNode as a, toDisplayString as g, withDirectives as _, vModelCheckbox as Le, vShow as E, mergeModels as K, useId as qe, ref as T, inject as de, watch as O, normalizeClass as Z, withKeys as F, withModifiers as V, vModelText as G, createCommentVNode as B, renderList as j, renderSlot as fe, createTextVNode as se, unref as J, createVNode as oe, withCtx as Fe, useTemplateRef as ne, onMounted as we, nextTick as Ce, reactive as ve, vModelSelect as Be, provide as Re, createBlock as ee, watchEffect as Ve, resolveDynamicComponent as ke, mergeProps as He } from "vue";
3
- import { vOnClickOutside as ye } from "@vueuse/components";
4
- import { onClickOutside as he, useFileDialog as Ne } from "@vueuse/core";
5
- import './assets/index.css';function ce(e) {
1
+ import { isBadgeDescriptor as qe, lookupBadge as ce, selectChoices as Be } from "@stonecrop/schema";
2
+ import { install as Ce } from "@stonecrop/atable";
3
+ import { defineComponent as V, computed as w, useModel as Y, openBlock as r, createElementBlock as m, Fragment as L, createElementVNode as t, toDisplayString as k, withDirectives as F, vModelCheckbox as Ve, vShow as Q, mergeModels as P, useId as Re, ref as p, inject as me, watch as J, normalizeClass as Z, withKeys as q, withModifiers as H, vModelText as G, createCommentVNode as B, renderList as j, renderSlot as ye, createTextVNode as se, unref as O, createVNode as ie, withCtx as Ne, useTemplateRef as oe, onMounted as Se, nextTick as He, reactive as he, vModelSelect as Ue, provide as Ee, createBlock as ee, normalizeStyle as fe, watchEffect as Pe, resolveDynamicComponent as De, mergeProps as Ke } from "vue";
4
+ import { vOnClickOutside as be } from "@vueuse/components";
5
+ import { onClickOutside as ge, useFileDialog as Qe } from "@vueuse/core";
6
+ import './assets/index.css';function ae(e) {
6
7
  return Function(`"use strict"; return (${e})`)();
7
8
  }
8
- const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" }, Ee = { class: "aform_display-value" }, Ke = ["for"], Qe = { class: "aform_checkbox-container aform_input-field" }, Ye = ["id", "disabled", "required"], Ge = ["innerHTML"], ze = /* @__PURE__ */ R({
9
+ function Ye(e, o, n, i = {}) {
10
+ if (n) {
11
+ let u;
12
+ if (typeof n == "function" ? u = n(e, i) : u = ae(n)(e, i), qe(u))
13
+ return u.label.trim() ? u : void 0;
14
+ if (typeof u == "string" && u !== "")
15
+ return ce(o, u) ?? { label: u, variant: "neutral" };
16
+ }
17
+ const a = Ge(e);
18
+ if (a !== void 0)
19
+ return ce(o, a);
20
+ }
21
+ function Ge(e) {
22
+ switch (typeof e) {
23
+ case "string":
24
+ return e === "" ? void 0 : e;
25
+ case "number":
26
+ case "boolean":
27
+ case "bigint":
28
+ return String(e);
29
+ default:
30
+ return;
31
+ }
32
+ }
33
+ const ze = /* @__PURE__ */ new Set(["neutral", "success", "warning", "danger", "brand"]);
34
+ function we(e) {
35
+ if (!e?.label?.trim()) return;
36
+ const o = e.variant ?? "neutral";
37
+ if (e.color)
38
+ return {
39
+ borderLeftWidth: "4px",
40
+ borderLeftStyle: "solid",
41
+ borderLeftColor: e.color,
42
+ paddingLeft: "calc(1ch - 4px)"
43
+ };
44
+ if (ze.has(o))
45
+ return {
46
+ borderLeftWidth: "4px",
47
+ borderLeftStyle: "solid",
48
+ borderLeftColor: `var(--sc-badge-${o}-accent)`,
49
+ paddingLeft: "calc(1ch - 4px)"
50
+ };
51
+ }
52
+ const We = { class: "aform_form-element" }, Je = { class: "aform_field-label" }, Oe = { class: "aform_display-value" }, Xe = ["for"], Ze = { class: "aform_checkbox-container aform_input-field" }, je = ["id", "disabled", "required"], et = ["innerHTML"], tt = /* @__PURE__ */ V({
9
53
  __name: "ACheckbox",
10
- props: /* @__PURE__ */ K({
54
+ props: /* @__PURE__ */ P({
11
55
  schema: {},
12
56
  label: {},
13
57
  selectRange: { type: Boolean },
@@ -23,54 +67,54 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
23
67
  }),
24
68
  emits: ["update:modelValue"],
25
69
  setup(e) {
26
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
27
- return (r, t) => (d(), f("div", Ue, [
28
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
29
- a("label", Pe, g(e.label), 1),
30
- a("span", Ee, g(n.value ? "✓" : "✗"), 1)
31
- ], 64)) : (d(), f(p, { key: 1 }, [
32
- a("label", {
70
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
71
+ return (i, a) => (r(), m("div", We, [
72
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
73
+ t("label", Je, k(e.label), 1),
74
+ t("span", Oe, k(n.value ? "✓" : "✗"), 1)
75
+ ], 64)) : (r(), m(L, { key: 1 }, [
76
+ t("label", {
33
77
  class: "aform_field-label",
34
78
  for: e.uuid
35
- }, g(e.label), 9, Ke),
36
- a("span", Qe, [
37
- _(a("input", {
79
+ }, k(e.label), 9, Xe),
80
+ t("span", Ze, [
81
+ F(t("input", {
38
82
  id: e.uuid,
39
- "onUpdate:modelValue": t[0] || (t[0] = (c) => n.value = c),
83
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
40
84
  type: "checkbox",
41
85
  class: "aform_checkbox",
42
86
  disabled: e.mode === "read",
43
87
  required: e.required
44
- }, null, 8, Ye), [
45
- [Le, n.value]
88
+ }, null, 8, je), [
89
+ [Ve, n.value]
46
90
  ])
47
91
  ]),
48
- _(a("p", {
92
+ F(t("p", {
49
93
  class: "aform_error",
50
- innerHTML: u.value
51
- }, null, 8, Ge), [
52
- [E, u.value]
94
+ innerHTML: o.value
95
+ }, null, 8, et), [
96
+ [Q, o.value]
53
97
  ])
54
98
  ], 64))
55
99
  ]));
56
100
  }
57
- }), H = (e, u) => {
101
+ }), N = (e, o) => {
58
102
  const n = e.__vccOpts || e;
59
- for (const [r, t] of u)
60
- n[r] = t;
103
+ for (const [i, a] of o)
104
+ n[i] = a;
61
105
  return n;
62
- }, We = /* @__PURE__ */ H(ze, [["__scopeId", "data-v-ca06741d"]]), Je = {
106
+ }, at = /* @__PURE__ */ N(tt, [["__scopeId", "data-v-ca06741d"]]), lt = {
63
107
  key: 0,
64
108
  class: "aform_display-value"
65
- }, Oe = { class: "aform_form-link-wrapper" }, Xe = { class: "input-group" }, Ze = ["placeholder", "aria-label", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "onKeydown"], je = ["onKeydown"], et = ["aria-label"], tt = {
109
+ }, nt = { class: "aform_form-link-wrapper" }, ot = { class: "input-group" }, st = ["placeholder", "aria-label", "required", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "onKeydown"], it = ["onKeydown"], ut = ["aria-label"], rt = {
66
110
  key: 0,
67
111
  class: "autocomplete-result loading"
68
- }, at = ["id", "aria-selected", "onMousedown"], lt = {
112
+ }, dt = ["id", "aria-selected", "onMousedown"], ct = {
69
113
  key: 0,
70
114
  class: "aform_field-label"
71
- }, nt = /* @__PURE__ */ R({
115
+ }, mt = /* @__PURE__ */ V({
72
116
  __name: "AFormLink",
73
- props: /* @__PURE__ */ K({
117
+ props: /* @__PURE__ */ P({
74
118
  schema: {},
75
119
  label: {},
76
120
  selectRange: { type: Boolean },
@@ -98,84 +142,84 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
98
142
  }),
99
143
  emits: ["update:modelValue"],
100
144
  setup(e) {
101
- const u = `${e.uuid ?? `aform-link-${qe()}`}-listbox`, n = Y(e, "modelValue"), r = I(() => S(n.value) !== void 0), t = I(() => {
102
- const w = S(n.value);
103
- return w === void 0 ? "—" : e.formatter ? e.formatter(l(n.value)) : s(n.value) ?? w;
104
- }), c = T(r.value ? t.value : ""), y = T(!1), k = T(!1), h = T([]), v = T(null), x = de("aformLinkNavigator", null), $ = de("aformLinkResolver", null);
105
- function S(w) {
106
- if (w == null) return;
107
- if (typeof w == "string") return w === "" ? void 0 : w;
108
- if (typeof w == "number") return String(w);
109
- const C = w.id;
145
+ const o = `${e.uuid ?? `aform-link-${Re()}`}-listbox`, n = Y(e, "modelValue"), i = w(() => A(n.value) !== void 0), a = w(() => {
146
+ const T = A(n.value);
147
+ return T === void 0 ? "—" : e.formatter ? e.formatter(l(n.value)) : d(n.value) ?? T;
148
+ }), u = p(i.value ? a.value : ""), y = p(!1), g = p(!1), h = p([]), s = p(null), x = me("aformLinkNavigator", null), $ = me("aformLinkResolver", null);
149
+ function A(T) {
150
+ if (T == null) return;
151
+ if (typeof T == "string") return T === "" ? void 0 : T;
152
+ if (typeof T == "number") return String(T);
153
+ const C = T.id;
110
154
  if (!(C == null || C === ""))
111
155
  return String(C);
112
156
  }
113
- function s(w) {
114
- if (w == null || typeof w != "object") return;
115
- const C = w.displayText;
157
+ function d(T) {
158
+ if (T == null || typeof T != "object") return;
159
+ const C = T.displayText;
116
160
  return typeof C == "string" || typeof C == "number" ? String(C) : void 0;
117
161
  }
118
- function l(w) {
119
- if (w != null && typeof w == "object") return w;
120
- const C = S(w);
162
+ function l(T) {
163
+ if (T != null && typeof T == "object") return T;
164
+ const C = A(T);
121
165
  return C !== void 0 ? { id: C } : { id: "" };
122
166
  }
123
- O(
124
- () => S(n.value),
125
- async (w) => {
126
- if (!(!w || s(n.value)))
167
+ J(
168
+ () => A(n.value),
169
+ async (T) => {
170
+ if (!(!T || d(n.value)))
127
171
  try {
128
- let C, P;
129
- if (e.filterFunction ? (C = (await (typeof e.filterFunction == "string" ? ce(e.filterFunction) : e.filterFunction)(String(w))).find((ue) => String(ue.id) === String(w)), P = C?.displayText, P === void 0 && console.warn(
130
- `[AFormLink] filterFunction returned no matching result for id "${w}". The function must return an item whose \`id\` exactly matches the search string.`
131
- )) : $ && e.doctype && (P = await $(e.doctype, w.toString()) ?? void 0), P) {
132
- const X = { ...l(n.value), ...C, id: w, displayText: P };
133
- c.value = e.formatter ? e.formatter(X) : P, n.value = X;
172
+ let C, E;
173
+ if (e.filterFunction ? (C = (await (typeof e.filterFunction == "string" ? ae(e.filterFunction) : e.filterFunction)(String(T))).find((re) => String(re.id) === String(T)), E = C?.displayText, E === void 0 && console.warn(
174
+ `[AFormLink] filterFunction returned no matching result for id "${T}". The function must return an item whose \`id\` exactly matches the search string.`
175
+ )) : $ && e.doctype && (E = await $(e.doctype, T.toString()) ?? void 0), E) {
176
+ const X = { ...l(n.value), ...C, id: T, displayText: E };
177
+ u.value = e.formatter ? e.formatter(X) : E, n.value = X;
134
178
  }
135
179
  } catch {
136
180
  }
137
181
  },
138
182
  { immediate: !0 }
139
183
  );
140
- const o = () => {
141
- const w = S(n.value);
142
- x && e.doctype && w !== void 0 ? x.navigate(e.doctype, w) : x && !e.doctype && console.warn(
184
+ const f = () => {
185
+ const T = A(n.value);
186
+ x && e.doctype && T !== void 0 ? x.navigate(e.doctype, T) : x && !e.doctype && console.warn(
143
187
  "[AFormLink] Navigation requested but `doctype` prop is missing. Add `options` (or `doctype`) to the Link field definition to enable navigation."
144
188
  );
145
- }, i = async (w) => {
189
+ }, c = async (T) => {
146
190
  if (!(!e.filterFunction || e.mode === "read")) {
147
- v.value = null, y.value = !0, e.isAsync && (k.value = !0);
191
+ s.value = null, y.value = !0, e.isAsync && (g.value = !0);
148
192
  try {
149
- const C = typeof e.filterFunction == "string" ? ce(e.filterFunction) : e.filterFunction;
150
- h.value = await C(w) ?? [];
193
+ const C = typeof e.filterFunction == "string" ? ae(e.filterFunction) : e.filterFunction;
194
+ h.value = await C(T) ?? [];
151
195
  } catch {
152
196
  h.value = [];
153
197
  } finally {
154
- k.value = !1;
198
+ g.value = !1;
155
199
  }
156
200
  }
157
- }, D = () => {
158
- y.value = !1, v.value = null, c.value = r.value ? t.value : "";
159
- }, m = () => {
160
- y.value && D();
161
- }, q = () => i(c.value), b = () => i(c.value), L = (w) => {
162
- n.value = w, c.value = e.formatter ? e.formatter(w) : w.displayText ?? String(w.id), y.value = !1, v.value = null;
163
- }, N = () => {
164
- const w = h.value.length;
165
- w && (v.value = v.value === null ? 0 : (v.value + 1) % w);
166
- }, W = () => {
167
- h.value.length && (v.value === null || v.value === 0 ? v.value = null : v.value -= 1);
201
+ }, M = () => {
202
+ y.value = !1, s.value = null, u.value = i.value ? a.value : "";
203
+ }, v = () => {
204
+ y.value && M();
205
+ }, D = () => c(u.value), b = () => c(u.value), I = (T) => {
206
+ n.value = T, u.value = e.formatter ? e.formatter(T) : T.displayText ?? String(T.id), y.value = !1, s.value = null;
207
+ }, R = () => {
208
+ const T = h.value.length;
209
+ T && (s.value = s.value === null ? 0 : (s.value + 1) % T);
210
+ }, z = () => {
211
+ h.value.length && (s.value === null || s.value === 0 ? s.value = null : s.value -= 1);
168
212
  }, te = () => {
169
- v.value !== null && h.value[v.value] && L(h.value[v.value]);
213
+ s.value !== null && h.value[s.value] && I(h.value[s.value]);
170
214
  };
171
- return (w, C) => (d(), f("div", {
215
+ return (T, C) => (r(), m("div", {
172
216
  class: Z(["aform_form-element", { "aform_form-element--embedded": e.embedded }])
173
217
  }, [
174
- e.mode === "display" ? (d(), f("span", Je, g(t.value), 1)) : (d(), f(p, { key: 1 }, [
175
- _((d(), f("div", Oe, [
176
- a("div", Xe, [
177
- _(a("input", {
178
- "onUpdate:modelValue": C[0] || (C[0] = (P) => c.value = P),
218
+ e.mode === "display" ? (r(), m("span", lt, k(a.value), 1)) : (r(), m(L, { key: 1 }, [
219
+ F((r(), m("div", nt, [
220
+ t("div", ot, [
221
+ F(t("input", {
222
+ "onUpdate:modelValue": C[0] || (C[0] = (E) => u.value = E),
179
223
  type: "text",
180
224
  role: "combobox",
181
225
  autocomplete: "off",
@@ -185,61 +229,61 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
185
229
  "aria-label": e.ariaLabel,
186
230
  required: e.required,
187
231
  "aria-expanded": y.value,
188
- "aria-controls": y.value ? u : void 0,
189
- "aria-activedescendant": v.value === null ? void 0 : `${u}-opt-${v.value}`,
232
+ "aria-controls": y.value ? o : void 0,
233
+ "aria-activedescendant": s.value === null ? void 0 : `${o}-opt-${s.value}`,
190
234
  disabled: e.disabled || e.mode === "read",
191
235
  onInput: b,
192
- onFocus: q,
236
+ onFocus: D,
193
237
  onKeydown: [
194
- F(V(N, ["prevent"]), ["down"]),
195
- F(V(W, ["prevent"]), ["up"]),
196
- F(V(te, ["prevent"]), ["enter"]),
197
- F(D, ["esc"]),
198
- F(D, ["tab"])
238
+ q(H(R, ["prevent"]), ["down"]),
239
+ q(H(z, ["prevent"]), ["up"]),
240
+ q(H(te, ["prevent"]), ["enter"]),
241
+ q(M, ["esc"]),
242
+ q(M, ["tab"])
199
243
  ]
200
- }, null, 42, Ze), [
201
- [G, c.value]
244
+ }, null, 42, st), [
245
+ [G, u.value]
202
246
  ]),
203
- r.value && !e.disabled && !e.embedded ? (d(), f("button", {
247
+ i.value && !e.disabled && !e.embedded ? (r(), m("button", {
204
248
  key: 0,
205
249
  type: "button",
206
250
  class: "aform_form-btn",
207
- onClick: o,
208
- onKeydown: F(V(o, ["prevent"]), ["enter"])
251
+ onClick: f,
252
+ onKeydown: q(H(f, ["prevent"]), ["enter"])
209
253
  }, [
210
- a("span", null, g(e.icon === "chevron-right" ? "›" : "→"), 1)
211
- ], 40, je)) : B("", !0)
254
+ t("span", null, k(e.icon === "chevron-right" ? "›" : "→"), 1)
255
+ ], 40, it)) : B("", !0)
212
256
  ]),
213
- y.value ? (d(), f("ul", {
257
+ y.value ? (r(), m("ul", {
214
258
  key: 0,
215
- id: u,
259
+ id: o,
216
260
  class: "autocomplete-results",
217
261
  role: "listbox",
218
262
  "aria-label": e.ariaLabel
219
263
  }, [
220
- k.value ? (d(), f("li", tt, "Loading…")) : (d(!0), f(p, { key: 1 }, j(h.value, (P, X) => (d(), f("li", {
221
- id: `${u}-opt-${X}`,
222
- key: String(P.id),
264
+ g.value ? (r(), m("li", rt, "Loading…")) : (r(!0), m(L, { key: 1 }, j(h.value, (E, X) => (r(), m("li", {
265
+ id: `${o}-opt-${X}`,
266
+ key: String(E.id),
223
267
  role: "option",
224
- "aria-selected": X === v.value,
225
- class: Z(["autocomplete-result", { "is-active": X === v.value }]),
226
- onMousedown: V((ie) => L(P), ["prevent"])
268
+ "aria-selected": X === s.value,
269
+ class: Z(["autocomplete-result", { "is-active": X === s.value }]),
270
+ onMousedown: H((ue) => I(E), ["prevent"])
227
271
  }, [
228
- fe(w.$slots, "option", { option: P }, () => [
229
- se(g(P.displayText ?? String(P.id)), 1)
272
+ ye(T.$slots, "option", { option: E }, () => [
273
+ se(k(E.displayText ?? String(E.id)), 1)
230
274
  ], !0)
231
- ], 42, at))), 128))
232
- ], 8, et)) : B("", !0)
275
+ ], 42, dt))), 128))
276
+ ], 8, ut)) : B("", !0)
233
277
  ])), [
234
- [J(ye), m]
278
+ [O(be), v]
235
279
  ]),
236
- e.label && !e.embedded ? (d(), f("label", lt, g(e.label), 1)) : B("", !0)
280
+ e.label && !e.embedded ? (r(), m("label", ct, k(e.label), 1)) : B("", !0)
237
281
  ], 64))
238
282
  ], 2));
239
283
  }
240
- }), Me = /* @__PURE__ */ H(nt, [["__scopeId", "data-v-154d79c9"]]), st = { class: "aform_form-element acurrency" }, ot = { class: "aform_display-value" }, it = { class: "aform_field-label" }, ut = { class: "acurrency__row" }, rt = { class: "acurrency__field acurrency__field--amount" }, dt = { class: "acurrency__group" }, ct = { class: "acurrency__currency" }, mt = { class: "acurrency__amount-wrap" }, ft = ["id", "disabled", "required"], vt = ["for"], yt = { class: "acurrency__row acurrency__row--base" }, ht = { class: "acurrency__field acurrency__field--base-currency" }, bt = ["value"], gt = { class: "aform_field-label" }, $t = { class: "acurrency__field acurrency__field--base-amount" }, kt = ["value"], xt = { class: "aform_field-label" }, Dt = { class: "acurrency__field acurrency__field--exchange-rate" }, wt = ["value"], Mt = { class: "aform_field-label" }, Tt = ["innerHTML"], xe = 6, St = /* @__PURE__ */ R({
284
+ }), Ae = /* @__PURE__ */ N(mt, [["__scopeId", "data-v-154d79c9"]]), ft = { class: "aform_form-element acurrency" }, vt = { class: "aform_display-value" }, yt = { class: "aform_field-label" }, ht = { class: "acurrency__row" }, bt = { class: "acurrency__field acurrency__field--amount" }, gt = { class: "acurrency__group" }, kt = { class: "acurrency__currency" }, $t = { class: "acurrency__amount-wrap" }, xt = ["id", "disabled", "required"], Dt = ["for"], wt = { class: "acurrency__row acurrency__row--base" }, Mt = { class: "acurrency__field acurrency__field--base-currency" }, Tt = ["value"], St = { class: "aform_field-label" }, At = { class: "acurrency__field acurrency__field--base-amount" }, pt = ["value"], It = { class: "aform_field-label" }, _t = { class: "acurrency__field acurrency__field--exchange-rate" }, Lt = ["value"], Ft = { class: "aform_field-label" }, qt = ["innerHTML"], Me = 6, Bt = /* @__PURE__ */ V({
241
285
  __name: "ACurrencyInput",
242
- props: /* @__PURE__ */ K({
286
+ props: /* @__PURE__ */ P({
243
287
  schema: {},
244
288
  label: {},
245
289
  selectRange: { type: Boolean },
@@ -268,51 +312,51 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
268
312
  }),
269
313
  emits: ["update:modelValue"],
270
314
  setup(e) {
271
- const u = (m) => m.symbol ?? m.displayText ?? String(m.id), n = Y(e, "modelValue"), r = I(() => {
272
- const m = e.options.baseCurrency ?? n.value?.baseCurrency;
273
- return m ? typeof m == "string" ? { id: m } : m : { id: "" };
274
- }), t = de("aformLinkResolver", null), c = T(r.value);
275
- O(
276
- r,
277
- async (m) => {
278
- if (!m.id || m.displayText || !t || !e.options.doctype) {
279
- c.value = m;
315
+ const o = (v) => v.symbol ?? v.displayText ?? String(v.id), n = Y(e, "modelValue"), i = w(() => {
316
+ const v = e.options.baseCurrency ?? n.value?.baseCurrency;
317
+ return v ? typeof v == "string" ? { id: v } : v : { id: "" };
318
+ }), a = me("aformLinkResolver", null), u = p(i.value);
319
+ J(
320
+ i,
321
+ async (v) => {
322
+ if (!v.id || v.displayText || !a || !e.options.doctype) {
323
+ u.value = v;
280
324
  return;
281
325
  }
282
326
  try {
283
- const q = await t(e.options.doctype, String(m.id));
284
- c.value = q ? { ...m, displayText: q } : m;
327
+ const D = await a(e.options.doctype, String(v.id));
328
+ u.value = D ? { ...v, displayText: D } : v;
285
329
  } catch {
286
- c.value = m;
330
+ u.value = v;
287
331
  }
288
332
  },
289
333
  { immediate: !0 }
290
334
  );
291
- const y = I(() => {
292
- const m = c.value;
293
- return m?.id ? m.displayText ?? String(m.id) : "";
294
- }), k = (m) => {
295
- const q = c.value.id;
296
- return !m || String(m) === String(q) ? 1 : String(m) === String(n.value?.currency?.id) ? n.value?.exchangeRate ?? e.options.exchangeRates?.[String(m)] ?? 1 : e.options.exchangeRates?.[String(m)] ?? 1;
297
- }, h = I(() => {
298
- const { precision: m } = e.options;
299
- return m === void 0 ? xe : Number.isInteger(m) && m >= 0 && m <= 100 ? m : xe;
300
- }), v = (m) => Number(m.toFixed(h.value)), x = (m, q) => {
301
- const b = k(q.id);
335
+ const y = w(() => {
336
+ const v = u.value;
337
+ return v?.id ? v.displayText ?? String(v.id) : "";
338
+ }), g = (v) => {
339
+ const D = u.value.id;
340
+ return !v || String(v) === String(D) ? 1 : String(v) === String(n.value?.currency?.id) ? n.value?.exchangeRate ?? e.options.exchangeRates?.[String(v)] ?? 1 : e.options.exchangeRates?.[String(v)] ?? 1;
341
+ }, h = w(() => {
342
+ const { precision: v } = e.options;
343
+ return v === void 0 ? Me : Number.isInteger(v) && v >= 0 && v <= 100 ? v : Me;
344
+ }), s = (v) => Number(v.toFixed(h.value)), x = (v, D) => {
345
+ const b = g(D.id);
302
346
  n.value = {
303
- amount: m,
304
- currency: q,
347
+ amount: v,
348
+ currency: D,
305
349
  exchangeRate: b,
306
- baseCurrency: c.value,
307
- baseAmount: v(m * b)
350
+ baseCurrency: u.value,
351
+ baseAmount: s(v * b)
308
352
  };
309
- }, $ = I({
353
+ }, $ = w({
310
354
  get: () => n.value?.amount ?? 0,
311
- set: (m) => x(m, n.value?.currency ?? { id: "" })
312
- }), S = I({
355
+ set: (v) => x(v, n.value?.currency ?? { id: "" })
356
+ }), A = w({
313
357
  get: () => n.value?.currency ?? { id: "" },
314
- set: (m) => x(n.value?.amount ?? 0, m)
315
- }), s = /* @__PURE__ */ new Set([
358
+ set: (v) => x(n.value?.amount ?? 0, v)
359
+ }), d = /* @__PURE__ */ new Set([
316
360
  "Backspace",
317
361
  "Delete",
318
362
  "Tab",
@@ -324,63 +368,63 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
324
368
  "ArrowDown",
325
369
  "Home",
326
370
  "End"
327
- ]), l = (m) => {
328
- if (m.ctrlKey || m.metaKey || m.altKey || s.has(m.key) || /^[0-9]$/.test(m.key)) return;
329
- const q = m.target;
330
- m.key === "." && !q.value.includes(".") || m.key === "-" && !q.value.includes("-") || m.preventDefault();
331
- }, o = (m) => {
332
- const q = m.clipboardData?.getData("text") ?? "";
333
- /^-?\d*\.?\d*$/.test(q) || m.preventDefault();
334
- }, i = I(() => {
335
- const m = n.value;
336
- return !!m?.baseCurrency?.id && (m.currency?.id !== m.baseCurrency?.id || m.amount !== m.baseAmount);
337
- }), D = I(() => {
338
- const m = n.value;
339
- if (!m || !m.currency?.id) return "—";
340
- const q = m.currency.displayText ?? String(m.currency.id), b = `${m.amount} ${q}`;
341
- if (!i.value) return b;
342
- const L = m.baseCurrency.displayText ?? String(m.baseCurrency.id);
343
- return `${b} (${m.baseAmount} ${L})`;
371
+ ]), l = (v) => {
372
+ if (v.ctrlKey || v.metaKey || v.altKey || d.has(v.key) || /^[0-9]$/.test(v.key)) return;
373
+ const D = v.target;
374
+ v.key === "." && !D.value.includes(".") || v.key === "-" && !D.value.includes("-") || v.preventDefault();
375
+ }, f = (v) => {
376
+ const D = v.clipboardData?.getData("text") ?? "";
377
+ /^-?\d*\.?\d*$/.test(D) || v.preventDefault();
378
+ }, c = w(() => {
379
+ const v = n.value;
380
+ return !!v?.baseCurrency?.id && (v.currency?.id !== v.baseCurrency?.id || v.amount !== v.baseAmount);
381
+ }), M = w(() => {
382
+ const v = n.value;
383
+ if (!v || !v.currency?.id) return "—";
384
+ const D = v.currency.displayText ?? String(v.currency.id), b = `${v.amount} ${D}`;
385
+ if (!c.value) return b;
386
+ const I = v.baseCurrency.displayText ?? String(v.baseCurrency.id);
387
+ return `${b} (${v.baseAmount} ${I})`;
344
388
  });
345
- return (m, q) => (d(), f("div", st, [
346
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
347
- a("span", ot, g(D.value), 1),
348
- a("label", it, g(e.label), 1)
349
- ], 64)) : (d(), f(p, { key: 1 }, [
350
- a("div", ut, [
351
- a("div", rt, [
352
- a("div", dt, [
353
- a("div", ct, [
354
- oe(Me, {
355
- modelValue: S.value,
356
- "onUpdate:modelValue": q[0] || (q[0] = (b) => S.value = b),
389
+ return (v, D) => (r(), m("div", ft, [
390
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
391
+ t("span", vt, k(M.value), 1),
392
+ t("label", yt, k(e.label), 1)
393
+ ], 64)) : (r(), m(L, { key: 1 }, [
394
+ t("div", ht, [
395
+ t("div", bt, [
396
+ t("div", gt, [
397
+ t("div", kt, [
398
+ ie(Ae, {
399
+ modelValue: A.value,
400
+ "onUpdate:modelValue": D[0] || (D[0] = (b) => A.value = b),
357
401
  mode: e.mode,
358
402
  embedded: "",
359
403
  placeholder: e.currencyLabel,
360
404
  "aria-label": e.currencyLabel,
361
405
  required: e.required,
362
- formatter: u,
406
+ formatter: o,
363
407
  doctype: e.options.doctype,
364
408
  "filter-function": e.options.filterFunction,
365
409
  "is-async": e.options.isAsync
366
410
  }, {
367
- option: Fe(({ option: b }) => [
368
- se(g(b.symbol ? `${b.symbol} — ` : "") + g(b.displayText ?? b.id), 1)
411
+ option: Ne(({ option: b }) => [
412
+ se(k(b.symbol ? `${b.symbol} — ` : "") + k(b.displayText ?? b.id), 1)
369
413
  ]),
370
414
  _: 1
371
415
  }, 8, ["modelValue", "mode", "placeholder", "aria-label", "required", "doctype", "filter-function", "is-async"])
372
416
  ]),
373
- a("div", mt, [
374
- _(a("input", {
417
+ t("div", $t, [
418
+ F(t("input", {
375
419
  id: e.uuid,
376
- "onUpdate:modelValue": q[1] || (q[1] = (b) => $.value = b),
420
+ "onUpdate:modelValue": D[1] || (D[1] = (b) => $.value = b),
377
421
  class: "acurrency__amount",
378
422
  type: "number",
379
423
  disabled: e.mode === "read",
380
424
  required: e.required,
381
425
  onKeydown: l,
382
- onPaste: o
383
- }, null, 40, ft), [
426
+ onPaste: f
427
+ }, null, 40, xt), [
384
428
  [
385
429
  G,
386
430
  $.value,
@@ -388,62 +432,62 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
388
432
  { number: !0 }
389
433
  ]
390
434
  ]),
391
- a("label", {
435
+ t("label", {
392
436
  class: "aform_field-label",
393
437
  for: e.uuid
394
- }, g(e.label), 9, vt)
438
+ }, k(e.label), 9, Dt)
395
439
  ])
396
440
  ])
397
441
  ])
398
442
  ]),
399
- a("div", yt, [
400
- a("div", ht, [
401
- a("input", {
443
+ t("div", wt, [
444
+ t("div", Mt, [
445
+ t("input", {
402
446
  value: y.value,
403
447
  class: "aform_input-field acurrency__base-field",
404
448
  type: "text",
405
449
  disabled: ""
406
- }, null, 8, bt),
407
- a("label", gt, g(e.baseCurrencyLabel), 1)
450
+ }, null, 8, Tt),
451
+ t("label", St, k(e.baseCurrencyLabel), 1)
408
452
  ]),
409
- a("div", $t, [
410
- a("input", {
453
+ t("div", At, [
454
+ t("input", {
411
455
  value: n.value.baseAmount,
412
456
  class: "aform_input-field acurrency__base-field",
413
457
  type: "number",
414
458
  disabled: ""
415
- }, null, 8, kt),
416
- a("label", xt, g(e.baseAmountLabel), 1)
459
+ }, null, 8, pt),
460
+ t("label", It, k(e.baseAmountLabel), 1)
417
461
  ]),
418
- a("div", Dt, [
419
- a("input", {
462
+ t("div", _t, [
463
+ t("input", {
420
464
  value: n.value.exchangeRate,
421
465
  class: "aform_input-field acurrency__base-field",
422
466
  type: "number",
423
467
  disabled: ""
424
- }, null, 8, wt),
425
- a("label", Mt, g(e.exchangeRateLabel), 1)
468
+ }, null, 8, Lt),
469
+ t("label", Ft, k(e.exchangeRateLabel), 1)
426
470
  ])
427
471
  ]),
428
- _(a("p", {
472
+ F(t("p", {
429
473
  class: "aform_error",
430
474
  innerHTML: e.validation.errorMessage
431
- }, null, 8, Tt), [
432
- [E, e.validation.errorMessage]
475
+ }, null, 8, qt), [
476
+ [Q, e.validation.errorMessage]
433
477
  ])
434
478
  ], 64))
435
479
  ]));
436
480
  }
437
- }), It = /* @__PURE__ */ H(St, [["__scopeId", "data-v-15bec6ef"]]), At = { class: "aform_display-value" }, pt = { key: 0 }, _t = ["innerHTML"], Lt = {
481
+ }), Ct = /* @__PURE__ */ N(Bt, [["__scopeId", "data-v-15bec6ef"]]), Vt = { class: "aform_display-value" }, Rt = { key: 0 }, Nt = ["innerHTML"], Ht = {
438
482
  ref: "datepicker",
439
483
  class: "adatepicker",
440
484
  tabindex: "0"
441
- }, qt = {
485
+ }, Ut = {
442
486
  colspan: "5",
443
487
  tabindex: -1
444
- }, Ft = { key: 0 }, Ct = { colspan: "7" }, Bt = { class: "date-input" }, Rt = ["value"], Vt = ["value"], Ht = ["onClick", "onKeydown", "onMouseover"], Nt = ["innerHTML"], Ut = 6, De = 7, Pt = /* @__PURE__ */ R({
488
+ }, Et = { key: 0 }, Pt = { colspan: "7" }, Kt = { class: "date-input" }, Qt = ["value"], Yt = ["value"], Gt = ["onClick", "onKeydown", "onMouseover"], zt = ["innerHTML"], Wt = 6, Te = 7, Jt = /* @__PURE__ */ V({
445
489
  __name: "ADatePicker",
446
- props: /* @__PURE__ */ K({
490
+ props: /* @__PURE__ */ P({
447
491
  schema: {},
448
492
  label: {},
449
493
  selectRange: { type: Boolean, default: !1 },
@@ -457,174 +501,174 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
457
501
  modelValue: { default: () => /* @__PURE__ */ new Date() },
458
502
  modelModifiers: {}
459
503
  }),
460
- emits: /* @__PURE__ */ K(["get-date"], ["update:modelValue"]),
461
- setup(e, { expose: u, emit: n }) {
462
- const r = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), t = Y(e, "modelValue"), c = T(new Date(t.value)), y = T(c.value.getMonth()), k = T(c.value.getFullYear()), h = T([]), v = T(new Date(t.value)), x = T(null), $ = T(null), S = ne("start-date-input"), s = ne("end-date-input"), l = n, o = I(() => new Date(k.value, y.value, 1).toLocaleDateString(void 0, {
504
+ emits: /* @__PURE__ */ P(["get-date"], ["update:modelValue"]),
505
+ setup(e, { expose: o, emit: n }) {
506
+ const i = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), a = Y(e, "modelValue"), u = p(new Date(a.value)), y = p(u.value.getMonth()), g = p(u.value.getFullYear()), h = p([]), s = p(new Date(a.value)), x = p(null), $ = p(null), A = oe("start-date-input"), d = oe("end-date-input"), l = n, f = w(() => new Date(g.value, y.value, 1).toLocaleDateString(void 0, {
463
507
  year: "numeric",
464
508
  month: "long"
465
- })), i = I(() => x.value != null ? m(x.value) : ""), D = I(() => $.value != null ? m($.value) : ""), m = (M) => z(M) ? M.getMonth() + 1 + "/" + M.getDate() + "/" + M.getFullYear() : "", q = (M) => {
466
- const A = /* @__PURE__ */ new Date();
467
- return y.value !== A.getMonth() ? !1 : A.toDateString() === new Date(M).toDateString();
468
- }, b = (M) => new Date(M).toDateString() === new Date(c.value).toDateString(), L = (M) => {
469
- const A = x.value;
470
- return z(A) ? new Date(M).toDateString() === A.toDateString() : !1;
471
- }, N = (M) => {
472
- const A = $.value;
473
- return z(A) ? new Date(M).toDateString() === A.toDateString() : !1;
474
- }, W = (M, A) => (M - 1) * De + A, te = (M) => {
475
- const A = x.value;
476
- if (!z(A)) return !1;
477
- const U = new Date(M), Q = $.value, le = z(Q) ? Q : new Date(v.value);
478
- return U.getTime() > A.getTime() && U.getTime() < le.getTime();
479
- }, w = (M, A) => h.value[W(M, A)], C = (M) => {
480
- v.value = new Date(h.value[M]);
481
- }, P = (M) => {
482
- M.target?.tagName !== "INPUT" && M.preventDefault();
509
+ })), c = w(() => x.value != null ? v(x.value) : ""), M = w(() => $.value != null ? v($.value) : ""), v = (S) => W(S) ? S.getMonth() + 1 + "/" + S.getDate() + "/" + S.getFullYear() : "", D = (S) => {
510
+ const _ = /* @__PURE__ */ new Date();
511
+ return y.value !== _.getMonth() ? !1 : _.toDateString() === new Date(S).toDateString();
512
+ }, b = (S) => new Date(S).toDateString() === new Date(u.value).toDateString(), I = (S) => {
513
+ const _ = x.value;
514
+ return W(_) ? new Date(S).toDateString() === _.toDateString() : !1;
515
+ }, R = (S) => {
516
+ const _ = $.value;
517
+ return W(_) ? new Date(S).toDateString() === _.toDateString() : !1;
518
+ }, z = (S, _) => (S - 1) * Te + _, te = (S) => {
519
+ const _ = x.value;
520
+ if (!W(_)) return !1;
521
+ const U = new Date(S), K = $.value, ne = W(K) ? K : new Date(s.value);
522
+ return U.getTime() > _.getTime() && U.getTime() < ne.getTime();
523
+ }, T = (S, _) => h.value[z(S, _)], C = (S) => {
524
+ s.value = new Date(h.value[S]);
525
+ }, E = (S) => {
526
+ S.target?.tagName !== "INPUT" && S.preventDefault();
483
527
  }, X = () => {
484
528
  h.value = [];
485
- const M = new Date(k.value, y.value, 1), A = M.getDay(), U = M.setDate(M.getDate() - A);
486
- for (const Q of Array(43).keys())
487
- h.value.push(U + Q * 864e5);
488
- }, ie = () => k.value -= 1, ue = () => k.value += 1, Ie = () => {
489
- y.value == 0 ? (y.value = 11, ie()) : y.value -= 1;
490
- }, Ae = () => {
491
- y.value == 11 ? (y.value = 0, ue()) : y.value += 1;
492
- }, be = (M) => {
493
- M.key === "Enter" && re();
494
- }, ge = (M) => {
495
- if (t.value = c.value = new Date(h.value[M]), e.selectRange) {
496
- const A = x.value;
497
- A == null || $.value != null ? (x.value = t.value, $.value = null) : z(A) && c.value.getTime() < A.getTime() ? ($.value = null, x.value = t.value) : $.value = t.value, S.value && (S.value.value = m(x.value) ?? ""), s.value && (s.value.value = m($.value) ?? "");
529
+ const S = new Date(g.value, y.value, 1), _ = S.getDay(), U = S.setDate(S.getDate() - _);
530
+ for (const K of Array(43).keys())
531
+ h.value.push(U + K * 864e5);
532
+ }, ue = () => g.value -= 1, re = () => g.value += 1, _e = () => {
533
+ y.value == 0 ? (y.value = 11, ue()) : y.value -= 1;
534
+ }, Le = () => {
535
+ y.value == 11 ? (y.value = 0, re()) : y.value += 1;
536
+ }, ke = (S) => {
537
+ S.key === "Enter" && de();
538
+ }, $e = (S) => {
539
+ if (a.value = u.value = new Date(h.value[S]), e.selectRange) {
540
+ const _ = x.value;
541
+ _ == null || $.value != null ? (x.value = a.value, $.value = null) : W(_) && u.value.getTime() < _.getTime() ? ($.value = null, x.value = a.value) : $.value = a.value, A.value && (A.value.value = v(x.value) ?? ""), d.value && (d.value.value = v($.value) ?? "");
498
542
  }
499
- $e();
500
- }, pe = () => {
501
- const M = x.value, A = $.value;
502
- z(A) && z(M) && A.getTime() < M.getTime() && ([x.value, $.value] = [A, M]);
503
- }, z = (M) => M instanceof Date && !isNaN(M.getTime()), re = () => {
504
- if (S.value?.value == "")
543
+ xe();
544
+ }, Fe = () => {
545
+ const S = x.value, _ = $.value;
546
+ W(_) && W(S) && _.getTime() < S.getTime() && ([x.value, $.value] = [_, S]);
547
+ }, W = (S) => S instanceof Date && !isNaN(S.getTime()), de = () => {
548
+ if (A.value?.value == "")
505
549
  x.value = null;
506
- else if (S.value) {
507
- const M = new Date(S.value.value);
508
- x.value = z(M) ? M : null;
550
+ else if (A.value) {
551
+ const S = new Date(A.value.value);
552
+ x.value = W(S) ? S : null;
509
553
  }
510
- if (s.value?.value == "")
554
+ if (d.value?.value == "")
511
555
  $.value = null;
512
- else if (s.value) {
513
- const M = new Date(s.value.value);
514
- $.value = z(M) ? M : null;
556
+ else if (d.value) {
557
+ const S = new Date(d.value.value);
558
+ $.value = W(S) ? S : null;
515
559
  }
516
- z(x.value) && (z($.value) && pe(), c.value = x.value), $e();
517
- }, $e = () => {
560
+ W(x.value) && (W($.value) && Fe(), u.value = x.value), xe();
561
+ }, xe = () => {
518
562
  l("get-date", {
519
563
  start: e.selectRange ? x.value : null,
520
564
  end: e.selectRange ? $.value : null,
521
- selected: c.value
565
+ selected: u.value
522
566
  });
523
567
  };
524
- return we(async () => {
525
- X(), await Ce();
526
- const M = document.getElementsByClassName("selectedDate");
527
- if (M.length > 0)
528
- M[0].focus();
568
+ return Se(async () => {
569
+ X(), await He();
570
+ const S = document.getElementsByClassName("selectedDate");
571
+ if (S.length > 0)
572
+ S[0].focus();
529
573
  else {
530
- const A = document.getElementsByClassName("todaysDate");
531
- A.length > 0 && A[0].focus();
574
+ const _ = document.getElementsByClassName("todaysDate");
575
+ _.length > 0 && _[0].focus();
532
576
  }
533
- }), O([y, k], X), u({ currentMonth: y, currentYear: k, selectedDate: c }), (M, A) => e.mode === "display" || e.mode === "read" ? (d(), f(p, { key: 0 }, [
534
- a("span", At, g(t.value ? new Date(t.value).toLocaleDateString() : ""), 1),
535
- e.label ? (d(), f("label", pt, g(e.label), 1)) : B("", !0),
536
- _(a("p", {
577
+ }), J([y, g], X), o({ currentMonth: y, currentYear: g, selectedDate: u }), (S, _) => e.mode === "display" || e.mode === "read" ? (r(), m(L, { key: 0 }, [
578
+ t("span", Vt, k(a.value ? new Date(a.value).toLocaleDateString() : ""), 1),
579
+ e.label ? (r(), m("label", Rt, k(e.label), 1)) : B("", !0),
580
+ F(t("p", {
537
581
  class: "aform_error",
538
- innerHTML: r.value
539
- }, null, 8, _t), [
540
- [E, r.value]
582
+ innerHTML: i.value
583
+ }, null, 8, Nt), [
584
+ [Q, i.value]
541
585
  ])
542
- ], 64)) : (d(), f(p, { key: 1 }, [
543
- a("div", Lt, [
544
- a("table", { onMousedown: P }, [
545
- a("tbody", null, [
546
- a("tr", null, [
547
- a("td", {
586
+ ], 64)) : (r(), m(L, { key: 1 }, [
587
+ t("div", Ht, [
588
+ t("table", { onMousedown: E }, [
589
+ t("tbody", null, [
590
+ t("tr", null, [
591
+ t("td", {
548
592
  id: "previous-month-btn",
549
593
  tabindex: -1,
550
- onClick: Ie
594
+ onClick: _e
551
595
  }, "<"),
552
- a("th", qt, g(o.value), 1),
553
- a("td", {
596
+ t("th", Ut, k(f.value), 1),
597
+ t("td", {
554
598
  id: "next-month-btn",
555
599
  tabindex: -1,
556
- onClick: Ae
600
+ onClick: Le
557
601
  }, ">")
558
602
  ]),
559
- e.selectRange ? (d(), f("tr", Ft, [
560
- a("td", Ct, [
561
- a("div", Bt, [
562
- a("input", {
603
+ e.selectRange ? (r(), m("tr", Et, [
604
+ t("td", Pt, [
605
+ t("div", Kt, [
606
+ t("input", {
563
607
  ref: "start-date-input",
564
- value: i.value,
608
+ value: c.value,
565
609
  class: "date-input-start aform_input-field",
566
610
  type: "text",
567
611
  placeholder: "start date",
568
- onBlur: A[0] || (A[0] = (U) => re()),
569
- onKeydown: be
570
- }, null, 40, Rt),
571
- A[2] || (A[2] = a("div", null, "-", -1)),
572
- a("input", {
612
+ onBlur: _[0] || (_[0] = (U) => de()),
613
+ onKeydown: ke
614
+ }, null, 40, Qt),
615
+ _[2] || (_[2] = t("div", null, "-", -1)),
616
+ t("input", {
573
617
  ref: "end-date-input",
574
- value: D.value,
618
+ value: M.value,
575
619
  class: "date-input-end aform_input-field",
576
620
  type: "text",
577
621
  placeholder: "end date",
578
- onBlur: A[1] || (A[1] = (U) => re()),
579
- onKeydown: be
580
- }, null, 40, Vt)
622
+ onBlur: _[1] || (_[1] = (U) => de()),
623
+ onKeydown: ke
624
+ }, null, 40, Yt)
581
625
  ])
582
626
  ])
583
627
  ])) : B("", !0),
584
- A[3] || (A[3] = a("tr", { class: "days-header" }, [
585
- a("td", null, "M"),
586
- a("td", null, "T"),
587
- a("td", null, "W"),
588
- a("td", null, "T"),
589
- a("td", null, "F"),
590
- a("td", null, "S"),
591
- a("td", null, "S")
628
+ _[3] || (_[3] = t("tr", { class: "days-header" }, [
629
+ t("td", null, "M"),
630
+ t("td", null, "T"),
631
+ t("td", null, "W"),
632
+ t("td", null, "T"),
633
+ t("td", null, "F"),
634
+ t("td", null, "S"),
635
+ t("td", null, "S")
592
636
  ], -1)),
593
- (d(), f(p, null, j(Ut, (U) => a("tr", { key: U }, [
594
- (d(), f(p, null, j(De, (Q) => a("td", {
637
+ (r(), m(L, null, j(Wt, (U) => t("tr", { key: U }, [
638
+ (r(), m(L, null, j(Te, (K) => t("td", {
595
639
  ref_for: !0,
596
640
  ref: "celldate",
597
- key: W(U, Q),
641
+ key: z(U, K),
598
642
  class: Z(["date-cell", {
599
- todaysDate: q(w(U, Q)),
600
- selectedDate: b(w(U, Q)),
601
- withinRange: e.selectRange ? te(w(U, Q)) : !1,
602
- startDate: e.selectRange ? L(w(U, Q)) : !1,
603
- endDate: e.selectRange ? N(w(U, Q)) : !1
643
+ todaysDate: D(T(U, K)),
644
+ selectedDate: b(T(U, K)),
645
+ withinRange: e.selectRange ? te(T(U, K)) : !1,
646
+ startDate: e.selectRange ? I(T(U, K)) : !1,
647
+ endDate: e.selectRange ? R(T(U, K)) : !1
604
648
  }]),
605
649
  contenteditable: !1,
606
650
  spellcheck: !1,
607
651
  tabindex: 0,
608
- onClick: V((le) => ge(W(U, Q)), ["prevent", "stop"]),
609
- onKeydown: F((le) => ge(W(U, Q)), ["enter"]),
610
- onMouseover: (le) => C(W(U, Q))
611
- }, g(new Date(w(U, Q)).getDate()), 43, Ht)), 64))
652
+ onClick: H((ne) => $e(z(U, K)), ["prevent", "stop"]),
653
+ onKeydown: q((ne) => $e(z(U, K)), ["enter"]),
654
+ onMouseover: (ne) => C(z(U, K))
655
+ }, k(new Date(T(U, K)).getDate()), 43, Gt)), 64))
612
656
  ])), 64))
613
657
  ])
614
658
  ], 32)
615
659
  ], 512),
616
- _(a("p", {
660
+ F(t("p", {
617
661
  class: "aform_error",
618
- innerHTML: r.value
619
- }, null, 8, Nt), [
620
- [E, r.value]
662
+ innerHTML: i.value
663
+ }, null, 8, zt), [
664
+ [Q, i.value]
621
665
  ])
622
666
  ], 64));
623
667
  }
624
- }), Te = /* @__PURE__ */ H(Pt, [["__scopeId", "data-v-322c2ceb"]]), Et = { class: "adate_time" }, Kt = { class: "adate_time_fields" }, Qt = ["onKeydown"], Yt = ["onKeydown"], Gt = {
668
+ }), pe = /* @__PURE__ */ N(Jt, [["__scopeId", "data-v-322c2ceb"]]), Ot = { class: "adate_time" }, Xt = { class: "adate_time_fields" }, Zt = ["onKeydown"], jt = ["onKeydown"], ea = {
625
669
  key: 0,
626
670
  class: "colon"
627
- }, zt = ["onKeydown"], Wt = /* @__PURE__ */ R({
671
+ }, ta = ["onKeydown"], aa = /* @__PURE__ */ V({
628
672
  __name: "ADateTimeInput",
629
673
  props: {
630
674
  allowMilitaryTime: { type: Boolean, default: !1 },
@@ -635,146 +679,146 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
635
679
  useSeconds: { type: Boolean, default: !0 }
636
680
  },
637
681
  emits: ["get-time"],
638
- setup(e, { emit: u }) {
639
- const n = u, r = ne("meridiem-selector"), t = ve({
682
+ setup(e, { emit: o }) {
683
+ const n = o, i = oe("meridiem-selector"), a = he({
640
684
  hours: String(e.defaultHours).padStart(2, "0"),
641
685
  minutes: String(e.defaultMinutes).padStart(2, "0"),
642
686
  seconds: String(e.defaultSeconds).padStart(2, "0")
643
- }), c = T(e.defaultMeridiem == "AM" ? "AM" : "PM");
644
- we(() => {
645
- k("init");
687
+ }), u = p(e.defaultMeridiem == "AM" ? "AM" : "PM");
688
+ Se(() => {
689
+ g("init");
646
690
  });
647
691
  const y = () => {
648
- const s = e.allowMilitaryTime ? 23 : 12, l = e.allowMilitaryTime ? 0 : 1;
649
- let o = Number(t.hours), i = Number(t.minutes), D = Number(t.seconds);
650
- (isNaN(o) || t.hours === "" || o > s) && (o = s), !e.allowMilitaryTime && o < l && (o = l), (isNaN(i) || t.minutes === "" || i > 59) && (i = 59), (isNaN(D) || t.seconds === "" || D > 59) && (D = 59), t.hours = String(o).padStart(2, "0"), t.minutes = String(i).padStart(2, "0"), t.seconds = String(D).padStart(2, "0"), k("user");
651
- }, k = (s) => {
652
- const l = Number(t.hours), o = Number(t.minutes), i = Number(t.seconds);
692
+ const d = e.allowMilitaryTime ? 23 : 12, l = e.allowMilitaryTime ? 0 : 1;
693
+ let f = Number(a.hours), c = Number(a.minutes), M = Number(a.seconds);
694
+ (isNaN(f) || a.hours === "" || f > d) && (f = d), !e.allowMilitaryTime && f < l && (f = l), (isNaN(c) || a.minutes === "" || c > 59) && (c = 59), (isNaN(M) || a.seconds === "" || M > 59) && (M = 59), a.hours = String(f).padStart(2, "0"), a.minutes = String(c).padStart(2, "0"), a.seconds = String(M).padStart(2, "0"), g("user");
695
+ }, g = (d) => {
696
+ const l = Number(a.hours), f = Number(a.minutes), c = Number(a.seconds);
653
697
  n("get-time", {
654
698
  hours: l,
655
- minutes: o,
656
- seconds: i,
657
- source: s,
658
- meridiem: c.value,
659
- militaryTime: e.allowMilitaryTime ? l : c.value === "PM" ? l === 12 ? 12 : l + 12 : l % 12
699
+ minutes: f,
700
+ seconds: c,
701
+ source: d,
702
+ meridiem: u.value,
703
+ militaryTime: e.allowMilitaryTime ? l : u.value === "PM" ? l === 12 ? 12 : l + 12 : l % 12
660
704
  });
661
- }, h = (s) => {
662
- const l = s.target;
705
+ }, h = (d) => {
706
+ const l = d.target;
663
707
  l instanceof HTMLInputElement && l.select();
664
- }, v = (s, l = 1) => {
665
- const o = e.allowMilitaryTime ? 23 : 12, i = e.allowMilitaryTime ? 0 : 1;
666
- if (s == "hours") {
667
- const q = Number(t.hours);
668
- t.hours = String(q + l), (q == 11 && Number(t.hours) == 12 || q == 12 && Number(t.hours) == 11) && $();
669
- } else s == "minutes" ? t.minutes = String(Number(t.minutes) + l) : s == "seconds" && (t.seconds = String(Number(t.seconds) + l));
670
- const D = Number(t.hours);
671
- Number(t.seconds) < 0 ? t.minutes = String(Number(t.minutes) - 1) : Number(t.seconds) > 59 && (t.minutes = String(Number(t.minutes) + 1)), Number(t.minutes) < 0 ? t.hours = String(D - 1) : Number(t.minutes) > 59 && (t.hours = String(D + 1));
672
- const m = Number(t.hours);
673
- !e.allowMilitaryTime && m !== D && (D === 11 && m === 12 || D === 12 && m === 11) && $(), t.hours = String(x(Number(t.hours), i, o)).padStart(2, "0"), t.minutes = String(x(Number(t.minutes), 0, 59)).padStart(2, "0"), t.seconds = String(x(Number(t.seconds), 0, 59)).padStart(2, "0");
708
+ }, s = (d, l = 1) => {
709
+ const f = e.allowMilitaryTime ? 23 : 12, c = e.allowMilitaryTime ? 0 : 1;
710
+ if (d == "hours") {
711
+ const D = Number(a.hours);
712
+ a.hours = String(D + l), (D == 11 && Number(a.hours) == 12 || D == 12 && Number(a.hours) == 11) && $();
713
+ } else d == "minutes" ? a.minutes = String(Number(a.minutes) + l) : d == "seconds" && (a.seconds = String(Number(a.seconds) + l));
714
+ const M = Number(a.hours);
715
+ Number(a.seconds) < 0 ? a.minutes = String(Number(a.minutes) - 1) : Number(a.seconds) > 59 && (a.minutes = String(Number(a.minutes) + 1)), Number(a.minutes) < 0 ? a.hours = String(M - 1) : Number(a.minutes) > 59 && (a.hours = String(M + 1));
716
+ const v = Number(a.hours);
717
+ !e.allowMilitaryTime && v !== M && (M === 11 && v === 12 || M === 12 && v === 11) && $(), a.hours = String(x(Number(a.hours), c, f)).padStart(2, "0"), a.minutes = String(x(Number(a.minutes), 0, 59)).padStart(2, "0"), a.seconds = String(x(Number(a.seconds), 0, 59)).padStart(2, "0");
674
718
  };
675
- O(
676
- () => t.hours,
677
- (s, l) => {
678
- t.hours = Number(s) > 99 ? l : s;
719
+ J(
720
+ () => a.hours,
721
+ (d, l) => {
722
+ a.hours = Number(d) > 99 ? l : d;
679
723
  }
680
- ), O(
681
- () => t.minutes,
682
- (s, l) => {
683
- t.minutes = Number(s) > 99 ? l : s;
724
+ ), J(
725
+ () => a.minutes,
726
+ (d, l) => {
727
+ a.minutes = Number(d) > 99 ? l : d;
684
728
  }
685
- ), O(
686
- () => t.seconds,
687
- (s, l) => {
688
- t.seconds = Number(s) > 99 ? l : s;
729
+ ), J(
730
+ () => a.seconds,
731
+ (d, l) => {
732
+ a.seconds = Number(d) > 99 ? l : d;
689
733
  }
690
734
  );
691
- const x = (s, l, o) => s > o ? l : s < l ? o : s, $ = () => {
692
- c.value = c.value == "PM" ? "AM" : "PM", k("user");
693
- }, S = (s, l = !1) => {
694
- s.stopPropagation(), s.preventDefault();
695
- const o = s.clipboardData;
696
- if (!o) return;
697
- let i = o.getData("Text");
698
- if (i = i.replace(/[^0-9]/g, ""), l) {
699
- i.length % 2 != 0 && (i = "0" + i), i.length < 3 && (i += "00"), i.length < 5 && (i += "00");
700
- const D = i.match(/(..?)/g);
701
- if (!D || D.length < 3) return;
702
- t.seconds = D[2], t.minutes = D[1], t.hours = D[0], y(), e.allowMilitaryTime || r.value?.focus();
735
+ const x = (d, l, f) => d > f ? l : d < l ? f : d, $ = () => {
736
+ u.value = u.value == "PM" ? "AM" : "PM", g("user");
737
+ }, A = (d, l = !1) => {
738
+ d.stopPropagation(), d.preventDefault();
739
+ const f = d.clipboardData;
740
+ if (!f) return;
741
+ let c = f.getData("Text");
742
+ if (c = c.replace(/[^0-9]/g, ""), l) {
743
+ c.length % 2 != 0 && (c = "0" + c), c.length < 3 && (c += "00"), c.length < 5 && (c += "00");
744
+ const M = c.match(/(..?)/g);
745
+ if (!M || M.length < 3) return;
746
+ a.seconds = M[2], a.minutes = M[1], a.hours = M[0], y(), e.allowMilitaryTime || i.value?.focus();
703
747
  } else {
704
- i.length > 2 && (i = i.slice(0, 2));
705
- const D = s.target;
706
- D instanceof HTMLInputElement && (D.value = i, D.dispatchEvent(new Event("input")));
748
+ c.length > 2 && (c = c.slice(0, 2));
749
+ const M = d.target;
750
+ M instanceof HTMLInputElement && (M.value = c, M.dispatchEvent(new Event("input")));
707
751
  }
708
752
  };
709
- return (s, l) => (d(), f("div", Et, [
710
- a("div", Kt, [
711
- _(a("input", {
712
- "onUpdate:modelValue": l[0] || (l[0] = (o) => t.hours = o),
753
+ return (d, l) => (r(), m("div", Ot, [
754
+ t("div", Xt, [
755
+ F(t("input", {
756
+ "onUpdate:modelValue": l[0] || (l[0] = (f) => a.hours = f),
713
757
  type: "text",
714
758
  inputmode: "numeric",
715
- onPaste: l[1] || (l[1] = (o) => S(o, !0)),
759
+ onPaste: l[1] || (l[1] = (f) => A(f, !0)),
716
760
  onFocus: h,
717
761
  onBlur: y,
718
762
  onKeydown: [
719
- F(V(y, ["prevent"]), ["enter"]),
720
- l[2] || (l[2] = F(V((o) => v("hours"), ["prevent"]), ["up"])),
721
- l[3] || (l[3] = F(V((o) => v("hours", -1), ["prevent"]), ["down"]))
763
+ q(H(y, ["prevent"]), ["enter"]),
764
+ l[2] || (l[2] = q(H((f) => s("hours"), ["prevent"]), ["up"])),
765
+ l[3] || (l[3] = q(H((f) => s("hours", -1), ["prevent"]), ["down"]))
722
766
  ]
723
- }, null, 40, Qt), [
724
- [G, t.hours]
767
+ }, null, 40, Zt), [
768
+ [G, a.hours]
725
769
  ]),
726
- l[12] || (l[12] = a("span", { class: "colon" }, ":", -1)),
727
- _(a("input", {
728
- "onUpdate:modelValue": l[4] || (l[4] = (o) => t.minutes = o),
770
+ l[12] || (l[12] = t("span", { class: "colon" }, ":", -1)),
771
+ F(t("input", {
772
+ "onUpdate:modelValue": l[4] || (l[4] = (f) => a.minutes = f),
729
773
  type: "text",
730
774
  inputmode: "numeric",
731
- onPaste: S,
775
+ onPaste: A,
732
776
  onFocus: h,
733
777
  onBlur: y,
734
778
  onKeydown: [
735
- F(V(y, ["prevent"]), ["enter"]),
736
- l[5] || (l[5] = F(V((o) => v("minutes"), ["prevent"]), ["up"])),
737
- l[6] || (l[6] = F(V((o) => v("minutes", -1), ["prevent"]), ["down"]))
779
+ q(H(y, ["prevent"]), ["enter"]),
780
+ l[5] || (l[5] = q(H((f) => s("minutes"), ["prevent"]), ["up"])),
781
+ l[6] || (l[6] = q(H((f) => s("minutes", -1), ["prevent"]), ["down"]))
738
782
  ]
739
- }, null, 40, Yt), [
740
- [G, t.minutes]
783
+ }, null, 40, jt), [
784
+ [G, a.minutes]
741
785
  ]),
742
- e.useSeconds ? (d(), f("span", Gt, ":")) : B("", !0),
743
- e.useSeconds ? _((d(), f("input", {
786
+ e.useSeconds ? (r(), m("span", ea, ":")) : B("", !0),
787
+ e.useSeconds ? F((r(), m("input", {
744
788
  key: 1,
745
- "onUpdate:modelValue": l[7] || (l[7] = (o) => t.seconds = o),
789
+ "onUpdate:modelValue": l[7] || (l[7] = (f) => a.seconds = f),
746
790
  type: "text",
747
791
  inputmode: "numeric",
748
- onPaste: S,
792
+ onPaste: A,
749
793
  onFocus: h,
750
794
  onBlur: y,
751
795
  onKeydown: [
752
- F(V(y, ["prevent"]), ["enter"]),
753
- l[8] || (l[8] = F(V((o) => v("seconds"), ["prevent"]), ["up"])),
754
- l[9] || (l[9] = F(V((o) => v("seconds", -1), ["prevent"]), ["down"]))
796
+ q(H(y, ["prevent"]), ["enter"]),
797
+ l[8] || (l[8] = q(H((f) => s("seconds"), ["prevent"]), ["up"])),
798
+ l[9] || (l[9] = q(H((f) => s("seconds", -1), ["prevent"]), ["down"]))
755
799
  ]
756
- }, null, 40, zt)), [
757
- [G, t.seconds]
800
+ }, null, 40, ta)), [
801
+ [G, a.seconds]
758
802
  ]) : B("", !0),
759
- e.allowMilitaryTime ? B("", !0) : _((d(), f("select", {
803
+ e.allowMilitaryTime ? B("", !0) : F((r(), m("select", {
760
804
  key: 2,
761
805
  ref: "meridiem-selector",
762
- "onUpdate:modelValue": l[10] || (l[10] = (o) => c.value = o),
806
+ "onUpdate:modelValue": l[10] || (l[10] = (f) => u.value = f),
763
807
  class: "aform-select meridiem-selector",
764
808
  onChange: y
765
809
  }, [...l[11] || (l[11] = [
766
- a("option", { value: "AM" }, "AM", -1),
767
- a("option", { value: "PM" }, "PM", -1)
810
+ t("option", { value: "AM" }, "AM", -1),
811
+ t("option", { value: "PM" }, "PM", -1)
768
812
  ])], 544)), [
769
- [Be, c.value]
813
+ [Ue, u.value]
770
814
  ])
771
815
  ])
772
816
  ]));
773
817
  }
774
- }), me = /* @__PURE__ */ H(Wt, [["__scopeId", "data-v-95ad0aa4"]]), Jt = { class: "adate-selection" }, Ot = {
818
+ }), ve = /* @__PURE__ */ N(aa, [["__scopeId", "data-v-95ad0aa4"]]), la = { class: "adate-selection" }, na = {
775
819
  key: 3,
776
820
  class: "empty"
777
- }, Xt = /* @__PURE__ */ R({
821
+ }, oa = /* @__PURE__ */ V({
778
822
  __name: "ADateSelection",
779
823
  props: {
780
824
  showDate: { type: Boolean, default: !0 },
@@ -789,41 +833,41 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
789
833
  useSeconds: { type: Boolean, default: !0 }
790
834
  },
791
835
  emits: ["get-date", "get-time", "get-range"],
792
- setup(e, { emit: u }) {
793
- const n = u;
794
- Re("select-range", e.selectRange);
795
- const r = /* @__PURE__ */ new Date(), t = T(r), c = T(r), y = T(0), k = T(0), h = (l, o) => {
796
- const i = new Date(l);
797
- return i.setHours(0, 0, 0, 0), new Date(i.getTime() + o);
798
- }, v = (l) => {
799
- let o;
836
+ setup(e, { emit: o }) {
837
+ const n = o;
838
+ Ee("select-range", e.selectRange);
839
+ const i = /* @__PURE__ */ new Date(), a = p(i), u = p(i), y = p(0), g = p(0), h = (l, f) => {
840
+ const c = new Date(l);
841
+ return c.setHours(0, 0, 0, 0), new Date(c.getTime() + f);
842
+ }, s = (l) => {
843
+ let f;
800
844
  if (l.militaryTime !== void 0)
801
- o = l.militaryTime;
845
+ f = l.militaryTime;
802
846
  else {
803
- const i = l.hours % 12;
804
- o = l.meridiem === "PM" ? i + 12 : i;
847
+ const c = l.hours % 12;
848
+ f = l.meridiem === "PM" ? c + 12 : c;
805
849
  }
806
- return (o * 3600 + l.minutes * 60 + (l.seconds ?? 0)) * 1e3;
850
+ return (f * 3600 + l.minutes * 60 + (l.seconds ?? 0)) * 1e3;
807
851
  }, x = (l) => {
808
852
  !e.selectRange || !e.showTime || !e.showEndTime || n("get-range", {
809
- start: h(t.value, y.value),
810
- end: h(c.value, k.value),
853
+ start: h(a.value, y.value),
854
+ end: h(u.value, g.value),
811
855
  source: l
812
856
  });
813
857
  }, $ = (l) => {
814
- n("get-date", l), e.selectRange && (t.value = l.start ?? l.selected, c.value = l.end ?? l.selected, x("user"));
815
- }, S = (l) => {
816
- y.value = v(l), e.showEndTime ? x(l.source ?? "user") : n("get-time", l);
817
- }, s = (l) => {
818
- k.value = v(l), x(l.source ?? "user");
858
+ n("get-date", l), e.selectRange && (a.value = l.start ?? l.selected, u.value = l.end ?? l.selected, x("user"));
859
+ }, A = (l) => {
860
+ y.value = s(l), e.showEndTime ? x(l.source ?? "user") : n("get-time", l);
861
+ }, d = (l) => {
862
+ g.value = s(l), x(l.source ?? "user");
819
863
  };
820
- return (l, o) => (d(), f("div", Jt, [
821
- e.showDate ? (d(), ee(Te, {
864
+ return (l, f) => (r(), m("div", la, [
865
+ e.showDate ? (r(), ee(pe, {
822
866
  key: 0,
823
867
  "select-range": e.selectRange,
824
868
  onGetDate: $
825
869
  }, null, 8, ["select-range"])) : B("", !0),
826
- e.showTime ? (d(), ee(me, {
870
+ e.showTime ? (r(), ee(ve, {
827
871
  key: 1,
828
872
  "allow-military-time": e.allowMilitaryTime,
829
873
  "default-hours": e.defaultHours,
@@ -831,26 +875,26 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
831
875
  "default-seconds": e.defaultSeconds,
832
876
  "default-meridiem": e.defaultMeridiem,
833
877
  "use-seconds": e.useSeconds,
834
- onGetTime: S
878
+ onGetTime: A
835
879
  }, null, 8, ["allow-military-time", "default-hours", "default-minutes", "default-seconds", "default-meridiem", "use-seconds"])) : B("", !0),
836
- e.selectRange && e.showTime && e.showEndTime ? (d(), f(p, { key: 2 }, [
837
- o[0] || (o[0] = a("div", { class: "adate-selection__end-label" }, "End time", -1)),
838
- oe(me, {
880
+ e.selectRange && e.showTime && e.showEndTime ? (r(), m(L, { key: 2 }, [
881
+ f[0] || (f[0] = t("div", { class: "adate-selection__end-label" }, "End time", -1)),
882
+ ie(ve, {
839
883
  "allow-military-time": e.allowMilitaryTime,
840
884
  "default-hours": e.defaultHours,
841
885
  "default-minutes": e.defaultMinutes,
842
886
  "default-seconds": e.defaultSeconds,
843
887
  "default-meridiem": e.defaultMeridiem,
844
888
  "use-seconds": e.useSeconds,
845
- onGetTime: s
889
+ onGetTime: d
846
890
  }, null, 8, ["allow-military-time", "default-hours", "default-minutes", "default-seconds", "default-meridiem", "use-seconds"])
847
891
  ], 64)) : B("", !0),
848
- !e.showTime && !e.showDate ? (d(), f("p", Ot, "empty")) : B("", !0)
892
+ !e.showTime && !e.showDate ? (r(), m("p", na, "empty")) : B("", !0)
849
893
  ]));
850
894
  }
851
- }), ae = /* @__PURE__ */ H(Xt, [["__scopeId", "data-v-602dfd69"]]), Zt = { class: "aform_form-element" }, jt = { class: "aform_display-value" }, ea = { class: "aform_field-label" }, ta = ["id", "disabled", "required"], aa = ["for"], la = ["innerHTML"], na = /* @__PURE__ */ R({
895
+ }), le = /* @__PURE__ */ N(oa, [["__scopeId", "data-v-602dfd69"]]), sa = { class: "aform_form-element" }, ia = { class: "aform_display-value" }, ua = { class: "aform_field-label" }, ra = ["id", "disabled", "required"], da = ["for"], ca = ["innerHTML"], ma = /* @__PURE__ */ V({
852
896
  __name: "ADate",
853
- props: /* @__PURE__ */ K({
897
+ props: /* @__PURE__ */ P({
854
898
  schema: {},
855
899
  label: { default: "Date" },
856
900
  selectRange: { type: Boolean },
@@ -866,53 +910,53 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
866
910
  }),
867
911
  emits: ["update:modelValue"],
868
912
  setup(e) {
869
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue"), r = T(n.value ? new Date(n.value) : /* @__PURE__ */ new Date()), t = I({
870
- get: () => r.value.toISOString().split("T")[0],
871
- set: (v) => {
872
- r.value = new Date(v), n.value = v;
913
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue"), i = p(n.value ? new Date(n.value) : /* @__PURE__ */ new Date()), a = w({
914
+ get: () => i.value.toISOString().split("T")[0],
915
+ set: (s) => {
916
+ i.value = new Date(s), n.value = s;
873
917
  }
874
- }), c = ne("picker"), y = T(!1);
875
- he(c, () => y.value = !1);
876
- const k = () => {
918
+ }), u = oe("picker"), y = p(!1);
919
+ ge(u, () => y.value = !1);
920
+ const g = () => {
877
921
  e.mode !== "read" && (y.value = !y.value);
878
922
  };
879
- O(
923
+ J(
880
924
  () => n.value,
881
- (v) => {
882
- v && (r.value = new Date(v));
925
+ (s) => {
926
+ s && (i.value = new Date(s));
883
927
  }
884
928
  );
885
- const h = (v) => {
886
- r.value = v.selected, n.value = t.value, y.value = !1;
929
+ const h = (s) => {
930
+ i.value = s.selected, n.value = a.value, y.value = !1;
887
931
  };
888
- return (v, x) => (d(), f("div", Zt, [
889
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
890
- a("span", jt, g(n.value ? new Date(t.value).toLocaleDateString() : ""), 1),
891
- a("label", ea, g(e.label), 1)
892
- ], 64)) : (d(), f(p, { key: 1 }, [
893
- _(a("input", {
932
+ return (s, x) => (r(), m("div", sa, [
933
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
934
+ t("span", ia, k(n.value ? new Date(a.value).toLocaleDateString() : ""), 1),
935
+ t("label", ua, k(e.label), 1)
936
+ ], 64)) : (r(), m(L, { key: 1 }, [
937
+ F(t("input", {
894
938
  id: e.uuid,
895
939
  ref: "date",
896
- "onUpdate:modelValue": x[0] || (x[0] = ($) => t.value = $),
940
+ "onUpdate:modelValue": x[0] || (x[0] = ($) => a.value = $),
897
941
  class: "aform_input-field",
898
942
  type: "date",
899
943
  disabled: e.mode === "read",
900
944
  required: e.required,
901
- onClick: k
902
- }, null, 8, ta), [
903
- [G, t.value]
945
+ onClick: g
946
+ }, null, 8, ra), [
947
+ [G, a.value]
904
948
  ]),
905
- a("label", {
949
+ t("label", {
906
950
  class: "aform_field-label",
907
951
  for: e.uuid
908
- }, g(e.label), 9, aa),
909
- _(a("p", {
952
+ }, k(e.label), 9, da),
953
+ F(t("p", {
910
954
  class: "aform_error",
911
- innerHTML: u.value
912
- }, null, 8, la), [
913
- [E, u.value]
955
+ innerHTML: o.value
956
+ }, null, 8, ca), [
957
+ [Q, o.value]
914
958
  ]),
915
- y.value ? (d(), ee(ae, {
959
+ y.value ? (r(), ee(le, {
916
960
  key: 0,
917
961
  ref: "picker",
918
962
  class: "adate-picker",
@@ -923,18 +967,18 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
923
967
  ], 64))
924
968
  ]));
925
969
  }
926
- }), sa = /* @__PURE__ */ H(na, [["__scopeId", "data-v-5de3fe7a"]]), oa = {
927
- key: 0,
928
- class: "input-wrapper"
929
- }, ia = { class: "aform_display-value" }, ua = ["innerHTML"], ra = { class: "input-wrapper" }, da = ["disabled"], ca = {
970
+ }), fa = /* @__PURE__ */ N(ma, [["__scopeId", "data-v-5de3fe7a"]]), va = { class: "aform_form-element" }, ya = {
971
+ key: 1,
972
+ class: "aform_display-value"
973
+ }, ha = { class: "aform_field-label" }, ba = ["disabled"], ga = {
930
974
  id: "autocomplete-results",
931
975
  class: "autocomplete-results"
932
- }, ma = {
976
+ }, ka = {
933
977
  key: 0,
934
978
  class: "loading autocomplete-result"
935
- }, fa = ["onClick"], va = ["innerHTML"], ya = /* @__PURE__ */ R({
979
+ }, $a = ["onClick"], xa = { class: "aform_field-label" }, Da = ["innerHTML"], wa = /* @__PURE__ */ V({
936
980
  __name: "ADropdown",
937
- props: /* @__PURE__ */ K({
981
+ props: /* @__PURE__ */ P({
938
982
  schema: {},
939
983
  label: {},
940
984
  selectRange: { type: Boolean },
@@ -945,6 +989,7 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
945
989
  validation: { default: () => ({ errorMessage: "" }) },
946
990
  errors: {},
947
991
  options: { default: () => [] },
992
+ format: {},
948
993
  isAsync: { type: Boolean, default: !1 },
949
994
  filterFunction: { type: Function, default: void 0 }
950
995
  }, {
@@ -953,108 +998,156 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
953
998
  }),
954
999
  emits: ["update:modelValue"],
955
1000
  setup(e) {
956
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue"), r = T(n.value ?? ""), t = ve({
1001
+ const o = w(() => Be(e.options)), n = w(() => e.format ? ae(e.format) : void 0), i = w(() => Ye(g.value, e.options, n.value)), a = w(() => we(i.value)), u = w(() => we(i.value)), y = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), g = Y(e, "modelValue"), h = p(g.value ?? ""), s = he({
957
1002
  activeItemIndex: null,
958
1003
  open: !1,
959
1004
  loading: !1,
960
- results: e.options
961
- }), c = () => v(), y = async () => {
962
- if (t.open = !0, t.activeItemIndex = null, e.filterFunction) {
963
- e.isAsync && (t.loading = !0);
1005
+ results: []
1006
+ });
1007
+ J(
1008
+ o,
1009
+ (D) => {
1010
+ s.results = D;
1011
+ },
1012
+ { immediate: !0 }
1013
+ );
1014
+ const x = () => l(), $ = async () => {
1015
+ if (s.open = !0, s.activeItemIndex = null, e.filterFunction) {
1016
+ e.isAsync && (s.loading = !0);
964
1017
  try {
965
- const l = await e.filterFunction(n.value || "");
966
- t.results = l || [];
1018
+ const D = await e.filterFunction(g.value || "");
1019
+ s.results = D || [];
967
1020
  } catch {
968
- t.results = [];
1021
+ s.results = [];
969
1022
  } finally {
970
- e.isAsync && (t.loading = !1);
1023
+ e.isAsync && (s.loading = !1);
971
1024
  }
972
1025
  } else
973
- x();
974
- }, k = (l) => {
975
- n.value = l, r.value = l, v(l);
976
- }, h = () => {
977
- const l = e.options?.indexOf(n.value ?? "") ?? -1;
978
- t.activeItemIndex = e.isAsync ? null : l >= 0 ? l : null, t.open = !0, t.results = e.isAsync ? [] : e.options;
979
- }, v = (l) => {
980
- t.activeItemIndex = null, t.open = !1, e.options?.includes(l || n.value || "") || (n.value = r.value);
981
- }, x = () => {
982
- n.value ? t.results = e.options?.filter((l) => l.toLowerCase().includes((n.value ?? "").toLowerCase())) : t.results = e.options;
983
- }, $ = () => {
984
- const l = t.results?.length || 0;
985
- if (t.activeItemIndex != null) {
986
- const o = isNaN(t.activeItemIndex) ? 0 : t.activeItemIndex;
987
- t.activeItemIndex = (o + 1) % l;
1026
+ f();
1027
+ }, A = (D) => {
1028
+ g.value = D, h.value = D, l(D);
1029
+ }, d = () => {
1030
+ const D = o.value.indexOf(g.value ?? "");
1031
+ s.activeItemIndex = e.isAsync ? null : D >= 0 ? D : null, s.open = !0, s.results = e.isAsync ? [] : o.value;
1032
+ }, l = (D) => {
1033
+ s.activeItemIndex = null, s.open = !1, o.value.includes(D || g.value || "") || (g.value = h.value);
1034
+ }, f = () => {
1035
+ g.value ? s.results = o.value.filter((D) => D.toLowerCase().includes((g.value ?? "").toLowerCase())) : s.results = o.value;
1036
+ }, c = () => {
1037
+ const D = s.results?.length || 0;
1038
+ if (s.activeItemIndex != null) {
1039
+ const b = isNaN(s.activeItemIndex) ? 0 : s.activeItemIndex;
1040
+ s.activeItemIndex = (b + 1) % D;
988
1041
  } else
989
- t.activeItemIndex = 0;
990
- }, S = () => {
991
- const l = t.results?.length || 0;
992
- if (t.activeItemIndex != null) {
993
- const o = isNaN(t.activeItemIndex) ? 0 : t.activeItemIndex;
994
- o === 0 ? t.activeItemIndex = null : t.activeItemIndex = o - 1;
1042
+ s.activeItemIndex = 0;
1043
+ }, M = () => {
1044
+ const D = s.results?.length || 0;
1045
+ if (s.activeItemIndex != null) {
1046
+ const b = isNaN(s.activeItemIndex) ? 0 : s.activeItemIndex;
1047
+ b === 0 ? s.activeItemIndex = null : s.activeItemIndex = b - 1;
995
1048
  } else
996
- t.activeItemIndex = l - 1;
997
- }, s = () => {
998
- if (t.results) {
999
- const l = t.activeItemIndex || 0, o = t.results[l];
1000
- k(o);
1049
+ s.activeItemIndex = D - 1;
1050
+ }, v = () => {
1051
+ if (s.results) {
1052
+ const D = s.activeItemIndex || 0, b = s.results[D];
1053
+ A(b);
1001
1054
  }
1002
- t.activeItemIndex = 0;
1055
+ s.activeItemIndex = 0;
1003
1056
  };
1004
- return (l, o) => e.mode === "display" ? (d(), f("div", oa, [
1005
- a("span", ia, g(n.value ?? ""), 1),
1006
- a("label", null, g(e.label), 1),
1007
- _(a("p", {
1008
- class: "aform_error",
1009
- innerHTML: u.value
1010
- }, null, 8, ua), [
1011
- [E, u.value]
1012
- ])
1013
- ])) : _((d(), f("div", {
1014
- key: 1,
1015
- class: Z(["autocomplete", { isOpen: t.open }])
1016
- }, [
1017
- a("div", ra, [
1018
- _(a("input", {
1019
- "onUpdate:modelValue": o[0] || (o[0] = (i) => n.value = i),
1020
- type: "text",
1021
- disabled: e.mode === "read",
1022
- onInput: y,
1023
- onFocus: h,
1024
- onKeydown: [
1025
- F($, ["down"]),
1026
- F(S, ["up"]),
1027
- F(s, ["enter"]),
1028
- F(c, ["esc"]),
1029
- F(c, ["tab"])
1030
- ]
1031
- }, null, 40, da), [
1032
- [G, n.value]
1033
- ]),
1034
- _(a("ul", ca, [
1035
- t.loading ? (d(), f("li", ma, "Loading results...")) : (d(!0), f(p, { key: 1 }, j(t.results, (i, D) => (d(), f("li", {
1036
- key: i,
1037
- class: Z(["autocomplete-result", { "is-active": D === t.activeItemIndex }]),
1038
- onClick: V((m) => k(i), ["stop"])
1039
- }, g(i), 11, fa))), 128))
1040
- ], 512), [
1041
- [E, t.open]
1057
+ return (D, b) => (r(), m("div", va, [
1058
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1059
+ i.value ? (r(), m("span", {
1060
+ key: 0,
1061
+ class: "aform_display-value",
1062
+ style: fe(u.value)
1063
+ }, k(i.value.label), 5)) : (r(), m("span", ya, k(g.value ?? ""), 1)),
1064
+ t("label", ha, k(e.label), 1)
1065
+ ], 64)) : (r(), m(L, { key: 1 }, [
1066
+ F((r(), m("div", {
1067
+ class: Z(["autocomplete", { isOpen: s.open }])
1068
+ }, [
1069
+ F(t("input", {
1070
+ "onUpdate:modelValue": b[0] || (b[0] = (I) => g.value = I),
1071
+ type: "text",
1072
+ class: "aform_input-field",
1073
+ disabled: e.mode === "read",
1074
+ style: fe(a.value),
1075
+ onInput: $,
1076
+ onFocus: d,
1077
+ onKeydown: [
1078
+ q(c, ["down"]),
1079
+ q(M, ["up"]),
1080
+ q(v, ["enter"]),
1081
+ q(x, ["esc"]),
1082
+ q(x, ["tab"])
1083
+ ]
1084
+ }, null, 44, ba), [
1085
+ [G, g.value]
1086
+ ]),
1087
+ F(t("ul", ga, [
1088
+ s.loading ? (r(), m("li", ka, "Loading results...")) : (r(!0), m(L, { key: 1 }, j(s.results, (I, R) => (r(), m("li", {
1089
+ key: I,
1090
+ class: Z(["autocomplete-result", { "is-active": R === s.activeItemIndex }]),
1091
+ onClick: H((z) => A(I), ["stop"])
1092
+ }, k(I), 11, $a))), 128))
1093
+ ], 512), [
1094
+ [Q, s.open]
1095
+ ]),
1096
+ t("label", xa, k(e.label), 1)
1097
+ ], 2)), [
1098
+ [O(be), x]
1042
1099
  ]),
1043
- a("label", null, g(e.label), 1)
1044
- ]),
1045
- _(a("p", {
1046
- class: "aform_error",
1047
- innerHTML: u.value
1048
- }, null, 8, va), [
1049
- [E, u.value]
1050
- ])
1051
- ], 2)), [
1052
- [J(ye), c]
1053
- ]);
1100
+ F(t("p", {
1101
+ class: "aform_error",
1102
+ innerHTML: y.value
1103
+ }, null, 8, Da), [
1104
+ [Q, y.value]
1105
+ ])
1106
+ ], 64))
1107
+ ]));
1054
1108
  }
1055
- }), ha = /* @__PURE__ */ H(ya, [["__scopeId", "data-v-2b75e2d5"]]), ba = { class: "aform_form-element" }, ga = { class: "aform_display-value" }, $a = { class: "aform_field-label" }, ka = ["id", "value", "disabled"], xa = ["for"], Da = ["innerHTML"], wa = /* @__PURE__ */ R({
1109
+ }), Ma = /* @__PURE__ */ N(wa, [["__scopeId", "data-v-11fc3569"]]), Ta = /* @__PURE__ */ V({
1110
+ __name: "ABadge",
1111
+ props: {
1112
+ label: {},
1113
+ variant: {},
1114
+ color: {},
1115
+ presentation: {},
1116
+ value: {},
1117
+ options: {}
1118
+ },
1119
+ setup(e) {
1120
+ const o = e, n = w(() => {
1121
+ if (o.label?.trim())
1122
+ return {
1123
+ label: o.label.trim(),
1124
+ variant: o.variant,
1125
+ color: o.color
1126
+ };
1127
+ if (o.value === null || o.value === void 0 || o.value === "") return;
1128
+ const h = typeof o.value == "string" ? o.value : String(o.value);
1129
+ return ce(o.options, h);
1130
+ }), i = w(() => n.value?.label?.trim() ?? ""), a = w(() => n.value?.variant ?? o.variant ?? "neutral"), u = w(() => n.value?.color ?? o.color), y = w(() => [
1131
+ "abadge",
1132
+ `abadge--${o.presentation ?? "cell-fill"}`,
1133
+ `abadge--${a.value}`
1134
+ ]), g = w(() => {
1135
+ const h = u.value;
1136
+ return h ? {
1137
+ "--sc-badge-bg": h,
1138
+ "--sc-badge-text": h,
1139
+ "--sc-badge-accent": h
1140
+ } : {};
1141
+ });
1142
+ return (h, s) => i.value ? (r(), m("span", {
1143
+ key: 0,
1144
+ class: Z(y.value),
1145
+ style: fe(g.value)
1146
+ }, k(i.value), 7)) : B("", !0);
1147
+ }
1148
+ }), Sa = /* @__PURE__ */ N(Ta, [["__scopeId", "data-v-4f364f5f"]]), Aa = { class: "aform_form-element" }, pa = { class: "aform_display-value" }, Ia = { class: "aform_field-label" }, _a = ["id", "value", "disabled"], La = ["for"], Fa = ["innerHTML"], qa = /* @__PURE__ */ V({
1056
1149
  __name: "ADateTime",
1057
- props: /* @__PURE__ */ K({
1150
+ props: /* @__PURE__ */ P({
1058
1151
  schema: {},
1059
1152
  label: { default: "Date & Time" },
1060
1153
  selectRange: { type: Boolean },
@@ -1072,39 +1165,39 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1072
1165
  }),
1073
1166
  emits: ["update:modelValue"],
1074
1167
  setup(e) {
1075
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue"), r = T(n.value ? new Date(n.value) : /* @__PURE__ */ new Date()), t = T(!1), c = T(null);
1076
- he(c, () => t.value = !1);
1168
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue"), i = p(n.value ? new Date(n.value) : /* @__PURE__ */ new Date()), a = p(!1), u = p(null);
1169
+ ge(u, () => a.value = !1);
1077
1170
  const y = () => {
1078
- e.mode !== "read" && (t.value = !0);
1079
- }, k = I(() => n.value ? r.value.toLocaleString() : ""), h = I(() => k.value), v = I(() => {
1080
- const s = r.value, l = s.getHours(), o = l >= 12 ? "PM" : "AM", i = l % 12 || 12;
1171
+ e.mode !== "read" && (a.value = !0);
1172
+ }, g = w(() => n.value ? i.value.toLocaleString() : ""), h = w(() => g.value), s = w(() => {
1173
+ const d = i.value, l = d.getHours(), f = l >= 12 ? "PM" : "AM", c = l % 12 || 12;
1081
1174
  return {
1082
- hours: e.allowMilitaryTime ? l : i,
1083
- minutes: s.getMinutes(),
1084
- seconds: s.getSeconds(),
1085
- meridiem: o
1175
+ hours: e.allowMilitaryTime ? l : c,
1176
+ minutes: d.getMinutes(),
1177
+ seconds: d.getSeconds(),
1178
+ meridiem: f
1086
1179
  };
1087
1180
  }), x = () => {
1088
- n.value = r.value.toISOString();
1089
- }, $ = (s) => {
1090
- const l = new Date(r.value);
1091
- l.setFullYear(s.selected.getFullYear(), s.selected.getMonth(), s.selected.getDate()), r.value = l, x();
1092
- }, S = (s) => {
1093
- if (s.source === "init") return;
1094
- const l = new Date(r.value), o = s.militaryTime ?? s.hours;
1095
- l.setHours(o, s.minutes, e.useSeconds ? s.seconds : 0, 0), r.value = l, x();
1181
+ n.value = i.value.toISOString();
1182
+ }, $ = (d) => {
1183
+ const l = new Date(i.value);
1184
+ l.setFullYear(d.selected.getFullYear(), d.selected.getMonth(), d.selected.getDate()), i.value = l, x();
1185
+ }, A = (d) => {
1186
+ if (d.source === "init") return;
1187
+ const l = new Date(i.value), f = d.militaryTime ?? d.hours;
1188
+ l.setHours(f, d.minutes, e.useSeconds ? d.seconds : 0, 0), i.value = l, x();
1096
1189
  };
1097
- return O(
1190
+ return J(
1098
1191
  () => n.value,
1099
- (s) => {
1100
- s && (r.value = new Date(s));
1192
+ (d) => {
1193
+ d && (i.value = new Date(d));
1101
1194
  }
1102
- ), (s, l) => (d(), f("div", ba, [
1103
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1104
- a("span", ga, g(k.value), 1),
1105
- a("label", $a, g(e.label), 1)
1106
- ], 64)) : (d(), f(p, { key: 1 }, [
1107
- a("input", {
1195
+ ), (d, l) => (r(), m("div", Aa, [
1196
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1197
+ t("span", pa, k(g.value), 1),
1198
+ t("label", Ia, k(e.label), 1)
1199
+ ], 64)) : (r(), m(L, { key: 1 }, [
1200
+ t("input", {
1108
1201
  id: e.uuid,
1109
1202
  class: "aform_input-field",
1110
1203
  type: "text",
@@ -1113,43 +1206,43 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1113
1206
  disabled: e.mode === "read",
1114
1207
  readonly: "",
1115
1208
  onClick: y
1116
- }, null, 8, ka),
1117
- a("label", {
1209
+ }, null, 8, _a),
1210
+ t("label", {
1118
1211
  class: "aform_field-label",
1119
1212
  for: e.uuid
1120
- }, g(e.label), 9, xa),
1121
- _(a("p", {
1213
+ }, k(e.label), 9, La),
1214
+ F(t("p", {
1122
1215
  class: "aform_error",
1123
- innerHTML: u.value
1124
- }, null, 8, Da), [
1125
- [E, u.value]
1216
+ innerHTML: o.value
1217
+ }, null, 8, Fa), [
1218
+ [Q, o.value]
1126
1219
  ]),
1127
- t.value ? (d(), ee(ae, {
1220
+ a.value ? (r(), ee(le, {
1128
1221
  key: 0,
1129
1222
  ref_key: "pickerRef",
1130
- ref: c,
1223
+ ref: u,
1131
1224
  class: "adatetime-picker",
1132
1225
  "select-range": !1,
1133
1226
  "show-date": !0,
1134
1227
  "show-time": !0,
1135
- "default-hours": v.value.hours,
1136
- "default-minutes": v.value.minutes,
1137
- "default-seconds": v.value.seconds,
1138
- "default-meridiem": v.value.meridiem,
1228
+ "default-hours": s.value.hours,
1229
+ "default-minutes": s.value.minutes,
1230
+ "default-seconds": s.value.seconds,
1231
+ "default-meridiem": s.value.meridiem,
1139
1232
  "allow-military-time": e.allowMilitaryTime,
1140
1233
  "use-seconds": e.useSeconds,
1141
1234
  onGetDate: $,
1142
- onGetTime: S
1235
+ onGetTime: A
1143
1236
  }, null, 8, ["default-hours", "default-minutes", "default-seconds", "default-meridiem", "allow-military-time", "use-seconds"])) : B("", !0)
1144
1237
  ], 64))
1145
1238
  ]));
1146
1239
  }
1147
- }), Ma = /* @__PURE__ */ H(wa, [["__scopeId", "data-v-b0fa488b"]]), Ta = { class: "aduration" }, Sa = { class: "aform_display-value" }, Ia = { class: "aduration__footer" }, Aa = {
1240
+ }), Ba = /* @__PURE__ */ N(qa, [["__scopeId", "data-v-b0fa488b"]]), Ca = { class: "aduration" }, Va = { class: "aform_display-value" }, Ra = { class: "aduration__footer" }, Na = {
1148
1241
  key: 0,
1149
1242
  class: "aduration__summary"
1150
- }, pa = { class: "aduration__value" }, _a = { class: "aduration__ms" }, La = /* @__PURE__ */ R({
1243
+ }, Ha = { class: "aduration__value" }, Ua = { class: "aduration__ms" }, Ea = /* @__PURE__ */ V({
1151
1244
  __name: "ADuration",
1152
- props: /* @__PURE__ */ K({
1245
+ props: /* @__PURE__ */ P({
1153
1246
  label: { default: "Duration" },
1154
1247
  mode: { default: "edit" },
1155
1248
  allowMilitaryTime: { type: Boolean, default: !1 },
@@ -1160,55 +1253,55 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1160
1253
  }),
1161
1254
  emits: ["update:modelValue"],
1162
1255
  setup(e) {
1163
- const u = Y(e, "modelValue"), n = T(null), r = T(null), t = I(() => {
1164
- if (!n.value || !r.value) return 0;
1165
- const h = r.value.getTime() - n.value.getTime();
1256
+ const o = Y(e, "modelValue"), n = p(null), i = p(null), a = w(() => {
1257
+ if (!n.value || !i.value) return 0;
1258
+ const h = i.value.getTime() - n.value.getTime();
1166
1259
  return h > 0 ? h : 0;
1167
1260
  });
1168
- O(t, (h) => {
1169
- u.value = h;
1261
+ J(a, (h) => {
1262
+ o.value = h;
1170
1263
  });
1171
- const c = (h) => {
1172
- h.source !== "init" && (n.value = h.start, r.value = h.end, u.value = t.value);
1173
- }, y = I(() => {
1174
- const h = t.value;
1264
+ const u = (h) => {
1265
+ h.source !== "init" && (n.value = h.start, i.value = h.end, o.value = a.value);
1266
+ }, y = w(() => {
1267
+ const h = a.value;
1175
1268
  if (h === 0) return "0s";
1176
- const v = Math.floor(h / 1e3) % 60, x = Math.floor(h / 6e4) % 60, $ = Math.floor(h / 36e5) % 24, S = Math.floor(h / 864e5);
1177
- return [S && `${S}d`, $ && `${$}h`, x && `${x}m`, v && `${v}s`].filter(Boolean).join(" ") || "0s";
1178
- }), k = I(() => {
1179
- const h = u.value;
1269
+ const s = Math.floor(h / 1e3) % 60, x = Math.floor(h / 6e4) % 60, $ = Math.floor(h / 36e5) % 24, A = Math.floor(h / 864e5);
1270
+ return [A && `${A}d`, $ && `${$}h`, x && `${x}m`, s && `${s}s`].filter(Boolean).join(" ") || "0s";
1271
+ }), g = w(() => {
1272
+ const h = o.value;
1180
1273
  if (!h) return "—";
1181
- const v = Math.floor(h / 1e3) % 60, x = Math.floor(h / 6e4) % 60, $ = Math.floor(h / 36e5) % 24, S = Math.floor(h / 864e5);
1182
- return [S && `${S}d`, $ && `${$}h`, x && `${x}m`, v && `${v}s`].filter(Boolean).join(" ") || "0s";
1274
+ const s = Math.floor(h / 1e3) % 60, x = Math.floor(h / 6e4) % 60, $ = Math.floor(h / 36e5) % 24, A = Math.floor(h / 864e5);
1275
+ return [A && `${A}d`, $ && `${$}h`, x && `${x}m`, s && `${s}s`].filter(Boolean).join(" ") || "0s";
1183
1276
  });
1184
- return (h, v) => (d(), f("div", Ta, [
1185
- e.mode === "display" || e.mode === "read" ? (d(), f(p, { key: 0 }, [
1186
- a("span", Sa, g(k.value), 1),
1187
- a("label", null, g(e.label), 1)
1188
- ], 64)) : (d(), f(p, { key: 1 }, [
1189
- oe(ae, {
1277
+ return (h, s) => (r(), m("div", Ca, [
1278
+ e.mode === "display" || e.mode === "read" ? (r(), m(L, { key: 0 }, [
1279
+ t("span", Va, k(g.value), 1),
1280
+ t("label", null, k(e.label), 1)
1281
+ ], 64)) : (r(), m(L, { key: 1 }, [
1282
+ ie(le, {
1190
1283
  ref: "selectionRef",
1191
1284
  "select-range": !0,
1192
1285
  "show-time": !0,
1193
1286
  "show-end-time": !0,
1194
1287
  "allow-military-time": e.allowMilitaryTime,
1195
1288
  "use-seconds": e.useSeconds,
1196
- onGetRange: c
1289
+ onGetRange: u
1197
1290
  }, null, 8, ["allow-military-time", "use-seconds"]),
1198
- a("div", Ia, [
1199
- a("label", null, g(e.label), 1),
1200
- n.value && r.value ? (d(), f("div", Aa, [
1201
- v[0] || (v[0] = a("span", { class: "aduration__label" }, "Duration:", -1)),
1202
- a("span", pa, g(y.value), 1),
1203
- a("span", _a, "(" + g(u.value ?? 0) + " ms)", 1)
1291
+ t("div", Ra, [
1292
+ t("label", null, k(e.label), 1),
1293
+ n.value && i.value ? (r(), m("div", Na, [
1294
+ s[0] || (s[0] = t("span", { class: "aduration__label" }, "Duration:", -1)),
1295
+ t("span", Ha, k(y.value), 1),
1296
+ t("span", Ua, "(" + k(o.value ?? 0) + " ms)", 1)
1204
1297
  ])) : B("", !0)
1205
1298
  ])
1206
1299
  ], 64))
1207
1300
  ]));
1208
1301
  }
1209
- }), qa = /* @__PURE__ */ H(La, [["__scopeId", "data-v-2e4dd7dd"]]), Fa = { class: "aform_form-element" }, Ca = { class: "aform_display-value" }, Ba = { class: "aform_field-label" }, Ra = ["id", "value", "disabled"], Va = ["for"], Ha = ["innerHTML"], Na = /* @__PURE__ */ R({
1302
+ }), Pa = /* @__PURE__ */ N(Ea, [["__scopeId", "data-v-2e4dd7dd"]]), Ka = { class: "aform_form-element" }, Qa = { class: "aform_display-value" }, Ya = { class: "aform_field-label" }, Ga = ["id", "value", "disabled"], za = ["for"], Wa = ["innerHTML"], Ja = /* @__PURE__ */ V({
1210
1303
  __name: "ADateRange",
1211
- props: /* @__PURE__ */ K({
1304
+ props: /* @__PURE__ */ P({
1212
1305
  schema: {},
1213
1306
  label: { default: "Date Range" },
1214
1307
  selectRange: { type: Boolean },
@@ -1226,39 +1319,39 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1226
1319
  }),
1227
1320
  emits: ["update:modelValue"],
1228
1321
  setup(e) {
1229
- const u = (i) => new Date(i).toLocaleDateString(), n = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), r = Y(e, "modelValue"), t = T(r.value.start_date ? new Date(r.value.start_date) : null), c = T(r.value.end_date ? new Date(r.value.end_date) : null), y = T(!1), k = T(null);
1230
- he(k, () => y.value = !1);
1322
+ const o = (c) => new Date(c).toLocaleDateString(), n = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), i = Y(e, "modelValue"), a = p(i.value.start_date ? new Date(i.value.start_date) : null), u = p(i.value.end_date ? new Date(i.value.end_date) : null), y = p(!1), g = p(null);
1323
+ ge(g, () => y.value = !1);
1231
1324
  const h = () => {
1232
1325
  e.mode !== "read" && (y.value = !0);
1233
- }, v = (i) => i ? `${i.getMonth() + 1}/${i.getDate()}/${i.getFullYear()}` : "", x = I(() => {
1234
- const i = v(t.value), D = v(c.value);
1235
- return i && D ? `${i} — ${D}` : i ? `${i} — ...` : "";
1236
- }), $ = I(() => {
1237
- const i = r.value.start_date, D = r.value.end_date;
1238
- return !i && !D ? "" : i && D ? `${u(i)} — ${u(D)}` : i ? `From ${u(i)}` : `Until ${u(D)}`;
1239
- }), S = () => {
1240
- const i = t.value, D = c.value;
1241
- i && D && D.getTime() < i.getTime() && ([t.value, c.value] = [D, i]);
1242
- }, s = (i) => i ? i.toISOString().split("T")[0] : null, l = () => {
1243
- r.value = {
1244
- start_date: s(t.value),
1245
- end_date: s(c.value)
1326
+ }, s = (c) => c ? `${c.getMonth() + 1}/${c.getDate()}/${c.getFullYear()}` : "", x = w(() => {
1327
+ const c = s(a.value), M = s(u.value);
1328
+ return c && M ? `${c} — ${M}` : c ? `${c} — ...` : "";
1329
+ }), $ = w(() => {
1330
+ const c = i.value.start_date, M = i.value.end_date;
1331
+ return !c && !M ? "" : c && M ? `${o(c)} — ${o(M)}` : c ? `From ${o(c)}` : `Until ${o(M)}`;
1332
+ }), A = () => {
1333
+ const c = a.value, M = u.value;
1334
+ c && M && M.getTime() < c.getTime() && ([a.value, u.value] = [M, c]);
1335
+ }, d = (c) => c ? c.toISOString().split("T")[0] : null, l = () => {
1336
+ i.value = {
1337
+ start_date: d(a.value),
1338
+ end_date: d(u.value)
1246
1339
  };
1247
- }, o = (i) => {
1248
- i.start && (t.value = i.start), i.end && (c.value = i.end, S(), y.value = !1), l();
1340
+ }, f = (c) => {
1341
+ c.start && (a.value = c.start), c.end && (u.value = c.end, A(), y.value = !1), l();
1249
1342
  };
1250
- return O(
1251
- () => r.value,
1252
- (i) => {
1253
- t.value = i.start_date ? new Date(i.start_date) : null, c.value = i.end_date ? new Date(i.end_date) : null;
1343
+ return J(
1344
+ () => i.value,
1345
+ (c) => {
1346
+ a.value = c.start_date ? new Date(c.start_date) : null, u.value = c.end_date ? new Date(c.end_date) : null;
1254
1347
  },
1255
1348
  { deep: !0 }
1256
- ), (i, D) => (d(), f("div", Fa, [
1257
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1258
- a("span", Ca, g($.value), 1),
1259
- a("label", Ba, g(e.label), 1)
1260
- ], 64)) : (d(), f(p, { key: 1 }, [
1261
- a("input", {
1349
+ ), (c, M) => (r(), m("div", Ka, [
1350
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1351
+ t("span", Qa, k($.value), 1),
1352
+ t("label", Ya, k(e.label), 1)
1353
+ ], 64)) : (r(), m(L, { key: 1 }, [
1354
+ t("input", {
1262
1355
  id: e.uuid,
1263
1356
  class: "aform_input-field",
1264
1357
  type: "text",
@@ -1267,38 +1360,38 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1267
1360
  disabled: e.mode === "read",
1268
1361
  readonly: "",
1269
1362
  onClick: h
1270
- }, null, 8, Ra),
1271
- a("label", {
1363
+ }, null, 8, Ga),
1364
+ t("label", {
1272
1365
  class: "aform_field-label",
1273
1366
  for: e.uuid
1274
- }, g(e.label), 9, Va),
1275
- _(a("p", {
1367
+ }, k(e.label), 9, za),
1368
+ F(t("p", {
1276
1369
  class: "aform_error",
1277
1370
  innerHTML: n.value
1278
- }, null, 8, Ha), [
1279
- [E, n.value]
1371
+ }, null, 8, Wa), [
1372
+ [Q, n.value]
1280
1373
  ]),
1281
- y.value ? (d(), ee(ae, {
1374
+ y.value ? (r(), ee(le, {
1282
1375
  key: 0,
1283
1376
  ref_key: "pickerRef",
1284
- ref: k,
1377
+ ref: g,
1285
1378
  class: "adaterange-picker",
1286
1379
  "select-range": !0,
1287
1380
  "show-time": !1,
1288
- onGetDate: o
1381
+ onGetDate: f
1289
1382
  }, null, 512)) : B("", !0)
1290
1383
  ], 64))
1291
1384
  ]));
1292
1385
  }
1293
- }), Ua = /* @__PURE__ */ H(Na, [["__scopeId", "data-v-f8dad4d3"]]), Pa = { class: "aform" }, Ea = {
1386
+ }), Oa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-f8dad4d3"]]), Xa = { class: "aform" }, Za = {
1294
1387
  key: 0,
1295
1388
  class: "aform-nested-section"
1296
- }, Ka = {
1389
+ }, ja = {
1297
1390
  key: 0,
1298
1391
  class: "aform-nested-label"
1299
- }, Qa = /* @__PURE__ */ R({
1392
+ }, el = /* @__PURE__ */ V({
1300
1393
  __name: "AForm",
1301
- props: /* @__PURE__ */ K({
1394
+ props: /* @__PURE__ */ P({
1302
1395
  schema: {},
1303
1396
  mode: { default: "edit" },
1304
1397
  errors: {}
@@ -1306,84 +1399,84 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1306
1399
  data: { required: !0 },
1307
1400
  dataModifiers: {}
1308
1401
  }),
1309
- emits: /* @__PURE__ */ K(["update:schema", "update:data"], ["update:data"]),
1310
- setup(e, { emit: u }) {
1311
- const n = u, r = Y(e, "data"), t = (s) => (s.kind === "link" || s.kind === "fieldset") && "schema" in s && Array.isArray(s.schema) && s.schema.length > 0, c = T({});
1312
- O(
1313
- () => r.value,
1314
- (s) => {
1315
- !e.schema || !s || e.schema.forEach((l) => {
1316
- t(l) && (c.value[l.fieldname] = s[l.fieldname] ?? {});
1402
+ emits: /* @__PURE__ */ P(["update:schema", "update:data"], ["update:data"]),
1403
+ setup(e, { emit: o }) {
1404
+ const n = o, i = Y(e, "data"), a = (d) => (d.kind === "link" || d.kind === "fieldset") && "schema" in d && Array.isArray(d.schema) && d.schema.length > 0, u = p({});
1405
+ J(
1406
+ () => i.value,
1407
+ (d) => {
1408
+ !e.schema || !d || e.schema.forEach((l) => {
1409
+ a(l) && (u.value[l.fieldname] = d[l.fieldname] ?? {});
1317
1410
  });
1318
1411
  },
1319
1412
  { immediate: !0 }
1320
1413
  );
1321
- const y = (s, l) => {
1322
- c.value[s] = l, r.value && (r.value[s] = l, n("update:data", { ...r.value }));
1323
- }, k = (s) => {
1414
+ const y = (d, l) => {
1415
+ u.value[d] = l, i.value && (i.value[d] = l, n("update:data", { ...i.value }));
1416
+ }, g = (d) => {
1324
1417
  const l = {};
1325
- for (const [o, i] of Object.entries(s))
1326
- ["component", "primaryKey", "computed", "language", "hidden", "mode", "width"].includes(o) || (l[o] = i);
1327
- return s.kind === "table" && (l.rows = r.value[s.fieldname] || []), l;
1328
- }, h = (s) => {
1329
- if (s.kind !== "field") return {};
1330
- const l = s.width;
1418
+ for (const [f, c] of Object.entries(d))
1419
+ ["component", "primaryKey", "computed", "language", "hidden", "mode", "width"].includes(f) || (l[f] = c);
1420
+ return d.kind === "table" && (l.rows = i.value[d.fieldname] || []), l;
1421
+ }, h = (d) => {
1422
+ if (d.kind !== "field") return {};
1423
+ const l = d.width;
1331
1424
  return l ? { flexBasis: l, width: l } : {};
1332
- }, v = I(() => e.mode ?? "edit");
1333
- function x(s) {
1334
- const l = s.mode;
1335
- return l || v.value;
1425
+ }, s = w(() => e.mode ?? "edit");
1426
+ function x(d) {
1427
+ const l = d.mode;
1428
+ return l || s.value;
1336
1429
  }
1337
- const $ = T([]);
1338
- Ve(() => {
1339
- e.schema && $.value.length !== e.schema.length && ($.value = e.schema.map((s, l) => I({
1430
+ const $ = p([]);
1431
+ Pe(() => {
1432
+ e.schema && $.value.length !== e.schema.length && ($.value = e.schema.map((d, l) => w({
1340
1433
  get() {
1341
- return r.value?.[e.schema[l].fieldname];
1434
+ return i.value?.[e.schema[l].fieldname];
1342
1435
  },
1343
- set: (o) => {
1344
- const i = e.schema[l].fieldname;
1345
- i && r.value && (r.value[i] = o, n("update:data", { ...r.value })), n("update:schema", e.schema);
1436
+ set: (f) => {
1437
+ const c = e.schema[l].fieldname;
1438
+ c && i.value && (i.value[c] = f, n("update:data", { ...i.value })), n("update:schema", e.schema);
1346
1439
  }
1347
1440
  })));
1348
1441
  });
1349
- const S = I(() => $.value);
1350
- return (s, l) => (d(), f("form", Pa, [
1351
- (d(!0), f(p, null, j(e.schema, (o, i) => (d(), f(p, { key: i }, [
1352
- t(o) ? (d(), f("div", Ea, [
1353
- o.label && o.kind !== "fieldset" ? (d(), f("h4", Ka, g(o.label), 1)) : B("", !0),
1354
- (d(), ee(ke(o.component ?? "AForm"), {
1355
- data: c.value[o.fieldname],
1356
- mode: x(o),
1357
- schema: o.schema,
1358
- label: o.label,
1359
- collapsible: o.kind === "fieldset" ? o.collapsible : void 0,
1442
+ const A = w(() => $.value);
1443
+ return (d, l) => (r(), m("form", Xa, [
1444
+ (r(!0), m(L, null, j(e.schema, (f, c) => (r(), m(L, { key: c }, [
1445
+ a(f) ? (r(), m("div", Za, [
1446
+ f.label && f.kind !== "fieldset" ? (r(), m("h4", ja, k(f.label), 1)) : B("", !0),
1447
+ (r(), ee(De(f.component ?? "AForm"), {
1448
+ data: u.value[f.fieldname],
1449
+ mode: x(f),
1450
+ schema: f.schema,
1451
+ label: f.label,
1452
+ collapsible: f.kind === "fieldset" ? f.collapsible : void 0,
1360
1453
  errors: e.errors,
1361
- "onUpdate:data": (D) => y(o.fieldname, D)
1454
+ "onUpdate:data": (M) => y(f.fieldname, M)
1362
1455
  }, null, 40, ["data", "mode", "schema", "label", "collapsible", "errors", "onUpdate:data"]))
1363
- ])) : o.hidden ? B("", !0) : (d(), ee(ke(o.component), He({
1456
+ ])) : f.hidden ? B("", !0) : (r(), ee(De(f.component), Ke({
1364
1457
  key: 1,
1365
- modelValue: S.value[i].value,
1366
- "onUpdate:modelValue": (D) => S.value[i].value = D,
1367
- style: h(o),
1368
- schema: o,
1369
- data: r.value[o.fieldname],
1370
- mode: x(o),
1371
- errors: e.errors?.[o.fieldname]
1372
- }, { ref_for: !0 }, k(o)), null, 16, ["modelValue", "onUpdate:modelValue", "style", "schema", "data", "mode", "errors"]))
1458
+ modelValue: A.value[c].value,
1459
+ "onUpdate:modelValue": (M) => A.value[c].value = M,
1460
+ style: h(f),
1461
+ schema: f,
1462
+ data: i.value[f.fieldname],
1463
+ mode: x(f),
1464
+ errors: e.errors?.[f.fieldname]
1465
+ }, { ref_for: !0 }, g(f)), null, 16, ["modelValue", "onUpdate:modelValue", "style", "schema", "data", "mode", "errors"]))
1373
1466
  ], 64))), 128))
1374
1467
  ]));
1375
1468
  }
1376
- }), Se = /* @__PURE__ */ H(Qa, [["__scopeId", "data-v-bb17171c"]]), Ya = /* @__PURE__ */ R({
1469
+ }), Ie = /* @__PURE__ */ N(el, [["__scopeId", "data-v-bb17171c"]]), tl = /* @__PURE__ */ V({
1377
1470
  __name: "CollapseButton",
1378
1471
  props: {
1379
1472
  collapsed: { type: Boolean }
1380
1473
  },
1381
1474
  setup(e) {
1382
- return (u, n) => (d(), f("button", {
1475
+ return (o, n) => (r(), m("button", {
1383
1476
  class: Z(["collapse-button", e.collapsed ? "rotated" : "unrotated"])
1384
1477
  }, "×", 2));
1385
1478
  }
1386
- }), Ga = /* @__PURE__ */ H(Ya, [["__scopeId", "data-v-6f1c1b45"]]), za = /* @__PURE__ */ R({
1479
+ }), al = /* @__PURE__ */ N(tl, [["__scopeId", "data-v-6f1c1b45"]]), ll = /* @__PURE__ */ V({
1387
1480
  __name: "AFieldset",
1388
1481
  props: {
1389
1482
  schema: {},
@@ -1393,44 +1486,44 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1393
1486
  data: { default: () => ({}) },
1394
1487
  mode: { default: "edit" }
1395
1488
  },
1396
- setup(e, { expose: u }) {
1397
- const n = T(!1), r = T(e.data || []), t = T(e.schema), c = (y) => {
1489
+ setup(e, { expose: o }) {
1490
+ const n = p(!1), i = p(e.data || []), a = p(e.schema), u = (y) => {
1398
1491
  y.preventDefault(), e.collapsible && (n.value = !n.value);
1399
1492
  };
1400
- return u({ collapsed: n }), (y, k) => (d(), f("fieldset", null, [
1401
- e.label || e.collapsible ? (d(), f("legend", {
1493
+ return o({ collapsed: n }), (y, g) => (r(), m("fieldset", null, [
1494
+ e.label || e.collapsible ? (r(), m("legend", {
1402
1495
  key: 0,
1403
- onClick: c,
1404
- onSubmit: c
1496
+ onClick: u,
1497
+ onSubmit: u
1405
1498
  }, [
1406
- se(g(e.label) + " ", 1),
1407
- e.collapsible ? (d(), ee(Ga, {
1499
+ se(k(e.label) + " ", 1),
1500
+ e.collapsible ? (r(), ee(al, {
1408
1501
  key: 0,
1409
1502
  collapsed: n.value
1410
1503
  }, null, 8, ["collapsed"])) : B("", !0)
1411
1504
  ], 32)) : B("", !0),
1412
- fe(y.$slots, "default", { collapsed: n.value }, () => [
1413
- _(oe(Se, {
1414
- data: r.value,
1415
- "onUpdate:data": k[0] || (k[0] = (h) => r.value = h),
1416
- schema: t.value,
1505
+ ye(y.$slots, "default", { collapsed: n.value }, () => [
1506
+ F(ie(Ie, {
1507
+ data: i.value,
1508
+ "onUpdate:data": g[0] || (g[0] = (h) => i.value = h),
1509
+ schema: a.value,
1417
1510
  mode: e.mode
1418
1511
  }, null, 8, ["data", "schema", "mode"]), [
1419
- [E, !n.value]
1512
+ [Q, !n.value]
1420
1513
  ])
1421
1514
  ], !0)
1422
1515
  ]));
1423
1516
  }
1424
- }), Wa = /* @__PURE__ */ H(za, [["__scopeId", "data-v-162e7317"]]), Ja = { class: "aform_form-element aform_file-attach aform__grid--full" }, Oa = {
1517
+ }), nl = /* @__PURE__ */ N(ll, [["__scopeId", "data-v-162e7317"]]), ol = { class: "aform_form-element aform_file-attach aform__grid--full" }, sl = {
1425
1518
  key: 0,
1426
1519
  class: "aform_file-attach-feedback"
1427
- }, Xa = {
1520
+ }, il = {
1428
1521
  key: 1,
1429
1522
  class: "aform_display-value"
1430
- }, Za = {
1523
+ }, ul = {
1431
1524
  key: 0,
1432
1525
  class: "aform_file-attach-feedback"
1433
- }, ja = ["disabled"], el = ["disabled"], tl = /* @__PURE__ */ R({
1526
+ }, rl = ["disabled"], dl = ["disabled"], cl = /* @__PURE__ */ V({
1434
1527
  __name: "AFileAttach",
1435
1528
  props: {
1436
1529
  schema: {},
@@ -1444,48 +1537,48 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1444
1537
  errors: {}
1445
1538
  },
1446
1539
  setup(e) {
1447
- const { files: u, open: n, reset: r, onChange: t } = Ne(), c = I(() => {
1448
- const y = u.value?.length ?? 0;
1540
+ const { files: o, open: n, reset: i, onChange: a } = Qe(), u = w(() => {
1541
+ const y = o.value?.length ?? 0;
1449
1542
  return `${y} ${y === 1 ? "file" : "files"}`;
1450
1543
  });
1451
- return t((y) => y), (y, k) => (d(), f("div", Ja, [
1452
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1453
- J(u) ? (d(), f("div", Oa, [
1454
- a("p", null, [
1455
- a("b", null, g(c.value), 1)
1544
+ return a((y) => y), (y, g) => (r(), m("div", ol, [
1545
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1546
+ O(o) ? (r(), m("div", sl, [
1547
+ t("p", null, [
1548
+ t("b", null, k(u.value), 1)
1456
1549
  ]),
1457
- (d(!0), f(p, null, j(J(u), (h) => (d(), f("li", {
1550
+ (r(!0), m(L, null, j(O(o), (h) => (r(), m("li", {
1458
1551
  key: h.name
1459
- }, g(h.name), 1))), 128))
1460
- ])) : (d(), f("span", Xa, "No file selected"))
1461
- ], 64)) : (d(), f(p, { key: 1 }, [
1462
- J(u) ? (d(), f("div", Za, [
1463
- a("p", null, [
1464
- k[2] || (k[2] = se(" You have selected: ", -1)),
1465
- a("b", null, g(c.value), 1)
1552
+ }, k(h.name), 1))), 128))
1553
+ ])) : (r(), m("span", il, "No file selected"))
1554
+ ], 64)) : (r(), m(L, { key: 1 }, [
1555
+ O(o) ? (r(), m("div", ul, [
1556
+ t("p", null, [
1557
+ g[2] || (g[2] = se(" You have selected: ", -1)),
1558
+ t("b", null, k(u.value), 1)
1466
1559
  ]),
1467
- (d(!0), f(p, null, j(J(u), (h) => (d(), f("li", {
1560
+ (r(!0), m(L, null, j(O(o), (h) => (r(), m("li", {
1468
1561
  key: h.name
1469
- }, g(h.name), 1))), 128))
1562
+ }, k(h.name), 1))), 128))
1470
1563
  ])) : B("", !0),
1471
- a("button", {
1564
+ t("button", {
1472
1565
  type: "button",
1473
1566
  class: "aform_form-btn",
1474
1567
  disabled: e.mode === "read",
1475
- onClick: k[0] || (k[0] = (h) => J(n)())
1476
- }, g(e.label), 9, ja),
1477
- a("button", {
1568
+ onClick: g[0] || (g[0] = (h) => O(n)())
1569
+ }, k(e.label), 9, rl),
1570
+ t("button", {
1478
1571
  type: "button",
1479
- disabled: !J(u) || e.mode === "read",
1572
+ disabled: !O(o) || e.mode === "read",
1480
1573
  class: "aform_form-btn",
1481
- onClick: k[1] || (k[1] = (h) => J(r)())
1482
- }, "Reset", 8, el)
1574
+ onClick: g[1] || (g[1] = (h) => O(i)())
1575
+ }, "Reset", 8, dl)
1483
1576
  ], 64))
1484
1577
  ]));
1485
1578
  }
1486
- }), al = /* @__PURE__ */ H(tl, [["__scopeId", "data-v-8eefd179"]]), ll = { class: "aform_form-element" }, nl = { class: "aform_display-value" }, sl = { class: "aform_field-label" }, ol = ["id", "disabled", "required"], il = ["for"], ul = ["innerHTML"], rl = /* @__PURE__ */ R({
1579
+ }), ml = /* @__PURE__ */ N(cl, [["__scopeId", "data-v-8eefd179"]]), fl = { class: "aform_form-element" }, vl = { class: "aform_display-value" }, yl = { class: "aform_field-label" }, hl = ["id", "disabled", "required"], bl = ["for"], gl = ["innerHTML"], kl = /* @__PURE__ */ V({
1487
1580
  __name: "ANumericInput",
1488
- props: /* @__PURE__ */ K({
1581
+ props: /* @__PURE__ */ P({
1489
1582
  schema: {},
1490
1583
  label: {},
1491
1584
  selectRange: { type: Boolean },
@@ -1501,38 +1594,38 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1501
1594
  }),
1502
1595
  emits: ["update:modelValue"],
1503
1596
  setup(e) {
1504
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
1505
- return (r, t) => (d(), f("div", ll, [
1506
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1507
- a("span", nl, g(n.value ?? ""), 1),
1508
- a("label", sl, g(e.label), 1)
1509
- ], 64)) : (d(), f(p, { key: 1 }, [
1510
- _(a("input", {
1597
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
1598
+ return (i, a) => (r(), m("div", fl, [
1599
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1600
+ t("span", vl, k(n.value ?? ""), 1),
1601
+ t("label", yl, k(e.label), 1)
1602
+ ], 64)) : (r(), m(L, { key: 1 }, [
1603
+ F(t("input", {
1511
1604
  id: e.uuid,
1512
- "onUpdate:modelValue": t[0] || (t[0] = (c) => n.value = c),
1605
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
1513
1606
  class: "aform_input-field",
1514
1607
  type: "number",
1515
1608
  disabled: e.mode === "read",
1516
1609
  required: e.required
1517
- }, null, 8, ol), [
1610
+ }, null, 8, hl), [
1518
1611
  [G, n.value]
1519
1612
  ]),
1520
- a("label", {
1613
+ t("label", {
1521
1614
  class: "aform_field-label",
1522
1615
  for: e.uuid
1523
- }, g(e.label), 9, il),
1524
- _(a("p", {
1616
+ }, k(e.label), 9, bl),
1617
+ F(t("p", {
1525
1618
  class: "aform_error",
1526
- innerHTML: u.value
1527
- }, null, 8, ul), [
1528
- [E, u.value]
1619
+ innerHTML: o.value
1620
+ }, null, 8, gl), [
1621
+ [Q, o.value]
1529
1622
  ])
1530
1623
  ], 64))
1531
1624
  ]));
1532
1625
  }
1533
- }), dl = { class: "aform_form-element aquantity" }, cl = { class: "aform_display-value" }, ml = { class: "aform_field-label" }, fl = { class: "aquantity__row" }, vl = { class: "aquantity__field aquantity__field--qty" }, yl = { class: "aquantity__group" }, hl = ["id", "disabled", "required"], bl = { class: "aquantity__uom" }, gl = ["id", "disabled", "aria-expanded", "aria-activedescendant", "onKeydown"], $l = { class: "aquantity__uom-value" }, kl = ["aria-label"], xl = ["id", "aria-selected", "onMouseenter", "onClick"], Dl = ["for"], wl = { class: "aquantity__row aquantity__row--stock" }, Ml = { class: "aquantity__field aquantity__field--stock-uom" }, Tl = ["value"], Sl = { class: "aform_field-label" }, Il = { class: "aquantity__field aquantity__field--stock-qty" }, Al = ["value"], pl = { class: "aform_field-label" }, _l = { class: "aquantity__field aquantity__field--conversion" }, Ll = ["value"], ql = { class: "aform_field-label" }, Fl = ["innerHTML"], Cl = /* @__PURE__ */ R({
1626
+ }), $l = { class: "aform_form-element aquantity" }, xl = { class: "aform_display-value" }, Dl = { class: "aform_field-label" }, wl = { class: "aquantity__row" }, Ml = { class: "aquantity__field aquantity__field--qty" }, Tl = { class: "aquantity__group" }, Sl = ["id", "disabled", "required"], Al = { class: "aquantity__uom" }, pl = ["id", "disabled", "aria-expanded", "aria-activedescendant", "onKeydown"], Il = { class: "aquantity__uom-value" }, _l = ["aria-label"], Ll = ["id", "aria-selected", "onMouseenter", "onClick"], Fl = ["for"], ql = { class: "aquantity__row aquantity__row--stock" }, Bl = { class: "aquantity__field aquantity__field--stock-uom" }, Cl = ["value"], Vl = { class: "aform_field-label" }, Rl = { class: "aquantity__field aquantity__field--stock-qty" }, Nl = ["value"], Hl = { class: "aform_field-label" }, Ul = { class: "aquantity__field aquantity__field--conversion" }, El = ["value"], Pl = { class: "aform_field-label" }, Kl = ["innerHTML"], Ql = /* @__PURE__ */ V({
1534
1627
  __name: "AQuantityInput",
1535
- props: /* @__PURE__ */ K({
1628
+ props: /* @__PURE__ */ P({
1536
1629
  schema: {},
1537
1630
  label: {},
1538
1631
  selectRange: { type: Boolean },
@@ -1555,26 +1648,26 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1555
1648
  }),
1556
1649
  emits: ["update:modelValue"],
1557
1650
  setup(e) {
1558
- const u = Y(e, "modelValue"), n = I(() => e.options.uoms ?? []), r = (b) => Number(b.toFixed(6)), t = (b) => {
1559
- const L = e.options.stockUom ?? u.value.stockUom;
1560
- if (!b || b === L) return 1;
1561
- const N = e.options.conversionFactors?.[b];
1562
- return N !== void 0 ? N : b === u.value.uom ? u.value.conversionFactor ?? 1 : 1;
1563
- }, c = (b, L) => {
1564
- const N = t(L);
1565
- u.value = {
1651
+ const o = Y(e, "modelValue"), n = w(() => e.options.uoms ?? []), i = (b) => Number(b.toFixed(6)), a = (b) => {
1652
+ const I = e.options.stockUom ?? o.value.stockUom;
1653
+ if (!b || b === I) return 1;
1654
+ const R = e.options.conversionFactors?.[b];
1655
+ return R !== void 0 ? R : b === o.value.uom ? o.value.conversionFactor ?? 1 : 1;
1656
+ }, u = (b, I) => {
1657
+ const R = a(I);
1658
+ o.value = {
1566
1659
  qty: b,
1567
- uom: L,
1568
- conversionFactor: N,
1569
- stockUom: e.options.stockUom ?? u.value.stockUom,
1570
- stockQty: r(b * N)
1660
+ uom: I,
1661
+ conversionFactor: R,
1662
+ stockUom: e.options.stockUom ?? o.value.stockUom,
1663
+ stockQty: i(b * R)
1571
1664
  };
1572
- }, y = I({
1573
- get: () => u.value?.qty ?? 0,
1574
- set: (b) => c(b, u.value?.uom ?? "")
1575
- }), k = I({
1576
- get: () => u.value?.uom ?? "",
1577
- set: (b) => c(u.value?.qty ?? 0, b)
1665
+ }, y = w({
1666
+ get: () => o.value?.qty ?? 0,
1667
+ set: (b) => u(b, o.value?.uom ?? "")
1668
+ }), g = w({
1669
+ get: () => o.value?.uom ?? "",
1670
+ set: (b) => u(o.value?.qty ?? 0, b)
1578
1671
  }), h = /* @__PURE__ */ new Set([
1579
1672
  "Backspace",
1580
1673
  "Delete",
@@ -1587,62 +1680,62 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1587
1680
  "ArrowDown",
1588
1681
  "Home",
1589
1682
  "End"
1590
- ]), v = (b) => {
1683
+ ]), s = (b) => {
1591
1684
  if (b.ctrlKey || b.metaKey || b.altKey || h.has(b.key) || /^[0-9]$/.test(b.key)) return;
1592
- const L = b.target;
1593
- b.key === "." && !L.value.includes(".") || b.preventDefault();
1685
+ const I = b.target;
1686
+ b.key === "." && !I.value.includes(".") || b.preventDefault();
1594
1687
  }, x = (b) => {
1595
- const L = b.clipboardData?.getData("text") ?? "";
1596
- /^\d*\.?\d*$/.test(L) || b.preventDefault();
1597
- }, $ = ve({ open: !1, activeIndex: -1 }), S = () => {
1598
- $.activeIndex = Math.max(n.value.indexOf(k.value), 0), $.open = !0;
1599
- }, s = () => {
1688
+ const I = b.clipboardData?.getData("text") ?? "";
1689
+ /^\d*\.?\d*$/.test(I) || b.preventDefault();
1690
+ }, $ = he({ open: !1, activeIndex: -1 }), A = () => {
1691
+ $.activeIndex = Math.max(n.value.indexOf(g.value), 0), $.open = !0;
1692
+ }, d = () => {
1600
1693
  $.open = !1;
1601
1694
  }, l = () => {
1602
- $.open ? s() : S();
1603
- }, o = (b) => {
1604
- k.value = b, s();
1605
- }, i = (b) => {
1695
+ $.open ? d() : A();
1696
+ }, f = (b) => {
1697
+ g.value = b, d();
1698
+ }, c = (b) => {
1606
1699
  if (!$.open) {
1607
- S();
1700
+ A();
1608
1701
  return;
1609
1702
  }
1610
- const L = n.value.length;
1611
- L && ($.activeIndex = ($.activeIndex + b + L) % L);
1612
- }, D = () => {
1703
+ const I = n.value.length;
1704
+ I && ($.activeIndex = ($.activeIndex + b + I) % I);
1705
+ }, M = () => {
1613
1706
  if (!$.open) {
1614
- S();
1707
+ A();
1615
1708
  return;
1616
1709
  }
1617
1710
  const b = n.value[$.activeIndex];
1618
- b !== void 0 && o(b);
1619
- }, m = I(() => {
1620
- const b = u.value;
1711
+ b !== void 0 && f(b);
1712
+ }, v = w(() => {
1713
+ const b = o.value;
1621
1714
  return !!b?.stockUom && (b.uom !== b.stockUom || b.qty !== b.stockQty);
1622
- }), q = I(() => {
1623
- const b = u.value;
1715
+ }), D = w(() => {
1716
+ const b = o.value;
1624
1717
  if (!b || !b.uom) return "—";
1625
- const L = `${b.qty} ${b.uom}`;
1626
- return m.value ? `${L} (${b.stockQty} ${b.stockUom})` : L;
1718
+ const I = `${b.qty} ${b.uom}`;
1719
+ return v.value ? `${I} (${b.stockQty} ${b.stockUom})` : I;
1627
1720
  });
1628
- return (b, L) => (d(), f("div", dl, [
1629
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1630
- a("span", cl, g(q.value), 1),
1631
- a("label", ml, g(e.label), 1)
1632
- ], 64)) : (d(), f(p, { key: 1 }, [
1633
- a("div", fl, [
1634
- a("div", vl, [
1635
- a("div", yl, [
1636
- _(a("input", {
1721
+ return (b, I) => (r(), m("div", $l, [
1722
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1723
+ t("span", xl, k(D.value), 1),
1724
+ t("label", Dl, k(e.label), 1)
1725
+ ], 64)) : (r(), m(L, { key: 1 }, [
1726
+ t("div", wl, [
1727
+ t("div", Ml, [
1728
+ t("div", Tl, [
1729
+ F(t("input", {
1637
1730
  id: e.uuid,
1638
- "onUpdate:modelValue": L[0] || (L[0] = (N) => y.value = N),
1731
+ "onUpdate:modelValue": I[0] || (I[0] = (R) => y.value = R),
1639
1732
  class: "aquantity__qty",
1640
1733
  type: "number",
1641
1734
  disabled: e.mode === "read",
1642
1735
  required: e.required,
1643
- onKeydown: v,
1736
+ onKeydown: s,
1644
1737
  onPaste: x
1645
- }, null, 40, hl), [
1738
+ }, null, 40, Sl), [
1646
1739
  [
1647
1740
  G,
1648
1741
  y.value,
@@ -1650,8 +1743,8 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1650
1743
  { number: !0 }
1651
1744
  ]
1652
1745
  ]),
1653
- _((d(), f("div", bl, [
1654
- a("button", {
1746
+ F((r(), m("div", Al, [
1747
+ t("button", {
1655
1748
  id: `${e.uuid}-uom`,
1656
1749
  type: "button",
1657
1750
  class: "aquantity__uom-toggle",
@@ -1661,132 +1754,132 @@ const Ue = { class: "aform_form-element" }, Pe = { class: "aform_field-label" },
1661
1754
  "aria-activedescendant": $.open && $.activeIndex >= 0 ? `${e.uuid}-uom-opt-${$.activeIndex}` : void 0,
1662
1755
  onClick: l,
1663
1756
  onKeydown: [
1664
- L[1] || (L[1] = F(V((N) => i(1), ["prevent"]), ["down"])),
1665
- L[2] || (L[2] = F(V((N) => i(-1), ["prevent"]), ["up"])),
1666
- F(V(D, ["prevent"]), ["enter"]),
1667
- F(s, ["esc"])
1757
+ I[1] || (I[1] = q(H((R) => c(1), ["prevent"]), ["down"])),
1758
+ I[2] || (I[2] = q(H((R) => c(-1), ["prevent"]), ["up"])),
1759
+ q(H(M, ["prevent"]), ["enter"]),
1760
+ q(d, ["esc"])
1668
1761
  ]
1669
1762
  }, [
1670
- a("span", $l, g(k.value || e.uomLabel), 1),
1671
- L[3] || (L[3] = a("span", {
1763
+ t("span", Il, k(g.value || e.uomLabel), 1),
1764
+ I[3] || (I[3] = t("span", {
1672
1765
  class: "aquantity__caret",
1673
1766
  "aria-hidden": "true"
1674
1767
  }, null, -1))
1675
- ], 40, gl),
1676
- _(a("ul", {
1768
+ ], 40, pl),
1769
+ F(t("ul", {
1677
1770
  class: "aquantity__uom-menu",
1678
1771
  role: "listbox",
1679
1772
  "aria-label": e.uomLabel
1680
1773
  }, [
1681
- (d(!0), f(p, null, j(n.value, (N, W) => (d(), f("li", {
1682
- id: `${e.uuid}-uom-opt-${W}`,
1683
- key: N,
1774
+ (r(!0), m(L, null, j(n.value, (R, z) => (r(), m("li", {
1775
+ id: `${e.uuid}-uom-opt-${z}`,
1776
+ key: R,
1684
1777
  role: "option",
1685
- "aria-selected": N === k.value,
1686
- class: Z(["aquantity__uom-option", { "is-active": W === $.activeIndex }]),
1687
- onMouseenter: (te) => $.activeIndex = W,
1688
- onClick: (te) => o(N)
1689
- }, g(N), 43, xl))), 128))
1690
- ], 8, kl), [
1691
- [E, $.open]
1778
+ "aria-selected": R === g.value,
1779
+ class: Z(["aquantity__uom-option", { "is-active": z === $.activeIndex }]),
1780
+ onMouseenter: (te) => $.activeIndex = z,
1781
+ onClick: (te) => f(R)
1782
+ }, k(R), 43, Ll))), 128))
1783
+ ], 8, _l), [
1784
+ [Q, $.open]
1692
1785
  ])
1693
1786
  ])), [
1694
- [J(ye), s]
1787
+ [O(be), d]
1695
1788
  ])
1696
1789
  ]),
1697
- a("label", {
1790
+ t("label", {
1698
1791
  class: "aform_field-label",
1699
1792
  for: e.uuid
1700
- }, g(e.label), 9, Dl)
1793
+ }, k(e.label), 9, Fl)
1701
1794
  ])
1702
1795
  ]),
1703
- a("div", wl, [
1704
- a("div", Ml, [
1705
- a("input", {
1706
- value: u.value.stockUom,
1796
+ t("div", ql, [
1797
+ t("div", Bl, [
1798
+ t("input", {
1799
+ value: o.value.stockUom,
1707
1800
  class: "aform_input-field aquantity__stock-field",
1708
1801
  type: "text",
1709
1802
  disabled: ""
1710
- }, null, 8, Tl),
1711
- a("label", Sl, g(e.stockUomLabel), 1)
1803
+ }, null, 8, Cl),
1804
+ t("label", Vl, k(e.stockUomLabel), 1)
1712
1805
  ]),
1713
- a("div", Il, [
1714
- a("input", {
1715
- value: u.value.stockQty,
1806
+ t("div", Rl, [
1807
+ t("input", {
1808
+ value: o.value.stockQty,
1716
1809
  class: "aform_input-field aquantity__stock-field",
1717
1810
  type: "number",
1718
1811
  disabled: ""
1719
- }, null, 8, Al),
1720
- a("label", pl, g(e.stockQtyLabel), 1)
1812
+ }, null, 8, Nl),
1813
+ t("label", Hl, k(e.stockQtyLabel), 1)
1721
1814
  ]),
1722
- a("div", _l, [
1723
- a("input", {
1724
- value: u.value.conversionFactor,
1815
+ t("div", Ul, [
1816
+ t("input", {
1817
+ value: o.value.conversionFactor,
1725
1818
  class: "aform_input-field aquantity__stock-field",
1726
1819
  type: "number",
1727
1820
  disabled: ""
1728
- }, null, 8, Ll),
1729
- a("label", ql, g(e.conversionFactorLabel), 1)
1821
+ }, null, 8, El),
1822
+ t("label", Pl, k(e.conversionFactorLabel), 1)
1730
1823
  ])
1731
1824
  ]),
1732
- _(a("p", {
1825
+ F(t("p", {
1733
1826
  class: "aform_error",
1734
1827
  innerHTML: e.validation.errorMessage
1735
- }, null, 8, Fl), [
1736
- [E, e.validation.errorMessage]
1828
+ }, null, 8, Kl), [
1829
+ [Q, e.validation.errorMessage]
1737
1830
  ])
1738
1831
  ], 64))
1739
1832
  ]));
1740
1833
  }
1741
- }), Bl = /* @__PURE__ */ H(Cl, [["__scopeId", "data-v-0b714861"]]);
1742
- function Rl(e) {
1834
+ }), Yl = /* @__PURE__ */ N(Ql, [["__scopeId", "data-v-0b714861"]]);
1835
+ function Gl(e) {
1743
1836
  try {
1744
- return ce(e);
1837
+ return ae(e);
1745
1838
  } catch {
1746
1839
  return;
1747
1840
  }
1748
1841
  }
1749
- function Vl(e) {
1750
- const u = e.value;
1751
- if (!u) return;
1752
- const n = Rl(u);
1842
+ function zl(e) {
1843
+ const o = e.value;
1844
+ if (!o) return;
1845
+ const n = Gl(o);
1753
1846
  if (n) {
1754
- const t = e.instance?.locale;
1755
- return n(t);
1847
+ const a = e.instance?.locale;
1848
+ return n(a);
1756
1849
  }
1757
- return u;
1850
+ return o;
1758
1851
  }
1759
- function Hl(e, u) {
1852
+ function Wl(e, o) {
1760
1853
  let n = e;
1761
- const r = [u, "/", "-", "(", ")", " "];
1762
- for (const t of r)
1763
- n = n.replaceAll(t, "");
1854
+ const i = [o, "/", "-", "(", ")", " "];
1855
+ for (const a of i)
1856
+ n = n.replaceAll(a, "");
1764
1857
  return n;
1765
1858
  }
1766
- function Nl(e, u, n) {
1767
- let r = u;
1768
- for (const t of e) {
1769
- const c = r.indexOf(n);
1770
- if (c !== -1) {
1771
- const y = r.substring(0, c), k = r.substring(c + 1);
1772
- r = y + t + k;
1859
+ function Jl(e, o, n) {
1860
+ let i = o;
1861
+ for (const a of e) {
1862
+ const u = i.indexOf(n);
1863
+ if (u !== -1) {
1864
+ const y = i.substring(0, u), g = i.substring(u + 1);
1865
+ i = y + a + g;
1773
1866
  }
1774
1867
  }
1775
- return r.slice(0, u.length);
1868
+ return i.slice(0, o.length);
1776
1869
  }
1777
- function Ul(e, u) {
1778
- const n = Vl(u);
1870
+ function Ol(e, o) {
1871
+ const n = zl(o);
1779
1872
  if (!n) return;
1780
- const r = "#", t = e.value, c = Hl(t, r);
1781
- if (c) {
1782
- const y = Nl(c, n, r), k = u.instance;
1783
- k?.maskFilled && (k.maskFilled = !y.includes(r)), e.value = y;
1873
+ const i = "#", a = e.value, u = Wl(a, i);
1874
+ if (u) {
1875
+ const y = Jl(u, n, i), g = o.instance;
1876
+ g?.maskFilled && (g.maskFilled = !y.includes(i)), e.value = y;
1784
1877
  } else
1785
1878
  e.value = n;
1786
1879
  }
1787
- const Pl = { class: "aform_form-element" }, El = { class: "aform_display-value" }, Kl = { class: "aform_field-label" }, Ql = ["id", "disabled", "maxlength", "required"], Yl = ["for"], Gl = ["innerHTML"], zl = /* @__PURE__ */ R({
1880
+ const Xl = { class: "aform_form-element" }, Zl = { class: "aform_display-value" }, jl = { class: "aform_field-label" }, en = ["id", "disabled", "maxlength", "required"], tn = ["for"], an = ["innerHTML"], ln = /* @__PURE__ */ V({
1788
1881
  __name: "ATextInput",
1789
- props: /* @__PURE__ */ K({
1882
+ props: /* @__PURE__ */ P({
1790
1883
  schema: {},
1791
1884
  label: {},
1792
1885
  selectRange: { type: Boolean },
@@ -1802,39 +1895,39 @@ const Pl = { class: "aform_form-element" }, El = { class: "aform_display-value"
1802
1895
  }),
1803
1896
  emits: ["update:modelValue"],
1804
1897
  setup(e) {
1805
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = T(!0), r = Y(e, "modelValue");
1806
- return (t, c) => (d(), f("div", Pl, [
1807
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1808
- a("span", El, g(r.value ?? ""), 1),
1809
- a("label", Kl, g(e.label), 1)
1810
- ], 64)) : (d(), f(p, { key: 1 }, [
1811
- _(a("input", {
1898
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = p(!0), i = Y(e, "modelValue");
1899
+ return (a, u) => (r(), m("div", Xl, [
1900
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1901
+ t("span", Zl, k(i.value ?? ""), 1),
1902
+ t("label", jl, k(e.label), 1)
1903
+ ], 64)) : (r(), m(L, { key: 1 }, [
1904
+ F(t("input", {
1812
1905
  id: e.uuid,
1813
- "onUpdate:modelValue": c[0] || (c[0] = (y) => r.value = y),
1906
+ "onUpdate:modelValue": u[0] || (u[0] = (y) => i.value = y),
1814
1907
  class: "aform_input-field",
1815
1908
  disabled: e.mode === "read",
1816
1909
  maxlength: e.mask && n.value ? e.mask.length : void 0,
1817
1910
  required: e.required
1818
- }, null, 8, Ql), [
1819
- [G, r.value],
1820
- [J(Ul), e.mask]
1911
+ }, null, 8, en), [
1912
+ [G, i.value],
1913
+ [O(Ol), e.mask]
1821
1914
  ]),
1822
- a("label", {
1915
+ t("label", {
1823
1916
  class: "aform_field-label",
1824
1917
  for: e.uuid
1825
- }, g(e.label), 9, Yl),
1826
- _(a("p", {
1918
+ }, k(e.label), 9, tn),
1919
+ F(t("p", {
1827
1920
  class: "aform_error",
1828
- innerHTML: u.value
1829
- }, null, 8, Gl), [
1830
- [E, u.value]
1921
+ innerHTML: o.value
1922
+ }, null, 8, an), [
1923
+ [Q, o.value]
1831
1924
  ])
1832
1925
  ], 64))
1833
1926
  ]));
1834
1927
  }
1835
- }), Wl = { class: "aform_form-element" }, Jl = { class: "aform_display-value aform_textbox-display" }, Ol = { class: "aform_field-label" }, Xl = ["id", "placeholder", "rows", "maxlength", "disabled", "required"], Zl = ["for"], jl = ["innerHTML"], en = /* @__PURE__ */ R({
1928
+ }), nn = { class: "aform_form-element" }, on = { class: "aform_display-value aform_textbox-display" }, sn = { class: "aform_field-label" }, un = ["id", "placeholder", "rows", "maxlength", "disabled", "required"], rn = ["for"], dn = ["innerHTML"], cn = /* @__PURE__ */ V({
1836
1929
  __name: "ATextboxInput",
1837
- props: /* @__PURE__ */ K({
1930
+ props: /* @__PURE__ */ P({
1838
1931
  schema: {},
1839
1932
  label: {},
1840
1933
  selectRange: { type: Boolean },
@@ -1853,74 +1946,74 @@ const Pl = { class: "aform_form-element" }, El = { class: "aform_display-value"
1853
1946
  }),
1854
1947
  emits: ["update:modelValue"],
1855
1948
  setup(e) {
1856
- const u = I(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
1857
- return (r, t) => (d(), f("div", Wl, [
1858
- e.mode === "display" ? (d(), f(p, { key: 0 }, [
1859
- a("span", Jl, g(n.value ?? ""), 1),
1860
- a("label", Ol, g(e.label), 1)
1861
- ], 64)) : (d(), f(p, { key: 1 }, [
1862
- _(a("textarea", {
1949
+ const o = w(() => e.errors?.length ? e.errors.join("; ") : e.validation.errorMessage ?? ""), n = Y(e, "modelValue");
1950
+ return (i, a) => (r(), m("div", nn, [
1951
+ e.mode === "display" ? (r(), m(L, { key: 0 }, [
1952
+ t("span", on, k(n.value ?? ""), 1),
1953
+ t("label", sn, k(e.label), 1)
1954
+ ], 64)) : (r(), m(L, { key: 1 }, [
1955
+ F(t("textarea", {
1863
1956
  id: e.uuid,
1864
- "onUpdate:modelValue": t[0] || (t[0] = (c) => n.value = c),
1957
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
1865
1958
  class: "aform_input-field aform_textbox",
1866
1959
  placeholder: e.placeholder,
1867
1960
  rows: e.rows,
1868
1961
  maxlength: e.maxlength,
1869
1962
  disabled: e.mode === "read",
1870
1963
  required: e.required
1871
- }, null, 8, Xl), [
1964
+ }, null, 8, un), [
1872
1965
  [G, n.value]
1873
1966
  ]),
1874
- a("label", {
1967
+ t("label", {
1875
1968
  class: "aform_field-label",
1876
1969
  for: e.uuid
1877
- }, g(e.label), 9, Zl),
1878
- _(a("p", {
1970
+ }, k(e.label), 9, rn),
1971
+ F(t("p", {
1879
1972
  class: "aform_error",
1880
- innerHTML: u.value
1881
- }, null, 8, jl), [
1882
- [E, u.value]
1973
+ innerHTML: o.value
1974
+ }, null, 8, dn), [
1975
+ [Q, o.value]
1883
1976
  ])
1884
1977
  ], 64))
1885
1978
  ]));
1886
1979
  }
1887
- }), tn = /* @__PURE__ */ H(en, [["__scopeId", "data-v-2a9c793b"]]), an = { class: "login-container" }, ln = { class: "account-container" }, nn = { class: "account-header" }, sn = { id: "account-title" }, on = { id: "account-subtitle" }, un = { class: "login-form-container" }, rn = { class: "login-form-email aform_form-element" }, dn = ["disabled"], cn = { class: "login-form-password aform_form-element" }, mn = ["disabled"], fn = ["disabled"], vn = {
1980
+ }), mn = /* @__PURE__ */ N(cn, [["__scopeId", "data-v-2a9c793b"]]), fn = { class: "login-container" }, vn = { class: "account-container" }, yn = { class: "account-header" }, hn = { id: "account-title" }, bn = { id: "account-subtitle" }, gn = { class: "login-form-container" }, kn = { class: "login-form-email aform_form-element" }, $n = ["disabled"], xn = { class: "login-form-password aform_form-element" }, Dn = ["disabled"], wn = ["disabled"], Mn = {
1888
1981
  key: 0,
1889
1982
  class: "material-symbols-outlined loading-icon"
1890
- }, yn = /* @__PURE__ */ R({
1983
+ }, Tn = /* @__PURE__ */ V({
1891
1984
  __name: "Login",
1892
1985
  props: {
1893
1986
  headerTitle: { default: "Login" },
1894
1987
  headerSubtitle: { default: "Enter your email and password to login" }
1895
1988
  },
1896
1989
  emits: ["loginFailed", "loginSuccess"],
1897
- setup(e, { emit: u }) {
1898
- const n = u, r = T(""), t = T(""), c = T(!1), y = T(!1);
1899
- function k(h) {
1900
- if (h.preventDefault(), c.value = !0, y.value) {
1901
- c.value = !1, n("loginFailed");
1990
+ setup(e, { emit: o }) {
1991
+ const n = o, i = p(""), a = p(""), u = p(!1), y = p(!1);
1992
+ function g(h) {
1993
+ if (h.preventDefault(), u.value = !0, y.value) {
1994
+ u.value = !1, n("loginFailed");
1902
1995
  return;
1903
1996
  }
1904
- c.value = !1, n("loginSuccess");
1997
+ u.value = !1, n("loginSuccess");
1905
1998
  }
1906
- return (h, v) => (d(), f("div", an, [
1907
- a("div", null, [
1908
- a("div", ln, [
1909
- a("div", nn, [
1910
- a("h1", sn, g(e.headerTitle), 1),
1911
- a("p", on, g(e.headerSubtitle), 1)
1999
+ return (h, s) => (r(), m("div", fn, [
2000
+ t("div", null, [
2001
+ t("div", vn, [
2002
+ t("div", yn, [
2003
+ t("h1", hn, k(e.headerTitle), 1),
2004
+ t("p", bn, k(e.headerSubtitle), 1)
1912
2005
  ]),
1913
- a("form", { onSubmit: k }, [
1914
- a("div", un, [
1915
- a("div", rn, [
1916
- v[2] || (v[2] = a("label", {
2006
+ t("form", { onSubmit: g }, [
2007
+ t("div", gn, [
2008
+ t("div", kn, [
2009
+ s[2] || (s[2] = t("label", {
1917
2010
  id: "login-email",
1918
2011
  for: "email",
1919
2012
  class: "aform_field-label"
1920
2013
  }, "Email", -1)),
1921
- _(a("input", {
2014
+ F(t("input", {
1922
2015
  id: "email",
1923
- "onUpdate:modelValue": v[0] || (v[0] = (x) => r.value = x),
2016
+ "onUpdate:modelValue": s[0] || (s[0] = (x) => i.value = x),
1924
2017
  class: "aform_input-field",
1925
2018
  name: "email",
1926
2019
  placeholder: "name@example.com",
@@ -1928,80 +2021,83 @@ const Pl = { class: "aform_form-element" }, El = { class: "aform_display-value"
1928
2021
  "auto-capitalize": "none",
1929
2022
  "auto-complete": "email",
1930
2023
  "auto-correct": "off",
1931
- disabled: c.value
1932
- }, null, 8, dn), [
1933
- [G, r.value]
2024
+ disabled: u.value
2025
+ }, null, 8, $n), [
2026
+ [G, i.value]
1934
2027
  ])
1935
2028
  ]),
1936
- a("div", cn, [
1937
- v[3] || (v[3] = a("label", {
2029
+ t("div", xn, [
2030
+ s[3] || (s[3] = t("label", {
1938
2031
  id: "login-password",
1939
2032
  for: "password",
1940
2033
  class: "aform_field-label"
1941
2034
  }, "Password", -1)),
1942
- _(a("input", {
2035
+ F(t("input", {
1943
2036
  id: "password",
1944
- "onUpdate:modelValue": v[1] || (v[1] = (x) => t.value = x),
2037
+ "onUpdate:modelValue": s[1] || (s[1] = (x) => a.value = x),
1945
2038
  class: "aform_input-field",
1946
2039
  name: "password",
1947
2040
  type: "password",
1948
- disabled: c.value
1949
- }, null, 8, mn), [
1950
- [G, t.value]
2041
+ disabled: u.value
2042
+ }, null, 8, Dn), [
2043
+ [G, a.value]
1951
2044
  ])
1952
2045
  ]),
1953
- a("button", {
2046
+ t("button", {
1954
2047
  class: "btn",
1955
- disabled: c.value || !r.value || !t.value,
1956
- onClick: k
2048
+ disabled: u.value || !i.value || !a.value,
2049
+ onClick: g
1957
2050
  }, [
1958
- c.value ? (d(), f("span", vn, "progress_activity")) : B("", !0),
1959
- v[4] || (v[4] = a("span", { id: "login-form-button" }, "Login", -1))
1960
- ], 8, fn)
2051
+ u.value ? (r(), m("span", Mn, "progress_activity")) : B("", !0),
2052
+ s[4] || (s[4] = t("span", { id: "login-form-button" }, "Login", -1))
2053
+ ], 8, wn)
1961
2054
  ])
1962
2055
  ], 32),
1963
- v[5] || (v[5] = a("button", { class: "btn" }, [
1964
- a("span", { id: "forgot-password-button" }, "Forgot password?")
2056
+ s[5] || (s[5] = t("button", { class: "btn" }, [
2057
+ t("span", { id: "forgot-password-button" }, "Forgot password?")
1965
2058
  ], -1))
1966
2059
  ])
1967
2060
  ])
1968
2061
  ]));
1969
2062
  }
1970
- }), Tn = /* @__PURE__ */ H(yn, [["__scopeId", "data-v-2c0f0634"]]), hn = {}, bn = { class: "aform-loading" }, gn = { class: "aform-loading__label" };
1971
- function $n(e, u) {
1972
- return d(), f("div", bn, [
1973
- a("div", gn, [
1974
- fe(e.$slots, "default", {}, void 0, !0)
2063
+ }), Vn = /* @__PURE__ */ N(Tn, [["__scopeId", "data-v-2c0f0634"]]), Sn = {}, An = { class: "aform-loading" }, pn = { class: "aform-loading__label" };
2064
+ function In(e, o) {
2065
+ return r(), m("div", An, [
2066
+ t("div", pn, [
2067
+ ye(e.$slots, "default", {}, void 0, !0)
1975
2068
  ]),
1976
- u[0] || (u[0] = a("div", { class: "aform-loading__bar" }, null, -1))
2069
+ o[0] || (o[0] = t("div", { class: "aform-loading__bar" }, null, -1))
1977
2070
  ]);
1978
2071
  }
1979
- const kn = /* @__PURE__ */ H(hn, [["render", $n], ["__scopeId", "data-v-274f5ba3"]]);
1980
- function Sn(e) {
1981
- e.use(_e), e.component("ACheckbox", We), e.component("ACurrencyInput", It), e.component("ADate", sa), e.component("ADropdown", ha), e.component("ADatePicker", Te), e.component("ADateTime", Ma), e.component("ADateTimeInput", me), e.component("ADateRange", Ua), e.component("ADateSelection", ae), e.component("AFieldset", Wa), e.component("AFileAttach", al), e.component("AForm", Se), e.component("AFormLink", Me), e.component("ANumericInput", rl), e.component("AQuantityInput", Bl), e.component("ATextInput", zl), e.component("ATextboxInput", tn), e.component("ADuration", qa), e.component("AFormLoading", kn);
2072
+ const _n = /* @__PURE__ */ N(Sn, [["render", In], ["__scopeId", "data-v-274f5ba3"]]);
2073
+ function Rn(e) {
2074
+ e.use(Ce), e.component("ACheckbox", at), e.component("ACurrencyInput", Ct), e.component("ADate", fa), e.component("ADropdown", Ma), e.component("ABadge", Sa), e.component("ADatePicker", pe), e.component("ADateTime", Ba), e.component("ADateTimeInput", ve), e.component("ADateRange", Oa), e.component("ADateSelection", le), e.component("AFieldset", nl), e.component("AFileAttach", ml), e.component("AForm", Ie), e.component("AFormLink", Ae), e.component("ANumericInput", kl), e.component("AQuantityInput", Yl), e.component("ATextInput", ln), e.component("ATextboxInput", mn), e.component("ADuration", Pa), e.component("AFormLoading", _n);
1982
2075
  }
1983
2076
  export {
1984
- We as ACheckbox,
1985
- It as ACurrencyInput,
1986
- sa as ADate,
1987
- Te as ADatePicker,
1988
- Ua as ADateRange,
1989
- ae as ADateSelection,
1990
- Ma as ADateTime,
1991
- me as ADateTimeInput,
1992
- ha as ADropdown,
1993
- qa as ADuration,
1994
- Wa as AFieldset,
1995
- al as AFileAttach,
1996
- Se as AForm,
1997
- Me as AFormLink,
1998
- kn as AFormLoading,
1999
- rl as ANumericInput,
2000
- Bl as AQuantityInput,
2001
- zl as ATextInput,
2002
- tn as ATextboxInput,
2003
- Tn as Login,
2004
- ce as deserializeFunction,
2005
- Sn as install
2077
+ Sa as ABadge,
2078
+ at as ACheckbox,
2079
+ Ct as ACurrencyInput,
2080
+ fa as ADate,
2081
+ pe as ADatePicker,
2082
+ Oa as ADateRange,
2083
+ le as ADateSelection,
2084
+ Ba as ADateTime,
2085
+ ve as ADateTimeInput,
2086
+ Ma as ADropdown,
2087
+ Pa as ADuration,
2088
+ nl as AFieldset,
2089
+ ml as AFileAttach,
2090
+ Ie as AForm,
2091
+ Ae as AFormLink,
2092
+ _n as AFormLoading,
2093
+ kl as ANumericInput,
2094
+ Yl as AQuantityInput,
2095
+ ln as ATextInput,
2096
+ mn as ATextboxInput,
2097
+ Vn as Login,
2098
+ we as badgeInputAccentStyle,
2099
+ ae as deserializeFunction,
2100
+ Rn as install,
2101
+ Ye as resolveFieldBadge
2006
2102
  };
2007
2103
  //# sourceMappingURL=aform.js.map