mimir-ui-kit 1.43.28 → 1.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Input-IzZ6B9kw.js +232 -0
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/CopyText.css +1 -0
- package/dist/assets/Counter.css +1 -0
- package/dist/assets/DropdownSelect.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +41 -37
- package/dist/components/Avatar/constants.d.ts +5 -0
- package/dist/components/Avatar/constants.js +3 -2
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +5 -4
- package/dist/components/Avatar/types.d.ts +3 -1
- package/dist/components/Chip/Chip.d.ts +5 -1
- package/dist/components/Chip/Chip.js +45 -36
- package/dist/components/Chip/constants.d.ts +5 -1
- package/dist/components/Chip/constants.js +3 -3
- package/dist/components/CopyText/CopyText.d.ts +3 -0
- package/dist/components/CopyText/CopyText.js +96 -0
- package/dist/components/CopyText/index.d.ts +2 -0
- package/dist/components/CopyText/index.js +4 -0
- package/dist/components/CopyText/types.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.d.ts +19 -0
- package/dist/components/DatePicker/DatePicker.js +149 -134
- package/dist/components/DatePicker/DatePickerModal.js +1 -1
- package/dist/components/DatePicker/MonthPickerModal.js +1 -1
- package/dist/components/DatePicker/YearPickerModal.js +1 -1
- package/dist/components/DatePicker/constants.d.ts +6 -0
- package/dist/components/DatePicker/constants.js +13 -12
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.js +3 -1
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +3 -0
- package/dist/components/DropdownSelect/DropdownSelect.js +115 -0
- package/dist/components/DropdownSelect/constants.d.ts +5 -0
- package/dist/components/DropdownSelect/constants.js +4 -0
- package/dist/components/DropdownSelect/index.d.ts +3 -0
- package/dist/components/DropdownSelect/index.js +6 -0
- package/dist/components/DropdownSelect/types.d.ts +56 -0
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/constants.d.ts +6 -0
- package/dist/components/Input/constants.js +4 -3
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +1 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/Pagination/Counter/Counter.d.ts +9 -0
- package/dist/components/Pagination/Counter/Counter.js +28 -0
- package/dist/components/Pagination/Pagination.d.ts +17 -0
- package/dist/components/Pagination/Pagination.js +167 -126
- package/dist/components/Pagination/constants.d.ts +6 -0
- package/dist/components/Pagination/constants.js +5 -3
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +4 -2
- package/dist/components/SelectSearch/SelectSearch.d.ts +2 -1
- package/dist/components/SelectSearch/SelectSearch.js +193 -187
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +7 -5
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +6 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TabTrail/TabTrail.d.ts +16 -0
- package/dist/components/TabTrail/TabTrail.js +257 -220
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +8 -4
- package/dist/components/index.js +178 -166
- package/dist/index.js +203 -191
- package/dist/styles.module-B3lX7mJq.js +31 -0
- package/package.json +1 -1
- package/dist/Input-BU_6U1CW.js +0 -227
- package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,52 +1,54 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { memo as
|
4
|
-
import { months as
|
5
|
-
import { DatePickerModal as
|
6
|
-
import { MonthPickerModal as
|
7
|
-
import { c as
|
8
|
-
import { formatDatePart as
|
9
|
-
import { YearPickerModal as
|
10
|
-
import { useClickOutside as
|
11
|
-
import { Icon as
|
1
|
+
import { jsxs as z, jsx as D } from "react/jsx-runtime";
|
2
|
+
import { c as H } from "../../index-DIxK0V-G.js";
|
3
|
+
import { memo as kt, forwardRef as Nt, useState as $, useEffect as j } from "react";
|
4
|
+
import { months as A, EDatePickerBorderRadius as C, MAX_DAY as ut, MAX_MONTH as ht, DATE_LENGTH as Mt } from "./constants.js";
|
5
|
+
import { DatePickerModal as gt } from "./DatePickerModal.js";
|
6
|
+
import { MonthPickerModal as Tt } from "./MonthPickerModal.js";
|
7
|
+
import { c as l } from "../../styles.module-B3lX7mJq.js";
|
8
|
+
import { formatDatePart as R } from "./utils.js";
|
9
|
+
import { YearPickerModal as $t } from "./YearPickerModal.js";
|
10
|
+
import { useClickOutside as bt } from "../../hooks/useClickOutside/useClickOutside.js";
|
11
|
+
import { Icon as B } from "../../icons/Icon.js";
|
12
12
|
import { formating as p } from "../../utils/index.js";
|
13
|
-
import { I as
|
14
|
-
import { EInputStatus as
|
15
|
-
const
|
16
|
-
|
13
|
+
import { I as At } from "../../Input-IzZ6B9kw.js";
|
14
|
+
import { EInputStatus as Pt, EInputSize as V } from "../Input/constants.js";
|
15
|
+
const St = kt(
|
16
|
+
Nt(
|
17
17
|
({
|
18
|
-
size:
|
18
|
+
size: v,
|
19
19
|
value: k,
|
20
20
|
onChangeValue: a,
|
21
21
|
name: w,
|
22
22
|
before: h,
|
23
23
|
type: n = "days",
|
24
24
|
dateFormat: N = "full",
|
25
|
-
error:
|
25
|
+
error: _,
|
26
26
|
onError: M,
|
27
27
|
onBlur: m,
|
28
28
|
validateImmediately: L,
|
29
|
-
variant:
|
30
|
-
disabled:
|
31
|
-
editable:
|
29
|
+
variant: tt,
|
30
|
+
disabled: O = !1,
|
31
|
+
editable: b = !1,
|
32
32
|
openOnInput: W = !0,
|
33
|
-
sendIntermediateValues:
|
33
|
+
sendIntermediateValues: et = !1,
|
34
34
|
disableFuture: q = !1,
|
35
|
-
disablePast:
|
36
|
-
disabledDate:
|
35
|
+
disablePast: J = !1,
|
36
|
+
disabledDate: U,
|
37
37
|
validRange: o,
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
borderRadius: X = C.All,
|
39
|
+
full: st,
|
40
|
+
...P
|
41
|
+
}, rt) => {
|
42
|
+
const [S, d] = $(!1), [E, y] = $(n), [f, g] = $(
|
41
43
|
() => k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
|
42
|
-
), [
|
43
|
-
|
44
|
-
|
45
|
-
}, [
|
44
|
+
), [Y, F] = $(_), [at, I] = $(""), [ct, T] = $();
|
45
|
+
P.status = !!Y && Pt.Error || P.status, j(() => {
|
46
|
+
F(_);
|
47
|
+
}, [_]), j(() => {
|
46
48
|
g(
|
47
49
|
k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
|
48
50
|
);
|
49
|
-
}, [k]),
|
51
|
+
}, [k]), j(() => {
|
50
52
|
if (f && typeof f != "string" && !isNaN(f == null ? void 0 : f.getTime())) {
|
51
53
|
let t = "";
|
52
54
|
switch (N) {
|
@@ -55,7 +57,7 @@ const $t = dt(
|
|
55
57
|
break;
|
56
58
|
}
|
57
59
|
case "month": {
|
58
|
-
const s =
|
60
|
+
const s = A[f.getMonth()], e = f.getFullYear();
|
59
61
|
t = `${s} ${e}`;
|
60
62
|
break;
|
61
63
|
}
|
@@ -68,23 +70,23 @@ const $t = dt(
|
|
68
70
|
break;
|
69
71
|
}
|
70
72
|
}
|
71
|
-
|
73
|
+
I(t);
|
72
74
|
} else
|
73
|
-
|
75
|
+
I("");
|
74
76
|
}, [f, N]);
|
75
|
-
const
|
76
|
-
|
77
|
-
L && (
|
78
|
-
}, [L, w,
|
79
|
-
isActive:
|
77
|
+
const K = k && new Date(k).getTime;
|
78
|
+
j(() => {
|
79
|
+
L && (K ? (F(!1), M == null || M({ name: w, active: !1 })) : (F(!0), M == null || M({ name: w, active: !0 })));
|
80
|
+
}, [L, w, K]), bt({
|
81
|
+
isActive: S,
|
80
82
|
setActive: (t) => {
|
81
|
-
d(t),
|
83
|
+
d(t), y(n), t || T(void 0);
|
82
84
|
},
|
83
|
-
className:
|
85
|
+
className: l["calendar-block"]
|
84
86
|
});
|
85
|
-
const
|
86
|
-
!
|
87
|
-
},
|
87
|
+
const it = () => {
|
88
|
+
!O && (W || !b) && d(!0);
|
89
|
+
}, Q = (t) => {
|
88
90
|
const s = t.getTime();
|
89
91
|
if (t.setHours(0, 0, 0, 0), h && (typeof h == "string" ? new Date(h) : h).getTime() > s)
|
90
92
|
return !1;
|
@@ -92,11 +94,11 @@ const $t = dt(
|
|
92
94
|
const e = /* @__PURE__ */ new Date();
|
93
95
|
if (e.setHours(0, 0, 0, 0), t.getTime() > e.getTime()) return !1;
|
94
96
|
}
|
95
|
-
if (
|
97
|
+
if (J) {
|
96
98
|
const e = /* @__PURE__ */ new Date();
|
97
99
|
if (e.setHours(0, 0, 0, 0), s < e.getTime()) return !1;
|
98
100
|
}
|
99
|
-
if (
|
101
|
+
if (U && U(t)) return !1;
|
100
102
|
if (o) {
|
101
103
|
let e;
|
102
104
|
typeof o[0] == "string" ? e = [
|
@@ -110,7 +112,7 @@ const $t = dt(
|
|
110
112
|
if (c.setHours(0, 0, 0, 0), u.setHours(23, 59, 59, 999), t < c || t > u) return !1;
|
111
113
|
}
|
112
114
|
return !0;
|
113
|
-
},
|
115
|
+
}, ot = (t) => {
|
114
116
|
if (!isNaN(t.getTime())) {
|
115
117
|
g(t), T(void 0);
|
116
118
|
let e = "";
|
@@ -120,7 +122,7 @@ const $t = dt(
|
|
120
122
|
break;
|
121
123
|
}
|
122
124
|
case "month": {
|
123
|
-
const i =
|
125
|
+
const i = A[t.getMonth()], r = t.getFullYear();
|
124
126
|
e = `${i} ${r}`;
|
125
127
|
break;
|
126
128
|
}
|
@@ -138,7 +140,7 @@ const $t = dt(
|
|
138
140
|
name: w
|
139
141
|
});
|
140
142
|
}
|
141
|
-
|
143
|
+
E === "years" && (n === "years" ? (d(!1), y(n)) : y("months")), E === "months" && (n === "months" ? (d(!1), y(n)) : y("days")), g(t);
|
142
144
|
let s = "";
|
143
145
|
switch (N) {
|
144
146
|
case "year": {
|
@@ -146,7 +148,7 @@ const $t = dt(
|
|
146
148
|
break;
|
147
149
|
}
|
148
150
|
case "month": {
|
149
|
-
const e =
|
151
|
+
const e = A[t.getMonth()], i = t.getFullYear();
|
150
152
|
s = `${e} ${i}`;
|
151
153
|
break;
|
152
154
|
}
|
@@ -163,9 +165,9 @@ const $t = dt(
|
|
163
165
|
value: s,
|
164
166
|
name: w
|
165
167
|
}), m == null || m(s);
|
166
|
-
},
|
168
|
+
}, mt = (t) => {
|
167
169
|
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 &&
|
170
|
+
if (r.getFullYear() === t && r.getMonth() === i - 1 && r.getDate() === e && Q(r)) {
|
169
171
|
g(r), T(void 0);
|
170
172
|
let c = "";
|
171
173
|
switch (N) {
|
@@ -174,7 +176,7 @@ const $t = dt(
|
|
174
176
|
break;
|
175
177
|
}
|
176
178
|
case "month": {
|
177
|
-
c = `${
|
179
|
+
c = `${A[i - 1]} ${t}`;
|
178
180
|
break;
|
179
181
|
}
|
180
182
|
case "full": {
|
@@ -190,15 +192,15 @@ const $t = dt(
|
|
190
192
|
value: c,
|
191
193
|
name: w
|
192
194
|
}), m == null || m(c), n === "years") {
|
193
|
-
d(!1),
|
195
|
+
d(!1), y(n);
|
194
196
|
return;
|
195
197
|
}
|
196
198
|
} else
|
197
199
|
T(new Date(t, i - 1, 1));
|
198
|
-
n === "years" ? (d(!1),
|
199
|
-
},
|
200
|
+
n === "years" ? (d(!1), y(n)) : y("months");
|
201
|
+
}, ft = (t, s) => {
|
200
202
|
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 &&
|
203
|
+
if (r.getFullYear() === t && r.getMonth() === s - 1 && r.getDate() === i && Q(r)) {
|
202
204
|
g(r), T(void 0);
|
203
205
|
let c = "";
|
204
206
|
switch (N) {
|
@@ -207,7 +209,7 @@ const $t = dt(
|
|
207
209
|
break;
|
208
210
|
}
|
209
211
|
case "month": {
|
210
|
-
c = `${
|
212
|
+
c = `${A[s - 1]} ${t}`;
|
211
213
|
break;
|
212
214
|
}
|
213
215
|
case "full": {
|
@@ -223,31 +225,31 @@ const $t = dt(
|
|
223
225
|
value: c,
|
224
226
|
name: w
|
225
227
|
}), m == null || m(c), n === "months") {
|
226
|
-
d(!1),
|
228
|
+
d(!1), y(n);
|
227
229
|
return;
|
228
230
|
}
|
229
231
|
} else
|
230
232
|
T(new Date(t, s - 1, 1));
|
231
|
-
n === "months" ? (d(!1),
|
232
|
-
},
|
233
|
-
if (
|
233
|
+
n === "months" ? (d(!1), y(n)) : y("days");
|
234
|
+
}, nt = (t) => {
|
235
|
+
if (b) {
|
234
236
|
const s = t.target.value.replace(/[^\d]/g, "");
|
235
237
|
if (s.length === 0)
|
236
|
-
|
238
|
+
I(""), a == null || a({ value: "", name: w }), m == null || m("");
|
237
239
|
else {
|
238
240
|
const [e, i, r] = [
|
239
|
-
|
240
|
-
|
241
|
+
R(s.substring(0, 2), ut),
|
242
|
+
R(s.substring(2, 4), ht),
|
241
243
|
s.substring(4, 8)
|
242
244
|
], c = [e, i, r].filter(Boolean).join("/");
|
243
|
-
if (
|
245
|
+
if (I(c), et) {
|
244
246
|
const u = r ? `${r}-${i || "00"}-${e || "00"}` : [e, i, r].filter(Boolean).join("-");
|
245
247
|
a == null || a({
|
246
248
|
value: u,
|
247
249
|
name: w
|
248
250
|
});
|
249
251
|
}
|
250
|
-
if (c.length ===
|
252
|
+
if (c.length === Mt) {
|
251
253
|
const u = parseInt(r), x = /* @__PURE__ */ new Date(
|
252
254
|
`${u}-${i.padStart(2, "0")}-${e.padStart(2, "0")}`
|
253
255
|
);
|
@@ -258,96 +260,109 @@ const $t = dt(
|
|
258
260
|
}
|
259
261
|
}
|
260
262
|
}
|
261
|
-
},
|
262
|
-
|
263
|
+
}, lt = H(
|
264
|
+
l.wrapper,
|
265
|
+
S && !b && l.active
|
266
|
+
), yt = H(l.input, l.inputBorderControl);
|
267
|
+
let Z;
|
263
268
|
if (o) {
|
264
269
|
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],
|
270
|
+
typeof o[0] == "string" ? t = new Date(o[0]) : t = o[0], typeof o[1] == "string" ? s = new Date(o[1]) : s = o[1], Z = [t, s];
|
266
271
|
}
|
267
|
-
const
|
268
|
-
onChangeValue:
|
269
|
-
date:
|
272
|
+
const G = {
|
273
|
+
onChangeValue: ot,
|
274
|
+
date: ct || f || /* @__PURE__ */ new Date(),
|
270
275
|
selectedDate: f,
|
271
276
|
before: typeof h == "string" ? new Date(h) : h,
|
272
|
-
onChangeType:
|
277
|
+
onChangeType: y,
|
273
278
|
setIsActive: d,
|
274
279
|
disableFuture: q,
|
275
|
-
disablePast:
|
276
|
-
disabledDate:
|
277
|
-
validRange:
|
280
|
+
disablePast: J,
|
281
|
+
disabledDate: U,
|
282
|
+
validRange: Z,
|
278
283
|
dateFormat: N
|
279
|
-
},
|
280
|
-
...
|
281
|
-
onChangeMonth:
|
284
|
+
}, pt = {
|
285
|
+
...G,
|
286
|
+
onChangeMonth: ft,
|
282
287
|
dateFormat: N
|
283
|
-
},
|
284
|
-
...
|
285
|
-
onChangeYear:
|
286
|
-
},
|
287
|
-
switch (
|
288
|
+
}, dt = {
|
289
|
+
...G,
|
290
|
+
onChangeYear: mt
|
291
|
+
}, Dt = (() => {
|
292
|
+
switch (E) {
|
288
293
|
case "months":
|
289
|
-
return () => /* @__PURE__ */ D(
|
294
|
+
return () => /* @__PURE__ */ D(Tt, { ...pt });
|
290
295
|
case "years":
|
291
|
-
return () => /* @__PURE__ */ D(
|
296
|
+
return () => /* @__PURE__ */ D($t, { ...dt });
|
292
297
|
default:
|
293
|
-
return () => /* @__PURE__ */ D(
|
298
|
+
return () => /* @__PURE__ */ D(gt, { ...G });
|
294
299
|
}
|
295
|
-
})(),
|
296
|
-
e.stopPropagation(),
|
297
|
-
}, className:
|
298
|
-
|
300
|
+
})(), wt = ({ isActive: t }) => /* @__PURE__ */ D("button", { onClick: (e) => {
|
301
|
+
e.stopPropagation(), O || d(!t);
|
302
|
+
}, className: l["icon-button"], children: t ? /* @__PURE__ */ D(
|
303
|
+
B,
|
299
304
|
{
|
300
|
-
iconName:
|
305
|
+
iconName: v === V.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
|
301
306
|
}
|
302
307
|
) : /* @__PURE__ */ D(
|
303
|
-
|
308
|
+
B,
|
304
309
|
{
|
305
|
-
iconName:
|
310
|
+
iconName: v === V.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
|
306
311
|
}
|
307
312
|
) });
|
308
|
-
return /* @__PURE__ */
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
onClick: rt,
|
319
|
-
children: /* @__PURE__ */ D(
|
320
|
-
Tt,
|
313
|
+
return /* @__PURE__ */ z(
|
314
|
+
"div",
|
315
|
+
{
|
316
|
+
className: H(l["input-field-group-datePicker"], {
|
317
|
+
[l.full]: st
|
318
|
+
}),
|
319
|
+
children: [
|
320
|
+
/* @__PURE__ */ z("div", { className: lt, "data-disabled": O, children: [
|
321
|
+
/* @__PURE__ */ D(
|
322
|
+
"div",
|
321
323
|
{
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
324
|
+
role: "button",
|
325
|
+
"data-status": P.status,
|
326
|
+
className: H(l["date-wrapper"], {
|
327
|
+
[l.editable]: b,
|
328
|
+
[l[`border-radius-${X}`]]: X !== C.All
|
329
|
+
}),
|
330
|
+
onClick: it,
|
331
|
+
children: /* @__PURE__ */ D(
|
332
|
+
At,
|
333
|
+
{
|
334
|
+
ref: rt,
|
335
|
+
className: yt,
|
336
|
+
wrapperClassName: l["input-wrapper"],
|
337
|
+
size: v,
|
338
|
+
type: "text",
|
339
|
+
variant: tt,
|
340
|
+
value: at,
|
341
|
+
onChange: nt,
|
342
|
+
rightAddon: {
|
343
|
+
addonType: "react-node",
|
344
|
+
addonContent: /* @__PURE__ */ D(wt, { isActive: S })
|
345
|
+
},
|
346
|
+
rightSlotClassName: l["right-slot"],
|
347
|
+
onFocus: () => {
|
348
|
+
W && !b && d(!0);
|
349
|
+
},
|
350
|
+
borderRadius: X,
|
351
|
+
...P
|
352
|
+
}
|
353
|
+
)
|
339
354
|
}
|
340
|
-
)
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
355
|
+
),
|
356
|
+
S && /* @__PURE__ */ D(Dt, {})
|
357
|
+
] }),
|
358
|
+
Y && typeof Y == "string" && /* @__PURE__ */ D("div", { className: l.textError, children: Y })
|
359
|
+
]
|
360
|
+
}
|
361
|
+
);
|
347
362
|
}
|
348
363
|
)
|
349
364
|
);
|
350
|
-
|
365
|
+
St.displayName = "DatePicker";
|
351
366
|
export {
|
352
|
-
|
367
|
+
St as DatePicker
|
353
368
|
};
|
@@ -3,7 +3,7 @@ import { c as A } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { useState as U } from "react";
|
4
4
|
import { week as V, COUNT_WORK_DAYS as W } from "./constants.js";
|
5
5
|
import { useDatePickerPosition as E } from "./hooks.js";
|
6
|
-
import { c as n } from "../../styles.module-
|
6
|
+
import { c as n } from "../../styles.module-B3lX7mJq.js";
|
7
7
|
import { getUpdateDate as B } from "./utils.js";
|
8
8
|
import { Icon as K } from "../../icons/Icon.js";
|
9
9
|
import { formating as m } from "../../utils/index.js";
|
@@ -3,7 +3,7 @@ import { c as _ } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { useState as C } from "react";
|
4
4
|
import { months as L } from "./constants.js";
|
5
5
|
import { useDatePickerPosition as b } from "./hooks.js";
|
6
|
-
import { c } from "../../styles.module-
|
6
|
+
import { c } from "../../styles.module-B3lX7mJq.js";
|
7
7
|
import { Icon as q } from "../../icons/Icon.js";
|
8
8
|
import { formating as P } from "../../utils/index.js";
|
9
9
|
import { Button as A } from "../Button/Button.js";
|
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { c as $ } from "../../index-DIxK0V-G.js";
|
3
3
|
import { useState as j } from "react";
|
4
4
|
import { useDatePickerPosition as z } from "./hooks.js";
|
5
|
-
import { c as n } from "../../styles.module-
|
5
|
+
import { c as n } from "../../styles.module-B3lX7mJq.js";
|
6
6
|
import { formating as F } from "../../utils/index.js";
|
7
7
|
import { Button as P } from "../Button/Button.js";
|
8
8
|
const p = 15, I = 7, W = ({
|
@@ -10,6 +10,12 @@ export declare enum EDatePickerValue {
|
|
10
10
|
CurrentDate = "20240510",
|
11
11
|
CurrentDate3 = "2024-09-10"
|
12
12
|
}
|
13
|
+
export declare enum EDatePickerBorderRadius {
|
14
|
+
All = "all",
|
15
|
+
Left = "left",
|
16
|
+
Right = "right",
|
17
|
+
None = "none"
|
18
|
+
}
|
13
19
|
export declare const BLOCK_WIDTH = 368;
|
14
20
|
export declare const COUNT_WORK_DAYS = 4;
|
15
21
|
export declare const MAX_DAY = 31;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
var
|
2
|
-
const
|
1
|
+
var t = /* @__PURE__ */ ((n) => (n.CurrentDate1 = "2024-08-01", n.CurrentDate2 = "2024-07-01", n.CurrentDate3 = "1995-07-11", n))(t || {});
|
2
|
+
const _ = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], o = [
|
3
3
|
"Январь",
|
4
4
|
"Февраль",
|
5
5
|
"Март",
|
@@ -13,17 +13,18 @@ const s = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], o = [
|
|
13
13
|
"Ноябрь",
|
14
14
|
"Декабрь"
|
15
15
|
];
|
16
|
-
var r = /* @__PURE__ */ ((
|
17
|
-
const
|
16
|
+
var r = /* @__PURE__ */ ((n) => (n.CurrentDate1 = "", n.CurrentDate = "20240510", n.CurrentDate3 = "2024-09-10", n))(r || {}), C = /* @__PURE__ */ ((n) => (n.All = "all", n.Left = "left", n.Right = "right", n.None = "none", n))(C || {});
|
17
|
+
const A = 368, s = 4, T = 31, M = 12, O = 10, u = 500;
|
18
18
|
export {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
A as BLOCK_WIDTH,
|
20
|
+
s as COUNT_WORK_DAYS,
|
21
|
+
O as DATE_LENGTH,
|
22
|
+
t as EDatePickerBeforeDate,
|
23
|
+
C as EDatePickerBorderRadius,
|
23
24
|
r as EDatePickerValue,
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
T as MAX_DAY,
|
26
|
+
u as MAX_MOBILE_WIDTH,
|
27
|
+
M as MAX_MONTH,
|
27
28
|
o as months,
|
28
|
-
|
29
|
+
_ as week
|
29
30
|
};
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import { jsx as s, jsxs as d, Fragment as D } from "react/jsx-runtime";
|
2
|
+
import { c as a } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as b } from "react";
|
4
|
+
import { EDropdownSelectSize as y } from "./constants.js";
|
5
|
+
import { Icon as f } from "../../icons/Icon.js";
|
6
|
+
import { H as S, U as C, K as k, W as U } from "../../combobox-fIVOzEhl.js";
|
7
|
+
import '../../assets/DropdownSelect.css';const V = "_full_ow9jf_265", z = "_disabled_ow9jf_268", A = "_trigger_ow9jf_273", H = "_options_ow9jf_313", K = "_option_ow9jf_313", W = "_focused_ow9jf_356", B = "_s_ow9jf_381", E = "_m_ow9jf_390", F = "_l_ow9jf_399", e = {
|
8
|
+
"dropdown-select": "_dropdown-select_ow9jf_261",
|
9
|
+
full: V,
|
10
|
+
disabled: z,
|
11
|
+
trigger: A,
|
12
|
+
"trigger-text": "_trigger-text_ow9jf_302",
|
13
|
+
options: H,
|
14
|
+
option: K,
|
15
|
+
focused: W,
|
16
|
+
"option-content": "_option-content_ow9jf_360",
|
17
|
+
"option-check": "_option-check_ow9jf_372",
|
18
|
+
s: B,
|
19
|
+
m: E,
|
20
|
+
l: F
|
21
|
+
}, I = b(
|
22
|
+
(p, _) => {
|
23
|
+
const {
|
24
|
+
value: t,
|
25
|
+
onChange: n,
|
26
|
+
options: m,
|
27
|
+
placeholder: w = "Выберите значение",
|
28
|
+
disabled: i = !1,
|
29
|
+
className: g,
|
30
|
+
triggerClassName: u,
|
31
|
+
optionsClassName: j,
|
32
|
+
optionClassName: N,
|
33
|
+
full: c = !1,
|
34
|
+
size: l = y.M
|
35
|
+
} = p, h = (o) => {
|
36
|
+
n == null || n(o);
|
37
|
+
}, x = (o) => o ? o.displayValue ? o.displayValue : typeof o.name == "string" ? o.name : typeof o.value == "string" ? o.value : String(o.id) : "";
|
38
|
+
return /* @__PURE__ */ s(
|
39
|
+
S,
|
40
|
+
{
|
41
|
+
as: "div",
|
42
|
+
ref: _,
|
43
|
+
value: t,
|
44
|
+
onChange: h,
|
45
|
+
disabled: i,
|
46
|
+
className: a(
|
47
|
+
e["dropdown-select"],
|
48
|
+
e[l],
|
49
|
+
{
|
50
|
+
[e.full]: c,
|
51
|
+
[e.disabled]: i
|
52
|
+
},
|
53
|
+
g
|
54
|
+
),
|
55
|
+
children: ({ open: o }) => /* @__PURE__ */ d(D, { children: [
|
56
|
+
/* @__PURE__ */ d(
|
57
|
+
C,
|
58
|
+
{
|
59
|
+
className: a(
|
60
|
+
e.trigger,
|
61
|
+
e[l],
|
62
|
+
{
|
63
|
+
[e.full]: c,
|
64
|
+
[e.disabled]: i
|
65
|
+
},
|
66
|
+
u
|
67
|
+
),
|
68
|
+
"data-testid": "dropdown-select-trigger",
|
69
|
+
children: [
|
70
|
+
/* @__PURE__ */ s("span", { className: a(e["trigger-text"]), children: t ? x(t) : w }),
|
71
|
+
/* @__PURE__ */ s(
|
72
|
+
f,
|
73
|
+
{
|
74
|
+
iconName: o ? "DropdownArrowUp16px" : "DropdownArrowBottom16px"
|
75
|
+
}
|
76
|
+
)
|
77
|
+
]
|
78
|
+
}
|
79
|
+
),
|
80
|
+
/* @__PURE__ */ s(
|
81
|
+
k,
|
82
|
+
{
|
83
|
+
className: a(e.options, e[l], j),
|
84
|
+
"data-testid": "dropdown-select-options",
|
85
|
+
children: m.map((r) => /* @__PURE__ */ d(
|
86
|
+
U,
|
87
|
+
{
|
88
|
+
value: r,
|
89
|
+
className: ({ focus: v }) => a(
|
90
|
+
e.option,
|
91
|
+
e[l],
|
92
|
+
{
|
93
|
+
[e.focused]: v
|
94
|
+
},
|
95
|
+
N
|
96
|
+
),
|
97
|
+
"data-testid": `dropdown-select-option-${r.id}`,
|
98
|
+
children: [
|
99
|
+
/* @__PURE__ */ s("div", { className: e["option-content"], children: r.name }),
|
100
|
+
t && t.id === r.id && /* @__PURE__ */ s("div", { className: e["option-check"], children: /* @__PURE__ */ s(f, { iconName: "Done16px" }) })
|
101
|
+
]
|
102
|
+
},
|
103
|
+
r.id
|
104
|
+
))
|
105
|
+
}
|
106
|
+
)
|
107
|
+
] })
|
108
|
+
}
|
109
|
+
);
|
110
|
+
}
|
111
|
+
);
|
112
|
+
I.displayName = "DropdownSelect";
|
113
|
+
export {
|
114
|
+
I as DropdownSelect
|
115
|
+
};
|