@hybridcore/ui 1.6.12 → 1.6.13

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.
Files changed (105) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index2.css +1 -1
  3. package/dist/components/button/styled.js +1 -1
  4. package/dist/components/charts/_common/format.js +149 -41
  5. package/dist/components/charts/_common/utils.js +16 -11
  6. package/dist/components/collapsible-card/index.js +21 -30
  7. package/dist/components/collapsible-card/styled.js +16 -14
  8. package/dist/components/color-picker/index.js +2227 -3357
  9. package/dist/components/color-picker/styled.js +87 -7
  10. package/dist/components/confirm/dialog.js +89 -8
  11. package/dist/components/confirm/index.js +1 -1
  12. package/dist/components/data-map/index.js +1 -1
  13. package/dist/components/data-map/logic.js +20 -20
  14. package/dist/components/data-security-selectors/dissemination-list/index.js +32 -3117
  15. package/dist/components/date-picker-with-custom-range/index.js +86 -7
  16. package/dist/components/date-range-picker/index.js +464 -452
  17. package/dist/components/document-viewer/components/viewer/index.js +1 -1
  18. package/dist/components/duration-select/index.js +10 -10
  19. package/dist/components/duration-select/styled.js +1 -1
  20. package/dist/components/geometry-picker/coordinate/index.js +14 -14
  21. package/dist/components/geometry-picker/edit/index.js +1 -1
  22. package/dist/components/geometry-picker/geometry/index.js +1 -1
  23. package/dist/components/geometry-picker/kml/index.js +11 -11
  24. package/dist/components/geometry-picker/map/logic.js +145 -3656
  25. package/dist/components/geometry-picker/map/style.js +18 -17
  26. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +43 -1255
  27. package/dist/components/heat-map/index.js +1 -1
  28. package/dist/components/heat-map/logic.js +77 -1924
  29. package/dist/components/instance-hierarchy-table/styled.js +18 -16
  30. package/dist/components/map/helpers/mapbox.js +17 -15
  31. package/dist/components/map/helpers/ol.js +386 -27
  32. package/dist/components/map/index.js +11 -10
  33. package/dist/components/map/logic.js +22 -22
  34. package/dist/components/map/styled.js +31 -27
  35. package/dist/components/metric-card/logic.js +46 -49
  36. package/dist/components/phone-input/index.js +10 -9
  37. package/dist/components/property-mapping/index.js +1 -1
  38. package/dist/components/prr-map/index.js +1 -1
  39. package/dist/components/prr-map/logic.js +27 -26
  40. package/dist/components/range-selector/styled.js +65 -4228
  41. package/dist/components/raster-grid-map/index.js +1 -1
  42. package/dist/components/raster-grid-map/logic.js +60 -57
  43. package/dist/components/simple-pivot-table/index.js +17 -17
  44. package/dist/components/simple-pivot-table/logic.js +67 -76
  45. package/dist/components/sortable-list/index.js +1091 -1264
  46. package/dist/components/template-form/components/property-list/index.js +36 -33
  47. package/dist/components/template-form/components/property-list/property-list-columns.js +19 -18
  48. package/dist/components/template-form/components/property-list/property-list-form.js +137 -601
  49. package/dist/components/template-form/components/recognition-property-list/index.js +40 -37
  50. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +11 -10
  51. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +55 -63
  52. package/dist/components/tree-select/index.js +16 -16
  53. package/dist/index.esm-UfGMjYOL.js +197 -0
  54. package/dist/main.d.ts +54 -8
  55. package/dist/main.js +176 -175
  56. package/package.json +1 -1
  57. package/dist/AccordionSummary-CJppWeqF.js +0 -781
  58. package/dist/Add-CqcD1PWb.js +0 -403
  59. package/dist/Box-DqUMmZjL.js +0 -31
  60. package/dist/Button-C5yquWAB.js +0 -357
  61. package/dist/ButtonBase-BEF7oTOe.js +0 -887
  62. package/dist/Delete-BdyYpINH.js +0 -23
  63. package/dist/DialogContent-BvVjD9z3.js +0 -523
  64. package/dist/FormGroup-CpBsIyYR.js +0 -89
  65. package/dist/IconButton-BoGwbvrP.js +0 -184
  66. package/dist/InputLabel-Dd8RrneV.js +0 -341
  67. package/dist/MenuItem-DwqJqzuM.js +0 -233
  68. package/dist/Modal-MUZygjmQ.js +0 -1158
  69. package/dist/Paper-BkQLdsCI.js +0 -582
  70. package/dist/Select-DHUl_uG3.js +0 -3916
  71. package/dist/Source-BSZST_GH.js +0 -4410
  72. package/dist/SwitchBase-DTndTqI8.js +0 -235
  73. package/dist/Text-ChJRuaD8.js +0 -2197
  74. package/dist/TextField-e2oKaUN1.js +0 -669
  75. package/dist/TransitionGroupContext-BDAp2T0O.js +0 -96
  76. package/dist/Typography-DgsSLCFC.js +0 -178
  77. package/dist/Vector-BmuhQO4p.js +0 -3606
  78. package/dist/Vector-DfTqQEln.js +0 -1735
  79. package/dist/WKT-2wsDT-nq.js +0 -2310
  80. package/dist/assertThisInitialized-C1dAyb4j.js +0 -7
  81. package/dist/assets/index3.css +0 -1
  82. package/dist/assets/index4.css +0 -1
  83. package/dist/clsx-OuTLNxxd.js +0 -16
  84. package/dist/createChainedFunction-C0nujS3O.js +0 -9
  85. package/dist/createSvgIcon-Ch_cT8az.js +0 -185
  86. package/dist/createSvgIcon-DuDuASu1.js +0 -62
  87. package/dist/debounce-46wSf_lW.js +0 -15
  88. package/dist/dialog-BYRnCztH.js +0 -154
  89. package/dist/formControlState-vgaj2ksH.js +0 -10
  90. package/dist/generateUtilityClasses-C3ivN9Ie.js +0 -2973
  91. package/dist/index-DH6qsPBn.js +0 -153
  92. package/dist/index-e9xTIYWt.js +0 -1934
  93. package/dist/index.esm-BLLrbTzY.js +0 -318
  94. package/dist/math-Bvt2Ubuz.js +0 -704
  95. package/dist/objectWithoutPropertiesLoose-DJteAcBH.js +0 -22
  96. package/dist/ol-yOE-NV0X.js +0 -7465
  97. package/dist/ownerWindow-wg6foiOE.js +0 -10
  98. package/dist/setPrototypeOf-NPgp4cYc.js +0 -8
  99. package/dist/styled-SoqbyrkW.js +0 -350
  100. package/dist/unsupportedProp-DuqR2hj9.js +0 -36
  101. package/dist/useControlled-BYdyS7Pn.js +0 -31
  102. package/dist/useFormControl-CatNKXAi.js +0 -10
  103. package/dist/useId-BW-oWmul.js +0 -19
  104. package/dist/useMobilePicker-CY8ndYRL.js +0 -8279
  105. package/dist/useSlot-B_Q4vnX5.js +0 -42
