@skedulo/sked-ui 21.7.4 → 21.8.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.
|
@@ -3,4 +3,4 @@ import { ISelectItem, SelectBox } from './interfaces';
|
|
|
3
3
|
/**
|
|
4
4
|
* A searchable select component. Just like it's native counterpart, only a valid listed option is allowed.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SearchSelect: <T extends ISelectItem<any>>({ id, name, items, placeholder, autoFocus, className, icon, onSelectedItemChange, disabled, onMenuToggle, loading, itemToString, ItemRenderer, filterHandler, itemIsValid, getNewItemData, ...rest }: SelectBox<T>) => JSX.Element;
|
|
6
|
+
export declare const SearchSelect: <T extends ISelectItem<any>>({ id, name, items, placeholder, autoFocus, className, icon, onSelectedItemChange, disabled, onMenuToggle, loading, itemToString, ItemRenderer, filterHandler, itemIsValid, getNewItemData, inputProps, ...rest }: SelectBox<T>) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
2
|
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
3
|
+
import { DOMAttributes } from 'react';
|
|
3
4
|
import { IconNames } from '../../icon/Icon';
|
|
4
5
|
export interface ISelectItem<T = any> {
|
|
5
6
|
value: T;
|
|
@@ -83,6 +84,8 @@ interface ISelectBox<T extends ISelectItem> extends ISearchSelect<T> {
|
|
|
83
84
|
export declare type SelectBox<T extends ISelectItem> = ISelectBox<T> & CommonComboBoxTypes<T> & Pick<UseComboboxProps<T>, 'initialSelectedItem' | 'selectedItem'> & {
|
|
84
85
|
onMenuToggle?: (isOpen: boolean) => void;
|
|
85
86
|
loading?: boolean;
|
|
87
|
+
} & {
|
|
88
|
+
inputProps?: DOMAttributes<HTMLDivElement>;
|
|
86
89
|
};
|
|
87
90
|
export declare type AsyncSelectBox<T extends ISelectItem> = Omit<SelectBox<T>, 'items' | 'itemIsValid' | 'getNewItemData'> & IAsyncSearchSelect<T>;
|
|
88
91
|
export interface IMultiSearchSelect<T extends ISelectItem> extends ISearchSelect<T> {
|
package/dist/index.js
CHANGED
|
@@ -45501,7 +45501,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45501
45501
|
|
|
45502
45502
|
|
|
45503
45503
|
|
|
45504
|
-
var _excluded = ["id", "name", "items", "placeholder", "autoFocus", "className", "icon", "onSelectedItemChange", "disabled", "onMenuToggle", "loading", "itemToString", "ItemRenderer", "filterHandler", "itemIsValid", "getNewItemData"];
|
|
45504
|
+
var _excluded = ["id", "name", "items", "placeholder", "autoFocus", "className", "icon", "onSelectedItemChange", "disabled", "onMenuToggle", "loading", "itemToString", "ItemRenderer", "filterHandler", "itemIsValid", "getNewItemData", "inputProps"];
|
|
45505
45505
|
|
|
45506
45506
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45507
45507
|
|
|
@@ -45550,6 +45550,7 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
45550
45550
|
label: input
|
|
45551
45551
|
}];
|
|
45552
45552
|
} : _ref$getNewItemData,
|
|
45553
|
+
restInputProps = _ref.inputProps,
|
|
45553
45554
|
rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_ref, _excluded);
|
|
45554
45555
|
|
|
45555
45556
|
var _React$useState = react__WEBPACK_IMPORTED_MODULE_3__["useState"](items),
|
|
@@ -45662,14 +45663,15 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
45662
45663
|
getItemProps = _useCombobox.getItemProps,
|
|
45663
45664
|
openMenu = _useCombobox.openMenu;
|
|
45664
45665
|
|
|
45665
|
-
var inputProps = {
|
|
45666
|
+
var inputProps = _objectSpread({
|
|
45666
45667
|
refKey: 'inputRef',
|
|
45667
45668
|
id: id,
|
|
45668
45669
|
onClick: openMenu,
|
|
45669
45670
|
name: name,
|
|
45670
45671
|
disabled: disabled,
|
|
45671
45672
|
autoFocus: autoFocus
|
|
45672
|
-
};
|
|
45673
|
+
}, restInputProps);
|
|
45674
|
+
|
|
45673
45675
|
var trigger = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["createElement"](_select_components__WEBPACK_IMPORTED_MODULE_9__["SearchSelectTrigger"], {
|
|
45674
45676
|
comboboxProps: // @ts-ignore: suppressRefError isn't in the types
|
|
45675
45677
|
getComboboxProps({}, {
|