urfu-ui-kit-react 2.1.7-next.4 → 2.1.7-next.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.
Files changed (150) hide show
  1. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  2. package/dist/components/Accordion/Accordion.js +16 -15
  3. package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
  4. package/dist/components/BreadCrumbs/BreadCrumbs.js +23 -22
  5. package/dist/components/Button/Button.d.ts.map +1 -1
  6. package/dist/components/Button/Button.js +51 -50
  7. package/dist/components/Button/ButtonRefreshIcon.d.ts.map +1 -1
  8. package/dist/components/Button/ButtonRefreshIcon.js +9 -8
  9. package/dist/components/Calendar/Calendar.js +232 -232
  10. package/dist/components/Calendar/CalendarSelect.d.ts.map +1 -1
  11. package/dist/components/Calendar/CalendarSelect.js +41 -40
  12. package/dist/components/Card/Card.d.ts.map +1 -1
  13. package/dist/components/Card/Card.js +59 -58
  14. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  15. package/dist/components/Checkbox/Checkbox.js +20 -19
  16. package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
  17. package/dist/components/ColumnSettings/ColumnSettings.js +112 -111
  18. package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
  19. package/dist/components/ConfirmModal/ConfirmModal.js +30 -29
  20. package/dist/components/Drawer/Drawer.js +57 -57
  21. package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
  22. package/dist/components/ErrorScreen/ErrorScreen.js +151 -150
  23. package/dist/components/ErrorScreen/ErrorScreenIllustration.d.ts.map +1 -1
  24. package/dist/components/ErrorScreen/ErrorScreenIllustration.js +35 -34
  25. package/dist/components/FormField/FormField.d.ts.map +1 -1
  26. package/dist/components/FormField/FormField.js +30 -29
  27. package/dist/components/Icon/Icon.d.ts.map +1 -1
  28. package/dist/components/Icon/Icon.js +17 -16
  29. package/dist/components/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
  30. package/dist/components/InfiniteScroll/InfiniteScroll.js +23 -22
  31. package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts.map +1 -1
  32. package/dist/components/InputExpandTextarea/InputExpandTextarea.js +88 -87
  33. package/dist/components/InputFile/InputFile.d.ts.map +1 -1
  34. package/dist/components/InputFile/InputFile.js +99 -98
  35. package/dist/components/InputNumber/InputNumber.d.ts.map +1 -1
  36. package/dist/components/InputNumber/InputNumber.js +112 -111
  37. package/dist/components/InputText/InputAffix.d.ts.map +1 -1
  38. package/dist/components/InputText/InputAffix.js +69 -68
  39. package/dist/components/InputText/InputText.d.ts.map +1 -1
  40. package/dist/components/InputText/InputText.js +108 -107
  41. package/dist/components/InputTime/InputTime.d.ts.map +1 -1
  42. package/dist/components/InputTime/InputTime.js +202 -201
  43. package/dist/components/InputTime/InputTimeDropdown.d.ts.map +1 -1
  44. package/dist/components/InputTime/InputTimeDropdown.js +21 -20
  45. package/dist/components/Menu/Menu.d.ts.map +1 -1
  46. package/dist/components/Menu/Menu.js +58 -57
  47. package/dist/components/Message/Message.d.ts.map +1 -1
  48. package/dist/components/Message/Message.js +19 -18
  49. package/dist/components/Modal/Modal.js +66 -66
  50. package/dist/components/Modal/useModalTitleClearance.d.ts.map +1 -1
  51. package/dist/components/Modal/useModalTitleClearance.js +34 -33
  52. package/dist/components/Multiselect/Multiselect.js +222 -222
  53. package/dist/components/Notification/Notification.js +90 -90
  54. package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
  55. package/dist/components/OfflineBanner/OfflineBanner.js +40 -37
  56. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  57. package/dist/components/Pagination/Pagination.js +59 -58
  58. package/dist/components/Preloader/Preloader.d.ts.map +1 -1
  59. package/dist/components/Preloader/Preloader.js +28 -27
  60. package/dist/components/Radio/Radio.d.ts.map +1 -1
  61. package/dist/components/Radio/Radio.js +21 -20
  62. package/dist/components/Search/Search.d.ts.map +1 -1
  63. package/dist/components/Search/Search.js +33 -32
  64. package/dist/components/SearchSelect/SearchSelect.js +178 -178
  65. package/dist/components/SearchSelect/SearchSelectOption.d.ts.map +1 -1
  66. package/dist/components/SearchSelect/SearchSelectOption.js +21 -20
  67. package/dist/components/Select/MobileOptionSheet.d.ts.map +1 -1
  68. package/dist/components/Select/MobileOptionSheet.js +65 -64
  69. package/dist/components/Select/Select.js +184 -184
  70. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
  71. package/dist/components/Skeleton/Skeleton.js +26 -25
  72. package/dist/components/Status/Status.d.ts.map +1 -1
  73. package/dist/components/Status/Status.js +36 -35
  74. package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
  75. package/dist/components/StickyActionBar/StickyActionBar.js +36 -35
  76. package/dist/components/Switch/Switch.d.ts.map +1 -1
  77. package/dist/components/Switch/Switch.js +19 -18
  78. package/dist/components/Table/Filter/DefaultInput.d.ts.map +1 -1
  79. package/dist/components/Table/Filter/DefaultInput.js +12 -11
  80. package/dist/components/Table/Filter/Filter.d.ts.map +1 -1
  81. package/dist/components/Table/Filter/Filter.js +99 -98
  82. package/dist/components/Table/Filter/FilterBooleanBox.d.ts.map +1 -1
  83. package/dist/components/Table/Filter/FilterBooleanBox.js +7 -6
  84. package/dist/components/Table/Filter/FilterBoxShell.js +48 -48
  85. package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
  86. package/dist/components/Table/Filter/FilterDateBox.js +65 -64
  87. package/dist/components/Table/Filter/FilterSortIndicator.d.ts.map +1 -1
  88. package/dist/components/Table/Filter/FilterSortIndicator.js +8 -7
  89. package/dist/components/Table/Filter/SelectFilter.js +53 -53
  90. package/dist/components/Table/Filter/TableFilterOptions.d.ts.map +1 -1
  91. package/dist/components/Table/Filter/TableFilterOptions.js +141 -140
  92. package/dist/components/Table/Filter/TableFilterSortButton.d.ts.map +1 -1
  93. package/dist/components/Table/Filter/TableFilterSortButton.js +10 -9
  94. package/dist/components/Table/Filter/useVirtualOptionWindow.d.ts.map +1 -1
  95. package/dist/components/Table/Filter/useVirtualOptionWindow.js +9 -8
  96. package/dist/components/Table/Skeleton/createSkeletonColumns.d.ts.map +1 -1
  97. package/dist/components/Table/Skeleton/createSkeletonColumns.js +9 -8
  98. package/dist/components/Table/Table.d.ts.map +1 -1
  99. package/dist/components/Table/Table.helpers.d.ts.map +1 -1
  100. package/dist/components/Table/Table.helpers.js +31 -30
  101. package/dist/components/Table/Table.js +253 -252
  102. package/dist/components/Table/TableHead.d.ts.map +1 -1
  103. package/dist/components/Table/TableHead.js +92 -91
  104. package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
  105. package/dist/components/Table/TableMobileCard.js +121 -120
  106. package/dist/components/Table/TableMobileFilters.d.ts.map +1 -1
  107. package/dist/components/Table/TableMobileFilters.js +28 -27
  108. package/dist/components/Table/TableMobileView.d.ts.map +1 -1
  109. package/dist/components/Table/TableMobileView.js +178 -177
  110. package/dist/components/Table/TableRow.d.ts.map +1 -1
  111. package/dist/components/Table/TableRow.js +59 -58
  112. package/dist/components/Table/useTableColumnPinning.d.ts +2 -917
  113. package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
  114. package/dist/components/Table/useTableColumnPinning.js +21 -20
  115. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  116. package/dist/components/Tabs/Tabs.js +102 -101
  117. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  118. package/dist/components/Textarea/Textarea.js +70 -69
  119. package/dist/components/Tooltip/Tooltip.js +106 -106
  120. package/dist/components/TreeView/TreeView.js +183 -183
  121. package/dist/components/VirtualList/VirtualList.d.ts.map +1 -1
  122. package/dist/components/VirtualList/VirtualList.js +42 -41
  123. package/dist/dev/index.js +1 -1
  124. package/dist/hooks/useAutoId.d.ts.map +1 -1
  125. package/dist/hooks/useAutoId.js +7 -6
  126. package/dist/hooks/useSelectEngine.d.ts.map +1 -1
  127. package/dist/hooks/useSelectEngine.js +31 -30
  128. package/dist/index.d.ts +2 -1
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/responsive/uiKitResponsive.d.ts +6 -0
  131. package/dist/responsive/uiKitResponsive.d.ts.map +1 -1
  132. package/dist/responsive/uiKitResponsive.js +27 -26
  133. package/dist/shared/kitCopy.js +1 -1
  134. package/dist/shared/optionStateColors.d.ts +3 -2
  135. package/dist/shared/optionStateColors.d.ts.map +1 -1
  136. package/dist/shared/optionStateColors.js +9 -4
  137. package/dist/shared/popupTransition.d.ts.map +1 -1
  138. package/dist/shared/popupTransition.js +7 -6
  139. package/dist/shared/sheetTitle.d.ts +2 -1
  140. package/dist/shared/sheetTitle.d.ts.map +1 -1
  141. package/dist/shared/size.d.ts.map +1 -1
  142. package/dist/shared/size.js +3 -2
  143. package/dist/shared/uiKitDefaults.d.ts +21 -0
  144. package/dist/shared/uiKitDefaults.d.ts.map +1 -1
  145. package/dist/shared/uiKitDefaults.js +32 -18
  146. package/dist/style.shell.lk.css +53 -0
  147. package/dist/urfu-ui-kit-react.js +27 -26
  148. package/dist/vanilla/core/describeError.js +1 -1
  149. package/dist/vanilla/core/sheetTitle.js +7 -7
  150. package/package.json +3 -1
