mimir-ui-kit 1.43.9 → 1.43.11

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.
Files changed (162) hide show
  1. package/dist/Input-CGZoshMl.js +224 -0
  2. package/dist/assets/Accordion.css +1 -1
  3. package/dist/assets/AccordionItem.css +1 -1
  4. package/dist/assets/Avatar.css +1 -1
  5. package/dist/assets/Button.css +1 -1
  6. package/dist/assets/CarBodyButton.css +1 -0
  7. package/dist/assets/CheckboxMimir.css +1 -1
  8. package/dist/assets/Chip.css +1 -1
  9. package/dist/assets/Drawer.css +1 -1
  10. package/dist/assets/GosZnak.css +1 -1
  11. package/dist/assets/Input.css +1 -1
  12. package/dist/assets/InputPassword.css +1 -1
  13. package/dist/assets/InputRangeSlider.css +1 -1
  14. package/dist/assets/Link.css +1 -1
  15. package/dist/assets/ListFiles.css +1 -1
  16. package/dist/assets/ListPhotos.css +1 -1
  17. package/dist/assets/MessageShortReply.css +1 -1
  18. package/dist/assets/MiniButton.css +1 -0
  19. package/dist/assets/MultiSelectSearch.css +1 -1
  20. package/dist/assets/NotificationBadge.css +1 -1
  21. package/dist/assets/OtpInput.css +1 -1
  22. package/dist/assets/Pagination.css +1 -1
  23. package/dist/assets/RoundButton.css +1 -0
  24. package/dist/assets/ScrollWrapper.css +1 -0
  25. package/dist/assets/SelectSearch.css +1 -1
  26. package/dist/assets/hooks.css +1 -1
  27. package/dist/assets/index.css +1 -1
  28. package/dist/assets/styles.css +1 -1
  29. package/dist/components/Accordion/Accordion.d.ts +10 -3
  30. package/dist/components/Accordion/Accordion.js +286 -212
  31. package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
  32. package/dist/components/Accordion/constants.d.ts +0 -4
  33. package/dist/components/Accordion/constants.js +4 -5
  34. package/dist/components/AnchorLink/Link.js +21 -20
  35. package/dist/components/Avatar/Avatar.js +26 -26
  36. package/dist/components/Button/Button.js +110 -87
  37. package/dist/components/Button/constants.d.ts +8 -2
  38. package/dist/components/Button/constants.js +6 -5
  39. package/dist/components/CarBodyButton/CarBodyButton.d.ts +26 -0
  40. package/dist/components/CarBodyButton/CarBodyButton.js +40 -0
  41. package/dist/components/CarBodyButton/index.d.ts +1 -0
  42. package/dist/components/CarBodyButton/index.js +4 -0
  43. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
  44. package/dist/components/CheckboxMimir/CheckboxMimir.js +37 -35
  45. package/dist/components/Chip/Chip.js +17 -17
  46. package/dist/components/DatePicker/DatePicker.d.ts +8 -0
  47. package/dist/components/DatePicker/DatePicker.js +182 -169
  48. package/dist/components/DatePicker/DatePickerModal.js +134 -98
  49. package/dist/components/DatePicker/MonthPickerModal.js +115 -95
  50. package/dist/components/DatePicker/YearPickerModal.js +109 -89
  51. package/dist/components/DatePicker/constants.d.ts +1 -0
  52. package/dist/components/DatePicker/constants.js +1 -1
  53. package/dist/components/DatePicker/hooks.d.ts +2 -1
  54. package/dist/components/DatePicker/hooks.js +12 -12
  55. package/dist/components/Drawer/Drawer.js +172 -138
  56. package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +11 -0
  57. package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +27 -0
  58. package/dist/components/Dropdown/Dropdown.js +1 -1
  59. package/dist/components/Dropdown/hooks.js +1 -1
  60. package/dist/components/GosZnak/GosZnak.js +47 -38
  61. package/dist/components/GosZnak/utils.d.ts +6 -0
  62. package/dist/components/GosZnak/utils.js +15 -0
  63. package/dist/components/Input/Input.d.ts +4 -0
  64. package/dist/components/Input/Input.js +2 -2
  65. package/dist/components/Input/index.js +1 -1
  66. package/dist/components/InputPassword/InputPassword.js +38 -42
  67. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  68. package/dist/components/InputRangeSlider/InputRangeSlider.js +159 -139
  69. package/dist/components/InputRangeSlider/constants.d.ts +5 -0
  70. package/dist/components/InputRangeSlider/constants.js +11 -6
  71. package/dist/components/ListFiles/ListFiles.js +41 -39
  72. package/dist/components/ListPhotos/ListPhotos.js +17 -18
  73. package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
  74. package/dist/components/{InputClearButton/ClearButton.d.ts → MiniButton/MiniButton.d.ts} +17 -8
  75. package/dist/components/MiniButton/MiniButton.js +44 -0
  76. package/dist/components/MiniButton/constants.d.ts +9 -0
  77. package/dist/components/MiniButton/constants.js +5 -0
  78. package/dist/components/MiniButton/index.d.ts +4 -0
  79. package/dist/components/MiniButton/index.js +6 -0
  80. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +153 -152
  81. package/dist/components/MultiSelectSearch/constants.d.ts +1 -0
  82. package/dist/components/MultiSelectSearch/constants.js +7 -7
  83. package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
  84. package/dist/components/MultiSelectSearch/utils.js +18 -16
  85. package/dist/components/NotificationBadge/NotificationBadge.js +49 -33
  86. package/dist/components/NotificationBadge/constants.d.ts +9 -2
  87. package/dist/components/NotificationBadge/constants.js +3 -2
  88. package/dist/components/NotificationBadge/types.d.ts +11 -1
  89. package/dist/components/NotificationBadge/utils.d.ts +8 -0
  90. package/dist/components/NotificationBadge/utils.js +4 -0
  91. package/dist/components/OtpInput/OtpInput.js +44 -40
  92. package/dist/components/OtpInput/constants.d.ts +4 -0
  93. package/dist/components/OtpInput/constants.js +6 -4
  94. package/dist/components/OtpInput/index.d.ts +1 -0
  95. package/dist/components/OtpInput/index.js +2 -0
  96. package/dist/components/Pagination/Pagination.js +23 -23
  97. package/dist/components/RoundButton/RoundButton.d.ts +82 -0
  98. package/dist/components/RoundButton/RoundButton.js +69 -0
  99. package/dist/components/RoundButton/constants.d.ts +11 -0
  100. package/dist/components/RoundButton/constants.js +5 -0
  101. package/dist/components/RoundButton/index.d.ts +2 -0
  102. package/dist/components/RoundButton/index.js +7 -0
  103. package/dist/components/RoundButton/types.d.ts +20 -0
  104. package/dist/components/SelectSearch/SelectSearch.d.ts +2 -0
  105. package/dist/components/SelectSearch/SelectSearch.js +273 -236
  106. package/dist/components/SelectSearch/types.d.ts +9 -1
  107. package/dist/components/SelectSearch/utils.d.ts +1 -1
  108. package/dist/components/SelectSearch/utils.js +1 -1
  109. package/dist/components/Slider/Slider.d.ts +1 -5
  110. package/dist/components/Slider/Slider.js +34 -36
  111. package/dist/components/TextArea/TextArea.js +1 -1
  112. package/dist/components/index.d.ts +3 -1
  113. package/dist/components/index.js +55 -51
  114. package/dist/hooks-Cd4Ez6_j.js +117 -0
  115. package/dist/icons/Icon.js +1 -1
  116. package/dist/icons/components/16px/DropdownArrowDown16px.js +23 -0
  117. package/dist/icons/components/24px/EyeClosed24px.js +65 -0
  118. package/dist/icons/components/Avito.js +36 -13
  119. package/dist/icons/components/Site.js +13 -36
  120. package/dist/icons/components/index.js +564 -591
  121. package/dist/{index-C2dQUuc9.js → index-DrVFMaBi.js} +1184 -1346
  122. package/dist/index.js +73 -69
  123. package/dist/styles.module-BfkM1-KJ.js +32 -0
  124. package/package.json +1 -1
  125. package/dist/Input-BU_6U1CW.js +0 -227
  126. package/dist/assets/ClearButton.css +0 -1
  127. package/dist/components/InputClearButton/ClearButton.js +0 -41
  128. package/dist/components/InputClearButton/constants.d.ts +0 -8
  129. package/dist/components/InputClearButton/constants.js +0 -5
  130. package/dist/components/InputClearButton/index.d.ts +0 -4
  131. package/dist/components/InputClearButton/index.js +0 -6
  132. package/dist/hooks-HgN6Yauq.js +0 -117
  133. package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +0 -59
  134. package/dist/icons/components/64px/AtsVendors64px.js +0 -37
  135. package/dist/icons/components/64px/ButtonOn64px.js +0 -31
  136. package/dist/icons/components/64px/BuyoutAuto64px.js +0 -45
  137. package/dist/icons/components/64px/CarAssistance64px.js +0 -44
  138. package/dist/icons/components/64px/CarDelivery64px.js +0 -37
  139. package/dist/icons/components/64px/CarSearchReturn64px.js +0 -45
  140. package/dist/icons/components/64px/CarService64px.js +0 -37
  141. package/dist/icons/components/64px/Case64px.js +0 -33
  142. package/dist/icons/components/64px/CoatOfArms64px.js +0 -149
  143. package/dist/icons/components/64px/CoffeeCup64px.js +0 -44
  144. package/dist/icons/components/64px/Cup64px.js +0 -38
  145. package/dist/icons/components/64px/ExpertAdvice64px.js +0 -40
  146. package/dist/icons/components/64px/Fines64px.js +0 -88
  147. package/dist/icons/components/64px/Fuel64px.js +0 -38
  148. package/dist/icons/components/64px/GazprombankIcon24px.js +0 -21
  149. package/dist/icons/components/64px/Kasko64px.js +0 -44
  150. package/dist/icons/components/64px/LegalSupport64px.js +0 -58
  151. package/dist/icons/components/64px/Microphone64px.js +0 -37
  152. package/dist/icons/components/64px/Money64px.js +0 -60
  153. package/dist/icons/components/64px/PaymentSchedule64px.js +0 -39
  154. package/dist/icons/components/64px/PersonalManager64px.js +0 -100
  155. package/dist/icons/components/64px/PreApproval64px.js +0 -44
  156. package/dist/icons/components/64px/Questions64px.js +0 -37
  157. package/dist/icons/components/64px/SupportGeography64px.js +0 -51
  158. package/dist/icons/components/64px/Timer64px.js +0 -45
  159. package/dist/icons/components/64px/Twogis64px.js +0 -51
  160. package/dist/icons/components/64px/Vehicles64px.js +0 -45
  161. package/dist/icons/components/64px/Workplace64px.js +0 -38
  162. package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,30 +1,30 @@
