mimir-ui-kit 1.42.1 → 1.43.0
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/CardTrail.css +1 -1
- 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/CardTrail/CardTrail.js +47 -46
- package/dist/components/CardTrail/utils.d.ts +0 -1
- package/dist/components/CardTrail/utils.js +7 -8
- 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/Image/Image.d.ts +16 -0
- package/dist/components/Image/Image.js +65 -37
- 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/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
@@ -6,52 +6,53 @@ import { hasHorizontalScroll as g, isScrollAtEdge as T } from "./utils.js";
|
|
6
6
|
import { useMergeRefs as Q } from "../../hooks/useMergeRefs/useMergeRefs.js";
|
7
7
|
import { useThrottledCallback as Z } from "../../hooks/useThrottledCallback/index.js";
|
8
8
|
import { MergedButton as rr } from "../MergedButton/MergedButton.js";
|
9
|
-
import '../../assets/CardTrail.css';const tr = "
|
10
|
-
"card-trail": "_card-
|
11
|
-
"card-trail-header": "_card-trail-
|
12
|
-
"card-trail-header-title": "_card-trail-header-
|
13
|
-
"card-trail-header-merged-button": "_card-trail-header-merged-
|
14
|
-
"card-trail-list": "_card-trail-
|
15
|
-
"card-trail-list-item": "_card-trail-list-
|
9
|
+
import '../../assets/CardTrail.css';const tr = "_pointer_1wzbr_50", i = {
|
10
|
+
"card-trail": "_card-trail_1wzbr_3",
|
11
|
+
"card-trail-header": "_card-trail-header_1wzbr_7",
|
12
|
+
"card-trail-header-title": "_card-trail-header-title_1wzbr_15",
|
13
|
+
"card-trail-header-merged-button": "_card-trail-header-merged-button_1wzbr_29",
|
14
|
+
"card-trail-list": "_card-trail-list_1wzbr_32",
|
15
|
+
"card-trail-list-item": "_card-trail-list-item_1wzbr_46",
|
16
16
|
pointer: tr
|
17
17
|
};
|
18
18
|
let v = {};
|
19
|
-
const dr = q((
|
19
|
+
const dr = q((w, D) => {
|
20
20
|
const {
|
21
|
-
cardClassName:
|
22
|
-
cardTrailClassName:
|
23
|
-
cardTrailHeaderClassName:
|
24
|
-
cardTrailListClassName:
|
25
|
-
cardTrailMergedButtonClassName:
|
26
|
-
children:
|
27
|
-
title:
|
21
|
+
cardClassName: L,
|
22
|
+
cardTrailClassName: z,
|
23
|
+
cardTrailHeaderClassName: W,
|
24
|
+
cardTrailListClassName: A,
|
25
|
+
cardTrailMergedButtonClassName: R,
|
26
|
+
children: b,
|
27
|
+
title: p,
|
28
28
|
spaceBetween: o = Y,
|
29
|
-
scrollStep:
|
30
|
-
dividedCardWidth:
|
29
|
+
scrollStep: C = G,
|
30
|
+
dividedCardWidth: k = J,
|
31
31
|
currentCardIndex: h = K,
|
32
|
-
mergedButtonProps:
|
33
|
-
scrollToCard:
|
34
|
-
needButtons:
|
32
|
+
mergedButtonProps: c,
|
33
|
+
scrollToCard: B = !1,
|
34
|
+
needButtons: I = !0,
|
35
35
|
padding: l = 0
|
36
|
-
} =
|
36
|
+
} = w, r = f(null), N = f(!0), s = f(null), [d, y] = _({
|
37
37
|
leftButton: !0,
|
38
38
|
rightButton: !1
|
39
39
|
}), [M, x] = _(0), [U, E] = _(
|
40
40
|
() => g(r == null ? void 0 : r.current)
|
41
|
-
), F = Q(r,
|
41
|
+
), F = Q(r, D), H = Z(() => {
|
42
42
|
var a;
|
43
43
|
if (N.current) {
|
44
44
|
N.current = !1;
|
45
45
|
const m = r.current, V = ((a = m == null ? void 0 : m.children[h]) == null ? void 0 : a.clientWidth) ?? 0;
|
46
46
|
x(
|
47
|
-
V /
|
48
|
-
)
|
49
|
-
paddingLeft: l,
|
50
|
-
paddingRight: l,
|
51
|
-
marginLeft: -l,
|
52
|
-
marginRight: -l
|
53
|
-
};
|
47
|
+
V / k + l + o
|
48
|
+
);
|
54
49
|
}
|
50
|
+
v = {
|
51
|
+
paddingLeft: l,
|
52
|
+
paddingRight: l,
|
53
|
+
marginLeft: -l,
|
54
|
+
marginRight: -l
|
55
|
+
};
|
55
56
|
const t = !T(r.current, "left"), e = !T(r.current, "right");
|
56
57
|
y({
|
57
58
|
leftButton: !t,
|
@@ -59,7 +60,7 @@ const dr = q((D, L) => {
|
|
59
60
|
});
|
60
61
|
}, 300), O = (t) => () => {
|
61
62
|
var a;
|
62
|
-
if (!
|
63
|
+
if (!B)
|
63
64
|
return;
|
64
65
|
const e = (a = r == null ? void 0 : r.current) == null ? void 0 : a.querySelector(
|
65
66
|
`[data-active-card='${t}']`
|
@@ -74,7 +75,7 @@ const dr = q((D, L) => {
|
|
74
75
|
if (!r.current || d.leftButton) return;
|
75
76
|
const t = r.current, e = ((a = t.children[h]) == null ? void 0 : a.clientWidth) ?? 0;
|
76
77
|
t.scrollBy({
|
77
|
-
left: -(e + o) *
|
78
|
+
left: -(e + o) * C,
|
78
79
|
behavior: "smooth"
|
79
80
|
});
|
80
81
|
}, j = () => {
|
@@ -82,7 +83,7 @@ const dr = q((D, L) => {
|
|
82
83
|
if (!r.current || d.rightButton) return;
|
83
84
|
const t = r.current, e = ((a = t.children[h]) == null ? void 0 : a.clientWidth) ?? 0;
|
84
85
|
t.scrollBy({
|
85
|
-
left: (e + o) *
|
86
|
+
left: (e + o) * C,
|
86
87
|
behavior: "smooth"
|
87
88
|
});
|
88
89
|
};
|
@@ -94,22 +95,22 @@ const dr = q((D, L) => {
|
|
94
95
|
}), s.current.observe(t), E(g(r == null ? void 0 : r.current)), () => {
|
95
96
|
s.current && s.current.disconnect();
|
96
97
|
};
|
97
|
-
}, [
|
98
|
+
}, [b]), /* @__PURE__ */ S("section", { className: n(i["card-trail"], z), children: [
|
98
99
|
/* @__PURE__ */ S(
|
99
100
|
"header",
|
100
101
|
{
|
101
102
|
className: n(
|
102
|
-
|
103
|
-
|
103
|
+
i["card-trail-header"],
|
104
|
+
W
|
104
105
|
),
|
105
106
|
children: [
|
106
|
-
|
107
|
-
U &&
|
107
|
+
p && /* @__PURE__ */ u("h3", { className: i["card-trail-header-title"], children: p }),
|
108
|
+
U && I && /* @__PURE__ */ u(
|
108
109
|
rr,
|
109
110
|
{
|
110
111
|
buttonsWrapperClassName: n(
|
111
|
-
|
112
|
-
|
112
|
+
i["card-trail-header-merged-button"],
|
113
|
+
R
|
113
114
|
),
|
114
115
|
buttons: [
|
115
116
|
{
|
@@ -119,7 +120,7 @@ const dr = q((D, L) => {
|
|
119
120
|
onClick: $,
|
120
121
|
disabled: d.leftButton,
|
121
122
|
size: "s",
|
122
|
-
...
|
123
|
+
...c == null ? void 0 : c.leftButton
|
123
124
|
},
|
124
125
|
{
|
125
126
|
isIconButton: !0,
|
@@ -128,7 +129,7 @@ const dr = q((D, L) => {
|
|
128
129
|
onClick: j,
|
129
130
|
size: "s",
|
130
131
|
disabled: d.rightButton,
|
131
|
-
...
|
132
|
+
...c == null ? void 0 : c.rightButton
|
132
133
|
}
|
133
134
|
]
|
134
135
|
}
|
@@ -145,18 +146,18 @@ const dr = q((D, L) => {
|
|
145
146
|
scrollPadding: `0 ${M}px`,
|
146
147
|
...v
|
147
148
|
},
|
148
|
-
className: n(
|
149
|
+
className: n(i["card-trail-list"], A),
|
149
150
|
ref: F,
|
150
|
-
children: X.map(
|
151
|
+
children: X.map(b, (t, e) => /* @__PURE__ */ u(
|
151
152
|
"li",
|
152
153
|
{
|
153
154
|
onClick: O(e),
|
154
155
|
"data-active-card": e,
|
155
156
|
"data-testid": `card-trail-item-${e}`,
|
156
157
|
className: n(
|
157
|
-
|
158
|
-
{ [
|
159
|
-
|
158
|
+
i["card-trail-list-item"],
|
159
|
+
{ [i.pointer]: B },
|
160
|
+
L
|
160
161
|
),
|
161
162
|
children: t
|
162
163
|
}
|
@@ -7,4 +7,3 @@
|
|
7
7
|
*/
|
8
8
|
export declare const isScrollAtEdge: (container: HTMLElement | null, direction: "left" | "right", tolerance?: number) => boolean;
|
9
9
|
export declare const hasHorizontalScroll: (element: HTMLElement | null) => boolean;
|
10
|
-
export declare const getCardWidth: <E extends Element>(element?: E) => number;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
const
|
2
|
-
if (!
|
3
|
-
const { scrollLeft:
|
4
|
-
return
|
5
|
-
},
|
1
|
+
const c = (r, i, t = 1) => {
|
2
|
+
if (!r) return !0;
|
3
|
+
const { scrollLeft: l, scrollWidth: s, clientWidth: o } = r;
|
4
|
+
return i === "left" ? l <= t : l >= s - o - t;
|
5
|
+
}, e = (r) => r ? r.scrollWidth > r.clientWidth : !1;
|
6
6
|
export {
|
7
|
-
|
8
|
-
|
9
|
-
o as isScrollAtEdge
|
7
|
+
e as hasHorizontalScroll,
|
8
|
+
c as isScrollAtEdge
|
10
9
|
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsxs as L, jsx as p } from "react/jsx-runtime";
|
2
|
-
import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-
|
2
|
+
import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-wis2TUql.js";
|
3
3
|
import h, { useId as J, useState as Q, useMemo as Y, useCallback as Z, forwardRef as ee } from "react";
|
4
|
-
import { w as re } from "../../use-active-press-
|
5
|
-
import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-
|
4
|
+
import { w as re } from "../../use-active-press-CnDeVvQq.js";
|
5
|
+
import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-BmphTIGY.js";
|
6
6
|
import { r as be } from "../../bugs-diTMAGNw.js";
|
7
|
-
import { H as ue } from "../../field-
|
7
|
+
import { H as ue } from "../../field-BLi5834s.js";
|
8
8
|
import { c as me } from "../../index-DIxK0V-G.js";
|
9
9
|
import { Icon as fe } from "../../icons/Icon.js";
|
10
10
|
import '../../assets/CheckboxMimir.css';let pe = "span";
|
@@ -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 {};
|