@stonecrop/aform 0.2.24 → 0.2.26
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/src/tsdoc-metadata.json +11 -0
- package/dist/aform.d.ts +55 -0
- package/dist/aform.js +477 -354
- package/dist/aform.js.map +1 -1
- package/dist/aform.tsbuildinfo +1 -0
- package/dist/aform.umd.cjs +1 -1
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/directives/mask.js +88 -0
- package/dist/index.js +31 -0
- package/dist/src/directives/mask.d.ts +3 -0
- package/dist/src/directives/mask.d.ts.map +1 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +27 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/index.js +0 -0
- package/package.json +24 -27
- package/src/components/AForm.vue +2 -1
- package/src/components/form/ACheckbox.vue +7 -1
- package/src/components/form/ADropdown.vue +1 -1
- package/src/components/form/AFieldset.vue +1 -1
- package/src/components/form/ANumericInput.vue +7 -1
- package/src/components/form/ATextInput.vue +2 -2
- package/src/directives/mask.ts +2 -1
- package/src/index.ts +20 -1
- package/src/theme/aform.css +1 -1
- package/src/theme/fields.css +34 -35
- package/src/theme/login.css +0 -2
- package/src/types/index.ts +31 -0
- package/src/histoire.setup.ts +0 -26
package/dist/aform.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as A, mergeModels as V, useModel as x, openBlock as h, createElementBlock as g, createElementVNode as i, toDisplayString as E, withDirectives as D, vModelCheckbox as pe, vShow as H, resolveComponent as me, createBlock as G, withCtx as ve, ref as f, onMounted as W, onUnmounted as he, normalizeClass as R, withKeys as q, vModelText as I, Fragment as O, renderList as U, watch as B, onBeforeUnmount as _e, computed as $, unref as ie, getCurrentScope as ge, onScopeDispose as ye, getCurrentInstance as be, nextTick as we, withModifiers as ke, resolveDynamicComponent as De, mergeProps as Me, createTextVNode as Ee, createCommentVNode as ue, renderSlot as Ae, createVNode as Ce } from "vue";
|
|
2
|
+
const Te = { class: "aform__form-element" }, Se = ["for"], Le = { class: "aform__checkbox-container aform__input-field" }, $e = ["id", "readonly", "required"], Ve = ["innerHTML"], xe = /* @__PURE__ */ A({
|
|
3
3
|
__name: "ACheckbox",
|
|
4
|
-
props: /* @__PURE__ */
|
|
4
|
+
props: /* @__PURE__ */ V({
|
|
5
5
|
label: {},
|
|
6
6
|
required: { type: Boolean },
|
|
7
7
|
readOnly: { type: Boolean },
|
|
@@ -13,57 +13,57 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
|
|
|
13
13
|
}),
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
15
|
setup(e) {
|
|
16
|
-
const t =
|
|
17
|
-
return (n, o) => (
|
|
18
|
-
|
|
16
|
+
const t = x(e, "modelValue");
|
|
17
|
+
return (n, o) => (h(), g("div", Te, [
|
|
18
|
+
i("label", {
|
|
19
19
|
class: "aform__field-label",
|
|
20
20
|
for: n.uuid
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
}, E(n.label), 9, Se),
|
|
22
|
+
i("span", Le, [
|
|
23
|
+
D(i("input", {
|
|
24
24
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
25
25
|
type: "checkbox",
|
|
26
26
|
id: n.uuid,
|
|
27
27
|
class: "aform__checkbox",
|
|
28
28
|
readonly: n.readOnly,
|
|
29
29
|
required: n.required
|
|
30
|
-
}, null, 8,
|
|
31
|
-
[
|
|
30
|
+
}, null, 8, $e), [
|
|
31
|
+
[pe, t.value]
|
|
32
32
|
])
|
|
33
33
|
]),
|
|
34
|
-
|
|
34
|
+
D(i("p", {
|
|
35
35
|
class: "error",
|
|
36
36
|
innerHTML: n.validation.errorMessage
|
|
37
|
-
}, null, 8,
|
|
38
|
-
[
|
|
37
|
+
}, null, 8, Ve), [
|
|
38
|
+
[H, n.validation.errorMessage]
|
|
39
39
|
])
|
|
40
40
|
]));
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
], -1),
|
|
42
|
+
}), He = /* @__PURE__ */ i("div", null, [
|
|
43
|
+
/* @__PURE__ */ i("input", { type: "text" }),
|
|
44
|
+
/* @__PURE__ */ i("input", { type: "text" }),
|
|
45
|
+
/* @__PURE__ */ i("input", { type: "text" })
|
|
46
|
+
], -1), Ie = /* @__PURE__ */ A({
|
|
47
47
|
__name: "AComboBox",
|
|
48
48
|
props: ["event", "cellData", "tableID"],
|
|
49
49
|
setup(e) {
|
|
50
50
|
return (t, n) => {
|
|
51
|
-
const o =
|
|
52
|
-
return
|
|
51
|
+
const o = me("ATableModal");
|
|
52
|
+
return h(), G(o, {
|
|
53
53
|
event: e.event,
|
|
54
54
|
cellData: e.cellData,
|
|
55
55
|
class: "amodal"
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
57
|
+
default: ve(() => [
|
|
58
|
+
He
|
|
59
59
|
]),
|
|
60
60
|
_: 1
|
|
61
61
|
}, 8, ["event", "cellData"]);
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
}),
|
|
64
|
+
}), Pe = ["id", "disabled", "required", "value"], Be = ["for"], Fe = ["innerHTML"], qe = /* @__PURE__ */ A({
|
|
65
65
|
__name: "ADate",
|
|
66
|
-
props: /* @__PURE__ */
|
|
66
|
+
props: /* @__PURE__ */ V({
|
|
67
67
|
label: { default: "Date" },
|
|
68
68
|
required: { type: Boolean },
|
|
69
69
|
readonly: { type: Boolean },
|
|
@@ -75,11 +75,11 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
|
|
|
75
75
|
}),
|
|
76
76
|
emits: ["update:modelValue"],
|
|
77
77
|
setup(e) {
|
|
78
|
-
const t =
|
|
78
|
+
const t = x(e, "modelValue"), n = f(null), o = () => {
|
|
79
79
|
n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
|
|
80
80
|
};
|
|
81
|
-
return (l,
|
|
82
|
-
|
|
81
|
+
return (l, a) => (h(), g("div", null, [
|
|
82
|
+
i("input", {
|
|
83
83
|
ref_key: "dateRef",
|
|
84
84
|
ref: n,
|
|
85
85
|
type: "date",
|
|
@@ -88,29 +88,29 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
|
|
|
88
88
|
required: l.required,
|
|
89
89
|
value: t.value,
|
|
90
90
|
onClick: o
|
|
91
|
-
}, null, 8,
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
}, null, 8, Pe),
|
|
92
|
+
i("label", { for: l.uuid }, E(l.label), 9, Be),
|
|
93
|
+
D(i("p", {
|
|
94
94
|
innerHTML: l.validation.errorMessage
|
|
95
|
-
}, null, 8,
|
|
96
|
-
[
|
|
95
|
+
}, null, 8, Fe), [
|
|
96
|
+
[H, l.validation.errorMessage]
|
|
97
97
|
])
|
|
98
98
|
]));
|
|
99
99
|
}
|
|
100
|
-
}),
|
|
100
|
+
}), Y = (e, t) => {
|
|
101
101
|
const n = e.__vccOpts || e;
|
|
102
102
|
for (const [o, l] of t)
|
|
103
103
|
n[o] = l;
|
|
104
104
|
return n;
|
|
105
|
-
},
|
|
105
|
+
}, Re = /* @__PURE__ */ Y(qe, [["__scopeId", "data-v-69d0f23d"]]), Oe = { class: "input-wrapper" }, Ue = {
|
|
106
106
|
id: "autocomplete-results",
|
|
107
107
|
class: "autocomplete-results"
|
|
108
|
-
},
|
|
108
|
+
}, We = {
|
|
109
109
|
key: 0,
|
|
110
110
|
class: "loading autocomplete-result"
|
|
111
|
-
},
|
|
111
|
+
}, Ye = ["onClick"], Ke = /* @__PURE__ */ A({
|
|
112
112
|
__name: "ADropdown",
|
|
113
|
-
props: /* @__PURE__ */
|
|
113
|
+
props: /* @__PURE__ */ V({
|
|
114
114
|
label: {},
|
|
115
115
|
items: {},
|
|
116
116
|
isAsync: { type: Boolean }
|
|
@@ -118,151 +118,191 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
|
|
|
118
118
|
modelValue: {},
|
|
119
119
|
modelModifiers: {}
|
|
120
120
|
}),
|
|
121
|
-
emits: /* @__PURE__ */
|
|
121
|
+
emits: /* @__PURE__ */ V(["filterChanged"], ["update:modelValue"]),
|
|
122
122
|
setup(e, { emit: t }) {
|
|
123
|
-
const n = e, o = t, l =
|
|
124
|
-
|
|
123
|
+
const n = e, o = t, l = f(n.items), a = x(e, "modelValue"), r = f(!1), s = f(0), c = f(!1), u = f(null);
|
|
124
|
+
W(() => {
|
|
125
125
|
document.addEventListener("click", _), p();
|
|
126
|
-
}),
|
|
126
|
+
}), he(() => {
|
|
127
127
|
document.removeEventListener("click", _);
|
|
128
128
|
});
|
|
129
|
-
const d = (
|
|
130
|
-
|
|
129
|
+
const d = (m) => {
|
|
130
|
+
a.value = m, b();
|
|
131
131
|
}, p = () => {
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
}, _ = (
|
|
136
|
-
b(),
|
|
132
|
+
a.value ? l.value = n.items.filter((m) => m.toLowerCase().indexOf(a.value.toLowerCase()) > -1) : l.value = n.items;
|
|
133
|
+
}, v = () => {
|
|
134
|
+
c.value = !0, n.isAsync ? (r.value = !0, o("filterChanged", a.value)) : p();
|
|
135
|
+
}, _ = () => {
|
|
136
|
+
b(), s.value = 0;
|
|
137
137
|
}, b = () => {
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
138
|
+
c.value = !1, n.items.includes(a.value) || (a.value = "");
|
|
139
|
+
}, S = () => {
|
|
140
|
+
s.value < l.value.length && (s.value = s.value + 1);
|
|
141
|
+
}, k = () => {
|
|
142
|
+
s.value > 0 && (s.value = s.value - 1);
|
|
143
143
|
}, L = () => {
|
|
144
|
-
|
|
144
|
+
a.value = l.value[s.value], b(), s.value = 0;
|
|
145
145
|
};
|
|
146
|
-
return (
|
|
147
|
-
class:
|
|
146
|
+
return (m, y) => (h(), g("div", {
|
|
147
|
+
class: R(["autocomplete", { isOpen: c.value }])
|
|
148
148
|
}, [
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
i("div", Oe, [
|
|
150
|
+
D(i("input", {
|
|
151
151
|
ref_key: "mopInput",
|
|
152
152
|
ref: u,
|
|
153
153
|
type: "text",
|
|
154
|
-
onInput:
|
|
155
|
-
onFocus:
|
|
156
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
154
|
+
onInput: v,
|
|
155
|
+
onFocus: v,
|
|
156
|
+
"onUpdate:modelValue": y[0] || (y[0] = (w) => a.value = w),
|
|
157
157
|
onKeydown: [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
q(S, ["down"]),
|
|
159
|
+
q(k, ["up"]),
|
|
160
|
+
q(L, ["enter"])
|
|
161
161
|
]
|
|
162
162
|
}, null, 544), [
|
|
163
|
-
[
|
|
163
|
+
[I, a.value]
|
|
164
164
|
]),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
key:
|
|
168
|
-
onClick: (
|
|
169
|
-
class:
|
|
170
|
-
},
|
|
165
|
+
D(i("ul", Ue, [
|
|
166
|
+
r.value ? (h(), g("li", We, "Loading results...")) : (h(!0), g(O, { key: 1 }, U(l.value, (w, M) => (h(), g("li", {
|
|
167
|
+
key: M,
|
|
168
|
+
onClick: (Z) => d(w),
|
|
169
|
+
class: R(["autocomplete-result", { "is-active": M === s.value }])
|
|
170
|
+
}, E(w), 11, Ye))), 128))
|
|
171
171
|
], 512), [
|
|
172
|
-
[
|
|
172
|
+
[H, c.value]
|
|
173
173
|
]),
|
|
174
|
-
|
|
174
|
+
i("label", null, E(m.label), 1)
|
|
175
175
|
])
|
|
176
176
|
], 2));
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
function
|
|
180
|
-
return
|
|
179
|
+
function ce(e) {
|
|
180
|
+
return ge() ? (ye(e), !0) : !1;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return typeof e == "function" ? e() :
|
|
182
|
+
function N(e) {
|
|
183
|
+
return typeof e == "function" ? e() : ie(e);
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const ze = typeof window < "u" && typeof document < "u";
|
|
186
186
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
187
|
-
const Ge = Object.prototype.toString,
|
|
187
|
+
const Ge = (e) => e != null, Ne = Object.prototype.toString, je = (e) => Ne.call(e) === "[object Object]", Je = () => {
|
|
188
188
|
};
|
|
189
|
-
function
|
|
189
|
+
function P(e) {
|
|
190
190
|
var t;
|
|
191
|
-
const n =
|
|
191
|
+
const n = N(e);
|
|
192
192
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
193
193
|
}
|
|
194
|
-
const
|
|
195
|
-
function
|
|
194
|
+
const K = ze ? window : void 0;
|
|
195
|
+
function z(...e) {
|
|
196
196
|
let t, n, o, l;
|
|
197
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t =
|
|
198
|
-
return
|
|
197
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = K) : [t, n, o, l] = e, !t)
|
|
198
|
+
return Je;
|
|
199
199
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
() => [
|
|
200
|
+
const a = [], r = () => {
|
|
201
|
+
a.forEach((d) => d()), a.length = 0;
|
|
202
|
+
}, s = (d, p, v, _) => (d.addEventListener(p, v, _), () => d.removeEventListener(p, v, _)), c = B(
|
|
203
|
+
() => [P(t), N(l)],
|
|
204
204
|
([d, p]) => {
|
|
205
|
-
if (
|
|
205
|
+
if (r(), !d)
|
|
206
206
|
return;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
...n.flatMap((_) => o.map((b) =>
|
|
207
|
+
const v = je(p) ? { ...p } : p;
|
|
208
|
+
a.push(
|
|
209
|
+
...n.flatMap((_) => o.map((b) => s(d, _, b, v)))
|
|
210
210
|
);
|
|
211
211
|
},
|
|
212
212
|
{ immediate: !0, flush: "post" }
|
|
213
213
|
), u = () => {
|
|
214
|
-
|
|
214
|
+
c(), r();
|
|
215
215
|
};
|
|
216
|
-
return
|
|
216
|
+
return ce(u), u;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Qe() {
|
|
219
|
+
const e = f(!1), t = be();
|
|
220
|
+
return t && W(() => {
|
|
221
|
+
e.value = !0;
|
|
222
|
+
}, t), e;
|
|
223
|
+
}
|
|
224
|
+
function Xe(e) {
|
|
225
|
+
const t = Qe();
|
|
226
|
+
return $(() => (t.value, !!e()));
|
|
227
|
+
}
|
|
228
|
+
function Ze(e, t, n = {}) {
|
|
229
|
+
const { window: o = K, ...l } = n;
|
|
230
|
+
let a;
|
|
231
|
+
const r = Xe(() => o && "MutationObserver" in o), s = () => {
|
|
232
|
+
a && (a.disconnect(), a = void 0);
|
|
233
|
+
}, c = $(() => {
|
|
234
|
+
const v = N(e), _ = (Array.isArray(v) ? v : [v]).map(P).filter(Ge);
|
|
235
|
+
return new Set(_);
|
|
236
|
+
}), u = B(
|
|
237
|
+
() => c.value,
|
|
238
|
+
(v) => {
|
|
239
|
+
s(), r.value && v.size && (a = new MutationObserver(t), v.forEach((_) => a.observe(_, l)));
|
|
240
|
+
},
|
|
241
|
+
{ immediate: !0, flush: "post" }
|
|
242
|
+
), d = () => a == null ? void 0 : a.takeRecords(), p = () => {
|
|
243
|
+
s(), u();
|
|
244
|
+
};
|
|
245
|
+
return ce(p), {
|
|
246
|
+
isSupported: r,
|
|
247
|
+
stop: p,
|
|
248
|
+
takeRecords: d
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function et(e = {}) {
|
|
219
252
|
var t;
|
|
220
253
|
const {
|
|
221
|
-
window: n =
|
|
222
|
-
deep: o = !0
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
254
|
+
window: n = K,
|
|
255
|
+
deep: o = !0,
|
|
256
|
+
triggerOnRemoval: l = !1
|
|
257
|
+
} = e, a = (t = e.document) != null ? t : n == null ? void 0 : n.document, r = () => {
|
|
258
|
+
var u;
|
|
259
|
+
let d = a == null ? void 0 : a.activeElement;
|
|
226
260
|
if (o)
|
|
227
|
-
for (;
|
|
228
|
-
|
|
229
|
-
return
|
|
230
|
-
}, s =
|
|
261
|
+
for (; d != null && d.shadowRoot; )
|
|
262
|
+
d = (u = d == null ? void 0 : d.shadowRoot) == null ? void 0 : u.activeElement;
|
|
263
|
+
return d;
|
|
264
|
+
}, s = f(), c = () => {
|
|
231
265
|
s.value = r();
|
|
232
266
|
};
|
|
233
|
-
return n && (
|
|
234
|
-
|
|
235
|
-
}, !0),
|
|
267
|
+
return n && (z(n, "blur", (u) => {
|
|
268
|
+
u.relatedTarget === null && c();
|
|
269
|
+
}, !0), z(n, "focus", c, !0)), l && Ze(a, (u) => {
|
|
270
|
+
u.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
|
|
271
|
+
d === s.value && c();
|
|
272
|
+
});
|
|
273
|
+
}, {
|
|
274
|
+
childList: !0,
|
|
275
|
+
subtree: !0
|
|
276
|
+
}), c(), s;
|
|
236
277
|
}
|
|
237
|
-
function
|
|
238
|
-
const n =
|
|
239
|
-
return { focused:
|
|
278
|
+
function tt(e, t = {}) {
|
|
279
|
+
const n = et(t), o = $(() => P(e));
|
|
280
|
+
return { focused: $(() => o.value && n.value ? o.value.contains(n.value) : !1) };
|
|
240
281
|
}
|
|
241
|
-
function
|
|
242
|
-
const o =
|
|
243
|
-
if (!t)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (!s)
|
|
282
|
+
function nt(e, { window: t = K, scrollTarget: n } = {}) {
|
|
283
|
+
const o = f(!1), l = () => {
|
|
284
|
+
if (!t) return;
|
|
285
|
+
const a = t.document, r = P(e);
|
|
286
|
+
if (!r)
|
|
247
287
|
o.value = !1;
|
|
248
288
|
else {
|
|
249
|
-
const
|
|
250
|
-
o.value =
|
|
289
|
+
const s = r.getBoundingClientRect();
|
|
290
|
+
o.value = s.top <= (t.innerHeight || a.documentElement.clientHeight) && s.left <= (t.innerWidth || a.documentElement.clientWidth) && s.bottom >= 0 && s.right >= 0;
|
|
251
291
|
}
|
|
252
292
|
};
|
|
253
|
-
return
|
|
254
|
-
() =>
|
|
293
|
+
return B(
|
|
294
|
+
() => P(e),
|
|
255
295
|
() => l(),
|
|
256
296
|
{ immediate: !0, flush: "post" }
|
|
257
|
-
), t &&
|
|
297
|
+
), t && z(n || t, "scroll", l, {
|
|
258
298
|
capture: !1,
|
|
259
299
|
passive: !0
|
|
260
300
|
}), o;
|
|
261
301
|
}
|
|
262
302
|
const C = (e) => {
|
|
263
|
-
let t =
|
|
303
|
+
let t = nt(e).value;
|
|
264
304
|
return t = t && e.offsetHeight > 0, t;
|
|
265
|
-
}, T = (e) => e.tabIndex >= 0,
|
|
305
|
+
}, T = (e) => e.tabIndex >= 0, ee = (e) => {
|
|
266
306
|
const t = e.target;
|
|
267
307
|
return j(t);
|
|
268
308
|
}, j = (e) => {
|
|
@@ -279,25 +319,25 @@ const C = (e) => {
|
|
|
279
319
|
o && (n = o);
|
|
280
320
|
}
|
|
281
321
|
return n && (!T(n) || !C(n)) ? j(n) : n;
|
|
282
|
-
},
|
|
322
|
+
}, ot = (e) => {
|
|
283
323
|
var t;
|
|
284
324
|
const n = e.target;
|
|
285
325
|
let o;
|
|
286
326
|
if (n instanceof HTMLTableCellElement) {
|
|
287
327
|
const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
288
328
|
if (l) {
|
|
289
|
-
const
|
|
290
|
-
|
|
329
|
+
const a = l.firstElementChild.children[n.cellIndex];
|
|
330
|
+
a && (o = a);
|
|
291
331
|
}
|
|
292
332
|
} else if (n instanceof HTMLTableRowElement) {
|
|
293
333
|
const l = n.parentElement;
|
|
294
334
|
if (l) {
|
|
295
|
-
const
|
|
296
|
-
|
|
335
|
+
const a = l.firstElementChild;
|
|
336
|
+
a && (o = a);
|
|
297
337
|
}
|
|
298
338
|
}
|
|
299
339
|
return o && (!T(o) || !C(o)) ? J(o) : o;
|
|
300
|
-
},
|
|
340
|
+
}, te = (e) => {
|
|
301
341
|
const t = e.target;
|
|
302
342
|
return J(t);
|
|
303
343
|
}, J = (e) => {
|
|
@@ -314,28 +354,28 @@ const C = (e) => {
|
|
|
314
354
|
o && (n = o);
|
|
315
355
|
}
|
|
316
356
|
return n && (!T(n) || !C(n)) ? J(n) : n;
|
|
317
|
-
},
|
|
357
|
+
}, lt = (e) => {
|
|
318
358
|
var t;
|
|
319
359
|
const n = e.target;
|
|
320
360
|
let o;
|
|
321
361
|
if (n instanceof HTMLTableCellElement) {
|
|
322
362
|
const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
|
|
323
363
|
if (l) {
|
|
324
|
-
const
|
|
325
|
-
|
|
364
|
+
const a = l.lastElementChild.children[n.cellIndex];
|
|
365
|
+
a && (o = a);
|
|
326
366
|
}
|
|
327
367
|
} else if (n instanceof HTMLTableRowElement) {
|
|
328
368
|
const l = n.parentElement;
|
|
329
369
|
if (l) {
|
|
330
|
-
const
|
|
331
|
-
|
|
370
|
+
const a = l.lastElementChild;
|
|
371
|
+
a && (o = a);
|
|
332
372
|
}
|
|
333
373
|
}
|
|
334
374
|
return o && (!T(o) || !C(o)) ? j(o) : o;
|
|
335
|
-
},
|
|
375
|
+
}, ne = (e) => {
|
|
336
376
|
const t = e.target;
|
|
337
|
-
return
|
|
338
|
-
},
|
|
377
|
+
return Q(t);
|
|
378
|
+
}, Q = (e) => {
|
|
339
379
|
var t;
|
|
340
380
|
let n;
|
|
341
381
|
if (e.previousElementSibling)
|
|
@@ -344,11 +384,11 @@ const C = (e) => {
|
|
|
344
384
|
const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
|
|
345
385
|
n = o == null ? void 0 : o.lastElementChild;
|
|
346
386
|
}
|
|
347
|
-
return n && (!T(n) || !C(n)) ?
|
|
348
|
-
},
|
|
387
|
+
return n && (!T(n) || !C(n)) ? Q(n) : n;
|
|
388
|
+
}, oe = (e) => {
|
|
349
389
|
const t = e.target;
|
|
350
|
-
return
|
|
351
|
-
},
|
|
390
|
+
return X(t);
|
|
391
|
+
}, X = (e) => {
|
|
352
392
|
var t;
|
|
353
393
|
let n;
|
|
354
394
|
if (e.nextElementSibling)
|
|
@@ -357,158 +397,157 @@ const C = (e) => {
|
|
|
357
397
|
const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
|
|
358
398
|
n = o == null ? void 0 : o.firstElementChild;
|
|
359
399
|
}
|
|
360
|
-
return n && (!T(n) || !C(n)) ?
|
|
361
|
-
}, oe = (e) => {
|
|
362
|
-
const t = e.target.parentElement.firstElementChild;
|
|
363
|
-
return t && (!T(t) || !C(t)) ? Q(t) : t;
|
|
400
|
+
return n && (!T(n) || !C(n)) ? X(n) : n;
|
|
364
401
|
}, le = (e) => {
|
|
402
|
+
const t = e.target.parentElement.firstElementChild;
|
|
403
|
+
return t && (!T(t) || !C(t)) ? X(t) : t;
|
|
404
|
+
}, ae = (e) => {
|
|
365
405
|
const t = e.target.parentElement.lastElementChild;
|
|
366
|
-
return t && (!T(t) || !C(t)) ?
|
|
367
|
-
},
|
|
406
|
+
return t && (!T(t) || !C(t)) ? Q(t) : t;
|
|
407
|
+
}, F = ["alt", "control", "shift", "meta"], at = {
|
|
368
408
|
ArrowUp: "up",
|
|
369
409
|
ArrowDown: "down",
|
|
370
410
|
ArrowLeft: "left",
|
|
371
411
|
ArrowRight: "right"
|
|
372
|
-
},
|
|
412
|
+
}, de = {
|
|
373
413
|
"keydown.up": (e) => {
|
|
374
|
-
const t =
|
|
414
|
+
const t = ee(e);
|
|
375
415
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
376
416
|
},
|
|
377
417
|
"keydown.down": (e) => {
|
|
378
|
-
const t =
|
|
418
|
+
const t = te(e);
|
|
379
419
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
380
420
|
},
|
|
381
421
|
"keydown.left": (e) => {
|
|
382
|
-
const t =
|
|
422
|
+
const t = ne(e);
|
|
383
423
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
384
424
|
},
|
|
385
425
|
"keydown.right": (e) => {
|
|
386
|
-
const t =
|
|
426
|
+
const t = oe(e);
|
|
387
427
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
388
428
|
},
|
|
389
429
|
"keydown.control.up": (e) => {
|
|
390
|
-
const t =
|
|
430
|
+
const t = ot(e);
|
|
391
431
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
392
432
|
},
|
|
393
433
|
"keydown.control.down": (e) => {
|
|
394
|
-
const t =
|
|
434
|
+
const t = lt(e);
|
|
395
435
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
396
436
|
},
|
|
397
437
|
"keydown.control.left": (e) => {
|
|
398
|
-
const t =
|
|
438
|
+
const t = le(e);
|
|
399
439
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
400
440
|
},
|
|
401
441
|
"keydown.control.right": (e) => {
|
|
402
|
-
const t =
|
|
442
|
+
const t = ae(e);
|
|
403
443
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
404
444
|
},
|
|
405
445
|
"keydown.end": (e) => {
|
|
406
|
-
const t =
|
|
446
|
+
const t = ae(e);
|
|
407
447
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
408
448
|
},
|
|
409
449
|
"keydown.enter": (e) => {
|
|
410
450
|
if (e.target instanceof HTMLTableCellElement) {
|
|
411
451
|
e.preventDefault(), e.stopPropagation();
|
|
412
|
-
const t =
|
|
452
|
+
const t = te(e);
|
|
413
453
|
t && t.focus();
|
|
414
454
|
}
|
|
415
455
|
},
|
|
416
456
|
"keydown.shift.enter": (e) => {
|
|
417
457
|
if (e.target instanceof HTMLTableCellElement) {
|
|
418
458
|
e.preventDefault(), e.stopPropagation();
|
|
419
|
-
const t =
|
|
459
|
+
const t = ee(e);
|
|
420
460
|
t && t.focus();
|
|
421
461
|
}
|
|
422
462
|
},
|
|
423
463
|
"keydown.home": (e) => {
|
|
424
|
-
const t =
|
|
464
|
+
const t = le(e);
|
|
425
465
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
426
466
|
},
|
|
427
467
|
"keydown.tab": (e) => {
|
|
428
|
-
const t =
|
|
468
|
+
const t = oe(e);
|
|
429
469
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
430
470
|
},
|
|
431
471
|
"keydown.shift.tab": (e) => {
|
|
432
|
-
const t =
|
|
472
|
+
const t = ne(e);
|
|
433
473
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
434
474
|
}
|
|
435
475
|
};
|
|
436
|
-
function
|
|
437
|
-
const t = (
|
|
438
|
-
let
|
|
439
|
-
return
|
|
440
|
-
}, n = (
|
|
441
|
-
const
|
|
442
|
-
let
|
|
443
|
-
if (typeof
|
|
444
|
-
|
|
445
|
-
else if (Array.isArray(
|
|
446
|
-
for (const u of
|
|
447
|
-
u instanceof HTMLElement ?
|
|
448
|
-
else if (
|
|
449
|
-
|
|
450
|
-
else if (Array.isArray(
|
|
451
|
-
for (const u of
|
|
452
|
-
u instanceof HTMLElement ?
|
|
476
|
+
function st(e) {
|
|
477
|
+
const t = (r) => {
|
|
478
|
+
let s = null;
|
|
479
|
+
return r.parent && (typeof r.parent == "string" ? s = document.querySelector(r.parent) : r.parent instanceof HTMLElement ? s = r.parent : s = r.parent.value), s;
|
|
480
|
+
}, n = (r) => {
|
|
481
|
+
const s = t(r);
|
|
482
|
+
let c = [];
|
|
483
|
+
if (typeof r.selectors == "string")
|
|
484
|
+
c = s ? Array.from(s.querySelectorAll(r.selectors)) : Array.from(document.querySelectorAll(r.selectors));
|
|
485
|
+
else if (Array.isArray(r.selectors))
|
|
486
|
+
for (const u of r.selectors)
|
|
487
|
+
u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
|
|
488
|
+
else if (r.selectors instanceof HTMLElement)
|
|
489
|
+
c.push(r.selectors);
|
|
490
|
+
else if (Array.isArray(r.selectors.value))
|
|
491
|
+
for (const u of r.selectors.value)
|
|
492
|
+
u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
|
|
453
493
|
else
|
|
454
|
-
|
|
455
|
-
return
|
|
456
|
-
}, o = (
|
|
457
|
-
const
|
|
458
|
-
let
|
|
459
|
-
return
|
|
460
|
-
}, l = (
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
-
const u = s.handlers || ie;
|
|
494
|
+
c.push(r.selectors.value);
|
|
495
|
+
return c;
|
|
496
|
+
}, o = (r) => {
|
|
497
|
+
const s = t(r);
|
|
498
|
+
let c = [];
|
|
499
|
+
return r.selectors ? c = n(r) : s && (c = Array.from(s.children).filter((u) => T(u) && C(u))), c;
|
|
500
|
+
}, l = (r) => (s) => {
|
|
501
|
+
const c = at[s.key] || s.key.toLowerCase();
|
|
502
|
+
if (F.includes(c)) return;
|
|
503
|
+
const u = r.handlers || de;
|
|
465
504
|
for (const d of Object.keys(u)) {
|
|
466
|
-
const [p, ...
|
|
467
|
-
if (p === "keydown" &&
|
|
468
|
-
const _ = u[d], b =
|
|
469
|
-
const L =
|
|
470
|
-
return
|
|
505
|
+
const [p, ...v] = d.split(".");
|
|
506
|
+
if (p === "keydown" && v.includes(c)) {
|
|
507
|
+
const _ = u[d], b = v.filter((k) => F.includes(k)), S = F.some((k) => {
|
|
508
|
+
const L = k.charAt(0).toUpperCase() + k.slice(1);
|
|
509
|
+
return s.getModifierState(L);
|
|
471
510
|
});
|
|
472
511
|
if (b.length > 0) {
|
|
473
|
-
if (
|
|
474
|
-
for (const
|
|
475
|
-
if (
|
|
476
|
-
const L =
|
|
477
|
-
|
|
512
|
+
if (S) {
|
|
513
|
+
for (const k of F)
|
|
514
|
+
if (v.includes(k)) {
|
|
515
|
+
const L = k.charAt(0).toUpperCase() + k.slice(1);
|
|
516
|
+
s.getModifierState(L) && _(s);
|
|
478
517
|
}
|
|
479
518
|
}
|
|
480
519
|
} else
|
|
481
|
-
|
|
520
|
+
S || _(s);
|
|
482
521
|
}
|
|
483
522
|
}
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
for (const
|
|
487
|
-
const
|
|
523
|
+
}, a = [];
|
|
524
|
+
W(() => {
|
|
525
|
+
for (const r of e) {
|
|
526
|
+
const s = t(r), c = o(r), u = l(r), d = s ? [s] : c;
|
|
488
527
|
for (const p of d) {
|
|
489
|
-
const { focused:
|
|
528
|
+
const { focused: v } = tt(f(p)), _ = B(v, (b) => {
|
|
490
529
|
b ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
|
|
491
530
|
});
|
|
492
|
-
|
|
531
|
+
a.push(_);
|
|
493
532
|
}
|
|
494
533
|
}
|
|
495
|
-
}),
|
|
496
|
-
for (const
|
|
497
|
-
|
|
534
|
+
}), _e(() => {
|
|
535
|
+
for (const r of a)
|
|
536
|
+
r();
|
|
498
537
|
});
|
|
499
538
|
}
|
|
500
|
-
const
|
|
539
|
+
const rt = {
|
|
501
540
|
colspan: "5",
|
|
502
541
|
tabindex: -1
|
|
503
|
-
},
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
], -1),
|
|
542
|
+
}, it = /* @__PURE__ */ i("tr", { class: "days-header" }, [
|
|
543
|
+
/* @__PURE__ */ i("td", null, "M"),
|
|
544
|
+
/* @__PURE__ */ i("td", null, "T"),
|
|
545
|
+
/* @__PURE__ */ i("td", null, "W"),
|
|
546
|
+
/* @__PURE__ */ i("td", null, "T"),
|
|
547
|
+
/* @__PURE__ */ i("td", null, "F"),
|
|
548
|
+
/* @__PURE__ */ i("td", null, "S"),
|
|
549
|
+
/* @__PURE__ */ i("td", null, "S")
|
|
550
|
+
], -1), ut = ["onClick", "onKeydown"], ct = 6, se = 7, dt = /* @__PURE__ */ A({
|
|
512
551
|
__name: "ADatePicker",
|
|
513
552
|
props: {
|
|
514
553
|
modelValue: { default: /* @__PURE__ */ new Date() },
|
|
@@ -516,46 +555,46 @@ const nt = {
|
|
|
516
555
|
},
|
|
517
556
|
emits: ["update:modelValue"],
|
|
518
557
|
setup(e) {
|
|
519
|
-
const t =
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
524
|
-
|
|
558
|
+
const t = x(e, "modelValue"), n = f(new Date(t.value)), o = f(n.value.getMonth()), l = f(n.value.getFullYear()), a = f([]), r = f(null);
|
|
559
|
+
W(async () => {
|
|
560
|
+
s(), await we();
|
|
561
|
+
const m = document.getElementsByClassName("selectedDate");
|
|
562
|
+
if (m.length > 0)
|
|
563
|
+
m[0].focus();
|
|
525
564
|
else {
|
|
526
565
|
const y = document.getElementsByClassName("todaysDate");
|
|
527
566
|
y.length > 0 && y[0].focus();
|
|
528
567
|
}
|
|
529
568
|
});
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
for (const
|
|
534
|
-
|
|
569
|
+
const s = () => {
|
|
570
|
+
a.value = [];
|
|
571
|
+
const m = new Date(l.value, o.value, 1), y = m.getDay(), w = m.setDate(m.getDate() - y);
|
|
572
|
+
for (const M of Array(43).keys())
|
|
573
|
+
a.value.push(w + M * 864e5);
|
|
535
574
|
};
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
o.value == 0 ? (o.value = 11,
|
|
575
|
+
B([o, l], s);
|
|
576
|
+
const c = () => l.value -= 1, u = () => l.value += 1, d = () => {
|
|
577
|
+
o.value == 0 ? (o.value = 11, c()) : o.value -= 1;
|
|
539
578
|
}, p = () => {
|
|
540
579
|
o.value == 11 ? (o.value = 0, u()) : o.value += 1;
|
|
541
|
-
},
|
|
580
|
+
}, v = (m) => {
|
|
542
581
|
const y = /* @__PURE__ */ new Date();
|
|
543
582
|
if (o.value === y.getMonth())
|
|
544
|
-
return y.toDateString() === new Date(
|
|
545
|
-
}, _ = (
|
|
546
|
-
t.value = n.value = new Date(
|
|
547
|
-
}, L =
|
|
583
|
+
return y.toDateString() === new Date(m).toDateString();
|
|
584
|
+
}, _ = (m) => new Date(m).toDateString() === new Date(n.value).toDateString(), b = (m, y) => (m - 1) * se + y, S = (m, y) => a.value[b(m, y)], k = (m) => {
|
|
585
|
+
t.value = n.value = new Date(a.value[m]);
|
|
586
|
+
}, L = $(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
|
|
548
587
|
year: "numeric",
|
|
549
588
|
month: "long"
|
|
550
589
|
}));
|
|
551
|
-
return
|
|
590
|
+
return st([
|
|
552
591
|
{
|
|
553
|
-
parent:
|
|
592
|
+
parent: r,
|
|
554
593
|
selectors: "td",
|
|
555
594
|
handlers: {
|
|
556
|
-
...
|
|
595
|
+
...de,
|
|
557
596
|
"keydown.pageup": d,
|
|
558
|
-
"keydown.shift.pageup":
|
|
597
|
+
"keydown.shift.pageup": c,
|
|
559
598
|
"keydown.pagedown": p,
|
|
560
599
|
"keydown.shift.pagedown": u,
|
|
561
600
|
// TODO: this is a hack to override the stonecrop enter handler;
|
|
@@ -565,57 +604,57 @@ const nt = {
|
|
|
565
604
|
}
|
|
566
605
|
}
|
|
567
606
|
}
|
|
568
|
-
]), (
|
|
607
|
+
]), (m, y) => (h(), g("div", {
|
|
569
608
|
class: "adatepicker",
|
|
570
609
|
tabindex: "0",
|
|
571
610
|
ref_key: "adatepicker",
|
|
572
|
-
ref:
|
|
611
|
+
ref: r
|
|
573
612
|
}, [
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
613
|
+
i("table", null, [
|
|
614
|
+
i("tr", null, [
|
|
615
|
+
i("td", {
|
|
577
616
|
id: "previous-month-btn",
|
|
578
617
|
onClick: d,
|
|
579
618
|
tabindex: -1
|
|
580
619
|
}, "<"),
|
|
581
|
-
|
|
582
|
-
|
|
620
|
+
i("th", rt, E(L.value), 1),
|
|
621
|
+
i("td", {
|
|
583
622
|
id: "next-month-btn",
|
|
584
623
|
onClick: p,
|
|
585
624
|
tabindex: -1
|
|
586
625
|
}, ">")
|
|
587
626
|
]),
|
|
588
|
-
|
|
589
|
-
(
|
|
590
|
-
(
|
|
627
|
+
it,
|
|
628
|
+
(h(), g(O, null, U(ct, (w) => i("tr", { key: w }, [
|
|
629
|
+
(h(), g(O, null, U(se, (M) => i("td", {
|
|
591
630
|
ref_for: !0,
|
|
592
631
|
ref: "celldate",
|
|
593
|
-
key: b(
|
|
632
|
+
key: b(w, M),
|
|
594
633
|
contenteditable: !1,
|
|
595
634
|
spellcheck: !1,
|
|
596
635
|
tabindex: 0,
|
|
597
|
-
onClick:
|
|
598
|
-
onKeydown:
|
|
599
|
-
class:
|
|
600
|
-
todaysDate:
|
|
601
|
-
selectedDate: _(
|
|
636
|
+
onClick: ke((Z) => k(b(w, M)), ["prevent", "stop"]),
|
|
637
|
+
onKeydown: q((Z) => k(b(w, M)), ["enter"]),
|
|
638
|
+
class: R({
|
|
639
|
+
todaysDate: v(S(w, M)),
|
|
640
|
+
selectedDate: _(S(w, M))
|
|
602
641
|
})
|
|
603
|
-
},
|
|
642
|
+
}, E(new Date(S(w, M)).getDate()), 43, ut)), 64))
|
|
604
643
|
])), 64))
|
|
605
644
|
])
|
|
606
645
|
], 512));
|
|
607
646
|
}
|
|
608
|
-
}),
|
|
647
|
+
}), ft = /* @__PURE__ */ A({
|
|
609
648
|
__name: "CollapseButton",
|
|
610
649
|
props: {
|
|
611
650
|
collapsed: { type: Boolean }
|
|
612
651
|
},
|
|
613
652
|
setup(e) {
|
|
614
|
-
return (t, n) => (
|
|
615
|
-
class:
|
|
653
|
+
return (t, n) => (h(), g("button", {
|
|
654
|
+
class: R(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
|
|
616
655
|
}, "×", 2));
|
|
617
656
|
}
|
|
618
|
-
}),
|
|
657
|
+
}), pt = /* @__PURE__ */ Y(ft, [["__scopeId", "data-v-6f1c1b45"]]), mt = { class: "aform" }, vt = /* @__PURE__ */ A({
|
|
619
658
|
__name: "AForm",
|
|
620
659
|
props: {
|
|
621
660
|
modelValue: {},
|
|
@@ -624,35 +663,36 @@ const nt = {
|
|
|
624
663
|
},
|
|
625
664
|
emits: ["update:modelValue"],
|
|
626
665
|
setup(e, { emit: t }) {
|
|
627
|
-
const n = e, o = t, l =
|
|
628
|
-
let
|
|
629
|
-
for (const [u, d] of Object.entries(
|
|
630
|
-
["component", "fieldtype"].includes(u) || (
|
|
631
|
-
return
|
|
632
|
-
},
|
|
633
|
-
get: () => n.modelValue.map((
|
|
666
|
+
const n = e, o = t, l = f(n.data || {}), a = (s) => {
|
|
667
|
+
let c = {};
|
|
668
|
+
for (const [u, d] of Object.entries(s))
|
|
669
|
+
["component", "fieldtype"].includes(u) || (c[u] = d), u === "rows" && d && d.length === 0 && (c.rows = l.value[s.fieldname]);
|
|
670
|
+
return c;
|
|
671
|
+
}, r = $({
|
|
672
|
+
get: () => n.modelValue.map((s, c) => $({
|
|
634
673
|
get() {
|
|
635
|
-
return
|
|
674
|
+
return s.value;
|
|
636
675
|
},
|
|
637
676
|
set: (u) => {
|
|
638
|
-
n.modelValue[
|
|
677
|
+
n.modelValue[c].value = u, o("update:modelValue", n.modelValue);
|
|
639
678
|
}
|
|
640
679
|
})),
|
|
641
680
|
set: () => {
|
|
642
681
|
}
|
|
643
682
|
});
|
|
644
|
-
return (
|
|
645
|
-
(
|
|
683
|
+
return (s, c) => (h(), g("form", mt, [
|
|
684
|
+
(h(!0), g(O, null, U(s.modelValue, (u, d) => (h(), G(De(u.component), Me({
|
|
646
685
|
key: d,
|
|
647
686
|
schema: u,
|
|
648
|
-
modelValue:
|
|
649
|
-
"onUpdate:modelValue": (p) =>
|
|
687
|
+
modelValue: r.value[d].value,
|
|
688
|
+
"onUpdate:modelValue": (p) => r.value[d].value = p,
|
|
650
689
|
data: l.value[u.fieldname],
|
|
651
|
-
readonly:
|
|
652
|
-
|
|
690
|
+
readonly: s.readonly,
|
|
691
|
+
ref_for: !0
|
|
692
|
+
}, a(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
|
|
653
693
|
]));
|
|
654
694
|
}
|
|
655
|
-
}),
|
|
695
|
+
}), fe = /* @__PURE__ */ Y(vt, [["__scopeId", "data-v-dc1a868d"]]), ht = /* @__PURE__ */ A({
|
|
656
696
|
__name: "AFieldset",
|
|
657
697
|
props: {
|
|
658
698
|
schema: {},
|
|
@@ -661,35 +701,35 @@ const nt = {
|
|
|
661
701
|
data: {}
|
|
662
702
|
},
|
|
663
703
|
setup(e) {
|
|
664
|
-
const t = e, n =
|
|
665
|
-
function s
|
|
666
|
-
|
|
704
|
+
const t = e, n = f(t.data || []), o = f(!1), l = f(t.collapsible), a = f(t.schema);
|
|
705
|
+
function r(s) {
|
|
706
|
+
s.preventDefault(), l.value && (o.value = !o.value);
|
|
667
707
|
}
|
|
668
|
-
return (
|
|
669
|
-
|
|
670
|
-
onClick:
|
|
671
|
-
onSubmit:
|
|
708
|
+
return (s, c) => (h(), g("fieldset", null, [
|
|
709
|
+
i("legend", {
|
|
710
|
+
onClick: r,
|
|
711
|
+
onSubmit: r
|
|
672
712
|
}, [
|
|
673
|
-
|
|
674
|
-
l.value ? (
|
|
713
|
+
Ee(E(s.label) + " ", 1),
|
|
714
|
+
l.value ? (h(), G(pt, {
|
|
675
715
|
key: 0,
|
|
676
716
|
collapsed: o.value
|
|
677
|
-
}, null, 8, ["collapsed"])) :
|
|
717
|
+
}, null, 8, ["collapsed"])) : ue("", !0)
|
|
678
718
|
], 32),
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
modelValue:
|
|
682
|
-
"onUpdate:modelValue":
|
|
719
|
+
Ae(s.$slots, "default", { collapsed: o.value }, () => [
|
|
720
|
+
D(Ce(fe, {
|
|
721
|
+
modelValue: a.value,
|
|
722
|
+
"onUpdate:modelValue": c[0] || (c[0] = (u) => a.value = u),
|
|
683
723
|
data: n.value
|
|
684
724
|
}, null, 8, ["modelValue", "data"]), [
|
|
685
|
-
[
|
|
725
|
+
[H, !o.value]
|
|
686
726
|
])
|
|
687
727
|
], !0)
|
|
688
728
|
]));
|
|
689
729
|
}
|
|
690
|
-
}),
|
|
730
|
+
}), _t = /* @__PURE__ */ Y(ht, [["__scopeId", "data-v-b89db0c0"]]), gt = { class: "aform__form-element" }, yt = ["for"], bt = ["id", "disabled", "required"], wt = ["innerHTML"], kt = /* @__PURE__ */ A({
|
|
691
731
|
__name: "ANumericInput",
|
|
692
|
-
props: /* @__PURE__ */
|
|
732
|
+
props: /* @__PURE__ */ V({
|
|
693
733
|
label: {},
|
|
694
734
|
required: { type: Boolean },
|
|
695
735
|
readonly: { type: Boolean },
|
|
@@ -701,31 +741,31 @@ const nt = {
|
|
|
701
741
|
}),
|
|
702
742
|
emits: ["update:modelValue"],
|
|
703
743
|
setup(e) {
|
|
704
|
-
const t =
|
|
705
|
-
return (n, o) => (
|
|
706
|
-
|
|
744
|
+
const t = x(e, "modelValue");
|
|
745
|
+
return (n, o) => (h(), g("div", gt, [
|
|
746
|
+
i("label", {
|
|
707
747
|
class: "aform__field-label",
|
|
708
748
|
for: n.uuid
|
|
709
|
-
},
|
|
710
|
-
|
|
749
|
+
}, E(n.label), 9, yt),
|
|
750
|
+
D(i("input", {
|
|
711
751
|
class: "aform__input-field",
|
|
712
752
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
713
753
|
type: "number",
|
|
714
754
|
id: n.uuid,
|
|
715
755
|
disabled: n.readonly,
|
|
716
756
|
required: n.required
|
|
717
|
-
}, null, 8,
|
|
718
|
-
[
|
|
757
|
+
}, null, 8, bt), [
|
|
758
|
+
[I, t.value]
|
|
719
759
|
]),
|
|
720
|
-
|
|
760
|
+
D(i("p", {
|
|
721
761
|
class: "error",
|
|
722
762
|
innerHTML: n.validation.errorMessage
|
|
723
|
-
}, null, 8,
|
|
724
|
-
[
|
|
763
|
+
}, null, 8, wt), [
|
|
764
|
+
[H, n.validation.errorMessage]
|
|
725
765
|
])
|
|
726
766
|
]));
|
|
727
767
|
}
|
|
728
|
-
}),
|
|
768
|
+
}), re = {
|
|
729
769
|
date: "##/##/####",
|
|
730
770
|
datetime: "####/##/## ##:##",
|
|
731
771
|
time: "##:##",
|
|
@@ -733,28 +773,28 @@ const nt = {
|
|
|
733
773
|
phone: "(###) ### - ####",
|
|
734
774
|
card: "#### #### #### ####"
|
|
735
775
|
};
|
|
736
|
-
function
|
|
776
|
+
function Dt(e) {
|
|
737
777
|
try {
|
|
738
778
|
return Function(`"use strict";return (${e})`)();
|
|
739
779
|
} catch {
|
|
740
780
|
}
|
|
741
781
|
}
|
|
742
|
-
function
|
|
782
|
+
function Mt(e) {
|
|
743
783
|
var n;
|
|
744
784
|
let t = e.value;
|
|
745
785
|
if (t) {
|
|
746
|
-
const o =
|
|
786
|
+
const o = Dt(t);
|
|
747
787
|
if (o) {
|
|
748
788
|
const l = e.instance.locale;
|
|
749
789
|
t = o(l);
|
|
750
790
|
}
|
|
751
791
|
} else {
|
|
752
792
|
const o = e.instance.schema, l = (n = o == null ? void 0 : o.fieldtype) == null ? void 0 : n.toLowerCase();
|
|
753
|
-
l &&
|
|
793
|
+
l && re[l] && (t = re[l]);
|
|
754
794
|
}
|
|
755
795
|
return t;
|
|
756
796
|
}
|
|
757
|
-
function
|
|
797
|
+
function Et(e, t) {
|
|
758
798
|
t || (t = "#");
|
|
759
799
|
let n = e;
|
|
760
800
|
const o = [t, "/", "-", "(", ")", " "];
|
|
@@ -762,32 +802,31 @@ function bt(e, t) {
|
|
|
762
802
|
n = n.replaceAll(l, "");
|
|
763
803
|
return n;
|
|
764
804
|
}
|
|
765
|
-
function
|
|
805
|
+
function At(e, t, n) {
|
|
766
806
|
n || (n = "#");
|
|
767
807
|
let o = t;
|
|
768
808
|
for (const l of e) {
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
771
|
-
const
|
|
772
|
-
o =
|
|
809
|
+
const a = o.indexOf(n);
|
|
810
|
+
if (a !== -1) {
|
|
811
|
+
const r = o.substring(0, a), s = o.substring(a + 1);
|
|
812
|
+
o = r + l + s;
|
|
773
813
|
}
|
|
774
814
|
}
|
|
775
815
|
return o.slice(0, t.length);
|
|
776
816
|
}
|
|
777
|
-
function
|
|
778
|
-
const n =
|
|
779
|
-
if (!n)
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
t.instance.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
|
|
817
|
+
function Ct(e, t) {
|
|
818
|
+
const n = Mt(t);
|
|
819
|
+
if (!n) return;
|
|
820
|
+
const o = "#", l = e.value, a = Et(l, o);
|
|
821
|
+
if (a) {
|
|
822
|
+
const r = At(a, n, o);
|
|
823
|
+
t.instance.maskFilled && (t.instance.maskFilled = !r.includes(o)), e.value = r;
|
|
785
824
|
} else
|
|
786
825
|
e.value = n;
|
|
787
826
|
}
|
|
788
|
-
const
|
|
827
|
+
const Tt = { class: "aform__form-element" }, St = ["for"], Lt = ["id", "disabled", "maxlength", "required"], $t = ["innerHTML"], Vt = /* @__PURE__ */ A({
|
|
789
828
|
__name: "ATextInput",
|
|
790
|
-
props: /* @__PURE__ */
|
|
829
|
+
props: /* @__PURE__ */ V({
|
|
791
830
|
schema: {},
|
|
792
831
|
label: {},
|
|
793
832
|
mask: {},
|
|
@@ -801,45 +840,129 @@ const Dt = { class: "aform__form-element" }, Mt = ["for"], Et = ["id", "disabled
|
|
|
801
840
|
}),
|
|
802
841
|
emits: ["update:modelValue"],
|
|
803
842
|
setup(e) {
|
|
804
|
-
const t =
|
|
805
|
-
return (o, l) => (
|
|
806
|
-
|
|
843
|
+
const t = f(!0), n = x(e, "modelValue");
|
|
844
|
+
return (o, l) => (h(), g("div", Tt, [
|
|
845
|
+
i("label", {
|
|
807
846
|
class: "aform__field-label",
|
|
808
847
|
for: o.uuid
|
|
809
|
-
},
|
|
810
|
-
|
|
848
|
+
}, E(o.label), 9, St),
|
|
849
|
+
D(i("input", {
|
|
811
850
|
class: "aform__input-field",
|
|
812
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
851
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => n.value = a),
|
|
813
852
|
id: o.uuid,
|
|
814
853
|
disabled: o.readonly,
|
|
815
854
|
maxlength: o.mask ? t.value && o.mask.length : void 0,
|
|
816
855
|
required: o.required
|
|
817
|
-
}, null, 8,
|
|
818
|
-
[
|
|
819
|
-
[
|
|
856
|
+
}, null, 8, Lt), [
|
|
857
|
+
[I, n.value],
|
|
858
|
+
[ie(Ct), o.mask]
|
|
820
859
|
]),
|
|
821
|
-
|
|
860
|
+
D(i("p", {
|
|
822
861
|
class: "error",
|
|
823
862
|
innerHTML: o.validation.errorMessage
|
|
824
|
-
}, null, 8,
|
|
825
|
-
[
|
|
863
|
+
}, null, 8, $t), [
|
|
864
|
+
[H, o.validation.errorMessage]
|
|
865
|
+
])
|
|
866
|
+
]));
|
|
867
|
+
}
|
|
868
|
+
}), xt = { class: "login-container" }, Ht = { class: "account-container" }, It = { class: "account-header" }, Pt = { id: "account-title" }, Bt = { id: "account-subtitle" }, Ft = { class: "login-form-container" }, qt = { class: "login-form-email login-form-element" }, Rt = /* @__PURE__ */ i("label", {
|
|
869
|
+
id: "login-email",
|
|
870
|
+
for: "email",
|
|
871
|
+
class: "aform__field-label"
|
|
872
|
+
}, "Email", -1), Ot = ["disabled"], Ut = { class: "login-form-password login-form-element" }, Wt = /* @__PURE__ */ i("label", {
|
|
873
|
+
id: "login-password",
|
|
874
|
+
for: "password",
|
|
875
|
+
class: "login-label"
|
|
876
|
+
}, "Password", -1), Yt = ["disabled"], Kt = ["disabled"], zt = {
|
|
877
|
+
key: 0,
|
|
878
|
+
class: "material-symbols-outlined loading-icon"
|
|
879
|
+
}, Gt = /* @__PURE__ */ i("span", { id: "login-form-button" }, "Login", -1), Nt = /* @__PURE__ */ i("button", { class: "btn" }, [
|
|
880
|
+
/* @__PURE__ */ i("span", { id: "forgot-password-button" }, "Forgot password?")
|
|
881
|
+
], -1), Jt = /* @__PURE__ */ A({
|
|
882
|
+
__name: "Login",
|
|
883
|
+
props: {
|
|
884
|
+
headerTitle: { default: "Login" },
|
|
885
|
+
headerSubtitle: { default: "Enter your email and password to login" }
|
|
886
|
+
},
|
|
887
|
+
emits: ["loginFailed", "loginSuccess"],
|
|
888
|
+
setup(e, { emit: t }) {
|
|
889
|
+
const n = t, o = f(""), l = f(""), a = f(!1), r = f(!1);
|
|
890
|
+
function s(c) {
|
|
891
|
+
if (c.preventDefault(), a.value = !0, r.value) {
|
|
892
|
+
a.value = !1, n("loginFailed");
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
a.value = !1, n("loginSuccess");
|
|
896
|
+
}
|
|
897
|
+
return (c, u) => (h(), g("div", xt, [
|
|
898
|
+
i("div", null, [
|
|
899
|
+
i("div", Ht, [
|
|
900
|
+
i("div", It, [
|
|
901
|
+
i("h1", Pt, E(c.headerTitle), 1),
|
|
902
|
+
i("p", Bt, E(c.headerSubtitle), 1)
|
|
903
|
+
]),
|
|
904
|
+
i("form", { onSubmit: s }, [
|
|
905
|
+
i("div", Ft, [
|
|
906
|
+
i("div", qt, [
|
|
907
|
+
Rt,
|
|
908
|
+
D(i("input", {
|
|
909
|
+
id: "email",
|
|
910
|
+
class: "aform__input-field",
|
|
911
|
+
name: "email",
|
|
912
|
+
placeholder: "name@example.com",
|
|
913
|
+
type: "email",
|
|
914
|
+
"onUpdate:modelValue": u[0] || (u[0] = (d) => o.value = d),
|
|
915
|
+
"auto-capitalize": "none",
|
|
916
|
+
"auto-complete": "email",
|
|
917
|
+
"auto-correct": "off",
|
|
918
|
+
disabled: a.value
|
|
919
|
+
}, null, 8, Ot), [
|
|
920
|
+
[I, o.value]
|
|
921
|
+
])
|
|
922
|
+
]),
|
|
923
|
+
i("div", Ut, [
|
|
924
|
+
Wt,
|
|
925
|
+
D(i("input", {
|
|
926
|
+
id: "password",
|
|
927
|
+
class: "login-field",
|
|
928
|
+
name: "password",
|
|
929
|
+
type: "password",
|
|
930
|
+
"onUpdate:modelValue": u[1] || (u[1] = (d) => l.value = d),
|
|
931
|
+
disabled: a.value
|
|
932
|
+
}, null, 8, Yt), [
|
|
933
|
+
[I, l.value]
|
|
934
|
+
])
|
|
935
|
+
]),
|
|
936
|
+
i("button", {
|
|
937
|
+
class: "btn",
|
|
938
|
+
onClick: s,
|
|
939
|
+
disabled: a.value || !o.value || !l.value
|
|
940
|
+
}, [
|
|
941
|
+
a.value ? (h(), g("span", zt, "progress_activity")) : ue("", !0),
|
|
942
|
+
Gt
|
|
943
|
+
], 8, Kt)
|
|
944
|
+
])
|
|
945
|
+
], 32),
|
|
946
|
+
Nt
|
|
947
|
+
])
|
|
826
948
|
])
|
|
827
949
|
]));
|
|
828
950
|
}
|
|
829
951
|
});
|
|
830
|
-
function
|
|
831
|
-
e.component("ACheckbox",
|
|
952
|
+
function Qt(e) {
|
|
953
|
+
e.component("ACheckbox", xe), e.component("ACombobox", Ie), e.component("ADate", Re), e.component("ADropdown", Ke), e.component("ADatePicker", dt), e.component("AFieldset", _t), e.component("AForm", fe), e.component("ANumericInput", kt), e.component("ATextInput", Vt);
|
|
832
954
|
}
|
|
833
955
|
export {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
956
|
+
xe as ACheckbox,
|
|
957
|
+
Ie as AComboBox,
|
|
958
|
+
Re as ADate,
|
|
959
|
+
dt as ADatePicker,
|
|
960
|
+
Ke as ADropdown,
|
|
961
|
+
_t as AFieldset,
|
|
962
|
+
fe as AForm,
|
|
963
|
+
kt as ANumericInput,
|
|
964
|
+
Vt as ATextInput,
|
|
965
|
+
Jt as Login,
|
|
966
|
+
Qt as install
|
|
844
967
|
};
|
|
845
968
|
//# sourceMappingURL=aform.js.map
|