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
package/dist/cjs/index.js
CHANGED
|
@@ -66337,7 +66337,11 @@ const DivContainerSC$4 = styled.div `
|
|
|
66337
66337
|
flex-direction: column;
|
|
66338
66338
|
width: unset;
|
|
66339
66339
|
min-width: ${getTheme("com/menu/min-width")};
|
|
66340
|
-
max-height: ${
|
|
66340
|
+
max-height: ${({ $maxHeight }) => $maxHeight
|
|
66341
|
+
? typeof $maxHeight === "number"
|
|
66342
|
+
? `${$maxHeight}px`
|
|
66343
|
+
: $maxHeight
|
|
66344
|
+
: getTheme("com/menu/max-height")};
|
|
66341
66345
|
border-radius: ${getTheme("com/menu/corner-radius")};
|
|
66342
66346
|
border: ${getTheme("com/menu/border/stroke-width")} solid
|
|
66343
66347
|
${getTheme("com/menu/border/color-stroke")};
|
|
@@ -66445,6 +66449,7 @@ const DivContentSC$2 = styled.div `
|
|
|
66445
66449
|
flex-direction: column;
|
|
66446
66450
|
flex: 1;
|
|
66447
66451
|
gap: ${getTheme("com/menu/item/vertical-gap")};
|
|
66452
|
+
min-width: 0;
|
|
66448
66453
|
`;
|
|
66449
66454
|
const DivPrefixIconSC = styled.div `
|
|
66450
66455
|
display: flex;
|
|
@@ -66504,6 +66509,10 @@ const DivPrefixIconSC = styled.div `
|
|
|
66504
66509
|
`;
|
|
66505
66510
|
const PTitleSC$1 = styled.p `
|
|
66506
66511
|
margin: 0;
|
|
66512
|
+
white-space: nowrap;
|
|
66513
|
+
overflow: hidden;
|
|
66514
|
+
text-overflow: ellipsis;
|
|
66515
|
+
min-width: 0;
|
|
66507
66516
|
|
|
66508
66517
|
${(props) => {
|
|
66509
66518
|
switch (props.$type) {
|
|
@@ -66555,6 +66564,10 @@ const PTitleSC$1 = styled.p `
|
|
|
66555
66564
|
`;
|
|
66556
66565
|
const PDescriptionSC = styled.p `
|
|
66557
66566
|
margin: 0;
|
|
66567
|
+
white-space: nowrap;
|
|
66568
|
+
overflow: hidden;
|
|
66569
|
+
text-overflow: ellipsis;
|
|
66570
|
+
min-width: 0;
|
|
66558
66571
|
|
|
66559
66572
|
${(props) => {
|
|
66560
66573
|
switch (props.$type) {
|
|
@@ -67370,10 +67383,16 @@ const DivContentSC$1 = styled.div `
|
|
|
67370
67383
|
padding-bottom: ${getTheme("sem/dimension/padding/2xs")};
|
|
67371
67384
|
padding-left: ${getTheme("com/menu/group-label/horizontal-padding")};
|
|
67372
67385
|
gap: 8px;
|
|
67386
|
+
min-width: 0;
|
|
67373
67387
|
`;
|
|
67374
67388
|
const SectionLabel = styled.span `
|
|
67375
67389
|
${getTheme("Subheading/Sm")}
|
|
67376
67390
|
color: ${getTheme("com/menu/group-label/color-text")};
|
|
67391
|
+
white-space: nowrap;
|
|
67392
|
+
overflow: hidden;
|
|
67393
|
+
text-overflow: ellipsis;
|
|
67394
|
+
min-width: 0;
|
|
67395
|
+
flex: 1;
|
|
67377
67396
|
`;
|
|
67378
67397
|
const ActionLink = styled.a `
|
|
67379
67398
|
${getTheme("Paragraph/Sm")};
|
|
@@ -67397,7 +67416,7 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
|
|
|
67397
67416
|
};
|
|
67398
67417
|
FISMenuSection.displayName = "FISMenuSection";
|
|
67399
67418
|
|
|
67400
|
-
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", }) => {
|
|
67419
|
+
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, }) => {
|
|
67401
67420
|
const [localSearch, setLocalSearch] = React.useState(searchValue);
|
|
67402
67421
|
React.useEffect(() => {
|
|
67403
67422
|
setLocalSearch(searchValue);
|
|
@@ -67478,7 +67497,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67478
67497
|
onClickMenu?.();
|
|
67479
67498
|
}
|
|
67480
67499
|
};
|
|
67481
|
-
return (jsxRuntime.jsxs(DivContainerSC$4, { className: className, children: [showInput && !combobox && (jsxRuntime.jsx(DivSearchSC, { children: jsxRuntime.jsx(FISInputText, { iconPrefix: jsxRuntime.jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoResultIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoDataIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsxRuntime.jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxRuntime.jsxs(DivWrapperSC$4, { children: [index !== 0 && jsxRuntime.jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsxRuntime.jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }, idx)))] }, index))) }), removeSelectedGroup && (jsxRuntime.jsx(FixedBottomSection, { children: jsxRuntime.jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsxRuntime.jsx(RemoveIcon, {}), negative: true }, idx))) }) }))] }))] }));
|
|
67500
|
+
return (jsxRuntime.jsxs(DivContainerSC$4, { "$maxHeight": maxHeight, className: className, children: [showInput && !combobox && (jsxRuntime.jsx(DivSearchSC, { children: jsxRuntime.jsx(FISInputText, { iconPrefix: jsxRuntime.jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoResultIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoDataIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsxRuntime.jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxRuntime.jsxs(DivWrapperSC$4, { children: [index !== 0 && jsxRuntime.jsx(FISMenuSection, { withDivider: true }), group?.groupLabel && (jsxRuntime.jsx(FISMenuSection, { label: group?.groupLabel })), group.items.map((item, idx) => (jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }, idx)))] }, index))) }), removeSelectedGroup && (jsxRuntime.jsx(FixedBottomSection, { children: jsxRuntime.jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsxRuntime.jsx(RemoveIcon, {}), negative: true }, idx))) }) }))] }))] }));
|
|
67482
67501
|
};
|
|
67483
67502
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67484
67503
|
|
|
@@ -70773,7 +70792,7 @@ const MultipleValue = ({ options, onRemove }) => {
|
|
|
70773
70792
|
return (jsxRuntime.jsxs(DivChipButtonWrapperSC, { ref: containerRef, children: [options.map((option, index) => (jsxRuntime.jsx(DivChipButtonSC, { "$isVisible": isVisible(option), children: jsxRuntime.jsx(FISChipButton, { ref: (el) => (tagRefs.current[index] = el), size: "xs", label: option.label, closeable: true, onClickClose: () => handleRemove(option) }, `${option.value}-${index}`) }))), hiddenTagCount > 0 && (jsxRuntime.jsx(DivTagSC, { "$isVisible": true, children: jsxRuntime.jsx(FISChipButton, { label: `+${hiddenTagCount}`, size: "xs" }) }))] }));
|
|
70774
70793
|
};
|
|
70775
70794
|
|
|
70776
|
-
const FISCombobox = React.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) => {
|
|
70795
|
+
const FISCombobox = React.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) => {
|
|
70777
70796
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
70778
70797
|
const [searchValue, setSearchValue] = React.useState("");
|
|
70779
70798
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
@@ -70879,7 +70898,7 @@ const FISCombobox = React.forwardRef(({ className, options, value, disabled = fa
|
|
|
70879
70898
|
}, [filteredOptions, searchValue]);
|
|
70880
70899
|
return (jsxRuntime.jsxs(DivWrapperSC$3, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC$2, { ref: setReferenceElement, onClick: handleToggle, children: jsxRuntime.jsx(FISInputField, { ...restProps, ref: ref, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: isOpen && searchValue !== undefined
|
|
70881
70900
|
? searchValue
|
|
70882
|
-
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "$isPointer": true }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper$1, { children: jsxRuntime.jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsxRuntime.jsx(FISMenuSelect, { groups: filteredOptions, placeholder: placeholderSearch, loading: loading, multi: multi, combobox: true, noResult: hasNoResults, noResultText: noResultText, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
|
|
70901
|
+
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "$isPointer": true }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper$1, { children: jsxRuntime.jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsxRuntime.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) => {
|
|
70883
70902
|
if (multi) {
|
|
70884
70903
|
onChange(values);
|
|
70885
70904
|
}
|
|
@@ -71043,7 +71062,7 @@ function mergeRefs(...refs) {
|
|
|
71043
71062
|
}
|
|
71044
71063
|
|
|
71045
71064
|
const FISInputDate = React.forwardRef((props, ref) => {
|
|
71046
|
-
const { value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71065
|
+
const { className, value, textLabel = "", iconLabel, required, message = "", disabled, negative, positive, format = "DD/MM/YYYY", onClickIconLabel, onChange, getPopupContainer, minDate, maxDate, ...restProps } = props;
|
|
71047
71066
|
const [open, setOpen] = React.useState(false);
|
|
71048
71067
|
const [inputValue, setInputValue] = React.useState(value ? dayjs(value).format(format) : "");
|
|
71049
71068
|
const [dateValue, setDateValue] = React.useState(value ? dayjs(value) : null);
|
|
@@ -71086,7 +71105,7 @@ const FISInputDate = React.forwardRef((props, ref) => {
|
|
|
71086
71105
|
onChange?.(null);
|
|
71087
71106
|
}
|
|
71088
71107
|
};
|
|
71089
|
-
return (jsxRuntime.jsxs(DivWrapperSC$2, { children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
|
|
71108
|
+
return (jsxRuntime.jsxs(DivWrapperSC$2, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC$1, { children: [jsxRuntime.jsx(FISInputField, { ...restProps, ref: mergeRef, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(DateIcon, {}), value: inputValue, negative: negative, disabled: disabled, onFocus: () => setOpen(true), onChange: handleInputChange, onClickSuffix: () => setOpen(true) }), jsxRuntime.jsx(HiddenDatePickerSC, { open: open, value: dateValue, onChange: (value) => handleChange(value), onOpenChange: handleOpenChange, format: format, getPopupContainer: getPopupContainer, minDate: minDate, maxDate: maxDate })] }), message && (jsxRuntime.jsx(DivHintWrapperSC$1, { children: jsxRuntime.jsx(SpanHintSC$3, { className: classNames({
|
|
71090
71109
|
disabled,
|
|
71091
71110
|
negative,
|
|
71092
71111
|
positive,
|
|
@@ -73086,10 +73105,27 @@ const DivWrapperSC$1 = styled.div `
|
|
|
73086
73105
|
flex-direction: column;
|
|
73087
73106
|
gap: ${getTheme("com/input/vertical-gap")};
|
|
73088
73107
|
`;
|
|
73108
|
+
const preventSelection = styled.css `
|
|
73109
|
+
user-select: none !important;
|
|
73110
|
+
-webkit-user-select: none !important;
|
|
73111
|
+
-moz-user-select: none !important;
|
|
73112
|
+
-ms-user-select: none !important;
|
|
73113
|
+
cursor: pointer !important;
|
|
73114
|
+
`;
|
|
73089
73115
|
const DivInputWrapperSC = styled.div `
|
|
73090
73116
|
position: relative;
|
|
73091
73117
|
display: inline-block;
|
|
73092
73118
|
width: 100%;
|
|
73119
|
+
|
|
73120
|
+
${(props) => props.$hasValue &&
|
|
73121
|
+
styled.css `
|
|
73122
|
+
${preventSelection}
|
|
73123
|
+
|
|
73124
|
+
input {
|
|
73125
|
+
${preventSelection}
|
|
73126
|
+
pointer-events: none;
|
|
73127
|
+
}
|
|
73128
|
+
`}
|
|
73093
73129
|
`;
|
|
73094
73130
|
const DivDropdownMenuSC = styled.div `
|
|
73095
73131
|
/* margin-top: ${getTheme("com/select/vertical-gap")}; */
|
|
@@ -73113,6 +73149,10 @@ const InputSC = styled.input `
|
|
|
73113
73149
|
border: none;
|
|
73114
73150
|
background: transparent;
|
|
73115
73151
|
outline: none;
|
|
73152
|
+
white-space: nowrap;
|
|
73153
|
+
overflow: hidden;
|
|
73154
|
+
text-overflow: ellipsis;
|
|
73155
|
+
min-width: 0;
|
|
73116
73156
|
|
|
73117
73157
|
${(props) => {
|
|
73118
73158
|
switch (props.$size) {
|
|
@@ -73185,6 +73225,7 @@ const DivWrapperSC = styled.div `
|
|
|
73185
73225
|
justify-content: space-between;
|
|
73186
73226
|
padding-right: ${getTheme("com/select/field/right-padding")};
|
|
73187
73227
|
padding-left: ${getTheme("com/select/field/left-padding")};
|
|
73228
|
+
min-width: 0;
|
|
73188
73229
|
`;
|
|
73189
73230
|
const DivIconPrefixSC = styled.div `
|
|
73190
73231
|
display: flex;
|
|
@@ -73219,7 +73260,7 @@ const DivIconSuffixSC = styled.div `
|
|
|
73219
73260
|
flex-shrink: 0;
|
|
73220
73261
|
align-items: center;
|
|
73221
73262
|
justify-content: center;
|
|
73222
|
-
cursor: pointer;
|
|
73263
|
+
cursor: ${(props) => (props.$disabled ? "not-allowed" : "pointer")};
|
|
73223
73264
|
color: ${getTheme("com/select/field/right-icon/color-icon")};
|
|
73224
73265
|
|
|
73225
73266
|
${(props) => {
|
|
@@ -73362,7 +73403,7 @@ const FISSelectItem = React.forwardRef((props, ref) => {
|
|
|
73362
73403
|
return (jsxRuntime.jsx(DivContainerSC, { className: classNames({
|
|
73363
73404
|
iconPrefix: iconPrefix,
|
|
73364
73405
|
negative: negative,
|
|
73365
|
-
}), "$size": size, children: jsxRuntime.jsxs(DivWrapperSC, { children: [iconPrefix && (jsxRuntime.jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsxRuntime.jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsxRuntime.jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
|
|
73406
|
+
}), "$size": size, children: jsxRuntime.jsxs(DivWrapperSC, { children: [iconPrefix && (jsxRuntime.jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsxRuntime.jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsxRuntime.jsx(DivIconSuffixSC, { "$size": size, "$disabled": disabled, children: iconSuffix }))] }) }));
|
|
73366
73407
|
});
|
|
73367
73408
|
FISSelectItem.displayName = "FISSelectItem";
|
|
73368
73409
|
|
|
@@ -73370,7 +73411,7 @@ function isMenuSize(value) {
|
|
|
73370
73411
|
return value === "sm" || value === "md";
|
|
73371
73412
|
}
|
|
73372
73413
|
|
|
73373
|
-
const FISSelect = React.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) => {
|
|
73414
|
+
const FISSelect = React.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) => {
|
|
73374
73415
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
73375
73416
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
73376
73417
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
@@ -73455,8 +73496,10 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73455
73496
|
onChange(values);
|
|
73456
73497
|
}
|
|
73457
73498
|
else {
|
|
73458
|
-
|
|
73459
|
-
|
|
73499
|
+
if (values.length > 0) {
|
|
73500
|
+
onChange(values[0]);
|
|
73501
|
+
setIsOpen(false);
|
|
73502
|
+
}
|
|
73460
73503
|
}
|
|
73461
73504
|
}, [multi, onChange]);
|
|
73462
73505
|
const handleMenuClick = React.useCallback(() => {
|
|
@@ -73479,6 +73522,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73479
73522
|
onClickMenu: handleMenuClick,
|
|
73480
73523
|
searchValue,
|
|
73481
73524
|
onSearchChange,
|
|
73525
|
+
maxHeight,
|
|
73482
73526
|
...restProps,
|
|
73483
73527
|
}), [
|
|
73484
73528
|
options,
|
|
@@ -73491,6 +73535,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73491
73535
|
handleMenuClick,
|
|
73492
73536
|
searchValue,
|
|
73493
73537
|
onSearchChange,
|
|
73538
|
+
maxHeight,
|
|
73494
73539
|
restProps,
|
|
73495
73540
|
]);
|
|
73496
73541
|
React.useEffect(() => {
|
|
@@ -73505,7 +73550,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73505
73550
|
document.addEventListener("mousedown", handleClickOutside);
|
|
73506
73551
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73507
73552
|
}, [referenceElement, popperElement]);
|
|
73508
|
-
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73553
|
+
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73509
73554
|
...styles.popper,
|
|
73510
73555
|
width: referenceElement?.offsetWidth,
|
|
73511
73556
|
zIndex: 9999,
|