mimir-ui-kit 1.43.11 → 1.43.13

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 (158) hide show
  1. package/dist/Input-BU_6U1CW.js +227 -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/CheckboxMimir.css +1 -1
  7. package/dist/assets/Chip.css +1 -1
  8. package/dist/assets/ClearButton.css +1 -0
  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/MultiSelectSearch.css +1 -1
  19. package/dist/assets/NotificationBadge.css +1 -1
  20. package/dist/assets/OtpInput.css +1 -1
  21. package/dist/assets/Pagination.css +1 -1
  22. package/dist/assets/SelectSearch.css +1 -1
  23. package/dist/assets/hooks.css +1 -1
  24. package/dist/assets/index.css +1 -1
  25. package/dist/assets/styles.css +1 -1
  26. package/dist/components/Accordion/Accordion.d.ts +3 -10
  27. package/dist/components/Accordion/Accordion.js +212 -286
  28. package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
  29. package/dist/components/Accordion/constants.d.ts +4 -0
  30. package/dist/components/Accordion/constants.js +5 -4
  31. package/dist/components/AnchorLink/Link.js +20 -21
  32. package/dist/components/Avatar/Avatar.js +26 -26
  33. package/dist/components/Button/Button.js +87 -110
  34. package/dist/components/Button/constants.d.ts +2 -8
  35. package/dist/components/Button/constants.js +5 -6
  36. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +0 -2
  37. package/dist/components/CheckboxMimir/CheckboxMimir.js +35 -37
  38. package/dist/components/Chip/Chip.js +17 -17
  39. package/dist/components/DatePicker/DatePicker.d.ts +0 -8
  40. package/dist/components/DatePicker/DatePicker.js +169 -182
  41. package/dist/components/DatePicker/DatePickerModal.js +98 -134
  42. package/dist/components/DatePicker/MonthPickerModal.js +95 -115
  43. package/dist/components/DatePicker/YearPickerModal.js +89 -109
  44. package/dist/components/DatePicker/constants.d.ts +1 -1
  45. package/dist/components/DatePicker/constants.js +7 -6
  46. package/dist/components/DatePicker/hooks.d.ts +1 -2
  47. package/dist/components/DatePicker/hooks.js +13 -13
  48. package/dist/components/Drawer/Drawer.js +138 -172
  49. package/dist/components/Dropdown/Dropdown.js +1 -1
  50. package/dist/components/Dropdown/hooks.js +1 -1
  51. package/dist/components/GosZnak/GosZnak.js +38 -47
  52. package/dist/components/Input/Input.d.ts +0 -4
  53. package/dist/components/Input/Input.js +2 -2
  54. package/dist/components/Input/index.js +1 -1
  55. package/dist/components/{MiniButton/MiniButton.d.ts → InputClearButton/ClearButton.d.ts} +8 -17
  56. package/dist/components/InputClearButton/ClearButton.js +41 -0
  57. package/dist/components/InputClearButton/constants.d.ts +8 -0
  58. package/dist/components/InputClearButton/constants.js +5 -0
  59. package/dist/components/InputClearButton/index.d.ts +4 -0
  60. package/dist/components/InputClearButton/index.js +6 -0
  61. package/dist/components/InputPassword/InputPassword.js +42 -38
  62. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  63. package/dist/components/InputRangeSlider/InputRangeSlider.js +139 -159
  64. package/dist/components/InputRangeSlider/constants.d.ts +0 -5
  65. package/dist/components/InputRangeSlider/constants.js +6 -11
  66. package/dist/components/ListFiles/ListFiles.js +39 -41
  67. package/dist/components/ListPhotos/ListPhotos.js +18 -17
  68. package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
  69. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +152 -153
  70. package/dist/components/MultiSelectSearch/constants.d.ts +0 -1
  71. package/dist/components/MultiSelectSearch/constants.js +7 -7
  72. package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
  73. package/dist/components/MultiSelectSearch/utils.js +16 -18
  74. package/dist/components/NotificationBadge/NotificationBadge.js +33 -49
  75. package/dist/components/NotificationBadge/constants.d.ts +2 -9
  76. package/dist/components/NotificationBadge/constants.js +2 -3
  77. package/dist/components/NotificationBadge/types.d.ts +1 -11
  78. package/dist/components/OtpInput/OtpInput.js +40 -44
  79. package/dist/components/OtpInput/constants.d.ts +0 -4
  80. package/dist/components/OtpInput/constants.js +4 -6
  81. package/dist/components/OtpInput/index.d.ts +0 -1
  82. package/dist/components/OtpInput/index.js +0 -2
  83. package/dist/components/Pagination/Pagination.js +23 -23
  84. package/dist/components/SelectSearch/SelectSearch.js +241 -241
  85. package/dist/components/SelectSearch/utils.d.ts +1 -1
  86. package/dist/components/SelectSearch/utils.js +1 -1
  87. package/dist/components/Slider/Slider.d.ts +5 -1
  88. package/dist/components/Slider/Slider.js +36 -34
  89. package/dist/components/TextArea/TextArea.js +1 -1
  90. package/dist/components/index.d.ts +1 -3
  91. package/dist/components/index.js +51 -55
  92. package/dist/hooks-HgN6Yauq.js +117 -0
  93. package/dist/icons/Icon.js +1 -1
  94. package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +59 -0
  95. package/dist/icons/components/64px/AtsVendors64px.js +37 -0
  96. package/dist/icons/components/64px/ButtonOn64px.js +31 -0
  97. package/dist/icons/components/64px/BuyoutAuto64px.js +45 -0
  98. package/dist/icons/components/64px/CarAssistance64px.js +44 -0
  99. package/dist/icons/components/64px/CarDelivery64px.js +37 -0
  100. package/dist/icons/components/64px/CarSearchReturn64px.js +45 -0
  101. package/dist/icons/components/64px/CarService64px.js +37 -0
  102. package/dist/icons/components/64px/Case64px.js +33 -0
  103. package/dist/icons/components/64px/CoatOfArms64px.js +149 -0
  104. package/dist/icons/components/64px/CoffeeCup64px.js +44 -0
  105. package/dist/icons/components/64px/Cup64px.js +38 -0
  106. package/dist/icons/components/64px/ExpertAdvice64px.js +40 -0
  107. package/dist/icons/components/64px/Fines64px.js +88 -0
  108. package/dist/icons/components/64px/Fuel64px.js +38 -0
  109. package/dist/icons/components/64px/GazprombankIcon24px.js +21 -0
  110. package/dist/icons/components/64px/Kasko64px.js +44 -0
  111. package/dist/icons/components/64px/LegalSupport64px.js +58 -0
  112. package/dist/icons/components/64px/Microphone64px.js +37 -0
  113. package/dist/icons/components/64px/Money64px.js +60 -0
  114. package/dist/icons/components/64px/PaymentSchedule64px.js +39 -0
  115. package/dist/icons/components/64px/PersonalManager64px.js +100 -0
  116. package/dist/icons/components/64px/PreApproval64px.js +44 -0
  117. package/dist/icons/components/64px/Questions64px.js +37 -0
  118. package/dist/icons/components/64px/SupportGeography64px.js +51 -0
  119. package/dist/icons/components/64px/Timer64px.js +45 -0
  120. package/dist/icons/components/64px/Twogis64px.js +51 -0
  121. package/dist/icons/components/64px/Vehicles64px.js +45 -0
  122. package/dist/icons/components/64px/Workplace64px.js +38 -0
  123. package/dist/icons/components/index.js +591 -564
  124. package/dist/{index-DrVFMaBi.js → index-C2dQUuc9.js} +1346 -1184
  125. package/dist/index.js +69 -73
  126. package/dist/styles.module-Cuqm31CO.js +28 -0
  127. package/package.json +1 -1
  128. package/dist/Input-CGZoshMl.js +0 -224
  129. package/dist/assets/CarBodyButton.css +0 -1
  130. package/dist/assets/MiniButton.css +0 -1
  131. package/dist/assets/RoundButton.css +0 -1
  132. package/dist/assets/ScrollWrapper.css +0 -1
  133. package/dist/components/CarBodyButton/CarBodyButton.d.ts +0 -26
  134. package/dist/components/CarBodyButton/CarBodyButton.js +0 -40
  135. package/dist/components/CarBodyButton/index.d.ts +0 -1
  136. package/dist/components/CarBodyButton/index.js +0 -4
  137. package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +0 -11
  138. package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +0 -27
  139. package/dist/components/GosZnak/utils.d.ts +0 -6
  140. package/dist/components/GosZnak/utils.js +0 -15
  141. package/dist/components/MiniButton/MiniButton.js +0 -44
  142. package/dist/components/MiniButton/constants.d.ts +0 -9
  143. package/dist/components/MiniButton/constants.js +0 -5
  144. package/dist/components/MiniButton/index.d.ts +0 -4
  145. package/dist/components/MiniButton/index.js +0 -6
  146. package/dist/components/NotificationBadge/utils.d.ts +0 -8
  147. package/dist/components/NotificationBadge/utils.js +0 -4
  148. package/dist/components/RoundButton/RoundButton.d.ts +0 -82
  149. package/dist/components/RoundButton/RoundButton.js +0 -69
  150. package/dist/components/RoundButton/constants.d.ts +0 -11
  151. package/dist/components/RoundButton/constants.js +0 -5
  152. package/dist/components/RoundButton/index.d.ts +0 -2
  153. package/dist/components/RoundButton/index.js +0 -7
  154. package/dist/components/RoundButton/types.d.ts +0 -20
  155. package/dist/hooks-Cd4Ez6_j.js +0 -117
  156. package/dist/icons/components/16px/DropdownArrowDown16px.js +0 -23
  157. package/dist/icons/components/24px/EyeClosed24px.js +0 -65
  158. package/dist/styles.module-BfkM1-KJ.js +0 -32
