@splunk/react-ui 4.1.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/Accordion.js +4 -4
  2. package/Anchor.js +2 -2
  3. package/Animation.js +26 -35
  4. package/AnimationToggle.js +2 -2
  5. package/Box.js +2 -2
  6. package/Button.js +22 -22
  7. package/ButtonGroup.js +2 -2
  8. package/ButtonSimple.js +12 -6
  9. package/CHANGELOG.md +69 -2
  10. package/Calendar.js +23 -23
  11. package/Card.js +15 -15
  12. package/CardLayout.js +2 -2
  13. package/Chip.js +13 -13
  14. package/Clickable.js +4 -4
  15. package/CloseButton.js +8 -8
  16. package/Code.js +1279 -1120
  17. package/CollapsiblePanel.js +11 -11
  18. package/Color.js +111 -172
  19. package/ColumnLayout.js +6 -6
  20. package/ComboBox.js +63 -30
  21. package/Concertina.js +2 -2
  22. package/ControlGroup.js +61 -20
  23. package/Date.js +66 -29
  24. package/DefinitionList.js +2 -2
  25. package/Dropdown.js +6 -6
  26. package/FetchOptions.js +8 -8
  27. package/File.js +87 -72
  28. package/FormRows.js +219 -331
  29. package/Heading.js +2 -2
  30. package/Image.js +15 -15
  31. package/JSONTree.js +63 -20
  32. package/Layer.js +8 -8
  33. package/Link.js +13 -13
  34. package/List.js +2 -2
  35. package/Markdown.js +19 -19
  36. package/Menu.js +315 -230
  37. package/Message.js +19 -19
  38. package/Modal.js +22 -11
  39. package/ModalLayer.js +25 -11
  40. package/Monogram.js +7 -7
  41. package/Multiselect.js +1931 -1057
  42. package/Number.js +40 -27
  43. package/Paginator.js +67 -49
  44. package/Paragraph.js +2 -2
  45. package/Popover.js +62 -35
  46. package/Progress.js +9 -21
  47. package/RadioBar.js +6 -6
  48. package/RadioList.js +2 -2
  49. package/ResultsMenu.js +18 -10
  50. package/ScreenReaderContent.js +2 -2
  51. package/Scroll.js +37 -19
  52. package/ScrollContainerContext.js +2 -2
  53. package/Select.js +1309 -562
  54. package/SidePanel.js +22 -17
  55. package/Slider.js +8 -8
  56. package/SlidingPanels.js +63 -47
  57. package/StaticContent.js +2 -2
  58. package/StepBar.js +8 -8
  59. package/Switch.js +20 -11
  60. package/TabBar.js +54 -40
  61. package/TabLayout.js +4 -4
  62. package/Table.js +148 -85
  63. package/Text.js +474 -356
  64. package/Tooltip.js +6 -6
  65. package/TransitionOpen.js +26 -24
  66. package/WaitSpinner.js +4 -4
  67. package/package.json +8 -7
  68. package/stubs-splunkui.d.ts +1 -0
  69. package/types/src/Accordion/Accordion.d.ts +2 -2
  70. package/types/src/Animation/Animation.d.ts +6 -5
  71. package/types/src/Button/Button.d.ts +2 -2
  72. package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
  73. package/types/src/Calendar/DateTable.d.ts +1 -0
  74. package/types/src/Calendar/MonthHeader.d.ts +2 -2
  75. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -2
  76. package/types/src/Color/Color.d.ts +5 -4
  77. package/types/src/Color/Swatch.d.ts +4 -15
  78. package/types/src/ComboBox/ComboBox.d.ts +2 -2
  79. package/types/src/ControlGroup/ControlGroup.d.ts +7 -2
  80. package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
  81. package/types/src/Date/Date.d.ts +7 -5
  82. package/types/src/Date/Icon.d.ts +1 -0
  83. package/types/src/Dropdown/Dropdown.d.ts +1 -1
  84. package/types/src/File/File.d.ts +2 -2
  85. package/types/src/File/FileContext.d.ts +9 -0
  86. package/types/src/File/Icon.d.ts +1 -0
  87. package/types/src/File/IconCloud.d.ts +1 -0
  88. package/types/src/File/Item.d.ts +5 -10
  89. package/types/src/File/PaperClip.d.ts +1 -0
  90. package/types/src/File/Retry.d.ts +1 -0
  91. package/types/src/File/Trash.d.ts +1 -0
  92. package/types/src/FormRows/FormRows.d.ts +11 -69
  93. package/types/src/FormRows/FormRowsContext.d.ts +9 -0
  94. package/types/src/FormRows/Row.d.ts +7 -20
  95. package/types/src/JSONTree/JSONTree.d.ts +14 -2
  96. package/types/src/JSONTree/TreeNode.d.ts +4 -1
  97. package/types/src/Menu/Divider.d.ts +1 -0
  98. package/types/src/Menu/Heading.d.ts +3 -1
  99. package/types/src/Menu/Item.d.ts +22 -6
  100. package/types/src/Menu/Menu.d.ts +17 -18
  101. package/types/src/Menu/MenuContext.d.ts +6 -0
  102. package/types/src/Menu/index.d.ts +1 -0
  103. package/types/src/Multiselect/Compact.d.ts +7 -26
  104. package/types/src/Multiselect/Multiselect.d.ts +7 -2
  105. package/types/src/Multiselect/Normal.d.ts +8 -2
  106. package/types/src/Multiselect/Option.d.ts +4 -1
  107. package/types/src/Number/IncrementIcon.d.ts +1 -0
  108. package/types/src/Number/Number.d.ts +4 -4
  109. package/types/src/Paginator/PageSeparator.d.ts +3 -0
  110. package/types/src/Popover/Popover.d.ts +5 -5
  111. package/types/src/Popover/PopoverContext.d.ts +6 -0
  112. package/types/src/Popover/index.d.ts +1 -0
  113. package/types/src/RadioBar/RadioBar.d.ts +5 -5
  114. package/types/src/RadioList/RadioListContext.d.ts +1 -0
  115. package/types/src/ResultsMenu/ResultsMenu.d.ts +4 -0
  116. package/types/src/Scroll/Inner.d.ts +4 -3
  117. package/types/src/Scroll/Scroll.d.ts +1 -1
  118. package/types/src/Select/Option.d.ts +2 -5
  119. package/types/src/Select/OptionBase.d.ts +94 -0
  120. package/types/src/Select/Select.d.ts +12 -37
  121. package/types/src/Select/SelectBase.d.ts +221 -0
  122. package/types/src/SidePanel/SidePanel.d.ts +4 -0
  123. package/types/src/Slider/Slider.d.ts +4 -4
  124. package/types/src/SlidingPanels/SlidingPanels.d.ts +0 -1
  125. package/types/src/Switch/CheckIcon.d.ts +1 -0
  126. package/types/src/Switch/Switch.d.ts +3 -7
  127. package/types/src/TabBar/Tab.d.ts +4 -1
  128. package/types/src/TabLayout/TabLayout.d.ts +2 -2
  129. package/types/src/Table/DragHandle.d.ts +1 -0
  130. package/types/src/Table/Head.d.ts +2 -0
  131. package/types/src/Table/HeadCell.d.ts +2 -2
  132. package/types/src/Table/HeadDropdownCell.d.ts +1 -1
  133. package/types/src/Table/HeadExpandRowsIcon.d.ts +1 -0
  134. package/types/src/Table/HeadInner.d.ts +3 -3
  135. package/types/src/Table/Table.d.ts +7 -3
  136. package/types/src/Table/Toggle.d.ts +1 -0
  137. package/types/src/Text/IconOutlinedHide.d.ts +1 -0
  138. package/types/src/Text/IconOutlinedView.d.ts +1 -0
  139. package/types/src/Text/Text.d.ts +28 -12
  140. package/types/src/Tooltip/InfoIcon.d.ts +1 -0
  141. package/types/src/Tooltip/Tooltip.d.ts +3 -3
  142. package/types/src/icons/Alert.d.ts +1 -0
  143. package/types/src/icons/AlertFilled.d.ts +1 -0
  144. package/types/src/icons/CaretDown.d.ts +1 -0
  145. package/types/src/icons/CaretRight.d.ts +1 -0
  146. package/types/src/icons/Check.d.ts +1 -0
  147. package/types/src/icons/ChevronDown.d.ts +1 -0
  148. package/types/src/icons/ChevronLeft.d.ts +1 -0
  149. package/types/src/icons/ChevronRight.d.ts +1 -0
  150. package/types/src/icons/CrossMark.d.ts +1 -0
  151. package/types/src/icons/External.d.ts +1 -0
  152. package/types/src/icons/InfoFilled.d.ts +1 -0
  153. package/types/src/icons/More.d.ts +1 -0
  154. package/types/src/icons/MoreVertical.d.ts +1 -0
  155. package/types/src/icons/Plus.d.ts +1 -0
  156. package/types/src/icons/SVG.d.ts +1 -0
  157. package/types/src/icons/Search.d.ts +1 -0
  158. package/types/src/icons/SortedDown.d.ts +1 -0
  159. package/types/src/icons/SortedUp.d.ts +1 -0
  160. package/types/src/icons/Success.d.ts +1 -0
  161. package/types/src/icons/SuccessFilled.d.ts +1 -0
  162. package/types/src/icons/WarningFilled.d.ts +1 -0
  163. package/types/src/utils/types.d.ts +1 -0
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
2
3
  export interface RadioListContext {
3
4
  value?: RadioListValueTypes;
@@ -4,6 +4,10 @@ declare type ResultsMenuScrollBottomHandler = (event?: React.UIEvent<HTMLDivElem
4
4
  interface ResultsMenuPropsBase {
5
5
  animateLoading?: boolean;
6
6
  children?: React.ReactNode;
7
+ /**
8
+ * @private If set, the menu will never take focus and the active menu item will not have a focus-like appearance.
9
+ */
10
+ controlledExternally?: boolean;
7
11
  childrenStart?: React.ReactNode;
8
12
  /**
9
13
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
@@ -1,4 +1,5 @@
1
1
  import React, { Component } from 'react';
2
+ import { SpringValue } from 'react-spring';
2
3
  import { ClassComponentProps } from '../utils/types';
3
4
  interface InnerPropsBase {
4
5
  children?: React.ReactNode;
@@ -8,14 +9,14 @@ interface InnerPropsBase {
8
9
  defaultTop?: number;
9
10
  elementRef?: React.Ref<Element>;
10
11
  /** If set, scroll to this position on update. If null, ignore. */
11
- left?: number;
12
+ left?: SpringValue<number>;
12
13
  /** Prevent mouseWheel events from scrolling the page or other containers. */
13
14
  stopScrollPropagation?: boolean | 'window';
14
15
  /** A callback for when the scroll position changes. */
15
16
  onScroll?: React.UIEventHandler<Element>;
16
- tagName?: string;
17
+ tagName?: keyof JSX.IntrinsicElements;
17
18
  /** If set, scroll to this position on update. If null, ignore. */
18
- top?: number;
19
+ top?: SpringValue<number>;
19
20
  }
20
21
  declare const defaultProps: Required<Pick<InnerPropsBase, 'defaultLeft' | 'defaultTop' | 'tagName'>>;
21
22
  declare type InnerProps = ClassComponentProps<InnerPropsBase, typeof defaultProps, keyof JSX.IntrinsicElements>;
@@ -21,7 +21,7 @@ interface ScrollPropsBase {
21
21
  * stops the window from scrolling by removing the scroll bars, which has better performance
22
22
  * but can affect layout. */
23
23
  stopScrollPropagation?: boolean | 'window';
24
- tagName?: string;
24
+ tagName?: keyof JSX.IntrinsicElements;
25
25
  }
26
26
  declare const defaultProps: Required<Pick<ScrollPropsBase, 'stopScrollPropagation' | 'tagName'>>;
27
27
  declare type ScrollProps = ClassComponentProps<ScrollPropsBase, typeof defaultProps, keyof JSX.IntrinsicElements>;
@@ -1,8 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { ClassComponentProps } from '../utils/types';
3
- declare type OptionClickHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
4
- value: string | number | boolean;
5
- }) => void;
3
+ import type { OptionClickHandler } from './OptionBase';
6
4
  interface OptionPropsBase {
7
5
  /** @private */
8
6
  active?: boolean;
@@ -77,7 +75,6 @@ declare class Option extends PureComponent<OptionProps, {}> {
77
75
  private c;
78
76
  static propTypes: React.WeakValidationMap<ClassComponentProps<OptionPropsBase, Required<Pick<OptionPropsBase, "hidden" | "disabled" | "selected" | "active" | "descriptionPosition" | "truncate">>, "button", never>>;
79
77
  static defaultProps: Required<Pick<OptionPropsBase, "hidden" | "disabled" | "selected" | "active" | "descriptionPosition" | "truncate">>;
80
- private handleClick;
81
78
  private handleMount;
82
79
  scrollIntoViewIfNeeded(): void;
83
80
  /**
@@ -87,4 +84,4 @@ declare class Option extends PureComponent<OptionProps, {}> {
87
84
  render(): JSX.Element;
88
85
  }
89
86
  export default Option;
90
- export { OptionClickHandler };
87
+ export type { OptionClickHandler };
@@ -0,0 +1,94 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { ClassComponentProps } from '../utils/types';
3
+ declare type OptionClickHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
4
+ value: string | number | boolean;
5
+ }) => void;
6
+ interface OptionPropsBase {
7
+ /** @private */
8
+ active?: boolean;
9
+ /**
10
+ * When provided, `children` is rendered instead of the `label`.
11
+ *
12
+ * Caution: The element(s) passed here must be pure.
13
+ */
14
+ children?: React.ReactNode;
15
+ /**
16
+ * Additional information to explain the option, such as "Recommended".
17
+ */
18
+ description?: string;
19
+ /**
20
+ * The description text may appear to the right of the label or under the label.
21
+ * @themeNotes Themes that don't support 'right' fall back to 'bottom'.
22
+ */
23
+ descriptionPosition?: 'right' | 'bottom';
24
+ /**
25
+ * If disabled=true, the option is grayed out and cannot be clicked.
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Adding hidden options can be useful for resolving the selected display label and icon,
30
+ * when the option should not be in the list. This scenario can arise when Select's filter is
31
+ * controlled, because the selected item may be filtered out; and when a legacy option is
32
+ * valid, but should no longer be displayed as a selectable option.
33
+ */
34
+ hidden?: boolean;
35
+ /**
36
+ * The icon to show before the label. See the @splunk/react-icons package for
37
+ * drop in icons.
38
+ *
39
+ * Caution: The element(s) passed here must be pure. All icons in the react-icons package are pure.
40
+ */
41
+ icon?: React.ReactNode;
42
+ /**
43
+ * The text to show for the option when `children` is not defined. When filtering, the
44
+ * `label` is used for matching to the filter text.
45
+ */
46
+ label: string;
47
+ /**
48
+ * Sections of the label string to highlight as a match. This is automatically set for
49
+ * uncontrolled filters, so it's not normally necessary to set this property when using
50
+ * filtering.
51
+ */
52
+ matchRanges?: {
53
+ start: number;
54
+ end: number;
55
+ }[];
56
+ /**
57
+ * @private Passed down from <BaseSelect>
58
+ */
59
+ multiple?: boolean;
60
+ /** @private */
61
+ onClick?: OptionClickHandler;
62
+ /** @private */
63
+ selected?: boolean;
64
+ /**
65
+ * When `true`, wrapping is disabled and any additional text is ellipsised.
66
+ */
67
+ truncate?: boolean;
68
+ /**
69
+ * The label and/or icon will be placed on the Control's toggle if it matches this value.
70
+ */
71
+ value: string | number | boolean;
72
+ }
73
+ declare const defaultProps: Required<Pick<OptionPropsBase, 'descriptionPosition' | 'disabled' | 'multiple' | 'selected' | 'truncate'>>;
74
+ declare type OptionProps = ClassComponentProps<OptionPropsBase, typeof defaultProps, 'button'>;
75
+ /**
76
+ * An option within a `Multiselect`. This inherits from
77
+ * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
78
+ * so any elements passed to it must also be pure.
79
+ */
80
+ declare class Option extends PureComponent<OptionProps, {}> {
81
+ private c;
82
+ static propTypes: React.WeakValidationMap<ClassComponentProps<OptionPropsBase, Required<Pick<OptionPropsBase, "disabled" | "multiple" | "selected" | "descriptionPosition" | "truncate">>, "button", never>>;
83
+ static defaultProps: Required<Pick<OptionPropsBase, "disabled" | "multiple" | "selected" | "descriptionPosition" | "truncate">>;
84
+ private handleClick;
85
+ private handleMount;
86
+ scrollIntoViewIfNeeded(): void;
87
+ /**
88
+ * Place focus on the button.
89
+ */
90
+ focus(): void;
91
+ render(): JSX.Element;
92
+ }
93
+ export default Option;
94
+ export { OptionClickHandler };
@@ -1,7 +1,7 @@
1
1
  import React, { Component } from 'react';
2
- import { Divider, Heading } from '@splunk/react-ui/Menu';
3
- import Option from './Option';
4
2
  import { ClassComponentProps } from '../utils/types';
3
+ import { Divider as BaseDivider, Heading as BaseHeading } from './SelectBase';
4
+ import Option from './Option';
5
5
  /** @public */
6
6
  declare type SelectChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>, data: {
7
7
  name?: string;
@@ -12,6 +12,10 @@ declare type SelectFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElem
12
12
  keyword: string;
13
13
  }) => void;
