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.
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +16 -15
- package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
- package/dist/components/BreadCrumbs/BreadCrumbs.js +23 -22
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +51 -50
- package/dist/components/Button/ButtonRefreshIcon.d.ts.map +1 -1
- package/dist/components/Button/ButtonRefreshIcon.js +9 -8
- package/dist/components/Calendar/Calendar.js +232 -232
- package/dist/components/Calendar/CalendarSelect.d.ts.map +1 -1
- package/dist/components/Calendar/CalendarSelect.js +41 -40
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +59 -58
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +20 -19
- package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettings.js +112 -111
- package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
- package/dist/components/ConfirmModal/ConfirmModal.js +30 -29
- package/dist/components/Drawer/Drawer.js +57 -57
- package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreen.js +151 -150
- package/dist/components/ErrorScreen/ErrorScreenIllustration.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreenIllustration.js +35 -34
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +30 -29
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +17 -16
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.js +23 -22
- package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts.map +1 -1
- package/dist/components/InputExpandTextarea/InputExpandTextarea.js +88 -87
- package/dist/components/InputFile/InputFile.d.ts.map +1 -1
- package/dist/components/InputFile/InputFile.js +99 -98
- package/dist/components/InputNumber/InputNumber.d.ts.map +1 -1
- package/dist/components/InputNumber/InputNumber.js +112 -111
- package/dist/components/InputText/InputAffix.d.ts.map +1 -1
- package/dist/components/InputText/InputAffix.js +69 -68
- package/dist/components/InputText/InputText.d.ts.map +1 -1
- package/dist/components/InputText/InputText.js +108 -107
- package/dist/components/InputTime/InputTime.d.ts.map +1 -1
- package/dist/components/InputTime/InputTime.js +202 -201
- package/dist/components/InputTime/InputTimeDropdown.d.ts.map +1 -1
- package/dist/components/InputTime/InputTimeDropdown.js +21 -20
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +58 -57
- package/dist/components/Message/Message.d.ts.map +1 -1
- package/dist/components/Message/Message.js +19 -18
- package/dist/components/Modal/Modal.js +66 -66
- package/dist/components/Modal/useModalTitleClearance.d.ts.map +1 -1
- package/dist/components/Modal/useModalTitleClearance.js +34 -33
- package/dist/components/Multiselect/Multiselect.js +222 -222
- package/dist/components/Notification/Notification.js +90 -90
- package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
- package/dist/components/OfflineBanner/OfflineBanner.js +40 -37
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +59 -58
- package/dist/components/Preloader/Preloader.d.ts.map +1 -1
- package/dist/components/Preloader/Preloader.js +28 -27
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +21 -20
- package/dist/components/Search/Search.d.ts.map +1 -1
- package/dist/components/Search/Search.js +33 -32
- package/dist/components/SearchSelect/SearchSelect.js +178 -178
- package/dist/components/SearchSelect/SearchSelectOption.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelectOption.js +21 -20
- package/dist/components/Select/MobileOptionSheet.d.ts.map +1 -1
- package/dist/components/Select/MobileOptionSheet.js +65 -64
- package/dist/components/Select/Select.js +184 -184
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +26 -25
- package/dist/components/Status/Status.d.ts.map +1 -1
- package/dist/components/Status/Status.js +36 -35
- package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
- package/dist/components/StickyActionBar/StickyActionBar.js +36 -35
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +19 -18
- package/dist/components/Table/Filter/DefaultInput.d.ts.map +1 -1
- package/dist/components/Table/Filter/DefaultInput.js +12 -11
- package/dist/components/Table/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Table/Filter/Filter.js +99 -98
- package/dist/components/Table/Filter/FilterBooleanBox.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterBooleanBox.js +7 -6
- package/dist/components/Table/Filter/FilterBoxShell.js +48 -48
- package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterDateBox.js +65 -64
- package/dist/components/Table/Filter/FilterSortIndicator.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterSortIndicator.js +8 -7
- package/dist/components/Table/Filter/SelectFilter.js +53 -53
- package/dist/components/Table/Filter/TableFilterOptions.d.ts.map +1 -1
- package/dist/components/Table/Filter/TableFilterOptions.js +141 -140
- package/dist/components/Table/Filter/TableFilterSortButton.d.ts.map +1 -1
- package/dist/components/Table/Filter/TableFilterSortButton.js +10 -9
- package/dist/components/Table/Filter/useVirtualOptionWindow.d.ts.map +1 -1
- package/dist/components/Table/Filter/useVirtualOptionWindow.js +9 -8
- package/dist/components/Table/Skeleton/createSkeletonColumns.d.ts.map +1 -1
- package/dist/components/Table/Skeleton/createSkeletonColumns.js +9 -8
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.helpers.d.ts.map +1 -1
- package/dist/components/Table/Table.helpers.js +31 -30
- package/dist/components/Table/Table.js +253 -252
- package/dist/components/Table/TableHead.d.ts.map +1 -1
- package/dist/components/Table/TableHead.js +92 -91
- package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
- package/dist/components/Table/TableMobileCard.js +121 -120
- package/dist/components/Table/TableMobileFilters.d.ts.map +1 -1
- package/dist/components/Table/TableMobileFilters.js +28 -27
- package/dist/components/Table/TableMobileView.d.ts.map +1 -1
- package/dist/components/Table/TableMobileView.js +178 -177
- package/dist/components/Table/TableRow.d.ts.map +1 -1
- package/dist/components/Table/TableRow.js +59 -58
- package/dist/components/Table/useTableColumnPinning.d.ts +2 -917
- package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
- package/dist/components/Table/useTableColumnPinning.js +21 -20
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +102 -101
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +70 -69
- package/dist/components/Tooltip/Tooltip.js +106 -106
- package/dist/components/TreeView/TreeView.js +183 -183
- package/dist/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/components/VirtualList/VirtualList.js +42 -41
- package/dist/dev/index.js +1 -1
- package/dist/hooks/useAutoId.d.ts.map +1 -1
- package/dist/hooks/useAutoId.js +7 -6
- package/dist/hooks/useSelectEngine.d.ts.map +1 -1
- package/dist/hooks/useSelectEngine.js +31 -30
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/responsive/uiKitResponsive.d.ts +6 -0
- package/dist/responsive/uiKitResponsive.d.ts.map +1 -1
- package/dist/responsive/uiKitResponsive.js +27 -26
- package/dist/shared/kitCopy.js +1 -1
- package/dist/shared/optionStateColors.d.ts +3 -2
- package/dist/shared/optionStateColors.d.ts.map +1 -1
- package/dist/shared/optionStateColors.js +9 -4
- package/dist/shared/popupTransition.d.ts.map +1 -1
- package/dist/shared/popupTransition.js +7 -6
- package/dist/shared/sheetTitle.d.ts +2 -1
- package/dist/shared/sheetTitle.d.ts.map +1 -1
- package/dist/shared/size.d.ts.map +1 -1
- package/dist/shared/size.js +3 -2
- package/dist/shared/uiKitDefaults.d.ts +21 -0
- package/dist/shared/uiKitDefaults.d.ts.map +1 -1
- package/dist/shared/uiKitDefaults.js +32 -18
- package/dist/style.shell.lk.css +53 -0
- package/dist/urfu-ui-kit-react.js +27 -26
- package/dist/vanilla/core/describeError.js +1 -1
- package/dist/vanilla/core/sheetTitle.js +7 -7
- package/package.json +3 -1
|
@@ -1,316 +1,316 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getFieldAccessibility$u as
|
|
3
|
-
import { useState as
|
|
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
|
|
10
|
-
import
|
|
11
|
-
import { useSelectEngine$u as
|
|
12
|
-
import { OPTION_STATE_COLORS$u as
|
|
13
|
-
import { isSameOptionValue$u as
|
|
14
|
-
import { getPopupTransitionStyle$u as
|
|
15
|
-
import { sizeClassName$u as
|
|
16
|
-
import { useMobilePicker$u as
|
|
17
|
-
import { MobileOptionSheet$u as
|
|
18
|
-
import { getPortalScopeProps$u as
|
|
19
|
-
import { resolveValidation$u as
|
|
20
|
-
import { resolveSheetTitle$u as
|
|
21
|
-
const
|
|
22
|
-
"aria-label":
|
|
23
|
-
"aria-labelledby":
|
|
24
|
-
"aria-describedby":
|
|
25
|
-
title:
|
|
26
|
-
required:
|
|
27
|
-
options:
|
|
28
|
-
styleSelectContainer:
|
|
29
|
-
styleTitle:
|
|
30
|
-
styleSelect:
|
|
31
|
-
lineUp:
|
|
32
|
-
placeholder:
|
|
33
|
-
values:
|
|
34
|
-
setValues:
|
|
35
|
-
isClearable:
|
|
36
|
-
className:
|
|
37
|
-
tableView:
|
|
38
|
-
size:
|
|
39
|
-
validationText:
|
|
40
|
-
validationOn:
|
|
41
|
-
error:
|
|
42
|
-
absoluteValidationText:
|
|
43
|
-
disabled:
|
|
44
|
-
portalOn:
|
|
45
|
-
isSearchable:
|
|
46
|
-
onInputChange:
|
|
47
|
-
loading:
|
|
48
|
-
inputValue:
|
|
49
|
-
onInputValueChange:
|
|
50
|
-
noScroll:
|
|
51
|
-
id:
|
|
52
|
-
mobilePicker:
|
|
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
|
|
55
|
-
(e) =>
|
|
56
|
-
),
|
|
57
|
-
optionsLength:
|
|
58
|
-
initialIndex: Math.max(0,
|
|
59
|
-
selectedIndex:
|
|
60
|
-
disabled:
|
|
61
|
-
portalOn:
|
|
62
|
-
loading:
|
|
63
|
-
id:
|
|
64
|
-
idPrefix: "
|
|
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),
|
|
69
|
-
return t > 0 ? Math.min(t,
|
|
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 =
|
|
73
|
-
t &&
|
|
72
|
+
const t = u[e];
|
|
73
|
+
t && V.current(t);
|
|
74
74
|
}
|
|
75
75
|
}), {
|
|
76
|
-
isOpen:
|
|
77
|
-
blockRef:
|
|
78
|
-
portalOptionsRef:
|
|
79
|
-
optionsListRef:
|
|
80
|
-
listboxId:
|
|
81
|
-
activeDescendantId:
|
|
82
|
-
activeIndex:
|
|
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:
|
|
85
|
-
handleKeyDown:
|
|
86
|
-
shouldRenderPortal:
|
|
87
|
-
portalStatus:
|
|
88
|
-
shouldRenderLocal:
|
|
89
|
-
localStatus:
|
|
90
|
-
isAnimated:
|
|
91
|
-
portalWidth:
|
|
92
|
-
usePortal:
|
|
93
|
-
} =
|
|
94
|
-
"aria-label":
|
|
95
|
-
"aria-labelledby":
|
|
96
|
-
"aria-describedby":
|
|
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
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
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
|
-
|
|
104
|
-
},
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
const e =
|
|
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
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
e.key !== "Enter" && e.key !== " " && e.key !== "ArrowDown" || (e.preventDefault(),
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
const
|
|
123
|
-
return /* @__PURE__ */
|
|
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: "
|
|
126
|
+
className: c("multiselectbox-option"),
|
|
127
127
|
"data-option-index": t,
|
|
128
|
-
id: `${
|
|
128
|
+
id: `${f}-option-${t}`,
|
|
129
129
|
role: "option",
|
|
130
|
-
"aria-selected":
|
|
130
|
+
"aria-selected": T,
|
|
131
131
|
style: Object.assign(
|
|
132
132
|
{},
|
|
133
|
-
|
|
133
|
+
a ? {
|
|
134
134
|
// Плотное поле — 43, а строка была 37: держим её не ниже поля
|
|
135
135
|
// и центрируем текст по вертикали.
|
|
136
|
-
minHeight:
|
|
136
|
+
minHeight: `var(--${o()}-option-min-height, var(--${o()}-compact-height))`,
|
|
137
137
|
display: "flex",
|
|
138
138
|
alignItems: "center",
|
|
139
|
-
fontSize:
|
|
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
|
-
|
|
144
|
-
|
|
143
|
+
T ? { backgroundColor: se.selectedBackground } : Be ? { backgroundColor: se.hoveredBackground } : null,
|
|
144
|
+
n && P ? {
|
|
145
145
|
maxHeight: "none"
|
|
146
146
|
} : null,
|
|
147
|
-
|
|
147
|
+
F
|
|
148
148
|
),
|
|
149
|
-
onMouseEnter: () =>
|
|
150
|
-
onMouseLeave: () =>
|
|
151
|
-
children: /* @__PURE__ */
|
|
149
|
+
onMouseEnter: () => Q(t),
|
|
150
|
+
onMouseLeave: () => Q(null),
|
|
151
|
+
children: /* @__PURE__ */ b(
|
|
152
152
|
"label",
|
|
153
153
|
{
|
|
154
|
-
className: "
|
|
155
|
-
style:
|
|
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:
|
|
163
|
-
} : { color:
|
|
162
|
+
color: `var(--${o()}-option-color, #222222)`
|
|
163
|
+
} : { color: `var(--${o()}-option-color, #222222)` },
|
|
164
164
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ i(
|
|
166
166
|
"input",
|
|
167
167
|
{
|
|
168
168
|
type: "checkbox",
|
|
169
|
-
checked:
|
|
170
|
-
onChange: (
|
|
171
|
-
|
|
169
|
+
checked: T,
|
|
170
|
+
onChange: (z) => {
|
|
171
|
+
z.stopPropagation(), N(e);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
),
|
|
175
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
181
|
+
Ee[t]
|
|
182
182
|
);
|
|
183
183
|
};
|
|
184
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ b(
|
|
185
185
|
"div",
|
|
186
186
|
{
|
|
187
|
-
className:
|
|
187
|
+
className: `${o()}-react-multiselect-container${_ ? ` ${_}` : ""} ${fe ?? ""}`,
|
|
188
188
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ b(
|
|
190
190
|
"div",
|
|
191
191
|
{
|
|
192
192
|
style: Object.assign(
|
|
193
193
|
{
|
|
194
194
|
display: "flex",
|
|
195
|
-
gap:
|
|
196
|
-
flexDirection:
|
|
195
|
+
gap: `calc(4 * var(--${o()}-preset-unit, 1px))`,
|
|
196
|
+
flexDirection: de ? "row" : "column"
|
|
197
197
|
},
|
|
198
|
-
|
|
198
|
+
me
|
|
199
199
|
),
|
|
200
200
|
children: [
|
|
201
|
-
|
|
201
|
+
O && /* @__PURE__ */ i(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
204
|
-
id: `${
|
|
205
|
-
className: `${
|
|
204
|
+
id: `${f}-label`,
|
|
205
|
+
className: `${A ? c("required") : ""} ${o()}-react-select-title`,
|
|
206
206
|
style: Object.assign(
|
|
207
207
|
{
|
|
208
|
-
color:
|
|
209
|
-
fontSize:
|
|
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
|
-
|
|
211
|
+
pe
|
|
212
212
|
),
|
|
213
|
-
children:
|
|
213
|
+
children: O
|
|
214
214
|
}
|
|
215
215
|
),
|
|
216
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ b(
|
|
217
217
|
"div",
|
|
218
218
|
{
|
|
219
|
-
className:
|
|
220
|
-
ref:
|
|
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
|
-
|
|
225
|
+
F
|
|
226
226
|
),
|
|
227
227
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ b(
|
|
229
229
|
"div",
|
|
230
230
|
{
|
|
231
|
-
ref:
|
|
232
|
-
className:
|
|
233
|
-
tabIndex:
|
|
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
|
-
...
|
|
236
|
-
"aria-expanded":
|
|
237
|
-
"aria-haspopup":
|
|
238
|
-
"aria-controls":
|
|
239
|
-
"aria-disabled":
|
|
240
|
-
"aria-activedescendant":
|
|
241
|
-
onKeyDown:
|
|
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 (
|
|
245
|
-
|
|
244
|
+
if (s) {
|
|
245
|
+
le();
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
!
|
|
248
|
+
!h && m && !r && ((t = k.current) == null || t.focus()), d.toggle(e.currentTarget);
|
|
249
249
|
},
|
|
250
250
|
style: Object.assign(
|
|
251
|
-
|
|
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
|
-
|
|
259
|
-
|
|
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
|
-
(
|
|
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:
|
|
267
|
-
|
|
266
|
+
{ color: `var(--${o()}-field-title-color, #545454)` },
|
|
267
|
+
a ? { fontSize: `var(--${o()}-compact-font-size)` } : {}
|
|
268
268
|
),
|
|
269
|
-
className: "
|
|
270
|
-
children:
|
|
269
|
+
className: c("multiselectbox-select-label"),
|
|
270
|
+
children: L
|
|
271
271
|
}
|
|
272
|
-
) : /* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
|
|
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
|
-
|
|
279
|
+
m && !s && /* @__PURE__ */ i(
|
|
280
280
|
"input",
|
|
281
281
|
{
|
|
282
|
-
ref:
|
|
283
|
-
className: "
|
|
284
|
-
disabled:
|
|
285
|
-
"aria-disabled":
|
|
286
|
-
value:
|
|
287
|
-
onChange:
|
|
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
|
-
|
|
289
|
+
h && e.stopPropagation();
|
|
290
290
|
},
|
|
291
|
-
onKeyDown:
|
|
291
|
+
onKeyDown: X
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
|
-
|
|
294
|
+
te ? /* @__PURE__ */ i(
|
|
295
295
|
"i",
|
|
296
296
|
{
|
|
297
|
-
className:
|
|
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(),
|
|
301
|
+
e.stopPropagation(), Te();
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
) : null,
|
|
305
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ i(
|
|
306
306
|
"i",
|
|
307
307
|
{
|
|
308
|
-
className: "
|
|
308
|
+
className: c("multiselectbox-select-icon-arrow"),
|
|
309
309
|
style: Object.assign(
|
|
310
|
-
|
|
310
|
+
h ? {
|
|
311
311
|
transform: "rotate(180deg)"
|
|
312
312
|
} : {},
|
|
313
|
-
|
|
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
|
-
|
|
323
|
-
!
|
|
324
|
-
/* @__PURE__ */
|
|
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: "
|
|
328
|
-
ref:
|
|
329
|
-
...
|
|
330
|
-
id:
|
|
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:
|
|
336
|
-
left:
|
|
337
|
-
top: (
|
|
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:
|
|
343
|
+
zIndex: `var(--${o()}-select-popup-z, 10010)`,
|
|
344
344
|
display: "block"
|
|
345
345
|
},
|
|
346
|
-
|
|
346
|
+
P ? {
|
|
347
347
|
maxHeight: "none"
|
|
348
348
|
} : {},
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
d.optionsStyle,
|
|
350
|
+
ne(Re, Z)
|
|
351
351
|
),
|
|
352
|
-
children:
|
|
352
|
+
children: u.map((e, t) => ce(e, t, !1))
|
|
353
353
|
}
|
|
354
354
|
),
|
|
355
355
|
document.body
|
|
356
356
|
),
|
|
357
|
-
!
|
|
357
|
+
!y && !q && Pe ? /* @__PURE__ */ i(
|
|
358
358
|
"div",
|
|
359
359
|
{
|
|
360
|
-
ref:
|
|
361
|
-
id:
|
|
360
|
+
ref: Oe,
|
|
361
|
+
id: f,
|
|
362
362
|
role: "listbox",
|
|
363
363
|
"aria-multiselectable": !0,
|
|
364
|
-
className: "
|
|
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
|
-
|
|
370
|
+
P ? {
|
|
371
371
|
maxHeight: "none"
|
|
372
372
|
} : {},
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
d.optionsStyle,
|
|
374
|
+
ne(He, Z)
|
|
375
375
|
),
|
|
376
|
-
children:
|
|
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
|
-
|
|
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:
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
} : { position: "relative", marginTop: "calc(4 * var(--u-unit, 1px))" }, children: H.text }),
|
|
389
|
+
s ? /* @__PURE__ */ i(
|
|
390
|
+
qe,
|
|
391
391
|
{
|
|
392
|
-
active:
|
|
393
|
-
title:
|
|
394
|
-
options:
|
|
392
|
+
active: oe,
|
|
393
|
+
title: Ke,
|
|
394
|
+
options: R,
|
|
395
395
|
multiple: !0,
|
|
396
|
-
isSelected: (e) =>
|
|
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:
|
|
400
|
-
onSearchChange:
|
|
401
|
-
loading:
|
|
399
|
+
searchable: m,
|
|
400
|
+
onSearchChange: Le,
|
|
401
|
+
loading: y
|
|
402
402
|
}
|
|
403
403
|
) : null
|
|
404
404
|
]
|
|
405
405
|
}
|
|
406
406
|
);
|
|
407
407
|
};
|
|
408
|
-
export {
|
|
408
|
+
export { St as Multiselect$u };
|