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