@splunk/react-ui 5.0.0-rc.1 → 5.0.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/DualListbox.js CHANGED
@@ -72,22 +72,20 @@
72
72
  var l = e.n(a);
73
73
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
74
74
  const i = require("@splunk/ui-utils/i18n");
75
- // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
76
- const u = require("@splunk/ui-utils/keyboard");
77
75
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronLeft"
78
76
  const o = require("@splunk/react-icons/ChevronLeft");
79
- var c = e.n(o);
77
+ var u = e.n(o);
80
78
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
81
- const s = require("@splunk/react-icons/ChevronRight");
82
- var v = e.n(s);
79
+ const c = require("@splunk/react-icons/ChevronRight");
80
+ var s = e.n(c);
83
81
  // CONCATENATED MODULE: external "@splunk/ui-utils/format"
84
- const f = require("@splunk/ui-utils/format");
82
+ const v = require("@splunk/ui-utils/format");
85
83
  // CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
86
- const d = require("@splunk/react-ui/useForceUpdate");
87
- var p = e.n(d);
84
+ const f = require("@splunk/react-ui/useForceUpdate");
85
+ var d = e.n(f);
88
86
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
89
- const b = require("@splunk/react-ui/ScreenReaderContent");
90
- var m = e.n(b);
87
+ const p = require("@splunk/react-ui/ScreenReaderContent");
88
+ var b = e.n(p);
91
89
  // CONCATENATED MODULE: ./src/DualListbox/DualListboxContext.tsx
92
90
  /**
93
91
  * A React context used to inform subcomponets of DualListbox of parent component values.
@@ -95,11 +93,11 @@
95
93
  * Defaults to `'{}'`.
96
94
  * @public
97
95
  */
98
- var h = n().createContext({});
99
- /* harmony default export */ const g = h;
96
+ var m = n().createContext({});
97
+ /* harmony default export */ const h = m;
100
98
  // CONCATENATED MODULE: ./src/DualListbox/ScreenReaderWrapper.tsx
101
- function y() {
102
- return y = Object.assign ? Object.assign.bind() : function(e) {
99
+ function g() {
100
+ return g = Object.assign ? Object.assign.bind() : function(e) {
103
101
  for (var r = 1; r < arguments.length; r++) {
104
102
  var t = arguments[r];
105
103
  for (var n in t) {
@@ -107,30 +105,30 @@
107
105
  }
108
106
  }
109
107
  return e;
110
- }, y.apply(null, arguments);
108
+ }, g.apply(null, arguments);
111
109
  }
112
- function k(e) {
113
- var r = y({}, e);
114
- var a = p()();
115
- var l = (0, t.useContext)(g);
116
- var i = l.getScreenReaderMessage, u = l.updateScreenReaderRefreshHook;
110
+ function y(e) {
111
+ var r = g({}, e);
112
+ var a = d()();
113
+ var l = (0, t.useContext)(h);
114
+ var i = l.getScreenReaderMessage, o = l.updateScreenReaderRefreshHook;
117
115
  (0, t.useEffect)((function() {
118
- u === null || u === void 0 ? void 0 : u(a);
116
+ o === null || o === void 0 ? void 0 : o(a);
119
117
  return function() {
120
- return u === null || u === void 0 ? void 0 : u();
118
+ return o === null || o === void 0 ? void 0 : o();
121
119
  };
122
- }), [ u, a ]);
120
+ }), [ o, a ]);
123
121
  if (!i) {
124
122
  return null;
125
123
  }
126
124
 
