mimir-ui-kit 1.64.4 → 1.65.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/assets/Drawer.css +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -4
- package/dist/components/DatePicker/DatePicker.js +195 -194
- package/dist/components/Drawer/Drawer.js +79 -78
- package/dist/components/Drawer/constants.d.ts +2 -1
- package/dist/components/Drawer/constants.js +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +11 -2
- package/dist/components/Dropdown/Dropdown.js +374 -358
- package/dist/components/Dropdown/hooks.d.ts +1 -1
- package/package.json +1 -1
package/dist/assets/Drawer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawerContainer_abn3o_2{position:fixed;z-index:1000000}._drawer_abn3o_2{--drawer-width: 808px;--drawer-z-index: 10000;position:fixed;z-index:10000;z-index:var(--drawer-z-index);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:808px;width:var(--drawer-width);height:100%;overflow:auto;background-color:var(--black-5);-webkit-transition:all .3s ease;transition:all .3s ease;pointer-events:none}._drawer_abn3o_2::-webkit-scrollbar{width:3px}._drawer_abn3o_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_abn3o_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_abn3o_2 ._content_abn3o_31{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-xs) var(--mimir-space-3xs) var(--mimir-space-4xl);overflow:hidden;-webkit-transition:all .3s ease;transition:all .3s ease}@media (max-width: 600px){._drawer_abn3o_2 ._content_abn3o_31{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_abn3o_2 ._header_abn3o_46{display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_abn3o_2 ._header_abn3o_46:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_abn3o_2 ._header_abn3o_46._sticky-header_abn3o_54{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_abn3o_2 ._header_abn3o_46 ._title_abn3o_60{-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-item-align:end;align-self:flex-end;font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-xl3);line-height:var(--mimir-space-2xxl);letter-spacing:.7px}@media (max-width: 600px){._drawer_abn3o_2 ._header_abn3o_46 ._title_abn3o_60{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_abn3o_2 ._header_abn3o_46 ._space_abn3o_74{-webkit-box-flex:0;-ms-flex:0 0 var(--button-height-m);flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_abn3o_2 ._header_abn3o_46{min-height:55px}._drawer_abn3o_2 ._header_abn3o_46:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_abn3o_2 ._inner_abn3o_85{-webkit-box-flex:1;-ms-flex:1;flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_abn3o_2 ._inner_abn3o_85._is-loading_abn3o_90{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media (max-width: 600px){._drawer_abn3o_2 ._inner_abn3o_85{padding-right:0}}._drawer_abn3o_2 ._button_abn3o_101{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_abn3o_2 ._footer_abn3o_106{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_abn3o_2 ._footer_abn3o_106{padding:var(--mimir-space-m)}}._drawer_abn3o_2 ._footer_abn3o_106._has-scroll_abn3o_115{-webkit-box-shadow:var(--mimir-modal-window-bottom-panel-shadow);box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_abn3o_2 ._footer-button_abn3o_118{display:block;margin-left:auto}._drawer_abn3o_2._left_abn3o_122{top:0;left:-100%}._drawer_abn3o_2._right_abn3o_126{top:0;right:-100%}._drawer_abn3o_2._center_abn3o_130{left:50%;top:50%;-webkit-transform:translate(-50%,-50%) scale(.95);transform:translate(-50%,-50%) scale(.95);height:auto;height:initial;border-radius:var(--mimir-control-radius);opacity:0;-webkit-transition:opacity .3s ease-in-out,-webkit-transform .3s ease-in-out;transition:opacity .3s ease-in-out,-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out,opacity .3s ease-in-out;transition:transform .3s ease-in-out,opacity .3s ease-in-out,-webkit-transform .3s ease-in-out}._drawer_abn3o_2._full_abn3o_139{top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;-webkit-transform:scale(.95);transform:scale(.95);opacity:0;-webkit-transition:opacity .3s ease-in-out,-webkit-transform .3s ease-in-out;transition:opacity .3s ease-in-out,-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out,opacity .3s ease-in-out;transition:transform .3s ease-in-out,opacity .3s ease-in-out,-webkit-transform .3s ease-in-out}._drawer_abn3o_2._bottom_abn3o_149{--drawer-width: calc(100% - var(--mimir-space-m));right:50%;bottom:-100%;left:50%;height:auto;max-height:calc(100% - var(--mimir-space-xs));border-top-left-radius:var(--mimir-control-radius);border-top-right-radius:var(--mimir-control-radius);-webkit-transform:translate(-50%,0);transform:translate(-50%)}._drawer_abn3o_2._bottom_abn3o_149._full-bottom-height_abn3o_160{height:calc(100% - var(--mimir-space-xs))}._drawer_abn3o_2._bottom_abn3o_149._is-loading_abn3o_90{height:50vh}._drawer_abn3o_2._opened_abn3o_166{-webkit-transition:all .3s ease;transition:all .3s ease;pointer-events:auto}._drawer_abn3o_2._opened_abn3o_166._left_abn3o_122{left:0%;-webkit-transition:left .3s ease;transition:left .3s ease}._drawer_abn3o_2._opened_abn3o_166._right_abn3o_126{right:0%;-webkit-transition:right .3s ease;transition:right .3s ease}._drawer_abn3o_2._opened_abn3o_166._bottom_abn3o_149{bottom:0%}._drawer_abn3o_2._opened_abn3o_166._full_abn3o_139{-webkit-transform:scale(1);transform:scale(1);opacity:1}._drawer_abn3o_2._opened_abn3o_166._center_abn3o_130{-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1);opacity:1}._drawer_abn3o_2._is-closing_abn3o_189._left_abn3o_122{left:-100%}._drawer_abn3o_2._is-closing_abn3o_189._right_abn3o_126{right:-100%}._drawer_abn3o_2._is-closing_abn3o_189._bottom_abn3o_149{bottom:-100%}._drawer_abn3o_2._is-closing_abn3o_189._full_abn3o_139{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}._drawer_abn3o_2._is-closing_abn3o_189._center_abn3o_130{-webkit-transform:translate(-50%,-50%) scale(.95);transform:translate(-50%,-50%) scale(.95);opacity:0}@media (max-width: 1440px){._drawer_abn3o_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_abn3o_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_abn3o_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_abn3o_2{--drawer-width: 100%}._drawer_abn3o_2._bottom_abn3o_149{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_abn3o_230{--overlay-z-index: 9990;position:fixed;top:0;left:0;z-index:9990;z-index:var(--overlay-z-index);width:100%;height:100%;background-color:#0009;opacity:0;-webkit-transition:all .3s ease;transition:all .3s ease;pointer-events:none}._overlay_abn3o_230._opened_abn3o_166{opacity:1;-webkit-transition:all .3s ease;transition:all .3s ease;pointer-events:auto}._overlay_abn3o_230._opened_abn3o_166._unmount_abn3o_248{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_abn3o_230._is-closing_abn3o_189{opacity:0;-webkit-transition:all .3s ease;transition:all .3s ease}._overlay_abn3o_230._unmount_abn3o_248{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FocusEventHandler } from 'react';
|
|
1
2
|
import { EDatePickerBorderRadius } from './constants';
|
|
2
3
|
import { TInputProps } from '../Input';
|
|
3
4
|
|
|
@@ -11,9 +12,9 @@ export type TProps = {
|
|
|
11
12
|
*/
|
|
12
13
|
onError?: (e: TDatePickerOnError) => void;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Стандартный обработчик потери фокуса input
|
|
15
16
|
*/
|
|
16
|
-
onBlur?:
|
|
17
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
17
18
|
/**
|
|
18
19
|
* Функция ограничения выбора даты (до какой даты выбор не доступен)
|
|
19
20
|
*/
|
|
@@ -106,9 +107,9 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
|
|
|
106
107
|
*/
|
|
107
108
|
onError?: (e: TDatePickerOnError) => void;
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
+
* Стандартный обработчик потери фокуса input
|
|
110
111
|
*/
|
|
111
|
-
onBlur?:
|
|
112
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
112
113
|
/**
|
|
113
114
|
* Функция ограничения выбора даты (до какой даты выбор не доступен)
|
|
114
115
|
*/
|
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { memo as ht, forwardRef as Mt, useState as
|
|
4
|
-
import { months as
|
|
1
|
+
import { jsxs as F, jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { memo as ht, forwardRef as Mt, useState as b, useEffect as P } from "react";
|
|
4
|
+
import { months as S, EDatePickerBorderRadius as C, MAX_DAY as gt, MAX_MONTH as Tt, DATE_LENGTH as $t } from "./constants.js";
|
|
5
5
|
import { DatePickerModal as bt } from "./DatePickerModal.js";
|
|
6
6
|
import { MonthPickerModal as At } from "./MonthPickerModal.js";
|
|
7
|
-
import { c as
|
|
8
|
-
import { formatDatePart as
|
|
7
|
+
import { c as m } from "../../styles.module-DjQdoVeY.js";
|
|
8
|
+
import { formatDatePart as R } from "./utils.js";
|
|
9
9
|
import { YearPickerModal as Pt } from "./YearPickerModal.js";
|
|
10
10
|
import { useClickOutside as St } from "../../hooks/useClickOutside/useClickOutside.js";
|
|
11
|
-
import { Icon as
|
|
11
|
+
import { Icon as V } from "../../icons/Icon.js";
|
|
12
12
|
import { formating as p } from "../../utils/index.js";
|
|
13
13
|
import { I as Yt } from "../../Input-JwHUiwVK.js";
|
|
14
|
-
import { EInputStatus as It, EInputSize as
|
|
14
|
+
import { EInputStatus as It, EInputSize as tt } from "../Input/constants.js";
|
|
15
15
|
const xt = ht(
|
|
16
16
|
Mt(
|
|
17
17
|
({
|
|
18
|
-
size:
|
|
19
|
-
value:
|
|
18
|
+
size: H,
|
|
19
|
+
value: w,
|
|
20
20
|
onChangeValue: r,
|
|
21
|
-
name:
|
|
22
|
-
before:
|
|
23
|
-
type:
|
|
24
|
-
dateFormat:
|
|
25
|
-
error:
|
|
26
|
-
onError:
|
|
27
|
-
onBlur:
|
|
28
|
-
validateImmediately:
|
|
21
|
+
name: d,
|
|
22
|
+
before: h,
|
|
23
|
+
type: f = "days",
|
|
24
|
+
dateFormat: N = "full",
|
|
25
|
+
error: B,
|
|
26
|
+
onError: g,
|
|
27
|
+
onBlur: et,
|
|
28
|
+
validateImmediately: G,
|
|
29
29
|
variant: st,
|
|
30
|
-
disabled:
|
|
31
|
-
editable:
|
|
32
|
-
openOnInput:
|
|
30
|
+
disabled: j = !1,
|
|
31
|
+
editable: A = !1,
|
|
32
|
+
openOnInput: W = !0,
|
|
33
33
|
sendIntermediateValues: rt = !1,
|
|
34
|
-
disableFuture:
|
|
35
|
-
disablePast:
|
|
36
|
-
disabledDate:
|
|
37
|
-
validRange:
|
|
38
|
-
borderRadius:
|
|
39
|
-
full:
|
|
40
|
-
position:
|
|
41
|
-
isFixed:
|
|
42
|
-
...
|
|
34
|
+
disableFuture: q = !1,
|
|
35
|
+
disablePast: J = !1,
|
|
36
|
+
disabledDate: E,
|
|
37
|
+
validRange: a,
|
|
38
|
+
borderRadius: L = C.All,
|
|
39
|
+
full: ot,
|
|
40
|
+
position: at,
|
|
41
|
+
isFixed: O = !1,
|
|
42
|
+
...Y
|
|
43
43
|
}, ct) => {
|
|
44
|
-
const [
|
|
45
|
-
() =>
|
|
46
|
-
), [
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
44
|
+
const [T, y] = b(!1), [_, u] = b(f), [i, M] = b(
|
|
45
|
+
() => w && !isNaN(new Date(w).getTime()) ? new Date(w) : void 0
|
|
46
|
+
), [I, U] = b(B), [it, x] = b(""), [nt, $] = b();
|
|
47
|
+
Y.status = !!I && It.Error || Y.status;
|
|
48
|
+
const K = () => {
|
|
49
|
+
y(!1);
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
if (!(
|
|
53
|
-
return window.addEventListener("scroll",
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
P(() => {
|
|
52
|
+
if (!(!T || !O))
|
|
53
|
+
return window.addEventListener("scroll", K, !0), () => window.removeEventListener("scroll", K, !0);
|
|
54
|
+
}, [T, O]), P(() => {
|
|
55
|
+
U(B);
|
|
56
|
+
}, [B]), P(() => {
|
|
57
|
+
M(
|
|
58
|
+
w && !isNaN(new Date(w).getTime()) ? new Date(w) : void 0
|
|
59
59
|
);
|
|
60
|
-
}, [
|
|
61
|
-
if (
|
|
60
|
+
}, [w]), P(() => {
|
|
61
|
+
if (i && typeof i != "string" && !isNaN(i == null ? void 0 : i.getTime())) {
|
|
62
62
|
let t = "";
|
|
63
|
-
switch (
|
|
63
|
+
switch (N) {
|
|
64
64
|
case "year": {
|
|
65
|
-
t =
|
|
65
|
+
t = i.getFullYear().toString();
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
case "month": {
|
|
69
|
-
const s =
|
|
69
|
+
const s = S[i.getMonth()], e = i.getFullYear();
|
|
70
70
|
t = `${s} ${e}`;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
case "full": {
|
|
74
|
-
t = p.Date(
|
|
74
|
+
t = p.Date(i, "dd/mm/yyyy");
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
default: {
|
|
78
|
-
t = p.Date(
|
|
78
|
+
t = p.Date(i, "dd/mm/yyyy");
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
x(t);
|
|
83
83
|
} else
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
isActive:
|
|
84
|
+
x("");
|
|
85
|
+
}, [i, N]);
|
|
86
|
+
const Q = w && new Date(w).getTime;
|
|
87
|
+
P(() => {
|
|
88
|
+
G && (Q ? (U(!1), g == null || g({ name: d, active: !1 })) : (U(!0), g == null || g({ name: d, active: !0 })));
|
|
89
|
+
}, [G, d, Q]), St({
|
|
90
|
+
isActive: T,
|
|
91
91
|
setActive: (t) => {
|
|
92
|
-
|
|
92
|
+
y(t), u(f), t || $(void 0);
|
|
93
93
|
},
|
|
94
|
-
className:
|
|
94
|
+
className: m["calendar-block"]
|
|
95
95
|
});
|
|
96
|
-
const
|
|
97
|
-
!
|
|
98
|
-
},
|
|
96
|
+
const ft = () => {
|
|
97
|
+
!j && (W || !A) && y(!0);
|
|
98
|
+
}, Z = (t) => {
|
|
99
99
|
const s = t.getTime();
|
|
100
|
-
if (t.setHours(0, 0, 0, 0),
|
|
100
|
+
if (t.setHours(0, 0, 0, 0), h && (typeof h == "string" ? new Date(h) : h).getTime() > s)
|
|
101
101
|
return !1;
|
|
102
|
-
if (
|
|
102
|
+
if (q) {
|
|
103
103
|
const e = /* @__PURE__ */ new Date();
|
|
104
104
|
if (e.setHours(0, 0, 0, 0), t.getTime() > e.getTime()) return !1;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (J) {
|
|
107
107
|
const e = /* @__PURE__ */ new Date();
|
|
108
108
|
if (e.setHours(0, 0, 0, 0), s < e.getTime()) return !1;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
if (
|
|
110
|
+
if (E && E(t)) return !1;
|
|
111
|
+
if (a) {
|
|
112
112
|
let e;
|
|
113
|
-
typeof
|
|
114
|
-
new Date(
|
|
115
|
-
typeof
|
|
113
|
+
typeof a[0] == "string" ? e = [
|
|
114
|
+
new Date(a[0]),
|
|
115
|
+
typeof a[1] == "string" ? new Date(a[1]) : a[1]
|
|
116
116
|
] : e = [
|
|
117
|
-
|
|
118
|
-
typeof
|
|
117
|
+
a[0],
|
|
118
|
+
typeof a[1] == "string" ? new Date(a[1]) : a[1]
|
|
119
119
|
];
|
|
120
|
-
const [c,
|
|
121
|
-
if (
|
|
120
|
+
const [c, o] = e, l = new Date(c), n = new Date(o);
|
|
121
|
+
if (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999), t < l || t > n) return !1;
|
|
122
122
|
}
|
|
123
123
|
return !0;
|
|
124
|
-
},
|
|
124
|
+
}, lt = (t) => {
|
|
125
125
|
if (!isNaN(t.getTime())) {
|
|
126
|
-
|
|
126
|
+
M(t), $(void 0);
|
|
127
127
|
let e = "";
|
|
128
|
-
switch (
|
|
128
|
+
switch (N) {
|
|
129
129
|
case "year": {
|
|
130
130
|
e = t.getFullYear().toString();
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
case "month": {
|
|
134
|
-
const c =
|
|
135
|
-
e = `${c} ${
|
|
134
|
+
const c = S[t.getMonth()], o = t.getFullYear();
|
|
135
|
+
e = `${c} ${o}`;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
case "full": {
|
|
@@ -146,18 +146,18 @@ const xt = ht(
|
|
|
146
146
|
}
|
|
147
147
|
r == null || r({
|
|
148
148
|
value: e,
|
|
149
|
-
name:
|
|
149
|
+
name: d
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
_ === "years" && (f === "years" ? (y(!1), u(f)) : u("months")), _ === "months" && (f === "months" ? (y(!1), u(f)) : u("days")), M(t);
|
|
153
153
|
let s = "";
|
|
154
|
-
switch (
|
|
154
|
+
switch (N) {
|
|
155
155
|
case "year": {
|
|
156
156
|
s = t.getFullYear().toString();
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
159
|
case "month": {
|
|
160
|
-
const e =
|
|
160
|
+
const e = S[t.getMonth()], c = t.getFullYear();
|
|
161
161
|
s = `${e} ${c}`;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
@@ -172,201 +172,202 @@ const xt = ht(
|
|
|
172
172
|
}
|
|
173
173
|
r == null || r({
|
|
174
174
|
value: s,
|
|
175
|
-
name:
|
|
176
|
-
})
|
|
177
|
-
},
|
|
178
|
-
const s =
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
let
|
|
182
|
-
switch (
|
|
175
|
+
name: d
|
|
176
|
+
});
|
|
177
|
+
}, mt = (t) => {
|
|
178
|
+
const s = i || /* @__PURE__ */ new Date(), e = s.getDate(), c = s.getMonth() + 1, o = new Date(t, c - 1, e);
|
|
179
|
+
if (o.getFullYear() === t && o.getMonth() === c - 1 && o.getDate() === e && Z(o)) {
|
|
180
|
+
M(o), $(void 0);
|
|
181
|
+
let l = "";
|
|
182
|
+
switch (N) {
|
|
183
183
|
case "year": {
|
|
184
|
-
|
|
184
|
+
l = t.toString();
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "month": {
|
|
188
|
-
|
|
188
|
+
l = `${S[c - 1]} ${t}`;
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case "full": {
|
|
192
|
-
|
|
192
|
+
l = p.Date(o, "yyyy-mm-dd");
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
default: {
|
|
196
|
-
|
|
196
|
+
l = p.Date(o, "yyyy-mm-dd");
|
|
197
197
|
break;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
if (r == null || r({
|
|
201
|
-
value:
|
|
202
|
-
name:
|
|
203
|
-
}),
|
|
204
|
-
|
|
201
|
+
value: l,
|
|
202
|
+
name: d
|
|
203
|
+
}), f === "years") {
|
|
204
|
+
y(!1), u(f);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
} else
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
$(new Date(t, c - 1, 1));
|
|
209
|
+
f === "years" ? (y(!1), u(f)) : u("months");
|
|
210
210
|
}, yt = (t, s) => {
|
|
211
|
-
const c = (
|
|
212
|
-
if (n.getFullYear() === t && n.getMonth() === s - 1 && n.getDate() ===
|
|
213
|
-
|
|
214
|
-
let
|
|
215
|
-
switch (
|
|
211
|
+
const c = (i || /* @__PURE__ */ new Date()).getDate(), o = new Date(t, s, 0).getDate(), l = Math.min(c, o), n = new Date(t, s - 1, l);
|
|
212
|
+
if (n.getFullYear() === t && n.getMonth() === s - 1 && n.getDate() === l && Z(n)) {
|
|
213
|
+
M(n), $(void 0);
|
|
214
|
+
let k = "";
|
|
215
|
+
switch (N) {
|
|
216
216
|
case "year": {
|
|
217
|
-
|
|
217
|
+
k = t.toString();
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
case "month": {
|
|
221
|
-
|
|
221
|
+
k = `${S[s - 1]} ${t}`;
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
224
|
case "full": {
|
|
225
|
-
|
|
225
|
+
k = p.Date(n, "yyyy-mm-dd");
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
default: {
|
|
229
|
-
|
|
229
|
+
k = p.Date(n, "yyyy-mm-dd");
|
|
230
230
|
break;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
if (r == null || r({
|
|
234
|
-
value:
|
|
235
|
-
name:
|
|
236
|
-
}),
|
|
237
|
-
|
|
234
|
+
value: k,
|
|
235
|
+
name: d
|
|
236
|
+
}), f === "months") {
|
|
237
|
+
y(!1), u(f);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
} else
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
if (
|
|
241
|
+
$(new Date(t, s - 1, 1));
|
|
242
|
+
f === "months" ? (y(!1), u(f)) : u("days");
|
|
243
|
+
}, ut = (t) => {
|
|
244
|
+
if (A || t.target.value === "") {
|
|
245
245
|
const s = t.target.value.replace(/[^\d]/g, "");
|
|
246
246
|
if (s.length === 0)
|
|
247
|
-
|
|
247
|
+
x(""), M(void 0), y(!1), r == null || r({ value: "", name: d });
|
|
248
248
|
else {
|
|
249
|
-
const [e, c,
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
const [e, c, o] = [
|
|
250
|
+
R(s.substring(0, 2), gt),
|
|
251
|
+
R(s.substring(2, 4), Tt),
|
|
252
252
|
s.substring(4, 8)
|
|
253
|
-
],
|
|
254
|
-
if (
|
|
255
|
-
const n =
|
|
253
|
+
], l = [e, c, o].filter(Boolean).join("/");
|
|
254
|
+
if (x(l), rt) {
|
|
255
|
+
const n = o ? `${o}-${c || "00"}-${e || "00"}` : [e, c, o].filter(Boolean).join("-");
|
|
256
256
|
r == null || r({
|
|
257
257
|
value: n,
|
|
258
|
-
name:
|
|
258
|
+
name: d
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
if (
|
|
262
|
-
const n = parseInt(
|
|
261
|
+
if (l.length === $t) {
|
|
262
|
+
const n = parseInt(o), k = /* @__PURE__ */ new Date(
|
|
263
263
|
`${n}-${c.padStart(2, "0")}-${e.padStart(2, "0")}`
|
|
264
264
|
);
|
|
265
|
-
isNaN(
|
|
266
|
-
value: p.Date(
|
|
267
|
-
name:
|
|
268
|
-
})
|
|
265
|
+
isNaN(k.getTime()) || (M(k), r == null || r({
|
|
266
|
+
value: p.Date(k, "yyyy-mm-dd"),
|
|
267
|
+
name: d
|
|
268
|
+
}));
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
), pt =
|
|
276
|
-
let
|
|
277
|
-
if (
|
|
272
|
+
}, Dt = v(
|
|
273
|
+
m.wrapper,
|
|
274
|
+
T && !A && m.active
|
|
275
|
+
), pt = v(m.input, m.inputBorderControl);
|
|
276
|
+
let z;
|
|
277
|
+
if (a) {
|
|
278
278
|
let t, s;
|
|
279
|
-
typeof
|
|
279
|
+
typeof a[0] == "string" ? t = new Date(a[0]) : t = a[0], typeof a[1] == "string" ? s = new Date(a[1]) : s = a[1], z = [t, s];
|
|
280
280
|
}
|
|
281
|
-
const
|
|
282
|
-
onChangeValue:
|
|
283
|
-
date:
|
|
284
|
-
selectedDate:
|
|
285
|
-
before: typeof
|
|
286
|
-
onChangeType:
|
|
287
|
-
setIsActive:
|
|
288
|
-
disableFuture:
|
|
289
|
-
disablePast:
|
|
290
|
-
disabledDate:
|
|
291
|
-
validRange:
|
|
292
|
-
dateFormat:
|
|
293
|
-
position:
|
|
294
|
-
isFixed:
|
|
295
|
-
},
|
|
296
|
-
...
|
|
281
|
+
const X = {
|
|
282
|
+
onChangeValue: lt,
|
|
283
|
+
date: nt || i || /* @__PURE__ */ new Date(),
|
|
284
|
+
selectedDate: i,
|
|
285
|
+
before: typeof h == "string" ? new Date(h) : h,
|
|
286
|
+
onChangeType: u,
|
|
287
|
+
setIsActive: y,
|
|
288
|
+
disableFuture: q,
|
|
289
|
+
disablePast: J,
|
|
290
|
+
disabledDate: E,
|
|
291
|
+
validRange: z,
|
|
292
|
+
dateFormat: N,
|
|
293
|
+
position: at,
|
|
294
|
+
isFixed: O
|
|
295
|
+
}, dt = {
|
|
296
|
+
...X,
|
|
297
297
|
onChangeMonth: yt,
|
|
298
|
-
dateFormat:
|
|
299
|
-
},
|
|
300
|
-
...
|
|
301
|
-
onChangeYear:
|
|
298
|
+
dateFormat: N
|
|
299
|
+
}, wt = {
|
|
300
|
+
...X,
|
|
301
|
+
onChangeYear: mt
|
|
302
302
|
}, kt = (() => {
|
|
303
|
-
switch (
|
|
303
|
+
switch (_) {
|
|
304
304
|
case "months":
|
|
305
|
-
return () => /* @__PURE__ */
|
|
305
|
+
return () => /* @__PURE__ */ D(At, { ...dt });
|
|
306
306
|
case "years":
|
|
307
|
-
return () => /* @__PURE__ */
|
|
307
|
+
return () => /* @__PURE__ */ D(Pt, { ...wt });
|
|
308
308
|
default:
|
|
309
|
-
return () => /* @__PURE__ */
|
|
309
|
+
return () => /* @__PURE__ */ D(bt, { ...X });
|
|
310
310
|
}
|
|
311
|
-
})(), Nt = ({ isActive: t }) => /* @__PURE__ */
|
|
312
|
-
e.stopPropagation(),
|
|
313
|
-
}, className:
|
|
314
|
-
|
|
311
|
+
})(), Nt = ({ isActive: t }) => /* @__PURE__ */ D("button", { onClick: (e) => {
|
|
312
|
+
e.stopPropagation(), j || y(!t);
|
|
313
|
+
}, className: m["icon-button"], children: t ? /* @__PURE__ */ D(
|
|
314
|
+
V,
|
|
315
315
|
{
|
|
316
|
-
iconName:
|
|
316
|
+
iconName: H === tt.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
|
|
317
317
|
}
|
|
318
|
-
) : /* @__PURE__ */
|
|
319
|
-
|
|
318
|
+
) : /* @__PURE__ */ D(
|
|
319
|
+
V,
|
|
320
320
|
{
|
|
321
|
-
iconName:
|
|
321
|
+
iconName: H === tt.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
|
|
322
322
|
}
|
|
323
323
|
) });
|
|
324
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ F(
|
|
325
325
|
"div",
|
|
326
326
|
{
|
|
327
|
-
className:
|
|
328
|
-
[
|
|
327
|
+
className: v(m["input-field-group-datePicker"], {
|
|
328
|
+
[m.full]: ot
|
|
329
329
|
}),
|
|
330
330
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ F("div", { className: Dt, "data-disabled": j, children: [
|
|
332
|
+
/* @__PURE__ */ D(
|
|
333
333
|
"div",
|
|
334
334
|
{
|
|
335
335
|
role: "button",
|
|
336
|
-
"data-status":
|
|
337
|
-
className:
|
|
338
|
-
[
|
|
339
|
-
[
|
|
336
|
+
"data-status": Y.status,
|
|
337
|
+
className: v(m["date-wrapper"], {
|
|
338
|
+
[m.editable]: A,
|
|
339
|
+
[m[`border-radius-${L}`]]: L !== C.All
|
|
340
340
|
}),
|
|
341
|
-
onClick:
|
|
342
|
-
children: /* @__PURE__ */
|
|
341
|
+
onClick: ft,
|
|
342
|
+
children: /* @__PURE__ */ D(
|
|
343
343
|
Yt,
|
|
344
344
|
{
|
|
345
345
|
ref: ct,
|
|
346
346
|
className: pt,
|
|
347
|
-
wrapperClassName:
|
|
348
|
-
size:
|
|
347
|
+
wrapperClassName: m["input-wrapper"],
|
|
348
|
+
size: H,
|
|
349
349
|
type: "text",
|
|
350
350
|
variant: st,
|
|
351
351
|
value: it,
|
|
352
|
-
onChange:
|
|
352
|
+
onChange: ut,
|
|
353
353
|
rightAddon: {
|
|
354
354
|
addonType: "react-node",
|
|
355
|
-
addonContent: /* @__PURE__ */
|
|
355
|
+
addonContent: /* @__PURE__ */ D(Nt, { isActive: T })
|
|
356
356
|
},
|
|
357
|
-
rightSlotClassName:
|
|
357
|
+
rightSlotClassName: m["right-slot"],
|
|
358
358
|
onFocus: () => {
|
|
359
|
-
|
|
359
|
+
W && !A && y(!0);
|
|
360
360
|
},
|
|
361
|
-
borderRadius:
|
|
362
|
-
...
|
|
361
|
+
borderRadius: L,
|
|
362
|
+
...Y,
|
|
363
|
+
onBlur: et
|
|
363
364
|
}
|
|
364
365
|
)
|
|
365
366
|
}
|
|
366
367
|
),
|
|
367
|
-
|
|
368
|
+
T && /* @__PURE__ */ D(kt, {})
|
|
368
369
|
] }),
|
|
369
|
-
|
|
370
|
+
I && typeof I == "string" && /* @__PURE__ */ D("div", { className: m.textError, children: I })
|
|
370
371
|
]
|
|
371
372
|
}
|
|
372
373
|
);
|