@stonecrop/aform 0.16.3 → 0.16.4

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