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