mimir-ui-kit 1.42.2 → 1.43.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/ProgressBar-COdzy3fY.js +67 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Switcher.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/hooks.css +1 -0
- package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
- package/dist/components/Accordion/Accordion.d.ts +6 -0
- package/dist/components/Accordion/Accordion.js +202 -182
- package/dist/components/AnchorLink/Link.d.ts +2 -0
- package/dist/components/AnchorLink/Link.js +54 -42
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.js +125 -111
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerModal.js +97 -75
- package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/MonthPickerModal.js +96 -58
- package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/YearPickerModal.js +75 -57
- package/dist/components/Drawer/Drawer.d.ts +7 -1
- package/dist/components/Drawer/Drawer.js +122 -106
- package/dist/components/Drawer/hooks.d.ts +9 -0
- package/dist/components/Drawer/hooks.js +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/components/Dropdown/Dropdown.js +361 -343
- package/dist/components/Dropdown/constants.d.ts +11 -0
- package/dist/components/Dropdown/constants.js +5 -0
- package/dist/components/Dropdown/hooks.d.ts +19 -0
- package/dist/components/Dropdown/hooks.js +11 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +5 -2
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
- package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -5
- package/dist/components/MultiSelectSearch/index.d.ts +1 -1
- package/dist/components/MultiSelectSearch/index.js +5 -4
- package/dist/components/MultiSelectSearch/types.d.ts +33 -1
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
- package/dist/components/MultiSelectSearch/utils.js +31 -17
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/Pagination.js +137 -99
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
- package/dist/components/SelectSearch/SelectSearch.js +381 -220
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +3 -2
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +32 -1
- package/dist/components/SelectSearch/utils.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +28 -14
- package/dist/components/Slider/Slider.d.ts +6 -2
- package/dist/components/Slider/Slider.js +123 -109
- package/dist/components/Slider/utils.d.ts +1 -0
- package/dist/components/Slider/utils.js +4 -0
- package/dist/components/Switcher/Switcher.js +66 -59
- package/dist/components/Switcher/types.d.ts +1 -0
- package/dist/components/TabTrail/TabTrail.d.ts +9 -0
- package/dist/components/TabTrail/TabTrail.js +198 -190
- package/dist/components/Toasts/ProgressBar.d.ts +4 -2
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.d.ts +5 -1
- package/dist/components/Toasts/Toast.js +59 -44
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +154 -149
- package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
- package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
- package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
- package/dist/hooks/useTimer/index.d.ts +2 -1
- package/dist/hooks/useTimer/index.js +55 -41
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/index.js +182 -177
- package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
- package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
- package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
- package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
- package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
- package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
- package/package.json +3 -1
- package/dist/ProgressBar-DEFs1tWq.js +0 -55
- package/dist/assets/Dropdown.css +0 -1
- package/dist/components/Pagination/types.d.ts +0 -0
@@ -49,6 +49,22 @@ export type TProps = {
|
|
49
49
|
* Флаг отправки промежуточных значений в родительский компонент
|
50
50
|
*/
|
51
51
|
sendIntermediateValues?: boolean;
|
52
|
+
/**
|
53
|
+
* Флаг отключения выбора будущих дат
|
54
|
+
*/
|
55
|
+
disableFuture?: boolean;
|
56
|
+
/**
|
57
|
+
* Флаг отключения выбора прошлых дат
|
58
|
+
*/
|
59
|
+
disablePast?: boolean;
|
60
|
+
/**
|
61
|
+
* Функция для определения недоступных дат
|
62
|
+
*/
|
63
|
+
disabledDate?: (date: Date) => boolean;
|
64
|
+
/**
|
65
|
+
* Диапазон доступных дат [от, до]
|
66
|
+
*/
|
67
|
+
validRange?: [Date | string, Date | string];
|
52
68
|
} & TInputProps;
|
53
69
|
export type TDatePickerValue = {
|
54
70
|
value?: string;
|
@@ -107,4 +123,20 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
|
|
107
123
|
* Флаг отправки промежуточных значений в родительский компонент
|
108
124
|
*/
|
109
125
|
sendIntermediateValues?: boolean;
|
126
|
+
/**
|
127
|
+
* Флаг отключения выбора будущих дат
|
128
|
+
*/
|
129
|
+
disableFuture?: boolean;
|
130
|
+
/**
|
131
|
+
* Флаг отключения выбора прошлых дат
|
132
|
+
*/
|
133
|
+
disablePast?: boolean;
|
134
|
+
/**
|
135
|
+
* Функция для определения недоступных дат
|
136
|
+
*/
|
137
|
+
disabledDate?: (date: Date) => boolean;
|
138
|
+
/**
|
139
|
+
* Диапазон доступных дат [от, до]
|
140
|
+
*/
|
141
|
+
validRange?: [Date | string, Date | string];
|
110
142
|
} & import('../Input/types').TInputProps & import('../Input').TAdditionalProps & import('react').RefAttributes<HTMLInputElement>>>;
|
@@ -1,164 +1,178 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { memo as
|
4
|
-
import { MAX_DAY as
|
5
|
-
import { DatePickerModal as
|
6
|
-
import { MonthPickerModal as
|
1
|
+
import { jsxs as E, jsx as m } from "react/jsx-runtime";
|
2
|
+
import { c as Y } from "../../index-DIxK0V-G.js";
|
3
|
+
import { memo as ot, forwardRef as ct, useState as N, useEffect as v } from "react";
|
4
|
+
import { MAX_DAY as at, MAX_MONTH as mt, DATE_LENGTH as ft } from "./constants.js";
|
5
|
+
import { DatePickerModal as pt } from "./DatePickerModal.js";
|
6
|
+
import { MonthPickerModal as dt } from "./MonthPickerModal.js";
|
7
7
|
import { c as e } from "../../styles.module-Cuqm31CO.js";
|
8
|
-
import { formatDatePart as
|
9
|
-
import { YearPickerModal as
|
10
|
-
import { useClickOutside as
|
11
|
-
import { Icon as
|
12
|
-
import { formating as
|
13
|
-
import { I as
|
14
|
-
import { EInputStatus as
|
15
|
-
const
|
16
|
-
days:
|
17
|
-
months:
|
18
|
-
years:
|
19
|
-
},
|
20
|
-
|
8
|
+
import { formatDatePart as F } from "./utils.js";
|
9
|
+
import { YearPickerModal as yt } from "./YearPickerModal.js";
|
10
|
+
import { useClickOutside as nt } from "../../hooks/useClickOutside/useClickOutside.js";
|
11
|
+
import { Icon as G } from "../../icons/Icon.js";
|
12
|
+
import { formating as D } from "../../utils/index.js";
|
13
|
+
import { I as lt } from "../../Input-BU_6U1CW.js";
|
14
|
+
import { EInputStatus as Dt, EInputSize as K } from "../Input/constants.js";
|
15
|
+
const wt = {
|
16
|
+
days: pt,
|
17
|
+
months: dt,
|
18
|
+
years: yt
|
19
|
+
}, Nt = ot(
|
20
|
+
ct(
|
21
21
|
({
|
22
|
-
size:
|
22
|
+
size: $,
|
23
23
|
value: i,
|
24
|
-
onChangeValue:
|
24
|
+
onChangeValue: s,
|
25
25
|
name: c,
|
26
|
-
before:
|
27
|
-
type:
|
28
|
-
error:
|
29
|
-
onError:
|
26
|
+
before: _,
|
27
|
+
type: d = "days",
|
28
|
+
error: j,
|
29
|
+
onError: y,
|
30
30
|
onBlur: r,
|
31
|
-
validateImmediately:
|
32
|
-
variant:
|
33
|
-
disabled:
|
34
|
-
editable:
|
35
|
-
openOnInput:
|
36
|
-
sendIntermediateValues:
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
validateImmediately: g,
|
32
|
+
variant: W,
|
33
|
+
disabled: b = !1,
|
34
|
+
editable: k = !1,
|
35
|
+
openOnInput: H = !0,
|
36
|
+
sendIntermediateValues: q = !1,
|
37
|
+
disableFuture: J = !1,
|
38
|
+
disablePast: Q = !1,
|
39
|
+
disabledDate: Z,
|
40
|
+
validRange: f,
|
41
|
+
...A
|
42
|
+
}, z) => {
|
43
|
+
const [I, p] = N(!1), [h, n] = N(d), [a, P] = N(
|
40
44
|
() => i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
|
41
|
-
), [
|
42
|
-
|
43
|
-
|
44
|
-
}, [
|
45
|
-
|
45
|
+
), [T, u] = N(j), [R, M] = N("");
|
46
|
+
A.status = !!T && Dt.Error || A.status, v(() => {
|
47
|
+
u(j);
|
48
|
+
}, [j]), v(() => {
|
49
|
+
P(
|
46
50
|
i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
|
47
51
|
);
|
48
|
-
}, [i]),
|
49
|
-
a && typeof a != "string" && !isNaN(a == null ? void 0 : a.getTime()) ?
|
52
|
+
}, [i]), v(() => {
|
53
|
+
a && typeof a != "string" && !isNaN(a == null ? void 0 : a.getTime()) ? M(D.Date(a, "dd/mm/yyyy")) : M("");
|
50
54
|
}, [a]);
|
51
|
-
const
|
52
|
-
|
53
|
-
|
54
|
-
}, [
|
55
|
-
isActive:
|
56
|
-
setActive: (
|
57
|
-
|
55
|
+
const L = i && new Date(i).getTime;
|
56
|
+
v(() => {
|
57
|
+
g && (L ? (u(!1), y == null || y({ name: c, active: !1 })) : (u(!0), y == null || y({ name: c, active: !0 })));
|
58
|
+
}, [g, c, L]), nt({
|
59
|
+
isActive: I,
|
60
|
+
setActive: (t) => {
|
61
|
+
p(t), n(d);
|
58
62
|
},
|
59
63
|
className: e["calendar-block"]
|
60
64
|
});
|
61
|
-
const
|
62
|
-
!
|
63
|
-
},
|
64
|
-
isNaN(
|
65
|
-
value:
|
65
|
+
const C = () => {
|
66
|
+
!b && (H || !k) && p(!0);
|
67
|
+
}, B = (t) => {
|
68
|
+
isNaN(t.getTime()) || (P(t), s == null || s({
|
69
|
+
value: D.Date(t, "yyyy-mm-dd"),
|
66
70
|
name: c
|
67
|
-
})),
|
68
|
-
value:
|
71
|
+
})), h === "years" && (d === "years" ? (p(!1), n(d)) : n("months")), h === "months" && (d === "months" ? (p(!1), n(d)) : n("days")), P(t), s == null || s({
|
72
|
+
value: D.Date(t, "yyyy-mm-dd"),
|
69
73
|
name: c
|
70
|
-
}), r == null || r(
|
71
|
-
},
|
72
|
-
if (
|
73
|
-
const
|
74
|
-
if (
|
75
|
-
|
74
|
+
}), r == null || r(D.Date(t, "yyyy-mm-dd"));
|
75
|
+
}, V = (t) => {
|
76
|
+
if (k) {
|
77
|
+
const o = t.target.value.replace(/[^\d]/g, "");
|
78
|
+
if (o.length === 0)
|
79
|
+
M(""), s == null || s({ value: "", name: c }), r == null || r("");
|
76
80
|
else {
|
77
|
-
const [
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
],
|
82
|
-
if (
|
83
|
-
const
|
84
|
-
|
85
|
-
value:
|
81
|
+
const [l, x, w] = [
|
82
|
+
F(o.substring(0, 2), at),
|
83
|
+
F(o.substring(2, 4), mt),
|
84
|
+
o.substring(4, 8)
|
85
|
+
], X = [l, x, w].filter(Boolean).join("/");
|
86
|
+
if (M(X), q) {
|
87
|
+
const O = w ? `${w}-${x || "00"}-${l || "00"}` : [l, x, w].filter(Boolean).join("-");
|
88
|
+
s == null || s({
|
89
|
+
value: O,
|
86
90
|
name: c
|
87
91
|
});
|
88
92
|
}
|
89
|
-
if (
|
90
|
-
const
|
91
|
-
`${
|
93
|
+
if (X.length === ft) {
|
94
|
+
const O = parseInt(w), S = /* @__PURE__ */ new Date(
|
95
|
+
`${O}-${x.padStart(2, "0")}-${l.padStart(2, "0")}`
|
92
96
|
);
|
93
|
-
isNaN(
|
94
|
-
value:
|
97
|
+
isNaN(S.getTime()) || (P(S), s == null || s({
|
98
|
+
value: D.Date(S, "yyyy-mm-dd"),
|
95
99
|
name: c
|
96
|
-
}), r == null || r(
|
100
|
+
}), r == null || r(D.Date(S, "yyyy-mm-dd")));
|
97
101
|
}
|
98
102
|
}
|
99
103
|
}
|
100
|
-
},
|
101
|
-
|
104
|
+
}, tt = Y(e.wrapper, I && e.active), st = Y(e.input, e.inputBorderControl);
|
105
|
+
let U;
|
106
|
+
if (f) {
|
107
|
+
let t, o;
|
108
|
+
typeof f[0] == "string" ? t = new Date(f[0]) : t = f[0], typeof f[1] == "string" ? o = new Date(f[1]) : o = f[1], U = [t, o];
|
109
|
+
}
|
110
|
+
const et = {
|
111
|
+
onChangeValue: B,
|
102
112
|
date: a || /* @__PURE__ */ new Date(),
|
103
|
-
before: typeof
|
104
|
-
onChangeType:
|
105
|
-
setIsActive:
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
113
|
+
before: typeof _ == "string" ? new Date(_) : _,
|
114
|
+
onChangeType: n,
|
115
|
+
setIsActive: p,
|
116
|
+
disableFuture: J,
|
117
|
+
disablePast: Q,
|
118
|
+
disabledDate: Z,
|
119
|
+
validRange: U
|
120
|
+
}, it = wt[h], rt = ({ isActive: t }) => /* @__PURE__ */ m("button", { onClick: (l) => {
|
121
|
+
l.stopPropagation(), b || p(!t);
|
122
|
+
}, className: e["icon-button"], children: t ? /* @__PURE__ */ m(
|
123
|
+
G,
|
110
124
|
{
|
111
|
-
iconName:
|
125
|
+
iconName: $ === K.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
|
112
126
|
}
|
113
|
-
) : /* @__PURE__ */
|
114
|
-
|
127
|
+
) : /* @__PURE__ */ m(
|
128
|
+
G,
|
115
129
|
{
|
116
|
-
iconName:
|
130
|
+
iconName: $ === K.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
|
117
131
|
}
|
118
132
|
) });
|
119
|
-
return /* @__PURE__ */
|
120
|
-
/* @__PURE__ */
|
121
|
-
/* @__PURE__ */
|
133
|
+
return /* @__PURE__ */ E("div", { className: e["input-field-group-datePicker"], children: [
|
134
|
+
/* @__PURE__ */ E("div", { className: tt, "data-disabled": b, children: [
|
135
|
+
/* @__PURE__ */ m(
|
122
136
|
"div",
|
123
137
|
{
|
124
138
|
role: "button",
|
125
|
-
"data-status":
|
126
|
-
className:
|
127
|
-
[e.editable]:
|
139
|
+
"data-status": A.status,
|
140
|
+
className: Y(e["date-wrapper"], {
|
141
|
+
[e.editable]: k
|
128
142
|
}),
|
129
|
-
onClick:
|
130
|
-
children: /* @__PURE__ */
|
131
|
-
|
143
|
+
onClick: C,
|
144
|
+
children: /* @__PURE__ */ m(
|
145
|
+
lt,
|
132
146
|
{
|
133
|
-
ref:
|
134
|
-
className:
|
147
|
+
ref: z,
|
148
|
+
className: st,
|
135
149
|
wrapperClassName: e["input-wrapper"],
|
136
|
-
size:
|
150
|
+
size: $,
|
137
151
|
type: "text",
|
138
|
-
variant:
|
139
|
-
value:
|
140
|
-
onChange:
|
152
|
+
variant: W,
|
153
|
+
value: R,
|
154
|
+
onChange: V,
|
141
155
|
rightAddon: {
|
142
156
|
addonType: "react-node",
|
143
|
-
addonContent: /* @__PURE__ */
|
157
|
+
addonContent: /* @__PURE__ */ m(rt, { isActive: I })
|
144
158
|
},
|
145
159
|
rightSlotClassName: e["right-slot"],
|
146
160
|
onFocus: () => {
|
147
|
-
|
161
|
+
H && !k && p(!0);
|
148
162
|
},
|
149
|
-
...
|
163
|
+
...A
|
150
164
|
}
|
151
165
|
)
|
152
166
|
}
|
153
167
|
),
|
154
|
-
|
168
|
+
I && /* @__PURE__ */ m(it, { ...et })
|
155
169
|
] }),
|
156
|
-
|
170
|
+
T && typeof T == "string" && /* @__PURE__ */ m("div", { className: e.textError, children: T })
|
157
171
|
] });
|
158
172
|
}
|
159
173
|
)
|
160
174
|
);
|
161
|
-
|
175
|
+
Nt.displayName = "DatePicker";
|
162
176
|
export {
|
163
|
-
|
177
|
+
Nt as DatePicker
|
164
178
|
};
|
@@ -4,6 +4,10 @@ type TProps = {
|
|
4
4
|
onChangeValue: (date: Date) => void;
|
5
5
|
setIsActive: (isActive: boolean) => void;
|
6
6
|
onChangeType?: (s: 'days' | 'months' | 'years') => void;
|
7
|
+
disableFuture?: boolean;
|
8
|
+
disablePast?: boolean;
|
9
|
+
disabledDate?: (date: Date) => boolean;
|
10
|
+
validRange?: [Date, Date];
|
7
11
|
};
|
8
|
-
export declare const DatePickerModal: ({ date, onChangeValue, setIsActive, before, onChangeType }: TProps) => import("react/jsx-runtime").JSX.Element;
|
12
|
+
export declare const DatePickerModal: ({ date, onChangeValue, setIsActive, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
|
9
13
|
export {};
|
@@ -1,80 +1,102 @@
|
|
1
1
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
2
|
-
import { c as
|
3
|
-
import { useState as
|
4
|
-
import { week as
|
5
|
-
import { useDatePickerPosition as
|
6
|
-
import { c as
|
7
|
-
import { getUpdateDate as
|
8
|
-
import { Icon as
|
9
|
-
import { formating as
|
10
|
-
import { Button as
|
11
|
-
import { parseDate as
|
12
|
-
const
|
2
|
+
import { c as k } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as z } from "react";
|
4
|
+
import { week as G, COUNT_WORK_DAYS as U } from "./constants.js";
|
5
|
+
import { useDatePickerPosition as V } from "./hooks.js";
|
6
|
+
import { c as n } from "../../styles.module-Cuqm31CO.js";
|
7
|
+
import { getUpdateDate as P } from "./utils.js";
|
8
|
+
import { Icon as W } from "../../icons/Icon.js";
|
9
|
+
import { formating as m } from "../../utils/index.js";
|
10
|
+
import { Button as A } from "../Button/Button.js";
|
11
|
+
import { parseDate as B } from "../../utils/formating/Date.js";
|
12
|
+
const st = ({
|
13
13
|
date: i,
|
14
|
-
onChangeValue:
|
15
|
-
setIsActive:
|
16
|
-
before:
|
17
|
-
onChangeType: u
|
14
|
+
onChangeValue: H,
|
15
|
+
setIsActive: I,
|
16
|
+
before: g,
|
17
|
+
onChangeType: u,
|
18
|
+
disableFuture: O = !1,
|
19
|
+
disablePast: S = !1,
|
20
|
+
disabledDate: p,
|
21
|
+
validRange: h
|
18
22
|
}) => {
|
19
|
-
var
|
23
|
+
var M;
|
20
24
|
i = isNaN(new Date(i).getTime()) ? /* @__PURE__ */ new Date() : i;
|
21
|
-
const
|
22
|
-
y: d.getFullYear(),
|
23
|
-
d: d.getDate(),
|
24
|
-
m: d.getMonth() + 1
|
25
|
-
}, f = {
|
25
|
+
const D = B(i), d = B(i), f = {
|
26
26
|
y: D.getFullYear(),
|
27
27
|
d: D.getDate(),
|
28
28
|
m: D.getMonth() + 1
|
29
|
-
},
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
}, N = {
|
30
|
+
y: d.getFullYear(),
|
31
|
+
d: d.getDate(),
|
32
|
+
m: d.getMonth() + 1
|
33
|
+
}, [r, w] = z({ y: N.y, m: N.m }), T = V([r]), _ = (t) => {
|
34
|
+
let e = t.getDay();
|
35
|
+
return e === 0 && (e = 7), e - 1;
|
36
|
+
}, b = r.m - 1, c = new Date(r.y, b), y = [], v = (() => {
|
37
|
+
const t = new Date(c);
|
34
38
|
t.setDate(t.getDate() - 1);
|
35
|
-
const
|
36
|
-
for (let
|
37
|
-
|
38
|
-
return
|
39
|
+
const e = t.getDate(), o = [];
|
40
|
+
for (let s = 0; s < _(c); s++)
|
41
|
+
o.push(e - s);
|
42
|
+
return o.reverse(), o;
|
39
43
|
})();
|
40
|
-
for (;
|
41
|
-
|
42
|
-
const
|
43
|
-
const
|
44
|
-
for (let
|
45
|
-
|
46
|
-
return
|
47
|
-
})(),
|
48
|
-
|
49
|
-
}, C = () => {
|
50
|
-
g(M(e.m + 1, e.y));
|
44
|
+
for (; c.getMonth() === b; )
|
45
|
+
y.push(c.getDate()), c.setDate(c.getDate() + 1);
|
46
|
+
const j = (() => {
|
47
|
+
const e = 42 - (v.length + y.length), o = [];
|
48
|
+
for (let s = 1; s <= e; s++)
|
49
|
+
o.push(s);
|
50
|
+
return o;
|
51
|
+
})(), C = () => {
|
52
|
+
I(!1);
|
51
53
|
}, F = () => {
|
52
|
-
|
53
|
-
},
|
54
|
-
w(
|
54
|
+
w(P(r.m + 1, r.y));
|
55
|
+
}, L = () => {
|
56
|
+
w(P(r.m - 1, r.y));
|
57
|
+
}, x = (t) => {
|
58
|
+
const e = new Date(t);
|
59
|
+
if (e.setHours(0, 0, 0, 0), g && g.getTime() > t)
|
60
|
+
return !0;
|
61
|
+
if (O) {
|
62
|
+
const o = /* @__PURE__ */ new Date();
|
63
|
+
if (o.setHours(0, 0, 0, 0), e.getTime() > o.getTime()) return !0;
|
64
|
+
}
|
65
|
+
if (S) {
|
66
|
+
const o = /* @__PURE__ */ new Date();
|
67
|
+
if (o.setHours(0, 0, 0, 0), t < o.getTime()) return !0;
|
68
|
+
}
|
69
|
+
if (p && p(e)) return !0;
|
70
|
+
if (h) {
|
71
|
+
const [o, s] = h, $ = new Date(t);
|
72
|
+
if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), $ < o || $ > s) return !0;
|
73
|
+
}
|
74
|
+
return !1;
|
75
|
+
}, Y = (t) => {
|
76
|
+
x(
|
55
77
|
(/* @__PURE__ */ new Date(
|
56
|
-
`${
|
78
|
+
`${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
|
57
79
|
)).getTime()
|
58
|
-
) || (
|
80
|
+
) || (H(
|
59
81
|
/* @__PURE__ */ new Date(
|
60
|
-
`${
|
82
|
+
`${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
|
61
83
|
)
|
62
|
-
),
|
84
|
+
), C());
|
63
85
|
};
|
64
86
|
return /* @__PURE__ */ l(
|
65
87
|
"div",
|
66
88
|
{
|
67
|
-
className:
|
68
|
-
ref:
|
89
|
+
className: n["calendar-block"],
|
90
|
+
ref: T,
|
69
91
|
"data-testid": "calendar-modal",
|
70
92
|
children: [
|
71
|
-
/* @__PURE__ */ l("div", { className:
|
93
|
+
/* @__PURE__ */ l("div", { className: n.h, children: [
|
72
94
|
/* @__PURE__ */ a(
|
73
|
-
|
95
|
+
A,
|
74
96
|
{
|
75
97
|
isIconButton: !0,
|
76
98
|
iconName: "DropdownArrowLeft16px",
|
77
|
-
onClick:
|
99
|
+
onClick: L,
|
78
100
|
variant: "secondary-gray",
|
79
101
|
size: "l"
|
80
102
|
}
|
@@ -83,65 +105,65 @@ const tt = ({
|
|
83
105
|
"button",
|
84
106
|
{
|
85
107
|
type: "button",
|
86
|
-
className:
|
108
|
+
className: n.d,
|
87
109
|
onClick: () => u == null ? void 0 : u("months"),
|
88
110
|
"data-testid": "month-year-button",
|
89
111
|
children: [
|
90
|
-
(
|
112
|
+
(M = m.Month(r.m)) == null ? void 0 : M.name,
|
91
113
|
"’",
|
92
|
-
|
93
|
-
/* @__PURE__ */ a(
|
114
|
+
r.y.toString().slice(-2),
|
115
|
+
/* @__PURE__ */ a(W, { iconName: "DropdownArrowBottom16px" })
|
94
116
|
]
|
95
117
|
}
|
96
118
|
),
|
97
119
|
/* @__PURE__ */ a(
|
98
|
-
|
120
|
+
A,
|
99
121
|
{
|
100
122
|
isIconButton: !0,
|
101
123
|
iconName: "DropdownArrowRight16px",
|
102
|
-
onClick:
|
124
|
+
onClick: F,
|
103
125
|
variant: "secondary-gray",
|
104
126
|
size: "l"
|
105
127
|
}
|
106
128
|
)
|
107
129
|
] }),
|
108
|
-
/* @__PURE__ */ l("div", { className:
|
109
|
-
|
130
|
+
/* @__PURE__ */ l("div", { className: n.b, children: [
|
131
|
+
G.map((t, e) => /* @__PURE__ */ a(
|
110
132
|
"div",
|
111
133
|
{
|
112
|
-
className:
|
113
|
-
[
|
134
|
+
className: k(n.m, {
|
135
|
+
[n.orange]: e > U
|
114
136
|
}),
|
115
137
|
children: t
|
116
138
|
},
|
117
|
-
`v${
|
139
|
+
`v${e}`
|
118
140
|
)),
|
119
|
-
v.map((t,
|
120
|
-
|
141
|
+
v.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e)),
|
142
|
+
y.map((t, e) => /* @__PURE__ */ a(
|
121
143
|
"button",
|
122
144
|
{
|
123
145
|
type: "button",
|
124
|
-
onClick: () =>
|
125
|
-
className:
|
126
|
-
|
146
|
+
onClick: () => Y(t),
|
147
|
+
className: k(
|
148
|
+
x(
|
127
149
|
(/* @__PURE__ */ new Date(
|
128
|
-
`${
|
150
|
+
`${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
|
129
151
|
)).getTime()
|
130
|
-
) ?
|
152
|
+
) ? n.m : n.a,
|
131
153
|
{
|
132
|
-
[
|
154
|
+
[n.current]: f.y === r.y && f.m === r.m && f.d === t
|
133
155
|
}
|
134
156
|
),
|
135
157
|
children: t !== 0 && t
|
136
158
|
},
|
137
|
-
|
159
|
+
e
|
138
160
|
)),
|
139
|
-
|
161
|
+
j.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e))
|
140
162
|
] })
|
141
163
|
]
|
142
164
|
}
|
143
165
|
);
|
144
166
|
};
|
145
167
|
export {
|
146
|
-
|
168
|
+
st as DatePickerModal
|
147
169
|
};
|
@@ -3,6 +3,10 @@ type TProps = {
|
|
3
3
|
before?: Date;
|
4
4
|
onChangeValue: (date: Date) => void;
|
5
5
|
onChangeType?: (type: 'years') => void;
|
6
|
+
disableFuture?: boolean;
|
7
|
+
disablePast?: boolean;
|
8
|
+
disabledDate?: (date: Date) => boolean;
|
9
|
+
validRange?: [Date, Date];
|
6
10
|
};
|
7
|
-
export declare const MonthPickerModal: ({ date, onChangeValue, before, onChangeType }: TProps) => import("react/jsx-runtime").JSX.Element;
|
11
|
+
export declare const MonthPickerModal: ({ date, onChangeValue, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
|
8
12
|
export {};
|