componentes-sinco 1.0.2-rc.7 → 1.0.2-rc.9

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/index.js CHANGED
@@ -31,9 +31,9 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
 
33
33
  // src/Components/Drawer/SCDrawer.tsx
34
- import React4 from "react";
35
- import { Box as Box4, Drawer, Typography as Typography4, IconButton as IconButton3, Button as Button2, Stack as Stack3 } from "@mui/material";
36
- import Grid3 from "@mui/material/Grid2";
34
+ import React7 from "react";
35
+ import { Box as Box7, Drawer, Typography as Typography7, IconButton as IconButton5, Button as Button4, Stack as Stack3 } from "@mui/material";
36
+ import Grid4 from "@mui/material/Grid2";
37
37
  import CloseIcon from "@mui/icons-material/Close";
38
38
 
39
39
  // src/Components/Textfield/SCTextField.tsx
@@ -75,12 +75,12 @@ function validateKeyDown(event2, format2) {
75
75
 
76
76
  // src/Components/Textfield/Helpers/validateOnBlur.tsx
77
77
  var validateOnBlurField = ({
78
- value,
78
+ state,
79
79
  required = false,
80
80
  setError,
81
81
  onBlur
82
82
  }) => (event2) => {
83
- const isError = !value.trim() && required;
83
+ const isError = !state.trim() && required;
84
84
  setError(isError);
85
85
  if (onBlur) {
86
86
  onBlur(event2);
@@ -109,8 +109,8 @@ var SCTextField = ({
109
109
  color,
110
110
  background,
111
111
  //Funcionales
112
+ setState,
112
113
  state,
113
- value,
114
114
  onChange,
115
115
  onBlur,
116
116
  onKeyDown
@@ -161,15 +161,15 @@ var SCTextField = ({
161
161
  const handleInputChange = (event2) => {
162
162
  let valueMax = maxLength ? maxLength + 1 : 50;
163
163
  if (event2.target.value.length < valueMax) {
164
- if (state) {
165
- state(event2.target.value);
164
+ if (setState) {
165
+ setState(event2.target.value);
166
166
  }
167
167
  if (onChange) {
168
168
  onChange(event2);
169
169
  }
170
170
  }
171
171
  };
172
- const handleBlur = validateOnBlurField({ value, required, setError, onBlur });
172
+ const handleBlur = validateOnBlurField({ state, required, setError, onBlur });
173
173
  const handleOpenInfoTitle = (event2) => {
174
174
  setAnchorInfoTitle(event2.currentTarget);
175
175
  };
@@ -244,7 +244,7 @@ var SCTextField = ({
244
244
  {
245
245
  size: size ? size : "medium",
246
246
  fullWidth: true,
247
- value,
247
+ value: state,
248
248
  error,
249
249
  id: label == null ? void 0 : label.replace(/\s+/g, ""),
250
250
  disabled: disabled != null ? disabled : false,
@@ -559,8 +559,8 @@ var SCTextArea = ({
559
559
  colorTitle,
560
560
  background,
561
561
  //funcionales
562
+ setState,
562
563
  state,
563
- value,
564
564
  onBlur
565
565
  }) => {
566
566
  const [helperCount, setHelperCount] = useState4(0);
@@ -568,11 +568,11 @@ var SCTextArea = ({
568
568
  const [anchorInfoTitle, setAnchorInfoTitle] = React3.useState(null);
569
569
  const openInfoTitle = Boolean(anchorInfoTitle);
570
570
  useEffect4(() => {
571
- setHelperCount(value == null ? void 0 : value.length);
572
- }, [value]);
571
+ setHelperCount(state == null ? void 0 : state.length);
572
+ }, [state]);
573
573
  const IconTitle = getIcon(iconTitle);
574
574
  const handleBlur = (event2) => {
575
- if (required && value.trim() === "") {
575
+ if (required && state.trim() === "") {
576
576
  setStateError(true);
577
577
  setTimeout(() => {
578
578
  setStateError(false);
@@ -634,11 +634,11 @@ var SCTextArea = ({
634
634
  multiline: true,
635
635
  disabled,
636
636
  rows,
637
- value,
637
+ value: state,
638
638
  onBlur: handleBlur,
639
639
  onChange: (e) => {
640
- if (state) {
641
- state(e.target.value.substring(0, maxLength));
640
+ if (setState) {
641
+ setState(e.target.value.substring(0, maxLength));
642
642
  }
643
643
  },
644
644
  autoComplete: "off"
@@ -656,683 +656,669 @@ var SCTextArea = ({
656
656
  ))));
657
657
  };
658
658
 
659
- // src/Components/Drawer/Helpers/Utils.tsx
659
+ // src/Components/SCSelect.tsx
660
+ import React4, { useEffect as useEffect5 } from "react";
661
+ import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as Box4 } from "@mui/material";
662
+ import Select from "@mui/material/Select";
660
663
  import * as Muicon2 from "@mui/icons-material";
661
- import { FilterListOutlined } from "@mui/icons-material";
662
- var getIcon2 = (iconName) => {
663
- if (iconName && iconName in Muicon2) {
664
- return Muicon2[iconName];
665
- }
666
- return FilterListOutlined;
667
- };
668
- var cleanInputs = (arrayElements) => {
669
- var _a, _b;
670
- for (let i = 0; i < arrayElements.length; i++) {
671
- if (arrayElements[i].component === void 0) {
672
- (_b = (_a = arrayElements[i]).state) == null ? void 0 : _b.call(_a, "");
664
+ function SCSelect({
665
+ label = "",
666
+ data,
667
+ getItemValue,
668
+ width = "100%",
669
+ size = "small",
670
+ variant = "outlined",
671
+ deleteType = "button",
672
+ required,
673
+ disabled,
674
+ background,
675
+ fnAplicar,
676
+ setState,
677
+ state
678
+ }) {
679
+ const labelContent = `<span class="red-asterisk">* </span>` + label;
680
+ let group = "";
681
+ let isSelected = false;
682
+ const [selectedOptions, setSelectedOptions] = React4.useState([]);
683
+ const [prevData, setPrevData] = React4.useState(data);
684
+ const [error, setError] = React4.useState(false);
685
+ useEffect5(() => {
686
+ if (error) {
687
+ setTimeout(() => {
688
+ setError(false);
689
+ }, 1e3);
673
690
  }
674
- }
675
- };
676
-
677
- // src/Components/Drawer/Helpers/validateInput.tsx
678
- var validateInputs = (arrayElements, onError, onSuccess) => {
679
- var _a;
680
- let requiredValues = 0;
681
- let filledValues = 0;
682
- for (let i = 0; i < arrayElements.length; i++) {
683
- if (arrayElements[i].component === void 0) {
684
- if (arrayElements[i].required) {
685
- requiredValues++;
686
- }
687
- if (arrayElements[i].required && ((_a = arrayElements[i].value) == null ? void 0 : _a.trim()) !== "") {
688
- filledValues++;
691
+ }, [error]);
692
+ useEffect5(() => {
693
+ let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
694
+ if (dataChangeValidation == false) {
695
+ setState({ hiddenValue: "", textValue: "" });
696
+ setSelectedOptions([]);
697
+ setPrevData(data);
698
+ }
699
+ }, [data]);
700
+ data.map(function(option, index, array) {
701
+ if (option == null ? void 0 : option.icon) {
702
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
703
+ option.icon = Muicon2[option == null ? void 0 : option.icon];
704
+ } else {
705
+ option;
689
706
  }
690
707
  }
691
- }
692
- if (requiredValues === filledValues) {
693
- onSuccess();
694
- } else {
695
- onError({
696
- type: "error",
697
- title: "Algunos campos son requeridos",
698
- time: 10
699
- });
700
- }
701
- };
702
-
703
- // src/generales/capitalize.tsx
704
- function capitalize(text) {
705
- return text.charAt(0).toUpperCase() + text.slice(1);
706
- }
707
-
708
- // src/Components/Drawer/SCDrawer.tsx
709
- var SCDrawer = ({
710
- //informativas
711
- title,
712
- arrayElements = [],
713
- actions,
714
- buttonDrawer,
715
- //Apariencia
716
- colorTitle,
717
- anchor = "left",
718
- width,
719
- //Funcionales
720
- open
721
- }) => {
722
- var _a;
723
- const [drawerOpen, setDrawerOpen] = React4.useState(open);
724
- const [toast, setToast] = React4.useState(null);
725
- const handleDrawerClose = () => {
726
- setDrawerOpen(false);
708
+ });
709
+ const cleanOptions = (event2) => {
710
+ setState({ hiddenValue: "", textValue: "" });
711
+ setSelectedOptions([]);
727
712
  };
728
- const toggleDrawer = (newOpen) => () => {
729
- setDrawerOpen(newOpen);
713
+ const handleBlur = () => {
714
+ const currentValue = Array.isArray(state.hiddenValue) ? state.hiddenValue[0] : state.hiddenValue;
715
+ const isError = !currentValue && !!required;
716
+ setError(Boolean(isError));
730
717
  };
731
- const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
732
- const setToastWithDelay = (toastContent) => {
733
- setToast(null);
734
- setTimeout(() => {
735
- setToast(toastContent);
736
- }, 10);
718
+ const handleChange = (event2) => {
719
+ const selectedValue = event2.target.value;
720
+ if (selectedValue) {
721
+ const selectedOption = data.find((item) => getItemValue(item).value === selectedValue);
722
+ if (selectedOption) {
723
+ const itemValue = getItemValue(selectedOption);
724
+ setState({
725
+ hiddenValue: itemValue.value,
726
+ textValue: itemValue.text
727
+ });
728
+ }
729
+ }
737
730
  };
738
- const inputValidation = () => validateInputs(arrayElements, setToastWithDelay, handleDrawerClose);
739
- const clean = () => cleanInputs(arrayElements);
740
- actions = actions != null ? actions : [{ text: "Limpiar", fn: clean }, { text: "Consultar", fn: inputValidation }];
741
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, toast && /* @__PURE__ */ React4.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React4.createElement(
742
- Button2,
743
- {
744
- "data-testid": "test-buttonDrawer",
745
- sx: { textTransform: "capitalize" },
746
- color: buttonDrawer == null ? void 0 : buttonDrawer.color,
747
- onClick: toggleDrawer(true),
748
- size: "small",
749
- variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
750
- startIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) ? /* @__PURE__ */ React4.createElement(ButtonIcon, { color: (buttonDrawer == null ? void 0 : buttonDrawer.color) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.color : "primary" }) : null,
751
- endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" ? /* @__PURE__ */ React4.createElement(ButtonIcon, { color: (buttonDrawer == null ? void 0 : buttonDrawer.color) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.color : "primary" }) : null
752
- },
753
- capitalize((_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "Drawer")
754
- ), /* @__PURE__ */ React4.createElement(
755
- Drawer,
731
+ return /* @__PURE__ */ React4.createElement(React4.Fragment, null, data && /* @__PURE__ */ React4.createElement(Box4, { sx: { width } }, /* @__PURE__ */ React4.createElement(
732
+ FormControl2,
756
733
  {
757
- open: drawerOpen,
758
- onClose: toggleDrawer(false),
759
- anchor: anchor != null ? anchor : "left",
760
- sx: {
761
- "& .MuiDrawer-paper": {
762
- width: width != null ? width : "450px",
763
- boxSizing: "border-box",
764
- borderRadius: anchor !== "right" ? "0px 4px 4px 0px" : "4px 0px 0px 4px"
765
- }
766
- }
734
+ fullWidth: true,
735
+ size: size ? size : "medium",
736
+ variant
767
737
  },
768
- /* @__PURE__ */ React4.createElement(Stack3, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ React4.createElement(Grid3, { container: true, sx: { backgroundColor: "secondary.main", alignItems: "center", height: "42px", textAlign: "left", padding: "10px 12px 10px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ React4.createElement(Typography4, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ React4.createElement(IconButton3, { onClick: handleDrawerClose }, /* @__PURE__ */ React4.createElement(CloseIcon, { color: "action", "data-testid": "test-button-close" }))), /* @__PURE__ */ React4.createElement(Stack3, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "12px 16px 12px 16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
769
- var _a2, _b;
770
- return /* @__PURE__ */ React4.createElement(
771
- Box4,
772
- {
773
- key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b = arrayElement.label) != null ? _b : ""}${index}`,
774
- sx: { width: "100%" }
775
- },
776
- arrayElement.component ? /* @__PURE__ */ React4.createElement(Stack3, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ React4.createElement(
777
- SCTextField,
778
- {
779
- title: arrayElement.title,
780
- iconTitle: arrayElement.iconTitle,
781
- infoTitle: arrayElement.infoTitle,
782
- label: arrayElement.label,
783
- placeholder: arrayElement.placeholder,
784
- infoElement: arrayElement.infoElement,
785
- iconInputStart: arrayElement.iconInputStart,
786
- iconInputEnd: arrayElement.iconInputEnd,
787
- maxLength: arrayElement.maxLength,
788
- variant: arrayElement.variant,
789
- format: arrayElement.format,
790
- disabled: arrayElement.disabled,
791
- required: arrayElement.required,
792
- size: arrayElement.size,
793
- width: arrayElement.width,
794
- color: arrayElement.color,
795
- background: arrayElement.background,
796
- state: arrayElement.state,
797
- value: arrayElement.value || "",
798
- onChange: arrayElement.onChange,
799
- onBlur: arrayElement.onBlur,
800
- onKeyDown: arrayElement.onKeyDown
801
- }
802
- ) : arrayElement.type === "textArea" ? /* @__PURE__ */ React4.createElement(
803
- SCTextArea,
804
- {
805
- title: arrayElement.title,
806
- iconTitle: arrayElement.iconTitle,
807
- infoTitle: arrayElement.infoTitle,
808
- label: arrayElement.label,
809
- placeholder: arrayElement.placeholder,
810
- maxLength: arrayElement.maxLength,
811
- variant: arrayElement.variant,
812
- disabled: arrayElement.disabled,
813
- required: arrayElement.required,
814
- width: arrayElement.width,
815
- rows: arrayElement.rows,
816
- background: arrayElement.background,
817
- state: arrayElement.state,
818
- value: arrayElement.value || "",
819
- onBlur: arrayElement.onBlur
820
- }
821
- ) : null
822
- );
823
- })), actions != void 0 && actions.length > 0 ? /* @__PURE__ */ React4.createElement(
824
- Grid3,
738
+ /* @__PURE__ */ React4.createElement(
739
+ InputLabel2,
825
740
  {
826
- container: true,
827
- bgcolor: "background.default",
828
- gap: 2,
829
- padding: "9px 16px 9px 16px",
830
- height: "42px",
831
- alignItems: "center",
832
- justifyContent: actions.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
833
- flexDirection: anchor != "right" ? "row-reverse" : "row"
741
+ required: required && label !== "" ? true : false,
742
+ error
834
743
  },
835
- actions.map((btn, index) => /* @__PURE__ */ React4.createElement(
836
- Button2,
837
- {
838
- key: index,
839
- variant: index === 0 || actions && actions.length < 2 ? "contained" : "text",
840
- color: "primary",
841
- onClick: btn.fn,
842
- disabled: btn.disabled || false,
843
- size: "small"
844
- },
845
- btn.text
846
- ))
847
- ) : "")
848
- ));
849
- };
850
-
851
- // src/Components/MultiSelect/SCMultiSelect.tsx
852
- import React5, { useEffect as useEffect5, useMemo as useMemo2 } from "react";
853
- import { Button as Button3, Checkbox, FormControl as FormControl2, InputAdornment as InputAdornment2, ListItemIcon, MenuItem, Popover as Popover3, Stack as Stack4, TextField as TextField2 } from "@mui/material";
854
- import { SearchOutlined } from "@mui/icons-material";
855
-
856
- // src/Components/MultiSelect/helpers/useHandlers.tsx
857
- import { useCallback, useState as useState5 } from "react";
858
- function useMultiSelectHandlers() {
859
- const [anchorEl, setAnchorEl] = useState5(null);
860
- const [open, setOpen] = useState5(false);
861
- const [selectedItems, setSelectedItems] = useState5([]);
862
- const [filterValue, setFilterValue] = useState5("");
863
- const handleOpen = useCallback((e) => {
864
- setAnchorEl(e.currentTarget);
865
- setOpen(true);
866
- }, []);
867
- const handleClose = useCallback(() => {
868
- setAnchorEl(null);
869
- setOpen(false);
870
- }, []);
871
- const handleFilterChange = useCallback(
872
- (e) => {
873
- setFilterValue(e.target.value);
874
- },
875
- []
876
- );
877
- const handleCheckboxToggle = useCallback((item) => {
878
- setSelectedItems(
879
- (prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
880
- );
881
- }, []);
882
- return {
883
- anchorEl,
884
- open,
885
- selectedItems,
886
- filterValue,
887
- setSelectedItems,
888
- handleOpen,
889
- handleClose,
890
- handleFilterChange,
891
- handleCheckboxToggle,
892
- setOpen
893
- };
894
- }
895
-
896
- // src/Components/MultiSelect/helpers/Utils.tsx
897
- import * as MuiIcons2 from "@mui/icons-material";
898
- import { FilterListOutlined as FilterListOutlined2 } from "@mui/icons-material";
899
- function getIconMultiSelect(name) {
900
- return name in MuiIcons2 ? MuiIcons2[name] : FilterListOutlined2;
744
+ label ? label : ""
745
+ ),
746
+ /* @__PURE__ */ React4.createElement(
747
+ Select,
748
+ {
749
+ value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
750
+ label: label ? label : "",
751
+ onChange: handleChange,
752
+ onBlur: handleBlur,
753
+ variant,
754
+ disabled: disabled || false,
755
+ error,
756
+ MenuProps: {
757
+ PaperProps: {
758
+ sx: {
759
+ left: "0px !important"
760
+ }
761
+ },
762
+ sx: {
763
+ "& .MuiPaper-root": {
764
+ left: "0px !important"
765
+ }
766
+ }
767
+ }
768
+ },
769
+ data.map((option, index) => {
770
+ return /* @__PURE__ */ React4.createElement(MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React4.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React4.createElement(SvgIcon3, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ React4.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
771
+ })
772
+ )
773
+ )));
901
774
  }
902
775
 
903
- // src/Components/MultiSelect/helpers/useFilteredItems.tsx
904
- import { useMemo } from "react";
905
- function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
906
- const filteredItems = useMemo(
907
- () => items.filter(
908
- (item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
909
- ),
910
- [items, filterValue, getItemLabel]
911
- );
912
- const sortedItems = useMemo(() => {
913
- return [
914
- ...filteredItems.filter((item) => selectedItems.includes(item)),
915
- ...filteredItems.filter((item) => !selectedItems.includes(item))
916
- ];
917
- }, [filteredItems, selectedItems]);
918
- return { filteredItems, sortedItems };
919
- }
920
-
921
- // src/Components/MultiSelect/SCMultiSelect.tsx
922
- function SCMultiSelect({
923
- textButton,
924
- button,
925
- items,
926
- topPanel,
927
- actions,
928
- dense = false,
929
- open,
930
- selectAll = false,
931
- getItemLabel
932
- }) {
933
- var _a, _b;
934
- const {
935
- anchorEl,
936
- open: openMultiselect,
937
- selectedItems,
938
- filterValue,
939
- setSelectedItems,
940
- handleOpen,
941
- handleClose,
942
- handleFilterChange,
943
- handleCheckboxToggle,
944
- setOpen
945
- } = useMultiSelectHandlers();
946
- useEffect5(() => {
947
- if (open !== void 0) {
948
- setOpen(open);
949
- }
950
- }, [open, setOpen]);
951
- useEffect5(() => {
952
- setSelectedItems([]);
953
- }, [items, setSelectedItems]);
954
- const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
955
- const Icon = useMemo2(() => {
956
- var _a2;
957
- return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
958
- }, [button == null ? void 0 : button.icon]);
959
- const handleSelectAll = () => {
960
- const allSelected2 = selectedItems.length === filteredItems.length;
961
- setSelectedItems(allSelected2 ? [] : filteredItems);
962
- };
963
- const allSelected = filteredItems.length > 0 && selectedItems.length === filteredItems.length;
964
- const resolvedActions = actions != null ? actions : [
965
- { text: "Limpiar", fn: handleClose },
966
- { text: "Aplicar", fn: () => {
967
- } }
968
- ];
969
- return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
970
- Button3,
971
- {
972
- "test-id": "multiselect-button",
973
- color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
974
- onClick: handleOpen,
975
- variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
976
- size: "small",
977
- startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ React5.createElement(Icon, null) : null,
978
- endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ React5.createElement(Icon, null) : null
979
- },
980
- capitalize(textButton != null ? textButton : "MultiSelect")
981
- ), /* @__PURE__ */ React5.createElement(
982
- Popover3,
983
- {
984
- elevation: 8,
985
- anchorEl,
986
- anchorOrigin: { vertical: "bottom", horizontal: "left" },
987
- open: openMultiselect,
988
- onClose: () => setOpen(false)
989
- },
990
- /* @__PURE__ */ React5.createElement(Stack4, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ React5.createElement(Stack4, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ React5.createElement(FormControl2, { fullWidth: true, size: "small" }, /* @__PURE__ */ React5.createElement(
991
- TextField2,
992
- {
993
- "data-testid": "multiselect-input",
994
- fullWidth: true,
995
- size: "small",
996
- variant: "outlined",
997
- placeholder: "Buscar",
998
- value: filterValue,
999
- onChange: handleFilterChange,
1000
- slotProps: {
1001
- input: {
1002
- endAdornment: /* @__PURE__ */ React5.createElement(InputAdornment2, { position: "end" }, /* @__PURE__ */ React5.createElement(SearchOutlined, { fontSize: "small" }))
1003
- }
1004
- }
1005
- }
1006
- ))), /* @__PURE__ */ React5.createElement(Stack4, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ React5.createElement(MenuItem, { dense, onClick: handleSelectAll }, /* @__PURE__ */ React5.createElement(ListItemIcon, null, /* @__PURE__ */ React5.createElement(Checkbox, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ React5.createElement(
1007
- MenuItem,
1008
- {
1009
- key: getItemLabel(item),
1010
- dense,
1011
- onClick: () => handleCheckboxToggle(item)
1012
- },
1013
- /* @__PURE__ */ React5.createElement(ListItemIcon, null, /* @__PURE__ */ React5.createElement(
1014
- Checkbox,
1015
- {
1016
- checked: selectedItems.includes(item),
1017
- color: "primary"
1018
- }
1019
- )),
1020
- getItemLabel(item)
1021
- )) : /* @__PURE__ */ React5.createElement(MenuItem, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ React5.createElement(Stack4, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
1022
- var _a2;
1023
- return /* @__PURE__ */ React5.createElement(
1024
- Button3,
1025
- {
1026
- key: index,
1027
- variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
1028
- onClick: button2.fn,
1029
- disabled: (_a2 = button2.disabled) != null ? _a2 : false,
1030
- size: "small"
1031
- },
1032
- capitalize(button2.text)
1033
- );
1034
- })))
1035
- ));
1036
- }
1037
-
1038
- // src/Components/SCDialog.tsx
1039
- import React6, { useEffect as useEffect6, useState as useState6 } from "react";
1040
- import { Button as Button4, Typography as Typography5, Modal, Dialog, DialogActions, DialogContent, DialogTitle, IconButton as IconButton4, Tooltip as Tooltip3, Box as Box5, SvgIcon as SvgIcon3 } from "@mui/material";
1041
- import Grid4 from "@mui/material/Grid2";
1042
- import CloseIcon2 from "@mui/icons-material/Close";
776
+ // src/Components/SCAutocomplete.tsx
777
+ import React5, { useEffect as useEffect6 } from "react";
778
+ import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography5, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton4, Chip, Box as Box5, Button as Button3 } from "@mui/material";
779
+ import Grid3 from "@mui/material/Grid2";
780
+ import { Search, Clear } from "@mui/icons-material";
1043
781
  import * as Muicon3 from "@mui/icons-material";
1044
- var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
1045
- let i = 0;
1046
- let iconTitleValidation = "";
1047
- let IconTitle;
1048
- let ButtonIcon;
1049
- const [open, setOpen] = useState6(show);
782
+ function SCAutocomplete({
783
+ label = "",
784
+ data,
785
+ columnGroup,
786
+ getItemValue,
787
+ typeFormat = "normal",
788
+ checkMassive = false,
789
+ deleteType = "button",
790
+ fnAplicar,
791
+ required,
792
+ disabled,
793
+ background,
794
+ setState,
795
+ state,
796
+ inputChange
797
+ }) {
798
+ const labelContent = `<span class="red-asterisk">* </span>` + label;
799
+ let group = "";
800
+ let isSelected = false;
801
+ const [selectedOptions, setSelectedOptions] = React5.useState([]);
802
+ const [prevData, setPrevData] = React5.useState(data);
1050
803
  useEffect6(() => {
1051
- if (show) {
1052
- handleOpen();
804
+ let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
805
+ if (dataChangeValidation == false) {
806
+ setState({ hiddenValue: "-1", textValue: "" });
807
+ setSelectedOptions([]);
808
+ setPrevData(data);
1053
809
  }
1054
- }, [show]);
1055
- if ((buttonDialog == null ? void 0 : buttonDialog.icon) != void 0) {
1056
- if (Muicon3[buttonDialog == null ? void 0 : buttonDialog.icon] == void 0) {
1057
- ButtonIcon = buttonDialog == null ? void 0 : buttonDialog.icon;
1058
- } else {
1059
- ButtonIcon = Muicon3[buttonDialog == null ? void 0 : buttonDialog.icon];
810
+ }, [data]);
811
+ useEffect6(() => {
812
+ if (typeFormat == "multiselect") {
813
+ if (state.hiddenValue != "-1") {
814
+ setSelectedOptions(data.filter(
815
+ (item) => Array.isArray(state.hiddenValue) ? state.hiddenValue.includes(getItemValue(item).value) : getItemValue(item).value === state.hiddenValue
816
+ ));
817
+ }
1060
818
  }
1061
- }
1062
- if (iconTitle) {
1063
- if (Muicon3[iconTitle] == void 0) {
1064
- if (iconTitle && React6.isValidElement(iconTitle) && iconTitle.type == void 0) {
1065
- iconTitleValidation = "image";
1066
- IconTitle = iconTitle;
819
+ }, [state.hiddenValue]);
820
+ data.map(function(option, index, array) {
821
+ if (option == null ? void 0 : option.icon) {
822
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
823
+ option.icon = Muicon3[option == null ? void 0 : option.icon];
1067
824
  } else {
1068
- iconTitleValidation = "icon";
1069
- IconTitle = iconTitle;
825
+ option;
1070
826
  }
827
+ }
828
+ });
829
+ const cleanOptions = (event2) => {
830
+ setState({ hiddenValue: "-1", textValue: "" });
831
+ setSelectedOptions([]);
832
+ };
833
+ const handleCheckAll = (event2) => {
834
+ if (event2.target.checked) {
835
+ setSelectedOptions(data);
836
+ setState({
837
+ hiddenValue: data.map((item) => getItemValue(item).value),
838
+ textValue: data.map((item) => getItemValue(item).text)
839
+ });
1071
840
  } else {
1072
- iconTitleValidation = "icon";
1073
- IconTitle = Muicon3[iconTitle];
841
+ setSelectedOptions([]);
842
+ setState({ hiddenValue: "-1", textValue: "" });
1074
843
  }
1075
- }
1076
- const handleOpen = () => setOpen(true);
1077
- const handleClose = () => {
1078
- setOpen(false);
1079
- if (setShow) {
1080
- setShow(false);
844
+ };
845
+ const allSelected = data.length > 0 && selectedOptions.length === data.length;
846
+ const handleChange = (event2, value) => {
847
+ if (typeFormat === "multiselect") {
848
+ const ids = value.map((v) => getItemValue ? getItemValue(v).value : "");
849
+ const texts = value.map((v) => getItemValue ? getItemValue(v).text : "");
850
+ setSelectedOptions(value);
851
+ setState({
852
+ hiddenValue: ids,
853
+ textValue: texts
854
+ });
855
+ } else {
856
+ setState({
857
+ hiddenValue: getItemValue(value).value,
858
+ textValue: getItemValue(value).text
859
+ });
1081
860
  }
1082
861
  };
1083
- const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
1084
- content = content != null ? content : { component: /* @__PURE__ */ React6.createElement(Box5, null, " Aqui va el contenido ") };
1085
- return /* @__PURE__ */ React6.createElement("div", null, buttonDialog ? /* @__PURE__ */ React6.createElement(React6.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React6.createElement(Tooltip3, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React6.createElement(Button4, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" || !(buttonDialog == null ? void 0 : buttonDialog.iconPosition) ? /* @__PURE__ */ React6.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React6.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React6.createElement(IconButton4, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React6.createElement(SvgIcon3, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React6.createElement(Modal, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React6.createElement(
1086
- Dialog,
862
+ const selectedValue = typeFormat === "multiselect" ? data.filter(
863
+ (item) => state.hiddenValue.includes(getItemValue(item).value)
864
+ ) : data.find(
865
+ (item) => getItemValue(item).value === state.hiddenValue
866
+ ) || null;
867
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, data && /* @__PURE__ */ React5.createElement(
868
+ Autocomplete,
1087
869
  {
1088
- open: open || false,
1089
- onClose: disableClose ? void 0 : handleClose,
1090
- maxWidth: "xl",
870
+ multiple: typeFormat === "multiselect",
871
+ clearOnEscape: true,
872
+ disabled,
873
+ options: data,
874
+ onInputChange: (event2, value) => {
875
+ if (inputChange) {
876
+ inputChange(value);
877
+ }
878
+ },
879
+ onChange: handleChange,
880
+ getOptionLabel: (option) => getItemValue(option).text,
881
+ value: selectedValue,
1091
882
  sx: {
1092
- width: "100% !important",
1093
- "& .MuiBackdrop-root": {
1094
- backdropFilter: "blur(0px) !important"
883
+ background: background || "transparent",
884
+ width: "100%",
885
+ maxWidth: "100%",
886
+ "& .MuiAutocomplete-tag": {
887
+ maxWidth: 120,
888
+ overflow: "hidden",
889
+ textOverflow: "ellipsis",
890
+ whiteSpace: "nowrap"
891
+ },
892
+ "& .MuiAutocomplete-inputRoot": {
893
+ flexWrap: "nowrap !important",
894
+ overflowX: "auto"
1095
895
  }
1096
- }
1097
- },
1098
- title && /* @__PURE__ */ React6.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, id: "dialog-title" }, /* @__PURE__ */ React6.createElement(Grid4, { container: true, size: 12, sx: { justifyContent: "space-between" } }, /* @__PURE__ */ React6.createElement(Grid4, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React6.createElement(Box5, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React6.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React6.createElement(SvgIcon3, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React6.createElement(Grid4, null, /* @__PURE__ */ React6.createElement(Typography5, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React6.createElement(Typography5, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React6.createElement(IconButton4, { onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React6.createElement(CloseIcon2, null)) : "")),
1099
- /* @__PURE__ */ React6.createElement(
1100
- DialogContent,
1101
- {
1102
- dividers: dividers ? dividers : false,
1103
- sx: {
1104
- m: 0,
1105
- padding: "12px 16px 8px 16px",
1106
- background: background ? background : "white",
1107
- height: !heightContent ? "508px" : heightContent,
1108
- width: widthContent == "extra-small" ? "444px" : widthContent == "small" ? "600px" : widthContent == "medium" ? "900px" : widthContent == "large" ? "1200px" : widthContent == "extra-large" ? "1536px" : "900px"
896
+ },
897
+ limitTags: 2,
898
+ renderTags: (value, getTagProps) => {
899
+ const limit = 2;
900
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, value.slice(0, limit).map((option, index) => /* @__PURE__ */ React5.createElement(
901
+ Chip,
902
+ __spreadProps(__spreadValues({
903
+ color: "default",
904
+ size: "small",
905
+ variant: "filled",
906
+ label: getItemValue(option).text
907
+ }, getTagProps({ index })), {
908
+ style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
909
+ })
910
+ )), value.length > limit && /* @__PURE__ */ React5.createElement(Box5, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
911
+ },
912
+ renderOption: (props, option) => {
913
+ const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
914
+ let isValid;
915
+ if (typeFormat == "multiselect") {
916
+ isSelected = selectedOptions.some(
917
+ (selected) => getItemValue(selected).value === getItemValue(option).value
918
+ );
1109
919
  }
920
+ if (columnGroup) {
921
+ isValid = group == option[columnGroup];
922
+ group = option[columnGroup];
923
+ }
924
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(React5.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React5.createElement(Typography5, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React5.createElement(MenuItem2, __spreadProps(__spreadValues({}, optionProps), { style: { background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#dfe6ec" : "white" : "white", padding: "7px 16px" } }), typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React5.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React5.createElement(SvgIcon4, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(Checkbox, { checked: isSelected, value: getItemValue(option).text, color: "primary" }) : "", /* @__PURE__ */ React5.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }))));
1110
925
  },
1111
- content.url ? /* @__PURE__ */ React6.createElement(
1112
- "iframe",
1113
- {
1114
- style: { border: "none", minWidth: "100%", minHeight: "100%" },
1115
- id: "inlineFrameExample",
1116
- title: "Inline Frame Example",
1117
- src: content.url
926
+ renderInput: (params) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
927
+ TextField3,
928
+ __spreadProps(__spreadValues({}, params), {
929
+ label: required ? /* @__PURE__ */ React5.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
930
+ placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
931
+ InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
932
+ endAdornment: /* @__PURE__ */ React5.createElement(React5.Fragment, null, deleteType == "icon" && state.hiddenValue != "-1" ? /* @__PURE__ */ React5.createElement(IconButton4, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ React5.createElement(Clear, { fontSize: "small" })) : "", /* @__PURE__ */ React5.createElement(InputAdornment3, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ React5.createElement(Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
933
+ })
934
+ })
935
+ )),
936
+ slotProps: {
937
+ listbox: {
938
+ component: React5.forwardRef(function ListboxComponent(props, ref) {
939
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
940
+ Box5,
941
+ __spreadProps(__spreadValues({
942
+ ref
943
+ }, props), {
944
+ sx: __spreadValues({
945
+ position: "relative",
946
+ paddingBottom: "56px",
947
+ backgroundColor: "white"
948
+ }, props.sx)
949
+ }),
950
+ checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(FormControlLabel2, { control: /* @__PURE__ */ React5.createElement(Checkbox, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los items", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ React5.createElement(Divider3, null)) : "",
951
+ props.children,
952
+ deleteType == "button" || fnAplicar ? /* @__PURE__ */ React5.createElement(
953
+ Grid3,
954
+ {
955
+ container: true,
956
+ sx: {
957
+ position: "sticky",
958
+ bottom: -8,
959
+ left: 0,
960
+ width: "100%",
961
+ backgroundColor: "grey.50",
962
+ padding: "8px 16px",
963
+ textAlign: "left",
964
+ justifyContent: "space-between"
965
+ }
966
+ },
967
+ deleteType == "button" ? /* @__PURE__ */ React5.createElement(
968
+ Button3,
969
+ {
970
+ variant: "text",
971
+ color: "primary",
972
+ size: "small",
973
+ onClick: (event2) => {
974
+ event2.stopPropagation();
975
+ cleanOptions(event2);
976
+ }
977
+ },
978
+ "Limpiar"
979
+ ) : "",
980
+ fnAplicar && /* @__PURE__ */ React5.createElement(
981
+ Button3,
982
+ {
983
+ variant: "contained",
984
+ color: "primary",
985
+ size: "small",
986
+ onClick: fnAplicar
987
+ },
988
+ "Aplicar"
989
+ )
990
+ ) : ""
991
+ ));
992
+ })
993
+ }
994
+ }
995
+ }
996
+ ));
997
+ }
998
+
999
+ // src/Components/SCDateRange.tsx
1000
+ import React6 from "react";
1001
+ import { Box as Box6, InputAdornment as InputAdornment4 } from "@mui/material";
1002
+ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
1003
+ import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
1004
+ import { DateRangePicker } from "@mui/x-date-pickers-pro/DateRangePicker";
1005
+ import { MultiInputDateRangeField } from "@mui/x-date-pickers-pro/MultiInputDateRangeField";
1006
+ import dayjs from "dayjs";
1007
+ import "dayjs/locale/es";
1008
+ import { LicenseInfo } from "@mui/x-license-pro";
1009
+ import EventIcon from "@mui/icons-material/Event";
1010
+ var SCDateRange = ({
1011
+ labelDateInitial = "Fecha inicial",
1012
+ labelDateFinal = "Fecha final",
1013
+ required = false,
1014
+ disabled = false,
1015
+ background = "transparent",
1016
+ state,
1017
+ setState
1018
+ }) => {
1019
+ LicenseInfo.setLicenseKey(
1020
+ "77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
1021
+ );
1022
+ const isStartEmpty = required && !state[0];
1023
+ const isEndEmpty = required && !state[1];
1024
+ const hasError = isStartEmpty || isEndEmpty;
1025
+ const handleDateChange = (newValue) => {
1026
+ const convertedValue = [
1027
+ newValue[0] ? dayjs(newValue[0]) : null,
1028
+ newValue[1] ? dayjs(newValue[1]) : null
1029
+ ];
1030
+ setState(convertedValue);
1031
+ };
1032
+ return /* @__PURE__ */ React6.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React6.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React6.createElement(
1033
+ DateRangePicker,
1034
+ {
1035
+ value: state,
1036
+ onChange: handleDateChange,
1037
+ disabled,
1038
+ slots: {
1039
+ field: MultiInputDateRangeField
1040
+ },
1041
+ slotProps: {
1042
+ field: {
1043
+ slotProps: {
1044
+ textField: ({ position }) => ({
1045
+ label: position === "start" ? labelDateInitial : labelDateFinal,
1046
+ size: "small",
1047
+ variant: "outlined",
1048
+ required,
1049
+ error: position === "start" ? isStartEmpty : isEndEmpty,
1050
+ InputProps: {
1051
+ endAdornment: /* @__PURE__ */ React6.createElement(InputAdornment4, { position: "end" }, /* @__PURE__ */ React6.createElement(
1052
+ EventIcon,
1053
+ {
1054
+ color: hasError ? "error" : "action",
1055
+ fontSize: "small"
1056
+ }
1057
+ ))
1058
+ },
1059
+ sx: {
1060
+ mr: position === "start" ? 1 : 0,
1061
+ "& .MuiOutlinedInput-root": {
1062
+ backgroundColor: background === "transparent" ? "transparent" : background
1063
+ },
1064
+ "& .MuiInputLabel-asterisk": {
1065
+ color: "error.main"
1066
+ },
1067
+ background: background != null ? background : "transparent"
1068
+ }
1069
+ })
1070
+ }
1118
1071
  }
1119
- ) : content.component
1120
- ),
1121
- dialogActions.length > 0 ? /* @__PURE__ */ React6.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px" } }, dialogActions.map((boton) => /* @__PURE__ */ React6.createElement(
1122
- Button4,
1123
- {
1124
- key: i = i + 1,
1125
- autoFocus: true,
1126
- variant: i == 1 || dialogActions.length < 2 ? "contained" : "text",
1127
- color: "primary",
1128
- size: "small",
1129
- onClick: boton.fn,
1130
- disabled: boton.disabled || false
1131
1072
  },
1132
- boton.text
1133
- ))) : ""
1073
+ sx: {
1074
+ display: "flex",
1075
+ gap: 1,
1076
+ width: "100%"
1077
+ }
1078
+ }
1134
1079
  )));
1135
1080
  };
1136
1081
 
1137
- // src/Components/SCMenu.tsx
1138
- import React7 from "react";
1139
- import { Box as Box6, Typography as Typography6, Paper, Divider as Divider2, MenuList, MenuItem as MenuItem2, ListItemIcon as ListItemIcon2, SvgIcon as SvgIcon4 } from "@mui/material";
1140
- import Grid5 from "@mui/material/Grid2";
1141
-
1142
- // src/Components/Hooks/useWindowDimensions.ts
1143
- import { useState as useState7, useEffect as useEffect7 } from "react";
1144
- function getWindowDimensions() {
1145
- const { innerWidth: width, innerHeight: height } = window;
1146
- return {
1147
- width,
1148
- height
1149
- };
1150
- }
1151
- function useWindowDimensions() {
1152
- const [windowDimensions, setWindowDimensions] = useState7(getWindowDimensions());
1153
- useEffect7(() => {
1154
- function handleResize() {
1155
- setWindowDimensions(getWindowDimensions());
1156
- }
1157
- window.addEventListener("resize", handleResize);
1158
- return () => window.removeEventListener("resize", handleResize);
1159
- }, []);
1160
- return windowDimensions;
1161
- }
1162
-
1163
- // src/Components/SCMenu.tsx
1082
+ // src/Components/Drawer/Helpers/Utils.tsx
1164
1083
  import * as Muicon4 from "@mui/icons-material";
1165
- var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }) => {
1166
- const { height, width } = useWindowDimensions();
1167
- const menuSize = widthMenu ? parseInt(widthMenu) : 284;
1168
- const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
1169
- const widthContainer = menuSize + pageSize;
1170
- let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
1171
- const [selectedIndex, setSelectedIndex] = React7.useState("1");
1172
- const [value, setValue] = React7.useState("1");
1173
- React7.useEffect(() => {
1174
- heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
1175
- }, [height]);
1176
- React7.useEffect(() => {
1177
- if (defaultOption) {
1178
- handleClickMenusItem(event, void 0);
1084
+ import { FilterListOutlined } from "@mui/icons-material";
1085
+ var getIcon2 = (iconName) => {
1086
+ if (iconName && iconName in Muicon4) {
1087
+ return Muicon4[iconName];
1088
+ }
1089
+ return FilterListOutlined;
1090
+ };
1091
+ var cleanInputs = (arrayElements) => {
1092
+ var _a, _b;
1093
+ for (let i = 0; i < arrayElements.length; i++) {
1094
+ if (arrayElements[i].component === void 0) {
1095
+ (_b = (_a = arrayElements[i]).state) == null ? void 0 : _b.call(_a, "");
1179
1096
  }
1180
- }, [defaultOption]);
1181
- options.map(function(option, index, array) {
1182
- if (option == null ? void 0 : option.iconLeft) {
1183
- if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
1184
- option.iconLeft = Muicon4[option == null ? void 0 : option.iconLeft];
1185
- } else {
1186
- option;
1097
+ }
1098
+ };
1099
+
1100
+ // src/Components/Drawer/Helpers/validateInput.tsx
1101
+ var validateInputs = (arrayElements, onError, onSuccess) => {
1102
+ var _a;
1103
+ let requiredValues = 0;
1104
+ let filledValues = 0;
1105
+ for (let i = 0; i < arrayElements.length; i++) {
1106
+ if (arrayElements[i].component === void 0) {
1107
+ if (arrayElements[i].required) {
1108
+ requiredValues++;
1187
1109
  }
1188
- }
1189
- if (option == null ? void 0 : option.iconRight) {
1190
- if ((option == null ? void 0 : option.iconRight.type) == void 0) {
1191
- option.iconRight = Muicon4[option == null ? void 0 : option.iconRight];
1192
- } else {
1193
- option;
1110
+ if (arrayElements[i].required && ((_a = arrayElements[i].value) == null ? void 0 : _a.trim()) !== "") {
1111
+ filledValues++;
1194
1112
  }
1195
1113
  }
1196
- });
1197
- const handleClickMenusItem = (event2, index) => {
1198
- if (defaultOption && index == void 0) {
1199
- setSelectedIndex(defaultOption);
1200
- setValue(defaultOption);
1201
- } else if (index != void 0) {
1202
- setSelectedIndex(String(index + 1));
1203
- setValue(String(index + 1));
1204
- }
1205
- };
1206
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Grid5, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ React7.createElement(Paper, { sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ React7.createElement(MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
1207
- MenuItem2,
1208
- {
1209
- disabled: disable == true ? true : false,
1210
- key: index,
1211
- selected: String(index + 1) === selectedIndex,
1212
- onClick: (event2) => handleClickMenusItem(event2, index)
1213
- },
1214
- option.iconLeft ? /* @__PURE__ */ React7.createElement(ListItemIcon2, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React7.createElement(SvgIcon4, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
1215
- /* @__PURE__ */ React7.createElement(Grid5, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React7.createElement(Typography6, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React7.createElement(ListItemIcon2, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React7.createElement(SvgIcon4, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
1216
- ), option.divider == true ? /* @__PURE__ */ React7.createElement(Divider2, null) : "")))), /* @__PURE__ */ React7.createElement(Grid5, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React7.createElement(Box6, { sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React7.createElement(Typography6, { color: "error" }, "No se ha configurado el componente a visualizar")))));
1114
+ }
1115
+ if (requiredValues === filledValues) {
1116
+ onSuccess();
1117
+ } else {
1118
+ onError({
1119
+ type: "error",
1120
+ title: "Algunos campos son requeridos",
1121
+ time: 10
1122
+ });
1123
+ }
1217
1124
  };
1218
1125
 
1219
- // src/Components/SCTabs.tsx
1220
- import React8, { useEffect as useEffect8 } from "react";
1221
- import { Typography as Typography7, Box as Box7, SvgIcon as SvgIcon5, Tab, Tabs, Badge } from "@mui/material";
1222
- import TabPanel from "@mui/lab/TabPanel";
1223
- import TabContext from "@mui/lab/TabContext";
1224
- import * as Muicon5 from "@mui/icons-material";
1225
- var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
1226
- const [toast, setToast] = React8.useState(null);
1227
- let i = 0;
1228
- let j = 0;
1229
- let k = 0;
1230
- let l = 0;
1231
- let validateTypeIcon = true;
1232
- const [value, setValue] = React8.useState("1");
1233
- useEffect8(() => {
1234
- if (defaultOption) {
1235
- handleChange(event, void 0);
1236
- }
1237
- }, [defaultOption]);
1238
- options.map(function(option) {
1239
- const optionsLength = options.length;
1240
- if (option == null ? void 0 : option.iconOrBadge) {
1241
- if (typeIcon == "icon") {
1242
- if ((option == null ? void 0 : option.iconOrBadge) in Muicon5 == true) {
1243
- validateTypeIcon = true;
1244
- option.iconOrBadge = Muicon5[option == null ? void 0 : option.iconOrBadge];
1245
- } else {
1246
- validateTypeIcon = false;
1247
- setTimeout(() => {
1248
- setToast({
1249
- type: "error",
1250
- title: "Componente SCTabs",
1251
- subtitle: "En Option todos los iconOrBadge deben ser iconos de MUI, por favor verificar.",
1252
- time: 50
1253
- });
1254
- }, 10);
1255
- return;
1256
- }
1257
- } else if (typeIcon == "badge") {
1258
- if ((option == null ? void 0 : option.iconOrBadge) in Muicon5 == false) {
1259
- validateTypeIcon = true;
1260
- option;
1261
- } else {
1262
- validateTypeIcon = false;
1263
- setTimeout(() => {
1264
- setToast({
1265
- type: "error",
1266
- title: "Componente SCTabs",
1267
- subtitle: "En Option todos los iconOrBadge deben ser numeros para el badge, por favor verificar.",
1268
- time: 10
1269
- });
1270
- }, 10);
1271
- return;
1272
- }
1273
- }
1274
- }
1275
- });
1276
- const handleChange = (event2, newValue) => {
1277
- if (defaultOption && newValue == void 0) {
1278
- setValue(defaultOption);
1279
- } else if (newValue != void 0) {
1280
- setValue(newValue);
1281
- }
1126
+ // src/generales/capitalize.tsx
1127
+ function capitalize(text) {
1128
+ return text.charAt(0).toUpperCase() + text.slice(1);
1129
+ }
1130
+
1131
+ // src/Components/Drawer/SCDrawer.tsx
1132
+ function SCDrawer({
1133
+ //informativas
1134
+ title,
1135
+ arrayElements = [],
1136
+ actions,
1137
+ buttonDrawer,
1138
+ //Apariencia
1139
+ colorTitle,
1140
+ anchor = "left",
1141
+ width,
1142
+ //Funcionales
1143
+ open
1144
+ }) {
1145
+ var _a;
1146
+ const [drawerOpen, setDrawerOpen] = React7.useState(open);
1147
+ const [toast, setToast] = React7.useState(null);
1148
+ const handleDrawerClose = () => {
1149
+ setDrawerOpen(false);
1282
1150
  };
1283
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ React8.createElement(Box7, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ React8.createElement(TabContext, { value }, /* @__PURE__ */ React8.createElement(
1284
- Tabs,
1151
+ const toggleDrawer = (newOpen) => () => {
1152
+ setDrawerOpen(newOpen);
1153
+ };
1154
+ const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
1155
+ const setToastWithDelay = (toastContent) => {
1156
+ setToast(null);
1157
+ setTimeout(() => {
1158
+ setToast(toastContent);
1159
+ }, 10);
1160
+ };
1161
+ const inputValidation = () => validateInputs(arrayElements, setToastWithDelay, handleDrawerClose);
1162
+ const clean = () => cleanInputs(arrayElements);
1163
+ actions = actions != null ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: clean }];
1164
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, toast && /* @__PURE__ */ React7.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React7.createElement(
1165
+ Button4,
1285
1166
  {
1286
- value,
1287
- onChange: handleChange,
1288
- variant: variant ? orientation == "vertical" && variant == "fullWidth" ? "standard" : variant : "standard",
1289
- scrollButtons: scrollButtons == false ? false : true,
1290
- visibleScrollbar: scrollButtons == false ? true : false,
1291
- textColor: colorTab,
1292
- indicatorColor: colorTab,
1293
- orientation: orientation || "horizontal",
1294
- sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
1167
+ "data-testid": "test-buttonDrawer",
1168
+ sx: { textTransform: "capitalize" },
1169
+ color: buttonDrawer == null ? void 0 : buttonDrawer.color,
1170
+ onClick: toggleDrawer(true),
1171
+ size: "small",
1172
+ variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
1173
+ startIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) ? /* @__PURE__ */ React7.createElement(ButtonIcon, { color: (buttonDrawer == null ? void 0 : buttonDrawer.color) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.color : "primary" }) : null,
1174
+ endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" ? /* @__PURE__ */ React7.createElement(ButtonIcon, { color: (buttonDrawer == null ? void 0 : buttonDrawer.color) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.color : "primary" }) : null
1295
1175
  },
1296
- options.map((option) => /* @__PURE__ */ React8.createElement(
1297
- Tab,
1298
- {
1299
- value: String(i = i + 1),
1300
- key: j = j + 1,
1301
- label: option.name || "",
1302
- disabled: option.disabled || false,
1303
- iconPosition: iconPosition || "end",
1304
- icon: typeIcon == "badge" ? /* @__PURE__ */ React8.createElement(
1305
- Badge,
1306
- {
1307
- sx: {
1308
- width: "20px",
1309
- height: "20px",
1310
- "& .MuiBadge-badge": {
1311
- top: "10px",
1312
- right: "10px"
1313
- }
1314
- },
1315
- variant: "standard",
1316
- badgeContent: option.iconOrBadge,
1317
- color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
1318
- }
1319
- ) : typeIcon == "icon" ? /* @__PURE__ */ React8.createElement(SvgIcon5, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
1320
- sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
1176
+ capitalize((_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "Drawer")
1177
+ ), /* @__PURE__ */ React7.createElement(
1178
+ Drawer,
1179
+ {
1180
+ open: drawerOpen,
1181
+ onClose: toggleDrawer(false),
1182
+ anchor: anchor != null ? anchor : "left",
1183
+ sx: {
1184
+ "& .MuiDrawer-paper": {
1185
+ width: width != null ? width : "450px",
1186
+ boxSizing: "border-box",
1187
+ borderRadius: anchor !== "right" ? "0px 4px 4px 0px" : "4px 0px 0px 4px"
1188
+ }
1321
1189
  }
1322
- ))
1323
- ), children, options.map((option) => /* @__PURE__ */ React8.createElement(
1324
- TabPanel,
1325
- {
1326
- key: k = k + 1,
1327
- value: String(l = l + 1),
1328
- sx: { padding: "16px" }
1329
1190
  },
1330
- option.page ? option.page : /* @__PURE__ */ React8.createElement(Typography7, null, "No se ha configurado el componente a visualizar ")
1331
- )))) : /* @__PURE__ */ React8.createElement(Box7, { sx: { height: "200px" } }, toast && /* @__PURE__ */ React8.createElement(SCToastNotification, __spreadValues({}, toast))));
1332
- };
1191
+ /* @__PURE__ */ React7.createElement(Stack3, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ React7.createElement(Grid4, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ React7.createElement(Typography7, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ React7.createElement(IconButton5, { onClick: handleDrawerClose }, /* @__PURE__ */ React7.createElement(CloseIcon, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ React7.createElement(Stack3, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
1192
+ var _a2, _b, _c, _d, _e, _f;
1193
+ return /* @__PURE__ */ React7.createElement(
1194
+ Box7,
1195
+ {
1196
+ key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b = arrayElement.label) != null ? _b : ""}${index}`,
1197
+ sx: { width: "100%" }
1198
+ },
1199
+ arrayElement.component ? /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ React7.createElement(
1200
+ SCTextField,
1201
+ {
1202
+ title: arrayElement.title,
1203
+ iconTitle: arrayElement.iconTitle,
1204
+ infoTitle: arrayElement.infoTitle,
1205
+ label: arrayElement.label,
1206
+ placeholder: arrayElement.placeholder,
1207
+ infoElement: arrayElement.infoElement,
1208
+ iconInputStart: arrayElement.iconInputStart,
1209
+ iconInputEnd: arrayElement.iconInputEnd,
1210
+ maxLength: arrayElement.maxLength,
1211
+ variant: arrayElement.variant,
1212
+ format: arrayElement.format,
1213
+ disabled: arrayElement.disabled,
1214
+ required: arrayElement.required,
1215
+ size: arrayElement.size,
1216
+ width: arrayElement.width,
1217
+ color: arrayElement.color,
1218
+ background: arrayElement.background,
1219
+ setState: arrayElement.setState,
1220
+ state: arrayElement.state || "",
1221
+ onChange: arrayElement.onChange,
1222
+ onBlur: arrayElement.onBlur,
1223
+ onKeyDown: arrayElement.onKeyDown
1224
+ }
1225
+ ) : arrayElement.type === "textArea" ? /* @__PURE__ */ React7.createElement(
1226
+ SCTextArea,
1227
+ {
1228
+ title: arrayElement.title,
1229
+ iconTitle: arrayElement.iconTitle,
1230
+ infoTitle: arrayElement.infoTitle,
1231
+ label: arrayElement.label,
1232
+ placeholder: arrayElement.placeholder,
1233
+ maxLength: arrayElement.maxLength,
1234
+ variant: arrayElement.variant,
1235
+ disabled: arrayElement.disabled,
1236
+ required: arrayElement.required,
1237
+ width: arrayElement.width,
1238
+ rows: arrayElement.rows,
1239
+ background: arrayElement.background,
1240
+ setState: arrayElement.setState,
1241
+ state: arrayElement.state || "",
1242
+ onBlur: arrayElement.onBlur
1243
+ }
1244
+ ) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ React7.createElement(
1245
+ SCAutocomplete,
1246
+ {
1247
+ label: arrayElement.label,
1248
+ data: (_c = arrayElement.data) != null ? _c : [],
1249
+ columnGroup: arrayElement.columnGroup,
1250
+ getItemValue: (_d = arrayElement.getItemValue) != null ? _d : () => ({ text: "", value: "" }),
1251
+ typeFormat: arrayElement.typeFormat,
1252
+ checkMassive: arrayElement.checkMassive,
1253
+ deleteType: arrayElement.deleteType,
1254
+ required: arrayElement.required,
1255
+ disabled: arrayElement.disabled,
1256
+ background: arrayElement.background,
1257
+ fnAplicar: arrayElement.fnAplicar,
1258
+ setState: arrayElement.setState,
1259
+ state: arrayElement.state || "",
1260
+ inputChange: arrayElement.inputChange
1261
+ }
1262
+ ) : arrayElement.type === "select" ? /* @__PURE__ */ React7.createElement(
1263
+ SCSelect,
1264
+ {
1265
+ label: arrayElement.label,
1266
+ data: (_e = arrayElement.data) != null ? _e : [],
1267
+ getItemValue: (_f = arrayElement.getItemValue) != null ? _f : () => ({ text: "", value: "" }),
1268
+ width: arrayElement.width,
1269
+ size: arrayElement.size,
1270
+ variant: arrayElement.variant,
1271
+ deleteType: arrayElement.deleteType,
1272
+ required: arrayElement.required,
1273
+ disabled: arrayElement.disabled,
1274
+ background: arrayElement.background,
1275
+ fnAplicar: arrayElement.fnAplicar,
1276
+ setState: arrayElement.setState,
1277
+ state: arrayElement.state || ""
1278
+ }
1279
+ ) : arrayElement.type === "dateRange" ? /* @__PURE__ */ React7.createElement(
1280
+ SCDateRange,
1281
+ {
1282
+ labelDateInitial: arrayElement.labelDateInitial,
1283
+ labelDateFinal: arrayElement.labelDateFinal,
1284
+ required: arrayElement.required,
1285
+ disabled: arrayElement.disabled,
1286
+ background: arrayElement.background,
1287
+ state: arrayElement.state || [],
1288
+ setState: arrayElement.setState
1289
+ }
1290
+ ) : null
1291
+ );
1292
+ })), actions != void 0 && actions.length > 0 ? /* @__PURE__ */ React7.createElement(
1293
+ Grid4,
1294
+ {
1295
+ sx: { borderTop: 1, borderColor: "#1018403B" },
1296
+ container: true,
1297
+ gap: 2,
1298
+ padding: "8px 12px",
1299
+ height: "42px",
1300
+ alignItems: "center",
1301
+ justifyContent: actions.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
1302
+ flexDirection: anchor != "right" ? "row-reverse" : "row"
1303
+ },
1304
+ actions.map((btn, index) => /* @__PURE__ */ React7.createElement(
1305
+ Button4,
1306
+ {
1307
+ key: index,
1308
+ variant: index === 0 || actions && actions.length < 2 ? "contained" : "text",
1309
+ color: "primary",
1310
+ onClick: btn.fn,
1311
+ disabled: btn.disabled || false,
1312
+ size: "small"
1313
+ },
1314
+ btn.text
1315
+ ))
1316
+ ) : "")
1317
+ ));
1318
+ }
1333
1319
 
1334
1320
  // src/Components/FooterAction/FooterAction.tsx
1335
- import React9 from "react";
1321
+ import React8 from "react";
1336
1322
  import { AppBar, Toolbar, Box as Box8, Typography as Typography8 } from "@mui/material";
1337
1323
  var FooterAction = ({
1338
1324
  leftContent,
@@ -1340,52 +1326,52 @@ var FooterAction = ({
1340
1326
  label,
1341
1327
  variant
1342
1328
  }) => {
1343
- return /* @__PURE__ */ React9.createElement(
1329
+ return /* @__PURE__ */ React8.createElement(
1344
1330
  AppBar,
1345
1331
  {
1346
1332
  color: "inherit",
1347
1333
  sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
1348
1334
  },
1349
- /* @__PURE__ */ React9.createElement(
1335
+ /* @__PURE__ */ React8.createElement(
1350
1336
  Toolbar,
1351
1337
  {
1352
1338
  id: "footer-toolbar",
1353
1339
  sx: { gap: 1.5, minHeight: "50px !important" }
1354
1340
  },
1355
1341
  leftContent,
1356
- /* @__PURE__ */ React9.createElement(Box8, { flexGrow: 1 }),
1357
- label && /* @__PURE__ */ React9.createElement(Typography8, { variant: "body2", color: "text.secondary" }, label),
1342
+ /* @__PURE__ */ React8.createElement(Box8, { flexGrow: 1 }),
1343
+ label && /* @__PURE__ */ React8.createElement(Typography8, { variant: "body2", color: "text.secondary" }, label),
1358
1344
  rightContent
1359
1345
  )
1360
1346
  );
1361
1347
  };
1362
1348
 
1363
1349
  // src/Components/Modal/Helpers/Data.tsx
1364
- import React10 from "react";
1350
+ import React9 from "react";
1365
1351
  import { Info, Warning } from "@mui/icons-material";
1366
1352
  var modalStateConfig = {
1367
1353
  info: {
1368
1354
  color: "info",
1369
1355
  defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
1370
- icon: /* @__PURE__ */ React10.createElement(Info, { color: "info", fontSize: "medium" })
1356
+ icon: /* @__PURE__ */ React9.createElement(Info, { color: "info", fontSize: "medium" })
1371
1357
  },
1372
1358
  delete: {
1373
1359
  color: "delete",
1374
1360
  defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
1375
- icon: /* @__PURE__ */ React10.createElement(Info, { color: "error", fontSize: "medium" })
1361
+ icon: /* @__PURE__ */ React9.createElement(Info, { color: "error", fontSize: "medium" })
1376
1362
  },
1377
1363
  warning: {
1378
1364
  color: "warning",
1379
1365
  defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
1380
- icon: /* @__PURE__ */ React10.createElement(Warning, { color: "warning", fontSize: "medium" })
1366
+ icon: /* @__PURE__ */ React9.createElement(Warning, { color: "warning", fontSize: "medium" })
1381
1367
  }
1382
1368
  };
1383
1369
 
1384
1370
  // src/Components/Modal/Helpers/Utils.tsx
1385
- import * as MuiIcons3 from "@mui/icons-material";
1386
- import { FilterListOutlined as FilterListOutlined3 } from "@mui/icons-material";
1371
+ import * as MuiIcons2 from "@mui/icons-material";
1372
+ import { FilterListOutlined as FilterListOutlined2 } from "@mui/icons-material";
1387
1373
  var getIconComponent2 = (iconName) => {
1388
- return iconName && MuiIcons3[iconName] ? MuiIcons3[iconName] : FilterListOutlined3;
1374
+ return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] : FilterListOutlined2;
1389
1375
  };
1390
1376
  var getModalColor = (state) => {
1391
1377
  var _a;
@@ -1407,8 +1393,8 @@ var getButtonColor = (state) => {
1407
1393
  };
1408
1394
 
1409
1395
  // src/Components/Modal/SCModal.tsx
1410
- import React11, { useCallback as useCallback2, useEffect as useEffect9, useMemo as useMemo3, useState as useState8 } from "react";
1411
- import { Modal as Modal3, Box as Box9, Typography as Typography9, IconButton as IconButton6, Button as Button6, Stack as Stack5 } from "@mui/material";
1396
+ import React10, { useCallback, useEffect as useEffect7, useMemo, useState as useState5 } from "react";
1397
+ import { Modal, Box as Box9, Typography as Typography9, IconButton as IconButton6, Button as Button5, Stack as Stack4 } from "@mui/material";
1412
1398
  import { Close as Close2 } from "@mui/icons-material";
1413
1399
  var SCModal = ({
1414
1400
  buttonModal,
@@ -1419,34 +1405,34 @@ var SCModal = ({
1419
1405
  action
1420
1406
  }) => {
1421
1407
  var _a, _b, _c, _d, _e;
1422
- const [openModal, setOpenModal] = useState8(open != null ? open : false);
1423
- useEffect9(() => {
1408
+ const [openModal, setOpenModal] = useState5(open != null ? open : false);
1409
+ useEffect7(() => {
1424
1410
  if (open !== void 0) {
1425
1411
  setOpenModal(open);
1426
1412
  }
1427
1413
  }, [open]);
1428
- const Icon = useMemo3(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
1429
- const handleClose = useCallback2(() => setOpenModal(false), []);
1414
+ const Icon = useMemo(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
1415
+ const handleClose = useCallback(() => setOpenModal(false), []);
1430
1416
  const toggleModal = (newOpen) => () => setOpenModal(newOpen);
1431
- const prevAction = useMemo3(
1417
+ const prevAction = useMemo(
1432
1418
  () => action != null ? action : [{ text: "Cancelar", fn: handleClose }, { text: "Consultar", fn: () => {
1433
1419
  } }],
1434
1420
  [action, handleClose]
1435
1421
  );
1436
1422
  const { icon, defaultDescription } = modalStateConfig[state];
1437
- return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
1438
- Button6,
1423
+ return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
1424
+ Button5,
1439
1425
  {
1440
1426
  "data-testid": "test-buttonModal",
1441
1427
  color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
1442
1428
  onClick: toggleModal(true),
1443
1429
  variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
1444
1430
  size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
1445
- startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React11.createElement(Icon, null),
1446
- endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React11.createElement(Icon, null)
1431
+ startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React10.createElement(Icon, null),
1432
+ endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React10.createElement(Icon, null)
1447
1433
  },
1448
1434
  capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
1449
- ), /* @__PURE__ */ React11.createElement(Modal3, { open: openModal, onClose: toggleModal(false), sx: { boxShadow: 8 } }, /* @__PURE__ */ React11.createElement(
1435
+ ), /* @__PURE__ */ React10.createElement(Modal, { open: openModal, onClose: toggleModal(false), sx: { boxShadow: 8 } }, /* @__PURE__ */ React10.createElement(
1450
1436
  Box9,
1451
1437
  {
1452
1438
  sx: {
@@ -1460,10 +1446,10 @@ var SCModal = ({
1460
1446
  boxShadow: 24
1461
1447
  }
1462
1448
  },
1463
- /* @__PURE__ */ React11.createElement(Stack5, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React11.createElement(Stack5, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React11.createElement(Box9, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ React11.createElement(Typography9, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React11.createElement(IconButton6, { onClick: toggleModal(false), "data-testid": "test-buttonClose" }, /* @__PURE__ */ React11.createElement(Close2, { color: "action" }))),
1464
- /* @__PURE__ */ React11.createElement(Stack5, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React11.createElement(Typography9, { variant: "body1" }, description || defaultDescription)),
1465
- action && /* @__PURE__ */ React11.createElement(
1466
- Stack5,
1449
+ /* @__PURE__ */ React10.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React10.createElement(Stack4, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Box9, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ React10.createElement(Typography9, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React10.createElement(IconButton6, { onClick: toggleModal(false), "data-testid": "test-buttonClose" }, /* @__PURE__ */ React10.createElement(Close2, { color: "action" }))),
1450
+ /* @__PURE__ */ React10.createElement(Stack4, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Typography9, { variant: "body1" }, description || defaultDescription)),
1451
+ action && /* @__PURE__ */ React10.createElement(
1452
+ Stack4,
1467
1453
  {
1468
1454
  id: "Action",
1469
1455
  direction: "row",
@@ -1473,8 +1459,8 @@ var SCModal = ({
1473
1459
  bgcolor: "grey.50",
1474
1460
  sx: { borderRadius: 1 }
1475
1461
  },
1476
- /* @__PURE__ */ React11.createElement(
1477
- Button6,
1462
+ /* @__PURE__ */ React10.createElement(
1463
+ Button5,
1478
1464
  {
1479
1465
  color: "inherit",
1480
1466
  variant: "text",
@@ -1483,21 +1469,208 @@ var SCModal = ({
1483
1469
  },
1484
1470
  capitalize("cancelar")
1485
1471
  ),
1486
- /* @__PURE__ */ React11.createElement(
1472
+ /* @__PURE__ */ React10.createElement(
1473
+ Button5,
1474
+ {
1475
+ "data-testid": "test-aceptar",
1476
+ color: getButtonColor(state),
1477
+ variant: "contained",
1478
+ onClick: (_e = action[0]) == null ? void 0 : _e.fn,
1479
+ disabled: false,
1480
+ size: "small"
1481
+ },
1482
+ capitalize(action[0].text)
1483
+ )
1484
+ )
1485
+ )));
1486
+ };
1487
+
1488
+ // src/Components/MultiSelect/MultiSelect.tsx
1489
+ import React11, { useEffect as useEffect8, useMemo as useMemo3 } from "react";
1490
+ import { Button as Button6, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack5, TextField as TextField4 } from "@mui/material";
1491
+ import { SearchOutlined } from "@mui/icons-material";
1492
+
1493
+ // src/Components/MultiSelect/helpers/useHandlers.tsx
1494
+ import { useCallback as useCallback2, useState as useState6 } from "react";
1495
+ function useMultiSelectHandlers() {
1496
+ const [anchorEl, setAnchorEl] = useState6(null);
1497
+ const [open, setOpen] = useState6(false);
1498
+ const [selectedItems, setSelectedItems] = useState6([]);
1499
+ const [filterValue, setFilterValue] = useState6("");
1500
+ const handleOpen = useCallback2((e) => {
1501
+ setAnchorEl(e.currentTarget);
1502
+ setOpen(true);
1503
+ }, []);
1504
+ const handleClose = useCallback2(() => {
1505
+ setAnchorEl(null);
1506
+ setOpen(false);
1507
+ }, []);
1508
+ const handleFilterChange = useCallback2(
1509
+ (e) => {
1510
+ setFilterValue(e.target.value);
1511
+ },
1512
+ []
1513
+ );
1514
+ const handleCheckboxToggle = useCallback2((item) => {
1515
+ setSelectedItems(
1516
+ (prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
1517
+ );
1518
+ }, []);
1519
+ return {
1520
+ anchorEl,
1521
+ open,
1522
+ selectedItems,
1523
+ filterValue,
1524
+ setSelectedItems,
1525
+ handleOpen,
1526
+ handleClose,
1527
+ handleFilterChange,
1528
+ handleCheckboxToggle,
1529
+ setOpen
1530
+ };
1531
+ }
1532
+
1533
+ // src/Components/MultiSelect/helpers/Utils.tsx
1534
+ import * as MuiIcons3 from "@mui/icons-material";
1535
+ import { FilterListOutlined as FilterListOutlined3 } from "@mui/icons-material";
1536
+ function getIconMultiSelect(name) {
1537
+ return name in MuiIcons3 ? MuiIcons3[name] : FilterListOutlined3;
1538
+ }
1539
+
1540
+ // src/Components/MultiSelect/helpers/useFilteredItems.tsx
1541
+ import { useMemo as useMemo2 } from "react";
1542
+ function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
1543
+ const filteredItems = useMemo2(
1544
+ () => items.filter(
1545
+ (item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
1546
+ ),
1547
+ [items, filterValue, getItemLabel]
1548
+ );
1549
+ const sortedItems = useMemo2(() => {
1550
+ return [
1551
+ ...filteredItems.filter((item) => selectedItems.includes(item)),
1552
+ ...filteredItems.filter((item) => !selectedItems.includes(item))
1553
+ ];
1554
+ }, [filteredItems, selectedItems]);
1555
+ return { filteredItems, sortedItems };
1556
+ }
1557
+
1558
+ // src/Components/MultiSelect/MultiSelect.tsx
1559
+ function MultiSelect({
1560
+ textButton,
1561
+ button,
1562
+ items,
1563
+ topPanel,
1564
+ actions,
1565
+ dense = false,
1566
+ open,
1567
+ selectAll = false,
1568
+ getItemLabel
1569
+ }) {
1570
+ var _a, _b;
1571
+ const {
1572
+ anchorEl,
1573
+ open: openMultiselect,
1574
+ selectedItems,
1575
+ filterValue,
1576
+ setSelectedItems,
1577
+ handleOpen,
1578
+ handleClose,
1579
+ handleFilterChange,
1580
+ handleCheckboxToggle,
1581
+ setOpen
1582
+ } = useMultiSelectHandlers();
1583
+ useEffect8(() => {
1584
+ if (open !== void 0) {
1585
+ setOpen(open);
1586
+ }
1587
+ }, [open, setOpen]);
1588
+ useEffect8(() => {
1589
+ setSelectedItems([]);
1590
+ }, [items, setSelectedItems]);
1591
+ const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
1592
+ const Icon = useMemo3(() => {
1593
+ var _a2;
1594
+ return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
1595
+ }, [button == null ? void 0 : button.icon]);
1596
+ const handleSelectAll = () => {
1597
+ const allSelected2 = selectedItems.length === filteredItems.length;
1598
+ setSelectedItems(allSelected2 ? [] : filteredItems);
1599
+ };
1600
+ const allSelected = filteredItems.length > 0 && selectedItems.length === filteredItems.length;
1601
+ const resolvedActions = actions != null ? actions : [
1602
+ { text: "Limpiar", fn: handleClose },
1603
+ { text: "Aplicar", fn: () => {
1604
+ } }
1605
+ ];
1606
+ return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
1607
+ Button6,
1608
+ {
1609
+ "test-id": "multiselect-button",
1610
+ color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
1611
+ onClick: handleOpen,
1612
+ variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
1613
+ size: "small",
1614
+ startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ React11.createElement(Icon, null) : null,
1615
+ endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ React11.createElement(Icon, null) : null
1616
+ },
1617
+ capitalize(textButton != null ? textButton : "MultiSelect")
1618
+ ), /* @__PURE__ */ React11.createElement(
1619
+ Popover3,
1620
+ {
1621
+ elevation: 8,
1622
+ anchorEl,
1623
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
1624
+ open: openMultiselect,
1625
+ onClose: () => setOpen(false)
1626
+ },
1627
+ /* @__PURE__ */ React11.createElement(Stack5, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ React11.createElement(Stack5, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ React11.createElement(FormControl3, { fullWidth: true, size: "small" }, /* @__PURE__ */ React11.createElement(
1628
+ TextField4,
1629
+ {
1630
+ "data-testid": "multiselect-input",
1631
+ fullWidth: true,
1632
+ size: "small",
1633
+ variant: "outlined",
1634
+ placeholder: "Buscar",
1635
+ value: filterValue,
1636
+ onChange: handleFilterChange,
1637
+ slotProps: {
1638
+ input: {
1639
+ endAdornment: /* @__PURE__ */ React11.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React11.createElement(SearchOutlined, { fontSize: "small" }))
1640
+ }
1641
+ }
1642
+ }
1643
+ ))), /* @__PURE__ */ React11.createElement(Stack5, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ React11.createElement(MenuItem3, { dense, onClick: handleSelectAll }, /* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(Checkbox2, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ React11.createElement(
1644
+ MenuItem3,
1645
+ {
1646
+ key: getItemLabel(item),
1647
+ dense,
1648
+ onClick: () => handleCheckboxToggle(item)
1649
+ },
1650
+ /* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(
1651
+ Checkbox2,
1652
+ {
1653
+ checked: selectedItems.includes(item),
1654
+ color: "primary"
1655
+ }
1656
+ )),
1657
+ getItemLabel(item)
1658
+ )) : /* @__PURE__ */ React11.createElement(MenuItem3, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ React11.createElement(Stack5, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
1659
+ var _a2;
1660
+ return /* @__PURE__ */ React11.createElement(
1487
1661
  Button6,
1488
1662
  {
1489
- "data-testid": "test-aceptar",
1490
- color: getButtonColor(state),
1491
- variant: "contained",
1492
- onClick: (_e = action[0]) == null ? void 0 : _e.fn,
1493
- disabled: false,
1663
+ key: index,
1664
+ variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
1665
+ onClick: button2.fn,
1666
+ disabled: (_a2 = button2.disabled) != null ? _a2 : false,
1494
1667
  size: "small"
1495
1668
  },
1496
- capitalize(action[0].text)
1497
- )
1498
- )
1499
- )));
1500
- };
1669
+ capitalize(button2.text)
1670
+ );
1671
+ })))
1672
+ ));
1673
+ }
1501
1674
 
1502
1675
  // src/Components/PageHeader/PageHeader.tsx
1503
1676
  import React12 from "react";
@@ -1527,11 +1700,11 @@ var PageHeader = ({
1527
1700
  };
1528
1701
 
1529
1702
  // src/Components/SCCalendarSwipeable.tsx
1530
- import React13, { useState as useState9 } from "react";
1703
+ import React13, { useState as useState7 } from "react";
1531
1704
  import { Typography as Typography11, IconButton as IconButton7, Box as Box10 } from "@mui/material";
1532
- import Grid6 from "@mui/material/Grid2";
1705
+ import Grid5 from "@mui/material/Grid2";
1533
1706
  import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
1534
- import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
1707
+ import { LocalizationProvider as LocalizationProvider2 } from "@mui/x-date-pickers/LocalizationProvider";
1535
1708
  import { StaticDatePicker } from "@mui/x-date-pickers/StaticDatePicker";
1536
1709
  import { es } from "date-fns/locale";
1537
1710
  import { format, startOfWeek, addDays, isSameDay } from "date-fns";
@@ -1546,8 +1719,8 @@ var SCCalendarSwipeable = ({
1546
1719
  state
1547
1720
  }) => {
1548
1721
  let convertFecha;
1549
- const [fecha, setFecha] = useState9(/* @__PURE__ */ new Date());
1550
- const [fechaSeleccionada, setFechaSeleccionada] = useState9();
1722
+ const [fecha, setFecha] = useState7(/* @__PURE__ */ new Date());
1723
+ const [fechaSeleccionada, setFechaSeleccionada] = useState7();
1551
1724
  const [stateVal, setstateVal] = React13.useState(/* @__PURE__ */ new Date());
1552
1725
  const [openCalendar, setOpenCalendar] = React13.useState(false);
1553
1726
  const hoy = /* @__PURE__ */ new Date();
@@ -1572,11 +1745,11 @@ var SCCalendarSwipeable = ({
1572
1745
  setOpenCalendar(newOpen);
1573
1746
  };
1574
1747
  const locale = __spreadValues({}, es);
1575
- return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React13.createElement(Box10, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ React13.createElement(Grid6, { container: true, gap: 0.5, sx: {
1748
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(LocalizationProvider2, { dateAdapter: AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React13.createElement(Box10, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ React13.createElement(Grid5, { container: true, gap: 0.5, sx: {
1576
1749
  justifyContent: "space-between",
1577
1750
  padding: "12px 0px",
1578
1751
  background: "transparent"
1579
- } }, diasSemana.map((dia) => /* @__PURE__ */ React13.createElement(Grid6, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: "#10184099" } }, format(dia, "EEEE", { locale: es }).charAt(0).toUpperCase())), /* @__PURE__ */ React13.createElement(
1752
+ } }, diasSemana.map((dia) => /* @__PURE__ */ React13.createElement(Grid5, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: "#10184099" } }, format(dia, "EEEE", { locale: es }).charAt(0).toUpperCase())), /* @__PURE__ */ React13.createElement(
1580
1753
  Box10,
1581
1754
  {
1582
1755
  onClick: () => setFecha(dia),
@@ -1593,7 +1766,7 @@ var SCCalendarSwipeable = ({
1593
1766
  }
1594
1767
  },
1595
1768
  /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: isSameDay(dia, fecha) ? "white" : "#101840DE" } }, format(dia, "d"))
1596
- )))), /* @__PURE__ */ React13.createElement(Grid6, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowDownIcon, null))))) : /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ React13.createElement(
1769
+ )))), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowDownIcon, null))))) : /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ React13.createElement(
1597
1770
  StaticDatePicker,
1598
1771
  {
1599
1772
  orientation: "landscape",
@@ -1603,29 +1776,132 @@ var SCCalendarSwipeable = ({
1603
1776
  sx: { fontSize: "12px !important", height: "300px !important", background: background ? background : "white", "& .MuiDayCalendar-header": { justifyContent: "space-between" }, "& .MuiDayCalendar-weekContainer": { justifyContent: "space-between" }, "& .MuiPickersCalendarHeader-root": { paddingLeft: "0px", paddingRight: "0px", color: "#10184099" }, "& .MuiPickersDay-root": { fontSize: "12px !important" }, "& .MuiDayCalendar-weekDayLabel": { fontSize: "12px !important" } },
1604
1777
  onChange: (newValue) => setFecha(newValue)
1605
1778
  }
1606
- ), /* @__PURE__ */ React13.createElement(Grid6, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowUpIcon, null))))));
1779
+ ), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowUpIcon, null))))));
1607
1780
  };
1608
1781
 
1609
1782
  // src/Components/SCDataGrid.tsx
1610
- import React14, { useEffect as useEffect11, useState as useState10 } from "react";
1783
+ import React14, { useEffect as useEffect10, useState as useState8 } from "react";
1611
1784
  import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
1612
- import { LicenseInfo } from "@mui/x-license-pro";
1613
- var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeight, density, groupingColDef, getTreeDataPath }) => {
1614
- const apiRef = useGridApiRef();
1615
- LicenseInfo.setLicenseKey(
1785
+ import { LicenseInfo as LicenseInfo2 } from "@mui/x-license-pro";
1786
+ import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
1787
+ import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
1788
+ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }) => {
1789
+ LicenseInfo2.setLicenseKey(
1616
1790
  "77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
1617
1791
  );
1618
- let validationTreeData = getTreeDataPath ? true : false;
1792
+ const apiRef = useGridApiRef();
1793
+ const isRowSelectable = (params) => params.row.bloqueoChecked == false ? false : true;
1794
+ function generateRandomId() {
1795
+ return Math.floor(Math.random() * 1e6);
1796
+ }
1797
+ const getTreeDataPaths = (row) => {
1798
+ return [
1799
+ row[groupColumns[0].split("[")[1].split("]")[0].trim()],
1800
+ ...groupColumns.length > 2 ? [row[groupColumns[1].split("[")[1].split("]")[0].trim()]] : [],
1801
+ `${row[groupColumns[groupColumns.length - 1].split("[")[1].split("]")[0].trim()].toString()}/${generateRandomId()}`
1802
+ ];
1803
+ };
1804
+ const groupingColDefs = {
1805
+ field: "grouping",
1806
+ headerName: groupColumns != void 0 ? groupColumns[groupColumns.length - 1].split("[").length == 2 ? groupColumns[groupColumns.length - 1].split("[")[0].trim() : "Agrupador" : "",
1807
+ renderCell: (params) => {
1808
+ var _a;
1809
+ let label = params.value.toString().includes("/") ? params.value.split("/")[0].toString() : params.value.toString();
1810
+ if (groupColumns != void 0) {
1811
+ if (params.rowNode.depth === 0) {
1812
+ const textBegin = groupColumns[0] ? groupColumns[0].split("[")[0].trim() : "";
1813
+ const textEnd = groupColumns[0] ? groupColumns[0].split("]")[1].trim() : "";
1814
+ const labelGrouping1 = `${textBegin} ${label} ${textEnd}`;
1815
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1816
+ const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
1817
+ const subgroup1 = arrayRows.filter((r) => r[fieldGrouping1].toString() === label).map((r) => r[fieldGrouping2]);
1818
+ const groupedDataLength1 = subgroup1.filter((valor, indiceActual, arreglo) => arreglo.indexOf(valor) === indiceActual);
1819
+ label = `${labelGrouping1} (${groupedDataLength1.length})`;
1820
+ } else if (groupColumns.length > 2 && params.rowNode.depth === 1) {
1821
+ const labelGrouping1 = (_a = params.api.getRowNode(params.rowNode.parent)) == null ? void 0 : _a.groupingKey;
1822
+ const textBegin = groupColumns[1] ? groupColumns[1].split("[")[0] : "";
1823
+ const textEnd = groupColumns[1] ? groupColumns[1].split("]")[1].trim() : "";
1824
+ const labelGrouping2 = `${textBegin} ${label} ${textEnd}`;
1825
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1826
+ const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
1827
+ const groupedDataLength2 = arrayRows.filter(
1828
+ (r) => r[fieldGrouping1] === labelGrouping1 && r[fieldGrouping2] === label
1829
+ ).length;
1830
+ label = `${labelGrouping2} (${groupedDataLength2})`;
1831
+ } else {
1832
+ label = label;
1833
+ }
1834
+ }
1835
+ return /* @__PURE__ */ React14.createElement(
1836
+ "div",
1837
+ {
1838
+ style: {
1839
+ width: "100%",
1840
+ boxSizing: "border-box",
1841
+ overflow: "hidden",
1842
+ textOverflow: "ellipsis",
1843
+ whiteSpace: "nowrap",
1844
+ color: "#101840DE",
1845
+ display: "flex",
1846
+ alignItems: "center",
1847
+ paddingLeft: params.rowNode.depth == 0 ? "5px" : params.rowNode.depth == 1 ? "15px" : "25px",
1848
+ backgroundColor: params.rowNode.depth == 0 ? "#DCDEE0" : groupColumns.length > 2 && params.rowNode.depth == 1 ? "#EAEBEC" : "#FFFFFF",
1849
+ fontWeight: params.rowNode.type == "group" ? "400" : "300"
1850
+ }
1851
+ },
1852
+ params.rowNode.type === "group" && /* @__PURE__ */ React14.createElement(
1853
+ "span",
1854
+ {
1855
+ style: {
1856
+ cursor: "pointer",
1857
+ marginRight: 8,
1858
+ userSelect: "none"
1859
+ },
1860
+ onClick: (e) => {
1861
+ e.stopPropagation();
1862
+ params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
1863
+ }
1864
+ },
1865
+ params.rowNode.childrenExpanded ? /* @__PURE__ */ React14.createElement(KeyboardArrowUpIcon, { fontSize: "small", color: "action" }) : /* @__PURE__ */ React14.createElement(KeyboardArrowDownIcon, { fontSize: "small", color: "action" })
1866
+ ),
1867
+ label
1868
+ );
1869
+ },
1870
+ colSpan: (params) => {
1871
+ const value = String(params);
1872
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1873
+ const fieldGrouping2 = groupColumns.length > 2 ? groupColumns[1].split("[")[1].split("]")[0].trim() : void 0;
1874
+ let agrupado1 = false;
1875
+ let agrupado2 = false;
1876
+ if (fieldGrouping1 != void 0) {
1877
+ agrupado1 = arrayRows.some(
1878
+ (row) => String(row[fieldGrouping1]) === value
1879
+ );
1880
+ }
1881
+ if (fieldGrouping2 != void 0) {
1882
+ agrupado2 = arrayRows.some(
1883
+ (row) => String(row[fieldGrouping2]) === value
1884
+ );
1885
+ }
1886
+ if (agrupado1 || agrupado2) {
1887
+ return columns.length + 1;
1888
+ } else {
1889
+ return 1;
1890
+ }
1891
+ }
1892
+ };
1893
+ let validationTreeData = groupColumns ? true : false;
1619
1894
  let validationCheckboxSelection = checkboxSelection || false;
1620
1895
  let styleDensity = density || "compact";
1621
1896
  let styleTopContainerHeight = styleDensity === "compact" ? "26px" : styleDensity === "standard" ? "38px" : styleDensity === "comfortable" ? "60px" : "27px";
1622
1897
  let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
1623
- let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length) : data.length < 10 ? parseInt(data.length) : 10;
1624
- let validationGroupingColDef = groupingColDef || {};
1625
- const [groupDataLenght, setGroupDataLengh] = useState10(0);
1626
- const [pageSize, setPageSize] = useState10(rows);
1627
- const [arrayRows, setArrayRows] = useState10([]);
1628
- useEffect11(() => {
1898
+ let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
1899
+ let validationGroupingColDef = groupingColDefs || {};
1900
+ const [groupDataLenght, setGroupDataLengh] = useState8(0);
1901
+ const [pageSize, setPageSize] = useState8(rows);
1902
+ const [arrayRows, setArrayRows] = useState8([]);
1903
+ const [selectionModel, setSelectionModel] = useState8([]);
1904
+ useEffect10(() => {
1629
1905
  if ((data == null ? void 0 : data.length) > 0) {
1630
1906
  dataConvertRows(data, void 0);
1631
1907
  }
@@ -1647,8 +1923,6 @@ var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeigh
1647
1923
  }
1648
1924
  setArrayRows(dataConvert);
1649
1925
  };
1650
- const isRowSelectable = (params) => params.row.bloqueoChecked == false ? false : true;
1651
- const [selectionModel, setSelectionModel] = useState10([]);
1652
1926
  const handleSelectionChange = (newSelection) => {
1653
1927
  console.log(data);
1654
1928
  console.log(arrayRows);
@@ -1685,7 +1959,7 @@ var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeigh
1685
1959
  setSelectionModel([...newSelection]);
1686
1960
  }
1687
1961
  };
1688
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, data && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { style: { width: width || "100%", maxHeight } }, /* @__PURE__ */ React14.createElement(
1962
+ return /* @__PURE__ */ React14.createElement(React14.Fragment, null, data && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ React14.createElement(
1689
1963
  DataGridPro,
1690
1964
  {
1691
1965
  apiRef,
@@ -1694,8 +1968,8 @@ var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeigh
1694
1968
  columns,
1695
1969
  density: styleDensity,
1696
1970
  treeData: validationTreeData,
1697
- getTreeDataPath,
1698
- groupingColDef: validationTreeData == true ? validationGroupingColDef : false,
1971
+ getTreeDataPath: validationTreeData == true ? getTreeDataPaths : void 0,
1972
+ groupingColDef: validationTreeData == true ? validationGroupingColDef : void 0,
1699
1973
  pagination: true,
1700
1974
  initialState: {
1701
1975
  pagination: { paginationModel: { pageSize: rows } }
@@ -1718,6 +1992,8 @@ var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeigh
1718
1992
  }
1719
1993
  },
1720
1994
  sx: {
1995
+ maxHeight: maxHeight ? `${maxHeight}px` : "none",
1996
+ //overflow: 'auto',
1721
1997
  "& .MuiDataGrid-filler": {
1722
1998
  display: "none !important"
1723
1999
  },
@@ -1741,235 +2017,411 @@ var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeigh
1741
2017
  "maxHeight": "0px !important"
1742
2018
  },
1743
2019
  "& .MuiDataGrid-cell": {
1744
- padding: "0 !important"
2020
+ padding: "0 !important",
2021
+ background: "white"
1745
2022
  }
1746
2023
  }
1747
2024
  }
1748
2025
  ))));
1749
2026
  };
2027
+ var SCDataGrid = React14.memo(SCDataGridInitial, (prevProps, nextProps) => {
2028
+ const isEqual = prevProps.data === nextProps.data && prevProps.columns === nextProps.columns && prevProps.groupColumns === nextProps.groupColumns && prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
2029
+ return isEqual;
2030
+ });
1750
2031
 
1751
- // src/Components/SCAutocomplete.tsx
1752
- import React15, { useEffect as useEffect12 } from "react";
1753
- import { Autocomplete, Checkbox as Checkbox2, InputAdornment as InputAdornment3, MenuItem as MenuItem3, TextField as TextField3, Typography as Typography12, SvgIcon as SvgIcon7, ListItemIcon as ListItemIcon3, ListItemText, Divider as Divider3, FormControlLabel, IconButton as IconButton8, Chip, Box as Box11, Button as Button8 } from "@mui/material";
2032
+ // src/Components/EmptyState/EmptyState.tsx
2033
+ import React15 from "react";
2034
+ import { Button as Button8, Stack as Stack7, Typography as Typography12 } from "@mui/material";
2035
+
2036
+ // src/assets/ImgEmptyState/create.svg
2037
+ var create_default = "./create-KZGO2OZA.svg";
2038
+
2039
+ // src/assets/ImgEmptyState/error.svg
2040
+ var error_default = "./error-RUCZUXDN.svg";
2041
+
2042
+ // src/assets/ImgEmptyState/empty.svg
2043
+ var empty_default = "./empty-3NEKE7WO.svg";
2044
+
2045
+ // src/assets/ImgEmptyState/search.svg
2046
+ var search_default = "./search-OKSCVF2W.svg";
2047
+
2048
+ // src/Components/EmptyState/EmptyState.tsx
2049
+ var EmptyStateImageUrls = {
2050
+ create: create_default,
2051
+ error: error_default,
2052
+ noResult: empty_default,
2053
+ search: search_default
2054
+ };
2055
+ var DefaultIcon = ({
2056
+ state = "create",
2057
+ size = "large"
2058
+ }) => {
2059
+ const imageUrl = EmptyStateImageUrls[state];
2060
+ const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
2061
+ return /* @__PURE__ */ React15.createElement("img", { src: imageUrl, alt: state, style: iconSize });
2062
+ };
2063
+ var EmptyState = ({
2064
+ state = "create",
2065
+ size = "large",
2066
+ title,
2067
+ subtitle,
2068
+ actions,
2069
+ containerHeight = "100vh",
2070
+ icon = /* @__PURE__ */ React15.createElement(DefaultIcon, { state, size })
2071
+ }) => {
2072
+ const titleVariant = size === "small" ? "subtitle2" : "h6";
2073
+ const subtitleVariant = size === "small" ? "caption" : "body1";
2074
+ return /* @__PURE__ */ React15.createElement(
2075
+ Stack7,
2076
+ {
2077
+ alignItems: "center",
2078
+ justifyContent: "center",
2079
+ spacing: 2,
2080
+ height: containerHeight,
2081
+ "data-testid": "empty-state-container"
2082
+ },
2083
+ icon && /* @__PURE__ */ React15.createElement(Stack7, null, icon),
2084
+ /* @__PURE__ */ React15.createElement(Stack7, { gap: 0.5 }, /* @__PURE__ */ React15.createElement(Typography12, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ React15.createElement(
2085
+ Typography12,
2086
+ {
2087
+ variant: subtitleVariant,
2088
+ textAlign: "center",
2089
+ color: "text.secondary"
2090
+ },
2091
+ subtitle
2092
+ ), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ React15.createElement(
2093
+ Stack7,
2094
+ {
2095
+ direction: "row",
2096
+ spacing: 2,
2097
+ alignItems: "center",
2098
+ justifyContent: "center"
2099
+ },
2100
+ actions.map((action, index) => {
2101
+ var _a, _b, _c, _d;
2102
+ return /* @__PURE__ */ React15.createElement(
2103
+ Button8,
2104
+ {
2105
+ key: index,
2106
+ color: (_a = action.color) != null ? _a : "primary",
2107
+ variant: (_b = action.variant) != null ? _b : "text",
2108
+ size: (_c = action.size) != null ? _c : "small",
2109
+ startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
2110
+ endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
2111
+ onClick: action.onClick
2112
+ },
2113
+ capitalize((_d = action.text) != null ? _d : "action")
2114
+ );
2115
+ })
2116
+ ))
2117
+ );
2118
+ };
2119
+
2120
+ // src/Components/SCDialog.tsx
2121
+ import React16, { useEffect as useEffect11, useState as useState9 } from "react";
2122
+ import { Button as Button9, Typography as Typography13, Modal as Modal2, Dialog, DialogActions, DialogContent, DialogTitle, IconButton as IconButton8, Tooltip as Tooltip3, Box as Box11, SvgIcon as SvgIcon5 } from "@mui/material";
2123
+ import Grid6 from "@mui/material/Grid2";
2124
+ import CloseIcon2 from "@mui/icons-material/Close";
2125
+ import * as Muicon5 from "@mui/icons-material";
2126
+ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
2127
+ let i = 0;
2128
+ let iconTitleValidation = "";
2129
+ let IconTitle;
2130
+ let ButtonIcon;
2131
+ const [open, setOpen] = useState9(show);
2132
+ useEffect11(() => {
2133
+ if (show) {
2134
+ handleOpen();
2135
+ }
2136
+ }, [show]);
2137
+ if ((buttonDialog == null ? void 0 : buttonDialog.icon) != void 0) {
2138
+ if (Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon] == void 0) {
2139
+ ButtonIcon = buttonDialog == null ? void 0 : buttonDialog.icon;
2140
+ } else {
2141
+ ButtonIcon = Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon];
2142
+ }
2143
+ }
2144
+ if (iconTitle) {
2145
+ if (Muicon5[iconTitle] == void 0) {
2146
+ if (iconTitle && React16.isValidElement(iconTitle) && iconTitle.type == void 0) {
2147
+ iconTitleValidation = "image";
2148
+ IconTitle = iconTitle;
2149
+ } else {
2150
+ iconTitleValidation = "icon";
2151
+ IconTitle = iconTitle;
2152
+ }
2153
+ } else {
2154
+ iconTitleValidation = "icon";
2155
+ IconTitle = Muicon5[iconTitle];
2156
+ }
2157
+ }
2158
+ const handleOpen = () => setOpen(true);
2159
+ const handleClose = () => {
2160
+ setOpen(false);
2161
+ if (setShow) {
2162
+ setShow(false);
2163
+ }
2164
+ };
2165
+ const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
2166
+ content = content != null ? content : { component: /* @__PURE__ */ React16.createElement(Box11, null, " Aqui va el contenido ") };
2167
+ return /* @__PURE__ */ React16.createElement("div", null, buttonDialog ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React16.createElement(Tooltip3, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React16.createElement(Button9, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React16.createElement(IconButton8, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React16.createElement(Modal2, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React16.createElement(
2168
+ Dialog,
2169
+ {
2170
+ "data-testid": "dialog-element",
2171
+ open: open || false,
2172
+ onClose: disableClose ? void 0 : handleClose,
2173
+ maxWidth: "xl",
2174
+ sx: {
2175
+ width: "100% !important",
2176
+ "& .MuiBackdrop-root": {
2177
+ backdropFilter: "blur(0px) !important"
2178
+ }
2179
+ }
2180
+ },
2181
+ title && /* @__PURE__ */ React16.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 12, sx: { justifyContent: "space-between" } }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React16.createElement(Box11, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React16.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React16.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React16.createElement(Grid6, null, /* @__PURE__ */ React16.createElement(Typography13, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React16.createElement(Typography13, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React16.createElement(IconButton8, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React16.createElement(CloseIcon2, null)) : "")),
2182
+ /* @__PURE__ */ React16.createElement(
2183
+ DialogContent,
2184
+ {
2185
+ "data-testid": "dialog-content",
2186
+ dividers: dividers ? dividers : false,
2187
+ sx: {
2188
+ m: 0,
2189
+ padding: "12px 16px 8px 16px",
2190
+ background: background ? background : "white",
2191
+ height: !heightContent ? "508px" : heightContent,
2192
+ width: widthContent == "extra-small" ? "444px" : widthContent == "small" ? "600px" : widthContent == "medium" ? "900px" : widthContent == "large" ? "1200px" : widthContent == "extra-large" ? "1536px" : "900px"
2193
+ }
2194
+ },
2195
+ content.url ? /* @__PURE__ */ React16.createElement(
2196
+ "iframe",
2197
+ {
2198
+ style: { border: "none", minWidth: "100%", minHeight: "100%" },
2199
+ id: "inlineFrameExample",
2200
+ title: "Inline Frame Example",
2201
+ src: content.url
2202
+ }
2203
+ ) : content.component
2204
+ ),
2205
+ dialogActions.length > 0 ? /* @__PURE__ */ React16.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px" } }, dialogActions.map((boton) => /* @__PURE__ */ React16.createElement(
2206
+ Button9,
2207
+ {
2208
+ key: i = i + 1,
2209
+ autoFocus: true,
2210
+ variant: i == 1 || dialogActions.length < 2 ? "contained" : "text",
2211
+ color: "primary",
2212
+ size: "small",
2213
+ onClick: boton.fn,
2214
+ disabled: boton.disabled || false
2215
+ },
2216
+ boton.text
2217
+ ))) : ""
2218
+ )));
2219
+ };
2220
+
2221
+ // src/Components/SCMenu.tsx
2222
+ import React17 from "react";
2223
+ import { Box as Box12, Typography as Typography14, Paper, Divider as Divider4, MenuList, MenuItem as MenuItem4, ListItemIcon as ListItemIcon4, SvgIcon as SvgIcon6 } from "@mui/material";
1754
2224
  import Grid7 from "@mui/material/Grid2";
1755
- import { Search, Clear } from "@mui/icons-material";
1756
- import * as Muicon6 from "@mui/icons-material";
1757
- function SCAutocomplete({
1758
- label = "",
1759
- data,
1760
- columnGroup,
1761
- getItemValue,
1762
- type = "normal",
1763
- checkMassive = false,
1764
- deleteType = "button",
1765
- fnAplicar,
1766
- required,
1767
- disabled,
1768
- background,
1769
- setState,
1770
- state
1771
- }) {
1772
- const labelContent = `<span class="red-asterisk">* </span>` + label;
1773
- let group = "";
1774
- let isSelected = false;
1775
- const [selectedOptions, setSelectedOptions] = React15.useState([]);
1776
- const [prevData, setPrevData] = React15.useState(data);
2225
+
2226
+ // src/Components/Hooks/useWindowDimensions.ts
2227
+ import { useState as useState10, useEffect as useEffect12 } from "react";
2228
+ function getWindowDimensions() {
2229
+ const { innerWidth: width, innerHeight: height } = window;
2230
+ return {
2231
+ width,
2232
+ height
2233
+ };
2234
+ }
2235
+ function useWindowDimensions() {
2236
+ const [windowDimensions, setWindowDimensions] = useState10(getWindowDimensions());
1777
2237
  useEffect12(() => {
1778
- let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
1779
- if (dataChangeValidation == false) {
1780
- setState({ hiddenValue: "-1", textValue: "" });
1781
- setSelectedOptions([]);
1782
- setPrevData(data);
2238
+ function handleResize() {
2239
+ setWindowDimensions(getWindowDimensions());
1783
2240
  }
1784
- }, [data]);
1785
- useEffect12(() => {
1786
- if (type == "multiselect") {
1787
- if (state.hiddenValue != "-1") {
1788
- setSelectedOptions(data.filter(
1789
- (item) => Array.isArray(state.hiddenValue) ? state.hiddenValue.includes(getItemValue(item).value) : getItemValue(item).value === state.hiddenValue
1790
- ));
2241
+ window.addEventListener("resize", handleResize);
2242
+ return () => window.removeEventListener("resize", handleResize);
2243
+ }, []);
2244
+ return windowDimensions;
2245
+ }
2246
+
2247
+ // src/Components/SCMenu.tsx
2248
+ import * as Muicon6 from "@mui/icons-material";
2249
+ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }) => {
2250
+ const { height, width } = useWindowDimensions();
2251
+ const menuSize = widthMenu ? parseInt(widthMenu) : 284;
2252
+ const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
2253
+ const widthContainer = menuSize + pageSize;
2254
+ let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
2255
+ const [selectedIndex, setSelectedIndex] = React17.useState("1");
2256
+ const [value, setValue] = React17.useState("1");
2257
+ React17.useEffect(() => {
2258
+ heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
2259
+ }, [height]);
2260
+ React17.useEffect(() => {
2261
+ if (defaultOption) {
2262
+ handleClickMenusItem(event, void 0);
2263
+ }
2264
+ }, [defaultOption]);
2265
+ options.map(function(option, index, array) {
2266
+ if (option == null ? void 0 : option.iconLeft) {
2267
+ if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
2268
+ option.iconLeft = Muicon6[option == null ? void 0 : option.iconLeft];
2269
+ } else {
2270
+ option;
1791
2271
  }
1792
2272
  }
1793
- }, [state.hiddenValue]);
1794
- data.map(function(option, index, array) {
1795
- if (option == null ? void 0 : option.icon) {
1796
- if ((option == null ? void 0 : option.icon.type) == void 0) {
1797
- option.icon = Muicon6[option == null ? void 0 : option.icon];
1798
- } else {
1799
- option;
2273
+ if (option == null ? void 0 : option.iconRight) {
2274
+ if ((option == null ? void 0 : option.iconRight.type) == void 0) {
2275
+ option.iconRight = Muicon6[option == null ? void 0 : option.iconRight];
2276
+ } else {
2277
+ option;
2278
+ }
2279
+ }
2280
+ });
2281
+ const handleClickMenusItem = (event2, index) => {
2282
+ if (defaultOption && index == void 0) {
2283
+ setSelectedIndex(defaultOption);
2284
+ setValue(defaultOption);
2285
+ } else if (index != void 0) {
2286
+ setSelectedIndex(String(index + 1));
2287
+ setValue(String(index + 1));
2288
+ }
2289
+ };
2290
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(Grid7, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ React17.createElement(Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ React17.createElement(MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
2291
+ MenuItem4,
2292
+ {
2293
+ disabled: disable == true ? true : false,
2294
+ key: index,
2295
+ selected: String(index + 1) === selectedIndex,
2296
+ onClick: (event2) => handleClickMenusItem(event2, index)
2297
+ },
2298
+ option.iconLeft ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
2299
+ /* @__PURE__ */ React17.createElement(Grid7, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React17.createElement(Typography14, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
2300
+ ), option.divider == true ? /* @__PURE__ */ React17.createElement(Divider4, null) : "")))), /* @__PURE__ */ React17.createElement(Grid7, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React17.createElement(Box12, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React17.createElement(Typography14, { color: "error" }, "No se ha configurado el componente a visualizar")))));
2301
+ };
2302
+
2303
+ // src/Components/SCTabs.tsx
2304
+ import React18, { useEffect as useEffect13 } from "react";
2305
+ import { Typography as Typography15, Box as Box13, SvgIcon as SvgIcon7, Tab, Tabs, Badge } from "@mui/material";
2306
+ import TabPanel from "@mui/lab/TabPanel";
2307
+ import TabContext from "@mui/lab/TabContext";
2308
+ import * as Muicon7 from "@mui/icons-material";
2309
+ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
2310
+ const [toast, setToast] = React18.useState(null);
2311
+ let i = 0;
2312
+ let j = 0;
2313
+ let k = 0;
2314
+ let l = 0;
2315
+ let validateTypeIcon = true;
2316
+ const [value, setValue] = React18.useState("1");
2317
+ useEffect13(() => {
2318
+ if (defaultOption) {
2319
+ handleChange(event, void 0);
2320
+ }
2321
+ }, [defaultOption]);
2322
+ options.map(function(option) {
2323
+ const optionsLength = options.length;
2324
+ if (option == null ? void 0 : option.iconOrBadge) {
2325
+ if (typeIcon == "icon") {
2326
+ if ((option == null ? void 0 : option.iconOrBadge) in Muicon7 == true) {
2327
+ validateTypeIcon = true;
2328
+ option.iconOrBadge = Muicon7[option == null ? void 0 : option.iconOrBadge];
2329
+ } else {
2330
+ validateTypeIcon = false;
2331
+ setTimeout(() => {
2332
+ setToast({
2333
+ type: "error",
2334
+ title: "Componente SCTabs",
2335
+ subtitle: "En Option todos los iconOrBadge deben ser iconos de MUI, por favor verificar.",
2336
+ time: 50
2337
+ });
2338
+ }, 10);
2339
+ return;
2340
+ }
2341
+ } else if (typeIcon == "badge") {
2342
+ if ((option == null ? void 0 : option.iconOrBadge) in Muicon7 == false) {
2343
+ validateTypeIcon = true;
2344
+ option;
2345
+ } else {
2346
+ validateTypeIcon = false;
2347
+ setTimeout(() => {
2348
+ setToast({
2349
+ type: "error",
2350
+ title: "Componente SCTabs",
2351
+ subtitle: "En Option todos los iconOrBadge deben ser numeros para el badge, por favor verificar.",
2352
+ time: 10
2353
+ });
2354
+ }, 10);
2355
+ return;
2356
+ }
1800
2357
  }
1801
2358
  }
1802
2359
  });
1803
- const cleanOptions = (event2) => {
1804
- setState({ hiddenValue: "-1", textValue: "" });
1805
- setSelectedOptions([]);
1806
- };
1807
- const handleCheckAll = (event2) => {
1808
- if (event2.target.checked) {
1809
- setSelectedOptions(data);
1810
- setState({
1811
- hiddenValue: data.map((item) => getItemValue(item).value),
1812
- textValue: data.map((item) => getItemValue(item).text)
1813
- });
1814
- } else {
1815
- setSelectedOptions([]);
1816
- setState({ hiddenValue: "-1", textValue: "" });
1817
- }
1818
- };
1819
- const allSelected = data.length > 0 && selectedOptions.length === data.length;
1820
- const handleChange = (event2, value) => {
1821
- if (type === "multiselect") {
1822
- const ids = value.map((v) => getItemValue ? getItemValue(v).value : "");
1823
- const texts = value.map((v) => getItemValue ? getItemValue(v).text : "");
1824
- setSelectedOptions(value);
1825
- setState({
1826
- hiddenValue: ids,
1827
- textValue: texts
1828
- });
1829
- } else {
1830
- setState({
1831
- hiddenValue: getItemValue(value).value,
1832
- textValue: getItemValue(value).text
1833
- });
2360
+ const handleChange = (event2, newValue) => {
2361
+ if (defaultOption && newValue == void 0) {
2362
+ setValue(defaultOption);
2363
+ } else if (newValue != void 0) {
2364
+ setValue(newValue);
1834
2365
  }
1835
2366
  };
1836
- const selectedValue = type === "multiselect" ? data.filter(
1837
- (item) => state.hiddenValue.includes(getItemValue(item).value)
1838
- ) : data.find(
1839
- (item) => getItemValue(item).value === state.hiddenValue
1840
- ) || null;
1841
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, data && /* @__PURE__ */ React15.createElement(
1842
- Autocomplete,
2367
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ React18.createElement(Box13, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ React18.createElement(TabContext, { value }, /* @__PURE__ */ React18.createElement(
2368
+ Tabs,
1843
2369
  {
1844
- multiple: type === "multiselect",
1845
- clearOnEscape: true,
1846
- disabled,
1847
- options: data,
2370
+ "data-testid": "tab-container",
2371
+ value,
1848
2372
  onChange: handleChange,
1849
- getOptionLabel: (option) => getItemValue(option).text,
1850
- value: selectedValue,
1851
- sx: {
1852
- background: background || "transparent",
1853
- width: "100%",
1854
- maxWidth: "100%",
1855
- "& .MuiAutocomplete-tag": {
1856
- maxWidth: 120,
1857
- overflow: "hidden",
1858
- textOverflow: "ellipsis",
1859
- whiteSpace: "nowrap"
1860
- },
1861
- "& .MuiAutocomplete-inputRoot": {
1862
- flexWrap: "nowrap !important",
1863
- overflowX: "auto"
1864
- }
1865
- },
1866
- limitTags: 2,
1867
- renderTags: (value, getTagProps) => {
1868
- const limit = 2;
1869
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, value.slice(0, limit).map((option, index) => /* @__PURE__ */ React15.createElement(
1870
- Chip,
1871
- __spreadProps(__spreadValues({
1872
- color: "default",
1873
- size: "small",
1874
- variant: "filled",
1875
- label: getItemValue(option).text
1876
- }, getTagProps({ index })), {
1877
- style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
1878
- })
1879
- )), value.length > limit && /* @__PURE__ */ React15.createElement(Box11, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
1880
- },
1881
- renderOption: (props, option) => {
1882
- const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
1883
- let isValid;
1884
- if (type == "multiselect") {
1885
- isSelected = selectedOptions.some(
1886
- (selected) => getItemValue(selected).value === getItemValue(option).value
1887
- );
1888
- }
1889
- if (columnGroup) {
1890
- isValid = group == option[columnGroup];
1891
- group = option[columnGroup];
1892
- }
1893
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(React15.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React15.createElement(Typography12, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React15.createElement(MenuItem3, __spreadProps(__spreadValues({}, optionProps), { style: { background: type != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#dfe6ec" : "white" : "white", padding: "7px 16px" } }), type != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React15.createElement(ListItemIcon3, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React15.createElement(SvgIcon7, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", type == "multiselect" ? /* @__PURE__ */ React15.createElement(Checkbox2, { checked: isSelected, value: getItemValue(option).text, color: "primary" }) : "", /* @__PURE__ */ React15.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }))));
1894
- },
1895
- renderInput: (params) => /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
1896
- TextField3,
1897
- __spreadProps(__spreadValues({}, params), {
1898
- label: required ? /* @__PURE__ */ React15.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
1899
- placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
1900
- InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
1901
- endAdornment: /* @__PURE__ */ React15.createElement(React15.Fragment, null, deleteType == "icon" && state.hiddenValue != "-1" ? /* @__PURE__ */ React15.createElement(IconButton8, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ React15.createElement(Clear, { fontSize: "small" })) : "", /* @__PURE__ */ React15.createElement(InputAdornment3, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ React15.createElement(Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
1902
- })
1903
- })
1904
- )),
1905
- slotProps: {
1906
- listbox: {
1907
- component: React15.forwardRef(function ListboxComponent(props, ref) {
1908
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
1909
- Box11,
1910
- __spreadProps(__spreadValues({
1911
- ref
1912
- }, props), {
1913
- sx: __spreadValues({
1914
- position: "relative",
1915
- paddingBottom: "56px",
1916
- backgroundColor: "white"
1917
- }, props.sx)
1918
- }),
1919
- checkMassive && type == "multiselect" ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(FormControlLabel, { control: /* @__PURE__ */ React15.createElement(Checkbox2, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los item", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ React15.createElement(Divider3, null)) : "",
1920
- props.children,
1921
- deleteType == "button" || fnAplicar ? /* @__PURE__ */ React15.createElement(
1922
- Grid7,
1923
- {
1924
- container: true,
1925
- sx: {
1926
- position: "sticky",
1927
- bottom: -8,
1928
- left: 0,
1929
- width: "100%",
1930
- backgroundColor: "grey.50",
1931
- padding: "8px 16px",
1932
- textAlign: "left",
1933
- justifyContent: "space-between"
1934
- }
1935
- },
1936
- deleteType == "button" ? /* @__PURE__ */ React15.createElement(
1937
- Button8,
1938
- {
1939
- variant: "text",
1940
- color: "primary",
1941
- size: "small",
1942
- onClick: (event2) => {
1943
- event2.stopPropagation();
1944
- cleanOptions(event2);
1945
- }
1946
- },
1947
- "Limpiar"
1948
- ) : "",
1949
- fnAplicar && /* @__PURE__ */ React15.createElement(
1950
- Button8,
1951
- {
1952
- variant: "contained",
1953
- color: "primary",
1954
- size: "small",
1955
- onClick: fnAplicar
1956
- },
1957
- "Aplicar"
1958
- )
1959
- ) : ""
1960
- ));
1961
- })
1962
- }
2373
+ variant: variant ? orientation == "vertical" && variant == "fullWidth" ? "standard" : variant : "standard",
2374
+ scrollButtons: scrollButtons == false ? false : true,
2375
+ visibleScrollbar: scrollButtons == false ? true : false,
2376
+ textColor: colorTab,
2377
+ indicatorColor: colorTab,
2378
+ orientation: orientation || "horizontal",
2379
+ sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
2380
+ },
2381
+ options.map((option) => /* @__PURE__ */ React18.createElement(
2382
+ Tab,
2383
+ {
2384
+ "data-testid": "tab-item",
2385
+ value: String(i = i + 1),
2386
+ key: j = j + 1,
2387
+ label: option.name || "",
2388
+ disabled: option.disabled || false,
2389
+ iconPosition: iconPosition || "end",
2390
+ icon: typeIcon == "badge" ? /* @__PURE__ */ React18.createElement(
2391
+ Badge,
2392
+ {
2393
+ sx: {
2394
+ width: "20px",
2395
+ height: "20px",
2396
+ "& .MuiBadge-badge": {
2397
+ top: "10px",
2398
+ right: "10px"
2399
+ }
2400
+ },
2401
+ variant: "standard",
2402
+ badgeContent: option.iconOrBadge,
2403
+ color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
2404
+ }
2405
+ ) : typeIcon == "icon" ? /* @__PURE__ */ React18.createElement(SvgIcon7, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
2406
+ sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
1963
2407
  }
1964
- }
1965
- ));
1966
- }
2408
+ ))
2409
+ ), children, options.map((option) => /* @__PURE__ */ React18.createElement(
2410
+ TabPanel,
2411
+ {
2412
+ key: k = k + 1,
2413
+ value: String(l = l + 1),
2414
+ sx: { padding: "16px" }
2415
+ },
2416
+ option.page ? option.page : /* @__PURE__ */ React18.createElement(Typography15, null, "No se ha configurado el componente a visualizar ")
2417
+ )))) : /* @__PURE__ */ React18.createElement(Box13, { sx: { height: "200px" } }, toast && /* @__PURE__ */ React18.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
2418
+ };
1967
2419
 
1968
2420
  // src/Theme/index.ts
1969
2421
  import { createTheme } from "@mui/material/styles";
1970
2422
 
1971
2423
  // src/Theme/components.ts
1972
- import React16 from "react";
2424
+ import React19 from "react";
1973
2425
  import {
1974
2426
  InfoRounded as InfoRounded2,
1975
2427
  CheckCircleRounded as CheckCircleRounded2,
@@ -2334,7 +2786,7 @@ var components = {
2334
2786
  MuiBackdrop: {
2335
2787
  styleOverrides: {
2336
2788
  root: {
2337
- backgroundColor: "#00000047"
2789
+ backgroundColor: "transparent"
2338
2790
  }
2339
2791
  }
2340
2792
  },
@@ -2672,10 +3124,10 @@ var components = {
2672
3124
  MuiAlert: {
2673
3125
  defaultProps: {
2674
3126
  iconMapping: {
2675
- success: React16.createElement(CheckCircleRounded2),
2676
- error: React16.createElement(ErrorRounded2),
2677
- warning: React16.createElement(WarningRounded2),
2678
- info: React16.createElement(InfoRounded2)
3127
+ success: React19.createElement(CheckCircleRounded2),
3128
+ error: React19.createElement(ErrorRounded2),
3129
+ warning: React19.createElement(WarningRounded2),
3130
+ info: React19.createElement(InfoRounded2)
2679
3131
  }
2680
3132
  },
2681
3133
  variants: [
@@ -3512,85 +3964,8 @@ var paletteADC = __spreadValues({
3512
3964
  }
3513
3965
  }, BasicPalette);
3514
3966
 
3515
- // node_modules/@mui/system/esm/createBreakpoints/createBreakpoints.js
3516
- var sortBreakpointsValues = (values) => {
3517
- const breakpointsAsArray = Object.keys(values).map((key) => ({
3518
- key,
3519
- val: values[key]
3520
- })) || [];
3521
- breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
3522
- return breakpointsAsArray.reduce((acc, obj) => {
3523
- return __spreadProps(__spreadValues({}, acc), {
3524
- [obj.key]: obj.val
3525
- });
3526
- }, {});
3527
- };
3528
- function createBreakpoints(breakpoints2) {
3529
- const _a = breakpoints2, {
3530
- values: values = {
3531
- xs: 0,
3532
- // phone
3533
- sm: 600,
3534
- // tablet
3535
- md: 900,
3536
- // small laptop
3537
- lg: 1200,
3538
- // desktop
3539
- xl: 1536
3540
- // large screen
3541
- },
3542
- unit = "px",
3543
- step = 5
3544
- } = _a, other = __objRest(_a, [
3545
- // The breakpoint **start** at this value.
3546
- // For instance with the first breakpoint xs: [xs, sm).
3547
- "values",
3548
- "unit",
3549
- "step"
3550
- ]);
3551
- const sortedValues = sortBreakpointsValues(values);
3552
- const keys = Object.keys(sortedValues);
3553
- function up(key) {
3554
- const value = typeof values[key] === "number" ? values[key] : key;
3555
- return `@media (min-width:${value}${unit})`;
3556
- }
3557
- function down(key) {
3558
- const value = typeof values[key] === "number" ? values[key] : key;
3559
- return `@media (max-width:${value - step / 100}${unit})`;
3560
- }
3561
- function between(start, end) {
3562
- const endIndex = keys.indexOf(end);
3563
- return `@media (min-width:${typeof values[start] === "number" ? values[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === "number" ? values[keys[endIndex]] : end) - step / 100}${unit})`;
3564
- }
3565
- function only(key) {
3566
- if (keys.indexOf(key) + 1 < keys.length) {
3567
- return between(key, keys[keys.indexOf(key) + 1]);
3568
- }
3569
- return up(key);
3570
- }
3571
- function not(key) {
3572
- const keyIndex = keys.indexOf(key);
3573
- if (keyIndex === 0) {
3574
- return up(keys[1]);
3575
- }
3576
- if (keyIndex === keys.length - 1) {
3577
- return down(keys[keyIndex]);
3578
- }
3579
- return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
3580
- }
3581
- return __spreadValues({
3582
- keys,
3583
- values: sortedValues,
3584
- up,
3585
- down,
3586
- between,
3587
- only,
3588
- not,
3589
- unit
3590
- }, other);
3591
- }
3592
-
3593
3967
  // src/Theme/breakpoints.ts
3968
+ import { createBreakpoints } from "@mui/system";
3594
3969
  var breakpoints = createBreakpoints({
3595
3970
  values: {
3596
3971
  xs: 0,
@@ -3793,16 +4168,20 @@ var ADCSincoTheme = createTheme(__spreadValues({}, ADCTheme));
3793
4168
  export {
3794
4169
  ADCSincoTheme,
3795
4170
  AdproSincoTheme,
4171
+ EmptyState,
3796
4172
  FooterAction,
4173
+ MultiSelect,
3797
4174
  PageHeader,
3798
4175
  SCAutocomplete,
3799
4176
  SCCalendarSwipeable,
3800
4177
  SCDataGrid,
4178
+ SCDataGridInitial,
4179
+ SCDateRange,
3801
4180
  SCDialog,
3802
4181
  SCDrawer,
3803
4182
  SCMenu,
3804
4183
  SCModal,
3805
- SCMultiSelect,
4184
+ SCSelect,
3806
4185
  SCTabs,
3807
4186
  SCTextArea,
3808
4187
  SCTextField,
@@ -3820,14 +4199,3 @@ export {
3820
4199
  useMultiSelectHandlers,
3821
4200
  useProgress
3822
4201
  };
3823
- /*! Bundled license information:
3824
-
3825
- @mui/system/esm/index.js:
3826
- (**
3827
- * @mui/system v7.1.1
3828
- *
3829
- * @license MIT
3830
- * This source code is licensed under the MIT license found in the
3831
- * LICENSE file in the root directory of this source tree.
3832
- *)
3833
- */