mimir-ui-kit 1.34.5 → 1.34.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{ProgressBar-C0dC7o7N.js → ProgressBar-DEFs1tWq.js} +3 -3
- package/dist/components/DatePicker/DatePicker.js +49 -49
- package/dist/components/DatePicker/DatePickerModal.js +44 -44
- package/dist/components/DatePicker/MonthPickerModal.js +29 -29
- package/dist/components/DatePicker/YearPickerModal.js +33 -33
- package/dist/components/DatePicker/constants.d.ts +1 -1
- package/dist/components/DatePicker/constants.js +1 -1
- package/dist/components/Drawer/Drawer.js +15 -15
- package/dist/components/InputPassword/InputPassword.js +28 -26
- package/dist/components/OtpInput/OtpInput.js +21 -15
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +531 -503
- package/dist/components/SelectSearch/types.d.ts +2 -0
- package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.js +14 -13
- package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.js +2 -1
- package/dist/components/Skeleton/SkeletonText/SkeletonText.js +26 -17
- package/dist/components/Slider/Slider.js +8 -1
- package/dist/components/Steps/Steps.js +10 -9
- package/dist/components/TextArea/TextArea.js +23 -23
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.js +1 -1
- package/dist/components/Toasts/ToastList.js +20 -19
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +7 -2
- package/dist/components/UniversalUploader/UniversalUploader.js +65 -43
- package/dist/components/UniversalUploader/types.d.ts +2 -9
- package/dist/components/Uploader/Uploader.d.ts +13 -0
- package/dist/components/Uploader/Uploader.js +45 -39
- package/package.json +1 -1
@@ -33,14 +33,14 @@ import './assets/ProgressBar.css';const f = "_title_1z0br_37", g = "_timer_1z0br
|
|
33
33
|
}) => {
|
34
34
|
const t = n(), r = n(null);
|
35
35
|
return p(() => {
|
36
|
-
const
|
37
|
-
const
|
36
|
+
const i = Date.now(), o = () => {
|
37
|
+
const m = Date.now() - i, _ = Math.min(m / s * 100, 100);
|
38
38
|
r.current && (r.current.style.width = `${_}%`), _ < 100 && (t.current = requestAnimationFrame(o));
|
39
39
|
};
|
40
40
|
return t.current = requestAnimationFrame(o), () => {
|
41
41
|
t.current && cancelAnimationFrame(t.current);
|
42
42
|
};
|
43
|
-
}, [s]), /* @__PURE__ */ a("div", { className: e.progress, children: /* @__PURE__ */ a(
|
43
|
+
}, [s]), /* @__PURE__ */ a("div", { className: e.progress, "data-testid": "progress-bar", children: /* @__PURE__ */ a(
|
44
44
|
"div",
|
45
45
|
{
|
46
46
|
ref: r,
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { jsxs as K, jsx as
|
2
|
-
import { c as
|
3
|
-
import { memo as Q, forwardRef as W, useState as
|
1
|
+
import { jsxs as K, jsx as N } from "react/jsx-runtime";
|
2
|
+
import { c as I } from "../../index-DIxK0V-G.js";
|
3
|
+
import { memo as Q, forwardRef as W, useState as D, useEffect as T } from "react";
|
4
4
|
import { DatePickerModal as Z } from "./DatePickerModal.js";
|
5
5
|
import { MonthPickerModal as b } from "./MonthPickerModal.js";
|
6
6
|
import { c as r } from "../../styles.module-CaPkyXYQ.js";
|
7
7
|
import { formatDatePart as h } from "./utils.js";
|
8
|
-
import { YearPickerModal as
|
9
|
-
import { useClickOutside as
|
10
|
-
import { formating as
|
8
|
+
import { YearPickerModal as C } from "./YearPickerModal.js";
|
9
|
+
import { useClickOutside as E } from "../../hooks/useClickOutside/useClickOutside.js";
|
10
|
+
import { formating as B } from "../../utils/index.js";
|
11
11
|
import { I as V } from "../../Input-DGr0q5AJ.js";
|
12
12
|
import { EInputStatus as tt } from "../Input/constants.js";
|
13
13
|
const st = 31, et = 12, it = 10, at = Q(
|
@@ -19,66 +19,66 @@ const st = 31, et = 12, it = 10, at = Q(
|
|
19
19
|
name: p,
|
20
20
|
before: a,
|
21
21
|
type: m = "days",
|
22
|
-
error:
|
23
|
-
onError:
|
24
|
-
onBlur:
|
25
|
-
validateImmediately:
|
22
|
+
error: A,
|
23
|
+
onError: f,
|
24
|
+
onBlur: n,
|
25
|
+
validateImmediately: P,
|
26
26
|
variant: X,
|
27
|
-
disabled:
|
27
|
+
disabled: u = !1,
|
28
28
|
editable: S = !1,
|
29
29
|
...G
|
30
30
|
}, L) => {
|
31
|
-
const [
|
31
|
+
const [d, c] = D(!1), [w, o] = D(m), [t, l] = D(
|
32
32
|
e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
|
33
|
-
), [
|
34
|
-
|
35
|
-
|
36
|
-
}, [
|
37
|
-
|
33
|
+
), [g, k] = D(A), [R, v] = D("");
|
34
|
+
T(() => {
|
35
|
+
k(A);
|
36
|
+
}, [A]), T(() => {
|
37
|
+
l(
|
38
38
|
e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
|
39
39
|
);
|
40
|
-
}, [e]),
|
41
|
-
t && typeof t != "string" && !isNaN(t == null ? void 0 : t.getTime()) ?
|
40
|
+
}, [e]), T(() => {
|
41
|
+
t && typeof t != "string" && !isNaN(t == null ? void 0 : t.getTime()) ? v(B.Date(t, "dd/mm/yyyy")) : v("");
|
42
42
|
}, [t]);
|
43
43
|
const j = e && new Date(e).getTime;
|
44
|
-
|
45
|
-
|
46
|
-
}, [
|
47
|
-
isActive:
|
44
|
+
T(() => {
|
45
|
+
P && (j ? (k(!1), f == null || f({ name: p, active: !1 })) : (k(!0), f == null || f({ name: p, active: !0 })));
|
46
|
+
}, [P, p, j]), E({
|
47
|
+
isActive: d,
|
48
48
|
setActive: (s) => {
|
49
49
|
c(s), o(m);
|
50
50
|
},
|
51
51
|
className: r["calendar-block"]
|
52
52
|
});
|
53
53
|
const U = () => {
|
54
|
-
|
55
|
-
},
|
56
|
-
isNaN(s.getTime()) || (
|
54
|
+
u || c(!0);
|
55
|
+
}, M = (s) => {
|
56
|
+
isNaN(s.getTime()) || (l(s), i == null || i({ value: s, name: p })), w === "years" && (m === "years" ? (c(!1), o(m)) : o("months")), w === "months" && (m === "months" ? (c(!1), o(m)) : o("days")), l(s), i == null || i({ value: s, name: p }), n == null || n(s);
|
57
57
|
}, q = (s) => {
|
58
58
|
if (S) {
|
59
|
-
const
|
60
|
-
h(
|
61
|
-
h(
|
62
|
-
|
59
|
+
const x = s.target.value.replace(/[^\d]/g, ""), [O, Y, _] = [
|
60
|
+
h(x.substring(0, 2), st),
|
61
|
+
h(x.substring(2, 4), et),
|
62
|
+
x.substring(4, 8)
|
63
63
|
], $ = [O, Y, _].filter(Boolean).join("/");
|
64
|
-
if (
|
65
|
-
const J = parseInt(_),
|
64
|
+
if (v($), $.length === it) {
|
65
|
+
const J = parseInt(_), y = /* @__PURE__ */ new Date(
|
66
66
|
`${J}-${Y.padStart(2, "0")}-${O.padStart(2, "0")}`
|
67
67
|
);
|
68
|
-
isNaN(
|
68
|
+
isNaN(y.getTime()) || (l(y), i == null || i({ value: y, name: p }), n == null || n(y));
|
69
69
|
}
|
70
70
|
}
|
71
|
-
}, z =
|
72
|
-
return /* @__PURE__ */ K("div", { className: z, "data-disabled":
|
73
|
-
/* @__PURE__ */
|
71
|
+
}, z = I(r.wrapper, d && r.active), F = I(r.input, r.inputBorderControl);
|
72
|
+
return /* @__PURE__ */ K("div", { className: z, "data-disabled": u, children: [
|
73
|
+
/* @__PURE__ */ N(
|
74
74
|
"div",
|
75
75
|
{
|
76
|
-
"data-error":
|
77
|
-
className:
|
76
|
+
"data-error": g,
|
77
|
+
className: I(r["date-wrapper"], {
|
78
78
|
[r.editable]: S
|
79
79
|
}),
|
80
80
|
onClick: U,
|
81
|
-
children: /* @__PURE__ */
|
81
|
+
children: /* @__PURE__ */ N(
|
82
82
|
V,
|
83
83
|
{
|
84
84
|
ref: L,
|
@@ -87,43 +87,43 @@ const st = 31, et = 12, it = 10, at = Q(
|
|
87
87
|
size: H,
|
88
88
|
type: "text",
|
89
89
|
variant: X,
|
90
|
-
status:
|
90
|
+
status: g ? tt.Error : void 0,
|
91
91
|
value: R,
|
92
92
|
onChange: q,
|
93
93
|
rightAddon: {
|
94
94
|
addonType: "icon",
|
95
|
-
addonContent:
|
95
|
+
addonContent: d ? "DropdownArrowUp24px" : "DropdownArrowDown24px"
|
96
96
|
},
|
97
|
-
"data-error":
|
97
|
+
"data-error": g,
|
98
98
|
...G
|
99
99
|
}
|
100
100
|
)
|
101
101
|
}
|
102
102
|
),
|
103
|
-
|
103
|
+
w === "days" && d && /* @__PURE__ */ N(
|
104
104
|
Z,
|
105
105
|
{
|
106
|
-
onChangeValue:
|
106
|
+
onChangeValue: M,
|
107
107
|
date: t || /* @__PURE__ */ new Date(),
|
108
108
|
setActive: c,
|
109
109
|
before: typeof a == "string" ? new Date(a) : a,
|
110
110
|
onType: o
|
111
111
|
}
|
112
112
|
),
|
113
|
-
|
113
|
+
w === "months" && d && /* @__PURE__ */ N(
|
114
114
|
b,
|
115
115
|
{
|
116
|
-
onChangeValue:
|
116
|
+
onChangeValue: M,
|
117
117
|
date: t || /* @__PURE__ */ new Date(),
|
118
118
|
setActive: c,
|
119
119
|
before: typeof a == "string" ? new Date(a) : a,
|
120
120
|
onType: o
|
121
121
|
}
|
122
122
|
),
|
123
|
-
|
124
|
-
|
123
|
+
w === "years" && d && /* @__PURE__ */ N(
|
124
|
+
C,
|
125
125
|
{
|
126
|
-
onChangeValue:
|
126
|
+
onChangeValue: M,
|
127
127
|
date: t || /* @__PURE__ */ new Date(),
|
128
128
|
setActive: c,
|
129
129
|
before: typeof a == "string" ? new Date(a) : a,
|
@@ -1,74 +1,74 @@
|
|
1
|
-
import { jsx as a, Fragment as
|
2
|
-
import { useRef as
|
3
|
-
import { week as
|
1
|
+
import { jsx as a, Fragment as q, jsxs as u } from "react/jsx-runtime";
|
2
|
+
import { useRef as G, useState as J, useEffect as K } from "react";
|
3
|
+
import { week as Q } from "./constants.js";
|
4
4
|
import { c as o } from "../../styles.module-CaPkyXYQ.js";
|
5
|
-
import { Icon as
|
5
|
+
import { Icon as T } from "../../icons/Icon.js";
|
6
6
|
import { formating as i } from "../../utils/index.js";
|
7
|
-
import { Button as
|
8
|
-
import { parseDate as
|
9
|
-
function
|
7
|
+
import { Button as j } from "../Button/Button.js";
|
8
|
+
import { parseDate as F } from "../../utils/formating/Date.js";
|
9
|
+
function ct({
|
10
10
|
date: l,
|
11
|
-
onChangeValue:
|
12
|
-
setActive:
|
13
|
-
before:
|
11
|
+
onChangeValue: I,
|
12
|
+
setActive: P,
|
13
|
+
before: g,
|
14
14
|
onType: d
|
15
15
|
}) {
|
16
16
|
var k;
|
17
|
-
const r =
|
17
|
+
const r = G(null);
|
18
18
|
l = isNaN(new Date(l).getTime()) ? /* @__PURE__ */ new Date() : l;
|
19
|
-
const h =
|
19
|
+
const h = F(l), p = F(l), y = {
|
20
20
|
y: h.getFullYear(),
|
21
21
|
d: h.getDate(),
|
22
22
|
m: h.getMonth() + 1
|
23
|
-
},
|
23
|
+
}, f = {
|
24
24
|
y: p.getFullYear(),
|
25
25
|
d: p.getDate(),
|
26
26
|
m: p.getMonth() + 1
|
27
|
-
},
|
28
|
-
|
29
|
-
var c, s, M, W;
|
27
|
+
}, z = 4, [n, w] = J({ y: f.y, m: f.m }), v = 368;
|
28
|
+
K(() => {
|
29
|
+
var c, s, M, W, B, C;
|
30
30
|
const t = window.innerHeight, e = window.innerWidth;
|
31
31
|
if (r.current !== null) {
|
32
|
-
const
|
33
|
-
t <
|
32
|
+
const O = ((s = (c = r == null ? void 0 : r.current) == null ? void 0 : c.parentElement) == null ? void 0 : s.offsetWidth) || 0, A = ((W = (M = r == null ? void 0 : r.current) == null ? void 0 : M.parentElement) == null ? void 0 : W.offsetHeight) || 0, E = (C = (B = r == null ? void 0 : r.current) == null ? void 0 : B.parentElement) == null ? void 0 : C.getBoundingClientRect(), H = r.current.offsetHeight;
|
33
|
+
t < E.y + H + A ? r.current.style.top = -H + "px" : r.current.style.top = A + "px", e < E.x + v && (r.current.style.left = O - v + "px"), r.current.style.opacity = "1";
|
34
34
|
}
|
35
35
|
}, [n]);
|
36
|
-
const
|
36
|
+
const L = (t) => {
|
37
37
|
let e = t.getDay();
|
38
38
|
return e === 0 && (e = 7), e - 1;
|
39
|
-
}, N = n.m - 1, m = new Date(n.y, N),
|
39
|
+
}, N = n.m - 1, m = new Date(n.y, N), D = [], x = (() => {
|
40
40
|
const t = new Date(m);
|
41
41
|
t.setDate(t.getDate() - 1);
|
42
42
|
const e = t.getDate(), c = [];
|
43
|
-
for (let s = 0; s <
|
43
|
+
for (let s = 0; s < L(m); s++)
|
44
44
|
c.push(e - s);
|
45
45
|
return c.reverse(), c;
|
46
46
|
})();
|
47
47
|
for (; m.getMonth() === N; )
|
48
|
-
|
49
|
-
const
|
50
|
-
const e = 42 - (x.length +
|
48
|
+
D.push(m.getDate()), m.setDate(m.getDate() + 1);
|
49
|
+
const R = (() => {
|
50
|
+
const e = 42 - (x.length + D.length), c = [];
|
51
51
|
for (let s = 1; s <= e; s++)
|
52
52
|
c.push(s);
|
53
53
|
return c;
|
54
|
-
})(), b = (t, e) => (e = t > 12 ? e + 1 : t < 1 ? e - 1 : e, t = t > 12 ? 1 : t < 1 ? 12 : t, { y: e, m: t }),
|
55
|
-
|
56
|
-
},
|
54
|
+
})(), b = (t, e) => (e = t > 12 ? e + 1 : t < 1 ? e - 1 : e, t = t > 12 ? 1 : t < 1 ? 12 : t, { y: e, m: t }), S = () => {
|
55
|
+
P(!1);
|
56
|
+
}, V = () => {
|
57
57
|
w(b(n.m + 1, n.y));
|
58
|
-
},
|
58
|
+
}, Y = () => {
|
59
59
|
w(b(n.m - 1, n.y));
|
60
|
-
}, $ = (t) => !!(
|
60
|
+
}, $ = (t) => !!(g && g.getTime() > t), _ = (t) => {
|
61
61
|
$(
|
62
62
|
(/* @__PURE__ */ new Date(
|
63
63
|
`${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
|
64
64
|
)).getTime()
|
65
|
-
) || (
|
65
|
+
) || (I(
|
66
66
|
/* @__PURE__ */ new Date(
|
67
67
|
`${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
|
68
68
|
)
|
69
|
-
),
|
69
|
+
), S());
|
70
70
|
};
|
71
|
-
return /* @__PURE__ */ a(
|
71
|
+
return /* @__PURE__ */ a(q, { children: /* @__PURE__ */ u(
|
72
72
|
"div",
|
73
73
|
{
|
74
74
|
className: [o["calendar-block"]].join(" "),
|
@@ -77,11 +77,11 @@ function st({
|
|
77
77
|
children: [
|
78
78
|
/* @__PURE__ */ u("div", { className: o.h, children: [
|
79
79
|
/* @__PURE__ */ a(
|
80
|
-
|
80
|
+
j,
|
81
81
|
{
|
82
82
|
isIconButton: !0,
|
83
83
|
iconName: "DropdownArrowLeft16px",
|
84
|
-
onClick:
|
84
|
+
onClick: Y,
|
85
85
|
variant: "secondary-gray",
|
86
86
|
size: "l"
|
87
87
|
}
|
@@ -96,32 +96,32 @@ function st({
|
|
96
96
|
(k = i.Month(n.m)) == null ? void 0 : k.name,
|
97
97
|
"’",
|
98
98
|
n.y.toString().slice(-2),
|
99
|
-
/* @__PURE__ */ a(
|
99
|
+
/* @__PURE__ */ a(T, { iconName: "DropdownArrowBottom16px" })
|
100
100
|
]
|
101
101
|
}
|
102
102
|
),
|
103
103
|
/* @__PURE__ */ a(
|
104
|
-
|
104
|
+
j,
|
105
105
|
{
|
106
106
|
isIconButton: !0,
|
107
107
|
iconName: "DropdownArrowRight16px",
|
108
|
-
onClick:
|
108
|
+
onClick: V,
|
109
109
|
variant: "secondary-gray",
|
110
110
|
size: "l"
|
111
111
|
}
|
112
112
|
)
|
113
113
|
] }),
|
114
114
|
/* @__PURE__ */ u("div", { className: o.b, children: [
|
115
|
-
|
115
|
+
Q.map((t, e) => /* @__PURE__ */ a(
|
116
116
|
"div",
|
117
117
|
{
|
118
|
-
className: `${e >
|
118
|
+
className: `${e > z ? [o.m, o.orange].join(" ") : o.m}`,
|
119
119
|
children: t
|
120
120
|
},
|
121
121
|
`v${e}`
|
122
122
|
)),
|
123
123
|
x.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e)),
|
124
|
-
|
124
|
+
D.map((t, e) => /* @__PURE__ */ a(
|
125
125
|
"div",
|
126
126
|
{
|
127
127
|
className: $(
|
@@ -132,20 +132,20 @@ function st({
|
|
132
132
|
children: t !== 0 ? /* @__PURE__ */ a(
|
133
133
|
"b",
|
134
134
|
{
|
135
|
-
className:
|
136
|
-
onClick: () =>
|
135
|
+
className: y.y === n.y && y.m === n.m && y.d === t ? o.current : "",
|
136
|
+
onClick: () => _(t),
|
137
137
|
children: t
|
138
138
|
}
|
139
139
|
) : /* @__PURE__ */ a("p", {})
|
140
140
|
},
|
141
141
|
e
|
142
142
|
)),
|
143
|
-
|
143
|
+
R.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e))
|
144
144
|
] })
|
145
145
|
]
|
146
146
|
}
|
147
147
|
) });
|
148
148
|
}
|
149
149
|
export {
|
150
|
-
|
150
|
+
ct as DatePickerModal
|
151
151
|
};
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { jsx as o, Fragment as
|
2
|
-
import { useRef as
|
3
|
-
import { months as
|
1
|
+
import { jsx as o, Fragment as z, jsxs as u } from "react/jsx-runtime";
|
2
|
+
import { useRef as A, useState as F, useEffect as I } from "react";
|
3
|
+
import { months as R } from "./constants.js";
|
4
4
|
import { c as i } from "../../styles.module-CaPkyXYQ.js";
|
5
|
-
import { Icon as
|
5
|
+
import { Icon as S } from "../../icons/Icon.js";
|
6
6
|
import { formating as c } from "../../utils/index.js";
|
7
|
-
import { Button as
|
8
|
-
function
|
7
|
+
import { Button as C } from "../Button/Button.js";
|
8
|
+
function K({
|
9
9
|
date: d,
|
10
|
-
onChangeValue:
|
10
|
+
onChangeValue: H,
|
11
11
|
before: f,
|
12
12
|
onType: s
|
13
13
|
}) {
|
14
|
-
const t =
|
14
|
+
const t = A(null), a = new Date(d), m = new Date(d), p = {
|
15
15
|
y: a.getFullYear(),
|
16
16
|
d: a.getDate(),
|
17
17
|
m: a.getMonth() + 1
|
@@ -19,38 +19,38 @@ function q({
|
|
19
19
|
y: m.getFullYear(),
|
20
20
|
d: m.getDate(),
|
21
21
|
m: m.getMonth() + 1
|
22
|
-
}, [n,
|
23
|
-
|
24
|
-
var N, y, x, D;
|
22
|
+
}, [n, h] = F(l.y), g = 368;
|
23
|
+
I(() => {
|
24
|
+
var N, y, x, D, b, k;
|
25
25
|
const e = window.innerHeight, r = window.innerWidth;
|
26
26
|
if (t.current !== null) {
|
27
|
-
const
|
28
|
-
e <
|
27
|
+
const j = ((y = (N = t == null ? void 0 : t.current) == null ? void 0 : N.parentElement) == null ? void 0 : y.offsetWidth) || 0, v = ((D = (x = t == null ? void 0 : t.current) == null ? void 0 : x.parentElement) == null ? void 0 : D.offsetHeight) || 0, $ = (k = (b = t == null ? void 0 : t.current) == null ? void 0 : b.parentElement) == null ? void 0 : k.getBoundingClientRect(), B = t.current.offsetHeight;
|
28
|
+
e < $.y + B + v ? t.current.style.top = -B + "px" : t.current.style.top = v + "px", r < $.x + g && (t.current.style.left = j - g + "px"), t.current.style.opacity = "1";
|
29
29
|
}
|
30
30
|
}, []);
|
31
|
-
const
|
32
|
-
|
33
|
-
},
|
34
|
-
|
35
|
-
}, w = (e) => !!(f && f.getTime() > e),
|
31
|
+
const W = () => {
|
32
|
+
h(n + 1);
|
33
|
+
}, E = () => {
|
34
|
+
h(n - 1);
|
35
|
+
}, w = (e) => !!(f && f.getTime() > e), M = (e) => {
|
36
36
|
w(
|
37
37
|
(/* @__PURE__ */ new Date(
|
38
38
|
`${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
|
39
39
|
)).getTime()
|
40
|
-
) ||
|
40
|
+
) || H(
|
41
41
|
/* @__PURE__ */ new Date(
|
42
42
|
`${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
|
43
43
|
)
|
44
44
|
);
|
45
45
|
};
|
46
|
-
return /* @__PURE__ */ o(
|
46
|
+
return /* @__PURE__ */ o(z, { children: /* @__PURE__ */ u("div", { className: [i["calendar-block"]].join(" "), ref: t, children: [
|
47
47
|
/* @__PURE__ */ u("div", { className: i.h, children: [
|
48
48
|
/* @__PURE__ */ o(
|
49
|
-
|
49
|
+
C,
|
50
50
|
{
|
51
51
|
isIconButton: !0,
|
52
52
|
iconName: "DropdownArrowLeft16px",
|
53
|
-
onClick:
|
53
|
+
onClick: E,
|
54
54
|
variant: "secondary-gray",
|
55
55
|
size: "l"
|
56
56
|
}
|
@@ -63,22 +63,22 @@ function q({
|
|
63
63
|
"data-testid": "year-button",
|
64
64
|
children: [
|
65
65
|
n.toString(),
|
66
|
-
/* @__PURE__ */ o(
|
66
|
+
/* @__PURE__ */ o(S, { iconName: "DropdownArrowBottom16px" })
|
67
67
|
]
|
68
68
|
}
|
69
69
|
),
|
70
70
|
/* @__PURE__ */ o(
|
71
|
-
|
71
|
+
C,
|
72
72
|
{
|
73
73
|
isIconButton: !0,
|
74
74
|
iconName: "DropdownArrowRight16px",
|
75
|
-
onClick:
|
75
|
+
onClick: W,
|
76
76
|
variant: "secondary-gray",
|
77
77
|
size: "l"
|
78
78
|
}
|
79
79
|
)
|
80
80
|
] }),
|
81
|
-
/* @__PURE__ */ o("div", { className: i.monthGrid, "data-testid": "month-picker", children:
|
81
|
+
/* @__PURE__ */ o("div", { className: i.monthGrid, "data-testid": "month-picker", children: R.map((e, r) => /* @__PURE__ */ o(
|
82
82
|
"div",
|
83
83
|
{
|
84
84
|
className: w(
|
@@ -87,8 +87,8 @@ function q({
|
|
87
87
|
children: /* @__PURE__ */ o(
|
88
88
|
"b",
|
89
89
|
{
|
90
|
-
className:
|
91
|
-
onClick: () =>
|
90
|
+
className: p.y === n && p.m === r + 1 ? i.current : "",
|
91
|
+
onClick: () => M(r + 1),
|
92
92
|
children: e
|
93
93
|
}
|
94
94
|
)
|
@@ -98,5 +98,5 @@ function q({
|
|
98
98
|
] }) });
|
99
99
|
}
|
100
100
|
export {
|
101
|
-
|
101
|
+
K as MonthPickerModal
|
102
102
|
};
|
@@ -1,71 +1,71 @@
|
|
1
|
-
import { jsx as r, Fragment as
|
2
|
-
import { useRef as
|
1
|
+
import { jsx as r, Fragment as F, jsxs as B } from "react/jsx-runtime";
|
2
|
+
import { useRef as M, useState as R, useEffect as I } from "react";
|
3
3
|
import { c as n } from "../../styles.module-CaPkyXYQ.js";
|
4
4
|
import { formating as c } from "../../utils/index.js";
|
5
|
-
import { Button as
|
6
|
-
function
|
5
|
+
import { Button as C } from "../Button/Button.js";
|
6
|
+
function q({
|
7
7
|
date: u,
|
8
|
-
onChangeValue:
|
8
|
+
onChangeValue: H,
|
9
9
|
before: d,
|
10
|
-
onType:
|
10
|
+
onType: i
|
11
11
|
}) {
|
12
|
-
const e =
|
12
|
+
const e = M(null), a = new Date(u), m = new Date(u), f = {
|
13
13
|
y: a.getFullYear(),
|
14
14
|
d: a.getDate(),
|
15
15
|
m: a.getMonth() + 1
|
16
16
|
}, o = {
|
17
|
-
y:
|
18
|
-
d:
|
19
|
-
m:
|
20
|
-
}, [
|
21
|
-
|
22
|
-
var w, y, N, x;
|
23
|
-
const t = window.innerHeight,
|
17
|
+
y: m.getFullYear(),
|
18
|
+
d: m.getDate(),
|
19
|
+
m: m.getMonth() + 1
|
20
|
+
}, [l, p] = R(o.y), g = 368, W = l - 7, Y = Array.from(Array(15).keys()).map((t) => t + W);
|
21
|
+
I(() => {
|
22
|
+
var w, y, N, x, D, b;
|
23
|
+
const t = window.innerHeight, s = window.innerWidth;
|
24
24
|
if (e.current !== null) {
|
25
|
-
const
|
26
|
-
t <
|
25
|
+
const z = ((y = (w = e == null ? void 0 : e.current) == null ? void 0 : w.parentElement) == null ? void 0 : y.offsetWidth) || 0, k = ((x = (N = e == null ? void 0 : e.current) == null ? void 0 : N.parentElement) == null ? void 0 : x.offsetHeight) || 0, v = (b = (D = e == null ? void 0 : e.current) == null ? void 0 : D.parentElement) == null ? void 0 : b.getBoundingClientRect(), $ = e.current.offsetHeight;
|
26
|
+
t < v.y + $ + k ? e.current.style.top = -$ + "px" : e.current.style.top = k + "px", s < v.x + g && (e.current.style.left = z - g + "px"), e.current.style.opacity = "1";
|
27
27
|
}
|
28
28
|
}, []);
|
29
|
-
const
|
30
|
-
|
31
|
-
},
|
32
|
-
|
33
|
-
}, h = (t) => !!(d && d.getTime() > t),
|
29
|
+
const A = () => {
|
30
|
+
p(l + 15);
|
31
|
+
}, E = () => {
|
32
|
+
p(l - 15);
|
33
|
+
}, h = (t) => !!(d && d.getTime() > t), j = (t) => {
|
34
34
|
h(
|
35
35
|
(/* @__PURE__ */ new Date(
|
36
36
|
`${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
|
37
37
|
)).getTime()
|
38
|
-
) ||
|
38
|
+
) || H(
|
39
39
|
/* @__PURE__ */ new Date(
|
40
40
|
`${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
|
41
41
|
)
|
42
42
|
);
|
43
43
|
};
|
44
|
-
return /* @__PURE__ */ r(
|
45
|
-
/* @__PURE__ */
|
44
|
+
return /* @__PURE__ */ r(F, { children: /* @__PURE__ */ B("div", { className: [n["calendar-block"]].join(" "), ref: e, children: [
|
45
|
+
/* @__PURE__ */ B("div", { className: n.h, children: [
|
46
46
|
/* @__PURE__ */ r(
|
47
|
-
|
47
|
+
C,
|
48
48
|
{
|
49
49
|
isIconButton: !0,
|
50
50
|
iconName: "DropdownArrowLeft16px",
|
51
|
-
onClick:
|
51
|
+
onClick: E,
|
52
52
|
variant: "secondary-gray",
|
53
53
|
size: "l"
|
54
54
|
}
|
55
55
|
),
|
56
|
-
/* @__PURE__ */ r("div", { onClick: () =>
|
56
|
+
/* @__PURE__ */ r("div", { onClick: () => i == null ? void 0 : i("years"), className: n.d }),
|
57
57
|
/* @__PURE__ */ r(
|
58
|
-
|
58
|
+
C,
|
59
59
|
{
|
60
60
|
isIconButton: !0,
|
61
61
|
iconName: "DropdownArrowRight16px",
|
62
|
-
onClick:
|
62
|
+
onClick: A,
|
63
63
|
variant: "secondary-gray",
|
64
64
|
size: "l"
|
65
65
|
}
|
66
66
|
)
|
67
67
|
] }),
|
68
|
-
/* @__PURE__ */ r("div", { className: n.monthGrid, "data-testid": "year-picker", children:
|
68
|
+
/* @__PURE__ */ r("div", { className: n.monthGrid, "data-testid": "year-picker", children: Y.map((t, s) => /* @__PURE__ */ r(
|
69
69
|
"div",
|
70
70
|
{
|
71
71
|
className: h(
|
@@ -75,15 +75,15 @@ function G({
|
|
75
75
|
"b",
|
76
76
|
{
|
77
77
|
className: f.y === t ? n.current : "",
|
78
|
-
onClick: () =>
|
78
|
+
onClick: () => j(t),
|
79
79
|
children: t
|
80
80
|
}
|
81
81
|
)
|
82
82
|
},
|
83
|
-
|
83
|
+
s
|
84
84
|
)) })
|
85
85
|
] }) });
|
86
86
|
}
|
87
87
|
export {
|
88
|
-
|
88
|
+
q as YearPickerModal
|
89
89
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var t = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "2024-08-01", r.CurrentDate2 = "2024-07-01", r.CurrentDate3 = "
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "2024-08-01", r.CurrentDate2 = "2024-07-01", r.CurrentDate3 = "1995-07-11", r))(t || {});
|
2
2
|
const u = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], C = [
|
3
3
|
"Январь",
|
4
4
|
"Февраль",
|