@splunk/react-ui 4.20.0 → 4.21.1

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.
Files changed (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/TabLayout.js CHANGED
@@ -1,445 +1,413 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
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 = 210);
86
- /******/ })
87
- /************************************************************************/
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
- /***/ 11:
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = require("lodash/has");
108
-
109
- /***/ }),
110
-
111
- /***/ 124:
112
- /***/ (function(module, exports) {
113
-
114
- module.exports = require("@splunk/react-ui/TabBar");
115
-
116
- /***/ }),
117
-
118
- /***/ 2:
119
- /***/ (function(module, exports) {
120
-
121
- module.exports = require("react");
122
-
123
- /***/ }),
124
-
125
- /***/ 210:
126
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
127
-
128
- "use strict";
129
- // ESM COMPAT FLAG
130
- __webpack_require__.r(__webpack_exports__);
131
-
132
- // EXPORTS
133
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_TabLayout_TabLayout; });
134
- __webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ TabLayout_Panel; });
135
-
136
- // EXTERNAL MODULE: external "react"
137
- var external_react_ = __webpack_require__(2);
138
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
139
-
140
- // EXTERNAL MODULE: external "prop-types"
141
- var external_prop_types_ = __webpack_require__(1);
142
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
143
-
144
- // EXTERNAL MODULE: external "lodash/has"
145
- var has_ = __webpack_require__(11);
146
- var has_default = /*#__PURE__*/__webpack_require__.n(has_);
147
-
148
- // EXTERNAL MODULE: external "lodash/keys"
149
- var keys_ = __webpack_require__(9);
150
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
151
-
152
- // EXTERNAL MODULE: external "lodash/omit"
153
- var omit_ = __webpack_require__(5);
154
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
155
-
156
- // EXTERNAL MODULE: external "@splunk/ui-utils/id"
157
- var id_ = __webpack_require__(8);
158
-
159
- // EXTERNAL MODULE: external "@splunk/react-ui/TabBar"
160
- var TabBar_ = __webpack_require__(124);
161
- var TabBar_default = /*#__PURE__*/__webpack_require__.n(TabBar_);
162
-
163
- // EXTERNAL MODULE: external "styled-components"
164
- var external_styled_components_ = __webpack_require__(3);
165
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
166
-
167
- // EXTERNAL MODULE: external "@splunk/themes"
168
- var themes_ = __webpack_require__(0);
169
-
170
- // CONCATENATED MODULE: ./src/TabLayout/TabLayoutStyles.ts
171
-
172
-
173
- var StyledPanel = external_styled_components_default.a.div.withConfig({
174
- displayName: "TabLayoutStyles__StyledPanel",
175
- componentId: "lf0quy-0"
176
- })(["", ""], themes_["mixins"].reset('block'));
177
- var Styled = external_styled_components_default.a.div.withConfig({
178
- displayName: "TabLayoutStyles__Styled",
179
- componentId: "lf0quy-1"
180
- })(["text-align:center;margin-top:", ";", ""], themes_["variables"].spacingLarge, function (_ref) {
181
- var $layout = _ref.$layout;
182
- return $layout === 'vertical' && Object(external_styled_components_["css"])(["display:flex;& > [role='tablist']{flex:0 0 auto;}& > ", "{width:100%;}"],
183
- /* sc-sel */
184
- StyledPanel);
185
- });
186
-
187
- // CONCATENATED MODULE: ./src/TabLayout/Panel.tsx
188
- 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); }
189
-
190
- 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; }
191
-
192
- 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; }
193
-
194
-
195
-
196
-
197
-
198
- var propTypes = {
199
- children: external_prop_types_default.a.node,
200
- count: external_prop_types_default.a.number,
201
- disabled: external_prop_types_default.a.bool,
202
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
203
- icon: external_prop_types_default.a.node,
204
- label: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.element]),
205
- panelId: external_prop_types_default.a.string.isRequired,
206
- tooltip: external_prop_types_default.a.node
207
- };
208
-
209
- function Panel(_ref) {
210
- var children = _ref.children,
211
- _ref$disabled = _ref.disabled,
212
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
213
- elementRef = _ref.elementRef,
214
- panelId = _ref.panelId,
215
- otherProps = _objectWithoutProperties(_ref, ["children", "disabled", "elementRef", "panelId"]);
216
-
217
- // @docs-props-type PanelPropsBase
218
- return /*#__PURE__*/external_react_default.a.createElement(StyledPanel, _extends({
219
- "data-test-panel-id": panelId,
220
- "data-test": "panel",
221
- ref: elementRef,
222
- role: "tabpanel"
223
- }, omit_default()(otherProps, ['icon', 'label', 'tooltip'])), children);
224
- }
225
-
226
- Panel.propTypes = propTypes;
227
- /* harmony default export */ var TabLayout_Panel = (Panel);
228
- // CONCATENATED MODULE: ./src/TabLayout/TabLayout.tsx
229
- 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); }
230
-
231
- function TabLayout_extends() { TabLayout_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 TabLayout_extends.apply(this, arguments); }
232
-
233
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
234
-
235
- 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); } }
236
-
237
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
238
-
239
- 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); }
240
-
241
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
242
-
243
- 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); }; }
244
-
245
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
246
-
247
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
248
-
249
- 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; } }
250
-
251
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
252
-
253
- 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; }
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
- var TabLayout_propTypes = {
265
- autoActivate: external_prop_types_default.a.bool,
266
- activePanelId: external_prop_types_default.a.string,
267
- appearance: external_prop_types_default.a.oneOf(['navigation', 'context']),
268
- children: external_prop_types_default.a.node,
269
- count: external_prop_types_default.a.number,
270
- defaultActivePanelId: external_prop_types_default.a.string,
271
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
272
- iconSize: external_prop_types_default.a.oneOf(['inline', 'small', 'large']),
273
- layout: external_prop_types_default.a.oneOf(['horizontal', 'vertical']),
274
- onChange: external_prop_types_default.a.func,
275
- tabWidth: external_prop_types_default.a.number
276
- };
277
- var defaultProps = {
278
- appearance: 'navigation',
279
- iconSize: 'inline',
280
- layout: 'horizontal'
281
- };
282
-
283
- /**
284
- * The `TabLayout` is a group of managed `Panels`. Only one panel can be open at a time.
285
- * `TabLayout` supports both the controlled and uncontrolled patterns.
286
- */
287
- var TabLayout_TabLayout = /*#__PURE__*/function (_Component) {
288
- _inherits(TabLayout, _Component);
289
-
290
- var _super = _createSuper(TabLayout);
291
-
292
- // @docs-props-type TabLayoutPropsBase
293
- function TabLayout(props) {
294
- var _this;
295
-
296
- _classCallCheck(this, TabLayout);
297
-
298
- _this = _super.call(this, props);
299
-
300
- _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0);
301
-
302
- _defineProperty(_assertThisInitialized(_this), "guid", void 0);
303
-
304
- _defineProperty(_assertThisInitialized(_this), "handleChange", function (e, data) {
305
- var _this$props$onChange, _this$props;
306
-
307
- var activePanelId = data.selectedTabId;
308
-
309
- if (!_this.isControlled()) {
310
- _this.setState({
311
- activePanelId: activePanelId
312
- });
313
- }
314
-
315
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, {
316
- activePanelId: activePanelId
317
- });
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 n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
+ enumerable: true,
31
+ get: n[r]
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
+ Panel: () => /* reexport */ w,
65
+ default: () => /* reexport */ B
318
66
  });
