feat(ui): move to React 18 and base for using shadcn/ui (#4174)
Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
This commit is contained in:
1 parent
72b63dcd6a
commit
70f2c797f4
153 files changed
+2973
-2043
No files matched your search
@@ -42,20 +42,20 @@ const Option = props => {
|
||||
|
||||
const Select = ({
|
||||
id,
|
||||
className,
|
||||
closeMenuOnSelect,
|
||||
hideSelectedOptions,
|
||||
isClearable,
|
||||
isDisabled,
|
||||
isMulti,
|
||||
isSearchable,
|
||||
className = '',
|
||||
closeMenuOnSelect = true,
|
||||
hideSelectedOptions = false,
|
||||
isClearable = true,
|
||||
isDisabled = false,
|
||||
isMulti = false,
|
||||
isSearchable = true,
|
||||
onChange,
|
||||
options,
|
||||
placeholder,
|
||||
noIcons,
|
||||
menuPlacement,
|
||||
components,
|
||||
value,
|
||||
noIcons = false,
|
||||
menuPlacement = 'auto',
|
||||
components = {},
|
||||
value = [],
|
||||
}) => {
|
||||
const _noIconComponents = {
|
||||
DropdownIndicator: () => null,
|
||||
@@ -96,11 +96,9 @@ const Select = ({
|
||||
options={options}
|
||||
blurInputOnSelect={true}
|
||||
menuPortalTarget={document.body}
|
||||
styles={
|
||||
{
|
||||
menuPortal: base => ({ ...base, zIndex: 9999 }),
|
||||
}
|
||||
}
|
||||
styles={{
|
||||
menuPortal: base => ({ ...base, zIndex: 9999 }),
|
||||
}}
|
||||
value={value && Array.isArray(value) ? selectedOptions : value}
|
||||
onChange={(selectedOptions, { action }) => {
|
||||
const newSelection = !selectedOptions.length
|
||||
@@ -112,20 +110,6 @@ const Select = ({
|
||||
);
|
||||
};
|
||||
|
||||
Select.defaultProps = {
|
||||
className: '',
|
||||
closeMenuOnSelect: true,
|
||||
hideSelectedOptions: false,
|
||||
isClearable: true,
|
||||
components: {},
|
||||
isDisabled: false,
|
||||
isMulti: false,
|
||||
isSearchable: true,
|
||||
noIcons: false,
|
||||
menuPlacement: 'auto',
|
||||
value: [],
|
||||
};
|
||||
|
||||
Select.propTypes = {
|
||||
className: PropTypes.string,
|
||||
closeMenuOnSelect: PropTypes.bool,
|
||||
|
||||
Reference in new issue
Block a user