@@ -1,1934 +0,0 @@
1
- import { jsx as M, jsxs as E } from "react/jsx-runtime";
2
- import { ToggleButton as me, Box as ye, Typography as be } from "@mui/material";
3
- import { LocalizationProvider as Ie } from "@mui/x-date-pickers";
4
- import { useDatePickerWithCustomRangeLogic as We } from "./components/date-picker-with-custom-range/logic.js";
5
- import { DatePickerWithCustomRangeRoot as He, DatePickerWithCustomRangeToggle as Ve, PresetGrid as Be, PresetButton as Ee, CustomRow as ze } from "./components/date-picker-with-custom-range/styled.js";
6
- import { a as y, _ as H } from "./objectWithoutPropertiesLoose-DJteAcBH.js";
7
- import V from "dayjs";
8
- import { c as G, a as K } from "./_commonjsHelpers-BVfed4GL.js";
9
- import { b as Ne, g as qe, a as Ue, P as Ze, u as X, c as z, d as ue, i as De, e as Me, f as Qe, h as ge, j as Je, k as Ge, l as J, m as Ke, s as de, n as Xe, v as ce, r as B, C as et, o as Te, p as tt, q as ot, t as rt, D as nt } from "./useMobilePicker-CY8ndYRL.js";
10
- import * as I from "react";
11
- import { P as e } from "./index-C__OZmYy.js";
12
- import { s as Pe } from "./generateUtilityClasses-C3ivN9Ie.js";
13
- import { T as st } from "./Typography-DgsSLCFC.js";
14
- import { T as at } from "./TextField-e2oKaUN1.js";
15
- import { u as it } from "./Modal-MUZygjmQ.js";
16
- import { r as Oe } from "./Paper-BkQLdsCI.js";
17
- var xe = { exports: {} };
18
- (function(h, d) {
19
- (function(l, u) {
20
- h.exports = u();
21
- })(G, function() {
22
- var l = "week", u = "year";
23
- return function(t, o, r) {
24
- var s = o.prototype;
25
- s.week = function(n) {
26
- if (n === void 0 && (n = null), n !== null) return this.add(7 * (n - this.week()), "day");
27
- var c = this.$locale().yearStart || 1;
28
- if (this.month() === 11 && this.date() > 25) {
29
- var a = r(this).startOf(u).add(1, u).date(c), b = r(this).endOf(l);
30
- if (a.isBefore(b)) return 1;
31
- }
32
- var D = r(this).startOf(u).date(c).startOf(l).subtract(1, "millisecond"), O = this.diff(D, l, !0);
33
- return O < 0 ? r(this).startOf("week").week() : Math.ceil(O);
34
- }, s.weeks = function(n) {
35
- return n === void 0 && (n = null), this.week(n);
36
- };
37
- };
38
- });
39
- })(xe);
40
- var lt = xe.exports;
41
- const ut = /* @__PURE__ */ K(lt);
42
- var ve = { exports: {} };
43
- (function(h, d) {
44
- (function(l, u) {
45
- h.exports = u();
46
- })(G, function() {
47
- var l = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, u = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, t = /\d/, o = /\d\d/, r = /\d\d?/, s = /\d*[^-_:/,()\s\d]+/, n = {}, c = function(i) {
48
- return (i = +i) + (i > 68 ? 1900 : 2e3);
49
- }, a = function(i) {
50
- return function(f) {
51
- this[i] = +f;
52
- };
53
- }, b = [/[+-]\d\d:?(\d\d)?|Z/, function(i) {
54
- (this.zone || (this.zone = {})).offset = function(f) {
55
- if (!f || f === "Z") return 0;
56
- var p = f.match(/([+-]|\d\d)/g), m = 60 * p[1] + (+p[2] || 0);
57
- return m === 0 ? 0 : p[0] === "+" ? -m : m;
58
- }(i);
59
- }], D = function(i) {
60
- var f = n[i];
61
- return f && (f.indexOf ? f : f.s.concat(f.f));
62
- }, O = function(i, f) {
63
- var p, m = n.meridiem;
64
- if (m) {
65
- for (var g = 1; g <= 24; g += 1) if (i.indexOf(m(g, 0, f)) > -1) {
66
- p = g > 12;
67
- break;
68
- }
69
- } else p = i === (f ? "pm" : "PM");
70
- return p;
71
- }, Y = { A: [s, function(i) {
72
- this.afternoon = O(i, !1);
73
- }], a: [s, function(i) {
74
- this.afternoon = O(i, !0);
75
- }], Q: [t, function(i) {
76
- this.month = 3 * (i - 1) + 1;
77
- }], S: [t, function(i) {
78
- this.milliseconds = 100 * +i;
79
- }], SS: [o, function(i) {
80
- this.milliseconds = 10 * +i;
81
- }], SSS: [/\d{3}/, function(i) {
82
- this.milliseconds = +i;
83
- }], s: [r, a("seconds")], ss: [r, a("seconds")], m: [r, a("minutes")], mm: [r, a("minutes")], H: [r, a("hours")], h: [r, a("hours")], HH: [r, a("hours")], hh: [r, a("hours")], D: [r, a("day")], DD: [o, a("day")], Do: [s, function(i) {
84
- var f = n.ordinal, p = i.match(/\d+/);
85
- if (this.day = p[0], f) for (var m = 1; m <= 31; m += 1) f(m).replace(/\[|\]/g, "") === i && (this.day = m);
86
- }], w: [r, a("week")], ww: [o, a("week")], M: [r, a("month")], MM: [o, a("month")], MMM: [s, function(i) {
87
- var f = D("months"), p = (D("monthsShort") || f.map(function(m) {
88
- return m.slice(0, 3);
89
- })).indexOf(i) + 1;
90
- if (p < 1) throw new Error();
91
- this.month = p % 12 || p;
92
- }], MMMM: [s, function(i) {
93
- var f = D("months").indexOf(i) + 1;
94
- if (f < 1) throw new Error();
95
- this.month = f % 12 || f;
96
- }], Y: [/[+-]?\d+/, a("year")], YY: [o, function(i) {
97
- this.year = c(i);
98
- }], YYYY: [/\d{4}/, a("year")], Z: b, ZZ: b };
99
- function v(i) {
100
- var f, p;
101
- f = i, p = n && n.formats;
102
- for (var m = (i = f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(A, S, k) {
103
- var w = k && k.toUpperCase();
104
- return S || p[k] || l[k] || p[w].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(C, R, _) {
105
- return R || _.slice(1);
106
- });
107
- })).match(u), g = m.length, T = 0; T < g; T += 1) {
108
- var j = m[T], L = Y[j], P = L && L[0], F = L && L[1];
109
- m[T] = F ? { regex: P, parser: F } : j.replace(/^\[|\]$/g, "");
110
- }
111
- return function(A) {
112
- for (var S = {}, k = 0, w = 0; k < g; k += 1) {
113
- var C = m[k];
114
- if (typeof C == "string") w += C.length;
115
- else {
116
- var R = C.regex, _ = C.parser, N = A.slice(w), W = R.exec(N)[0];
117
- _.call(S, W), A = A.replace(W, "");
118
- }
119
- }
120
- return function($) {
121
- var q = $.afternoon;
122
- if (q !== void 0) {
123
- var x = $.hours;
124
- q ? x < 12 && ($.hours += 12) : x === 12 && ($.hours = 0), delete $.afternoon;
125
- }
126
- }(S), S;
127
- };
128
- }
129
- return function(i, f, p) {
130
- p.p.customParseFormat = !0, i && i.parseTwoDigitYear && (c = i.parseTwoDigitYear);
131
- var m = f.prototype, g = m.parse;
132
- m.parse = function(T) {
133
- var j = T.date, L = T.utc, P = T.args;
134
- this.$u = L;
135
- var F = P[1];
136
- if (typeof F == "string") {
137
- var A = P[2] === !0, S = P[3] === !0, k = A || S, w = P[2];
138
- S && (w = P[2]), n = this.$locale(), !A && w && (n = p.Ls[w]), this.$d = function(N, W, $, q) {
139
- try {
140
- if (["x", "X"].indexOf(W) > -1) return new Date((W === "X" ? 1e3 : 1) * N);
141
- var x = v(W)(N), ee = x.year, U = x.month, Re = x.day, je = x.hours, Ae = x.minutes, _e = x.seconds, $e = x.milliseconds, fe = x.zone, pe = x.week, te = /* @__PURE__ */ new Date(), oe = Re || (ee || U ? 1 : te.getDate()), re = ee || te.getFullYear(), Z = 0;
142
- ee && !U || (Z = U > 0 ? U - 1 : te.getMonth());
143
- var Q, ne = je || 0, se = Ae || 0, ae = _e || 0, ie = $e || 0;
144
- return fe ? new Date(Date.UTC(re, Z, oe, ne, se, ae, ie + 60 * fe.offset * 1e3)) : $ ? new Date(Date.UTC(re, Z, oe, ne, se, ae, ie)) : (Q = new Date(re, Z, oe, ne, se, ae, ie), pe && (Q = q(Q).week(pe).toDate()), Q);
145
- } catch {
146
- return /* @__PURE__ */ new Date("");
147
- }
148
- }(j, F, L, p), this.init(), w && w !== !0 && (this.$L = this.locale(w).$L), k && j != this.format(F) && (this.$d = /* @__PURE__ */ new Date("")), n = {};
149
- } else if (F instanceof Array) for (var C = F.length, R = 1; R <= C; R += 1) {
150
- P[1] = F[R - 1];
151
- var _ = p.apply(this, P);
152
- if (_.isValid()) {
153
- this.$d = _.$d, this.$L = _.$L, this.init();
154
- break;
155
- }
156
- R === C && (this.$d = /* @__PURE__ */ new Date(""));
157
- }
158
- else g.call(this, T);
159
- };
160
- };
161
- });
162
- })(ve);
163
- var dt = ve.exports;
164
- const ct = /* @__PURE__ */ K(dt);
165
- var we = { exports: {} };
166
- (function(h, d) {
167
- (function(l, u) {
168
- h.exports = u();
169
- })(G, function() {
170
- var l = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
171
- return function(u, t, o) {
172
- var r = t.prototype, s = r.format;
173
- o.en.formats = l, r.format = function(n) {
174
- n === void 0 && (n = "YYYY-MM-DDTHH:mm:ssZ");
175
- var c = this.$locale().formats, a = function(b, D) {
176
- return b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(O, Y, v) {
177
- var i = v && v.toUpperCase();
178
- return Y || D[v] || l[v] || D[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(f, p, m) {
179
- return p || m.slice(1);
180
- });
181
- });
182
- }(n, c === void 0 ? {} : c);
183
- return s.call(this, a);
184
- };
185
- };
186
- });
187
- })(we);
188
- var ht = we.exports;
189
- const ft = /* @__PURE__ */ K(ht);
190
- var ke = { exports: {} };
191
- (function(h, d) {
192
- (function(l, u) {
193
- h.exports = u();
194
- })(G, function() {
195
- return function(l, u, t) {
196
- u.prototype.isBetween = function(o, r, s, n) {
197
- var c = t(o), a = t(r), b = (n = n || "()")[0] === "(", D = n[1] === ")";
198
- return (b ? this.isAfter(c, s) : !this.isBefore(c, s)) && (D ? this.isBefore(a, s) : !this.isAfter(a, s)) || (b ? this.isBefore(c, s) : !this.isAfter(c, s)) && (D ? this.isAfter(a, s) : !this.isBefore(a, s));
199
- };
200
- };
201
- });
202
- })(ke);
203
- var pt = ke.exports;
204
- const mt = /* @__PURE__ */ K(pt);
205
- V.extend(ct);
206
- V.extend(ft);
207
- V.extend(mt);
208
- const yt = Ne(["Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale", "Or you forget to import the locale with `require('dayjs/locale/{localeUsed}')`", "fallback on English locale"]), bt = {
209
- // Year
210
- YY: "year",
211
- YYYY: {
212
- sectionType: "year",
213
- contentType: "digit",
214
- maxLength: 4
215
- },
216
- // Month
217
- M: {
218
- sectionType: "month",
219
- contentType: "digit",
220
- maxLength: 2
221
- },
222
- MM: "month",
223
- MMM: {
224
- sectionType: "month",
225
- contentType: "letter"
226
- },
227
- MMMM: {
228
- sectionType: "month",
229
- contentType: "letter"
230
- },
231
- // Day of the month
232
- D: {
233
- sectionType: "day",
234
- contentType: "digit",
235
- maxLength: 2
236
- },
237
- DD: "day",
238
- Do: {
239
- sectionType: "day",
240
- contentType: "digit-with-letter"
241
- },
242
- // Day of the week
243
- d: {
244
- sectionType: "weekDay",
245
- contentType: "digit",
246
- maxLength: 2
247
- },
248
- dd: {
249
- sectionType: "weekDay",
250
- contentType: "letter"
251
- },
252
- ddd: {
253
- sectionType: "weekDay",
254
- contentType: "letter"
255
- },
256
- dddd: {
257
- sectionType: "weekDay",
258
- contentType: "letter"
259
- },
260
- // Meridiem
261
- A: "meridiem",
262
- a: "meridiem",
263
- // Hours
264
- H: {
265
- sectionType: "hours",
266
- contentType: "digit",
267
- maxLength: 2
268
- },
269
- HH: "hours",
270
- h: {
271
- sectionType: "hours",
272
- contentType: "digit",
273
- maxLength: 2
274
- },
275
- hh: "hours",
276
- // Minutes
277
- m: {
278
- sectionType: "minutes",
279
- contentType: "digit",
280
- maxLength: 2
281
- },
282
- mm: "minutes",
283
- // Seconds
284
- s: {
285
- sectionType: "seconds",
286
- contentType: "digit",
287
- maxLength: 2
288
- },
289
- ss: "seconds"
290
- }, Dt = {
291
- normalDateWithWeekday: "ddd, MMM D",
292
- normalDate: "D MMMM",
293
- shortDate: "MMM D",
294
- monthAndDate: "MMMM D",
295
- dayOfMonth: "D",
296
- year: "YYYY",
297
- month: "MMMM",
298
- monthShort: "MMM",
299
- monthAndYear: "MMMM YYYY",
300
- weekday: "dddd",
301
- weekdayShort: "ddd",
302
- minutes: "mm",
303
- hours12h: "hh",
304
- hours24h: "HH",
305
- seconds: "ss",
306
- fullTime: "LT",
307
- fullTime12h: "hh:mm A",
308
- fullTime24h: "HH:mm",
309
- fullDate: "ll",
310
- fullDateWithWeekday: "dddd, LL",
311
- fullDateTime: "lll",
312
- fullDateTime12h: "ll hh:mm A",
313
- fullDateTime24h: "ll HH:mm",
314
- keyboardDate: "L",
315
- keyboardDateTime: "L LT",
316
- keyboardDateTime12h: "L hh:mm A",
317
- keyboardDateTime24h: "L HH:mm"
318
- }, Mt = (h, d) => d ? (...l) => h(...l).locale(d) : h;
319
- class gt {
320
- constructor({
321
- locale: d,
322
- formats: l,
323
- instance: u
324
- } = {}) {
325
- this.isMUIAdapter = !0, this.lib = "dayjs", this.rawDayJsInstance = void 0, this.dayjs = void 0, this.locale = void 0, this.formats = void 0, this.escapedCharacters = {
326
- start: "[",
327
- end: "]"
328
- }, this.formatTokenMap = bt, this.getLocaleFormats = () => {
329
- var t;
330
- const o = (t = this.rawDayJsInstance.Ls) != null ? t : V.Ls, r = this.locale || "en";
331
- let s = o[r];
332
- return s === void 0 && (yt(), s = o.en), s.formats;
333
- }, this.date = (t) => t === null ? null : this.dayjs(t), this.toJsDate = (t) => t.toDate(), this.parseISO = (t) => this.dayjs(t), this.toISO = (t) => t.toISOString(), this.parse = (t, o) => t === "" ? null : this.dayjs(t, o, this.locale, !0), this.getCurrentLocaleCode = () => this.locale || "en", this.is12HourCycleInCurrentLocale = () => /A|a/.test(this.getLocaleFormats().LT || ""), this.expandFormat = (t) => {
334
- const o = this.getLocaleFormats(), r = (s) => s.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (n, c, a) => c || a.slice(1));
335
- return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (s, n, c) => {
336
- const a = c && c.toUpperCase();
337
- return n || o[c] || r(o[a]);
338
- });
339
- }, this.getFormatHelperText = (t) => this.expandFormat(t).replace(/a/gi, "(a|p)m").toLocaleLowerCase(), this.isNull = (t) => t === null, this.isValid = (t) => this.dayjs(t).isValid(), this.format = (t, o) => this.formatByString(t, this.formats[o]), this.formatByString = (t, o) => this.dayjs(t).format(o), this.formatNumber = (t) => t, this.getDiff = (t, o, r) => t.diff(o, r), this.isEqual = (t, o) => t === null && o === null ? !0 : this.dayjs(t).isSame(o), this.isSameYear = (t, o) => t.isSame(o, "year"), this.isSameMonth = (t, o) => t.isSame(o, "month"), this.isSameDay = (t, o) => t.isSame(o, "day"), this.isSameHour = (t, o) => t.isSame(o, "hour"), this.isAfter = (t, o) => t.isAfter(o), this.isAfterYear = (t, o) => t.isAfter(o, "year"), this.isAfterDay = (t, o) => t.isAfter(o, "day"), this.isBefore = (t, o) => t.isBefore(o), this.isBeforeYear = (t, o) => t.isBefore(o, "year"), this.isBeforeDay = (t, o) => t.isBefore(o, "day"), this.isWithinRange = (t, [o, r]) => t.isBetween(o, r, null, "[]"), this.startOfYear = (t) => t.startOf("year"), this.startOfMonth = (t) => t.startOf("month"), this.startOfWeek = (t) => t.startOf("week"), this.startOfDay = (t) => t.startOf("day"), this.endOfYear = (t) => t.endOf("year"), this.endOfMonth = (t) => t.endOf("month"), this.endOfWeek = (t) => t.endOf("week"), this.endOfDay = (t) => t.endOf("day"), this.addYears = (t, o) => o < 0 ? t.subtract(Math.abs(o), "year") : t.add(o, "year"), this.addMonths = (t, o) => o < 0 ? t.subtract(Math.abs(o), "month") : t.add(o, "month"), this.addWeeks = (t, o) => o < 0 ? t.subtract(Math.abs(o), "week") : t.add(o, "week"), this.addDays = (t, o) => o < 0 ? t.subtract(Math.abs(o), "day") : t.add(o, "day"), this.addHours = (t, o) => o < 0 ? t.subtract(Math.abs(o), "hour") : t.add(o, "hour"), this.addMinutes = (t, o) => o < 0 ? t.subtract(Math.abs(o), "minute") : t.add(o, "minute"), this.addSeconds = (t, o) => o < 0 ? t.subtract(Math.abs(o), "second") : t.add(o, "second"), this.getYear = (t) => t.year(), this.getMonth = (t) => t.month(), this.getDate = (t) => t.date(), this.getHours = (t) => t.hour(), this.getMinutes = (t) => t.minute(), this.getSeconds = (t) => t.second(), this.setYear = (t, o) => t.set("year", o), this.setMonth = (t, o) => t.set("month", o), this.setDate = (t, o) => t.set("date", o), this.setHours = (t, o) => t.set("hour", o), this.setMinutes = (t, o) => t.set("minute", o), this.setSeconds = (t, o) => t.set("second", o), this.getDaysInMonth = (t) => t.daysInMonth(), this.getNextMonth = (t) => t.add(1, "month"), this.getPreviousMonth = (t) => t.subtract(1, "month"), this.getMonthArray = (t) => {
340
- const r = [t.startOf("year")];
341
- for (; r.length < 12; ) {
342
- const s = r[r.length - 1];
343
- r.push(this.getNextMonth(s));
344
- }
345
- return r;
346
- }, this.mergeDateAndTime = (t, o) => t.hour(o.hour()).minute(o.minute()).second(o.second()), this.getWeekdays = () => {
347
- const t = this.dayjs().startOf("week");
348
- return [0, 1, 2, 3, 4, 5, 6].map((o) => this.formatByString(t.add(o, "day"), "dd"));
349
- }, this.getWeekArray = (t) => {
350
- const o = t.startOf("month").startOf("week"), r = t.endOf("month").endOf("week");
351
- let s = 0, n = o;
352
- const c = [];
353
- for (; n.isBefore(r); ) {
354
- const a = Math.floor(s / 7);
355
- c[a] = c[a] || [], c[a].push(n), n = n.add(1, "day"), s += 1;
356
- }
357
- return c;
358
- }, this.getWeekNumber = (t) => t.week(), this.getYearRange = (t, o) => {
359
- const r = t.startOf("year"), s = o.endOf("year"), n = [];
360
- let c = r;
361
- for (; c.isBefore(s); )
362
- n.push(c), c = c.add(1, "year");
363
- return n;
364
- }, this.getMeridiemText = (t) => t === "am" ? "AM" : "PM", this.rawDayJsInstance = u || V, this.dayjs = Mt(this.rawDayJsInstance, d), this.locale = d, this.formats = y({}, Dt, l), V.extend(ut);
365
- }
366
- }
367
- function Tt(h) {
368
- return Ue("MuiDatePickerToolbar", h);
369
- }
370
- qe("MuiDatePickerToolbar", ["root", "title"]);
371
- const Pt = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "views"], Ot = (h) => {
372
- const {
373
- classes: d
374
- } = h;
375
- return Qe({
376
- root: ["root"],
377
- title: ["title"]
378
- }, Tt, d);
379
- }, xt = Pe(Ze, {
380
- name: "MuiDatePickerToolbar",
381
- slot: "Root",
382
- overridesResolver: (h, d) => d.root
383
- })({}), vt = Pe(st, {
384
- name: "MuiDatePickerToolbar",
385
- slot: "Title",
386
- overridesResolver: (h, d) => d.title
387
- })(({
388
- ownerState: h
389
- }) => y({}, h.isLandscape && {
390
- margin: "auto 16px auto auto"
391
- })), Ye = /* @__PURE__ */ I.forwardRef(function(d, l) {
392
- const u = X({
393
- props: d,
394
- name: "MuiDatePickerToolbar"
395
- }), {
396
- value: t,
397
- isLandscape: o,
398
- toolbarFormat: r,
399
- toolbarPlaceholder: s = "––",
400
- views: n
401
- } = u, c = H(u, Pt), a = z(), b = ue(), D = Ot(u), O = I.useMemo(() => t ? r ? a.formatByString(t, r) : De(n) ? a.format(t, "year") : Me(n) ? a.format(t, "month") : /en/.test(a.getCurrentLocaleCode()) ? a.format(t, "normalDateWithWeekday") : a.format(t, "normalDate") : s, [t, r, s, a, n]), Y = u;
402
- return /* @__PURE__ */ M(xt, y({
403
- ref: l,
404
- toolbarTitle: b.datePickerToolbarTitle,
405
- isLandscape: o,
406
- className: D.root
407
- }, c, {
408
- children: /* @__PURE__ */ M(vt, {
409
- variant: "h4",
410
- align: o ? "left" : "center",
411
- ownerState: Y,
412
- className: D.title,
413
- children: O
414
- })
415
- }));
416
- });
417
- process.env.NODE_ENV !== "production" && (Ye.propTypes = {
418
- // ----------------------------- Warning --------------------------------
419
- // | These PropTypes are generated from the TypeScript type definitions |
420
- // | To update them edit the TypeScript types and run "yarn proptypes" |
421
- // ----------------------------------------------------------------------
422
- classes: e.object,
423
- /**
424
- * className applied to the root component.
425
- */
426
- className: e.string,
427
- disabled: e.bool,
428
- /**
429
- * If `true`, show the toolbar even in desktop mode.
430
- * @default `true` for Desktop, `false` for Mobile.
431
- */
432
- hidden: e.bool,
433
- isLandscape: e.bool.isRequired,
434
- onChange: e.func.isRequired,
435
- /**
436
- * Callback called when a toolbar is clicked
437
- * @template TView
438
- * @param {TView} view The view to open
439
- */
440
- onViewChange: e.func.isRequired,
441
- readOnly: e.bool,
442
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
443
- titleId: e.string,
444
- /**
445
- * Toolbar date format.
446
- */
447
- toolbarFormat: e.string,
448
- /**
449
- * Toolbar value placeholder—it is displayed when the value is empty.
450
- * @default "––"
451
- */
452
- toolbarPlaceholder: e.node,
453
- value: e.any,
454
- /**
455
- * Currently visible picker view.
456
- */
457
- view: e.oneOf(["day", "month", "year"]).isRequired,
458
- views: e.arrayOf(e.oneOf(["day", "month", "year"]).isRequired).isRequired
459
- });
460
- const Le = (h, {
461
- format: d,
462
- views: l
463
- }) => {
464
- if (d != null)
465
- return d;
466
- if (De(l))
467
- return h.formats.year;
468
- if (Me(l))
469
- return h.formats.monthAndYear;
470
- };
471
- function Fe(h, d) {
472
- var l, u, t, o;
473
- const r = z(), s = ge(), n = X({
474
- props: h,
475
- name: d
476
- }), c = I.useMemo(() => {
477
- var b;
478
- return ((b = n.localeText) == null ? void 0 : b.toolbarTitle) == null ? n.localeText : y({}, n.localeText, {
479
- datePickerToolbarTitle: n.localeText.toolbarTitle
480
- });
481
- }, [n.localeText]), a = (l = n.slots) != null ? l : Je(n.components);
482
- return y({}, n, {
483
- localeText: c
484
- }, Ge({
485
- views: n.views,
486
- openTo: n.openTo,
487
- defaultViews: ["year", "day"],
488
- defaultOpenTo: "day"
489
- }), {
490
- disableFuture: (u = n.disableFuture) != null ? u : !1,
491
- disablePast: (t = n.disablePast) != null ? t : !1,
492
- minDate: J(r, n.minDate, s.minDate),
493
- maxDate: J(r, n.maxDate, s.maxDate),
494
- slots: y({
495
- toolbar: Ye
496
- }, a),
497
- slotProps: (o = n.slotProps) != null ? o : n.componentsProps
498
- });
499
- }
500
- const wt = ["value", "defaultValue", "format", "formatDensity", "shouldRespectLeadingZeros", "onChange", "readOnly", "onError", "shouldDisableDate", "shouldDisableMonth", "shouldDisableYear", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"], kt = (h) => {
501
- var d, l, u;
502
- const t = z(), o = ge();
503
- return y({}, h, {
504
- disablePast: (d = h.disablePast) != null ? d : !1,
505
- disableFuture: (l = h.disableFuture) != null ? l : !1,
506
- format: (u = h.format) != null ? u : t.formats.keyboardDate,
507
- minDate: J(t, h.minDate, o.minDate),
508
- maxDate: J(t, h.maxDate, o.maxDate)
509
- });
510
- }, Yt = ({
511
- props: h,
512
- inputRef: d
513
- }) => {
514
- const l = kt(h), {
515
- value: u,
516
- defaultValue: t,
517
- format: o,
518
- formatDensity: r,
519
- shouldRespectLeadingZeros: s,
520
- onChange: n,
521
- readOnly: c,
522
- onError: a,
523
- shouldDisableDate: b,
524
- shouldDisableMonth: D,
525
- shouldDisableYear: O,
526
- minDate: Y,
527
- maxDate: v,
528
- disableFuture: i,
529
- disablePast: f,
530
- selectedSections: p,
531
- onSelectedSectionsChange: m,
532
- unstableFieldRef: g
533
- } = l, T = H(l, wt);
534
- return Ke({
535
- inputRef: d,
536
- forwardedProps: T,
537
- internalProps: {
538
- value: u,
539
- defaultValue: t,
540
- format: o,
541
- formatDensity: r,
542
- shouldRespectLeadingZeros: s,
543
- onChange: n,
544
- readOnly: c,
545
- onError: a,
546
- shouldDisableDate: b,
547
- shouldDisableMonth: D,
548
- shouldDisableYear: O,
549
- minDate: Y,
550
- maxDate: v,
551
- disableFuture: i,
552
- disablePast: f,
553
- selectedSections: p,
554
- onSelectedSectionsChange: m,
555
- unstableFieldRef: g
556
- },
557
- valueManager: de,
558
- fieldValueManager: Xe,
559
- validator: ce,
560
- valueType: "date"
561
- });
562
- }, Lt = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"], Ft = ["inputRef"], St = ["ref", "onPaste", "inputMode", "readOnly"], he = /* @__PURE__ */ I.forwardRef(function(d, l) {
563
- var u, t, o;
564
- const r = X({
565
- props: d,
566
- name: "MuiDateField"
567
- }), {
568
- components: s,
569
- componentsProps: n,
570
- slots: c,
571
- slotProps: a,
572
- InputProps: b,
573
- inputProps: D
574
- } = r, O = H(r, Lt), Y = r, v = (u = (t = c == null ? void 0 : c.textField) != null ? t : s == null ? void 0 : s.TextField) != null ? u : at, i = it({
575
- elementType: v,
576
- externalSlotProps: (o = a == null ? void 0 : a.textField) != null ? o : n == null ? void 0 : n.textField,
577
- externalForwardedProps: O,
578
- ownerState: Y
579
- }), {
580
- inputRef: f
581
- } = i, p = H(i, Ft);
582
- p.inputProps = y({}, p.inputProps, D), p.InputProps = y({}, p.InputProps, b);
583
- const m = Yt({
584
- props: p,
585
- inputRef: f
586
- }), {
587
- ref: g,
588
- onPaste: T,
589
- inputMode: j,
590
- readOnly: L
591
- } = m, P = H(m, St);
592
- return /* @__PURE__ */ M(v, y({
593
- ref: l
594
- }, P, {
595
- InputProps: y({}, P.InputProps, {
596
- readOnly: L
597
- }),
598
- inputProps: y({}, P.inputProps, {
599
- inputMode: j,
600
- onPaste: T,
601
- ref: g
602
- })
603
- }));
604
- });
605
- process.env.NODE_ENV !== "production" && (he.propTypes = {
606
- // ----------------------------- Warning --------------------------------
607
- // | These PropTypes are generated from the TypeScript type definitions |
608
- // | To update them edit the TypeScript types and run "yarn proptypes" |
609
- // ----------------------------------------------------------------------
610
- /**
611
- * If `true`, the `input` element is focused during the first mount.
612
- * @default false
613
- */
614
- autoFocus: e.bool,
615
- className: e.string,
616
- /**
617
- * The color of the component.
618
- * It supports both default and custom theme colors, which can be added as shown in the
619
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
620
- * @default 'primary'
621
- */
622
- color: e.oneOf(["error", "info", "primary", "secondary", "success", "warning"]),
623
- /**
624
- * Overridable components.
625
- * @default {}
626
- * @deprecated Please use `slots`.
627
- */
628
- components: e.object,
629
- /**
630
- * The props used for each component slot.
631
- * @default {}
632
- * @deprecated Please use `slotProps`.
633
- */
634
- componentsProps: e.object,
635
- /**
636
- * The default value. Use when the component is not controlled.
637
- */
638
- defaultValue: e.any,
639
- /**
640
- * If `true`, the component is disabled.
641
- * @default false
642
- */
643
- disabled: e.bool,
644
- /**
645
- * If `true`, disable values after the current date for date components, time for time components and both for date time components.
646
- * @default false
647
- */
648
- disableFuture: e.bool,
649
- /**
650
- * If `true`, disable values before the current date for date components, time for time components and both for date time components.
651
- * @default false
652
- */
653
- disablePast: e.bool,
654
- /**
655
- * If `true`, the component is displayed in focused state.
656
- */
657
- focused: e.bool,
658
- /**
659
- * Format of the date when rendered in the input(s).
660
- */
661
- format: e.string,
662
- /**
663
- * Density of the format when rendered in the input.
664
- * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
665
- * @default "dense"
666
- */
667
- formatDensity: e.oneOf(["dense", "spacious"]),
668
- /**
669
- * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
670
- */
671
- FormHelperTextProps: e.object,
672
- /**
673
- * If `true`, the input will take up the full width of its container.
674
- * @default false
675
- */
676
- fullWidth: e.bool,
677
- /**
678
- * The helper text content.
679
- */
680
- helperText: e.node,
681
- /**
682
- * If `true`, the label is hidden.
683
- * This is used to increase density for a `FilledInput`.
684
- * Be sure to add `aria-label` to the `input` element.
685
- * @default false
686
- */
687
- hiddenLabel: e.bool,
688
- /**
689
- * The id of the `input` element.
690
- * Use this prop to make `label` and `helperText` accessible for screen readers.
691
- */
692
- id: e.string,
693
- /**
694
- * Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.
695
- * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
696
- */
697
- InputLabelProps: e.object,
698
- /**
699
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
700
- */
701
- inputProps: e.object,
702
- /**
703
- * Props applied to the Input element.
704
- * It will be a [`FilledInput`](/material-ui/api/filled-input/),
705
- * [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
706
- * component depending on the `variant` prop value.
707
- */
708
- InputProps: e.object,
709
- /**
710
- * Pass a ref to the `input` element.
711
- */
712
- inputRef: e.oneOfType([e.func, e.shape({
713
- current: e.any.isRequired
714
- })]),
715
- /**
716
- * The label content.
717
- */
718
- label: e.node,
719
- /**
720
- * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
721
- * @default 'none'
722
- */
723
- margin: e.oneOf(["dense", "none", "normal"]),
724
- /**
725
- * Maximal selectable date.
726
- */
727
- maxDate: e.any,
728
- /**
729
- * Minimal selectable date.
730
- */
731
- minDate: e.any,
732
- /**
733
- * Name attribute of the `input` element.
734
- */
735
- name: e.string,
736
- onBlur: e.func,
737
- /**
738
- * Callback fired when the value changes.
739
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
740
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
741
- * @param {TValue} value The new value.
742
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
743
- */
744
- onChange: e.func,
745
- /**
746
- * Callback fired when the error associated to the current value changes.
747
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
748
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
749
- * @param {TError} error The new error.
750
- * @param {TValue} value The value associated to the error.
751
- */
752
- onError: e.func,
753
- onFocus: e.func,
754
- /**
755
- * Callback fired when the selected sections change.
756
- * @param {FieldSelectedSections} newValue The new selected sections.
757
- */
758
- onSelectedSectionsChange: e.func,
759
- /**
760
- * It prevents the user from changing the value of the field
761
- * (not from interacting with the field).
762
- * @default false
763
- */
764
- readOnly: e.bool,
765
- /**
766
- * If `true`, the label is displayed as required and the `input` element is required.
767
- * @default false
768
- */
769
- required: e.bool,
770
- /**
771
- * The currently selected sections.
772
- * This prop accept four formats:
773
- * 1. If a number is provided, the section at this index will be selected.
774
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
775
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
776
- * 4. If `null` is provided, no section will be selected
777
- * If not provided, the selected sections will be handled internally.
778
- */
779
- selectedSections: e.oneOfType([e.oneOf(["all", "day", "hours", "meridiem", "minutes", "month", "seconds", "weekDay", "year"]), e.number, e.shape({
780
- endIndex: e.number.isRequired,
781
- startIndex: e.number.isRequired
782
- })]),
783
- /**
784
- * Disable specific date.
785
- * @template TDate
786
- * @param {TDate} day The date to test.
787
- * @returns {boolean} If `true` the date will be disabled.
788
- */
789
- shouldDisableDate: e.func,
790
- /**
791
- * Disable specific month.
792
- * @template TDate
793
- * @param {TDate} month The month to test.
794
- * @returns {boolean} If `true`, the month will be disabled.
795
- */
796
- shouldDisableMonth: e.func,
797
- /**
798
- * Disable specific year.
799
- * @template TDate
800
- * @param {TDate} year The year to test.
801
- * @returns {boolean} If `true`, the year will be disabled.
802
- */
803
- shouldDisableYear: e.func,
804
- /**
805
- * If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
806
- * If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
807
- *
808
- * Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
809
- *
810
- * Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
811
- * If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
812
- *
813
- * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
814
- * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
815
- *
816
- * @default `false`
817
- */
818
- shouldRespectLeadingZeros: e.bool,
819
- /**
820
- * The size of the component.
821
- */
822
- size: e.oneOf(["medium", "small"]),
823
- /**
824
- * The props used for each component slot.
825
- * @default {}
826
- */
827
- slotProps: e.object,
828
- /**
829
- * Overridable component slots.
830
- * @default {}
831
- */
832
- slots: e.object,
833
- style: e.object,
834
- /**
835
- * The system prop that allows defining system overrides as well as additional CSS styles.
836
- */
837
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
838
- /**
839
- * The ref object used to imperatively interact with the field.
840
- */
841
- unstableFieldRef: e.oneOfType([e.func, e.object]),
842
- /**
843
- * The selected value.
844
- * Used when the component is controlled.
845
- */
846
- value: e.any,
847
- /**
848
- * The variant to use.
849
- * @default 'outlined'
850
- */
851
- variant: e.oneOf(["filled", "outlined", "standard"])
852
- });
853
- const Se = /* @__PURE__ */ I.forwardRef(function(d, l) {
854
- var u, t;
855
- const o = ue(), r = z(), s = Fe(d, "MuiDesktopDatePicker"), n = y({
856
- day: B,
857
- month: B,
858
- year: B
859
- }, s.viewRenderers), c = y({}, s, {
860
- viewRenderers: n,
861
- format: Le(r, s),
862
- yearsPerRow: (u = s.yearsPerRow) != null ? u : 4,
863
- slots: y({
864
- openPickerIcon: et,
865
- field: he
866
- }, s.slots),
867
- slotProps: y({}, s.slotProps, {
868
- field: (b) => {
869
- var D;
870
- return y({}, Oe((D = s.slotProps) == null ? void 0 : D.field, b), Te(s), {
871
- ref: l
872
- });
873
- },
874
- toolbar: y({
875
- hidden: !0
876
- }, (t = s.slotProps) == null ? void 0 : t.toolbar)
877
- })
878
- }), {
879
- renderPicker: a
880
- } = tt({
881
- props: c,
882
- valueManager: de,
883
- valueType: "date",
884
- getOpenDialogAriaText: o.openDatePickerDialogue,
885
- validator: ce
886
- });
887
- return a();
888
- });
889
- Se.propTypes = {
890
- // ----------------------------- Warning --------------------------------
891
- // | These PropTypes are generated from the TypeScript type definitions |
892
- // | To update them edit the TypeScript types and run "yarn proptypes" |
893
- // ----------------------------------------------------------------------
894
- /**
895
- * If `true`, the main element is focused during the first mount.
896
- * This main element is:
897
- * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).
898
- * - the `input` element if there is a field rendered.
899
- */
900
- autoFocus: e.bool,
901
- /**
902
- * Class name applied to the root element.
903
- */
904
- className: e.string,
905
- /**
906
- * If `true`, the popover or modal will close after submitting the full date.
907
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
908
- */
909
- closeOnSelect: e.bool,
910
- /**
911
- * Overridable components.
912
- * @default {}
913
- * @deprecated Please use `slots`.
914
- */
915
- components: e.object,
916
- /**
917
- * The props used for each component slot.
918
- * @default {}
919
- * @deprecated Please use `slotProps`.
920
- */
921
- componentsProps: e.object,
922
- /**
923
- * Formats the day of week displayed in the calendar header.
924
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
925
- * @returns {string} The name to display.
926
- * @default (day) => day.charAt(0).toUpperCase()
927
- */
928
- dayOfWeekFormatter: e.func,
929
- /**
930
- * Default calendar month displayed when `value={null}`.
931
- */
932
- defaultCalendarMonth: e.any,
933
- /**
934
- * The default value.
935
- * Used when the component is not controlled.
936
- */
937
- defaultValue: e.any,
938
- /**
939
- * If `true`, the picker and text field are disabled.
940
- * @default false
941
- */
942
- disabled: e.bool,
943
- /**
944
- * If `true`, disable values after the current date for date components, time for time components and both for date time components.
945
- * @default false
946
- */
947
- disableFuture: e.bool,
948
- /**
949
- * If `true`, today's date is rendering without highlighting with circle.
950
- * @default false
951
- */
952
- disableHighlightToday: e.bool,
953
- /**
954
- * If `true`, the open picker button will not be rendered (renders only the field).
955
- * @default false
956
- */
957
- disableOpenPicker: e.bool,
958
- /**
959
- * If `true`, disable values before the current date for date components, time for time components and both for date time components.
960
- * @default false
961
- */
962
- disablePast: e.bool,
963
- /**
964
- * If `true`, the week number will be display in the calendar.
965
- */
966
- displayWeekNumber: e.bool,
967
- /**
968
- * Calendar will show more weeks in order to match this value.
969
- * Put it to 6 for having fix number of week in Gregorian calendars
970
- * @default undefined
971
- */
972
- fixedWeekNumber: e.number,
973
- /**
974
- * Format of the date when rendered in the input(s).
975
- * Defaults to localized format based on the used `views`.
976
- */
977
- format: e.string,
978
- /**
979
- * Density of the format when rendered in the input.
980
- * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
981
- * @default "dense"
982
- */
983
- formatDensity: e.oneOf(["dense", "spacious"]),
984
- /**
985
- * Pass a ref to the `input` element.
986
- */
987
- inputRef: e.oneOfType([e.func, e.shape({
988
- current: e.object
989
- })]),
990
- /**
991
- * The label content.
992
- */
993
- label: e.node,
994
- /**
995
- * If `true`, calls `renderLoading` instead of rendering the day calendar.
996
- * Can be used to preload information and show it in calendar.
997
- * @default false
998
- */
999
- loading: e.bool,
1000
- /**
1001
- * Locale for components texts.
1002
- * Allows overriding texts coming from `LocalizationProvider` and `theme`.
1003
- */
1004
- localeText: e.object,
1005
- /**
1006
- * Maximal selectable date.
1007
- */
1008
- maxDate: e.any,
1009
- /**
1010
- * Minimal selectable date.
1011
- */
1012
- minDate: e.any,
1013
- /**
1014
- * Months rendered per row.
1015
- * @default 3
1016
- */
1017
- monthsPerRow: e.oneOf([3, 4]),
1018
- /**
1019
- * Callback fired when the value is accepted.
1020
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1021
- * @param {TValue} value The value that was just accepted.
1022
- */
1023
- onAccept: e.func,
1024
- /**
1025
- * Callback fired when the value changes.
1026
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1027
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1028
- * @param {TValue} value The new value.
1029
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
1030
- */
1031
- onChange: e.func,
1032
- /**
1033
- * Callback fired when the popup requests to be closed.
1034
- * Use in controlled mode (see `open`).
1035
- */
1036
- onClose: e.func,
1037
- /**
1038
- * Callback fired when the error associated to the current value changes.
1039
- * If the error has a non-null value, then the `TextField` will be rendered in `error` state.
1040
- *
1041
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1042
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1043
- * @param {TError} error The new error describing why the current value is not valid.
1044
- * @param {TValue} value The value associated to the error.
1045
- */
1046
- onError: e.func,
1047
- /**
1048
- * Callback fired on month change.
1049
- * @template TDate
1050
- * @param {TDate} month The new month.
1051
- */
1052
- onMonthChange: e.func,
1053
- /**
1054
- * Callback fired when the popup requests to be opened.
1055
- * Use in controlled mode (see `open`).
1056
- */
1057
- onOpen: e.func,
1058
- /**
1059
- * Callback fired when the selected sections change.
1060
- * @param {FieldSelectedSections} newValue The new selected sections.
1061
- */
1062
- onSelectedSectionsChange: e.func,
1063
- /**
1064
- * Callback fired on view change.
1065
- * @template TView
1066
- * @param {TView} view The new view.
1067
- */
1068
- onViewChange: e.func,
1069
- /**
1070
- * Callback fired on year change.
1071
- * @template TDate
1072
- * @param {TDate} year The new year.
1073
- */
1074
- onYearChange: e.func,
1075
- /**
1076
- * Control the popup or dialog open state.
1077
- * @default false
1078
- */
1079
- open: e.bool,
1080
- /**
1081
- * The default visible view.
1082
- * Used when the component view is not controlled.
1083
- * Must be a valid option from `views` list.
1084
- */
1085
- openTo: e.oneOf(["day", "month", "year"]),
1086
- /**
1087
- * Force rendering in particular orientation.
1088
- */
1089
- orientation: e.oneOf(["landscape", "portrait"]),
1090
- readOnly: e.bool,
1091
- /**
1092
- * Disable heavy animations.
1093
- * @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
1094
- */
1095
- reduceAnimations: e.bool,
1096
- /**
1097
- * Component displaying when passed `loading` true.
1098
- * @returns {React.ReactNode} The node to render when loading.
1099
- * @default () => <span data-mui-test="loading-progress">...</span>
1100
- */
1101
- renderLoading: e.func,
1102
- /**
1103
- * The currently selected sections.
1104
- * This prop accept four formats:
1105
- * 1. If a number is provided, the section at this index will be selected.
1106
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
1107
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
1108
- * 4. If `null` is provided, no section will be selected
1109
- * If not provided, the selected sections will be handled internally.
1110
- */
1111
- selectedSections: e.oneOfType([e.oneOf(["all", "day", "hours", "meridiem", "minutes", "month", "seconds", "weekDay", "year"]), e.number, e.shape({
1112
- endIndex: e.number.isRequired,
1113
- startIndex: e.number.isRequired
1114
- })]),
1115
- /**
1116
- * Disable specific date.
1117
- * @template TDate
1118
- * @param {TDate} day The date to test.
1119
- * @returns {boolean} If `true` the date will be disabled.
1120
- */
1121
- shouldDisableDate: e.func,
1122
- /**
1123
- * Disable specific month.
1124
- * @template TDate
1125
- * @param {TDate} month The month to test.
1126
- * @returns {boolean} If `true`, the month will be disabled.
1127
- */
1128
- shouldDisableMonth: e.func,
1129
- /**
1130
- * Disable specific year.
1131
- * @template TDate
1132
- * @param {TDate} year The year to test.
1133
- * @returns {boolean} If `true`, the year will be disabled.
1134
- */
1135
- shouldDisableYear: e.func,
1136
- /**
1137
- * If `true`, days outside the current month are rendered:
1138
- *
1139
- * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
1140
- *
1141
- * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
1142
- *
1143
- * - ignored if `calendars` equals more than `1` on range pickers.
1144
- * @default false
1145
- */
1146
- showDaysOutsideCurrentMonth: e.bool,
1147
- /**
1148
- * The props used for each component slot.
1149
- * @default {}
1150
- */
1151
- slotProps: e.object,
1152
- /**
1153
- * Overridable component slots.
1154
- * @default {}
1155
- */
1156
- slots: e.object,
1157
- /**
1158
- * The system prop that allows defining system overrides as well as additional CSS styles.
1159
- */
1160
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1161
- /**
1162
- * The selected value.
1163
- * Used when the component is controlled.
1164
- */
1165
- value: e.any,
1166
- /**
1167
- * The visible view.
1168
- * Used when the component view is controlled.
1169
- * Must be a valid option from `views` list.
1170
- */
1171
- view: e.oneOf(["day", "month", "year"]),
1172
- /**
1173
- * Define custom view renderers for each section.
1174
- * If `null`, the section will only have field editing.
1175
- * If `undefined`, internally defined view will be the used.
1176
- */
1177
- viewRenderers: e.shape({
1178
- day: e.func,
1179
- month: e.func,
1180
- year: e.func
1181
- }),
1182
- /**
1183
- * Available views.
1184
- */
1185
- views: e.arrayOf(e.oneOf(["day", "month", "year"]).isRequired),
1186
- /**
1187
- * Years rendered per row.
1188
- * @default 4
1189
- */
1190
- yearsPerRow: e.oneOf([3, 4])
1191
- };
1192
- const Ce = /* @__PURE__ */ I.forwardRef(function(d, l) {
1193
- var u;
1194
- const t = ue(), o = z(), r = Fe(d, "MuiMobileDatePicker"), s = y({
1195
- day: B,
1196
- month: B,
1197
- year: B
1198
- }, r.viewRenderers), n = y({}, r, {
1199
- viewRenderers: s,
1200
- format: Le(o, r),
1201
- slots: y({
1202
- field: he
1203
- }, r.slots),
1204
- slotProps: y({}, r.slotProps, {
1205
- field: (a) => {
1206
- var b;
1207
- return y({}, Oe((b = r.slotProps) == null ? void 0 : b.field, a), Te(r), {
1208
- ref: l
1209
- });
1210
- },
1211
- toolbar: y({
1212
- hidden: !1
1213
- }, (u = r.slotProps) == null ? void 0 : u.toolbar)
1214
- })
1215
- }), {
1216
- renderPicker: c
1217
- } = ot({
1218
- props: n,
1219
- valueManager: de,
1220
- valueType: "date",
1221
- getOpenDialogAriaText: t.openDatePickerDialogue,
1222
- validator: ce
1223
- });
1224
- return c();
1225
- });
1226
- Ce.propTypes = {
1227
- // ----------------------------- Warning --------------------------------
1228
- // | These PropTypes are generated from the TypeScript type definitions |
1229
- // | To update them edit the TypeScript types and run "yarn proptypes" |
1230
- // ----------------------------------------------------------------------
1231
- /**
1232
- * If `true`, the main element is focused during the first mount.
1233
- * This main element is:
1234
- * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).
1235
- * - the `input` element if there is a field rendered.
1236
- */
1237
- autoFocus: e.bool,
1238
- /**
1239
- * Class name applied to the root element.
1240
- */
1241
- className: e.string,
1242
- /**
1243
- * If `true`, the popover or modal will close after submitting the full date.
1244
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
1245
- */
1246
- closeOnSelect: e.bool,
1247
- /**
1248
- * Overridable components.
1249
- * @default {}
1250
- * @deprecated Please use `slots`.
1251
- */
1252
- components: e.object,
1253
- /**
1254
- * The props used for each component slot.
1255
- * @default {}
1256
- * @deprecated Please use `slotProps`.
1257
- */
1258
- componentsProps: e.object,
1259
- /**
1260
- * Formats the day of week displayed in the calendar header.
1261
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
1262
- * @returns {string} The name to display.
1263
- * @default (day) => day.charAt(0).toUpperCase()
1264
- */
1265
- dayOfWeekFormatter: e.func,
1266
- /**
1267
- * Default calendar month displayed when `value={null}`.
1268
- */
1269
- defaultCalendarMonth: e.any,
1270
- /**
1271
- * The default value.
1272
- * Used when the component is not controlled.
1273
- */
1274
- defaultValue: e.any,
1275
- /**
1276
- * If `true`, the picker and text field are disabled.
1277
- * @default false
1278
- */
1279
- disabled: e.bool,
1280
- /**
1281
- * If `true`, disable values after the current date for date components, time for time components and both for date time components.
1282
- * @default false
1283
- */
1284
- disableFuture: e.bool,
1285
- /**
1286
- * If `true`, today's date is rendering without highlighting with circle.
1287
- * @default false
1288
- */
1289
- disableHighlightToday: e.bool,
1290
- /**
1291
- * If `true`, the open picker button will not be rendered (renders only the field).
1292
- * @default false
1293
- */
1294
- disableOpenPicker: e.bool,
1295
- /**
1296
- * If `true`, disable values before the current date for date components, time for time components and both for date time components.
1297
- * @default false
1298
- */
1299
- disablePast: e.bool,
1300
- /**
1301
- * If `true`, the week number will be display in the calendar.
1302
- */
1303
- displayWeekNumber: e.bool,
1304
- /**
1305
- * Calendar will show more weeks in order to match this value.
1306
- * Put it to 6 for having fix number of week in Gregorian calendars
1307
- * @default undefined
1308
- */
1309
- fixedWeekNumber: e.number,
1310
- /**
1311
- * Format of the date when rendered in the input(s).
1312
- * Defaults to localized format based on the used `views`.
1313
- */
1314
- format: e.string,
1315
- /**
1316
- * Density of the format when rendered in the input.
1317
- * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
1318
- * @default "dense"
1319
- */
1320
- formatDensity: e.oneOf(["dense", "spacious"]),
1321
- /**
1322
- * Pass a ref to the `input` element.
1323
- */
1324
- inputRef: e.oneOfType([e.func, e.shape({
1325
- current: e.object
1326
- })]),
1327
- /**
1328
- * The label content.
1329
- */
1330
- label: e.node,
1331
- /**
1332
- * If `true`, calls `renderLoading` instead of rendering the day calendar.
1333
- * Can be used to preload information and show it in calendar.
1334
- * @default false
1335
- */
1336
- loading: e.bool,
1337
- /**
1338
- * Locale for components texts.
1339
- * Allows overriding texts coming from `LocalizationProvider` and `theme`.
1340
- */
1341
- localeText: e.object,
1342
- /**
1343
- * Maximal selectable date.
1344
- */
1345
- maxDate: e.any,
1346
- /**
1347
- * Minimal selectable date.
1348
- */
1349
- minDate: e.any,
1350
- /**
1351
- * Months rendered per row.
1352
- * @default 3
1353
- */
1354
- monthsPerRow: e.oneOf([3, 4]),
1355
- /**
1356
- * Callback fired when the value is accepted.
1357
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1358
- * @param {TValue} value The value that was just accepted.
1359
- */
1360
- onAccept: e.func,
1361
- /**
1362
- * Callback fired when the value changes.
1363
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1364
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1365
- * @param {TValue} value The new value.
1366
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
1367
- */
1368
- onChange: e.func,
1369
- /**
1370
- * Callback fired when the popup requests to be closed.
1371
- * Use in controlled mode (see `open`).
1372
- */
1373
- onClose: e.func,
1374
- /**
1375
- * Callback fired when the error associated to the current value changes.
1376
- * If the error has a non-null value, then the `TextField` will be rendered in `error` state.
1377
- *
1378
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1379
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1380
- * @param {TError} error The new error describing why the current value is not valid.
1381
- * @param {TValue} value The value associated to the error.
1382
- */
1383
- onError: e.func,
1384
- /**
1385
- * Callback fired on month change.
1386
- * @template TDate
1387
- * @param {TDate} month The new month.
1388
- */
1389
- onMonthChange: e.func,
1390
- /**
1391
- * Callback fired when the popup requests to be opened.
1392
- * Use in controlled mode (see `open`).
1393
- */
1394
- onOpen: e.func,
1395
- /**
1396
- * Callback fired when the selected sections change.
1397
- * @param {FieldSelectedSections} newValue The new selected sections.
1398
- */
1399
- onSelectedSectionsChange: e.func,
1400
- /**
1401
- * Callback fired on view change.
1402
- * @template TView
1403
- * @param {TView} view The new view.
1404
- */
1405
- onViewChange: e.func,
1406
- /**
1407
- * Callback fired on year change.
1408
- * @template TDate
1409
- * @param {TDate} year The new year.
1410
- */
1411
- onYearChange: e.func,
1412
- /**
1413
- * Control the popup or dialog open state.
1414
- * @default false
1415
- */
1416
- open: e.bool,
1417
- /**
1418
- * The default visible view.
1419
- * Used when the component view is not controlled.
1420
- * Must be a valid option from `views` list.
1421
- */
1422
- openTo: e.oneOf(["day", "month", "year"]),
1423
- /**
1424
- * Force rendering in particular orientation.
1425
- */
1426
- orientation: e.oneOf(["landscape", "portrait"]),
1427
- readOnly: e.bool,
1428
- /**
1429
- * Disable heavy animations.
1430
- * @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
1431
- */
1432
- reduceAnimations: e.bool,
1433
- /**
1434
- * Component displaying when passed `loading` true.
1435
- * @returns {React.ReactNode} The node to render when loading.
1436
- * @default () => <span data-mui-test="loading-progress">...</span>
1437
- */
1438
- renderLoading: e.func,
1439
- /**
1440
- * The currently selected sections.
1441
- * This prop accept four formats:
1442
- * 1. If a number is provided, the section at this index will be selected.
1443
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
1444
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
1445
- * 4. If `null` is provided, no section will be selected
1446
- * If not provided, the selected sections will be handled internally.
1447
- */
1448
- selectedSections: e.oneOfType([e.oneOf(["all", "day", "hours", "meridiem", "minutes", "month", "seconds", "weekDay", "year"]), e.number, e.shape({
1449
- endIndex: e.number.isRequired,
1450
- startIndex: e.number.isRequired
1451
- })]),
1452
- /**
1453
- * Disable specific date.
1454
- * @template TDate
1455
- * @param {TDate} day The date to test.
1456
- * @returns {boolean} If `true` the date will be disabled.
1457
- */
1458
- shouldDisableDate: e.func,
1459
- /**
1460
- * Disable specific month.
1461
- * @template TDate
1462
- * @param {TDate} month The month to test.
1463
- * @returns {boolean} If `true`, the month will be disabled.
1464
- */
1465
- shouldDisableMonth: e.func,
1466
- /**
1467
- * Disable specific year.
1468
- * @template TDate
1469
- * @param {TDate} year The year to test.
1470
- * @returns {boolean} If `true`, the year will be disabled.
1471
- */
1472
- shouldDisableYear: e.func,
1473
- /**
1474
- * If `true`, days outside the current month are rendered:
1475
- *
1476
- * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
1477
- *
1478
- * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
1479
- *
1480
- * - ignored if `calendars` equals more than `1` on range pickers.
1481
- * @default false
1482
- */
1483
- showDaysOutsideCurrentMonth: e.bool,
1484
- /**
1485
- * The props used for each component slot.
1486
- * @default {}
1487
- */
1488
- slotProps: e.object,
1489
- /**
1490
- * Overridable component slots.
1491
- * @default {}
1492
- */
1493
- slots: e.object,
1494
- /**
1495
- * The system prop that allows defining system overrides as well as additional CSS styles.
1496
- */
1497
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1498
- /**
1499
- * The selected value.
1500
- * Used when the component is controlled.
1501
- */
1502
- value: e.any,
1503
- /**
1504
- * The visible view.
1505
- * Used when the component view is controlled.
1506
- * Must be a valid option from `views` list.
1507
- */
1508
- view: e.oneOf(["day", "month", "year"]),
1509
- /**
1510
- * Define custom view renderers for each section.
1511
- * If `null`, the section will only have field editing.
1512
- * If `undefined`, internally defined view will be the used.
1513
- */
1514
- viewRenderers: e.shape({
1515
- day: e.func,
1516
- month: e.func,
1517
- year: e.func
1518
- }),
1519
- /**
1520
- * Available views.
1521
- */
1522
- views: e.arrayOf(e.oneOf(["day", "month", "year"]).isRequired),
1523
- /**
1524
- * Years rendered per row.
1525
- * @default 3
1526
- */
1527
- yearsPerRow: e.oneOf([3, 4])
1528
- };
1529
- const Ct = ["desktopModeMediaQuery"], le = /* @__PURE__ */ I.forwardRef(function(d, l) {
1530
- const u = X({
1531
- props: d,
1532
- name: "MuiDatePicker"
1533
- }), {
1534
- desktopModeMediaQuery: t = nt
1535
- } = u, o = H(u, Ct);
1536
- return rt(t, {
1537
- defaultMatches: !0
1538
- }) ? /* @__PURE__ */ M(Se, y({
1539
- ref: l
1540
- }, o)) : /* @__PURE__ */ M(Ce, y({
1541
- ref: l
1542
- }, o));
1543
- });
1544
- process.env.NODE_ENV !== "production" && (le.propTypes = {
1545
- // ----------------------------- Warning --------------------------------
1546
- // | These PropTypes are generated from the TypeScript type definitions |
1547
- // | To update them edit the TypeScript types and run "yarn proptypes" |
1548
- // ----------------------------------------------------------------------
1549
- /**
1550
- * If `true`, the main element is focused during the first mount.
1551
- * This main element is:
1552
- * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).
1553
- * - the `input` element if there is a field rendered.
1554
- */
1555
- autoFocus: e.bool,
1556
- /**
1557
- * Class name applied to the root element.
1558
- */
1559
- className: e.string,
1560
- /**
1561
- * If `true`, the popover or modal will close after submitting the full date.
1562
- * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
1563
- */
1564
- closeOnSelect: e.bool,
1565
- /**
1566
- * Overridable components.
1567
- * @default {}
1568
- * @deprecated Please use `slots`.
1569
- */
1570
- components: e.object,
1571
- /**
1572
- * The props used for each component slot.
1573
- * @default {}
1574
- * @deprecated Please use `slotProps`.
1575
- */
1576
- componentsProps: e.object,
1577
- /**
1578
- * Formats the day of week displayed in the calendar header.
1579
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
1580
- * @returns {string} The name to display.
1581
- * @default (day) => day.charAt(0).toUpperCase()
1582
- */
1583
- dayOfWeekFormatter: e.func,
1584
- /**
1585
- * Default calendar month displayed when `value={null}`.
1586
- */
1587
- defaultCalendarMonth: e.any,
1588
- /**
1589
- * The default value.
1590
- * Used when the component is not controlled.
1591
- */
1592
- defaultValue: e.any,
1593
- /**
1594
- * CSS media query when `Mobile` mode will be changed to `Desktop`.
1595
- * @default '@media (pointer: fine)'
1596
- * @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
1597
- */
1598
- desktopModeMediaQuery: e.string,
1599
- /**
1600
- * If `true`, the picker and text field are disabled.
1601
- * @default false
1602
- */
1603
- disabled: e.bool,
1604
- /**
1605
- * If `true`, disable values after the current date for date components, time for time components and both for date time components.
1606
- * @default false
1607
- */
1608
- disableFuture: e.bool,
1609
- /**
1610
- * If `true`, today's date is rendering without highlighting with circle.
1611
- * @default false
1612
- */
1613
- disableHighlightToday: e.bool,
1614
- /**
1615
- * If `true`, the open picker button will not be rendered (renders only the field).
1616
- * @default false
1617
- */
1618
- disableOpenPicker: e.bool,
1619
- /**
1620
- * If `true`, disable values before the current date for date components, time for time components and both for date time components.
1621
- * @default false
1622
- */
1623
- disablePast: e.bool,
1624
- /**
1625
- * If `true`, the week number will be display in the calendar.
1626
- */
1627
- displayWeekNumber: e.bool,
1628
- /**
1629
- * Calendar will show more weeks in order to match this value.
1630
- * Put it to 6 for having fix number of week in Gregorian calendars
1631
- * @default undefined
1632
- */
1633
- fixedWeekNumber: e.number,
1634
- /**
1635
- * Format of the date when rendered in the input(s).
1636
- * Defaults to localized format based on the used `views`.
1637
- */
1638
- format: e.string,
1639
- /**
1640
- * Density of the format when rendered in the input.
1641
- * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
1642
- * @default "dense"
1643
- */
1644
- formatDensity: e.oneOf(["dense", "spacious"]),
1645
- /**
1646
- * Pass a ref to the `input` element.
1647
- */
1648
- inputRef: e.oneOfType([e.func, e.shape({
1649
- current: e.object
1650
- })]),
1651
- /**
1652
- * The label content.
1653
- */
1654
- label: e.node,
1655
- /**
1656
- * If `true`, calls `renderLoading` instead of rendering the day calendar.
1657
- * Can be used to preload information and show it in calendar.
1658
- * @default false
1659
- */
1660
- loading: e.bool,
1661
- /**
1662
- * Locale for components texts.
1663
- * Allows overriding texts coming from `LocalizationProvider` and `theme`.
1664
- */
1665
- localeText: e.object,
1666
- /**
1667
- * Maximal selectable date.
1668
- */
1669
- maxDate: e.any,
1670
- /**
1671
- * Minimal selectable date.
1672
- */
1673
- minDate: e.any,
1674
- /**
1675
- * Months rendered per row.
1676
- * @default 3
1677
- */
1678
- monthsPerRow: e.oneOf([3, 4]),
1679
- /**
1680
- * Callback fired when the value is accepted.
1681
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1682
- * @param {TValue} value The value that was just accepted.
1683
- */
1684
- onAccept: e.func,
1685
- /**
1686
- * Callback fired when the value changes.
1687
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1688
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1689
- * @param {TValue} value The new value.
1690
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
1691
- */
1692
- onChange: e.func,
1693
- /**
1694
- * Callback fired when the popup requests to be closed.
1695
- * Use in controlled mode (see `open`).
1696
- */
1697
- onClose: e.func,
1698
- /**
1699
- * Callback fired when the error associated to the current value changes.
1700
- * If the error has a non-null value, then the `TextField` will be rendered in `error` state.
1701
- *
1702
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
1703
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
1704
- * @param {TError} error The new error describing why the current value is not valid.
1705
- * @param {TValue} value The value associated to the error.
1706
- */
1707
- onError: e.func,
1708
- /**
1709
- * Callback fired on month change.
1710
- * @template TDate
1711
- * @param {TDate} month The new month.
1712
- */
1713
- onMonthChange: e.func,
1714
- /**
1715
- * Callback fired when the popup requests to be opened.
1716
- * Use in controlled mode (see `open`).
1717
- */
1718
- onOpen: e.func,
1719
- /**
1720
- * Callback fired when the selected sections change.
1721
- * @param {FieldSelectedSections} newValue The new selected sections.
1722
- */
1723
- onSelectedSectionsChange: e.func,
1724
- /**
1725
- * Callback fired on view change.
1726
- * @template TView
1727
- * @param {TView} view The new view.
1728
- */
1729
- onViewChange: e.func,
1730
- /**
1731
- * Callback fired on year change.
1732
- * @template TDate
1733
- * @param {TDate} year The new year.
1734
- */
1735
- onYearChange: e.func,
1736
- /**
1737
- * Control the popup or dialog open state.
1738
- * @default false
1739
- */
1740
- open: e.bool,
1741
- /**
1742
- * The default visible view.
1743
- * Used when the component view is not controlled.
1744
- * Must be a valid option from `views` list.
1745
- */
1746
- openTo: e.oneOf(["day", "month", "year"]),
1747
- /**
1748
- * Force rendering in particular orientation.
1749
- */
1750
- orientation: e.oneOf(["landscape", "portrait"]),
1751
- readOnly: e.bool,
1752
- /**
1753
- * Disable heavy animations.
1754
- * @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
1755
- */
1756
- reduceAnimations: e.bool,
1757
- /**
1758
- * Component displaying when passed `loading` true.
1759
- * @returns {React.ReactNode} The node to render when loading.
1760
- * @default () => <span data-mui-test="loading-progress">...</span>
1761
- */
1762
- renderLoading: e.func,
1763
- /**
1764
- * The currently selected sections.
1765
- * This prop accept four formats:
1766
- * 1. If a number is provided, the section at this index will be selected.
1767
- * 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
1768
- * 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
1769
- * 4. If `null` is provided, no section will be selected
1770
- * If not provided, the selected sections will be handled internally.
1771
- */
1772
- selectedSections: e.oneOfType([e.oneOf(["all", "day", "hours", "meridiem", "minutes", "month", "seconds", "weekDay", "year"]), e.number, e.shape({
1773
- endIndex: e.number.isRequired,
1774
- startIndex: e.number.isRequired
1775
- })]),
1776
- /**
1777
- * Disable specific date.
1778
- * @template TDate
1779
- * @param {TDate} day The date to test.
1780
- * @returns {boolean} If `true` the date will be disabled.
1781
- */
1782
- shouldDisableDate: e.func,
1783
- /**
1784
- * Disable specific month.
1785
- * @template TDate
1786
- * @param {TDate} month The month to test.
1787
- * @returns {boolean} If `true`, the month will be disabled.
1788
- */
1789
- shouldDisableMonth: e.func,
1790
- /**
1791
- * Disable specific year.
1792
- * @template TDate
1793
- * @param {TDate} year The year to test.
1794
- * @returns {boolean} If `true`, the year will be disabled.
1795
- */
1796
- shouldDisableYear: e.func,
1797
- /**
1798
- * If `true`, days outside the current month are rendered:
1799
- *
1800
- * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
1801
- *
1802
- * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
1803
- *
1804
- * - ignored if `calendars` equals more than `1` on range pickers.
1805
- * @default false
1806
- */
1807
- showDaysOutsideCurrentMonth: e.bool,
1808
- /**
1809
- * The props used for each component slot.
1810
- * @default {}
1811
- */
1812
- slotProps: e.object,
1813
- /**
1814
- * Overridable component slots.
1815
- * @default {}
1816
- */
1817
- slots: e.object,
1818
- /**
1819
- * The system prop that allows defining system overrides as well as additional CSS styles.
1820
- */
1821
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1822
- /**
1823
- * The selected value.
1824
- * Used when the component is controlled.
1825
- */
1826
- value: e.any,
1827
- /**
1828
- * The visible view.
1829
- * Used when the component view is controlled.
1830
- * Must be a valid option from `views` list.
1831
- */
1832
- view: e.oneOf(["day", "month", "year"]),
1833
- /**
1834
- * Define custom view renderers for each section.
1835
- * If `null`, the section will only have field editing.
1836
- * If `undefined`, internally defined view will be the used.
1837
- */
1838
- viewRenderers: e.shape({
1839
- day: e.func,
1840
- month: e.func,
1841
- year: e.func
1842
- }),
1843
- /**
1844
- * Available views.
1845
- */
1846
- views: e.arrayOf(e.oneOf(["day", "month", "year"]).isRequired),
1847
- /**
1848
- * Years rendered per row.
1849
- * @default 4 on desktop, 3 on mobile
1850
- */
1851
- yearsPerRow: e.oneOf([3, 4])
1852
- });
1853
- const Qt = (h) => {
1854
- const { state: d, actions: l, ownerState: u, sx: t, other: o } = We(h);
1855
- return /* @__PURE__ */ M(Ie, { dateAdapter: gt, children: /* @__PURE__ */ E(
1856
- He,
1857
- {
1858
- ownerState: u,
1859
- sx: t,
1860
- ...o,
1861
- children: [
1862
- /* @__PURE__ */ E(
1863
- Ve,
1864
- {
1865
- value: d.filterType,
1866
- exclusive: !0,
1867
- onChange: l.handleTypeChange,
1868
- size: "small",
1869
- children: [
1870
- /* @__PURE__ */ M(me, { value: "relative", children: "Relative" }),
1871
- /* @__PURE__ */ M(me, { value: "custom", children: "Custom" })
1872
- ]
1873
- }
1874
- ),
1875
- d.filterType === "relative" && /* @__PURE__ */ M(Be, { children: d.presets.map(([r, s]) => /* @__PURE__ */ M(
1876
- Ee,
1877
- {
1878
- size: "small",
1879
- variant: "outlined",
1880
- active: d.activePreset === r,
1881
- onClick: () => l.handlePresetSelect(r),
1882
- children: s
1883
- },
1884
- r
1885
- )) }),
1886
- d.filterType === "custom" && /* @__PURE__ */ E(ze, { children: [
1887
- /* @__PURE__ */ E(ye, { flex: 1, children: [
1888
- /* @__PURE__ */ M(be, { fontSize: 14, mb: 1, children: "From" }),
1889
- /* @__PURE__ */ M(
1890
- le,
1891
- {
1892
- value: d.minValue,
1893
- onChange: l.handleMinDateChange,
1894
- format: "DD/MM/YYYY",
1895
- slotProps: {
1896
- textField: {
1897
- size: "small",
1898
- fullWidth: !0,
1899
- placeholder: "Select start date"
1900
- },
1901
- popper: { placement: "right-start" }
1902
- }
1903
- }
1904
- )
1905
- ] }),
1906
- /* @__PURE__ */ E(ye, { flex: 1, children: [
1907
- /* @__PURE__ */ M(be, { fontSize: 14, mb: 1, children: "To" }),
1908
- /* @__PURE__ */ M(
1909
- le,
1910
- {
1911
- value: d.maxValue,
1912
- onChange: l.handleMaxDateChange,
1913
- minDate: d.minValue || void 0,
1914
- format: "DD/MM/YYYY",
1915
- slotProps: {
1916
- textField: {
1917
- size: "small",
1918
- fullWidth: !0,
1919
- placeholder: "Select end date"
1920
- },
1921
- popper: { placement: "right-start" }
1922
- }
1923
- }
1924
- )
1925
- ] })
1926
- ] })
1927
- ]
1928
- }
1929
- ) });
1930
- };
1931
- export {
1932
- gt as A,
1933
- Qt as D
1934
- };