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