fis-component 0.0.51 → 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 +243 -123
- 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 +18 -6
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +10 -4
- package/dist/cjs/types/src/components/Select/types.d.ts +20 -17
- package/dist/esm/index.js +243 -123
- 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 +18 -6
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +10 -4
- package/dist/esm/types/src/components/Select/types.d.ts +20 -17
- package/dist/index.d.ts +26 -20
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -61548,7 +61548,7 @@ function ExitIcon(props) {
|
|
|
61548
61548
|
}
|
|
61549
61549
|
|
|
61550
61550
|
function InfoIcon(props) {
|
|
61551
|
-
return (
|
|
61551
|
+
return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: 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" }) }));
|
|
61552
61552
|
}
|
|
61553
61553
|
|
|
61554
61554
|
function CheckIcon(props) {
|
|
@@ -61558,12 +61558,17 @@ function CheckIcon(props) {
|
|
|
61558
61558
|
|
|
61559
61559
|
function WarningIcon(props) {
|
|
61560
61560
|
const { width = 16, height = 16, ...rest } = props;
|
|
61561
|
-
return (jsx("svg", { width: width, height: height, viewBox: "0 0
|
|
61561
|
+
return (jsx("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: 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" }) }));
|
|
61562
61562
|
}
|
|
61563
61563
|
|
|
61564
61564
|
function ErrorIcon(props) {
|
|
61565
61565
|
const { width = 16, height = 16, ...rest } = props;
|
|
61566
|
-
return (jsx("svg", { width:
|
|
61566
|
+
return (jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: 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" }) }));
|
|
61567
|
+
}
|
|
61568
|
+
|
|
61569
|
+
function PositiveIcon(props) {
|
|
61570
|
+
const { width = 16, height = 16, ...rest } = props;
|
|
61571
|
+
return (jsx("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: 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" }) }));
|
|
61567
61572
|
}
|
|
61568
61573
|
|
|
61569
61574
|
function ArrowDownIcon(props) {
|
|
@@ -62513,7 +62518,7 @@ const FISDivider = (props) => {
|
|
|
62513
62518
|
|
|
62514
62519
|
const themeIcons = {
|
|
62515
62520
|
info: jsx(InfoIcon, {}),
|
|
62516
|
-
positive: jsx(
|
|
62521
|
+
positive: jsx(PositiveIcon, {}),
|
|
62517
62522
|
caution: jsx(WarningIcon, {}),
|
|
62518
62523
|
negative: jsx(ErrorIcon, {}),
|
|
62519
62524
|
};
|
|
@@ -64210,6 +64215,7 @@ const InputSC$2 = styled.input `
|
|
|
64210
64215
|
border: none;
|
|
64211
64216
|
background: transparent;
|
|
64212
64217
|
outline: none;
|
|
64218
|
+
cursor: ${(props) => (props.$isPointer ? "pointer" : "text")};
|
|
64213
64219
|
padding-right: calc(
|
|
64214
64220
|
${getTheme("com/input/field/size-md/label/sub-spacing")} +
|
|
64215
64221
|
${getTheme("com/input/field/right-padding")}
|
|
@@ -64566,32 +64572,41 @@ const DivContainerSC$7 = styled.div `
|
|
|
64566
64572
|
pointer-events: auto;
|
|
64567
64573
|
}
|
|
64568
64574
|
|
|
64569
|
-
&:has(${InputSC$2}:disabled)
|
|
64570
|
-
&:has(${InputSC$2}:read-only) {
|
|
64575
|
+
&:has(${InputSC$2}:disabled) {
|
|
64571
64576
|
outline-color: ${getTheme("com/input/field/disable/stroke-color")};
|
|
64572
64577
|
background-color: ${getTheme("com/input/field/disable/background-color")};
|
|
64573
64578
|
cursor: not-allowed;
|
|
64574
64579
|
|
|
64580
|
+
${InputSC$2} {
|
|
64581
|
+
cursor: not-allowed;
|
|
64582
|
+
}
|
|
64583
|
+
|
|
64575
64584
|
${DivIconSC$2} {
|
|
64576
64585
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64586
|
+
cursor: not-allowed;
|
|
64577
64587
|
}
|
|
64578
64588
|
${DivIconSuffixSC$1} {
|
|
64579
64589
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64590
|
+
cursor: not-allowed;
|
|
64580
64591
|
}
|
|
64581
64592
|
${DivIconPrefixSC$1} {
|
|
64582
64593
|
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64594
|
+
cursor: not-allowed;
|
|
64583
64595
|
}
|
|
64584
64596
|
|
|
64585
64597
|
.icon-suffix {
|
|
64586
64598
|
pointer-events: none;
|
|
64587
64599
|
color: ${getTheme("com/button/disable/icon-color")};
|
|
64600
|
+
cursor: not-allowed;
|
|
64588
64601
|
}
|
|
64589
64602
|
|
|
64590
64603
|
${SpanTextPrefixSC} {
|
|
64591
64604
|
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64605
|
+
cursor: not-allowed;
|
|
64592
64606
|
}
|
|
64593
64607
|
${SpanTextSuffixSC} {
|
|
64594
64608
|
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64609
|
+
cursor: not-allowed;
|
|
64595
64610
|
}
|
|
64596
64611
|
|
|
64597
64612
|
&::placeholder {
|
|
@@ -64599,11 +64614,49 @@ const DivContainerSC$7 = styled.div `
|
|
|
64599
64614
|
}
|
|
64600
64615
|
}
|
|
64601
64616
|
|
|
64602
|
-
&:has(${InputSC$2}:read-only) {
|
|
64617
|
+
&:has(${InputSC$2}:read-only):not(:has(${InputSC$2}:disabled)) {
|
|
64603
64618
|
cursor: default;
|
|
64619
|
+
outline-color: ${getTheme("com/input/field/disable/stroke-color")};
|
|
64620
|
+
background-color: ${getTheme("com/input/field/disable/background-color")};
|
|
64621
|
+
|
|
64622
|
+
${InputSC$2} {
|
|
64623
|
+
cursor: default;
|
|
64624
|
+
}
|
|
64625
|
+
|
|
64626
|
+
${DivIconSC$2} {
|
|
64627
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64628
|
+
cursor: default;
|
|
64629
|
+
}
|
|
64630
|
+
${DivIconSuffixSC$1} {
|
|
64631
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64632
|
+
cursor: default;
|
|
64633
|
+
}
|
|
64634
|
+
${DivIconPrefixSC$1} {
|
|
64635
|
+
color: ${getTheme("com/input/field/disable/icon-color")};
|
|
64636
|
+
cursor: default;
|
|
64637
|
+
}
|
|
64638
|
+
|
|
64639
|
+
.icon-suffix {
|
|
64640
|
+
pointer-events: none;
|
|
64641
|
+
color: ${getTheme("com/button/disable/icon-color")};
|
|
64642
|
+
cursor: default;
|
|
64643
|
+
}
|
|
64644
|
+
|
|
64645
|
+
${SpanTextPrefixSC} {
|
|
64646
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64647
|
+
cursor: default;
|
|
64648
|
+
}
|
|
64649
|
+
${SpanTextSuffixSC} {
|
|
64650
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64651
|
+
cursor: default;
|
|
64652
|
+
}
|
|
64653
|
+
|
|
64654
|
+
&::placeholder {
|
|
64655
|
+
color: ${getTheme("com/input/field/disable/label-color")};
|
|
64656
|
+
}
|
|
64604
64657
|
}
|
|
64605
64658
|
|
|
64606
|
-
&:hover:not(
|
|
64659
|
+
&:hover:not(:has(${InputSC$2}:disabled)):not(:has(.icon-suffix:hover)) {
|
|
64607
64660
|
outline-color: ${getTheme("com/input/field/default/border/hover")};
|
|
64608
64661
|
background-color: ${getTheme("com/input/field/default/background/hover")};
|
|
64609
64662
|
|
|
@@ -64673,7 +64726,7 @@ const FISInputField = forwardRef(({ onClickSuffix, onClickPrefix, ...props }, re
|
|
|
64673
64726
|
"active-dropdown": activeDropdown,
|
|
64674
64727
|
disabled: disabled,
|
|
64675
64728
|
"input-text-lg": sizeInput === "lg",
|
|
64676
|
-
}), onClick: onClickPrefix, children: [iconPrefix && jsx(DivIconDropSC, { children: iconPrefix }), labelPrefix && jsx(SpanTextDropSC, { children: labelPrefix }), jsx(DivIconPrefixSC$1, { children: jsx(DropdownIcon, {}) })] })), jsx(InputSC$2, { ...rest, ref: ref, disabled: disabled, className: classNames({
|
|
64729
|
+
}), onClick: onClickPrefix, children: [iconPrefix && jsx(DivIconDropSC, { children: iconPrefix }), labelPrefix && jsx(SpanTextDropSC, { children: labelPrefix }), jsx(DivIconPrefixSC$1, { children: jsx(DropdownIcon, {}) })] })), jsx(InputSC$2, { ...rest, ref: ref, disabled: disabled, "$isPointer": props.$isPointer, className: classNames({
|
|
64677
64730
|
negative: negative,
|
|
64678
64731
|
"input-text-lg": sizeInput === "lg",
|
|
64679
64732
|
prefix: iconPrefix,
|
|
@@ -66294,7 +66347,7 @@ const PTitleSC$2 = styled.p `
|
|
|
66294
66347
|
${getTheme("Paragraph/Sm")}
|
|
66295
66348
|
color: ${getTheme("com/menu/item/action/label/color-text/default")};
|
|
66296
66349
|
`;
|
|
66297
|
-
styled.div `
|
|
66350
|
+
const DivWrapperMenuSC = styled.div `
|
|
66298
66351
|
display: flex;
|
|
66299
66352
|
flex-direction: column;
|
|
66300
66353
|
height: 100%;
|
|
@@ -67324,62 +67377,64 @@ const FISMenuSection = ({ label, withAction = false, actionText, actionLabel = f
|
|
|
67324
67377
|
};
|
|
67325
67378
|
FISMenuSection.displayName = "FISMenuSection";
|
|
67326
67379
|
|
|
67327
|
-
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", }) => {
|
|
67328
|
-
const [
|
|
67329
|
-
|
|
67330
|
-
|
|
67331
|
-
|
|
67332
|
-
|
|
67333
|
-
|
|
67334
|
-
|
|
67335
|
-
|
|
67336
|
-
|
|
67337
|
-
|
|
67338
|
-
|
|
67339
|
-
|
|
67340
|
-
|
|
67341
|
-
|
|
67342
|
-
|
|
67343
|
-
item
|
|
67344
|
-
|
|
67345
|
-
|
|
67346
|
-
|
|
67347
|
-
|
|
67348
|
-
|
|
67349
|
-
|
|
67350
|
-
|
|
67351
|
-
|
|
67352
|
-
|
|
67353
|
-
|
|
67354
|
-
|
|
67355
|
-
|
|
67356
|
-
value: "__remove_selected__",
|
|
67357
|
-
},
|
|
67358
|
-
],
|
|
67359
|
-
}
|
|
67360
|
-
: null;
|
|
67380
|
+
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", }) => {
|
|
67381
|
+
const [localSearch, setLocalSearch] = useState(searchValue);
|
|
67382
|
+
useEffect(() => {
|
|
67383
|
+
setLocalSearch(searchValue);
|
|
67384
|
+
}, [searchValue]);
|
|
67385
|
+
const search = localSearch;
|
|
67386
|
+
const filteredGroups = useMemo$1(() => {
|
|
67387
|
+
let filteredItems = groups.map((group) => ({
|
|
67388
|
+
groupLabel: group.groupLabel,
|
|
67389
|
+
items: multi
|
|
67390
|
+
? group.items.filter((item) => !selectedValues.includes(item.value))
|
|
67391
|
+
: group.items,
|
|
67392
|
+
}));
|
|
67393
|
+
if (search.trim()) {
|
|
67394
|
+
filteredItems = filteredItems.map((group) => ({
|
|
67395
|
+
...group,
|
|
67396
|
+
items: group.items.filter((item) => item.label.toLowerCase().includes(search.toLowerCase())),
|
|
67397
|
+
}));
|
|
67398
|
+
}
|
|
67399
|
+
return filteredItems.filter((group) => group.items.length > 0);
|
|
67400
|
+
}, [groups, multi, selectedValues, search]);
|
|
67401
|
+
const selectedItemsGroup = useMemo$1(() => {
|
|
67402
|
+
if (!multi)
|
|
67403
|
+
return null;
|
|
67404
|
+
const selectedItems = groups
|
|
67405
|
+
.flatMap((g) => g.items)
|
|
67406
|
+
.filter((item) => selectedValues.includes(item.value));
|
|
67407
|
+
if (selectedItems.length === 0)
|
|
67408
|
+
return null;
|
|
67361
67409
|
return {
|
|
67362
|
-
|
|
67363
|
-
|
|
67364
|
-
otherGroups,
|
|
67365
|
-
filteredGroups,
|
|
67366
|
-
removeSelectedGroup,
|
|
67410
|
+
groupLabel: selectedGroupLabel,
|
|
67411
|
+
items: selectedItems,
|
|
67367
67412
|
};
|
|
67368
|
-
}, [
|
|
67369
|
-
|
|
67370
|
-
|
|
67371
|
-
|
|
67372
|
-
|
|
67373
|
-
|
|
67374
|
-
|
|
67375
|
-
|
|
67413
|
+
}, [groups, multi, selectedValues, selectedGroupLabel]);
|
|
67414
|
+
const groupsToRender = selectedItemsGroup
|
|
67415
|
+
? [selectedItemsGroup, ...filteredGroups]
|
|
67416
|
+
: filteredGroups;
|
|
67417
|
+
const removeSelectedGroup = multi && selectedValues.length > 0
|
|
67418
|
+
? {
|
|
67419
|
+
groupLabel: "",
|
|
67420
|
+
items: [
|
|
67421
|
+
{
|
|
67422
|
+
label: removeSelectedText,
|
|
67423
|
+
description: "",
|
|
67424
|
+
value: "__remove_selected__",
|
|
67425
|
+
},
|
|
67426
|
+
],
|
|
67427
|
+
}
|
|
67428
|
+
: null;
|
|
67376
67429
|
const totalItems = groups.reduce((acc, group) => acc + group.items.length, 0);
|
|
67377
|
-
const showInput = totalItems >= 7;
|
|
67378
67430
|
const hasSearch = search.trim() !== "";
|
|
67379
|
-
const
|
|
67431
|
+
const showInput = totalItems >= 7 || hasSearch;
|
|
67432
|
+
const hasFilteredResult = groupsToRender.length > 0;
|
|
67380
67433
|
const shouldShowNoResult = hasSearch && !hasFilteredResult;
|
|
67381
67434
|
const handleSearchChange = (e) => {
|
|
67382
|
-
|
|
67435
|
+
const value = e.target.value;
|
|
67436
|
+
setLocalSearch(value);
|
|
67437
|
+
onSearchChange?.(value);
|
|
67383
67438
|
};
|
|
67384
67439
|
const handleItemClick = (item) => {
|
|
67385
67440
|
if (multi) {
|
|
@@ -67388,22 +67443,22 @@ const FISMenuSelect = ({ placeholder, groups, size = "md", multi = false, select
|
|
|
67388
67443
|
return;
|
|
67389
67444
|
}
|
|
67390
67445
|
let newValues;
|
|
67391
|
-
if (selectedValues
|
|
67446
|
+
if (selectedValues.includes(item.value)) {
|
|
67392
67447
|
newValues = selectedValues.filter((v) => v !== item.value);
|
|
67393
67448
|
}
|
|
67394
67449
|
else {
|
|
67395
|
-
newValues = [...
|
|
67450
|
+
newValues = [...selectedValues, item.value];
|
|
67396
67451
|
}
|
|
67397
67452
|
onChangeSelected?.(newValues);
|
|
67398
67453
|
return;
|
|
67399
67454
|
}
|
|
67400
67455
|
else {
|
|
67401
|
-
const newValues = selectedValues
|
|
67456
|
+
const newValues = selectedValues[0] === item.value ? [] : [item.value];
|
|
67402
67457
|
onChangeSelected?.(newValues);
|
|
67403
67458
|
onClickMenu?.();
|
|
67404
67459
|
}
|
|
67405
67460
|
};
|
|
67406
|
-
return (
|
|
67461
|
+
return (jsx(DivContainerSC$4, { className: className, children: jsxs(DivWrapperMenuSC, { children: [showInput && !combobox && (jsx(DivSearchSC, { children: jsx(FISInputText, { iconPrefix: jsx(SearchIcon, {}), placeholder: placeholder, value: search, onChange: handleSearchChange }) })), (shouldShowNoResult || noResult) && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoResultIcon, {}) }), jsx(PTitleSC$2, { children: noResultText })] })), noData && (jsxs(DivLoaderSC, { children: [jsx(DivIconDataSC, { children: jsx(NoDataIcon, {}) }), jsx(PTitleSC$2, { children: noDataText })] })), loading && (jsxs(DivLoaderSC, { children: [jsx(FISProgressCircular, { size: size, variant: "indeterminate" }), jsx(PTitleSC$2, { children: loadingText })] })), !shouldShowNoResult && !noData && !loading && (jsxs(Fragment, { children: [jsx(MenuContent, { "$removeSelectedGroup": !!removeSelectedGroup, children: groupsToRender.map((group, index) => (jsxs(DivWrapperSC$4, { children: [index !== 0 && jsx(FISMenuSection, { withDivider: true }), jsx(FISMenuSection, { label: group?.groupLabel }), group.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => handleItemClick(item), selected: selectedValues.includes(item.value), type: "select" }, idx)))] }, index))) }), removeSelectedGroup && (jsx(FixedBottomSection, { children: jsx(DivWrapperSC$4, { children: removeSelectedGroup.items.map((item, idx) => (jsx(FISMenuItem, { title: item.label, description: item.description, size: size, onClickMenu: () => onChangeSelected?.([]), type: "select", iconPrefix: jsx(RemoveIcon, {}), negative: true }, idx))) }) }))] }))] }) }));
|
|
67407
67462
|
};
|
|
67408
67463
|
FISMenuSelect.displayName = "FISMenuSelect";
|
|
67409
67464
|
|
|
@@ -70804,7 +70859,7 @@ const FISCombobox = forwardRef(({ className, options, value, disabled = false, t
|
|
|
70804
70859
|
}, [filteredOptions, searchValue]);
|
|
70805
70860
|
return (jsxs(DivWrapperSC$3, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC$2, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISInputField, { ...restProps, ref: ref, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: isOpen && searchValue !== undefined
|
|
70806
70861
|
? searchValue
|
|
70807
|
-
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper$1, { children: jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { children: jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsx(FISMenuSelect, { groups: filteredOptions, placeholder: placeholderSearch, loading: loading, multi: multi, combobox: true, noResult: hasNoResults, noResultText: noResultText, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
|
|
70862
|
+
: computedDisplayValue, disabled: disabled, onClickSuffix: handleToggle, onChange: handleInputChange, onKeyDown: handleInputKeyDown, "$isPointer": true }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper$1, { children: jsx(MultipleValue, { options: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { children: jsx(DivDropdownMenuSC$1, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsx(FISMenuSelect, { groups: filteredOptions, placeholder: placeholderSearch, loading: loading, multi: multi, combobox: true, noResult: hasNoResults, noResultText: noResultText, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
|
|
70808
70863
|
if (multi) {
|
|
70809
70864
|
onChange(values);
|
|
70810
70865
|
}
|
|
@@ -71268,7 +71323,7 @@ const DivHeaderCellContainerSC = styled.div `
|
|
|
71268
71323
|
`;
|
|
71269
71324
|
|
|
71270
71325
|
const FISTableHeaderCell = forwardRef(({ className, label, description, rightComponent, disabled, hasRightDivider = true, hasTruncateLabel = false, onlyIcon = false, textAlign = "left", ...rest }, ref) => {
|
|
71271
|
-
return (jsx(DivHeaderCellContainerSC, { ref: ref, className: classNames("header-cell-container", className), "$textAlign": textAlign, "$disabled": disabled, "$hasTruncateLabel": hasTruncateLabel, "$hasRightDivider": hasRightDivider, "$onlyIcon": onlyIcon, ...rest, children: jsxs("div", { className: "header-cell-content", children: [jsxs("div", { className: "cell-content title", children: [label && jsx("div", { className: "label", children: label }), rightComponent && (jsx("div", { className: "right-component-father", children: jsx("div", { className: "right-component-child", children: rightComponent }) }))] }), jsx("div", { className: "cell-content", children:
|
|
71326
|
+
return (jsx(DivHeaderCellContainerSC, { ref: ref, className: classNames("header-cell-container", className), "$textAlign": textAlign, "$disabled": disabled, "$hasTruncateLabel": hasTruncateLabel, "$hasRightDivider": hasRightDivider, "$onlyIcon": onlyIcon, ...rest, children: jsxs("div", { className: "header-cell-content", children: [jsxs("div", { className: "cell-content title", children: [label && jsx("div", { className: "label", children: label }), rightComponent && (jsx("div", { className: "right-component-father", children: jsx("div", { className: "right-component-child", children: rightComponent }) }))] }), description && (jsx("div", { className: "cell-content", children: jsx("div", { className: "description", children: description }) }))] }) }));
|
|
71272
71327
|
});
|
|
71273
71328
|
FISTableHeaderCell.displayName = "FISTableHeaderCell";
|
|
71274
71329
|
|
|
@@ -73002,7 +73057,7 @@ const DivInputWrapperSC = styled.div `
|
|
|
73002
73057
|
width: 100%;
|
|
73003
73058
|
`;
|
|
73004
73059
|
const DivDropdownMenuSC = styled.div `
|
|
73005
|
-
margin-top: ${getTheme("com/select/vertical-gap")};
|
|
73060
|
+
/* margin-top: ${getTheme("com/select/vertical-gap")}; */
|
|
73006
73061
|
`;
|
|
73007
73062
|
const SelectedTagsWrapper = styled.div `
|
|
73008
73063
|
display: flex;
|
|
@@ -73017,6 +73072,7 @@ const SelectedTagsWrapper = styled.div `
|
|
|
73017
73072
|
|
|
73018
73073
|
const InputSC = styled.input `
|
|
73019
73074
|
width: 100%;
|
|
73075
|
+
cursor: pointer;
|
|
73020
73076
|
color: ${getTheme("com/select/field/default/label/color-text/inputed")};
|
|
73021
73077
|
caret-color: ${getTheme("com/typing-cursor/default")};
|
|
73022
73078
|
border: none;
|
|
@@ -73200,12 +73256,17 @@ const DivContainerSC = styled.div `
|
|
|
73200
73256
|
`;
|
|
73201
73257
|
}
|
|
73202
73258
|
}}
|
|
73259
|
+
&:has(${InputSC}:read-only) {
|
|
73260
|
+
cursor: default;
|
|
73261
|
+
}
|
|
73262
|
+
&:has(${InputSC}:disabled) {
|
|
73263
|
+
cursor: not-allowed;
|
|
73264
|
+
}
|
|
73203
73265
|
|
|
73204
73266
|
&:has(${InputSC}:disabled),
|
|
73205
73267
|
&:has(${InputSC}:read-only) {
|
|
73206
73268
|
outline-color: ${getTheme("com/select/field/disable/stroke-color")};
|
|
73207
73269
|
background-color: ${getTheme("com/select/field/disable/background-color")};
|
|
73208
|
-
cursor: not-allowed;
|
|
73209
73270
|
|
|
73210
73271
|
${DivIconPrefixSC} {
|
|
73211
73272
|
color: ${getTheme("com/select/field/disable/color-icon")};
|
|
@@ -73219,11 +73280,7 @@ const DivContainerSC = styled.div `
|
|
|
73219
73280
|
}
|
|
73220
73281
|
}
|
|
73221
73282
|
|
|
73222
|
-
&:has(${InputSC}:
|
|
73223
|
-
cursor: default;
|
|
73224
|
-
}
|
|
73225
|
-
|
|
73226
|
-
&:hover:not(:has(.icon-suffix:hover)) {
|
|
73283
|
+
&:hover:not(:has(.icon-suffix:hover)):not(:has(${InputSC}:disabled)) {
|
|
73227
73284
|
outline-color: ${getTheme("com/select/field/default/border/hover")};
|
|
73228
73285
|
background-color: ${getTheme("com/select/field/default/background/hover")};
|
|
73229
73286
|
|
|
@@ -73255,80 +73312,143 @@ function isMenuSize(value) {
|
|
|
73255
73312
|
return value === "sm" || value === "md";
|
|
73256
73313
|
}
|
|
73257
73314
|
|
|
73258
|
-
const FISSelect = forwardRef(({ className, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, portal, ...restProps }, ref) => {
|
|
73315
|
+
const FISSelect = 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) => {
|
|
73259
73316
|
const [isOpen, setIsOpen] = useState(false);
|
|
73260
73317
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
73261
73318
|
const [popperElement, setPopperElement] = useState(null);
|
|
73262
|
-
const
|
|
73319
|
+
const popperOptions = useMemo$1(() => ({
|
|
73263
73320
|
modifiers: [
|
|
73264
73321
|
{ name: "preventOverflow", options: { padding: 0, altAxis: true } },
|
|
73322
|
+
{
|
|
73323
|
+
name: "offset",
|
|
73324
|
+
options: {
|
|
73325
|
+
offset: [0, 4],
|
|
73326
|
+
},
|
|
73327
|
+
},
|
|
73265
73328
|
],
|
|
73266
73329
|
placement: "bottom-start",
|
|
73267
73330
|
strategy: "fixed",
|
|
73268
|
-
});
|
|
73269
|
-
const
|
|
73270
|
-
|
|
73271
|
-
setIsOpen((prev) => !prev);
|
|
73272
|
-
}, [disabled]);
|
|
73331
|
+
}), []);
|
|
73332
|
+
const { styles, attributes } = usePopper(referenceElement, popperElement, popperOptions);
|
|
73333
|
+
const originalOptionsRef = useRef(options);
|
|
73273
73334
|
useEffect(() => {
|
|
73274
|
-
|
|
73275
|
-
|
|
73276
|
-
|
|
73277
|
-
|
|
73278
|
-
|
|
73279
|
-
|
|
73280
|
-
}
|
|
73281
|
-
};
|
|
73282
|
-
|
|
73283
|
-
|
|
73284
|
-
|
|
73285
|
-
|
|
73335
|
+
// Keep track of all items including selected ones
|
|
73336
|
+
const allItems = new Map();
|
|
73337
|
+
// Add items from current options
|
|
73338
|
+
options.forEach((group) => {
|
|
73339
|
+
group.items.forEach((item) => {
|
|
73340
|
+
allItems.set(item.value, item);
|
|
73341
|
+
});
|
|
73342
|
+
});
|
|
73343
|
+
// Add selected items that might not be in current options
|
|
73344
|
+
if (multi && Array.isArray(value)) {
|
|
73345
|
+
const selectedItems = originalOptionsRef.current
|
|
73346
|
+
.flatMap((group) => group.items)
|
|
73347
|
+
.filter((item) => value.includes(item.value));
|
|
73348
|
+
selectedItems.forEach((item) => {
|
|
73349
|
+
allItems.set(item.value, item);
|
|
73350
|
+
});
|
|
73351
|
+
}
|
|
73352
|
+
// Update originalOptionsRef with all items
|
|
73353
|
+
originalOptionsRef.current = [
|
|
73354
|
+
{
|
|
73355
|
+
items: Array.from(allItems.values()),
|
|
73356
|
+
},
|
|
73357
|
+
];
|
|
73358
|
+
}, [options, value, multi]);
|
|
73359
|
+
const selectedItems = useMemo$1(() => {
|
|
73360
|
+
const allItems = originalOptionsRef.current.flatMap((group) => group.items);
|
|
73361
|
+
if (multi) {
|
|
73362
|
+
return allItems.filter((item) => value.includes(item.value));
|
|
73363
|
+
}
|
|
73364
|
+
else {
|
|
73365
|
+
const found = allItems.find((item) => item.value === value);
|
|
73366
|
+
return found ? [found] : [];
|
|
73367
|
+
}
|
|
73368
|
+
}, [value, multi]);
|
|
73286
73369
|
const computedDisplayValue = useMemo$1(() => {
|
|
73287
73370
|
if (multi) {
|
|
73288
|
-
const
|
|
73289
|
-
const count = selected.length;
|
|
73371
|
+
const count = value.length;
|
|
73290
73372
|
return multiDisplayText
|
|
73291
73373
|
? multiDisplayText(count)
|
|
73292
73374
|
: `Selected ${count.toString().padStart(2, "0")} option${count !== 1 ? "s" : ""}`;
|
|
73293
73375
|
}
|
|
73294
73376
|
else {
|
|
73295
|
-
|
|
73296
|
-
if (!selected)
|
|
73377
|
+
if (!selectedItems[0])
|
|
73297
73378
|
return "";
|
|
73298
|
-
return displayValue?.(
|
|
73379
|
+
return (displayValue?.(selectedItems[0]) || selectedItems[0].label);
|
|
73299
73380
|
}
|
|
73300
|
-
}, [value,
|
|
73301
|
-
const
|
|
73302
|
-
if (
|
|
73303
|
-
|
|
73304
|
-
|
|
73305
|
-
.map((item) => ({ label: item.label, value: item.value }));
|
|
73306
|
-
}
|
|
73307
|
-
return value
|
|
73308
|
-
? flatItems
|
|
73309
|
-
.filter((item) => item.value === value)
|
|
73310
|
-
.map((item) => ({ label: item.label, value: item.value }))
|
|
73311
|
-
: [];
|
|
73312
|
-
}, [flatItems, value, multi]);
|
|
73381
|
+
}, [value, multi, displayValue, multiDisplayText, selectedItems]);
|
|
73382
|
+
const handleToggle = useCallback(() => {
|
|
73383
|
+
if (!disabled)
|
|
73384
|
+
setIsOpen((prev) => !prev);
|
|
73385
|
+
}, [disabled]);
|
|
73313
73386
|
const handleOptionRemove = useCallback((option) => {
|
|
73314
73387
|
if (multi) {
|
|
73315
73388
|
const newValues = value.filter((v) => v !== option.value);
|
|
73316
73389
|
onChange(newValues);
|
|
73317
73390
|
}
|
|
73318
73391
|
}, [multi, onChange, value]);
|
|
73319
|
-
|
|
73320
|
-
|
|
73321
|
-
|
|
73322
|
-
|
|
73323
|
-
|
|
73324
|
-
|
|
73325
|
-
|
|
73326
|
-
|
|
73327
|
-
|
|
73328
|
-
|
|
73329
|
-
|
|
73330
|
-
|
|
73331
|
-
|
|
73392
|
+
const handleMenuChange = useCallback((values) => {
|
|
73393
|
+
if (multi) {
|
|
73394
|
+
onChange(values);
|
|
73395
|
+
}
|
|
73396
|
+
else {
|
|
73397
|
+
onChange(values[0]);
|
|
73398
|
+
setIsOpen(false);
|
|
73399
|
+
}
|
|
73400
|
+
}, [multi, onChange]);
|
|
73401
|
+
const handleMenuClick = useCallback(() => {
|
|
73402
|
+
if (!multi) {
|
|
73403
|
+
setIsOpen(false);
|
|
73404
|
+
}
|
|
73405
|
+
}, [multi]);
|
|
73406
|
+
const menuProps = useMemo$1(() => ({
|
|
73407
|
+
groups: options,
|
|
73408
|
+
placeholder: placeholderSearch,
|
|
73409
|
+
loading,
|
|
73410
|
+
multi,
|
|
73411
|
+
size: isMenuSize(size) ? size : "md",
|
|
73412
|
+
selectedValues: multi
|
|
73413
|
+
? value
|
|
73414
|
+
: value
|
|
73415
|
+
? [value]
|
|
73416
|
+
: [],
|
|
73417
|
+
onChangeSelected: handleMenuChange,
|
|
73418
|
+
onClickMenu: handleMenuClick,
|
|
73419
|
+
searchValue,
|
|
73420
|
+
onSearchChange,
|
|
73421
|
+
...restProps,
|
|
73422
|
+
}), [
|
|
73423
|
+
options,
|
|
73424
|
+
placeholderSearch,
|
|
73425
|
+
loading,
|
|
73426
|
+
multi,
|
|
73427
|
+
size,
|
|
73428
|
+
value,
|
|
73429
|
+
handleMenuChange,
|
|
73430
|
+
handleMenuClick,
|
|
73431
|
+
searchValue,
|
|
73432
|
+
onSearchChange,
|
|
73433
|
+
restProps,
|
|
73434
|
+
]);
|
|
73435
|
+
useEffect(() => {
|
|
73436
|
+
const handleClickOutside = (event) => {
|
|
73437
|
+
if (referenceElement &&
|
|
73438
|
+
!referenceElement.contains(event.target) &&
|
|
73439
|
+
popperElement &&
|
|
73440
|
+
!popperElement.contains(event.target)) {
|
|
73441
|
+
setIsOpen(false);
|
|
73442
|
+
}
|
|
73443
|
+
};
|
|
73444
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
73445
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
73446
|
+
}, [referenceElement, popperElement]);
|
|
73447
|
+
return (jsxs(DivWrapperSC$1, { className: className, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
|
|
73448
|
+
...styles.popper,
|
|
73449
|
+
width: referenceElement?.offsetWidth,
|
|
73450
|
+
zIndex: 9999,
|
|
73451
|
+
}, ...attributes.popper, children: jsx(FISMenuSelect, { ...menuProps }) }) }))] }));
|
|
73332
73452
|
});
|
|
73333
73453
|
FISSelect.displayName = "FISSelect";
|
|
73334
73454
|
|