@splunk/react-ui 4.38.0 → 4.39.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 +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Select.js
CHANGED
|
@@ -61,25 +61,25 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
Divider: () => /* reexport */
|
|
65
|
-
Heading: () => /* reexport */
|
|
66
|
-
Option: () => /* reexport */
|
|
67
|
-
default: () => /* reexport */
|
|
64
|
+
Divider: () => /* reexport */ M.Divider,
|
|
65
|
+
Heading: () => /* reexport */ M.Heading,
|
|
66
|
+
Option: () => /* reexport */ zt,
|
|
67
|
+
default: () => /* reexport */ fn
|
|
68
68
|
});
|
|
69
69
|
// CONCATENATED MODULE: external "react"
|
|
70
70
|
const n = require("react");
|
|
71
71
|
var r = e.n(n);
|
|
72
72
|
// CONCATENATED MODULE: external "prop-types"
|
|
73
73
|
const o = require("prop-types");
|
|
74
|
-
var
|
|
74
|
+
var l = e.n(o);
|
|
75
75
|
// CONCATENATED MODULE: external "lodash/has"
|
|
76
|
-
const
|
|
77
|
-
var
|
|
76
|
+
const i = require("lodash/has");
|
|
77
|
+
var a = e.n(i);
|
|
78
78
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
79
|
-
const
|
|
79
|
+
const u = require("@splunk/ui-utils/i18n");
|
|
80
80
|
// CONCATENATED MODULE: external "lodash/castArray"
|
|
81
|
-
const
|
|
82
|
-
var
|
|
81
|
+
const c = require("lodash/castArray");
|
|
82
|
+
var s = e.n(c);
|
|
83
83
|
// CONCATENATED MODULE: external "lodash/find"
|
|
84
84
|
const p = require("lodash/find");
|
|
85
85
|
var f = e.n(p);
|
|
@@ -90,268 +90,251 @@
|
|
|
90
90
|
const h = require("lodash/includes");
|
|
91
91
|
var b = e.n(h);
|
|
92
92
|
// CONCATENATED MODULE: external "lodash/isUndefined"
|
|
93
|
-
const
|
|
94
|
-
var
|
|
93
|
+
const y = require("lodash/isUndefined");
|
|
94
|
+
var m = e.n(y);
|
|
95
95
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
96
96
|
const g = require("lodash/keys");
|
|
97
97
|
var O = e.n(g);
|
|
98
98
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
99
|
-
const
|
|
100
|
-
var
|
|
99
|
+
const w = require("lodash/memoize");
|
|
100
|
+
var S = e.n(w);
|
|
101
101
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
102
|
-
const
|
|
103
|
-
var
|
|
102
|
+
const C = require("lodash/omit");
|
|
103
|
+
var x = e.n(C);
|
|
104
104
|
// CONCATENATED MODULE: external "lodash/pick"
|
|
105
105
|
const k = require("lodash/pick");
|
|
106
|
-
var
|
|
106
|
+
var j = e.n(k);
|
|
107
107
|
// CONCATENATED MODULE: external "lodash/uniq"
|
|
108
|
-
const
|
|
109
|
-
var
|
|
108
|
+
const P = require("lodash/uniq");
|
|
109
|
+
var E = e.n(P);
|
|
110
110
|
// CONCATENATED MODULE: external "lodash/without"
|
|
111
|
-
const
|
|
112
|
-
var
|
|
111
|
+
const I = require("lodash/without");
|
|
112
|
+
var T = e.n(I);
|
|
113
113
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
114
|
-
const
|
|
114
|
+
const A = require("@splunk/ui-utils/id");
|
|
115
115
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
116
|
-
const
|
|
116
|
+
const M = require("@splunk/react-ui/Menu");
|
|
117
117
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
118
|
-
const
|
|
119
|
-
var V = e.n(
|
|
118
|
+
const _ = require("@splunk/react-ui/Dropdown");
|
|
119
|
+
var V = e.n(_);
|
|
120
120
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
121
|
-
const
|
|
121
|
+
const q = require("@splunk/ui-utils/keyboard");
|
|
122
122
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
123
|
-
const
|
|
123
|
+
const R = require("@splunk/ui-utils/filter");
|
|
124
124
|
// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
125
125
|
const L = require("@splunk/react-ui/Link");
|
|
126
|
-
var
|
|
126
|
+
var D = e.n(L);
|
|
127
127
|
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
128
|
-
const
|
|
129
|
-
var
|
|
128
|
+
const B = require("@splunk/react-ui/ResultsMenu");
|
|
129
|
+
var K = e.n(B);
|
|
130
130
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
131
|
-
const
|
|
132
|
-
var F = e.n(
|
|
131
|
+
const N = require("@splunk/react-ui/Text");
|
|
132
|
+
var F = e.n(N);
|
|
133
133
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
134
134
|
const H = require("@splunk/react-icons/CaretSmallDown");
|
|
135
|
-
var
|
|
135
|
+
var z = e.n(H);
|
|
136
136
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
137
|
-
const
|
|
138
|
-
var W = e.n(
|
|
137
|
+
const $ = require("@splunk/react-icons/enterprise/Caret");
|
|
138
|
+
var W = e.n($);
|
|
139
139
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
140
140
|
const U = require("@splunk/themes");
|
|
141
141
|
// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
142
|
-
var
|
|
142
|
+
var J = function e() {
|
|
143
143
|
var t = (0, U.useSplunkTheme)(), n = t.isEnterprise;
|
|
144
144
|
var o = n ? r().createElement(W(), {
|
|
145
145
|
screenReaderText: null,
|
|
146
146
|
hideDefaultTooltip: true,
|
|
147
147
|
size: .5
|
|
148
|
-
}) : r().createElement(
|
|
148
|
+
}) : r().createElement(z(), null);
|
|
149
149
|
return o;
|
|
150
150
|
};
|
|
151
|
-
/* harmony default export */ const
|
|
151
|
+
/* harmony default export */ const X = J;
|
|
152
152
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
153
|
-
const
|
|
154
|
-
var
|
|
153
|
+
const G = require("@splunk/react-icons/enterprise/Search");
|
|
154
|
+
var Q = e.n(G);
|
|
155
155
|
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
156
|
-
const
|
|
157
|
-
var Z = e.n(
|
|
156
|
+
const Y = require("@splunk/react-icons/Magnifier");
|
|
157
|
+
var Z = e.n(Y);
|
|
158
158
|
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
159
159
|
var ee = function e() {
|
|
160
160
|
var t = (0, U.useSplunkTheme)(), n = t.isEnterprise, o = t.isCompact;
|
|
161
|
-
var
|
|
162
|
-
var
|
|
163
|
-
var
|
|
161
|
+
var l = (0, u._)("Search");
|
|
162
|
+
var i = o ? "20px" : "24px";
|
|
163
|
+
var a = n ? r().createElement(Q(), {
|
|
164
164
|
role: "presentation",
|
|
165
165
|
size: "16px",
|
|
166
|
-
screenReaderText:
|
|
166
|
+
screenReaderText: l,
|
|
167
167
|
hideDefaultTooltip: true
|
|
168
168
|
}) : r().createElement(Z(), {
|
|
169
169
|
role: "presentation",
|
|
170
|
-
"aria-label":
|
|
171
|
-
width:
|
|
172
|
-
height:
|
|
170
|
+
"aria-label": l,
|
|
171
|
+
width: i,
|
|
172
|
+
height: i
|
|
173
173
|
});
|
|
174
|
-
return
|
|
174
|
+
return a;
|
|
175
175
|
};
|
|
176
176
|
/* harmony default export */ const te = ee;
|
|
177
177
|
// CONCATENATED MODULE: ./src/Select/OptionBase.tsx
|
|
178
178
|
function ne(e) {
|
|
179
179
|
"@babel/helpers - typeof";
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
ne = function e(t) {
|
|
186
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
return ne(e);
|
|
180
|
+
return ne = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
181
|
+
return typeof e;
|
|
182
|
+
} : function(e) {
|
|
183
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
184
|
+
}, ne(e);
|
|
190
185
|
}
|
|
191
186
|
function re() {
|
|
192
|
-
re = Object.assign
|
|
187
|
+
return re = Object.assign ? Object.assign.bind() : function(e) {
|
|
193
188
|
for (var t = 1; t < arguments.length; t++) {
|
|
194
189
|
var n = arguments[t];
|
|
195
190
|
for (var r in n) {
|
|
196
|
-
|
|
197
|
-
e[r] = n[r];
|
|
198
|
-
}
|
|
191
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
199
192
|
}
|
|
200
193
|
}
|
|
201
194
|
return e;
|
|
202
|
-
};
|
|
203
|
-
return re.apply(this, arguments);
|
|
195
|
+
}, re.apply(null, arguments);
|
|
204
196
|
}
|
|
205
197
|
function oe(e, t) {
|
|
206
|
-
if (
|
|
207
|
-
var n =
|
|
208
|
-
var r, o;
|
|
198
|
+
if (null == e) return {};
|
|
199
|
+
var n, r, o = le(e, t);
|
|
209
200
|
if (Object.getOwnPropertySymbols) {
|
|
210
|
-
var
|
|
211
|
-
for (
|
|
212
|
-
|
|
213
|
-
if (t.indexOf(r) >= 0) continue;
|
|
214
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
215
|
-
n[r] = e[r];
|
|
201
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
202
|
+
for (r = 0; r < l.length; r++) {
|
|
203
|
+
n = l[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
216
204
|
}
|
|
217
205
|
}
|
|
218
|
-
return
|
|
206
|
+
return o;
|
|
219
207
|
}
|
|
220
|
-
function
|
|
221
|
-
if (
|
|
208
|
+
function le(e, t) {
|
|
209
|
+
if (null == e) return {};
|
|
222
210
|
var n = {};
|
|
223
|
-
var r
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
n[o] = e[o];
|
|
211
|
+
for (var r in e) {
|
|
212
|
+
if ({}.hasOwnProperty.call(e, r)) {
|
|
213
|
+
if (t.includes(r)) continue;
|
|
214
|
+
n[r] = e[r];
|
|
215
|
+
}
|
|
229
216
|
}
|
|
230
217
|
return n;
|
|
231
218
|
}
|
|
232
|
-
function
|
|
233
|
-
if (!(e instanceof t))
|
|
234
|
-
throw new TypeError("Cannot call a class as a function");
|
|
235
|
-
}
|
|
219
|
+
function ie(e, t) {
|
|
220
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
236
221
|
}
|
|
237
|
-
function
|
|
222
|
+
function ae(e, t) {
|
|
238
223
|
for (var n = 0; n < t.length; n++) {
|
|
239
224
|
var r = t[n];
|
|
240
|
-
r.enumerable = r.enumerable ||
|
|
241
|
-
r.
|
|
242
|
-
if ("value" in r) r.writable = true;
|
|
243
|
-
Object.defineProperty(e, r.key, r);
|
|
225
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
226
|
+
Object.defineProperty(e, ye(r.key), r);
|
|
244
227
|
}
|
|
245
228
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
229
|
+
function ue(e, t, n) {
|
|
230
|
+
return t && ae(e.prototype, t), n && ae(e, n), Object.defineProperty(e, "prototype", {
|
|
231
|
+
writable: !1
|
|
232
|
+
}), e;
|
|
250
233
|
}
|
|
251
|
-
function
|
|
252
|
-
if (typeof t !== "
|
|
253
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
254
|
-
}
|
|
234
|
+
function ce(e, t) {
|
|
235
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
255
236
|
e.prototype = Object.create(t && t.prototype, {
|
|
256
237
|
constructor: {
|
|
257
238
|
value: e,
|
|
258
|
-
writable:
|
|
259
|
-
configurable:
|
|
239
|
+
writable: !0,
|
|
240
|
+
configurable: !0
|
|
260
241
|
}
|
|
261
|
-
})
|
|
262
|
-
|
|
242
|
+
}), Object.defineProperty(e, "prototype", {
|
|
243
|
+
writable: !1
|
|
244
|
+
}), t && se(e, t);
|
|
263
245
|
}
|
|
264
|
-
function
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
};
|
|
269
|
-
return ue(e, t);
|
|
246
|
+
function se(e, t) {
|
|
247
|
+
return se = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
248
|
+
return e.__proto__ = t, e;
|
|
249
|
+
}, se(e, t);
|
|
270
250
|
}
|
|
271
251
|
function pe(e) {
|
|
272
252
|
var t = ve();
|
|
273
|
-
return function
|
|
274
|
-
var r = he(e)
|
|
253
|
+
return function() {
|
|
254
|
+
var n, r = he(e);
|
|
275
255
|
if (t) {
|
|
276
|
-
var
|
|
277
|
-
|
|
278
|
-
} else
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
return fe(this, o);
|
|
256
|
+
var o = he(this).constructor;
|
|
257
|
+
n = Reflect.construct(r, arguments, o);
|
|
258
|
+
} else n = r.apply(this, arguments);
|
|
259
|
+
return fe(this, n);
|
|
282
260
|
};
|
|
283
261
|
}
|
|
284
262
|
function fe(e, t) {
|
|
285
|
-
if (t && (ne(t)
|
|
286
|
-
|
|
287
|
-
}
|
|
263
|
+
if (t && ("object" == ne(t) || "function" == typeof t)) return t;
|
|
264
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
288
265
|
return de(e);
|
|
289
266
|
}
|
|
290
267
|
function de(e) {
|
|
291
|
-
if (
|
|
292
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
293
|
-
}
|
|
268
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
294
269
|
return e;
|
|
295
270
|
}
|
|
296
271
|
function ve() {
|
|
297
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
298
|
-
if (Reflect.construct.sham) return false;
|
|
299
|
-
if (typeof Proxy === "function") return true;
|
|
300
272
|
try {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
return
|
|
305
|
-
}
|
|
273
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
274
|
+
} catch (e) {}
|
|
275
|
+
return (ve = function t() {
|
|
276
|
+
return !!e;
|
|
277
|
+
})();
|
|
306
278
|
}
|
|
307
279
|
function he(e) {
|
|
308
|
-
he = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
309
|
-
return
|
|
310
|
-
};
|
|
311
|
-
return he(e);
|
|
280
|
+
return he = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
281
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
282
|
+
}, he(e);
|
|
312
283
|
}
|
|
313
284
|
function be(e, t, n) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
285
|
+
return (t = ye(t)) in e ? Object.defineProperty(e, t, {
|
|
286
|
+
value: n,
|
|
287
|
+
enumerable: !0,
|
|
288
|
+
configurable: !0,
|
|
289
|
+
writable: !0
|
|
290
|
+
}) : e[t] = n, e;
|
|
291
|
+
}
|
|
292
|
+
function ye(e) {
|
|
293
|
+
var t = me(e, "string");
|
|
294
|
+
return "symbol" == ne(t) ? t : t + "";
|
|
295
|
+
}
|
|
296
|
+
function me(e, t) {
|
|
297
|
+
if ("object" != ne(e) || !e) return e;
|
|
298
|
+
var n = e[Symbol.toPrimitive];
|
|
299
|
+
if (void 0 !== n) {
|
|
300
|
+
var r = n.call(e, t || "default");
|
|
301
|
+
if ("object" != ne(r)) return r;
|
|
302
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
323
303
|
}
|
|
324
|
-
return e;
|
|
304
|
+
return ("string" === t ? String : Number)(e);
|
|
325
305
|
}
|
|
326
|
-
var
|
|
306
|
+
var ge = {
|
|
327
307
|
/** @private */
|
|
328
|
-
active:
|
|
329
|
-
children:
|
|
330
|
-
description:
|
|
331
|
-
descriptionPosition:
|
|
332
|
-
disabled:
|
|
333
|
-
hidden:
|
|
334
|
-
icon:
|
|
335
|
-
label:
|
|
308
|
+
active: l().bool,
|
|
309
|
+
children: l().node,
|
|
310
|
+
description: l().string,
|
|
311
|
+
descriptionPosition: l().oneOf([ "right", "bottom" ]),
|
|
312
|
+
disabled: l().bool,
|
|
313
|
+
hidden: l().bool,
|
|
314
|
+
icon: l().node,
|
|
315
|
+
label: l().string.isRequired,
|
|
336
316
|
/**
|
|
337
317
|
* @private Passed down from <BaseSelect>
|
|
338
318
|
*/
|
|
339
|
-
multiple:
|
|
340
|
-
matchRanges:
|
|
341
|
-
start:
|
|
342
|
-
end:
|
|
319
|
+
multiple: l().bool,
|
|
320
|
+
matchRanges: l().arrayOf(l().shape({
|
|
321
|
+
start: l().number.isRequired,
|
|
322
|
+
end: l().number.isRequired
|
|
343
323
|
})),
|
|
344
324
|
/** @private */
|
|
345
|
-
onClick:
|
|
325
|
+
onClick: l().func,
|
|
326
|
+
/** @private */
|
|
327
|
+
role: l().oneOf([ "menuitemcheckbox", "option" ]),
|
|
346
328
|
/** @private */
|
|
347
|
-
selected:
|
|
348
|
-
truncate:
|
|
349
|
-
value:
|
|
329
|
+
selected: l().oneOfType([ l().bool, l().oneOf([ "some" ]) ]),
|
|
330
|
+
truncate: l().bool,
|
|
331
|
+
value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
|
|
350
332
|
};
|
|
351
|
-
var
|
|
333
|
+
var Oe = {
|
|
352
334
|
descriptionPosition: "bottom",
|
|
353
335
|
disabled: false,
|
|
354
336
|
multiple: false,
|
|
337
|
+
role: "option",
|
|
355
338
|
selected: false,
|
|
356
339
|
truncate: false
|
|
357
340
|
};
|
|
@@ -359,20 +342,20 @@
|
|
|
359
342
|
* An option within a `Multiselect`. This inherits from
|
|
360
343
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
361
344
|
* so any elements passed to it must also be pure.
|
|
362
|
-
*/ var
|
|
363
|
-
|
|
345
|
+
*/ var we = function(e) {
|
|
346
|
+
ce(n, e);
|
|
364
347
|
var t = pe(n);
|
|
365
348
|
function n() {
|
|
366
349
|
var e;
|
|
367
|
-
|
|
368
|
-
for (var r = arguments.length, o = new Array(r),
|
|
369
|
-
o[
|
|
350
|
+
ie(this, n);
|
|
351
|
+
for (var r = arguments.length, o = new Array(r), l = 0; l < r; l++) {
|
|
352
|
+
o[l] = arguments[l];
|
|
370
353
|
}
|
|
371
354
|
e = t.call.apply(t, [ this ].concat(o));
|
|
372
355
|
be(de(e), "c", null);
|
|
373
356
|
be(de(e), "handleClick", (function(t) {
|
|
374
|
-
var n = e.props, r = n.onClick, o = n.value,
|
|
375
|
-
if (!
|
|
357
|
+
var n = e.props, r = n.onClick, o = n.value, l = n.disabled;
|
|
358
|
+
if (!l) {
|
|
376
359
|
r === null || r === void 0 ? void 0 : r(t, {
|
|
377
360
|
value: o
|
|
378
361
|
});
|
|
@@ -383,15 +366,19 @@
|
|
|
383
366
|
}));
|
|
384
367
|
return e;
|
|
385
368
|
}
|
|
386
|
-
|
|
369
|
+
// @docs-props-type OptionPropsBase
|
|
370
|
+
ue(n, [ {
|
|
387
371
|
key: "scrollIntoViewIfNeeded",
|
|
372
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
388
373
|
value: function e() {
|
|
389
374
|
var t;
|
|
390
375
|
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
391
376
|
}
|
|
392
377
|
/**
|
|
393
378
|
* Place focus on the button.
|
|
394
|
-
*/
|
|
379
|
+
*/
|
|
380
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
381
|
+
}, {
|
|
395
382
|
key: "focus",
|
|
396
383
|
value: function e() {
|
|
397
384
|
var t;
|
|
@@ -400,278 +387,73 @@
|
|
|
400
387
|
}, {
|
|
401
388
|
key: "render",
|
|
402
389
|
value: function e() {
|
|
403
|
-
var t = this.props, n = t.value, o = t.children,
|
|
390
|
+
var t = this.props, n = t.value, o = t.children, l = t.label, i = t.multiple, a = t.role, u = t.icon, c = oe(t, [ "value", "children", "label", "multiple", "role", "icon" ]);
|
|
391
|
+
var s = n.toString();
|
|
404
392
|
|
|
405
|
-
return r().createElement(
|
|
393
|
+
return r().createElement(M.Item, re({
|
|
406
394
|
"data-test-value": n,
|
|
407
395
|
"data-test": "option",
|
|
408
396
|
ref: this.handleMount
|
|
409
|
-
},
|
|
397
|
+
}, c, {
|
|
410
398
|
selectable: true,
|
|
411
|
-
selectableAppearance:
|
|
399
|
+
selectableAppearance: i ? "checkbox" : "checkmark",
|
|
412
400
|
onClick: this.handleClick,
|
|
413
|
-
role:
|
|
414
|
-
value:
|
|
415
|
-
|
|
401
|
+
role: a,
|
|
402
|
+
value: s,
|
|
403
|
+
startAdornment: u
|
|
404
|
+
}), o || l);
|
|
416
405
|
}
|
|
417
406
|
} ]);
|
|
418
407
|
return n;
|
|
419
408
|
}(n.PureComponent);
|
|
420
|
-
be(
|
|
421
|
-
be(
|
|
422
|
-
be(
|
|
423
|
-
/* harmony default export */ const
|
|
424
|
-
// CONCATENATED MODULE: external "styled-components"
|
|
425
|
-
const Se = require("styled-components");
|
|
426
|
-
var we = e.n(Se);
|
|
427
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
428
|
-
const xe = require("@splunk/react-ui/Clickable");
|
|
429
|
-
var Ce = e.n(xe);
|
|
430
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
431
|
-
const ke = require("@splunk/react-ui/Switch");
|
|
432
|
-
var Ie = e.n(ke);
|
|
433
|
-
// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
434
|
-
var _e = (0, Se.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
|
|
435
|
-
U.pick)({
|
|
436
|
-
prisma: U.variables.contentColorDefault,
|
|
437
|
-
enterprise: U.variables.textGray
|
|
438
|
-
}), U.variables.fontSizeSmall, (0, U.pick)({
|
|
439
|
-
prisma: "16px"
|
|
440
|
-
}));
|
|
441
|
-
var Ae = we().span.withConfig({
|
|
442
|
-
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
443
|
-
componentId: "sc-4kc053-0"
|
|
444
|
-
})([ "", ";display:block;" ], _e);
|
|
445
|
-
var je = we().span.withConfig({
|
|
446
|
-
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
447
|
-
componentId: "sc-4kc053-1"
|
|
448
|
-
})([ "", ";float:right;", " max-width:50%;text-align:right;box-sizing:border-box;" ], _e, (0,
|
|
449
|
-
U.pick)({
|
|
450
|
-
enterprise: (0, Se.css)([ "padding-left:", ";" ], U.variables.spacingLarge)
|
|
451
|
-
}));
|
|
452
|
-
var Ee = we().div.withConfig({
|
|
453
|
-
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
454
|
-
componentId: "sc-4kc053-2"
|
|
455
|
-
})([ "position:absolute;", " color:", ";" ], (0, U.pick)({
|
|
456
|
-
prisma: (0, Se.css)([ "right:16px;" ]),
|
|
457
|
-
enterprise: (0, Se.css)([ "right:3px;left:8px;" ])
|
|
458
|
-
}), (0, U.pick)({
|
|
459
|
-
prisma: U.variables.contentColorActive,
|
|
460
|
-
enterprise: U.variables.accentColorL10
|
|
461
|
-
}));
|
|
462
|
-
var Me = we().span.withConfig({
|
|
463
|
-
displayName: "ItemStyles__StyledItemIcon",
|
|
464
|
-
componentId: "sc-4kc053-3"
|
|
465
|
-
})([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
|
|
466
|
-
U.pick)({
|
|
467
|
-
prisma: "8px",
|
|
468
|
-
enterprise: "3px"
|
|
469
|
-
}), (0, U.pick)({
|
|
470
|
-
prisma: "initial",
|
|
471
|
-
enterprise: "middle"
|
|
472
|
-
}), (0, U.pick)({
|
|
473
|
-
prisma: (0, Se.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], U.variables.contentColorMuted),
|
|
474
|
-
enterprise: (0, Se.css)([ "transform:translateY(-1px);" ])
|
|
475
|
-
}));
|
|
476
|
-
var Te = we()(Ce()).withConfig({
|
|
477
|
-
displayName: "ItemStyles__StyledClickable",
|
|
478
|
-
componentId: "sc-4kc053-4"
|
|
479
|
-
})([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled],[aria-disabled='true']){&:hover{background:", ";", "}", " ", "}&:focus{outline:0;box-shadow:", ";", "}&[disabled],&[aria-disabled='true']{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
|
|
480
|
-
U.pick)({
|
|
481
|
-
prisma: U.variables.contentColorActive,
|
|
482
|
-
enterprise: {
|
|
483
|
-
dark: U.variables.gray96,
|
|
484
|
-
light: U.variables.gray22
|
|
485
|
-
}
|
|
486
|
-
}), (0, U.pick)({
|
|
487
|
-
prisma: {
|
|
488
|
-
comfortable: "10px 16px",
|
|
489
|
-
compact: "6px 16px"
|
|
490
|
-
},
|
|
491
|
-
enterprise: "6px 10px"
|
|
492
|
-
}), (function(e) {
|
|
493
|
-
var t = e.$isSelectable, n = e.$selectableAppearance;
|
|
494
|
-
return t && (0, U.pick)({
|
|
495
|
-
prisma: (0, Se.css)([ "padding-right:44px;", "" ], (function() {
|
|
496
|
-
return n === "checkbox" && "padding-left: 42px;";
|
|
497
|
-
})),
|
|
498
|
-
enterprise: (0, Se.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
|
|
499
|
-
return n === "checkbox" ? "32px" : "28px";
|
|
500
|
-
}))
|
|
501
|
-
});
|
|
502
|
-
}), (function(e) {
|
|
503
|
-
var t = e.$active, n = e.$preventFocus;
|
|
504
|
-
return t && !n && (0, Se.css)([ "box-shadow:", ";" ], U.variables.focusShadowInset);
|
|
505
|
-
}), (function(e) {
|
|
506
|
-
var t = e.$active;
|
|
507
|
-
return t && (0, Se.css)([ "background:", ";font-weight:", ";" ], (0, U.pick)({
|
|
508
|
-
enterprise: {
|
|
509
|
-
light: U.variables.gray92,
|
|
510
|
-
dark: U.variables.gray22
|
|
511
|
-
},
|
|
512
|
-
prisma: U.variables.neutral100
|
|
513
|
-
}), U.variables.fontWeightBold);
|
|
514
|
-
}), (0, U.pick)({
|
|
515
|
-
prisma: U.variables.interactiveColorOverlayHover,
|
|
516
|
-
enterprise: U.variables.backgroundColorHover
|
|
517
|
-
}), (function(e) {
|
|
518
|
-
var t = e.$selected;
|
|
519
|
-
return t && (0, U.pick)({
|
|
520
|
-
prisma: (0, Se.css)([ "background:", ";" ], U.mixins.overlayColors(U.variables.interactiveColorOverlaySelected, U.variables.interactiveColorOverlayHover))
|
|
521
|
-
});
|
|
522
|
-
}), (0, U.pick)({
|
|
523
|
-
prisma: (0, Se.css)([ "&:active{background:", ";}" ], U.variables.interactiveColorOverlayActive)
|
|
524
|
-
}), (function(e) {
|
|
525
|
-
var t = e.$selected;
|
|
526
|
-
return t && (0, U.pick)({
|
|
527
|
-
prisma: (0, Se.css)([ "background:", ";&:active{background:", ";}" ], U.variables.interactiveColorOverlaySelected, U.mixins.overlayColors(U.variables.interactiveColorOverlaySelected, U.variables.interactiveColorOverlayActive))
|
|
528
|
-
});
|
|
529
|
-
}), U.variables.focusShadowInset, (0, U.pick)({
|
|
530
|
-
prisma: (0, Se.css)([ "background:", ";" ], U.variables.interactiveColorOverlayHover)
|
|
531
|
-
}), (0, U.pick)({
|
|
532
|
-
enterprise: {
|
|
533
|
-
light: U.variables.gray45,
|
|
534
|
-
dark: U.variables.contentColorDisabled
|
|
535
|
-
},
|
|
536
|
-
prisma: U.variables.contentColorDisabled
|
|
537
|
-
}),
|
|
538
|
-
/* sc-sel */
|
|
539
|
-
Ae,
|
|
540
|
-
/* sc-sel */
|
|
541
|
-
je,
|
|
542
|
-
/* sc-sel */
|
|
543
|
-
Ee, (0, U.pick)({
|
|
544
|
-
prisma: U.variables.contentColorDisabled,
|
|
545
|
-
enterprise: U.variables.gray80
|
|
546
|
-
}), (0, U.pick)({
|
|
547
|
-
prisma: (0, Se.css)([ "& > * > ", "{color:", ";}" ],
|
|
548
|
-
/* sc-sel */
|
|
549
|
-
Me, U.variables.contentColorDisabled)
|
|
550
|
-
}), (function(e) {
|
|
551
|
-
var t = e.$selected;
|
|
552
|
-
return t && (0, U.pick)({
|
|
553
|
-
prisma: (0, Se.css)([ "", "{color:", ";}" ],
|
|
554
|
-
/* sc-sel */
|
|
555
|
-
Me, U.variables.contentColorActive)
|
|
556
|
-
});
|
|
557
|
-
}));
|
|
558
|
-
var Pe = we()(Ie()).withConfig({
|
|
559
|
-
displayName: "ItemStyles__StyledSwitch",
|
|
560
|
-
componentId: "sc-4kc053-5"
|
|
561
|
-
})([ "position:absolute;left:", ";top:", ";" ], (0, U.pick)({
|
|
562
|
-
prisma: "16px",
|
|
563
|
-
enterprise: "8px"
|
|
564
|
-
}), (0, U.pick)({
|
|
565
|
-
prisma: "0px",
|
|
566
|
-
enterprise: {
|
|
567
|
-
comfortable: "-1px",
|
|
568
|
-
compact: "2px"
|
|
569
|
-
}
|
|
570
|
-
}));
|
|
571
|
-
var Ve = we().span.withConfig({
|
|
572
|
-
displayName: "ItemStyles__StyledInnerWrapper",
|
|
573
|
-
componentId: "sc-4kc053-6"
|
|
574
|
-
})([ "display:flex;align-items:flex-start;" ]);
|
|
575
|
-
var Re = we().span.withConfig({
|
|
576
|
-
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
577
|
-
componentId: "sc-4kc053-7"
|
|
578
|
-
})([ "display:flex;flex-wrap:wrap;flex-direction:column;max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
|
|
579
|
-
var t = e.$truncate;
|
|
580
|
-
return t && (0, Se.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
|
|
581
|
-
}));
|
|
582
|
-
var De = we().div.withConfig({
|
|
583
|
-
displayName: "ItemStyles__StyledLabel",
|
|
584
|
-
componentId: "sc-4kc053-8"
|
|
585
|
-
})([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
|
|
586
|
-
var t = e.$truncate;
|
|
587
|
-
return t && (0, Se.css)([ "display:block;clear:both;" ]);
|
|
588
|
-
}));
|
|
589
|
-
var Le = we().span.withConfig({
|
|
590
|
-
displayName: "ItemStyles__StyledMatch",
|
|
591
|
-
componentId: "sc-4kc053-9"
|
|
592
|
-
})([ "border-bottom:1px solid ", ";" ], (0, U.pick)({
|
|
593
|
-
prisma: U.variables.contentColorActive,
|
|
594
|
-
enterprise: {
|
|
595
|
-
dark: U.variables.gray96,
|
|
596
|
-
light: U.variables.gray45
|
|
597
|
-
}
|
|
598
|
-
}));
|
|
599
|
-
var qe = we().span.withConfig({
|
|
600
|
-
displayName: "ItemStyles__StyledSubmenu",
|
|
601
|
-
componentId: "sc-4kc053-10"
|
|
602
|
-
})([ "float:right;padding-left:", ";color:", ";", "" ], U.variables.spacingSmall, (0,
|
|
603
|
-
U.pick)({
|
|
604
|
-
prisma: "inherit",
|
|
605
|
-
enterprise: U.variables.textGray
|
|
606
|
-
}), (0, U.pick)({
|
|
607
|
-
prisma: (0, Se.css)([ "& > svg{width:20px;height:20px;}" ])
|
|
608
|
-
}));
|
|
609
|
-
// CONCATENATED MODULE: ./src/Select/SelectAllOptionStyles.ts
|
|
610
|
-
var Ne = we()(De).withConfig({
|
|
611
|
-
displayName: "SelectAllOptionStyles__StyledSelectAllLabel",
|
|
612
|
-
componentId: "y6bn08-0"
|
|
613
|
-
})([ "font-weight:", ";" ], U.variables.fontWeightBold);
|
|
614
|
-
var Be = we()(Oe).withConfig({
|
|
615
|
-
displayName: "SelectAllOptionStyles__StyledSelectAllOption",
|
|
616
|
-
componentId: "y6bn08-1"
|
|
617
|
-
})([ "padding-inline-start:", ";box-shadow:none;" ], (0, U.pick)({
|
|
618
|
-
prisma: "42px;",
|
|
619
|
-
enterprise: "32px;"
|
|
620
|
-
}));
|
|
409
|
+
be(we, "propTypes", ge);
|
|
410
|
+
be(we, "defaultProps", Oe);
|
|
411
|
+
be(we, "type", M.Item);
|
|
412
|
+
/* harmony default export */ const Se = we;
|
|
621
413
|
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
622
|
-
var
|
|
623
|
-
active:
|
|
624
|
-
elementRef:
|
|
625
|
-
id:
|
|
626
|
-
onClick:
|
|
627
|
-
selectAllLabel:
|
|
628
|
-
totalCount:
|
|
629
|
-
changedToggle:
|
|
630
|
-
selected:
|
|
414
|
+
var Ce = {
|
|
415
|
+
active: l().bool,
|
|
416
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
417
|
+
id: l().string,
|
|
418
|
+
onClick: l().func,
|
|
419
|
+
selectAllLabel: l().string,
|
|
420
|
+
totalCount: l().number,
|
|
421
|
+
changedToggle: l().bool,
|
|
422
|
+
selected: l().oneOf([ false, true, "some" ])
|
|
631
423
|
};
|
|
632
|
-
var
|
|
633
|
-
var n = e.active, o = e.id,
|
|
424
|
+
var xe = r().forwardRef((function(e, t) {
|
|
425
|
+
var n = e.active, o = e.id, l = e.onClick, i = e.selectAllLabel, a = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
634
426
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
635
|
-
var
|
|
427
|
+
var s = u ? " (".concat(a === null || a === void 0 ? void 0 : a.toString(), ")") : "";
|
|
636
428
|
|
|
637
|
-
return r().createElement(
|
|
638
|
-
label:
|
|
429
|
+
return r().createElement(Se, {
|
|
430
|
+
label: i,
|
|
639
431
|
value: "selectAll",
|
|
640
432
|
key: "selectAll",
|
|
641
|
-
onClick:
|
|
433
|
+
onClick: l,
|
|
642
434
|
"data-test": "select-all",
|
|
643
435
|
"aria-keyshortcuts": "Control+A",
|
|
644
436
|
id: o,
|
|
645
437
|
active: n,
|
|
646
438
|
ref: t,
|
|
647
|
-
tabIndex: -1
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
"aria-label": !u && (0, c._)("No options selected") || u === "some" && (0, c._)("Some options selected") || (0,
|
|
655
|
-
c._)("All options selected"),
|
|
656
|
-
"data-test": "select-all-switch",
|
|
657
|
-
selectedLabel: u === true ? (0, c._)("All options selected") : (0, c._)("Option selected"),
|
|
658
|
-
unselectedLabel: u === true ? (0, c._)("No options selected") : (0, c._)("Option unselected"),
|
|
659
|
-
someSelectedLabel: (0, c._)("Some options selected")
|
|
660
|
-
}), r().createElement(je, {
|
|
661
|
-
"data-test": "description"
|
|
662
|
-
}, "".concat(p, " Ctrl-a")), r().createElement(Ve, null, r().createElement(Re, {
|
|
663
|
-
$truncate: false
|
|
664
|
-
}, r().createElement(Ne, {
|
|
665
|
-
$truncate: false
|
|
666
|
-
}, a))));
|
|
439
|
+
tabIndex: -1,
|
|
440
|
+
selected: c,
|
|
441
|
+
description: "".concat(s, " Ctrl-a"),
|
|
442
|
+
descriptionPosition: "right",
|
|
443
|
+
multiple: true,
|
|
444
|
+
role: "menuitemcheckbox"
|
|
445
|
+
});
|
|
667
446
|
}));
|
|
668
|
-
|
|
669
|
-
/* harmony default export */ const
|
|
447
|
+
xe.propTypes = Ce;
|
|
448
|
+
/* harmony default export */ const ke = xe;
|
|
449
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
450
|
+
const je = require("styled-components");
|
|
451
|
+
var Pe = e.n(je);
|
|
670
452
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
671
|
-
const
|
|
672
|
-
var
|
|
453
|
+
const Ee = require("@splunk/react-ui/Button");
|
|
454
|
+
var Ie = e.n(Ee);
|
|
673
455
|
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
674
|
-
var
|
|
456
|
+
var Te = Pe()(Ie()).withConfig({
|
|
675
457
|
displayName: "SelectBaseStyles__StyledButton",
|
|
676
458
|
componentId: "sc-16cj7sk-0"
|
|
677
459
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -681,22 +463,22 @@
|
|
|
681
463
|
var t = e.$multiple;
|
|
682
464
|
return !t && "flex-grow: 0;";
|
|
683
465
|
}));
|
|
684
|
-
var
|
|
466
|
+
var Ae = Pe().span.withConfig({
|
|
685
467
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
686
468
|
componentId: "sc-16cj7sk-1"
|
|
687
469
|
})([ "padding-right:2px;" ]);
|
|
688
|
-
var
|
|
470
|
+
var Me = Pe().span.withConfig({
|
|
689
471
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
690
472
|
componentId: "sc-16cj7sk-2"
|
|
691
473
|
})([ "padding-left:2px;" ]);
|
|
692
|
-
var
|
|
474
|
+
var _e = Pe().div.withConfig({
|
|
693
475
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
694
476
|
componentId: "sc-16cj7sk-3"
|
|
695
477
|
})([ "padding:", ";min-width:160px;" ], (0, U.pick)({
|
|
696
478
|
enterprise: "8px",
|
|
697
479
|
prisma: "10px 16px"
|
|
698
480
|
}));
|
|
699
|
-
var
|
|
481
|
+
var Ve = Pe().span.withConfig({
|
|
700
482
|
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
701
483
|
componentId: "sc-16cj7sk-4"
|
|
702
484
|
})([ "color:", ";pointer-events:none;padding:", ";" ], (0, U.pick)({
|
|
@@ -709,18 +491,18 @@
|
|
|
709
491
|
comfortable: "0 8px",
|
|
710
492
|
compact: "0 6px"
|
|
711
493
|
}));
|
|
712
|
-
var
|
|
494
|
+
var qe = Pe().span.withConfig({
|
|
713
495
|
displayName: "SelectBaseStyles__StyledCount",
|
|
714
496
|
componentId: "sc-16cj7sk-5"
|
|
715
497
|
})([ "padding-right:", ";" ], U.variables.spacingXSmall);
|
|
716
|
-
var
|
|
498
|
+
var Re = Pe()(D()).withConfig({
|
|
717
499
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
718
500
|
componentId: "sc-16cj7sk-6"
|
|
719
501
|
})([ "margin-right:20px;", ";" ], (function(e) {
|
|
720
502
|
var t = e.$disabled;
|
|
721
|
-
return t && (0,
|
|
503
|
+
return t && (0, je.css)([ "color:", ";" ], U.variables.contentColorDisabled);
|
|
722
504
|
}));
|
|
723
|
-
var
|
|
505
|
+
var Le = Pe().div.withConfig({
|
|
724
506
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
725
507
|
componentId: "sc-16cj7sk-7"
|
|
726
508
|
})([ "padding:", ";", "" ], (0, U.pick)({
|
|
@@ -728,54 +510,54 @@
|
|
|
728
510
|
prisma: "10px 16px"
|
|
729
511
|
}), (0, U.pickVariant)("$placement", {
|
|
730
512
|
above: {
|
|
731
|
-
enterprise: (0,
|
|
732
|
-
prisma: (0,
|
|
513
|
+
enterprise: (0, je.css)([ "border-top:", ";" ], U.variables.border),
|
|
514
|
+
prisma: (0, je.css)([ "border-top:1px solid ", ";" ], U.variables.neutral200)
|
|
733
515
|
},
|
|
734
516
|
below: {
|
|
735
|
-
enterprise: (0,
|
|
736
|
-
prisma: (0,
|
|
517
|
+
enterprise: (0, je.css)([ "border-bottom:", ";" ], U.variables.border),
|
|
518
|
+
prisma: (0, je.css)([ "border-bottom:1px solid ", ";" ], U.variables.neutral200)
|
|
737
519
|
}
|
|
738
520
|
}));
|
|
739
521
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
740
522
|
// A utility for matching keyboard characters to list values
|
|
741
|
-
var
|
|
523
|
+
var De = function e(t, n) {
|
|
742
524
|
return t ? t.label.charAt(n).toLowerCase() : "";
|
|
743
525
|
};
|
|
744
|
-
var
|
|
526
|
+
var Be = function e(t, n) {
|
|
745
527
|
if (!t.length) {
|
|
746
528
|
return t;
|
|
747
529
|
}
|
|
748
530
|
var r = null;
|
|
749
531
|
var o = false;
|
|
750
|
-
var
|
|
751
|
-
var t =
|
|
532
|
+
var l = t.filter((function(e) {
|
|
533
|
+
var t = De(e, n.index);
|
|
752
534
|
if (t === n.value) {
|
|
753
535
|
o = true;
|
|
754
536
|
return true;
|
|
755
537
|
}
|
|
756
|
-
|
|
538
|
+
// If we haven't found a match yet, keep track of the next closest match.
|
|
757
539
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
758
540
|
if (!o) {
|
|
759
|
-
var
|
|
760
|
-
if (!
|
|
541
|
+
var l = De(r, n.index);
|
|
542
|
+
if (!l) {
|
|
761
543
|
r = e;
|
|
762
544
|
} else if (t > n.value) {
|
|
763
|
-
if (
|
|
545
|
+
if (l < n.value) {
|
|
764
546
|
r = e;
|
|
765
|
-
} else if (
|
|
547
|
+
} else if (l > t) {
|
|
766
548
|
r = e;
|
|
767
549
|
}
|
|
768
|
-
} else if (t >
|
|
550
|
+
} else if (t > l) {
|
|
769
551
|
r = e;
|
|
770
552
|
}
|
|
771
553
|
}
|
|
772
554
|
return false;
|
|
773
555
|
}));
|
|
774
|
-
return
|
|
556
|
+
return l.length === 0 && r ? [ r ] : l;
|
|
775
557
|
};
|
|
776
558
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
777
559
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
778
|
-
var
|
|
560
|
+
var Ke = {
|
|
779
561
|
body: {
|
|
780
562
|
appendChild: function e() {
|
|
781
563
|
return [];
|
|
@@ -829,14 +611,14 @@
|
|
|
829
611
|
search: ""
|
|
830
612
|
}
|
|
831
613
|
};
|
|
832
|
-
function
|
|
833
|
-
var e = typeof document !== "undefined" ? document :
|
|
614
|
+
function Ne() {
|
|
615
|
+
var e = typeof document !== "undefined" ? document : Ke;
|
|
834
616
|
return e;
|
|
835
617
|
}
|
|
836
618
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
837
619
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
838
|
-
var
|
|
839
|
-
document:
|
|
620
|
+
var Fe = {
|
|
621
|
+
document: Ke,
|
|
840
622
|
navigator: {
|
|
841
623
|
userAgent: ""
|
|
842
624
|
},
|
|
@@ -890,267 +672,243 @@
|
|
|
890
672
|
clearTimeout(t);
|
|
891
673
|
}
|
|
892
674
|
};
|
|
893
|
-
function
|
|
894
|
-
var e = typeof window !== "undefined" ? window :
|
|
675
|
+
function He() {
|
|
676
|
+
var e = typeof window !== "undefined" ? window : Fe;
|
|
895
677
|
return e;
|
|
896
678
|
}
|
|
897
679
|
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
898
|
-
function
|
|
899
|
-
|
|
680
|
+
function ze() {
|
|
681
|
+
return ze = Object.assign ? Object.assign.bind() : function(e) {
|
|
900
682
|
for (var t = 1; t < arguments.length; t++) {
|
|
901
683
|
var n = arguments[t];
|
|
902
684
|
for (var r in n) {
|
|
903
|
-
|
|
904
|
-
e[r] = n[r];
|
|
905
|
-
}
|
|
685
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
906
686
|
}
|
|
907
687
|
}
|
|
908
688
|
return e;
|
|
909
|
-
};
|
|
910
|
-
return at.apply(this, arguments);
|
|
689
|
+
}, ze.apply(null, arguments);
|
|
911
690
|
}
|
|
912
|
-
function
|
|
913
|
-
return
|
|
691
|
+
function $e(e, t) {
|
|
692
|
+
return Je(e) || Ue(e, t) || Qe(e, t) || We();
|
|
914
693
|
}
|
|
915
|
-
function
|
|
694
|
+
function We() {
|
|
916
695
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
917
696
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
var o = false;
|
|
923
|
-
var i = undefined;
|
|
924
|
-
try {
|
|
925
|
-
for (var a = e[Symbol.iterator](), l; !(r = (l = a.next()).done); r = true) {
|
|
926
|
-
n.push(l.value);
|
|
927
|
-
if (t && n.length === t) break;
|
|
928
|
-
}
|
|
929
|
-
} catch (e) {
|
|
930
|
-
o = true;
|
|
931
|
-
i = e;
|
|
932
|
-
} finally {
|
|
697
|
+
function Ue(e, t) {
|
|
698
|
+
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
699
|
+
if (null != n) {
|
|
700
|
+
var r, o, l, i, a = [], u = !0, c = !1;
|
|
933
701
|
try {
|
|
934
|
-
if (
|
|
702
|
+
if (l = (n = n.call(e)).next, 0 === t) {
|
|
703
|
+
if (Object(n) !== n) return;
|
|
704
|
+
u = !1;
|
|
705
|
+
} else for (;!(u = (r = l.call(n)).done) && (a.push(r.value), a.length !== t); u = !0) {
|
|
706
|
+
}
|
|
707
|
+
} catch (e) {
|
|
708
|
+
c = !0, o = e;
|
|
935
709
|
} finally {
|
|
936
|
-
|
|
710
|
+
try {
|
|
711
|
+
if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
|
|
712
|
+
} finally {
|
|
713
|
+
if (c) throw o;
|
|
714
|
+
}
|
|
937
715
|
}
|
|
716
|
+
return a;
|
|
938
717
|
}
|
|
939
|
-
return n;
|
|
940
718
|
}
|
|
941
|
-
function
|
|
719
|
+
function Je(e) {
|
|
942
720
|
if (Array.isArray(e)) return e;
|
|
943
721
|
}
|
|
944
|
-
function
|
|
945
|
-
return
|
|
722
|
+
function Xe(e) {
|
|
723
|
+
return Ze(e) || Ye(e) || Qe(e) || Ge();
|
|
946
724
|
}
|
|
947
|
-
function
|
|
725
|
+
function Ge() {
|
|
948
726
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
949
727
|
}
|
|
950
|
-
function
|
|
951
|
-
if (
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return bt(e, t);
|
|
728
|
+
function Qe(e, t) {
|
|
729
|
+
if (e) {
|
|
730
|
+
if ("string" == typeof e) return et(e, t);
|
|
731
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
732
|
+
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) ? et(e, t) : void 0;
|
|
733
|
+
}
|
|
957
734
|
}
|
|
958
|
-
function
|
|
959
|
-
if (typeof Symbol
|
|
735
|
+
function Ye(e) {
|
|
736
|
+
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
960
737
|
}
|
|
961
|
-
function
|
|
962
|
-
if (Array.isArray(e)) return
|
|
738
|
+
function Ze(e) {
|
|
739
|
+
if (Array.isArray(e)) return et(e);
|
|
963
740
|
}
|
|
964
|
-
function
|
|
965
|
-
|
|
966
|
-
for (var n = 0, r =
|
|
741
|
+
function et(e, t) {
|
|
742
|
+
(null == t || t > e.length) && (t = e.length);
|
|
743
|
+
for (var n = 0, r = Array(t); n < t; n++) {
|
|
967
744
|
r[n] = e[n];
|
|
968
745
|
}
|
|
969
746
|
return r;
|
|
970
747
|
}
|
|
971
|
-
function
|
|
972
|
-
if (!(e instanceof t))
|
|
973
|
-
throw new TypeError("Cannot call a class as a function");
|
|
974
|
-
}
|
|
748
|
+
function tt(e, t) {
|
|
749
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
975
750
|
}
|
|
976
|
-
function
|
|
751
|
+
function nt(e, t) {
|
|
977
752
|
for (var n = 0; n < t.length; n++) {
|
|
978
753
|
var r = t[n];
|
|
979
|
-
r.enumerable = r.enumerable ||
|
|
980
|
-
r.
|
|
981
|
-
if ("value" in r) r.writable = true;
|
|
982
|
-
Object.defineProperty(e, r.key, r);
|
|
754
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
755
|
+
Object.defineProperty(e, ht(r.key), r);
|
|
983
756
|
}
|
|
984
757
|
}
|
|
985
|
-
function
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
758
|
+
function rt(e, t, n) {
|
|
759
|
+
return t && nt(e.prototype, t), n && nt(e, n), Object.defineProperty(e, "prototype", {
|
|
760
|
+
writable: !1
|
|
761
|
+
}), e;
|
|
989
762
|
}
|
|
990
|
-
function
|
|
991
|
-
if (typeof t !== "
|
|
992
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
993
|
-
}
|
|
763
|
+
function ot(e, t) {
|
|
764
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
994
765
|
e.prototype = Object.create(t && t.prototype, {
|
|
995
766
|
constructor: {
|
|
996
767
|
value: e,
|
|
997
|
-
writable:
|
|
998
|
-
configurable:
|
|
768
|
+
writable: !0,
|
|
769
|
+
configurable: !0
|
|
999
770
|
}
|
|
1000
|
-
})
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
function St(e, t) {
|
|
1004
|
-
St = Object.setPrototypeOf || function e(t, n) {
|
|
1005
|
-
t.__proto__ = n;
|
|
1006
|
-
return t;
|
|
1007
|
-
};
|
|
1008
|
-
return St(e, t);
|
|
771
|
+
}), Object.defineProperty(e, "prototype", {
|
|
772
|
+
writable: !1
|
|
773
|
+
}), t && lt(e, t);
|
|
1009
774
|
}
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
775
|
+
function lt(e, t) {
|
|
776
|
+
return lt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
777
|
+
return e.__proto__ = t, e;
|
|
778
|
+
}, lt(e, t);
|
|
779
|
+
}
|
|
780
|
+
function it(e) {
|
|
781
|
+
var t = ct();
|
|
782
|
+
return function() {
|
|
783
|
+
var n, r = st(e);
|
|
1014
784
|
if (t) {
|
|
1015
|
-
var
|
|
1016
|
-
|
|
1017
|
-
} else
|
|
1018
|
-
|
|
1019
|
-
}
|
|
1020
|
-
return xt(this, o);
|
|
785
|
+
var o = st(this).constructor;
|
|
786
|
+
n = Reflect.construct(r, arguments, o);
|
|
787
|
+
} else n = r.apply(this, arguments);
|
|
788
|
+
return at(this, n);
|
|
1021
789
|
};
|
|
1022
790
|
}
|
|
1023
|
-
function
|
|
1024
|
-
if (t && (
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
return Ct(e);
|
|
791
|
+
function at(e, t) {
|
|
792
|
+
if (t && ("object" == pt(t) || "function" == typeof t)) return t;
|
|
793
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
794
|
+
return ut(e);
|
|
1028
795
|
}
|
|
1029
|
-
function
|
|
1030
|
-
if (
|
|
1031
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1032
|
-
}
|
|
796
|
+
function ut(e) {
|
|
797
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1033
798
|
return e;
|
|
1034
799
|
}
|
|
1035
|
-
function
|
|
1036
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
1037
|
-
if (Reflect.construct.sham) return false;
|
|
1038
|
-
if (typeof Proxy === "function") return true;
|
|
800
|
+
function ct() {
|
|
1039
801
|
try {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
return
|
|
1044
|
-
}
|
|
802
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
803
|
+
} catch (e) {}
|
|
804
|
+
return (ct = function t() {
|
|
805
|
+
return !!e;
|
|
806
|
+
})();
|
|
1045
807
|
}
|
|
1046
|
-
function
|
|
1047
|
-
|
|
1048
|
-
return
|
|
1049
|
-
};
|
|
1050
|
-
return It(e);
|
|
808
|
+
function st(e) {
|
|
809
|
+
return st = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
810
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
811
|
+
}, st(e);
|
|
1051
812
|
}
|
|
1052
|
-
function
|
|
813
|
+
function pt(e) {
|
|
1053
814
|
"@babel/helpers - typeof";
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
}
|
|
1059
|
-
_t = function e(t) {
|
|
1060
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1061
|
-
};
|
|
1062
|
-
}
|
|
1063
|
-
return _t(e);
|
|
815
|
+
return pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
816
|
+
return typeof e;
|
|
817
|
+
} : function(e) {
|
|
818
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
819
|
+
}, pt(e);
|
|
1064
820
|
}
|
|
1065
|
-
function
|
|
821
|
+
function ft(e, t) {
|
|
1066
822
|
var n = Object.keys(e);
|
|
1067
823
|
if (Object.getOwnPropertySymbols) {
|
|
1068
824
|
var r = Object.getOwnPropertySymbols(e);
|
|
1069
|
-
|
|
825
|
+
t && (r = r.filter((function(t) {
|
|
1070
826
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1071
|
-
}));
|
|
1072
|
-
n.push.apply(n, r);
|
|
827
|
+
}))), n.push.apply(n, r);
|
|
1073
828
|
}
|
|
1074
829
|
return n;
|
|
1075
830
|
}
|
|
1076
|
-
function
|
|
831
|
+
function dt(e) {
|
|
1077
832
|
for (var t = 1; t < arguments.length; t++) {
|
|
1078
|
-
var n = arguments[t]
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
}
|
|
1084
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
1085
|
-
} else {
|
|
1086
|
-
At(Object(n)).forEach((function(t) {
|
|
1087
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1088
|
-
}));
|
|
1089
|
-
}
|
|
833
|
+
var n = null != arguments[t] ? arguments[t] : {};
|
|
834
|
+
t % 2 ? ft(Object(n), !0).forEach((function(t) {
|
|
835
|
+
vt(e, t, n[t]);
|
|
836
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ft(Object(n)).forEach((function(t) {
|
|
837
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
838
|
+
}));
|
|
1090
839
|
}
|
|
1091
840
|
return e;
|
|
1092
841
|
}
|
|
1093
|
-
function
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
});
|
|
1101
|
-
} else {
|
|
1102
|
-
e[t] = n;
|
|
1103
|
-
}
|
|
1104
|
-
return e;
|
|
842
|
+
function vt(e, t, n) {
|
|
843
|
+
return (t = ht(t)) in e ? Object.defineProperty(e, t, {
|
|
844
|
+
value: n,
|
|
845
|
+
enumerable: !0,
|
|
846
|
+
configurable: !0,
|
|
847
|
+
writable: !0
|
|
848
|
+
}) : e[t] = n, e;
|
|
1105
849
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
850
|
+
function ht(e) {
|
|
851
|
+
var t = bt(e, "string");
|
|
852
|
+
return "symbol" == pt(t) ? t : t + "";
|
|
853
|
+
}
|
|
854
|
+
function bt(e, t) {
|
|
855
|
+
if ("object" != pt(e) || !e) return e;
|
|
856
|
+
var n = e[Symbol.toPrimitive];
|
|
857
|
+
if (void 0 !== n) {
|
|
858
|
+
var r = n.call(e, t || "default");
|
|
859
|
+
if ("object" != pt(r)) return r;
|
|
860
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
861
|
+
}
|
|
862
|
+
return ("string" === t ? String : Number)(e);
|
|
863
|
+
}
|
|
864
|
+
var yt = {
|
|
865
|
+
allowKeyMatching: l().bool,
|
|
866
|
+
allowNewValues: l().bool,
|
|
867
|
+
animateLoading: l().bool,
|
|
868
|
+
appearance: l().oneOf([ "default", "link", "primary", "pill", "toggle", "flat", "subtle" ]),
|
|
869
|
+
append: l().bool,
|
|
870
|
+
children: l().node,
|
|
871
|
+
defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
|
|
872
|
+
defaultValues: l().array,
|
|
873
|
+
describedBy: l().string,
|
|
874
|
+
disabled: l().bool,
|
|
875
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
876
|
+
error: l().bool,
|
|
877
|
+
filter: l().oneOf([ false, true, "controlled" ]),
|
|
878
|
+
footerMessage: l().node,
|
|
879
|
+
inline: l().bool,
|
|
880
|
+
inputId: l().string,
|
|
881
|
+
inputRef: l().oneOfType([ l().func, l().object ]),
|
|
882
|
+
isLoadingOptions: l().bool,
|
|
883
|
+
labelledBy: l().string,
|
|
884
|
+
labelText: l().string,
|
|
885
|
+
loadingMessage: l().node,
|
|
886
|
+
menuStyle: l().object,
|
|
887
|
+
multiple: l().bool,
|
|
888
|
+
name: l().string,
|
|
889
|
+
noOptionsMessage: l().node,
|
|
890
|
+
onChange: l().func,
|
|
891
|
+
onClose: l().func,
|
|
892
|
+
onFilterChange: l().func,
|
|
893
|
+
onOpen: l().func,
|
|
894
|
+
onScroll: l().func,
|
|
895
|
+
onScrollBottom: l().func,
|
|
1138
896
|
/** @private. */
|
|
1139
|
-
required:
|
|
1140
|
-
placeholder:
|
|
1141
|
-
prefixLabel:
|
|
1142
|
-
prepend:
|
|
1143
|
-
repositionMode:
|
|
1144
|
-
selectAllAppearance:
|
|
1145
|
-
showSelectedValuesFirst:
|
|
1146
|
-
suffixLabel:
|
|
1147
|
-
tabConfirmsNewValue:
|
|
1148
|
-
toggleContent:
|
|
1149
|
-
values:
|
|
897
|
+
required: l().bool,
|
|
898
|
+
placeholder: l().string,
|
|
899
|
+
prefixLabel: l().string,
|
|
900
|
+
prepend: l().bool,
|
|
901
|
+
repositionMode: l().oneOf([ "none", "flip" ]),
|
|
902
|
+
selectAllAppearance: l().oneOf([ "buttongroup", "checkbox" ]),
|
|
903
|
+
showSelectedValuesFirst: l().oneOf([ "nextOpen", "immediately", "never" ]),
|
|
904
|
+
suffixLabel: l().string,
|
|
905
|
+
tabConfirmsNewValue: l().bool,
|
|
906
|
+
toggleContent: l().oneOf([ "optionChildren", "optionLabel" ]),
|
|
907
|
+
values: l().array,
|
|
1150
908
|
/** @private. */
|
|
1151
|
-
virtualization:
|
|
909
|
+
virtualization: l().number
|
|
1152
910
|
};
|
|
1153
|
-
var
|
|
911
|
+
var mt = {
|
|
1154
912
|
allowKeyMatching: true,
|
|
1155
913
|
allowNewValues: false,
|
|
1156
914
|
animateLoading: false,
|
|
@@ -1163,40 +921,40 @@
|
|
|
1163
921
|
isLoadingOptions: false,
|
|
1164
922
|
menuStyle: {},
|
|
1165
923
|
multiple: false,
|
|
1166
|
-
noOptionsMessage: (0,
|
|
1167
|
-
placeholder: (0,
|
|
924
|
+
noOptionsMessage: (0, u._)("No matches"),
|
|
925
|
+
placeholder: (0, u._)("Select..."),
|
|
1168
926
|
prepend: false,
|
|
1169
927
|
repositionMode: "flip",
|
|
1170
928
|
selectAllAppearance: "buttongroup",
|
|
1171
929
|
tabConfirmsNewValue: false,
|
|
1172
930
|
toggleContent: "optionChildren"
|
|
1173
931
|
};
|
|
1174
|
-
var
|
|
932
|
+
var gt = S()((function(e) {
|
|
1175
933
|
return [ e ];
|
|
1176
934
|
}));
|
|
1177
|
-
|
|
1178
|
-
var
|
|
935
|
+
// preserve separate widths for single vs. multi mode
|
|
936
|
+
var Ot = S()((function(e) {
|
|
1179
937
|
var t = e.anchorWidth, n = e.isMultiple, r = e.maxHeight, o = e.menuStyle;
|
|
1180
|
-
return n ?
|
|
938
|
+
return n ? dt({
|
|
1181
939
|
width: Math.max(t !== null && t !== void 0 ? t : 0, 200),
|
|
1182
940
|
maxHeight: r
|
|
1183
|
-
}, o) :
|
|
941
|
+
}, o) : dt({
|
|
1184
942
|
minWidth: t !== null && t !== void 0 ? t : undefined,
|
|
1185
943
|
maxWidth: Math.max(t !== null && t !== void 0 ? t : 0, 300),
|
|
1186
944
|
maxHeight: r
|
|
1187
945
|
}, o);
|
|
1188
946
|
}));
|
|
1189
|
-
var
|
|
1190
|
-
function
|
|
1191
|
-
return e &&
|
|
947
|
+
var wt = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
948
|
+
function St(e) {
|
|
949
|
+
return e && a()(e.props, "value");
|
|
1192
950
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return "".concat(
|
|
951
|
+
function Ct(e, t) {
|
|
952
|
+
return "".concat(pt(e), "-").concat(e, "-").concat(t);
|
|
1195
953
|
}
|
|
1196
|
-
var
|
|
1197
|
-
|
|
1198
|
-
var t =
|
|
1199
|
-
|
|
954
|
+
var xt = function(e) {
|
|
955
|
+
ot(o, e);
|
|
956
|
+
var t = it(o);
|
|
957
|
+
rt(o, null, [ {
|
|
1200
958
|
key: "validateAppearance",
|
|
1201
959
|
// @docs-props-type CompactPropsBase
|
|
1202
960
|
value: function e(t) {
|
|
@@ -1204,601 +962,602 @@
|
|
|
1204
962
|
}
|
|
1205
963
|
} ]);
|
|
1206
964
|
function o(e) {
|
|
1207
|
-
var
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
if (
|
|
1231
|
-
clearTimeout(
|
|
965
|
+
var l;
|
|
966
|
+
tt(this, o);
|
|
967
|
+
l = t.call(this, e);
|
|
968
|
+
vt(ut(l), "activeItemId", void 0);
|
|
969
|
+
vt(ut(l), "activeValue", void 0);
|
|
970
|
+
vt(ut(l), "availableOptionCount", void 0);
|
|
971
|
+
vt(ut(l), "controlledExternally", void 0);
|
|
972
|
+
vt(ut(l), "displayedValues", void 0);
|
|
973
|
+
vt(ut(l), "dropdown", null);
|
|
974
|
+
vt(ut(l), "firstSelectedEnabledOption", null);
|
|
975
|
+
vt(ut(l), "firstSelectedOptionIndex", void 0);
|
|
976
|
+
vt(ut(l), "menuListboxId", void 0);
|
|
977
|
+
vt(ut(l), "previousActiveIndex", null);
|
|
978
|
+
vt(ut(l), "selectedOptionCount", void 0);
|
|
979
|
+
vt(ut(l), "optionRefsByKey", void 0);
|
|
980
|
+
vt(ut(l), "matchCharacter", void 0);
|
|
981
|
+
vt(ut(l), "matchTimeout", void 0);
|
|
982
|
+
vt(ut(l), "currentMatchOptions", void 0);
|
|
983
|
+
vt(ut(l), "availableMatchOptions", void 0);
|
|
984
|
+
vt(ut(l), "optionSelection", void 0);
|
|
985
|
+
vt(ut(l), "resetMatches", (function() {
|
|
986
|
+
l.matchCharacter = null;
|
|
987
|
+
l.currentMatchOptions = [];
|
|
988
|
+
if (l.matchTimeout) {
|
|
989
|
+
clearTimeout(l.matchTimeout);
|
|
1232
990
|
}
|
|
1233
991
|
}));
|
|
1234
|
-
|
|
992
|
+
vt(ut(l), "handleSelectAll", (function(e) {
|
|
1235
993
|
var t, n, o;
|
|
1236
|
-
var
|
|
994
|
+
var i = l.props, a = i.name, u = i.children, c = i.multiple;
|
|
1237
995
|
// this doesn't make sense if we can't select multiple values
|
|
1238
|
-
if (!
|
|
996
|
+
if (!c) {
|
|
1239
997
|
return;
|
|
1240
998
|
}
|
|
1241
|
-
var
|
|
1242
|
-
var p =
|
|
1243
|
-
p = r().Children.toArray(
|
|
1244
|
-
return
|
|
999
|
+
var s = (t = l.getCurrentValues()) !== null && t !== void 0 ? t : [];
|
|
1000
|
+
var p = E()(s.concat(l.displayedValues));
|
|
1001
|
+
p = r().Children.toArray(u).filter((function(e) {
|
|
1002
|
+
return St(e) && b()(p, e.props.value) && (!e.props.disabled || b()(s, e.props.value));
|
|
1245
1003
|
})).map((function(e) {
|
|
1246
1004
|
return e.props.value;
|
|
1247
1005
|
}));
|
|
1248
|
-
if (!
|
|
1249
|
-
|
|
1006
|
+
if (!l.isControlled()) {
|
|
1007
|
+
l.setState({
|
|
1250
1008
|
values: p
|
|
1251
1009
|
});
|
|
1252
1010
|
}
|
|
1253
|
-
(n = (o =
|
|
1011
|
+
(n = (o = l.props).onChange) === null || n === void 0 ? void 0 : n.call(o, e, {
|
|
1254
1012
|
values: p,
|
|
1255
|
-
name:
|
|
1013
|
+
name: a,
|
|
1256
1014
|
reason: "selectAll"
|
|
1257
1015
|
});
|
|
1258
1016
|
}));
|
|
1259
|
-
|
|
1017
|
+
vt(ut(l), "handleClearAll", (function(e) {
|
|
1260
1018
|
var t, n, o;
|
|
1261
|
-
var
|
|
1019
|
+
var i = l.props, a = i.name, u = i.children, c = i.multiple;
|
|
1262
1020
|
// this doesn't make sense if we can't select multiple values
|
|
1263
|
-
if (!
|
|
1021
|
+
if (!c) {
|
|
1264
1022
|
return;
|
|
1265
1023
|
}
|
|
1266
|
-
var
|
|
1267
|
-
var p =
|
|
1268
|
-
|
|
1269
|
-
var f = r().Children.toArray(
|
|
1270
|
-
return
|
|
1024
|
+
var s = (t = l.getCurrentValues()) !== null && t !== void 0 ? t : [];
|
|
1025
|
+
var p = T().apply(void 0, [ s ].concat(Xe(l.displayedValues)));
|
|
1026
|
+
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1027
|
+
var f = r().Children.toArray(u).filter((function(e) {
|
|
1028
|
+
return St(e) && (b()(s, e.props.value) && e.props.disabled || b()(p, e.props.value));
|
|
1271
1029
|
})).map((function(e) {
|
|
1272
1030
|
return e.props.value;
|
|
1273
1031
|
}));
|
|
1274
|
-
if (!
|
|
1275
|
-
|
|
1032
|
+
if (!l.isControlled()) {
|
|
1033
|
+
l.setState({
|
|
1276
1034
|
values: f
|
|
1277
1035
|
});
|
|
1278
1036
|
}
|
|
1279
|
-
(n = (o =
|
|
1037
|
+
(n = (o = l.props).onChange) === null || n === void 0 ? void 0 : n.call(o, e, {
|
|
1280
1038
|
values: f,
|
|
1281
|
-
name:
|
|
1039
|
+
name: a,
|
|
1282
1040
|
reason: "clearAll"
|
|
1283
1041
|
});
|
|
1284
1042
|
}));
|
|
1285
|
-
|
|
1286
|
-
var t =
|
|
1287
|
-
var
|
|
1288
|
-
if (
|
|
1289
|
-
if (
|
|
1043
|
+
vt(ut(l), "handleTextKeyDown", (function(e) {
|
|
1044
|
+
var t = l.props, r = t.children, o = t.onScrollBottom, i = t.tabConfirmsNewValue;
|
|
1045
|
+
var a = (0, q.keycode)(e.nativeEvent);
|
|
1046
|
+
if (a === "tab") {
|
|
1047
|
+
if (i && !m()(l.activeValue) && l.availableOptionCount <= 1) {
|
|
1290
1048
|
e.preventDefault();
|
|
1291
|
-
|
|
1049
|
+
l.toggleValue(e, l.activeValue);
|
|
1292
1050
|
}
|
|
1293
1051
|
}
|
|
1294
1052
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1295
|
-
if (
|
|
1053
|
+
if (a === "a" && (e.ctrlKey || e.metaKey)) {
|
|
1296
1054
|
// handle control + A
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1055
|
+
if (l.optionSelection === "all") {
|
|
1056
|
+
l.handleClearAll(e);
|
|
1299
1057
|
} else {
|
|
1300
|
-
|
|
1058
|
+
l.handleSelectAll(e);
|
|
1301
1059
|
}
|
|
1302
1060
|
}
|
|
1303
1061
|
return;
|
|
1304
1062
|
}
|
|
1305
|
-
if (
|
|
1063
|
+
if (a === "down") {
|
|
1306
1064
|
e.preventDefault();
|
|
1307
|
-
|
|
1065
|
+
l.setState((function(e) {
|
|
1308
1066
|
return {
|
|
1309
|
-
activeIndex: Math.min(e.activeIndex + 1,
|
|
1067
|
+
activeIndex: Math.min(e.activeIndex + 1, l.props.selectAllAppearance === "checkbox" ? l.availableOptionCount : l.availableOptionCount - 1)
|
|
1310
1068
|
};
|
|
1311
1069
|
}));
|
|
1312
1070
|
if (r && o) {
|
|
1313
|
-
var
|
|
1314
|
-
var
|
|
1315
|
-
if (
|
|
1316
|
-
|
|
1071
|
+
var u;
|
|
1072
|
+
var c = n.Children.toArray(r).length - (2 + ((u = l.getCurrentValues()) !== null && u !== void 0 ? u : []).length);
|
|
1073
|
+
if (l.state.activeIndex === c) {
|
|
1074
|
+
l.handleScrollBottom(e);
|
|
1317
1075
|
}
|
|
1318
1076
|
}
|
|
1319
1077
|
}
|
|
1320
|
-
if (
|
|
1078
|
+
if (a === "up") {
|
|
1321
1079
|
e.preventDefault();
|
|
1322
|
-
|
|
1080
|
+
l.setState((function(e) {
|
|
1323
1081
|
return {
|
|
1324
1082
|
activeIndex: Math.max(e.activeIndex - 1, 0)
|
|
1325
1083
|
};
|
|
1326
1084
|
}));
|
|
1327
1085
|
}
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1330
|
-
if (
|
|
1331
|
-
|
|
1086
|
+
if (a === "enter" && !m()(l.activeValue) && l.state.open) {
|
|
1087
|
+
if (l.activeValue === "selectAll") {
|
|
1088
|
+
if (l.optionSelection === "all") {
|
|
1089
|
+
l.handleClearAll(e);
|
|
1332
1090
|
} else {
|
|
1333
|
-
|
|
1091
|
+
l.handleSelectAll(e);
|
|
1334
1092
|
}
|
|
1335
1093
|
} else {
|
|
1336
1094
|
e.preventDefault();
|
|
1337
|
-
|
|
1095
|
+
l.toggleValue(e, l.activeValue);
|
|
1338
1096
|
}
|
|
1339
1097
|
}
|
|
1340
1098
|
}));
|
|
1341
|
-
|
|
1099
|
+
vt(ut(l), "handleMenuOptionClick", (function(e, t) {
|
|
1342
1100
|
var n = t.value;
|
|
1343
1101
|
e.preventDefault();
|
|
1344
|
-
if (!
|
|
1102
|
+
if (!l.state.open) {
|
|
1345
1103
|
return;
|
|
1346
1104
|
}
|
|
1347
|
-
|
|
1105
|
+
l.toggleValue(e, n);
|
|
1348
1106
|
}));
|
|
1349
|
-
|
|
1107
|
+
vt(ut(l), "handleMenuOptionKeyDown", (function(e, t) {
|
|
1350
1108
|
var n = e.nativeEvent.key;
|
|
1351
|
-
|
|
1109
|
+
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1352
1110
|
if (n.length === 1) {
|
|
1353
1111
|
var r = [];
|
|
1354
1112
|
var o = {
|
|
1355
1113
|
index: 0,
|
|
1356
1114
|
value: n
|
|
1357
1115
|
};
|
|
1358
|
-
if (!
|
|
1116
|
+
if (!l.matchCharacter) {
|
|
1359
1117
|
if (n === " ") {
|
|
1360
|
-
|
|
1118
|
+
l.resetMatches();
|
|
1361
1119
|
return;
|
|
1362
1120
|
}
|
|
1363
|
-
r =
|
|
1364
|
-
} else if (
|
|
1365
|
-
o.index =
|
|
1366
|
-
r =
|
|
1121
|
+
r = Be(l.availableMatchOptions, o);
|
|
1122
|
+
} else if (l.currentMatchOptions.length > 1) {
|
|
1123
|
+
o.index = l.matchCharacter.index + 1;
|
|
1124
|
+
r = Be(l.currentMatchOptions, o);
|
|
1367
1125
|
}
|
|
1368
1126
|
if (r.length) {
|
|
1369
|
-
var
|
|
1370
|
-
|
|
1127
|
+
var i = 0;
|
|
1128
|
+
// If the active option is a first character match, cycle to the next matching option.
|
|
1371
1129
|
if (o.index === 0 && r.length > 1) {
|
|
1372
|
-
var
|
|
1373
|
-
if (
|
|
1374
|
-
|
|
1130
|
+
var a = r.indexOf(l.availableMatchOptions[t]);
|
|
1131
|
+
if (a >= 0) {
|
|
1132
|
+
i = a === r.length - 1 ? 0 : a + 1;
|
|
1375
1133
|
}
|
|
1376
1134
|
}
|
|
1377
|
-
var
|
|
1378
|
-
var
|
|
1379
|
-
if (
|
|
1380
|
-
var
|
|
1381
|
-
(
|
|
1135
|
+
var u = r[i];
|
|
1136
|
+
var c = l.optionRefsByKey[Ct(u.value, u.label)];
|
|
1137
|
+
if (c != null) {
|
|
1138
|
+
var s;
|
|
1139
|
+
(s = c.focus) === null || s === void 0 ? void 0 : s.call(c);
|
|
1382
1140
|
}
|
|
1383
1141
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
if (
|
|
1387
|
-
clearTimeout(
|
|
1142
|
+
l.currentMatchOptions = r;
|
|
1143
|
+
l.matchCharacter = o;
|
|
1144
|
+
if (l.matchTimeout) {
|
|
1145
|
+
clearTimeout(l.matchTimeout);
|
|
1388
1146
|
}
|
|
1389
|
-
|
|
1147
|
+
l.matchTimeout = setTimeout(l.resetMatches, 500);
|
|
1390
1148
|
e.preventDefault();
|
|
1391
1149
|
e.stopPropagation();
|
|
1392
1150
|
}
|
|
1393
1151
|
}));
|
|
1394
|
-
|
|
1152
|
+
vt(ut(l), "handleTextChange", (function(e, t) {
|
|
1395
1153
|
var n, r;
|
|
1396
1154
|
var o = t.value;
|
|
1397
|
-
|
|
1155
|
+
l.setState({
|
|
1398
1156
|
filterKeyword: o,
|
|
1399
1157
|
open: true,
|
|
1400
1158
|
activeIndex: 0
|
|
1401
1159
|
});
|
|
1402
|
-
(n = (r =
|
|
1160
|
+
(n = (r = l.props).onFilterChange) === null || n === void 0 ? void 0 : n.call(r, e, {
|
|
1403
1161
|
keyword: o
|
|
1404
1162
|
});
|
|
1405
1163
|
}));
|
|
1406
|
-
|
|
1407
|
-
|
|
1164
|
+
vt(ut(l), "handleTextFocus", (function() {
|
|
1165
|
+
l.setState({
|
|
1408
1166
|
textHasFocus: true
|
|
1409
1167
|
});
|
|
1410
1168
|
}));
|
|
1411
|
-
|
|
1412
|
-
|
|
1169
|
+
vt(ut(l), "handleTextBlur", (function() {
|
|
1170
|
+
l.setState({
|
|
1413
1171
|
textHasFocus: false
|
|
1414
1172
|
});
|
|
1415
1173
|
}));
|
|
1416
|
-
|
|
1174
|
+
vt(ut(l), "handleRequestOpen", (function(e) {
|
|
1417
1175
|
var t = {
|
|
1418
1176
|
open: true,
|
|
1419
|
-
topValues:
|
|
1177
|
+
topValues: l.getTopValues()
|
|
1420
1178
|
};
|
|
1421
|
-
|
|
1422
|
-
if (
|
|
1179
|
+
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1180
|
+
if (l.props.multiple) {
|
|
1423
1181
|
t.filterKeyword = "";
|
|
1424
1182
|
}
|
|
1425
|
-
var n =
|
|
1426
|
-
|
|
1183
|
+
var n = l.state.filterKeyword;
|
|
1184
|
+
l.setState(t, (function() {
|
|
1427
1185
|
var t, r;
|
|
1428
|
-
(t = (r =
|
|
1429
|
-
if (
|
|
1430
|
-
|
|
1186
|
+
(t = (r = l.props).onOpen) === null || t === void 0 ? void 0 : t.call(r);
|
|
1187
|
+
if (l.firstSelectedEnabledOption && !l.hasFilter()) {
|
|
1188
|
+
l.firstSelectedEnabledOption.focus();
|
|
1431
1189
|
} else {
|
|
1432
1190
|
var o;
|
|
1433
|
-
|
|
1434
|
-
activeIndex: (o =
|
|
1191
|
+
l.setState({
|
|
1192
|
+
activeIndex: (o = l.firstSelectedOptionIndex) !== null && o !== void 0 ? o : 0
|
|
1435
1193
|
});
|
|
1436
1194
|
}
|
|
1437
|
-
if (n !==
|
|
1438
|
-
var
|
|
1439
|
-
(
|
|
1440
|
-
keyword:
|
|
1195
|
+
if (n !== l.state.filterKeyword) {
|
|
1196
|
+
var i, a;
|
|
1197
|
+
(i = (a = l.props).onFilterChange) === null || i === void 0 ? void 0 : i.call(a, e, {
|
|
1198
|
+
keyword: l.state.filterKeyword
|
|
1441
1199
|
});
|
|
1442
1200
|
}
|
|
1443
1201
|
}));
|
|
1444
1202
|
}));
|
|
1445
|
-
|
|
1446
|
-
|
|
1203
|
+
vt(ut(l), "handleRequestClose", (function() {
|
|
1204
|
+
l.setState({
|
|
1447
1205
|
open: false,
|
|
1448
1206
|
activeIndex: 0
|
|
1449
1207
|
}, (function() {
|
|
1450
1208
|
var e, t;
|
|
1451
|
-
|
|
1452
|
-
(e = (t =
|
|
1209
|
+
l.previousActiveIndex = null;
|
|
1210
|
+
(e = (t = l.props).onClose) === null || e === void 0 ? void 0 : e.call(t);
|
|
1453
1211
|
}));
|
|
1454
1212
|
}));
|
|
1455
|
-
|
|
1456
|
-
if (
|
|
1213
|
+
vt(ut(l), "handleScrollBottom", (function(e) {
|
|
1214
|
+
if (l.state.open && !l.props.isLoadingOptions) {
|
|
1457
1215
|
var t, n;
|
|
1458
|
-
(t = (n =
|
|
1216
|
+
(t = (n = l.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
|
|
1459
1217
|
}
|
|
1460
1218
|
}));
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1219
|
+
vt(ut(l), "handleActiveOptionMount", (function(e) {
|
|
1220
|
+
if (l.previousActiveIndex !== l.state.activeIndex) {
|
|
1463
1221
|
e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
|
|
1464
1222
|
}
|
|
1465
1223
|
}));
|
|
1466
|
-
|
|
1224
|
+
vt(ut(l), "handleOptionMount", (function(e, t, n) {
|
|
1467
1225
|
if (n) {
|
|
1468
|
-
|
|
1226
|
+
l.firstSelectedEnabledOption = e;
|
|
1469
1227
|
}
|
|
1470
1228
|
if (e == null) {
|
|
1471
|
-
delete
|
|
1229
|
+
delete l.optionRefsByKey[t];
|
|
1472
1230
|
} else {
|
|
1473
|
-
|
|
1231
|
+
l.optionRefsByKey[t] = e;
|
|
1474
1232
|
}
|
|
1475
1233
|
}));
|
|
1476
|
-
|
|
1234
|
+
vt(ut(l), "createToggle", (function() {
|
|
1477
1235
|
var e;
|
|
1478
|
-
var t =
|
|
1479
|
-
var
|
|
1480
|
-
var
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
var
|
|
1484
|
-
var
|
|
1485
|
-
var
|
|
1486
|
-
var o = f()(
|
|
1487
|
-
return
|
|
1236
|
+
var t = l.props, i = t.toggle, a = t.appearance, c = t.children, s = t.describedBy, p = t.disabled, d = t.elementRef, v = t.error, h = t.inline, b = t.labelledBy, y = t.labelText, m = t.multiple, g = t.placeholder, w = t.prefixLabel, S = t.required, C = t.suffixLabel, k = t.toggleContent;
|
|
1237
|
+
var P;
|
|
1238
|
+
var E;
|
|
1239
|
+
var I = [];
|
|
1240
|
+
// Generate buttonLabels
|
|
1241
|
+
var T = (e = l.getCurrentValues()) !== null && e !== void 0 ? e : [];
|
|
1242
|
+
var A = n.Children.toArray(c);
|
|
1243
|
+
var M = T.reduce((function(e, t, n, r) {
|
|
1244
|
+
var o = f()(A, (function(e) {
|
|
1245
|
+
return St(e) && e.props.value === t;
|
|
1488
1246
|
}));
|
|
1489
1247
|
if (o) {
|
|
1490
|
-
var
|
|
1491
|
-
e.push(
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
if (!
|
|
1495
|
-
|
|
1248
|
+
var l = k !== "optionLabel" && o.props.children ? o.props.children : o.props.label;
|
|
1249
|
+
e.push(l);
|
|
1250
|
+
I.push(o.props.label);
|
|
1251
|
+
// if not in multiple mode, add the icon
|
|
1252
|
+
if (!m && T.length === 1) {
|
|
1253
|
+
P = o.props.icon;
|
|
1496
1254
|
}
|
|
1497
|
-
} else if (
|
|
1255
|
+
} else if (m) {
|
|
1498
1256
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
1499
1257
|
e.push(t);
|
|
1500
|
-
|
|
1258
|
+
I.push(t.toString());
|
|
1501
1259
|
}
|
|
1502
1260
|
if (n < r.length - 1) {
|
|
1503
|
-
e.push((0,
|
|
1504
|
-
|
|
1261
|
+
e.push((0, u._)(", "));
|
|
1262
|
+
I.push((0, u._)(", "));
|
|
1505
1263
|
}
|
|
1506
1264
|
return e;
|
|
1507
1265
|
}), []);
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
if (
|
|
1266
|
+
E = M;
|
|
1267
|
+
// only apply prefix / suffix if the label is not empty
|
|
1268
|
+
if (E.length > 0) {
|
|
1511
1269
|
// If there's more than one item selected, read out the selected total
|
|
1512
1270
|
// rather than reading out each selected item
|
|
1513
|
-
|
|
1514
|
-
prefixLabel:
|
|
1515
|
-
label:
|
|
1516
|
-
suffixLabel:
|
|
1271
|
+
I = l.wrapLabel({
|
|
1272
|
+
prefixLabel: w,
|
|
1273
|
+
label: E.length > 1 ? [ "".concat(T.length, " items selected") ] : I,
|
|
1274
|
+
suffixLabel: C
|
|
1517
1275
|
});
|
|
1518
|
-
|
|
1519
|
-
prefixLabel:
|
|
1520
|
-
label:
|
|
1521
|
-
suffixLabel:
|
|
1276
|
+
E = l.wrapLabel({
|
|
1277
|
+
prefixLabel: w,
|
|
1278
|
+
label: E,
|
|
1279
|
+
suffixLabel: C
|
|
1522
1280
|
});
|
|
1523
1281
|
}
|
|
1524
|
-
|
|
1282
|
+
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
1525
1283
|
// are empty strings so we replicate this behaviour here
|
|
1526
|
-
if (
|
|
1284
|
+
if (E.length === 0 || !m && E.every((function(e) {
|
|
1527
1285
|
return e === "";
|
|
1528
1286
|
}))) {
|
|
1529
|
-
|
|
1530
|
-
|
|
1287
|
+
E = gt(g);
|
|
1288
|
+
I = E;
|
|
1531
1289
|
}
|
|
1532
|
-
var
|
|
1533
|
-
"aria-describedby":
|
|
1534
|
-
"aria-label": "".concat(
|
|
1535
|
-
"aria-labelledby":
|
|
1536
|
-
|
|
1537
|
-
"
|
|
1538
|
-
"data-
|
|
1290
|
+
var _ = dt({
|
|
1291
|
+
"aria-describedby": s,
|
|
1292
|
+
"aria-label": "".concat(y ? "".concat(y, ", ") : "").concat(I.join("")),
|
|
1293
|
+
"aria-labelledby": b,
|
|
1294
|
+
// aria-labelledby takes precedence over aria-label if exists
|
|
1295
|
+
"aria-required": S,
|
|
1296
|
+
"data-select-appearance": a,
|
|
1297
|
+
"data-test": m ? "multiselect" : "select",
|
|
1539
1298
|
role: "combobox",
|
|
1540
1299
|
disabled: p,
|
|
1541
1300
|
elementRef: d,
|
|
1542
1301
|
error: v
|
|
1543
|
-
},
|
|
1544
|
-
if (
|
|
1545
|
-
|
|
1302
|
+
}, x()(l.props, O()(o.propTypes)));
|
|
1303
|
+
if (m) {
|
|
1304
|
+
_["data-test-values"] = JSON.stringify(T);
|
|
1546
1305
|
} else {
|
|
1547
|
-
var V =
|
|
1548
|
-
|
|
1306
|
+
var V = $e(T, 1), q = V[0];
|
|
1307
|
+
_["data-test-value"] = q;
|
|
1549
1308
|
}
|
|
1550
|
-
if (
|
|
1309
|
+
if (i) {
|
|
1551
1310
|
|
|
1552
|
-
return (0, n.cloneElement)(
|
|
1311
|
+
return (0, n.cloneElement)(i, _);
|
|
1553
1312
|
}
|
|
1554
|
-
if (
|
|
1313
|
+
if (a === "link") {
|
|
1555
1314
|
|
|
1556
|
-
return r().createElement(
|
|
1315
|
+
return r().createElement(D(), ze({}, _, {
|
|
1557
1316
|
"data-select-appearance": "link"
|
|
1558
|
-
}), !!
|
|
1317
|
+
}), !!P && r().createElement(Ae, null, P), E || g, r().createElement(Me, null, r().createElement(X, null)));
|
|
1559
1318
|
}
|
|
1560
1319
|
|
|
1561
|
-
return r().createElement(
|
|
1562
|
-
$multiple:
|
|
1563
|
-
appearance:
|
|
1564
|
-
label:
|
|
1320
|
+
return r().createElement(Te, ze({}, _, {
|
|
1321
|
+
$multiple: m,
|
|
1322
|
+
appearance: a,
|
|
1323
|
+
label: E,
|
|
1565
1324
|
error: v,
|
|
1566
|
-
icon:
|
|
1325
|
+
icon: P,
|
|
1567
1326
|
inline: h,
|
|
1568
1327
|
isMenu: true,
|
|
1569
|
-
onClick:
|
|
1570
|
-
},
|
|
1328
|
+
onClick: l.props.onClick
|
|
1329
|
+
}, j()(l.props, o.invalidLinkAppearanceProps)), !!T.length && m && r().createElement(qe, {
|
|
1571
1330
|
"data-role": "count"
|
|
1572
|
-
}, "(",
|
|
1331
|
+
}, "(", T.length, ")"));
|
|
1573
1332
|
}));
|
|
1574
|
-
|
|
1575
|
-
var e =
|
|
1576
|
-
var
|
|
1577
|
-
var g =
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1333
|
+
vt(ut(l), "createChildren", (function() {
|
|
1334
|
+
var e = l.state, t = e.filterKeyword, o = e.textHasFocus, i = e.topValues;
|
|
1335
|
+
var a = l.props, c = a.allowKeyMatching, s = a.allowNewValues, p = a.filter, d = a.multiple, h = a.selectAllAppearance, b = a.showSelectedValuesFirst, y = a.isLoadingOptions, m = a.onScrollBottom;
|
|
1336
|
+
var g = l.getCurrentValues();
|
|
1337
|
+
l.availableOptionCount = 0;
|
|
1338
|
+
l.firstSelectedOptionIndex = undefined;
|
|
1339
|
+
l.selectedOptionCount = 0;
|
|
1340
|
+
l.activeValue = undefined;
|
|
1341
|
+
l.availableMatchOptions = [];
|
|
1583
1342
|
var O;
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
var
|
|
1588
|
-
var
|
|
1589
|
-
var k = n.Children.toArray(
|
|
1343
|
+
var w = 0;
|
|
1344
|
+
var S = false;
|
|
1345
|
+
// used to avoid overwriting the selected item ref in multiple mode
|
|
1346
|
+
var C;
|
|
1347
|
+
var x = b === "immediately" ? l.getTopValues() : i;
|
|
1348
|
+
var k = n.Children.toArray(l.props.children).reduce((function(e, t, o) {
|
|
1590
1349
|
// ignore Headings and Dividers
|
|
1591
|
-
if (!
|
|
1350
|
+
if (!St(t)) {
|
|
1592
1351
|
e.push(t);
|
|
1593
1352
|
return e;
|
|
1594
1353
|
}
|
|
1595
|
-
|
|
1596
|
-
if (t.props.value ===
|
|
1354
|
+
// Find out if the search string exactly matches a value
|
|
1355
|
+
if (t.props.value === l.state.filterKeyword) {
|
|
1597
1356
|
O = true;
|
|
1598
1357
|
}
|
|
1599
|
-
var
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1602
|
-
var
|
|
1358
|
+
var i = g && g.indexOf(t.props.value) >= 0;
|
|
1359
|
+
var a = !!i && !t.props.disabled && !C;
|
|
1360
|
+
var u = c && !d && !p && !y && !m;
|
|
1361
|
+
var s = Ct(t.props.value, t.props.label);
|
|
1603
1362
|
var f = -1;
|
|
1604
|
-
if (
|
|
1605
|
-
|
|
1363
|
+
if (u && !t.props.disabled && !t.props.hidden) {
|
|
1364
|
+
l.availableMatchOptions.push({
|
|
1606
1365
|
label: t.props.label,
|
|
1607
1366
|
value: t.props.value
|
|
1608
1367
|
});
|
|
1609
|
-
f =
|
|
1368
|
+
f = l.availableMatchOptions.length - 1;
|
|
1610
1369
|
}
|
|
1611
|
-
|
|
1370
|
+
// Format the Menu.Item
|
|
1612
1371
|
var v = (0, n.cloneElement)(t, {
|
|
1613
1372
|
key: t.key || o,
|
|
1614
|
-
onClick:
|
|
1615
|
-
onKeyDown:
|
|
1616
|
-
return
|
|
1373
|
+
onClick: l.handleMenuOptionClick,
|
|
1374
|
+
onKeyDown: u ? function(e) {
|
|
1375
|
+
return l.handleMenuOptionKeyDown(e, f);
|
|
1617
1376
|
} : undefined,
|
|
1618
|
-
selected:
|
|
1377
|
+
selected: i,
|
|
1619
1378
|
multiple: d,
|
|
1620
1379
|
role: "option",
|
|
1621
1380
|
ref: function e(t) {
|
|
1622
|
-
return
|
|
1381
|
+
return l.handleOptionMount(t, s, a);
|
|
1623
1382
|
}
|
|
1624
1383
|
});
|
|
1625
|
-
if (
|
|
1626
|
-
|
|
1384
|
+
if (a) {
|
|
1385
|
+
C = true;
|
|
1627
1386
|
}
|
|
1628
|
-
if (
|
|
1629
|
-
if (
|
|
1630
|
-
e.splice(
|
|
1387
|
+
if (x && x.indexOf(t.props.value) >= 0) {
|
|
1388
|
+
if (w === 0) {
|
|
1389
|
+
e.splice(w, 0, r().createElement(M.Divider, {
|
|
1631
1390
|
key: "topDivider"
|
|
1632
1391
|
}));
|
|
1633
|
-
|
|
1392
|
+
S = true;
|
|
1634
1393
|
}
|
|
1635
|
-
e.splice(
|
|
1636
|
-
|
|
1394
|
+
e.splice(w, 0, v);
|
|
1395
|
+
w += 1;
|
|
1637
1396
|
} else {
|
|
1638
1397
|
e.push(v);
|
|
1639
1398
|
}
|
|
1640
1399
|
return e;
|
|
1641
1400
|
}), []);
|
|
1642
|
-
|
|
1401
|
+
// In multiple mode, add missing items
|
|
1643
1402
|
if (d) {
|
|
1644
1403
|
v()(g, (function(e) {
|
|
1645
1404
|
var t = f()(k, (function(t) {
|
|
1646
|
-
return
|
|
1405
|
+
return St(t) && t.props && t.props.value === e;
|
|
1647
1406
|
}));
|
|
1648
1407
|
if (!t) {
|
|
1649
|
-
if (e ===
|
|
1408
|
+
if (e === l.state.filterKeyword) {
|
|
1650
1409
|
O = true;
|
|
1651
1410
|
}
|
|
1652
|
-
var n =
|
|
1653
|
-
var o =
|
|
1654
|
-
if (
|
|
1655
|
-
k.splice(0, 0, r().createElement(
|
|
1411
|
+
var n = x && x.indexOf(e) >= 0;
|
|
1412
|
+
var o = x.length;
|
|
1413
|
+
if (w === 0) {
|
|
1414
|
+
k.splice(0, 0, r().createElement(M.Divider, {
|
|
1656
1415
|
key: "topDivider"
|
|
1657
1416
|
}));
|
|
1658
|
-
|
|
1659
|
-
|
|
1417
|
+
w += 1;
|
|
1418
|
+
S = true;
|
|
1660
1419
|
}
|
|
1661
|
-
k.splice(n ? 0 : o + 1, 0, r().createElement(
|
|
1420
|
+
k.splice(n ? 0 : o + 1, 0, r().createElement(Se, {
|
|
1662
1421
|
label: String(e),
|
|
1663
1422
|
value: e,
|
|
1664
1423
|
key: "missing-value-".concat(e),
|
|
1665
|
-
onClick:
|
|
1424
|
+
onClick: l.handleMenuOptionClick,
|
|
1666
1425
|
multiple: d,
|
|
1667
1426
|
selected: true
|
|
1668
1427
|
}));
|
|
1669
1428
|
if (n) {
|
|
1670
|
-
|
|
1429
|
+
w += 1;
|
|
1671
1430
|
}
|
|
1672
1431
|
}
|
|
1673
1432
|
}));
|
|
1674
1433
|
}
|
|
1675
|
-
var
|
|
1676
|
-
|
|
1677
|
-
var
|
|
1678
|
-
k =
|
|
1679
|
-
if (
|
|
1680
|
-
return (0,
|
|
1434
|
+
var j = p === "controlled";
|
|
1435
|
+
// Filter the items
|
|
1436
|
+
var P = (0, R.stringToKeywords)(t);
|
|
1437
|
+
k = j ? k : k.filter((function(e) {
|
|
1438
|
+
if (St(e)) {
|
|
1439
|
+
return (0, R.testPhrase)(e.props.label, P);
|
|
1681
1440
|
}
|
|
1682
1441
|
return true;
|
|
1683
1442
|
// Keep all headers and non-interactive options
|
|
1684
1443
|
})).map((function(e) {
|
|
1685
|
-
if (!
|
|
1444
|
+
if (!St(e)) {
|
|
1686
1445
|
return e;
|
|
1687
1446
|
}
|
|
1688
|
-
|
|
1689
|
-
var t =
|
|
1447
|
+
// highlight matched text
|
|
1448
|
+
var t = P && (0, R.keywordLocations)(e.props.label, P);
|
|
1690
1449
|
|
|
1691
1450
|
return (0, n.cloneElement)(e, {
|
|
1692
1451
|
matchRanges: t || undefined
|
|
1693
1452
|
});
|
|
1694
1453
|
}));
|
|
1695
|
-
|
|
1696
|
-
if (
|
|
1697
|
-
var
|
|
1698
|
-
k.splice(
|
|
1454
|
+
// Add the option to add the new value
|
|
1455
|
+
if (s && !O && t) {
|
|
1456
|
+
var E = S ? w + 1 : w;
|
|
1457
|
+
k.splice(E, 0, r().createElement(Se, {
|
|
1699
1458
|
label: "".concat(t, " (new value)"),
|
|
1700
1459
|
value: t,
|
|
1701
1460
|
key: "newValue",
|
|
1702
1461
|
multiple: d,
|
|
1703
|
-
onClick:
|
|
1462
|
+
onClick: l.handleMenuOptionClick
|
|
1704
1463
|
}));
|
|
1705
1464
|
}
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1708
|
-
var
|
|
1709
|
-
|
|
1465
|
+
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1466
|
+
var I = h === "checkbox" && d && k.length > 1 ? 1 : 0;
|
|
1467
|
+
var T = true;
|
|
1468
|
+
// Highlight the selected Items and remove hidden
|
|
1710
1469
|
k = k.reduce((function(e, t) {
|
|
1711
1470
|
// ignore Dividers & Headings
|
|
1712
|
-
if (!
|
|
1471
|
+
if (!St(t)) {
|
|
1713
1472
|
e.push(t);
|
|
1714
1473
|
return e;
|
|
1715
1474
|
}
|
|
1716
|
-
|
|
1475
|
+
// Ignore any hidden items
|
|
1717
1476
|
if (t.props && t.props.hidden) {
|
|
1718
1477
|
return e;
|
|
1719
1478
|
}
|
|
1720
|
-
if (t.props.selected && !t.props.disabled &&
|
|
1721
|
-
|
|
1479
|
+
if (t.props.selected && !t.props.disabled && l.firstSelectedOptionIndex == null) {
|
|
1480
|
+
l.firstSelectedOptionIndex = l.availableOptionCount;
|
|
1722
1481
|
}
|
|
1723
|
-
var r =
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1482
|
+
var r = I === l.state.activeIndex;
|
|
1483
|
+
I += 1;
|
|
1484
|
+
l.availableOptionCount += 1;
|
|
1485
|
+
l.selectedOptionCount += t.props.selected ? 1 : 0;
|
|
1727
1486
|
if (t.key !== "newValue" && !t.props.disabled && !t.props.selected) {
|
|
1728
|
-
|
|
1487
|
+
T = false;
|
|
1729
1488
|
}
|
|
1730
1489
|
if (!r || !o) {
|
|
1731
1490
|
e.push(t);
|
|
1732
1491
|
return e;
|
|
1733
1492
|
}
|
|
1734
1493
|
if (!t.props.disabled) {
|
|
1735
|
-
|
|
1494
|
+
l.activeValue = t.props.value;
|
|
1736
1495
|
}
|
|
1737
|
-
var
|
|
1496
|
+
var i = (0, n.cloneElement)(t, {
|
|
1738
1497
|
active: r,
|
|
1739
|
-
id:
|
|
1740
|
-
ref:
|
|
1498
|
+
id: l.activeItemId,
|
|
1499
|
+
ref: l.handleActiveOptionMount
|
|
1741
1500
|
});
|
|
1742
|
-
e.push(
|
|
1501
|
+
e.push(i);
|
|
1743
1502
|
return e;
|
|
1744
1503
|
}), []);
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
if (h === "checkbox" && d &&
|
|
1748
|
-
var
|
|
1749
|
-
var
|
|
1750
|
-
if (
|
|
1504
|
+
l.optionSelection = l.selectedOptionCount === 0 && "none" || T && "all" || "some";
|
|
1505
|
+
// add select all option
|
|
1506
|
+
if (h === "checkbox" && d && l.availableOptionCount > 0) {
|
|
1507
|
+
var A;
|
|
1508
|
+
var _;
|
|
1509
|
+
if (l.optionSelection === "all") {
|
|
1751
1510
|
if (t === "") {
|
|
1752
|
-
|
|
1511
|
+
_ = (0, u._)("Clear all");
|
|
1753
1512
|
} else {
|
|
1754
|
-
|
|
1513
|
+
_ = (0, u._)("Clear all matches");
|
|
1755
1514
|
}
|
|
1756
1515
|
} else if (t === "") {
|
|
1757
|
-
|
|
1516
|
+
_ = (0, u._)("Select all");
|
|
1758
1517
|
} else {
|
|
1759
|
-
|
|
1518
|
+
_ = (0, u._)("Select all matches");
|
|
1760
1519
|
}
|
|
1761
|
-
if (
|
|
1762
|
-
|
|
1520
|
+
if (l.state.activeIndex === 0 && o) {
|
|
1521
|
+
l.activeValue = "selectAll";
|
|
1763
1522
|
}
|
|
1764
|
-
k.unshift( r().createElement(
|
|
1523
|
+
k.unshift( r().createElement(ke, {
|
|
1765
1524
|
key: "selectAllOption",
|
|
1766
|
-
selected:
|
|
1767
|
-
selectAllLabel:
|
|
1768
|
-
totalCount: (
|
|
1769
|
-
changedToggle: !!
|
|
1770
|
-
onClick:
|
|
1771
|
-
id:
|
|
1772
|
-
active:
|
|
1773
|
-
ref:
|
|
1525
|
+
selected: l.optionSelection === "all" || l.optionSelection !== "none" && "some",
|
|
1526
|
+
selectAllLabel: _,
|
|
1527
|
+
totalCount: (A = l.getCurrentValues()) === null || A === void 0 ? void 0 : A.length,
|
|
1528
|
+
changedToggle: !!l.props.toggle,
|
|
1529
|
+
onClick: l.optionSelection === "all" ? l.handleClearAll : l.handleSelectAll,
|
|
1530
|
+
id: l.state.activeIndex === 0 ? l.activeItemId : undefined,
|
|
1531
|
+
active: l.state.activeIndex === 0,
|
|
1532
|
+
ref: l.handleActiveOptionMount,
|
|
1774
1533
|
tabIndex: -1
|
|
1775
|
-
}), r().createElement(
|
|
1534
|
+
}), r().createElement(M.Divider, {
|
|
1776
1535
|
key: "selectAllDivider"
|
|
1777
1536
|
}));
|
|
1778
1537
|
}
|
|
1779
|
-
|
|
1780
|
-
if (
|
|
1538
|
+
l.displayedValues = k.reduce((function(e, t) {
|
|
1539
|
+
if (St(t)) {
|
|
1781
1540
|
e.push(t.props.value);
|
|
1782
1541
|
}
|
|
1783
1542
|
return e;
|
|
1784
1543
|
}), []);
|
|
1785
1544
|
return k;
|
|
1786
1545
|
}));
|
|
1787
|
-
|
|
1546
|
+
vt(ut(l), "wrapLabel", (function(e) {
|
|
1788
1547
|
var t = e.prefixLabel, n = e.label, r = e.suffixLabel;
|
|
1789
1548
|
var o = n;
|
|
1790
1549
|
if (t) {
|
|
1791
1550
|
o = [ "".concat(t, ": ") ].concat(o);
|
|
1792
1551
|
}
|
|
1793
1552
|
if (r) {
|
|
1794
|
-
o =
|
|
1553
|
+
o = s()(o).concat(" ".concat(r));
|
|
1795
1554
|
}
|
|
1796
1555
|
return o;
|
|
1797
1556
|
}));
|
|
1798
|
-
|
|
1799
|
-
|
|
1557
|
+
vt(ut(l), "handleDropdownMount", (function(e) {
|
|
1558
|
+
l.dropdown = e;
|
|
1800
1559
|
}));
|
|
1801
|
-
|
|
1560
|
+
l.state = {
|
|
1802
1561
|
activeIndex: 0,
|
|
1803
1562
|
filterKeyword: "",
|
|
1804
1563
|
open: false,
|
|
@@ -1806,25 +1565,25 @@
|
|
|
1806
1565
|
topValues: [],
|
|
1807
1566
|
values: e.defaultValues || []
|
|
1808
1567
|
};
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1568
|
+
l.controlledExternally = a()(e, "values");
|
|
1569
|
+
l.displayedValues = [];
|
|
1570
|
+
l.availableOptionCount = 0;
|
|
1571
|
+
l.firstSelectedOptionIndex = undefined;
|
|
1572
|
+
l.selectedOptionCount = 0;
|
|
1573
|
+
l.matchCharacter = null;
|
|
1574
|
+
l.matchTimeout = null;
|
|
1575
|
+
l.currentMatchOptions = [];
|
|
1576
|
+
l.availableMatchOptions = [];
|
|
1577
|
+
l.optionRefsByKey = {};
|
|
1578
|
+
l.optionSelection = "none";
|
|
1820
1579
|
if (false) {}
|
|
1821
1580
|
if (false) {}
|
|
1822
1581
|
o.validateAppearance(e);
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
return
|
|
1582
|
+
l.menuListboxId = (0, A.createDOMID)("menu-listbox");
|
|
1583
|
+
l.activeItemId = (0, A.createDOMID)("active-item");
|
|
1584
|
+
return l;
|
|
1826
1585
|
}
|
|
1827
|
-
|
|
1586
|
+
rt(o, [ {
|
|
1828
1587
|
key: "componentDidUpdate",
|
|
1829
1588
|
value: function e(t, n) {
|
|
1830
1589
|
if (false) {}
|
|
@@ -1858,16 +1617,16 @@
|
|
|
1858
1617
|
}, {
|
|
1859
1618
|
key: "toggleValue",
|
|
1860
1619
|
value: function e(t, n) {
|
|
1861
|
-
var r, o,
|
|
1862
|
-
var
|
|
1863
|
-
var
|
|
1864
|
-
var
|
|
1620
|
+
var r, o, l;
|
|
1621
|
+
var i = (r = this.getCurrentValues()) !== null && r !== void 0 ? r : [];
|
|
1622
|
+
var a = i.indexOf(n);
|
|
1623
|
+
var u = this.props, c = u.name, s = u.multiple;
|
|
1865
1624
|
var p;
|
|
1866
|
-
if (
|
|
1867
|
-
if (
|
|
1868
|
-
p = [].concat(
|
|
1625
|
+
if (s) {
|
|
1626
|
+
if (a >= 0) {
|
|
1627
|
+
p = [].concat(Xe(i.slice(0, a)), Xe(i.slice(a + 1)));
|
|
1869
1628
|
} else {
|
|
1870
|
-
p =
|
|
1629
|
+
p = i.concat([ n ]);
|
|
1871
1630
|
}
|
|
1872
1631
|
} else {
|
|
1873
1632
|
// non-multiple mode must always have a value
|
|
@@ -1879,7 +1638,7 @@
|
|
|
1879
1638
|
values: p
|
|
1880
1639
|
});
|
|
1881
1640
|
}
|
|
1882
|
-
if (
|
|
1641
|
+
if (s) {
|
|
1883
1642
|
// in uncontrolled multiple mode, keep the menu open
|
|
1884
1643
|
if (f) {
|
|
1885
1644
|
this.setState({
|
|
@@ -1894,9 +1653,9 @@
|
|
|
1894
1653
|
});
|
|
1895
1654
|
this.focus();
|
|
1896
1655
|
}
|
|
1897
|
-
(o = (
|
|
1656
|
+
(o = (l = this.props).onChange) === null || o === void 0 ? void 0 : o.call(l, t, {
|
|
1898
1657
|
values: p,
|
|
1899
|
-
name:
|
|
1658
|
+
name: c,
|
|
1900
1659
|
reason: "valueToggle"
|
|
1901
1660
|
});
|
|
1902
1661
|
}
|
|
@@ -1912,32 +1671,32 @@
|
|
|
1912
1671
|
key: "renderControls",
|
|
1913
1672
|
value: function e(t) {
|
|
1914
1673
|
var n = t.hasChildren, o = t.placement;
|
|
1915
|
-
var
|
|
1916
|
-
var
|
|
1917
|
-
var f = (0,
|
|
1918
|
-
var d = (0,
|
|
1919
|
-
|
|
1920
|
-
var v = r().createElement(
|
|
1674
|
+
var l = this.state.filterKeyword;
|
|
1675
|
+
var i = this.props, a = i.inputId, c = i.inputRef, s = i.multiple, p = i.selectAllAppearance;
|
|
1676
|
+
var f = (0, u._)("Select all options".concat(this.optionSelection === "all" ? " disabled" : ""));
|
|
1677
|
+
var d = (0, u._)("Clear all options".concat(this.optionSelection === "none" ? " disabled" : ""));
|
|
1678
|
+
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
1679
|
+
var v = r().createElement(Le, {
|
|
1921
1680
|
$placement: o,
|
|
1922
1681
|
key: "selectAll"
|
|
1923
|
-
}, r().createElement(
|
|
1682
|
+
}, r().createElement(Re, {
|
|
1924
1683
|
$disabled: this.optionSelection === "all",
|
|
1925
1684
|
"aria-label": f,
|
|
1926
1685
|
onClick: this.handleSelectAll,
|
|
1927
1686
|
"data-test": "select-all"
|
|
1928
|
-
},
|
|
1687
|
+
}, l ? (0, u._)("Select all Matches") : (0, u._)("Select all")), r().createElement(Re, {
|
|
1929
1688
|
$disabled: this.optionSelection === "none",
|
|
1930
1689
|
"aria-label": d,
|
|
1931
1690
|
onClick: this.handleClearAll,
|
|
1932
1691
|
"data-test": "clear-all"
|
|
1933
|
-
},
|
|
1692
|
+
}, l ? (0, u._)("Clear all Matches") : (0, u._)("Clear all")));
|
|
1934
1693
|
return this.hasFilter() && r().createElement("div", {
|
|
1935
1694
|
key: "controls"
|
|
1936
|
-
}, r().createElement(
|
|
1695
|
+
}, r().createElement(_e, {
|
|
1937
1696
|
key: "filter",
|
|
1938
1697
|
"data-test": "filter"
|
|
1939
1698
|
}, r().createElement(F(), {
|
|
1940
|
-
value:
|
|
1699
|
+
value: l,
|
|
1941
1700
|
autoCapitalize: "off",
|
|
1942
1701
|
autoComplete: "off",
|
|
1943
1702
|
autoCorrect: "off",
|
|
@@ -1946,83 +1705,83 @@
|
|
|
1946
1705
|
onKeyDown: this.handleTextKeyDown,
|
|
1947
1706
|
onFocus: this.handleTextFocus,
|
|
1948
1707
|
onBlur: this.handleTextBlur,
|
|
1949
|
-
placeholder: (0,
|
|
1708
|
+
placeholder: (0, u._)("filter"),
|
|
1950
1709
|
role: "combobox",
|
|
1951
1710
|
"aria-expanded": "true",
|
|
1952
1711
|
"aria-controls": this.menuListboxId,
|
|
1953
1712
|
"aria-owns": n ? this.activeItemId : undefined,
|
|
1954
|
-
"aria-label": (0,
|
|
1713
|
+
"aria-label": (0, u._)("Filter"),
|
|
1955
1714
|
"aria-autocomplete": "list",
|
|
1956
1715
|
"aria-activedescendant": this.state.textHasFocus && n ? this.activeItemId : undefined,
|
|
1957
|
-
inputRef:
|
|
1958
|
-
inputId:
|
|
1716
|
+
inputRef: c,
|
|
1717
|
+
inputId: a,
|
|
1959
1718
|
canClear: true,
|
|
1960
|
-
startAdornment: r().createElement(
|
|
1961
|
-
})),
|
|
1719
|
+
startAdornment: r().createElement(Ve, null, r().createElement(te, null))
|
|
1720
|
+
})), s && n && p === "buttongroup" && v);
|
|
1962
1721
|
}
|
|
1963
1722
|
}, {
|
|
1964
1723
|
key: "render",
|
|
1965
1724
|
value: function e() {
|
|
1966
1725
|
var t, o = this;
|
|
1967
|
-
var
|
|
1726
|
+
var l = this.props, i = l.children, a = l.defaultPlacement, u = l.inputId, c = l.multiple, s = l.repositionMode, p = l.virtualization;
|
|
1968
1727
|
var d = this.hasFilter();
|
|
1969
1728
|
var v = (t = this.getCurrentValues()) !== null && t !== void 0 ? t : [];
|
|
1970
|
-
var h = n.Children.toArray(
|
|
1729
|
+
var h = n.Children.toArray(i);
|
|
1971
1730
|
var b = v.some((function(e) {
|
|
1972
1731
|
var t = f()(h, (function(t) {
|
|
1973
|
-
return
|
|
1732
|
+
return St(t) && t.props.value === e;
|
|
1974
1733
|
}));
|
|
1975
1734
|
return t && !t.props.disabled;
|
|
1976
1735
|
}));
|
|
1977
|
-
var
|
|
1978
|
-
var
|
|
1736
|
+
var y = this.createChildren();
|
|
1737
|
+
var m = this.createToggle();
|
|
1979
1738
|
var g = function e(t) {
|
|
1980
|
-
var n = t.anchorWidth,
|
|
1981
|
-
var
|
|
1739
|
+
var n = t.anchorWidth, l = t.maxHeight, i = t.placement;
|
|
1740
|
+
var a = Ot({
|
|
1982
1741
|
anchorWidth: n,
|
|
1983
1742
|
isMultiple: o.props.multiple,
|
|
1984
|
-
maxHeight:
|
|
1743
|
+
maxHeight: l,
|
|
1985
1744
|
menuStyle: o.props.menuStyle
|
|
1986
1745
|
});
|
|
1987
|
-
var
|
|
1988
|
-
var
|
|
1989
|
-
"aria-multiselectable":
|
|
1746
|
+
var u = v.length > 0 && !b && !o.hasFilter() ? 0 : undefined;
|
|
1747
|
+
var s = dt(dt({
|
|
1748
|
+
"aria-multiselectable": c || undefined,
|
|
1990
1749
|
childrenStart: o.renderControls({
|
|
1991
|
-
placement:
|
|
1992
|
-
hasChildren:
|
|
1993
|
-
return
|
|
1750
|
+
placement: i,
|
|
1751
|
+
hasChildren: y.some((function(e) {
|
|
1752
|
+
return St(e);
|
|
1994
1753
|
}))
|
|
1995
1754
|
}),
|
|
1996
1755
|
focusMode: o.hasFilter() ? "never" : undefined,
|
|
1997
1756
|
isLoading: o.props.isLoadingOptions,
|
|
1998
1757
|
menuId: o.menuListboxId,
|
|
1999
1758
|
onScrollBottom: o.props.onScrollBottom ? o.handleScrollBottom : undefined,
|
|
2000
|
-
placement:
|
|
2001
|
-
},
|
|
2002
|
-
style:
|
|
2003
|
-
tabIndex:
|
|
1759
|
+
placement: i !== null && i !== void 0 ? i : undefined
|
|
1760
|
+
}, j()(o.props, "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), {}, {
|
|
1761
|
+
style: a,
|
|
1762
|
+
tabIndex: u
|
|
2004
1763
|
});
|
|
2005
1764
|
if (p) {
|
|
2006
1765
|
|
|
2007
|
-
return r().createElement(
|
|
1766
|
+
return r().createElement(B.VirtualizedResultsMenu, ze({
|
|
2008
1767
|
virtualization: p
|
|
2009
|
-
},
|
|
1768
|
+
}, s), y);
|
|
2010
1769
|
}
|
|
2011
1770
|
|
|
2012
|
-
return r().createElement(
|
|
1771
|
+
return r().createElement(K(), s, y);
|
|
2013
1772
|
};
|
|
2014
1773
|
|
|
2015
1774
|
return r().createElement(V(), {
|
|
2016
|
-
closeReasons:
|
|
2017
|
-
inputId:
|
|
2018
|
-
toggle:
|
|
1775
|
+
closeReasons: wt,
|
|
1776
|
+
inputId: u,
|
|
1777
|
+
toggle: m,
|
|
2019
1778
|
onRequestOpen: this.handleRequestOpen,
|
|
2020
1779
|
onRequestClose: this.handleRequestClose,
|
|
2021
1780
|
open: this.state.open,
|
|
2022
1781
|
openWithArrowKeys: true,
|
|
2023
|
-
repositionMode:
|
|
2024
|
-
defaultPlacement: d ?
|
|
2025
|
-
canCoverAnchor:
|
|
1782
|
+
repositionMode: s,
|
|
1783
|
+
defaultPlacement: d ? a : undefined,
|
|
1784
|
+
canCoverAnchor: He().innerHeight < 500,
|
|
2026
1785
|
ref: this.handleDropdownMount,
|
|
2027
1786
|
retainFocus: false,
|
|
2028
1787
|
takeFocus: v.length === 0 || v.length > 0 && !b || d
|
|
@@ -2031,157 +1790,144 @@
|
|
|
2031
1790
|
} ]);
|
|
2032
1791
|
return o;
|
|
2033
1792
|
}(n.Component);
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
/* harmony default export */ const
|
|
1793
|
+
vt(xt, "propTypes", yt);
|
|
1794
|
+
vt(xt, "defaultProps", mt);
|
|
1795
|
+
vt(xt, "Option", Se);
|
|
1796
|
+
vt(xt, "Divider", M.Divider);
|
|
1797
|
+
vt(xt, "Heading", M.Heading);
|
|
1798
|
+
vt(xt, "invalidLinkAppearanceProps", [ "append", "error", "prepend" ]);
|
|
1799
|
+
/* harmony default export */ const kt = xt;
|
|
2041
1800
|
// CONCATENATED MODULE: ./src/Select/Option.tsx
|
|
2042
|
-
function
|
|
1801
|
+
function jt(e) {
|
|
2043
1802
|
"@babel/helpers - typeof";
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
}
|
|
2053
|
-
return Bt(e);
|
|
2054
|
-
}
|
|
2055
|
-
function Kt() {
|
|
2056
|
-
Kt = Object.assign || function(e) {
|
|
1803
|
+
return jt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
1804
|
+
return typeof e;
|
|
1805
|
+
} : function(e) {
|
|
1806
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1807
|
+
}, jt(e);
|
|
1808
|
+
}
|
|
1809
|
+
function Pt() {
|
|
1810
|
+
return Pt = Object.assign ? Object.assign.bind() : function(e) {
|
|
2057
1811
|
for (var t = 1; t < arguments.length; t++) {
|
|
2058
1812
|
var n = arguments[t];
|
|
2059
1813
|
for (var r in n) {
|
|
2060
|
-
|
|
2061
|
-
e[r] = n[r];
|
|
2062
|
-
}
|
|
1814
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
2063
1815
|
}
|
|
2064
1816
|
}
|
|
2065
1817
|
return e;
|
|
2066
|
-
};
|
|
2067
|
-
return Kt.apply(this, arguments);
|
|
1818
|
+
}, Pt.apply(null, arguments);
|
|
2068
1819
|
}
|
|
2069
|
-
function
|
|
2070
|
-
if (!(e instanceof t))
|
|
2071
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2072
|
-
}
|
|
1820
|
+
function Et(e, t) {
|
|
1821
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2073
1822
|
}
|
|
2074
|
-
function
|
|
1823
|
+
function It(e, t) {
|
|
2075
1824
|
for (var n = 0; n < t.length; n++) {
|
|
2076
1825
|
var r = t[n];
|
|
2077
|
-
r.enumerable = r.enumerable ||
|
|
2078
|
-
r.
|
|
2079
|
-
if ("value" in r) r.writable = true;
|
|
2080
|
-
Object.defineProperty(e, r.key, r);
|
|
1826
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
1827
|
+
Object.defineProperty(e, Bt(r.key), r);
|
|
2081
1828
|
}
|
|
2082
1829
|
}
|
|
2083
|
-
function
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
1830
|
+
function Tt(e, t, n) {
|
|
1831
|
+
return t && It(e.prototype, t), n && It(e, n), Object.defineProperty(e, "prototype", {
|
|
1832
|
+
writable: !1
|
|
1833
|
+
}), e;
|
|
2087
1834
|
}
|
|
2088
|
-
function
|
|
2089
|
-
if (typeof t !== "
|
|
2090
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
2091
|
-
}
|
|
1835
|
+
function At(e, t) {
|
|
1836
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
2092
1837
|
e.prototype = Object.create(t && t.prototype, {
|
|
2093
1838
|
constructor: {
|
|
2094
1839
|
value: e,
|
|
2095
|
-
writable:
|
|
2096
|
-
configurable:
|
|
1840
|
+
writable: !0,
|
|
1841
|
+
configurable: !0
|
|
2097
1842
|
}
|
|
2098
|
-
})
|
|
2099
|
-
|
|
1843
|
+
}), Object.defineProperty(e, "prototype", {
|
|
1844
|
+
writable: !1
|
|
1845
|
+
}), t && Mt(e, t);
|
|
2100
1846
|
}
|
|
2101
|
-
function
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
};
|
|
2106
|
-
return Wt(e, t);
|
|
1847
|
+
function Mt(e, t) {
|
|
1848
|
+
return Mt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
1849
|
+
return e.__proto__ = t, e;
|
|
1850
|
+
}, Mt(e, t);
|
|
2107
1851
|
}
|
|
2108
|
-
function
|
|
2109
|
-
var t =
|
|
2110
|
-
return function
|
|
2111
|
-
var r =
|
|
1852
|
+
function _t(e) {
|
|
1853
|
+
var t = Rt();
|
|
1854
|
+
return function() {
|
|
1855
|
+
var n, r = Lt(e);
|
|
2112
1856
|
if (t) {
|
|
2113
|
-
var
|
|
2114
|
-
|
|
2115
|
-
} else
|
|
2116
|
-
|
|
2117
|
-
}
|
|
2118
|
-
return Gt(this, o);
|
|
1857
|
+
var o = Lt(this).constructor;
|
|
1858
|
+
n = Reflect.construct(r, arguments, o);
|
|
1859
|
+
} else n = r.apply(this, arguments);
|
|
1860
|
+
return Vt(this, n);
|
|
2119
1861
|
};
|
|
2120
1862
|
}
|
|
2121
|
-
function
|
|
2122
|
-
if (t && (
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
return Jt(e);
|
|
1863
|
+
function Vt(e, t) {
|
|
1864
|
+
if (t && ("object" == jt(t) || "function" == typeof t)) return t;
|
|
1865
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1866
|
+
return qt(e);
|
|
2126
1867
|
}
|
|
2127
|
-
function
|
|
2128
|
-
if (
|
|
2129
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2130
|
-
}
|
|
1868
|
+
function qt(e) {
|
|
1869
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2131
1870
|
return e;
|
|
2132
1871
|
}
|
|
2133
|
-
function
|
|
2134
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
2135
|
-
if (Reflect.construct.sham) return false;
|
|
2136
|
-
if (typeof Proxy === "function") return true;
|
|
1872
|
+
function Rt() {
|
|
2137
1873
|
try {
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
return
|
|
2142
|
-
}
|
|
1874
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1875
|
+
} catch (e) {}
|
|
1876
|
+
return (Rt = function t() {
|
|
1877
|
+
return !!e;
|
|
1878
|
+
})();
|
|
1879
|
+
}
|
|
1880
|
+
function Lt(e) {
|
|
1881
|
+
return Lt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
1882
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
1883
|
+
}, Lt(e);
|
|
1884
|
+
}
|
|
1885
|
+
function Dt(e, t, n) {
|
|
1886
|
+
return (t = Bt(t)) in e ? Object.defineProperty(e, t, {
|
|
1887
|
+
value: n,
|
|
1888
|
+
enumerable: !0,
|
|
1889
|
+
configurable: !0,
|
|
1890
|
+
writable: !0
|
|
1891
|
+
}) : e[t] = n, e;
|
|
2143
1892
|
}
|
|
2144
|
-
function
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
if (
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
configurable: true,
|
|
2156
|
-
writable: true
|
|
2157
|
-
});
|
|
2158
|
-
} else {
|
|
2159
|
-
e[t] = n;
|
|
1893
|
+
function Bt(e) {
|
|
1894
|
+
var t = Kt(e, "string");
|
|
1895
|
+
return "symbol" == jt(t) ? t : t + "";
|
|
1896
|
+
}
|
|
1897
|
+
function Kt(e, t) {
|
|
1898
|
+
if ("object" != jt(e) || !e) return e;
|
|
1899
|
+
var n = e[Symbol.toPrimitive];
|
|
1900
|
+
if (void 0 !== n) {
|
|
1901
|
+
var r = n.call(e, t || "default");
|
|
1902
|
+
if ("object" != jt(r)) return r;
|
|
1903
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2160
1904
|
}
|
|
2161
|
-
return e;
|
|
1905
|
+
return ("string" === t ? String : Number)(e);
|
|
2162
1906
|
}
|
|
2163
|
-
var
|
|
1907
|
+
var Nt = {
|
|
2164
1908
|
/** @private */
|
|
2165
|
-
active:
|
|
2166
|
-
children:
|
|
2167
|
-
description:
|
|
2168
|
-
descriptionPosition:
|
|
2169
|
-
disabled:
|
|
2170
|
-
hidden:
|
|
2171
|
-
icon:
|
|
2172
|
-
label:
|
|
2173
|
-
matchRanges:
|
|
2174
|
-
start:
|
|
2175
|
-
end:
|
|
1909
|
+
active: l().bool,
|
|
1910
|
+
children: l().node,
|
|
1911
|
+
description: l().string,
|
|
1912
|
+
descriptionPosition: l().oneOf([ "right", "bottom" ]),
|
|
1913
|
+
disabled: l().bool,
|
|
1914
|
+
hidden: l().bool,
|
|
1915
|
+
icon: l().node,
|
|
1916
|
+
label: l().string.isRequired,
|
|
1917
|
+
matchRanges: l().arrayOf(l().shape({
|
|
1918
|
+
start: l().number.isRequired,
|
|
1919
|
+
end: l().number.isRequired
|
|
2176
1920
|
})),
|
|
2177
1921
|
/** @private */
|
|
2178
|
-
onClick:
|
|
1922
|
+
onClick: l().func,
|
|
2179
1923
|
/** @private */
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
1924
|
+
role: l().oneOf([ "menuitemcheckbox", "option" ]),
|
|
1925
|
+
/** @private */
|
|
1926
|
+
selected: l().bool,
|
|
1927
|
+
truncate: l().bool,
|
|
1928
|
+
value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
|
|
2183
1929
|
};
|
|
2184
|
-
var
|
|
1930
|
+
var Ft = {
|
|
2185
1931
|
active: false,
|
|
2186
1932
|
descriptionPosition: "bottom",
|
|
2187
1933
|
disabled: false,
|
|
@@ -2193,31 +1939,35 @@
|
|
|
2193
1939
|
* An option within a `Select`. This inherits from
|
|
2194
1940
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
2195
1941
|
* so any elements passed to it must also be pure.
|
|
2196
|
-
*/ var
|
|
2197
|
-
|
|
2198
|
-
var t =
|
|
1942
|
+
*/ var Ht = function(e) {
|
|
1943
|
+
At(n, e);
|
|
1944
|
+
var t = _t(n);
|
|
2199
1945
|
function n() {
|
|
2200
1946
|
var e;
|
|
2201
|
-
|
|
2202
|
-
for (var r = arguments.length, o = new Array(r),
|
|
2203
|
-
o[
|
|
1947
|
+
Et(this, n);
|
|
1948
|
+
for (var r = arguments.length, o = new Array(r), l = 0; l < r; l++) {
|
|
1949
|
+
o[l] = arguments[l];
|
|
2204
1950
|
}
|
|
2205
1951
|
e = t.call.apply(t, [ this ].concat(o));
|
|
2206
|
-
|
|
2207
|
-
|
|
1952
|
+
Dt(qt(e), "c", null);
|
|
1953
|
+
Dt(qt(e), "handleMount", (function(t) {
|
|
2208
1954
|
e.c = t;
|
|
2209
1955
|
}));
|
|
2210
1956
|
return e;
|
|
2211
1957
|
}
|
|
2212
|
-
|
|
1958
|
+
// @docs-props-type OptionPropsBase
|
|
1959
|
+
Tt(n, [ {
|
|
2213
1960
|
key: "scrollIntoViewIfNeeded",
|
|
1961
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
2214
1962
|
value: function e() {
|
|
2215
1963
|
var t;
|
|
2216
1964
|
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
2217
1965
|
}
|
|
2218
1966
|
/**
|
|
2219
1967
|
* Place focus on the button.
|
|
2220
|
-
*/
|
|
1968
|
+
*/
|
|
1969
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
1970
|
+
}, {
|
|
2221
1971
|
key: "focus",
|
|
2222
1972
|
value: function e() {
|
|
2223
1973
|
var t;
|
|
@@ -2227,7 +1977,7 @@
|
|
|
2227
1977
|
key: "render",
|
|
2228
1978
|
value: function e() {
|
|
2229
1979
|
|
|
2230
|
-
return r().createElement(
|
|
1980
|
+
return r().createElement(Se, Pt({}, this.props, {
|
|
2231
1981
|
multiple: false,
|
|
2232
1982
|
ref: this.handleMount
|
|
2233
1983
|
}), this.props.children || this.props.label);
|
|
@@ -2235,201 +1985,183 @@
|
|
|
2235
1985
|
} ]);
|
|
2236
1986
|
return n;
|
|
2237
1987
|
}(n.PureComponent);
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
/* harmony default export */ const
|
|
1988
|
+
Dt(Ht, "propTypes", Nt);
|
|
1989
|
+
Dt(Ht, "defaultProps", Ft);
|
|
1990
|
+
/* harmony default export */ const zt = Ht;
|
|
2241
1991
|
// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
2242
|
-
function
|
|
1992
|
+
function $t(e) {
|
|
2243
1993
|
"@babel/helpers - typeof";
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
}
|
|
2253
|
-
return rn(e);
|
|
2254
|
-
}
|
|
2255
|
-
function on() {
|
|
2256
|
-
on = Object.assign || function(e) {
|
|
1994
|
+
return $t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
1995
|
+
return typeof e;
|
|
1996
|
+
} : function(e) {
|
|
1997
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1998
|
+
}, $t(e);
|
|
1999
|
+
}
|
|
2000
|
+
function Wt() {
|
|
2001
|
+
return Wt = Object.assign ? Object.assign.bind() : function(e) {
|
|
2257
2002
|
for (var t = 1; t < arguments.length; t++) {
|
|
2258
2003
|
var n = arguments[t];
|
|
2259
2004
|
for (var r in n) {
|
|
2260
|
-
|
|
2261
|
-
e[r] = n[r];
|
|
2262
|
-
}
|
|
2005
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
2263
2006
|
}
|
|
2264
2007
|
}
|
|
2265
2008
|
return e;
|
|
2266
|
-
};
|
|
2267
|
-
return on.apply(this, arguments);
|
|
2009
|
+
}, Wt.apply(null, arguments);
|
|
2268
2010
|
}
|
|
2269
|
-
function
|
|
2270
|
-
if (
|
|
2271
|
-
var n =
|
|
2272
|
-
var r, o;
|
|
2011
|
+
function Ut(e, t) {
|
|
2012
|
+
if (null == e) return {};
|
|
2013
|
+
var n, r, o = Jt(e, t);
|
|
2273
2014
|
if (Object.getOwnPropertySymbols) {
|
|
2274
|
-
var
|
|
2275
|
-
for (
|
|
2276
|
-
|
|
2277
|
-
if (t.indexOf(r) >= 0) continue;
|
|
2278
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
2279
|
-
n[r] = e[r];
|
|
2015
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
2016
|
+
for (r = 0; r < l.length; r++) {
|
|
2017
|
+
n = l[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
2280
2018
|
}
|
|
2281
2019
|
}
|
|
2282
|
-
return
|
|
2020
|
+
return o;
|
|
2283
2021
|
}
|
|
2284
|
-
function
|
|
2285
|
-
if (
|
|
2022
|
+
function Jt(e, t) {
|
|
2023
|
+
if (null == e) return {};
|
|
2286
2024
|
var n = {};
|
|
2287
|
-
var r
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
n[o] = e[o];
|
|
2025
|
+
for (var r in e) {
|
|
2026
|
+
if ({}.hasOwnProperty.call(e, r)) {
|
|
2027
|
+
if (t.includes(r)) continue;
|
|
2028
|
+
n[r] = e[r];
|
|
2029
|
+
}
|
|
2293
2030
|
}
|
|
2294
2031
|
return n;
|
|
2295
2032
|
}
|
|
2296
|
-
function
|
|
2297
|
-
if (!(e instanceof t))
|
|
2298
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2299
|
-
}
|
|
2033
|
+
function Xt(e, t) {
|
|
2034
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2300
2035
|
}
|
|
2301
|
-
function
|
|
2036
|
+
function Gt(e, t) {
|
|
2302
2037
|
for (var n = 0; n < t.length; n++) {
|
|
2303
2038
|
var r = t[n];
|
|
2304
|
-
r.enumerable = r.enumerable ||
|
|
2305
|
-
r.
|
|
2306
|
-
if ("value" in r) r.writable = true;
|
|
2307
|
-
Object.defineProperty(e, r.key, r);
|
|
2039
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
2040
|
+
Object.defineProperty(e, an(r.key), r);
|
|
2308
2041
|
}
|
|
2309
2042
|
}
|
|
2310
|
-
function
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2043
|
+
function Qt(e, t, n) {
|
|
2044
|
+
return t && Gt(e.prototype, t), n && Gt(e, n), Object.defineProperty(e, "prototype", {
|
|
2045
|
+
writable: !1
|
|
2046
|
+
}), e;
|
|
2314
2047
|
}
|
|
2315
|
-
function
|
|
2316
|
-
if (typeof t !== "
|
|
2317
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
2318
|
-
}
|
|
2048
|
+
function Yt(e, t) {
|
|
2049
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
2319
2050
|
e.prototype = Object.create(t && t.prototype, {
|
|
2320
2051
|
constructor: {
|
|
2321
2052
|
value: e,
|
|
2322
|
-
writable:
|
|
2323
|
-
configurable:
|
|
2053
|
+
writable: !0,
|
|
2054
|
+
configurable: !0
|
|
2324
2055
|
}
|
|
2325
|
-
})
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
return t;
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
var r = mn(e), o;
|
|
2056
|
+
}), Object.defineProperty(e, "prototype", {
|
|
2057
|
+
writable: !1
|
|
2058
|
+
}), t && Zt(e, t);
|
|
2059
|
+
}
|
|
2060
|
+
function Zt(e, t) {
|
|
2061
|
+
return Zt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
2062
|
+
return e.__proto__ = t, e;
|
|
2063
|
+
}, Zt(e, t);
|
|
2064
|
+
}
|
|
2065
|
+
function en(e) {
|
|
2066
|
+
var t = rn();
|
|
2067
|
+
return function() {
|
|
2068
|
+
var n, r = on(e);
|
|
2339
2069
|
if (t) {
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
} else
|
|
2343
|
-
|
|
2344
|
-
}
|
|
2345
|
-
return vn(this, o);
|
|
2070
|
+
var o = on(this).constructor;
|
|
2071
|
+
n = Reflect.construct(r, arguments, o);
|
|
2072
|
+
} else n = r.apply(this, arguments);
|
|
2073
|
+
return tn(this, n);
|
|
2346
2074
|
};
|
|
2347
2075
|
}
|
|
2348
|
-
function
|
|
2349
|
-
if (t && (
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
return hn(e);
|
|
2076
|
+
function tn(e, t) {
|
|
2077
|
+
if (t && ("object" == $t(t) || "function" == typeof t)) return t;
|
|
2078
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2079
|
+
return nn(e);
|
|
2353
2080
|
}
|
|
2354
|
-
function
|
|
2355
|
-
if (
|
|
2356
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2357
|
-
}
|
|
2081
|
+
function nn(e) {
|
|
2082
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2358
2083
|
return e;
|
|
2359
2084
|
}
|
|
2360
|
-
function
|
|
2361
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
2362
|
-
if (Reflect.construct.sham) return false;
|
|
2363
|
-
if (typeof Proxy === "function") return true;
|
|
2085
|
+
function rn() {
|
|
2364
2086
|
try {
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
return
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
function
|
|
2372
|
-
|
|
2373
|
-
return
|
|
2374
|
-
};
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2087
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
2088
|
+
} catch (e) {}
|
|
2089
|
+
return (rn = function t() {
|
|
2090
|
+
return !!e;
|
|
2091
|
+
})();
|
|
2092
|
+
}
|
|
2093
|
+
function on(e) {
|
|
2094
|
+
return on = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
2095
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
2096
|
+
}, on(e);
|
|
2097
|
+
}
|
|
2098
|
+
function ln(e, t, n) {
|
|
2099
|
+
return (t = an(t)) in e ? Object.defineProperty(e, t, {
|
|
2100
|
+
value: n,
|
|
2101
|
+
enumerable: !0,
|
|
2102
|
+
configurable: !0,
|
|
2103
|
+
writable: !0
|
|
2104
|
+
}) : e[t] = n, e;
|
|
2105
|
+
}
|
|
2106
|
+
function an(e) {
|
|
2107
|
+
var t = un(e, "string");
|
|
2108
|
+
return "symbol" == $t(t) ? t : t + "";
|
|
2109
|
+
}
|
|
2110
|
+
function un(e, t) {
|
|
2111
|
+
if ("object" != $t(e) || !e) return e;
|
|
2112
|
+
var n = e[Symbol.toPrimitive];
|
|
2113
|
+
if (void 0 !== n) {
|
|
2114
|
+
var r = n.call(e, t || "default");
|
|
2115
|
+
if ("object" != $t(r)) return r;
|
|
2116
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2387
2117
|
}
|
|
2388
|
-
return e;
|
|
2118
|
+
return ("string" === t ? String : Number)(e);
|
|
2389
2119
|
}
|
|
2390
2120
|
/* eslint-disable max-classes-per-file */
|
|
2391
|
-
/** @public */
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2121
|
+
/** @public */
|
|
2122
|
+
/** @public */
|
|
2123
|
+
/** @public */ var cn = {
|
|
2124
|
+
allowKeyMatching: l().bool,
|
|
2125
|
+
animateLoading: l().bool,
|
|
2126
|
+
appearance: l().oneOf([ "default", "link", "primary", "pill", "toggle", "flat", "subtle" ]),
|
|
2127
|
+
append: l().bool,
|
|
2128
|
+
children: l().node,
|
|
2129
|
+
defaultPlacement: l().oneOf([ "above", "below", "vertical" ]),
|
|
2130
|
+
defaultValue: l().oneOfType([ l().string, l().number, l().bool ]),
|
|
2131
|
+
describedBy: l().string,
|
|
2132
|
+
disabled: l().bool,
|
|
2133
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
2134
|
+
error: l().bool,
|
|
2135
|
+
filter: l().oneOf([ false, true, "controlled" ]),
|
|
2136
|
+
footerMessage: l().node,
|
|
2137
|
+
inline: l().bool,
|
|
2138
|
+
inputId: l().string,
|
|
2139
|
+
inputRef: l().oneOfType([ l().func, l().object ]),
|
|
2140
|
+
isLoadingOptions: l().bool,
|
|
2141
|
+
labelledBy: l().string,
|
|
2142
|
+
labelText: l().string,
|
|
2143
|
+
loadingMessage: l().node,
|
|
2144
|
+
menuStyle: l().object,
|
|
2145
|
+
name: l().string,
|
|
2146
|
+
noOptionsMessage: l().node,
|
|
2147
|
+
onChange: l().func,
|
|
2148
|
+
onClose: l().func,
|
|
2149
|
+
onFilterChange: l().func,
|
|
2150
|
+
onOpen: l().func,
|
|
2151
|
+
onScroll: l().func,
|
|
2152
|
+
onScrollBottom: l().func,
|
|
2153
|
+
placeholder: l().string,
|
|
2154
|
+
prefixLabel: l().string,
|
|
2155
|
+
prepend: l().bool,
|
|
2156
|
+
suffixLabel: l().string,
|
|
2157
|
+
toggleContent: l().oneOf([ "optionChildren", "optionLabel" ]),
|
|
2426
2158
|
/** @private. */
|
|
2427
|
-
toggle:
|
|
2428
|
-
value:
|
|
2159
|
+
toggle: l().node,
|
|
2160
|
+
value: l().oneOfType([ l().string, l().number, l().bool ]),
|
|
2429
2161
|
/** @private. */
|
|
2430
|
-
virtualization:
|
|
2162
|
+
virtualization: l().number
|
|
2431
2163
|
};
|
|
2432
|
-
var
|
|
2164
|
+
var sn = {
|
|
2433
2165
|
allowKeyMatching: true,
|
|
2434
2166
|
animateLoading: false,
|
|
2435
2167
|
appearance: "toggle",
|
|
@@ -2442,23 +2174,23 @@
|
|
|
2442
2174
|
inline: true,
|
|
2443
2175
|
isLoadingOptions: false,
|
|
2444
2176
|
menuStyle: {},
|
|
2445
|
-
noOptionsMessage: (0,
|
|
2446
|
-
placeholder: (0,
|
|
2177
|
+
noOptionsMessage: (0, u._)("No matches"),
|
|
2178
|
+
placeholder: (0, u._)("Select..."),
|
|
2447
2179
|
prepend: false,
|
|
2448
2180
|
toggleContent: "optionChildren"
|
|
2449
2181
|
};
|
|
2450
|
-
var
|
|
2451
|
-
|
|
2452
|
-
var t =
|
|
2182
|
+
var pn = function(e) {
|
|
2183
|
+
Yt(n, e);
|
|
2184
|
+
var t = en(n);
|
|
2453
2185
|
// @docs-props-type SelectPropsBase
|
|
2454
2186
|
function n(e) {
|
|
2455
2187
|
var r;
|
|
2456
|
-
|
|
2188
|
+
Xt(this, n);
|
|
2457
2189
|
r = t.call(this, e);
|
|
2458
2190
|
var o = {};
|
|
2459
|
-
|
|
2191
|
+
// wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
2460
2192
|
// using "has" to make sure that pre-4.3 behavior is preserved if a user explicitly passes "null" or "undefined"
|
|
2461
|
-
if (
|
|
2193
|
+
if (a()(e, "defaultValue")) {
|
|
2462
2194
|
if (e.defaultValue != null) {
|
|
2463
2195
|
o.defaultValues = [ e.defaultValue ];
|
|
2464
2196
|
} else {
|
|
@@ -2466,12 +2198,12 @@
|
|
|
2466
2198
|
}
|
|
2467
2199
|
}
|
|
2468
2200
|
r.state = o;
|
|
2469
|
-
|
|
2201
|
+
// `this.props.appearance === 'toggle'` is not included here because it is the default value.
|
|
2470
2202
|
// Including it would trigger a warning for every instance of using `Select`.
|
|
2471
2203
|
if (false) {}
|
|
2472
2204
|
return r;
|
|
2473
2205
|
}
|
|
2474
|
-
|
|
2206
|
+
Qt(n, [ {
|
|
2475
2207
|
key: "componentDidUpdate",
|
|
2476
2208
|
value: function e(t) {
|
|
2477
2209
|
if (false) {}
|
|
@@ -2479,41 +2211,41 @@
|
|
|
2479
2211
|
}, {
|
|
2480
2212
|
key: "render",
|
|
2481
2213
|
value: function e() {
|
|
2482
|
-
var t = this.props, n = t.defaultValue, o = t.onChange,
|
|
2483
|
-
var
|
|
2214
|
+
var t = this.props, n = t.defaultValue, o = t.onChange, l = t.value, i = Ut(t, [ "defaultValue", "onChange", "value" ]);
|
|
2215
|
+
var u = {
|
|
2484
2216
|
onChange: function e(t, n) {
|
|
2485
|
-
var r = n.name,
|
|
2217
|
+
var r = n.name, l = n.values;
|
|
2486
2218
|
o === null || o === void 0 ? void 0 : o(t, {
|
|
2487
2219
|
name: r,
|
|
2488
|
-
value:
|
|
2220
|
+
value: l[0]
|
|
2489
2221
|
});
|
|
2490
2222
|
}
|
|
2491
2223
|
};
|
|
2492
|
-
|
|
2493
|
-
if (
|
|
2494
|
-
if (
|
|
2495
|
-
|
|
2224
|
+
// using "has" as opposed to a null check to match SelectBase
|
|
2225
|
+
if (a()(this.props, "value")) {
|
|
2226
|
+
if (l != null) {
|
|
2227
|
+
u.values = [ l ];
|
|
2496
2228
|
} else {
|
|
2497
|
-
|
|
2229
|
+
u.values = [];
|
|
2498
2230
|
}
|
|
2499
2231
|
} else if (this.state.defaultValues != null) {
|
|
2500
2232
|
// using defaultValues from state in order to avoid wrapping defaultValue here
|
|
2501
|
-
|
|
2233
|
+
u.defaultValues = this.state.defaultValues;
|
|
2502
2234
|
}
|
|
2503
2235
|
|
|
2504
|
-
return r().createElement(
|
|
2236
|
+
return r().createElement(kt, Wt({}, i, u, {
|
|
2505
2237
|
multiple: false
|
|
2506
2238
|
}));
|
|
2507
2239
|
}
|
|
2508
2240
|
} ]);
|
|
2509
2241
|
return n;
|
|
2510
2242
|
}(n.Component);
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
/* harmony default export */ const
|
|
2243
|
+
ln(pn, "propTypes", cn);
|
|
2244
|
+
ln(pn, "defaultProps", sn);
|
|
2245
|
+
ln(pn, "Option", zt);
|
|
2246
|
+
ln(pn, "Heading", M.Heading);
|
|
2247
|
+
ln(pn, "Divider", M.Divider);
|
|
2248
|
+
/* harmony default export */ const fn = pn;
|
|
2517
2249
|
// CONCATENATED MODULE: ./src/Select/index.ts
|
|
2518
2250
|
module.exports = t;
|
|
2519
2251
|
/******/})();
|