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 CHANGED
@@ -61568,7 +61568,7 @@ function ExitIcon(props) {
61568
61568
  }
61569
61569
 
61570
61570
  function InfoIcon(props) {
61571
- return (jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_6263_11228)", children: jsxRuntime.jsx("path", { d: "M7.99967 10.6667V8.00004M7.99967 5.33337H8.00634M14.6663 8.00004C14.6663 11.6819 11.6816 14.6667 7.99967 14.6667C4.31778 14.6667 1.33301 11.6819 1.33301 8.00004C1.33301 4.31814 4.31778 1.33337 7.99967 1.33337C11.6816 1.33337 14.6663 4.31814 14.6663 8.00004Z", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_6263_11228", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }));
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 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.80013 0.666626C4.75004 0.666626 1.4668 3.94987 1.4668 7.99996C1.4668 12.05 4.75004 15.3333 8.80013 15.3333C12.8502 15.3333 16.1335 12.05 16.1335 7.99996C16.1335 3.94987 12.8502 0.666626 8.80013 0.666626ZM9.4668 5.33329C9.4668 4.9651 9.16832 4.66663 8.80013 4.66663C8.43194 4.66663 8.13346 4.9651 8.13346 5.33329V7.99996C8.13346 8.36815 8.43194 8.66663 8.80013 8.66663C9.16832 8.66663 9.4668 8.36815 9.4668 7.99996V5.33329ZM8.80013 9.99996C8.43194 9.99996 8.13346 10.2984 8.13346 10.6666C8.13346 11.0348 8.43194 11.3333 8.80013 11.3333H8.8068C9.17499 11.3333 9.47346 11.0348 9.47346 10.6666C9.47346 10.2984 9.17499 9.99996 8.8068 9.99996H8.80013Z", fill: "#BC6300" }) }));
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: width, height: height, viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.40023 0.666626C4.35014 0.666626 1.06689 3.94987 1.06689 7.99996C1.06689 12.05 4.35014 15.3333 8.40023 15.3333C12.4503 15.3333 15.7336 12.05 15.7336 7.99996C15.7336 3.94987 12.4503 0.666626 8.40023 0.666626ZM9.06689 5.33329C9.06689 4.9651 8.76842 4.66663 8.40023 4.66663C8.03204 4.66663 7.73356 4.9651 7.73356 5.33329V7.99996C7.73356 8.36815 8.03204 8.66663 8.40023 8.66663C8.76842 8.66663 9.06689 8.36815 9.06689 7.99996V5.33329ZM8.40023 9.99996C8.03204 9.99996 7.73356 10.2984 7.73356 10.6666C7.73356 11.0348 8.03204 11.3333 8.40023 11.3333H8.40689C8.77508 11.3333 9.07356 11.0348 9.07356 10.6666C9.07356 10.2984 8.77508 9.99996 8.40689 9.99996H8.40023Z", fill: "#D8473C" }) }));
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(CheckIcon, {}),
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(.disabled):not(:has(.icon-suffix:hover)) {
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 [search, setSearch] = React.useState("");
67349
- const menuState = React.useMemo(() => {
67350
- const selectedItemsGroup = multi
67351
- ? {
67352
- groupLabel: selectedGroupLabel,
67353
- items: groups
67354
- .flatMap((group) => group.items)
67355
- .filter((item) => selectedValues?.includes(item.value) &&
67356
- item?.label?.toLowerCase().includes(search.toLowerCase())),
67357
- }
67358
- : null;
67359
- const otherGroups = groups
67360
- .map((group) => ({
67361
- groupLabel: group?.groupLabel,
67362
- items: group.items.filter((item) => (!multi || !selectedValues?.includes(item.value)) &&
67363
- item?.label?.toLowerCase().includes(search.toLowerCase())),
67364
- }))
67365
- .filter((group) => group.items.length > 0);
67366
- const filteredGroups = selectedItemsGroup && selectedItemsGroup.items.length > 0
67367
- ? [selectedItemsGroup, ...otherGroups]
67368
- : otherGroups;
67369
- const removeSelectedGroup = multi && selectedValues.length > 0
67370
- ? {
67371
- groupLabel: "",
67372
- items: [
67373
- {
67374
- label: removeSelectedText,
67375
- description: "",
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
- search,
67383
- selectedItemsGroup,
67384
- otherGroups,
67385
- filteredGroups,
67386
- removeSelectedGroup,
67430
+ groupLabel: selectedGroupLabel,
67431
+ items: selectedItems,
67387
67432
  };
67388
- }, [
67389
- groups,
67390
- multi,
67391
- search,
67392
- selectedValues,
67393
- removeSelectedText,
67394
- selectedGroupLabel,
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 hasFilteredResult = menuState.filteredGroups.length > 0;
67451
+ const showInput = totalItems >= 7 || hasSearch;
67452
+ const hasFilteredResult = groupsToRender.length > 0;
67400
67453
  const shouldShowNoResult = hasSearch && !hasFilteredResult;
67401
67454
  const handleSearchChange = (e) => {
67402
- setSearch(e.target.value);
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?.includes(item.value)) {
67466
+ if (selectedValues.includes(item.value)) {
67412
67467
  newValues = selectedValues.filter((v) => v !== item.value);
67413
67468
  }
67414
67469
  else {
67415
- newValues = [...(selectedValues || []), item.value];
67470
+ newValues = [...selectedValues, item.value];
67416
67471
  }
67417
67472
  onChangeSelected?.(newValues);
67418
67473
  return;
67419
67474
  }
67420
67475
  else {
67421
- const newValues = selectedValues?.[0] === item.value ? [] : [item.value];
67476
+ const newValues = selectedValues[0] === item.value ? [] : [item.value];
67422
67477
  onChangeSelected?.(newValues);
67423
67478
  onClickMenu?.();
67424
67479
  }
67425
67480
  };
67426
- return (jsxRuntime.jsxs(DivContainerSC$4, { className: className, children: [showInput && !combobox && (jsxRuntime.jsx(DivSearchSC, { children: jsxRuntime.jsx(FISInputText, { iconPrefix: jsxRuntime.jsx(SearchIcon, {}), placeholder: placeholder, 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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuContent, { "$removeSelectedGroup": !!menuState.removeSelectedGroup, children: menuState.filteredGroups.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))) }), menuState.removeSelectedGroup && (jsxRuntime.jsx(FixedBottomSection, { children: jsxRuntime.jsx(DivWrapperSC$4, { children: menuState.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))) }) }))] }))] }));
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(props) {
70029
+ function Portal({ container, children, portal }) {
69975
70030
  const [mountNode, setMountNode] = React.useState(null);
69976
70031
  React.useLayoutEffect(() => {
69977
- setMountNode(props.container || getDefaultContainer());
69978
- }, [props.container]);
69979
- return mountNode ? ReactDOM.createPortal(props.children, mountNode) : null;
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: description && jsxRuntime.jsx("div", { className: "description", children: description }) })] }) }));
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}:read-only) {
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 { styles, attributes } = usePopper(referenceElement, popperElement, {
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 handleToggle = React.useCallback(() => {
73287
- if (!disabled)
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
- const handleClickOutside = (event) => {
73292
- if (referenceElement &&
73293
- !referenceElement.contains(event.target) &&
73294
- popperElement &&
73295
- !popperElement.contains(event.target)) {
73296
- setIsOpen(false);
73297
- }
73298
- };
73299
- document.addEventListener("mousedown", handleClickOutside);
73300
- return () => document.removeEventListener("mousedown", handleClickOutside);
73301
- }, [referenceElement, popperElement]);
73302
- const flatItems = React.useMemo(() => options.flatMap((group) => group.items), [options]);
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 selected = flatItems.filter((item) => value.includes(item.value));
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
- const selected = flatItems.find((item) => item.value === value);
73313
- if (!selected)
73397
+ if (!selectedItems[0])
73314
73398
  return "";
73315
- return displayValue?.(selected) || selected.label;
73399
+ return (displayValue?.(selectedItems[0]) || selectedItems[0].label);
73316
73400
  }
73317
- }, [value, flatItems, multi, displayValue]);
73318
- const selectedOptions = React.useMemo(() => {
73319
- if (multi) {
73320
- return flatItems
73321
- .filter((item) => value.includes(item.value))
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
- 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: selectedOptions, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: { ...styles.popper, width: referenceElement?.offsetWidth }, ...attributes.popper, children: jsxRuntime.jsx(FISMenuSelect, { size: isMenuSize(size) ? size : "md", groups: options, placeholder: placeholderSearch, loading: loading, multi: multi, selectedValues: multi ? value : value ? [value] : [], onChangeSelected: (values) => {
73337
- if (multi) {
73338
- onChange(values);
73339
- }
73340
- else {
73341
- onChange(values?.[0]);
73342
- setIsOpen(false);
73343
- }
73344
- }, onClickMenu: () => {
73345
- if (!multi) {
73346
- setIsOpen(false);
73347
- }
73348
- }, ...restProps }) }) }))] }));
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