@ryuzaki13/react-foundation-ui 3.4.3 → 3.5.0
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/badge/index.js +65 -2
- package/dist/badge/index.js.map +1 -0
- package/dist/barcode-scanner/index.js +18 -18
- package/dist/base-table/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/check-box/index.js +1 -1
- package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
- package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
- package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
- package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
- package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
- package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
- package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
- package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
- package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
- package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
- package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
- package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
- package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
- package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
- package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
- package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
- package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
- package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
- package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
- package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
- package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
- package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
- package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
- package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
- package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
- package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
- package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
- package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
- package/dist/chunks/popover-yl5DVe06.js +245 -0
- package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
- package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
- package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
- package/dist/chunks/select-DblNSc5H.js +363 -0
- package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
- package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
- package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
- package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
- package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
- package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
- package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
- package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
- package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
- package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
- package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-range-preset-select/index.js +1 -1
- package/dist/date-time-input/index.js +122 -122
- package/dist/date-time-input/index.js.map +1 -1
- package/dist/detail/index.js +22 -22
- package/dist/dialog/index.js +1 -1
- package/dist/disclosure/index.js +9 -9
- package/dist/drop-zone/index.js +21 -21
- package/dist/errors/index.js +50 -50
- package/dist/expandable-action-panel/index.js +24 -24
- package/dist/flex/index.js +1 -1
- package/dist/flex/useFlexClasses.d.ts +1 -1
- package/dist/floating-arrow/index.js +1 -1
- package/dist/fullscreen-portal/index.js +8 -8
- package/dist/image/index.js +119 -119
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +55 -55
- package/dist/input-file/index.js +16 -16
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +17 -17
- package/dist/input-search/index.js +30 -2
- package/dist/input-search/index.js.map +1 -0
- package/dist/layout-picker/index.js +93 -93
- package/dist/layout-picker/index.js.map +1 -1
- package/dist/list/index.js +39 -39
- package/dist/listbox/index.js +33 -33
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +466 -2
- package/dist/multi-select/index.js.map +1 -0
- package/dist/notifications/index.js +45 -45
- package/dist/option/index.js +30 -30
- package/dist/period-select/index.js +7 -7
- package/dist/picker/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +10 -10
- package/dist/preset-select/index.js +1 -1
- package/dist/radio-button/index.js +9 -9
- package/dist/radio-group/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/separator/index.js +1 -1
- package/dist/simple-table/index.js +5 -5
- package/dist/slider/index.js +82 -82
- package/dist/slider/index.js.map +1 -1
- package/dist/sortable/index.js +1 -1
- package/dist/splitter/index.js +55 -55
- package/dist/state-select/index.js +17 -17
- package/dist/styles.css +1 -1
- package/dist/switch/index.js +18 -18
- package/dist/table/index.js +1 -1
- package/dist/table-column-interactions/index.js +1 -1
- package/dist/table-editor/index.js +99 -99
- package/dist/table-sorting/index.js +13 -13
- package/dist/tabs/index.js +83 -83
- package/dist/tag-input/index.js +58 -58
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text/index.js +18 -18
- package/dist/text-editor/index.js +3 -3
- package/dist/textarea/index.js +1 -1
- package/dist/three-scene/index.js +7 -7
- package/dist/toggle/index.js +20 -20
- package/dist/toolbar/index.js +16 -16
- package/dist/tree/index.js +24 -24
- package/dist/tree-select/index.js +189 -189
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +33 -33
- package/dist/tree-table/index.js.map +1 -1
- package/dist/wheel-picker/index.js +1 -1
- package/package.json +1 -5
- package/storybook-static/project.json +1 -1
- package/dist/advanced-search/index.d.ts +0 -3
- package/dist/advanced-search/index.d.ts.map +0 -1
- package/dist/advanced-search/index.js +0 -399
- package/dist/advanced-search/index.js.map +0 -1
- package/dist/advanced-search/lib/index.d.ts +0 -2
- package/dist/advanced-search/lib/index.d.ts.map +0 -1
- package/dist/advanced-search/lib/searchParts.d.ts +0 -3
- package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
- package/dist/advanced-search/model/index.d.ts +0 -5
- package/dist/advanced-search/model/index.d.ts.map +0 -1
- package/dist/advanced-search/model/types.d.ts +0 -55
- package/dist/advanced-search/model/types.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
- package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
- package/dist/advanced-search/ui/index.d.ts +0 -2
- package/dist/advanced-search/ui/index.d.ts.map +0 -1
- package/dist/chunks/badge-6mXO9BWP.js +0 -65
- package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
- package/dist/chunks/input-search-Cat4c7SM.js +0 -30
- package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
- package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
- package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
- package/dist/chunks/popover-Bne-Ljbs.js +0 -245
- package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
- package/dist/chunks/select-aTGupQan.js +0 -363
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { s as e } from "../chunks/input-
|
|
2
|
-
import { t } from "../chunks/
|
|
3
|
-
import { Option as
|
|
4
|
-
import {
|
|
1
|
+
import { s as e } from "../chunks/input-CuRK9Vbz.js";
|
|
2
|
+
import { f as t, g as n, i as r, n as i, r as a, s as o, t as s, u as c, v as l } from "../chunks/picker-BA6okKnz.js";
|
|
3
|
+
import { Option as u, OptionButton as d } from "../option/index.js";
|
|
4
|
+
import { t as f } from "../chunks/check-box-D_Y6iIWv.js";
|
|
5
5
|
import { r as p } from "../chunks/defaultRenderers-u_Vep6Pj.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { compareStrings as
|
|
6
|
+
import { cn as m, findFirstEnabledIndex as h, findLastEnabledIndex as g, findNextEnabledIndex as _ } from "@ryuzaki13/react-foundation-lib/utils";
|
|
7
|
+
import { ChevronRightIcon as v } from "lucide-react";
|
|
8
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback as ee, useLayoutEffect as te, useMemo as S, useRef as C, useState as ne } from "react";
|
|
10
|
+
import { flattenODataDependentServices as w, sortODataDependentSegmentItemsByChains as T, useODataCollection as re, useODataCollectionChains as E, useODataCollectionModel as D } from "@ryuzaki13/react-foundation-api/odata";
|
|
11
|
+
import { compareStrings as O } from "@ryuzaki13/react-foundation-lib/string-comparison";
|
|
12
12
|
//#region src/tree-select/helpers.ts
|
|
13
|
-
function
|
|
13
|
+
function k(e) {
|
|
14
14
|
return e ? { [e.codeKey]: [e.value] } : {};
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
@@ -45,7 +45,7 @@ function A(e) {
|
|
|
45
45
|
function se(e, t) {
|
|
46
46
|
e.sort((e, n) => {
|
|
47
47
|
let r = t ? e.sortCode : e.label, i = t ? n.sortCode : n.label;
|
|
48
|
-
return
|
|
48
|
+
return O(r, i) || O(e.sortCode, n.sortCode);
|
|
49
49
|
});
|
|
50
50
|
for (let n of e) se(n.children, t);
|
|
51
51
|
}
|
|
@@ -84,12 +84,12 @@ function ce({ items: e, orderedCodeKeys: t, keyPairsMap: n, hiddenCodeKeys: r, t
|
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/tree-select/model/resolveOrderedTreeSegmentItems.ts
|
|
86
86
|
function le(e, t, n) {
|
|
87
|
-
return
|
|
87
|
+
return T(e, t, n);
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/tree-select/model/useODataTreeData.ts
|
|
91
91
|
function ue(e, t, n) {
|
|
92
|
-
return
|
|
92
|
+
return w([{
|
|
93
93
|
odata: e,
|
|
94
94
|
segments: t,
|
|
95
95
|
model: n
|
|
@@ -99,28 +99,28 @@ function de(e) {
|
|
|
99
99
|
return e[0]?.id;
|
|
100
100
|
}
|
|
101
101
|
function fe({ odata: e, segments: t, model: n, segmentOrder: r, allowEmptyCodeKeys: i }) {
|
|
102
|
-
let a = `${e.service}.${e.target}`, o =
|
|
102
|
+
let a = `${e.service}.${e.target}`, o = S(() => ue(e, t, n), [
|
|
103
103
|
e,
|
|
104
104
|
t,
|
|
105
105
|
n
|
|
106
|
-
]), s =
|
|
106
|
+
]), s = E([e]), c = S(() => le(o, s, r), [
|
|
107
107
|
o,
|
|
108
108
|
s,
|
|
109
109
|
r
|
|
110
|
-
]), l =
|
|
110
|
+
]), l = S(() => c.map((e) => e.id), [c]), u = S(() => new Set(i), [i]), d = de(c) ?? Object.keys(t)[0], f = D({
|
|
111
111
|
codeKey: d,
|
|
112
112
|
...n
|
|
113
|
-
}), p =
|
|
113
|
+
}), p = re({
|
|
114
114
|
odata: e,
|
|
115
115
|
model: f
|
|
116
|
-
}), { hiddenCodeKeys: m, textValueCodeKeys: h } =
|
|
116
|
+
}), { hiddenCodeKeys: m, textValueCodeKeys: h } = S(() => {
|
|
117
117
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
118
118
|
for (let r of c) (r.segment.hideCode ?? e.hideCode) && t.add(r.id), r.segment.selectText && n.add(r.id);
|
|
119
119
|
return {
|
|
120
120
|
hiddenCodeKeys: t,
|
|
121
121
|
textValueCodeKeys: n
|
|
122
122
|
};
|
|
123
|
-
}, [e.hideCode, c]),
|
|
123
|
+
}, [e.hideCode, c]), g = S(() => ce({
|
|
124
124
|
items: p.data?.items ?? [],
|
|
125
125
|
orderedCodeKeys: l,
|
|
126
126
|
keyPairsMap: p.data?.keyPairsMap ?? {},
|
|
@@ -136,15 +136,15 @@ function fe({ odata: e, segments: t, model: n, segmentOrder: r, allowEmptyCodeKe
|
|
|
136
136
|
e.sortByCode,
|
|
137
137
|
l,
|
|
138
138
|
h
|
|
139
|
-
]),
|
|
139
|
+
]), _ = c[0]?.segment.placeholder ?? "Выберите значение", v = !!s[a]?.length;
|
|
140
140
|
return {
|
|
141
|
-
nodes:
|
|
141
|
+
nodes: g,
|
|
142
142
|
orderedSegmentItems: c,
|
|
143
143
|
orderedCodeKeys: l,
|
|
144
144
|
isLoading: p.isLoading,
|
|
145
145
|
isError: p.isError,
|
|
146
|
-
placeholder:
|
|
147
|
-
hasResolvedChain:
|
|
146
|
+
placeholder: _,
|
|
147
|
+
hasResolvedChain: v
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
@@ -152,7 +152,7 @@ function fe({ odata: e, segments: t, model: n, segmentOrder: r, allowEmptyCodeKe
|
|
|
152
152
|
function M(e, t) {
|
|
153
153
|
return `${e}::${t}`;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function pe(e) {
|
|
156
156
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = 0, l = (e, u) => {
|
|
157
157
|
t.set(e.id, e), n.set(e.id, u), i.set(e.id, c++);
|
|
158
158
|
let d = M(e.codeKey, e.value);
|
|
@@ -176,20 +176,20 @@ function N(e) {
|
|
|
176
176
|
subtreeContainsDisabledById: s
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function N(e, t) {
|
|
180
180
|
let n = t.nodeById.get(e);
|
|
181
181
|
return n ? t.nodeIdsByCodeValue.get(M(n.codeKey, n.value)) ?? [] : [];
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function me(e, t) {
|
|
184
184
|
if (e) return t.nodeIdByCodeValue.get(M(e.codeKey, e.value));
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function P(e, t) {
|
|
187
187
|
let n = /* @__PURE__ */ new Set();
|
|
188
188
|
if (!e) return n;
|
|
189
189
|
for (let [r, i] of Object.entries(e)) for (let e of i) for (let i of t.nodeIdsByCodeValue.get(M(r, e)) ?? []) n.add(i);
|
|
190
190
|
return ve(n, t);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function F(e, t) {
|
|
193
193
|
let n = [...e].sort((e, n) => (t.preorderIndexById.get(e) ?? 2 ** 53 - 1) - (t.preorderIndexById.get(n) ?? 2 ** 53 - 1)), r = {}, i = /* @__PURE__ */ new Set();
|
|
194
194
|
for (let e of n) {
|
|
195
195
|
let n = t.nodeById.get(e);
|
|
@@ -199,12 +199,12 @@ function I(e, t) {
|
|
|
199
199
|
}
|
|
200
200
|
return r;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function he(e, t) {
|
|
203
203
|
let n = [], r = t.parentById.get(e);
|
|
204
204
|
for (; r;) n.push(r), r = t.parentById.get(r);
|
|
205
205
|
return n;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function ge(e, t, n) {
|
|
208
208
|
let r = n.parentById.get(e);
|
|
209
209
|
for (; r;) {
|
|
210
210
|
if (r === t) return !0;
|
|
@@ -212,18 +212,18 @@ function he(e, t, n) {
|
|
|
212
212
|
}
|
|
213
213
|
return !1;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
let n =
|
|
215
|
+
function I(e, t) {
|
|
216
|
+
let n = N(e, t);
|
|
217
217
|
return !n.length || n.some((e) => {
|
|
218
218
|
let n = t.nodeById.get(e);
|
|
219
219
|
return !n || n.selectionBehavior === "descendants" || t.subtreeContainsDisabledById.get(e) === !0;
|
|
220
|
-
}) ? !1 : !n.some((e, r) => n.some((n, i) => r !== i && (
|
|
220
|
+
}) ? !1 : !n.some((e, r) => n.some((n, i) => r !== i && (ge(e, n, t) || ge(n, e, t))));
|
|
221
221
|
}
|
|
222
222
|
function _e(e, t) {
|
|
223
|
-
return
|
|
223
|
+
return I(e, t) ? N(e, t) : [e];
|
|
224
224
|
}
|
|
225
225
|
function L(e, t, n) {
|
|
226
|
-
for (let r of [...e])
|
|
226
|
+
for (let r of [...e]) ge(r, t, n) && e.delete(r);
|
|
227
227
|
}
|
|
228
228
|
function R(e, t, n) {
|
|
229
229
|
let r = [t];
|
|
@@ -231,7 +231,7 @@ function R(e, t, n) {
|
|
|
231
231
|
let i = r[t];
|
|
232
232
|
if (i) {
|
|
233
233
|
r.push(...n.childrenById.get(i) ?? []);
|
|
234
|
-
for (let t of
|
|
234
|
+
for (let t of N(i, n)) e.delete(t);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -252,13 +252,13 @@ function ve(e, t) {
|
|
|
252
252
|
n.delete(e);
|
|
253
253
|
for (let r of W(t, t.childrenById.get(e) ?? [])) n.add(r);
|
|
254
254
|
}
|
|
255
|
-
for (let e of [...n])
|
|
255
|
+
for (let e of [...n]) he(e, t).some((e) => n.has(e)) && n.delete(e);
|
|
256
256
|
let r = [...t.nodeById.keys()].sort((e, n) => (t.preorderIndexById.get(n) ?? 0) - (t.preorderIndexById.get(e) ?? 0));
|
|
257
257
|
for (let e of r) {
|
|
258
258
|
let r = t.childrenById.get(e) ?? [];
|
|
259
259
|
if (!(r.length === 0 || n.has(e) || t.nodeById.get(e)?.disabled || t.nodeById.get(e)?.selectionBehavior === "descendants") && r.every((e) => z(e, n, t))) {
|
|
260
|
-
let r =
|
|
261
|
-
if (
|
|
260
|
+
let r = N(e, t);
|
|
261
|
+
if (I(e, t) && r.every((e) => {
|
|
262
262
|
let r = t.nodeById.get(e);
|
|
263
263
|
return r && !r.disabled && r.selectionBehavior !== "descendants" && z(e, n, t);
|
|
264
264
|
})) for (let e of r) L(n, e, t), n.add(e);
|
|
@@ -270,7 +270,7 @@ function V(e, t, n) {
|
|
|
270
270
|
let r = n.parentById.get(t);
|
|
271
271
|
for (; r;) {
|
|
272
272
|
if (e.has(r)) {
|
|
273
|
-
for (let t of
|
|
273
|
+
for (let t of N(r, n)) if (e.has(t)) {
|
|
274
274
|
e.delete(t);
|
|
275
275
|
for (let r of W(n, n.childrenById.get(t) ?? [])) e.add(r);
|
|
276
276
|
}
|
|
@@ -281,7 +281,7 @@ function V(e, t, n) {
|
|
|
281
281
|
return !1;
|
|
282
282
|
}
|
|
283
283
|
function H(e, t, n) {
|
|
284
|
-
return t.has(e) ? !0 :
|
|
284
|
+
return t.has(e) ? !0 : he(e, n).some((e) => t.has(e));
|
|
285
285
|
}
|
|
286
286
|
function U(e, t, n, r) {
|
|
287
287
|
let i = n.childrenById.get(e) ?? [];
|
|
@@ -324,7 +324,7 @@ function W(e, t = e.rootIds) {
|
|
|
324
324
|
containsDisabled: o,
|
|
325
325
|
selectedIds: a
|
|
326
326
|
};
|
|
327
|
-
let s = !
|
|
327
|
+
let s = !I(t, e);
|
|
328
328
|
return o || s ? {
|
|
329
329
|
containsDisabled: !0,
|
|
330
330
|
selectedIds: a
|
|
@@ -336,8 +336,8 @@ function W(e, t = e.rootIds) {
|
|
|
336
336
|
return new Set(t.flatMap((e) => n(e).selectedIds));
|
|
337
337
|
}
|
|
338
338
|
function G(e, t, n, r) {
|
|
339
|
-
let i =
|
|
340
|
-
if (!a && z(t, i, n)) return R(i, t, n),
|
|
339
|
+
let i = P(e, n), a = r !== void 0 && !B(t, n, r);
|
|
340
|
+
if (!a && z(t, i, n)) return R(i, t, n), F(ve(i, n), n);
|
|
341
341
|
let o = (e) => {
|
|
342
342
|
if (i.has(e)) {
|
|
343
343
|
R(i, e, n);
|
|
@@ -364,7 +364,7 @@ function G(e, t, n, r) {
|
|
|
364
364
|
let t = H(e, i, n) || z(e, i, n);
|
|
365
365
|
(u && t || !u && !t) && o(e);
|
|
366
366
|
}
|
|
367
|
-
return
|
|
367
|
+
return F(ve(i, n), n);
|
|
368
368
|
}
|
|
369
369
|
function be(e, t, n) {
|
|
370
370
|
let r = t.parentById.get(e);
|
|
@@ -511,48 +511,48 @@ var X = {
|
|
|
511
511
|
};
|
|
512
512
|
//#endregion
|
|
513
513
|
//#region src/tree-select/TreeNodeContent.tsx
|
|
514
|
-
function Pe({ node: e, level:
|
|
515
|
-
let
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
514
|
+
function Pe({ node: e, level: t, highlight: n, hasChildren: r, isExpanded: i, selected: a, partial: o, selectionMode: s, optionsLayout: c = "tree", onToggleExpand: l, onToggleSelection: u, onActivate: p }) {
|
|
515
|
+
let h = c === "tree", g = c === "columns" && t === 0;
|
|
516
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
517
|
+
/* @__PURE__ */ b("div", {
|
|
518
518
|
className: X.treeIndent,
|
|
519
|
-
style: { "--tree-level":
|
|
519
|
+
style: { "--tree-level": t },
|
|
520
520
|
"aria-hidden": "true"
|
|
521
521
|
}),
|
|
522
|
-
|
|
522
|
+
h && r ? /* @__PURE__ */ b("button", {
|
|
523
523
|
type: "button",
|
|
524
524
|
className: X.treeExpander,
|
|
525
525
|
onClick: (e) => {
|
|
526
|
-
e.stopPropagation(),
|
|
526
|
+
e.stopPropagation(), l?.();
|
|
527
527
|
},
|
|
528
|
-
"aria-label":
|
|
528
|
+
"aria-label": i ? "Свернуть ветку" : "Развернуть ветку",
|
|
529
529
|
"data-ui": "tree-select-expander",
|
|
530
|
-
"data-action":
|
|
531
|
-
children: /* @__PURE__ */
|
|
532
|
-
}) :
|
|
530
|
+
"data-action": i ? "collapse-tree-select-node" : "expand-tree-select-node",
|
|
531
|
+
children: /* @__PURE__ */ b(v, { className: m(X.treeExpanderIcon, i && X.treeExpanderIconExpanded) })
|
|
532
|
+
}) : h ? /* @__PURE__ */ b("div", {
|
|
533
533
|
className: X.treeExpanderPlaceholder,
|
|
534
534
|
"aria-hidden": "true"
|
|
535
535
|
}) : null,
|
|
536
|
-
|
|
536
|
+
s === "multi" ? /* @__PURE__ */ b("div", {
|
|
537
537
|
className: X.treeColumnCheckBox,
|
|
538
538
|
onMouseDown: (e) => e.stopPropagation(),
|
|
539
539
|
onClick: (e) => e.stopPropagation(),
|
|
540
|
-
children: /* @__PURE__ */
|
|
541
|
-
value:
|
|
542
|
-
indeterminate:
|
|
540
|
+
children: /* @__PURE__ */ b(f, {
|
|
541
|
+
value: a,
|
|
542
|
+
indeterminate: o,
|
|
543
543
|
disabled: e.disabled,
|
|
544
544
|
"aria-label": `Выбрать ${e.label}`,
|
|
545
|
-
onChange: () =>
|
|
545
|
+
onChange: () => u?.()
|
|
546
546
|
})
|
|
547
547
|
}) : null,
|
|
548
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ b(d, {
|
|
549
549
|
className: X.treeNodeButton,
|
|
550
550
|
tabIndex: -1,
|
|
551
551
|
disabled: e.disabled,
|
|
552
552
|
text: e.label,
|
|
553
553
|
code: e.code,
|
|
554
|
-
searchText:
|
|
555
|
-
emphasizeContent:
|
|
554
|
+
searchText: n,
|
|
555
|
+
emphasizeContent: g,
|
|
556
556
|
onMouseDown: (e) => e.preventDefault(),
|
|
557
557
|
onClick: p
|
|
558
558
|
})
|
|
@@ -560,29 +560,29 @@ function Pe({ node: e, level: n, highlight: i, hasChildren: a, isExpanded: o, se
|
|
|
560
560
|
}
|
|
561
561
|
//#endregion
|
|
562
562
|
//#region src/tree-select/TreePickerBase.tsx
|
|
563
|
-
function Z({ label:
|
|
564
|
-
let
|
|
563
|
+
function Z({ label: i, description: d, disabled: f, placeholder: p, size: v, nodes: w, selectedIds: T, partialIds: re, selectionMode: E, optionsLayout: D = "tree", defaultExpandedCodeKeys: O, unavailableNodeIds: k, open: ie, onOpenChange: ae, bulkActions: oe, triggerMode: A = "display", selectedSummary: se, selectedSummaryText: j, query: ce, defaultQuery: le, onQuery: ue, onNodeActivate: de, onNodeToggleSelection: fe, onClearSelection: M, isLoading: N, error: me }) {
|
|
564
|
+
let P = C(null), F = C(null), he = C([]), [ge, I] = ne(!1), [_e, L] = ne(), R = ie !== void 0, z = R ? ie : ge, [B, ve] = ne(() => /* @__PURE__ */ new Map()), V = A === "search" ? E === "multi" ? "search-multi" : "search-single" : "display", U = S(() => pe(w), [w]), ye = S(() => new Set(O), [O]), { query: W, setQuery: G, resetQueryOnClose: be } = a({
|
|
565
565
|
query: ce,
|
|
566
566
|
defaultQuery: le,
|
|
567
567
|
onQuery: ue,
|
|
568
568
|
triggerMode: V
|
|
569
569
|
}), Ce = (e) => {
|
|
570
|
-
z && !e && be && G(""), e || L(void 0), R ||
|
|
571
|
-
}, { nodes: K, expandedIds: De } =
|
|
570
|
+
z && !e && be && G(""), e || L(void 0), R || I(e), ae?.(e);
|
|
571
|
+
}, { nodes: K, expandedIds: De } = S(() => we(w, W), [w, W]), Oe = S(() => pe(K), [K]), q = W.trim().length > 0 ? Oe : void 0, ke = S(() => xe(T, U), [T, U]), Ae = S(() => Se(U, ye, B), [
|
|
572
572
|
ye,
|
|
573
573
|
B,
|
|
574
574
|
U
|
|
575
|
-
]), je =
|
|
575
|
+
]), je = S(() => new Set([...U.childrenById].filter(([, e]) => e.length > 0).map(([e]) => e)), [U]), J = S(() => D === "columns" ? je : /* @__PURE__ */ new Set([
|
|
576
576
|
...Ae,
|
|
577
577
|
...De,
|
|
578
578
|
...ke
|
|
579
579
|
]), [
|
|
580
580
|
je,
|
|
581
581
|
Ae,
|
|
582
|
-
|
|
582
|
+
D,
|
|
583
583
|
De,
|
|
584
584
|
ke
|
|
585
|
-
]), Y =
|
|
585
|
+
]), Y = S(() => Te(K, J), [K, J]), Me = S(() => Y.findIndex((e) => T.has(e.node.id)), [T, Y]), Z = ee((e) => e.node.disabled === !0 || k?.has(e.node.id) === !0, [k]), Fe = S(() => Ee(Y), [Y]), Ie = ee((e) => {
|
|
586
586
|
let t = Ne({
|
|
587
587
|
...e,
|
|
588
588
|
descriptor: Fe
|
|
@@ -598,36 +598,36 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
598
598
|
"--tree-row-count": String(t.rowCount),
|
|
599
599
|
...n
|
|
600
600
|
};
|
|
601
|
-
}, [Fe]), { activeIndex: Q, context: Le, floatingStyles: Re, getFloatingProps: ze, setReference: Be, setFloating: Ve, setOptionRef: He, close: Ue, openList: We, toggleOpen: Ge, selectOption: Ke, handleReferenceKeyDown: qe, handleFloatingKeyDown: Je, getOptionId: Ye, getActiveOptionId: Xe } =
|
|
601
|
+
}, [Fe]), { activeIndex: Q, context: Le, floatingStyles: Re, getFloatingProps: ze, setReference: Be, setFloating: Ve, setOptionRef: He, close: Ue, openList: We, toggleOpen: Ge, selectOption: Ke, handleReferenceKeyDown: qe, handleFloatingKeyDown: Je, getOptionId: Ye, getActiveOptionId: Xe } = r({
|
|
602
602
|
options: Y,
|
|
603
603
|
selectedIndex: Me,
|
|
604
604
|
open: z,
|
|
605
605
|
onOpenChange: Ce,
|
|
606
606
|
onSelect: (e) => de(e.node, q),
|
|
607
607
|
getOptionDisabled: Z,
|
|
608
|
-
disabled:
|
|
608
|
+
disabled: f || N,
|
|
609
609
|
closeOnSelect: !0,
|
|
610
610
|
allowOpenWithoutOptions: !0,
|
|
611
611
|
triggerMode: V,
|
|
612
|
-
placementStrategy:
|
|
613
|
-
resolveFloatingSize:
|
|
614
|
-
}), Ze = _e ? Y.findIndex((e) => e.node.id === _e) : -1, Qe = Ze >= 0 ? Ze : Q, $e = Le.update, et =
|
|
612
|
+
placementStrategy: D === "columns" ? "auto" : "flip",
|
|
613
|
+
resolveFloatingSize: D === "columns" ? Ie : void 0
|
|
614
|
+
}), Ze = _e ? Y.findIndex((e) => e.node.id === _e) : -1, Qe = Ze >= 0 ? Ze : Q, $e = Le.update, et = T.size > 0, tt = A === "search" && (z || W.length > 0), nt = tt ? W : j ?? "", $ = s({
|
|
615
615
|
mode: V,
|
|
616
616
|
open: z,
|
|
617
617
|
currentQuery: W,
|
|
618
618
|
hasDisplayValue: !!j,
|
|
619
|
-
inputRef:
|
|
619
|
+
inputRef: P,
|
|
620
620
|
setQuery: G,
|
|
621
621
|
openList: We,
|
|
622
622
|
close: Ue,
|
|
623
623
|
toggleOpen: Ge
|
|
624
|
-
}), rt =
|
|
624
|
+
}), rt = D === "columns" && E === "multi" && oe, it = A === "display", at = rt || it ? /* @__PURE__ */ x("div", {
|
|
625
625
|
className: X.treePopupHeader,
|
|
626
|
-
children: [rt ? /* @__PURE__ */
|
|
626
|
+
children: [rt ? /* @__PURE__ */ b(n, {
|
|
627
627
|
onSelectAll: oe.onSelectAll,
|
|
628
628
|
onDeselectAll: oe.onDeselectAll,
|
|
629
|
-
selectAllButtonRef:
|
|
630
|
-
}) : null, it ? /* @__PURE__ */
|
|
629
|
+
selectAllButtonRef: F
|
|
630
|
+
}) : null, it ? /* @__PURE__ */ b(e, {
|
|
631
631
|
value: W,
|
|
632
632
|
onChange: G,
|
|
633
633
|
onClear: () => G(""),
|
|
@@ -640,39 +640,39 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
640
640
|
}
|
|
641
641
|
}) : null]
|
|
642
642
|
}) : void 0;
|
|
643
|
-
|
|
644
|
-
z &&
|
|
643
|
+
te(() => {
|
|
644
|
+
z && D === "columns" && $e();
|
|
645
645
|
}, [
|
|
646
646
|
Fe.signature,
|
|
647
647
|
z,
|
|
648
|
-
|
|
648
|
+
D,
|
|
649
649
|
$e
|
|
650
650
|
]);
|
|
651
651
|
let ot = (e) => {
|
|
652
|
-
|
|
652
|
+
P.current = e;
|
|
653
653
|
}, st = () => {
|
|
654
|
-
M?.(), G(""),
|
|
654
|
+
M?.(), G(""), E === "single" && Ue();
|
|
655
655
|
}, ct = (e) => {
|
|
656
656
|
e.hasChildren && ve((t) => {
|
|
657
657
|
let n = new Map(t), r = t.get(e.node.id) ?? ye.has(e.node.codeKey);
|
|
658
658
|
return n.set(e.node.id, !r), n;
|
|
659
659
|
});
|
|
660
660
|
}, lt = (e) => {
|
|
661
|
-
|
|
661
|
+
he.current[e]?.focus();
|
|
662
662
|
}, ut = (e, t, n) => {
|
|
663
663
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
664
664
|
e.preventDefault();
|
|
665
665
|
let t = e.key === "ArrowDown" ? 1 : -1;
|
|
666
|
-
lt(
|
|
666
|
+
lt(_(Y, n, t, Z));
|
|
667
667
|
return;
|
|
668
668
|
}
|
|
669
669
|
if (e.key === "Home" || e.key === "End") {
|
|
670
670
|
e.preventDefault();
|
|
671
|
-
let t = e.key === "Home" ?
|
|
671
|
+
let t = e.key === "Home" ? h(Y, Z) : g(Y, Z);
|
|
672
672
|
lt(t);
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
|
-
if (
|
|
675
|
+
if (D === "tree" && e.key === "ArrowRight") {
|
|
676
676
|
if (e.preventDefault(), t.hasChildren && !t.isExpanded) {
|
|
677
677
|
ct(t);
|
|
678
678
|
return;
|
|
@@ -681,7 +681,7 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
681
681
|
t.isExpanded && r?.parentId === t.node.id && lt(n + 1);
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
if (
|
|
684
|
+
if (D === "tree" && e.key === "ArrowLeft") {
|
|
685
685
|
if (e.preventDefault(), t.hasChildren && t.isExpanded) {
|
|
686
686
|
ct(t);
|
|
687
687
|
return;
|
|
@@ -689,31 +689,31 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
689
689
|
t.parentId && lt(Y.findIndex((e) => e.node.id === t.parentId));
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
|
-
if (e.key === " " &&
|
|
692
|
+
if (e.key === " " && E === "multi" && !Z(t)) {
|
|
693
693
|
e.preventDefault(), fe?.(t.node, q);
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
696
|
e.key === "Enter" && !Z(t) && (e.preventDefault(), Ke(t));
|
|
697
697
|
};
|
|
698
|
-
return /* @__PURE__ */
|
|
699
|
-
label:
|
|
700
|
-
description:
|
|
701
|
-
disabled:
|
|
702
|
-
size:
|
|
703
|
-
children: ({ controlId: e, labelId:
|
|
704
|
-
let
|
|
705
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ b(l, {
|
|
699
|
+
label: i,
|
|
700
|
+
description: d,
|
|
701
|
+
disabled: f,
|
|
702
|
+
size: v,
|
|
703
|
+
children: ({ controlId: e, labelId: n, describedBy: r }) => {
|
|
704
|
+
let a = `${e}-listbox`, s = typeof i == "string" ? i : p;
|
|
705
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(o, {
|
|
706
706
|
ref: ot,
|
|
707
707
|
rootRef: Be,
|
|
708
708
|
id: e,
|
|
709
709
|
type: "text",
|
|
710
710
|
role: "combobox",
|
|
711
711
|
autoComplete: "off",
|
|
712
|
-
isLoading:
|
|
713
|
-
disabled:
|
|
712
|
+
isLoading: N,
|
|
713
|
+
disabled: f,
|
|
714
714
|
open: z,
|
|
715
715
|
optionCount: U.nodeById.size,
|
|
716
|
-
label:
|
|
716
|
+
label: i,
|
|
717
717
|
placeholder: p,
|
|
718
718
|
readOnly: A !== "search",
|
|
719
719
|
value: nt,
|
|
@@ -724,14 +724,14 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
724
724
|
onClear: st,
|
|
725
725
|
onToggleMouseDown: $.handleToggleMouseDown,
|
|
726
726
|
onToggleClick: $.handleToggleClick,
|
|
727
|
-
"aria-labelledby":
|
|
728
|
-
"aria-label":
|
|
729
|
-
"aria-describedby":
|
|
730
|
-
"aria-haspopup":
|
|
727
|
+
"aria-labelledby": n,
|
|
728
|
+
"aria-label": n ? void 0 : p,
|
|
729
|
+
"aria-describedby": r,
|
|
730
|
+
"aria-haspopup": D === "columns" ? "dialog" : "listbox",
|
|
731
731
|
"aria-expanded": z,
|
|
732
|
-
"aria-controls": z ?
|
|
733
|
-
"aria-autocomplete":
|
|
734
|
-
"aria-activedescendant":
|
|
732
|
+
"aria-controls": z ? a : void 0,
|
|
733
|
+
"aria-autocomplete": D !== "columns" && A === "search" ? "list" : "none",
|
|
734
|
+
"aria-activedescendant": D !== "columns" && z && Y.length > 0 ? Xe(a) : void 0,
|
|
735
735
|
onChange: (e) => {
|
|
736
736
|
A === "search" && $.handleTriggerInputChange(e.target.value);
|
|
737
737
|
},
|
|
@@ -740,8 +740,8 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
740
740
|
L(void 0), $.handleTriggerFocus(e.currentTarget);
|
|
741
741
|
},
|
|
742
742
|
onKeyDown: (e) => {
|
|
743
|
-
if (
|
|
744
|
-
e.preventDefault(),
|
|
743
|
+
if (D === "columns" && z && e.key === "Tab" && !e.shiftKey && F.current) {
|
|
744
|
+
e.preventDefault(), F.current.focus();
|
|
745
745
|
return;
|
|
746
746
|
}
|
|
747
747
|
qe(e), !e.defaultPrevented && $.handleTriggerKeyDown({
|
|
@@ -753,51 +753,51 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
753
753
|
enableSpaceActivation: A === "display"
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
|
-
}), /* @__PURE__ */
|
|
756
|
+
}), /* @__PURE__ */ b(t, {
|
|
757
757
|
open: z,
|
|
758
758
|
context: Le,
|
|
759
759
|
floatingStyles: Re,
|
|
760
|
-
listId:
|
|
761
|
-
labelId:
|
|
762
|
-
popupAriaLabel:
|
|
763
|
-
descriptionId:
|
|
764
|
-
activeOptionId:
|
|
765
|
-
ariaMultiselectable:
|
|
766
|
-
popupRole:
|
|
760
|
+
listId: a,
|
|
761
|
+
labelId: n,
|
|
762
|
+
popupAriaLabel: s,
|
|
763
|
+
descriptionId: r,
|
|
764
|
+
activeOptionId: D !== "columns" && Y.length > 0 ? Xe(a) : void 0,
|
|
765
|
+
ariaMultiselectable: D !== "columns" && E === "multi",
|
|
766
|
+
popupRole: D === "columns" ? "dialog" : "listbox",
|
|
767
767
|
setFloating: Ve,
|
|
768
768
|
getFloatingProps: ze,
|
|
769
769
|
onKeyDown: Je,
|
|
770
|
-
layoutClassName:
|
|
770
|
+
layoutClassName: D === "columns" ? X.treeColumnsPopupLayout : void 0,
|
|
771
771
|
bodyClassName: "scrollable",
|
|
772
772
|
toolbar: at,
|
|
773
|
-
children: /* @__PURE__ */
|
|
774
|
-
className:
|
|
775
|
-
children: Y.length === 0 ? /* @__PURE__ */
|
|
776
|
-
errorState:
|
|
777
|
-
emptyState: !
|
|
773
|
+
children: /* @__PURE__ */ b("div", {
|
|
774
|
+
className: m(D === "columns" && X.treeColumns),
|
|
775
|
+
children: Y.length === 0 ? /* @__PURE__ */ b(c, {
|
|
776
|
+
errorState: me,
|
|
777
|
+
emptyState: !me && !N ? "Нет данных" : void 0
|
|
778
778
|
}) : Y.map((e, t) => {
|
|
779
|
-
let
|
|
780
|
-
return /* @__PURE__ */
|
|
779
|
+
let n = E === "multi" ? H(e.node.id, T, U) : T.has(e.node.id), r = E === "multi" && !n && re.has(e.node.id), i = t === Qe, o = e.node.disabled === !0 || k?.has(e.node.id) === !0;
|
|
780
|
+
return /* @__PURE__ */ b(u, {
|
|
781
781
|
"data-ui": "tree-select-option",
|
|
782
|
-
id: Ye(
|
|
782
|
+
id: Ye(a, t),
|
|
783
783
|
ref: (e) => {
|
|
784
|
-
|
|
784
|
+
he.current[t] = e, He(t, e);
|
|
785
785
|
},
|
|
786
786
|
tabIndex: -1,
|
|
787
|
-
role:
|
|
788
|
-
"aria-selected":
|
|
789
|
-
disabled:
|
|
790
|
-
active:
|
|
791
|
-
selected:
|
|
787
|
+
role: D === "columns" ? void 0 : "option",
|
|
788
|
+
"aria-selected": D === "columns" ? void 0 : n,
|
|
789
|
+
disabled: o,
|
|
790
|
+
active: i,
|
|
791
|
+
selected: n,
|
|
792
792
|
onFocus: () => L(e.node.id),
|
|
793
793
|
onKeyDown: (n) => ut(n, e, t),
|
|
794
|
-
className:
|
|
795
|
-
style:
|
|
794
|
+
className: D === "columns" ? X.treeColumnRow : void 0,
|
|
795
|
+
style: D === "columns" ? {
|
|
796
796
|
"--tree-option-column": `var(--tree-option-${t}-column, auto)`,
|
|
797
797
|
"--tree-option-row": `var(--tree-option-${t}-row, auto)`
|
|
798
798
|
} : void 0,
|
|
799
|
-
children: /* @__PURE__ */
|
|
800
|
-
node:
|
|
799
|
+
children: /* @__PURE__ */ b(Pe, {
|
|
800
|
+
node: o ? {
|
|
801
801
|
...e.node,
|
|
802
802
|
disabled: !0
|
|
803
803
|
} : e.node,
|
|
@@ -805,10 +805,10 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
805
805
|
highlight: W,
|
|
806
806
|
hasChildren: e.hasChildren,
|
|
807
807
|
isExpanded: e.isExpanded,
|
|
808
|
-
selected:
|
|
809
|
-
partial:
|
|
810
|
-
selectionMode:
|
|
811
|
-
optionsLayout:
|
|
808
|
+
selected: n,
|
|
809
|
+
partial: r,
|
|
810
|
+
selectionMode: E,
|
|
811
|
+
optionsLayout: D,
|
|
812
812
|
onToggleExpand: () => ct(e),
|
|
813
813
|
onToggleSelection: () => fe?.(e.node, q),
|
|
814
814
|
onActivate: () => Ke(e)
|
|
@@ -823,7 +823,7 @@ function Z({ label: t, description: r, disabled: s, placeholder: p, size: y, nod
|
|
|
823
823
|
//#endregion
|
|
824
824
|
//#region src/tree-select/TreeMultiSelect.tsx
|
|
825
825
|
function Fe(e, t) {
|
|
826
|
-
let n =
|
|
826
|
+
let n = F(e, t), r = Object.values(n).reduce((e, t) => e + t.length, 0);
|
|
827
827
|
if (r !== 0) {
|
|
828
828
|
if (r === 1) {
|
|
829
829
|
let n = [...e].sort((e, n) => (t.preorderIndexById.get(e) ?? 2 ** 53 - 1) - (t.preorderIndexById.get(n) ?? 2 ** 53 - 1))[0], r = t.nodeById.get(n);
|
|
@@ -833,56 +833,56 @@ function Fe(e, t) {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
function Ie(e, t, n) {
|
|
836
|
-
let r =
|
|
836
|
+
let r = P(e, n), i = P(t, n);
|
|
837
837
|
return r.size === i.size && [...r].every((e) => i.has(e));
|
|
838
838
|
}
|
|
839
|
-
function Q({ label: e, description: t, disabled: n, placeholder: r = "Выберите значения", size:
|
|
840
|
-
let [
|
|
841
|
-
value:
|
|
842
|
-
open:
|
|
839
|
+
function Q({ label: e, description: t, disabled: n, placeholder: r = "Выберите значения", size: a, nodes: o, value: s, onChange: c, query: l, defaultQuery: u, onQuery: d, isLoading: f, error: p, optionsLayout: m = "tree", defaultExpandedCodeKeys: h }) {
|
|
840
|
+
let [g, _] = ne(!1), v = S(() => pe(o), [o]), { draftValue: y, setDraftValue: x, prepareOpen: ee } = i({
|
|
841
|
+
value: s,
|
|
842
|
+
open: g,
|
|
843
843
|
onCommit: c,
|
|
844
|
-
isEqual: (e, t) => Ie(e, t,
|
|
845
|
-
}),
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
]),
|
|
850
|
-
return /* @__PURE__ */
|
|
844
|
+
isEqual: (e, t) => Ie(e, t, v)
|
|
845
|
+
}), te = g ? y : s, C = S(() => P(te, v), [te, v]), w = S(() => ye(C, v), [C, v]), T = S(() => new Set([...v.nodeById.keys()].filter((e) => v.nodeById.get(e)?.disabled !== !0 && !H(e, C, v) && !w.selectedIds.has(e) && W(v, [e]).size === 0)), [
|
|
846
|
+
C,
|
|
847
|
+
w.selectedIds,
|
|
848
|
+
v
|
|
849
|
+
]), re = S(() => Fe(C, v), [C, v]);
|
|
850
|
+
return /* @__PURE__ */ b(Z, {
|
|
851
851
|
label: e,
|
|
852
852
|
description: t,
|
|
853
853
|
disabled: n,
|
|
854
854
|
placeholder: r,
|
|
855
|
-
size:
|
|
856
|
-
nodes:
|
|
857
|
-
selectedIds:
|
|
858
|
-
partialIds:
|
|
855
|
+
size: a,
|
|
856
|
+
nodes: o,
|
|
857
|
+
selectedIds: w.selectedIds,
|
|
858
|
+
partialIds: w.partialIds,
|
|
859
859
|
selectionMode: "multi",
|
|
860
860
|
optionsLayout: m,
|
|
861
861
|
defaultExpandedCodeKeys: h,
|
|
862
|
-
unavailableNodeIds:
|
|
863
|
-
open:
|
|
862
|
+
unavailableNodeIds: T,
|
|
863
|
+
open: g,
|
|
864
864
|
onOpenChange: (e) => {
|
|
865
|
-
e && !
|
|
865
|
+
e && !g && ee(), _(e);
|
|
866
866
|
},
|
|
867
867
|
bulkActions: {
|
|
868
868
|
onSelectAll: () => {
|
|
869
|
-
|
|
869
|
+
x(F(W(v), v));
|
|
870
870
|
},
|
|
871
|
-
onDeselectAll: () =>
|
|
871
|
+
onDeselectAll: () => x({})
|
|
872
872
|
},
|
|
873
873
|
triggerMode: "search",
|
|
874
|
-
selectedSummary:
|
|
874
|
+
selectedSummary: re,
|
|
875
875
|
query: l,
|
|
876
876
|
defaultQuery: u,
|
|
877
877
|
onQuery: d,
|
|
878
878
|
onNodeActivate: (e, t) => {
|
|
879
|
-
|
|
879
|
+
x(G({}, e.id, v, t));
|
|
880
880
|
},
|
|
881
881
|
onNodeToggleSelection: (e, t) => {
|
|
882
|
-
|
|
882
|
+
x((n) => G(n, e.id, v, t));
|
|
883
883
|
},
|
|
884
884
|
onClearSelection: () => {
|
|
885
|
-
|
|
885
|
+
x({}), g || c({});
|
|
886
886
|
},
|
|
887
887
|
isLoading: f,
|
|
888
888
|
error: p
|
|
@@ -890,25 +890,25 @@ function Q({ label: e, description: t, disabled: n, placeholder: r = "Выбер
|
|
|
890
890
|
}
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/tree-select/ODataTreeMultiSelect.tsx
|
|
893
|
-
function Le({ label: e, description: t, disabled: n, size: r, placeholder: i, query: a, defaultQuery: o, onQuery: s, optionsLayout: c, value: l, onChange: u, odata: d, segments: f, model: p, defaultExpandedCodeKeys: m, segmentOrder: h, allowEmptyCodeKeys:
|
|
894
|
-
let
|
|
893
|
+
function Le({ label: e, description: t, disabled: n, size: r, placeholder: i, query: a, defaultQuery: o, onQuery: s, optionsLayout: c, value: l, onChange: u, odata: d, segments: f, model: p, defaultExpandedCodeKeys: m, segmentOrder: h, allowEmptyCodeKeys: g, transformNodes: _ }) {
|
|
894
|
+
let v = fe({
|
|
895
895
|
odata: d,
|
|
896
896
|
segments: f,
|
|
897
897
|
model: p,
|
|
898
898
|
segmentOrder: h,
|
|
899
|
-
allowEmptyCodeKeys:
|
|
900
|
-
}),
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
899
|
+
allowEmptyCodeKeys: g
|
|
900
|
+
}), y = S(() => _?.(v.nodes, { orderedCodeKeys: v.orderedCodeKeys }) ?? v.nodes, [
|
|
901
|
+
_,
|
|
902
|
+
v.nodes,
|
|
903
|
+
v.orderedCodeKeys
|
|
904
904
|
]);
|
|
905
|
-
return /* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ b(Q, {
|
|
906
906
|
label: e,
|
|
907
907
|
description: t,
|
|
908
|
-
disabled: n ||
|
|
908
|
+
disabled: n || v.isLoading,
|
|
909
909
|
size: r,
|
|
910
|
-
placeholder: i ??
|
|
911
|
-
nodes:
|
|
910
|
+
placeholder: i ?? v.placeholder,
|
|
911
|
+
nodes: y,
|
|
912
912
|
value: l,
|
|
913
913
|
onChange: u,
|
|
914
914
|
query: a,
|
|
@@ -916,8 +916,8 @@ function Le({ label: e, description: t, disabled: n, size: r, placeholder: i, qu
|
|
|
916
916
|
onQuery: s,
|
|
917
917
|
optionsLayout: c,
|
|
918
918
|
defaultExpandedCodeKeys: m,
|
|
919
|
-
isLoading:
|
|
920
|
-
error:
|
|
919
|
+
isLoading: v.isLoading,
|
|
920
|
+
error: v.isError ? "Ошибка загрузки" : void 0
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
//#endregion
|
|
@@ -926,20 +926,20 @@ function Re(e) {
|
|
|
926
926
|
if (e) return e.code && e.code !== e.label ? `${e.label} · ${e.code}` : e.label;
|
|
927
927
|
}
|
|
928
928
|
function ze({ label: e, description: t, disabled: n, placeholder: r = "Выберите значение", size: i, nodes: a, value: o, onChange: s, query: c, defaultQuery: l, onQuery: u, isLoading: d, error: f, clearable: p = !1, defaultExpandedCodeKeys: m }) {
|
|
929
|
-
let h =
|
|
930
|
-
return /* @__PURE__ */
|
|
929
|
+
let h = S(() => pe(a), [a]), g = me(o, h), _ = g ? h.nodeById.get(g) : void 0;
|
|
930
|
+
return /* @__PURE__ */ b(Z, {
|
|
931
931
|
label: e,
|
|
932
932
|
description: t,
|
|
933
933
|
disabled: n,
|
|
934
934
|
placeholder: r,
|
|
935
935
|
size: i,
|
|
936
936
|
nodes: a,
|
|
937
|
-
selectedIds:
|
|
937
|
+
selectedIds: g ? /* @__PURE__ */ new Set([g]) : /* @__PURE__ */ new Set(),
|
|
938
938
|
partialIds: /* @__PURE__ */ new Set(),
|
|
939
939
|
selectionMode: "single",
|
|
940
940
|
defaultExpandedCodeKeys: m,
|
|
941
941
|
triggerMode: "search",
|
|
942
|
-
selectedSummaryText: Re(
|
|
942
|
+
selectedSummaryText: Re(_),
|
|
943
943
|
query: c,
|
|
944
944
|
defaultQuery: l,
|
|
945
945
|
onQuery: u,
|
|
@@ -960,7 +960,7 @@ function Be({ label: e, description: t, disabled: n, size: r, placeholder: i, qu
|
|
|
960
960
|
segments: d,
|
|
961
961
|
model: f
|
|
962
962
|
});
|
|
963
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ b(ze, {
|
|
964
964
|
label: e,
|
|
965
965
|
description: t,
|
|
966
966
|
disabled: n || h.isLoading,
|
|
@@ -979,6 +979,6 @@ function Be({ label: e, description: t, disabled: n, size: r, placeholder: i, qu
|
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
981
|
//#endregion
|
|
982
|
-
export { Le as ODataTreeMultiSelect, Be as ODataTreeSelect, Q as TreeMultiSelect, ze as TreeSelect,
|
|
982
|
+
export { Le as ODataTreeMultiSelect, Be as ODataTreeSelect, Q as TreeMultiSelect, ze as TreeSelect, k as treeSelectValueToSelectedFilters };
|
|
983
983
|
|
|
984
984
|
//# sourceMappingURL=index.js.map
|