@box/combobox-with-api 1.42.33 → 1.42.34
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/chunks/combobox-with-api-error.js +18 -0
- package/dist/chunks/combobox-with-api-pagination.js +168 -0
- package/dist/chunks/combobox-with-api-pagination2.js +229 -0
- package/dist/chunks/combobox-with-api-tree-view.js +423 -0
- package/dist/chunks/dynamic-loading-tree.js +299 -326
- package/dist/chunks/treeReducer.js +60 -78
- package/dist/esm/index.js +6 -16
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api-container.js +47 -52
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api-error.js +2 -26
- package/dist/esm/lib/components/combobox-with-api/combobox-with-api.js +16 -36
- package/dist/esm/lib/components/combobox-with-api/messages.js +6 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +2 -214
- package/dist/esm/lib/components/combobox-with-api-pagination/index.js +3 -205
- package/dist/esm/lib/components/combobox-with-api-pagination/messages.js +31 -33
- package/dist/esm/lib/components/combobox-with-api-pagination/request.js +4 -6
- package/dist/esm/lib/components/combobox-with-api-pagination/use-async-list.js +113 -128
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/is-abort-error.js +8 -10
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +32 -34
- package/dist/esm/lib/components/combobox-with-api-pagination/utils/use-intersection-observer.js +72 -82
- package/dist/esm/lib/components/combobox-with-api-tree-view/combobox-with-api-tree-view.js +133 -174
- package/dist/esm/lib/components/combobox-with-api-tree-view/dynamic-loading-tree.js +2 -10
- package/dist/esm/lib/components/combobox-with-api-tree-view/index.js +3 -464
- package/dist/esm/lib/components/combobox-with-api-tree-view/tree-utils.js +17 -26
- package/dist/esm/lib/components/combobox-with-api-tree-view/treeReducer.js +2 -6
- package/dist/styles/combobox-with-api-error.css +1 -1
- package/dist/styles/combobox-with-api-pagination.css +1 -1
- package/dist/styles/dynamic-loading-tree.css +1 -1
- package/package.json +7 -7
|
@@ -1,327 +1,300 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import '../styles/dynamic-loading-tree.css';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}) : /* @__PURE__ */ ne("div", {
|
|
300
|
-
children: [T && /* @__PURE__ */ f("div", {
|
|
301
|
-
className: V.noResultOption,
|
|
302
|
-
children: /* @__PURE__ */ f($, {
|
|
303
|
-
"aria-label": G,
|
|
304
|
-
className: V.loadingIndicator
|
|
305
|
-
})
|
|
306
|
-
}), Q && !T ? /* @__PURE__ */ f("div", {
|
|
307
|
-
className: V.noResultOption,
|
|
308
|
-
children: q
|
|
309
|
-
}) : !T && /* @__PURE__ */ f(ee, {
|
|
310
|
-
ref: H,
|
|
311
|
-
"aria-label": n,
|
|
312
|
-
data: h.nodes,
|
|
313
|
-
focusedId: X,
|
|
314
|
-
multiSelect: E,
|
|
315
|
-
onExpand: K,
|
|
316
|
-
onLoadData: M,
|
|
317
|
-
onNodeSelect: Y,
|
|
318
|
-
selectedIds: h.selectedIds,
|
|
319
|
-
size: "large",
|
|
320
|
-
togglableSelect: !0
|
|
321
|
-
})]
|
|
322
|
-
});
|
|
1
|
+
import { RootTreeNode as e, getServiceNode as t, hasValidLevel as n } from "../esm/lib/components/combobox-with-api-tree-view/tree-utils.js";
|
|
2
|
+
import { n as r, r as i, t as a } from "./treeReducer.js";
|
|
3
|
+
import { LoadingIndicator as o } from "@box/blueprint-web";
|
|
4
|
+
import { forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useReducer as d, useState as f } from "react";
|
|
5
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
|
+
import { InlineError as h, Tree as g } from "@box/tree";
|
|
7
|
+
import '../styles/dynamic-loading-tree.css';var _ = {
|
|
8
|
+
container: "_container_rhp7y_2",
|
|
9
|
+
disabled: "_disabled_rhp7y_13",
|
|
10
|
+
label: "_label_rhp7y_16",
|
|
11
|
+
hiddenLabel: "_hiddenLabel_rhp7y_28",
|
|
12
|
+
comboboxContainer: "_comboboxContainer_rhp7y_31",
|
|
13
|
+
withComboboxButtons: "_withComboboxButtons_rhp7y_47",
|
|
14
|
+
error: "_error_rhp7y_58",
|
|
15
|
+
textInputWrapper: "_textInputWrapper_rhp7y_69",
|
|
16
|
+
textInput: "_textInput_rhp7y_69",
|
|
17
|
+
errorIcon: "_errorIcon_rhp7y_91",
|
|
18
|
+
comboboxButtons: "_comboboxButtons_rhp7y_94",
|
|
19
|
+
withChips: "_withChips_rhp7y_101",
|
|
20
|
+
inlineError: "_inlineError_rhp7y_111",
|
|
21
|
+
popover: "_popover_rhp7y_115",
|
|
22
|
+
option: "_option_rhp7y_141",
|
|
23
|
+
indicator: "_indicator_rhp7y_164",
|
|
24
|
+
indicatorIcon: "_indicatorIcon_rhp7y_173",
|
|
25
|
+
optionWithIndicator: "_optionWithIndicator_rhp7y_176",
|
|
26
|
+
loadingIndicator: "_loadingIndicator_rhp7y_179",
|
|
27
|
+
noResultOption: "_noResultOption_rhp7y_182"
|
|
28
|
+
}, v = (e) => {
|
|
29
|
+
let t = [...e.children], { metadata: n } = e;
|
|
30
|
+
return {
|
|
31
|
+
...e,
|
|
32
|
+
children: t,
|
|
33
|
+
metadata: {
|
|
34
|
+
...e.metadata,
|
|
35
|
+
variant: n.variant,
|
|
36
|
+
isLoading: e.status === "loading" && !e.children.length,
|
|
37
|
+
labelName: n.labelName || "",
|
|
38
|
+
labelValue: n.labelValue || ""
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}, y = (e, n) => {
|
|
42
|
+
let r;
|
|
43
|
+
return e.children.length && e.status === "loading" && (r = t(n.id, n.metadata.displayValue, "loading")), e.status === "error" && (r = t(n.id, n.metadata.displayValue, "reload")), e.status === "success" && e.marker && (r = t(n.id, n.metadata.displayValue, "loadMore")), r;
|
|
44
|
+
}, b = /* @__PURE__ */ s(({ ariaLabel: t, onSelect: s, selectedNodes: b, defaultFetcher: x, levels: S, selectableLevels: C, multiselect: w, open: T, searchInput: E, noResultMessage: D, loadingAriaLabel: O }, k) => {
|
|
45
|
+
let [A, j] = d(r, a), [M, N] = f({
|
|
46
|
+
nodes: [],
|
|
47
|
+
selectedIds: []
|
|
48
|
+
}), [P, F] = f(!1), [I, L] = f(!1), R = u(() => Math.max(...C), [C]), z = c((e = A) => {
|
|
49
|
+
let t = [];
|
|
50
|
+
return [...Object.values(e).map((e) => {
|
|
51
|
+
let n = v(e), r = y(e, n);
|
|
52
|
+
return r && (t.push(r), n.children.push(r.id)), n;
|
|
53
|
+
}), ...t];
|
|
54
|
+
}, [A]), B = c((e) => {
|
|
55
|
+
let t = e.ancestors?.find((t) => t.level === e.level - 1), n = S.find((t) => t.level === e.level);
|
|
56
|
+
return e.level === 1 || E === "" ? e.displayValue : {
|
|
57
|
+
labelName: n.displayName,
|
|
58
|
+
labelValue: t.displayName
|
|
59
|
+
};
|
|
60
|
+
}, [S, E]), V = c((t) => ({
|
|
61
|
+
id: t.value,
|
|
62
|
+
name: t.displayValue,
|
|
63
|
+
parent: e.id,
|
|
64
|
+
isBranch: t.level !== R,
|
|
65
|
+
children: [],
|
|
66
|
+
metadata: {
|
|
67
|
+
variant: "content",
|
|
68
|
+
displayValue: t.displayValue,
|
|
69
|
+
level: t.level,
|
|
70
|
+
selectable: t.selectable,
|
|
71
|
+
marker: t.marker,
|
|
72
|
+
ancestors: t.ancestors
|
|
73
|
+
}
|
|
74
|
+
}), [R]), H = c((t, n) => {
|
|
75
|
+
j({
|
|
76
|
+
type: i.RESET,
|
|
77
|
+
payload: {
|
|
78
|
+
id: e.id,
|
|
79
|
+
items: []
|
|
80
|
+
}
|
|
81
|
+
}), j({
|
|
82
|
+
type: i.LOAD_SUCCESS,
|
|
83
|
+
payload: {
|
|
84
|
+
id: e.id,
|
|
85
|
+
items: t,
|
|
86
|
+
marker: n
|
|
87
|
+
}
|
|
88
|
+
}), F(!1);
|
|
89
|
+
}, [j, F]), U = c(() => {
|
|
90
|
+
j({
|
|
91
|
+
type: i.LOAD_ERROR,
|
|
92
|
+
payload: { id: e.id }
|
|
93
|
+
}), F(!1), L(!0);
|
|
94
|
+
}, [
|
|
95
|
+
j,
|
|
96
|
+
F,
|
|
97
|
+
L
|
|
98
|
+
]), W = c((e, t) => {
|
|
99
|
+
let n = new Set(e.map((e) => e.id));
|
|
100
|
+
return t.filter((e) => e != null && n.has(e));
|
|
101
|
+
}, []);
|
|
102
|
+
l(() => {
|
|
103
|
+
let e = z(A);
|
|
104
|
+
N({
|
|
105
|
+
nodes: e,
|
|
106
|
+
selectedIds: W(e, b)
|
|
107
|
+
});
|
|
108
|
+
}, [
|
|
109
|
+
W,
|
|
110
|
+
z,
|
|
111
|
+
b,
|
|
112
|
+
A,
|
|
113
|
+
I
|
|
114
|
+
]), l(() => {
|
|
115
|
+
if (!T) return;
|
|
116
|
+
let { signal: t } = new AbortController();
|
|
117
|
+
F(!0), L(!1), E ? (j({
|
|
118
|
+
type: i.RESET,
|
|
119
|
+
payload: {
|
|
120
|
+
id: e.id,
|
|
121
|
+
items: []
|
|
122
|
+
}
|
|
123
|
+
}), x({
|
|
124
|
+
signal: t,
|
|
125
|
+
marker: null,
|
|
126
|
+
searchInput: E,
|
|
127
|
+
level: null,
|
|
128
|
+
onlySelectableOptions: !1,
|
|
129
|
+
ancestorId: null
|
|
130
|
+
}).then((t) => {
|
|
131
|
+
H(t.options.filter((e) => e.selectable).map((t) => {
|
|
132
|
+
let { labelName: n, labelValue: r } = B(t);
|
|
133
|
+
return {
|
|
134
|
+
id: t.value,
|
|
135
|
+
name: t.displayValue,
|
|
136
|
+
parent: e.id,
|
|
137
|
+
isBranch: t.level < R,
|
|
138
|
+
children: [],
|
|
139
|
+
metadata: {
|
|
140
|
+
variant: t.level === 1 ? "content" : "labeled",
|
|
141
|
+
displayValue: t.displayValue,
|
|
142
|
+
level: t.level,
|
|
143
|
+
selectable: t.selectable,
|
|
144
|
+
ancestors: t.ancestors,
|
|
145
|
+
labelName: n,
|
|
146
|
+
labelValue: r
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}), t.marker);
|
|
150
|
+
}).catch(() => {
|
|
151
|
+
U();
|
|
152
|
+
})) : (j({
|
|
153
|
+
type: i.RESET,
|
|
154
|
+
payload: {
|
|
155
|
+
id: e.id,
|
|
156
|
+
items: []
|
|
157
|
+
}
|
|
158
|
+
}), j({
|
|
159
|
+
type: i.LOAD_DATA,
|
|
160
|
+
payload: { id: e.id }
|
|
161
|
+
}), x({
|
|
162
|
+
signal: t,
|
|
163
|
+
marker: null,
|
|
164
|
+
searchInput: "",
|
|
165
|
+
level: 1,
|
|
166
|
+
onlySelectableOptions: !1,
|
|
167
|
+
ancestorId: null
|
|
168
|
+
}).then((e) => {
|
|
169
|
+
H(e.options.map(V), e.marker);
|
|
170
|
+
}).catch(() => {
|
|
171
|
+
U();
|
|
172
|
+
}));
|
|
173
|
+
}, [
|
|
174
|
+
x,
|
|
175
|
+
V,
|
|
176
|
+
T,
|
|
177
|
+
E,
|
|
178
|
+
S,
|
|
179
|
+
R,
|
|
180
|
+
B,
|
|
181
|
+
H,
|
|
182
|
+
U
|
|
183
|
+
]);
|
|
184
|
+
let G = c((e) => {
|
|
185
|
+
let { isExpanded: t, isDisabled: n, element: r } = e;
|
|
186
|
+
if (!t || n) {
|
|
187
|
+
j({
|
|
188
|
+
type: i.RESET,
|
|
189
|
+
payload: {
|
|
190
|
+
id: r.id,
|
|
191
|
+
items: []
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
let { level: a } = r.metadata, { id: o, marker: s } = r, { signal: c } = new AbortController();
|
|
197
|
+
j({
|
|
198
|
+
type: i.LOAD_DATA,
|
|
199
|
+
payload: { id: o }
|
|
200
|
+
}), x({
|
|
201
|
+
signal: c,
|
|
202
|
+
marker: s,
|
|
203
|
+
searchInput: "",
|
|
204
|
+
level: a + 1,
|
|
205
|
+
ancestorId: o,
|
|
206
|
+
onlySelectableOptions: !1
|
|
207
|
+
}).then((e) => {
|
|
208
|
+
let t = e.options.map((e) => (r.children.push(e.value), V(e)));
|
|
209
|
+
j({
|
|
210
|
+
type: i.LOAD_SUCCESS,
|
|
211
|
+
payload: {
|
|
212
|
+
id: o,
|
|
213
|
+
items: t,
|
|
214
|
+
marker: e.marker
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}).catch(() => {
|
|
218
|
+
j({
|
|
219
|
+
type: i.LOAD_ERROR,
|
|
220
|
+
payload: { id: o }
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}, [x, V]), K = c((t) => {
|
|
224
|
+
I && (L(!1), F(!0));
|
|
225
|
+
let n = A[t], { level: r } = n.metadata, { id: a, marker: o } = n, { signal: s } = new AbortController();
|
|
226
|
+
j({
|
|
227
|
+
type: i.LOAD_DATA,
|
|
228
|
+
payload: { id: a }
|
|
229
|
+
}), x({
|
|
230
|
+
signal: s,
|
|
231
|
+
marker: o,
|
|
232
|
+
searchInput: E,
|
|
233
|
+
level: E === "" ? r + 1 : null,
|
|
234
|
+
ancestorId: a === e.id ? null : a.toString(),
|
|
235
|
+
onlySelectableOptions: !1
|
|
236
|
+
}).then((e) => {
|
|
237
|
+
let t = e.options.map(V);
|
|
238
|
+
j({
|
|
239
|
+
type: i.LOAD_SUCCESS,
|
|
240
|
+
payload: {
|
|
241
|
+
id: a,
|
|
242
|
+
items: t,
|
|
243
|
+
marker: e.marker
|
|
244
|
+
}
|
|
245
|
+
}), F(!1);
|
|
246
|
+
}).catch(() => {
|
|
247
|
+
j({
|
|
248
|
+
type: i.LOAD_ERROR,
|
|
249
|
+
payload: {
|
|
250
|
+
id: a,
|
|
251
|
+
marker: o
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
}, [
|
|
256
|
+
x,
|
|
257
|
+
I,
|
|
258
|
+
V,
|
|
259
|
+
E,
|
|
260
|
+
A
|
|
261
|
+
]), { isTreeEmpty: q, focusedId: J } = u(() => {
|
|
262
|
+
let t = M.nodes.find(({ id: t }) => t === e.id)?.children ?? [], n = t[0], r = !w && M.selectedIds.length === 0 && n != null;
|
|
263
|
+
return {
|
|
264
|
+
isTreeEmpty: M.nodes.length === 0 || t.length === 0,
|
|
265
|
+
focusedId: r ? n : void 0
|
|
266
|
+
};
|
|
267
|
+
}, [
|
|
268
|
+
w,
|
|
269
|
+
M.nodes,
|
|
270
|
+
M.selectedIds.length
|
|
271
|
+
]), Y = c((e) => {
|
|
272
|
+
let { metadata: t } = e.element;
|
|
273
|
+
n(t) && C.includes(t.level) ? s(e) : (e.isSelected = !1, e.treeState.selectedIds.delete(e.element.id));
|
|
274
|
+
}, [C, s]);
|
|
275
|
+
return I ? /* @__PURE__ */ p(h, { onReload: () => {
|
|
276
|
+
K("root");
|
|
277
|
+
} }) : /* @__PURE__ */ m("div", { children: [P && /* @__PURE__ */ p("div", {
|
|
278
|
+
className: _.noResultOption,
|
|
279
|
+
children: /* @__PURE__ */ p(o, {
|
|
280
|
+
"aria-label": O,
|
|
281
|
+
className: _.loadingIndicator
|
|
282
|
+
})
|
|
283
|
+
}), q && !P ? /* @__PURE__ */ p("div", {
|
|
284
|
+
className: _.noResultOption,
|
|
285
|
+
children: D
|
|
286
|
+
}) : !P && /* @__PURE__ */ p(g, {
|
|
287
|
+
ref: k,
|
|
288
|
+
"aria-label": t,
|
|
289
|
+
data: M.nodes,
|
|
290
|
+
focusedId: J,
|
|
291
|
+
multiSelect: w,
|
|
292
|
+
onExpand: G,
|
|
293
|
+
onLoadData: K,
|
|
294
|
+
onNodeSelect: Y,
|
|
295
|
+
selectedIds: M.selectedIds,
|
|
296
|
+
size: "large",
|
|
297
|
+
togglableSelect: !0
|
|
298
|
+
})] });
|
|
323
299
|
});
|
|
324
|
-
export {
|
|
325
|
-
xe as D,
|
|
326
|
-
V as s
|
|
327
|
-
};
|
|
300
|
+
export { _ as n, b as t };
|