componentes-sinco 1.0.2-rc.6 → 1.0.2-rc.8
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 +56 -95
- package/dist/index.d.cts +2 -6
- package/dist/index.d.mts +392 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +48 -87
- package/dist/index.mjs +3833 -0
- package/package.json +18 -17
- package/dist/componentes-sinco.css +0 -1
- package/dist/my-react-lib.es.js +0 -105856
- package/dist/my-react-lib.umd.js +0 -454
- package/dist/src/App.d.ts +0 -4
- package/dist/src/Components/Adjuntar/Adjuntar.d.ts +0 -4
- package/dist/src/Components/Adjuntar/Model.d.ts +0 -17
- package/dist/src/Components/Adjuntar/index.d.ts +0 -1
- package/dist/src/Components/Calendario/Calendario.d.ts +0 -3
- package/dist/src/Components/Drawer/Helpers/Model.d.ts +0 -55
- package/dist/src/Components/Drawer/Helpers/Utils.d.ts +0 -4
- package/dist/src/Components/Drawer/Helpers/index.d.ts +0 -3
- package/dist/src/Components/Drawer/Helpers/validateInput.d.ts +0 -3
- package/dist/src/Components/Drawer/SCDrawer.d.ts +0 -5
- package/dist/src/Components/Drawer/SCDrawer.test.d.ts +0 -1
- package/dist/src/Components/Drawer/index.d.ts +0 -1
- package/dist/src/Components/FooterAction/FooterAction.d.ts +0 -4
- package/dist/src/Components/FooterAction/Model.d.ts +0 -6
- package/dist/src/Components/FooterAction/index.d.ts +0 -2
- package/dist/src/Components/Hooks/useWindowDimensions.d.ts +0 -4
- package/dist/src/Components/Modal/Helpers/Data.d.ts +0 -19
- package/dist/src/Components/Modal/Helpers/Model.d.ts +0 -26
- package/dist/src/Components/Modal/Helpers/Utils.d.ts +0 -3
- package/dist/src/Components/Modal/Helpers/index.d.ts +0 -3
- package/dist/src/Components/Modal/SCModal.d.ts +0 -4
- package/dist/src/Components/Modal/SCModal.test.d.ts +0 -1
- package/dist/src/Components/Modal/index.d.ts +0 -2
- package/dist/src/Components/MultiSelect/MultiSelect.test.d.ts +0 -1
- package/dist/src/Components/MultiSelect/SCMultiSelect.d.ts +0 -4
- package/dist/src/Components/MultiSelect/example.d.ts +0 -3
- package/dist/src/Components/MultiSelect/helpers/Model.d.ts +0 -24
- package/dist/src/Components/MultiSelect/helpers/Utils.d.ts +0 -3
- package/dist/src/Components/MultiSelect/helpers/index.d.ts +0 -4
- package/dist/src/Components/MultiSelect/helpers/useFilteredItems.d.ts +0 -4
- package/dist/src/Components/MultiSelect/helpers/useHandlers.d.ts +0 -12
- package/dist/src/Components/MultiSelect/index.d.ts +0 -2
- package/dist/src/Components/PageHeader/Model.d.ts +0 -8
- package/dist/src/Components/PageHeader/PageHeader.d.ts +0 -4
- package/dist/src/Components/PageHeader/PageHeader.test.d.ts +0 -1
- package/dist/src/Components/PageHeader/index.d.ts +0 -2
- package/dist/src/Components/SCAutocomplete.d.ts +0 -26
- package/dist/src/Components/SCCalendarSwipeable.d.ts +0 -9
- package/dist/src/Components/SCDataGrid.d.ts +0 -19
- package/dist/src/Components/SCDialog.d.ts +0 -32
- package/dist/src/Components/SCMenu.d.ts +0 -20
- package/dist/src/Components/SCTabs.d.ts +0 -22
- package/dist/src/Components/TextArea/Helpers/Model.d.ts +0 -23
- package/dist/src/Components/TextArea/Helpers/index.d.ts +0 -2
- package/dist/src/Components/TextArea/Helpers/validateIcon.d.ts +0 -3
- package/dist/src/Components/TextArea/SCTextArea.d.ts +0 -4
- package/dist/src/Components/TextArea/index.d.ts +0 -2
- package/dist/src/Components/Textfield/Helpers/index.d.ts +0 -3
- package/dist/src/Components/Textfield/Helpers/validateIcon.d.ts +0 -4
- package/dist/src/Components/Textfield/Helpers/validateKeyDown.d.ts +0 -1
- package/dist/src/Components/Textfield/Helpers/validateOnBlur.d.ts +0 -10
- package/dist/src/Components/Textfield/Model.d.ts +0 -32
- package/dist/src/Components/Textfield/SCTextField.d.ts +0 -4
- package/dist/src/Components/Textfield/Textfield.test.d.ts +0 -1
- package/dist/src/Components/Textfield/index.d.ts +0 -2
- package/dist/src/Components/ToastNotification/Model.d.ts +0 -14
- package/dist/src/Components/ToastNotification/SCToastNotification.d.ts +0 -4
- package/dist/src/Components/ToastNotification/index.d.ts +0 -3
- package/dist/src/Components/ToastNotification/useProgress.d.ts +0 -6
- package/dist/src/Components/index.d.ts +0 -14
- package/dist/src/Pages/PruebasDavid/Test.d.ts +0 -3
- package/dist/src/Pages/PruebasNataly/PruebaPag1.d.ts +0 -4
- package/dist/src/Pages/PruebasNataly/PruebaPag2.d.ts +0 -3
- package/dist/src/Pages/PruebasNataly/TestNataly.d.ts +0 -3
- package/dist/src/Theme/breakpoints.d.ts +0 -3
- package/dist/src/Theme/components.d.ts +0 -3
- package/dist/src/Theme/index.d.ts +0 -3
- package/dist/src/Theme/mixins.d.ts +0 -3
- package/dist/src/Theme/module.d.ts +0 -69
- package/dist/src/Theme/palette.d.ts +0 -6
- package/dist/src/Theme/shadows.d.ts +0 -3
- package/dist/src/Theme/theme.d.ts +0 -5
- package/dist/src/Theme/typography.d.ts +0 -3
- package/dist/src/generales/capitalize.d.ts +0 -1
- package/dist/src/generales/index.d.ts +0 -2
- package/dist/src/generales/types.d.ts +0 -4
- package/dist/src/index.d.ts +0 -5
- package/dist/src/main.d.ts +0 -1
- package/dist/src/stories/Autocomplete/Autocomplete.stories.d.ts +0 -7
- package/dist/src/stories/CalendarSwipeable/CalendarSwipeable.stories.d.ts +0 -7
- package/dist/src/stories/DataGrid/DataGrid.stories.d.ts +0 -7
- package/dist/src/stories/Dialog/Dialog.stories.d.ts +0 -7
- package/dist/src/stories/Drawer/Drawer.stories.d.ts +0 -7
- package/dist/src/stories/FooterAction/Footer.stories.d.ts +0 -7
- package/dist/src/stories/Generales/Typography.d.ts +0 -1
- package/dist/src/stories/Generales/index.d.ts +0 -2
- package/dist/src/stories/Generales/types.d.ts +0 -3
- package/dist/src/stories/Menu/Menu.stories.d.ts +0 -7
- package/dist/src/stories/Modal/Modal.stories.d.ts +0 -7
- package/dist/src/stories/MultiSelect/MultiSelect.stories.d.ts +0 -7
- package/dist/src/stories/PageHeader/Header.stories.d.ts +0 -7
- package/dist/src/stories/Tabs/Tabs.stories.d.ts +0 -7
- package/dist/src/stories/TextArea/TextArea.stories.d.ts +0 -7
- package/dist/src/stories/Textfield/textfield.stories.d.ts +0 -7
- package/dist/src/stories/ToastNotification/toastNotification.stories.d.ts +0 -27
- package/dist/vite.svg +0 -1
- package/dist/vitest.setup.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1610,94 +1610,42 @@ var SCCalendarSwipeable = ({
|
|
|
1610
1610
|
import React14, { useEffect as useEffect11, useState as useState10 } from "react";
|
|
1611
1611
|
import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
|
|
1612
1612
|
import { LicenseInfo } from "@mui/x-license-pro";
|
|
1613
|
-
|
|
1614
|
-
var useStyles = makeStyles({
|
|
1615
|
-
root: {
|
|
1616
|
-
"& .MuiDataGrid-filler": {
|
|
1617
|
-
display: "none !important"
|
|
1618
|
-
},
|
|
1619
|
-
"& .MuiDataGrid-footerContainer": {
|
|
1620
|
-
minHeight: "26px !important",
|
|
1621
|
-
height: "26px !important"
|
|
1622
|
-
},
|
|
1623
|
-
"& .MuiTablePagination-toolbar": {
|
|
1624
|
-
minHeight: "25px !important",
|
|
1625
|
-
height: "25px !important"
|
|
1626
|
-
},
|
|
1627
|
-
"& .MuiTablePagination-actions .MuiIconButton-root": {
|
|
1628
|
-
padding: "0px !important"
|
|
1629
|
-
},
|
|
1630
|
-
"&.MuiDataGrid-root": {
|
|
1631
|
-
"--DataGrid-topContainerHeight": "0px !important"
|
|
1632
|
-
/* Cambia este valor según tus necesidades */
|
|
1633
|
-
},
|
|
1634
|
-
"MuiDataGrid-root .MuiDataGrid-virtualScrollerContent .MuiDataGrid-row": {
|
|
1635
|
-
"--height": "0px !important",
|
|
1636
|
-
"minHeight": "0px !important",
|
|
1637
|
-
"maxHeight": "0px !important"
|
|
1638
|
-
},
|
|
1639
|
-
"& .MuiDataGrid-cell": {
|
|
1640
|
-
padding: "0 !important"
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
var SCDataGrid = (_a) => {
|
|
1645
|
-
var _b = _a, { data, columns, rowsTable, checkboxSelection, width, height, maxHeight, density, agrupacion, groupingColDef, getTreeDataPath } = _b, props = __objRest(_b, ["data", "columns", "rowsTable", "checkboxSelection", "width", "height", "maxHeight", "density", "agrupacion", "groupingColDef", "getTreeDataPath"]);
|
|
1613
|
+
var SCDataGrid = ({ data, columns, rowsTable, checkboxSelection, width, maxHeight, density, groupingColDef, getTreeDataPath }) => {
|
|
1646
1614
|
const apiRef = useGridApiRef();
|
|
1647
|
-
const classes = useStyles();
|
|
1648
1615
|
LicenseInfo.setLicenseKey(
|
|
1649
1616
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
1650
1617
|
);
|
|
1651
1618
|
let validationTreeData = getTreeDataPath ? true : false;
|
|
1652
|
-
let
|
|
1653
|
-
let
|
|
1654
|
-
let
|
|
1655
|
-
let
|
|
1656
|
-
let
|
|
1657
|
-
let
|
|
1658
|
-
let dataConvert = [];
|
|
1619
|
+
let validationCheckboxSelection = checkboxSelection || false;
|
|
1620
|
+
let styleDensity = density || "compact";
|
|
1621
|
+
let styleTopContainerHeight = styleDensity === "compact" ? "26px" : styleDensity === "standard" ? "38px" : styleDensity === "comfortable" ? "60px" : "27px";
|
|
1622
|
+
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 || {};
|
|
1659
1625
|
const [groupDataLenght, setGroupDataLengh] = useState10(0);
|
|
1660
|
-
checkboxSelection = checkboxSelection || false;
|
|
1661
|
-
const rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length) : data.length < 10 ? parseInt(data.length) : 10;
|
|
1662
|
-
width = width || "100%";
|
|
1663
|
-
density = density || "compact";
|
|
1664
|
-
agrupacion = agrupacion || false;
|
|
1665
|
-
groupingColDef = groupingColDef || {};
|
|
1666
|
-
getTreeDataPath = getTreeDataPath || void 0;
|
|
1667
1626
|
const [pageSize, setPageSize] = useState10(rows);
|
|
1668
1627
|
const [arrayRows, setArrayRows] = useState10([]);
|
|
1669
|
-
const [heightTable, setHeightTable] = useState10(height || 0);
|
|
1670
1628
|
useEffect11(() => {
|
|
1671
1629
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
1672
1630
|
dataConvertRows(data, void 0);
|
|
1673
|
-
if (validationTreeData) {
|
|
1674
|
-
countGroupedElements(data, getTreeDataPath);
|
|
1675
|
-
}
|
|
1676
1631
|
}
|
|
1677
1632
|
}, [data]);
|
|
1678
|
-
useEffect11(() => {
|
|
1679
|
-
if (groupDataLenght > 0 && validationTreeData == true) {
|
|
1680
|
-
setHeightTable(heightTable ? heightTable : groupDataLenght * tamanoCelda + tamanoEncabezado + 27);
|
|
1681
|
-
} else if (groupDataLenght <= 0 && validationTreeData == false) {
|
|
1682
|
-
setHeightTable(heightTable ? heightTable : rows * tamanoCelda + tamanoEncabezado + 27);
|
|
1683
|
-
}
|
|
1684
|
-
}, [groupDataLenght]);
|
|
1685
1633
|
const dataConvertRows = (data2, columnId) => {
|
|
1686
|
-
let
|
|
1634
|
+
let dataConvert = [];
|
|
1687
1635
|
if ((data2 == null ? void 0 : data2.length) > 0) {
|
|
1688
1636
|
const dataKeys = Object.keys(data2[0]);
|
|
1689
1637
|
data2.map((item) => {
|
|
1690
1638
|
const newKeys = {};
|
|
1691
1639
|
let i = 0;
|
|
1692
|
-
let id =
|
|
1640
|
+
let id = dataConvert.length + 1;
|
|
1693
1641
|
for (i = 0; i < dataKeys.length; i++) {
|
|
1694
1642
|
newKeys[dataKeys[i]] = item[dataKeys[i]];
|
|
1695
1643
|
}
|
|
1696
1644
|
newKeys.id = columnId ? item[columnId] : id;
|
|
1697
|
-
|
|
1645
|
+
dataConvert = [...dataConvert, newKeys];
|
|
1698
1646
|
});
|
|
1699
1647
|
}
|
|
1700
|
-
setArrayRows(
|
|
1648
|
+
setArrayRows(dataConvert);
|
|
1701
1649
|
};
|
|
1702
1650
|
const isRowSelectable = (params) => params.row.bloqueoChecked == false ? false : true;
|
|
1703
1651
|
const [selectionModel, setSelectionModel] = useState10([]);
|
|
@@ -1737,41 +1685,27 @@ var SCDataGrid = (_a) => {
|
|
|
1737
1685
|
setSelectionModel([...newSelection]);
|
|
1738
1686
|
}
|
|
1739
1687
|
};
|
|
1740
|
-
|
|
1741
|
-
const groupedCounts = {};
|
|
1742
|
-
data.forEach((row2) => {
|
|
1743
|
-
const path = getTreeDataPath2(row2) || [];
|
|
1744
|
-
const key = path[0];
|
|
1745
|
-
if (!groupedCounts[key]) {
|
|
1746
|
-
groupedCounts[key] = 0;
|
|
1747
|
-
}
|
|
1748
|
-
groupedCounts[key]++;
|
|
1749
|
-
});
|
|
1750
|
-
setGroupDataLengh(Object.keys(groupedCounts).length);
|
|
1751
|
-
return groupedCounts;
|
|
1752
|
-
};
|
|
1753
|
-
const virtualScrollerHeight = validationTreeData ? groupDataLenght * tamanoCelda + 10 : rows * tamanoCelda;
|
|
1754
|
-
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, heightTable > 0 ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { style: { display: "flex", flexDirection: "column", width, maxHeight } }, /* @__PURE__ */ React14.createElement(
|
|
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(
|
|
1755
1689
|
DataGridPro,
|
|
1756
|
-
|
|
1757
|
-
apiRef
|
|
1758
|
-
|
|
1690
|
+
{
|
|
1691
|
+
apiRef,
|
|
1692
|
+
rowHeight: styleRowHeight,
|
|
1759
1693
|
rows: arrayRows,
|
|
1760
1694
|
columns,
|
|
1761
|
-
density,
|
|
1695
|
+
density: styleDensity,
|
|
1762
1696
|
treeData: validationTreeData,
|
|
1763
1697
|
getTreeDataPath,
|
|
1764
|
-
groupingColDef: validationTreeData == true ?
|
|
1698
|
+
groupingColDef: validationTreeData == true ? validationGroupingColDef : false,
|
|
1765
1699
|
pagination: true,
|
|
1766
1700
|
initialState: {
|
|
1767
1701
|
pagination: { paginationModel: { pageSize: rows } }
|
|
1768
1702
|
},
|
|
1769
|
-
checkboxSelection,
|
|
1703
|
+
checkboxSelection: validationCheckboxSelection,
|
|
1770
1704
|
rowSelectionModel: selectionModel,
|
|
1771
1705
|
onRowSelectionModelChange: (newSelection) => handleSelectionChange(newSelection),
|
|
1772
1706
|
isRowSelectable,
|
|
1773
1707
|
disableRowSelectionOnClick: true,
|
|
1774
|
-
|
|
1708
|
+
hideFooter: validationTreeData == true ? true : false,
|
|
1775
1709
|
localeText: {
|
|
1776
1710
|
noRowsLabel: "No hay filas",
|
|
1777
1711
|
columnMenuLabel: "Men\xFA de columna",
|
|
@@ -1782,9 +1716,36 @@ var SCDataGrid = (_a) => {
|
|
|
1782
1716
|
labelRowsPerPage: "Filas por p\xE1gina:",
|
|
1783
1717
|
labelDisplayedRows: ({ from, to, count }) => `${from}\u2013${to} de ${count !== -1 ? count : `m\xE1s de ${to}`}`
|
|
1784
1718
|
}
|
|
1719
|
+
},
|
|
1720
|
+
sx: {
|
|
1721
|
+
"& .MuiDataGrid-filler": {
|
|
1722
|
+
display: "none !important"
|
|
1723
|
+
},
|
|
1724
|
+
"& .MuiDataGrid-footerContainer": {
|
|
1725
|
+
minHeight: "26px !important",
|
|
1726
|
+
height: "26px !important"
|
|
1727
|
+
},
|
|
1728
|
+
"& .MuiTablePagination-toolbar": {
|
|
1729
|
+
minHeight: "25px !important",
|
|
1730
|
+
height: "25px !important"
|
|
1731
|
+
},
|
|
1732
|
+
"& .MuiTablePagination-actions .MuiIconButton-root": {
|
|
1733
|
+
padding: "0px !important"
|
|
1734
|
+
},
|
|
1735
|
+
"&.MuiDataGrid-root": {
|
|
1736
|
+
[`--DataGrid-topContainerHeight`]: `${styleTopContainerHeight} !important`
|
|
1737
|
+
},
|
|
1738
|
+
"MuiDataGrid-root .MuiDataGrid-virtualScrollerContent .MuiDataGrid-row": {
|
|
1739
|
+
"--height": "0px !important",
|
|
1740
|
+
"minHeight": "0px !important",
|
|
1741
|
+
"maxHeight": "0px !important"
|
|
1742
|
+
},
|
|
1743
|
+
"& .MuiDataGrid-cell": {
|
|
1744
|
+
padding: "0 !important"
|
|
1745
|
+
}
|
|
1785
1746
|
}
|
|
1786
|
-
}
|
|
1787
|
-
)))
|
|
1747
|
+
}
|
|
1748
|
+
))));
|
|
1788
1749
|
};
|
|
1789
1750
|
|
|
1790
1751
|
// src/Components/SCAutocomplete.tsx
|