componentes-sinco 1.0.7 → 1.0.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/Icon Scheduler-WX62PISD.svg +17 -0
- package/dist/index.cjs +903 -376
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -12
- package/dist/index.d.ts +36 -12
- package/dist/index.js +891 -365
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -79,6 +79,7 @@ __export(src_exports, {
|
|
|
79
79
|
SCTabs: () => SCTabs,
|
|
80
80
|
SCTextArea: () => SCTextArea,
|
|
81
81
|
SCTextField: () => SCTextField,
|
|
82
|
+
SCTime: () => SCTime,
|
|
82
83
|
SCToastNotification: () => SCToastNotification,
|
|
83
84
|
SincoTheme: () => SincoTheme,
|
|
84
85
|
ToastProgress: () => ToastProgress,
|
|
@@ -96,10 +97,12 @@ __export(src_exports, {
|
|
|
96
97
|
module.exports = __toCommonJS(src_exports);
|
|
97
98
|
|
|
98
99
|
// src/Components/Drawer/SCDrawer.tsx
|
|
99
|
-
var
|
|
100
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
100
101
|
var import_material7 = require("@mui/material");
|
|
101
102
|
var import_Grid23 = __toESM(require("@mui/material/Grid2"), 1);
|
|
102
103
|
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
104
|
+
var import_ArrowBackIos = __toESM(require("@mui/icons-material/ArrowBackIos"), 1);
|
|
105
|
+
var import_ArrowForwardIos = __toESM(require("@mui/icons-material/ArrowForwardIos"), 1);
|
|
103
106
|
|
|
104
107
|
// src/Components/Textfield/SCTextField.tsx
|
|
105
108
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -733,11 +736,9 @@ function SCSelect({
|
|
|
733
736
|
width = "100%",
|
|
734
737
|
size = "small",
|
|
735
738
|
variant = "outlined",
|
|
736
|
-
|
|
739
|
+
background = "white",
|
|
737
740
|
required,
|
|
738
741
|
disabled,
|
|
739
|
-
background,
|
|
740
|
-
fnAplicar,
|
|
741
742
|
setState,
|
|
742
743
|
state
|
|
743
744
|
}) {
|
|
@@ -812,14 +813,20 @@ function SCSelect({
|
|
|
812
813
|
MenuProps: {
|
|
813
814
|
PaperProps: {
|
|
814
815
|
sx: {
|
|
815
|
-
|
|
816
|
+
maxHeight: "300px",
|
|
817
|
+
minWidth: "100%"
|
|
816
818
|
}
|
|
817
819
|
},
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
anchorOrigin: {
|
|
821
|
+
vertical: "bottom",
|
|
822
|
+
horizontal: "left"
|
|
823
|
+
},
|
|
824
|
+
transformOrigin: {
|
|
825
|
+
vertical: "top",
|
|
826
|
+
horizontal: "left"
|
|
827
|
+
},
|
|
828
|
+
disableAutoFocusItem: true,
|
|
829
|
+
marginThreshold: 0
|
|
823
830
|
}
|
|
824
831
|
},
|
|
825
832
|
data.map((option, index) => {
|
|
@@ -851,7 +858,6 @@ function SCAutocomplete({
|
|
|
851
858
|
state,
|
|
852
859
|
inputChange,
|
|
853
860
|
maxCheck
|
|
854
|
-
// Agregar el parámetro maxCheck
|
|
855
861
|
}) {
|
|
856
862
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
857
863
|
let group = "";
|
|
@@ -945,6 +951,7 @@ function SCAutocomplete({
|
|
|
945
951
|
{
|
|
946
952
|
multiple: typeFormat === "multiselect",
|
|
947
953
|
clearOnEscape: true,
|
|
954
|
+
noOptionsText: "No se encuentra",
|
|
948
955
|
disabled,
|
|
949
956
|
options: data,
|
|
950
957
|
isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
|
|
@@ -1188,31 +1195,83 @@ var getIcon2 = (iconName) => {
|
|
|
1188
1195
|
};
|
|
1189
1196
|
|
|
1190
1197
|
// src/Components/Drawer/Helpers/validateInput.tsx
|
|
1191
|
-
var validateInputs = (arrayElements, onError, onSuccess) => {
|
|
1192
|
-
var _a;
|
|
1198
|
+
var validateInputs = (arrayElements, onError, onSuccess, setChipFilters, setTextFilters) => {
|
|
1199
|
+
var _a, _b;
|
|
1193
1200
|
let requiredValues = 0;
|
|
1194
1201
|
let filledValues = 0;
|
|
1195
1202
|
for (let i = 0; i < arrayElements.length; i++) {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1203
|
+
const element = arrayElements[i];
|
|
1204
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1205
|
+
const textValue = ((_a = typeElement.state) == null ? void 0 : _a.textValue) !== void 0 ? String((_b = typeElement.state) == null ? void 0 : _b.textValue) : String(typeElement.state);
|
|
1206
|
+
if (typeElement == null ? void 0 : typeElement.required) {
|
|
1207
|
+
requiredValues++;
|
|
1208
|
+
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1201
1209
|
filledValues++;
|
|
1202
1210
|
}
|
|
1203
1211
|
}
|
|
1204
1212
|
}
|
|
1205
1213
|
if (requiredValues === filledValues) {
|
|
1206
1214
|
onSuccess();
|
|
1215
|
+
setChipFilters(true);
|
|
1207
1216
|
} else {
|
|
1208
1217
|
onError({
|
|
1209
1218
|
type: "error",
|
|
1210
1219
|
title: "Algunos campos son requeridos",
|
|
1211
1220
|
time: 10
|
|
1212
1221
|
});
|
|
1222
|
+
setChipFilters(false);
|
|
1213
1223
|
}
|
|
1214
1224
|
};
|
|
1215
1225
|
|
|
1226
|
+
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
1227
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
1228
|
+
var validateTypeElements = (element) => {
|
|
1229
|
+
var _a;
|
|
1230
|
+
let validation = "";
|
|
1231
|
+
let typeElement = element;
|
|
1232
|
+
if (element.type == "textField") {
|
|
1233
|
+
validation = "textField";
|
|
1234
|
+
typeElement = element;
|
|
1235
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextField") {
|
|
1236
|
+
validation = "textField";
|
|
1237
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1238
|
+
} else if (element.type == "textArea") {
|
|
1239
|
+
validation = "textArea";
|
|
1240
|
+
typeElement = element;
|
|
1241
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextArea") {
|
|
1242
|
+
validation = "textArea";
|
|
1243
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1244
|
+
} else if (element.type == "dateRange") {
|
|
1245
|
+
validation = "dateRange";
|
|
1246
|
+
typeElement = element;
|
|
1247
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCDateRange") {
|
|
1248
|
+
validation = "dateRange";
|
|
1249
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1250
|
+
} else if (element.type == "autocomplete") {
|
|
1251
|
+
validation = "autocomplete";
|
|
1252
|
+
typeElement = element;
|
|
1253
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCAutocomplete") {
|
|
1254
|
+
validation = "autocomplete";
|
|
1255
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1256
|
+
} else if (element.typeFormat == "multiselect") {
|
|
1257
|
+
validation = "multiselect";
|
|
1258
|
+
typeElement = element;
|
|
1259
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_a = element == null ? void 0 : element.component) == null ? void 0 : _a.props).typeFormat == "multiselect") {
|
|
1260
|
+
validation = "multiselect";
|
|
1261
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1262
|
+
} else if (element.type == "select") {
|
|
1263
|
+
validation = "select";
|
|
1264
|
+
typeElement = element;
|
|
1265
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCSelect") {
|
|
1266
|
+
validation = "select";
|
|
1267
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1268
|
+
}
|
|
1269
|
+
return {
|
|
1270
|
+
validation,
|
|
1271
|
+
element: typeElement
|
|
1272
|
+
};
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1216
1275
|
// src/Components/Drawer/SCDrawer.tsx
|
|
1217
1276
|
function SCDrawer({
|
|
1218
1277
|
//informativas
|
|
@@ -1225,16 +1284,42 @@ function SCDrawer({
|
|
|
1225
1284
|
anchor = "left",
|
|
1226
1285
|
width,
|
|
1227
1286
|
//Funcionales
|
|
1228
|
-
open
|
|
1287
|
+
open,
|
|
1288
|
+
setOpen,
|
|
1289
|
+
chipFilters
|
|
1229
1290
|
}) {
|
|
1230
1291
|
var _a, _b;
|
|
1231
|
-
const
|
|
1232
|
-
const [
|
|
1292
|
+
const scrollRef = (0, import_react9.useRef)(null);
|
|
1293
|
+
const [drawerOpen, setDrawerOpen] = import_react9.default.useState(open);
|
|
1294
|
+
const [toast, setToast] = import_react9.default.useState(null);
|
|
1295
|
+
const [stateChipFilters, setChipFilters] = import_react9.default.useState(false);
|
|
1296
|
+
const [textFilters, setTextFilters] = import_react9.default.useState([]);
|
|
1297
|
+
(0, import_react9.useEffect)(() => {
|
|
1298
|
+
if (chipFilters != void 0) {
|
|
1299
|
+
if (chipFilters.length > 0) {
|
|
1300
|
+
setTextFilters([]);
|
|
1301
|
+
inputValidation();
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}, [chipFilters]);
|
|
1305
|
+
(0, import_react9.useEffect)(() => {
|
|
1306
|
+
if (open) {
|
|
1307
|
+
toggleDrawer(true);
|
|
1308
|
+
} else {
|
|
1309
|
+
handleDrawerClose();
|
|
1310
|
+
}
|
|
1311
|
+
}, [open]);
|
|
1233
1312
|
const handleDrawerClose = () => {
|
|
1234
1313
|
setDrawerOpen(false);
|
|
1314
|
+
if (setOpen) {
|
|
1315
|
+
setOpen(false);
|
|
1316
|
+
}
|
|
1235
1317
|
};
|
|
1236
1318
|
const toggleDrawer = (newOpen) => () => {
|
|
1237
1319
|
setDrawerOpen(newOpen);
|
|
1320
|
+
if (setOpen) {
|
|
1321
|
+
setOpen(true);
|
|
1322
|
+
}
|
|
1238
1323
|
};
|
|
1239
1324
|
const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
|
|
1240
1325
|
const setToastWithDelay = (toastContent) => {
|
|
@@ -1243,39 +1328,179 @@ function SCDrawer({
|
|
|
1243
1328
|
setToast(toastContent);
|
|
1244
1329
|
}, 10);
|
|
1245
1330
|
};
|
|
1246
|
-
const inputValidation = () =>
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
element
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (element.type == "autocomplete" || import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name === "SCAutocomplete" || (element.typeFormat == "multiselect" || import_react8.default.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_f = element == null ? void 0 : element.component) == null ? void 0 : _f.props).typeFormat == "multiselect")) {
|
|
1259
|
-
element.setState != void 0 ? element.setState({ hiddenValue: [], textValue: [] }) : null;
|
|
1260
|
-
import_react8.default.isValidElement(element == null ? void 0 : element.component) && typeof ((_g = element.component.props) == null ? void 0 : _g.setState) === "function" && element.component.props.setState({ hiddenValue: [], textValue: [] });
|
|
1331
|
+
const inputValidation = () => {
|
|
1332
|
+
var _a2, _b2, _c, _d;
|
|
1333
|
+
if (chipFilters != void 0 && chipFilters.length > 0) {
|
|
1334
|
+
if (chipFilters && chipFilters.length > 0) {
|
|
1335
|
+
arrayElements.forEach((arrayElement) => {
|
|
1336
|
+
var _a3, _b3, _c2;
|
|
1337
|
+
const { validation, element: typeElement } = validateTypeElements(arrayElement);
|
|
1338
|
+
let currentValue = "";
|
|
1339
|
+
if (validation === "dateRange") {
|
|
1340
|
+
if (typeElement.state && typeElement.state[0] && typeElement.state[1]) {
|
|
1341
|
+
currentValue = `${(_a3 = typeElement.state[0]) == null ? void 0 : _a3.format("DD/MM/YYYY")} - ${(_b3 = typeElement.state[1]) == null ? void 0 : _b3.format("DD/MM/YYYY")}`;
|
|
1342
|
+
}
|
|
1261
1343
|
} else {
|
|
1262
|
-
|
|
1263
|
-
|
|
1344
|
+
currentValue = ((_c2 = typeElement.state) == null ? void 0 : _c2.textValue) !== void 0 ? String(typeElement.state.textValue).trim() : String(typeElement.state).trim();
|
|
1345
|
+
}
|
|
1346
|
+
chipFilters.forEach((chipFilter) => {
|
|
1347
|
+
const chipValue = String(chipFilter).trim();
|
|
1348
|
+
if (currentValue === chipValue && currentValue !== "" && currentValue !== ",") {
|
|
1349
|
+
setTextFilters((prevFilters) => {
|
|
1350
|
+
const newFilter = { value: currentValue, arrayElement: typeElement };
|
|
1351
|
+
const existingFilterIndex = prevFilters.findIndex(
|
|
1352
|
+
(filter) => filter.arrayElement.label === arrayElement.label
|
|
1353
|
+
);
|
|
1354
|
+
if (existingFilterIndex !== -1) {
|
|
1355
|
+
const updatedFilters = [...prevFilters];
|
|
1356
|
+
updatedFilters[existingFilterIndex] = newFilter;
|
|
1357
|
+
return updatedFilters;
|
|
1358
|
+
} else {
|
|
1359
|
+
return [...prevFilters, newFilter];
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
} else {
|
|
1367
|
+
const newFiltersToAdd = [];
|
|
1368
|
+
for (let i = 0; i < arrayElements.length; i++) {
|
|
1369
|
+
const element = arrayElements[i];
|
|
1370
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1371
|
+
const textValue = ((_a2 = typeElement.state) == null ? void 0 : _a2.textValue) !== void 0 ? String((_b2 = typeElement.state) == null ? void 0 : _b2.textValue) : String(typeElement.state);
|
|
1372
|
+
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1373
|
+
let newFilter;
|
|
1374
|
+
switch (validation) {
|
|
1375
|
+
case "dateRange":
|
|
1376
|
+
const values = `${(_c = typeElement.state[0]) == null ? void 0 : _c.format("DD/MM/YYYY")} - ${(_d = typeElement.state[1]) == null ? void 0 : _d.format("DD/MM/YYYY")}`;
|
|
1377
|
+
newFilter = { value: values, arrayElement: typeElement };
|
|
1378
|
+
break;
|
|
1379
|
+
default:
|
|
1380
|
+
newFilter = { value: textValue, arrayElement: typeElement };
|
|
1381
|
+
break;
|
|
1382
|
+
}
|
|
1383
|
+
const existingFilterByLabel = newFiltersToAdd.find(
|
|
1384
|
+
(filter) => filter.arrayElement.label === element.label
|
|
1385
|
+
);
|
|
1386
|
+
if (existingFilterByLabel) {
|
|
1387
|
+
existingFilterByLabel.value = newFilter.value;
|
|
1388
|
+
existingFilterByLabel.arrayElement = newFilter.arrayElement;
|
|
1389
|
+
} else {
|
|
1390
|
+
newFiltersToAdd.push(newFilter);
|
|
1264
1391
|
}
|
|
1265
1392
|
}
|
|
1266
1393
|
}
|
|
1394
|
+
setTextFilters((prevFilters) => {
|
|
1395
|
+
let updatedFilters = [...prevFilters];
|
|
1396
|
+
newFiltersToAdd.forEach((newFilter) => {
|
|
1397
|
+
const existingFilterIndex = updatedFilters.findIndex(
|
|
1398
|
+
(filter) => filter.arrayElement.label === newFilter.arrayElement.label
|
|
1399
|
+
);
|
|
1400
|
+
if (existingFilterIndex !== -1) {
|
|
1401
|
+
updatedFilters[existingFilterIndex] = newFilter;
|
|
1402
|
+
} else {
|
|
1403
|
+
updatedFilters.push(newFilter);
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
return updatedFilters;
|
|
1407
|
+
});
|
|
1408
|
+
validateInputs(arrayElements, setToastWithDelay, handleDrawerClose, setChipFilters, setTextFilters);
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
const resetElementByType = (originalElement, validation, typeElement) => {
|
|
1412
|
+
let defaultValue;
|
|
1413
|
+
switch (validation) {
|
|
1414
|
+
case "textField":
|
|
1415
|
+
case "textArea":
|
|
1416
|
+
defaultValue = "";
|
|
1417
|
+
break;
|
|
1418
|
+
case "dateRange":
|
|
1419
|
+
defaultValue = [null, null];
|
|
1420
|
+
break;
|
|
1421
|
+
case "multiselect":
|
|
1422
|
+
defaultValue = { hiddenValue: [], textValue: [] };
|
|
1423
|
+
break;
|
|
1424
|
+
default:
|
|
1425
|
+
defaultValue = { hiddenValue: "-1", textValue: "" };
|
|
1426
|
+
}
|
|
1427
|
+
if (typeElement.setState) {
|
|
1428
|
+
typeElement.setState(defaultValue);
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
const cleanFilters = () => {
|
|
1432
|
+
arrayElements.forEach((element) => {
|
|
1433
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1434
|
+
if (typeElement.setState) {
|
|
1435
|
+
resetElementByType(element, validation, typeElement);
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
setTextFilters([]);
|
|
1439
|
+
};
|
|
1440
|
+
const deleteFilter = (element) => {
|
|
1441
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1442
|
+
if (typeElement.setState && shouldShowChips == true) {
|
|
1443
|
+
resetElementByType(element, validation, typeElement);
|
|
1444
|
+
setTextFilters(
|
|
1445
|
+
(prevFilters) => prevFilters.filter((filter) => filter.arrayElement.label !== element.label)
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1448
|
+
};
|
|
1449
|
+
const scroll = (offset) => {
|
|
1450
|
+
if (scrollRef.current) {
|
|
1451
|
+
scrollRef.current.scrollLeft += offset;
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
const hasActiveFilters = () => {
|
|
1455
|
+
return arrayElements.some((arrayElement) => {
|
|
1456
|
+
const { validation, element: typeElement } = validateTypeElements(arrayElement);
|
|
1457
|
+
if (typeElement.state.textValue !== void 0) {
|
|
1458
|
+
return String(typeElement.state.textValue).trim() !== "";
|
|
1459
|
+
} else if (validation === "dateRange") {
|
|
1460
|
+
return typeElement.state && typeElement.state[0] !== null && typeElement.state[1] !== null;
|
|
1461
|
+
} else {
|
|
1462
|
+
return String(typeElement.state).trim() !== "" && String(typeElement.state).trim() !== ",";
|
|
1463
|
+
}
|
|
1267
1464
|
});
|
|
1268
1465
|
};
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1466
|
+
const shouldShowChips = chipFilters != void 0 && chipFilters.length > 0 ? true : stateChipFilters === true && hasActiveFilters();
|
|
1467
|
+
const actionsA = actions == false ? false : actions != void 0 ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: cleanFilters }];
|
|
1468
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, toast && /* @__PURE__ */ import_react9.default.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ import_react9.default.createElement(import_Grid23.default, { container: true, justifyContent: "flex-start", flexWrap: "nowrap", alignItems: "center", sx: { width: "100%" } }, shouldShowChips && /* @__PURE__ */ import_react9.default.createElement(import_material7.Box, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ import_react9.default.createElement(import_material7.IconButton, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ import_react9.default.createElement(import_ArrowBackIos.default, { fontSize: "small" })), /* @__PURE__ */ import_react9.default.createElement(
|
|
1469
|
+
import_material7.Box,
|
|
1470
|
+
{
|
|
1471
|
+
ref: scrollRef,
|
|
1472
|
+
gap: 0.3,
|
|
1473
|
+
sx: {
|
|
1474
|
+
display: "flex",
|
|
1475
|
+
overflowX: "auto",
|
|
1476
|
+
scrollBehavior: "smooth",
|
|
1477
|
+
"&::-webkit-scrollbar": { display: "none" }
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */ import_react9.default.createElement(
|
|
1481
|
+
import_material7.Chip,
|
|
1482
|
+
__spreadProps(__spreadValues({
|
|
1483
|
+
key: index,
|
|
1484
|
+
label: chipData.value
|
|
1485
|
+
}, chipData.arrayElement.required == false || chipData.arrayElement.required == void 0 ? { onDelete: () => deleteFilter(chipData.arrayElement) } : {}), {
|
|
1486
|
+
color: "default",
|
|
1487
|
+
variant: "filled",
|
|
1488
|
+
size: "small",
|
|
1489
|
+
sx: {
|
|
1490
|
+
flexShrink: 0,
|
|
1491
|
+
minWidth: "auto"
|
|
1492
|
+
}
|
|
1493
|
+
})
|
|
1494
|
+
))
|
|
1495
|
+
), /* @__PURE__ */ import_react9.default.createElement(import_material7.IconButton, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ import_react9.default.createElement(import_ArrowForwardIos.default, { fontSize: "small" }))), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1271
1496
|
import_material7.Chip,
|
|
1272
1497
|
__spreadProps(__spreadValues({
|
|
1273
1498
|
onClick: toggleDrawer(true),
|
|
1274
1499
|
color: buttonDrawer == null ? void 0 : buttonDrawer.color,
|
|
1275
1500
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) == "contained" ? "filled" : "outlined",
|
|
1276
1501
|
label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
|
|
1277
|
-
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */
|
|
1278
|
-
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1502
|
+
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ import_react9.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
|
|
1503
|
+
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react9.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0
|
|
1279
1504
|
}, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
|
|
1280
1505
|
} } : {}), {
|
|
1281
1506
|
sx: {
|
|
@@ -1285,7 +1510,7 @@ function SCDrawer({
|
|
|
1285
1510
|
textTransform: "capitalize"
|
|
1286
1511
|
}
|
|
1287
1512
|
})
|
|
1288
|
-
) : /* @__PURE__ */
|
|
1513
|
+
) : /* @__PURE__ */ import_react9.default.createElement(
|
|
1289
1514
|
import_material7.Button,
|
|
1290
1515
|
{
|
|
1291
1516
|
"data-testid": "test-buttonDrawer",
|
|
@@ -1294,11 +1519,11 @@ function SCDrawer({
|
|
|
1294
1519
|
onClick: toggleDrawer(true),
|
|
1295
1520
|
size: "small",
|
|
1296
1521
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
|
|
1297
|
-
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */
|
|
1298
|
-
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1522
|
+
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ import_react9.default.createElement(ButtonIcon, { fontSize: "small" }) : null,
|
|
1523
|
+
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react9.default.createElement(ButtonIcon, { fontSize: "small" }) : null
|
|
1299
1524
|
},
|
|
1300
1525
|
(_b = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _b : ""
|
|
1301
|
-
), /* @__PURE__ */
|
|
1526
|
+
)), /* @__PURE__ */ import_react9.default.createElement(
|
|
1302
1527
|
import_material7.Drawer,
|
|
1303
1528
|
{
|
|
1304
1529
|
open: drawerOpen,
|
|
@@ -1312,15 +1537,15 @@ function SCDrawer({
|
|
|
1312
1537
|
}
|
|
1313
1538
|
}
|
|
1314
1539
|
},
|
|
1315
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ import_react9.default.createElement(import_material7.Stack, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react9.default.createElement(import_Grid23.default, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ import_react9.default.createElement(import_material7.Typography, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ import_react9.default.createElement(import_material7.IconButton, { onClick: handleDrawerClose }, /* @__PURE__ */ import_react9.default.createElement(import_Close.default, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ import_react9.default.createElement(import_material7.Stack, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
|
|
1316
1541
|
var _a2, _b2, _c, _d, _e, _f;
|
|
1317
|
-
return /* @__PURE__ */
|
|
1542
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
1318
1543
|
import_material7.Box,
|
|
1319
1544
|
{
|
|
1320
1545
|
key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b2 = arrayElement.label) != null ? _b2 : ""}${index}`,
|
|
1321
1546
|
sx: { width: "100%" }
|
|
1322
1547
|
},
|
|
1323
|
-
arrayElement.component ? /* @__PURE__ */
|
|
1548
|
+
arrayElement.component ? /* @__PURE__ */ import_react9.default.createElement(import_material7.Stack, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1324
1549
|
SCTextField,
|
|
1325
1550
|
{
|
|
1326
1551
|
title: arrayElement.title,
|
|
@@ -1346,7 +1571,7 @@ function SCDrawer({
|
|
|
1346
1571
|
onBlur: arrayElement.onBlur,
|
|
1347
1572
|
onKeyDown: arrayElement.onKeyDown
|
|
1348
1573
|
}
|
|
1349
|
-
) : arrayElement.type === "textArea" ? /* @__PURE__ */
|
|
1574
|
+
) : arrayElement.type === "textArea" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1350
1575
|
SCTextArea,
|
|
1351
1576
|
{
|
|
1352
1577
|
title: arrayElement.title,
|
|
@@ -1365,7 +1590,7 @@ function SCDrawer({
|
|
|
1365
1590
|
state: arrayElement.state || "",
|
|
1366
1591
|
onBlur: arrayElement.onBlur
|
|
1367
1592
|
}
|
|
1368
|
-
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */
|
|
1593
|
+
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1369
1594
|
SCAutocomplete,
|
|
1370
1595
|
{
|
|
1371
1596
|
label: arrayElement.label,
|
|
@@ -1383,7 +1608,7 @@ function SCDrawer({
|
|
|
1383
1608
|
state: arrayElement.state || "",
|
|
1384
1609
|
inputChange: arrayElement.inputChange
|
|
1385
1610
|
}
|
|
1386
|
-
) : arrayElement.type === "select" ? /* @__PURE__ */
|
|
1611
|
+
) : arrayElement.type === "select" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1387
1612
|
SCSelect,
|
|
1388
1613
|
{
|
|
1389
1614
|
label: arrayElement.label,
|
|
@@ -1392,7 +1617,6 @@ function SCDrawer({
|
|
|
1392
1617
|
width: arrayElement.width,
|
|
1393
1618
|
size: arrayElement.size,
|
|
1394
1619
|
variant: arrayElement.variant,
|
|
1395
|
-
deleteType: arrayElement.deleteType,
|
|
1396
1620
|
required: arrayElement.required,
|
|
1397
1621
|
disabled: arrayElement.disabled,
|
|
1398
1622
|
background: arrayElement.background,
|
|
@@ -1400,7 +1624,7 @@ function SCDrawer({
|
|
|
1400
1624
|
setState: arrayElement.setState,
|
|
1401
1625
|
state: arrayElement.state || ""
|
|
1402
1626
|
}
|
|
1403
|
-
) : arrayElement.type === "dateRange" ? /* @__PURE__ */
|
|
1627
|
+
) : arrayElement.type === "dateRange" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1404
1628
|
SCDateRange,
|
|
1405
1629
|
{
|
|
1406
1630
|
labelDateInitial: arrayElement.labelDateInitial,
|
|
@@ -1413,7 +1637,7 @@ function SCDrawer({
|
|
|
1413
1637
|
}
|
|
1414
1638
|
) : null
|
|
1415
1639
|
);
|
|
1416
|
-
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */
|
|
1640
|
+
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1417
1641
|
import_Grid23.default,
|
|
1418
1642
|
{
|
|
1419
1643
|
sx: { borderTop: 1, borderColor: "#1018403B" },
|
|
@@ -1425,7 +1649,7 @@ function SCDrawer({
|
|
|
1425
1649
|
justifyContent: actionsA.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
|
|
1426
1650
|
flexDirection: anchor != "right" ? "row-reverse" : "row"
|
|
1427
1651
|
},
|
|
1428
|
-
actionsA.map((btn, index) => /* @__PURE__ */
|
|
1652
|
+
actionsA.map((btn, index) => /* @__PURE__ */ import_react9.default.createElement(
|
|
1429
1653
|
import_material7.Button,
|
|
1430
1654
|
{
|
|
1431
1655
|
key: index,
|
|
@@ -1442,7 +1666,7 @@ function SCDrawer({
|
|
|
1442
1666
|
}
|
|
1443
1667
|
|
|
1444
1668
|
// src/Components/FooterAction/FooterAction.tsx
|
|
1445
|
-
var
|
|
1669
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1446
1670
|
var import_material8 = require("@mui/material");
|
|
1447
1671
|
var FooterAction = ({
|
|
1448
1672
|
leftContent,
|
|
@@ -1450,44 +1674,44 @@ var FooterAction = ({
|
|
|
1450
1674
|
label,
|
|
1451
1675
|
variant
|
|
1452
1676
|
}) => {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
1454
1678
|
import_material8.AppBar,
|
|
1455
1679
|
{
|
|
1456
1680
|
color: "inherit",
|
|
1457
1681
|
sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
|
|
1458
1682
|
},
|
|
1459
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
1460
1684
|
import_material8.Toolbar,
|
|
1461
1685
|
{
|
|
1462
1686
|
id: "footer-toolbar",
|
|
1463
1687
|
sx: { gap: 1.5, minHeight: "50px !important" }
|
|
1464
1688
|
},
|
|
1465
1689
|
leftContent,
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
label && /* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ import_react10.default.createElement(import_material8.Box, { flexGrow: 1 }),
|
|
1691
|
+
label && /* @__PURE__ */ import_react10.default.createElement(import_material8.Typography, { variant: "body2", color: "text.secondary" }, label),
|
|
1468
1692
|
rightContent
|
|
1469
1693
|
)
|
|
1470
1694
|
);
|
|
1471
1695
|
};
|
|
1472
1696
|
|
|
1473
1697
|
// src/Components/Modal/Helpers/Data.tsx
|
|
1474
|
-
var
|
|
1698
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
1475
1699
|
var import_icons_material5 = require("@mui/icons-material");
|
|
1476
1700
|
var modalStateConfig = {
|
|
1477
1701
|
info: {
|
|
1478
1702
|
color: "info",
|
|
1479
1703
|
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
1480
|
-
icon: /* @__PURE__ */
|
|
1704
|
+
icon: /* @__PURE__ */ import_react11.default.createElement(import_icons_material5.Info, { color: "info", fontSize: "medium" })
|
|
1481
1705
|
},
|
|
1482
1706
|
delete: {
|
|
1483
1707
|
color: "delete",
|
|
1484
1708
|
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
1485
|
-
icon: /* @__PURE__ */
|
|
1709
|
+
icon: /* @__PURE__ */ import_react11.default.createElement(import_icons_material5.Info, { color: "error", fontSize: "medium" })
|
|
1486
1710
|
},
|
|
1487
1711
|
warning: {
|
|
1488
1712
|
color: "warning",
|
|
1489
1713
|
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
1490
|
-
icon: /* @__PURE__ */
|
|
1714
|
+
icon: /* @__PURE__ */ import_react11.default.createElement(import_icons_material5.Warning, { color: "warning", fontSize: "medium" })
|
|
1491
1715
|
}
|
|
1492
1716
|
};
|
|
1493
1717
|
|
|
@@ -1517,7 +1741,7 @@ var getButtonColor = (state) => {
|
|
|
1517
1741
|
};
|
|
1518
1742
|
|
|
1519
1743
|
// src/Components/Modal/SCModal.tsx
|
|
1520
|
-
var
|
|
1744
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
1521
1745
|
var import_material9 = require("@mui/material");
|
|
1522
1746
|
var import_icons_material7 = require("@mui/icons-material");
|
|
1523
1747
|
|
|
@@ -1536,34 +1760,31 @@ var SCModal = ({
|
|
|
1536
1760
|
action
|
|
1537
1761
|
}) => {
|
|
1538
1762
|
var _a, _b, _c, _d, _e;
|
|
1539
|
-
const [openModal, setOpenModal] = (0,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
const
|
|
1546
|
-
const handleClose = (0, import_react11.useCallback)(() => setOpenModal(false), []);
|
|
1547
|
-
const toggleModal = (newOpen) => () => setOpenModal(newOpen);
|
|
1548
|
-
const prevAction = (0, import_react11.useMemo)(
|
|
1763
|
+
const [openModal, setOpenModal] = (0, import_react12.useState)(open != null ? open : false);
|
|
1764
|
+
const handleOpen = import_react12.default.useCallback(() => {
|
|
1765
|
+
setOpenModal((prev) => !prev);
|
|
1766
|
+
}, []);
|
|
1767
|
+
const Icon = (0, import_react12.useMemo)(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
1768
|
+
const handleClose = (0, import_react12.useCallback)(() => setOpenModal(false), []);
|
|
1769
|
+
const prevAction = (0, import_react12.useMemo)(
|
|
1549
1770
|
() => action != null ? action : [{ text: "Cancelar", fn: handleClose }, { text: "Consultar", fn: () => {
|
|
1550
1771
|
} }],
|
|
1551
1772
|
[action, handleClose]
|
|
1552
1773
|
);
|
|
1553
1774
|
const { icon, defaultDescription } = modalStateConfig[state];
|
|
1554
|
-
return /* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(
|
|
1555
1776
|
import_material9.Button,
|
|
1556
1777
|
{
|
|
1557
1778
|
"data-testid": "test-buttonModal",
|
|
1558
1779
|
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
1559
|
-
onClick:
|
|
1780
|
+
onClick: handleOpen,
|
|
1560
1781
|
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
1561
1782
|
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
1562
|
-
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */
|
|
1563
|
-
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */
|
|
1783
|
+
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ import_react12.default.createElement(Icon, null),
|
|
1784
|
+
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ import_react12.default.createElement(Icon, null)
|
|
1564
1785
|
},
|
|
1565
1786
|
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
1566
|
-
), /* @__PURE__ */
|
|
1787
|
+
), /* @__PURE__ */ import_react12.default.createElement(import_material9.Modal, { open: openModal, onClose: handleOpen, sx: { boxShadow: 8 } }, /* @__PURE__ */ import_react12.default.createElement(
|
|
1567
1788
|
import_material9.Box,
|
|
1568
1789
|
{
|
|
1569
1790
|
sx: {
|
|
@@ -1577,9 +1798,9 @@ var SCModal = ({
|
|
|
1577
1798
|
boxShadow: 24
|
|
1578
1799
|
}
|
|
1579
1800
|
},
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
action && /* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ import_react12.default.createElement(import_material9.Box, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ import_react12.default.createElement(import_material9.Typography, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ import_react12.default.createElement(import_material9.IconButton, { onClick: handleOpen, "data-testid": "test-buttonClose" }, /* @__PURE__ */ import_react12.default.createElement(import_icons_material7.Close, { color: "action" }))),
|
|
1802
|
+
/* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ import_react12.default.createElement(import_material9.Typography, { variant: "body1" }, description || defaultDescription)),
|
|
1803
|
+
action && /* @__PURE__ */ import_react12.default.createElement(
|
|
1583
1804
|
import_material9.Stack,
|
|
1584
1805
|
{
|
|
1585
1806
|
id: "Action",
|
|
@@ -1590,7 +1811,7 @@ var SCModal = ({
|
|
|
1590
1811
|
bgcolor: "grey.50",
|
|
1591
1812
|
sx: { borderRadius: 1 }
|
|
1592
1813
|
},
|
|
1593
|
-
/* @__PURE__ */
|
|
1814
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
1594
1815
|
import_material9.Button,
|
|
1595
1816
|
{
|
|
1596
1817
|
color: "inherit",
|
|
@@ -1600,7 +1821,7 @@ var SCModal = ({
|
|
|
1600
1821
|
},
|
|
1601
1822
|
capitalize("cancelar")
|
|
1602
1823
|
),
|
|
1603
|
-
/* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
1604
1825
|
import_material9.Button,
|
|
1605
1826
|
{
|
|
1606
1827
|
"data-testid": "test-aceptar",
|
|
@@ -1617,32 +1838,32 @@ var SCModal = ({
|
|
|
1617
1838
|
};
|
|
1618
1839
|
|
|
1619
1840
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
1620
|
-
var
|
|
1841
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
1621
1842
|
var import_material10 = require("@mui/material");
|
|
1622
1843
|
var import_icons_material9 = require("@mui/icons-material");
|
|
1623
1844
|
|
|
1624
1845
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
1625
|
-
var
|
|
1846
|
+
var import_react13 = require("react");
|
|
1626
1847
|
function useMultiSelectHandlers() {
|
|
1627
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
1628
|
-
const [open, setOpen] = (0,
|
|
1629
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
1630
|
-
const [filterValue, setFilterValue] = (0,
|
|
1631
|
-
const handleOpen = (0,
|
|
1848
|
+
const [anchorEl, setAnchorEl] = (0, import_react13.useState)(null);
|
|
1849
|
+
const [open, setOpen] = (0, import_react13.useState)(false);
|
|
1850
|
+
const [selectedItems, setSelectedItems] = (0, import_react13.useState)([]);
|
|
1851
|
+
const [filterValue, setFilterValue] = (0, import_react13.useState)("");
|
|
1852
|
+
const handleOpen = (0, import_react13.useCallback)((e) => {
|
|
1632
1853
|
setAnchorEl(e.currentTarget);
|
|
1633
1854
|
setOpen(true);
|
|
1634
1855
|
}, []);
|
|
1635
|
-
const handleClose = (0,
|
|
1856
|
+
const handleClose = (0, import_react13.useCallback)(() => {
|
|
1636
1857
|
setAnchorEl(null);
|
|
1637
1858
|
setOpen(false);
|
|
1638
1859
|
}, []);
|
|
1639
|
-
const handleFilterChange = (0,
|
|
1860
|
+
const handleFilterChange = (0, import_react13.useCallback)(
|
|
1640
1861
|
(e) => {
|
|
1641
1862
|
setFilterValue(e.target.value);
|
|
1642
1863
|
},
|
|
1643
1864
|
[]
|
|
1644
1865
|
);
|
|
1645
|
-
const handleCheckboxToggle = (0,
|
|
1866
|
+
const handleCheckboxToggle = (0, import_react13.useCallback)((item) => {
|
|
1646
1867
|
setSelectedItems(
|
|
1647
1868
|
(prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
|
|
1648
1869
|
);
|
|
@@ -1669,15 +1890,15 @@ function getIconMultiSelect(name) {
|
|
|
1669
1890
|
}
|
|
1670
1891
|
|
|
1671
1892
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
1672
|
-
var
|
|
1893
|
+
var import_react14 = require("react");
|
|
1673
1894
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
1674
|
-
const filteredItems = (0,
|
|
1895
|
+
const filteredItems = (0, import_react14.useMemo)(
|
|
1675
1896
|
() => items.filter(
|
|
1676
1897
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
1677
1898
|
),
|
|
1678
1899
|
[items, filterValue, getItemLabel]
|
|
1679
1900
|
);
|
|
1680
|
-
const sortedItems = (0,
|
|
1901
|
+
const sortedItems = (0, import_react14.useMemo)(() => {
|
|
1681
1902
|
return [
|
|
1682
1903
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
1683
1904
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -1711,16 +1932,16 @@ function MultiSelect({
|
|
|
1711
1932
|
handleCheckboxToggle,
|
|
1712
1933
|
setOpen
|
|
1713
1934
|
} = useMultiSelectHandlers();
|
|
1714
|
-
(0,
|
|
1935
|
+
(0, import_react15.useEffect)(() => {
|
|
1715
1936
|
if (open !== void 0) {
|
|
1716
1937
|
setOpen(open);
|
|
1717
1938
|
}
|
|
1718
1939
|
}, [open, setOpen]);
|
|
1719
|
-
(0,
|
|
1940
|
+
(0, import_react15.useEffect)(() => {
|
|
1720
1941
|
setSelectedItems([]);
|
|
1721
1942
|
}, [items, setSelectedItems]);
|
|
1722
1943
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
1723
|
-
const Icon = (0,
|
|
1944
|
+
const Icon = (0, import_react15.useMemo)(() => {
|
|
1724
1945
|
var _a2;
|
|
1725
1946
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
1726
1947
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -1734,7 +1955,7 @@ function MultiSelect({
|
|
|
1734
1955
|
{ text: "Aplicar", fn: () => {
|
|
1735
1956
|
} }
|
|
1736
1957
|
];
|
|
1737
|
-
return /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1738
1959
|
import_material10.Button,
|
|
1739
1960
|
{
|
|
1740
1961
|
"test-id": "multiselect-button",
|
|
@@ -1742,11 +1963,11 @@ function MultiSelect({
|
|
|
1742
1963
|
onClick: handleOpen,
|
|
1743
1964
|
variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
|
|
1744
1965
|
size: "small",
|
|
1745
|
-
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */
|
|
1746
|
-
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */
|
|
1966
|
+
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ import_react15.default.createElement(Icon, null) : null,
|
|
1967
|
+
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ import_react15.default.createElement(Icon, null) : null
|
|
1747
1968
|
},
|
|
1748
1969
|
capitalize(textButton != null ? textButton : "MultiSelect")
|
|
1749
|
-
), /* @__PURE__ */
|
|
1970
|
+
), /* @__PURE__ */ import_react15.default.createElement(
|
|
1750
1971
|
import_material10.Popover,
|
|
1751
1972
|
{
|
|
1752
1973
|
elevation: 8,
|
|
@@ -1755,7 +1976,7 @@ function MultiSelect({
|
|
|
1755
1976
|
open: openMultiselect,
|
|
1756
1977
|
onClose: () => setOpen(false)
|
|
1757
1978
|
},
|
|
1758
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ import_react15.default.createElement(import_material10.Stack, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ import_react15.default.createElement(import_material10.Stack, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ import_react15.default.createElement(import_material10.FormControl, { fullWidth: true, size: "small" }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1759
1980
|
import_material10.TextField,
|
|
1760
1981
|
{
|
|
1761
1982
|
"data-testid": "multiselect-input",
|
|
@@ -1767,18 +1988,18 @@ function MultiSelect({
|
|
|
1767
1988
|
onChange: handleFilterChange,
|
|
1768
1989
|
slotProps: {
|
|
1769
1990
|
input: {
|
|
1770
|
-
endAdornment: /* @__PURE__ */
|
|
1991
|
+
endAdornment: /* @__PURE__ */ import_react15.default.createElement(import_material10.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react15.default.createElement(import_icons_material9.SearchOutlined, { fontSize: "small" }))
|
|
1771
1992
|
}
|
|
1772
1993
|
}
|
|
1773
1994
|
}
|
|
1774
|
-
))), /* @__PURE__ */
|
|
1995
|
+
))), /* @__PURE__ */ import_react15.default.createElement(import_material10.Stack, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ import_react15.default.createElement(import_material10.MenuItem, { dense, onClick: handleSelectAll }, /* @__PURE__ */ import_react15.default.createElement(import_material10.ListItemIcon, null, /* @__PURE__ */ import_react15.default.createElement(import_material10.Checkbox, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ import_react15.default.createElement(
|
|
1775
1996
|
import_material10.MenuItem,
|
|
1776
1997
|
{
|
|
1777
1998
|
key: getItemLabel(item),
|
|
1778
1999
|
dense,
|
|
1779
2000
|
onClick: () => handleCheckboxToggle(item)
|
|
1780
2001
|
},
|
|
1781
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ import_react15.default.createElement(import_material10.ListItemIcon, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1782
2003
|
import_material10.Checkbox,
|
|
1783
2004
|
{
|
|
1784
2005
|
checked: selectedItems.includes(item),
|
|
@@ -1786,9 +2007,9 @@ function MultiSelect({
|
|
|
1786
2007
|
}
|
|
1787
2008
|
)),
|
|
1788
2009
|
getItemLabel(item)
|
|
1789
|
-
)) : /* @__PURE__ */
|
|
2010
|
+
)) : /* @__PURE__ */ import_react15.default.createElement(import_material10.MenuItem, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ import_react15.default.createElement(import_material10.Stack, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
|
|
1790
2011
|
var _a2;
|
|
1791
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1792
2013
|
import_material10.Button,
|
|
1793
2014
|
{
|
|
1794
2015
|
key: index,
|
|
@@ -1804,7 +2025,7 @@ function MultiSelect({
|
|
|
1804
2025
|
}
|
|
1805
2026
|
|
|
1806
2027
|
// src/Components/PageHeader/PageHeader.tsx
|
|
1807
|
-
var
|
|
2028
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
1808
2029
|
var import_material11 = require("@mui/material");
|
|
1809
2030
|
var PageHeader = ({
|
|
1810
2031
|
title,
|
|
@@ -1814,7 +2035,7 @@ var PageHeader = ({
|
|
|
1814
2035
|
fixed,
|
|
1815
2036
|
shadow = true
|
|
1816
2037
|
}) => {
|
|
1817
|
-
return /* @__PURE__ */
|
|
2038
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1818
2039
|
import_material11.Stack,
|
|
1819
2040
|
{
|
|
1820
2041
|
"data-testid": "main-container",
|
|
@@ -1826,12 +2047,12 @@ var PageHeader = ({
|
|
|
1826
2047
|
zIndex: 10,
|
|
1827
2048
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
1828
2049
|
},
|
|
1829
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ import_react16.default.createElement(import_material11.Typography, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ import_react16.default.createElement(import_material11.Typography, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.primary" }, subtitle))), actions && /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
1830
2051
|
);
|
|
1831
2052
|
};
|
|
1832
2053
|
|
|
1833
2054
|
// src/Components/SCCalendarSwipeable.tsx
|
|
1834
|
-
var
|
|
2055
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
1835
2056
|
var import_material12 = require("@mui/material");
|
|
1836
2057
|
var import_Grid24 = __toESM(require("@mui/material/Grid2"), 1);
|
|
1837
2058
|
var import_AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
@@ -1850,14 +2071,14 @@ var SCCalendarSwipeable = ({
|
|
|
1850
2071
|
state
|
|
1851
2072
|
}) => {
|
|
1852
2073
|
let convertFecha;
|
|
1853
|
-
const [fecha, setFecha] = (0,
|
|
1854
|
-
const [fechaSeleccionada, setFechaSeleccionada] = (0,
|
|
1855
|
-
const [stateVal, setstateVal] =
|
|
1856
|
-
const [openCalendar, setOpenCalendar] =
|
|
2074
|
+
const [fecha, setFecha] = (0, import_react17.useState)(/* @__PURE__ */ new Date());
|
|
2075
|
+
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react17.useState)();
|
|
2076
|
+
const [stateVal, setstateVal] = import_react17.default.useState(/* @__PURE__ */ new Date());
|
|
2077
|
+
const [openCalendar, setOpenCalendar] = import_react17.default.useState(false);
|
|
1857
2078
|
const hoy = /* @__PURE__ */ new Date();
|
|
1858
2079
|
const inicioSemana = (0, import_date_fns.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
1859
2080
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns.addDays)(inicioSemana, i));
|
|
1860
|
-
|
|
2081
|
+
import_react17.default.useEffect(() => {
|
|
1861
2082
|
if (fecha != null) {
|
|
1862
2083
|
handleConvertFecha(fecha);
|
|
1863
2084
|
}
|
|
@@ -1876,11 +2097,11 @@ var SCCalendarSwipeable = ({
|
|
|
1876
2097
|
setOpenCalendar(newOpen);
|
|
1877
2098
|
};
|
|
1878
2099
|
const locale = __spreadValues({}, import_locale.es);
|
|
1879
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(import_LocalizationProvider2.LocalizationProvider, { dateAdapter: import_AdapterDateFns.AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ import_react17.default.createElement(import_material12.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react17.default.createElement(import_material12.Box, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ import_react17.default.createElement(import_Grid24.default, { container: true, gap: 0.5, sx: {
|
|
1880
2101
|
justifyContent: "space-between",
|
|
1881
2102
|
padding: "12px 0px",
|
|
1882
2103
|
background: "transparent"
|
|
1883
|
-
} }, diasSemana.map((dia) => /* @__PURE__ */
|
|
2104
|
+
} }, diasSemana.map((dia) => /* @__PURE__ */ import_react17.default.createElement(import_Grid24.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react17.default.createElement(import_material12.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react17.default.createElement(import_material12.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns.format)(dia, "EEEE", { locale: import_locale.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react17.default.createElement(
|
|
1884
2105
|
import_material12.Box,
|
|
1885
2106
|
{
|
|
1886
2107
|
onClick: () => setFecha(dia),
|
|
@@ -1896,8 +2117,8 @@ var SCCalendarSwipeable = ({
|
|
|
1896
2117
|
//height: '36px',
|
|
1897
2118
|
}
|
|
1898
2119
|
},
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
)))), /* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ import_react17.default.createElement(import_material12.Typography, { sx: { fontSize: "12px !important", color: (0, import_date_fns.isSameDay)(dia, fecha) ? "white" : "#101840DE" } }, (0, import_date_fns.format)(dia, "d"))
|
|
2121
|
+
)))), /* @__PURE__ */ import_react17.default.createElement(import_Grid24.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react17.default.createElement(import_material12.IconButton, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ import_react17.default.createElement(import_KeyboardDoubleArrowDown.default, null))))) : /* @__PURE__ */ import_react17.default.createElement(import_material12.Box, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1901
2122
|
import_StaticDatePicker.StaticDatePicker,
|
|
1902
2123
|
{
|
|
1903
2124
|
orientation: "landscape",
|
|
@@ -1907,17 +2128,17 @@ var SCCalendarSwipeable = ({
|
|
|
1907
2128
|
sx: { fontSize: "12px !important", height: "300px !important", background: background ? background : "white", "& .MuiDayCalendar-header": { justifyContent: "space-between" }, "& .MuiDayCalendar-weekContainer": { justifyContent: "space-between" }, "& .MuiPickersCalendarHeader-root": { paddingLeft: "0px", paddingRight: "0px", color: "#10184099" }, "& .MuiPickersDay-root": { fontSize: "12px !important" }, "& .MuiDayCalendar-weekDayLabel": { fontSize: "12px !important" } },
|
|
1908
2129
|
onChange: (newValue) => setFecha(newValue)
|
|
1909
2130
|
}
|
|
1910
|
-
), /* @__PURE__ */
|
|
2131
|
+
), /* @__PURE__ */ import_react17.default.createElement(import_Grid24.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react17.default.createElement(import_material12.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react17.default.createElement(import_KeyboardDoubleArrowUp.default, null))))));
|
|
1911
2132
|
};
|
|
1912
2133
|
|
|
1913
2134
|
// src/Components/SCDataGrid.tsx
|
|
1914
|
-
var
|
|
2135
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
1915
2136
|
var import_x_data_grid_pro = require("@mui/x-data-grid-pro");
|
|
1916
2137
|
var import_x_license_pro2 = require("@mui/x-license-pro");
|
|
1917
2138
|
var import_KeyboardArrowDown = __toESM(require("@mui/icons-material/KeyboardArrowDown"), 1);
|
|
1918
2139
|
var import_KeyboardArrowUp = __toESM(require("@mui/icons-material/KeyboardArrowUp"), 1);
|
|
1919
2140
|
var import_styles = require("@mui/material/styles");
|
|
1920
|
-
|
|
2141
|
+
function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }) {
|
|
1921
2142
|
import_x_license_pro2.LicenseInfo.setLicenseKey(
|
|
1922
2143
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
1923
2144
|
);
|
|
@@ -1928,45 +2149,80 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1928
2149
|
return Math.floor(Math.random() * 1e6);
|
|
1929
2150
|
}
|
|
1930
2151
|
const getTreeDataPaths = (row) => {
|
|
2152
|
+
var _a, _b, _c;
|
|
2153
|
+
const group1Value = groupColumns && ((_a = groupColumns(row)) == null ? void 0 : _a.valueGroup1);
|
|
2154
|
+
const group2Value = groupColumns && ((_b = groupColumns(row)) == null ? void 0 : _b.valueGroup2);
|
|
2155
|
+
const fieldValue = groupColumns && ((_c = groupColumns(row)) == null ? void 0 : _c.fieldFirstColumn);
|
|
1931
2156
|
return [
|
|
1932
|
-
|
|
1933
|
-
...
|
|
1934
|
-
`${
|
|
2157
|
+
String(group1Value || ""),
|
|
2158
|
+
...group2Value ? [String(group2Value)] : [],
|
|
2159
|
+
`${String(fieldValue || "")}/${generateRandomId()}`
|
|
1935
2160
|
];
|
|
1936
2161
|
};
|
|
1937
2162
|
const groupingColDefs = {
|
|
1938
2163
|
field: "grouping",
|
|
1939
|
-
headerName: groupColumns
|
|
2164
|
+
headerName: groupColumns ? groupColumns(data[0]).headerNameFirstColumn : "Agrupador",
|
|
1940
2165
|
renderCell: (params) => {
|
|
1941
|
-
var _a;
|
|
2166
|
+
var _a, _b;
|
|
1942
2167
|
let label = params.value.toString().includes("/") ? params.value.split("/")[0].toString() : params.value.toString();
|
|
1943
|
-
|
|
1944
|
-
if (groupColumns
|
|
2168
|
+
let maxDepth = 0;
|
|
2169
|
+
if (groupColumns && data.length > 0) {
|
|
2170
|
+
const sampleItem = groupColumns(data[0]);
|
|
2171
|
+
if (sampleItem.valueGroup1) maxDepth++;
|
|
2172
|
+
if (sampleItem.valueGroup2) maxDepth++;
|
|
2173
|
+
maxDepth = Math.max(0, maxDepth - 1);
|
|
2174
|
+
}
|
|
2175
|
+
if (groupColumns) {
|
|
1945
2176
|
if (params.rowNode.depth === 0) {
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
2177
|
+
let customLabel = label;
|
|
2178
|
+
if (groupColumns) {
|
|
2179
|
+
const originalItem = data.find(
|
|
2180
|
+
(item) => {
|
|
2181
|
+
var _a2;
|
|
2182
|
+
return String((_a2 = groupColumns(item)) == null ? void 0 : _a2.valueGroup1) === label;
|
|
2183
|
+
}
|
|
2184
|
+
);
|
|
2185
|
+
if (originalItem) {
|
|
2186
|
+
const itemValue = groupColumns(originalItem);
|
|
2187
|
+
customLabel = itemValue.textGroup1 || label;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
const subgroup1 = arrayRows.filter((r) => {
|
|
2191
|
+
var _a2;
|
|
2192
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === label;
|
|
2193
|
+
}).map((r) => {
|
|
2194
|
+
var _a2;
|
|
2195
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup2);
|
|
2196
|
+
});
|
|
1952
2197
|
const groupedDataLength1 = subgroup1.filter((valor, indiceActual, arreglo) => arreglo.indexOf(valor) === indiceActual);
|
|
1953
|
-
label = `${
|
|
1954
|
-
} else if (groupColumns
|
|
1955
|
-
const labelGrouping1 = (
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2198
|
+
label = `${customLabel} (${groupedDataLength1.length})`;
|
|
2199
|
+
} else if (((_a = groupColumns(data[0])) == null ? void 0 : _a.valueGroup2) && params.rowNode.depth === 1) {
|
|
2200
|
+
const labelGrouping1 = (_b = params.api.getRowNode(params.rowNode.parent)) == null ? void 0 : _b.groupingKey.toString();
|
|
2201
|
+
let customLabel = label;
|
|
2202
|
+
if (groupColumns) {
|
|
2203
|
+
const originalItem = data.find(
|
|
2204
|
+
(item) => {
|
|
2205
|
+
var _a2;
|
|
2206
|
+
return String((_a2 = groupColumns(item)) == null ? void 0 : _a2.valueGroup2) === label;
|
|
2207
|
+
}
|
|
2208
|
+
);
|
|
2209
|
+
if (originalItem) {
|
|
2210
|
+
const itemValue = groupColumns(originalItem);
|
|
2211
|
+
customLabel = itemValue.textGroup2 || label;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
1961
2214
|
const groupedDataLength2 = arrayRows.filter(
|
|
1962
|
-
(r) =>
|
|
2215
|
+
(r) => {
|
|
2216
|
+
var _a2, _b2;
|
|
2217
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === labelGrouping1 && groupColumns && String((_b2 = groupColumns(r)) == null ? void 0 : _b2.valueGroup2) === label;
|
|
2218
|
+
}
|
|
1963
2219
|
).length;
|
|
1964
|
-
label = `${
|
|
2220
|
+
label = `${customLabel} (${groupedDataLength2})`;
|
|
1965
2221
|
} else {
|
|
1966
2222
|
label = label;
|
|
1967
2223
|
}
|
|
1968
2224
|
}
|
|
1969
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1970
2226
|
"div",
|
|
1971
2227
|
{
|
|
1972
2228
|
style: {
|
|
@@ -1983,7 +2239,7 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1983
2239
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
1984
2240
|
}
|
|
1985
2241
|
},
|
|
1986
|
-
params.rowNode.type === "group" && /* @__PURE__ */
|
|
2242
|
+
params.rowNode.type === "group" && /* @__PURE__ */ import_react18.default.createElement(
|
|
1987
2243
|
"span",
|
|
1988
2244
|
{
|
|
1989
2245
|
style: {
|
|
@@ -1996,25 +2252,32 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1996
2252
|
params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
1997
2253
|
}
|
|
1998
2254
|
},
|
|
1999
|
-
params.rowNode.childrenExpanded ? /* @__PURE__ */
|
|
2255
|
+
params.rowNode.childrenExpanded ? /* @__PURE__ */ import_react18.default.createElement(import_KeyboardArrowUp.default, { fontSize: "small", color: "action" }) : /* @__PURE__ */ import_react18.default.createElement(import_KeyboardArrowDown.default, { fontSize: "small", color: "action" })
|
|
2000
2256
|
),
|
|
2001
2257
|
label
|
|
2002
2258
|
);
|
|
2003
2259
|
},
|
|
2004
2260
|
colSpan: (params) => {
|
|
2261
|
+
var _a, _b;
|
|
2005
2262
|
const value = String(params);
|
|
2006
|
-
const fieldGrouping1 = groupColumns[0]
|
|
2007
|
-
const fieldGrouping2 = groupColumns
|
|
2263
|
+
const fieldGrouping1 = groupColumns ? (_a = groupColumns(data[0])) == null ? void 0 : _a.valueGroup1 : void 0;
|
|
2264
|
+
const fieldGrouping2 = groupColumns ? (_b = groupColumns(data[0])) == null ? void 0 : _b.valueGroup2 : void 0;
|
|
2008
2265
|
let agrupado1 = false;
|
|
2009
2266
|
let agrupado2 = false;
|
|
2010
2267
|
if (fieldGrouping1 != void 0) {
|
|
2011
2268
|
agrupado1 = arrayRows.some(
|
|
2012
|
-
(row) =>
|
|
2269
|
+
(row) => {
|
|
2270
|
+
var _a2;
|
|
2271
|
+
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup1) === value;
|
|
2272
|
+
}
|
|
2013
2273
|
);
|
|
2014
2274
|
}
|
|
2015
2275
|
if (fieldGrouping2 != void 0) {
|
|
2016
2276
|
agrupado2 = arrayRows.some(
|
|
2017
|
-
(row) =>
|
|
2277
|
+
(row) => {
|
|
2278
|
+
var _a2;
|
|
2279
|
+
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup2) === value;
|
|
2280
|
+
}
|
|
2018
2281
|
);
|
|
2019
2282
|
}
|
|
2020
2283
|
if (agrupado1 || agrupado2) {
|
|
@@ -2031,11 +2294,11 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2031
2294
|
let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
|
|
2032
2295
|
let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
|
|
2033
2296
|
let validationGroupingColDef = groupingColDefs || {};
|
|
2034
|
-
const [groupDataLenght, setGroupDataLengh] = (0,
|
|
2035
|
-
const [pageSize, setPageSize] = (0,
|
|
2036
|
-
const [arrayRows, setArrayRows] = (0,
|
|
2037
|
-
const [selectionModel, setSelectionModel] = (0,
|
|
2038
|
-
(0,
|
|
2297
|
+
const [groupDataLenght, setGroupDataLengh] = (0, import_react18.useState)(0);
|
|
2298
|
+
const [pageSize, setPageSize] = (0, import_react18.useState)(rows);
|
|
2299
|
+
const [arrayRows, setArrayRows] = (0, import_react18.useState)([]);
|
|
2300
|
+
const [selectionModel, setSelectionModel] = (0, import_react18.useState)([]);
|
|
2301
|
+
(0, import_react18.useEffect)(() => {
|
|
2039
2302
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
2040
2303
|
dataConvertRows(data, void 0);
|
|
2041
2304
|
}
|
|
@@ -2091,7 +2354,7 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2091
2354
|
setSelectionModel([...newSelection]);
|
|
2092
2355
|
}
|
|
2093
2356
|
};
|
|
2094
|
-
return /* @__PURE__ */
|
|
2357
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, data && /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ import_react18.default.createElement(
|
|
2095
2358
|
import_x_data_grid_pro.DataGridPro,
|
|
2096
2359
|
{
|
|
2097
2360
|
apiRef,
|
|
@@ -2125,7 +2388,6 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2125
2388
|
},
|
|
2126
2389
|
sx: {
|
|
2127
2390
|
maxHeight: maxHeight ? `${maxHeight}px` : "none",
|
|
2128
|
-
//overflow: 'auto',
|
|
2129
2391
|
"& .MuiDataGrid-filler": {
|
|
2130
2392
|
display: "none !important"
|
|
2131
2393
|
},
|
|
@@ -2155,14 +2417,14 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2155
2417
|
}
|
|
2156
2418
|
}
|
|
2157
2419
|
))));
|
|
2158
|
-
}
|
|
2159
|
-
var SCDataGrid =
|
|
2160
|
-
const isEqual = prevProps.
|
|
2420
|
+
}
|
|
2421
|
+
var SCDataGrid = import_react18.default.memo(SCDataGridInitial, (prevProps, nextProps) => {
|
|
2422
|
+
const isEqual = prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
|
|
2161
2423
|
return isEqual;
|
|
2162
2424
|
});
|
|
2163
2425
|
|
|
2164
2426
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2165
|
-
var
|
|
2427
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
2166
2428
|
var import_material13 = require("@mui/material");
|
|
2167
2429
|
|
|
2168
2430
|
// src/assets/ImgEmptyState/create.svg
|
|
@@ -2190,7 +2452,7 @@ var DefaultIcon = ({
|
|
|
2190
2452
|
}) => {
|
|
2191
2453
|
const imageUrl = EmptyStateImageUrls[state];
|
|
2192
2454
|
const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
|
|
2193
|
-
return /* @__PURE__ */
|
|
2455
|
+
return /* @__PURE__ */ import_react19.default.createElement("img", { src: imageUrl, alt: state, style: iconSize });
|
|
2194
2456
|
};
|
|
2195
2457
|
var EmptyState = ({
|
|
2196
2458
|
state = "create",
|
|
@@ -2199,11 +2461,11 @@ var EmptyState = ({
|
|
|
2199
2461
|
subtitle,
|
|
2200
2462
|
actions,
|
|
2201
2463
|
containerHeight = "100vh",
|
|
2202
|
-
icon = /* @__PURE__ */
|
|
2464
|
+
icon = /* @__PURE__ */ import_react19.default.createElement(DefaultIcon, { state, size })
|
|
2203
2465
|
}) => {
|
|
2204
2466
|
const titleVariant = size === "small" ? "subtitle2" : "h6";
|
|
2205
2467
|
const subtitleVariant = size === "small" ? "caption" : "body1";
|
|
2206
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2207
2469
|
import_material13.Stack,
|
|
2208
2470
|
{
|
|
2209
2471
|
alignItems: "center",
|
|
@@ -2212,8 +2474,8 @@ var EmptyState = ({
|
|
|
2212
2474
|
height: containerHeight,
|
|
2213
2475
|
"data-testid": "empty-state-container"
|
|
2214
2476
|
},
|
|
2215
|
-
icon && /* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2477
|
+
icon && /* @__PURE__ */ import_react19.default.createElement(import_material13.Stack, null, icon),
|
|
2478
|
+
/* @__PURE__ */ import_react19.default.createElement(import_material13.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react19.default.createElement(import_material13.Typography, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ import_react19.default.createElement(
|
|
2217
2479
|
import_material13.Typography,
|
|
2218
2480
|
{
|
|
2219
2481
|
variant: subtitleVariant,
|
|
@@ -2221,7 +2483,7 @@ var EmptyState = ({
|
|
|
2221
2483
|
color: "text.secondary"
|
|
2222
2484
|
},
|
|
2223
2485
|
subtitle
|
|
2224
|
-
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */
|
|
2486
|
+
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ import_react19.default.createElement(
|
|
2225
2487
|
import_material13.Stack,
|
|
2226
2488
|
{
|
|
2227
2489
|
direction: "row",
|
|
@@ -2231,15 +2493,15 @@ var EmptyState = ({
|
|
|
2231
2493
|
},
|
|
2232
2494
|
actions.map((action, index) => {
|
|
2233
2495
|
var _a, _b, _c, _d;
|
|
2234
|
-
return /* @__PURE__ */
|
|
2496
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2235
2497
|
import_material13.Button,
|
|
2236
2498
|
{
|
|
2237
2499
|
key: index,
|
|
2238
2500
|
color: (_a = action.color) != null ? _a : "primary",
|
|
2239
2501
|
variant: (_b = action.variant) != null ? _b : "text",
|
|
2240
2502
|
size: (_c = action.size) != null ? _c : "small",
|
|
2241
|
-
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */
|
|
2242
|
-
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */
|
|
2503
|
+
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ import_react19.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2504
|
+
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ import_react19.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2243
2505
|
onClick: action.onClick
|
|
2244
2506
|
},
|
|
2245
2507
|
capitalize((_d = action.text) != null ? _d : "action")
|
|
@@ -2250,7 +2512,7 @@ var EmptyState = ({
|
|
|
2250
2512
|
};
|
|
2251
2513
|
|
|
2252
2514
|
// src/Components/SCDialog.tsx
|
|
2253
|
-
var
|
|
2515
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
2254
2516
|
var import_material14 = require("@mui/material");
|
|
2255
2517
|
var import_Grid25 = __toESM(require("@mui/material/Grid2"), 1);
|
|
2256
2518
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
|
|
@@ -2260,8 +2522,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2260
2522
|
let iconTitleValidation = "";
|
|
2261
2523
|
let IconTitle;
|
|
2262
2524
|
let ButtonIcon;
|
|
2263
|
-
const [open, setOpen] = (0,
|
|
2264
|
-
(0,
|
|
2525
|
+
const [open, setOpen] = (0, import_react20.useState)(show);
|
|
2526
|
+
(0, import_react20.useEffect)(() => {
|
|
2265
2527
|
if (show) {
|
|
2266
2528
|
handleOpen();
|
|
2267
2529
|
} else {
|
|
@@ -2286,7 +2548,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2286
2548
|
});
|
|
2287
2549
|
if (iconTitle) {
|
|
2288
2550
|
if (Muicon5[iconTitle] == void 0) {
|
|
2289
|
-
if (iconTitle &&
|
|
2551
|
+
if (iconTitle && import_react20.default.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
2290
2552
|
iconTitleValidation = "image";
|
|
2291
2553
|
IconTitle = iconTitle;
|
|
2292
2554
|
} else {
|
|
@@ -2311,8 +2573,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2311
2573
|
}
|
|
2312
2574
|
};
|
|
2313
2575
|
const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
2314
|
-
content = content != null ? content : { component: /* @__PURE__ */
|
|
2315
|
-
return /* @__PURE__ */
|
|
2576
|
+
content = content != null ? content : { component: /* @__PURE__ */ import_react20.default.createElement(import_material14.Box, null, " Aqui va el contenido ") };
|
|
2577
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", null, buttonDialog ? /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ import_react20.default.createElement(import_material14.Tooltip, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react20.default.createElement(import_material14.Button, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ import_react20.default.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ import_react20.default.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ import_react20.default.createElement(import_material14.IconButton, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ import_react20.default.createElement(import_material14.SvgIcon, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ import_react20.default.createElement(import_material14.Modal, { open: open || false, onClose: handleClose }, /* @__PURE__ */ import_react20.default.createElement(
|
|
2316
2578
|
import_material14.Dialog,
|
|
2317
2579
|
{
|
|
2318
2580
|
"data-testid": "dialog-element",
|
|
@@ -2326,8 +2588,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2326
2588
|
}
|
|
2327
2589
|
}
|
|
2328
2590
|
},
|
|
2329
|
-
title && /* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2591
|
+
title && /* @__PURE__ */ import_react20.default.createElement(import_material14.DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ import_react20.default.createElement(import_Grid25.default, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ import_react20.default.createElement(import_Grid25.default, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ import_react20.default.createElement(import_material14.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react20.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react20.default.createElement(import_material14.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ import_react20.default.createElement(import_Grid25.default, null, /* @__PURE__ */ import_react20.default.createElement(import_material14.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ import_react20.default.createElement(import_material14.Typography, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ import_react20.default.createElement(import_material14.IconButton, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ import_react20.default.createElement(import_Close2.default, null)) : "")),
|
|
2592
|
+
/* @__PURE__ */ import_react20.default.createElement(
|
|
2331
2593
|
import_material14.DialogContent,
|
|
2332
2594
|
{
|
|
2333
2595
|
"data-testid": "dialog-content",
|
|
@@ -2355,7 +2617,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2355
2617
|
}
|
|
2356
2618
|
}
|
|
2357
2619
|
},
|
|
2358
|
-
content.url ? /* @__PURE__ */
|
|
2620
|
+
content.url ? /* @__PURE__ */ import_react20.default.createElement(
|
|
2359
2621
|
"iframe",
|
|
2360
2622
|
{
|
|
2361
2623
|
style: { border: "none", minWidth: "100%", minHeight: "100%" },
|
|
@@ -2365,7 +2627,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2365
2627
|
}
|
|
2366
2628
|
) : content.component
|
|
2367
2629
|
),
|
|
2368
|
-
dialogActions.length > 0 ? /* @__PURE__ */
|
|
2630
|
+
dialogActions.length > 0 ? /* @__PURE__ */ import_react20.default.createElement(import_material14.DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
2369
2631
|
import_material14.Button,
|
|
2370
2632
|
{
|
|
2371
2633
|
variant: "text",
|
|
@@ -2373,11 +2635,11 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2373
2635
|
size: "small",
|
|
2374
2636
|
onClick: dialogActions[0].fn,
|
|
2375
2637
|
disabled: dialogActions[0].disabled || false,
|
|
2376
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */
|
|
2638
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ import_react20.default.createElement(import_material14.SvgIcon, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
2377
2639
|
},
|
|
2378
2640
|
dialogActions[0].text
|
|
2379
|
-
), /* @__PURE__ */
|
|
2380
|
-
return /* @__PURE__ */
|
|
2641
|
+
), /* @__PURE__ */ import_react20.default.createElement(import_material14.Box, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
2642
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2381
2643
|
import_material14.Button,
|
|
2382
2644
|
{
|
|
2383
2645
|
key: index + 1,
|
|
@@ -2386,12 +2648,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2386
2648
|
size: "small",
|
|
2387
2649
|
onClick: boton.fn,
|
|
2388
2650
|
disabled: boton.disabled || false,
|
|
2389
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2651
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react20.default.createElement(import_material14.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
2390
2652
|
},
|
|
2391
2653
|
boton.text
|
|
2392
2654
|
);
|
|
2393
2655
|
}))) : dialogActions.map((boton, index) => {
|
|
2394
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2395
2657
|
import_material14.Button,
|
|
2396
2658
|
{
|
|
2397
2659
|
key: index,
|
|
@@ -2400,7 +2662,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2400
2662
|
size: "small",
|
|
2401
2663
|
onClick: boton.fn,
|
|
2402
2664
|
disabled: boton.disabled || false,
|
|
2403
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2665
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react20.default.createElement(import_material14.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
2404
2666
|
},
|
|
2405
2667
|
boton.text
|
|
2406
2668
|
);
|
|
@@ -2409,12 +2671,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2409
2671
|
};
|
|
2410
2672
|
|
|
2411
2673
|
// src/Components/SCMenu.tsx
|
|
2412
|
-
var
|
|
2674
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
2413
2675
|
var import_material15 = require("@mui/material");
|
|
2414
2676
|
var import_Grid26 = __toESM(require("@mui/material/Grid2"), 1);
|
|
2415
2677
|
|
|
2416
2678
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
2417
|
-
var
|
|
2679
|
+
var import_react21 = require("react");
|
|
2418
2680
|
function getWindowDimensions() {
|
|
2419
2681
|
const { innerWidth: width, innerHeight: height } = window;
|
|
2420
2682
|
return {
|
|
@@ -2423,8 +2685,8 @@ function getWindowDimensions() {
|
|
|
2423
2685
|
};
|
|
2424
2686
|
}
|
|
2425
2687
|
function useWindowDimensions() {
|
|
2426
|
-
const [windowDimensions, setWindowDimensions] = (0,
|
|
2427
|
-
(0,
|
|
2688
|
+
const [windowDimensions, setWindowDimensions] = (0, import_react21.useState)(getWindowDimensions());
|
|
2689
|
+
(0, import_react21.useEffect)(() => {
|
|
2428
2690
|
function handleResize() {
|
|
2429
2691
|
setWindowDimensions(getWindowDimensions());
|
|
2430
2692
|
}
|
|
@@ -2442,12 +2704,12 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2442
2704
|
const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
|
|
2443
2705
|
const widthContainer = menuSize + pageSize;
|
|
2444
2706
|
let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2445
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2446
|
-
const [value, setValue] =
|
|
2447
|
-
|
|
2707
|
+
const [selectedIndex, setSelectedIndex] = import_react22.default.useState("1");
|
|
2708
|
+
const [value, setValue] = import_react22.default.useState("1");
|
|
2709
|
+
import_react22.default.useEffect(() => {
|
|
2448
2710
|
heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2449
2711
|
}, [height]);
|
|
2450
|
-
|
|
2712
|
+
import_react22.default.useEffect(() => {
|
|
2451
2713
|
if (defaultOption) {
|
|
2452
2714
|
handleClickMenusItem(event, void 0);
|
|
2453
2715
|
}
|
|
@@ -2477,7 +2739,7 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2477
2739
|
setValue(String(index + 1));
|
|
2478
2740
|
}
|
|
2479
2741
|
};
|
|
2480
|
-
return /* @__PURE__ */
|
|
2742
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(import_Grid26.default, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ import_react22.default.createElement(import_material15.Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ import_react22.default.createElement(import_material15.MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
2481
2743
|
import_material15.MenuItem,
|
|
2482
2744
|
{
|
|
2483
2745
|
disabled: disable == true ? true : false,
|
|
@@ -2485,26 +2747,26 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2485
2747
|
selected: String(index + 1) === selectedIndex,
|
|
2486
2748
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
2487
2749
|
},
|
|
2488
|
-
option.iconLeft ? /* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
), option.divider == true ? /* @__PURE__ */
|
|
2750
|
+
option.iconLeft ? /* @__PURE__ */ import_react22.default.createElement(import_material15.ListItemIcon, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react22.default.createElement(import_material15.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
2751
|
+
/* @__PURE__ */ import_react22.default.createElement(import_Grid26.default, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ import_react22.default.createElement(import_material15.Typography, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ import_react22.default.createElement(import_material15.ListItemIcon, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react22.default.createElement(import_material15.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
2752
|
+
), option.divider == true ? /* @__PURE__ */ import_react22.default.createElement(import_material15.Divider, null) : "")))), /* @__PURE__ */ import_react22.default.createElement(import_Grid26.default, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ import_react22.default.createElement(import_material15.Box, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ import_react22.default.createElement(import_material15.Typography, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
2491
2753
|
};
|
|
2492
2754
|
|
|
2493
2755
|
// src/Components/SCTabs.tsx
|
|
2494
|
-
var
|
|
2756
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
2495
2757
|
var import_material16 = require("@mui/material");
|
|
2496
2758
|
var import_TabPanel = __toESM(require("@mui/lab/TabPanel"), 1);
|
|
2497
2759
|
var import_TabContext = __toESM(require("@mui/lab/TabContext"), 1);
|
|
2498
2760
|
var Muicon7 = __toESM(require("@mui/icons-material"), 1);
|
|
2499
2761
|
var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
|
|
2500
|
-
const [toast, setToast] =
|
|
2762
|
+
const [toast, setToast] = import_react23.default.useState(null);
|
|
2501
2763
|
let i = 0;
|
|
2502
2764
|
let j = 0;
|
|
2503
2765
|
let k = 0;
|
|
2504
2766
|
let l = 0;
|
|
2505
2767
|
let validateTypeIcon = true;
|
|
2506
|
-
const [value, setValue] =
|
|
2507
|
-
(0,
|
|
2768
|
+
const [value, setValue] = import_react23.default.useState("1");
|
|
2769
|
+
(0, import_react23.useEffect)(() => {
|
|
2508
2770
|
if (defaultOption) {
|
|
2509
2771
|
handleChange(event, void 0);
|
|
2510
2772
|
}
|
|
@@ -2554,7 +2816,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2554
2816
|
setValue(newValue);
|
|
2555
2817
|
}
|
|
2556
2818
|
};
|
|
2557
|
-
return /* @__PURE__ */
|
|
2819
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ import_react23.default.createElement(import_material16.Box, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ import_react23.default.createElement(import_TabContext.default, { value }, /* @__PURE__ */ import_react23.default.createElement(
|
|
2558
2820
|
import_material16.Tabs,
|
|
2559
2821
|
{
|
|
2560
2822
|
"data-testid": "tab-container",
|
|
@@ -2568,7 +2830,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2568
2830
|
orientation: orientation || "horizontal",
|
|
2569
2831
|
sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
|
|
2570
2832
|
},
|
|
2571
|
-
options.map((option) => /* @__PURE__ */
|
|
2833
|
+
options.map((option) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2572
2834
|
import_material16.Tab,
|
|
2573
2835
|
{
|
|
2574
2836
|
"data-testid": "tab-item",
|
|
@@ -2577,7 +2839,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2577
2839
|
label: option.name || "",
|
|
2578
2840
|
disabled: option.disabled || false,
|
|
2579
2841
|
iconPosition: iconPosition || "end",
|
|
2580
|
-
icon: typeIcon == "badge" ? /* @__PURE__ */
|
|
2842
|
+
icon: typeIcon == "badge" ? /* @__PURE__ */ import_react23.default.createElement(
|
|
2581
2843
|
import_material16.Badge,
|
|
2582
2844
|
{
|
|
2583
2845
|
sx: {
|
|
@@ -2592,33 +2854,38 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2592
2854
|
badgeContent: option.iconOrBadge,
|
|
2593
2855
|
color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
|
|
2594
2856
|
}
|
|
2595
|
-
) : typeIcon == "icon" ? /* @__PURE__ */
|
|
2857
|
+
) : typeIcon == "icon" ? /* @__PURE__ */ import_react23.default.createElement(import_material16.SvgIcon, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
|
|
2596
2858
|
sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
|
|
2597
2859
|
}
|
|
2598
2860
|
))
|
|
2599
|
-
), children, options.map((option) => /* @__PURE__ */
|
|
2861
|
+
), children, options.map((option) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2600
2862
|
import_TabPanel.default,
|
|
2601
2863
|
{
|
|
2602
2864
|
key: k = k + 1,
|
|
2603
2865
|
value: String(l = l + 1),
|
|
2604
2866
|
sx: { padding: "16px" }
|
|
2605
2867
|
},
|
|
2606
|
-
option.page ? option.page : /* @__PURE__ */
|
|
2607
|
-
)))) : /* @__PURE__ */
|
|
2868
|
+
option.page ? option.page : /* @__PURE__ */ import_react23.default.createElement(import_material16.Typography, null, "No se ha configurado el componente a visualizar ")
|
|
2869
|
+
)))) : /* @__PURE__ */ import_react23.default.createElement(import_material16.Box, { sx: { height: "200px" } }, toast && /* @__PURE__ */ import_react23.default.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
|
|
2608
2870
|
};
|
|
2609
2871
|
|
|
2610
2872
|
// src/Components/Calendario/Calendar.tsx
|
|
2611
|
-
var
|
|
2873
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
2612
2874
|
var import_material22 = require("@mui/material");
|
|
2613
|
-
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
2614
2875
|
|
|
2615
2876
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
2616
|
-
var
|
|
2877
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
2617
2878
|
var import_icons_material10 = require("@mui/icons-material");
|
|
2618
2879
|
var import_material17 = require("@mui/material");
|
|
2619
2880
|
var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
2881
|
+
var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"), 1);
|
|
2620
2882
|
var import_es2 = require("dayjs/locale/es");
|
|
2621
2883
|
import_dayjs2.default.locale("es");
|
|
2884
|
+
import_dayjs2.default.extend(import_updateLocale.default);
|
|
2885
|
+
import_dayjs2.default.updateLocale("en", {
|
|
2886
|
+
weekStart: 0
|
|
2887
|
+
// 0 = domingo
|
|
2888
|
+
});
|
|
2622
2889
|
var CalendarToolbar = ({
|
|
2623
2890
|
labelDate,
|
|
2624
2891
|
view,
|
|
@@ -2626,7 +2893,7 @@ var CalendarToolbar = ({
|
|
|
2626
2893
|
onNavigate,
|
|
2627
2894
|
children
|
|
2628
2895
|
}) => {
|
|
2629
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
2896
|
+
const [anchorEl, setAnchorEl] = (0, import_react24.useState)(null);
|
|
2630
2897
|
const open = Boolean(anchorEl);
|
|
2631
2898
|
const handleMenuOpen = (event2) => {
|
|
2632
2899
|
setAnchorEl(event2.currentTarget);
|
|
@@ -2639,23 +2906,26 @@ var CalendarToolbar = ({
|
|
|
2639
2906
|
handleMenuClose();
|
|
2640
2907
|
};
|
|
2641
2908
|
const getFormattedDate = () => {
|
|
2909
|
+
const sunday = labelDate.day(0);
|
|
2910
|
+
const saturday = sunday.add(6, "day");
|
|
2642
2911
|
if (view === "month") {
|
|
2643
|
-
|
|
2912
|
+
const textMonth = labelDate.format("MMMM YYYY");
|
|
2913
|
+
return textMonth.charAt(0).toUpperCase() + textMonth.slice(1);
|
|
2644
2914
|
}
|
|
2645
2915
|
if (view === "week") {
|
|
2646
|
-
return `${labelDate.startOf("week").
|
|
2916
|
+
return `${labelDate.startOf("week").format("DD MMM")} - ${labelDate.endOf("week").format("DD MMM YYYY")}`;
|
|
2647
2917
|
}
|
|
2648
2918
|
return labelDate.format(" DD MMMM YYYY");
|
|
2649
2919
|
};
|
|
2650
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_material17.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 0.5, px: 1, py: 0.5 }, /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, null, /* @__PURE__ */ import_react24.default.createElement(
|
|
2651
2921
|
import_material17.Chip,
|
|
2652
2922
|
{
|
|
2653
2923
|
label: "Hoy",
|
|
2654
|
-
icon: /* @__PURE__ */
|
|
2924
|
+
icon: /* @__PURE__ */ import_react24.default.createElement(import_icons_material10.LightModeOutlined, { fontSize: "small" }),
|
|
2655
2925
|
color: "primary",
|
|
2656
2926
|
onClick: () => onNavigate("TODAY")
|
|
2657
2927
|
}
|
|
2658
|
-
)), /* @__PURE__ */
|
|
2928
|
+
)), /* @__PURE__ */ import_react24.default.createElement(import_material17.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { "aria-label": "Anterior", onClick: () => onNavigate("PREV"), size: "small", color: "primary" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material10.ChevronLeft, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { "aria-label": "Siguiente", onClick: () => onNavigate("NEXT"), size: "small", color: "primary" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material10.ChevronRight, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(import_material17.Typography, { variant: "h6", color: "primary", "data-testid": "currentDate" }, getFormattedDate()), /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { onClick: handleMenuOpen, size: "small", color: "primary", "aria-label": "Cambiar vista" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material10.KeyboardArrowDown, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(
|
|
2659
2929
|
import_material17.Menu,
|
|
2660
2930
|
{
|
|
2661
2931
|
anchorEl,
|
|
@@ -2664,14 +2934,14 @@ var CalendarToolbar = ({
|
|
|
2664
2934
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2665
2935
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
2666
2936
|
},
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
)), children ? /* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("month") }, "Mes"),
|
|
2938
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("week") }, "Semana"),
|
|
2939
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("day") }, "D\xEDa")
|
|
2940
|
+
)), children ? /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, null, children) : /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, { width: "24px" }), " ");
|
|
2671
2941
|
};
|
|
2672
2942
|
|
|
2673
2943
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
2674
|
-
var
|
|
2944
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
2675
2945
|
var import_material19 = require("@mui/material");
|
|
2676
2946
|
var import_Add = __toESM(require("@mui/icons-material/Add"), 1);
|
|
2677
2947
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
@@ -2698,14 +2968,24 @@ var stateColors = {
|
|
|
2698
2968
|
Asignada: "warning.main",
|
|
2699
2969
|
Finalizado: "primary.main",
|
|
2700
2970
|
Vencida: "error.main",
|
|
2701
|
-
EnProgreso: "success.main"
|
|
2971
|
+
EnProgreso: "success.main",
|
|
2972
|
+
Aplazada: "grey.400",
|
|
2973
|
+
Generada: "secondary.main"
|
|
2702
2974
|
};
|
|
2703
2975
|
|
|
2704
2976
|
// src/Components/Calendario/Event.tsx
|
|
2705
|
-
var
|
|
2977
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
2706
2978
|
var import_material18 = require("@mui/material");
|
|
2707
|
-
var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
2708
|
-
|
|
2979
|
+
var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
2980
|
+
const [anchorEl, setAnchorEl] = import_react25.default.useState(null);
|
|
2981
|
+
const handlePopoverOpen = (event3) => {
|
|
2982
|
+
setAnchorEl(event3.currentTarget);
|
|
2983
|
+
};
|
|
2984
|
+
const handlePopoverClose = () => {
|
|
2985
|
+
setAnchorEl(null);
|
|
2986
|
+
};
|
|
2987
|
+
const open = Boolean(anchorEl);
|
|
2988
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
2709
2989
|
import_material18.Stack,
|
|
2710
2990
|
{
|
|
2711
2991
|
direction: "row",
|
|
@@ -2713,6 +2993,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2713
2993
|
borderRadius: 0.5,
|
|
2714
2994
|
alignItems: "flex-start",
|
|
2715
2995
|
minHeight: "20px",
|
|
2996
|
+
onMouseOver: () => onHover == null ? void 0 : onHover(event2),
|
|
2716
2997
|
onClick: (e) => {
|
|
2717
2998
|
e.stopPropagation();
|
|
2718
2999
|
onClick == null ? void 0 : onClick(event2);
|
|
@@ -2725,7 +3006,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2725
3006
|
cursor: onClick ? "pointer" : "default"
|
|
2726
3007
|
}, sx)
|
|
2727
3008
|
},
|
|
2728
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
2729
3010
|
import_material18.Divider,
|
|
2730
3011
|
{
|
|
2731
3012
|
orientation: "vertical",
|
|
@@ -2737,7 +3018,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2737
3018
|
}
|
|
2738
3019
|
}
|
|
2739
3020
|
),
|
|
2740
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
2741
3022
|
import_material18.Box,
|
|
2742
3023
|
{
|
|
2743
3024
|
px: 1,
|
|
@@ -2747,7 +3028,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2747
3028
|
display: "flex",
|
|
2748
3029
|
alignItems: "center"
|
|
2749
3030
|
},
|
|
2750
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
2751
3032
|
import_material18.Typography,
|
|
2752
3033
|
{
|
|
2753
3034
|
color: "text.primary",
|
|
@@ -2757,29 +3038,62 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2757
3038
|
overflow: "hidden",
|
|
2758
3039
|
textOverflow: "ellipsis",
|
|
2759
3040
|
whiteSpace: "nowrap"
|
|
2760
|
-
}
|
|
3041
|
+
},
|
|
3042
|
+
onMouseEnter: handlePopoverOpen,
|
|
3043
|
+
onMouseLeave: handlePopoverClose
|
|
2761
3044
|
},
|
|
2762
3045
|
capitalize(event2.title)
|
|
3046
|
+
),
|
|
3047
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3048
|
+
import_material18.Popover,
|
|
3049
|
+
{
|
|
3050
|
+
id: "mouse-over-popover",
|
|
3051
|
+
sx: { pointerEvents: "none" },
|
|
3052
|
+
open,
|
|
3053
|
+
anchorEl,
|
|
3054
|
+
anchorOrigin: {
|
|
3055
|
+
vertical: "top",
|
|
3056
|
+
horizontal: "right"
|
|
3057
|
+
},
|
|
3058
|
+
transformOrigin: {
|
|
3059
|
+
vertical: "bottom",
|
|
3060
|
+
horizontal: "right"
|
|
3061
|
+
},
|
|
3062
|
+
onClose: handlePopoverClose,
|
|
3063
|
+
disableRestoreFocus: true
|
|
3064
|
+
},
|
|
3065
|
+
onHover ? onHover(event2) : /* @__PURE__ */ import_react25.default.createElement(import_material18.Typography, null, "Sin contenido")
|
|
2763
3066
|
)
|
|
2764
3067
|
)
|
|
2765
3068
|
);
|
|
2766
3069
|
};
|
|
2767
3070
|
|
|
3071
|
+
// src/assets/Icon Scheduler.svg
|
|
3072
|
+
var Icon_Scheduler_default = "./Icon Scheduler-WX62PISD.svg";
|
|
3073
|
+
|
|
2768
3074
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
2769
3075
|
import_dayjs4.default.extend(import_localeData.default);
|
|
2770
3076
|
import_dayjs4.default.extend(import_isBetween.default);
|
|
2771
|
-
var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick }) => {
|
|
3077
|
+
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover }) => {
|
|
3078
|
+
const noEvents = events.length === 0;
|
|
2772
3079
|
const days = getMonthDays(currentDate);
|
|
2773
3080
|
const weekDays = Array.from({ length: 7 }, (_, i) => (0, import_dayjs4.default)().day(i));
|
|
2774
|
-
const [openDrawer, setOpenDrawer] =
|
|
2775
|
-
const [selectedDay, setSelectedDay] =
|
|
2776
|
-
const [selectedEvents, setSelectedEvents] =
|
|
2777
|
-
return /* @__PURE__ */
|
|
3081
|
+
const [openDrawer, setOpenDrawer] = import_react26.default.useState(false);
|
|
3082
|
+
const [selectedDay, setSelectedDay] = import_react26.default.useState(null);
|
|
3083
|
+
const [selectedEvents, setSelectedEvents] = import_react26.default.useState([]);
|
|
3084
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { minWidth: "1050px" }, /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react26.default.createElement(import_material19.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react26.default.createElement(import_material19.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react26.default.createElement(
|
|
3085
|
+
EmptyState,
|
|
3086
|
+
{
|
|
3087
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3088
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3089
|
+
icon: /* @__PURE__ */ import_react26.default.createElement("img", { src: Icon_Scheduler_default, alt: "icon_calendario", style: { width: 60, height: 60 } })
|
|
3090
|
+
}
|
|
3091
|
+
) : /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5 }, days.map((day) => {
|
|
2778
3092
|
const dayEvents = events.filter(
|
|
2779
3093
|
(e) => day.isBetween(e.start.startOf("day"), e.end.endOf("day"), null, "[]")
|
|
2780
3094
|
);
|
|
2781
3095
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
2782
|
-
return /* @__PURE__ */
|
|
3096
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2783
3097
|
import_material19.Paper,
|
|
2784
3098
|
{
|
|
2785
3099
|
key: day.toString(),
|
|
@@ -2796,7 +3110,7 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2796
3110
|
overflow: "hidden"
|
|
2797
3111
|
}
|
|
2798
3112
|
},
|
|
2799
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { p: 1, flexShrink: 0 }, /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "flex", alignItems: "center", justifyContent: "flex-start" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
2800
3114
|
import_material19.Box,
|
|
2801
3115
|
{
|
|
2802
3116
|
sx: {
|
|
@@ -2809,7 +3123,7 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2809
3123
|
justifyContent: "center"
|
|
2810
3124
|
}
|
|
2811
3125
|
},
|
|
2812
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
2813
3127
|
import_material19.Typography,
|
|
2814
3128
|
{
|
|
2815
3129
|
variant: "body2",
|
|
@@ -2817,7 +3131,7 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2817
3131
|
},
|
|
2818
3132
|
day.date()
|
|
2819
3133
|
)
|
|
2820
|
-
), dayEvents.length > 2 && /* @__PURE__ */
|
|
3134
|
+
), dayEvents.length > 2 && /* @__PURE__ */ import_react26.default.createElement(import_material19.Tooltip, { title: "M\xE1s eventos" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
2821
3135
|
import_material19.IconButton,
|
|
2822
3136
|
{
|
|
2823
3137
|
color: "primary",
|
|
@@ -2829,18 +3143,19 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2829
3143
|
setSelectedEvents(dayEvents);
|
|
2830
3144
|
}
|
|
2831
3145
|
},
|
|
2832
|
-
/* @__PURE__ */
|
|
3146
|
+
/* @__PURE__ */ import_react26.default.createElement(import_Add.default, { fontSize: "small" })
|
|
2833
3147
|
)))),
|
|
2834
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "flex", flexDirection: "column", gap: 0.5, p: 1, pt: 0, overflow: "hidden" }, dayEvents.slice(0, 2).map((event2) => /* @__PURE__ */ import_react26.default.createElement(
|
|
2835
3149
|
CalendarEventCard,
|
|
2836
3150
|
{
|
|
2837
3151
|
key: `${event2.id}-${day.toString()}`,
|
|
2838
3152
|
event: event2,
|
|
2839
3153
|
color: stateColors[event2.state],
|
|
2840
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day)
|
|
3154
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3155
|
+
onHover: onEventHover
|
|
2841
3156
|
}
|
|
2842
3157
|
))),
|
|
2843
|
-
dayEvents.length > 2 && /* @__PURE__ */
|
|
3158
|
+
dayEvents.length > 2 && /* @__PURE__ */ import_react26.default.createElement(import_material19.Stack, { justifyContent: "flex-end", px: 1, pb: 0.5, onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react26.default.createElement(
|
|
2844
3159
|
SCDrawer,
|
|
2845
3160
|
{
|
|
2846
3161
|
width: "350px",
|
|
@@ -2852,7 +3167,7 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2852
3167
|
arrayElements: [{
|
|
2853
3168
|
component: (() => {
|
|
2854
3169
|
const [first, ...rest] = dayEvents;
|
|
2855
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { display: "flex", width: "100%", flexDirection: "column", height: "100%", pr: 1.5 }, /* @__PURE__ */ import_react26.default.createElement(import_material19.Typography, { width: "100%", color: "text.secondary" }, " Proximo evento "), first && /* @__PURE__ */ import_react26.default.createElement(import_material19.Box, { p: 1, pb: 1, width: "100%" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
2856
3171
|
CalendarEventCard,
|
|
2857
3172
|
{
|
|
2858
3173
|
event: first,
|
|
@@ -2867,7 +3182,7 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2867
3182
|
}
|
|
2868
3183
|
}
|
|
2869
3184
|
}
|
|
2870
|
-
)), /* @__PURE__ */
|
|
3185
|
+
)), /* @__PURE__ */ import_react26.default.createElement(import_material19.Divider, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ import_react26.default.createElement(import_material19.Typography, { width: "100%", py: 1, color: "text.secondary" }, " Eventos restantes "), /* @__PURE__ */ import_react26.default.createElement(
|
|
2871
3186
|
import_material19.Box,
|
|
2872
3187
|
{
|
|
2873
3188
|
width: "100%",
|
|
@@ -2880,13 +3195,14 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2880
3195
|
flexDirection: "column",
|
|
2881
3196
|
gap: 1.5
|
|
2882
3197
|
},
|
|
2883
|
-
rest.map((event2) => /* @__PURE__ */
|
|
3198
|
+
rest.map((event2) => /* @__PURE__ */ import_react26.default.createElement(
|
|
2884
3199
|
CalendarEventCard,
|
|
2885
3200
|
{
|
|
2886
3201
|
key: `${event2.id}-${day.toString()}`,
|
|
2887
3202
|
event: event2,
|
|
2888
3203
|
color: stateColors[event2.state],
|
|
2889
3204
|
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3205
|
+
onHover: onEventHover,
|
|
2890
3206
|
sx: {
|
|
2891
3207
|
whiteSpace: "normal",
|
|
2892
3208
|
"& .MuiTypography-root": {
|
|
@@ -2907,15 +3223,26 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2907
3223
|
};
|
|
2908
3224
|
|
|
2909
3225
|
// src/Components/Calendario/Views/WeekView.tsx
|
|
2910
|
-
var
|
|
3226
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
2911
3227
|
var import_material20 = require("@mui/material");
|
|
2912
3228
|
var import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
2913
3229
|
var import_localeData2 = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
2914
3230
|
import_dayjs5.default.extend(import_localeData2.default);
|
|
2915
|
-
var WeekView = ({
|
|
3231
|
+
var WeekView = ({
|
|
3232
|
+
events,
|
|
3233
|
+
currentDate,
|
|
3234
|
+
isLoading,
|
|
3235
|
+
onDayClick,
|
|
3236
|
+
onEventClick,
|
|
3237
|
+
onEventHover,
|
|
3238
|
+
startHour = 0,
|
|
3239
|
+
endHour = 23
|
|
3240
|
+
}) => {
|
|
3241
|
+
const noEvents = events.length === 0;
|
|
3242
|
+
const todayString = (0, import_dayjs5.default)().format("YYYY-MM-DD");
|
|
2916
3243
|
const startOfWeek2 = currentDate.startOf("week");
|
|
2917
3244
|
const days = Array.from({ length: 7 }, (_, i) => startOfWeek2.add(i, "day"));
|
|
2918
|
-
const
|
|
3245
|
+
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
2919
3246
|
const getCellBorderType = (cellHour, dayEvents) => {
|
|
2920
3247
|
for (const event2 of dayEvents) {
|
|
2921
3248
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -2923,8 +3250,7 @@ var WeekView = ({ events, currentDate, onDayClick, onEventClick }) => {
|
|
|
2923
3250
|
const cellStart = cellHour;
|
|
2924
3251
|
const cellEnd = cellHour + 1;
|
|
2925
3252
|
if (cellEnd > start && cellStart < end) {
|
|
2926
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2927
|
-
return "full";
|
|
3253
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01) return "full";
|
|
2928
3254
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
2929
3255
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
2930
3256
|
return "middle";
|
|
@@ -2932,92 +3258,122 @@ var WeekView = ({ events, currentDate, onDayClick, onEventClick }) => {
|
|
|
2932
3258
|
}
|
|
2933
3259
|
return "none";
|
|
2934
3260
|
};
|
|
2935
|
-
return /* @__PURE__ */
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
key: day.toString(),
|
|
2939
|
-
height: 40,
|
|
2940
|
-
flex: 1,
|
|
2941
|
-
pl: 0.5,
|
|
2942
|
-
textAlign: "center",
|
|
2943
|
-
display: "flex",
|
|
2944
|
-
flexDirection: "column",
|
|
2945
|
-
justifyContent: "center",
|
|
2946
|
-
alignItems: "flex-start"
|
|
2947
|
-
},
|
|
2948
|
-
/* @__PURE__ */ import_react26.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
2949
|
-
))), /* @__PURE__ */ import_react26.default.createElement(import_material20.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react26.default.createElement(import_material20.Box, { width: 45, bgcolor: "background.default" }, hours2.map((h) => /* @__PURE__ */ import_react26.default.createElement(
|
|
2950
|
-
import_material20.Box,
|
|
2951
|
-
{
|
|
2952
|
-
key: h,
|
|
2953
|
-
height: 60,
|
|
2954
|
-
textAlign: "right",
|
|
2955
|
-
pr: 1,
|
|
2956
|
-
borderTop: "1px solid",
|
|
2957
|
-
borderColor: "divider"
|
|
2958
|
-
},
|
|
2959
|
-
/* @__PURE__ */ import_react26.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs5.default)().hour(h).format("h A"))
|
|
2960
|
-
))), days.map((day) => {
|
|
2961
|
-
const dayEvents = events.filter(
|
|
2962
|
-
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
2963
|
-
);
|
|
2964
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3261
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { display: "flex", bgcolor: "transparent" }, /* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { width: 45, bgcolor: "transparent" }), days.map((day) => {
|
|
3262
|
+
const isToday2 = day.format("YYYY-MM-DD") === todayString;
|
|
3263
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
2965
3264
|
import_material20.Box,
|
|
2966
3265
|
{
|
|
2967
3266
|
key: day.toString(),
|
|
3267
|
+
height: 40,
|
|
2968
3268
|
flex: 1,
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
3269
|
+
pl: 0.5,
|
|
3270
|
+
textAlign: "center",
|
|
3271
|
+
display: "flex",
|
|
3272
|
+
flexDirection: "column",
|
|
3273
|
+
justifyContent: "center",
|
|
3274
|
+
alignItems: "flex-start",
|
|
3275
|
+
bgcolor: isToday2 ? "primary.100" : "transparent",
|
|
3276
|
+
borderRadius: isToday2 ? "6px 6px 0 0" : "0",
|
|
3277
|
+
borderBottom: isToday2 ? 2 : 0,
|
|
3278
|
+
borderColor: isToday2 ? "primary.main" : "transparent"
|
|
2974
3279
|
},
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2978
|
-
import_material20.Box,
|
|
2979
|
-
{
|
|
2980
|
-
key: hourIdx,
|
|
2981
|
-
height: 60,
|
|
2982
|
-
borderTop: "1px solid",
|
|
2983
|
-
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
2984
|
-
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
2985
|
-
}
|
|
2986
|
-
);
|
|
2987
|
-
}),
|
|
2988
|
-
dayEvents.map((event2) => {
|
|
2989
|
-
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(0).minute(0);
|
|
2990
|
-
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(23).minute(59);
|
|
2991
|
-
const startMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
2992
|
-
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
2993
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2994
|
-
CalendarEventCard,
|
|
2995
|
-
{
|
|
2996
|
-
key: `${event2.id}-${day.toString()}`,
|
|
2997
|
-
event: event2,
|
|
2998
|
-
color: stateColors[event2.state],
|
|
2999
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3000
|
-
sx: {
|
|
3001
|
-
position: "absolute",
|
|
3002
|
-
top: `${startMinutes + 15}px`,
|
|
3003
|
-
left: 4,
|
|
3004
|
-
right: 4,
|
|
3005
|
-
cursor: "pointer",
|
|
3006
|
-
height: "auto"
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
);
|
|
3010
|
-
})
|
|
3280
|
+
/* @__PURE__ */ import_react27.default.createElement(import_material20.Typography, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3281
|
+
/* @__PURE__ */ import_react27.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3011
3282
|
);
|
|
3012
|
-
})))
|
|
3283
|
+
})), isLoading ? /* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react27.default.createElement(import_material20.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react27.default.createElement(
|
|
3284
|
+
EmptyState,
|
|
3285
|
+
{
|
|
3286
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3287
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3288
|
+
icon: /* @__PURE__ */ import_react27.default.createElement("img", { src: Icon_Scheduler_default, alt: "icon_calendario", style: { width: 60, height: 60 } })
|
|
3289
|
+
}
|
|
3290
|
+
) : (
|
|
3291
|
+
// Grid de horas y eventos
|
|
3292
|
+
/* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react27.default.createElement(import_material20.Box, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ import_react27.default.createElement(
|
|
3293
|
+
import_material20.Box,
|
|
3294
|
+
{
|
|
3295
|
+
key: h,
|
|
3296
|
+
height: 60,
|
|
3297
|
+
textAlign: "right",
|
|
3298
|
+
pr: 1,
|
|
3299
|
+
borderColor: "divider"
|
|
3300
|
+
},
|
|
3301
|
+
/* @__PURE__ */ import_react27.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs5.default)().hour(h).format("h A"))
|
|
3302
|
+
))), days.map((day) => {
|
|
3303
|
+
const dayEvents = events.filter(
|
|
3304
|
+
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3305
|
+
).filter((event2) => {
|
|
3306
|
+
const startsInRange = event2.start.hour() >= startHour && event2.start.hour() <= endHour;
|
|
3307
|
+
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
3308
|
+
return startsInRange || endsInRange;
|
|
3309
|
+
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
3310
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
3311
|
+
import_material20.Box,
|
|
3312
|
+
{
|
|
3313
|
+
key: day.toString(),
|
|
3314
|
+
flex: 1,
|
|
3315
|
+
borderLeft: "1px solid",
|
|
3316
|
+
borderColor: "divider",
|
|
3317
|
+
position: "relative",
|
|
3318
|
+
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
3319
|
+
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
3320
|
+
},
|
|
3321
|
+
hours.map((hourIdx) => {
|
|
3322
|
+
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3323
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
3324
|
+
import_material20.Box,
|
|
3325
|
+
{
|
|
3326
|
+
key: hourIdx,
|
|
3327
|
+
height: 60,
|
|
3328
|
+
borderTop: "1px solid",
|
|
3329
|
+
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
3330
|
+
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
3331
|
+
}
|
|
3332
|
+
);
|
|
3333
|
+
}),
|
|
3334
|
+
dayEvents.map((event2) => {
|
|
3335
|
+
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(startHour).minute(0);
|
|
3336
|
+
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
3337
|
+
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
3338
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
3339
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
3340
|
+
CalendarEventCard,
|
|
3341
|
+
{
|
|
3342
|
+
key: `${event2.id}-${day.toString()}`,
|
|
3343
|
+
event: event2,
|
|
3344
|
+
color: stateColors[event2.state],
|
|
3345
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3346
|
+
onHover: onEventHover,
|
|
3347
|
+
sx: {
|
|
3348
|
+
position: "absolute",
|
|
3349
|
+
top: `${startMinutes}px`,
|
|
3350
|
+
left: 4,
|
|
3351
|
+
right: 4,
|
|
3352
|
+
cursor: "pointer",
|
|
3353
|
+
height: `${durationMinutes}px`
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
);
|
|
3357
|
+
})
|
|
3358
|
+
);
|
|
3359
|
+
}))
|
|
3360
|
+
));
|
|
3013
3361
|
};
|
|
3014
3362
|
|
|
3015
3363
|
// src/Components/Calendario/Views/DayView.tsx
|
|
3016
|
-
var
|
|
3364
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
3017
3365
|
var import_material21 = require("@mui/material");
|
|
3018
3366
|
var import_dayjs6 = __toESM(require("dayjs"), 1);
|
|
3019
|
-
var
|
|
3020
|
-
|
|
3367
|
+
var DayView = ({
|
|
3368
|
+
events,
|
|
3369
|
+
currentDate,
|
|
3370
|
+
isLoading,
|
|
3371
|
+
onEventClick,
|
|
3372
|
+
onEventHover,
|
|
3373
|
+
startHour = 0,
|
|
3374
|
+
endHour = 24
|
|
3375
|
+
}) => {
|
|
3376
|
+
const hours = Array.from({ length: endHour - startHour }, (_, i) => startHour + i);
|
|
3021
3377
|
const getCellBorderType = (cellHour, dayEvents2) => {
|
|
3022
3378
|
for (const event2 of dayEvents2) {
|
|
3023
3379
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -3025,8 +3381,7 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3025
3381
|
const cellStart = cellHour;
|
|
3026
3382
|
const cellEnd = cellHour + 1;
|
|
3027
3383
|
if (cellEnd > start && cellStart < end) {
|
|
3028
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
3029
|
-
return "full";
|
|
3384
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01) return "full";
|
|
3030
3385
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
3031
3386
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
3032
3387
|
return "middle";
|
|
@@ -3037,20 +3392,15 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3037
3392
|
const dayEvents = events.filter(
|
|
3038
3393
|
(event2) => currentDate.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3039
3394
|
);
|
|
3040
|
-
|
|
3041
|
-
|
|
3395
|
+
const noEvents = events.length === 0;
|
|
3396
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { width: 47, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react28.default.createElement(import_material21.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react28.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react28.default.createElement(import_material21.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : noEvents ? /* @__PURE__ */ import_react28.default.createElement(
|
|
3397
|
+
EmptyState,
|
|
3042
3398
|
{
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
py: 1,
|
|
3049
|
-
bgcolor: "primary.50"
|
|
3050
|
-
},
|
|
3051
|
-
/* @__PURE__ */ import_react27.default.createElement(import_material21.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")),
|
|
3052
|
-
/* @__PURE__ */ import_react27.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd"))
|
|
3053
|
-
)), /* @__PURE__ */ import_react27.default.createElement(import_material21.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react27.default.createElement(import_material21.Box, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ import_react27.default.createElement(
|
|
3399
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3400
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3401
|
+
icon: /* @__PURE__ */ import_react28.default.createElement("img", { src: Icon_Scheduler_default, alt: "icon_calendario", style: { width: 60, height: 60 } })
|
|
3402
|
+
}
|
|
3403
|
+
) : /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ import_react28.default.createElement(
|
|
3054
3404
|
import_material21.Box,
|
|
3055
3405
|
{
|
|
3056
3406
|
key: h,
|
|
@@ -3061,10 +3411,10 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3061
3411
|
borderRight: "1px solid",
|
|
3062
3412
|
borderColor: "divider"
|
|
3063
3413
|
},
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
))), /* @__PURE__ */
|
|
3414
|
+
/* @__PURE__ */ import_react28.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
3415
|
+
))), /* @__PURE__ */ import_react28.default.createElement(import_material21.Box, { flex: 1, position: "relative" }, hours.map((hourIdx) => {
|
|
3066
3416
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3067
|
-
return /* @__PURE__ */
|
|
3417
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
3068
3418
|
import_material21.Box,
|
|
3069
3419
|
{
|
|
3070
3420
|
key: hourIdx,
|
|
@@ -3075,20 +3425,26 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3075
3425
|
}
|
|
3076
3426
|
);
|
|
3077
3427
|
}), dayEvents.map((event2) => {
|
|
3078
|
-
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day")
|
|
3079
|
-
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day")
|
|
3080
|
-
const
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3428
|
+
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day");
|
|
3429
|
+
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day");
|
|
3430
|
+
const minStart = currentDate.hour(startHour).minute(0);
|
|
3431
|
+
const maxEnd = currentDate.hour(endHour).minute(0);
|
|
3432
|
+
const clampedStart = eventStart.isBefore(minStart) ? minStart : eventStart;
|
|
3433
|
+
const clampedEnd = eventEnd.isAfter(maxEnd) ? maxEnd : eventEnd;
|
|
3434
|
+
const startMinutes = (clampedStart.hour() - startHour) * 60 + clampedStart.minute();
|
|
3435
|
+
const durationMinutes = clampedEnd.diff(clampedStart, "minute");
|
|
3436
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
3083
3437
|
CalendarEventCard,
|
|
3084
3438
|
{
|
|
3085
3439
|
key: `${event2.id}-${currentDate.toString()}`,
|
|
3086
3440
|
event: event2,
|
|
3087
3441
|
color: stateColors[event2.state],
|
|
3088
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2),
|
|
3442
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, currentDate),
|
|
3443
|
+
onHover: onEventHover,
|
|
3089
3444
|
sx: {
|
|
3090
3445
|
position: "absolute",
|
|
3091
|
-
top: `${startMinutes
|
|
3446
|
+
top: `${startMinutes}px`,
|
|
3447
|
+
height: `${durationMinutes}px`,
|
|
3092
3448
|
left: 4,
|
|
3093
3449
|
right: 4
|
|
3094
3450
|
}
|
|
@@ -3098,17 +3454,23 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3098
3454
|
};
|
|
3099
3455
|
|
|
3100
3456
|
// src/Components/Calendario/Calendar.tsx
|
|
3457
|
+
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
3101
3458
|
var Calendar = ({
|
|
3102
3459
|
events,
|
|
3103
3460
|
onDayClick,
|
|
3104
3461
|
onMoreClick,
|
|
3105
3462
|
onEventClick,
|
|
3463
|
+
onEventHover,
|
|
3106
3464
|
view: initialView = "month",
|
|
3107
3465
|
onViewChange,
|
|
3108
|
-
toolbar
|
|
3466
|
+
toolbar,
|
|
3467
|
+
isLoading = false,
|
|
3468
|
+
startHour = 0,
|
|
3469
|
+
// <- valor por defecto
|
|
3470
|
+
endHour = 23
|
|
3109
3471
|
}) => {
|
|
3110
|
-
const [view, setView] = (0,
|
|
3111
|
-
const [currentDate, setCurrentDate] = (0,
|
|
3472
|
+
const [view, setView] = (0, import_react29.useState)(initialView);
|
|
3473
|
+
const [currentDate, setCurrentDate] = (0, import_react29.useState)((0, import_dayjs7.default)());
|
|
3112
3474
|
const handleViewChange = (newView) => {
|
|
3113
3475
|
setView(newView);
|
|
3114
3476
|
onViewChange == null ? void 0 : onViewChange(newView);
|
|
@@ -3121,7 +3483,7 @@ var Calendar = ({
|
|
|
3121
3483
|
else if (action === "TODAY") newDate = (0, import_dayjs7.default)();
|
|
3122
3484
|
setCurrentDate(newDate);
|
|
3123
3485
|
};
|
|
3124
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ import_react29.default.createElement(import_material22.Box, null, /* @__PURE__ */ import_react29.default.createElement(
|
|
3125
3487
|
CalendarToolbar,
|
|
3126
3488
|
{
|
|
3127
3489
|
labelDate: currentDate,
|
|
@@ -3130,39 +3492,203 @@ var Calendar = ({
|
|
|
3130
3492
|
onNavigate: handleNavigate
|
|
3131
3493
|
},
|
|
3132
3494
|
toolbar
|
|
3133
|
-
),
|
|
3495
|
+
), isLoading ? /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(import_material22.Box, null, /* @__PURE__ */ import_react29.default.createElement(
|
|
3496
|
+
import_material22.Box,
|
|
3497
|
+
{
|
|
3498
|
+
display: "flex",
|
|
3499
|
+
justifyContent: "center",
|
|
3500
|
+
alignItems: "center",
|
|
3501
|
+
height: "400px"
|
|
3502
|
+
},
|
|
3503
|
+
/* @__PURE__ */ import_react29.default.createElement(import_material22.CircularProgress, { variant: "indeterminate" })
|
|
3504
|
+
))) : /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, view === "month" && /* @__PURE__ */ import_react29.default.createElement(
|
|
3134
3505
|
MonthView,
|
|
3135
3506
|
{
|
|
3136
3507
|
events,
|
|
3508
|
+
currentDate,
|
|
3137
3509
|
onDayClick,
|
|
3138
3510
|
onMoreClick,
|
|
3139
3511
|
onEventClick,
|
|
3140
|
-
|
|
3512
|
+
onEventHover
|
|
3141
3513
|
}
|
|
3142
|
-
), view === "week" && /* @__PURE__ */
|
|
3514
|
+
), view === "week" && /* @__PURE__ */ import_react29.default.createElement(
|
|
3143
3515
|
WeekView,
|
|
3144
3516
|
{
|
|
3145
3517
|
events,
|
|
3146
3518
|
currentDate,
|
|
3147
3519
|
onDayClick,
|
|
3148
3520
|
onMoreClick,
|
|
3149
|
-
onEventClick
|
|
3521
|
+
onEventClick,
|
|
3522
|
+
onEventHover,
|
|
3523
|
+
startHour,
|
|
3524
|
+
endHour
|
|
3150
3525
|
}
|
|
3151
|
-
), view === "day" && /* @__PURE__ */
|
|
3526
|
+
), view === "day" && /* @__PURE__ */ import_react29.default.createElement(
|
|
3152
3527
|
DayView,
|
|
3153
3528
|
{
|
|
3154
3529
|
events,
|
|
3155
3530
|
currentDate,
|
|
3156
|
-
onEventClick
|
|
3531
|
+
onEventClick,
|
|
3532
|
+
onEventHover,
|
|
3533
|
+
startHour,
|
|
3534
|
+
endHour
|
|
3157
3535
|
}
|
|
3158
|
-
));
|
|
3536
|
+
)));
|
|
3537
|
+
};
|
|
3538
|
+
|
|
3539
|
+
// src/Components/SCTime.tsx
|
|
3540
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
3541
|
+
var import_material23 = require("@mui/material");
|
|
3542
|
+
var import_LocalizationProvider3 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
3543
|
+
var import_AdapterDayjs2 = require("@mui/x-date-pickers/AdapterDayjs");
|
|
3544
|
+
var import_dayjs8 = __toESM(require("dayjs"), 1);
|
|
3545
|
+
var import_es3 = require("dayjs/locale/es");
|
|
3546
|
+
var import_x_license_pro3 = require("@mui/x-license-pro");
|
|
3547
|
+
var import_AccessTime = __toESM(require("@mui/icons-material/AccessTime"), 1);
|
|
3548
|
+
var import_TimeField = require("@mui/x-date-pickers/TimeField");
|
|
3549
|
+
var import_DigitalClock = require("@mui/x-date-pickers/DigitalClock");
|
|
3550
|
+
var SCTime = ({
|
|
3551
|
+
label = "Hora",
|
|
3552
|
+
required = false,
|
|
3553
|
+
disabled = false,
|
|
3554
|
+
background = "transparent",
|
|
3555
|
+
timeStep = 5,
|
|
3556
|
+
state,
|
|
3557
|
+
setState
|
|
3558
|
+
}) => {
|
|
3559
|
+
import_x_license_pro3.LicenseInfo.setLicenseKey(
|
|
3560
|
+
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
3561
|
+
);
|
|
3562
|
+
const isTimeEmpty = required && !state;
|
|
3563
|
+
const hasError = isTimeEmpty;
|
|
3564
|
+
const [anchorEl, setAnchorEl] = (0, import_react30.useState)(null);
|
|
3565
|
+
const [isOpenPopover, setIsOpenPopover] = (0, import_react30.useState)(false);
|
|
3566
|
+
const [popoverPlacement, setPopoverPlacement] = (0, import_react30.useState)("bottom");
|
|
3567
|
+
const detectPlacement = (element) => {
|
|
3568
|
+
const rect = element.getBoundingClientRect();
|
|
3569
|
+
const windowHeight = window.innerHeight;
|
|
3570
|
+
const spaceBelow = windowHeight - rect.bottom;
|
|
3571
|
+
const spaceAbove = rect.top;
|
|
3572
|
+
const popoverHeight = 300;
|
|
3573
|
+
if (spaceBelow < popoverHeight && spaceAbove > spaceBelow) {
|
|
3574
|
+
setPopoverPlacement("top");
|
|
3575
|
+
} else {
|
|
3576
|
+
setPopoverPlacement("bottom");
|
|
3577
|
+
}
|
|
3578
|
+
};
|
|
3579
|
+
const handleTimeFieldClick = (event2) => {
|
|
3580
|
+
if (!disabled) {
|
|
3581
|
+
const target = event2.currentTarget;
|
|
3582
|
+
setAnchorEl(target);
|
|
3583
|
+
detectPlacement(target);
|
|
3584
|
+
setIsOpenPopover(true);
|
|
3585
|
+
}
|
|
3586
|
+
};
|
|
3587
|
+
const handleTimeChange = (newValue) => {
|
|
3588
|
+
const dayjsValue = newValue ? (0, import_dayjs8.default)(newValue) : null;
|
|
3589
|
+
setState(dayjsValue);
|
|
3590
|
+
setIsOpenPopover(false);
|
|
3591
|
+
setAnchorEl(null);
|
|
3592
|
+
};
|
|
3593
|
+
const handleClose = () => {
|
|
3594
|
+
setIsOpenPopover(false);
|
|
3595
|
+
setAnchorEl(null);
|
|
3596
|
+
};
|
|
3597
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_LocalizationProvider3.LocalizationProvider, { dateAdapter: import_AdapterDayjs2.AdapterDayjs }, /* @__PURE__ */ import_react30.default.createElement(import_material23.Box, { sx: { position: "relative", width: "120px" } }, /* @__PURE__ */ import_react30.default.createElement(
|
|
3598
|
+
import_TimeField.TimeField,
|
|
3599
|
+
{
|
|
3600
|
+
label,
|
|
3601
|
+
value: state,
|
|
3602
|
+
disabled,
|
|
3603
|
+
required,
|
|
3604
|
+
error: hasError,
|
|
3605
|
+
onClick: handleTimeFieldClick,
|
|
3606
|
+
slotProps: {
|
|
3607
|
+
textField: {
|
|
3608
|
+
InputProps: {
|
|
3609
|
+
endAdornment: /* @__PURE__ */ import_react30.default.createElement(import_material23.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react30.default.createElement(
|
|
3610
|
+
import_AccessTime.default,
|
|
3611
|
+
{
|
|
3612
|
+
color: disabled ? "disabled" : "action",
|
|
3613
|
+
sx: { cursor: disabled ? "default" : "pointer" },
|
|
3614
|
+
fontSize: "small"
|
|
3615
|
+
}
|
|
3616
|
+
)),
|
|
3617
|
+
sx: {
|
|
3618
|
+
backgroundColor: background,
|
|
3619
|
+
padding: "8px 12px",
|
|
3620
|
+
cursor: disabled ? "default" : "pointer",
|
|
3621
|
+
"& input": {
|
|
3622
|
+
cursor: disabled ? "default" : "pointer"
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
},
|
|
3628
|
+
sx: {
|
|
3629
|
+
width: "100%",
|
|
3630
|
+
"& .MuiInputBase-input": {
|
|
3631
|
+
cursor: disabled ? "default" : "pointer"
|
|
3632
|
+
},
|
|
3633
|
+
"& .MuiPickersSectionList-root": {
|
|
3634
|
+
padding: "0px !important"
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
), /* @__PURE__ */ import_react30.default.createElement(
|
|
3639
|
+
import_material23.Popover,
|
|
3640
|
+
{
|
|
3641
|
+
open: isOpenPopover,
|
|
3642
|
+
anchorEl,
|
|
3643
|
+
onClose: handleClose,
|
|
3644
|
+
anchorOrigin: {
|
|
3645
|
+
vertical: popoverPlacement === "top" ? "top" : "bottom",
|
|
3646
|
+
horizontal: "left"
|
|
3647
|
+
},
|
|
3648
|
+
transformOrigin: {
|
|
3649
|
+
vertical: popoverPlacement === "top" ? "bottom" : "top",
|
|
3650
|
+
horizontal: "left"
|
|
3651
|
+
},
|
|
3652
|
+
marginThreshold: 0,
|
|
3653
|
+
disableScrollLock: true,
|
|
3654
|
+
slotProps: {
|
|
3655
|
+
paper: {
|
|
3656
|
+
sx: {
|
|
3657
|
+
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.1)",
|
|
3658
|
+
borderRadius: 1,
|
|
3659
|
+
border: "1px solid #e0e0e0",
|
|
3660
|
+
maxHeight: "300px",
|
|
3661
|
+
overflow: "visible"
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
}
|
|
3665
|
+
},
|
|
3666
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material23.ClickAwayListener, { onClickAway: handleClose }, /* @__PURE__ */ import_react30.default.createElement(import_material23.Box, { sx: { p: 0 } }, /* @__PURE__ */ import_react30.default.createElement(
|
|
3667
|
+
import_DigitalClock.DigitalClock,
|
|
3668
|
+
{
|
|
3669
|
+
value: state,
|
|
3670
|
+
onChange: handleTimeChange,
|
|
3671
|
+
timeStep,
|
|
3672
|
+
sx: {
|
|
3673
|
+
"& .MuiList-root": {
|
|
3674
|
+
maxHeight: "250px",
|
|
3675
|
+
overflow: "auto"
|
|
3676
|
+
},
|
|
3677
|
+
"& .MuiMenuItem-root": {
|
|
3678
|
+
fontSize: "0.875rem",
|
|
3679
|
+
py: 0.5
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
)))
|
|
3684
|
+
)));
|
|
3159
3685
|
};
|
|
3160
3686
|
|
|
3161
3687
|
// src/Theme/index.ts
|
|
3162
3688
|
var import_styles3 = require("@mui/material/styles");
|
|
3163
3689
|
|
|
3164
3690
|
// src/Theme/components.ts
|
|
3165
|
-
var
|
|
3691
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3166
3692
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3167
3693
|
var components = {
|
|
3168
3694
|
MuiSelect: {
|
|
@@ -3860,10 +4386,10 @@ var components = {
|
|
|
3860
4386
|
MuiAlert: {
|
|
3861
4387
|
defaultProps: {
|
|
3862
4388
|
iconMapping: {
|
|
3863
|
-
success:
|
|
3864
|
-
error:
|
|
3865
|
-
warning:
|
|
3866
|
-
info:
|
|
4389
|
+
success: import_react31.default.createElement(import_icons_material11.CheckCircleRounded),
|
|
4390
|
+
error: import_react31.default.createElement(import_icons_material11.ErrorRounded),
|
|
4391
|
+
warning: import_react31.default.createElement(import_icons_material11.WarningRounded),
|
|
4392
|
+
info: import_react31.default.createElement(import_icons_material11.InfoRounded)
|
|
3867
4393
|
}
|
|
3868
4394
|
},
|
|
3869
4395
|
variants: [
|
|
@@ -4923,6 +5449,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
4923
5449
|
SCTabs,
|
|
4924
5450
|
SCTextArea,
|
|
4925
5451
|
SCTextField,
|
|
5452
|
+
SCTime,
|
|
4926
5453
|
SCToastNotification,
|
|
4927
5454
|
SincoTheme,
|
|
4928
5455
|
ToastProgress,
|