@splunk/react-ui 4.19.0 → 4.21.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 +114 -230
- package/Anchor.js +74 -150
- package/Animation.js +52 -124
- package/AnimationToggle.js +86 -146
- package/Box.js +77 -153
- package/Breadcrumbs.d.ts +2 -0
- package/Breadcrumbs.js +207 -0
- package/Button.js +168 -316
- package/ButtonGroup.js +84 -168
- package/ButtonSimple.js +224 -324
- package/CHANGELOG.md +35 -0
- package/Calendar.js +264 -462
- package/Card.js +223 -371
- package/CardLayout.js +87 -163
- package/Chip.js +199 -323
- package/Clickable.js +132 -248
- package/CloseButton.js +92 -200
- package/Code.js +188 -251
- package/CollapsiblePanel.js +214 -370
- package/Color.js +267 -495
- package/ColumnLayout.js +152 -254
- package/ComboBox.js +197 -371
- package/Concertina.js +214 -374
- package/ControlGroup.js +164 -288
- package/Date.js +154 -304
- package/DefinitionList.js +104 -180
- package/Divider.js +80 -156
- package/Dropdown.js +121 -263
- package/DualListbox.js +408 -601
- package/EventListener.js +70 -138
- package/File.js +343 -547
- package/FormRows.js +232 -414
- package/Heading.js +94 -164
- package/Image.js +167 -323
- package/JSONTree.js +166 -314
- package/Layer.js +221 -388
- package/Link.js +133 -239
- package/List.js +85 -161
- package/Markdown.js +230 -355
- package/Menu.js +396 -647
- package/Message.js +248 -437
- package/MessageBar.js +220 -408
- package/Modal.js +201 -365
- package/ModalLayer.js +96 -196
- package/Monogram.js +112 -204
- package/Multiselect.js +2675 -2807
- package/Number.js +178 -334
- package/Paginator.js +170 -336
- package/Paragraph.js +77 -153
- package/Popover.js +436 -623
- package/Progress.js +139 -255
- package/RadioBar.js +156 -280
- package/RadioList.js +182 -282
- package/Resize.js +173 -307
- package/ResultsMenu.js +183 -304
- package/ScreenReaderContent.js +75 -151
- package/Scroll.js +125 -267
- package/ScrollContainerContext.js +129 -201
- package/Search.js +188 -354
- package/Select.js +1243 -1248
- package/SidePanel.js +106 -214
- package/Slider.js +198 -348
- package/SlidingPanels.js +138 -280
- package/SplitButton.js +141 -273
- package/StaticContent.js +84 -168
- package/StepBar.js +138 -246
- package/Switch.js +261 -385
- package/TabBar.js +261 -398
- package/TabLayout.js +122 -238
- package/Table.js +975 -1447
- package/Text.js +335 -549
- package/TextArea.js +315 -537
- package/Tooltip.js +152 -292
- package/TransitionOpen.js +118 -242
- package/Typography.js +81 -157
- package/WaitSpinner.js +117 -209
- package/package.json +20 -21
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +25 -0
- package/types/src/Breadcrumbs/Item.d.ts +42 -0
- package/types/src/Breadcrumbs/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Breadcrumbs/docs/examples/Basic.d.ts +2 -0
- package/types/src/Breadcrumbs/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/Link/Link.d.ts +12 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Compact.d.ts +4 -0
- package/types/src/Multiselect/Multiselect.d.ts +5 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +2 -0
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +14 -0
- package/types/src/Select/SelectBase.d.ts +11 -3
- package/types/src/Table/Table.d.ts +4 -0
- package/types/src/Text/Text.d.ts +3 -3
- package/types/src/TextArea/TextArea.d.ts +3 -3
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +46 -110
- package/useKeyPress.js +50 -107
- package/usePrevious.js +47 -111
- package/useRovingFocus.js +53 -133
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- package/types/src/Typography/docs/examples/Variants.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/SplitButton.js
CHANGED
|
@@ -1,241 +1,145 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/ // The
|
|
4
|
-
/******/ var
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
/******/
|
|
8
|
-
/******/
|
|
9
|
-
/******/ //
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
/******/
|
|
16
|
-
/******/
|
|
17
|
-
/******/
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ (() => {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = (module) => {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ () => (module['default']) :
|
|
13
|
+
/******/ () => (module);
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ })();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/define property getters */
|
|
20
|
+
/******/ (() => {
|
|
21
|
+
/******/ // define getter functions for harmony exports
|
|
22
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
23
|
+
/******/ for(var key in definition) {
|
|
24
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
25
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
26
|
+
/******/ }
|
|
27
|
+
/******/ }
|
|
18
28
|
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 206);
|
|
86
|
-
/******/ })
|
|
29
|
+
/******/ })();
|
|
30
|
+
/******/
|
|
31
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
32
|
+
/******/ (() => {
|
|
33
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
34
|
+
/******/ })();
|
|
35
|
+
/******/
|
|
36
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
37
|
+
/******/ (() => {
|
|
38
|
+
/******/ // define __esModule on exports
|
|
39
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
40
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
+
/******/ }
|
|
43
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
+
/******/ };
|
|
45
|
+
/******/ })();
|
|
46
|
+
/******/
|
|
87
47
|
/************************************************************************/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 13:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("@splunk/react-ui/Menu");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 157:
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("@splunk/react-icons/enterprise/ChevronDown");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 17:
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
|
|
125
|
-
/***/ 2:
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
module.exports = require("react");
|
|
129
|
-
|
|
130
|
-
/***/ }),
|
|
131
|
-
|
|
132
|
-
/***/ 206:
|
|
133
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
134
|
-
|
|
135
|
-
"use strict";
|
|
48
|
+
var __webpack_exports__ = {};
|
|
136
49
|
// ESM COMPAT FLAG
|
|
137
50
|
__webpack_require__.r(__webpack_exports__);
|
|
138
51
|
|
|
139
52
|
// EXPORTS
|
|
140
|
-
__webpack_require__.d(__webpack_exports__,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var ChevronDown_default = /*#__PURE__*/__webpack_require__.n(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
var themes_ = __webpack_require__(0);
|
|
180
|
-
|
|
181
|
-
// CONCATENATED MODULE: ./src/SplitButton/SplitButtonStyles.ts
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var StyledButton = external_styled_components_default()(Button_default.a).withConfig({
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
Item: () => (/* reexport */ SplitButton_Item),
|
|
55
|
+
"default": () => (/* reexport */ SplitButton_SplitButton)
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
;// CONCATENATED MODULE: external "react"
|
|
59
|
+
const external_react_namespaceObject = require("react");
|
|
60
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
|
|
61
|
+
;// CONCATENATED MODULE: external "prop-types"
|
|
62
|
+
const external_prop_types_namespaceObject = require("prop-types");
|
|
63
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
|
|
64
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronDown"
|
|
65
|
+
const ChevronDown_namespaceObject = require("@splunk/react-icons/enterprise/ChevronDown");
|
|
66
|
+
var ChevronDown_default = /*#__PURE__*/__webpack_require__.n(ChevronDown_namespaceObject);
|
|
67
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
68
|
+
const Dropdown_namespaceObject = require("@splunk/react-ui/Dropdown");
|
|
69
|
+
var Dropdown_default = /*#__PURE__*/__webpack_require__.n(Dropdown_namespaceObject);
|
|
70
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
71
|
+
const Menu_namespaceObject = require("@splunk/react-ui/Menu");
|
|
72
|
+
var Menu_default = /*#__PURE__*/__webpack_require__.n(Menu_namespaceObject);
|
|
73
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
74
|
+
const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
|
|
75
|
+
;// CONCATENATED MODULE: external "styled-components"
|
|
76
|
+
const external_styled_components_namespaceObject = require("styled-components");
|
|
77
|
+
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
|
|
78
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
79
|
+
const Button_namespaceObject = require("@splunk/react-ui/Button");
|
|
80
|
+
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_namespaceObject);
|
|
81
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
82
|
+
const Box_namespaceObject = require("@splunk/react-ui/Box");
|
|
83
|
+
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
|
|
84
|
+
;// CONCATENATED MODULE: external "@splunk/themes"
|
|
85
|
+
const themes_namespaceObject = require("@splunk/themes");
|
|
86
|
+
;// CONCATENATED MODULE: ./src/SplitButton/SplitButtonStyles.ts
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var StyledButton = external_styled_components_default()((Button_default())).withConfig({
|
|
187
92
|
displayName: "SplitButtonStyles__StyledButton",
|
|
188
93
|
componentId: "sc-9igsyh-0"
|
|
189
|
-
})(["", ""],
|
|
94
|
+
})(["", ""], (0,themes_namespaceObject.pick)({
|
|
190
95
|
prisma: function prisma(_ref) {
|
|
191
96
|
var appearance = _ref.appearance;
|
|
192
|
-
return appearance === 'default' &&
|
|
97
|
+
return appearance === 'default' && (0,external_styled_components_namespaceObject.css)(["&:first-child{border-right:1px solid ", ";}"], themes_namespaceObject.variables.interactiveColorBorder);
|
|
193
98
|
}
|
|
194
99
|
}));
|
|
195
|
-
var StyledSeparator = external_styled_components_default()(Box_default
|
|
100
|
+
var StyledSeparator = external_styled_components_default()((Box_default())).withConfig({
|
|
196
101
|
displayName: "SplitButtonStyles__StyledSeparator",
|
|
197
102
|
componentId: "sc-9igsyh-1"
|
|
198
|
-
})(["width:", ";height:", ";background-color:", ";"],
|
|
199
|
-
prisma:
|
|
103
|
+
})(["width:", ";height:", ";background-color:", ";"], (0,themes_namespaceObject.pick)({
|
|
104
|
+
prisma: (0,themes_namespaceObject.pickVariant)('$appearance', {
|
|
200
105
|
primary: '2px',
|
|
201
106
|
destructive: '2px'
|
|
202
107
|
}),
|
|
203
108
|
enterprise: '1px'
|
|
204
|
-
}),
|
|
109
|
+
}), themes_namespaceObject.variables.inputHeight, (0,themes_namespaceObject.pickVariant)('$appearance', {
|
|
205
110
|
primary: {
|
|
206
|
-
enterprise:
|
|
111
|
+
enterprise: themes_namespaceObject.variables.white,
|
|
207
112
|
prisma: {
|
|
208
|
-
light:
|
|
209
|
-
dark:
|
|
113
|
+
light: themes_namespaceObject.variables.white,
|
|
114
|
+
dark: themes_namespaceObject.variables.black
|
|
210
115
|
}
|
|
211
116
|
},
|
|
212
117
|
destructive: {
|
|
213
118
|
enterprise: {
|
|
214
|
-
light:
|
|
215
|
-
dark:
|
|
119
|
+
light: themes_namespaceObject.variables.white,
|
|
120
|
+
dark: themes_namespaceObject.variables.black
|
|
216
121
|
},
|
|
217
122
|
prisma: {
|
|
218
|
-
light:
|
|
219
|
-
dark:
|
|
123
|
+
light: themes_namespaceObject.variables.white,
|
|
124
|
+
dark: themes_namespaceObject.variables.black
|
|
220
125
|
}
|
|
221
126
|
}
|
|
222
127
|
}));
|
|
223
|
-
var StyledBox = external_styled_components_default()(Box_default
|
|
128
|
+
var StyledBox = external_styled_components_default()((Box_default())).withConfig({
|
|
224
129
|
displayName: "SplitButtonStyles__StyledBox",
|
|
225
130
|
componentId: "sc-9igsyh-2"
|
|
226
131
|
})(["", " [data-inline] + &{margin-left:", ";}"], function (_ref2) {
|
|
227
132
|
var $inline = _ref2.$inline;
|
|
228
|
-
return !$inline &&
|
|
229
|
-
},
|
|
230
|
-
enterprise:
|
|
231
|
-
prisma:
|
|
133
|
+
return !$inline && (0,external_styled_components_namespaceObject.css)(["width:100%;"]);
|
|
134
|
+
}, (0,themes_namespaceObject.pick)({
|
|
135
|
+
enterprise: themes_namespaceObject.variables.spacingHalf,
|
|
136
|
+
prisma: themes_namespaceObject.variables.spacingSmall
|
|
232
137
|
}));
|
|
233
138
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(
|
|
237
|
-
|
|
238
|
-
// CONCATENATED MODULE: ./src/SplitButton/Item.tsx
|
|
139
|
+
;// CONCATENATED MODULE: external "lodash/omit"
|
|
140
|
+
const omit_namespaceObject = require("lodash/omit");
|
|
141
|
+
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
|
|
142
|
+
;// CONCATENATED MODULE: ./src/SplitButton/Item.tsx
|
|
239
143
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
240
144
|
|
|
241
145
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -272,11 +176,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
272
176
|
|
|
273
177
|
|
|
274
178
|
var propTypes = {
|
|
275
|
-
appearance: external_prop_types_default.
|
|
276
|
-
children: external_prop_types_default.
|
|
277
|
-
disabled: external_prop_types_default.
|
|
278
|
-
isMain: external_prop_types_default.
|
|
279
|
-
onClick: external_prop_types_default.
|
|
179
|
+
appearance: external_prop_types_default().oneOf(['default', 'primary', 'destructive']),
|
|
180
|
+
children: (external_prop_types_default()).node,
|
|
181
|
+
disabled: (external_prop_types_default()).bool,
|
|
182
|
+
isMain: (external_prop_types_default()).bool,
|
|
183
|
+
onClick: (external_prop_types_default()).func
|
|
280
184
|
};
|
|
281
185
|
var defaultProps = {
|
|
282
186
|
appearance: 'default'
|
|
@@ -287,7 +191,7 @@ var defaultProps = {
|
|
|
287
191
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
288
192
|
* so any elements passed to it must also be pure.
|
|
289
193
|
*/
|
|
290
|
-
var
|
|
194
|
+
var Item = /*#__PURE__*/function (_PureComponent) {
|
|
291
195
|
_inherits(Item, _PureComponent);
|
|
292
196
|
|
|
293
197
|
var _super = _createSuper(Item);
|
|
@@ -349,7 +253,7 @@ var Item_Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
349
253
|
otherProps = _objectWithoutProperties(_this$props2, ["disabled", "isMain", "children", "appearance"]);
|
|
350
254
|
|
|
351
255
|
if (isMain) {
|
|
352
|
-
return /*#__PURE__*/external_react_default.
|
|
256
|
+
return /*#__PURE__*/external_react_default().createElement(StyledButton, _extends({
|
|
353
257
|
onClick: this.handleClick,
|
|
354
258
|
disabled: disabled,
|
|
355
259
|
append: true,
|
|
@@ -357,7 +261,7 @@ var Item_Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
357
261
|
}, otherProps), children);
|
|
358
262
|
}
|
|
359
263
|
|
|
360
|
-
return /*#__PURE__*/external_react_default.
|
|
264
|
+
return /*#__PURE__*/external_react_default().createElement((Menu_default()).Item, _extends({
|
|
361
265
|
ref: function ref(c) {
|
|
362
266
|
_this2.item = c;
|
|
363
267
|
},
|
|
@@ -368,14 +272,14 @@ var Item_Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
368
272
|
}]);
|
|
369
273
|
|
|
370
274
|
return Item;
|
|
371
|
-
}(
|
|
275
|
+
}(external_react_namespaceObject.PureComponent);
|
|
372
276
|
|
|
373
|
-
_defineProperty(
|
|
277
|
+
_defineProperty(Item, "propTypes", propTypes);
|
|
374
278
|
|
|
375
|
-
_defineProperty(
|
|
279
|
+
_defineProperty(Item, "defaultProps", defaultProps);
|
|
376
280
|
|
|
377
|
-
/* harmony default export */
|
|
378
|
-
|
|
281
|
+
/* harmony default export */ const SplitButton_Item = (Item);
|
|
282
|
+
;// CONCATENATED MODULE: ./src/SplitButton/SplitButton.tsx
|
|
379
283
|
function SplitButton_extends() { SplitButton_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return SplitButton_extends.apply(this, arguments); }
|
|
380
284
|
|
|
381
285
|
function SplitButton_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = SplitButton_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -391,12 +295,12 @@ function SplitButton_objectWithoutPropertiesLoose(source, excluded) { if (source
|
|
|
391
295
|
|
|
392
296
|
|
|
393
297
|
var SplitButton_propTypes = {
|
|
394
|
-
appearance: external_prop_types_default.
|
|
395
|
-
children: external_prop_types_default.
|
|
396
|
-
disabled: external_prop_types_default.
|
|
397
|
-
elementRef: external_prop_types_default.
|
|
398
|
-
onClick: external_prop_types_default.
|
|
399
|
-
inline: external_prop_types_default.
|
|
298
|
+
appearance: external_prop_types_default().oneOf(['default', 'primary', 'destructive']),
|
|
299
|
+
children: (external_prop_types_default()).node,
|
|
300
|
+
disabled: (external_prop_types_default()).bool,
|
|
301
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
302
|
+
onClick: (external_prop_types_default()).func,
|
|
303
|
+
inline: (external_prop_types_default()).bool
|
|
400
304
|
};
|
|
401
305
|
|
|
402
306
|
function SplitButton(_ref) {
|
|
@@ -410,7 +314,7 @@ function SplitButton(_ref) {
|
|
|
410
314
|
onClick = _ref.onClick,
|
|
411
315
|
otherProps = SplitButton_objectWithoutProperties(_ref, ["appearance", "children", "disabled", "elementRef", "inline", "onClick"]);
|
|
412
316
|
|
|
413
|
-
var filteredChildren =
|
|
317
|
+
var filteredChildren = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
414
318
|
var indexOfMain = 0;
|
|
415
319
|
var numDisabledItems = 0;
|
|
416
320
|
filteredChildren.forEach(function (item, index) {
|
|
@@ -426,7 +330,7 @@ function SplitButton(_ref) {
|
|
|
426
330
|
numDisabledItems += 1;
|
|
427
331
|
}
|
|
428
332
|
});
|
|
429
|
-
var mainButton = /*#__PURE__*/
|
|
333
|
+
var mainButton = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(filteredChildren[indexOfMain], {
|
|
430
334
|
isMain: true,
|
|
431
335
|
appearance: appearance,
|
|
432
336
|
disabled: disabled || filteredChildren[indexOfMain].props.disabled
|
|
@@ -434,17 +338,17 @@ function SplitButton(_ref) {
|
|
|
434
338
|
|
|
435
339
|
filteredChildren.splice(indexOfMain, 1);
|
|
436
340
|
var items = filteredChildren;
|
|
437
|
-
var toggle = /*#__PURE__*/external_react_default.
|
|
341
|
+
var toggle = /*#__PURE__*/external_react_default().createElement(StyledButton, {
|
|
438
342
|
prepend: true // disable toggle if all items within dropdown are disabled
|
|
439
343
|
,
|
|
440
344
|
disabled: disabled || numDisabledItems === items.length,
|
|
441
345
|
appearance: appearance,
|
|
442
346
|
"data-test": "split-button-toggle",
|
|
443
|
-
"aria-label":
|
|
444
|
-
icon: /*#__PURE__*/external_react_default.
|
|
347
|
+
"aria-label": (0,i18n_namespaceObject._)('Open more options'),
|
|
348
|
+
icon: /*#__PURE__*/external_react_default().createElement((ChevronDown_default()), null)
|
|
445
349
|
});
|
|
446
|
-
return /*#__PURE__*/external_react_default.
|
|
447
|
-
"aria-label":
|
|
350
|
+
return /*#__PURE__*/external_react_default().createElement(StyledBox, SplitButton_extends({
|
|
351
|
+
"aria-label": (0,i18n_namespaceObject._)('Split button'),
|
|
448
352
|
"data-inline": inline || null,
|
|
449
353
|
"data-test": "split-button-container",
|
|
450
354
|
elementRef: elementRef,
|
|
@@ -453,57 +357,21 @@ function SplitButton(_ref) {
|
|
|
453
357
|
flex: true,
|
|
454
358
|
role: "group",
|
|
455
359
|
onClick: disabled ? undefined : onClick
|
|
456
|
-
}, otherProps), mainButton, appearance !== 'default' && /*#__PURE__*/external_react_default.
|
|
360
|
+
}, otherProps), mainButton, appearance !== 'default' && /*#__PURE__*/external_react_default().createElement(StyledSeparator, {
|
|
457
361
|
inline: true,
|
|
458
362
|
$appearance: appearance
|
|
459
|
-
}), /*#__PURE__*/external_react_default.
|
|
363
|
+
}), /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement((Dropdown_default()), {
|
|
460
364
|
toggle: toggle
|
|
461
|
-
}, /*#__PURE__*/external_react_default.
|
|
365
|
+
}, /*#__PURE__*/external_react_default().createElement((Menu_default()), null, items))));
|
|
462
366
|
}
|
|
463
367
|
|
|
464
368
|
SplitButton.propTypes = SplitButton_propTypes;
|
|
465
369
|
SplitButton.Item = SplitButton_Item;
|
|
466
|
-
/* harmony default export */
|
|
467
|
-
|
|
468
|
-
// CONCATENATED MODULE: ./src/SplitButton/index.ts
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
/***/ }),
|
|
473
|
-
|
|
474
|
-
/***/ 22:
|
|
475
|
-
/***/ (function(module, exports) {
|
|
476
|
-
|
|
477
|
-
module.exports = require("@splunk/react-ui/Dropdown");
|
|
478
|
-
|
|
479
|
-
/***/ }),
|
|
480
|
-
|
|
481
|
-
/***/ 3:
|
|
482
|
-
/***/ (function(module, exports) {
|
|
483
|
-
|
|
484
|
-
module.exports = require("styled-components");
|
|
485
|
-
|
|
486
|
-
/***/ }),
|
|
487
|
-
|
|
488
|
-
/***/ 4:
|
|
489
|
-
/***/ (function(module, exports) {
|
|
490
|
-
|
|
491
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
492
|
-
|
|
493
|
-
/***/ }),
|
|
494
|
-
|
|
495
|
-
/***/ 5:
|
|
496
|
-
/***/ (function(module, exports) {
|
|
497
|
-
|
|
498
|
-
module.exports = require("lodash/omit");
|
|
499
|
-
|
|
500
|
-
/***/ }),
|
|
501
|
-
|
|
502
|
-
/***/ 6:
|
|
503
|
-
/***/ (function(module, exports) {
|
|
370
|
+
/* harmony default export */ const SplitButton_SplitButton = (SplitButton);
|
|
504
371
|
|
|
505
|
-
|
|
372
|
+
;// CONCATENATED MODULE: ./src/SplitButton/index.ts
|
|
506
373
|
|
|
507
|
-
/***/ })
|
|
508
374
|
|
|
509
|
-
|
|
375
|
+
module.exports = __webpack_exports__;
|
|
376
|
+
/******/ })()
|
|
377
|
+
;
|