127
- return n().createElement(m(), y({
125
+ return n().createElement(b(), g({
128
126
  "aria-live": "assertive"
129
127
  }, r), i() || "");
130
128
  }
131
- /* harmony default export */ const C = k;
129
+ /* harmony default export */ const k = y;
132
130
  // CONCATENATED MODULE: ./src/DualListbox/listboxUtils.ts
133
- var S = function e(r, t) {
131
+ var C = function e(r, t) {
134
132
  var n = r.filter((function(e) {
135
133
  return e !== t;
136
134
  }));
@@ -139,13 +137,13 @@
139
137
  }
140
138
  return n;
141
139
  };
142
- var w = function e(r, t) {
140
+ var S = function e(r, t) {
143
141
  var n = new Set(t);
144
142
  return r.filter((function(e) {
145
143
  return !n.has(e);
146
144
  }));
147
145
  };
148
- var x = function e(r, t, n) {
146
+ var w = function e(r, t, n) {
149
147
  if (r < 0) {
150
148
  return undefined;
151
149
  }
@@ -155,13 +153,13 @@
155
153
  return a;
156
154
  }
157
155
  for (var i = r + 1; i < t.length; i += 1) {
158
- var u = t[i];
159
- if (!l.has(u)) {
160
- return u;
156
+ var o = t[i];
157
+ if (!l.has(o)) {
158
+ return o;
161
159
  }
162
160
  }
163
- for (var o = r - 1; o > 0; o -= 1) {
164
- var c = t[o];
161
+ for (var u = r - 1; u > 0; u -= 1) {
162
+ var c = t[u];
165
163
  if (!l.has(c)) {
166
164
  return c;
167
165
  }
@@ -170,7 +168,7 @@
170
168
  };
171
169
  // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
172
170
  // A utility that attempts to move an element into view by scrolling it's derived parent.
173
- var O = function e(r) {
171
+ var x = function e(r) {
174
172
  if (!r) {
175
173
  return;
176
174
  }
@@ -188,17 +186,17 @@
188
186
  };
189
187
  // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
190
188
  // A utility for matching keyboard characters to list values
191
- var R = function e(r, t) {
189
+ var O = function e(r, t) {
192
190
  return r ? r.label.charAt(t).toLowerCase() : "";
193
191
  };
194
- var E = function e(r, t) {
192
+ var R = function e(r, t) {
195
193
  if (!r.length) {
196
194
  return r;
197
195
  }
198
196
  var n = null;
199
197
  var a = false;
200
198
  var l = r.filter((function(e) {
201
- var r = R(e, t.index);
199
+ var r = O(e, t.index);
202
200
  if (r === t.value) {
203
201
  a = true;
204
202
  return true;
@@ -206,7 +204,7 @@
206
204
  // If we haven't found a match yet, keep track of the next closest match.
207
205
  // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
208
206
  if (!a) {
209
- var l = R(n, t.index);
207
+ var l = O(n, t.index);
210
208
  if (!l) {
211
209
  n = e;
212
210
  } else if (r > t.value) {
@@ -230,31 +228,31 @@
230
228
  * Defaults to `'{}'`.
231
229
  * @public
232
230
  */
233
- var I = n().createContext({});
234
- /* harmony default export */ const q = I;
231
+ var E = n().createContext({});
232
+ /* harmony default export */ const I = E;
235
233
  // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
236
234
  const L = require("@splunk/react-ui/Tooltip");
237
- var P = e.n(L);
235
+ var q = e.n(L);
238
236
  // CONCATENATED MODULE: external "styled-components"
239
- const N = require("styled-components");
240
- var _ = e.n(N);
237
+ const P = require("styled-components");
238
+ var N = e.n(P);
241
239
  // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
242
- const j = require("@splunk/react-ui/ButtonSimple");
243
- var V = e.n(j);
240
+ const _ = require("@splunk/react-ui/ButtonSimple");
241
+ var j = e.n(_);
244
242
  // CONCATENATED MODULE: external "@splunk/themes"
245
- const B = require("@splunk/themes");
243
+ const V = require("@splunk/themes");
246
244
  // CONCATENATED MODULE: ./src/DualListbox/ToolbarButtonStyles.ts
247
- var M = _()(V()).withConfig({
245
+ var B = N()(j()).withConfig({
248
246
  displayName: "ToolbarButtonStyles__StyledButtonSimple",
249
247
  componentId: "k7zksz-0"
250
- })([ "height:", ";width:", ";" ], B.variables.inputHeight, B.variables.inputHeight);
251
- var D = _().span.withConfig({
248
+ })([ "height:", ";width:", ";" ], V.variables.inputHeight, V.variables.inputHeight);
249
+ var D = N().span.withConfig({
252
250
  displayName: "ToolbarButtonStyles__StyledIcon",
253
251
  componentId: "k7zksz-1"
254
252
  })([ "align-items:center;display:flex;flex-direction:row;flex-shrink:0;justify-content:center;max-width:100%;" ]);
255
253
  // CONCATENATED MODULE: ./src/DualListbox/ToolbarButton.tsx
256
- function T() {
257
- return T = Object.assign ? Object.assign.bind() : function(e) {
254
+ function M() {
255
+ return M = Object.assign ? Object.assign.bind() : function(e) {
258
256
  for (var r = 1; r < arguments.length; r++) {
259
257
  var t = arguments[r];
260
258
  for (var n in t) {
@@ -262,9 +260,9 @@
262
260
  }
263
261
  }
264
262
  return e;
265
- }, T.apply(null, arguments);
263
+ }, M.apply(null, arguments);
266
264
  }
267
- function H(e, r) {
265
+ function T(e, r) {
268
266
  if (null == e) return {};
269
267
  var t, n, a = A(e, r);
270
268
  if (Object.getOwnPropertySymbols) {
@@ -286,17 +284,17 @@
286
284
  }
287
285
  return t;
288
286
  }
289
- var K = {
287
+ var H = {
290
288
  icon: l().node.isRequired,
291
289
  name: l().string.isRequired,
292
290
  tooltipLabel: l().string.isRequired,
293
291
  tooltipPlacement: l().oneOf([ "above", "below", "left", "right" ])
294
292
  };
295
- function F(e) {
296
- var r = e.ariaLabel, a = e.ariaKeyShortcuts, l = e.icon, i = e.name, u = e.tooltipLabel, o = e.tooltipPlacement, c = H(e, [ "ariaLabel", "ariaKeyShortcuts", "icon", "name", "tooltipLabel", "tooltipPlacement" ]);
297
- var s = (0, t.useContext)(q);
298
- var v = p()();
299
- var f = s.getButtonState, d = s.onButtonClick, b = s.updateButtonRefreshHookByName;
293
+ function K(e) {
294
+ var r = e.ariaLabel, a = e.ariaKeyShortcuts, l = e.icon, i = e.name, o = e.tooltipLabel, u = e.tooltipPlacement, c = T(e, [ "ariaLabel", "ariaKeyShortcuts", "icon", "name", "tooltipLabel", "tooltipPlacement" ]);
295
+ var s = (0, t.useContext)(I);
296
+ var v = d()();
297
+ var f = s.getButtonState, p = s.onButtonClick, b = s.updateButtonRefreshHookByName;
300
298
  (0, t.useEffect)((function() {
301
299
  b === null || b === void 0 ? void 0 : b(i, v);
302
300
  return function() {
@@ -304,21 +302,21 @@
304
302
  };
305
303
  }), [ i, b, v ]);
306
304
  var m = (0, t.useCallback)((function(e) {
307
- d === null || d === void 0 ? void 0 : d(e, {
305
+ p === null || p === void 0 ? void 0 : p(e, {
308
306
  name: i
309
307
  });
310
- }), [ d, i ]);
308
+ }), [ p, i ]);
311
309
  if (!f) {
312
310
  return null;
313
311
  }
314
312
  var h = f(i), g = h.disabled;
315
313
 
316
- return n().createElement(P(), {
317
- defaultPlacement: o,
314
+ return n().createElement(q(), {
315
+ defaultPlacement: u,
318
316
  content: n().createElement("span", {
319
317
  "aria-hidden": true
320
- }, u)
321
- }, n().createElement(M, T({
318
+ }, o)
319
+ }, n().createElement(B, M({
322
320
  appearance: "subtle",
323
321
  "aria-label": r,
324
322
  "aria-keyshortcuts": a,
@@ -328,27 +326,28 @@
328
326
  onClick: m
329
327
  }, c), n().createElement(D, null, l)));
330
328
  }
331
- F.propsTypes = K;
332
- /* harmony default export */ const $ = F;
329
+ K.propsTypes = H;
330
+ /* harmony default export */ const F = K;
333
331
  // CONCATENATED MODULE: external "@splunk/react-ui/NonInteractiveCheckbox"
334
- const z = require("@splunk/react-ui/NonInteractiveCheckbox");
335
- var U = e.n(z);
332
+ const $ = require("@splunk/react-ui/NonInteractiveCheckbox");
333
+ var z = e.n($);
336
334
  // CONCATENATED MODULE: ./src/DualListbox/OptionStyles.ts
337
- var W = _().li.withConfig({
335
+ var U = (0, P.css)([ "background:", ";font-weight:", ";" ], V.mixins.overlayColors(V.variables.interactiveColorOverlaySelected, V.variables.interactiveColorOverlayActive), V.variables.fontWeightBold);
336
+ var W = N().li.withConfig({
338
337
  displayName: "OptionStyles__StyledListItem",
339
338
  componentId: "q275d9-0"
340
- })([ "align-items:center;color:", ";cursor:pointer;display:flex;min-height:", ";overflow:hidden;padding:0 ", ";word-wrap:break-word;line-height:20px;", " ", "" ], B.variables.contentColorActive, B.variables.inputHeight, B.variables.spacingSmall, (0,
341
- B.pickVariant)("$active", {
342
- true: (0, N.css)([ "background:", ";" ], B.mixins.overlayColors(B.variables.interactiveColorOverlaySelected, B.variables.interactiveColorOverlayActive))
343
- }), (0, B.pickVariant)("$selected", {
344
- true: (0, N.css)([ "background:", ";&:hover{background:", ";}" ], B.variables.interactiveColorOverlaySelected, B.mixins.overlayColors(B.variables.interactiveColorOverlaySelected, B.variables.interactiveColorOverlayHover)),
345
- false: (0, N.css)([ "&:hover{background:", ";}" ], B.variables.interactiveColorOverlayHover)
339
+ })([ "align-items:center;color:", ";cursor:pointer;display:flex;min-height:", ";overflow:hidden;padding:0 ", ";word-wrap:break-word;line-height:20px;", " &:active{", "}", "" ], V.variables.contentColorActive, V.variables.inputHeight, V.variables.spacingSmall, (function(e) {
340
+ var r = e.$active;
341
+ return r && U;
342
+ }), U, (0, V.pickVariant)("$selected", {
343
+ true: (0, P.css)([ "background:", ";&:hover{background:", ";}" ], V.variables.interactiveColorOverlaySelected, V.mixins.overlayColors(V.variables.interactiveColorOverlaySelected, V.variables.interactiveColorOverlayHover)),
344
+ false: (0, P.css)([ "&:hover{background:", ";}" ], V.variables.interactiveColorOverlayHover)
346
345
  }));
347
- var X = _()(U()).withConfig({
346
+ var X = N()(z()).withConfig({
348
347
  displayName: "OptionStyles__StyledNonInteractiveCheckbox",
349
348
  componentId: "q275d9-1"
350
- })([ "", " padding-inline-end:", ";" ], B.mixins.reset("min-height"), B.variables.spacingSmall);
351
- var G = _().div.withConfig({
349
+ })([ "", " padding-inline-end:", ";" ], V.mixins.reset("min-height"), V.variables.spacingSmall);
350
+ var G = N().div.withConfig({
352
351
  displayName: "OptionStyles__StyledDiv",
353
352
  componentId: "q275d9-2"
354
353
  })([ "word-break:break-word;word-wrap:break-word;" ]);
@@ -403,10 +402,10 @@
403
402
  value: l().string.isRequired
404
403
  };
405
404
  function te(e) {
406
- var r = e.id, a = e.label, l = e.selected, i = e.value, u = Z(e, [ "id", "label", "selected", "value" ]);
407
- var o = (0, t.useContext)(Q);
408
- var c = p()();
409
- var s = o.onOptionClick, v = o.getOptionStateForValue, f = o.updateOptionRefreshHookByValue, d = o.controlled;
405
+ var r = e.id, a = e.label, l = e.selected, i = e.value, o = Z(e, [ "id", "label", "selected", "value" ]);
406
+ var u = (0, t.useContext)(Q);
407
+ var c = d()();
408
+ var s = u.onOptionClick, v = u.getOptionStateForValue, f = u.updateOptionRefreshHookByValue, p = u.controlled;
410
409
  (0, t.useEffect)((function() {
411
410
  f === null || f === void 0 ? void 0 : f(i, c);
412
411
  return function() {
@@ -422,7 +421,7 @@
422
421
  return null;
423
422
  }
424
423
  var m = v(i), h = m.active, g = m.selected;
425
- var y = !!(d ? l : g);
424
+ var y = !!(p ? l : g);
426
425
 
427
426
  return n().createElement(W, Y({
428
427
  "aria-selected": y,
@@ -434,7 +433,7 @@
434
433
  role: "option",
435
434
  $active: h,
436
435
  $selected: y
437
- }, u), n().createElement(X, {
436
+ }, o), n().createElement(X, {
438
437
  selected: y
439
438
  }), n().createElement(G, null, a));
440
439
  }
@@ -446,20 +445,20 @@
446
445
  const le = require("@splunk/react-ui/Switch");
447
446
  var ie = e.n(le);
448
447
  // CONCATENATED MODULE: ./src/DualListbox/LabelStyles.ts
449
- var ue = _().label.withConfig({
448
+ var oe = N().label.withConfig({
450
449
  displayName: "LabelStyles__StyledLabel",
451
450
  componentId: "unwplx-0"
452
- })([ "color:", ";flex:0 0 auto;" ], B.variables.contentColorActive);
453
- var oe = _().div.withConfig({
451
+ })([ "color:", ";flex:0 0 auto;" ], V.variables.contentColorActive);
452
+ var ue = N().div.withConfig({
454
453
  displayName: "LabelStyles__StyledLabelContainer",
455
454
  componentId: "unwplx-1"
456
455
  })([ "display:flex;flex-direction:column;" ]);
457
- var ce = _().div.withConfig({
456
+ var ce = N().div.withConfig({
458
457
  displayName: "LabelStyles__StyledSwitchContainer",
459
458
  componentId: "unwplx-2"
460
- })([ "align-items:center;border:", " solid transparent;display:flex;gap:", ";grid-row:headers;padding:0 ", ";", "" ], B.variables.inputBorderWidth, B.variables.spacingSmall, B.variables.spacingSmall, (function(e) {
459
+ })([ "align-items:center;border:", " solid transparent;display:flex;gap:", ";grid-row:headers;padding:0 ", ";", "" ], V.variables.inputBorderWidth, V.variables.spacingSmall, V.variables.spacingSmall, (function(e) {
461
460
  var r = e.$columnNumber;
462
- return (0, N.css)([ "grid-column:", ";" ], "list".concat(r));
461
+ return (0, P.css)([ "grid-column:", ";" ], "list".concat(r));
463
462
  }));
464
463
  // CONCATENATED MODULE: ./src/DualListbox/Label.tsx
465
464
  var se = {
@@ -471,17 +470,17 @@
471
470
  value: l().string.isRequired
472
471
  };
473
472
  function ve(e) {
474
- var r = e.id, a = e.index, l = e.listId, u = e.name, o = e.onSwitchClick, c = e.value;
473
+ var r = e.id, a = e.index, l = e.listId, o = e.name, u = e.onSwitchClick, c = e.value;
475
474
  var s = (0, t.useContext)(Q);
476
- var v = p()();
477
- var d = (0, t.useRef)((0, ae.createDOMID)("switch"));
478
- var b = s.updateLabelRefreshHookByName, h = s.getLabelState;
475
+ var f = d()();
476
+ var p = (0, t.useRef)((0, ae.createDOMID)("switch"));
477
+ var m = s.updateLabelRefreshHookByName, h = s.getLabelState;
479
478
  (0, t.useEffect)((function() {
480
- b === null || b === void 0 ? void 0 : b(u, v);
479
+ m === null || m === void 0 ? void 0 : m(o, f);
481
480
  return function() {
482
- return b === null || b === void 0 ? void 0 : b(u);
481
+ return m === null || m === void 0 ? void 0 : m(o);
483
482
  };
484
- }), [ u, b, v ]);
483
+ }), [ o, m, f ]);
485
484
  if (!h) {
486
485
  return null;
487
486
  }
@@ -489,20 +488,20 @@
489
488
 
490
489
  return n().createElement(ce, {
491
490
  $columnNumber: a
492
- }, n().createElement(m(), {
491
+ }, n().createElement(b(), {
493
492
  "aria-hidden": true,
494
- id: d.current
495
- }, (0, f.sprintf)((0, i._)("Select all %(listName)s Options"), {
493
+ id: p.current
494
+ }, (0, v.sprintf)((0, i._)("Select all %(listName)s Options"), {
496
495
  listName: c
497
496
  })), n().createElement(ie(), {
498
497
  appearance: "checkbox",
499
498
  "data-test": "select-all",
500
499
  disabled: y,
501
- labelledBy: d.current,
502
- onClick: o,
500
+ labelledBy: p.current,
501
+ onClick: u,
503
502
  selected: k,
504
503
  value: c
505
- }), n().createElement(oe, null, n().createElement(ue, {
504
+ }), n().createElement(ue, null, n().createElement(oe, {
506
505
  id: r,
507
506
  htmlFor: l
508
507
  }, c), n().createElement("span", {
@@ -512,12 +511,12 @@
512
511
  ve.propTypes = se;
513
512
  /* harmony default export */ const fe = ve;
514
513
  // CONCATENATED MODULE: ./src/DualListbox/ListboxStyles.ts
515
- var de = _().ul.withConfig({
514
+ var de = N().ul.withConfig({
516
515
  displayName: "ListboxStyles__StyledListbox",
517
516
  componentId: "sc-11oqtd-0"
518
- })([ "background-color:", ";border:", " solid ", ";border-radius:", ";grid-row:lists;list-style:none;margin:0;min-height:0;min-width:0;overflow:auto;padding:0;position:relative;&:focus{box-shadow:", ";outline:none;}", "" ], B.variables.transparent, B.variables.inputBorderWidth, B.variables.interactiveColorBorder, B.variables.borderRadius, B.variables.focusShadow, (function(e) {
517
+ })([ "background-color:", ";border:", " solid ", ";border-radius:", ";grid-row:lists;list-style:none;margin:0;min-height:0;min-width:0;overflow:auto;padding:0;position:relative;&:focus{box-shadow:", ";outline:none;}", "" ], V.variables.transparent, V.variables.inputBorderWidth, V.variables.interactiveColorBorder, V.variables.borderRadius, V.variables.focusShadow, (function(e) {
519
518
  var r = e.$columnNumber;
520
- return (0, N.css)([ "grid-column:", ";" ], "list".concat(r));
519
+ return (0, P.css)([ "grid-column:", ";" ], "list".concat(r));
521
520
  }));
522
521
  // CONCATENATED MODULE: ./src/DualListbox/Listbox.tsx
523
522
  function pe() {
@@ -564,26 +563,26 @@
564
563
  onSelectAllClick: l().func
565
564
  };
566
565
  function ge(e) {
567
- var r = e.children, a = e.elementRef, l = e.index, i = e.label, u = e.name, o = e.onClick, c = e.onKeyDown, s = e.onSelectAllClick, v = be(e, [ "children", "elementRef", "index", "label", "name", "onClick", "onKeyDown", "onSelectAllClick" ]);
566
+ var r = e.children, a = e.elementRef, l = e.index, i = e.label, o = e.name, u = e.onClick, c = e.onKeyDown, s = e.onSelectAllClick, v = be(e, [ "children", "elementRef", "index", "label", "name", "onClick", "onKeyDown", "onSelectAllClick" ]);
568
567
  var f = (0, t.useRef)((0, ae.createDOMID)("label"));
569
568
  var d = (0, t.useRef)((0, ae.createDOMID)("listbox"));
570
- var p = (0, t.useContext)(g), b = p.controlled, m = p.getSelectedStateForValue, h = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, S = p.updateOptionRefreshHookByValue;
569
+ var p = (0, t.useContext)(h), b = p.controlled, m = p.getSelectedStateForValue, g = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, S = p.updateOptionRefreshHookByValue;
571
570
  var w = (0, t.useCallback)((function(e, r) {
572
571
  var t = r.value;
573
- o === null || o === void 0 ? void 0 : o(e, {
574
- name: u,
572
+ u === null || u === void 0 ? void 0 : u(e, {
573
+ name: o,
575
574
  value: t
576
575
  });
577
- }), [ u, o ]);
576
+ }), [ o, u ]);
578
577
  var x = (0, t.useCallback)((function(e) {
579
578
  return {
580
- active: (h === null || h === void 0 ? void 0 : h(u)) === e,
579
+ active: (g === null || g === void 0 ? void 0 : g(o)) === e,
581
580
  selected: !!(m === null || m === void 0 ? void 0 : m(e))
582
581
  };
583
- }), [ u, h, m ]);
582
+ }), [ o, g, m ]);
584
583
  var O = (0, t.useCallback)((function() {
585
- var e = (k === null || k === void 0 ? void 0 : k(u)) || 0;
586
- var r = (y === null || y === void 0 ? void 0 : y(u)) || 0;
584
+ var e = (k === null || k === void 0 ? void 0 : k(o)) || 0;
585
+ var r = (y === null || y === void 0 ? void 0 : y(o)) || 0;
587
586
  var t = false;
588
587
  if (r > 0) {
589
588
  t = r === e ? true : "some";
@@ -594,16 +593,16 @@
594
593
  selectedValueCount: r,
595
594
  valueCount: e
596
595
  };
597
- }), [ u, y, k ]);
596
+ }), [ o, y, k ]);
598
597
  var R = function e(r) {
599
598
  c === null || c === void 0 ? void 0 : c(r, {
600
- name: u
599
+ name: o
601
600
  });
602
601
  };
603
602
  var E = function e(r, t) {
604
603
  var n = t.selected;
605
604
  s === null || s === void 0 ? void 0 : s(r, {
606
- name: u,
605
+ name: o,
607
606
  selected: n
608
607
  });
609
608
  };
@@ -613,7 +612,7 @@
613
612
  r.preventDefault();
614
613
  }
615
614
  };
616
- var q = (0, t.useMemo)((function() {
615
+ var L = (0, t.useMemo)((function() {
617
616
  return {
618
617
  onOptionClick: w,
619
618
  updateLabelRefreshHookByName: C,
@@ -625,12 +624,12 @@
625
624
  }), [ w, C, S, x, O, b ]);
626
625
 
627
626
  return n().createElement(Q.Provider, {
628
- value: q
627
+ value: L
629
628
  }, n().createElement(fe, {
630
629
  id: f.current,
631
630
  index: l,
632
631
  listId: d.current,
633
- name: u,
632
+ name: o,
634
633
  onSwitchClick: E,
635
634
  value: i
636
635
  }), n().createElement(de, pe({
@@ -653,20 +652,20 @@
653
652
  const ke = require("@splunk/react-ui/Box");
654
653
  var Ce = e.n(ke);
655
654
  // CONCATENATED MODULE: ./src/DualListbox/DualListboxStyles.ts
656
- var Se = _()(Ce()).withConfig({
655
+ var Se = N()(Ce()).withConfig({
657
656
  displayName: "DualListboxStyles__StyledBox",
658
657
  componentId: "sc-1te6bz0-0"
659
- })([ "display:grid;grid-template-columns:[list0] 180px [actions] min-content [list1] 180px;grid-template-rows:[headers] min-content [lists] 160px;gap:", " ", ";", " ", "" ], B.variables.spacingXSmall, B.variables.spacingSmall, (function(e) {
658
+ })([ "display:grid;grid-template-columns:[list0] 180px [actions] min-content [list1] 180px;grid-template-rows:[headers] min-content [lists] 160px;gap:", " ", ";", " ", "" ], V.variables.spacingXSmall, V.variables.spacingSmall, (function(e) {
660
659
  var r = e.$inline;
661
- return r && (0, N.css)([ "display:inline-grid;" ]);
660
+ return r && (0, P.css)([ "display:inline-grid;" ]);
662
661
  }), (function(e) {
663
662
  var r = e.$fill;
664
- return r && (0, N.css)([ "height:100%;grid-template-columns:[list0] 1fr [actions] min-content [list1] 1fr;grid-template-rows:[headers] min-content [lists] 1fr;position:relative;width:100%;" ]);
663
+ return r && (0, P.css)([ "height:100%;grid-template-columns:[list0] 1fr [actions] min-content [list1] 1fr;grid-template-rows:[headers] min-content [lists] 1fr;position:relative;width:100%;" ]);
665
664
  }));
666
- var we = _().div.withConfig({
665
+ var we = N().div.withConfig({
667
666
  displayName: "DualListboxStyles__StyledFlexColumn",
668
667
  componentId: "sc-1te6bz0-1"
669
- })([ "&::before{content:'';grid-column:headers;grid-row:lists;}align-items:center;display:flex;flex-direction:column;gap:", ";grid-column:actions;grid-row:lists;justify-content:center;" ], B.variables.spacingSmall);
668
+ })([ "&::before{content:'';grid-column:headers;grid-row:lists;}align-items:center;display:flex;flex-direction:column;gap:", ";grid-column:actions;grid-row:lists;justify-content:center;" ], V.variables.spacingSmall);
670
669
  // CONCATENATED MODULE: ./src/DualListbox/DualListbox.tsx
671
670
  function xe() {
672
671
  return xe = Object.assign ? Object.assign.bind() : function(e) {
@@ -680,7 +679,7 @@
680
679
  }, xe.apply(null, arguments);
681
680
  }
682
681
  function Oe(e, r) {
683
- return Le(e) || qe(e, r) || Ee(e, r) || Re();
682
+ return qe(e) || Le(e, r) || Ee(e, r) || Re();
684
683
  }
685
684
  function Re() {
686
685
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -699,29 +698,29 @@
699
698
  }
700
699
  return n;
701
700
  }
702
- function qe(e, r) {
701
+ function Le(e, r) {
703
702
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
704
703
  if (null != t) {
705
- var n, a, l, i, u = [], o = !0, c = !1;
704
+ var n, a, l, i, o = [], u = !0, c = !1;
706
705
  try {
707
706
  if (l = (t = t.call(e)).next, 0 === r) {
708
707
  if (Object(t) !== t) return;
709
- o = !1;
710
- } else for (;!(o = (n = l.call(t)).done) && (u.push(n.value), u.length !== r); o = !0) {
708
+ u = !1;
709
+ } else for (;!(u = (n = l.call(t)).done) && (o.push(n.value), o.length !== r); u = !0) {
711
710
  }
712
711
  } catch (e) {
713
712
  c = !0, a = e;
714
713
  } finally {
715
714
  try {
716
- if (!o && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
715
+ if (!u && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
717
716
  } finally {
718
717
  if (c) throw a;
719
718
  }
720
719
  }
721
- return u;
720
+ return o;
722
721
  }
723
722
  }
724
- function Le(e) {
723
+ function qe(e) {
725
724
  if (Array.isArray(e)) return e;
726
725
  }
727
726
  function Pe(e, r) {
@@ -762,85 +761,85 @@
762
761
  };
763
762
  function je(e) {
764
763
  var r, a, l, o;
765
- var s = e.children, d = e.controlled, b = d === void 0 ? false : d, m = e.elementRef, h = e.fill, y = h === void 0 ? false : h, k = e.inline, R = k === void 0 ? false : k, I = e.onChange, L = e.onSelect, P = e.lists, N = Pe(e, [ "children", "controlled", "elementRef", "fill", "inline", "onChange", "onSelect", "lists" ]);
764
+ var c = e.children, f = e.controlled, p = f === void 0 ? false : f, b = e.elementRef, m = e.fill, g = m === void 0 ? false : m, y = e.inline, O = y === void 0 ? false : y, E = e.onChange, L = e.onSelect, q = e.lists, P = Pe(e, [ "children", "controlled", "elementRef", "fill", "inline", "onChange", "onSelect", "lists" ]);
766
765
  // @docs-props-type DualListboxPropsBase
767
- var _ = p()();
768
- var j = (0, t.useRef)(false);
766
+ var N = d()();
767
+ var _ = (0, t.useRef)(false);
769
768
  (0, t.useEffect)((function() {
770
- j.current = true;
769
+ _.current = true;
771
770
  }), []);
772
771
  // TODO: Implement shared isControlled hook (SUI-5283).
773
- var V = (0, t.useRef)(b);
772
+ var j = (0, t.useRef)(p);
774
773
  // List One "Available" Refs
775
- var B = (0, t.useRef)([]);
776
- var M = (0, t.useRef)([]);
774
+ var V = (0, t.useRef)([]);
775
+ var B = (0, t.useRef)([]);
777
776
  var D = (0, t.useRef)();
778
- var T = (0, t.useRef)(null);
779
- var H = (0, t.useRef)([]);
777
+ var M = (0, t.useRef)(null);
778
+ var T = (0, t.useRef)([]);
780
779
  // List Two "Selected" Refs
781
780
  var A = (0, t.useRef)([]);
782
- var K = (0, t.useRef)([]);
783
- var F = (0, t.useRef)();
784
- var z = (0, t.useRef)(null);
785
- var U = (0, t.useRef)([]);
781
+ var H = (0, t.useRef)([]);
782
+ var K = (0, t.useRef)();
783
+ var $ = (0, t.useRef)(null);
784
+ var z = (0, t.useRef)([]);
786
785
  // Refresh Hook Stores, used to render indivual elements when uncontrolled
787
- var W = (0, t.useRef)({});
786
+ var U = (0, t.useRef)({});
787
+ var W = (0, t.useRef)({});
788
788
  var X = (0, t.useRef)({});
789
- var G = (0, t.useRef)({});
790
- var J = (0, t.useRef)();
789
+ var G = (0, t.useRef)();
791
790
  // Activity Values Refs
792
- var Q = (0, t.useRef)();
791
+ var J = (0, t.useRef)();
792
+ var Q = (0, t.useRef)({});
793
793
  var Y = (0, t.useRef)({});
794
794
  var Z = (0, t.useRef)({});
795
- var ee = (0, t.useRef)({});
796
- var re = (0, t.useRef)(0);
795
+ var ee = (0, t.useRef)(0);
797
796
  // Key Match Refs
798
- var te = (0, t.useRef)();
799
- var ne = (0, t.useRef)();
800
- var ae = (0, t.useRef)([]);
797
+ var re = (0, t.useRef)();
798
+ var te = (0, t.useRef)();
799
+ var ne = (0, t.useRef)([]);
801
800
  if (false) {}
802
801
  if (false) {}
803
802
  if (false) {}
804
803
  // Unpack names and labels instead of relying on `lists` being a consistent reference
805
- var le = (r = P[0]) === null || r === void 0 ? void 0 : r.name;
806
- var ie = (a = P[1]) === null || a === void 0 ? void 0 : a.name;
807
- var ue = (l = P[0]) === null || l === void 0 ? void 0 : l.label;
808
- var oe = (o = P[1]) === null || o === void 0 ? void 0 : o.label;
804
+ var ae = (r = q[0]) === null || r === void 0 ? void 0 : r.name;
805
+ var le = (a = q[1]) === null || a === void 0 ? void 0 : a.name;
806
+ var ie = (l = q[0]) === null || l === void 0 ? void 0 : l.label;
807
+ var oe = (o = q[1]) === null || o === void 0 ? void 0 : o.label;
809
808
  // Copy previous state for uncontrolled render so it's not voided by following value reset
810
- var ce = new Set(A.current);
809
+ var ue = new Set(A.current);
811
810
  // This ensures we recapture the indexes after batch moves, but will be refactored when sorting is implemented (SUI-5270).
812
- B.current = [];
811
+ V.current = [];
813
812
  A.current = [];
814
- H.current = [];
815
- U.current = [];
813
+ T.current = [];
814
+ z.current = [];
816
815
  // Clean the data stores before we copy the references into listData
817
- if (!j.current || V.current) {
818
- M.current = [];
819
- K.current = [];
820
- Y.current = {};
821
- ee.current = {};
816
+ if (!_.current || j.current) {
817
+ B.current = [];
818
+ H.current = [];
819
+ Q.current = {};
822
820
  Z.current = {};
821
+ Y.current = {};
823
822
  }
824
- var se = [ {
823
+ var ce = [ {
825
824
  options: [],
826
- matchOptions: H.current,
827
- values: B.current,
828
- selectedValues: M.current,
825
+ matchOptions: T.current,
826
+ values: V.current,
827
+ selectedValues: B.current,
829
828
  activeValue: D.current,
830
829
  activeFound: !D.current
831
830
  }, {
832
831
  options: [],
833
- matchOptions: U.current,
832
+ matchOptions: z.current,
834
833
  values: A.current,
835
- selectedValues: K.current,
836
- activeValue: F.current,
837
- activeFound: !F.current
834
+ selectedValues: H.current,
835
+ activeValue: K.current,
836
+ activeFound: !K.current
838
837
  } ];
839
- if (!j.current || V.current) {
840
- t.Children.toArray(s).filter(t.isValidElement).forEach((function(e) {
838
+ if (!_.current || j.current) {
839
+ t.Children.toArray(c).filter(t.isValidElement).forEach((function(e) {
841
840
  var r = e.props, t = r.value, n = r.label;
842
- var a = e.props.listName === ie;
843
- var l = se[a ? 1 : 0];
841
+ var a = e.props.listName === le;
842
+ var l = ce[a ? 1 : 0];
844
843
  // Ensure the active value is found on controlled renders
845
844
  if (!l.activeFound && l.activeValue === t) {
846
845
  l.activeFound = true;
@@ -855,300 +854,300 @@
855
854
  if (i) {
856
855
  l.selectedValues.push(t);
857
856
  }
858
- Y.current[t] = i;
859
- ee.current[t] = l.values.length - 1;
860
- Z.current[t] = e.props.id;
857
+ Q.current[t] = i;
858
+ Z.current[t] = l.values.length - 1;
859
+ Y.current[t] = e.props.id;
861
860
  }));
862
861
  } else {
863
- t.Children.toArray(s).filter(t.isValidElement).forEach((function(e) {
862
+ t.Children.toArray(c).filter(t.isValidElement).forEach((function(e) {
864
863
  var r = e.props, t = r.value, n = r.label;
865
- var a = ce.has(t);
866
- var l = se[a ? 1 : 0];
864
+ var a = ue.has(t);
865
+ var l = ce[a ? 1 : 0];
867
866
  l.values.push(t);
868
867
  l.options.push(e);
869
868
  l.matchOptions.push({
870
869
  value: t,
871
870
  label: n
872
871
  });
873
- ee.current[t] = l.values.length - 1;
872
+ Z.current[t] = l.values.length - 1;
874
873
  }));
875
874
  }
876
- var ve = (0, t.useCallback)((function(e, r) {
877
- if (e === le) {
875
+ var se = (0, t.useCallback)((function(e, r) {
876
+ if (e === ae) {
878
877
  D.current = r;
879
878
  } else {
880
- F.current = r;
879
+ K.current = r;
881
880
  }
882
- }), [ le ]);
883
- var fe = (0, t.useCallback)((function(e) {
884
- return e === le ? D.current : F.current;
885
- }), [ le ]);
886
- var de = (0, t.useCallback)((function(e, r) {
887
- if (e === le) {
888
- M.current = r;
881
+ }), [ ae ]);
882
+ var ve = (0, t.useCallback)((function(e) {
883
+ return e === ae ? D.current : K.current;
884
+ }), [ ae ]);
885
+ var fe = (0, t.useCallback)((function(e, r) {
886
+ if (e === ae) {
887
+ B.current = r;
889
888
  } else {
890
- K.current = r;
889
+ H.current = r;
891
890
  }
892
- }), [ le ]);
891
+ }), [ ae ]);
892
+ var de = (0, t.useCallback)((function(e) {
893
+ return e === ae ? B.current : H.current;
894
+ }), [ ae ]);
893
895
  var pe = (0, t.useCallback)((function(e) {
894
- return e === le ? M.current : K.current;
895
- }), [ le ]);
896
- var be = (0, t.useCallback)((function(e) {
897
- return pe(e).length;
898
- }), [ pe ]);
899
- var me = (0, t.useCallback)((function() {
900
- return Q.current;
896
+ return de(e).length;
897
+ }), [ de ]);
898
+ var be = (0, t.useCallback)((function() {
899
+ return J.current;
901
900
  }), []);
902
- var he = (0, t.useCallback)((function(e) {
903
- return Y.current[e];
901
+ var me = (0, t.useCallback)((function(e) {
902
+ return Q.current[e];
904
903
  }), []);
905
- var ge = (0, t.useCallback)((function(e, r) {
906
- if (e === le) {
907
- B.current = r;
904
+ var he = (0, t.useCallback)((function(e, r) {
905
+ if (e === ae) {
906
+ V.current = r;
908
907
  } else {
909
908
  A.current = r;
910
909
  }
911
- }), [ le ]);
910
+ }), [ ae ]);
911
+ var ge = (0, t.useCallback)((function(e) {
912
+ return e === ae ? V.current : A.current;
913
+ }), [ ae ]);
912
914
  var ke = (0, t.useCallback)((function(e) {
913
- return e === le ? B.current : A.current;
914
- }), [ le ]);
915
+ return ge(e).length;
916
+ }), [ ge ]);
915
917
  var Ce = (0, t.useCallback)((function(e) {
916
- return ke(e).length;
917
- }), [ ke ]);
918
+ var r = ke(e);
919
+ return r > 0 && r === pe(e);
920
+ }), [ ke, pe ]);
918
921
  var Re = (0, t.useCallback)((function(e) {
919
- var r = Ce(e);
920
- return r > 0 && r === be(e);
921
- }), [ Ce, be ]);
922
+ return e === ae ? T.current : z.current;
923
+ }), [ ae ]);
922
924
  var Ee = (0, t.useCallback)((function(e) {
923
- return e === le ? H.current : U.current;
924
- }), [ le ]);
925
- var Ie = (0, t.useCallback)((function(e) {
926
- var r = Ce(e);
927
- var t = be(e);
925
+ var r = ke(e);
926
+ var t = pe(e);
928
927
  return {
929
928
  disabled: r < 1 || t < 1
930
929
  };
931
- }), [ Ce, be ]);
932
- var qe = (0, t.useCallback)((function() {
933
- if (Q.current && Q.current.length > 0) {
930
+ }), [ ke, pe ]);
931
+ var Ie = (0, t.useCallback)((function() {
932
+ if (J.current && J.current.length > 0) {
934
933
  var e;
935
- Q.current = "";
936
- (e = J.current) === null || e === void 0 ? void 0 : e.call(J);
934
+ J.current = "";
935
+ (e = G.current) === null || e === void 0 ? void 0 : e.call(G);
937
936
  }
938
937
  }), []);
939
938
  var Le = (0, t.useCallback)((function() {
940
- te.current = undefined;
941
- ae.current = [];
942
- if (ne.current) {
943
- clearTimeout(ne.current);
939
+ re.current = undefined;
940
+ ne.current = [];
941
+ if (te.current) {
942
+ clearTimeout(te.current);
944
943
  }
945
944
  }), []);
946
- var Ne = (0, t.useCallback)((function(e) {
947
- J.current = e;
945
+ var qe = (0, t.useCallback)((function(e) {
946
+ G.current = e;
948
947
  }), []);
949
- var _e = (0, t.useCallback)((function(e, r) {
950
- if (r) {
951
- G.current[e] = r;
952
- } else {
953
- delete G.current[e];
954
- }
955
- }), []);
956
- var je = (0, t.useCallback)((function(e, r) {
948
+ var Ne = (0, t.useCallback)((function(e, r) {
957
949
  if (r) {
958
950
  X.current[e] = r;
959
951
  } else {
960
952
  delete X.current[e];
961
953
  }
962
954
  }), []);
963
- var Ve = (0, t.useCallback)((function(e, r) {
955
+ var _e = (0, t.useCallback)((function(e, r) {
964
956
  if (r) {
965
957
  W.current[e] = r;
966
958
  } else {
967
959
  delete W.current[e];
968
960
  }
969
961
  }), []);
970
- var Be = (0, t.useCallback)((function(e) {
962
+ var je = (0, t.useCallback)((function(e, r) {
963
+ if (r) {
964
+ U.current[e] = r;
965
+ } else {
966
+ delete U.current[e];
967
+ }
968
+ }), []);
969
+ var Ve = (0, t.useCallback)((function(e) {
971
970
  if (e) {
972
971
  var r, t;
973
- (r = (t = G.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
972
+ (r = (t = X.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
974
973
  }
975
974
  }), []);
976
- var Me = (0, t.useCallback)((function(e) {
975
+ var Be = (0, t.useCallback)((function(e) {
977
976
  if (e) {
978
977
  var r, t;
979
- (r = (t = X.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
978
+ (r = (t = W.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
980
979
  }
981
980
  }), []);
982
981
  var De = (0, t.useCallback)((function(e) {
983
982
  if (e) {
984
983
  var r, t;
985
- (r = (t = W.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
984
+ (r = (t = U.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
986
985
  }
987
986
  }), []);
988
- var Te = (0, t.useCallback)((function(e) {
989
- qe();
990
- Me(e);
987
+ var Me = (0, t.useCallback)((function(e) {
988
+ Ie();
989
+ Be(e);
990
+ De(ae);
991
991
  De(le);
992
- De(ie);
993
- }), [ qe, De, Me, le, ie ]);
994
- var He = (0, t.useCallback)((function(e, r) {
992
+ }), [ Ie, De, Be, ae, le ]);
993
+ var Te = (0, t.useCallback)((function(e, r) {
995
994
  var t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
996
- var n = e === le ? T.current : z.current;
995
+ var n = e === ae ? M.current : $.current;
997
996
  if (!n) {
998
997
  return;
999
998
  }
1000
- var a = fe(e);
1001
- ve(e, r);
999
+ var a = ve(e);
1000
+ se(e, r);
1002
1001
  if (!t) {
1003
1002
  // render new
1004
- Be(r);
1003
+ Ve(r);
1005
1004
  }
1006
1005
  if (r !== a) {
1007
1006
  if (!t) {
1008
1007
  // render previous
1009
- Be(a);
1008
+ Ve(a);
1010
1009
  }
1011
- var l = r ? Z.current[r] : "";
1010
+ var l = r ? Y.current[r] : "";
1012
1011
  // update listbox via dom to avoid render + child render
1013
1012
  n.setAttribute("aria-activedescendant", l);
1014
1013
  if (!t && l.length > 0) {
1015
1014
  var i = n.querySelector("#".concat(l));
1016
- O(i);
1015
+ x(i);
1017
1016
  }
1018
1017
  }
1019
- }), [ fe, ve, Be, le ]);
1018
+ }), [ ve, se, Ve, ae ]);
1020
1019
  var Ae = (0, t.useCallback)((function(e, r) {
1021
1020
  var t = r.value, n = r.name;
1022
- var a = Re(n) ? ke(n) : pe(n);
1023
- var l = S(a, t);
1024
- if (!V.current) {
1025
- Y.current[t] = !Y.current[t];
1026
- de(n, l);
1027
- Te(n);
1021
+ var a = Ce(n) ? ge(n) : de(n);
1022
+ var l = C(a, t);
1023
+ if (!j.current) {
1024
+ Q.current[t] = !Q.current[t];
1025
+ fe(n, l);
1026
+ Me(n);
1028
1027
  }
1029
- He(n, t);
1028
+ Te(n, t);
1030
1029
  e.preventDefault();
1031
1030
  L === null || L === void 0 ? void 0 : L(e, {
1032
1031
  values: l,
1033
1032
  listName: n
1034
1033
  });
1035
- }), [ Re, pe, ke, de, He, Te, L ]);
1036
- var Ke = (0, t.useCallback)((function(e, r) {
1034
+ }), [ Ce, de, ge, fe, Te, Me, L ]);
1035
+ var He = (0, t.useCallback)((function(e, r) {
1037
1036
  var t = r.initialIndex, n = r.name, a = r.targetIndex;
1038
- var l = ke(n);
1037
+ var l = ge(n);
1039
1038
  var i = Math.min(t, a);
1040
- var u = Math.max(t, a);
1041
- var o = [];
1042
- if (V.current) {
1043
- o = l.slice(i, u + 1);
1039
+ var o = Math.max(t, a);
1040
+ var u = [];
1041
+ if (j.current) {
1042
+ u = l.slice(i, o + 1);
1044
1043
  } else {
1045
1044
  l.forEach((function(e, r) {
1046
1045
  var t = false;
1047
- if (r >= i && r <= u) {
1046
+ if (r >= i && r <= o) {
1048
1047
  t = true;
1049
- o.push(e);
1048
+ u.push(e);
1050
1049
  } else {
1051
1050
  t = false;
1052
1051
  }
1053
- if (Y.current[e] !== t) {
1054
- Y.current[e] = t;
1055
- Be(e);
1052
+ if (Q.current[e] !== t) {
1053
+ Q.current[e] = t;
1054
+ Ve(e);
1056
1055
  }
1057
1056
  }));
1058
- de(n, o);
1059
- Te(n);
1057
+ fe(n, u);
1058
+ Me(n);
1060
1059
  }
1061
- He(n, l[a]);
1060
+ Te(n, l[a]);
1062
1061
  e.preventDefault();
1063
1062
  e.stopPropagation();
1064
1063
  L === null || L === void 0 ? void 0 : L(e, {
1065
- values: o,
1064
+ values: u,
1066
1065
  listName: n
1067
1066
  });
1068
- }), [ ke, L, de, He, Te, Be ]);
1069
- var Fe = (0, t.useCallback)((function(e, r) {
1067
+ }), [ ge, L, fe, Te, Me, Ve ]);
1068
+ var Ke = (0, t.useCallback)((function(e, r) {
1070
1069
  var t = r.name, n = r.selected;
1071
- var a = ke(t);
1070
+ var a = ge(t);
1072
1071
  var l = n === true ? [] : a;
1073
1072
  var i = n !== true;
1074
- if (!V.current) {
1073
+ if (!j.current) {
1075
1074
  a === null || a === void 0 ? void 0 : a.forEach((function(e) {
1076
- if (Y.current[e] !== i) {
1077
- Y.current[e] = i;
1078
- Be(e);
1075
+ if (Q.current[e] !== i) {
1076
+ Q.current[e] = i;
1077
+ Ve(e);
1079
1078
  }
1080
1079
  }));
1081
- de(t, l);
1082
- Te(t);
1080
+ fe(t, l);
1081
+ Me(t);
1083
1082
  }
1084
1083
  e.preventDefault();
1085
1084
  L === null || L === void 0 ? void 0 : L(e, {
1086
1085
  values: l,
1087
1086
  listName: t
1088
1087
  });
1089
- }), [ ke, L, de, Te, Be ]);
1088
+ }), [ ge, L, fe, Me, Ve ]);
1090
1089
  // handleMoveValues does not update the active value of the source, keyboard and mouse differ, only the target active value is updated
1091
- var $e = (0, t.useCallback)((function(e, r, t) {
1092
- var n = ke(r);
1093
- var a = pe(r);
1094
- var l = Re(r);
1095
- var u = ke(t);
1096
- var o = fe(t);
1090
+ var Fe = (0, t.useCallback)((function(e, r, t) {
1091
+ var n = ge(r);
1092
+ var a = de(r);
1093
+ var l = Ce(r);
1094
+ var o = ge(t);
1095
+ var u = ve(t);
1097
1096
  if (n.length === 0 || !l && a.length === 0) {
1098
1097
  return;
1099
1098
  }
1100
- if (!o && a.length > 0) {
1099
+ if (!u && a.length > 0) {
1101
1100
  // target lacks an active value, default to the first
1102
1101
  // skip the render it will be catch in batch
1103
- He(t, a[0], true);
1102
+ Te(t, a[0], true);
1104
1103
  }
1105
- var c = (0, f.sprintf)((0, i._)("Moved %(count)d items to %(listLabel)s list"), {
1104
+ var c = (0, v.sprintf)((0, i._)("Moved %(count)d items to %(listLabel)s list"), {
1106
1105
  count: a.length,
1107
- listLabel: t === le ? ue : oe
1106
+ listLabel: t === ae ? ie : oe
1108
1107
  });
1109
1108
  // These new values do not perserve sort position, may need to be refactored with sort logic (SUI-5270).
1110
- var s = l ? [] : w(n, a);
1111
- var v = u.concat(a);
1112
- if (!V.current) {
1109
+ var s = l ? [] : S(n, a);
1110
+ var f = o.concat(a);
1111
+ if (!j.current) {
1113
1112
  a.forEach((function(e) {
1114
- Y.current[e] = false;
1113
+ Q.current[e] = false;
1115
1114
  }));
1116
- ge(t, v);
1117
- ge(r, s);
1118
- de(r, []);
1119
- Q.current = c;
1115
+ he(t, f);
1116
+ he(r, s);
1117
+ fe(r, []);
1118
+ J.current = c;
1120
1119
  // move is a batch update, force a full render, no internal update needed
1121
- _();
1120
+ N();
1122
1121
  }
1123
1122
  var d = {
1124
1123
  affectedValues: a,
1125
1124
  sourceListName: r || "",
1126
1125
  sourceValues: s,
1127
1126
  targetListName: t || "",
1128
- targetValues: v,
1127
+ targetValues: f,
1129
1128
  screenReaderMessage: c || "",
1130
1129
  values: a.slice()
1131
1130
  };
1132
1131
  e.preventDefault();
1133
- I === null || I === void 0 ? void 0 : I(e, d);
1134
- }), [ _, fe, Re, pe, ke, I, de, ge, He, le, ue, oe ]);
1135
- var ze = (0, t.useCallback)((function(e, r) {
1132
+ E === null || E === void 0 ? void 0 : E(e, d);
1133
+ }), [ N, ve, Ce, de, ge, E, fe, he, Te, ae, ie, oe ]);
1134
+ var $e = (0, t.useCallback)((function(e, r) {
1136
1135
  var t = r.name;
1137
- var n = Re(t);
1138
- var a = fe(t);
1139
- var l = t === le ? ie : le;
1140
- if (a && (n || !!Y.current[a])) {
1136
+ var n = Ce(t);
1137
+ var a = ve(t);
1138
+ var l = t === ae ? le : ae;
1139
+ if (a && (n || !!Q.current[a])) {
1141
1140
  // active option was present in items to be removed, clear the active option
1142
- He(t);
1141
+ Te(t);
1143
1142
  }
1144
- $e(e, t, l);
1145
- }), [ fe, Re, $e, He, le, ie ]);
1146
- var Ue = (0, t.useCallback)((function(e, r) {
1143
+ Fe(e, t, l);
1144
+ }), [ ve, Ce, Fe, Te, ae, le ]);
1145
+ var ze = (0, t.useCallback)((function(e, r) {
1147
1146
  var t = r.name, n = r.value;
1148
1147
  if (e.nativeEvent.shiftKey) {
1149
- Ke(e, {
1150
- targetIndex: ee.current[n],
1151
- initialIndex: re.current,
1148
+ He(e, {
1149
+ targetIndex: Z.current[n],
1150
+ initialIndex: ee.current,
1152
1151
  name: t
1153
1152
  });
1154
1153
  } else {
@@ -1157,13 +1156,13 @@
1157
1156
  value: n
1158
1157
  });
1159
1158
  }
1160
- }), [ Ke, Ae ]);
1159
+ }), [ He, Ae ]);
1160
+ var Ue = (0, t.useCallback)((function(e, r) {
1161
+ Ke(e, r);
1162
+ }), [ Ke ]);
1161
1163
  var We = (0, t.useCallback)((function(e, r) {
1162
- Fe(e, r);
1163
- }), [ Fe ]);
1164
- var Xe = (0, t.useCallback)((function(e, r) {
1165
1164
  var t = e.nativeEvent.key;
1166
- var n = Ee(r);
1165
+ var n = Re(r);
1167
1166
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1168
1167
  if (t.length === 1) {
1169
1168
  var a = [];
@@ -1171,247 +1170,247 @@
1171
1170
  index: 0,
1172
1171
  value: t
1173
1172
  };
1174
- if (!te.current) {
1173
+ if (!re.current) {
1175
1174
  if (t === " ") {
1176
1175
  Le();
1177
1176
  return;
1178
1177
  }
1179
- a = E(n, l);
1180
- } else if (ae.current.length > 1) {
1181
- l.index = te.current.index + 1;
1182
- a = E(ae.current, l);
1178
+ a = R(n, l);
1179
+ } else if (ne.current.length > 1) {
1180
+ l.index = re.current.index + 1;
1181
+ a = R(ne.current, l);
1183
1182
  }
1184
1183
  if (a.length) {
1185
1184
  var i = 0;
1186
1185
  // If the active option is a first character match, cycle to the next matching option.
1187
1186
  if (l.index === 0 && a.length > 1) {
1188
- var u = fe(r);
1189
- if (u) {
1190
- var o = a.findIndex((function(e) {
1191
- return e.value === u;
1187
+ var o = ve(r);
1188
+ if (o) {
1189
+ var u = a.findIndex((function(e) {
1190
+ return e.value === o;
1192
1191
  }));
1193
- if (o >= 0) {
1194
- i = o === a.length - 1 ? 0 : o + 1;
1192
+ if (u >= 0) {
1193
+ i = u === a.length - 1 ? 0 : u + 1;
1195
1194
  }
1196
1195
  }
1197
1196
  }
1198
- He(r, a[i].value);
1197
+ Te(r, a[i].value);
1199
1198
  }
1200
- ae.current = a;
1201
- te.current = l;
1202
- if (ne.current) {
1203
- clearTimeout(ne.current);
1199
+ ne.current = a;
1200
+ re.current = l;
1201
+ if (te.current) {
1202
+ clearTimeout(te.current);
1204
1203
  }
1205
- ne.current = setTimeout(Le, 500);
1204
+ te.current = setTimeout(Le, 500);
1206
1205
  e.preventDefault();
1207
1206
  e.stopPropagation();
1208
1207
  }
1209
- }), [ fe, Ee, Le, He ]);
1210
- var Ge = (0, t.useCallback)((function(e, r) {
1208
+ }), [ ve, Re, Le, Te ]);
1209
+ var Xe = (0, t.useCallback)((function(e, r) {
1211
1210
  var t = r.name;
1212
- var n = (0, u.keycode)(e.nativeEvent);
1213
- var a = ke(t);
1214
- var l = pe(t);
1215
- var i = Re(t);
1216
- var o = fe(t);
1217
- var c = o ? ee.current[o] : -1;
1218
- var s = re.current >= 0 ? re.current : 0;
1219
- if (Q.current && Q.current.length > 0) {
1220
- qe();
1211
+ var n = e.ctrlKey, a = e.key, l = e.metaKey, i = e.shiftKey;
1212
+ var o = ge(t);
1213
+ var u = de(t);
1214
+ var c = Ce(t);
1215
+ var s = ve(t);
1216
+ var v = s ? Z.current[s] : -1;
1217
+ var f = ee.current >= 0 ? ee.current : 0;
1218
+ if (J.current && J.current.length > 0) {
1219
+ Ie();
1221
1220
  }
1222
- var v = o;
1223
- switch (n) {
1224
- case "shift":
1225
- re.current = c;
1221
+ var d = s;
1222
+ switch (a) {
1223
+ case "Shift":
1224
+ ee.current = v;
1226
1225
  break;
1227
1226
 
1228
- case "home":
1229
- if (e.nativeEvent.ctrlKey && e.nativeEvent.shiftKey) {
1227
+ case "Home":
1228
+ if (n && i) {
1230
1229
  // handle select until start
1231
- Ke(e, {
1230
+ He(e, {
1232
1231
  targetIndex: 0,
1233
- initialIndex: s,
1232
+ initialIndex: f,
1234
1233
  name: t
1235
1234
  });
1236
1235
  } else {
1237
- var f = Oe(a, 1);
1238
- v = f[0];
1236
+ var p = Oe(o, 1);
1237
+ d = p[0];
1239
1238
  }
1240
1239
  break;
1241
1240
 
1242
- case "end":
1243
- if (e.nativeEvent.ctrlKey && e.nativeEvent.shiftKey) {
1241
+ case "End":
1242
+ if (n && i) {
1244
1243
  // handle select until end
1245
- Ke(e, {
1246
- targetIndex: a.length - 1,
1247
- initialIndex: s,
1244
+ He(e, {
1245
+ targetIndex: o.length - 1,
1246
+ initialIndex: f,
1248
1247
  name: t
1249
1248
  });
1250
1249
  } else {
1251
- v = a[a.length - 1];
1250
+ d = o[o.length - 1];
1252
1251
  }
1253
1252
  break;
1254
1253
 
1255
- case "up":
1256
- if (e.nativeEvent.shiftKey) {
1254
+ case "ArrowUp":
1255
+ if (i) {
1257
1256
  // handle select until previous
1258
- Ke(e, {
1259
- targetIndex: Math.max(c - 1, 0),
1260
- initialIndex: s,
1257
+ He(e, {
1258
+ targetIndex: Math.max(v - 1, 0),
1259
+ initialIndex: f,
1261
1260
  name: t
1262
1261
  });
1263
1262
  } else {
1264
- v = a[Math.max(c - 1, 0)];
1263
+ d = o[Math.max(v - 1, 0)];
1265
1264
  }
1266
1265
  break;
1267
1266
 
1268
- case "down":
1269
- if (e.nativeEvent.shiftKey) {
1267
+ case "ArrowDown":
1268
+ if (i) {
1270
1269
  // handle select until next
1271
- Ke(e, {
1272
- targetIndex: Math.min(c + 1, a.length - 1),
1273
- initialIndex: s,
1270
+ He(e, {
1271
+ targetIndex: Math.min(v + 1, o.length - 1),
1272
+ initialIndex: f,
1274
1273
  name: t
1275
1274
  });
1276
1275
  } else {
1277
- v = a[Math.min(c + 1, a.length - 1)];
1276
+ d = o[Math.min(v + 1, o.length - 1)];
1278
1277
  }
1279
1278
  break;
1280
1279
 
1281
- case "space":
1282
- if (o != null) {
1280
+ case " ":
1281
+ if (s != null) {
1283
1282
  Ae(e, {
1284
1283
  name: t,
1285
- value: o
1284
+ value: s
1286
1285
  });
1287
1286
  }
1288
1287
  break;
1289
1288
 
1290
- case "enter":
1291
- if (t === le) {
1292
- if (i) {
1289
+ case "Enter":
1290
+ if (t === ae) {
1291
+ if (c) {
1293
1292
  // all values moved, no longer an active value
1294
- v = undefined;
1295
- } else if (l.length > 0) {
1293
+ d = undefined;
1294
+ } else if (u.length > 0) {
1296
1295
  // somes values moved, determine next active value
1297
- v = x(c, a, l);
1296
+ d = w(v, o, u);
1298
1297
  }
1299
- $e(e, le, ie);
1298
+ Fe(e, ae, le);
1300
1299
  }
1301
1300
  break;
1302
1301
 
1303
- case "delete":
1304
- if (t === ie) {
1305
- if (i) {
1302
+ case "Delete":
1303
+ if (t === le) {
1304
+ if (c) {
1306
1305
  // all values moved, no longer an active value
1307
- v = undefined;
1308
- } else if (l.length > 0) {
1306
+ d = undefined;
1307
+ } else if (u.length > 0) {
1309
1308
  // somes values moved, determine next active value
1310
- v = x(c, a, l);
1309
+ d = w(v, o, u);
1311
1310
  }
1312
- $e(e, ie, le);
1311
+ Fe(e, le, ae);
1313
1312
  }
1314
1313
  break;
1315
1314
 
1316
1315
  default:
1317
- if (n === "a" && (e.nativeEvent.ctrlKey || e.nativeEvent.metaKey)) {
1316
+ if (a === "a" && (n || l)) {
1318
1317
  // handle control + A, otherwise let 'a' passthrough
1319
- Fe(e, {
1318
+ Ke(e, {
1320
1319
  name: t,
1321
- selected: i
1320
+ selected: c
1322
1321
  });
1323
1322
  } else {
1324
1323
  // do fuzzy match
1325
- Xe(e, t);
1324
+ We(e, t);
1326
1325
  }
1327
1326
  break;
1328
1327
  }
1329
- if (v !== o) {
1328
+ if (d !== s) {
1330
1329
  e.preventDefault();
1331
- He(t, v);
1330
+ Te(t, d);
1332
1331
  }
1333
- }), [ qe, fe, Re, pe, ke, Xe, $e, Ke, Ae, Fe, He, le, ie ]);
1334
- var Je = (0, t.useMemo)((function() {
1332
+ }), [ Ie, ve, Ce, de, ge, We, Fe, He, Ae, Ke, Te, ae, le ]);
1333
+ var Ge = (0, t.useMemo)((function() {
1335
1334
  return {
1336
- onButtonClick: ze,
1337
- updateButtonRefreshHookByName: Ve,
1338
- getButtonState: Ie
1335
+ onButtonClick: $e,
1336
+ updateButtonRefreshHookByName: je,
1337
+ getButtonState: Ee
1339
1338
  };
1340
- }), [ ze, Ve, Ie ]);
1341
- var Qe = (0, t.useMemo)((function() {
1339
+ }), [ $e, je, Ee ]);
1340
+ var Je = (0, t.useMemo)((function() {
1342
1341
  return {
1343
- controlled: V.current,
1344
- getActiveValue: fe,
1345
- getScreenReaderMessage: me,
1346
- getSelectedStateForValue: he,
1347
- getSelectedValueCount: be,
1348
- getValueCount: Ce,
1349
- updateLabelRefreshHookByName: je,
1350
- updateOptionRefreshHookByValue: _e,
1351
- updateScreenReaderRefreshHook: Ne
1342
+ controlled: j.current,
1343
+ getActiveValue: ve,
1344
+ getScreenReaderMessage: be,
1345
+ getSelectedStateForValue: me,
1346
+ getSelectedValueCount: pe,
1347
+ getValueCount: ke,
1348
+ updateLabelRefreshHookByName: _e,
1349
+ updateOptionRefreshHookByValue: Ne,
1350
+ updateScreenReaderRefreshHook: qe
1352
1351
  };
1353
- }), [ fe, me, he, be, Ce, je, _e, Ne ]);
1354
- if (V.current && !se[0].activeFound) {
1352
+ }), [ ve, be, me, pe, ke, _e, Ne, qe ]);
1353
+ if (j.current && !ce[0].activeFound) {
1355
1354
  // listOne active value wasn't found, likely the result of a controlled state reset
1356
1355
  // update interal values, skip the render it will be caught in batch
1357
- He(le, undefined, true);
1356
+ Te(ae, undefined, true);
1358
1357
  }
1359
- if (V.current && !se[1].activeFound) {
1358
+ if (j.current && !ce[1].activeFound) {
1360
1359
  // listTwo active value wasn't found, likely the result of a controlled state reset
1361
1360
  // update interal values, skip the render it will be caught in batch
1362
- He(ie, undefined, true);
1361
+ Te(le, undefined, true);
1363
1362
  }
1364
1363
 
1365
1364
  return n().createElement(Se, xe({
1366
1365
  "data-test": "dual-listbox",
1367
- elementRef: m,
1368
- $inline: y ? false : R,
1369
- $fill: y
1370
- }, N), n().createElement(g.Provider, {
1371
- value: Qe
1366
+ elementRef: b,
1367
+ $inline: g ? false : O,
1368
+ $fill: g
1369
+ }, P), n().createElement(h.Provider, {
1370
+ value: Je
1372
1371
  }, n().createElement(ye, {
1373
1372
  index: 0,
1374
- elementRef: T,
1375
- label: ue,
1376
- name: le,
1377
- onClick: Ue,
1378
- onKeyDown: Ge,
1379
- onSelectAllClick: We
1380
- }, se[0].options), n().createElement(we, null, n().createElement(q.Provider, {
1381
- value: Je
1382
- }, n().createElement($, {
1383
- ariaLabel: (0, f.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1373
+ elementRef: M,
1374
+ label: ie,
1375
+ name: ae,
1376
+ onClick: ze,
1377
+ onKeyDown: Xe,
1378
+ onSelectAllClick: Ue
1379
+ }, ce[0].options), n().createElement(we, null, n().createElement(I.Provider, {
1380
+ value: Ge
1381
+ }, n().createElement(F, {
1382
+ ariaLabel: (0, v.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1384
1383
  listLabel: oe
1385
1384
  }),
1386
1385
  ariaKeyShortcuts: "Enter",
1387
1386
  "data-test": "move-to-secondary",
1388
- icon: n().createElement(v(), null),
1389
- name: le,
1390
- tooltipLabel: (0, f.sprintf)((0, i._)("Move to %(listLabel)s"), {
1387
+ icon: n().createElement(s(), null),
1388
+ name: ae,
1389
+ tooltipLabel: (0, v.sprintf)((0, i._)("Move to %(listLabel)s"), {
1391
1390
  listLabel: oe
1392
1391
  }),
1393
1392
  tooltipPlacement: "left"
1394
- }), n().createElement($, {
1395
- ariaLabel: (0, f.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1396
- listLabel: ue
1393
+ }), n().createElement(F, {
1394
+ ariaLabel: (0, v.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1395
+ listLabel: ie
1397
1396
  }),
1398
1397
  ariaKeyShortcuts: "Delete",
1399
1398
  "data-test": "move-to-primary",
1400
- icon: n().createElement(c(), null),
1401
- name: ie,
1402
- tooltipLabel: (0, f.sprintf)((0, i._)("Move to %(listLabel)s"), {
1403
- listLabel: ue
1399
+ icon: n().createElement(u(), null),
1400
+ name: le,
1401
+ tooltipLabel: (0, v.sprintf)((0, i._)("Move to %(listLabel)s"), {
1402
+ listLabel: ie
1404
1403
  }),
1405
1404
  tooltipPlacement: "right"
1406
1405
  }))), n().createElement(ye, {
1407
1406
  index: 1,
1408
- elementRef: z,
1407
+ elementRef: $,
1409
1408
  label: oe,
1410
- name: ie,
1411
- onClick: Ue,
1412
- onKeyDown: Ge,
1413
- onSelectAllClick: We
1414
- }, se[1].options), n().createElement(C, null)));
1409
+ name: le,
1410
+ onClick: ze,
1411
+ onKeyDown: Xe,
1412
+ onSelectAllClick: Ue
1413
+ }, ce[1].options), n().createElement(k, null)));
1415
1414
  }
1416
1415
  je.propTypes = _e;
1417
1416
  je.Option = ne;