1
- import { jsxs as r, jsx as m } from "react/jsx-runtime";
2
- import { c as p } from "../../index-DIxK0V-G.js";
3
- import { EChipSize as h, EChipVariant as b } from "./constants.js";
1
+ import { jsxs as r, jsx as j } from "react/jsx-runtime";
2
+ import { c as m } from "../../index-DIxK0V-G.js";
3
+ import { EChipSize as p, EChipVariant as h } from "./constants.js";
4
4
  import { Button as l } from "../Button/Button.js";
5
- import '../../assets/Chip.css';const v = "_chip_19bvm_2", d = "_disabled_19bvm_40", x = "_xs_19bvm_51", g = "_s_19bvm_59", u = "_m_19bvm_67", w = "_sapphire_19bvm_75", C = "_citrine_19bvm_84", f = "_asphalt_19bvm_93", y = "_gray_19bvm_102", N = "_white_19bvm_111", j = "_green_19bvm_120", s = {
6
- chip: v,
7
- "with-action": "_with-action_19bvm_18",
8
- disabled: d,
9
- xs: x,
10
- s: g,
11
- m: u,
12
- sapphire: w,
13
- citrine: C,
5
+ import '../../assets/Chip.css';const d = "_chip_10jmj_2", x = "_disabled_10jmj_41", g = "_xs_10jmj_52", u = "_s_10jmj_60", w = "_m_10jmj_68", C = "_sapphire_10jmj_78", b = "_citrine_10jmj_87", f = "_asphalt_10jmj_96", y = "_gray_10jmj_105", N = "_white_10jmj_114", B = "_green_10jmj_123", s = {
6
+ chip: d,
7
+ "with-action": "_with-action_10jmj_19",
8
+ disabled: x,
9
+ xs: g,
10
+ s: u,
11
+ m: w,
12
+ sapphire: C,
13
+ citrine: b,
14
14
  asphalt: f,
15
15
  gray: y,
16
16
  white: N,
17
- green: j
17
+ green: B
18
18
  }, z = ({
19
- size: i = h.M,
20
- variant: _ = b.Sapphire,
19
+ size: i = p.M,
20
+ variant: _ = h.Sapphire,
21
21
  className: c,
22
22
  disabled: e,
23
23
  withAction: t,
24
24
  children: o,
25
25
  onClose: a
26
26
  }) => {
27
- const n = p(
27
+ const n = m(
28
28
  s.chip,
29
29
  c,
30
30
  {
@@ -36,7 +36,7 @@ import '../../assets/Chip.css';const v = "_chip_19bvm_2", d = "_disabled_19bvm_4
36
36
  );
37
37
  return /* @__PURE__ */ r("div", { className: n, children: [
38
38
  o,
39
- t && /* @__PURE__ */ m(l, { isIconButton: !0, iconName: "Close16px", onClick: a, clear: !0 })
39
+ t && /* @__PURE__ */ j(l, { isIconButton: !0, iconName: "Close16px", onClick: a, clear: !0 })
40
40
  ] });
41
41
  };
42
42
  export {
@@ -65,6 +65,10 @@ export type TProps = {
65
65
  * Диапазон доступных дат [от, до]
66
66
  */
67
67
  validRange?: [Date | string, Date | string];
68
+ /**
69
+ * Флаг показывающий необходилось кнопки очиски
70
+ */
71
+ withClearButton?: boolean;
68
72
  } & TInputProps;
69
73
  export type TDatePickerValue = {
70
74
  value?: string;
@@ -139,4 +143,8 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
139
143
  * Диапазон доступных дат [от, до]
140
144
  */
141
145
  validRange?: [Date | string, Date | string];
146
+ /**
147
+ * Флаг показывающий необходилось кнопки очиски
148
+ */
149
+ withClearButton?: boolean;
142
150
  } & import('../Input/types').TInputProps & import('../Input').TAdditionalProps & import('react').RefAttributes<HTMLInputElement>>>;
@@ -1,242 +1,255 @@
1
- import { jsxs as Q, jsx as d } from "react/jsx-runtime";
1
+ import { jsxs as J, jsx as l } from "react/jsx-runtime";
2
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(
3
+ import { memo as pt, forwardRef as dt, useState as A, useEffect as S } from "react";
4
+ import { MAX_DAY as wt, MAX_MONTH as lt, DATE_LENGTH as Nt } from "./constants.js";
5
+ import { DatePickerModal as Tt } from "./DatePickerModal.js";
6
+ import { MonthPickerModal as Mt } from "./MonthPickerModal.js";
7
+ import { c as y } from "../../styles.module-BfkM1-KJ.js";
8
+ import { formatDatePart as Q } from "./utils.js";
9
+ import { YearPickerModal as kt } from "./YearPickerModal.js";
10
+ import { useClickOutside as Pt } from "../../hooks/useClickOutside/useClickOutside.js";
11
+ import { formating as d } from "../../utils/index.js";
12
+ import { I as At } from "../../Input-CGZoshMl.js";
13
+ import { EInputStatus as ut } from "../Input/constants.js";
14
+ import { MiniButton as xt } from "../MiniButton/MiniButton.js";
15
+ const It = pt(
16
16
  dt(
17
17
  ({
18
- size: g,
19
- value: l,
20
- onChangeValue: s,
21
- name: y,
18
+ size: j,
19
+ value: w,
20
+ onChangeValue: i,
21
+ name: p,
22
22
  before: N,
23
- type: a = "days",
24
- error: j,
23
+ type: f = "days",
24
+ error: v,
25
25
  onError: T,
26
- onBlur: o,
26
+ onBlur: c,
27
27
  validateImmediately: G,
28
- variant: C,
29
- disabled: v = !1,
30
- editable: x = !1,
28
+ variant: Z,
29
+ disabled: $ = !1,
30
+ editable: u = !1,
31
31
  openOnInput: L = !0,
32
- sendIntermediateValues: R = !1,
33
- disableFuture: W = !1,
34
- disablePast: q = !1,
32
+ sendIntermediateValues: b = !1,
33
+ disableFuture: U = !1,
34
+ disablePast: W = !1,
35
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]), $(() => {
36
+ validRange: o,
37
+ withClearButton: C = !1,
38
+ ...h
39
+ }, R) => {
40
+ const [H, m] = A(!1), [F, n] = A(f), [D, M] = A(
41
+ () => w && !isNaN(new Date(w).getTime()) ? new Date(w) : void 0
42
+ ), [Y, K] = A(v), [B, x] = A(""), [V, k] = A();
43
+ h.status = !!Y && ut.Error || h.status, S(() => {
44
+ K(v);
45
+ }, [v]), S(() => {
45
46
  M(
46
- l && !isNaN(new Date(l).getTime()) ? new Date(l) : void 0
47
+ w && !isNaN(new Date(w).getTime()) ? new Date(w) : void 0
47
48
  );
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,
49
+ }, [w]), S(() => {
50
+ D && typeof D != "string" && !isNaN(D == null ? void 0 : D.getTime()) ? x(d.Date(D, "dd/mm/yyyy")) : x("");
51
+ }, [D]);
52
+ const q = w && new Date(w).getTime;
53
+ S(() => {
54
+ G && (q ? (K(!1), T == null || T({ name: p, active: !1 })) : (K(!0), T == null || T({ name: p, active: !0 })));
55
+ }, [G, p, q]), Pt({
56
+ isActive: H,
56
57
  setActive: (t) => {
57
- D(t), m(a), t || k(void 0);
58
+ m(t), n(f), t || k(void 0);
58
59
  },
59
- className: n["calendar-block"]
60
+ className: y["calendar-block"]
60
61
  });
61
- const et = () => {
62
- !v && (L || !x) && D(!0);
63
- }, J = (t) => {
62
+ const tt = () => {
63
+ !$ && (L || !u) && m(!0);
64
+ }, z = (t) => {
64
65
  const r = t.getTime();
65
66
  if (t.setHours(0, 0, 0, 0), N && (typeof N == "string" ? new Date(N) : N).getTime() > r)
66
67
  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;
68
+ if (U) {
69
+ const s = /* @__PURE__ */ new Date();
70
+ if (s.setHours(0, 0, 0, 0), t.getTime() > s.getTime()) return !1;
70
71
  }
71
- if (q) {
72
- const i = /* @__PURE__ */ new Date();
73
- if (i.setHours(0, 0, 0, 0), r < i.getTime()) return !1;
72
+ if (W) {
73
+ const s = /* @__PURE__ */ new Date();
74
+ if (s.setHours(0, 0, 0, 0), r < s.getTime()) return !1;
74
75
  }
75
76
  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]
77
+ if (o) {
78
+ let s;
79
+ typeof o[0] == "string" ? s = [
80
+ new Date(o[0]),
81
+ typeof o[1] == "string" ? new Date(o[1]) : o[1]
82
+ ] : s = [
83
+ o[0],
84
+ typeof o[1] == "string" ? new Date(o[1]) : o[1]
84
85
  ];
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;
86
+ const [a, e] = s, I = new Date(a), P = new Date(e);
87
+ if (I.setHours(0, 0, 0, 0), P.setHours(23, 59, 59, 999), t < I || t > P) return !1;
87
88
  }
88
89
  return !0;
90
+ }, et = (t) => {
91
+ isNaN(t.getTime()) || (M(t), k(void 0), i == null || i({
92
+ value: d.Date(t, "yyyy-mm-dd"),
93
+ name: p
94
+ })), F === "years" && (f === "years" ? (m(!1), n(f)) : n("months")), F === "months" && (f === "months" ? (m(!1), n(f)) : n("days")), M(t), i == null || i({
95
+ value: d.Date(t, "yyyy-mm-dd"),
96
+ name: p
97
+ }), c == null || c(d.Date(t, "yyyy-mm-dd"));
89
98
  }, 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);
99
+ const r = D || /* @__PURE__ */ new Date(), s = r.getDate(), a = r.getMonth() + 1, e = new Date(t, a - 1, s);
100
+ if (e.getFullYear() === t && e.getMonth() === a - 1 && e.getDate() === s && z(e)) {
101
+ if (M(e), k(void 0), i == null || i({
102
+ value: d.Date(e, "yyyy-mm-dd"),
103
+ name: p
104
+ }), c == null || c(d.Date(e, "yyyy-mm-dd")), f === "years") {
105
+ m(!1), n(f);
105
106
  return;
106
107
  }
107
108
  } 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);
109
+ k(new Date(t, a - 1, 1));
110
+ f === "years" ? (m(!1), n(f)) : n("months");
111
+ }, it = (t, r) => {
112
+ const a = (D || /* @__PURE__ */ new Date()).getDate(), e = new Date(t, r - 1, a);
113
+ if (e.getFullYear() === t && e.getMonth() === r - 1 && e.getDate() === a && z(e)) {
114
+ if (M(e), k(void 0), i == null || i({
115
+ value: d.Date(e, "yyyy-mm-dd"),
116
+ name: p
117
+ }), c == null || c(d.Date(e, "yyyy-mm-dd")), f === "months") {
118
+ m(!1), n(f);
118
119
  return;
119
120
  }
120
121
  } else
121
122
  k(new Date(t, r - 1, 1));
122
- a === "months" ? (D(!1), m(a)) : m("days");
123
- }, ct = (t) => {
124
- if (x) {
123
+ f === "months" ? (m(!1), n(f)) : n("days");
124
+ }, rt = (t) => {
125
+ if (u) {
125
126
  const r = t.target.value.replace(/[^\d]/g, "");
126
127
  if (r.length === 0)
127
- H(""), s == null || s({ value: "", name: y }), o == null || o("");
128
+ x(""), i == null || i({ value: "", name: p }), c == null || c("");
128
129
  else {
129
- const [i, f, e] = [
130
- Z(r.substring(0, 2), yt),
131
- Z(r.substring(2, 4), wt),
130
+ const [s, a, e] = [
131
+ Q(r.substring(0, 2), wt),
132
+ Q(r.substring(2, 4), lt),
132
133
  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("-");
136
- s == null || s({
137
- value: A,
138
- name: y
134
+ ], I = [s, a, e].filter(Boolean).join("/");
135
+ if (x(I), b) {
136
+ const P = e ? `${e}-${a || "00"}-${s || "00"}` : [s, a, e].filter(Boolean).join("-");
137
+ i == null || i({
138
+ value: P,
139
+ name: p
139
140
  });
140
141
  }
141
- if (P.length === lt) {
142
- const A = parseInt(e), Y = /* @__PURE__ */ new Date(
143
- `${A}-${f.padStart(2, "0")}-${i.padStart(2, "0")}`
142
+ if (I.length === Nt) {
143
+ const P = parseInt(e), g = /* @__PURE__ */ new Date(
144
+ `${P}-${a.padStart(2, "0")}-${s.padStart(2, "0")}`
144
145
  );
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")));
146
+ isNaN(g.getTime()) || (M(g), i == null || i({
147
+ value: d.Date(g, "yyyy-mm-dd"),
148
+ name: p
149
+ }), c == null || c(d.Date(g, "yyyy-mm-dd")));
149
150
  }
150
151
  }
151
152
  }
152
- }, ot = X(n.wrapper, h && n.active), at = X(n.input, n.inputBorderControl);
153
- let K;
154
- if (c) {
153
+ }, ot = (t) => {
154
+ if (u && t.key === "Enter") {
155
+ m(!1);
156
+ return;
157
+ }
158
+ }, ct = (t) => {
159
+ t == null || t.stopPropagation(), x("");
160
+ }, at = X(y.wrapper, H && y.active), ft = X(y.input, y.inputBorderControl);
161
+ let E;
162
+ if (o) {
155
163
  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];
164
+ typeof o[0] == "string" ? t = new Date(o[0]) : t = o[0], typeof o[1] == "string" ? r = new Date(o[1]) : r = o[1], E = [t, r];
157
165
  }
158
- const U = {
159
- onChangeValue: st,
160
- date: tt || p || /* @__PURE__ */ new Date(),
161
- selectedDate: p,
166
+ const O = {
167
+ onChangeValue: et,
168
+ date: V || D || /* @__PURE__ */ new Date(),
169
+ selectedDate: D,
162
170
  before: typeof N == "string" ? new Date(N) : N,
163
- onChangeType: m,
164
- setIsActive: D,
165
- disableFuture: W,
166
- disablePast: q,
171
+ onChangeType: n,
172
+ setIsActive: m,
173
+ disableFuture: U,
174
+ disablePast: W,
167
175
  disabledDate: _,
168
- validRange: K
169
- }, ft = {
170
- ...U,
171
- onChangeMonth: rt
176
+ validRange: E
172
177
  }, mt = {
173
- ...U,
174
- onChangeYear: it
175
- }, nt = (() => {
178
+ ...O,
179
+ onChangeMonth: it
180
+ }, nt = {
181
+ ...O,
182
+ onChangeYear: st
183
+ }, Dt = (() => {
176
184
  switch (F) {
177
185
  case "months":
178
- return () => /* @__PURE__ */ d(Tt, { ...ft });
186
+ return () => /* @__PURE__ */ l(Mt, { ...mt });
179
187
  case "years":
180
- return () => /* @__PURE__ */ d(Mt, { ...mt });
188
+ return () => /* @__PURE__ */ l(kt, { ...nt });
181
189
  default:
182
- return () => /* @__PURE__ */ d(Nt, { ...U });
190
+ return () => /* @__PURE__ */ l(Tt, { ...O });
183
191
  }
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,
188
- {
189
- iconName: g === b.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
190
- }
191
- ) : /* @__PURE__ */ d(
192
- z,
193
- {
194
- iconName: g === b.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
195
- }
196
- ) });
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(
192
+ })(), yt = ({ isActive: t }) => {
193
+ const r = (a) => {
194
+ a.stopPropagation(), $ || m(!t);
195
+ }, s = j === "l" ? 16 : 12;
196
+ return /* @__PURE__ */ l(
197
+ xt,
198
+ {
199
+ variant: "transparent",
200
+ disabled: $,
201
+ size: j === "l" ? "l" : "m-s",
202
+ onClick: r,
203
+ iconName: t ? `DropdownArrowUp${s}px` : `DropdownArrowBottom${s}px`
204
+ }
205
+ );
206
+ };
207
+ return /* @__PURE__ */ J("div", { className: y["input-field-group-datePicker"], children: [
208
+ /* @__PURE__ */ J("div", { className: at, "data-disabled": $, children: [
209
+ /* @__PURE__ */ l(
200
210
  "div",
201
211
  {
202
212
  role: "button",
203
- "data-status": u.status,
204
- className: X(n["date-wrapper"], {
205
- [n.editable]: x
213
+ "data-status": h.status,
214
+ className: X(y["date-wrapper"], {
215
+ [y.editable]: u
206
216
  }),
207
- onClick: et,
208
- children: /* @__PURE__ */ d(
217
+ onClick: tt,
218
+ children: /* @__PURE__ */ l(
209
219
  At,
210
220
  {
211
- ref: B,
212
- className: at,
213
- wrapperClassName: n["input-wrapper"],
214
- size: g,
221
+ ref: R,
222
+ className: ft,
223
+ wrapperClassName: y["input-wrapper"],
224
+ size: j,
215
225
  type: "text",
216
- variant: C,
217
- value: V,
218
- onChange: ct,
226
+ variant: Z,
227
+ value: B,
228
+ onChange: rt,
229
+ onKeyDown: ot,
219
230
  rightAddon: {
220
231
  addonType: "react-node",
221
- addonContent: /* @__PURE__ */ d(Dt, { isActive: h })
232
+ addonContent: /* @__PURE__ */ l(yt, { isActive: H })
222
233
  },
223
- rightSlotClassName: n["right-slot"],
234
+ rightSlotClassName: y["right-slot"],
224
235
  onFocus: () => {
225
- L && !x && D(!0);
236
+ L && !u && m(!0);
226
237
  },
227
- ...u
238
+ withClearButton: C,
239
+ onClearButtonClick: ct,
240
+ ...h
228
241
  }
229
242
  )
230
243
  }
231
244
  ),
232
- h && /* @__PURE__ */ d(nt, {})
245
+ H && /* @__PURE__ */ l(Dt, {})
233
246
  ] }),
234
- S && typeof S == "string" && /* @__PURE__ */ d("div", { className: n.textError, children: S })
247
+ Y && typeof Y == "string" && /* @__PURE__ */ l("div", { className: y.textError, children: Y })
235
248
  ] });
236
249
  }
237
250
  )
238
251
  );
239
- Pt.displayName = "DatePicker";
252
+ It.displayName = "DatePicker";
240
253
  export {
241
- Pt as DatePicker
254
+ It as DatePicker
242
255
  };