mimir-ui-kit 1.34.5 → 1.34.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
- import { jsxs as K, jsx as w } from "react/jsx-runtime";
2
- import { c as x } from "../../index-DIxK0V-G.js";
3
- import { memo as Q, forwardRef as W, useState as l, useEffect as D } from "react";
1
+ import { jsxs as K, jsx as N } from "react/jsx-runtime";
2
+ import { c as I } from "../../index-DIxK0V-G.js";
3
+ import { memo as Q, forwardRef as W, useState as D, useEffect as T } from "react";
4
4
  import { DatePickerModal as Z } from "./DatePickerModal.js";
5
5
  import { MonthPickerModal as b } from "./MonthPickerModal.js";
6
6
  import { c as r } from "../../styles.module-CaPkyXYQ.js";
7
7
  import { formatDatePart as h } from "./utils.js";
8
- import { YearPickerModal as B } from "./YearPickerModal.js";
9
- import { useClickOutside as C } from "../../hooks/useClickOutside/useClickOutside.js";
10
- import { formating as E } from "../../utils/index.js";
8
+ import { YearPickerModal as C } from "./YearPickerModal.js";
9
+ import { useClickOutside as E } from "../../hooks/useClickOutside/useClickOutside.js";
10
+ import { formating as B } from "../../utils/index.js";
11
11
  import { I as V } from "../../Input-DGr0q5AJ.js";
12
12
  import { EInputStatus as tt } from "../Input/constants.js";
