@gen-epix/ui-core-form 4.0.0 → 4.0.1
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/_chunks/Autocomplete.js.map +1 -1
- package/dist/_chunks/DatePicker.js +74 -74
- package/dist/_chunks/DatePicker.js.map +1 -1
- package/dist/_chunks/FormUtil.js +136 -141
- package/dist/_chunks/FormUtil.js.map +1 -1
- package/dist/_chunks/RichTextEditor.js +17451 -18531
- package/dist/_chunks/RichTextEditor.js.map +1 -1
- package/dist/_chunks/TransferList.js +1 -1
- package/dist/_chunks/TransferList.js.map +1 -1
- package/dist/_chunks/UploadButton.js.map +1 -1
- package/dist/_chunks/index.esm.js +236 -186
- package/dist/_chunks/index.esm.js.map +1 -1
- package/dist/_chunks/isEqual.js.map +1 -1
- package/dist/_chunks/isValid.js +1 -1
- package/dist/_chunks/isValid.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -2
- package/dist/_chunks/sv.js +15 -15
- package/dist/components/fields/CheckboxGroup/index.js +89 -89
- package/dist/components/fields/CheckboxGroup/index.js.map +1 -1
- package/dist/components/fields/DateRangePicker/index.js +193 -193
- package/dist/components/fields/DateRangePicker/index.js.map +1 -1
- package/dist/components/fields/NumberField/index.js.map +1 -1
- package/dist/components/fields/NumberRangeInput/index.js +140 -140
- package/dist/components/fields/NumberRangeInput/index.js.map +1 -1
- package/dist/components/fields/RadioGroup/index.js.map +1 -1
- package/dist/components/fields/Select/index.js.map +1 -1
- package/dist/components/fields/Switch/index.js +44 -44
- package/dist/components/fields/Switch/index.js.map +1 -1
- package/dist/components/fields/TextField/index.js.map +1 -1
- package/dist/components/fields/ToggleButtonGroup/index.js.map +1 -1
- package/dist/components/helpers/FormFieldHelperText/index.js.map +1 -1
- package/dist/components/helpers/GenericForm/index.js.map +1 -1
- package/package.json +3 -3
- /package/dist/@types/{ui-form.d.ts → ui-core-form.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e } from "../../../_chunks/rolldown-runtime.js";
|
|
2
2
|
import { a as t, n, o as r, r as i, s as a, t as o } from "../../../_chunks/isValid.js";
|
|
3
|
-
import {
|
|
3
|
+
import { _ as s, a as c, c as l, g as u, h as d, i as f, l as p, n as m, o as h, r as g, s as _, t as v, u as y, v as b } from "../../../_chunks/FormUtil.js";
|
|
4
4
|
import { a as x, i as S, t as C } from "../../../_chunks/index.esm.js";
|
|
5
5
|
import { FormFieldHelperText as ee } from "../../helpers/FormFieldHelperText/index.js";
|
|
6
6
|
import { FormFieldLoadingIndicator as te } from "../../helpers/FormFieldLoadingIndicator/index.js";
|
|
@@ -14,16 +14,16 @@ import { Box as oe, FormControl as se, FormHelperText as ce, FormLabel as le, Ic
|
|
|
14
14
|
import fe from "@mui/icons-material/Clear";
|
|
15
15
|
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
16
16
|
import { TestIdUtil as j } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
17
|
-
import { DatePicker as
|
|
18
|
-
import { AdapterDateFns as
|
|
17
|
+
import { DatePicker as pe, LocalizationProvider as me } from "@mui/x-date-pickers";
|
|
18
|
+
import { AdapterDateFns as he } from "@mui/x-date-pickers/AdapterDateFns";
|
|
19
19
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addDays.js
|
|
20
|
-
function
|
|
20
|
+
function M(e, t, r) {
|
|
21
21
|
let a = n(e, r?.in);
|
|
22
22
|
return isNaN(t) ? i(r?.in || e, NaN) : (t && a.setDate(a.getDate() + t), a);
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addMonths.js
|
|
26
|
-
function
|
|
26
|
+
function N(e, t, r) {
|
|
27
27
|
let a = n(e, r?.in);
|
|
28
28
|
if (isNaN(t)) return i(r?.in || e, NaN);
|
|
29
29
|
if (!t) return a;
|
|
@@ -32,44 +32,44 @@ function P(e, t, r) {
|
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDaysInMonth.js
|
|
35
|
-
function
|
|
35
|
+
function P(e, t) {
|
|
36
36
|
let r = n(e, t?.in), a = r.getFullYear(), o = r.getMonth(), s = i(r, 0);
|
|
37
37
|
return s.setFullYear(a, o + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDefaultOptions.js
|
|
41
|
-
function
|
|
42
|
-
return Object.assign({},
|
|
41
|
+
function F() {
|
|
42
|
+
return Object.assign({}, b());
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISODay.js
|
|
46
|
-
function
|
|
46
|
+
function I(e, t) {
|
|
47
47
|
let r = n(e, t?.in).getDay();
|
|
48
48
|
return r === 0 ? 7 : r;
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/lastDayOfMonth.js
|
|
52
|
-
function
|
|
52
|
+
function ge(e, t) {
|
|
53
53
|
let r = n(e, t?.in), i = r.getMonth();
|
|
54
54
|
return r.setFullYear(r.getFullYear(), i + 1, 0), r.setHours(0, 0, 0, 0), n(r, t?.in);
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/transpose.js
|
|
58
|
-
function
|
|
59
|
-
let n =
|
|
58
|
+
function L(e, t) {
|
|
59
|
+
let n = R(t) ? new t(0) : i(t, 0);
|
|
60
60
|
return n.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), n.setHours(e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()), n;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function R(e) {
|
|
63
63
|
return typeof e == "function" && e.prototype?.constructor === e;
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/parse/_lib/Setter.js
|
|
67
|
-
var
|
|
67
|
+
var z = 10, B = class {
|
|
68
68
|
subPriority = 0;
|
|
69
69
|
validate(e, t) {
|
|
70
70
|
return !0;
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, V = class extends B {
|
|
73
73
|
constructor(e, t, n, r, i) {
|
|
74
74
|
super(), this.value = e, this.validateValue = t, this.setValue = n, this.priority = r, i && (this.subPriority = i);
|
|
75
75
|
}
|
|
@@ -79,20 +79,20 @@ var B = 10, V = class {
|
|
|
79
79
|
set(e, t, n) {
|
|
80
80
|
return this.setValue(e, t, this.value, n);
|
|
81
81
|
}
|
|
82
|
-
}, _e = class extends
|
|
83
|
-
priority =
|
|
82
|
+
}, _e = class extends B {
|
|
83
|
+
priority = z;
|
|
84
84
|
subPriority = -1;
|
|
85
85
|
constructor(e, t) {
|
|
86
86
|
super(), this.context = e || ((e) => i(t, e));
|
|
87
87
|
}
|
|
88
88
|
set(e, t) {
|
|
89
|
-
return t.timestampIsSet ? e : i(e,
|
|
89
|
+
return t.timestampIsSet ? e : i(e, L(e, this.context));
|
|
90
90
|
}
|
|
91
91
|
}, H = class {
|
|
92
92
|
run(e, t, n, r) {
|
|
93
93
|
let i = this.parse(e, t, n, r);
|
|
94
94
|
return i ? {
|
|
95
|
-
setter: new
|
|
95
|
+
setter: new V(i.value, this.validate, this.set, this.priority, this.subPriority),
|
|
96
96
|
rest: i.rest
|
|
97
97
|
} : null;
|
|
98
98
|
}
|
|
@@ -273,13 +273,13 @@ var Se = class extends H {
|
|
|
273
273
|
return t.isTwoDigitYear || t.year > 0;
|
|
274
274
|
}
|
|
275
275
|
set(e, t, n, r) {
|
|
276
|
-
let i =
|
|
276
|
+
let i = l(e, r);
|
|
277
277
|
if (n.isTwoDigitYear) {
|
|
278
278
|
let t = xe(n.year, i);
|
|
279
|
-
return e.setFullYear(t, 0, r.firstWeekContainsDate), e.setHours(0, 0, 0, 0),
|
|
279
|
+
return e.setFullYear(t, 0, r.firstWeekContainsDate), e.setHours(0, 0, 0, 0), s(e, r);
|
|
280
280
|
}
|
|
281
281
|
let a = !("era" in t) || t.era === 1 ? n.year : 1 - n.year;
|
|
282
|
-
return e.setFullYear(a, 0, r.firstWeekContainsDate), e.setHours(0, 0, 0, 0),
|
|
282
|
+
return e.setFullYear(a, 0, r.firstWeekContainsDate), e.setHours(0, 0, 0, 0), s(e, r);
|
|
283
283
|
}
|
|
284
284
|
incompatibleTokens = [
|
|
285
285
|
"y",
|
|
@@ -303,7 +303,7 @@ var Se = class extends H {
|
|
|
303
303
|
}
|
|
304
304
|
set(e, t, n) {
|
|
305
305
|
let r = i(e, 0);
|
|
306
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
306
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), u(r);
|
|
307
307
|
}
|
|
308
308
|
incompatibleTokens = [
|
|
309
309
|
"G",
|
|
@@ -573,7 +573,7 @@ var je = class extends H {
|
|
|
573
573
|
return t >= 1 && t <= 53;
|
|
574
574
|
}
|
|
575
575
|
set(e, t, n, r) {
|
|
576
|
-
return
|
|
576
|
+
return s(Ae(e, n, r), r);
|
|
577
577
|
}
|
|
578
578
|
incompatibleTokens = [
|
|
579
579
|
"y",
|
|
@@ -594,7 +594,7 @@ var je = class extends H {
|
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setISOWeek.js
|
|
596
596
|
function Me(e, t, r) {
|
|
597
|
-
let i = n(e, r?.in), a =
|
|
597
|
+
let i = n(e, r?.in), a = p(i, r) - t;
|
|
598
598
|
return i.setDate(i.getDate() - a * 7), i;
|
|
599
599
|
}
|
|
600
600
|
//#endregion
|
|
@@ -612,7 +612,7 @@ var Ne = class extends H {
|
|
|
612
612
|
return t >= 1 && t <= 53;
|
|
613
613
|
}
|
|
614
614
|
set(e, t, n) {
|
|
615
|
-
return
|
|
615
|
+
return u(Me(e, n));
|
|
616
616
|
}
|
|
617
617
|
incompatibleTokens = [
|
|
618
618
|
"y",
|
|
@@ -725,8 +725,8 @@ var Ne = class extends H {
|
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setDay.js
|
|
727
727
|
function Z(e, t, r) {
|
|
728
|
-
let i =
|
|
729
|
-
return
|
|
728
|
+
let i = b(), a = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? i.weekStartsOn ?? i.locale?.options?.weekStartsOn ?? 0, o = n(e, r?.in), s = o.getDay(), c = (t % 7 + 7) % 7, l = 7 - a;
|
|
729
|
+
return M(o, t < 0 || t > 6 ? t - (s + l) % 7 : (c + l) % 7 - (s + l) % 7, r);
|
|
730
730
|
}
|
|
731
731
|
//#endregion
|
|
732
732
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/parse/_lib/parsers/DayParser.js
|
|
@@ -931,7 +931,7 @@ var Re = class extends H {
|
|
|
931
931
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setISODay.js
|
|
932
932
|
function Ve(e, t, r) {
|
|
933
933
|
let i = n(e, r?.in);
|
|
934
|
-
return
|
|
934
|
+
return M(i, t - I(i, r), r);
|
|
935
935
|
}
|
|
936
936
|
//#endregion
|
|
937
937
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js
|
|
@@ -1267,7 +1267,7 @@ var He = class extends H {
|
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
set(e, t, n) {
|
|
1270
|
-
return t.timestampIsSet ? e : i(e, e.getTime() -
|
|
1270
|
+
return t.timestampIsSet ? e : i(e, e.getTime() - d(e) - n);
|
|
1271
1271
|
}
|
|
1272
1272
|
incompatibleTokens = [
|
|
1273
1273
|
"t",
|
|
@@ -1286,7 +1286,7 @@ var He = class extends H {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
1288
|
set(e, t, n) {
|
|
1289
|
-
return t.timestampIsSet ? e : i(e, e.getTime() -
|
|
1289
|
+
return t.timestampIsSet ? e : i(e, e.getTime() - d(e) - n);
|
|
1290
1290
|
}
|
|
1291
1291
|
incompatibleTokens = [
|
|
1292
1292
|
"t",
|
|
@@ -1345,36 +1345,36 @@ var He = class extends H {
|
|
|
1345
1345
|
T: new nt()
|
|
1346
1346
|
}, it = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, at = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ot = /^'([^]*?)'?$/, st = /''/g, ct = /\S/, lt = /[a-zA-Z]/;
|
|
1347
1347
|
function ut(e, t, r, a) {
|
|
1348
|
-
let o = () => i(a?.in || r, NaN),
|
|
1348
|
+
let o = () => i(a?.in || r, NaN), s = F(), l = a?.locale ?? s.locale ?? y, u = a?.firstWeekContainsDate ?? a?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, d = a?.weekStartsOn ?? a?.locale?.options?.weekStartsOn ?? s.weekStartsOn ?? s.locale?.options?.weekStartsOn ?? 0;
|
|
1349
1349
|
if (!t) return e ? o() : n(r, a?.in);
|
|
1350
1350
|
let p = {
|
|
1351
1351
|
firstWeekContainsDate: u,
|
|
1352
|
-
weekStartsOn:
|
|
1352
|
+
weekStartsOn: d,
|
|
1353
1353
|
locale: l
|
|
1354
|
-
},
|
|
1354
|
+
}, m = [new _e(a?.in, r)], _ = t.match(at).map((e) => {
|
|
1355
1355
|
let t = e[0];
|
|
1356
|
-
if (t in
|
|
1357
|
-
let n =
|
|
1356
|
+
if (t in h) {
|
|
1357
|
+
let n = h[t];
|
|
1358
1358
|
return n(e, l.formatLong);
|
|
1359
1359
|
}
|
|
1360
1360
|
return e;
|
|
1361
|
-
}).join("").match(it),
|
|
1362
|
-
for (let n of
|
|
1363
|
-
!a?.useAdditionalWeekYearTokens &&
|
|
1361
|
+
}).join("").match(it), v = [];
|
|
1362
|
+
for (let n of _) {
|
|
1363
|
+
!a?.useAdditionalWeekYearTokens && f(n) && c(n, t, e), !a?.useAdditionalDayOfYearTokens && g(n) && c(n, t, e);
|
|
1364
1364
|
let r = n[0], i = rt[r];
|
|
1365
1365
|
if (i) {
|
|
1366
1366
|
let { incompatibleTokens: t } = i;
|
|
1367
1367
|
if (Array.isArray(t)) {
|
|
1368
|
-
let e =
|
|
1368
|
+
let e = v.find((e) => t.includes(e.token) || e.token === r);
|
|
1369
1369
|
if (e) throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`);
|
|
1370
|
-
} else if (i.incompatibleTokens === "*" &&
|
|
1371
|
-
|
|
1370
|
+
} else if (i.incompatibleTokens === "*" && v.length > 0) throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);
|
|
1371
|
+
v.push({
|
|
1372
1372
|
token: r,
|
|
1373
1373
|
fullToken: n
|
|
1374
1374
|
});
|
|
1375
1375
|
let a = i.run(e, n, l.match, p);
|
|
1376
1376
|
if (!a) return o();
|
|
1377
|
-
|
|
1377
|
+
m.push(a.setter), e = a.rest;
|
|
1378
1378
|
} else {
|
|
1379
1379
|
if (r.match(lt)) throw RangeError("Format string contains an unescaped latin alphabet character `" + r + "`");
|
|
1380
1380
|
if (n === "''" ? n = "'" : r === "'" && (n = dt(n)), e.indexOf(n) === 0) e = e.slice(n.length);
|
|
@@ -1382,7 +1382,7 @@ function ut(e, t, r, a) {
|
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
1384
|
if (e.length > 0 && ct.test(e)) return o();
|
|
1385
|
-
let b =
|
|
1385
|
+
let b = m.map((e) => e.priority).sort((e, t) => t - e).filter((e, t, n) => n.indexOf(e) === t).map((e) => m.filter((t) => t.priority === e).sort((e, t) => t.subPriority - e.subPriority)).map((e) => e[0]), x = n(r, a?.in);
|
|
1386
1386
|
if (isNaN(+x)) return o();
|
|
1387
1387
|
let S = {};
|
|
1388
1388
|
for (let e of b) {
|
|
@@ -1400,7 +1400,7 @@ function dt(e) {
|
|
|
1400
1400
|
function ft(e, t, r) {
|
|
1401
1401
|
let a = n(e, r?.in), o = a.getFullYear(), s = a.getDate(), c = i(r?.in || e, 0);
|
|
1402
1402
|
c.setFullYear(o, t, 15), c.setHours(0, 0, 0, 0);
|
|
1403
|
-
let l =
|
|
1403
|
+
let l = P(c);
|
|
1404
1404
|
return a.setMonth(t, Math.min(s, l)), a;
|
|
1405
1405
|
}
|
|
1406
1406
|
//#endregion
|
|
@@ -1412,12 +1412,12 @@ function Q(e, t, r) {
|
|
|
1412
1412
|
//#endregion
|
|
1413
1413
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/subMonths.js
|
|
1414
1414
|
function pt(e, t, n) {
|
|
1415
|
-
return
|
|
1415
|
+
return N(e, -t, n);
|
|
1416
1416
|
}
|
|
1417
1417
|
//#endregion
|
|
1418
1418
|
//#region src/components/fields/DateRangePicker/DateRangePicker.tsx
|
|
1419
1419
|
var $ = /* @__PURE__ */ e(w(), 1), mt = /* @__PURE__ */ e(T(), 1), ht = ({ dateFormat: e = E.DATE, disabled: t = !1, infoMessage: n, label: r, loading: i = !1, maxDate: a, minDate: s, name: c, onChange: l, required: u = !1, warningMessage: d }) => {
|
|
1420
|
-
let { control: f, formState: { errors:
|
|
1420
|
+
let { control: f, formState: { errors: p } } = S(), h = v.getFieldErrorMessage(p, c), g = !!h, _ = !!d && !g, b = ie(null), w = ie(null), T = de(), M = re(), { t: N } = ae(), P = O(() => pt(/* @__PURE__ */ new Date(), 3), []), F = O(() => {
|
|
1421
1421
|
switch (e) {
|
|
1422
1422
|
case E.DATE:
|
|
1423
1423
|
case E.DATE_TIME: return;
|
|
@@ -1425,7 +1425,7 @@ var $ = /* @__PURE__ */ e(w(), 1), mt = /* @__PURE__ */ e(T(), 1), ht = ({ dateF
|
|
|
1425
1425
|
case E.YEAR_MONTH: return ["year", "month"];
|
|
1426
1426
|
default: throw Error(`Unsupported date format: ${e}`);
|
|
1427
1427
|
}
|
|
1428
|
-
}, [e]),
|
|
1428
|
+
}, [e]), I = D((t) => {
|
|
1429
1429
|
let n = [null, null];
|
|
1430
1430
|
switch (e) {
|
|
1431
1431
|
case E.DATE:
|
|
@@ -1474,7 +1474,7 @@ var $ = /* @__PURE__ */ e(w(), 1), mt = /* @__PURE__ */ e(T(), 1), ht = ({ dateF
|
|
|
1474
1474
|
milliseconds: 0,
|
|
1475
1475
|
minutes: 0,
|
|
1476
1476
|
seconds: 0
|
|
1477
|
-
}) : null, n[1] = t[1] ? Q(
|
|
1477
|
+
}) : null, n[1] = t[1] ? Q(ge(t[1]), {
|
|
1478
1478
|
hours: 23,
|
|
1479
1479
|
milliseconds: 999,
|
|
1480
1480
|
minutes: 59,
|
|
@@ -1484,17 +1484,154 @@ var $ = /* @__PURE__ */ e(w(), 1), mt = /* @__PURE__ */ e(T(), 1), ht = ({ dateF
|
|
|
1484
1484
|
default: throw Error(`Unsupported date format: ${e}`);
|
|
1485
1485
|
}
|
|
1486
1486
|
return n;
|
|
1487
|
-
}, [e]),
|
|
1488
|
-
...
|
|
1487
|
+
}, [e]), L = D((t) => t ? e === E.YEAR_MONTH ? ut(t, "MMMM yyyy", /* @__PURE__ */ new Date()) : m(t) : null, [e]), R = O(() => ({
|
|
1488
|
+
...y,
|
|
1489
1489
|
formatLong: ne.formatLong
|
|
1490
|
-
}), []),
|
|
1490
|
+
}), []), z = x({
|
|
1491
1491
|
control: f,
|
|
1492
1492
|
name: c
|
|
1493
|
-
}),
|
|
1494
|
-
let n =
|
|
1495
|
-
(0, mt.default)(n,
|
|
1493
|
+
}), B = D((e, t) => {
|
|
1494
|
+
let n = I(t);
|
|
1495
|
+
(0, mt.default)(n, z) || (e(n), l && l(n));
|
|
1496
1496
|
}, [
|
|
1497
1497
|
l,
|
|
1498
|
+
z,
|
|
1499
|
+
I
|
|
1500
|
+
]), V = D(({ field: { onBlur: e, onChange: l, ref: f, value: p } }) => {
|
|
1501
|
+
f({ focus: () => {
|
|
1502
|
+
b?.current?.focus();
|
|
1503
|
+
} });
|
|
1504
|
+
let m = p[0], v = p[1], y = (e) => {
|
|
1505
|
+
B(l, [e, v]);
|
|
1506
|
+
}, x = (e) => {
|
|
1507
|
+
B(l, [m, e]);
|
|
1508
|
+
}, S = () => {
|
|
1509
|
+
let t = L(b.current.value);
|
|
1510
|
+
o(t) ? t < s ? B(l, [s, v]) : t > a ? B(l, [a, a]) : v && t > v ? B(l, [v, t]) : B(l, [t, v]) : B(l, [null, v]), e();
|
|
1511
|
+
}, C = () => {
|
|
1512
|
+
let t = L(w.current.value);
|
|
1513
|
+
o(t) ? t > a ? B(l, [m, a]) : t < s ? B(l, [s, s]) : m && t < m ? B(l, [t, m]) : B(l, [m, t]) : B(l, [m, null]), e();
|
|
1514
|
+
}, ne = () => {
|
|
1515
|
+
l([null, null]);
|
|
1516
|
+
};
|
|
1517
|
+
return /* @__PURE__ */ A(se, {
|
|
1518
|
+
component: "fieldset",
|
|
1519
|
+
error: g,
|
|
1520
|
+
...j.createAttributes("DateRangePicker", {
|
|
1521
|
+
label: r,
|
|
1522
|
+
name: c
|
|
1523
|
+
}),
|
|
1524
|
+
fullWidth: !0,
|
|
1525
|
+
sx: {
|
|
1526
|
+
"&:hover legend button, &:focus-within legend button": { display: "initial" },
|
|
1527
|
+
"legend button": { display: "none" }
|
|
1528
|
+
},
|
|
1529
|
+
children: [
|
|
1530
|
+
/* @__PURE__ */ A(le, {
|
|
1531
|
+
component: "legend",
|
|
1532
|
+
disabled: t || i,
|
|
1533
|
+
id: M,
|
|
1534
|
+
required: u,
|
|
1535
|
+
children: [r, !t && /* @__PURE__ */ k(ue, {
|
|
1536
|
+
...j.createAttributes("DateRangePicker-reset"),
|
|
1537
|
+
"aria-label": N`Clear date range`,
|
|
1538
|
+
onClick: ne,
|
|
1539
|
+
sx: {
|
|
1540
|
+
"& svg": { fontSize: "16px" },
|
|
1541
|
+
position: "absolute",
|
|
1542
|
+
top: "-10px"
|
|
1543
|
+
},
|
|
1544
|
+
tabIndex: -1,
|
|
1545
|
+
children: /* @__PURE__ */ k(fe, {})
|
|
1546
|
+
})]
|
|
1547
|
+
}),
|
|
1548
|
+
/* @__PURE__ */ k(me, {
|
|
1549
|
+
adapterLocale: R,
|
|
1550
|
+
dateAdapter: he,
|
|
1551
|
+
children: /* @__PURE__ */ A(oe, {
|
|
1552
|
+
sx: {
|
|
1553
|
+
display: "grid",
|
|
1554
|
+
gap: T.spacing(1),
|
|
1555
|
+
gridTemplateColumns: "1fr 1fr"
|
|
1556
|
+
},
|
|
1557
|
+
children: [/* @__PURE__ */ k(pe, {
|
|
1558
|
+
disabled: t || i,
|
|
1559
|
+
disableFuture: !0,
|
|
1560
|
+
inputRef: b,
|
|
1561
|
+
label: N`From`,
|
|
1562
|
+
loading: i,
|
|
1563
|
+
maxDate: v ? new Date(Math.min.apply(null, [a, v])) : a,
|
|
1564
|
+
minDate: s,
|
|
1565
|
+
onChange: y,
|
|
1566
|
+
referenceDate: P,
|
|
1567
|
+
slotProps: { textField: {
|
|
1568
|
+
className: (0, $.default)({ "Mui-warning": _ }),
|
|
1569
|
+
error: g,
|
|
1570
|
+
onBlur: S,
|
|
1571
|
+
slotProps: { inputLabel: {
|
|
1572
|
+
...j.createAttributes("DateRangePicker-from-input"),
|
|
1573
|
+
required: u
|
|
1574
|
+
} },
|
|
1575
|
+
variant: "outlined"
|
|
1576
|
+
} },
|
|
1577
|
+
value: m ?? null,
|
|
1578
|
+
views: F
|
|
1579
|
+
}), /* @__PURE__ */ k(pe, {
|
|
1580
|
+
disabled: t || i,
|
|
1581
|
+
disableFuture: !0,
|
|
1582
|
+
inputRef: w,
|
|
1583
|
+
label: N`To`,
|
|
1584
|
+
loading: i,
|
|
1585
|
+
maxDate: a,
|
|
1586
|
+
minDate: m ? new Date(Math.max.apply(null, [s, m])) : s,
|
|
1587
|
+
onChange: x,
|
|
1588
|
+
referenceDate: a,
|
|
1589
|
+
slotProps: { textField: {
|
|
1590
|
+
className: (0, $.default)({ "Mui-warning": _ }),
|
|
1591
|
+
error: g,
|
|
1592
|
+
onBlur: C,
|
|
1593
|
+
slotProps: { inputLabel: {
|
|
1594
|
+
...j.createAttributes("DateRangePicker-to-input"),
|
|
1595
|
+
required: u
|
|
1596
|
+
} },
|
|
1597
|
+
variant: "outlined"
|
|
1598
|
+
} },
|
|
1599
|
+
value: v ?? null,
|
|
1600
|
+
views: F
|
|
1601
|
+
})]
|
|
1602
|
+
})
|
|
1603
|
+
}),
|
|
1604
|
+
!!i && /* @__PURE__ */ k(te, {}),
|
|
1605
|
+
/* @__PURE__ */ k(ce, {
|
|
1606
|
+
sx: { ml: 0 },
|
|
1607
|
+
children: /* @__PURE__ */ k(ee, {
|
|
1608
|
+
errorMessage: h,
|
|
1609
|
+
infoMessage: n,
|
|
1610
|
+
noIndent: !0,
|
|
1611
|
+
warningMessage: d
|
|
1612
|
+
})
|
|
1613
|
+
})
|
|
1614
|
+
]
|
|
1615
|
+
});
|
|
1616
|
+
}, [
|
|
1617
|
+
g,
|
|
1618
|
+
n,
|
|
1619
|
+
r,
|
|
1620
|
+
c,
|
|
1621
|
+
t,
|
|
1622
|
+
i,
|
|
1623
|
+
M,
|
|
1624
|
+
u,
|
|
1625
|
+
R,
|
|
1626
|
+
T,
|
|
1627
|
+
N,
|
|
1628
|
+
a,
|
|
1629
|
+
s,
|
|
1630
|
+
P,
|
|
1631
|
+
_,
|
|
1632
|
+
F,
|
|
1633
|
+
h,
|
|
1634
|
+
d,
|
|
1498
1635
|
B,
|
|
1499
1636
|
L
|
|
1500
1637
|
]);
|
|
@@ -1502,144 +1639,7 @@ var $ = /* @__PURE__ */ e(w(), 1), mt = /* @__PURE__ */ e(T(), 1), ht = ({ dateF
|
|
|
1502
1639
|
control: f,
|
|
1503
1640
|
defaultValue: "",
|
|
1504
1641
|
name: c,
|
|
1505
|
-
render:
|
|
1506
|
-
f({ focus: () => {
|
|
1507
|
-
b?.current?.focus();
|
|
1508
|
-
} });
|
|
1509
|
-
let m = p[0], h = p[1], v = (e) => {
|
|
1510
|
-
V(l, [e, h]);
|
|
1511
|
-
}, x = (e) => {
|
|
1512
|
-
V(l, [m, e]);
|
|
1513
|
-
}, S = () => {
|
|
1514
|
-
let t = R(b.current.value);
|
|
1515
|
-
o(t) ? t < s ? V(l, [s, h]) : t > a ? V(l, [a, a]) : h && t > h ? V(l, [h, t]) : V(l, [t, h]) : V(l, [null, h]), e();
|
|
1516
|
-
}, C = () => {
|
|
1517
|
-
let t = R(w.current.value);
|
|
1518
|
-
o(t) ? t > a ? V(l, [m, a]) : t < s ? V(l, [s, s]) : m && t < m ? V(l, [t, m]) : V(l, [m, t]) : V(l, [m, null]), e();
|
|
1519
|
-
}, ne = () => {
|
|
1520
|
-
l([null, null]);
|
|
1521
|
-
};
|
|
1522
|
-
return /* @__PURE__ */ A(se, {
|
|
1523
|
-
component: "fieldset",
|
|
1524
|
-
error: _,
|
|
1525
|
-
...j.createAttributes("DateRangePicker", {
|
|
1526
|
-
label: r,
|
|
1527
|
-
name: c
|
|
1528
|
-
}),
|
|
1529
|
-
fullWidth: !0,
|
|
1530
|
-
sx: {
|
|
1531
|
-
"&:hover legend button, &:focus-within legend button": { display: "initial" },
|
|
1532
|
-
"legend button": { display: "none" }
|
|
1533
|
-
},
|
|
1534
|
-
children: [
|
|
1535
|
-
/* @__PURE__ */ A(le, {
|
|
1536
|
-
component: "legend",
|
|
1537
|
-
disabled: t || i,
|
|
1538
|
-
id: N,
|
|
1539
|
-
required: u,
|
|
1540
|
-
children: [r, !t && /* @__PURE__ */ k(ue, {
|
|
1541
|
-
...j.createAttributes("DateRangePicker-reset"),
|
|
1542
|
-
"aria-label": P`Clear date range`,
|
|
1543
|
-
onClick: ne,
|
|
1544
|
-
sx: {
|
|
1545
|
-
"& svg": { fontSize: "16px" },
|
|
1546
|
-
position: "absolute",
|
|
1547
|
-
top: "-10px"
|
|
1548
|
-
},
|
|
1549
|
-
tabIndex: -1,
|
|
1550
|
-
children: /* @__PURE__ */ k(fe, {})
|
|
1551
|
-
})]
|
|
1552
|
-
}),
|
|
1553
|
-
/* @__PURE__ */ k(pe, {
|
|
1554
|
-
adapterLocale: z,
|
|
1555
|
-
dateAdapter: me,
|
|
1556
|
-
children: /* @__PURE__ */ A(oe, {
|
|
1557
|
-
sx: {
|
|
1558
|
-
display: "grid",
|
|
1559
|
-
gap: T.spacing(1),
|
|
1560
|
-
gridTemplateColumns: "1fr 1fr"
|
|
1561
|
-
},
|
|
1562
|
-
children: [/* @__PURE__ */ k(M, {
|
|
1563
|
-
disabled: t || i,
|
|
1564
|
-
disableFuture: !0,
|
|
1565
|
-
inputRef: b,
|
|
1566
|
-
label: P`From`,
|
|
1567
|
-
loading: i,
|
|
1568
|
-
maxDate: h ? new Date(Math.min.apply(null, [a, h])) : a,
|
|
1569
|
-
minDate: s,
|
|
1570
|
-
onChange: v,
|
|
1571
|
-
referenceDate: F,
|
|
1572
|
-
slotProps: { textField: {
|
|
1573
|
-
className: (0, $.default)({ "Mui-warning": y }),
|
|
1574
|
-
error: _,
|
|
1575
|
-
onBlur: S,
|
|
1576
|
-
slotProps: { inputLabel: {
|
|
1577
|
-
...j.createAttributes("DateRangePicker-from-input"),
|
|
1578
|
-
required: u
|
|
1579
|
-
} },
|
|
1580
|
-
variant: "outlined"
|
|
1581
|
-
} },
|
|
1582
|
-
value: m ?? null,
|
|
1583
|
-
views: I
|
|
1584
|
-
}), /* @__PURE__ */ k(M, {
|
|
1585
|
-
disabled: t || i,
|
|
1586
|
-
disableFuture: !0,
|
|
1587
|
-
inputRef: w,
|
|
1588
|
-
label: P`To`,
|
|
1589
|
-
loading: i,
|
|
1590
|
-
maxDate: a,
|
|
1591
|
-
minDate: m ? new Date(Math.max.apply(null, [s, m])) : s,
|
|
1592
|
-
onChange: x,
|
|
1593
|
-
referenceDate: a,
|
|
1594
|
-
slotProps: { textField: {
|
|
1595
|
-
className: (0, $.default)({ "Mui-warning": y }),
|
|
1596
|
-
error: _,
|
|
1597
|
-
onBlur: C,
|
|
1598
|
-
slotProps: { inputLabel: {
|
|
1599
|
-
...j.createAttributes("DateRangePicker-to-input"),
|
|
1600
|
-
required: u
|
|
1601
|
-
} },
|
|
1602
|
-
variant: "outlined"
|
|
1603
|
-
} },
|
|
1604
|
-
value: h ?? null,
|
|
1605
|
-
views: I
|
|
1606
|
-
})]
|
|
1607
|
-
})
|
|
1608
|
-
}),
|
|
1609
|
-
!!i && /* @__PURE__ */ k(te, {}),
|
|
1610
|
-
/* @__PURE__ */ k(ce, {
|
|
1611
|
-
sx: { ml: 0 },
|
|
1612
|
-
children: /* @__PURE__ */ k(ee, {
|
|
1613
|
-
errorMessage: g,
|
|
1614
|
-
infoMessage: n,
|
|
1615
|
-
noIndent: !0,
|
|
1616
|
-
warningMessage: d
|
|
1617
|
-
})
|
|
1618
|
-
})
|
|
1619
|
-
]
|
|
1620
|
-
});
|
|
1621
|
-
}, [
|
|
1622
|
-
_,
|
|
1623
|
-
n,
|
|
1624
|
-
r,
|
|
1625
|
-
c,
|
|
1626
|
-
t,
|
|
1627
|
-
i,
|
|
1628
|
-
N,
|
|
1629
|
-
u,
|
|
1630
|
-
z,
|
|
1631
|
-
T,
|
|
1632
|
-
P,
|
|
1633
|
-
a,
|
|
1634
|
-
s,
|
|
1635
|
-
F,
|
|
1636
|
-
y,
|
|
1637
|
-
I,
|
|
1638
|
-
g,
|
|
1639
|
-
d,
|
|
1640
|
-
V,
|
|
1641
|
-
R
|
|
1642
|
-
])
|
|
1642
|
+
render: V
|
|
1643
1643
|
});
|
|
1644
1644
|
};
|
|
1645
1645
|
//#endregion
|