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.
@@ -1,151 +1,147 @@
1
- import { jsx as a, Fragment as q, jsxs as u } from "react/jsx-runtime";
2
- import { useRef as G, useState as J, useEffect as K } from "react";
3
- import { week as Q } from "./constants.js";
4
- import { c as o } from "../../styles.module-BQZZ6FB1.js";
5
- import { Icon as T } from "../../icons/Icon.js";
6
- import { formating as i } from "../../utils/index.js";
7
- import { Button as j } from "../Button/Button.js";
8
- import { parseDate as F } from "../../utils/formating/Date.js";
9
- function ct({
10
- date: l,
11
- onChangeValue: I,
12
- setActive: P,
13
- before: g,
14
- onType: d
15
- }) {
16
- var k;
17
- const r = G(null);
18
- l = isNaN(new Date(l).getTime()) ? /* @__PURE__ */ new Date() : l;
19
- const h = F(l), p = F(l), y = {
20
- y: h.getFullYear(),
21
- d: h.getDate(),
22
- m: h.getMonth() + 1
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import { c as x } from "../../index-DIxK0V-G.js";
3
+ import { useState as O } from "react";
4
+ import { week as Y, COUNT_WORK_DAYS as j } from "./constants.js";
5
+ import { useDatePickerPosition as z } from "./hooks.js";
6
+ import { c as o } from "../../styles.module-Chnn6DA-.js";
7
+ import { getUpdateDate as M } from "./utils.js";
8
+ import { Icon as G } from "../../icons/Icon.js";
9
+ import { formating as s } from "../../utils/index.js";
10
+ import { Button as $ } from "../Button/Button.js";
11
+ import { parseDate as k } from "../../utils/formating/Date.js";
12
+ const tt = ({
13
+ date: i,
14
+ onChangeValue: P,
15
+ setIsActive: A,
16
+ before: h,
17
+ onChangeType: u
18
+ }) => {
19
+ var b;
20
+ i = isNaN(new Date(i).getTime()) ? /* @__PURE__ */ new Date() : i;
21
+ const d = k(i), D = k(i), y = {
22
+ y: d.getFullYear(),
23
+ d: d.getDate(),
24
+ m: d.getMonth() + 1
23
25
  }, f = {
24
- y: p.getFullYear(),
25
- d: p.getDate(),
26
- m: p.getMonth() + 1
27
- }, z = 4, [n, w] = J({ y: f.y, m: f.m }), v = 368;
28
- K(() => {
29
- var c, s, M, W, B, C;
30
- const t = window.innerHeight, e = window.innerWidth;
31
- if (r.current !== null) {
32
- const O = ((s = (c = r == null ? void 0 : r.current) == null ? void 0 : c.parentElement) == null ? void 0 : s.offsetWidth) || 0, A = ((W = (M = r == null ? void 0 : r.current) == null ? void 0 : M.parentElement) == null ? void 0 : W.offsetHeight) || 0, E = (C = (B = r == null ? void 0 : r.current) == null ? void 0 : B.parentElement) == null ? void 0 : C.getBoundingClientRect(), H = r.current.offsetHeight;
33
- t < E.y + H + A ? r.current.style.top = -H + "px" : r.current.style.top = A + "px", e < E.x + v && (r.current.style.left = O - v + "px"), r.current.style.opacity = "1";
34
- }
35
- }, [n]);
36
- const L = (t) => {
37
- let e = t.getDay();
38
- return e === 0 && (e = 7), e - 1;
39
- }, N = n.m - 1, m = new Date(n.y, N), D = [], x = (() => {
26
+ y: D.getFullYear(),
27
+ d: D.getDate(),
28
+ m: D.getMonth() + 1
29
+ }, [e, g] = O({ y: f.y, m: f.m }), B = z([e]), I = (t) => {
30
+ let r = t.getDay();
31
+ return r === 0 && (r = 7), r - 1;
32
+ }, N = e.m - 1, m = new Date(e.y, N), p = [], v = (() => {
40
33
  const t = new Date(m);
41
34
  t.setDate(t.getDate() - 1);
42
- const e = t.getDate(), c = [];
43
- for (let s = 0; s < L(m); s++)
44
- c.push(e - s);
35
+ const r = t.getDate(), c = [];
36
+ for (let n = 0; n < I(m); n++)
37
+ c.push(r - n);
45
38
  return c.reverse(), c;
46
39
  })();
47
40
  for (; m.getMonth() === N; )
48
- D.push(m.getDate()), m.setDate(m.getDate() + 1);
49
- const R = (() => {
50
- const e = 42 - (x.length + D.length), c = [];
51
- for (let s = 1; s <= e; s++)
52
- c.push(s);
41
+ p.push(m.getDate()), m.setDate(m.getDate() + 1);
42
+ const S = (() => {
43
+ const r = 42 - (v.length + p.length), c = [];
44
+ for (let n = 1; n <= r; n++)
45
+ c.push(n);
53
46
  return c;
54
- })(), b = (t, e) => (e = t > 12 ? e + 1 : t < 1 ? e - 1 : e, t = t > 12 ? 1 : t < 1 ? 12 : t, { y: e, m: t }), S = () => {
55
- P(!1);
56
- }, V = () => {
57
- w(b(n.m + 1, n.y));
58
- }, Y = () => {
59
- w(b(n.m - 1, n.y));
60
- }, $ = (t) => !!(g && g.getTime() > t), _ = (t) => {
61
- $(
47
+ })(), _ = () => {
48
+ A(!1);
49
+ }, C = () => {
50
+ g(M(e.m + 1, e.y));
51
+ }, F = () => {
52
+ g(M(e.m - 1, e.y));
53
+ }, w = (t) => !!(h && h.getTime() > t), L = (t) => {
54
+ w(
62
55
  (/* @__PURE__ */ new Date(
63
- `${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
56
+ `${e.y}-${s.Number(2, e.m)}-${s.Number(2, t)}`
64
57
  )).getTime()
65
- ) || (I(
58
+ ) || (P(
66
59
  /* @__PURE__ */ new Date(
67
- `${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
60
+ `${e.y}-${s.Number(2, e.m)}-${s.Number(2, t)}`
68
61
  )
69
- ), S());
62
+ ), _());
70
63
  };
71
- return /* @__PURE__ */ a(q, { children: /* @__PURE__ */ u(
64
+ return /* @__PURE__ */ l(
72
65
  "div",
73
66
  {
74
- className: [o["calendar-block"]].join(" "),
75
- ref: r,
67
+ className: o["calendar-block"],
68
+ ref: B,
76
69
  "data-testid": "calendar-modal",
77
70
  children: [
78
- /* @__PURE__ */ u("div", { className: o.h, children: [
71
+ /* @__PURE__ */ l("div", { className: o.h, children: [
79
72
  /* @__PURE__ */ a(
80
- j,
73
+ $,
81
74
  {
82
75
  isIconButton: !0,
83
76
  iconName: "DropdownArrowLeft16px",
84
- onClick: Y,
77
+ onClick: F,
85
78
  variant: "secondary-gray",
86
79
  size: "l"
87
80
  }
88
81
  ),
89
- /* @__PURE__ */ u(
90
- "div",
82
+ /* @__PURE__ */ l(
83
+ "button",
91
84
  {
85
+ type: "button",
92
86
  className: o.d,
93
- onClick: () => d == null ? void 0 : d("months"),
87
+ onClick: () => u == null ? void 0 : u("months"),
94
88
  "data-testid": "month-year-button",
95
89
  children: [
96
- (k = i.Month(n.m)) == null ? void 0 : k.name,
90
+ (b = s.Month(e.m)) == null ? void 0 : b.name,
97
91
  "’",
98
- n.y.toString().slice(-2),
99
- /* @__PURE__ */ a(T, { iconName: "DropdownArrowBottom16px" })
92
+ e.y.toString().slice(-2),
93
+ /* @__PURE__ */ a(G, { iconName: "DropdownArrowBottom16px" })
100
94
  ]
101
95
  }
102
96
  ),
103
97
  /* @__PURE__ */ a(
104
- j,
98
+ $,
105
99
  {
106
100
  isIconButton: !0,
107
101
  iconName: "DropdownArrowRight16px",
108
- onClick: V,
102
+ onClick: C,
109
103
  variant: "secondary-gray",
110
104
  size: "l"
111
105
  }
112
106
  )
113
107
  ] }),
114
- /* @__PURE__ */ u("div", { className: o.b, children: [
115
- Q.map((t, e) => /* @__PURE__ */ a(
108
+ /* @__PURE__ */ l("div", { className: o.b, children: [
109
+ Y.map((t, r) => /* @__PURE__ */ a(
116
110
  "div",
117
111
  {
118
- className: `${e > z ? [o.m, o.orange].join(" ") : o.m}`,
112
+ className: x(o.m, {
113
+ [o.orange]: r > j
114
+ }),
119
115
  children: t
120
116
  },
121
- `v${e}`
117
+ `v${r}`
122
118
  )),
123
- x.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e)),
124
- D.map((t, e) => /* @__PURE__ */ a(
125
- "div",
119
+ v.map((t, r) => /* @__PURE__ */ a("div", { className: o.m, children: t }, r)),
120
+ p.map((t, r) => /* @__PURE__ */ a(
121
+ "button",
126
122
  {
127
- className: $(
128
- (/* @__PURE__ */ new Date(
129
- `${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
130
- )).getTime()
131
- ) ? o.m : o.a,
132
- children: t !== 0 ? /* @__PURE__ */ a(
133
- "b",
123
+ type: "button",
124
+ onClick: () => L(t),
125
+ className: x(
126
+ w(
127
+ (/* @__PURE__ */ new Date(
128
+ `${e.y}-${s.Number(2, e.m)}-${s.Number(2, t)}`
129
+ )).getTime()
130
+ ) ? o.m : o.a,
134
131
  {
135
- className: y.y === n.y && y.m === n.m && y.d === t ? o.current : "",
136
- onClick: () => _(t),
137
- children: t
132
+ [o.current]: y.y === e.y && y.m === e.m && y.d === t
138
133
  }
139
- ) : /* @__PURE__ */ a("p", {})
134
+ ),
135
+ children: t !== 0 && t
140
136
  },
141
- e
137
+ r
142
138
  )),
143
- R.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e))
139
+ S.map((t, r) => /* @__PURE__ */ a("div", { className: o.m, children: t }, r))
144
140
  ] })
145
141
  ]
146
142
  }
147
- ) });
148
- }
143
+ );
144
+ };
149
145
  export {
150
- ct as DatePickerModal
146
+ tt as DatePickerModal
151
147
  };
@@ -1,9 +1,8 @@
1
- type MonthPickerModal = {
1
+ type TProps = {
2
2
  date: Date;
3
- onChangeValue: (d: Date) => void;
4
- setActive: (s: boolean) => void;
5
3
  before?: Date;
6
- onType?: (s: 'years') => void;
4
+ onChangeValue: (date: Date) => void;
5
+ onChangeType?: (type: 'years') => void;
7
6
  };
8
- export declare function MonthPickerModal({ date, onChangeValue, before, onType }: MonthPickerModal): import("react/jsx-runtime").JSX.Element;
7
+ export declare const MonthPickerModal: ({ date, onChangeValue, before, onChangeType }: TProps) => import("react/jsx-runtime").JSX.Element;
9
8
  export {};
@@ -1,102 +1,94 @@
1
- import { jsx as o, Fragment as z, jsxs as u } from "react/jsx-runtime";
2
- import { useRef as A, useState as F, useEffect as I } from "react";
3
- import { months as R } from "./constants.js";
4
- import { c as i } from "../../styles.module-BQZZ6FB1.js";
5
- import { Icon as S } from "../../icons/Icon.js";
6
- import { formating as c } from "../../utils/index.js";
7
- import { Button as C } from "../Button/Button.js";
8
- function K({
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: H,
11
- before: f,
12
- onType: s
13
- }) {
14
- const t = A(null), a = new Date(d), m = new Date(d), p = {
15
- y: a.getFullYear(),
16
- d: a.getDate(),
17
- m: a.getMonth() + 1
18
- }, l = {
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
- }, [n, h] = F(l.y), g = 368;
23
- I(() => {
24
- var N, y, x, D, b, k;
25
- const e = window.innerHeight, r = window.innerWidth;
26
- if (t.current !== null) {
27
- const j = ((y = (N = t == null ? void 0 : t.current) == null ? void 0 : N.parentElement) == null ? void 0 : y.offsetWidth) || 0, v = ((D = (x = t == null ? void 0 : t.current) == null ? void 0 : x.parentElement) == null ? void 0 : D.offsetHeight) || 0, $ = (k = (b = t == null ? void 0 : t.current) == null ? void 0 : b.parentElement) == null ? void 0 : k.getBoundingClientRect(), B = t.current.offsetHeight;
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
- `${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
31
+ `${t}-${a.Number(2, r)}-${a.Number(2, s.d)}`
39
32
  )).getTime()
40
- ) || H(
33
+ ) || D(
41
34
  /* @__PURE__ */ new Date(
42
- `${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
35
+ `${t}-${a.Number(2, r)}-${a.Number(2, s.d)}`
43
36
  )
44
37
  );
45
38
  };
46
- return /* @__PURE__ */ o(z, { children: /* @__PURE__ */ u("div", { className: [i["calendar-block"]].join(" "), ref: t, children: [
47
- /* @__PURE__ */ u("div", { className: i.h, children: [
48
- /* @__PURE__ */ o(
49
- C,
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: E,
46
+ onClick: g,
54
47
  variant: "secondary-gray",
55
48
  size: "l"
56
49
  }
57
50
  ),
58
- /* @__PURE__ */ u(
59
- "div",
51
+ /* @__PURE__ */ l(
52
+ "button",
60
53
  {
61
- onClick: () => s == null ? void 0 : s("years"),
62
- className: i.d,
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
- n.toString(),
66
- /* @__PURE__ */ o(S, { iconName: "DropdownArrowBottom16px" })
59
+ t.toString(),
60
+ /* @__PURE__ */ n(B, { iconName: "DropdownArrowBottom16px" })
67
61
  ]
68
62
  }
69
63
  ),
70
- /* @__PURE__ */ o(
71
- C,
64
+ /* @__PURE__ */ n(
65
+ b,
72
66
  {
73
67
  isIconButton: !0,
74
68
  iconName: "DropdownArrowRight16px",
75
- onClick: W,
69
+ onClick: w,
76
70
  variant: "secondary-gray",
77
71
  size: "l"
78
72
  }
79
73
  )
80
74
  ] }),
81
- /* @__PURE__ */ o("div", { className: i.monthGrid, "data-testid": "month-picker", children: R.map((e, r) => /* @__PURE__ */ o(
82
- "div",
75
+ /* @__PURE__ */ n("div", { className: e.monthGrid, "data-testid": "month-picker", children: x.map((r, o) => /* @__PURE__ */ n(
76
+ "button",
83
77
  {
84
- className: w(
85
- (/* @__PURE__ */ new Date(`${n}-${c.Number(2, r + 1)}`)).getTime()
86
- ) ? i.m : i.a,
87
- children: /* @__PURE__ */ o(
88
- "b",
89
- {
90
- className: p.y === n && p.m === r + 1 ? i.current : "",
91
- onClick: () => M(r + 1),
92
- children: e
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
- r
88
+ o
97
89
  )) })
98
- ] }) });
99
- }
90
+ ] });
91
+ };
100
92
  export {
101
- K as MonthPickerModal
93
+ F as MonthPickerModal
102
94
  };
@@ -1,9 +1,8 @@
1
- type YearPickerModal = {
1
+ type TProps = {
2
2
  date: Date;
3
- onChangeValue: (d: Date) => void;
4
- setActive: (s: boolean) => void;
5
3
  before?: Date;
6
- onType?: (s: 'years') => void;
4
+ onChangeValue: (date: Date) => void;
5
+ onChangeType?: (type: 'years') => void;
7
6
  };
8
- export declare function YearPickerModal({ date, onChangeValue, before, onType }: YearPickerModal): import("react/jsx-runtime").JSX.Element;
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 { jsx as r, Fragment as F, jsxs as B } from "react/jsx-runtime";
2
- import { useRef as M, useState as R, useEffect as I } from "react";
3
- import { c as n } from "../../styles.module-BQZZ6FB1.js";
4
- import { formating as c } from "../../utils/index.js";
5
- import { Button as C } from "../Button/Button.js";
6
- function q({
7
- date: u,
8
- onChangeValue: H,
9
- before: d,
10
- onType: i
11
- }) {
12
- const e = M(null), a = new Date(u), m = new Date(u), f = {
13
- y: a.getFullYear(),
14
- d: a.getDate(),
15
- m: a.getMonth() + 1
16
- }, o = {
17
- y: m.getFullYear(),
18
- d: m.getDate(),
19
- m: m.getMonth() + 1
20
- }, [l, p] = R(o.y), g = 368, W = l - 7, Y = Array.from(Array(15).keys()).map((t) => t + W);
21
- I(() => {
22
- var w, y, N, x, D, b;
23
- const t = window.innerHeight, s = window.innerWidth;
24
- if (e.current !== null) {
25
- const z = ((y = (w = e == null ? void 0 : e.current) == null ? void 0 : w.parentElement) == null ? void 0 : y.offsetWidth) || 0, k = ((x = (N = e == null ? void 0 : e.current) == null ? void 0 : N.parentElement) == null ? void 0 : x.offsetHeight) || 0, v = (b = (D = e == null ? void 0 : e.current) == null ? void 0 : D.parentElement) == null ? void 0 : b.getBoundingClientRect(), $ = e.current.offsetHeight;
26
- t < v.y + $ + k ? e.current.style.top = -$ + "px" : e.current.style.top = k + "px", s < v.x + g && (e.current.style.left = z - g + "px"), e.current.style.opacity = "1";
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
- `${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
29
+ `${e}-${n.Number(2, r.m)}-${n.Number(2, r.d)}`
37
30
  )).getTime()
38
- ) || H(
31
+ ) || b(
39
32
  /* @__PURE__ */ new Date(
40
- `${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
33
+ `${e}-${n.Number(2, r.m)}-${n.Number(2, r.d)}`
41
34
  )
42
35
  );
43
36
  };
44
- return /* @__PURE__ */ r(F, { children: /* @__PURE__ */ B("div", { className: [n["calendar-block"]].join(" "), ref: e, children: [
45
- /* @__PURE__ */ B("div", { className: n.h, children: [
46
- /* @__PURE__ */ r(
47
- C,
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: E,
44
+ onClick: $,
52
45
  variant: "secondary-gray",
53
46
  size: "l"
54
47
  }
55
48
  ),
56
- /* @__PURE__ */ r("div", { onClick: () => i == null ? void 0 : i("years"), className: n.d }),
57
- /* @__PURE__ */ r(
58
- C,
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: A,
62
+ onClick: w,
63
63
  variant: "secondary-gray",
64
64
  size: "l"
65
65
  }
66
66
  )
67
67
  ] }),
68
- /* @__PURE__ */ r("div", { className: n.monthGrid, "data-testid": "year-picker", children: Y.map((t, s) => /* @__PURE__ */ r(
69
- "div",
68
+ /* @__PURE__ */ o("div", { className: t.monthGrid, "data-testid": "year-picker", children: k.map((e, N) => /* @__PURE__ */ o(
69
+ "button",
70
70
  {
71
- className: h(
72
- (/* @__PURE__ */ new Date(`${t}-${c.Number(2, f.m)}`)).getTime()
73
- ) ? n.m : n.a,
74
- children: /* @__PURE__ */ r(
75
- "b",
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
- className: f.y === t ? n.current : "",
78
- onClick: () => j(t),
79
- children: t
78
+ [t.current]: u.y === e
80
79
  }
81
- )
80
+ ),
81
+ children: e
82
82
  },
83
- s
83
+ N
84
84
  )) })
85
- ] }) });
86
- }
85
+ ] });
86
+ };
87
87
  export {
88
- q as YearPickerModal
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 t = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "2024-08-01", r.CurrentDate2 = "2024-07-01", r.CurrentDate3 = "1995-07-11", r))(t || {});
2
- const u = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], C = [
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 n = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "", r.CurrentDate = "20240510", r.CurrentDate3 = "2024-09-10", r))(n || {});
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
- t as EDatePickerBeforeDate,
19
- n as EDatePickerValue,
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
- u as week
27
+ s as week
22
28
  };
@@ -0,0 +1,3 @@
1
+ import { DependencyList } from 'react';
2
+
3
+ export declare const useDatePickerPosition: (deps?: DependencyList) => import('react').RefObject<HTMLDivElement>;