@splunk/react-ui 4.3.0 → 4.5.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 +37 -21
- package/Anchor.js +2 -2
- package/Animation.js +2 -2
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +36 -12
- package/ButtonGroup.js +27 -6
- package/ButtonSimple.js +6 -6
- package/CHANGELOG.md +57 -0
- package/Calendar.js +14 -14
- package/Card.js +51 -25
- package/CardLayout.js +31 -10
- package/Chip.js +77 -53
- package/Clickable.js +6 -6
- package/CloseButton.js +6 -6
- package/Code.js +1279 -1120
- package/CollapsiblePanel.js +6 -6
- package/Color.js +180 -209
- package/ColumnLayout.js +4 -4
- package/ComboBox.js +22 -17
- package/Concertina.js +56 -51
- package/ControlGroup.js +121 -32
- package/Date.js +62 -25
- package/DefinitionList.js +2 -2
- package/Dropdown.js +12 -12
- package/EventListener.js +168 -0
- package/FetchOptions.js +8 -8
- package/File.js +122 -96
- package/FormRows.js +66 -58
- package/Heading.js +2 -2
- package/Image.js +14 -14
- package/JSONTree.js +5 -5
- package/Layer.js +32 -20
- package/Link.js +8 -8
- package/List.js +2 -2
- package/Markdown.js +250 -88
- package/Menu.js +70 -64
- package/Message.js +18 -18
- package/Modal.js +70 -16
- package/ModalLayer.js +4 -4
- package/Monogram.js +12 -11
- package/Multiselect.js +124 -80
- package/Number.js +44 -34
- package/Paginator.js +10 -10
- package/Paragraph.js +2 -2
- package/Popover.js +54 -40
- package/Progress.js +8 -8
- package/RadioBar.js +45 -38
- package/RadioList.js +2 -2
- package/Resize.js +19 -15
- package/ResultsMenu.js +6 -6
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +25 -23
- package/ScrollContainerContext.js +5 -5
- package/Search.d.ts +2 -0
- package/Search.js +797 -0
- package/Select.js +85 -45
- package/SidePanel.js +6 -6
- package/Slider.js +34 -30
- package/SlidingPanels.js +6 -6
- package/StaticContent.js +2 -2
- package/StepBar.js +56 -52
- package/Switch.js +8 -8
- package/TabBar.js +126 -85
- package/TabLayout.js +4 -5
- package/Table.js +266 -155
- package/Text.js +486 -401
- package/Tooltip.js +11 -11
- package/TransitionOpen.js +11 -11
- package/WaitSpinner.js +3 -4
- package/package.json +5 -6
- package/types/src/Accordion/AccordionContext.d.ts +10 -0
- package/types/src/Accordion/Panel.d.ts +0 -9
- package/types/src/Button/Button.d.ts +4 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +7 -0
- package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
- package/types/src/Card/Card.d.ts +2 -0
- package/types/src/CardLayout/CardLayoutContext.d.ts +8 -0
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Swatch.d.ts +4 -15
- package/types/src/ComboBox/ComboBox.d.ts +4 -3
- package/types/src/Concertina/ConcertinaContext.d.ts +8 -0
- package/types/src/Concertina/Panel.d.ts +2 -4
- package/types/src/ControlGroup/ControlGroup.d.ts +11 -1
- package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
- package/types/src/Date/Date.d.ts +6 -4
- package/types/src/EventListener/EventListener.d.ts +18 -0
- package/types/src/EventListener/index.d.ts +2 -0
- package/types/src/File/File.d.ts +6 -4
- package/types/src/File/FileContext.d.ts +9 -0
- package/types/src/File/Item.d.ts +5 -10
- package/types/src/FormRows/FormRows.d.ts +2 -2
- package/types/src/FormRows/FormRowsContext.d.ts +10 -0
- package/types/src/FormRows/Row.d.ts +5 -16
- package/types/src/Markdown/Markdown.d.ts +2 -0
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +14 -0
- package/types/src/Markdown/renderers/MarkdownCode.d.ts +15 -0
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +16 -0
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +15 -0
- package/types/src/Markdown/renderers/MarkdownImage.d.ts +18 -0
- package/types/src/Markdown/renderers/MarkdownItem.d.ts +14 -0
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +18 -0
- package/types/src/Markdown/renderers/MarkdownList.d.ts +26 -0
- package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +14 -0
- package/types/src/Markdown/renderers/index.d.ts +10 -0
- package/types/src/Modal/Modal.d.ts +15 -3
- package/types/src/Monogram/Monogram.d.ts +5 -1
- package/types/src/Multiselect/Compact.d.ts +12 -4
- package/types/src/Multiselect/Multiselect.d.ts +14 -4
- package/types/src/Multiselect/Normal.d.ts +7 -2
- package/types/src/Number/Number.d.ts +11 -7
- package/types/src/Popover/Popover.d.ts +2 -2
- package/types/src/RadioBar/Option.d.ts +1 -15
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/RadioBar/RadioBarContext.d.ts +9 -0
- package/types/src/Scroll/Inner.d.ts +2 -2
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +4 -4
- package/types/src/Search/Option.d.ts +60 -0
- package/types/src/Search/Search.d.ts +97 -0
- package/types/src/Search/index.d.ts +2 -0
- package/types/src/Select/Select.d.ts +6 -2
- package/types/src/Select/SelectBase.d.ts +12 -5
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/StepBar/Step.d.ts +1 -13
- package/types/src/StepBar/StepBarContext.d.ts +8 -0
- package/types/src/TabBar/Tab.d.ts +5 -13
- package/types/src/TabBar/TabBarContext.d.ts +14 -0
- package/types/src/Table/Body.d.ts +1 -1
- package/types/src/Table/Head.d.ts +3 -1
- package/types/src/Table/HeadCell.d.ts +1 -1
- package/types/src/Table/HeadInner.d.ts +3 -3
- package/types/src/Table/Row.d.ts +10 -3
- package/types/src/Table/Table.d.ts +10 -5
- package/types/src/Text/Text.d.ts +33 -12
- package/types/src/icons/Sort.d.ts +3 -0
- package/types/src/usePrevious/index.d.ts +2 -0
- package/types/src/usePrevious/usePrevious.d.ts +12 -0
- package/usePrevious.js +137 -0
package/ControlGroup.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 135);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -108,14 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 151:
|
|
111
|
+
/***/ 135:
|
|
119
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
113
|
|
|
121
114
|
"use strict";
|
|
@@ -124,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
124
117
|
|
|
125
118
|
// EXPORTS
|
|
126
119
|
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_ControlGroup_ControlGroup; });
|
|
120
|
+
__webpack_require__.d(__webpack_exports__, "ControlGroupContext", function() { return /* reexport */ ControlGroup_ControlGroupContext; });
|
|
127
121
|
|
|
128
122
|
// EXTERNAL MODULE: external "react"
|
|
129
123
|
var external_react_ = __webpack_require__(2);
|
|
@@ -147,11 +141,11 @@ var Box_ = __webpack_require__(8);
|
|
|
147
141
|
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
148
142
|
|
|
149
143
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
150
|
-
var ScreenReaderContent_ = __webpack_require__(
|
|
144
|
+
var ScreenReaderContent_ = __webpack_require__(15);
|
|
151
145
|
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
152
146
|
|
|
153
147
|
// EXTERNAL MODULE: external "@splunk/react-ui/Tooltip"
|
|
154
|
-
var Tooltip_ = __webpack_require__(
|
|
148
|
+
var Tooltip_ = __webpack_require__(46);
|
|
155
149
|
var Tooltip_default = /*#__PURE__*/__webpack_require__.n(Tooltip_);
|
|
156
150
|
|
|
157
151
|
// EXTERNAL MODULE: external "styled-components"
|
|
@@ -221,11 +215,26 @@ var StyledHelp = external_styled_components_default.a.div.withConfig({
|
|
|
221
215
|
prisma: '4px'
|
|
222
216
|
}));
|
|
223
217
|
|
|
218
|
+
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupContext.tsx
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* A React context used to inform subcomponets of ControlGroup of parent component values.
|
|
223
|
+
* The context interface is `ControlGroupContextValue`.
|
|
224
|
+
* Defaults to `'{}'`.
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
var ControlGroupContext = /*#__PURE__*/external_react_default.a.createContext({});
|
|
228
|
+
/* harmony default export */ var ControlGroup_ControlGroupContext = (ControlGroupContext);
|
|
224
229
|
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
|
|
225
230
|
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); }
|
|
226
231
|
|
|
227
232
|
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); }
|
|
228
233
|
|
|
234
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
235
|
+
|
|
236
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
237
|
+
|
|
229
238
|
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; }
|
|
230
239
|
|
|
231
240
|
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; }
|
|
@@ -273,6 +282,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
273
282
|
|
|
274
283
|
|
|
275
284
|
|
|
285
|
+
// props ControlGroup may access and/or override on children
|
|
286
|
+
|
|
276
287
|
var propTypes = {
|
|
277
288
|
children: external_prop_types_default.a.node,
|
|
278
289
|
controlsLayout: external_prop_types_default.a.oneOf(['fill', 'fillJoin', 'none', 'stack']),
|
|
@@ -298,7 +309,14 @@ var defaultProps = {
|
|
|
298
309
|
labelWidth: 120,
|
|
299
310
|
size: 'medium'
|
|
300
311
|
};
|
|
301
|
-
|
|
312
|
+
// Style cloned onto child elements when fill behavior set.
|
|
313
|
+
var FLEX_GROW_STYLE = {
|
|
314
|
+
flexGrow: 1
|
|
315
|
+
}; // Margin bootom values cloned onto child elements when the stacking behavior is needed.
|
|
316
|
+
|
|
317
|
+
var CHILD_MARGIN_BOTTOM_DEFAULT = '0';
|
|
318
|
+
var CHILD_MARGIN_BOTTOM_PRISMA = '16px';
|
|
319
|
+
var CHILD_MARGIN_BOTTOM_PRISMA_COMPACT = '12px';
|
|
302
320
|
/**
|
|
303
321
|
* `ControlGroup` places a label and optional help text around one or more controls. The `ControlGroup`
|
|
304
322
|
* will automatically add aria attributes to associate the controls with the labels and help text to
|
|
@@ -317,6 +335,7 @@ var defaultProps = {
|
|
|
317
335
|
* attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
|
|
318
336
|
* supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
|
|
319
337
|
*/
|
|
338
|
+
|
|
320
339
|
var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
321
340
|
_inherits(ControlGroup, _Component);
|
|
322
341
|
|
|
@@ -334,6 +353,38 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
334
353
|
|
|
335
354
|
_defineProperty(_assertThisInitialized(_this), "labelId", void 0);
|
|
336
355
|
|
|
356
|
+
_defineProperty(_assertThisInitialized(_this), "contextValue", void 0);
|
|
357
|
+
|
|
358
|
+
_defineProperty(_assertThisInitialized(_this), "childIds", void 0);
|
|
359
|
+
|
|
360
|
+
_defineProperty(_assertThisInitialized(_this), "stackLayoutChildStyle", void 0);
|
|
361
|
+
|
|
362
|
+
_defineProperty(_assertThisInitialized(_this), "getChildID", function (key, index) {
|
|
363
|
+
var childKey = "".concat(key, "-").concat(index);
|
|
364
|
+
var value = _this.childIds[childKey];
|
|
365
|
+
|
|
366
|
+
if (!value || !value.length) {
|
|
367
|
+
value = Object(id_["createDOMID"])(key);
|
|
368
|
+
_this.childIds[childKey] = value;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return value;
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
_defineProperty(_assertThisInitialized(_this), "getStackLayoutChildStyle", function (isPrisma, isCompact) {
|
|
375
|
+
if (isPrisma) {
|
|
376
|
+
if (isCompact) {
|
|
377
|
+
_this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA_COMPACT;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
_this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA;
|
|
381
|
+
} else {
|
|
382
|
+
_this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_DEFAULT;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return _this.stackLayoutChildStyle;
|
|
386
|
+
});
|
|
387
|
+
|
|
337
388
|
_defineProperty(_assertThisInitialized(_this), "hasInputId", function (item) {
|
|
338
389
|
return item.type && item.type.propTypes && Object.prototype.hasOwnProperty.call(item.type.propTypes, 'inputId');
|
|
339
390
|
});
|
|
@@ -370,10 +421,43 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
370
421
|
|
|
371
422
|
_this.labelId = Object(id_["createDOMID"])('label');
|
|
372
423
|
_this.helpId = Object(id_["createDOMID"])('help');
|
|
424
|
+
_this.contextValue = _this.createContextValue();
|
|
425
|
+
_this.childIds = {};
|
|
426
|
+
_this.stackLayoutChildStyle = {};
|
|
373
427
|
return _this;
|
|
374
428
|
}
|
|
375
429
|
|
|
376
430
|
_createClass(ControlGroup, [{
|
|
431
|
+
key: "shouldComponentUpdate",
|
|
432
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
433
|
+
if (external_react_default.a.Children.count(nextProps.children) !== external_react_default.a.Children.count(this.props.children)) {
|
|
434
|
+
this.childIds = {};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
439
|
+
}, {
|
|
440
|
+
key: "createContextValue",
|
|
441
|
+
value: function createContextValue() {
|
|
442
|
+
return {
|
|
443
|
+
labelAttrs: {
|
|
444
|
+
text: this.props.label,
|
|
445
|
+
id: this.labelId
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
}, {
|
|
450
|
+
key: "getContextValue",
|
|
451
|
+
value: function getContextValue() {
|
|
452
|
+
var _this$contextValue$la, _this$contextValue$la2;
|
|
453
|
+
|
|
454
|
+
if (this.props.label !== ((_this$contextValue$la = this.contextValue.labelAttrs) === null || _this$contextValue$la === void 0 ? void 0 : _this$contextValue$la.text) || this.labelId !== ((_this$contextValue$la2 = this.contextValue.labelAttrs) === null || _this$contextValue$la2 === void 0 ? void 0 : _this$contextValue$la2.id)) {
|
|
455
|
+
this.contextValue = this.createContextValue();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
return this.contextValue;
|
|
459
|
+
}
|
|
460
|
+
}, {
|
|
377
461
|
key: "render",
|
|
378
462
|
value: function render() {
|
|
379
463
|
var _this2 = this;
|
|
@@ -393,19 +477,11 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
393
477
|
tooltip = _this$props.tooltip,
|
|
394
478
|
otherProps = _objectWithoutProperties(_this$props, ["children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "size", "splunkTheme", "tooltip"]);
|
|
395
479
|
|
|
396
|
-
var isPrisma = splunkTheme.
|
|
397
|
-
|
|
480
|
+
var isPrisma = splunkTheme.isPrisma,
|
|
481
|
+
isCompact = splunkTheme.isCompact;
|
|
398
482
|
var validChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
|
|
399
483
|
var count = validChildren.length;
|
|
400
|
-
var writableOtherProps = otherProps;
|
|
401
|
-
var stackMarginBottom = '0px';
|
|
402
|
-
|
|
403
|
-
if (isPrisma && isCompact) {
|
|
404
|
-
stackMarginBottom = '12px';
|
|
405
|
-
} else if (isPrisma) {
|
|
406
|
-
stackMarginBottom = '16px';
|
|
407
|
-
} // Clean the Children
|
|
408
|
-
|
|
484
|
+
var writableOtherProps = otherProps; // Clean the Children
|
|
409
485
|
|
|
410
486
|
var cloneWithProps = function cloneWithProps(item, i) {
|
|
411
487
|
var cloneProps = {
|
|
@@ -448,8 +524,10 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
448
524
|
cloneProps.inline = false;
|
|
449
525
|
|
|
450
526
|
if (i < count - 1) {
|
|
451
|
-
|
|
452
|
-
|
|
527
|
+
// The spread operator is used as css styles are not nested, so there is no need for a deep copy.
|
|
528
|
+
var stackStyle = _this2.getStackLayoutChildStyle(isPrisma, isCompact);
|
|
529
|
+
|
|
530
|
+
cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), stackStyle) : stackStyle;
|
|
453
531
|
}
|
|
454
532
|
}
|
|
455
533
|
|
|
@@ -467,15 +545,16 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
467
545
|
}
|
|
468
546
|
|
|
469
547
|
if (count === 1 && (controlsLayout === 'fillJoin' || controlsLayout === 'fill')) {
|
|
470
|
-
|
|
471
|
-
|
|
548
|
+
// Some controls like Select do not grow by default, so flexGrow is applied
|
|
549
|
+
// The spread operator is used as css styles are not nested, so there is no need for a deep copy.
|
|
550
|
+
cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), FLEX_GROW_STYLE) : FLEX_GROW_STYLE;
|
|
472
551
|
}
|
|
473
552
|
|
|
474
553
|
if (!labelFor && item) {
|
|
475
554
|
if (_this2.hasInputId(item)) {
|
|
476
|
-
cloneProps.inputId = item.props.inputId ||
|
|
555
|
+
cloneProps.inputId = item.props.inputId || _this2.getChildID('input-id', i);
|
|
477
556
|
} else {
|
|
478
|
-
cloneProps.id = item.props.id ||
|
|
557
|
+
cloneProps.id = item.props.id || _this2.getChildID('id', i);
|
|
479
558
|
}
|
|
480
559
|
}
|
|
481
560
|
|
|
@@ -514,7 +593,9 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
514
593
|
return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
|
|
515
594
|
"data-test": "control-group",
|
|
516
595
|
$error: error
|
|
517
|
-
}, writableOtherProps),
|
|
596
|
+
}, writableOtherProps), /*#__PURE__*/external_react_default.a.createElement(ControlGroup_ControlGroupContext.Provider, {
|
|
597
|
+
value: this.getContextValue()
|
|
598
|
+
}, hideLabel ? /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default.a.createElement(StyledControlsComponent, {
|
|
518
599
|
"data-test": "controls",
|
|
519
600
|
flex: controlsLayout !== 'none',
|
|
520
601
|
style: contentMarginStyle
|
|
@@ -522,7 +603,7 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
522
603
|
"data-test": "help",
|
|
523
604
|
id: this.helpId,
|
|
524
605
|
style: contentMarginStyle
|
|
525
|
-
}, help));
|
|
606
|
+
}, help)));
|
|
526
607
|
}
|
|
527
608
|
}]);
|
|
528
609
|
|
|
@@ -536,10 +617,18 @@ _defineProperty(ControlGroup_ControlGroup, "defaultProps", defaultProps);
|
|
|
536
617
|
var ControlGroupWithTheme = Object(themes_["withSplunkTheme"])(ControlGroup_ControlGroup);
|
|
537
618
|
ControlGroupWithTheme.propTypes = ControlGroup_ControlGroup.propTypes;
|
|
538
619
|
/* harmony default export */ var src_ControlGroup_ControlGroup = (ControlGroupWithTheme);
|
|
620
|
+
|
|
539
621
|
// CONCATENATED MODULE: ./src/ControlGroup/index.ts
|
|
540
622
|
|
|
541
623
|
|
|
542
624
|
|
|
625
|
+
/***/ }),
|
|
626
|
+
|
|
627
|
+
/***/ 15:
|
|
628
|
+
/***/ (function(module, exports) {
|
|
629
|
+
|
|
630
|
+
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
631
|
+
|
|
543
632
|
/***/ }),
|
|
544
633
|
|
|
545
634
|
/***/ 2:
|
|
@@ -563,7 +652,7 @@ module.exports = require("lodash");
|
|
|
563
652
|
|
|
564
653
|
/***/ }),
|
|
565
654
|
|
|
566
|
-
/***/
|
|
655
|
+
/***/ 46:
|
|
567
656
|
/***/ (function(module, exports) {
|
|
568
657
|
|
|
569
658
|
module.exports = require("@splunk/react-ui/Tooltip");
|
package/Date.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 136);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -108,7 +108,34 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 11:
|
|
112
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
|
+
|
|
114
|
+
"use strict";
|
|
115
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
116
|
+
/**
|
|
117
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
118
|
+
*
|
|
119
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
120
|
+
* @param current - The new value of the ref.
|
|
121
|
+
*/
|
|
122
|
+
function updateReactRef(ref, current) {
|
|
123
|
+
if (ref) {
|
|
124
|
+
if (typeof ref === 'function') {
|
|
125
|
+
ref(current);
|
|
126
|
+
} else {
|
|
127
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
128
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
129
|
+
ref.current = current; // eslint-disable-line no-param-reassign
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
/***/ }),
|
|
137
|
+
|
|
138
|
+
/***/ 136:
|
|
112
139
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
140
|
|
|
114
141
|
"use strict";
|
|
@@ -141,11 +168,11 @@ var id_ = __webpack_require__(10);
|
|
|
141
168
|
var keyboard_ = __webpack_require__(9);
|
|
142
169
|
|
|
143
170
|
// EXTERNAL MODULE: external "@splunk/react-ui/Calendar"
|
|
144
|
-
var Calendar_ = __webpack_require__(
|
|
171
|
+
var Calendar_ = __webpack_require__(77);
|
|
145
172
|
var Calendar_default = /*#__PURE__*/__webpack_require__.n(Calendar_);
|
|
146
173
|
|
|
147
174
|
// EXTERNAL MODULE: external "@splunk/react-ui/Popover"
|
|
148
|
-
var Popover_ = __webpack_require__(
|
|
175
|
+
var Popover_ = __webpack_require__(16);
|
|
149
176
|
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
|
|
150
177
|
|
|
151
178
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
@@ -156,7 +183,7 @@ var external_styled_components_ = __webpack_require__(3);
|
|
|
156
183
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
157
184
|
|
|
158
185
|
// EXTERNAL MODULE: external "@splunk/react-ui/Text"
|
|
159
|
-
var Text_ = __webpack_require__(
|
|
186
|
+
var Text_ = __webpack_require__(21);
|
|
160
187
|
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
|
|
161
188
|
|
|
162
189
|
// CONCATENATED MODULE: ./src/Date/DateStyles.ts
|
|
@@ -179,7 +206,10 @@ var StyledText = external_styled_components_default()(Text_default.a).withConfig
|
|
|
179
206
|
var IconContainer = external_styled_components_default.a.div.withConfig({
|
|
180
207
|
displayName: "DateStyles__IconContainer",
|
|
181
208
|
componentId: "kacgdc-1"
|
|
182
|
-
})(["
|
|
209
|
+
})(["display:flex;align-items:center;padding:", ";color:", ";pointer-events:none;"], Object(themes_["pick"])({
|
|
210
|
+
comfortable: '0 8px',
|
|
211
|
+
compact: '0 6px'
|
|
212
|
+
}), Object(themes_["pickVariant"])('$disabled', {
|
|
183
213
|
"false": themes_["variables"].contentColorMuted,
|
|
184
214
|
"true": themes_["variables"].contentColorDisabled
|
|
185
215
|
}));
|
|
@@ -204,6 +234,9 @@ function CalendarIcon(props) {
|
|
|
204
234
|
d: "M16.6001 2C17.1524 2 17.6001 2.44772 17.6001 3V4H19C20.1046 4 21 4.89543 21 6V8.5V9.5V19.5C21 19.7761 20.7761 20 20.5 20H3.5C3.22386 20 3 19.7761 3 19.5V9.5V8.5V6C3 4.89543 3.89543 4 5 4H6.6001V3C6.6001 2.44772 7.04781 2 7.6001 2C8.15238 2 8.6001 2.44772 8.6001 3V4H15.6001V3C15.6001 2.44772 16.0478 2 16.6001 2ZM6.6001 6C6.6001 6.55228 7.04781 7 7.6001 7C8.15238 7 8.6001 6.55228 8.6001 6H15.6001C15.6001 6.55228 16.0478 7 16.6001 7C17.1524 7 17.6001 6.55228 17.6001 6H19V8H5L5 6H6.6001ZM19 10H5V18H19V10Z"
|
|
205
235
|
}));
|
|
206
236
|
}
|
|
237
|
+
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
238
|
+
var updateReactRef = __webpack_require__(11);
|
|
239
|
+
|
|
207
240
|
// CONCATENATED MODULE: ./src/Date/Date.tsx
|
|
208
241
|
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); }
|
|
209
242
|
|
|
@@ -242,6 +275,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
242
275
|
|
|
243
276
|
|
|
244
277
|
|
|
278
|
+
|
|
245
279
|
var propTypes = {
|
|
246
280
|
defaultValue: external_prop_types_default.a.string,
|
|
247
281
|
describedBy: external_prop_types_default.a.string,
|
|
@@ -413,6 +447,14 @@ var _Date = /*#__PURE__*/function (_Component) {
|
|
|
413
447
|
_this.setState({
|
|
414
448
|
anchor: el
|
|
415
449
|
});
|
|
450
|
+
|
|
451
|
+
Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
_defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) {
|
|
455
|
+
_this.setState({
|
|
456
|
+
input: el
|
|
457
|
+
});
|
|
416
458
|
});
|
|
417
459
|
|
|
418
460
|
_defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (_ref3) {
|
|
@@ -429,6 +471,7 @@ var _Date = /*#__PURE__*/function (_Component) {
|
|
|
429
471
|
_this.state = {
|
|
430
472
|
anchor: null,
|
|
431
473
|
calendarOpen: false,
|
|
474
|
+
input: null,
|
|
432
475
|
value: _this.isControlled() ? undefined : dateString
|
|
433
476
|
};
|
|
434
477
|
_this.popoverId = Object(id_["createDOMID"])('calender');
|
|
@@ -467,9 +510,9 @@ var _Date = /*#__PURE__*/function (_Component) {
|
|
|
467
510
|
}, {
|
|
468
511
|
key: "focus",
|
|
469
512
|
value: function focus() {
|
|
470
|
-
var _this$state$
|
|
513
|
+
var _this$state$input;
|
|
471
514
|
|
|
472
|
-
(_this$state$
|
|
515
|
+
(_this$state$input = this.state.input) === null || _this$state$input === void 0 ? void 0 : _this$state$input.focus();
|
|
473
516
|
}
|
|
474
517
|
}, {
|
|
475
518
|
key: "render",
|
|
@@ -477,8 +520,11 @@ var _Date = /*#__PURE__*/function (_Component) {
|
|
|
477
520
|
var _this$props5 = this.props,
|
|
478
521
|
highlightToday = _this$props5.highlightToday,
|
|
479
522
|
splunkTheme = _this$props5.splunkTheme;
|
|
480
|
-
var isPrisma = splunkTheme.
|
|
523
|
+
var isPrisma = splunkTheme.isPrisma;
|
|
481
524
|
var currentValue = this.getValue();
|
|
525
|
+
var startAdornment = isPrisma && /*#__PURE__*/external_react_default.a.createElement(IconContainer, {
|
|
526
|
+
$disabled: this.props.disabled
|
|
527
|
+
}, /*#__PURE__*/external_react_default.a.createElement(CalendarIcon, null));
|
|
482
528
|
return /*#__PURE__*/external_react_default.a.createElement(StyledText, Date_extends({
|
|
483
529
|
autoCapitalize: "off",
|
|
484
530
|
autoComplete: "off",
|
|
@@ -487,24 +533,15 @@ var _Date = /*#__PURE__*/function (_Component) {
|
|
|
487
533
|
"data-test": "date",
|
|
488
534
|
"data-test-value": currentValue,
|
|
489
535
|
"data-test-popover-id": this.popoverId,
|
|
536
|
+
elementRef: this.handleMount,
|
|
537
|
+
inputRef: this.handleInputMount,
|
|
490
538
|
onChange: this.handleInputChange,
|
|
491
539
|
onClick: this.handleClick,
|
|
492
540
|
onFocus: this.handleFocus,
|
|
493
541
|
onKeyDown: this.handleKeyDown,
|
|
494
542
|
value: this.getTextInputValue(),
|
|
495
|
-
|
|
496
|
-
}, Object(external_lodash_["omit"])(this.props, 'className', 'defaultValue', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value'), {
|
|
497
|
-
inputStyle: isPrisma ? {
|
|
498
|
-
paddingLeft: '26px'
|
|
499
|
-
} : undefined
|
|
500
|
-
}), isPrisma && /*#__PURE__*/external_react_default.a.createElement(IconContainer, {
|
|
501
|
-
$disabled: this.props.disabled
|
|
502
|
-
}, /*#__PURE__*/external_react_default.a.createElement(CalendarIcon, {
|
|
503
|
-
style: {
|
|
504
|
-
width: 24,
|
|
505
|
-
height: 24
|
|
506
|
-
}
|
|
507
|
-
})), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, {
|
|
543
|
+
startAdornment: startAdornment
|
|
544
|
+
}, Object(external_lodash_["omit"])(this.props, 'className', 'defaultValue', 'elementRef', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value')), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, {
|
|
508
545
|
anchor: this.state.anchor,
|
|
509
546
|
id: this.popoverId,
|
|
510
547
|
open: this.props.disabled ? false : this.state.calendarOpen,
|
|
@@ -539,7 +576,7 @@ DateWithTheme.momentFormat = _Date.momentFormat;
|
|
|
539
576
|
|
|
540
577
|
/***/ }),
|
|
541
578
|
|
|
542
|
-
/***/
|
|
579
|
+
/***/ 16:
|
|
543
580
|
/***/ (function(module, exports) {
|
|
544
581
|
|
|
545
582
|
module.exports = require("@splunk/react-ui/Popover");
|
|
@@ -560,7 +597,7 @@ module.exports = require("moment");
|
|
|
560
597
|
|
|
561
598
|
/***/ }),
|
|
562
599
|
|
|
563
|
-
/***/
|
|
600
|
+
/***/ 21:
|
|
564
601
|
/***/ (function(module, exports) {
|
|
565
602
|
|
|
566
603
|
module.exports = require("@splunk/react-ui/Text");
|
|
@@ -581,7 +618,7 @@ module.exports = require("lodash");
|
|
|
581
618
|
|
|
582
619
|
/***/ }),
|
|
583
620
|
|
|
584
|
-
/***/
|
|
621
|
+
/***/ 77:
|
|
585
622
|
/***/ (function(module, exports) {
|
|
586
623
|
|
|
587
624
|
module.exports = require("@splunk/react-ui/Calendar");
|
package/DefinitionList.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 120);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 120:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
package/Dropdown.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 171);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 11:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
|
@@ -128,7 +128,14 @@ function updateReactRef(ref, current) {
|
|
|
128
128
|
|
|
129
129
|
/***/ }),
|
|
130
130
|
|
|
131
|
-
/***/
|
|
131
|
+
/***/ 16:
|
|
132
|
+
/***/ (function(module, exports) {
|
|
133
|
+
|
|
134
|
+
module.exports = require("@splunk/react-ui/Popover");
|
|
135
|
+
|
|
136
|
+
/***/ }),
|
|
137
|
+
|
|
138
|
+
/***/ 171:
|
|
132
139
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
133
140
|
|
|
134
141
|
"use strict";
|
|
@@ -154,11 +161,11 @@ var external_lodash_ = __webpack_require__(4);
|
|
|
154
161
|
var id_ = __webpack_require__(10);
|
|
155
162
|
|
|
156
163
|
// EXTERNAL MODULE: external "@splunk/react-ui/Popover"
|
|
157
|
-
var Popover_ = __webpack_require__(
|
|
164
|
+
var Popover_ = __webpack_require__(16);
|
|
158
165
|
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
|
|
159
166
|
|
|
160
167
|
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
161
|
-
var updateReactRef = __webpack_require__(
|
|
168
|
+
var updateReactRef = __webpack_require__(11);
|
|
162
169
|
|
|
163
170
|
// CONCATENATED MODULE: ./src/Dropdown/Dropdown.tsx
|
|
164
171
|
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); }
|
|
@@ -444,13 +451,6 @@ _defineProperty(Dropdown_Dropdown, "defaultProps", defaultProps);
|
|
|
444
451
|
|
|
445
452
|
|
|
446
453
|
|
|
447
|
-
/***/ }),
|
|
448
|
-
|
|
449
|
-
/***/ 17:
|
|
450
|
-
/***/ (function(module, exports) {
|
|
451
|
-
|
|
452
|
-
module.exports = require("@splunk/react-ui/Popover");
|
|
453
|
-
|
|
454
454
|
/***/ }),
|
|
455
455
|
|
|
456
456
|
/***/ 2:
|