x-ui-design 0.6.44 → 0.6.46
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/dist/esm/types/components/Select/Select.d.ts +3 -3
- package/dist/esm/types/index.d.ts +50 -1
- package/dist/index.d.ts +52 -2
- package/dist/index.esm.js +84 -79
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +83 -78
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +128 -123
- package/package.json +1 -1
- package/src/app/page.tsx +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { SelectProps } from '../../types/select';
|
|
3
3
|
import './style.css';
|
|
4
|
-
declare const
|
|
4
|
+
declare const _default: React.MemoExoticComponent<{
|
|
5
5
|
({ prefixCls, id, searchValue, autoClearSearchValue, filterOption, optionFilterProp, children, options, listHeight, menuItemSelectedIcon, mode, value, defaultValue, maxCount, disabled, loading, placeholder, allowClear, filterable, defaultOpen, size, error, dropdownClassName, className, suffixIcon, searchIcon, style, showSearch, open, closeFromParent, showArrow, notFoundContent, noStyle, feedbackIcons, placement, removeIcon, maxTagCount, onSearch, onSelect, onDeselect, onClear, onChange, onClose, tagRender, getPopupContainer, dropdownRender, onDropdownVisibleChange, ref }: SelectProps): ReactElement;
|
|
6
6
|
displayName: string;
|
|
7
7
|
} & {
|
|
8
8
|
Option: React.FC<import("../../types/select").OptionProps>;
|
|
9
|
-
}
|
|
10
|
-
export default
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|
|
@@ -14,7 +14,56 @@ declare const Textarea: import("react").ComponentType<import("@/types/input").Te
|
|
|
14
14
|
declare const Radio: import("react").ComponentType<import("@/types/radio").RadioProps>;
|
|
15
15
|
declare const RadioButton: import("react").ComponentType<import("@/types/radio").RadioButtonProps>;
|
|
16
16
|
declare const RadioGroup: import("react").ComponentType<import("@/types/radio").RadioGroupProps>;
|
|
17
|
-
declare const Select: import("react").ComponentType<import("@/types
|
|
17
|
+
declare const Select: import("react").ComponentType<import("@/types").DefaultProps & {
|
|
18
|
+
id?: string;
|
|
19
|
+
searchValue?: string;
|
|
20
|
+
onSearch?: (value: string) => void;
|
|
21
|
+
autoClearSearchValue?: boolean;
|
|
22
|
+
onSelect?: (value: import("@/types").RuleTypes, option?: import("@/types/select").OptionType) => void;
|
|
23
|
+
onDeselect?: (value: string, option?: import("@/types/select").OptionType) => void;
|
|
24
|
+
filterOption?: boolean | ((input: string, option: import("@/types/select").OptionType) => boolean);
|
|
25
|
+
optionFilterProp?: string;
|
|
26
|
+
options?: import("@/types/select").OptionType[];
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
defaultActiveFirstOption?: boolean;
|
|
29
|
+
listHeight?: number;
|
|
30
|
+
menuItemSelectedIcon?: import("react").ReactNode;
|
|
31
|
+
mode?: "default" | "multiple" | "tags";
|
|
32
|
+
value?: import("@/types").RuleTypes;
|
|
33
|
+
defaultValue?: import("@/types").RuleTypes;
|
|
34
|
+
maxCount?: number;
|
|
35
|
+
onChange?: (e: import("@/types").RuleTypes, option?: import("@/types/select").OptionType) => void;
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
allowClear?: boolean;
|
|
41
|
+
filterable?: boolean;
|
|
42
|
+
defaultOpen?: boolean;
|
|
43
|
+
size?: "small" | "middle" | "large";
|
|
44
|
+
onClear?: () => void;
|
|
45
|
+
error?: boolean;
|
|
46
|
+
showSearch?: boolean;
|
|
47
|
+
tagRender?: ((props: import("@/types/select").CustomTagProps) => import("react").ReactElement) | undefined;
|
|
48
|
+
maxTagPlaceholder?: import("react").ReactNode | ((omittedValues: import("@/types/select").DisplayValueType[]) => import("react").ReactNode);
|
|
49
|
+
dropdownClassName?: string;
|
|
50
|
+
showArrow?: boolean;
|
|
51
|
+
onBlur?: import("react").FocusEventHandler<HTMLElement> | undefined;
|
|
52
|
+
onDropdownVisibleChange?: ((open: boolean, selected: import("@/types").RuleType) => void) | undefined;
|
|
53
|
+
showAction?: ("click" | "focus")[] | undefined;
|
|
54
|
+
suffixIcon?: import("react").ReactNode;
|
|
55
|
+
searchIcon?: import("react").ReactNode;
|
|
56
|
+
open?: boolean;
|
|
57
|
+
notFoundContent?: import("react").ReactNode;
|
|
58
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
59
|
+
dropdownRender?: (menu: import("react").ReactNode) => import("react").ReactNode;
|
|
60
|
+
feedbackIcons?: boolean;
|
|
61
|
+
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
|
|
62
|
+
removeIcon?: import("react").ReactNode;
|
|
63
|
+
maxTagCount?: number | "responsive";
|
|
64
|
+
ref?: import("react").ForwardedRef<HTMLDivElement>;
|
|
65
|
+
closeFromParent?: boolean;
|
|
66
|
+
}>;
|
|
18
67
|
declare const Option: import("react").ComponentType<import("@/types/select").OptionProps>;
|
|
19
68
|
declare const Tag: import("react").ComponentType<import("@/types/select").CustomTagProps>;
|
|
20
69
|
declare const Skeleton: import("react").ComponentType<import("./types/skeleton").SkeletonProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import * as react from 'react';
|
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import * as __types_select from '@/types/select';
|
|
4
4
|
export { CustomTagProps, DisplayValueType, OptionProps, OptionType, SelectProps, TagProps } from '@/types/select';
|
|
5
|
+
import * as __types from '@/types';
|
|
6
|
+
export { DefaultProps, MouseEventHandlerSelect, RuleType, RuleTypes, SyntheticBaseEvent, TargetProps } from '@/types';
|
|
5
7
|
import * as __types_radio from '@/types/radio';
|
|
6
8
|
export { RadioButtonProps, RadioGroupProps, RadioProps } from '@/types/radio';
|
|
7
9
|
import * as __types_input from '@/types/input';
|
|
@@ -19,7 +21,6 @@ export { BaseButtonProps, ButtonProps, ButtonType } from '@/types/button';
|
|
|
19
21
|
export { ArrowIcon, CalendarIcon, CheckIcon, ClearIcon, DateDistanceIcon, ErrorIcon, LoadingIcon, SearchIcon, SpinerIcon, StampleIcon, SuccessIcon, TimeIcon, TrashIcon } from '@/components/Icons';
|
|
20
22
|
export { useForm } from '@/hooks/useForm';
|
|
21
23
|
export { useWatch } from '@/hooks/useWatch';
|
|
22
|
-
export { DefaultProps, MouseEventHandlerSelect, RuleType, RuleTypes, SyntheticBaseEvent, TargetProps } from '@/types';
|
|
23
24
|
export { FormContext } from '@/components/Form/Form';
|
|
24
25
|
export { clsx, createArray, parseValue } from '@/helpers';
|
|
25
26
|
export { flattenChildren } from '@/helpers/flatten';
|
|
@@ -117,7 +118,56 @@ declare const Textarea: react.ComponentType<__types_input.TextareaProps>;
|
|
|
117
118
|
declare const Radio: react.ComponentType<__types_radio.RadioProps>;
|
|
118
119
|
declare const RadioButton: react.ComponentType<__types_radio.RadioButtonProps>;
|
|
119
120
|
declare const RadioGroup: react.ComponentType<__types_radio.RadioGroupProps>;
|
|
120
|
-
declare const Select: react.ComponentType<
|
|
121
|
+
declare const Select: react.ComponentType<__types.DefaultProps & {
|
|
122
|
+
id?: string;
|
|
123
|
+
searchValue?: string;
|
|
124
|
+
onSearch?: (value: string) => void;
|
|
125
|
+
autoClearSearchValue?: boolean;
|
|
126
|
+
onSelect?: (value: __types.RuleTypes, option?: __types_select.OptionType) => void;
|
|
127
|
+
onDeselect?: (value: string, option?: __types_select.OptionType) => void;
|
|
128
|
+
filterOption?: boolean | ((input: string, option: __types_select.OptionType) => boolean);
|
|
129
|
+
optionFilterProp?: string;
|
|
130
|
+
options?: __types_select.OptionType[];
|
|
131
|
+
children?: react.ReactNode;
|
|
132
|
+
defaultActiveFirstOption?: boolean;
|
|
133
|
+
listHeight?: number;
|
|
134
|
+
menuItemSelectedIcon?: react.ReactNode;
|
|
135
|
+
mode?: "default" | "multiple" | "tags";
|
|
136
|
+
value?: __types.RuleTypes;
|
|
137
|
+
defaultValue?: __types.RuleTypes;
|
|
138
|
+
maxCount?: number;
|
|
139
|
+
onChange?: (e: __types.RuleTypes, option?: __types_select.OptionType) => void;
|
|
140
|
+
onClose?: () => void;
|
|
141
|
+
disabled?: boolean;
|
|
142
|
+
loading?: boolean;
|
|
143
|
+
placeholder?: string;
|
|
144
|
+
allowClear?: boolean;
|
|
145
|
+
filterable?: boolean;
|
|
146
|
+
defaultOpen?: boolean;
|
|
147
|
+
size?: "small" | "middle" | "large";
|
|
148
|
+
onClear?: () => void;
|
|
149
|
+
error?: boolean;
|
|
150
|
+
showSearch?: boolean;
|
|
151
|
+
tagRender?: ((props: __types_select.CustomTagProps) => react.ReactElement) | undefined;
|
|
152
|
+
maxTagPlaceholder?: react.ReactNode | ((omittedValues: __types_select.DisplayValueType[]) => react.ReactNode);
|
|
153
|
+
dropdownClassName?: string;
|
|
154
|
+
showArrow?: boolean;
|
|
155
|
+
onBlur?: react.FocusEventHandler<HTMLElement> | undefined;
|
|
156
|
+
onDropdownVisibleChange?: ((open: boolean, selected: __types.RuleType) => void) | undefined;
|
|
157
|
+
showAction?: ("click" | "focus")[] | undefined;
|
|
158
|
+
suffixIcon?: react.ReactNode;
|
|
159
|
+
searchIcon?: react.ReactNode;
|
|
160
|
+
open?: boolean;
|
|
161
|
+
notFoundContent?: react.ReactNode;
|
|
162
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
163
|
+
dropdownRender?: (menu: react.ReactNode) => react.ReactNode;
|
|
164
|
+
feedbackIcons?: boolean;
|
|
165
|
+
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
|
|
166
|
+
removeIcon?: react.ReactNode;
|
|
167
|
+
maxTagCount?: number | "responsive";
|
|
168
|
+
ref?: react.ForwardedRef<HTMLDivElement>;
|
|
169
|
+
closeFromParent?: boolean;
|
|
170
|
+
}>;
|
|
121
171
|
declare const Option: react.ComponentType<__types_select.OptionProps>;
|
|
122
172
|
declare const Tag: react.ComponentType<__types_select.CustomTagProps>;
|
|
123
173
|
declare const Skeleton: react.ComponentType<SkeletonProps>;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import require$$1 from 'react/jsx-runtime';
|
|
2
|
-
import React, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, createContext, useImperativeHandle, useCallback, useLayoutEffect } from 'react';
|
|
2
|
+
import React, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, createContext, useImperativeHandle, memo, useCallback, useLayoutEffect } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import ReactDOMServer from 'react-dom/server';
|
|
5
5
|
|
|
@@ -1340,7 +1340,7 @@ const RadioButton$1 = dynamic$1(() => Promise.resolve().then(function () { retur
|
|
|
1340
1340
|
const RadioGroup$1 = dynamic$1(() => Promise.resolve().then(function () { return Group; }), {
|
|
1341
1341
|
ssr: false
|
|
1342
1342
|
});
|
|
1343
|
-
const Select$
|
|
1343
|
+
const Select$3 = dynamic$1(() => Promise.resolve().then(function () { return Select$2; }), {
|
|
1344
1344
|
ssr: false
|
|
1345
1345
|
});
|
|
1346
1346
|
const Option$2 = dynamic$1(() => Promise.resolve().then(function () { return Option$1; }), {
|
|
@@ -3647,11 +3647,13 @@ const SelectComponent = ({
|
|
|
3647
3647
|
isOpen: isOpen
|
|
3648
3648
|
}));
|
|
3649
3649
|
}, [showArrow, showSearch, isOpen, suffixIcon, searchIcon]);
|
|
3650
|
-
const extractedOptions =
|
|
3650
|
+
const extractedOptions = useMemo(() => {
|
|
3651
|
+
return children ? extractOptions(children) : Array.isArray(options) ? options : [];
|
|
3652
|
+
}, [children, children]);
|
|
3651
3653
|
const triggerNode = useMemo(() => {
|
|
3652
3654
|
return selectRef.current?.querySelector(`.${prefixCls}-trigger`);
|
|
3653
3655
|
}, [prefixCls]);
|
|
3654
|
-
|
|
3656
|
+
const extractOptions = useCallback((children, options) => {
|
|
3655
3657
|
const result = [];
|
|
3656
3658
|
const flatten = nodes => {
|
|
3657
3659
|
try {
|
|
@@ -3675,7 +3677,7 @@ const SelectComponent = ({
|
|
|
3675
3677
|
return result;
|
|
3676
3678
|
}
|
|
3677
3679
|
return options || [];
|
|
3678
|
-
}
|
|
3680
|
+
}, []);
|
|
3679
3681
|
const filteredOptions = extractedOptions.filter(option => {
|
|
3680
3682
|
if (typeof filterOption === 'function') {
|
|
3681
3683
|
return filterOption(searchQuery, option);
|
|
@@ -3699,76 +3701,6 @@ const SelectComponent = ({
|
|
|
3699
3701
|
setSearchInputWidth(searchContent.clientWidth - PADDING_TAG_INPUT);
|
|
3700
3702
|
}
|
|
3701
3703
|
};
|
|
3702
|
-
const dropdownContent = !loading && open && isOpen && /*#__PURE__*/React.createElement("div", {
|
|
3703
|
-
className: clsx([`${prefixCls}-dropdown`, {
|
|
3704
|
-
[placement]: placement,
|
|
3705
|
-
[dropdownClassName]: dropdownClassName
|
|
3706
|
-
}]),
|
|
3707
|
-
style: {
|
|
3708
|
-
...dropdownPosition,
|
|
3709
|
-
maxHeight: dropdownRender ? 'unset' : listHeight,
|
|
3710
|
-
opacity: Object.keys(dropdownPosition).length ? 1 : 0
|
|
3711
|
-
}
|
|
3712
|
-
}, filterable && /*#__PURE__*/React.createElement("input", {
|
|
3713
|
-
type: "text",
|
|
3714
|
-
inputMode: "text",
|
|
3715
|
-
className: `${prefixCls}-search`,
|
|
3716
|
-
value: searchQuery,
|
|
3717
|
-
onChange: handleSearch,
|
|
3718
|
-
placeholder: "Search..."
|
|
3719
|
-
}), !loading &&
|
|
3720
|
-
/*#__PURE__*/
|
|
3721
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3722
|
-
// @ts-expect-error
|
|
3723
|
-
React.createElement(ConditionalWrapper, {
|
|
3724
|
-
wrapper: element => {
|
|
3725
|
-
return dropdownRender?.(element || /*#__PURE__*/React.createElement(React.Fragment, null, " ")) || /*#__PURE__*/React.createElement(React.Fragment, null, " ");
|
|
3726
|
-
},
|
|
3727
|
-
condition: !!dropdownRender
|
|
3728
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
3729
|
-
className: `${prefixCls}-options`,
|
|
3730
|
-
style: {
|
|
3731
|
-
maxHeight: listHeight,
|
|
3732
|
-
overflowY: 'auto',
|
|
3733
|
-
// display: !filteredOptions.length && asTag ? 'none' : 'block',
|
|
3734
|
-
maxWidth: selectRef.current ? `${selectRef.current.getBoundingClientRect().width}px` : 'inherit'
|
|
3735
|
-
}
|
|
3736
|
-
}, asTag && !!searchQuery && /*#__PURE__*/React.createElement(Option, {
|
|
3737
|
-
value: searchQuery,
|
|
3738
|
-
className: `${prefixCls}-focused`,
|
|
3739
|
-
onClick: e => {
|
|
3740
|
-
handleSelect(e, searchQuery);
|
|
3741
|
-
},
|
|
3742
|
-
"data-value": searchQuery
|
|
3743
|
-
}, searchQuery), filteredOptions.length ? filteredOptions.map(({
|
|
3744
|
-
children,
|
|
3745
|
-
className = '',
|
|
3746
|
-
...props
|
|
3747
|
-
}, index) => {
|
|
3748
|
-
const isSelected = hasMode ? selected.includes(props.value) : props.value === selected;
|
|
3749
|
-
return /*#__PURE__*/React.createElement(Option, _extends({
|
|
3750
|
-
key: `${props.value}_${index}`
|
|
3751
|
-
}, props, {
|
|
3752
|
-
selected: isSelected,
|
|
3753
|
-
className: clsx([className, {
|
|
3754
|
-
[`${prefixCls}-focused`]: hasMode ? isSelected : props.value === selected,
|
|
3755
|
-
[`${prefixCls}-disabled`]: maxCount && hasMode && !isSelected ? selected.length >= maxCount : false
|
|
3756
|
-
}]),
|
|
3757
|
-
onClick: e => {
|
|
3758
|
-
if (props.disabled) {
|
|
3759
|
-
return;
|
|
3760
|
-
}
|
|
3761
|
-
handleSelect(e, props.value, {
|
|
3762
|
-
children,
|
|
3763
|
-
className,
|
|
3764
|
-
...props
|
|
3765
|
-
});
|
|
3766
|
-
},
|
|
3767
|
-
"data-value": props.value
|
|
3768
|
-
}), children || props.label || props.value, menuItemSelectedIcon && hasMode && isSelected && /*#__PURE__*/React.createElement("span", {
|
|
3769
|
-
className: `${prefixCls}-selected-icon`
|
|
3770
|
-
}, menuItemSelectedIcon === true ? /*#__PURE__*/React.createElement(CheckIcon, null) : menuItemSelectedIcon));
|
|
3771
|
-
}) : !asTag ? notFoundContent || /*#__PURE__*/React.createElement(EmptyContent, null) : null)));
|
|
3772
3704
|
const selectedOption = (() => {
|
|
3773
3705
|
const option = extractedOptions.find(e => e.value === selected || e.label === selected || e.children === selected) || selected;
|
|
3774
3706
|
return option?.children || option?.label || option?.value || null;
|
|
@@ -3905,16 +3837,89 @@ const SelectComponent = ({
|
|
|
3905
3837
|
className: `${prefixCls}-arrow`
|
|
3906
3838
|
}, ArrowContainer, error && feedbackIcons ? /*#__PURE__*/React.createElement(ErrorIcon, null) : null), loading && /*#__PURE__*/React.createElement("span", {
|
|
3907
3839
|
className: `${prefixCls}-loading`
|
|
3908
|
-
}, /*#__PURE__*/React.createElement(LoadingIcon, null)))),
|
|
3840
|
+
}, /*#__PURE__*/React.createElement(LoadingIcon, null)))), /*#__PURE__*/React.createElement(ConditionalWrapper, {
|
|
3841
|
+
condition: getPopupContainer !== undefined,
|
|
3842
|
+
wrapper: element => getPopupContainer ? /*#__PURE__*/createPortal(element, getPopupContainer(triggerNode)) : /*#__PURE__*/React.createElement(React.Fragment, null, element)
|
|
3843
|
+
}, !loading && open && isOpen && /*#__PURE__*/React.createElement("div", {
|
|
3844
|
+
className: clsx([`${prefixCls}-dropdown`, {
|
|
3845
|
+
[placement]: placement,
|
|
3846
|
+
[dropdownClassName]: dropdownClassName
|
|
3847
|
+
}]),
|
|
3848
|
+
style: {
|
|
3849
|
+
...dropdownPosition,
|
|
3850
|
+
maxHeight: dropdownRender ? 'unset' : listHeight,
|
|
3851
|
+
opacity: Object.keys(dropdownPosition).length ? 1 : 0
|
|
3852
|
+
}
|
|
3853
|
+
}, filterable && /*#__PURE__*/React.createElement("input", {
|
|
3854
|
+
type: "text",
|
|
3855
|
+
inputMode: "text",
|
|
3856
|
+
className: `${prefixCls}-search`,
|
|
3857
|
+
value: searchQuery,
|
|
3858
|
+
onChange: handleSearch,
|
|
3859
|
+
placeholder: "Search..."
|
|
3860
|
+
}), !loading &&
|
|
3861
|
+
/*#__PURE__*/
|
|
3862
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3863
|
+
// @ts-expect-error
|
|
3864
|
+
React.createElement(ConditionalWrapper, {
|
|
3865
|
+
wrapper: element => {
|
|
3866
|
+
return dropdownRender?.(element || /*#__PURE__*/React.createElement(React.Fragment, null, " ")) || /*#__PURE__*/React.createElement(React.Fragment, null, " ");
|
|
3867
|
+
},
|
|
3868
|
+
condition: !!dropdownRender
|
|
3869
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3870
|
+
className: `${prefixCls}-options`,
|
|
3871
|
+
style: {
|
|
3872
|
+
maxHeight: listHeight,
|
|
3873
|
+
overflowY: 'auto',
|
|
3874
|
+
// display: !filteredOptions.length && asTag ? 'none' : 'block',
|
|
3875
|
+
maxWidth: selectRef.current ? `${selectRef.current.getBoundingClientRect().width}px` : 'inherit'
|
|
3876
|
+
}
|
|
3877
|
+
}, asTag && !!searchQuery && /*#__PURE__*/React.createElement(Option, {
|
|
3878
|
+
value: searchQuery,
|
|
3879
|
+
className: `${prefixCls}-focused`,
|
|
3880
|
+
onClick: e => {
|
|
3881
|
+
handleSelect(e, searchQuery);
|
|
3882
|
+
},
|
|
3883
|
+
"data-value": searchQuery
|
|
3884
|
+
}, searchQuery), filteredOptions.length ? filteredOptions.map(({
|
|
3885
|
+
children,
|
|
3886
|
+
className = '',
|
|
3887
|
+
...props
|
|
3888
|
+
}, index) => {
|
|
3889
|
+
const isSelected = hasMode ? selected.includes(props.value) : props.value === selected;
|
|
3890
|
+
return /*#__PURE__*/React.createElement(Option, _extends({
|
|
3891
|
+
key: `${props.value}_${index}`
|
|
3892
|
+
}, props, {
|
|
3893
|
+
selected: isSelected,
|
|
3894
|
+
className: clsx([className, {
|
|
3895
|
+
[`${prefixCls}-focused`]: hasMode ? isSelected : props.value === selected,
|
|
3896
|
+
[`${prefixCls}-disabled`]: maxCount && hasMode && !isSelected ? selected.length >= maxCount : false
|
|
3897
|
+
}]),
|
|
3898
|
+
onClick: e => {
|
|
3899
|
+
if (props.disabled) {
|
|
3900
|
+
return;
|
|
3901
|
+
}
|
|
3902
|
+
handleSelect(e, props.value, {
|
|
3903
|
+
children,
|
|
3904
|
+
className,
|
|
3905
|
+
...props
|
|
3906
|
+
});
|
|
3907
|
+
},
|
|
3908
|
+
"data-value": props.value
|
|
3909
|
+
}), children || props.label || props.value, menuItemSelectedIcon && hasMode && isSelected && /*#__PURE__*/React.createElement("span", {
|
|
3910
|
+
className: `${prefixCls}-selected-icon`
|
|
3911
|
+
}, menuItemSelectedIcon === true ? /*#__PURE__*/React.createElement(CheckIcon, null) : menuItemSelectedIcon));
|
|
3912
|
+
}) : !asTag ? notFoundContent || /*#__PURE__*/React.createElement(EmptyContent, null) : null)))));
|
|
3909
3913
|
};
|
|
3910
3914
|
SelectComponent.displayName = 'Select';
|
|
3911
3915
|
const Select = Object.assign(SelectComponent, {
|
|
3912
3916
|
Option
|
|
3913
3917
|
});
|
|
3918
|
+
var Select$1 = /*#__PURE__*/memo(Select);
|
|
3914
3919
|
|
|
3915
|
-
var Select$
|
|
3920
|
+
var Select$2 = /*#__PURE__*/Object.freeze({
|
|
3916
3921
|
__proto__: null,
|
|
3917
|
-
default: Select
|
|
3922
|
+
default: Select$1
|
|
3918
3923
|
});
|
|
3919
3924
|
|
|
3920
3925
|
var css_248z$4 = "@keyframes xUi-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.xUi-skeleton-element{display:inline-block!important;width:auto!important}.xUi-skeleton-button{background:hsla(0,0%,75%,.2);border-radius:4px;display:inline-block;height:32px;line-height:32px;min-width:64px;vertical-align:top;width:64px}.xUi-skeleton-button-sm{height:24px;line-height:24px;min-width:48px;width:48px}.xUi-skeleton-button-lg{height:44px;line-height:44px;min-width:80px;width:80px}.xUi-skeleton-active .xUi-skeleton-button{animation:xUi-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);background-size:400% 100%}";
|
|
@@ -4138,5 +4143,5 @@ var Skeleton$1 = /*#__PURE__*/Object.freeze({
|
|
|
4138
4143
|
default: Skeleton
|
|
4139
4144
|
});
|
|
4140
4145
|
|
|
4141
|
-
export { ArrowIcon, Button$3 as Button, CalendarIcon, CheckIcon, Checkbox$2 as Checkbox, ClearIcon, DateDistanceIcon, DatePicker$2 as DatePicker, Empty$1 as Empty, ErrorIcon, Form, FormContext, FormItem, Input$3 as Input, LoadingIcon, Option$2 as Option, Radio$2 as Radio, RadioButton$1 as RadioButton, RadioGroup$1 as RadioGroup, RangePicker$2 as RangePicker, SearchIcon, Select$
|
|
4146
|
+
export { ArrowIcon, Button$3 as Button, CalendarIcon, CheckIcon, Checkbox$2 as Checkbox, ClearIcon, DateDistanceIcon, DatePicker$2 as DatePicker, Empty$1 as Empty, ErrorIcon, Form, FormContext, FormItem, Input$3 as Input, LoadingIcon, Option$2 as Option, Radio$2 as Radio, RadioButton$1 as RadioButton, RadioGroup$1 as RadioGroup, RangePicker$2 as RangePicker, SearchIcon, Select$3 as Select, Skeleton$2 as Skeleton, SkeletonAvatar$1 as SkeletonAvatar, SkeletonButton$1 as SkeletonButton, SkeletonImage$1 as SkeletonImage, SkeletonInput$1 as SkeletonInput, SpinerIcon, StampleIcon, SuccessIcon, Switch$2 as Switch, Tag$2 as Tag, Textarea$2 as Textarea, TimeIcon, TimePicker$2 as TimePicker, TrashIcon, Upload$2 as Upload, clsx, createArray, flattenChildren, parseValue, useForm, useWatch };
|
|
4142
4147
|
//# sourceMappingURL=index.esm.js.map
|