@stonecrop/aform 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aform.js +726 -608
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +2 -2
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/src/tsdoc-metadata.json +1 -1
- package/package.json +21 -20
package/dist/aform.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import './assets/index.css';const
|
|
1
|
+
import { defineComponent as C, mergeModels as G, useModel as W, createElementBlock as w, openBlock as g, createElementVNode as d, withDirectives as M, toDisplayString as A, vModelCheckbox as Oe, vShow as U, resolveComponent as Fe, createBlock as oe, withCtx as Re, useTemplateRef as Me, vModelText as B, watch as O, getCurrentScope as Ae, onScopeDispose as Ie, toRef as He, readonly as Ce, ref as k, customRef as Be, computed as T, toValue as D, unref as $, shallowRef as le, reactive as qe, normalizeClass as Q, withKeys as R, Fragment as j, renderList as K, withModifiers as Te, onMounted as se, onBeforeUnmount as We, watchEffect as Ue, getCurrentInstance as Ne, nextTick as Ye, resolveDynamicComponent as je, mergeProps as Ke, renderSlot as ze, createTextVNode as Se, createCommentVNode as ae, createVNode as Ge } from "vue";
|
|
2
|
+
import './assets/index.css';const Xe = { class: "aform_form-element" }, Je = ["for"], Qe = { class: "aform_checkbox-container aform_input-field" }, Ze = ["id", "readonly", "required"], et = ["innerHTML"], tt = /* @__PURE__ */ C({
|
|
3
3
|
__name: "ACheckbox",
|
|
4
4
|
props: /* @__PURE__ */ G({
|
|
5
5
|
schema: {},
|
|
@@ -15,49 +15,49 @@ import './assets/index.css';const Ge = { class: "aform_form-element" }, Ke = ["f
|
|
|
15
15
|
}),
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
17
|
setup(e) {
|
|
18
|
-
const t =
|
|
19
|
-
return (n, o) => (g(),
|
|
18
|
+
const t = W(e, "modelValue");
|
|
19
|
+
return (n, o) => (g(), w("div", Xe, [
|
|
20
20
|
d("label", {
|
|
21
21
|
class: "aform_field-label",
|
|
22
22
|
for: n.uuid
|
|
23
|
-
},
|
|
24
|
-
d("span",
|
|
25
|
-
|
|
26
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
23
|
+
}, A(n.label), 9, Je),
|
|
24
|
+
d("span", Qe, [
|
|
25
|
+
M(d("input", {
|
|
26
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
|
|
27
27
|
type: "checkbox",
|
|
28
28
|
id: n.uuid,
|
|
29
29
|
class: "aform_checkbox",
|
|
30
30
|
readonly: n.readonly,
|
|
31
31
|
required: n.required
|
|
32
|
-
}, null, 8,
|
|
33
|
-
[
|
|
32
|
+
}, null, 8, Ze), [
|
|
33
|
+
[Oe, t.value]
|
|
34
34
|
])
|
|
35
35
|
]),
|
|
36
|
-
|
|
36
|
+
M(d("p", {
|
|
37
37
|
class: "aform_error",
|
|
38
38
|
innerHTML: n.validation.errorMessage
|
|
39
|
-
}, null, 8,
|
|
40
|
-
[
|
|
39
|
+
}, null, 8, et), [
|
|
40
|
+
[U, n.validation.errorMessage]
|
|
41
41
|
])
|
|
42
42
|
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), L = (e, t) => {
|
|
45
45
|
const n = e.__vccOpts || e;
|
|
46
|
-
for (const [o,
|
|
47
|
-
n[o] =
|
|
46
|
+
for (const [o, s] of t)
|
|
47
|
+
n[o] = s;
|
|
48
48
|
return n;
|
|
49
|
-
},
|
|
49
|
+
}, nt = /* @__PURE__ */ L(tt, [["__scopeId", "data-v-9f382ad4"]]), ot = /* @__PURE__ */ C({
|
|
50
50
|
__name: "AComboBox",
|
|
51
51
|
props: ["event", "cellData", "tableID"],
|
|
52
52
|
setup(e) {
|
|
53
53
|
return (t, n) => {
|
|
54
|
-
const o =
|
|
55
|
-
return g(),
|
|
54
|
+
const o = Fe("ATableModal");
|
|
55
|
+
return g(), oe(o, {
|
|
56
56
|
event: e.event,
|
|
57
57
|
cellData: e.cellData,
|
|
58
58
|
class: "amodal"
|
|
59
59
|
}, {
|
|
60
|
-
default:
|
|
60
|
+
default: Re(() => n[0] || (n[0] = [
|
|
61
61
|
d("div", null, [
|
|
62
62
|
d("input", { type: "text" }),
|
|
63
63
|
d("input", { type: "text" }),
|
|
@@ -68,7 +68,7 @@ import './assets/index.css';const Ge = { class: "aform_form-element" }, Ke = ["f
|
|
|
68
68
|
}, 8, ["event", "cellData"]);
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
71
|
+
}), lt = ["id", "disabled", "required"], st = ["for"], at = ["innerHTML"], rt = /* @__PURE__ */ C({
|
|
72
72
|
__name: "ADate",
|
|
73
73
|
props: /* @__PURE__ */ G({
|
|
74
74
|
schema: {},
|
|
@@ -86,277 +86,324 @@ import './assets/index.css';const Ge = { class: "aform_form-element" }, Ke = ["f
|
|
|
86
86
|
}),
|
|
87
87
|
emits: ["update:modelValue"],
|
|
88
88
|
setup(e) {
|
|
89
|
-
const t =
|
|
89
|
+
const t = W(e, "modelValue", {
|
|
90
90
|
// format the date to be compatible with the native input datepicker
|
|
91
|
-
set: (
|
|
92
|
-
}), n =
|
|
91
|
+
set: (s) => new Date(s).toISOString().split("T")[0]
|
|
92
|
+
}), n = Me("date"), o = () => {
|
|
93
93
|
n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
|
|
94
94
|
};
|
|
95
|
-
return (
|
|
96
|
-
|
|
97
|
-
"onUpdate:modelValue":
|
|
95
|
+
return (s, r) => (g(), w("div", null, [
|
|
96
|
+
M(d("input", {
|
|
97
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => t.value = a),
|
|
98
98
|
ref: "date",
|
|
99
99
|
type: "date",
|
|
100
|
-
id:
|
|
101
|
-
disabled:
|
|
102
|
-
required:
|
|
100
|
+
id: s.uuid,
|
|
101
|
+
disabled: s.readonly,
|
|
102
|
+
required: s.required,
|
|
103
103
|
onClick: o
|
|
104
|
-
}, null, 8,
|
|
105
|
-
[
|
|
104
|
+
}, null, 8, lt), [
|
|
105
|
+
[B, t.value]
|
|
106
106
|
]),
|
|
107
|
-
d("label", { for:
|
|
108
|
-
|
|
109
|
-
innerHTML:
|
|
110
|
-
}, null, 8,
|
|
111
|
-
[
|
|
107
|
+
d("label", { for: s.uuid }, A(s.label), 9, st),
|
|
108
|
+
M(d("p", {
|
|
109
|
+
innerHTML: s.validation.errorMessage
|
|
110
|
+
}, null, 8, at), [
|
|
111
|
+
[U, s.validation.errorMessage]
|
|
112
112
|
])
|
|
113
113
|
]));
|
|
114
114
|
}
|
|
115
|
-
}),
|
|
116
|
-
function
|
|
117
|
-
return Ae() ? (
|
|
115
|
+
}), it = /* @__PURE__ */ L(rt, [["__scopeId", "data-v-280b3d1a"]]);
|
|
116
|
+
function re(e) {
|
|
117
|
+
return Ae() ? (Ie(e), !0) : !1;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
const e = /* @__PURE__ */ new Set(), t = (
|
|
121
|
-
e.delete(
|
|
119
|
+
function pe() {
|
|
120
|
+
const e = /* @__PURE__ */ new Set(), t = (r) => {
|
|
121
|
+
e.delete(r);
|
|
122
122
|
};
|
|
123
123
|
return {
|
|
124
|
-
on: (
|
|
125
|
-
e.add(
|
|
126
|
-
const a = () => t(
|
|
127
|
-
return
|
|
124
|
+
on: (r) => {
|
|
125
|
+
e.add(r);
|
|
126
|
+
const a = () => t(r);
|
|
127
|
+
return re(a), {
|
|
128
128
|
off: a
|
|
129
129
|
};
|
|
130
130
|
},
|
|
131
131
|
off: t,
|
|
132
|
-
trigger: (...
|
|
132
|
+
trigger: (...r) => Promise.all(Array.from(e).map((a) => a(...r))),
|
|
133
|
+
clear: () => {
|
|
134
|
+
e.clear();
|
|
135
|
+
}
|
|
133
136
|
};
|
|
134
137
|
}
|
|
135
|
-
|
|
136
|
-
return typeof e == "function" ? e() : C(e);
|
|
137
|
-
}
|
|
138
|
-
const se = typeof window < "u" && typeof document < "u";
|
|
138
|
+
const ie = typeof window < "u" && typeof document < "u";
|
|
139
139
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
140
|
-
const
|
|
141
|
-
},
|
|
142
|
-
function
|
|
140
|
+
const ut = Object.prototype.toString, ct = (e) => ut.call(e) === "[object Object]", F = () => {
|
|
141
|
+
}, dt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), ne = /* @__PURE__ */ ft();
|
|
142
|
+
function ft() {
|
|
143
143
|
var e, t;
|
|
144
|
-
return
|
|
144
|
+
return ie && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
145
|
+
}
|
|
146
|
+
function Z(e) {
|
|
147
|
+
return Array.isArray(e) ? e : [e];
|
|
145
148
|
}
|
|
146
|
-
function
|
|
149
|
+
function mt(...e) {
|
|
147
150
|
if (e.length !== 1)
|
|
148
|
-
return
|
|
151
|
+
return He(...e);
|
|
149
152
|
const t = e[0];
|
|
150
|
-
return typeof t == "function" ?
|
|
153
|
+
return typeof t == "function" ? Ce(Be(() => ({ get: t, set: F }))) : k(t);
|
|
154
|
+
}
|
|
155
|
+
function pt(e, t, n) {
|
|
156
|
+
return O(
|
|
157
|
+
e,
|
|
158
|
+
t,
|
|
159
|
+
{
|
|
160
|
+
...n,
|
|
161
|
+
immediate: !0
|
|
162
|
+
}
|
|
163
|
+
);
|
|
151
164
|
}
|
|
152
|
-
const
|
|
165
|
+
const vt = ie ? window.document : void 0, ht = {
|
|
153
166
|
multiple: !0,
|
|
154
167
|
accept: "*",
|
|
155
168
|
reset: !1,
|
|
156
169
|
directory: !1
|
|
157
170
|
};
|
|
158
|
-
function
|
|
171
|
+
function gt(e) {
|
|
172
|
+
if (!e)
|
|
173
|
+
return null;
|
|
174
|
+
if (e instanceof FileList)
|
|
175
|
+
return e;
|
|
176
|
+
const t = new DataTransfer();
|
|
177
|
+
for (const n of e)
|
|
178
|
+
t.items.add(n);
|
|
179
|
+
return t.files;
|
|
180
|
+
}
|
|
181
|
+
function yt(e = {}) {
|
|
159
182
|
const {
|
|
160
|
-
document: t =
|
|
161
|
-
} = e, n =
|
|
162
|
-
let
|
|
163
|
-
t && (
|
|
164
|
-
const
|
|
165
|
-
n.value =
|
|
166
|
-
},
|
|
167
|
-
|
|
183
|
+
document: t = vt
|
|
184
|
+
} = e, n = k(gt(e.initialFiles)), { on: o, trigger: s } = pe(), { on: r, trigger: a } = pe();
|
|
185
|
+
let l;
|
|
186
|
+
t && (l = t.createElement("input"), l.type = "file", l.onchange = (c) => {
|
|
187
|
+
const v = c.target;
|
|
188
|
+
n.value = v.files, s(n.value);
|
|
189
|
+
}, l.oncancel = () => {
|
|
190
|
+
a();
|
|
168
191
|
});
|
|
169
|
-
const
|
|
170
|
-
n.value = null,
|
|
171
|
-
},
|
|
172
|
-
if (!
|
|
192
|
+
const i = () => {
|
|
193
|
+
n.value = null, l && l.value && (l.value = "", s(null));
|
|
194
|
+
}, u = (c) => {
|
|
195
|
+
if (!l)
|
|
173
196
|
return;
|
|
174
|
-
const
|
|
175
|
-
...
|
|
197
|
+
const v = {
|
|
198
|
+
...ht,
|
|
176
199
|
...e,
|
|
177
200
|
...c
|
|
178
201
|
};
|
|
179
|
-
|
|
202
|
+
l.multiple = v.multiple, l.accept = v.accept, l.webkitdirectory = v.directory, dt(v, "capture") && (l.capture = v.capture), v.reset && i(), l.click();
|
|
180
203
|
};
|
|
181
204
|
return {
|
|
182
|
-
files:
|
|
183
|
-
open:
|
|
184
|
-
reset:
|
|
185
|
-
onCancel:
|
|
205
|
+
files: Ce(n),
|
|
206
|
+
open: u,
|
|
207
|
+
reset: i,
|
|
208
|
+
onCancel: r,
|
|
186
209
|
onChange: o
|
|
187
210
|
};
|
|
188
211
|
}
|
|
189
|
-
const
|
|
190
|
-
function
|
|
212
|
+
const $e = ie ? window : void 0;
|
|
213
|
+
function Y(e) {
|
|
191
214
|
var t;
|
|
192
|
-
const n =
|
|
215
|
+
const n = D(e);
|
|
193
216
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
194
217
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
218
|
+
function H(...e) {
|
|
219
|
+
const t = [], n = () => {
|
|
220
|
+
t.forEach((l) => l()), t.length = 0;
|
|
221
|
+
}, o = (l, i, u, c) => (l.addEventListener(i, u, c), () => l.removeEventListener(i, u, c)), s = T(() => {
|
|
222
|
+
const l = Z(D(e[0])).filter((i) => i != null);
|
|
223
|
+
return l.every((i) => typeof i != "string") ? l : void 0;
|
|
224
|
+
}), r = pt(
|
|
225
|
+
() => {
|
|
226
|
+
var l, i;
|
|
227
|
+
return [
|
|
228
|
+
(i = (l = s.value) == null ? void 0 : l.map((u) => Y(u))) != null ? i : [$e].filter((u) => u != null),
|
|
229
|
+
Z(D(s.value ? e[1] : e[0])),
|
|
230
|
+
Z($(s.value ? e[2] : e[1])),
|
|
231
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
232
|
+
D(s.value ? e[3] : e[2])
|
|
233
|
+
];
|
|
234
|
+
},
|
|
235
|
+
([l, i, u, c]) => {
|
|
236
|
+
if (n(), !(l != null && l.length) || !(i != null && i.length) || !(u != null && u.length))
|
|
206
237
|
return;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
...
|
|
238
|
+
const v = ct(c) ? { ...c } : c;
|
|
239
|
+
t.push(
|
|
240
|
+
...l.flatMap(
|
|
241
|
+
(f) => i.flatMap(
|
|
242
|
+
(p) => u.map((y) => o(f, p, y, v))
|
|
243
|
+
)
|
|
244
|
+
)
|
|
210
245
|
);
|
|
211
246
|
},
|
|
212
|
-
{
|
|
213
|
-
),
|
|
214
|
-
|
|
247
|
+
{ flush: "post" }
|
|
248
|
+
), a = () => {
|
|
249
|
+
r(), n();
|
|
215
250
|
};
|
|
216
|
-
return
|
|
251
|
+
return re(n), a;
|
|
217
252
|
}
|
|
218
|
-
let
|
|
219
|
-
function
|
|
220
|
-
const { window: o =
|
|
253
|
+
let ve = !1;
|
|
254
|
+
function he(e, t, n = {}) {
|
|
255
|
+
const { window: o = $e, ignore: s = [], capture: r = !0, detectIframe: a = !1, controls: l = !1 } = n;
|
|
221
256
|
if (!o)
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
257
|
+
return l ? { stop: F, cancel: F, trigger: F } : F;
|
|
258
|
+
if (ne && !ve) {
|
|
259
|
+
ve = !0;
|
|
260
|
+
const m = { passive: !0 };
|
|
261
|
+
Array.from(o.document.body.children).forEach((h) => H(h, "click", F, m)), H(o.document.documentElement, "click", F, m);
|
|
262
|
+
}
|
|
263
|
+
let i = !0;
|
|
264
|
+
const u = (m) => D(s).some((h) => {
|
|
226
265
|
if (typeof h == "string")
|
|
227
|
-
return Array.from(o.document.querySelectorAll(h)).some((
|
|
266
|
+
return Array.from(o.document.querySelectorAll(h)).some((E) => E === m.target || m.composedPath().includes(E));
|
|
228
267
|
{
|
|
229
|
-
const
|
|
230
|
-
return
|
|
268
|
+
const E = Y(h);
|
|
269
|
+
return E && (m.target === E || m.composedPath().includes(E));
|
|
231
270
|
}
|
|
232
271
|
});
|
|
233
|
-
function
|
|
234
|
-
const h =
|
|
272
|
+
function c(m) {
|
|
273
|
+
const h = D(m);
|
|
235
274
|
return h && h.$.subTree.shapeFlag === 16;
|
|
236
275
|
}
|
|
237
|
-
function
|
|
238
|
-
const
|
|
239
|
-
return
|
|
276
|
+
function v(m, h) {
|
|
277
|
+
const E = D(m), b = E.$.subTree && E.$.subTree.children;
|
|
278
|
+
return b == null || !Array.isArray(b) ? !1 : b.some((_) => _.el === h.target || h.composedPath().includes(_.el));
|
|
240
279
|
}
|
|
241
|
-
const
|
|
242
|
-
const h =
|
|
243
|
-
if (
|
|
244
|
-
if (
|
|
245
|
-
|
|
280
|
+
const f = (m) => {
|
|
281
|
+
const h = Y(e);
|
|
282
|
+
if (m.target != null && !(!(h instanceof Element) && c(e) && v(e, m)) && !(!h || h === m.target || m.composedPath().includes(h))) {
|
|
283
|
+
if ("detail" in m && m.detail === 0 && (i = !u(m)), !i) {
|
|
284
|
+
i = !0;
|
|
246
285
|
return;
|
|
247
286
|
}
|
|
248
|
-
t(
|
|
287
|
+
t(m);
|
|
249
288
|
}
|
|
250
289
|
};
|
|
251
|
-
let
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}, 0), m
|
|
257
|
-
}, { passive: !0, capture:
|
|
258
|
-
|
|
259
|
-
const h =
|
|
260
|
-
|
|
290
|
+
let p = !1;
|
|
291
|
+
const y = [
|
|
292
|
+
H(o, "click", (m) => {
|
|
293
|
+
p || (p = !0, setTimeout(() => {
|
|
294
|
+
p = !1;
|
|
295
|
+
}, 0), f(m));
|
|
296
|
+
}, { passive: !0, capture: r }),
|
|
297
|
+
H(o, "pointerdown", (m) => {
|
|
298
|
+
const h = Y(e);
|
|
299
|
+
i = !u(m) && !!(h && !m.composedPath().includes(h));
|
|
261
300
|
}, { passive: !0 }),
|
|
262
|
-
|
|
301
|
+
a && H(o, "blur", (m) => {
|
|
263
302
|
setTimeout(() => {
|
|
264
303
|
var h;
|
|
265
|
-
const
|
|
266
|
-
((h = o.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(
|
|
304
|
+
const E = Y(e);
|
|
305
|
+
((h = o.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(E != null && E.contains(o.document.activeElement)) && t(m);
|
|
267
306
|
}, 0);
|
|
268
|
-
})
|
|
269
|
-
].filter(Boolean);
|
|
270
|
-
return
|
|
307
|
+
}, { passive: !0 })
|
|
308
|
+
].filter(Boolean), I = () => y.forEach((m) => m());
|
|
309
|
+
return l ? {
|
|
310
|
+
stop: I,
|
|
311
|
+
cancel: () => {
|
|
312
|
+
i = !1;
|
|
313
|
+
},
|
|
314
|
+
trigger: (m) => {
|
|
315
|
+
i = !0, f(m), i = !1;
|
|
316
|
+
}
|
|
317
|
+
} : I;
|
|
271
318
|
}
|
|
272
|
-
const
|
|
319
|
+
const bt = {
|
|
273
320
|
mounted(e, t) {
|
|
274
321
|
const n = !t.modifiers.bubble;
|
|
275
322
|
if (typeof t.value == "function")
|
|
276
|
-
e.__onClickOutside_stop =
|
|
323
|
+
e.__onClickOutside_stop = he(e, t.value, { capture: n });
|
|
277
324
|
else {
|
|
278
|
-
const [o,
|
|
279
|
-
e.__onClickOutside_stop =
|
|
325
|
+
const [o, s] = t.value;
|
|
326
|
+
e.__onClickOutside_stop = he(e, o, Object.assign({ capture: n }, s));
|
|
280
327
|
}
|
|
281
328
|
},
|
|
282
329
|
unmounted(e) {
|
|
283
330
|
e.__onClickOutside_stop();
|
|
284
331
|
}
|
|
285
332
|
};
|
|
286
|
-
function
|
|
333
|
+
function ee(e) {
|
|
287
334
|
return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
|
|
288
335
|
}
|
|
289
|
-
function
|
|
336
|
+
function Le(e) {
|
|
290
337
|
const t = window.getComputedStyle(e);
|
|
291
338
|
if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
|
|
292
339
|
return !0;
|
|
293
340
|
{
|
|
294
341
|
const n = e.parentNode;
|
|
295
|
-
return !n || n.tagName === "BODY" ? !1 :
|
|
342
|
+
return !n || n.tagName === "BODY" ? !1 : Le(n);
|
|
296
343
|
}
|
|
297
344
|
}
|
|
298
|
-
function
|
|
345
|
+
function wt(e) {
|
|
299
346
|
const t = e || window.event, n = t.target;
|
|
300
|
-
return
|
|
347
|
+
return Le(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
301
348
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const n =
|
|
305
|
-
let o = null,
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
349
|
+
const te = /* @__PURE__ */ new WeakMap();
|
|
350
|
+
function kt(e, t = !1) {
|
|
351
|
+
const n = k(t);
|
|
352
|
+
let o = null, s = "";
|
|
353
|
+
O(mt(e), (l) => {
|
|
354
|
+
const i = ee(D(l));
|
|
355
|
+
if (i) {
|
|
356
|
+
const u = i;
|
|
357
|
+
if (te.get(u) || te.set(u, u.style.overflow), u.style.overflow !== "hidden" && (s = u.style.overflow), u.style.overflow === "hidden")
|
|
311
358
|
return n.value = !0;
|
|
312
359
|
if (n.value)
|
|
313
|
-
return
|
|
360
|
+
return u.style.overflow = "hidden";
|
|
314
361
|
}
|
|
315
362
|
}, {
|
|
316
363
|
immediate: !0
|
|
317
364
|
});
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
!
|
|
321
|
-
|
|
365
|
+
const r = () => {
|
|
366
|
+
const l = ee(D(e));
|
|
367
|
+
!l || n.value || (ne && (o = H(
|
|
368
|
+
l,
|
|
322
369
|
"touchmove",
|
|
323
|
-
(
|
|
324
|
-
|
|
370
|
+
(i) => {
|
|
371
|
+
wt(i);
|
|
325
372
|
},
|
|
326
373
|
{ passive: !1 }
|
|
327
|
-
)),
|
|
328
|
-
},
|
|
329
|
-
const
|
|
330
|
-
!
|
|
374
|
+
)), l.style.overflow = "hidden", n.value = !0);
|
|
375
|
+
}, a = () => {
|
|
376
|
+
const l = ee(D(e));
|
|
377
|
+
!l || !n.value || (ne && (o == null || o()), l.style.overflow = s, te.delete(l), n.value = !1);
|
|
331
378
|
};
|
|
332
|
-
return
|
|
379
|
+
return re(a), T({
|
|
333
380
|
get() {
|
|
334
381
|
return n.value;
|
|
335
382
|
},
|
|
336
|
-
set(
|
|
337
|
-
|
|
383
|
+
set(l) {
|
|
384
|
+
l ? r() : a();
|
|
338
385
|
}
|
|
339
386
|
});
|
|
340
387
|
}
|
|
341
|
-
function
|
|
388
|
+
function _t() {
|
|
342
389
|
let e = !1;
|
|
343
|
-
const t =
|
|
390
|
+
const t = le(!1);
|
|
344
391
|
return (n, o) => {
|
|
345
392
|
if (t.value = o.value, e)
|
|
346
393
|
return;
|
|
347
394
|
e = !0;
|
|
348
|
-
const
|
|
349
|
-
|
|
395
|
+
const s = kt(n, o.value);
|
|
396
|
+
O(t, (r) => s.value = r);
|
|
350
397
|
};
|
|
351
398
|
}
|
|
352
|
-
|
|
353
|
-
const
|
|
399
|
+
_t();
|
|
400
|
+
const Dt = { class: "input-wrapper" }, Et = {
|
|
354
401
|
id: "autocomplete-results",
|
|
355
402
|
class: "autocomplete-results"
|
|
356
|
-
},
|
|
403
|
+
}, Mt = {
|
|
357
404
|
key: 0,
|
|
358
405
|
class: "loading autocomplete-result"
|
|
359
|
-
},
|
|
406
|
+
}, At = ["onClick"], It = /* @__PURE__ */ C({
|
|
360
407
|
__name: "ADropdown",
|
|
361
408
|
props: /* @__PURE__ */ G({
|
|
362
409
|
label: {},
|
|
@@ -369,12 +416,12 @@ const yt = { class: "input-wrapper" }, bt = {
|
|
|
369
416
|
}),
|
|
370
417
|
emits: ["update:modelValue"],
|
|
371
418
|
setup(e) {
|
|
372
|
-
const t =
|
|
419
|
+
const t = W(e, "modelValue"), n = qe({
|
|
373
420
|
activeItemIndex: null,
|
|
374
421
|
open: !1,
|
|
375
422
|
loading: !1,
|
|
376
423
|
results: e.items
|
|
377
|
-
}), o = () =>
|
|
424
|
+
}), o = () => l(), s = async () => {
|
|
378
425
|
if (n.open = !0, e.filterFunction) {
|
|
379
426
|
e.isAsync && (n.loading = !0);
|
|
380
427
|
try {
|
|
@@ -386,276 +433,347 @@ const yt = { class: "input-wrapper" }, bt = {
|
|
|
386
433
|
e.isAsync && (n.loading = !1);
|
|
387
434
|
}
|
|
388
435
|
} else
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
t.value = f,
|
|
392
|
-
},
|
|
436
|
+
i();
|
|
437
|
+
}, r = (f) => {
|
|
438
|
+
t.value = f, l(f);
|
|
439
|
+
}, a = () => {
|
|
393
440
|
var f;
|
|
394
441
|
n.activeItemIndex = e.isAsync ? null : t.value && ((f = e.items) == null ? void 0 : f.indexOf(t.value)) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;
|
|
395
|
-
},
|
|
442
|
+
}, l = (f) => {
|
|
396
443
|
var p;
|
|
397
444
|
n.activeItemIndex = null, n.open = !1, (p = e.items) != null && p.includes(f || t.value || "") || (t.value = "");
|
|
398
|
-
},
|
|
445
|
+
}, i = () => {
|
|
399
446
|
var f;
|
|
400
447
|
t.value ? n.results = (f = e.items) == null ? void 0 : f.filter((p) => p.toLowerCase().includes((t.value ?? "").toLowerCase())) : n.results = e.items;
|
|
401
|
-
},
|
|
448
|
+
}, u = () => {
|
|
402
449
|
var p;
|
|
403
450
|
const f = ((p = n.results) == null ? void 0 : p.length) || 0;
|
|
404
451
|
if (n.activeItemIndex != null) {
|
|
405
|
-
const
|
|
406
|
-
n.activeItemIndex = (
|
|
452
|
+
const y = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;
|
|
453
|
+
n.activeItemIndex = (y + 1) % f;
|
|
407
454
|
} else
|
|
408
455
|
n.activeItemIndex = 0;
|
|
409
456
|
}, c = () => {
|
|
410
457
|
var p;
|
|
411
458
|
const f = ((p = n.results) == null ? void 0 : p.length) || 0;
|
|
412
459
|
if (n.activeItemIndex != null) {
|
|
413
|
-
const
|
|
414
|
-
n.activeItemIndex = (
|
|
460
|
+
const y = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;
|
|
461
|
+
n.activeItemIndex = (y - 1 + f) % f;
|
|
415
462
|
} else
|
|
416
463
|
n.activeItemIndex = f - 1;
|
|
417
|
-
},
|
|
464
|
+
}, v = () => {
|
|
418
465
|
if (n.results) {
|
|
419
466
|
const f = n.activeItemIndex || 0, p = n.results[f];
|
|
420
|
-
|
|
467
|
+
r(p);
|
|
421
468
|
}
|
|
422
469
|
n.activeItemIndex = 0;
|
|
423
470
|
};
|
|
424
|
-
return (f, p) =>
|
|
425
|
-
class:
|
|
471
|
+
return (f, p) => M((g(), w("div", {
|
|
472
|
+
class: Q(["autocomplete", { isOpen: n.open }])
|
|
426
473
|
}, [
|
|
427
|
-
d("div",
|
|
428
|
-
|
|
429
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
474
|
+
d("div", Dt, [
|
|
475
|
+
M(d("input", {
|
|
476
|
+
"onUpdate:modelValue": p[0] || (p[0] = (y) => t.value = y),
|
|
430
477
|
type: "text",
|
|
431
|
-
onInput:
|
|
432
|
-
onFocus:
|
|
478
|
+
onInput: s,
|
|
479
|
+
onFocus: a,
|
|
433
480
|
onKeydown: [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
481
|
+
R(u, ["down"]),
|
|
482
|
+
R(c, ["up"]),
|
|
483
|
+
R(v, ["enter"]),
|
|
484
|
+
R(o, ["esc"]),
|
|
485
|
+
R(o, ["tab"])
|
|
439
486
|
]
|
|
440
487
|
}, null, 544), [
|
|
441
|
-
[
|
|
488
|
+
[B, t.value]
|
|
442
489
|
]),
|
|
443
|
-
|
|
444
|
-
n.loading ? (g(),
|
|
445
|
-
key:
|
|
446
|
-
onClick:
|
|
447
|
-
class:
|
|
448
|
-
},
|
|
490
|
+
M(d("ul", Et, [
|
|
491
|
+
n.loading ? (g(), w("li", Mt, "Loading results...")) : (g(!0), w(j, { key: 1 }, K(n.results, (y, I) => (g(), w("li", {
|
|
492
|
+
key: y,
|
|
493
|
+
onClick: Te((m) => r(y), ["stop"]),
|
|
494
|
+
class: Q(["autocomplete-result", { "is-active": I === n.activeItemIndex }])
|
|
495
|
+
}, A(y), 11, At))), 128))
|
|
449
496
|
], 512), [
|
|
450
|
-
[
|
|
497
|
+
[U, n.open]
|
|
451
498
|
]),
|
|
452
|
-
d("label", null,
|
|
499
|
+
d("label", null, A(f.label), 1)
|
|
453
500
|
])
|
|
454
501
|
], 2)), [
|
|
455
|
-
[
|
|
502
|
+
[$(bt), o]
|
|
456
503
|
]);
|
|
457
504
|
}
|
|
458
|
-
}),
|
|
459
|
-
function
|
|
460
|
-
return Ae() ? (
|
|
461
|
-
}
|
|
462
|
-
function ae(e) {
|
|
463
|
-
return typeof e == "function" ? e() : C(e);
|
|
505
|
+
}), Ct = /* @__PURE__ */ L(It, [["__scopeId", "data-v-16c329d1"]]);
|
|
506
|
+
function ue(e) {
|
|
507
|
+
return Ae() ? (Ie(e), !0) : !1;
|
|
464
508
|
}
|
|
465
|
-
const
|
|
509
|
+
const Tt = typeof window < "u" && typeof document < "u";
|
|
466
510
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
467
|
-
const
|
|
468
|
-
}
|
|
469
|
-
function
|
|
511
|
+
const St = (e) => e != null, $t = Object.prototype.toString, Lt = (e) => $t.call(e) === "[object Object]", xt = () => {
|
|
512
|
+
};
|
|
513
|
+
function J(e) {
|
|
514
|
+
return Array.isArray(e) ? e : [e];
|
|
515
|
+
}
|
|
516
|
+
function Vt(e, t, n) {
|
|
517
|
+
return O(
|
|
518
|
+
e,
|
|
519
|
+
t,
|
|
520
|
+
{
|
|
521
|
+
...n,
|
|
522
|
+
immediate: !0
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
const N = Tt ? window : void 0;
|
|
527
|
+
function q(e) {
|
|
470
528
|
var t;
|
|
471
|
-
const n =
|
|
529
|
+
const n = D(e);
|
|
472
530
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
473
531
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
532
|
+
function z(...e) {
|
|
533
|
+
const t = [], n = () => {
|
|
534
|
+
t.forEach((l) => l()), t.length = 0;
|
|
535
|
+
}, o = (l, i, u, c) => (l.addEventListener(i, u, c), () => l.removeEventListener(i, u, c)), s = T(() => {
|
|
536
|
+
const l = J(D(e[0])).filter((i) => i != null);
|
|
537
|
+
return l.every((i) => typeof i != "string") ? l : void 0;
|
|
538
|
+
}), r = Vt(
|
|
539
|
+
() => {
|
|
540
|
+
var l, i;
|
|
541
|
+
return [
|
|
542
|
+
(i = (l = s.value) == null ? void 0 : l.map((u) => q(u))) != null ? i : [N].filter((u) => u != null),
|
|
543
|
+
J(D(s.value ? e[1] : e[0])),
|
|
544
|
+
J($(s.value ? e[2] : e[1])),
|
|
545
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
546
|
+
D(s.value ? e[3] : e[2])
|
|
547
|
+
];
|
|
548
|
+
},
|
|
549
|
+
([l, i, u, c]) => {
|
|
550
|
+
if (n(), !(l != null && l.length) || !(i != null && i.length) || !(u != null && u.length))
|
|
485
551
|
return;
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
...
|
|
552
|
+
const v = Lt(c) ? { ...c } : c;
|
|
553
|
+
t.push(
|
|
554
|
+
...l.flatMap(
|
|
555
|
+
(f) => i.flatMap(
|
|
556
|
+
(p) => u.map((y) => o(f, p, y, v))
|
|
557
|
+
)
|
|
558
|
+
)
|
|
489
559
|
);
|
|
490
560
|
},
|
|
491
|
-
{
|
|
492
|
-
),
|
|
493
|
-
|
|
561
|
+
{ flush: "post" }
|
|
562
|
+
), a = () => {
|
|
563
|
+
r(), n();
|
|
494
564
|
};
|
|
495
|
-
return
|
|
565
|
+
return ue(n), a;
|
|
496
566
|
}
|
|
497
|
-
function
|
|
498
|
-
const e =
|
|
499
|
-
return t &&
|
|
567
|
+
function Pt() {
|
|
568
|
+
const e = le(!1), t = Ne();
|
|
569
|
+
return t && se(() => {
|
|
500
570
|
e.value = !0;
|
|
501
571
|
}, t), e;
|
|
502
572
|
}
|
|
503
|
-
function
|
|
504
|
-
const t =
|
|
573
|
+
function Ot(e) {
|
|
574
|
+
const t = Pt();
|
|
505
575
|
return T(() => (t.value, !!e()));
|
|
506
576
|
}
|
|
507
|
-
function
|
|
508
|
-
const { window: o =
|
|
509
|
-
let
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
const f =
|
|
577
|
+
function Ft(e, t, n = {}) {
|
|
578
|
+
const { window: o = N, ...s } = n;
|
|
579
|
+
let r;
|
|
580
|
+
const a = Ot(() => o && "MutationObserver" in o), l = () => {
|
|
581
|
+
r && (r.disconnect(), r = void 0);
|
|
582
|
+
}, i = T(() => {
|
|
583
|
+
const f = D(e), p = J(f).map(q).filter(St);
|
|
514
584
|
return new Set(p);
|
|
515
|
-
}),
|
|
516
|
-
() =>
|
|
585
|
+
}), u = O(
|
|
586
|
+
() => i.value,
|
|
517
587
|
(f) => {
|
|
518
|
-
|
|
588
|
+
l(), a.value && f.size && (r = new MutationObserver(t), f.forEach((p) => r.observe(p, s)));
|
|
519
589
|
},
|
|
520
590
|
{ immediate: !0, flush: "post" }
|
|
521
|
-
), c = () =>
|
|
522
|
-
|
|
591
|
+
), c = () => r == null ? void 0 : r.takeRecords(), v = () => {
|
|
592
|
+
u(), l();
|
|
523
593
|
};
|
|
524
|
-
return
|
|
525
|
-
isSupported:
|
|
526
|
-
stop:
|
|
594
|
+
return ue(v), {
|
|
595
|
+
isSupported: a,
|
|
596
|
+
stop: v,
|
|
527
597
|
takeRecords: c
|
|
528
598
|
};
|
|
529
599
|
}
|
|
530
|
-
function
|
|
600
|
+
function Rt(e, t, n = {}) {
|
|
601
|
+
const {
|
|
602
|
+
window: o = N,
|
|
603
|
+
document: s = o == null ? void 0 : o.document,
|
|
604
|
+
flush: r = "sync"
|
|
605
|
+
} = n;
|
|
606
|
+
if (!o || !s)
|
|
607
|
+
return xt;
|
|
608
|
+
let a;
|
|
609
|
+
const l = (c) => {
|
|
610
|
+
a == null || a(), a = c;
|
|
611
|
+
}, i = Ue(() => {
|
|
612
|
+
const c = q(e);
|
|
613
|
+
if (c) {
|
|
614
|
+
const { stop: v } = Ft(
|
|
615
|
+
s,
|
|
616
|
+
(f) => {
|
|
617
|
+
f.map((p) => [...p.removedNodes]).flat().some((p) => p === c || p.contains(c)) && t(f);
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
window: o,
|
|
621
|
+
childList: !0,
|
|
622
|
+
subtree: !0
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
l(v);
|
|
626
|
+
}
|
|
627
|
+
}, { flush: r }), u = () => {
|
|
628
|
+
i(), l();
|
|
629
|
+
};
|
|
630
|
+
return ue(u), u;
|
|
631
|
+
}
|
|
632
|
+
function Ht(e = {}) {
|
|
531
633
|
var t;
|
|
532
634
|
const {
|
|
533
|
-
window: n =
|
|
635
|
+
window: n = N,
|
|
534
636
|
deep: o = !0,
|
|
535
|
-
triggerOnRemoval:
|
|
536
|
-
} = e,
|
|
537
|
-
var
|
|
538
|
-
let c =
|
|
637
|
+
triggerOnRemoval: s = !1
|
|
638
|
+
} = e, r = (t = e.document) != null ? t : n == null ? void 0 : n.document, a = () => {
|
|
639
|
+
var u;
|
|
640
|
+
let c = r == null ? void 0 : r.activeElement;
|
|
539
641
|
if (o)
|
|
540
642
|
for (; c != null && c.shadowRoot; )
|
|
541
|
-
c = (
|
|
643
|
+
c = (u = c == null ? void 0 : c.shadowRoot) == null ? void 0 : u.activeElement;
|
|
542
644
|
return c;
|
|
543
|
-
},
|
|
544
|
-
|
|
645
|
+
}, l = k(), i = () => {
|
|
646
|
+
l.value = a();
|
|
545
647
|
};
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
648
|
+
if (n) {
|
|
649
|
+
const u = {
|
|
650
|
+
capture: !0,
|
|
651
|
+
passive: !0
|
|
652
|
+
};
|
|
653
|
+
z(
|
|
654
|
+
n,
|
|
655
|
+
"blur",
|
|
656
|
+
(c) => {
|
|
657
|
+
c.relatedTarget === null && i();
|
|
658
|
+
},
|
|
659
|
+
u
|
|
660
|
+
), z(
|
|
661
|
+
n,
|
|
662
|
+
"focus",
|
|
663
|
+
i,
|
|
664
|
+
u
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
return s && Rt(l, i, { document: r }), i(), l;
|
|
556
668
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
559
|
-
const { window: n =
|
|
560
|
-
|
|
669
|
+
const Bt = "focusin", qt = "focusout", Wt = ":focus-within";
|
|
670
|
+
function Ut(e, t = {}) {
|
|
671
|
+
const { window: n = N } = t, o = T(() => q(e)), s = le(!1), r = T(() => s.value), a = Ht(t);
|
|
672
|
+
if (!n || !a.value)
|
|
673
|
+
return { focused: r };
|
|
674
|
+
const l = { passive: !0 };
|
|
675
|
+
return z(o, Bt, () => s.value = !0, l), z(o, qt, () => {
|
|
676
|
+
var i, u, c;
|
|
677
|
+
return s.value = (c = (u = (i = o.value) == null ? void 0 : i.matches) == null ? void 0 : u.call(i, Wt)) != null ? c : !1;
|
|
678
|
+
}, l), { focused: r };
|
|
561
679
|
}
|
|
562
|
-
function
|
|
563
|
-
const o =
|
|
680
|
+
function Nt(e, { window: t = N, scrollTarget: n } = {}) {
|
|
681
|
+
const o = k(!1), s = () => {
|
|
564
682
|
if (!t) return;
|
|
565
|
-
const
|
|
566
|
-
if (!
|
|
683
|
+
const r = t.document, a = q(e);
|
|
684
|
+
if (!a)
|
|
567
685
|
o.value = !1;
|
|
568
686
|
else {
|
|
569
|
-
const
|
|
570
|
-
o.value =
|
|
687
|
+
const l = a.getBoundingClientRect();
|
|
688
|
+
o.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;
|
|
571
689
|
}
|
|
572
690
|
};
|
|
573
|
-
return
|
|
574
|
-
() =>
|
|
575
|
-
() =>
|
|
691
|
+
return O(
|
|
692
|
+
() => q(e),
|
|
693
|
+
() => s(),
|
|
576
694
|
{ immediate: !0, flush: "post" }
|
|
577
|
-
), t &&
|
|
695
|
+
), t && z(n || t, "scroll", s, {
|
|
578
696
|
capture: !1,
|
|
579
697
|
passive: !0
|
|
580
698
|
}), o;
|
|
581
699
|
}
|
|
582
|
-
const
|
|
583
|
-
let t =
|
|
700
|
+
const x = (e) => {
|
|
701
|
+
let t = Nt(e).value;
|
|
584
702
|
return t = t && e.offsetHeight > 0, t;
|
|
585
|
-
},
|
|
703
|
+
}, V = (e) => e.tabIndex >= 0, ge = (e) => {
|
|
586
704
|
const t = e.target;
|
|
587
|
-
return
|
|
588
|
-
},
|
|
705
|
+
return ce(t);
|
|
706
|
+
}, ce = (e) => {
|
|
589
707
|
var t;
|
|
590
708
|
let n;
|
|
591
709
|
if (e instanceof HTMLTableCellElement) {
|
|
592
710
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
593
711
|
if (o) {
|
|
594
|
-
const
|
|
595
|
-
|
|
712
|
+
const s = Array.from(o.children)[e.cellIndex];
|
|
713
|
+
s && (n = s);
|
|
596
714
|
}
|
|
597
715
|
} else if (e instanceof HTMLTableRowElement) {
|
|
598
716
|
const o = e.previousElementSibling;
|
|
599
717
|
o && (n = o);
|
|
600
718
|
}
|
|
601
|
-
return n && (
|
|
602
|
-
},
|
|
719
|
+
return n && (!V(n) || !x(n)) ? ce(n) : n;
|
|
720
|
+
}, Yt = (e) => {
|
|
603
721
|
var t;
|
|
604
722
|
const n = e.target;
|
|
605
723
|
let o;
|
|
606
724
|
if (n instanceof HTMLTableCellElement) {
|
|
607
|
-
const
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
|
|
725
|
+
const s = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
726
|
+
if (s) {
|
|
727
|
+
const r = s.firstElementChild, a = r == null ? void 0 : r.children[n.cellIndex];
|
|
728
|
+
a && (o = a);
|
|
611
729
|
}
|
|
612
730
|
} else if (n instanceof HTMLTableRowElement) {
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
const
|
|
616
|
-
|
|
731
|
+
const s = n.parentElement;
|
|
732
|
+
if (s) {
|
|
733
|
+
const r = s.firstElementChild;
|
|
734
|
+
r && (o = r);
|
|
617
735
|
}
|
|
618
736
|
}
|
|
619
|
-
return o && (
|
|
620
|
-
},
|
|
737
|
+
return o && (!V(o) || !x(o)) ? de(o) : o;
|
|
738
|
+
}, ye = (e) => {
|
|
621
739
|
const t = e.target;
|
|
622
|
-
return
|
|
623
|
-
},
|
|
740
|
+
return de(t);
|
|
741
|
+
}, de = (e) => {
|
|
624
742
|
var t;
|
|
625
743
|
let n;
|
|
626
744
|
if (e instanceof HTMLTableCellElement) {
|
|
627
745
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
628
746
|
if (o) {
|
|
629
|
-
const
|
|
630
|
-
|
|
747
|
+
const s = Array.from(o.children)[e.cellIndex];
|
|
748
|
+
s && (n = s);
|
|
631
749
|
}
|
|
632
750
|
} else if (e instanceof HTMLTableRowElement) {
|
|
633
751
|
const o = e.nextElementSibling;
|
|
634
752
|
o && (n = o);
|
|
635
753
|
}
|
|
636
|
-
return n && (
|
|
637
|
-
},
|
|
754
|
+
return n && (!V(n) || !x(n)) ? de(n) : n;
|
|
755
|
+
}, jt = (e) => {
|
|
638
756
|
var t;
|
|
639
757
|
const n = e.target;
|
|
640
758
|
let o;
|
|
641
759
|
if (n instanceof HTMLTableCellElement) {
|
|
642
|
-
const
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
645
|
-
|
|
760
|
+
const s = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
761
|
+
if (s) {
|
|
762
|
+
const r = s.lastElementChild, a = r == null ? void 0 : r.children[n.cellIndex];
|
|
763
|
+
a && (o = a);
|
|
646
764
|
}
|
|
647
765
|
} else if (n instanceof HTMLTableRowElement) {
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
|
|
766
|
+
const s = n.parentElement;
|
|
767
|
+
if (s) {
|
|
768
|
+
const r = s.lastElementChild;
|
|
769
|
+
r && (o = r);
|
|
652
770
|
}
|
|
653
771
|
}
|
|
654
|
-
return o && (
|
|
655
|
-
},
|
|
772
|
+
return o && (!V(o) || !x(o)) ? ce(o) : o;
|
|
773
|
+
}, be = (e) => {
|
|
656
774
|
const t = e.target;
|
|
657
|
-
return
|
|
658
|
-
},
|
|
775
|
+
return fe(t);
|
|
776
|
+
}, fe = (e) => {
|
|
659
777
|
var t;
|
|
660
778
|
let n;
|
|
661
779
|
if (e.previousElementSibling)
|
|
@@ -664,11 +782,11 @@ const L = (e) => {
|
|
|
664
782
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
665
783
|
n = o == null ? void 0 : o.lastElementChild;
|
|
666
784
|
}
|
|
667
|
-
return n && (
|
|
668
|
-
},
|
|
785
|
+
return n && (!V(n) || !x(n)) ? fe(n) : n;
|
|
786
|
+
}, we = (e) => {
|
|
669
787
|
const t = e.target;
|
|
670
|
-
return
|
|
671
|
-
},
|
|
788
|
+
return me(t);
|
|
789
|
+
}, me = (e) => {
|
|
672
790
|
var t;
|
|
673
791
|
let n;
|
|
674
792
|
if (e.nextElementSibling)
|
|
@@ -677,155 +795,155 @@ const L = (e) => {
|
|
|
677
795
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
678
796
|
n = o == null ? void 0 : o.firstElementChild;
|
|
679
797
|
}
|
|
680
|
-
return n && (
|
|
681
|
-
},
|
|
798
|
+
return n && (!V(n) || !x(n)) ? me(n) : n;
|
|
799
|
+
}, ke = (e) => {
|
|
682
800
|
const t = e.target.parentElement, n = t == null ? void 0 : t.firstElementChild;
|
|
683
|
-
return n && (
|
|
684
|
-
},
|
|
801
|
+
return n && (!V(n) || !x(n)) ? me(n) : n;
|
|
802
|
+
}, _e = (e) => {
|
|
685
803
|
const t = e.target.parentElement, n = t == null ? void 0 : t.lastElementChild;
|
|
686
|
-
return n && (
|
|
687
|
-
},
|
|
804
|
+
return n && (!V(n) || !x(n)) ? fe(n) : n;
|
|
805
|
+
}, X = ["alt", "control", "shift", "meta"], Kt = {
|
|
688
806
|
ArrowUp: "up",
|
|
689
807
|
ArrowDown: "down",
|
|
690
808
|
ArrowLeft: "left",
|
|
691
809
|
ArrowRight: "right"
|
|
692
|
-
},
|
|
810
|
+
}, xe = {
|
|
693
811
|
"keydown.up": (e) => {
|
|
694
|
-
const t =
|
|
812
|
+
const t = ge(e);
|
|
695
813
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
696
814
|
},
|
|
697
815
|
"keydown.down": (e) => {
|
|
698
|
-
const t =
|
|
816
|
+
const t = ye(e);
|
|
699
817
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
700
818
|
},
|
|
701
819
|
"keydown.left": (e) => {
|
|
702
|
-
const t =
|
|
820
|
+
const t = be(e);
|
|
703
821
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
704
822
|
},
|
|
705
823
|
"keydown.right": (e) => {
|
|
706
|
-
const t =
|
|
824
|
+
const t = we(e);
|
|
707
825
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
708
826
|
},
|
|
709
827
|
"keydown.control.up": (e) => {
|
|
710
|
-
const t =
|
|
828
|
+
const t = Yt(e);
|
|
711
829
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
712
830
|
},
|
|
713
831
|
"keydown.control.down": (e) => {
|
|
714
|
-
const t =
|
|
832
|
+
const t = jt(e);
|
|
715
833
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
716
834
|
},
|
|
717
835
|
"keydown.control.left": (e) => {
|
|
718
|
-
const t =
|
|
836
|
+
const t = ke(e);
|
|
719
837
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
720
838
|
},
|
|
721
839
|
"keydown.control.right": (e) => {
|
|
722
|
-
const t =
|
|
840
|
+
const t = _e(e);
|
|
723
841
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
724
842
|
},
|
|
725
843
|
"keydown.end": (e) => {
|
|
726
|
-
const t =
|
|
844
|
+
const t = _e(e);
|
|
727
845
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
728
846
|
},
|
|
729
847
|
"keydown.enter": (e) => {
|
|
730
848
|
if (e.target instanceof HTMLTableCellElement) {
|
|
731
849
|
e.preventDefault(), e.stopPropagation();
|
|
732
|
-
const t =
|
|
850
|
+
const t = ye(e);
|
|
733
851
|
t && t.focus();
|
|
734
852
|
}
|
|
735
853
|
},
|
|
736
854
|
"keydown.shift.enter": (e) => {
|
|
737
855
|
if (e.target instanceof HTMLTableCellElement) {
|
|
738
856
|
e.preventDefault(), e.stopPropagation();
|
|
739
|
-
const t =
|
|
857
|
+
const t = ge(e);
|
|
740
858
|
t && t.focus();
|
|
741
859
|
}
|
|
742
860
|
},
|
|
743
861
|
"keydown.home": (e) => {
|
|
744
|
-
const t =
|
|
862
|
+
const t = ke(e);
|
|
745
863
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
746
864
|
},
|
|
747
865
|
"keydown.tab": (e) => {
|
|
748
|
-
const t =
|
|
866
|
+
const t = we(e);
|
|
749
867
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
750
868
|
},
|
|
751
869
|
"keydown.shift.tab": (e) => {
|
|
752
|
-
const t =
|
|
870
|
+
const t = be(e);
|
|
753
871
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
754
872
|
}
|
|
755
873
|
};
|
|
756
|
-
function
|
|
757
|
-
const t = (
|
|
758
|
-
let
|
|
759
|
-
return
|
|
760
|
-
}, n = (
|
|
761
|
-
var
|
|
762
|
-
const
|
|
763
|
-
let i = [];
|
|
764
|
-
if (typeof s.selectors == "string")
|
|
765
|
-
i = u ? Array.from(u.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
|
|
766
|
-
else if (Array.isArray(s.selectors))
|
|
767
|
-
for (const c of s.selectors)
|
|
768
|
-
c instanceof HTMLElement ? i.push(c) : i.push(c.$el);
|
|
769
|
-
else if (s.selectors instanceof HTMLElement)
|
|
770
|
-
i.push(s.selectors);
|
|
771
|
-
else if ((r = s.selectors) != null && r.value)
|
|
772
|
-
if (Array.isArray(s.selectors.value))
|
|
773
|
-
for (const c of s.selectors.value)
|
|
774
|
-
c instanceof HTMLElement ? i.push(c) : i.push(c.$el);
|
|
775
|
-
else
|
|
776
|
-
i.push(s.selectors.value);
|
|
777
|
-
return i;
|
|
778
|
-
}, o = (s) => {
|
|
779
|
-
const r = t(s);
|
|
874
|
+
function zt(e) {
|
|
875
|
+
const t = (a) => {
|
|
876
|
+
let l = null;
|
|
877
|
+
return a.parent && (typeof a.parent == "string" ? l = document.querySelector(a.parent) : a.parent instanceof HTMLElement ? l = a.parent : l = a.parent.value), l;
|
|
878
|
+
}, n = (a) => {
|
|
879
|
+
var l;
|
|
880
|
+
const i = t(a);
|
|
780
881
|
let u = [];
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
882
|
+
if (typeof a.selectors == "string")
|
|
883
|
+
u = i ? Array.from(i.querySelectorAll(a.selectors)) : Array.from(document.querySelectorAll(a.selectors));
|
|
884
|
+
else if (Array.isArray(a.selectors))
|
|
885
|
+
for (const c of a.selectors)
|
|
886
|
+
c instanceof HTMLElement ? u.push(c) : u.push(c.$el);
|
|
887
|
+
else if (a.selectors instanceof HTMLElement)
|
|
888
|
+
u.push(a.selectors);
|
|
889
|
+
else if ((l = a.selectors) != null && l.value)
|
|
890
|
+
if (Array.isArray(a.selectors.value))
|
|
891
|
+
for (const c of a.selectors.value)
|
|
892
|
+
c instanceof HTMLElement ? u.push(c) : u.push(c.$el);
|
|
893
|
+
else
|
|
894
|
+
u.push(a.selectors.value);
|
|
895
|
+
return u;
|
|
896
|
+
}, o = (a) => {
|
|
897
|
+
const l = t(a);
|
|
898
|
+
let i = [];
|
|
899
|
+
return a.selectors ? i = n(a) : l && (i = Array.from(l.children).filter((u) => V(u) && x(u))), i;
|
|
900
|
+
}, s = (a) => (l) => {
|
|
901
|
+
const i = Kt[l.key] || l.key.toLowerCase();
|
|
902
|
+
if (X.includes(i)) return;
|
|
903
|
+
const u = a.handlers || xe;
|
|
904
|
+
for (const c of Object.keys(u)) {
|
|
905
|
+
const [v, ...f] = c.split(".");
|
|
906
|
+
if (v === "keydown" && f.includes(i)) {
|
|
907
|
+
const p = u[c], y = f.filter((m) => X.includes(m)), I = X.some((m) => {
|
|
908
|
+
const h = m.charAt(0).toUpperCase() + m.slice(1);
|
|
909
|
+
return l.getModifierState(h);
|
|
792
910
|
});
|
|
793
|
-
if (
|
|
794
|
-
if (
|
|
795
|
-
for (const
|
|
796
|
-
if (f.includes(
|
|
797
|
-
const
|
|
798
|
-
|
|
911
|
+
if (y.length > 0) {
|
|
912
|
+
if (I) {
|
|
913
|
+
for (const m of X)
|
|
914
|
+
if (f.includes(m)) {
|
|
915
|
+
const h = m.charAt(0).toUpperCase() + m.slice(1);
|
|
916
|
+
l.getModifierState(h) && p(l);
|
|
799
917
|
}
|
|
800
918
|
}
|
|
801
919
|
} else
|
|
802
|
-
|
|
920
|
+
I || p(l);
|
|
803
921
|
}
|
|
804
922
|
}
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
for (const
|
|
808
|
-
const
|
|
809
|
-
for (const
|
|
810
|
-
const { focused: f } =
|
|
811
|
-
|
|
923
|
+
}, r = [];
|
|
924
|
+
se(() => {
|
|
925
|
+
for (const a of e) {
|
|
926
|
+
const l = t(a), i = o(a), u = s(a), c = l ? [l] : i;
|
|
927
|
+
for (const v of c) {
|
|
928
|
+
const { focused: f } = Ut(k(v)), p = O(f, (y) => {
|
|
929
|
+
y ? v.addEventListener("keydown", u) : v.removeEventListener("keydown", u);
|
|
812
930
|
});
|
|
813
|
-
|
|
931
|
+
r.push(p);
|
|
814
932
|
}
|
|
815
933
|
}
|
|
816
|
-
}),
|
|
817
|
-
for (const
|
|
818
|
-
|
|
934
|
+
}), We(() => {
|
|
935
|
+
for (const a of r)
|
|
936
|
+
a();
|
|
819
937
|
});
|
|
820
938
|
}
|
|
821
|
-
const
|
|
939
|
+
const Gt = {
|
|
822
940
|
class: "adatepicker",
|
|
823
941
|
tabindex: "0",
|
|
824
942
|
ref: "datepicker"
|
|
825
|
-
},
|
|
943
|
+
}, Xt = {
|
|
826
944
|
colspan: "5",
|
|
827
945
|
tabindex: -1
|
|
828
|
-
},
|
|
946
|
+
}, Jt = ["onClick", "onKeydown"], Qt = 6, De = 7, Zt = /* @__PURE__ */ C({
|
|
829
947
|
__name: "ADatePicker",
|
|
830
948
|
props: {
|
|
831
949
|
modelValue: { default: /* @__PURE__ */ new Date() },
|
|
@@ -833,46 +951,46 @@ const qt = {
|
|
|
833
951
|
},
|
|
834
952
|
emits: ["update:modelValue"],
|
|
835
953
|
setup(e, { expose: t }) {
|
|
836
|
-
const n =
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
841
|
-
|
|
954
|
+
const n = W(e, "modelValue"), o = k(new Date(n.value)), s = k(o.value.getMonth()), r = k(o.value.getFullYear()), a = k([]), l = Me("datepicker");
|
|
955
|
+
se(async () => {
|
|
956
|
+
i(), await Ye();
|
|
957
|
+
const b = document.getElementsByClassName("selectedDate");
|
|
958
|
+
if (b.length > 0)
|
|
959
|
+
b[0].focus();
|
|
842
960
|
else {
|
|
843
|
-
const
|
|
844
|
-
|
|
961
|
+
const _ = document.getElementsByClassName("todaysDate");
|
|
962
|
+
_.length > 0 && _[0].focus();
|
|
845
963
|
}
|
|
846
964
|
});
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
for (const
|
|
851
|
-
|
|
965
|
+
const i = () => {
|
|
966
|
+
a.value = [];
|
|
967
|
+
const b = new Date(r.value, s.value, 1), _ = b.getDay(), S = b.setDate(b.getDate() - _);
|
|
968
|
+
for (const P of Array(43).keys())
|
|
969
|
+
a.value.push(S + P * 864e5);
|
|
852
970
|
};
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
|
|
971
|
+
O([s, r], i);
|
|
972
|
+
const u = () => r.value -= 1, c = () => r.value += 1, v = () => {
|
|
973
|
+
s.value == 0 ? (s.value = 11, u()) : s.value -= 1;
|
|
856
974
|
}, f = () => {
|
|
857
|
-
|
|
858
|
-
}, p = (
|
|
859
|
-
const
|
|
860
|
-
if (
|
|
861
|
-
return
|
|
862
|
-
},
|
|
863
|
-
n.value = o.value = new Date(
|
|
864
|
-
},
|
|
975
|
+
s.value == 11 ? (s.value = 0, c()) : s.value += 1;
|
|
976
|
+
}, p = (b) => {
|
|
977
|
+
const _ = /* @__PURE__ */ new Date();
|
|
978
|
+
if (s.value === _.getMonth())
|
|
979
|
+
return _.toDateString() === new Date(b).toDateString();
|
|
980
|
+
}, y = (b) => new Date(b).toDateString() === new Date(o.value).toDateString(), I = (b, _) => (b - 1) * De + _, m = (b, _) => a.value[I(b, _)], h = (b) => {
|
|
981
|
+
n.value = o.value = new Date(a.value[b]);
|
|
982
|
+
}, E = T(() => new Date(r.value, s.value, 1).toLocaleDateString(void 0, {
|
|
865
983
|
year: "numeric",
|
|
866
984
|
month: "long"
|
|
867
985
|
}));
|
|
868
|
-
return
|
|
986
|
+
return zt([
|
|
869
987
|
{
|
|
870
|
-
parent:
|
|
988
|
+
parent: l,
|
|
871
989
|
selectors: "td",
|
|
872
990
|
handlers: {
|
|
873
|
-
...
|
|
874
|
-
"keydown.pageup":
|
|
875
|
-
"keydown.shift.pageup":
|
|
991
|
+
...xe,
|
|
992
|
+
"keydown.pageup": v,
|
|
993
|
+
"keydown.shift.pageup": u,
|
|
876
994
|
"keydown.pagedown": f,
|
|
877
995
|
"keydown.shift.pagedown": c,
|
|
878
996
|
// TODO: this is a hack to override the stonecrop enter handler;
|
|
@@ -882,23 +1000,23 @@ const qt = {
|
|
|
882
1000
|
}
|
|
883
1001
|
}
|
|
884
1002
|
}
|
|
885
|
-
]), t({ currentMonth:
|
|
1003
|
+
]), t({ currentMonth: s, currentYear: r, selectedDate: o }), (b, _) => (g(), w("div", Gt, [
|
|
886
1004
|
d("table", null, [
|
|
887
1005
|
d("tbody", null, [
|
|
888
1006
|
d("tr", null, [
|
|
889
1007
|
d("td", {
|
|
890
1008
|
id: "previous-month-btn",
|
|
891
|
-
onClick:
|
|
1009
|
+
onClick: v,
|
|
892
1010
|
tabindex: -1
|
|
893
1011
|
}, "<"),
|
|
894
|
-
d("th",
|
|
1012
|
+
d("th", Xt, A(E.value), 1),
|
|
895
1013
|
d("td", {
|
|
896
1014
|
id: "next-month-btn",
|
|
897
1015
|
onClick: f,
|
|
898
1016
|
tabindex: -1
|
|
899
1017
|
}, ">")
|
|
900
1018
|
]),
|
|
901
|
-
|
|
1019
|
+
_[0] || (_[0] = d("tr", { class: "days-header" }, [
|
|
902
1020
|
d("td", null, "M"),
|
|
903
1021
|
d("td", null, "T"),
|
|
904
1022
|
d("td", null, "W"),
|
|
@@ -907,37 +1025,37 @@ const qt = {
|
|
|
907
1025
|
d("td", null, "S"),
|
|
908
1026
|
d("td", null, "S")
|
|
909
1027
|
], -1)),
|
|
910
|
-
(g(),
|
|
911
|
-
(g(),
|
|
1028
|
+
(g(), w(j, null, K(Qt, (S) => d("tr", { key: S }, [
|
|
1029
|
+
(g(), w(j, null, K(De, (P) => d("td", {
|
|
912
1030
|
ref_for: !0,
|
|
913
1031
|
ref: "celldate",
|
|
914
|
-
key:
|
|
1032
|
+
key: I(S, P),
|
|
915
1033
|
contenteditable: !1,
|
|
916
1034
|
spellcheck: !1,
|
|
917
1035
|
tabindex: 0,
|
|
918
|
-
onClick:
|
|
919
|
-
onKeydown:
|
|
920
|
-
class:
|
|
921
|
-
todaysDate: p(
|
|
922
|
-
selectedDate:
|
|
1036
|
+
onClick: Te((Pe) => h(I(S, P)), ["prevent", "stop"]),
|
|
1037
|
+
onKeydown: R((Pe) => h(I(S, P)), ["enter"]),
|
|
1038
|
+
class: Q({
|
|
1039
|
+
todaysDate: p(m(S, P)),
|
|
1040
|
+
selectedDate: y(m(S, P))
|
|
923
1041
|
})
|
|
924
|
-
},
|
|
1042
|
+
}, A(new Date(m(S, P)).getDate()), 43, Jt)), 64))
|
|
925
1043
|
])), 64))
|
|
926
1044
|
])
|
|
927
1045
|
])
|
|
928
1046
|
], 512));
|
|
929
1047
|
}
|
|
930
|
-
}),
|
|
1048
|
+
}), en = /* @__PURE__ */ L(Zt, [["__scopeId", "data-v-f49cfd40"]]), tn = /* @__PURE__ */ C({
|
|
931
1049
|
__name: "CollapseButton",
|
|
932
1050
|
props: {
|
|
933
1051
|
collapsed: { type: Boolean }
|
|
934
1052
|
},
|
|
935
1053
|
setup(e) {
|
|
936
|
-
return (t, n) => (g(),
|
|
937
|
-
class:
|
|
1054
|
+
return (t, n) => (g(), w("button", {
|
|
1055
|
+
class: Q(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
|
|
938
1056
|
}, "×", 2));
|
|
939
1057
|
}
|
|
940
|
-
}),
|
|
1058
|
+
}), nn = /* @__PURE__ */ L(tn, [["__scopeId", "data-v-6f1c1b45"]]), on = { class: "aform" }, ln = /* @__PURE__ */ C({
|
|
941
1059
|
__name: "AForm",
|
|
942
1060
|
props: {
|
|
943
1061
|
modelValue: {},
|
|
@@ -946,36 +1064,36 @@ const qt = {
|
|
|
946
1064
|
},
|
|
947
1065
|
emits: ["update:modelValue"],
|
|
948
1066
|
setup(e, { emit: t }) {
|
|
949
|
-
const n = t, o =
|
|
950
|
-
let
|
|
951
|
-
for (const [
|
|
952
|
-
["component", "fieldtype"].includes(
|
|
953
|
-
return
|
|
954
|
-
},
|
|
955
|
-
get: () => e.modelValue.map((
|
|
1067
|
+
const n = t, o = k(e.data || {}), s = (a) => {
|
|
1068
|
+
let l = {};
|
|
1069
|
+
for (const [i, u] of Object.entries(a))
|
|
1070
|
+
["component", "fieldtype"].includes(i) || (l[i] = u), i === "rows" && u && u.length === 0 && (l.rows = o.value[a.fieldname]);
|
|
1071
|
+
return l;
|
|
1072
|
+
}, r = T({
|
|
1073
|
+
get: () => e.modelValue.map((a, l) => T({
|
|
956
1074
|
get() {
|
|
957
|
-
return
|
|
1075
|
+
return a.value;
|
|
958
1076
|
},
|
|
959
|
-
set: (
|
|
960
|
-
e.modelValue[
|
|
1077
|
+
set: (i) => {
|
|
1078
|
+
e.modelValue[l].value = i, n("update:modelValue", e.modelValue);
|
|
961
1079
|
}
|
|
962
1080
|
})),
|
|
963
1081
|
set: () => {
|
|
964
1082
|
}
|
|
965
1083
|
});
|
|
966
|
-
return (
|
|
967
|
-
(g(!0),
|
|
968
|
-
key:
|
|
969
|
-
schema:
|
|
970
|
-
modelValue:
|
|
971
|
-
"onUpdate:modelValue": (c) =>
|
|
972
|
-
data: o.value[
|
|
973
|
-
readonly:
|
|
1084
|
+
return (a, l) => (g(), w("form", on, [
|
|
1085
|
+
(g(!0), w(j, null, K(a.modelValue, (i, u) => (g(), oe(je(i.component), Ke({
|
|
1086
|
+
key: u,
|
|
1087
|
+
schema: i,
|
|
1088
|
+
modelValue: r.value[u].value,
|
|
1089
|
+
"onUpdate:modelValue": (c) => r.value[u].value = c,
|
|
1090
|
+
data: o.value[i.fieldname],
|
|
1091
|
+
readonly: a.readonly,
|
|
974
1092
|
ref_for: !0
|
|
975
|
-
},
|
|
1093
|
+
}, s(i)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
|
|
976
1094
|
]));
|
|
977
1095
|
}
|
|
978
|
-
}),
|
|
1096
|
+
}), Ve = /* @__PURE__ */ L(ln, [["__scopeId", "data-v-68845234"]]), sn = /* @__PURE__ */ C({
|
|
979
1097
|
__name: "AFieldset",
|
|
980
1098
|
props: {
|
|
981
1099
|
schema: {},
|
|
@@ -984,65 +1102,65 @@ const qt = {
|
|
|
984
1102
|
data: {}
|
|
985
1103
|
},
|
|
986
1104
|
setup(e, { expose: t }) {
|
|
987
|
-
const n =
|
|
988
|
-
|
|
1105
|
+
const n = k(!1), o = k(e.data || []), s = k(e.schema), r = (a) => {
|
|
1106
|
+
a.preventDefault(), e.collapsible && (n.value = !n.value);
|
|
989
1107
|
};
|
|
990
|
-
return t({ collapsed: n }), (
|
|
1108
|
+
return t({ collapsed: n }), (a, l) => (g(), w("fieldset", null, [
|
|
991
1109
|
d("legend", {
|
|
992
|
-
onClick:
|
|
993
|
-
onSubmit:
|
|
1110
|
+
onClick: r,
|
|
1111
|
+
onSubmit: r
|
|
994
1112
|
}, [
|
|
995
|
-
|
|
996
|
-
|
|
1113
|
+
Se(A(a.label) + " ", 1),
|
|
1114
|
+
a.collapsible ? (g(), oe(nn, {
|
|
997
1115
|
key: 0,
|
|
998
1116
|
collapsed: n.value
|
|
999
|
-
}, null, 8, ["collapsed"])) :
|
|
1117
|
+
}, null, 8, ["collapsed"])) : ae("", !0)
|
|
1000
1118
|
], 32),
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
modelValue:
|
|
1004
|
-
"onUpdate:modelValue":
|
|
1119
|
+
ze(a.$slots, "default", { collapsed: n.value }, () => [
|
|
1120
|
+
M(Ge(Ve, {
|
|
1121
|
+
modelValue: s.value,
|
|
1122
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => s.value = i),
|
|
1005
1123
|
data: o.value
|
|
1006
1124
|
}, null, 8, ["modelValue", "data"]), [
|
|
1007
|
-
[
|
|
1125
|
+
[U, !n.value]
|
|
1008
1126
|
])
|
|
1009
1127
|
], !0)
|
|
1010
1128
|
]));
|
|
1011
1129
|
}
|
|
1012
|
-
}),
|
|
1130
|
+
}), an = /* @__PURE__ */ L(sn, [["__scopeId", "data-v-e7ea7e12"]]), rn = { class: "aform_form-element aform_file-attach aform__grid--full" }, un = {
|
|
1013
1131
|
key: 0,
|
|
1014
1132
|
class: "aform_file-attach-feedback"
|
|
1015
|
-
},
|
|
1133
|
+
}, cn = ["disabled"], dn = /* @__PURE__ */ C({
|
|
1016
1134
|
__name: "AFileAttach",
|
|
1017
1135
|
props: {
|
|
1018
1136
|
label: {}
|
|
1019
1137
|
},
|
|
1020
1138
|
setup(e) {
|
|
1021
|
-
const { files: t, open: n, reset: o, onChange:
|
|
1022
|
-
return
|
|
1023
|
-
|
|
1139
|
+
const { files: t, open: n, reset: o, onChange: s } = yt(), r = T(() => `${t.value.length} ${t.value.length === 1 ? "file" : "files"}`);
|
|
1140
|
+
return s((a) => a), (a, l) => (g(), w("div", rn, [
|
|
1141
|
+
$(t) ? (g(), w("div", un, [
|
|
1024
1142
|
d("p", null, [
|
|
1025
|
-
|
|
1026
|
-
d("b", null,
|
|
1143
|
+
l[2] || (l[2] = Se(" You have selected: ")),
|
|
1144
|
+
d("b", null, A(r.value), 1)
|
|
1027
1145
|
]),
|
|
1028
|
-
(g(!0),
|
|
1029
|
-
key:
|
|
1030
|
-
},
|
|
1031
|
-
])) :
|
|
1146
|
+
(g(!0), w(j, null, K($(t), (i) => (g(), w("li", {
|
|
1147
|
+
key: i.name
|
|
1148
|
+
}, A(i.name), 1))), 128))
|
|
1149
|
+
])) : ae("", !0),
|
|
1032
1150
|
d("button", {
|
|
1033
1151
|
type: "button",
|
|
1034
|
-
onClick:
|
|
1152
|
+
onClick: l[0] || (l[0] = (i) => $(n)()),
|
|
1035
1153
|
class: "aform_form-btn"
|
|
1036
|
-
},
|
|
1154
|
+
}, A(a.label), 1),
|
|
1037
1155
|
d("button", {
|
|
1038
1156
|
type: "button",
|
|
1039
|
-
disabled:
|
|
1040
|
-
onClick:
|
|
1157
|
+
disabled: !$(t),
|
|
1158
|
+
onClick: l[1] || (l[1] = (i) => $(o)()),
|
|
1041
1159
|
class: "aform_form-btn"
|
|
1042
|
-
}, "Reset", 8,
|
|
1160
|
+
}, "Reset", 8, cn)
|
|
1043
1161
|
]));
|
|
1044
1162
|
}
|
|
1045
|
-
}),
|
|
1163
|
+
}), fn = /* @__PURE__ */ L(dn, [["__scopeId", "data-v-0b3a11cc"]]), mn = { class: "aform_form-element" }, pn = ["id", "disabled", "required"], vn = ["for"], hn = ["innerHTML"], gn = /* @__PURE__ */ C({
|
|
1046
1164
|
__name: "ANumericInput",
|
|
1047
1165
|
props: /* @__PURE__ */ G({
|
|
1048
1166
|
schema: {},
|
|
@@ -1058,31 +1176,31 @@ const qt = {
|
|
|
1058
1176
|
}),
|
|
1059
1177
|
emits: ["update:modelValue"],
|
|
1060
1178
|
setup(e) {
|
|
1061
|
-
const t =
|
|
1062
|
-
return (n, o) => (g(),
|
|
1063
|
-
|
|
1179
|
+
const t = W(e, "modelValue");
|
|
1180
|
+
return (n, o) => (g(), w("div", mn, [
|
|
1181
|
+
M(d("input", {
|
|
1064
1182
|
class: "aform_input-field",
|
|
1065
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1183
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
|
|
1066
1184
|
type: "number",
|
|
1067
1185
|
id: n.uuid,
|
|
1068
1186
|
disabled: n.readonly,
|
|
1069
1187
|
required: n.required
|
|
1070
|
-
}, null, 8,
|
|
1071
|
-
[
|
|
1188
|
+
}, null, 8, pn), [
|
|
1189
|
+
[B, t.value]
|
|
1072
1190
|
]),
|
|
1073
1191
|
d("label", {
|
|
1074
1192
|
class: "aform_field-label",
|
|
1075
1193
|
for: n.uuid
|
|
1076
|
-
},
|
|
1077
|
-
|
|
1194
|
+
}, A(n.label), 9, vn),
|
|
1195
|
+
M(d("p", {
|
|
1078
1196
|
class: "aform_error",
|
|
1079
1197
|
innerHTML: n.validation.errorMessage
|
|
1080
|
-
}, null, 8,
|
|
1081
|
-
[
|
|
1198
|
+
}, null, 8, hn), [
|
|
1199
|
+
[U, n.validation.errorMessage]
|
|
1082
1200
|
])
|
|
1083
1201
|
]));
|
|
1084
1202
|
}
|
|
1085
|
-
}),
|
|
1203
|
+
}), Ee = {
|
|
1086
1204
|
date: "##/##/####",
|
|
1087
1205
|
datetime: "####/##/## ##:##",
|
|
1088
1206
|
time: "##:##",
|
|
@@ -1090,57 +1208,57 @@ const qt = {
|
|
|
1090
1208
|
phone: "(###) ### - ####",
|
|
1091
1209
|
card: "#### #### #### ####"
|
|
1092
1210
|
};
|
|
1093
|
-
function
|
|
1211
|
+
function yn(e) {
|
|
1094
1212
|
try {
|
|
1095
1213
|
return Function(`"use strict";return (${e})`)();
|
|
1096
1214
|
} catch {
|
|
1097
1215
|
}
|
|
1098
1216
|
}
|
|
1099
|
-
function
|
|
1100
|
-
var n, o,
|
|
1217
|
+
function bn(e) {
|
|
1218
|
+
var n, o, s;
|
|
1101
1219
|
let t = e.value;
|
|
1102
1220
|
if (t) {
|
|
1103
|
-
const
|
|
1104
|
-
if (
|
|
1105
|
-
const
|
|
1106
|
-
t = a
|
|
1221
|
+
const r = yn(t);
|
|
1222
|
+
if (r) {
|
|
1223
|
+
const a = (n = e.instance) == null ? void 0 : n.locale;
|
|
1224
|
+
t = r(a);
|
|
1107
1225
|
}
|
|
1108
1226
|
} else {
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1227
|
+
const r = (o = e.instance) == null ? void 0 : o.schema, a = (s = r == null ? void 0 : r.fieldtype) == null ? void 0 : s.toLowerCase();
|
|
1228
|
+
a && Ee[a] && (t = Ee[a]);
|
|
1111
1229
|
}
|
|
1112
1230
|
return t;
|
|
1113
1231
|
}
|
|
1114
|
-
function
|
|
1232
|
+
function wn(e, t) {
|
|
1115
1233
|
let n = e;
|
|
1116
1234
|
const o = [t, "/", "-", "(", ")", " "];
|
|
1117
|
-
for (const
|
|
1118
|
-
n = n.replaceAll(
|
|
1235
|
+
for (const s of o)
|
|
1236
|
+
n = n.replaceAll(s, "");
|
|
1119
1237
|
return n;
|
|
1120
1238
|
}
|
|
1121
|
-
function
|
|
1239
|
+
function kn(e, t, n) {
|
|
1122
1240
|
let o = t;
|
|
1123
|
-
for (const
|
|
1124
|
-
const
|
|
1125
|
-
if (
|
|
1126
|
-
const
|
|
1127
|
-
o =
|
|
1241
|
+
for (const s of e) {
|
|
1242
|
+
const r = o.indexOf(n);
|
|
1243
|
+
if (r !== -1) {
|
|
1244
|
+
const a = o.substring(0, r), l = o.substring(r + 1);
|
|
1245
|
+
o = a + s + l;
|
|
1128
1246
|
}
|
|
1129
1247
|
}
|
|
1130
1248
|
return o.slice(0, t.length);
|
|
1131
1249
|
}
|
|
1132
|
-
function
|
|
1133
|
-
var
|
|
1134
|
-
const n =
|
|
1250
|
+
function _n(e, t) {
|
|
1251
|
+
var a;
|
|
1252
|
+
const n = bn(t);
|
|
1135
1253
|
if (!n) return;
|
|
1136
|
-
const o = "#",
|
|
1137
|
-
if (
|
|
1138
|
-
const
|
|
1139
|
-
(
|
|
1254
|
+
const o = "#", s = e.value, r = wn(s, o);
|
|
1255
|
+
if (r) {
|
|
1256
|
+
const l = kn(r, n, o);
|
|
1257
|
+
(a = t.instance) != null && a.maskFilled && (t.instance.maskFilled = !l.includes(o)), e.value = l;
|
|
1140
1258
|
} else
|
|
1141
1259
|
e.value = n;
|
|
1142
1260
|
}
|
|
1143
|
-
const
|
|
1261
|
+
const Dn = { class: "aform_form-element" }, En = ["id", "disabled", "maxlength", "required"], Mn = ["for"], An = ["innerHTML"], In = /* @__PURE__ */ C({
|
|
1144
1262
|
__name: "ATextInput",
|
|
1145
1263
|
props: /* @__PURE__ */ G({
|
|
1146
1264
|
schema: {},
|
|
@@ -1156,35 +1274,35 @@ const vn = { class: "aform_form-element" }, hn = ["id", "disabled", "maxlength",
|
|
|
1156
1274
|
}),
|
|
1157
1275
|
emits: ["update:modelValue"],
|
|
1158
1276
|
setup(e) {
|
|
1159
|
-
const t =
|
|
1160
|
-
return (o,
|
|
1161
|
-
|
|
1277
|
+
const t = k(!0), n = W(e, "modelValue");
|
|
1278
|
+
return (o, s) => (g(), w("div", Dn, [
|
|
1279
|
+
M(d("input", {
|
|
1162
1280
|
class: "aform_input-field",
|
|
1163
|
-
"onUpdate:modelValue":
|
|
1281
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => n.value = r),
|
|
1164
1282
|
id: o.uuid,
|
|
1165
1283
|
disabled: o.readonly,
|
|
1166
1284
|
maxlength: o.mask ? t.value && o.mask.length : void 0,
|
|
1167
1285
|
required: o.required
|
|
1168
|
-
}, null, 8,
|
|
1169
|
-
[
|
|
1170
|
-
[
|
|
1286
|
+
}, null, 8, En), [
|
|
1287
|
+
[B, n.value],
|
|
1288
|
+
[$(_n), o.mask]
|
|
1171
1289
|
]),
|
|
1172
1290
|
d("label", {
|
|
1173
1291
|
class: "aform_field-label",
|
|
1174
1292
|
for: o.uuid
|
|
1175
|
-
},
|
|
1176
|
-
|
|
1293
|
+
}, A(o.label), 9, Mn),
|
|
1294
|
+
M(d("p", {
|
|
1177
1295
|
class: "aform_error",
|
|
1178
1296
|
innerHTML: o.validation.errorMessage
|
|
1179
|
-
}, null, 8,
|
|
1180
|
-
[
|
|
1297
|
+
}, null, 8, An), [
|
|
1298
|
+
[U, o.validation.errorMessage]
|
|
1181
1299
|
])
|
|
1182
1300
|
]));
|
|
1183
1301
|
}
|
|
1184
|
-
}),
|
|
1302
|
+
}), Cn = { class: "login-container" }, Tn = { class: "account-container" }, Sn = { class: "account-header" }, $n = { id: "account-title" }, Ln = { id: "account-subtitle" }, xn = { class: "login-form-container" }, Vn = { class: "login-form-email aform_form-element" }, Pn = ["disabled"], On = { class: "login-form-password aform_form-element" }, Fn = ["disabled"], Rn = ["disabled"], Hn = {
|
|
1185
1303
|
key: 0,
|
|
1186
1304
|
class: "material-symbols-outlined loading-icon"
|
|
1187
|
-
},
|
|
1305
|
+
}, Bn = /* @__PURE__ */ C({
|
|
1188
1306
|
__name: "Login",
|
|
1189
1307
|
props: {
|
|
1190
1308
|
headerTitle: { default: "Login" },
|
|
@@ -1192,94 +1310,94 @@ const vn = { class: "aform_form-element" }, hn = ["id", "disabled", "maxlength",
|
|
|
1192
1310
|
},
|
|
1193
1311
|
emits: ["loginFailed", "loginSuccess"],
|
|
1194
1312
|
setup(e, { emit: t }) {
|
|
1195
|
-
const n = t, o =
|
|
1196
|
-
function
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
1313
|
+
const n = t, o = k(""), s = k(""), r = k(!1), a = k(!1);
|
|
1314
|
+
function l(i) {
|
|
1315
|
+
if (i.preventDefault(), r.value = !0, a.value) {
|
|
1316
|
+
r.value = !1, n("loginFailed");
|
|
1199
1317
|
return;
|
|
1200
1318
|
}
|
|
1201
|
-
|
|
1319
|
+
r.value = !1, n("loginSuccess");
|
|
1202
1320
|
}
|
|
1203
|
-
return (
|
|
1321
|
+
return (i, u) => (g(), w("div", Cn, [
|
|
1204
1322
|
d("div", null, [
|
|
1205
|
-
d("div",
|
|
1206
|
-
d("div",
|
|
1207
|
-
d("h1",
|
|
1208
|
-
d("p",
|
|
1323
|
+
d("div", Tn, [
|
|
1324
|
+
d("div", Sn, [
|
|
1325
|
+
d("h1", $n, A(i.headerTitle), 1),
|
|
1326
|
+
d("p", Ln, A(i.headerSubtitle), 1)
|
|
1209
1327
|
]),
|
|
1210
|
-
d("form", { onSubmit:
|
|
1211
|
-
d("div",
|
|
1212
|
-
d("div",
|
|
1213
|
-
|
|
1328
|
+
d("form", { onSubmit: l }, [
|
|
1329
|
+
d("div", xn, [
|
|
1330
|
+
d("div", Vn, [
|
|
1331
|
+
u[2] || (u[2] = d("label", {
|
|
1214
1332
|
id: "login-email",
|
|
1215
1333
|
for: "email",
|
|
1216
1334
|
class: "aform_field-label"
|
|
1217
1335
|
}, "Email", -1)),
|
|
1218
|
-
|
|
1336
|
+
M(d("input", {
|
|
1219
1337
|
id: "email",
|
|
1220
1338
|
class: "aform_input-field",
|
|
1221
1339
|
name: "email",
|
|
1222
1340
|
placeholder: "name@example.com",
|
|
1223
1341
|
type: "email",
|
|
1224
|
-
"onUpdate:modelValue":
|
|
1342
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
1225
1343
|
"auto-capitalize": "none",
|
|
1226
1344
|
"auto-complete": "email",
|
|
1227
1345
|
"auto-correct": "off",
|
|
1228
|
-
disabled:
|
|
1229
|
-
}, null, 8,
|
|
1230
|
-
[
|
|
1346
|
+
disabled: r.value
|
|
1347
|
+
}, null, 8, Pn), [
|
|
1348
|
+
[B, o.value]
|
|
1231
1349
|
])
|
|
1232
1350
|
]),
|
|
1233
|
-
d("div",
|
|
1234
|
-
|
|
1351
|
+
d("div", On, [
|
|
1352
|
+
u[3] || (u[3] = d("label", {
|
|
1235
1353
|
id: "login-password",
|
|
1236
1354
|
for: "password",
|
|
1237
1355
|
class: "aform_field-label"
|
|
1238
1356
|
}, "Password", -1)),
|
|
1239
|
-
|
|
1357
|
+
M(d("input", {
|
|
1240
1358
|
id: "password",
|
|
1241
1359
|
class: "aform_input-field",
|
|
1242
1360
|
name: "password",
|
|
1243
1361
|
type: "password",
|
|
1244
|
-
"onUpdate:modelValue":
|
|
1245
|
-
disabled:
|
|
1246
|
-
}, null, 8,
|
|
1247
|
-
[
|
|
1362
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c),
|
|
1363
|
+
disabled: r.value
|
|
1364
|
+
}, null, 8, Fn), [
|
|
1365
|
+
[B, s.value]
|
|
1248
1366
|
])
|
|
1249
1367
|
]),
|
|
1250
1368
|
d("button", {
|
|
1251
1369
|
class: "btn",
|
|
1252
|
-
onClick:
|
|
1253
|
-
disabled:
|
|
1370
|
+
onClick: l,
|
|
1371
|
+
disabled: r.value || !o.value || !s.value
|
|
1254
1372
|
}, [
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
], 8,
|
|
1373
|
+
r.value ? (g(), w("span", Hn, "progress_activity")) : ae("", !0),
|
|
1374
|
+
u[4] || (u[4] = d("span", { id: "login-form-button" }, "Login", -1))
|
|
1375
|
+
], 8, Rn)
|
|
1258
1376
|
])
|
|
1259
1377
|
], 32),
|
|
1260
|
-
|
|
1378
|
+
u[5] || (u[5] = d("button", { class: "btn" }, [
|
|
1261
1379
|
d("span", { id: "forgot-password-button" }, "Forgot password?")
|
|
1262
1380
|
], -1))
|
|
1263
1381
|
])
|
|
1264
1382
|
])
|
|
1265
1383
|
]));
|
|
1266
1384
|
}
|
|
1267
|
-
}),
|
|
1268
|
-
function
|
|
1269
|
-
e.component("ACheckbox",
|
|
1385
|
+
}), Wn = /* @__PURE__ */ L(Bn, [["__scopeId", "data-v-6cbd3add"]]);
|
|
1386
|
+
function Un(e) {
|
|
1387
|
+
e.component("ACheckbox", nt), e.component("ACombobox", ot), e.component("ADate", it), e.component("ADropdown", Ct), e.component("ADatePicker", en), e.component("AFieldset", an), e.component("AFileAttach", fn), e.component("AForm", Ve), e.component("ANumericInput", gn), e.component("ATextInput", In);
|
|
1270
1388
|
}
|
|
1271
1389
|
export {
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1390
|
+
nt as ACheckbox,
|
|
1391
|
+
ot as AComboBox,
|
|
1392
|
+
it as ADate,
|
|
1393
|
+
en as ADatePicker,
|
|
1394
|
+
Ct as ADropdown,
|
|
1395
|
+
an as AFieldset,
|
|
1396
|
+
fn as AFileAttach,
|
|
1397
|
+
Ve as AForm,
|
|
1398
|
+
gn as ANumericInput,
|
|
1399
|
+
In as ATextInput,
|
|
1400
|
+
Wn as Login,
|
|
1401
|
+
Un as install
|
|
1284
1402
|
};
|
|
1285
1403
|
//# sourceMappingURL=aform.js.map
|