@splunk/react-ui 4.12.0 → 4.13.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.
Files changed (99) hide show
  1. package/Accordion.js +4 -4
  2. package/Anchor.js +2 -2
  3. package/Animation.js +4 -4
  4. package/AnimationToggle.js +2 -2
  5. package/Box.js +2 -2
  6. package/Button.js +11 -11
  7. package/ButtonGroup.js +2 -2
  8. package/ButtonSimple.js +7 -7
  9. package/CHANGELOG.md +25 -0
  10. package/Calendar.js +33 -33
  11. package/Card.js +13 -13
  12. package/CardLayout.js +2 -2
  13. package/Chip.js +11 -11
  14. package/Clickable.js +7 -7
  15. package/CloseButton.js +11 -11
  16. package/Code.js +4 -4
  17. package/CollapsiblePanel.js +6 -6
  18. package/Color.js +21 -21
  19. package/ColumnLayout.js +4 -4
  20. package/ComboBox.js +4 -4
  21. package/Concertina.js +2 -2
  22. package/ControlGroup.js +4 -4
  23. package/Date.js +4 -4
  24. package/DefinitionList.js +2 -2
  25. package/Dropdown.js +6 -2
  26. package/EventListener.js +4 -4
  27. package/File.js +15 -15
  28. package/FormRows.js +4 -4
  29. package/Heading.js +3 -3
  30. package/Image.js +15 -15
  31. package/JSONTree.js +2 -2
  32. package/Layer.js +4 -4
  33. package/Link.js +9 -9
  34. package/List.js +2 -2
  35. package/Markdown.js +21 -21
  36. package/Menu.js +32 -33
  37. package/Message.js +22 -22
  38. package/MessageBar.js +15 -15
  39. package/Modal.js +4 -4
  40. package/ModalLayer.js +8 -8
  41. package/Monogram.js +2 -2
  42. package/Multiselect.js +112 -103
  43. package/Number.js +2 -2
  44. package/Paginator.js +41 -41
  45. package/Paragraph.js +2 -2
  46. package/Popover.js +18 -9
  47. package/Progress.js +4 -4
  48. package/RadioBar.js +2 -2
  49. package/RadioList.js +2 -2
  50. package/Resize.js +2 -2
  51. package/ResultsMenu.js +12 -12
  52. package/ScreenReaderContent.js +2 -2
  53. package/Scroll.js +6 -6
  54. package/ScrollContainerContext.js +2 -2
  55. package/Search.js +13 -13
  56. package/Select.js +109 -100
  57. package/SidePanel.js +4 -4
  58. package/Slider.js +4 -4
  59. package/SlidingPanels.js +6 -6
  60. package/SplitButton.js +511 -0
  61. package/StaticContent.js +2 -2
  62. package/StepBar.js +6 -6
  63. package/Switch.js +2 -2
  64. package/TabBar.js +2 -2
  65. package/TabLayout.js +4 -4
  66. package/Table.js +60 -43
  67. package/Text.js +105 -101
  68. package/TextArea.js +83 -72
  69. package/Tooltip.js +2 -2
  70. package/TransitionOpen.js +8 -8
  71. package/Typography.js +4 -4
  72. package/WaitSpinner.js +68 -2
  73. package/package.json +4 -3
  74. package/types/src/Button/Button.d.ts +1 -1
  75. package/types/src/Dropdown/Dropdown.d.ts +11 -3
  76. package/types/src/Popover/Popover.d.ts +5 -1
  77. package/types/src/Popover/getPlacement.d.ts +1 -1
  78. package/types/src/SplitButton/Item.d.ts +45 -0
  79. package/types/src/SplitButton/SplitButton.d.ts +41 -0
  80. package/types/src/SplitButton/docs/examples/Basic.d.ts +1 -0
  81. package/types/src/SplitButton/docs/examples/ChangeLabel.d.ts +1 -0
  82. package/types/src/SplitButton/docs/examples/Disabled.d.ts +1 -0
  83. package/types/src/SplitButton/docs/examples/prisma/Basic.d.ts +1 -0
  84. package/types/src/SplitButton/docs/examples/prisma/Disabled.d.ts +1 -0
  85. package/types/src/SplitButton/index.d.ts +2 -0
  86. package/types/src/Table/HeadCell.d.ts +4 -1
  87. package/types/src/Table/HeadDropdownCell.d.ts +10 -3
  88. package/types/src/Text/Text.d.ts +5 -1
  89. package/types/src/TextArea/TextArea.d.ts +5 -1
  90. package/types/src/WaitSpinner/WaitSpinner.d.ts +1 -1
  91. package/types/src/useForceUpdate/index.d.ts +2 -0
  92. package/types/src/useForceUpdate/useForceUpdate.d.ts +9 -0
  93. package/types/src/useIsSsr/index.d.ts +2 -0
  94. package/types/src/useIsSsr/useIsSsr.d.ts +8 -0
  95. package/useForceUpdate.js +151 -0
  96. package/useIsSsr.js +153 -0
  97. package/usePrevious.js +2 -2
  98. package/types/src/Text/docs/examples/prisma/Multiline.d.ts +0 -10
  99. package/types/src/Text/docs/examples/prisma/Search.d.ts +0 -10
