fis-component 0.0.71 → 0.0.73
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 +33 -7
- 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/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/types.d.ts +1 -0
- package/dist/esm/index.js +33 -7
- 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/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/types.d.ts +1 -0
- package/dist/index.d.ts +3 -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
|
}
|
|
@@ -71820,7 +71839,7 @@ const DivSuffixIconSC = styled.div `
|
|
|
71820
71839
|
`;
|
|
71821
71840
|
|
|
71822
71841
|
const { RangePicker } = DatePicker;
|
|
71823
|
-
const FISDateRange = ({ placeholder = ["dd/mm/yyyy", "dd/mm/yyyy"], label, required
|
|
71842
|
+
const FISDateRange = ({ placeholder = ["dd/mm/yyyy", "dd/mm/yyyy"], label, required, message, negative, positive, disabled, ...rest }) => {
|
|
71824
71843
|
const [open, setOpen] = React.useState(false);
|
|
71825
71844
|
const handleOpenCalendar = () => {
|
|
71826
71845
|
setOpen(!open);
|
|
@@ -73130,6 +73149,10 @@ const InputSC = styled.input `
|
|
|
73130
73149
|
border: none;
|
|
73131
73150
|
background: transparent;
|
|
73132
73151
|
outline: none;
|
|
73152
|
+
white-space: nowrap;
|
|
73153
|
+
overflow: hidden;
|
|
73154
|
+
text-overflow: ellipsis;
|
|
73155
|
+
min-width: 0;
|
|
73133
73156
|
|
|
73134
73157
|
${(props) => {
|
|
73135
73158
|
switch (props.$size) {
|
|
@@ -73202,6 +73225,7 @@ const DivWrapperSC = styled.div `
|
|
|
73202
73225
|
justify-content: space-between;
|
|
73203
73226
|
padding-right: ${getTheme("com/select/field/right-padding")};
|
|
73204
73227
|
padding-left: ${getTheme("com/select/field/left-padding")};
|
|
73228
|
+
min-width: 0;
|
|
73205
73229
|
`;
|
|
73206
73230
|
const DivIconPrefixSC = styled.div `
|
|
73207
73231
|
display: flex;
|
|
@@ -73387,7 +73411,7 @@ function isMenuSize(value) {
|
|
|
73387
73411
|
return value === "sm" || value === "md";
|
|
73388
73412
|
}
|
|
73389
73413
|
|
|
73390
|
-
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) => {
|
|
73391
73415
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
73392
73416
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
73393
73417
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
@@ -73498,6 +73522,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73498
73522
|
onClickMenu: handleMenuClick,
|
|
73499
73523
|
searchValue,
|
|
73500
73524
|
onSearchChange,
|
|
73525
|
+
maxHeight,
|
|
73501
73526
|
...restProps,
|
|
73502
73527
|
}), [
|
|
73503
73528
|
options,
|
|
@@ -73510,6 +73535,7 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
|
|
|
73510
73535
|
handleMenuClick,
|
|
73511
73536
|
searchValue,
|
|
73512
73537
|
onSearchChange,
|
|
73538
|
+
maxHeight,
|
|
73513
73539
|
restProps,
|
|
73514
73540
|
]);
|
|
73515
73541
|
React.useEffect(() => {
|