@splunk/react-ui 5.0.0-beta.4 → 5.0.0-beta.5
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/Button.js +3 -1
- package/CHANGELOG.md +4 -1
- package/CHANGELOG.v5.mdx +35 -0
- package/Card.js +163 -162
- package/Chip.js +171 -225
- package/Clickable.js +79 -76
- package/ComboBox.js +1 -1
- package/Date.js +160 -184
- package/DualListbox.js +439 -504
- package/File.js +449 -324
- package/FormRows.js +143 -142
- package/JSONTree.js +496 -521
- package/Layer.js +162 -97
- package/Link.js +20 -13
- package/MIGRATION.v5.mdx +47 -0
- package/Markdown.js +1 -1
- package/Message.js +119 -141
- package/MessageBar.js +109 -168
- package/Multiselect.js +595 -602
- package/Popover.js +194 -190
- package/Progress.js +68 -54
- package/RadioBar.js +4 -1
- package/RadioList.js +67 -65
- package/Resize.js +377 -265
- package/ResultsMenu.js +573 -661
- package/ScrollContainerContext.js +13 -9
- package/Search.js +1 -1
- package/Select.js +206 -199
- package/Slider.js +455 -329
- package/StepBar.js +2 -2
- package/Switch.js +88 -87
- package/TabBar.js +322 -317
- package/TabLayout.js +34 -34
- package/Table.js +548 -525
- package/Text.js +20 -19
- package/TextArea.js +278 -152
- package/Tooltip.js +173 -177
- package/Tree.js +2 -2
- package/Typography.js +30 -28
- package/WaitSpinner.js +6 -11
- package/cypress/support/commands.ts +14 -4
- package/cypress/support/index.d.ts +1 -1
- package/package.json +5 -5
- package/stubs-splunkui.d.ts +0 -4
- package/types/src/Card/Card.d.ts +3 -1
- package/types/src/Card/Header.d.ts +2 -0
- package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
- package/types/src/Clickable/Clickable.d.ts +11 -3
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Message/Message.d.ts +1 -1
- package/types/src/MessageBar/MessageBar.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -8
- package/types/src/Multiselect/Normal.d.ts +1 -7
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
- package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
- package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/TabBar/TabBar.d.ts +8 -5
- package/types/src/TabBar/TabBarContext.d.ts +1 -1
- package/types/src/TabLayout/TabLayout.d.ts +8 -5
- package/types/src/Typography/Typography.d.ts +27 -22
- package/types/src/Date/Icon.d.ts +0 -3
- package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
- package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
- /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
package/Typography.js
CHANGED
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
const t = require("react");
|
|
69
69
|
var n = e.n(t);
|
|
70
70
|
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
-
const
|
|
72
|
-
var
|
|
71
|
+
const o = require("prop-types");
|
|
72
|
+
var a = e.n(o);
|
|
73
73
|
// CONCATENATED MODULE: external "styled-components"
|
|
74
74
|
const i = require("styled-components");
|
|
75
75
|
var l = e.n(i);
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
}
|
|
91
91
|
function c(e, r) {
|
|
92
92
|
if (null == e) return {};
|
|
93
|
-
var t, n,
|
|
93
|
+
var t, n, o = f(e, r);
|
|
94
94
|
if (Object.getOwnPropertySymbols) {
|
|
95
|
-
var
|
|
96
|
-
for (n = 0; n <
|
|
97
|
-
t =
|
|
95
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
96
|
+
for (n = 0; n < a.length; n++) {
|
|
97
|
+
t = a[n], r.includes(t) || {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return o;
|
|
101
101
|
}
|
|
102
102
|
function f(e, r) {
|
|
103
103
|
if (null == e) return {};
|
|
@@ -111,15 +111,16 @@
|
|
|
111
111
|
return t;
|
|
112
112
|
}
|
|
113
113
|
var y = {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
weight:
|
|
114
|
+
as: a().string.isRequired,
|
|
115
|
+
children: a().node.isRequired,
|
|
116
|
+
color: a().oneOf([ "active", "default", "disabled", "inverted", "muted", "inherit" ]),
|
|
117
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
118
|
+
family: a().oneOf([ "sansSerif", "monospace", "title" ]),
|
|
119
|
+
lineHeight: a().oneOf([ "single", "tight", "snug", "comfortable", "relaxed", "spacious", "normal" ]),
|
|
120
|
+
size: a().oneOf([ 24, 20, 18, 16, 14, 12 ]),
|
|
121
|
+
variant: a().oneOf(s.typographyVariants),
|
|
122
|
+
weight: a().oneOf([ "light", "normal", "semiBold", "bold", "extraBold", "heavy" ]),
|
|
123
|
+
withReset: a().bool
|
|
123
124
|
};
|
|
124
125
|
var d = l().p.withConfig({
|
|
125
126
|
displayName: "Typography__StyledTypography",
|
|
@@ -131,25 +132,26 @@
|
|
|
131
132
|
/**
|
|
132
133
|
* Typography renders text content with styling based on the Splunk Design System.
|
|
133
134
|
*/ function g(e) {
|
|
134
|
-
var r = e.
|
|
135
|
+
var r = e.as, o = e.children, a = e.color, i = e.elementRef, l = e.family, s = e.lineHeight, u = e.size, f = e.variant, y = e.weight, g = e.withReset, h = g === void 0 ? true : g, v = c(e, [ "as", "children", "color", "elementRef", "family", "lineHeight", "size", "variant", "weight", "withReset" ]);
|
|
135
136
|
// @docs-props-type TypographyPropsBase
|
|
136
|
-
var
|
|
137
|
+
var m = (0, t.useMemo)((function() {
|
|
137
138
|
return {
|
|
139
|
+
color: a,
|
|
138
140
|
family: l,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
lineHeight: s,
|
|
142
|
+
size: u,
|
|
143
|
+
weight: y,
|
|
144
|
+
withReset: h
|
|
143
145
|
};
|
|
144
|
-
}), [
|
|
146
|
+
}), [ a, l, s, u, y, h ]);
|
|
145
147
|
|
|
146
148
|
return n().createElement(d, p({
|
|
147
|
-
as:
|
|
148
|
-
ref: o,
|
|
149
|
+
as: r,
|
|
149
150
|
"data-test": "typography",
|
|
150
|
-
|
|
151
|
-
$typographyParams:
|
|
152
|
-
|
|
151
|
+
ref: i,
|
|
152
|
+
$typographyParams: m,
|
|
153
|
+
$variant: f
|
|
154
|
+
}, v), o);
|
|
153
155
|
}
|
|
154
156
|
g.propTypes = y;
|
|
155
157
|
/* harmony default export */ const h = g;
|
package/WaitSpinner.js
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ z
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const r = require("react");
|
|
@@ -109,12 +109,7 @@
|
|
|
109
109
|
var b = c().circle.withConfig({
|
|
110
110
|
displayName: "WaitSpinnerStyles__StyledFillPath",
|
|
111
111
|
componentId: "sc-1nu971z-3"
|
|
112
|
-
})([ "fill:transparent;stroke-width:2;stroke:", ";stroke-dasharray:7 113;stroke-dashoffset:3;", "" ],
|
|
113
|
-
f.pickVariant)("$size", {
|
|
114
|
-
small: f.variables.contentColorDefault,
|
|
115
|
-
medium: f.variables.contentColorDefault,
|
|
116
|
-
large: f.variables.contentColorAccent
|
|
117
|
-
}), (function(e) {
|
|
112
|
+
})([ "fill:transparent;stroke-width:2;stroke:", ";stroke-dasharray:7 113;stroke-dashoffset:3;", "" ], f.variables.contentColorAccent, (function(e) {
|
|
118
113
|
var t = e.$animated;
|
|
119
114
|
return t && (0, l.css)([ "animation:", " ", " infinite;" ], h, p);
|
|
120
115
|
}));
|
|
@@ -152,12 +147,12 @@
|
|
|
152
147
|
}
|
|
153
148
|
return r;
|
|
154
149
|
}
|
|
155
|
-
var
|
|
150
|
+
var O = {
|
|
156
151
|
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
157
152
|
screenReaderText: i().oneOfType([ i().string, i().oneOf([ "null" ]) ]),
|
|
158
153
|
size: i().oneOf([ "small", "medium", "large" ])
|
|
159
154
|
};
|
|
160
|
-
function
|
|
155
|
+
function x(e) {
|
|
161
156
|
var t = e.elementRef, r = e.screenReaderText, a = r === void 0 ? (0, o._)("Waiting") : r, i = e.size, l = i === void 0 ? "small" : i, c = w(e, [ "elementRef", "screenReaderText", "size" ]);
|
|
162
157
|
// @docs-props-type WaitSpinnerPropsBase
|
|
163
158
|
var f = (0, s.useAnimationToggle)() === "on";
|
|
@@ -185,8 +180,8 @@
|
|
|
185
180
|
$size: l
|
|
186
181
|
}))));
|
|
187
182
|
}
|
|
188
|
-
|
|
189
|
-
/* harmony default export */ const
|
|
183
|
+
x.propTypes = O;
|
|
184
|
+
/* harmony default export */ const z = x;
|
|
190
185
|
// CONCATENATED MODULE: ./src/WaitSpinner/index.ts
|
|
191
186
|
module.exports = t;
|
|
192
187
|
/******/})();
|
|
@@ -3,9 +3,19 @@ import 'cypress-real-events';
|
|
|
3
3
|
|
|
4
4
|
// https://docs.cypress.io/api/commands/hover
|
|
5
5
|
Cypress.Commands.add('hover', (selector: string) => {
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
} else {
|
|
9
|
-
cy.get(selector).trigger('mouseover', { force: true });
|
|
6
|
+
if (!selector) {
|
|
7
|
+
throw new Error('You must provide a valid selector to hover over.');
|
|
10
8
|
}
|
|
9
|
+
|
|
10
|
+
return cy.get(selector).then(($el) => {
|
|
11
|
+
if ($el.length === 0) {
|
|
12
|
+
throw new Error(`No elements found for selector: ${selector}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (Cypress.browser.name !== 'firefox') {
|
|
16
|
+
return cy.wrap($el).realHover();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return cy.wrap($el).trigger('mouseover', { force: true });
|
|
20
|
+
});
|
|
11
21
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.5",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@dnd-kit/sortable": "^8.0.0",
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
47
|
"@react-spring/web": "^9.7.5",
|
|
48
|
-
"@splunk/react-icons": "5.0.0-beta.
|
|
49
|
-
"@splunk/themes": "1.0.0-beta.
|
|
48
|
+
"@splunk/react-icons": "5.0.0-beta.5",
|
|
49
|
+
"@splunk/themes": "1.0.0-beta.5",
|
|
50
50
|
"@splunk/ui-utils": "^1.8.0",
|
|
51
51
|
"decimal.js-light": "^2.2.3",
|
|
52
52
|
"lodash": "^4.17.14",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@babel/core": "^7.2.0",
|
|
62
62
|
"@babel/plugin-transform-runtime": "^7.18.6",
|
|
63
63
|
"@splunk/babel-preset": "^4.0.0",
|
|
64
|
-
"@splunk/docs-gen": "1.0.0-beta.14.v5.
|
|
64
|
+
"@splunk/docs-gen": "1.0.0-beta.14.v5.3",
|
|
65
65
|
"@splunk/eslint-config": "^5.0.0",
|
|
66
|
-
"@splunk/react-docs": "1.0.0-beta.
|
|
66
|
+
"@splunk/react-docs": "1.0.0-beta.22.v5",
|
|
67
67
|
"@splunk/stylelint-config": "^5.0.0",
|
|
68
68
|
"@splunk/test-runner-utils": "^0.4.1",
|
|
69
69
|
"@splunk/webpack-configs": "^7.0.2",
|
package/stubs-splunkui.d.ts
CHANGED
|
@@ -90,10 +90,6 @@ declare module '@splunk/ui-utils/style' {
|
|
|
90
90
|
function toClassName(...args: ClassNameArg[]): string;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
declare module '@splunk/ui-utils/userAgent' {
|
|
94
|
-
function isIE11(): boolean;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
93
|
declare module '@splunk/react-docs/DocExample' {
|
|
98
94
|
function getDependencyVersions(
|
|
99
95
|
packageJSON: Record<string, unknown>,
|
package/types/src/Card/Card.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface CardPropsBase {
|
|
|
46
46
|
to?: string;
|
|
47
47
|
/** Returns a value on click. Use when composing or if you have more than one selectable `Card`. */
|
|
48
48
|
value?: any;
|
|
49
|
-
/** Overrides the HTML tag for the Card component. Defaults to `article`. */
|
|
49
|
+
/** Overrides the HTML tag for the Card component. Defaults to `article`. Ignored if `to` or `onClick` are present. */
|
|
50
50
|
tag?: 'article' | 'div' | 'aside' | 'section';
|
|
51
51
|
}
|
|
52
52
|
interface CardPropsBaseNonClickable extends CardPropsBase {
|
|
@@ -60,12 +60,14 @@ interface CardPropsBaseOnClickClickable extends CardPropsBase {
|
|
|
60
60
|
onClick: CardClickHandler;
|
|
61
61
|
selected?: boolean;
|
|
62
62
|
to?: string;
|
|
63
|
+
tag?: never;
|
|
63
64
|
}
|
|
64
65
|
interface CardPropsBaseClickable extends CardPropsBase {
|
|
65
66
|
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
66
67
|
onClick?: CardClickHandler;
|
|
67
68
|
selected?: never;
|
|
68
69
|
to?: string;
|
|
70
|
+
tag?: never;
|
|
69
71
|
}
|
|
70
72
|
type CardNonClickableProps = ComponentProps<CardPropsBaseNonClickable, 'div' | 'article'>;
|
|
71
73
|
type CardClickableButtonProps = ComponentProps<CardPropsBaseOnClickClickable | CardPropsBaseClickable, 'button'>;
|
|
@@ -20,6 +20,8 @@ interface HeaderPropsBase {
|
|
|
20
20
|
*/
|
|
21
21
|
actionsSecondary?: React.ReactNode;
|
|
22
22
|
/**
|
|
23
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
24
|
+
*
|
|
23
25
|
* Make the title an anchor so it can be bookmarked with a fragment.
|
|
24
26
|
*/
|
|
25
27
|
anchor?: string;
|
|
@@ -37,13 +37,21 @@ interface ClickablePropsBase {
|
|
|
37
37
|
*/
|
|
38
38
|
navigationLabel?: string;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
tag?: 'a' | 'button';
|
|
43
|
+
/**
|
|
44
|
+
* A URL for a link. If set, an `a` element is used instead
|
|
41
45
|
* of a `button` element (link mode).
|
|
42
46
|
*/
|
|
43
47
|
to?: string;
|
|
44
48
|
}
|
|
45
|
-
type ClickableButtonProps = ComponentProps<ClickablePropsBase
|
|
46
|
-
|
|
49
|
+
type ClickableButtonProps = ComponentProps<ClickablePropsBase & {
|
|
50
|
+
to?: never;
|
|
51
|
+
}, 'button'>;
|
|
52
|
+
type ClickableLinkProps = ComponentProps<ClickablePropsBase & {
|
|
53
|
+
to: string;
|
|
54
|
+
}, 'a', 'href'>;
|
|
47
55
|
type ClickableProps = ClickableButtonProps | ClickableLinkProps;
|
|
48
56
|
/**
|
|
49
57
|
* `Clickable` renders as a `button` element, or as an `a` element if the `to` prop is set
|
package/types/src/Link/Link.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ interface LinkPropsBase {
|
|
|
31
31
|
* The URL or path to link to.
|
|
32
32
|
*/
|
|
33
33
|
to?: string;
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
tag?: 'a' | 'button';
|
|
34
38
|
}
|
|
35
39
|
type LinkLinkProps = ComponentProps<LinkPropsBase, 'a', 'href'>;
|
|
36
40
|
type LinkButtonProps = ComponentProps<LinkPropsBase, 'button'>;
|
|
@@ -21,7 +21,7 @@ interface MessagePropsBase {
|
|
|
21
21
|
type?: 'info' | 'warning' | 'error' | 'success';
|
|
22
22
|
}
|
|
23
23
|
type MessageProps = ComponentProps<MessagePropsBase, 'div'>;
|
|
24
|
-
declare function Message({ appearance, children,
|
|
24
|
+
declare function Message({ appearance, children, elementRef, onRequestRemove, type, ...otherProps }: MessageProps): React.JSX.Element;
|
|
25
25
|
declare namespace Message {
|
|
26
26
|
var propTypes: {
|
|
27
27
|
appearance: PropTypes.Requireable<string>;
|
|
@@ -13,7 +13,7 @@ interface MessageBarPropsBase {
|
|
|
13
13
|
/**
|
|
14
14
|
* Includes a close button. Always consider including a close button.
|
|
15
15
|
*/
|
|
16
|
-
onRequestClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
onRequestClose?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
17
17
|
/**
|
|
18
18
|
* Sets the severity of this `MessageBar`.
|
|
19
19
|
* */
|
|
@@ -161,12 +161,6 @@ interface MultiselectPropsBase {
|
|
|
161
161
|
showSelectedValuesFirst?: 'nextOpen' | 'immediately' | 'never';
|
|
162
162
|
/** Pressing Tab while entering an input confirms the new value. Requires `allowNewValues`. */
|
|
163
163
|
tabConfirmsNewValue?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Specifies whether or not to add an overlay div to clickaway from the popover. This is
|
|
166
|
-
* to avoid cases where some other element is accidentally clicked when the popover is open.
|
|
167
|
-
* Note: This only works with the Normal multiselect.
|
|
168
|
-
*/
|
|
169
|
-
useClickawayOverlay?: boolean;
|
|
170
164
|
/**
|
|
171
165
|
* Value will be matched to one of the children to deduce the label and/or icon for the
|
|
172
166
|
* toggle.
|
|
@@ -204,7 +198,7 @@ interface MultiselectPropsBaseCompact extends MultiselectPropsBase {
|
|
|
204
198
|
type MultiselectNormalProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseNormal, 'div'>;
|
|
205
199
|
type MultiselectCompactProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseCompact, 'button'>;
|
|
206
200
|
type MultiselectProps = MultiselectNormalProps | MultiselectCompactProps;
|
|
207
|
-
declare function Multiselect({ allowNewValues, animateLoading, compact, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, filter, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onOpen, onScroll, onScrollBottom, placeholder, repositionMode, selectAllAppearance, showSelectedValuesFirst, tabConfirmsNewValue,
|
|
201
|
+
declare function Multiselect({ allowNewValues, animateLoading, compact, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, filter, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onOpen, onScroll, onScrollBottom, placeholder, repositionMode, selectAllAppearance, showSelectedValuesFirst, tabConfirmsNewValue, values, virtualization, ...otherProps }: MultiselectProps): React.JSX.Element;
|
|
208
202
|
declare namespace Multiselect {
|
|
209
203
|
var componentType: string;
|
|
210
204
|
var Option: typeof import("./Option").default;
|
|
@@ -244,7 +238,6 @@ declare namespace Multiselect {
|
|
|
244
238
|
selectAllAppearance: PropTypes.Requireable<string>;
|
|
245
239
|
showSelectedValuesFirst: PropTypes.Requireable<string>;
|
|
246
240
|
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
247
|
-
useClickawayOverlay: PropTypes.Requireable<boolean>;
|
|
248
241
|
values: PropTypes.Requireable<any[]>;
|
|
249
242
|
/** @private */
|
|
250
243
|
virtualization: PropTypes.Requireable<number>;
|
|
@@ -115,11 +115,6 @@ interface NormalPropsBase {
|
|
|
115
115
|
repositionMode?: 'none' | 'flip';
|
|
116
116
|
/** Pressing tab while entering an input confirms the new value. Requires `allowNewValues`. */
|
|
117
117
|
tabConfirmsNewValue?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Specifies whether or not to add a overlay div to clickaway from the popover. This is
|
|
120
|
-
* to avoid cases where some other element is accidentally clicked when the popover is open
|
|
121
|
-
*/
|
|
122
|
-
useClickawayOverlay?: boolean;
|
|
123
118
|
/**
|
|
124
119
|
* Value will be matched to one of the children to deduce the label and/or icon for the
|
|
125
120
|
* toggle. An `onChange` callback is required.
|
|
@@ -128,7 +123,7 @@ interface NormalPropsBase {
|
|
|
128
123
|
}
|
|
129
124
|
export declare const getInlineMenuStyle: (({ anchorWidth, maxHeight, menuStyle }: any) => any) & import("lodash").MemoizedFunction;
|
|
130
125
|
type NormalProps = ComponentProps<NormalPropsBase, 'div'>;
|
|
131
|
-
declare function Normal({ allowNewValues, animateLoading, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, footerMessage, inline, inputId, inputRef: inputRefProp, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onScroll, onScrollBottom, onOpen, placeholder, required, repositionMode, tabConfirmsNewValue,
|
|
126
|
+
declare function Normal({ allowNewValues, animateLoading, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, footerMessage, inline, inputId, inputRef: inputRefProp, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onScroll, onScrollBottom, onOpen, placeholder, required, repositionMode, tabConfirmsNewValue, values, ...otherProps }: NormalProps): React.JSX.Element;
|
|
132
127
|
declare namespace Normal {
|
|
133
128
|
var propTypes: {
|
|
134
129
|
allowNewValues: PropTypes.Requireable<boolean>;
|
|
@@ -162,7 +157,6 @@ declare namespace Normal {
|
|
|
162
157
|
required: PropTypes.Requireable<boolean>;
|
|
163
158
|
repositionMode: PropTypes.Requireable<string>;
|
|
164
159
|
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
165
|
-
useClickawayOverlay: PropTypes.Requireable<boolean>;
|
|
166
160
|
values: PropTypes.Requireable<any[]>;
|
|
167
161
|
};
|
|
168
162
|
var Option: typeof import("./Option").default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Children extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Children(): React.JSX.Element;
|
|
10
3
|
export default Children;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Controlled extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Controlled(): React.JSX.Element;
|
|
10
3
|
export default Controlled;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class CustomizeSelected extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function CustomizeSelected(): React.JSX.Element;
|
|
10
3
|
export default CustomizeSelected;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Disabled extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Disabled(): React.JSX.Element;
|
|
10
3
|
export default Disabled;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class MultiselectError extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function MultiselectError(): React.JSX.Element;
|
|
10
3
|
export default MultiselectError;
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
import { Movie, MovieOption } from '@splunk/react-ui/fixtures/FetchOptions';
|
|
4
|
-
interface ExampleState {
|
|
5
|
-
fullCount: number;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
options: MovieOption[];
|
|
8
|
-
values: (string | number | boolean)[];
|
|
9
|
-
}
|
|
10
|
-
declare class Fetching extends Component<object, ExampleState> {
|
|
11
|
-
private fetchOptions;
|
|
12
|
-
constructor(props: object);
|
|
13
|
-
componentDidMount(): void;
|
|
14
|
-
componentWillUnmount(): void;
|
|
15
|
-
handleChange: MultiselectChangeHandler;
|
|
16
|
-
handleFetch: (keyword?: string) => void;
|
|
17
|
-
handleFilterChange: MultiselectFilterChangeHandler;
|
|
18
|
-
createOption: (movie: Movie | MovieOption, isSelected?: boolean) => React.JSX.Element;
|
|
19
|
-
generateOptions: () => React.JSX.Element[];
|
|
20
|
-
footerMessage: () => string | null;
|
|
21
|
-
render(): React.JSX.Element;
|
|
22
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Fetching(): React.JSX.Element;
|
|
23
3
|
export default Fetching;
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
import { Movie, MovieOption } from '@splunk/react-ui/fixtures/FetchOptions';
|
|
4
|
-
interface ExampleState {
|
|
5
|
-
fullCount: number;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isLoadingMore: boolean;
|
|
8
|
-
options: MovieOption[];
|
|
9
|
-
values: (string | number | boolean)[];
|
|
10
|
-
}
|
|
11
|
-
declare class LoadMoreOnScrollBottom extends Component<object, ExampleState> {
|
|
12
|
-
private fetchOptions;
|
|
13
|
-
constructor(props: object);
|
|
14
|
-
componentDidMount(): void;
|
|
15
|
-
componentWillUnmount(): void;
|
|
16
|
-
handleChange: MultiselectChangeHandler;
|
|
17
|
-
handleFetch: (keyword?: string) => void;
|
|
18
|
-
handleFetchMore: (currentOptions: MovieOption[]) => void;
|
|
19
|
-
handleFilterChange: MultiselectFilterChangeHandler;
|
|
20
|
-
handleScrollBottom: () => void;
|
|
21
|
-
createOption: (movie: Movie | MovieOption, isSelected?: boolean) => React.JSX.Element;
|
|
22
|
-
generateOptions: () => React.JSX.Element[];
|
|
23
|
-
footerMessage: () => string;
|
|
24
|
-
render(): React.JSX.Element;
|
|
25
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function LoadMoreOnScrollBottom(): React.JSX.Element;
|
|
26
3
|
export default LoadMoreOnScrollBottom;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class NewValues extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function NewValues(): React.JSX.Element;
|
|
10
3
|
export default NewValues;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class TabInput extends Component<object, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: object);
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function TabInput(): React.JSX.Element;
|
|
10
3
|
export default TabInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
4
4
|
type ResultsMenuScrollBottomHandler = (event: React.UIEvent<HTMLDivElement> | null) => void;
|
|
5
5
|
interface ResultsMenuPropsBase {
|
|
6
6
|
/**
|
|
@@ -29,6 +29,7 @@ interface ResultsMenuPropsBase {
|
|
|
29
29
|
* - `roving`: Does not retain focus inside the menu. One tab stop. Uses up/down arrow keys to navigate and loop inside the menu.
|
|
30
30
|
*/
|
|
31
31
|
focusMode?: 'roving' | 'normal' | 'never';
|
|
32
|
+
footerMessage?: React.ReactNode;
|
|
32
33
|
/**
|
|
33
34
|
* Whether or not to show the loading message and/or wait spinner. It's not recommended to
|
|
34
35
|
* pass old children when loading new children. The loading animation will show below any
|
|
@@ -36,6 +37,7 @@ interface ResultsMenuPropsBase {
|
|
|
36
37
|
*/
|
|
37
38
|
isLoading?: boolean;
|
|
38
39
|
loadingMessage?: React.ReactNode;
|
|
40
|
+
menuId?: string;
|
|
39
41
|
noOptionsMessage?: React.ReactNode;
|
|
40
42
|
onScroll?: React.UIEventHandler<Element>;
|
|
41
43
|
/**
|
|
@@ -47,8 +49,6 @@ interface ResultsMenuPropsBase {
|
|
|
47
49
|
*/
|
|
48
50
|
onScrollBottom?: ResultsMenuScrollBottomHandler;
|
|
49
51
|
placement?: string;
|
|
50
|
-
footerMessage?: React.ReactNode;
|
|
51
|
-
menuId?: string;
|
|
52
52
|
}
|
|
53
53
|
declare const propTypes: {
|
|
54
54
|
animateLoading: PropTypes.Requireable<boolean>;
|
|
@@ -59,41 +59,30 @@ declare const propTypes: {
|
|
|
59
59
|
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
60
60
|
isLoading: PropTypes.Requireable<boolean>;
|
|
61
61
|
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
62
|
+
menuId: PropTypes.Requireable<string>;
|
|
62
63
|
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
63
64
|
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
65
|
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
66
|
placement: PropTypes.Requireable<string>;
|
|
66
|
-
menuId: PropTypes.Requireable<string>;
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
private handleMount;
|
|
87
|
-
private handleMouseEnter;
|
|
88
|
-
private handleMouseLeave;
|
|
89
|
-
private handleScroll;
|
|
90
|
-
private handleWheelMenu;
|
|
91
|
-
private handleScrollBottomOnFullMenu;
|
|
92
|
-
private handleScrollBottom;
|
|
93
|
-
private checkFullHeight;
|
|
94
|
-
private renderFooterMessage;
|
|
95
|
-
private createMenuContextValue;
|
|
96
|
-
render(): React.JSX.Element;
|
|
68
|
+
type ResultsMenuProps = ComponentProps<ResultsMenuPropsBase, 'div'>;
|
|
69
|
+
declare function ResultsMenu({ animateLoading, 'aria-multiselectable': ariaMultiselectable, children, childrenStart, elementRef, focusMode, footerMessage, isLoading, loadingMessage, menuId, noOptionsMessage, onScroll, onScrollBottom, placement, style, tabIndex, ...otherProps }: ResultsMenuProps): React.JSX.Element;
|
|
70
|
+
declare namespace ResultsMenu {
|
|
71
|
+
var propTypes: {
|
|
72
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
73
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
74
|
+
childrenStart: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
75
|
+
elementRef: PropTypes.Requireable<object>;
|
|
76
|
+
focusMode: PropTypes.Requireable<string>;
|
|
77
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
78
|
+
isLoading: PropTypes.Requireable<boolean>;
|
|
79
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
80
|
+
menuId: PropTypes.Requireable<string>;
|
|
81
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
82
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
+
placement: PropTypes.Requireable<string>;
|
|
85
|
+
};
|
|
97
86
|
}
|
|
98
87
|
export default ResultsMenu;
|
|
99
88
|
export { propTypes };
|