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