@@ -1,43 +1,43 @@
1
- import { jsx as o, jsxs as N, Fragment as tt } from "react/jsx-runtime";
2
- import { getFieldAccessibility$u as rt } from "../../shared/fieldAccessibility.js";
3
- import { useRef as ve, useState as h, useInsertionEffect as ot, useEffect as T, useMemo as p, useContext as nt, createContext as at } from "react";
4
- import { createPortal as it } from "react-dom";
5
- import lt, { registerLocale$u as ct } from "../../vendor/react-datepicker/dist/es/index.js";
1
+ import { jsx as o, jsxs as T, Fragment as ot } from "react/jsx-runtime";
2
+ import { getFieldAccessibility$u as nt } from "../../shared/fieldAccessibility.js";
3
+ import { useRef as he, useState as g, useInsertionEffect as it, useEffect as A, useMemo as m, useContext as at, createContext as lt } from "react";
4
+ import { createPortal as ct } from "react-dom";
5
+ import st, { registerLocale$u as dt } from "../../vendor/react-datepicker/dist/es/index.js";
6
6
  /* empty css */
7
- import { MaskedDateInput$u as st } from "./MaskedDateInput.js";
8
- import { Tooltip$u as ut } from "../Tooltip/Tooltip.js";
9
- import { ru$u as dt } from "../../vendor/date-fns/locale/ru.js";
10
- import { toCalendarDay$u as K, isCalendarRangeBlocked$u as be, isCalendarDayBlocked$u as pt } from "../../vanilla/core/dateLimits.js";
7
+ import { MaskedDateInput$u as ut } from "./MaskedDateInput.js";
8
+ import { Tooltip$u as pt } from "../Tooltip/Tooltip.js";
9
+ import { ru$u as mt } from "../../vendor/date-fns/locale/ru.js";
10
+ import { toCalendarDay$u as J, isCalendarRangeBlocked$u as ge, isCalendarDayBlocked$u as ft } from "../../vanilla/core/dateLimits.js";
11
11
  /* empty css */
