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