fis-component 0.0.50 → 0.0.52
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 +250 -127
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/assets/icons/PositiveIcon.d.ts +3 -0
- package/dist/cjs/types/src/assets/icons/index.d.ts +1 -0
- package/dist/cjs/types/src/components/Input/InputField/index.d.ts +2 -0
- package/dist/cjs/types/src/components/Input/InputField/styles.d.ts +3 -1
- package/dist/cjs/types/src/components/MenuSelect/types.d.ts +2 -0
- package/dist/cjs/types/src/components/Pagination/styles.d.ts +20 -6
- package/dist/cjs/types/src/components/Portal/index.d.ts +2 -1
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +10 -4
- package/dist/cjs/types/src/components/Select/types.d.ts +20 -16
- package/dist/esm/index.js +250 -127
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/assets/icons/PositiveIcon.d.ts +3 -0
- package/dist/esm/types/src/assets/icons/index.d.ts +1 -0
- package/dist/esm/types/src/components/Input/InputField/index.d.ts +2 -0
- package/dist/esm/types/src/components/Input/InputField/styles.d.ts +3 -1
- package/dist/esm/types/src/components/MenuSelect/types.d.ts +2 -0
- package/dist/esm/types/src/components/Pagination/styles.d.ts +20 -6
- package/dist/esm/types/src/components/Portal/index.d.ts +2 -1
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +10 -4
- package/dist/esm/types/src/components/Select/types.d.ts +20 -16
- package/dist/index.d.ts +26 -19
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -61568,7 +61568,7 @@ function ExitIcon(props) {
|
|
|
61568
61568
|
}
|
|
61569
61569
|
|
|
61570
61570
|
function InfoIcon(props) {
|
|
61571
|
-
return (jsxRuntime.
|
|
61571
|
+
return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.99996 0.666626C3.94987 0.666626 0.666626 3.94987 0.666626 7.99996C0.666626 12.05 3.94987 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.05 15.3333 7.99996C15.3333 3.94987 12.05 0.666626 7.99996 0.666626ZM7.99996 4.66663C7.63177 4.66663 7.33329 4.9651 7.33329 5.33329C7.33329 5.70148 7.63177 5.99996 7.99996 5.99996H8.00663C8.37482 5.99996 8.67329 5.70148 8.67329 5.33329C8.67329 4.9651 8.37482 4.66663 8.00663 4.66663H7.99996ZM8.66663 7.99996C8.66663 7.63177 8.36815 7.33329 7.99996 7.33329C7.63177 7.33329 7.33329 7.63177 7.33329 7.99996V10.6666C7.33329 11.0348 7.63177 11.3333 7.99996 11.3333C8.36815 11.3333 8.66663 11.0348 8.66663 10.6666V7.99996Z", fill: "#0055C2" }) }));
|
|
61572
61572
|
}
|
|
61573
61573
|
|
|
61574
61574
|
function CheckIcon(props) {
|
|
@@ -61578,12 +61578,17 @@ function CheckIcon(props) {
|
|
|
61578
61578
|
|
|
61579
61579
|
function WarningIcon(props) {
|
|
61580
61580
|
const { width = 16, height = 16, ...rest } = props;
|
|
61581
|
-
return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0
|
|
61581
|
+
return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.99996 0.666626C3.94987 0.666626 0.666626 3.94987 0.666626 7.99996C0.666626 12.05 3.94987 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.05 15.3333 7.99996C15.3333 3.94987 12.05 0.666626 7.99996 0.666626ZM8.66663 5.33329C8.66663 4.9651 8.36815 4.66663 7.99996 4.66663C7.63177 4.66663 7.33329 4.9651 7.33329 5.33329V7.99996C7.33329 8.36815 7.63177 8.66663 7.99996 8.66663C8.36815 8.66663 8.66663 8.36815 8.66663 7.99996V5.33329ZM7.99996 9.99996C7.63177 9.99996 7.33329 10.2984 7.33329 10.6666C7.33329 11.0348 7.63177 11.3333 7.99996 11.3333H8.00663C8.37482 11.3333 8.67329 11.0348 8.67329 10.6666C8.67329 10.2984 8.37482 9.99996 8.00663 9.99996H7.99996Z", fill: "#893700" }) }));
|
|
61582
61582
|
}
|
|
61583
61583
|
|
|
61584
61584
|
function ErrorIcon(props) {
|
|
61585
61585
|
const { width = 16, height = 16, ...rest } = props;
|
|
61586
|
-
return (jsxRuntime.jsx("svg", { width:
|
|
61586
|
+
return (jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.99996 0.666626C3.94987 0.666626 0.666626 3.94987 0.666626 7.99996C0.666626 12.05 3.94987 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.05 15.3333 7.99996C15.3333 3.94987 12.05 0.666626 7.99996 0.666626ZM8.66663 5.33329C8.66663 4.9651 8.36815 4.66663 7.99996 4.66663C7.63177 4.66663 7.33329 4.9651 7.33329 5.33329V7.99996C7.33329 8.36815 7.63177 8.66663 7.99996 8.66663C8.36815 8.66663 8.66663 8.36815 8.66663 7.99996V5.33329ZM7.99996 9.99996C7.63177 9.99996 7.33329 10.2984 7.33329 10.6666C7.33329 11.0348 7.63177 11.3333 7.99996 11.3333H8.00663C8.37482 11.3333 8.67329 11.0348 8.67329 10.6666C8.67329 10.2984 8.37482 9.99996 8.00663 9.99996H7.99996Z", fill: "#A80A12" }) }));
|
|
61587
|
+
}
|
|
61588
|
+
|
|
61589
|
+
function PositiveIcon(props) {
|
|
61590
|
+
const { width = 16, height = 16, ...rest } = props;
|
|
61591
|
+
return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.99996 0.666626C3.94987 0.666626 0.666626 3.94987 0.666626 7.99996C0.666626 12.05 3.94987 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.05 15.3333 7.99996C15.3333 3.94987 12.05 0.666626 7.99996 0.666626ZM11.4714 6.47136C11.7317 6.21101 11.7317 5.7889 11.4714 5.52855C11.211 5.26821 10.7889 5.26821 10.5286 5.52855L6.99996 9.05715L5.47136 7.52855C5.21101 7.2682 4.7889 7.2682 4.52855 7.52855C4.26821 7.7889 4.26821 8.21101 4.52855 8.47136L6.52855 10.4714C6.7889 10.7317 7.21101 10.7317 7.47136 10.4714L11.4714 6.47136Z", fill: "#00652A" }) }));
|
|
61587
61592
|
}
|
|
61588
61593
|
|
|
61589
61594
|
function ArrowDownIcon(props) {
|
|
@@ -62533,7 +62538,7 @@ const FISDivider = (props) => {
|
|
|
62533
62538
|
|
|
62534
62539
|
const themeIcons = {
|
|
62535
62540
|
info: jsxRuntime.jsx(InfoIcon, {}),
|
|
62536
|
-
positive: jsxRuntime.jsx(
|
|
62541
|
+
positive: jsxRuntime.jsx(PositiveIcon, {}),
|
|
62537
62542
|
caution: jsxRuntime.jsx(WarningIcon, {}),
|
|
62538
62543
|
negative: jsxRuntime.jsx(ErrorIcon, {}),
|
|
62539
62544
|
};
|
|
@@ -64230,6 +64235,7 @@ const InputSC$2 = styled.input `
|
|
|
64230
64235
|
border: none;
|
|
64231
64236
|
background: transparent;
|
|
64232
64237
|
outline: none;
|
|
64238
|
+
cursor: ${(props) => (props.$isPointer ? "pointer" : "text")};
|
|
64233
64239
|
padding-right: calc(
|
|
64234
64240
|
${getTheme("com/input/field/size-md/label/sub-spacing")} +
|
|
64235
64241
|
${getTheme("com/input/field/right-padding")}
|
|
@@ -64586,32 +64592,41 @@ const DivContainerSC$7 = styled.div `
|
|
|
64586
64592
|
pointer-events: auto;
|
|
64587
64593
|
}
|
|
64588
64594
|
|
|
64589
|
-
&:has(${InputSC$2}:disabled)
|
|
64590
|
-
&:has(${InputSC$2}:read-only) {
|
|
64595
|
+
&:has(${InputSC$2}:disabled) {
|
|
64591
64596
|
outline-color: ${getTheme("com/input/field/disable/stroke-color")};
|
|
64592
64597
|
background-color: ${getTheme("com/input/field/disable/background-color")};
|
|
64593
64598
|
cursor: not-allowed;
|
|
64594
64599
|
|
|
64600
|
+
${InputSC$2} {
|
|
64601
|
+
cursor: not-allowed;
|
|
64602
|
+
}
|
|
64603
|
+
|
|
64595
64604
|
${DivIconSC$2} {
|
|
64596
64605
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64606
|
+
cursor: not-allowed;
|
|
64597
64607
|
}
|
|
64598
64608
|
${DivIconSuffixSC$1} {
|
|
64599
64609
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64610
|
+
cursor: not-allowed;
|
|
64600
64611
|
}
|
|
64601
64612
|
${DivIconPrefixSC$1} {
|
|
64602
64613
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64614
|
+
cursor: not-allowed;
|
|
64603
64615
|
}
|
|
64604
64616
|
|
|
64605
64617
|
.icon-suffix {
|
|
64606
64618
|
pointer-events: none;
|
|
64607
64619
|
color: ${getTheme("com/button/disable/icon-color")};
|
|
64620
|
+
cursor: not-allowed;
|
|
64608
64621
|
}
|
|
64609
64622
|
|
|
64610
64623
|
${SpanTextPrefixSC} {
|
|
64611
64624
|
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64625
|
+
cursor: not-allowed;
|
|
64612
64626
|
}
|
|
64613
64627
|
${SpanTextSuffixSC} {
|
|
64614
64628
|
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64629
|
+
cursor: not-allowed;
|
|
64615
64630
|
}
|
|
64616
64631
|
|
|
64617
64632
|
&::placeholder {
|
|
@@ -64619,11 +64634,49 @@ const DivContainerSC$7 = styled.div `
|
|
|
64619
64634
|
}
|
|
64620
64635
|
}
|
|
64621
64636
|
|
|
64622
|
-
&:has(${InputSC$2}:read-only) {
|
|
64637
|
+
&:has(${InputSC$2}:read-only):not(:has(${InputSC$2}:disabled)) {
|
|
64623
64638
|
cursor: default;
|
|
64639
|
+
outline-color: ${getTheme("com/input/field/disable/stroke-color")};
|
|
64640
|
+
background-color: ${getTheme("com/input/field/disable/background-color")};
|
|
64641
|
+
|
|
64642
|
+
${InputSC$2} {
|
|
64643
|
+
cursor: default;
|
|
64644
|
+
}
|
|
64645
|
+
|
|
64646
|
+
${DivIconSC$2} {
|
|
64647
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64648
|
+
cursor: default;
|
|
64649
|
+
}
|
|
64650
|
+
${DivIconSuffixSC$1} {
|
|
64651
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64652
|
+
cursor: default;
|
|
64653
|
+
}
|
|
64654
|
+
${DivIconPrefixSC$1} {
|
|
64655
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64656
|
+
cursor: default;
|
|
64657
|
+
}
|
|
64658
|
+
|
|
64659
|
+
.icon-suffix {
|
|
64660
|
+
pointer-events: none;
|
|
64661
|
+
color: ${getTheme("com/button/disable/icon-color")};
|
|
64662
|
+
cursor: default;
|
|
64663
|
+
}
|
|
64664
|
+
|
|
64665
|
+
${SpanTextPrefixSC} {
|
|
64666
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64667
|
+
cursor: default;
|
|
64668
|
+
}
|
|
64669
|
+
${SpanTextSuffixSC} {
|
|
64670
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64671
|
+
cursor: default;
|
|
64672
|
+
}
|
|
64673
|
+
|
|
64674
|
+
&::placeholder {
|
|
64675
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64676
|
+
}
|
|
64624
64677
|
}
|
|
64625
64678
|
|
|
64626
|
-
&:hover:not(
|
|
64679
|
+
&:hover:not(:has(${InputSC$2}:disabled)):not(:has(.icon-suffix:hover)) {
|
|
64627
64680
|
outline-color: ${getTheme("com/input/field/default/border/hover")};
|
|
64628
64681
|
background-color: ${getTheme("com/input/field/default/background/hover")};
|
|
64629
64682
|
|
|
@@ -64693,7 +64746,7 @@ const FISInputField = React.forwardRef(({ onClickSuffix, onClickPrefix, ...props
|
|
|
64693
64746
|
"active-dropdown": activeDropdown,
|
|
64694
64747
|
disabled: disabled,
|
|
64695
64748
|
"input-text-lg": sizeInput === "lg",
|
|
64696
|
-
}), onClick: onClickPrefix, children: [iconPrefix && jsxRuntime.jsx(DivIconDropSC, { children: iconPrefix }), labelPrefix && jsxRuntime.jsx(SpanTextDropSC, { children: labelPrefix }), jsxRuntime.jsx(DivIconPrefixSC$1, { children: jsxRuntime.jsx(DropdownIcon, {}) })] })), jsxRuntime.jsx(InputSC$2, { ...rest, ref: ref, disabled: disabled, className: classNames({
|
|
64749
|
+
}), onClick: onClickPrefix, children: [iconPrefix && jsxRuntime.jsx(DivIconDropSC, { children: iconPrefix }), labelPrefix && jsxRuntime.jsx(SpanTextDropSC, { children: labelPrefix }), jsxRuntime.jsx(DivIconPrefixSC$1, { children: jsxRuntime.jsx(DropdownIcon, {}) })] })), jsxRuntime.jsx(InputSC$2, { ...rest, ref: ref, disabled: disabled, "$isPointer": props.$isPointer, className: classNames({
|
|
64697
64750
|
negative: negative,
|
|
64698
64751
|
"input-text-lg": sizeInput === "lg",
|
|
64699
64752
|
prefix: iconPrefix,
|
|
@@ -66314,7 +66367,7 @@ const PTitleSC$2 = styled.p `
|
|
|
66314
66367
|
${getTheme("Paragraph/Sm")}
|
|
66315
66368
|
color: ${getTheme("com/menu/item/action/label/color-text/default")};
|
|
66316
66369
|
`;
|
|
66317
|
-
styled.div `
|
|
66370
|
+
const DivWrapperMenuSC = styled.div `
|
|
66318
66371
|
display: flex;
|
|
66319
66372
|
flex-direction: column;
|
|
66320
66373
|
height: 100%;
|
|
@@ -67344,62 +67397,64 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
|
|
|
67344
67397
|
};
|
|
67345
67398
|
FISMenuSection.displayName = "FISMenuSection";
|
|
67346
67399
|
|
|
67347
|
-
const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, selectedValues = [], onChangeSelected, loading = false, noData = false, noResult = false, combobox, className, onClickMenu, loadingText = "Data loading...", noDataText = "No data", noResultText = "No result", removeSelectedText = "Remove selected", selectedGroupLabel = "Selected", }) => {
|
|
67348
|
-
const [
|
|
67349
|
-
|
|
67350
|
-
|
|
67351
|
-
|
|
67352
|
-
|
|
67353
|
-
|
|
67354
|
-
|
|
67355
|
-
|
|
67356
|
-
|
|
67357
|
-
|
|
67358
|
-
|
|
67359
|
-
|
|
67360
|
-
|
|
67361
|
-
|
|
67362
|
-
|
|
67363
|
-
item
|
|
67364
|
-
|
|
67365
|
-
|
|
67366
|
-
|
|
67367
|
-
|
|
67368
|
-
|
|
67369
|
-
|
|
67370
|
-
|
|
67371
|
-
|
|
67372
|
-
|
|
67373
|
-
|
|
67374
|
-
|
|
67375
|
-
|
|
67376
|
-
value: "__remove_selected__",
|
|
67377
|
-
},
|
|
67378
|
-
],
|
|
67379
|
-
}
|
|
67380
|
-
: null;
|
|
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", }) => {
|
|
67401
|
+
const [localSearch, setLocalSearch] = React.useState(searchValue);
|
|
67402
|
+
React.useEffect(() => {
|
|
67403
|
+
setLocalSearch(searchValue);
|
|
67404
|
+
}, [searchValue]);
|
|
67405
|
+
const search = localSearch;
|
|
67406
|
+
const filteredGroups = React.useMemo(() => {
|
|
67407
|
+
let filteredItems = groups.map((group) => ({
|
|
67408
|
+
groupLabel: group.groupLabel,
|
|
67409
|
+
items: multi
|
|
67410
|
+
? group.items.filter((item) => !selectedValues.includes(item.value))
|
|
67411
|
+
: group.items,
|
|
67412
|
+
}));
|
|
67413
|
+
if (search.trim()) {
|
|
67414
|
+
filteredItems = filteredItems.map((group) => ({
|
|
67415
|
+
...group,
|
|
67416
|
+
items: group.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase())),
|
|
67417
|
+
}));
|
|
67418
|
+
}
|
|
67419
|
+
return filteredItems.filter((group) => group.items.length > 0);
|
|
67420
|
+
}, [groups, multi, selectedValues, search]);
|
|
67421
|
+
const selectedItemsGroup = React.useMemo(() => {
|
|
67422
|
+
if (!multi)
|
|
67423
|
+
return null;
|
|
67424
|
+
const selectedItems = groups
|
|
67425
|
+
.flatMap((g) => g.items)
|
|
67426
|
+
.filter((item) => selectedValues.includes(item.value));
|
|
67427
|
+
if (selectedItems.length === 0)
|
|
67428
|
+
return null;
|
|
67381
67429
|
return {
|
|
67382
|
-
|
|
67383
|
-
|
|
67384
|
-
otherGroups,
|
|
67385
|
-
filteredGroups,
|
|
67386
|
-
removeSelectedGroup,
|
|
67430
|
+
groupLabel: selectedGroupLabel,
|
|
67431
|
+
items: selectedItems,
|
|
67387
67432
|
};
|
|
67388
|
-
}, [
|
|
67389
|
-
|
|
67390
|
-
|
|
67391
|
-
|
|
67392
|
-
|
|
67393
|
-
|
|
67394
|
-
|
|
67395
|
-
|
|
67433
|
+
}, [groups, multi, selectedValues, selectedGroupLabel]);
|
|
67434
|
+
const groupsToRender = selectedItemsGroup
|
|
67435
|
+
? [selectedItemsGroup, ...filteredGroups]
|
|
67436
|
+
: filteredGroups;
|
|
67437
|
+
const removeSelectedGroup = multi && selectedValues.length > 0
|
|
67438
|
+
? {
|
|
67439
|
+
groupLabel: "",
|
|
67440
|
+
items: [
|
|
67441
|
+
{
|
|
67442
|
+
label: removeSelectedText,
|
|
67443
|
+
description: "",
|
|
67444
|
+
value: "__remove_selected__",
|
|
67445
|
+
},
|
|
67446
|
+
],
|
|
67447
|
+
}
|
|
67448
|
+
: null;
|
|
67396
67449
|
const totalItems = groups.reduce((acc, group) => acc + group.items.length, 0);
|
|
67397
|
-
const showInput = totalItems >= 7;
|
|
67398
67450
|
const hasSearch = search.trim() !== "";
|
|
67399
|
-
const
|
|
67451
|
+
const showInput = totalItems >= 7 || hasSearch;
|
|
67452
|
+
const hasFilteredResult = groupsToRender.length > 0;
|
|
67400
67453
|
const shouldShowNoResult = hasSearch && !hasFilteredResult;
|
|
67401
67454
|
const handleSearchChange = (e) => {
|
|
67402
|
-
|
|
67455
|
+
const value = e.target.value;
|
|
67456
|
+
setLocalSearch(value);
|
|
67457
|
+
onSearchChange?.(value);
|
|
67403
67458
|
};
|
|
67404
67459
|
const handleItemClick = (item) => {
|
|
67405
67460
|
if (multi) {
|
|
@@ -67408,22 +67463,22 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67408
67463
|
return;
|
|
67409
67464
|
}
|
|
67410
67465
|
let newValues;
|
|
67411
|
-
if (selectedValues
|
|
67466
|
+
if (selectedValues.includes(item.value)) {
|
|
67412
67467
|
newValues = selectedValues.filter((v) => v !== item.value);
|
|
67413
67468
|
}
|
|
67414
67469
|
else {
|
|
67415
|
-
newValues = [...
|
|
67470
|
+
newValues = [...selectedValues, item.value];
|
|
67416
67471
|
}
|
|
67417
67472
|
onChangeSelected?.(newValues);
|
|
67418
67473
|
return;
|
|
67419
67474
|
}
|
|
67420
67475
|
else {
|
|
67421
|
-
const newValues = selectedValues
|
|
67476
|
+
const newValues = selectedValues[0] === item.value ? [] : [item.value];
|
|
67422
67477
|
onChangeSelected?.(newValues);
|
|
67423
67478
|
onClickMenu?.();
|
|
67424
67479
|
}
|
|
67425
67480
|
};
|
|
67426
|
-
return (jsxRuntime.
|
|
67481
|
+
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 }), 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))) }) }))] }))] }) }));
|
|
67427
67482
|
};
|
|
67428
67483
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67429
67484
|
|
|
@@ -69971,12 +70026,15 @@ function getDefaultContainer() {
|
|
|
69971
70026
|
rootPortal.setAttribute("id", rootId);
|
|
69972
70027
|
return document.body.appendChild(rootPortal);
|
|
69973
70028
|
}
|
|
69974
|
-
function Portal(
|
|
70029
|
+
function Portal({ container, children, portal }) {
|
|
69975
70030
|
const [mountNode, setMountNode] = React.useState(null);
|
|
69976
70031
|
React.useLayoutEffect(() => {
|
|
69977
|
-
setMountNode(
|
|
69978
|
-
}, [
|
|
69979
|
-
|
|
70032
|
+
setMountNode(container || getDefaultContainer());
|
|
70033
|
+
}, [container]);
|
|
70034
|
+
if (!portal) {
|
|
70035
|
+
return children || null;
|
|
70036
|
+
}
|
|
70037
|
+
return mountNode ? ReactDOM.createPortal(children, mountNode) : null;
|
|
69980
70038
|
}
|
|
69981
70039
|
|
|
69982
70040
|
const DivChipButtonWrapperSC = styled.div `
|
|
@@ -70821,7 +70879,7 @@ const FISCombobox = React.forwardRef(({ className, options, value, disabled = fa
|
|
|
70821
70879
|
}, [filteredOptions, searchValue]);
|
|
70822
70880
|
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
|
|
70823
70881
|
? searchValue
|
|
70824
|
-
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown }) }), 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) => {
|
|
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) => {
|
|
70825
70883
|
if (multi) {
|
|
70826
70884
|
onChange(values);
|
|
70827
70885
|
}
|
|
@@ -71285,7 +71343,7 @@ const DivHeaderCellContainerSC = styled.div `
|
|
|
71285
71343
|
`;
|
|
71286
71344
|
|
|
71287
71345
|
const FISTableHeaderCell = React.forwardRef(({ className, label, description, rightComponent, disabled, hasRightDivider = true, hasTruncateLabel = false, onlyIcon = false, textAlign = "left", ...rest }, ref) => {
|
|
71288
|
-
return (jsxRuntime.jsx(DivHeaderCellContainerSC, { ref: ref, className: classNames("header-cell-container", className), "$textAlign": textAlign, "$disabled": disabled, "$hasTruncateLabel": hasTruncateLabel, "$hasRightDivider": hasRightDivider, "$onlyIcon": onlyIcon, ...rest, children: jsxRuntime.jsxs("div", { className: "header-cell-content", children: [jsxRuntime.jsxs("div", { className: "cell-content title", children: [label && jsxRuntime.jsx("div", { className: "label", children: label }), rightComponent && (jsxRuntime.jsx("div", { className: "right-component-father", children: jsxRuntime.jsx("div", { className: "right-component-child", children: rightComponent }) }))] }), jsxRuntime.jsx("div", { className: "cell-content", children:
|
|
71346
|
+
return (jsxRuntime.jsx(DivHeaderCellContainerSC, { ref: ref, className: classNames("header-cell-container", className), "$textAlign": textAlign, "$disabled": disabled, "$hasTruncateLabel": hasTruncateLabel, "$hasRightDivider": hasRightDivider, "$onlyIcon": onlyIcon, ...rest, children: jsxRuntime.jsxs("div", { className: "header-cell-content", children: [jsxRuntime.jsxs("div", { className: "cell-content title", children: [label && jsxRuntime.jsx("div", { className: "label", children: label }), rightComponent && (jsxRuntime.jsx("div", { className: "right-component-father", children: jsxRuntime.jsx("div", { className: "right-component-child", children: rightComponent }) }))] }), description && (jsxRuntime.jsx("div", { className: "cell-content", children: jsxRuntime.jsx("div", { className: "description", children: description }) }))] }) }));
|
|
71289
71347
|
});
|
|
71290
71348
|
FISTableHeaderCell.displayName = "FISTableHeaderCell";
|
|
71291
71349
|
|
|
@@ -73019,7 +73077,7 @@ const DivInputWrapperSC = styled.div `
|
|
|
73019
73077
|
width: 100%;
|
|
73020
73078
|
`;
|
|
73021
73079
|
const DivDropdownMenuSC = styled.div `
|
|
73022
|
-
margin-top: ${getTheme("com/select/vertical-gap")};
|
|
73080
|
+
/* margin-top: ${getTheme("com/select/vertical-gap")}; */
|
|
73023
73081
|
`;
|
|
73024
73082
|
const SelectedTagsWrapper = styled.div `
|
|
73025
73083
|
display: flex;
|
|
@@ -73034,6 +73092,7 @@ const SelectedTagsWrapper = styled.div `
|
|
|
73034
73092
|
|
|
73035
73093
|
const InputSC = styled.input `
|
|
73036
73094
|
width: 100%;
|
|
73095
|
+
cursor: pointer;
|
|
73037
73096
|
color: ${getTheme("com/select/field/default/label/color-text/inputed")};
|
|
73038
73097
|
caret-color: ${getTheme("com/typing-cursor/default")};
|
|
73039
73098
|
border: none;
|
|
@@ -73217,12 +73276,17 @@ const DivContainerSC = styled.div `
|
|
|
73217
73276
|
`;
|
|
73218
73277
|
}
|
|
73219
73278
|
}}
|
|
73279
|
+
&:has(${InputSC}:read-only) {
|
|
73280
|
+
cursor: default;
|
|
73281
|
+
}
|
|
73282
|
+
&:has(${InputSC}:disabled) {
|
|
73283
|
+
cursor: not-allowed;
|
|
73284
|
+
}
|
|
73220
73285
|
|
|
73221
73286
|
&:has(${InputSC}:disabled),
|
|
73222
73287
|
&:has(${InputSC}:read-only) {
|
|
73223
73288
|
outline-color: ${getTheme("com/select/field/disable/stroke-color")};
|
|
73224
73289
|
background-color: ${getTheme("com/select/field/disable/background-color")};
|
|
73225
|
-
cursor: not-allowed;
|
|
73226
73290
|
|
|
73227
73291
|
${DivIconPrefixSC} {
|
|
73228
73292
|
color: ${getTheme("com/select/field/disable/color-icon")};
|
|
@@ -73236,11 +73300,7 @@ const DivContainerSC = styled.div `
|
|
|
73236
73300
|
}
|
|
73237
73301
|
}
|
|
73238
73302
|
|
|
73239
|
-
&:has(${InputSC}:
|
|
73240
|
-
cursor: default;
|
|
73241
|
-
}
|
|
73242
|
-
|
|
73243
|
-
&:hover:not(:has(.icon-suffix:hover)) {
|
|
73303
|
+
&:hover:not(:has(.icon-suffix:hover)):not(:has(${InputSC}:disabled)) {
|
|
73244
73304
|
outline-color: ${getTheme("com/select/field/default/border/hover")};
|
|
73245
73305
|
background-color: ${getTheme("com/select/field/default/background/hover")};
|
|
73246
73306
|
|
|
@@ -73272,80 +73332,143 @@ function isMenuSize(value) {
|
|
|
73272
73332
|
return value === "sm" || value === "md";
|
|
73273
73333
|
}
|
|
73274
73334
|
|
|
73275
|
-
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, ...restProps }, ref) => {
|
|
73335
|
+
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) => {
|
|
73276
73336
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
73277
73337
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
73278
73338
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
73279
|
-
const
|
|
73339
|
+
const popperOptions = React.useMemo(() => ({
|
|
73280
73340
|
modifiers: [
|
|
73281
73341
|
{ name: "preventOverflow", options: { padding: 0, altAxis: true } },
|
|
73342
|
+
{
|
|
73343
|
+
name: "offset",
|
|
73344
|
+
options: {
|
|
73345
|
+
offset: [0, 4],
|
|
73346
|
+
},
|
|
73347
|
+
},
|
|
73282
73348
|
],
|
|
73283
73349
|
placement: "bottom-start",
|
|
73284
73350
|
strategy: "fixed",
|
|
73285
|
-
});
|
|
73286
|
-
const
|
|
73287
|
-
|
|
73288
|
-
setIsOpen((prev) => !prev);
|
|
73289
|
-
}, [disabled]);
|
|
73351
|
+
}), []);
|
|
73352
|
+
const { styles, attributes } = usePopper(referenceElement, popperElement, popperOptions);
|
|
73353
|
+
const originalOptionsRef = React.useRef(options);
|
|
73290
73354
|
React.useEffect(() => {
|
|
73291
|
-
|
|
73292
|
-
|
|
73293
|
-
|
|
73294
|
-
|
|
73295
|
-
|
|
73296
|
-
|
|
73297
|
-
}
|
|
73298
|
-
};
|
|
73299
|
-
|
|
73300
|
-
|
|
73301
|
-
|
|
73302
|
-
|
|
73355
|
+
// Keep track of all items including selected ones
|
|
73356
|
+
const allItems = new Map();
|
|
73357
|
+
// Add items from current options
|
|
73358
|
+
options.forEach((group) => {
|
|
73359
|
+
group.items.forEach((item) => {
|
|
73360
|
+
allItems.set(item.value, item);
|
|
73361
|
+
});
|
|
73362
|
+
});
|
|
73363
|
+
// Add selected items that might not be in current options
|
|
73364
|
+
if (multi && Array.isArray(value)) {
|
|
73365
|
+
const selectedItems = originalOptionsRef.current
|
|
73366
|
+
.flatMap((group) => group.items)
|
|
73367
|
+
.filter((item) => value.includes(item.value));
|
|
73368
|
+
selectedItems.forEach((item) => {
|
|
73369
|
+
allItems.set(item.value, item);
|
|
73370
|
+
});
|
|
73371
|
+
}
|
|
73372
|
+
// Update originalOptionsRef with all items
|
|
73373
|
+
originalOptionsRef.current = [
|
|
73374
|
+
{
|
|
73375
|
+
items: Array.from(allItems.values()),
|
|
73376
|
+
},
|
|
73377
|
+
];
|
|
73378
|
+
}, [options, value, multi]);
|
|
73379
|
+
const selectedItems = React.useMemo(() => {
|
|
73380
|
+
const allItems = originalOptionsRef.current.flatMap((group) => group.items);
|
|
73381
|
+
if (multi) {
|
|
73382
|
+
return allItems.filter((item) => value.includes(item.value));
|
|
73383
|
+
}
|
|
73384
|
+
else {
|
|
73385
|
+
const found = allItems.find((item) => item.value === value);
|
|
73386
|
+
return found ? [found] : [];
|
|
73387
|
+
}
|
|
73388
|
+
}, [value, multi]);
|
|
73303
73389
|
const computedDisplayValue = React.useMemo(() => {
|
|
73304
73390
|
if (multi) {
|
|
73305
|
-
const
|
|
73306
|
-
const count = selected.length;
|
|
73391
|
+
const count = value.length;
|
|
73307
73392
|
return multiDisplayText
|
|
73308
73393
|
? multiDisplayText(count)
|
|
73309
73394
|
: `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
|
|
73310
73395
|
}
|
|
73311
73396
|
else {
|
|
73312
|
-
|
|
73313
|
-
if (!selected)
|
|
73397
|
+
if (!selectedItems[0])
|
|
73314
73398
|
return "";
|
|
73315
|
-
return displayValue?.(
|
|
73399
|
+
return (displayValue?.(selectedItems[0]) || selectedItems[0].label);
|
|
73316
73400
|
}
|
|
73317
|
-
}, [value,
|
|
73318
|
-
const
|
|
73319
|
-
if (
|
|
73320
|
-
|
|
73321
|
-
|
|
73322
|
-
.map((item) => ({ label: item.label, value: item.value }));
|
|
73323
|
-
}
|
|
73324
|
-
return value
|
|
73325
|
-
? flatItems
|
|
73326
|
-
.filter((item) => item.value === value)
|
|
73327
|
-
.map((item) => ({ label: item.label, value: item.value }))
|
|
73328
|
-
: [];
|
|
73329
|
-
}, [flatItems, value, multi]);
|
|
73401
|
+
}, [value, multi, displayValue, multiDisplayText, selectedItems]);
|
|
73402
|
+
const handleToggle = React.useCallback(() => {
|
|
73403
|
+
if (!disabled)
|
|
73404
|
+
setIsOpen((prev) => !prev);
|
|
73405
|
+
}, [disabled]);
|
|
73330
73406
|
const handleOptionRemove = React.useCallback((option) => {
|
|
73331
73407
|
if (multi) {
|
|
73332
73408
|
const newValues = value.filter((v) => v !== option.value);
|
|
73333
73409
|
onChange(newValues);
|
|
73334
73410
|
}
|
|
73335
73411
|
}, [multi, onChange, value]);
|
|
73336
|
-
|
|
73337
|
-
|
|
73338
|
-
|
|
73339
|
-
|
|
73340
|
-
|
|
73341
|
-
|
|
73342
|
-
|
|
73343
|
-
|
|
73344
|
-
|
|
73345
|
-
|
|
73346
|
-
|
|
73347
|
-
|
|
73348
|
-
|
|
73412
|
+
const handleMenuChange = React.useCallback((values) => {
|
|
73413
|
+
if (multi) {
|
|
73414
|
+
onChange(values);
|
|
73415
|
+
}
|
|
73416
|
+
else {
|
|
73417
|
+
onChange(values[0]);
|
|
73418
|
+
setIsOpen(false);
|
|
73419
|
+
}
|
|
73420
|
+
}, [multi, onChange]);
|
|
73421
|
+
const handleMenuClick = React.useCallback(() => {
|
|
73422
|
+
if (!multi) {
|
|
73423
|
+
setIsOpen(false);
|
|
73424
|
+
}
|
|
73425
|
+
}, [multi]);
|
|
73426
|
+
const menuProps = React.useMemo(() => ({
|
|
73427
|
+
groups: options,
|
|
73428
|
+
placeholder: placeholderSearch,
|
|
73429
|
+
loading,
|
|
73430
|
+
multi,
|
|
73431
|
+
size: isMenuSize(size) ? size : "md",
|
|
73432
|
+
selectedValues: multi
|
|
73433
|
+
? value
|
|
73434
|
+
: value
|
|
73435
|
+
? [value]
|
|
73436
|
+
: [],
|
|
73437
|
+
onChangeSelected: handleMenuChange,
|
|
73438
|
+
onClickMenu: handleMenuClick,
|
|
73439
|
+
searchValue,
|
|
73440
|
+
onSearchChange,
|
|
73441
|
+
...restProps,
|
|
73442
|
+
}), [
|
|
73443
|
+
options,
|
|
73444
|
+
placeholderSearch,
|
|
73445
|
+
loading,
|
|
73446
|
+
multi,
|
|
73447
|
+
size,
|
|
73448
|
+
value,
|
|
73449
|
+
handleMenuChange,
|
|
73450
|
+
handleMenuClick,
|
|
73451
|
+
searchValue,
|
|
73452
|
+
onSearchChange,
|
|
73453
|
+
restProps,
|
|
73454
|
+
]);
|
|
73455
|
+
React.useEffect(() => {
|
|
73456
|
+
const handleClickOutside = (event) => {
|
|
73457
|
+
if (referenceElement &&
|
|
73458
|
+
!referenceElement.contains(event.target) &&
|
|
73459
|
+
popperElement &&
|
|
73460
|
+
!popperElement.contains(event.target)) {
|
|
73461
|
+
setIsOpen(false);
|
|
73462
|
+
}
|
|
73463
|
+
};
|
|
73464
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
73465
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73466
|
+
}, [referenceElement, popperElement]);
|
|
73467
|
+
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: {
|
|
73468
|
+
...styles.popper,
|
|
73469
|
+
width: referenceElement?.offsetWidth,
|
|
73470
|
+
zIndex: 9999,
|
|
73471
|
+
}, ...attributes.popper, children: jsxRuntime.jsx(FISMenuSelect, { ...menuProps }) }) }))] }));
|
|
73349
73472
|
});
|
|
73350
73473
|
FISSelect.displayName = "FISSelect";
|
|
73351
73474
|
|