mimir-ui-kit 1.65.2 → 1.65.3
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FocusEventHandler } from 'react';
|
|
2
1
|
import { EDatePickerBorderRadius } from './constants';
|
|
3
2
|
import { TInputProps } from '../Input';
|
|
4
3
|
|
|
@@ -12,9 +11,9 @@ export type TProps = {
|
|
|
12
11
|
*/
|
|
13
12
|
onError?: (e: TDatePickerOnError) => void;
|
|
14
13
|
/**
|
|
15
|
-
*
|
|
14
|
+
* Функция обратного вызова при потере фокуса компонентом
|
|
16
15
|
*/
|
|
17
|
-
onBlur?:
|
|
16
|
+
onBlur?: (e: TDatePickerFocusEvent) => void;
|
|
18
17
|
/**
|
|
19
18
|
* Функция ограничения выбора даты (до какой даты выбор не доступен)
|
|
20
19
|
*/
|
|
@@ -97,6 +96,12 @@ export type TDatePickerOnError = {
|
|
|
97
96
|
name?: string;
|
|
98
97
|
active: boolean;
|
|
99
98
|
};
|
|
99
|
+
export type TDatePickerFocusEvent = {
|
|
100
|
+
target: {
|
|
101
|
+
value: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
100
105
|
export declare const DatePicker: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<{
|
|
101
106
|
/**
|
|
102
107
|
* Функция обратного вызова при изменении значения даты
|
|
@@ -107,9 +112,9 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
|
|
|
107
112
|
*/
|
|
108
113
|
onError?: (e: TDatePickerOnError) => void;
|
|
109
114
|
/**
|
|
110
|
-
*
|
|
115
|
+
* Функция обратного вызова при потере фокуса компонентом
|
|
111
116
|
*/
|
|
112
|
-
onBlur?:
|
|
117
|
+
onBlur?: (e: TDatePickerFocusEvent) => void;
|
|
113
118
|
/**
|
|
114
119
|
* Функция ограничения выбора даты (до какой даты выбор не доступен)
|
|
115
120
|
*/
|
|
@@ -1,146 +1,180 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { months as
|
|
5
|
-
import { DatePickerModal as
|
|
6
|
-
import { MonthPickerModal as
|
|
1
|
+
import { jsxs as et, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as H } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { memo as It, forwardRef as St, useState as $, useEffect as A } from "react";
|
|
4
|
+
import { months as j, EDatePickerBorderRadius as st, MAX_DAY as rt, MAX_MONTH as at, DATE_LENGTH as ot } from "./constants.js";
|
|
5
|
+
import { DatePickerModal as Pt } from "./DatePickerModal.js";
|
|
6
|
+
import { MonthPickerModal as Yt } from "./MonthPickerModal.js";
|
|
7
7
|
import { c as m } from "../../styles.module-DjQdoVeY.js";
|
|
8
|
-
import { formatDatePart as
|
|
9
|
-
import { YearPickerModal as
|
|
10
|
-
import { useClickOutside as
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { formating as
|
|
13
|
-
import { I as
|
|
14
|
-
import { EInputStatus as
|
|
15
|
-
const
|
|
16
|
-
|
|
8
|
+
import { formatDatePart as O } from "./utils.js";
|
|
9
|
+
import { YearPickerModal as xt } from "./YearPickerModal.js";
|
|
10
|
+
import { useClickOutside as Ht } from "../../hooks/useClickOutside/useClickOutside.js";
|
|
11
|
+
import { Icon as it } from "../../icons/Icon.js";
|
|
12
|
+
import { formating as w } from "../../utils/index.js";
|
|
13
|
+
import { I as jt } from "../../Input-JwHUiwVK.js";
|
|
14
|
+
import { EInputStatus as Ot, EInputSize as ct } from "../Input/constants.js";
|
|
15
|
+
const Et = It(
|
|
16
|
+
St(
|
|
17
17
|
({
|
|
18
|
-
size:
|
|
19
|
-
value:
|
|
18
|
+
size: E,
|
|
19
|
+
value: g,
|
|
20
20
|
onChangeValue: r,
|
|
21
21
|
name: d,
|
|
22
|
-
before:
|
|
23
|
-
type:
|
|
24
|
-
dateFormat:
|
|
25
|
-
error:
|
|
26
|
-
onError:
|
|
27
|
-
onBlur:
|
|
28
|
-
validateImmediately:
|
|
29
|
-
variant:
|
|
30
|
-
disabled:
|
|
31
|
-
editable:
|
|
32
|
-
openOnInput:
|
|
33
|
-
sendIntermediateValues:
|
|
34
|
-
disableFuture:
|
|
35
|
-
disablePast:
|
|
36
|
-
disabledDate:
|
|
37
|
-
validRange:
|
|
38
|
-
borderRadius:
|
|
39
|
-
full:
|
|
40
|
-
position:
|
|
41
|
-
isFixed:
|
|
42
|
-
...
|
|
43
|
-
},
|
|
44
|
-
const [
|
|
45
|
-
() =>
|
|
46
|
-
), [
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
before: M,
|
|
23
|
+
type: l = "days",
|
|
24
|
+
dateFormat: T = "full",
|
|
25
|
+
error: L,
|
|
26
|
+
onError: b,
|
|
27
|
+
onBlur: D,
|
|
28
|
+
validateImmediately: K,
|
|
29
|
+
variant: nt,
|
|
30
|
+
disabled: _ = !1,
|
|
31
|
+
editable: I = !1,
|
|
32
|
+
openOnInput: Q = !0,
|
|
33
|
+
sendIntermediateValues: ft = !1,
|
|
34
|
+
disableFuture: Z = !1,
|
|
35
|
+
disablePast: z = !1,
|
|
36
|
+
disabledDate: U,
|
|
37
|
+
validRange: n,
|
|
38
|
+
borderRadius: X = st.All,
|
|
39
|
+
full: lt,
|
|
40
|
+
position: mt,
|
|
41
|
+
isFixed: G = !1,
|
|
42
|
+
...P
|
|
43
|
+
}, dt) => {
|
|
44
|
+
const [k, y] = $(!1), [W, p] = $(l), [f, h] = $(
|
|
45
|
+
() => g && !isNaN(new Date(g).getTime()) ? new Date(g) : void 0
|
|
46
|
+
), [Y, q] = $(L), [yt, S] = $(""), [Dt, v] = $(), [pt, F] = $(!1);
|
|
47
|
+
P.status = !!Y && Ot.Error || P.status, A(() => {
|
|
48
|
+
!k && pt && (D == null || D({
|
|
49
|
+
target: {
|
|
50
|
+
value: f ? w.Date(f, "yyyy-mm-dd") : "",
|
|
51
|
+
name: d
|
|
52
|
+
}
|
|
53
|
+
})), F(k);
|
|
54
|
+
}, [k]);
|
|
55
|
+
const wt = (t) => {
|
|
56
|
+
var s;
|
|
57
|
+
if ((s = t.relatedTarget) != null && s.closest('[data-name="calendar-modal"]')) return;
|
|
58
|
+
F(!1);
|
|
59
|
+
const e = t.target.value.replace(/[^\d]/g, "");
|
|
60
|
+
if (e.length === 0)
|
|
61
|
+
S(""), h(void 0), t.target && (D == null || D({ target: { value: "", name: d } }));
|
|
62
|
+
else {
|
|
63
|
+
const [i, a, c] = [
|
|
64
|
+
O(e.substring(0, 2), rt),
|
|
65
|
+
O(e.substring(2, 4), at),
|
|
66
|
+
e.substring(4, 8)
|
|
67
|
+
];
|
|
68
|
+
let o = c;
|
|
69
|
+
if (c.length === 2 && (o = "20" + c), [i, a, o].filter(Boolean).join("/").length === ot) {
|
|
70
|
+
const tt = parseInt(o), x = /* @__PURE__ */ new Date(
|
|
71
|
+
`${tt}-${a.padStart(2, "0")}-${i.padStart(2, "0")}`
|
|
72
|
+
);
|
|
73
|
+
isNaN(x.getTime()) || (h(x), r == null || r({
|
|
74
|
+
value: w.Date(x, "yyyy-mm-dd"),
|
|
75
|
+
name: d
|
|
76
|
+
}), t.target && (D == null || D({
|
|
77
|
+
target: { value: w.Date(x, "yyyy-mm-dd"), name: d }
|
|
78
|
+
})));
|
|
79
|
+
} else
|
|
80
|
+
t.target && (D == null || D({ target: { value: "Invalid date" } }));
|
|
81
|
+
}
|
|
82
|
+
}, B = () => {
|
|
49
83
|
y(!1);
|
|
50
84
|
};
|
|
51
|
-
|
|
52
|
-
if (!(!
|
|
53
|
-
return window.addEventListener("scroll",
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
|
|
85
|
+
A(() => {
|
|
86
|
+
if (!(!k || !G))
|
|
87
|
+
return window.addEventListener("scroll", B, !0), () => window.removeEventListener("scroll", B, !0);
|
|
88
|
+
}, [k, G]), A(() => {
|
|
89
|
+
q(L);
|
|
90
|
+
}, [L]), A(() => {
|
|
91
|
+
h(
|
|
92
|
+
g && !isNaN(new Date(g).getTime()) ? new Date(g) : void 0
|
|
59
93
|
);
|
|
60
|
-
}, [
|
|
61
|
-
if (
|
|
94
|
+
}, [g]), A(() => {
|
|
95
|
+
if (f && typeof f != "string" && !isNaN(f == null ? void 0 : f.getTime())) {
|
|
62
96
|
let t = "";
|
|
63
|
-
switch (
|
|
97
|
+
switch (T) {
|
|
64
98
|
case "year": {
|
|
65
|
-
t =
|
|
99
|
+
t = f.getFullYear().toString();
|
|
66
100
|
break;
|
|
67
101
|
}
|
|
68
102
|
case "month": {
|
|
69
|
-
const
|
|
70
|
-
t = `${
|
|
103
|
+
const e = j[f.getMonth()], s = f.getFullYear();
|
|
104
|
+
t = `${e} ${s}`;
|
|
71
105
|
break;
|
|
72
106
|
}
|
|
73
107
|
case "full": {
|
|
74
|
-
t =
|
|
108
|
+
t = w.Date(f, "dd/mm/yyyy");
|
|
75
109
|
break;
|
|
76
110
|
}
|
|
77
111
|
default: {
|
|
78
|
-
t =
|
|
112
|
+
t = w.Date(f, "dd/mm/yyyy");
|
|
79
113
|
break;
|
|
80
114
|
}
|
|
81
115
|
}
|
|
82
|
-
|
|
116
|
+
S(t);
|
|
83
117
|
} else
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
isActive:
|
|
118
|
+
S("");
|
|
119
|
+
}, [f, T]);
|
|
120
|
+
const C = g && new Date(g).getTime;
|
|
121
|
+
A(() => {
|
|
122
|
+
K && (C ? (q(!1), b == null || b({ name: d, active: !1 })) : (q(!0), b == null || b({ name: d, active: !0 })));
|
|
123
|
+
}, [K, d, C]), Ht({
|
|
124
|
+
isActive: k,
|
|
91
125
|
setActive: (t) => {
|
|
92
|
-
y(t),
|
|
126
|
+
y(t), p(l), t || v(void 0);
|
|
93
127
|
},
|
|
94
128
|
className: m["calendar-block"]
|
|
95
129
|
});
|
|
96
|
-
const
|
|
97
|
-
!
|
|
98
|
-
},
|
|
99
|
-
const
|
|
100
|
-
if (t.setHours(0, 0, 0, 0),
|
|
130
|
+
const ut = () => {
|
|
131
|
+
!_ && (Q || !I) && y(!0);
|
|
132
|
+
}, R = (t) => {
|
|
133
|
+
const e = t.getTime();
|
|
134
|
+
if (t.setHours(0, 0, 0, 0), M && (typeof M == "string" ? new Date(M) : M).getTime() > e)
|
|
101
135
|
return !1;
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
136
|
+
if (Z) {
|
|
137
|
+
const s = /* @__PURE__ */ new Date();
|
|
138
|
+
if (s.setHours(0, 0, 0, 0), t.getTime() > s.getTime()) return !1;
|
|
105
139
|
}
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
140
|
+
if (z) {
|
|
141
|
+
const s = /* @__PURE__ */ new Date();
|
|
142
|
+
if (s.setHours(0, 0, 0, 0), e < s.getTime()) return !1;
|
|
109
143
|
}
|
|
110
|
-
if (
|
|
111
|
-
if (
|
|
112
|
-
let
|
|
113
|
-
typeof
|
|
114
|
-
new Date(
|
|
115
|
-
typeof
|
|
116
|
-
] :
|
|
117
|
-
|
|
118
|
-
typeof
|
|
144
|
+
if (U && U(t)) return !1;
|
|
145
|
+
if (n) {
|
|
146
|
+
let s;
|
|
147
|
+
typeof n[0] == "string" ? s = [
|
|
148
|
+
new Date(n[0]),
|
|
149
|
+
typeof n[1] == "string" ? new Date(n[1]) : n[1]
|
|
150
|
+
] : s = [
|
|
151
|
+
n[0],
|
|
152
|
+
typeof n[1] == "string" ? new Date(n[1]) : n[1]
|
|
119
153
|
];
|
|
120
|
-
const [
|
|
121
|
-
if (
|
|
154
|
+
const [i, a] = s, c = new Date(i), o = new Date(a);
|
|
155
|
+
if (c.setHours(0, 0, 0, 0), o.setHours(23, 59, 59, 999), t < c || t > o) return !1;
|
|
122
156
|
}
|
|
123
157
|
return !0;
|
|
124
|
-
},
|
|
158
|
+
}, Nt = (t) => {
|
|
125
159
|
if (!isNaN(t.getTime())) {
|
|
126
|
-
|
|
160
|
+
h(t), v(void 0);
|
|
127
161
|
let e = "";
|
|
128
|
-
switch (
|
|
162
|
+
switch (T) {
|
|
129
163
|
case "year": {
|
|
130
164
|
e = t.getFullYear().toString();
|
|
131
165
|
break;
|
|
132
166
|
}
|
|
133
167
|
case "month": {
|
|
134
|
-
const
|
|
135
|
-
e = `${
|
|
168
|
+
const s = j[t.getMonth()], i = t.getFullYear();
|
|
169
|
+
e = `${s} ${i}`;
|
|
136
170
|
break;
|
|
137
171
|
}
|
|
138
172
|
case "full": {
|
|
139
|
-
e =
|
|
173
|
+
e = w.Date(t, "yyyy-mm-dd");
|
|
140
174
|
break;
|
|
141
175
|
}
|
|
142
176
|
default: {
|
|
143
|
-
e =
|
|
177
|
+
e = w.Date(t, "yyyy-mm-dd");
|
|
144
178
|
break;
|
|
145
179
|
}
|
|
146
180
|
}
|
|
@@ -149,232 +183,208 @@ const xt = ht(
|
|
|
149
183
|
name: d
|
|
150
184
|
});
|
|
151
185
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
case "month": {
|
|
160
|
-
const e = S[t.getMonth()], c = t.getFullYear();
|
|
161
|
-
s = `${e} ${c}`;
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case "full": {
|
|
165
|
-
s = p.Date(t, "yyyy-mm-dd");
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
default: {
|
|
169
|
-
s = p.Date(t, "yyyy-mm-dd");
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
r == null || r({
|
|
174
|
-
value: s,
|
|
175
|
-
name: d
|
|
176
|
-
});
|
|
177
|
-
}, mt = (t) => {
|
|
178
|
-
const s = i || /* @__PURE__ */ new Date(), e = s.getDate(), c = s.getMonth() + 1, o = new Date(t, c - 1, e);
|
|
179
|
-
if (o.getFullYear() === t && o.getMonth() === c - 1 && o.getDate() === e && Z(o)) {
|
|
180
|
-
M(o), $(void 0);
|
|
181
|
-
let l = "";
|
|
182
|
-
switch (N) {
|
|
186
|
+
W === "years" && (l === "years" ? (y(!1), p(l)) : p("months")), W === "months" && (l === "months" ? (y(!1), p(l)) : p("days")), h(t);
|
|
187
|
+
}, gt = (t) => {
|
|
188
|
+
const e = f || /* @__PURE__ */ new Date(), s = e.getDate(), i = e.getMonth() + 1, a = new Date(t, i - 1, s);
|
|
189
|
+
if (a.getFullYear() === t && a.getMonth() === i - 1 && a.getDate() === s && R(a)) {
|
|
190
|
+
h(a), v(void 0);
|
|
191
|
+
let c = "";
|
|
192
|
+
switch (T) {
|
|
183
193
|
case "year": {
|
|
184
|
-
|
|
194
|
+
c = t.toString();
|
|
185
195
|
break;
|
|
186
196
|
}
|
|
187
197
|
case "month": {
|
|
188
|
-
|
|
198
|
+
c = `${j[i - 1]} ${t}`;
|
|
189
199
|
break;
|
|
190
200
|
}
|
|
191
201
|
case "full": {
|
|
192
|
-
|
|
202
|
+
c = w.Date(a, "yyyy-mm-dd");
|
|
193
203
|
break;
|
|
194
204
|
}
|
|
195
205
|
default: {
|
|
196
|
-
|
|
206
|
+
c = w.Date(a, "yyyy-mm-dd");
|
|
197
207
|
break;
|
|
198
208
|
}
|
|
199
209
|
}
|
|
200
210
|
if (r == null || r({
|
|
201
|
-
value:
|
|
211
|
+
value: c,
|
|
202
212
|
name: d
|
|
203
|
-
}),
|
|
204
|
-
y(!1),
|
|
213
|
+
}), l === "years") {
|
|
214
|
+
y(!1), p(l);
|
|
205
215
|
return;
|
|
206
216
|
}
|
|
207
217
|
} else
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
let
|
|
215
|
-
switch (
|
|
218
|
+
v(new Date(t, i - 1, 1));
|
|
219
|
+
l === "years" ? (y(!1), p(l)) : p("months");
|
|
220
|
+
}, kt = (t, e) => {
|
|
221
|
+
const i = (f || /* @__PURE__ */ new Date()).getDate(), a = new Date(t, e, 0).getDate(), c = Math.min(i, a), o = new Date(t, e - 1, c);
|
|
222
|
+
if (o.getFullYear() === t && o.getMonth() === e - 1 && o.getDate() === c && R(o)) {
|
|
223
|
+
h(o), v(void 0);
|
|
224
|
+
let N = "";
|
|
225
|
+
switch (T) {
|
|
216
226
|
case "year": {
|
|
217
|
-
|
|
227
|
+
N = t.toString();
|
|
218
228
|
break;
|
|
219
229
|
}
|
|
220
230
|
case "month": {
|
|
221
|
-
|
|
231
|
+
N = `${j[e - 1]} ${t}`;
|
|
222
232
|
break;
|
|
223
233
|
}
|
|
224
234
|
case "full": {
|
|
225
|
-
|
|
235
|
+
N = w.Date(o, "yyyy-mm-dd");
|
|
226
236
|
break;
|
|
227
237
|
}
|
|
228
238
|
default: {
|
|
229
|
-
|
|
239
|
+
N = w.Date(o, "yyyy-mm-dd");
|
|
230
240
|
break;
|
|
231
241
|
}
|
|
232
242
|
}
|
|
233
243
|
if (r == null || r({
|
|
234
|
-
value:
|
|
244
|
+
value: N,
|
|
235
245
|
name: d
|
|
236
|
-
}),
|
|
237
|
-
y(!1),
|
|
246
|
+
}), l === "months") {
|
|
247
|
+
y(!1), p(l);
|
|
238
248
|
return;
|
|
239
249
|
}
|
|
240
250
|
} else
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
if (
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
|
|
251
|
+
v(new Date(t, e - 1, 1));
|
|
252
|
+
l === "months" ? (y(!1), p(l)) : p("days");
|
|
253
|
+
}, ht = (t) => {
|
|
254
|
+
if (I || t.target.value === "") {
|
|
255
|
+
const e = t.target.value.replace(/[^\d]/g, "");
|
|
256
|
+
if (e.length === 0)
|
|
257
|
+
S(""), h(void 0), y(!1), r == null || r({ value: "", name: d });
|
|
248
258
|
else {
|
|
249
|
-
const [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
],
|
|
254
|
-
if (
|
|
255
|
-
const
|
|
259
|
+
const [s, i, a] = [
|
|
260
|
+
O(e.substring(0, 2), rt),
|
|
261
|
+
O(e.substring(2, 4), at),
|
|
262
|
+
e.substring(4, 8)
|
|
263
|
+
], c = [s, i, a].filter(Boolean).join("/");
|
|
264
|
+
if (S(c), ft) {
|
|
265
|
+
const o = a ? `${a}-${i || "00"}-${s || "00"}` : [s, i, a].filter(Boolean).join("-");
|
|
256
266
|
r == null || r({
|
|
257
|
-
value:
|
|
267
|
+
value: o,
|
|
258
268
|
name: d
|
|
259
269
|
});
|
|
260
270
|
}
|
|
261
|
-
if (
|
|
262
|
-
const
|
|
263
|
-
`${
|
|
271
|
+
if (c.length === ot) {
|
|
272
|
+
const o = parseInt(a), N = /* @__PURE__ */ new Date(
|
|
273
|
+
`${o}-${i.padStart(2, "0")}-${s.padStart(2, "0")}`
|
|
264
274
|
);
|
|
265
|
-
isNaN(
|
|
266
|
-
value:
|
|
275
|
+
isNaN(N.getTime()) || (h(N), r == null || r({
|
|
276
|
+
value: w.Date(N, "yyyy-mm-dd"),
|
|
267
277
|
name: d
|
|
268
278
|
}));
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
281
|
}
|
|
272
|
-
},
|
|
282
|
+
}, Mt = H(
|
|
273
283
|
m.wrapper,
|
|
274
|
-
|
|
275
|
-
),
|
|
276
|
-
let
|
|
277
|
-
if (
|
|
278
|
-
let t,
|
|
279
|
-
typeof
|
|
284
|
+
k && !I && m.active
|
|
285
|
+
), Tt = H(m.input, m.inputBorderControl);
|
|
286
|
+
let V;
|
|
287
|
+
if (n) {
|
|
288
|
+
let t, e;
|
|
289
|
+
typeof n[0] == "string" ? t = new Date(n[0]) : t = n[0], typeof n[1] == "string" ? e = new Date(n[1]) : e = n[1], V = [t, e];
|
|
280
290
|
}
|
|
281
|
-
const
|
|
282
|
-
onChangeValue:
|
|
283
|
-
date:
|
|
284
|
-
selectedDate:
|
|
285
|
-
before: typeof
|
|
286
|
-
onChangeType:
|
|
291
|
+
const J = {
|
|
292
|
+
onChangeValue: Nt,
|
|
293
|
+
date: Dt || f || /* @__PURE__ */ new Date(),
|
|
294
|
+
selectedDate: f,
|
|
295
|
+
before: typeof M == "string" ? new Date(M) : M,
|
|
296
|
+
onChangeType: p,
|
|
287
297
|
setIsActive: y,
|
|
288
|
-
disableFuture:
|
|
289
|
-
disablePast:
|
|
290
|
-
disabledDate:
|
|
291
|
-
validRange:
|
|
292
|
-
dateFormat:
|
|
293
|
-
position:
|
|
294
|
-
isFixed:
|
|
295
|
-
},
|
|
296
|
-
...
|
|
297
|
-
onChangeMonth:
|
|
298
|
-
dateFormat:
|
|
299
|
-
},
|
|
300
|
-
...
|
|
301
|
-
onChangeYear:
|
|
302
|
-
},
|
|
303
|
-
switch (
|
|
298
|
+
disableFuture: Z,
|
|
299
|
+
disablePast: z,
|
|
300
|
+
disabledDate: U,
|
|
301
|
+
validRange: V,
|
|
302
|
+
dateFormat: T,
|
|
303
|
+
position: mt,
|
|
304
|
+
isFixed: G
|
|
305
|
+
}, $t = {
|
|
306
|
+
...J,
|
|
307
|
+
onChangeMonth: kt,
|
|
308
|
+
dateFormat: T
|
|
309
|
+
}, bt = {
|
|
310
|
+
...J,
|
|
311
|
+
onChangeYear: gt
|
|
312
|
+
}, vt = (() => {
|
|
313
|
+
switch (W) {
|
|
304
314
|
case "months":
|
|
305
|
-
return () => /* @__PURE__ */
|
|
315
|
+
return () => /* @__PURE__ */ u(Yt, { ...$t });
|
|
306
316
|
case "years":
|
|
307
|
-
return () => /* @__PURE__ */
|
|
317
|
+
return () => /* @__PURE__ */ u(xt, { ...bt });
|
|
308
318
|
default:
|
|
309
|
-
return () => /* @__PURE__ */
|
|
319
|
+
return () => /* @__PURE__ */ u(Pt, { ...J });
|
|
310
320
|
}
|
|
311
|
-
})(),
|
|
312
|
-
|
|
313
|
-
}, className: m["icon-button"], children: t ? /* @__PURE__ */
|
|
314
|
-
|
|
321
|
+
})(), At = ({ isActive: t }) => /* @__PURE__ */ u("button", { onClick: (s) => {
|
|
322
|
+
s.stopPropagation(), _ || y(!t);
|
|
323
|
+
}, className: m["icon-button"], children: t ? /* @__PURE__ */ u(
|
|
324
|
+
it,
|
|
315
325
|
{
|
|
316
|
-
iconName:
|
|
326
|
+
iconName: E === ct.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
|
|
317
327
|
}
|
|
318
|
-
) : /* @__PURE__ */
|
|
319
|
-
|
|
328
|
+
) : /* @__PURE__ */ u(
|
|
329
|
+
it,
|
|
320
330
|
{
|
|
321
|
-
iconName:
|
|
331
|
+
iconName: E === ct.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
|
|
322
332
|
}
|
|
323
333
|
) });
|
|
324
|
-
return /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ et(
|
|
325
335
|
"div",
|
|
326
336
|
{
|
|
327
|
-
className:
|
|
328
|
-
[m.full]:
|
|
337
|
+
className: H(m["input-field-group-datePicker"], {
|
|
338
|
+
[m.full]: lt
|
|
329
339
|
}),
|
|
330
340
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ et("div", { className: Mt, "data-disabled": _, children: [
|
|
342
|
+
/* @__PURE__ */ u(
|
|
333
343
|
"div",
|
|
334
344
|
{
|
|
335
345
|
role: "button",
|
|
336
|
-
"data-status":
|
|
337
|
-
className:
|
|
338
|
-
[m.editable]:
|
|
339
|
-
[m[`border-radius-${
|
|
346
|
+
"data-status": P.status,
|
|
347
|
+
className: H(m["date-wrapper"], {
|
|
348
|
+
[m.editable]: I,
|
|
349
|
+
[m[`border-radius-${X}`]]: X !== st.All
|
|
340
350
|
}),
|
|
341
|
-
onClick:
|
|
342
|
-
children: /* @__PURE__ */
|
|
343
|
-
|
|
351
|
+
onClick: ut,
|
|
352
|
+
children: /* @__PURE__ */ u(
|
|
353
|
+
jt,
|
|
344
354
|
{
|
|
345
|
-
ref:
|
|
346
|
-
className:
|
|
355
|
+
ref: dt,
|
|
356
|
+
className: Tt,
|
|
347
357
|
wrapperClassName: m["input-wrapper"],
|
|
348
|
-
size:
|
|
358
|
+
size: E,
|
|
349
359
|
type: "text",
|
|
350
|
-
variant:
|
|
351
|
-
value:
|
|
352
|
-
onChange:
|
|
360
|
+
variant: nt,
|
|
361
|
+
value: yt,
|
|
362
|
+
onChange: ht,
|
|
353
363
|
rightAddon: {
|
|
354
364
|
addonType: "react-node",
|
|
355
|
-
addonContent: /* @__PURE__ */
|
|
365
|
+
addonContent: /* @__PURE__ */ u(At, { isActive: k })
|
|
356
366
|
},
|
|
357
367
|
rightSlotClassName: m["right-slot"],
|
|
358
368
|
onFocus: () => {
|
|
359
|
-
|
|
369
|
+
Q && !I && y(!0);
|
|
360
370
|
},
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
371
|
+
onBlur: wt,
|
|
372
|
+
borderRadius: X,
|
|
373
|
+
...P
|
|
364
374
|
}
|
|
365
375
|
)
|
|
366
376
|
}
|
|
367
377
|
),
|
|
368
|
-
|
|
378
|
+
k && /* @__PURE__ */ u(vt, {})
|
|
369
379
|
] }),
|
|
370
|
-
|
|
380
|
+
Y && typeof Y == "string" && /* @__PURE__ */ u("div", { className: m.textError, children: Y })
|
|
371
381
|
]
|
|
372
382
|
}
|
|
373
383
|
);
|
|
374
384
|
}
|
|
375
385
|
)
|
|
376
386
|
);
|
|
377
|
-
|
|
387
|
+
Et.displayName = "DatePicker";
|
|
378
388
|
export {
|
|
379
|
-
|
|
389
|
+
Et as DatePicker
|
|
380
390
|
};
|