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