react-artasys-ui 0.1.32 → 0.1.33
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/Form/Element/Element.d.ts +3 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +222 -212
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -286,37 +286,37 @@ var Pe = (e, t, n, r) => {
|
|
|
286
286
|
fields: i,
|
|
287
287
|
shouldUseNativeValidation: r
|
|
288
288
|
};
|
|
289
|
-
},
|
|
289
|
+
}, Fe = (e) => e instanceof RegExp, Ie = (e) => M(e) ? e : Fe(e) ? e.source : w(e) ? Fe(e.value) ? e.value.source : e.value : e, Le = (e) => ({
|
|
290
290
|
isOnSubmit: !e || e === A.onSubmit,
|
|
291
291
|
isOnBlur: e === A.onBlur,
|
|
292
292
|
isOnChange: e === A.onChange,
|
|
293
293
|
isOnAll: e === A.all,
|
|
294
294
|
isOnTouch: e === A.onTouched
|
|
295
|
-
}),
|
|
295
|
+
}), Re = "AsyncFunction", ze = (e) => {
|
|
296
296
|
if (!e || !e.validate) return !1;
|
|
297
|
-
if (F(e.validate)) return e.validate.constructor.name ===
|
|
297
|
+
if (F(e.validate)) return e.validate.constructor.name === Re;
|
|
298
298
|
if (w(e.validate)) {
|
|
299
|
-
for (let t in e.validate) if (e.validate[t].constructor.name ===
|
|
299
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === Re) return !0;
|
|
300
300
|
}
|
|
301
301
|
return !1;
|
|
302
|
-
},
|
|
302
|
+
}, Be = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Ve = (e, t, n) => {
|
|
303
303
|
if (n) return !1;
|
|
304
304
|
if (t.watchAll || t.watch.has(e)) return !0;
|
|
305
305
|
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
306
306
|
return !1;
|
|
307
|
-
},
|
|
307
|
+
}, He = (e, t, n, r) => {
|
|
308
308
|
for (let i of n || Object.keys(e)) {
|
|
309
309
|
let n = N(e, i);
|
|
310
310
|
if (n) {
|
|
311
311
|
let { _f: e, ...a } = n;
|
|
312
312
|
if (e) {
|
|
313
313
|
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
314
|
-
if (
|
|
315
|
-
} else if (w(a) &&
|
|
314
|
+
if (He(a, t)) break;
|
|
315
|
+
} else if (w(a) && He(a, t)) break;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
function
|
|
319
|
+
function Ue(e, t, n) {
|
|
320
320
|
let r = N(e, n);
|
|
321
321
|
if (r || ie(n)) return {
|
|
322
322
|
error: r,
|
|
@@ -338,25 +338,25 @@ function He(e, t, n) {
|
|
|
338
338
|
}
|
|
339
339
|
return { name: n };
|
|
340
340
|
}
|
|
341
|
-
var
|
|
341
|
+
var We = (e, t, n, r) => {
|
|
342
342
|
n(e);
|
|
343
343
|
let { name: i, ...a } = e, o = Object.keys(a);
|
|
344
344
|
return !o.length || r && o.length >= Object.keys(t).length || o.find((e) => t[e] === (!r || A.all));
|
|
345
|
-
},
|
|
345
|
+
}, Ge = (e, t, n) => !e || !t || e === t || he(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), Ke = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, qe = (e, t) => !me(N(e, t)).length && U(e, t), Je = (e, t, n) => {
|
|
346
346
|
let r = N(e, n), i = Array.isArray(r) ? r : [];
|
|
347
347
|
return I(i, te, t[n]), I(e, n, i), e;
|
|
348
348
|
};
|
|
349
|
-
function
|
|
349
|
+
function Ye(e, t, n = "validate") {
|
|
350
350
|
if (L(e) || Array.isArray(e) && e.every(L) || P(e) && !e) return {
|
|
351
351
|
type: n,
|
|
352
352
|
message: L(e) ? e : "",
|
|
353
353
|
ref: t
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
var
|
|
356
|
+
var K = (e) => w(e) && !Fe(e) ? e : {
|
|
357
357
|
value: e,
|
|
358
358
|
message: ""
|
|
359
|
-
},
|
|
359
|
+
}, Xe = async (e, t, n, r, i, a) => {
|
|
360
360
|
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = N(n, h);
|
|
361
361
|
if (!_ || t.has(h)) return {};
|
|
362
362
|
let y = s ? s[0] : o, x = (e) => {
|
|
@@ -377,7 +377,7 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
377
377
|
let { value: e, message: t } = L(c) ? {
|
|
378
378
|
value: !!c,
|
|
379
379
|
message: c
|
|
380
|
-
} :
|
|
380
|
+
} : K(c);
|
|
381
381
|
if (e && (C[h] = {
|
|
382
382
|
type: j.required,
|
|
383
383
|
message: t,
|
|
@@ -386,7 +386,7 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
386
386
|
}, !r)) return x(t), C;
|
|
387
387
|
}
|
|
388
388
|
if (!D && (!S(d) || !S(f))) {
|
|
389
|
-
let e, t, n =
|
|
389
|
+
let e, t, n = K(f), i = K(d);
|
|
390
390
|
if (!S(v) && !isNaN(v)) {
|
|
391
391
|
let r = o.valueAsNumber || v && +v;
|
|
392
392
|
S(n.value) || (e = r > n.value), S(i.value) || (t = r < i.value);
|
|
@@ -397,12 +397,12 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
397
397
|
if ((e || t) && (k(!!e, n.message, i.message, j.max, j.min), !r)) return x(C[h].message), C;
|
|
398
398
|
}
|
|
399
399
|
if ((l || u) && !D && (L(v) || a && Array.isArray(v))) {
|
|
400
|
-
let e =
|
|
400
|
+
let e = K(l), t = K(u), n = !S(e.value) && v.length > +e.value, i = !S(t.value) && v.length < +t.value;
|
|
401
401
|
if ((n || i) && (k(n, e.message, t.message), !r)) return x(C[h].message), C;
|
|
402
402
|
}
|
|
403
403
|
if (p && !D && L(v)) {
|
|
404
|
-
let { value: e, message: t } =
|
|
405
|
-
if (
|
|
404
|
+
let { value: e, message: t } = K(p);
|
|
405
|
+
if (Fe(e) && !v.match(e) && (C[h] = {
|
|
406
406
|
type: j.pattern,
|
|
407
407
|
message: t,
|
|
408
408
|
ref: o,
|
|
@@ -411,7 +411,7 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
411
411
|
}
|
|
412
412
|
if (m) {
|
|
413
413
|
if (F(m)) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = Ye(await m(v, n), y);
|
|
415
415
|
if (e && (C[h] = {
|
|
416
416
|
...e,
|
|
417
417
|
...O(j.validate, e.message)
|
|
@@ -420,7 +420,7 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
420
420
|
let e = {};
|
|
421
421
|
for (let t in m) {
|
|
422
422
|
if (!B(e) && !r) break;
|
|
423
|
-
let i =
|
|
423
|
+
let i = Ye(await m[t](v, n), y, t);
|
|
424
424
|
i && (e = {
|
|
425
425
|
...i,
|
|
426
426
|
...O(t, i.message)
|
|
@@ -433,11 +433,11 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
return x(!0), C;
|
|
436
|
-
},
|
|
436
|
+
}, Ze = {
|
|
437
437
|
mode: A.onSubmit,
|
|
438
438
|
reValidateMode: A.onChange,
|
|
439
439
|
shouldFocusError: !0
|
|
440
|
-
},
|
|
440
|
+
}, Qe = "form", $e = {
|
|
441
441
|
submitCount: 0,
|
|
442
442
|
isDirty: !1,
|
|
443
443
|
isReady: !1,
|
|
@@ -450,12 +450,12 @@ var q = (e) => w(e) && !K(e) ? e : {
|
|
|
450
450
|
dirtyFields: {},
|
|
451
451
|
validatingFields: {}
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function et(e = {}) {
|
|
454
454
|
let t = {
|
|
455
|
-
...
|
|
455
|
+
...Ze,
|
|
456
456
|
...e
|
|
457
457
|
}, n = {
|
|
458
|
-
...O(
|
|
458
|
+
...O($e),
|
|
459
459
|
isLoading: F(t.defaultValues),
|
|
460
460
|
errors: t.errors || {},
|
|
461
461
|
disabled: t.disabled || !1
|
|
@@ -471,7 +471,7 @@ function $e(e = {}) {
|
|
|
471
471
|
array: /* @__PURE__ */ new Set(),
|
|
472
472
|
watch: /* @__PURE__ */ new Set(),
|
|
473
473
|
registerName: /* @__PURE__ */ new Set()
|
|
474
|
-
}, c, l = 0, u = 0, d =
|
|
474
|
+
}, c, l = 0, u = 0, d = Le(t.mode), f = Le(t.reValidateMode), p = {
|
|
475
475
|
isDirty: !1,
|
|
476
476
|
dirtyFields: !1,
|
|
477
477
|
validatingFields: !1,
|
|
@@ -510,7 +510,7 @@ function $e(e = {}) {
|
|
|
510
510
|
}
|
|
511
511
|
if (u && Array.isArray(N(n.errors, e))) {
|
|
512
512
|
let t = s(N(n.errors, e), c.argA, c.argB);
|
|
513
|
-
l && I(n.errors, e, t),
|
|
513
|
+
l && I(n.errors, e, t), qe(n.errors, e);
|
|
514
514
|
}
|
|
515
515
|
if ((m.touchedFields || h.touchedFields) && u && Array.isArray(N(n.touchedFields, e))) {
|
|
516
516
|
let t = s(N(n.touchedFields, e), c.argA, c.argB);
|
|
@@ -543,7 +543,7 @@ function $e(e = {}) {
|
|
|
543
543
|
if (d) {
|
|
544
544
|
if (se(t)) return;
|
|
545
545
|
let r = M(N(a, t)), f = N(a, t, M(l) ? N(i, t) : l);
|
|
546
|
-
M(f) || u && u.defaultChecked || c ? I(a, t, c ? f : Ne(d._f)) : Ee(t, f), o.mount && !o.action && (y(), r && n.isDirty && (m.isDirty || h.isDirty) && (H() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !M(N(a, t)) &&
|
|
546
|
+
M(f) || u && u.defaultChecked || c ? I(a, t, c ? f : Ne(d._f)) : Ee(t, f), o.mount && !o.action && (y(), r && n.isDirty && (m.isDirty || h.isDirty) && (H() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !M(N(a, t)) && Ve(t, s) && (o.watch = !0));
|
|
547
547
|
}
|
|
548
548
|
}, le = (e, r, o, s, c) => {
|
|
549
549
|
let l = !1, u = !1, d = { name: e };
|
|
@@ -578,7 +578,7 @@ function $e(e = {}) {
|
|
|
578
578
|
if (C(e), e) {
|
|
579
579
|
for (let r of e) {
|
|
580
580
|
let e = N(t, r);
|
|
581
|
-
e ? s.array.has(r) && w(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ?
|
|
581
|
+
e ? s.array.has(r) && w(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? Je(n.errors, { [r]: e }, r) : I(n.errors, r, e) : U(n.errors, r);
|
|
582
582
|
}
|
|
583
583
|
n.errors = { ...n.errors };
|
|
584
584
|
} else n.errors = t;
|
|
@@ -593,15 +593,15 @@ function $e(e = {}) {
|
|
|
593
593
|
});
|
|
594
594
|
if (w(i)) for (let e in i) {
|
|
595
595
|
let t = i[e];
|
|
596
|
-
t &&
|
|
596
|
+
t && et(`${Qe}.${e}`, {
|
|
597
597
|
message: L(t.message) ? t.message : "",
|
|
598
598
|
type: t.type || j.validate
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
|
-
else L(i) || !i ?
|
|
601
|
+
else L(i) || !i ? et(Qe, {
|
|
602
602
|
message: i || "",
|
|
603
603
|
type: j.validate
|
|
604
|
-
}) :
|
|
604
|
+
}) : K(Qe);
|
|
605
605
|
return i;
|
|
606
606
|
}
|
|
607
607
|
return !0;
|
|
@@ -618,10 +618,10 @@ function $e(e = {}) {
|
|
|
618
618
|
if (u) {
|
|
619
619
|
let { _f: r, ...d } = u;
|
|
620
620
|
if (r) {
|
|
621
|
-
let o = s.array.has(r.name), c = u._f &&
|
|
621
|
+
let o = s.array.has(r.name), c = u._f && ze(u._f), d = m.validatingFields || m.isValidating || h.validatingFields || h.isValidating;
|
|
622
622
|
c && d && C([r.name], !0);
|
|
623
|
-
let f = await
|
|
624
|
-
if (c && d && C([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (N(f, r.name) ? o ?
|
|
623
|
+
let f = await Xe(u, s.disabled, a, _, t.shouldUseNativeValidation && !i, o);
|
|
624
|
+
if (c && d && C([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (N(f, r.name) ? o ? Je(n.errors, f, r.name) : I(n.errors, r.name, f[r.name]) : U(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
|
|
625
625
|
}
|
|
626
626
|
!B(d) && await V({
|
|
627
627
|
context: l,
|
|
@@ -636,7 +636,7 @@ function $e(e = {}) {
|
|
|
636
636
|
}, Ce = () => {
|
|
637
637
|
for (let e of s.unMount) {
|
|
638
638
|
let t = N(r, e);
|
|
639
|
-
t && (t._f.refs ? t._f.refs.every((e) => !Se(e)) : !Se(t._f.ref)) &&
|
|
639
|
+
t && (t._f.refs ? t._f.refs.every((e) => !Se(e)) : !Se(t._f.ref)) && J(e);
|
|
640
640
|
}
|
|
641
641
|
s.unMount = /* @__PURE__ */ new Set();
|
|
642
642
|
}, H = (e, n) => !t.disabled && (e && n && I(a, e, n), !z(o.mount ? a : i, i)), we = (e, t, n) => ue(e, s, { ...o.mount ? a : M(t) ? i : L(e) ? { [e]: t } : t }, n, t), Te = (e) => me(N(o.mount ? a : i, e, t.shouldUnregister ? N(i, e, []) : [])), Ee = (e, t, n = {}, i = !1, o = !1) => {
|
|
@@ -650,7 +650,7 @@ function $e(e = {}) {
|
|
|
650
650
|
values: i ? a : O(a)
|
|
651
651
|
})));
|
|
652
652
|
}
|
|
653
|
-
(n.shouldDirty || n.shouldTouch) && le(e, c, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate &&
|
|
653
|
+
(n.shouldDirty || n.shouldTouch) && le(e, c, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate && Fe(e);
|
|
654
654
|
}, De = (e, t, n, i = !1, a = !1) => {
|
|
655
655
|
for (let o in t) {
|
|
656
656
|
if (!t.hasOwnProperty(o)) return;
|
|
@@ -672,7 +672,7 @@ function $e(e = {}) {
|
|
|
672
672
|
!u || u._f || S(f) || t ? Ee(e, f, i, c, l) : De(e, f, i, c, l);
|
|
673
673
|
}
|
|
674
674
|
if (!p && !l) {
|
|
675
|
-
let t =
|
|
675
|
+
let t = Ve(e, s), r = c ? a : O(a);
|
|
676
676
|
g.state.next({
|
|
677
677
|
...t && n,
|
|
678
678
|
name: o.mount || t ? e : void 0,
|
|
@@ -700,7 +700,7 @@ function $e(e = {}) {
|
|
|
700
700
|
v = Number.isNaN(e) || x(e) && isNaN(e.getTime()) || z(e, N(a, p, e));
|
|
701
701
|
};
|
|
702
702
|
if (b) {
|
|
703
|
-
let o, x, w = l.type ? Ne(b._f) : ee(i), T = i.type === k.BLUR || i.type === k.FOCUS_OUT, E = !
|
|
703
|
+
let o, x, w = l.type ? Ne(b._f) : ee(i), T = i.type === k.BLUR || i.type === k.FOCUS_OUT, E = !Be(b._f) && !e.validate && !t.resolver && !N(n.errors, p) && !b._f.deps, D = E || Ke(T, N(n.touchedFields, p), n.isSubmitted, f, d), A = Ve(p, s, T);
|
|
704
704
|
I(a, p, w), T ? (!l || !l.readOnly) && (b._f.onBlur && b._f.onBlur(i), c && c(0)) : b._f.onChange && b._f.onChange(i);
|
|
705
705
|
let j = le(p, w, T), te = !B(j) || A;
|
|
706
706
|
if (!T && g.state.next({
|
|
@@ -720,19 +720,19 @@ function $e(e = {}) {
|
|
|
720
720
|
!B(j) && g.state.next(j);
|
|
721
721
|
return;
|
|
722
722
|
}
|
|
723
|
-
let t =
|
|
723
|
+
let t = Ue(n.errors, r, p), i = Ue(e, r, t.name || p);
|
|
724
724
|
o = i.error, p = i.name, x = B(e);
|
|
725
|
-
} else C([p], !0), o = (await
|
|
725
|
+
} else C([p], !0), o = (await Xe(b, s.disabled, a, _, t.shouldUseNativeValidation))[p], C([p]), S(w), v && (o ? x = !1 : (m.isValid || h.isValid) && (x = await V({
|
|
726
726
|
fields: r,
|
|
727
727
|
onlyCheckValid: !0,
|
|
728
728
|
name: p,
|
|
729
729
|
eventType: i.type
|
|
730
730
|
})));
|
|
731
|
-
v && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) &&
|
|
731
|
+
v && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) && Fe(b._f.deps), de(p, x, o, j));
|
|
732
732
|
}
|
|
733
733
|
}, Me = (e, t) => {
|
|
734
734
|
if (N(n.errors, t) && e.focus) return e.focus(), 1;
|
|
735
|
-
},
|
|
735
|
+
}, Fe = async (e, i = {}) => {
|
|
736
736
|
let a, o, c = he(e);
|
|
737
737
|
if (t.resolver) {
|
|
738
738
|
let t = await fe(M(e) ? e : c);
|
|
@@ -752,17 +752,17 @@ function $e(e = {}) {
|
|
|
752
752
|
...!L(e) || (m.isValid || h.isValid) && a !== n.isValid ? {} : { name: e },
|
|
753
753
|
...t.resolver || !e ? { isValid: a } : {},
|
|
754
754
|
errors: n.errors
|
|
755
|
-
}), i.shouldFocus && !o &&
|
|
756
|
-
},
|
|
755
|
+
}), i.shouldFocus && !o && He(r, Me, e ? c : s.mount), o;
|
|
756
|
+
}, Re = (e, t) => {
|
|
757
757
|
let r = { ...o.mount ? a : i };
|
|
758
758
|
return t && (r = _e(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), M(e) ? r : L(e) ? N(r, e) : e.map((e) => N(r, e));
|
|
759
|
-
},
|
|
759
|
+
}, Ye = (e, t) => ({
|
|
760
760
|
invalid: !!N((t || n).errors, e),
|
|
761
761
|
isDirty: !!N((t || n).dirtyFields, e),
|
|
762
762
|
error: N((t || n).errors, e),
|
|
763
763
|
isValidating: !!N(n.validatingFields, e),
|
|
764
764
|
isTouched: !!N((t || n).touchedFields, e)
|
|
765
|
-
}),
|
|
765
|
+
}), K = (e) => {
|
|
766
766
|
let t = e ? he(e) : void 0;
|
|
767
767
|
t?.forEach((e) => U(n.errors, e)), t ? t.forEach((e) => {
|
|
768
768
|
g.state.next({
|
|
@@ -770,7 +770,7 @@ function $e(e = {}) {
|
|
|
770
770
|
errors: n.errors
|
|
771
771
|
});
|
|
772
772
|
}) : g.state.next({ errors: {} });
|
|
773
|
-
},
|
|
773
|
+
}, et = (e, t, i) => {
|
|
774
774
|
let a = (N(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = N(n.errors, e) || {};
|
|
775
775
|
I(n.errors, e, {
|
|
776
776
|
...l,
|
|
@@ -781,7 +781,7 @@ function $e(e = {}) {
|
|
|
781
781
|
errors: n.errors,
|
|
782
782
|
isValid: !1
|
|
783
783
|
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
784
|
-
},
|
|
784
|
+
}, tt = (e, t) => {
|
|
785
785
|
if (F(e)) {
|
|
786
786
|
u++;
|
|
787
787
|
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values || we(void 0, t), n) }), r = !1;
|
|
@@ -790,11 +790,11 @@ function $e(e = {}) {
|
|
|
790
790
|
} };
|
|
791
791
|
}
|
|
792
792
|
return we(e, t, !0);
|
|
793
|
-
},
|
|
793
|
+
}, nt = (e) => {
|
|
794
794
|
let t = !!e.formState?.values;
|
|
795
795
|
t && u++;
|
|
796
796
|
let { unsubscribe: r } = g.state.subscribe({ next: (t) => {
|
|
797
|
-
if (
|
|
797
|
+
if (Ge(e.name, t.name, e.exact) && We(t, e.formState || m, dt, e.reRenderRoot)) {
|
|
798
798
|
let r = { ...a };
|
|
799
799
|
e.callback({
|
|
800
800
|
values: r,
|
|
@@ -809,27 +809,27 @@ function $e(e = {}) {
|
|
|
809
809
|
return () => {
|
|
810
810
|
o || (o = !0, u--, r());
|
|
811
811
|
};
|
|
812
|
-
},
|
|
812
|
+
}, q = (e) => (o.mount = !0, h = {
|
|
813
813
|
...h,
|
|
814
814
|
...e.formState
|
|
815
|
-
},
|
|
815
|
+
}, nt({
|
|
816
816
|
...e,
|
|
817
817
|
formState: {
|
|
818
818
|
...p,
|
|
819
819
|
...e.formState
|
|
820
820
|
}
|
|
821
|
-
})),
|
|
821
|
+
})), J = (e, o = {}) => {
|
|
822
822
|
for (let c of e ? he(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || (U(r, c), U(a, c)), !o.keepError && U(n.errors, c), !o.keepDirty && U(n.dirtyFields, c), !o.keepTouched && U(n.touchedFields, c), !o.keepIsValidating && U(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && U(i, c);
|
|
823
823
|
g.state.next({ values: O(a) }), g.state.next({
|
|
824
824
|
...n,
|
|
825
825
|
...o.keepDirty ? { isDirty: H() } : {}
|
|
826
826
|
}), !o.keepIsValid && y();
|
|
827
|
-
},
|
|
827
|
+
}, rt = ({ disabled: e, name: t }) => {
|
|
828
828
|
if (P(e) && o.mount || e || s.disabled.has(t)) {
|
|
829
829
|
let n = s.disabled.has(t) !== !!e;
|
|
830
830
|
e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && y();
|
|
831
831
|
}
|
|
832
|
-
},
|
|
832
|
+
}, Y = (e, n = {}) => {
|
|
833
833
|
let a = N(r, e), c = P(n.disabled) || P(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
|
|
834
834
|
return I(r, e, {
|
|
835
835
|
...a || {},
|
|
@@ -839,25 +839,25 @@ function $e(e = {}) {
|
|
|
839
839
|
mount: !0,
|
|
840
840
|
...n
|
|
841
841
|
}
|
|
842
|
-
}), s.mount.add(e), a && !l ?
|
|
842
|
+
}), s.mount.add(e), a && !l ? rt({
|
|
843
843
|
disabled: P(n.disabled) ? n.disabled : t.disabled,
|
|
844
844
|
name: e
|
|
845
845
|
}) : ce(e, !0, n.value), {
|
|
846
846
|
...c ? { disabled: n.disabled || t.disabled } : {},
|
|
847
847
|
...t.progressive ? {
|
|
848
848
|
required: !!n.required,
|
|
849
|
-
min:
|
|
850
|
-
max:
|
|
851
|
-
minLength:
|
|
852
|
-
maxLength:
|
|
853
|
-
pattern:
|
|
849
|
+
min: Ie(n.min),
|
|
850
|
+
max: Ie(n.max),
|
|
851
|
+
minLength: Ie(n.minLength),
|
|
852
|
+
maxLength: Ie(n.maxLength),
|
|
853
|
+
pattern: Ie(n.pattern)
|
|
854
854
|
} : {},
|
|
855
855
|
name: e,
|
|
856
856
|
onChange: je,
|
|
857
857
|
onBlur: je,
|
|
858
858
|
ref: (c) => {
|
|
859
859
|
if (c) {
|
|
860
|
-
s.registerName.add(e),
|
|
860
|
+
s.registerName.add(e), Y(e, n), s.registerName.delete(e), a = N(r, e);
|
|
861
861
|
let t = M(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = xe(t), l = a._f.refs || [];
|
|
862
862
|
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
863
863
|
I(r, e, { _f: {
|
|
@@ -877,14 +877,14 @@ function $e(e = {}) {
|
|
|
877
877
|
} else a = N(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(T(s.array, e) && o.action) && s.unMount.add(e);
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
|
-
},
|
|
881
|
-
P(e) && (g.state.next({ disabled: e }),
|
|
880
|
+
}, it = () => t.shouldFocusError && !t.shouldUseNativeValidation && He(r, Me, s.mount), at = (e) => {
|
|
881
|
+
P(e) && (g.state.next({ disabled: e }), He(r, (t, n) => {
|
|
882
882
|
let i = N(r, n);
|
|
883
883
|
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
884
884
|
t.disabled = i._f.disabled || e;
|
|
885
885
|
}));
|
|
886
886
|
}, 0, !1));
|
|
887
|
-
},
|
|
887
|
+
}, ot = (e, i) => async (o) => {
|
|
888
888
|
let c;
|
|
889
889
|
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
890
890
|
let l = O(a);
|
|
@@ -903,7 +903,7 @@ function $e(e = {}) {
|
|
|
903
903
|
} catch (e) {
|
|
904
904
|
c = e;
|
|
905
905
|
}
|
|
906
|
-
} else i && await i({ ...n.errors }, o),
|
|
906
|
+
} else i && await i({ ...n.errors }, o), it(), setTimeout(it);
|
|
907
907
|
if (g.state.next({
|
|
908
908
|
isSubmitted: !0,
|
|
909
909
|
isSubmitting: !1,
|
|
@@ -911,9 +911,9 @@ function $e(e = {}) {
|
|
|
911
911
|
submitCount: n.submitCount + 1,
|
|
912
912
|
errors: n.errors
|
|
913
913
|
}), c) throw c;
|
|
914
|
-
},
|
|
914
|
+
}, st = (e, t = {}) => {
|
|
915
915
|
N(r, e) && (M(t.defaultValue) ? G(e, O(N(i, e))) : (G(e, t.defaultValue), I(i, e, O(t.defaultValue))), t.keepTouched || U(n.touchedFields, e), t.keepDirty || (U(n.dirtyFields, e), n.isDirty = t.defaultValue ? H(e, O(N(i, e))) : H()), t.keepError || (U(n.errors, e), m.isValid && y()), g.state.next({ ...n }));
|
|
916
|
-
},
|
|
916
|
+
}, ct = (e, c = {}) => {
|
|
917
917
|
let l = e ? O(e) : i, u = O(l), d = B(e), f = u;
|
|
918
918
|
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
919
919
|
if (c.keepDirtyValues) {
|
|
@@ -964,10 +964,10 @@ function $e(e = {}) {
|
|
|
964
964
|
isSubmitting: !1,
|
|
965
965
|
defaultValues: i
|
|
966
966
|
});
|
|
967
|
-
},
|
|
967
|
+
}, lt = (e, n) => ct(F(e) ? e(a) : e, {
|
|
968
968
|
...t.resetOptions,
|
|
969
969
|
...n
|
|
970
|
-
}),
|
|
970
|
+
}), ut = (e, t = {}) => {
|
|
971
971
|
let n = N(r, e), i = n && n._f;
|
|
972
972
|
if (i) {
|
|
973
973
|
let e = i.refs ? i.refs[0] : i.ref;
|
|
@@ -975,35 +975,35 @@ function $e(e = {}) {
|
|
|
975
975
|
e.focus(), t.shouldSelect && F(e.select) && e.select();
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
|
-
},
|
|
978
|
+
}, dt = (e) => {
|
|
979
979
|
n = {
|
|
980
980
|
...n,
|
|
981
981
|
...e
|
|
982
982
|
};
|
|
983
|
-
},
|
|
983
|
+
}, X = {
|
|
984
984
|
control: {
|
|
985
|
-
register:
|
|
986
|
-
unregister:
|
|
987
|
-
getFieldState:
|
|
988
|
-
handleSubmit:
|
|
989
|
-
setError:
|
|
990
|
-
_subscribe:
|
|
985
|
+
register: Y,
|
|
986
|
+
unregister: J,
|
|
987
|
+
getFieldState: Ye,
|
|
988
|
+
handleSubmit: ot,
|
|
989
|
+
setError: et,
|
|
990
|
+
_subscribe: nt,
|
|
991
991
|
_runSchema: R,
|
|
992
992
|
_updateIsValidating: C,
|
|
993
|
-
_focusError:
|
|
993
|
+
_focusError: it,
|
|
994
994
|
_getWatch: we,
|
|
995
995
|
_getDirty: H,
|
|
996
996
|
_setValid: y,
|
|
997
997
|
_setFieldArray: ne,
|
|
998
|
-
_setDisabledField:
|
|
998
|
+
_setDisabledField: rt,
|
|
999
999
|
_setErrors: ae,
|
|
1000
1000
|
_getFieldArray: Te,
|
|
1001
|
-
_reset:
|
|
1001
|
+
_reset: ct,
|
|
1002
1002
|
_resetDefaultValues: () => F(t.defaultValues) && t.defaultValues().then((e) => {
|
|
1003
|
-
|
|
1003
|
+
lt(e, t.resetOptions), g.state.next({ isLoading: !1 });
|
|
1004
1004
|
}),
|
|
1005
1005
|
_removeUnmounted: Ce,
|
|
1006
|
-
_disableForm:
|
|
1006
|
+
_disableForm: at,
|
|
1007
1007
|
_subjects: g,
|
|
1008
1008
|
_proxyFormState: m,
|
|
1009
1009
|
get _fields() {
|
|
@@ -1037,19 +1037,19 @@ function $e(e = {}) {
|
|
|
1037
1037
|
t = {
|
|
1038
1038
|
...t,
|
|
1039
1039
|
...e
|
|
1040
|
-
}, d =
|
|
1040
|
+
}, d = Le(t.mode), f = Le(t.reValidateMode);
|
|
1041
1041
|
}
|
|
1042
1042
|
},
|
|
1043
|
-
subscribe:
|
|
1044
|
-
trigger:
|
|
1045
|
-
register:
|
|
1046
|
-
handleSubmit:
|
|
1047
|
-
watch:
|
|
1043
|
+
subscribe: q,
|
|
1044
|
+
trigger: Fe,
|
|
1045
|
+
register: Y,
|
|
1046
|
+
handleSubmit: ot,
|
|
1047
|
+
watch: tt,
|
|
1048
1048
|
setValue: G,
|
|
1049
1049
|
setValues: ke,
|
|
1050
|
-
getValues:
|
|
1051
|
-
reset:
|
|
1052
|
-
resetField:
|
|
1050
|
+
getValues: Re,
|
|
1051
|
+
reset: lt,
|
|
1052
|
+
resetField: st,
|
|
1053
1053
|
resetDefaultValues: (e, t = {}) => {
|
|
1054
1054
|
if (i = O(e), !t.keepDirty) {
|
|
1055
1055
|
let e = W(i, a);
|
|
@@ -1060,20 +1060,20 @@ function $e(e = {}) {
|
|
|
1060
1060
|
defaultValues: i
|
|
1061
1061
|
});
|
|
1062
1062
|
},
|
|
1063
|
-
clearErrors:
|
|
1064
|
-
unregister:
|
|
1065
|
-
setError:
|
|
1066
|
-
setFocus:
|
|
1067
|
-
getFieldState:
|
|
1063
|
+
clearErrors: K,
|
|
1064
|
+
unregister: J,
|
|
1065
|
+
setError: et,
|
|
1066
|
+
setFocus: ut,
|
|
1067
|
+
getFieldState: Ye
|
|
1068
1068
|
};
|
|
1069
1069
|
return {
|
|
1070
|
-
...
|
|
1071
|
-
formControl:
|
|
1070
|
+
...X,
|
|
1071
|
+
formControl: X
|
|
1072
1072
|
};
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function tt(e = {}) {
|
|
1075
1075
|
let t = r.useRef(void 0), n = r.useRef(void 0), i = r.useRef(e.formControl), [a, o] = r.useState(() => ({
|
|
1076
|
-
...O(
|
|
1076
|
+
...O($e),
|
|
1077
1077
|
isLoading: F(e.defaultValues),
|
|
1078
1078
|
errors: e.errors || {},
|
|
1079
1079
|
disabled: e.disabled || !1,
|
|
@@ -1084,7 +1084,7 @@ function et(e = {}) {
|
|
|
1084
1084
|
formState: a
|
|
1085
1085
|
}, e.defaultValues && !F(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1086
1086
|
else {
|
|
1087
|
-
let { formControl: n, ...r } =
|
|
1087
|
+
let { formControl: n, ...r } = et(e);
|
|
1088
1088
|
t.current = {
|
|
1089
1089
|
...r,
|
|
1090
1090
|
formState: a
|
|
@@ -1130,8 +1130,8 @@ function et(e = {}) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
//#endregion
|
|
1132
1132
|
//#region src/Form/useForm.tsx
|
|
1133
|
-
var
|
|
1134
|
-
let [n, r] = p(), i =
|
|
1133
|
+
var nt = () => {
|
|
1134
|
+
let [n, r] = p(), i = tt({ reValidateMode: "onChange" }), a = (e, t) => {
|
|
1135
1135
|
let n = i.register(e, t), a = (t) => (r(null), i.clearErrors(e), n.onChange(t)), o = i?.formState.errors, s = i.watch(e);
|
|
1136
1136
|
return {
|
|
1137
1137
|
...n,
|
|
@@ -1151,66 +1151,71 @@ var tt = () => {
|
|
|
1151
1151
|
GlobalError: s,
|
|
1152
1152
|
setErrors: o
|
|
1153
1153
|
};
|
|
1154
|
-
},
|
|
1154
|
+
}, q = {
|
|
1155
1155
|
container: "style-module__container__JyG0-",
|
|
1156
1156
|
"loading-container": "style-module__loading-container__sphNQ",
|
|
1157
1157
|
hidden: "style-module__hidden__jvJWI",
|
|
1158
1158
|
disabled: "style-module__disabled__p40Jo",
|
|
1159
1159
|
error: "style-module__error__pSghy",
|
|
1160
1160
|
placeholder: "style-module__placeholder__c-V0V",
|
|
1161
|
+
border: "style-module__border__LR2ve",
|
|
1161
1162
|
element: "style-module__element__Ex50N"
|
|
1162
|
-
},
|
|
1163
|
+
}, J = {
|
|
1163
1164
|
loading: "style-module__loading__r9fwC",
|
|
1164
1165
|
dot: "style-module__dot__mMqu2",
|
|
1165
1166
|
bounce: "style-module__bounce__ikJLW",
|
|
1166
1167
|
light: "style-module__light__Kubs1",
|
|
1167
1168
|
secondary: "style-module__secondary__EkNcU",
|
|
1168
1169
|
"secondary-light": "style-module__secondary-light__cJeWY"
|
|
1169
|
-
},
|
|
1170
|
+
}, rt = ({ color: e = "primary", ...r }) => {
|
|
1170
1171
|
let i = ["ui-loading"];
|
|
1171
|
-
return i.push(
|
|
1172
|
+
return i.push(J.loading), e && i.push(J[e], "ui-loading-" + e), /* @__PURE__ */ n("div", {
|
|
1172
1173
|
...r,
|
|
1173
1174
|
className: i.join(" "),
|
|
1174
1175
|
children: [
|
|
1175
|
-
/* @__PURE__ */ t("div", { className:
|
|
1176
|
-
/* @__PURE__ */ t("div", { className:
|
|
1177
|
-
/* @__PURE__ */ t("div", { className:
|
|
1178
|
-
/* @__PURE__ */ t("div", { className:
|
|
1176
|
+
/* @__PURE__ */ t("div", { className: J.dot }),
|
|
1177
|
+
/* @__PURE__ */ t("div", { className: J.dot }),
|
|
1178
|
+
/* @__PURE__ */ t("div", { className: J.dot }),
|
|
1179
|
+
/* @__PURE__ */ t("div", { className: J.dot })
|
|
1179
1180
|
]
|
|
1180
1181
|
});
|
|
1181
|
-
},
|
|
1182
|
-
let [
|
|
1182
|
+
}, Y = ({ children: r, beforeElement: a, afterElement: o, error: s, placeholder: c, styleContainer: u, classNameContainer: f, classNameContainerElement: m, hiddenContainer: h, formvalue: g, wait: _, withBorder: v = !1, ...y }) => {
|
|
1183
|
+
let [b, x] = p("");
|
|
1183
1184
|
return l(() => {
|
|
1184
|
-
|
|
1185
|
+
x(s ?? "");
|
|
1185
1186
|
}, [s]), /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("label", {
|
|
1186
1187
|
className: d(() => {
|
|
1187
1188
|
let e = ["ui-form-element-container"];
|
|
1188
|
-
return e.push(
|
|
1189
|
+
return e.push(q.container), b && e.push(q.error), y.disabled && e.push(q.disabled), h && e.push(q.hidden), v && e.push(q.border), f && e.push(f), e.join(" ");
|
|
1189
1190
|
}, [
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
f
|
|
1191
|
+
b,
|
|
1192
|
+
y.disabled,
|
|
1193
|
+
h,
|
|
1194
|
+
f,
|
|
1195
|
+
v
|
|
1194
1196
|
]),
|
|
1195
1197
|
style: u,
|
|
1196
1198
|
children: /* @__PURE__ */ n("div", {
|
|
1197
|
-
className: "ui-form-element " +
|
|
1199
|
+
className: "ui-form-element " + q.element + (m ? " " + m : ""),
|
|
1198
1200
|
children: [
|
|
1199
1201
|
a ? i(a, { key: "ui-before-element" }) : null,
|
|
1200
|
-
typeof r == "function" ? r(
|
|
1201
|
-
c &&
|
|
1202
|
-
className: "ui-form-element-placeholder " +
|
|
1202
|
+
typeof r == "function" ? r(y) : null,
|
|
1203
|
+
c && _ ? "" : /* @__PURE__ */ t("span", {
|
|
1204
|
+
className: "ui-form-element-placeholder " + q.placeholder,
|
|
1203
1205
|
children: c
|
|
1204
1206
|
}),
|
|
1205
|
-
|
|
1207
|
+
_ && /* @__PURE__ */ t(rt, {}),
|
|
1206
1208
|
o ? i(o, { key: "ui-after-element" }) : null
|
|
1207
1209
|
]
|
|
1208
1210
|
})
|
|
1209
|
-
}),
|
|
1210
|
-
className: "ui-form-error " +
|
|
1211
|
-
children:
|
|
1211
|
+
}), b && /* @__PURE__ */ t("div", {
|
|
1212
|
+
className: "ui-form-error " + q.error,
|
|
1213
|
+
children: b
|
|
1212
1214
|
})] });
|
|
1213
|
-
},
|
|
1215
|
+
}, it = y, at = {
|
|
1216
|
+
container: "styles-module__container__-32s9",
|
|
1217
|
+
placeholder: "styles-module__placeholder__HQctl"
|
|
1218
|
+
}, ot = o(({ onChange: e, onInput: n, onChangeText: r, wait: i, disabled: a, formvalue: o, children: s, ...c }, u) => {
|
|
1214
1219
|
let [d, f] = p(""), m = (t) => {
|
|
1215
1220
|
typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
|
|
1216
1221
|
}, h = (e) => {
|
|
@@ -1219,9 +1224,11 @@ var tt = () => {
|
|
|
1219
1224
|
return l(() => {
|
|
1220
1225
|
let e = c.value ?? o;
|
|
1221
1226
|
f(e ? String(e) : "");
|
|
1222
|
-
}, [c.value, o]), /* @__PURE__ */ t(
|
|
1227
|
+
}, [c.value, o]), /* @__PURE__ */ t(Y, {
|
|
1223
1228
|
...c,
|
|
1224
1229
|
wait: i,
|
|
1230
|
+
classNameContainerElement: at.container,
|
|
1231
|
+
withBorder: !0,
|
|
1225
1232
|
children: (e) => /* @__PURE__ */ t("input", {
|
|
1226
1233
|
...e,
|
|
1227
1234
|
placeholder: "",
|
|
@@ -1232,7 +1239,7 @@ var tt = () => {
|
|
|
1232
1239
|
ref: u
|
|
1233
1240
|
})
|
|
1234
1241
|
});
|
|
1235
|
-
}),
|
|
1242
|
+
}), st = { container: "style-module__container__iExWO" }, ct = o(({ onChange: e, onInput: n, onChangeText: r, formvalue: i, wait: a, ...o }, s) => {
|
|
1236
1243
|
let c = f(null), [d, m] = p(o.value ?? i ?? ""), h = (t) => {
|
|
1237
1244
|
typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
|
|
1238
1245
|
}, g = (e) => {
|
|
@@ -1249,9 +1256,11 @@ var tt = () => {
|
|
|
1249
1256
|
m(o.value ?? i ?? "");
|
|
1250
1257
|
}, [o.value, i]), u(s, () => c.current);
|
|
1251
1258
|
let _ = a ? "" : d;
|
|
1252
|
-
return /* @__PURE__ */ t(
|
|
1259
|
+
return /* @__PURE__ */ t(Y, {
|
|
1253
1260
|
...o,
|
|
1254
1261
|
wait: a,
|
|
1262
|
+
classNameContainerElement: st.container,
|
|
1263
|
+
withBorder: !0,
|
|
1255
1264
|
children: (e) => /* @__PURE__ */ t("textarea", {
|
|
1256
1265
|
...e,
|
|
1257
1266
|
disabled: a,
|
|
@@ -1262,18 +1271,18 @@ var tt = () => {
|
|
|
1262
1271
|
ref: c
|
|
1263
1272
|
})
|
|
1264
1273
|
});
|
|
1265
|
-
}),
|
|
1274
|
+
}), lt = {
|
|
1266
1275
|
"file-btn": "style-module__file-btn__WajPw",
|
|
1267
1276
|
icon: "style-module__icon__f1VPN"
|
|
1268
|
-
},
|
|
1277
|
+
}, ut = ({ onChange: r, onChangeFiles: i, accept: a, multiple: o, wait: c, children: l, className: u, icon: d, ...p }) => {
|
|
1269
1278
|
let m = f(null), h = `
|
|
1270
|
-
${
|
|
1271
|
-
${d && !c ?
|
|
1279
|
+
${lt["file-btn"]}
|
|
1280
|
+
${d && !c ? lt.icon : ""}
|
|
1272
1281
|
`.trim(), g = s((e) => {
|
|
1273
1282
|
let t = e.target.files;
|
|
1274
1283
|
typeof r == "function" && r(e), typeof i == "function" && i(t);
|
|
1275
1284
|
}, [r, i]);
|
|
1276
|
-
return /* @__PURE__ */ t(
|
|
1285
|
+
return /* @__PURE__ */ t(Y, {
|
|
1277
1286
|
...p,
|
|
1278
1287
|
wait: c,
|
|
1279
1288
|
children: (r) => /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("input", {
|
|
@@ -1289,7 +1298,7 @@ var tt = () => {
|
|
|
1289
1298
|
children: !c && (l || "Выбрать файл")
|
|
1290
1299
|
})] })
|
|
1291
1300
|
});
|
|
1292
|
-
},
|
|
1301
|
+
}, dt = ({ onChange: e, children: n, multiple: r, accept: i, ...a }) => {
|
|
1293
1302
|
let o = f(null), s = (t) => {
|
|
1294
1303
|
let n = t.target;
|
|
1295
1304
|
if (n.files) for (let t of n.files) {
|
|
@@ -1319,7 +1328,7 @@ var tt = () => {
|
|
|
1319
1328
|
onClick: c,
|
|
1320
1329
|
children: n
|
|
1321
1330
|
});
|
|
1322
|
-
},
|
|
1331
|
+
}, X = {
|
|
1323
1332
|
container: "style-module__container__Y4Az4",
|
|
1324
1333
|
"wait-indicator": "style-module__wait-indicator__qOZNZ",
|
|
1325
1334
|
active: "style-module__active__SLZO0",
|
|
@@ -1334,15 +1343,15 @@ var tt = () => {
|
|
|
1334
1343
|
"normal-btn": "style-module__normal-btn__qHevU",
|
|
1335
1344
|
"small-btn": "style-module__small-btn__Axtvq",
|
|
1336
1345
|
"large-btn": "style-module__large-btn__X3--3"
|
|
1337
|
-
},
|
|
1346
|
+
}, ft = ({ children: e, className: r, classNameContainer: i, styleContainer: a, wait: o = !1, variant: s, size: c = "normal", icon: l, ...u }) => {
|
|
1338
1347
|
let d = `
|
|
1339
|
-
${
|
|
1340
|
-
${s &&
|
|
1341
|
-
${c &&
|
|
1342
|
-
${l && !o ?
|
|
1348
|
+
${X.btn}
|
|
1349
|
+
${s && X[`btn-${s}`]}
|
|
1350
|
+
${c && X[`${c}-btn`]}
|
|
1351
|
+
${l && !o ? X[`icon-${l}`] : ""}
|
|
1343
1352
|
${r || ""}
|
|
1344
1353
|
`.replace(/\s+/g, " ").trim(), f = ["ui-button-container"];
|
|
1345
|
-
return f.push(
|
|
1354
|
+
return f.push(X.container), i && f.push(i), /* @__PURE__ */ n("div", {
|
|
1346
1355
|
className: f.join(" "),
|
|
1347
1356
|
style: a,
|
|
1348
1357
|
children: [/* @__PURE__ */ t("button", {
|
|
@@ -1350,17 +1359,17 @@ var tt = () => {
|
|
|
1350
1359
|
className: d,
|
|
1351
1360
|
children: !o && e
|
|
1352
1361
|
}), o && /* @__PURE__ */ t("div", {
|
|
1353
|
-
className: "ui-button-spinner " +
|
|
1354
|
-
children: /* @__PURE__ */ t(
|
|
1362
|
+
className: "ui-button-spinner " + X["wait-indicator"] + (o ? " " + X.active : ""),
|
|
1363
|
+
children: /* @__PURE__ */ t(rt, { color: s })
|
|
1355
1364
|
})]
|
|
1356
1365
|
});
|
|
1357
|
-
},
|
|
1366
|
+
}, pt = {
|
|
1358
1367
|
container: "style-module__container__Qt7Ix",
|
|
1359
1368
|
image: "style-module__image__1qdut",
|
|
1360
1369
|
new: "style-module__new__fOnXf",
|
|
1361
1370
|
close: "style-module__close__9k-p1",
|
|
1362
1371
|
wait: "style-module__wait__qnGnj"
|
|
1363
|
-
},
|
|
1372
|
+
}, mt = ({ onChange: e, onClick: r, onId: i, onRemove: a, ...o }) => {
|
|
1364
1373
|
let { base64: s, src: c } = o, [u, d] = p(!0), m = f(!1), h = f(), _ = (e) => {
|
|
1365
1374
|
h.current = e, typeof i == "function" && i(e);
|
|
1366
1375
|
};
|
|
@@ -1372,7 +1381,7 @@ var tt = () => {
|
|
|
1372
1381
|
id: h.current
|
|
1373
1382
|
});
|
|
1374
1383
|
}, []), /* @__PURE__ */ n("span", {
|
|
1375
|
-
className:
|
|
1384
|
+
className: pt.image,
|
|
1376
1385
|
onClick: () => {
|
|
1377
1386
|
typeof r == "function" && r({
|
|
1378
1387
|
...o,
|
|
@@ -1383,7 +1392,7 @@ var tt = () => {
|
|
|
1383
1392
|
},
|
|
1384
1393
|
children: [
|
|
1385
1394
|
/* @__PURE__ */ t("span", {
|
|
1386
|
-
className:
|
|
1395
|
+
className: pt.close,
|
|
1387
1396
|
onClick: (e) => {
|
|
1388
1397
|
if (!e.target) return;
|
|
1389
1398
|
let t = e.target;
|
|
@@ -1401,12 +1410,12 @@ var tt = () => {
|
|
|
1401
1410
|
}
|
|
1402
1411
|
}),
|
|
1403
1412
|
u && /* @__PURE__ */ t("span", {
|
|
1404
|
-
className:
|
|
1413
|
+
className: pt.wait,
|
|
1405
1414
|
children: /* @__PURE__ */ t(g, {})
|
|
1406
1415
|
})
|
|
1407
1416
|
]
|
|
1408
1417
|
});
|
|
1409
|
-
},
|
|
1418
|
+
}, ht = ({ imagesArray: e, onChange: r, onChangeArray: i, onClick: a }) => {
|
|
1410
1419
|
let [o, s] = p([]), c = (e) => {
|
|
1411
1420
|
s((t) => [...t, { ...e }]);
|
|
1412
1421
|
}, u = (e) => (t) => {
|
|
@@ -1417,33 +1426,33 @@ var tt = () => {
|
|
|
1417
1426
|
}, [o]), l(() => {
|
|
1418
1427
|
e && s(e);
|
|
1419
1428
|
}, [e]), /* @__PURE__ */ n("div", {
|
|
1420
|
-
className:
|
|
1421
|
-
children: [o.map((e, n) => /* @__PURE__ */ t(
|
|
1429
|
+
className: pt.container,
|
|
1430
|
+
children: [o.map((e, n) => /* @__PURE__ */ t(mt, {
|
|
1422
1431
|
...e,
|
|
1423
1432
|
onChange: r,
|
|
1424
1433
|
onClick: a,
|
|
1425
1434
|
onRemove: d(e),
|
|
1426
1435
|
onId: u(e)
|
|
1427
|
-
}, e.name + n)), /* @__PURE__ */ t(
|
|
1436
|
+
}, e.name + n)), /* @__PURE__ */ t(dt, {
|
|
1428
1437
|
onChange: c,
|
|
1429
1438
|
accept: ["image/png"],
|
|
1430
|
-
className:
|
|
1439
|
+
className: pt.new,
|
|
1431
1440
|
multiple: !0
|
|
1432
1441
|
})]
|
|
1433
1442
|
});
|
|
1434
|
-
},
|
|
1443
|
+
}, gt = {
|
|
1435
1444
|
container: "style-module__container__tUkU0",
|
|
1436
1445
|
text: "style-module__text__5dksK",
|
|
1437
1446
|
indicator: "style-module__indicator__BdmZs"
|
|
1438
|
-
},
|
|
1447
|
+
}, _t = o(({ type: e = "checkbox", hiddenContainer: r = !0, placeholder: i, onChecked: a, onChange: o, ...s }, c) => {
|
|
1439
1448
|
let l = (e) => {
|
|
1440
1449
|
typeof o == "function" && o(e), typeof a == "function" && a(e.target.checked, s.value);
|
|
1441
1450
|
};
|
|
1442
|
-
return /* @__PURE__ */ t(
|
|
1451
|
+
return /* @__PURE__ */ t(Y, {
|
|
1443
1452
|
...s,
|
|
1444
1453
|
hiddenContainer: r,
|
|
1445
1454
|
children: (r) => /* @__PURE__ */ n("div", {
|
|
1446
|
-
className: "ui-checkbox-container " +
|
|
1455
|
+
className: "ui-checkbox-container " + gt.container,
|
|
1447
1456
|
children: [
|
|
1448
1457
|
/* @__PURE__ */ t("input", {
|
|
1449
1458
|
...r,
|
|
@@ -1452,27 +1461,27 @@ var tt = () => {
|
|
|
1452
1461
|
onChange: l,
|
|
1453
1462
|
ref: c
|
|
1454
1463
|
}),
|
|
1455
|
-
/* @__PURE__ */ t("span", { className: "ui-checkbox-indicator " +
|
|
1464
|
+
/* @__PURE__ */ t("span", { className: "ui-checkbox-indicator " + gt.indicator }),
|
|
1456
1465
|
/* @__PURE__ */ t("span", {
|
|
1457
|
-
className: "ui-checkbox-text " +
|
|
1466
|
+
className: "ui-checkbox-text " + gt.text,
|
|
1458
1467
|
children: i
|
|
1459
1468
|
})
|
|
1460
1469
|
]
|
|
1461
1470
|
})
|
|
1462
1471
|
});
|
|
1463
|
-
}),
|
|
1472
|
+
}), vt = {
|
|
1464
1473
|
container: "style-module__container__nvLZo",
|
|
1465
1474
|
down: "style-module__down__0mCw1",
|
|
1466
1475
|
up: "style-module__up__4e9Cz",
|
|
1467
1476
|
left: "style-module__left__tsvvk",
|
|
1468
1477
|
right: "style-module__right__-YgfC"
|
|
1469
|
-
},
|
|
1478
|
+
}, yt = ({ className: e, direction: n = "down", ...r }) => {
|
|
1470
1479
|
let i = ["ui-component-arrow"];
|
|
1471
|
-
return i.push(
|
|
1480
|
+
return i.push(vt.container), n && i.push(vt[n]), e && i.push(e), /* @__PURE__ */ t("div", {
|
|
1472
1481
|
...r,
|
|
1473
1482
|
className: i.join(" ")
|
|
1474
1483
|
});
|
|
1475
|
-
},
|
|
1484
|
+
}, Z = {
|
|
1476
1485
|
"container-element": "style-module__container-element__bbCnL",
|
|
1477
1486
|
container: "style-module__container__P3B9C",
|
|
1478
1487
|
select: "style-module__select__BYzzT",
|
|
@@ -1488,16 +1497,16 @@ var tt = () => {
|
|
|
1488
1497
|
title: "style-module__title__x7nug",
|
|
1489
1498
|
active: "style-module__active__ORdtQ",
|
|
1490
1499
|
disabled: "style-module__disabled__xA0bc"
|
|
1491
|
-
},
|
|
1492
|
-
let r =
|
|
1493
|
-
return Array.isArray(e) ? e.map(() =>
|
|
1494
|
-
},
|
|
1500
|
+
}, bt = "ui-", Q = (e, t, n) => {
|
|
1501
|
+
let r = bt + (n ? n + "-" : "");
|
|
1502
|
+
return Array.isArray(e) ? e.map(() => Q(e, t, r)).join(" ") : `${t[e]} ${r}${e}`;
|
|
1503
|
+
}, xt = a({
|
|
1495
1504
|
selected: "",
|
|
1496
1505
|
emptyValue: { current: {} },
|
|
1497
1506
|
setSelect: (e) => {},
|
|
1498
1507
|
setSelected: (e) => {},
|
|
1499
1508
|
setTitle: (e) => {}
|
|
1500
|
-
}),
|
|
1509
|
+
}), St = o(({ children: e, onChangeSelect: r, value: i, formvalue: a, ...o }, s) => {
|
|
1501
1510
|
let c = f(null), m = f(null), h = f(!1), [g, _] = p(!1), [v, y] = p(""), [b, x] = p(), S = () => {
|
|
1502
1511
|
o.disabled || _(!0);
|
|
1503
1512
|
}, C = () => {
|
|
@@ -1519,20 +1528,21 @@ var tt = () => {
|
|
|
1519
1528
|
y(String(i ?? a));
|
|
1520
1529
|
}, [i, a]), l(() => {
|
|
1521
1530
|
let e = c.current, t = e.classList;
|
|
1522
|
-
g ? (t.remove(
|
|
1523
|
-
t.add(
|
|
1524
|
-
})) : (t.contains(
|
|
1525
|
-
t.add(
|
|
1526
|
-
}), t.remove(
|
|
1531
|
+
g ? (t.remove(Z.hidden), requestAnimationFrame(() => {
|
|
1532
|
+
t.add(Z.opened), e?.focus();
|
|
1533
|
+
})) : (t.contains(Z.opened) && (e.ontransitionend = () => {
|
|
1534
|
+
t.add(Z.hidden), e.ontransitionend = null;
|
|
1535
|
+
}), t.remove(Z.opened));
|
|
1527
1536
|
}, [g]), u(s, () => m.current, []);
|
|
1528
1537
|
let D = d(() => {
|
|
1529
|
-
let e = [
|
|
1530
|
-
return e.push(
|
|
1538
|
+
let e = [Q("container", Z, "select")];
|
|
1539
|
+
return e.push(Z.hidden), e;
|
|
1531
1540
|
}, []);
|
|
1532
|
-
return /* @__PURE__ */ t(
|
|
1541
|
+
return /* @__PURE__ */ t(Y, {
|
|
1533
1542
|
...o,
|
|
1534
|
-
classNameContainer:
|
|
1535
|
-
|
|
1543
|
+
classNameContainer: Q("container-element", Z, "select"),
|
|
1544
|
+
withBorder: !0,
|
|
1545
|
+
children: (r) => /* @__PURE__ */ n(xt.Provider, {
|
|
1536
1546
|
value: {
|
|
1537
1547
|
selected: v,
|
|
1538
1548
|
emptyValue: h,
|
|
@@ -1552,29 +1562,29 @@ var tt = () => {
|
|
|
1552
1562
|
tabIndex: 1,
|
|
1553
1563
|
onBlur: C,
|
|
1554
1564
|
children: [/* @__PURE__ */ n("div", {
|
|
1555
|
-
className:
|
|
1565
|
+
className: Z.select,
|
|
1556
1566
|
onClick: w,
|
|
1557
1567
|
children: [/* @__PURE__ */ t("span", {
|
|
1558
|
-
className:
|
|
1568
|
+
className: Q("title", Z, "select"),
|
|
1559
1569
|
children: b
|
|
1560
|
-
}), /* @__PURE__ */ t(
|
|
1570
|
+
}), /* @__PURE__ */ t(yt, { className: Q("arrow", Z, "select") })]
|
|
1561
1571
|
}), /* @__PURE__ */ t("ul", {
|
|
1562
|
-
className:
|
|
1572
|
+
className: Q("select-list", Z, "select"),
|
|
1563
1573
|
children: e
|
|
1564
1574
|
})]
|
|
1565
1575
|
})]
|
|
1566
1576
|
})
|
|
1567
1577
|
});
|
|
1568
|
-
}),
|
|
1569
|
-
let s = c(
|
|
1578
|
+
}), Ct = ({ children: e, value: n, disabled: r, hidden: i, onClick: a, ...o }) => {
|
|
1579
|
+
let s = c(xt), u = (e) => {
|
|
1570
1580
|
n === void 0 || r || (s.setSelect(n), typeof a == "function" && a(e));
|
|
1571
1581
|
};
|
|
1572
1582
|
if (l(() => {
|
|
1573
1583
|
e && (n === s.selected || !s.emptyValue.current) && (s.setTitle(e), !s.emptyValue.current && n && s.setSelected(n), s.emptyValue.current = !0);
|
|
1574
1584
|
}, [s.selected, s.emptyValue.current]), i) return null;
|
|
1575
1585
|
let f = d(() => {
|
|
1576
|
-
let e = [
|
|
1577
|
-
return e.push(
|
|
1586
|
+
let e = [Q("ui-select-option", Z, "select")];
|
|
1587
|
+
return e.push(Z.option), s.selected === n && e.push(Z.active, "active"), r && e.push(Z.disabled, "disabled"), e;
|
|
1578
1588
|
}, [s.selected, r]);
|
|
1579
1589
|
return /* @__PURE__ */ t("li", {
|
|
1580
1590
|
...o,
|
|
@@ -1582,19 +1592,19 @@ var tt = () => {
|
|
|
1582
1592
|
className: f.join(" "),
|
|
1583
1593
|
children: e
|
|
1584
1594
|
});
|
|
1585
|
-
},
|
|
1586
|
-
className:
|
|
1595
|
+
}, wt = ({ children: e, label: r }) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("ul", {
|
|
1596
|
+
className: Z.optgpoup,
|
|
1587
1597
|
children: [r && /* @__PURE__ */ t("li", {
|
|
1588
|
-
className:
|
|
1598
|
+
className: Z.label,
|
|
1589
1599
|
children: r
|
|
1590
1600
|
}), e]
|
|
1591
|
-
}) }),
|
|
1592
|
-
...o(({ ...e }, n) => /* @__PURE__ */ t(
|
|
1601
|
+
}) }), Tt = {
|
|
1602
|
+
...o(({ ...e }, n) => /* @__PURE__ */ t(St, {
|
|
1593
1603
|
...e,
|
|
1594
1604
|
ref: n
|
|
1595
1605
|
})),
|
|
1596
|
-
Option:
|
|
1597
|
-
Optgroup:
|
|
1606
|
+
Option: Ct,
|
|
1607
|
+
Optgroup: wt
|
|
1598
1608
|
}, $ = {
|
|
1599
1609
|
container: "style-module__container__3-2SP",
|
|
1600
1610
|
hide: "style-module__hide__4ywHX",
|
|
@@ -1606,7 +1616,7 @@ var tt = () => {
|
|
|
1606
1616
|
opened: "style-module__opened__GjGrB",
|
|
1607
1617
|
arrow: "style-module__arrow__SCvqs",
|
|
1608
1618
|
item: "style-module__item__v8SnZ"
|
|
1609
|
-
},
|
|
1619
|
+
}, Et = ({ items: e, isOpen: n, enableRerenderItems: r, disabled: i }) => {
|
|
1610
1620
|
let a = f(null), o = d(() => r ? n ? e : null : e, [
|
|
1611
1621
|
r,
|
|
1612
1622
|
e,
|
|
@@ -1619,7 +1629,7 @@ var tt = () => {
|
|
|
1619
1629
|
children: o,
|
|
1620
1630
|
ref: a
|
|
1621
1631
|
});
|
|
1622
|
-
},
|
|
1632
|
+
}, Dt = a({ close: () => {} }), Ot = ({ children: e, className: r, items: i, arrow: a = !0, direction: o = "down", position: s = "right", split: c = !1, disabled: u, hover: m = !1, enableRerenderItems: h = !0, onShow: g, onHide: _, ...v }) => {
|
|
1623
1633
|
let y = f(null), b = f(null), [x, S] = p(!1), C = () => {
|
|
1624
1634
|
S(!1);
|
|
1625
1635
|
}, w = () => {
|
|
@@ -1649,7 +1659,7 @@ var tt = () => {
|
|
|
1649
1659
|
o,
|
|
1650
1660
|
s
|
|
1651
1661
|
]);
|
|
1652
|
-
return /* @__PURE__ */ t(
|
|
1662
|
+
return /* @__PURE__ */ t(Dt.Provider, {
|
|
1653
1663
|
value: { close: C },
|
|
1654
1664
|
children: /* @__PURE__ */ n("div", {
|
|
1655
1665
|
...v,
|
|
@@ -1660,7 +1670,7 @@ var tt = () => {
|
|
|
1660
1670
|
tabIndex: 1,
|
|
1661
1671
|
onBlur: D,
|
|
1662
1672
|
children: [
|
|
1663
|
-
s === "left" && !u && /* @__PURE__ */ t(
|
|
1673
|
+
s === "left" && !u && /* @__PURE__ */ t(yt, {
|
|
1664
1674
|
className: $.arrow,
|
|
1665
1675
|
onClick: T
|
|
1666
1676
|
}),
|
|
@@ -1669,11 +1679,11 @@ var tt = () => {
|
|
|
1669
1679
|
className: "ui-dropdown-block" + (x ? " " + $.hide : ""),
|
|
1670
1680
|
children: e
|
|
1671
1681
|
}),
|
|
1672
|
-
s === "right" && !u && a && /* @__PURE__ */ t(
|
|
1682
|
+
s === "right" && !u && a && /* @__PURE__ */ t(yt, {
|
|
1673
1683
|
className: $.arrow,
|
|
1674
1684
|
onClick: T
|
|
1675
1685
|
}),
|
|
1676
|
-
/* @__PURE__ */ t(
|
|
1686
|
+
/* @__PURE__ */ t(Et, {
|
|
1677
1687
|
isOpen: x,
|
|
1678
1688
|
disabled: u,
|
|
1679
1689
|
enableRerenderItems: h,
|
|
@@ -1682,8 +1692,8 @@ var tt = () => {
|
|
|
1682
1692
|
]
|
|
1683
1693
|
})
|
|
1684
1694
|
});
|
|
1685
|
-
},
|
|
1686
|
-
let s = c(
|
|
1695
|
+
}, kt = ({ children: e, onClick: n, autoClose: r = !0, active: i, className: a, ...o }) => {
|
|
1696
|
+
let s = c(Dt), l = (e) => {
|
|
1687
1697
|
typeof n == "function" && n(e), r && s.close();
|
|
1688
1698
|
}, u = ["ui-dropdown-item"];
|
|
1689
1699
|
return u.push($.item), i && u.push($.active, "active"), a && u.push(a), /* @__PURE__ */ t("li", {
|
|
@@ -1692,12 +1702,12 @@ var tt = () => {
|
|
|
1692
1702
|
className: u.join(" "),
|
|
1693
1703
|
children: typeof e == "function" ? e(s) : e
|
|
1694
1704
|
});
|
|
1695
|
-
},
|
|
1696
|
-
...o(({ ...e }, n) => /* @__PURE__ */ t(
|
|
1697
|
-
Item:
|
|
1698
|
-
},
|
|
1705
|
+
}, At = {
|
|
1706
|
+
...o(({ ...e }, n) => /* @__PURE__ */ t(Ot, { ...e })),
|
|
1707
|
+
Item: kt
|
|
1708
|
+
}, jt = a({}), Mt = ({ children: e }) => /* @__PURE__ */ t(jt.Provider, {
|
|
1699
1709
|
value: {},
|
|
1700
1710
|
children: e
|
|
1701
1711
|
});
|
|
1702
1712
|
//#endregion
|
|
1703
|
-
export {
|
|
1713
|
+
export { ft as Button, _t as Checkbox, At as Dropdown, kt as DropdownItem, Y as Element, Y as FormElement, dt as File, ut as FileInput, it as Form, ot as Input, rt as Loading, v as Progress, Mt as Provider, Tt as Select, wt as SelectOptgroup, Ct as SelectOption, g as Spinner, ct as TextArea, ht as UploadImages, nt as useForm };
|