mimir-ui-kit 1.43.9 → 1.43.11
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-CGZoshMl.js +224 -0
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/AccordionItem.css +1 -1
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CarBodyButton.css +1 -0
- package/dist/assets/CheckboxMimir.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/GosZnak.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputPassword.css +1 -1
- package/dist/assets/InputRangeSlider.css +1 -1
- package/dist/assets/Link.css +1 -1
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/MessageShortReply.css +1 -1
- package/dist/assets/MiniButton.css +1 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/NotificationBadge.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/RoundButton.css +1 -0
- package/dist/assets/ScrollWrapper.css +1 -0
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/hooks.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +10 -3
- package/dist/components/Accordion/Accordion.js +286 -212
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
- package/dist/components/Accordion/constants.d.ts +0 -4
- package/dist/components/Accordion/constants.js +4 -5
- package/dist/components/AnchorLink/Link.js +21 -20
- package/dist/components/Avatar/Avatar.js +26 -26
- package/dist/components/Button/Button.js +110 -87
- package/dist/components/Button/constants.d.ts +8 -2
- package/dist/components/Button/constants.js +6 -5
- package/dist/components/CarBodyButton/CarBodyButton.d.ts +26 -0
- package/dist/components/CarBodyButton/CarBodyButton.js +40 -0
- package/dist/components/CarBodyButton/index.d.ts +1 -0
- package/dist/components/CarBodyButton/index.js +4 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +37 -35
- package/dist/components/Chip/Chip.js +17 -17
- package/dist/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/components/DatePicker/DatePicker.js +182 -169
- package/dist/components/DatePicker/DatePickerModal.js +134 -98
- package/dist/components/DatePicker/MonthPickerModal.js +115 -95
- package/dist/components/DatePicker/YearPickerModal.js +109 -89
- package/dist/components/DatePicker/constants.d.ts +1 -0
- package/dist/components/DatePicker/constants.js +1 -1
- package/dist/components/DatePicker/hooks.d.ts +2 -1
- package/dist/components/DatePicker/hooks.js +12 -12
- package/dist/components/Drawer/Drawer.js +172 -138
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +11 -0
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +27 -0
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/hooks.js +1 -1
- package/dist/components/GosZnak/GosZnak.js +47 -38
- package/dist/components/GosZnak/utils.d.ts +6 -0
- package/dist/components/GosZnak/utils.js +15 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +38 -42
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/InputRangeSlider/InputRangeSlider.js +159 -139
- package/dist/components/InputRangeSlider/constants.d.ts +5 -0
- package/dist/components/InputRangeSlider/constants.js +11 -6
- package/dist/components/ListFiles/ListFiles.js +41 -39
- package/dist/components/ListPhotos/ListPhotos.js +17 -18
- package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
- package/dist/components/{InputClearButton/ClearButton.d.ts → MiniButton/MiniButton.d.ts} +17 -8
- package/dist/components/MiniButton/MiniButton.js +44 -0
- package/dist/components/MiniButton/constants.d.ts +9 -0
- package/dist/components/MiniButton/constants.js +5 -0
- package/dist/components/MiniButton/index.d.ts +4 -0
- package/dist/components/MiniButton/index.js +6 -0
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +153 -152
- package/dist/components/MultiSelectSearch/constants.d.ts +1 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -7
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
- package/dist/components/MultiSelectSearch/utils.js +18 -16
- package/dist/components/NotificationBadge/NotificationBadge.js +49 -33
- package/dist/components/NotificationBadge/constants.d.ts +9 -2
- package/dist/components/NotificationBadge/constants.js +3 -2
- package/dist/components/NotificationBadge/types.d.ts +11 -1
- package/dist/components/NotificationBadge/utils.d.ts +8 -0
- package/dist/components/NotificationBadge/utils.js +4 -0
- package/dist/components/OtpInput/OtpInput.js +44 -40
- package/dist/components/OtpInput/constants.d.ts +4 -0
- package/dist/components/OtpInput/constants.js +6 -4
- package/dist/components/OtpInput/index.d.ts +1 -0
- package/dist/components/OtpInput/index.js +2 -0
- package/dist/components/Pagination/Pagination.js +23 -23
- package/dist/components/RoundButton/RoundButton.d.ts +82 -0
- package/dist/components/RoundButton/RoundButton.js +69 -0
- package/dist/components/RoundButton/constants.d.ts +11 -0
- package/dist/components/RoundButton/constants.js +5 -0
- package/dist/components/RoundButton/index.d.ts +2 -0
- package/dist/components/RoundButton/index.js +7 -0
- package/dist/components/RoundButton/types.d.ts +20 -0
- package/dist/components/SelectSearch/SelectSearch.d.ts +2 -0
- package/dist/components/SelectSearch/SelectSearch.js +273 -236
- package/dist/components/SelectSearch/types.d.ts +9 -1
- package/dist/components/SelectSearch/utils.d.ts +1 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -5
- package/dist/components/Slider/Slider.js +34 -36
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +55 -51
- package/dist/hooks-Cd4Ez6_j.js +117 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/16px/DropdownArrowDown16px.js +23 -0
- package/dist/icons/components/24px/EyeClosed24px.js +65 -0
- package/dist/icons/components/Avito.js +36 -13
- package/dist/icons/components/Site.js +13 -36
- package/dist/icons/components/index.js +564 -591
- package/dist/{index-C2dQUuc9.js → index-DrVFMaBi.js} +1184 -1346
- package/dist/index.js +73 -69
- package/dist/styles.module-BfkM1-KJ.js +32 -0
- package/package.json +1 -1
- package/dist/Input-BU_6U1CW.js +0 -227
- package/dist/assets/ClearButton.css +0 -1
- package/dist/components/InputClearButton/ClearButton.js +0 -41
- package/dist/components/InputClearButton/constants.d.ts +0 -8
- package/dist/components/InputClearButton/constants.js +0 -5
- package/dist/components/InputClearButton/index.d.ts +0 -4
- package/dist/components/InputClearButton/index.js +0 -6
- package/dist/hooks-HgN6Yauq.js +0 -117
- package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +0 -59
- package/dist/icons/components/64px/AtsVendors64px.js +0 -37
- package/dist/icons/components/64px/ButtonOn64px.js +0 -31
- package/dist/icons/components/64px/BuyoutAuto64px.js +0 -45
- package/dist/icons/components/64px/CarAssistance64px.js +0 -44
- package/dist/icons/components/64px/CarDelivery64px.js +0 -37
- package/dist/icons/components/64px/CarSearchReturn64px.js +0 -45
- package/dist/icons/components/64px/CarService64px.js +0 -37
- package/dist/icons/components/64px/Case64px.js +0 -33
- package/dist/icons/components/64px/CoatOfArms64px.js +0 -149
- package/dist/icons/components/64px/CoffeeCup64px.js +0 -44
- package/dist/icons/components/64px/Cup64px.js +0 -38
- package/dist/icons/components/64px/ExpertAdvice64px.js +0 -40
- package/dist/icons/components/64px/Fines64px.js +0 -88
- package/dist/icons/components/64px/Fuel64px.js +0 -38
- package/dist/icons/components/64px/GazprombankIcon24px.js +0 -21
- package/dist/icons/components/64px/Kasko64px.js +0 -44
- package/dist/icons/components/64px/LegalSupport64px.js +0 -58
- package/dist/icons/components/64px/Microphone64px.js +0 -37
- package/dist/icons/components/64px/Money64px.js +0 -60
- package/dist/icons/components/64px/PaymentSchedule64px.js +0 -39
- package/dist/icons/components/64px/PersonalManager64px.js +0 -100
- package/dist/icons/components/64px/PreApproval64px.js +0 -44
- package/dist/icons/components/64px/Questions64px.js +0 -37
- package/dist/icons/components/64px/SupportGeography64px.js +0 -51
- package/dist/icons/components/64px/Timer64px.js +0 -45
- package/dist/icons/components/64px/Twogis64px.js +0 -51
- package/dist/icons/components/64px/Vehicles64px.js +0 -45
- package/dist/icons/components/64px/Workplace64px.js +0 -38
- package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,170 +1,206 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { useState as
|
4
|
-
import { week as
|
5
|
-
import { useDatePickerPosition as
|
6
|
-
import { c as n } from "../../styles.module-
|
7
|
-
import { getUpdateDate as
|
8
|
-
import { Icon as
|
9
|
-
import { formating as
|
10
|
-
import { Button as
|
11
|
-
import { parseDate as
|
12
|
-
const
|
13
|
-
date:
|
14
|
-
selectedDate:
|
15
|
-
onChangeValue:
|
16
|
-
setIsActive:
|
17
|
-
before:
|
18
|
-
onChangeType:
|
19
|
-
disableFuture:
|
20
|
-
disablePast:
|
21
|
-
disabledDate:
|
22
|
-
validRange:
|
1
|
+
import { jsxs as D, jsx as m } from "react/jsx-runtime";
|
2
|
+
import { c as l } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as E } from "react";
|
4
|
+
import { week as K, COUNT_WORK_DAYS as R } from "./constants.js";
|
5
|
+
import { useDatePickerPosition as q } from "./hooks.js";
|
6
|
+
import { c as n } from "../../styles.module-BfkM1-KJ.js";
|
7
|
+
import { getUpdateDate as F } from "./utils.js";
|
8
|
+
import { Icon as J } from "../../icons/Icon.js";
|
9
|
+
import { formating as c } from "../../utils/index.js";
|
10
|
+
import { Button as H } from "../Button/Button.js";
|
11
|
+
import { parseDate as I } from "../../utils/formating/Date.js";
|
12
|
+
const lt = ({
|
13
|
+
date: u,
|
14
|
+
selectedDate: f,
|
15
|
+
onChangeValue: O,
|
16
|
+
setIsActive: S,
|
17
|
+
before: x,
|
18
|
+
onChangeType: h,
|
19
|
+
disableFuture: T = !1,
|
20
|
+
disablePast: j = !1,
|
21
|
+
disabledDate: v,
|
22
|
+
validRange: M
|
23
23
|
}) => {
|
24
|
-
var
|
25
|
-
|
26
|
-
const
|
27
|
-
y:
|
28
|
-
d:
|
29
|
-
m:
|
30
|
-
},
|
31
|
-
y:
|
32
|
-
d:
|
33
|
-
m:
|
34
|
-
},
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
24
|
+
var B;
|
25
|
+
u = isNaN(new Date(u).getTime()) ? /* @__PURE__ */ new Date() : u;
|
26
|
+
const d = I(u), g = f ? I(f) : d, p = /* @__PURE__ */ new Date(), N = {
|
27
|
+
y: g.getFullYear(),
|
28
|
+
d: g.getDate(),
|
29
|
+
m: g.getMonth() + 1
|
30
|
+
}, $ = {
|
31
|
+
y: d.getFullYear(),
|
32
|
+
d: d.getDate(),
|
33
|
+
m: d.getMonth() + 1
|
34
|
+
}, a = {
|
35
|
+
y: p.getFullYear(),
|
36
|
+
d: p.getDate(),
|
37
|
+
m: p.getMonth() + 1
|
38
|
+
}, [e, k] = E({ y: $.y, m: $.m }), [C, P] = q([e]), L = (t) => {
|
39
|
+
let r = t.getDay();
|
40
|
+
return r === 0 && (r = 7), r - 1;
|
41
|
+
}, _ = e.m - 1, i = new Date(e.y, _), w = [], A = (() => {
|
42
|
+
const t = new Date(i);
|
39
43
|
t.setDate(t.getDate() - 1);
|
40
|
-
const
|
41
|
-
for (let s = 0; s <
|
42
|
-
o.push(
|
44
|
+
const r = t.getDate(), o = [];
|
45
|
+
for (let s = 0; s < L(i); s++)
|
46
|
+
o.push({
|
47
|
+
day: r - s,
|
48
|
+
month: t.getMonth() + 1,
|
49
|
+
year: t.getFullYear()
|
50
|
+
});
|
43
51
|
return o.reverse(), o;
|
44
52
|
})();
|
45
|
-
for (;
|
46
|
-
|
47
|
-
const
|
48
|
-
const
|
49
|
-
for (let
|
50
|
-
o.push(
|
53
|
+
for (; i.getMonth() === _; )
|
54
|
+
w.push(i.getDate()), i.setDate(i.getDate() + 1);
|
55
|
+
const z = (() => {
|
56
|
+
const r = 42 - (A.length + w.length), o = [], s = e.m === 11 ? 0 : e.m + 1, y = e.m === 11 ? e.y + 1 : e.y;
|
57
|
+
for (let b = 1; b <= r; b++)
|
58
|
+
o.push({
|
59
|
+
day: b,
|
60
|
+
month: s,
|
61
|
+
year: y
|
62
|
+
});
|
51
63
|
return o;
|
52
|
-
})(),
|
53
|
-
|
54
|
-
},
|
55
|
-
|
56
|
-
},
|
57
|
-
|
58
|
-
},
|
59
|
-
const
|
60
|
-
if (
|
64
|
+
})(), G = () => {
|
65
|
+
S(!1);
|
66
|
+
}, U = () => {
|
67
|
+
k(F(e.m + 1, e.y));
|
68
|
+
}, V = () => {
|
69
|
+
k(F(e.m - 1, e.y));
|
70
|
+
}, Y = (t) => {
|
71
|
+
const r = new Date(t);
|
72
|
+
if (r.setHours(0, 0, 0, 0), x && x.getTime() > t)
|
61
73
|
return !0;
|
62
|
-
if (
|
74
|
+
if (T) {
|
63
75
|
const o = /* @__PURE__ */ new Date();
|
64
|
-
if (o.setHours(0, 0, 0, 0),
|
76
|
+
if (o.setHours(0, 0, 0, 0), r.getTime() > o.getTime()) return !0;
|
65
77
|
}
|
66
|
-
if (
|
78
|
+
if (j) {
|
67
79
|
const o = /* @__PURE__ */ new Date();
|
68
80
|
if (o.setHours(0, 0, 0, 0), t < o.getTime()) return !0;
|
69
81
|
}
|
70
|
-
if (
|
71
|
-
if (
|
72
|
-
const [o, s] =
|
73
|
-
if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0),
|
82
|
+
if (v && v(r)) return !0;
|
83
|
+
if (M) {
|
84
|
+
const [o, s] = M, y = new Date(t);
|
85
|
+
if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), y < o || y > s) return !0;
|
74
86
|
}
|
75
87
|
return !1;
|
76
|
-
},
|
77
|
-
|
88
|
+
}, W = (t) => {
|
89
|
+
Y(
|
78
90
|
(/* @__PURE__ */ new Date(
|
79
|
-
`${
|
91
|
+
`${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
|
80
92
|
)).getTime()
|
81
|
-
) || (
|
93
|
+
) || (O(
|
82
94
|
/* @__PURE__ */ new Date(
|
83
|
-
`${
|
95
|
+
`${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
|
84
96
|
)
|
85
|
-
),
|
97
|
+
), G());
|
86
98
|
};
|
87
|
-
return /* @__PURE__ */
|
99
|
+
return /* @__PURE__ */ D(
|
88
100
|
"div",
|
89
101
|
{
|
90
|
-
className:
|
91
|
-
|
102
|
+
className: l(
|
103
|
+
n["calendar-block"],
|
104
|
+
P && n[`calendar-block--position-${P}`]
|
105
|
+
),
|
106
|
+
ref: C,
|
92
107
|
"data-testid": "calendar-modal",
|
93
108
|
children: [
|
94
|
-
/* @__PURE__ */
|
95
|
-
/* @__PURE__ */
|
96
|
-
|
109
|
+
/* @__PURE__ */ D("div", { className: n.h, children: [
|
110
|
+
/* @__PURE__ */ m(
|
111
|
+
H,
|
97
112
|
{
|
98
113
|
isIconButton: !0,
|
99
114
|
iconName: "DropdownArrowLeft16px",
|
100
|
-
onClick:
|
115
|
+
onClick: V,
|
101
116
|
variant: "secondary-gray",
|
102
117
|
size: "l"
|
103
118
|
}
|
104
119
|
),
|
105
|
-
/* @__PURE__ */
|
120
|
+
/* @__PURE__ */ D(
|
106
121
|
"button",
|
107
122
|
{
|
108
123
|
type: "button",
|
109
124
|
className: n.d,
|
110
|
-
onClick: () =>
|
125
|
+
onClick: () => h == null ? void 0 : h("months"),
|
111
126
|
"data-testid": "month-year-button",
|
112
127
|
children: [
|
113
|
-
(
|
128
|
+
(B = c.Month(e.m)) == null ? void 0 : B.name,
|
114
129
|
"’",
|
115
|
-
|
116
|
-
/* @__PURE__ */
|
130
|
+
e.y.toString().slice(-2),
|
131
|
+
/* @__PURE__ */ m(J, { iconName: "DropdownArrowBottom16px" })
|
117
132
|
]
|
118
133
|
}
|
119
134
|
),
|
120
|
-
/* @__PURE__ */
|
121
|
-
|
135
|
+
/* @__PURE__ */ m(
|
136
|
+
H,
|
122
137
|
{
|
123
138
|
isIconButton: !0,
|
124
139
|
iconName: "DropdownArrowRight16px",
|
125
|
-
onClick:
|
140
|
+
onClick: U,
|
126
141
|
variant: "secondary-gray",
|
127
142
|
size: "l"
|
128
143
|
}
|
129
144
|
)
|
130
145
|
] }),
|
131
|
-
/* @__PURE__ */
|
132
|
-
|
146
|
+
/* @__PURE__ */ D("div", { className: n.b, children: [
|
147
|
+
K.map((t, r) => /* @__PURE__ */ m(
|
133
148
|
"div",
|
134
149
|
{
|
135
|
-
className:
|
136
|
-
[n.orange]:
|
150
|
+
className: l(n.m, {
|
151
|
+
[n.orange]: r > R
|
137
152
|
}),
|
138
153
|
children: t
|
139
154
|
},
|
140
|
-
`v${
|
155
|
+
`v${r}`
|
156
|
+
)),
|
157
|
+
A.map((t, r) => /* @__PURE__ */ m(
|
158
|
+
"div",
|
159
|
+
{
|
160
|
+
className: l(n.m, {
|
161
|
+
[n.current_disabled]: a.y === t.year && a.m === t.month && a.d === t.day
|
162
|
+
}),
|
163
|
+
children: t.day
|
164
|
+
},
|
165
|
+
r
|
141
166
|
)),
|
142
|
-
|
143
|
-
g.map((t, e) => /* @__PURE__ */ a(
|
167
|
+
w.map((t, r) => /* @__PURE__ */ m(
|
144
168
|
"button",
|
145
169
|
{
|
146
170
|
type: "button",
|
147
|
-
onClick: () =>
|
148
|
-
className:
|
149
|
-
|
171
|
+
onClick: () => W(t),
|
172
|
+
className: l(
|
173
|
+
Y(
|
150
174
|
(/* @__PURE__ */ new Date(
|
151
|
-
`${
|
175
|
+
`${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
|
152
176
|
)).getTime()
|
153
177
|
) ? n.m : n.a,
|
154
178
|
{
|
155
|
-
[n.current]:
|
179
|
+
[n.current]: a.y === e.y && a.m === e.m && a.d === t
|
180
|
+
},
|
181
|
+
{
|
182
|
+
[n.selecte]: f && N.y === e.y && N.m === e.m && N.d === t
|
156
183
|
}
|
157
184
|
),
|
158
185
|
children: t !== 0 && t
|
159
186
|
},
|
160
|
-
|
187
|
+
r
|
161
188
|
)),
|
162
|
-
|
189
|
+
z.map((t, r) => /* @__PURE__ */ m(
|
190
|
+
"div",
|
191
|
+
{
|
192
|
+
className: l(n.m, {
|
193
|
+
[n.current_disabled]: a.y === t.year && a.m === t.month && a.d === t.day
|
194
|
+
}),
|
195
|
+
children: t.day
|
196
|
+
},
|
197
|
+
r
|
198
|
+
))
|
163
199
|
] })
|
164
200
|
]
|
165
201
|
}
|
166
202
|
);
|
167
203
|
};
|
168
204
|
export {
|
169
|
-
|
205
|
+
lt as DatePickerModal
|
170
206
|
};
|
@@ -1,134 +1,154 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { useState as
|
4
|
-
import { months as
|
5
|
-
import { useDatePickerPosition as
|
6
|
-
import { c } from "../../styles.module-
|
7
|
-
import { Icon as
|
8
|
-
import { formating as
|
9
|
-
import { Button as
|
10
|
-
const
|
11
|
-
date:
|
1
|
+
import { jsxs as g, jsx as f } from "react/jsx-runtime";
|
2
|
+
import { c as B } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as L } from "react";
|
4
|
+
import { months as q } from "./constants.js";
|
5
|
+
import { useDatePickerPosition as E } from "./hooks.js";
|
6
|
+
import { c as a } from "../../styles.module-BfkM1-KJ.js";
|
7
|
+
import { Icon as J } from "../../icons/Icon.js";
|
8
|
+
import { formating as H } from "../../utils/index.js";
|
9
|
+
import { Button as $ } from "../Button/Button.js";
|
10
|
+
const et = ({
|
11
|
+
date: A,
|
12
12
|
selectedDate: D,
|
13
|
-
onChangeValue:
|
13
|
+
onChangeValue: G,
|
14
14
|
before: m,
|
15
15
|
onChangeType: y,
|
16
|
-
onChangeMonth:
|
17
|
-
disableFuture:
|
18
|
-
disablePast:
|
16
|
+
onChangeMonth: M,
|
17
|
+
disableFuture: I = !1,
|
18
|
+
disablePast: O = !1,
|
19
19
|
disabledDate: u,
|
20
|
-
validRange:
|
20
|
+
validRange: h
|
21
21
|
}) => {
|
22
|
-
const
|
23
|
-
y:
|
24
|
-
d:
|
25
|
-
m:
|
26
|
-
},
|
22
|
+
const [S, _] = E(), d = new Date(A), w = D ? new Date(D) : d, p = /* @__PURE__ */ new Date(), k = {
|
23
|
+
y: w.getFullYear(),
|
24
|
+
d: w.getDate(),
|
25
|
+
m: w.getMonth() + 1
|
26
|
+
}, x = {
|
27
27
|
y: d.getFullYear(),
|
28
28
|
d: d.getDate(),
|
29
29
|
m: d.getMonth() + 1
|
30
|
-
},
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
},
|
30
|
+
}, Y = {
|
31
|
+
y: p.getFullYear(),
|
32
|
+
d: p.getDate(),
|
33
|
+
m: p.getMonth() + 1
|
34
|
+
}, [t, v] = L(x.y), j = () => {
|
35
|
+
v(t + 1);
|
36
|
+
}, z = () => {
|
37
|
+
v(t - 1);
|
38
|
+
}, F = (e) => {
|
35
39
|
const i = /* @__PURE__ */ new Date(), n = i.getFullYear(), l = i.getMonth() + 1;
|
36
|
-
if (
|
37
|
-
const [r,
|
40
|
+
if (h) {
|
41
|
+
const [r, c] = h, o = new Date(t, e - 1, 1), s = new Date(t, e, 0);
|
38
42
|
o.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999);
|
39
|
-
const
|
40
|
-
|
41
|
-
const
|
42
|
-
if (
|
43
|
+
const N = new Date(r), P = new Date(c);
|
44
|
+
N.setHours(0, 0, 0, 0), P.setHours(23, 59, 59, 999);
|
45
|
+
const b = s < N, C = o > P;
|
46
|
+
if (b || C)
|
43
47
|
return !0;
|
44
48
|
}
|
45
49
|
if (m) {
|
46
|
-
const r = m.getFullYear(),
|
47
|
-
if (r > t || r === t &&
|
50
|
+
const r = m.getFullYear(), c = m.getMonth() + 1;
|
51
|
+
if (r > t || r === t && c > e)
|
48
52
|
return !0;
|
49
53
|
}
|
50
|
-
if (
|
54
|
+
if (I && (t > n || t === n && e > l) || O && (t < n || t === n && e < l))
|
51
55
|
return !0;
|
52
56
|
if (u) {
|
53
|
-
const r = new Date(t, e, 0).getDate(),
|
54
|
-
for (const o of
|
57
|
+
const r = new Date(t, e, 0).getDate(), c = [1, Math.ceil(r / 2), r];
|
58
|
+
for (const o of c) {
|
55
59
|
const s = new Date(t, e - 1, o);
|
56
60
|
if (!u(s)) return !1;
|
57
61
|
}
|
58
62
|
for (let o = 2; o < r; o += 3) {
|
59
|
-
if (
|
63
|
+
if (c.includes(o)) continue;
|
60
64
|
const s = new Date(t, e - 1, o);
|
61
65
|
if (!u(s)) return !1;
|
62
66
|
}
|
63
67
|
for (let o = 1; o <= r; o++) {
|
64
|
-
if (
|
68
|
+
if (c.includes(o) || (o - 2) % 3 === 0) continue;
|
65
69
|
const s = new Date(t, e - 1, o);
|
66
70
|
if (!u(s)) return !1;
|
67
71
|
}
|
68
72
|
return !0;
|
69
73
|
}
|
70
74
|
return !1;
|
71
|
-
},
|
72
|
-
|
75
|
+
}, R = (e) => {
|
76
|
+
F(e) || (M ? M(t, e) : G(
|
73
77
|
/* @__PURE__ */ new Date(
|
74
|
-
`${t}-${
|
78
|
+
`${t}-${H.Number(2, e)}-${H.Number(2, x.d)}`
|
75
79
|
)
|
76
80
|
));
|
77
81
|
};
|
78
|
-
return /* @__PURE__ */
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
iconName: "DropdownArrowLeft16px",
|
85
|
-
onClick: S,
|
86
|
-
variant: "secondary-gray",
|
87
|
-
size: "l"
|
88
|
-
}
|
89
|
-
),
|
90
|
-
/* @__PURE__ */ w(
|
91
|
-
"button",
|
92
|
-
{
|
93
|
-
type: "button",
|
94
|
-
onClick: () => y == null ? void 0 : y("years"),
|
95
|
-
className: c.d,
|
96
|
-
"data-testid": "year-button",
|
97
|
-
children: [
|
98
|
-
t.toString(),
|
99
|
-
/* @__PURE__ */ f(b, { iconName: "DropdownArrowBottom16px" })
|
100
|
-
]
|
101
|
-
}
|
82
|
+
return /* @__PURE__ */ g(
|
83
|
+
"div",
|
84
|
+
{
|
85
|
+
className: B(
|
86
|
+
a["calendar-block"],
|
87
|
+
a[`calendar-block--position-${_}`]
|
102
88
|
),
|
103
|
-
|
104
|
-
|
105
|
-
{
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
89
|
+
ref: S,
|
90
|
+
children: [
|
91
|
+
/* @__PURE__ */ g("div", { className: a.h, children: [
|
92
|
+
/* @__PURE__ */ f(
|
93
|
+
$,
|
94
|
+
{
|
95
|
+
isIconButton: !0,
|
96
|
+
iconName: "DropdownArrowLeft16px",
|
97
|
+
onClick: z,
|
98
|
+
variant: "secondary-gray",
|
99
|
+
size: "l"
|
100
|
+
}
|
101
|
+
),
|
102
|
+
/* @__PURE__ */ g(
|
103
|
+
"button",
|
104
|
+
{
|
105
|
+
type: "button",
|
106
|
+
onClick: () => y == null ? void 0 : y("years"),
|
107
|
+
className: a.d,
|
108
|
+
"data-testid": "year-button",
|
109
|
+
children: [
|
110
|
+
t.toString(),
|
111
|
+
/* @__PURE__ */ f(J, { iconName: "DropdownArrowBottom16px" })
|
112
|
+
]
|
113
|
+
}
|
114
|
+
),
|
115
|
+
/* @__PURE__ */ f(
|
116
|
+
$,
|
117
|
+
{
|
118
|
+
isIconButton: !0,
|
119
|
+
iconName: "DropdownArrowRight16px",
|
120
|
+
onClick: j,
|
121
|
+
variant: "secondary-gray",
|
122
|
+
size: "l"
|
123
|
+
}
|
124
|
+
)
|
125
|
+
] }),
|
126
|
+
/* @__PURE__ */ f("div", { className: a.monthGrid, "data-testid": "month-picker", children: q.map((e, i) => {
|
127
|
+
const n = i + 1, l = F(n);
|
128
|
+
return /* @__PURE__ */ f(
|
129
|
+
"button",
|
130
|
+
{
|
131
|
+
type: "button",
|
132
|
+
onClick: () => R(n),
|
133
|
+
disabled: l,
|
134
|
+
className: B(
|
135
|
+
l ? a.m : a.a,
|
136
|
+
{
|
137
|
+
[a.current]: Y.y === t && Y.m === n
|
138
|
+
},
|
139
|
+
{
|
140
|
+
[a.selecte]: D && k.y === t && k.m === n
|
141
|
+
}
|
142
|
+
),
|
143
|
+
children: e
|
144
|
+
},
|
145
|
+
i
|
146
|
+
);
|
147
|
+
}) })
|
148
|
+
]
|
149
|
+
}
|
150
|
+
);
|
131
151
|
};
|
132
152
|
export {
|
133
|
-
|
153
|
+
et as MonthPickerModal
|
134
154
|
};
|