componentes-sinco 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +950 -722
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +793 -566
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,17 +30,423 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
// src/Components/Adjuntar/Adjuntar.tsx
|
|
34
|
+
import React2, { useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
|
35
|
+
import { Box as Box2, Button as Button2, IconButton as IconButton2, LinearProgress as LinearProgress2, Stack as Stack2, Typography as Typography2 } from "@mui/material";
|
|
36
|
+
import { CloudUploadOutlined, AttachFileOutlined, DeleteOutline, UploadFileOutlined } from "@mui/icons-material";
|
|
37
|
+
|
|
38
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
39
|
+
import React, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
40
|
+
import { Stack, LinearProgress, Divider, Box, Typography, IconButton, Button } from "@mui/material";
|
|
41
|
+
import { Close, InfoRounded, CheckCircleRounded, WarningRounded, ErrorRounded, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
|
|
42
|
+
|
|
43
|
+
// src/Components/ToastNotification/useProgress.ts
|
|
44
|
+
import { useEffect, useState } from "react";
|
|
45
|
+
var useProgress = (timeProgress, lote) => {
|
|
46
|
+
const [progress, setProgress] = useState(0);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const interval = setInterval(() => {
|
|
49
|
+
setProgress((prev) => {
|
|
50
|
+
if (prev >= 100) {
|
|
51
|
+
clearInterval(interval);
|
|
52
|
+
}
|
|
53
|
+
if (lote) {
|
|
54
|
+
const nextProgress = prev + lote;
|
|
55
|
+
return nextProgress <= 100 ? nextProgress : 100;
|
|
56
|
+
} else {
|
|
57
|
+
return prev + 1;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, timeProgress * 10);
|
|
61
|
+
return () => {
|
|
62
|
+
clearInterval(interval);
|
|
63
|
+
};
|
|
64
|
+
}, [timeProgress, lote]);
|
|
65
|
+
return {
|
|
66
|
+
progress
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var ToastProgress = (timeProgress) => {
|
|
70
|
+
const [progress, setProgress] = useState(100);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
const interval = setInterval(() => {
|
|
73
|
+
setProgress((prev) => {
|
|
74
|
+
if (prev <= 0) {
|
|
75
|
+
clearInterval(interval);
|
|
76
|
+
}
|
|
77
|
+
return prev - 1;
|
|
78
|
+
});
|
|
79
|
+
}, timeProgress * 10);
|
|
80
|
+
return () => {
|
|
81
|
+
clearInterval(interval);
|
|
82
|
+
};
|
|
83
|
+
}, [timeProgress]);
|
|
84
|
+
return {
|
|
85
|
+
progressToast: progress
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
90
|
+
var SCToastNotification = (toast) => {
|
|
91
|
+
var _a;
|
|
92
|
+
const [stateOptions, setStateOptions] = useState2(true);
|
|
93
|
+
const [stateToast, setStateToast] = useState2(true);
|
|
94
|
+
const timeProgress = toast.time || 10;
|
|
95
|
+
const { progress } = useProgress(timeProgress);
|
|
96
|
+
const toastColorConfig = toast.type || "info";
|
|
97
|
+
const toastIconOption = {
|
|
98
|
+
success: /* @__PURE__ */ React.createElement(CheckCircleRounded, { color: "success" }),
|
|
99
|
+
error: /* @__PURE__ */ React.createElement(ErrorRounded, { color: "error" }),
|
|
100
|
+
warning: /* @__PURE__ */ React.createElement(WarningRounded, { color: "warning" }),
|
|
101
|
+
info: /* @__PURE__ */ React.createElement(InfoRounded, { color: "info" })
|
|
102
|
+
};
|
|
103
|
+
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
104
|
+
alert("");
|
|
105
|
+
} }, { text: "Consultar", fn: () => {
|
|
106
|
+
} }]];
|
|
107
|
+
const ToastIconConfig = toastIconOption[toast.type];
|
|
108
|
+
const closeToast = () => {
|
|
109
|
+
setStateToast(false);
|
|
110
|
+
};
|
|
111
|
+
const toggleToastOptions = () => {
|
|
112
|
+
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
113
|
+
};
|
|
114
|
+
useEffect2(() => {
|
|
115
|
+
progress >= 100 && setStateToast(false);
|
|
116
|
+
}, [progress]);
|
|
117
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, stateToast && /* @__PURE__ */ React.createElement(
|
|
118
|
+
Stack,
|
|
119
|
+
{
|
|
120
|
+
position: "fixed",
|
|
121
|
+
zIndex: 1400,
|
|
122
|
+
right: 16,
|
|
123
|
+
top: 16,
|
|
124
|
+
width: 370,
|
|
125
|
+
sx: {
|
|
126
|
+
boxShadow: (theme) => theme.shadows[8]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
/* @__PURE__ */ React.createElement(
|
|
130
|
+
Box,
|
|
131
|
+
{
|
|
132
|
+
padding: 1.5,
|
|
133
|
+
gap: 1.5,
|
|
134
|
+
display: "flex",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
sx: {
|
|
137
|
+
backgroundColor: {
|
|
138
|
+
success: "success.50",
|
|
139
|
+
error: "error.50",
|
|
140
|
+
warning: "warning.50",
|
|
141
|
+
info: "info.50"
|
|
142
|
+
}[toastColorConfig]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
/* @__PURE__ */ React.createElement(
|
|
146
|
+
Stack,
|
|
147
|
+
{
|
|
148
|
+
p: 1,
|
|
149
|
+
gap: 1,
|
|
150
|
+
borderRadius: 50,
|
|
151
|
+
bgcolor: {
|
|
152
|
+
success: "success.100",
|
|
153
|
+
error: "error.100",
|
|
154
|
+
warning: "warning.100",
|
|
155
|
+
info: "info.100"
|
|
156
|
+
}[(_a = toast.type) != null ? _a : "info"]
|
|
157
|
+
},
|
|
158
|
+
/* @__PURE__ */ React.createElement(Stack, null, ToastIconConfig)
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", flexItem: true }),
|
|
161
|
+
/* @__PURE__ */ React.createElement(Stack, { width: 285 }, /* @__PURE__ */ React.createElement(
|
|
162
|
+
Stack,
|
|
163
|
+
{
|
|
164
|
+
justifyContent: "space-between",
|
|
165
|
+
flexDirection: "row",
|
|
166
|
+
alignItems: "center"
|
|
167
|
+
},
|
|
168
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
169
|
+
/* @__PURE__ */ React.createElement(
|
|
170
|
+
IconButton,
|
|
171
|
+
{
|
|
172
|
+
size: "small",
|
|
173
|
+
"data-testid": "close-icon",
|
|
174
|
+
onClick: closeToast
|
|
175
|
+
},
|
|
176
|
+
/* @__PURE__ */ React.createElement(Close, { fontSize: "small" })
|
|
177
|
+
)
|
|
178
|
+
), /* @__PURE__ */ React.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React.createElement(Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ React.createElement(Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ React.createElement(Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ React.createElement(Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ React.createElement(Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ React.createElement(
|
|
179
|
+
Button,
|
|
180
|
+
{
|
|
181
|
+
key: index,
|
|
182
|
+
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
183
|
+
variant: "text",
|
|
184
|
+
onClick: button.fn,
|
|
185
|
+
disabled: button.disabled || false,
|
|
186
|
+
size: "small"
|
|
187
|
+
},
|
|
188
|
+
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
189
|
+
))), toast.seeMore && /* @__PURE__ */ React.createElement(
|
|
190
|
+
Button,
|
|
191
|
+
{
|
|
192
|
+
onClick: toggleToastOptions,
|
|
193
|
+
size: "small",
|
|
194
|
+
variant: "text",
|
|
195
|
+
color: toastColorConfig
|
|
196
|
+
},
|
|
197
|
+
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
198
|
+
stateOptions ? /* @__PURE__ */ React.createElement(KeyboardArrowDown, null) : /* @__PURE__ */ React.createElement(KeyboardArrowUp, null)
|
|
199
|
+
)))
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ React.createElement(
|
|
202
|
+
LinearProgress,
|
|
203
|
+
{
|
|
204
|
+
sx: {
|
|
205
|
+
".MuiLinearProgress-bar": {
|
|
206
|
+
transition: "0.1s linear !important",
|
|
207
|
+
transform: "scaleX(-1)"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
color: toastColorConfig,
|
|
211
|
+
variant: "determinate",
|
|
212
|
+
value: 100 - progress
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
));
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// src/Components/Adjuntar/Adjuntar.tsx
|
|
219
|
+
var Adjuntar = ({
|
|
220
|
+
sx,
|
|
221
|
+
compact,
|
|
222
|
+
error,
|
|
223
|
+
onChange,
|
|
224
|
+
maxSize = 400,
|
|
225
|
+
fileAccepted = ""
|
|
226
|
+
}) => {
|
|
227
|
+
const [files, setFiles] = useState3([]);
|
|
228
|
+
const [toast, setToast] = React2.useState(null);
|
|
229
|
+
const [isDragFile, setIsDragFile] = useState3(false);
|
|
230
|
+
const inputRef = useRef(null);
|
|
231
|
+
const handleDrop = (event2) => {
|
|
232
|
+
event2.preventDefault();
|
|
233
|
+
setIsDragFile(false);
|
|
234
|
+
const filesDropped = event2.dataTransfer.files;
|
|
235
|
+
if (filesDropped && filesDropped.length > 0) {
|
|
236
|
+
const fakeEvent = {
|
|
237
|
+
target: { files: filesDropped }
|
|
238
|
+
};
|
|
239
|
+
handleUpload(fakeEvent);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
const handleDragOver = (event2) => {
|
|
243
|
+
event2.preventDefault();
|
|
244
|
+
setIsDragFile(true);
|
|
245
|
+
};
|
|
246
|
+
const handleDragLeave = (event2) => {
|
|
247
|
+
event2.preventDefault();
|
|
248
|
+
setIsDragFile(false);
|
|
249
|
+
};
|
|
250
|
+
useEffect3(() => {
|
|
251
|
+
const interval = setInterval(() => {
|
|
252
|
+
setFiles((prevFiles) => {
|
|
253
|
+
let updated = false;
|
|
254
|
+
const nuevosArchivos = prevFiles.map((file) => {
|
|
255
|
+
if (!file.uploadError && file.progress < 100) {
|
|
256
|
+
updated = true;
|
|
257
|
+
return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
|
|
258
|
+
}
|
|
259
|
+
return file;
|
|
260
|
+
});
|
|
261
|
+
return updated ? nuevosArchivos : prevFiles;
|
|
262
|
+
});
|
|
263
|
+
}, 1e3);
|
|
264
|
+
return () => clearInterval(interval);
|
|
265
|
+
}, [files]);
|
|
266
|
+
const handleUpload = (event2) => {
|
|
267
|
+
const newFiles = event2.target.files;
|
|
268
|
+
if (!newFiles) return;
|
|
269
|
+
const nuevosArchivos = [];
|
|
270
|
+
Array.from(newFiles).forEach((file) => {
|
|
271
|
+
const isDuplicatedFile = files.findIndex((e) => e.name === file.name && e.size === file.size);
|
|
272
|
+
const sizeMB = file.size / (1024 * 1024);
|
|
273
|
+
if (isDuplicatedFile !== -1) {
|
|
274
|
+
setToast(null);
|
|
275
|
+
setTimeout(() => {
|
|
276
|
+
setToast({
|
|
277
|
+
type: "error",
|
|
278
|
+
title: "Archivo duplicado",
|
|
279
|
+
seeMore: true,
|
|
280
|
+
listITems: ["No se permiten archivos duplicados."],
|
|
281
|
+
time: 10
|
|
282
|
+
});
|
|
283
|
+
}, 10);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (sizeMB > maxSize) {
|
|
287
|
+
nuevosArchivos.push({
|
|
288
|
+
name: file.name,
|
|
289
|
+
size: file.size,
|
|
290
|
+
type: file.type,
|
|
291
|
+
progress: 0,
|
|
292
|
+
uploadError: true
|
|
293
|
+
});
|
|
294
|
+
setToast(null);
|
|
295
|
+
setTimeout(() => {
|
|
296
|
+
setToast({
|
|
297
|
+
type: "error",
|
|
298
|
+
title: "Carga fallida",
|
|
299
|
+
seeMore: true,
|
|
300
|
+
listITems: ["El archivo supera el l\xEDmite / 400MB."],
|
|
301
|
+
time: 10
|
|
302
|
+
});
|
|
303
|
+
}, 10);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (fileAccepted && !file.name.match(new RegExp(`(${fileAccepted.replace(/\./g, "\\.").replace(/,/g, "|")})$`, "i"))) {
|
|
307
|
+
setToast({
|
|
308
|
+
type: "error",
|
|
309
|
+
title: "Tipo de archivo no permitido",
|
|
310
|
+
listITems: [`El archivo ${file.name} no es un tipo permitido.`],
|
|
311
|
+
time: 10
|
|
312
|
+
});
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
nuevosArchivos.push({
|
|
316
|
+
name: file.name,
|
|
317
|
+
size: file.size,
|
|
318
|
+
type: file.type,
|
|
319
|
+
progress: 0,
|
|
320
|
+
// inicializa el progreso en 0
|
|
321
|
+
uploadError: false
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
if (nuevosArchivos.length > 0) {
|
|
325
|
+
setFiles((prev) => {
|
|
326
|
+
const actualizados = [...prev, ...nuevosArchivos];
|
|
327
|
+
onChange == null ? void 0 : onChange(actualizados);
|
|
328
|
+
return actualizados;
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
event2.target.value = "";
|
|
332
|
+
};
|
|
333
|
+
const deleteFiles = (nameFile) => {
|
|
334
|
+
const filtered = files.filter((e) => e.name !== nameFile);
|
|
335
|
+
setFiles(filtered);
|
|
336
|
+
onChange == null ? void 0 : onChange(filtered);
|
|
337
|
+
};
|
|
338
|
+
return /* @__PURE__ */ React2.createElement(Stack2, { spacing: 2 }, toast && /* @__PURE__ */ React2.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React2.createElement(
|
|
339
|
+
"input",
|
|
340
|
+
{
|
|
341
|
+
type: "file",
|
|
342
|
+
multiple: true,
|
|
343
|
+
hidden: true,
|
|
344
|
+
ref: inputRef,
|
|
345
|
+
onChange: handleUpload
|
|
346
|
+
}
|
|
347
|
+
), /* @__PURE__ */ React2.createElement(
|
|
348
|
+
Stack2,
|
|
349
|
+
{
|
|
350
|
+
id: "ZonaAdjuntos",
|
|
351
|
+
justifyContent: "center",
|
|
352
|
+
alignItems: "center",
|
|
353
|
+
bgcolor: "transparent",
|
|
354
|
+
padding: compact ? "12px 16px" : "16px 24px",
|
|
355
|
+
height: compact ? "56px" : "100%",
|
|
356
|
+
flexDirection: compact ? "row" : "column",
|
|
357
|
+
gap: 1,
|
|
358
|
+
borderRadius: 1,
|
|
359
|
+
onClick: () => {
|
|
360
|
+
var _a;
|
|
361
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
362
|
+
},
|
|
363
|
+
onDrop: handleDrop,
|
|
364
|
+
onDragOver: handleDragOver,
|
|
365
|
+
onDragLeave: handleDragLeave,
|
|
366
|
+
sx: __spreadValues({
|
|
367
|
+
border: error ? (theme) => `1px solid ${theme.palette.error.main}` : (theme) => `1px dashed ${theme.palette.grey[500]}`,
|
|
368
|
+
cursor: "pointer",
|
|
369
|
+
":hover": {
|
|
370
|
+
backgroundColor: error ? "error.50" : "action.hover"
|
|
371
|
+
}
|
|
372
|
+
}, sx)
|
|
373
|
+
},
|
|
374
|
+
/* @__PURE__ */ React2.createElement(Box2, { display: "flex", bgcolor: error ? "error.50" : "primary.50", borderRadius: "100%", p: 1 }, /* @__PURE__ */ React2.createElement(CloudUploadOutlined, { color: error ? "error" : "primary", fontSize: "medium" })),
|
|
375
|
+
/* @__PURE__ */ React2.createElement(
|
|
376
|
+
Stack2,
|
|
377
|
+
{
|
|
378
|
+
width: "100%",
|
|
379
|
+
flexDirection: compact ? "row" : "column",
|
|
380
|
+
alignItems: "center",
|
|
381
|
+
justifyContent: compact ? "space-between" : "center",
|
|
382
|
+
gap: 1
|
|
383
|
+
},
|
|
384
|
+
/* @__PURE__ */ React2.createElement(Stack2, { flexDirection: "column", alignItems: compact ? "start" : "center", gap: 0.5 }, /* @__PURE__ */ React2.createElement(Typography2, { variant: "body2", color: "text.primary" }, "Arrastrar o adjuntar archivos"), /* @__PURE__ */ React2.createElement(Typography2, { variant: "caption", color: error ? "error" : "text.secondary" }, error ? "DOCX, XML, PNG, JPG \u2022 Archivo no soportado" : `DOCX, XML, PNG, JPG \u2022 Max. ${maxSize}MB`)),
|
|
385
|
+
/* @__PURE__ */ React2.createElement(
|
|
386
|
+
Button2,
|
|
387
|
+
{
|
|
388
|
+
variant: "text",
|
|
389
|
+
color: "primary",
|
|
390
|
+
size: "small",
|
|
391
|
+
startIcon: /* @__PURE__ */ React2.createElement(AttachFileOutlined, { color: "primary", fontSize: "small" })
|
|
392
|
+
},
|
|
393
|
+
"Adjuntar"
|
|
394
|
+
)
|
|
395
|
+
)
|
|
396
|
+
), files.length > 0 && /* @__PURE__ */ React2.createElement(
|
|
397
|
+
Stack2,
|
|
398
|
+
{
|
|
399
|
+
id: "ContenedorArchivosAdjuntos",
|
|
400
|
+
width: "100%",
|
|
401
|
+
sx: __spreadValues({
|
|
402
|
+
overflowY: "auto"
|
|
403
|
+
}, files.length > 5 && {
|
|
404
|
+
maxHeight: 250
|
|
405
|
+
}),
|
|
406
|
+
spacing: 1
|
|
407
|
+
},
|
|
408
|
+
files.map((file) => /* @__PURE__ */ React2.createElement(
|
|
409
|
+
Stack2,
|
|
410
|
+
{
|
|
411
|
+
height: 46,
|
|
412
|
+
key: file.name + (file.uploadError ? "_error" : ""),
|
|
413
|
+
direction: "row",
|
|
414
|
+
alignItems: "center",
|
|
415
|
+
justifyContent: "space-between",
|
|
416
|
+
gap: 2,
|
|
417
|
+
padding: 1,
|
|
418
|
+
borderRadius: 1,
|
|
419
|
+
sx: {
|
|
420
|
+
backgroundColor: file.uploadError ? "error.50" : "transparent",
|
|
421
|
+
":hover": {
|
|
422
|
+
backgroundColor: file.uploadError ? "error.100" : "primary.50"
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
/* @__PURE__ */ React2.createElement(Stack2, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(UploadFileOutlined, { color: file.uploadError ? "error" : "primary", fontSize: "small" }), /* @__PURE__ */ React2.createElement(Stack2, { width: "100%" }, /* @__PURE__ */ React2.createElement(Typography2, { variant: "body2", color: "text.primary" }, file.name), /* @__PURE__ */ React2.createElement(Typography2, { variant: "caption", color: file.uploadError ? "error" : "text.secondary" }, file.uploadError ? "Archivo duplicado o inv\xE1lido \u2022 Carga fallida" : file.size > maxSize && file.uploadError ? "Archivo supero el l\xEDmite" : `${(file.size / (1024 * 1024)).toFixed(2)}MB \u2022 ${file.type} \u2022 carga ${file.progress}%`), file.progress === 100 && !file.uploadError ? /* @__PURE__ */ React2.createElement(React2.Fragment, null) : /* @__PURE__ */ React2.createElement(
|
|
427
|
+
LinearProgress2,
|
|
428
|
+
{
|
|
429
|
+
variant: "determinate",
|
|
430
|
+
color: file.uploadError ? "error" : "primary",
|
|
431
|
+
value: file.progress
|
|
432
|
+
}
|
|
433
|
+
))),
|
|
434
|
+
/* @__PURE__ */ React2.createElement(IconButton2, { size: "small", onClick: () => deleteFiles(file.name) }, /* @__PURE__ */ React2.createElement(DeleteOutline, { fontSize: "small", color: "action" }))
|
|
435
|
+
))
|
|
436
|
+
));
|
|
437
|
+
};
|
|
438
|
+
|
|
33
439
|
// src/Components/Drawer/SCDrawer.tsx
|
|
34
|
-
import
|
|
35
|
-
import { Box as
|
|
440
|
+
import React9, { useEffect as useEffect9, useRef as useRef3 } from "react";
|
|
441
|
+
import { Box as Box8, Drawer, Typography as Typography8, IconButton as IconButton6, Button as Button5, Stack as Stack4, Chip as Chip2 } from "@mui/material";
|
|
36
442
|
import Grid4 from "@mui/material/Grid2";
|
|
37
443
|
import CloseIcon from "@mui/icons-material/Close";
|
|
38
444
|
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
|
|
39
445
|
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
|
40
446
|
|
|
41
447
|
// src/Components/Textfield/SCTextField.tsx
|
|
42
|
-
import
|
|
43
|
-
import { FormControl, IconButton, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover, Input, Box, Typography, SvgIcon, Tooltip } from "@mui/material";
|
|
448
|
+
import React3, { useEffect as useEffect4, useState as useState4 } from "react";
|
|
449
|
+
import { FormControl, IconButton as IconButton3, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover, Input, Box as Box3, Typography as Typography3, SvgIcon, Tooltip } from "@mui/material";
|
|
44
450
|
import Grid from "@mui/material/Grid2";
|
|
45
451
|
import { Visibility, VisibilityOff, InfoOutlined } from "@mui/icons-material";
|
|
46
452
|
|
|
@@ -128,13 +534,13 @@ var SCTextField = ({
|
|
|
128
534
|
let IconInputStart;
|
|
129
535
|
let IconInputEnd;
|
|
130
536
|
let IconTitle;
|
|
131
|
-
const [showPassword, setShowPassword] =
|
|
132
|
-
const [error, setError] =
|
|
133
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
537
|
+
const [showPassword, setShowPassword] = useState4(false);
|
|
538
|
+
const [error, setError] = useState4(false);
|
|
539
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = useState4(null);
|
|
134
540
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
135
|
-
const [anchorInfoElement, setAnchorInfoElement] =
|
|
541
|
+
const [anchorInfoElement, setAnchorInfoElement] = useState4(null);
|
|
136
542
|
const openInfoElement = Boolean(anchorInfoElement);
|
|
137
|
-
|
|
543
|
+
useEffect4(() => {
|
|
138
544
|
if (error) {
|
|
139
545
|
setTimeout(() => {
|
|
140
546
|
setError(false);
|
|
@@ -184,7 +590,7 @@ var SCTextField = ({
|
|
|
184
590
|
const handleCloseInfoElement = () => {
|
|
185
591
|
setAnchorInfoElement(null);
|
|
186
592
|
};
|
|
187
|
-
return /* @__PURE__ */
|
|
593
|
+
return /* @__PURE__ */ React3.createElement(Box3, { sx: { width } }, /* @__PURE__ */ React3.createElement(Grid, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ React3.createElement(SvgIcon, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ React3.createElement(Typography3, { mx: 0.5, variant: "subtitle2", color: "text.secondary" }, title) : "", infoTitle ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
188
594
|
InfoOutlined,
|
|
189
595
|
{
|
|
190
596
|
color: "action",
|
|
@@ -192,7 +598,7 @@ var SCTextField = ({
|
|
|
192
598
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
193
599
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
194
600
|
}
|
|
195
|
-
), /* @__PURE__ */
|
|
601
|
+
), /* @__PURE__ */ React3.createElement(
|
|
196
602
|
Popover,
|
|
197
603
|
{
|
|
198
604
|
sx: {
|
|
@@ -214,14 +620,14 @@ var SCTextField = ({
|
|
|
214
620
|
},
|
|
215
621
|
disableRestoreFocus: true
|
|
216
622
|
},
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
)) : /* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ React3.createElement(Typography3, { p: 2 }, infoTitle.text)
|
|
624
|
+
)) : /* @__PURE__ */ React3.createElement(Tooltip, { title: infoTitle.text, "data-testid": "test-infoTitle", placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React3.createElement(
|
|
219
625
|
InfoOutlined,
|
|
220
626
|
{
|
|
221
627
|
color: "action",
|
|
222
628
|
fontSize: "small"
|
|
223
629
|
}
|
|
224
|
-
))) : ""), /* @__PURE__ */
|
|
630
|
+
))) : ""), /* @__PURE__ */ React3.createElement(Grid, { container: true, sx: { flexWrap: "nowrap", alignItems: "center" } }, /* @__PURE__ */ React3.createElement(
|
|
225
631
|
FormControl,
|
|
226
632
|
{
|
|
227
633
|
color,
|
|
@@ -230,7 +636,7 @@ var SCTextField = ({
|
|
|
230
636
|
variant,
|
|
231
637
|
sx: { background: background || "transparent", borderRadius: "4px" }
|
|
232
638
|
},
|
|
233
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ React3.createElement(
|
|
234
640
|
InputLabel,
|
|
235
641
|
{
|
|
236
642
|
"data-testid": "test-label",
|
|
@@ -241,7 +647,7 @@ var SCTextField = ({
|
|
|
241
647
|
},
|
|
242
648
|
label ? label : ""
|
|
243
649
|
),
|
|
244
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ React3.createElement(
|
|
245
651
|
InputComponent,
|
|
246
652
|
{
|
|
247
653
|
size: size ? size : "medium",
|
|
@@ -257,17 +663,17 @@ var SCTextField = ({
|
|
|
257
663
|
type: !showPassword && format2 === "password" ? "password" : (format2 || "text").toUpperCase() === "INT" || (format2 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
|
|
258
664
|
className: format2 === "password" && !showPassword ? "" : "",
|
|
259
665
|
placeholder,
|
|
260
|
-
startAdornment: iconInputStart ? /* @__PURE__ */
|
|
261
|
-
endAdornment: /* @__PURE__ */
|
|
262
|
-
|
|
666
|
+
startAdornment: iconInputStart ? /* @__PURE__ */ React3.createElement(InputAdornment, { position: "start" }, IconInputStartValidation === "text" ? iconInputStart : IconInputStart ? /* @__PURE__ */ React3.createElement(IconInputStart, { fontSize: "small" }) : null) : "",
|
|
667
|
+
endAdornment: /* @__PURE__ */ React3.createElement(InputAdornment, { position: "end" }, format2 === "password" ? /* @__PURE__ */ React3.createElement(
|
|
668
|
+
IconButton3,
|
|
263
669
|
{
|
|
264
670
|
"aria-label": "toggle password visibility",
|
|
265
671
|
onClick: handleClickShowPassword,
|
|
266
672
|
onMouseDown: handleMouseDownPassword,
|
|
267
673
|
edge: "end"
|
|
268
674
|
},
|
|
269
|
-
showPassword ? /* @__PURE__ */
|
|
270
|
-
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */
|
|
675
|
+
showPassword ? /* @__PURE__ */ React3.createElement(VisibilityOff, null) : /* @__PURE__ */ React3.createElement(Visibility, null)
|
|
676
|
+
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
271
677
|
InfoOutlined,
|
|
272
678
|
{
|
|
273
679
|
"data-testid": "test-infoElement",
|
|
@@ -278,7 +684,7 @@ var SCTextField = ({
|
|
|
278
684
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
279
685
|
onMouseLeave: () => handleCloseInfoElement()
|
|
280
686
|
}
|
|
281
|
-
), /* @__PURE__ */
|
|
687
|
+
), /* @__PURE__ */ React3.createElement(
|
|
282
688
|
Popover,
|
|
283
689
|
{
|
|
284
690
|
sx: {
|
|
@@ -300,19 +706,19 @@ var SCTextField = ({
|
|
|
300
706
|
},
|
|
301
707
|
disableRestoreFocus: true
|
|
302
708
|
},
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
)) : /* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ React3.createElement(Typography3, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
710
|
+
)) : /* @__PURE__ */ React3.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React3.createElement(
|
|
305
711
|
InfoOutlined,
|
|
306
712
|
{
|
|
307
713
|
color: "action",
|
|
308
714
|
fontSize: "small"
|
|
309
715
|
}
|
|
310
|
-
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */
|
|
716
|
+
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */ React3.createElement(IconInputEnd, { fontSize: "small" }) : null : ""),
|
|
311
717
|
label: label ? label + (format2 === "password" && !showPassword ? "" : "") : "",
|
|
312
718
|
autoComplete: format2 === "password" ? "new-password" : "off"
|
|
313
719
|
}
|
|
314
720
|
)
|
|
315
|
-
), (iconInputEnd !== void 0 || format2 === "password") && infoElement ? /* @__PURE__ */
|
|
721
|
+
), (iconInputEnd !== void 0 || format2 === "password") && infoElement ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
316
722
|
InfoOutlined,
|
|
317
723
|
{
|
|
318
724
|
"data-testid": "test-infoElement",
|
|
@@ -323,7 +729,7 @@ var SCTextField = ({
|
|
|
323
729
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
324
730
|
onMouseLeave: handleCloseInfoElement
|
|
325
731
|
}
|
|
326
|
-
), /* @__PURE__ */
|
|
732
|
+
), /* @__PURE__ */ React3.createElement(
|
|
327
733
|
Popover,
|
|
328
734
|
{
|
|
329
735
|
sx: { pointerEvents: "none" },
|
|
@@ -340,8 +746,8 @@ var SCTextField = ({
|
|
|
340
746
|
},
|
|
341
747
|
disableRestoreFocus: true
|
|
342
748
|
},
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
)) : /* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ React3.createElement(Typography3, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
750
|
+
)) : /* @__PURE__ */ React3.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React3.createElement(
|
|
345
751
|
InfoOutlined,
|
|
346
752
|
{
|
|
347
753
|
sx: { marginLeft: "4px" },
|
|
@@ -351,186 +757,6 @@ var SCTextField = ({
|
|
|
351
757
|
))) : ""));
|
|
352
758
|
};
|
|
353
759
|
|
|
354
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
355
|
-
import React2, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
356
|
-
import { Stack, LinearProgress, Divider, Box as Box2, Typography as Typography2, IconButton as IconButton2, Button } from "@mui/material";
|
|
357
|
-
import { Close, InfoRounded, CheckCircleRounded, WarningRounded, ErrorRounded, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
|
|
358
|
-
|
|
359
|
-
// src/Components/ToastNotification/useProgress.ts
|
|
360
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
361
|
-
var useProgress = (timeProgress, lote) => {
|
|
362
|
-
const [progress, setProgress] = useState2(0);
|
|
363
|
-
useEffect2(() => {
|
|
364
|
-
const interval = setInterval(() => {
|
|
365
|
-
setProgress((prev) => {
|
|
366
|
-
if (prev >= 100) {
|
|
367
|
-
clearInterval(interval);
|
|
368
|
-
}
|
|
369
|
-
if (lote) {
|
|
370
|
-
const nextProgress = prev + lote;
|
|
371
|
-
return nextProgress <= 100 ? nextProgress : 100;
|
|
372
|
-
} else {
|
|
373
|
-
return prev + 1;
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
}, timeProgress * 10);
|
|
377
|
-
return () => {
|
|
378
|
-
clearInterval(interval);
|
|
379
|
-
};
|
|
380
|
-
}, [timeProgress, lote]);
|
|
381
|
-
return {
|
|
382
|
-
progress
|
|
383
|
-
};
|
|
384
|
-
};
|
|
385
|
-
var ToastProgress = (timeProgress) => {
|
|
386
|
-
const [progress, setProgress] = useState2(100);
|
|
387
|
-
useEffect2(() => {
|
|
388
|
-
const interval = setInterval(() => {
|
|
389
|
-
setProgress((prev) => {
|
|
390
|
-
if (prev <= 0) {
|
|
391
|
-
clearInterval(interval);
|
|
392
|
-
}
|
|
393
|
-
return prev - 1;
|
|
394
|
-
});
|
|
395
|
-
}, timeProgress * 10);
|
|
396
|
-
return () => {
|
|
397
|
-
clearInterval(interval);
|
|
398
|
-
};
|
|
399
|
-
}, [timeProgress]);
|
|
400
|
-
return {
|
|
401
|
-
progressToast: progress
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
406
|
-
var SCToastNotification = (toast) => {
|
|
407
|
-
var _a;
|
|
408
|
-
const [stateOptions, setStateOptions] = useState3(true);
|
|
409
|
-
const [stateToast, setStateToast] = useState3(true);
|
|
410
|
-
const timeProgress = toast.time || 10;
|
|
411
|
-
const { progress } = useProgress(timeProgress);
|
|
412
|
-
const toastColorConfig = toast.type || "info";
|
|
413
|
-
const toastIconOption = {
|
|
414
|
-
success: /* @__PURE__ */ React2.createElement(CheckCircleRounded, { color: "success" }),
|
|
415
|
-
error: /* @__PURE__ */ React2.createElement(ErrorRounded, { color: "error" }),
|
|
416
|
-
warning: /* @__PURE__ */ React2.createElement(WarningRounded, { color: "warning" }),
|
|
417
|
-
info: /* @__PURE__ */ React2.createElement(InfoRounded, { color: "info" })
|
|
418
|
-
};
|
|
419
|
-
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
420
|
-
alert("");
|
|
421
|
-
} }, { text: "Consultar", fn: () => {
|
|
422
|
-
} }]];
|
|
423
|
-
const ToastIconConfig = toastIconOption[toast.type];
|
|
424
|
-
const closeToast = () => {
|
|
425
|
-
setStateToast(false);
|
|
426
|
-
};
|
|
427
|
-
const toggleToastOptions = () => {
|
|
428
|
-
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
429
|
-
};
|
|
430
|
-
useEffect3(() => {
|
|
431
|
-
progress >= 100 && setStateToast(false);
|
|
432
|
-
}, [progress]);
|
|
433
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, stateToast && /* @__PURE__ */ React2.createElement(
|
|
434
|
-
Stack,
|
|
435
|
-
{
|
|
436
|
-
position: "fixed",
|
|
437
|
-
zIndex: 1400,
|
|
438
|
-
right: 16,
|
|
439
|
-
top: 16,
|
|
440
|
-
width: 370,
|
|
441
|
-
sx: {
|
|
442
|
-
boxShadow: (theme) => theme.shadows[8]
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
/* @__PURE__ */ React2.createElement(
|
|
446
|
-
Box2,
|
|
447
|
-
{
|
|
448
|
-
padding: 1.5,
|
|
449
|
-
gap: 1.5,
|
|
450
|
-
display: "flex",
|
|
451
|
-
alignItems: "center",
|
|
452
|
-
sx: {
|
|
453
|
-
backgroundColor: {
|
|
454
|
-
success: "success.50",
|
|
455
|
-
error: "error.50",
|
|
456
|
-
warning: "warning.50",
|
|
457
|
-
info: "info.50"
|
|
458
|
-
}[toastColorConfig]
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
/* @__PURE__ */ React2.createElement(
|
|
462
|
-
Stack,
|
|
463
|
-
{
|
|
464
|
-
p: 1,
|
|
465
|
-
gap: 1,
|
|
466
|
-
borderRadius: 50,
|
|
467
|
-
bgcolor: {
|
|
468
|
-
success: "success.100",
|
|
469
|
-
error: "error.100",
|
|
470
|
-
warning: "warning.100",
|
|
471
|
-
info: "info.100"
|
|
472
|
-
}[(_a = toast.type) != null ? _a : "info"]
|
|
473
|
-
},
|
|
474
|
-
/* @__PURE__ */ React2.createElement(Stack, null, ToastIconConfig)
|
|
475
|
-
),
|
|
476
|
-
/* @__PURE__ */ React2.createElement(Divider, { orientation: "vertical", flexItem: true }),
|
|
477
|
-
/* @__PURE__ */ React2.createElement(Stack, { width: 285 }, /* @__PURE__ */ React2.createElement(
|
|
478
|
-
Stack,
|
|
479
|
-
{
|
|
480
|
-
justifyContent: "space-between",
|
|
481
|
-
flexDirection: "row",
|
|
482
|
-
alignItems: "center"
|
|
483
|
-
},
|
|
484
|
-
/* @__PURE__ */ React2.createElement(Typography2, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
485
|
-
/* @__PURE__ */ React2.createElement(
|
|
486
|
-
IconButton2,
|
|
487
|
-
{
|
|
488
|
-
size: "small",
|
|
489
|
-
"data-testid": "close-icon",
|
|
490
|
-
onClick: closeToast
|
|
491
|
-
},
|
|
492
|
-
/* @__PURE__ */ React2.createElement(Close, { fontSize: "small" })
|
|
493
|
-
)
|
|
494
|
-
), /* @__PURE__ */ React2.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React2.createElement(Typography2, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ React2.createElement(Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ React2.createElement(Typography2, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ React2.createElement(Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ React2.createElement(Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ React2.createElement(
|
|
495
|
-
Button,
|
|
496
|
-
{
|
|
497
|
-
key: index,
|
|
498
|
-
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
499
|
-
variant: "text",
|
|
500
|
-
onClick: button.fn,
|
|
501
|
-
disabled: button.disabled || false,
|
|
502
|
-
size: "small"
|
|
503
|
-
},
|
|
504
|
-
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
505
|
-
))), toast.seeMore && /* @__PURE__ */ React2.createElement(
|
|
506
|
-
Button,
|
|
507
|
-
{
|
|
508
|
-
onClick: toggleToastOptions,
|
|
509
|
-
size: "small",
|
|
510
|
-
variant: "text",
|
|
511
|
-
color: toastColorConfig
|
|
512
|
-
},
|
|
513
|
-
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
514
|
-
stateOptions ? /* @__PURE__ */ React2.createElement(KeyboardArrowDown, null) : /* @__PURE__ */ React2.createElement(KeyboardArrowUp, null)
|
|
515
|
-
)))
|
|
516
|
-
),
|
|
517
|
-
/* @__PURE__ */ React2.createElement(
|
|
518
|
-
LinearProgress,
|
|
519
|
-
{
|
|
520
|
-
sx: {
|
|
521
|
-
".MuiLinearProgress-bar": {
|
|
522
|
-
transition: "0.1s linear !important",
|
|
523
|
-
transform: "scaleX(-1)"
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
color: toastColorConfig,
|
|
527
|
-
variant: "determinate",
|
|
528
|
-
value: 100 - progress
|
|
529
|
-
}
|
|
530
|
-
)
|
|
531
|
-
));
|
|
532
|
-
};
|
|
533
|
-
|
|
534
760
|
// src/Components/TextArea/Helpers/validateIcon.tsx
|
|
535
761
|
import * as MuiIcons from "@mui/icons-material";
|
|
536
762
|
function getIcon(name) {
|
|
@@ -541,8 +767,8 @@ function getIcon(name) {
|
|
|
541
767
|
}
|
|
542
768
|
|
|
543
769
|
// src/Components/TextArea/SCTextArea.tsx
|
|
544
|
-
import
|
|
545
|
-
import { Typography as
|
|
770
|
+
import React4, { useEffect as useEffect5, useState as useState5 } from "react";
|
|
771
|
+
import { Typography as Typography4, Stack as Stack3, TextField, Box as Box4, Popover as Popover2, Tooltip as Tooltip2, SvgIcon as SvgIcon2, Grid as Grid2 } from "@mui/material";
|
|
546
772
|
import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
|
|
547
773
|
var SCTextArea = ({
|
|
548
774
|
//informativas
|
|
@@ -565,11 +791,11 @@ var SCTextArea = ({
|
|
|
565
791
|
state,
|
|
566
792
|
onBlur
|
|
567
793
|
}) => {
|
|
568
|
-
const [helperCount, setHelperCount] =
|
|
569
|
-
const [stateError, setStateError] =
|
|
570
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
794
|
+
const [helperCount, setHelperCount] = useState5(0);
|
|
795
|
+
const [stateError, setStateError] = useState5(false);
|
|
796
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = React4.useState(null);
|
|
571
797
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
572
|
-
|
|
798
|
+
useEffect5(() => {
|
|
573
799
|
setHelperCount(state == null ? void 0 : state.length);
|
|
574
800
|
}, [state]);
|
|
575
801
|
const IconTitle = getIcon(iconTitle);
|
|
@@ -591,7 +817,7 @@ var SCTextArea = ({
|
|
|
591
817
|
const handleCloseInfoTitle = () => {
|
|
592
818
|
setAnchorInfoTitle(null);
|
|
593
819
|
};
|
|
594
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(Box4, { sx: { width } }, /* @__PURE__ */ React4.createElement(Grid2, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ React4.createElement(SvgIcon2, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ React4.createElement(Typography4, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
|
|
595
821
|
InfoOutlined2,
|
|
596
822
|
{
|
|
597
823
|
color: "action",
|
|
@@ -599,7 +825,7 @@ var SCTextArea = ({
|
|
|
599
825
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
600
826
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
601
827
|
}
|
|
602
|
-
), /* @__PURE__ */
|
|
828
|
+
), /* @__PURE__ */ React4.createElement(
|
|
603
829
|
Popover2,
|
|
604
830
|
{
|
|
605
831
|
sx: { pointerEvents: "none" },
|
|
@@ -616,14 +842,14 @@ var SCTextArea = ({
|
|
|
616
842
|
},
|
|
617
843
|
disableRestoreFocus: true
|
|
618
844
|
},
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
)) : /* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ React4.createElement(Typography4, { sx: { p: 2 } }, infoTitle.text)
|
|
846
|
+
)) : /* @__PURE__ */ React4.createElement(Tooltip2, { title: infoTitle.text, placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React4.createElement(
|
|
621
847
|
InfoOutlined2,
|
|
622
848
|
{
|
|
623
849
|
color: "action",
|
|
624
850
|
fontSize: "small"
|
|
625
851
|
}
|
|
626
|
-
))) : ""), /* @__PURE__ */
|
|
852
|
+
))) : ""), /* @__PURE__ */ React4.createElement(Stack3, null, /* @__PURE__ */ React4.createElement(
|
|
627
853
|
TextField,
|
|
628
854
|
{
|
|
629
855
|
required,
|
|
@@ -645,8 +871,8 @@ var SCTextArea = ({
|
|
|
645
871
|
},
|
|
646
872
|
autoComplete: "off"
|
|
647
873
|
}
|
|
648
|
-
)), /* @__PURE__ */
|
|
649
|
-
|
|
874
|
+
)), /* @__PURE__ */ React4.createElement(Stack3, null, /* @__PURE__ */ React4.createElement(
|
|
875
|
+
Typography4,
|
|
650
876
|
{
|
|
651
877
|
variant: "caption",
|
|
652
878
|
color: "text.secondary",
|
|
@@ -659,8 +885,8 @@ var SCTextArea = ({
|
|
|
659
885
|
};
|
|
660
886
|
|
|
661
887
|
// src/Components/SCSelect.tsx
|
|
662
|
-
import
|
|
663
|
-
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as
|
|
888
|
+
import React5, { useEffect as useEffect6 } from "react";
|
|
889
|
+
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as Box5 } from "@mui/material";
|
|
664
890
|
import Select from "@mui/material/Select";
|
|
665
891
|
import * as Muicon2 from "@mui/icons-material";
|
|
666
892
|
function SCSelect({
|
|
@@ -677,16 +903,16 @@ function SCSelect({
|
|
|
677
903
|
state
|
|
678
904
|
}) {
|
|
679
905
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
680
|
-
const [prevData, setPrevData] =
|
|
681
|
-
const [error, setError] =
|
|
682
|
-
|
|
906
|
+
const [prevData, setPrevData] = React5.useState(data);
|
|
907
|
+
const [error, setError] = React5.useState(false);
|
|
908
|
+
useEffect6(() => {
|
|
683
909
|
if (error) {
|
|
684
910
|
setTimeout(() => {
|
|
685
911
|
setError(false);
|
|
686
912
|
}, 1e3);
|
|
687
913
|
}
|
|
688
914
|
}, [error]);
|
|
689
|
-
|
|
915
|
+
useEffect6(() => {
|
|
690
916
|
let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
691
917
|
if (dataChangeValidation == false) {
|
|
692
918
|
setState({ hiddenValue: "", textValue: "" });
|
|
@@ -720,25 +946,25 @@ function SCSelect({
|
|
|
720
946
|
}
|
|
721
947
|
}
|
|
722
948
|
};
|
|
723
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, data && /* @__PURE__ */ React5.createElement(Box5, { sx: { width } }, /* @__PURE__ */ React5.createElement(
|
|
724
950
|
FormControl2,
|
|
725
951
|
{
|
|
726
952
|
fullWidth: true,
|
|
727
953
|
size: size ? size : "medium",
|
|
728
954
|
variant
|
|
729
955
|
},
|
|
730
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ React5.createElement(
|
|
731
957
|
InputLabel2,
|
|
732
958
|
{
|
|
733
959
|
error
|
|
734
960
|
},
|
|
735
|
-
required ? /* @__PURE__ */
|
|
961
|
+
required ? /* @__PURE__ */ React5.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label
|
|
736
962
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ React5.createElement(
|
|
738
964
|
Select,
|
|
739
965
|
{
|
|
740
966
|
value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
|
|
741
|
-
label: required ? /* @__PURE__ */
|
|
967
|
+
label: required ? /* @__PURE__ */ React5.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
742
968
|
onChange: handleChange,
|
|
743
969
|
onBlur: handleBlur,
|
|
744
970
|
variant,
|
|
@@ -764,15 +990,15 @@ function SCSelect({
|
|
|
764
990
|
}
|
|
765
991
|
},
|
|
766
992
|
data.map((option, index) => {
|
|
767
|
-
return /* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ React5.createElement(MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React5.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React5.createElement(SvgIcon3, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ React5.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
|
|
768
994
|
})
|
|
769
995
|
)
|
|
770
996
|
)));
|
|
771
997
|
}
|
|
772
998
|
|
|
773
999
|
// src/Components/SCAutocomplete.tsx
|
|
774
|
-
import
|
|
775
|
-
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as
|
|
1000
|
+
import React6, { useEffect as useEffect7 } from "react";
|
|
1001
|
+
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography6, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton5, Chip, Box as Box6, Button as Button4 } from "@mui/material";
|
|
776
1002
|
import Grid3 from "@mui/material/Grid2";
|
|
777
1003
|
import { Search, Clear } from "@mui/icons-material";
|
|
778
1004
|
import * as Muicon3 from "@mui/icons-material";
|
|
@@ -796,12 +1022,12 @@ function SCAutocomplete({
|
|
|
796
1022
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
797
1023
|
let group = "";
|
|
798
1024
|
let isSelected = false;
|
|
799
|
-
const [selectedOptions, setSelectedOptions] =
|
|
800
|
-
const [prevData, setPrevData] =
|
|
801
|
-
const [originalData, setOriginalData] =
|
|
802
|
-
const [inputValue, setInputValue] =
|
|
803
|
-
const [isUserTyping, setIsUserTyping] =
|
|
804
|
-
|
|
1025
|
+
const [selectedOptions, setSelectedOptions] = React6.useState([]);
|
|
1026
|
+
const [prevData, setPrevData] = React6.useState(data);
|
|
1027
|
+
const [originalData, setOriginalData] = React6.useState(data);
|
|
1028
|
+
const [inputValue, setInputValue] = React6.useState("");
|
|
1029
|
+
const [isUserTyping, setIsUserTyping] = React6.useState(false);
|
|
1030
|
+
useEffect7(() => {
|
|
805
1031
|
const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
806
1032
|
if (!dataChangeValidation && !isUserTyping) {
|
|
807
1033
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
@@ -812,7 +1038,7 @@ function SCAutocomplete({
|
|
|
812
1038
|
}
|
|
813
1039
|
setPrevData(data);
|
|
814
1040
|
}, [data, isUserTyping]);
|
|
815
|
-
|
|
1041
|
+
useEffect7(() => {
|
|
816
1042
|
if (typeFormat == "multiselect") {
|
|
817
1043
|
if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
|
|
818
1044
|
const newSelectedOptions = originalData.filter(
|
|
@@ -822,7 +1048,7 @@ function SCAutocomplete({
|
|
|
822
1048
|
}
|
|
823
1049
|
}
|
|
824
1050
|
}, [state.hiddenValue, originalData, typeFormat]);
|
|
825
|
-
|
|
1051
|
+
useEffect7(() => {
|
|
826
1052
|
if (inputValue === "") {
|
|
827
1053
|
setIsUserTyping(false);
|
|
828
1054
|
}
|
|
@@ -880,7 +1106,7 @@ function SCAutocomplete({
|
|
|
880
1106
|
const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
|
|
881
1107
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
882
1108
|
) || null;
|
|
883
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, data && /* @__PURE__ */ React6.createElement(
|
|
884
1110
|
Autocomplete,
|
|
885
1111
|
{
|
|
886
1112
|
multiple: typeFormat === "multiselect",
|
|
@@ -907,9 +1133,9 @@ function SCAutocomplete({
|
|
|
907
1133
|
limitTags: 2,
|
|
908
1134
|
renderTags: (value, getTagProps) => {
|
|
909
1135
|
const limit = 2;
|
|
910
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, value.slice(0, limit).map((option, index) => {
|
|
911
1137
|
const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
|
|
912
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ React6.createElement(
|
|
913
1139
|
Chip,
|
|
914
1140
|
__spreadProps(__spreadValues({
|
|
915
1141
|
key,
|
|
@@ -921,7 +1147,7 @@ function SCAutocomplete({
|
|
|
921
1147
|
style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
922
1148
|
})
|
|
923
1149
|
);
|
|
924
|
-
}), value.length > limit && /* @__PURE__ */
|
|
1150
|
+
}), value.length > limit && /* @__PURE__ */ React6.createElement(Box6, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
|
|
925
1151
|
},
|
|
926
1152
|
renderOption: (props, option) => {
|
|
927
1153
|
const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
|
|
@@ -939,7 +1165,7 @@ function SCAutocomplete({
|
|
|
939
1165
|
isValid = group == option[columnGroup];
|
|
940
1166
|
group = option[columnGroup];
|
|
941
1167
|
}
|
|
942
|
-
return /* @__PURE__ */
|
|
1168
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(React6.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React6.createElement(Typography6, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React6.createElement(
|
|
943
1169
|
MenuItem2,
|
|
944
1170
|
__spreadProps(__spreadValues({}, optionProps), {
|
|
945
1171
|
disabled: isDisabled,
|
|
@@ -949,8 +1175,8 @@ function SCAutocomplete({
|
|
|
949
1175
|
opacity: isDisabled ? 0.5 : 1
|
|
950
1176
|
}
|
|
951
1177
|
}),
|
|
952
|
-
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */
|
|
953
|
-
typeFormat == "multiselect" ? /* @__PURE__ */
|
|
1178
|
+
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React6.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React6.createElement(SvgIcon4, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
|
|
1179
|
+
typeFormat == "multiselect" ? /* @__PURE__ */ React6.createElement(
|
|
954
1180
|
Checkbox,
|
|
955
1181
|
{
|
|
956
1182
|
checked: isSelected,
|
|
@@ -959,25 +1185,25 @@ function SCAutocomplete({
|
|
|
959
1185
|
color: "primary"
|
|
960
1186
|
}
|
|
961
1187
|
) : "",
|
|
962
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ React6.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }),
|
|
963
1189
|
getItemValue(option).component != void 0 ? getItemValue(option).component : ""
|
|
964
1190
|
)));
|
|
965
1191
|
},
|
|
966
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1192
|
+
renderInput: (params) => /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
|
967
1193
|
TextField3,
|
|
968
1194
|
__spreadProps(__spreadValues({}, params), {
|
|
969
|
-
label: required ? /* @__PURE__ */
|
|
1195
|
+
label: required ? /* @__PURE__ */ React6.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
970
1196
|
placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
|
|
971
1197
|
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
972
|
-
endAdornment: /* @__PURE__ */
|
|
1198
|
+
endAdornment: /* @__PURE__ */ React6.createElement(React6.Fragment, null, deleteType == "icon" && (state.hiddenValue.toString() != "-1" && state.hiddenValue.toString() != "") ? /* @__PURE__ */ React6.createElement(IconButton5, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ React6.createElement(Clear, { fontSize: "small" })) : "", /* @__PURE__ */ React6.createElement(InputAdornment3, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ React6.createElement(Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
|
|
973
1199
|
})
|
|
974
1200
|
})
|
|
975
1201
|
)),
|
|
976
1202
|
slotProps: {
|
|
977
1203
|
listbox: {
|
|
978
|
-
component:
|
|
979
|
-
return /* @__PURE__ */
|
|
980
|
-
|
|
1204
|
+
component: React6.forwardRef(function ListboxComponent(props, ref) {
|
|
1205
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
|
1206
|
+
Box6,
|
|
981
1207
|
__spreadProps(__spreadValues({
|
|
982
1208
|
ref
|
|
983
1209
|
}, props), {
|
|
@@ -987,9 +1213,9 @@ function SCAutocomplete({
|
|
|
987
1213
|
backgroundColor: "white"
|
|
988
1214
|
}, props.sx)
|
|
989
1215
|
}),
|
|
990
|
-
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */
|
|
1216
|
+
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(FormControlLabel2, { control: /* @__PURE__ */ React6.createElement(Checkbox, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los items", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ React6.createElement(Divider3, null)) : "",
|
|
991
1217
|
props.children,
|
|
992
|
-
deleteType == "button" || fnAplicar ? /* @__PURE__ */
|
|
1218
|
+
deleteType == "button" || fnAplicar ? /* @__PURE__ */ React6.createElement(
|
|
993
1219
|
Grid3,
|
|
994
1220
|
{
|
|
995
1221
|
container: true,
|
|
@@ -1004,8 +1230,8 @@ function SCAutocomplete({
|
|
|
1004
1230
|
justifyContent: "space-between"
|
|
1005
1231
|
}
|
|
1006
1232
|
},
|
|
1007
|
-
deleteType == "button" ? /* @__PURE__ */
|
|
1008
|
-
|
|
1233
|
+
deleteType == "button" ? /* @__PURE__ */ React6.createElement(
|
|
1234
|
+
Button4,
|
|
1009
1235
|
{
|
|
1010
1236
|
variant: "text",
|
|
1011
1237
|
color: "primary",
|
|
@@ -1017,8 +1243,8 @@ function SCAutocomplete({
|
|
|
1017
1243
|
},
|
|
1018
1244
|
"Limpiar"
|
|
1019
1245
|
) : "",
|
|
1020
|
-
fnAplicar && /* @__PURE__ */
|
|
1021
|
-
|
|
1246
|
+
fnAplicar && /* @__PURE__ */ React6.createElement(
|
|
1247
|
+
Button4,
|
|
1022
1248
|
{
|
|
1023
1249
|
variant: "contained",
|
|
1024
1250
|
color: "primary",
|
|
@@ -1037,8 +1263,8 @@ function SCAutocomplete({
|
|
|
1037
1263
|
}
|
|
1038
1264
|
|
|
1039
1265
|
// src/Components/SCDateRange.tsx
|
|
1040
|
-
import
|
|
1041
|
-
import { Box as
|
|
1266
|
+
import React7 from "react";
|
|
1267
|
+
import { Box as Box7, InputAdornment as InputAdornment4 } from "@mui/material";
|
|
1042
1268
|
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
1043
1269
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
1044
1270
|
import { DateRangePicker } from "@mui/x-date-pickers-pro/DateRangePicker";
|
|
@@ -1069,7 +1295,7 @@ var SCDateRange = ({
|
|
|
1069
1295
|
];
|
|
1070
1296
|
setState(convertedValue);
|
|
1071
1297
|
};
|
|
1072
|
-
return /* @__PURE__ */
|
|
1298
|
+
return /* @__PURE__ */ React7.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React7.createElement(Box7, { sx: { width: "100%" } }, /* @__PURE__ */ React7.createElement(
|
|
1073
1299
|
DateRangePicker,
|
|
1074
1300
|
{
|
|
1075
1301
|
value: state,
|
|
@@ -1088,7 +1314,7 @@ var SCDateRange = ({
|
|
|
1088
1314
|
required,
|
|
1089
1315
|
error: position === "start" ? isStartEmpty : isEndEmpty,
|
|
1090
1316
|
InputProps: {
|
|
1091
|
-
endAdornment: /* @__PURE__ */
|
|
1317
|
+
endAdornment: /* @__PURE__ */ React7.createElement(InputAdornment4, { position: "end" }, /* @__PURE__ */ React7.createElement(
|
|
1092
1318
|
EventIcon,
|
|
1093
1319
|
{
|
|
1094
1320
|
color: hasError ? "error" : "action",
|
|
@@ -1158,7 +1384,7 @@ var validateInputs = (arrayElements, onError, onSuccess, setChipFilters, setText
|
|
|
1158
1384
|
};
|
|
1159
1385
|
|
|
1160
1386
|
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
1161
|
-
import
|
|
1387
|
+
import React8 from "react";
|
|
1162
1388
|
var validateTypeElements = (element) => {
|
|
1163
1389
|
var _a;
|
|
1164
1390
|
let validation = "";
|
|
@@ -1166,37 +1392,37 @@ var validateTypeElements = (element) => {
|
|
|
1166
1392
|
if (element.type == "textField") {
|
|
1167
1393
|
validation = "textField";
|
|
1168
1394
|
typeElement = element;
|
|
1169
|
-
} else if (
|
|
1395
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextField") {
|
|
1170
1396
|
validation = "textField";
|
|
1171
1397
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1172
1398
|
} else if (element.type == "textArea") {
|
|
1173
1399
|
validation = "textArea";
|
|
1174
1400
|
typeElement = element;
|
|
1175
|
-
} else if (
|
|
1401
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextArea") {
|
|
1176
1402
|
validation = "textArea";
|
|
1177
1403
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1178
1404
|
} else if (element.type == "dateRange") {
|
|
1179
1405
|
validation = "dateRange";
|
|
1180
1406
|
typeElement = element;
|
|
1181
|
-
} else if (
|
|
1407
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCDateRange") {
|
|
1182
1408
|
validation = "dateRange";
|
|
1183
1409
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1184
1410
|
} else if (element.type == "autocomplete") {
|
|
1185
1411
|
validation = "autocomplete";
|
|
1186
1412
|
typeElement = element;
|
|
1187
|
-
} else if (
|
|
1413
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCAutocomplete") {
|
|
1188
1414
|
validation = "autocomplete";
|
|
1189
1415
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1190
1416
|
} else if (element.typeFormat == "multiselect") {
|
|
1191
1417
|
validation = "multiselect";
|
|
1192
1418
|
typeElement = element;
|
|
1193
|
-
} else if (
|
|
1419
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_a = element == null ? void 0 : element.component) == null ? void 0 : _a.props).typeFormat == "multiselect") {
|
|
1194
1420
|
validation = "multiselect";
|
|
1195
1421
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1196
1422
|
} else if (element.type == "select") {
|
|
1197
1423
|
validation = "select";
|
|
1198
1424
|
typeElement = element;
|
|
1199
|
-
} else if (
|
|
1425
|
+
} else if (React8.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCSelect") {
|
|
1200
1426
|
validation = "select";
|
|
1201
1427
|
typeElement = element == null ? void 0 : element.component.props;
|
|
1202
1428
|
}
|
|
@@ -1223,12 +1449,12 @@ function SCDrawer({
|
|
|
1223
1449
|
chipFilters
|
|
1224
1450
|
}) {
|
|
1225
1451
|
var _a, _b;
|
|
1226
|
-
const scrollRef =
|
|
1227
|
-
const [drawerOpen, setDrawerOpen] =
|
|
1228
|
-
const [toast, setToast] =
|
|
1229
|
-
const [stateChipFilters, setChipFilters] =
|
|
1230
|
-
const [textFilters, setTextFilters] =
|
|
1231
|
-
|
|
1452
|
+
const scrollRef = useRef3(null);
|
|
1453
|
+
const [drawerOpen, setDrawerOpen] = React9.useState(open);
|
|
1454
|
+
const [toast, setToast] = React9.useState(null);
|
|
1455
|
+
const [stateChipFilters, setChipFilters] = React9.useState(false);
|
|
1456
|
+
const [textFilters, setTextFilters] = React9.useState([]);
|
|
1457
|
+
useEffect9(() => {
|
|
1232
1458
|
if (chipFilters != void 0) {
|
|
1233
1459
|
if (chipFilters.length > 0) {
|
|
1234
1460
|
setTextFilters([]);
|
|
@@ -1236,7 +1462,7 @@ function SCDrawer({
|
|
|
1236
1462
|
}
|
|
1237
1463
|
}
|
|
1238
1464
|
}, [chipFilters]);
|
|
1239
|
-
|
|
1465
|
+
useEffect9(() => {
|
|
1240
1466
|
if (open) {
|
|
1241
1467
|
toggleDrawer(true);
|
|
1242
1468
|
} else {
|
|
@@ -1399,8 +1625,8 @@ function SCDrawer({
|
|
|
1399
1625
|
};
|
|
1400
1626
|
const shouldShowChips = chipFilters != void 0 && chipFilters.length > 0 ? true : stateChipFilters === true && hasActiveFilters();
|
|
1401
1627
|
const actionsA = actions == false ? false : actions != void 0 ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: cleanFilters }];
|
|
1402
|
-
return /* @__PURE__ */
|
|
1403
|
-
|
|
1628
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, toast && /* @__PURE__ */ React9.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React9.createElement(Grid4, { container: true, justifyContent: "flex-start", flexWrap: "nowrap", alignItems: "center", sx: { width: "100%" } }, shouldShowChips && /* @__PURE__ */ React9.createElement(Box8, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ React9.createElement(IconButton6, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ React9.createElement(ArrowBackIosIcon, { fontSize: "small" })), /* @__PURE__ */ React9.createElement(
|
|
1629
|
+
Box8,
|
|
1404
1630
|
{
|
|
1405
1631
|
ref: scrollRef,
|
|
1406
1632
|
gap: 0.3,
|
|
@@ -1411,7 +1637,7 @@ function SCDrawer({
|
|
|
1411
1637
|
"&::-webkit-scrollbar": { display: "none" }
|
|
1412
1638
|
}
|
|
1413
1639
|
},
|
|
1414
|
-
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */
|
|
1640
|
+
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */ React9.createElement(
|
|
1415
1641
|
Chip2,
|
|
1416
1642
|
__spreadProps(__spreadValues({
|
|
1417
1643
|
key: index,
|
|
@@ -1426,15 +1652,15 @@ function SCDrawer({
|
|
|
1426
1652
|
}
|
|
1427
1653
|
})
|
|
1428
1654
|
))
|
|
1429
|
-
), /* @__PURE__ */
|
|
1655
|
+
), /* @__PURE__ */ React9.createElement(IconButton6, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ React9.createElement(ArrowForwardIosIcon, { fontSize: "small" }))), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ React9.createElement(
|
|
1430
1656
|
Chip2,
|
|
1431
1657
|
__spreadProps(__spreadValues({
|
|
1432
1658
|
onClick: toggleDrawer(true),
|
|
1433
1659
|
color: buttonDrawer == null ? void 0 : buttonDrawer.color,
|
|
1434
1660
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) == "contained" ? "filled" : "outlined",
|
|
1435
1661
|
label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
|
|
1436
|
-
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */
|
|
1437
|
-
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1662
|
+
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ React9.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
|
|
1663
|
+
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React9.createElement(ButtonIcon, { fontSize: "small" }) : void 0
|
|
1438
1664
|
}, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
|
|
1439
1665
|
} } : {}), {
|
|
1440
1666
|
sx: {
|
|
@@ -1444,8 +1670,8 @@ function SCDrawer({
|
|
|
1444
1670
|
textTransform: "capitalize"
|
|
1445
1671
|
}
|
|
1446
1672
|
})
|
|
1447
|
-
) : /* @__PURE__ */
|
|
1448
|
-
|
|
1673
|
+
) : /* @__PURE__ */ React9.createElement(
|
|
1674
|
+
Button5,
|
|
1449
1675
|
{
|
|
1450
1676
|
"data-testid": "test-buttonDrawer",
|
|
1451
1677
|
sx: { textTransform: "capitalize" },
|
|
@@ -1453,11 +1679,11 @@ function SCDrawer({
|
|
|
1453
1679
|
onClick: toggleDrawer(true),
|
|
1454
1680
|
size: "small",
|
|
1455
1681
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
|
|
1456
|
-
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */
|
|
1457
|
-
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1682
|
+
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ React9.createElement(ButtonIcon, { fontSize: "small" }) : null,
|
|
1683
|
+
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React9.createElement(ButtonIcon, { fontSize: "small" }) : null
|
|
1458
1684
|
},
|
|
1459
1685
|
(_b = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _b : ""
|
|
1460
|
-
)), /* @__PURE__ */
|
|
1686
|
+
)), /* @__PURE__ */ React9.createElement(
|
|
1461
1687
|
Drawer,
|
|
1462
1688
|
{
|
|
1463
1689
|
open: drawerOpen,
|
|
@@ -1471,15 +1697,15 @@ function SCDrawer({
|
|
|
1471
1697
|
}
|
|
1472
1698
|
}
|
|
1473
1699
|
},
|
|
1474
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ React9.createElement(Stack4, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ React9.createElement(Grid4, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ React9.createElement(Typography8, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ React9.createElement(IconButton6, { onClick: handleDrawerClose }, /* @__PURE__ */ React9.createElement(CloseIcon, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ React9.createElement(Stack4, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
|
|
1475
1701
|
var _a2, _b2, _c, _d, _e, _f;
|
|
1476
|
-
return /* @__PURE__ */
|
|
1477
|
-
|
|
1702
|
+
return /* @__PURE__ */ React9.createElement(
|
|
1703
|
+
Box8,
|
|
1478
1704
|
{
|
|
1479
1705
|
key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b2 = arrayElement.label) != null ? _b2 : ""}${index}`,
|
|
1480
1706
|
sx: { width: "100%" }
|
|
1481
1707
|
},
|
|
1482
|
-
arrayElement.component ? /* @__PURE__ */
|
|
1708
|
+
arrayElement.component ? /* @__PURE__ */ React9.createElement(Stack4, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ React9.createElement(
|
|
1483
1709
|
SCTextField,
|
|
1484
1710
|
{
|
|
1485
1711
|
title: arrayElement.title,
|
|
@@ -1505,7 +1731,7 @@ function SCDrawer({
|
|
|
1505
1731
|
onBlur: arrayElement.onBlur,
|
|
1506
1732
|
onKeyDown: arrayElement.onKeyDown
|
|
1507
1733
|
}
|
|
1508
|
-
) : arrayElement.type === "textArea" ? /* @__PURE__ */
|
|
1734
|
+
) : arrayElement.type === "textArea" ? /* @__PURE__ */ React9.createElement(
|
|
1509
1735
|
SCTextArea,
|
|
1510
1736
|
{
|
|
1511
1737
|
title: arrayElement.title,
|
|
@@ -1524,7 +1750,7 @@ function SCDrawer({
|
|
|
1524
1750
|
state: arrayElement.state || "",
|
|
1525
1751
|
onBlur: arrayElement.onBlur
|
|
1526
1752
|
}
|
|
1527
|
-
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */
|
|
1753
|
+
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ React9.createElement(
|
|
1528
1754
|
SCAutocomplete,
|
|
1529
1755
|
{
|
|
1530
1756
|
label: arrayElement.label,
|
|
@@ -1542,7 +1768,7 @@ function SCDrawer({
|
|
|
1542
1768
|
state: arrayElement.state || "",
|
|
1543
1769
|
inputChange: arrayElement.inputChange
|
|
1544
1770
|
}
|
|
1545
|
-
) : arrayElement.type === "select" ? /* @__PURE__ */
|
|
1771
|
+
) : arrayElement.type === "select" ? /* @__PURE__ */ React9.createElement(
|
|
1546
1772
|
SCSelect,
|
|
1547
1773
|
{
|
|
1548
1774
|
label: arrayElement.label,
|
|
@@ -1558,7 +1784,7 @@ function SCDrawer({
|
|
|
1558
1784
|
setState: arrayElement.setState,
|
|
1559
1785
|
state: arrayElement.state || ""
|
|
1560
1786
|
}
|
|
1561
|
-
) : arrayElement.type === "dateRange" ? /* @__PURE__ */
|
|
1787
|
+
) : arrayElement.type === "dateRange" ? /* @__PURE__ */ React9.createElement(
|
|
1562
1788
|
SCDateRange,
|
|
1563
1789
|
{
|
|
1564
1790
|
labelDateInitial: arrayElement.labelDateInitial,
|
|
@@ -1571,7 +1797,7 @@ function SCDrawer({
|
|
|
1571
1797
|
}
|
|
1572
1798
|
) : null
|
|
1573
1799
|
);
|
|
1574
|
-
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */
|
|
1800
|
+
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */ React9.createElement(
|
|
1575
1801
|
Grid4,
|
|
1576
1802
|
{
|
|
1577
1803
|
sx: { borderTop: 1, borderColor: "#1018403B" },
|
|
@@ -1583,8 +1809,8 @@ function SCDrawer({
|
|
|
1583
1809
|
justifyContent: actionsA.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
|
|
1584
1810
|
flexDirection: anchor != "right" ? "row-reverse" : "row"
|
|
1585
1811
|
},
|
|
1586
|
-
actionsA.map((btn, index) => /* @__PURE__ */
|
|
1587
|
-
|
|
1812
|
+
actionsA.map((btn, index) => /* @__PURE__ */ React9.createElement(
|
|
1813
|
+
Button5,
|
|
1588
1814
|
{
|
|
1589
1815
|
key: index,
|
|
1590
1816
|
variant: index === 0 || actionsA.length < 2 ? "contained" : "text",
|
|
@@ -1600,52 +1826,52 @@ function SCDrawer({
|
|
|
1600
1826
|
}
|
|
1601
1827
|
|
|
1602
1828
|
// src/Components/FooterAction/FooterAction.tsx
|
|
1603
|
-
import
|
|
1604
|
-
import { AppBar, Toolbar, Box as
|
|
1829
|
+
import React10 from "react";
|
|
1830
|
+
import { AppBar, Toolbar, Box as Box9, Typography as Typography9 } from "@mui/material";
|
|
1605
1831
|
var FooterAction = ({
|
|
1606
1832
|
leftContent,
|
|
1607
1833
|
rightContent,
|
|
1608
1834
|
label,
|
|
1609
1835
|
variant
|
|
1610
1836
|
}) => {
|
|
1611
|
-
return /* @__PURE__ */
|
|
1837
|
+
return /* @__PURE__ */ React10.createElement(
|
|
1612
1838
|
AppBar,
|
|
1613
1839
|
{
|
|
1614
1840
|
color: "inherit",
|
|
1615
1841
|
sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
|
|
1616
1842
|
},
|
|
1617
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ React10.createElement(
|
|
1618
1844
|
Toolbar,
|
|
1619
1845
|
{
|
|
1620
1846
|
id: "footer-toolbar",
|
|
1621
1847
|
sx: { gap: 1.5, minHeight: "50px !important" }
|
|
1622
1848
|
},
|
|
1623
1849
|
leftContent,
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
label && /* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ React10.createElement(Box9, { flexGrow: 1 }),
|
|
1851
|
+
label && /* @__PURE__ */ React10.createElement(Typography9, { variant: "body2", color: "text.secondary" }, label),
|
|
1626
1852
|
rightContent
|
|
1627
1853
|
)
|
|
1628
1854
|
);
|
|
1629
1855
|
};
|
|
1630
1856
|
|
|
1631
1857
|
// src/Components/Modal/Helpers/Data.tsx
|
|
1632
|
-
import
|
|
1858
|
+
import React11 from "react";
|
|
1633
1859
|
import { Info, Warning } from "@mui/icons-material";
|
|
1634
1860
|
var modalStateConfig = {
|
|
1635
1861
|
info: {
|
|
1636
1862
|
color: "info",
|
|
1637
1863
|
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
1638
|
-
icon: /* @__PURE__ */
|
|
1864
|
+
icon: /* @__PURE__ */ React11.createElement(Info, { color: "info", fontSize: "medium" })
|
|
1639
1865
|
},
|
|
1640
1866
|
delete: {
|
|
1641
1867
|
color: "delete",
|
|
1642
1868
|
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
1643
|
-
icon: /* @__PURE__ */
|
|
1869
|
+
icon: /* @__PURE__ */ React11.createElement(Info, { color: "error", fontSize: "medium" })
|
|
1644
1870
|
},
|
|
1645
1871
|
warning: {
|
|
1646
1872
|
color: "warning",
|
|
1647
1873
|
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
1648
|
-
icon: /* @__PURE__ */
|
|
1874
|
+
icon: /* @__PURE__ */ React11.createElement(Warning, { color: "warning", fontSize: "medium" })
|
|
1649
1875
|
}
|
|
1650
1876
|
};
|
|
1651
1877
|
|
|
@@ -1675,8 +1901,8 @@ var getButtonColor = (state) => {
|
|
|
1675
1901
|
};
|
|
1676
1902
|
|
|
1677
1903
|
// src/Components/Modal/SCModal.tsx
|
|
1678
|
-
import
|
|
1679
|
-
import { Modal, Box as
|
|
1904
|
+
import React12, { useCallback as useCallback3, useMemo as useMemo3, useState as useState6 } from "react";
|
|
1905
|
+
import { Modal, Box as Box10, Typography as Typography10, IconButton as IconButton7, Button as Button6, Stack as Stack5 } from "@mui/material";
|
|
1680
1906
|
import { Close as Close2 } from "@mui/icons-material";
|
|
1681
1907
|
|
|
1682
1908
|
// src/generales/capitalize.tsx
|
|
@@ -1694,8 +1920,8 @@ var SCModal = ({
|
|
|
1694
1920
|
action
|
|
1695
1921
|
}) => {
|
|
1696
1922
|
var _a, _b, _c, _d, _e;
|
|
1697
|
-
const [openModal, setOpenModal] =
|
|
1698
|
-
const handleOpen =
|
|
1923
|
+
const [openModal, setOpenModal] = useState6(open != null ? open : false);
|
|
1924
|
+
const handleOpen = React12.useCallback(() => {
|
|
1699
1925
|
setOpenModal((prev) => !prev);
|
|
1700
1926
|
}, []);
|
|
1701
1927
|
const Icon = useMemo3(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
@@ -1706,20 +1932,20 @@ var SCModal = ({
|
|
|
1706
1932
|
[action, handleClose]
|
|
1707
1933
|
);
|
|
1708
1934
|
const { icon, defaultDescription } = modalStateConfig[state];
|
|
1709
|
-
return /* @__PURE__ */
|
|
1710
|
-
|
|
1935
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
1936
|
+
Button6,
|
|
1711
1937
|
{
|
|
1712
1938
|
"data-testid": "test-buttonModal",
|
|
1713
1939
|
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
1714
1940
|
onClick: handleOpen,
|
|
1715
1941
|
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
1716
1942
|
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
1717
|
-
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */
|
|
1718
|
-
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */
|
|
1943
|
+
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React12.createElement(Icon, null),
|
|
1944
|
+
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React12.createElement(Icon, null)
|
|
1719
1945
|
},
|
|
1720
1946
|
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
1721
|
-
), /* @__PURE__ */
|
|
1722
|
-
|
|
1947
|
+
), /* @__PURE__ */ React12.createElement(Modal, { open: openModal, onClose: handleOpen, sx: { boxShadow: 8 } }, /* @__PURE__ */ React12.createElement(
|
|
1948
|
+
Box10,
|
|
1723
1949
|
{
|
|
1724
1950
|
sx: {
|
|
1725
1951
|
position: "absolute",
|
|
@@ -1732,10 +1958,10 @@ var SCModal = ({
|
|
|
1732
1958
|
boxShadow: 24
|
|
1733
1959
|
}
|
|
1734
1960
|
},
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
action && /* @__PURE__ */
|
|
1738
|
-
|
|
1961
|
+
/* @__PURE__ */ React12.createElement(Stack5, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React12.createElement(Box10, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ React12.createElement(Typography10, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React12.createElement(IconButton7, { onClick: handleOpen, "data-testid": "test-buttonClose" }, /* @__PURE__ */ React12.createElement(Close2, { color: "action" }))),
|
|
1962
|
+
/* @__PURE__ */ React12.createElement(Stack5, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React12.createElement(Typography10, { variant: "body1" }, description || defaultDescription)),
|
|
1963
|
+
action && /* @__PURE__ */ React12.createElement(
|
|
1964
|
+
Stack5,
|
|
1739
1965
|
{
|
|
1740
1966
|
id: "Action",
|
|
1741
1967
|
direction: "row",
|
|
@@ -1745,8 +1971,8 @@ var SCModal = ({
|
|
|
1745
1971
|
bgcolor: "grey.50",
|
|
1746
1972
|
sx: { borderRadius: 1 }
|
|
1747
1973
|
},
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
|
|
1974
|
+
/* @__PURE__ */ React12.createElement(
|
|
1975
|
+
Button6,
|
|
1750
1976
|
{
|
|
1751
1977
|
color: "inherit",
|
|
1752
1978
|
variant: "text",
|
|
@@ -1755,8 +1981,8 @@ var SCModal = ({
|
|
|
1755
1981
|
},
|
|
1756
1982
|
capitalize("cancelar")
|
|
1757
1983
|
),
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
|
|
1984
|
+
/* @__PURE__ */ React12.createElement(
|
|
1985
|
+
Button6,
|
|
1760
1986
|
{
|
|
1761
1987
|
"data-testid": "test-aceptar",
|
|
1762
1988
|
color: getButtonColor(state),
|
|
@@ -1772,17 +1998,17 @@ var SCModal = ({
|
|
|
1772
1998
|
};
|
|
1773
1999
|
|
|
1774
2000
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
1775
|
-
import
|
|
1776
|
-
import { Button as
|
|
2001
|
+
import React13, { useEffect as useEffect11, useMemo as useMemo5 } from "react";
|
|
2002
|
+
import { Button as Button7, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack6, TextField as TextField4 } from "@mui/material";
|
|
1777
2003
|
import { SearchOutlined } from "@mui/icons-material";
|
|
1778
2004
|
|
|
1779
2005
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
1780
|
-
import { useCallback as useCallback4, useState as
|
|
2006
|
+
import { useCallback as useCallback4, useState as useState7 } from "react";
|
|
1781
2007
|
function useMultiSelectHandlers() {
|
|
1782
|
-
const [anchorEl, setAnchorEl] =
|
|
1783
|
-
const [open, setOpen] =
|
|
1784
|
-
const [selectedItems, setSelectedItems] =
|
|
1785
|
-
const [filterValue, setFilterValue] =
|
|
2008
|
+
const [anchorEl, setAnchorEl] = useState7(null);
|
|
2009
|
+
const [open, setOpen] = useState7(false);
|
|
2010
|
+
const [selectedItems, setSelectedItems] = useState7([]);
|
|
2011
|
+
const [filterValue, setFilterValue] = useState7("");
|
|
1786
2012
|
const handleOpen = useCallback4((e) => {
|
|
1787
2013
|
setAnchorEl(e.currentTarget);
|
|
1788
2014
|
setOpen(true);
|
|
@@ -1866,12 +2092,12 @@ function MultiSelect({
|
|
|
1866
2092
|
handleCheckboxToggle,
|
|
1867
2093
|
setOpen
|
|
1868
2094
|
} = useMultiSelectHandlers();
|
|
1869
|
-
|
|
2095
|
+
useEffect11(() => {
|
|
1870
2096
|
if (open !== void 0) {
|
|
1871
2097
|
setOpen(open);
|
|
1872
2098
|
}
|
|
1873
2099
|
}, [open, setOpen]);
|
|
1874
|
-
|
|
2100
|
+
useEffect11(() => {
|
|
1875
2101
|
setSelectedItems([]);
|
|
1876
2102
|
}, [items, setSelectedItems]);
|
|
1877
2103
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
@@ -1889,19 +2115,19 @@ function MultiSelect({
|
|
|
1889
2115
|
{ text: "Aplicar", fn: () => {
|
|
1890
2116
|
} }
|
|
1891
2117
|
];
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
|
|
2118
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
2119
|
+
Button7,
|
|
1894
2120
|
{
|
|
1895
2121
|
"test-id": "multiselect-button",
|
|
1896
2122
|
color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
|
|
1897
2123
|
onClick: handleOpen,
|
|
1898
2124
|
variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
|
|
1899
2125
|
size: "small",
|
|
1900
|
-
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */
|
|
1901
|
-
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */
|
|
2126
|
+
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ React13.createElement(Icon, null) : null,
|
|
2127
|
+
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ React13.createElement(Icon, null) : null
|
|
1902
2128
|
},
|
|
1903
2129
|
capitalize(textButton != null ? textButton : "MultiSelect")
|
|
1904
|
-
), /* @__PURE__ */
|
|
2130
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1905
2131
|
Popover3,
|
|
1906
2132
|
{
|
|
1907
2133
|
elevation: 8,
|
|
@@ -1910,7 +2136,7 @@ function MultiSelect({
|
|
|
1910
2136
|
open: openMultiselect,
|
|
1911
2137
|
onClose: () => setOpen(false)
|
|
1912
2138
|
},
|
|
1913
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ React13.createElement(Stack6, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ React13.createElement(Stack6, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ React13.createElement(FormControl3, { fullWidth: true, size: "small" }, /* @__PURE__ */ React13.createElement(
|
|
1914
2140
|
TextField4,
|
|
1915
2141
|
{
|
|
1916
2142
|
"data-testid": "multiselect-input",
|
|
@@ -1922,18 +2148,18 @@ function MultiSelect({
|
|
|
1922
2148
|
onChange: handleFilterChange,
|
|
1923
2149
|
slotProps: {
|
|
1924
2150
|
input: {
|
|
1925
|
-
endAdornment: /* @__PURE__ */
|
|
2151
|
+
endAdornment: /* @__PURE__ */ React13.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React13.createElement(SearchOutlined, { fontSize: "small" }))
|
|
1926
2152
|
}
|
|
1927
2153
|
}
|
|
1928
2154
|
}
|
|
1929
|
-
))), /* @__PURE__ */
|
|
2155
|
+
))), /* @__PURE__ */ React13.createElement(Stack6, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ React13.createElement(MenuItem3, { dense, onClick: handleSelectAll }, /* @__PURE__ */ React13.createElement(ListItemIcon3, null, /* @__PURE__ */ React13.createElement(Checkbox2, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ React13.createElement(
|
|
1930
2156
|
MenuItem3,
|
|
1931
2157
|
{
|
|
1932
2158
|
key: getItemLabel(item),
|
|
1933
2159
|
dense,
|
|
1934
2160
|
onClick: () => handleCheckboxToggle(item)
|
|
1935
2161
|
},
|
|
1936
|
-
/* @__PURE__ */
|
|
2162
|
+
/* @__PURE__ */ React13.createElement(ListItemIcon3, null, /* @__PURE__ */ React13.createElement(
|
|
1937
2163
|
Checkbox2,
|
|
1938
2164
|
{
|
|
1939
2165
|
checked: selectedItems.includes(item),
|
|
@@ -1941,10 +2167,10 @@ function MultiSelect({
|
|
|
1941
2167
|
}
|
|
1942
2168
|
)),
|
|
1943
2169
|
getItemLabel(item)
|
|
1944
|
-
)) : /* @__PURE__ */
|
|
2170
|
+
)) : /* @__PURE__ */ React13.createElement(MenuItem3, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ React13.createElement(Stack6, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
|
|
1945
2171
|
var _a2;
|
|
1946
|
-
return /* @__PURE__ */
|
|
1947
|
-
|
|
2172
|
+
return /* @__PURE__ */ React13.createElement(
|
|
2173
|
+
Button7,
|
|
1948
2174
|
{
|
|
1949
2175
|
key: index,
|
|
1950
2176
|
variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
|
|
@@ -1959,8 +2185,8 @@ function MultiSelect({
|
|
|
1959
2185
|
}
|
|
1960
2186
|
|
|
1961
2187
|
// src/Components/PageHeader/PageHeader.tsx
|
|
1962
|
-
import
|
|
1963
|
-
import { Stack as
|
|
2188
|
+
import React14 from "react";
|
|
2189
|
+
import { Stack as Stack7, Typography as Typography11 } from "@mui/material";
|
|
1964
2190
|
var PageHeader = ({
|
|
1965
2191
|
title,
|
|
1966
2192
|
subtitle,
|
|
@@ -1969,8 +2195,8 @@ var PageHeader = ({
|
|
|
1969
2195
|
fixed,
|
|
1970
2196
|
shadow = true
|
|
1971
2197
|
}) => {
|
|
1972
|
-
return /* @__PURE__ */
|
|
1973
|
-
|
|
2198
|
+
return /* @__PURE__ */ React14.createElement(
|
|
2199
|
+
Stack7,
|
|
1974
2200
|
{
|
|
1975
2201
|
"data-testid": "main-container",
|
|
1976
2202
|
justifyContent: "center",
|
|
@@ -1981,13 +2207,13 @@ var PageHeader = ({
|
|
|
1981
2207
|
zIndex: 10,
|
|
1982
2208
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
1983
2209
|
},
|
|
1984
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ React14.createElement(Stack7, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React14.createElement(Stack7, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ React14.createElement(Stack7, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ React14.createElement(Typography11, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ React14.createElement(Typography11, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.primary" }, subtitle))), actions && /* @__PURE__ */ React14.createElement(Stack7, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
1985
2211
|
);
|
|
1986
2212
|
};
|
|
1987
2213
|
|
|
1988
2214
|
// src/Components/SCCalendarSwipeable.tsx
|
|
1989
|
-
import
|
|
1990
|
-
import { Typography as
|
|
2215
|
+
import React15, { useState as useState8 } from "react";
|
|
2216
|
+
import { Typography as Typography12, IconButton as IconButton8, Box as Box11 } from "@mui/material";
|
|
1991
2217
|
import Grid5 from "@mui/material/Grid2";
|
|
1992
2218
|
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
1993
2219
|
import { LocalizationProvider as LocalizationProvider2 } from "@mui/x-date-pickers/LocalizationProvider";
|
|
@@ -2005,14 +2231,14 @@ var SCCalendarSwipeable = ({
|
|
|
2005
2231
|
state
|
|
2006
2232
|
}) => {
|
|
2007
2233
|
let convertFecha;
|
|
2008
|
-
const [fecha, setFecha] =
|
|
2009
|
-
const [fechaSeleccionada, setFechaSeleccionada] =
|
|
2010
|
-
const [stateVal, setstateVal] =
|
|
2011
|
-
const [openCalendar, setOpenCalendar] =
|
|
2234
|
+
const [fecha, setFecha] = useState8(/* @__PURE__ */ new Date());
|
|
2235
|
+
const [fechaSeleccionada, setFechaSeleccionada] = useState8();
|
|
2236
|
+
const [stateVal, setstateVal] = React15.useState(/* @__PURE__ */ new Date());
|
|
2237
|
+
const [openCalendar, setOpenCalendar] = React15.useState(false);
|
|
2012
2238
|
const hoy = /* @__PURE__ */ new Date();
|
|
2013
2239
|
const inicioSemana = startOfWeek(fecha, { weekStartsOn: 0 });
|
|
2014
2240
|
const diasSemana = Array.from({ length: 7 }, (_, i) => addDays(inicioSemana, i));
|
|
2015
|
-
|
|
2241
|
+
React15.useEffect(() => {
|
|
2016
2242
|
if (fecha != null) {
|
|
2017
2243
|
handleConvertFecha(fecha);
|
|
2018
2244
|
}
|
|
@@ -2031,12 +2257,12 @@ var SCCalendarSwipeable = ({
|
|
|
2031
2257
|
setOpenCalendar(newOpen);
|
|
2032
2258
|
};
|
|
2033
2259
|
const locale = __spreadValues({}, es);
|
|
2034
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(LocalizationProvider2, { dateAdapter: AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React15.createElement(Box11, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React15.createElement(Box11, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ React15.createElement(Grid5, { container: true, gap: 0.5, sx: {
|
|
2035
2261
|
justifyContent: "space-between",
|
|
2036
2262
|
padding: "12px 0px",
|
|
2037
2263
|
background: "transparent"
|
|
2038
|
-
} }, diasSemana.map((dia) => /* @__PURE__ */
|
|
2039
|
-
|
|
2264
|
+
} }, diasSemana.map((dia) => /* @__PURE__ */ React15.createElement(Grid5, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React15.createElement(Box11, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React15.createElement(Typography12, { sx: { fontSize: "12px !important", color: "#10184099" } }, format(dia, "EEEE", { locale: es }).charAt(0).toUpperCase())), /* @__PURE__ */ React15.createElement(
|
|
2265
|
+
Box11,
|
|
2040
2266
|
{
|
|
2041
2267
|
onClick: () => setFecha(dia),
|
|
2042
2268
|
sx: {
|
|
@@ -2051,8 +2277,8 @@ var SCCalendarSwipeable = ({
|
|
|
2051
2277
|
//height: '36px',
|
|
2052
2278
|
}
|
|
2053
2279
|
},
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
)))), /* @__PURE__ */
|
|
2280
|
+
/* @__PURE__ */ React15.createElement(Typography12, { sx: { fontSize: "12px !important", color: isSameDay(dia, fecha) ? "white" : "#101840DE" } }, format(dia, "d"))
|
|
2281
|
+
)))), /* @__PURE__ */ React15.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React15.createElement(IconButton8, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ React15.createElement(KeyboardDoubleArrowDownIcon, null))))) : /* @__PURE__ */ React15.createElement(Box11, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ React15.createElement(
|
|
2056
2282
|
StaticDatePicker,
|
|
2057
2283
|
{
|
|
2058
2284
|
orientation: "landscape",
|
|
@@ -2062,11 +2288,11 @@ var SCCalendarSwipeable = ({
|
|
|
2062
2288
|
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" } },
|
|
2063
2289
|
onChange: (newValue) => setFecha(newValue)
|
|
2064
2290
|
}
|
|
2065
|
-
), /* @__PURE__ */
|
|
2291
|
+
), /* @__PURE__ */ React15.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React15.createElement(IconButton8, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React15.createElement(KeyboardDoubleArrowUpIcon, null))))));
|
|
2066
2292
|
};
|
|
2067
2293
|
|
|
2068
2294
|
// src/Components/SCDataGrid.tsx
|
|
2069
|
-
import
|
|
2295
|
+
import React16, { useEffect as useEffect13, useState as useState9 } from "react";
|
|
2070
2296
|
import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
|
|
2071
2297
|
import { LicenseInfo as LicenseInfo2 } from "@mui/x-license-pro";
|
|
2072
2298
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
@@ -2156,7 +2382,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2156
2382
|
label = label;
|
|
2157
2383
|
}
|
|
2158
2384
|
}
|
|
2159
|
-
return /* @__PURE__ */
|
|
2385
|
+
return /* @__PURE__ */ React16.createElement(
|
|
2160
2386
|
"div",
|
|
2161
2387
|
{
|
|
2162
2388
|
style: {
|
|
@@ -2173,7 +2399,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2173
2399
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
2174
2400
|
}
|
|
2175
2401
|
},
|
|
2176
|
-
params.rowNode.type === "group" && /* @__PURE__ */
|
|
2402
|
+
params.rowNode.type === "group" && /* @__PURE__ */ React16.createElement(
|
|
2177
2403
|
"span",
|
|
2178
2404
|
{
|
|
2179
2405
|
style: {
|
|
@@ -2186,7 +2412,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2186
2412
|
params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
2187
2413
|
}
|
|
2188
2414
|
},
|
|
2189
|
-
params.rowNode.childrenExpanded ? /* @__PURE__ */
|
|
2415
|
+
params.rowNode.childrenExpanded ? /* @__PURE__ */ React16.createElement(KeyboardArrowUpIcon, { fontSize: "small", color: "action" }) : /* @__PURE__ */ React16.createElement(KeyboardArrowDownIcon, { fontSize: "small", color: "action" })
|
|
2190
2416
|
),
|
|
2191
2417
|
label
|
|
2192
2418
|
);
|
|
@@ -2228,11 +2454,11 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2228
2454
|
let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
|
|
2229
2455
|
let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
|
|
2230
2456
|
let validationGroupingColDef = groupingColDefs || {};
|
|
2231
|
-
const [groupDataLenght, setGroupDataLengh] =
|
|
2232
|
-
const [pageSize, setPageSize] =
|
|
2233
|
-
const [arrayRows, setArrayRows] =
|
|
2234
|
-
const [selectionModel, setSelectionModel] =
|
|
2235
|
-
|
|
2457
|
+
const [groupDataLenght, setGroupDataLengh] = useState9(0);
|
|
2458
|
+
const [pageSize, setPageSize] = useState9(rows);
|
|
2459
|
+
const [arrayRows, setArrayRows] = useState9([]);
|
|
2460
|
+
const [selectionModel, setSelectionModel] = useState9([]);
|
|
2461
|
+
useEffect13(() => {
|
|
2236
2462
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
2237
2463
|
dataConvertRows(data, void 0);
|
|
2238
2464
|
}
|
|
@@ -2288,7 +2514,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2288
2514
|
setSelectionModel([...newSelection]);
|
|
2289
2515
|
}
|
|
2290
2516
|
};
|
|
2291
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, data && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ React16.createElement(
|
|
2292
2518
|
DataGridPro,
|
|
2293
2519
|
{
|
|
2294
2520
|
apiRef,
|
|
@@ -2352,45 +2578,45 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2352
2578
|
}
|
|
2353
2579
|
))));
|
|
2354
2580
|
}
|
|
2355
|
-
var SCDataGrid =
|
|
2581
|
+
var SCDataGrid = React16.memo(SCDataGridInitial, (prevProps, nextProps) => {
|
|
2356
2582
|
const isEqual = prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
|
|
2357
2583
|
return isEqual;
|
|
2358
2584
|
});
|
|
2359
2585
|
|
|
2360
2586
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2361
|
-
import
|
|
2362
|
-
import { Button as
|
|
2587
|
+
import React21 from "react";
|
|
2588
|
+
import { Button as Button9, Stack as Stack8, Typography as Typography13 } from "@mui/material";
|
|
2363
2589
|
|
|
2364
2590
|
// src/assets/ImgEmptyState/create.tsx
|
|
2365
|
-
import
|
|
2591
|
+
import React17 from "react";
|
|
2366
2592
|
var Create = () => {
|
|
2367
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ React17.createElement("svg", { width: "45", height: "41", viewBox: "0 0 45 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React17.createElement("g", { "clip-path": "url(#clip0_1283_39624)" }, /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.4956 13.1869C44.4386 13.8714 43.8367 14.3801 43.1514 14.3231L39.9978 14.0608C39.3124 14.0038 38.8032 13.4027 38.8602 12.7182C38.9173 12.0336 39.5191 11.525 40.2044 11.582L43.3581 11.8443C44.0434 11.9013 44.5527 12.5024 44.4956 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M41.0393 1.01388C41.4429 1.57002 41.3187 2.34766 40.7619 2.75078L38.099 4.6787C37.5423 5.08182 36.7637 4.95777 36.3601 4.40163C35.9565 3.84548 36.0807 3.06785 36.6375 2.66473L39.3004 0.736804C39.8572 0.333685 40.6357 0.457736 41.0393 1.01388Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M36.6656 21.2361C36.1755 21.7179 36.1692 22.5054 36.6515 22.9949L38.9584 25.3363C39.4408 25.8258 40.2291 25.8321 40.7193 25.3503C41.2094 24.8685 41.2157 24.0811 40.7333 23.5915L38.4264 21.2502C37.9441 20.7606 37.1557 20.7543 36.6656 21.2361Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.504365 13.1869C0.561439 13.8714 1.16326 14.3801 1.84856 14.323L5.00224 14.0607C5.68755 14.0037 6.19683 13.4026 6.13976 12.7181C6.08268 12.0336 5.48087 11.5249 4.79556 11.5819L1.64188 11.8442C0.956574 11.9012 0.447291 12.5023 0.504365 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.95913 1.01431C3.55554 1.57046 3.67974 2.34809 4.23653 2.75121L6.8994 4.67914C7.45619 5.08225 8.23473 4.9582 8.63832 4.40206C9.04191 3.84592 8.91771 3.06828 8.36092 2.66516L5.69805 0.737237C5.14126 0.334118 4.36272 0.458169 3.95913 1.01431Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.33389 21.236C8.82403 21.7178 8.83033 22.5053 8.34796 22.9949L6.04107 25.3362C5.5587 25.8257 4.77034 25.832 4.28021 25.3502C3.79008 24.8684 3.78378 24.081 4.26614 23.5914L6.57304 21.2501C7.0554 20.7605 7.84376 20.7542 8.33389 21.236Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { d: "M19.1448 37.3573H25.5804L25.1621 38.889C25.0636 39.2498 24.7356 39.5 24.3613 39.5H20.3638C19.9895 39.5 19.6615 39.2498 19.563 38.889L19.1448 37.3573Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { d: "M17.6534 35.3665C17.5381 34.8487 17.9326 34.3575 18.4637 34.3575H26.3983C26.9294 34.3575 27.3239 34.8487 27.2087 35.3665L26.9829 36.3814C26.8563 36.9504 26.351 37.3553 25.7674 37.3553H19.0946C18.511 37.3553 18.0057 36.9504 17.8791 36.3814L17.6534 35.3665Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.85423 13.9906C8.85423 6.60807 14.935 0.652473 22.3998 0.652473C29.8646 0.652473 35.9455 6.60807 35.9455 13.9906C35.9455 17.6153 34.4759 20.9015 32.0983 23.3022C31.9627 23.4392 31.8257 23.5745 31.6935 23.7052L31.6917 23.707C30.7961 24.5922 30.1385 25.2699 29.8494 26.1116C29.7242 26.4761 29.6012 27.1915 29.4988 28.0885C29.4002 28.9527 29.3306 29.8872 29.2854 30.6281C29.2099 31.864 28.1896 32.8547 26.9266 32.8547H17.8731C16.6101 32.8547 15.5898 31.864 15.5143 30.6281C15.469 29.8872 15.3995 28.9527 15.3009 28.0885C15.1985 27.1915 15.0755 26.4761 14.9503 26.1116C14.6612 25.2699 14.0036 24.5922 13.108 23.707L13.106 23.7051C12.9739 23.5744 12.837 23.4391 12.7014 23.3022C10.3238 20.9015 8.85423 17.6153 8.85423 13.9906ZM22.3998 2.85676C16.1214 2.85676 11.0611 7.85765 11.0611 13.9906C11.0611 17.0068 12.2813 19.7437 14.2703 21.752C14.3969 21.8798 14.526 22.0075 14.6602 22.1401C14.6831 22.1627 14.7062 22.1855 14.7294 22.2085C15.5402 23.0091 16.5655 24.0215 17.0377 25.3961C17.2505 26.0156 17.3925 26.9534 17.4936 27.8388C17.5983 28.757 17.6707 29.7342 17.7171 30.4939C17.723 30.59 17.8001 30.6504 17.8731 30.6504H26.9266C26.9996 30.6504 27.0767 30.59 27.0826 30.4939C27.129 29.7342 27.2013 28.757 27.3061 27.8388C27.4072 26.9534 27.5492 26.0156 27.762 25.3961C28.2342 24.0215 29.2594 23.0091 30.0702 22.2085C30.0935 22.1855 30.1166 22.1627 30.1395 22.1401C30.2737 22.0075 30.4028 21.8798 30.5294 21.752C32.5184 19.7437 33.7386 17.0068 33.7386 13.9906C33.7386 7.85765 28.6783 2.85676 22.3998 2.85676Z", fill: "#B9BDC1" })), /* @__PURE__ */ React17.createElement("defs", null, /* @__PURE__ */ React17.createElement("clipPath", { id: "clip0_1283_39624" }, /* @__PURE__ */ React17.createElement("rect", { width: "44", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2368
2594
|
};
|
|
2369
2595
|
|
|
2370
2596
|
// src/assets/ImgEmptyState/empty.tsx
|
|
2371
|
-
import
|
|
2597
|
+
import React18 from "react";
|
|
2372
2598
|
var Empty = () => {
|
|
2373
|
-
return /* @__PURE__ */
|
|
2599
|
+
return /* @__PURE__ */ React18.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React18.createElement("g", { "clip-path": "url(#clip0_1283_39626)" }, /* @__PURE__ */ React18.createElement("path", { d: "M36.1351 20.9955C25.1396 25.3151 16.1875 30.5689 11.8186 30.9221L14.7134 35.4696L36.1351 20.9955Z", fill: "#CED1D4" }), /* @__PURE__ */ React18.createElement("path", { d: "M37.4531 24.9937C39.7468 28.137 42.9751 35.0522 37.4531 35.3441C34.9101 35.4058 31.3306 32.981 37.4531 24.9937Z", fill: "#CED1D4" }), /* @__PURE__ */ React18.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M25.6074 1.30001C25.1055 0.501016 24.051 0.26003 23.2522 0.761943L19.6474 3.02673C17.5114 2.68138 14.5326 2.642 12.1799 3.71891C10.8937 4.30766 9.75284 5.25155 9.09396 6.68863C8.65845 7.63849 8.46029 8.74589 8.52317 10.0159L1.2996 14.5543C0.500747 15.0562 0.260156 16.1108 0.762045 16.9098L12.7907 36.0589C13.2926 36.8579 14.3471 37.0989 15.1459 36.597L37.0985 22.8046C37.8973 22.3027 38.1379 21.2481 37.636 20.4491L25.6074 1.30001ZM2.79326 16.1347L8.88857 12.3051C8.91842 12.3953 8.95405 12.4868 8.99634 12.5777C9.70948 14.1097 11.2554 15.9861 13.7088 16.7327C16.2084 17.4934 19.3887 17.0049 23.1824 14.2981L23.3709 14.1636L22.1324 12.4273L21.9439 12.5618C18.5121 15.0104 16.0132 15.2048 14.3292 14.6924C12.5992 14.1659 11.458 12.8132 10.9295 11.6778C10.9197 11.6569 10.9072 11.6225 10.8968 11.5772C10.8595 11.4156 10.8267 11.2584 10.7981 11.1054L24.0275 2.79363L35.6048 21.2243L14.3706 34.5653L2.79326 16.1347ZM13.0675 5.65821C14.0932 5.18871 15.3429 4.98089 16.5902 4.94754L10.716 8.63821C10.7826 8.23367 10.8925 7.88269 11.0323 7.57786C11.4327 6.70447 12.1364 6.08441 13.0675 5.65821Z", fill: "#B9BDC1" }), /* @__PURE__ */ React18.createElement("path", { d: "M24.3482 14.3207C24.0493 15.6305 22.7454 16.4497 21.4358 16.1505C20.1262 15.8513 19.3069 14.547 19.6058 13.2372C19.9047 11.9274 21.2086 11.1082 22.5182 11.4074C23.8278 11.7066 24.6471 13.011 24.3482 14.3207Z", fill: "#CED1D4" })), /* @__PURE__ */ React18.createElement("defs", null, /* @__PURE__ */ React18.createElement("clipPath", { id: "clip0_1283_39626" }, /* @__PURE__ */ React18.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2374
2600
|
};
|
|
2375
2601
|
|
|
2376
2602
|
// src/assets/ImgEmptyState/error.tsx
|
|
2377
|
-
import
|
|
2603
|
+
import React19 from "react";
|
|
2378
2604
|
var Error2 = () => {
|
|
2379
|
-
return /* @__PURE__ */
|
|
2605
|
+
return /* @__PURE__ */ React19.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React19.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.8035 3.2925C17.0304 3.2925 16.358 3.82772 16.1913 4.58349L14.0944 13.8188C13.8625 14.8535 14.6474 15.8412 15.7066 15.8412H25.4175C26.4764 15.8412 27.2677 14.8538 27.0297 13.8185L24.9328 4.58323C24.7608 3.82996 24.0975 3.29514 23.3264 3.2925H17.8035ZM15.9436 13.9945L17.9555 5.13336L23.1745 5.12121L25.1863 13.9945H15.9436Z", fill: "#B9BDC1" }), /* @__PURE__ */ React19.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5449 28.1551C10.7717 28.1551 10.0993 28.6904 9.93264 29.4462L8.54048 35.6049C8.46109 35.7863 8.54048 35.6049 8.46109 35.7863H5.42145C4.91308 35.7863 4.50096 36.1984 4.50096 36.7068C4.50096 37.2152 4.91308 37.6273 5.42145 37.6273H35.5795C36.0879 37.6273 36.5 37.2152 36.5 36.7068C36.5 36.1984 36.0879 35.7863 35.5795 35.7863H32.595C32.5443 35.6284 32.5801 35.745 32.5443 35.5928L31.1121 29.4342C30.9394 28.6844 30.2672 28.1551 29.5 28.1551H11.5449ZM10.3781 35.7863L11.6854 29.9961H29.3426L30.6891 35.7863H10.3781Z", fill: "#B9BDC1" }), /* @__PURE__ */ React19.createElement("path", { d: "M13.7368 17.4381H28.0252C28.2486 17.4381 28.4434 17.5928 28.495 17.8162L30.271 25.9114C30.334 26.2094 30.1106 26.4901 29.8012 26.4901H11.6743C11.3649 26.4901 11.1358 26.1979 11.2102 25.8943L13.2727 17.799C13.3243 17.587 13.519 17.4381 13.7368 17.4381Z", fill: "#CED1D4" }));
|
|
2380
2606
|
};
|
|
2381
2607
|
|
|
2382
2608
|
// src/assets/ImgEmptyState/search.tsx
|
|
2383
|
-
import
|
|
2609
|
+
import React20 from "react";
|
|
2384
2610
|
var Search2 = () => {
|
|
2385
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React20.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React20.createElement("g", { "clip-path": "url(#clip0_1283_39628)" }, /* @__PURE__ */ React20.createElement("path", { d: "M29.421 4.71198C28.943 2.92749 30.0021 1.09315 31.7865 0.61487C33.5709 0.136592 35.405 1.19549 35.883 2.97998L40.3853 19.7878C40.8633 21.5723 39.8042 23.4066 38.0198 23.8849C36.2354 24.3632 34.4013 23.3043 33.9233 21.5198L29.421 4.71198Z", fill: "#CED1D4" }), /* @__PURE__ */ React20.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.607749 18.613C0.158895 16.9369 1.15336 15.2141 2.82895 14.7649C4.50454 14.3157 6.22674 15.3102 6.67559 16.9862L8.06043 22.1573C8.50928 23.8333 7.51482 25.5561 5.83923 26.0054C4.16364 26.4546 2.44144 25.46 1.99259 23.784L0.607749 18.613ZM3.41576 16.9561C2.95002 17.0809 2.67359 17.5598 2.79836 18.0257L4.18319 23.1967C4.30796 23.6626 4.78667 23.939 5.25242 23.8142C5.71816 23.6893 5.99459 23.2104 5.86982 22.7445L4.48499 17.5735C4.36022 17.1076 3.88151 16.8312 3.41576 16.9561Z", fill: "#B9BDC1" }), /* @__PURE__ */ React20.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.0672 23.7222C17.6115 24.3518 16.9814 24.8602 16.2239 25.1659L23.5692 38.9314C23.929 39.6056 23.6742 40.4438 23.0003 40.8037C22.3263 41.1635 21.4883 40.9087 21.1286 40.2346L14.2002 27.2506L6.15159 39.7788C5.73857 40.4217 4.88273 40.6079 4.24003 40.1948C3.59732 39.7816 3.41113 38.9255 3.82416 38.2826L12.4422 24.8681C11.8201 24.4937 11.2926 23.9601 10.9267 23.3057L6.9728 23.4848C6.43282 23.5092 5.94855 23.1546 5.80865 22.6324L4.48764 17.7008C4.34775 17.1786 4.5899 16.6293 5.06976 16.3804L11.2775 13.1606L11.2169 12.934C11.0764 12.4095 11.3213 11.8581 11.8046 11.6107L26.5904 4.04383C26.8999 3.88542 27.2644 3.87542 27.5822 4.01662C27.8999 4.15781 28.1369 4.43508 28.2269 4.77102L32.7303 21.5831C32.8203 21.9191 32.7537 22.2777 32.5491 22.5589C32.3445 22.8401 32.0238 23.0137 31.6766 23.0314L18.0672 23.7222ZM17.9643 23.1894C18.1495 22.8739 18.2903 22.5322 18.3806 22.1748C18.4139 22.0434 18.4403 21.9098 18.4596 21.7746C18.4048 22.1588 18.2927 22.5298 18.1297 22.876C18.0793 22.983 18.0241 23.0876 17.9643 23.1894ZM18.8739 21.375L30.1375 20.8032L26.3713 6.7432L13.6819 13.2372L14.6854 16.9834C16.5391 17.0063 18.2272 18.2517 18.7306 20.1311C18.8421 20.5473 18.8877 20.9656 18.8739 21.375ZM12.4612 17.5793C11.2373 18.3061 10.4581 19.6082 10.3898 21.0243L7.79324 21.142L6.95134 17.999L11.8877 15.4386L12.4612 17.5793ZM15.1332 23.1064C16.1692 22.8287 16.784 21.7635 16.5064 20.7272C16.2288 19.6909 15.164 19.0759 14.128 19.3536C13.092 19.6313 12.4772 20.6965 12.7547 21.7328C12.9527 22.4718 13.5511 22.9972 14.2553 23.1365C14.2923 23.1351 14.3294 23.1351 14.3667 23.1366C14.4569 23.1402 14.5456 23.1526 14.6318 23.1732C14.797 23.173 14.9652 23.1515 15.1332 23.1064Z", fill: "#B9BDC1" })), /* @__PURE__ */ React20.createElement("defs", null, /* @__PURE__ */ React20.createElement("clipPath", { id: "clip0_1283_39628" }, /* @__PURE__ */ React20.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2386
2612
|
};
|
|
2387
2613
|
|
|
2388
2614
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2389
2615
|
var EmptyStateImageUrls = {
|
|
2390
|
-
create: /* @__PURE__ */
|
|
2391
|
-
error: /* @__PURE__ */
|
|
2392
|
-
noResult: /* @__PURE__ */
|
|
2393
|
-
search: /* @__PURE__ */
|
|
2616
|
+
create: /* @__PURE__ */ React21.createElement(Create, null),
|
|
2617
|
+
error: /* @__PURE__ */ React21.createElement(Error2, null),
|
|
2618
|
+
noResult: /* @__PURE__ */ React21.createElement(Empty, null),
|
|
2619
|
+
search: /* @__PURE__ */ React21.createElement(Search2, null)
|
|
2394
2620
|
};
|
|
2395
2621
|
var DefaultIcon = ({
|
|
2396
2622
|
state = "create",
|
|
@@ -2398,7 +2624,7 @@ var DefaultIcon = ({
|
|
|
2398
2624
|
}) => {
|
|
2399
2625
|
const Icon = EmptyStateImageUrls[state];
|
|
2400
2626
|
const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
|
|
2401
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ React21.createElement("div", null, Icon);
|
|
2402
2628
|
};
|
|
2403
2629
|
var EmptyState = ({
|
|
2404
2630
|
state = "create",
|
|
@@ -2407,12 +2633,12 @@ var EmptyState = ({
|
|
|
2407
2633
|
subtitle,
|
|
2408
2634
|
actions,
|
|
2409
2635
|
containerHeight = "100vh",
|
|
2410
|
-
icon = /* @__PURE__ */
|
|
2636
|
+
icon = /* @__PURE__ */ React21.createElement(DefaultIcon, { state, size })
|
|
2411
2637
|
}) => {
|
|
2412
2638
|
const titleVariant = size === "small" ? "subtitle2" : "h6";
|
|
2413
2639
|
const subtitleVariant = size === "small" ? "caption" : "body1";
|
|
2414
|
-
return /* @__PURE__ */
|
|
2415
|
-
|
|
2640
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2641
|
+
Stack8,
|
|
2416
2642
|
{
|
|
2417
2643
|
alignItems: "center",
|
|
2418
2644
|
justifyContent: "center",
|
|
@@ -2420,17 +2646,17 @@ var EmptyState = ({
|
|
|
2420
2646
|
height: containerHeight,
|
|
2421
2647
|
"data-testid": "empty-state-container"
|
|
2422
2648
|
},
|
|
2423
|
-
icon && /* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
|
|
2649
|
+
icon && /* @__PURE__ */ React21.createElement(Stack8, null, icon),
|
|
2650
|
+
/* @__PURE__ */ React21.createElement(Stack8, { gap: 0.5 }, /* @__PURE__ */ React21.createElement(Typography13, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ React21.createElement(
|
|
2651
|
+
Typography13,
|
|
2426
2652
|
{
|
|
2427
2653
|
variant: subtitleVariant,
|
|
2428
2654
|
textAlign: "center",
|
|
2429
2655
|
color: "text.secondary"
|
|
2430
2656
|
},
|
|
2431
2657
|
subtitle
|
|
2432
|
-
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */
|
|
2433
|
-
|
|
2658
|
+
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ React21.createElement(
|
|
2659
|
+
Stack8,
|
|
2434
2660
|
{
|
|
2435
2661
|
direction: "row",
|
|
2436
2662
|
spacing: 2,
|
|
@@ -2439,15 +2665,15 @@ var EmptyState = ({
|
|
|
2439
2665
|
},
|
|
2440
2666
|
actions.map((action, index) => {
|
|
2441
2667
|
var _a, _b, _c, _d;
|
|
2442
|
-
return /* @__PURE__ */
|
|
2443
|
-
|
|
2668
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2669
|
+
Button9,
|
|
2444
2670
|
{
|
|
2445
2671
|
key: index,
|
|
2446
2672
|
color: (_a = action.color) != null ? _a : "primary",
|
|
2447
2673
|
variant: (_b = action.variant) != null ? _b : "text",
|
|
2448
2674
|
size: (_c = action.size) != null ? _c : "small",
|
|
2449
|
-
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */
|
|
2450
|
-
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */
|
|
2675
|
+
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ React21.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2676
|
+
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ React21.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2451
2677
|
onClick: action.onClick
|
|
2452
2678
|
},
|
|
2453
2679
|
capitalize((_d = action.text) != null ? _d : "action")
|
|
@@ -2458,8 +2684,8 @@ var EmptyState = ({
|
|
|
2458
2684
|
};
|
|
2459
2685
|
|
|
2460
2686
|
// src/Components/SCDialog.tsx
|
|
2461
|
-
import
|
|
2462
|
-
import { Button as
|
|
2687
|
+
import React22, { useEffect as useEffect14, useState as useState10 } from "react";
|
|
2688
|
+
import { Button as Button10, Typography as Typography14, Modal as Modal2, Dialog, DialogActions, DialogContent, DialogTitle, IconButton as IconButton9, Tooltip as Tooltip3, Box as Box12, SvgIcon as SvgIcon5 } from "@mui/material";
|
|
2463
2689
|
import Grid6 from "@mui/material/Grid2";
|
|
2464
2690
|
import CloseIcon2 from "@mui/icons-material/Close";
|
|
2465
2691
|
import * as Muicon5 from "@mui/icons-material";
|
|
@@ -2468,8 +2694,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2468
2694
|
let iconTitleValidation = "";
|
|
2469
2695
|
let IconTitle;
|
|
2470
2696
|
let ButtonIcon;
|
|
2471
|
-
const [open, setOpen] =
|
|
2472
|
-
|
|
2697
|
+
const [open, setOpen] = useState10(show);
|
|
2698
|
+
useEffect14(() => {
|
|
2473
2699
|
if (show) {
|
|
2474
2700
|
handleOpen();
|
|
2475
2701
|
} else {
|
|
@@ -2494,7 +2720,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2494
2720
|
});
|
|
2495
2721
|
if (iconTitle) {
|
|
2496
2722
|
if (Muicon5[iconTitle] == void 0) {
|
|
2497
|
-
if (iconTitle &&
|
|
2723
|
+
if (iconTitle && React22.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
2498
2724
|
iconTitleValidation = "image";
|
|
2499
2725
|
IconTitle = iconTitle;
|
|
2500
2726
|
} else {
|
|
@@ -2519,8 +2745,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2519
2745
|
}
|
|
2520
2746
|
};
|
|
2521
2747
|
const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
2522
|
-
content = content != null ? content : { component: /* @__PURE__ */
|
|
2523
|
-
return /* @__PURE__ */
|
|
2748
|
+
content = content != null ? content : { component: /* @__PURE__ */ React22.createElement(Box12, null, " Aqui va el contenido ") };
|
|
2749
|
+
return /* @__PURE__ */ React22.createElement("div", null, buttonDialog ? /* @__PURE__ */ React22.createElement(React22.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React22.createElement(Tooltip3, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React22.createElement(Button10, { 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__ */ React22.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React22.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React22.createElement(IconButton9, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React22.createElement(SvgIcon5, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React22.createElement(Modal2, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React22.createElement(
|
|
2524
2750
|
Dialog,
|
|
2525
2751
|
{
|
|
2526
2752
|
"data-testid": "dialog-element",
|
|
@@ -2534,8 +2760,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2534
2760
|
}
|
|
2535
2761
|
}
|
|
2536
2762
|
},
|
|
2537
|
-
title && /* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2763
|
+
title && /* @__PURE__ */ React22.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React22.createElement(Grid6, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ React22.createElement(Grid6, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React22.createElement(Box12, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React22.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React22.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React22.createElement(Grid6, null, /* @__PURE__ */ React22.createElement(Typography14, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React22.createElement(Typography14, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React22.createElement(IconButton9, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React22.createElement(CloseIcon2, null)) : "")),
|
|
2764
|
+
/* @__PURE__ */ React22.createElement(
|
|
2539
2765
|
DialogContent,
|
|
2540
2766
|
{
|
|
2541
2767
|
"data-testid": "dialog-content",
|
|
@@ -2563,7 +2789,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2563
2789
|
}
|
|
2564
2790
|
}
|
|
2565
2791
|
},
|
|
2566
|
-
content.url ? /* @__PURE__ */
|
|
2792
|
+
content.url ? /* @__PURE__ */ React22.createElement(
|
|
2567
2793
|
"iframe",
|
|
2568
2794
|
{
|
|
2569
2795
|
style: { border: "none", minWidth: "100%", minHeight: "100%" },
|
|
@@ -2573,20 +2799,20 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2573
2799
|
}
|
|
2574
2800
|
) : content.component
|
|
2575
2801
|
),
|
|
2576
|
-
dialogActions.length > 0 ? /* @__PURE__ */
|
|
2577
|
-
|
|
2802
|
+
dialogActions.length > 0 ? /* @__PURE__ */ React22.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(
|
|
2803
|
+
Button10,
|
|
2578
2804
|
{
|
|
2579
2805
|
variant: "text",
|
|
2580
2806
|
color: dialogActions[0].color || "primary",
|
|
2581
2807
|
size: "small",
|
|
2582
2808
|
onClick: dialogActions[0].fn,
|
|
2583
2809
|
disabled: dialogActions[0].disabled || false,
|
|
2584
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */
|
|
2810
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ React22.createElement(SvgIcon5, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
2585
2811
|
},
|
|
2586
2812
|
dialogActions[0].text
|
|
2587
|
-
), /* @__PURE__ */
|
|
2588
|
-
return /* @__PURE__ */
|
|
2589
|
-
|
|
2813
|
+
), /* @__PURE__ */ React22.createElement(Box12, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
2814
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2815
|
+
Button10,
|
|
2590
2816
|
{
|
|
2591
2817
|
key: index + 1,
|
|
2592
2818
|
variant: index === dialogActions.length - 2 ? "contained" : "text",
|
|
@@ -2594,13 +2820,13 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2594
2820
|
size: "small",
|
|
2595
2821
|
onClick: boton.fn,
|
|
2596
2822
|
disabled: boton.disabled || false,
|
|
2597
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2823
|
+
startIcon: boton.icon ? /* @__PURE__ */ React22.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
|
|
2598
2824
|
},
|
|
2599
2825
|
boton.text
|
|
2600
2826
|
);
|
|
2601
2827
|
}))) : dialogActions.map((boton, index) => {
|
|
2602
|
-
return /* @__PURE__ */
|
|
2603
|
-
|
|
2828
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2829
|
+
Button10,
|
|
2604
2830
|
{
|
|
2605
2831
|
key: index,
|
|
2606
2832
|
variant: index === dialogActions.length - 1 ? "contained" : "text",
|
|
@@ -2608,7 +2834,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2608
2834
|
size: "small",
|
|
2609
2835
|
onClick: boton.fn,
|
|
2610
2836
|
disabled: boton.disabled || false,
|
|
2611
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2837
|
+
startIcon: boton.icon ? /* @__PURE__ */ React22.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
|
|
2612
2838
|
},
|
|
2613
2839
|
boton.text
|
|
2614
2840
|
);
|
|
@@ -2617,12 +2843,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2617
2843
|
};
|
|
2618
2844
|
|
|
2619
2845
|
// src/Components/SCMenu.tsx
|
|
2620
|
-
import
|
|
2621
|
-
import { Box as
|
|
2846
|
+
import React23 from "react";
|
|
2847
|
+
import { Box as Box13, Typography as Typography15, Paper, Divider as Divider4, MenuList, MenuItem as MenuItem4, ListItemIcon as ListItemIcon4, SvgIcon as SvgIcon6 } from "@mui/material";
|
|
2622
2848
|
import Grid7 from "@mui/material/Grid2";
|
|
2623
2849
|
|
|
2624
2850
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
2625
|
-
import { useState as
|
|
2851
|
+
import { useState as useState11, useEffect as useEffect15 } from "react";
|
|
2626
2852
|
function getWindowDimensions() {
|
|
2627
2853
|
const { innerWidth: width, innerHeight: height } = window;
|
|
2628
2854
|
return {
|
|
@@ -2631,8 +2857,8 @@ function getWindowDimensions() {
|
|
|
2631
2857
|
};
|
|
2632
2858
|
}
|
|
2633
2859
|
function useWindowDimensions() {
|
|
2634
|
-
const [windowDimensions, setWindowDimensions] =
|
|
2635
|
-
|
|
2860
|
+
const [windowDimensions, setWindowDimensions] = useState11(getWindowDimensions());
|
|
2861
|
+
useEffect15(() => {
|
|
2636
2862
|
function handleResize() {
|
|
2637
2863
|
setWindowDimensions(getWindowDimensions());
|
|
2638
2864
|
}
|
|
@@ -2650,12 +2876,12 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2650
2876
|
const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
|
|
2651
2877
|
const widthContainer = menuSize + pageSize;
|
|
2652
2878
|
let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2653
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2654
|
-
const [value, setValue] =
|
|
2655
|
-
|
|
2879
|
+
const [selectedIndex, setSelectedIndex] = React23.useState("1");
|
|
2880
|
+
const [value, setValue] = React23.useState("1");
|
|
2881
|
+
React23.useEffect(() => {
|
|
2656
2882
|
heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2657
2883
|
}, [height]);
|
|
2658
|
-
|
|
2884
|
+
React23.useEffect(() => {
|
|
2659
2885
|
if (defaultOption) {
|
|
2660
2886
|
handleClickMenusItem(event, void 0);
|
|
2661
2887
|
}
|
|
@@ -2685,7 +2911,7 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2685
2911
|
setValue(String(index + 1));
|
|
2686
2912
|
}
|
|
2687
2913
|
};
|
|
2688
|
-
return /* @__PURE__ */
|
|
2914
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Grid7, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ React23.createElement(Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ React23.createElement(MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
2689
2915
|
MenuItem4,
|
|
2690
2916
|
{
|
|
2691
2917
|
disabled: disable == true ? true : false,
|
|
@@ -2693,26 +2919,26 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2693
2919
|
selected: String(index + 1) === selectedIndex,
|
|
2694
2920
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
2695
2921
|
},
|
|
2696
|
-
option.iconLeft ? /* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2698
|
-
), option.divider == true ? /* @__PURE__ */
|
|
2922
|
+
option.iconLeft ? /* @__PURE__ */ React23.createElement(ListItemIcon4, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React23.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
2923
|
+
/* @__PURE__ */ React23.createElement(Grid7, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React23.createElement(Typography15, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React23.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React23.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
2924
|
+
), option.divider == true ? /* @__PURE__ */ React23.createElement(Divider4, null) : "")))), /* @__PURE__ */ React23.createElement(Grid7, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React23.createElement(Box13, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React23.createElement(Typography15, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
2699
2925
|
};
|
|
2700
2926
|
|
|
2701
2927
|
// src/Components/SCTabs.tsx
|
|
2702
|
-
import
|
|
2703
|
-
import { Typography as
|
|
2928
|
+
import React24, { useEffect as useEffect16 } from "react";
|
|
2929
|
+
import { Typography as Typography16, Box as Box14, SvgIcon as SvgIcon7, Tab, Tabs, Badge } from "@mui/material";
|
|
2704
2930
|
import TabPanel from "@mui/lab/TabPanel";
|
|
2705
2931
|
import TabContext from "@mui/lab/TabContext";
|
|
2706
2932
|
import * as Muicon7 from "@mui/icons-material";
|
|
2707
2933
|
var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
|
|
2708
|
-
const [toast, setToast] =
|
|
2934
|
+
const [toast, setToast] = React24.useState(null);
|
|
2709
2935
|
let i = 0;
|
|
2710
2936
|
let j = 0;
|
|
2711
2937
|
let k = 0;
|
|
2712
2938
|
let l = 0;
|
|
2713
2939
|
let validateTypeIcon = true;
|
|
2714
|
-
const [value, setValue] =
|
|
2715
|
-
|
|
2940
|
+
const [value, setValue] = React24.useState("1");
|
|
2941
|
+
useEffect16(() => {
|
|
2716
2942
|
if (defaultOption) {
|
|
2717
2943
|
handleChange(event, void 0);
|
|
2718
2944
|
}
|
|
@@ -2762,7 +2988,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2762
2988
|
setValue(newValue);
|
|
2763
2989
|
}
|
|
2764
2990
|
};
|
|
2765
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ React24.createElement(Box14, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ React24.createElement(TabContext, { value }, /* @__PURE__ */ React24.createElement(
|
|
2766
2992
|
Tabs,
|
|
2767
2993
|
{
|
|
2768
2994
|
"data-testid": "tab-container",
|
|
@@ -2776,7 +3002,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2776
3002
|
orientation: orientation || "horizontal",
|
|
2777
3003
|
sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
|
|
2778
3004
|
},
|
|
2779
|
-
options.map((option) => /* @__PURE__ */
|
|
3005
|
+
options.map((option) => /* @__PURE__ */ React24.createElement(
|
|
2780
3006
|
Tab,
|
|
2781
3007
|
{
|
|
2782
3008
|
"data-testid": "tab-item",
|
|
@@ -2785,7 +3011,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2785
3011
|
label: option.name || "",
|
|
2786
3012
|
disabled: option.disabled || false,
|
|
2787
3013
|
iconPosition: iconPosition || "end",
|
|
2788
|
-
icon: typeIcon == "badge" ? /* @__PURE__ */
|
|
3014
|
+
icon: typeIcon == "badge" ? /* @__PURE__ */ React24.createElement(
|
|
2789
3015
|
Badge,
|
|
2790
3016
|
{
|
|
2791
3017
|
sx: {
|
|
@@ -2800,29 +3026,29 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2800
3026
|
badgeContent: option.iconOrBadge,
|
|
2801
3027
|
color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
|
|
2802
3028
|
}
|
|
2803
|
-
) : typeIcon == "icon" ? /* @__PURE__ */
|
|
3029
|
+
) : typeIcon == "icon" ? /* @__PURE__ */ React24.createElement(SvgIcon7, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
|
|
2804
3030
|
sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
|
|
2805
3031
|
}
|
|
2806
3032
|
))
|
|
2807
|
-
), children, options.map((option) => /* @__PURE__ */
|
|
3033
|
+
), children, options.map((option) => /* @__PURE__ */ React24.createElement(
|
|
2808
3034
|
TabPanel,
|
|
2809
3035
|
{
|
|
2810
3036
|
key: k = k + 1,
|
|
2811
3037
|
value: String(l = l + 1),
|
|
2812
3038
|
sx: { padding: "16px" }
|
|
2813
3039
|
},
|
|
2814
|
-
option.page ? option.page : /* @__PURE__ */
|
|
2815
|
-
)))) : /* @__PURE__ */
|
|
3040
|
+
option.page ? option.page : /* @__PURE__ */ React24.createElement(Typography16, null, "No se ha configurado el componente a visualizar ")
|
|
3041
|
+
)))) : /* @__PURE__ */ React24.createElement(Box14, { sx: { height: "200px" } }, toast && /* @__PURE__ */ React24.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
|
|
2816
3042
|
};
|
|
2817
3043
|
|
|
2818
3044
|
// src/Components/Calendario/Calendar.tsx
|
|
2819
|
-
import
|
|
2820
|
-
import { Box as
|
|
3045
|
+
import React31, { useState as useState13 } from "react";
|
|
3046
|
+
import { Box as Box20, CircularProgress as CircularProgress4 } from "@mui/material";
|
|
2821
3047
|
|
|
2822
3048
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
2823
|
-
import
|
|
3049
|
+
import React25, { useState as useState12 } from "react";
|
|
2824
3050
|
import { ChevronLeft, ChevronRight, KeyboardArrowDown as KeyboardArrowDown2, LightModeOutlined } from "@mui/icons-material";
|
|
2825
|
-
import { Box as
|
|
3051
|
+
import { Box as Box15, Chip as Chip3, IconButton as IconButton10, Menu, MenuItem as MenuItem5, Stack as Stack9, Typography as Typography17 } from "@mui/material";
|
|
2826
3052
|
import dayjs2 from "dayjs";
|
|
2827
3053
|
import updateLocale from "dayjs/plugin/updateLocale";
|
|
2828
3054
|
import "dayjs/locale/es";
|
|
@@ -2839,7 +3065,7 @@ var CalendarToolbar = ({
|
|
|
2839
3065
|
onNavigate,
|
|
2840
3066
|
children
|
|
2841
3067
|
}) => {
|
|
2842
|
-
const [anchorEl, setAnchorEl] =
|
|
3068
|
+
const [anchorEl, setAnchorEl] = useState12(null);
|
|
2843
3069
|
const open = Boolean(anchorEl);
|
|
2844
3070
|
const handleMenuOpen = (event2) => {
|
|
2845
3071
|
setAnchorEl(event2.currentTarget);
|
|
@@ -2862,15 +3088,15 @@ var CalendarToolbar = ({
|
|
|
2862
3088
|
}
|
|
2863
3089
|
return labelDate.format(" DD MMMM YYYY");
|
|
2864
3090
|
};
|
|
2865
|
-
return /* @__PURE__ */
|
|
3091
|
+
return /* @__PURE__ */ React25.createElement(Stack9, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 0.5, px: 1, py: 0.5 }, /* @__PURE__ */ React25.createElement(Box15, null, /* @__PURE__ */ React25.createElement(
|
|
2866
3092
|
Chip3,
|
|
2867
3093
|
{
|
|
2868
3094
|
label: "Hoy",
|
|
2869
|
-
icon: /* @__PURE__ */
|
|
3095
|
+
icon: /* @__PURE__ */ React25.createElement(LightModeOutlined, { fontSize: "small" }),
|
|
2870
3096
|
color: "primary",
|
|
2871
3097
|
onClick: () => onNavigate("TODAY")
|
|
2872
3098
|
}
|
|
2873
|
-
)), /* @__PURE__ */
|
|
3099
|
+
)), /* @__PURE__ */ React25.createElement(Stack9, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React25.createElement(IconButton10, { "aria-label": "Anterior", onClick: () => onNavigate("PREV"), size: "small", color: "primary" }, /* @__PURE__ */ React25.createElement(ChevronLeft, { fontSize: "small" })), /* @__PURE__ */ React25.createElement(IconButton10, { "aria-label": "Siguiente", onClick: () => onNavigate("NEXT"), size: "small", color: "primary" }, /* @__PURE__ */ React25.createElement(ChevronRight, { fontSize: "small" })), /* @__PURE__ */ React25.createElement(Typography17, { variant: "h6", color: "primary", "data-testid": "currentDate" }, getFormattedDate()), /* @__PURE__ */ React25.createElement(IconButton10, { onClick: handleMenuOpen, size: "small", color: "primary", "aria-label": "Cambiar vista" }, /* @__PURE__ */ React25.createElement(KeyboardArrowDown2, { fontSize: "small" })), /* @__PURE__ */ React25.createElement(
|
|
2874
3100
|
Menu,
|
|
2875
3101
|
{
|
|
2876
3102
|
anchorEl,
|
|
@@ -2879,15 +3105,15 @@ var CalendarToolbar = ({
|
|
|
2879
3105
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2880
3106
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
2881
3107
|
},
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
)), children ? /* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ React25.createElement(MenuItem5, { onClick: () => handleViewChange("month") }, "Mes"),
|
|
3109
|
+
/* @__PURE__ */ React25.createElement(MenuItem5, { onClick: () => handleViewChange("week") }, "Semana"),
|
|
3110
|
+
/* @__PURE__ */ React25.createElement(MenuItem5, { onClick: () => handleViewChange("day") }, "D\xEDa")
|
|
3111
|
+
)), children ? /* @__PURE__ */ React25.createElement(Box15, null, children) : /* @__PURE__ */ React25.createElement(Box15, { width: "24px" }), " ");
|
|
2886
3112
|
};
|
|
2887
3113
|
|
|
2888
3114
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
2889
|
-
import
|
|
2890
|
-
import { Box as
|
|
3115
|
+
import React28 from "react";
|
|
3116
|
+
import { Box as Box17, Typography as Typography19, IconButton as IconButton11, Paper as Paper2, Tooltip as Tooltip5, Stack as Stack11, Divider as Divider6, CircularProgress } from "@mui/material";
|
|
2891
3117
|
import AddIcon from "@mui/icons-material/Add";
|
|
2892
3118
|
import dayjs4 from "dayjs";
|
|
2893
3119
|
import localeData from "dayjs/plugin/localeData";
|
|
@@ -2919,10 +3145,10 @@ var stateColors = {
|
|
|
2919
3145
|
};
|
|
2920
3146
|
|
|
2921
3147
|
// src/Components/Calendario/Event.tsx
|
|
2922
|
-
import
|
|
2923
|
-
import { Box as
|
|
3148
|
+
import React26 from "react";
|
|
3149
|
+
import { Box as Box16, Stack as Stack10, Typography as Typography18, Divider as Divider5, Popover as Popover4 } from "@mui/material";
|
|
2924
3150
|
var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
2925
|
-
const [anchorEl, setAnchorEl] =
|
|
3151
|
+
const [anchorEl, setAnchorEl] = React26.useState(null);
|
|
2926
3152
|
const handlePopoverOpen = (event3) => {
|
|
2927
3153
|
setAnchorEl(event3.currentTarget);
|
|
2928
3154
|
};
|
|
@@ -2930,8 +3156,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
2930
3156
|
setAnchorEl(null);
|
|
2931
3157
|
};
|
|
2932
3158
|
const open = Boolean(anchorEl);
|
|
2933
|
-
return /* @__PURE__ */
|
|
2934
|
-
|
|
3159
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3160
|
+
Stack10,
|
|
2935
3161
|
{
|
|
2936
3162
|
direction: "row",
|
|
2937
3163
|
padding: 0.5,
|
|
@@ -2951,7 +3177,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
2951
3177
|
cursor: onClick ? "pointer" : "default"
|
|
2952
3178
|
}, sx)
|
|
2953
3179
|
},
|
|
2954
|
-
/* @__PURE__ */
|
|
3180
|
+
/* @__PURE__ */ React26.createElement(
|
|
2955
3181
|
Divider5,
|
|
2956
3182
|
{
|
|
2957
3183
|
orientation: "vertical",
|
|
@@ -2963,8 +3189,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
2963
3189
|
}
|
|
2964
3190
|
}
|
|
2965
3191
|
),
|
|
2966
|
-
/* @__PURE__ */
|
|
2967
|
-
|
|
3192
|
+
/* @__PURE__ */ React26.createElement(
|
|
3193
|
+
Box16,
|
|
2968
3194
|
{
|
|
2969
3195
|
px: 1,
|
|
2970
3196
|
py: 0.5,
|
|
@@ -2973,8 +3199,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
2973
3199
|
display: "flex",
|
|
2974
3200
|
alignItems: "center"
|
|
2975
3201
|
},
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
|
|
3202
|
+
/* @__PURE__ */ React26.createElement(
|
|
3203
|
+
Typography18,
|
|
2978
3204
|
{
|
|
2979
3205
|
color: "text.primary",
|
|
2980
3206
|
variant: "caption",
|
|
@@ -2989,7 +3215,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
2989
3215
|
},
|
|
2990
3216
|
event2.title.charAt(0).toUpperCase() + event2.title.slice(1).toLowerCase()
|
|
2991
3217
|
),
|
|
2992
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ React26.createElement(
|
|
2993
3219
|
Popover4,
|
|
2994
3220
|
{
|
|
2995
3221
|
id: "mouse-over-popover",
|
|
@@ -3014,9 +3240,9 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3014
3240
|
};
|
|
3015
3241
|
|
|
3016
3242
|
// src/assets/LogoCalendario.tsx
|
|
3017
|
-
import
|
|
3243
|
+
import React27 from "react";
|
|
3018
3244
|
var LogoCalendario = () => {
|
|
3019
|
-
return /* @__PURE__ */
|
|
3245
|
+
return /* @__PURE__ */ React27.createElement("svg", { width: "60", height: "61", viewBox: "0 0 60 61", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React27.createElement("g", { "clip-path": "url(#clip0_5353_24891)" }, /* @__PURE__ */ React27.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40.7361 11.1589C39.7792 11.1589 39.0106 11.9722 39.0106 12.9661V15.4375H20.0309V12.9661C20.0309 11.964 19.2545 11.1589 18.3055 11.1589C17.3487 11.1589 16.5801 11.9722 16.5801 12.9661V15.4375H12.8819C12.0652 15.4375 11.4038 16.0918 11.4038 16.8998V20.6551C11.4038 21.463 12.0652 22.1174 12.8819 22.1174H46.8383C47.655 22.1174 48.3165 21.463 48.3165 20.6551V16.8998C48.3165 16.0918 47.655 15.4375 46.8383 15.4375H42.4615V12.9661C42.4615 11.964 41.6851 11.1589 40.7361 11.1589ZM19.4827 19.2049C19.6528 19.1343 19.7361 19.006 19.7724 18.8352C19.6916 18.9714 19.594 19.0957 19.4827 19.2049Z", fill: "#00BCD4" }), /* @__PURE__ */ React27.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.2037 25.8653C13.7579 25.8653 13.425 26.2168 13.425 26.6093V47.3669C13.425 47.7595 13.7579 48.1109 14.2037 48.1109H46.0004C46.4782 48.1109 46.8656 47.7236 46.8656 47.2458V26.6093C46.8656 26.2168 46.5327 25.8653 46.087 25.8653H14.2037ZM11.6948 26.6093C11.6948 25.2255 12.8384 24.135 14.2037 24.135H46.087C47.4522 24.135 48.5959 25.2255 48.5959 26.6093V47.2458C48.5959 48.6792 47.4339 49.8412 46.0004 49.8412H14.2037C12.8384 49.8412 11.6948 48.7508 11.6948 47.3669V26.6093Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M19.481 30.9138C19.481 30.5164 20.1155 30.1903 20.9058 30.1903C21.6894 30.1903 22.3305 30.5131 22.3305 30.9138V32.8862C22.3305 33.2836 21.6894 33.6097 20.9058 33.6097C20.1222 33.6097 19.481 33.2869 19.481 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M30.0242 30.1903C29.2339 30.1903 28.5995 30.5164 28.5995 30.9138V32.8862C28.5995 33.2869 29.2406 33.6097 30.0242 33.6097C30.8079 33.6097 31.449 33.2836 31.449 32.8862V30.9138C31.449 30.5131 30.8079 30.1903 30.0242 30.1903Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M37.7179 30.9138C37.7179 30.5164 38.3524 30.1903 39.1427 30.1903C39.608 30.1903 40.022 30.3038 40.2825 30.4797C40.3515 30.5276 40.4116 30.5788 40.4561 30.6344C40.5274 30.7201 40.5675 30.8147 40.5675 30.9138V32.8862C40.5675 33.2836 39.9263 33.6097 39.1427 33.6097C38.3591 33.6097 37.7179 33.2869 37.7179 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M20.9058 39.8787C20.1155 39.8787 19.481 40.2048 19.481 40.6022V42.5746C19.481 42.687 19.5322 42.7927 19.6213 42.8874C19.7036 42.9731 19.8172 43.0499 19.9552 43.1122C20.2068 43.228 20.5407 43.2981 20.9058 43.2981C21.6894 43.2981 22.3305 42.972 22.3305 42.5746V40.6022C22.3305 40.2015 21.6894 39.8787 20.9058 39.8787Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M29.524 39.9477C29.7087 39.9032 29.9158 39.8787 30.1339 39.8787C30.9176 39.8787 31.5587 40.2015 31.5587 40.6022V42.5746C31.5587 42.972 30.9176 43.2981 30.1339 43.2981C29.3503 43.2981 28.7092 42.9753 28.7092 42.5746V40.6022C28.7092 40.315 29.0409 40.0646 29.524 39.9477Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M38.5141 39.9482C38.6989 39.9037 38.9059 39.8792 39.1241 39.8792C39.9077 39.8792 40.5488 40.202 40.5488 40.6027V42.5751C40.5488 42.9725 39.9077 43.2986 39.1241 43.2986C38.3405 43.2986 37.6993 42.9758 37.6993 42.5751V40.6027C37.6993 40.3155 38.031 40.0651 38.5141 39.9482Z", fill: "#6392BD" })), /* @__PURE__ */ React27.createElement("defs", null, /* @__PURE__ */ React27.createElement("clipPath", { id: "clip0_5353_24891" }, /* @__PURE__ */ React27.createElement("rect", { width: "60", height: "60", fill: "white", transform: "translate(0 0.5)" }))));
|
|
3020
3246
|
};
|
|
3021
3247
|
|
|
3022
3248
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
@@ -3026,22 +3252,22 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3026
3252
|
const noEvents = events.length === 0;
|
|
3027
3253
|
const days = getMonthDays(currentDate);
|
|
3028
3254
|
const weekDays = Array.from({ length: 7 }, (_, i) => dayjs4().day(i));
|
|
3029
|
-
const [openDrawer, setOpenDrawer] =
|
|
3030
|
-
const [selectedDay, setSelectedDay] =
|
|
3031
|
-
const [selectedEvents, setSelectedEvents] =
|
|
3032
|
-
return /* @__PURE__ */
|
|
3255
|
+
const [openDrawer, setOpenDrawer] = React28.useState(false);
|
|
3256
|
+
const [selectedDay, setSelectedDay] = React28.useState(null);
|
|
3257
|
+
const [selectedEvents, setSelectedEvents] = React28.useState([]);
|
|
3258
|
+
return /* @__PURE__ */ React28.createElement(Box17, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ React28.createElement(Box17, { minWidth: "1050px" }, /* @__PURE__ */ React28.createElement(Box17, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ React28.createElement(Box17, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ React28.createElement(Typography19, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ React28.createElement(Box17, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ React28.createElement(CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ React28.createElement(
|
|
3033
3259
|
EmptyState,
|
|
3034
3260
|
{
|
|
3035
3261
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
3036
3262
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3037
|
-
icon: /* @__PURE__ */
|
|
3263
|
+
icon: /* @__PURE__ */ React28.createElement(LogoCalendario, null)
|
|
3038
3264
|
}
|
|
3039
|
-
) : /* @__PURE__ */
|
|
3265
|
+
) : /* @__PURE__ */ React28.createElement(Box17, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5 }, days.map((day) => {
|
|
3040
3266
|
const dayEvents = events.filter(
|
|
3041
3267
|
(e) => day.isBetween(e.start.startOf("day"), e.end.endOf("day"), null, "[]")
|
|
3042
3268
|
);
|
|
3043
3269
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
3044
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ React28.createElement(
|
|
3045
3271
|
Paper2,
|
|
3046
3272
|
{
|
|
3047
3273
|
key: day.toString(),
|
|
@@ -3058,8 +3284,8 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3058
3284
|
overflow: "hidden"
|
|
3059
3285
|
}
|
|
3060
3286
|
},
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
|
|
3287
|
+
/* @__PURE__ */ React28.createElement(Box17, { p: 1, flexShrink: 0 }, /* @__PURE__ */ React28.createElement(Box17, { display: "flex", alignItems: "center", justifyContent: "flex-start" }, /* @__PURE__ */ React28.createElement(
|
|
3288
|
+
Box17,
|
|
3063
3289
|
{
|
|
3064
3290
|
sx: {
|
|
3065
3291
|
width: 24,
|
|
@@ -3071,16 +3297,16 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3071
3297
|
justifyContent: "center"
|
|
3072
3298
|
}
|
|
3073
3299
|
},
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
|
|
3300
|
+
/* @__PURE__ */ React28.createElement(
|
|
3301
|
+
Typography19,
|
|
3076
3302
|
{
|
|
3077
3303
|
variant: "body2",
|
|
3078
3304
|
sx: { color: isToday(day) ? "white" : "text.secondary" }
|
|
3079
3305
|
},
|
|
3080
3306
|
day.date()
|
|
3081
3307
|
)
|
|
3082
|
-
), dayEvents.length > 2 && /* @__PURE__ */
|
|
3083
|
-
|
|
3308
|
+
), dayEvents.length > 2 && /* @__PURE__ */ React28.createElement(Tooltip5, { title: "M\xE1s eventos" }, /* @__PURE__ */ React28.createElement(
|
|
3309
|
+
IconButton11,
|
|
3084
3310
|
{
|
|
3085
3311
|
color: "primary",
|
|
3086
3312
|
size: "small",
|
|
@@ -3091,9 +3317,9 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3091
3317
|
setSelectedEvents(dayEvents);
|
|
3092
3318
|
}
|
|
3093
3319
|
},
|
|
3094
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ React28.createElement(AddIcon, { fontSize: "small" })
|
|
3095
3321
|
)))),
|
|
3096
|
-
/* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ React28.createElement(Box17, { display: "flex", flexDirection: "column", gap: 0.5, p: 1, pt: 0, overflow: "hidden" }, dayEvents.slice(0, 2).map((event2) => /* @__PURE__ */ React28.createElement(
|
|
3097
3323
|
CalendarEventCard,
|
|
3098
3324
|
{
|
|
3099
3325
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -3103,8 +3329,8 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3103
3329
|
onHover: onEventHover
|
|
3104
3330
|
}
|
|
3105
3331
|
))),
|
|
3106
|
-
dayEvents.length > 2 && /* @__PURE__ */
|
|
3107
|
-
|
|
3332
|
+
dayEvents.length > 2 && /* @__PURE__ */ React28.createElement(
|
|
3333
|
+
Stack11,
|
|
3108
3334
|
{
|
|
3109
3335
|
justifyItems: "center",
|
|
3110
3336
|
px: 1,
|
|
@@ -3112,7 +3338,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3112
3338
|
onClick: (e) => e.stopPropagation(),
|
|
3113
3339
|
sx: { "& .MuiButtonBase-root": { width: "100%" } }
|
|
3114
3340
|
},
|
|
3115
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ React28.createElement(
|
|
3116
3342
|
SCDrawer,
|
|
3117
3343
|
{
|
|
3118
3344
|
width: "350px",
|
|
@@ -3124,7 +3350,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3124
3350
|
arrayElements: [{
|
|
3125
3351
|
component: (() => {
|
|
3126
3352
|
const [first, ...rest] = dayEvents;
|
|
3127
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ React28.createElement(Box17, { display: "flex", width: "100%", flexDirection: "column", height: "100%", pr: 1.5 }, /* @__PURE__ */ React28.createElement(Typography19, { width: "100%", color: "text.secondary" }, " Proximo evento "), first && /* @__PURE__ */ React28.createElement(Box17, { p: 1, pb: 1, width: "100%" }, /* @__PURE__ */ React28.createElement(
|
|
3128
3354
|
CalendarEventCard,
|
|
3129
3355
|
{
|
|
3130
3356
|
event: first,
|
|
@@ -3139,8 +3365,8 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3139
3365
|
}
|
|
3140
3366
|
}
|
|
3141
3367
|
}
|
|
3142
|
-
)), /* @__PURE__ */
|
|
3143
|
-
|
|
3368
|
+
)), /* @__PURE__ */ React28.createElement(Divider6, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ React28.createElement(Typography19, { width: "100%", py: 1, color: "text.secondary" }, " Eventos restantes "), /* @__PURE__ */ React28.createElement(
|
|
3369
|
+
Box17,
|
|
3144
3370
|
{
|
|
3145
3371
|
width: "100%",
|
|
3146
3372
|
height: "100%",
|
|
@@ -3152,7 +3378,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3152
3378
|
flexDirection: "column",
|
|
3153
3379
|
gap: 1.5
|
|
3154
3380
|
},
|
|
3155
|
-
rest.map((event2) => /* @__PURE__ */
|
|
3381
|
+
rest.map((event2) => /* @__PURE__ */ React28.createElement(
|
|
3156
3382
|
CalendarEventCard,
|
|
3157
3383
|
{
|
|
3158
3384
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -3181,8 +3407,8 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3181
3407
|
};
|
|
3182
3408
|
|
|
3183
3409
|
// src/Components/Calendario/Views/WeekView.tsx
|
|
3184
|
-
import
|
|
3185
|
-
import { Box as
|
|
3410
|
+
import React29 from "react";
|
|
3411
|
+
import { Box as Box18, CircularProgress as CircularProgress2, Typography as Typography20 } from "@mui/material";
|
|
3186
3412
|
import dayjs5 from "dayjs";
|
|
3187
3413
|
import localeData2 from "dayjs/plugin/localeData";
|
|
3188
3414
|
dayjs5.extend(localeData2);
|
|
@@ -3216,10 +3442,10 @@ var WeekView = ({
|
|
|
3216
3442
|
}
|
|
3217
3443
|
return "none";
|
|
3218
3444
|
};
|
|
3219
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ React29.createElement(Box18, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ React29.createElement(Box18, { display: "flex", bgcolor: "transparent" }, /* @__PURE__ */ React29.createElement(Box18, { width: 45, bgcolor: "transparent" }), days.map((day) => {
|
|
3220
3446
|
const isToday2 = day.format("YYYY-MM-DD") === todayString;
|
|
3221
|
-
return /* @__PURE__ */
|
|
3222
|
-
|
|
3447
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3448
|
+
Box18,
|
|
3223
3449
|
{
|
|
3224
3450
|
key: day.toString(),
|
|
3225
3451
|
height: 40,
|
|
@@ -3235,20 +3461,20 @@ var WeekView = ({
|
|
|
3235
3461
|
borderBottom: isToday2 ? 2 : 0,
|
|
3236
3462
|
borderColor: isToday2 ? "primary.main" : "transparent"
|
|
3237
3463
|
},
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ React29.createElement(Typography20, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3465
|
+
/* @__PURE__ */ React29.createElement(Typography20, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3240
3466
|
);
|
|
3241
|
-
})), isLoading ? /* @__PURE__ */
|
|
3467
|
+
})), isLoading ? /* @__PURE__ */ React29.createElement(Box18, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ React29.createElement(CircularProgress2, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ React29.createElement(
|
|
3242
3468
|
EmptyState,
|
|
3243
3469
|
{
|
|
3244
3470
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
3245
3471
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3246
|
-
icon: /* @__PURE__ */
|
|
3472
|
+
icon: /* @__PURE__ */ React29.createElement(LogoCalendario, null)
|
|
3247
3473
|
}
|
|
3248
3474
|
) : (
|
|
3249
3475
|
// Grid de horas y eventos
|
|
3250
|
-
/* @__PURE__ */
|
|
3251
|
-
|
|
3476
|
+
/* @__PURE__ */ React29.createElement(Box18, { display: "flex", flex: 1 }, /* @__PURE__ */ React29.createElement(Box18, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ React29.createElement(
|
|
3477
|
+
Box18,
|
|
3252
3478
|
{
|
|
3253
3479
|
key: h,
|
|
3254
3480
|
height: 60,
|
|
@@ -3256,7 +3482,7 @@ var WeekView = ({
|
|
|
3256
3482
|
pr: 1,
|
|
3257
3483
|
borderColor: "divider"
|
|
3258
3484
|
},
|
|
3259
|
-
/* @__PURE__ */
|
|
3485
|
+
/* @__PURE__ */ React29.createElement(Typography20, { variant: "caption", color: "text.secondary" }, dayjs5().hour(h).format("h A"))
|
|
3260
3486
|
))), days.map((day) => {
|
|
3261
3487
|
const dayEvents = events.filter(
|
|
3262
3488
|
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
@@ -3265,8 +3491,8 @@ var WeekView = ({
|
|
|
3265
3491
|
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
3266
3492
|
return startsInRange || endsInRange;
|
|
3267
3493
|
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
3268
|
-
return /* @__PURE__ */
|
|
3269
|
-
|
|
3494
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3495
|
+
Box18,
|
|
3270
3496
|
{
|
|
3271
3497
|
key: day.toString(),
|
|
3272
3498
|
flex: 1,
|
|
@@ -3278,8 +3504,8 @@ var WeekView = ({
|
|
|
3278
3504
|
},
|
|
3279
3505
|
hours.map((hourIdx) => {
|
|
3280
3506
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3281
|
-
return /* @__PURE__ */
|
|
3282
|
-
|
|
3507
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3508
|
+
Box18,
|
|
3283
3509
|
{
|
|
3284
3510
|
key: hourIdx,
|
|
3285
3511
|
height: 60,
|
|
@@ -3294,7 +3520,7 @@ var WeekView = ({
|
|
|
3294
3520
|
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
3295
3521
|
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
3296
3522
|
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
3297
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3298
3524
|
CalendarEventCard,
|
|
3299
3525
|
{
|
|
3300
3526
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -3319,8 +3545,8 @@ var WeekView = ({
|
|
|
3319
3545
|
};
|
|
3320
3546
|
|
|
3321
3547
|
// src/Components/Calendario/Views/DayView.tsx
|
|
3322
|
-
import
|
|
3323
|
-
import { Box as
|
|
3548
|
+
import React30 from "react";
|
|
3549
|
+
import { Box as Box19, CircularProgress as CircularProgress3, Typography as Typography21 } from "@mui/material";
|
|
3324
3550
|
import dayjs6 from "dayjs";
|
|
3325
3551
|
var DayView = ({
|
|
3326
3552
|
events,
|
|
@@ -3351,15 +3577,15 @@ var DayView = ({
|
|
|
3351
3577
|
(event2) => currentDate.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3352
3578
|
);
|
|
3353
3579
|
const noEvents = events.length === 0;
|
|
3354
|
-
return /* @__PURE__ */
|
|
3580
|
+
return /* @__PURE__ */ React30.createElement(Box19, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ React30.createElement(Box19, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ React30.createElement(Box19, { width: 47, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ React30.createElement(Box19, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ React30.createElement(Typography21, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ React30.createElement(Typography21, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ React30.createElement(Box19, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ React30.createElement(CircularProgress3, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : noEvents ? /* @__PURE__ */ React30.createElement(
|
|
3355
3581
|
EmptyState,
|
|
3356
3582
|
{
|
|
3357
3583
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
3358
3584
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3359
|
-
icon: /* @__PURE__ */
|
|
3585
|
+
icon: /* @__PURE__ */ React30.createElement(LogoCalendario, null)
|
|
3360
3586
|
}
|
|
3361
|
-
) : /* @__PURE__ */
|
|
3362
|
-
|
|
3587
|
+
) : /* @__PURE__ */ React30.createElement(Box19, { display: "flex", flex: 1 }, /* @__PURE__ */ React30.createElement(Box19, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ React30.createElement(
|
|
3588
|
+
Box19,
|
|
3363
3589
|
{
|
|
3364
3590
|
key: h,
|
|
3365
3591
|
height: 60,
|
|
@@ -3369,11 +3595,11 @@ var DayView = ({
|
|
|
3369
3595
|
borderRight: "1px solid",
|
|
3370
3596
|
borderColor: "divider"
|
|
3371
3597
|
},
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
))), /* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ React30.createElement(Typography21, { variant: "caption", color: "text.secondary" }, dayjs6().hour(h).format("h A"))
|
|
3599
|
+
))), /* @__PURE__ */ React30.createElement(Box19, { flex: 1, position: "relative" }, hours.map((hourIdx) => {
|
|
3374
3600
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3375
|
-
return /* @__PURE__ */
|
|
3376
|
-
|
|
3601
|
+
return /* @__PURE__ */ React30.createElement(
|
|
3602
|
+
Box19,
|
|
3377
3603
|
{
|
|
3378
3604
|
key: hourIdx,
|
|
3379
3605
|
height: 60,
|
|
@@ -3391,7 +3617,7 @@ var DayView = ({
|
|
|
3391
3617
|
const clampedEnd = eventEnd.isAfter(maxEnd) ? maxEnd : eventEnd;
|
|
3392
3618
|
const startMinutes = (clampedStart.hour() - startHour) * 60 + clampedStart.minute();
|
|
3393
3619
|
const durationMinutes = clampedEnd.diff(clampedStart, "minute");
|
|
3394
|
-
return /* @__PURE__ */
|
|
3620
|
+
return /* @__PURE__ */ React30.createElement(
|
|
3395
3621
|
CalendarEventCard,
|
|
3396
3622
|
{
|
|
3397
3623
|
key: `${event2.id}-${currentDate.toString()}`,
|
|
@@ -3427,8 +3653,8 @@ var Calendar = ({
|
|
|
3427
3653
|
// <- valor por defecto
|
|
3428
3654
|
endHour = 23
|
|
3429
3655
|
}) => {
|
|
3430
|
-
const [view, setView] =
|
|
3431
|
-
const [currentDate, setCurrentDate] =
|
|
3656
|
+
const [view, setView] = useState13(initialView);
|
|
3657
|
+
const [currentDate, setCurrentDate] = useState13(dayjs7());
|
|
3432
3658
|
const handleViewChange = (newView) => {
|
|
3433
3659
|
setView(newView);
|
|
3434
3660
|
onViewChange == null ? void 0 : onViewChange(newView);
|
|
@@ -3447,7 +3673,7 @@ var Calendar = ({
|
|
|
3447
3673
|
} else if (action === "TODAY") newDate = dayjs7();
|
|
3448
3674
|
setCurrentDate(newDate);
|
|
3449
3675
|
};
|
|
3450
|
-
return /* @__PURE__ */
|
|
3676
|
+
return /* @__PURE__ */ React31.createElement(Box20, null, /* @__PURE__ */ React31.createElement(
|
|
3451
3677
|
CalendarToolbar,
|
|
3452
3678
|
{
|
|
3453
3679
|
labelDate: currentDate,
|
|
@@ -3456,16 +3682,16 @@ var Calendar = ({
|
|
|
3456
3682
|
onNavigate: handleNavigate
|
|
3457
3683
|
},
|
|
3458
3684
|
toolbar
|
|
3459
|
-
), isLoading ? /* @__PURE__ */
|
|
3460
|
-
|
|
3685
|
+
), isLoading ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(Box20, null, /* @__PURE__ */ React31.createElement(
|
|
3686
|
+
Box20,
|
|
3461
3687
|
{
|
|
3462
3688
|
display: "flex",
|
|
3463
3689
|
justifyContent: "center",
|
|
3464
3690
|
alignItems: "center",
|
|
3465
3691
|
height: "400px"
|
|
3466
3692
|
},
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
))) : /* @__PURE__ */
|
|
3693
|
+
/* @__PURE__ */ React31.createElement(CircularProgress4, { variant: "indeterminate" })
|
|
3694
|
+
))) : /* @__PURE__ */ React31.createElement(React31.Fragment, null, view === "month" && /* @__PURE__ */ React31.createElement(
|
|
3469
3695
|
MonthView,
|
|
3470
3696
|
{
|
|
3471
3697
|
events,
|
|
@@ -3475,7 +3701,7 @@ var Calendar = ({
|
|
|
3475
3701
|
onEventClick,
|
|
3476
3702
|
onEventHover
|
|
3477
3703
|
}
|
|
3478
|
-
), view === "week" && /* @__PURE__ */
|
|
3704
|
+
), view === "week" && /* @__PURE__ */ React31.createElement(
|
|
3479
3705
|
WeekView,
|
|
3480
3706
|
{
|
|
3481
3707
|
events,
|
|
@@ -3487,7 +3713,7 @@ var Calendar = ({
|
|
|
3487
3713
|
startHour,
|
|
3488
3714
|
endHour
|
|
3489
3715
|
}
|
|
3490
|
-
), view === "day" && /* @__PURE__ */
|
|
3716
|
+
), view === "day" && /* @__PURE__ */ React31.createElement(
|
|
3491
3717
|
DayView,
|
|
3492
3718
|
{
|
|
3493
3719
|
events,
|
|
@@ -3501,8 +3727,8 @@ var Calendar = ({
|
|
|
3501
3727
|
};
|
|
3502
3728
|
|
|
3503
3729
|
// src/Components/SCTime.tsx
|
|
3504
|
-
import
|
|
3505
|
-
import { Box as
|
|
3730
|
+
import React32, { useState as useState14 } from "react";
|
|
3731
|
+
import { Box as Box21, InputAdornment as InputAdornment6, Popover as Popover5, ClickAwayListener } from "@mui/material";
|
|
3506
3732
|
import { LocalizationProvider as LocalizationProvider3 } from "@mui/x-date-pickers/LocalizationProvider";
|
|
3507
3733
|
import { AdapterDayjs as AdapterDayjs2 } from "@mui/x-date-pickers/AdapterDayjs";
|
|
3508
3734
|
import dayjs8 from "dayjs";
|
|
@@ -3525,9 +3751,9 @@ var SCTime = ({
|
|
|
3525
3751
|
);
|
|
3526
3752
|
const isTimeEmpty = required && !state;
|
|
3527
3753
|
const hasError = isTimeEmpty;
|
|
3528
|
-
const [anchorEl, setAnchorEl] =
|
|
3529
|
-
const [isOpenPopover, setIsOpenPopover] =
|
|
3530
|
-
const [popoverPlacement, setPopoverPlacement] =
|
|
3754
|
+
const [anchorEl, setAnchorEl] = useState14(null);
|
|
3755
|
+
const [isOpenPopover, setIsOpenPopover] = useState14(false);
|
|
3756
|
+
const [popoverPlacement, setPopoverPlacement] = useState14("bottom");
|
|
3531
3757
|
const detectPlacement = (element) => {
|
|
3532
3758
|
const rect = element.getBoundingClientRect();
|
|
3533
3759
|
const windowHeight = window.innerHeight;
|
|
@@ -3558,7 +3784,7 @@ var SCTime = ({
|
|
|
3558
3784
|
setIsOpenPopover(false);
|
|
3559
3785
|
setAnchorEl(null);
|
|
3560
3786
|
};
|
|
3561
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ React32.createElement(LocalizationProvider3, { dateAdapter: AdapterDayjs2 }, /* @__PURE__ */ React32.createElement(Box21, { sx: { position: "relative", width: "120px" } }, /* @__PURE__ */ React32.createElement(
|
|
3562
3788
|
TimeField,
|
|
3563
3789
|
{
|
|
3564
3790
|
label,
|
|
@@ -3570,7 +3796,7 @@ var SCTime = ({
|
|
|
3570
3796
|
slotProps: {
|
|
3571
3797
|
textField: {
|
|
3572
3798
|
InputProps: {
|
|
3573
|
-
endAdornment: /* @__PURE__ */
|
|
3799
|
+
endAdornment: /* @__PURE__ */ React32.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React32.createElement(
|
|
3574
3800
|
AccessTimeIcon,
|
|
3575
3801
|
{
|
|
3576
3802
|
color: disabled ? "disabled" : "action",
|
|
@@ -3599,7 +3825,7 @@ var SCTime = ({
|
|
|
3599
3825
|
}
|
|
3600
3826
|
}
|
|
3601
3827
|
}
|
|
3602
|
-
), /* @__PURE__ */
|
|
3828
|
+
), /* @__PURE__ */ React32.createElement(
|
|
3603
3829
|
Popover5,
|
|
3604
3830
|
{
|
|
3605
3831
|
open: isOpenPopover,
|
|
@@ -3627,7 +3853,7 @@ var SCTime = ({
|
|
|
3627
3853
|
}
|
|
3628
3854
|
}
|
|
3629
3855
|
},
|
|
3630
|
-
/* @__PURE__ */
|
|
3856
|
+
/* @__PURE__ */ React32.createElement(ClickAwayListener, { onClickAway: handleClose }, /* @__PURE__ */ React32.createElement(Box21, { sx: { p: 0 } }, /* @__PURE__ */ React32.createElement(
|
|
3631
3857
|
DigitalClock,
|
|
3632
3858
|
{
|
|
3633
3859
|
value: state,
|
|
@@ -3649,9 +3875,9 @@ var SCTime = ({
|
|
|
3649
3875
|
};
|
|
3650
3876
|
|
|
3651
3877
|
// src/Components/SCCard.tsx
|
|
3652
|
-
import
|
|
3653
|
-
import { Button as
|
|
3654
|
-
import
|
|
3878
|
+
import React33 from "react";
|
|
3879
|
+
import { Button as Button12, Box as Box22, SvgIcon as SvgIcon8 } from "@mui/material";
|
|
3880
|
+
import IconButton12 from "@mui/material/IconButton";
|
|
3655
3881
|
import Card from "@mui/material/Card";
|
|
3656
3882
|
import CardHeader from "@mui/material/CardHeader";
|
|
3657
3883
|
import CardMedia from "@mui/material/CardMedia";
|
|
@@ -3663,10 +3889,10 @@ import * as Muicon8 from "@mui/icons-material";
|
|
|
3663
3889
|
var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, actions, expand }) => {
|
|
3664
3890
|
let iconTitleValidation = "";
|
|
3665
3891
|
let IconTitle;
|
|
3666
|
-
const [expanded, setExpanded] =
|
|
3892
|
+
const [expanded, setExpanded] = React33.useState(false);
|
|
3667
3893
|
if (iconTitle) {
|
|
3668
3894
|
if (Muicon8[iconTitle] == void 0) {
|
|
3669
|
-
if (iconTitle &&
|
|
3895
|
+
if (iconTitle && React33.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
3670
3896
|
iconTitleValidation = "image";
|
|
3671
3897
|
IconTitle = iconTitle;
|
|
3672
3898
|
} else {
|
|
@@ -3681,11 +3907,11 @@ var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, action
|
|
|
3681
3907
|
const handleExpandClick = () => {
|
|
3682
3908
|
setExpanded(!expanded);
|
|
3683
3909
|
};
|
|
3684
|
-
return /* @__PURE__ */
|
|
3910
|
+
return /* @__PURE__ */ React33.createElement(Card, { sx: { maxWidth: 345 } }, title && /* @__PURE__ */ React33.createElement(
|
|
3685
3911
|
CardHeader,
|
|
3686
3912
|
{
|
|
3687
|
-
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */
|
|
3688
|
-
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */
|
|
3913
|
+
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ React33.createElement(Box22, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React33.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React33.createElement(SvgIcon8, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
3914
|
+
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ React33.createElement(Button12, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ React33.createElement(IconButton12, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ React33.createElement(ExpandMoreIcon, { fontSize: "small" })) : actionsTitle,
|
|
3689
3915
|
title,
|
|
3690
3916
|
subheader: subtitle,
|
|
3691
3917
|
sx: {
|
|
@@ -3704,15 +3930,15 @@ var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, action
|
|
|
3704
3930
|
}
|
|
3705
3931
|
}
|
|
3706
3932
|
}
|
|
3707
|
-
), image && /* @__PURE__ */
|
|
3933
|
+
), image && /* @__PURE__ */ React33.createElement(
|
|
3708
3934
|
CardMedia,
|
|
3709
3935
|
{
|
|
3710
3936
|
component: "img",
|
|
3711
3937
|
height: "194",
|
|
3712
3938
|
image
|
|
3713
3939
|
}
|
|
3714
|
-
), content && /* @__PURE__ */
|
|
3715
|
-
|
|
3940
|
+
), content && /* @__PURE__ */ React33.createElement(CardContent, { sx: { padding: "8px 16px !important" } }, content), ((expand == null ? void 0 : expand.position) == "bottom" || actions != void 0) && /* @__PURE__ */ React33.createElement(CardActions, { disableSpacing: true, sx: { justifyContent: "flex-end" } }, (expand == null ? void 0 : expand.position) === "bottom" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ React33.createElement(Button12, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ React33.createElement(IconButton12, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, /* @__PURE__ */ React33.createElement(ExpandMoreIcon, null)) : null, actions && actions.length > 0 ? actions.map((action, index) => /* @__PURE__ */ React33.createElement(
|
|
3941
|
+
Button12,
|
|
3716
3942
|
{
|
|
3717
3943
|
key: index,
|
|
3718
3944
|
size: "small",
|
|
@@ -3722,14 +3948,14 @@ var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, action
|
|
|
3722
3948
|
disabled: action.disabled || false
|
|
3723
3949
|
},
|
|
3724
3950
|
action.text
|
|
3725
|
-
)) : ""), expand && /* @__PURE__ */
|
|
3951
|
+
)) : ""), expand && /* @__PURE__ */ React33.createElement(Collapse, { in: expanded, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React33.createElement(CardContent, { sx: { padding: "8px 16px !important" } }, expand.content)));
|
|
3726
3952
|
};
|
|
3727
3953
|
|
|
3728
3954
|
// src/Theme/index.ts
|
|
3729
3955
|
import { createTheme } from "@mui/material/styles";
|
|
3730
3956
|
|
|
3731
3957
|
// src/Theme/components.ts
|
|
3732
|
-
import
|
|
3958
|
+
import React34 from "react";
|
|
3733
3959
|
import {
|
|
3734
3960
|
InfoRounded as InfoRounded2,
|
|
3735
3961
|
CheckCircleRounded as CheckCircleRounded2,
|
|
@@ -4432,10 +4658,10 @@ var components = {
|
|
|
4432
4658
|
MuiAlert: {
|
|
4433
4659
|
defaultProps: {
|
|
4434
4660
|
iconMapping: {
|
|
4435
|
-
success:
|
|
4436
|
-
error:
|
|
4437
|
-
warning:
|
|
4438
|
-
info:
|
|
4661
|
+
success: React34.createElement(CheckCircleRounded2),
|
|
4662
|
+
error: React34.createElement(ErrorRounded2),
|
|
4663
|
+
warning: React34.createElement(WarningRounded2),
|
|
4664
|
+
info: React34.createElement(InfoRounded2)
|
|
4439
4665
|
}
|
|
4440
4666
|
},
|
|
4441
4667
|
variants: [
|
|
@@ -5475,6 +5701,7 @@ var AdproSincoTheme = createTheme(__spreadValues({}, ADPROTheme));
|
|
|
5475
5701
|
var ADCSincoTheme = createTheme(__spreadValues({}, ADCTheme));
|
|
5476
5702
|
export {
|
|
5477
5703
|
ADCSincoTheme,
|
|
5704
|
+
Adjuntar,
|
|
5478
5705
|
AdproSincoTheme,
|
|
5479
5706
|
Calendar,
|
|
5480
5707
|
EmptyState,
|