319
-
320
- _this.controlledExternally = has_default()(props, 'activePanelId');
321
- _this.guid = Object(id_["createDOMID"])();
322
-
323
- if (!_this.isControlled()) {
324
- _this.state = {
325
- activePanelId: props.defaultActivePanelId
326
- };
67
+ // CONCATENATED MODULE: external "react"
68
+ const n = require("react");
69
+ var r = e.n(n);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const o = require("prop-types");
72
+ var a = e.n(o);
73
+ // CONCATENATED MODULE: external "lodash/has"
74
+ const i = require("lodash/has");
75
+ var l = e.n(i);
76
+ // CONCATENATED MODULE: external "lodash/keys"
77
+ const c = require("lodash/keys");
78
+ var u = e.n(c);
79
+ // CONCATENATED MODULE: external "lodash/omit"
80
+ const f = require("lodash/omit");
81
+ var s = e.n(f);
82
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
83
+ const p = require("@splunk/ui-utils/id");
84
+ // CONCATENATED MODULE: external "@splunk/react-ui/TabBar"
85
+ const d = require("@splunk/react-ui/TabBar");
86
+ var y = e.n(d);
87
+ // CONCATENATED MODULE: external "styled-components"
88
+ const v = require("styled-components");
89
+ var b = e.n(v);
90
+ // CONCATENATED MODULE: external "@splunk/themes"
91
+ const h = require("@splunk/themes");
92
+ // CONCATENATED MODULE: ./src/TabLayout/TabLayoutStyles.ts
93
+ var m = b().div.withConfig({
94
+ displayName: "TabLayoutStyles__StyledPanel",
95
+ componentId: "lf0quy-0"
96
+ })([ "", "" ], h.mixins.reset("block"));
97
+ var g = b().div.withConfig({
98
+ displayName: "TabLayoutStyles__Styled",
99
+ componentId: "lf0quy-1"
100
+ })([ "text-align:center;margin-top:", ";", "" ], h.variables.spacingLarge, (function(e) {
101
+ var t = e.$layout;
102
+ return t === "vertical" && (0, v.css)([ "display:flex;& > [role='tablist']{flex:0 0 auto;}& > ", "{width:100%;}" ],
103
+ /* sc-sel */
104
+ m);
105
+ }));
106
+ // CONCATENATED MODULE: ./src/TabLayout/Panel.tsx
107
+ function O() {
108
+ O = Object.assign || function(e) {
109
+ for (var t = 1; t < arguments.length; t++) {
110
+ var n = arguments[t];
111
+ for (var r in n) {
112
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
113
+ e[r] = n[r];
114
+ }
115
+ }
116
+ }
117
+ return e;
118
+ };
119
+ return O.apply(this, arguments);
120
+ }
121
+ function P(e, t) {
122
+ if (e == null) return {};
123
+ var n = I(e, t);
124
+ var r, o;
125
+ if (Object.getOwnPropertySymbols) {
126
+ var a = Object.getOwnPropertySymbols(e);
127
+ for (o = 0; o < a.length; o++) {
128
+ r = a[o];
129
+ if (t.indexOf(r) >= 0) continue;
130
+ if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
131
+ n[r] = e[r];
132
+ }
133
+ }
134
+ return n;
135
+ }
136
+ function I(e, t) {
137
+ if (e == null) return {};
138
+ var n = {};
139
+ var r = Object.keys(e);
140
+ var o, a;
141
+ for (a = 0; a < r.length; a++) {
142
+ o = r[a];
143
+ if (t.indexOf(o) >= 0) continue;
144
+ n[o] = e[o];
145
+ }
146
+ return n;
327
147
  }
