@splunk/react-ui 5.3.0 → 5.4.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 +31 -31
- package/Avatar.js +13 -13
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +16 -0
- package/CardLayout.js +39 -36
- package/Clickable.js +5 -6
- package/Code.js +424 -528
- package/CollapsiblePanel.js +1 -1
- package/Color.js +903 -1025
- package/DefinitionList.js +1 -1
- package/FormRows.js +13 -11
- package/JSONTree.js +682 -1408
- package/Link.js +5 -5
- package/Markdown.js +9 -5
- package/Menu.js +72 -67
- package/Multiselect.js +2692 -2780
- package/Popover.js +201 -196
- package/Resize.js +11 -8
- package/ResultsMenu.js +913 -1030
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -425
- package/Select.js +1741 -1832
- package/Slider.js +1 -1
- package/SlidingPanels.js +129 -127
- package/StepBar.js +123 -97
- package/Switch.js +115 -111
- package/TabBar.js +10 -10
- package/Table.js +1239 -1240
- package/TextArea.js +596 -684
- package/Tree.js +638 -682
- package/package.json +11 -11
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +2 -2
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +7 -1
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/Head.d.ts +1 -1
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -0
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/useControlled.js +61 -97
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +95 -127
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.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.",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@dnd-kit/sortable": "^8.0.0",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-spring/web": "^9.7.5",
|
|
47
|
-
"@splunk/react-icons": "^5.
|
|
48
|
-
"@splunk/themes": "^1.
|
|
49
|
-
"@splunk/ui-utils": "^1.
|
|
50
|
-
"decimal.js-light": "^2.
|
|
47
|
+
"@splunk/react-icons": "^5.4.0",
|
|
48
|
+
"@splunk/themes": "^1.3.0",
|
|
49
|
+
"@splunk/ui-utils": "^1.11.0",
|
|
50
|
+
"decimal.js-light": "^2.5.1",
|
|
51
51
|
"lodash": "^4.17.14",
|
|
52
52
|
"moment": "^2.29.4",
|
|
53
53
|
"prop-types": "^15.6.2",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@babel/core": "^7.28.0",
|
|
61
61
|
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
62
62
|
"@splunk/babel-preset": "^4.0.0",
|
|
63
|
-
"@splunk/docs-gen": "^1.
|
|
63
|
+
"@splunk/docs-gen": "^1.2.0",
|
|
64
64
|
"@splunk/eslint-config": "^5.0.0",
|
|
65
|
-
"@splunk/react-docs": "^1.
|
|
65
|
+
"@splunk/react-docs": "^1.4.0",
|
|
66
66
|
"@splunk/stylelint-config": "^5.0.0",
|
|
67
67
|
"@splunk/test-runner-utils": "^0.4.1",
|
|
68
68
|
"@splunk/webpack-configs": "^7.0.2",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"@storybook/react-webpack5": "^7.6.20",
|
|
75
75
|
"@storybook/test-runner": "0.16.0",
|
|
76
76
|
"@testing-library/cypress": "^9.0.0",
|
|
77
|
-
"@testing-library/dom": "^10.4.
|
|
77
|
+
"@testing-library/dom": "^10.4.1",
|
|
78
78
|
"@testing-library/jest-dom": "^6.6.3",
|
|
79
79
|
"@testing-library/react": "^16.3.0",
|
|
80
80
|
"@testing-library/react-hooks": "^8.0.1",
|
|
81
81
|
"@testing-library/user-event": "^14.6.1",
|
|
82
|
-
"@types/jest": "^
|
|
82
|
+
"@types/jest": "^30.0.0",
|
|
83
83
|
"@types/lodash": "^4.14.156",
|
|
84
84
|
"@types/node": "^18.16.0",
|
|
85
85
|
"@types/prismjs": "^1.26.3",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"fs-readdir-recursive": "^1.0.0",
|
|
119
119
|
"glob": "^7.1.6",
|
|
120
120
|
"http-server": "^14.1.1",
|
|
121
|
-
"jest": "^
|
|
122
|
-
"jest-environment-jsdom": "^
|
|
121
|
+
"jest": "^30.1.3",
|
|
122
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
123
123
|
"jest-image-snapshot": "^5.1.0",
|
|
124
124
|
"jest-junit": "^10.0.0",
|
|
125
125
|
"jest-stare": "^2.4.1",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import BreadcrumbsContext from './BreadcrumbsContext';
|
|
3
4
|
import Item from './Item';
|
|
4
5
|
import { ComponentProps } from '../utils/types';
|
|
5
6
|
/** @public */
|
|
@@ -27,11 +28,6 @@ interface BreadcrumbsPropsBase {
|
|
|
27
28
|
onClick?: BreadcrumbsClickHandler;
|
|
28
29
|
}
|
|
29
30
|
type BreadcrumbsProps = ComponentProps<BreadcrumbsPropsBase, 'nav'>;
|
|
30
|
-
type BreadcrumbsContextValue = {
|
|
31
|
-
onClick?: BreadcrumbsClickHandler;
|
|
32
|
-
prefix?: string;
|
|
33
|
-
};
|
|
34
|
-
declare const BreadcrumbsContext: React.Context<BreadcrumbsContextValue>;
|
|
35
31
|
declare function Breadcrumbs({ children, elementRef, enableCurrentPage, onClick, ...otherProps }: BreadcrumbsProps): React.JSX.Element;
|
|
36
32
|
declare namespace Breadcrumbs {
|
|
37
33
|
var propTypes: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
2
|
+
export interface BreadcrumbsContext {
|
|
3
|
+
onClick?: BreadcrumbsClickHandler;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const BreadcrumbsContext: import("react").Context<BreadcrumbsContext>;
|
|
7
|
+
export default BreadcrumbsContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { BreadcrumbsClickHandler } from '
|
|
3
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface ItemPropsBase {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyTheme, Interpolation, InterpolationResult, ThemedProps } from '@splunk/themes';
|
|
2
2
|
declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle", "standalone"];
|
|
3
|
-
type ButtonVariant = typeof buttonVariants[number];
|
|
3
|
+
type ButtonVariant = (typeof buttonVariants)[number];
|
|
4
4
|
type ButtonStyleProps = ThemedProps & Partial<{
|
|
5
5
|
$append: boolean;
|
|
6
6
|
$prepend: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { JSONElement } from '@splunk/react-ui/JSONTree';
|
|
3
4
|
import { TreeItemPropsBase } from '@splunk/react-ui/Tree';
|
|
4
|
-
import { JSONElement } from './JSONTree';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
export type ExpandLinkRenderer = (params: {
|
|
7
7
|
onToggleExpansion: (event: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLSpanElement>, data?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '
|
|
2
|
+
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '@splunk/react-ui/JSONTree';
|
|
3
3
|
type RenderTreeItemsProps = {
|
|
4
4
|
baseId: string;
|
|
5
5
|
defaultOpen?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '
|
|
3
|
+
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
|
|
4
4
|
import { SelectBaseProps } from '../Select/SelectBase';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
interface CompactPropsBase {
|
|
@@ -196,7 +196,7 @@ declare namespace Compact {
|
|
|
196
196
|
/** @private */
|
|
197
197
|
virtualization: PropTypes.Requireable<number>;
|
|
198
198
|
};
|
|
199
|
-
var Option: typeof import("
|
|
199
|
+
var Option: typeof import("@splunk/react-ui/Multiselect").Option;
|
|
200
200
|
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
201
201
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
202
202
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '
|
|
3
|
+
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface NormalPropsBase {
|
|
6
6
|
/**
|
|
@@ -165,7 +165,7 @@ declare namespace Normal {
|
|
|
165
165
|
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
166
166
|
values: PropTypes.Requireable<any[]>;
|
|
167
167
|
};
|
|
168
|
-
var Option: typeof import("
|
|
168
|
+
var Option: typeof import("@splunk/react-ui/Multiselect").Option;
|
|
169
169
|
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
170
170
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
171
171
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { RadioListChangeHandler, RadioListValueTypes } from '
|
|
3
|
+
import { RadioListChangeHandler, RadioListValueTypes } from '@splunk/react-ui/RadioList';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface OptionPropsBase {
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -17,15 +17,18 @@ interface StepBarPropsBase {
|
|
|
17
17
|
* Setting inline to true makes the Step Bar an inline element. It assumes its minimum width.
|
|
18
18
|
*/
|
|
19
19
|
inline?: boolean;
|
|
20
|
+
/** The flow direction of steps. */
|
|
21
|
+
orientation?: 'horizontal' | 'vertical';
|
|
20
22
|
}
|
|
21
23
|
type StepBarProps = ComponentProps<StepBarPropsBase, 'ul'>;
|
|
22
|
-
declare function StepBar({ activeStepId, children, elementRef, inline, ...otherProps }: StepBarProps): React.JSX.Element;
|
|
24
|
+
declare function StepBar({ activeStepId, children, elementRef, inline, orientation, ...otherProps }: StepBarProps): React.JSX.Element;
|
|
23
25
|
declare namespace StepBar {
|
|
24
26
|
var propTypes: {
|
|
25
27
|
activeStepId: PropTypes.Validator<any>;
|
|
26
28
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
29
|
elementRef: PropTypes.Requireable<object>;
|
|
28
30
|
inline: PropTypes.Requireable<boolean>;
|
|
31
|
+
orientation: PropTypes.Requireable<string>;
|
|
29
32
|
};
|
|
30
33
|
var Step: typeof import("./Step").default;
|
|
31
34
|
}
|
|
@@ -20,6 +20,11 @@ interface SwitchPropsBase {
|
|
|
20
20
|
*/
|
|
21
21
|
appearance?: 'checkbox' | 'toggle';
|
|
22
22
|
children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The id of the description. When placed in a ControlGroup, this is automatically set to the
|
|
25
|
+
* ControlGroup's help component.
|
|
26
|
+
*/
|
|
27
|
+
describedBy?: string;
|
|
23
28
|
disabled?: boolean;
|
|
24
29
|
/**
|
|
25
30
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
@@ -88,11 +93,12 @@ type SwitchProps = ComponentProps<SwitchCheckboxWithSomePropsBase | SwitchNoSome
|
|
|
88
93
|
/**
|
|
89
94
|
* `Switch` is a basic form control with an on/off state.
|
|
90
95
|
*/
|
|
91
|
-
declare function Switch({ appearance, children, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
|
|
96
|
+
declare function Switch({ appearance, children, describedBy, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
|
|
92
97
|
declare namespace Switch {
|
|
93
98
|
var propTypes: {
|
|
94
99
|
appearance: PropTypes.Requireable<string>;
|
|
95
100
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
101
|
+
describedBy: PropTypes.Requireable<string>;
|
|
96
102
|
disabled: PropTypes.Requireable<boolean>;
|
|
97
103
|
elementRef: PropTypes.Requireable<object>;
|
|
98
104
|
error: PropTypes.Requireable<boolean>;
|
|
@@ -41,7 +41,9 @@ interface TabPropsBase {
|
|
|
41
41
|
* instead of a <button> tag. */
|
|
42
42
|
to?: string;
|
|
43
43
|
/**
|
|
44
|
-
* Content to show in a tooltip.
|
|
44
|
+
* Content to show in a tooltip when the user hovers over or focuses on the Tab.
|
|
45
|
+
*
|
|
46
|
+
* Note: The tooltip will override the label for the Tab for screen readers.
|
|
45
47
|
*/
|
|
46
48
|
tooltip?: React.ReactNode;
|
|
47
49
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Icons
|
|
4
|
+
* @description Icons can be used in tabs to provide additional context.
|
|
5
|
+
* Use icons sparingly and only when they add value that the text alone cannot communicate.
|
|
6
|
+
*
|
|
7
|
+
* Icon only tabs are not recommended. If you do use an icon only tab, a tooltip is required to provide an accessible name to the tab.
|
|
4
8
|
*/
|
|
5
9
|
declare function IconsLeft(): React.JSX.Element;
|
|
6
10
|
export default IconsLeft;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* @name Tooltips
|
|
4
|
+
* @description Tooltips must be used when the entire tab label is not visible: e.g. due to truncation.
|
|
5
|
+
* The tooltip will override the accessible name of the tab.
|
|
6
|
+
* Tooltips should not be used to add a description or additional information.
|
|
4
7
|
*/
|
|
5
8
|
declare function Tooltips(): React.JSX.Element;
|
|
6
9
|
export default Tooltips;
|
|
@@ -22,6 +22,8 @@ interface PanelPropsBase {
|
|
|
22
22
|
panelId: string;
|
|
23
23
|
/**
|
|
24
24
|
* Content to show in a tooltip when the user hovers over or focuses on the tab.
|
|
25
|
+
*
|
|
26
|
+
* Note: The tooltip will override the label for the Panel for screen readers.
|
|
25
27
|
*/
|
|
26
28
|
tooltip?: React.ReactNode;
|
|
27
29
|
/** Prevents user from clicking the tab. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TableRequestMoveColumnHandler } from '
|
|
3
|
+
import { TableRequestMoveColumnHandler } from '@splunk/react-ui/Table';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
|
|
6
6
|
columnId?: string;
|
package/types/src/Table/Row.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TableRequestMoveRowHandler } from '
|
|
3
|
+
import { TableRequestMoveRowHandler } from '@splunk/react-ui/Table';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
/** @public */
|
|
6
6
|
type RowActionPrimaryClickHandler = (event: React.MouseEvent, data?: any) => void;
|
|
@@ -119,6 +119,7 @@ interface TablePropsBase {
|
|
|
119
119
|
/**
|
|
120
120
|
* An event handler for resize of columns for the current column being resized. The function is passed an event and a data
|
|
121
121
|
* object with `columnId`, `id`, `index`, and `width`.
|
|
122
|
+
* Every Table.HeadCell must have a width prop when using onRequestResizeColumn. Table with resizableFillLayout supports width of "auto".
|
|
122
123
|
*/
|
|
123
124
|
onRequestResizeColumn?: TableRequestResizeColumnHandler;
|
|
124
125
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { RemoveNodeHandler, SetNodeHandler } from '@splunk/react-ui/Tree';
|
|
1
2
|
import { TreeItemClickHandler, TreeItemKeyDownHandler } from './Item';
|
|
2
|
-
import { RemoveNodeHandler, SetNodeHandler } from './Tree';
|
|
3
3
|
export interface TreeContext {
|
|
4
4
|
defaultIndent?: boolean;
|
|
5
5
|
onItemKeyDown?: TreeItemKeyDownHandler;
|
package/useControlled.js
CHANGED
|
@@ -1,67 +1,34 @@
|
|
|
1
1
|
/******/ (() => {
|
|
2
2
|
// webpackBootstrap
|
|
3
3
|
/******/ "use strict";
|
|
4
|
-
/******/
|
|
5
|
-
|
|
6
|
-
/***/ e => {
|
|
7
|
-
e.exports = require("lodash/has");
|
|
8
|
-
/***/ },
|
|
9
|
-
/***/ 9497:
|
|
10
|
-
/***/ e => {
|
|
11
|
-
e.exports = require("react");
|
|
12
|
-
/***/
|
|
13
|
-
/******/ }
|
|
14
|
-
};
|
|
15
|
-
/************************************************************************/
|
|
16
|
-
/******/ // The module cache
|
|
17
|
-
/******/ var r = {};
|
|
18
|
-
/******/
|
|
19
|
-
/******/ // The require function
|
|
20
|
-
/******/ function t(o) {
|
|
21
|
-
/******/ // Check if module is in cache
|
|
22
|
-
/******/ var n = r[o];
|
|
23
|
-
/******/ if (n !== undefined) {
|
|
24
|
-
/******/ return n.exports;
|
|
25
|
-
/******/ }
|
|
26
|
-
/******/ // Create a new module (and put it into the cache)
|
|
27
|
-
/******/ var u = r[o] = {
|
|
28
|
-
/******/ // no module.id needed
|
|
29
|
-
/******/ // no module.loaded needed
|
|
30
|
-
/******/ exports: {}
|
|
31
|
-
/******/ };
|
|
32
|
-
/******/
|
|
33
|
-
/******/ // Execute the module function
|
|
34
|
-
/******/ e[o](u, u.exports, t);
|
|
35
|
-
/******/
|
|
36
|
-
/******/ // Return the exports of the module
|
|
37
|
-
/******/ return u.exports;
|
|
38
|
-
/******/ }
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
39
6
|
/******/
|
|
40
7
|
/************************************************************************/
|
|
41
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
42
9
|
/******/ (() => {
|
|
43
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
44
|
-
/******/
|
|
45
|
-
/******/ var
|
|
46
|
-
/******/ () =>
|
|
47
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = r => {
|
|
12
|
+
/******/ var t = r && r.__esModule ?
|
|
13
|
+
/******/ () => r["default"]
|
|
14
|
+
/******/ : () => r
|
|
48
15
|
/******/;
|
|
49
|
-
|
|
50
|
-
a:
|
|
16
|
+
e.d(t, {
|
|
17
|
+
a: t
|
|
51
18
|
});
|
|
52
|
-
/******/ return
|
|
19
|
+
/******/ return t;
|
|
53
20
|
/******/ };
|
|
54
21
|
/******/ })();
|
|
55
22
|
/******/
|
|
56
23
|
/******/ /* webpack/runtime/define property getters */
|
|
57
24
|
/******/ (() => {
|
|
58
25
|
/******/ // define getter functions for harmony exports
|
|
59
|
-
/******/
|
|
60
|
-
/******/ for (var o in
|
|
61
|
-
/******/ if (
|
|
62
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (r, t) => {
|
|
27
|
+
/******/ for (var o in t) {
|
|
28
|
+
/******/ if (e.o(t, o) && !e.o(r, o)) {
|
|
29
|
+
/******/ Object.defineProperty(r, o, {
|
|
63
30
|
enumerable: true,
|
|
64
|
-
get:
|
|
31
|
+
get: t[o]
|
|
65
32
|
});
|
|
66
33
|
/******/ }
|
|
67
34
|
/******/ }
|
|
@@ -70,14 +37,14 @@
|
|
|
70
37
|
/******/
|
|
71
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
72
39
|
/******/ (() => {
|
|
73
|
-
/******/
|
|
40
|
+
/******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
74
41
|
/******/;
|
|
75
42
|
})();
|
|
76
43
|
/******/
|
|
77
44
|
/******/ /* webpack/runtime/make namespace object */
|
|
78
45
|
/******/ (() => {
|
|
79
46
|
/******/ // define __esModule on exports
|
|
80
|
-
/******/
|
|
47
|
+
/******/ e.r = e => {
|
|
81
48
|
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
82
49
|
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
83
50
|
value: "Module"
|
|
@@ -89,38 +56,36 @@
|
|
|
89
56
|
/******/ };
|
|
90
57
|
/******/ })();
|
|
91
58
|
/******/
|
|
92
|
-
/************************************************************************/ var
|
|
93
|
-
//
|
|
94
|
-
(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
59
|
+
/************************************************************************/ var r = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(r);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(r, {
|
|
64
|
+
default: () => /* reexport */ l,
|
|
65
|
+
isAllowedType: () => /* reexport */ f,
|
|
66
|
+
isPrimitive: () => /* reexport */ a
|
|
67
|
+
});
|
|
68
|
+
// CONCATENATED MODULE: external "react"
|
|
69
|
+
const t = require("react");
|
|
70
|
+
// CONCATENATED MODULE: external "lodash/isEqual"
|
|
71
|
+
const o = require("lodash/isEqual");
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/has"
|
|
73
|
+
const n = require("lodash/has");
|
|
74
|
+
var u = e.n(n);
|
|
75
|
+
// CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
|
|
76
|
+
function a(e) {
|
|
77
|
+
return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
|
|
78
|
+
}
|
|
79
|
+
function f(e) {
|
|
80
|
+
if (a(e)) {
|
|
81
|
+
return true;
|
|
113
82
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
if (Array.isArray(e)) {
|
|
119
|
-
return e.every(a);
|
|
120
|
-
}
|
|
121
|
-
return false;
|
|
83
|
+
if (Array.isArray(e)) {
|
|
84
|
+
return e.every(a);
|
|
122
85
|
}
|
|
123
|
-
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
124
89
|
* This is a private component not intended for use outside @splunk/react-ui
|
|
125
90
|
*
|
|
126
91
|
* A hook that accepts a default value (as used in an uncontrolled component)
|
|
@@ -129,22 +94,21 @@
|
|
|
129
94
|
* are not happening.
|
|
130
95
|
*
|
|
131
96
|
* Return the controlled state of the component.
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
module.exports = o;
|
|
97
|
+
*/ function i(e) {
|
|
98
|
+
var r = e.componentProps, o = e.componentName, n = o === void 0 ? "this component" : o, a = e.defaultValuePropName, f = a === void 0 ? "defaultValue" : a, i = e.valuePropName, l = i === void 0 ? "value" : i;
|
|
99
|
+
var s = (0, t.useRef)(u()(r, l));
|
|
100
|
+
var d = (0, t.useRef)(r[f]);
|
|
101
|
+
(0, t.useEffect)((function() {
|
|
102
|
+
if (false) {}
|
|
103
|
+
}), [ n, r, f, l ]);
|
|
104
|
+
(0, t.useEffect)((function() {
|
|
105
|
+
if (false) {}
|
|
106
|
+
if (false) {}
|
|
107
|
+
if (false) {}
|
|
108
|
+
}), [ n, r, f, l ]);
|
|
109
|
+
return s.current;
|
|
110
|
+
}
|
|
111
|
+
/* harmony default export */ const l = i;
|
|
112
|
+
// CONCATENATED MODULE: ./src/useControlled/index.ts
|
|
113
|
+
module.exports = r;
|
|
150
114
|
/******/})();
|