frontend-plus-react 0.1.13 → 0.1.15
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 +283 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +540 -298
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1027,6 +1027,120 @@ var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
|
1027
1027
|
);
|
|
1028
1028
|
};
|
|
1029
1029
|
|
|
1030
|
+
// src/components/grid/DataGridOptionsDialog.tsx
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
var DataGridOptionsDialog = ({
|
|
1044
|
+
open,
|
|
1045
|
+
onClose,
|
|
1046
|
+
options,
|
|
1047
|
+
anchorEl
|
|
1048
|
+
}) => {
|
|
1049
|
+
const [isExecuting, setIsExecuting] = _react.useState.call(void 0, false);
|
|
1050
|
+
const handleOptionClick = async (handler) => {
|
|
1051
|
+
try {
|
|
1052
|
+
setIsExecuting(true);
|
|
1053
|
+
await handler();
|
|
1054
|
+
} catch (error) {
|
|
1055
|
+
console.error("Error ejecutando handler:", error);
|
|
1056
|
+
} finally {
|
|
1057
|
+
setIsExecuting(false);
|
|
1058
|
+
onClose();
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1062
|
+
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1063
|
+
"div",
|
|
1064
|
+
{
|
|
1065
|
+
style: {
|
|
1066
|
+
position: "fixed",
|
|
1067
|
+
top: 0,
|
|
1068
|
+
left: 0,
|
|
1069
|
+
right: 0,
|
|
1070
|
+
bottom: 0,
|
|
1071
|
+
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
1072
|
+
zIndex: 1200,
|
|
1073
|
+
pointerEvents: "none"
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1078
|
+
_material.Popover,
|
|
1079
|
+
{
|
|
1080
|
+
open,
|
|
1081
|
+
anchorEl,
|
|
1082
|
+
onClose,
|
|
1083
|
+
anchorOrigin: {
|
|
1084
|
+
vertical: "bottom",
|
|
1085
|
+
horizontal: "left"
|
|
1086
|
+
},
|
|
1087
|
+
transformOrigin: {
|
|
1088
|
+
vertical: "top",
|
|
1089
|
+
horizontal: "left"
|
|
1090
|
+
},
|
|
1091
|
+
slotProps: {
|
|
1092
|
+
paper: {
|
|
1093
|
+
sx: {
|
|
1094
|
+
zIndex: 1300
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Paper, { sx: { minWidth: 150, maxWidth: 350 }, children: [
|
|
1099
|
+
isExecuting && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1100
|
+
_material.Box,
|
|
1101
|
+
{
|
|
1102
|
+
sx: {
|
|
1103
|
+
display: "flex",
|
|
1104
|
+
justifyContent: "center",
|
|
1105
|
+
alignItems: "center",
|
|
1106
|
+
p: 5
|
|
1107
|
+
},
|
|
1108
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CircularProgress, { size: 40 })
|
|
1109
|
+
}
|
|
1110
|
+
),
|
|
1111
|
+
!isExecuting && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.List, { sx: {
|
|
1112
|
+
py: 0,
|
|
1113
|
+
"& .MuiListItemButton-root": {
|
|
1114
|
+
py: 0.5,
|
|
1115
|
+
px: 1.5,
|
|
1116
|
+
minHeight: 36
|
|
1117
|
+
},
|
|
1118
|
+
"& .MuiListItemIcon-root": {
|
|
1119
|
+
minWidth: 32
|
|
1120
|
+
},
|
|
1121
|
+
"& .MuiListItemText-primary": {
|
|
1122
|
+
fontSize: "0.85rem"
|
|
1123
|
+
},
|
|
1124
|
+
"& .MuiSvgIcon-root": {
|
|
1125
|
+
fontSize: 18
|
|
1126
|
+
}
|
|
1127
|
+
}, children: options.filter((option) => option.visible !== false).map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1128
|
+
_material.ListItemButton,
|
|
1129
|
+
{
|
|
1130
|
+
onClick: () => handleOptionClick(option.handler),
|
|
1131
|
+
children: [
|
|
1132
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemIcon, { children: option.icon }),
|
|
1133
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemText, { primary: option.label })
|
|
1134
|
+
]
|
|
1135
|
+
},
|
|
1136
|
+
option.id
|
|
1137
|
+
)) })
|
|
1138
|
+
] })
|
|
1139
|
+
}
|
|
1140
|
+
)
|
|
1141
|
+
] });
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1030
1144
|
// src/components/grid/renderers/headerCellRenderers.tsx
|
|
1031
1145
|
|
|
1032
1146
|
var _Search = require('@mui/icons-material/Search'); var _Search2 = _interopRequireDefault(_Search);
|
|
@@ -1064,30 +1178,31 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
|
1064
1178
|
}
|
|
1065
1179
|
);
|
|
1066
1180
|
};
|
|
1067
|
-
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) =>
|
|
1068
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
] });
|
|
1181
|
+
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility, handleDataGridOptions) => {
|
|
1182
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 0.2 }, children: [
|
|
1183
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1184
|
+
_material.IconButton,
|
|
1185
|
+
{
|
|
1186
|
+
color: "inherit",
|
|
1187
|
+
onClick: toggleFilterVisibility,
|
|
1188
|
+
size: "small",
|
|
1189
|
+
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1190
|
+
sx: { p: 0.25 },
|
|
1191
|
+
children: isFilterRowVisible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SearchOff2.default, { sx: { fontSize: 18 } }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { sx: { fontSize: 18 } })
|
|
1192
|
+
}
|
|
1193
|
+
),
|
|
1194
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1195
|
+
_material.IconButton,
|
|
1196
|
+
{
|
|
1197
|
+
onClick: (event) => handleDataGridOptions(event),
|
|
1198
|
+
size: "small",
|
|
1199
|
+
title: "Opciones de esta tabla",
|
|
1200
|
+
sx: { p: 0.25 },
|
|
1201
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _MoreVert2.default, { sx: { fontSize: 20, variant: "filled", size: "small" } })
|
|
1202
|
+
}
|
|
1203
|
+
)
|
|
1204
|
+
] });
|
|
1205
|
+
};
|
|
1091
1206
|
var detailColumnCellHeaderRenderer = (props, detailTable) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: detailTable.label, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "caption", sx: { fontSize: "0.75rem", fontWeight: "bold" }, children: detailTable.abr.toUpperCase() }) });
|
|
1092
1207
|
|
|
1093
1208
|
// src/components/grid/FilterInputRender.tsx
|
|
@@ -1677,6 +1792,109 @@ function EmptyRowsRenderer() {
|
|
|
1677
1792
|
}, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { textAlign: "center" }, children: "No hay filas para mostrar" }) });
|
|
1678
1793
|
}
|
|
1679
1794
|
|
|
1795
|
+
// src/components/grid/menu/options.tsx
|
|
1796
|
+
var _Refresh = require('@mui/icons-material/Refresh'); var _Refresh2 = _interopRequireDefault(_Refresh);
|
|
1797
|
+
var _ViewColumn = require('@mui/icons-material/ViewColumn'); var _ViewColumn2 = _interopRequireDefault(_ViewColumn);
|
|
1798
|
+
var _VisibilityOff = require('@mui/icons-material/VisibilityOff'); var _VisibilityOff2 = _interopRequireDefault(_VisibilityOff);
|
|
1799
|
+
var _FileDownload = require('@mui/icons-material/FileDownload'); var _FileDownload2 = _interopRequireDefault(_FileDownload);
|
|
1800
|
+
var _FileUpload = require('@mui/icons-material/FileUpload'); var _FileUpload2 = _interopRequireDefault(_FileUpload);
|
|
1801
|
+
var _DeleteSweep = require('@mui/icons-material/DeleteSweep'); var _DeleteSweep2 = _interopRequireDefault(_DeleteSweep);
|
|
1802
|
+
var _FilterAlt = require('@mui/icons-material/FilterAlt'); var _FilterAlt2 = _interopRequireDefault(_FilterAlt);
|
|
1803
|
+
|
|
1804
|
+
var buildMenuOptions = (params) => {
|
|
1805
|
+
const {
|
|
1806
|
+
tableDefinition,
|
|
1807
|
+
tableName,
|
|
1808
|
+
fixedFields,
|
|
1809
|
+
setTableData,
|
|
1810
|
+
callApi,
|
|
1811
|
+
showSuccess,
|
|
1812
|
+
showError,
|
|
1813
|
+
showWarning
|
|
1814
|
+
} = params;
|
|
1815
|
+
if (!tableDefinition) return [];
|
|
1816
|
+
const options = [];
|
|
1817
|
+
options.push({
|
|
1818
|
+
id: "refresh",
|
|
1819
|
+
label: "refrescar la grilla desde la base de datos",
|
|
1820
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Refresh2.default, {}),
|
|
1821
|
+
handler: async () => {
|
|
1822
|
+
try {
|
|
1823
|
+
const data = await callApi("table_data", {
|
|
1824
|
+
table: tableName,
|
|
1825
|
+
fixedFields
|
|
1826
|
+
});
|
|
1827
|
+
setTableData(data);
|
|
1828
|
+
showSuccess("Grilla refrescada correctamente");
|
|
1829
|
+
} catch (err) {
|
|
1830
|
+
showError(`Error al refrescar: ${err.message || "Error desconocido"}`);
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
visible: true
|
|
1834
|
+
});
|
|
1835
|
+
options.push({
|
|
1836
|
+
id: "showColumns",
|
|
1837
|
+
label: "mostrar las columnas relacionadas",
|
|
1838
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ViewColumn2.default, {}),
|
|
1839
|
+
handler: async () => {
|
|
1840
|
+
console.log("Mostrar columnas relacionadas");
|
|
1841
|
+
},
|
|
1842
|
+
visible: true
|
|
1843
|
+
});
|
|
1844
|
+
options.push({
|
|
1845
|
+
id: "hideColumns",
|
|
1846
|
+
label: "ocultar o mostrar columnas",
|
|
1847
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _VisibilityOff2.default, {}),
|
|
1848
|
+
handler: async () => {
|
|
1849
|
+
console.log("Ocultar/mostrar columnas");
|
|
1850
|
+
},
|
|
1851
|
+
visible: true
|
|
1852
|
+
});
|
|
1853
|
+
if (_optionalChain([tableDefinition, 'access', _31 => _31.allow, 'optionalAccess', _32 => _32.export])) {
|
|
1854
|
+
options.push({
|
|
1855
|
+
id: "export",
|
|
1856
|
+
label: "exportar",
|
|
1857
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FileDownload2.default, {}),
|
|
1858
|
+
handler: async () => {
|
|
1859
|
+
console.log("Exportar datos");
|
|
1860
|
+
},
|
|
1861
|
+
visible: true
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
if (_optionalChain([tableDefinition, 'access', _33 => _33.allow, 'optionalAccess', _34 => _34.import])) {
|
|
1865
|
+
options.push({
|
|
1866
|
+
id: "import",
|
|
1867
|
+
label: "importar",
|
|
1868
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FileUpload2.default, {}),
|
|
1869
|
+
handler: async () => {
|
|
1870
|
+
console.log("Importar datos");
|
|
1871
|
+
},
|
|
1872
|
+
visible: true
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
if (_optionalChain([tableDefinition, 'access', _35 => _35.allow, 'optionalAccess', _36 => _36.delete])) {
|
|
1876
|
+
options.push({
|
|
1877
|
+
id: "deleteAll",
|
|
1878
|
+
label: "borrar todos los registros",
|
|
1879
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DeleteSweep2.default, {}),
|
|
1880
|
+
handler: async () => {
|
|
1881
|
+
showWarning("Esta operaci\xF3n eliminar\xE1 TODOS los registros de la tabla");
|
|
1882
|
+
},
|
|
1883
|
+
visible: true
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
options.push({
|
|
1887
|
+
id: "completeTable",
|
|
1888
|
+
label: "tabla completa y filtrada",
|
|
1889
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FilterAlt2.default, {}),
|
|
1890
|
+
handler: async () => {
|
|
1891
|
+
console.log("Toggle tabla completa/filtrada");
|
|
1892
|
+
},
|
|
1893
|
+
visible: true
|
|
1894
|
+
});
|
|
1895
|
+
return options;
|
|
1896
|
+
};
|
|
1897
|
+
|
|
1680
1898
|
// src/components/grid/GenericDataGrid.tsx
|
|
1681
1899
|
|
|
1682
1900
|
var NEW_ROW_INDICATOR = "$new";
|
|
@@ -1709,6 +1927,8 @@ var GenericDataGrid = ({
|
|
|
1709
1927
|
const [localCellChanges, setLocalCellChanges] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
|
|
1710
1928
|
const theme = _material.useTheme.call(void 0, );
|
|
1711
1929
|
const [openConfirmDialog, setOpenConfirmDialog] = _react.useState.call(void 0, false);
|
|
1930
|
+
const [openDataGridOptions, setOpenDataGridOptions] = _react.useState.call(void 0, false);
|
|
1931
|
+
const [dataGridOptionsAnchorEl, setDataGridOptionsAnchorEl] = _react.useState.call(void 0, null);
|
|
1712
1932
|
const [rowToDelete, setRowToDelete] = _react.useState.call(void 0, null);
|
|
1713
1933
|
const [exitingRowIds, setExitingRowIds] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
1714
1934
|
const { showSuccess, showError, showWarning, showInfo } = useSnackbar();
|
|
@@ -1923,14 +2143,14 @@ var GenericDataGrid = ({
|
|
|
1923
2143
|
const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
|
|
1924
2144
|
const editableColumns = currentColumns.filter((col) => {
|
|
1925
2145
|
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1926
|
-
return col.key !== "actionsColumn" && col.customType != "detail" && (_optionalChain([fieldDefinition, 'optionalAccess',
|
|
2146
|
+
return col.key !== "actionsColumn" && col.customType != "detail" && (_optionalChain([fieldDefinition, 'optionalAccess', _37 => _37.editable]) !== false && !_optionalChain([fieldDefinition, 'optionalAccess', _38 => _38.clientSide]));
|
|
1927
2147
|
});
|
|
1928
2148
|
const { key, target } = event;
|
|
1929
2149
|
const input = target;
|
|
1930
2150
|
if (currentColumnIndex !== -1 && editableColumns.length > 0) {
|
|
1931
2151
|
const editableColumnKeys = editableColumns.map((col) => col.key);
|
|
1932
2152
|
let currentEditableColumnIndex = editableColumnKeys.indexOf(columnKey);
|
|
1933
|
-
const hacerFoco = ({ rowIdx, idx }) => setTimeout(() => _optionalChain([dataGridRef, 'access',
|
|
2153
|
+
const hacerFoco = ({ rowIdx, idx }) => setTimeout(() => _optionalChain([dataGridRef, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.selectCell, 'call', _41 => _41({ rowIdx, idx }, { enableEditor: true, shouldFocusCell: true })]), 10);
|
|
1934
2154
|
const calcularColumnaSiguiente = () => {
|
|
1935
2155
|
let nextEditableColumnIndex = currentEditableColumnIndex + 1;
|
|
1936
2156
|
let nextRowIndex = rowIndex;
|
|
@@ -2027,14 +2247,24 @@ var GenericDataGrid = ({
|
|
|
2027
2247
|
const handleSelectedCellChange = _react.useCallback.call(void 0, (args) => {
|
|
2028
2248
|
setSelectedCell(args);
|
|
2029
2249
|
}, []);
|
|
2250
|
+
const menuOptions = _react.useMemo.call(void 0, () => buildMenuOptions({
|
|
2251
|
+
tableDefinition,
|
|
2252
|
+
tableName,
|
|
2253
|
+
fixedFields,
|
|
2254
|
+
setTableData,
|
|
2255
|
+
callApi,
|
|
2256
|
+
showSuccess,
|
|
2257
|
+
showError,
|
|
2258
|
+
showWarning
|
|
2259
|
+
}), [tableDefinition, tableName, fixedFields, setTableData, callApi, showSuccess, showError, showWarning]);
|
|
2030
2260
|
const columns = _react.useMemo.call(void 0, () => {
|
|
2031
2261
|
if (!tableDefinition) return [];
|
|
2032
2262
|
const fieldsToShow = tableDefinition.fields.filter((field) => {
|
|
2033
|
-
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess',
|
|
2263
|
+
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess', _42 => _42.find, 'call', _43 => _43((f) => f.fieldName === field.name)]);
|
|
2034
2264
|
return !(fixedFieldEntry && fixedFieldEntry.until === void 0);
|
|
2035
2265
|
});
|
|
2036
2266
|
const defaultColumns = fieldsToShow.map((fieldDef) => {
|
|
2037
|
-
const isFixedField = _optionalChain([fixedFields, 'optionalAccess',
|
|
2267
|
+
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _44 => _44.some, 'call', _45 => _45((f) => f.fieldName === fieldDef.name)]);
|
|
2038
2268
|
const isFieldEditable = fieldDef.editable !== false && !isFixedField;
|
|
2039
2269
|
return {
|
|
2040
2270
|
key: fieldDef.name,
|
|
@@ -2061,9 +2291,9 @@ var GenericDataGrid = ({
|
|
|
2061
2291
|
};
|
|
2062
2292
|
});
|
|
2063
2293
|
const availableActions = [
|
|
2064
|
-
_optionalChain([tableDefinition, 'access',
|
|
2065
|
-
_optionalChain([tableDefinition, 'access',
|
|
2066
|
-
_optionalChain([tableDefinition, 'access',
|
|
2294
|
+
_optionalChain([tableDefinition, 'access', _46 => _46.allow, 'optionalAccess', _47 => _47.insert]),
|
|
2295
|
+
_optionalChain([tableDefinition, 'access', _48 => _48.allow, 'optionalAccess', _49 => _49.delete]),
|
|
2296
|
+
_optionalChain([tableDefinition, 'access', _50 => _50.allow, 'optionalAccess', _51 => _51["vertical-edit"]])
|
|
2067
2297
|
].filter(Boolean).length;
|
|
2068
2298
|
const actionColumnWidth = availableActions === 0 ? 30 : 12 + availableActions * 25;
|
|
2069
2299
|
const actionsColumn = {
|
|
@@ -2077,7 +2307,10 @@ var GenericDataGrid = ({
|
|
|
2077
2307
|
editable: false,
|
|
2078
2308
|
resizable: false,
|
|
2079
2309
|
sortable: false,
|
|
2080
|
-
renderHeaderCell: (props) => actionsColumnHeaderCellRenderer(props, isFilterRowVisible, toggleFilterVisibility)
|
|
2310
|
+
renderHeaderCell: (props) => actionsColumnHeaderCellRenderer(props, isFilterRowVisible, toggleFilterVisibility, (e) => {
|
|
2311
|
+
setDataGridOptionsAnchorEl(e.currentTarget);
|
|
2312
|
+
setOpenDataGridOptions(true);
|
|
2313
|
+
}),
|
|
2081
2314
|
renderSummaryCell: (props) => actionsColumnSummaryCellRenderer(props)
|
|
2082
2315
|
};
|
|
2083
2316
|
const detailColumns = [];
|
|
@@ -2169,11 +2402,11 @@ var GenericDataGrid = ({
|
|
|
2169
2402
|
event.preventGridDefault();
|
|
2170
2403
|
}, []);
|
|
2171
2404
|
const handleCellClick = _react.useCallback.call(void 0, (args, _event) => {
|
|
2172
|
-
const fieldDefinition = _optionalChain([tableDefinition, 'optionalAccess',
|
|
2173
|
-
const isFixedField = _optionalChain([fixedFields, 'optionalAccess',
|
|
2174
|
-
const isEditable = _optionalChain([fieldDefinition, 'optionalAccess',
|
|
2405
|
+
const fieldDefinition = _optionalChain([tableDefinition, 'optionalAccess', _52 => _52.fields, 'access', _53 => _53.find, 'call', _54 => _54((f) => f.name === args.column.key)]);
|
|
2406
|
+
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _55 => _55.some, 'call', _56 => _56((f) => f.fieldName === args.column.key)]);
|
|
2407
|
+
const isEditable = _optionalChain([fieldDefinition, 'optionalAccess', _57 => _57.editable]) !== false && !isFixedField;
|
|
2175
2408
|
if (isEditable) {
|
|
2176
|
-
deselectAllOtherGrids(_optionalChain([dataGridRef, 'access',
|
|
2409
|
+
deselectAllOtherGrids(_optionalChain([dataGridRef, 'access', _58 => _58.current, 'optionalAccess', _59 => _59.element]));
|
|
2177
2410
|
args.selectCell(true);
|
|
2178
2411
|
}
|
|
2179
2412
|
console.log("Clicked column index:", args.column.idx);
|
|
@@ -2265,6 +2498,15 @@ var GenericDataGrid = ({
|
|
|
2265
2498
|
title: "Confirmar Eliminaci\xF3n",
|
|
2266
2499
|
message: rowToDelete && rowToDelete[NEW_ROW_INDICATOR] ? `\xBFEst\xE1s seguro de que quieres eliminar esta nueva fila (ID: ${getPrimaryKeyValues(rowToDelete, primaryKey)}) localmente?` : rowToDelete ? `\xBFEst\xE1s seguro de que quieres eliminar la fila con ID: ${getPrimaryKeyValues(rowToDelete, primaryKey)} de la base de datos? Esta acci\xF3n es irreversible.` : "\xBFEst\xE1s seguro de que quieres eliminar este registro? Esta acci\xF3n es irreversible."
|
|
2267
2500
|
}
|
|
2501
|
+
),
|
|
2502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2503
|
+
DataGridOptionsDialog,
|
|
2504
|
+
{
|
|
2505
|
+
open: openDataGridOptions,
|
|
2506
|
+
onClose: () => setOpenDataGridOptions(false),
|
|
2507
|
+
options: menuOptions,
|
|
2508
|
+
anchorEl: dataGridOptionsAnchorEl
|
|
2509
|
+
}
|
|
2268
2510
|
)
|
|
2269
2511
|
] });
|
|
2270
2512
|
};
|
|
@@ -2794,7 +3036,7 @@ var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
|
2794
3036
|
var HomePage = () => {
|
|
2795
3037
|
const { clientContext } = useApp();
|
|
2796
3038
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { p: 3 }, children: [
|
|
2797
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${_optionalChain([clientContext, 'optionalAccess',
|
|
3039
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${_optionalChain([clientContext, 'optionalAccess', _60 => _60.username])}` }),
|
|
2798
3040
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
|
|
2799
3041
|
] });
|
|
2800
3042
|
};
|
|
@@ -2923,7 +3165,7 @@ var LoginPage = () => {
|
|
|
2923
3165
|
fullWidth: true,
|
|
2924
3166
|
margin: "normal",
|
|
2925
3167
|
error: !!errors.username,
|
|
2926
|
-
helperText: _optionalChain([errors, 'access',
|
|
3168
|
+
helperText: _optionalChain([errors, 'access', _61 => _61.username, 'optionalAccess', _62 => _62.message]),
|
|
2927
3169
|
disabled: isSubmitting
|
|
2928
3170
|
}
|
|
2929
3171
|
)
|
|
@@ -2946,7 +3188,7 @@ var LoginPage = () => {
|
|
|
2946
3188
|
fullWidth: true,
|
|
2947
3189
|
margin: "normal",
|
|
2948
3190
|
error: !!errors.password,
|
|
2949
|
-
helperText: _optionalChain([errors, 'access',
|
|
3191
|
+
helperText: _optionalChain([errors, 'access', _63 => _63.password, 'optionalAccess', _64 => _64.message]),
|
|
2950
3192
|
disabled: isSubmitting
|
|
2951
3193
|
}
|
|
2952
3194
|
)
|
|
@@ -3024,7 +3266,7 @@ var ProcedureForm = () => {
|
|
|
3024
3266
|
const [executionLog, setExecutionLog] = _react.useState.call(void 0, []);
|
|
3025
3267
|
const [procedureResultData, setProcedureResultData] = _react.useState.call(void 0, null);
|
|
3026
3268
|
const procedure = _react.useMemo.call(void 0, () => {
|
|
3027
|
-
if (procedureName && _optionalChain([clientContext, 'optionalAccess',
|
|
3269
|
+
if (procedureName && _optionalChain([clientContext, 'optionalAccess', _65 => _65.procedure])) {
|
|
3028
3270
|
return clientContext.procedure[procedureName];
|
|
3029
3271
|
}
|
|
3030
3272
|
return void 0;
|
|
@@ -3315,7 +3557,7 @@ var ProcedureForm = () => {
|
|
|
3315
3557
|
}
|
|
3316
3558
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3317
3559
|
const ResultDisplayContent = _react.useMemo.call(void 0, () => {
|
|
3318
|
-
if (!procedureResultData || !_optionalChain([procedure, 'optionalAccess',
|
|
3560
|
+
if (!procedureResultData || !_optionalChain([procedure, 'optionalAccess', _66 => _66.resultOk])) return null;
|
|
3319
3561
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3320
3562
|
if (ComponentToRender) {
|
|
3321
3563
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ComponentToRender, { data: procedureResultData });
|