13
13
  const st = 31, et = 12, it = 10, at = Q(
@@ -19,66 +19,66 @@ const st = 31, et = 12, it = 10, at = Q(
19
19
  name: p,
20
20
  before: a,
21
21
  type: m = "days",
22
- error: y,
23
- onError: n,
24
- onBlur: T,
25
- validateImmediately: I,
22
+ error: A,
23
+ onError: f,
24
+ onBlur: n,
25
+ validateImmediately: P,
26
26
  variant: X,
27
- disabled: P = !1,
27
+ disabled: u = !1,
28
28
  editable: S = !1,
29
29
  ...G
30
30
  }, L) => {
31
- const [f, c] = l(!1), [d, o] = l(m), [t, N] = l(
31
+ const [d, c] = D(!1), [w, o] = D(m), [t, l] = D(
32
32
  e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
33
- ), [A, g] = l(y), [R, k] = l("");
34
- D(() => {
35
- g(y);
36
- }, [y]), D(() => {
37
- N(
33
+ ), [g, k] = D(A), [R, v] = D("");
34
+ T(() => {
35
+ k(A);
36
+ }, [A]), T(() => {
37
+ l(
38
38
  e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
39
39
  );
40
- }, [e]), D(() => {
41
- t && typeof t != "string" && !isNaN(t == null ? void 0 : t.getTime()) ? k(E.Date(t, "dd/mm/yyyy")) : k("");
40
+ }, [e]), T(() => {
41
+ t && typeof t != "string" && !isNaN(t == null ? void 0 : t.getTime()) ? v(B.Date(t, "dd/mm/yyyy")) : v("");
42
42
  }, [t]);
43
43
  const j = e && new Date(e).getTime;
44
- D(() => {
45
- I && (j ? (g(!1), n == null || n({ name: p, active: !1 })) : (g(!0), n == null || n({ name: p, active: !0 })));
46
- }, [I, p, j]), C({
47
- isActive: f,
44
+ T(() => {
45
+ P && (j ? (k(!1), f == null || f({ name: p, active: !1 })) : (k(!0), f == null || f({ name: p, active: !0 })));
46
+ }, [P, p, j]), E({
47
+ isActive: d,
48
48
  setActive: (s) => {
49
49
  c(s), o(m);
50
50
  },
51
51
  className: r["calendar-block"]
52
52
  });
53
53
  const U = () => {
54
- P || c(!0);
55
- }, u = (s) => {
56
- isNaN(s.getTime()) || (N(s), i == null || i({ value: s, name: p })), d === "years" && (m === "years" ? (c(!1), o(m)) : o("months")), d === "months" && (m === "months" ? (c(!1), o(m)) : o("days")), N(s), i == null || i({ value: s, name: p }), T == null || T(s);
54
+ u || c(!0);
55
+ }, M = (s) => {
56
+ isNaN(s.getTime()) || (l(s), i == null || i({ value: s, name: p })), w === "years" && (m === "years" ? (c(!1), o(m)) : o("months")), w === "months" && (m === "months" ? (c(!1), o(m)) : o("days")), l(s), i == null || i({ value: s, name: p }), n == null || n(s);
57
57
  }, q = (s) => {
58
58
  if (S) {
59
- const v = s.target.value.replace(/[^\d]/g, ""), [O, Y, _] = [
60
- h(v.substring(0, 2), st),
61
- h(v.substring(2, 4), et),
62
- v.substring(4, 8)
59
+ const x = s.target.value.replace(/[^\d]/g, ""), [O, Y, _] = [
60
+ h(x.substring(0, 2), st),
61
+ h(x.substring(2, 4), et),
62
+ x.substring(4, 8)
63
63
  ], $ = [O, Y, _].filter(Boolean).join("/");
64
- if (k($), $.length === it) {
65
- const J = parseInt(_), M = /* @__PURE__ */ new Date(
64
+ if (v($), $.length === it) {
65
+ const J = parseInt(_), y = /* @__PURE__ */ new Date(
66
66
  `${J}-${Y.padStart(2, "0")}-${O.padStart(2, "0")}`
67
67
  );
68
- isNaN(M.getTime()) || (N(M), i == null || i({ value: M, name: p }));
68
+ isNaN(y.getTime()) || (l(y), i == null || i({ value: y, name: p }), n == null || n(y));
69
69
  }
70
70
  }
71
- }, z = x(r.wrapper, f && r.active), F = x(r.input, r.inputBorderControl);
72
- return /* @__PURE__ */ K("div", { className: z, "data-disabled": P, children: [
73
- /* @__PURE__ */ w(
71
+ }, z = I(r.wrapper, d && r.active), F = I(r.input, r.inputBorderControl);
72
+ return /* @__PURE__ */ K("div", { className: z, "data-disabled": u, children: [
73
+ /* @__PURE__ */ N(
74
74
  "div",
75
75
  {
76
- "data-error": A,
77
- className: x(r["date-wrapper"], {
76
+ "data-error": g,
77
+ className: I(r["date-wrapper"], {
78
78
  [r.editable]: S
79
79
  }),
80
80
  onClick: U,
81
- children: /* @__PURE__ */ w(
81
+ children: /* @__PURE__ */ N(
82
82
  V,
83
83
  {
84
84
  ref: L,
@@ -87,43 +87,43 @@ const st = 31, et = 12, it = 10, at = Q(
87
87
  size: H,
88
88
  type: "text",
89
89
  variant: X,
90
- status: A ? tt.Error : void 0,
90
+ status: g ? tt.Error : void 0,
91
91
  value: R,
92
92
  onChange: q,
93
93
  rightAddon: {
94
94
  addonType: "icon",
95
- addonContent: f ? "DropdownArrowUp24px" : "DropdownArrowDown24px"
95
+ addonContent: d ? "DropdownArrowUp24px" : "DropdownArrowDown24px"
96
96
  },
97
- "data-error": A,
97
+ "data-error": g,
98
98
  ...G
99
99
  }
100
100
  )
101
101
  }
102
102
  ),
103
- d === "days" && f && /* @__PURE__ */ w(
103
+ w === "days" && d && /* @__PURE__ */ N(
104
104
  Z,
105
105
  {
106
- onChangeValue: u,
106
+ onChangeValue: M,
107
107
  date: t || /* @__PURE__ */ new Date(),
108
108
  setActive: c,
109
109
  before: typeof a == "string" ? new Date(a) : a,
110
110
  onType: o
111
111
  }
112
112
  ),
113
- d === "months" && f && /* @__PURE__ */ w(
113
+ w === "months" && d && /* @__PURE__ */ N(
114
114
  b,
115
115
  {
116
- onChangeValue: u,
116
+ onChangeValue: M,
117
117
  date: t || /* @__PURE__ */ new Date(),
118
118
  setActive: c,
119
119
  before: typeof a == "string" ? new Date(a) : a,
120
120
  onType: o
121
121
  }
122
122
  ),
123
- d === "years" && f && /* @__PURE__ */ w(
124
- B,
123
+ w === "years" && d && /* @__PURE__ */ N(
124
+ C,
125
125
  {
126
- onChangeValue: u,
126
+ onChangeValue: M,
127
127
  date: t || /* @__PURE__ */ new Date(),
128
128
  setActive: c,
129
129
  before: typeof a == "string" ? new Date(a) : a,
@@ -1,74 +1,74 @@
1
- import { jsx as a, Fragment as _, jsxs as u } from "react/jsx-runtime";
2
- import { useRef as O, useState as q, useEffect as G } from "react";
3
- import { week as J } from "./constants.js";
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
4
  import { c as o } from "../../styles.module-CaPkyXYQ.js";
5
- import { Icon as K } from "../../icons/Icon.js";
5
+ import { Icon as T } from "../../icons/Icon.js";
6
6
  import { formating as i } from "../../utils/index.js";
7
- import { Button as H } from "../Button/Button.js";
8
- import { parseDate as j } from "../../utils/formating/Date.js";
9
- function st({
7
+ import { Button as j } from "../Button/Button.js";
8
+ import { parseDate as F } from "../../utils/formating/Date.js";
9
+ function ct({
10
10
  date: l,
11
- onChangeValue: E,
12
- setActive: F,
13
- before: D,
11
+ onChangeValue: I,
12
+ setActive: P,
13
+ before: g,
14
14
  onType: d
15
15
  }) {
16
16
  var k;
17
- const r = O(null);
17
+ const r = G(null);
18
18
  l = isNaN(new Date(l).getTime()) ? /* @__PURE__ */ new Date() : l;
19
- const h = j(l), p = j(l), f = {
19
+ const h = F(l), p = F(l), y = {
20
20
  y: h.getFullYear(),
21
21
  d: h.getDate(),
22
22
  m: h.getMonth() + 1
23
- }, g = {
23
+ }, f = {
24
24
  y: p.getFullYear(),
25
25
  d: p.getDate(),
26
26
  m: p.getMonth() + 1
27
- }, I = 4, [n, w] = q({ y: g.y, m: g.m }), v = 368;
28
- G(() => {
29
- var c, s, M, W;
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
30
  const t = window.innerHeight, e = window.innerWidth;
31
31
  if (r.current !== null) {
32
- const Y = ((s = (c = r == null ? void 0 : r.current) == null ? void 0 : c.parentElement) == null ? void 0 : s.offsetWidth) || 0, B = ((W = (M = r == null ? void 0 : r.current) == null ? void 0 : M.parentElement) == null ? void 0 : W.offsetHeight) || 0, C = r.current.getBoundingClientRect(), A = r.current.offsetHeight;
33
- t < C.y + A + B ? r.current.style.top = -A + "px" : r.current.style.top = B + "px", e < C.x + v && (r.current.style.left = Y - v + "px"), r.current.style.opacity = "1";
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
34
  }
35
35
  }, [n]);
36
- const P = (t) => {
36
+ const L = (t) => {
37
37
  let e = t.getDay();
38
38
  return e === 0 && (e = 7), e - 1;
39
- }, N = n.m - 1, m = new Date(n.y, N), y = [], x = (() => {
39
+ }, N = n.m - 1, m = new Date(n.y, N), D = [], x = (() => {
40
40
  const t = new Date(m);
41
41
  t.setDate(t.getDate() - 1);
42
42
  const e = t.getDate(), c = [];
43
- for (let s = 0; s < P(m); s++)
43
+ for (let s = 0; s < L(m); s++)
44
44
  c.push(e - s);
45
45
  return c.reverse(), c;
46
46
  })();
47
47
  for (; m.getMonth() === N; )
48
- y.push(m.getDate()), m.setDate(m.getDate() + 1);
49
- const z = (() => {
50
- const e = 42 - (x.length + y.length), c = [];
48
+ D.push(m.getDate()), m.setDate(m.getDate() + 1);
49
+ const R = (() => {
50
+ const e = 42 - (x.length + D.length), c = [];
51
51
  for (let s = 1; s <= e; s++)
52
52
  c.push(s);
53
53
  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 }), L = () => {
55
- F(!1);
56
- }, R = () => {
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
57
  w(b(n.m + 1, n.y));
58
- }, S = () => {
58
+ }, Y = () => {
59
59
  w(b(n.m - 1, n.y));
60
- }, $ = (t) => !!(D && D.getTime() > t), V = (t) => {
60
+ }, $ = (t) => !!(g && g.getTime() > t), _ = (t) => {
61
61
  $(
62
62
  (/* @__PURE__ */ new Date(
63
63
  `${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
64
64
  )).getTime()
65
- ) || (E(
65
+ ) || (I(
66
66
  /* @__PURE__ */ new Date(
67
67
  `${n.y}-${i.Number(2, n.m)}-${i.Number(2, t)}`
68
68
  )
69
- ), L());
69
+ ), S());
70
70
  };
71
- return /* @__PURE__ */ a(_, { children: /* @__PURE__ */ u(
71
+ return /* @__PURE__ */ a(q, { children: /* @__PURE__ */ u(
72
72
  "div",
73
73
  {
74
74
  className: [o["calendar-block"]].join(" "),
@@ -77,11 +77,11 @@ function st({
77
77
  children: [
78
78
  /* @__PURE__ */ u("div", { className: o.h, children: [
79
79
  /* @__PURE__ */ a(
80
- H,
80
+ j,
81
81
  {
82
82
  isIconButton: !0,
83
83
  iconName: "DropdownArrowLeft16px",
84
- onClick: S,
84
+ onClick: Y,
85
85
  variant: "secondary-gray",
86
86
  size: "l"
87
87
  }
@@ -96,32 +96,32 @@ function st({
96
96
  (k = i.Month(n.m)) == null ? void 0 : k.name,
97
97
  "’",
98
98
  n.y.toString().slice(-2),
99
- /* @__PURE__ */ a(K, { iconName: "DropdownArrowBottom16px" })
99
+ /* @__PURE__ */ a(T, { iconName: "DropdownArrowBottom16px" })
100
100
  ]
101
101
  }
102
102
  ),
103
103
  /* @__PURE__ */ a(
104
- H,
104
+ j,
105
105
  {
106
106
  isIconButton: !0,
107
107
  iconName: "DropdownArrowRight16px",
108
- onClick: R,
108
+ onClick: V,
109
109
  variant: "secondary-gray",
110
110
  size: "l"
111
111
  }
112
112
  )
113
113
  ] }),
114
114
  /* @__PURE__ */ u("div", { className: o.b, children: [
115
- J.map((t, e) => /* @__PURE__ */ a(
115
+ Q.map((t, e) => /* @__PURE__ */ a(
116
116
  "div",
117
117
  {
118
- className: `${e > I ? [o.m, o.orange].join(" ") : o.m}`,
118
+ className: `${e > z ? [o.m, o.orange].join(" ") : o.m}`,
119
119
  children: t
120
120
  },
121
121
  `v${e}`
122
122
  )),
123
123
  x.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e)),
124
- y.map((t, e) => /* @__PURE__ */ a(
124
+ D.map((t, e) => /* @__PURE__ */ a(
125
125
  "div",
126
126
  {
127
127
  className: $(
@@ -132,20 +132,20 @@ function st({
132
132
  children: t !== 0 ? /* @__PURE__ */ a(
133
133
  "b",
134
134
  {
135
- className: f.y === n.y && f.m === n.m && f.d === t ? o.current : "",
136
- onClick: () => V(t),
135
+ className: y.y === n.y && y.m === n.m && y.d === t ? o.current : "",
136
+ onClick: () => _(t),
137
137
  children: t
138
138
  }
139
139
  ) : /* @__PURE__ */ a("p", {})
140
140
  },
141
141
  e
142
142
  )),
143
- z.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e))
143
+ R.map((t, e) => /* @__PURE__ */ a("div", { className: o.m, children: t }, e))
144
144
  ] })
145
145
  ]
146
146
  }
147
147
  ) });
148
148
  }
149
149
  export {
150
- st as DatePickerModal
150
+ ct as DatePickerModal
151
151
  };
@@ -1,17 +1,17 @@
1
- import { jsx as o, Fragment as j, jsxs as u } from "react/jsx-runtime";
2
- import { useRef as z, useState as A, useEffect as E } from "react";
3
- import { months as F } from "./constants.js";
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
4
  import { c as i } from "../../styles.module-CaPkyXYQ.js";
5
- import { Icon as I } from "../../icons/Icon.js";
5
+ import { Icon as S } from "../../icons/Icon.js";
6
6
  import { formating as c } from "../../utils/index.js";
7
- import { Button as v } from "../Button/Button.js";
8
- function q({
7
+ import { Button as C } from "../Button/Button.js";
8
+ function K({
9
9
  date: d,
10
- onChangeValue: $,
10
+ onChangeValue: H,
11
11
  before: f,
12
12
  onType: s
13
13
  }) {
14
- const t = z(null), a = new Date(d), m = new Date(d), h = {
14
+ const t = A(null), a = new Date(d), m = new Date(d), p = {
15
15
  y: a.getFullYear(),
16
16
  d: a.getDate(),
17
17
  m: a.getMonth() + 1
@@ -19,38 +19,38 @@ function q({
19
19
  y: m.getFullYear(),
20
20
  d: m.getDate(),
21
21
  m: m.getMonth() + 1
22
- }, [n, p] = A(l.y), g = 368;
23
- E(() => {
24
- var N, y, x, D;
22
+ }, [n, h] = F(l.y), g = 368;
23
+ I(() => {
24
+ var N, y, x, D, b, k;
25
25
  const e = window.innerHeight, r = window.innerWidth;
26
26
  if (t.current !== null) {
27
- const W = ((y = (N = t == null ? void 0 : t.current) == null ? void 0 : N.parentElement) == null ? void 0 : y.offsetWidth) || 0, M = (D = (x = t == null ? void 0 : t.current) == null ? void 0 : x.parentElement) == null ? void 0 : D.offsetHeight, b = t.current.getBoundingClientRect(), k = t.current.offsetHeight;
28
- e < b.y + k ? t.current.style.top = -k + "px" : t.current.style.top = M + "px", r < b.x + g && (t.current.style.left = W - g + "px"), t.current.style.opacity = "1";
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
29
  }
30
30
  }, []);
31
- const B = () => {
32
- p(n + 1);
33
- }, C = () => {
34
- p(n - 1);
35
- }, w = (e) => !!(f && f.getTime() > e), H = (e) => {
31
+ const W = () => {
32
+ h(n + 1);
33
+ }, E = () => {
34
+ h(n - 1);
35
+ }, w = (e) => !!(f && f.getTime() > e), M = (e) => {
36
36
  w(
37
37
  (/* @__PURE__ */ new Date(
38
38
  `${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
39
39
  )).getTime()
40
- ) || $(
40
+ ) || H(
41
41
  /* @__PURE__ */ new Date(
42
42
  `${n}-${c.Number(2, e)}-${c.Number(2, l.d)}`
43
43
  )
44
44
  );
45
45
  };
46
- return /* @__PURE__ */ o(j, { children: /* @__PURE__ */ u("div", { className: [i["calendar-block"]].join(" "), ref: t, children: [
46
+ return /* @__PURE__ */ o(z, { children: /* @__PURE__ */ u("div", { className: [i["calendar-block"]].join(" "), ref: t, children: [
47
47
  /* @__PURE__ */ u("div", { className: i.h, children: [
48
48
  /* @__PURE__ */ o(
49
- v,
49
+ C,
50
50
  {
51
51
  isIconButton: !0,
52
52
  iconName: "DropdownArrowLeft16px",
53
- onClick: C,
53
+ onClick: E,
54
54
  variant: "secondary-gray",
55
55
  size: "l"
56
56
  }
@@ -63,22 +63,22 @@ function q({
63
63
  "data-testid": "year-button",
64
64
  children: [
65
65
  n.toString(),
66
- /* @__PURE__ */ o(I, { iconName: "DropdownArrowBottom16px" })
66
+ /* @__PURE__ */ o(S, { iconName: "DropdownArrowBottom16px" })
67
67
  ]
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ o(
71
- v,
71
+ C,
72
72
  {
73
73
  isIconButton: !0,
74
74
  iconName: "DropdownArrowRight16px",
75
- onClick: B,
75
+ onClick: W,
76
76
  variant: "secondary-gray",
77
77
  size: "l"
78
78
  }
79
79
  )
80
80
  ] }),
81
- /* @__PURE__ */ o("div", { className: i.monthGrid, "data-testid": "month-picker", children: F.map((e, r) => /* @__PURE__ */ o(
81
+ /* @__PURE__ */ o("div", { className: i.monthGrid, "data-testid": "month-picker", children: R.map((e, r) => /* @__PURE__ */ o(
82
82
  "div",
83
83
  {
84
84
  className: w(
@@ -87,8 +87,8 @@ function q({
87
87
  children: /* @__PURE__ */ o(
88
88
  "b",
89
89
  {
90
- className: h.y === n && h.m === r + 1 ? i.current : "",
91
- onClick: () => H(r + 1),
90
+ className: p.y === n && p.m === r + 1 ? i.current : "",
91
+ onClick: () => M(r + 1),
92
92
  children: e
93
93
  }
94
94
  )
@@ -98,5 +98,5 @@ function q({
98
98
  ] }) });
99
99
  }
100
100
  export {
101
- q as MonthPickerModal
101
+ K as MonthPickerModal
102
102
  };
@@ -1,71 +1,71 @@
1
- import { jsx as r, Fragment as z, jsxs as k } from "react/jsx-runtime";
2
- import { useRef as E, useState as F, useEffect as M } from "react";
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
3
  import { c as n } from "../../styles.module-CaPkyXYQ.js";
4
4
  import { formating as c } from "../../utils/index.js";
5
- import { Button as v } from "../Button/Button.js";
6
- function G({
5
+ import { Button as C } from "../Button/Button.js";
6
+ function q({
7
7
  date: u,
8
- onChangeValue: $,
8
+ onChangeValue: H,
9
9
  before: d,
10
- onType: s
10
+ onType: i
11
11
  }) {
12
- const e = E(null), a = new Date(u), l = new Date(u), f = {
12
+ const e = M(null), a = new Date(u), m = new Date(u), f = {
13
13
  y: a.getFullYear(),
14
14
  d: a.getDate(),
15
15
  m: a.getMonth() + 1
16
16
  }, o = {
17
- y: l.getFullYear(),
18
- d: l.getDate(),
19
- m: l.getMonth() + 1
20
- }, [m, g] = F(o.y), p = 368, B = m - 7, C = Array.from(Array(15).keys()).map((t) => t + B);
21
- M(() => {
22
- var w, y, N, x;
23
- const t = window.innerHeight, i = window.innerWidth;
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
24
  if (e.current !== null) {
25
- const A = ((y = (w = e == null ? void 0 : e.current) == null ? void 0 : w.parentElement) == null ? void 0 : y.offsetWidth) || 0, j = (x = (N = e == null ? void 0 : e.current) == null ? void 0 : N.parentElement) == null ? void 0 : x.offsetHeight, D = e.current.getBoundingClientRect(), b = e.current.offsetHeight;
26
- t < D.y + b ? e.current.style.top = -b + "px" : e.current.style.top = j + "px", i < D.x + p && (e.current.style.left = A - p + "px"), e.current.style.opacity = "1";
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
27
  }
28
28
  }, []);
29
- const H = () => {
30
- g(m + 15);
31
- }, W = () => {
32
- g(m - 15);
33
- }, h = (t) => !!(d && d.getTime() > t), Y = (t) => {
29
+ const A = () => {
30
+ p(l + 15);
31
+ }, E = () => {
32
+ p(l - 15);
33
+ }, h = (t) => !!(d && d.getTime() > t), j = (t) => {
34
34
  h(
35
35
  (/* @__PURE__ */ new Date(
36
36
  `${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
37
37
  )).getTime()
38
- ) || $(
38
+ ) || H(
39
39
  /* @__PURE__ */ new Date(
40
40
  `${t}-${c.Number(2, o.m)}-${c.Number(2, o.d)}`
41
41
  )
42
42
  );
43
43
  };
44
- return /* @__PURE__ */ r(z, { children: /* @__PURE__ */ k("div", { className: [n["calendar-block"]].join(" "), ref: e, children: [
45
- /* @__PURE__ */ k("div", { className: n.h, children: [
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
46
  /* @__PURE__ */ r(
47
- v,
47
+ C,
48
48
  {
49
49
  isIconButton: !0,
50
50
  iconName: "DropdownArrowLeft16px",
51
- onClick: W,
51
+ onClick: E,
52
52
  variant: "secondary-gray",
53
53
  size: "l"
54
54
  }
55
55
  ),
56
- /* @__PURE__ */ r("div", { onClick: () => s == null ? void 0 : s("years"), className: n.d }),
56
+ /* @__PURE__ */ r("div", { onClick: () => i == null ? void 0 : i("years"), className: n.d }),
57
57
  /* @__PURE__ */ r(
58
- v,
58
+ C,
59
59
  {
60
60
  isIconButton: !0,
61
61
  iconName: "DropdownArrowRight16px",
62
- onClick: H,
62
+ onClick: A,
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: C.map((t, i) => /* @__PURE__ */ r(
68
+ /* @__PURE__ */ r("div", { className: n.monthGrid, "data-testid": "year-picker", children: Y.map((t, s) => /* @__PURE__ */ r(
69
69
  "div",
70
70
  {
71
71
  className: h(
@@ -75,15 +75,15 @@ function G({
75
75
  "b",
76
76
  {
77
77
  className: f.y === t ? n.current : "",
78
- onClick: () => Y(t),
78
+ onClick: () => j(t),
79
79
  children: t
80
80
  }
81
81
  )
82
82
  },
83
- i
83
+ s
84
84
  )) })
85
85
  ] }) });
86
86
  }
87
87
  export {
88
- G as YearPickerModal
88
+ q as YearPickerModal
89
89
  };
@@ -1,7 +1,7 @@
1
1
  export declare enum EDatePickerBeforeDate {
2
2
  CurrentDate1 = "2024-08-01",
3
3
  CurrentDate2 = "2024-07-01",
4
- CurrentDate3 = "2024-07-11"
4
+ CurrentDate3 = "1995-07-11"
5
5
  }
6
6
  export declare const week: string[];
7
7
  export declare const months: string[];
@@ -1,4 +1,4 @@
1
- var t = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "2024-08-01", r.CurrentDate2 = "2024-07-01", r.CurrentDate3 = "2024-07-11", r))(t || {});
1
+ var t = /* @__PURE__ */ ((r) => (r.CurrentDate1 = "2024-08-01", r.CurrentDate2 = "2024-07-01", r.CurrentDate3 = "1995-07-11", r))(t || {});
2
2
  const u = ["пн", "вт", "ср", "чт", "пт", "сб", "вс"], C = [
3
3
  "Январь",
4
4
  "Февраль",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.34.5",
4
+ "version": "1.34.6",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {