@splunk/react-ui 4.38.0 → 4.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/SplitButton.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 = r => {
|
|
12
|
+
/******/ var t = r && r.__esModule ?
|
|
13
|
+
/******/ () => r["default"]
|
|
14
|
+
/******/ : () => r
|
|
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 = (r, t) => {
|
|
27
|
+
/******/ for (var n in t) {
|
|
28
|
+
/******/ if (e.o(t, n) && !e.o(r, n)) {
|
|
29
|
+
/******/ Object.defineProperty(r, 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, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,23 +56,23 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var r = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(r);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
Item: () => /* reexport */
|
|
65
|
-
default: () => /* reexport */
|
|
63
|
+
e.d(r, {
|
|
64
|
+
Item: () => /* reexport */ J,
|
|
65
|
+
default: () => /* reexport */ X
|
|
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 i = require("prop-types");
|
|
72
|
-
var
|
|
72
|
+
var o = e.n(i);
|
|
73
73
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronDown"
|
|
74
|
-
const
|
|
75
|
-
var l = e.n(
|
|
74
|
+
const a = require("@splunk/react-icons/enterprise/ChevronDown");
|
|
75
|
+
var l = e.n(a);
|
|
76
76
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
77
77
|
const c = require("@splunk/react-ui/Dropdown");
|
|
78
78
|
var u = e.n(c);
|
|
@@ -83,26 +83,26 @@
|
|
|
83
83
|
const f = require("@splunk/ui-utils/i18n");
|
|
84
84
|
// CONCATENATED MODULE: external "styled-components"
|
|
85
85
|
const d = require("styled-components");
|
|
86
|
-
var
|
|
86
|
+
var b = e.n(d);
|
|
87
87
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
88
|
-
const
|
|
89
|
-
var y = e.n(
|
|
88
|
+
const v = require("@splunk/react-ui/Button");
|
|
89
|
+
var y = e.n(v);
|
|
90
90
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
91
|
-
const
|
|
92
|
-
var
|
|
91
|
+
const m = require("@splunk/react-ui/Box");
|
|
92
|
+
var h = e.n(m);
|
|
93
93
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
94
94
|
const g = require("@splunk/themes");
|
|
95
95
|
// CONCATENATED MODULE: ./src/SplitButton/SplitButtonStyles.ts
|
|
96
|
-
var O =
|
|
96
|
+
var O = b()(y()).withConfig({
|
|
97
97
|
displayName: "SplitButtonStyles__StyledButton",
|
|
98
98
|
componentId: "sc-9igsyh-0"
|
|
99
99
|
})([ "", "" ], (0, g.pick)({
|
|
100
|
-
prisma: function e(
|
|
101
|
-
var
|
|
102
|
-
return
|
|
100
|
+
prisma: function e(r) {
|
|
101
|
+
var t = r.appearance;
|
|
102
|
+
return t === "default" && (0, d.css)([ "&:first-child{border-right:1px solid ", ";}" ], g.variables.interactiveColorBorder);
|
|
103
103
|
}
|
|
104
104
|
}));
|
|
105
|
-
var
|
|
105
|
+
var w = b()(h()).withConfig({
|
|
106
106
|
displayName: "SplitButtonStyles__StyledSeparator",
|
|
107
107
|
componentId: "sc-9igsyh-1"
|
|
108
108
|
})([ "width:", ";height:", ";background-color:", ";" ], (0, g.pick)({
|
|
@@ -130,323 +130,300 @@
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}));
|
|
133
|
-
var
|
|
133
|
+
var k = b()(h()).withConfig({
|
|
134
134
|
displayName: "SplitButtonStyles__StyledBox",
|
|
135
135
|
componentId: "sc-9igsyh-2"
|
|
136
136
|
})([ "", " [data-inline] + &{margin-left:", ";}" ], (function(e) {
|
|
137
|
-
var
|
|
138
|
-
return !
|
|
137
|
+
var r = e.$inline;
|
|
138
|
+
return !r && (0, d.css)([ "width:100%;" ]);
|
|
139
139
|
}), g.variables.spacingSmall);
|
|
140
140
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
141
141
|
const S = require("lodash/omit");
|
|
142
142
|
var j = e.n(S);
|
|
143
143
|
// CONCATENATED MODULE: ./src/SplitButton/Item.tsx
|
|
144
|
-
function
|
|
144
|
+
function P(e) {
|
|
145
145
|
"@babel/helpers - typeof";
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
_ = function e(t) {
|
|
152
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
return _(e);
|
|
146
|
+
return P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
147
|
+
return typeof e;
|
|
148
|
+
} : function(e) {
|
|
149
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
150
|
+
}, P(e);
|
|
156
151
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
-
for (var
|
|
160
|
-
var
|
|
161
|
-
for (var n in
|
|
162
|
-
|
|
163
|
-
e[n] = r[n];
|
|
164
|
-
}
|
|
152
|
+
function _() {
|
|
153
|
+
return _ = Object.assign ? Object.assign.bind() : function(e) {
|
|
154
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
155
|
+
var t = arguments[r];
|
|
156
|
+
for (var n in t) {
|
|
157
|
+
({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
165
158
|
}
|
|
166
159
|
}
|
|
167
160
|
return e;
|
|
168
|
-
};
|
|
169
|
-
return C.apply(this, arguments);
|
|
161
|
+
}, _.apply(null, arguments);
|
|
170
162
|
}
|
|
171
|
-
function
|
|
172
|
-
if (
|
|
173
|
-
var
|
|
174
|
-
var n, i;
|
|
163
|
+
function C(e, r) {
|
|
164
|
+
if (null == e) return {};
|
|
165
|
+
var t, n, i = E(e, r);
|
|
175
166
|
if (Object.getOwnPropertySymbols) {
|
|
176
|
-
var
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
if (t.indexOf(n) >= 0) continue;
|
|
180
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
181
|
-
r[n] = e[n];
|
|
167
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
168
|
+
for (n = 0; n < o.length; n++) {
|
|
169
|
+
t = o[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]);
|
|
182
170
|
}
|
|
183
171
|
}
|
|
184
|
-
return
|
|
172
|
+
return i;
|
|
185
173
|
}
|
|
186
|
-
function E(e,
|
|
187
|
-
if (
|
|
188
|
-
var
|
|
189
|
-
var n
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
r[i] = e[i];
|
|
174
|
+
function E(e, r) {
|
|
175
|
+
if (null == e) return {};
|
|
176
|
+
var t = {};
|
|
177
|
+
for (var n in e) {
|
|
178
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
179
|
+
if (r.includes(n)) continue;
|
|
180
|
+
t[n] = e[n];
|
|
181
|
+
}
|
|
195
182
|
}
|
|
196
|
-
return
|
|
183
|
+
return t;
|
|
197
184
|
}
|
|
198
|
-
function
|
|
199
|
-
if (!(e instanceof
|
|
200
|
-
throw new TypeError("Cannot call a class as a function");
|
|
201
|
-
}
|
|
185
|
+
function I(e, r) {
|
|
186
|
+
if (!(e instanceof r)) throw new TypeError("Cannot call a class as a function");
|
|
202
187
|
}
|
|
203
|
-
function
|
|
204
|
-
for (var
|
|
205
|
-
var n = t
|
|
206
|
-
n.enumerable = n.enumerable ||
|
|
207
|
-
n.
|
|
208
|
-
if ("value" in n) n.writable = true;
|
|
209
|
-
Object.defineProperty(e, n.key, n);
|
|
188
|
+
function q(e, r) {
|
|
189
|
+
for (var t = 0; t < r.length; t++) {
|
|
190
|
+
var n = r[t];
|
|
191
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
192
|
+
Object.defineProperty(e, A(n.key), n);
|
|
210
193
|
}
|
|
211
194
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
195
|
+
function B(e, r, t) {
|
|
196
|
+
return r && q(e.prototype, r), t && q(e, t), Object.defineProperty(e, "prototype", {
|
|
197
|
+
writable: !1
|
|
198
|
+
}), e;
|
|
216
199
|
}
|
|
217
|
-
function
|
|
218
|
-
if (typeof
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
200
|
+
function x(e, r) {
|
|
201
|
+
if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function");
|
|
202
|
+
e.prototype = Object.create(r && r.prototype, {
|
|
222
203
|
constructor: {
|
|
223
204
|
value: e,
|
|
224
|
-
writable:
|
|
225
|
-
configurable:
|
|
205
|
+
writable: !0,
|
|
206
|
+
configurable: !0
|
|
226
207
|
}
|
|
227
|
-
})
|
|
228
|
-
|
|
208
|
+
}), Object.defineProperty(e, "prototype", {
|
|
209
|
+
writable: !1
|
|
210
|
+
}), r && M(e, r);
|
|
229
211
|
}
|
|
230
|
-
function M(e,
|
|
231
|
-
M = Object.setPrototypeOf
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
};
|
|
235
|
-
return M(e, t);
|
|
212
|
+
function M(e, r) {
|
|
213
|
+
return M = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, r) {
|
|
214
|
+
return e.__proto__ = r, e;
|
|
215
|
+
}, M(e, r);
|
|
236
216
|
}
|
|
237
|
-
function
|
|
238
|
-
var
|
|
239
|
-
return function
|
|
240
|
-
var n = $(e)
|
|
241
|
-
if (
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
} else
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
return T(this, i);
|
|
217
|
+
function T(e) {
|
|
218
|
+
var r = V();
|
|
219
|
+
return function() {
|
|
220
|
+
var t, n = $(e);
|
|
221
|
+
if (r) {
|
|
222
|
+
var i = $(this).constructor;
|
|
223
|
+
t = Reflect.construct(n, arguments, i);
|
|
224
|
+
} else t = n.apply(this, arguments);
|
|
225
|
+
return R(this, t);
|
|
248
226
|
};
|
|
249
227
|
}
|
|
250
|
-
function
|
|
251
|
-
if (
|
|
252
|
-
|
|
253
|
-
}
|
|
228
|
+
function R(e, r) {
|
|
229
|
+
if (r && ("object" == P(r) || "function" == typeof r)) return r;
|
|
230
|
+
if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
|
|
254
231
|
return N(e);
|
|
255
232
|
}
|
|
256
233
|
function N(e) {
|
|
257
|
-
if (
|
|
258
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
259
|
-
}
|
|
234
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
260
235
|
return e;
|
|
261
236
|
}
|
|
262
237
|
function V() {
|
|
263
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
264
|
-
if (Reflect.construct.sham) return false;
|
|
265
|
-
if (typeof Proxy === "function") return true;
|
|
266
238
|
try {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return
|
|
271
|
-
}
|
|
239
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
240
|
+
} catch (e) {}
|
|
241
|
+
return (V = function r() {
|
|
242
|
+
return !!e;
|
|
243
|
+
})();
|
|
272
244
|
}
|
|
273
245
|
function $(e) {
|
|
274
|
-
$ = Object.setPrototypeOf ? Object.getPrototypeOf : function
|
|
275
|
-
return
|
|
276
|
-
};
|
|
277
|
-
return $(e);
|
|
246
|
+
return $ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
247
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
248
|
+
}, $(e);
|
|
278
249
|
}
|
|
279
|
-
function D(e,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
250
|
+
function D(e, r, t) {
|
|
251
|
+
return (r = A(r)) in e ? Object.defineProperty(e, r, {
|
|
252
|
+
value: t,
|
|
253
|
+
enumerable: !0,
|
|
254
|
+
configurable: !0,
|
|
255
|
+
writable: !0
|
|
256
|
+
}) : e[r] = t, e;
|
|
257
|
+
}
|
|
258
|
+
function A(e) {
|
|
259
|
+
var r = H(e, "string");
|
|
260
|
+
return "symbol" == P(r) ? r : r + "";
|
|
261
|
+
}
|
|
262
|
+
function H(e, r) {
|
|
263
|
+
if ("object" != P(e) || !e) return e;
|
|
264
|
+
var t = e[Symbol.toPrimitive];
|
|
265
|
+
if (void 0 !== t) {
|
|
266
|
+
var n = t.call(e, r || "default");
|
|
267
|
+
if ("object" != P(n)) return n;
|
|
268
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
289
269
|
}
|
|
290
|
-
return e;
|
|
270
|
+
return ("string" === r ? String : Number)(e);
|
|
291
271
|
}
|
|
292
|
-
var
|
|
293
|
-
appearance:
|
|
294
|
-
children:
|
|
295
|
-
disabled:
|
|
296
|
-
isMain:
|
|
297
|
-
onClick:
|
|
272
|
+
var z = {
|
|
273
|
+
appearance: o().oneOf([ "default", "primary", "destructive" ]),
|
|
274
|
+
children: o().node,
|
|
275
|
+
disabled: o().bool,
|
|
276
|
+
isMain: o().bool,
|
|
277
|
+
onClick: o().func
|
|
298
278
|
};
|
|
299
|
-
var
|
|
279
|
+
var F = {
|
|
300
280
|
appearance: "default"
|
|
301
281
|
};
|
|
302
282
|
/**
|
|
303
283
|
* An item within a `SplitButton`. This inherits from
|
|
304
284
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
305
285
|
* so any elements passed to it must also be pure.
|
|
306
|
-
*/ var
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
function
|
|
286
|
+
*/ var G = function(e) {
|
|
287
|
+
x(t, e);
|
|
288
|
+
var r = T(t);
|
|
289
|
+
function t() {
|
|
310
290
|
var e;
|
|
311
|
-
|
|
312
|
-
for (var n = arguments.length, i = new Array(n),
|
|
313
|
-
i[
|
|
291
|
+
I(this, t);
|
|
292
|
+
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++) {
|
|
293
|
+
i[o] = arguments[o];
|
|
314
294
|
}
|
|
315
|
-
e =
|
|
295
|
+
e = r.call.apply(r, [ this ].concat(i));
|
|
316
296
|
D(N(e), "item", null);
|
|
317
|
-
D(N(e), "handleClick", (function(
|
|
318
|
-
var
|
|
297
|
+
D(N(e), "handleClick", (function(r) {
|
|
298
|
+
var t = e.props, n = t.disabled, i = t.onClick;
|
|
319
299
|
if (!n) {
|
|
320
|
-
i === null || i === void 0 ? void 0 : i(
|
|
300
|
+
i === null || i === void 0 ? void 0 : i(r);
|
|
321
301
|
}
|
|
322
302
|
}));
|
|
323
303
|
return e;
|
|
324
304
|
}
|
|
325
|
-
|
|
305
|
+
// @docs-props-type ItemPropsBase
|
|
306
|
+
B(t, [ {
|
|
326
307
|
key: "scrollIntoViewIfNeeded",
|
|
308
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
327
309
|
value: function e() {
|
|
328
|
-
var
|
|
329
|
-
(
|
|
310
|
+
var r;
|
|
311
|
+
(r = this.item) === null || r === void 0 ? void 0 : r.scrollIntoViewIfNeeded();
|
|
330
312
|
}
|
|
331
313
|
/**
|
|
332
314
|
* Place focus on the item.
|
|
333
|
-
*/
|
|
315
|
+
*/
|
|
316
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
317
|
+
}, {
|
|
334
318
|
key: "focus",
|
|
335
319
|
value: function e() {
|
|
336
|
-
var
|
|
337
|
-
(
|
|
320
|
+
var r;
|
|
321
|
+
(r = this.item) === null || r === void 0 ? void 0 : r.focus();
|
|
338
322
|
}
|
|
339
323
|
}, {
|
|
340
324
|
key: "render",
|
|
341
325
|
value: function e() {
|
|
342
|
-
var
|
|
343
|
-
var
|
|
344
|
-
if (
|
|
326
|
+
var r = this;
|
|
327
|
+
var t = this.props, i = t.disabled, o = t.isMain, a = t.children, l = t.appearance, c = C(t, [ "disabled", "isMain", "children", "appearance" ]);
|
|
328
|
+
if (o) {
|
|
345
329
|
|
|
346
|
-
return n().createElement(O,
|
|
330
|
+
return n().createElement(O, _({
|
|
347
331
|
onClick: this.handleClick,
|
|
348
332
|
disabled: i,
|
|
349
333
|
append: true,
|
|
350
334
|
appearance: l
|
|
351
|
-
}, c),
|
|
335
|
+
}, c), a);
|
|
352
336
|
}
|
|
353
337
|
|
|
354
|
-
return n().createElement(p().Item,
|
|
355
|
-
ref: function e(
|
|
356
|
-
|
|
338
|
+
return n().createElement(p().Item, _({
|
|
339
|
+
ref: function e(t) {
|
|
340
|
+
r.item = t;
|
|
357
341
|
},
|
|
358
342
|
onClick: this.handleClick,
|
|
359
343
|
disabled: i
|
|
360
|
-
}, j()(c, [ "role" ])),
|
|
344
|
+
}, j()(c, [ "role" ])), a);
|
|
361
345
|
}
|
|
362
346
|
} ]);
|
|
363
|
-
return
|
|
364
|
-
}(
|
|
365
|
-
D(
|
|
366
|
-
D(
|
|
367
|
-
/* harmony default export */ const
|
|
347
|
+
return t;
|
|
348
|
+
}(t.PureComponent);
|
|
349
|
+
D(G, "propTypes", z);
|
|
350
|
+
D(G, "defaultProps", F);
|
|
351
|
+
/* harmony default export */ const J = G;
|
|
368
352
|
// CONCATENATED MODULE: ./src/SplitButton/SplitButton.tsx
|
|
369
|
-
function
|
|
370
|
-
|
|
371
|
-
for (var
|
|
372
|
-
var
|
|
373
|
-
for (var n in
|
|
374
|
-
|
|
375
|
-
e[n] = r[n];
|
|
376
|
-
}
|
|
353
|
+
function K() {
|
|
354
|
+
return K = Object.assign ? Object.assign.bind() : function(e) {
|
|
355
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
356
|
+
var t = arguments[r];
|
|
357
|
+
for (var n in t) {
|
|
358
|
+
({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
377
359
|
}
|
|
378
360
|
}
|
|
379
361
|
return e;
|
|
380
|
-
};
|
|
381
|
-
return G.apply(this, arguments);
|
|
362
|
+
}, K.apply(null, arguments);
|
|
382
363
|
}
|
|
383
|
-
function
|
|
384
|
-
if (
|
|
385
|
-
var
|
|
386
|
-
var n, i;
|
|
364
|
+
function L(e, r) {
|
|
365
|
+
if (null == e) return {};
|
|
366
|
+
var t, n, i = Q(e, r);
|
|
387
367
|
if (Object.getOwnPropertySymbols) {
|
|
388
|
-
var
|
|
389
|
-
for (
|
|
390
|
-
|
|
391
|
-
if (t.indexOf(n) >= 0) continue;
|
|
392
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
393
|
-
r[n] = e[n];
|
|
368
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
369
|
+
for (n = 0; n < o.length; n++) {
|
|
370
|
+
t = o[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]);
|
|
394
371
|
}
|
|
395
372
|
}
|
|
396
|
-
return
|
|
373
|
+
return i;
|
|
397
374
|
}
|
|
398
|
-
function
|
|
399
|
-
if (
|
|
400
|
-
var
|
|
401
|
-
var n
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
r[i] = e[i];
|
|
375
|
+
function Q(e, r) {
|
|
376
|
+
if (null == e) return {};
|
|
377
|
+
var t = {};
|
|
378
|
+
for (var n in e) {
|
|
379
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
380
|
+
if (r.includes(n)) continue;
|
|
381
|
+
t[n] = e[n];
|
|
382
|
+
}
|
|
407
383
|
}
|
|
408
|
-
return
|
|
384
|
+
return t;
|
|
409
385
|
}
|
|
410
|
-
var
|
|
411
|
-
appearance:
|
|
412
|
-
children:
|
|
413
|
-
disabled:
|
|
414
|
-
elementRef:
|
|
415
|
-
onClick:
|
|
416
|
-
inline:
|
|
386
|
+
var U = {
|
|
387
|
+
appearance: o().oneOf([ "default", "primary", "destructive" ]),
|
|
388
|
+
children: o().node,
|
|
389
|
+
disabled: o().bool,
|
|
390
|
+
elementRef: o().oneOfType([ o().func, o().object ]),
|
|
391
|
+
onClick: o().func,
|
|
392
|
+
inline: o().bool
|
|
417
393
|
};
|
|
418
|
-
function
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
|
|
394
|
+
function W(e) {
|
|
395
|
+
var r = e.appearance, i = r === void 0 ? "default" : r, o = e.children, a = e.disabled, c = e.elementRef, s = e.inline, d = s === void 0 ? true : s, b = e.onClick, v = L(e, [ "appearance", "children", "disabled", "elementRef", "inline", "onClick" ]);
|
|
396
|
+
// @docs-props-type SplitButtonPropsBase
|
|
397
|
+
var y = t.Children.toArray(o).filter(t.isValidElement);
|
|
422
398
|
var m = 0;
|
|
423
|
-
|
|
424
|
-
|
|
399
|
+
var h = 0;
|
|
400
|
+
y.forEach((function(e, r) {
|
|
401
|
+
var t = e.props, n = t.disabled, i = t.isMain;
|
|
425
402
|
if (i) {
|
|
426
|
-
|
|
403
|
+
m = r;
|
|
427
404
|
}
|
|
428
405
|
if (n) {
|
|
429
|
-
|
|
406
|
+
h += 1;
|
|
430
407
|
}
|
|
431
408
|
}));
|
|
432
|
-
var g = (0,
|
|
409
|
+
var g = (0, t.cloneElement)(y[m], {
|
|
433
410
|
isMain: true,
|
|
434
411
|
appearance: i,
|
|
435
|
-
disabled:
|
|
412
|
+
disabled: a || y[m].props.disabled
|
|
436
413
|
});
|
|
437
|
-
|
|
438
|
-
y.splice(
|
|
414
|
+
// Remove mainButton from array of dropdown items
|
|
415
|
+
y.splice(m, 1);
|
|
439
416
|
var S = y;
|
|
440
417
|
var j = n().createElement(O, {
|
|
441
418
|
prepend: true,
|
|
442
|
-
disabled:
|
|
419
|
+
disabled: a || h === S.length,
|
|
443
420
|
appearance: i,
|
|
444
421
|
"data-test": "split-button-toggle",
|
|
445
422
|
"aria-label": (0, f._)("Open more options"),
|
|
446
423
|
icon: n().createElement(l(), null)
|
|
447
424
|
});
|
|
448
425
|
|
|
449
|
-
return n().createElement(
|
|
426
|
+
return n().createElement(k, K({
|
|
450
427
|
"aria-label": (0, f._)("Split button"),
|
|
451
428
|
"data-inline": d || null,
|
|
452
429
|
"data-test": "split-button-container",
|
|
@@ -455,17 +432,17 @@
|
|
|
455
432
|
inline: true,
|
|
456
433
|
flex: true,
|
|
457
434
|
role: "group",
|
|
458
|
-
onClick:
|
|
459
|
-
},
|
|
435
|
+
onClick: a ? undefined : b
|
|
436
|
+
}, v), g, i !== "default" && n().createElement(w, {
|
|
460
437
|
inline: true,
|
|
461
438
|
$appearance: i
|
|
462
439
|
}), n().createElement("div", null, n().createElement(u(), {
|
|
463
440
|
toggle: j
|
|
464
441
|
}, n().createElement(p(), null, S))));
|
|
465
442
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
/* harmony default export */ const
|
|
443
|
+
W.propTypes = U;
|
|
444
|
+
W.Item = J;
|
|
445
|
+
/* harmony default export */ const X = W;
|
|
469
446
|
// CONCATENATED MODULE: ./src/SplitButton/index.ts
|
|
470
|
-
module.exports =
|
|
447
|
+
module.exports = r;
|
|
471
448
|
/******/})();
|