@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/Dropdown.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = o => {
|
|
12
|
+
/******/ var t = o && o.__esModule ?
|
|
13
|
+
/******/ () => o["default"]
|
|
14
|
+
/******/ : () => o
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(t, {
|
|
17
|
+
a: t
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return t;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var n in
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (o, t) => {
|
|
27
|
+
/******/ for (var n in t) {
|
|
28
|
+
/******/ if (e.o(t, n) && !e.o(o, n)) {
|
|
29
|
+
/******/ Object.defineProperty(o, n, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get:
|
|
31
|
+
get: t[n]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, o) => Object.prototype.hasOwnProperty.call(e, o)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,37 +56,37 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var o = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(o);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
default: () => /* reexport */
|
|
65
|
-
legacyRefMode: () => /* reexport */
|
|
63
|
+
e.d(o, {
|
|
64
|
+
default: () => /* reexport */ U,
|
|
65
|
+
legacyRefMode: () => /* reexport */ N
|
|
66
66
|
});
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
|
-
const
|
|
69
|
-
var n = e.n(
|
|
68
|
+
const t = require("react");
|
|
69
|
+
var n = e.n(t);
|
|
70
70
|
// CONCATENATED MODULE: external "prop-types"
|
|
71
71
|
const r = require("prop-types");
|
|
72
|
-
var
|
|
72
|
+
var i = e.n(r);
|
|
73
73
|
// CONCATENATED MODULE: external "lodash/has"
|
|
74
|
-
const
|
|
75
|
-
var s = e.n(
|
|
74
|
+
const l = require("lodash/has");
|
|
75
|
+
var s = e.n(l);
|
|
76
76
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
77
77
|
const a = require("lodash/includes");
|
|
78
78
|
var c = e.n(a);
|
|
79
79
|
// CONCATENATED MODULE: external "lodash/isEmpty"
|
|
80
|
-
const
|
|
80
|
+
const p = require("lodash/isEmpty");
|
|
81
81
|
// CONCATENATED MODULE: external "lodash/isFunction"
|
|
82
|
-
const
|
|
83
|
-
var f = e.n(
|
|
82
|
+
const u = require("lodash/isFunction");
|
|
83
|
+
var f = e.n(u);
|
|
84
84
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
85
85
|
const d = require("lodash/keys");
|
|
86
86
|
var g = e.n(d);
|
|
87
87
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
88
|
-
const
|
|
89
|
-
var
|
|
88
|
+
const v = require("lodash/omit");
|
|
89
|
+
var y = e.n(v);
|
|
90
90
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
91
91
|
const h = require("@splunk/ui-utils/id");
|
|
92
92
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
@@ -101,177 +101,165 @@
|
|
|
101
101
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
102
102
|
* @param current - The new value of the ref.
|
|
103
103
|
*/
|
|
104
|
-
function
|
|
104
|
+
function w(e, o) {
|
|
105
105
|
if (e) {
|
|
106
106
|
if (typeof e === "function") {
|
|
107
|
-
e(
|
|
107
|
+
e(o);
|
|
108
108
|
} else {
|
|
109
109
|
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
110
110
|
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
111
|
-
e.current =
|
|
111
|
+
e.current = o;
|
|
112
112
|
// eslint-disable-line no-param-reassign
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
// CONCATENATED MODULE: ./src/Dropdown/Dropdown.tsx
|
|
117
|
-
function
|
|
117
|
+
function C(e) {
|
|
118
118
|
"@babel/helpers - typeof";
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
k = function e(t) {
|
|
125
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
return k(e);
|
|
119
|
+
return C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
120
|
+
return typeof e;
|
|
121
|
+
} : function(e) {
|
|
122
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
123
|
+
}, C(e);
|
|
129
124
|
}
|
|
130
|
-
function
|
|
131
|
-
var
|
|
125
|
+
function k(e, o) {
|
|
126
|
+
var t = Object.keys(e);
|
|
132
127
|
if (Object.getOwnPropertySymbols) {
|
|
133
128
|
var n = Object.getOwnPropertySymbols(e);
|
|
134
|
-
|
|
135
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
136
|
-
}));
|
|
137
|
-
o.push.apply(o, n);
|
|
129
|
+
o && (n = n.filter((function(o) {
|
|
130
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
131
|
+
}))), t.push.apply(t, n);
|
|
138
132
|
}
|
|
139
|
-
return
|
|
133
|
+
return t;
|
|
140
134
|
}
|
|
141
|
-
function
|
|
142
|
-
for (var
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(o));
|
|
150
|
-
} else {
|
|
151
|
-
R(Object(o)).forEach((function(t) {
|
|
152
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(o, t));
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
135
|
+
function R(e) {
|
|
136
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
137
|
+
var t = null != arguments[o] ? arguments[o] : {};
|
|
138
|
+
o % 2 ? k(Object(t), !0).forEach((function(o) {
|
|
139
|
+
_(e, o, t[o]);
|
|
140
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : k(Object(t)).forEach((function(o) {
|
|
141
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
|
|
142
|
+
}));
|
|
155
143
|
}
|
|
156
144
|
return e;
|
|
157
145
|
}
|
|
158
|
-
function
|
|
159
|
-
if (!(e instanceof
|
|
160
|
-
throw new TypeError("Cannot call a class as a function");
|
|
161
|
-
}
|
|
146
|
+
function j(e, o) {
|
|
147
|
+
if (!(e instanceof o)) throw new TypeError("Cannot call a class as a function");
|
|
162
148
|
}
|
|
163
|
-
function
|
|
164
|
-
for (var
|
|
165
|
-
var n = t
|
|
166
|
-
n.enumerable = n.enumerable ||
|
|
167
|
-
n.
|
|
168
|
-
if ("value" in n) n.writable = true;
|
|
169
|
-
Object.defineProperty(e, n.key, n);
|
|
149
|
+
function P(e, o) {
|
|
150
|
+
for (var t = 0; t < o.length; t++) {
|
|
151
|
+
var n = o[t];
|
|
152
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
153
|
+
Object.defineProperty(e, F(n.key), n);
|
|
170
154
|
}
|
|
171
155
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
function S(e, o, t) {
|
|
157
|
+
return o && P(e.prototype, o), t && P(e, t), Object.defineProperty(e, "prototype", {
|
|
158
|
+
writable: !1
|
|
159
|
+
}), e;
|
|
176
160
|
}
|
|
177
|
-
function
|
|
178
|
-
if (typeof
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
161
|
+
function q(e, o) {
|
|
162
|
+
if ("function" != typeof o && null !== o) throw new TypeError("Super expression must either be null or a function");
|
|
163
|
+
e.prototype = Object.create(o && o.prototype, {
|
|
182
164
|
constructor: {
|
|
183
165
|
value: e,
|
|
184
|
-
writable:
|
|
185
|
-
configurable:
|
|
166
|
+
writable: !0,
|
|
167
|
+
configurable: !0
|
|
186
168
|
}
|
|
187
|
-
})
|
|
188
|
-
|
|
169
|
+
}), Object.defineProperty(e, "prototype", {
|
|
170
|
+
writable: !1
|
|
171
|
+
}), o && T(e, o);
|
|
189
172
|
}
|
|
190
|
-
function T(e,
|
|
191
|
-
T = Object.setPrototypeOf
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
};
|
|
195
|
-
return T(e, t);
|
|
173
|
+
function T(e, o) {
|
|
174
|
+
return T = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, o) {
|
|
175
|
+
return e.__proto__ = o, e;
|
|
176
|
+
}, T(e, o);
|
|
196
177
|
}
|
|
197
|
-
function
|
|
198
|
-
var
|
|
199
|
-
return function
|
|
200
|
-
var n = M(e)
|
|
201
|
-
if (
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
} else
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
return I(this, r);
|
|
178
|
+
function E(e) {
|
|
179
|
+
var o = K();
|
|
180
|
+
return function() {
|
|
181
|
+
var t, n = M(e);
|
|
182
|
+
if (o) {
|
|
183
|
+
var r = M(this).constructor;
|
|
184
|
+
t = Reflect.construct(n, arguments, r);
|
|
185
|
+
} else t = n.apply(this, arguments);
|
|
186
|
+
return D(this, t);
|
|
208
187
|
};
|
|
209
188
|
}
|
|
210
|
-
function
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return E(e);
|
|
189
|
+
function D(e, o) {
|
|
190
|
+
if (o && ("object" == C(o) || "function" == typeof o)) return o;
|
|
191
|
+
if (void 0 !== o) throw new TypeError("Derived constructors may only return object or undefined");
|
|
192
|
+
return I(e);
|
|
215
193
|
}
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
218
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
219
|
-
}
|
|
194
|
+
function I(e) {
|
|
195
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
220
196
|
return e;
|
|
221
197
|
}
|
|
222
198
|
function K() {
|
|
223
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
224
|
-
if (Reflect.construct.sham) return false;
|
|
225
|
-
if (typeof Proxy === "function") return true;
|
|
226
199
|
try {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
}
|
|
200
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
201
|
+
} catch (e) {}
|
|
202
|
+
return (K = function o() {
|
|
203
|
+
return !!e;
|
|
204
|
+
})();
|
|
232
205
|
}
|
|
233
206
|
function M(e) {
|
|
234
|
-
M = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
235
|
-
return
|
|
236
|
-
};
|
|
237
|
-
return M(e);
|
|
207
|
+
return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
208
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
209
|
+
}, M(e);
|
|
238
210
|
}
|
|
239
|
-
function _(e,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
211
|
+
function _(e, o, t) {
|
|
212
|
+
return (o = F(o)) in e ? Object.defineProperty(e, o, {
|
|
213
|
+
value: t,
|
|
214
|
+
enumerable: !0,
|
|
215
|
+
configurable: !0,
|
|
216
|
+
writable: !0
|
|
217
|
+
}) : e[o] = t, e;
|
|
218
|
+
}
|
|
219
|
+
function F(e) {
|
|
220
|
+
var o = A(e, "string");
|
|
221
|
+
return "symbol" == C(o) ? o : o + "";
|
|
222
|
+
}
|
|
223
|
+
function A(e, o) {
|
|
224
|
+
if ("object" != C(e) || !e) return e;
|
|
225
|
+
var t = e[Symbol.toPrimitive];
|
|
226
|
+
if (void 0 !== t) {
|
|
227
|
+
var n = t.call(e, o || "default");
|
|
228
|
+
if ("object" != C(n)) return n;
|
|
229
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
249
230
|
}
|
|
250
|
-
return e;
|
|
231
|
+
return ("string" === o ? String : Number)(e);
|
|
251
232
|
}
|
|
252
|
-
/** @public */
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
233
|
+
/** @public */
|
|
234
|
+
/** @public */
|
|
235
|
+
/** @public */
|
|
236
|
+
/** @public */
|
|
237
|
+
/** @public */
|
|
238
|
+
/** @public */
|
|
239
|
+
/** @public */
|
|
240
|
+
/** @public */ var x = [ "clickAway", "contentClick", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
241
|
+
var W = {
|
|
242
|
+
align: i().oneOf([ "center", "edge", "theme", "end" ]),
|
|
243
|
+
canCoverAnchor: i().bool,
|
|
244
|
+
children: i().oneOfType([ i().node, i().func ]),
|
|
245
|
+
closeReasons: i().arrayOf(i().oneOf(x)),
|
|
246
|
+
defaultPlacement: i().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
|
|
247
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
248
|
+
focusToggleReasons: i().arrayOf(i().oneOf(x)),
|
|
249
|
+
inputId: i().string,
|
|
250
|
+
onRequestClose: i().func,
|
|
251
|
+
onRequestOpen: i().func,
|
|
252
|
+
open: i().bool,
|
|
253
|
+
openWithArrowKeys: i().bool,
|
|
254
|
+
repositionMode: i().oneOf([ "none", "flip", "any" ]),
|
|
255
|
+
retainFocus: i().bool,
|
|
256
|
+
takeFocus: i().bool,
|
|
257
|
+
toggle: i().element.isRequired
|
|
270
258
|
};
|
|
271
|
-
var
|
|
259
|
+
var B = {
|
|
272
260
|
align: "theme",
|
|
273
261
|
canCoverAnchor: true,
|
|
274
|
-
closeReasons:
|
|
262
|
+
closeReasons: x,
|
|
275
263
|
defaultPlacement: "below",
|
|
276
264
|
focusToggleReasons: [ "contentClick", "escapeKey", "tabKey", "toggleClick" ],
|
|
277
265
|
repositionMode: "flip",
|
|
@@ -279,122 +267,122 @@
|
|
|
279
267
|
openWithArrowKeys: false,
|
|
280
268
|
takeFocus: true
|
|
281
269
|
};
|
|
282
|
-
var
|
|
270
|
+
var N = Symbol("Dropdown legacy ref mode marker");
|
|
283
271
|
var z = function(e) {
|
|
284
|
-
|
|
285
|
-
var
|
|
272
|
+
q(r, e);
|
|
273
|
+
var o = E(r);
|
|
286
274
|
// @docs-props-type DropdownPropsBase
|
|
287
275
|
/**
|
|
288
276
|
* Enumeration of the possible reasons for closing the Select.
|
|
289
277
|
* 'clickAway', 'escapeKey', and 'offScreen' are inherited from Popover, but repeated here for
|
|
290
278
|
* docs extraction.
|
|
291
279
|
*/ function r(e) {
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
_(
|
|
296
|
-
_(
|
|
297
|
-
_(
|
|
298
|
-
_(
|
|
299
|
-
_(
|
|
300
|
-
|
|
301
|
-
|
|
280
|
+
var t;
|
|
281
|
+
j(this, r);
|
|
282
|
+
t = o.call(this, e);
|
|
283
|
+
_(I(t), "controlledExternally", void 0);
|
|
284
|
+
_(I(t), "popoverId", void 0);
|
|
285
|
+
_(I(t), "toggleRef", null);
|
|
286
|
+
_(I(t), "toggleId", void 0);
|
|
287
|
+
_(I(t), "handleToggleMount", (function(e) {
|
|
288
|
+
t.toggleRef = e;
|
|
289
|
+
t.setState({
|
|
302
290
|
anchor: e
|
|
303
291
|
});
|
|
304
|
-
if (
|
|
292
|
+
if (t.props.toggle.type[N]) {
|
|
305
293
|
// TS: assume that legacy ref mode toggles support elementRef
|
|
306
|
-
|
|
294
|
+
w(t.props.toggle.props.elementRef, e);
|
|
307
295
|
} else {
|
|
308
296
|
// TS: ref does not exist on React.ReactElement - technically, this is undocumented API
|
|
309
|
-
|
|
297
|
+
w(t.props.toggle.ref, e);
|
|
310
298
|
}
|
|
311
299
|
}));
|
|
312
|
-
_(
|
|
313
|
-
var
|
|
314
|
-
(
|
|
315
|
-
if (
|
|
316
|
-
|
|
300
|
+
_(I(t), "handleToggleClick", (function(e) {
|
|
301
|
+
var o, n;
|
|
302
|
+
(o = (n = t.props.toggle.props).onClick) === null || o === void 0 ? void 0 : o.call(n, e);
|
|
303
|
+
if (t.isOpen()) {
|
|
304
|
+
t.handleRequestClose({
|
|
317
305
|
reason: "toggleClick",
|
|
318
306
|
event: e
|
|
319
307
|
});
|
|
320
308
|
} else {
|
|
321
|
-
var r,
|
|
322
|
-
(r = (
|
|
309
|
+
var r, i;
|
|
310
|
+
(r = (i = t.props).onRequestOpen) === null || r === void 0 ? void 0 : r.call(i, e, {
|
|
323
311
|
reason: "toggleClick"
|
|
324
312
|
});
|
|
325
|
-
if (!
|
|
326
|
-
|
|
313
|
+
if (!t.isControlled()) {
|
|
314
|
+
t.setState({
|
|
327
315
|
open: true
|
|
328
316
|
});
|
|
329
317
|
}
|
|
330
318
|
}
|
|
331
319
|
}));
|
|
332
|
-
_(
|
|
333
|
-
var
|
|
334
|
-
(
|
|
335
|
-
if (!
|
|
320
|
+
_(I(t), "handleToggleKeyDownOpen", (function(e) {
|
|
321
|
+
var o, n;
|
|
322
|
+
(o = (n = t.props.toggle.props).onKeyDown) === null || o === void 0 ? void 0 : o.call(n, e);
|
|
323
|
+
if (!t.props.openWithArrowKeys) {
|
|
336
324
|
return;
|
|
337
325
|
}
|
|
338
326
|
var r = (0, b.keycode)(e.nativeEvent);
|
|
339
327
|
if (r === "up" || r === "down") {
|
|
340
|
-
var
|
|
328
|
+
var i, l;
|
|
341
329
|
e.preventDefault();
|
|
342
|
-
(
|
|
330
|
+
(i = (l = t.props).onRequestOpen) === null || i === void 0 ? void 0 : i.call(l, e, {
|
|
343
331
|
reason: "toggleKeydown"
|
|
344
332
|
});
|
|
345
|
-
if (!
|
|
346
|
-
|
|
333
|
+
if (!t.isControlled()) {
|
|
334
|
+
t.setState({
|
|
347
335
|
open: true
|
|
348
336
|
});
|
|
349
337
|
}
|
|
350
338
|
}
|
|
351
339
|
}));
|
|
352
|
-
_(
|
|
353
|
-
var
|
|
354
|
-
var r =
|
|
355
|
-
if (
|
|
356
|
-
var a =
|
|
357
|
-
var
|
|
340
|
+
_(I(t), "handleRequestClose", (function(e) {
|
|
341
|
+
var o = e.event, n = e.reason;
|
|
342
|
+
var r = t.props, i = r.closeReasons, l = r.focusToggleReasons, s = r.onRequestClose;
|
|
343
|
+
if (o && n === "clickAway") {
|
|
344
|
+
var a = o.target;
|
|
345
|
+
var p = t.props.inputId || t.props.toggle.props.id || t.toggleId;
|
|
358
346
|
while (a) {
|
|
359
347
|
// Ignore clicks on toggle.
|
|
360
|
-
if (a.id ===
|
|
348
|
+
if (a.id === p) {
|
|
361
349
|
return;
|
|
362
350
|
}
|
|
363
351
|
a = a.parentNode;
|
|
364
352
|
}
|
|
365
353
|
}
|
|
366
|
-
if (
|
|
367
|
-
if (c()(
|
|
368
|
-
|
|
354
|
+
if (t.isOpen() && c()(i, n)) {
|
|
355
|
+
if (c()(l, n)) {
|
|
356
|
+
t.focus();
|
|
369
357
|
}
|
|
370
|
-
if (!
|
|
371
|
-
|
|
358
|
+
if (!t.isControlled()) {
|
|
359
|
+
t.setState({
|
|
372
360
|
open: false
|
|
373
361
|
});
|
|
374
362
|
}
|
|
375
363
|
s === null || s === void 0 ? void 0 : s(e);
|
|
376
364
|
}
|
|
377
365
|
}));
|
|
378
|
-
_(
|
|
379
|
-
|
|
366
|
+
_(I(t), "handleContentClick", (function(e) {
|
|
367
|
+
t.handleRequestClose({
|
|
380
368
|
reason: "contentClick",
|
|
381
369
|
event: e
|
|
382
370
|
});
|
|
383
371
|
}));
|
|
384
|
-
|
|
372
|
+
t.state = {
|
|
385
373
|
anchor: null,
|
|
386
374
|
open: false
|
|
387
375
|
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return
|
|
376
|
+
t.controlledExternally = s()(e, "open");
|
|
377
|
+
t.popoverId = (0, h.createDOMID)("popover");
|
|
378
|
+
t.toggleId = (0, h.createDOMID)("toggle");
|
|
379
|
+
return t;
|
|
392
380
|
}
|
|
393
|
-
|
|
381
|
+
S(r, [ {
|
|
394
382
|
key: "componentDidUpdate",
|
|
395
383
|
value: function e() {
|
|
396
384
|
if (false) {}
|
|
397
|
-
var
|
|
385
|
+
var o = R({}, y()(this.props, g()(r.propTypes), "value", "id"));
|
|
398
386
|
if (false) {}
|
|
399
387
|
}
|
|
400
388
|
}, {
|
|
@@ -407,8 +395,8 @@
|
|
|
407
395
|
*/ }, {
|
|
408
396
|
key: "focus",
|
|
409
397
|
value: function e() {
|
|
410
|
-
var
|
|
411
|
-
(
|
|
398
|
+
var o;
|
|
399
|
+
(o = this.toggleRef) === null || o === void 0 ? void 0 : o.focus();
|
|
412
400
|
}
|
|
413
401
|
}, {
|
|
414
402
|
key: "isControlled",
|
|
@@ -418,59 +406,60 @@
|
|
|
418
406
|
}, {
|
|
419
407
|
key: "renderToggle",
|
|
420
408
|
value: function e() {
|
|
421
|
-
var
|
|
409
|
+
var o;
|
|
422
410
|
|
|
423
|
-
return (0,
|
|
411
|
+
return (0, t.cloneElement)(this.props.toggle, (o = {
|
|
424
412
|
onClick: this.handleToggleClick,
|
|
425
413
|
onKeyDown: this.handleToggleKeyDownOpen
|
|
426
|
-
}, _(
|
|
427
|
-
_(
|
|
428
|
-
_(
|
|
429
|
-
_(
|
|
430
|
-
|
|
414
|
+
}, _(o, this.props.toggle.type[N] ? "elementRef" : "ref", this.handleToggleMount),
|
|
415
|
+
_(o, "aria-controls", this.isOpen() ? this.popoverId : undefined), _(o, "aria-haspopup", this.props.toggle.props["aria-haspopup"] || true),
|
|
416
|
+
_(o, "aria-expanded", this.isOpen()), _(o, "data-test", this.props.toggle.props["data-test"] || "dropdown"),
|
|
417
|
+
_(o, "data-test-popover-id", this.popoverId), _(o, "id", this.props.inputId || this.props.toggle.props.id || this.toggleId),
|
|
418
|
+
o));
|
|
431
419
|
}
|
|
432
420
|
}, {
|
|
433
421
|
key: "render",
|
|
434
422
|
value: function e() {
|
|
435
|
-
var
|
|
423
|
+
var o = this.props, t = o.align, r = o.canCoverAnchor, i = o.children, l = o.closeReasons, s = o.defaultPlacement, a = o.elementRef, p = o.repositionMode, u = o.retainFocus, d = o.takeFocus;
|
|
436
424
|
var g = this.state.anchor;
|
|
437
|
-
var
|
|
425
|
+
var v = this.handleRequestClose, y = this.handleContentClick;
|
|
438
426
|
var h = this.renderToggle();
|
|
439
427
|
|
|
440
428
|
return n().createElement(n().Fragment, null, h, n().createElement(m(), {
|
|
441
|
-
align:
|
|
429
|
+
align: t,
|
|
442
430
|
open: !!g && this.isOpen(),
|
|
443
|
-
autoCloseWhenOffScreen: c()(
|
|
431
|
+
autoCloseWhenOffScreen: c()(l, "offScreen"),
|
|
444
432
|
anchor: g,
|
|
445
433
|
canCoverAnchor: r,
|
|
446
434
|
elementRef: a,
|
|
447
|
-
retainFocus:
|
|
435
|
+
retainFocus: u,
|
|
448
436
|
defaultPlacement: s,
|
|
449
|
-
onRequestClose:
|
|
450
|
-
repositionMode:
|
|
437
|
+
onRequestClose: v,
|
|
438
|
+
repositionMode: p,
|
|
451
439
|
id: this.popoverId,
|
|
452
440
|
"aria-labelledby": this.props.inputId || this.props.toggle.props.id || this.toggleId,
|
|
453
441
|
takeFocus: d
|
|
454
|
-
}, f()(
|
|
442
|
+
}, f()(i) ?
|
|
443
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
455
444
|
function() {
|
|
456
445
|
|
|
457
446
|
return n().createElement("div", {
|
|
458
|
-
onClick:
|
|
459
|
-
},
|
|
447
|
+
onClick: y
|
|
448
|
+
}, i.apply(void 0, arguments));
|
|
460
449
|
} :
|
|
461
450
|
|
|
462
451
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
463
452
|
n().createElement("div", {
|
|
464
|
-
onClick:
|
|
465
|
-
},
|
|
453
|
+
onClick: y
|
|
454
|
+
}, i)));
|
|
466
455
|
}
|
|
467
456
|
} ]);
|
|
468
457
|
return r;
|
|
469
|
-
}(
|
|
470
|
-
_(z, "possibleCloseReasons",
|
|
471
|
-
_(z, "propTypes",
|
|
472
|
-
_(z, "defaultProps",
|
|
473
|
-
/* harmony default export */ const
|
|
458
|
+
}(t.Component);
|
|
459
|
+
_(z, "possibleCloseReasons", x);
|
|
460
|
+
_(z, "propTypes", W);
|
|
461
|
+
_(z, "defaultProps", B);
|
|
462
|
+
/* harmony default export */ const U = z;
|
|
474
463
|
// CONCATENATED MODULE: ./src/Dropdown/index.ts
|
|
475
|
-
module.exports =
|
|
464
|
+
module.exports = o;
|
|
476
465
|
/******/})();
|