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