mimir-ui-kit 1.35.2 → 1.35.3
Sign up to get free protection for your applications and to get access to all the features.
- 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/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,102 +1,94 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { c as k } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as $ } from "react";
|
4
|
+
import { months as x } from "./constants.js";
|
5
|
+
import { useDatePickerPosition as v } from "./hooks.js";
|
6
|
+
import { c as e } from "../../styles.module-Chnn6DA-.js";
|
7
|
+
import { Icon as B } from "../../icons/Icon.js";
|
8
|
+
import { formating as a } from "../../utils/index.js";
|
9
|
+
import { Button as b } from "../Button/Button.js";
|
10
|
+
const F = ({
|
9
11
|
date: d,
|
10
|
-
onChangeValue:
|
11
|
-
before:
|
12
|
-
|
13
|
-
}) {
|
14
|
-
const
|
15
|
-
y:
|
16
|
-
d:
|
17
|
-
m:
|
18
|
-
},
|
12
|
+
onChangeValue: D,
|
13
|
+
before: u,
|
14
|
+
onChangeType: i
|
15
|
+
}) => {
|
16
|
+
const h = v(), c = new Date(d), m = new Date(d), f = {
|
17
|
+
y: c.getFullYear(),
|
18
|
+
d: c.getDate(),
|
19
|
+
m: c.getMonth() + 1
|
20
|
+
}, s = {
|
19
21
|
y: m.getFullYear(),
|
20
22
|
d: m.getDate(),
|
21
23
|
m: m.getMonth() + 1
|
22
|
-
}, [
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
e < $.y + B + v ? t.current.style.top = -B + "px" : t.current.style.top = v + "px", r < $.x + g && (t.current.style.left = j - g + "px"), t.current.style.opacity = "1";
|
29
|
-
}
|
30
|
-
}, []);
|
31
|
-
const W = () => {
|
32
|
-
h(n + 1);
|
33
|
-
}, E = () => {
|
34
|
-
h(n - 1);
|
35
|
-
}, w = (e) => !!(f && f.getTime() > e), M = (e) => {
|
36
|
-
w(
|
24
|
+
}, [t, p] = $(s.y), w = () => {
|
25
|
+
p(t + 1);
|
26
|
+
}, g = () => {
|
27
|
+
p(t - 1);
|
28
|
+
}, N = (r) => !!(u && u.getTime() > r), y = (r) => {
|
29
|
+
N(
|
37
30
|
(/* @__PURE__ */ new Date(
|
38
|
-
`${
|
31
|
+
`${t}-${a.Number(2, r)}-${a.Number(2, s.d)}`
|
39
32
|
)).getTime()
|
40
|
-
) ||
|
33
|
+
) || D(
|
41
34
|
/* @__PURE__ */ new Date(
|
42
|
-
`${
|
35
|
+
`${t}-${a.Number(2, r)}-${a.Number(2, s.d)}`
|
43
36
|
)
|
44
37
|
);
|
45
38
|
};
|
46
|
-
return /* @__PURE__ */
|
47
|
-
/* @__PURE__ */
|
48
|
-
/* @__PURE__ */
|
49
|
-
|
39
|
+
return /* @__PURE__ */ l("div", { className: e["calendar-block"], ref: h, children: [
|
40
|
+
/* @__PURE__ */ l("div", { className: e.h, children: [
|
41
|
+
/* @__PURE__ */ n(
|
42
|
+
b,
|
50
43
|
{
|
51
44
|
isIconButton: !0,
|
52
45
|
iconName: "DropdownArrowLeft16px",
|
53
|
-
onClick:
|
46
|
+
onClick: g,
|
54
47
|
variant: "secondary-gray",
|
55
48
|
size: "l"
|
56
49
|
}
|
57
50
|
),
|
58
|
-
/* @__PURE__ */
|
59
|
-
"
|
51
|
+
/* @__PURE__ */ l(
|
52
|
+
"button",
|
60
53
|
{
|
61
|
-
|
62
|
-
|
54
|
+
type: "button",
|
55
|
+
onClick: () => i == null ? void 0 : i("years"),
|
56
|
+
className: e.d,
|
63
57
|
"data-testid": "year-button",
|
64
58
|
children: [
|
65
|
-
|
66
|
-
/* @__PURE__ */
|
59
|
+
t.toString(),
|
60
|
+
/* @__PURE__ */ n(B, { iconName: "DropdownArrowBottom16px" })
|
67
61
|
]
|
68
62
|
}
|
69
63
|
),
|
70
|
-
/* @__PURE__ */
|
71
|
-
|
64
|
+
/* @__PURE__ */ n(
|
65
|
+
b,
|
72
66
|
{
|
73
67
|
isIconButton: !0,
|
74
68
|
iconName: "DropdownArrowRight16px",
|
75
|
-
onClick:
|
69
|
+
onClick: w,
|
76
70
|
variant: "secondary-gray",
|
77
71
|
size: "l"
|
78
72
|
}
|
79
73
|
)
|
80
74
|
] }),
|
81
|
-
/* @__PURE__ */
|
82
|
-
"
|
75
|
+
/* @__PURE__ */ n("div", { className: e.monthGrid, "data-testid": "month-picker", children: x.map((r, o) => /* @__PURE__ */ n(
|
76
|
+
"button",
|
83
77
|
{
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}
|
94
|
-
)
|
78
|
+
type: "button",
|
79
|
+
onClick: () => y(o + 1),
|
80
|
+
className: k(
|
81
|
+
N(
|
82
|
+
(/* @__PURE__ */ new Date(`${t}-${a.Number(2, o + 1)}`)).getTime()
|
83
|
+
) ? e.m : e.a,
|
84
|
+
{ [e.current]: f.y === t && f.m === o + 1 }
|
85
|
+
),
|
86
|
+
children: r
|
95
87
|
},
|
96
|
-
|
88
|
+
o
|
97
89
|
)) })
|
98
|
-
] })
|
99
|
-
}
|
90
|
+
] });
|
91
|
+
};
|
100
92
|
export {
|
101
|
-
|
93
|
+
F as MonthPickerModal
|
102
94
|
};
|
@@ -1,9 +1,8 @@
|
|
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
|
+
onChangeType?: (type: 'years') => void;
|
7
6
|
};
|
8
|
-
export declare
|
7
|
+
export declare const YearPickerModal: ({ date, onChangeValue, before, onChangeType }: TProps) => import("react/jsx-runtime").JSX.Element;
|
9
8
|
export {};
|
@@ -1,89 +1,89 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}, []);
|
29
|
-
const A = () => {
|
30
|
-
p(l + 15);
|
31
|
-
}, E = () => {
|
32
|
-
p(l - 15);
|
33
|
-
}, h = (t) => !!(d && d.getTime() > t), j = (t) => {
|
34
|
-
h(
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
2
|
+
import { c as v } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as x } from "react";
|
4
|
+
import { useDatePickerPosition as Y } from "./hooks.js";
|
5
|
+
import { c as t } from "../../styles.module-Chnn6DA-.js";
|
6
|
+
import { formating as n } from "../../utils/index.js";
|
7
|
+
import { Button as y } from "../Button/Button.js";
|
8
|
+
const F = ({
|
9
|
+
date: m,
|
10
|
+
onChangeValue: b,
|
11
|
+
before: l,
|
12
|
+
onChangeType: a
|
13
|
+
}) => {
|
14
|
+
const D = Y(), s = new Date(m), c = new Date(m), u = {
|
15
|
+
y: s.getFullYear(),
|
16
|
+
d: s.getDate(),
|
17
|
+
m: s.getMonth() + 1
|
18
|
+
}, r = {
|
19
|
+
y: c.getFullYear(),
|
20
|
+
d: c.getDate(),
|
21
|
+
m: c.getMonth() + 1
|
22
|
+
}, [i, d] = x(r.y), g = i - 7, k = Array.from(Array(15).keys()).map((e) => e + g), w = () => {
|
23
|
+
d(i + 15);
|
24
|
+
}, $ = () => {
|
25
|
+
d(i - 15);
|
26
|
+
}, f = (e) => !!(l && l.getTime() > e), h = (e) => {
|
27
|
+
f(
|
35
28
|
(/* @__PURE__ */ new Date(
|
36
|
-
`${
|
29
|
+
`${e}-${n.Number(2, r.m)}-${n.Number(2, r.d)}`
|
37
30
|
)).getTime()
|
38
|
-
) ||
|
31
|
+
) || b(
|
39
32
|
/* @__PURE__ */ new Date(
|
40
|
-
`${
|
33
|
+
`${e}-${n.Number(2, r.m)}-${n.Number(2, r.d)}`
|
41
34
|
)
|
42
35
|
);
|
43
36
|
};
|
44
|
-
return /* @__PURE__ */
|
45
|
-
/* @__PURE__ */
|
46
|
-
/* @__PURE__ */
|
47
|
-
|
37
|
+
return /* @__PURE__ */ p("div", { className: t["calendar-block"], ref: D, children: [
|
38
|
+
/* @__PURE__ */ p("div", { className: t.h, children: [
|
39
|
+
/* @__PURE__ */ o(
|
40
|
+
y,
|
48
41
|
{
|
49
42
|
isIconButton: !0,
|
50
43
|
iconName: "DropdownArrowLeft16px",
|
51
|
-
onClick:
|
44
|
+
onClick: $,
|
52
45
|
variant: "secondary-gray",
|
53
46
|
size: "l"
|
54
47
|
}
|
55
48
|
),
|
56
|
-
/* @__PURE__ */
|
57
|
-
|
58
|
-
|
49
|
+
/* @__PURE__ */ o(
|
50
|
+
"button",
|
51
|
+
{
|
52
|
+
type: "button",
|
53
|
+
onClick: () => a == null ? void 0 : a("years"),
|
54
|
+
className: t.d
|
55
|
+
}
|
56
|
+
),
|
57
|
+
/* @__PURE__ */ o(
|
58
|
+
y,
|
59
59
|
{
|
60
60
|
isIconButton: !0,
|
61
61
|
iconName: "DropdownArrowRight16px",
|
62
|
-
onClick:
|
62
|
+
onClick: w,
|
63
63
|
variant: "secondary-gray",
|
64
64
|
size: "l"
|
65
65
|
}
|
66
66
|
)
|
67
67
|
] }),
|
68
|
-
/* @__PURE__ */
|
69
|
-
"
|
68
|
+
/* @__PURE__ */ o("div", { className: t.monthGrid, "data-testid": "year-picker", children: k.map((e, N) => /* @__PURE__ */ o(
|
69
|
+
"button",
|
70
70
|
{
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
type: "button",
|
72
|
+
onClick: () => h(e),
|
73
|
+
className: v(
|
74
|
+
f(
|
75
|
+
(/* @__PURE__ */ new Date(`${e}-${n.Number(2, u.m)}`)).getTime()
|
76
|
+
) ? t.m : t.a,
|
76
77
|
{
|
77
|
-
|
78
|
-
onClick: () => j(t),
|
79
|
-
children: t
|
78
|
+
[t.current]: u.y === e
|
80
79
|
}
|
81
|
-
)
|
80
|
+
),
|
81
|
+
children: e
|
82
82
|
},
|
83
|
-
|
83
|
+
N
|
84
84
|
)) })
|
85
|
-
] })
|
86
|
-
}
|
85
|
+
] });
|
86
|
+
};
|
87
87
|
export {
|
88
|
-
|
88
|
+
F as YearPickerModal
|
89
89
|
};
|
@@ -10,3 +10,8 @@ export declare enum EDatePickerValue {
|
|
10
10
|
CurrentDate = "20240510",
|
11
11
|
CurrentDate3 = "2024-09-10"
|
12
12
|
}
|
13
|
+
export declare const BLOCK_WIDTH = 368;
|
14
|
+
export declare const COUNT_WORK_DAYS = 4;
|
15
|
+
export declare const MAX_DAY = 31;
|
16
|
+
export declare const MAX_MONTH = 12;
|
17
|
+
export declare const DATE_LENGTH = 10;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
var
|
2
|
-
const
|
1
|
+
var n = /* @__PURE__ */ ((t) => (t.CurrentDate1 = "2024-08-01", t.CurrentDate2 = "2024-07-01", t.CurrentDate3 = "1995-07-11", t))(n || {});
|
2
|
+
const s = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], C = [
|
3
3
|
"Январь",
|
4
4
|
"Февраль",
|
5
5
|
"Март",
|
@@ -13,10 +13,16 @@ const u = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], C = [
|
|
13
13
|
"Ноябрь",
|
14
14
|
"Декабрь"
|
15
15
|
];
|
16
|
-
var
|
16
|
+
var r = /* @__PURE__ */ ((t) => (t.CurrentDate1 = "", t.CurrentDate = "20240510", t.CurrentDate3 = "2024-09-10", t))(r || {});
|
17
|
+
const o = 368, u = 4, _ = 31, A = 12, T = 10;
|
17
18
|
export {
|
18
|
-
|
19
|
-
|
19
|
+
o as BLOCK_WIDTH,
|
20
|
+
u as COUNT_WORK_DAYS,
|
21
|
+
T as DATE_LENGTH,
|
22
|
+
n as EDatePickerBeforeDate,
|
23
|
+
r as EDatePickerValue,
|
24
|
+
_ as MAX_DAY,
|
25
|
+
A as MAX_MONTH,
|
20
26
|
C as months,
|
21
|
-
|
27
|
+
s as week
|
22
28
|
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { useRef as a, useEffect as g } from "react";
|
2
|
+
import { BLOCK_WIDTH as p } from "./constants.js";
|
3
|
+
const H = (d) => {
|
4
|
+
const t = a(null);
|
5
|
+
return g(() => {
|
6
|
+
var e, n, i, o, r, c;
|
7
|
+
const f = window.innerHeight, h = window.innerWidth;
|
8
|
+
if (t.current !== null) {
|
9
|
+
const w = ((n = (e = t == null ? void 0 : t.current) == null ? void 0 : e.parentElement) == null ? void 0 : n.offsetWidth) ?? 0, s = ((o = (i = t == null ? void 0 : t.current) == null ? void 0 : i.parentElement) == null ? void 0 : o.offsetHeight) ?? 0, u = (c = (r = t == null ? void 0 : t.current) == null ? void 0 : r.parentElement) == null ? void 0 : c.getBoundingClientRect(), l = t.current.offsetHeight;
|
10
|
+
f < u.y + l + s ? t.current.style.top = -l + "px" : t.current.style.top = s + "px", h < u.x + p && (t.current.style.left = w - p + "px"), t.current.style.opacity = "1";
|
11
|
+
}
|
12
|
+
}, [d]), t;
|
13
|
+
};
|
14
|
+
export {
|
15
|
+
H as useDatePickerPosition
|
16
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { DatePicker } from './DatePicker';
|
2
|
-
export type {
|
2
|
+
export type { TProps as TDatePickerProps, TDatePickerValue } from './DatePicker';
|
@@ -1,8 +1,9 @@
|
|
1
|
-
const o = (
|
2
|
-
const
|
3
|
-
return n >
|
4
|
-
};
|
1
|
+
const o = (t, r) => parseInt(t) > r ? r.toString() : t, a = (t) => {
|
2
|
+
const r = (/* @__PURE__ */ new Date()).getFullYear(), e = Math.floor(r / 100) * 100, n = parseInt(t) + e;
|
3
|
+
return n > r + 20 ? n - 100 : n;
|
4
|
+
}, c = (t, r) => (r = t > 12 ? r + 1 : t < 1 ? r - 1 : r, t = t > 12 ? 1 : t < 1 ? 12 : t, { y: r, m: t });
|
5
5
|
export {
|
6
6
|
o as formatDatePart,
|
7
|
-
|
7
|
+
a as getFullYear,
|
8
|
+
c as getUpdateDate
|
8
9
|
};
|
@@ -32,7 +32,7 @@ import '../../assets/Image.css';const k = "_picture_9zemz_2", x = "_image_9zemz_
|
|
32
32
|
[s.loading]: a
|
33
33
|
}),
|
34
34
|
children: [
|
35
|
-
r && /* @__PURE__ */ i("source", { srcSet: r, media: N.
|
35
|
+
r && /* @__PURE__ */ i("source", { srcSet: r, media: N.XS1 }),
|
36
36
|
e && /* @__PURE__ */ i("source", { srcSet: e, media: S.S }),
|
37
37
|
/* @__PURE__ */ i(
|
38
38
|
"img",
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import './assets/styles.css';const _ = "_input_yyf2c_2", t = "_inputBorderControl_yyf2c_14", c = "_editable_yyf2c_27", r = "_wrapper_yyf2c_50", n = "_active_yyf2c_56", o = "_button_yyf2c_44", y = "_h_yyf2c_100", e = "_b_yyf2c_44", p = "_d_yyf2c_10", a = "_m_yyf2c_122", f = "_a_yyf2c_56", s = "_prev_yyf2c_124", i = "_orange_yyf2c_138", d = "_current_yyf2c_155", u = "_monthGrid_yyf2c_160", b = {
|
2
|
+
input: _,
|
3
|
+
"input-wrapper": "_input-wrapper_yyf2c_6",
|
4
|
+
"date-wrapper": "_date-wrapper_yyf2c_10",
|
5
|
+
inputBorderControl: t,
|
6
|
+
editable: c,
|
7
|
+
"button-wrapper": "_button-wrapper_yyf2c_44",
|
8
|
+
wrapper: r,
|
9
|
+
active: n,
|
10
|
+
button: o,
|
11
|
+
"calendar-block": "_calendar-block_yyf2c_78",
|
12
|
+
h: y,
|
13
|
+
b: e,
|
14
|
+
d: p,
|
15
|
+
m: a,
|
16
|
+
a: f,
|
17
|
+
prev: s,
|
18
|
+
orange: i,
|
19
|
+
current: d,
|
20
|
+
monthGrid: u
|
21
|
+
};
|
22
|
+
export {
|
23
|
+
b as c
|
24
|
+
};
|
package/package.json
CHANGED
@@ -1,25 +0,0 @@
|
|
1
|
-
import './assets/styles.css';const o = "_input_1uohj_2", _ = "_inputBorderControl_1uohj_14", t = "_editable_1uohj_27", r = "_wrapper_1uohj_50", n = "_active_1uohj_56", e = "_button_1uohj_44", u = "_h_1uohj_107", p = "_b_1uohj_44", a = "_d_1uohj_10", c = "_m_1uohj_128", h = "_a_1uohj_56", j = "_prev_1uohj_130", i = "_orange_1uohj_146", d = "_current_1uohj_171", s = "_monthGrid_1uohj_176", l = {
|
2
|
-
input: o,
|
3
|
-
"input-wrapper": "_input-wrapper_1uohj_6",
|
4
|
-
"date-wrapper": "_date-wrapper_1uohj_10",
|
5
|
-
inputBorderControl: _,
|
6
|
-
editable: t,
|
7
|
-
"button-wrapper": "_button-wrapper_1uohj_44",
|
8
|
-
wrapper: r,
|
9
|
-
active: n,
|
10
|
-
button: e,
|
11
|
-
"field-overlow": "_field-overlow_1uohj_78",
|
12
|
-
"calendar-block": "_calendar-block_1uohj_84",
|
13
|
-
h: u,
|
14
|
-
b: p,
|
15
|
-
d: a,
|
16
|
-
m: c,
|
17
|
-
a: h,
|
18
|
-
prev: j,
|
19
|
-
orange: i,
|
20
|
-
current: d,
|
21
|
-
monthGrid: s
|
22
|
-
};
|
23
|
-
export {
|
24
|
-
l as c
|
25
|
-
};
|