fis-component 0.0.56 → 0.0.58
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 +20 -14
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Combobox/types.d.ts +1 -1
- package/dist/cjs/types/src/components/MenuSelect/types.d.ts +3 -3
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/cjs/types/src/components/Select/index.d.ts +1 -1
- package/dist/cjs/types/src/components/Select/types.d.ts +5 -5
- package/dist/esm/index.js +20 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Combobox/types.d.ts +1 -1
- package/dist/esm/types/src/components/MenuSelect/types.d.ts +3 -3
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/esm/types/src/components/Select/index.d.ts +1 -1
- package/dist/esm/types/src/components/Select/types.d.ts +5 -5
- package/dist/index.d.ts +10 -10
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -66357,7 +66357,7 @@ const PTitleSC$2 = styled.p `
|
|
|
66357
66357
|
${getTheme("Paragraph/Sm")}
|
|
66358
66358
|
color: ${getTheme("com/menu/item/action/label/color-text/default")};
|
|
66359
66359
|
`;
|
|
66360
|
-
styled.div `
|
|
66360
|
+
const DivWrapperMenuSC = styled.div `
|
|
66361
66361
|
display: flex;
|
|
66362
66362
|
flex-direction: column;
|
|
66363
66363
|
height: 100%;
|
|
@@ -67468,7 +67468,7 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67468
67468
|
onClickMenu?.();
|
|
67469
67469
|
}
|
|
67470
67470
|
};
|
|
67471
|
-
return (jsxRuntime.
|
|
67471
|
+
return (jsxRuntime.jsx(DivContainerSC$4, { className: className, children: jsxRuntime.jsxs(DivWrapperMenuSC, { 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))) }) }))] }))] }) }));
|
|
67472
67472
|
};
|
|
67473
67473
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67474
67474
|
|
|
@@ -70932,6 +70932,19 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70932
70932
|
const [inputValue, setInputValue] = React.useState("");
|
|
70933
70933
|
const [timeValue, setTimeValue] = React.useState(null);
|
|
70934
70934
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
70935
|
+
const containerRef = React.useRef(null);
|
|
70936
|
+
React.useEffect(() => {
|
|
70937
|
+
const handleClickOutside = (event) => {
|
|
70938
|
+
if (containerRef.current &&
|
|
70939
|
+
!containerRef.current.contains(event.target)) {
|
|
70940
|
+
setIsOpen(false);
|
|
70941
|
+
}
|
|
70942
|
+
};
|
|
70943
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
70944
|
+
return () => {
|
|
70945
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
70946
|
+
};
|
|
70947
|
+
}, []);
|
|
70935
70948
|
const handleTimeChange = (time) => {
|
|
70936
70949
|
setTimeValue(time);
|
|
70937
70950
|
setInputValue(time ? time.format(format) : "");
|
|
@@ -70956,7 +70969,7 @@ const FISInputTime = React.forwardRef((props, ref) => {
|
|
|
70956
70969
|
setIsOpen(open);
|
|
70957
70970
|
}
|
|
70958
70971
|
};
|
|
70959
|
-
return (jsxRuntime.jsxs(DivContainerSC$2, { className: className, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputTimeSC, { children: [jsxRuntime.jsx(FISInputField, { ...rest, ref: ref, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(TimeIcon, {}), negative: negative, value: inputValue, onChange: handleInputChange, onFocus: handleClickInput, onClickSuffix: handleClickInput }), jsxRuntime.jsx(HiddenTimePickerSC, { format: format, value: timeValue, onChange: handleTimeChange, open: isOpen, onOpenChange: handleOpenChange, getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body })] }), message && (jsxRuntime.jsx(DivHintWrapperSC, { children: jsxRuntime.jsx(SpanHintSC, { className: classNames({
|
|
70972
|
+
return (jsxRuntime.jsxs(DivContainerSC$2, { className: className, ref: containerRef, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputTimeSC, { children: [jsxRuntime.jsx(FISInputField, { ...rest, ref: ref, typeSuffix: "icon", iconSuffix: jsxRuntime.jsx(TimeIcon, {}), negative: negative, value: inputValue, onChange: handleInputChange, onFocus: handleClickInput, onClickSuffix: handleClickInput }), jsxRuntime.jsx(HiddenTimePickerSC, { format: format, value: timeValue, onChange: handleTimeChange, open: isOpen, onOpenChange: handleOpenChange, getPopupContainer: (triggerNode) => triggerNode.parentElement || document.body })] }), message && (jsxRuntime.jsx(DivHintWrapperSC, { children: jsxRuntime.jsx(SpanHintSC, { className: classNames({
|
|
70960
70973
|
disabled: disabled,
|
|
70961
70974
|
negative: negative,
|
|
70962
70975
|
positive: positive,
|
|
@@ -73311,7 +73324,7 @@ function isMenuSize(value) {
|
|
|
73311
73324
|
return value === "sm" || value === "md";
|
|
73312
73325
|
}
|
|
73313
73326
|
|
|
73314
|
-
const FISSelect = React.forwardRef(({ className, 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) => {
|
|
73327
|
+
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) => {
|
|
73315
73328
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
73316
73329
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
73317
73330
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
@@ -73368,9 +73381,6 @@ const FISSelect = React.forwardRef(({ className, size = "md", options, value, di
|
|
|
73368
73381
|
const computedDisplayValue = React.useMemo(() => {
|
|
73369
73382
|
if (multi) {
|
|
73370
73383
|
const count = value.length;
|
|
73371
|
-
if (count === 0) {
|
|
73372
|
-
return "";
|
|
73373
|
-
}
|
|
73374
73384
|
return multiDisplayText
|
|
73375
73385
|
? multiDisplayText(count)
|
|
73376
73386
|
: `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
|
|
@@ -73446,7 +73456,7 @@ const FISSelect = React.forwardRef(({ className, size = "md", options, value, di
|
|
|
73446
73456
|
document.addEventListener("mousedown", handleClickOutside);
|
|
73447
73457
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73448
73458
|
}, [referenceElement, popperElement]);
|
|
73449
|
-
return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, 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 }) }), 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: {
|
|
73459
|
+
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 }) }), 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: {
|
|
73450
73460
|
...styles.popper,
|
|
73451
73461
|
width: referenceElement?.offsetWidth,
|
|
73452
73462
|
zIndex: 9999,
|
|
@@ -73470,7 +73480,6 @@ const useToast = () => {
|
|
|
73470
73480
|
return context;
|
|
73471
73481
|
};
|
|
73472
73482
|
|
|
73473
|
-
// import FISSelect from "../Select";
|
|
73474
73483
|
const PaginationAntdSC = styled(Pagination) `
|
|
73475
73484
|
display: flex;
|
|
73476
73485
|
align-items: center;
|
|
@@ -73573,6 +73582,7 @@ const PaginationAntdSC = styled(Pagination) `
|
|
|
73573
73582
|
`}
|
|
73574
73583
|
`;
|
|
73575
73584
|
const DivPaginationContainer = styled.div `
|
|
73585
|
+
width: 100%;
|
|
73576
73586
|
display: flex;
|
|
73577
73587
|
align-items: center;
|
|
73578
73588
|
justify-content: space-between;
|
|
@@ -73594,10 +73604,6 @@ const SpanTotalSC = styled.span `
|
|
|
73594
73604
|
${getTheme("Paragraph/Sm")};
|
|
73595
73605
|
color: ${getTheme("com/pagination/range-number/label/color-text")} !important;
|
|
73596
73606
|
`;
|
|
73597
|
-
// export const SelectPageSizeSC = styled(FISSelect)`
|
|
73598
|
-
// // fixed
|
|
73599
|
-
// width: 100px;
|
|
73600
|
-
// `;
|
|
73601
73607
|
|
|
73602
73608
|
const LIMIT_DEFAULT = 10;
|
|
73603
73609
|
const FISPagination = ({ pageSize = LIMIT_DEFAULT, current = 1, total = 0, minimize, recordCounted, onIconPageRecordClick, showTotal, ...rest }) => {
|
|
@@ -73629,7 +73635,7 @@ const FISPagination = ({ pageSize = LIMIT_DEFAULT, current = 1, total = 0, minim
|
|
|
73629
73635
|
}
|
|
73630
73636
|
return originalElement;
|
|
73631
73637
|
};
|
|
73632
|
-
return (jsxRuntime.jsxs(DivPaginationContainer, { children: [jsxRuntime.jsx(SpanTotalSC, { children: showTotal ? showTotal(total, rangeRecords) : defaultShowTotal }), jsxRuntime.jsxs(DivPaginationContent, { children: [jsxRuntime.jsx(PaginationAntdSC, { ...mergedProps, "$minimize": Boolean(minimize), showSizeChanger: false, itemRender: itemRender }), jsxRuntime.jsx(FISSelect, { size: "xs", options: [
|
|
73638
|
+
return (jsxRuntime.jsxs(DivPaginationContainer, { children: [jsxRuntime.jsx(SpanTotalSC, { children: showTotal ? showTotal(total, rangeRecords) : defaultShowTotal }), jsxRuntime.jsxs(DivPaginationContent, { children: [jsxRuntime.jsx(PaginationAntdSC, { ...mergedProps, "$minimize": Boolean(minimize), showSizeChanger: false, itemRender: itemRender }), jsxRuntime.jsx(FISSelect, { style: { width: "94px" }, size: "xs", options: [
|
|
73633
73639
|
{
|
|
73634
73640
|
groupLabel: "",
|
|
73635
73641
|
items: (rest.pageSizeOptions || [10, 20, 50, 100]).map((size) => ({
|