@stonecrop/aform 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aform.d.ts +16 -2
- package/dist/aform.js +126 -117
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +2 -2
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/assets/index.css +1 -1
- package/package.json +7 -7
- package/src/components/form/ADate.vue +5 -2
- package/src/components/form/ADatePicker.vue +34 -32
package/dist/aform.d.ts
CHANGED
|
@@ -106,9 +106,23 @@ export declare type TableColumn = {
|
|
|
106
106
|
pinned?: boolean;
|
|
107
107
|
cellComponent?: string;
|
|
108
108
|
cellComponentProps?: Record<string, any>;
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* The component to use for the modal. If a function is provided, it will be called with the cell context.
|
|
111
|
+
* The following properties are available on the cell context:
|
|
112
|
+
* - `row` - the row object
|
|
113
|
+
* - `column` - the column object
|
|
114
|
+
* - `table` - the table object
|
|
115
|
+
*
|
|
116
|
+
* The function should return the name of the component to use for the modal.
|
|
117
|
+
*
|
|
118
|
+
* Additionally, the following properties will be automatically passed to the modal component:
|
|
119
|
+
* - `colIndex` - the column index of the current cell
|
|
120
|
+
* - `rowIndex` - the row index of the current cell
|
|
121
|
+
* - `store` - the table data store
|
|
122
|
+
*/
|
|
123
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
110
124
|
modalComponentExtraProps?: Record<string, any>;
|
|
111
|
-
format?: string | ((value: any, context
|
|
125
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
112
126
|
mask?: (value: any) => any;
|
|
113
127
|
};
|
|
114
128
|
|
package/dist/aform.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, mergeModels as H, useModel as
|
|
1
|
+
import { defineComponent as A, mergeModels as H, useModel as x, openBlock as m, createElementBlock as h, createElementVNode as i, toDisplayString as k, withDirectives as w, vModelCheckbox as ye, vShow as F, resolveComponent as be, createBlock as N, withCtx as _e, useTemplateRef as ce, vModelText as P, ref as v, onMounted as z, onUnmounted as ke, normalizeClass as K, withKeys as G, Fragment as B, renderList as q, watch as U, onBeforeUnmount as we, computed as V, unref as I, getCurrentScope as de, onScopeDispose as fe, getCurrentInstance as De, nextTick as Ae, withModifiers as Me, resolveDynamicComponent as Ee, mergeProps as Ce, createTextVNode as me, createCommentVNode as j, renderSlot as Te, createVNode as Se, readonly as $e } from "vue";
|
|
2
2
|
import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["for"], Ie = { class: "aform_checkbox-container aform_input-field" }, He = ["id", "readonly", "required"], Pe = ["innerHTML"], xe = /* @__PURE__ */ A({
|
|
3
3
|
__name: "ACheckbox",
|
|
4
4
|
props: /* @__PURE__ */ H({
|
|
@@ -14,14 +14,14 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
14
14
|
}),
|
|
15
15
|
emits: ["update:modelValue"],
|
|
16
16
|
setup(e) {
|
|
17
|
-
const t =
|
|
17
|
+
const t = x(e, "modelValue");
|
|
18
18
|
return (n, o) => (m(), h("div", Le, [
|
|
19
19
|
i("label", {
|
|
20
20
|
class: "aform_field-label",
|
|
21
21
|
for: n.uuid
|
|
22
22
|
}, k(n.label), 9, Ve),
|
|
23
23
|
i("span", Ie, [
|
|
24
|
-
|
|
24
|
+
w(i("input", {
|
|
25
25
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
26
26
|
type: "checkbox",
|
|
27
27
|
id: n.uuid,
|
|
@@ -32,11 +32,11 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
32
32
|
[ye, t.value]
|
|
33
33
|
])
|
|
34
34
|
]),
|
|
35
|
-
|
|
35
|
+
w(i("p", {
|
|
36
36
|
class: "aform_error",
|
|
37
37
|
innerHTML: n.validation.errorMessage
|
|
38
38
|
}, null, 8, Pe), [
|
|
39
|
-
[
|
|
39
|
+
[F, n.validation.errorMessage]
|
|
40
40
|
])
|
|
41
41
|
]));
|
|
42
42
|
}
|
|
@@ -67,7 +67,7 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
67
67
|
}, 8, ["event", "cellData"]);
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
}), qe = ["id", "disabled", "required"
|
|
70
|
+
}), qe = ["id", "disabled", "required"], Oe = ["for"], Re = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
71
71
|
__name: "ADate",
|
|
72
72
|
props: /* @__PURE__ */ H({
|
|
73
73
|
label: { default: "Date" },
|
|
@@ -77,33 +77,40 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
77
77
|
uuid: {},
|
|
78
78
|
validation: { default: () => ({ errorMessage: " " }) }
|
|
79
79
|
}, {
|
|
80
|
-
modelValue: {
|
|
80
|
+
modelValue: {
|
|
81
|
+
// format the date to be compatible with the native input datepicker
|
|
82
|
+
},
|
|
81
83
|
modelModifiers: {}
|
|
82
84
|
}),
|
|
83
85
|
emits: ["update:modelValue"],
|
|
84
86
|
setup(e) {
|
|
85
|
-
const t =
|
|
87
|
+
const t = x(e, "modelValue", {
|
|
88
|
+
// format the date to be compatible with the native input datepicker
|
|
89
|
+
set: (l) => new Date(l).toISOString().split("T")[0]
|
|
90
|
+
}), n = ce("date"), o = () => {
|
|
86
91
|
n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
|
|
87
92
|
};
|
|
88
93
|
return (l, a) => (m(), h("div", null, [
|
|
89
|
-
i("input", {
|
|
94
|
+
w(i("input", {
|
|
95
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => t.value = s),
|
|
90
96
|
ref: "date",
|
|
91
97
|
type: "date",
|
|
92
98
|
id: l.uuid,
|
|
93
99
|
disabled: l.readonly,
|
|
94
100
|
required: l.required,
|
|
95
|
-
value: t.value,
|
|
96
101
|
onClick: o
|
|
97
|
-
}, null, 8, qe),
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
}, null, 8, qe), [
|
|
103
|
+
[P, t.value]
|
|
104
|
+
]),
|
|
105
|
+
i("label", { for: l.uuid }, k(l.label), 9, Oe),
|
|
106
|
+
w(i("p", {
|
|
100
107
|
innerHTML: l.validation.errorMessage
|
|
101
|
-
}, null, 8,
|
|
102
|
-
[
|
|
108
|
+
}, null, 8, Re), [
|
|
109
|
+
[F, l.validation.errorMessage]
|
|
103
110
|
])
|
|
104
111
|
]));
|
|
105
112
|
}
|
|
106
|
-
}), We = /* @__PURE__ */ E(Ue, [["__scopeId", "data-v-
|
|
113
|
+
}), We = /* @__PURE__ */ E(Ue, [["__scopeId", "data-v-bf338f75"]]), Ye = { class: "input-wrapper" }, Ge = {
|
|
107
114
|
id: "autocomplete-results",
|
|
108
115
|
class: "autocomplete-results"
|
|
109
116
|
}, Ke = {
|
|
@@ -121,7 +128,7 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
121
128
|
}),
|
|
122
129
|
emits: /* @__PURE__ */ H(["filterChanged"], ["update:modelValue"]),
|
|
123
130
|
setup(e, { emit: t }) {
|
|
124
|
-
const n = t, o = v(e.items), l =
|
|
131
|
+
const n = t, o = v(e.items), l = x(e, "modelValue"), a = v(!1), s = v(0), r = v(!1);
|
|
125
132
|
z(() => {
|
|
126
133
|
document.addEventListener("click", f), u();
|
|
127
134
|
}), ke(() => {
|
|
@@ -139,37 +146,37 @@ import './assets/index.css';const Le = { class: "aform_form-element" }, Ve = ["f
|
|
|
139
146
|
r.value = !1, e.items.includes(l.value) || (l.value = "");
|
|
140
147
|
}, y = () => {
|
|
141
148
|
s.value < o.value.length && (s.value = s.value + 1);
|
|
142
|
-
},
|
|
149
|
+
}, D = () => {
|
|
143
150
|
s.value > 0 && (s.value = s.value - 1);
|
|
144
|
-
},
|
|
151
|
+
}, S = () => {
|
|
145
152
|
l.value = o.value[s.value], p(), s.value = 0;
|
|
146
153
|
};
|
|
147
|
-
return (b,
|
|
154
|
+
return (b, $) => (m(), h("div", {
|
|
148
155
|
class: K(["autocomplete", { isOpen: r.value }])
|
|
149
156
|
}, [
|
|
150
157
|
i("div", Ye, [
|
|
151
|
-
|
|
158
|
+
w(i("input", {
|
|
152
159
|
ref: "mopInput",
|
|
153
160
|
type: "text",
|
|
154
161
|
onInput: d,
|
|
155
162
|
onFocus: d,
|
|
156
|
-
"onUpdate:modelValue":
|
|
163
|
+
"onUpdate:modelValue": $[0] || ($[0] = (g) => l.value = g),
|
|
157
164
|
onKeydown: [
|
|
158
165
|
G(y, ["down"]),
|
|
159
|
-
G(
|
|
160
|
-
G(
|
|
166
|
+
G(D, ["up"]),
|
|
167
|
+
G(S, ["enter"])
|
|
161
168
|
]
|
|
162
169
|
}, null, 544), [
|
|
163
|
-
[
|
|
170
|
+
[P, l.value]
|
|
164
171
|
]),
|
|
165
|
-
|
|
172
|
+
w(i("ul", Ge, [
|
|
166
173
|
a.value ? (m(), h("li", Ke, "Loading results...")) : (m(!0), h(B, { key: 1 }, q(o.value, (g, _) => (m(), h("li", {
|
|
167
174
|
key: _,
|
|
168
175
|
onClick: (M) => c(g),
|
|
169
176
|
class: K(["autocomplete-result", { "is-active": _ === s.value }])
|
|
170
177
|
}, k(g), 11, ze))), 128))
|
|
171
178
|
], 512), [
|
|
172
|
-
[
|
|
179
|
+
[F, r.value]
|
|
173
180
|
]),
|
|
174
181
|
i("label", null, k(b.label), 1)
|
|
175
182
|
])
|
|
@@ -186,12 +193,12 @@ const Je = typeof window < "u" && typeof document < "u";
|
|
|
186
193
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
187
194
|
const Qe = (e) => e != null, Xe = Object.prototype.toString, Ze = (e) => Xe.call(e) === "[object Object]", et = () => {
|
|
188
195
|
}, W = Je ? window : void 0;
|
|
189
|
-
function
|
|
196
|
+
function O(e) {
|
|
190
197
|
var t;
|
|
191
198
|
const n = J(e);
|
|
192
199
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
193
200
|
}
|
|
194
|
-
function
|
|
201
|
+
function R(...e) {
|
|
195
202
|
let t, n, o, l;
|
|
196
203
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = W) : [t, n, o, l] = e, !t)
|
|
197
204
|
return et;
|
|
@@ -199,13 +206,13 @@ function O(...e) {
|
|
|
199
206
|
const a = [], s = () => {
|
|
200
207
|
a.forEach((d) => d()), a.length = 0;
|
|
201
208
|
}, r = (d, f, p, y) => (d.addEventListener(f, p, y), () => d.removeEventListener(f, p, y)), c = U(
|
|
202
|
-
() => [
|
|
209
|
+
() => [O(t), J(l)],
|
|
203
210
|
([d, f]) => {
|
|
204
211
|
if (s(), !d)
|
|
205
212
|
return;
|
|
206
213
|
const p = Ze(f) ? { ...f } : f;
|
|
207
214
|
a.push(
|
|
208
|
-
...n.flatMap((y) => o.map((
|
|
215
|
+
...n.flatMap((y) => o.map((D) => r(d, y, D, p)))
|
|
209
216
|
);
|
|
210
217
|
},
|
|
211
218
|
{ immediate: !0, flush: "post" }
|
|
@@ -230,7 +237,7 @@ function ot(e, t, n = {}) {
|
|
|
230
237
|
const s = nt(() => o && "MutationObserver" in o), r = () => {
|
|
231
238
|
a && (a.disconnect(), a = void 0);
|
|
232
239
|
}, c = V(() => {
|
|
233
|
-
const p = J(e), y = (Array.isArray(p) ? p : [p]).map(
|
|
240
|
+
const p = J(e), y = (Array.isArray(p) ? p : [p]).map(O).filter(Qe);
|
|
234
241
|
return new Set(y);
|
|
235
242
|
}), u = U(
|
|
236
243
|
() => c.value,
|
|
@@ -263,9 +270,9 @@ function lt(e = {}) {
|
|
|
263
270
|
}, r = v(), c = () => {
|
|
264
271
|
r.value = s();
|
|
265
272
|
};
|
|
266
|
-
return n && (
|
|
273
|
+
return n && (R(n, "blur", (u) => {
|
|
267
274
|
u.relatedTarget === null && c();
|
|
268
|
-
}, !0),
|
|
275
|
+
}, !0), R(n, "focus", c, !0)), l && ot(a, (u) => {
|
|
269
276
|
u.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
|
|
270
277
|
d === r.value && c();
|
|
271
278
|
});
|
|
@@ -276,13 +283,13 @@ function lt(e = {}) {
|
|
|
276
283
|
}
|
|
277
284
|
const at = "focusin", st = "focusout";
|
|
278
285
|
function rt(e, t = {}) {
|
|
279
|
-
const { window: n = W } = t, o = V(() =>
|
|
280
|
-
return !n || !s.value ? { focused: a } : (
|
|
286
|
+
const { window: n = W } = t, o = V(() => O(e)), l = v(!1), a = V(() => l.value), s = lt(t);
|
|
287
|
+
return !n || !s.value ? { focused: a } : (R(o, at, () => l.value = !0), R(o, st, () => l.value = !1), { focused: a });
|
|
281
288
|
}
|
|
282
289
|
function it(e, { window: t = W, scrollTarget: n } = {}) {
|
|
283
290
|
const o = v(!1), l = () => {
|
|
284
291
|
if (!t) return;
|
|
285
|
-
const a = t.document, s =
|
|
292
|
+
const a = t.document, s = O(e);
|
|
286
293
|
if (!s)
|
|
287
294
|
o.value = !1;
|
|
288
295
|
else {
|
|
@@ -291,10 +298,10 @@ function it(e, { window: t = W, scrollTarget: n } = {}) {
|
|
|
291
298
|
}
|
|
292
299
|
};
|
|
293
300
|
return U(
|
|
294
|
-
() =>
|
|
301
|
+
() => O(e),
|
|
295
302
|
() => l(),
|
|
296
303
|
{ immediate: !0, flush: "post" }
|
|
297
|
-
), t &&
|
|
304
|
+
), t && R(n || t, "scroll", l, {
|
|
298
305
|
capture: !1,
|
|
299
306
|
passive: !0
|
|
300
307
|
}), o;
|
|
@@ -504,20 +511,20 @@ function ft(e) {
|
|
|
504
511
|
for (const d of Object.keys(u)) {
|
|
505
512
|
const [f, ...p] = d.split(".");
|
|
506
513
|
if (f === "keydown" && p.includes(c)) {
|
|
507
|
-
const y = u[d],
|
|
508
|
-
const
|
|
509
|
-
return r.getModifierState(
|
|
514
|
+
const y = u[d], D = p.filter((b) => Y.includes(b)), S = Y.some((b) => {
|
|
515
|
+
const $ = b.charAt(0).toUpperCase() + b.slice(1);
|
|
516
|
+
return r.getModifierState($);
|
|
510
517
|
});
|
|
511
|
-
if (
|
|
512
|
-
if (
|
|
518
|
+
if (D.length > 0) {
|
|
519
|
+
if (S) {
|
|
513
520
|
for (const b of Y)
|
|
514
521
|
if (p.includes(b)) {
|
|
515
|
-
const
|
|
516
|
-
r.getModifierState(
|
|
522
|
+
const $ = b.charAt(0).toUpperCase() + b.slice(1);
|
|
523
|
+
r.getModifierState($) && y(r);
|
|
517
524
|
}
|
|
518
525
|
}
|
|
519
526
|
} else
|
|
520
|
-
|
|
527
|
+
S || y(r);
|
|
521
528
|
}
|
|
522
529
|
}
|
|
523
530
|
}, a = [];
|
|
@@ -525,8 +532,8 @@ function ft(e) {
|
|
|
525
532
|
for (const s of e) {
|
|
526
533
|
const r = t(s), c = o(s), u = l(s), d = r ? [r] : c;
|
|
527
534
|
for (const f of d) {
|
|
528
|
-
const { focused: p } = rt(v(f)), y = U(p, (
|
|
529
|
-
|
|
535
|
+
const { focused: p } = rt(v(f)), y = U(p, (D) => {
|
|
536
|
+
D ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
|
|
530
537
|
});
|
|
531
538
|
a.push(y);
|
|
532
539
|
}
|
|
@@ -551,7 +558,7 @@ const mt = {
|
|
|
551
558
|
},
|
|
552
559
|
emits: ["update:modelValue"],
|
|
553
560
|
setup(e) {
|
|
554
|
-
const t =
|
|
561
|
+
const t = x(e, "modelValue"), n = v(new Date(t.value)), o = v(n.value.getMonth()), l = v(n.value.getFullYear()), a = v([]), s = ce("datepicker");
|
|
555
562
|
z(async () => {
|
|
556
563
|
r(), await Ae();
|
|
557
564
|
const g = document.getElementsByClassName("selectedDate");
|
|
@@ -577,9 +584,9 @@ const mt = {
|
|
|
577
584
|
const _ = /* @__PURE__ */ new Date();
|
|
578
585
|
if (o.value === _.getMonth())
|
|
579
586
|
return _.toDateString() === new Date(g).toDateString();
|
|
580
|
-
}, y = (g) => new Date(g).toDateString() === new Date(n.value).toDateString(),
|
|
587
|
+
}, y = (g) => new Date(g).toDateString() === new Date(n.value).toDateString(), D = (g, _) => (g - 1) * re + _, S = (g, _) => a.value[D(g, _)], b = (g) => {
|
|
581
588
|
t.value = n.value = new Date(a.value[g]);
|
|
582
|
-
},
|
|
589
|
+
}, $ = V(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
|
|
583
590
|
year: "numeric",
|
|
584
591
|
month: "long"
|
|
585
592
|
}));
|
|
@@ -602,48 +609,50 @@ const mt = {
|
|
|
602
609
|
}
|
|
603
610
|
]), (g, _) => (m(), h("div", mt, [
|
|
604
611
|
i("table", null, [
|
|
605
|
-
i("
|
|
606
|
-
i("
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
i("
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
(m(), h(B, null, q(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
612
|
+
i("tbody", null, [
|
|
613
|
+
i("tr", null, [
|
|
614
|
+
i("td", {
|
|
615
|
+
id: "previous-month-btn",
|
|
616
|
+
onClick: d,
|
|
617
|
+
tabindex: -1
|
|
618
|
+
}, "<"),
|
|
619
|
+
i("th", pt, k($.value), 1),
|
|
620
|
+
i("td", {
|
|
621
|
+
id: "next-month-btn",
|
|
622
|
+
onClick: f,
|
|
623
|
+
tabindex: -1
|
|
624
|
+
}, ">")
|
|
625
|
+
]),
|
|
626
|
+
_[0] || (_[0] = i("tr", { class: "days-header" }, [
|
|
627
|
+
i("td", null, "M"),
|
|
628
|
+
i("td", null, "T"),
|
|
629
|
+
i("td", null, "W"),
|
|
630
|
+
i("td", null, "T"),
|
|
631
|
+
i("td", null, "F"),
|
|
632
|
+
i("td", null, "S"),
|
|
633
|
+
i("td", null, "S")
|
|
634
|
+
], -1)),
|
|
635
|
+
(m(), h(B, null, q(gt, (M) => i("tr", { key: M }, [
|
|
636
|
+
(m(), h(B, null, q(re, (L) => i("td", {
|
|
637
|
+
ref_for: !0,
|
|
638
|
+
ref: "celldate",
|
|
639
|
+
key: D(M, L),
|
|
640
|
+
contenteditable: !1,
|
|
641
|
+
spellcheck: !1,
|
|
642
|
+
tabindex: 0,
|
|
643
|
+
onClick: Me((he) => b(D(M, L)), ["prevent", "stop"]),
|
|
644
|
+
onKeydown: G((he) => b(D(M, L)), ["enter"]),
|
|
645
|
+
class: K({
|
|
646
|
+
todaysDate: p(S(M, L)),
|
|
647
|
+
selectedDate: y(S(M, L))
|
|
648
|
+
})
|
|
649
|
+
}, k(new Date(S(M, L)).getDate()), 43, vt)), 64))
|
|
650
|
+
])), 64))
|
|
651
|
+
])
|
|
643
652
|
])
|
|
644
653
|
], 512));
|
|
645
654
|
}
|
|
646
|
-
}), yt = /* @__PURE__ */ E(ht, [["__scopeId", "data-v-
|
|
655
|
+
}), yt = /* @__PURE__ */ E(ht, [["__scopeId", "data-v-72e0307f"]]), bt = /* @__PURE__ */ A({
|
|
647
656
|
__name: "CollapseButton",
|
|
648
657
|
props: {
|
|
649
658
|
collapsed: { type: Boolean }
|
|
@@ -715,12 +724,12 @@ const mt = {
|
|
|
715
724
|
}, null, 8, ["collapsed"])) : j("", !0)
|
|
716
725
|
], 32),
|
|
717
726
|
Te(a.$slots, "default", { collapsed: t.value }, () => [
|
|
718
|
-
|
|
727
|
+
w(Se(ge, {
|
|
719
728
|
modelValue: o.value,
|
|
720
729
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => o.value = r),
|
|
721
730
|
data: n.value
|
|
722
731
|
}, null, 8, ["modelValue", "data"]), [
|
|
723
|
-
[
|
|
732
|
+
[F, !t.value]
|
|
724
733
|
])
|
|
725
734
|
], !0)
|
|
726
735
|
]));
|
|
@@ -747,13 +756,13 @@ function ie() {
|
|
|
747
756
|
}
|
|
748
757
|
const Et = typeof window < "u" && typeof document < "u";
|
|
749
758
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
750
|
-
const Ct = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Tt = Et ? window.document : void 0,
|
|
759
|
+
const Ct = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Tt = Et ? window.document : void 0, St = {
|
|
751
760
|
multiple: !0,
|
|
752
761
|
accept: "*",
|
|
753
762
|
reset: !1,
|
|
754
763
|
directory: !1
|
|
755
764
|
};
|
|
756
|
-
function
|
|
765
|
+
function $t(e = {}) {
|
|
757
766
|
const {
|
|
758
767
|
document: t = Tt
|
|
759
768
|
} = e, n = v(null), { on: o, trigger: l } = ie(), { on: a, trigger: s } = ie();
|
|
@@ -770,14 +779,14 @@ function St(e = {}) {
|
|
|
770
779
|
if (!r)
|
|
771
780
|
return;
|
|
772
781
|
const f = {
|
|
773
|
-
|
|
782
|
+
...St,
|
|
774
783
|
...e,
|
|
775
784
|
...d
|
|
776
785
|
};
|
|
777
786
|
r.multiple = f.multiple, r.accept = f.accept, r.webkitdirectory = f.directory, Ct(f, "capture") && (r.capture = f.capture), f.reset && c(), r.click();
|
|
778
787
|
};
|
|
779
788
|
return {
|
|
780
|
-
files:
|
|
789
|
+
files: $e(n),
|
|
781
790
|
open: u,
|
|
782
791
|
reset: c,
|
|
783
792
|
onCancel: a,
|
|
@@ -793,7 +802,7 @@ const Lt = { class: "aform_form-element aform_file-attach aform__grid--full" },
|
|
|
793
802
|
label: {}
|
|
794
803
|
},
|
|
795
804
|
setup(e) {
|
|
796
|
-
const { files: t, open: n, reset: o, onChange: l } =
|
|
805
|
+
const { files: t, open: n, reset: o, onChange: l } = $t(), a = V(() => `${t.value.length} ${t.value.length === 1 ? "file" : "files"}`);
|
|
797
806
|
return l((s) => s), (s, r) => (m(), h("div", Lt, [
|
|
798
807
|
I(t) ? (m(), h("div", Vt, [
|
|
799
808
|
i("p", null, [
|
|
@@ -817,7 +826,7 @@ const Lt = { class: "aform_form-element aform_file-attach aform__grid--full" },
|
|
|
817
826
|
}, "Reset", 8, It)
|
|
818
827
|
]));
|
|
819
828
|
}
|
|
820
|
-
}), Pt = /* @__PURE__ */ E(Ht, [["__scopeId", "data-v-0b3a11cc"]]), xt = { class: "aform_form-element" }, Ft = ["id", "disabled", "required"], Bt = ["for"], qt = ["innerHTML"],
|
|
829
|
+
}), Pt = /* @__PURE__ */ E(Ht, [["__scopeId", "data-v-0b3a11cc"]]), xt = { class: "aform_form-element" }, Ft = ["id", "disabled", "required"], Bt = ["for"], qt = ["innerHTML"], Ot = /* @__PURE__ */ A({
|
|
821
830
|
__name: "ANumericInput",
|
|
822
831
|
props: /* @__PURE__ */ H({
|
|
823
832
|
label: {},
|
|
@@ -832,9 +841,9 @@ const Lt = { class: "aform_form-element aform_file-attach aform__grid--full" },
|
|
|
832
841
|
}),
|
|
833
842
|
emits: ["update:modelValue"],
|
|
834
843
|
setup(e) {
|
|
835
|
-
const t =
|
|
844
|
+
const t = x(e, "modelValue");
|
|
836
845
|
return (n, o) => (m(), h("div", xt, [
|
|
837
|
-
|
|
846
|
+
w(i("input", {
|
|
838
847
|
class: "aform_input-field",
|
|
839
848
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
840
849
|
type: "number",
|
|
@@ -842,17 +851,17 @@ const Lt = { class: "aform_form-element aform_file-attach aform__grid--full" },
|
|
|
842
851
|
disabled: n.readonly,
|
|
843
852
|
required: n.required
|
|
844
853
|
}, null, 8, Ft), [
|
|
845
|
-
[
|
|
854
|
+
[P, t.value]
|
|
846
855
|
]),
|
|
847
856
|
i("label", {
|
|
848
857
|
class: "aform_field-label",
|
|
849
858
|
for: n.uuid
|
|
850
859
|
}, k(n.label), 9, Bt),
|
|
851
|
-
|
|
860
|
+
w(i("p", {
|
|
852
861
|
class: "aform_error",
|
|
853
862
|
innerHTML: n.validation.errorMessage
|
|
854
863
|
}, null, 8, qt), [
|
|
855
|
-
[
|
|
864
|
+
[F, n.validation.errorMessage]
|
|
856
865
|
])
|
|
857
866
|
]));
|
|
858
867
|
}
|
|
@@ -864,7 +873,7 @@ const Lt = { class: "aform_form-element aform_file-attach aform__grid--full" },
|
|
|
864
873
|
phone: "(###) ### - ####",
|
|
865
874
|
card: "#### #### #### ####"
|
|
866
875
|
};
|
|
867
|
-
function
|
|
876
|
+
function Rt(e) {
|
|
868
877
|
try {
|
|
869
878
|
return Function(`"use strict";return (${e})`)();
|
|
870
879
|
} catch {
|
|
@@ -874,7 +883,7 @@ function Ut(e) {
|
|
|
874
883
|
var n;
|
|
875
884
|
let t = e.value;
|
|
876
885
|
if (t) {
|
|
877
|
-
const o =
|
|
886
|
+
const o = Rt(t);
|
|
878
887
|
if (o) {
|
|
879
888
|
const l = e.instance.locale;
|
|
880
889
|
t = o(l);
|
|
@@ -928,9 +937,9 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
928
937
|
}),
|
|
929
938
|
emits: ["update:modelValue"],
|
|
930
939
|
setup(e) {
|
|
931
|
-
const t = v(!0), n =
|
|
940
|
+
const t = v(!0), n = x(e, "modelValue");
|
|
932
941
|
return (o, l) => (m(), h("div", Kt, [
|
|
933
|
-
|
|
942
|
+
w(i("input", {
|
|
934
943
|
class: "aform_input-field",
|
|
935
944
|
"onUpdate:modelValue": l[0] || (l[0] = (a) => n.value = a),
|
|
936
945
|
id: o.uuid,
|
|
@@ -938,18 +947,18 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
938
947
|
maxlength: o.mask ? t.value && o.mask.length : void 0,
|
|
939
948
|
required: o.required
|
|
940
949
|
}, null, 8, zt), [
|
|
941
|
-
[
|
|
950
|
+
[P, n.value],
|
|
942
951
|
[I(Gt), o.mask]
|
|
943
952
|
]),
|
|
944
953
|
i("label", {
|
|
945
954
|
class: "aform_field-label",
|
|
946
955
|
for: o.uuid
|
|
947
956
|
}, k(o.label), 9, Nt),
|
|
948
|
-
|
|
957
|
+
w(i("p", {
|
|
949
958
|
class: "aform_error",
|
|
950
959
|
innerHTML: o.validation.errorMessage
|
|
951
960
|
}, null, 8, jt), [
|
|
952
|
-
[
|
|
961
|
+
[F, o.validation.errorMessage]
|
|
953
962
|
])
|
|
954
963
|
]));
|
|
955
964
|
}
|
|
@@ -987,7 +996,7 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
987
996
|
for: "email",
|
|
988
997
|
class: "aform_field-label"
|
|
989
998
|
}, "Email", -1)),
|
|
990
|
-
|
|
999
|
+
w(i("input", {
|
|
991
1000
|
id: "email",
|
|
992
1001
|
class: "aform_input-field",
|
|
993
1002
|
name: "email",
|
|
@@ -999,7 +1008,7 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
999
1008
|
"auto-correct": "off",
|
|
1000
1009
|
disabled: a.value
|
|
1001
1010
|
}, null, 8, ln), [
|
|
1002
|
-
[
|
|
1011
|
+
[P, o.value]
|
|
1003
1012
|
])
|
|
1004
1013
|
]),
|
|
1005
1014
|
i("div", an, [
|
|
@@ -1008,7 +1017,7 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
1008
1017
|
for: "password",
|
|
1009
1018
|
class: "aform_field-label"
|
|
1010
1019
|
}, "Password", -1)),
|
|
1011
|
-
|
|
1020
|
+
w(i("input", {
|
|
1012
1021
|
id: "password",
|
|
1013
1022
|
class: "aform_input-field",
|
|
1014
1023
|
name: "password",
|
|
@@ -1016,7 +1025,7 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
1016
1025
|
"onUpdate:modelValue": u[1] || (u[1] = (d) => l.value = d),
|
|
1017
1026
|
disabled: a.value
|
|
1018
1027
|
}, null, 8, sn), [
|
|
1019
|
-
[
|
|
1028
|
+
[P, l.value]
|
|
1020
1029
|
])
|
|
1021
1030
|
]),
|
|
1022
1031
|
i("button", {
|
|
@@ -1038,7 +1047,7 @@ const Kt = { class: "aform_form-element" }, zt = ["id", "disabled", "maxlength",
|
|
|
1038
1047
|
}
|
|
1039
1048
|
}), fn = /* @__PURE__ */ E(cn, [["__scopeId", "data-v-6cbd3add"]]);
|
|
1040
1049
|
function mn(e) {
|
|
1041
|
-
e.component("ACheckbox", Fe), e.component("ACombobox", Be), e.component("ADate", We), e.component("ADropdown", je), e.component("ADatePicker", yt), e.component("AFieldset", At), e.component("AFileAttach", Pt), e.component("AForm", ge), e.component("ANumericInput",
|
|
1050
|
+
e.component("ACheckbox", Fe), e.component("ACombobox", Be), e.component("ADate", We), e.component("ADropdown", je), e.component("ADatePicker", yt), e.component("AFieldset", At), e.component("AFileAttach", Pt), e.component("AForm", ge), e.component("ANumericInput", Ot), e.component("ATextInput", Jt);
|
|
1042
1051
|
}
|
|
1043
1052
|
export {
|
|
1044
1053
|
Fe as ACheckbox,
|
|
@@ -1049,7 +1058,7 @@ export {
|
|
|
1049
1058
|
At as AFieldset,
|
|
1050
1059
|
Pt as AFileAttach,
|
|
1051
1060
|
ge as AForm,
|
|
1052
|
-
|
|
1061
|
+
Ot as ANumericInput,
|
|
1053
1062
|
Jt as ATextInput,
|
|
1054
1063
|
fn as Login,
|
|
1055
1064
|
mn as install
|