fis-component 0.0.70 → 0.0.72
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/cjs/index.js +58 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Combobox/types.d.ts +1 -0
- package/dist/cjs/types/src/components/Input/InputDate/index.d.ts +1 -0
- package/dist/cjs/types/src/components/MenuSelect/styles.d.ts +3 -1
- package/dist/cjs/types/src/components/MenuSelect/types.d.ts +1 -0
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/cjs/types/src/components/Select/styles.d.ts +3 -1
- package/dist/cjs/types/src/components/Select/types.d.ts +1 -0
- package/dist/cjs/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/esm/index.js +58 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Combobox/types.d.ts +1 -0
- package/dist/esm/types/src/components/Input/InputDate/index.d.ts +1 -0
- package/dist/esm/types/src/components/MenuSelect/styles.d.ts +3 -1
- package/dist/esm/types/src/components/MenuSelect/types.d.ts +1 -0
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/esm/types/src/components/Select/styles.d.ts +3 -1
- package/dist/esm/types/src/components/Select/types.d.ts +1 -0
- package/dist/esm/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { InputFieldProps } from "../InputField";
|
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import { InputLabelProps } from "../InputLabel";
|
|
4
4
|
export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChange">, Partial<InputLabelProps> {
|
|
5
|
+
className?: string | undefined;
|
|
5
6
|
/**Date value*/
|
|
6
7
|
value?: Date | null;
|
|
7
8
|
/**Format Date*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const DivContainerSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
1
|
+
export declare const DivContainerSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
|
+
$maxHeight?: string | number;
|
|
3
|
+
}>> & string;
|
|
2
4
|
export declare const DivLoaderSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
5
|
export declare const DivIconDataSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
6
|
export declare const PTitleSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
@@ -13,3 +13,5 @@ export declare const Loading: import("@storybook/core/csf").AnnotatedStoryFn<imp
|
|
|
13
13
|
export declare const LargeSize: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
14
14
|
export declare const Disabled: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
15
15
|
export declare const NumberType: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, NumberSelectStoryProps>;
|
|
16
|
+
export declare const CustomMaxHeight: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
17
|
+
export declare const TextEllipsis: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const DivWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
-
export declare const DivInputWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
2
|
+
export declare const DivInputWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$hasValue?: boolean;
|
|
4
|
+
}>> & string;
|
|
3
5
|
export declare const DivDropdownMenuSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
6
|
export declare const SelectedTagsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -18,6 +18,7 @@ type BaseSelectProps<T extends string | number> = Partial<InputLabelProps> & Omi
|
|
|
18
18
|
multiDisplayText?: (count: number) => string;
|
|
19
19
|
renderOption?: (option: SelectOption<T>) => React.ReactNode;
|
|
20
20
|
portal?: boolean;
|
|
21
|
+
maxHeight?: string | number;
|
|
21
22
|
};
|
|
22
23
|
export type SingleSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
23
24
|
multi?: false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SelectSize } from ".";
|
|
2
2
|
interface SelectItemProps {
|
|
3
3
|
$size?: SelectSize;
|
|
4
|
+
$disabled?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare const InputSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, SelectItemProps>> & string;
|
|
6
7
|
export declare const DivWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SelectItemProps>> & string;
|
package/dist/esm/index.js
CHANGED
|
@@ -66317,7 +66317,11 @@ const DivContainerSC$4 = styled.div `
|
|
|
66317
66317
|
flex-direction: column;
|
|
66318
66318
|
width: unset;
|
|
66319
66319
|
min-width: ${getTheme("com/menu/min-width")};
|
|
66320
|
-
max-height: ${
|
|
66320
|
+
max-height: ${({ $maxHeight }) => $maxHeight
|
|
66321
|
+
? typeof $maxHeight === "number"
|
|
66322
|
+
? `${$maxHeight}px`
|
|
66323
|
+
: $maxHeight
|
|
66324
|
+
: getTheme("com/menu/max-height")};
|
|
66321
66325
|
border-radius: ${getTheme("com/menu/corner-radius")};
|
|
66322
66326
|
border: ${getTheme("com/menu/border/stroke-width")} solid
|
|
66323
66327
|
${getTheme("com/menu/border/color-stroke")};
|
|
@@ -66425,6 +66429,7 @@ const DivContentSC$2 = styled.div `
|
|
|
66425
66429
|
flex-direction: column;
|
|
66426
66430
|
flex: 1;
|
|
66427
66431
|
gap: ${getTheme("com/menu/item/vertical-gap")};
|
|
66432
|
+
min-width: 0;
|
|
66428
66433
|
`;
|
|
66429
66434
|
const DivPrefixIconSC = styled.div `
|
|
66430
66435
|
display: flex;
|
|
@@ -66484,6 +66489,10 @@ const DivPrefixIconSC = styled.div `
|
|
|
66484
66489
|
`;
|
|
66485
66490
|
const PTitleSC$1 = styled.p `
|
|
66486
66491
|
margin: 0;
|
|
66492
|
+
white-space: nowrap;
|
|
66493
|
+
overflow: hidden;
|
|
66494
|
+
text-overflow: ellipsis;
|
|
66495
|
+
min-width: 0;
|
|
66487
66496
|
|
|
66488
66497
|
${(props) => {
|
|
66489
66498
|
switch (props.$type) {
|
|
@@ -66535,6 +66544,10 @@ const PTitleSC$1 = styled.p `
|
|
|
66535
66544
|
`;
|
|
66536
66545
|
const PDescriptionSC = styled.p `
|
|
66537
66546
|
margin: 0;
|
|
66547
|
+
white-space: nowrap;
|
|
66548
|
+
overflow: hidden;
|
|
66549
|
+
text-overflow: ellipsis;
|
|
66550
|
+
min-width: 0;
|
|
66538
66551
|
|
|
66539
66552
|
${(props) => {
|
|
66540
66553
|
switch (props.$type) {
|
|
@@ -67350,10 +67363,16 @@ const DivContentSC$1 = styled.div `
|
|
|
67350
67363
|
padding-bottom: ${getTheme("sem/dimension/padding/2xs")};
|
|
67351
67364
|
padding-left: ${getTheme("com/menu/group-label/horizontal-padding")};
|
|
67352
67365
|
gap: 8px;
|
|
67366
|
+
min-width: 0;
|
|
67353
67367
|
`;
|
|
67354
67368
|
const SectionLabel = styled.span `
|
|
67355
67369
|
${getTheme("Subheading/Sm")}
|
|
67356
67370
|
color: ${getTheme("com/menu/group-label/color-text")};
|
|
67371
|
+
white-space: nowrap;
|
|
67372
|
+
overflow: hidden;
|
|
67373
|
+
text-overflow: ellipsis;
|
|
67374
|
+
min-width: 0;
|
|
67375
|
+
flex: 1;
|
|
67357
67376
|
`;
|
|
67358
67377
|
const ActionLink = styled.a `
|
|
67359
67378
|
${getTheme("Paragraph/Sm")};
|
|
@@ -67377,7 +67396,7 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
|
|
|
67377
67396
|
};
|
|
67378
67397
|
FISMenuSection.displayName = "FISMenuSection";
|
|
67379
67398
|
|
|
67380
|
-
const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, selectedValues = [], onChangeSelected, searchValue = "", onSearchChange, loading = false, noData = false, noResult = false, combobox, className, onClickMenu, loadingText = "Data loading...", noDataText = "No data", noResultText = "No result", removeSelectedText = "Remove selected", selectedGroupLabel = "Selected", }) => {
|
|
67399
|
+
const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, selectedValues = [], onChangeSelected, searchValue = "", onSearchChange, loading = false, noData = false, noResult = false, combobox, className, onClickMenu, loadingText = "Data loading...", noDataText = "No data", noResultText = "No result", removeSelectedText = "Remove selected", selectedGroupLabel = "Selected", maxHeight, }) => {
|
|
67381
67400
|
const [localSearch, setLocalSearch] = useState(searchValue);
|
|
67382
67401
|
useEffect(() => {
|
|
67383
67402
|
setLocalSearch(searchValue);
|
|
@@ -67458,7 +67477,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67458
67477
|
onClickMenu?.();
|
|
67459
67478
|
}
|
|
67460
67479
|
};
|
|
67461
|
-
return (jsxs(DivContainerSC$4, { className: className, children: [showInput && !combobox && (jsx(DivSearchSC, { children: jsx(FISInputText, { iconPrefix: jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoResultIcon, {}) }), jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoDataIcon, {}) }), jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxs(DivLoaderSC, { children: [jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxs(Fragment, { children: [jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxs(DivWrapperSC$4, { children: [index !== 0 && jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }, idx)))] }, index))) }), removeSelectedGroup && (jsx(FixedBottomSection, { children: jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsx(RemoveIcon, {}), negative: true }, idx))) }) }))] }))] }));
|
|
67480
|
+
return (jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, children: [showInput && !combobox && (jsx(DivSearchSC, { children: jsx(FISInputText, { iconPrefix: jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoResultIcon, {}) }), jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoDataIcon, {}) }), jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxs(DivLoaderSC, { children: [jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxs(Fragment, { children: [jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxs(DivWrapperSC$4, { children: [index !== 0 && jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }, idx)))] }, index))) }), removeSelectedGroup && (jsx(FixedBottomSection, { children: jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsx(RemoveIcon, {}), negative: true }, idx))) }) }))] }))] }));
|
|
67462
67481
|
};
|
|
67463
67482
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67464
67483
|
|
|
@@ -70753,7 +70772,7 @@ const MultipleValue = ({ options, onRemove }) => {
|
|
|
70753
70772
|
return (jsxs(DivChipButtonWrapperSC, { ref: containerRef, children: [options.map((option, index) => (jsx(DivChipButtonSC, { "$isVisible": isVisible(option), children: jsx(FISChipButton, { ref: (el) => (tagRefs.current[index] = el), size: "xs", label: option.label, closeable: true, onClickClose: () => handleRemove(option) }, `${option.value}-${index}`) }))), hiddenTagCount > 0 && (jsx(DivTagSC, { "$isVisible": true, children: jsx(FISChipButton, { label: `+${hiddenTagCount}`, size: "xs" }) }))] }));
|
|
70754
70773
|
};
|
|
70755
70774
|
|
|
70756
|
-
const FISCombobox = forwardRef(({ className, options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, noResultText = "Không tìm thấy kết quả", ...restProps }, ref) => {
|
|
70775
|
+
const FISCombobox = forwardRef(({ className, options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, noResultText = "Không tìm thấy kết quả", maxHeight, ...restProps }, ref) => {
|
|
70757
70776
|
const [isOpen, setIsOpen] = useState(false);
|
|
70758
70777
|
const [searchValue, setSearchValue] = useState("");
|
|
70759
70778
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
@@ -70859,7 +70878,7 @@ const FISCombobox = forwardRef(({ className, options, value, disabled = false, t
|
|
|
70859
70878
|
}, [filteredOptions, searchValue]);
|
|
70860
70879
|
return (jsxs(DivWrapperSC$3, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC$2, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISInputField, { ...restProps, ref: ref, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: isOpen && searchValue !== undefined
|
|
70861
70880
|
? searchValue
|
|
70862
|
-
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "$isPointer": true }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper$1, { children: jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { children: jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsx(FISMenuSelect, { groups: filteredOptions, placeholder: placeholderSearch, loading: loading, multi: multi, combobox: true, noResult: hasNoResults, noResultText: noResultText, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
|
|
70881
|
+
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "$isPointer": true }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper$1, { children: jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { children: jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsx(FISMenuSelect, { groups: filteredOptions, placeholder: placeholderSearch, loading: loading, multi: multi, combobox: true, noResult: hasNoResults, noResultText: noResultText, maxHeight: maxHeight, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
|
|
70863
70882
|
if (multi) {
|
|
70864
70883
|
onChange(values);
|
|
70865
70884
|
}
|
|
@@ -71023,7 +71042,7 @@ function mergeRefs(...refs) {
|
|
|
71023
71042
|
}
|
|
71024
71043
|
|
|
71025
71044
|
const FISInputDate = forwardRef((props, ref) => {
|
|
71026
|
-
const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71045
|
+
const { className, value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71027
71046
|
const [open, setOpen] = useState(false);
|
|
71028
71047
|
const [inputValue, setInputValue] = useState(value ? dayjs(value).format(format) : "");
|
|
71029
71048
|
const [dateValue, setDateValue] = useState(value ? dayjs(value) : null);
|
|
@@ -71066,7 +71085,7 @@ const FISInputDate = forwardRef((props, ref) => {
|
|
|
71066
71085
|
onChange?.(null);
|
|
71067
71086
|
}
|
|
71068
71087
|
};
|
|
71069
|
-
return (jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxs(DivInputWrapperSC$1, { children: [jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsx(DivHintWrapperSC$1, { children: jsx(SpanHintSC$3, { className: classNames({
|
|
71088
|
+
return (jsxs(DivWrapperSC$2, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxs(DivInputWrapperSC$1, { children: [jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsx(DivHintWrapperSC$1, { children: jsx(SpanHintSC$3, { className: classNames({
|
|
71070
71089
|
disabled,
|
|
71071
71090
|
negative,
|
|
71072
71091
|
positive,
|
|
@@ -73066,10 +73085,27 @@ const DivWrapperSC$1 = styled.div `
|
|
|
73066
73085
|
flex-direction: column;
|
|
73067
73086
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
73068
73087
|
`;
|
|
73088
|
+
const preventSelection = css `
|
|
73089
|
+
user-select: none !important;
|
|
73090
|
+
-webkit-user-select: none !important;
|
|
73091
|
+
-moz-user-select: none !important;
|
|
73092
|
+
-ms-user-select: none !important;
|
|
73093
|
+
cursor: pointer !important;
|
|
73094
|
+
`;
|
|
73069
73095
|
const DivInputWrapperSC = styled.div `
|
|
73070
73096
|
position: relative;
|
|
73071
73097
|
display: inline-block;
|
|
73072
73098
|
width: 100%;
|
|
73099
|
+
|
|
73100
|
+
${(props) => props.$hasValue &&
|
|
73101
|
+
css `
|
|
73102
|
+
${preventSelection}
|
|
73103
|
+
|
|
73104
|
+
input {
|
|
73105
|
+
${preventSelection}
|
|
73106
|
+
pointer-events: none;
|
|
73107
|
+
}
|
|
73108
|
+
`}
|
|
73073
73109
|
`;
|
|
73074
73110
|
const DivDropdownMenuSC = styled.div `
|
|
73075
73111
|
/* margin-top: ${getTheme("com/select/vertical-gap")}; */
|
|
@@ -73093,6 +73129,10 @@ const InputSC = styled.input `
|
|
|
73093
73129
|
border: none;
|
|
73094
73130
|
background: transparent;
|
|
73095
73131
|
outline: none;
|
|
73132
|
+
white-space: nowrap;
|
|
73133
|
+
overflow: hidden;
|
|
73134
|
+
text-overflow: ellipsis;
|
|
73135
|
+
min-width: 0;
|
|
73096
73136
|
|
|
73097
73137
|
${(props) => {
|
|
73098
73138
|
switch (props.$size) {
|
|
@@ -73165,6 +73205,7 @@ const DivWrapperSC = styled.div `
|
|
|
73165
73205
|
justify-content: space-between;
|
|
73166
73206
|
padding-right: ${getTheme("com/select/field/right-padding")};
|
|
73167
73207
|
padding-left: ${getTheme("com/select/field/left-padding")};
|
|
73208
|
+
min-width: 0;
|
|
73168
73209
|
`;
|
|
73169
73210
|
const DivIconPrefixSC = styled.div `
|
|
73170
73211
|
display: flex;
|
|
@@ -73199,7 +73240,7 @@ const DivIconSuffixSC = styled.div `
|
|
|
73199
73240
|
flex-shrink: 0;
|
|
73200
73241
|
align-items: center;
|
|
73201
73242
|
justify-content: center;
|
|
73202
|
-
cursor: pointer;
|
|
73243
|
+
cursor: ${(props) => (props.$disabled ? "not-allowed" : "pointer")};
|
|
73203
73244
|
color: ${getTheme("com/select/field/right-icon/color-icon")};
|
|
73204
73245
|
|
|
73205
73246
|
${(props) => {
|
|
@@ -73342,7 +73383,7 @@ const FISSelectItem = forwardRef((props, ref) => {
|
|
|
73342
73383
|
return (jsx(DivContainerSC, { className: classNames({
|
|
73343
73384
|
iconPrefix: iconPrefix,
|
|
73344
73385
|
negative: negative,
|
|
73345
|
-
}), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
|
|
73386
|
+
}), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, "$disabled": disabled, children: iconSuffix }))] }) }));
|
|
73346
73387
|
});
|
|
73347
73388
|
FISSelectItem.displayName = "FISSelectItem";
|
|
73348
73389
|
|
|
@@ -73350,7 +73391,7 @@ function isMenuSize(value) {
|
|
|
73350
73391
|
return value === "sm" || value === "md";
|
|
73351
73392
|
}
|
|
73352
73393
|
|
|
73353
|
-
const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, ...restProps }, ref) => {
|
|
73394
|
+
const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, maxHeight, ...restProps }, ref) => {
|
|
73354
73395
|
const [isOpen, setIsOpen] = useState(false);
|
|
73355
73396
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
73356
73397
|
const [popperElement, setPopperElement] = useState(null);
|
|
@@ -73435,8 +73476,10 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
|
|
|
73435
73476
|
onChange(values);
|
|
73436
73477
|
}
|
|
73437
73478
|
else {
|
|
73438
|
-
|
|
73439
|
-
|
|
73479
|
+
if (values.length > 0) {
|
|
73480
|
+
onChange(values[0]);
|
|
73481
|
+
setIsOpen(false);
|
|
73482
|
+
}
|
|
73440
73483
|
}
|
|
73441
73484
|
}, [multi, onChange]);
|
|
73442
73485
|
const handleMenuClick = useCallback(() => {
|
|
@@ -73459,6 +73502,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
|
|
|
73459
73502
|
onClickMenu: handleMenuClick,
|
|
73460
73503
|
searchValue,
|
|
73461
73504
|
onSearchChange,
|
|
73505
|
+
maxHeight,
|
|
73462
73506
|
...restProps,
|
|
73463
73507
|
}), [
|
|
73464
73508
|
options,
|
|
@@ -73471,6 +73515,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
|
|
|
73471
73515
|
handleMenuClick,
|
|
73472
73516
|
searchValue,
|
|
73473
73517
|
onSearchChange,
|
|
73518
|
+
maxHeight,
|
|
73474
73519
|
restProps,
|
|
73475
73520
|
]);
|
|
73476
73521
|
useEffect(() => {
|
|
@@ -73485,7 +73530,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
|
|
|
73485
73530
|
document.addEventListener("mousedown", handleClickOutside);
|
|
73486
73531
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73487
73532
|
}, [referenceElement, popperElement]);
|
|
73488
|
-
return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73533
|
+
return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73489
73534
|
...styles.popper,
|
|
73490
73535
|
width: referenceElement?.offsetWidth,
|
|
73491
73536
|
zIndex: 9999,
|