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,316 +1,316 @@
1
- import { jsxs as x, jsx as o, Fragment as Le } from "react/jsx-runtime";
2
- import { getFieldAccessibility$u as Be } from "../../shared/fieldAccessibility.js";
3
- import { useState as z, useRef as k, useMemo as le, useEffect as Ie } from "react";
1
+ import { jsxs as b, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
+ import { getFieldAccessibility$u as We } from "../../shared/fieldAccessibility.js";
3
+ import { useState as M, useRef as w, useMemo as re, useEffect as _e } from "react";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
- import { createPortal as We } from "react-dom";
10
- import _e from "../../hooks/useDebounce.js";
11
- import { useSelectEngine$u as Ge } from "../../hooks/useSelectEngine.js";
12
- import { OPTION_STATE_COLORS$u as ce } from "../../shared/optionStateColors.js";
13
- import { isSameOptionValue$u as h, getOptionKeys$u as Ye } from "../../shared/optionValue.js";
14
- import { getPopupTransitionStyle$u as re } from "../../shared/popupTransition.js";
15
- import { sizeClassName$u as Je, isCompact$u as Qe } from "../../shared/size.js";
16
- import { useMobilePicker$u as Ue } from "../../hooks/useMobilePicker.js";
17
- import { MobileOptionSheet$u as Xe } from "../Select/MobileOptionSheet.js";
18
- import { getPortalScopeProps$u as Ze } from "../../shared/uiKitDefaults.js";
19
- import { resolveValidation$u as qe } from "../../vanilla/core/validation.js";
20
- import { resolveSheetTitle$u as Ve } from "../../vanilla/core/sheetTitle.js";
21
- const yt = ({
22
- "aria-label": C,
23
- "aria-labelledby": M,
24
- "aria-describedby": se,
25
- title: y = "",
26
- required: E = !1,
27
- options: w,
28
- styleSelectContainer: ne,
29
- styleTitle: ae,
30
- styleSelect: A,
31
- lineUp: ue = !1,
32
- placeholder: K = "Не выбрано",
33
- values: i,
34
- setValues: O,
35
- isClearable: me = !1,
36
- className: pe,
37
- tableView: F = !1,
38
- size: L,
39
- validationText: de = "Заполните поле",
40
- validationOn: B,
41
- error: fe,
42
- absoluteValidationText: xe,
43
- disabled: l,
44
- portalOn: he,
45
- isSearchable: n,
46
- onInputChange: b,
47
- loading: g,
48
- inputValue: v = "",
49
- onInputValueChange: a,
50
- noScroll: R,
51
- id: be,
52
- mobilePicker: ge
9
+ import { createPortal as Ge } from "react-dom";
10
+ import Ue from "../../hooks/useDebounce.js";
11
+ import { useSelectEngine$u as Ye } from "../../hooks/useSelectEngine.js";
12
+ import { OPTION_STATE_COLORS$u as se } from "../../shared/optionStateColors.js";
13
+ import { isSameOptionValue$u as g, getOptionKeys$u as Je } from "../../shared/optionValue.js";
14
+ import { getPopupTransitionStyle$u as ne } from "../../shared/popupTransition.js";
15
+ import { sizeClassName$u as Qe, isCompact$u as Xe } from "../../shared/size.js";
16
+ import { useMobilePicker$u as Ze } from "../../hooks/useMobilePicker.js";
17
+ import { MobileOptionSheet$u as qe } from "../Select/MobileOptionSheet.js";
18
+ import { getUiKitPrefix$u as o, kitCls$u as c, kitClasses$u as Ve, getPortalScopeProps$u as et } from "../../shared/uiKitDefaults.js";
19
+ import { resolveValidation$u as tt } from "../../vanilla/core/validation.js";
20
+ import { resolveSheetTitle$u as ot } from "../../vanilla/core/sheetTitle.js";
21
+ const St = ({
22
+ "aria-label": E,
23
+ "aria-labelledby": K,
24
+ "aria-describedby": ae,
25
+ title: O = "",
26
+ required: A = !1,
27
+ options: R,
28
+ styleSelectContainer: me,
29
+ styleTitle: pe,
30
+ styleSelect: F,
31
+ lineUp: de = !1,
32
+ placeholder: L = "Не выбрано",
33
+ values: l,
34
+ setValues: S,
35
+ isClearable: ue = !1,
36
+ className: fe,
37
+ tableView: B = !1,
38
+ size: I,
39
+ validationText: xe = "Заполните поле",
40
+ validationOn: W,
41
+ error: he,
42
+ absoluteValidationText: be,
43
+ disabled: r,
44
+ portalOn: ge,
45
+ isSearchable: m,
46
+ onInputChange: v,
47
+ loading: y,
48
+ inputValue: $ = "",
49
+ onInputValueChange: p,
50
+ noScroll: P,
51
+ id: ve,
52
+ mobilePicker: ye
53
53
  }) => {
54
- const s = Qe(L, F), I = Je(L, F), P = qe({ error: fe, validationOn: B, validationText: de }), [H, W] = z(""), S = k(null), _ = _e(H, 300), m = le(() => w.filter((e) => (e.label ?? "").toLowerCase().includes((_ || "").toLowerCase())), [_, w]), G = m.findIndex(
55
- (e) => i.some((t) => h(t == null ? void 0 : t.value, e == null ? void 0 : e.value))
56
- ), u = Ge({
57
- optionsLength: m.length,
58
- initialIndex: Math.max(0, G),
59
- selectedIndex: G,
60
- disabled: l,
61
- portalOn: he,
62
- loading: g,
63
- id: be,
64
- idPrefix: "u-multiselect",
54
+ const a = Xe(I, B), _ = Qe(I, B), H = tt({ error: he, validationOn: W, validationText: xe }), [j, G] = M(""), k = w(null), U = Ue(j, 300), u = re(() => R.filter((e) => (e.label ?? "").toLowerCase().includes((U || "").toLowerCase())), [U, R]), Y = u.findIndex(
55
+ (e) => l.some((t) => g(t == null ? void 0 : t.value, e == null ? void 0 : e.value))
56
+ ), d = Ye({
57
+ optionsLength: u.length,
58
+ initialIndex: Math.max(0, Y),
59
+ selectedIndex: Y,
60
+ disabled: r,
61
+ portalOn: ge,
62
+ loading: y,
63
+ id: ve,
64
+ idPrefix: c("multiselect"),
65
65
  getPortalPosition: (e) => ({ x: e.x, y: e.y + 60 + e.height + e.scrollY }),
66
66
  // Поле растёт от чипов: строке варианта нужна его базовая высота, а не текущая.
67
67
  measureFieldHeight: (e) => {
68
- const t = Number.parseFloat(getComputedStyle(e).minHeight), r = e.getBoundingClientRect().height;
69
- return t > 0 ? Math.min(t, r) : r;
68
+ const t = Number.parseFloat(getComputedStyle(e).minHeight), n = e.getBoundingClientRect().height;
69
+ return t > 0 ? Math.min(t, n) : n;
70
70
  },
71
71
  onSelectByIndex: (e) => {
72
- const t = m[e];
73
- t && Z.current(t);
72
+ const t = u[e];
73
+ t && V.current(t);
74
74
  }
75
75
  }), {
76
- isOpen: f,
77
- blockRef: Y,
78
- portalOptionsRef: ve,
79
- optionsListRef: ye,
80
- listboxId: p,
81
- activeDescendantId: Oe,
82
- activeIndex: Se,
76
+ isOpen: h,
77
+ blockRef: J,
78
+ portalOptionsRef: $e,
79
+ optionsListRef: Oe,
80
+ listboxId: f,
81
+ activeDescendantId: Se,
82
+ activeIndex: ke,
83
83
  hoveredIndex: Ne,
84
- setHoveredIndex: J,
85
- handleKeyDown: Q,
86
- shouldRenderPortal: ke,
87
- portalStatus: we,
88
- shouldRenderLocal: Re,
89
- localStatus: Pe,
90
- isAnimated: U,
91
- portalWidth: He,
92
- usePortal: X
93
- } = u, d = u.portalPosition, je = Be(p, y, E, P, {
94
- "aria-label": C,
95
- "aria-labelledby": M,
96
- "aria-describedby": se
84
+ setHoveredIndex: Q,
85
+ handleKeyDown: X,
86
+ shouldRenderPortal: we,
87
+ portalStatus: Re,
88
+ shouldRenderLocal: Pe,
89
+ localStatus: He,
90
+ isAnimated: Z,
91
+ portalWidth: je,
92
+ usePortal: q
93
+ } = d, x = d.portalPosition, Ce = We(f, O, A, H, {
94
+ "aria-label": E,
95
+ "aria-labelledby": K,
96
+ "aria-describedby": ae
97
97
  }), N = (e) => {
98
98
  var t;
99
- l || (i.some((r) => h(r.value, e.value)) ? O(i.filter((r) => !h(r.value, e.value))) : O([...i, e]), n && (W(""), (t = S.current) == null || t.focus()), n && a && a(""));
100
- }, Z = k(N);
101
- Z.current = N;
99
+ r || (l.some((n) => g(n.value, e.value)) ? S(l.filter((n) => !g(n.value, e.value))) : S([...l, e]), m && (G(""), (t = k.current) == null || t.focus()), m && p && p(""));
100
+ }, V = w(N);
101
+ V.current = N;
102
102
  const De = (e) => {
103
- l || O(i.filter((t) => !h(t.value, e.value)));
104
- }, q = k(null), V = me && !l && (i == null ? void 0 : i.length) > 0, $e = () => {
105
- if (l) return;
106
- O([]), u.close();
107
- const e = n && !c ? S.current : q.current;
103
+ r || S(l.filter((t) => !g(t.value, e.value)));
104
+ }, ee = w(null), te = ue && !r && (l == null ? void 0 : l.length) > 0, Te = () => {
105
+ if (r) return;
106
+ S([]), d.close();
107
+ const e = m && !s ? k.current : ee.current;
108
108
  e == null || e.focus();
109
- }, j = typeof v == "string" && typeof a == "function", Te = j ? v : H, ze = (e) => {
110
- l || (j ? a && a(e.target.value) : W(e.target.value), b && b(e.target.value));
111
- }, Ce = le(() => Ye(m), [m]), c = Ue(ge), [ee, D] = z(!1), [Me, Ee] = z(""), te = k(u.close);
112
- te.current = u.close, Ie(() => {
113
- c ? te.current() : D(!1);
114
- }, [c]);
115
- const oe = () => {
116
- l || (Ee(Ve(Y.current, { title: y, ariaLabel: C, ariaLabelledBy: M, placeholder: K })), D(!0));
117
- }, Ae = (e) => {
118
- e.key !== "Enter" && e.key !== " " && e.key !== "ArrowDown" || (e.preventDefault(), oe());
119
- }, Ke = (e) => {
120
- j && (a == null || a(e)), b == null || b(e);
121
- }, ie = (e, t, r) => {
122
- const $ = i.some((T) => h(T.value, e.value)), Fe = Ne === t || Se === t;
123
- return /* @__PURE__ */ o(
109
+ }, C = typeof $ == "string" && typeof p == "function", ze = C ? $ : j, Me = (e) => {
110
+ r || (C ? p && p(e.target.value) : G(e.target.value), v && v(e.target.value));
111
+ }, Ee = re(() => Je(u), [u]), s = Ze(ye), [oe, D] = M(!1), [Ke, Ae] = M(""), ie = w(d.close);
112
+ ie.current = d.close, _e(() => {
113
+ s ? ie.current() : D(!1);
114
+ }, [s]);
115
+ const le = () => {
116
+ r || (Ae(ot(J.current, { title: O, ariaLabel: E, ariaLabelledBy: K, placeholder: L }, o())), D(!0));
117
+ }, Fe = (e) => {
118
+ e.key !== "Enter" && e.key !== " " && e.key !== "ArrowDown" || (e.preventDefault(), le());
119
+ }, Le = (e) => {
120
+ C && (p == null || p(e)), v == null || v(e);
121
+ }, ce = (e, t, n) => {
122
+ const T = l.some((z) => g(z.value, e.value)), Be = Ne === t || ke === t;
123
+ return /* @__PURE__ */ i(
124
124
  "div",
125
125
  {
126
- className: "u-multiselectbox-option",
126
+ className: c("multiselectbox-option"),
127
127
  "data-option-index": t,
128
- id: `${p}-option-${t}`,
128
+ id: `${f}-option-${t}`,
129
129
  role: "option",
130
- "aria-selected": $,
130
+ "aria-selected": T,
131
131
  style: Object.assign(
132
132
  {},
133
- s ? {
133
+ a ? {
134
134
  // Плотное поле — 43, а строка была 37: держим её не ниже поля
135
135
  // и центрируем текст по вертикали.
136
- minHeight: "var(--u-option-min-height, var(--u-compact-height))",
136
+ minHeight: `var(--${o()}-option-min-height, var(--${o()}-compact-height))`,
137
137
  display: "flex",
138
138
  alignItems: "center",
139
- fontSize: "var(--u-compact-font-size)",
139
+ fontSize: `var(--${o()}-compact-font-size)`,
140
140
  lineHeight: 1.6667,
141
141
  padding: "calc(8 * var(--u-unit, 1px)) calc(5 * var(--u-unit, 1px))"
142
142
  } : null,
143
- $ ? { backgroundColor: ce.selectedBackground } : Fe ? { backgroundColor: ce.hoveredBackground } : null,
144
- r && R ? {
143
+ T ? { backgroundColor: se.selectedBackground } : Be ? { backgroundColor: se.hoveredBackground } : null,
144
+ n && P ? {
145
145
  maxHeight: "none"
146
146
  } : null,
147
- A
147
+ F
148
148
  ),
149
- onMouseEnter: () => J(t),
150
- onMouseLeave: () => J(null),
151
- children: /* @__PURE__ */ x(
149
+ onMouseEnter: () => Q(t),
150
+ onMouseLeave: () => Q(null),
151
+ children: /* @__PURE__ */ b(
152
152
  "label",
153
153
  {
154
- className: "u-multiselectbox-option-checkbox",
155
- style: s ? {
154
+ className: c("multiselectbox-option-checkbox"),
155
+ style: a ? {
156
156
  // Строка плотного варианта — flex: без растяжения метка сжималась
157
157
  // до ширины текста, и клик по правой части строки не отмечал вариант.
158
158
  flex: 1,
159
159
  minHeight: 0,
160
160
  padding: 0,
161
161
  lineHeight: "calc(20 * var(--u-unit, 1px))",
162
- color: "var(--u-option-color, #222222)"
163
- } : { color: "var(--u-option-color, #222222)" },
162
+ color: `var(--${o()}-option-color, #222222)`
163
+ } : { color: `var(--${o()}-option-color, #222222)` },
164
164
  children: [
165
- /* @__PURE__ */ o(
165
+ /* @__PURE__ */ i(
166
166
  "input",
167
167
  {
168
168
  type: "checkbox",
169
- checked: $,
170
- onChange: (T) => {
171
- T.stopPropagation(), N(e);
169
+ checked: T,
170
+ onChange: (z) => {
171
+ z.stopPropagation(), N(e);
172
172
  }
173
173
  }
174
174
  ),
175
- /* @__PURE__ */ o("div", { style: s ? { marginRight: "calc(8 * var(--u-unit, 1px))" } : null }),
175
+ /* @__PURE__ */ i("div", { style: a ? { marginRight: "calc(8 * var(--u-unit, 1px))" } : null }),
176
176
  e.label
177
177
  ]
178
178
  }
179
179
  )
180
180
  },
181
- Ce[t]
181
+ Ee[t]
182
182
  );
183
183
  };
184
- return /* @__PURE__ */ x(
184
+ return /* @__PURE__ */ b(
185
185
  "div",
186
186
  {
187
- className: `u-react-multiselect-container${I ? ` ${I}` : ""} ${pe ?? ""}`,
187
+ className: `${o()}-react-multiselect-container${_ ? ` ${_}` : ""} ${fe ?? ""}`,
188
188
  children: [
189
- /* @__PURE__ */ x(
189
+ /* @__PURE__ */ b(
190
190
  "div",
191
191
  {
192
192
  style: Object.assign(
193
193
  {
194
194
  display: "flex",
195
- gap: "calc(4 * var(--u-preset-unit, 1px))",
196
- flexDirection: ue ? "row" : "column"
195
+ gap: `calc(4 * var(--${o()}-preset-unit, 1px))`,
196
+ flexDirection: de ? "row" : "column"
197
197
  },
198
- ne
198
+ me
199
199
  ),
200
200
  children: [
201
- y && /* @__PURE__ */ o(
201
+ O && /* @__PURE__ */ i(
202
202
  "div",
203
203
  {
204
- id: `${p}-label`,
205
- className: `${E ? "u-required" : ""} u-react-select-title`,
204
+ id: `${f}-label`,
205
+ className: `${A ? c("required") : ""} ${o()}-react-select-title`,
206
206
  style: Object.assign(
207
207
  {
208
- color: "var(--u-field-title-color, #545454)",
209
- fontSize: "var(--u-field-label-size-main, calc(14 * var(--u-unit, 1px)))"
208
+ color: `var(--${o()}-field-title-color, #545454)`,
209
+ fontSize: `var(--${o()}-field-label-size-main, calc(14 * var(--u-unit, 1px)))`
210
210
  },
211
- ae
211
+ pe
212
212
  ),
213
- children: y
213
+ children: O
214
214
  }
215
215
  ),
216
- /* @__PURE__ */ x(
216
+ /* @__PURE__ */ b(
217
217
  "div",
218
218
  {
219
- className: `u-multiselectbox${l ? " u-multiselectbox-disabled" : ""} u-react-multiselect`,
220
- ref: Y,
219
+ className: `${o()}-multiselectbox${r ? ` ${o()}-multiselectbox-disabled` : ""} ${o()}-react-multiselect`,
220
+ ref: J,
221
221
  style: Object.assign(
222
222
  {
223
223
  width: "100%"
224
224
  },
225
- A
225
+ F
226
226
  ),
227
227
  children: [
228
- /* @__PURE__ */ x(
228
+ /* @__PURE__ */ b(
229
229
  "div",
230
230
  {
231
- ref: q,
232
- className: f ? "u-multiselectbox-select u-multiselectbox-select-open" : "u-multiselectbox-select",
233
- tabIndex: n && !c || l ? -1 : 0,
231
+ ref: ee,
232
+ className: h ? Ve("multiselectbox-select", "multiselectbox-select-open") : c("multiselectbox-select"),
233
+ tabIndex: m && !s || r ? -1 : 0,
234
234
  role: "combobox",
235
- ...je,
236
- "aria-expanded": c ? ee : f,
237
- "aria-haspopup": c ? "dialog" : "listbox",
238
- "aria-controls": c ? void 0 : p,
239
- "aria-disabled": l || void 0,
240
- "aria-activedescendant": c ? void 0 : Oe,
241
- onKeyDown: c ? Ae : n ? void 0 : Q,
235
+ ...Ce,
236
+ "aria-expanded": s ? oe : h,
237
+ "aria-haspopup": s ? "dialog" : "listbox",
238
+ "aria-controls": s ? void 0 : f,
239
+ "aria-disabled": r || void 0,
240
+ "aria-activedescendant": s ? void 0 : Se,
241
+ onKeyDown: s ? Fe : m ? void 0 : X,
242
242
  onClick: (e) => {
243
243
  var t;
244
- if (c) {
245
- oe();
244
+ if (s) {
245
+ le();
246
246
  return;
247
247
  }
248
- !f && n && !l && ((t = S.current) == null || t.focus()), u.toggle(e.currentTarget);
248
+ !h && m && !r && ((t = k.current) == null || t.focus()), d.toggle(e.currentTarget);
249
249
  },
250
250
  style: Object.assign(
251
- s ? {
251
+ a ? {
252
252
  padding: "calc(6 * var(--u-unit, 1px)) calc(28 * var(--u-unit, 1px)) calc(5 * var(--u-unit, 1px)) calc(10 * var(--u-unit, 1px))",
253
253
  gridRowGap: "calc(4 * var(--u-unit, 1px))",
254
254
  borderRadius: "calc(8 * var(--u-unit, 1px))",
255
255
  minHeight: "calc(43 * var(--u-unit, 1px))"
256
256
  } : {},
257
257
  // Плотному полю справа хватало места только под стрелку — крестику нужен свой резерв.
258
- s && V ? { paddingRight: "calc(56 * var(--u-unit, 1px))" } : {},
259
- B && { border: "1px solid var(--u-color-error, #EF302B)" }
258
+ a && te ? { paddingRight: "calc(56 * var(--u-unit, 1px))" } : {},
259
+ W && { border: `1px solid var(--${o()}-color-error, #EF302B)` }
260
260
  ),
261
261
  children: [
262
- (i == null ? void 0 : i.length) <= 0 && H.length === 0 && (v == null ? void 0 : v.length) === 0 ? /* @__PURE__ */ o(
262
+ (l == null ? void 0 : l.length) <= 0 && j.length === 0 && ($ == null ? void 0 : $.length) === 0 ? /* @__PURE__ */ i(
263
263
  "span",
264
264
  {
265
265
  style: Object.assign(
266
- { color: "var(--u-field-title-color, #545454)" },
267
- s ? { fontSize: "var(--u-compact-font-size)" } : {}
266
+ { color: `var(--${o()}-field-title-color, #545454)` },
267
+ a ? { fontSize: `var(--${o()}-compact-font-size)` } : {}
268
268
  ),
269
- className: "u-multiselectbox-select-label",
270
- children: K
269
+ className: c("multiselectbox-select-label"),
270
+ children: L
271
271
  }
272
- ) : /* @__PURE__ */ o(Le, {}),
273
- i == null ? void 0 : i.map((e, t) => /* @__PURE__ */ o("div", { className: "u-multiselectbox-select-item-wrapper", children: /* @__PURE__ */ x("div", { className: `u-multiselectbox-select-item-container${s ? " u-multiselectbox-select-item-container--compact" : ""}`, children: [
274
- /* @__PURE__ */ o("span", { className: "u-multiselectbox-select-item", children: e.label }),
275
- /* @__PURE__ */ o("div", { className: "u-multiselectbox-select-cross", onClick: (r) => {
276
- r.stopPropagation(), De(e);
272
+ ) : /* @__PURE__ */ i(Ie, {}),
273
+ l == null ? void 0 : l.map((e, t) => /* @__PURE__ */ i("div", { className: c("multiselectbox-select-item-wrapper"), children: /* @__PURE__ */ b("div", { className: `${o()}-multiselectbox-select-item-container${a ? ` ${o()}-multiselectbox-select-item-container--compact` : ""}`, children: [
274
+ /* @__PURE__ */ i("span", { className: c("multiselectbox-select-item"), children: e.label }),
275
+ /* @__PURE__ */ i("div", { className: c("multiselectbox-select-cross"), onClick: (n) => {
276
+ n.stopPropagation(), De(e);
277
277
  } })
278
278
  ] }) }, t)),
279
- n && !c && /* @__PURE__ */ o(
279
+ m && !s && /* @__PURE__ */ i(
280
280
  "input",
281
281
  {
282
- ref: S,
283
- className: "u-multiselectbox-search",
284
- disabled: l,
285
- "aria-disabled": l || void 0,
286
- value: Te,
287
- onChange: ze,
282
+ ref: k,
283
+ className: c("multiselectbox-search"),
284
+ disabled: r,
285
+ "aria-disabled": r || void 0,
286
+ value: ze,
287
+ onChange: Me,
288
288
  onClick: (e) => {
289
- f && e.stopPropagation();
289
+ h && e.stopPropagation();
290
290
  },
291
- onKeyDown: Q
291
+ onKeyDown: X
292
292
  }
293
293
  ),
294
- V ? /* @__PURE__ */ o(
294
+ te ? /* @__PURE__ */ i(
295
295
  "i",
296
296
  {
297
- className: `u-selectbox-select-icon-cross u-multiselectbox-clear${s ? " u-multiselectbox-clear--compact" : ""}`,
297
+ className: `${o()}-selectbox-select-icon-cross ${o()}-multiselectbox-clear${a ? ` ${o()}-multiselectbox-clear--compact` : ""}`,
298
298
  role: "button",
299
299
  "aria-label": "Очистить",
300
300
  onClick: (e) => {
301
- e.stopPropagation(), $e();
301
+ e.stopPropagation(), Te();
302
302
  }
303
303
  }
304
304
  ) : null,
305
- /* @__PURE__ */ o(
305
+ /* @__PURE__ */ i(
306
306
  "i",
307
307
  {
308
- className: "u-multiselectbox-select-icon-arrow",
308
+ className: c("multiselectbox-select-icon-arrow"),
309
309
  style: Object.assign(
310
- f ? {
310
+ h ? {
311
311
  transform: "rotate(180deg)"
312
312
  } : {},
313
- s ? {
313
+ a ? {
314
314
  top: "calc(15 * var(--u-unit, 1px))"
315
315
  } : {}
316
316
  )
@@ -319,61 +319,61 @@ const yt = ({
319
319
  ]
320
320
  }
321
321
  ),
322
- f && g ? /* @__PURE__ */ o("div", { className: "u-multiselectbox-options", style: { textAlign: "center", padding: "calc(16 * var(--u-unit, 1px))" }, children: /* @__PURE__ */ o("span", { className: "u-multiselectbox-loading", children: "Загрузка..." }) }) : null,
323
- !g && X && ke && d && We(
324
- /* @__PURE__ */ o(
322
+ h && y ? /* @__PURE__ */ i("div", { className: c("multiselectbox-options"), style: { textAlign: "center", padding: "calc(16 * var(--u-unit, 1px))" }, children: /* @__PURE__ */ i("span", { className: c("multiselectbox-loading"), children: "Загрузка..." }) }) : null,
323
+ !y && q && we && x && Ge(
324
+ /* @__PURE__ */ i(
325
325
  "div",
326
326
  {
327
- className: "u-multiselectbox-options",
328
- ref: ve,
329
- ...Ze(),
330
- id: p,
327
+ className: c("multiselectbox-options"),
328
+ ref: $e,
329
+ ...et(),
330
+ id: f,
331
331
  role: "listbox",
332
332
  "aria-multiselectable": !0,
333
333
  style: Object.assign(
334
334
  {
335
- width: He,
336
- left: d == null ? void 0 : d.x,
337
- top: (d == null ? void 0 : d.y) - 60,
335
+ width: je,
336
+ left: x == null ? void 0 : x.x,
337
+ top: (x == null ? void 0 : x.y) - 60,
338
338
  opacity: 1,
339
339
  visibility: "visible",
340
340
  height: "fit-content",
341
341
  // Переменная, чтобы список внутри модалки можно было
342
342
  // поднять над ней, не трогая код потребителя.
343
- zIndex: "var(--u-select-popup-z, 10010)",
343
+ zIndex: `var(--${o()}-select-popup-z, 10010)`,
344
344
  display: "block"
345
345
  },
346
- R ? {
346
+ P ? {
347
347
  maxHeight: "none"
348
348
  } : {},
349
- u.optionsStyle,
350
- re(we, U)
349
+ d.optionsStyle,
350
+ ne(Re, Z)
351
351
  ),
352
- children: m.map((e, t) => ie(e, t, !1))
352
+ children: u.map((e, t) => ce(e, t, !1))
353
353
  }
354
354
  ),
355
355
  document.body
356
356
  ),
357
- !g && !X && Re ? /* @__PURE__ */ o(
357
+ !y && !q && Pe ? /* @__PURE__ */ i(
358
358
  "div",
359
359
  {
360
- ref: ye,
361
- id: p,
360
+ ref: Oe,
361
+ id: f,
362
362
  role: "listbox",
363
363
  "aria-multiselectable": !0,
364
- className: "u-multiselectbox-options",
364
+ className: c("multiselectbox-options"),
365
365
  style: Object.assign(
366
366
  {},
367
367
  // см. Select: свой `display` на всё время жизни узла,
368
368
  // иначе переход срывается кадром с `display: none`
369
369
  { display: "block" },
370
- R ? {
370
+ P ? {
371
371
  maxHeight: "none"
372
372
  } : {},
373
- u.optionsStyle,
374
- re(Pe, U)
373
+ d.optionsStyle,
374
+ ne(He, Z)
375
375
  ),
376
- children: m.map((e, t) => ie(e, t, !0))
376
+ children: u.map((e, t) => ce(e, t, !0))
377
377
  }
378
378
  ) : null
379
379
  ]
@@ -382,27 +382,27 @@ const yt = ({
382
382
  ]
383
383
  }
384
384
  ),
385
- P.showText && /* @__PURE__ */ o("h5", { id: `${p}-error`, className: "h5 clr-red-main", style: xe ? {
385
+ H.showText && /* @__PURE__ */ i("h5", { id: `${f}-error`, className: "h5 clr-red-main", style: be ? {
386
386
  position: "absolute",
387
387
  bottom: "calc(-20 * var(--u-unit, 1px))"
388
- } : { position: "relative", marginTop: "calc(4 * var(--u-unit, 1px))" }, children: P.text }),
389
- c ? /* @__PURE__ */ o(
390
- Xe,
388
+ } : { position: "relative", marginTop: "calc(4 * var(--u-unit, 1px))" }, children: H.text }),
389
+ s ? /* @__PURE__ */ i(
390
+ qe,
391
391
  {
392
- active: ee,
393
- title: Me,
394
- options: w,
392
+ active: oe,
393
+ title: Ke,
394
+ options: R,
395
395
  multiple: !0,
396
- isSelected: (e) => i.some((t) => h(t == null ? void 0 : t.value, e == null ? void 0 : e.value)),
396
+ isSelected: (e) => l.some((t) => g(t == null ? void 0 : t.value, e == null ? void 0 : e.value)),
397
397
  onSelect: N,
398
398
  onClose: () => D(!1),
399
- searchable: n,
400
- onSearchChange: Ke,
401
- loading: g
399
+ searchable: m,
400
+ onSearchChange: Le,
401
+ loading: y
402
402
  }
403
403
  ) : null
404
404
  ]
405
405
  }
406
406
  );
407
407
  };
408
- export { yt as Multiselect$u };
408
+ export { St as Multiselect$u };