@itwin/itwinui-react 1.37.3 → 1.38.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/CHANGELOG.md +16 -0
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +3 -5
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBox.d.ts +4 -2
- package/cjs/core/ComboBox/ComboBox.js +129 -246
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +8 -0
- package/cjs/core/ComboBox/ComboBoxDropdown.js +55 -0
- package/cjs/core/ComboBox/ComboBoxEndIcon.d.ts +5 -0
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +54 -0
- package/cjs/core/ComboBox/ComboBoxInput.d.ts +5 -0
- package/cjs/core/ComboBox/ComboBoxInput.js +134 -0
- package/cjs/core/ComboBox/ComboBoxInputContainer.d.ts +8 -0
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +45 -0
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +3 -0
- package/cjs/core/ComboBox/ComboBoxMenu.js +45 -0
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +21 -0
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +65 -0
- package/cjs/core/ComboBox/helpers.d.ts +27 -0
- package/cjs/core/ComboBox/helpers.js +50 -0
- package/cjs/core/Modal/Modal.d.ts +1 -1
- package/cjs/core/Modal/Modal.js +6 -6
- package/cjs/core/Modal/ModalButtonBar.d.ts +1 -1
- package/cjs/core/Modal/ModalButtonBar.js +2 -2
- package/cjs/core/Modal/ModalContent.d.ts +1 -1
- package/cjs/core/Modal/ModalContent.js +2 -2
- package/cjs/core/RadioTiles/RadioTile.d.ts +1 -1
- package/cjs/core/RadioTiles/RadioTile.js +7 -9
- package/cjs/core/Table/Table.js +2 -2
- package/cjs/core/Table/filters/FilterToggle.js +3 -2
- package/cjs/core/Toast/ToastWrapper.d.ts +7 -5
- package/cjs/core/Toast/ToastWrapper.js +8 -4
- package/cjs/core/Toast/Toaster.d.ts +3 -0
- package/cjs/core/Toast/Toaster.js +66 -5
- package/cjs/core/utils/components/Popover.d.ts +1 -1
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useSafeContext.d.ts +6 -0
- package/cjs/core/utils/hooks/useSafeContext.js +23 -0
- package/esm/core/Breadcrumbs/Breadcrumbs.js +3 -5
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ComboBox/ComboBox.d.ts +4 -2
- package/esm/core/ComboBox/ComboBox.js +131 -248
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +8 -0
- package/esm/core/ComboBox/ComboBoxDropdown.js +49 -0
- package/esm/core/ComboBox/ComboBoxEndIcon.d.ts +5 -0
- package/esm/core/ComboBox/ComboBoxEndIcon.js +48 -0
- package/esm/core/ComboBox/ComboBoxInput.d.ts +5 -0
- package/esm/core/ComboBox/ComboBoxInput.js +128 -0
- package/esm/core/ComboBox/ComboBoxInputContainer.d.ts +8 -0
- package/esm/core/ComboBox/ComboBoxInputContainer.js +38 -0
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +3 -0
- package/esm/core/ComboBox/ComboBoxMenu.js +39 -0
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +21 -0
- package/esm/core/ComboBox/ComboBoxMenuItem.js +59 -0
- package/esm/core/ComboBox/helpers.d.ts +27 -0
- package/esm/core/ComboBox/helpers.js +43 -0
- package/esm/core/Modal/Modal.d.ts +1 -1
- package/esm/core/Modal/Modal.js +6 -6
- package/esm/core/Modal/ModalButtonBar.d.ts +1 -1
- package/esm/core/Modal/ModalButtonBar.js +2 -2
- package/esm/core/Modal/ModalContent.d.ts +1 -1
- package/esm/core/Modal/ModalContent.js +2 -2
- package/esm/core/RadioTiles/RadioTile.d.ts +1 -1
- package/esm/core/RadioTiles/RadioTile.js +7 -9
- package/esm/core/Table/Table.js +2 -2
- package/esm/core/Table/filters/FilterToggle.js +3 -2
- package/esm/core/Toast/ToastWrapper.d.ts +7 -5
- package/esm/core/Toast/ToastWrapper.js +8 -3
- package/esm/core/Toast/Toaster.d.ts +3 -0
- package/esm/core/Toast/Toaster.js +66 -5
- package/esm/core/utils/components/Popover.d.ts +1 -1
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useSafeContext.d.ts +6 -0
- package/esm/core/utils/hooks/useSafeContext.js +16 -0
- package/package.json +5 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.38.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.3...v1.38.0) (2022-05-23)
|
|
4
|
+
|
|
5
|
+
### What's new
|
|
6
|
+
|
|
7
|
+
* **ComboBox:** Full component refactor to improve performance by using components composition ([#618](https://www.github.com/iTwin/iTwinUI-react/issues/618)) ([5d56809](https://www.github.com/iTwin/iTwinUI-react/commit/5d56809c46ad312402669f9cb2dbf6c8d3c733ad))
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
* **Table:** Allow 'false' as valid filter value ([#664](https://www.github.com/iTwin/iTwinUI-react/issues/664)) ([628cc26](https://www.github.com/iTwin/iTwinUI-react/commit/628cc26afc044e1b3f1c09b2489b31fe15b34de1))
|
|
12
|
+
* **Toaster:** Do not call `ReactDOM` render multiple times ([#667](https://www.github.com/iTwin/iTwinUI-react/issues/667)) ([195a857](https://www.github.com/iTwin/iTwinUI-react/commit/195a8573157ce6588e0edb40569770ffa4636584))
|
|
13
|
+
* Visuals changes after CSS update ([#678](https://www.github.com/iTwin/iTwinUI-react/issues/678)) ([16b9310](https://www.github.com/iTwin/iTwinUI-react/commit/16b93106c8d3787cc3f6bdee469604db6167ccf0))
|
|
14
|
+
- **Select:** Arrow color
|
|
15
|
+
- **Tabs:** Description color
|
|
16
|
+
- **Skeleton:** Background color
|
|
17
|
+
- **Checkbox:** Add border to disabled state
|
|
18
|
+
|
|
3
19
|
### [1.37.3](https://www.github.com/iTwin/iTwinUI-react/compare/v1.37.2...v1.37.3) (2022-05-06)
|
|
4
20
|
|
|
5
21
|
### Fixes
|
|
@@ -67,9 +67,7 @@ exports.Breadcrumbs = react_1.default.forwardRef(function (props, ref) {
|
|
|
67
67
|
var _b;
|
|
68
68
|
var index = _a.index;
|
|
69
69
|
var item = items[index];
|
|
70
|
-
return (react_1.default.createElement("li", { className:
|
|
71
|
-
'iui-current': currentIndex === index,
|
|
72
|
-
}) }, react_1.default.isValidElement(item)
|
|
70
|
+
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' }, react_1.default.isValidElement(item)
|
|
73
71
|
? react_1.default.cloneElement(item, {
|
|
74
72
|
'aria-current': ((_b = item.props['aria-current']) !== null && _b !== void 0 ? _b : currentIndex === index)
|
|
75
73
|
? 'location'
|
|
@@ -83,8 +81,8 @@ exports.Breadcrumbs = react_1.default.forwardRef(function (props, ref) {
|
|
|
83
81
|
react_1.default.createElement(ListItem, { index: 0 }),
|
|
84
82
|
react_1.default.createElement(Separator, null))),
|
|
85
83
|
items.length - visibleCount > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
86
|
-
react_1.default.createElement("li", { className: 'iui-breadcrumbs-item' },
|
|
87
|
-
react_1.default.createElement("span",
|
|
84
|
+
react_1.default.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' },
|
|
85
|
+
react_1.default.createElement("span", { className: 'iui-breadcrumbs-text' }, "\u2026")),
|
|
88
86
|
react_1.default.createElement(Separator, null))),
|
|
89
87
|
items
|
|
90
88
|
.slice(visibleCount > 1
|
|
@@ -17,5 +17,5 @@ export declare type ColorSwatchProps = {
|
|
|
17
17
|
* <ColorSwatch color='#23450b' onClick={onClick}/>
|
|
18
18
|
* <ColorSwatch color={{ r: 255, g: 255, b: 0 }} onClick={onClick}/>
|
|
19
19
|
*/
|
|
20
|
-
export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "aria-disabled" | "
|
|
20
|
+
export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "aria-disabled" | "children" | "role" | "className" | "onClick" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "color" | "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-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" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "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" | "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" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "isActive"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export default ColorSwatch;
|
|
@@ -40,8 +40,10 @@ export declare type ComboBoxProps<T> = {
|
|
|
40
40
|
emptyStateMessage?: string;
|
|
41
41
|
/**
|
|
42
42
|
* A custom item renderer can be specified to control the rendering.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
*
|
|
44
|
+
* For keyboard navigation to work, the returned element should use the `id` provided by this function.
|
|
45
|
+
* The `isFocused` state is calculated using this `id` and can be used for specifying the focus styling.
|
|
46
|
+
* If a `MenuItem` is returned, then focus styling is automatically handled.
|
|
45
47
|
*/
|
|
46
48
|
itemRenderer?: (option: SelectOption<T>, states: {
|
|
47
49
|
isSelected: boolean;
|
|
@@ -32,13 +32,22 @@ exports.ComboBox = void 0;
|
|
|
32
32
|
*--------------------------------------------------------------------------------------------*/
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
34
|
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
-
var Input_1 = require("../Input");
|
|
36
35
|
var Menu_1 = require("../Menu");
|
|
37
36
|
var Typography_1 = require("../Typography");
|
|
38
37
|
var utils_1 = require("../utils");
|
|
39
|
-
var CaretDownSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall"));
|
|
40
38
|
require("tippy.js/animations/shift-away.css");
|
|
41
|
-
var
|
|
39
|
+
var helpers_1 = require("./helpers");
|
|
40
|
+
var ComboBoxDropdown_1 = require("./ComboBoxDropdown");
|
|
41
|
+
var ComboBoxEndIcon_1 = require("./ComboBoxEndIcon");
|
|
42
|
+
var ComboBoxInput_1 = require("./ComboBoxInput");
|
|
43
|
+
var ComboBoxInputContainer_1 = require("./ComboBoxInputContainer");
|
|
44
|
+
var ComboBoxMenu_1 = require("./ComboBoxMenu");
|
|
45
|
+
var ComboBoxMenuItem_1 = require("./ComboBoxMenuItem");
|
|
46
|
+
/** Returns either `option.id` or derives a stable id using `idPrefix` and `option.label` (without whitespace) */
|
|
47
|
+
var getOptionId = function (option, idPrefix) {
|
|
48
|
+
var _a;
|
|
49
|
+
return (_a = option.id) !== null && _a !== void 0 ? _a : "".concat(idPrefix, "-option-").concat(option.label.replace(/\s/g, '-'));
|
|
50
|
+
};
|
|
42
51
|
/**
|
|
43
52
|
* ComboBox component that allows typing a value to filter the options in dropdown list.
|
|
44
53
|
* Values can be selected either using mouse clicks or using the Enter key.
|
|
@@ -53,273 +62,147 @@ var StatusMessage_1 = require("../StatusMessage");
|
|
|
53
62
|
* />
|
|
54
63
|
*/
|
|
55
64
|
var ComboBox = function (props) {
|
|
56
|
-
var
|
|
65
|
+
var _a;
|
|
66
|
+
var options = props.options, valueProp = props.value, onChange = props.onChange, filterFunction = props.filterFunction, inputProps = props.inputProps, dropdownMenuProps = props.dropdownMenuProps, _b = props.emptyStateMessage, emptyStateMessage = _b === void 0 ? 'No options found' : _b, itemRenderer = props.itemRenderer, rest = __rest(props, ["options", "value", "onChange", "filterFunction", "inputProps", "dropdownMenuProps", "emptyStateMessage", "itemRenderer"]);
|
|
57
67
|
// Generate a stateful random id if not specified
|
|
58
68
|
var id = react_1.default.useState(function () {
|
|
59
69
|
var _a, _b;
|
|
60
70
|
return (_b = (_a = props.id) !== null && _a !== void 0 ? _a : ((inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) && "".concat(inputProps.id, "-cb"))) !== null && _b !== void 0 ? _b : "iui-cb-".concat((0, utils_1.getRandomValue)(10));
|
|
61
71
|
})[0];
|
|
62
72
|
(0, utils_1.useTheme)();
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}));
|
|
70
|
-
}, [options, id]);
|
|
71
|
-
var userOnChange = react_1.default.useRef(onChange);
|
|
73
|
+
// Refs get set in subcomponents
|
|
74
|
+
var inputRef = react_1.default.useRef(null);
|
|
75
|
+
var menuRef = react_1.default.useRef(null);
|
|
76
|
+
var toggleButtonRef = react_1.default.useRef(null);
|
|
77
|
+
// Latest value of the onChange prop
|
|
78
|
+
var onChangeProp = react_1.default.useRef(onChange);
|
|
72
79
|
react_1.default.useEffect(function () {
|
|
73
|
-
|
|
80
|
+
onChangeProp.current = onChange;
|
|
74
81
|
}, [onChange]);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
// Record to store all extra information (e.g. original indexes), where the key is the id of the option
|
|
83
|
+
var optionsExtraInfoRef = react_1.default.useRef({});
|
|
84
|
+
// Clear the extra info when the options change so that it can be reinitialized below
|
|
85
|
+
react_1.default.useEffect(function () {
|
|
86
|
+
optionsExtraInfoRef.current = {};
|
|
87
|
+
}, [options]);
|
|
88
|
+
// Initialize the extra info only if it is not already initialized
|
|
89
|
+
if (options.length > 0 &&
|
|
90
|
+
Object.keys(optionsExtraInfoRef.current).length === 0) {
|
|
91
|
+
options.forEach(function (option, index) {
|
|
92
|
+
optionsExtraInfoRef.current[getOptionId(option, id)] = {
|
|
93
|
+
__originalIndex: index,
|
|
87
94
|
};
|
|
88
|
-
if (itemRenderer) {
|
|
89
|
-
return react_1.default.cloneElement(itemRenderer(option, {
|
|
90
|
-
id: getOptionId(index),
|
|
91
|
-
index: index,
|
|
92
|
-
isSelected: false,
|
|
93
|
-
isFocused: false,
|
|
94
|
-
}), additionalProps);
|
|
95
|
-
}
|
|
96
|
-
return (react_1.default.createElement(Menu_1.MenuItem, __assign({ id: getOptionId(index), key: getOptionId(index) }, additionalProps, rest), label));
|
|
97
95
|
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
}
|
|
97
|
+
// Reducer where all the component-wide state is stored
|
|
98
|
+
var _c = react_1.default.useReducer(helpers_1.comboBoxReducer, {
|
|
99
|
+
isOpen: false,
|
|
100
|
+
selectedIndex: -1,
|
|
101
|
+
focusedIndex: -1,
|
|
102
|
+
}), _d = _c[0], isOpen = _d.isOpen, selectedIndex = _d.selectedIndex, focusedIndex = _d.focusedIndex, dispatch = _c[1];
|
|
103
|
+
react_1.default.useEffect(function () {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
// When the dropdown opens
|
|
106
|
+
if (isOpen) {
|
|
107
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // Focus the input
|
|
108
|
+
setFilteredOptions(options); // Reset the filtered list
|
|
109
|
+
}
|
|
110
|
+
// When the dropdown closes
|
|
111
|
+
else {
|
|
112
|
+
// Reset the focused index
|
|
113
|
+
dispatch(['focus']);
|
|
114
|
+
// Reset the input value
|
|
115
|
+
setInputValue(selectedIndex != undefined && selectedIndex >= 0
|
|
116
|
+
? (_b = options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.label
|
|
117
|
+
: '');
|
|
118
|
+
}
|
|
119
|
+
}, [isOpen, options, selectedIndex]);
|
|
103
120
|
// Set min-width of menu to be same as input
|
|
104
|
-
var
|
|
121
|
+
var _e = react_1.default.useState(0), minWidth = _e[0], setMinWidth = _e[1];
|
|
105
122
|
react_1.default.useEffect(function () {
|
|
106
123
|
if (inputRef.current) {
|
|
107
124
|
setMinWidth(inputRef.current.offsetWidth);
|
|
108
125
|
}
|
|
109
126
|
}, [isOpen]);
|
|
110
|
-
|
|
127
|
+
// Initialize filtered options to the latest value options
|
|
128
|
+
var _f = react_1.default.useState(options), filteredOptions = _f[0], setFilteredOptions = _f[1];
|
|
111
129
|
react_1.default.useEffect(function () {
|
|
112
130
|
setFilteredOptions(options);
|
|
113
131
|
}, [options]);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
132
|
+
// Filter options based on input value
|
|
133
|
+
var _g = react_1.default.useState((_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.value) !== null && _a !== void 0 ? _a : ''), inputValue = _g[0], setInputValue = _g[1];
|
|
134
|
+
var handleOnInput = react_1.default.useCallback(function (event) {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
var value = event.currentTarget.value;
|
|
137
|
+
setInputValue(value);
|
|
138
|
+
dispatch(['open']); // reopen when typing
|
|
139
|
+
setFilteredOptions((_a = filterFunction === null || filterFunction === void 0 ? void 0 : filterFunction(options, value)) !== null && _a !== void 0 ? _a : options.filter(function (option) {
|
|
140
|
+
return option.label.toLowerCase().includes(value.toLowerCase());
|
|
141
|
+
}));
|
|
142
|
+
(_b = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) === null || _b === void 0 ? void 0 : _b.call(inputProps, event);
|
|
143
|
+
}, [filterFunction, inputProps, options]);
|
|
144
|
+
// Reset focused item when filteredOptions change
|
|
119
145
|
react_1.default.useEffect(function () {
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
//
|
|
123
|
-
var _g = react_1.default.useState(''), inputValue = _g[0], setInputValue = _g[1];
|
|
124
|
-
var onInput = react_1.default.useCallback(function (event) {
|
|
125
|
-
var _a;
|
|
126
|
-
setInputValue(event.target.value);
|
|
127
|
-
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) === null || _a === void 0 ? void 0 : _a.call(inputProps, event);
|
|
128
|
-
}, [inputProps]);
|
|
129
|
-
// update inputValue and focusedIndex every time selected value changes
|
|
146
|
+
dispatch(['focus']);
|
|
147
|
+
}, [filteredOptions]);
|
|
148
|
+
// When the value prop changes, update the selectedIndex
|
|
130
149
|
react_1.default.useEffect(function () {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
setFocusedIndex(selectedOption ? options.indexOf(selectedOption) : -1);
|
|
138
|
-
}, [selectedValue, options]);
|
|
139
|
-
// Filter options and update focus when input value changes
|
|
150
|
+
dispatch([
|
|
151
|
+
'select',
|
|
152
|
+
options.findIndex(function (option) { return option.value === valueProp; }),
|
|
153
|
+
]);
|
|
154
|
+
}, [options, valueProp]);
|
|
155
|
+
// Call user-defined onChange when the value actually changes
|
|
140
156
|
react_1.default.useEffect(function () {
|
|
141
|
-
var _a;
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var selectedOption = options.find(function (_a) {
|
|
147
|
-
var value = _a.value;
|
|
148
|
-
return value === selectedValue;
|
|
149
|
-
});
|
|
150
|
-
if (!inputValue || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) === inputValue) {
|
|
151
|
-
setFilteredOptions(options);
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
var _filteredOptions = (_a = filterFunction === null || filterFunction === void 0 ? void 0 : filterFunction(options, inputValue)) !== null && _a !== void 0 ? _a : options.filter(function (option) {
|
|
155
|
-
return option.label.toLowerCase().includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim().toLowerCase());
|
|
156
|
-
});
|
|
157
|
-
setFilteredOptions(_filteredOptions);
|
|
158
|
-
setFocusedIndex(function (previouslyFocusedIndex) {
|
|
159
|
-
if (_filteredOptions.includes(options[previouslyFocusedIndex])) {
|
|
160
|
-
return previouslyFocusedIndex;
|
|
161
|
-
}
|
|
162
|
-
else if (_filteredOptions.find(function (_a) {
|
|
163
|
-
var value = _a.value;
|
|
164
|
-
return value === selectedValue;
|
|
165
|
-
})) {
|
|
166
|
-
return options.findIndex(function (_a) {
|
|
167
|
-
var value = _a.value;
|
|
168
|
-
return value === selectedValue;
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
return -1; // reset focus if previously focused or selected value is not in filtered list
|
|
157
|
+
var _a, _b;
|
|
158
|
+
if (selectedIndex != undefined && selectedIndex >= 0) {
|
|
159
|
+
var value = (_a = options[selectedIndex]) === null || _a === void 0 ? void 0 : _a.value;
|
|
160
|
+
if (value === valueProp) {
|
|
161
|
+
return;
|
|
173
162
|
}
|
|
174
|
-
|
|
175
|
-
}, [inputValue, options, selectedValue, isOpen, filterFunction]);
|
|
176
|
-
var onKeyDown = react_1.default.useCallback(function (event) {
|
|
177
|
-
var _a;
|
|
178
|
-
var focusableOptions = (0, utils_1.getFocusableElements)(menuRef.current);
|
|
179
|
-
var focusedIndexInFilteredList = focusableOptions.findIndex(function (_a) {
|
|
180
|
-
var _b;
|
|
181
|
-
var id = _a.id;
|
|
182
|
-
return id === ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-activedescendant'));
|
|
183
|
-
});
|
|
184
|
-
switch (event.key) {
|
|
185
|
-
case 'ArrowDown':
|
|
186
|
-
if (isOpen) {
|
|
187
|
-
var nextIndex_1 = Math.min(focusedIndexInFilteredList + 1, focusableOptions.length - 1);
|
|
188
|
-
setFocusedIndex(options.findIndex(function (_, index) {
|
|
189
|
-
return getOptionId(index) === focusableOptions[nextIndex_1].id;
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
setIsOpen(true); // reopen menu if closed when typing
|
|
194
|
-
}
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
event.stopPropagation();
|
|
197
|
-
break;
|
|
198
|
-
case 'ArrowUp':
|
|
199
|
-
if (isOpen) {
|
|
200
|
-
var previousIndex_1 = Math.max(focusedIndexInFilteredList - 1, 0);
|
|
201
|
-
setFocusedIndex(options.findIndex(function (_, index) {
|
|
202
|
-
return getOptionId(index) === focusableOptions[previousIndex_1].id;
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
event.preventDefault();
|
|
206
|
-
event.stopPropagation();
|
|
207
|
-
break;
|
|
208
|
-
case 'Enter':
|
|
209
|
-
if (isOpen) {
|
|
210
|
-
setSelectedValue(options[focusedIndex].value);
|
|
211
|
-
(_a = userOnChange.current) === null || _a === void 0 ? void 0 : _a.call(userOnChange, options[focusedIndex].value);
|
|
212
|
-
}
|
|
213
|
-
setIsOpen(function (open) { return !open; });
|
|
214
|
-
event.preventDefault();
|
|
215
|
-
event.stopPropagation();
|
|
216
|
-
break;
|
|
217
|
-
case 'Escape':
|
|
218
|
-
setIsOpen(false);
|
|
219
|
-
event.preventDefault();
|
|
220
|
-
event.stopPropagation();
|
|
221
|
-
break;
|
|
222
|
-
case 'Tab':
|
|
223
|
-
setIsOpen(false);
|
|
224
|
-
break;
|
|
225
|
-
default:
|
|
226
|
-
if (!isOpen) {
|
|
227
|
-
setIsOpen(true); // reopen menu if closed when typing
|
|
228
|
-
}
|
|
229
|
-
break;
|
|
163
|
+
(_b = onChangeProp.current) === null || _b === void 0 ? void 0 : _b.call(onChangeProp, value);
|
|
230
164
|
}
|
|
231
|
-
}, [
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
filteredOptions,
|
|
273
|
-
emptyStateMessage,
|
|
274
|
-
options,
|
|
275
|
-
getOptionId,
|
|
276
|
-
selectedValue,
|
|
277
|
-
focusedIndex,
|
|
278
|
-
itemRenderer,
|
|
279
|
-
memoizedItems,
|
|
280
|
-
]);
|
|
281
|
-
return (react_1.default.createElement(utils_1.InputContainer, __assign({ className: className, status: status, statusMessage: typeof message === 'string' ? (react_1.default.createElement(StatusMessage_1.StatusMessage, { status: status }, message)) : (react_1.default.isValidElement(message) &&
|
|
282
|
-
react_1.default.cloneElement(message, { status: status })) }, rest, { id: id }),
|
|
283
|
-
react_1.default.createElement("div", { className: 'iui-input-with-icon' },
|
|
284
|
-
react_1.default.createElement(utils_1.Popover, __assign({ placement: 'bottom-start', visible: isOpen, onClickOutside: function (_, _a) {
|
|
285
|
-
var _b;
|
|
286
|
-
var target = _a.target;
|
|
287
|
-
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
288
|
-
setIsOpen(false);
|
|
289
|
-
}
|
|
290
|
-
}, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: react_1.default.createElement(Menu_1.Menu, { id: "".concat(id, "-list"), className: 'iui-scroll', style: {
|
|
291
|
-
minWidth: minWidth,
|
|
292
|
-
maxWidth: "min(".concat(minWidth * 2, "px, 90vw)"),
|
|
293
|
-
maxHeight: 300,
|
|
294
|
-
}, setFocus: false, role: 'listbox', ref: menuRef }, menuItems), onHide: function (instance) {
|
|
295
|
-
var _a;
|
|
296
|
-
var selectedIndex = options.findIndex(function (_a) {
|
|
297
|
-
var value = _a.value;
|
|
298
|
-
return value === selectedValue;
|
|
299
|
-
});
|
|
300
|
-
setFocusedIndex(selectedIndex);
|
|
301
|
-
if (selectedIndex > -1) {
|
|
302
|
-
setInputValue(options[selectedIndex].label); // update input value to be same as selected value
|
|
303
|
-
}
|
|
304
|
-
(_a = dropdownMenuProps === null || dropdownMenuProps === void 0 ? void 0 : dropdownMenuProps.onHide) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, instance);
|
|
305
|
-
} }),
|
|
306
|
-
react_1.default.createElement(Input_1.Input, __assign({ ref: inputRef, onKeyDown: onKeyDown, onFocus: function () { return setIsOpen(true); }, value: inputValue, "aria-activedescendant": isOpen && focusedIndex > -1
|
|
307
|
-
? getOptionId(focusedIndex)
|
|
308
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? "".concat(id, "-list") : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off' }, inputProps, { onChange: onInput }))),
|
|
309
|
-
react_1.default.createElement("span", { ref: toggleButtonRef, className: (0, classnames_1.default)('iui-end-icon', {
|
|
310
|
-
'iui-actionable': !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled),
|
|
311
|
-
'iui-disabled': inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
|
|
312
|
-
'iui-open': isOpen,
|
|
313
|
-
}), onClick: function () {
|
|
314
|
-
var _a;
|
|
315
|
-
if (isOpen) {
|
|
316
|
-
setIsOpen(false);
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
320
|
-
}
|
|
321
|
-
} },
|
|
322
|
-
react_1.default.createElement(CaretDownSmall_1.default, { "aria-hidden": true })))));
|
|
165
|
+
}, [options, selectedIndex, valueProp]);
|
|
166
|
+
var getMenuItem = react_1.default.useCallback(function (option) {
|
|
167
|
+
var optionId = getOptionId(option, id);
|
|
168
|
+
var __originalIndex = optionsExtraInfoRef.current[optionId].__originalIndex;
|
|
169
|
+
var customItem = itemRenderer
|
|
170
|
+
? itemRenderer(option, {
|
|
171
|
+
isFocused: focusedIndex === __originalIndex,
|
|
172
|
+
isSelected: selectedIndex === __originalIndex,
|
|
173
|
+
index: __originalIndex,
|
|
174
|
+
id: optionId,
|
|
175
|
+
})
|
|
176
|
+
: null;
|
|
177
|
+
return customItem ? (react_1.default.cloneElement(customItem, {
|
|
178
|
+
onClick: function (e) {
|
|
179
|
+
var _a, _b;
|
|
180
|
+
dispatch(['select', __originalIndex]);
|
|
181
|
+
(_b = (_a = customItem.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
182
|
+
},
|
|
183
|
+
// ComboBox.MenuItem handles scrollIntoView, data-iui-index and iui-focused through context
|
|
184
|
+
// but we still need to pass them here for backwards compatibility with MenuItem
|
|
185
|
+
className: (0, classnames_1.default)(customItem.props.className, {
|
|
186
|
+
'iui-focused': focusedIndex === __originalIndex,
|
|
187
|
+
}),
|
|
188
|
+
'data-iui-index': __originalIndex,
|
|
189
|
+
ref: (0, utils_1.mergeRefs)(customItem.props.ref, function (el) {
|
|
190
|
+
// will need to check for virtualization here too
|
|
191
|
+
if (focusedIndex === __originalIndex) {
|
|
192
|
+
el === null || el === void 0 ? void 0 : el.scrollIntoView({ block: 'nearest' });
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
})) : (react_1.default.createElement(ComboBoxMenuItem_1.ComboBoxMenuItem, __assign({ key: optionId, id: optionId }, option, { isSelected: selectedIndex === __originalIndex, onClick: function () { return dispatch(['select', __originalIndex]); }, index: __originalIndex }), option.label));
|
|
196
|
+
}, [focusedIndex, id, itemRenderer, selectedIndex]);
|
|
197
|
+
return (react_1.default.createElement(helpers_1.ComboBoxRefsContext.Provider, { value: { inputRef: inputRef, menuRef: menuRef, toggleButtonRef: toggleButtonRef, optionsExtraInfoRef: optionsExtraInfoRef } },
|
|
198
|
+
react_1.default.createElement(helpers_1.ComboBoxActionContext.Provider, { value: dispatch },
|
|
199
|
+
react_1.default.createElement(helpers_1.ComboBoxStateContext.Provider, { value: { id: id, minWidth: minWidth, isOpen: isOpen, focusedIndex: focusedIndex } },
|
|
200
|
+
react_1.default.createElement(ComboBoxInputContainer_1.ComboBoxInputContainer, __assign({ disabled: inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled }, rest),
|
|
201
|
+
react_1.default.createElement(ComboBoxInput_1.ComboBoxInput, __assign({ value: inputValue }, inputProps, { onChange: handleOnInput })),
|
|
202
|
+
react_1.default.createElement(ComboBoxEndIcon_1.ComboBoxEndIcon, { disabled: inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled, isOpen: isOpen })),
|
|
203
|
+
react_1.default.createElement(ComboBoxDropdown_1.ComboBoxDropdown, __assign({}, dropdownMenuProps),
|
|
204
|
+
react_1.default.createElement(ComboBoxMenu_1.ComboBoxMenu, null, filteredOptions.length > 0 ? (filteredOptions.map(getMenuItem)) : (react_1.default.createElement(Menu_1.MenuExtraContent, null,
|
|
205
|
+
react_1.default.createElement(Typography_1.Text, { isMuted: true }, emptyStateMessage)))))))));
|
|
323
206
|
};
|
|
324
207
|
exports.ComboBox = ComboBox;
|
|
325
208
|
exports.default = exports.ComboBox;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ComboBoxDropdown: React.ForwardRefExoticComponent<Pick<{
|
|
3
|
+
visible?: boolean | undefined;
|
|
4
|
+
trigger?: string | undefined;
|
|
5
|
+
placement?: import("@popperjs/core").Placement | undefined;
|
|
6
|
+
} & Omit<import("@tippyjs/react").TippyProps, "placement" | "trigger" | "visible"> & {
|
|
7
|
+
children: JSX.Element;
|
|
8
|
+
}, "disabled" | "children" | "placement" | "trigger" | "visible" | "content" | "render" | "animateFill" | "appendTo" | "aria" | "delay" | "duration" | "followCursor" | "getReferenceClientRect" | "hideOnClick" | "ignoreAttributes" | "inlinePositioning" | "interactive" | "interactiveBorder" | "interactiveDebounce" | "moveTransition" | "offset" | "plugins" | "popperOptions" | "showOnCreate" | "sticky" | "touch" | "triggerTarget" | "onAfterUpdate" | "onBeforeUpdate" | "onCreate" | "onDestroy" | "onHidden" | "onHide" | "onMount" | "onShow" | "onShown" | "onTrigger" | "onUntrigger" | "onClickOutside" | "allowHTML" | "animation" | "arrow" | "inertia" | "maxWidth" | "role" | "theme" | "zIndex" | "className" | "singleton" | "reference"> & React.RefAttributes<Element>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.ComboBoxDropdown = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var utils_1 = require("../utils");
|
|
35
|
+
var helpers_1 = require("./helpers");
|
|
36
|
+
exports.ComboBoxDropdown = react_1.default.forwardRef(function (props, forwardedRef) {
|
|
37
|
+
var children = props.children, rest = __rest(props, ["children"]);
|
|
38
|
+
var isOpen = (0, utils_1.useSafeContext)(helpers_1.ComboBoxStateContext).isOpen;
|
|
39
|
+
var dispatch = (0, utils_1.useSafeContext)(helpers_1.ComboBoxActionContext);
|
|
40
|
+
var _a = (0, utils_1.useSafeContext)(helpers_1.ComboBoxRefsContext), inputRef = _a.inputRef, toggleButtonRef = _a.toggleButtonRef;
|
|
41
|
+
// sync internal isOpen state with user's visible prop
|
|
42
|
+
react_1.default.useEffect(function () {
|
|
43
|
+
if (props.visible != undefined) {
|
|
44
|
+
dispatch([props.visible ? 'open' : 'close']);
|
|
45
|
+
}
|
|
46
|
+
}, [dispatch, props.visible]);
|
|
47
|
+
return (react_1.default.createElement(utils_1.Popover, __assign({ placement: 'bottom-start', visible: isOpen, onClickOutside: react_1.default.useCallback(function (_, _a) {
|
|
48
|
+
var _b;
|
|
49
|
+
var target = _a.target;
|
|
50
|
+
if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
|
|
51
|
+
dispatch(['close']);
|
|
52
|
+
}
|
|
53
|
+
}, [dispatch, toggleButtonRef]), animation: 'shift-away', duration: 200, reference: inputRef, ref: forwardedRef, content: children }, rest)));
|
|
54
|
+
});
|
|
55
|
+
exports.ComboBoxDropdown.displayName = 'ComboBoxDropdown';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ComboBoxEndIcon: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
3
|
+
disabled?: boolean | undefined;
|
|
4
|
+
isOpen?: boolean | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|