@box/combobox-with-api 0.34.2 → 0.34.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.
@@ -1,298 +1,280 @@
1
- import { Text as L, LoadingIndicator as G } from "@box/blueprint-web";
2
- import { Tree as H } from "@box/tree";
3
- import { useReducer as J, useState as V, useMemo as K, useCallback as O, useEffect as W } from "react";
4
- import { RootTreeNode as i, getServiceNode as g } from "../esm/lib/components/combobox-with-api-tree-view/tree-utils.js";
5
- import { jsxs as N, jsx as u } from "react/jsx-runtime";
6
- import '../styles/dynamic-loading-tree.css';const Q = "_container_xz6fa_1", X = "_disabled_xz6fa_12", Y = "_label_xz6fa_15", Z = "_hiddenLabel_xz6fa_27", F = "_comboboxContainer_xz6fa_30", ee = "_withComboboxButtons_xz6fa_46", ae = "_error_xz6fa_54", te = "_textInputWrapper_xz6fa_62", ne = "_textInput_xz6fa_62", le = "_errorIcon_xz6fa_84", se = "_comboboxButtons_xz6fa_87", oe = "_withChips_xz6fa_94", re = "_inlineError_xz6fa_104", ie = "_popover_xz6fa_108", de = "_option_xz6fa_134", ce = "_indicator_xz6fa_157", pe = "_indicatorIcon_xz6fa_166", me = "_optionWithIndicator_xz6fa_169", _e = "_loadingIndicator_xz6fa_172", ue = "_noResultOption_xz6fa_175", C = {
1
+ import { LoadingIndicator as q } from "@box/blueprint-web";
2
+ import { Tree as G } from "@box/tree";
3
+ import { useReducer as H, useState as k, useMemo as J, useCallback as O, useEffect as V } from "react";
4
+ import { RootTreeNode as r, getServiceNode as L } from "../esm/lib/components/combobox-with-api-tree-view/tree-utils.js";
5
+ import { jsxs as K, jsx as R } from "react/jsx-runtime";
6
+ import '../styles/dynamic-loading-tree.css';const Q = "_container_xz6fa_1", X = "_disabled_xz6fa_12", Y = "_label_xz6fa_15", Z = "_hiddenLabel_xz6fa_27", $ = "_comboboxContainer_xz6fa_30", F = "_withComboboxButtons_xz6fa_46", ee = "_error_xz6fa_54", ae = "_textInputWrapper_xz6fa_62", te = "_textInput_xz6fa_62", ne = "_errorIcon_xz6fa_84", le = "_comboboxButtons_xz6fa_87", oe = "_withChips_xz6fa_94", se = "_inlineError_xz6fa_104", re = "_popover_xz6fa_108", ie = "_option_xz6fa_134", de = "_indicator_xz6fa_157", ce = "_indicatorIcon_xz6fa_166", _e = "_optionWithIndicator_xz6fa_169", me = "_loadingIndicator_xz6fa_172", pe = "_noResultOption_xz6fa_175", C = {
7
7
  container: Q,
8
8
  disabled: X,
9
9
  label: Y,
10
10
  hiddenLabel: Z,
11
- comboboxContainer: F,
12
- withComboboxButtons: ee,
13
- error: ae,
14
- textInputWrapper: te,
15
- textInput: ne,
16
- errorIcon: le,
17
- comboboxButtons: se,
11
+ comboboxContainer: $,
12
+ withComboboxButtons: F,
13
+ error: ee,
14
+ textInputWrapper: ae,
15
+ textInput: te,
16
+ errorIcon: ne,
17
+ comboboxButtons: le,
18
18
  withChips: oe,
19
- inlineError: re,
20
- popover: ie,
21
- option: de,
22
- indicator: ce,
23
- indicatorIcon: pe,
24
- optionWithIndicator: me,
25
- loadingIndicator: _e,
26
- noResultOption: ue
19
+ inlineError: se,
20
+ popover: re,
21
+ option: ie,
22
+ indicator: de,
23
+ indicatorIcon: ce,
24
+ optionWithIndicator: _e,
25
+ loadingIndicator: me,
26
+ noResultOption: pe
27
27
  };
28
- let n = /* @__PURE__ */ function(t) {
29
- return t.LOAD_DATA = "LOAD_DATA", t.LOAD_ERROR = "LOAD_DATA_ERROR", t.LOAD_SUCCESS = "LOAD_DATA_SUCCESS", t.LOAD_MORE = "LOAD_DATA_SUCCESS", t.RESET = "RESET", t;
28
+ let t = /* @__PURE__ */ function(n) {
29
+ return n.LOAD_DATA = "LOAD_DATA", n.LOAD_ERROR = "LOAD_DATA_ERROR", n.LOAD_SUCCESS = "LOAD_DATA_SUCCESS", n.LOAD_MORE = "LOAD_DATA_SUCCESS", n.RESET = "RESET", n;
30
30
  }({});
31
- const ye = ({
32
- levelName: t,
33
- parentDisplayValue: h,
34
- displayValue: o
35
- }) => /* @__PURE__ */ N("div", {
36
- style: {
37
- display: "flex",
38
- alignItems: "flex-start",
39
- flexDirection: "column"
40
- },
41
- children: [/* @__PURE__ */ N("div", {
42
- style: {
43
- display: "flex",
44
- alignItems: "flex-start"
45
- },
46
- children: [/* @__PURE__ */ u(L, {
47
- as: "span",
48
- variant: "labelBold",
49
- children: `${t}`
50
- }), /* @__PURE__ */ u(L, {
51
- as: "span",
52
- variant: "label",
53
- children: `/${h}`
54
- })]
55
- }), /* @__PURE__ */ u(L, {
56
- as: "span",
57
- variant: "bodyDefault",
58
- children: o
59
- })]
60
- }), he = (t, h) => {
31
+ const ue = (n, A) => {
61
32
  const {
62
- id: o,
63
- items: m,
64
- marker: y
65
- } = h.payload;
66
- switch (h.type) {
67
- case n.LOAD_DATA:
33
+ id: i,
34
+ items: u,
35
+ marker: b
36
+ } = A.payload;
37
+ switch (A.type) {
38
+ case t.LOAD_DATA:
68
39
  return {
69
- ...t,
70
- [o]: {
71
- ...t[o],
40
+ ...n,
41
+ [i]: {
42
+ ...n[i],
72
43
  status: "loading"
73
44
  }
74
45
  };
75
- case n.LOAD_ERROR:
46
+ case t.LOAD_ERROR:
76
47
  return {
77
- ...t,
78
- [o]: {
79
- ...t[o],
80
- marker: y,
48
+ ...n,
49
+ [i]: {
50
+ ...n[i],
51
+ marker: b,
81
52
  status: "error"
82
53
  }
83
54
  };
84
- case n.LOAD_SUCCESS: {
55
+ case t.LOAD_SUCCESS: {
85
56
  const {
86
- itemsWithParent: x,
57
+ itemsWithParent: h,
87
58
  itemsIds: v
88
- } = m.reduce((b, d) => ({
59
+ } = u.reduce((f, c) => ({
89
60
  itemsWithParent: {
90
- ...b.itemsWithParent,
91
- [d.id]: {
92
- ...d,
93
- parent: o,
61
+ ...f.itemsWithParent,
62
+ [c.id]: {
63
+ ...c,
64
+ parent: i,
94
65
  children: []
95
66
  }
96
67
  },
97
- itemsIds: [...b.itemsIds, d.id]
68
+ itemsIds: [...f.itemsIds, c.id]
98
69
  }), {
99
70
  itemsWithParent: {},
100
71
  itemsIds: []
101
72
  });
102
73
  return {
103
- ...t,
104
- [o]: {
105
- ...t[o],
74
+ ...n,
75
+ [i]: {
76
+ ...n[i],
106
77
  status: "success",
107
- marker: y,
108
- children: [...t[o].children || [], ...v]
78
+ marker: b,
79
+ children: [...n[i].children || [], ...v]
109
80
  },
110
- ...x
81
+ ...h
111
82
  };
112
83
  }
113
- case n.RESET:
84
+ case t.RESET:
114
85
  return {
115
- ...t,
116
- [o]: {
117
- ...t[o],
86
+ ...n,
87
+ [i]: {
88
+ ...n[i],
118
89
  status: "success",
119
- marker: y,
90
+ marker: b,
120
91
  children: []
121
92
  }
122
93
  };
123
94
  default:
124
- return t;
95
+ return n;
125
96
  }
126
- }, Oe = ({
127
- ariaLabel: t,
128
- onSelect: h,
129
- selectedNodes: o,
130
- defaultFetcher: m,
131
- levels: y,
132
- selectableLevels: x,
97
+ }, xe = ({
98
+ ariaLabel: n,
99
+ onSelect: A,
100
+ selectedNodes: i,
101
+ defaultFetcher: u,
102
+ levels: b,
103
+ selectableLevels: h,
133
104
  multiselect: v,
134
- open: b,
135
- searchInput: d,
136
- noResultMessage: B,
137
- loadingAriaLabel: U
105
+ open: f,
106
+ searchInput: c,
107
+ noResultMessage: w,
108
+ loadingAriaLabel: W
138
109
  }) => {
139
- const [f, s] = J(he, {
140
- [i.id]: i
141
- }), [A, P] = V({
110
+ const [y, l] = H(ue, {
111
+ [r.id]: r
112
+ }), [D, B] = k({
142
113
  nodes: [],
143
114
  selectedIds: []
144
- }), [T, D] = V(!1), E = K(() => Math.max(...x), [x]), z = O((e = f) => {
145
- const r = [];
146
- return [...Object.values(e).map((a) => {
147
- const _ = [...a.children], l = {
148
- ...a,
115
+ }), [I, x] = k(!1), E = J(() => Math.max(...h), [h]), g = O((a = y) => {
116
+ const s = [];
117
+ return [...Object.values(a).map((e) => {
118
+ const _ = [...e.children], {
119
+ metadata: o
120
+ } = e, d = {
121
+ ...e,
149
122
  children: _,
150
123
  metadata: {
151
- ...a.metadata,
152
- variant: "content",
153
- isLoading: a.status === "loading" && !a.children.length
124
+ ...e.metadata,
125
+ variant: o.variant,
126
+ isLoading: e.status === "loading" && !e.children.length,
127
+ labelName: o.labelName || "",
128
+ labelValue: o.labelValue || ""
154
129
  }
155
130
  };
156
- let c;
157
- return a.children.length && a.status === "loading" && (c = g(l.id, l.metadata.displayValue, "loading")), a.status === "error" && (c = g(l.id, l.metadata.displayValue, "reload")), a.status === "success" && a.marker && (c = g(l.id, l.metadata.displayValue, "loadMore")), c && (r.push(c), l.children.push(c.id)), l;
158
- }), ...r];
159
- }, [f]), R = O((e) => {
131
+ let p;
132
+ return e.children.length && e.status === "loading" && (p = L(d.id, d.metadata.displayValue, "loading")), e.status === "error" && (p = L(d.id, d.metadata.displayValue, "reload")), e.status === "success" && e.marker && (p = L(d.id, d.metadata.displayValue, "loadMore")), p && (s.push(p), d.children.push(p.id)), d;
133
+ }), ...s];
134
+ }, [y]), N = O((a) => {
160
135
  var _;
161
- const r = (_ = e.ancestors) == null ? void 0 : _.find((l) => l.level === e.level - 1), p = y.find((l) => l.level === e.level);
162
- return e.level === 1 || d === "" ? e.displayValue : /* @__PURE__ */ u(ye, {
163
- displayValue: e.displayValue,
164
- levelName: p.displayName,
165
- parentDisplayValue: r.displayName
166
- });
167
- }, [y, d]), S = O((e) => ({
168
- id: e.value,
169
- name: R(e),
170
- parent: i.id,
171
- isBranch: e.level !== E,
136
+ const s = (_ = a.ancestors) == null ? void 0 : _.find((o) => o.level === a.level - 1), m = b.find((o) => o.level === a.level);
137
+ return a.level === 1 || c === "" ? a.displayValue : {
138
+ labelName: m.displayName,
139
+ labelValue: s.displayName
140
+ };
141
+ }, [b, c]), S = O((a) => ({
142
+ id: a.value,
143
+ name: a.displayValue,
144
+ parent: r.id,
145
+ isBranch: a.level !== E,
172
146
  children: [],
173
147
  metadata: {
174
148
  variant: "content",
175
- level: e.level,
176
- selectable: e.selectable,
177
- displayValue: e.displayValue,
178
- marker: e.marker,
179
- ancestors: e.ancestors
149
+ displayValue: a.displayValue,
150
+ level: a.level,
151
+ selectable: a.selectable,
152
+ marker: a.marker,
153
+ ancestors: a.ancestors
180
154
  }
181
- }), [R, E]);
182
- W(() => {
183
- P({
184
- nodes: z(f),
185
- selectedIds: o
155
+ }), [E]);
156
+ V(() => {
157
+ B({
158
+ nodes: g(y),
159
+ selectedIds: i
186
160
  });
187
- }, [z, o, f]), W(() => {
188
- if (!b)
161
+ }, [g, i, y]), V(() => {
162
+ if (!f)
189
163
  return;
190
164
  const {
191
- signal: e
165
+ signal: a
192
166
  } = new AbortController();
193
- D(!0), d ? (s({
194
- type: n.RESET,
167
+ x(!0), c ? (l({
168
+ type: t.RESET,
195
169
  payload: {
196
- id: i.id,
170
+ id: r.id,
197
171
  items: []
198
172
  }
199
- }), m({
200
- signal: e,
173
+ }), u({
174
+ signal: a,
201
175
  marker: null,
202
- searchInput: d,
176
+ searchInput: c,
203
177
  level: null,
204
178
  onlySelectableOptions: !1,
205
179
  ancestorId: null
206
- }).then((r) => {
207
- const p = r.options.map((a) => ({
208
- id: a.value,
209
- name: R(a),
210
- parent: i.id,
211
- isBranch: a.level < E,
212
- children: [],
213
- metadata: {
214
- variant: "content",
215
- level: a.level,
216
- selectable: a.selectable,
217
- displayValue: a.displayValue,
218
- ancestors: a.ancestors
219
- }
220
- }));
221
- s({
222
- type: n.RESET,
180
+ }).then((s) => {
181
+ const m = s.options.map((e) => {
182
+ const {
183
+ labelName: _,
184
+ labelValue: o
185
+ } = N(e);
186
+ return {
187
+ id: e.value,
188
+ name: e.displayValue,
189
+ parent: r.id,
190
+ isBranch: e.level < E,
191
+ children: [],
192
+ metadata: {
193
+ variant: e.level === 1 ? "content" : "labeled",
194
+ displayValue: e.displayValue,
195
+ level: e.level,
196
+ selectable: e.selectable,
197
+ ancestors: e.ancestors,
198
+ labelName: _,
199
+ labelValue: o
200
+ }
201
+ };
202
+ });
203
+ l({
204
+ type: t.RESET,
223
205
  payload: {
224
- id: i.id,
206
+ id: r.id,
225
207
  items: []
226
208
  }
227
- }), s({
228
- type: n.LOAD_SUCCESS,
209
+ }), l({
210
+ type: t.LOAD_SUCCESS,
229
211
  payload: {
230
- id: i.id,
231
- items: p,
232
- marker: r.marker
212
+ id: r.id,
213
+ items: m,
214
+ marker: s.marker
233
215
  }
234
- }), D(!1);
216
+ }), x(!1);
235
217
  }).catch(() => {
236
- s({
237
- type: n.LOAD_ERROR,
218
+ l({
219
+ type: t.LOAD_ERROR,
238
220
  payload: {
239
- id: i.id
221
+ id: r.id
240
222
  }
241
- }), D(!1);
242
- })) : (s({
243
- type: n.RESET,
223
+ }), x(!1);
224
+ })) : (l({
225
+ type: t.RESET,
244
226
  payload: {
245
- id: i.id,
227
+ id: r.id,
246
228
  items: []
247
229
  }
248
- }), s({
249
- type: n.LOAD_DATA,
230
+ }), l({
231
+ type: t.LOAD_DATA,
250
232
  payload: {
251
- id: i.id
233
+ id: r.id
252
234
  }
253
- }), m({
254
- signal: e,
235
+ }), u({
236
+ signal: a,
255
237
  marker: null,
256
238
  searchInput: "",
257
239
  level: 1,
258
240
  onlySelectableOptions: !1,
259
241
  ancestorId: null
260
- }).then((r) => {
261
- const p = r.options.map(S);
262
- s({
263
- type: n.RESET,
242
+ }).then((s) => {
243
+ const m = s.options.map(S);
244
+ l({
245
+ type: t.RESET,
264
246
  payload: {
265
- id: i.id,
247
+ id: r.id,
266
248
  items: []
267
249
  }
268
- }), s({
269
- type: n.LOAD_SUCCESS,
250
+ }), l({
251
+ type: t.LOAD_SUCCESS,
270
252
  payload: {
271
- id: i.id,
272
- items: p,
273
- marker: r.marker
253
+ id: r.id,
254
+ items: m,
255
+ marker: s.marker
274
256
  }
275
- }), D(!1);
257
+ }), x(!1);
276
258
  }).catch(() => {
277
- s({
278
- type: n.LOAD_ERROR,
259
+ l({
260
+ type: t.LOAD_ERROR,
279
261
  payload: {
280
- id: i.id
262
+ id: r.id
281
263
  }
282
- }), D(!1);
264
+ }), x(!1);
283
265
  }));
284
- }, [m, S, b, d, y, E, R]);
285
- const M = O((e) => {
266
+ }, [u, S, f, c, b, E, N]);
267
+ const U = O((a) => {
286
268
  const {
287
- isExpanded: r,
288
- isDisabled: p,
289
- element: a
290
- } = e;
291
- if (!r || p) {
292
- s({
293
- type: n.RESET,
269
+ isExpanded: s,
270
+ isDisabled: m,
271
+ element: e
272
+ } = a;
273
+ if (!s || m) {
274
+ l({
275
+ type: t.RESET,
294
276
  payload: {
295
- id: a.id,
277
+ id: e.id,
296
278
  items: []
297
279
  }
298
280
  });
@@ -300,101 +282,101 @@ const ye = ({
300
282
  }
301
283
  const {
302
284
  level: _
303
- } = a.metadata, {
304
- id: l,
305
- marker: c
306
- } = a, {
307
- signal: I
285
+ } = e.metadata, {
286
+ id: o,
287
+ marker: d
288
+ } = e, {
289
+ signal: p
308
290
  } = new AbortController();
309
- s({
310
- type: n.LOAD_DATA,
291
+ l({
292
+ type: t.LOAD_DATA,
311
293
  payload: {
312
- id: l
294
+ id: o
313
295
  }
314
- }), m({
315
- signal: I,
316
- marker: c,
296
+ }), u({
297
+ signal: p,
298
+ marker: d,
317
299
  searchInput: "",
318
300
  level: _ + 1,
319
- ancestorId: l,
301
+ ancestorId: o,
320
302
  onlySelectableOptions: !1
321
- }).then((k) => {
322
- const q = k.options.map((w) => (a.children.push(w.value), S(w)));
323
- s({
324
- type: n.LOAD_SUCCESS,
303
+ }).then((z) => {
304
+ const j = z.options.map((T) => (e.children.push(T.value), S(T)));
305
+ l({
306
+ type: t.LOAD_SUCCESS,
325
307
  payload: {
326
- id: l,
327
- items: q,
328
- marker: k.marker
308
+ id: o,
309
+ items: j,
310
+ marker: z.marker
329
311
  }
330
312
  });
331
313
  }).catch(() => {
332
- s({
333
- type: n.LOAD_ERROR,
314
+ l({
315
+ type: t.LOAD_ERROR,
334
316
  payload: {
335
- id: l
317
+ id: o
336
318
  }
337
319
  });
338
320
  });
339
- }, [m, S]), j = O((e) => {
340
- const r = f[e], {
341
- level: p
342
- } = r.metadata, {
343
- id: a,
321
+ }, [u, S]), P = O((a) => {
322
+ const s = y[a], {
323
+ level: m
324
+ } = s.metadata, {
325
+ id: e,
344
326
  marker: _
345
- } = r, {
346
- signal: l
327
+ } = s, {
328
+ signal: o
347
329
  } = new AbortController();
348
- s({
349
- type: n.LOAD_DATA,
330
+ l({
331
+ type: t.LOAD_DATA,
350
332
  payload: {
351
- id: a
333
+ id: e
352
334
  }
353
- }), m({
354
- signal: l,
335
+ }), u({
336
+ signal: o,
355
337
  marker: _,
356
- searchInput: d,
357
- level: d === "" ? p + 1 : null,
358
- ancestorId: a !== i.id ? a.toString() : null,
338
+ searchInput: c,
339
+ level: c === "" ? m + 1 : null,
340
+ ancestorId: e !== r.id ? e.toString() : null,
359
341
  onlySelectableOptions: !1
360
- }).then((c) => {
361
- const I = c.options.map(S);
362
- s({
363
- type: n.LOAD_SUCCESS,
342
+ }).then((d) => {
343
+ const p = d.options.map(S);
344
+ l({
345
+ type: t.LOAD_SUCCESS,
364
346
  payload: {
365
- id: a,
366
- items: I,
367
- marker: c.marker
347
+ id: e,
348
+ items: p,
349
+ marker: d.marker
368
350
  }
369
351
  });
370
352
  }).catch(() => {
371
- s({
372
- type: n.LOAD_ERROR,
353
+ l({
354
+ type: t.LOAD_ERROR,
373
355
  payload: {
374
- id: a,
356
+ id: e,
375
357
  marker: _
376
358
  }
377
359
  });
378
360
  });
379
- }, [m, S, d, f]), $ = A.nodes.length === 0 || A.nodes[0].children.length === 0 && A.nodes[0].id === i.id;
380
- return /* @__PURE__ */ N("div", {
381
- children: [T && /* @__PURE__ */ u("div", {
361
+ }, [u, S, c, y]), M = D.nodes.length === 0 || D.nodes[0].children.length === 0 && D.nodes[0].id === r.id;
362
+ return /* @__PURE__ */ K("div", {
363
+ children: [I && /* @__PURE__ */ R("div", {
382
364
  className: C.noResultOption,
383
- children: /* @__PURE__ */ u(G, {
384
- "aria-label": U,
365
+ children: /* @__PURE__ */ R(q, {
366
+ "aria-label": W,
385
367
  className: C.loadingIndicator
386
368
  })
387
- }), $ && !T ? /* @__PURE__ */ u("div", {
369
+ }), M && !I ? /* @__PURE__ */ R("div", {
388
370
  className: C.noResultOption,
389
- children: B
390
- }) : /* @__PURE__ */ u(H, {
391
- "aria-label": t,
392
- data: A.nodes,
371
+ children: w
372
+ }) : /* @__PURE__ */ R(G, {
373
+ "aria-label": n,
374
+ data: D.nodes,
393
375
  multiSelect: v,
394
- onExpand: M,
395
- onLoadData: j,
396
- onNodeSelect: (e) => {
397
- x.includes(e.element.metadata.level) ? h(e) : (e.isSelected = !1, e.treeState.selectedIds.delete(e.element.id));
376
+ onExpand: U,
377
+ onLoadData: P,
378
+ onNodeSelect: (a) => {
379
+ h.includes(a.element.metadata.level) ? A(a) : (a.isSelected = !1, a.treeState.selectedIds.delete(a.element.id));
398
380
  },
399
381
  size: "large",
400
382
  togglableSelect: !0,
@@ -403,7 +385,6 @@ const ye = ({
403
385
  });
404
386
  };
405
387
  export {
406
- Oe as D,
407
- ye as S,
388
+ xe as D,
408
389
  C as s
409
390
  };
@@ -2,9 +2,8 @@ import "@box/blueprint-web";
2
2
  import "@box/tree";
3
3
  import "react";
4
4
  import "./tree-utils.js";
5
- import { D as p, S as s } from "../../../../chunks/dynamic-loading-tree.js";
5
+ import { D as e } from "../../../../chunks/dynamic-loading-tree.js";
6
6
  import "react/jsx-runtime";
7
7
  export {
8
- p as DynamicLoadingTree,
9
- s as SearchResultsName
8
+ e as DynamicLoadingTree
10
9
  };
@@ -1,5 +1,5 @@
1
1
  import { ComboboxWithApiTreeView as I } from "./combobox-with-api-tree-view.js";
2
- const y = [
2
+ const u = [
3
3
  // Level 1
4
4
  {
5
5
  id: "japan-l1-id",
@@ -203,6 +203,17 @@ const y = [
203
203
  level: 3,
204
204
  selectable: !0
205
205
  },
206
+ {
207
+ id: "long-option-l3-id",
208
+ ancestors: [{
209
+ id: "long-option-l1-id",
210
+ displayName: "Long child node",
211
+ level: 1
212
+ }],
213
+ displayName: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
214
+ level: 2,
215
+ selectable: !0
216
+ },
206
217
  // Japan L2
207
218
  {
208
219
  id: "hokkaido-l2-id",
@@ -359,8 +370,8 @@ const y = [
359
370
  level: 2,
360
371
  selectable: !0
361
372
  }
362
- ], N = 5, j = (l, e) => {
363
- const a = parseInt(l, 10) || 0, i = a + N;
373
+ ], y = 5, j = (l, e) => {
374
+ const a = parseInt(l, 10) || 0, i = a + y;
364
375
  return e.slice(a, i).map(({
365
376
  displayName: s,
366
377
  id: t,
@@ -371,7 +382,7 @@ const y = [
371
382
  ...n
372
383
  }));
373
384
  }, U = (l, e) => {
374
- const i = (parseInt(l, 10) || 0) + N;
385
+ const i = (parseInt(l, 10) || 0) + y;
375
386
  return i < e.length ? i.toString() : void 0;
376
387
  }, x = /* @__PURE__ */ (() => {
377
388
  let l = 0, e = 0;
@@ -382,17 +393,17 @@ const y = [
382
393
  searchInput: t,
383
394
  ancestorId: n,
384
395
  marker: o,
385
- failOnLoadMore: u,
386
- options: v = y,
396
+ failOnLoadMore: N,
397
+ options: v = u,
387
398
  failOnLoadMoreTimes: b = Number.MAX_SAFE_INTEGER,
388
- failOnLoadLevel: k,
389
- failOnLoadLevelTimes: f = Number.MAX_SAFE_INTEGER
399
+ failOnLoadLevel: g,
400
+ failOnLoadLevelTimes: k = Number.MAX_SAFE_INTEGER
390
401
  }) => {
391
402
  if (i.aborted)
392
403
  return Promise.reject(new DOMException("Aborted", "AbortError"));
393
- if (u && o != null && l < b)
404
+ if (N && o != null && l < b)
394
405
  return l += 1, Promise.reject();
395
- if (s === k && e < f)
406
+ if (s === g && e < k)
396
407
  return e += 1, Promise.reject();
397
408
  a && await new Promise((r) => setTimeout(r, a));
398
409
  const m = v.filter((r) => {
@@ -407,11 +418,11 @@ const y = [
407
418
  return s && c && c !== s && (d = !1), t && (d = d && h.toLowerCase().includes(t.toLowerCase())), n && (d = d && (p == null ? void 0 : p.some(({
408
419
  id: S
409
420
  }) => S === n))), d;
410
- }), g = Promise.resolve({
421
+ }), f = Promise.resolve({
411
422
  marker: U(o, m),
412
423
  options: j(o, m)
413
424
  });
414
- return w(await g);
425
+ return w(await f);
415
426
  };
416
427
  })();
417
428
  function w(l) {
@@ -432,7 +443,7 @@ function w(l) {
432
443
  };
433
444
  }
434
445
  const J = (l) => {
435
- const e = y.find((a) => a.displayName === l);
446
+ const e = u.find((a) => a.displayName === l);
436
447
  return e ? {
437
448
  value: e.id,
438
449
  displayValue: e.displayName,
@@ -443,7 +454,7 @@ const J = (l) => {
443
454
  };
444
455
  export {
445
456
  I as ComboboxWithApiTreeView,
446
- y as apiResponse,
457
+ u as apiResponse,
447
458
  J as findNode,
448
459
  x as mockTreeFetcher
449
460
  };
@@ -1,12 +1,6 @@
1
1
  import { NodeId, TreeProps } from '@box/tree';
2
2
  import { TreeOptionType } from '../combobox-with-api-pagination/types';
3
3
  import { ComboboxWithApiTreeViewProps, Level } from './types';
4
- export interface SearchResultsNameProps {
5
- levelName: string;
6
- parentDisplayValue: string;
7
- displayValue: string;
8
- }
9
- export declare const SearchResultsName: ({ levelName, parentDisplayValue, displayValue }: SearchResultsNameProps) => import("react/jsx-runtime").JSX.Element;
10
4
  export interface DynamicLoadingTreeProps {
11
5
  ariaLabel: string;
12
6
  onSelect: TreeProps['onNodeSelect'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/combobox-with-api",
3
- "version": "0.34.2",
3
+ "version": "0.34.5",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/blueprint-web": "^10.3.1",
@@ -11,11 +11,11 @@
11
11
  "react-intl": "^6.4.2"
12
12
  },
13
13
  "dependencies": {
14
- "@box/tree": "^0.45.1",
14
+ "@box/tree": "^0.45.2",
15
15
  "react-accessible-treeview": "2.9.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@box/blueprint-web": "^11.8.4",
18
+ "@box/blueprint-web": "^11.9.0",
19
19
  "@box/blueprint-web-assets": "^4.41.1",
20
20
  "@box/storybook-utils": "^0.12.0",
21
21
  "react": "^18.3.0",