14
14
  interface SelectPropsBase {
15
+ /**
16
+ * Whether or not to show the wait spinner when loading. It's recommended to set this to
17
+ * `true` when loading may take more than one second.
18
+ */
15
19
  animateLoading?: boolean;
16
20
  /**
17
21
  * Change the style of the button or link.
@@ -152,46 +156,17 @@ interface SelectPropsBaseUncontrolled extends SelectPropsBase {
152
156
  }
153
157
  declare type SelectProps = ClassComponentProps<SelectPropsBaseControlled | SelectPropsBaseUncontrolled, typeof defaultProps, 'button'>;
154
158
  interface SelectState {
155
- activeIndex?: number;
156
- filterKeyword?: string;
157
- open: boolean;
158
- value?: string | number | boolean;
159
+ defaultValues?: (string | number | boolean)[];
159
160
  }
160
161
  declare class Select extends Component<SelectProps, SelectState> {
161
- private activeItemId;
162
- private activeValue?;
163
- private availableOptionCount;
164
- private controlledExternally;
165
- private dropdown;
166
- private menuId;
167
- private selectedOption;
168
- private selectedOptionIndex?;
169
- static propTypes: React.WeakValidationMap<SelectPropsBaseControlled & Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "inline" | "defaultPlacement" | "appearance" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">> | React.WeakValidationMap<SelectPropsBaseUncontrolled & Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "inline" | "defaultPlacement" | "appearance" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">>;
170
- static defaultProps: Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "inline" | "defaultPlacement" | "appearance" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">>;
162
+ static propTypes: React.WeakValidationMap<SelectPropsBaseControlled & Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "appearance" | "inline" | "defaultPlacement" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "onPause" | "className" | "color" | "id" | "lang" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">> | React.WeakValidationMap<SelectPropsBaseUncontrolled & Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "appearance" | "inline" | "defaultPlacement" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "onPause" | "className" | "color" | "id" | "lang" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">>;
163
+ static defaultProps: Required<Pick<SelectPropsBase, "filter" | "children" | "placeholder" | "disabled" | "appearance" | "inline" | "defaultPlacement" | "error" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "isLoadingOptions" | "menuStyle">>;
171
164
  static Option: typeof Option;
172
- static Divider: typeof Divider;
173
- static Heading: typeof Heading;
174
- private static validateAppearance;
165
+ static Heading: typeof BaseHeading;
166
+ static Divider: typeof BaseDivider;
175
167
  constructor(props: Readonly<SelectProps>);
176
168
  componentDidUpdate(prevProps: Readonly<SelectProps>): void;
177
- private getCurrentValue;
178
- private handleActiveOptionMount;
179
- private handleTextKeyDown;
180
- private handleTextChange;
181
- private handleTextKeyUp;
182
- private handleSelectedItemMount;
183
- private handleItemClick;
184
- private handleRequestOpen;
185
- private handleRequestClose;
186
- private handleScrollBottom;
187
- private selectValue;
188
- private isControlled;
189
- /**
190
- * Place focus on the toggle.
191
- */
192
- focus(): void;
193
- private renderFilter;
194
169
  render(): JSX.Element;
195
170
  }
196
171
  export default Select;
197
- export { Divider, Heading, Option, SelectChangeHandler, SelectFilterChangeHandler };
172
+ export { BaseDivider as Divider, BaseHeading as Heading, Option, SelectChangeHandler, SelectFilterChangeHandler, };
@@ -0,0 +1,221 @@
1
+ import React, { Component } from 'react';
2
+ import { Divider, Heading } from '@splunk/react-ui/Menu';
3
+ import Option from './OptionBase';
4
+ import { ClassComponentProps } from '../utils/types';
5
+ declare type SelectBaseFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement>, data: {
6
+ keyword: string;
7
+ }) => void;
8
+ declare type SelectBaseChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>, data: {
9
+ name?: string;
10
+ values: (string | number | boolean)[];
11
+ }) => void;
12
+ interface SelectBasePropsBase {
13
+ animateLoading?: boolean;
14
+ /**
15
+ * Change the style of the button or link.
16
+ * @themeNotes 'pill': supported by `enterprise`, `enterpriseDark` and `lite`. 'toggle' and 'flat': supported by `scp`.
17
+ */
18
+ appearance?: 'default' | 'link' | 'primary' | 'pill' | 'toggle' | 'flat';
19
+ /**
20
+ * Remove rounding from the left side of the toggle.
21
+ */
22
+ append?: boolean;
23
+ /**
24
+ * Allow the user to add arbitrary values.
25
+ */
26
+ allowNewValues?: boolean;
27
+ /**
28
+ * `children` should be `Multiselect.Option`, `Multiselect.Heading`, or
29
+ * `Multiselect.Divider`.
30
+ */
31
+ children?: React.ReactNode;
32
+ /**
33
+ * The default placement of the dropdown menu. It might be rendered in a different direction
34
+ * depending upon the space available.
35
+ */
36
+ defaultPlacement?: 'above' | 'below' | 'vertical';
37
+ /**
38
+ * Set this property instead of values to keep the values uncontrolled.
39
+ */
40
+ defaultValues?: (string | number | boolean)[];
41
+ /**
42
+ * The id of the description. When placed in a ControlGroup, this automatically set to the
43
+ * ControlGroup's help component.
44
+ */
45
+ describedBy?: string;
46
+ /** Disable adding and removing. */
47
+ disabled?: boolean;
48
+ /**
49
+ * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
50
+ */
51
+ elementRef?: React.Ref<HTMLButtonElement>;
52
+ /** Display as in an error. */
53
+ error?: boolean;
54
+ /**
55
+ * Determines whether to show the filter box. When true, the children are automatically
56
+ * filtered based on the label. When controlled, the parent component must provide a
57
+ * onFilterChange callback and update the children. This can also be used to fetch new
58
+ * results. */
59
+ filter?: boolean | 'controlled';
60
+ /**
61
+ * The footer message can show additional information, such as a truncation message.
62
+ */
63
+ footerMessage?: React.ReactNode;
64
+ /** Make the control an inline block with variable width. */
65
+ inline?: boolean;
66
+ /**
67
+ * An id for the input, which may be necessary for accessibility, such as for aria
68
+ * attributes.
69
+ */
70
+ inputId?: string;
71
+ /**
72
+ * A React ref which is set to the input element when the component mounts and null when it unmounts.
73
+ */
74
+ inputRef?: React.Ref<HTMLInputElement>;
75
+ isLoadingOptions?: boolean;
76
+ /**
77
+ * The id of the label. When placed in a ControlGroup, this automatically set to the
78
+ * ControlGroup's label. This property is not used when `labelText` is provided.
79
+ */
80
+ labelledBy?: string;
81
+ /**
82
+ * Text presented in the label for this field.
83
+ * This is used to supply this text along with the current value to a screen reader.
84
+ */
85
+ labelText?: string;
86
+ /**
87
+ * The loading message to show when isLoadingOptions. */
88
+ loadingMessage?: React.ReactNode;
89
+ /**
90
+ * Style properties to apply to the Menu. */
91
+ menuStyle?: React.CSSProperties;
92
+ /**
93
+ * Allow multiple values to be selected.
94
+ */
95
+ multiple: boolean;
96
+ /** The name is returned with onChange events, which can be used to identify the
97
+ * control when multiple controls share an onChange callback. */
98
+ name?: string;
99
+ /**
100
+ * The noOptionsMessage is shown when there are no children and not loading, such as when
101
+ * there are no Options matching the filter. This can be customized to the type of content,
102
+ * such as "No matching dashboards"; insert other content, such as an error message; or
103
+ * communicate a minimum number of chararters to enter to see results. */
104
+ noOptionsMessage?: React.ReactNode;
105
+ /**
106
+ * A callback to receive the change events. If values is set, this callback is required.
107
+ * This must set the values prop to retain the change.
108
+ */
109
+ onChange?: SelectBaseChangeHandler;
110
+ /**
111
+ * A callback function when the list is scrolled to the bottom. Use to fetch more results and append to list.
112
+ * Note: Set to null when all items are loaded.
113
+ */
114
+ onScrollBottom?: () => void;
115
+ /**
116
+ * A callback with the change event and value of the filter box. Providing this callback and
117
+ * setting the `filter` prop to `"controlled"` enables you to filter and update the children by other
118
+ * criteria.
119
+ */
120
+ onFilterChange?: SelectBaseFilterChangeHandler;
121
+ /**
122
+ * A callback function invoked when the popover closes.
123
+ */
124
+ onClose?: () => void;
125
+ /**
126
+ * A callback function invoked when the popover opens.
127
+ */
128
+ onOpen?: () => void;
129
+ /**
130
+ * If 'values' is undefined or don't match an item, the Button will display this text.
131
+ */
132
+ placeholder?: string;
133
+ /**
134
+ * When used outside of a control group, it can be useful to include the label on the toggle.
135
+ */
136
+ prefixLabel?: string;
137
+ /**
138
+ * Remove rounding from the left side of the toggle.
139
+ */
140
+ prepend?: boolean;
141
+ /**
142
+ * Places this string after the selected label.
143
+ */
144
+ suffixLabel?: string;
145
+ /** Pressing tab while entering an input confirms the new value. Requires `allowNewValues`. */
146
+ tabConfirmsNewValue?: boolean;
147
+ /**
148
+ * Values will be matched to one of the children to deduce the label and/or icon for the
149
+ * toggle.
150
+ */
151
+ values?: (string | number | boolean)[];
152
+ }
153
+ declare const defaultProps: Required<Pick<SelectBasePropsBase, 'allowNewValues' | 'animateLoading' | 'appearance' | 'append' | 'defaultPlacement' | 'disabled' | 'filter' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'multiple' | 'noOptionsMessage' | 'placeholder' | 'prepend' | 'tabConfirmsNewValue'>>;
154
+ interface SelectBasePropsBaseControlled extends SelectBasePropsBase {
155
+ defaultValues?: never;
156
+ onChange: SelectBaseChangeHandler;
157
+ values?: (string | number | boolean)[];
158
+ }
159
+ interface SelectBasePropsBaseUncontrolled extends SelectBasePropsBase {
160
+ defaultValues?: (string | number | boolean)[];
161
+ values?: never;
162
+ }
163
+ declare type SelectBaseProps = ClassComponentProps<SelectBasePropsBaseControlled | SelectBasePropsBaseUncontrolled, typeof defaultProps, 'button'>;
164
+ declare type OptionElement = React.ReactElement<React.ComponentPropsWithRef<typeof Option>, typeof Option>;
165
+ declare type ChildrenElement = React.ReactElement<React.ComponentProps<typeof Divider | typeof Heading>, typeof Divider | typeof Heading> | OptionElement;
166
+ declare function isOption(child: ChildrenElement): child is OptionElement;
167
+ interface SelectBaseState {
168
+ activeIndex: number;
169
+ filterKeyword: string;
170
+ open: boolean;
171
+ textHasFocus: boolean;
172
+ topValues: (string | number | boolean)[];
173
+ values: (string | number | boolean)[];
174
+ }
175
+ declare class SelectBase extends Component<SelectBaseProps, SelectBaseState> {
176
+ private activeItemId;
177
+ private activeValue?;
178
+ private availableOptionCount;
179
+ private controlledExternally;
180
+ private displayedValues;
181
+ private dropdown;
182
+ private firstSelectedOption;
183
+ private firstSelectedOptionIndex?;
184
+ private menuId;
185
+ private selectedOptionCount;
186
+ static propTypes: React.WeakValidationMap<SelectBasePropsBaseControlled & Required<Pick<SelectBasePropsBase, "filter" | "placeholder" | "disabled" | "multiple" | "appearance" | "inline" | "defaultPlacement" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "value" | "onPause" | "className" | "color" | "id" | "lang" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">> | React.WeakValidationMap<SelectBasePropsBaseUncontrolled & Required<Pick<SelectBasePropsBase, "filter" | "placeholder" | "disabled" | "multiple" | "appearance" | "inline" | "defaultPlacement" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue">> & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "value" | "onPause" | "className" | "color" | "id" | "lang" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">>;
187
+ static defaultProps: Required<Pick<SelectBasePropsBase, "filter" | "placeholder" | "disabled" | "multiple" | "appearance" | "inline" | "defaultPlacement" | "append" | "prepend" | "animateLoading" | "noOptionsMessage" | "allowNewValues" | "isLoadingOptions" | "menuStyle" | "tabConfirmsNewValue">>;
188
+ static Option: typeof Option;
189
+ static Divider: typeof Divider;
190
+ static Heading: typeof Heading;
191
+ private static invalidLinkAppearanceProps;
192
+ private static validateAppearance;
193
+ constructor(props: Readonly<SelectBaseProps>);
194
+ componentDidUpdate(prevProps: Readonly<SelectBaseProps>): void;
195
+ private getCurrentValues;
196
+ private handleSelectAll;
197
+ private handleClearAll;
198
+ private handleTextKeyDown;
199
+ private handleMenuOptionClick;
200
+ private handleTextChange;
201
+ private handleTextFocus;
202
+ private handleTextBlur;
203
+ private handleRequestOpen;
204
+ private handleRequestClose;
205
+ private handleScrollBottom;
206
+ private handleActiveOptionMount;
207
+ private handleSelectedItemMount;
208
+ private isControlled;
209
+ private hasFilter;
210
+ private toggleValue;
211
+ /**
212
+ * Place focus on the toggle.
213
+ */
214
+ focus(): void;
215
+ private renderControls;
216
+ private createChildren;
217
+ private wrapLabel;
218
+ render(): JSX.Element;
219
+ }
220
+ export default SelectBase;
221
+ export { ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
@@ -21,6 +21,10 @@ interface SidePanelPropsBase {
21
21
  * the height when placed top or bottom.
22
22
  */
23
23
  innerStyle?: React.CSSProperties;
24
+ /**
25
+ * A function called when the open / close animation ends.
26
+ */
27
+ onAnimationEnd?: () => void;
24
28
  /**
25
29
  * A function that is called when a close event occurs. The callback is passed a
26
30
  * reason and the event.