mimir-ui-kit 1.43.4 → 1.43.5

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.
@@ -1,178 +1,242 @@
1
- import { jsxs as E, jsx as m } from "react/jsx-runtime";
2
- import { c as Y } from "../../index-DIxK0V-G.js";
3
- import { memo as ot, forwardRef as ct, useState as N, useEffect as v } from "react";
4
- import { MAX_DAY as at, MAX_MONTH as mt, DATE_LENGTH as ft } from "./constants.js";
5
- import { DatePickerModal as pt } from "./DatePickerModal.js";
6
- import { MonthPickerModal as dt } from "./MonthPickerModal.js";
7
- import { c as e } from "../../styles.module-Cuqm31CO.js";
8
- import { formatDatePart as F } from "./utils.js";
9
- import { YearPickerModal as yt } from "./YearPickerModal.js";
10
- import { useClickOutside as nt } from "../../hooks/useClickOutside/useClickOutside.js";
11
- import { Icon as G } from "../../icons/Icon.js";
12
- import { formating as D } from "../../utils/index.js";
13
- import { I as lt } from "../../Input-BU_6U1CW.js";
14
- import { EInputStatus as Dt, EInputSize as K } from "../Input/constants.js";
15
- const wt = {
16
- days: pt,
17
- months: dt,
18
- years: yt
19
- }, Nt = ot(
20
- ct(
1
+ import { jsxs as Q, jsx as d } from "react/jsx-runtime";
2
+ import { c as X } from "../../index-DIxK0V-G.js";
3
+ import { memo as pt, forwardRef as dt, useState as I, useEffect as $ } from "react";
4
+ import { MAX_DAY as yt, MAX_MONTH as wt, DATE_LENGTH as lt } from "./constants.js";
5
+ import { DatePickerModal as Nt } from "./DatePickerModal.js";
6
+ import { MonthPickerModal as Tt } from "./MonthPickerModal.js";
7
+ import { c as n } from "../../styles.module-Cuqm31CO.js";
8
+ import { formatDatePart as Z } from "./utils.js";
9
+ import { YearPickerModal as Mt } from "./YearPickerModal.js";
10
+ import { useClickOutside as kt } from "../../hooks/useClickOutside/useClickOutside.js";
11
+ import { Icon as z } from "../../icons/Icon.js";
12
+ import { formating as w } from "../../utils/index.js";
13
+ import { I as At } from "../../Input-BU_6U1CW.js";
14
+ import { EInputStatus as It, EInputSize as b } from "../Input/constants.js";
15
+ const Pt = pt(
16
+ dt(
21
17
  ({
22
- size: $,
23
- value: i,
18
+ size: g,
19
+ value: l,
24
20
  onChangeValue: s,
25
- name: c,
26
- before: _,
27
- type: d = "days",
21
+ name: y,
22
+ before: N,
23
+ type: a = "days",
28
24
  error: j,
29
- onError: y,
30
- onBlur: r,
31
- validateImmediately: g,
32
- variant: W,
33
- disabled: b = !1,
34
- editable: k = !1,
35
- openOnInput: H = !0,
36
- sendIntermediateValues: q = !1,
37
- disableFuture: J = !1,
38
- disablePast: Q = !1,
39
- disabledDate: Z,
40
- validRange: f,
41
- ...A
42
- }, z) => {
43
- const [I, p] = N(!1), [h, n] = N(d), [a, P] = N(
44
- () => i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
45
- ), [T, u] = N(j), [R, M] = N("");
46
- A.status = !!T && Dt.Error || A.status, v(() => {
47
- u(j);
48
- }, [j]), v(() => {
49
- P(
50
- i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
25
+ onError: T,
26
+ onBlur: o,
27
+ validateImmediately: G,
28
+ variant: C,
29
+ disabled: v = !1,
30
+ editable: x = !1,
31
+ openOnInput: L = !0,
32
+ sendIntermediateValues: R = !1,
33
+ disableFuture: W = !1,
34
+ disablePast: q = !1,
35
+ disabledDate: _,
36
+ validRange: c,
37
+ ...u
38
+ }, B) => {
39
+ const [h, D] = I(!1), [F, m] = I(a), [p, M] = I(
40
+ () => l && !isNaN(new Date(l).getTime()) ? new Date(l) : void 0
41
+ ), [S, O] = I(j), [V, H] = I(""), [tt, k] = I();
42
+ u.status = !!S && It.Error || u.status, $(() => {
43
+ O(j);
44
+ }, [j]), $(() => {
45
+ M(
46
+ l && !isNaN(new Date(l).getTime()) ? new Date(l) : void 0
51
47
  );
52
- }, [i]), v(() => {
53
- a && typeof a != "string" && !isNaN(a == null ? void 0 : a.getTime()) ? M(D.Date(a, "dd/mm/yyyy")) : M("");
54
- }, [a]);
55
- const L = i && new Date(i).getTime;
56
- v(() => {
57
- g && (L ? (u(!1), y == null || y({ name: c, active: !1 })) : (u(!0), y == null || y({ name: c, active: !0 })));
58
- }, [g, c, L]), nt({
59
- isActive: I,
48
+ }, [l]), $(() => {
49
+ p && typeof p != "string" && !isNaN(p == null ? void 0 : p.getTime()) ? H(w.Date(p, "dd/mm/yyyy")) : H("");
50
+ }, [p]);
51
+ const E = l && new Date(l).getTime;
52
+ $(() => {
53
+ G && (E ? (O(!1), T == null || T({ name: y, active: !1 })) : (O(!0), T == null || T({ name: y, active: !0 })));
54
+ }, [G, y, E]), kt({
55
+ isActive: h,
60
56
  setActive: (t) => {
61
- p(t), n(d);
57
+ D(t), m(a), t || k(void 0);
62
58
  },
63
- className: e["calendar-block"]
59
+ className: n["calendar-block"]
64
60
  });
65
- const C = () => {
66
- !b && (H || !k) && p(!0);
67
- }, B = (t) => {
68
- isNaN(t.getTime()) || (P(t), s == null || s({
69
- value: D.Date(t, "yyyy-mm-dd"),
70
- name: c
71
- })), h === "years" && (d === "years" ? (p(!1), n(d)) : n("months")), h === "months" && (d === "months" ? (p(!1), n(d)) : n("days")), P(t), s == null || s({
72
- value: D.Date(t, "yyyy-mm-dd"),
73
- name: c
74
- }), r == null || r(D.Date(t, "yyyy-mm-dd"));
75
- }, V = (t) => {
76
- if (k) {
77
- const o = t.target.value.replace(/[^\d]/g, "");
78
- if (o.length === 0)
79
- M(""), s == null || s({ value: "", name: c }), r == null || r("");
61
+ const et = () => {
62
+ !v && (L || !x) && D(!0);
63
+ }, J = (t) => {
64
+ const r = t.getTime();
65
+ if (t.setHours(0, 0, 0, 0), N && (typeof N == "string" ? new Date(N) : N).getTime() > r)
66
+ return !1;
67
+ if (W) {
68
+ const i = /* @__PURE__ */ new Date();
69
+ if (i.setHours(0, 0, 0, 0), t.getTime() > i.getTime()) return !1;
70
+ }
71
+ if (q) {
72
+ const i = /* @__PURE__ */ new Date();
73
+ if (i.setHours(0, 0, 0, 0), r < i.getTime()) return !1;
74
+ }
75
+ if (_ && _(t)) return !1;
76
+ if (c) {
77
+ let i;
78
+ typeof c[0] == "string" ? i = [
79
+ new Date(c[0]),
80
+ typeof c[1] == "string" ? new Date(c[1]) : c[1]
81
+ ] : i = [
82
+ c[0],
83
+ typeof c[1] == "string" ? new Date(c[1]) : c[1]
84
+ ];
85
+ const [f, e] = i, P = new Date(f), A = new Date(e);
86
+ if (P.setHours(0, 0, 0, 0), A.setHours(23, 59, 59, 999), t < P || t > A) return !1;
87
+ }
88
+ return !0;
89
+ }, st = (t) => {
90
+ isNaN(t.getTime()) || (M(t), k(void 0), s == null || s({
91
+ value: w.Date(t, "yyyy-mm-dd"),
92
+ name: y
93
+ })), F === "years" && (a === "years" ? (D(!1), m(a)) : m("months")), F === "months" && (a === "months" ? (D(!1), m(a)) : m("days")), M(t), s == null || s({
94
+ value: w.Date(t, "yyyy-mm-dd"),
95
+ name: y
96
+ }), o == null || o(w.Date(t, "yyyy-mm-dd"));
97
+ }, it = (t) => {
98
+ const r = p || /* @__PURE__ */ new Date(), i = r.getDate(), f = r.getMonth() + 1, e = new Date(t, f - 1, i);
99
+ if (e.getFullYear() === t && e.getMonth() === f - 1 && e.getDate() === i && J(e)) {
100
+ if (M(e), k(void 0), s == null || s({
101
+ value: w.Date(e, "yyyy-mm-dd"),
102
+ name: y
103
+ }), o == null || o(w.Date(e, "yyyy-mm-dd")), a === "years") {
104
+ D(!1), m(a);
105
+ return;
106
+ }
107
+ } else
108
+ k(new Date(t, f - 1, 1));
109
+ a === "years" ? (D(!1), m(a)) : m("months");
110
+ }, rt = (t, r) => {
111
+ const f = (p || /* @__PURE__ */ new Date()).getDate(), e = new Date(t, r - 1, f);
112
+ if (e.getFullYear() === t && e.getMonth() === r - 1 && e.getDate() === f && J(e)) {
113
+ if (M(e), k(void 0), s == null || s({
114
+ value: w.Date(e, "yyyy-mm-dd"),
115
+ name: y
116
+ }), o == null || o(w.Date(e, "yyyy-mm-dd")), a === "months") {
117
+ D(!1), m(a);
118
+ return;
119
+ }
120
+ } else
121
+ k(new Date(t, r - 1, 1));
122
+ a === "months" ? (D(!1), m(a)) : m("days");
123
+ }, ct = (t) => {
124
+ if (x) {
125
+ const r = t.target.value.replace(/[^\d]/g, "");
126
+ if (r.length === 0)
127
+ H(""), s == null || s({ value: "", name: y }), o == null || o("");
80
128
  else {
81
- const [l, x, w] = [
82
- F(o.substring(0, 2), at),
83
- F(o.substring(2, 4), mt),
84
- o.substring(4, 8)
85
- ], X = [l, x, w].filter(Boolean).join("/");
86
- if (M(X), q) {
87
- const O = w ? `${w}-${x || "00"}-${l || "00"}` : [l, x, w].filter(Boolean).join("-");
129
+ const [i, f, e] = [
130
+ Z(r.substring(0, 2), yt),
131
+ Z(r.substring(2, 4), wt),
132
+ r.substring(4, 8)
133
+ ], P = [i, f, e].filter(Boolean).join("/");
134
+ if (H(P), R) {
135
+ const A = e ? `${e}-${f || "00"}-${i || "00"}` : [i, f, e].filter(Boolean).join("-");
88
136
  s == null || s({
89
- value: O,
90
- name: c
137
+ value: A,
138
+ name: y
91
139
  });
92
140
  }
93
- if (X.length === ft) {
94
- const O = parseInt(w), S = /* @__PURE__ */ new Date(
95
- `${O}-${x.padStart(2, "0")}-${l.padStart(2, "0")}`
141
+ if (P.length === lt) {
142
+ const A = parseInt(e), Y = /* @__PURE__ */ new Date(
143
+ `${A}-${f.padStart(2, "0")}-${i.padStart(2, "0")}`
96
144
  );
97
- isNaN(S.getTime()) || (P(S), s == null || s({
98
- value: D.Date(S, "yyyy-mm-dd"),
99
- name: c
100
- }), r == null || r(D.Date(S, "yyyy-mm-dd")));
145
+ isNaN(Y.getTime()) || (M(Y), s == null || s({
146
+ value: w.Date(Y, "yyyy-mm-dd"),
147
+ name: y
148
+ }), o == null || o(w.Date(Y, "yyyy-mm-dd")));
101
149
  }
102
150
  }
103
151
  }
104
- }, tt = Y(e.wrapper, I && e.active), st = Y(e.input, e.inputBorderControl);
105
- let U;
106
- if (f) {
107
- let t, o;
108
- typeof f[0] == "string" ? t = new Date(f[0]) : t = f[0], typeof f[1] == "string" ? o = new Date(f[1]) : o = f[1], U = [t, o];
152
+ }, ot = X(n.wrapper, h && n.active), at = X(n.input, n.inputBorderControl);
153
+ let K;
154
+ if (c) {
155
+ let t, r;
156
+ typeof c[0] == "string" ? t = new Date(c[0]) : t = c[0], typeof c[1] == "string" ? r = new Date(c[1]) : r = c[1], K = [t, r];
109
157
  }
110
- const et = {
111
- onChangeValue: B,
112
- date: a || /* @__PURE__ */ new Date(),
113
- before: typeof _ == "string" ? new Date(_) : _,
114
- onChangeType: n,
115
- setIsActive: p,
116
- disableFuture: J,
117
- disablePast: Q,
118
- disabledDate: Z,
119
- validRange: U
120
- }, it = wt[h], rt = ({ isActive: t }) => /* @__PURE__ */ m("button", { onClick: (l) => {
121
- l.stopPropagation(), b || p(!t);
122
- }, className: e["icon-button"], children: t ? /* @__PURE__ */ m(
123
- G,
158
+ const U = {
159
+ onChangeValue: st,
160
+ date: tt || p || /* @__PURE__ */ new Date(),
161
+ selectedDate: p,
162
+ before: typeof N == "string" ? new Date(N) : N,
163
+ onChangeType: m,
164
+ setIsActive: D,
165
+ disableFuture: W,
166
+ disablePast: q,
167
+ disabledDate: _,
168
+ validRange: K
169
+ }, ft = {
170
+ ...U,
171
+ onChangeMonth: rt
172
+ }, mt = {
173
+ ...U,
174
+ onChangeYear: it
175
+ }, nt = (() => {
176
+ switch (F) {
177
+ case "months":
178
+ return () => /* @__PURE__ */ d(Tt, { ...ft });
179
+ case "years":
180
+ return () => /* @__PURE__ */ d(Mt, { ...mt });
181
+ default:
182
+ return () => /* @__PURE__ */ d(Nt, { ...U });
183
+ }
184
+ })(), Dt = ({ isActive: t }) => /* @__PURE__ */ d("button", { onClick: (i) => {
185
+ i.stopPropagation(), v || D(!t);
186
+ }, className: n["icon-button"], children: t ? /* @__PURE__ */ d(
187
+ z,
124
188
  {
125
- iconName: $ === K.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
189
+ iconName: g === b.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
126
190
  }
127
- ) : /* @__PURE__ */ m(
128
- G,
191
+ ) : /* @__PURE__ */ d(
192
+ z,
129
193
  {
130
- iconName: $ === K.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
194
+ iconName: g === b.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
131
195
  }
132
196
  ) });
133
- return /* @__PURE__ */ E("div", { className: e["input-field-group-datePicker"], children: [
134
- /* @__PURE__ */ E("div", { className: tt, "data-disabled": b, children: [
135
- /* @__PURE__ */ m(
197
+ return /* @__PURE__ */ Q("div", { className: n["input-field-group-datePicker"], children: [
198
+ /* @__PURE__ */ Q("div", { className: ot, "data-disabled": v, children: [
199
+ /* @__PURE__ */ d(
136
200
  "div",
137
201
  {
138
202
  role: "button",
139
- "data-status": A.status,
140
- className: Y(e["date-wrapper"], {
141
- [e.editable]: k
203
+ "data-status": u.status,
204
+ className: X(n["date-wrapper"], {
205
+ [n.editable]: x
142
206
  }),
143
- onClick: C,
144
- children: /* @__PURE__ */ m(
145
- lt,
207
+ onClick: et,
208
+ children: /* @__PURE__ */ d(
209
+ At,
146
210
  {
147
- ref: z,
148
- className: st,
149
- wrapperClassName: e["input-wrapper"],
150
- size: $,
211
+ ref: B,
212
+ className: at,
213
+ wrapperClassName: n["input-wrapper"],
214
+ size: g,
151
215
  type: "text",
152
- variant: W,
153
- value: R,
154
- onChange: V,
216
+ variant: C,
217
+ value: V,
218
+ onChange: ct,
155
219
  rightAddon: {
156
220
  addonType: "react-node",
157
- addonContent: /* @__PURE__ */ m(rt, { isActive: I })
221
+ addonContent: /* @__PURE__ */ d(Dt, { isActive: h })
158
222
  },
159
- rightSlotClassName: e["right-slot"],
223
+ rightSlotClassName: n["right-slot"],
160
224
  onFocus: () => {
161
- H && !k && p(!0);
225
+ L && !x && D(!0);
162
226
  },
163
- ...A
227
+ ...u
164
228
  }
165
229
  )
166
230
  }
167
231
  ),
168
- I && /* @__PURE__ */ m(it, { ...et })
232
+ h && /* @__PURE__ */ d(nt, {})
169
233
  ] }),
170
- T && typeof T == "string" && /* @__PURE__ */ m("div", { className: e.textError, children: T })
234
+ S && typeof S == "string" && /* @__PURE__ */ d("div", { className: n.textError, children: S })
171
235
  ] });
172
236
  }
173
237
  )
174
238
  );
175
- Nt.displayName = "DatePicker";
239
+ Pt.displayName = "DatePicker";
176
240
  export {
177
- Nt as DatePicker
241
+ Pt as DatePicker
178
242
  };
@@ -1,5 +1,6 @@
1
1
  type TProps = {
2
2
  date: Date;
3
+ selectedDate?: Date;
3
4
  before?: Date;
4
5
  onChangeValue: (date: Date) => void;
5
6
  setIsActive: (isActive: boolean) => void;
@@ -9,5 +10,5 @@ type TProps = {
9
10
  disabledDate?: (date: Date) => boolean;
10
11
  validRange?: [Date, Date];
11
12
  };
12
- export declare const DatePickerModal: ({ date, onChangeValue, setIsActive, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const DatePickerModal: ({ date, selectedDate, onChangeValue, setIsActive, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -1,169 +1,170 @@
1
- import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { c as k } from "../../index-DIxK0V-G.js";
3
- import { useState as z } from "react";
4
- import { week as G, COUNT_WORK_DAYS as U } from "./constants.js";
5
- import { useDatePickerPosition as V } from "./hooks.js";
1
+ import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
+ import { c as P } from "../../index-DIxK0V-G.js";
3
+ import { useState as G } from "react";
4
+ import { week as U, COUNT_WORK_DAYS as V } from "./constants.js";
5
+ import { useDatePickerPosition as W } from "./hooks.js";
6
6
  import { c as n } from "../../styles.module-Cuqm31CO.js";
7
- import { getUpdateDate as P } from "./utils.js";
8
- import { Icon as W } from "../../icons/Icon.js";
7
+ import { getUpdateDate as A } from "./utils.js";
8
+ import { Icon as E } from "../../icons/Icon.js";
9
9
  import { formating as m } from "../../utils/index.js";
10
- import { Button as A } from "../Button/Button.js";
11
- import { parseDate as B } from "../../utils/formating/Date.js";
12
- const st = ({
10
+ import { Button as B } from "../Button/Button.js";
11
+ import { parseDate as H } from "../../utils/formating/Date.js";
12
+ const at = ({
13
13
  date: i,
14
- onChangeValue: H,
15
- setIsActive: I,
16
- before: g,
17
- onChangeType: u,
18
- disableFuture: O = !1,
19
- disablePast: S = !1,
20
- disabledDate: p,
21
- validRange: h
14
+ selectedDate: d,
15
+ onChangeValue: I,
16
+ setIsActive: O,
17
+ before: p,
18
+ onChangeType: D,
19
+ disableFuture: S = !1,
20
+ disablePast: T = !1,
21
+ disabledDate: h,
22
+ validRange: N
22
23
  }) => {
23
- var M;
24
+ var $;
24
25
  i = isNaN(new Date(i).getTime()) ? /* @__PURE__ */ new Date() : i;
25
- const D = B(i), d = B(i), f = {
26
- y: D.getFullYear(),
27
- d: D.getDate(),
28
- m: D.getMonth() + 1
29
- }, N = {
30
- y: d.getFullYear(),
31
- d: d.getDate(),
32
- m: d.getMonth() + 1
33
- }, [r, w] = z({ y: N.y, m: N.m }), T = V([r]), _ = (t) => {
26
+ const l = H(i), f = d ? H(d) : l, y = {
27
+ y: f.getFullYear(),
28
+ d: f.getDate(),
29
+ m: f.getMonth() + 1
30
+ }, w = {
31
+ y: l.getFullYear(),
32
+ d: l.getDate(),
33
+ m: l.getMonth() + 1
34
+ }, [r, b] = G({ y: w.y, m: w.m }), _ = W([r]), j = (t) => {
34
35
  let e = t.getDay();
35
36
  return e === 0 && (e = 7), e - 1;
36
- }, b = r.m - 1, c = new Date(r.y, b), y = [], v = (() => {
37
+ }, v = r.m - 1, c = new Date(r.y, v), g = [], x = (() => {
37
38
  const t = new Date(c);
38
39
  t.setDate(t.getDate() - 1);
39
40
  const e = t.getDate(), o = [];
40
- for (let s = 0; s < _(c); s++)
41
+ for (let s = 0; s < j(c); s++)
41
42
  o.push(e - s);
42
43
  return o.reverse(), o;
43
44
  })();
44
- for (; c.getMonth() === b; )
45
- y.push(c.getDate()), c.setDate(c.getDate() + 1);
46
- const j = (() => {
47
- const e = 42 - (v.length + y.length), o = [];
45
+ for (; c.getMonth() === v; )
46
+ g.push(c.getDate()), c.setDate(c.getDate() + 1);
47
+ const C = (() => {
48
+ const e = 42 - (x.length + g.length), o = [];
48
49
  for (let s = 1; s <= e; s++)
49
50
  o.push(s);
50
51
  return o;
51
- })(), C = () => {
52
- I(!1);
53
- }, F = () => {
54
- w(P(r.m + 1, r.y));
52
+ })(), F = () => {
53
+ O(!1);
55
54
  }, L = () => {
56
- w(P(r.m - 1, r.y));
57
- }, x = (t) => {
55
+ b(A(r.m + 1, r.y));
56
+ }, Y = () => {
57
+ b(A(r.m - 1, r.y));
58
+ }, M = (t) => {
58
59
  const e = new Date(t);
59
- if (e.setHours(0, 0, 0, 0), g && g.getTime() > t)
60
+ if (e.setHours(0, 0, 0, 0), p && p.getTime() > t)
60
61
  return !0;
61
- if (O) {
62
+ if (S) {
62
63
  const o = /* @__PURE__ */ new Date();
63
64
  if (o.setHours(0, 0, 0, 0), e.getTime() > o.getTime()) return !0;
64
65
  }
65
- if (S) {
66
+ if (T) {
66
67
  const o = /* @__PURE__ */ new Date();
67
68
  if (o.setHours(0, 0, 0, 0), t < o.getTime()) return !0;
68
69
  }
69
- if (p && p(e)) return !0;
70
- if (h) {
71
- const [o, s] = h, $ = new Date(t);
72
- if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), $ < o || $ > s) return !0;
70
+ if (h && h(e)) return !0;
71
+ if (N) {
72
+ const [o, s] = N, k = new Date(t);
73
+ if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), k < o || k > s) return !0;
73
74
  }
74
75
  return !1;
75
- }, Y = (t) => {
76
- x(
76
+ }, z = (t) => {
77
+ M(
77
78
  (/* @__PURE__ */ new Date(
78
79
  `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
79
80
  )).getTime()
80
- ) || (H(
81
+ ) || (I(
81
82
  /* @__PURE__ */ new Date(
82
83
  `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
83
84
  )
84
- ), C());
85
+ ), F());
85
86
  };
86
- return /* @__PURE__ */ l(
87
+ return /* @__PURE__ */ u(
87
88
  "div",
88
89
  {
89
90
  className: n["calendar-block"],
90
- ref: T,
91
+ ref: _,
91
92
  "data-testid": "calendar-modal",
92
93
  children: [
93
- /* @__PURE__ */ l("div", { className: n.h, children: [
94
+ /* @__PURE__ */ u("div", { className: n.h, children: [
94
95
  /* @__PURE__ */ a(
95
- A,
96
+ B,
96
97
  {
97
98
  isIconButton: !0,
98
99
  iconName: "DropdownArrowLeft16px",
99
- onClick: L,
100
+ onClick: Y,
100
101
  variant: "secondary-gray",
101
102
  size: "l"
102
103
  }
103
104
  ),
104
- /* @__PURE__ */ l(
105
+ /* @__PURE__ */ u(
105
106
  "button",
106
107
  {
107
108
  type: "button",
108
109
  className: n.d,
109
- onClick: () => u == null ? void 0 : u("months"),
110
+ onClick: () => D == null ? void 0 : D("months"),
110
111
  "data-testid": "month-year-button",
111
112
  children: [
112
- (M = m.Month(r.m)) == null ? void 0 : M.name,
113
+ ($ = m.Month(r.m)) == null ? void 0 : $.name,
113
114
  "’",
114
115
  r.y.toString().slice(-2),
115
- /* @__PURE__ */ a(W, { iconName: "DropdownArrowBottom16px" })
116
+ /* @__PURE__ */ a(E, { iconName: "DropdownArrowBottom16px" })
116
117
  ]
117
118
  }
118
119
  ),
119
120
  /* @__PURE__ */ a(
120
- A,
121
+ B,
121
122
  {
122
123
  isIconButton: !0,
123
124
  iconName: "DropdownArrowRight16px",
124
- onClick: F,
125
+ onClick: L,
125
126
  variant: "secondary-gray",
126
127
  size: "l"
127
128
  }
128
129
  )
129
130
  ] }),
130
- /* @__PURE__ */ l("div", { className: n.b, children: [
131
- G.map((t, e) => /* @__PURE__ */ a(
131
+ /* @__PURE__ */ u("div", { className: n.b, children: [
132
+ U.map((t, e) => /* @__PURE__ */ a(
132
133
  "div",
133
134
  {
134
- className: k(n.m, {
135
- [n.orange]: e > U
135
+ className: P(n.m, {
136
+ [n.orange]: e > V
136
137
  }),
137
138
  children: t
138
139
  },
139
140
  `v${e}`
140
141
  )),
141
- v.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e)),
142
- y.map((t, e) => /* @__PURE__ */ a(
142
+ x.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e)),
143
+ g.map((t, e) => /* @__PURE__ */ a(
143
144
  "button",
144
145
  {
145
146
  type: "button",
146
- onClick: () => Y(t),
147
- className: k(
148
- x(
147
+ onClick: () => z(t),
148
+ className: P(
149
+ M(
149
150
  (/* @__PURE__ */ new Date(
150
151
  `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
151
152
  )).getTime()
152
153
  ) ? n.m : n.a,
153
154
  {
154
- [n.current]: f.y === r.y && f.m === r.m && f.d === t
155
+ [n.current]: d && y.y === r.y && y.m === r.m && y.d === t
155
156
  }
156
157
  ),
157
158
  children: t !== 0 && t
158
159
  },
159
160
  e
160
161
  )),
161
- j.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e))
162
+ C.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e))
162
163
  ] })
163
164
  ]
164
165
  }
165
166
  );
166
167
  };
167
168
  export {
168
- st as DatePickerModal
169
+ at as DatePickerModal
169
170
  };
@@ -1,12 +1,14 @@
1
1
  type TProps = {
2
2
  date: Date;
3
+ selectedDate?: Date;
3
4
  before?: Date;
4
5
  onChangeValue: (date: Date) => void;
5
6
  onChangeType?: (type: 'years') => void;
7
+ onChangeMonth?: (year: number, month: number) => void;
6
8
  disableFuture?: boolean;
7
9
  disablePast?: boolean;
8
10
  disabledDate?: (date: Date) => boolean;
9
11
  validRange?: [Date, Date];
10
12
  };
11
- export declare const MonthPickerModal: ({ date, onChangeValue, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const MonthPickerModal: ({ date, selectedDate, onChangeValue, before, onChangeType, onChangeMonth, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
12
14
  export {};
@@ -1,126 +1,128 @@
1
- import { jsxs as p, jsx as f } from "react/jsx-runtime";
2
- import { c as j } from "../../index-DIxK0V-G.js";
3
- import { useState as z } from "react";
1
+ import { jsxs as w, jsx as f } from "react/jsx-runtime";
2
+ import { c as R } from "../../index-DIxK0V-G.js";
3
+ import { useState as _ } from "react";
4
4
  import { months as C } from "./constants.js";
5
- import { useDatePickerPosition as R } from "./hooks.js";
5
+ import { useDatePickerPosition as L } from "./hooks.js";
6
6
  import { c } from "../../styles.module-Cuqm31CO.js";
7
- import { Icon as _ } from "../../icons/Icon.js";
8
- import { formating as B } from "../../utils/index.js";
9
- import { Button as F } from "../Button/Button.js";
10
- const W = ({
11
- date: w,
12
- onChangeValue: H,
13
- before: d,
14
- onChangeType: D,
15
- disableFuture: N = !1,
16
- disablePast: P = !1,
7
+ import { Icon as b } from "../../icons/Icon.js";
8
+ import { formating as F } from "../../utils/index.js";
9
+ import { Button as H } from "../Button/Button.js";
10
+ const Z = ({
11
+ date: P,
12
+ selectedDate: D,
13
+ onChangeValue: A,
14
+ before: m,
15
+ onChangeType: y,
16
+ onChangeMonth: g,
17
+ disableFuture: G = !1,
18
+ disablePast: I = !1,
17
19
  disabledDate: u,
18
- validRange: g
20
+ validRange: M
19
21
  }) => {
20
- const A = R(), m = new Date(w), y = new Date(w), h = {
21
- y: m.getFullYear(),
22
- d: m.getDate(),
23
- m: m.getMonth() + 1
24
- }, M = {
25
- y: y.getFullYear(),
26
- d: y.getDate(),
27
- m: y.getMonth() + 1
28
- }, [t, k] = z(M.y), G = () => {
29
- k(t + 1);
30
- }, I = () => {
31
- k(t - 1);
32
- }, x = (n) => {
33
- const i = /* @__PURE__ */ new Date(), r = i.getFullYear(), l = i.getMonth() + 1;
34
- if (g) {
35
- const [o, s] = g, e = new Date(t, n - 1, 1), a = new Date(t, n, 0);
36
- e.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999);
37
- const Y = new Date(o), v = new Date(s);
38
- Y.setHours(0, 0, 0, 0), v.setHours(23, 59, 59, 999);
39
- const S = a < Y, $ = e > v;
40
- if (S || $)
22
+ const N = L(), d = new Date(P), p = D ? new Date(D) : d, h = {
23
+ y: p.getFullYear(),
24
+ d: p.getDate(),
25
+ m: p.getMonth() + 1
26
+ }, k = {
27
+ y: d.getFullYear(),
28
+ d: d.getDate(),
29
+ m: d.getMonth() + 1
30
+ }, [t, x] = _(k.y), O = () => {
31
+ x(t + 1);
32
+ }, S = () => {
33
+ x(t - 1);
34
+ }, Y = (e) => {
35
+ const i = /* @__PURE__ */ new Date(), n = i.getFullYear(), l = i.getMonth() + 1;
36
+ if (M) {
37
+ const [r, a] = M, o = new Date(t, e - 1, 1), s = new Date(t, e, 0);
38
+ o.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999);
39
+ const v = new Date(r), B = new Date(a);
40
+ v.setHours(0, 0, 0, 0), B.setHours(23, 59, 59, 999);
41
+ const j = s < v, z = o > B;
42
+ if (j || z)
41
43
  return !0;
42
44
  }
43
- if (d) {
44
- const o = d.getFullYear(), s = d.getMonth() + 1;
45
- if (o > t || o === t && s > n)
45
+ if (m) {
46
+ const r = m.getFullYear(), a = m.getMonth() + 1;
47
+ if (r > t || r === t && a > e)
46
48
  return !0;
47
49
  }
48
- if (N && (t > r || t === r && n > l) || P && (t < r || t === r && n < l))
50
+ if (G && (t > n || t === n && e > l) || I && (t < n || t === n && e < l))
49
51
  return !0;
50
52
  if (u) {
51
- const o = new Date(t, n, 0).getDate(), s = [1, Math.ceil(o / 2), o];
52
- for (const e of s) {
53
- const a = new Date(t, n - 1, e);
54
- if (!u(a)) return !1;
53
+ const r = new Date(t, e, 0).getDate(), a = [1, Math.ceil(r / 2), r];
54
+ for (const o of a) {
55
+ const s = new Date(t, e - 1, o);
56
+ if (!u(s)) return !1;
55
57
  }
56
- for (let e = 2; e < o; e += 3) {
57
- if (s.includes(e)) continue;
58
- const a = new Date(t, n - 1, e);
59
- if (!u(a)) return !1;
58
+ for (let o = 2; o < r; o += 3) {
59
+ if (a.includes(o)) continue;
60
+ const s = new Date(t, e - 1, o);
61
+ if (!u(s)) return !1;
60
62
  }
61
- for (let e = 1; e <= o; e++) {
62
- if (s.includes(e) || (e - 2) % 3 === 0) continue;
63
- const a = new Date(t, n - 1, e);
64
- if (!u(a)) return !1;
63
+ for (let o = 1; o <= r; o++) {
64
+ if (a.includes(o) || (o - 2) % 3 === 0) continue;
65
+ const s = new Date(t, e - 1, o);
66
+ if (!u(s)) return !1;
65
67
  }
66
68
  return !0;
67
69
  }
68
70
  return !1;
69
- }, O = (n) => {
70
- x(n) || H(
71
+ }, $ = (e) => {
72
+ Y(e) || (g ? g(t, e) : A(
71
73
  /* @__PURE__ */ new Date(
72
- `${t}-${B.Number(2, n)}-${B.Number(2, M.d)}`
74
+ `${t}-${F.Number(2, e)}-${F.Number(2, k.d)}`
73
75
  )
74
- );
76
+ ));
75
77
  };
76
- return /* @__PURE__ */ p("div", { className: c["calendar-block"], ref: A, children: [
77
- /* @__PURE__ */ p("div", { className: c.h, children: [
78
+ return /* @__PURE__ */ w("div", { className: c["calendar-block"], ref: N, children: [
79
+ /* @__PURE__ */ w("div", { className: c.h, children: [
78
80
  /* @__PURE__ */ f(
79
- F,
81
+ H,
80
82
  {
81
83
  isIconButton: !0,
82
84
  iconName: "DropdownArrowLeft16px",
83
- onClick: I,
85
+ onClick: S,
84
86
  variant: "secondary-gray",
85
87
  size: "l"
86
88
  }
87
89
  ),
88
- /* @__PURE__ */ p(
90
+ /* @__PURE__ */ w(
89
91
  "button",
90
92
  {
91
93
  type: "button",
92
- onClick: () => D == null ? void 0 : D("years"),
94
+ onClick: () => y == null ? void 0 : y("years"),
93
95
  className: c.d,
94
96
  "data-testid": "year-button",
95
97
  children: [
96
98
  t.toString(),
97
- /* @__PURE__ */ f(_, { iconName: "DropdownArrowBottom16px" })
99
+ /* @__PURE__ */ f(b, { iconName: "DropdownArrowBottom16px" })
98
100
  ]
99
101
  }
100
102
  ),
101
103
  /* @__PURE__ */ f(
102
- F,
104
+ H,
103
105
  {
104
106
  isIconButton: !0,
105
107
  iconName: "DropdownArrowRight16px",
106
- onClick: G,
108
+ onClick: O,
107
109
  variant: "secondary-gray",
108
110
  size: "l"
109
111
  }
110
112
  )
111
113
  ] }),
112
- /* @__PURE__ */ f("div", { className: c.monthGrid, "data-testid": "month-picker", children: C.map((n, i) => {
113
- const r = i + 1, l = x(r);
114
+ /* @__PURE__ */ f("div", { className: c.monthGrid, "data-testid": "month-picker", children: C.map((e, i) => {
115
+ const n = i + 1, l = Y(n);
114
116
  return /* @__PURE__ */ f(
115
117
  "button",
116
118
  {
117
119
  type: "button",
118
- onClick: () => O(r),
120
+ onClick: () => $(n),
119
121
  disabled: l,
120
- className: j(l ? c.m : c.a, {
121
- [c.current]: h.y === t && h.m === r
122
+ className: R(l ? c.m : c.a, {
123
+ [c.current]: D && h.y === t && h.m === n
122
124
  }),
123
- children: n
125
+ children: e
124
126
  },
125
127
  i
126
128
  );
@@ -128,5 +130,5 @@ const W = ({
128
130
  ] });
129
131
  };
130
132
  export {
131
- W as MonthPickerModal
133
+ Z as MonthPickerModal
132
134
  };
@@ -1,12 +1,14 @@
1
1
  type TProps = {
2
2
  date: Date;
3
+ selectedDate?: Date;
3
4
  before?: Date;
4
5
  onChangeValue: (date: Date) => void;
5
6
  onChangeType?: (type: 'years') => void;
7
+ onChangeYear?: (year: number) => void;
6
8
  disableFuture?: boolean;
7
9
  disablePast?: boolean;
8
10
  disabledDate?: (date: Date) => boolean;
9
11
  validRange?: [Date, Date];
10
12
  };
11
- export declare const YearPickerModal: ({ date, onChangeValue, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const YearPickerModal: ({ date, selectedDate, onChangeValue, before, onChangeType, onChangeYear, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
12
14
  export {};
@@ -1,62 +1,72 @@
1
- import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
- import { c as O } from "../../index-DIxK0V-G.js";
3
- import { useState as $ } from "react";
4
- import { useDatePickerPosition as j } from "./hooks.js";
5
- import { c as e } from "../../styles.module-Cuqm31CO.js";
6
- import { formating as y } from "../../utils/index.js";
7
- import { Button as A } from "../Button/Button.js";
8
- const D = 15, z = 7, W = ({
9
- date: w,
10
- onChangeValue: F,
11
- before: p,
12
- onChangeType: i,
13
- disableFuture: P = !1,
14
- disablePast: v = !1,
15
- disabledDate: r,
16
- validRange: Y
1
+ import { jsxs as b, jsx as c } from "react/jsx-runtime";
2
+ import { c as $ } from "../../index-DIxK0V-G.js";
3
+ import { useState as j } from "react";
4
+ import { useDatePickerPosition as z } from "./hooks.js";
5
+ import { c as n } from "../../styles.module-Cuqm31CO.js";
6
+ import { formating as F } from "../../utils/index.js";
7
+ import { Button as P } from "../Button/Button.js";
8
+ const p = 15, I = 7, W = ({
9
+ date: v,
10
+ selectedDate: u,
11
+ onChangeValue: E,
12
+ before: Y,
13
+ onChangeType: d,
14
+ onChangeYear: N,
15
+ disableFuture: S = !1,
16
+ disablePast: _ = !1,
17
+ disabledDate: o,
18
+ validRange: k
17
19
  }) => {
18
- const E = j(), m = new Date(w), f = new Date(w), R = {
19
- y: m.getFullYear(),
20
- d: m.getDate(),
21
- m: m.getMonth() + 1
22
- }, u = {
23
- y: f.getFullYear(),
24
- d: f.getDate(),
25
- m: f.getMonth() + 1
26
- }, [l, N] = $(u.y), S = l - z, _ = Array.from(Array(D).keys()).map(
27
- (t) => t + S
28
- ), G = () => {
29
- N(l + D);
20
+ const y = z(), i = new Date(v), l = u ? new Date(u) : i, G = {
21
+ y: l.getFullYear(),
22
+ d: l.getDate(),
23
+ m: l.getMonth() + 1
24
+ }, e = {
25
+ y: i.getFullYear(),
26
+ d: i.getDate(),
27
+ m: i.getMonth() + 1
28
+ }, [D, h] = j(e.y), M = D - I, Q = Array.from(Array(p).keys()).map(
29
+ (t) => t + M
30
+ ), B = () => {
31
+ h(D + p);
30
32
  }, H = () => {
31
- N(l - D);
33
+ h(D - p);
32
34
  }, g = (t) => {
33
- const n = (/* @__PURE__ */ new Date()).getFullYear();
34
- if (Y) {
35
- const [s, d] = Y, c = new Date(t, 0, 1), a = new Date(t, 11, 31);
36
- c.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999);
37
- const b = new Date(s), h = new Date(d);
38
- b.setHours(0, 0, 0, 0), h.setHours(23, 59, 59, 999);
39
- const B = a < b, M = c > h;
40
- if (B || M) return !0;
35
+ const s = (/* @__PURE__ */ new Date()).getFullYear();
36
+ if (k) {
37
+ const [a, w] = k;
38
+ let r;
39
+ if (e.m && e.d)
40
+ r = new Date(t, e.m - 1, e.d);
41
+ else {
42
+ const A = /* @__PURE__ */ new Date();
43
+ r = new Date(t, A.getMonth(), A.getDate());
44
+ }
45
+ r.setHours(0, 0, 0, 0);
46
+ const m = new Date(a), f = new Date(w);
47
+ if (m.setHours(0, 0, 0, 0), f.setHours(23, 59, 59, 999), r < m || r > f)
48
+ return !0;
41
49
  }
42
- if (p && p.getFullYear() > t || P && t > n || v && t < n)
50
+ if (Y && Y.getFullYear() > t || S && t > s || _ && t < s)
43
51
  return !0;
44
- if (r) {
45
- const s = new Date(t, 2, 15), d = new Date(t, 5, 15), c = new Date(t, 8, 15), a = new Date(t, 11, 15);
46
- return r(s) && r(d) && r(c) && r(a);
52
+ if (o) {
53
+ const a = new Date(t, e.m - 1, e.d);
54
+ if (!o(a)) return !1;
55
+ const w = new Date(t, 2, 15), r = new Date(t, 5, 15), m = new Date(t, 8, 15), f = new Date(t, 11, 15);
56
+ return o(w) && o(r) && o(m) && o(f);
47
57
  }
48
58
  return !1;
49
- }, Q = (t) => {
50
- g(t) || F(
59
+ }, R = (t) => {
60
+ g(t) || (N ? N(t) : E(
51
61
  /* @__PURE__ */ new Date(
52
- `${t}-${y.Number(2, u.m)}-${y.Number(2, u.d)}`
62
+ `${t}-${F.Number(2, e.m)}-${F.Number(2, e.d)}`
53
63
  )
54
- );
64
+ ));
55
65
  };
56
- return /* @__PURE__ */ x("div", { className: e["calendar-block"], ref: E, children: [
57
- /* @__PURE__ */ x("div", { className: e.h, children: [
58
- /* @__PURE__ */ o(
59
- A,
66
+ return /* @__PURE__ */ b("div", { className: n["calendar-block"], ref: y, children: [
67
+ /* @__PURE__ */ b("div", { className: n.h, children: [
68
+ /* @__PURE__ */ c(
69
+ P,
60
70
  {
61
71
  isIconButton: !0,
62
72
  iconName: "DropdownArrowLeft16px",
@@ -65,39 +75,39 @@ const D = 15, z = 7, W = ({
65
75
  size: "l"
66
76
  }
67
77
  ),
68
- /* @__PURE__ */ o(
78
+ /* @__PURE__ */ c(
69
79
  "button",
70
80
  {
71
81
  type: "button",
72
- onClick: () => i == null ? void 0 : i("years"),
73
- className: e.d
82
+ onClick: () => d == null ? void 0 : d("years"),
83
+ className: n.d
74
84
  }
75
85
  ),
76
- /* @__PURE__ */ o(
77
- A,
86
+ /* @__PURE__ */ c(
87
+ P,
78
88
  {
79
89
  isIconButton: !0,
80
90
  iconName: "DropdownArrowRight16px",
81
- onClick: G,
91
+ onClick: B,
82
92
  variant: "secondary-gray",
83
93
  size: "l"
84
94
  }
85
95
  )
86
96
  ] }),
87
- /* @__PURE__ */ o("div", { className: e.monthGrid, "data-testid": "year-picker", children: _.map((t, k) => {
88
- const n = g(t);
89
- return /* @__PURE__ */ o(
97
+ /* @__PURE__ */ c("div", { className: n.monthGrid, "data-testid": "year-picker", children: Q.map((t, x) => {
98
+ const s = g(t);
99
+ return /* @__PURE__ */ c(
90
100
  "button",
91
101
  {
92
102
  type: "button",
93
- onClick: () => Q(t),
94
- disabled: n,
95
- className: O(n ? e.m : e.a, {
96
- [e.current]: R.y === t
103
+ onClick: () => R(t),
104
+ disabled: s,
105
+ className: $(s ? n.m : n.a, {
106
+ [n.current]: u && G.y === t
97
107
  }),
98
108
  children: t
99
109
  },
100
- k
110
+ x
101
111
  );
102
112
  }) })
103
113
  ] });
@@ -1,4 +1,7 @@
1
1
  import { TInputProps } from '../Input';
2
2
 
3
- export type TProps = TInputProps;
4
- export declare const InputPassword: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<import('../Input/types').TInputProps & import('../Input').TAdditionalProps & import('react').RefAttributes<HTMLInputElement>>>;
3
+ export interface TProps extends TInputProps {
4
+ /** Показывать пароль при удержании кнопки */
5
+ showOnHold?: boolean;
6
+ }
7
+ export declare const InputPassword: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLInputElement>>>;
@@ -1,47 +1,58 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { c } from "../../index-DIxK0V-G.js";
3
- import { memo as w, forwardRef as u, useState as m } from "react";
4
- import { Icon as d } from "../../icons/Icon.js";
5
- import { Button as _ } from "../Button/Button.js";
6
- import { I as l } from "../../Input-BU_6U1CW.js";
7
- import '../../assets/InputPassword.css';const b = "_input_7b9x2_2", x = "_wrapper_7b9x2_6", h = "_button_7b9x2_17", f = "_icon_7b9x2_33", N = "_show_7b9x2_38", t = {
8
- input: b,
9
- wrapper: x,
1
+ import { jsxs as _, jsx as o } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-DIxK0V-G.js";
3
+ import { memo as d, forwardRef as b, useState as f, useCallback as r } from "react";
4
+ import { Icon as x } from "../../icons/Icon.js";
5
+ import { Button as N } from "../Button/Button.js";
6
+ import { I as h } from "../../Input-BU_6U1CW.js";
7
+ import '../../assets/InputPassword.css';const M = "_input_7b9x2_2", y = "_wrapper_7b9x2_6", I = "_button_7b9x2_17", v = "_icon_7b9x2_33", C = "_show_7b9x2_38", e = {
8
+ input: M,
9
+ wrapper: y,
10
10
  "input-wrapper": "_input-wrapper_7b9x2_13",
11
11
  "button-wrapper": "_button-wrapper_7b9x2_17",
12
- button: h,
13
- icon: f,
14
- show: N
15
- }, y = w(
16
- u(
17
- ({ size: r, ...p }, a) => {
18
- const [o, e] = m(!1), n = () => e(!o);
19
- return /* @__PURE__ */ i("div", { className: t.wrapper, "data-testid": "input-password-wrapper", children: [
20
- /* @__PURE__ */ s(
21
- l,
12
+ button: I,
13
+ icon: v,
14
+ show: C
15
+ }, P = d(
16
+ b(
17
+ ({ size: p, showOnHold: t = !1, ...n }, i) => {
18
+ const [s, a] = f(!1), c = r(() => {
19
+ t || a(!s);
20
+ }, [t, s]), u = r(() => {
21
+ t && a(!0);
22
+ }, [t]), m = r(() => {
23
+ t && a(!1);
24
+ }, [t]), w = r(() => {
25
+ t && a(!1);
26
+ }, [t]);
27
+ return /* @__PURE__ */ _("div", { className: e.wrapper, "data-testid": "input-password-wrapper", children: [
28
+ /* @__PURE__ */ o(
29
+ h,
22
30
  {
23
- ref: a,
24
- className: t.input,
25
- wrapperClassName: t["input-wrapper"],
26
- size: r,
27
- type: o ? "text" : "password",
31
+ ref: i,
32
+ className: e.input,
33
+ wrapperClassName: e["input-wrapper"],
34
+ size: p,
35
+ type: s ? "text" : "password",
28
36
  "data-testid": "password-input",
29
- ...p
37
+ ...n
30
38
  }
31
39
  ),
32
- /* @__PURE__ */ s("div", { className: t["button-wrapper"], children: /* @__PURE__ */ s(
33
- _,
40
+ /* @__PURE__ */ o("div", { className: e["button-wrapper"], children: /* @__PURE__ */ o(
41
+ N,
34
42
  {
35
43
  clear: !0,
36
44
  type: "button",
37
- className: t.button,
38
- onClick: n,
45
+ className: e.button,
46
+ onClick: c,
47
+ onMouseDown: u,
48
+ onMouseUp: m,
49
+ onMouseLeave: w,
39
50
  "data-testid": "eye-icon",
40
- children: /* @__PURE__ */ s(
41
- d,
51
+ children: /* @__PURE__ */ o(
52
+ x,
42
53
  {
43
- className: c(t.icon, {
44
- [t.show]: o
54
+ className: l(e.icon, {
55
+ [e.show]: s
45
56
  }),
46
57
  iconName: "Eye24px"
47
58
  }
@@ -52,7 +63,7 @@ import '../../assets/InputPassword.css';const b = "_input_7b9x2_2", x = "_wrappe
52
63
  }
53
64
  )
54
65
  );
55
- y.displayName = "InputPassword";
66
+ P.displayName = "InputPassword";
56
67
  export {
57
- y as InputPassword
68
+ P as InputPassword
58
69
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.43.4",
4
+ "version": "1.43.5",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {