fis-component 0.1.1 → 0.1.3
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 +109 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Breadcrumb/styles.d.ts +1 -0
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +4 -0
- package/dist/cjs/types/src/components/Select/types.d.ts +6 -0
- package/dist/cjs/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/esm/index.js +109 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Breadcrumb/styles.d.ts +1 -0
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +4 -0
- package/dist/esm/types/src/components/Select/types.d.ts +6 -0
- package/dist/esm/types/src/components/SelectItem/styles.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -61015,9 +61015,9 @@ const ButtonStyled = styled.button `
|
|
|
61015
61015
|
`}
|
|
61016
61016
|
|
|
61017
61017
|
&:disabled {
|
|
61018
|
-
background-color: ${getTheme("com/button/disable/background-color
|
|
61019
|
-
border-color: ${getTheme("com/button/disable/stroke-color")};
|
|
61018
|
+
background-color: ${getTheme("com/button/disable/background-color")};
|
|
61020
61019
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
61020
|
+
border: none;
|
|
61021
61021
|
}
|
|
61022
61022
|
|
|
61023
61023
|
${props.$loading &&
|
|
@@ -61585,12 +61585,12 @@ function PositiveIcon(props) {
|
|
|
61585
61585
|
}
|
|
61586
61586
|
|
|
61587
61587
|
function ArrowDownIcon(props) {
|
|
61588
|
-
const { width =
|
|
61588
|
+
const { width = 20, height = 20, ...rest } = props;
|
|
61589
61589
|
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_11182_21084)", children: jsxRuntime.jsx("path", { d: "M4.66666 6L8.66666 10L12.6667 6", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11182_21084", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.666656)" }) }) })] }));
|
|
61590
61590
|
}
|
|
61591
61591
|
|
|
61592
61592
|
function ArrowUpIcon(props) {
|
|
61593
|
-
const { width =
|
|
61593
|
+
const { width = 20, height = 20, ...rest } = props;
|
|
61594
61594
|
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_11028_8041)", children: jsxRuntime.jsx("path", { d: "M4.33331 10L8.33331 6L12.3333 10", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11028_8041", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.333313)" }) }) })] }));
|
|
61595
61595
|
}
|
|
61596
61596
|
|
|
@@ -62192,9 +62192,9 @@ const ButtonSC = styled.button `
|
|
|
62192
62192
|
`}
|
|
62193
62193
|
|
|
62194
62194
|
&:disabled {
|
|
62195
|
-
background-color: ${getTheme("com/button/disable/background-color
|
|
62196
|
-
|
|
62197
|
-
|
|
62195
|
+
background-color: ${getTheme("com/button/disable/background-color")};
|
|
62196
|
+
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62197
|
+
border: none;
|
|
62198
62198
|
|
|
62199
62199
|
${SpanIconSC$2} {
|
|
62200
62200
|
color: ${getTheme("com/button/disable/icon-color")};
|
|
@@ -63825,7 +63825,8 @@ const ButtonItemSC = styled.button `
|
|
|
63825
63825
|
|
|
63826
63826
|
&:focus-visible {
|
|
63827
63827
|
background-color: ${getTheme("com/focus-mark/background-color")};
|
|
63828
|
-
box-shadow:
|
|
63828
|
+
box-shadow:
|
|
63829
|
+
0 0 0 ${getTheme("sem/dimension/stroke-width/divider/lg")}
|
|
63829
63830
|
${getTheme("com/focus-mark/color-gap-spacing")},
|
|
63830
63831
|
0 0 0 4px ${getTheme("com/focus-mark/color-stroke")};
|
|
63831
63832
|
}
|
|
@@ -63841,16 +63842,19 @@ const DivIconDotSC = styled.div `
|
|
|
63841
63842
|
gap: ${getTheme("com/breadcrumbs/module/horizontal-gap")};
|
|
63842
63843
|
border-radius: ${getTheme("com/breadcrumbs/module/corner-radius")};
|
|
63843
63844
|
`;
|
|
63845
|
+
const DivSeparatorIconSC$1 = styled.div `
|
|
63846
|
+
color: ${getTheme("com/breadcrumbs/separated-icon/color-icon")};
|
|
63847
|
+
`;
|
|
63844
63848
|
|
|
63845
63849
|
const MAX_VISIBLE_ITEMS = 4;
|
|
63846
63850
|
const BreadcrumbItem = React.forwardRef(({ label, icon, active, onClick, ...rest }, ref) => {
|
|
63847
63851
|
return (jsxRuntime.jsxs(ButtonItemSC, { type: "button", ...rest, ref: ref, onClick: onClick, "$active": active, children: [icon && jsxRuntime.jsx(DivIconSC$3, { children: icon }), label && jsxRuntime.jsx(SpanLabelSC$1, { children: label })] }));
|
|
63848
63852
|
});
|
|
63849
|
-
const BreadcrumbEllipsis = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DivIconDotSC, { children: jsxRuntime.jsx(DotIcon, {}) }), jsxRuntime.jsx(SeparatorIcon, {})] }));
|
|
63853
|
+
const BreadcrumbEllipsis = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DivIconDotSC, { children: jsxRuntime.jsx(DotIcon, {}) }), jsxRuntime.jsx(DivSeparatorIconSC$1, { children: jsxRuntime.jsx(SeparatorIcon, {}) })] }));
|
|
63850
63854
|
const FISBreadcrumb = ({ items, className }) => {
|
|
63851
63855
|
if (items.length === 0)
|
|
63852
63856
|
return null;
|
|
63853
|
-
return (jsxRuntime.jsxs(DivContainerSC$9, { className: className, children: [items?.[0]?.icon && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FISIconButton, { size: "xs", icon: items?.[0]?.icon, variant: "tertiary-invisible", onClick: items[0].onClick }), jsxRuntime.jsx(SeparatorIcon, {})] })), items.length > MAX_VISIBLE_ITEMS ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [items.slice(1, 2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))), jsxRuntime.jsx(BreadcrumbEllipsis, {}), items.slice(-2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, `end-${index}`)))] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.slice(1).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))) }))] }));
|
|
63857
|
+
return (jsxRuntime.jsxs(DivContainerSC$9, { className: className, children: [items?.[0]?.icon && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FISIconButton, { size: "xs", icon: items?.[0]?.icon, variant: "tertiary-invisible", onClick: items[0].onClick }), jsxRuntime.jsx(DivSeparatorIconSC$1, { children: jsxRuntime.jsx(SeparatorIcon, {}) })] })), items.length > MAX_VISIBLE_ITEMS ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [items.slice(1, 2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(DivSeparatorIconSC$1, { children: jsxRuntime.jsx(SeparatorIcon, {}) })] }, index))), jsxRuntime.jsx(BreadcrumbEllipsis, {}), items.slice(-2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(DivSeparatorIconSC$1, { children: jsxRuntime.jsx(SeparatorIcon, {}) })] }, `end-${index}`)))] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.slice(1).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(DivSeparatorIconSC$1, { children: jsxRuntime.jsx(SeparatorIcon, {}) })] }, index))) }))] }));
|
|
63854
63858
|
};
|
|
63855
63859
|
FISBreadcrumb.displayName = "FISBreadcrumb";
|
|
63856
63860
|
|
|
@@ -64828,7 +64832,7 @@ const DivContainerSC$7 = styled.div `
|
|
|
64828
64832
|
color: ${getTheme("com/input/field/negative/icon/color-icon/default")};
|
|
64829
64833
|
}
|
|
64830
64834
|
|
|
64831
|
-
&:hover {
|
|
64835
|
+
&:hover:not(:has(${InputSC$2}:disabled)):not(:has(.icon-suffix:hover)) {
|
|
64832
64836
|
outline-color: ${getTheme("com/input/field/negative/border/hover")};
|
|
64833
64837
|
background-color: ${getTheme("com/input/field/negative/background/hover")};
|
|
64834
64838
|
|
|
@@ -66549,7 +66553,7 @@ const DivContainerSC$4 = styled.div `
|
|
|
66549
66553
|
padding-bottom: ${getTheme("com/menu/bottom-padding")};
|
|
66550
66554
|
padding-left: ${getTheme("com/menu/left-padding")};
|
|
66551
66555
|
padding-right: ${getTheme("com/menu/right-padding")};
|
|
66552
|
-
gap: ${getTheme("com/menu/item/horizontal-gap")};
|
|
66556
|
+
/* gap: ${getTheme("com/menu/item/horizontal-gap")}; */
|
|
66553
66557
|
background-color: ${getTheme("com/menu/background-color")};
|
|
66554
66558
|
box-shadow: ${getTheme("Elevation/Level-2")};
|
|
66555
66559
|
`;
|
|
@@ -66560,6 +66564,7 @@ const DivLoaderSC = styled.div `
|
|
|
66560
66564
|
align-items: center;
|
|
66561
66565
|
justify-content: center;
|
|
66562
66566
|
gap: ${getTheme("com/menu/item/horizontal-gap")};
|
|
66567
|
+
height: ${getTheme("com/menu/height")};
|
|
66563
66568
|
`;
|
|
66564
66569
|
const DivIconDataSC = styled.div `
|
|
66565
66570
|
display: flex;
|
|
@@ -66579,8 +66584,7 @@ styled.div `
|
|
|
66579
66584
|
const DivWrapperSC$4 = styled.div `
|
|
66580
66585
|
display: flex;
|
|
66581
66586
|
flex-direction: column;
|
|
66582
|
-
gap: ${getTheme("
|
|
66583
|
-
/* min-width: ${getTheme("com/menu/item/min-width")}; */
|
|
66587
|
+
gap: ${getTheme("sem/dimension/gap/xs")};
|
|
66584
66588
|
min-height: ${getTheme("com/menu/item/size-md/min-height")};
|
|
66585
66589
|
background-color: ${getTheme("com/menu/item/action/background-color/default")};
|
|
66586
66590
|
`;
|
|
@@ -67629,9 +67633,16 @@ FISMenuSection.displayName = "FISMenuSection";
|
|
|
67629
67633
|
|
|
67630
67634
|
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, onPopupScroll, }) => {
|
|
67631
67635
|
const [localSearch, setLocalSearch] = React.useState(searchValue);
|
|
67636
|
+
const [pendingSearch, setPendingSearch] = React.useState(null);
|
|
67632
67637
|
React.useEffect(() => {
|
|
67633
67638
|
setLocalSearch(searchValue);
|
|
67634
67639
|
}, [searchValue]);
|
|
67640
|
+
React.useEffect(() => {
|
|
67641
|
+
if (pendingSearch !== null) {
|
|
67642
|
+
setLocalSearch(pendingSearch);
|
|
67643
|
+
setPendingSearch(null);
|
|
67644
|
+
}
|
|
67645
|
+
}, [groups]);
|
|
67635
67646
|
const search = localSearch;
|
|
67636
67647
|
const filteredGroups = React.useMemo(() => {
|
|
67637
67648
|
let filteredItems = groups.map((group) => ({
|
|
@@ -67683,8 +67694,13 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67683
67694
|
const shouldShowNoResult = hasSearch && !hasFilteredResult;
|
|
67684
67695
|
const handleSearchChange = (e) => {
|
|
67685
67696
|
const value = e.target.value;
|
|
67686
|
-
|
|
67687
|
-
|
|
67697
|
+
if (onSearchChange) {
|
|
67698
|
+
setPendingSearch(value);
|
|
67699
|
+
onSearchChange(value);
|
|
67700
|
+
}
|
|
67701
|
+
else {
|
|
67702
|
+
setLocalSearch(value);
|
|
67703
|
+
}
|
|
67688
67704
|
};
|
|
67689
67705
|
const handleItemClick = (item) => {
|
|
67690
67706
|
if (multi) {
|
|
@@ -67708,7 +67724,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67708
67724
|
onClickMenu?.();
|
|
67709
67725
|
}
|
|
67710
67726
|
};
|
|
67711
|
-
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 }) })),
|
|
67727
|
+
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 }) })), loading && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsxRuntime.jsx(PTitleSC$2, { children: loadingText })] })), !loading && noData && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoDataIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noDataText })] })), !loading && !noData && (shouldShowNoResult || noResult) && (jsxRuntime.jsxs(DivLoaderSC, { children: [jsxRuntime.jsx(DivIconDataSC, { children: jsxRuntime.jsx(NoResultIcon, {}) }), jsxRuntime.jsx(PTitleSC$2, { children: noResultText })] })), !shouldShowNoResult && !noData && !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, onScroll: onPopupScroll, 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(FISTooltip, { title: item.label, variant: "primary", children: 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(FISTooltip, { title: item.label, variant: "primary", children: jsxRuntime.jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsxRuntime.jsx(RemoveIcon, {}), negative: true }) }, idx))) }) }))] }))] }));
|
|
67712
67728
|
};
|
|
67713
67729
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67714
67730
|
|
|
@@ -73384,7 +73400,7 @@ const DivInputWrapperSC = styled.div `
|
|
|
73384
73400
|
`}
|
|
73385
73401
|
`;
|
|
73386
73402
|
const DivDropdownMenuSC = styled.div `
|
|
73387
|
-
|
|
73403
|
+
margin-top: ${getTheme("com/select/vertical-gap")};
|
|
73388
73404
|
`;
|
|
73389
73405
|
const SelectedTagsWrapper = styled.div `
|
|
73390
73406
|
display: flex;
|
|
@@ -73631,6 +73647,17 @@ const DivContainerSC = styled.div `
|
|
|
73631
73647
|
}
|
|
73632
73648
|
}
|
|
73633
73649
|
|
|
73650
|
+
&.activeDropdown {
|
|
73651
|
+
outline-color: ${getTheme("com/select/field/default/border/active")};
|
|
73652
|
+
background-color: ${getTheme("com/select/field/default/background/active")};
|
|
73653
|
+
box-shadow: 0 0 0 ${getTheme("com/actived-mark/gap-spacing")}
|
|
73654
|
+
${getTheme("com/actived-mark/color-gap-spacing")};
|
|
73655
|
+
|
|
73656
|
+
${DivIconPrefixSC} {
|
|
73657
|
+
color: ${getTheme("com/select/field/default/icon/color-icon/active")};
|
|
73658
|
+
}
|
|
73659
|
+
}
|
|
73660
|
+
|
|
73634
73661
|
// Design chưa có negative
|
|
73635
73662
|
&.negative {
|
|
73636
73663
|
outline-color: ${getTheme("com/input/field/negative/border/default")};
|
|
@@ -73648,6 +73675,13 @@ const DivContainerSC = styled.div `
|
|
|
73648
73675
|
${getTheme("com/actived-mark/color-gap-spacing-negative")};
|
|
73649
73676
|
}
|
|
73650
73677
|
|
|
73678
|
+
&.activeDropdown {
|
|
73679
|
+
outline-color: ${getTheme("com/input/field/negative/border/active")};
|
|
73680
|
+
background-color: ${getTheme("com/input/field/negative/background/active")};
|
|
73681
|
+
box-shadow: 0 0 0 ${getTheme("com/actived-mark/gap-spacing")}
|
|
73682
|
+
${getTheme("com/actived-mark/color-gap-spacing-negative")};
|
|
73683
|
+
}
|
|
73684
|
+
|
|
73651
73685
|
&::placeholder {
|
|
73652
73686
|
color: ${getTheme("com/input/field/negative/label/color-text/placeholder")};
|
|
73653
73687
|
}
|
|
@@ -73659,7 +73693,8 @@ const FISSelectItem = React.forwardRef((props, ref) => {
|
|
|
73659
73693
|
return (jsxRuntime.jsx(DivContainerSC, { className: classNames({
|
|
73660
73694
|
iconPrefix: iconPrefix,
|
|
73661
73695
|
negative: negative,
|
|
73662
|
-
|
|
73696
|
+
activeDropdown: activeDropdown,
|
|
73697
|
+
}), "$size": size, "$activeDropdown": activeDropdown, 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 }))] }) }));
|
|
73663
73698
|
});
|
|
73664
73699
|
FISSelectItem.displayName = "FISSelectItem";
|
|
73665
73700
|
|
|
@@ -73667,11 +73702,25 @@ function isMenuSize(value) {
|
|
|
73667
73702
|
return value === "sm" || value === "md";
|
|
73668
73703
|
}
|
|
73669
73704
|
|
|
73670
|
-
const FISSelect = React.forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, maxHeight, onPopupScroll, hideChip, ...restProps }, ref) => {
|
|
73705
|
+
const FISSelect = React.forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal, maxHeight, onPopupScroll, onOpen, hideChip, tooltipTitle, tooltipVariant = "primary", ...restProps }, ref) => {
|
|
73671
73706
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
73672
73707
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
73673
73708
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
73709
|
+
const [cachedSelectedItem, setCachedSelectedItem] = React.useState(null);
|
|
73674
73710
|
const isSelectingRef = React.useRef(false);
|
|
73711
|
+
const inputRef = React.useRef(null);
|
|
73712
|
+
// Expose focus and openDropdown methods via ref
|
|
73713
|
+
React.useImperativeHandle(ref, () => ({
|
|
73714
|
+
...inputRef.current,
|
|
73715
|
+
openDropdown: () => {
|
|
73716
|
+
if (!disabled && !isOpen) {
|
|
73717
|
+
setIsOpen(true);
|
|
73718
|
+
if (onOpen) {
|
|
73719
|
+
onOpen();
|
|
73720
|
+
}
|
|
73721
|
+
}
|
|
73722
|
+
},
|
|
73723
|
+
}));
|
|
73675
73724
|
const popperOptions = React.useMemo(() => ({
|
|
73676
73725
|
modifiers: [
|
|
73677
73726
|
{ name: "preventOverflow", options: { padding: 0, altAxis: true } },
|
|
@@ -73709,17 +73758,39 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73709
73758
|
: `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
|
|
73710
73759
|
}
|
|
73711
73760
|
else {
|
|
73712
|
-
|
|
73713
|
-
|
|
73714
|
-
|
|
73715
|
-
|
|
73761
|
+
if (value) {
|
|
73762
|
+
const firstItem = selectedItems[0];
|
|
73763
|
+
if (firstItem) {
|
|
73764
|
+
if (!cachedSelectedItem ||
|
|
73765
|
+
cachedSelectedItem.value !== firstItem.value) {
|
|
73766
|
+
setCachedSelectedItem(firstItem);
|
|
73767
|
+
}
|
|
73768
|
+
return displayValue?.(firstItem) || firstItem.label;
|
|
73769
|
+
}
|
|
73770
|
+
if (cachedSelectedItem) {
|
|
73771
|
+
return (displayValue?.(cachedSelectedItem) || cachedSelectedItem.label);
|
|
73772
|
+
}
|
|
73773
|
+
if (displayValue) {
|
|
73774
|
+
return displayValue({ label: String(value), value });
|
|
73775
|
+
}
|
|
73776
|
+
return String(value);
|
|
73777
|
+
}
|
|
73778
|
+
return "";
|
|
73716
73779
|
}
|
|
73717
|
-
}, [
|
|
73780
|
+
}, [
|
|
73781
|
+
multi,
|
|
73782
|
+
value,
|
|
73783
|
+
multiDisplayText,
|
|
73784
|
+
selectedItems,
|
|
73785
|
+
displayValue,
|
|
73786
|
+
cachedSelectedItem,
|
|
73787
|
+
]);
|
|
73718
73788
|
const handleToggle = React.useCallback(() => {
|
|
73719
73789
|
if (!disabled) {
|
|
73720
73790
|
setIsOpen((prev) => !prev);
|
|
73791
|
+
onOpen?.();
|
|
73721
73792
|
}
|
|
73722
|
-
}, [disabled]);
|
|
73793
|
+
}, [disabled, onOpen]);
|
|
73723
73794
|
const handleOptionRemove = React.useCallback((option) => {
|
|
73724
73795
|
if (multi && Array.isArray(value)) {
|
|
73725
73796
|
const newValues = value.filter((v) => v !== option.value);
|
|
@@ -73814,7 +73885,14 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73814
73885
|
return () => clearTimeout(timer);
|
|
73815
73886
|
}
|
|
73816
73887
|
}, [isOpen, multi]);
|
|
73817
|
-
|
|
73888
|
+
const renderSelectInput = () => {
|
|
73889
|
+
const selectInput = (jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, onBlur: handleBlur, ref: inputRef, size: size, placeholder: placeholder, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen, negative: negative }) }));
|
|
73890
|
+
if (tooltipTitle) {
|
|
73891
|
+
return (jsxRuntime.jsx(FISTooltip, { title: tooltipTitle, variant: tooltipVariant, smartPlacement: true, children: selectInput }));
|
|
73892
|
+
}
|
|
73893
|
+
return selectInput;
|
|
73894
|
+
};
|
|
73895
|
+
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), renderSelectInput(), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && !hideChip && Array.isArray(value) && 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: {
|
|
73818
73896
|
...styles.popper,
|
|
73819
73897
|
width: referenceElement?.offsetWidth,
|
|
73820
73898
|
zIndex: 9999,
|
|
@@ -73905,8 +73983,11 @@ const PaginationAntdSC = styled(Pagination) `
|
|
|
73905
73983
|
&.ant-pagination-disabled .ant-pagination-next,
|
|
73906
73984
|
&.ant-pagination-disabled .ant-pagination-prev {
|
|
73907
73985
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
73908
|
-
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
73909
73986
|
background-color: transparent !important;
|
|
73987
|
+
|
|
73988
|
+
button {
|
|
73989
|
+
border: none !important;
|
|
73990
|
+
}
|
|
73910
73991
|
}
|
|
73911
73992
|
|
|
73912
73993
|
&.ant-pagination-disabled .ant-pagination-item-active {
|