@prokodo/ui 0.0.24 → 0.0.26
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/components/accordion/Accordion.js +65 -65
- package/dist/components/animated/Animated.js +17 -17
- package/dist/components/animatedText/AnimatedText.js +4 -4
- package/dist/components/avatar/Avatar.js +34 -34
- package/dist/components/base-link/BaseLink.js +12 -12
- package/dist/components/button/Button.js +48 -48
- package/dist/components/calendly/Calendly.js +32 -32
- package/dist/components/card/Card.js +107 -107
- package/dist/components/carousel/Carousel.js +106 -106
- package/dist/components/chip/Chip.js +26 -26
- package/dist/components/datePicker/DatePicker.js +37 -37
- package/dist/components/dialog/Dialog.js +82 -82
- package/dist/components/drawer/Drawer.js +48 -48
- package/dist/components/form/Form.js +94 -94
- package/dist/components/form/FormField.js +41 -41
- package/dist/components/form/FormResponse.js +22 -22
- package/dist/components/grid/Grid.js +8 -8
- package/dist/components/grid/GridRow.js +10 -10
- package/dist/components/headline/Headline.js +28 -28
- package/dist/components/icon/Icon.js +4 -4
- package/dist/components/image/Image.js +15 -15
- package/dist/components/image-text/ImageText.js +48 -48
- package/dist/components/input/Input.js +121 -121
- package/dist/components/inputOTP/InputOTP.js +24 -24
- package/dist/components/label/Label.js +26 -26
- package/dist/components/link/Link.js +27 -27
- package/dist/components/list/List.js +75 -75
- package/dist/components/loading/Loading.js +17 -17
- package/dist/components/lottie/Lottie.js +23 -23
- package/dist/components/map/Map.js +19 -19
- package/dist/components/post-item/PostItem.js +73 -73
- package/dist/components/post-item/PostItemAuthor.js +16 -16
- package/dist/components/post-item/index.js +4 -2
- package/dist/components/post-teaser/PostTeaser.js +76 -76
- package/dist/components/post-widget/PostWidget.js +63 -63
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +67 -67
- package/dist/components/quote/Quote.js +40 -40
- package/dist/components/rich-text/RichText.js +76 -76
- package/dist/components/select/Select.js +92 -92
- package/dist/components/skeleton/Skeleton.js +8 -8
- package/dist/components/slider/Slider.js +50 -50
- package/dist/components/stepper/Stepper.js +41 -41
- package/dist/components/switch/Switch.js +32 -32
- package/dist/components/table/Table.js +31 -31
- package/dist/components/teaser/Teaser.js +55 -55
- package/dist/constants/project.js +1 -1
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Option/Option.js +23 -23
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Portal/Portal.js +22 -22
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Select/Select.js +46 -46
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Slider/Slider.js +141 -141
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Switch/Switch.js +33 -33
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Unstable_Popup/Popup.js +31 -31
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/SelectProvider.js +14 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/post-item/index.d.ts +1 -0
- package/package.json +7 -3
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.js +0 -4
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.development.js +0 -247
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.production.js +0 -35
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.js +0 -10
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { create as
|
|
4
|
-
import
|
|
5
|
-
import { NEXT as
|
|
6
|
-
import { Lottie as
|
|
7
|
-
import { Button as
|
|
8
|
-
const
|
|
9
|
-
ref:
|
|
1
|
+
import { jsx as l, jsxs as J } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as b, useState as f, Children as le, useEffect as X, useCallback as v, useImperativeHandle as ne } from "react";
|
|
3
|
+
import { create as ce } from "../../helpers/bem.js";
|
|
4
|
+
import de from "./Carousel.module.scss.js";
|
|
5
|
+
import { NEXT as N, PREV as R, handleTouchStart as oe, handleTouchMove as fe, handleTouchEnd as me, handleMouseUp as ue, handleMouseDown as be } from "./Carousel.services.js";
|
|
6
|
+
import { Lottie as ve } from "../lottie/Lottie.js";
|
|
7
|
+
import { Button as L } from "../button/Button.js";
|
|
8
|
+
const a = ce(de, "Carousel"), Ie = ({
|
|
9
|
+
ref: O,
|
|
10
10
|
autoplay: m,
|
|
11
|
-
enableControl:
|
|
12
|
-
itemsToShow:
|
|
13
|
-
className:
|
|
14
|
-
classNameControls:
|
|
15
|
-
classNameButtons:
|
|
16
|
-
classNameWrapper:
|
|
17
|
-
classNameItem:
|
|
18
|
-
classNameDots:
|
|
19
|
-
classNameDot:
|
|
20
|
-
onKeyDown:
|
|
21
|
-
onMouseEnter:
|
|
22
|
-
onMouseLeave:
|
|
23
|
-
onTouchEnd:
|
|
24
|
-
onTouchMove:
|
|
25
|
-
onTouchStart:
|
|
26
|
-
onMouseDown:
|
|
27
|
-
onMouseUp:
|
|
28
|
-
children:
|
|
29
|
-
...
|
|
11
|
+
enableControl: y,
|
|
12
|
+
itemsToShow: r = 1,
|
|
13
|
+
className: Q,
|
|
14
|
+
classNameControls: W,
|
|
15
|
+
classNameButtons: V,
|
|
16
|
+
classNameWrapper: Y,
|
|
17
|
+
classNameItem: Z,
|
|
18
|
+
classNameDots: h,
|
|
19
|
+
classNameDot: B,
|
|
20
|
+
onKeyDown: x,
|
|
21
|
+
onMouseEnter: I,
|
|
22
|
+
onMouseLeave: p,
|
|
23
|
+
onTouchEnd: C,
|
|
24
|
+
onTouchMove: g,
|
|
25
|
+
onTouchStart: k,
|
|
26
|
+
onMouseDown: A,
|
|
27
|
+
onMouseUp: _,
|
|
28
|
+
children: K,
|
|
29
|
+
...U
|
|
30
30
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const $ = b(null), E = b(0), j = b(0), z = b(0), w = b(0), [D, M] = f(!0), [c, d] = f(r), [T, H] = f(!1), [q, F] = f(!!m), [u, n] = f(!1), o = le.toArray(K), [G, S] = f([]), s = o.length;
|
|
32
|
+
X(() => {
|
|
33
33
|
const e = [
|
|
34
|
-
...o.slice(-
|
|
34
|
+
...o.slice(-r),
|
|
35
35
|
...o,
|
|
36
|
-
...o.slice(0,
|
|
36
|
+
...o.slice(0, r)
|
|
37
37
|
];
|
|
38
|
-
e !== G && (
|
|
39
|
-
}, [
|
|
38
|
+
e !== G && (S(e), d(r));
|
|
39
|
+
}, [r]), X(() => {
|
|
40
40
|
const e = setTimeout(() => {
|
|
41
|
-
|
|
41
|
+
M(!1);
|
|
42
42
|
}, 1500);
|
|
43
43
|
return () => clearTimeout(e);
|
|
44
44
|
}, []);
|
|
45
|
-
const
|
|
45
|
+
const i = v(
|
|
46
46
|
(e) => {
|
|
47
47
|
if (u) return;
|
|
48
48
|
n(!0);
|
|
49
49
|
let t = c;
|
|
50
|
-
e ===
|
|
51
|
-
t >=
|
|
50
|
+
e === N ? t = c + 1 : e === R && (t = c - 1), d(t), setTimeout(() => {
|
|
51
|
+
t >= s + r ? (d(r), n(!1)) : (t < r && d(s), n(!1));
|
|
52
52
|
}, 300);
|
|
53
53
|
},
|
|
54
|
-
[u, c,
|
|
54
|
+
[u, c, r, s]
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
X(() => {
|
|
57
57
|
if (typeof m != "number" || m <= 0) return;
|
|
58
58
|
let e;
|
|
59
59
|
return q && (e = setInterval(() => {
|
|
60
|
-
|
|
60
|
+
i(N);
|
|
61
61
|
}, m)), () => {
|
|
62
62
|
clearInterval(e);
|
|
63
63
|
};
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
64
|
+
}, [i, q, m]);
|
|
65
|
+
const P = v(
|
|
66
66
|
(e) => {
|
|
67
67
|
if (u) return;
|
|
68
68
|
n(!0);
|
|
69
|
-
const t = e +
|
|
69
|
+
const t = e + r;
|
|
70
70
|
d(t), setTimeout(() => {
|
|
71
|
-
t >=
|
|
71
|
+
t >= s + r ? (d(t - s), n(!1)) : (t < r && d(s + t), n(!1));
|
|
72
72
|
}, 300);
|
|
73
73
|
},
|
|
74
|
-
[u,
|
|
74
|
+
[u, r, s]
|
|
75
75
|
);
|
|
76
|
-
|
|
77
|
-
slidePrev: () =>
|
|
78
|
-
slideNext: () =>
|
|
79
|
-
carouselContainer:
|
|
76
|
+
ne(O, () => ({
|
|
77
|
+
slidePrev: () => i(R),
|
|
78
|
+
slideNext: () => i(N),
|
|
79
|
+
carouselContainer: $.current
|
|
80
80
|
}));
|
|
81
|
-
const
|
|
81
|
+
const ee = v(
|
|
82
82
|
(e) => {
|
|
83
|
-
|
|
83
|
+
I == null || I(e), F(!1);
|
|
84
84
|
},
|
|
85
|
-
[
|
|
86
|
-
),
|
|
85
|
+
[I]
|
|
86
|
+
), te = v(
|
|
87
87
|
(e) => {
|
|
88
|
-
|
|
88
|
+
p == null || p(e), F(!0);
|
|
89
89
|
},
|
|
90
|
-
[
|
|
91
|
-
),
|
|
92
|
-
() =>
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
90
|
+
[p]
|
|
91
|
+
), re = () => `translateX(${-c * (100 / r)}%)`, se = v(
|
|
92
|
+
() => s > 0 && /* @__PURE__ */ l("span", { className: a("dots", void 0, h), children: o.map((e, t) => {
|
|
93
|
+
const ie = t === (c - r + s) % s;
|
|
94
|
+
return /* @__PURE__ */ l(
|
|
95
95
|
"button",
|
|
96
96
|
{
|
|
97
97
|
tabIndex: 0,
|
|
98
|
-
className:
|
|
98
|
+
className: a(
|
|
99
99
|
"dots__dot",
|
|
100
100
|
{
|
|
101
|
-
"is-active":
|
|
101
|
+
"is-active": ie
|
|
102
102
|
},
|
|
103
|
-
|
|
103
|
+
B
|
|
104
104
|
),
|
|
105
|
-
onClick: () =>
|
|
106
|
-
onKeyDown: (
|
|
105
|
+
onClick: () => P(t),
|
|
106
|
+
onKeyDown: (ae) => ae.key === "Enter" && P(t)
|
|
107
107
|
},
|
|
108
108
|
`carousel-dot-${t}`
|
|
109
109
|
);
|
|
110
110
|
}) }),
|
|
111
111
|
[
|
|
112
|
-
|
|
112
|
+
s,
|
|
113
113
|
o,
|
|
114
114
|
c,
|
|
115
|
-
V,
|
|
116
115
|
h,
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
B,
|
|
117
|
+
r,
|
|
118
|
+
P
|
|
119
119
|
]
|
|
120
120
|
);
|
|
121
|
-
return
|
|
121
|
+
return s === 0 ? null : /* @__PURE__ */ J(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
124
|
"aria-label": "Carousel",
|
|
125
125
|
role: "button",
|
|
126
126
|
tabIndex: 0,
|
|
127
|
-
...
|
|
128
|
-
ref:
|
|
129
|
-
className:
|
|
127
|
+
...U,
|
|
128
|
+
ref: $,
|
|
129
|
+
className: a(
|
|
130
130
|
void 0,
|
|
131
131
|
{
|
|
132
|
-
"is-active":
|
|
132
|
+
"is-active": T
|
|
133
133
|
},
|
|
134
|
-
|
|
134
|
+
Q
|
|
135
135
|
),
|
|
136
|
-
onMouseEnter:
|
|
137
|
-
onMouseLeave:
|
|
136
|
+
onMouseEnter: ee,
|
|
137
|
+
onMouseLeave: te,
|
|
138
138
|
onKeyDown: (e) => {
|
|
139
|
-
switch (
|
|
139
|
+
switch (x == null || x(e), e.key) {
|
|
140
140
|
case "ArrowLeft":
|
|
141
|
-
|
|
141
|
+
i("NEXT");
|
|
142
142
|
break;
|
|
143
143
|
case "ArrowRight":
|
|
144
|
-
|
|
144
|
+
i("PREV");
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
onMouseDown: (e) => {
|
|
149
|
-
|
|
149
|
+
A == null || A(e), be(e, z), H(!0);
|
|
150
150
|
},
|
|
151
151
|
onMouseUp: (e) => {
|
|
152
|
-
|
|
152
|
+
_ == null || _(e), ue(e, z, w, i), H(!1);
|
|
153
153
|
},
|
|
154
154
|
onTouchEnd: (e) => {
|
|
155
|
-
|
|
155
|
+
C == null || C(e), me(E, j, i);
|
|
156
156
|
},
|
|
157
157
|
onTouchMove: (e) => {
|
|
158
|
-
|
|
158
|
+
g == null || g(e), fe(e, j);
|
|
159
159
|
},
|
|
160
160
|
onTouchStart: (e) => {
|
|
161
|
-
|
|
161
|
+
k == null || k(e), oe(e, E);
|
|
162
162
|
},
|
|
163
163
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ l(
|
|
165
165
|
"div",
|
|
166
166
|
{
|
|
167
|
-
className:
|
|
167
|
+
className: a("wrapper", void 0, Y),
|
|
168
168
|
style: {
|
|
169
|
-
transform:
|
|
169
|
+
transform: re(),
|
|
170
170
|
transition: u ? "transform 0.3s ease-in-out" : "none"
|
|
171
171
|
},
|
|
172
|
-
children: G.map((e, t) => /* @__PURE__ */
|
|
172
|
+
children: G.map((e, t) => /* @__PURE__ */ l(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
|
-
className:
|
|
175
|
+
className: a("item", void 0, Z),
|
|
176
176
|
style: {
|
|
177
|
-
width: `${100 /
|
|
177
|
+
width: `${100 / r}%`
|
|
178
178
|
},
|
|
179
179
|
children: e
|
|
180
180
|
},
|
|
@@ -182,43 +182,43 @@ const l = ne(ce, "Carousel"), be = ({
|
|
|
182
182
|
))
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ l(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
|
-
className:
|
|
189
|
-
"is-hidden": !
|
|
188
|
+
className: a("mobile__tutorial", {
|
|
189
|
+
"is-hidden": !D
|
|
190
190
|
}),
|
|
191
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ l("div", { className: a("mobile__tutorial__animation"), children: /* @__PURE__ */ l(ve, { animationName: "Swipe" }) })
|
|
192
192
|
}
|
|
193
193
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
!!
|
|
196
|
-
|
|
194
|
+
/* @__PURE__ */ J("footer", { className: a("controls", void 0, W), children: [
|
|
195
|
+
!!y && /* @__PURE__ */ l(
|
|
196
|
+
L,
|
|
197
197
|
{
|
|
198
198
|
"aria-label": "Swipe one slide backwards",
|
|
199
|
-
className:
|
|
199
|
+
className: a("button", void 0, V),
|
|
200
200
|
variant: "outlined",
|
|
201
201
|
iconProps: {
|
|
202
202
|
name: "ArrowLeft01Icon",
|
|
203
203
|
size: "md",
|
|
204
204
|
color: "white"
|
|
205
205
|
},
|
|
206
|
-
onClick: () =>
|
|
206
|
+
onClick: () => i(R)
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
209
|
se(),
|
|
210
|
-
!!
|
|
211
|
-
|
|
210
|
+
!!y && /* @__PURE__ */ l(
|
|
211
|
+
L,
|
|
212
212
|
{
|
|
213
213
|
"aria-label": "Swipe one slide forwards",
|
|
214
|
-
className:
|
|
214
|
+
className: a("button", void 0, V),
|
|
215
215
|
variant: "outlined",
|
|
216
216
|
iconProps: {
|
|
217
217
|
name: "ArrowRight01Icon",
|
|
218
218
|
size: "md",
|
|
219
219
|
color: "white"
|
|
220
220
|
},
|
|
221
|
-
onClick: () =>
|
|
221
|
+
onClick: () => i(N)
|
|
222
222
|
}
|
|
223
223
|
)
|
|
224
224
|
] })
|
|
@@ -226,7 +226,7 @@ const l = ne(ce, "Carousel"), be = ({
|
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
228
|
};
|
|
229
|
-
|
|
229
|
+
Ie.displayName = "Carousel";
|
|
230
230
|
export {
|
|
231
|
-
|
|
231
|
+
Ie as Carousel
|
|
232
232
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
3
|
-
import { create as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as f, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { memo as h, useCallback as u } from "react";
|
|
3
|
+
import { create as v } from "../../helpers/bem.js";
|
|
4
|
+
import n from "./Chip.module.scss.js";
|
|
5
|
+
const s = v(n, "Chip"), x = h(
|
|
6
6
|
({
|
|
7
|
-
label:
|
|
7
|
+
label: i,
|
|
8
8
|
icon: o,
|
|
9
|
-
variant:
|
|
10
|
-
color:
|
|
9
|
+
variant: l = "filled",
|
|
10
|
+
color: m = "primary",
|
|
11
11
|
className: c,
|
|
12
|
-
onDelete:
|
|
13
|
-
onClick:
|
|
12
|
+
onDelete: p,
|
|
13
|
+
onClick: a,
|
|
14
14
|
onKeyDown: e
|
|
15
15
|
}) => {
|
|
16
|
-
const b =
|
|
16
|
+
const b = u(
|
|
17
17
|
(t) => {
|
|
18
18
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e == null || e(t));
|
|
19
19
|
},
|
|
20
20
|
[e]
|
|
21
|
-
),
|
|
21
|
+
), r = !!a;
|
|
22
22
|
return (
|
|
23
23
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ f(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
"aria-label": typeof
|
|
28
|
-
role:
|
|
29
|
-
tabIndex:
|
|
30
|
-
className:
|
|
27
|
+
"aria-label": typeof i == "string" ? i : void 0,
|
|
28
|
+
role: r ? "button" : void 0,
|
|
29
|
+
tabIndex: r ? 0 : -1,
|
|
30
|
+
className: s(
|
|
31
31
|
void 0,
|
|
32
|
-
{ [
|
|
32
|
+
{ [l]: !!l, [m]: !!m },
|
|
33
33
|
c
|
|
34
34
|
),
|
|
35
|
-
onClick: (t) =>
|
|
36
|
-
onKeyDown:
|
|
35
|
+
onClick: (t) => r && (a == null ? void 0 : a(t)),
|
|
36
|
+
onKeyDown: r || e ? b : void 0,
|
|
37
37
|
children: [
|
|
38
38
|
o,
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
39
|
+
/* @__PURE__ */ d("span", { className: s("label"), children: i }),
|
|
40
|
+
p && /* @__PURE__ */ d(
|
|
41
41
|
"button",
|
|
42
42
|
{
|
|
43
43
|
"aria-label": "delete",
|
|
44
|
-
className:
|
|
44
|
+
className: s("delete"),
|
|
45
45
|
type: "button",
|
|
46
46
|
onClick: (t) => {
|
|
47
|
-
t.stopPropagation(),
|
|
47
|
+
t.stopPropagation(), p(t);
|
|
48
48
|
},
|
|
49
49
|
children: "× "
|
|
50
50
|
}
|
|
@@ -55,7 +55,7 @@ const m = u(x, "Chip"), j = f(
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
|
-
|
|
58
|
+
x.displayName = "Chip";
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
x as Chip
|
|
61
61
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import y, { isDayjs as
|
|
1
|
+
import { jsx as G } from "react/jsx-runtime";
|
|
2
|
+
import y, { isDayjs as E } from "dayjs";
|
|
3
3
|
import { useRef as H, useState as I, useEffect as J } from "react";
|
|
4
4
|
import { Input as K } from "../input/Input.js";
|
|
5
5
|
const L = ({
|
|
6
6
|
name: D,
|
|
7
|
-
value:
|
|
7
|
+
value: s,
|
|
8
8
|
// Dayjs | null from parent
|
|
9
9
|
onChange: f,
|
|
10
10
|
// (value: Dayjs | null) => void
|
|
@@ -13,60 +13,60 @@ const L = ({
|
|
|
13
13
|
label: S,
|
|
14
14
|
errorText: k,
|
|
15
15
|
helperText: P,
|
|
16
|
-
format:
|
|
16
|
+
format: b = "YYYY-MM-DD",
|
|
17
17
|
minDate: $,
|
|
18
18
|
maxDate: A,
|
|
19
|
-
errorTranslations:
|
|
19
|
+
errorTranslations: c,
|
|
20
20
|
...B
|
|
21
21
|
}) => {
|
|
22
|
-
const N = H(null),
|
|
23
|
-
if (!
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
},
|
|
22
|
+
const N = H(null), i = (t) => {
|
|
23
|
+
if (!t) return null;
|
|
24
|
+
if (E(t)) return t;
|
|
25
|
+
const v = y(t);
|
|
26
|
+
return v.isValid() ? v : null;
|
|
27
|
+
}, Y = i($), x = i(A), [R, p] = I(null), [q, m] = I(k);
|
|
28
28
|
J(() => {
|
|
29
|
-
if (!
|
|
29
|
+
if (!s) {
|
|
30
30
|
p(null), m(void 0), u == null || u(D, void 0);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
34
|
-
p(
|
|
33
|
+
if (E(s))
|
|
34
|
+
p(s), m(void 0), u == null || u(D, void 0);
|
|
35
35
|
else {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
p(
|
|
36
|
+
const t = i(s);
|
|
37
|
+
if (t)
|
|
38
|
+
p(t), m(void 0), u == null || u(D, void 0);
|
|
39
39
|
else {
|
|
40
|
-
const
|
|
41
|
-
p(null), m(
|
|
40
|
+
const v = "Invalid initial date.";
|
|
41
|
+
p(null), m(v), u == null || u(D, v);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
}, [
|
|
45
|
-
const z = (
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
50
|
-
}, F = (
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
44
|
+
}, [s]);
|
|
45
|
+
const z = (t) => {
|
|
46
|
+
if (Y && t.isBefore(Y, "day"))
|
|
47
|
+
return Y.isSame(y(), "day") ? (c == null ? void 0 : c.minDate) ?? "Date cannot be in the past." : (c == null ? void 0 : c.minDate) ?? `Date cannot be before ${Y.format(b)}.`;
|
|
48
|
+
if (x && t.isAfter(x, "day"))
|
|
49
|
+
return x.isSame(y(), "day") ? (c == null ? void 0 : c.maxDate) ?? "Date cannot be in the future." : (c == null ? void 0 : c.maxDate) ?? `Date cannot be after ${x.format(b)}.`;
|
|
50
|
+
}, F = (t) => {
|
|
51
|
+
const v = t.target.value.trim();
|
|
52
|
+
if (!v) {
|
|
53
53
|
p(null), m(void 0), u == null || u(D, void 0), f == null || f(null);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
const
|
|
59
|
-
p(null), m(
|
|
56
|
+
const M = y(v, b, !0);
|
|
57
|
+
if (!M.isValid()) {
|
|
58
|
+
const w = "Invalid date format.";
|
|
59
|
+
p(null), m(w), u == null || u(D, w), f == null || f(null);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
p(null), m(
|
|
62
|
+
const j = z(M);
|
|
63
|
+
if (j !== void 0) {
|
|
64
|
+
p(null), m(j), u == null || u(D, j), f == null || f(null);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
p(
|
|
67
|
+
p(M), m(void 0), u == null || u(D, void 0), f == null || f(M);
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */ G
|
|
69
|
+
return /* @__PURE__ */ G(
|
|
70
70
|
K,
|
|
71
71
|
{
|
|
72
72
|
...B,
|