@konturio/ui-kit
Advanced tools
Comparing version 3.0.0-alpha.60 to 3.0.0-alpha.61
{ | ||
"name": "@konturio/ui-kit", | ||
"version": "3.0.0-alpha.60", | ||
"version": "3.0.0-alpha.61", | ||
"repository": { | ||
@@ -32,3 +32,3 @@ "type": "git", | ||
}, | ||
"gitHead": "8ad4e086dad5476387f0919e49332080244fd33d" | ||
"gitHead": "cd8547afb31b77ce313d9db4162142bf015ea42a" | ||
} |
@@ -27,4 +27,5 @@ import React from 'react'; | ||
onSelect?: (selection: SelectItemType | SelectItemType[] | null | undefined) => void; | ||
onClose?: (selection: SelectItemType | SelectItemType[] | null | undefined) => void; | ||
} | ||
export declare const Select: ForwardRefComponent<"div", SelectProps>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -38,3 +38,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
export const Select = forwardRef((_a, ref) => { | ||
var { children, items, value, defaultValue, showSelectedIcon = true, showEntryIcon = false, multiselect, withResetButton = true, itemToString = defaultItemToString, label, placeholder, classes, className, disabled, error, type = 'classic', onChange, onSelect } = _a, props = __rest(_a, ["children", "items", "value", "defaultValue", "showSelectedIcon", "showEntryIcon", "multiselect", "withResetButton", "itemToString", "label", "placeholder", "classes", "className", "disabled", "error", "type", "onChange", "onSelect"]); | ||
var { children, items, value, defaultValue, showSelectedIcon = true, showEntryIcon = false, multiselect, withResetButton = true, itemToString = defaultItemToString, label, placeholder, classes, className, disabled, error, type = 'classic', onChange, onSelect, onClose } = _a, props = __rest(_a, ["children", "items", "value", "defaultValue", "showSelectedIcon", "showEntryIcon", "multiselect", "withResetButton", "itemToString", "label", "placeholder", "classes", "className", "disabled", "error", "type", "onChange", "onSelect", "onClose"]); | ||
const initialSelectedItem = !multiselect && value && items ? items.find((itm) => itm.value === value) : undefined; | ||
@@ -111,2 +111,7 @@ const defaultSelectedItem = !multiselect && defaultValue && items ? items.find((itm) => itm.value === defaultValue) : null; | ||
}, [onChange, onSelect, multiselect, selectedItems]); | ||
const onOpenChange = useCallback((changes) => { | ||
if (changes.isOpen && onClose && typeof onClose === 'function') { | ||
onClose(multiselect ? selectedItems : changes.selectedItem); | ||
} | ||
}, [onClose, multiselect, selectedItems]); | ||
const useSelectProps = { | ||
@@ -118,2 +123,3 @@ items, | ||
onSelectedItemChange: onSelectChange, | ||
onIsOpenChange: onOpenChange, | ||
}; | ||
@@ -120,0 +126,0 @@ if (multiselect) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
392504
6965