componentes-sinco 1.1.30 → 1.1.32
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.cjs +166 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +241 -177
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,8 +52,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
|
|
53
53
|
// src/Components/Adjuntar/Adjuntar.tsx
|
|
54
54
|
import React4, { useEffect as useEffect3, useRef, useState as useState4 } from "react";
|
|
55
|
-
import { Box as Box3, Button as Button3, CircularProgress, IconButton as IconButton3, Stack as Stack3, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
55
|
+
import { Box as Box3, Button as Button3, CircularProgress, IconButton as IconButton3, Stack as Stack3, Tooltip, Typography as Typography3, SvgIcon } from "@mui/material";
|
|
56
56
|
import { CloudUploadOutlined, AttachFileOutlined, DeleteOutline, UploadFileOutlined, FileDownload } from "@mui/icons-material";
|
|
57
|
+
import * as Muicon from "@mui/icons-material";
|
|
57
58
|
|
|
58
59
|
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
59
60
|
import React, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -398,7 +399,8 @@ var Attachment = ({
|
|
|
398
399
|
onChange,
|
|
399
400
|
downloadAction,
|
|
400
401
|
deleteAction,
|
|
401
|
-
initialFiles = []
|
|
402
|
+
initialFiles = [],
|
|
403
|
+
iconFileItem
|
|
402
404
|
}) => {
|
|
403
405
|
const [files, setFiles] = useState4([]);
|
|
404
406
|
const [fileToDelete, setFileToDelete] = useState4(null);
|
|
@@ -406,6 +408,14 @@ var Attachment = ({
|
|
|
406
408
|
const [openModal, setOpenModal] = useState4(false);
|
|
407
409
|
const [isDragFile, setIsDragFile] = useState4(false);
|
|
408
410
|
const inputRef = useRef(null);
|
|
411
|
+
let IconFileItem;
|
|
412
|
+
if (iconFileItem) {
|
|
413
|
+
if (Muicon[iconFileItem] == void 0) {
|
|
414
|
+
IconFileItem = iconFileItem;
|
|
415
|
+
} else {
|
|
416
|
+
IconFileItem = Muicon[iconFileItem];
|
|
417
|
+
}
|
|
418
|
+
}
|
|
409
419
|
useEffect3(() => {
|
|
410
420
|
if (initialFiles && initialFiles.length > 0) {
|
|
411
421
|
setFiles(initialFiles);
|
|
@@ -656,7 +666,7 @@ var Attachment = ({
|
|
|
656
666
|
}
|
|
657
667
|
}
|
|
658
668
|
},
|
|
659
|
-
/* @__PURE__ */ React4.createElement(Stack3, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(
|
|
669
|
+
/* @__PURE__ */ React4.createElement(Stack3, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, iconFileItem ? /* @__PURE__ */ React4.createElement(SvgIcon, { color: file.uploadError ? "error" : "primary", fontSize: "small", component: IconFileItem }) : /* @__PURE__ */ React4.createElement(
|
|
660
670
|
UploadFileOutlined,
|
|
661
671
|
{
|
|
662
672
|
color: file.uploadError ? "error" : "primary",
|
|
@@ -799,7 +809,7 @@ var AttachmentButton = ({ buttonAttachment, open, setOpen }) => {
|
|
|
799
809
|
};
|
|
800
810
|
|
|
801
811
|
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
802
|
-
import { IconButton as IconButton4, Stack as Stack4, SwipeableDrawer, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
812
|
+
import { IconButton as IconButton4, Stack as Stack4, SwipeableDrawer, Tooltip as Tooltip2, Typography as Typography4, SvgIcon as SvgIcon2 } from "@mui/material";
|
|
803
813
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
804
814
|
import { Box as Box4 } from "@mui/system";
|
|
805
815
|
import { CloseOutlined, DeleteOutline as DeleteOutline2, FolderOpenOutlined, PhotoCameraOutlined, UploadFileOutlined as UploadFileOutlined2 } from "@mui/icons-material";
|
|
@@ -807,6 +817,7 @@ import PhotoCameraIcon from "@mui/icons-material/PhotoCamera";
|
|
|
807
817
|
import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined";
|
|
808
818
|
import ImageOutlinedIcon from "@mui/icons-material/ImageOutlined";
|
|
809
819
|
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
|
|
820
|
+
import * as Muicon2 from "@mui/icons-material";
|
|
810
821
|
var AttachmentMobile = ({
|
|
811
822
|
buttonAttachment,
|
|
812
823
|
maxSize = 400,
|
|
@@ -817,7 +828,8 @@ var AttachmentMobile = ({
|
|
|
817
828
|
onChange,
|
|
818
829
|
children,
|
|
819
830
|
sx,
|
|
820
|
-
view = "button"
|
|
831
|
+
view = "button",
|
|
832
|
+
iconFileItem
|
|
821
833
|
}) => {
|
|
822
834
|
const webcamRef = useRef2(null);
|
|
823
835
|
const [abrirCamara, setAbrirCamara] = useState5(false);
|
|
@@ -828,6 +840,14 @@ var AttachmentMobile = ({
|
|
|
828
840
|
const toggleAttachment = (newOpen) => () => {
|
|
829
841
|
setOpen(newOpen);
|
|
830
842
|
};
|
|
843
|
+
let IconFileItem;
|
|
844
|
+
if (iconFileItem) {
|
|
845
|
+
if (Muicon2[iconFileItem] == void 0) {
|
|
846
|
+
IconFileItem = iconFileItem;
|
|
847
|
+
} else {
|
|
848
|
+
IconFileItem = Muicon2[iconFileItem];
|
|
849
|
+
}
|
|
850
|
+
}
|
|
831
851
|
const closeCam = () => {
|
|
832
852
|
setAbrirCamara(false);
|
|
833
853
|
};
|
|
@@ -1136,7 +1156,7 @@ var AttachmentMobile = ({
|
|
|
1136
1156
|
}
|
|
1137
1157
|
}
|
|
1138
1158
|
},
|
|
1139
|
-
/* @__PURE__ */ React6.createElement(Stack4, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React6.createElement(
|
|
1159
|
+
/* @__PURE__ */ React6.createElement(Stack4, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, iconFileItem ? /* @__PURE__ */ React6.createElement(SvgIcon2, { color: file.uploadError ? "error" : "primary", fontSize: "small", component: IconFileItem }) : /* @__PURE__ */ React6.createElement(
|
|
1140
1160
|
UploadFileOutlined2,
|
|
1141
1161
|
{
|
|
1142
1162
|
color: file.uploadError ? "error" : "primary",
|
|
@@ -1185,7 +1205,7 @@ var AttachmentMobile = ({
|
|
|
1185
1205
|
};
|
|
1186
1206
|
|
|
1187
1207
|
// src/Components/Calendario/Calendar.tsx
|
|
1188
|
-
import React31, { useEffect as
|
|
1208
|
+
import React31, { useEffect as useEffect11, useState as useState14 } from "react";
|
|
1189
1209
|
import { Box as Box19, CircularProgress as CircularProgress5 } from "@mui/material";
|
|
1190
1210
|
|
|
1191
1211
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
@@ -1390,10 +1410,10 @@ import { Drawer, Stack as Stack9, SwipeableDrawer as SwipeableDrawer2, Box as Bo
|
|
|
1390
1410
|
import Grid6 from "@mui/material/Grid";
|
|
1391
1411
|
|
|
1392
1412
|
// src/Components/Drawer/Helpers/Utils.tsx
|
|
1393
|
-
import * as
|
|
1413
|
+
import * as Muicon3 from "@mui/icons-material";
|
|
1394
1414
|
var getIcon = (iconName) => {
|
|
1395
|
-
if (iconName && iconName in
|
|
1396
|
-
return
|
|
1415
|
+
if (iconName && iconName in Muicon3) {
|
|
1416
|
+
return Muicon3[iconName];
|
|
1397
1417
|
}
|
|
1398
1418
|
return null;
|
|
1399
1419
|
};
|
|
@@ -1429,58 +1449,75 @@ var validateInputs = (arrayElements, onError, onSuccess, setChipFilters, setText
|
|
|
1429
1449
|
|
|
1430
1450
|
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
1431
1451
|
import React9 from "react";
|
|
1452
|
+
var COMPONENT_NAME_MAP = {
|
|
1453
|
+
SCtextField: "textField",
|
|
1454
|
+
SCtextArea: "textArea",
|
|
1455
|
+
SCDateRange: "dateRange",
|
|
1456
|
+
SCDatePicker: "datePicker",
|
|
1457
|
+
SCTime: "time",
|
|
1458
|
+
SCAutocomplete: "autocomplete",
|
|
1459
|
+
SCSelect: "select"
|
|
1460
|
+
};
|
|
1461
|
+
var getComponentName = (node) => {
|
|
1462
|
+
const type = node.type;
|
|
1463
|
+
return typeof type === "function" ? type.displayName || type.name || "" : "";
|
|
1464
|
+
};
|
|
1465
|
+
var isKnownComponent = (node) => {
|
|
1466
|
+
var _a;
|
|
1467
|
+
const name = getComponentName(node);
|
|
1468
|
+
if (COMPONENT_NAME_MAP[name]) return true;
|
|
1469
|
+
if (((_a = node.props) == null ? void 0 : _a.typeFormat) === "multiselect") return true;
|
|
1470
|
+
return false;
|
|
1471
|
+
};
|
|
1472
|
+
var findInTree = (node) => {
|
|
1473
|
+
var _a;
|
|
1474
|
+
if (!React9.isValidElement(node)) return null;
|
|
1475
|
+
if (isKnownComponent(node)) return node;
|
|
1476
|
+
const children = (_a = node.props) == null ? void 0 : _a.children;
|
|
1477
|
+
if (!children) return null;
|
|
1478
|
+
for (const child of React9.Children.toArray(children)) {
|
|
1479
|
+
if (React9.isValidElement(child)) {
|
|
1480
|
+
const found = findInTree(child);
|
|
1481
|
+
if (found) return found;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return null;
|
|
1485
|
+
};
|
|
1486
|
+
var resolveValidation = (node) => {
|
|
1487
|
+
var _a;
|
|
1488
|
+
const name = getComponentName(node);
|
|
1489
|
+
if (((_a = node.props) == null ? void 0 : _a.typeFormat) === "multiselect") return "multiselect";
|
|
1490
|
+
return COMPONENT_NAME_MAP[name] || "";
|
|
1491
|
+
};
|
|
1432
1492
|
var validateTypeElements = (element) => {
|
|
1433
1493
|
var _a;
|
|
1434
1494
|
let validation = "";
|
|
1435
1495
|
let typeElement = element;
|
|
1436
|
-
if (element.type
|
|
1437
|
-
validation =
|
|
1496
|
+
if (element.type && COMPONENT_NAME_MAP[(_a = Object.keys(COMPONENT_NAME_MAP).find((k) => COMPONENT_NAME_MAP[k] === element.type)) != null ? _a : ""]) {
|
|
1497
|
+
validation = element.type;
|
|
1438
1498
|
typeElement = element;
|
|
1439
|
-
} else if (
|
|
1440
|
-
validation = "textField";
|
|
1441
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1442
|
-
} else if (element.type == "textArea") {
|
|
1443
|
-
validation = "textArea";
|
|
1444
|
-
typeElement = element;
|
|
1445
|
-
} else if (React9.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextArea") {
|
|
1446
|
-
validation = "textArea";
|
|
1447
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1448
|
-
} else if (element.type == "dateRange") {
|
|
1449
|
-
validation = "dateRange";
|
|
1450
|
-
typeElement = element;
|
|
1451
|
-
} else if (React9.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCDateRange") {
|
|
1452
|
-
validation = "dateRange";
|
|
1453
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1454
|
-
} else if (element.type == "autocomplete") {
|
|
1455
|
-
validation = "autocomplete";
|
|
1456
|
-
typeElement = element;
|
|
1457
|
-
} else if (React9.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCAutocomplete") {
|
|
1458
|
-
validation = "autocomplete";
|
|
1459
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1460
|
-
} else if (element.typeFormat == "multiselect") {
|
|
1461
|
-
validation = "multiselect";
|
|
1462
|
-
typeElement = element;
|
|
1463
|
-
} else if (React9.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_a = element == null ? void 0 : element.component) == null ? void 0 : _a.props).typeFormat == "multiselect") {
|
|
1499
|
+
} else if (element.typeFormat === "multiselect") {
|
|
1464
1500
|
validation = "multiselect";
|
|
1465
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1466
|
-
} else if (element.type == "select") {
|
|
1467
|
-
validation = "select";
|
|
1468
1501
|
typeElement = element;
|
|
1469
|
-
} else if (React9.isValidElement(element == null ? void 0 : element.component) && element.component
|
|
1470
|
-
|
|
1471
|
-
|
|
1502
|
+
} else if (React9.isValidElement(element == null ? void 0 : element.component) && isKnownComponent(element.component)) {
|
|
1503
|
+
const node = element.component;
|
|
1504
|
+
validation = resolveValidation(node);
|
|
1505
|
+
typeElement = node.props;
|
|
1506
|
+
} else if (React9.isValidElement(element == null ? void 0 : element.component)) {
|
|
1507
|
+
const found = findInTree(element.component);
|
|
1508
|
+
if (found) {
|
|
1509
|
+
validation = resolveValidation(found);
|
|
1510
|
+
typeElement = found.props;
|
|
1511
|
+
}
|
|
1472
1512
|
}
|
|
1473
|
-
return {
|
|
1474
|
-
validation,
|
|
1475
|
-
element: typeElement
|
|
1476
|
-
};
|
|
1513
|
+
return { validation, element: typeElement };
|
|
1477
1514
|
};
|
|
1478
1515
|
|
|
1479
1516
|
// src/Components/Drawer/hooks/useDrawerState.ts
|
|
1480
|
-
import { useState as useState7, useEffect as
|
|
1517
|
+
import { useState as useState7, useEffect as useEffect5 } from "react";
|
|
1481
1518
|
var useDrawerState = ({ open, setOpen }) => {
|
|
1482
1519
|
const [drawerOpen, setDrawerOpen] = useState7(open || false);
|
|
1483
|
-
|
|
1520
|
+
useEffect5(() => {
|
|
1484
1521
|
if (open !== void 0) {
|
|
1485
1522
|
setDrawerOpen(open);
|
|
1486
1523
|
}
|
|
@@ -1509,11 +1546,11 @@ var useDrawerState = ({ open, setOpen }) => {
|
|
|
1509
1546
|
};
|
|
1510
1547
|
|
|
1511
1548
|
// src/Components/Drawer/hooks/useChipFilters.ts
|
|
1512
|
-
import { useState as useState8, useEffect as
|
|
1549
|
+
import { useState as useState8, useEffect as useEffect6 } from "react";
|
|
1513
1550
|
var useChipFilters = (arrayElements, chipFilters) => {
|
|
1514
1551
|
const [stateChipFilters, setChipFilters] = useState8(false);
|
|
1515
1552
|
const [textFilters, setTextFilters] = useState8([]);
|
|
1516
|
-
|
|
1553
|
+
useEffect6(() => {
|
|
1517
1554
|
if (chipFilters == null ? void 0 : chipFilters.length) {
|
|
1518
1555
|
setTextFilters([]);
|
|
1519
1556
|
processChipFilters();
|
|
@@ -1538,11 +1575,11 @@ var useChipFilters = (arrayElements, chipFilters) => {
|
|
|
1538
1575
|
const processManualFilters = () => {
|
|
1539
1576
|
const newFiltersToAdd = [];
|
|
1540
1577
|
arrayElements.forEach((element) => {
|
|
1541
|
-
var _a, _b, _c, _d;
|
|
1578
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1542
1579
|
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1543
1580
|
const textValue = ((_a = typeElement.state) == null ? void 0 : _a.textValue) !== void 0 ? String((_b = typeElement.state) == null ? void 0 : _b.textValue) : String(typeElement.state);
|
|
1544
|
-
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1545
|
-
const value = validation === "dateRange" ? `${(_c = typeElement.state[0]) == null ? void 0 : _c.format("DD/MM/YYYY")} - ${(_d = typeElement.state[1]) == null ? void 0 : _d.format("DD/MM/YYYY")}` : textValue;
|
|
1581
|
+
if (textValue.trim() !== "" && textValue.trim() !== "," && textValue.trim() !== "undefined") {
|
|
1582
|
+
const value = validation === "dateRange" ? `${(_c = typeElement.state[0]) == null ? void 0 : _c.format("DD/MM/YYYY")} - ${(_d = typeElement.state[1]) == null ? void 0 : _d.format("DD/MM/YYYY")}` : validation === "datePicker" ? (_f = (_e = typeElement.state) == null ? void 0 : _e.format("DD/MM/YYYY")) != null ? _f : "" : validation === "time" ? (_h = (_g = typeElement.state) == null ? void 0 : _g.format("HH:mm")) != null ? _h : "" : textValue;
|
|
1546
1583
|
const existingFilterIndex = newFiltersToAdd.findIndex(
|
|
1547
1584
|
(filter) => filter.arrayElement.label === element.label
|
|
1548
1585
|
);
|
|
@@ -1570,20 +1607,26 @@ var useChipFilters = (arrayElements, chipFilters) => {
|
|
|
1570
1607
|
});
|
|
1571
1608
|
};
|
|
1572
1609
|
const getCurrentValue = (validation, typeElement) => {
|
|
1573
|
-
var _a, _b, _c, _d, _e;
|
|
1610
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1574
1611
|
if (validation === "dateRange") {
|
|
1575
1612
|
if (((_a = typeElement.state) == null ? void 0 : _a[0]) && ((_b = typeElement.state) == null ? void 0 : _b[1])) {
|
|
1576
1613
|
return `${(_c = typeElement.state[0]) == null ? void 0 : _c.format("DD/MM/YYYY")} - ${(_d = typeElement.state[1]) == null ? void 0 : _d.format("DD/MM/YYYY")}`;
|
|
1577
1614
|
}
|
|
1578
1615
|
return "";
|
|
1579
1616
|
}
|
|
1580
|
-
|
|
1617
|
+
if (validation === "datePicker") {
|
|
1618
|
+
return ((_f = (_e = typeElement.state) == null ? void 0 : _e.isValid) == null ? void 0 : _f.call(_e)) ? typeElement.state.format("DD/MM/YYYY") : "";
|
|
1619
|
+
}
|
|
1620
|
+
if (validation === "time") {
|
|
1621
|
+
return ((_h = (_g = typeElement.state) == null ? void 0 : _g.isValid) == null ? void 0 : _h.call(_g)) ? typeElement.state.format("HH:mm") : "";
|
|
1622
|
+
}
|
|
1623
|
+
return ((_i = typeElement.state) == null ? void 0 : _i.textValue) !== void 0 ? String(typeElement.state.textValue).trim() : String(typeElement.state).trim();
|
|
1581
1624
|
};
|
|
1582
1625
|
const updateFilter = (value, typeElement, label) => {
|
|
1583
1626
|
setTextFilters((prevFilters) => {
|
|
1584
1627
|
const newFilter = { value, arrayElement: typeElement };
|
|
1585
1628
|
const existingFilterIndex = prevFilters.findIndex(
|
|
1586
|
-
(filter) => filter.arrayElement.label === label
|
|
1629
|
+
(filter) => label !== void 0 ? filter.arrayElement.label === label : filter.value === value
|
|
1587
1630
|
);
|
|
1588
1631
|
if (existingFilterIndex !== -1) {
|
|
1589
1632
|
const updatedFilters = [...prevFilters];
|
|
@@ -1604,7 +1647,7 @@ var useChipFilters = (arrayElements, chipFilters) => {
|
|
|
1604
1647
|
return ((_b = typeElement.state) == null ? void 0 : _b[0]) !== null && ((_c = typeElement.state) == null ? void 0 : _c[1]) !== null;
|
|
1605
1648
|
} else {
|
|
1606
1649
|
const stateValue = String(typeElement.state).trim();
|
|
1607
|
-
return stateValue !== "" && stateValue !== ",";
|
|
1650
|
+
return stateValue !== "" && stateValue !== "," && stateValue !== "undefined";
|
|
1608
1651
|
}
|
|
1609
1652
|
});
|
|
1610
1653
|
};
|
|
@@ -1649,6 +1692,10 @@ var resetElementByType = (originalElement, validation, typeElement) => {
|
|
|
1649
1692
|
case "dateRange":
|
|
1650
1693
|
defaultValue = [null, null];
|
|
1651
1694
|
break;
|
|
1695
|
+
case "datePicker":
|
|
1696
|
+
case "time":
|
|
1697
|
+
defaultValue = null;
|
|
1698
|
+
break;
|
|
1652
1699
|
case "multiselect":
|
|
1653
1700
|
defaultValue = { hiddenValue: [], textValue: [] };
|
|
1654
1701
|
break;
|
|
@@ -1725,21 +1772,21 @@ var DrawerButton = ({
|
|
|
1725
1772
|
};
|
|
1726
1773
|
|
|
1727
1774
|
// src/Components/Drawer/components/ChipFiltersDisplay.tsx
|
|
1728
|
-
import React11, { useRef as
|
|
1775
|
+
import React11, { useRef as useRef3 } from "react";
|
|
1729
1776
|
import { Box as Box7, IconButton as IconButton6, Chip as Chip3 } from "@mui/material";
|
|
1730
|
-
import
|
|
1731
|
-
import
|
|
1777
|
+
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
1778
|
+
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
1732
1779
|
var ChipFiltersDisplay = ({
|
|
1733
1780
|
textFilters,
|
|
1734
1781
|
onDeleteFilter
|
|
1735
1782
|
}) => {
|
|
1736
|
-
const scrollRef =
|
|
1783
|
+
const scrollRef = useRef3(null);
|
|
1737
1784
|
const scroll = (offset) => {
|
|
1738
1785
|
if (scrollRef.current) {
|
|
1739
1786
|
scrollRef.current.scrollLeft += offset;
|
|
1740
1787
|
}
|
|
1741
1788
|
};
|
|
1742
|
-
return /* @__PURE__ */ React11.createElement(Box7, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ React11.createElement(IconButton6, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ React11.createElement(
|
|
1789
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, (textFilters == null ? void 0 : textFilters.length) > 0 && /* @__PURE__ */ React11.createElement(Box7, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ React11.createElement(IconButton6, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ React11.createElement(ChevronLeftIcon, { fontSize: "small", color: "action" })), /* @__PURE__ */ React11.createElement(
|
|
1743
1790
|
Box7,
|
|
1744
1791
|
{
|
|
1745
1792
|
ref: scrollRef,
|
|
@@ -1766,7 +1813,7 @@ var ChipFiltersDisplay = ({
|
|
|
1766
1813
|
}
|
|
1767
1814
|
})
|
|
1768
1815
|
))
|
|
1769
|
-
), /* @__PURE__ */ React11.createElement(IconButton6, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ React11.createElement(
|
|
1816
|
+
), /* @__PURE__ */ React11.createElement(IconButton6, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ React11.createElement(ChevronRightIcon, { fontSize: "small", color: "action" }))));
|
|
1770
1817
|
};
|
|
1771
1818
|
|
|
1772
1819
|
// src/Components/Drawer/components/DrawerContent.tsx
|
|
@@ -1774,22 +1821,22 @@ import React17 from "react";
|
|
|
1774
1821
|
import { Box as Box13, Stack as Stack8 } from "@mui/material";
|
|
1775
1822
|
|
|
1776
1823
|
// src/Components/Textfield/SCTextField.tsx
|
|
1777
|
-
import React12, { useEffect as
|
|
1778
|
-
import { FormControl, IconButton as IconButton7, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover as Popover2, Input, Box as Box8, Typography as Typography7, SvgIcon, Tooltip as Tooltip4 } from "@mui/material";
|
|
1824
|
+
import React12, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1825
|
+
import { FormControl, IconButton as IconButton7, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover as Popover2, Input, Box as Box8, Typography as Typography7, SvgIcon as SvgIcon3, Tooltip as Tooltip4 } from "@mui/material";
|
|
1779
1826
|
import Grid from "@mui/material/Grid";
|
|
1780
1827
|
import { Visibility, VisibilityOff, InfoOutlined } from "@mui/icons-material";
|
|
1781
1828
|
|
|
1782
1829
|
// src/Components/Textfield/Helpers/validateIcon.tsx
|
|
1783
|
-
import * as
|
|
1830
|
+
import * as Muicon4 from "@mui/icons-material";
|
|
1784
1831
|
function getIconComponent2(name) {
|
|
1785
1832
|
if (typeof name !== "string") return name;
|
|
1786
|
-
return name in
|
|
1833
|
+
return name in Muicon4 ? Muicon4[name] : void 0;
|
|
1787
1834
|
}
|
|
1788
1835
|
function getIconValidation(name) {
|
|
1789
1836
|
if (typeof name !== "string") {
|
|
1790
1837
|
return (name == null ? void 0 : name.type) ? "icon" : "text";
|
|
1791
1838
|
}
|
|
1792
|
-
return name in
|
|
1839
|
+
return name in Muicon4 ? "icon" : "text";
|
|
1793
1840
|
}
|
|
1794
1841
|
|
|
1795
1842
|
// src/Components/Textfield/Helpers/validateKeyDown.tsx
|
|
@@ -1869,7 +1916,7 @@ var SCTextField = ({
|
|
|
1869
1916
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
1870
1917
|
const [anchorInfoElement, setAnchorInfoElement] = useState10(null);
|
|
1871
1918
|
const openInfoElement = Boolean(anchorInfoElement);
|
|
1872
|
-
|
|
1919
|
+
useEffect7(() => {
|
|
1873
1920
|
if (error) {
|
|
1874
1921
|
setTimeout(() => {
|
|
1875
1922
|
setError(false);
|
|
@@ -1919,7 +1966,7 @@ var SCTextField = ({
|
|
|
1919
1966
|
const handleCloseInfoElement = () => {
|
|
1920
1967
|
setAnchorInfoElement(null);
|
|
1921
1968
|
};
|
|
1922
|
-
return /* @__PURE__ */ React12.createElement(Box8, { sx: { width } }, /* @__PURE__ */ React12.createElement(Grid, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ React12.createElement(
|
|
1969
|
+
return /* @__PURE__ */ React12.createElement(Box8, { sx: { width } }, /* @__PURE__ */ React12.createElement(Grid, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ React12.createElement(SvgIcon3, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ React12.createElement(Typography7, { mx: 0.5, variant: "subtitle2", color: "text.secondary" }, title) : "", infoTitle ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
1923
1970
|
InfoOutlined,
|
|
1924
1971
|
{
|
|
1925
1972
|
color: "action",
|
|
@@ -2108,8 +2155,8 @@ function getIcon2(name) {
|
|
|
2108
2155
|
}
|
|
2109
2156
|
|
|
2110
2157
|
// src/Components/TextArea/SCTextArea.tsx
|
|
2111
|
-
import React13, { useEffect as
|
|
2112
|
-
import { Typography as Typography8, Stack as Stack7, TextField, Box as Box9, Popover as Popover3, Tooltip as Tooltip5, SvgIcon as
|
|
2158
|
+
import React13, { useEffect as useEffect8, useState as useState11 } from "react";
|
|
2159
|
+
import { Typography as Typography8, Stack as Stack7, TextField, Box as Box9, Popover as Popover3, Tooltip as Tooltip5, SvgIcon as SvgIcon4, Grid as Grid2 } from "@mui/material";
|
|
2113
2160
|
import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
|
|
2114
2161
|
var SCTextArea = ({
|
|
2115
2162
|
//informativas
|
|
@@ -2136,7 +2183,7 @@ var SCTextArea = ({
|
|
|
2136
2183
|
const [stateError, setStateError] = useState11(false);
|
|
2137
2184
|
const [anchorInfoTitle, setAnchorInfoTitle] = React13.useState(null);
|
|
2138
2185
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
2139
|
-
|
|
2186
|
+
useEffect8(() => {
|
|
2140
2187
|
setHelperCount(state == null ? void 0 : state.length);
|
|
2141
2188
|
}, [state]);
|
|
2142
2189
|
const IconTitle = getIcon2(iconTitle);
|
|
@@ -2158,7 +2205,7 @@ var SCTextArea = ({
|
|
|
2158
2205
|
const handleCloseInfoTitle = () => {
|
|
2159
2206
|
setAnchorInfoTitle(null);
|
|
2160
2207
|
};
|
|
2161
|
-
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Box9, { sx: { width } }, /* @__PURE__ */ React13.createElement(Grid2, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ React13.createElement(
|
|
2208
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Box9, { sx: { width } }, /* @__PURE__ */ React13.createElement(Grid2, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ React13.createElement(SvgIcon4, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ React13.createElement(Typography8, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
2162
2209
|
InfoOutlined2,
|
|
2163
2210
|
{
|
|
2164
2211
|
color: "action",
|
|
@@ -2229,10 +2276,10 @@ var SCTextArea = ({
|
|
|
2229
2276
|
};
|
|
2230
2277
|
|
|
2231
2278
|
// src/Components/SCSelect.tsx
|
|
2232
|
-
import React14, { useEffect as
|
|
2233
|
-
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem as MenuItem2, SvgIcon as
|
|
2279
|
+
import React14, { useEffect as useEffect9 } from "react";
|
|
2280
|
+
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem as MenuItem2, SvgIcon as SvgIcon5, ListItemIcon, ListItemText, Box as Box10 } from "@mui/material";
|
|
2234
2281
|
import Select from "@mui/material/Select";
|
|
2235
|
-
import * as
|
|
2282
|
+
import * as Muicon5 from "@mui/icons-material";
|
|
2236
2283
|
function SCSelect({
|
|
2237
2284
|
label = "",
|
|
2238
2285
|
data,
|
|
@@ -2249,14 +2296,14 @@ function SCSelect({
|
|
|
2249
2296
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
2250
2297
|
const [prevData, setPrevData] = React14.useState(data);
|
|
2251
2298
|
const [error, setError] = React14.useState(false);
|
|
2252
|
-
|
|
2299
|
+
useEffect9(() => {
|
|
2253
2300
|
if (error) {
|
|
2254
2301
|
setTimeout(() => {
|
|
2255
2302
|
setError(false);
|
|
2256
2303
|
}, 1e3);
|
|
2257
2304
|
}
|
|
2258
2305
|
}, [error]);
|
|
2259
|
-
|
|
2306
|
+
useEffect9(() => {
|
|
2260
2307
|
let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
2261
2308
|
if (dataChangeValidation == false) {
|
|
2262
2309
|
setState({ hiddenValue: "", textValue: "" });
|
|
@@ -2266,7 +2313,7 @@ function SCSelect({
|
|
|
2266
2313
|
data.map(function(option, index, array) {
|
|
2267
2314
|
if (option == null ? void 0 : option.icon) {
|
|
2268
2315
|
if ((option == null ? void 0 : option.icon.type) == void 0) {
|
|
2269
|
-
option.icon =
|
|
2316
|
+
option.icon = Muicon5[option == null ? void 0 : option.icon];
|
|
2270
2317
|
} else {
|
|
2271
2318
|
option;
|
|
2272
2319
|
}
|
|
@@ -2338,17 +2385,17 @@ function SCSelect({
|
|
|
2338
2385
|
}
|
|
2339
2386
|
},
|
|
2340
2387
|
data.map((option, index) => {
|
|
2341
|
-
return /* @__PURE__ */ React14.createElement(MenuItem2, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React14.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React14.createElement(
|
|
2388
|
+
return /* @__PURE__ */ React14.createElement(MenuItem2, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React14.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React14.createElement(SvgIcon5, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ React14.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
|
|
2342
2389
|
})
|
|
2343
2390
|
)
|
|
2344
2391
|
)));
|
|
2345
2392
|
}
|
|
2346
2393
|
|
|
2347
2394
|
// src/Components/SCAutocomplete.tsx
|
|
2348
|
-
import React15, { useEffect as
|
|
2349
|
-
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem3, TextField as TextField3, Typography as Typography10, SvgIcon as
|
|
2395
|
+
import React15, { useEffect as useEffect10, useMemo as useMemo3 } from "react";
|
|
2396
|
+
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem3, TextField as TextField3, Typography as Typography10, SvgIcon as SvgIcon6, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider4, FormControlLabel as FormControlLabel2, IconButton as IconButton9, Chip as Chip4, Box as Box11, Button as Button7, Grid as Grid3 } from "@mui/material";
|
|
2350
2397
|
import { Search, Clear } from "@mui/icons-material";
|
|
2351
|
-
import * as
|
|
2398
|
+
import * as Muicon6 from "@mui/icons-material";
|
|
2352
2399
|
var StopEvent = ({ children }) => {
|
|
2353
2400
|
return /* @__PURE__ */ React15.createElement(
|
|
2354
2401
|
Box11,
|
|
@@ -2382,7 +2429,8 @@ function SCAutocomplete({
|
|
|
2382
2429
|
setState,
|
|
2383
2430
|
state,
|
|
2384
2431
|
inputChange,
|
|
2385
|
-
maxCheck
|
|
2432
|
+
maxCheck,
|
|
2433
|
+
width = "100%"
|
|
2386
2434
|
}) {
|
|
2387
2435
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
2388
2436
|
let group = "";
|
|
@@ -2392,7 +2440,7 @@ function SCAutocomplete({
|
|
|
2392
2440
|
const [originalData, setOriginalData] = React15.useState(data);
|
|
2393
2441
|
const [inputValue, setInputValue] = React15.useState("");
|
|
2394
2442
|
const [isUserTyping, setIsUserTyping] = React15.useState(false);
|
|
2395
|
-
|
|
2443
|
+
useEffect10(() => {
|
|
2396
2444
|
const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
2397
2445
|
if (!dataChangeValidation && !isUserTyping) {
|
|
2398
2446
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
@@ -2403,7 +2451,7 @@ function SCAutocomplete({
|
|
|
2403
2451
|
}
|
|
2404
2452
|
setPrevData(data);
|
|
2405
2453
|
}, [data, isUserTyping]);
|
|
2406
|
-
|
|
2454
|
+
useEffect10(() => {
|
|
2407
2455
|
if (typeFormat == "multiselect") {
|
|
2408
2456
|
if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
|
|
2409
2457
|
const newSelectedOptions = originalData.filter(
|
|
@@ -2413,16 +2461,16 @@ function SCAutocomplete({
|
|
|
2413
2461
|
}
|
|
2414
2462
|
}
|
|
2415
2463
|
}, [state.hiddenValue, originalData, typeFormat]);
|
|
2416
|
-
|
|
2464
|
+
useEffect10(() => {
|
|
2417
2465
|
if (inputValue === "") {
|
|
2418
2466
|
setIsUserTyping(false);
|
|
2419
2467
|
}
|
|
2420
2468
|
}, [inputValue]);
|
|
2421
|
-
const normalizedData =
|
|
2469
|
+
const normalizedData = useMemo3(() => {
|
|
2422
2470
|
return data.map((option) => {
|
|
2423
2471
|
if ((option == null ? void 0 : option.icon) && option.icon.type === void 0) {
|
|
2424
2472
|
return __spreadProps(__spreadValues({}, option), {
|
|
2425
|
-
icon:
|
|
2473
|
+
icon: Muicon6[option.icon]
|
|
2426
2474
|
});
|
|
2427
2475
|
}
|
|
2428
2476
|
return option;
|
|
@@ -2474,13 +2522,26 @@ function SCAutocomplete({
|
|
|
2474
2522
|
) || null;
|
|
2475
2523
|
const [open, setOpen] = React15.useState(false);
|
|
2476
2524
|
const componentClickActiveRef = React15.useRef(false);
|
|
2477
|
-
const
|
|
2525
|
+
const containerRef = React15.useRef(null);
|
|
2526
|
+
const [chipLimit, setChipLimit] = React15.useState(2);
|
|
2527
|
+
useEffect10(() => {
|
|
2528
|
+
const el = containerRef.current;
|
|
2529
|
+
if (!el) return;
|
|
2530
|
+
const observer = new ResizeObserver((entries) => {
|
|
2531
|
+
const width2 = entries[0].contentRect.width;
|
|
2532
|
+
const limit = Math.max(1, Math.floor((width2 - 80) / 128));
|
|
2533
|
+
setChipLimit(limit);
|
|
2534
|
+
});
|
|
2535
|
+
observer.observe(el);
|
|
2536
|
+
return () => observer.disconnect();
|
|
2537
|
+
}, []);
|
|
2538
|
+
const hayOnComponentClickGlobal = useMemo3(() => {
|
|
2478
2539
|
return data.some((opt) => {
|
|
2479
2540
|
const item = getItemValue(opt);
|
|
2480
2541
|
return Boolean(item.onComponentClick);
|
|
2481
2542
|
});
|
|
2482
2543
|
}, [data, getItemValue]);
|
|
2483
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, data && /* @__PURE__ */ React15.createElement(
|
|
2544
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, data && /* @__PURE__ */ React15.createElement(Box11, { ref: containerRef, sx: { width } }, /* @__PURE__ */ React15.createElement(
|
|
2484
2545
|
Autocomplete,
|
|
2485
2546
|
__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { disableCloseOnSelect: true } : {}), hayOnComponentClickGlobal ? { blurOnSelect: false } : {}), hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
2486
2547
|
onClose: (event2, reason) => {
|
|
@@ -2510,9 +2571,9 @@ function SCAutocomplete({
|
|
|
2510
2571
|
width: "100%",
|
|
2511
2572
|
maxWidth: "100%"
|
|
2512
2573
|
},
|
|
2513
|
-
limitTags:
|
|
2574
|
+
limitTags: chipLimit,
|
|
2514
2575
|
renderTags: (value, getTagProps) => {
|
|
2515
|
-
const limit =
|
|
2576
|
+
const limit = chipLimit;
|
|
2516
2577
|
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, value.slice(0, limit).map((option, index) => {
|
|
2517
2578
|
const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
|
|
2518
2579
|
return /* @__PURE__ */ React15.createElement(
|
|
@@ -2557,7 +2618,7 @@ function SCAutocomplete({
|
|
|
2557
2618
|
opacity: isDisabled ? 0.5 : 1
|
|
2558
2619
|
}
|
|
2559
2620
|
}),
|
|
2560
|
-
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React15.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React15.createElement(
|
|
2621
|
+
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React15.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React15.createElement(SvgIcon6, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
|
|
2561
2622
|
typeFormat == "multiselect" ? /* @__PURE__ */ React15.createElement(
|
|
2562
2623
|
Checkbox,
|
|
2563
2624
|
{
|
|
@@ -2595,7 +2656,14 @@ function SCAutocomplete({
|
|
|
2595
2656
|
},
|
|
2596
2657
|
renderInput: (params) => /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
2597
2658
|
TextField3,
|
|
2598
|
-
__spreadProps(__spreadValues({
|
|
2659
|
+
__spreadProps(__spreadValues({
|
|
2660
|
+
sx: { "& .MuiOutlinedInput-input": {
|
|
2661
|
+
padding: "2.5px 2px 2.5px 2px !important",
|
|
2662
|
+
// ajusta aquí
|
|
2663
|
+
width: "10px !important",
|
|
2664
|
+
minWidth: "10px !important"
|
|
2665
|
+
} }
|
|
2666
|
+
}, params), {
|
|
2599
2667
|
label: required ? /* @__PURE__ */ React15.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
2600
2668
|
placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
|
|
2601
2669
|
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
@@ -2670,7 +2738,7 @@ function SCAutocomplete({
|
|
|
2670
2738
|
}
|
|
2671
2739
|
}
|
|
2672
2740
|
})
|
|
2673
|
-
));
|
|
2741
|
+
)));
|
|
2674
2742
|
}
|
|
2675
2743
|
|
|
2676
2744
|
// src/Components/SCDateRange.tsx
|
|
@@ -3833,7 +3901,7 @@ var Calendar = ({
|
|
|
3833
3901
|
}) => {
|
|
3834
3902
|
const [view, setView] = useState14(initialView);
|
|
3835
3903
|
const { currentDate, navigateDate } = useCalendarNavigation(dayjs9(), onDateChange);
|
|
3836
|
-
|
|
3904
|
+
useEffect11(() => {
|
|
3837
3905
|
onDateChange == null ? void 0 : onDateChange(currentDate);
|
|
3838
3906
|
}, [currentDate, onDateChange]);
|
|
3839
3907
|
const handleViewChange = (newView) => {
|
|
@@ -3935,7 +4003,7 @@ var FooterAction = ({
|
|
|
3935
4003
|
};
|
|
3936
4004
|
|
|
3937
4005
|
// src/Components/Menu/Menu.tsx
|
|
3938
|
-
import React33, { useCallback as
|
|
4006
|
+
import React33, { useCallback as useCallback3, useState as useState15 } from "react";
|
|
3939
4007
|
import { Button as Button12, Menu as Menu2 } from "@mui/material";
|
|
3940
4008
|
var BasicMenu = ({
|
|
3941
4009
|
open,
|
|
@@ -3954,7 +4022,7 @@ var BasicMenu = ({
|
|
|
3954
4022
|
} : setInternalOpen;
|
|
3955
4023
|
const menuAnchorEl = anchorEl != null ? anchorEl : internalAnchorEl;
|
|
3956
4024
|
const actualOpen = Boolean(menuAnchorEl) && menuOpen;
|
|
3957
|
-
const handleButtonClick =
|
|
4025
|
+
const handleButtonClick = useCallback3((event2) => {
|
|
3958
4026
|
if (handleClick) {
|
|
3959
4027
|
handleClick(event2);
|
|
3960
4028
|
} else {
|
|
@@ -3964,7 +4032,7 @@ var BasicMenu = ({
|
|
|
3964
4032
|
}
|
|
3965
4033
|
}
|
|
3966
4034
|
}, [handleClick, setMenuOpen, isControlled]);
|
|
3967
|
-
const handleMenuClose =
|
|
4035
|
+
const handleMenuClose = useCallback3(() => {
|
|
3968
4036
|
if (onClose) {
|
|
3969
4037
|
onClose();
|
|
3970
4038
|
} else {
|
|
@@ -4003,32 +4071,32 @@ var BasicMenu = ({
|
|
|
4003
4071
|
};
|
|
4004
4072
|
|
|
4005
4073
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4006
|
-
import React34, { useEffect as
|
|
4074
|
+
import React34, { useEffect as useEffect12, useMemo as useMemo5 } from "react";
|
|
4007
4075
|
import { Button as Button13, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem5, Popover as Popover4, Stack as Stack12, TextField as TextField4 } from "@mui/material";
|
|
4008
4076
|
import { SearchOutlined } from "@mui/icons-material";
|
|
4009
4077
|
|
|
4010
4078
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
4011
|
-
import { useCallback as
|
|
4079
|
+
import { useCallback as useCallback4, useState as useState16 } from "react";
|
|
4012
4080
|
function useMultiSelectHandlers() {
|
|
4013
4081
|
const [anchorEl, setAnchorEl] = useState16(null);
|
|
4014
4082
|
const [open, setOpen] = useState16(false);
|
|
4015
4083
|
const [selectedItems, setSelectedItems] = useState16([]);
|
|
4016
4084
|
const [filterValue, setFilterValue] = useState16("");
|
|
4017
|
-
const handleOpen =
|
|
4085
|
+
const handleOpen = useCallback4((e) => {
|
|
4018
4086
|
setAnchorEl(e.currentTarget);
|
|
4019
4087
|
setOpen(true);
|
|
4020
4088
|
}, []);
|
|
4021
|
-
const handleClose =
|
|
4089
|
+
const handleClose = useCallback4(() => {
|
|
4022
4090
|
setAnchorEl(null);
|
|
4023
4091
|
setOpen(false);
|
|
4024
4092
|
}, []);
|
|
4025
|
-
const handleFilterChange =
|
|
4093
|
+
const handleFilterChange = useCallback4(
|
|
4026
4094
|
(e) => {
|
|
4027
4095
|
setFilterValue(e.target.value);
|
|
4028
4096
|
},
|
|
4029
4097
|
[]
|
|
4030
4098
|
);
|
|
4031
|
-
const handleCheckboxToggle =
|
|
4099
|
+
const handleCheckboxToggle = useCallback4((item) => {
|
|
4032
4100
|
setSelectedItems(
|
|
4033
4101
|
(prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
|
|
4034
4102
|
);
|
|
@@ -4055,15 +4123,15 @@ function getIconMultiSelect(name) {
|
|
|
4055
4123
|
}
|
|
4056
4124
|
|
|
4057
4125
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
4058
|
-
import { useMemo as
|
|
4126
|
+
import { useMemo as useMemo4 } from "react";
|
|
4059
4127
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
4060
|
-
const filteredItems =
|
|
4128
|
+
const filteredItems = useMemo4(
|
|
4061
4129
|
() => items.filter(
|
|
4062
4130
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
4063
4131
|
),
|
|
4064
4132
|
[items, filterValue, getItemLabel]
|
|
4065
4133
|
);
|
|
4066
|
-
const sortedItems =
|
|
4134
|
+
const sortedItems = useMemo4(() => {
|
|
4067
4135
|
return [
|
|
4068
4136
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
4069
4137
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -4097,16 +4165,16 @@ function MultiSelect({
|
|
|
4097
4165
|
handleCheckboxToggle,
|
|
4098
4166
|
setOpen
|
|
4099
4167
|
} = useMultiSelectHandlers();
|
|
4100
|
-
|
|
4168
|
+
useEffect12(() => {
|
|
4101
4169
|
if (open !== void 0) {
|
|
4102
4170
|
setOpen(open);
|
|
4103
4171
|
}
|
|
4104
4172
|
}, [open, setOpen]);
|
|
4105
|
-
|
|
4173
|
+
useEffect12(() => {
|
|
4106
4174
|
setSelectedItems([]);
|
|
4107
4175
|
}, [items, setSelectedItems]);
|
|
4108
4176
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
4109
|
-
const Icon =
|
|
4177
|
+
const Icon = useMemo5(() => {
|
|
4110
4178
|
var _a2;
|
|
4111
4179
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
4112
4180
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -4212,7 +4280,7 @@ var PageHeader = ({
|
|
|
4212
4280
|
zIndex: 10,
|
|
4213
4281
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
4214
4282
|
},
|
|
4215
|
-
/* @__PURE__ */ React35.createElement(Stack13, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React35.createElement(Stack13, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ React35.createElement(Stack13, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ React35.createElement(Typography18, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ React35.createElement(Typography18, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.
|
|
4283
|
+
/* @__PURE__ */ React35.createElement(Stack13, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React35.createElement(Stack13, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ React35.createElement(Stack13, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ React35.createElement(Typography18, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ React35.createElement(Typography18, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.secondary" }, subtitle))), actions && /* @__PURE__ */ React35.createElement(Stack13, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
4216
4284
|
);
|
|
4217
4285
|
};
|
|
4218
4286
|
|
|
@@ -4228,27 +4296,27 @@ import { format, startOfWeek, addDays, isSameDay } from "date-fns";
|
|
|
4228
4296
|
|
|
4229
4297
|
// src/Components/SCListContent.tsx
|
|
4230
4298
|
import React36 from "react";
|
|
4231
|
-
import { Divider as Divider6, List, ListItemButton, ListItemIcon as ListItemIcon4, ListItemText as ListItemText3, SvgIcon as
|
|
4299
|
+
import { Divider as Divider6, List, ListItemButton, ListItemIcon as ListItemIcon4, ListItemText as ListItemText3, SvgIcon as SvgIcon7 } from "@mui/material";
|
|
4232
4300
|
import Grid7 from "@mui/material/Grid";
|
|
4233
4301
|
import Avatar from "@mui/material/Avatar";
|
|
4234
|
-
import * as
|
|
4302
|
+
import * as Muicon7 from "@mui/icons-material";
|
|
4235
4303
|
var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" }) => {
|
|
4236
4304
|
const [selectedIndex, setSelectedIndex] = React36.useState("1");
|
|
4237
4305
|
const [value, setValue] = React36.useState("1");
|
|
4238
4306
|
options.map(function(option, index, array) {
|
|
4239
4307
|
if (option == null ? void 0 : option.iconLeft) {
|
|
4240
4308
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
4241
|
-
const found =
|
|
4309
|
+
const found = Muicon7[option == null ? void 0 : option.iconLeft];
|
|
4242
4310
|
if (found != void 0) {
|
|
4243
|
-
option.iconLeft =
|
|
4311
|
+
option.iconLeft = Muicon7[option == null ? void 0 : option.iconLeft];
|
|
4244
4312
|
}
|
|
4245
4313
|
}
|
|
4246
4314
|
}
|
|
4247
4315
|
if (option == null ? void 0 : option.iconRight) {
|
|
4248
4316
|
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
4249
|
-
const found =
|
|
4317
|
+
const found = Muicon7[option == null ? void 0 : option.iconRight];
|
|
4250
4318
|
if (found != void 0) {
|
|
4251
|
-
option.iconRight =
|
|
4319
|
+
option.iconRight = Muicon7[option == null ? void 0 : option.iconRight];
|
|
4252
4320
|
}
|
|
4253
4321
|
}
|
|
4254
4322
|
}
|
|
@@ -4262,7 +4330,7 @@ var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" })
|
|
|
4262
4330
|
onClick: option.fn,
|
|
4263
4331
|
sx: { gap: 1, padding: iconLeftType == "Icon" ? "8px 8px" : "8px 8px 8px 0px" }
|
|
4264
4332
|
},
|
|
4265
|
-
option.iconLeft ? iconLeftType == "Icon" ? /* @__PURE__ */ React36.createElement(ListItemIcon4, { sx: { minWidth: "0px !important" } }, /* @__PURE__ */ React36.createElement(
|
|
4333
|
+
option.iconLeft ? iconLeftType == "Icon" ? /* @__PURE__ */ React36.createElement(ListItemIcon4, { sx: { minWidth: "0px !important" } }, /* @__PURE__ */ React36.createElement(SvgIcon7, { fontSize: "small", sx: { color: option.iconLeftColor || "action" }, component: option.iconLeft })) : /* @__PURE__ */ React36.createElement(Avatar, { sx: { width: 25, height: 25, fontSize: "11px", bgcolor: option.iconLeftColor ? `${option.iconLeftColor}.main` : "default" } }, ((_a = option.iconLeft) == null ? void 0 : _a.type) != void 0 ? /* @__PURE__ */ React36.createElement(SvgIcon7, { fontSize: "small", component: option.iconLeft }) : option.iconLeft) : "",
|
|
4266
4334
|
/* @__PURE__ */ React36.createElement(
|
|
4267
4335
|
ListItemText3,
|
|
4268
4336
|
{
|
|
@@ -4271,7 +4339,7 @@ var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" })
|
|
|
4271
4339
|
secondary: /* @__PURE__ */ React36.createElement(Grid7, { gap: 0.5 }, /* @__PURE__ */ React36.createElement(Grid7, { container: true, gap: 0.5, sx: { color: option.colorDisabled == true ? "text.disabled" : "default" } }, option.subtitle), /* @__PURE__ */ React36.createElement(Grid7, { container: true, gap: 0.5, sx: { color: option.colorDisabled == true ? "text.disabled" : "default" } }, option.description))
|
|
4272
4340
|
}
|
|
4273
4341
|
),
|
|
4274
|
-
option.iconRight ? iconRightType == "Icon" ? /* @__PURE__ */ React36.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", marginRight: "8px" } }, /* @__PURE__ */ React36.createElement(
|
|
4342
|
+
option.iconRight ? iconRightType == "Icon" ? /* @__PURE__ */ React36.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", marginRight: "8px" } }, /* @__PURE__ */ React36.createElement(SvgIcon7, { fontSize: "small", sx: { color: option.iconRightColor || "action" }, component: option.iconRight })) : /* @__PURE__ */ React36.createElement(Avatar, { variant: "circular", sx: { width: 20, height: 20 } }, ((_b = option.iconRight) == null ? void 0 : _b.type) != void 0 ? /* @__PURE__ */ React36.createElement(SvgIcon7, { fontSize: "small", color: option.iconRightColor || "action", component: option.iconRight }) : option.iconRight) : ""
|
|
4275
4343
|
), option.divider == true ? /* @__PURE__ */ React36.createElement(Divider6, null) : "");
|
|
4276
4344
|
})));
|
|
4277
4345
|
};
|
|
@@ -4304,8 +4372,6 @@ var SCActivityCalendar = ({
|
|
|
4304
4372
|
const [openCalendar, setOpenCalendar] = React37.useState(false);
|
|
4305
4373
|
const [anchorPopoverFiltro, setAnchorPopoverFiltro] = useState18(null);
|
|
4306
4374
|
const [datosEventos, setDatosEventos] = React37.useState(events);
|
|
4307
|
-
console.log("eventos", events);
|
|
4308
|
-
console.log("datosEventos", datosEventos);
|
|
4309
4375
|
const openPopoverFiltro = Boolean(anchorPopoverFiltro);
|
|
4310
4376
|
const hoy = /* @__PURE__ */ new Date();
|
|
4311
4377
|
const inicioSemana = startOfWeek(fecha, { weekStartsOn: 0 });
|
|
@@ -4440,12 +4506,9 @@ var SCActivityCalendar = ({
|
|
|
4440
4506
|
flexDirection: "column"
|
|
4441
4507
|
} }, (() => {
|
|
4442
4508
|
const esDomingo = day.getDay() === 0;
|
|
4443
|
-
console.log("D\xEDa:", day);
|
|
4444
|
-
console.log("Filtrando eventos para el d\xEDa:", datosEventos);
|
|
4445
4509
|
const eventosDelDia = datosEventos.filter(
|
|
4446
4510
|
(event2) => (/* @__PURE__ */ new Date(event2.date + "T00:00:00")).toDateString() === day.toDateString()
|
|
4447
4511
|
);
|
|
4448
|
-
console.log("Cantidad eventos para el d\xEDa:", eventosDelDia);
|
|
4449
4512
|
if (eventosDelDia.length > 0) {
|
|
4450
4513
|
return eventosDelDia.map((event2, idx) => /* @__PURE__ */ React37.createElement(
|
|
4451
4514
|
SCListContent,
|
|
@@ -4516,7 +4579,7 @@ var SCAlert = ({
|
|
|
4516
4579
|
};
|
|
4517
4580
|
|
|
4518
4581
|
// src/Components/SCAppBar.tsx
|
|
4519
|
-
import React39, { useState as useState19, useEffect as
|
|
4582
|
+
import React39, { useState as useState19, useEffect as useEffect15 } from "react";
|
|
4520
4583
|
import { Menu as Menu4, Box as Box23, Typography as Typography22, MenuItem as MenuItem8, IconButton as IconButton14, Badge as Badge2 } from "@mui/material";
|
|
4521
4584
|
import Grid9 from "@mui/material/Grid";
|
|
4522
4585
|
import "dayjs/locale/es";
|
|
@@ -4541,13 +4604,11 @@ var SCAppBar = ({
|
|
|
4541
4604
|
const handleMenuClose = () => {
|
|
4542
4605
|
setAnchorEl(null);
|
|
4543
4606
|
};
|
|
4544
|
-
|
|
4607
|
+
useEffect15(() => {
|
|
4545
4608
|
const handleOnline = () => {
|
|
4546
|
-
console.log("tiene internet");
|
|
4547
4609
|
setIsOnline(true);
|
|
4548
4610
|
};
|
|
4549
4611
|
const handleOffline = () => {
|
|
4550
|
-
console.log(" no tiene internet");
|
|
4551
4612
|
setIsOnline(false);
|
|
4552
4613
|
};
|
|
4553
4614
|
window.addEventListener("online", handleOnline);
|
|
@@ -4690,7 +4751,7 @@ var SCCalendarSwipeable = ({
|
|
|
4690
4751
|
|
|
4691
4752
|
// src/Components/SCCard.tsx
|
|
4692
4753
|
import React41 from "react";
|
|
4693
|
-
import { Button as Button18, Box as Box25, SvgIcon as
|
|
4754
|
+
import { Button as Button18, Box as Box25, SvgIcon as SvgIcon9 } from "@mui/material";
|
|
4694
4755
|
import IconButton16 from "@mui/material/IconButton";
|
|
4695
4756
|
import Card2 from "@mui/material/Card";
|
|
4696
4757
|
import CardHeader from "@mui/material/CardHeader";
|
|
@@ -4699,13 +4760,13 @@ import CardContent2 from "@mui/material/CardContent";
|
|
|
4699
4760
|
import CardActions from "@mui/material/CardActions";
|
|
4700
4761
|
import Collapse2 from "@mui/material/Collapse";
|
|
4701
4762
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4702
|
-
import * as
|
|
4763
|
+
import * as Muicon8 from "@mui/icons-material";
|
|
4703
4764
|
var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, content, actions, expand }) => {
|
|
4704
4765
|
let iconTitleValidation = "";
|
|
4705
4766
|
let IconTitle;
|
|
4706
4767
|
const [expanded, setExpanded] = React41.useState(false);
|
|
4707
4768
|
if (iconTitle) {
|
|
4708
|
-
if (
|
|
4769
|
+
if (Muicon8[iconTitle] == void 0) {
|
|
4709
4770
|
if (iconTitle && React41.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
4710
4771
|
iconTitleValidation = "image";
|
|
4711
4772
|
IconTitle = iconTitle;
|
|
@@ -4715,7 +4776,7 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, content,
|
|
|
4715
4776
|
}
|
|
4716
4777
|
} else {
|
|
4717
4778
|
iconTitleValidation = "icon";
|
|
4718
|
-
IconTitle =
|
|
4779
|
+
IconTitle = Muicon8[iconTitle];
|
|
4719
4780
|
}
|
|
4720
4781
|
}
|
|
4721
4782
|
const handleExpandClick = () => {
|
|
@@ -4724,7 +4785,7 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, content,
|
|
|
4724
4785
|
return /* @__PURE__ */ React41.createElement(Card2, { sx: { width: width || "auto" } }, title && /* @__PURE__ */ React41.createElement(
|
|
4725
4786
|
CardHeader,
|
|
4726
4787
|
{
|
|
4727
|
-
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ React41.createElement(Box25, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React41.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React41.createElement(
|
|
4788
|
+
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ React41.createElement(Box25, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React41.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React41.createElement(SvgIcon9, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
4728
4789
|
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ React41.createElement(Button18, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ React41.createElement(IconButton16, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ React41.createElement(ExpandMoreIcon, { fontSize: "small" })) : actionsTitle,
|
|
4729
4790
|
title,
|
|
4730
4791
|
subheader: subtitle,
|
|
@@ -4766,13 +4827,13 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, content,
|
|
|
4766
4827
|
};
|
|
4767
4828
|
|
|
4768
4829
|
// src/Components/SCDataGrid.tsx
|
|
4769
|
-
import React42, { useEffect as
|
|
4830
|
+
import React42, { useEffect as useEffect18, useState as useState22 } from "react";
|
|
4770
4831
|
import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
|
|
4771
4832
|
import { LicenseInfo as LicenseInfo2 } from "@mui/x-license";
|
|
4772
4833
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
4773
4834
|
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
4774
4835
|
import { useTheme } from "@mui/material/styles";
|
|
4775
|
-
function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPage, rowsTable, rowSelection, checkboxSelection, width, maxHeight, density, disableColumnMenu, disableColumnSorting, setSelectedIndex, selectedIndex = 0, setSelectedRow, selectedRow }) {
|
|
4836
|
+
function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPage, rowsTable, rowSelection, checkboxSelection, width, maxHeight, density, disableColumnMenu, disableHeader, disableColumnSorting, setSelectedIndex, selectedIndex = 0, setSelectedRow, selectedRow }) {
|
|
4776
4837
|
LicenseInfo2.setLicenseKey(
|
|
4777
4838
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
4778
4839
|
);
|
|
@@ -4869,6 +4930,7 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
4869
4930
|
color: "#10184099",
|
|
4870
4931
|
display: "flex",
|
|
4871
4932
|
alignItems: "center",
|
|
4933
|
+
borderTop: params.rowNode.type === "group" && params.rowNode.depth === 0 ? "2px solid #2063A0" : "1px solid #E0E0E0",
|
|
4872
4934
|
paddingLeft: params.rowNode.depth == 0 ? "5px" : params.rowNode.depth == 1 ? "15px" : "25px",
|
|
4873
4935
|
backgroundColor: params.rowNode.type === "group" ? theme.palette.grey[100 + (maxDepth - params.rowNode.depth) * 100] : "#FFFFFF",
|
|
4874
4936
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
@@ -4933,14 +4995,14 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
4933
4995
|
const [pageSize, setPageSize] = useState22(rows);
|
|
4934
4996
|
const [arrayRows, setArrayRows] = useState22([]);
|
|
4935
4997
|
const [selectionModel, setSelectionModel] = useState22([]);
|
|
4936
|
-
|
|
4998
|
+
useEffect18(() => {
|
|
4937
4999
|
var _a;
|
|
4938
5000
|
if (setSelectedRow) {
|
|
4939
5001
|
setSelectedRow(arrayRows[selectedIndex]);
|
|
4940
5002
|
setSelectionModel(((_a = arrayRows[selectedIndex]) == null ? void 0 : _a.id) ? [arrayRows[selectedIndex].id] : []);
|
|
4941
5003
|
}
|
|
4942
5004
|
}, [selectedIndex]);
|
|
4943
|
-
|
|
5005
|
+
useEffect18(() => {
|
|
4944
5006
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
4945
5007
|
dataConvertRows(data, void 0);
|
|
4946
5008
|
}
|
|
@@ -5023,14 +5085,13 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5023
5085
|
columnVisibilityModel[col.field] = false;
|
|
5024
5086
|
}
|
|
5025
5087
|
});
|
|
5026
|
-
console.log("columnVisibilityModel:", columnVisibilityModel);
|
|
5027
5088
|
const initialState = {
|
|
5028
5089
|
pagination: { paginationModel: { pageSize: rows } }
|
|
5029
5090
|
};
|
|
5030
5091
|
if (Object.keys(columnVisibilityModel).length > 0) {
|
|
5031
5092
|
initialState.columns = { columnVisibilityModel };
|
|
5032
5093
|
}
|
|
5033
|
-
|
|
5094
|
+
useEffect18(() => {
|
|
5034
5095
|
if (apiRef.current && Object.keys(columnVisibilityModel).length > 0) {
|
|
5035
5096
|
apiRef.current.setColumnVisibilityModel(columnVisibilityModel);
|
|
5036
5097
|
}
|
|
@@ -5075,6 +5136,9 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5075
5136
|
},
|
|
5076
5137
|
sx: {
|
|
5077
5138
|
maxHeight: maxHeight ? `${maxHeight}px` : "none",
|
|
5139
|
+
"& .MuiDataGrid-columnHeaders": {
|
|
5140
|
+
display: disableHeader == true ? "none" : "block"
|
|
5141
|
+
},
|
|
5078
5142
|
"& .MuiDataGrid-filler": {
|
|
5079
5143
|
display: "none !important"
|
|
5080
5144
|
},
|
|
@@ -5264,20 +5328,20 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
|
|
|
5264
5328
|
};
|
|
5265
5329
|
|
|
5266
5330
|
// src/Components/SCDialog.tsx
|
|
5267
|
-
import React44, { useEffect as
|
|
5268
|
-
import { Button as Button19, Typography as Typography25, Modal as Modal5, Dialog as Dialog4, DialogActions as DialogActions4, DialogContent as DialogContent4, DialogTitle as DialogTitle4, IconButton as IconButton17, Tooltip as Tooltip8, Box as Box26, SvgIcon as
|
|
5331
|
+
import React44, { useEffect as useEffect19, useState as useState24 } from "react";
|
|
5332
|
+
import { Button as Button19, Typography as Typography25, Modal as Modal5, Dialog as Dialog4, DialogActions as DialogActions4, DialogContent as DialogContent4, DialogTitle as DialogTitle4, IconButton as IconButton17, Tooltip as Tooltip8, Box as Box26, SvgIcon as SvgIcon10 } from "@mui/material";
|
|
5269
5333
|
import Grid11 from "@mui/material/Grid";
|
|
5270
5334
|
import ToggleButton from "@mui/material/ToggleButton";
|
|
5271
5335
|
import ToggleButtonGroup from "@mui/material/ToggleButtonGroup";
|
|
5272
5336
|
import CloseIcon2 from "@mui/icons-material/Close";
|
|
5273
|
-
import * as
|
|
5337
|
+
import * as Muicon9 from "@mui/icons-material";
|
|
5274
5338
|
var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView = "web", setShow, show }) => {
|
|
5275
5339
|
let i = 0;
|
|
5276
5340
|
let iconTitleValidation = "";
|
|
5277
5341
|
let IconTitle;
|
|
5278
5342
|
let ButtonIcon;
|
|
5279
5343
|
const [open, setOpen] = useState24(show);
|
|
5280
|
-
|
|
5344
|
+
useEffect19(() => {
|
|
5281
5345
|
if (show) {
|
|
5282
5346
|
handleOpen();
|
|
5283
5347
|
} else {
|
|
@@ -5285,17 +5349,17 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5285
5349
|
}
|
|
5286
5350
|
}, [show]);
|
|
5287
5351
|
if ((buttonDialog == null ? void 0 : buttonDialog.icon) != void 0) {
|
|
5288
|
-
if (
|
|
5352
|
+
if (Muicon9[buttonDialog == null ? void 0 : buttonDialog.icon] == void 0) {
|
|
5289
5353
|
ButtonIcon = buttonDialog == null ? void 0 : buttonDialog.icon;
|
|
5290
5354
|
} else {
|
|
5291
|
-
ButtonIcon =
|
|
5355
|
+
ButtonIcon = Muicon9[buttonDialog == null ? void 0 : buttonDialog.icon];
|
|
5292
5356
|
}
|
|
5293
5357
|
}
|
|
5294
5358
|
if (Array.isArray(actions)) {
|
|
5295
5359
|
actions.map(function(option, index, array) {
|
|
5296
5360
|
if (option == null ? void 0 : option.icon) {
|
|
5297
5361
|
if ((option == null ? void 0 : option.icon.type) == void 0) {
|
|
5298
|
-
option.icon =
|
|
5362
|
+
option.icon = Muicon9[option == null ? void 0 : option.icon];
|
|
5299
5363
|
} else {
|
|
5300
5364
|
option;
|
|
5301
5365
|
}
|
|
@@ -5303,17 +5367,17 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5303
5367
|
});
|
|
5304
5368
|
}
|
|
5305
5369
|
if (iconTitle) {
|
|
5306
|
-
if (
|
|
5307
|
-
if (
|
|
5370
|
+
if (Muicon9[iconTitle] == void 0) {
|
|
5371
|
+
if (Muicon9[iconTitle]) {
|
|
5308
5372
|
iconTitleValidation = "icon";
|
|
5309
|
-
IconTitle =
|
|
5373
|
+
IconTitle = Muicon9[iconTitle];
|
|
5310
5374
|
} else {
|
|
5311
5375
|
iconTitleValidation = "image";
|
|
5312
5376
|
IconTitle = iconTitle;
|
|
5313
5377
|
}
|
|
5314
5378
|
} else {
|
|
5315
5379
|
iconTitleValidation = "icon";
|
|
5316
|
-
IconTitle =
|
|
5380
|
+
IconTitle = Muicon9[iconTitle];
|
|
5317
5381
|
}
|
|
5318
5382
|
}
|
|
5319
5383
|
const handleOpen = () => {
|
|
@@ -5330,7 +5394,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5330
5394
|
};
|
|
5331
5395
|
const dialogActions = actions == false ? false : actions != void 0 ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
5332
5396
|
content = content != null ? content : { component: /* @__PURE__ */ React44.createElement(Box26, null, " Aqui va el contenido ") };
|
|
5333
|
-
return /* @__PURE__ */ React44.createElement("div", null, buttonDialog ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React44.createElement(Tooltip8, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React44.createElement(Button19, { 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__ */ React44.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React44.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React44.createElement(IconButton17, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React44.createElement(
|
|
5397
|
+
return /* @__PURE__ */ React44.createElement("div", null, buttonDialog ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React44.createElement(Tooltip8, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React44.createElement(Button19, { 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__ */ React44.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React44.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React44.createElement(IconButton17, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React44.createElement(SvgIcon10, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React44.createElement(Modal5, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React44.createElement(
|
|
5334
5398
|
Dialog4,
|
|
5335
5399
|
{
|
|
5336
5400
|
fullScreen: typeView === "mobile" ? true : false,
|
|
@@ -5345,7 +5409,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5345
5409
|
}
|
|
5346
5410
|
}
|
|
5347
5411
|
},
|
|
5348
|
-
title && /* @__PURE__ */ React44.createElement(DialogTitle4, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React44.createElement(Grid11, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, typeView == "web" ? /* @__PURE__ */ React44.createElement(Grid11, { container: true, size: 11, sx: { alignItems: "center", flexWrap: "nowrap" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React44.createElement(Box26, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React44.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React44.createElement(
|
|
5412
|
+
title && /* @__PURE__ */ React44.createElement(DialogTitle4, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React44.createElement(Grid11, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, typeView == "web" ? /* @__PURE__ */ React44.createElement(Grid11, { container: true, size: 11, sx: { alignItems: "center", flexWrap: "nowrap" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React44.createElement(Box26, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React44.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React44.createElement(SvgIcon10, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React44.createElement(Grid11, { sx: { width: "98%" } }, /* @__PURE__ */ React44.createElement(Typography25, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), subtitle ? subtitle : "")) : /* @__PURE__ */ React44.createElement(Grid11, { container: true, size: 11, sx: { alignItems: "center", flexWrap: "nowrap" } }), disableClose != true ? /* @__PURE__ */ React44.createElement(IconButton17, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React44.createElement(CloseIcon2, { color: "action" })) : ""), typeView == "mobile" ? /* @__PURE__ */ React44.createElement(Grid11, { sx: { display: "flex", flexDirection: "column", padding: "12px 0px 4px 0px" }, gap: 1.5 }, /* @__PURE__ */ React44.createElement(Typography25, { color: "text.primary", variant: "h5" }, title ? title : ""), subtitle ? subtitle : "") : ""),
|
|
5349
5413
|
/* @__PURE__ */ React44.createElement(
|
|
5350
5414
|
DialogContent4,
|
|
5351
5415
|
{
|
|
@@ -5393,7 +5457,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5393
5457
|
size: "small",
|
|
5394
5458
|
onClick: dialogActions[0].fn,
|
|
5395
5459
|
disabled: dialogActions[0].disabled || false,
|
|
5396
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */ React44.createElement(
|
|
5460
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ React44.createElement(SvgIcon10, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
5397
5461
|
},
|
|
5398
5462
|
dialogActions[0].text
|
|
5399
5463
|
), /* @__PURE__ */ React44.createElement(Box26, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
@@ -5406,7 +5470,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5406
5470
|
size: "small",
|
|
5407
5471
|
onClick: boton.fn,
|
|
5408
5472
|
disabled: boton.disabled || false,
|
|
5409
|
-
startIcon: boton.icon ? /* @__PURE__ */ React44.createElement(
|
|
5473
|
+
startIcon: boton.icon ? /* @__PURE__ */ React44.createElement(SvgIcon10, { fontSize: "small", component: boton.icon }) : void 0
|
|
5410
5474
|
},
|
|
5411
5475
|
boton.text
|
|
5412
5476
|
);
|
|
@@ -5420,24 +5484,24 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5420
5484
|
size: "small",
|
|
5421
5485
|
onClick: boton.fn,
|
|
5422
5486
|
disabled: boton.disabled || false,
|
|
5423
|
-
startIcon: boton.icon ? /* @__PURE__ */ React44.createElement(
|
|
5487
|
+
startIcon: boton.icon ? /* @__PURE__ */ React44.createElement(SvgIcon10, { fontSize: "small", component: boton.icon }) : void 0
|
|
5424
5488
|
},
|
|
5425
5489
|
boton.text
|
|
5426
5490
|
);
|
|
5427
5491
|
})) : /* @__PURE__ */ React44.createElement(Box26, { sx: { width: "100%", display: "flex", flexDirection: "row", justifyContent: "center" } }, /* @__PURE__ */ React44.createElement(ToggleButtonGroup, { size: "large", fullWidth: true }, dialogActions.map((boton, index) => {
|
|
5428
5492
|
var _a;
|
|
5429
|
-
return /* @__PURE__ */ React44.createElement(ToggleButton, { sx: { color: "primary.main" }, disabled: boton.disabled || false, fullWidth: boton.text ? true : false, size: "medium", value: "text", onClick: boton.fn }, (_a = boton.text) != null ? _a : /* @__PURE__ */ React44.createElement(
|
|
5493
|
+
return /* @__PURE__ */ React44.createElement(ToggleButton, { sx: { color: "primary.main" }, disabled: boton.disabled || false, fullWidth: boton.text ? true : false, size: "medium", value: "text", onClick: boton.fn }, (_a = boton.text) != null ? _a : /* @__PURE__ */ React44.createElement(SvgIcon10, { fontSize: "small", component: boton.icon }));
|
|
5430
5494
|
})))) : "" : ""
|
|
5431
5495
|
)));
|
|
5432
5496
|
};
|
|
5433
5497
|
|
|
5434
5498
|
// src/Components/SCMenu.tsx
|
|
5435
5499
|
import React45 from "react";
|
|
5436
|
-
import { Box as Box27, Typography as Typography26, Paper as Paper4, Divider as Divider8, MenuList as MenuList3, MenuItem as MenuItem9, ListItemIcon as ListItemIcon7, SvgIcon as
|
|
5500
|
+
import { Box as Box27, Typography as Typography26, Paper as Paper4, Divider as Divider8, MenuList as MenuList3, MenuItem as MenuItem9, ListItemIcon as ListItemIcon7, SvgIcon as SvgIcon11 } from "@mui/material";
|
|
5437
5501
|
import Grid12 from "@mui/material/Grid";
|
|
5438
5502
|
|
|
5439
5503
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
5440
|
-
import { useState as useState25, useEffect as
|
|
5504
|
+
import { useState as useState25, useEffect as useEffect20 } from "react";
|
|
5441
5505
|
function getWindowDimensions() {
|
|
5442
5506
|
const { innerWidth: width, innerHeight: height } = window;
|
|
5443
5507
|
return {
|
|
@@ -5447,7 +5511,7 @@ function getWindowDimensions() {
|
|
|
5447
5511
|
}
|
|
5448
5512
|
function useWindowDimensions() {
|
|
5449
5513
|
const [windowDimensions, setWindowDimensions] = useState25(getWindowDimensions());
|
|
5450
|
-
|
|
5514
|
+
useEffect20(() => {
|
|
5451
5515
|
function handleResize() {
|
|
5452
5516
|
setWindowDimensions(getWindowDimensions());
|
|
5453
5517
|
}
|
|
@@ -5458,7 +5522,7 @@ function useWindowDimensions() {
|
|
|
5458
5522
|
}
|
|
5459
5523
|
|
|
5460
5524
|
// src/Components/SCMenu.tsx
|
|
5461
|
-
import * as
|
|
5525
|
+
import * as Muicon10 from "@mui/icons-material";
|
|
5462
5526
|
var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }) => {
|
|
5463
5527
|
const { height, width } = useWindowDimensions();
|
|
5464
5528
|
const menuSize = widthMenu ? parseInt(widthMenu) : 284;
|
|
@@ -5478,14 +5542,14 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
5478
5542
|
options.map(function(option, index, array) {
|
|
5479
5543
|
if (option == null ? void 0 : option.iconLeft) {
|
|
5480
5544
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
5481
|
-
option.iconLeft =
|
|
5545
|
+
option.iconLeft = Muicon10[option == null ? void 0 : option.iconLeft];
|
|
5482
5546
|
} else {
|
|
5483
5547
|
option;
|
|
5484
5548
|
}
|
|
5485
5549
|
}
|
|
5486
5550
|
if (option == null ? void 0 : option.iconRight) {
|
|
5487
5551
|
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
5488
|
-
option.iconRight =
|
|
5552
|
+
option.iconRight = Muicon10[option == null ? void 0 : option.iconRight];
|
|
5489
5553
|
} else {
|
|
5490
5554
|
option;
|
|
5491
5555
|
}
|
|
@@ -5508,8 +5572,8 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
5508
5572
|
selected: String(index + 1) === selectedIndex,
|
|
5509
5573
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
5510
5574
|
},
|
|
5511
|
-
option.iconLeft ? /* @__PURE__ */ React45.createElement(ListItemIcon7, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React45.createElement(
|
|
5512
|
-
/* @__PURE__ */ React45.createElement(Grid12, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React45.createElement(Typography26, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React45.createElement(ListItemIcon7, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React45.createElement(
|
|
5575
|
+
option.iconLeft ? /* @__PURE__ */ React45.createElement(ListItemIcon7, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React45.createElement(SvgIcon11, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
5576
|
+
/* @__PURE__ */ React45.createElement(Grid12, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React45.createElement(Typography26, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React45.createElement(ListItemIcon7, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React45.createElement(SvgIcon11, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
5513
5577
|
), option.divider == true ? /* @__PURE__ */ React45.createElement(Divider8, null) : "")))), /* @__PURE__ */ React45.createElement(Grid12, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React45.createElement(Box27, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React45.createElement(Typography26, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
5514
5578
|
};
|
|
5515
5579
|
|
|
@@ -5556,11 +5620,11 @@ var SCSnackBar = ({
|
|
|
5556
5620
|
};
|
|
5557
5621
|
|
|
5558
5622
|
// src/Components/SCTabs.tsx
|
|
5559
|
-
import React47, { useEffect as
|
|
5560
|
-
import { Typography as Typography27, Box as Box28, SvgIcon as
|
|
5623
|
+
import React47, { useEffect as useEffect21 } from "react";
|
|
5624
|
+
import { Typography as Typography27, Box as Box28, SvgIcon as SvgIcon12, Tab as Tab3, Tabs as Tabs3, Badge as Badge3 } from "@mui/material";
|
|
5561
5625
|
import TabPanel from "@mui/lab/TabPanel";
|
|
5562
5626
|
import TabContext from "@mui/lab/TabContext";
|
|
5563
|
-
import * as
|
|
5627
|
+
import * as Muicon11 from "@mui/icons-material";
|
|
5564
5628
|
var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
|
|
5565
5629
|
const [toast, setToast] = React47.useState(null);
|
|
5566
5630
|
let i = 0;
|
|
@@ -5569,7 +5633,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
5569
5633
|
let l = 0;
|
|
5570
5634
|
let validateTypeIcon = true;
|
|
5571
5635
|
const [value, setValue] = React47.useState("1");
|
|
5572
|
-
|
|
5636
|
+
useEffect21(() => {
|
|
5573
5637
|
if (defaultOption) {
|
|
5574
5638
|
handleChange(event, void 0);
|
|
5575
5639
|
}
|
|
@@ -5578,9 +5642,9 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
5578
5642
|
const optionsLength = options.length;
|
|
5579
5643
|
if (option == null ? void 0 : option.iconOrBadge) {
|
|
5580
5644
|
if (typeIcon == "icon") {
|
|
5581
|
-
if ((option == null ? void 0 : option.iconOrBadge) in
|
|
5645
|
+
if ((option == null ? void 0 : option.iconOrBadge) in Muicon11 == true) {
|
|
5582
5646
|
validateTypeIcon = true;
|
|
5583
|
-
option.iconOrBadge =
|
|
5647
|
+
option.iconOrBadge = Muicon11[option == null ? void 0 : option.iconOrBadge];
|
|
5584
5648
|
} else {
|
|
5585
5649
|
validateTypeIcon = false;
|
|
5586
5650
|
setTimeout(() => {
|
|
@@ -5594,7 +5658,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
5594
5658
|
return;
|
|
5595
5659
|
}
|
|
5596
5660
|
} else if (typeIcon == "badge") {
|
|
5597
|
-
if ((option == null ? void 0 : option.iconOrBadge) in
|
|
5661
|
+
if ((option == null ? void 0 : option.iconOrBadge) in Muicon11 == false) {
|
|
5598
5662
|
validateTypeIcon = true;
|
|
5599
5663
|
option;
|
|
5600
5664
|
} else {
|
|
@@ -5657,7 +5721,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
5657
5721
|
badgeContent: option.iconOrBadge,
|
|
5658
5722
|
color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
|
|
5659
5723
|
}
|
|
5660
|
-
) : typeIcon == "icon" ? /* @__PURE__ */ React47.createElement(
|
|
5724
|
+
) : typeIcon == "icon" ? /* @__PURE__ */ React47.createElement(SvgIcon12, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
|
|
5661
5725
|
sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
|
|
5662
5726
|
}
|
|
5663
5727
|
))
|
|
@@ -5734,7 +5798,7 @@ var SCTime = ({
|
|
|
5734
5798
|
setIsOpenPopover(false);
|
|
5735
5799
|
setAnchorEl(null);
|
|
5736
5800
|
};
|
|
5737
|
-
return /* @__PURE__ */ React48.createElement(LocalizationProvider5, { dateAdapter: AdapterDayjs3 }, /* @__PURE__ */ React48.createElement(Box29, { sx: { position: "relative", width: width ? `${width}%` : "99%" } }, /* @__PURE__ */ React48.createElement(
|
|
5801
|
+
return /* @__PURE__ */ React48.createElement(LocalizationProvider5, { dateAdapter: AdapterDayjs3 }, /* @__PURE__ */ React48.createElement(Box29, { sx: { position: "relative", minWidth: "120px", width: width ? `${width}%` : "99%" } }, /* @__PURE__ */ React48.createElement(
|
|
5738
5802
|
TimeField,
|
|
5739
5803
|
{
|
|
5740
5804
|
label,
|