12
- import { useMountTransition$u as mt } from "../../hooks/useMountTransition.js";
13
- import { POPUP_TRANSITION_MS$u as ft } from "../../shared/popupTransition.js";
14
- import { useAutoId$u as yt } from "../../hooks/useAutoId.js";
15
- import { isCompact$u as vt, sizeClassName$u as bt } from "../../shared/size.js";
16
- import { getPortalScopeProps$u as ht } from "../../shared/uiKitDefaults.js";
17
- import { CalendarSelect$u as he } from "./CalendarSelect.js";
18
- import { resolveValidation$u as gt } from "../../vanilla/core/validation.js";
19
- import { getYear$u as Y } from "../../vendor/date-fns/getYear.js";
20
- import { getMonth$u as kt } from "../../vendor/date-fns/getMonth.js";
21
- import { differenceInCalendarDays$u as ge } from "../../vendor/date-fns/differenceInCalendarDays.js";
22
- import { isSameDay$u as xt } from "../../vendor/date-fns/isSameDay.js";
23
- ct(
12
+ import { useMountTransition$u as yt } from "../../hooks/useMountTransition.js";
13
+ import { POPUP_TRANSITION_MS$u as vt } from "../../shared/popupTransition.js";
14
+ import { useAutoId$u as bt } from "../../hooks/useAutoId.js";
15
+ import { isCompact$u as ht, sizeClassName$u as gt } from "../../shared/size.js";
16
+ import { getUiKitPrefix$u as a, kitCls$u as w, getPortalScopeProps$u as kt } from "../../shared/uiKitDefaults.js";
17
+ import { CalendarSelect$u as ke } from "./CalendarSelect.js";
18
+ import { resolveValidation$u as xt } from "../../vanilla/core/validation.js";
19
+ import { getYear$u as Q } from "../../vendor/date-fns/getYear.js";
20
+ import { getMonth$u as wt } from "../../vendor/date-fns/getMonth.js";
21
+ import { differenceInCalendarDays$u as xe } from "../../vendor/date-fns/differenceInCalendarDays.js";
22
+ import { isSameDay$u as Ct } from "../../vendor/date-fns/isSameDay.js";
23
+ dt(
24
24
  "ru",
25
- dt
25
+ mt
26
26
  );
27
- const g = (s) => {
28
- if (!s) return null;
29
- const d = new Date(s);
30
- return d.setHours(12, 0, 0, 0), d;
27
+ const k = (d) => {
28
+ if (!d) return null;
29
+ const p = new Date(d);
30
+ return p.setHours(12, 0, 0, 0), p;
31
31
  };
32
- function wt(s, d, E = 1) {
32
+ function Dt(d, p, B = 1) {
33
33
  return {
34
34
  *[Symbol.iterator]() {
35
- for (let m = s; m < d; m += E)
36
- yield m;
35
+ for (let f = d; f < p; f += B)
36
+ yield f;
37
37
  }
38
38
  };
39
39
  }
40
- const A = [
40
+ const E = [
41
41
  "Январь",
42
42
  "Февраль",
43
43
  "Март",
@@ -50,179 +50,179 @@ const A = [
50
50
  "Октябрь",
51
51
  "Ноябрь",
52
52
  "Декабрь"
53
- ], Dt = [
54
- ...wt(Y(/* @__PURE__ */ new Date()) - 100, Y(/* @__PURE__ */ new Date()) + 15, 1)
55
- ], ke = at(null), Ct = ({ children: s }) => {
56
- const d = nt(ke);
57
- return d ? it(/* @__PURE__ */ o("div", { children: s }), d) : /* @__PURE__ */ o(tt, { children: s });
58
- }, Yt = ({
59
- "aria-label": s,
60
- "aria-labelledby": d,
61
- "aria-describedby": E,
62
- title: m = "",
63
- selected: $,
64
- onChange: v,
53
+ ], $t = [
54
+ ...Dt(Q(/* @__PURE__ */ new Date()) - 100, Q(/* @__PURE__ */ new Date()) + 15, 1)
55
+ ], we = lt(null), St = ({ children: d }) => {
56
+ const p = at(we);
57
+ return p ? ct(/* @__PURE__ */ o("div", { children: d }), p) : /* @__PURE__ */ o(ot, { children: d });
58
+ }, Qt = ({
59
+ "aria-label": d,
60
+ "aria-labelledby": p,
61
+ "aria-describedby": B,
62
+ title: f = "",
63
+ selected: L,
64
+ onChange: b,
65
65
  range: u = !1,
66
- startDate: J,
67
- endDate: Q,
68
- onRangeChange: B,
69
- isFilter: xe,
70
- placeholder: we,
71
- inline: L,
72
- portalOn: X = !1,
73
- open: Z,
74
- greyIcon: De,
75
- isClearable: x,
76
- setOptionState: U,
77
- tableView: R,
78
- size: ee,
79
- id: Ce,
80
- required: te = !1,
81
- validationText: Se = "Заполните поле",
82
- validationOn: _e,
66
+ startDate: U,
67
+ endDate: X,
68
+ onRangeChange: j,
69
+ isFilter: Ce,
70
+ placeholder: De,
71
+ inline: F,
72
+ portalOn: Z = !1,
73
+ open: R,
74
+ greyIcon: $e,
75
+ isClearable: C,
76
+ setOptionState: ee,
77
+ tableView: te,
78
+ size: re,
79
+ id: Se,
80
+ required: oe = !1,
81
+ validationText: _e = "Заполните поле",
82
+ validationOn: Pe,
83
83
  error: Ie,
84
84
  validationOnWithoutText: Me,
85
- absoluteValidationText: Pe,
86
- lineUp: j = !1,
87
- rowGap: Oe = 4,
88
- columnGap: Ne = 20,
89
- styleInputContainer: Te,
90
- styleTitle: Ae,
91
- disabled: re,
92
- wheelEdit: Ee = !1,
93
- showHint: $e = !1,
94
- hintText: Be = "Используйте колесо мыши или стрелки ↑↓ для изменения значения",
95
- tooltipMaxWidth: Le = 300,
96
- minDate: oe,
97
- maxDate: ne,
98
- excludeDates: w,
99
- allowDisabledInRange: ae = !0
85
+ absoluteValidationText: Oe,
86
+ lineUp: H = !1,
87
+ rowGap: Ne = 4,
88
+ columnGap: Te = 20,
89
+ styleInputContainer: Ae,
90
+ styleTitle: Ee,
91
+ disabled: ne,
92
+ wheelEdit: Be = !1,
93
+ showHint: Le = !1,
94
+ hintText: je = "Используйте колесо мыши или стрелки ↑↓ для изменения значения",
95
+ tooltipMaxWidth: Fe = 300,
96
+ minDate: ie,
97
+ maxDate: ae,
98
+ excludeDates: D,
99
+ allowDisabledInRange: le = !0
100
100
  }) => {
101
- const je = vt(ee, R), Fe = bt(ee, R), D = gt({ error: Ie, validationOn: _e, validationOnWithoutText: Me, validationText: Se }), f = yt(Ce, "u-calendar"), ie = `u-calendar-portal-${f}`, F = ve(null), le = ve(null), [He] = h(
101
+ const He = ht(re, te), qe = gt(re, te), $ = xt({ error: Ie, validationOn: Pe, validationOnWithoutText: Me, validationText: _e }), y = bt(Se, w("calendar")), ce = `${a()}-calendar-portal-${y}`, q = he(null), se = he(null), [ze] = g(
102
102
  () => typeof document > "u" ? null : document.createElement("div")
103
- ), i = X && !L ? He : null, C = rt(f, m, te, D, {
104
- "aria-label": s,
105
- "aria-labelledby": d,
106
- "aria-describedby": E
107
- }), [k, S] = h(!1), {
108
- shouldRender: _,
109
- status: qe,
110
- isAnimated: ze
111
- } = mt({
112
- isOpen: !!(Z || k),
113
- duration: ft
114
- }), We = ze && qe === "exiting";
115
- ot(() => {
116
- if (!i || !_) return;
117
- i.id = ie;
118
- const e = ht()["data-u-kit"];
119
- return e ? i.setAttribute("data-u-kit", e) : i.removeAttribute("data-u-kit"), document.body.appendChild(i), () => i.remove();
120
- }, [i, _, ie]);
121
- const [ce, b] = h(null), [Ge, Ve] = h(!1), [Ke, Ye] = h(!1);
122
- T(() => {
103
+ ), l = Z && !F ? ze : null, S = nt(y, f, oe, $, {
104
+ "aria-label": d,
105
+ "aria-labelledby": p,
106
+ "aria-describedby": B
107
+ }), [x, _] = g(!1), {
108
+ shouldRender: P,
109
+ status: We,
110
+ isAnimated: Ge
111
+ } = yt({
112
+ isOpen: !!(R || x),
113
+ duration: vt
114
+ }), Ke = Ge && We === "exiting";
115
+ it(() => {
116
+ if (!l || !P) return;
117
+ l.id = ce;
118
+ const e = kt()["data-u-kit"];
119
+ return e ? l.setAttribute("data-u-kit", e) : l.removeAttribute("data-u-kit"), document.body.appendChild(l), () => l.remove();
120
+ }, [l, P, ce]);
121
+ const [de, h] = g(null), [Ve, Ye] = g(!1), [Je, Qe] = g(!1);
122
+ A(() => {
123
123
  const e = () => {
124
- Ye(window.innerWidth <= 900);
124
+ Qe(window.innerWidth <= 900);
125
125
  };
126
126
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
127
127
  }, []);
128
- const se = p(() => g($), [$]), ue = (e, t) => {
128
+ const ue = m(() => k(L), [L]), pe = (e, t) => {
129
129
  const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input";
130
130
  if (!e) {
131
- v == null || v("", { source: r });
131
+ b == null || b("", { source: r });
132
132
  return;
133
133
  }
134
- const a = g(e);
135
- v == null || v(a, { source: r });
136
- }, H = p(() => K(oe), [oe]), q = p(() => K(ne), [ne]), z = p(
137
- () => w == null ? void 0 : w.map(K).filter((e) => e !== null),
138
- [w]
139
- ), I = p(
140
- () => ({ minDate: H, maxDate: q, excludeDates: z }),
141
- [H, q, z]
142
- ), de = (e) => pt(e, I), l = p(() => g(J), [J]), c = p(() => g(Q), [Q]), W = u && !ae && l && !c ? l : null, G = p(
143
- () => W ? (e) => !be(W, e, I) : void 0,
144
- [W, I]
145
- ), Je = (e, t) => {
146
- var O;
147
- const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input", [a, y] = e ?? [null, null];
148
- if (!ae && r === "input" && a && y && be(a, y, I)) return;
149
- B == null || B([g(a), g(y)], { source: r }), r === "calendar" && a && y && S(!1);
150
- const P = y ?? a;
151
- r === "input" && P && ((O = le.current) == null || O.setPreSelection(P));
134
+ const i = k(e);
135
+ b == null || b(i, { source: r });
136
+ }, z = m(() => J(ie), [ie]), W = m(() => J(ae), [ae]), G = m(
137
+ () => D == null ? void 0 : D.map(J).filter((e) => e !== null),
138
+ [D]
139
+ ), I = m(
140
+ () => ({ minDate: z, maxDate: W, excludeDates: G }),
141
+ [z, W, G]
142
+ ), me = (e) => ft(e, I), c = m(() => k(U), [U]), s = m(() => k(X), [X]), K = u && !le && c && !s ? c : null, V = m(
143
+ () => K ? (e) => !ge(K, e, I) : void 0,
144
+ [K, I]
145
+ ), Ue = (e, t) => {
146
+ var N;
147
+ const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input", [i, v] = e ?? [null, null];
148
+ if (!le && r === "input" && i && v && ge(i, v, I)) return;
149
+ j == null || j([k(i), k(v)], { source: r }), r === "calendar" && i && v && _(!1);
150
+ const O = v ?? i;
151
+ r === "input" && O && ((N = se.current) == null || N.setPreSelection(O));
152
152
  };
153
- T(() => {
153
+ A(() => {
154
154
  const e = (t) => {
155
- const r = F.current, a = r == null ? void 0 : r.querySelector(":scope > div > div > input");
156
- k && (a && a.focus(), r && !r.contains(t.target) && !(i != null && i.contains(t.target)) && (S(!1), a && a.blur()));
155
+ const r = q.current, i = r == null ? void 0 : r.querySelector(":scope > div > div > input");
156
+ x && (i && i.focus(), r && !r.contains(t.target) && !(l != null && l.contains(t.target)) && (_(!1), i && i.blur()));
157
157
  };
158
158
  return document.addEventListener("click", e), () => {
159
159
  document.removeEventListener("click", e);
160
160
  };
161
- }, [k, i]), T(() => {
161
+ }, [x, l]), A(() => {
162
162
  var e;
163
- if (x) {
164
- const t = ((e = F.current) == null ? void 0 : e.querySelectorAll(".react-datepicker__close-icon")) ?? [];
163
+ if (C) {
164
+ const t = ((e = q.current) == null ? void 0 : e.querySelectorAll(".react-datepicker__close-icon")) ?? [];
165
165
  for (const r of t)
166
- r.innerHTML = '<i class="u-selectbox-select-icon-cross u-calendar-clear-icon"></i>';
166
+ r.innerHTML = `<i class="${a()}-selectbox-select-icon-cross ${a()}-calendar-clear-icon"></i>`;
167
167
  }
168
- }, [$, l == null ? void 0 : l.getTime(), c == null ? void 0 : c.getTime()]);
169
- const pe = (e) => typeof e == "number" ? `calc(${e} * var(--u-preset-unit, 1px))` : String(e), Qe = (e) => typeof e == "number" ? `calc(${e} * var(--u-unit, 1px))` : String(e), me = (e) => {
168
+ }, [L, c == null ? void 0 : c.getTime(), s == null ? void 0 : s.getTime()]);
169
+ const fe = (e) => typeof e == "number" ? `calc(${e} * var(--${a()}-preset-unit, 1px))` : String(e), Xe = (e) => typeof e == "number" ? `calc(${e} * var(--u-unit, 1px))` : String(e), ye = (e) => {
170
170
  const t = e.target;
171
- t.closest(".react-datepicker") && (u || !t.closest(".react-datepicker__day") || t.closest(".react-datepicker__day--disabled")) || S(!k);
172
- }, Xe = u ? {
171
+ t.closest(".react-datepicker") && (u || !t.closest(".react-datepicker__day") || t.closest(".react-datepicker__day--disabled")) || _(!x);
172
+ }, Ze = u ? {
173
173
  selectsRange: !0,
174
174
  // Клик раньше выбранного начала завершает период «кликнутый день — прежнее начало», как и в Vue.
175
175
  swapRange: !0,
176
- startDate: l,
177
- endDate: c,
178
- onChange: (e, t) => Je(e, t)
176
+ startDate: c,
177
+ endDate: s,
178
+ onChange: (e, t) => Ue(e, t)
179
179
  } : {
180
- selected: se,
181
- onChange: (e, t) => ue(e, t)
182
- }, [M, V] = h(null), Ze = (l == null ? void 0 : l.getTime()) ?? null, Ue = (c == null ? void 0 : c.getTime()) ?? null;
183
- T(() => {
184
- V(null);
185
- }, [Ze, Ue, _]);
186
- const Re = (e) => {
187
- if (!l || c) return "";
188
- const t = M === null ? 0 : ge(l, M);
180
+ selected: ue,
181
+ onChange: (e, t) => pe(e, t)
182
+ }, [M, Y] = g(null), Re = (c == null ? void 0 : c.getTime()) ?? null, et = (s == null ? void 0 : s.getTime()) ?? null;
183
+ A(() => {
184
+ Y(null);
185
+ }, [Re, et, P]);
186
+ const tt = (e) => {
187
+ if (!c || s) return "";
188
+ const t = M === null ? 0 : xe(c, M);
189
189
  if (M !== null && t > 0) {
190
- const r = ge(e, M);
190
+ const r = xe(e, M);
191
191
  return r === 0 ? "react-datepicker__day--in-selecting-range react-datepicker__day--selecting-range-start" : r === t ? "react-datepicker__day--in-selecting-range react-datepicker__day--selecting-range-end" : r > 0 && r < t ? "react-datepicker__day--in-selecting-range" : "";
192
192
  }
193
- return xt(e, l) ? "u-calendar-day--range-pending" : "";
194
- }, et = u ? !!(l || c) : !!se, fe = /* @__PURE__ */ o(
195
- lt,
193
+ return Ct(e, c) ? w("calendar-day--range-pending") : "";
194
+ }, rt = u ? !!(c || s) : !!ue, ve = /* @__PURE__ */ o(
195
+ st,
196
196
  {
197
- ref: le,
198
- ariaLabelledBy: C["aria-labelledby"],
199
- ariaDescribedBy: C["aria-describedby"],
200
- ariaInvalid: C["aria-invalid"] ? "true" : void 0,
201
- ariaRequired: C["aria-required"] ? "true" : void 0,
202
- open: L ? Z || k : _,
203
- inline: L,
204
- popperContainer: i ? Ct : void 0,
197
+ ref: se,
198
+ ariaLabelledBy: S["aria-labelledby"],
199
+ ariaDescribedBy: S["aria-describedby"],
200
+ ariaInvalid: S["aria-invalid"] ? "true" : void 0,
201
+ ariaRequired: S["aria-required"] ? "true" : void 0,
202
+ open: F ? R || x : P,
203
+ inline: F,
204
+ popperContainer: l ? St : void 0,
205
205
  popperPlacement: "bottom-end",
206
- popperClassName: [We ? "u-calendar-popper--closing" : "", X ? "u-calendar-popper--portal" : ""].filter(Boolean).join(" ") || void 0,
207
- dayClassName: u ? Re : void 0,
208
- onDayMouseEnter: u ? (e) => V(c || de(e) || G && !G(e) ? null : e.getTime()) : void 0,
209
- onMonthMouseLeave: u ? () => V(null) : void 0,
210
- minDate: H ?? void 0,
211
- maxDate: q ?? void 0,
212
- excludeDates: z,
213
- filterDate: G,
214
- isClearable: x,
206
+ popperClassName: [Ke ? w("calendar-popper--closing") : "", Z ? w("calendar-popper--portal") : ""].filter(Boolean).join(" ") || void 0,
207
+ dayClassName: u ? tt : void 0,
208
+ onDayMouseEnter: u ? (e) => Y(s || me(e) || V && !V(e) ? null : e.getTime()) : void 0,
209
+ onMonthMouseLeave: u ? () => Y(null) : void 0,
210
+ minDate: z ?? void 0,
211
+ maxDate: W ?? void 0,
212
+ excludeDates: G,
213
+ filterDate: V,
214
+ isClearable: C,
215
215
  ariaLabelClose: "Очистить",
216
- disabled: re,
216
+ disabled: ne,
217
217
  renderCustomHeader: ({
218
218
  date: e,
219
219
  changeYear: t,
220
220
  changeMonth: r,
221
- decreaseMonth: a,
222
- increaseMonth: y,
223
- prevMonthButtonDisabled: P,
224
- nextMonthButtonDisabled: O
225
- }) => /* @__PURE__ */ N(
221
+ decreaseMonth: i,
222
+ increaseMonth: v,
223
+ prevMonthButtonDisabled: O,
224
+ nextMonthButtonDisabled: N
225
+ }) => /* @__PURE__ */ T(
226
226
  "div",
227
227
  {
228
228
  style: {
@@ -240,7 +240,7 @@ const A = [
240
240
  {
241
241
  style: {
242
242
  width: "calc(25 * var(--u-unit, 1px))",
243
- color: "var(--u-color-primary, #1E4391)",
243
+ color: `var(--${a()}-color-primary, #1E4391)`,
244
244
  display: "flex",
245
245
  // Без внутреннего отступа: стрелка прижата к краю карточки,
246
246
  // а не поджата к году и месяцу.
@@ -248,13 +248,13 @@ const A = [
248
248
  cursor: "pointer"
249
249
  },
250
250
  onClick: (n) => {
251
- n.preventDefault(), n.stopPropagation(), b(null), a();
251
+ n.preventDefault(), n.stopPropagation(), h(null), i();
252
252
  },
253
- disabled: P,
254
- children: /* @__PURE__ */ o("i", { className: "u-icon icon-left", style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
253
+ disabled: O,
254
+ children: /* @__PURE__ */ o("i", { className: `${a()}-icon icon-left`, style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
255
255
  }
256
256
  ),
257
- /* @__PURE__ */ N(
257
+ /* @__PURE__ */ T(
258
258
  "div",
259
259
  {
260
260
  style: {
@@ -266,32 +266,32 @@ const A = [
266
266
  },
267
267
  children: [
268
268
  /* @__PURE__ */ o(
269
- he,
269
+ ke,
270
270
  {
271
- value: Y(e),
272
- options: Dt.map((n) => ({ value: n, label: n })),
271
+ value: Q(e),
272
+ options: $t.map((n) => ({ value: n, label: n })),
273
273
  onChange: (n) => t(Number(n)),
274
274
  fallbackValue: (/* @__PURE__ */ new Date()).getFullYear(),
275
275
  width: 45,
276
- isOpen: ce === "year",
277
- onOpen: () => b("year"),
278
- onClose: () => b(null)
276
+ isOpen: de === "year",
277
+ onOpen: () => h("year"),
278
+ onClose: () => h(null)
279
279
  }
280
280
  ),
281
281
  /* @__PURE__ */ o(
282
- he,
282
+ ke,
283
283
  {
284
- value: A[kt(e)],
285
- options: A.map((n) => ({ value: n, label: n })),
284
+ value: E[wt(e)],
285
+ options: E.map((n) => ({ value: n, label: n })),
286
286
  onChange: (n) => {
287
- const ye = String(n);
288
- r(A.indexOf(ye)), U && U(ye);
287
+ const be = String(n);
288
+ r(E.indexOf(be)), ee && ee(be);
289
289
  },
290
- fallbackValue: A[(/* @__PURE__ */ new Date()).getMonth()],
290
+ fallbackValue: E[(/* @__PURE__ */ new Date()).getMonth()],
291
291
  width: 85,
292
- isOpen: ce === "month",
293
- onOpen: () => b("month"),
294
- onClose: () => b(null)
292
+ isOpen: de === "month",
293
+ onOpen: () => h("month"),
294
+ onClose: () => h(null)
295
295
  }
296
296
  )
297
297
  ]
@@ -302,114 +302,114 @@ const A = [
302
302
  {
303
303
  style: {
304
304
  width: "calc(25 * var(--u-unit, 1px))",
305
- color: "var(--u-color-primary, #1E4391)",
305
+ color: `var(--${a()}-color-primary, #1E4391)`,
306
306
  display: "flex",
307
307
  justifyContent: "flex-end",
308
308
  padding: 0,
309
309
  cursor: "pointer"
310
310
  },
311
311
  onClick: (n) => {
312
- n.preventDefault(), n.stopPropagation(), b(null), y();
312
+ n.preventDefault(), n.stopPropagation(), h(null), v();
313
313
  },
314
- disabled: O,
315
- children: /* @__PURE__ */ o("i", { className: "u-icon icon-right", style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
314
+ disabled: N,
315
+ children: /* @__PURE__ */ o("i", { className: `${a()}-icon icon-right`, style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
316
316
  }
317
317
  )
318
318
  ]
319
319
  }
320
320
  ),
321
- placeholderText: we ?? (u ? "Выберите период" : "Выберите дату"),
321
+ placeholderText: De ?? (u ? "Выберите период" : "Выберите дату"),
322
322
  customInput: /* @__PURE__ */ o(
323
- st,
323
+ ut,
324
324
  {
325
- "aria-label": s,
326
- id: `custom-input-mask-${f}`,
327
- isClearable: x,
325
+ "aria-label": d,
326
+ id: `custom-input-mask-${y}`,
327
+ isClearable: C,
328
328
  range: u,
329
- wheelEdit: Ee && !u,
329
+ wheelEdit: Be && !u,
330
330
  onWheelDate: (e) => {
331
- de(e) || ue(e);
331
+ me(e) || pe(e);
332
332
  },
333
- onOpenCalendar: () => S(!0),
334
- onFocusChange: Ve
333
+ onOpenCalendar: () => _(!0),
334
+ onFocusChange: Ye
335
335
  }
336
336
  ),
337
- ...Xe,
337
+ ...Ze,
338
338
  strictParsing: !0,
339
339
  locale: "ru",
340
- className: (xe ? "custom-input dpc-filter custom-input-filter" : je ? "custom-input dpc-table custom-input-table" : `${De ? "dpc-grey" : "dpc"} custom-input`) + (D.hasError ? " u-input-required" : "") + // react-datepicker рисует крестик и у disabled-поля — отступ под него тоже есть, как во Vue.
341
- (x && et ? " dpc--clearable" : ""),
340
+ className: (Ce ? "custom-input dpc-filter custom-input-filter" : He ? "custom-input dpc-table custom-input-table" : `${$e ? "dpc-grey" : "dpc"} custom-input`) + ($.hasError ? ` ${a()}-input-required` : "") + // react-datepicker рисует крестик и у disabled-поля — отступ под него тоже есть, как во Vue.
341
+ (C && rt ? " dpc--clearable" : ""),
342
342
  dateFormat: "dd.MM.yyyy"
343
343
  }
344
344
  );
345
- return /* @__PURE__ */ o(ke.Provider, { value: i, children: /* @__PURE__ */ N(
345
+ return /* @__PURE__ */ o(we.Provider, { value: l, children: /* @__PURE__ */ T(
346
346
  "div",
347
347
  {
348
- ref: F,
349
- id: `u-datepicker${f}`,
350
- className: Fe || void 0,
351
- style: { display: "flex", flexDirection: "column", rowGap: "calc(4 * var(--u-preset-unit, 1px))" },
348
+ ref: q,
349
+ id: `${a()}-datepicker${y}`,
350
+ className: qe || void 0,
351
+ style: { display: "flex", flexDirection: "column", rowGap: `calc(4 * var(--${a()}-preset-unit, 1px))` },
352
352
  children: [
353
- /* @__PURE__ */ N(
353
+ /* @__PURE__ */ T(
354
354
  "div",
355
355
  {
356
356
  style: Object.assign(
357
357
  {
358
358
  display: "flex",
359
- flexDirection: j ? "row" : "column",
360
- rowGap: j ? null : pe(Oe),
361
- columnGap: j ? pe(Ne) : null
359
+ flexDirection: H ? "row" : "column",
360
+ rowGap: H ? null : fe(Ne),
361
+ columnGap: H ? fe(Te) : null
362
362
  },
363
- Te
363
+ Ae
364
364
  ),
365
365
  children: [
366
- m && /* @__PURE__ */ o(
366
+ f && /* @__PURE__ */ o(
367
367
  "div",
368
368
  {
369
- id: `${f}-label`,
370
- className: `${te ? "u-required" : ""} u-react-input-title`,
369
+ id: `${y}-label`,
370
+ className: `${oe ? w("required") : ""} ${a()}-react-input-title`,
371
371
  style: Object.assign(
372
372
  {
373
- color: "var(--u-field-title-color, #545454)",
374
- fontSize: "var(--u-field-label-size-main, calc(14 * var(--u-unit, 1px)))"
373
+ color: `var(--${a()}-field-title-color, #545454)`,
374
+ fontSize: `var(--${a()}-field-label-size-main, calc(14 * var(--u-unit, 1px)))`
375
375
  },
376
- Ae
376
+ Ee
377
377
  ),
378
- children: m
378
+ children: f
379
379
  }
380
380
  ),
381
- $e ? /* @__PURE__ */ o(
382
- ut,
381
+ Le ? /* @__PURE__ */ o(
382
+ pt,
383
383
  {
384
384
  portalOn: !0,
385
- id: `calendar-hint-${f || "default"}`,
385
+ id: `calendar-hint-${y || "default"}`,
386
386
  position: "top",
387
- isActive: Ge && !re && !Ke,
387
+ isActive: Ve && !ne && !Je,
388
388
  showWhenActive: !0,
389
389
  tooltipStyle: {
390
- maxWidth: Qe(Le),
390
+ maxWidth: Xe(Fe),
391
391
  width: "auto",
392
392
  whiteSpace: "normal",
393
393
  overflowWrap: "break-word"
394
394
  },
395
- tooltipText: Be,
396
- children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: me, children: fe })
395
+ tooltipText: je,
396
+ children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: ye, children: ve })
397
397
  }
398
- ) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: me, children: fe })
398
+ ) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: ye, children: ve })
399
399
  ]
400
400
  }
401
401
  ),
402
- D.showText && /* @__PURE__ */ o(
402
+ $.showText && /* @__PURE__ */ o(
403
403
  "h5",
404
404
  {
405
- id: `${f}-error`,
405
+ id: `${y}-error`,
406
406
  className: "h5 clr-red-main",
407
- style: Pe ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative" },
408
- children: D.text
407
+ style: Oe ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative" },
408
+ children: $.text
409
409
  }
410
410
  )
411
411
  ]
412
412
  }
413
413
  ) });
414
414
  };
415
- export { Yt as Calendar$u };
415
+ export { Qt as Calendar$u };
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarSelect.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarSelect.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEjD,2EAA2E;AAC3E,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnC,KAAK,MAAM,GAAG;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAEzD,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE;QAAE,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,CAAC,gBAAgB,CAAC,CAAC;IACzE,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,8EAS5B,KAAK,4CA2JP,CAAC"}
1
+ {"version":3,"file":"CalendarSelect.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarSelect.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEjD,2EAA2E;AAC3E,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnC,KAAK,MAAM,GAAG;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAEzD,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE;QAAE,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,CAAC,gBAAgB,CAAC,CAAC;IACzE,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,8EAS5B,KAAK,4CA2JP,CAAC"}