@splunk/react-ui 4.12.1 → 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.
- package/Accordion.js +4 -4
- package/Anchor.js +2 -2
- package/Animation.js +4 -4
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +9 -9
- package/ButtonGroup.js +2 -2
- package/ButtonSimple.js +7 -7
- package/CHANGELOG.md +18 -0
- package/Calendar.js +31 -31
- package/Card.js +13 -13
- package/CardLayout.js +2 -2
- package/Chip.js +11 -11
- package/Clickable.js +7 -7
- package/CloseButton.js +11 -11
- package/Code.js +4 -4
- package/CollapsiblePanel.js +4 -4
- package/Color.js +21 -21
- package/ColumnLayout.js +4 -4
- package/ComboBox.js +2 -2
- package/Concertina.js +2 -2
- package/ControlGroup.js +4 -4
- package/Date.js +4 -4
- package/DefinitionList.js +2 -2
- package/Dropdown.js +6 -2
- package/EventListener.js +4 -4
- package/File.js +15 -15
- package/FormRows.js +4 -4
- package/Heading.js +2 -2
- package/Image.js +15 -15
- package/JSONTree.js +2 -2
- package/Layer.js +4 -4
- package/Link.js +9 -9
- package/List.js +2 -2
- package/Markdown.js +16 -16
- package/Menu.js +29 -30
- package/Message.js +17 -17
- package/MessageBar.js +15 -15
- package/Modal.js +4 -4
- package/ModalLayer.js +6 -6
- package/Monogram.js +2 -2
- package/Multiselect.js +87 -78
- package/Number.js +2 -2
- package/Paginator.js +39 -39
- package/Paragraph.js +2 -2
- package/Popover.js +16 -7
- package/Progress.js +4 -4
- package/RadioBar.js +2 -2
- package/RadioList.js +2 -2
- package/Resize.js +2 -2
- package/ResultsMenu.js +12 -12
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +4 -4
- package/ScrollContainerContext.js +2 -2
- package/Search.js +11 -11
- package/Select.js +85 -76
- package/SidePanel.js +4 -4
- package/Slider.js +4 -4
- package/SlidingPanels.js +4 -4
- package/SplitButton.js +511 -0
- package/StaticContent.js +2 -2
- package/StepBar.js +6 -6
- package/Switch.js +2 -2
- package/TabBar.js +2 -2
- package/TabLayout.js +4 -4
- package/Table.js +57 -40
- package/Text.js +29 -21
- package/TextArea.js +21 -13
- package/Tooltip.js +2 -2
- package/TransitionOpen.js +4 -4
- package/Typography.js +4 -4
- package/WaitSpinner.js +68 -2
- package/package.json +3 -3
- package/types/src/Button/Button.d.ts +1 -1
- package/types/src/Dropdown/Dropdown.d.ts +11 -3
- package/types/src/Popover/Popover.d.ts +5 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/SplitButton/Item.d.ts +45 -0
- package/types/src/SplitButton/SplitButton.d.ts +41 -0
- package/types/src/SplitButton/docs/examples/Basic.d.ts +1 -0
- package/types/src/SplitButton/docs/examples/ChangeLabel.d.ts +1 -0
- package/types/src/SplitButton/docs/examples/Disabled.d.ts +1 -0
- package/types/src/SplitButton/docs/examples/prisma/Basic.d.ts +1 -0
- package/types/src/SplitButton/docs/examples/prisma/Disabled.d.ts +1 -0
- package/types/src/SplitButton/index.d.ts +2 -0
- package/types/src/Table/HeadCell.d.ts +4 -1
- package/types/src/Table/HeadDropdownCell.d.ts +10 -3
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/TextArea/TextArea.d.ts +5 -1
- package/types/src/WaitSpinner/WaitSpinner.d.ts +1 -1
- package/types/src/useForceUpdate/index.d.ts +2 -0
- package/types/src/useForceUpdate/useForceUpdate.d.ts +9 -0
- package/types/src/useIsSsr/index.d.ts +2 -0
- package/types/src/useIsSsr/useIsSsr.d.ts +8 -0
- package/useForceUpdate.js +151 -0
- package/useIsSsr.js +153 -0
- package/usePrevious.js +2 -2
package/WaitSpinner.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 = 177);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 177:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
|
@@ -198,6 +198,9 @@ var StyledEnterpriseCircle = external_styled_components_default.a.circle.withCon
|
|
|
198
198
|
enterprise: Object(external_styled_components_["css"])(["stroke-dasharray:34 19;"])
|
|
199
199
|
}));
|
|
200
200
|
|
|
201
|
+
// EXTERNAL MODULE: ./src/useIsSsr/index.ts + 1 modules
|
|
202
|
+
var useIsSsr = __webpack_require__(80);
|
|
203
|
+
|
|
201
204
|
// CONCATENATED MODULE: ./src/WaitSpinner/WaitSpinner.tsx
|
|
202
205
|
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); }
|
|
203
206
|
|
|
@@ -211,6 +214,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
211
214
|
|
|
212
215
|
|
|
213
216
|
|
|
217
|
+
|
|
214
218
|
var propTypes = {
|
|
215
219
|
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
216
220
|
screenReaderText: external_prop_types_default.a.string,
|
|
@@ -232,6 +236,12 @@ function WaitSpinner(_ref) {
|
|
|
232
236
|
isPrisma = _useSplunkTheme.isPrisma;
|
|
233
237
|
|
|
234
238
|
var viewBox = isPrisma ? '0 0 40 40' : '0 0 19 19';
|
|
239
|
+
var isSsr = Object(useIsSsr["default"])();
|
|
240
|
+
|
|
241
|
+
if (isSsr) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
|
|
235
245
|
return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
|
|
236
246
|
"data-test": "wait-spinner"
|
|
237
247
|
}, otherProps), /*#__PURE__*/external_react_default.a.createElement(StyledSvg, {
|
|
@@ -293,6 +303,62 @@ module.exports = require("@splunk/react-ui/AnimationToggle");
|
|
|
293
303
|
|
|
294
304
|
module.exports = require("@splunk/ui-utils/i18n");
|
|
295
305
|
|
|
306
|
+
/***/ }),
|
|
307
|
+
|
|
308
|
+
/***/ 80:
|
|
309
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
310
|
+
|
|
311
|
+
"use strict";
|
|
312
|
+
// ESM COMPAT FLAG
|
|
313
|
+
__webpack_require__.r(__webpack_exports__);
|
|
314
|
+
|
|
315
|
+
// EXPORTS
|
|
316
|
+
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_useIsSsr_useIsSsr; });
|
|
317
|
+
|
|
318
|
+
// EXTERNAL MODULE: external "react"
|
|
319
|
+
var external_react_ = __webpack_require__(2);
|
|
320
|
+
|
|
321
|
+
// CONCATENATED MODULE: ./src/useIsSsr/useIsSsr.tsx
|
|
322
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
323
|
+
|
|
324
|
+
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."); }
|
|
325
|
+
|
|
326
|
+
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); }
|
|
327
|
+
|
|
328
|
+
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; }
|
|
329
|
+
|
|
330
|
+
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; }
|
|
331
|
+
|
|
332
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* This is a private component not intended for use outside @splunk/react-ui
|
|
337
|
+
*
|
|
338
|
+
* Checks if the application is server side rendered and returns boolean
|
|
339
|
+
* to be used in components that utilize "window" or "document" objects.
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
var useIsSsr_useIsSsr = function useIsSsr() {
|
|
343
|
+
// we always start off in "SSR mode", to ensure our initial browser render
|
|
344
|
+
var _useState = Object(external_react_["useState"])(true),
|
|
345
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
346
|
+
isSsr = _useState2[0],
|
|
347
|
+
setIsSsr = _useState2[1];
|
|
348
|
+
|
|
349
|
+
Object(external_react_["useEffect"])(function () {
|
|
350
|
+
// `useEffect` never runs on the server, so we must be on the client if
|
|
351
|
+
// we hit this block
|
|
352
|
+
setIsSsr(false);
|
|
353
|
+
}, []);
|
|
354
|
+
return isSsr;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
/* harmony default export */ var src_useIsSsr_useIsSsr = (useIsSsr_useIsSsr);
|
|
358
|
+
// CONCATENATED MODULE: ./src/useIsSsr/index.ts
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
296
362
|
/***/ })
|
|
297
363
|
|
|
298
364
|
/******/ });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build": "cross-env NODE_ENV=production webpack && yarn types:build && yarn build-storybook",
|
|
9
9
|
"docs": "NODE_ENV=production webpack --config docs.gen.webpack.config.js",
|
|
10
10
|
"docs:publish": "cicd-publish-docs docs --force",
|
|
11
|
-
"docs:publish:external": "cicd-publish-docs docs --force --suffix=public",
|
|
11
|
+
"docs:publish:external": "cicd-publish-docs docs-external --force --suffix=public",
|
|
12
12
|
"docs:start": "webpack serve --config docs.gen.webpack.config.js",
|
|
13
13
|
"eslint": "eslint src .storybook --ext \".ts,.tsx,.js,.jsx\"",
|
|
14
14
|
"eslint:fix": "yarn run eslint --fix",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@splunk/react-icons": "^3.2.0",
|
|
44
44
|
"@splunk/themes": "^0.13.0",
|
|
45
|
-
"@splunk/ui-utils": "^1.5.
|
|
45
|
+
"@splunk/ui-utils": "^1.5.1",
|
|
46
46
|
"@types/commonmark": "^0.27.0",
|
|
47
47
|
"@types/lodash": "^4.14.156",
|
|
48
48
|
"@types/react": "^16.9.38",
|
|
@@ -12,7 +12,7 @@ interface ButtonPropsBase {
|
|
|
12
12
|
/** Returns a value on click. Use when composing or testing. */
|
|
13
13
|
action?: string;
|
|
14
14
|
/** Changes the style of the button.
|
|
15
|
-
* @themeNotes
|
|
15
|
+
* @themeNotes Enterprise themes support the following appearances:`default`, `primary`, `secondary`, and `pill`. Prisma themes support the `default`, `primary`, `secondary`, `destructive`, `toggle` and `flat` appearances.
|
|
16
16
|
*/
|
|
17
17
|
appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'pill' | 'toggle' | 'flat';
|
|
18
18
|
/** Removes the right border and border-radius of the button so you can
|
|
@@ -31,6 +31,14 @@ declare type DropdownToggleElement = React.ReactElement<React.HTMLAttributes<HTM
|
|
|
31
31
|
ref?: React.Ref<ComponentWithFocus | HTMLElement | null>;
|
|
32
32
|
}>;
|
|
33
33
|
interface DropdownPropsBase {
|
|
34
|
+
/**
|
|
35
|
+
* Resurface private `Popover` prop for aligning the edge.
|
|
36
|
+
*
|
|
37
|
+
* `end` is ONLY supported in with the `below` PopoverPlacement
|
|
38
|
+
* TODO: SUI-5101 Allow users to supply align prop in Popover and Dropdowns
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
align?: 'center' | 'edge' | 'theme' | 'end';
|
|
34
42
|
/**
|
|
35
43
|
* Enables the `Dropdown` to be rendered over the toggle
|
|
36
44
|
* if there isn't enough room to render it in a direction.
|
|
@@ -106,7 +114,7 @@ interface DropdownPropsBase {
|
|
|
106
114
|
*/
|
|
107
115
|
toggle: DropdownToggleElement;
|
|
108
116
|
}
|
|
109
|
-
declare const defaultProps: Required<Pick<DropdownPropsBase, 'canCoverAnchor' | 'closeReasons' | 'defaultPlacement' | 'focusToggleReasons' | 'repositionMode' | 'retainFocus' | 'takeFocus'>>;
|
|
117
|
+
declare const defaultProps: Required<Pick<DropdownPropsBase, 'align' | 'canCoverAnchor' | 'closeReasons' | 'defaultPlacement' | 'focusToggleReasons' | 'repositionMode' | 'retainFocus' | 'takeFocus'>>;
|
|
110
118
|
interface DropdownPropsBaseControlled extends DropdownPropsBase {
|
|
111
119
|
onRequestClose: DropdownRequestCloseHandler;
|
|
112
120
|
onRequestOpen: DropdownRequestOpenHandler;
|
|
@@ -132,8 +140,8 @@ declare class Dropdown extends Component<DropdownProps, DropdownState> {
|
|
|
132
140
|
* docs extraction.
|
|
133
141
|
*/
|
|
134
142
|
static possibleCloseReasons: DropdownPossibleCloseReason[];
|
|
135
|
-
static propTypes: React.WeakValidationMap<DropdownPropsBaseControlled & Required<Pick<DropdownPropsBase, "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>> | React.WeakValidationMap<DropdownPropsBaseUncontrolled & Required<Pick<DropdownPropsBase, "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>>;
|
|
136
|
-
static defaultProps: Required<Pick<DropdownPropsBase, "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>;
|
|
143
|
+
static propTypes: React.WeakValidationMap<DropdownPropsBaseControlled & Required<Pick<DropdownPropsBase, "align" | "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>> | React.WeakValidationMap<DropdownPropsBaseUncontrolled & Required<Pick<DropdownPropsBase, "align" | "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>>;
|
|
144
|
+
static defaultProps: Required<Pick<DropdownPropsBase, "align" | "retainFocus" | "takeFocus" | "closeReasons" | "canCoverAnchor" | "defaultPlacement" | "repositionMode" | "focusToggleReasons">>;
|
|
137
145
|
constructor(props: Readonly<DropdownProps>);
|
|
138
146
|
componentDidUpdate(): void;
|
|
139
147
|
private handleToggleMount;
|
|
@@ -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;
|
|
@@ -86,7 +86,10 @@ interface HeadCellPropsBase {
|
|
|
86
86
|
width?: number | 'auto';
|
|
87
87
|
/** @private. */
|
|
88
88
|
variant?: 'toggleAll' | 'info' | 'actions';
|
|
89
|
-
/**
|
|
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;
|
package/types/src/Text/Text.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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,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,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
|
+
/******/ });
|