328
-
329
- if (false) {}
330
-
331
- return _this;
332
- }
333
-
334
- _createClass(TabLayout, [{
335
- key: "componentDidUpdate",
336
- value: function componentDidUpdate(prevProps) {
337
- if (false) {}
338
-
339
- if (false) {}
148
+ var S = {
149
+ children: a().node,
150
+ count: a().number,
151
+ disabled: a().bool,
152
+ elementRef: a().oneOfType([ a().func, a().object ]),
153
+ icon: a().node,
154
+ label: a().oneOfType([ a().string, a().element ]),
155
+ panelId: a().string.isRequired,
156
+ tooltip: a().node
157
+ };
158
+ function j(e) {
159
+ var t = e.children, n = e.disabled, o = n === void 0 ? false : n, a = e.elementRef, i = e.panelId, l = P(e, [ "children", "disabled", "elementRef", "panelId" ]);
160
+ // @docs-props-type PanelPropsBase
161
+
162
+ return r().createElement(m, O({
163
+ "data-test-panel-id": i,
164
+ "data-test": "panel",
165
+ ref: a,
166
+ role: "tabpanel"
167
+ }, s()(l, [ "icon", "label", "tooltip" ])), t);
168
+ }
169
+ j.propTypes = S;
170
+ /* harmony default export */ const w = j;
171
+ // CONCATENATED MODULE: ./src/TabLayout/TabLayout.tsx
172
+ function T(e) {
173
+ "@babel/helpers - typeof";
174
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
175
+ T = function e(t) {
176
+ return typeof t;
177
+ };
178
+ } else {
179
+ T = function e(t) {
180
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
181
+ };
182
+ }
183
+ return T(e);
184
+ }
185
+ function _() {
186
+ _ = Object.assign || function(e) {
187
+ for (var t = 1; t < arguments.length; t++) {
188
+ var n = arguments[t];
189
+ for (var r in n) {
190
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
191
+ e[r] = n[r];
192
+ }
193
+ }
194
+ }
195
+ return e;
196
+ };
197
+ return _.apply(this, arguments);
198
+ }
199
+ function C(e, t) {
200
+ if (!(e instanceof t)) {
201
+ throw new TypeError("Cannot call a class as a function");
202
+ }
203
+ }
204
+ function x(e, t) {
205
+ for (var n = 0; n < t.length; n++) {
206
+ var r = t[n];
207
+ r.enumerable = r.enumerable || false;
208
+ r.configurable = true;
209
+ if ("value" in r) r.writable = true;
210
+ Object.defineProperty(e, r.key, r);
211
+ }
340
212
  }
341
- }, {
342
- key: "isControlled",
343
- value: function isControlled() {
344
- return this.controlledExternally;
213
+ function E(e, t, n) {
214
+ if (t) x(e.prototype, t);
215
+ if (n) x(e, n);
216
+ return e;
345
217
  }
346
- }, {
347
- key: "render",
348
- value: function render() {
349
- var _this2 = this;
350
-
351
- var _this$props2 = this.props,
352
- children = _this$props2.children,
353
- layout = _this$props2.layout;
354
- var activePanelId = this.isControlled() ? this.props.activePanelId : this.state.activePanelId;
355
- var panel;
356
- var tabs = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) {
357
- var props = child.props;
358
- var id = "".concat(_this2.guid, "-").concat(props.panelId);
359
- var tabId = "".concat(_this2.guid, "-").concat(props.panelId, "-tab");
360
-
361
- if (props.panelId === activePanelId) {
362
- panel = /*#__PURE__*/Object(external_react_["cloneElement"])(child, {
363
- 'aria-labelledby': tabId,
364
- id: id
365
- });
218
+ function q(e, t) {
219
+ if (typeof t !== "function" && t !== null) {
220
+ throw new TypeError("Super expression must either be null or a function");
366
221
  }
367
-
368
- return /*#__PURE__*/external_react_default.a.createElement(TabBar_default.a.Tab, {
369
- count: props.count,
370
- icon: props.icon,
371
- key: props.panelId,
372
- label: props.label,
373
- tabId: props.panelId,
374
- id: tabId,
375
- ariaControls: id,
376
- tooltip: props.tooltip,
377
- disabled: props.disabled
222
+ e.prototype = Object.create(t && t.prototype, {
223
+ constructor: {
224
+ value: e,
225
+ writable: true,
226
+ configurable: true
227
+ }
378
228
  });
379
- });
380
-
381
- if (false) {}
382
-
383
- return /*#__PURE__*/external_react_default.a.createElement(Styled, TabLayout_extends({
384
- "data-test-active-panel-id": activePanelId,
385
- "data-test": "tab-layout",
386
- ref: this.props.elementRef,
387
- $layout: layout
388
- }, omit_default()(this.props, keys_default()(TabLayout.propTypes))), /*#__PURE__*/external_react_default.a.createElement(TabBar_default.a, {
389
- autoActivate: this.props.autoActivate,
390
- activeTabId: activePanelId,
391
- appearance: this.props.appearance,
392
- iconSize: this.props.iconSize,
393
- layout: this.props.layout,
394
- onChange: this.handleChange,
395
- tabWidth: this.props.tabWidth
396
- }, tabs), panel);
229
+ if (t) R(e, t);
397
230
  }
398
- }]);
399
-
400
- return TabLayout;
401
- }(external_react_["Component"]);
402
-
403
- _defineProperty(TabLayout_TabLayout, "propTypes", TabLayout_propTypes);
404
-
405
- _defineProperty(TabLayout_TabLayout, "defaultProps", defaultProps);
406
-
407
- _defineProperty(TabLayout_TabLayout, "Panel", TabLayout_Panel);
408
-
409
- /* harmony default export */ var src_TabLayout_TabLayout = (TabLayout_TabLayout);
410
-
411
- // CONCATENATED MODULE: ./src/TabLayout/index.ts
412
-
413
-
414
-
415
- /***/ }),
416
-
417
- /***/ 3:
418
- /***/ (function(module, exports) {
419
-
420
- module.exports = require("styled-components");
421
-
422
- /***/ }),
423
-
424
- /***/ 5:
425
- /***/ (function(module, exports) {
426
-
427
- module.exports = require("lodash/omit");
428
-
429
- /***/ }),
430
-
431
- /***/ 8:
432
- /***/ (function(module, exports) {
433
-
434
- module.exports = require("@splunk/ui-utils/id");
435
-
436
- /***/ }),
437
-
438
- /***/ 9:
439
- /***/ (function(module, exports) {
440
-
441
- module.exports = require("lodash/keys");
442
-
443
- /***/ })
444
-
445
- /******/ });
231
+ function R(e, t) {
232
+ R = Object.setPrototypeOf || function e(t, n) {
233
+ t.__proto__ = n;
234
+ return t;
235
+ };
236
+ return R(e, t);
237
+ }
238
+ function k(e) {
239
+ var t = D();
240
+ return function n() {
241
+ var r = M(e), o;
242
+ if (t) {
243
+ var a = M(this).constructor;
244
+ o = Reflect.construct(r, arguments, a);
245
+ } else {
246
+ o = r.apply(this, arguments);
247
+ }
248
+ return z(this, o);
249
+ };
250
+ }
251
+ function z(e, t) {
252
+ if (t && (T(t) === "object" || typeof t === "function")) {
253
+ return t;
254
+ }
255
+ return A(e);
256
+ }
257
+ function A(e) {
258
+ if (e === void 0) {
259
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
260
+ }
261
+ return e;
262
+ }
263
+ function D() {
264
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
265
+ if (Reflect.construct.sham) return false;
266
+ if (typeof Proxy === "function") return true;
267
+ try {
268
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
269
+ return true;
270
+ } catch (e) {
271
+ return false;
272
+ }
273
+ }
274
+ function M(e) {
275
+ M = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
276
+ return t.__proto__ || Object.getPrototypeOf(t);
277
+ };
278
+ return M(e);
279
+ }
280
+ function L(e, t, n) {
281
+ if (t in e) {
282
+ Object.defineProperty(e, t, {
283
+ value: n,
284
+ enumerable: true,
285
+ configurable: true,
286
+ writable: true
287
+ });
288
+ } else {
289
+ e[t] = n;
290
+ }
291
+ return e;
292
+ }
293
+ var W = {
294
+ autoActivate: a().bool,
295
+ activePanelId: a().string,
296
+ appearance: a().oneOf([ "navigation", "context" ]),
297
+ children: a().node,
298
+ count: a().number,
299
+ defaultActivePanelId: a().string,
300
+ elementRef: a().oneOfType([ a().func, a().object ]),
301
+ iconSize: a().oneOf([ "inline", "small", "large" ]),
302
+ layout: a().oneOf([ "horizontal", "vertical" ]),
303
+ onChange: a().func,
304
+ tabWidth: a().number
305
+ };
306
+ var N = {
307
+ appearance: "navigation",
308
+ iconSize: "inline",
309
+ layout: "horizontal"
310
+ };
311
+ /**
312
+ * The `TabLayout` is a group of managed `Panels`. Only one panel can be open at a time.
313
+ * `TabLayout` supports both the controlled and uncontrolled patterns.
314
+ */ var $ = function(e) {
315
+ q(o, e);
316
+ var t = k(o);
317
+ // @docs-props-type TabLayoutPropsBase
318
+ function o(e) {
319
+ var n;
320
+ C(this, o);
321
+ n = t.call(this, e);
322
+ L(A(n), "controlledExternally", void 0);
323
+ L(A(n), "guid", void 0);
324
+ L(A(n), "handleChange", (function(e, t) {
325
+ var r, o;
326
+ var a = t.selectedTabId;
327
+ if (!n.isControlled()) {
328
+ n.setState({
329
+ activePanelId: a
330
+ });
331
+ }
332
+ (r = (o = n.props).onChange) === null || r === void 0 ? void 0 : r.call(o, e, {
333
+ activePanelId: a
334
+ });
335
+ }));
336
+ n.controlledExternally = l()(e, "activePanelId");
337
+ n.guid = (0, p.createDOMID)();
338
+ if (!n.isControlled()) {
339
+ n.state = {
340
+ activePanelId: e.defaultActivePanelId
341
+ };
342
+ }
343
+ if (false) {}
344
+ return n;
345
+ }
346
+ E(o, [ {
347
+ key: "componentDidUpdate",
348
+ value: function e(t) {
349
+ if (false) {}
350
+ if (false) {}
351
+ }
352
+ }, {
353
+ key: "isControlled",
354
+ value: function e() {
355
+ return this.controlledExternally;
356
+ }
357
+ }, {
358
+ key: "render",
359
+ value: function e() {
360
+ var t = this;
361
+ var a = this.props, i = a.children, l = a.layout;
362
+ var c = this.isControlled() ? this.props.activePanelId : this.state.activePanelId;
363
+ var f;
364
+ var p = n.Children.toArray(i).filter(n.isValidElement).map((function(e) {
365
+ var o = e.props;
366
+ var a = "".concat(t.guid, "-").concat(o.panelId);
367
+ var i = "".concat(t.guid, "-").concat(o.panelId, "-tab");
368
+ if (o.panelId === c) {
369
+ f = (0, n.cloneElement)(e, {
370
+ "aria-labelledby": i,
371
+ id: a
372
+ });
373
+ }
374
+
375
+ return r().createElement(y().Tab, {
376
+ count: o.count,
377
+ icon: o.icon,
378
+ key: o.panelId,
379
+ label: o.label,
380
+ tabId: o.panelId,
381
+ id: i,
382
+ ariaControls: a,
383
+ tooltip: o.tooltip,
384
+ disabled: o.disabled
385
+ });
386
+ }));
387
+ if (false) {}
388
+
389
+ return r().createElement(g, _({
390
+ "data-test-active-panel-id": c,
391
+ "data-test": "tab-layout",
392
+ ref: this.props.elementRef,
393
+ $layout: l
394
+ }, s()(this.props, u()(o.propTypes))), r().createElement(y(), {
395
+ autoActivate: this.props.autoActivate,
396
+ activeTabId: c,
397
+ appearance: this.props.appearance,
398
+ iconSize: this.props.iconSize,
399
+ layout: this.props.layout,
400
+ onChange: this.handleChange,
401
+ tabWidth: this.props.tabWidth
402
+ }, p), f);
403
+ }
404
+ } ]);
405
+ return o;
406
+ }(n.Component);
407
+ L($, "propTypes", W);
408
+ L($, "defaultProps", N);
409
+ L($, "Panel", w);
410
+ /* harmony default export */ const B = $;
411
+ // CONCATENATED MODULE: ./src/TabLayout/index.ts
412
+ module.exports = t;
413
+ /******/})();