@splunk/react-ui 4.21.0 → 4.22.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 +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +24 -3
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1807 -2084
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1068 -1068
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +903 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1104 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3564 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +634 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +479 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +756 -650
- package/Select.js +2446 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +680 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +741 -680
- package/TabLayout.js +406 -322
- package/Table.js +4974 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +7 -7
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/SplitButton.js
CHANGED
|
@@ -1,377 +1,474 @@
|
|
|
1
|
-
/******/ (() => {
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}))
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
Item: () => /* reexport */ F,
|
|
65
|
+
default: () => /* reexport */ U
|
|
66
|
+
});
|
|
67
|
+
// CONCATENATED MODULE: external "react"
|
|
68
|
+
const r = require("react");
|
|
69
|
+
var n = e.n(r);
|
|
70
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
+
const i = require("prop-types");
|
|
72
|
+
var a = e.n(i);
|
|
73
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronDown"
|
|
74
|
+
const o = require("@splunk/react-icons/enterprise/ChevronDown");
|
|
75
|
+
var l = e.n(o);
|
|
76
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
77
|
+
const c = require("@splunk/react-ui/Dropdown");
|
|
78
|
+
var u = e.n(c);
|
|
79
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
80
|
+
const s = require("@splunk/react-ui/Menu");
|
|
81
|
+
var p = e.n(s);
|
|
82
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
83
|
+
const f = require("@splunk/ui-utils/i18n");
|
|
84
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
85
|
+
const d = require("styled-components");
|
|
86
|
+
var v = e.n(d);
|
|
87
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
88
|
+
const b = require("@splunk/react-ui/Button");
|
|
89
|
+
var y = e.n(b);
|
|
90
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
91
|
+
const h = require("@splunk/react-ui/Box");
|
|
92
|
+
var m = e.n(h);
|
|
93
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
94
|
+
const g = require("@splunk/themes");
|
|
95
|
+
// CONCATENATED MODULE: ./src/SplitButton/SplitButtonStyles.ts
|
|
96
|
+
var O = v()(y()).withConfig({
|
|
97
|
+
displayName: "SplitButtonStyles__StyledButton",
|
|
98
|
+
componentId: "sc-9igsyh-0"
|
|
99
|
+
})([ "", "" ], (0, g.pick)({
|
|
100
|
+
prisma: function e(t) {
|
|
101
|
+
var r = t.appearance;
|
|
102
|
+
return r === "default" && (0, d.css)([ "&:first-child{border-right:1px solid ", ";}" ], g.variables.interactiveColorBorder);
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
var k = v()(m()).withConfig({
|
|
106
|
+
displayName: "SplitButtonStyles__StyledSeparator",
|
|
107
|
+
componentId: "sc-9igsyh-1"
|
|
108
|
+
})([ "width:", ";height:", ";background-color:", ";" ], (0, g.pick)({
|
|
109
|
+
prisma: (0, g.pickVariant)("$appearance", {
|
|
110
|
+
primary: "2px",
|
|
111
|
+
destructive: "2px"
|
|
112
|
+
}),
|
|
113
|
+
enterprise: "1px"
|
|
114
|
+
}), g.variables.inputHeight, (0, g.pickVariant)("$appearance", {
|
|
115
|
+
primary: {
|
|
116
|
+
enterprise: g.variables.white,
|
|
117
|
+
prisma: {
|
|
118
|
+
light: g.variables.white,
|
|
119
|
+
dark: g.variables.black
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
destructive: {
|
|
123
|
+
enterprise: {
|
|
124
|
+
light: g.variables.white,
|
|
125
|
+
dark: g.variables.black
|
|
126
|
+
},
|
|
127
|
+
prisma: {
|
|
128
|
+
light: g.variables.white,
|
|
129
|
+
dark: g.variables.black
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}));
|
|
133
|
+
var w = v()(m()).withConfig({
|
|
134
|
+
displayName: "SplitButtonStyles__StyledBox",
|
|
135
|
+
componentId: "sc-9igsyh-2"
|
|
136
|
+
})([ "", " [data-inline] + &{margin-left:", ";}" ], (function(e) {
|
|
137
|
+
var t = e.$inline;
|
|
138
|
+
return !t && (0, d.css)([ "width:100%;" ]);
|
|
139
|
+
}), (0, g.pick)({
|
|
140
|
+
enterprise: g.variables.spacingHalf,
|
|
141
|
+
prisma: g.variables.spacingSmall
|
|
142
|
+
}));
|
|
143
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
144
|
+
const S = require("lodash/omit");
|
|
145
|
+
var j = e.n(S);
|
|
146
|
+
// CONCATENATED MODULE: ./src/SplitButton/Item.tsx
|
|
147
|
+
function _(e) {
|
|
148
|
+
"@babel/helpers - typeof";
|
|
149
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
150
|
+
_ = function e(t) {
|
|
151
|
+
return typeof t;
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
_ = function e(t) {
|
|
155
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return _(e);
|
|
115
159
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
160
|
+
function C() {
|
|
161
|
+
C = Object.assign || function(e) {
|
|
162
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
163
|
+
var r = arguments[t];
|
|
164
|
+
for (var n in r) {
|
|
165
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
166
|
+
e[n] = r[n];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return e;
|
|
171
|
+
};
|
|
172
|
+
return C.apply(this, arguments);
|
|
125
173
|
}
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const omit_namespaceObject = require("lodash/omit");
|
|
141
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
|
|
142
|
-
;// CONCATENATED MODULE: ./src/SplitButton/Item.tsx
|
|
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); }
|
|
144
|
-
|
|
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); }
|
|
146
|
-
|
|
147
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _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; }
|
|
148
|
-
|
|
149
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
150
|
-
|
|
151
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
152
|
-
|
|
153
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
154
|
-
|
|
155
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
156
|
-
|
|
157
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
158
|
-
|
|
159
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
160
|
-
|
|
161
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
162
|
-
|
|
163
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
164
|
-
|
|
165
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
166
|
-
|
|
167
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
168
|
-
|
|
169
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
170
|
-
|
|
171
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var propTypes = {
|
|
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
|
|
184
|
-
};
|
|
185
|
-
var defaultProps = {
|
|
186
|
-
appearance: 'default'
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* An item within a `SplitButton`. This inherits from
|
|
191
|
-
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
192
|
-
* so any elements passed to it must also be pure.
|
|
193
|
-
*/
|
|
194
|
-
var Item = /*#__PURE__*/function (_PureComponent) {
|
|
195
|
-
_inherits(Item, _PureComponent);
|
|
196
|
-
|
|
197
|
-
var _super = _createSuper(Item);
|
|
198
|
-
|
|
199
|
-
function Item() {
|
|
200
|
-
var _this;
|
|
201
|
-
|
|
202
|
-
_classCallCheck(this, Item);
|
|
203
|
-
|
|
204
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
205
|
-
args[_key] = arguments[_key];
|
|
174
|
+
function P(e, t) {
|
|
175
|
+
if (e == null) return {};
|
|
176
|
+
var r = E(e, t);
|
|
177
|
+
var n, i;
|
|
178
|
+
if (Object.getOwnPropertySymbols) {
|
|
179
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
180
|
+
for (i = 0; i < a.length; i++) {
|
|
181
|
+
n = a[i];
|
|
182
|
+
if (t.indexOf(n) >= 0) continue;
|
|
183
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
184
|
+
r[n] = e[n];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return r;
|
|
206
188
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
189
|
+
function E(e, t) {
|
|
190
|
+
if (e == null) return {};
|
|
191
|
+
var r = {};
|
|
192
|
+
var n = Object.keys(e);
|
|
193
|
+
var i, a;
|
|
194
|
+
for (a = 0; a < n.length; a++) {
|
|
195
|
+
i = n[a];
|
|
196
|
+
if (t.indexOf(i) >= 0) continue;
|
|
197
|
+
r[i] = e[i];
|
|
198
|
+
}
|
|
199
|
+
return r;
|
|
200
|
+
}
|
|
201
|
+
function x(e, t) {
|
|
202
|
+
if (!(e instanceof t)) {
|
|
203
|
+
throw new TypeError("Cannot call a class as a function");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function I(e, t) {
|
|
207
|
+
for (var r = 0; r < t.length; r++) {
|
|
208
|
+
var n = t[r];
|
|
209
|
+
n.enumerable = n.enumerable || false;
|
|
210
|
+
n.configurable = true;
|
|
211
|
+
if ("value" in n) n.writable = true;
|
|
212
|
+
Object.defineProperty(e, n.key, n);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function q(e, t, r) {
|
|
216
|
+
if (t) I(e.prototype, t);
|
|
217
|
+
if (r) I(e, r);
|
|
218
|
+
return e;
|
|
219
|
+
}
|
|
220
|
+
function R(e, t) {
|
|
221
|
+
if (typeof t !== "function" && t !== null) {
|
|
222
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
223
|
+
}
|
|
224
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
225
|
+
constructor: {
|
|
226
|
+
value: e,
|
|
227
|
+
writable: true,
|
|
228
|
+
configurable: true
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
if (t) M(e, t);
|
|
232
|
+
}
|
|
233
|
+
function M(e, t) {
|
|
234
|
+
M = Object.setPrototypeOf || function e(t, r) {
|
|
235
|
+
t.__proto__ = r;
|
|
236
|
+
return t;
|
|
237
|
+
};
|
|
238
|
+
return M(e, t);
|
|
231
239
|
}
|
|
240
|
+
function B(e) {
|
|
241
|
+
var t = V();
|
|
242
|
+
return function r() {
|
|
243
|
+
var n = $(e), i;
|
|
244
|
+
if (t) {
|
|
245
|
+
var a = $(this).constructor;
|
|
246
|
+
i = Reflect.construct(n, arguments, a);
|
|
247
|
+
} else {
|
|
248
|
+
i = n.apply(this, arguments);
|
|
249
|
+
}
|
|
250
|
+
return T(this, i);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function T(e, t) {
|
|
254
|
+
if (t && (_(t) === "object" || typeof t === "function")) {
|
|
255
|
+
return t;
|
|
256
|
+
}
|
|
257
|
+
return N(e);
|
|
258
|
+
}
|
|
259
|
+
function N(e) {
|
|
260
|
+
if (e === void 0) {
|
|
261
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
262
|
+
}
|
|
263
|
+
return e;
|
|
264
|
+
}
|
|
265
|
+
function V() {
|
|
266
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
267
|
+
if (Reflect.construct.sham) return false;
|
|
268
|
+
if (typeof Proxy === "function") return true;
|
|
269
|
+
try {
|
|
270
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
271
|
+
return true;
|
|
272
|
+
} catch (e) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function $(e) {
|
|
277
|
+
$ = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
278
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
279
|
+
};
|
|
280
|
+
return $(e);
|
|
281
|
+
}
|
|
282
|
+
function D(e, t, r) {
|
|
283
|
+
if (t in e) {
|
|
284
|
+
Object.defineProperty(e, t, {
|
|
285
|
+
value: r,
|
|
286
|
+
enumerable: true,
|
|
287
|
+
configurable: true,
|
|
288
|
+
writable: true
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
e[t] = r;
|
|
292
|
+
}
|
|
293
|
+
return e;
|
|
294
|
+
}
|
|
295
|
+
var A = {
|
|
296
|
+
appearance: a().oneOf([ "default", "primary", "destructive" ]),
|
|
297
|
+
children: a().node,
|
|
298
|
+
disabled: a().bool,
|
|
299
|
+
isMain: a().bool,
|
|
300
|
+
onClick: a().func
|
|
301
|
+
};
|
|
302
|
+
var H = {
|
|
303
|
+
appearance: "default"
|
|
304
|
+
};
|
|
232
305
|
/**
|
|
306
|
+
* An item within a `SplitButton`. This inherits from
|
|
307
|
+
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
308
|
+
* so any elements passed to it must also be pure.
|
|
309
|
+
*/ var z = function(e) {
|
|
310
|
+
R(r, e);
|
|
311
|
+
var t = B(r);
|
|
312
|
+
function r() {
|
|
313
|
+
var e;
|
|
314
|
+
x(this, r);
|
|
315
|
+
for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++) {
|
|
316
|
+
i[a] = arguments[a];
|
|
317
|
+
}
|
|
318
|
+
e = t.call.apply(t, [ this ].concat(i));
|
|
319
|
+
D(N(e), "item", null);
|
|
320
|
+
D(N(e), "handleClick", (function(t) {
|
|
321
|
+
var r = e.props, n = r.disabled, i = r.onClick;
|
|
322
|
+
if (!n) {
|
|
323
|
+
i === null || i === void 0 ? void 0 : i(t);
|
|
324
|
+
}
|
|
325
|
+
}));
|
|
326
|
+
return e;
|
|
327
|
+
}
|
|
328
|
+
q(r, [ {
|
|
329
|
+
key: "scrollIntoViewIfNeeded",
|
|
330
|
+
value: function e() {
|
|
331
|
+
var t;
|
|
332
|
+
(t = this.item) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
233
335
|
* Place focus on the item.
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
336
|
+
*/ }, {
|
|
337
|
+
key: "focus",
|
|
338
|
+
value: function e() {
|
|
339
|
+
var t;
|
|
340
|
+
(t = this.item) === null || t === void 0 ? void 0 : t.focus();
|
|
341
|
+
}
|
|
342
|
+
}, {
|
|
343
|
+
key: "render",
|
|
344
|
+
value: function e() {
|
|
345
|
+
var t = this;
|
|
346
|
+
var r = this.props, i = r.disabled, a = r.isMain, o = r.children, l = r.appearance, c = P(r, [ "disabled", "isMain", "children", "appearance" ]);
|
|
347
|
+
if (a) {
|
|
348
|
+
|
|
349
|
+
return n().createElement(O, C({
|
|
350
|
+
onClick: this.handleClick,
|
|
351
|
+
disabled: i,
|
|
352
|
+
append: true,
|
|
353
|
+
appearance: l
|
|
354
|
+
}, c), o);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return n().createElement(p().Item, C({
|
|
358
|
+
ref: function e(r) {
|
|
359
|
+
t.item = r;
|
|
360
|
+
},
|
|
361
|
+
onClick: this.handleClick,
|
|
362
|
+
disabled: i
|
|
363
|
+
}, j()(c, [ "role" ])), o);
|
|
364
|
+
}
|
|
365
|
+
} ]);
|
|
366
|
+
return r;
|
|
367
|
+
}(r.PureComponent);
|
|
368
|
+
D(z, "propTypes", A);
|
|
369
|
+
D(z, "defaultProps", H);
|
|
370
|
+
/* harmony default export */ const F = z;
|
|
371
|
+
// CONCATENATED MODULE: ./src/SplitButton/SplitButton.tsx
|
|
372
|
+
function G() {
|
|
373
|
+
G = Object.assign || function(e) {
|
|
374
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
375
|
+
var r = arguments[t];
|
|
376
|
+
for (var n in r) {
|
|
377
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
378
|
+
e[n] = r[n];
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return e;
|
|
383
|
+
};
|
|
384
|
+
return G.apply(this, arguments);
|
|
242
385
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return
|
|
257
|
-
onClick: this.handleClick,
|
|
258
|
-
disabled: disabled,
|
|
259
|
-
append: true,
|
|
260
|
-
appearance: appearance
|
|
261
|
-
}, otherProps), children);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return /*#__PURE__*/external_react_default().createElement((Menu_default()).Item, _extends({
|
|
265
|
-
ref: function ref(c) {
|
|
266
|
-
_this2.item = c;
|
|
267
|
-
},
|
|
268
|
-
onClick: this.handleClick,
|
|
269
|
-
disabled: disabled
|
|
270
|
-
}, omit_default()(otherProps, ['role'])), children);
|
|
386
|
+
function J(e, t) {
|
|
387
|
+
if (e == null) return {};
|
|
388
|
+
var r = K(e, t);
|
|
389
|
+
var n, i;
|
|
390
|
+
if (Object.getOwnPropertySymbols) {
|
|
391
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
392
|
+
for (i = 0; i < a.length; i++) {
|
|
393
|
+
n = a[i];
|
|
394
|
+
if (t.indexOf(n) >= 0) continue;
|
|
395
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
396
|
+
r[n] = e[n];
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return r;
|
|
271
400
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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); }
|
|
284
|
-
|
|
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; }
|
|
286
|
-
|
|
287
|
-
function SplitButton_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
var SplitButton_propTypes = {
|
|
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
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
function SplitButton(_ref) {
|
|
307
|
-
var _ref$appearance = _ref.appearance,
|
|
308
|
-
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
309
|
-
children = _ref.children,
|
|
310
|
-
disabled = _ref.disabled,
|
|
311
|
-
elementRef = _ref.elementRef,
|
|
312
|
-
_ref$inline = _ref.inline,
|
|
313
|
-
inline = _ref$inline === void 0 ? true : _ref$inline,
|
|
314
|
-
onClick = _ref.onClick,
|
|
315
|
-
otherProps = SplitButton_objectWithoutProperties(_ref, ["appearance", "children", "disabled", "elementRef", "inline", "onClick"]);
|
|
316
|
-
|
|
317
|
-
var filteredChildren = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
318
|
-
var indexOfMain = 0;
|
|
319
|
-
var numDisabledItems = 0;
|
|
320
|
-
filteredChildren.forEach(function (item, index) {
|
|
321
|
-
var _item$props = item.props,
|
|
322
|
-
itemDisabled = _item$props.disabled,
|
|
323
|
-
itemIsMain = _item$props.isMain;
|
|
324
|
-
|
|
325
|
-
if (itemIsMain) {
|
|
326
|
-
indexOfMain = index;
|
|
401
|
+
function K(e, t) {
|
|
402
|
+
if (e == null) return {};
|
|
403
|
+
var r = {};
|
|
404
|
+
var n = Object.keys(e);
|
|
405
|
+
var i, a;
|
|
406
|
+
for (a = 0; a < n.length; a++) {
|
|
407
|
+
i = n[a];
|
|
408
|
+
if (t.indexOf(i) >= 0) continue;
|
|
409
|
+
r[i] = e[i];
|
|
410
|
+
}
|
|
411
|
+
return r;
|
|
327
412
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
413
|
+
var L = {
|
|
414
|
+
appearance: a().oneOf([ "default", "primary", "destructive" ]),
|
|
415
|
+
children: a().node,
|
|
416
|
+
disabled: a().bool,
|
|
417
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
418
|
+
onClick: a().func,
|
|
419
|
+
inline: a().bool
|
|
420
|
+
};
|
|
421
|
+
function Q(e) {
|
|
422
|
+
var t = e.appearance, i = t === void 0 ? "default" : t, a = e.children, o = e.disabled, c = e.elementRef, s = e.inline, d = s === void 0 ? true : s, v = e.onClick, b = J(e, [ "appearance", "children", "disabled", "elementRef", "inline", "onClick" ]);
|
|
423
|
+
var y = r.Children.toArray(a).filter(r.isValidElement);
|
|
424
|
+
var h = 0;
|
|
425
|
+
var m = 0;
|
|
426
|
+
y.forEach((function(e, t) {
|
|
427
|
+
var r = e.props, n = r.disabled, i = r.isMain;
|
|
428
|
+
if (i) {
|
|
429
|
+
h = t;
|
|
430
|
+
}
|
|
431
|
+
if (n) {
|
|
432
|
+
m += 1;
|
|
433
|
+
}
|
|
434
|
+
}));
|
|
435
|
+
var g = (0, r.cloneElement)(y[h], {
|
|
436
|
+
isMain: true,
|
|
437
|
+
appearance: i,
|
|
438
|
+
disabled: o || y[h].props.disabled
|
|
439
|
+
});
|
|
440
|
+
// Remove mainButton from array of dropdown items
|
|
441
|
+
y.splice(h, 1);
|
|
442
|
+
var S = y;
|
|
443
|
+
var j = n().createElement(O, {
|
|
444
|
+
prepend: true,
|
|
445
|
+
disabled: o || m === S.length,
|
|
446
|
+
appearance: i,
|
|
447
|
+
"data-test": "split-button-toggle",
|
|
448
|
+
"aria-label": (0, f._)("Open more options"),
|
|
449
|
+
icon: n().createElement(l(), null)
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
return n().createElement(w, G({
|
|
453
|
+
"aria-label": (0, f._)("Split button"),
|
|
454
|
+
"data-inline": d || null,
|
|
455
|
+
"data-test": "split-button-container",
|
|
456
|
+
elementRef: c,
|
|
457
|
+
$inline: d,
|
|
458
|
+
inline: true,
|
|
459
|
+
flex: true,
|
|
460
|
+
role: "group",
|
|
461
|
+
onClick: o ? undefined : v
|
|
462
|
+
}, b), g, i !== "default" && n().createElement(k, {
|
|
463
|
+
inline: true,
|
|
464
|
+
$appearance: i
|
|
465
|
+
}), n().createElement("div", null, n().createElement(u(), {
|
|
466
|
+
toggle: j
|
|
467
|
+
}, n().createElement(p(), null, S))));
|
|
331
468
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
filteredChildren.splice(indexOfMain, 1);
|
|
340
|
-
var items = filteredChildren;
|
|
341
|
-
var toggle = /*#__PURE__*/external_react_default().createElement(StyledButton, {
|
|
342
|
-
prepend: true // disable toggle if all items within dropdown are disabled
|
|
343
|
-
,
|
|
344
|
-
disabled: disabled || numDisabledItems === items.length,
|
|
345
|
-
appearance: appearance,
|
|
346
|
-
"data-test": "split-button-toggle",
|
|
347
|
-
"aria-label": (0,i18n_namespaceObject._)('Open more options'),
|
|
348
|
-
icon: /*#__PURE__*/external_react_default().createElement((ChevronDown_default()), null)
|
|
349
|
-
});
|
|
350
|
-
return /*#__PURE__*/external_react_default().createElement(StyledBox, SplitButton_extends({
|
|
351
|
-
"aria-label": (0,i18n_namespaceObject._)('Split button'),
|
|
352
|
-
"data-inline": inline || null,
|
|
353
|
-
"data-test": "split-button-container",
|
|
354
|
-
elementRef: elementRef,
|
|
355
|
-
$inline: inline,
|
|
356
|
-
inline: true,
|
|
357
|
-
flex: true,
|
|
358
|
-
role: "group",
|
|
359
|
-
onClick: disabled ? undefined : onClick
|
|
360
|
-
}, otherProps), mainButton, appearance !== 'default' && /*#__PURE__*/external_react_default().createElement(StyledSeparator, {
|
|
361
|
-
inline: true,
|
|
362
|
-
$appearance: appearance
|
|
363
|
-
}), /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement((Dropdown_default()), {
|
|
364
|
-
toggle: toggle
|
|
365
|
-
}, /*#__PURE__*/external_react_default().createElement((Menu_default()), null, items))));
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
SplitButton.propTypes = SplitButton_propTypes;
|
|
369
|
-
SplitButton.Item = SplitButton_Item;
|
|
370
|
-
/* harmony default export */ const SplitButton_SplitButton = (SplitButton);
|
|
371
|
-
|
|
372
|
-
;// CONCATENATED MODULE: ./src/SplitButton/index.ts
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
module.exports = __webpack_exports__;
|
|
376
|
-
/******/ })()
|
|
377
|
-
;
|
|
469
|
+
Q.propTypes = L;
|
|
470
|
+
Q.Item = F;
|
|
471
|
+
/* harmony default export */ const U = Q;
|
|
472
|
+
// CONCATENATED MODULE: ./src/SplitButton/index.ts
|
|
473
|
+
module.exports = t;
|
|
474
|
+
/******/})();
|