@splunk/react-ui 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Badge.js +154 -0
- package/CHANGELOG.md +27 -0
- package/Code.js +1097 -500
- package/Color.js +142 -141
- package/ComboBox.js +6 -5
- package/Link.js +74 -44
- package/MIGRATION.md +32 -1
- package/Menu.js +41 -43
- package/Multiselect.js +596 -2143
- package/Number.js +3 -3
- package/PhoneNumber.d.ts +2 -0
- package/PhoneNumber.js +769 -0
- package/Popover.js +73 -75
- package/RadioList.js +166 -151
- package/ResultsMenu.js +27 -29
- package/Select.js +179 -1768
- package/SelectBase.d.ts +2 -0
- package/SelectBase.js +1681 -0
- package/Slider.js +202 -199
- package/SlidingPanels.js +55 -62
- package/Switch.js +42 -27
- package/TabBar.js +295 -294
- package/TabLayout.js +14 -14
- package/Table.js +1087 -1040
- package/TransitionOpen.js +82 -74
- package/docker-compose.yml +99 -52
- package/package.json +9 -5
- package/stubs-splunkui.d.ts +0 -86
- package/test-runner-jest.config.js +1 -0
- package/types/src/Badge/Badge.d.ts +29 -0
- package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
- package/types/src/Badge/docs/examples/Count.d.ts +6 -0
- package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
- package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
- package/types/src/Badge/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -3
- package/types/src/Code/index.d.ts +1 -0
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/LinkContext.d.ts +14 -0
- package/types/src/Link/docs/examples/Visited.d.ts +7 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
- package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/PhoneNumber/index.d.ts +2 -0
- package/types/src/PhoneNumber/utils.d.ts +47 -0
- package/types/src/RadioList/Option.d.ts +6 -1
- package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
- package/types/src/Select/Option.d.ts +8 -3
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
- package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
- package/types/src/SelectBase/index.d.ts +2 -0
- package/types/src/Switch/Switch.d.ts +3 -0
- package/types/src/Table/Body.d.ts +6 -1
- package/types/src/Table/Cell.d.ts +5 -1
- package/types/src/Table/Head.d.ts +6 -2
- package/types/src/Table/HeadCell.d.ts +5 -1
- package/types/src/Table/Row.d.ts +5 -1
- package/types/src/Table/Table.d.ts +20 -1
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
- package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
- package/usePrevious.d.ts +2 -0
- package/useResizeObserver.js +59 -92
- package/useRovingFocus.js +96 -41
- /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name Custom colors
|
|
4
|
+
* @description The background and text of Badge can be customized with the `backgroundColor` and `foregroundColor` props. Prefer using variables from `@splunk/themes`, but other valid CSS color values are supported.
|
|
5
|
+
*
|
|
6
|
+
* In all cases, you must check that the chosen colors meet [contrast minimum for text of 4.5:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html#user%20interface%20component).
|
|
7
|
+
*/
|
|
8
|
+
export default function CustomColors(): React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name With icon
|
|
4
|
+
* @description Use the `icon` prop with an icon component (e.g., `@splunk/react-icons`) to add visual context or emphasis alongside the badge's `label`. When using an icon, a label must also be provided.
|
|
5
|
+
*/
|
|
6
|
+
export default function Icon(): React.JSX.Element;
|
package/types/src/Code/Code.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
type CodeSupportedLanguages = 'bash' | 'clike' | '
|
|
4
|
+
type CodeSupportedLanguages = 'bash' | 'c' | 'clike' | 'cpp' | 'cs' | 'csharp' | 'css' | 'html' | 'javascript' | 'js' | 'json' | 'jsx' | 'markup' | 'mathml' | 'plain' | 'plaintext' | 'powershell' | 'py' | 'python' | 'sh' | 'shell' | 'splunk-spl' | 'sql' | 'svg' | 'text' | 'ts' | 'tsx' | 'txt' | 'typescript' | 'xml' | 'yaml' | 'yml';
|
|
5
5
|
interface CodePropsBase {
|
|
6
6
|
/** Change the style of the Code container. */
|
|
7
7
|
containerAppearance?: 'none' | 'section';
|
|
@@ -51,8 +51,8 @@ declare namespace Code {
|
|
|
51
51
|
containerAppearance: PropTypes.Requireable<string>;
|
|
52
52
|
elementRef: PropTypes.Requireable<object>;
|
|
53
53
|
indentChars: PropTypes.Requireable<number>;
|
|
54
|
-
language: PropTypes.Requireable<
|
|
55
|
-
languageFallback: PropTypes.Requireable<
|
|
54
|
+
language: PropTypes.Requireable<CodeSupportedLanguages>;
|
|
55
|
+
languageFallback: PropTypes.Requireable<CodeSupportedLanguages>;
|
|
56
56
|
lineHighlights: PropTypes.Requireable<string>;
|
|
57
57
|
lineNumberStart: PropTypes.Requireable<number>;
|
|
58
58
|
showIndentGuide: PropTypes.Requireable<boolean>;
|
|
@@ -61,3 +61,4 @@ declare namespace Code {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export default Code;
|
|
64
|
+
export type { CodeSupportedLanguages };
|
package/types/src/Link/Link.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ interface LinkPropsBase {
|
|
|
10
10
|
* Adds an aria-disabled attribute and prevents clicking.
|
|
11
11
|
*/
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
enableVisitedStyling?: boolean;
|
|
13
17
|
/**
|
|
14
18
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
15
19
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface LinkProviderProps {
|
|
3
|
+
enableVisitedStyling?: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
type LinkContextValue = {
|
|
7
|
+
enableVisitedStyling: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const LinkContext: React.Context<LinkContextValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Control behavior for all children Link components.
|
|
12
|
+
*/
|
|
13
|
+
declare const LinkProvider: ({ enableVisitedStyling, children, }: LinkProviderProps) => React.ReactElement;
|
|
14
|
+
export { LinkContext, LinkProvider, LinkContextValue, LinkProviderProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
|
|
4
|
-
import { SelectBaseProps } from '
|
|
4
|
+
import { SelectBaseProps } from '@splunk/react-ui/SelectBase';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
interface CompactPropsBase {
|
|
7
7
|
animateLoading?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Heading, Divider } from '@splunk/react-ui/Menu';
|
|
4
|
-
import { SelectBaseChangeReason } from '@splunk/react-ui/
|
|
4
|
+
import { SelectBaseChangeReason } from '@splunk/react-ui/SelectBase';
|
|
5
5
|
import { CompactPropsBase } from './Compact';
|
|
6
6
|
import Option from './Option';
|
|
7
7
|
import { ComponentProps } from '../utils/types';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
4
|
+
/** @public */
|
|
5
|
+
type PhoneNumberChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement | HTMLSpanElement>, data: {
|
|
6
|
+
name?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
displayValue: string;
|
|
9
|
+
country?: string;
|
|
10
|
+
isPossibleNumber: boolean;
|
|
11
|
+
isValidNumber: boolean;
|
|
12
|
+
internationalFormat: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
/** @public */
|
|
15
|
+
type PhoneNumberBlurHandler = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
16
|
+
name?: string;
|
|
17
|
+
value: string;
|
|
18
|
+
displayValue: string;
|
|
19
|
+
country?: string;
|
|
20
|
+
isPossibleNumber: boolean;
|
|
21
|
+
isValidNumber: boolean;
|
|
22
|
+
internationalFormat: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
/** @public */
|
|
25
|
+
type PhoneNumberFocusHandler = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
26
|
+
name?: string;
|
|
27
|
+
value: string;
|
|
28
|
+
displayValue: string;
|
|
29
|
+
country?: string;
|
|
30
|
+
isPossibleNumber: boolean;
|
|
31
|
+
isValidNumber: boolean;
|
|
32
|
+
internationalFormat: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
interface PhoneNumberPropsBase {
|
|
35
|
+
/** Append removes rounded corners and the border from the right side. */
|
|
36
|
+
append?: boolean;
|
|
37
|
+
/** Include an "X" button to clear the value. */
|
|
38
|
+
canClear?: boolean;
|
|
39
|
+
/** The iso2 country code to use for the phone number input. */
|
|
40
|
+
defaultCountry?: string;
|
|
41
|
+
/** Set this property instead of value to make the value uncontrolled. */
|
|
42
|
+
defaultValue?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The id of the description. When placed in a ControlGroup, this is automatically set to the
|
|
45
|
+
* ControlGroup's help component.
|
|
46
|
+
*/
|
|
47
|
+
describedBy?: string;
|
|
48
|
+
/** Determines whether or not the input is disabled. */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
52
|
+
*/
|
|
53
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
54
|
+
/** Highlight the field as having an error. */
|
|
55
|
+
error?: boolean;
|
|
56
|
+
/** When true, displays inline with a default width. */
|
|
57
|
+
inline?: boolean;
|
|
58
|
+
/** An id for the text input. */
|
|
59
|
+
inputId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A React ref which is set to the text input element when the component mounts, and null when it unmounts.
|
|
62
|
+
*/
|
|
63
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
64
|
+
/**
|
|
65
|
+
* The id of the label. When placed in a ControlGroup, this is automatically set to the
|
|
66
|
+
* ControlGroup's label.
|
|
67
|
+
*/
|
|
68
|
+
labelledBy?: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
/** A callback for when the input loses focus. */
|
|
71
|
+
onBlur?: PhoneNumberBlurHandler;
|
|
72
|
+
/**
|
|
73
|
+
* Called whenever the value changes.
|
|
74
|
+
* If the value prop is set, this callback is required.
|
|
75
|
+
*/
|
|
76
|
+
onChange?: PhoneNumberChangeHandler;
|
|
77
|
+
/** A callback for when the input is clicked. */
|
|
78
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
79
|
+
/** A callback for when the input takes focus. */
|
|
80
|
+
onFocus?: PhoneNumberFocusHandler;
|
|
81
|
+
/** A callback for when the user selects text. */
|
|
82
|
+
onSelect?: React.ReactEventHandler<HTMLInputElement>;
|
|
83
|
+
/** Prepend removes rounded borders from the left side. */
|
|
84
|
+
prepend?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @private
|
|
87
|
+
* Do not format the number as the user types.
|
|
88
|
+
*/
|
|
89
|
+
skipFormatting?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* A React ref which is set to the dropdown toggle when the component mounts and null when it unmounts.
|
|
92
|
+
*/
|
|
93
|
+
toggleRef?: React.Ref<HTMLButtonElement>;
|
|
94
|
+
/**
|
|
95
|
+
* The contents of the input. Setting this value makes the input controlled. A callback is required.
|
|
96
|
+
*/
|
|
97
|
+
value?: string;
|
|
98
|
+
}
|
|
99
|
+
interface PhoneNumberPropsBaseControlled extends PhoneNumberPropsBase {
|
|
100
|
+
defaultValue?: never;
|
|
101
|
+
onChange: PhoneNumberChangeHandler;
|
|
102
|
+
value?: string;
|
|
103
|
+
}
|
|
104
|
+
interface PhoneNumberPropsBaseUncontrolled extends PhoneNumberPropsBase {
|
|
105
|
+
defaultValue?: string;
|
|
106
|
+
value?: never;
|
|
107
|
+
}
|
|
108
|
+
type PhoneNumberProps = ComponentProps<PhoneNumberPropsBaseControlled | PhoneNumberPropsBaseUncontrolled, 'div'>;
|
|
109
|
+
declare function PhoneNumber({ append, canClear, defaultCountry, defaultValue, describedBy, disabled, elementRef, error, inline, inputRef, name, onBlur, onChange, onFocus, prepend, skipFormatting, toggleRef, value, ...otherProps }: PhoneNumberProps): React.JSX.Element;
|
|
110
|
+
declare namespace PhoneNumber {
|
|
111
|
+
var componentType: string;
|
|
112
|
+
var propTypes: {
|
|
113
|
+
append: PropTypes.Requireable<boolean>;
|
|
114
|
+
canClear: PropTypes.Requireable<boolean>;
|
|
115
|
+
defaultCountry: PropTypes.Requireable<string>;
|
|
116
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
117
|
+
describedBy: PropTypes.Requireable<string>;
|
|
118
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
119
|
+
elementRef: PropTypes.Requireable<object>;
|
|
120
|
+
error: PropTypes.Requireable<boolean>;
|
|
121
|
+
inline: PropTypes.Requireable<boolean>;
|
|
122
|
+
inputId: PropTypes.Requireable<string>;
|
|
123
|
+
inputRef: PropTypes.Requireable<object>;
|
|
124
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
125
|
+
name: PropTypes.Requireable<string>;
|
|
126
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
127
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
128
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
129
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
130
|
+
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
131
|
+
prepend: PropTypes.Requireable<boolean>;
|
|
132
|
+
/** @private */
|
|
133
|
+
skipFormatting: PropTypes.Requireable<boolean>;
|
|
134
|
+
value: PropTypes.Requireable<string>;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export default PhoneNumber;
|
|
138
|
+
export { PhoneNumberBlurHandler, PhoneNumberChangeHandler, PhoneNumberFocusHandler };
|
|
139
|
+
export type { PhoneNumberProps, PhoneNumberPropsBase, PhoneNumberPropsBaseControlled, PhoneNumberPropsBaseUncontrolled, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name Uncontrolled
|
|
4
|
+
* @description Alternatively, Phone Number can be uncontrolled and optionally provided a `defaultValue`. The `onChange` callback still fires. The `value` prop cannot be set or updated externally.
|
|
5
|
+
*/
|
|
6
|
+
declare function Uncontrolled(): React.JSX.Element;
|
|
7
|
+
export default Uncontrolled;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type IntlTelInputUtils = typeof import('intl-tel-input/intlTelInputWithUtils').default.utils;
|
|
2
|
+
type CountryData = {
|
|
3
|
+
areaCodes: string[] | null;
|
|
4
|
+
countryName: string;
|
|
5
|
+
dialCode: string;
|
|
6
|
+
flag: string;
|
|
7
|
+
iso2: string;
|
|
8
|
+
iso2Upper: string;
|
|
9
|
+
nationalPrefix: string | null;
|
|
10
|
+
priority?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const PHONE_NUMBER_INVALID_CHAR_REGEX: RegExp;
|
|
13
|
+
declare const UNKNOWN_FLAG = "\uD83C\uDF10";
|
|
14
|
+
declare const loadUtils: () => Promise<{
|
|
15
|
+
formatNumber(number: string, iso2: string | undefined, format?: number): string;
|
|
16
|
+
formatNumberAsYouType(number: string, iso2: string | undefined): string;
|
|
17
|
+
getCoreNumber(number: string, iso2: string | undefined): string;
|
|
18
|
+
getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: number, useE164?: boolean): string;
|
|
19
|
+
getExtension(number: string, iso2: string | undefined): string;
|
|
20
|
+
getNumberType(number: string, iso2: string | undefined): number;
|
|
21
|
+
getValidationError(number: string, iso2: string | undefined): number;
|
|
22
|
+
isPossibleNumber(number: string, iso2: string | undefined, numberType?: ("FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP")[] | null): boolean;
|
|
23
|
+
isValidNumber(number: string, iso2: string | undefined, numberType?: ("FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP")[] | null): boolean;
|
|
24
|
+
numberFormat: {
|
|
25
|
+
NATIONAL: number;
|
|
26
|
+
INTERNATIONAL: number;
|
|
27
|
+
E164: number;
|
|
28
|
+
RFC3966: number;
|
|
29
|
+
};
|
|
30
|
+
numberType: object;
|
|
31
|
+
} | null | undefined>;
|
|
32
|
+
declare const getCountryFlag: (countryCode: string) => string;
|
|
33
|
+
declare const getCountries: () => CountryData[];
|
|
34
|
+
/**
|
|
35
|
+
* Main function to process phone input using intl-tel-input utilities
|
|
36
|
+
*/
|
|
37
|
+
declare const processPhoneInput: (utils: IntlTelInputUtils | null, inputValue: string, country?: string, countries?: CountryData[]) => {
|
|
38
|
+
displayValue: string;
|
|
39
|
+
value: string;
|
|
40
|
+
internationalFormat: string;
|
|
41
|
+
country: string;
|
|
42
|
+
isPossibleNumber: boolean;
|
|
43
|
+
isValidNumber: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare const replaceDialCode: (inputValue: string, previousCountry: string, newCountry: string, countries: CountryData[]) => string;
|
|
46
|
+
export { getCountries, getCountryFlag, loadUtils, processPhoneInput, replaceDialCode, PHONE_NUMBER_INVALID_CHAR_REGEX, UNKNOWN_FLAG, };
|
|
47
|
+
export type { IntlTelInputUtils };
|
|
@@ -4,6 +4,10 @@ import { RadioListChangeHandler, RadioListValueTypes } from '@splunk/react-ui/Ra
|
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface OptionPropsBase {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Additional information to explain the option.
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
7
11
|
disabled?: boolean;
|
|
8
12
|
error?: boolean;
|
|
9
13
|
id?: string;
|
|
@@ -14,10 +18,11 @@ interface OptionPropsBase {
|
|
|
14
18
|
value: RadioListValueTypes;
|
|
15
19
|
}
|
|
16
20
|
type OptionProps = ComponentProps<OptionPropsBase, 'div'>;
|
|
17
|
-
declare function Option({ children, disabled: disabledProp, error: errorProp, id: idProp, onChange, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
21
|
+
declare function Option({ children, description, disabled: disabledProp, error: errorProp, id: idProp, onChange, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
18
22
|
declare namespace Option {
|
|
19
23
|
var propTypes: {
|
|
20
24
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
|
+
description: PropTypes.Requireable<string>;
|
|
21
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
22
27
|
error: PropTypes.Requireable<boolean>;
|
|
23
28
|
id: PropTypes.Requireable<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { OptionClickHandler as OptionBaseClickHandler } from '@splunk/react-ui/SelectBase';
|
|
2
3
|
import { ComponentProps } from '../utils/types';
|
|
3
|
-
import type { OptionClickHandler } from './OptionBase';
|
|
4
4
|
interface OptionPropsBase {
|
|
5
5
|
/** @private */
|
|
6
6
|
active?: boolean;
|
|
@@ -26,6 +26,11 @@ interface OptionPropsBase {
|
|
|
26
26
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
27
27
|
*/
|
|
28
28
|
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
29
|
+
/**
|
|
30
|
+
* Allow the endAdornment to be passed to the underlying Menu.Item.
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
endAdornment?: React.ReactNode;
|
|
29
34
|
/**
|
|
30
35
|
* Adding hidden options can be useful for resolving the selected display label and icon,
|
|
31
36
|
* when the option should not be in the list. This scenario can arise when Select's filter is
|
|
@@ -55,7 +60,7 @@ interface OptionPropsBase {
|
|
|
55
60
|
end: number;
|
|
56
61
|
}[];
|
|
57
62
|
/** @private */
|
|
58
|
-
onClick?:
|
|
63
|
+
onClick?: OptionBaseClickHandler;
|
|
59
64
|
/** @private */
|
|
60
65
|
role?: 'menuitemcheckbox' | 'option';
|
|
61
66
|
/** @private */
|
|
@@ -76,4 +81,4 @@ type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
|
76
81
|
declare function Option({ children, descriptionPosition, elementRef, label, ...otherProps }: OptionProps): React.JSX.Element;
|
|
77
82
|
declare const OptionMemoized: React.MemoExoticComponent<typeof Option>;
|
|
78
83
|
export default OptionMemoized;
|
|
79
|
-
export type {
|
|
84
|
+
export type { OptionBaseClickHandler, OptionPropsBase };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Divider as BaseDivider, Heading as BaseHeading, SelectBaseProps } from '@splunk/react-ui/SelectBase';
|
|
3
4
|
import Option from './Option';
|
|
4
|
-
import { Divider as BaseDivider, Heading as BaseHeading, SelectBaseProps } from './SelectBase';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
/** @public */
|
|
7
7
|
type SelectChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>, data: {
|
|
@@ -30,6 +30,11 @@ interface OptionPropsBase {
|
|
|
30
30
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
31
31
|
*/
|
|
32
32
|
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
33
|
+
/**
|
|
34
|
+
* Allow the endAdornment to be passed to the underlying Menu.Item.
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
endAdornment?: React.ReactNode;
|
|
33
38
|
/**
|
|
34
39
|
* Adding hidden options can be useful for resolving the selected display label and icon,
|
|
35
40
|
* when the option should not be in the list. This scenario can arise when Select's filter is
|
|
@@ -81,7 +86,7 @@ type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
|
81
86
|
/**
|
|
82
87
|
* An option within a `Multiselect`.
|
|
83
88
|
*/
|
|
84
|
-
declare function Option({ children, descriptionPosition, disabled, elementRef, icon, label, multiple, onClick, role, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
89
|
+
declare function Option({ children, descriptionPosition, disabled, elementRef, endAdornment, icon, label, multiple, onClick, role, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
85
90
|
declare namespace Option {
|
|
86
91
|
var propTypes: {
|
|
87
92
|
/** @private */
|
|
@@ -91,6 +96,7 @@ declare namespace Option {
|
|
|
91
96
|
descriptionPosition: PropTypes.Requireable<string>;
|
|
92
97
|
disabled: PropTypes.Requireable<boolean>;
|
|
93
98
|
elementRef: PropTypes.Requireable<object>;
|
|
99
|
+
endAdornment: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
94
100
|
hidden: PropTypes.Requireable<boolean>;
|
|
95
101
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
96
102
|
label: PropTypes.Validator<string>;
|
|
@@ -114,4 +120,4 @@ declare namespace Option {
|
|
|
114
120
|
var type: typeof Item;
|
|
115
121
|
}
|
|
116
122
|
export default Option;
|
|
117
|
-
export { OptionClickHandler };
|
|
123
|
+
export type { OptionClickHandler };
|
|
@@ -3,7 +3,9 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Divider, Heading } from '@splunk/react-ui/Menu';
|
|
4
4
|
import { TextBlurHandler, TextChangeHandler, TextFocusHandler } from '@splunk/react-ui/Text';
|
|
5
5
|
import Option from './OptionBase';
|
|
6
|
+
import SelectAllOption from './SelectAllOption';
|
|
6
7
|
import { ComponentProps } from '../utils/types';
|
|
8
|
+
import type { OptionClickHandler } from './OptionBase';
|
|
7
9
|
type SelectBaseFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent, data: {
|
|
8
10
|
keyword: string;
|
|
9
11
|
}) => void;
|
|
@@ -286,4 +288,4 @@ declare namespace SelectBase {
|
|
|
286
288
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
287
289
|
}
|
|
288
290
|
export default SelectBase;
|
|
289
|
-
export { Controls, ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
|
|
291
|
+
export { Controls, ChildrenElement, Divider, Heading, Option, SelectAllOption, OptionClickHandler, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
|
|
@@ -57,10 +57,12 @@ interface SwitchPropsBase {
|
|
|
57
57
|
*/
|
|
58
58
|
selected?: boolean | 'some';
|
|
59
59
|
/**
|
|
60
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
60
61
|
* The customized content presented to screen readers when selected.
|
|
61
62
|
*/
|
|
62
63
|
selectedLabel?: string;
|
|
63
64
|
/**
|
|
65
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
64
66
|
* The customized content presented to screen readers when selected="some".
|
|
65
67
|
*/
|
|
66
68
|
someSelectedLabel?: string;
|
|
@@ -69,6 +71,7 @@ interface SwitchPropsBase {
|
|
|
69
71
|
*/
|
|
70
72
|
toggleRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>;
|
|
71
73
|
/**
|
|
74
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
72
75
|
* The customized content presented to screen readers when unselected.
|
|
73
76
|
*/
|
|
74
77
|
unselectedLabel?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { PinnedColumnsProp } from '@splunk/react-ui/Table';
|
|
3
4
|
import { RowRequestMoveRowHandler } from './Row';
|
|
4
5
|
import { ComponentProps } from '../utils/types';
|
|
5
6
|
type BodyRequestMoveRowHandler = RowRequestMoveRowHandler;
|
|
@@ -20,13 +21,15 @@ interface BodyPropsBase {
|
|
|
20
21
|
rowExpansion?: 'single' | 'multi' | 'none' | 'controlled';
|
|
21
22
|
/** @private. Generally passed by Table rather than added directly. */
|
|
22
23
|
onRequestMoveRow?: BodyRequestMoveRowHandler;
|
|
24
|
+
/** @private. */
|
|
25
|
+
pinnedColumns?: PinnedColumnsProp;
|
|
23
26
|
/** Indicates the column to use as the primary label for each row. */
|
|
24
27
|
primaryColumnIndex?: number;
|
|
25
28
|
/** @private. Generally passed by Table rather than added directly. */
|
|
26
29
|
stripeRows?: boolean;
|
|
27
30
|
}
|
|
28
31
|
type BodyProps = ComponentProps<BodyPropsBase, 'tbody'>;
|
|
29
|
-
declare function Body({ actions, children, elementRef, movableColumns, onRequestMoveRow, rowExpansion, primaryColumnIndex, stripeRows, ...otherProps }: BodyProps): React.JSX.Element | null;
|
|
32
|
+
declare function Body({ actions, children, elementRef, pinnedColumns, movableColumns, onRequestMoveRow, rowExpansion, primaryColumnIndex, stripeRows, ...otherProps }: BodyProps): React.JSX.Element | null;
|
|
30
33
|
declare namespace Body {
|
|
31
34
|
var propTypes: {
|
|
32
35
|
/** @private. Generally passed by Table rather than added directly. */
|
|
@@ -39,6 +42,8 @@ declare namespace Body {
|
|
|
39
42
|
rowExpansion: PropTypes.Requireable<string>;
|
|
40
43
|
/** @private. Generally passed by Table rather than added directly. */
|
|
41
44
|
onRequestMoveRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
/** @private. */
|
|
46
|
+
pinnedColumns: PropTypes.Requireable<object>;
|
|
42
47
|
/** @private. Generally passed by Table rather than added directly. */
|
|
43
48
|
primaryColumnIndex: PropTypes.Requireable<number>;
|
|
44
49
|
/** @private. Generally passed by Table rather than added directly. */
|
|
@@ -24,6 +24,8 @@ interface CellPropsBase {
|
|
|
24
24
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
25
25
|
*/
|
|
26
26
|
elementRef?: React.Ref<HTMLTableCellElement>;
|
|
27
|
+
/** @private. */
|
|
28
|
+
isPinned?: boolean;
|
|
27
29
|
/**
|
|
28
30
|
* @private
|
|
29
31
|
* Used to style the primary cell when row is clickable
|
|
@@ -44,7 +46,7 @@ interface CellPropsBase {
|
|
|
44
46
|
variant?: 'toggle' | 'expand' | 'drag' | 'actions';
|
|
45
47
|
}
|
|
46
48
|
type CellProps = ComponentProps<CellPropsBase, 'td'>;
|
|
47
|
-
declare function Cell({ align, appearance, appearClickable, children, data, disabled, elementRef, isPrimaryCell, onClick, onKeyDown, stripe, variant, ...otherProps }: CellProps): React.JSX.Element;
|
|
49
|
+
declare function Cell({ align, appearance, appearClickable, children, data, disabled, elementRef, isPinned, isPrimaryCell, onClick, onKeyDown, stripe, variant, ...otherProps }: CellProps): React.JSX.Element;
|
|
48
50
|
declare namespace Cell {
|
|
49
51
|
var propTypes: {
|
|
50
52
|
align: PropTypes.Requireable<string>;
|
|
@@ -57,6 +59,8 @@ declare namespace Cell {
|
|
|
57
59
|
elementRef: PropTypes.Requireable<object>;
|
|
58
60
|
/** @private */
|
|
59
61
|
isPrimaryCell: PropTypes.Requireable<boolean>;
|
|
62
|
+
/** @private */
|
|
63
|
+
isPinned: PropTypes.Requireable<boolean>;
|
|
60
64
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
61
65
|
/** @private */
|
|
62
66
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TableRequestMoveColumnHandler } from '@splunk/react-ui/Table';
|
|
3
|
+
import { PinnedColumnsProp, 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;
|
|
@@ -42,11 +42,13 @@ interface HeadPropsBase {
|
|
|
42
42
|
/** @private. */
|
|
43
43
|
onRequestToggleAllRows?: () => void;
|
|
44
44
|
/** @private. */
|
|
45
|
+
pinnedColumns?: PinnedColumnsProp;
|
|
46
|
+
/** @private. */
|
|
45
47
|
rowSelection?: 'all' | 'some' | 'none';
|
|
46
48
|
}
|
|
47
49
|
type HeadProps = ComponentProps<HeadPropsBase, 'thead'>;
|
|
48
50
|
declare const getCellWidths: (headEl: HTMLTableSectionElement | null) => number[];
|
|
49
|
-
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
|
|
51
|
+
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, pinnedColumns, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
|
|
50
52
|
declare namespace Head {
|
|
51
53
|
var propTypes: {
|
|
52
54
|
/** @private. */
|
|
@@ -70,6 +72,8 @@ declare namespace Head {
|
|
|
70
72
|
/** @private. */
|
|
71
73
|
onRequestToggleAllRows: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
74
|
/** @private. */
|
|
75
|
+
pinnedColumns: PropTypes.Requireable<object>;
|
|
76
|
+
/** @private. */
|
|
73
77
|
rowSelection: PropTypes.Requireable<string>;
|
|
74
78
|
};
|
|
75
79
|
var splunkUiType: string;
|
|
@@ -46,6 +46,8 @@ interface HeadCellPropsBase {
|
|
|
46
46
|
/** @private The index of the cell, skipping the info column. */
|
|
47
47
|
index?: number;
|
|
48
48
|
/** @private. */
|
|
49
|
+
isPinned?: boolean;
|
|
50
|
+
/** @private. */
|
|
49
51
|
onAutosizeColumn?: HeadCellAutosizeColumnHandler;
|
|
50
52
|
/**
|
|
51
53
|
* A callback invoked when this head cell is clicked. If provided, this HeadCell is
|
|
@@ -97,7 +99,7 @@ interface HeadCellPropsBase {
|
|
|
97
99
|
variant?: 'toggleAll' | 'info' | 'actions';
|
|
98
100
|
}
|
|
99
101
|
type HeadCellProps = ComponentProps<HeadCellPropsBase, 'th'>;
|
|
100
|
-
declare function HeadCell({ align, appearClickable, children, columnId, elementRef, dragId, headCellScreenReaderText, id, index, onAutosizeColumn, onClick, onKeyDown, onRequestMoveColumn, onRequestResize, onSort, resizable, sortDir, sortKey, style, tooltip, truncate: truncateProp, variant, visible, width, ...otherProps }: HeadCellProps): React.JSX.Element;
|
|
102
|
+
declare function HeadCell({ align, appearClickable, children, columnId, elementRef, dragId, headCellScreenReaderText, id, index, isPinned, onAutosizeColumn, onClick, onKeyDown, onRequestMoveColumn, onRequestResize, onSort, resizable, sortDir, sortKey, style, tooltip, truncate: truncateProp, variant, visible, width, ...otherProps }: HeadCellProps): React.JSX.Element;
|
|
101
103
|
declare namespace HeadCell {
|
|
102
104
|
var propTypes: {
|
|
103
105
|
align: PropTypes.Requireable<string>;
|
|
@@ -112,6 +114,8 @@ declare namespace HeadCell {
|
|
|
112
114
|
/** @private The index of the cell, skipping the info column. */
|
|
113
115
|
index: PropTypes.Requireable<number>;
|
|
114
116
|
/** @private. */
|
|
117
|
+
isPinned: PropTypes.Requireable<boolean>;
|
|
118
|
+
/** @private. */
|
|
115
119
|
onAutosizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
|
|
116
120
|
/** @private. */
|
|
117
121
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|