mimir-ui-kit 1.35.1 → 1.35.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/Button.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +5 -3
- package/dist/components/Accordion/Accordion.js +141 -141
- package/dist/components/Button/Button.d.ts +36 -0
- package/dist/components/Button/Button.js +83 -75
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.js +91 -108
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -5
- package/dist/components/DatePicker/DatePickerModal.js +91 -95
- package/dist/components/DatePicker/MonthPickerModal.d.ts +4 -5
- package/dist/components/DatePicker/MonthPickerModal.js +58 -66
- package/dist/components/DatePicker/YearPickerModal.d.ts +4 -5
- package/dist/components/DatePicker/YearPickerModal.js +61 -61
- package/dist/components/DatePicker/constants.d.ts +5 -0
- package/dist/components/DatePicker/constants.js +12 -6
- package/dist/components/DatePicker/hooks.d.ts +3 -0
- package/dist/components/DatePicker/hooks.js +16 -0
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/utils.d.ts +4 -0
- package/dist/components/DatePicker/utils.js +6 -5
- package/dist/components/Image/Image.js +1 -1
- package/dist/styles.module-Chnn6DA-.js +24 -0
- package/package.json +1 -1
- package/dist/styles.module-BQZZ6FB1.js +0 -25
@@ -1,91 +1,99 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c
|
1
|
+
import { jsxs as N, jsx as l } from "react/jsx-runtime";
|
2
|
+
import { c } from "../../index-DIxK0V-G.js";
|
3
3
|
import { forwardRef as B } from "react";
|
4
|
-
import { EButtonVariantDefault as
|
4
|
+
import { EButtonVariantDefault as I, EButtonForm as k } from "./constants.js";
|
5
5
|
import { Icon as j } from "../../icons/Icon.js";
|
6
|
-
import '../../assets/Button.css';const D = "
|
7
|
-
button:
|
8
|
-
clear:
|
9
|
-
|
10
|
-
"
|
11
|
-
"primary-
|
12
|
-
"
|
13
|
-
"secondary-
|
14
|
-
"secondary-
|
15
|
-
"secondary-
|
16
|
-
"
|
6
|
+
import '../../assets/Button.css';const C = "_button_1qnsv_2", D = "_clear_1qnsv_42", E = "_count_1qnsv_53", P = "_black_1qnsv_132", z = "_gray_1qnsv_141", F = "_white_1qnsv_150", R = "_xs_1qnsv_250", S = "_s_1qnsv_83", V = "_m_1qnsv_259", A = "_l_1qnsv_283", G = "_xl_1qnsv_291", H = "_xxl_1qnsv_299", J = "_full_1qnsv_314", K = "_disabled_1qnsv_320", s = {
|
7
|
+
button: C,
|
8
|
+
clear: D,
|
9
|
+
count: E,
|
10
|
+
"default-button": "_default-button_1qnsv_61",
|
11
|
+
"primary-sapphire": "_primary-sapphire_1qnsv_64",
|
12
|
+
"primary-citrine": "_primary-citrine_1qnsv_73",
|
13
|
+
"secondary-asphalt": "_secondary-asphalt_1qnsv_83",
|
14
|
+
"secondary-gray": "_secondary-gray_1qnsv_92",
|
15
|
+
"secondary-white": "_secondary-white_1qnsv_101",
|
16
|
+
"secondary-red": "_secondary-red_1qnsv_110",
|
17
|
+
"round-button": "_round-button_1qnsv_120",
|
17
18
|
black: P,
|
18
|
-
gray:
|
19
|
-
white:
|
20
|
-
"outline-button": "_outline-
|
21
|
-
"outline-asphalt": "_outline-
|
22
|
-
"outline-gray": "_outline-
|
23
|
-
"outline-white": "_outline-
|
24
|
-
"outline-red": "_outline-
|
25
|
-
"borderless-button": "_borderless-
|
26
|
-
"borderless-asphalt": "_borderless-
|
27
|
-
"borderless-gray": "_borderless-
|
28
|
-
"borderless-white": "_borderless-
|
29
|
-
"borderless-red": "_borderless-
|
30
|
-
xs:
|
31
|
-
"m-s": "_m-
|
32
|
-
s:
|
33
|
-
m:
|
34
|
-
l:
|
35
|
-
xl:
|
36
|
-
xxl:
|
37
|
-
full:
|
38
|
-
disabled:
|
39
|
-
"icon-button": "_icon-
|
40
|
-
},
|
41
|
-
(
|
19
|
+
gray: z,
|
20
|
+
white: F,
|
21
|
+
"outline-button": "_outline-button_1qnsv_160",
|
22
|
+
"outline-asphalt": "_outline-asphalt_1qnsv_168",
|
23
|
+
"outline-gray": "_outline-gray_1qnsv_176",
|
24
|
+
"outline-white": "_outline-white_1qnsv_185",
|
25
|
+
"outline-red": "_outline-red_1qnsv_194",
|
26
|
+
"borderless-button": "_borderless-button_1qnsv_204",
|
27
|
+
"borderless-asphalt": "_borderless-asphalt_1qnsv_211",
|
28
|
+
"borderless-gray": "_borderless-gray_1qnsv_216",
|
29
|
+
"borderless-white": "_borderless-white_1qnsv_221",
|
30
|
+
"borderless-red": "_borderless-red_1qnsv_226",
|
31
|
+
xs: R,
|
32
|
+
"m-s": "_m-s_1qnsv_259",
|
33
|
+
s: S,
|
34
|
+
m: V,
|
35
|
+
l: A,
|
36
|
+
xl: G,
|
37
|
+
xxl: H,
|
38
|
+
full: J,
|
39
|
+
disabled: K,
|
40
|
+
"icon-button": "_icon-button_1qnsv_341"
|
41
|
+
}, L = B(
|
42
|
+
(i, u) => {
|
42
43
|
const {
|
43
|
-
size:
|
44
|
-
variant:
|
45
|
-
form:
|
46
|
-
full:
|
47
|
-
clear:
|
44
|
+
size: o = "m",
|
45
|
+
variant: d = I.PrimarySapphire,
|
46
|
+
form: _ = k.DefaultButton,
|
47
|
+
full: b,
|
48
|
+
clear: n,
|
48
49
|
isIconButton: r = !1,
|
49
|
-
iconName:
|
50
|
-
children:
|
51
|
-
className:
|
52
|
-
formId:
|
53
|
-
type:
|
54
|
-
rightIcon:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
[
|
61
|
-
[
|
62
|
-
[
|
63
|
-
[
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
50
|
+
iconName: v,
|
51
|
+
children: m,
|
52
|
+
className: q,
|
53
|
+
formId: p,
|
54
|
+
type: y = "button",
|
55
|
+
rightIcon: h,
|
56
|
+
count: e,
|
57
|
+
leftIcon: f,
|
58
|
+
disabled: t,
|
59
|
+
...x
|
60
|
+
} = i, a = {
|
61
|
+
[s.full]: b && !n,
|
62
|
+
[s.disabled]: t && !n,
|
63
|
+
[s.clear]: n,
|
64
|
+
[s[d ?? ""]]: !t || n,
|
65
|
+
[s["icon-button"]]: r
|
66
|
+
}, g = c(
|
67
|
+
q,
|
68
|
+
s.button,
|
69
|
+
a,
|
70
|
+
n ? [] : [s[_ ?? ""], s[o]]
|
71
|
+
), w = c(
|
72
|
+
s.count,
|
73
|
+
a,
|
74
|
+
s[o],
|
75
|
+
s[_ ?? ""]
|
69
76
|
);
|
70
|
-
return /* @__PURE__ */
|
77
|
+
return /* @__PURE__ */ N(
|
71
78
|
"button",
|
72
79
|
{
|
73
|
-
type:
|
74
|
-
form:
|
75
|
-
...
|
76
|
-
disabled:
|
77
|
-
ref:
|
78
|
-
className:
|
80
|
+
type: y,
|
81
|
+
form: p,
|
82
|
+
...x,
|
83
|
+
disabled: t,
|
84
|
+
ref: u,
|
85
|
+
className: g,
|
79
86
|
children: [
|
80
|
-
|
81
|
-
r ? /* @__PURE__ */
|
82
|
-
|
87
|
+
f,
|
88
|
+
r ? /* @__PURE__ */ l(j, { iconName: v }) : m,
|
89
|
+
h,
|
90
|
+
!!e && /* @__PURE__ */ l("span", { className: w, children: e })
|
83
91
|
]
|
84
92
|
}
|
85
93
|
);
|
86
94
|
}
|
87
95
|
);
|
88
|
-
|
96
|
+
L.displayName = "Button";
|
89
97
|
export {
|
90
|
-
|
98
|
+
L as Button
|
91
99
|
};
|
@@ -1,140 +1,123 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { memo as Q, forwardRef as W, useState as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
|
1
|
+
import { jsxs as J, jsx as I } from "react/jsx-runtime";
|
2
|
+
import { c as g } from "../../index-DIxK0V-G.js";
|
3
|
+
import { memo as Q, forwardRef as W, useState as d, useEffect as N } from "react";
|
4
|
+
import { MAX_DAY as Z, MAX_MONTH as E, DATE_LENGTH as B } from "./constants.js";
|
5
|
+
import { DatePickerModal as V } from "./DatePickerModal.js";
|
6
|
+
import { MonthPickerModal as tt } from "./MonthPickerModal.js";
|
7
|
+
import { c as a } from "../../styles.module-Chnn6DA-.js";
|
8
|
+
import { formatDatePart as j } from "./utils.js";
|
9
|
+
import { YearPickerModal as st } from "./YearPickerModal.js";
|
10
|
+
import { useClickOutside as et } from "../../hooks/useClickOutside/useClickOutside.js";
|
11
|
+
import { formating as it } from "../../utils/index.js";
|
12
|
+
import { I as at } from "../../Input-B-gKQ9FT.js";
|
13
|
+
import { EInputStatus as rt } from "../Input/constants.js";
|
14
|
+
const ot = {
|
15
|
+
days: V,
|
16
|
+
months: tt,
|
17
|
+
years: st
|
18
|
+
}, ct = Q(
|
14
19
|
W(
|
15
20
|
({
|
16
|
-
size:
|
17
|
-
value:
|
18
|
-
onChangeValue:
|
19
|
-
name:
|
20
|
-
before:
|
21
|
-
type:
|
22
|
-
error:
|
23
|
-
onError:
|
24
|
-
onBlur:
|
25
|
-
validateImmediately:
|
26
|
-
variant:
|
27
|
-
disabled:
|
21
|
+
size: Y,
|
22
|
+
value: s,
|
23
|
+
onChangeValue: e,
|
24
|
+
name: r,
|
25
|
+
before: D,
|
26
|
+
type: o = "days",
|
27
|
+
error: y,
|
28
|
+
onError: c,
|
29
|
+
onBlur: m,
|
30
|
+
validateImmediately: v,
|
31
|
+
variant: $,
|
32
|
+
disabled: x = !1,
|
28
33
|
editable: S = !1,
|
29
|
-
...
|
34
|
+
...H
|
30
35
|
}, L) => {
|
31
|
-
const [
|
32
|
-
|
33
|
-
), [
|
34
|
-
|
35
|
-
k(
|
36
|
-
}, [
|
36
|
+
const [n, f] = d(!1), [T, p] = d(o), [i, l] = d(
|
37
|
+
() => s && !isNaN(new Date(s).getTime()) ? new Date(s) : void 0
|
38
|
+
), [A, k] = d(y), [R, M] = d("");
|
39
|
+
N(() => {
|
40
|
+
k(y);
|
41
|
+
}, [y]), N(() => {
|
37
42
|
l(
|
38
|
-
|
43
|
+
s && !isNaN(new Date(s).getTime()) ? new Date(s) : void 0
|
39
44
|
);
|
40
|
-
}, [
|
41
|
-
|
42
|
-
}, [
|
43
|
-
const
|
44
|
-
|
45
|
-
|
46
|
-
}, [
|
47
|
-
isActive:
|
48
|
-
setActive: (
|
49
|
-
|
45
|
+
}, [s]), N(() => {
|
46
|
+
i && typeof i != "string" && !isNaN(i == null ? void 0 : i.getTime()) ? M(it.Date(i, "dd/mm/yyyy")) : M("");
|
47
|
+
}, [i]);
|
48
|
+
const _ = s && new Date(s).getTime;
|
49
|
+
N(() => {
|
50
|
+
v && (_ ? (k(!1), c == null || c({ name: r, active: !1 })) : (k(!0), c == null || c({ name: r, active: !0 })));
|
51
|
+
}, [v, r, _]), et({
|
52
|
+
isActive: n,
|
53
|
+
setActive: (t) => {
|
54
|
+
f(t), p(o);
|
50
55
|
},
|
51
|
-
className:
|
56
|
+
className: a["calendar-block"]
|
52
57
|
});
|
53
|
-
const
|
54
|
-
|
55
|
-
},
|
56
|
-
isNaN(
|
57
|
-
},
|
58
|
+
const X = () => {
|
59
|
+
x || f(!0);
|
60
|
+
}, G = (t) => {
|
61
|
+
isNaN(t.getTime()) || (l(t), e == null || e({ value: t, name: r })), T === "years" && (o === "years" ? (f(!1), p(o)) : p("months")), T === "months" && (o === "months" ? (f(!1), p(o)) : p("days")), l(t), e == null || e({ value: t, name: r }), m == null || m(t);
|
62
|
+
}, K = (t) => {
|
58
63
|
if (S) {
|
59
|
-
const
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
],
|
64
|
-
if (
|
65
|
-
const
|
66
|
-
`${
|
64
|
+
const P = t.target.value.replace(/[^\d]/g, ""), [b, h, u] = [
|
65
|
+
j(P.substring(0, 2), Z),
|
66
|
+
j(P.substring(2, 4), E),
|
67
|
+
P.substring(4, 8)
|
68
|
+
], O = [b, h, u].filter(Boolean).join("/");
|
69
|
+
if (M(O), O.length === B) {
|
70
|
+
const F = parseInt(u), w = /* @__PURE__ */ new Date(
|
71
|
+
`${F}-${h.padStart(2, "0")}-${b.padStart(2, "0")}`
|
67
72
|
);
|
68
|
-
isNaN(
|
73
|
+
isNaN(w.getTime()) || (l(w), e == null || e({ value: w, name: r }), m == null || m(w));
|
69
74
|
}
|
70
75
|
}
|
71
|
-
},
|
72
|
-
|
73
|
-
/* @__PURE__ */
|
76
|
+
}, U = g(a.wrapper, n && a.active), q = g(a.input, a.inputBorderControl), z = {
|
77
|
+
onChangeValue: G,
|
78
|
+
date: i || /* @__PURE__ */ new Date(),
|
79
|
+
before: typeof D == "string" ? new Date(D) : D,
|
80
|
+
onChangeType: p,
|
81
|
+
setIsActive: f
|
82
|
+
}, C = ot[T];
|
83
|
+
return /* @__PURE__ */ J("div", { className: U, "data-disabled": x, children: [
|
84
|
+
/* @__PURE__ */ I(
|
74
85
|
"div",
|
75
86
|
{
|
76
|
-
"
|
77
|
-
|
78
|
-
|
87
|
+
role: "button",
|
88
|
+
"data-error": A,
|
89
|
+
className: g(a["date-wrapper"], {
|
90
|
+
[a.editable]: S
|
79
91
|
}),
|
80
|
-
onClick:
|
81
|
-
children: /* @__PURE__ */
|
82
|
-
|
92
|
+
onClick: X,
|
93
|
+
children: /* @__PURE__ */ I(
|
94
|
+
at,
|
83
95
|
{
|
84
96
|
ref: L,
|
85
|
-
className:
|
86
|
-
wrapperClassName:
|
87
|
-
size:
|
97
|
+
className: q,
|
98
|
+
wrapperClassName: a["input-wrapper"],
|
99
|
+
size: Y,
|
88
100
|
type: "text",
|
89
|
-
variant:
|
90
|
-
status:
|
101
|
+
variant: $,
|
102
|
+
status: A ? rt.Error : void 0,
|
91
103
|
value: R,
|
92
|
-
onChange:
|
104
|
+
onChange: K,
|
93
105
|
rightAddon: {
|
94
106
|
addonType: "icon",
|
95
|
-
addonContent:
|
107
|
+
addonContent: n ? "DropdownArrowUp24px" : "DropdownArrowDown24px"
|
96
108
|
},
|
97
|
-
"data-error":
|
98
|
-
...
|
109
|
+
"data-error": A,
|
110
|
+
...H
|
99
111
|
}
|
100
112
|
)
|
101
113
|
}
|
102
114
|
),
|
103
|
-
|
104
|
-
Z,
|
105
|
-
{
|
106
|
-
onChangeValue: M,
|
107
|
-
date: t || /* @__PURE__ */ new Date(),
|
108
|
-
setActive: c,
|
109
|
-
before: typeof a == "string" ? new Date(a) : a,
|
110
|
-
onType: o
|
111
|
-
}
|
112
|
-
),
|
113
|
-
w === "months" && d && /* @__PURE__ */ N(
|
114
|
-
b,
|
115
|
-
{
|
116
|
-
onChangeValue: M,
|
117
|
-
date: t || /* @__PURE__ */ new Date(),
|
118
|
-
setActive: c,
|
119
|
-
before: typeof a == "string" ? new Date(a) : a,
|
120
|
-
onType: o
|
121
|
-
}
|
122
|
-
),
|
123
|
-
w === "years" && d && /* @__PURE__ */ N(
|
124
|
-
C,
|
125
|
-
{
|
126
|
-
onChangeValue: M,
|
127
|
-
date: t || /* @__PURE__ */ new Date(),
|
128
|
-
setActive: c,
|
129
|
-
before: typeof a == "string" ? new Date(a) : a,
|
130
|
-
onType: o
|
131
|
-
}
|
132
|
-
)
|
115
|
+
n && /* @__PURE__ */ I(C, { ...z })
|
133
116
|
] });
|
134
117
|
}
|
135
118
|
)
|
136
119
|
);
|
137
|
-
|
120
|
+
ct.displayName = "DatePicker";
|
138
121
|
export {
|
139
|
-
|
122
|
+
ct as DatePicker
|
140
123
|
};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
type
|
1
|
+
type TProps = {
|
2
2
|
date: Date;
|
3
|
-
onChangeValue: (d: Date) => void;
|
4
|
-
setActive: (s: boolean) => void;
|
5
3
|
before?: Date;
|
6
|
-
|
4
|
+
onChangeValue: (date: Date) => void;
|
5
|
+
setIsActive: (isActive: boolean) => void;
|
6
|
+
onChangeType?: (s: 'days' | 'months' | 'years') => void;
|
7
7
|
};
|
8
|
-
export declare
|
8
|
+
export declare const DatePickerModal: ({ date, onChangeValue, setIsActive, before, onChangeType }: TProps) => import("react/jsx-runtime").JSX.Element;
|
9
9
|
export {};
|