@@ -1,206 +1,170 @@
1
- import { jsxs as D, jsx as m } from "react/jsx-runtime";
2
- import { c as l } from "../../index-DIxK0V-G.js";
3
- import { useState as E } from "react";
4
- import { week as K, COUNT_WORK_DAYS as R } from "./constants.js";
5
- import { useDatePickerPosition as q } from "./hooks.js";
6
- import { c as n } from "../../styles.module-BfkM1-KJ.js";
7
- import { getUpdateDate as F } from "./utils.js";
8
- import { Icon as J } from "../../icons/Icon.js";
9
- import { formating as c } from "../../utils/index.js";
10
- import { Button as H } from "../Button/Button.js";
11
- import { parseDate as I } from "../../utils/formating/Date.js";
12
- const lt = ({
13
- date: u,
14
- selectedDate: f,
15
- onChangeValue: O,
16
- setIsActive: S,
17
- before: x,
18
- onChangeType: h,
19
- disableFuture: T = !1,
20
- disablePast: j = !1,
21
- disabledDate: v,
22
- validRange: M
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
+ import { c as n } from "../../styles.module-Cuqm31CO.js";
7
+ import { getUpdateDate as A } from "./utils.js";
8
+ import { Icon as E } from "../../icons/Icon.js";
9
+ import { formating as m } from "../../utils/index.js";
10
+ import { Button as B } from "../Button/Button.js";
11
+ import { parseDate as H } from "../../utils/formating/Date.js";
12
+ const at = ({
13
+ date: i,
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
23
23
  }) => {
24
- var B;
25
- u = isNaN(new Date(u).getTime()) ? /* @__PURE__ */ new Date() : u;
26
- const d = I(u), g = f ? I(f) : d, p = /* @__PURE__ */ new Date(), N = {
27
- y: g.getFullYear(),
28
- d: g.getDate(),
29
- m: g.getMonth() + 1
30
- }, $ = {
31
- y: d.getFullYear(),
32
- d: d.getDate(),
33
- m: d.getMonth() + 1
34
- }, a = {
35
- y: p.getFullYear(),
36
- d: p.getDate(),
37
- m: p.getMonth() + 1
38
- }, [e, k] = E({ y: $.y, m: $.m }), [C, P] = q([e]), L = (t) => {
39
- let r = t.getDay();
40
- return r === 0 && (r = 7), r - 1;
41
- }, _ = e.m - 1, i = new Date(e.y, _), w = [], A = (() => {
42
- const t = new Date(i);
24
+ var $;
25
+ i = isNaN(new Date(i).getTime()) ? /* @__PURE__ */ new Date() : i;
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) => {
35
+ let e = t.getDay();
36
+ return e === 0 && (e = 7), e - 1;
37
+ }, v = r.m - 1, c = new Date(r.y, v), g = [], x = (() => {
38
+ const t = new Date(c);
43
39
  t.setDate(t.getDate() - 1);
44
- const r = t.getDate(), o = [];
45
- for (let s = 0; s < L(i); s++)
46
- o.push({
47
- day: r - s,
48
- month: t.getMonth() + 1,
49
- year: t.getFullYear()
50
- });
40
+ const e = t.getDate(), o = [];
41
+ for (let s = 0; s < j(c); s++)
42
+ o.push(e - s);
51
43
  return o.reverse(), o;
52
44
  })();
53
- for (; i.getMonth() === _; )
54
- w.push(i.getDate()), i.setDate(i.getDate() + 1);
55
- const z = (() => {
56
- const r = 42 - (A.length + w.length), o = [], s = e.m === 11 ? 0 : e.m + 1, y = e.m === 11 ? e.y + 1 : e.y;
57
- for (let b = 1; b <= r; b++)
58
- o.push({
59
- day: b,
60
- month: s,
61
- year: y
62
- });
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 = [];
49
+ for (let s = 1; s <= e; s++)
50
+ o.push(s);
63
51
  return o;
64
- })(), G = () => {
65
- S(!1);
66
- }, U = () => {
67
- k(F(e.m + 1, e.y));
68
- }, V = () => {
69
- k(F(e.m - 1, e.y));
70
- }, Y = (t) => {
71
- const r = new Date(t);
72
- if (r.setHours(0, 0, 0, 0), x && x.getTime() > t)
52
+ })(), F = () => {
53
+ O(!1);
54
+ }, L = () => {
55
+ b(A(r.m + 1, r.y));
56
+ }, Y = () => {
57
+ b(A(r.m - 1, r.y));
58
+ }, M = (t) => {
59
+ const e = new Date(t);
60
+ if (e.setHours(0, 0, 0, 0), p && p.getTime() > t)
73
61
  return !0;
74
- if (T) {
62
+ if (S) {
75
63
  const o = /* @__PURE__ */ new Date();
76
- if (o.setHours(0, 0, 0, 0), r.getTime() > o.getTime()) return !0;
64
+ if (o.setHours(0, 0, 0, 0), e.getTime() > o.getTime()) return !0;
77
65
  }
78
- if (j) {
66
+ if (T) {
79
67
  const o = /* @__PURE__ */ new Date();
80
68
  if (o.setHours(0, 0, 0, 0), t < o.getTime()) return !0;
81
69
  }
82
- if (v && v(r)) return !0;
83
- if (M) {
84
- const [o, s] = M, y = new Date(t);
85
- if (o.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), y < o || y > 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;
86
74
  }
87
75
  return !1;
88
- }, W = (t) => {
89
- Y(
76
+ }, z = (t) => {
77
+ M(
90
78
  (/* @__PURE__ */ new Date(
91
- `${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
79
+ `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
92
80
  )).getTime()
93
- ) || (O(
81
+ ) || (I(
94
82
  /* @__PURE__ */ new Date(
95
- `${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
83
+ `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
96
84
  )
97
- ), G());
85
+ ), F());
98
86
  };
99
- return /* @__PURE__ */ D(
87
+ return /* @__PURE__ */ u(
100
88
  "div",
101
89
  {
102
- className: l(
103
- n["calendar-block"],
104
- P && n[`calendar-block--position-${P}`]
105
- ),
106
- ref: C,
90
+ className: n["calendar-block"],
91
+ ref: _,
107
92
  "data-testid": "calendar-modal",
108
93
  children: [
109
- /* @__PURE__ */ D("div", { className: n.h, children: [
110
- /* @__PURE__ */ m(
111
- H,
94
+ /* @__PURE__ */ u("div", { className: n.h, children: [
95
+ /* @__PURE__ */ a(
96
+ B,
112
97
  {
113
98
  isIconButton: !0,
114
99
  iconName: "DropdownArrowLeft16px",
115
- onClick: V,
100
+ onClick: Y,
116
101
  variant: "secondary-gray",
117
102
  size: "l"
118
103
  }
119
104
  ),
120
- /* @__PURE__ */ D(
105
+ /* @__PURE__ */ u(
121
106
  "button",
122
107
  {
123
108
  type: "button",
124
109
  className: n.d,
125
- onClick: () => h == null ? void 0 : h("months"),
110
+ onClick: () => D == null ? void 0 : D("months"),
126
111
  "data-testid": "month-year-button",
127
112
  children: [
128
- (B = c.Month(e.m)) == null ? void 0 : B.name,
113
+ ($ = m.Month(r.m)) == null ? void 0 : $.name,
129
114
  "’",
130
- e.y.toString().slice(-2),
131
- /* @__PURE__ */ m(J, { iconName: "DropdownArrowBottom16px" })
115
+ r.y.toString().slice(-2),
116
+ /* @__PURE__ */ a(E, { iconName: "DropdownArrowBottom16px" })
132
117
  ]
133
118
  }
134
119
  ),
135
- /* @__PURE__ */ m(
136
- H,
120
+ /* @__PURE__ */ a(
121
+ B,
137
122
  {
138
123
  isIconButton: !0,
139
124
  iconName: "DropdownArrowRight16px",
140
- onClick: U,
125
+ onClick: L,
141
126
  variant: "secondary-gray",
142
127
  size: "l"
143
128
  }
144
129
  )
145
130
  ] }),
146
- /* @__PURE__ */ D("div", { className: n.b, children: [
147
- K.map((t, r) => /* @__PURE__ */ m(
131
+ /* @__PURE__ */ u("div", { className: n.b, children: [
132
+ U.map((t, e) => /* @__PURE__ */ a(
148
133
  "div",
149
134
  {
150
- className: l(n.m, {
151
- [n.orange]: r > R
135
+ className: P(n.m, {
136
+ [n.orange]: e > V
152
137
  }),
153
138
  children: t
154
139
  },
155
- `v${r}`
156
- )),
157
- A.map((t, r) => /* @__PURE__ */ m(
158
- "div",
159
- {
160
- className: l(n.m, {
161
- [n.current_disabled]: a.y === t.year && a.m === t.month && a.d === t.day
162
- }),
163
- children: t.day
164
- },
165
- r
140
+ `v${e}`
166
141
  )),
167
- w.map((t, r) => /* @__PURE__ */ m(
142
+ x.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e)),
143
+ g.map((t, e) => /* @__PURE__ */ a(
168
144
  "button",
169
145
  {
170
146
  type: "button",
171
- onClick: () => W(t),
172
- className: l(
173
- Y(
147
+ onClick: () => z(t),
148
+ className: P(
149
+ M(
174
150
  (/* @__PURE__ */ new Date(
175
- `${e.y}-${c.Number(2, e.m)}-${c.Number(2, t)}`
151
+ `${r.y}-${m.Number(2, r.m)}-${m.Number(2, t)}`
176
152
  )).getTime()
177
153
  ) ? n.m : n.a,
178
154
  {
179
- [n.current]: a.y === e.y && a.m === e.m && a.d === t
180
- },
181
- {
182
- [n.selecte]: f && N.y === e.y && N.m === e.m && N.d === t
155
+ [n.current]: d && y.y === r.y && y.m === r.m && y.d === t
183
156
  }
184
157
  ),
185
158
  children: t !== 0 && t
186
159
  },
187
- r
160
+ e
188
161
  )),
189
- z.map((t, r) => /* @__PURE__ */ m(
190
- "div",
191
- {
192
- className: l(n.m, {
193
- [n.current_disabled]: a.y === t.year && a.m === t.month && a.d === t.day
194
- }),
195
- children: t.day
196
- },
197
- r
198
- ))
162
+ C.map((t, e) => /* @__PURE__ */ a("div", { className: n.m, children: t }, e))
199
163
  ] })
200
164
  ]
201
165
  }
202
166
  );
203
167
  };
204
168
  export {
205
- lt as DatePickerModal
169
+ at as DatePickerModal
206
170
  };
@@ -1,154 +1,134 @@
1
- import { jsxs as g, jsx as f } from "react/jsx-runtime";
2
- import { c as B } from "../../index-DIxK0V-G.js";
3
- import { useState as L } from "react";
4
- import { months as q } from "./constants.js";
5
- import { useDatePickerPosition as E } from "./hooks.js";
6
- import { c as a } from "../../styles.module-BfkM1-KJ.js";
7
- import { Icon as J } from "../../icons/Icon.js";
8
- import { formating as H } from "../../utils/index.js";
9
- import { Button as $ } from "../Button/Button.js";
10
- const et = ({
11
- date: A,
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
+ import { months as C } from "./constants.js";
5
+ import { useDatePickerPosition as L } from "./hooks.js";
6
+ import { c } from "../../styles.module-Cuqm31CO.js";
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
12
  selectedDate: D,
13
- onChangeValue: G,
13
+ onChangeValue: A,
14
14
  before: m,
15
15
  onChangeType: y,
16
- onChangeMonth: M,
17
- disableFuture: I = !1,
18
- disablePast: O = !1,
16
+ onChangeMonth: g,
17
+ disableFuture: G = !1,
18
+ disablePast: I = !1,
19
19
  disabledDate: u,
20
- validRange: h
20
+ validRange: M
21
21
  }) => {
22
- const [S, _] = E(), d = new Date(A), w = D ? new Date(D) : d, p = /* @__PURE__ */ new Date(), k = {
23
- y: w.getFullYear(),
24
- d: w.getDate(),
25
- m: w.getMonth() + 1
26
- }, x = {
27
- y: d.getFullYear(),
28
- d: d.getDate(),
29
- m: d.getMonth() + 1
30
- }, Y = {
22
+ const N = L(), d = new Date(P), p = D ? new Date(D) : d, h = {
31
23
  y: p.getFullYear(),
32
24
  d: p.getDate(),
33
25
  m: p.getMonth() + 1
34
- }, [t, v] = L(x.y), j = () => {
35
- v(t + 1);
36
- }, z = () => {
37
- v(t - 1);
38
- }, F = (e) => {
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) => {
39
35
  const i = /* @__PURE__ */ new Date(), n = i.getFullYear(), l = i.getMonth() + 1;
40
- if (h) {
41
- const [r, c] = h, o = new Date(t, e - 1, 1), s = new Date(t, e, 0);
36
+ if (M) {
37
+ const [r, a] = M, o = new Date(t, e - 1, 1), s = new Date(t, e, 0);
42
38
  o.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999);
43
- const N = new Date(r), P = new Date(c);
44
- N.setHours(0, 0, 0, 0), P.setHours(23, 59, 59, 999);
45
- const b = s < N, C = o > P;
46
- if (b || C)
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)
47
43
  return !0;
48
44
  }
49
45
  if (m) {
50
- const r = m.getFullYear(), c = m.getMonth() + 1;
51
- if (r > t || r === t && c > e)
46
+ const r = m.getFullYear(), a = m.getMonth() + 1;
47
+ if (r > t || r === t && a > e)
52
48
  return !0;
53
49
  }
54
- if (I && (t > n || t === n && e > l) || O && (t < n || t === n && e < l))
50
+ if (G && (t > n || t === n && e > l) || I && (t < n || t === n && e < l))
55
51
  return !0;
56
52
  if (u) {
57
- const r = new Date(t, e, 0).getDate(), c = [1, Math.ceil(r / 2), r];
58
- for (const o of c) {
53
+ const r = new Date(t, e, 0).getDate(), a = [1, Math.ceil(r / 2), r];
54
+ for (const o of a) {
59
55
  const s = new Date(t, e - 1, o);
60
56
  if (!u(s)) return !1;
61
57
  }
62
58
  for (let o = 2; o < r; o += 3) {
63
- if (c.includes(o)) continue;
59
+ if (a.includes(o)) continue;
64
60
  const s = new Date(t, e - 1, o);
65
61
  if (!u(s)) return !1;
66
62
  }
67
63
  for (let o = 1; o <= r; o++) {
68
- if (c.includes(o) || (o - 2) % 3 === 0) continue;
64
+ if (a.includes(o) || (o - 2) % 3 === 0) continue;
69
65
  const s = new Date(t, e - 1, o);
70
66
  if (!u(s)) return !1;
71
67
  }
72
68
  return !0;
73
69
  }
74
70
  return !1;
75
- }, R = (e) => {
76
- F(e) || (M ? M(t, e) : G(
71
+ }, $ = (e) => {
72
+ Y(e) || (g ? g(t, e) : A(
77
73
  /* @__PURE__ */ new Date(
78
- `${t}-${H.Number(2, e)}-${H.Number(2, x.d)}`
74
+ `${t}-${F.Number(2, e)}-${F.Number(2, k.d)}`
79
75
  )
80
76
  ));
81
77
  };
82
- return /* @__PURE__ */ g(
83
- "div",
84
- {
85
- className: B(
86
- a["calendar-block"],
87
- a[`calendar-block--position-${_}`]
78
+ return /* @__PURE__ */ w("div", { className: c["calendar-block"], ref: N, children: [
79
+ /* @__PURE__ */ w("div", { className: c.h, children: [
80
+ /* @__PURE__ */ f(
81
+ H,
82
+ {
83
+ isIconButton: !0,
84
+ iconName: "DropdownArrowLeft16px",
85
+ onClick: S,
86
+ variant: "secondary-gray",
87
+ size: "l"
88
+ }
88
89
  ),
89
- ref: S,
90
- children: [
91
- /* @__PURE__ */ g("div", { className: a.h, children: [
92
- /* @__PURE__ */ f(
93
- $,
94
- {
95
- isIconButton: !0,
96
- iconName: "DropdownArrowLeft16px",
97
- onClick: z,
98
- variant: "secondary-gray",
99
- size: "l"
100
- }
101
- ),
102
- /* @__PURE__ */ g(
103
- "button",
104
- {
105
- type: "button",
106
- onClick: () => y == null ? void 0 : y("years"),
107
- className: a.d,
108
- "data-testid": "year-button",
109
- children: [
110
- t.toString(),
111
- /* @__PURE__ */ f(J, { iconName: "DropdownArrowBottom16px" })
112
- ]
113
- }
114
- ),
115
- /* @__PURE__ */ f(
116
- $,
117
- {
118
- isIconButton: !0,
119
- iconName: "DropdownArrowRight16px",
120
- onClick: j,
121
- variant: "secondary-gray",
122
- size: "l"
123
- }
124
- )
125
- ] }),
126
- /* @__PURE__ */ f("div", { className: a.monthGrid, "data-testid": "month-picker", children: q.map((e, i) => {
127
- const n = i + 1, l = F(n);
128
- return /* @__PURE__ */ f(
129
- "button",
130
- {
131
- type: "button",
132
- onClick: () => R(n),
133
- disabled: l,
134
- className: B(
135
- l ? a.m : a.a,
136
- {
137
- [a.current]: Y.y === t && Y.m === n
138
- },
139
- {
140
- [a.selecte]: D && k.y === t && k.m === n
141
- }
142
- ),
143
- children: e
144
- },
145
- i
146
- );
147
- }) })
148
- ]
149
- }
150
- );
90
+ /* @__PURE__ */ w(
91
+ "button",
92
+ {
93
+ type: "button",
94
+ onClick: () => y == null ? void 0 : y("years"),
95
+ className: c.d,
96
+ "data-testid": "year-button",
97
+ children: [
98
+ t.toString(),
99
+ /* @__PURE__ */ f(b, { iconName: "DropdownArrowBottom16px" })
100
+ ]
101
+ }
102
+ ),
103
+ /* @__PURE__ */ f(
104
+ H,
105
+ {
106
+ isIconButton: !0,
107
+ iconName: "DropdownArrowRight16px",
108
+ onClick: O,
109
+ variant: "secondary-gray",
110
+ size: "l"
111
+ }
112
+ )
113
+ ] }),
114
+ /* @__PURE__ */ f("div", { className: c.monthGrid, "data-testid": "month-picker", children: C.map((e, i) => {
115
+ const n = i + 1, l = Y(n);
116
+ return /* @__PURE__ */ f(
117
+ "button",
118
+ {
119
+ type: "button",
120
+ onClick: () => $(n),
121
+ disabled: l,
122
+ className: R(l ? c.m : c.a, {
123
+ [c.current]: D && h.y === t && h.m === n
124
+ }),
125
+ children: e
126
+ },
127
+ i
128
+ );
129
+ }) })
130
+ ] });
151
131
  };
152
132
  export {
153
- et as MonthPickerModal
133
+ Z as MonthPickerModal
154
134
  };