@@ -24,9 +24,13 @@ declare type PopoverRequestCloseHandler = (data: {
24
24
  interface PopoverPropsBase {
25
25
  /**
26
26
  * The `Popover `can align itself to the center of the anchor or to its edges.
27
+ *
28
+ * Note: `end` is ONLY supported with `below` PopoverPlacement
29
+ *
30
+ * TODO: Allow users to supply align prop SUI-5101
27
31
  * @private
28
32
  */
29
- align?: 'center' | 'edge' | 'theme';
33
+ align?: 'center' | 'edge' | 'theme' | 'end';
30
34
  /**
31
35
  * The element used to set the position of the `Popover`. It is required when the `Popover` is
32
36
  * open and must be mounted. Passing a React component instance is deprecated and may result
@@ -5,7 +5,7 @@ interface ExtendedDOMRect extends DOMRect {
5
5
  center: number;
6
6
  }
7
7
  export declare function getPlacement(args: {
8
- align: 'center' | 'edge';
8
+ align: 'center' | 'edge' | 'end';
9
9
  anchorPos: ExtendedDOMRect;
10
10
  canCoverAnchor: boolean;
11
11
  defaultPlacement: PopoverPlacement;
@@ -0,0 +1,45 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { ClassComponentProps } from '../utils/types';
3
+ interface ItemPropsBase {
4
+ /**
5
+ * Changes the style if isMain=true, passed from SplitButton.
6
+ * @private
7
+ */
8
+ appearance: 'default' | 'primary' | 'destructive';
9
+ /**
10
+ * Becomes the label.
11
+ */
12
+ children?: React.ReactNode;
13
+ /**
14
+ * Prevents user from clicking the button.
15
+ */
16
+ disabled?: boolean;
17
+ /**
18
+ * Becomes the main button. If no `Item`s have this prop, the first `Item` is the main button.
19
+ */
20
+ isMain?: boolean;
21
+ /**
22
+ * A callback for when an item is clicked.
23
+ */
24
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
25
+ }
26
+ declare const defaultProps: Required<Pick<ItemPropsBase, 'appearance'>>;
27
+ declare type ItemProps = ClassComponentProps<ItemPropsBase, typeof defaultProps, 'button'>;
28
+ /**
29
+ * An item within a `SplitButton`. This inherits from
30
+ * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
31
+ * so any elements passed to it must also be pure.
32
+ */
33
+ declare class Item extends PureComponent<ItemProps, {}> {
34
+ private item;
35
+ static propTypes: React.WeakValidationMap<ClassComponentProps<ItemPropsBase, Required<Pick<ItemPropsBase, "appearance">>, "button", never>>;
36
+ static defaultProps: Required<Pick<ItemPropsBase, "appearance">>;
37
+ private handleClick;
38
+ scrollIntoViewIfNeeded(): void;
39
+ /**
40
+ * Place focus on the item.
41
+ */
42
+ focus(): void;
43
+ render(): JSX.Element;
44
+ }
45
+ export default Item;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Item from './Item';
4
+ import { ComponentProps } from '../utils/types';
5
+ interface SplitButtonPropsBase {
6
+ /**
7
+ * Changes the style of the main button and toggle.
8
+ * @themeNotes 'destructive' is not supported by `enterprise` themes.
9
+ */
10
+ appearance?: 'default' | 'primary' | 'destructive';
11
+ /**
12
+ * Must be `SplitButton.Item`. Becomes main button and dropdown items.
13
+ */
14
+ children?: React.ReactNode;
15
+ /**
16
+ * Prevents main button and dropdown toggle from being clicked.
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
21
+ */
22
+ elementRef?: React.Ref<HTMLDivElement>;
23
+ /**
24
+ * A callback for when the main button or toggle is clicked.
25
+ */
26
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
27
+ }
28
+ declare type SplitButtonProps = ComponentProps<SplitButtonPropsBase, 'div'>;
29
+ declare function SplitButton({ appearance, children, disabled, elementRef, onClick, ...otherProps }: SplitButtonProps): JSX.Element;
30
+ declare namespace SplitButton {
31
+ var propTypes: {
32
+ appearance: PropTypes.Requireable<string>;
33
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
34
+ disabled: PropTypes.Requireable<boolean>;
35
+ elementRef: PropTypes.Requireable<object>;
36
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
37
+ };
38
+ var Item: typeof import("./Item").default;
39
+ }
40
+ export default SplitButton;
41
+ export { Item };
@@ -0,0 +1 @@
1
+ export default function Basic(): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ChangeLabel(): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Basic(): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Basic(): JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Basic(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './SplitButton';
2
+ export * from './SplitButton';
@@ -86,7 +86,10 @@ interface HeadCellPropsBase {
86
86
  width?: number | 'auto';
87
87
  /** @private. */
88
88
  variant?: 'toggleAll' | 'info' | 'actions';
89
- /** @private. */
89
+ /**
90
+ * @private
91
+ * Used internally to manage overlapping head cell elements, i.e. drag handle
92
+ */
90
93
  zIndex?: number;
91
94
  }
92
95
  declare const defaultProps: Required<Pick<HeadCellPropsBase, 'align' | 'resizable' | 'showGuideline' | 'sortDir' | 'truncate' | 'visible' | 'zIndex'>>;
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
2
2
  import { HeadAutosizeColumnHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler } from './Head';
3
3
  import { HeadCellDragStartHandler, HeadCellKeyDownHandler } from './HeadCell';
4
4
  import { ClassComponentProps } from '../utils/types';
5
+ import TableContext from './TableContext';
5
6
  /** @public */
6
7
  declare type HeadDropdownCellPossibleCloseReason = 'clickAway' | 'contentClick' | 'escapeKey' | 'offScreen' | 'tabKey' | 'toggleClick';
7
8
  declare type HeadDropdownCellAutosizeColumnHandler = HeadAutosizeColumnHandler;
@@ -127,8 +128,13 @@ interface HeadDropdownCellPropsBase {
127
128
  * The width of the column in pixels.
128
129
  */
129
130
  width?: number;
131
+ /**
132
+ * @private
133
+ * Used internally to manage overlapping head cell elements, i.e. drag handle
134
+ */
135
+ zIndex?: number;
130
136
  }
131
- declare const defaultProps: Required<Pick<HeadDropdownCellPropsBase, 'align' | 'canCoverHead' | 'closeReasons' | 'defaultPlacement' | 'focusToggleReasons' | 'repositionMode' | 'resizable' | 'retainFocus' | 'takeFocus' | 'truncate' | 'visible'>>;
137
+ declare const defaultProps: Required<Pick<HeadDropdownCellPropsBase, 'align' | 'canCoverHead' | 'closeReasons' | 'defaultPlacement' | 'focusToggleReasons' | 'repositionMode' | 'resizable' | 'retainFocus' | 'takeFocus' | 'truncate' | 'visible' | 'zIndex'>>;
132
138
  declare type HeadDropdownCellProps = ClassComponentProps<HeadDropdownCellPropsBase, typeof defaultProps, 'th'>;
133
139
  interface HeadDropdownCellState {
134
140
  clientX?: number;
@@ -147,8 +153,9 @@ declare class HeadDropdownCell extends Component<HeadDropdownCellProps, HeadDrop
147
153
  * docs extraction.
148
154
  */
149
155
  static possibleCloseReasons: import("../Dropdown/Dropdown").DropdownPossibleCloseReason[];
150
- static propTypes: React.WeakValidationMap<ClassComponentProps<HeadDropdownCellPropsBase, Required<Pick<HeadDropdownCellPropsBase, "align" | "retainFocus" | "takeFocus" | "visible" | "closeReasons" | "defaultPlacement" | "repositionMode" | "focusToggleReasons" | "truncate" | "resizable" | "canCoverHead">>, "th", never>>;
151
- static defaultProps: Required<Pick<HeadDropdownCellPropsBase, "align" | "retainFocus" | "takeFocus" | "visible" | "closeReasons" | "defaultPlacement" | "repositionMode" | "focusToggleReasons" | "truncate" | "resizable" | "canCoverHead">>;
156
+ static propTypes: React.WeakValidationMap<ClassComponentProps<HeadDropdownCellPropsBase, Required<Pick<HeadDropdownCellPropsBase, "align" | "zIndex" | "retainFocus" | "takeFocus" | "visible" | "closeReasons" | "defaultPlacement" | "repositionMode" | "focusToggleReasons" | "truncate" | "resizable" | "canCoverHead">>, "th", never>>;
157
+ static defaultProps: Required<Pick<HeadDropdownCellPropsBase, "align" | "zIndex" | "retainFocus" | "takeFocus" | "visible" | "closeReasons" | "defaultPlacement" | "repositionMode" | "focusToggleReasons" | "truncate" | "resizable" | "canCoverHead">>;
158
+ static contextType: React.Context<TableContext>;
152
159
  constructor(props: Readonly<HeadDropdownCellProps>);
153
160
  componentDidUpdate(prevProps: Readonly<HeadDropdownCellProps>): void;
154
161
  private handleMount;
@@ -106,7 +106,11 @@ interface TextPropsBase {
106
106
  * If you want to handle all click events, pass the "onClick" prop, which will be attached to `Text`'s root element.
107
107
  */
108
108
  onInputClick?: React.MouseEventHandler<HTMLInputElement | HTMLTextAreaElement>;
109
- /** The gray text shown when the input is empty. */
109
+ /**
110
+ * @deprecated This prop is deprecated and will be removed in the next major version.
111
+ *
112
+ * The gray text shown when the input is empty.
113
+ */
110
114
  placeholder?: string;
111
115
  /** Prepend removes rounded borders from the left side. */
112
116
  prepend?: boolean;
@@ -100,7 +100,11 @@ interface TextAreaPropsBase {
100
100
  /** A callback for when the text selection or cursor position changes. */
101
101
  onSelect?: React.ReactEventHandler<HTMLTextAreaElement>;
102
102
  onInputClick?: React.MouseEventHandler<HTMLTextAreaElement>;
103
- /** The gray text shown when the input is empty. */
103
+ /**
104
+ * @deprecated This prop is deprecated and will be removed in the next major version.
105
+ *
106
+ * The gray text shown when the input is empty.
107
+ */
104
108
  placeholder?: string;
105
109
  /** Prepend removes rounded borders from the left side. */
106
110
  prepend?: boolean;
@@ -17,7 +17,7 @@ interface WaitSpinnerPropsBase {
17
17
  size?: 'small' | 'medium' | 'large';
18
18
  }
19
19
  declare type WaitSpinnerProps = ComponentProps<WaitSpinnerPropsBase, 'div'>;
20
- declare function WaitSpinner({ elementRef, screenReaderText, size, ...otherProps }: WaitSpinnerProps): JSX.Element;
20
+ declare function WaitSpinner({ elementRef, screenReaderText, size, ...otherProps }: WaitSpinnerProps): JSX.Element | null;
21
21
  declare namespace WaitSpinner {
22
22
  var propTypes: {
23
23
  elementRef: PropTypes.Requireable<object>;
@@ -0,0 +1,2 @@
1
+ export { default } from './useForceUpdate';
2
+ export * from './useForceUpdate';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This is a private component not intended for use outside @splunk/react-ui
3
+ *
4
+ * Triggers a rerender of a functional component. Useful as an escape hatch when a render is needed regardless of state.
5
+ * See https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
6
+ *
7
+ */
8
+ declare function useForceUpdate(): import("react").DispatchWithoutAction;
9
+ export default useForceUpdate;
@@ -0,0 +1,2 @@
1
+ export { default } from './useIsSsr';
2
+ export * from './useIsSsr';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This is a private component not intended for use outside @splunk/react-ui
3
+ *
4
+ * Checks if the application is server side rendered and returns boolean
5
+ * to be used in components that utilize "window" or "document" objects.
6
+ */
7
+ declare const useIsSsr: () => boolean;
8
+ export default useIsSsr;
@@ -0,0 +1,151 @@
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 = 183);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 183:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ // ESM COMPAT FLAG
95
+ __webpack_require__.r(__webpack_exports__);
96
+
97
+ // EXPORTS
98
+ __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ useForceUpdate_useForceUpdate; });
99
+
100
+ // EXTERNAL MODULE: external "react"
101
+ var external_react_ = __webpack_require__(2);
102
+
103
+ // CONCATENATED MODULE: ./src/useForceUpdate/useForceUpdate.tsx
104
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
105
+
106
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
107
+
108
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
109
+
110
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
111
+
112
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
113
+
114
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
115
+
116
+
117
+ /**
118
+ * This is a private component not intended for use outside @splunk/react-ui
119
+ *
120
+ * Triggers a rerender of a functional component. Useful as an escape hatch when a render is needed regardless of state.
121
+ * See https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
122
+ *
123
+ */
124
+
125
+ function useForceUpdate() {
126
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
127
+ var _useReducer = Object(external_react_["useReducer"])(function (x) {
128
+ return x + 1;
129
+ }, 0),
130
+ _useReducer2 = _slicedToArray(_useReducer, 2),
131
+ ignored = _useReducer2[0],
132
+ forceUpdate = _useReducer2[1];
133
+
134
+ return forceUpdate;
135
+ }
136
+
137
+ /* harmony default export */ var useForceUpdate_useForceUpdate = (useForceUpdate);
138
+ // CONCATENATED MODULE: ./src/useForceUpdate/index.ts
139
+
140
+
141
+
142
+ /***/ }),
143
+
144
+ /***/ 2:
145
+ /***/ (function(module, exports) {
146
+
147
+ module.exports = require("react");
148
+
149
+ /***/ })
150
+
151
+ /******/ });
package/useIsSsr.js ADDED
@@ -0,0 +1,153 @@
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 = 80);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 2:
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("react");
94
+
95
+ /***/ }),
96
+
97
+ /***/ 80:
98
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
+
100
+ "use strict";
101
+ // ESM COMPAT FLAG
102
+ __webpack_require__.r(__webpack_exports__);
103
+
104
+ // EXPORTS
105
+ __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_useIsSsr_useIsSsr; });
106
+
107
+ // EXTERNAL MODULE: external "react"
108
+ var external_react_ = __webpack_require__(2);
109
+
110
+ // CONCATENATED MODULE: ./src/useIsSsr/useIsSsr.tsx
111
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
112
+
113
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
114
+
115
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
116
+
117
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
118
+
119
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
120
+
121
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
122
+
123
+
124
+ /**
125
+ * This is a private component not intended for use outside @splunk/react-ui
126
+ *
127
+ * Checks if the application is server side rendered and returns boolean
128
+ * to be used in components that utilize "window" or "document" objects.
129
+ */
130
+
131
+ var useIsSsr_useIsSsr = function useIsSsr() {
132
+ // we always start off in "SSR mode", to ensure our initial browser render
133
+ var _useState = Object(external_react_["useState"])(true),
134
+ _useState2 = _slicedToArray(_useState, 2),
135
+ isSsr = _useState2[0],
136
+ setIsSsr = _useState2[1];
137
+
138
+ Object(external_react_["useEffect"])(function () {
139
+ // `useEffect` never runs on the server, so we must be on the client if
140
+ // we hit this block
141
+ setIsSsr(false);
142
+ }, []);
143
+ return isSsr;
144
+ };
145
+
146
+ /* harmony default export */ var src_useIsSsr_useIsSsr = (useIsSsr_useIsSsr);
147
+ // CONCATENATED MODULE: ./src/useIsSsr/index.ts
148
+
149
+
150
+
151
+ /***/ })
152
+
153
+ /******/ });
package/usePrevious.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 180);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 184);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 180:
90
+ /***/ 184:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
@@ -1,10 +0,0 @@
1
- import { Component } from 'react';
2
- import { TextChangeHandler } from '@splunk/react-ui/Text';
3
- declare class Example extends Component<{}, {
4
- value: string;
5
- }> {
6
- constructor(props: {});
7
- handleChange: TextChangeHandler;
8
- render(): JSX.Element;
9
- }
10
- export default Example;
@@ -1,10 +0,0 @@
1
- import { Component } from 'react';
2
- import { TextChangeHandler } from '@splunk/react-ui/Text';
3
- declare class Example extends Component<{}, {
4
- value: string;
5
- }> {
6
- constructor(props: {});
7
- handleChange: TextChangeHandler;
8
- render(): JSX.Element;
9
- }
10
- export default Example;