@stonecrop/aform 0.2.22 → 0.2.24
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 +182 -172
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +1 -1
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/components/AForm.vue +2 -8
- package/src/components/form/ACheckbox.vue +6 -89
- package/src/components/form/ANumericInput.vue +4 -58
- package/src/components/form/ATextInput.vue +4 -57
- package/src/components/utilities/Login.vue +3 -3
- package/src/theme/aform.css +1 -28
- package/src/theme/fields.css +85 -0
- package/src/theme/login.css +0 -128
package/dist/aform.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const Ae = {
|
|
1
|
+
import { defineComponent as E, mergeModels as S, useModel as $, openBlock as v, createElementBlock as g, createElementVNode as c, toDisplayString as A, withDirectives as M, vModelCheckbox as de, vShow as x, resolveComponent as fe, createBlock as K, withCtx as pe, ref as m, onMounted as Y, onUnmounted as me, normalizeClass as P, withKeys as B, vModelText as G, Fragment as q, renderList as F, watch as U, onBeforeUnmount as ve, computed as H, unref as re, getCurrentScope as he, onScopeDispose as ye, nextTick as ge, withModifiers as _e, resolveDynamicComponent as be, mergeProps as ke, createTextVNode as we, createCommentVNode as De, renderSlot as Me, createVNode as Ee } from "vue";
|
|
2
|
+
const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform__checkbox-container aform__input-field" }, Ve = ["id", "readonly", "required"], Le = ["innerHTML"], Se = /* @__PURE__ */ E({
|
|
3
3
|
__name: "ACheckbox",
|
|
4
|
-
props: /* @__PURE__ */
|
|
4
|
+
props: /* @__PURE__ */ S({
|
|
5
5
|
label: {},
|
|
6
6
|
required: { type: Boolean },
|
|
7
7
|
readOnly: { type: Boolean },
|
|
@@ -13,62 +13,57 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
|
|
|
13
13
|
}),
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
15
|
setup(e) {
|
|
16
|
-
const t =
|
|
17
|
-
return (n, o) => (v(), g("div",
|
|
18
|
-
c("label",
|
|
16
|
+
const t = $(e, "modelValue");
|
|
17
|
+
return (n, o) => (v(), g("div", Ae, [
|
|
18
|
+
c("label", {
|
|
19
|
+
class: "aform__field-label",
|
|
20
|
+
for: n.uuid
|
|
21
|
+
}, A(n.label), 9, Ce),
|
|
22
|
+
c("span", Te, [
|
|
19
23
|
M(c("input", {
|
|
20
24
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
21
25
|
type: "checkbox",
|
|
22
26
|
id: n.uuid,
|
|
23
|
-
class: "
|
|
27
|
+
class: "aform__checkbox",
|
|
24
28
|
readonly: n.readOnly,
|
|
25
29
|
required: n.required
|
|
26
|
-
}, null, 8,
|
|
30
|
+
}, null, 8, Ve), [
|
|
27
31
|
[de, t.value]
|
|
28
|
-
])
|
|
29
|
-
c("span", Te, E(t.value), 1)
|
|
32
|
+
])
|
|
30
33
|
]),
|
|
31
|
-
c("label", {
|
|
32
|
-
for: n.uuid,
|
|
33
|
-
id: "checkbox-label"
|
|
34
|
-
}, E(n.label), 9, Ve),
|
|
35
34
|
M(c("p", {
|
|
35
|
+
class: "error",
|
|
36
36
|
innerHTML: n.validation.errorMessage
|
|
37
37
|
}, null, 8, Le), [
|
|
38
|
-
[
|
|
38
|
+
[x, n.validation.errorMessage]
|
|
39
39
|
])
|
|
40
40
|
]));
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
43
|
-
const n = e.__vccOpts || e;
|
|
44
|
-
for (const [o, l] of t)
|
|
45
|
-
n[o] = l;
|
|
46
|
-
return n;
|
|
47
|
-
}, $e = /* @__PURE__ */ S(Se, [["__scopeId", "data-v-5093f1cb"]]), xe = /* @__PURE__ */ c("div", null, [
|
|
42
|
+
}), $e = /* @__PURE__ */ c("div", null, [
|
|
48
43
|
/* @__PURE__ */ c("input", { type: "text" }),
|
|
49
44
|
/* @__PURE__ */ c("input", { type: "text" }),
|
|
50
45
|
/* @__PURE__ */ c("input", { type: "text" })
|
|
51
|
-
], -1),
|
|
46
|
+
], -1), xe = /* @__PURE__ */ E({
|
|
52
47
|
__name: "AComboBox",
|
|
53
48
|
props: ["event", "cellData", "tableID"],
|
|
54
49
|
setup(e) {
|
|
55
50
|
return (t, n) => {
|
|
56
|
-
const o =
|
|
51
|
+
const o = fe("ATableModal");
|
|
57
52
|
return v(), K(o, {
|
|
58
53
|
event: e.event,
|
|
59
54
|
cellData: e.cellData,
|
|
60
55
|
class: "amodal"
|
|
61
56
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
57
|
+
default: pe(() => [
|
|
58
|
+
$e
|
|
64
59
|
]),
|
|
65
60
|
_: 1
|
|
66
61
|
}, 8, ["event", "cellData"]);
|
|
67
62
|
};
|
|
68
63
|
}
|
|
69
|
-
}), He = ["id", "disabled", "required", "value"],
|
|
64
|
+
}), He = ["id", "disabled", "required", "value"], Ie = ["for"], Be = ["innerHTML"], Pe = /* @__PURE__ */ E({
|
|
70
65
|
__name: "ADate",
|
|
71
|
-
props: /* @__PURE__ */
|
|
66
|
+
props: /* @__PURE__ */ S({
|
|
72
67
|
label: { default: "Date" },
|
|
73
68
|
required: { type: Boolean },
|
|
74
69
|
readonly: { type: Boolean },
|
|
@@ -80,7 +75,7 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
|
|
|
80
75
|
}),
|
|
81
76
|
emits: ["update:modelValue"],
|
|
82
77
|
setup(e) {
|
|
83
|
-
const t =
|
|
78
|
+
const t = $(e, "modelValue"), n = m(null), o = () => {
|
|
84
79
|
n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
|
|
85
80
|
};
|
|
86
81
|
return (l, r) => (v(), g("div", null, [
|
|
@@ -94,23 +89,28 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
|
|
|
94
89
|
value: t.value,
|
|
95
90
|
onClick: o
|
|
96
91
|
}, null, 8, He),
|
|
97
|
-
c("label", { for: l.uuid },
|
|
92
|
+
c("label", { for: l.uuid }, A(l.label), 9, Ie),
|
|
98
93
|
M(c("p", {
|
|
99
94
|
innerHTML: l.validation.errorMessage
|
|
100
|
-
}, null, 8,
|
|
101
|
-
[
|
|
95
|
+
}, null, 8, Be), [
|
|
96
|
+
[x, l.validation.errorMessage]
|
|
102
97
|
])
|
|
103
98
|
]));
|
|
104
99
|
}
|
|
105
|
-
}),
|
|
100
|
+
}), O = (e, t) => {
|
|
101
|
+
const n = e.__vccOpts || e;
|
|
102
|
+
for (const [o, l] of t)
|
|
103
|
+
n[o] = l;
|
|
104
|
+
return n;
|
|
105
|
+
}, qe = /* @__PURE__ */ O(Pe, [["__scopeId", "data-v-69d0f23d"]]), Fe = { class: "input-wrapper" }, Re = {
|
|
106
106
|
id: "autocomplete-results",
|
|
107
107
|
class: "autocomplete-results"
|
|
108
|
-
},
|
|
108
|
+
}, Ue = {
|
|
109
109
|
key: 0,
|
|
110
110
|
class: "loading autocomplete-result"
|
|
111
|
-
},
|
|
111
|
+
}, Oe = ["onClick"], We = /* @__PURE__ */ E({
|
|
112
112
|
__name: "ADropdown",
|
|
113
|
-
props: /* @__PURE__ */
|
|
113
|
+
props: /* @__PURE__ */ S({
|
|
114
114
|
label: {},
|
|
115
115
|
items: {},
|
|
116
116
|
isAsync: { type: Boolean }
|
|
@@ -118,104 +118,104 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
|
|
|
118
118
|
modelValue: {},
|
|
119
119
|
modelModifiers: {}
|
|
120
120
|
}),
|
|
121
|
-
emits: /* @__PURE__ */
|
|
121
|
+
emits: /* @__PURE__ */ S(["filterChanged"], ["update:modelValue"]),
|
|
122
122
|
setup(e, { emit: t }) {
|
|
123
|
-
const n = e, o = t, l = m(n.items), r =
|
|
123
|
+
const n = e, o = t, l = m(n.items), r = $(e, "modelValue"), s = m(!1), a = m(0), i = m(!1), u = m(null);
|
|
124
124
|
Y(() => {
|
|
125
|
-
document.addEventListener("click",
|
|
125
|
+
document.addEventListener("click", _), p();
|
|
126
126
|
}), me(() => {
|
|
127
|
-
document.removeEventListener("click",
|
|
127
|
+
document.removeEventListener("click", _);
|
|
128
128
|
});
|
|
129
|
-
const d = (
|
|
130
|
-
r.value =
|
|
131
|
-
},
|
|
132
|
-
r.value ? l.value = n.items.filter((
|
|
129
|
+
const d = (f) => {
|
|
130
|
+
r.value = f, b();
|
|
131
|
+
}, p = () => {
|
|
132
|
+
r.value ? l.value = n.items.filter((f) => f.toLowerCase().indexOf(r.value.toLowerCase()) > -1) : l.value = n.items;
|
|
133
133
|
}, h = () => {
|
|
134
|
-
i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) :
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
},
|
|
134
|
+
i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) : p();
|
|
135
|
+
}, _ = (f) => {
|
|
136
|
+
b(), a.value = 0;
|
|
137
|
+
}, b = () => {
|
|
138
138
|
i.value = !1, n.items.includes(r.value) || (r.value = "");
|
|
139
139
|
}, V = () => {
|
|
140
140
|
a.value < l.value.length && (a.value = a.value + 1);
|
|
141
141
|
}, w = () => {
|
|
142
142
|
a.value > 0 && (a.value = a.value - 1);
|
|
143
143
|
}, L = () => {
|
|
144
|
-
r.value = l.value[a.value],
|
|
144
|
+
r.value = l.value[a.value], b(), a.value = 0;
|
|
145
145
|
};
|
|
146
|
-
return (
|
|
147
|
-
class:
|
|
146
|
+
return (f, y) => (v(), g("div", {
|
|
147
|
+
class: P(["autocomplete", { isOpen: i.value }])
|
|
148
148
|
}, [
|
|
149
|
-
c("div",
|
|
149
|
+
c("div", Fe, [
|
|
150
150
|
M(c("input", {
|
|
151
151
|
ref_key: "mopInput",
|
|
152
152
|
ref: u,
|
|
153
153
|
type: "text",
|
|
154
154
|
onInput: h,
|
|
155
155
|
onFocus: h,
|
|
156
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
156
|
+
"onUpdate:modelValue": y[0] || (y[0] = (k) => r.value = k),
|
|
157
157
|
onKeydown: [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
B(V, ["down"]),
|
|
159
|
+
B(w, ["up"]),
|
|
160
|
+
B(L, ["enter"])
|
|
161
161
|
]
|
|
162
162
|
}, null, 544), [
|
|
163
163
|
[G, r.value]
|
|
164
164
|
]),
|
|
165
|
-
M(c("ul",
|
|
166
|
-
s.value ? (v(), g("li",
|
|
165
|
+
M(c("ul", Re, [
|
|
166
|
+
s.value ? (v(), g("li", Ue, "Loading results...")) : (v(!0), g(q, { key: 1 }, F(l.value, (k, D) => (v(), g("li", {
|
|
167
167
|
key: D,
|
|
168
|
-
onClick: (X) => d(
|
|
169
|
-
class:
|
|
170
|
-
},
|
|
168
|
+
onClick: (X) => d(k),
|
|
169
|
+
class: P(["autocomplete-result", { "is-active": D === a.value }])
|
|
170
|
+
}, A(k), 11, Oe))), 128))
|
|
171
171
|
], 512), [
|
|
172
|
-
[
|
|
172
|
+
[x, i.value]
|
|
173
173
|
]),
|
|
174
|
-
c("label", null,
|
|
174
|
+
c("label", null, A(f.label), 1)
|
|
175
175
|
])
|
|
176
176
|
], 2));
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
function
|
|
179
|
+
function Ke(e) {
|
|
180
180
|
return he() ? (ye(e), !0) : !1;
|
|
181
181
|
}
|
|
182
182
|
function ue(e) {
|
|
183
183
|
return typeof e == "function" ? e() : re(e);
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const Ye = typeof window < "u" && typeof document < "u";
|
|
186
186
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
187
|
-
const
|
|
187
|
+
const Ge = Object.prototype.toString, ze = (e) => Ge.call(e) === "[object Object]", je = () => {
|
|
188
188
|
};
|
|
189
|
-
function
|
|
189
|
+
function R(e) {
|
|
190
190
|
var t;
|
|
191
191
|
const n = ue(e);
|
|
192
192
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
193
193
|
}
|
|
194
|
-
const z =
|
|
194
|
+
const z = Ye ? window : void 0;
|
|
195
195
|
function W(...e) {
|
|
196
196
|
let t, n, o, l;
|
|
197
197
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = z) : [t, n, o, l] = e, !t)
|
|
198
|
-
return
|
|
198
|
+
return je;
|
|
199
199
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
200
200
|
const r = [], s = () => {
|
|
201
201
|
r.forEach((d) => d()), r.length = 0;
|
|
202
|
-
}, a = (d,
|
|
203
|
-
() => [
|
|
204
|
-
([d,
|
|
202
|
+
}, a = (d, p, h, _) => (d.addEventListener(p, h, _), () => d.removeEventListener(p, h, _)), i = U(
|
|
203
|
+
() => [R(t), ue(l)],
|
|
204
|
+
([d, p]) => {
|
|
205
205
|
if (s(), !d)
|
|
206
206
|
return;
|
|
207
|
-
const h =
|
|
207
|
+
const h = ze(p) ? { ...p } : p;
|
|
208
208
|
r.push(
|
|
209
|
-
...n.flatMap((
|
|
209
|
+
...n.flatMap((_) => o.map((b) => a(d, _, b, h)))
|
|
210
210
|
);
|
|
211
211
|
},
|
|
212
212
|
{ immediate: !0, flush: "post" }
|
|
213
213
|
), u = () => {
|
|
214
214
|
i(), s();
|
|
215
215
|
};
|
|
216
|
-
return
|
|
216
|
+
return Ke(u), u;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Je(e = {}) {
|
|
219
219
|
var t;
|
|
220
220
|
const {
|
|
221
221
|
window: n = z,
|
|
@@ -234,15 +234,15 @@ function Ne(e = {}) {
|
|
|
234
234
|
i.relatedTarget === null && a();
|
|
235
235
|
}, !0), W(n, "focus", a, !0)), a(), s;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
const n =
|
|
237
|
+
function Ne(e, t = {}) {
|
|
238
|
+
const n = Je(t), o = H(() => R(e));
|
|
239
239
|
return { focused: H(() => o.value && n.value ? o.value.contains(n.value) : !1) };
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Qe(e, { window: t = z, scrollTarget: n } = {}) {
|
|
242
242
|
const o = m(!1), l = () => {
|
|
243
243
|
if (!t)
|
|
244
244
|
return;
|
|
245
|
-
const r = t.document, s =
|
|
245
|
+
const r = t.document, s = R(e);
|
|
246
246
|
if (!s)
|
|
247
247
|
o.value = !1;
|
|
248
248
|
else {
|
|
@@ -250,8 +250,8 @@ function Xe(e, { window: t = z, scrollTarget: n } = {}) {
|
|
|
250
250
|
o.value = a.top <= (t.innerHeight || r.documentElement.clientHeight) && a.left <= (t.innerWidth || r.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
return
|
|
254
|
-
() =>
|
|
253
|
+
return U(
|
|
254
|
+
() => R(e),
|
|
255
255
|
() => l(),
|
|
256
256
|
{ immediate: !0, flush: "post" }
|
|
257
257
|
), t && W(n || t, "scroll", l, {
|
|
@@ -260,7 +260,7 @@ function Xe(e, { window: t = z, scrollTarget: n } = {}) {
|
|
|
260
260
|
}), o;
|
|
261
261
|
}
|
|
262
262
|
const C = (e) => {
|
|
263
|
-
let t =
|
|
263
|
+
let t = Qe(e).value;
|
|
264
264
|
return t = t && e.offsetHeight > 0, t;
|
|
265
265
|
}, T = (e) => e.tabIndex >= 0, Z = (e) => {
|
|
266
266
|
const t = e.target;
|
|
@@ -279,7 +279,7 @@ const C = (e) => {
|
|
|
279
279
|
o && (n = o);
|
|
280
280
|
}
|
|
281
281
|
return n && (!T(n) || !C(n)) ? j(n) : n;
|
|
282
|
-
},
|
|
282
|
+
}, Xe = (e) => {
|
|
283
283
|
var t;
|
|
284
284
|
const n = e.target;
|
|
285
285
|
let o;
|
|
@@ -314,7 +314,7 @@ const C = (e) => {
|
|
|
314
314
|
o && (n = o);
|
|
315
315
|
}
|
|
316
316
|
return n && (!T(n) || !C(n)) ? J(n) : n;
|
|
317
|
-
},
|
|
317
|
+
}, Ze = (e) => {
|
|
318
318
|
var t;
|
|
319
319
|
const n = e.target;
|
|
320
320
|
let o;
|
|
@@ -364,7 +364,7 @@ const C = (e) => {
|
|
|
364
364
|
}, le = (e) => {
|
|
365
365
|
const t = e.target.parentElement.lastElementChild;
|
|
366
366
|
return t && (!T(t) || !C(t)) ? N(t) : t;
|
|
367
|
-
},
|
|
367
|
+
}, I = ["alt", "control", "shift", "meta"], et = {
|
|
368
368
|
ArrowUp: "up",
|
|
369
369
|
ArrowDown: "down",
|
|
370
370
|
ArrowLeft: "left",
|
|
@@ -387,11 +387,11 @@ const C = (e) => {
|
|
|
387
387
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
388
388
|
},
|
|
389
389
|
"keydown.control.up": (e) => {
|
|
390
|
-
const t =
|
|
390
|
+
const t = Xe(e);
|
|
391
391
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
392
392
|
},
|
|
393
393
|
"keydown.control.down": (e) => {
|
|
394
|
-
const t =
|
|
394
|
+
const t = Ze(e);
|
|
395
395
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
396
396
|
},
|
|
397
397
|
"keydown.control.left": (e) => {
|
|
@@ -433,7 +433,7 @@ const C = (e) => {
|
|
|
433
433
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
|
-
function
|
|
436
|
+
function tt(e) {
|
|
437
437
|
const t = (s) => {
|
|
438
438
|
let a = null;
|
|
439
439
|
return s.parent && (typeof s.parent == "string" ? a = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? a = s.parent : a = s.parent.value), a;
|
|
@@ -458,38 +458,38 @@ function nt(e) {
|
|
|
458
458
|
let i = [];
|
|
459
459
|
return s.selectors ? i = n(s) : a && (i = Array.from(a.children).filter((u) => T(u) && C(u))), i;
|
|
460
460
|
}, l = (s) => (a) => {
|
|
461
|
-
const i =
|
|
462
|
-
if (
|
|
461
|
+
const i = et[a.key] || a.key.toLowerCase();
|
|
462
|
+
if (I.includes(i))
|
|
463
463
|
return;
|
|
464
464
|
const u = s.handlers || ie;
|
|
465
465
|
for (const d of Object.keys(u)) {
|
|
466
|
-
const [
|
|
467
|
-
if (
|
|
468
|
-
const
|
|
466
|
+
const [p, ...h] = d.split(".");
|
|
467
|
+
if (p === "keydown" && h.includes(i)) {
|
|
468
|
+
const _ = u[d], b = h.filter((w) => I.includes(w)), V = I.some((w) => {
|
|
469
469
|
const L = w.charAt(0).toUpperCase() + w.slice(1);
|
|
470
470
|
return a.getModifierState(L);
|
|
471
471
|
});
|
|
472
|
-
if (
|
|
472
|
+
if (b.length > 0) {
|
|
473
473
|
if (V) {
|
|
474
|
-
for (const w of
|
|
474
|
+
for (const w of I)
|
|
475
475
|
if (h.includes(w)) {
|
|
476
476
|
const L = w.charAt(0).toUpperCase() + w.slice(1);
|
|
477
|
-
a.getModifierState(L) &&
|
|
477
|
+
a.getModifierState(L) && _(a);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
} else
|
|
481
|
-
V ||
|
|
481
|
+
V || _(a);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
}, r = [];
|
|
485
485
|
Y(() => {
|
|
486
486
|
for (const s of e) {
|
|
487
487
|
const a = t(s), i = o(s), u = l(s), d = a ? [a] : i;
|
|
488
|
-
for (const
|
|
489
|
-
const { focused: h } =
|
|
490
|
-
|
|
488
|
+
for (const p of d) {
|
|
489
|
+
const { focused: h } = Ne(m(p)), _ = U(h, (b) => {
|
|
490
|
+
b ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
|
|
491
491
|
});
|
|
492
|
-
r.push(
|
|
492
|
+
r.push(_);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
}), ve(() => {
|
|
@@ -497,10 +497,10 @@ function nt(e) {
|
|
|
497
497
|
s();
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
|
-
const
|
|
500
|
+
const nt = {
|
|
501
501
|
colspan: "5",
|
|
502
502
|
tabindex: -1
|
|
503
|
-
},
|
|
503
|
+
}, ot = /* @__PURE__ */ c("tr", { class: "days-header" }, [
|
|
504
504
|
/* @__PURE__ */ c("td", null, "M"),
|
|
505
505
|
/* @__PURE__ */ c("td", null, "T"),
|
|
506
506
|
/* @__PURE__ */ c("td", null, "W"),
|
|
@@ -508,7 +508,7 @@ const ot = {
|
|
|
508
508
|
/* @__PURE__ */ c("td", null, "F"),
|
|
509
509
|
/* @__PURE__ */ c("td", null, "S"),
|
|
510
510
|
/* @__PURE__ */ c("td", null, "S")
|
|
511
|
-
], -1),
|
|
511
|
+
], -1), lt = ["onClick", "onKeydown"], at = 6, ae = 7, st = /* @__PURE__ */ E({
|
|
512
512
|
__name: "ADatePicker",
|
|
513
513
|
props: {
|
|
514
514
|
modelValue: { default: /* @__PURE__ */ new Date() },
|
|
@@ -516,12 +516,12 @@ const ot = {
|
|
|
516
516
|
},
|
|
517
517
|
emits: ["update:modelValue"],
|
|
518
518
|
setup(e) {
|
|
519
|
-
const t =
|
|
519
|
+
const t = $(e, "modelValue"), n = m(new Date(t.value)), o = m(n.value.getMonth()), l = m(n.value.getFullYear()), r = m([]), s = m(null);
|
|
520
520
|
Y(async () => {
|
|
521
521
|
a(), await ge();
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
524
|
-
|
|
522
|
+
const f = document.getElementsByClassName("selectedDate");
|
|
523
|
+
if (f.length > 0)
|
|
524
|
+
f[0].focus();
|
|
525
525
|
else {
|
|
526
526
|
const y = document.getElementsByClassName("todaysDate");
|
|
527
527
|
y.length > 0 && y[0].focus();
|
|
@@ -529,26 +529,26 @@ const ot = {
|
|
|
529
529
|
});
|
|
530
530
|
const a = () => {
|
|
531
531
|
r.value = [];
|
|
532
|
-
const
|
|
532
|
+
const f = new Date(l.value, o.value, 1), y = f.getDay(), k = f.setDate(f.getDate() - y);
|
|
533
533
|
for (const D of Array(43).keys())
|
|
534
|
-
r.value.push(
|
|
534
|
+
r.value.push(k + D * 864e5);
|
|
535
535
|
};
|
|
536
|
-
|
|
536
|
+
U([o, l], a);
|
|
537
537
|
const i = () => l.value -= 1, u = () => l.value += 1, d = () => {
|
|
538
538
|
o.value == 0 ? (o.value = 11, i()) : o.value -= 1;
|
|
539
|
-
},
|
|
539
|
+
}, p = () => {
|
|
540
540
|
o.value == 11 ? (o.value = 0, u()) : o.value += 1;
|
|
541
|
-
}, h = (
|
|
541
|
+
}, h = (f) => {
|
|
542
542
|
const y = /* @__PURE__ */ new Date();
|
|
543
543
|
if (o.value === y.getMonth())
|
|
544
|
-
return y.toDateString() === new Date(
|
|
545
|
-
},
|
|
546
|
-
t.value = n.value = new Date(r.value[
|
|
544
|
+
return y.toDateString() === new Date(f).toDateString();
|
|
545
|
+
}, _ = (f) => new Date(f).toDateString() === new Date(n.value).toDateString(), b = (f, y) => (f - 1) * ae + y, V = (f, y) => r.value[b(f, y)], w = (f) => {
|
|
546
|
+
t.value = n.value = new Date(r.value[f]);
|
|
547
547
|
}, L = H(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
|
|
548
548
|
year: "numeric",
|
|
549
549
|
month: "long"
|
|
550
550
|
}));
|
|
551
|
-
return
|
|
551
|
+
return tt([
|
|
552
552
|
{
|
|
553
553
|
parent: s,
|
|
554
554
|
selectors: "td",
|
|
@@ -556,7 +556,7 @@ const ot = {
|
|
|
556
556
|
...ie,
|
|
557
557
|
"keydown.pageup": d,
|
|
558
558
|
"keydown.shift.pageup": i,
|
|
559
|
-
"keydown.pagedown":
|
|
559
|
+
"keydown.pagedown": p,
|
|
560
560
|
"keydown.shift.pagedown": u,
|
|
561
561
|
// TODO: this is a hack to override the stonecrop enter handler;
|
|
562
562
|
// store context inside the component so that handlers can be setup consistently
|
|
@@ -565,7 +565,7 @@ const ot = {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
]), (
|
|
568
|
+
]), (f, y) => (v(), g("div", {
|
|
569
569
|
class: "adatepicker",
|
|
570
570
|
tabindex: "0",
|
|
571
571
|
ref_key: "adatepicker",
|
|
@@ -578,44 +578,44 @@ const ot = {
|
|
|
578
578
|
onClick: d,
|
|
579
579
|
tabindex: -1
|
|
580
580
|
}, "<"),
|
|
581
|
-
c("th",
|
|
581
|
+
c("th", nt, A(L.value), 1),
|
|
582
582
|
c("td", {
|
|
583
583
|
id: "next-month-btn",
|
|
584
|
-
onClick:
|
|
584
|
+
onClick: p,
|
|
585
585
|
tabindex: -1
|
|
586
586
|
}, ">")
|
|
587
587
|
]),
|
|
588
|
-
|
|
589
|
-
(v(), g(
|
|
590
|
-
(v(), g(
|
|
588
|
+
ot,
|
|
589
|
+
(v(), g(q, null, F(at, (k) => c("tr", { key: k }, [
|
|
590
|
+
(v(), g(q, null, F(ae, (D) => c("td", {
|
|
591
591
|
ref_for: !0,
|
|
592
592
|
ref: "celldate",
|
|
593
|
-
key: k
|
|
593
|
+
key: b(k, D),
|
|
594
594
|
contenteditable: !1,
|
|
595
595
|
spellcheck: !1,
|
|
596
596
|
tabindex: 0,
|
|
597
|
-
onClick:
|
|
598
|
-
onKeydown:
|
|
599
|
-
class:
|
|
600
|
-
todaysDate: h(V(
|
|
601
|
-
selectedDate:
|
|
597
|
+
onClick: _e((X) => w(b(k, D)), ["prevent", "stop"]),
|
|
598
|
+
onKeydown: B((X) => w(b(k, D)), ["enter"]),
|
|
599
|
+
class: P({
|
|
600
|
+
todaysDate: h(V(k, D)),
|
|
601
|
+
selectedDate: _(V(k, D))
|
|
602
602
|
})
|
|
603
|
-
},
|
|
603
|
+
}, A(new Date(V(k, D)).getDate()), 43, lt)), 64))
|
|
604
604
|
])), 64))
|
|
605
605
|
])
|
|
606
606
|
], 512));
|
|
607
607
|
}
|
|
608
|
-
}),
|
|
608
|
+
}), rt = /* @__PURE__ */ E({
|
|
609
609
|
__name: "CollapseButton",
|
|
610
610
|
props: {
|
|
611
611
|
collapsed: { type: Boolean }
|
|
612
612
|
},
|
|
613
613
|
setup(e) {
|
|
614
614
|
return (t, n) => (v(), g("button", {
|
|
615
|
-
class:
|
|
615
|
+
class: P(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
|
|
616
616
|
}, "×", 2));
|
|
617
617
|
}
|
|
618
|
-
}),
|
|
618
|
+
}), ut = /* @__PURE__ */ O(rt, [["__scopeId", "data-v-6f1c1b45"]]), it = { class: "aform" }, ct = /* @__PURE__ */ E({
|
|
619
619
|
__name: "AForm",
|
|
620
620
|
props: {
|
|
621
621
|
modelValue: {},
|
|
@@ -641,18 +641,18 @@ const ot = {
|
|
|
641
641
|
set: () => {
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
return (a, i) => (v(), g("form",
|
|
645
|
-
(v(!0), g(
|
|
644
|
+
return (a, i) => (v(), g("form", it, [
|
|
645
|
+
(v(!0), g(q, null, F(a.modelValue, (u, d) => (v(), K(be(u.component), ke({
|
|
646
646
|
key: d,
|
|
647
647
|
schema: u,
|
|
648
648
|
modelValue: s.value[d].value,
|
|
649
|
-
"onUpdate:modelValue": (
|
|
649
|
+
"onUpdate:modelValue": (p) => s.value[d].value = p,
|
|
650
650
|
data: l.value[u.fieldname],
|
|
651
651
|
readonly: a.readonly
|
|
652
652
|
}, r(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
|
|
653
653
|
]));
|
|
654
654
|
}
|
|
655
|
-
}), ce = /* @__PURE__ */
|
|
655
|
+
}), ce = /* @__PURE__ */ O(ct, [["__scopeId", "data-v-88047a70"]]), dt = /* @__PURE__ */ E({
|
|
656
656
|
__name: "AFieldset",
|
|
657
657
|
props: {
|
|
658
658
|
schema: {},
|
|
@@ -670,8 +670,8 @@ const ot = {
|
|
|
670
670
|
onClick: s,
|
|
671
671
|
onSubmit: s
|
|
672
672
|
}, [
|
|
673
|
-
we(
|
|
674
|
-
l.value ? (v(), K(
|
|
673
|
+
we(A(a.label) + " ", 1),
|
|
674
|
+
l.value ? (v(), K(ut, {
|
|
675
675
|
key: 0,
|
|
676
676
|
collapsed: o.value
|
|
677
677
|
}, null, 8, ["collapsed"])) : De("", !0)
|
|
@@ -682,14 +682,14 @@ const ot = {
|
|
|
682
682
|
"onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
|
|
683
683
|
data: n.value
|
|
684
684
|
}, null, 8, ["modelValue", "data"]), [
|
|
685
|
-
[
|
|
685
|
+
[x, !o.value]
|
|
686
686
|
])
|
|
687
687
|
], !0)
|
|
688
688
|
]));
|
|
689
689
|
}
|
|
690
|
-
}),
|
|
690
|
+
}), ft = /* @__PURE__ */ O(dt, [["__scopeId", "data-v-0f671e32"]]), pt = { class: "aform__form-element" }, mt = ["for"], vt = ["id", "disabled", "required"], ht = ["innerHTML"], yt = /* @__PURE__ */ E({
|
|
691
691
|
__name: "ANumericInput",
|
|
692
|
-
props: /* @__PURE__ */
|
|
692
|
+
props: /* @__PURE__ */ S({
|
|
693
693
|
label: {},
|
|
694
694
|
required: { type: Boolean },
|
|
695
695
|
readonly: { type: Boolean },
|
|
@@ -701,26 +701,31 @@ const ot = {
|
|
|
701
701
|
}),
|
|
702
702
|
emits: ["update:modelValue"],
|
|
703
703
|
setup(e) {
|
|
704
|
-
const t =
|
|
705
|
-
return (n, o) => (v(), g("div",
|
|
704
|
+
const t = $(e, "modelValue");
|
|
705
|
+
return (n, o) => (v(), g("div", pt, [
|
|
706
|
+
c("label", {
|
|
707
|
+
class: "aform__field-label",
|
|
708
|
+
for: n.uuid
|
|
709
|
+
}, A(n.label), 9, mt),
|
|
706
710
|
M(c("input", {
|
|
711
|
+
class: "aform__input-field",
|
|
707
712
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
708
713
|
type: "number",
|
|
709
714
|
id: n.uuid,
|
|
710
715
|
disabled: n.readonly,
|
|
711
716
|
required: n.required
|
|
712
|
-
}, null, 8,
|
|
717
|
+
}, null, 8, vt), [
|
|
713
718
|
[G, t.value]
|
|
714
719
|
]),
|
|
715
|
-
c("label", { for: n.uuid }, E(n.label), 9, mt),
|
|
716
720
|
M(c("p", {
|
|
721
|
+
class: "error",
|
|
717
722
|
innerHTML: n.validation.errorMessage
|
|
718
|
-
}, null, 8,
|
|
719
|
-
[
|
|
723
|
+
}, null, 8, ht), [
|
|
724
|
+
[x, n.validation.errorMessage]
|
|
720
725
|
])
|
|
721
726
|
]));
|
|
722
727
|
}
|
|
723
|
-
}),
|
|
728
|
+
}), se = {
|
|
724
729
|
date: "##/##/####",
|
|
725
730
|
datetime: "####/##/## ##:##",
|
|
726
731
|
time: "##:##",
|
|
@@ -734,7 +739,7 @@ function gt(e) {
|
|
|
734
739
|
} catch {
|
|
735
740
|
}
|
|
736
741
|
}
|
|
737
|
-
function
|
|
742
|
+
function _t(e) {
|
|
738
743
|
var n;
|
|
739
744
|
let t = e.value;
|
|
740
745
|
if (t) {
|
|
@@ -749,7 +754,7 @@ function bt(e) {
|
|
|
749
754
|
}
|
|
750
755
|
return t;
|
|
751
756
|
}
|
|
752
|
-
function
|
|
757
|
+
function bt(e, t) {
|
|
753
758
|
t || (t = "#");
|
|
754
759
|
let n = e;
|
|
755
760
|
const o = [t, "/", "-", "(", ")", " "];
|
|
@@ -757,7 +762,7 @@ function kt(e, t) {
|
|
|
757
762
|
n = n.replaceAll(l, "");
|
|
758
763
|
return n;
|
|
759
764
|
}
|
|
760
|
-
function
|
|
765
|
+
function kt(e, t, n) {
|
|
761
766
|
n || (n = "#");
|
|
762
767
|
let o = t;
|
|
763
768
|
for (const l of e) {
|
|
@@ -770,19 +775,19 @@ function _t(e, t, n) {
|
|
|
770
775
|
return o.slice(0, t.length);
|
|
771
776
|
}
|
|
772
777
|
function wt(e, t) {
|
|
773
|
-
const n =
|
|
778
|
+
const n = _t(t);
|
|
774
779
|
if (!n)
|
|
775
780
|
return;
|
|
776
|
-
const o = "#", l = e.value, r =
|
|
781
|
+
const o = "#", l = e.value, r = bt(l, o);
|
|
777
782
|
if (r) {
|
|
778
|
-
const s =
|
|
783
|
+
const s = kt(r, n, o);
|
|
779
784
|
t.instance.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
|
|
780
785
|
} else
|
|
781
786
|
e.value = n;
|
|
782
787
|
}
|
|
783
|
-
const Dt = ["id", "disabled", "maxlength", "required"],
|
|
788
|
+
const Dt = { class: "aform__form-element" }, Mt = ["for"], Et = ["id", "disabled", "maxlength", "required"], At = ["innerHTML"], Ct = /* @__PURE__ */ E({
|
|
784
789
|
__name: "ATextInput",
|
|
785
|
-
props: /* @__PURE__ */
|
|
790
|
+
props: /* @__PURE__ */ S({
|
|
786
791
|
schema: {},
|
|
787
792
|
label: {},
|
|
788
793
|
mask: {},
|
|
@@ -796,37 +801,42 @@ const Dt = ["id", "disabled", "maxlength", "required"], Mt = ["for"], Et = ["inn
|
|
|
796
801
|
}),
|
|
797
802
|
emits: ["update:modelValue"],
|
|
798
803
|
setup(e) {
|
|
799
|
-
const t = m(!0), n =
|
|
800
|
-
return (o, l) => (v(), g("div",
|
|
804
|
+
const t = m(!0), n = $(e, "modelValue");
|
|
805
|
+
return (o, l) => (v(), g("div", Dt, [
|
|
806
|
+
c("label", {
|
|
807
|
+
class: "aform__field-label",
|
|
808
|
+
for: o.uuid
|
|
809
|
+
}, A(o.label), 9, Mt),
|
|
801
810
|
M(c("input", {
|
|
811
|
+
class: "aform__input-field",
|
|
802
812
|
"onUpdate:modelValue": l[0] || (l[0] = (r) => n.value = r),
|
|
803
813
|
id: o.uuid,
|
|
804
814
|
disabled: o.readonly,
|
|
805
815
|
maxlength: o.mask ? t.value && o.mask.length : void 0,
|
|
806
816
|
required: o.required
|
|
807
|
-
}, null, 8,
|
|
817
|
+
}, null, 8, Et), [
|
|
808
818
|
[G, n.value],
|
|
809
819
|
[re(wt), o.mask]
|
|
810
820
|
]),
|
|
811
|
-
c("label", { for: o.uuid }, E(o.label), 9, Mt),
|
|
812
821
|
M(c("p", {
|
|
822
|
+
class: "error",
|
|
813
823
|
innerHTML: o.validation.errorMessage
|
|
814
|
-
}, null, 8,
|
|
815
|
-
[
|
|
824
|
+
}, null, 8, At), [
|
|
825
|
+
[x, o.validation.errorMessage]
|
|
816
826
|
])
|
|
817
827
|
]));
|
|
818
828
|
}
|
|
819
|
-
})
|
|
829
|
+
});
|
|
820
830
|
function Vt(e) {
|
|
821
|
-
e.component("ACheckbox",
|
|
831
|
+
e.component("ACheckbox", Se), e.component("ACombobox", xe), e.component("ADate", qe), e.component("ADropdown", We), e.component("ADatePicker", st), e.component("AFieldset", ft), e.component("AForm", ce), e.component("ANumericInput", yt), e.component("ATextInput", Ct);
|
|
822
832
|
}
|
|
823
833
|
export {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
834
|
+
Se as ACheckbox,
|
|
835
|
+
xe as AComboBox,
|
|
836
|
+
qe as ADate,
|
|
837
|
+
st as ADatePicker,
|
|
838
|
+
We as ADropdown,
|
|
839
|
+
ft as AFieldset,
|
|
830
840
|
ce as AForm,
|
|
831
841
|
yt as ANumericInput,
|
|
832
842
|
Ct as ATextInput,
|