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.
- 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.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +237 -216
- package/dist/components/Calendar/Calendar.types.d.ts +19 -0
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelect.js +176 -166
- 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 +101 -99
- package/dist/components/Tabs/distributeTabs.d.ts +7 -3
- package/dist/components/Tabs/distributeTabs.d.ts.map +1 -1
- package/dist/components/Tabs/useTabsOverflow.d.ts +4 -0
- package/dist/components/Tabs/useTabsOverflow.d.ts.map +1 -1
- package/dist/components/Tabs/useTabsOverflow.js +40 -41
- 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 +2 -2
- 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 +4 -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-no-fonts.css +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layer.css +2 -2
- package/dist/style.shell.css +2 -2
- package/dist/style.shell.lk.css +53 -0
- package/dist/urfu-ui-kit-react.js +29 -27
- package/dist/vanilla/core/dateLimits.js +21 -0
- package/dist/vanilla/core/describeError.js +1 -1
- package/dist/vanilla/core/distributeTabs.js +36 -23
- package/dist/vanilla/core/sheetTitle.js +7 -7
- package/package.json +3 -1
|
@@ -1,263 +1,263 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as x, jsx as n, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as B, useMemo as Z } from "react";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { createPortal as
|
|
4
|
+
import { createPortal as ke } from "react-dom";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { useDismiss$u as
|
|
10
|
-
import { useAnchoredPosition$u as
|
|
11
|
-
import { useMountTransition$u as
|
|
12
|
-
import
|
|
13
|
-
import { useOptionKeyboardNavigation$u as
|
|
14
|
-
import { useActiveOptionScroll$u as
|
|
15
|
-
import { OPTION_STATE_COLORS$u as
|
|
16
|
-
import { getPopupTransitionStyle$u as
|
|
17
|
-
import { useAutoId$u as
|
|
18
|
-
import { sizeClassName$u as
|
|
19
|
-
import { getPortalScopeProps$u as
|
|
20
|
-
import { resolveValidation$u as
|
|
21
|
-
const
|
|
22
|
-
title:
|
|
23
|
-
required:
|
|
24
|
-
styleSelectContainer:
|
|
25
|
-
styleTitle:
|
|
26
|
-
lineUp:
|
|
27
|
-
rowGap:
|
|
28
|
-
columnGap:
|
|
29
|
-
placeholder:
|
|
30
|
-
value:
|
|
31
|
-
isClearable:
|
|
32
|
-
onDelete:
|
|
33
|
-
onClick:
|
|
34
|
-
className:
|
|
35
|
-
tableView:
|
|
36
|
-
size:
|
|
37
|
-
validationText:
|
|
38
|
-
validationOn:
|
|
39
|
-
error:
|
|
40
|
-
absoluteValidationText:
|
|
41
|
-
data:
|
|
42
|
-
portalOn:
|
|
43
|
-
id:
|
|
44
|
-
disabled:
|
|
45
|
-
isSearchable:
|
|
9
|
+
import { useDismiss$u as Ie } from "../../hooks/useDismiss.js";
|
|
10
|
+
import { useAnchoredPosition$u as Ee, fitToViewport$u as Pe } from "../../hooks/useAnchoredPosition.js";
|
|
11
|
+
import { useMountTransition$u as Se } from "../../hooks/useMountTransition.js";
|
|
12
|
+
import _e from "../../hooks/useDebounce.js";
|
|
13
|
+
import { useOptionKeyboardNavigation$u as je } from "../../hooks/useOptionKeyboardNavigation.js";
|
|
14
|
+
import { useActiveOptionScroll$u as Ae } from "../../hooks/useActiveOptionScroll.js";
|
|
15
|
+
import { OPTION_STATE_COLORS$u as ee } from "../../shared/optionStateColors.js";
|
|
16
|
+
import { getPopupTransitionStyle$u as ze, POPUP_TRANSITION_MS$u as De } from "../../shared/popupTransition.js";
|
|
17
|
+
import { useAutoId$u as Be } from "../../hooks/useAutoId.js";
|
|
18
|
+
import { sizeClassName$u as Ke, isCompact$u as Le } from "../../shared/size.js";
|
|
19
|
+
import { getUiKitPrefix$u as i, kitCls$u as d, getPortalScopeProps$u as Me } from "../../shared/uiKitDefaults.js";
|
|
20
|
+
import { resolveValidation$u as Re } from "../../vanilla/core/validation.js";
|
|
21
|
+
const lt = ({
|
|
22
|
+
title: K = "",
|
|
23
|
+
required: te = !1,
|
|
24
|
+
styleSelectContainer: ie,
|
|
25
|
+
styleTitle: ne,
|
|
26
|
+
lineUp: S = !1,
|
|
27
|
+
rowGap: ce = 4,
|
|
28
|
+
columnGap: re = 20,
|
|
29
|
+
placeholder: oe = "Выберите из списка",
|
|
30
|
+
value: c,
|
|
31
|
+
isClearable: _,
|
|
32
|
+
onDelete: se,
|
|
33
|
+
onClick: L,
|
|
34
|
+
className: M,
|
|
35
|
+
tableView: R = !1,
|
|
36
|
+
size: V,
|
|
37
|
+
validationText: le = "Заполните поле",
|
|
38
|
+
validationOn: ae,
|
|
39
|
+
error: de,
|
|
40
|
+
absoluteValidationText: ue,
|
|
41
|
+
data: u,
|
|
42
|
+
portalOn: C,
|
|
43
|
+
id: pe,
|
|
44
|
+
disabled: $,
|
|
45
|
+
isSearchable: o
|
|
46
46
|
}) => {
|
|
47
|
-
var
|
|
48
|
-
const
|
|
49
|
-
|
|
47
|
+
var U;
|
|
48
|
+
const b = Le(V, R), H = Ke(V, R), j = Re({ error: de, validationOn: ae, validationText: le }), W = Be(pe, d("tree")), [g, k] = T(""), [me, fe] = T(null), [w, he] = T([]), [s, I] = T(!1), [xe, F] = T(null), G = B(null), E = B(null), p = B(), q = _e(g, 300), A = Z(() => u.filter((e) => e.title.toLowerCase().includes((q || "").toLowerCase())), [q, u]), P = () => {
|
|
49
|
+
I(!1);
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
refs: [
|
|
53
|
-
onDismiss:
|
|
54
|
-
enabled:
|
|
51
|
+
Ie({
|
|
52
|
+
refs: [G, E],
|
|
53
|
+
onDismiss: P,
|
|
54
|
+
enabled: s
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
e.stopPropagation(),
|
|
58
|
-
},
|
|
59
|
-
const t =
|
|
56
|
+
const Y = (e) => typeof e == "number" ? `calc(${e} * var(--${i()}-preset-unit, 1px))` : String(e), ge = (e, t) => {
|
|
57
|
+
e.stopPropagation(), he((r) => r != null && r.includes(t) ? r.filter((a) => a !== t) : [...r, t]);
|
|
58
|
+
}, J = (e) => {
|
|
59
|
+
const t = u.filter((a) => a.parentId === e.id);
|
|
60
60
|
if (t.length === 0)
|
|
61
61
|
return e;
|
|
62
|
-
let
|
|
63
|
-
return t.forEach((
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
},
|
|
68
|
-
const
|
|
69
|
-
var
|
|
70
|
-
|
|
62
|
+
let r = null;
|
|
63
|
+
return t.forEach((a) => {
|
|
64
|
+
const m = J(a);
|
|
65
|
+
m && (r = m);
|
|
66
|
+
}), r;
|
|
67
|
+
}, z = ({ node: e, counter: t }) => {
|
|
68
|
+
const r = u.filter((h) => h.parentId === e.id), a = t + 1, m = w == null ? void 0 : w.includes(e.id), f = J(e), Ne = ve === e.id, Oe = c == (e == null ? void 0 : e.title), Te = xe === e.id, Ce = () => {
|
|
69
|
+
var h;
|
|
70
|
+
L(e), P(), o && (k(""), (h = p == null ? void 0 : p.current) == null || h.focus());
|
|
71
71
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ x("ul", { className: "treeview-list", children: [
|
|
73
|
+
/* @__PURE__ */ x(
|
|
74
74
|
"li",
|
|
75
75
|
{
|
|
76
76
|
className: "treeview-list__item",
|
|
77
77
|
"data-node-id": String(e.id),
|
|
78
78
|
style: Object.assign(
|
|
79
|
-
{ paddingLeft: `calc((${t} * 16 + 12) * var(
|
|
80
|
-
|
|
79
|
+
{ paddingLeft: `calc((${t} * 16 + 12) * var(--${i()}-preset-unit, 1px))` },
|
|
80
|
+
Oe ? { backgroundColor: ee.selectedBackground, borderRadius: `calc(10 * var(--${i()}-preset-unit, 1px))` } : Te || Ne ? { backgroundColor: ee.hoveredBackground, borderRadius: `calc(10 * var(--${i()}-preset-unit, 1px))` } : null
|
|
81
81
|
),
|
|
82
|
-
onMouseEnter: () =>
|
|
83
|
-
onMouseLeave: () =>
|
|
82
|
+
onMouseEnter: () => F(e.id),
|
|
83
|
+
onMouseLeave: () => F(null),
|
|
84
84
|
children: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */
|
|
85
|
+
f.id !== e.id && /* @__PURE__ */ n("div", { onClick: (h) => ge(h, e.id), children: m ? /* @__PURE__ */ n("i", { style: { cursor: "pointer", width: "calc(20 * var(--u-unit, 1px))", height: "calc(20 * var(--u-unit, 1px))" }, className: `${i()}-icon icon-down clr-blue-main` }) : /* @__PURE__ */ n("i", { style: { cursor: "pointer", width: "calc(20 * var(--u-unit, 1px))", height: "calc(20 * var(--u-unit, 1px))" }, className: `${i()}-icon icon-right clr-blue-main` }) }),
|
|
86
|
+
f.id !== e.id && /* @__PURE__ */ n("i", { className: `${i()}-icon icon-folder clr-orange` }),
|
|
87
|
+
/* @__PURE__ */ n("p", { onClick: Ce, style: { cursor: "pointer" }, className: "tt", children: e.title })
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
|
|
91
|
+
m && r.map((h) => /* @__PURE__ */ n(z, { node: h, counter: a }, h.id))
|
|
92
92
|
] });
|
|
93
|
-
},
|
|
94
|
-
if (!Array.isArray(
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
93
|
+
}, l = o && g ? A : u == null ? void 0 : u.filter((e) => e.parentId === null), N = Z(() => {
|
|
94
|
+
if (!Array.isArray(u)) return [];
|
|
95
|
+
if (o && g)
|
|
96
|
+
return A;
|
|
97
97
|
const e = /* @__PURE__ */ new Map();
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
98
|
+
u.forEach((a) => {
|
|
99
|
+
const m = a.parentId, f = e.get(m) ?? [];
|
|
100
|
+
f.push(a), e.set(m, f);
|
|
101
101
|
});
|
|
102
|
-
const t = [],
|
|
103
|
-
(e.get(
|
|
104
|
-
t.push(
|
|
102
|
+
const t = [], r = (a) => {
|
|
103
|
+
(e.get(a) ?? []).forEach((f) => {
|
|
104
|
+
t.push(f), w.includes(f.id) && r(f.id);
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
return
|
|
108
|
-
}, [
|
|
109
|
-
isOpen:
|
|
110
|
-
disabled:
|
|
111
|
-
optionsLength:
|
|
107
|
+
return r(null), t;
|
|
108
|
+
}, [u, w, A, o, g]), { activeIndex: D, handleKeyDown: Q } = je({
|
|
109
|
+
isOpen: s,
|
|
110
|
+
disabled: $,
|
|
111
|
+
optionsLength: N.length,
|
|
112
112
|
initialIndex: Math.max(
|
|
113
113
|
0,
|
|
114
|
-
|
|
114
|
+
N.findIndex((e) => (e == null ? void 0 : e.title) === c)
|
|
115
115
|
),
|
|
116
|
-
onOpen: () =>
|
|
116
|
+
onOpen: () => I(!0),
|
|
117
117
|
onClose: () => {
|
|
118
|
-
|
|
118
|
+
P();
|
|
119
119
|
},
|
|
120
120
|
onSelectByIndex: (e) => {
|
|
121
|
-
const t =
|
|
122
|
-
t &&
|
|
121
|
+
const t = N[e];
|
|
122
|
+
t && ye(t);
|
|
123
123
|
}
|
|
124
|
-
}),
|
|
125
|
-
|
|
126
|
-
isOpen:
|
|
127
|
-
activeIndex:
|
|
124
|
+
}), ve = D >= 0 ? (U = N[D]) == null ? void 0 : U.id : void 0;
|
|
125
|
+
Ae({
|
|
126
|
+
isOpen: s,
|
|
127
|
+
activeIndex: D,
|
|
128
128
|
portalOn: !1,
|
|
129
|
-
localRef:
|
|
129
|
+
localRef: E,
|
|
130
130
|
getSelector: (e) => {
|
|
131
|
-
const t =
|
|
131
|
+
const t = N[e];
|
|
132
132
|
return t ? `[data-node-id="${String(t.id)}"]` : "";
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
const
|
|
135
|
+
const ye = (e) => {
|
|
136
136
|
var t;
|
|
137
|
-
e && (
|
|
138
|
-
}, { rect:
|
|
139
|
-
anchor:
|
|
140
|
-
enabled:
|
|
141
|
-
}),
|
|
142
|
-
isOpen:
|
|
143
|
-
duration:
|
|
137
|
+
e && (L(e), P(), o && (k(""), (t = p == null ? void 0 : p.current) == null || t.focus()));
|
|
138
|
+
}, { rect: v } = Ee({
|
|
139
|
+
anchor: me,
|
|
140
|
+
enabled: s && !!C
|
|
141
|
+
}), O = v ? Pe(v.x, v.width) : null, y = v && O ? { x: O.x, y: v.y + 60 + v.height + v.scrollY } : null, { shouldRender: $e, status: be, isAnimated: we } = Se({
|
|
142
|
+
isOpen: s && !!C,
|
|
143
|
+
duration: De
|
|
144
144
|
});
|
|
145
|
-
return /* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ x("div", { className: `${i()}-react-select-container${H ? ` ${H}` : ""}${M ? ` ${M}` : ""}`, style: { position: "relative" }, children: [
|
|
146
|
+
/* @__PURE__ */ x(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
149
|
style: Object.assign(
|
|
150
150
|
{
|
|
151
151
|
display: "flex",
|
|
152
|
-
flexDirection:
|
|
153
|
-
rowGap:
|
|
154
|
-
columnGap:
|
|
152
|
+
flexDirection: S ? "row" : "column",
|
|
153
|
+
rowGap: S ? null : Y(ce),
|
|
154
|
+
columnGap: S ? Y(re) : null
|
|
155
155
|
},
|
|
156
|
-
|
|
156
|
+
ie
|
|
157
157
|
),
|
|
158
158
|
children: [
|
|
159
|
-
|
|
159
|
+
K && /* @__PURE__ */ n(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
|
-
className: `${
|
|
162
|
+
className: `${te ? d("required") : ""} ${i()}-react-select-title`,
|
|
163
163
|
style: Object.assign(
|
|
164
164
|
{
|
|
165
|
-
color:
|
|
166
|
-
fontSize:
|
|
165
|
+
color: `var(--${i()}-field-title-color, #545454)`,
|
|
166
|
+
fontSize: `var(--${i()}-field-label-size-main, calc(14 * var(--u-unit, 1px)))`
|
|
167
167
|
},
|
|
168
|
-
|
|
168
|
+
ne
|
|
169
169
|
),
|
|
170
|
-
children:
|
|
170
|
+
children: K
|
|
171
171
|
}
|
|
172
172
|
),
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ x(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
|
-
className:
|
|
177
|
-
ref:
|
|
178
|
-
style: { cursor:
|
|
176
|
+
className: `${i()}-selectbox${$ ? ` ${i()}-selectbox-disabled` : ""} ${i()}-react-tree-view`,
|
|
177
|
+
ref: G,
|
|
178
|
+
style: { cursor: $ ? "default" : "pointer" },
|
|
179
179
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ x(
|
|
181
181
|
"div",
|
|
182
182
|
{
|
|
183
|
-
tabIndex:
|
|
184
|
-
onKeyDown:
|
|
183
|
+
tabIndex: $ ? -1 : 0,
|
|
184
|
+
onKeyDown: o ? void 0 : Q,
|
|
185
185
|
onClick: (e) => {
|
|
186
186
|
var t;
|
|
187
|
-
|
|
187
|
+
s || (o && ((t = p == null ? void 0 : p.current) == null || t.focus(), k("")), C && fe(e.currentTarget)), I(!s);
|
|
188
188
|
},
|
|
189
|
-
className:
|
|
190
|
-
id:
|
|
189
|
+
className: `${i()}-selectbox-select ${s ? d("selectbox-select-open") : ""}`,
|
|
190
|
+
id: `${i()}-selectbox-select${W}`,
|
|
191
191
|
style: Object.assign(
|
|
192
|
-
|
|
193
|
-
height:
|
|
194
|
-
fontSize:
|
|
192
|
+
b ? {
|
|
193
|
+
height: `var(--${i()}-compact-height)`,
|
|
194
|
+
fontSize: `var(--${i()}-compact-font-size)`,
|
|
195
195
|
lineHeight: 1,
|
|
196
|
-
padding:
|
|
196
|
+
padding: `var(--${i()}-compact-padding)`
|
|
197
197
|
} : {},
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
j.hasError && { border: `1px solid var(--${i()}-color-error, #EF302B)` },
|
|
199
|
+
$ && { pointerEvents: "none" }
|
|
200
200
|
),
|
|
201
201
|
children: [
|
|
202
|
-
!
|
|
202
|
+
!c && (!o || !s) ? /* @__PURE__ */ n(
|
|
203
203
|
"span",
|
|
204
204
|
{
|
|
205
205
|
style: Object.assign(
|
|
206
|
-
|
|
207
|
-
maxWidth: `calc(100% - ${((
|
|
206
|
+
b ? {
|
|
207
|
+
maxWidth: `calc(100% - ${((c == null ? void 0 : c.length) ?? 0) > 0 ? 32 : 16}px)`
|
|
208
208
|
} : {},
|
|
209
|
-
{ color:
|
|
209
|
+
{ color: `var(--${i()}-field-title-color, #545454)` }
|
|
210
210
|
),
|
|
211
|
-
className: "
|
|
212
|
-
children:
|
|
211
|
+
className: d("selectbox-select-title"),
|
|
212
|
+
children: oe
|
|
213
213
|
}
|
|
214
|
-
) : /* @__PURE__ */
|
|
215
|
-
|
|
214
|
+
) : /* @__PURE__ */ n(X, {}),
|
|
215
|
+
c && (!s || !o) ? /* @__PURE__ */ n(
|
|
216
216
|
"span",
|
|
217
217
|
{
|
|
218
|
-
style:
|
|
219
|
-
className: "
|
|
220
|
-
children:
|
|
218
|
+
style: b ? { maxWidth: `calc(100% - ${_ && (c != null && c.length) ? 32 : 16}px)` } : {},
|
|
219
|
+
className: d("selectbox-select-title"),
|
|
220
|
+
children: c
|
|
221
221
|
}
|
|
222
|
-
) : /* @__PURE__ */
|
|
223
|
-
|
|
222
|
+
) : /* @__PURE__ */ n(X, {}),
|
|
223
|
+
o && /* @__PURE__ */ n(
|
|
224
224
|
"input",
|
|
225
225
|
{
|
|
226
|
-
ref:
|
|
227
|
-
className:
|
|
228
|
-
placeholder:
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
226
|
+
ref: p,
|
|
227
|
+
className: s ? "treeview__search" : "treeview__search_disabled",
|
|
228
|
+
placeholder: c || "Введите значение",
|
|
229
|
+
value: g,
|
|
230
|
+
onChange: (e) => k(e.target.value),
|
|
231
231
|
onClick: (e) => {
|
|
232
|
-
|
|
232
|
+
s && e.stopPropagation();
|
|
233
233
|
},
|
|
234
|
-
onKeyDown:
|
|
235
|
-
style: Object.assign(
|
|
234
|
+
onKeyDown: Q,
|
|
235
|
+
style: Object.assign(b ? { padding: 0, paddingRight: `calc(${_ && (c != null && c.length) ? 37 : 20} * var(--u-unit, 1px))`, fontSize: `var(--${i()}-compact-font-size)` } : {}, { width: "100%" })
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
|
-
|
|
238
|
+
c && _ && /* @__PURE__ */ n(
|
|
239
239
|
"i",
|
|
240
240
|
{
|
|
241
241
|
onClick: (e) => {
|
|
242
|
-
|
|
242
|
+
se(e), I(!1);
|
|
243
243
|
},
|
|
244
|
-
className: "
|
|
244
|
+
className: d("selectbox-select-icon-cross"),
|
|
245
245
|
role: "button",
|
|
246
246
|
"aria-label": "Очистить",
|
|
247
247
|
style: Object.assign(
|
|
248
|
-
|
|
248
|
+
b ? {
|
|
249
249
|
right: "calc(24 * var(--u-unit, 1px))"
|
|
250
250
|
} : {},
|
|
251
|
-
|
|
251
|
+
$ && { pointerEvents: "none" }
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ n(
|
|
256
256
|
"i",
|
|
257
257
|
{
|
|
258
|
-
className: "
|
|
259
|
-
id:
|
|
260
|
-
style:
|
|
258
|
+
className: d("selectbox-select-icon-arrow"),
|
|
259
|
+
id: `${i()}-selectbox-select-icon-arrow${W}`,
|
|
260
|
+
style: b ? {
|
|
261
261
|
width: "calc(12 * var(--u-unit, 1px)) !important",
|
|
262
262
|
right: "calc(6 * var(--u-unit, 1px))"
|
|
263
263
|
} : null
|
|
@@ -266,48 +266,48 @@ const ot = ({
|
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
|
-
|
|
270
|
-
/* @__PURE__ */
|
|
269
|
+
C ? $e && y && ke(
|
|
270
|
+
/* @__PURE__ */ n(
|
|
271
271
|
"div",
|
|
272
272
|
{
|
|
273
|
-
ref:
|
|
274
|
-
...
|
|
273
|
+
ref: E,
|
|
274
|
+
...Me(),
|
|
275
275
|
style: Object.assign(
|
|
276
276
|
{
|
|
277
|
-
left:
|
|
278
|
-
top: (
|
|
277
|
+
left: y == null ? void 0 : y.x,
|
|
278
|
+
top: (y == null ? void 0 : y.y) - 60,
|
|
279
279
|
opacity: 1,
|
|
280
280
|
visibility: "visible",
|
|
281
281
|
height: "fit-content",
|
|
282
282
|
// Переменная, чтобы список внутри модалки можно было
|
|
283
283
|
// поднять над ней, не трогая код потребителя.
|
|
284
|
-
zIndex:
|
|
284
|
+
zIndex: `var(--${i()}-select-popup-z, 10010)`,
|
|
285
285
|
display: "block",
|
|
286
286
|
// Не уже поля: при `width: auto` портальный список
|
|
287
287
|
// сжимался по содержимому и обрезал названия узлов.
|
|
288
288
|
// Ширину задаём минимальной, чтобы дерево по-прежнему
|
|
289
289
|
// могло раздаться под вложенность.
|
|
290
|
-
minWidth:
|
|
290
|
+
minWidth: O == null ? void 0 : O.width,
|
|
291
291
|
width: "auto"
|
|
292
292
|
},
|
|
293
|
-
|
|
293
|
+
ze(be, we)
|
|
294
294
|
),
|
|
295
|
-
className: "
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
className: d("selectbox-options"),
|
|
296
|
+
children: /* @__PURE__ */ x("div", { className: "treeview", children: [
|
|
297
|
+
l == null ? void 0 : l.map((e) => /* @__PURE__ */ n(z, { node: e, counter: 0 }, e.id)),
|
|
298
|
+
o && g && !(l != null && l.length) && /* @__PURE__ */ n("div", { className: d("selectbox-empty-text"), children: "Ничего не найдено" })
|
|
299
299
|
] })
|
|
300
300
|
}
|
|
301
301
|
),
|
|
302
302
|
document.body
|
|
303
|
-
) : /* @__PURE__ */
|
|
303
|
+
) : /* @__PURE__ */ n(
|
|
304
304
|
"div",
|
|
305
305
|
{
|
|
306
|
-
ref:
|
|
307
|
-
className: "
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
-
|
|
310
|
-
|
|
306
|
+
ref: E,
|
|
307
|
+
className: d("selectbox-options"),
|
|
308
|
+
children: /* @__PURE__ */ x("div", { className: "treeview", children: [
|
|
309
|
+
l == null ? void 0 : l.map((e) => /* @__PURE__ */ n(z, { node: e, counter: 0 }, e.id)),
|
|
310
|
+
o && g && !(l != null && l.length) && /* @__PURE__ */ n("div", { className: d("selectbox-empty-text"), children: "Ничего не найдено" })
|
|
311
311
|
] })
|
|
312
312
|
}
|
|
313
313
|
)
|
|
@@ -317,7 +317,7 @@ const ot = ({
|
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
|
-
|
|
320
|
+
j.showText && /* @__PURE__ */ n("h5", { className: "h5 clr-red-main", style: ue ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative", marginTop: "calc(4 * var(--u-unit, 1px))" }, children: j.text })
|
|
321
321
|
] });
|
|
322
322
|
};
|
|
323
|
-
export {
|
|
323
|
+
export { lt as TreeView$u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualList.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualList/VirtualList.tsx"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;AACnE,OAAO,EAAmC,KAAK,aAAa,EAAqB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5I,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"VirtualList.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualList/VirtualList.tsx"],"names":[],"mappings":"AAAA,OAAO,2DAA2D,CAAC;AACnE,OAAO,EAAmC,KAAK,aAAa,EAAqB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5I,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGjF,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,UAAU,CAAC;IAC/C,6DAA6D;IAC7D,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,mEAAmE;IACnE,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACxE;AAkED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAmC,CAAC,CAAC,EAC3D,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAC1D,YAAY,CAAC"}
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import { jsxs as B, jsx as
|
|
1
|
+
import { jsxs as B, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useVirtualList$u as
|
|
3
|
+
import { forwardRef as R, useImperativeHandle as S } from "react";
|
|
4
|
+
import { useVirtualList$u as k } from "../../hooks/useVirtualList.js";
|
|
5
|
+
import { kitCls$u as l } from "../../shared/uiKitDefaults.js";
|
|
5
6
|
function E({
|
|
6
|
-
items:
|
|
7
|
-
getKey:
|
|
8
|
-
renderItem:
|
|
9
|
-
estimateSize:
|
|
10
|
-
overscan:
|
|
11
|
-
height:
|
|
12
|
-
scrollElement:
|
|
7
|
+
items: i,
|
|
8
|
+
getKey: m,
|
|
9
|
+
renderItem: c,
|
|
10
|
+
estimateSize: u,
|
|
11
|
+
overscan: d,
|
|
12
|
+
height: t,
|
|
13
|
+
scrollElement: f,
|
|
13
14
|
busy: v,
|
|
14
|
-
footer:
|
|
15
|
-
empty:
|
|
16
|
-
"aria-label":
|
|
17
|
-
"aria-labelledby":
|
|
18
|
-
className:
|
|
19
|
-
itemClassName:
|
|
20
|
-
style:
|
|
21
|
-
},
|
|
22
|
-
const { listRef:
|
|
23
|
-
items:
|
|
24
|
-
getKey:
|
|
25
|
-
estimateSize:
|
|
26
|
-
overscan:
|
|
27
|
-
scrollElement:
|
|
15
|
+
footer: p,
|
|
16
|
+
empty: e,
|
|
17
|
+
"aria-label": b,
|
|
18
|
+
"aria-labelledby": h,
|
|
19
|
+
className: N,
|
|
20
|
+
itemClassName: _,
|
|
21
|
+
style: s
|
|
22
|
+
}, y) {
|
|
23
|
+
const { listRef: j, virtualItems: I, totalSize: w, measureElement: x, scrollToIndex: o } = k({
|
|
24
|
+
items: i,
|
|
25
|
+
getKey: m,
|
|
26
|
+
estimateSize: u,
|
|
27
|
+
overscan: d,
|
|
28
|
+
scrollElement: f
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */ B("div", { className:
|
|
32
|
-
/* @__PURE__ */
|
|
30
|
+
S(y, () => ({ scrollToIndex: o }), [o]);
|
|
31
|
+
const n = t !== void 0, C = [l("virtual-list"), n && l("virtual-list--scroll"), N].filter(Boolean).join(" "), L = [l("virtual-list__item"), _].filter(Boolean).join(" ");
|
|
32
|
+
return /* @__PURE__ */ B("div", { className: C, style: n ? { height: t, ...s } : s, children: [
|
|
33
|
+
/* @__PURE__ */ r(
|
|
33
34
|
"ul",
|
|
34
35
|
{
|
|
35
|
-
ref:
|
|
36
|
+
ref: j,
|
|
36
37
|
role: "list",
|
|
37
|
-
className: "
|
|
38
|
-
style: { height:
|
|
39
|
-
"aria-label":
|
|
40
|
-
"aria-labelledby":
|
|
38
|
+
className: l("virtual-list__inner"),
|
|
39
|
+
style: { height: w },
|
|
40
|
+
"aria-label": b,
|
|
41
|
+
"aria-labelledby": h,
|
|
41
42
|
"aria-busy": v || void 0,
|
|
42
|
-
children:
|
|
43
|
+
children: I.map(({ key: V, index: a, start: g, item: z }) => /* @__PURE__ */ r(
|
|
43
44
|
"li",
|
|
44
45
|
{
|
|
45
|
-
ref:
|
|
46
|
+
ref: x,
|
|
46
47
|
"data-index": a,
|
|
47
48
|
className: L,
|
|
48
49
|
style: { top: g },
|
|
49
|
-
"aria-setsize":
|
|
50
|
+
"aria-setsize": i.length,
|
|
50
51
|
"aria-posinset": a + 1,
|
|
51
|
-
children:
|
|
52
|
+
children: c(z, a)
|
|
52
53
|
},
|
|
53
54
|
V
|
|
54
55
|
))
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
!
|
|
58
|
-
|
|
58
|
+
!i.length && e !== void 0 && /* @__PURE__ */ r("div", { className: l("virtual-list__empty"), children: e }),
|
|
59
|
+
p
|
|
59
60
|
] });
|
|
60
61
|
}
|
|
61
|
-
const
|
|
62
|
-
export {
|
|
62
|
+
const F = R(E);
|
|
63
|
+
export { F as VirtualList$u };
|