frontend-plus-react 0.1.3 → 0.1.4
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 +439 -401
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +622 -584
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -788,7 +788,6 @@ var useApiCall = () => {
|
|
|
788
788
|
|
|
789
789
|
|
|
790
790
|
|
|
791
|
-
|
|
792
791
|
var _material = require('@mui/material');
|
|
793
792
|
|
|
794
793
|
// src/utils/functions.tsx
|
|
@@ -991,17 +990,44 @@ var useRedirectPath = () => {
|
|
|
991
990
|
var cambiarGuionesBajosPorEspacios = (texto) => texto.replace(/_/g, " ");
|
|
992
991
|
|
|
993
992
|
// src/components/grid/GenericDataGrid.tsx
|
|
994
|
-
var _Search = require('@mui/icons-material/Search'); var _Search2 = _interopRequireDefault(_Search);
|
|
995
|
-
var _SearchOff = require('@mui/icons-material/SearchOff'); var _SearchOff2 = _interopRequireDefault(_SearchOff);
|
|
996
993
|
var _Add = require('@mui/icons-material/Add'); var _Add2 = _interopRequireDefault(_Add);
|
|
997
|
-
var _Delete = require('@mui/icons-material/Delete'); var _Delete2 = _interopRequireDefault(_Delete);
|
|
998
994
|
|
|
999
|
-
// src/components/
|
|
995
|
+
// src/components/ConfirmDialog.tsx
|
|
996
|
+
var _Dialog = require('@mui/material/Dialog'); var _Dialog2 = _interopRequireDefault(_Dialog);
|
|
997
|
+
var _DialogTitle = require('@mui/material/DialogTitle'); var _DialogTitle2 = _interopRequireDefault(_DialogTitle);
|
|
998
|
+
var _DialogContent = require('@mui/material/DialogContent'); var _DialogContent2 = _interopRequireDefault(_DialogContent);
|
|
999
|
+
var _DialogContentText = require('@mui/material/DialogContentText'); var _DialogContentText2 = _interopRequireDefault(_DialogContentText);
|
|
1000
|
+
var _DialogActions = require('@mui/material/DialogActions'); var _DialogActions2 = _interopRequireDefault(_DialogActions);
|
|
1001
|
+
var _Button = require('@mui/material/Button'); var _Button2 = _interopRequireDefault(_Button);
|
|
1002
|
+
|
|
1003
|
+
var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
1004
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1005
|
+
_Dialog2.default,
|
|
1006
|
+
{
|
|
1007
|
+
open,
|
|
1008
|
+
onClose: () => onClose(false),
|
|
1009
|
+
"aria-labelledby": "confirm-dialog-title",
|
|
1010
|
+
"aria-describedby": "confirm-dialog-description",
|
|
1011
|
+
children: [
|
|
1012
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogTitle2.default, { id: "confirm-dialog-title", children: title }),
|
|
1013
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogContent2.default, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogContentText2.default, { id: "confirm-dialog-description", children: message }) }),
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _DialogActions2.default, { children: [
|
|
1015
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Button2.default, { onClick: () => onClose(false), color: "primary", children: "Cancelar" }),
|
|
1016
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Button2.default, { onClick: () => onClose(true), color: "error", autoFocus: true, children: "Confirmar" })
|
|
1017
|
+
] })
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
// src/components/grid/renderers/headerCellRenderers.tsx
|
|
1000
1024
|
|
|
1025
|
+
var _Search = require('@mui/icons-material/Search'); var _Search2 = _interopRequireDefault(_Search);
|
|
1026
|
+
var _SearchOff = require('@mui/icons-material/SearchOff'); var _SearchOff2 = _interopRequireDefault(_SearchOff);
|
|
1001
1027
|
|
|
1002
|
-
|
|
1028
|
+
var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
|
|
1003
1029
|
const { column } = props;
|
|
1004
|
-
const isPrimaryKey =
|
|
1030
|
+
const isPrimaryKey = fieldDef.isPk;
|
|
1005
1031
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1006
1032
|
_material.Box,
|
|
1007
1033
|
{
|
|
@@ -1029,63 +1055,19 @@ function PkHeaderRenderer(props) {
|
|
|
1029
1055
|
)
|
|
1030
1056
|
}
|
|
1031
1057
|
);
|
|
1032
|
-
}
|
|
1033
|
-
var PkHeaderRenderer_default = PkHeaderRenderer;
|
|
1034
|
-
|
|
1035
|
-
// src/components/grid/PkCellRenderer.tsx
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
function PkCellRenderer(props) {
|
|
1039
|
-
const { column, row } = props;
|
|
1040
|
-
const isPrimaryKey = column.isPK;
|
|
1041
|
-
const rowAsRecord = row;
|
|
1042
|
-
const value = rowAsRecord[column.key];
|
|
1043
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1044
|
-
_material.Typography,
|
|
1045
|
-
{
|
|
1046
|
-
variant: "body2",
|
|
1047
|
-
sx: {
|
|
1048
|
-
//fontWeight: isPrimaryKey ? 'bold' : 'normal',
|
|
1049
|
-
fontSize: "0.875rem",
|
|
1050
|
-
// Ajusta el tamaño si es necesario
|
|
1051
|
-
whiteSpace: "nowrap",
|
|
1052
|
-
overflow: "hidden",
|
|
1053
|
-
textOverflow: "ellipsis",
|
|
1054
|
-
width: "100%"
|
|
1055
|
-
},
|
|
1056
|
-
children: value === null || value === void 0 ? "" : String(value)
|
|
1057
|
-
}
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
var PkCellRenderer_default = PkCellRenderer;
|
|
1061
|
-
|
|
1062
|
-
// src/components/ConfirmDialog.tsx
|
|
1063
|
-
var _Dialog = require('@mui/material/Dialog'); var _Dialog2 = _interopRequireDefault(_Dialog);
|
|
1064
|
-
var _DialogTitle = require('@mui/material/DialogTitle'); var _DialogTitle2 = _interopRequireDefault(_DialogTitle);
|
|
1065
|
-
var _DialogContent = require('@mui/material/DialogContent'); var _DialogContent2 = _interopRequireDefault(_DialogContent);
|
|
1066
|
-
var _DialogContentText = require('@mui/material/DialogContentText'); var _DialogContentText2 = _interopRequireDefault(_DialogContentText);
|
|
1067
|
-
var _DialogActions = require('@mui/material/DialogActions'); var _DialogActions2 = _interopRequireDefault(_DialogActions);
|
|
1068
|
-
var _Button = require('@mui/material/Button'); var _Button2 = _interopRequireDefault(_Button);
|
|
1069
|
-
|
|
1070
|
-
var ConfirmDialog = ({ open, onClose, title, message }) => {
|
|
1071
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1072
|
-
_Dialog2.default,
|
|
1073
|
-
{
|
|
1074
|
-
open,
|
|
1075
|
-
onClose: () => onClose(false),
|
|
1076
|
-
"aria-labelledby": "confirm-dialog-title",
|
|
1077
|
-
"aria-describedby": "confirm-dialog-description",
|
|
1078
|
-
children: [
|
|
1079
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogTitle2.default, { id: "confirm-dialog-title", children: title }),
|
|
1080
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogContent2.default, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DialogContentText2.default, { id: "confirm-dialog-description", children: message }) }),
|
|
1081
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _DialogActions2.default, { children: [
|
|
1082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Button2.default, { onClick: () => onClose(false), color: "primary", children: "Cancelar" }),
|
|
1083
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Button2.default, { onClick: () => onClose(true), color: "error", autoFocus: true, children: "Confirmar" })
|
|
1084
|
-
] })
|
|
1085
|
-
]
|
|
1086
|
-
}
|
|
1087
|
-
);
|
|
1088
1058
|
};
|
|
1059
|
+
var actionsColumnHeaderCellRenderer = (props, isFilterRowVisible, toggleFilterVisibility) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1060
|
+
_material.IconButton,
|
|
1061
|
+
{
|
|
1062
|
+
color: "inherit",
|
|
1063
|
+
onClick: toggleFilterVisibility,
|
|
1064
|
+
size: "small",
|
|
1065
|
+
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1066
|
+
sx: { p: 0.5 },
|
|
1067
|
+
children: isFilterRowVisible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SearchOff2.default, { sx: { fontSize: 20 } }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { sx: { fontSize: 20 } })
|
|
1068
|
+
}
|
|
1069
|
+
);
|
|
1070
|
+
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() }) });
|
|
1089
1071
|
|
|
1090
1072
|
// src/components/grid/FilterInputRender.tsx
|
|
1091
1073
|
|
|
@@ -1118,7 +1100,209 @@ function FilterInputRenderer({
|
|
|
1118
1100
|
}
|
|
1119
1101
|
var FilterInputRender_default = FilterInputRenderer;
|
|
1120
1102
|
|
|
1121
|
-
// src/components/grid/
|
|
1103
|
+
// src/components/grid/renderers/summaryCellRenderers.tsx
|
|
1104
|
+
|
|
1105
|
+
var defaultColumnSummaryCellRenderer = (props, fixedFields, isFilterRowVisible, filters, setFilters) => {
|
|
1106
|
+
const { column } = props;
|
|
1107
|
+
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((f) => f.fieldName === column.key)]);
|
|
1108
|
+
if (fixedFieldEntry && fixedFieldEntry.until === void 0 || !isFilterRowVisible) return null;
|
|
1109
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1110
|
+
FilterInputRender_default,
|
|
1111
|
+
{
|
|
1112
|
+
column,
|
|
1113
|
+
filters,
|
|
1114
|
+
setFilters
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
};
|
|
1118
|
+
var actionsColumnSummaryCellRenderer = (props) => null;
|
|
1119
|
+
var detailColumnCellSummaryRenderer = (props) => null;
|
|
1120
|
+
|
|
1121
|
+
// src/components/grid/renderers/cellRenderers.tsx
|
|
1122
|
+
|
|
1123
|
+
var _KeyboardArrowDown = require('@mui/icons-material/KeyboardArrowDown'); var _KeyboardArrowDown2 = _interopRequireDefault(_KeyboardArrowDown);
|
|
1124
|
+
var _KeyboardArrowUp = require('@mui/icons-material/KeyboardArrowUp'); var _KeyboardArrowUp2 = _interopRequireDefault(_KeyboardArrowUp);
|
|
1125
|
+
var _Delete = require('@mui/icons-material/Delete'); var _Delete2 = _interopRequireDefault(_Delete);
|
|
1126
|
+
|
|
1127
|
+
// src/components/grid/ExampleClientSideComponent.tsx
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
|
|
1131
|
+
const value = row[column.key];
|
|
1132
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: {
|
|
1133
|
+
padding: 0.5,
|
|
1134
|
+
width: "100%",
|
|
1135
|
+
height: "100%",
|
|
1136
|
+
display: "flex",
|
|
1137
|
+
alignItems: "center",
|
|
1138
|
+
backgroundColor: value === "Special" ? "lightblue" : "transparent"
|
|
1139
|
+
}, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", sx: { fontWeight: "bold" }, children: value ? `CS: ${value}` : "N/A" }) });
|
|
1140
|
+
};
|
|
1141
|
+
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1142
|
+
|
|
1143
|
+
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1144
|
+
|
|
1145
|
+
var _WarningAmber = require('@mui/icons-material/WarningAmber'); var _WarningAmber2 = _interopRequireDefault(_WarningAmber);
|
|
1146
|
+
|
|
1147
|
+
var FallbackClientSideRenderer = ({ column, row, fieldDefinition }) => {
|
|
1148
|
+
const value = row[column.key];
|
|
1149
|
+
const clientSideName = _optionalChain([fieldDefinition, 'optionalAccess', _5 => _5.clientSide]) || "Desconocido";
|
|
1150
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: `Componente clientSide '${clientSideName}' no implementado. Mostrando valor por defecto.`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1151
|
+
_material.Box,
|
|
1152
|
+
{
|
|
1153
|
+
sx: {
|
|
1154
|
+
display: "flex",
|
|
1155
|
+
alignItems: "center",
|
|
1156
|
+
justifyContent: "space-between",
|
|
1157
|
+
// Para espaciar el valor y el icono
|
|
1158
|
+
gap: 1,
|
|
1159
|
+
// Espacio entre elementos
|
|
1160
|
+
width: "100%",
|
|
1161
|
+
height: "100%",
|
|
1162
|
+
paddingLeft: "8px",
|
|
1163
|
+
backgroundColor: "rgba(255, 193, 7, 0.1)",
|
|
1164
|
+
// Amarillo claro para advertencia
|
|
1165
|
+
border: "1px dashed rgba(255, 193, 7, 0.5)",
|
|
1166
|
+
boxSizing: "border-box",
|
|
1167
|
+
overflow: "hidden"
|
|
1168
|
+
// Evita que el contenido se desborde
|
|
1169
|
+
},
|
|
1170
|
+
children: [
|
|
1171
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", noWrap: true, sx: { flexGrow: 1 }, children: value !== null && value !== void 0 ? String(value) : "*Vac\xEDo*" }),
|
|
1172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1173
|
+
_WarningAmber2.default,
|
|
1174
|
+
{
|
|
1175
|
+
sx: {
|
|
1176
|
+
fontSize: 18,
|
|
1177
|
+
color: "warning.main",
|
|
1178
|
+
marginRight: "4px"
|
|
1179
|
+
// Pequeño margen a la derecha del icono
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
]
|
|
1184
|
+
}
|
|
1185
|
+
) });
|
|
1186
|
+
};
|
|
1187
|
+
var FallbackClientSideRenderer_default = FallbackClientSideRenderer;
|
|
1188
|
+
|
|
1189
|
+
// src/components/grid/clientSides.ts
|
|
1190
|
+
var clientSides = {
|
|
1191
|
+
"ExampleClientSideComponent": ExampleClientSideComponent_default,
|
|
1192
|
+
// Aseguramos el tipo aquí también
|
|
1193
|
+
"FallbackClientSideRenderer": FallbackClientSideRenderer_default
|
|
1194
|
+
// Y aquí
|
|
1195
|
+
};
|
|
1196
|
+
var extendClientSides = (newRenderers) => {
|
|
1197
|
+
clientSides = exports.clientSides = { ...clientSides, ...newRenderers };
|
|
1198
|
+
console.log("clientSides extendidos:", clientSides);
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
// src/components/grid/renderers/cellRenderers.tsx
|
|
1202
|
+
|
|
1203
|
+
var allColumnsCellRenderer = (props) => {
|
|
1204
|
+
const theme = _material.useTheme.call(void 0, );
|
|
1205
|
+
const column = props.column;
|
|
1206
|
+
const { row, rowIdx } = props;
|
|
1207
|
+
if (row[DETAIL_ROW_INDICATOR]) {
|
|
1208
|
+
const detailTableAbr = row[DETAIL_ROW_INDICATOR];
|
|
1209
|
+
const detailColumn = column;
|
|
1210
|
+
if (column.customType === "detail" && detailColumn.detailTable.abr === detailTableAbr) {
|
|
1211
|
+
const detailTable = detailColumn.tableDefinition.detailTables.find((dt) => dt.abr === detailTableAbr);
|
|
1212
|
+
let fixedFields = [];
|
|
1213
|
+
detailTable.fields.forEach((field) => {
|
|
1214
|
+
if (typeof field === "string") {
|
|
1215
|
+
fixedFields.push({ fieldName: field, value: row[field] });
|
|
1216
|
+
} else {
|
|
1217
|
+
fixedFields.push({ fieldName: field.target, value: row[field.source] });
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: {
|
|
1221
|
+
// Se eliminó el padding para que la sub-grilla se extienda por completo
|
|
1222
|
+
minHeight: "200px",
|
|
1223
|
+
width: "100%",
|
|
1224
|
+
height: "100%",
|
|
1225
|
+
//display: 'flex',
|
|
1226
|
+
//flexDirection: 'column',
|
|
1227
|
+
boxSizing: "border-box"
|
|
1228
|
+
}, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GenericDataGrid_default, { tableName: detailTable.table, fixedFields }) });
|
|
1229
|
+
}
|
|
1230
|
+
return void 0;
|
|
1231
|
+
}
|
|
1232
|
+
switch (column.customType) {
|
|
1233
|
+
case "default": {
|
|
1234
|
+
const defaultColumn = column;
|
|
1235
|
+
const { fieldDef, tableDefinition, primaryKey, cellFeedback, fixedFields, localCellChanges } = defaultColumn;
|
|
1236
|
+
const rowId = getPrimaryKeyValues(row, primaryKey);
|
|
1237
|
+
if (_optionalChain([fieldDef, 'optionalAccess', _6 => _6.clientSide])) {
|
|
1238
|
+
const ClientSideComponent = clientSides[fieldDef.clientSide];
|
|
1239
|
+
if (ClientSideComponent) {
|
|
1240
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ClientSideComponent, { ...props, fieldDefinition: fieldDef, tableDefinition, primaryKey });
|
|
1241
|
+
}
|
|
1242
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FallbackClientSideRenderer_default, { ...props, fieldDefinition: fieldDef, tableDefinition, primaryKey });
|
|
1243
|
+
}
|
|
1244
|
+
let cellBackgroundColor = "transparent";
|
|
1245
|
+
if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
|
|
1246
|
+
cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
|
|
1247
|
+
} else {
|
|
1248
|
+
const isNewRowLocalCheck = row[NEW_ROW_INDICATOR];
|
|
1249
|
+
const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || _optionalChain([tableDefinition, 'access', _7 => _7.fields, 'access', _8 => _8.find, 'call', _9 => _9((f) => f.name === props.column.key), 'optionalAccess', _10 => _10.nullable]) === false;
|
|
1250
|
+
const hasValue = row[props.column.key] !== null && row[props.column.key] !== void 0 && String(row[props.column.key]).trim() !== "";
|
|
1251
|
+
const isFixedFieldCurrent = _optionalChain([fixedFields, 'optionalAccess', _11 => _11.some, 'call', _12 => _12((f) => f.fieldName === props.column.key)]);
|
|
1252
|
+
if (isFixedFieldCurrent) {
|
|
1253
|
+
cellBackgroundColor = theme.palette.action.selected;
|
|
1254
|
+
} else if (isNewRowLocalCheck && isMandatory && !hasValue || localCellChanges.has(rowId) && _optionalChain([localCellChanges, 'access', _13 => _13.get, 'call', _14 => _14(rowId), 'optionalAccess', _15 => _15.has, 'call', _16 => _16(props.column.key)])) {
|
|
1255
|
+
cellBackgroundColor = theme.palette.info.light;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
const value = row[props.column.key];
|
|
1259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", backgroundColor: cellBackgroundColor, transition: "background-color 0.3s ease-in-out", display: "flex", alignItems: "center", paddingLeft: "8px", boxSizing: "border-box" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", sx: { fontSize: "0.875rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", width: "100%" }, children: value === null || value === void 0 ? "" : String(value) }) });
|
|
1260
|
+
}
|
|
1261
|
+
case "detail": {
|
|
1262
|
+
const detailColumn = column;
|
|
1263
|
+
const { detailTable, primaryKey, tableData, setTableData, detailKey } = detailColumn;
|
|
1264
|
+
const isExpanded = tableData.some(
|
|
1265
|
+
(r) => r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey)
|
|
1266
|
+
);
|
|
1267
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: detailTable.label, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1268
|
+
_material.IconButton,
|
|
1269
|
+
{
|
|
1270
|
+
size: "small",
|
|
1271
|
+
onClick: (event) => {
|
|
1272
|
+
let rows = [...tableData];
|
|
1273
|
+
const rowId = getPrimaryKeyValues({ ...row, [DETAIL_ROW_INDICATOR]: detailTable.abr }, primaryKey);
|
|
1274
|
+
if (isExpanded) {
|
|
1275
|
+
setTableData(rows.filter(
|
|
1276
|
+
(r) => !(r[DETAIL_ROW_INDICATOR] === detailTable.abr && getPrimaryKeyValues(r, primaryKey) === rowId)
|
|
1277
|
+
));
|
|
1278
|
+
} else {
|
|
1279
|
+
const parentRowIndex = rowIdx;
|
|
1280
|
+
rows.splice(parentRowIndex + 1, 0, {
|
|
1281
|
+
...row,
|
|
1282
|
+
[DETAIL_ROW_INDICATOR]: detailTable.abr
|
|
1283
|
+
});
|
|
1284
|
+
setTableData(rows);
|
|
1285
|
+
}
|
|
1286
|
+
event.stopPropagation();
|
|
1287
|
+
},
|
|
1288
|
+
title: isExpanded ? "Contraer detalle" : "Expandir detalle",
|
|
1289
|
+
sx: { p: 0.5 },
|
|
1290
|
+
children: isExpanded ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowUp2.default, { sx: { fontSize: 20 } }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KeyboardArrowDown2.default, { sx: { fontSize: 20 } })
|
|
1291
|
+
}
|
|
1292
|
+
) }) });
|
|
1293
|
+
}
|
|
1294
|
+
case "action": {
|
|
1295
|
+
const actionColumn = column;
|
|
1296
|
+
const { tableDefinition, handleDeleteRow } = actionColumn;
|
|
1297
|
+
if (!_optionalChain([tableDefinition, 'access', _17 => _17.allow, 'optionalAccess', _18 => _18.delete])) return void 0;
|
|
1298
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Button, { variant: "outlined", color: "error", size: "small", onClick: () => handleDeleteRow(row), title: "Eliminar fila", sx: { minWidth: 35, height: 30, p: 0.5, "& .MuiButton-startIcon": { m: 0 } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Delete2.default, { sx: { fontSize: 18 } }) }) });
|
|
1299
|
+
}
|
|
1300
|
+
default:
|
|
1301
|
+
return void 0;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
// src/components/grid/InputRenderer.tsx
|
|
1122
1306
|
|
|
1123
1307
|
var _InputBase = require('@mui/material/InputBase'); var _InputBase2 = _interopRequireDefault(_InputBase);
|
|
1124
1308
|
|
|
@@ -1140,7 +1324,7 @@ function InputRenderer({
|
|
|
1140
1324
|
const [editingValue, setEditingValue] = _react.useState.call(void 0, row[column.key]);
|
|
1141
1325
|
const { showSuccess, showError } = useSnackbar();
|
|
1142
1326
|
const initialRowId = _react.useMemo.call(void 0, () => getPrimaryKeyValues(row, primaryKey), [row, primaryKey]);
|
|
1143
|
-
const { callApi
|
|
1327
|
+
const { callApi } = useApiCall();
|
|
1144
1328
|
const handleCommit = _react.useCallback.call(void 0, async (currentValue, closeEditor, focusNextCell) => {
|
|
1145
1329
|
const processedNewValue = typeof currentValue === "string" ? currentValue.trim() === "" ? null : currentValue.trim() : currentValue;
|
|
1146
1330
|
const potentialUpdatedRow = { ...row, [column.key]: processedNewValue };
|
|
@@ -1148,7 +1332,7 @@ function InputRenderer({
|
|
|
1148
1332
|
(key) => potentialUpdatedRow[key] !== void 0 && potentialUpdatedRow[key] !== null && String(potentialUpdatedRow[key]).trim() !== ""
|
|
1149
1333
|
);
|
|
1150
1334
|
const isNewRow = !arePKValuesFilled || potentialUpdatedRow[NEW_ROW_INDICATOR];
|
|
1151
|
-
const isMandatoryField = tableDefinition.primaryKey.includes(column.key) || _optionalChain([tableDefinition, 'access',
|
|
1335
|
+
const isMandatoryField = tableDefinition.primaryKey.includes(column.key) || _optionalChain([tableDefinition, 'access', _19 => _19.fields, 'access', _20 => _20.find, 'call', _21 => _21((f) => f.name === column.key), 'optionalAccess', _22 => _22.nullable]) === false;
|
|
1152
1336
|
const isMandatoryFieldEmpty = isNewRow && isMandatoryField && (processedNewValue === null || processedNewValue === void 0 || String(processedNewValue).trim() === "");
|
|
1153
1337
|
if (processedNewValue === row[column.key] && !isNewRow && !isMandatoryFieldEmpty) {
|
|
1154
1338
|
console.log("No se guard\xF3: el valor no cambi\xF3 (y no es una nueva fila o campo obligatorio vac\xEDo que se est\xE1 iniciando).");
|
|
@@ -1219,7 +1403,7 @@ function InputRenderer({
|
|
|
1219
1403
|
}
|
|
1220
1404
|
});
|
|
1221
1405
|
if (localCellChanges.has(initialRowId)) {
|
|
1222
|
-
_optionalChain([localCellChanges, 'access',
|
|
1406
|
+
_optionalChain([localCellChanges, 'access', _23 => _23.get, 'call', _24 => _24(initialRowId), 'optionalAccess', _25 => _25.forEach, 'call', _26 => _26((colKey) => {
|
|
1223
1407
|
if (!rowToSend.hasOwnProperty(colKey)) {
|
|
1224
1408
|
rowToSend[colKey] = potentialUpdatedRow[colKey];
|
|
1225
1409
|
}
|
|
@@ -1317,7 +1501,7 @@ function InputRenderer({
|
|
|
1317
1501
|
handleCommit(editingValue, true, false);
|
|
1318
1502
|
}, [handleCommit, editingValue]);
|
|
1319
1503
|
const fieldDefinition = tableDefinition.fields.find((f) => f.name === column.key);
|
|
1320
|
-
const isFieldEditable = _optionalChain([fieldDefinition, 'optionalAccess',
|
|
1504
|
+
const isFieldEditable = _optionalChain([fieldDefinition, 'optionalAccess', _27 => _27.editable]) !== false;
|
|
1321
1505
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
1506
|
_InputBase2.default,
|
|
1323
1507
|
{
|
|
@@ -1341,90 +1525,65 @@ function InputRenderer({
|
|
|
1341
1525
|
}
|
|
1342
1526
|
);
|
|
1343
1527
|
}
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
// src/components/grid/ExampleClientSideComponent.tsx
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
var ExampleClientSideComponent = ({ row, column, fieldDefinition }) => {
|
|
1350
|
-
const value = row[column.key];
|
|
1351
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: {
|
|
1352
|
-
padding: 0.5,
|
|
1353
|
-
width: "100%",
|
|
1354
|
-
height: "100%",
|
|
1355
|
-
display: "flex",
|
|
1356
|
-
alignItems: "center",
|
|
1357
|
-
backgroundColor: value === "Special" ? "lightblue" : "transparent"
|
|
1358
|
-
}, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", sx: { fontWeight: "bold" }, children: value ? `CS: ${value}` : "N/A" }) });
|
|
1359
|
-
};
|
|
1360
|
-
var ExampleClientSideComponent_default = ExampleClientSideComponent;
|
|
1361
|
-
|
|
1362
|
-
// src/components/grid/FallbackClientSideRenderer.tsx
|
|
1528
|
+
var InputRenderer_default = InputRenderer;
|
|
1363
1529
|
|
|
1364
|
-
|
|
1530
|
+
// src/components/grid/renderers/editCellRenderers.tsx
|
|
1365
1531
|
|
|
1366
|
-
var
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
alignItems: "center",
|
|
1375
|
-
justifyContent: "space-between",
|
|
1376
|
-
// Para espaciar el valor y el icono
|
|
1377
|
-
gap: 1,
|
|
1378
|
-
// Espacio entre elementos
|
|
1379
|
-
width: "100%",
|
|
1380
|
-
height: "100%",
|
|
1381
|
-
paddingLeft: "8px",
|
|
1382
|
-
backgroundColor: "rgba(255, 193, 7, 0.1)",
|
|
1383
|
-
// Amarillo claro para advertencia
|
|
1384
|
-
border: "1px dashed rgba(255, 193, 7, 0.5)",
|
|
1385
|
-
boxSizing: "border-box",
|
|
1386
|
-
overflow: "hidden"
|
|
1387
|
-
// Evita que el contenido se desborde
|
|
1388
|
-
},
|
|
1389
|
-
children: [
|
|
1390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body2", noWrap: true, sx: { flexGrow: 1 }, children: value !== null && value !== void 0 ? String(value) : "*Vac\xEDo*" }),
|
|
1391
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
-
_WarningAmber2.default,
|
|
1393
|
-
{
|
|
1394
|
-
sx: {
|
|
1395
|
-
fontSize: 18,
|
|
1396
|
-
color: "warning.main",
|
|
1397
|
-
marginRight: "4px"
|
|
1398
|
-
// Pequeño margen a la derecha del icono
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
)
|
|
1402
|
-
]
|
|
1532
|
+
var defaultColumnEditCellRenderer = (props, tableDefinition, fixedFields, primaryKey, setCellFeedback, setTableData, localCellChanges, setLocalCellChanges, handleEnterKeyPressInEditor, allColumns) => {
|
|
1533
|
+
const { column } = props;
|
|
1534
|
+
if (column.editable) {
|
|
1535
|
+
const fieldDefinition = tableDefinition.fields.find((f) => f.name === column.key);
|
|
1536
|
+
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _28 => _28.some, 'call', _29 => _29((f) => f.fieldName === column.key)]);
|
|
1537
|
+
const isFieldEditableByUI = _optionalChain([fieldDefinition, 'optionalAccess', _30 => _30.editable]) !== false && !isFixedField;
|
|
1538
|
+
if (!isFieldEditableByUI) {
|
|
1539
|
+
return void 0;
|
|
1403
1540
|
}
|
|
1404
|
-
|
|
1541
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1542
|
+
InputRenderer_default,
|
|
1543
|
+
{
|
|
1544
|
+
...props,
|
|
1545
|
+
tableDefinition,
|
|
1546
|
+
setCellFeedback,
|
|
1547
|
+
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1548
|
+
setTableData,
|
|
1549
|
+
setLocalCellChanges,
|
|
1550
|
+
localCellChanges,
|
|
1551
|
+
primaryKey
|
|
1552
|
+
}
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1405
1555
|
};
|
|
1406
|
-
var FallbackClientSideRenderer_default = FallbackClientSideRenderer;
|
|
1407
1556
|
|
|
1408
|
-
// src/components/grid/
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1557
|
+
// src/components/grid/renderers/emptyRowRenderer.tsx
|
|
1558
|
+
|
|
1559
|
+
function EmptyRowsRenderer() {
|
|
1560
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: {
|
|
1561
|
+
// Posicionamiento absoluto respecto a la pantalla
|
|
1562
|
+
position: "fixed",
|
|
1563
|
+
top: "50%",
|
|
1564
|
+
// Centrado verticalmente
|
|
1565
|
+
left: "50%",
|
|
1566
|
+
// Centrado horizontalmente
|
|
1567
|
+
transform: "translate(-50%, -50%)",
|
|
1568
|
+
// Ajuste para el 50% del tamaño del div
|
|
1569
|
+
// Estilos de visualización
|
|
1570
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
1571
|
+
border: "1px solid #ccc",
|
|
1572
|
+
borderRadius: "4px",
|
|
1573
|
+
padding: "16px 24px",
|
|
1574
|
+
boxShadow: "0 2px 10px rgba(0,0,0,0.1)"
|
|
1575
|
+
}, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { textAlign: "center" }, children: "No hay filas para mostrar" }) });
|
|
1576
|
+
}
|
|
1419
1577
|
|
|
1420
1578
|
// src/components/grid/GenericDataGrid.tsx
|
|
1421
1579
|
|
|
1422
1580
|
var getPrimaryKeyValues = (row, primaryKey) => {
|
|
1423
|
-
return primaryKey.map((key) => {
|
|
1581
|
+
return primaryKey.concat(DETAIL_ROW_INDICATOR).map((key) => {
|
|
1424
1582
|
return row[key] !== void 0 && row[key] !== null ? String(row[key]) : "NULL_OR_UNDEFINED";
|
|
1425
1583
|
}).join("|");
|
|
1426
1584
|
};
|
|
1427
|
-
var NEW_ROW_INDICATOR = "
|
|
1585
|
+
var NEW_ROW_INDICATOR = "$new";
|
|
1586
|
+
var DETAIL_ROW_INDICATOR = "$detail";
|
|
1428
1587
|
var GenericDataGrid = ({
|
|
1429
1588
|
tableName,
|
|
1430
1589
|
fixedFields
|
|
@@ -1444,6 +1603,8 @@ var GenericDataGrid = ({
|
|
|
1444
1603
|
const feedbackTimerRef = _react.useRef.call(void 0, null);
|
|
1445
1604
|
const dataGridRef = _react.useRef.call(void 0, null);
|
|
1446
1605
|
const { callApi, loading, error } = useApiCall();
|
|
1606
|
+
const getRowCount = () => tableData.filter((row) => !row[DETAIL_ROW_INDICATOR]).length;
|
|
1607
|
+
const getFilteredRowCount = () => filteredRows.filter((row) => !row[DETAIL_ROW_INDICATOR]).length;
|
|
1447
1608
|
_react.useEffect.call(void 0, () => {
|
|
1448
1609
|
setFilters({});
|
|
1449
1610
|
setIsFilterRowVisible(false);
|
|
@@ -1467,7 +1628,6 @@ var GenericDataGrid = ({
|
|
|
1467
1628
|
const data = await callApi("table_data", {
|
|
1468
1629
|
table: tableName,
|
|
1469
1630
|
fixedFields
|
|
1470
|
-
// Envía el array fixedFields directamente a la API
|
|
1471
1631
|
});
|
|
1472
1632
|
setTableData(data);
|
|
1473
1633
|
} catch (err) {
|
|
@@ -1484,7 +1644,7 @@ var GenericDataGrid = ({
|
|
|
1484
1644
|
if (feedbackTimerRef.current) {
|
|
1485
1645
|
clearTimeout(feedbackTimerRef.current);
|
|
1486
1646
|
}
|
|
1487
|
-
const timerDuration =
|
|
1647
|
+
const timerDuration = 3e3;
|
|
1488
1648
|
feedbackTimerRef.current = setTimeout(() => {
|
|
1489
1649
|
setCellFeedback(null);
|
|
1490
1650
|
}, timerDuration);
|
|
@@ -1638,37 +1798,25 @@ var GenericDataGrid = ({
|
|
|
1638
1798
|
const handleEnterKeyPressInEditor = _react.useCallback.call(void 0, (rowIndex, columnKey, currentColumns) => {
|
|
1639
1799
|
if (dataGridRef.current && tableDefinition) {
|
|
1640
1800
|
const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1801
|
+
const editableColumns = currentColumns.filter((col) => {
|
|
1802
|
+
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1803
|
+
return col.key !== "filterToggle" && col.key !== "deleteAction" && (_optionalChain([fieldDefinition, 'optionalAccess', _31 => _31.editable]) !== false && !_optionalChain([fieldDefinition, 'optionalAccess', _32 => _32.clientSide]));
|
|
1804
|
+
});
|
|
1805
|
+
if (currentColumnIndex !== -1 && editableColumns.length > 0) {
|
|
1806
|
+
const editableColumnKeys = editableColumns.map((col) => col.key);
|
|
1807
|
+
let currentEditableColumnIndex = editableColumnKeys.indexOf(columnKey);
|
|
1808
|
+
if (currentEditableColumnIndex !== -1) {
|
|
1809
|
+
let nextEditableColumnIndex = currentEditableColumnIndex + 1;
|
|
1810
|
+
let nextRowIndex = rowIndex;
|
|
1811
|
+
if (nextEditableColumnIndex >= editableColumns.length) {
|
|
1812
|
+
nextEditableColumnIndex = 0;
|
|
1648
1813
|
nextRowIndex++;
|
|
1649
1814
|
if (nextRowIndex >= filteredRows.length) {
|
|
1650
1815
|
nextRowIndex = 0;
|
|
1651
|
-
nextColumnIndex = 0;
|
|
1652
|
-
if (filteredRows.length === 0 || rowIndex === filteredRows.length - 1 && currentColumnIndex === currentColumns.length - 1) {
|
|
1653
|
-
foundNextTarget = true;
|
|
1654
|
-
break;
|
|
1655
|
-
}
|
|
1656
1816
|
}
|
|
1657
1817
|
}
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === nextColumn.key);
|
|
1661
|
-
const isEditableField = _optionalChain([fieldDefinition, 'optionalAccess', _13 => _13.editable]) !== false;
|
|
1662
|
-
if (nextColumn.key !== "filterToggle" && nextColumn.key !== "deleteAction" && isEditableField) {
|
|
1663
|
-
foundNextTarget = true;
|
|
1664
|
-
} else {
|
|
1665
|
-
nextColumnIndex++;
|
|
1666
|
-
}
|
|
1667
|
-
} else {
|
|
1668
|
-
nextColumnIndex++;
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
if (foundNextTarget) {
|
|
1818
|
+
const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
|
|
1819
|
+
const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
|
|
1672
1820
|
dataGridRef.current.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: false, scrollIntoView: true });
|
|
1673
1821
|
}
|
|
1674
1822
|
}
|
|
@@ -1677,186 +1825,87 @@ var GenericDataGrid = ({
|
|
|
1677
1825
|
const columns = _react.useMemo.call(void 0, () => {
|
|
1678
1826
|
if (!tableDefinition) return [];
|
|
1679
1827
|
const fieldsToShow = tableDefinition.fields.filter((field) => {
|
|
1680
|
-
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess',
|
|
1828
|
+
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess', _33 => _33.find, 'call', _34 => _34((f) => f.fieldName === field.name)]);
|
|
1681
1829
|
return !(fixedFieldEntry && fixedFieldEntry.until === void 0);
|
|
1682
1830
|
});
|
|
1683
|
-
const defaultColumns = fieldsToShow.map((
|
|
1684
|
-
const isFixedField = _optionalChain([fixedFields, 'optionalAccess',
|
|
1685
|
-
const isFieldEditable =
|
|
1831
|
+
const defaultColumns = fieldsToShow.map((fieldDef) => {
|
|
1832
|
+
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _35 => _35.some, 'call', _36 => _36((f) => f.fieldName === fieldDef.name)]);
|
|
1833
|
+
const isFieldEditable = fieldDef.editable !== false && !isFixedField;
|
|
1686
1834
|
return {
|
|
1687
|
-
key:
|
|
1688
|
-
|
|
1835
|
+
key: fieldDef.name,
|
|
1836
|
+
customType: "default",
|
|
1837
|
+
tableDefinition,
|
|
1838
|
+
fieldDef,
|
|
1839
|
+
cellFeedback,
|
|
1840
|
+
primaryKey,
|
|
1841
|
+
fixedFields,
|
|
1842
|
+
localCellChanges,
|
|
1843
|
+
name: fieldDef.label || cambiarGuionesBajosPorEspacios(fieldDef.name),
|
|
1689
1844
|
resizable: true,
|
|
1690
1845
|
sortable: true,
|
|
1846
|
+
//frozen: true,
|
|
1691
1847
|
editable: isFieldEditable,
|
|
1692
|
-
// Usar la nueva bandera de editable
|
|
1693
1848
|
flexGrow: 1,
|
|
1694
1849
|
minWidth: 60,
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
renderSummaryCell: ({ column }) => {
|
|
1698
|
-
const fixedFieldEntry = _optionalChain([fixedFields, 'optionalAccess', _18 => _18.find, 'call', _19 => _19((f) => f.fieldName === column.key)]);
|
|
1699
|
-
if (fixedFieldEntry && fixedFieldEntry.until === void 0) return null;
|
|
1700
|
-
return isFilterRowVisible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1701
|
-
FilterInputRender_default,
|
|
1702
|
-
{
|
|
1703
|
-
column,
|
|
1704
|
-
filters,
|
|
1705
|
-
setFilters
|
|
1706
|
-
}
|
|
1707
|
-
) : null;
|
|
1708
|
-
},
|
|
1709
|
-
renderCell: (props) => {
|
|
1710
|
-
const rowId = getPrimaryKeyValues(props.row, primaryKey);
|
|
1711
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === props.column.key);
|
|
1712
|
-
if (_optionalChain([fieldDefinition, 'optionalAccess', _20 => _20.clientSide])) {
|
|
1713
|
-
const ClientSideComponent = clientSides[fieldDefinition.clientSide];
|
|
1714
|
-
if (ClientSideComponent) {
|
|
1715
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1716
|
-
ClientSideComponent,
|
|
1717
|
-
{
|
|
1718
|
-
...props,
|
|
1719
|
-
fieldDefinition,
|
|
1720
|
-
tableDefinition,
|
|
1721
|
-
primaryKey
|
|
1722
|
-
}
|
|
1723
|
-
);
|
|
1724
|
-
} else {
|
|
1725
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1726
|
-
FallbackClientSideRenderer_default,
|
|
1727
|
-
{
|
|
1728
|
-
...props,
|
|
1729
|
-
fieldDefinition,
|
|
1730
|
-
tableDefinition,
|
|
1731
|
-
primaryKey
|
|
1732
|
-
}
|
|
1733
|
-
);
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
let cellBackgroundColor = "transparent";
|
|
1737
|
-
if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
|
|
1738
|
-
cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
|
|
1739
|
-
} else {
|
|
1740
|
-
const isNewRowLocalCheck = props.row[NEW_ROW_INDICATOR];
|
|
1741
|
-
const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || _optionalChain([tableDefinition, 'access', _21 => _21.fields, 'access', _22 => _22.find, 'call', _23 => _23((f) => f.name === props.column.key), 'optionalAccess', _24 => _24.nullable]) === false;
|
|
1742
|
-
const hasValue = props.row[props.column.key] !== null && props.row[props.column.key] !== void 0 && String(props.row[props.column.key]).trim() !== "";
|
|
1743
|
-
const isFixedFieldCurrent = _optionalChain([fixedFields, 'optionalAccess', _25 => _25.some, 'call', _26 => _26((f) => f.fieldName === props.column.key)]);
|
|
1744
|
-
if (isFixedFieldCurrent) {
|
|
1745
|
-
cellBackgroundColor = theme.palette.action.selected;
|
|
1746
|
-
} else if (isNewRowLocalCheck && isMandatory && !hasValue || localCellChanges.has(rowId) && _optionalChain([localCellChanges, 'access', _27 => _27.get, 'call', _28 => _28(rowId), 'optionalAccess', _29 => _29.has, 'call', _30 => _30(props.column.key)])) {
|
|
1747
|
-
cellBackgroundColor = theme.palette.info.light;
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1751
|
-
_material.Box,
|
|
1752
|
-
{
|
|
1753
|
-
sx: {
|
|
1754
|
-
position: "absolute",
|
|
1755
|
-
top: 0,
|
|
1756
|
-
left: 0,
|
|
1757
|
-
width: "100%",
|
|
1758
|
-
height: "100%",
|
|
1759
|
-
backgroundColor: cellBackgroundColor,
|
|
1760
|
-
transition: "background-color 0.3s ease-in-out",
|
|
1761
|
-
display: "flex",
|
|
1762
|
-
alignItems: "center",
|
|
1763
|
-
paddingLeft: "8px",
|
|
1764
|
-
boxSizing: "border-box"
|
|
1765
|
-
},
|
|
1766
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1767
|
-
PkCellRenderer_default,
|
|
1768
|
-
{
|
|
1769
|
-
...props,
|
|
1770
|
-
column: { ...props.column, isPK: !!field.isPk }
|
|
1771
|
-
}
|
|
1772
|
-
)
|
|
1773
|
-
}
|
|
1774
|
-
);
|
|
1775
|
-
}
|
|
1850
|
+
renderHeaderCell: (props) => defaultColumnHeaderCellRenderer(props, fieldDef),
|
|
1851
|
+
renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields, isFilterRowVisible, filters, setFilters)
|
|
1776
1852
|
};
|
|
1777
1853
|
});
|
|
1778
|
-
const
|
|
1854
|
+
const actionsColumn = {
|
|
1779
1855
|
key: "filterToggle",
|
|
1780
|
-
|
|
1856
|
+
customType: "action",
|
|
1857
|
+
tableDefinition,
|
|
1858
|
+
handleDeleteRow,
|
|
1859
|
+
name: "filterCol",
|
|
1781
1860
|
width: 50,
|
|
1782
1861
|
resizable: false,
|
|
1783
1862
|
sortable: false,
|
|
1784
|
-
frozen: true,
|
|
1785
|
-
renderHeaderCell: () =>
|
|
1786
|
-
|
|
1787
|
-
{
|
|
1788
|
-
color: "inherit",
|
|
1789
|
-
onClick: toggleFilterVisibility,
|
|
1790
|
-
size: "small",
|
|
1791
|
-
title: isFilterRowVisible ? "Ocultar filtros" : "Mostrar filtros",
|
|
1792
|
-
sx: { p: 0.5 },
|
|
1793
|
-
children: isFilterRowVisible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SearchOff2.default, { sx: { fontSize: 20 } }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Search2.default, { sx: { fontSize: 20 } })
|
|
1794
|
-
}
|
|
1795
|
-
),
|
|
1796
|
-
renderSummaryCell: () => null
|
|
1863
|
+
//frozen: true,
|
|
1864
|
+
renderHeaderCell: (props) => actionsColumnHeaderCellRenderer(props, isFilterRowVisible, toggleFilterVisibility),
|
|
1865
|
+
renderSummaryCell: (props) => actionsColumnSummaryCellRenderer(props)
|
|
1797
1866
|
};
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1867
|
+
const detailColumns = [];
|
|
1868
|
+
if (tableDefinition.detailTables && tableDefinition.detailTables.length > 0) {
|
|
1869
|
+
tableDefinition.detailTables.forEach((detailTable) => {
|
|
1870
|
+
const detailKey = `detail_${detailTable.abr}`;
|
|
1871
|
+
detailColumns.push({
|
|
1872
|
+
key: detailKey,
|
|
1873
|
+
customType: "detail",
|
|
1874
|
+
tableDefinition,
|
|
1875
|
+
detailTable,
|
|
1876
|
+
primaryKey,
|
|
1877
|
+
tableData,
|
|
1878
|
+
setTableData,
|
|
1879
|
+
detailKey,
|
|
1880
|
+
name: detailTable.label || `Detalle ${detailTable.abr}`,
|
|
1881
|
+
resizable: false,
|
|
1882
|
+
sortable: false,
|
|
1883
|
+
width: 50,
|
|
1884
|
+
//frozen: true,
|
|
1885
|
+
renderHeaderCell: (props) => detailColumnCellHeaderRenderer(props, detailTable),
|
|
1886
|
+
renderSummaryCell: (props) => detailColumnCellSummaryRenderer(props)
|
|
1887
|
+
});
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
const allColumns = [
|
|
1891
|
+
actionsColumn,
|
|
1892
|
+
...detailColumns,
|
|
1893
|
+
...defaultColumns
|
|
1894
|
+
];
|
|
1895
|
+
return allColumns.map((col) => ({
|
|
1896
|
+
...col,
|
|
1897
|
+
colSpan: (args) => {
|
|
1898
|
+
if (args.type === "ROW") {
|
|
1899
|
+
const detailTableAbr = args.row[DETAIL_ROW_INDICATOR];
|
|
1900
|
+
if (col.key === `detail_${detailTableAbr}`) {
|
|
1901
|
+
return allColumns.length;
|
|
1826
1902
|
}
|
|
1827
|
-
) });
|
|
1828
|
-
}
|
|
1829
|
-
};
|
|
1830
|
-
const allColumns = [filterToggleColumn, deleteActionColumn, ...defaultColumns];
|
|
1831
|
-
return allColumns.map((col) => {
|
|
1832
|
-
if (col.editable) {
|
|
1833
|
-
const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
|
|
1834
|
-
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _33 => _33.some, 'call', _34 => _34((f) => f.fieldName === col.key)]);
|
|
1835
|
-
const isFieldEditableByUI = _optionalChain([fieldDefinition, 'optionalAccess', _35 => _35.editable]) !== false && !isFixedField;
|
|
1836
|
-
if (!isFieldEditableByUI) {
|
|
1837
|
-
return { ...col, renderEditCell: void 0 };
|
|
1838
1903
|
}
|
|
1839
|
-
return
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
{
|
|
1845
|
-
...props,
|
|
1846
|
-
tableDefinition,
|
|
1847
|
-
setCellFeedback,
|
|
1848
|
-
onEnterPress: (rowIndex, columnKey) => handleEnterKeyPressInEditor(rowIndex, columnKey, allColumns),
|
|
1849
|
-
setTableData,
|
|
1850
|
-
setLocalCellChanges,
|
|
1851
|
-
localCellChanges,
|
|
1852
|
-
primaryKey
|
|
1853
|
-
}
|
|
1854
|
-
);
|
|
1855
|
-
}
|
|
1856
|
-
};
|
|
1857
|
-
}
|
|
1858
|
-
return col;
|
|
1859
|
-
});
|
|
1904
|
+
return void 0;
|
|
1905
|
+
},
|
|
1906
|
+
renderEditCell: (props) => defaultColumnEditCellRenderer(props, tableDefinition, fixedFields, primaryKey, setCellFeedback, setTableData, localCellChanges, setLocalCellChanges, handleEnterKeyPressInEditor, allColumns),
|
|
1907
|
+
renderCell: (props) => allColumnsCellRenderer(props)
|
|
1908
|
+
}));
|
|
1860
1909
|
}, [
|
|
1861
1910
|
tableDefinition,
|
|
1862
1911
|
isFilterRowVisible,
|
|
@@ -1868,22 +1917,20 @@ var GenericDataGrid = ({
|
|
|
1868
1917
|
theme.palette.error.light,
|
|
1869
1918
|
theme.palette.info.light,
|
|
1870
1919
|
theme.palette.action.selected,
|
|
1871
|
-
// Añade el color de campos fijos
|
|
1872
1920
|
handleEnterKeyPressInEditor,
|
|
1873
1921
|
setTableData,
|
|
1874
1922
|
localCellChanges,
|
|
1875
1923
|
handleDeleteRow,
|
|
1876
|
-
fixedFields
|
|
1877
|
-
|
|
1924
|
+
fixedFields,
|
|
1925
|
+
tableData
|
|
1878
1926
|
]);
|
|
1879
|
-
const showNoRowsMessage = filteredRows.length === 0 && !loading && !error;
|
|
1880
1927
|
const handleRowsChange = _react.useCallback.call(void 0, (updatedRows) => {
|
|
1881
1928
|
setTableData(updatedRows);
|
|
1882
1929
|
}, []);
|
|
1883
1930
|
const handleCellClick = _react.useCallback.call(void 0, (args) => {
|
|
1884
|
-
const fieldDefinition = _optionalChain([tableDefinition, 'optionalAccess',
|
|
1885
|
-
const isFixedField = _optionalChain([fixedFields, 'optionalAccess',
|
|
1886
|
-
const isEditable = _optionalChain([fieldDefinition, 'optionalAccess',
|
|
1931
|
+
const fieldDefinition = _optionalChain([tableDefinition, 'optionalAccess', _37 => _37.fields, 'access', _38 => _38.find, 'call', _39 => _39((f) => f.name === args.column.key)]);
|
|
1932
|
+
const isFixedField = _optionalChain([fixedFields, 'optionalAccess', _40 => _40.some, 'call', _41 => _41((f) => f.fieldName === args.column.key)]);
|
|
1933
|
+
const isEditable = _optionalChain([fieldDefinition, 'optionalAccess', _42 => _42.editable]) !== false && !isFixedField;
|
|
1887
1934
|
console.log("Clicked column index:", args.column.idx);
|
|
1888
1935
|
console.log("Clicked row index:", args.rowIdx);
|
|
1889
1936
|
console.log("Is editable:", isEditable);
|
|
@@ -1900,9 +1947,8 @@ var GenericDataGrid = ({
|
|
|
1900
1947
|
if (!tableDefinition) {
|
|
1901
1948
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Alert, { severity: "warning", children: "No se pudo cargar la definici\xF3n de la tabla." }) });
|
|
1902
1949
|
}
|
|
1903
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: {
|
|
1904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex",
|
|
1905
|
-
_optionalChain([tableDefinition, 'access', _42 => _42.allow, 'optionalAccess', _43 => _43.insert]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", px: 2 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1950
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { pt: 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box" }, children: [
|
|
1951
|
+
_optionalChain([tableDefinition, 'access', _43 => _43.allow, 'optionalAccess', _44 => _44.insert]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { display: "flex", px: 2, pb: 1 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1906
1952
|
_material.Button,
|
|
1907
1953
|
{
|
|
1908
1954
|
variant: "contained",
|
|
@@ -1911,19 +1957,33 @@ var GenericDataGrid = ({
|
|
|
1911
1957
|
children: "Nuevo Registro"
|
|
1912
1958
|
}
|
|
1913
1959
|
) }),
|
|
1914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1915
|
-
"mostrando ",
|
|
1916
|
-
`${tableData.length} registros`
|
|
1917
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { children: [
|
|
1918
|
-
"mostrando ",
|
|
1919
|
-
`${filteredRows.length} registros filtrados`
|
|
1920
|
-
] }) }) }),
|
|
1921
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1960
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1922
1961
|
_material.Box,
|
|
1923
1962
|
{
|
|
1924
1963
|
sx: {
|
|
1925
|
-
|
|
1926
|
-
|
|
1964
|
+
backgroundColor: theme.palette.primary.main,
|
|
1965
|
+
color: theme.palette.primary.contrastText,
|
|
1966
|
+
padding: theme.spacing(1),
|
|
1967
|
+
textAlign: "left",
|
|
1968
|
+
fontWeight: "bold",
|
|
1969
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
1970
|
+
borderTopLeftRadius: theme.shape.borderRadius,
|
|
1971
|
+
borderTopRightRadius: theme.shape.borderRadius,
|
|
1972
|
+
ml: 2,
|
|
1973
|
+
mr: 2
|
|
1974
|
+
},
|
|
1975
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Typography, { variant: "subtitle1", component: "div", children: [
|
|
1976
|
+
cambiarGuionesBajosPorEspacios(tableDefinition.title || tableDefinition.name),
|
|
1977
|
+
" - mostrando ",
|
|
1978
|
+
getFilteredRowCount() === getRowCount() ? `${getRowCount()} registros` : `${getFilteredRowCount()} registros filtrados`
|
|
1979
|
+
] })
|
|
1980
|
+
}
|
|
1981
|
+
),
|
|
1982
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1983
|
+
_material.Box,
|
|
1984
|
+
{
|
|
1985
|
+
sx: {
|
|
1986
|
+
flexGrow: 1,
|
|
1927
1987
|
boxSizing: "border-box",
|
|
1928
1988
|
position: "relative",
|
|
1929
1989
|
overflowX: "auto",
|
|
@@ -1931,51 +1991,29 @@ var GenericDataGrid = ({
|
|
|
1931
1991
|
px: 2,
|
|
1932
1992
|
pb: 2
|
|
1933
1993
|
},
|
|
1934
|
-
children:
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
showNoRowsMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1958
|
-
_material.Box,
|
|
1959
|
-
{
|
|
1960
|
-
sx: {
|
|
1961
|
-
position: "absolute",
|
|
1962
|
-
top: isFilterRowVisible ? "70px" : "36px",
|
|
1963
|
-
left: (theme2) => theme2.spacing(2),
|
|
1964
|
-
right: (theme2) => theme2.spacing(2),
|
|
1965
|
-
bottom: (theme2) => theme2.spacing(2),
|
|
1966
|
-
display: "flex",
|
|
1967
|
-
justifyContent: "center",
|
|
1968
|
-
alignItems: "center",
|
|
1969
|
-
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
1970
|
-
color: (theme2) => theme2.palette.text.secondary,
|
|
1971
|
-
border: (theme2) => `1px solid ${theme2.palette.divider}`,
|
|
1972
|
-
borderRadius: "4px",
|
|
1973
|
-
zIndex: 1
|
|
1974
|
-
},
|
|
1975
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "h6", children: "No hay filas para mostrar." })
|
|
1976
|
-
}
|
|
1977
|
-
)
|
|
1978
|
-
]
|
|
1994
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1995
|
+
_reactdatagrid.DataGrid,
|
|
1996
|
+
{
|
|
1997
|
+
ref: dataGridRef,
|
|
1998
|
+
columns,
|
|
1999
|
+
rows: filteredRows.map((row) => ({
|
|
2000
|
+
...row,
|
|
2001
|
+
style: exitingRowIds.has(getPrimaryKeyValues(row, primaryKey)) ? { maxHeight: 0, opacity: 0, overflow: "hidden" } : { maxHeight: "35px", opacity: 1 }
|
|
2002
|
+
})),
|
|
2003
|
+
enableVirtualization: true,
|
|
2004
|
+
rowKeyGetter: (row) => getPrimaryKeyValues(row, primaryKey),
|
|
2005
|
+
onSelectedRowsChange: setSelectedRows,
|
|
2006
|
+
onRowsChange: handleRowsChange,
|
|
2007
|
+
selectedRows,
|
|
2008
|
+
rowHeight: (row) => row[DETAIL_ROW_INDICATOR] ? 400 : 35,
|
|
2009
|
+
style: { height: "100%", width: "100%", boxSizing: "border-box" },
|
|
2010
|
+
headerRowHeight: 35,
|
|
2011
|
+
topSummaryRows: isFilterRowVisible ? [{ id: "filterRow" }] : void 0,
|
|
2012
|
+
summaryRowHeight: isFilterRowVisible ? 35 : 0,
|
|
2013
|
+
onCellClick: handleCellClick,
|
|
2014
|
+
renderers: { noRowsFallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmptyRowsRenderer, {}) }
|
|
2015
|
+
}
|
|
2016
|
+
)
|
|
1979
2017
|
}
|
|
1980
2018
|
),
|
|
1981
2019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2512,7 +2550,7 @@ var SessionExpiredMessage_default = SessionExpiredMessage;
|
|
|
2512
2550
|
var HomePage = () => {
|
|
2513
2551
|
const { clientContext } = useApp();
|
|
2514
2552
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { p: 3 }, children: [
|
|
2515
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${_optionalChain([clientContext, 'optionalAccess',
|
|
2553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${_optionalChain([clientContext, 'optionalAccess', _45 => _45.username])}` }),
|
|
2516
2554
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
|
|
2517
2555
|
] });
|
|
2518
2556
|
};
|
|
@@ -2641,7 +2679,7 @@ var LoginPage = () => {
|
|
|
2641
2679
|
fullWidth: true,
|
|
2642
2680
|
margin: "normal",
|
|
2643
2681
|
error: !!errors.username,
|
|
2644
|
-
helperText: _optionalChain([errors, 'access',
|
|
2682
|
+
helperText: _optionalChain([errors, 'access', _46 => _46.username, 'optionalAccess', _47 => _47.message]),
|
|
2645
2683
|
disabled: isSubmitting
|
|
2646
2684
|
}
|
|
2647
2685
|
)
|
|
@@ -2664,7 +2702,7 @@ var LoginPage = () => {
|
|
|
2664
2702
|
fullWidth: true,
|
|
2665
2703
|
margin: "normal",
|
|
2666
2704
|
error: !!errors.password,
|
|
2667
|
-
helperText: _optionalChain([errors, 'access',
|
|
2705
|
+
helperText: _optionalChain([errors, 'access', _48 => _48.password, 'optionalAccess', _49 => _49.message]),
|
|
2668
2706
|
disabled: isSubmitting
|
|
2669
2707
|
}
|
|
2670
2708
|
)
|
|
@@ -2742,7 +2780,7 @@ var ProcedureForm = () => {
|
|
|
2742
2780
|
const [executionLog, setExecutionLog] = _react.useState.call(void 0, []);
|
|
2743
2781
|
const [procedureResultData, setProcedureResultData] = _react.useState.call(void 0, null);
|
|
2744
2782
|
const procedure = _react.useMemo.call(void 0, () => {
|
|
2745
|
-
if (procedureName && _optionalChain([clientContext, 'optionalAccess',
|
|
2783
|
+
if (procedureName && _optionalChain([clientContext, 'optionalAccess', _50 => _50.procedure])) {
|
|
2746
2784
|
return clientContext.procedure[procedureName];
|
|
2747
2785
|
}
|
|
2748
2786
|
return void 0;
|
|
@@ -3033,7 +3071,7 @@ var ProcedureForm = () => {
|
|
|
3033
3071
|
}
|
|
3034
3072
|
}, [formValues, handleChange, apiLoading, validationErrors]);
|
|
3035
3073
|
const ResultDisplayContent = _react.useMemo.call(void 0, () => {
|
|
3036
|
-
if (!procedureResultData || !_optionalChain([procedure, 'optionalAccess',
|
|
3074
|
+
if (!procedureResultData || !_optionalChain([procedure, 'optionalAccess', _51 => _51.resultOk])) return null;
|
|
3037
3075
|
const ComponentToRender = resultsOk[procedure.resultOk];
|
|
3038
3076
|
if (ComponentToRender) {
|
|
3039
3077
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ComponentToRender, { data: procedureResultData });
|