@splunk/react-ui 5.7.1 → 5.9.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/Accordion.js +6 -6
- package/Anchor.js +2 -1
- package/Box.js +83 -34
- package/CHANGELOG.md +51 -0
- package/Calendar.js +134 -134
- package/Clickable.js +131 -94
- package/CollapsiblePanel.js +175 -137
- package/ComboBox.js +32 -27
- package/ControlGroup.js +92 -91
- package/DefinitionList.js +9 -9
- package/Drawer.d.ts +2 -0
- package/Drawer.js +679 -0
- package/Dropdown.js +27 -18
- package/DualListbox.js +1 -1
- package/File.js +35 -35
- package/JSONTree.js +73 -72
- package/Link.js +2 -2
- package/MIGRATION.md +10 -0
- package/Menu.js +403 -261
- package/Modal.js +263 -252
- package/Monogram.js +2 -2
- package/Multiselect.js +551 -385
- package/Number.js +2 -1
- package/Paginator.js +14 -12
- package/Popover.js +4 -1
- package/README.md +11 -0
- package/RadioBar.js +1 -1
- package/Search.js +111 -95
- package/Select.js +42 -40
- package/SelectBase.js +819 -715
- package/SidePanel.js +346 -167
- package/SlidingPanels.js +11 -11
- package/StepBar.js +7 -7
- package/Switch.js +5 -5
- package/Table.js +116 -119
- package/Text.js +48 -48
- package/TextArea.js +7 -7
- package/TransitionOpen.js +188 -169
- package/docs-llm/Accordion.md +267 -0
- package/docs-llm/Anchor Menu.md +115 -0
- package/docs-llm/Anchor.md +54 -0
- package/docs-llm/AnimationToggle.md +254 -0
- package/docs-llm/Avatar.md +292 -0
- package/docs-llm/Badge.md +212 -0
- package/docs-llm/Breadcrumbs.md +306 -0
- package/docs-llm/Button Group.md +53 -0
- package/docs-llm/Button.md +361 -0
- package/docs-llm/Card Layout.md +286 -0
- package/docs-llm/Card.md +619 -0
- package/docs-llm/Checkbox.md +218 -0
- package/docs-llm/Chip.md +291 -0
- package/docs-llm/Clickable.md +160 -0
- package/docs-llm/Code.md +292 -0
- package/docs-llm/Collapsible Panel.md +744 -0
- package/docs-llm/Color.md +253 -0
- package/docs-llm/Column Layout.md +391 -0
- package/docs-llm/Combo Box.md +540 -0
- package/docs-llm/Control Group.md +594 -0
- package/docs-llm/Date.md +270 -0
- package/docs-llm/Definition List.md +278 -0
- package/docs-llm/Divider.md +216 -0
- package/docs-llm/Drawer.md +414 -0
- package/docs-llm/Dropdown.md +472 -0
- package/docs-llm/Dual Listbox.md +325 -0
- package/docs-llm/File.md +653 -0
- package/docs-llm/Form Rows.md +374 -0
- package/docs-llm/Heading.md +179 -0
- package/docs-llm/Image.md +109 -0
- package/docs-llm/JSON Tree.md +260 -0
- package/docs-llm/Layer.md +74 -0
- package/docs-llm/Layout.md +50 -0
- package/docs-llm/Link.md +318 -0
- package/docs-llm/List.md +189 -0
- package/docs-llm/Markdown.md +179 -0
- package/docs-llm/Menu.md +735 -0
- package/docs-llm/Message Bar.md +236 -0
- package/docs-llm/Message.md +248 -0
- package/docs-llm/Modal.md +443 -0
- package/docs-llm/Monogram.md +159 -0
- package/docs-llm/Multiselect.md +939 -0
- package/docs-llm/Notifications.md +46 -0
- package/docs-llm/Number.md +298 -0
- package/docs-llm/Paginator.md +395 -0
- package/docs-llm/Paragraph.md +148 -0
- package/docs-llm/Phone Number.md +254 -0
- package/docs-llm/Popover.md +166 -0
- package/docs-llm/Progress.md +141 -0
- package/docs-llm/Radio Bar.md +303 -0
- package/docs-llm/Radio List.md +350 -0
- package/docs-llm/Resize.md +362 -0
- package/docs-llm/Screen Reader Content.md +73 -0
- package/docs-llm/Scroll Container Context.md +155 -0
- package/docs-llm/Scroll.md +152 -0
- package/docs-llm/Search.md +381 -0
- package/docs-llm/Select.md +985 -0
- package/docs-llm/Side Panel.md +777 -0
- package/docs-llm/Slider.md +339 -0
- package/docs-llm/Sliding Panels.md +340 -0
- package/docs-llm/Split Button.md +295 -0
- package/docs-llm/Static Content.md +90 -0
- package/docs-llm/Step Bar.md +292 -0
- package/docs-llm/Switch.md +268 -0
- package/docs-llm/Tab Bar.md +439 -0
- package/docs-llm/Tab Layout.md +398 -0
- package/docs-llm/Table.md +2642 -0
- package/docs-llm/Text Area.md +253 -0
- package/docs-llm/Text.md +339 -0
- package/docs-llm/Tooltip.md +325 -0
- package/docs-llm/Transition Open.md +406 -0
- package/docs-llm/Tree.md +591 -0
- package/docs-llm/Typography.md +125 -0
- package/docs-llm/Wait Spinner.md +121 -0
- package/docs-llm/llms.txt +101 -0
- package/package.json +6 -5
- package/types/src/Box/Box.d.ts +2 -10
- package/types/src/Drawer/Body.d.ts +17 -0
- package/types/src/Drawer/Drawer.d.ts +114 -0
- package/types/src/Drawer/DrawerContext.d.ts +11 -0
- package/types/src/Drawer/Footer.d.ts +25 -0
- package/types/src/Drawer/Header.d.ts +41 -0
- package/types/src/Drawer/docs/examples/Basic.d.ts +6 -0
- package/types/src/Drawer/docs/examples/ContainerPosition.d.ts +7 -0
- package/types/src/Drawer/docs/examples/InitialFocus.d.ts +9 -0
- package/types/src/Drawer/docs/examples/InlinePosition.d.ts +7 -0
- package/types/src/Drawer/docs/examples/PagePosition.d.ts +7 -0
- package/types/src/Drawer/index.d.ts +2 -0
- package/types/src/JSONTree/JSONTree.d.ts +12 -5
- package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
- package/types/src/Menu/Item.d.ts +2 -1
- package/types/src/Menu/docs/examples/SelectableCheckbox.d.ts +7 -0
- package/types/src/Modal/Modal.d.ts +1 -2
- package/types/src/Multiselect/Compact.d.ts +8 -3
- package/types/src/Multiselect/Multiselect.d.ts +8 -3
- package/types/src/Multiselect/Normal.d.ts +8 -3
- package/types/src/Multiselect/Option.d.ts +6 -3
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +1 -0
- package/types/src/Select/Option.d.ts +6 -3
- package/types/src/Select/Select.d.ts +8 -5
- package/types/src/Select/docs/examples/Dimmed.d.ts +7 -0
- package/types/src/SelectBase/OptionBase.d.ts +6 -3
- package/types/src/SelectBase/SelectBase.d.ts +8 -3
- package/types/src/SidePanel/SidePanel.d.ts +43 -2
- package/types/src/SidePanel/docs/examples/DockLayout.d.ts +17 -0
- package/types/src/SidePanel/docs/examples/InitialFocus.d.ts +9 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +29 -4
- package/types/src/useKeyPress/index.d.ts +9 -2
- package/types/src/useOnClickOutside/index.d.ts +2 -0
- package/types/src/useOnClickOutside/useOnClickOutside.d.ts +4 -0
- package/useKeyPress.js +23 -18
- package/useOnClickOutside.d.ts +2 -0
- package/useOnClickOutside.js +79 -0
- package/types/src/RadioList/docs/examples/Row.d.ts +0 -6
package/SelectBase.js
CHANGED
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
11
|
/******/ e.n = r => {
|
|
12
|
-
/******/ var
|
|
12
|
+
/******/ var n = r && r.__esModule ?
|
|
13
13
|
/******/ () => r["default"]
|
|
14
14
|
/******/ : () => r
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(n, {
|
|
17
|
+
a: n
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return n;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (r,
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(r,
|
|
26
|
+
/******/ e.d = (r, n) => {
|
|
27
|
+
/******/ for (var t in n) {
|
|
28
|
+
/******/ if (e.o(n, t) && !e.o(r, t)) {
|
|
29
|
+
/******/ Object.defineProperty(r, t, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: t
|
|
31
|
+
get: n[t]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -61,23 +61,23 @@
|
|
|
61
61
|
e.r(r);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(r, {
|
|
64
|
-
Controls: () => /* reexport */
|
|
64
|
+
Controls: () => /* reexport */ dr,
|
|
65
65
|
Divider: () => /* reexport */ w.Divider,
|
|
66
66
|
Heading: () => /* reexport */ w.Heading,
|
|
67
|
-
Option: () => /* reexport */
|
|
67
|
+
Option: () => /* reexport */ J,
|
|
68
68
|
SelectAllOption: () => /* reexport */ oe,
|
|
69
|
-
default: () => /* reexport */
|
|
70
|
-
isOption: () => /* reexport */
|
|
69
|
+
default: () => /* reexport */ gr,
|
|
70
|
+
isOption: () => /* reexport */ lr
|
|
71
71
|
});
|
|
72
72
|
// CONCATENATED MODULE: external "react"
|
|
73
|
-
const
|
|
74
|
-
var
|
|
73
|
+
const n = require("react");
|
|
74
|
+
var t = e.n(n);
|
|
75
75
|
// CONCATENATED MODULE: external "lodash/castArray"
|
|
76
76
|
const l = require("lodash/castArray");
|
|
77
77
|
var a = e.n(l);
|
|
78
78
|
// CONCATENATED MODULE: external "lodash/has"
|
|
79
|
-
const
|
|
80
|
-
var
|
|
79
|
+
const i = require("lodash/has");
|
|
80
|
+
var o = e.n(i);
|
|
81
81
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
82
82
|
const u = require("lodash/memoize");
|
|
83
83
|
var c = e.n(u);
|
|
@@ -108,114 +108,156 @@
|
|
|
108
108
|
const x = require("@splunk/react-ui/ScreenReaderContent");
|
|
109
109
|
var j = e.n(x);
|
|
110
110
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
111
|
-
const
|
|
112
|
-
var
|
|
111
|
+
const E = require("@splunk/react-ui/Text");
|
|
112
|
+
var P = e.n(E);
|
|
113
113
|
// CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
|
|
114
114
|
const A = require("@splunk/react-ui/useControlled");
|
|
115
115
|
var L = e.n(A);
|
|
116
116
|
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
117
117
|
const I = require("@splunk/react-ui/usePrevious");
|
|
118
|
-
var
|
|
118
|
+
var D = e.n(I);
|
|
119
119
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
120
|
-
const
|
|
120
|
+
const R = require("@splunk/ui-utils/filter");
|
|
121
121
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
122
|
-
const
|
|
122
|
+
const M = require("@splunk/ui-utils/i18n");
|
|
123
123
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
124
124
|
const T = require("@splunk/ui-utils/id");
|
|
125
125
|
// CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
|
|
126
|
-
const
|
|
127
|
-
// CONCATENATED MODULE: ./src/
|
|
126
|
+
const q = require("@splunk/ui-utils/scroll");
|
|
127
|
+
// CONCATENATED MODULE: ./src/utils/disabled.ts
|
|
128
|
+
/**
|
|
129
|
+
* Normalizes the disabled prop and returns both the boolean state and normalized string value.
|
|
130
|
+
* Use this function to ensure consistent handling of disabled prop across components.
|
|
131
|
+
*
|
|
132
|
+
* @param disabled - The disabled prop value
|
|
133
|
+
* @param defaultWhenBooleanTrue - Optional normalization override for disabled={true}
|
|
134
|
+
* @returns Object with isDisabled boolean|undefined and disabledValue string
|
|
135
|
+
*
|
|
136
|
+
* TODO (SUI-8600): `disabled` prop should default to 'dimmed' for data entry components
|
|
137
|
+
*/
|
|
128
138
|
function _(e) {
|
|
139
|
+
var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "dimmed";
|
|
140
|
+
if (e === "dimmed") {
|
|
141
|
+
return {
|
|
142
|
+
isDisabled: true,
|
|
143
|
+
disabledValue: "dimmed"
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (e === true) {
|
|
147
|
+
return {
|
|
148
|
+
isDisabled: true,
|
|
149
|
+
disabledValue: r
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (e === "disabled") {
|
|
153
|
+
return {
|
|
154
|
+
isDisabled: true,
|
|
155
|
+
disabledValue: "disabled"
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (e === false) {
|
|
159
|
+
return {
|
|
160
|
+
isDisabled: false,
|
|
161
|
+
disabledValue: undefined
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
isDisabled: undefined,
|
|
166
|
+
disabledValue: undefined
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
// CONCATENATED MODULE: ./src/SelectBase/OptionBase.tsx
|
|
170
|
+
function B(e) {
|
|
129
171
|
"@babel/helpers - typeof";
|
|
130
|
-
return
|
|
172
|
+
return B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
131
173
|
return typeof e;
|
|
132
174
|
} : function(e) {
|
|
133
175
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
134
|
-
},
|
|
176
|
+
}, B(e);
|
|
135
177
|
}
|
|
136
|
-
function
|
|
137
|
-
return
|
|
178
|
+
function V() {
|
|
179
|
+
return V = Object.assign ? Object.assign.bind() : function(e) {
|
|
138
180
|
for (var r = 1; r < arguments.length; r++) {
|
|
139
|
-
var
|
|
140
|
-
for (var
|
|
141
|
-
({}).hasOwnProperty.call(
|
|
181
|
+
var n = arguments[r];
|
|
182
|
+
for (var t in n) {
|
|
183
|
+
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
142
184
|
}
|
|
143
185
|
}
|
|
144
186
|
return e;
|
|
145
|
-
},
|
|
187
|
+
}, V.apply(null, arguments);
|
|
146
188
|
}
|
|
147
189
|
function N(e, r) {
|
|
148
|
-
var
|
|
190
|
+
var n = Object.keys(e);
|
|
149
191
|
if (Object.getOwnPropertySymbols) {
|
|
150
|
-
var
|
|
151
|
-
r && (
|
|
192
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
193
|
+
r && (t = t.filter((function(r) {
|
|
152
194
|
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
153
|
-
}))),
|
|
195
|
+
}))), n.push.apply(n, t);
|
|
154
196
|
}
|
|
155
|
-
return
|
|
197
|
+
return n;
|
|
156
198
|
}
|
|
157
|
-
function
|
|
199
|
+
function F(e) {
|
|
158
200
|
for (var r = 1; r < arguments.length; r++) {
|
|
159
|
-
var
|
|
160
|
-
r % 2 ? N(Object(
|
|
161
|
-
|
|
162
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
163
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(
|
|
201
|
+
var n = null != arguments[r] ? arguments[r] : {};
|
|
202
|
+
r % 2 ? N(Object(n), !0).forEach((function(r) {
|
|
203
|
+
K(e, r, n[r]);
|
|
204
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : N(Object(n)).forEach((function(r) {
|
|
205
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
164
206
|
}));
|
|
165
207
|
}
|
|
166
208
|
return e;
|
|
167
209
|
}
|
|
168
|
-
function
|
|
169
|
-
return (r =
|
|
170
|
-
value:
|
|
210
|
+
function K(e, r, n) {
|
|
211
|
+
return (r = H(r)) in e ? Object.defineProperty(e, r, {
|
|
212
|
+
value: n,
|
|
171
213
|
enumerable: !0,
|
|
172
214
|
configurable: !0,
|
|
173
215
|
writable: !0
|
|
174
|
-
}) : e[r] =
|
|
216
|
+
}) : e[r] = n, e;
|
|
175
217
|
}
|
|
176
|
-
function
|
|
177
|
-
var r =
|
|
178
|
-
return "symbol" ==
|
|
218
|
+
function H(e) {
|
|
219
|
+
var r = z(e, "string");
|
|
220
|
+
return "symbol" == B(r) ? r : r + "";
|
|
179
221
|
}
|
|
180
|
-
function
|
|
181
|
-
if ("object" !=
|
|
182
|
-
var
|
|
183
|
-
if (void 0 !==
|
|
184
|
-
var
|
|
185
|
-
if ("object" !=
|
|
222
|
+
function z(e, r) {
|
|
223
|
+
if ("object" != B(e) || !e) return e;
|
|
224
|
+
var n = e[Symbol.toPrimitive];
|
|
225
|
+
if (void 0 !== n) {
|
|
226
|
+
var t = n.call(e, r || "default");
|
|
227
|
+
if ("object" != B(t)) return t;
|
|
186
228
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
187
229
|
}
|
|
188
230
|
return ("string" === r ? String : Number)(e);
|
|
189
231
|
}
|
|
190
|
-
function
|
|
232
|
+
function W(e, r) {
|
|
191
233
|
if (null == e) return {};
|
|
192
|
-
var
|
|
234
|
+
var n, t, l = $(e, r);
|
|
193
235
|
if (Object.getOwnPropertySymbols) {
|
|
194
236
|
var a = Object.getOwnPropertySymbols(e);
|
|
195
|
-
for (
|
|
196
|
-
|
|
237
|
+
for (t = 0; t < a.length; t++) {
|
|
238
|
+
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
|
|
197
239
|
}
|
|
198
240
|
}
|
|
199
241
|
return l;
|
|
200
242
|
}
|
|
201
|
-
function
|
|
243
|
+
function $(e, r) {
|
|
202
244
|
if (null == e) return {};
|
|
203
|
-
var
|
|
204
|
-
for (var
|
|
205
|
-
if ({}.hasOwnProperty.call(e,
|
|
206
|
-
if (-1 !== r.indexOf(
|
|
207
|
-
t
|
|
245
|
+
var n = {};
|
|
246
|
+
for (var t in e) {
|
|
247
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
248
|
+
if (-1 !== r.indexOf(t)) continue;
|
|
249
|
+
n[t] = e[t];
|
|
208
250
|
}
|
|
209
251
|
}
|
|
210
|
-
return
|
|
252
|
+
return n;
|
|
211
253
|
}
|
|
212
|
-
var
|
|
254
|
+
var X = {
|
|
213
255
|
/** @private */
|
|
214
256
|
active: p().bool,
|
|
215
257
|
children: p().node,
|
|
216
258
|
description: p().string,
|
|
217
259
|
descriptionPosition: p().oneOf([ "right", "bottom" ]),
|
|
218
|
-
disabled: p().bool,
|
|
260
|
+
disabled: p().oneOfType([ p().bool, p().oneOf([ "dimmed", "disabled" ]) ]),
|
|
219
261
|
elementRef: p().oneOfType([ p().func, p().object ]),
|
|
220
262
|
endAdornment: p().node,
|
|
221
263
|
hidden: p().bool,
|
|
@@ -240,139 +282,141 @@
|
|
|
240
282
|
};
|
|
241
283
|
/**
|
|
242
284
|
* An option within a `Multiselect`.
|
|
243
|
-
*/ function
|
|
244
|
-
var r = e.children, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l,
|
|
285
|
+
*/ function U(e) {
|
|
286
|
+
var r = e.children, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, i = e.disabled, o = e.elementRef, u = e.endAdornment, c = e.icon, s = e.label, f = e.multiple, d = e.onClick, p = e.role, v = p === void 0 ? "option" : p, b = e.value, m = W(e, [ "children", "descriptionPosition", "disabled", "elementRef", "endAdornment", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
245
287
|
// @docs-props-type OptionPropsBase
|
|
246
|
-
var y = (
|
|
247
|
-
|
|
288
|
+
var y = _(i, "disabled"), g = y.isDisabled, h = y.disabledValue;
|
|
289
|
+
var S = (0, n.useCallback)((function(e) {
|
|
290
|
+
if (!g) {
|
|
248
291
|
d === null || d === void 0 ? void 0 : d(e, {
|
|
249
292
|
value: b
|
|
250
293
|
});
|
|
251
294
|
}
|
|
252
|
-
}), [
|
|
253
|
-
var
|
|
254
|
-
var
|
|
295
|
+
}), [ g, d, b ]);
|
|
296
|
+
var O = b.toString();
|
|
297
|
+
var C = F({
|
|
255
298
|
descriptionPosition: a,
|
|
256
|
-
disabled:
|
|
299
|
+
disabled: h,
|
|
300
|
+
"data-test-disabled": h
|
|
257
301
|
}, m);
|
|
258
302
|
|
|
259
|
-
return
|
|
303
|
+
return t().createElement(w.Item, V({
|
|
260
304
|
"data-test-value": b,
|
|
261
305
|
"data-test": "option",
|
|
262
|
-
elementRef:
|
|
306
|
+
elementRef: o,
|
|
263
307
|
endAdornment: u
|
|
264
|
-
},
|
|
308
|
+
}, C, {
|
|
265
309
|
selectable: true,
|
|
266
310
|
selectableAppearance: f ? "checkbox" : "checkmark",
|
|
267
311
|
startAdornment: c,
|
|
268
|
-
onClick:
|
|
312
|
+
onClick: S,
|
|
269
313
|
role: v,
|
|
270
|
-
value:
|
|
314
|
+
value: O
|
|
271
315
|
}), r || s);
|
|
272
316
|
}
|
|
273
|
-
|
|
274
|
-
|
|
317
|
+
U.propTypes = X;
|
|
318
|
+
U.type = w.Item;
|
|
275
319
|
// For components to distinguish if their children are Options or Headings/Dividers
|
|
276
|
-
/* harmony default export */ const
|
|
320
|
+
/* harmony default export */ const J = U;
|
|
277
321
|
// CONCATENATED MODULE: ./src/SelectBase/SelectAllOption.tsx
|
|
278
|
-
function
|
|
322
|
+
function G(e) {
|
|
279
323
|
"@babel/helpers - typeof";
|
|
280
|
-
return
|
|
324
|
+
return G = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
281
325
|
return typeof e;
|
|
282
326
|
} : function(e) {
|
|
283
327
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
284
|
-
},
|
|
328
|
+
}, G(e);
|
|
285
329
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
330
|
+
function Q() {
|
|
331
|
+
return Q = Object.assign ? Object.assign.bind() : function(e) {
|
|
288
332
|
for (var r = 1; r < arguments.length; r++) {
|
|
289
|
-
var
|
|
290
|
-
for (var
|
|
291
|
-
({}).hasOwnProperty.call(
|
|
333
|
+
var n = arguments[r];
|
|
334
|
+
for (var t in n) {
|
|
335
|
+
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
292
336
|
}
|
|
293
337
|
}
|
|
294
338
|
return e;
|
|
295
|
-
},
|
|
339
|
+
}, Q.apply(null, arguments);
|
|
296
340
|
}
|
|
297
|
-
function
|
|
341
|
+
function Y(e, r) {
|
|
298
342
|
if (null == e) return {};
|
|
299
|
-
var
|
|
343
|
+
var n, t, l = Z(e, r);
|
|
300
344
|
if (Object.getOwnPropertySymbols) {
|
|
301
345
|
var a = Object.getOwnPropertySymbols(e);
|
|
302
|
-
for (
|
|
303
|
-
|
|
346
|
+
for (t = 0; t < a.length; t++) {
|
|
347
|
+
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
|
|
304
348
|
}
|
|
305
349
|
}
|
|
306
350
|
return l;
|
|
307
351
|
}
|
|
308
|
-
function
|
|
352
|
+
function Z(e, r) {
|
|
309
353
|
if (null == e) return {};
|
|
310
|
-
var
|
|
311
|
-
for (var
|
|
312
|
-
if ({}.hasOwnProperty.call(e,
|
|
313
|
-
if (-1 !== r.indexOf(
|
|
314
|
-
t
|
|
354
|
+
var n = {};
|
|
355
|
+
for (var t in e) {
|
|
356
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
357
|
+
if (-1 !== r.indexOf(t)) continue;
|
|
358
|
+
n[t] = e[t];
|
|
315
359
|
}
|
|
316
360
|
}
|
|
317
|
-
return
|
|
361
|
+
return n;
|
|
318
362
|
}
|
|
319
|
-
function
|
|
320
|
-
var
|
|
363
|
+
function ee(e, r) {
|
|
364
|
+
var n = Object.keys(e);
|
|
321
365
|
if (Object.getOwnPropertySymbols) {
|
|
322
|
-
var
|
|
323
|
-
r && (
|
|
366
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
367
|
+
r && (t = t.filter((function(r) {
|
|
324
368
|
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
325
|
-
}))),
|
|
369
|
+
}))), n.push.apply(n, t);
|
|
326
370
|
}
|
|
327
|
-
return
|
|
371
|
+
return n;
|
|
328
372
|
}
|
|
329
|
-
function
|
|
373
|
+
function re(e) {
|
|
330
374
|
for (var r = 1; r < arguments.length; r++) {
|
|
331
|
-
var
|
|
332
|
-
r % 2 ?
|
|
333
|
-
|
|
334
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
335
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(
|
|
375
|
+
var n = null != arguments[r] ? arguments[r] : {};
|
|
376
|
+
r % 2 ? ee(Object(n), !0).forEach((function(r) {
|
|
377
|
+
ne(e, r, n[r]);
|
|
378
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ee(Object(n)).forEach((function(r) {
|
|
379
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
336
380
|
}));
|
|
337
381
|
}
|
|
338
382
|
return e;
|
|
339
383
|
}
|
|
340
|
-
function
|
|
384
|
+
function ne(e, r, n) {
|
|
341
385
|
return (r = te(r)) in e ? Object.defineProperty(e, r, {
|
|
342
|
-
value:
|
|
386
|
+
value: n,
|
|
343
387
|
enumerable: !0,
|
|
344
388
|
configurable: !0,
|
|
345
389
|
writable: !0
|
|
346
|
-
}) : e[r] =
|
|
390
|
+
}) : e[r] = n, e;
|
|
347
391
|
}
|
|
348
392
|
function te(e) {
|
|
349
|
-
var r =
|
|
350
|
-
return "symbol" ==
|
|
393
|
+
var r = le(e, "string");
|
|
394
|
+
return "symbol" == G(r) ? r : r + "";
|
|
351
395
|
}
|
|
352
|
-
function
|
|
353
|
-
if ("object" !=
|
|
354
|
-
var
|
|
355
|
-
if (void 0 !==
|
|
356
|
-
var
|
|
357
|
-
if ("object" !=
|
|
396
|
+
function le(e, r) {
|
|
397
|
+
if ("object" != G(e) || !e) return e;
|
|
398
|
+
var n = e[Symbol.toPrimitive];
|
|
399
|
+
if (void 0 !== n) {
|
|
400
|
+
var t = n.call(e, r || "default");
|
|
401
|
+
if ("object" != G(t)) return t;
|
|
358
402
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
359
403
|
}
|
|
360
404
|
return ("string" === r ? String : Number)(e);
|
|
361
405
|
}
|
|
362
|
-
var
|
|
406
|
+
var ae = re(re({}, J.propTypes), {}, {
|
|
363
407
|
totalCount: p().number,
|
|
364
408
|
// unlike OptionBase, there's a default value for this prop
|
|
365
409
|
value: p().string
|
|
366
410
|
});
|
|
367
|
-
function
|
|
368
|
-
var r = e.active,
|
|
411
|
+
function ie(e) {
|
|
412
|
+
var r = e.active, n = e.elementRef, l = e.id, a = e.label, i = e.onClick, o = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, f = Y(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
|
|
369
413
|
// @docs-props-type SelectAllOptionPropsBase
|
|
370
414
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
371
415
|
var d = u != null ? " (".concat(u === null || u === void 0 ? void 0 : u.toString(), ")") : "";
|
|
372
416
|
|
|
373
|
-
return
|
|
417
|
+
return t().createElement(J, Q({
|
|
374
418
|
active: r,
|
|
375
|
-
elementRef:
|
|
419
|
+
elementRef: n,
|
|
376
420
|
"aria-keyshortcuts": "Control+A",
|
|
377
421
|
"data-test": "select-all",
|
|
378
422
|
description: "".concat(d, " Ctrl-a"),
|
|
@@ -381,27 +425,27 @@
|
|
|
381
425
|
key: "selectAll",
|
|
382
426
|
multiple: true,
|
|
383
427
|
label: a,
|
|
384
|
-
onClick:
|
|
385
|
-
selected:
|
|
428
|
+
onClick: i,
|
|
429
|
+
selected: o,
|
|
386
430
|
role: "menuitemcheckbox",
|
|
387
431
|
value: s
|
|
388
432
|
}, f));
|
|
389
433
|
}
|
|
390
|
-
|
|
391
|
-
/* harmony default export */ const oe =
|
|
434
|
+
ie.propTypes = ae;
|
|
435
|
+
/* harmony default export */ const oe = ie;
|
|
392
436
|
// CONCATENATED MODULE: external "styled-components"
|
|
393
|
-
const
|
|
394
|
-
var
|
|
437
|
+
const ue = require("styled-components");
|
|
438
|
+
var ce = e.n(ue);
|
|
395
439
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
396
|
-
const
|
|
397
|
-
var
|
|
440
|
+
const se = require("@splunk/react-ui/Button");
|
|
441
|
+
var fe = e.n(se);
|
|
398
442
|
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
399
|
-
const
|
|
400
|
-
var
|
|
443
|
+
const de = require("@splunk/react-ui/Divider");
|
|
444
|
+
var pe = e.n(de);
|
|
401
445
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
402
|
-
const
|
|
446
|
+
const ve = require("@splunk/themes");
|
|
403
447
|
// CONCATENATED MODULE: ./src/SelectBase/SelectBaseStyles.ts
|
|
404
|
-
var
|
|
448
|
+
var be = ce()(fe()).withConfig({
|
|
405
449
|
displayName: "SelectBaseStyles__StyledButton",
|
|
406
450
|
componentId: "sc-1lmonqb-0"
|
|
407
451
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -411,77 +455,77 @@
|
|
|
411
455
|
var r = e.$multiple;
|
|
412
456
|
return !r && "flex-grow: 0;";
|
|
413
457
|
}));
|
|
414
|
-
var
|
|
458
|
+
var me = ce().span.withConfig({
|
|
415
459
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
416
460
|
componentId: "sc-1lmonqb-1"
|
|
417
|
-
})([ "padding-right:", ";" ],
|
|
418
|
-
var
|
|
461
|
+
})([ "padding-right:", ";" ], ve.variables.spacingXSmall);
|
|
462
|
+
var ye = ce().span.withConfig({
|
|
419
463
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
420
464
|
componentId: "sc-1lmonqb-2"
|
|
421
|
-
})([ "padding-left:", ";" ],
|
|
422
|
-
var
|
|
465
|
+
})([ "padding-left:", ";" ], ve.variables.spacingXSmall);
|
|
466
|
+
var ge = ce().div.withConfig({
|
|
423
467
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
424
468
|
componentId: "sc-1lmonqb-3"
|
|
425
|
-
})([ "padding:", " ", " ", ";min-width:160px;" ],
|
|
426
|
-
var
|
|
469
|
+
})([ "padding:", " ", " ", ";min-width:160px;" ], ve.variables.spacingLarge, ve.variables.spacingLarge, ve.variables.spacingSmall);
|
|
470
|
+
var he = ce().span.withConfig({
|
|
427
471
|
displayName: "SelectBaseStyles__StyledCount",
|
|
428
472
|
componentId: "sc-1lmonqb-4"
|
|
429
|
-
})([ "padding-right:", ";" ],
|
|
430
|
-
var
|
|
473
|
+
})([ "padding-right:", ";" ], ve.variables.spacingXSmall);
|
|
474
|
+
var Se = ce()(O()).withConfig({
|
|
431
475
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
432
476
|
componentId: "sc-1lmonqb-5"
|
|
433
477
|
})([ "", ";" ], (function(e) {
|
|
434
478
|
var r = e.$disabled;
|
|
435
|
-
return r && (0,
|
|
479
|
+
return r && (0, ue.css)([ "color:", ";" ], ve.variables.contentColorDisabled);
|
|
436
480
|
}));
|
|
437
|
-
var
|
|
481
|
+
var Oe = ce().div.withConfig({
|
|
438
482
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
439
483
|
componentId: "sc-1lmonqb-6"
|
|
440
|
-
})([ "", ";gap:", ";padding:", " ", " ", ";" ],
|
|
441
|
-
var
|
|
484
|
+
})([ "", ";gap:", ";padding:", " ", " ", ";" ], ve.mixins.reset("flex"), ve.variables.spacingMedium, ve.variables.spacingXSmall, ve.variables.spacingLarge, ve.variables.spacingSmall);
|
|
485
|
+
var we = ce()(pe()).withConfig({
|
|
442
486
|
displayName: "SelectBaseStyles__StyledControlsDivider",
|
|
443
487
|
componentId: "sc-1lmonqb-7"
|
|
444
|
-
})([ "border-color:", ";" ],
|
|
488
|
+
})([ "border-color:", ";" ], ve.variables.borderColor);
|
|
445
489
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
446
490
|
// A utility for matching keyboard characters to list values
|
|
447
|
-
var
|
|
448
|
-
return r ? r.label.charAt(
|
|
491
|
+
var Ce = function e(r, n) {
|
|
492
|
+
return r ? r.label.charAt(n).toLowerCase() : "";
|
|
449
493
|
};
|
|
450
|
-
var
|
|
494
|
+
var ke = function e(r, n) {
|
|
451
495
|
if (!r.length) {
|
|
452
496
|
return r;
|
|
453
497
|
}
|
|
454
|
-
var
|
|
498
|
+
var t = null;
|
|
455
499
|
var l = false;
|
|
456
500
|
var a = r.filter((function(e) {
|
|
457
|
-
var r =
|
|
458
|
-
if (r ===
|
|
501
|
+
var r = Ce(e, n.index);
|
|
502
|
+
if (r === n.value) {
|
|
459
503
|
l = true;
|
|
460
504
|
return true;
|
|
461
505
|
}
|
|
462
506
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
463
507
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
464
508
|
if (!l) {
|
|
465
|
-
var a =
|
|
509
|
+
var a = Ce(t, n.index);
|
|
466
510
|
if (!a) {
|
|
467
|
-
|
|
468
|
-
} else if (r >
|
|
469
|
-
if (a <
|
|
470
|
-
|
|
511
|
+
t = e;
|
|
512
|
+
} else if (r > n.value) {
|
|
513
|
+
if (a < n.value) {
|
|
514
|
+
t = e;
|
|
471
515
|
} else if (a > r) {
|
|
472
|
-
|
|
516
|
+
t = e;
|
|
473
517
|
}
|
|
474
518
|
} else if (r > a) {
|
|
475
|
-
|
|
519
|
+
t = e;
|
|
476
520
|
}
|
|
477
521
|
}
|
|
478
522
|
return false;
|
|
479
523
|
}));
|
|
480
|
-
return a.length === 0 &&
|
|
524
|
+
return a.length === 0 && t ? [ t ] : a;
|
|
481
525
|
};
|
|
482
526
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
483
527
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
484
|
-
var
|
|
528
|
+
var xe = {
|
|
485
529
|
body: {
|
|
486
530
|
appendChild: function e() {
|
|
487
531
|
return [];
|
|
@@ -535,16 +579,16 @@
|
|
|
535
579
|
search: ""
|
|
536
580
|
}
|
|
537
581
|
};
|
|
538
|
-
function
|
|
539
|
-
var e = typeof document !== "undefined" ? document :
|
|
582
|
+
function je() {
|
|
583
|
+
var e = typeof document !== "undefined" ? document : xe;
|
|
540
584
|
return e;
|
|
541
585
|
}
|
|
542
|
-
var
|
|
543
|
-
/* harmony default export */ const Pe = /* unused pure expression or super */ null &&
|
|
586
|
+
var Ee = je();
|
|
587
|
+
/* harmony default export */ const Pe = /* unused pure expression or super */ null && Ee;
|
|
544
588
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
545
589
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
546
|
-
var
|
|
547
|
-
document:
|
|
590
|
+
var Ae = {
|
|
591
|
+
document: xe,
|
|
548
592
|
navigator: {
|
|
549
593
|
userAgent: ""
|
|
550
594
|
},
|
|
@@ -598,12 +642,12 @@
|
|
|
598
642
|
clearTimeout(r);
|
|
599
643
|
}
|
|
600
644
|
};
|
|
601
|
-
function
|
|
602
|
-
var e = typeof window !== "undefined" ? window :
|
|
645
|
+
function Le() {
|
|
646
|
+
var e = typeof window !== "undefined" ? window : Ae;
|
|
603
647
|
return e;
|
|
604
648
|
}
|
|
605
|
-
var
|
|
606
|
-
/* harmony default export */ const
|
|
649
|
+
var Ie = Le();
|
|
650
|
+
/* harmony default export */ const De = /* unused pure expression or super */ null && Ie;
|
|
607
651
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
608
652
|
/**
|
|
609
653
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -625,147 +669,151 @@
|
|
|
625
669
|
}
|
|
626
670
|
// CONCATENATED MODULE: ./src/SelectBase/SelectBase.tsx
|
|
627
671
|
function Me(e) {
|
|
628
|
-
return
|
|
672
|
+
return _e(e) || qe(e) || Fe(e) || Te();
|
|
629
673
|
}
|
|
630
|
-
function
|
|
674
|
+
function Te() {
|
|
631
675
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
632
676
|
}
|
|
633
|
-
function
|
|
677
|
+
function qe(e) {
|
|
634
678
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
635
679
|
}
|
|
636
|
-
function
|
|
637
|
-
if (Array.isArray(e)) return
|
|
680
|
+
function _e(e) {
|
|
681
|
+
if (Array.isArray(e)) return Ke(e);
|
|
638
682
|
}
|
|
639
|
-
function
|
|
640
|
-
return
|
|
683
|
+
function Be() {
|
|
684
|
+
return Be = Object.assign ? Object.assign.bind() : function(e) {
|
|
641
685
|
for (var r = 1; r < arguments.length; r++) {
|
|
642
|
-
var
|
|
643
|
-
for (var
|
|
644
|
-
({}).hasOwnProperty.call(
|
|
686
|
+
var n = arguments[r];
|
|
687
|
+
for (var t in n) {
|
|
688
|
+
({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
645
689
|
}
|
|
646
690
|
}
|
|
647
691
|
return e;
|
|
648
|
-
},
|
|
692
|
+
}, Be.apply(null, arguments);
|
|
649
693
|
}
|
|
650
|
-
function
|
|
651
|
-
return
|
|
694
|
+
function Ve(e, r) {
|
|
695
|
+
return ze(e) || He(e, r) || Fe(e, r) || Ne();
|
|
652
696
|
}
|
|
653
697
|
function Ne() {
|
|
654
698
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
655
699
|
}
|
|
656
|
-
function
|
|
700
|
+
function Fe(e, r) {
|
|
657
701
|
if (e) {
|
|
658
|
-
if ("string" == typeof e) return
|
|
659
|
-
var
|
|
660
|
-
return "Object" ===
|
|
702
|
+
if ("string" == typeof e) return Ke(e, r);
|
|
703
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
704
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ke(e, r) : void 0;
|
|
661
705
|
}
|
|
662
706
|
}
|
|
663
|
-
function
|
|
707
|
+
function Ke(e, r) {
|
|
664
708
|
(null == r || r > e.length) && (r = e.length);
|
|
665
|
-
for (var
|
|
666
|
-
n
|
|
709
|
+
for (var n = 0, t = Array(r); n < r; n++) {
|
|
710
|
+
t[n] = e[n];
|
|
667
711
|
}
|
|
668
|
-
return
|
|
712
|
+
return t;
|
|
669
713
|
}
|
|
670
|
-
function
|
|
671
|
-
var
|
|
672
|
-
if (null !=
|
|
673
|
-
var
|
|
714
|
+
function He(e, r) {
|
|
715
|
+
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
716
|
+
if (null != n) {
|
|
717
|
+
var t, l, a, i, o = [], u = !0, c = !1;
|
|
674
718
|
try {
|
|
675
|
-
if (a = (
|
|
676
|
-
if (Object(
|
|
719
|
+
if (a = (n = n.call(e)).next, 0 === r) {
|
|
720
|
+
if (Object(n) !== n) return;
|
|
677
721
|
u = !1;
|
|
678
|
-
} else for (;!(u = (
|
|
722
|
+
} else for (;!(u = (t = a.call(n)).done) && (o.push(t.value), o.length !== r); u = !0) {
|
|
679
723
|
}
|
|
680
724
|
} catch (e) {
|
|
681
725
|
c = !0, l = e;
|
|
682
726
|
} finally {
|
|
683
727
|
try {
|
|
684
|
-
if (!u && null !=
|
|
728
|
+
if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
685
729
|
} finally {
|
|
686
730
|
if (c) throw l;
|
|
687
731
|
}
|
|
688
732
|
}
|
|
689
|
-
return
|
|
733
|
+
return o;
|
|
690
734
|
}
|
|
691
735
|
}
|
|
692
|
-
function
|
|
736
|
+
function ze(e) {
|
|
693
737
|
if (Array.isArray(e)) return e;
|
|
694
738
|
}
|
|
695
|
-
function
|
|
739
|
+
function We(e, r) {
|
|
696
740
|
if (null == e) return {};
|
|
697
|
-
var
|
|
741
|
+
var n, t, l = $e(e, r);
|
|
698
742
|
if (Object.getOwnPropertySymbols) {
|
|
699
743
|
var a = Object.getOwnPropertySymbols(e);
|
|
700
|
-
for (
|
|
701
|
-
|
|
744
|
+
for (t = 0; t < a.length; t++) {
|
|
745
|
+
n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (l[n] = e[n]);
|
|
702
746
|
}
|
|
703
747
|
}
|
|
704
748
|
return l;
|
|
705
749
|
}
|
|
706
|
-
function
|
|
750
|
+
function $e(e, r) {
|
|
707
751
|
if (null == e) return {};
|
|
708
|
-
var
|
|
709
|
-
for (var
|
|
710
|
-
if ({}.hasOwnProperty.call(e,
|
|
711
|
-
if (-1 !== r.indexOf(
|
|
712
|
-
t
|
|
752
|
+
var n = {};
|
|
753
|
+
for (var t in e) {
|
|
754
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
755
|
+
if (-1 !== r.indexOf(t)) continue;
|
|
756
|
+
n[t] = e[t];
|
|
713
757
|
}
|
|
714
758
|
}
|
|
715
|
-
return
|
|
759
|
+
return n;
|
|
716
760
|
}
|
|
717
|
-
function
|
|
761
|
+
function Xe(e) {
|
|
718
762
|
"@babel/helpers - typeof";
|
|
719
|
-
return
|
|
763
|
+
return Xe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
720
764
|
return typeof e;
|
|
721
765
|
} : function(e) {
|
|
722
766
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
723
|
-
},
|
|
767
|
+
}, Xe(e);
|
|
724
768
|
}
|
|
725
|
-
function
|
|
726
|
-
var
|
|
769
|
+
function Ue(e, r) {
|
|
770
|
+
var n = Object.keys(e);
|
|
727
771
|
if (Object.getOwnPropertySymbols) {
|
|
728
|
-
var
|
|
729
|
-
r && (
|
|
772
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
773
|
+
r && (t = t.filter((function(r) {
|
|
730
774
|
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
731
|
-
}))),
|
|
775
|
+
}))), n.push.apply(n, t);
|
|
732
776
|
}
|
|
733
|
-
return
|
|
777
|
+
return n;
|
|
734
778
|
}
|
|
735
|
-
function
|
|
779
|
+
function Je(e) {
|
|
736
780
|
for (var r = 1; r < arguments.length; r++) {
|
|
737
|
-
var
|
|
738
|
-
r % 2 ?
|
|
739
|
-
|
|
740
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
741
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(
|
|
781
|
+
var n = null != arguments[r] ? arguments[r] : {};
|
|
782
|
+
r % 2 ? Ue(Object(n), !0).forEach((function(r) {
|
|
783
|
+
Ge(e, r, n[r]);
|
|
784
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ue(Object(n)).forEach((function(r) {
|
|
785
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
742
786
|
}));
|
|
743
787
|
}
|
|
744
788
|
return e;
|
|
745
789
|
}
|
|
746
|
-
function
|
|
747
|
-
return (r =
|
|
748
|
-
value:
|
|
790
|
+
function Ge(e, r, n) {
|
|
791
|
+
return (r = Qe(r)) in e ? Object.defineProperty(e, r, {
|
|
792
|
+
value: n,
|
|
749
793
|
enumerable: !0,
|
|
750
794
|
configurable: !0,
|
|
751
795
|
writable: !0
|
|
752
|
-
}) : e[r] =
|
|
796
|
+
}) : e[r] = n, e;
|
|
753
797
|
}
|
|
754
|
-
function
|
|
755
|
-
var r =
|
|
756
|
-
return "symbol" ==
|
|
798
|
+
function Qe(e) {
|
|
799
|
+
var r = Ye(e, "string");
|
|
800
|
+
return "symbol" == Xe(r) ? r : r + "";
|
|
757
801
|
}
|
|
758
|
-
function
|
|
759
|
-
if ("object" !=
|
|
760
|
-
var
|
|
761
|
-
if (void 0 !==
|
|
762
|
-
var
|
|
763
|
-
if ("object" !=
|
|
802
|
+
function Ye(e, r) {
|
|
803
|
+
if ("object" != Xe(e) || !e) return e;
|
|
804
|
+
var n = e[Symbol.toPrimitive];
|
|
805
|
+
if (void 0 !== n) {
|
|
806
|
+
var t = n.call(e, r || "default");
|
|
807
|
+
if ("object" != Xe(t)) return t;
|
|
764
808
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
765
809
|
}
|
|
766
810
|
return ("string" === r ? String : Number)(e);
|
|
767
811
|
}
|
|
768
|
-
var
|
|
812
|
+
var Ze = function e(r) {
|
|
813
|
+
var n = _(r, "disabled"), t = n.isDisabled;
|
|
814
|
+
return !!t;
|
|
815
|
+
};
|
|
816
|
+
var er = {
|
|
769
817
|
allowKeyMatching: p().bool,
|
|
770
818
|
allowNewValues: p().bool,
|
|
771
819
|
animateLoading: p().bool,
|
|
@@ -775,7 +823,7 @@
|
|
|
775
823
|
defaultPlacement: p().oneOf([ "above", "below", "vertical" ]),
|
|
776
824
|
defaultValues: p().array,
|
|
777
825
|
describedBy: p().string,
|
|
778
|
-
disabled: p().bool,
|
|
826
|
+
disabled: p().oneOfType([ p().bool, p().oneOf([ "dimmed", "disabled" ]) ]),
|
|
779
827
|
elementRef: p().oneOfType([ p().func, p().object ]),
|
|
780
828
|
error: p().bool,
|
|
781
829
|
filter: p().oneOf([ false, true, "controlled" ]),
|
|
@@ -816,65 +864,65 @@
|
|
|
816
864
|
/** @private. */
|
|
817
865
|
virtualization: p().number
|
|
818
866
|
};
|
|
819
|
-
var
|
|
867
|
+
var rr = c()((function(e) {
|
|
820
868
|
return [ e ];
|
|
821
869
|
}));
|
|
822
870
|
// preserve separate widths for single vs. multi mode
|
|
823
|
-
var
|
|
824
|
-
var r = e.anchorWidth,
|
|
825
|
-
return
|
|
871
|
+
var nr = c()((function(e) {
|
|
872
|
+
var r = e.anchorWidth, n = e.isMultiple, t = e.maxHeight, l = e.menuStyle;
|
|
873
|
+
return n ? Je({
|
|
826
874
|
width: Math.max(r !== null && r !== void 0 ? r : 0, 200),
|
|
827
|
-
maxHeight:
|
|
828
|
-
}, l) :
|
|
875
|
+
maxHeight: t
|
|
876
|
+
}, l) : Je({
|
|
829
877
|
minWidth: r !== null && r !== void 0 ? r : undefined,
|
|
830
878
|
maxWidth: Math.max(r !== null && r !== void 0 ? r : 0, 300),
|
|
831
|
-
maxHeight:
|
|
879
|
+
maxHeight: t
|
|
832
880
|
}, l);
|
|
833
881
|
}));
|
|
834
|
-
var
|
|
835
|
-
function
|
|
836
|
-
return e &&
|
|
882
|
+
var tr = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
883
|
+
function lr(e) {
|
|
884
|
+
return e && o()(e.props, "value");
|
|
837
885
|
}
|
|
838
|
-
function
|
|
839
|
-
return "".concat(
|
|
886
|
+
function ar(e, r) {
|
|
887
|
+
return "".concat(Xe(e), "-").concat(e, "-").concat(r);
|
|
840
888
|
}
|
|
841
|
-
var
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
var
|
|
845
|
-
var
|
|
846
|
-
var
|
|
847
|
-
var
|
|
848
|
-
var
|
|
849
|
-
var O = (0,
|
|
850
|
-
var w = (0,
|
|
889
|
+
var ir = [ "append", "error", "prepend" ];
|
|
890
|
+
var or = (0, M._)("No matches");
|
|
891
|
+
var ur = (0, M._)("Select...");
|
|
892
|
+
var cr = 30;
|
|
893
|
+
var sr = {};
|
|
894
|
+
var fr = t().createElement(y(), null);
|
|
895
|
+
var dr = function e(r) {
|
|
896
|
+
var n = r.activeItemId, l = r.filterA11yId, a = r.filterKeyword, i = r.hasChildren, o = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, d = r.onSelectAll, p = r.onTextBlur, v = r.onTextChange, b = r.onTextFocus, m = r.onTextKeyDown, y = r.optionSelection, g = r.placement, h = r.selectAllAppearance, S = r.textHasFocus;
|
|
897
|
+
var O = (0, M._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
|
|
898
|
+
var w = (0, M._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
|
|
851
899
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
852
|
-
var C =
|
|
900
|
+
var C = t().createElement(Oe, {
|
|
853
901
|
key: "selectAll"
|
|
854
|
-
},
|
|
902
|
+
}, t().createElement(Se, {
|
|
855
903
|
disabled: y.current === "all",
|
|
856
904
|
appearance: "standalone",
|
|
857
905
|
"aria-label": O,
|
|
858
906
|
onClick: d,
|
|
859
907
|
"data-test": "select-all",
|
|
860
908
|
tag: "button"
|
|
861
|
-
}, a ? (0,
|
|
909
|
+
}, a ? (0, M._)("Select all Matches") : (0, M._)("Select all")), t().createElement(Se, {
|
|
862
910
|
disabled: y.current === "none",
|
|
863
911
|
appearance: "standalone",
|
|
864
912
|
"aria-label": w,
|
|
865
913
|
onClick: f,
|
|
866
914
|
"data-test": "clear-all",
|
|
867
915
|
tag: "button"
|
|
868
|
-
}, a ? (0,
|
|
916
|
+
}, a ? (0, M._)("Clear all Matches") : (0, M._)("Clear all")));
|
|
869
917
|
|
|
870
|
-
return
|
|
918
|
+
return t().createElement("div", {
|
|
871
919
|
key: "controls"
|
|
872
|
-
}, l &&
|
|
920
|
+
}, l && t().createElement(j(), {
|
|
873
921
|
id: l
|
|
874
|
-
}, (0,
|
|
922
|
+
}, (0, M._)("Type to filter")), g === "above" && t().createElement(we, null), t().createElement(ge, {
|
|
875
923
|
key: "filter",
|
|
876
924
|
"data-test": "filter"
|
|
877
|
-
},
|
|
925
|
+
}, t().createElement(P(), {
|
|
878
926
|
value: a,
|
|
879
927
|
autoCapitalize: "off",
|
|
880
928
|
autoComplete: "off",
|
|
@@ -884,88 +932,88 @@
|
|
|
884
932
|
onKeyDown: m,
|
|
885
933
|
onFocus: b,
|
|
886
934
|
onBlur: p,
|
|
887
|
-
placeholder: (0,
|
|
935
|
+
placeholder: (0, M._)("Filter"),
|
|
888
936
|
role: "combobox",
|
|
889
937
|
"aria-expanded": "true",
|
|
890
938
|
"aria-controls": c,
|
|
891
|
-
"aria-owns": S &&
|
|
892
|
-
"aria-label": (0,
|
|
939
|
+
"aria-owns": S && i ? n : undefined,
|
|
940
|
+
"aria-label": (0, M._)("Filter"),
|
|
893
941
|
"aria-autocomplete": "list",
|
|
894
|
-
"aria-activedescendant": S &&
|
|
942
|
+
"aria-activedescendant": S && i ? n : undefined,
|
|
895
943
|
inputRef: u,
|
|
896
|
-
inputId:
|
|
944
|
+
inputId: o,
|
|
897
945
|
canClear: true,
|
|
898
|
-
startAdornment:
|
|
899
|
-
})), s &&
|
|
946
|
+
startAdornment: fr
|
|
947
|
+
})), s && i && h === "buttongroup" && C, g === "below" && t().createElement(we, null));
|
|
900
948
|
};
|
|
901
|
-
var
|
|
902
|
-
var
|
|
903
|
-
var
|
|
904
|
-
if (
|
|
905
|
-
|
|
949
|
+
var pr = function e(r) {
|
|
950
|
+
var n = r.prefixLabel, t = r.label, l = r.suffixLabel;
|
|
951
|
+
var i = t;
|
|
952
|
+
if (n) {
|
|
953
|
+
i = [ "".concat(n, ": ") ].concat(i);
|
|
906
954
|
}
|
|
907
955
|
if (l) {
|
|
908
|
-
|
|
956
|
+
i = a()(i).concat(" ".concat(l));
|
|
909
957
|
}
|
|
910
|
-
return
|
|
958
|
+
return i;
|
|
911
959
|
};
|
|
912
|
-
var
|
|
913
|
-
var
|
|
914
|
-
var l = e.appearance, a = l === void 0 ? "default" : l,
|
|
915
|
-
var
|
|
916
|
-
var e =
|
|
960
|
+
var vr = [];
|
|
961
|
+
var br = t().forwardRef((function(e, r) {
|
|
962
|
+
var l = e.appearance, a = l === void 0 ? "default" : l, i = e.append, o = e.children, u = e.currentValues, c = u === void 0 ? vr : u, s = e.describedBy, d = e.disabled, p = e.elementRef, v = e.error, m = e.inline, y = e.labelText, g = e.labelledBy, h = e.multiple, S = e.onClick, w = e.placeholder, C = e.prefixLabel, k = e.prepend, x = e.required, j = e.suffixLabel, E = e.toggle, P = e.toggleContent, A = e.maxLabelItems, L = A === void 0 ? cr : A, I = We(e, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent", "maxLabelItems" ]);
|
|
963
|
+
var D = (0, n.useMemo)((function() {
|
|
964
|
+
var e = n.Children.toArray(o);
|
|
917
965
|
var r = new Map;
|
|
918
|
-
for (var
|
|
919
|
-
var l = e[
|
|
920
|
-
if (
|
|
966
|
+
for (var t = 0; t < e.length; t += 1) {
|
|
967
|
+
var l = e[t];
|
|
968
|
+
if (lr(l)) {
|
|
921
969
|
r.set(l.props.value, l);
|
|
922
970
|
}
|
|
923
971
|
}
|
|
924
972
|
return r;
|
|
925
|
-
}), [
|
|
926
|
-
var
|
|
973
|
+
}), [ o ]);
|
|
974
|
+
var R = (0, n.useMemo)((function() {
|
|
927
975
|
var e = {
|
|
928
976
|
icon: null,
|
|
929
977
|
label: [],
|
|
930
978
|
ariaLabel: []
|
|
931
979
|
};
|
|
932
980
|
var r = h && c.length > L ? Math.max(1, L) : c.length;
|
|
933
|
-
for (var
|
|
934
|
-
var
|
|
935
|
-
var l =
|
|
981
|
+
for (var n = 0; n < r; n += 1) {
|
|
982
|
+
var t = c[n];
|
|
983
|
+
var l = D.get(t);
|
|
936
984
|
if (l) {
|
|
937
|
-
var a = l.props,
|
|
938
|
-
var s =
|
|
985
|
+
var a = l.props, i = a.children, o = a.icon, u = a.label;
|
|
986
|
+
var s = P !== "optionLabel" && i ? i : u;
|
|
939
987
|
e.label.push(s);
|
|
940
988
|
e.ariaLabel.push(u);
|
|
941
989
|
// if not in multiple mode, add the icon
|
|
942
990
|
if (!h && c.length === 1) {
|
|
943
|
-
e.icon =
|
|
991
|
+
e.icon = o;
|
|
944
992
|
}
|
|
945
993
|
} else if (h) {
|
|
946
994
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
947
|
-
e.label.push(
|
|
948
|
-
e.ariaLabel.push(
|
|
995
|
+
e.label.push(t);
|
|
996
|
+
e.ariaLabel.push(t.toString());
|
|
949
997
|
}
|
|
950
|
-
if (
|
|
951
|
-
e.label.push((0,
|
|
952
|
-
e.ariaLabel.push((0,
|
|
998
|
+
if (n < r - 1) {
|
|
999
|
+
e.label.push((0, M._)(", "));
|
|
1000
|
+
e.ariaLabel.push((0, M._)(", "));
|
|
953
1001
|
}
|
|
954
1002
|
}
|
|
955
1003
|
if (h && c.length > r && e.label.length) {
|
|
956
1004
|
// add visual ellipsis to ensure truncation is shown
|
|
957
|
-
e.label.push((0,
|
|
1005
|
+
e.label.push((0, M._)("..."));
|
|
958
1006
|
}
|
|
959
1007
|
// only apply prefix / suffix if the label is not empty
|
|
960
1008
|
if (e.label.length > 0) {
|
|
961
1009
|
// If there's more than one item selected, read out the selected total
|
|
962
1010
|
// rather than reading out each selected item
|
|
963
|
-
e.ariaLabel =
|
|
1011
|
+
e.ariaLabel = pr({
|
|
964
1012
|
prefixLabel: C,
|
|
965
1013
|
label: e.label.length > 1 ? [ "".concat(c.length, " items selected") ] : e.ariaLabel,
|
|
966
1014
|
suffixLabel: j
|
|
967
1015
|
});
|
|
968
|
-
e.label =
|
|
1016
|
+
e.label = pr({
|
|
969
1017
|
prefixLabel: C,
|
|
970
1018
|
label: e.label,
|
|
971
1019
|
suffixLabel: j
|
|
@@ -976,74 +1024,77 @@
|
|
|
976
1024
|
if (!e.label.length || !h && e.label.every((function(e) {
|
|
977
1025
|
return e === "";
|
|
978
1026
|
}))) {
|
|
979
|
-
e.label =
|
|
1027
|
+
e.label = rr(w);
|
|
980
1028
|
e.ariaLabel = e.label;
|
|
981
1029
|
}
|
|
982
1030
|
return e;
|
|
983
|
-
}), [ c, L, h,
|
|
984
|
-
var
|
|
985
|
-
var N =
|
|
1031
|
+
}), [ c, L, h, D, w, C, j, P ]), T = R.label, q = R.ariaLabel, B = R.icon;
|
|
1032
|
+
var V = "aria-labelledby" in I;
|
|
1033
|
+
var N = _(d, "disabled"), F = N.disabledValue;
|
|
1034
|
+
var K = Je({
|
|
986
1035
|
"aria-describedby": s,
|
|
987
|
-
"aria-
|
|
1036
|
+
"aria-disabled": d === "dimmed" || undefined,
|
|
1037
|
+
"aria-label": g || V ? undefined : "".concat(y ? "".concat(y, ", ") : "").concat(q.join("")),
|
|
988
1038
|
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
989
1039
|
"aria-labelledby": g,
|
|
990
1040
|
"aria-required": x,
|
|
991
1041
|
"data-select-appearance": a,
|
|
992
|
-
append:
|
|
1042
|
+
append: i,
|
|
993
1043
|
prepend: k,
|
|
994
1044
|
onClick: S,
|
|
995
1045
|
role: "combobox",
|
|
996
|
-
disabled:
|
|
1046
|
+
disabled: a === "link" ? d === true || d === "disabled" : F,
|
|
997
1047
|
elementRef: p,
|
|
998
1048
|
error: v,
|
|
999
1049
|
ref: r
|
|
1000
1050
|
}, I);
|
|
1001
1051
|
if (h) {
|
|
1002
|
-
|
|
1052
|
+
K["data-test-values"] = JSON.stringify(c);
|
|
1003
1053
|
} else {
|
|
1004
|
-
var
|
|
1005
|
-
|
|
1054
|
+
var H = Ve(c, 1), z = H[0];
|
|
1055
|
+
K["data-test-value"] = z;
|
|
1006
1056
|
}
|
|
1007
|
-
|
|
1057
|
+
K["data-test-disabled"] = F;
|
|
1058
|
+
if (E) {
|
|
1008
1059
|
|
|
1009
|
-
return (0,
|
|
1060
|
+
return (0, n.cloneElement)(E, K);
|
|
1010
1061
|
}
|
|
1011
1062
|
if (a === "link") {
|
|
1012
1063
|
|
|
1013
|
-
return
|
|
1064
|
+
return t().createElement(O(), Be({
|
|
1014
1065
|
tag: "button",
|
|
1015
1066
|
appearance: "standalone"
|
|
1016
|
-
},
|
|
1067
|
+
}, K, {
|
|
1017
1068
|
"data-select-appearance": "link"
|
|
1018
|
-
}), !!
|
|
1069
|
+
}), !!B && t().createElement(me, null, B), T || w, t().createElement(ye, null, t().createElement(b(), null)));
|
|
1019
1070
|
}
|
|
1020
1071
|
// Using Button's secondary appearance as Select's default appearance.
|
|
1021
|
-
var
|
|
1072
|
+
var W = a === "default" ? "secondary" : a;
|
|
1022
1073
|
|
|
1023
|
-
return
|
|
1074
|
+
return t().createElement(be, Be({}, K, {
|
|
1024
1075
|
$multiple: h,
|
|
1025
|
-
appearance:
|
|
1076
|
+
appearance: W,
|
|
1026
1077
|
label: T,
|
|
1027
1078
|
error: v,
|
|
1028
|
-
icon:
|
|
1079
|
+
icon: B,
|
|
1029
1080
|
inline: m,
|
|
1030
1081
|
isMenu: true,
|
|
1031
1082
|
onClick: S
|
|
1032
|
-
}, f()(I,
|
|
1083
|
+
}, f()(I, ir)), !!c.length && h && t().createElement(he, {
|
|
1033
1084
|
"data-role": "count"
|
|
1034
1085
|
}, "(", c.length, ")"));
|
|
1035
1086
|
}));
|
|
1036
|
-
function
|
|
1037
|
-
var r = e.currentValues,
|
|
1038
|
-
if (
|
|
1087
|
+
function mr(e) {
|
|
1088
|
+
var r = e.currentValues, n = e.multiple;
|
|
1089
|
+
if (n || !(r === null || r === void 0 ? void 0 : r.length)) {
|
|
1039
1090
|
return r !== null && r !== void 0 ? r : [];
|
|
1040
1091
|
}
|
|
1041
1092
|
return [ r[0] ];
|
|
1042
1093
|
}
|
|
1043
|
-
function
|
|
1044
|
-
var r = e.allowKeyMatching, l = r === void 0 ? true : r, a = e.animateLoading,
|
|
1094
|
+
function yr(e) {
|
|
1095
|
+
var r = e.allowKeyMatching, l = r === void 0 ? true : r, a = e.animateLoading, i = e.appearance, o = i === void 0 ? "default" : i, u = e.append, c = e.allowNewValues, s = e.children, f = e.defaultPlacement, d = f === void 0 ? "vertical" : f, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, y = e.error, g = e.filter, S = e.footerMessage, O = e.inline, x = e.inputId, j = e.inputRef, E = e.isLoadingOptions, P = e.labelledBy, A = e.labelText, I = e.loadingMessage, B = e.menuStyle, V = B === void 0 ? sr : B, N = e.multiple, F = e.name, K = e.noOptionsMessage, H = K === void 0 ? or : K, z = e.onChange, W = e.onScroll, $ = e.onScrollBottom, X = e.onFilterChange, U = e.onClick, G = e.onClose, Q = e.onOpen, Y = e.required, Z = e.placeholder, ee = Z === void 0 ? ur : Z, re = e.prefixLabel, ne = e.prepend, te = e.repositionMode, le = te === void 0 ? "flip" : te, ae = e.selectAllAppearance, ie = ae === void 0 ? "buttongroup" : ae, ue = e.showSelectedValuesFirst, ce = e.suffixLabel, se = e.tabConfirmsNewValue, fe = e.values, de = e.virtualization, pe = e.toggle, ve = e.toggleContent, be = ve === void 0 ? "optionChildren" : ve, me = e.maxLabelItems, ye = me === void 0 ? cr : me, ge = We(e, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent", "maxLabelItems" ]);
|
|
1045
1096
|
// @docs-props-type SelectBasePropsBase
|
|
1046
|
-
var
|
|
1097
|
+
var he = L()({
|
|
1047
1098
|
componentName: "SelectBase",
|
|
1048
1099
|
/* eslint-disable-next-line prefer-rest-params */
|
|
1049
1100
|
componentProps: arguments[0],
|
|
@@ -1052,400 +1103,449 @@
|
|
|
1052
1103
|
valuePropName: "values"
|
|
1053
1104
|
});
|
|
1054
1105
|
// states
|
|
1055
|
-
var
|
|
1106
|
+
var Se = (0, n.useState)((function() {
|
|
1056
1107
|
return {
|
|
1057
1108
|
activeItemId: (0, T.createDOMID)("active-item"),
|
|
1058
1109
|
menuListboxId: (0, T.createDOMID)("menu-listbox")
|
|
1059
1110
|
};
|
|
1060
|
-
})),
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1065
|
-
var
|
|
1066
|
-
var
|
|
1111
|
+
})), Oe = Ve(Se, 1), we = Oe[0], Ce = we.activeItemId, xe = we.menuListboxId;
|
|
1112
|
+
var je = (0, n.useState)(0), Ee = Ve(je, 2), Pe = Ee[0], Ae = Ee[1];
|
|
1113
|
+
var Ie = (0, n.useState)(""), De = Ve(Ie, 2), Te = De[0], qe = De[1];
|
|
1114
|
+
var _e = (0, n.useState)(false), Ne = Ve(_e, 2), Fe = Ne[0], Ke = Ne[1];
|
|
1115
|
+
var He = (0, n.useState)(false), ze = Ve(He, 2), $e = ze[0], Xe = ze[1];
|
|
1116
|
+
var Ue = (0, n.useState)([]), Je = Ve(Ue, 2), Ge = Je[0], Qe = Je[1];
|
|
1117
|
+
var Ye = (0, n.useState)(p || []), er = Ve(Ye, 2), rr = er[0], ir = er[1];
|
|
1067
1118
|
// previous state
|
|
1068
|
-
var
|
|
1119
|
+
var fr = D()(Pe);
|
|
1069
1120
|
// refs
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1072
|
-
var
|
|
1073
|
-
var
|
|
1074
|
-
var
|
|
1075
|
-
var
|
|
1076
|
-
var
|
|
1077
|
-
var
|
|
1078
|
-
var
|
|
1079
|
-
var
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
1084
|
-
var
|
|
1085
|
-
(
|
|
1121
|
+
var pr = (0, n.useRef)(null);
|
|
1122
|
+
var vr = (0, n.useRef)(null);
|
|
1123
|
+
var yr = (0, n.useRef)(null);
|
|
1124
|
+
var gr = (0, n.useRef)([]);
|
|
1125
|
+
var hr = (0, n.useRef)([]);
|
|
1126
|
+
var Sr = (0, n.useRef)(fr);
|
|
1127
|
+
var Or = (0, n.useRef)();
|
|
1128
|
+
var wr = (0, n.useRef)({});
|
|
1129
|
+
var Cr = (0, n.useRef)(0);
|
|
1130
|
+
var kr = (0, n.useRef)([]);
|
|
1131
|
+
var xr = (0, n.useRef)(null);
|
|
1132
|
+
var jr = (0, n.useRef)();
|
|
1133
|
+
var Er = (0, n.useRef)(0);
|
|
1134
|
+
var Pr = (0, n.useRef)("none");
|
|
1135
|
+
var Ar = (0, n.useState)(g ? (0, T.createDOMID)("filter") : undefined), Lr = Ve(Ar, 1), Ir = Lr[0];
|
|
1136
|
+
var Dr = _(b, "disabled"), Rr = Dr.isDisabled;
|
|
1137
|
+
(0, n.useEffect)((function() {
|
|
1086
1138
|
if (false) {}
|
|
1087
|
-
}), [
|
|
1088
|
-
var
|
|
1089
|
-
var e =
|
|
1139
|
+
}), [ o, u, y, ne ]);
|
|
1140
|
+
var Mr = (0, n.useMemo)((function() {
|
|
1141
|
+
var e = t().Children.toArray(s);
|
|
1090
1142
|
var r = new Map;
|
|
1091
|
-
for (var
|
|
1092
|
-
var l = e[
|
|
1093
|
-
if (
|
|
1143
|
+
for (var n = 0; n < e.length; n += 1) {
|
|
1144
|
+
var l = e[n];
|
|
1145
|
+
if (lr(l)) {
|
|
1094
1146
|
r.set(l.props.value, l);
|
|
1095
1147
|
}
|
|
1096
1148
|
}
|
|
1097
1149
|
return [ e, r ];
|
|
1098
|
-
}), [ s ]),
|
|
1099
|
-
var
|
|
1100
|
-
currentValues:
|
|
1150
|
+
}), [ s ]), Tr = Ve(Mr, 2), qr = Tr[0], _r = Tr[1];
|
|
1151
|
+
var Br = mr({
|
|
1152
|
+
currentValues: he ? fe : rr,
|
|
1101
1153
|
multiple: N
|
|
1102
1154
|
});
|
|
1103
1155
|
// mutable object reference to currentValues to permit idempotent callbacks
|
|
1104
|
-
var
|
|
1105
|
-
|
|
1106
|
-
var
|
|
1156
|
+
var Vr = (0, n.useRef)(null);
|
|
1157
|
+
Vr.current = Br;
|
|
1158
|
+
var Nr = (0, n.useCallback)((function() {
|
|
1107
1159
|
// in non-multiple mode, don't move values to the top of the list
|
|
1108
|
-
return N &&
|
|
1109
|
-
}), [ N,
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1160
|
+
return N && ue !== "never" ? Vr.current : [];
|
|
1161
|
+
}), [ N, ue ]);
|
|
1162
|
+
var Fr = (0, n.useCallback)((function(e) {
|
|
1163
|
+
if (Rr) {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
var r = Te;
|
|
1167
|
+
Ke(true);
|
|
1168
|
+
Qe(Nr());
|
|
1114
1169
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1115
1170
|
if (N) {
|
|
1116
|
-
|
|
1171
|
+
qe("");
|
|
1117
1172
|
}
|
|
1118
|
-
if (r !==
|
|
1119
|
-
|
|
1120
|
-
keyword:
|
|
1173
|
+
if (r !== Te) {
|
|
1174
|
+
X === null || X === void 0 ? void 0 : X(e, {
|
|
1175
|
+
keyword: Te
|
|
1121
1176
|
});
|
|
1122
1177
|
}
|
|
1123
|
-
}), [
|
|
1124
|
-
(0,
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1178
|
+
}), [ Rr, Te, Nr, N, X ]);
|
|
1179
|
+
(0, n.useEffect)((function() {
|
|
1180
|
+
if (Fe) {
|
|
1181
|
+
Q === null || Q === void 0 ? void 0 : Q();
|
|
1182
|
+
if (xr.current && !g) {
|
|
1183
|
+
xr.current.focus();
|
|
1129
1184
|
} else {
|
|
1130
1185
|
var e;
|
|
1131
|
-
|
|
1186
|
+
Ae((e = jr.current) !== null && e !== void 0 ? e : 0);
|
|
1132
1187
|
}
|
|
1133
1188
|
}
|
|
1134
|
-
}), [
|
|
1135
|
-
var
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
}), [
|
|
1141
|
-
var
|
|
1142
|
-
|
|
1143
|
-
|
|
1189
|
+
}), [ Q, Fe, Ge, Te, g ]);
|
|
1190
|
+
var Kr = (0, n.useCallback)((function() {
|
|
1191
|
+
Ke(false);
|
|
1192
|
+
Ae(0);
|
|
1193
|
+
Sr.current = null;
|
|
1194
|
+
G === null || G === void 0 ? void 0 : G();
|
|
1195
|
+
}), [ G ]);
|
|
1196
|
+
var Hr = (0, n.useCallback)((function() {
|
|
1197
|
+
Kr();
|
|
1198
|
+
}), [ Kr ]);
|
|
1199
|
+
var zr = (0, n.useCallback)((function(e, r) {
|
|
1200
|
+
if (Rr) {
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
var n = new Set(Vr.current);
|
|
1204
|
+
var t;
|
|
1144
1205
|
if (N) {
|
|
1145
|
-
if (
|
|
1146
|
-
|
|
1206
|
+
if (n.has(r)) {
|
|
1207
|
+
n["delete"](r);
|
|
1147
1208
|
} else {
|
|
1148
|
-
|
|
1209
|
+
n.add(r);
|
|
1149
1210
|
}
|
|
1150
|
-
|
|
1211
|
+
t = Array.from(n);
|
|
1151
1212
|
} else {
|
|
1152
1213
|
// non-multiple mode must always have a value
|
|
1153
|
-
|
|
1214
|
+
t = [ r ];
|
|
1154
1215
|
}
|
|
1155
|
-
var l = !
|
|
1216
|
+
var l = !he;
|
|
1156
1217
|
if (l) {
|
|
1157
|
-
|
|
1218
|
+
ir(t);
|
|
1158
1219
|
}
|
|
1159
1220
|
if (N) {
|
|
1160
1221
|
// in uncontrolled multiple mode, keep the menu open
|
|
1161
1222
|
if (l) {
|
|
1162
|
-
|
|
1223
|
+
Ke(true);
|
|
1163
1224
|
}
|
|
1164
1225
|
} else {
|
|
1165
1226
|
var a;
|
|
1166
1227
|
// non-multiple mode only supports a single selection
|
|
1167
1228
|
// so close the menu once a selection is made
|
|
1168
|
-
|
|
1229
|
+
Hr({
|
|
1169
1230
|
reason: "contentClick"
|
|
1170
1231
|
});
|
|
1171
|
-
(a =
|
|
1232
|
+
(a = pr.current) === null || a === void 0 ? void 0 : a.focus();
|
|
1172
1233
|
}
|
|
1173
|
-
|
|
1174
|
-
values:
|
|
1175
|
-
name:
|
|
1234
|
+
z === null || z === void 0 ? void 0 : z(e, {
|
|
1235
|
+
values: t,
|
|
1236
|
+
name: F,
|
|
1176
1237
|
reason: "valueToggle"
|
|
1177
1238
|
});
|
|
1178
|
-
}), [
|
|
1179
|
-
var
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
if (
|
|
1183
|
-
clearTimeout(
|
|
1239
|
+
}), [ Hr, he, Rr, N, F, z ]);
|
|
1240
|
+
var Wr = function e() {
|
|
1241
|
+
vr.current = null;
|
|
1242
|
+
gr.current = [];
|
|
1243
|
+
if (yr.current) {
|
|
1244
|
+
clearTimeout(yr.current);
|
|
1184
1245
|
}
|
|
1185
1246
|
};
|
|
1186
|
-
var
|
|
1247
|
+
var $r = (0, n.useCallback)((function(e) {
|
|
1248
|
+
if (Rr) {
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1187
1251
|
// this doesn't make sense if we can't select multiple values
|
|
1188
|
-
|
|
1252
|
+
if (!N) {
|
|
1189
1253
|
return;
|
|
1190
1254
|
}
|
|
1191
|
-
var r =
|
|
1192
|
-
var
|
|
1193
|
-
var
|
|
1255
|
+
var r = Vr.current;
|
|
1256
|
+
var n = new Set(r);
|
|
1257
|
+
var t = new Set([].concat(Me(r), Me(kr.current)));
|
|
1194
1258
|
// to keep track of custom values we create a copy of selected values and remove
|
|
1195
1259
|
// items as they are accounted for in children, leaving only custom values
|
|
1196
|
-
var l = new Set(
|
|
1260
|
+
var l = new Set(t);
|
|
1197
1261
|
var a = new Set;
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1262
|
+
qr.forEach((function(e) {
|
|
1263
|
+
if (lr(e)) {
|
|
1200
1264
|
// this value is being represented in children so it is not custom
|
|
1201
1265
|
l["delete"](e.props.value);
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1266
|
+
var r = Ze(e.props.disabled);
|
|
1267
|
+
if (t.has(e.props.value) && (!r || n.has(e.props.value))) {
|
|
1268
|
+
a.add(e.props.value);
|
|
1269
|
+
}
|
|
1205
1270
|
}
|
|
1206
1271
|
}));
|
|
1207
|
-
var
|
|
1208
|
-
if (!
|
|
1209
|
-
|
|
1272
|
+
var i = [].concat(Me(Array.from(l)), Me(Array.from(a)));
|
|
1273
|
+
if (!he) {
|
|
1274
|
+
ir(i);
|
|
1210
1275
|
}
|
|
1211
|
-
|
|
1212
|
-
values:
|
|
1213
|
-
name:
|
|
1276
|
+
z === null || z === void 0 ? void 0 : z(e, {
|
|
1277
|
+
values: i,
|
|
1278
|
+
name: F,
|
|
1214
1279
|
reason: "selectAll"
|
|
1215
1280
|
});
|
|
1216
|
-
}), [
|
|
1217
|
-
var
|
|
1281
|
+
}), [ qr, he, Rr, N, F, z ]);
|
|
1282
|
+
var Xr = (0, n.useCallback)((function(e) {
|
|
1283
|
+
if (Rr) {
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1218
1286
|
// this doesn't make sense if we can't select multiple values
|
|
1219
|
-
|
|
1287
|
+
if (!N) {
|
|
1220
1288
|
return;
|
|
1221
1289
|
}
|
|
1222
|
-
var r = new Set(
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1290
|
+
var r = new Set(Vr.current);
|
|
1291
|
+
// Preserve hidden values only when "Clear matches" semantics apply
|
|
1292
|
+
var n = Te !== "";
|
|
1293
|
+
var t = new Set;
|
|
1294
|
+
if (n) {
|
|
1295
|
+
t = new Set(Vr.current);
|
|
1296
|
+
kr.current.forEach((function(e) {
|
|
1297
|
+
t["delete"](e);
|
|
1298
|
+
}));
|
|
1226
1299
|
}
|
|
1227
1300
|
var l = new Set;
|
|
1228
|
-
for (var a = 0; a <
|
|
1229
|
-
var
|
|
1301
|
+
for (var a = 0; a < qr.length; a += 1) {
|
|
1302
|
+
var i = qr[a];
|
|
1230
1303
|
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1231
|
-
if (
|
|
1232
|
-
|
|
1304
|
+
if (lr(i)) {
|
|
1305
|
+
var o = Ze(i.props.disabled);
|
|
1306
|
+
if (r.has(i.props.value) && o || t.has(i.props.value)) {
|
|
1307
|
+
l.add(i.props.value);
|
|
1308
|
+
}
|
|
1233
1309
|
}
|
|
1234
1310
|
}
|
|
1235
|
-
var
|
|
1236
|
-
if (!
|
|
1237
|
-
|
|
1311
|
+
var u = Array.from(l);
|
|
1312
|
+
if (!he) {
|
|
1313
|
+
ir(u);
|
|
1238
1314
|
}
|
|
1239
|
-
|
|
1240
|
-
values:
|
|
1241
|
-
name:
|
|
1315
|
+
z === null || z === void 0 ? void 0 : z(e, {
|
|
1316
|
+
values: u,
|
|
1317
|
+
name: F,
|
|
1242
1318
|
reason: "clearAll"
|
|
1243
1319
|
});
|
|
1244
|
-
}), [
|
|
1245
|
-
var
|
|
1246
|
-
if (
|
|
1247
|
-
|
|
1320
|
+
}), [ qr, Te, he, Rr, N, F, z ]);
|
|
1321
|
+
var Ur = (0, n.useCallback)((function(e) {
|
|
1322
|
+
if (Fe && !E) {
|
|
1323
|
+
$ === null || $ === void 0 ? void 0 : $(e);
|
|
1248
1324
|
}
|
|
1249
|
-
}), [
|
|
1250
|
-
var
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1325
|
+
}), [ Fe, E, $ ]);
|
|
1326
|
+
var Jr = (0, n.useCallback)((function(e) {
|
|
1327
|
+
if (Rr) {
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
var r = Cr.current;
|
|
1331
|
+
var t = e.key;
|
|
1332
|
+
var l = Or.current !== null && Or.current !== undefined ? _r.get(Or.current) : undefined;
|
|
1333
|
+
var a = Ze(l === null || l === void 0 ? void 0 : l.props.disabled);
|
|
1334
|
+
if (t === "Tab") {
|
|
1335
|
+
if (se && Or.current && Cr.current <= 1) {
|
|
1336
|
+
if (!a) {
|
|
1337
|
+
e.preventDefault();
|
|
1338
|
+
zr(e, Or.current);
|
|
1339
|
+
}
|
|
1256
1340
|
}
|
|
1257
1341
|
}
|
|
1258
1342
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1259
|
-
if (
|
|
1343
|
+
if (t === "a" && (e.ctrlKey || e.metaKey)) {
|
|
1260
1344
|
// handle control + A
|
|
1261
|
-
if (
|
|
1262
|
-
|
|
1345
|
+
if (Pr.current === "all") {
|
|
1346
|
+
Xr(e);
|
|
1263
1347
|
} else {
|
|
1264
|
-
|
|
1348
|
+
$r(e);
|
|
1265
1349
|
}
|
|
1266
1350
|
}
|
|
1267
1351
|
return;
|
|
1268
1352
|
}
|
|
1269
|
-
if (
|
|
1353
|
+
if (t === "ArrowDown") {
|
|
1270
1354
|
e.preventDefault();
|
|
1271
|
-
|
|
1272
|
-
if (
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1355
|
+
var i = ie === "checkbox" ? r : r - 1;
|
|
1356
|
+
if (i >= 0) {
|
|
1357
|
+
Ae(Math.min(Pe + 1, i));
|
|
1358
|
+
}
|
|
1359
|
+
if (s && $) {
|
|
1360
|
+
var o = n.Children.toArray(s).length - (2 + Vr.current.length);
|
|
1361
|
+
if (Pe === o) {
|
|
1362
|
+
Ur(e);
|
|
1276
1363
|
}
|
|
1277
1364
|
}
|
|
1278
1365
|
}
|
|
1279
|
-
if (
|
|
1366
|
+
if (t === "ArrowUp") {
|
|
1280
1367
|
e.preventDefault();
|
|
1281
|
-
|
|
1368
|
+
Ae(Math.max(Pe - 1, 0));
|
|
1282
1369
|
}
|
|
1283
|
-
if (
|
|
1284
|
-
if (
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
1370
|
+
if (t === "Enter" && Or.current && Fe) {
|
|
1371
|
+
if (Or.current === "selectAll") {
|
|
1372
|
+
if (Pr.current === "all") {
|
|
1373
|
+
Xr(e);
|
|
1287
1374
|
} else {
|
|
1288
|
-
|
|
1375
|
+
$r(e);
|
|
1289
1376
|
}
|
|
1290
|
-
} else {
|
|
1377
|
+
} else if (!a) {
|
|
1291
1378
|
e.preventDefault();
|
|
1292
|
-
|
|
1379
|
+
zr(e, Or.current);
|
|
1293
1380
|
}
|
|
1294
1381
|
}
|
|
1295
|
-
}), [ Pe, s,
|
|
1296
|
-
var
|
|
1297
|
-
var
|
|
1382
|
+
}), [ Pe, s, Xr, Ur, $r, Rr, _r, $, Fe, ie, se, zr ]);
|
|
1383
|
+
var Gr = (0, n.useCallback)((function(e, r) {
|
|
1384
|
+
var n = r.value;
|
|
1385
|
+
if (Rr) {
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1298
1388
|
e.preventDefault();
|
|
1299
|
-
if (!
|
|
1389
|
+
if (!Fe) {
|
|
1300
1390
|
return;
|
|
1301
1391
|
}
|
|
1302
|
-
|
|
1303
|
-
}), [
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1392
|
+
zr(e, n);
|
|
1393
|
+
}), [ Rr, Fe, zr ]);
|
|
1394
|
+
var Qr = (0, n.useCallback)((function(e, r) {
|
|
1395
|
+
var n = e.nativeEvent.key;
|
|
1306
1396
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1307
|
-
if (
|
|
1308
|
-
var
|
|
1397
|
+
if (n.length === 1) {
|
|
1398
|
+
var t = [];
|
|
1309
1399
|
var l = {
|
|
1310
1400
|
index: 0,
|
|
1311
|
-
value:
|
|
1401
|
+
value: n
|
|
1312
1402
|
};
|
|
1313
|
-
if (!
|
|
1314
|
-
if (
|
|
1315
|
-
|
|
1403
|
+
if (!vr.current) {
|
|
1404
|
+
if (n === " ") {
|
|
1405
|
+
Wr();
|
|
1316
1406
|
return;
|
|
1317
1407
|
}
|
|
1318
|
-
|
|
1319
|
-
} else if (
|
|
1320
|
-
l.index =
|
|
1321
|
-
|
|
1408
|
+
t = ke(hr.current, l);
|
|
1409
|
+
} else if (gr.current.length > 1) {
|
|
1410
|
+
l.index = vr.current.index + 1;
|
|
1411
|
+
t = ke(gr.current, l);
|
|
1322
1412
|
}
|
|
1323
|
-
if (
|
|
1413
|
+
if (t.length) {
|
|
1324
1414
|
var a;
|
|
1325
|
-
var
|
|
1415
|
+
var i = 0;
|
|
1326
1416
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1327
|
-
if (l.index === 0 &&
|
|
1328
|
-
var
|
|
1329
|
-
if (
|
|
1330
|
-
|
|
1417
|
+
if (l.index === 0 && t.length > 1) {
|
|
1418
|
+
var o = t.indexOf(hr.current[r]);
|
|
1419
|
+
if (o >= 0) {
|
|
1420
|
+
i = o === t.length - 1 ? 0 : o + 1;
|
|
1331
1421
|
}
|
|
1332
1422
|
}
|
|
1333
|
-
var u =
|
|
1423
|
+
var u = t[i];
|
|
1334
1424
|
var c = u.value, s = u.label;
|
|
1335
|
-
var f =
|
|
1425
|
+
var f = wr.current[ar(c, s)];
|
|
1336
1426
|
f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
|
|
1337
1427
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
if (
|
|
1341
|
-
clearTimeout(
|
|
1428
|
+
gr.current = t;
|
|
1429
|
+
vr.current = l;
|
|
1430
|
+
if (yr.current) {
|
|
1431
|
+
clearTimeout(yr.current);
|
|
1342
1432
|
}
|
|
1343
|
-
|
|
1433
|
+
yr.current = setTimeout(Wr, 500);
|
|
1344
1434
|
e.preventDefault();
|
|
1345
1435
|
e.stopPropagation();
|
|
1346
1436
|
}
|
|
1347
1437
|
}), []);
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1438
|
+
var Yr = (0, n.useCallback)((function(e, r) {
|
|
1439
|
+
var n = r.value;
|
|
1440
|
+
if (Rr) {
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
qe(n);
|
|
1444
|
+
Ke(true);
|
|
1445
|
+
Ae(0);
|
|
1446
|
+
X === null || X === void 0 ? void 0 : X(e, {
|
|
1447
|
+
keyword: n
|
|
1355
1448
|
});
|
|
1356
|
-
}), [
|
|
1357
|
-
var
|
|
1358
|
-
|
|
1449
|
+
}), [ Rr, X ]);
|
|
1450
|
+
var Zr = (0, n.useCallback)((function() {
|
|
1451
|
+
Xe(true);
|
|
1359
1452
|
}), []);
|
|
1360
|
-
var
|
|
1361
|
-
|
|
1453
|
+
var en = (0, n.useCallback)((function() {
|
|
1454
|
+
Xe(false);
|
|
1362
1455
|
}), []);
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1456
|
+
// Close when component becomes disabled/dimmed during an expanded state to prevent further selection
|
|
1457
|
+
(0, n.useEffect)((function() {
|
|
1458
|
+
if (Rr && Fe) {
|
|
1459
|
+
Kr();
|
|
1460
|
+
}
|
|
1461
|
+
}), [ Rr, Fe, Kr ]);
|
|
1462
|
+
var rn = (0, n.useCallback)((function(e) {
|
|
1463
|
+
if (Sr.current !== Pe) {
|
|
1464
|
+
(0, q.scrollIntoViewIfNeeded)(e);
|
|
1366
1465
|
}
|
|
1367
1466
|
}), [ Pe ]);
|
|
1368
|
-
var
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1467
|
+
var nn = (0, n.useCallback)((function(e, r, n) {
|
|
1468
|
+
if (n) {
|
|
1469
|
+
xr.current = e;
|
|
1371
1470
|
}
|
|
1372
1471
|
if (e == null) {
|
|
1373
|
-
delete
|
|
1472
|
+
delete wr.current[r];
|
|
1374
1473
|
} else {
|
|
1375
|
-
|
|
1474
|
+
wr.current[r] = e;
|
|
1376
1475
|
}
|
|
1377
|
-
}), [
|
|
1378
|
-
var
|
|
1379
|
-
|
|
1476
|
+
}), [ wr ]);
|
|
1477
|
+
var tn = (0, n.useCallback)((function(e) {
|
|
1478
|
+
pr.current = e;
|
|
1380
1479
|
Re(m, e);
|
|
1381
|
-
}), [ m,
|
|
1382
|
-
var
|
|
1383
|
-
var r =
|
|
1384
|
-
|
|
1480
|
+
}), [ m, pr ]);
|
|
1481
|
+
var ln = Br.some((function(e) {
|
|
1482
|
+
var r = _r.get(e);
|
|
1483
|
+
var n = Ze(r === null || r === void 0 ? void 0 : r.props.disabled);
|
|
1484
|
+
return r && !n;
|
|
1385
1485
|
}));
|
|
1386
|
-
var
|
|
1387
|
-
var
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
var e = function e(r,
|
|
1486
|
+
var an = ue === "immediately" ? Nr() : Ge;
|
|
1487
|
+
var on = (0, n.useMemo)((function() {
|
|
1488
|
+
Cr.current = 0;
|
|
1489
|
+
jr.current = undefined;
|
|
1490
|
+
Er.current = 0;
|
|
1491
|
+
Or.current = undefined;
|
|
1492
|
+
hr.current = [];
|
|
1493
|
+
var e = function e(r, n) {
|
|
1394
1494
|
return function(e) {
|
|
1395
|
-
return
|
|
1495
|
+
return nn(e, r, n);
|
|
1396
1496
|
};
|
|
1397
1497
|
};
|
|
1398
1498
|
var r;
|
|
1399
1499
|
var a = 0;
|
|
1400
|
-
var
|
|
1500
|
+
var i = false;
|
|
1401
1501
|
// used to avoid overwriting the selected item ref in multiple mode
|
|
1402
|
-
var
|
|
1403
|
-
var u = new Set(
|
|
1404
|
-
var s = new Set(
|
|
1405
|
-
var f =
|
|
1502
|
+
var o;
|
|
1503
|
+
var u = new Set(Br);
|
|
1504
|
+
var s = new Set(an !== null && an !== void 0 ? an : []);
|
|
1505
|
+
var f = qr.reduce((function(c, f, d) {
|
|
1406
1506
|
// ignore Headings and Dividers
|
|
1407
|
-
if (!
|
|
1507
|
+
if (!lr(f)) {
|
|
1408
1508
|
c.push(f);
|
|
1409
1509
|
return c;
|
|
1410
1510
|
}
|
|
1411
1511
|
var p = f.props, v = p.disabled, b = p.hidden, m = p.label, y = p.value;
|
|
1412
1512
|
// Find out if the search string exactly matches a value
|
|
1413
|
-
if (y ===
|
|
1513
|
+
if (y === Te) {
|
|
1414
1514
|
r = true;
|
|
1415
1515
|
}
|
|
1416
1516
|
var h = u.has(y);
|
|
1417
|
-
var S = !!h &&
|
|
1418
|
-
var O = l && !N && !g && !
|
|
1419
|
-
var C =
|
|
1517
|
+
var S = !!h && v !== true && v !== "disabled" && !o;
|
|
1518
|
+
var O = l && !N && !g && !E && !$;
|
|
1519
|
+
var C = ar(y, m);
|
|
1420
1520
|
var k = -1;
|
|
1421
|
-
if (O &&
|
|
1422
|
-
|
|
1521
|
+
if (O && v !== true && v !== "disabled" && !b) {
|
|
1522
|
+
hr.current.push({
|
|
1423
1523
|
label: m,
|
|
1424
1524
|
value: y
|
|
1425
1525
|
});
|
|
1426
|
-
k =
|
|
1526
|
+
k = hr.current.length - 1;
|
|
1427
1527
|
}
|
|
1428
1528
|
// Format the Menu.Item
|
|
1429
|
-
var x = (0,
|
|
1529
|
+
var x = (0, n.cloneElement)(f, {
|
|
1430
1530
|
elementRef: e(C, S),
|
|
1431
1531
|
key: f.key || d,
|
|
1432
|
-
onClick:
|
|
1532
|
+
onClick: Gr,
|
|
1433
1533
|
onKeyDown: O ? function(e) {
|
|
1434
|
-
return
|
|
1534
|
+
return Qr(e, k);
|
|
1435
1535
|
} : undefined,
|
|
1436
1536
|
selected: h,
|
|
1437
1537
|
multiple: N,
|
|
1438
1538
|
role: "option"
|
|
1439
1539
|
});
|
|
1440
1540
|
if (S) {
|
|
1441
|
-
|
|
1541
|
+
o = true;
|
|
1442
1542
|
}
|
|
1443
1543
|
if (s.has(y)) {
|
|
1444
1544
|
if (a === 0) {
|
|
1445
|
-
c.splice(a, 0,
|
|
1545
|
+
c.splice(a, 0, t().createElement(w.Divider, {
|
|
1446
1546
|
key: "topDivider"
|
|
1447
1547
|
}));
|
|
1448
|
-
|
|
1548
|
+
i = true;
|
|
1449
1549
|
}
|
|
1450
1550
|
c.splice(a, 0, x);
|
|
1451
1551
|
a += 1;
|
|
@@ -1456,30 +1556,30 @@
|
|
|
1456
1556
|
}), []);
|
|
1457
1557
|
// In multiple mode, add missing items
|
|
1458
1558
|
if (N) {
|
|
1459
|
-
for (var d =
|
|
1460
|
-
var p =
|
|
1461
|
-
var v =
|
|
1559
|
+
for (var d = Br.length - 1; d >= 0; d -= 1) {
|
|
1560
|
+
var p = Br[d];
|
|
1561
|
+
var v = _r.get(p);
|
|
1462
1562
|
if (!v) {
|
|
1463
|
-
if (p ===
|
|
1563
|
+
if (p === Te) {
|
|
1464
1564
|
r = true;
|
|
1465
1565
|
}
|
|
1466
1566
|
var b = s.has(p);
|
|
1467
|
-
var m =
|
|
1567
|
+
var m = an.length;
|
|
1468
1568
|
if (a === 0) {
|
|
1469
|
-
f.splice(0, 0,
|
|
1569
|
+
f.splice(0, 0, t().createElement(w.Divider, {
|
|
1470
1570
|
key: "topDivider"
|
|
1471
1571
|
}));
|
|
1472
1572
|
a += 1;
|
|
1473
|
-
|
|
1573
|
+
i = true;
|
|
1474
1574
|
}
|
|
1475
1575
|
var y = String(p);
|
|
1476
|
-
var h =
|
|
1477
|
-
f.splice(b ? 0 : m + 1, 0,
|
|
1576
|
+
var h = ar(p, y);
|
|
1577
|
+
f.splice(b ? 0 : m + 1, 0, t().createElement(J, {
|
|
1478
1578
|
elementRef: e(h),
|
|
1479
1579
|
label: y,
|
|
1480
1580
|
value: p,
|
|
1481
1581
|
key: "missing-value-".concat(p),
|
|
1482
|
-
onClick:
|
|
1582
|
+
onClick: Gr,
|
|
1483
1583
|
multiple: N,
|
|
1484
1584
|
selected: true
|
|
1485
1585
|
}));
|
|
@@ -1491,45 +1591,45 @@
|
|
|
1491
1591
|
}
|
|
1492
1592
|
var S = g === "controlled";
|
|
1493
1593
|
// Filter the items
|
|
1494
|
-
var O = (0,
|
|
1594
|
+
var O = (0, R.stringToKeywords)(Te);
|
|
1495
1595
|
f = S ? f : f.filter((function(e) {
|
|
1496
|
-
if (
|
|
1497
|
-
return (0,
|
|
1596
|
+
if (lr(e)) {
|
|
1597
|
+
return (0, R.testPhrase)(e.props.label, O);
|
|
1498
1598
|
}
|
|
1499
1599
|
return true;
|
|
1500
1600
|
// Keep all headers and non-interactive options
|
|
1501
1601
|
})).map((function(e) {
|
|
1502
|
-
if (!
|
|
1602
|
+
if (!lr(e)) {
|
|
1503
1603
|
return e;
|
|
1504
1604
|
}
|
|
1505
1605
|
// highlight matched text
|
|
1506
|
-
var r = O && (0,
|
|
1606
|
+
var r = O && (0, R.keywordLocations)(e.props.label, O);
|
|
1507
1607
|
|
|
1508
|
-
return (0,
|
|
1608
|
+
return (0, n.cloneElement)(e, {
|
|
1509
1609
|
matchRanges: r || undefined
|
|
1510
1610
|
});
|
|
1511
1611
|
}));
|
|
1512
1612
|
// Add the option to add the new value
|
|
1513
|
-
if (c && !r &&
|
|
1514
|
-
var C =
|
|
1515
|
-
var k = "".concat(
|
|
1516
|
-
var x =
|
|
1517
|
-
f.splice(C, 0,
|
|
1613
|
+
if (c && !r && Te) {
|
|
1614
|
+
var C = i ? a + 1 : a;
|
|
1615
|
+
var k = "".concat(Te, " (new value)");
|
|
1616
|
+
var x = ar(Te, k);
|
|
1617
|
+
f.splice(C, 0, t().createElement(J, {
|
|
1518
1618
|
elementRef: e(x),
|
|
1519
1619
|
label: k,
|
|
1520
|
-
value:
|
|
1620
|
+
value: Te,
|
|
1521
1621
|
key: "newValue",
|
|
1522
1622
|
multiple: N,
|
|
1523
|
-
onClick:
|
|
1623
|
+
onClick: Gr
|
|
1524
1624
|
}));
|
|
1525
1625
|
}
|
|
1526
1626
|
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1527
|
-
var j =
|
|
1528
|
-
var
|
|
1627
|
+
var j = ie === "checkbox" && N && f.length > 1 ? 1 : 0;
|
|
1628
|
+
var P = true;
|
|
1529
1629
|
// Highlight the selected Items and remove hidden
|
|
1530
1630
|
f = f.reduce((function(e, r) {
|
|
1531
1631
|
// ignore Dividers & Headings
|
|
1532
|
-
if (!
|
|
1632
|
+
if (!lr(r)) {
|
|
1533
1633
|
e.push(r);
|
|
1534
1634
|
return e;
|
|
1535
1635
|
}
|
|
@@ -1537,178 +1637,182 @@
|
|
|
1537
1637
|
if (r.props && r.props.hidden) {
|
|
1538
1638
|
return e;
|
|
1539
1639
|
}
|
|
1540
|
-
if (r.props.selected &&
|
|
1541
|
-
|
|
1640
|
+
if (r.props.selected && r.props.disabled !== true && r.props.disabled !== "disabled" && jr.current == null) {
|
|
1641
|
+
jr.current = Cr.current;
|
|
1542
1642
|
}
|
|
1543
|
-
var
|
|
1643
|
+
var t = r.props.disabled;
|
|
1644
|
+
if (t === true || t === "disabled") {
|
|
1645
|
+
e.push(r);
|
|
1646
|
+
return e;
|
|
1647
|
+
}
|
|
1648
|
+
var l = j === Pe;
|
|
1544
1649
|
j += 1;
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1650
|
+
Cr.current += 1;
|
|
1651
|
+
// Dimmed Options can receive focus but are not selectable
|
|
1652
|
+
Er.current += r.props.selected && t !== "dimmed" ? 1 : 0;
|
|
1653
|
+
if (r.key !== "newValue" && t !== "dimmed" && !r.props.selected) {
|
|
1654
|
+
P = false;
|
|
1549
1655
|
}
|
|
1550
|
-
if (!
|
|
1656
|
+
if (!l || !$e) {
|
|
1551
1657
|
e.push(r);
|
|
1552
1658
|
return e;
|
|
1553
1659
|
}
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
elementRef: Gr,
|
|
1560
|
-
id: we
|
|
1660
|
+
Or.current = r.props.value;
|
|
1661
|
+
var a = (0, n.cloneElement)(r, {
|
|
1662
|
+
active: l,
|
|
1663
|
+
elementRef: rn,
|
|
1664
|
+
id: Ce
|
|
1561
1665
|
});
|
|
1562
|
-
e.push(
|
|
1666
|
+
e.push(a);
|
|
1563
1667
|
return e;
|
|
1564
1668
|
}), []);
|
|
1565
|
-
|
|
1669
|
+
Pr.current = Er.current === 0 && "none" || P && "all" || "some";
|
|
1566
1670
|
// add select all option
|
|
1567
|
-
if (
|
|
1671
|
+
if (ie === "checkbox" && N && Cr.current > 0) {
|
|
1568
1672
|
var A = Pe === 0 && !!g;
|
|
1569
1673
|
var L;
|
|
1570
|
-
if (
|
|
1571
|
-
if (
|
|
1572
|
-
L = (0,
|
|
1674
|
+
if (Pr.current === "all") {
|
|
1675
|
+
if (Te === "") {
|
|
1676
|
+
L = (0, M._)("Clear all");
|
|
1573
1677
|
} else {
|
|
1574
|
-
L = (0,
|
|
1678
|
+
L = (0, M._)("Clear all matches");
|
|
1575
1679
|
}
|
|
1576
|
-
} else if (
|
|
1577
|
-
L = (0,
|
|
1680
|
+
} else if (Te === "") {
|
|
1681
|
+
L = (0, M._)("Select all");
|
|
1578
1682
|
} else {
|
|
1579
|
-
L = (0,
|
|
1683
|
+
L = (0, M._)("Select all matches");
|
|
1580
1684
|
}
|
|
1581
1685
|
if (A) {
|
|
1582
|
-
|
|
1686
|
+
Or.current = "selectAll";
|
|
1583
1687
|
}
|
|
1584
|
-
f.unshift(
|
|
1688
|
+
f.unshift( t().createElement(oe, {
|
|
1585
1689
|
key: "select-all-option",
|
|
1586
1690
|
active: A,
|
|
1587
|
-
elementRef:
|
|
1588
|
-
id: A ?
|
|
1589
|
-
onClick:
|
|
1691
|
+
elementRef: rn,
|
|
1692
|
+
id: A ? Ce : undefined,
|
|
1693
|
+
onClick: Pr.current === "all" ? Xr : $r,
|
|
1590
1694
|
label: L,
|
|
1591
|
-
selected:
|
|
1592
|
-
totalCount: !!
|
|
1695
|
+
selected: Pr.current === "all" || Pr.current !== "none" && "some",
|
|
1696
|
+
totalCount: !!pe && Br.length || undefined,
|
|
1593
1697
|
tabIndex: g ? -1 : undefined
|
|
1594
|
-
}),
|
|
1698
|
+
}), t().createElement(w.Divider, {
|
|
1595
1699
|
key: "selectAllDivider"
|
|
1596
1700
|
}));
|
|
1597
1701
|
}
|
|
1598
|
-
|
|
1599
|
-
if (
|
|
1702
|
+
kr.current = f.reduce((function(e, r) {
|
|
1703
|
+
if (lr(r)) {
|
|
1600
1704
|
e.push(r.props.value);
|
|
1601
1705
|
}
|
|
1602
1706
|
return e;
|
|
1603
1707
|
}), []);
|
|
1604
1708
|
return f;
|
|
1605
|
-
}), [ Pe,
|
|
1606
|
-
var
|
|
1607
|
-
var
|
|
1608
|
-
var u =
|
|
1609
|
-
anchorWidth:
|
|
1709
|
+
}), [ Pe, Ce, l, c, qr, _r, Br, g, Te, rn, Xr, Gr, Qr, nn, $r, E, N, an, $, ie, $e, pe ]);
|
|
1710
|
+
var un = function e(r) {
|
|
1711
|
+
var n = r.anchorWidth, l = r.maxHeight, i = r.placement, o = r.toggleId;
|
|
1712
|
+
var u = nr({
|
|
1713
|
+
anchorWidth: n,
|
|
1610
1714
|
isMultiple: N,
|
|
1611
1715
|
maxHeight: l,
|
|
1612
|
-
menuStyle:
|
|
1716
|
+
menuStyle: V
|
|
1613
1717
|
});
|
|
1614
|
-
var c =
|
|
1718
|
+
var c = Br.length > 0 && !ln && !g ? 0 : undefined;
|
|
1615
1719
|
var s = {
|
|
1616
1720
|
"aria-multiselectable": N || undefined,
|
|
1617
|
-
childrenStart: !!g &&
|
|
1618
|
-
activeItemId:
|
|
1619
|
-
filterA11yId:
|
|
1620
|
-
filterKeyword:
|
|
1621
|
-
hasChildren:
|
|
1622
|
-
return
|
|
1721
|
+
childrenStart: !!g && t().createElement(dr, {
|
|
1722
|
+
activeItemId: Ce,
|
|
1723
|
+
filterA11yId: Ir,
|
|
1724
|
+
filterKeyword: Te,
|
|
1725
|
+
hasChildren: on.some((function(e) {
|
|
1726
|
+
return lr(e);
|
|
1623
1727
|
})),
|
|
1624
1728
|
inputId: x,
|
|
1625
1729
|
inputRef: j,
|
|
1626
|
-
menuListboxId:
|
|
1730
|
+
menuListboxId: xe,
|
|
1627
1731
|
multiple: N,
|
|
1628
|
-
onClearAll:
|
|
1629
|
-
onSelectAll:
|
|
1630
|
-
onTextBlur:
|
|
1631
|
-
onTextChange:
|
|
1632
|
-
onTextFocus:
|
|
1633
|
-
onTextKeyDown:
|
|
1634
|
-
optionSelection:
|
|
1635
|
-
placement:
|
|
1636
|
-
selectAllAppearance:
|
|
1637
|
-
textHasFocus:
|
|
1732
|
+
onClearAll: Xr,
|
|
1733
|
+
onSelectAll: $r,
|
|
1734
|
+
onTextBlur: en,
|
|
1735
|
+
onTextChange: Yr,
|
|
1736
|
+
onTextFocus: Zr,
|
|
1737
|
+
onTextKeyDown: Jr,
|
|
1738
|
+
optionSelection: Pr,
|
|
1739
|
+
placement: i,
|
|
1740
|
+
selectAllAppearance: ie,
|
|
1741
|
+
textHasFocus: $e
|
|
1638
1742
|
}),
|
|
1639
1743
|
focusMode: g ? "never" : undefined,
|
|
1640
|
-
isLoading:
|
|
1641
|
-
labelledBy: "".concat(
|
|
1744
|
+
isLoading: E,
|
|
1745
|
+
labelledBy: "".concat(Ir !== null && Ir !== void 0 ? Ir : "", " ").concat(o !== null && o !== void 0 ? o : "").trim(),
|
|
1642
1746
|
// NVDA ignores aria-labelledby attribute on popover, but reads it on menu
|
|
1643
|
-
menuId:
|
|
1644
|
-
onScrollBottom:
|
|
1645
|
-
placement:
|
|
1646
|
-
noOptionsMessage:
|
|
1747
|
+
menuId: xe,
|
|
1748
|
+
onScrollBottom: $ ? Ur : undefined,
|
|
1749
|
+
placement: i !== null && i !== void 0 ? i : undefined,
|
|
1750
|
+
noOptionsMessage: H,
|
|
1647
1751
|
footerMessage: S,
|
|
1648
1752
|
animateLoading: a,
|
|
1649
1753
|
loadingMessage: I,
|
|
1650
|
-
onScroll:
|
|
1754
|
+
onScroll: W,
|
|
1651
1755
|
style: u,
|
|
1652
1756
|
tabIndex: c
|
|
1653
1757
|
};
|
|
1654
|
-
if (
|
|
1758
|
+
if (de) {
|
|
1655
1759
|
|
|
1656
|
-
return
|
|
1657
|
-
virtualization:
|
|
1658
|
-
}, s),
|
|
1760
|
+
return t().createElement(C.VirtualizedResultsMenu, Be({
|
|
1761
|
+
virtualization: de
|
|
1762
|
+
}, s), on);
|
|
1659
1763
|
}
|
|
1660
1764
|
|
|
1661
|
-
return
|
|
1765
|
+
return t().createElement(k(), s, on);
|
|
1662
1766
|
};
|
|
1663
|
-
var
|
|
1767
|
+
var cn = (0, n.useMemo)((function() {
|
|
1664
1768
|
|
|
1665
|
-
return
|
|
1666
|
-
appearance:
|
|
1769
|
+
return t().createElement(br, Be({
|
|
1770
|
+
appearance: o,
|
|
1667
1771
|
append: u,
|
|
1668
|
-
currentValues:
|
|
1772
|
+
currentValues: Br,
|
|
1669
1773
|
"data-test": N ? "multiselect" : "select",
|
|
1670
1774
|
describedBy: v,
|
|
1671
1775
|
disabled: b,
|
|
1672
|
-
elementRef:
|
|
1776
|
+
elementRef: tn,
|
|
1673
1777
|
error: y,
|
|
1674
1778
|
inline: O,
|
|
1675
1779
|
labelText: A,
|
|
1676
|
-
labelledBy:
|
|
1780
|
+
labelledBy: P,
|
|
1677
1781
|
multiple: N,
|
|
1678
|
-
onClick:
|
|
1679
|
-
placeholder:
|
|
1680
|
-
prefixLabel:
|
|
1681
|
-
prepend:
|
|
1682
|
-
required:
|
|
1683
|
-
suffixLabel:
|
|
1684
|
-
toggle:
|
|
1685
|
-
toggleContent:
|
|
1686
|
-
maxLabelItems:
|
|
1687
|
-
},
|
|
1688
|
-
}), [
|
|
1782
|
+
onClick: Rr ? undefined : U,
|
|
1783
|
+
placeholder: ee,
|
|
1784
|
+
prefixLabel: re,
|
|
1785
|
+
prepend: ne,
|
|
1786
|
+
required: Y,
|
|
1787
|
+
suffixLabel: ce,
|
|
1788
|
+
toggle: pe,
|
|
1789
|
+
toggleContent: be,
|
|
1790
|
+
maxLabelItems: ye
|
|
1791
|
+
}, ge), s);
|
|
1792
|
+
}), [ o, u, Br, N, v, b, tn, y, O, A, P, Rr, U, ee, re, ne, Y, ce, pe, be, ye, ge, s ]);
|
|
1689
1793
|
|
|
1690
|
-
return
|
|
1691
|
-
closeReasons:
|
|
1794
|
+
return t().createElement(h(), {
|
|
1795
|
+
closeReasons: tr,
|
|
1692
1796
|
inputId: x,
|
|
1693
|
-
"aria-labelledby":
|
|
1694
|
-
toggle:
|
|
1695
|
-
onRequestOpen:
|
|
1696
|
-
onRequestClose:
|
|
1697
|
-
open:
|
|
1698
|
-
openWithArrowKeys:
|
|
1699
|
-
repositionMode:
|
|
1797
|
+
"aria-labelledby": Ir,
|
|
1798
|
+
toggle: cn,
|
|
1799
|
+
onRequestOpen: Fr,
|
|
1800
|
+
onRequestClose: Hr,
|
|
1801
|
+
open: Fe,
|
|
1802
|
+
openWithArrowKeys: !Rr,
|
|
1803
|
+
repositionMode: le,
|
|
1700
1804
|
defaultPlacement: d,
|
|
1701
|
-
canCoverAnchor:
|
|
1805
|
+
canCoverAnchor: Le().innerHeight < 500,
|
|
1702
1806
|
retainFocus: false,
|
|
1703
|
-
takeFocus:
|
|
1704
|
-
},
|
|
1807
|
+
takeFocus: Br.length === 0 || Br.length > 0 && !ln || !!g
|
|
1808
|
+
}, un);
|
|
1705
1809
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
/* harmony default export */ const
|
|
1810
|
+
yr.propTypes = er;
|
|
1811
|
+
yr.componentType = "SelectBase";
|
|
1812
|
+
yr.Option = J;
|
|
1813
|
+
yr.Divider = w.Divider;
|
|
1814
|
+
yr.Heading = w.Heading;
|
|
1815
|
+
/* harmony default export */ const gr = yr;
|
|
1712
1816
|
// CONCATENATED MODULE: ./src/SelectBase/index.ts
|
|
1713
1817
|
module.exports = r;
|
|
1714
1818
|
/******/})();
|