componentes-sinco 1.2.9 → 1.3.0
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 +813 -862
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +705 -754
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -137,217 +137,79 @@ __export(index_exports, {
|
|
|
137
137
|
module.exports = __toCommonJS(index_exports);
|
|
138
138
|
|
|
139
139
|
// src/Components/Adjuntar/Adjuntar.tsx
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
140
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
141
|
+
var import_material2 = require("@mui/material");
|
|
142
|
+
var import_icons_material4 = require("@mui/icons-material");
|
|
143
143
|
var Muicon = __toESM(require("@mui/icons-material"), 1);
|
|
144
144
|
|
|
145
|
-
// src/Components/
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
167
|
-
}, timeProgress * 10);
|
|
168
|
-
return () => {
|
|
169
|
-
clearInterval(interval);
|
|
170
|
-
};
|
|
171
|
-
}, [timeProgress, lote]);
|
|
172
|
-
return {
|
|
173
|
-
progress
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
var ToastProgress = (timeProgress) => {
|
|
177
|
-
const [progress, setProgress] = (0, import_react.useState)(100);
|
|
178
|
-
(0, import_react.useEffect)(() => {
|
|
179
|
-
const interval = setInterval(() => {
|
|
180
|
-
setProgress((prev) => {
|
|
181
|
-
if (prev <= 0) {
|
|
182
|
-
clearInterval(interval);
|
|
183
|
-
}
|
|
184
|
-
return prev - 1;
|
|
185
|
-
});
|
|
186
|
-
}, timeProgress * 10);
|
|
187
|
-
return () => {
|
|
188
|
-
clearInterval(interval);
|
|
189
|
-
};
|
|
190
|
-
}, [timeProgress]);
|
|
191
|
-
return {
|
|
192
|
-
progressToast: progress
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
197
|
-
var SCToastNotification = (toast) => {
|
|
198
|
-
var _a;
|
|
199
|
-
const [stateOptions, setStateOptions] = (0, import_react2.useState)(true);
|
|
200
|
-
const [stateToast, setStateToast] = (0, import_react2.useState)(true);
|
|
201
|
-
const timeProgress = toast.time || 10;
|
|
202
|
-
const { progress } = useProgress(timeProgress);
|
|
203
|
-
const toastColorConfig = toast.type || "info";
|
|
204
|
-
const toastIconOption = {
|
|
205
|
-
success: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.CheckCircleRounded, { color: "success" }),
|
|
206
|
-
error: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.ErrorRounded, { color: "error" }),
|
|
207
|
-
warning: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.WarningRounded, { color: "warning" }),
|
|
208
|
-
info: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.InfoRounded, { color: "info" })
|
|
209
|
-
};
|
|
210
|
-
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
211
|
-
alert("");
|
|
212
|
-
} }, { text: "Consultar", fn: () => {
|
|
213
|
-
} }]];
|
|
214
|
-
const ToastIconConfig = toastIconOption[toast.type];
|
|
215
|
-
const closeToast = () => {
|
|
216
|
-
setStateToast(false);
|
|
217
|
-
};
|
|
218
|
-
const toggleToastOptions = () => {
|
|
219
|
-
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
145
|
+
// src/Components/SCSnackBar.tsx
|
|
146
|
+
var import_react = __toESM(require("react"), 1);
|
|
147
|
+
var import_Alert = __toESM(require("@mui/material/Alert"), 1);
|
|
148
|
+
var import_es = require("dayjs/locale/es");
|
|
149
|
+
var import_Snackbar = __toESM(require("@mui/material/Snackbar"), 1);
|
|
150
|
+
var SCSnackBar = ({
|
|
151
|
+
type = "success",
|
|
152
|
+
close = true,
|
|
153
|
+
openState,
|
|
154
|
+
setOpenState,
|
|
155
|
+
mensaje,
|
|
156
|
+
duration = 3e3,
|
|
157
|
+
position = "Center"
|
|
158
|
+
}) => {
|
|
159
|
+
const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
|
|
160
|
+
const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
|
|
161
|
+
const handleClose = (event2, reason) => {
|
|
162
|
+
if (reason === "clickaway") {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
setOpenState(false);
|
|
220
166
|
};
|
|
221
|
-
(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
zIndex:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
import_material.Box,
|
|
238
|
-
{
|
|
239
|
-
padding: 1.5,
|
|
240
|
-
gap: 1.5,
|
|
241
|
-
display: "flex",
|
|
242
|
-
alignItems: "center",
|
|
243
|
-
sx: {
|
|
244
|
-
backgroundColor: {
|
|
245
|
-
success: "success.50",
|
|
246
|
-
error: "error.50",
|
|
247
|
-
warning: "warning.50",
|
|
248
|
-
info: "info.50"
|
|
249
|
-
}[toastColorConfig]
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
253
|
-
import_material.Stack,
|
|
254
|
-
{
|
|
255
|
-
p: 1,
|
|
256
|
-
gap: 1,
|
|
257
|
-
borderRadius: 50,
|
|
258
|
-
bgcolor: {
|
|
259
|
-
success: "success.100",
|
|
260
|
-
error: "error.100",
|
|
261
|
-
warning: "warning.100",
|
|
262
|
-
info: "info.100"
|
|
263
|
-
}[(_a = toast.type) != null ? _a : "info"]
|
|
264
|
-
},
|
|
265
|
-
/* @__PURE__ */ import_react2.default.createElement(import_material.Stack, null, ToastIconConfig)
|
|
266
|
-
),
|
|
267
|
-
/* @__PURE__ */ import_react2.default.createElement(import_material.Divider, { orientation: "vertical", flexItem: true }),
|
|
268
|
-
/* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { width: 285 }, /* @__PURE__ */ import_react2.default.createElement(
|
|
269
|
-
import_material.Stack,
|
|
270
|
-
{
|
|
271
|
-
justifyContent: "space-between",
|
|
272
|
-
flexDirection: "row",
|
|
273
|
-
alignItems: "center"
|
|
274
|
-
},
|
|
275
|
-
/* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
276
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
277
|
-
import_material.IconButton,
|
|
278
|
-
{
|
|
279
|
-
size: "small",
|
|
280
|
-
"data-testid": "close-icon",
|
|
281
|
-
onClick: closeToast
|
|
282
|
-
},
|
|
283
|
-
/* @__PURE__ */ import_react2.default.createElement(import_icons_material.Close, { fontSize: "small" })
|
|
284
|
-
)
|
|
285
|
-
), /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ import_react2.default.createElement(
|
|
286
|
-
import_material.Button,
|
|
287
|
-
{
|
|
288
|
-
key: index,
|
|
289
|
-
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
290
|
-
variant: "text",
|
|
291
|
-
onClick: button.fn,
|
|
292
|
-
disabled: button.disabled || false,
|
|
293
|
-
size: "small"
|
|
294
|
-
},
|
|
295
|
-
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
296
|
-
))), toast.seeMore && /* @__PURE__ */ import_react2.default.createElement(
|
|
297
|
-
import_material.Button,
|
|
298
|
-
{
|
|
299
|
-
onClick: toggleToastOptions,
|
|
300
|
-
size: "small",
|
|
301
|
-
variant: "text",
|
|
302
|
-
color: toastColorConfig
|
|
303
|
-
},
|
|
304
|
-
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
305
|
-
stateOptions ? /* @__PURE__ */ import_react2.default.createElement(import_icons_material.KeyboardArrowDown, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons_material.KeyboardArrowUp, null)
|
|
306
|
-
)))
|
|
307
|
-
),
|
|
308
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
309
|
-
import_material.LinearProgress,
|
|
310
|
-
{
|
|
311
|
-
sx: {
|
|
312
|
-
".MuiLinearProgress-bar": {
|
|
313
|
-
transition: "0.1s linear !important",
|
|
314
|
-
transform: "scaleX(-1)"
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
color: toastColorConfig,
|
|
318
|
-
variant: "determinate",
|
|
319
|
-
value: 100 - progress
|
|
320
|
-
}
|
|
167
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
168
|
+
import_Snackbar.default,
|
|
169
|
+
__spreadProps(__spreadValues({
|
|
170
|
+
anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },
|
|
171
|
+
open: openState,
|
|
172
|
+
autoHideDuration: duration
|
|
173
|
+
}, close ? { onClose: handleClose } : {}), {
|
|
174
|
+
sx: { zIndex: 2e3 }
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
177
|
+
import_Alert.default,
|
|
178
|
+
__spreadProps(__spreadValues({}, close ? { onClose: handleClose } : {}), {
|
|
179
|
+
severity: type,
|
|
180
|
+
sx: { backgroundColor: type == "success" ? "success.50" : type == "error" ? "#F9E8E8" : type == "warning" ? "#FFF0E0" : "#E6F3F8" }
|
|
181
|
+
}),
|
|
182
|
+
mensaje
|
|
321
183
|
)
|
|
322
184
|
));
|
|
323
185
|
};
|
|
324
186
|
|
|
325
187
|
// src/Components/Modal/Helpers/Data.tsx
|
|
326
|
-
var
|
|
327
|
-
var
|
|
188
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
189
|
+
var import_icons_material = require("@mui/icons-material");
|
|
328
190
|
var modalStateConfig = {
|
|
329
191
|
info: {
|
|
330
192
|
color: "info",
|
|
331
193
|
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
332
|
-
icon: /* @__PURE__ */
|
|
194
|
+
icon: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.Info, { color: "info", fontSize: "medium" })
|
|
333
195
|
},
|
|
334
196
|
delete: {
|
|
335
197
|
color: "delete",
|
|
336
198
|
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
337
|
-
icon: /* @__PURE__ */
|
|
199
|
+
icon: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.Info, { color: "error", fontSize: "medium" })
|
|
338
200
|
},
|
|
339
201
|
warning: {
|
|
340
202
|
color: "warning",
|
|
341
203
|
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
342
|
-
icon: /* @__PURE__ */
|
|
204
|
+
icon: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.Warning, { color: "warning", fontSize: "medium" })
|
|
343
205
|
}
|
|
344
206
|
};
|
|
345
207
|
|
|
346
208
|
// src/Components/Modal/Helpers/Utils.tsx
|
|
347
209
|
var MuiIcons = __toESM(require("@mui/icons-material"), 1);
|
|
348
|
-
var
|
|
210
|
+
var import_icons_material2 = require("@mui/icons-material");
|
|
349
211
|
var getIconComponent = (iconName) => {
|
|
350
|
-
return iconName && MuiIcons[iconName] ? MuiIcons[iconName] :
|
|
212
|
+
return iconName && MuiIcons[iconName] ? MuiIcons[iconName] : import_icons_material2.FilterListOutlined;
|
|
351
213
|
};
|
|
352
214
|
var getModalColor = (state) => {
|
|
353
215
|
var _a;
|
|
@@ -369,9 +231,9 @@ var getButtonColor = (state) => {
|
|
|
369
231
|
};
|
|
370
232
|
|
|
371
233
|
// src/Components/Modal/SCModal.tsx
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
var
|
|
234
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
235
|
+
var import_material = require("@mui/material");
|
|
236
|
+
var import_icons_material3 = require("@mui/icons-material");
|
|
375
237
|
|
|
376
238
|
// src/generales/capitalize.tsx
|
|
377
239
|
function capitalize(text) {
|
|
@@ -389,28 +251,28 @@ var SCModal = ({
|
|
|
389
251
|
action
|
|
390
252
|
}) => {
|
|
391
253
|
var _a, _b, _c, _d, _e;
|
|
392
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
254
|
+
const [internalOpen, setInternalOpen] = (0, import_react3.useState)(open != null ? open : false);
|
|
393
255
|
const isControlled = Boolean(setOpen);
|
|
394
256
|
const modalOpen = isControlled ? open != null ? open : false : internalOpen;
|
|
395
257
|
const setModalOpen = isControlled ? setOpen : setInternalOpen;
|
|
396
|
-
const handleToggle = (0,
|
|
397
|
-
const handleClose = (0,
|
|
398
|
-
const Icon = (0,
|
|
258
|
+
const handleToggle = (0, import_react3.useCallback)(() => setModalOpen((prev) => !prev), [setModalOpen]);
|
|
259
|
+
const handleClose = (0, import_react3.useCallback)(() => setModalOpen(false), [setModalOpen]);
|
|
260
|
+
const Icon = (0, import_react3.useMemo)(() => getIconComponent(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
399
261
|
const { icon, defaultDescription } = modalStateConfig[state];
|
|
400
|
-
return /* @__PURE__ */
|
|
401
|
-
|
|
262
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, buttonModal && /* @__PURE__ */ import_react3.default.createElement(
|
|
263
|
+
import_material.Button,
|
|
402
264
|
{
|
|
403
265
|
"data-testid": "test-buttonModal",
|
|
404
266
|
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
405
267
|
onClick: handleToggle,
|
|
406
268
|
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
407
269
|
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
408
|
-
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */
|
|
409
|
-
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */
|
|
270
|
+
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ import_react3.default.createElement(Icon, null),
|
|
271
|
+
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ import_react3.default.createElement(Icon, null)
|
|
410
272
|
},
|
|
411
273
|
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
412
|
-
), /* @__PURE__ */
|
|
413
|
-
|
|
274
|
+
), /* @__PURE__ */ import_react3.default.createElement(import_material.Modal, { open: modalOpen, onClose: handleClose, sx: { boxShadow: 8 } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
275
|
+
import_material.Box,
|
|
414
276
|
{
|
|
415
277
|
sx: {
|
|
416
278
|
position: "absolute",
|
|
@@ -423,8 +285,8 @@ var SCModal = ({
|
|
|
423
285
|
boxShadow: 24
|
|
424
286
|
}
|
|
425
287
|
},
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
|
|
288
|
+
/* @__PURE__ */ import_react3.default.createElement(import_material.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ import_react3.default.createElement(import_material.Stack, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ import_react3.default.createElement(
|
|
289
|
+
import_material.Box,
|
|
428
290
|
{
|
|
429
291
|
display: "flex",
|
|
430
292
|
justifyContent: "center",
|
|
@@ -435,10 +297,10 @@ var SCModal = ({
|
|
|
435
297
|
bgcolor: getModalColor(state)
|
|
436
298
|
},
|
|
437
299
|
icon
|
|
438
|
-
), /* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
action && /* @__PURE__ */
|
|
441
|
-
|
|
300
|
+
), /* @__PURE__ */ import_react3.default.createElement(import_material.Typography, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ import_react3.default.createElement(import_material.IconButton, { onClick: handleClose, "data-testid": "test-buttonClose" }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material3.Close, { color: "action" }))),
|
|
301
|
+
/* @__PURE__ */ import_react3.default.createElement(import_material.Stack, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ import_react3.default.createElement(import_material.Typography, { variant: "body1" }, description || defaultDescription)),
|
|
302
|
+
action && /* @__PURE__ */ import_react3.default.createElement(
|
|
303
|
+
import_material.Stack,
|
|
442
304
|
{
|
|
443
305
|
id: "Action",
|
|
444
306
|
direction: "row",
|
|
@@ -448,8 +310,8 @@ var SCModal = ({
|
|
|
448
310
|
bgcolor: "grey.50",
|
|
449
311
|
sx: { borderRadius: 1 }
|
|
450
312
|
},
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
|
|
313
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
314
|
+
import_material.Button,
|
|
453
315
|
{
|
|
454
316
|
color: "inherit",
|
|
455
317
|
variant: "text",
|
|
@@ -458,8 +320,8 @@ var SCModal = ({
|
|
|
458
320
|
},
|
|
459
321
|
capitalize("cancelar")
|
|
460
322
|
),
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
|
|
323
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
324
|
+
import_material.Button,
|
|
463
325
|
{
|
|
464
326
|
"data-testid": "test-aceptar",
|
|
465
327
|
color: getButtonColor(state),
|
|
@@ -489,12 +351,12 @@ var Attachment = ({
|
|
|
489
351
|
iconFileItem,
|
|
490
352
|
view = "button"
|
|
491
353
|
}) => {
|
|
492
|
-
const [files, setFiles] = (0,
|
|
493
|
-
const [fileToDelete, setFileToDelete] = (0,
|
|
494
|
-
const [toast, setToast] = (0,
|
|
495
|
-
const [openModal, setOpenModal] = (0,
|
|
496
|
-
const [isDragFile, setIsDragFile] = (0,
|
|
497
|
-
const inputRef = (0,
|
|
354
|
+
const [files, setFiles] = (0, import_react4.useState)([]);
|
|
355
|
+
const [fileToDelete, setFileToDelete] = (0, import_react4.useState)(null);
|
|
356
|
+
const [toast, setToast] = (0, import_react4.useState)({ open: false, mensaje: "", type: "success" });
|
|
357
|
+
const [openModal, setOpenModal] = (0, import_react4.useState)(false);
|
|
358
|
+
const [isDragFile, setIsDragFile] = (0, import_react4.useState)(false);
|
|
359
|
+
const inputRef = (0, import_react4.useRef)(null);
|
|
498
360
|
let IconFileItem;
|
|
499
361
|
if (iconFileItem) {
|
|
500
362
|
if (Muicon[iconFileItem] == void 0) {
|
|
@@ -503,7 +365,7 @@ var Attachment = ({
|
|
|
503
365
|
IconFileItem = Muicon[iconFileItem];
|
|
504
366
|
}
|
|
505
367
|
}
|
|
506
|
-
(0,
|
|
368
|
+
(0, import_react4.useEffect)(() => {
|
|
507
369
|
if (initialFiles && initialFiles.length > 0) {
|
|
508
370
|
setFiles(initialFiles);
|
|
509
371
|
}
|
|
@@ -538,13 +400,7 @@ var Attachment = ({
|
|
|
538
400
|
);
|
|
539
401
|
const sizeMB = file.size / (1024 * 1024);
|
|
540
402
|
if (isDuplicateFile) {
|
|
541
|
-
setToast({
|
|
542
|
-
type: "error",
|
|
543
|
-
title: "Archivo duplicado",
|
|
544
|
-
listITems: [`El archivo "${file.name}" ya existe.`],
|
|
545
|
-
seeMore: true,
|
|
546
|
-
time: 5
|
|
547
|
-
});
|
|
403
|
+
setToast({ open: true, type: "error", mensaje: `Archivo duplicado: El archivo "${file.name}" ya existe.` });
|
|
548
404
|
return;
|
|
549
405
|
}
|
|
550
406
|
if (sizeMB > maxSize) {
|
|
@@ -555,13 +411,7 @@ var Attachment = ({
|
|
|
555
411
|
progress: 0,
|
|
556
412
|
uploadError: true
|
|
557
413
|
});
|
|
558
|
-
setToast({
|
|
559
|
-
type: "error",
|
|
560
|
-
title: "Carga fallida",
|
|
561
|
-
seeMore: true,
|
|
562
|
-
listITems: [`El archivo "${file.name}" supera el l\xEDmite de ${maxSize}MB.`],
|
|
563
|
-
time: 5
|
|
564
|
-
});
|
|
414
|
+
setToast({ open: true, type: "error", mensaje: `Carga fallida: El archivo "${file.name}" supera el l\xEDmite de ${maxSize}MB.` });
|
|
565
415
|
return;
|
|
566
416
|
}
|
|
567
417
|
if (fileAccepted && !file.name.match(
|
|
@@ -570,13 +420,7 @@ var Attachment = ({
|
|
|
570
420
|
"i"
|
|
571
421
|
)
|
|
572
422
|
)) {
|
|
573
|
-
setToast({
|
|
574
|
-
type: "error",
|
|
575
|
-
title: "Tipo de archivo no permitido",
|
|
576
|
-
listITems: [`El archivo "${file.name}" no es un tipo permitido.`],
|
|
577
|
-
seeMore: true,
|
|
578
|
-
time: 5
|
|
579
|
-
});
|
|
423
|
+
setToast({ open: true, type: "error", mensaje: `Tipo de archivo no permitido: El archivo "${file.name}" no es un tipo permitido.` });
|
|
580
424
|
return;
|
|
581
425
|
}
|
|
582
426
|
nuevosArchivos.push({
|
|
@@ -611,7 +455,17 @@ var Attachment = ({
|
|
|
611
455
|
return filteredFiles;
|
|
612
456
|
});
|
|
613
457
|
};
|
|
614
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { spacing: 2, display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react4.default.createElement(
|
|
459
|
+
SCSnackBar,
|
|
460
|
+
{
|
|
461
|
+
openState: toast.open,
|
|
462
|
+
setOpenState: (v) => setToast((prev) => __spreadProps(__spreadValues({}, prev), { open: v })),
|
|
463
|
+
mensaje: toast.mensaje,
|
|
464
|
+
type: toast.type,
|
|
465
|
+
duration: 5e3,
|
|
466
|
+
position: "Center"
|
|
467
|
+
}
|
|
468
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
615
469
|
"input",
|
|
616
470
|
{
|
|
617
471
|
type: "file",
|
|
@@ -620,8 +474,8 @@ var Attachment = ({
|
|
|
620
474
|
ref: inputRef,
|
|
621
475
|
onChange: handleUpload
|
|
622
476
|
}
|
|
623
|
-
), view === "button" && /* @__PURE__ */
|
|
624
|
-
|
|
477
|
+
), view === "button" && /* @__PURE__ */ import_react4.default.createElement(
|
|
478
|
+
import_material2.Stack,
|
|
625
479
|
{
|
|
626
480
|
"data-testid": "ZonaAdjuntos",
|
|
627
481
|
id: "ZonaAdjuntos",
|
|
@@ -650,8 +504,8 @@ var Attachment = ({
|
|
|
650
504
|
}
|
|
651
505
|
}, sx)
|
|
652
506
|
},
|
|
653
|
-
onLoading ? /* @__PURE__ */
|
|
654
|
-
|
|
507
|
+
onLoading ? /* @__PURE__ */ import_react4.default.createElement(
|
|
508
|
+
import_material2.Box,
|
|
655
509
|
{
|
|
656
510
|
display: "flex",
|
|
657
511
|
alignItems: "center",
|
|
@@ -659,30 +513,30 @@ var Attachment = ({
|
|
|
659
513
|
width: "100%",
|
|
660
514
|
height: "450px"
|
|
661
515
|
},
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
|
|
516
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
517
|
+
import_material2.CircularProgress,
|
|
664
518
|
{
|
|
665
519
|
sx: { width: "60px", height: "60px" },
|
|
666
520
|
variant: "indeterminate"
|
|
667
521
|
}
|
|
668
522
|
)
|
|
669
|
-
) : /* @__PURE__ */
|
|
670
|
-
|
|
523
|
+
) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
|
|
524
|
+
import_material2.Box,
|
|
671
525
|
{
|
|
672
526
|
display: "flex",
|
|
673
527
|
bgcolor: error ? "error.50" : "primary.50",
|
|
674
528
|
borderRadius: "100%",
|
|
675
529
|
p: 1
|
|
676
530
|
},
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
|
|
531
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
532
|
+
import_icons_material4.CloudUploadOutlined,
|
|
679
533
|
{
|
|
680
534
|
color: error ? "error" : "primary",
|
|
681
535
|
fontSize: "medium"
|
|
682
536
|
}
|
|
683
537
|
)
|
|
684
|
-
), /* @__PURE__ */
|
|
685
|
-
|
|
538
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
539
|
+
import_material2.Stack,
|
|
686
540
|
{
|
|
687
541
|
width: "100%",
|
|
688
542
|
flexDirection: compact ? "row" : "column",
|
|
@@ -690,16 +544,16 @@ var Attachment = ({
|
|
|
690
544
|
justifyContent: compact ? "space-between" : "center",
|
|
691
545
|
gap: 1
|
|
692
546
|
},
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
547
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
548
|
+
import_material2.Stack,
|
|
695
549
|
{
|
|
696
550
|
flexDirection: "column",
|
|
697
551
|
alignItems: compact ? "start" : "center",
|
|
698
552
|
gap: 0.5
|
|
699
553
|
},
|
|
700
|
-
/* @__PURE__ */
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
|
|
554
|
+
/* @__PURE__ */ import_react4.default.createElement(import_material2.Typography, { variant: "body2", color: "text.primary" }, "Arrastrar o adjuntar archivos"),
|
|
555
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
556
|
+
import_material2.Typography,
|
|
703
557
|
{
|
|
704
558
|
variant: "caption",
|
|
705
559
|
color: error ? "error" : "text.secondary",
|
|
@@ -711,19 +565,19 @@ var Attachment = ({
|
|
|
711
565
|
error ? `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Archivo no soportado` : `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Max. ${maxSize}MB`
|
|
712
566
|
)
|
|
713
567
|
),
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
|
|
568
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
569
|
+
import_material2.Button,
|
|
716
570
|
{
|
|
717
571
|
variant: "text",
|
|
718
572
|
color: "primary",
|
|
719
573
|
size: "small",
|
|
720
|
-
startIcon: /* @__PURE__ */
|
|
574
|
+
startIcon: /* @__PURE__ */ import_react4.default.createElement(import_icons_material4.AttachFileOutlined, { color: "primary", fontSize: "small" })
|
|
721
575
|
},
|
|
722
576
|
"Adjuntar"
|
|
723
577
|
)
|
|
724
578
|
))
|
|
725
|
-
), files.length > 0 && /* @__PURE__ */
|
|
726
|
-
|
|
579
|
+
), files.length > 0 && /* @__PURE__ */ import_react4.default.createElement(
|
|
580
|
+
import_material2.Stack,
|
|
727
581
|
{
|
|
728
582
|
"data-testid": "ContenedorArchivosAdjuntos",
|
|
729
583
|
id: "ContenedorArchivosAdjuntos",
|
|
@@ -736,8 +590,8 @@ var Attachment = ({
|
|
|
736
590
|
}),
|
|
737
591
|
spacing: 1
|
|
738
592
|
},
|
|
739
|
-
files.map((file) => /* @__PURE__ */
|
|
740
|
-
|
|
593
|
+
files.map((file) => /* @__PURE__ */ import_react4.default.createElement(
|
|
594
|
+
import_material2.Stack,
|
|
741
595
|
{
|
|
742
596
|
height: 46,
|
|
743
597
|
key: file.name + (file.uploadError ? "_error" : ""),
|
|
@@ -754,14 +608,14 @@ var Attachment = ({
|
|
|
754
608
|
}
|
|
755
609
|
}
|
|
756
610
|
},
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
|
|
611
|
+
/* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, iconFileItem ? /* @__PURE__ */ import_react4.default.createElement(import_material2.SvgIcon, { color: file.uploadError ? "error" : "primary", fontSize: "small", component: IconFileItem }) : /* @__PURE__ */ import_react4.default.createElement(
|
|
612
|
+
import_icons_material4.UploadFileOutlined,
|
|
759
613
|
{
|
|
760
614
|
color: file.uploadError ? "error" : "primary",
|
|
761
615
|
fontSize: "small"
|
|
762
616
|
}
|
|
763
|
-
), /* @__PURE__ */
|
|
764
|
-
|
|
617
|
+
), /* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { width: "100%" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
618
|
+
import_material2.Typography,
|
|
765
619
|
{
|
|
766
620
|
variant: "body2",
|
|
767
621
|
color: "text.primary",
|
|
@@ -771,26 +625,26 @@ var Attachment = ({
|
|
|
771
625
|
maxWidth: "310px"
|
|
772
626
|
},
|
|
773
627
|
file.name
|
|
774
|
-
), /* @__PURE__ */
|
|
775
|
-
|
|
628
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
629
|
+
import_material2.Typography,
|
|
776
630
|
{
|
|
777
631
|
variant: "caption",
|
|
778
632
|
color: file.uploadError ? "error" : "text.secondary"
|
|
779
633
|
},
|
|
780
634
|
file.uploadError && file.size / (1024 * 1024) > maxSize ? "Archivo super\xF3 el l\xEDmite \u2022 Carga fallida" : file.uploadError ? "Archivo duplicado o inv\xE1lido \u2022 Carga fallida" : `${(file.size / (1024 * 1024)).toFixed(2)}MB \u2022 ${file.type}`
|
|
781
635
|
))),
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
|
|
636
|
+
/* @__PURE__ */ import_react4.default.createElement(import_material2.Tooltip, { title: "Descargar" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
637
|
+
import_material2.IconButton,
|
|
784
638
|
{
|
|
785
639
|
size: "small",
|
|
786
640
|
onClick: () => downloadAction == null ? void 0 : downloadAction(file.name),
|
|
787
641
|
disabled: file.uploadError,
|
|
788
642
|
"aria-label": `Descargar ${file.name}`
|
|
789
643
|
},
|
|
790
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_material4.FileDownload, { fontSize: "small", color: "action" })
|
|
791
645
|
)),
|
|
792
|
-
view === "button" && /* @__PURE__ */
|
|
793
|
-
|
|
646
|
+
view === "button" && /* @__PURE__ */ import_react4.default.createElement(import_material2.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
647
|
+
import_material2.IconButton,
|
|
794
648
|
{
|
|
795
649
|
size: "small",
|
|
796
650
|
onClick: () => {
|
|
@@ -799,10 +653,10 @@ var Attachment = ({
|
|
|
799
653
|
},
|
|
800
654
|
"aria-label": `Eliminar ${file.name}`
|
|
801
655
|
},
|
|
802
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ import_react4.default.createElement(import_icons_material4.DeleteOutline, { fontSize: "small", color: "action" })
|
|
803
657
|
))
|
|
804
658
|
))
|
|
805
|
-
), /* @__PURE__ */
|
|
659
|
+
), /* @__PURE__ */ import_react4.default.createElement(
|
|
806
660
|
SCModal,
|
|
807
661
|
{
|
|
808
662
|
state: "delete",
|
|
@@ -820,19 +674,9 @@ var Attachment = ({
|
|
|
820
674
|
yield deleteAction(fileToDelete.name);
|
|
821
675
|
}
|
|
822
676
|
deleteFiles(fileToDelete.name);
|
|
823
|
-
setToast({
|
|
824
|
-
title: "Archivo eliminado",
|
|
825
|
-
type: "success",
|
|
826
|
-
listITems: [`El archivo "${fileToDelete.name}" fue eliminado exitosamente.`],
|
|
827
|
-
time: 3
|
|
828
|
-
});
|
|
677
|
+
setToast({ open: true, type: "success", mensaje: `El archivo "${fileToDelete.name}" fue eliminado exitosamente.` });
|
|
829
678
|
} catch (error2) {
|
|
830
|
-
setToast({
|
|
831
|
-
title: "Error al eliminar archivo",
|
|
832
|
-
type: "error",
|
|
833
|
-
listITems: [`No se pudo eliminar el archivo "${fileToDelete.name}".`],
|
|
834
|
-
time: 5
|
|
835
|
-
});
|
|
679
|
+
setToast({ open: true, type: "error", mensaje: `No se pudo eliminar el archivo "${fileToDelete.name}".` });
|
|
836
680
|
} finally {
|
|
837
681
|
setFileToDelete(null);
|
|
838
682
|
setOpenModal(false);
|
|
@@ -846,18 +690,18 @@ var Attachment = ({
|
|
|
846
690
|
};
|
|
847
691
|
|
|
848
692
|
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
849
|
-
var
|
|
693
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
850
694
|
var import_react_webcam = __toESM(require("react-webcam"), 1);
|
|
851
695
|
|
|
852
696
|
// src/Components/Adjuntar/mobile/components/button.tsx
|
|
853
|
-
var
|
|
854
|
-
var
|
|
697
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
698
|
+
var import_material3 = require("@mui/material");
|
|
855
699
|
|
|
856
700
|
// src/Components/Adjuntar/mobile/components/Utils.tsx
|
|
857
701
|
var MuiIcons2 = __toESM(require("@mui/icons-material"), 1);
|
|
858
|
-
var
|
|
702
|
+
var import_icons_material5 = require("@mui/icons-material");
|
|
859
703
|
var getAttachmentIcon = (iconName) => {
|
|
860
|
-
return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] :
|
|
704
|
+
return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] : import_icons_material5.AttachFileOutlined;
|
|
861
705
|
};
|
|
862
706
|
var getAttachmentColor = (state) => {
|
|
863
707
|
const colors = {
|
|
@@ -876,42 +720,222 @@ var AttachmentButton = ({ buttonAttachment, open, setOpen }) => {
|
|
|
876
720
|
setOpen(!open);
|
|
877
721
|
}
|
|
878
722
|
};
|
|
879
|
-
const Icon = (0,
|
|
723
|
+
const Icon = (0, import_react5.useMemo)(
|
|
880
724
|
() => getAttachmentIcon(buttonAttachment == null ? void 0 : buttonAttachment.icon),
|
|
881
725
|
[buttonAttachment == null ? void 0 : buttonAttachment.icon]
|
|
882
726
|
);
|
|
883
727
|
if (!buttonAttachment) return null;
|
|
884
|
-
return /* @__PURE__ */
|
|
885
|
-
|
|
728
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, buttonAttachment && /* @__PURE__ */ import_react5.default.createElement(
|
|
729
|
+
import_material3.Button,
|
|
886
730
|
{
|
|
887
731
|
"data-testid": "test-buttonModal",
|
|
888
732
|
color: (_a = buttonAttachment == null ? void 0 : buttonAttachment.color) != null ? _a : "primary",
|
|
889
733
|
onClick: handleToggle,
|
|
890
734
|
variant: (_b = buttonAttachment == null ? void 0 : buttonAttachment.variant) != null ? _b : "text",
|
|
891
735
|
size: (_c = buttonAttachment == null ? void 0 : buttonAttachment.size) != null ? _c : "small",
|
|
892
|
-
startIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "left" && /* @__PURE__ */
|
|
893
|
-
endIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "right" && /* @__PURE__ */
|
|
736
|
+
startIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "left" && /* @__PURE__ */ import_react5.default.createElement(Icon, null),
|
|
737
|
+
endIcon: (buttonAttachment == null ? void 0 : buttonAttachment.iconPosition) === "right" && /* @__PURE__ */ import_react5.default.createElement(Icon, null)
|
|
738
|
+
},
|
|
739
|
+
capitalize((_d = buttonAttachment == null ? void 0 : buttonAttachment.text) != null ? _d : "Adjuntar")
|
|
740
|
+
));
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
744
|
+
var import_material16 = require("@mui/material");
|
|
745
|
+
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"), 1);
|
|
746
|
+
var import_system = require("@mui/system");
|
|
747
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
748
|
+
var import_PhotoCamera = __toESM(require("@mui/icons-material/PhotoCamera"), 1);
|
|
749
|
+
var import_CancelOutlined = __toESM(require("@mui/icons-material/CancelOutlined"), 1);
|
|
750
|
+
var import_ImageOutlined = __toESM(require("@mui/icons-material/ImageOutlined"), 1);
|
|
751
|
+
var import_FileDownloadOutlined = __toESM(require("@mui/icons-material/FileDownloadOutlined"), 1);
|
|
752
|
+
var Muicon6 = __toESM(require("@mui/icons-material"), 1);
|
|
753
|
+
|
|
754
|
+
// src/Components/Drawer/SCDrawer.tsx
|
|
755
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
756
|
+
var import_material15 = require("@mui/material");
|
|
757
|
+
var import_Grid4 = __toESM(require("@mui/material/Grid"), 1);
|
|
758
|
+
|
|
759
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
760
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
761
|
+
var import_material4 = require("@mui/material");
|
|
762
|
+
var import_icons_material6 = require("@mui/icons-material");
|
|
763
|
+
|
|
764
|
+
// src/Components/ToastNotification/useProgress.ts
|
|
765
|
+
var import_react6 = require("react");
|
|
766
|
+
var useProgress = (timeProgress, lote) => {
|
|
767
|
+
const [progress, setProgress] = (0, import_react6.useState)(0);
|
|
768
|
+
(0, import_react6.useEffect)(() => {
|
|
769
|
+
const interval = setInterval(() => {
|
|
770
|
+
setProgress((prev) => {
|
|
771
|
+
if (prev >= 100) {
|
|
772
|
+
clearInterval(interval);
|
|
773
|
+
}
|
|
774
|
+
if (lote) {
|
|
775
|
+
const nextProgress = prev + lote;
|
|
776
|
+
return nextProgress <= 100 ? nextProgress : 100;
|
|
777
|
+
} else {
|
|
778
|
+
return prev + 1;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
}, timeProgress * 10);
|
|
782
|
+
return () => {
|
|
783
|
+
clearInterval(interval);
|
|
784
|
+
};
|
|
785
|
+
}, [timeProgress, lote]);
|
|
786
|
+
return {
|
|
787
|
+
progress
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
var ToastProgress = (timeProgress) => {
|
|
791
|
+
const [progress, setProgress] = (0, import_react6.useState)(100);
|
|
792
|
+
(0, import_react6.useEffect)(() => {
|
|
793
|
+
const interval = setInterval(() => {
|
|
794
|
+
setProgress((prev) => {
|
|
795
|
+
if (prev <= 0) {
|
|
796
|
+
clearInterval(interval);
|
|
797
|
+
}
|
|
798
|
+
return prev - 1;
|
|
799
|
+
});
|
|
800
|
+
}, timeProgress * 10);
|
|
801
|
+
return () => {
|
|
802
|
+
clearInterval(interval);
|
|
803
|
+
};
|
|
804
|
+
}, [timeProgress]);
|
|
805
|
+
return {
|
|
806
|
+
progressToast: progress
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
811
|
+
var SCToastNotification = (toast) => {
|
|
812
|
+
var _a;
|
|
813
|
+
const [stateOptions, setStateOptions] = (0, import_react7.useState)(true);
|
|
814
|
+
const [stateToast, setStateToast] = (0, import_react7.useState)(true);
|
|
815
|
+
const timeProgress = toast.time || 10;
|
|
816
|
+
const { progress } = useProgress(timeProgress);
|
|
817
|
+
const toastColorConfig = toast.type || "info";
|
|
818
|
+
const toastIconOption = {
|
|
819
|
+
success: /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.CheckCircleRounded, { color: "success" }),
|
|
820
|
+
error: /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.ErrorRounded, { color: "error" }),
|
|
821
|
+
warning: /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.WarningRounded, { color: "warning" }),
|
|
822
|
+
info: /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.InfoRounded, { color: "info" })
|
|
823
|
+
};
|
|
824
|
+
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
825
|
+
alert("");
|
|
826
|
+
} }, { text: "Consultar", fn: () => {
|
|
827
|
+
} }]];
|
|
828
|
+
const ToastIconConfig = toastIconOption[toast.type];
|
|
829
|
+
const closeToast = () => {
|
|
830
|
+
setStateToast(false);
|
|
831
|
+
};
|
|
832
|
+
const toggleToastOptions = () => {
|
|
833
|
+
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
834
|
+
};
|
|
835
|
+
(0, import_react7.useEffect)(() => {
|
|
836
|
+
progress >= 100 && setStateToast(false);
|
|
837
|
+
}, [progress]);
|
|
838
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, stateToast && /* @__PURE__ */ import_react7.default.createElement(
|
|
839
|
+
import_material4.Stack,
|
|
840
|
+
{
|
|
841
|
+
position: "fixed",
|
|
842
|
+
zIndex: 1400,
|
|
843
|
+
right: 16,
|
|
844
|
+
top: 16,
|
|
845
|
+
width: 370,
|
|
846
|
+
sx: {
|
|
847
|
+
boxShadow: (theme) => theme.shadows[8]
|
|
848
|
+
}
|
|
894
849
|
},
|
|
895
|
-
|
|
850
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
851
|
+
import_material4.Box,
|
|
852
|
+
{
|
|
853
|
+
padding: 1.5,
|
|
854
|
+
gap: 1.5,
|
|
855
|
+
display: "flex",
|
|
856
|
+
alignItems: "center",
|
|
857
|
+
sx: {
|
|
858
|
+
backgroundColor: {
|
|
859
|
+
success: "success.50",
|
|
860
|
+
error: "error.50",
|
|
861
|
+
warning: "warning.50",
|
|
862
|
+
info: "info.50"
|
|
863
|
+
}[toastColorConfig]
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
867
|
+
import_material4.Stack,
|
|
868
|
+
{
|
|
869
|
+
p: 1,
|
|
870
|
+
gap: 1,
|
|
871
|
+
borderRadius: 50,
|
|
872
|
+
bgcolor: {
|
|
873
|
+
success: "success.100",
|
|
874
|
+
error: "error.100",
|
|
875
|
+
warning: "warning.100",
|
|
876
|
+
info: "info.100"
|
|
877
|
+
}[(_a = toast.type) != null ? _a : "info"]
|
|
878
|
+
},
|
|
879
|
+
/* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, null, ToastIconConfig)
|
|
880
|
+
),
|
|
881
|
+
/* @__PURE__ */ import_react7.default.createElement(import_material4.Divider, { orientation: "vertical", flexItem: true }),
|
|
882
|
+
/* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, { width: 285 }, /* @__PURE__ */ import_react7.default.createElement(
|
|
883
|
+
import_material4.Stack,
|
|
884
|
+
{
|
|
885
|
+
justifyContent: "space-between",
|
|
886
|
+
flexDirection: "row",
|
|
887
|
+
alignItems: "center"
|
|
888
|
+
},
|
|
889
|
+
/* @__PURE__ */ import_react7.default.createElement(import_material4.Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
890
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
891
|
+
import_material4.IconButton,
|
|
892
|
+
{
|
|
893
|
+
size: "small",
|
|
894
|
+
"data-testid": "close-icon",
|
|
895
|
+
onClick: closeToast
|
|
896
|
+
},
|
|
897
|
+
/* @__PURE__ */ import_react7.default.createElement(import_icons_material6.Close, { fontSize: "small" })
|
|
898
|
+
)
|
|
899
|
+
), /* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react7.default.createElement(import_material4.Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ import_react7.default.createElement(import_material4.Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ import_react7.default.createElement(import_material4.Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ import_react7.default.createElement(
|
|
900
|
+
import_material4.Button,
|
|
901
|
+
{
|
|
902
|
+
key: index,
|
|
903
|
+
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
904
|
+
variant: "text",
|
|
905
|
+
onClick: button.fn,
|
|
906
|
+
disabled: button.disabled || false,
|
|
907
|
+
size: "small"
|
|
908
|
+
},
|
|
909
|
+
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
910
|
+
))), toast.seeMore && /* @__PURE__ */ import_react7.default.createElement(
|
|
911
|
+
import_material4.Button,
|
|
912
|
+
{
|
|
913
|
+
onClick: toggleToastOptions,
|
|
914
|
+
size: "small",
|
|
915
|
+
variant: "text",
|
|
916
|
+
color: toastColorConfig
|
|
917
|
+
},
|
|
918
|
+
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
919
|
+
stateOptions ? /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.KeyboardArrowDown, null) : /* @__PURE__ */ import_react7.default.createElement(import_icons_material6.KeyboardArrowUp, null)
|
|
920
|
+
)))
|
|
921
|
+
),
|
|
922
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
923
|
+
import_material4.LinearProgress,
|
|
924
|
+
{
|
|
925
|
+
sx: {
|
|
926
|
+
".MuiLinearProgress-bar": {
|
|
927
|
+
transition: "0.1s linear !important",
|
|
928
|
+
transform: "scaleX(-1)"
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
color: toastColorConfig,
|
|
932
|
+
variant: "determinate",
|
|
933
|
+
value: 100 - progress
|
|
934
|
+
}
|
|
935
|
+
)
|
|
896
936
|
));
|
|
897
937
|
};
|
|
898
938
|
|
|
899
|
-
// src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
|
|
900
|
-
var import_material16 = require("@mui/material");
|
|
901
|
-
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"), 1);
|
|
902
|
-
var import_system = require("@mui/system");
|
|
903
|
-
var import_icons_material10 = require("@mui/icons-material");
|
|
904
|
-
var import_PhotoCamera = __toESM(require("@mui/icons-material/PhotoCamera"), 1);
|
|
905
|
-
var import_CancelOutlined = __toESM(require("@mui/icons-material/CancelOutlined"), 1);
|
|
906
|
-
var import_ImageOutlined = __toESM(require("@mui/icons-material/ImageOutlined"), 1);
|
|
907
|
-
var import_FileDownloadOutlined = __toESM(require("@mui/icons-material/FileDownloadOutlined"), 1);
|
|
908
|
-
var Muicon6 = __toESM(require("@mui/icons-material"), 1);
|
|
909
|
-
|
|
910
|
-
// src/Components/Drawer/SCDrawer.tsx
|
|
911
|
-
var import_react21 = __toESM(require("react"), 1);
|
|
912
|
-
var import_material15 = require("@mui/material");
|
|
913
|
-
var import_Grid4 = __toESM(require("@mui/material/Grid"), 1);
|
|
914
|
-
|
|
915
939
|
// src/Components/Drawer/Helpers/Utils.tsx
|
|
916
940
|
var Muicon2 = __toESM(require("@mui/icons-material"), 1);
|
|
917
941
|
var getIcon = (iconName) => {
|
|
@@ -951,7 +975,7 @@ var validateInputs = (arrayElements, onError, onSuccess, setChipFilters, setText
|
|
|
951
975
|
};
|
|
952
976
|
|
|
953
977
|
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
954
|
-
var
|
|
978
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
955
979
|
var COMPONENT_NAME_MAP = {
|
|
956
980
|
SCtextField: "textField",
|
|
957
981
|
SCtextArea: "textArea",
|
|
@@ -974,12 +998,12 @@ var isKnownComponent = (node) => {
|
|
|
974
998
|
};
|
|
975
999
|
var findInTree = (node) => {
|
|
976
1000
|
var _a;
|
|
977
|
-
if (!
|
|
1001
|
+
if (!import_react8.default.isValidElement(node)) return null;
|
|
978
1002
|
if (isKnownComponent(node)) return node;
|
|
979
1003
|
const children = (_a = node.props) == null ? void 0 : _a.children;
|
|
980
1004
|
if (!children) return null;
|
|
981
|
-
for (const child of
|
|
982
|
-
if (
|
|
1005
|
+
for (const child of import_react8.default.Children.toArray(children)) {
|
|
1006
|
+
if (import_react8.default.isValidElement(child)) {
|
|
983
1007
|
const found = findInTree(child);
|
|
984
1008
|
if (found) return found;
|
|
985
1009
|
}
|
|
@@ -1002,11 +1026,11 @@ var validateTypeElements = (element) => {
|
|
|
1002
1026
|
} else if (element.typeFormat === "multiselect") {
|
|
1003
1027
|
validation = "multiselect";
|
|
1004
1028
|
typeElement = element;
|
|
1005
|
-
} else if (
|
|
1029
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component) && isKnownComponent(element.component)) {
|
|
1006
1030
|
const node = element.component;
|
|
1007
1031
|
validation = resolveValidation(node);
|
|
1008
1032
|
typeElement = node.props;
|
|
1009
|
-
} else if (
|
|
1033
|
+
} else if (import_react8.default.isValidElement(element == null ? void 0 : element.component)) {
|
|
1010
1034
|
const found = findInTree(element.component);
|
|
1011
1035
|
if (found) {
|
|
1012
1036
|
validation = resolveValidation(found);
|
|
@@ -1017,10 +1041,10 @@ var validateTypeElements = (element) => {
|
|
|
1017
1041
|
};
|
|
1018
1042
|
|
|
1019
1043
|
// src/Components/Drawer/hooks/useDrawerState.ts
|
|
1020
|
-
var
|
|
1044
|
+
var import_react9 = require("react");
|
|
1021
1045
|
var useDrawerState = ({ open, setOpen }) => {
|
|
1022
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
1023
|
-
(0,
|
|
1046
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react9.useState)(open || false);
|
|
1047
|
+
(0, import_react9.useEffect)(() => {
|
|
1024
1048
|
if (open !== void 0) {
|
|
1025
1049
|
setDrawerOpen(open);
|
|
1026
1050
|
}
|
|
@@ -1049,11 +1073,11 @@ var useDrawerState = ({ open, setOpen }) => {
|
|
|
1049
1073
|
};
|
|
1050
1074
|
|
|
1051
1075
|
// src/Components/Drawer/hooks/useChipFilters.ts
|
|
1052
|
-
var
|
|
1076
|
+
var import_react10 = require("react");
|
|
1053
1077
|
var useChipFilters = (arrayElements, chipFilters) => {
|
|
1054
|
-
const [stateChipFilters, setChipFilters] = (0,
|
|
1055
|
-
const [textFilters, setTextFilters] = (0,
|
|
1056
|
-
(0,
|
|
1078
|
+
const [stateChipFilters, setChipFilters] = (0, import_react10.useState)(false);
|
|
1079
|
+
const [textFilters, setTextFilters] = (0, import_react10.useState)([]);
|
|
1080
|
+
(0, import_react10.useEffect)(() => {
|
|
1057
1081
|
if (chipFilters == null ? void 0 : chipFilters.length) {
|
|
1058
1082
|
setTextFilters([]);
|
|
1059
1083
|
processChipFilters();
|
|
@@ -1184,9 +1208,9 @@ var useChipFilters = (arrayElements, chipFilters) => {
|
|
|
1184
1208
|
};
|
|
1185
1209
|
|
|
1186
1210
|
// src/Components/Drawer/hooks/useToast.ts
|
|
1187
|
-
var
|
|
1211
|
+
var import_react11 = require("react");
|
|
1188
1212
|
var useToast = () => {
|
|
1189
|
-
const [toast, setToast] = (0,
|
|
1213
|
+
const [toast, setToast] = (0, import_react11.useState)(null);
|
|
1190
1214
|
const setToastWithDelay = (toastContent) => {
|
|
1191
1215
|
setToast(null);
|
|
1192
1216
|
setTimeout(() => {
|
|
@@ -1246,7 +1270,7 @@ var deleteFilter = (element, shouldShowChips, setTextFilters) => {
|
|
|
1246
1270
|
};
|
|
1247
1271
|
|
|
1248
1272
|
// src/Components/Drawer/components/DrawerButton.tsx
|
|
1249
|
-
var
|
|
1273
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
1250
1274
|
var import_material5 = require("@mui/material");
|
|
1251
1275
|
var DrawerButton = ({
|
|
1252
1276
|
buttonDrawer,
|
|
@@ -1255,7 +1279,7 @@ var DrawerButton = ({
|
|
|
1255
1279
|
var _a, _b, _c;
|
|
1256
1280
|
const ButtonIcon = getIcon(buttonDrawer == null ? void 0 : buttonDrawer.icon);
|
|
1257
1281
|
if ((buttonDrawer == null ? void 0 : buttonDrawer.type) === "chip") {
|
|
1258
|
-
return /* @__PURE__ */
|
|
1282
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
1259
1283
|
import_material5.Chip,
|
|
1260
1284
|
__spreadProps(__spreadValues({
|
|
1261
1285
|
onClick: onToggle,
|
|
@@ -1263,8 +1287,8 @@ var DrawerButton = ({
|
|
|
1263
1287
|
color: buttonDrawer == null ? void 0 : buttonDrawer.color,
|
|
1264
1288
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) === "contained" ? "filled" : "outlined",
|
|
1265
1289
|
label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
|
|
1266
|
-
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */
|
|
1267
|
-
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1290
|
+
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
|
|
1291
|
+
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0
|
|
1268
1292
|
}, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
|
|
1269
1293
|
} } : {}), {
|
|
1270
1294
|
sx: {
|
|
@@ -1276,7 +1300,7 @@ var DrawerButton = ({
|
|
|
1276
1300
|
})
|
|
1277
1301
|
);
|
|
1278
1302
|
}
|
|
1279
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
1280
1304
|
import_material5.Button,
|
|
1281
1305
|
{
|
|
1282
1306
|
"data-testid": "test-buttonDrawer",
|
|
@@ -1285,15 +1309,15 @@ var DrawerButton = ({
|
|
|
1285
1309
|
onClick: onToggle,
|
|
1286
1310
|
size: "small",
|
|
1287
1311
|
variant: (_b = buttonDrawer == null ? void 0 : buttonDrawer.variant) != null ? _b : "text",
|
|
1288
|
-
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */
|
|
1289
|
-
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1312
|
+
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : null,
|
|
1313
|
+
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : null
|
|
1290
1314
|
},
|
|
1291
1315
|
(_c = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _c : ""
|
|
1292
1316
|
);
|
|
1293
1317
|
};
|
|
1294
1318
|
|
|
1295
1319
|
// src/Components/Drawer/components/ChipFiltersDisplay.tsx
|
|
1296
|
-
var
|
|
1320
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
1297
1321
|
var import_material6 = require("@mui/material");
|
|
1298
1322
|
var import_ChevronLeft = __toESM(require("@mui/icons-material/ChevronLeft"), 1);
|
|
1299
1323
|
var import_ChevronRight = __toESM(require("@mui/icons-material/ChevronRight"), 1);
|
|
@@ -1301,9 +1325,9 @@ var ChipFiltersDisplay = ({
|
|
|
1301
1325
|
textFilters,
|
|
1302
1326
|
onDeleteFilter
|
|
1303
1327
|
}) => {
|
|
1304
|
-
const scrollRef = (0,
|
|
1305
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
1306
|
-
(0,
|
|
1328
|
+
const scrollRef = (0, import_react13.useRef)(null);
|
|
1329
|
+
const [hasOverflow, setHasOverflow] = (0, import_react13.useState)(false);
|
|
1330
|
+
(0, import_react13.useEffect)(() => {
|
|
1307
1331
|
const el = scrollRef.current;
|
|
1308
1332
|
if (!el) return;
|
|
1309
1333
|
const checkOverflow = () => setHasOverflow(el.scrollWidth > el.clientWidth);
|
|
@@ -1317,7 +1341,7 @@ var ChipFiltersDisplay = ({
|
|
|
1317
1341
|
scrollRef.current.scrollLeft += offset;
|
|
1318
1342
|
}
|
|
1319
1343
|
};
|
|
1320
|
-
return /* @__PURE__ */
|
|
1344
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, (textFilters == null ? void 0 : textFilters.length) > 0 && /* @__PURE__ */ import_react13.default.createElement(import_material6.Box, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, hasOverflow && /* @__PURE__ */ import_react13.default.createElement(import_material6.IconButton, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronLeft.default, { fontSize: "small", color: "action" })), /* @__PURE__ */ import_react13.default.createElement(
|
|
1321
1345
|
import_material6.Box,
|
|
1322
1346
|
{
|
|
1323
1347
|
ref: scrollRef,
|
|
@@ -1329,7 +1353,7 @@ var ChipFiltersDisplay = ({
|
|
|
1329
1353
|
"&::-webkit-scrollbar": { display: "none" }
|
|
1330
1354
|
}
|
|
1331
1355
|
},
|
|
1332
|
-
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */
|
|
1356
|
+
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1333
1357
|
import_material6.Chip,
|
|
1334
1358
|
__spreadProps(__spreadValues({
|
|
1335
1359
|
key: index,
|
|
@@ -1344,15 +1368,15 @@ var ChipFiltersDisplay = ({
|
|
|
1344
1368
|
}
|
|
1345
1369
|
})
|
|
1346
1370
|
))
|
|
1347
|
-
), hasOverflow && /* @__PURE__ */
|
|
1371
|
+
), hasOverflow && /* @__PURE__ */ import_react13.default.createElement(import_material6.IconButton, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronRight.default, { fontSize: "small", color: "action" }))));
|
|
1348
1372
|
};
|
|
1349
1373
|
|
|
1350
1374
|
// src/Components/Drawer/components/DrawerContent.tsx
|
|
1351
|
-
var
|
|
1375
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
1352
1376
|
var import_material12 = require("@mui/material");
|
|
1353
1377
|
|
|
1354
1378
|
// src/Components/Textfield/SCTextField.tsx
|
|
1355
|
-
var
|
|
1379
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
1356
1380
|
var import_material7 = require("@mui/material");
|
|
1357
1381
|
var import_Grid = __toESM(require("@mui/material/Grid"), 1);
|
|
1358
1382
|
var import_icons_material7 = require("@mui/icons-material");
|
|
@@ -1441,13 +1465,13 @@ var SCTextField = ({
|
|
|
1441
1465
|
let IconInputStart;
|
|
1442
1466
|
let IconInputEnd;
|
|
1443
1467
|
let IconTitle;
|
|
1444
|
-
const [showPassword, setShowPassword] = (0,
|
|
1445
|
-
const [error, setError] = (0,
|
|
1446
|
-
const [anchorInfoTitle, setAnchorInfoTitle] = (0,
|
|
1468
|
+
const [showPassword, setShowPassword] = (0, import_react14.useState)(false);
|
|
1469
|
+
const [error, setError] = (0, import_react14.useState)(false);
|
|
1470
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = (0, import_react14.useState)(null);
|
|
1447
1471
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
1448
|
-
const [anchorInfoElement, setAnchorInfoElement] = (0,
|
|
1472
|
+
const [anchorInfoElement, setAnchorInfoElement] = (0, import_react14.useState)(null);
|
|
1449
1473
|
const openInfoElement = Boolean(anchorInfoElement);
|
|
1450
|
-
(0,
|
|
1474
|
+
(0, import_react14.useEffect)(() => {
|
|
1451
1475
|
if (error) {
|
|
1452
1476
|
setTimeout(() => {
|
|
1453
1477
|
setError(false);
|
|
@@ -1497,7 +1521,7 @@ var SCTextField = ({
|
|
|
1497
1521
|
const handleCloseInfoElement = () => {
|
|
1498
1522
|
setAnchorInfoElement(null);
|
|
1499
1523
|
};
|
|
1500
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_material7.Box, { sx: { width } }, /* @__PURE__ */ import_react14.default.createElement(import_Grid.default, { container: true, alignItems: "center", gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ import_react14.default.createElement(import_material7.SvgIcon, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ import_react14.default.createElement(import_material7.Typography, { mx: 0.5, variant: "subtitle2", color: "text.secondary", sx: { marginBottom: "10px" } }, title) : "", infoTitle ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1501
1525
|
import_icons_material7.InfoOutlined,
|
|
1502
1526
|
{
|
|
1503
1527
|
color: "action",
|
|
@@ -1505,7 +1529,7 @@ var SCTextField = ({
|
|
|
1505
1529
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
1506
1530
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
1507
1531
|
}
|
|
1508
|
-
), /* @__PURE__ */
|
|
1532
|
+
), /* @__PURE__ */ import_react14.default.createElement(
|
|
1509
1533
|
import_material7.Popover,
|
|
1510
1534
|
{
|
|
1511
1535
|
sx: {
|
|
@@ -1527,14 +1551,14 @@ var SCTextField = ({
|
|
|
1527
1551
|
},
|
|
1528
1552
|
disableRestoreFocus: true
|
|
1529
1553
|
},
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
)) : /* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ import_react14.default.createElement(import_material7.Typography, { p: 2 }, infoTitle.text)
|
|
1555
|
+
)) : /* @__PURE__ */ import_react14.default.createElement(import_material7.Tooltip, { title: infoTitle.text, "data-testid": "test-infoTitle", placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1532
1556
|
import_icons_material7.InfoOutlined,
|
|
1533
1557
|
{
|
|
1534
1558
|
color: "action",
|
|
1535
1559
|
fontSize: "small"
|
|
1536
1560
|
}
|
|
1537
|
-
))) : ""), /* @__PURE__ */
|
|
1561
|
+
))) : ""), /* @__PURE__ */ import_react14.default.createElement(import_Grid.default, { container: true, sx: { flexWrap: "nowrap", alignItems: "center" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1538
1562
|
import_material7.FormControl,
|
|
1539
1563
|
{
|
|
1540
1564
|
color,
|
|
@@ -1549,7 +1573,7 @@ var SCTextField = ({
|
|
|
1549
1573
|
}
|
|
1550
1574
|
}
|
|
1551
1575
|
},
|
|
1552
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
1553
1577
|
import_material7.InputLabel,
|
|
1554
1578
|
{
|
|
1555
1579
|
"data-testid": "test-label",
|
|
@@ -1566,7 +1590,7 @@ var SCTextField = ({
|
|
|
1566
1590
|
},
|
|
1567
1591
|
label ? label : ""
|
|
1568
1592
|
),
|
|
1569
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
1570
1594
|
InputComponent,
|
|
1571
1595
|
{
|
|
1572
1596
|
size: size ? size : "medium",
|
|
@@ -1582,8 +1606,8 @@ var SCTextField = ({
|
|
|
1582
1606
|
type: !showPassword && format3 === "password" ? "password" : (format3 || "text").toUpperCase() === "INT" || (format3 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
|
|
1583
1607
|
className: format3 === "password" && !showPassword ? "" : "",
|
|
1584
1608
|
placeholder,
|
|
1585
|
-
startAdornment: iconInputStart ? /* @__PURE__ */
|
|
1586
|
-
endAdornment: /* @__PURE__ */
|
|
1609
|
+
startAdornment: iconInputStart ? /* @__PURE__ */ import_react14.default.createElement(import_material7.InputAdornment, { position: "start" }, IconInputStartValidation === "text" ? iconInputStart : IconInputStart ? /* @__PURE__ */ import_react14.default.createElement(IconInputStart, { fontSize: "small" }) : null) : "",
|
|
1610
|
+
endAdornment: /* @__PURE__ */ import_react14.default.createElement(import_material7.InputAdornment, { position: "end" }, format3 === "password" ? /* @__PURE__ */ import_react14.default.createElement(
|
|
1587
1611
|
import_material7.IconButton,
|
|
1588
1612
|
{
|
|
1589
1613
|
"aria-label": "toggle password visibility",
|
|
@@ -1591,8 +1615,8 @@ var SCTextField = ({
|
|
|
1591
1615
|
onMouseDown: handleMouseDownPassword,
|
|
1592
1616
|
edge: "end"
|
|
1593
1617
|
},
|
|
1594
|
-
showPassword ? /* @__PURE__ */
|
|
1595
|
-
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */
|
|
1618
|
+
showPassword ? /* @__PURE__ */ import_react14.default.createElement(import_icons_material7.VisibilityOff, null) : /* @__PURE__ */ import_react14.default.createElement(import_icons_material7.Visibility, null)
|
|
1619
|
+
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1596
1620
|
import_icons_material7.InfoOutlined,
|
|
1597
1621
|
{
|
|
1598
1622
|
"data-testid": "test-infoElement",
|
|
@@ -1603,7 +1627,7 @@ var SCTextField = ({
|
|
|
1603
1627
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
1604
1628
|
onMouseLeave: () => handleCloseInfoElement()
|
|
1605
1629
|
}
|
|
1606
|
-
), /* @__PURE__ */
|
|
1630
|
+
), /* @__PURE__ */ import_react14.default.createElement(
|
|
1607
1631
|
import_material7.Popover,
|
|
1608
1632
|
{
|
|
1609
1633
|
sx: {
|
|
@@ -1625,19 +1649,19 @@ var SCTextField = ({
|
|
|
1625
1649
|
},
|
|
1626
1650
|
disableRestoreFocus: true
|
|
1627
1651
|
},
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
)) : /* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ import_react14.default.createElement(import_material7.Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
1653
|
+
)) : /* @__PURE__ */ import_react14.default.createElement(import_material7.Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1630
1654
|
import_icons_material7.InfoOutlined,
|
|
1631
1655
|
{
|
|
1632
1656
|
color: "action",
|
|
1633
1657
|
fontSize: "small"
|
|
1634
1658
|
}
|
|
1635
|
-
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */
|
|
1659
|
+
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */ import_react14.default.createElement(IconInputEnd, { fontSize: "small" }) : null : ""),
|
|
1636
1660
|
label: label ? label + (format3 === "password" && !showPassword ? "" : "") : "",
|
|
1637
1661
|
autoComplete: format3 === "password" ? "new-password" : "off"
|
|
1638
1662
|
}
|
|
1639
1663
|
)
|
|
1640
|
-
), (iconInputEnd !== void 0 || format3 === "password") && infoElement ? /* @__PURE__ */
|
|
1664
|
+
), (iconInputEnd !== void 0 || format3 === "password") && infoElement ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1641
1665
|
import_icons_material7.InfoOutlined,
|
|
1642
1666
|
{
|
|
1643
1667
|
"data-testid": "test-infoElement",
|
|
@@ -1648,7 +1672,7 @@ var SCTextField = ({
|
|
|
1648
1672
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
1649
1673
|
onMouseLeave: handleCloseInfoElement
|
|
1650
1674
|
}
|
|
1651
|
-
), /* @__PURE__ */
|
|
1675
|
+
), /* @__PURE__ */ import_react14.default.createElement(
|
|
1652
1676
|
import_material7.Popover,
|
|
1653
1677
|
{
|
|
1654
1678
|
sx: { pointerEvents: "none" },
|
|
@@ -1665,8 +1689,8 @@ var SCTextField = ({
|
|
|
1665
1689
|
},
|
|
1666
1690
|
disableRestoreFocus: true
|
|
1667
1691
|
},
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
)) : /* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ import_react14.default.createElement(import_material7.Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
1693
|
+
)) : /* @__PURE__ */ import_react14.default.createElement(import_material7.Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
1670
1694
|
import_icons_material7.InfoOutlined,
|
|
1671
1695
|
{
|
|
1672
1696
|
sx: { marginLeft: "4px" },
|
|
@@ -1686,7 +1710,7 @@ function getIcon2(name) {
|
|
|
1686
1710
|
}
|
|
1687
1711
|
|
|
1688
1712
|
// src/Components/TextArea/SCTextArea.tsx
|
|
1689
|
-
var
|
|
1713
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
1690
1714
|
var import_material8 = require("@mui/material");
|
|
1691
1715
|
var import_icons_material8 = require("@mui/icons-material");
|
|
1692
1716
|
var SCTextArea = ({
|
|
@@ -1710,11 +1734,11 @@ var SCTextArea = ({
|
|
|
1710
1734
|
state,
|
|
1711
1735
|
onBlur
|
|
1712
1736
|
}) => {
|
|
1713
|
-
const [helperCount, setHelperCount] = (0,
|
|
1714
|
-
const [stateError, setStateError] = (0,
|
|
1715
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
1737
|
+
const [helperCount, setHelperCount] = (0, import_react15.useState)(0);
|
|
1738
|
+
const [stateError, setStateError] = (0, import_react15.useState)(false);
|
|
1739
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = import_react15.default.useState(null);
|
|
1716
1740
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
1717
|
-
(0,
|
|
1741
|
+
(0, import_react15.useEffect)(() => {
|
|
1718
1742
|
setHelperCount(state == null ? void 0 : state.length);
|
|
1719
1743
|
}, [state]);
|
|
1720
1744
|
const IconTitle = getIcon2(iconTitle);
|
|
@@ -1736,7 +1760,7 @@ var SCTextArea = ({
|
|
|
1736
1760
|
const handleCloseInfoTitle = () => {
|
|
1737
1761
|
setAnchorInfoTitle(null);
|
|
1738
1762
|
};
|
|
1739
|
-
return /* @__PURE__ */
|
|
1763
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(import_material8.Box, { sx: { width } }, /* @__PURE__ */ import_react15.default.createElement(import_material8.Grid, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ import_react15.default.createElement(import_material8.SvgIcon, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ import_react15.default.createElement(import_material8.Typography, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1740
1764
|
import_icons_material8.InfoOutlined,
|
|
1741
1765
|
{
|
|
1742
1766
|
color: "action",
|
|
@@ -1744,7 +1768,7 @@ var SCTextArea = ({
|
|
|
1744
1768
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
1745
1769
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
1746
1770
|
}
|
|
1747
|
-
), /* @__PURE__ */
|
|
1771
|
+
), /* @__PURE__ */ import_react15.default.createElement(
|
|
1748
1772
|
import_material8.Popover,
|
|
1749
1773
|
{
|
|
1750
1774
|
sx: { pointerEvents: "none" },
|
|
@@ -1761,14 +1785,14 @@ var SCTextArea = ({
|
|
|
1761
1785
|
},
|
|
1762
1786
|
disableRestoreFocus: true
|
|
1763
1787
|
},
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
)) : /* @__PURE__ */
|
|
1788
|
+
/* @__PURE__ */ import_react15.default.createElement(import_material8.Typography, { sx: { p: 2 } }, infoTitle.text)
|
|
1789
|
+
)) : /* @__PURE__ */ import_react15.default.createElement(import_material8.Tooltip, { title: infoTitle.text, placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1766
1790
|
import_icons_material8.InfoOutlined,
|
|
1767
1791
|
{
|
|
1768
1792
|
color: "action",
|
|
1769
1793
|
fontSize: "small"
|
|
1770
1794
|
}
|
|
1771
|
-
))) : ""), /* @__PURE__ */
|
|
1795
|
+
))) : ""), /* @__PURE__ */ import_react15.default.createElement(import_material8.Stack, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1772
1796
|
import_material8.TextField,
|
|
1773
1797
|
{
|
|
1774
1798
|
required,
|
|
@@ -1793,7 +1817,7 @@ var SCTextArea = ({
|
|
|
1793
1817
|
shrink: true
|
|
1794
1818
|
}
|
|
1795
1819
|
}
|
|
1796
|
-
)), /* @__PURE__ */
|
|
1820
|
+
)), /* @__PURE__ */ import_react15.default.createElement(import_material8.Stack, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1797
1821
|
import_material8.Typography,
|
|
1798
1822
|
{
|
|
1799
1823
|
variant: "caption",
|
|
@@ -1807,7 +1831,7 @@ var SCTextArea = ({
|
|
|
1807
1831
|
};
|
|
1808
1832
|
|
|
1809
1833
|
// src/Components/SCSelect.tsx
|
|
1810
|
-
var
|
|
1834
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
1811
1835
|
var import_material9 = require("@mui/material");
|
|
1812
1836
|
var import_Select = __toESM(require("@mui/material/Select"), 1);
|
|
1813
1837
|
var Muicon4 = __toESM(require("@mui/icons-material"), 1);
|
|
@@ -1825,16 +1849,16 @@ function SCSelect({
|
|
|
1825
1849
|
state
|
|
1826
1850
|
}) {
|
|
1827
1851
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
1828
|
-
const [prevData, setPrevData] =
|
|
1829
|
-
const [error, setError] =
|
|
1830
|
-
(0,
|
|
1852
|
+
const [prevData, setPrevData] = import_react16.default.useState(data);
|
|
1853
|
+
const [error, setError] = import_react16.default.useState(false);
|
|
1854
|
+
(0, import_react16.useEffect)(() => {
|
|
1831
1855
|
if (error) {
|
|
1832
1856
|
setTimeout(() => {
|
|
1833
1857
|
setError(false);
|
|
1834
1858
|
}, 1e3);
|
|
1835
1859
|
}
|
|
1836
1860
|
}, [error]);
|
|
1837
|
-
(0,
|
|
1861
|
+
(0, import_react16.useEffect)(() => {
|
|
1838
1862
|
let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
1839
1863
|
if (dataChangeValidation == false) {
|
|
1840
1864
|
setState({ hiddenValue: "", textValue: "" });
|
|
@@ -1868,7 +1892,7 @@ function SCSelect({
|
|
|
1868
1892
|
}
|
|
1869
1893
|
}
|
|
1870
1894
|
};
|
|
1871
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, data && /* @__PURE__ */ import_react16.default.createElement(import_material9.Box, { sx: { width } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1872
1896
|
import_material9.FormControl,
|
|
1873
1897
|
{
|
|
1874
1898
|
fullWidth: true,
|
|
@@ -1876,18 +1900,18 @@ function SCSelect({
|
|
|
1876
1900
|
variant,
|
|
1877
1901
|
sx: { background: background ? background : "transparent" }
|
|
1878
1902
|
},
|
|
1879
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1880
1904
|
import_material9.InputLabel,
|
|
1881
1905
|
{
|
|
1882
1906
|
error
|
|
1883
1907
|
},
|
|
1884
|
-
required ? /* @__PURE__ */
|
|
1908
|
+
required ? /* @__PURE__ */ import_react16.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label
|
|
1885
1909
|
),
|
|
1886
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1887
1911
|
import_Select.default,
|
|
1888
1912
|
{
|
|
1889
1913
|
value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
|
|
1890
|
-
label: required ? /* @__PURE__ */
|
|
1914
|
+
label: required ? /* @__PURE__ */ import_react16.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
1891
1915
|
onChange: handleChange,
|
|
1892
1916
|
onBlur: handleBlur,
|
|
1893
1917
|
variant,
|
|
@@ -1918,19 +1942,19 @@ function SCSelect({
|
|
|
1918
1942
|
}
|
|
1919
1943
|
},
|
|
1920
1944
|
data.map((option, index) => {
|
|
1921
|
-
return /* @__PURE__ */
|
|
1945
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_material9.MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ import_react16.default.createElement(import_material9.ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ import_react16.default.createElement(import_material9.SvgIcon, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ import_react16.default.createElement(import_material9.ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
|
|
1922
1946
|
})
|
|
1923
1947
|
)
|
|
1924
1948
|
)));
|
|
1925
1949
|
}
|
|
1926
1950
|
|
|
1927
1951
|
// src/Components/SCAutocomplete.tsx
|
|
1928
|
-
var
|
|
1952
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
1929
1953
|
var import_material10 = require("@mui/material");
|
|
1930
1954
|
var import_icons_material9 = require("@mui/icons-material");
|
|
1931
1955
|
var Muicon5 = __toESM(require("@mui/icons-material"), 1);
|
|
1932
1956
|
var StopEvent = ({ children }) => {
|
|
1933
|
-
return /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1934
1958
|
import_material10.Box,
|
|
1935
1959
|
{
|
|
1936
1960
|
onMouseDown: (e) => {
|
|
@@ -1969,12 +1993,12 @@ function SCAutocomplete({
|
|
|
1969
1993
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
1970
1994
|
let group = "";
|
|
1971
1995
|
let isSelected = false;
|
|
1972
|
-
const [selectedOptions, setSelectedOptions] =
|
|
1973
|
-
const [prevData, setPrevData] =
|
|
1974
|
-
const [originalData, setOriginalData] =
|
|
1975
|
-
const [inputValue, setInputValue] =
|
|
1976
|
-
const [isUserTyping, setIsUserTyping] =
|
|
1977
|
-
(0,
|
|
1996
|
+
const [selectedOptions, setSelectedOptions] = import_react17.default.useState([]);
|
|
1997
|
+
const [prevData, setPrevData] = import_react17.default.useState(data);
|
|
1998
|
+
const [originalData, setOriginalData] = import_react17.default.useState(data);
|
|
1999
|
+
const [inputValue, setInputValue] = import_react17.default.useState("");
|
|
2000
|
+
const [isUserTyping, setIsUserTyping] = import_react17.default.useState(false);
|
|
2001
|
+
(0, import_react17.useEffect)(() => {
|
|
1978
2002
|
const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
1979
2003
|
if (!dataChangeValidation && !isUserTyping) {
|
|
1980
2004
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
@@ -1985,7 +2009,7 @@ function SCAutocomplete({
|
|
|
1985
2009
|
}
|
|
1986
2010
|
setPrevData(data);
|
|
1987
2011
|
}, [data, isUserTyping]);
|
|
1988
|
-
(0,
|
|
2012
|
+
(0, import_react17.useEffect)(() => {
|
|
1989
2013
|
if (typeFormat == "multiselect") {
|
|
1990
2014
|
if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
|
|
1991
2015
|
const newSelectedOptions = originalData.filter(
|
|
@@ -1995,7 +2019,7 @@ function SCAutocomplete({
|
|
|
1995
2019
|
}
|
|
1996
2020
|
}
|
|
1997
2021
|
}, [state.hiddenValue, originalData, typeFormat]);
|
|
1998
|
-
(0,
|
|
2022
|
+
(0, import_react17.useEffect)(() => {
|
|
1999
2023
|
if (inputValue === "") {
|
|
2000
2024
|
setIsUserTyping(false);
|
|
2001
2025
|
}
|
|
@@ -2010,7 +2034,7 @@ function SCAutocomplete({
|
|
|
2010
2034
|
textValue: newSelected.length > 0 ? newSelected.map((item) => getItemValue(item).text) : ""
|
|
2011
2035
|
});
|
|
2012
2036
|
};
|
|
2013
|
-
const normalizedData = (0,
|
|
2037
|
+
const normalizedData = (0, import_react17.useMemo)(() => {
|
|
2014
2038
|
return data.map((option) => {
|
|
2015
2039
|
if ((option == null ? void 0 : option.icon) && option.icon.type === void 0) {
|
|
2016
2040
|
return __spreadProps(__spreadValues({}, option), {
|
|
@@ -2064,16 +2088,16 @@ function SCAutocomplete({
|
|
|
2064
2088
|
const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
|
|
2065
2089
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
2066
2090
|
) || null;
|
|
2067
|
-
const [open, setOpen] =
|
|
2068
|
-
const componentClickActiveRef =
|
|
2069
|
-
const listboxScrollRef =
|
|
2070
|
-
const containerRef =
|
|
2071
|
-
const [chipLimit, setChipLimit] =
|
|
2072
|
-
const outsideChipsMeasureRef =
|
|
2073
|
-
const [visibleChipCount, setVisibleChipCount] =
|
|
2074
|
-
const [popoverAnchor, setPopoverAnchor] =
|
|
2075
|
-
const popoverTimerRef =
|
|
2076
|
-
(0,
|
|
2091
|
+
const [open, setOpen] = import_react17.default.useState(false);
|
|
2092
|
+
const componentClickActiveRef = import_react17.default.useRef(false);
|
|
2093
|
+
const listboxScrollRef = import_react17.default.useRef(null);
|
|
2094
|
+
const containerRef = import_react17.default.useRef(null);
|
|
2095
|
+
const [chipLimit, setChipLimit] = import_react17.default.useState(2);
|
|
2096
|
+
const outsideChipsMeasureRef = import_react17.default.useRef(null);
|
|
2097
|
+
const [visibleChipCount, setVisibleChipCount] = import_react17.default.useState(Number.MAX_SAFE_INTEGER);
|
|
2098
|
+
const [popoverAnchor, setPopoverAnchor] = import_react17.default.useState(null);
|
|
2099
|
+
const popoverTimerRef = import_react17.default.useRef(null);
|
|
2100
|
+
(0, import_react17.useEffect)(() => {
|
|
2077
2101
|
const el = containerRef.current;
|
|
2078
2102
|
if (!el) return;
|
|
2079
2103
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -2084,7 +2108,7 @@ function SCAutocomplete({
|
|
|
2084
2108
|
observer.observe(el);
|
|
2085
2109
|
return () => observer.disconnect();
|
|
2086
2110
|
}, []);
|
|
2087
|
-
(0,
|
|
2111
|
+
(0, import_react17.useEffect)(() => {
|
|
2088
2112
|
if (!chipOutside || typeFormat !== "multiselect") return;
|
|
2089
2113
|
const box = outsideChipsMeasureRef.current;
|
|
2090
2114
|
if (!box) return;
|
|
@@ -2104,7 +2128,7 @@ function SCAutocomplete({
|
|
|
2104
2128
|
observer.observe(box);
|
|
2105
2129
|
return () => observer.disconnect();
|
|
2106
2130
|
}, [selectedOptions, chipOutside, typeFormat]);
|
|
2107
|
-
(0,
|
|
2131
|
+
(0, import_react17.useEffect)(() => {
|
|
2108
2132
|
const displayCount = Math.min(visibleChipCount, selectedOptions.length);
|
|
2109
2133
|
if (selectedOptions.length - displayCount === 0) {
|
|
2110
2134
|
setPopoverAnchor(null);
|
|
@@ -2128,13 +2152,13 @@ function SCAutocomplete({
|
|
|
2128
2152
|
if (!(chipOutside == null ? void 0 : chipOutside.textSeccion)) return optionText.charAt(0).toUpperCase();
|
|
2129
2153
|
return chipOutside.textSeccion.split(",").map((p) => optionText.charAt(Number(p.trim())).toUpperCase()).join("");
|
|
2130
2154
|
};
|
|
2131
|
-
const hayOnComponentClickGlobal = (0,
|
|
2155
|
+
const hayOnComponentClickGlobal = (0, import_react17.useMemo)(() => {
|
|
2132
2156
|
return data.some((opt) => {
|
|
2133
2157
|
const item = getItemValue(opt);
|
|
2134
2158
|
return Boolean(item.onComponentClick);
|
|
2135
2159
|
});
|
|
2136
2160
|
}, [data, getItemValue]);
|
|
2137
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, data && /* @__PURE__ */ import_react17.default.createElement(import_material10.Box, { ref: containerRef, sx: { width } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2138
2162
|
import_material10.Autocomplete,
|
|
2139
2163
|
__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { disableCloseOnSelect: true } : {}), hayOnComponentClickGlobal ? { blurOnSelect: false } : {}), hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
2140
2164
|
onClose: (event2, reason) => {
|
|
@@ -2167,9 +2191,9 @@ function SCAutocomplete({
|
|
|
2167
2191
|
limitTags: chipLimit,
|
|
2168
2192
|
renderTags: chipOutside ? () => null : (value, getTagProps) => {
|
|
2169
2193
|
const limit = chipLimit;
|
|
2170
|
-
return /* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, value.slice(0, limit).map((option, index) => {
|
|
2171
2195
|
const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
|
|
2172
|
-
return /* @__PURE__ */
|
|
2196
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
2173
2197
|
import_material10.Chip,
|
|
2174
2198
|
__spreadProps(__spreadValues({
|
|
2175
2199
|
key,
|
|
@@ -2181,7 +2205,7 @@ function SCAutocomplete({
|
|
|
2181
2205
|
style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
2182
2206
|
})
|
|
2183
2207
|
);
|
|
2184
|
-
}), value.length > limit && /* @__PURE__ */
|
|
2208
|
+
}), value.length > limit && /* @__PURE__ */ import_react17.default.createElement(import_material10.Box, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
|
|
2185
2209
|
},
|
|
2186
2210
|
renderOption: (props, option) => {
|
|
2187
2211
|
const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
|
|
@@ -2200,7 +2224,7 @@ function SCAutocomplete({
|
|
|
2200
2224
|
group = option[columnGroup];
|
|
2201
2225
|
}
|
|
2202
2226
|
const item = getItemValue(option);
|
|
2203
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ import_react17.default.createElement(import_material10.Typography, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ import_react17.default.createElement(
|
|
2204
2228
|
import_material10.MenuItem,
|
|
2205
2229
|
__spreadProps(__spreadValues({}, optionProps), {
|
|
2206
2230
|
component: "li",
|
|
@@ -2211,8 +2235,8 @@ function SCAutocomplete({
|
|
|
2211
2235
|
opacity: isDisabled ? 0.5 : 1
|
|
2212
2236
|
}
|
|
2213
2237
|
}),
|
|
2214
|
-
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */
|
|
2215
|
-
typeFormat == "multiselect" ? /* @__PURE__ */
|
|
2238
|
+
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ import_react17.default.createElement(import_material10.ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ import_react17.default.createElement(import_material10.SvgIcon, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
|
|
2239
|
+
typeFormat == "multiselect" ? /* @__PURE__ */ import_react17.default.createElement(
|
|
2216
2240
|
import_material10.Checkbox,
|
|
2217
2241
|
{
|
|
2218
2242
|
checked: isSelected,
|
|
@@ -2221,8 +2245,8 @@ function SCAutocomplete({
|
|
|
2221
2245
|
color: "primary"
|
|
2222
2246
|
}
|
|
2223
2247
|
) : "",
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
item.component != null ? /* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ import_react17.default.createElement(import_material10.ListItemText, { primary: getItemValue(option).text, color: "text.primary" }),
|
|
2249
|
+
item.component != null ? /* @__PURE__ */ import_react17.default.createElement(StopEvent, null, /* @__PURE__ */ import_react17.default.createElement(
|
|
2226
2250
|
"span",
|
|
2227
2251
|
{
|
|
2228
2252
|
onMouseDown: (event2) => {
|
|
@@ -2253,7 +2277,7 @@ function SCAutocomplete({
|
|
|
2253
2277
|
)) : null
|
|
2254
2278
|
)));
|
|
2255
2279
|
},
|
|
2256
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2280
|
+
renderInput: (params) => /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(
|
|
2257
2281
|
import_material10.TextField,
|
|
2258
2282
|
__spreadProps(__spreadValues({
|
|
2259
2283
|
sx: {
|
|
@@ -2265,10 +2289,10 @@ function SCAutocomplete({
|
|
|
2265
2289
|
}
|
|
2266
2290
|
}
|
|
2267
2291
|
}, params), {
|
|
2268
|
-
label: required ? /* @__PURE__ */
|
|
2292
|
+
label: required ? /* @__PURE__ */ import_react17.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
2269
2293
|
placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
|
|
2270
2294
|
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
2271
|
-
endAdornment: /* @__PURE__ */
|
|
2295
|
+
endAdornment: /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, deleteType == "icon" && (state.hiddenValue.toString() != "-1" && state.hiddenValue.toString() != "") ? /* @__PURE__ */ import_react17.default.createElement(import_material10.IconButton, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ import_react17.default.createElement(import_icons_material9.Clear, { fontSize: "small" })) : "", /* @__PURE__ */ import_react17.default.createElement(import_material10.InputAdornment, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ import_react17.default.createElement(import_icons_material9.Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
|
|
2272
2296
|
})
|
|
2273
2297
|
})
|
|
2274
2298
|
)),
|
|
@@ -2280,8 +2304,8 @@ function SCAutocomplete({
|
|
|
2280
2304
|
}
|
|
2281
2305
|
},
|
|
2282
2306
|
listbox: {
|
|
2283
|
-
component:
|
|
2284
|
-
return /* @__PURE__ */
|
|
2307
|
+
component: import_react17.default.forwardRef(function ListboxComponent(props, ref) {
|
|
2308
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(
|
|
2285
2309
|
import_material10.Box,
|
|
2286
2310
|
__spreadProps(__spreadValues({
|
|
2287
2311
|
ref: (node) => {
|
|
@@ -2296,9 +2320,9 @@ function SCAutocomplete({
|
|
|
2296
2320
|
backgroundColor: "white"
|
|
2297
2321
|
}, props.sx)
|
|
2298
2322
|
}),
|
|
2299
|
-
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */
|
|
2323
|
+
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, null, /* @__PURE__ */ import_react17.default.createElement(import_material10.FormControlLabel, { control: /* @__PURE__ */ import_react17.default.createElement(import_material10.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__ */ import_react17.default.createElement(import_material10.Divider, null)) : "",
|
|
2300
2324
|
props.children,
|
|
2301
|
-
deleteType == "button" || fnAplicar ? /* @__PURE__ */
|
|
2325
|
+
deleteType == "button" || fnAplicar ? /* @__PURE__ */ import_react17.default.createElement(
|
|
2302
2326
|
import_material10.Grid,
|
|
2303
2327
|
{
|
|
2304
2328
|
container: true,
|
|
@@ -2313,7 +2337,7 @@ function SCAutocomplete({
|
|
|
2313
2337
|
justifyContent: "space-between"
|
|
2314
2338
|
}
|
|
2315
2339
|
},
|
|
2316
|
-
deleteType == "button" ? /* @__PURE__ */
|
|
2340
|
+
deleteType == "button" ? /* @__PURE__ */ import_react17.default.createElement(
|
|
2317
2341
|
import_material10.Button,
|
|
2318
2342
|
{
|
|
2319
2343
|
variant: "text",
|
|
@@ -2327,7 +2351,7 @@ function SCAutocomplete({
|
|
|
2327
2351
|
},
|
|
2328
2352
|
"Limpiar"
|
|
2329
2353
|
) : "",
|
|
2330
|
-
fnAplicar && /* @__PURE__ */
|
|
2354
|
+
fnAplicar && /* @__PURE__ */ import_react17.default.createElement(
|
|
2331
2355
|
import_material10.Button,
|
|
2332
2356
|
{
|
|
2333
2357
|
variant: "contained",
|
|
@@ -2346,7 +2370,7 @@ function SCAutocomplete({
|
|
|
2346
2370
|
), chipOutside && typeFormat === "multiselect" && selectedOptions.length > 0 && (() => {
|
|
2347
2371
|
const displayCount = Math.min(visibleChipCount, selectedOptions.length);
|
|
2348
2372
|
const hiddenCount = selectedOptions.length - displayCount;
|
|
2349
|
-
return /* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_material10.Box, { sx: { position: "relative", mt: 0.5 } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2350
2374
|
import_material10.Box,
|
|
2351
2375
|
{
|
|
2352
2376
|
ref: outsideChipsMeasureRef,
|
|
@@ -2365,17 +2389,17 @@ function SCAutocomplete({
|
|
|
2365
2389
|
},
|
|
2366
2390
|
selectedOptions.map((option) => {
|
|
2367
2391
|
const avatarText = resolveAvatarText(option);
|
|
2368
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { key: getItemValue(option).value, "data-outside-chip": true, style: { display: "inline-flex" } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2369
2393
|
import_material10.Chip,
|
|
2370
2394
|
__spreadValues({
|
|
2371
2395
|
size: "medium",
|
|
2372
2396
|
label: getItemValue(option).text
|
|
2373
|
-
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */
|
|
2397
|
+
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */ import_react17.default.createElement(import_material10.Avatar, null, avatarText) } : {})
|
|
2374
2398
|
));
|
|
2375
2399
|
})
|
|
2376
|
-
), /* @__PURE__ */
|
|
2400
|
+
), /* @__PURE__ */ import_react17.default.createElement(import_material10.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5, maxHeight: 36, overflow: "hidden" } }, selectedOptions.slice(0, displayCount).map((option) => {
|
|
2377
2401
|
const avatarText = resolveAvatarText(option);
|
|
2378
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
2379
2403
|
import_material10.Chip,
|
|
2380
2404
|
__spreadValues({
|
|
2381
2405
|
key: getItemValue(option).value,
|
|
@@ -2384,9 +2408,9 @@ function SCAutocomplete({
|
|
|
2384
2408
|
variant: "filled",
|
|
2385
2409
|
label: getItemValue(option).text,
|
|
2386
2410
|
onDelete: () => handleDeleteChip(option)
|
|
2387
|
-
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */
|
|
2411
|
+
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */ import_react17.default.createElement(import_material10.Avatar, null, avatarText) } : {})
|
|
2388
2412
|
);
|
|
2389
|
-
}), hiddenCount > 0 && /* @__PURE__ */
|
|
2413
|
+
}), hiddenCount > 0 && /* @__PURE__ */ import_react17.default.createElement(
|
|
2390
2414
|
import_material10.Box,
|
|
2391
2415
|
{
|
|
2392
2416
|
onMouseEnter: handlePlusEnter,
|
|
@@ -2394,7 +2418,7 @@ function SCAutocomplete({
|
|
|
2394
2418
|
sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center", cursor: "default" }
|
|
2395
2419
|
},
|
|
2396
2420
|
`+${hiddenCount}`
|
|
2397
|
-
)), /* @__PURE__ */
|
|
2421
|
+
)), /* @__PURE__ */ import_react17.default.createElement(
|
|
2398
2422
|
import_material10.Popper,
|
|
2399
2423
|
{
|
|
2400
2424
|
open: Boolean(popoverAnchor),
|
|
@@ -2402,7 +2426,7 @@ function SCAutocomplete({
|
|
|
2402
2426
|
placement: "bottom-start",
|
|
2403
2427
|
sx: { zIndex: 1500 }
|
|
2404
2428
|
},
|
|
2405
|
-
/* @__PURE__ */
|
|
2429
|
+
/* @__PURE__ */ import_react17.default.createElement(
|
|
2406
2430
|
import_material10.Paper,
|
|
2407
2431
|
{
|
|
2408
2432
|
elevation: 3,
|
|
@@ -2412,7 +2436,7 @@ function SCAutocomplete({
|
|
|
2412
2436
|
},
|
|
2413
2437
|
selectedOptions.slice(displayCount).map((option) => {
|
|
2414
2438
|
const avatarText = resolveAvatarText(option);
|
|
2415
|
-
return /* @__PURE__ */
|
|
2439
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
2416
2440
|
import_material10.Chip,
|
|
2417
2441
|
__spreadValues({
|
|
2418
2442
|
key: getItemValue(option).value,
|
|
@@ -2421,7 +2445,7 @@ function SCAutocomplete({
|
|
|
2421
2445
|
variant: "filled",
|
|
2422
2446
|
label: getItemValue(option).text,
|
|
2423
2447
|
onDelete: () => handleDeleteChip(option)
|
|
2424
|
-
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */
|
|
2448
|
+
}, chipOutside.type === "avatar" ? { avatar: /* @__PURE__ */ import_react17.default.createElement(import_material10.Avatar, { sx: { fontSize: avatarText.length > 1 ? "0.55rem" : "0.75rem" } }, avatarText) } : {})
|
|
2425
2449
|
);
|
|
2426
2450
|
})
|
|
2427
2451
|
)
|
|
@@ -2430,14 +2454,14 @@ function SCAutocomplete({
|
|
|
2430
2454
|
}
|
|
2431
2455
|
|
|
2432
2456
|
// src/Components/SCDateRange.tsx
|
|
2433
|
-
var
|
|
2457
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
2434
2458
|
var import_material11 = require("@mui/material");
|
|
2435
2459
|
var import_LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
2436
2460
|
var import_AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
|
|
2437
2461
|
var import_DateRangePicker = require("@mui/x-date-pickers-pro/DateRangePicker");
|
|
2438
2462
|
var import_MultiInputDateRangeField = require("@mui/x-date-pickers-pro/MultiInputDateRangeField");
|
|
2439
2463
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
2440
|
-
var
|
|
2464
|
+
var import_es2 = require("dayjs/locale/es");
|
|
2441
2465
|
var import_x_license = require("@mui/x-license");
|
|
2442
2466
|
var import_InsertInvitationOutlined = __toESM(require("@mui/icons-material/InsertInvitationOutlined"), 1);
|
|
2443
2467
|
var SCDateRange = ({
|
|
@@ -2455,7 +2479,7 @@ var SCDateRange = ({
|
|
|
2455
2479
|
const isStartEmpty = required && !state[0];
|
|
2456
2480
|
const isEndEmpty = required && !state[1];
|
|
2457
2481
|
const hasError = isStartEmpty || isEndEmpty;
|
|
2458
|
-
const [notification, setNotification] =
|
|
2482
|
+
const [notification, setNotification] = import_react18.default.useState(false);
|
|
2459
2483
|
const handleDateChange = (newValue) => {
|
|
2460
2484
|
const minDateDayjs = (0, import_dayjs.default)("2013-01-01");
|
|
2461
2485
|
const convertedValue = [
|
|
@@ -2499,7 +2523,7 @@ var SCDateRange = ({
|
|
|
2499
2523
|
setState(convertedValue);
|
|
2500
2524
|
}
|
|
2501
2525
|
};
|
|
2502
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_LocalizationProvider.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react18.default.createElement(import_material11.Box, { sx: { width: "100%" } }, /* @__PURE__ */ import_react18.default.createElement(
|
|
2503
2527
|
import_DateRangePicker.DateRangePicker,
|
|
2504
2528
|
{
|
|
2505
2529
|
value: state,
|
|
@@ -2523,7 +2547,7 @@ var SCDateRange = ({
|
|
|
2523
2547
|
required,
|
|
2524
2548
|
error: isStart ? isStartEmpty : isEndEmpty,
|
|
2525
2549
|
InputProps: {
|
|
2526
|
-
endAdornment: /* @__PURE__ */
|
|
2550
|
+
endAdornment: /* @__PURE__ */ import_react18.default.createElement(import_material11.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
2527
2551
|
import_InsertInvitationOutlined.default,
|
|
2528
2552
|
{
|
|
2529
2553
|
color: hasError ? "error" : "action",
|
|
@@ -2559,11 +2583,11 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2559
2583
|
var _a, _b, _c, _d, _e, _f;
|
|
2560
2584
|
const key = `Stack_${(_a = arrayElement.type) != null ? _a : ""} ${(_b = arrayElement.label) != null ? _b : ""}${index}`;
|
|
2561
2585
|
if (arrayElement.component) {
|
|
2562
|
-
return /* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_material12.Stack, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component);
|
|
2563
2587
|
}
|
|
2564
2588
|
switch (arrayElement.type) {
|
|
2565
2589
|
case "textField":
|
|
2566
|
-
return /* @__PURE__ */
|
|
2590
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2567
2591
|
SCTextField,
|
|
2568
2592
|
{
|
|
2569
2593
|
title: arrayElement.title,
|
|
@@ -2591,7 +2615,7 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2591
2615
|
}
|
|
2592
2616
|
);
|
|
2593
2617
|
case "textArea":
|
|
2594
|
-
return /* @__PURE__ */
|
|
2618
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2595
2619
|
SCTextArea,
|
|
2596
2620
|
{
|
|
2597
2621
|
title: arrayElement.title,
|
|
@@ -2612,7 +2636,7 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2612
2636
|
}
|
|
2613
2637
|
);
|
|
2614
2638
|
case "autocomplete":
|
|
2615
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2616
2640
|
SCAutocomplete,
|
|
2617
2641
|
{
|
|
2618
2642
|
label: arrayElement.label,
|
|
@@ -2632,7 +2656,7 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2632
2656
|
}
|
|
2633
2657
|
);
|
|
2634
2658
|
case "select":
|
|
2635
|
-
return /* @__PURE__ */
|
|
2659
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2636
2660
|
SCSelect,
|
|
2637
2661
|
{
|
|
2638
2662
|
label: arrayElement.label,
|
|
@@ -2650,7 +2674,7 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2650
2674
|
}
|
|
2651
2675
|
);
|
|
2652
2676
|
case "dateRange":
|
|
2653
|
-
return /* @__PURE__ */
|
|
2677
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2654
2678
|
SCDateRange,
|
|
2655
2679
|
{
|
|
2656
2680
|
labelDateInitial: arrayElement.labelDateInitial,
|
|
@@ -2666,9 +2690,9 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2666
2690
|
return null;
|
|
2667
2691
|
}
|
|
2668
2692
|
};
|
|
2669
|
-
return /* @__PURE__ */
|
|
2693
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_material12.Stack, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
|
|
2670
2694
|
var _a, _b;
|
|
2671
|
-
return /* @__PURE__ */
|
|
2695
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2672
2696
|
import_material12.Box,
|
|
2673
2697
|
{
|
|
2674
2698
|
key: `Stack_${(_a = arrayElement.type) != null ? _a : ""} ${(_b = arrayElement.label) != null ? _b : ""}${index}`,
|
|
@@ -2680,7 +2704,7 @@ var DrawerContent = ({ arrayElements }) => {
|
|
|
2680
2704
|
};
|
|
2681
2705
|
|
|
2682
2706
|
// src/Components/Drawer/components/DrawerActions.tsx
|
|
2683
|
-
var
|
|
2707
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
2684
2708
|
var import_material13 = require("@mui/material");
|
|
2685
2709
|
var import_Grid2 = __toESM(require("@mui/material/Grid"), 1);
|
|
2686
2710
|
var DrawerActions = ({ actions, anchor }) => {
|
|
@@ -2690,7 +2714,7 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2690
2714
|
if (!Array.isArray(actions) || actions.length === 0) {
|
|
2691
2715
|
return null;
|
|
2692
2716
|
}
|
|
2693
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2694
2718
|
import_Grid2.default,
|
|
2695
2719
|
{
|
|
2696
2720
|
sx: { borderTop: 1, borderColor: "#1018403B", zIndex: 1500 },
|
|
@@ -2703,7 +2727,7 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2703
2727
|
justifyContent: actions.length > 1 ? "space-between" : "flex-start",
|
|
2704
2728
|
flexDirection: "row-reverse"
|
|
2705
2729
|
},
|
|
2706
|
-
actions.map((btn, index) => /* @__PURE__ */
|
|
2730
|
+
actions.map((btn, index) => /* @__PURE__ */ import_react20.default.createElement(
|
|
2707
2731
|
import_material13.Button,
|
|
2708
2732
|
{
|
|
2709
2733
|
key: index,
|
|
@@ -2720,7 +2744,7 @@ var DrawerActions = ({ actions, anchor }) => {
|
|
|
2720
2744
|
};
|
|
2721
2745
|
|
|
2722
2746
|
// src/Components/Drawer/components/DrawerHeader.tsx
|
|
2723
|
-
var
|
|
2747
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
2724
2748
|
var import_material14 = require("@mui/material");
|
|
2725
2749
|
var import_Grid3 = __toESM(require("@mui/material/Grid"), 1);
|
|
2726
2750
|
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
@@ -2731,7 +2755,7 @@ var DrawerHeader = ({
|
|
|
2731
2755
|
filterSideCard,
|
|
2732
2756
|
type = "Drawer"
|
|
2733
2757
|
}) => {
|
|
2734
|
-
return /* @__PURE__ */
|
|
2758
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
2735
2759
|
import_Grid3.default,
|
|
2736
2760
|
{
|
|
2737
2761
|
container: true,
|
|
@@ -2746,8 +2770,8 @@ var DrawerHeader = ({
|
|
|
2746
2770
|
alignContent: "center"
|
|
2747
2771
|
}
|
|
2748
2772
|
},
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
filterSideCard ? /* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ import_react21.default.createElement(import_material14.Typography, { variant: filterSideCard ? "body2" : "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda aqui"),
|
|
2774
|
+
filterSideCard ? /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, filterSideCard) : /* @__PURE__ */ import_react21.default.createElement(import_material14.IconButton, { onClick: onClose }, /* @__PURE__ */ import_react21.default.createElement(import_Close.default, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))
|
|
2751
2775
|
);
|
|
2752
2776
|
};
|
|
2753
2777
|
|
|
@@ -2809,7 +2833,7 @@ function SCDrawer({
|
|
|
2809
2833
|
];
|
|
2810
2834
|
};
|
|
2811
2835
|
const drawerActions = getActions();
|
|
2812
|
-
return /* @__PURE__ */
|
|
2836
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, toast && /* @__PURE__ */ import_react22.default.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ import_react22.default.createElement(
|
|
2813
2837
|
import_Grid4.default,
|
|
2814
2838
|
{
|
|
2815
2839
|
container: true,
|
|
@@ -2818,21 +2842,21 @@ function SCDrawer({
|
|
|
2818
2842
|
alignItems: "center",
|
|
2819
2843
|
sx: { width: "100%" }
|
|
2820
2844
|
},
|
|
2821
|
-
shouldShowChips && /* @__PURE__ */
|
|
2845
|
+
shouldShowChips && /* @__PURE__ */ import_react22.default.createElement(
|
|
2822
2846
|
ChipFiltersDisplay,
|
|
2823
2847
|
{
|
|
2824
2848
|
textFilters,
|
|
2825
2849
|
onDeleteFilter: handleDeleteFilter
|
|
2826
2850
|
}
|
|
2827
2851
|
),
|
|
2828
|
-
buttonDrawer && /* @__PURE__ */
|
|
2852
|
+
buttonDrawer && /* @__PURE__ */ import_react22.default.createElement(
|
|
2829
2853
|
DrawerButton,
|
|
2830
2854
|
{
|
|
2831
2855
|
buttonDrawer,
|
|
2832
2856
|
onToggle: toggleDrawer(true)
|
|
2833
2857
|
}
|
|
2834
2858
|
)
|
|
2835
|
-
), type != "Swipeable" ? /* @__PURE__ */
|
|
2859
|
+
), type != "Swipeable" ? /* @__PURE__ */ import_react22.default.createElement(
|
|
2836
2860
|
import_material15.Drawer,
|
|
2837
2861
|
{
|
|
2838
2862
|
open: drawerOpen,
|
|
@@ -2870,7 +2894,7 @@ function SCDrawer({
|
|
|
2870
2894
|
}
|
|
2871
2895
|
}
|
|
2872
2896
|
},
|
|
2873
|
-
/* @__PURE__ */
|
|
2897
|
+
/* @__PURE__ */ import_react22.default.createElement(import_material15.Stack, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
2874
2898
|
DrawerHeader,
|
|
2875
2899
|
{
|
|
2876
2900
|
title,
|
|
@@ -2879,8 +2903,8 @@ function SCDrawer({
|
|
|
2879
2903
|
filterSideCard,
|
|
2880
2904
|
type
|
|
2881
2905
|
}
|
|
2882
|
-
), /* @__PURE__ */
|
|
2883
|
-
) : /* @__PURE__ */
|
|
2906
|
+
), /* @__PURE__ */ import_react22.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react22.default.createElement(DrawerActions, { actions: drawerActions, anchor }))
|
|
2907
|
+
) : /* @__PURE__ */ import_react22.default.createElement(
|
|
2884
2908
|
import_material15.SwipeableDrawer,
|
|
2885
2909
|
{
|
|
2886
2910
|
open: drawerOpen,
|
|
@@ -2908,7 +2932,7 @@ function SCDrawer({
|
|
|
2908
2932
|
}
|
|
2909
2933
|
}
|
|
2910
2934
|
},
|
|
2911
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
2912
2936
|
import_material15.Box,
|
|
2913
2937
|
{
|
|
2914
2938
|
sx: {
|
|
@@ -2922,7 +2946,7 @@ function SCDrawer({
|
|
|
2922
2946
|
}
|
|
2923
2947
|
}
|
|
2924
2948
|
),
|
|
2925
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ import_react22.default.createElement(import_material15.Stack, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
2926
2950
|
DrawerHeader,
|
|
2927
2951
|
{
|
|
2928
2952
|
title,
|
|
@@ -2930,7 +2954,7 @@ function SCDrawer({
|
|
|
2930
2954
|
onClose: handleDrawerClose,
|
|
2931
2955
|
type
|
|
2932
2956
|
}
|
|
2933
|
-
), /* @__PURE__ */
|
|
2957
|
+
), /* @__PURE__ */ import_react22.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react22.default.createElement(
|
|
2934
2958
|
import_Grid4.default,
|
|
2935
2959
|
{
|
|
2936
2960
|
sx: { zIndex: 1500 },
|
|
@@ -2943,7 +2967,7 @@ function SCDrawer({
|
|
|
2943
2967
|
justifyContent: Array.isArray(drawerActions) && drawerActions.length > 1 ? "space-between" : "flex-end",
|
|
2944
2968
|
flexDirection: "row-reverse"
|
|
2945
2969
|
},
|
|
2946
|
-
Array.isArray(drawerActions) && drawerActions.map((btn, index) => /* @__PURE__ */
|
|
2970
|
+
Array.isArray(drawerActions) && drawerActions.map((btn, index) => /* @__PURE__ */ import_react22.default.createElement(
|
|
2947
2971
|
import_material15.Button,
|
|
2948
2972
|
{
|
|
2949
2973
|
key: index,
|
|
@@ -2975,14 +2999,14 @@ var AttachmentMobile = ({
|
|
|
2975
2999
|
iconFileItem,
|
|
2976
3000
|
onFileClick
|
|
2977
3001
|
}) => {
|
|
2978
|
-
const webcamRef = (0,
|
|
2979
|
-
const [abrirCamara, setAbrirCamara] = (0,
|
|
2980
|
-
const [capturedImage, setCapturedImage] = (0,
|
|
2981
|
-
const [files, setFiles] = (0,
|
|
2982
|
-
const [fileToDelete, setFileToDelete] = (0,
|
|
2983
|
-
const [openDrawerDelete, setOpenDrawerDelete] = (0,
|
|
2984
|
-
const [toast, setToast] = (0,
|
|
2985
|
-
const [open, setOpen] =
|
|
3002
|
+
const webcamRef = (0, import_react23.useRef)(null);
|
|
3003
|
+
const [abrirCamara, setAbrirCamara] = (0, import_react23.useState)(false);
|
|
3004
|
+
const [capturedImage, setCapturedImage] = (0, import_react23.useState)(null);
|
|
3005
|
+
const [files, setFiles] = (0, import_react23.useState)([]);
|
|
3006
|
+
const [fileToDelete, setFileToDelete] = (0, import_react23.useState)(null);
|
|
3007
|
+
const [openDrawerDelete, setOpenDrawerDelete] = (0, import_react23.useState)(false);
|
|
3008
|
+
const [toast, setToast] = (0, import_react23.useState)({ open: false, mensaje: "", type: "success" });
|
|
3009
|
+
const [open, setOpen] = import_react23.default.useState(false);
|
|
2986
3010
|
const toggleAttachment = (newOpen) => () => {
|
|
2987
3011
|
setOpen(newOpen);
|
|
2988
3012
|
};
|
|
@@ -3002,7 +3026,7 @@ var AttachmentMobile = ({
|
|
|
3002
3026
|
setAbrirCamara(true);
|
|
3003
3027
|
};
|
|
3004
3028
|
let capturedImage2 = null;
|
|
3005
|
-
const capture = (0,
|
|
3029
|
+
const capture = (0, import_react23.useCallback)((e) => {
|
|
3006
3030
|
if (webcamRef.current) {
|
|
3007
3031
|
const imageSrc = webcamRef.current.getScreenshot();
|
|
3008
3032
|
setCapturedImage(imageSrc);
|
|
@@ -3013,7 +3037,7 @@ var AttachmentMobile = ({
|
|
|
3013
3037
|
handleUpload(e);
|
|
3014
3038
|
}
|
|
3015
3039
|
}, [webcamRef, setCapturedImage]);
|
|
3016
|
-
const inputRef = (0,
|
|
3040
|
+
const inputRef = (0, import_react23.useRef)(null);
|
|
3017
3041
|
const handleUpload = (event2) => {
|
|
3018
3042
|
var _a;
|
|
3019
3043
|
let newFiles = event2.target.files;
|
|
@@ -3044,13 +3068,7 @@ var AttachmentMobile = ({
|
|
|
3044
3068
|
);
|
|
3045
3069
|
const sizeMB = file.size / (1024 * 1024);
|
|
3046
3070
|
if (isDuplicateFile) {
|
|
3047
|
-
setToast({
|
|
3048
|
-
type: "error",
|
|
3049
|
-
title: "Archivo duplicado",
|
|
3050
|
-
listITems: [`El archivo "${file.name}" ya existe.`],
|
|
3051
|
-
seeMore: true,
|
|
3052
|
-
time: 5
|
|
3053
|
-
});
|
|
3071
|
+
setToast({ open: true, type: "error", mensaje: `Archivo duplicado: El archivo "${file.name}" ya existe.` });
|
|
3054
3072
|
return;
|
|
3055
3073
|
}
|
|
3056
3074
|
if (sizeMB > maxSize) {
|
|
@@ -3061,13 +3079,7 @@ var AttachmentMobile = ({
|
|
|
3061
3079
|
progress: 0,
|
|
3062
3080
|
uploadError: true
|
|
3063
3081
|
});
|
|
3064
|
-
setToast({
|
|
3065
|
-
type: "error",
|
|
3066
|
-
title: "Carga fallida",
|
|
3067
|
-
seeMore: true,
|
|
3068
|
-
listITems: [`El archivo "${file.name}" supera el l\xEDmite de ${maxSize}MB.`],
|
|
3069
|
-
time: 5
|
|
3070
|
-
});
|
|
3082
|
+
setToast({ open: true, type: "error", mensaje: `Carga fallida: El archivo "${file.name}" supera el l\xEDmite de ${maxSize}MB.` });
|
|
3071
3083
|
return;
|
|
3072
3084
|
}
|
|
3073
3085
|
if (fileAccepted && !file.name.match(
|
|
@@ -3076,13 +3088,7 @@ var AttachmentMobile = ({
|
|
|
3076
3088
|
"i"
|
|
3077
3089
|
)
|
|
3078
3090
|
)) {
|
|
3079
|
-
setToast({
|
|
3080
|
-
type: "error",
|
|
3081
|
-
title: "Tipo de archivo no permitido",
|
|
3082
|
-
listITems: [`El archivo "${file.name}" no es un tipo permitido.`],
|
|
3083
|
-
seeMore: true,
|
|
3084
|
-
time: 5
|
|
3085
|
-
});
|
|
3091
|
+
setToast({ open: true, type: "error", mensaje: `Tipo de archivo no permitido: El archivo "${file.name}" no es un tipo permitido.` });
|
|
3086
3092
|
return;
|
|
3087
3093
|
}
|
|
3088
3094
|
nuevosArchivos.push({
|
|
@@ -3122,21 +3128,9 @@ var AttachmentMobile = ({
|
|
|
3122
3128
|
const remainingValidFiles = updatedFiles.filter((f) => !f.uploadError).map((f) => new File([], f.name, { type: f.type }));
|
|
3123
3129
|
onChange(remainingValidFiles);
|
|
3124
3130
|
}
|
|
3125
|
-
setToast({
|
|
3126
|
-
type: "success",
|
|
3127
|
-
title: "Archivo eliminado",
|
|
3128
|
-
listITems: [`El archivo "${fileToRemove.name}" ha sido eliminado exitosamente.`],
|
|
3129
|
-
seeMore: true,
|
|
3130
|
-
time: 3
|
|
3131
|
-
});
|
|
3131
|
+
setToast({ open: true, type: "success", mensaje: `El archivo "${fileToRemove.name}" ha sido eliminado exitosamente.` });
|
|
3132
3132
|
} catch (error) {
|
|
3133
|
-
setToast({
|
|
3134
|
-
type: "error",
|
|
3135
|
-
title: "Error al eliminar",
|
|
3136
|
-
listITems: [`No se pudo eliminar el archivo "${fileToRemove.name}".`],
|
|
3137
|
-
seeMore: true,
|
|
3138
|
-
time: 5
|
|
3139
|
-
});
|
|
3133
|
+
setToast({ open: true, type: "error", mensaje: `No se pudo eliminar el archivo "${fileToRemove.name}".` });
|
|
3140
3134
|
}
|
|
3141
3135
|
});
|
|
3142
3136
|
const deleteFiles = (fileName) => {
|
|
@@ -3149,29 +3143,39 @@ var AttachmentMobile = ({
|
|
|
3149
3143
|
});
|
|
3150
3144
|
};
|
|
3151
3145
|
const AttachtmentActions = [
|
|
3152
|
-
{ icon: /* @__PURE__ */
|
|
3146
|
+
{ icon: /* @__PURE__ */ import_react23.default.createElement(import_ImageOutlined.default, { type: "file", color: "primary" }), color: "primary", label: "Galer\xEDa", onClick: () => {
|
|
3153
3147
|
var _a;
|
|
3154
3148
|
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
3155
3149
|
} },
|
|
3156
|
-
{ icon: /* @__PURE__ */
|
|
3157
|
-
{ icon: /* @__PURE__ */
|
|
3150
|
+
{ icon: /* @__PURE__ */ import_react23.default.createElement(import_icons_material10.PhotoCameraOutlined, { type: "file", color: "success" }), color: "success", label: "C\xE1mara", onClick: () => openCam() },
|
|
3151
|
+
{ icon: /* @__PURE__ */ import_react23.default.createElement(import_icons_material10.FolderOpenOutlined, { type: "file", color: "warning" }), color: "warning", label: "Archivos", onClick: () => {
|
|
3158
3152
|
var _a;
|
|
3159
3153
|
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
3160
3154
|
} }
|
|
3161
3155
|
];
|
|
3162
|
-
(0,
|
|
3156
|
+
(0, import_react23.useEffect)(() => {
|
|
3163
3157
|
if (initialFiles && initialFiles.length > 0) {
|
|
3164
3158
|
setFiles(initialFiles);
|
|
3165
3159
|
}
|
|
3166
3160
|
}, []);
|
|
3167
|
-
return /* @__PURE__ */
|
|
3161
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react23.default.createElement(
|
|
3162
|
+
SCSnackBar,
|
|
3163
|
+
{
|
|
3164
|
+
openState: toast.open,
|
|
3165
|
+
setOpenState: (v) => setToast((prev) => __spreadProps(__spreadValues({}, prev), { open: v })),
|
|
3166
|
+
mensaje: toast.mensaje,
|
|
3167
|
+
type: toast.type,
|
|
3168
|
+
duration: 5e3,
|
|
3169
|
+
position: "Center"
|
|
3170
|
+
}
|
|
3171
|
+
), view == "button" ? /* @__PURE__ */ import_react23.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ import_react23.default.createElement(
|
|
3168
3172
|
AttachmentButton,
|
|
3169
3173
|
{
|
|
3170
3174
|
buttonAttachment,
|
|
3171
3175
|
open,
|
|
3172
3176
|
setOpen
|
|
3173
3177
|
}
|
|
3174
|
-
)) : "", /* @__PURE__ */
|
|
3178
|
+
)) : "", /* @__PURE__ */ import_react23.default.createElement(import_CssBaseline.default, null), /* @__PURE__ */ import_react23.default.createElement(
|
|
3175
3179
|
import_material16.SwipeableDrawer,
|
|
3176
3180
|
{
|
|
3177
3181
|
slotProps: {
|
|
@@ -3196,8 +3200,7 @@ var AttachmentMobile = ({
|
|
|
3196
3200
|
onClose: toggleAttachment(false),
|
|
3197
3201
|
onOpen: toggleAttachment(true)
|
|
3198
3202
|
},
|
|
3199
|
-
|
|
3200
|
-
/* @__PURE__ */ import_react22.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", alignItems: "center", p: 2, gap: 2 }, /* @__PURE__ */ import_react22.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", gap: 1, p: 1 }, /* @__PURE__ */ import_react22.default.createElement(import_material16.Typography, { variant: "h6", color: "text.primary" }, "Agrega adjuntos"), /* @__PURE__ */ import_react22.default.createElement(import_material16.IconButton, { size: "medium", onClick: toggleAttachment(false) }, /* @__PURE__ */ import_react22.default.createElement(import_icons_material10.CloseOutlined, { color: "action" }))), /* @__PURE__ */ import_react22.default.createElement(
|
|
3203
|
+
/* @__PURE__ */ import_react23.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", alignItems: "center", p: 2, gap: 2 }, /* @__PURE__ */ import_react23.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", gap: 1, p: 1 }, /* @__PURE__ */ import_react23.default.createElement(import_material16.Typography, { variant: "h6", color: "text.primary" }, "Agrega adjuntos"), /* @__PURE__ */ import_react23.default.createElement(import_material16.IconButton, { size: "medium", onClick: toggleAttachment(false) }, /* @__PURE__ */ import_react23.default.createElement(import_icons_material10.CloseOutlined, { color: "action" }))), /* @__PURE__ */ import_react23.default.createElement(
|
|
3201
3204
|
"input",
|
|
3202
3205
|
{
|
|
3203
3206
|
type: "file",
|
|
@@ -3206,7 +3209,7 @@ var AttachmentMobile = ({
|
|
|
3206
3209
|
ref: inputRef,
|
|
3207
3210
|
onChange: handleUpload
|
|
3208
3211
|
}
|
|
3209
|
-
), /* @__PURE__ */
|
|
3212
|
+
), /* @__PURE__ */ import_react23.default.createElement(import_system.Box, { display: "flex", justifyContent: "space-around", alignItems: "center", width: "100%", gap: 2, sx: { padding: "0px 0px 52px 0px !important" } }, AttachtmentActions.map((option, index) => /* @__PURE__ */ import_react23.default.createElement(
|
|
3210
3213
|
import_system.Box,
|
|
3211
3214
|
{
|
|
3212
3215
|
display: "flex",
|
|
@@ -3226,7 +3229,7 @@ var AttachmentMobile = ({
|
|
|
3226
3229
|
cursor: "pointer"
|
|
3227
3230
|
}
|
|
3228
3231
|
},
|
|
3229
|
-
/* @__PURE__ */
|
|
3232
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
3230
3233
|
import_material16.IconButton,
|
|
3231
3234
|
{
|
|
3232
3235
|
sx: {
|
|
@@ -3236,9 +3239,9 @@ var AttachmentMobile = ({
|
|
|
3236
3239
|
},
|
|
3237
3240
|
option.icon
|
|
3238
3241
|
),
|
|
3239
|
-
/* @__PURE__ */
|
|
3242
|
+
/* @__PURE__ */ import_react23.default.createElement(import_material16.Typography, { variant: "body2", color: "text.secondary" }, option.label)
|
|
3240
3243
|
))))
|
|
3241
|
-
), abrirCamara && /* @__PURE__ */
|
|
3244
|
+
), abrirCamara && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(import_CancelOutlined.default, { onClick: closeCam, sx: { borderRadius: "50px", height: "35px", width: "35px", zIndex: 1700, background: "white", position: "absolute", left: `calc(100% - 50px)`, bottom: `calc(100% - 50px)` } }), /* @__PURE__ */ import_react23.default.createElement(import_material16.Stack, { className: "camras" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
3242
3245
|
import_react_webcam.default,
|
|
3243
3246
|
{
|
|
3244
3247
|
audio: false,
|
|
@@ -3262,7 +3265,7 @@ var AttachmentMobile = ({
|
|
|
3262
3265
|
// Encima de todo
|
|
3263
3266
|
}
|
|
3264
3267
|
}
|
|
3265
|
-
), /* @__PURE__ */
|
|
3268
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
3266
3269
|
import_PhotoCamera.default,
|
|
3267
3270
|
{
|
|
3268
3271
|
onClick: capture,
|
|
@@ -3280,7 +3283,7 @@ var AttachmentMobile = ({
|
|
|
3280
3283
|
},
|
|
3281
3284
|
fontSize: "medium"
|
|
3282
3285
|
}
|
|
3283
|
-
))), files.length > 0 && /* @__PURE__ */
|
|
3286
|
+
))), files.length > 0 && /* @__PURE__ */ import_react23.default.createElement(
|
|
3284
3287
|
import_material16.Stack,
|
|
3285
3288
|
{
|
|
3286
3289
|
"data-testid": "ContenedorArchivosAdjuntos",
|
|
@@ -3293,7 +3296,7 @@ var AttachmentMobile = ({
|
|
|
3293
3296
|
}),
|
|
3294
3297
|
spacing: 1
|
|
3295
3298
|
},
|
|
3296
|
-
files.map((file) => /* @__PURE__ */
|
|
3299
|
+
files.map((file) => /* @__PURE__ */ import_react23.default.createElement(
|
|
3297
3300
|
import_material16.Stack,
|
|
3298
3301
|
{
|
|
3299
3302
|
height: 46,
|
|
@@ -3311,7 +3314,7 @@ var AttachmentMobile = ({
|
|
|
3311
3314
|
}
|
|
3312
3315
|
}
|
|
3313
3316
|
},
|
|
3314
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
3315
3318
|
import_material16.Stack,
|
|
3316
3319
|
{
|
|
3317
3320
|
direction: "row",
|
|
@@ -3321,14 +3324,14 @@ var AttachmentMobile = ({
|
|
|
3321
3324
|
onClick: () => onFileClick == null ? void 0 : onFileClick(file),
|
|
3322
3325
|
sx: { cursor: onFileClick ? "pointer" : "default" }
|
|
3323
3326
|
},
|
|
3324
|
-
iconFileItem ? /* @__PURE__ */
|
|
3327
|
+
iconFileItem ? /* @__PURE__ */ import_react23.default.createElement(import_material16.SvgIcon, { color: file.uploadError ? "error" : "primary", fontSize: "small", component: IconFileItem }) : /* @__PURE__ */ import_react23.default.createElement(
|
|
3325
3328
|
import_icons_material10.UploadFileOutlined,
|
|
3326
3329
|
{
|
|
3327
3330
|
color: file.uploadError ? "error" : "primary",
|
|
3328
3331
|
fontSize: "small"
|
|
3329
3332
|
}
|
|
3330
3333
|
),
|
|
3331
|
-
/* @__PURE__ */
|
|
3334
|
+
/* @__PURE__ */ import_react23.default.createElement(import_material16.Stack, { width: "100%" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
3332
3335
|
import_material16.Typography,
|
|
3333
3336
|
{
|
|
3334
3337
|
variant: "body2",
|
|
@@ -3339,7 +3342,7 @@ var AttachmentMobile = ({
|
|
|
3339
3342
|
maxWidth: "310px"
|
|
3340
3343
|
},
|
|
3341
3344
|
file.name
|
|
3342
|
-
), /* @__PURE__ */
|
|
3345
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
3343
3346
|
import_material16.Typography,
|
|
3344
3347
|
{
|
|
3345
3348
|
variant: "caption",
|
|
@@ -3348,7 +3351,7 @@ var AttachmentMobile = ({
|
|
|
3348
3351
|
file.uploadError && file.size / (1024 * 1024) > maxSize ? "Archivo super\xF3 el l\xEDmite \u2022 Carga fallida" : file.uploadError ? "Archivo duplicado o inv\xE1lido \u2022 Carga fallida" : `${(file.size / (1024 * 1024)).toFixed(2)}MB \u2022 ${file.type}`
|
|
3349
3352
|
))
|
|
3350
3353
|
),
|
|
3351
|
-
view == "file" ? /* @__PURE__ */
|
|
3354
|
+
view == "file" ? /* @__PURE__ */ import_react23.default.createElement(import_material16.Tooltip, { title: "Descargar" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
3352
3355
|
import_material16.IconButton,
|
|
3353
3356
|
{
|
|
3354
3357
|
size: "small",
|
|
@@ -3356,9 +3359,9 @@ var AttachmentMobile = ({
|
|
|
3356
3359
|
disabled: file.uploadError,
|
|
3357
3360
|
"aria-label": `Descargar ${file.name}`
|
|
3358
3361
|
},
|
|
3359
|
-
/* @__PURE__ */
|
|
3362
|
+
/* @__PURE__ */ import_react23.default.createElement(import_FileDownloadOutlined.default, { fontSize: "small", color: "action" })
|
|
3360
3363
|
)) : "",
|
|
3361
|
-
view == "button" ? /* @__PURE__ */
|
|
3364
|
+
view == "button" ? /* @__PURE__ */ import_react23.default.createElement(import_material16.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
3362
3365
|
import_material16.IconButton,
|
|
3363
3366
|
{
|
|
3364
3367
|
size: "small",
|
|
@@ -3368,10 +3371,10 @@ var AttachmentMobile = ({
|
|
|
3368
3371
|
},
|
|
3369
3372
|
"aria-label": `Eliminar ${file.name}`
|
|
3370
3373
|
},
|
|
3371
|
-
/* @__PURE__ */
|
|
3374
|
+
/* @__PURE__ */ import_react23.default.createElement(import_icons_material10.DeleteOutline, { fontSize: "small", color: "action" })
|
|
3372
3375
|
)) : ""
|
|
3373
3376
|
))
|
|
3374
|
-
), openDrawerDelete && /* @__PURE__ */
|
|
3377
|
+
), openDrawerDelete && /* @__PURE__ */ import_react23.default.createElement(
|
|
3375
3378
|
SCDrawer,
|
|
3376
3379
|
{
|
|
3377
3380
|
open: openDrawerDelete,
|
|
@@ -3381,7 +3384,7 @@ var AttachmentMobile = ({
|
|
|
3381
3384
|
heightDrawer: 150,
|
|
3382
3385
|
arrayElements: [
|
|
3383
3386
|
{
|
|
3384
|
-
component: /* @__PURE__ */
|
|
3387
|
+
component: /* @__PURE__ */ import_react23.default.createElement(import_material16.Typography, null, "Esta seguro de eliminar el adjunto ", /* @__PURE__ */ import_react23.default.createElement("strong", null, '"', fileToDelete == null ? void 0 : fileToDelete.name, '"'), " ")
|
|
3385
3388
|
}
|
|
3386
3389
|
],
|
|
3387
3390
|
actions: [
|
|
@@ -3394,19 +3397,9 @@ var AttachmentMobile = ({
|
|
|
3394
3397
|
yield deleteAction(fileToDelete.name);
|
|
3395
3398
|
}
|
|
3396
3399
|
deleteFiles(fileToDelete.name);
|
|
3397
|
-
setToast({
|
|
3398
|
-
title: "Archivo eliminado",
|
|
3399
|
-
type: "success",
|
|
3400
|
-
listITems: [`El archivo "${fileToDelete.name}" fue eliminado exitosamente.`],
|
|
3401
|
-
time: 3
|
|
3402
|
-
});
|
|
3400
|
+
setToast({ open: true, type: "success", mensaje: `El archivo "${fileToDelete.name}" fue eliminado exitosamente.` });
|
|
3403
3401
|
} catch (error) {
|
|
3404
|
-
setToast({
|
|
3405
|
-
title: "Error al eliminar archivo",
|
|
3406
|
-
type: "error",
|
|
3407
|
-
listITems: [`No se pudo eliminar el archivo "${fileToDelete.name}".`],
|
|
3408
|
-
time: 5
|
|
3409
|
-
});
|
|
3402
|
+
setToast({ open: true, type: "error", mensaje: `No se pudo eliminar el archivo "${fileToDelete.name}".` });
|
|
3410
3403
|
} finally {
|
|
3411
3404
|
setFileToDelete(null);
|
|
3412
3405
|
setOpenDrawerDelete(false);
|
|
@@ -3421,16 +3414,16 @@ var AttachmentMobile = ({
|
|
|
3421
3414
|
};
|
|
3422
3415
|
|
|
3423
3416
|
// src/Components/Calendario/Calendar.tsx
|
|
3424
|
-
var
|
|
3417
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
3425
3418
|
var import_material24 = require("@mui/material");
|
|
3426
3419
|
|
|
3427
3420
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
3428
|
-
var
|
|
3421
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3429
3422
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3430
3423
|
var import_material17 = require("@mui/material");
|
|
3431
3424
|
var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
3432
3425
|
var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"), 1);
|
|
3433
|
-
var
|
|
3426
|
+
var import_es3 = require("dayjs/locale/es");
|
|
3434
3427
|
import_dayjs2.default.locale("es");
|
|
3435
3428
|
import_dayjs2.default.extend(import_updateLocale.default);
|
|
3436
3429
|
import_dayjs2.default.updateLocale("en", {
|
|
@@ -3444,7 +3437,7 @@ var CalendarToolbar = ({
|
|
|
3444
3437
|
onNavigate,
|
|
3445
3438
|
children
|
|
3446
3439
|
}) => {
|
|
3447
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
3440
|
+
const [anchorEl, setAnchorEl] = (0, import_react24.useState)(null);
|
|
3448
3441
|
const open = Boolean(anchorEl);
|
|
3449
3442
|
const handleMenuOpen = (event2) => {
|
|
3450
3443
|
setAnchorEl(event2.currentTarget);
|
|
@@ -3467,17 +3460,17 @@ var CalendarToolbar = ({
|
|
|
3467
3460
|
}
|
|
3468
3461
|
return labelDate.format(" DD MMMM YYYY");
|
|
3469
3462
|
};
|
|
3470
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_material17.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 1.5, sx: { paddingBottom: "16px" } }, /* @__PURE__ */ import_react24.default.createElement(import_material17.Stack, { direction: "row", alignItems: "center", justifyContent: "flex-start", gap: 1.5 }, /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, null, /* @__PURE__ */ import_react24.default.createElement(
|
|
3471
3464
|
import_material17.Chip,
|
|
3472
3465
|
{
|
|
3473
3466
|
size: "medium",
|
|
3474
3467
|
label: "Hoy",
|
|
3475
|
-
icon: /* @__PURE__ */
|
|
3468
|
+
icon: /* @__PURE__ */ import_react24.default.createElement(import_icons_material11.EventOutlined, { fontSize: "small" }),
|
|
3476
3469
|
color: "primary",
|
|
3477
3470
|
onClick: () => onNavigate("TODAY"),
|
|
3478
3471
|
variant: "standard"
|
|
3479
3472
|
}
|
|
3480
|
-
)), /* @__PURE__ */
|
|
3473
|
+
)), /* @__PURE__ */ import_react24.default.createElement(import_material17.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { "aria-label": "Anterior", onClick: () => onNavigate("PREV"), size: "small", color: "primary" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material11.ChevronLeft, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { "aria-label": "Siguiente", onClick: () => onNavigate("NEXT"), size: "small", color: "primary" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material11.ChevronRight, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(import_material17.Typography, { variant: "h6", color: "primary", "data-testid": "currentDate" }, getFormattedDate()), /* @__PURE__ */ import_react24.default.createElement(import_material17.IconButton, { onClick: handleMenuOpen, size: "small", color: "primary", "aria-label": "Cambiar vista" }, /* @__PURE__ */ import_react24.default.createElement(import_icons_material11.KeyboardArrowDown, { fontSize: "small" })), /* @__PURE__ */ import_react24.default.createElement(
|
|
3481
3474
|
import_material17.Menu,
|
|
3482
3475
|
{
|
|
3483
3476
|
anchorEl,
|
|
@@ -3486,14 +3479,14 @@ var CalendarToolbar = ({
|
|
|
3486
3479
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
3487
3480
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
3488
3481
|
},
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
))), children ? /* @__PURE__ */
|
|
3482
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("month") }, "Mes"),
|
|
3483
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("week") }, "Semana"),
|
|
3484
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material17.MenuItem, { onClick: () => handleViewChange("day") }, "D\xEDa")
|
|
3485
|
+
))), children ? /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, null, children) : /* @__PURE__ */ import_react24.default.createElement(import_material17.Box, { width: "24px" }), " ");
|
|
3493
3486
|
};
|
|
3494
3487
|
|
|
3495
3488
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
3496
|
-
var
|
|
3489
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
3497
3490
|
var import_material21 = require("@mui/material");
|
|
3498
3491
|
var import_Add = __toESM(require("@mui/icons-material/Add"), 1);
|
|
3499
3492
|
var import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
@@ -3526,10 +3519,10 @@ var stateColors = {
|
|
|
3526
3519
|
};
|
|
3527
3520
|
|
|
3528
3521
|
// src/Components/Calendario/Event.tsx
|
|
3529
|
-
var
|
|
3522
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
3530
3523
|
var import_material18 = require("@mui/material");
|
|
3531
3524
|
var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
3532
|
-
const [anchorEl, setAnchorEl] =
|
|
3525
|
+
const [anchorEl, setAnchorEl] = import_react25.default.useState(null);
|
|
3533
3526
|
const handlePopoverOpen = (event3) => {
|
|
3534
3527
|
setAnchorEl(event3.currentTarget);
|
|
3535
3528
|
};
|
|
@@ -3537,7 +3530,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3537
3530
|
setAnchorEl(null);
|
|
3538
3531
|
};
|
|
3539
3532
|
const open = Boolean(anchorEl);
|
|
3540
|
-
return /* @__PURE__ */
|
|
3533
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3541
3534
|
import_material18.Stack,
|
|
3542
3535
|
{
|
|
3543
3536
|
direction: "row",
|
|
@@ -3558,7 +3551,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3558
3551
|
cursor: onClick ? "pointer" : "default"
|
|
3559
3552
|
}, sx)
|
|
3560
3553
|
},
|
|
3561
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3562
3555
|
import_material18.Divider,
|
|
3563
3556
|
{
|
|
3564
3557
|
orientation: "vertical",
|
|
@@ -3570,7 +3563,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3570
3563
|
}
|
|
3571
3564
|
}
|
|
3572
3565
|
),
|
|
3573
|
-
/* @__PURE__ */
|
|
3566
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3574
3567
|
import_material18.Box,
|
|
3575
3568
|
{
|
|
3576
3569
|
px: 1,
|
|
@@ -3580,7 +3573,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3580
3573
|
display: "flex",
|
|
3581
3574
|
alignItems: "center"
|
|
3582
3575
|
},
|
|
3583
|
-
/* @__PURE__ */
|
|
3576
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3584
3577
|
import_material18.Typography,
|
|
3585
3578
|
{
|
|
3586
3579
|
color: "text.primary",
|
|
@@ -3596,7 +3589,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3596
3589
|
},
|
|
3597
3590
|
event2.title.charAt(0).toUpperCase() + event2.title.slice(1).toLowerCase()
|
|
3598
3591
|
),
|
|
3599
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3600
3593
|
import_material18.Popover,
|
|
3601
3594
|
{
|
|
3602
3595
|
id: "mouse-over-popover",
|
|
@@ -3621,60 +3614,60 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3621
3614
|
};
|
|
3622
3615
|
|
|
3623
3616
|
// src/Components/EmptyState/EmptyState.tsx
|
|
3624
|
-
var
|
|
3617
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
3625
3618
|
var import_material19 = require("@mui/material");
|
|
3626
3619
|
|
|
3627
|
-
// src/assets/ImgEmptyState/create.tsx
|
|
3628
|
-
var import_react25 = __toESM(require("react"), 1);
|
|
3629
|
-
var Create = () => {
|
|
3630
|
-
return /* @__PURE__ */ import_react25.default.createElement("svg", { width: "45", height: "41", viewBox: "0 0 45 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react25.default.createElement("g", { "clip-path": "url(#clip0_1283_39624)" }, /* @__PURE__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.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__ */ import_react25.default.createElement("defs", null, /* @__PURE__ */ import_react25.default.createElement("clipPath", { id: "clip0_1283_39624" }, /* @__PURE__ */ import_react25.default.createElement("rect", { width: "44", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
3631
|
-
};
|
|
3632
|
-
|
|
3633
3620
|
// src/assets/ImgEmptyState/empty.tsx
|
|
3634
3621
|
var import_react26 = __toESM(require("react"), 1);
|
|
3635
3622
|
var Empty = () => {
|
|
3636
|
-
return /* @__PURE__ */ import_react26.default.createElement("svg", { width: "
|
|
3623
|
+
return /* @__PURE__ */ import_react26.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react26.default.createElement("g", { "clip-path": "url(#clip0_1283_39626)" }, /* @__PURE__ */ import_react26.default.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__ */ import_react26.default.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__ */ import_react26.default.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__ */ import_react26.default.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__ */ import_react26.default.createElement("defs", null, /* @__PURE__ */ import_react26.default.createElement("clipPath", { id: "clip0_1283_39626" }, /* @__PURE__ */ import_react26.default.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
3637
3624
|
};
|
|
3638
3625
|
|
|
3639
3626
|
// src/assets/ImgEmptyState/error.tsx
|
|
3640
3627
|
var import_react27 = __toESM(require("react"), 1);
|
|
3641
3628
|
var Error2 = () => {
|
|
3642
|
-
return /* @__PURE__ */ import_react27.default.createElement("svg", { width: "
|
|
3629
|
+
return /* @__PURE__ */ import_react27.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react27.default.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__ */ import_react27.default.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__ */ import_react27.default.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" }));
|
|
3643
3630
|
};
|
|
3644
3631
|
|
|
3645
3632
|
// src/assets/ImgEmptyState/search.tsx
|
|
3646
3633
|
var import_react28 = __toESM(require("react"), 1);
|
|
3647
3634
|
var Search2 = () => {
|
|
3648
|
-
return /* @__PURE__ */ import_react28.default.createElement("svg", { width: "
|
|
3635
|
+
return /* @__PURE__ */ import_react28.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react28.default.createElement("g", { "clip-path": "url(#clip0_1283_39628)" }, /* @__PURE__ */ import_react28.default.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__ */ import_react28.default.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__ */ import_react28.default.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__ */ import_react28.default.createElement("defs", null, /* @__PURE__ */ import_react28.default.createElement("clipPath", { id: "clip0_1283_39628" }, /* @__PURE__ */ import_react28.default.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3638
|
+
// src/assets/ImgEmptyState/Crear.tsx
|
|
3639
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
3640
|
+
var Crear = () => {
|
|
3641
|
+
return /* @__PURE__ */ import_react29.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 71 60", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.8651 7.72749C33.3297 8.73403 32.8905 9.92668 31.8839 10.3913C29.95 11.2842 28.3291 12.4017 27.1797 13.9815C26.0474 15.5377 25.2507 17.7105 25.2505 20.9384C25.2504 22.047 24.3517 22.9457 23.243 22.9456C22.1344 22.9456 21.2358 22.0468 21.2358 20.9382C21.2361 17.0048 22.2237 13.9694 23.9334 11.6196C25.626 9.29313 27.9046 7.80661 30.2012 6.74635C31.2078 6.28169 32.4004 6.72096 32.8651 7.72749Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { d: "Mnan nanL31.6838 57.8016C31.5923 57.3702 31.9213 56.9641 32.3623 56.9641H37.7342C38.1752 56.9641 38.5042 57.3702 38.4127 57.8016Lnan nanL38.4127 57.8016C38.1408 59.0834 37.0092 60.0002 35.6988 60.0002H34.3977C33.0874 60.0002 31.9557 59.0834 31.6838 57.8016Lnan nanZ", fill: "#B9BDC1" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.618 59.3541C32.5278 59.2787 32.4424 59.1976 32.3623 59.1112C32.0307 58.7535 31.7908 58.3058 31.6838 57.8016C31.5923 57.3702 31.9213 56.9641 32.3623 56.9641H37.7342C38.1752 56.9641 38.5042 57.3702 38.4127 57.8016C38.3058 58.3058 38.0658 58.7535 37.7342 59.1112C37.6542 59.1976 37.5687 59.2787 37.4785 59.3541C37.471 59.3604 37.4634 59.3667 37.4558 59.3729C36.9735 59.7676 36.3588 60.0002 35.6988 60.0002H34.3977C33.7377 60.0002 33.123 59.7676 32.6407 59.3729C32.6331 59.3667 32.6255 59.3604 32.618 59.3541Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react29.default.createElement("path", { d: "M28.0335 53.3519C27.8107 52.349 28.5738 51.3977 29.6011 51.3977H40.7778C41.8051 51.3977 42.5683 52.349 42.3454 53.3519L42.1868 54.0656C41.9419 55.1677 40.9644 55.9518 39.8354 55.9518H30.5435C29.4145 55.9518 28.437 55.1677 28.1921 54.0656L28.0335 53.3519Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.5254 20.5958C14.5254 9.19174 23.9064 0 35.4124 0C46.9185 0 56.2995 9.19174 56.2995 20.5958C56.2995 26.1942 54.0319 31.2695 50.3655 34.9759L48.9384 33.5642L50.3655 34.9759C50.1585 35.1851 49.9497 35.3917 49.7494 35.5899L49.7461 35.5932C48.3758 36.9492 47.4403 37.9255 47.0313 39.1176C46.8693 39.5896 46.697 40.5317 46.547 41.7784C46.4035 42.9721 46.2975 44.286 46.2239 45.402C46.0712 47.7172 44.1613 49.5864 41.7826 49.5864H29.0423C26.6636 49.5864 24.7537 47.7172 24.6009 45.402C24.5273 44.286 24.4214 42.9721 24.2778 41.7784C24.1278 40.5317 23.9555 39.5896 23.7936 39.1176C23.3845 37.9255 22.4491 36.9492 21.0788 35.5932L21.075 35.5895C20.8748 35.3914 20.6662 35.185 20.4593 34.9759C16.793 31.2695 14.5254 26.1942 14.5254 20.5958ZM35.4124 4.01465C26.0645 4.01465 18.54 11.4676 18.54 20.5958C18.54 25.086 20.3539 29.1607 23.3135 32.1525L21.9353 33.5158L23.3135 32.1525C23.504 32.3451 23.6987 32.5378 23.9026 32.7396L22.4907 34.1664L23.9026 32.7396C23.9418 32.7783 23.9815 32.8175 24.0215 32.8571C25.243 34.0642 26.8485 35.6508 27.5909 37.8146C27.9057 38.732 28.1145 40.0581 28.2637 41.299C28.4194 42.5929 28.5309 43.9862 28.6069 45.1377C28.6243 45.4015 28.8364 45.5717 29.0423 45.5717H41.7826C41.9885 45.5717 42.2006 45.4015 42.218 45.1377C42.2939 43.9862 42.4055 42.593 42.5611 41.299C42.7104 40.0581 42.9191 38.732 43.2339 37.8146C43.9764 35.6508 45.5819 34.0642 46.8033 32.8571C46.8434 32.8175 46.883 32.7783 46.9222 32.7396C47.1261 32.5378 47.3208 32.3451 47.5114 32.1525C50.4709 29.1607 52.2848 25.086 52.2848 20.5958C52.2848 11.4676 44.7603 4.01465 35.4124 4.01465Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M70.3394 21.106C70.2846 19.9987 69.3427 19.1455 68.2354 19.2002L63.4393 19.4373C62.332 19.492 61.4788 20.434 61.5335 21.5412C61.5883 22.6485 62.5302 23.5018 63.6375 23.447L68.4336 23.2099C69.5409 23.1552 70.3941 22.2132 70.3394 21.106Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M64.4519 39.4881C65.1324 38.6129 64.9746 37.3518 64.0994 36.6713L60.1598 33.608C59.2846 32.9275 58.0234 33.0853 57.3429 33.9605C56.6624 34.8356 56.8202 36.0968 57.6954 36.7773L61.6351 39.8406C62.5103 40.5211 63.7714 40.3633 64.4519 39.4881Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M58.6747 8.57034C57.9112 7.76654 57.9439 6.49599 58.7477 5.73249L62.366 2.29558C63.1698 1.53208 64.4404 1.56476 65.2039 2.36856C65.9673 3.17236 65.9347 4.44291 65.1309 5.20641L61.5125 8.64332C60.7087 9.40682 59.4382 9.37415 58.6747 8.57034Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.0991034 21.1063C0.153837 19.9991 1.09582 19.1458 2.20309 19.2006L6.99918 19.4376C8.10644 19.4924 8.95969 20.4343 8.90495 21.5416C8.85022 22.6489 7.90823 23.5021 6.80097 23.4474L2.00488 23.2103C0.897615 23.1556 0.0443701 22.2136 0.0991034 21.1063Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.98659 39.4881C5.30608 38.6129 5.4639 37.3518 6.33908 36.6713L10.2787 33.608C11.1539 32.9275 12.415 33.0853 13.0955 33.9605C13.776 34.8356 13.6182 36.0968 12.7431 36.7773L8.80341 39.8406C7.92822 40.5211 6.66709 40.3633 5.98659 39.4881Z", fill: "#D9D9D9" }), /* @__PURE__ */ import_react29.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7638 8.57071C12.5273 7.76691 12.4946 6.49636 11.6908 5.73286L8.07248 2.29595C7.26867 1.53245 5.99813 1.56512 5.23463 2.36893C4.47113 3.17273 4.5038 4.44328 5.3076 5.20678L8.92593 8.64368C9.72974 9.40718 11.0003 9.37451 11.7638 8.57071Z", fill: "#D9D9D9" }));
|
|
3649
3642
|
};
|
|
3650
3643
|
|
|
3651
3644
|
// src/Components/EmptyState/EmptyState.tsx
|
|
3652
3645
|
var EmptyStateImageUrls = {
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3646
|
+
Crear: /* @__PURE__ */ import_react30.default.createElement(Crear, null),
|
|
3647
|
+
Error: /* @__PURE__ */ import_react30.default.createElement(Error2, null),
|
|
3648
|
+
Vacio: /* @__PURE__ */ import_react30.default.createElement(Empty, null),
|
|
3649
|
+
Buscar: /* @__PURE__ */ import_react30.default.createElement(Search2, null)
|
|
3657
3650
|
};
|
|
3658
3651
|
var DefaultIcon = ({
|
|
3659
|
-
state = "
|
|
3660
|
-
size = "
|
|
3652
|
+
state = "Crear",
|
|
3653
|
+
size = "Normal"
|
|
3661
3654
|
}) => {
|
|
3662
3655
|
const Icon = EmptyStateImageUrls[state];
|
|
3663
|
-
const iconSize = size === "
|
|
3664
|
-
return /* @__PURE__ */
|
|
3656
|
+
const iconSize = size === "Small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
|
|
3657
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", null, Icon);
|
|
3665
3658
|
};
|
|
3666
3659
|
var EmptyState = ({
|
|
3667
|
-
state = "
|
|
3668
|
-
size = "
|
|
3660
|
+
state = "Crear",
|
|
3661
|
+
size = "Normal",
|
|
3669
3662
|
title,
|
|
3670
3663
|
subtitle,
|
|
3671
3664
|
actions,
|
|
3672
3665
|
containerHeight = "100vh",
|
|
3673
|
-
icon = /* @__PURE__ */
|
|
3666
|
+
icon = /* @__PURE__ */ import_react30.default.createElement(DefaultIcon, { state, size })
|
|
3674
3667
|
}) => {
|
|
3675
|
-
const titleVariant = size === "
|
|
3676
|
-
const subtitleVariant = size === "
|
|
3677
|
-
return /* @__PURE__ */
|
|
3668
|
+
const titleVariant = size === "Small" ? "subtitle2" : "h6";
|
|
3669
|
+
const subtitleVariant = size === "Small" ? "caption" : "body1";
|
|
3670
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
3678
3671
|
import_material19.Stack,
|
|
3679
3672
|
{
|
|
3680
3673
|
alignItems: "center",
|
|
@@ -3683,8 +3676,8 @@ var EmptyState = ({
|
|
|
3683
3676
|
height: containerHeight,
|
|
3684
3677
|
"data-testid": "empty-state-container"
|
|
3685
3678
|
},
|
|
3686
|
-
icon && /* @__PURE__ */
|
|
3687
|
-
/* @__PURE__ */
|
|
3679
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material19.Stack, { sx: { width: size === "Small" ? "40px" : "60px", height: size === "Small" ? "40px" : "60px" } }, icon && /* @__PURE__ */ import_react30.default.createElement(import_material19.Stack, null, icon)),
|
|
3680
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material19.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react30.default.createElement(import_material19.Typography, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ import_react30.default.createElement(
|
|
3688
3681
|
import_material19.Typography,
|
|
3689
3682
|
{
|
|
3690
3683
|
variant: subtitleVariant,
|
|
@@ -3693,7 +3686,7 @@ var EmptyState = ({
|
|
|
3693
3686
|
style: { whiteSpace: "pre-line" }
|
|
3694
3687
|
},
|
|
3695
3688
|
subtitle
|
|
3696
|
-
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */
|
|
3689
|
+
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ import_react30.default.createElement(
|
|
3697
3690
|
import_material19.Stack,
|
|
3698
3691
|
{
|
|
3699
3692
|
direction: "row",
|
|
@@ -3703,15 +3696,15 @@ var EmptyState = ({
|
|
|
3703
3696
|
},
|
|
3704
3697
|
actions.map((action, index) => {
|
|
3705
3698
|
var _a, _b, _c, _d;
|
|
3706
|
-
return /* @__PURE__ */
|
|
3699
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
3707
3700
|
import_material19.Button,
|
|
3708
3701
|
{
|
|
3709
3702
|
key: index,
|
|
3710
3703
|
color: (_a = action.color) != null ? _a : "primary",
|
|
3711
|
-
variant: (_b = action.variant) != null ? _b : "text",
|
|
3704
|
+
variant: index == actions.length - 1 ? "outlined" : (_b = action.variant) != null ? _b : "text",
|
|
3712
3705
|
size: (_c = action.size) != null ? _c : "small",
|
|
3713
|
-
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */
|
|
3714
|
-
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */
|
|
3706
|
+
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ import_react30.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
3707
|
+
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ import_react30.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
3715
3708
|
onClick: action.onClick
|
|
3716
3709
|
},
|
|
3717
3710
|
capitalize((_d = action.text) != null ? _d : "action")
|
|
@@ -3722,13 +3715,13 @@ var EmptyState = ({
|
|
|
3722
3715
|
};
|
|
3723
3716
|
|
|
3724
3717
|
// src/assets/LogoCalendario.tsx
|
|
3725
|
-
var
|
|
3718
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3726
3719
|
var LogoCalendario = () => {
|
|
3727
|
-
return /* @__PURE__ */
|
|
3720
|
+
return /* @__PURE__ */ import_react31.default.createElement("svg", { width: "60", height: "61", viewBox: "0 0 60 61", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react31.default.createElement("g", { "clip-path": "url(#clip0_5353_24891)" }, /* @__PURE__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.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__ */ import_react31.default.createElement("defs", null, /* @__PURE__ */ import_react31.default.createElement("clipPath", { id: "clip0_5353_24891" }, /* @__PURE__ */ import_react31.default.createElement("rect", { width: "60", height: "60", fill: "white", transform: "translate(0 0.5)" }))));
|
|
3728
3721
|
};
|
|
3729
3722
|
|
|
3730
3723
|
// src/Components/Calendario/components/DayEventsList.tsx
|
|
3731
|
-
var
|
|
3724
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
3732
3725
|
var import_material20 = require("@mui/material");
|
|
3733
3726
|
var DayEventsList = ({
|
|
3734
3727
|
events,
|
|
@@ -3737,7 +3730,7 @@ var DayEventsList = ({
|
|
|
3737
3730
|
onEventHover
|
|
3738
3731
|
}) => {
|
|
3739
3732
|
const [first, ...rest] = events;
|
|
3740
|
-
return /* @__PURE__ */
|
|
3733
|
+
return /* @__PURE__ */ import_react32.default.createElement(import_material20.Box, { display: "flex", width: "100%", flexDirection: "column", height: "100%", pr: 1.5 }, /* @__PURE__ */ import_react32.default.createElement(import_material20.Typography, { width: "100%", color: "text.secondary" }, "Proximo evento"), first && /* @__PURE__ */ import_react32.default.createElement(import_material20.Box, { p: 1, pb: 1, width: "100%" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
3741
3734
|
CalendarEventCard,
|
|
3742
3735
|
{
|
|
3743
3736
|
event: first,
|
|
@@ -3753,7 +3746,7 @@ var DayEventsList = ({
|
|
|
3753
3746
|
}
|
|
3754
3747
|
}
|
|
3755
3748
|
}
|
|
3756
|
-
)), /* @__PURE__ */
|
|
3749
|
+
)), /* @__PURE__ */ import_react32.default.createElement(import_material20.Divider, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ import_react32.default.createElement(import_material20.Typography, { width: "100%", py: 1, color: "text.secondary" }, "Eventos restantes"), /* @__PURE__ */ import_react32.default.createElement(
|
|
3757
3750
|
import_material20.Box,
|
|
3758
3751
|
{
|
|
3759
3752
|
width: "100%",
|
|
@@ -3766,7 +3759,7 @@ var DayEventsList = ({
|
|
|
3766
3759
|
flexDirection: "column",
|
|
3767
3760
|
gap: 1.5
|
|
3768
3761
|
},
|
|
3769
|
-
rest.map((event2) => /* @__PURE__ */
|
|
3762
|
+
rest.map((event2) => /* @__PURE__ */ import_react32.default.createElement(
|
|
3770
3763
|
CalendarEventCard,
|
|
3771
3764
|
{
|
|
3772
3765
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -3850,21 +3843,21 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3850
3843
|
const noEvents = events.length === 0;
|
|
3851
3844
|
const days = getMonthDays(currentDate);
|
|
3852
3845
|
const weekDays = Array.from({ length: 7 }, (_, i) => (0, import_dayjs5.default)().day(i));
|
|
3853
|
-
const [openDrawer, setOpenDrawer] =
|
|
3854
|
-
const [selectedDay, setSelectedDay] =
|
|
3855
|
-
const [selectedEvents, setSelectedEvents] =
|
|
3856
|
-
return /* @__PURE__ */
|
|
3846
|
+
const [openDrawer, setOpenDrawer] = import_react33.default.useState(false);
|
|
3847
|
+
const [selectedDay, setSelectedDay] = import_react33.default.useState(null);
|
|
3848
|
+
const [selectedEvents, setSelectedEvents] = import_react33.default.useState([]);
|
|
3849
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { minWidth: CALENDAR_CONSTANTS.MIN_WIDTH }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react33.default.createElement(import_material21.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : seeDays == false ? /* @__PURE__ */ import_react33.default.createElement(
|
|
3857
3850
|
EmptyState,
|
|
3858
3851
|
{
|
|
3859
3852
|
containerHeight: "calc(100vh - 130px)",
|
|
3860
3853
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
3861
3854
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3862
|
-
icon: /* @__PURE__ */
|
|
3855
|
+
icon: /* @__PURE__ */ import_react33.default.createElement(LogoCalendario, null)
|
|
3863
3856
|
}
|
|
3864
|
-
) : seeDays == true ? /* @__PURE__ */
|
|
3857
|
+
) : seeDays == true ? /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5 }, days.map((day) => {
|
|
3865
3858
|
const dayEvents = filterEventsForDay(events, day);
|
|
3866
3859
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
3867
|
-
return /* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
3868
3861
|
import_material21.Paper,
|
|
3869
3862
|
{
|
|
3870
3863
|
key: day.toString(),
|
|
@@ -3881,7 +3874,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3881
3874
|
overflow: "hidden"
|
|
3882
3875
|
}
|
|
3883
3876
|
},
|
|
3884
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { p: 1, flexShrink: 0 }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "flex-start" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3885
3878
|
import_material21.Box,
|
|
3886
3879
|
{
|
|
3887
3880
|
sx: {
|
|
@@ -3894,7 +3887,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3894
3887
|
justifyContent: "center"
|
|
3895
3888
|
}
|
|
3896
3889
|
},
|
|
3897
|
-
/* @__PURE__ */
|
|
3890
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
3898
3891
|
import_material21.Typography,
|
|
3899
3892
|
{
|
|
3900
3893
|
variant: "body2",
|
|
@@ -3902,7 +3895,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3902
3895
|
},
|
|
3903
3896
|
day.date()
|
|
3904
3897
|
)
|
|
3905
|
-
), dayEvents.length > CALENDAR_CONSTANTS.MAX_VISIBLE_EVENTS && /* @__PURE__ */
|
|
3898
|
+
), dayEvents.length > CALENDAR_CONSTANTS.MAX_VISIBLE_EVENTS && /* @__PURE__ */ import_react33.default.createElement(import_material21.Tooltip, { title: "M\xE1s eventos" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3906
3899
|
import_material21.IconButton,
|
|
3907
3900
|
{
|
|
3908
3901
|
color: "primary",
|
|
@@ -3914,9 +3907,9 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3914
3907
|
setSelectedEvents(dayEvents);
|
|
3915
3908
|
}
|
|
3916
3909
|
},
|
|
3917
|
-
/* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ import_react33.default.createElement(import_Add.default, { fontSize: "small" })
|
|
3918
3911
|
)))),
|
|
3919
|
-
/* @__PURE__ */
|
|
3912
|
+
/* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", flexDirection: "column", gap: 0.5, p: 1, pt: 0, overflow: "hidden" }, dayEvents.slice(0, CALENDAR_CONSTANTS.MAX_VISIBLE_EVENTS).map((event2) => /* @__PURE__ */ import_react33.default.createElement(
|
|
3920
3913
|
CalendarEventCard,
|
|
3921
3914
|
{
|
|
3922
3915
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -3926,7 +3919,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3926
3919
|
onHover: onEventHover
|
|
3927
3920
|
}
|
|
3928
3921
|
))),
|
|
3929
|
-
dayEvents.length > CALENDAR_CONSTANTS.MAX_VISIBLE_EVENTS && /* @__PURE__ */
|
|
3922
|
+
dayEvents.length > CALENDAR_CONSTANTS.MAX_VISIBLE_EVENTS && /* @__PURE__ */ import_react33.default.createElement(
|
|
3930
3923
|
import_material21.Stack,
|
|
3931
3924
|
{
|
|
3932
3925
|
justifyItems: "center",
|
|
@@ -3935,7 +3928,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3935
3928
|
onClick: (e) => e.stopPropagation(),
|
|
3936
3929
|
sx: { "& .MuiButtonBase-root": { width: "100%" } }
|
|
3937
3930
|
},
|
|
3938
|
-
/* @__PURE__ */
|
|
3931
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
3939
3932
|
import_material21.Button,
|
|
3940
3933
|
{
|
|
3941
3934
|
size: "small",
|
|
@@ -3952,7 +3945,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3952
3945
|
)
|
|
3953
3946
|
)
|
|
3954
3947
|
);
|
|
3955
|
-
})) : null)), selectedDay && /* @__PURE__ */
|
|
3948
|
+
})) : null)), selectedDay && /* @__PURE__ */ import_react33.default.createElement(
|
|
3956
3949
|
SCDrawer,
|
|
3957
3950
|
{
|
|
3958
3951
|
width: CALENDAR_CONSTANTS.DRAWER_WIDTH,
|
|
@@ -3965,7 +3958,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3965
3958
|
anchor: "right",
|
|
3966
3959
|
actions: false,
|
|
3967
3960
|
arrayElements: [{
|
|
3968
|
-
component: /* @__PURE__ */
|
|
3961
|
+
component: /* @__PURE__ */ import_react33.default.createElement(
|
|
3969
3962
|
DayEventsList,
|
|
3970
3963
|
{
|
|
3971
3964
|
events: selectedEvents,
|
|
@@ -3980,7 +3973,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3980
3973
|
};
|
|
3981
3974
|
|
|
3982
3975
|
// src/Components/Calendario/Views/WeekView.tsx
|
|
3983
|
-
var
|
|
3976
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
3984
3977
|
var import_material22 = require("@mui/material");
|
|
3985
3978
|
var import_dayjs6 = __toESM(require("dayjs"), 1);
|
|
3986
3979
|
var import_localeData2 = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
@@ -4016,9 +4009,9 @@ var WeekView = ({
|
|
|
4016
4009
|
}
|
|
4017
4010
|
return "none";
|
|
4018
4011
|
};
|
|
4019
|
-
return /* @__PURE__ */
|
|
4012
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", bgcolor: "transparent" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { width: 45, bgcolor: "transparent" }), days.map((day) => {
|
|
4020
4013
|
const isToday2 = day.format("YYYY-MM-DD") === todayString;
|
|
4021
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
4022
4015
|
import_material22.Box,
|
|
4023
4016
|
{
|
|
4024
4017
|
key: day.toString(),
|
|
@@ -4035,20 +4028,20 @@ var WeekView = ({
|
|
|
4035
4028
|
borderBottom: isToday2 ? 2 : 0,
|
|
4036
4029
|
borderColor: isToday2 ? "primary.main" : "transparent"
|
|
4037
4030
|
},
|
|
4038
|
-
/* @__PURE__ */
|
|
4039
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
4032
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
4040
4033
|
);
|
|
4041
|
-
})), isLoading ? /* @__PURE__ */
|
|
4034
|
+
})), isLoading ? /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && seeDays == false ? /* @__PURE__ */ import_react34.default.createElement(
|
|
4042
4035
|
EmptyState,
|
|
4043
4036
|
{
|
|
4044
4037
|
containerHeight: "calc(100vh - 130px)",
|
|
4045
4038
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
4046
4039
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4047
|
-
icon: /* @__PURE__ */
|
|
4040
|
+
icon: /* @__PURE__ */ import_react34.default.createElement(LogoCalendario, null)
|
|
4048
4041
|
}
|
|
4049
4042
|
) : (
|
|
4050
4043
|
// Grid de horas y eventos
|
|
4051
|
-
/* @__PURE__ */
|
|
4044
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ import_react34.default.createElement(
|
|
4052
4045
|
import_material22.Box,
|
|
4053
4046
|
{
|
|
4054
4047
|
key: h,
|
|
@@ -4057,7 +4050,7 @@ var WeekView = ({
|
|
|
4057
4050
|
pr: 1,
|
|
4058
4051
|
borderColor: "divider"
|
|
4059
4052
|
},
|
|
4060
|
-
/* @__PURE__ */
|
|
4053
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
4061
4054
|
))), days.map((day) => {
|
|
4062
4055
|
const dayEvents = events.filter(
|
|
4063
4056
|
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
@@ -4066,7 +4059,7 @@ var WeekView = ({
|
|
|
4066
4059
|
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
4067
4060
|
return startsInRange || endsInRange;
|
|
4068
4061
|
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
4069
|
-
return /* @__PURE__ */
|
|
4062
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
4070
4063
|
import_material22.Box,
|
|
4071
4064
|
{
|
|
4072
4065
|
key: day.toString(),
|
|
@@ -4079,7 +4072,7 @@ var WeekView = ({
|
|
|
4079
4072
|
},
|
|
4080
4073
|
hours.map((hourIdx) => {
|
|
4081
4074
|
const borderType = getCellBorderType2(hourIdx, dayEvents);
|
|
4082
|
-
return /* @__PURE__ */
|
|
4075
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
4083
4076
|
import_material22.Box,
|
|
4084
4077
|
{
|
|
4085
4078
|
sx: { "&:hover": { bgcolor: "primary.50" } },
|
|
@@ -4096,7 +4089,7 @@ var WeekView = ({
|
|
|
4096
4089
|
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
4097
4090
|
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
4098
4091
|
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
4099
|
-
return /* @__PURE__ */
|
|
4092
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
4100
4093
|
CalendarEventCard,
|
|
4101
4094
|
{
|
|
4102
4095
|
key: `${event2.id}-${day.toString()}`,
|
|
@@ -4121,7 +4114,7 @@ var WeekView = ({
|
|
|
4121
4114
|
};
|
|
4122
4115
|
|
|
4123
4116
|
// src/Components/Calendario/Views/DayView.tsx
|
|
4124
|
-
var
|
|
4117
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
4125
4118
|
var import_material23 = require("@mui/material");
|
|
4126
4119
|
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
4127
4120
|
var DayView = ({
|
|
@@ -4137,15 +4130,15 @@ var DayView = ({
|
|
|
4137
4130
|
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
4138
4131
|
const dayEvents = filterEventsForDay(events, currentDate);
|
|
4139
4132
|
const noEvents = events.length === 0;
|
|
4140
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.paper", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react35.default.createElement(import_material23.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : seeDays == false ? /* @__PURE__ */ import_react35.default.createElement(
|
|
4141
4134
|
EmptyState,
|
|
4142
4135
|
{
|
|
4143
4136
|
containerHeight: "calc(100vh - 140px)",
|
|
4144
4137
|
title: "Inicia la gesti\xF3n de las actividades",
|
|
4145
4138
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
4146
|
-
icon: /* @__PURE__ */
|
|
4139
|
+
icon: /* @__PURE__ */ import_react35.default.createElement(LogoCalendario, null)
|
|
4147
4140
|
}
|
|
4148
|
-
) : /* @__PURE__ */
|
|
4141
|
+
) : /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.paper" }, hours.map((h) => /* @__PURE__ */ import_react35.default.createElement(
|
|
4149
4142
|
import_material23.Box,
|
|
4150
4143
|
{
|
|
4151
4144
|
key: h,
|
|
@@ -4156,10 +4149,10 @@ var DayView = ({
|
|
|
4156
4149
|
borderRight: "1px solid",
|
|
4157
4150
|
borderColor: "divider"
|
|
4158
4151
|
},
|
|
4159
|
-
/* @__PURE__ */
|
|
4160
|
-
))), /* @__PURE__ */
|
|
4152
|
+
/* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs7.default)().hour(h).format("h A"))
|
|
4153
|
+
))), /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { flex: 1, position: "relative" }, hours.map((hourIdx) => {
|
|
4161
4154
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
4162
|
-
return /* @__PURE__ */
|
|
4155
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4163
4156
|
import_material23.Box,
|
|
4164
4157
|
{
|
|
4165
4158
|
sx: { "&:hover": { bgcolor: "primary.50" } },
|
|
@@ -4177,7 +4170,7 @@ var DayView = ({
|
|
|
4177
4170
|
startHour,
|
|
4178
4171
|
endHour
|
|
4179
4172
|
);
|
|
4180
|
-
return /* @__PURE__ */
|
|
4173
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4181
4174
|
CalendarEventCard,
|
|
4182
4175
|
{
|
|
4183
4176
|
key: `${event2.id}-${currentDate.toString()}`,
|
|
@@ -4198,10 +4191,10 @@ var DayView = ({
|
|
|
4198
4191
|
};
|
|
4199
4192
|
|
|
4200
4193
|
// src/Components/Calendario/hooks/useCalendarNavigation.ts
|
|
4201
|
-
var
|
|
4194
|
+
var import_react36 = require("react");
|
|
4202
4195
|
var import_dayjs8 = __toESM(require("dayjs"), 1);
|
|
4203
4196
|
var useCalendarNavigation = (initialDate, onDateChange) => {
|
|
4204
|
-
const [currentDate, setCurrentDate] = (0,
|
|
4197
|
+
const [currentDate, setCurrentDate] = (0, import_react36.useState)(initialDate || (0, import_dayjs8.default)());
|
|
4205
4198
|
const getNavigationUnit = (view) => {
|
|
4206
4199
|
switch (view) {
|
|
4207
4200
|
case "day":
|
|
@@ -4255,9 +4248,9 @@ var Calendar = ({
|
|
|
4255
4248
|
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR,
|
|
4256
4249
|
seeDays = false
|
|
4257
4250
|
}) => {
|
|
4258
|
-
const [view, setView] = (0,
|
|
4251
|
+
const [view, setView] = (0, import_react37.useState)(initialView);
|
|
4259
4252
|
const { currentDate, navigateDate } = useCalendarNavigation((0, import_dayjs9.default)(), onDateChange);
|
|
4260
|
-
(0,
|
|
4253
|
+
(0, import_react37.useEffect)(() => {
|
|
4261
4254
|
onDateChange == null ? void 0 : onDateChange(currentDate);
|
|
4262
4255
|
}, [currentDate, onDateChange]);
|
|
4263
4256
|
const handleViewChange = (newView) => {
|
|
@@ -4267,7 +4260,7 @@ var Calendar = ({
|
|
|
4267
4260
|
const handleNavigate = (action) => {
|
|
4268
4261
|
navigateDate(action, view);
|
|
4269
4262
|
};
|
|
4270
|
-
return /* @__PURE__ */
|
|
4263
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_material24.Box, { bgcolor: "background.paper" }, /* @__PURE__ */ import_react37.default.createElement(
|
|
4271
4264
|
CalendarToolbar,
|
|
4272
4265
|
{
|
|
4273
4266
|
labelDate: currentDate,
|
|
@@ -4276,7 +4269,7 @@ var Calendar = ({
|
|
|
4276
4269
|
onNavigate: handleNavigate
|
|
4277
4270
|
},
|
|
4278
4271
|
toolbar
|
|
4279
|
-
), isLoading ? /* @__PURE__ */
|
|
4272
|
+
), isLoading ? /* @__PURE__ */ import_react37.default.createElement(
|
|
4280
4273
|
import_material24.Box,
|
|
4281
4274
|
{
|
|
4282
4275
|
display: "flex",
|
|
@@ -4284,7 +4277,7 @@ var Calendar = ({
|
|
|
4284
4277
|
alignItems: "center",
|
|
4285
4278
|
height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT
|
|
4286
4279
|
},
|
|
4287
|
-
/* @__PURE__ */
|
|
4280
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
|
4288
4281
|
import_material24.CircularProgress,
|
|
4289
4282
|
{
|
|
4290
4283
|
variant: "indeterminate",
|
|
@@ -4294,7 +4287,7 @@ var Calendar = ({
|
|
|
4294
4287
|
}
|
|
4295
4288
|
}
|
|
4296
4289
|
)
|
|
4297
|
-
) : /* @__PURE__ */
|
|
4290
|
+
) : /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, view === "month" && /* @__PURE__ */ import_react37.default.createElement(
|
|
4298
4291
|
MonthView,
|
|
4299
4292
|
{
|
|
4300
4293
|
events,
|
|
@@ -4305,7 +4298,7 @@ var Calendar = ({
|
|
|
4305
4298
|
onEventHover,
|
|
4306
4299
|
seeDays
|
|
4307
4300
|
}
|
|
4308
|
-
), view === "week" && /* @__PURE__ */
|
|
4301
|
+
), view === "week" && /* @__PURE__ */ import_react37.default.createElement(
|
|
4309
4302
|
WeekView,
|
|
4310
4303
|
{
|
|
4311
4304
|
events,
|
|
@@ -4318,7 +4311,7 @@ var Calendar = ({
|
|
|
4318
4311
|
endHour,
|
|
4319
4312
|
seeDays
|
|
4320
4313
|
}
|
|
4321
|
-
), view === "day" && /* @__PURE__ */
|
|
4314
|
+
), view === "day" && /* @__PURE__ */ import_react37.default.createElement(
|
|
4322
4315
|
DayView,
|
|
4323
4316
|
{
|
|
4324
4317
|
events,
|
|
@@ -4333,7 +4326,7 @@ var Calendar = ({
|
|
|
4333
4326
|
};
|
|
4334
4327
|
|
|
4335
4328
|
// src/Components/FooterAction/FooterAction.tsx
|
|
4336
|
-
var
|
|
4329
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
4337
4330
|
var import_material25 = require("@mui/material");
|
|
4338
4331
|
var FooterAction = ({
|
|
4339
4332
|
leftContent,
|
|
@@ -4341,28 +4334,28 @@ var FooterAction = ({
|
|
|
4341
4334
|
label,
|
|
4342
4335
|
variant
|
|
4343
4336
|
}) => {
|
|
4344
|
-
return /* @__PURE__ */
|
|
4337
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
4345
4338
|
import_material25.AppBar,
|
|
4346
4339
|
{
|
|
4347
4340
|
color: "inherit",
|
|
4348
4341
|
sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
|
|
4349
4342
|
},
|
|
4350
|
-
/* @__PURE__ */
|
|
4343
|
+
/* @__PURE__ */ import_react38.default.createElement(
|
|
4351
4344
|
import_material25.Toolbar,
|
|
4352
4345
|
{
|
|
4353
4346
|
id: "footer-toolbar",
|
|
4354
4347
|
sx: { gap: 1.5, minHeight: "50px !important" }
|
|
4355
4348
|
},
|
|
4356
4349
|
leftContent,
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
label && /* @__PURE__ */
|
|
4350
|
+
/* @__PURE__ */ import_react38.default.createElement(import_material25.Box, { flexGrow: 1 }),
|
|
4351
|
+
label && /* @__PURE__ */ import_react38.default.createElement(import_material25.Typography, { variant: "body2", color: "text.secondary" }, label),
|
|
4359
4352
|
rightContent
|
|
4360
4353
|
)
|
|
4361
4354
|
);
|
|
4362
4355
|
};
|
|
4363
4356
|
|
|
4364
4357
|
// src/Components/Menu/Menu.tsx
|
|
4365
|
-
var
|
|
4358
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
4366
4359
|
var import_material26 = require("@mui/material");
|
|
4367
4360
|
var BasicMenu = ({
|
|
4368
4361
|
open,
|
|
@@ -4373,15 +4366,15 @@ var BasicMenu = ({
|
|
|
4373
4366
|
options
|
|
4374
4367
|
}) => {
|
|
4375
4368
|
var _a, _b, _c, _d;
|
|
4376
|
-
const [internalAnchorEl, setInternalAnchorEl] = (0,
|
|
4377
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
4369
|
+
const [internalAnchorEl, setInternalAnchorEl] = (0, import_react39.useState)(null);
|
|
4370
|
+
const [internalOpen, setInternalOpen] = (0, import_react39.useState)(open != null ? open : false);
|
|
4378
4371
|
const isControlled = Boolean(onClose);
|
|
4379
4372
|
const menuOpen = isControlled ? open != null ? open : false : internalOpen;
|
|
4380
4373
|
const setMenuOpen = isControlled ? () => {
|
|
4381
4374
|
} : setInternalOpen;
|
|
4382
4375
|
const menuAnchorEl = anchorEl != null ? anchorEl : internalAnchorEl;
|
|
4383
4376
|
const actualOpen = Boolean(menuAnchorEl) && menuOpen;
|
|
4384
|
-
const handleButtonClick = (0,
|
|
4377
|
+
const handleButtonClick = (0, import_react39.useCallback)((event2) => {
|
|
4385
4378
|
if (handleClick) {
|
|
4386
4379
|
handleClick(event2);
|
|
4387
4380
|
} else {
|
|
@@ -4391,7 +4384,7 @@ var BasicMenu = ({
|
|
|
4391
4384
|
}
|
|
4392
4385
|
}
|
|
4393
4386
|
}, [handleClick, setMenuOpen, isControlled]);
|
|
4394
|
-
const handleMenuClose = (0,
|
|
4387
|
+
const handleMenuClose = (0, import_react39.useCallback)(() => {
|
|
4395
4388
|
if (onClose) {
|
|
4396
4389
|
onClose();
|
|
4397
4390
|
} else {
|
|
@@ -4399,7 +4392,7 @@ var BasicMenu = ({
|
|
|
4399
4392
|
setMenuOpen(false);
|
|
4400
4393
|
}
|
|
4401
4394
|
}, [onClose, setMenuOpen]);
|
|
4402
|
-
return /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ import_react39.default.createElement("div", null, /* @__PURE__ */ import_react39.default.createElement(
|
|
4403
4396
|
import_material26.Button,
|
|
4404
4397
|
{
|
|
4405
4398
|
id: "basic-button",
|
|
@@ -4412,7 +4405,7 @@ var BasicMenu = ({
|
|
|
4412
4405
|
size: (_c = button == null ? void 0 : button.size) != null ? _c : "small"
|
|
4413
4406
|
},
|
|
4414
4407
|
capitalize((_d = button == null ? void 0 : button.text) != null ? _d : "Menu")
|
|
4415
|
-
), /* @__PURE__ */
|
|
4408
|
+
), /* @__PURE__ */ import_react39.default.createElement(
|
|
4416
4409
|
import_material26.Menu,
|
|
4417
4410
|
{
|
|
4418
4411
|
id: "basic-menu",
|
|
@@ -4430,32 +4423,32 @@ var BasicMenu = ({
|
|
|
4430
4423
|
};
|
|
4431
4424
|
|
|
4432
4425
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
4433
|
-
var
|
|
4426
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
4434
4427
|
var import_material27 = require("@mui/material");
|
|
4435
4428
|
var import_icons_material13 = require("@mui/icons-material");
|
|
4436
4429
|
|
|
4437
4430
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
4438
|
-
var
|
|
4431
|
+
var import_react40 = require("react");
|
|
4439
4432
|
function useMultiSelectHandlers() {
|
|
4440
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
4441
|
-
const [open, setOpen] = (0,
|
|
4442
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
4443
|
-
const [filterValue, setFilterValue] = (0,
|
|
4444
|
-
const handleOpen = (0,
|
|
4433
|
+
const [anchorEl, setAnchorEl] = (0, import_react40.useState)(null);
|
|
4434
|
+
const [open, setOpen] = (0, import_react40.useState)(false);
|
|
4435
|
+
const [selectedItems, setSelectedItems] = (0, import_react40.useState)([]);
|
|
4436
|
+
const [filterValue, setFilterValue] = (0, import_react40.useState)("");
|
|
4437
|
+
const handleOpen = (0, import_react40.useCallback)((e) => {
|
|
4445
4438
|
setAnchorEl(e.currentTarget);
|
|
4446
4439
|
setOpen(true);
|
|
4447
4440
|
}, []);
|
|
4448
|
-
const handleClose = (0,
|
|
4441
|
+
const handleClose = (0, import_react40.useCallback)(() => {
|
|
4449
4442
|
setAnchorEl(null);
|
|
4450
4443
|
setOpen(false);
|
|
4451
4444
|
}, []);
|
|
4452
|
-
const handleFilterChange = (0,
|
|
4445
|
+
const handleFilterChange = (0, import_react40.useCallback)(
|
|
4453
4446
|
(e) => {
|
|
4454
4447
|
setFilterValue(e.target.value);
|
|
4455
4448
|
},
|
|
4456
4449
|
[]
|
|
4457
4450
|
);
|
|
4458
|
-
const handleCheckboxToggle = (0,
|
|
4451
|
+
const handleCheckboxToggle = (0, import_react40.useCallback)((item) => {
|
|
4459
4452
|
setSelectedItems(
|
|
4460
4453
|
(prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
|
|
4461
4454
|
);
|
|
@@ -4482,15 +4475,15 @@ function getIconMultiSelect(name) {
|
|
|
4482
4475
|
}
|
|
4483
4476
|
|
|
4484
4477
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
4485
|
-
var
|
|
4478
|
+
var import_react41 = require("react");
|
|
4486
4479
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
4487
|
-
const filteredItems = (0,
|
|
4480
|
+
const filteredItems = (0, import_react41.useMemo)(
|
|
4488
4481
|
() => items.filter(
|
|
4489
4482
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
4490
4483
|
),
|
|
4491
4484
|
[items, filterValue, getItemLabel]
|
|
4492
4485
|
);
|
|
4493
|
-
const sortedItems = (0,
|
|
4486
|
+
const sortedItems = (0, import_react41.useMemo)(() => {
|
|
4494
4487
|
return [
|
|
4495
4488
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
4496
4489
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -4525,16 +4518,16 @@ function MultiSelect({
|
|
|
4525
4518
|
handleCheckboxToggle,
|
|
4526
4519
|
setOpen
|
|
4527
4520
|
} = useMultiSelectHandlers();
|
|
4528
|
-
(0,
|
|
4521
|
+
(0, import_react42.useEffect)(() => {
|
|
4529
4522
|
if (open !== void 0) {
|
|
4530
4523
|
setOpen(open);
|
|
4531
4524
|
}
|
|
4532
4525
|
}, [open, setOpen]);
|
|
4533
|
-
(0,
|
|
4526
|
+
(0, import_react42.useEffect)(() => {
|
|
4534
4527
|
setSelectedItems([]);
|
|
4535
4528
|
}, [items, setSelectedItems]);
|
|
4536
4529
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
4537
|
-
const Icon = (0,
|
|
4530
|
+
const Icon = (0, import_react42.useMemo)(() => {
|
|
4538
4531
|
var _a2;
|
|
4539
4532
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
4540
4533
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -4548,7 +4541,7 @@ function MultiSelect({
|
|
|
4548
4541
|
{ text: "Aplicar", fn: () => {
|
|
4549
4542
|
} }
|
|
4550
4543
|
];
|
|
4551
|
-
return /* @__PURE__ */
|
|
4544
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react42.default.Fragment, null, /* @__PURE__ */ import_react42.default.createElement(
|
|
4552
4545
|
import_material27.Button,
|
|
4553
4546
|
{
|
|
4554
4547
|
"test-id": "multiselect-button",
|
|
@@ -4556,11 +4549,11 @@ function MultiSelect({
|
|
|
4556
4549
|
onClick: handleOpen,
|
|
4557
4550
|
variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
|
|
4558
4551
|
size: "small",
|
|
4559
|
-
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */
|
|
4560
|
-
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */
|
|
4552
|
+
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ import_react42.default.createElement(Icon, null) : null,
|
|
4553
|
+
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ import_react42.default.createElement(Icon, null) : null
|
|
4561
4554
|
},
|
|
4562
4555
|
capitalize((_c = button == null ? void 0 : button.text) != null ? _c : "")
|
|
4563
|
-
), /* @__PURE__ */
|
|
4556
|
+
), /* @__PURE__ */ import_react42.default.createElement(
|
|
4564
4557
|
import_material27.Popover,
|
|
4565
4558
|
{
|
|
4566
4559
|
elevation: 8,
|
|
@@ -4569,7 +4562,7 @@ function MultiSelect({
|
|
|
4569
4562
|
open: openMultiselect,
|
|
4570
4563
|
onClose: () => setOpen(false)
|
|
4571
4564
|
},
|
|
4572
|
-
/* @__PURE__ */
|
|
4565
|
+
/* @__PURE__ */ import_react42.default.createElement(import_material27.Stack, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ import_react42.default.createElement(import_material27.Stack, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ import_react42.default.createElement(import_material27.FormControl, { fullWidth: true, size: "small" }, /* @__PURE__ */ import_react42.default.createElement(
|
|
4573
4566
|
import_material27.TextField,
|
|
4574
4567
|
{
|
|
4575
4568
|
sx: { background: background ? background : "transparent" },
|
|
@@ -4582,18 +4575,18 @@ function MultiSelect({
|
|
|
4582
4575
|
onChange: handleFilterChange,
|
|
4583
4576
|
slotProps: {
|
|
4584
4577
|
input: {
|
|
4585
|
-
endAdornment: /* @__PURE__ */
|
|
4578
|
+
endAdornment: /* @__PURE__ */ import_react42.default.createElement(import_material27.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react42.default.createElement(import_icons_material13.SearchOutlined, { fontSize: "small" }))
|
|
4586
4579
|
}
|
|
4587
4580
|
}
|
|
4588
4581
|
}
|
|
4589
|
-
))), /* @__PURE__ */
|
|
4582
|
+
))), /* @__PURE__ */ import_react42.default.createElement(import_material27.Stack, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ import_react42.default.createElement(import_material27.MenuItem, { dense, onClick: handleSelectAll }, /* @__PURE__ */ import_react42.default.createElement(import_material27.ListItemIcon, null, /* @__PURE__ */ import_react42.default.createElement(import_material27.Checkbox, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ import_react42.default.createElement(
|
|
4590
4583
|
import_material27.MenuItem,
|
|
4591
4584
|
{
|
|
4592
4585
|
key: getItemLabel(item),
|
|
4593
4586
|
dense,
|
|
4594
4587
|
onClick: () => handleCheckboxToggle(item)
|
|
4595
4588
|
},
|
|
4596
|
-
/* @__PURE__ */
|
|
4589
|
+
/* @__PURE__ */ import_react42.default.createElement(import_material27.ListItemIcon, null, /* @__PURE__ */ import_react42.default.createElement(
|
|
4597
4590
|
import_material27.Checkbox,
|
|
4598
4591
|
{
|
|
4599
4592
|
checked: selectedItems.includes(item),
|
|
@@ -4601,9 +4594,9 @@ function MultiSelect({
|
|
|
4601
4594
|
}
|
|
4602
4595
|
)),
|
|
4603
4596
|
getItemLabel(item)
|
|
4604
|
-
)) : /* @__PURE__ */
|
|
4597
|
+
)) : /* @__PURE__ */ import_react42.default.createElement(import_material27.MenuItem, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ import_react42.default.createElement(import_material27.Stack, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
|
|
4605
4598
|
var _a2;
|
|
4606
|
-
return /* @__PURE__ */
|
|
4599
|
+
return /* @__PURE__ */ import_react42.default.createElement(
|
|
4607
4600
|
import_material27.Button,
|
|
4608
4601
|
{
|
|
4609
4602
|
key: index,
|
|
@@ -4619,7 +4612,7 @@ function MultiSelect({
|
|
|
4619
4612
|
}
|
|
4620
4613
|
|
|
4621
4614
|
// src/Components/PageHeader/PageHeader.tsx
|
|
4622
|
-
var
|
|
4615
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
4623
4616
|
var import_material28 = require("@mui/material");
|
|
4624
4617
|
var PageHeader = ({
|
|
4625
4618
|
title,
|
|
@@ -4629,7 +4622,7 @@ var PageHeader = ({
|
|
|
4629
4622
|
fixed,
|
|
4630
4623
|
shadow = true
|
|
4631
4624
|
}) => {
|
|
4632
|
-
return /* @__PURE__ */
|
|
4625
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, /* @__PURE__ */ import_react43.default.createElement(
|
|
4633
4626
|
import_material28.Stack,
|
|
4634
4627
|
{
|
|
4635
4628
|
"data-testid": "main-container",
|
|
@@ -4641,12 +4634,12 @@ var PageHeader = ({
|
|
|
4641
4634
|
zIndex: 10,
|
|
4642
4635
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
4643
4636
|
},
|
|
4644
|
-
/* @__PURE__ */
|
|
4645
|
-
), fixed && /* @__PURE__ */
|
|
4637
|
+
/* @__PURE__ */ import_react43.default.createElement(import_material28.Stack, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ import_react43.default.createElement(import_material28.Stack, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ import_react43.default.createElement(import_material28.Stack, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ import_react43.default.createElement(import_material28.Typography, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ import_react43.default.createElement(import_material28.Typography, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.secondary" }, subtitle))), actions && /* @__PURE__ */ import_react43.default.createElement(import_material28.Stack, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
4638
|
+
), fixed && /* @__PURE__ */ import_react43.default.createElement(import_material28.Stack, { sx: { height: 48 } }));
|
|
4646
4639
|
};
|
|
4647
4640
|
|
|
4648
4641
|
// src/Components/SCAccordion.tsx
|
|
4649
|
-
var
|
|
4642
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
4650
4643
|
var import_material29 = require("@mui/material");
|
|
4651
4644
|
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
|
|
4652
4645
|
var SCAccordion = ({
|
|
@@ -4654,18 +4647,18 @@ var SCAccordion = ({
|
|
|
4654
4647
|
actions,
|
|
4655
4648
|
children
|
|
4656
4649
|
}) => {
|
|
4657
|
-
const [open, setOpen] = (0,
|
|
4658
|
-
return /* @__PURE__ */
|
|
4650
|
+
const [open, setOpen] = (0, import_react44.useState)(false);
|
|
4651
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement(import_material29.Accordion, null, /* @__PURE__ */ import_react44.default.createElement(
|
|
4659
4652
|
import_material29.AccordionSummary,
|
|
4660
4653
|
{
|
|
4661
|
-
expandIcon: /* @__PURE__ */
|
|
4654
|
+
expandIcon: /* @__PURE__ */ import_react44.default.createElement(import_ExpandMore.default, { fontSize: "small", color: "action" })
|
|
4662
4655
|
},
|
|
4663
|
-
/* @__PURE__ */
|
|
4664
|
-
), /* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ import_react44.default.createElement(import_material29.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" } }, typeof title === "string" ? /* @__PURE__ */ import_react44.default.createElement(import_material29.Typography, { noWrap: true, variant: "body1", color: "text.primary" }, title) : title, actions)
|
|
4657
|
+
), /* @__PURE__ */ import_react44.default.createElement(import_material29.AccordionDetails, { sx: { padding: "12px" } }, children)));
|
|
4665
4658
|
};
|
|
4666
4659
|
|
|
4667
4660
|
// src/Components/SCActivityCalendar.tsx
|
|
4668
|
-
var
|
|
4661
|
+
var import_react46 = __toESM(require("react"), 1);
|
|
4669
4662
|
var import_material31 = require("@mui/material");
|
|
4670
4663
|
var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
|
|
4671
4664
|
var import_AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
@@ -4675,14 +4668,14 @@ var import_locale = require("date-fns/locale");
|
|
|
4675
4668
|
var import_date_fns = require("date-fns");
|
|
4676
4669
|
|
|
4677
4670
|
// src/Components/SCListContent.tsx
|
|
4678
|
-
var
|
|
4671
|
+
var import_react45 = __toESM(require("react"), 1);
|
|
4679
4672
|
var import_material30 = require("@mui/material");
|
|
4680
4673
|
var import_Grid5 = __toESM(require("@mui/material/Grid"), 1);
|
|
4681
4674
|
var import_Avatar = __toESM(require("@mui/material/Avatar"), 1);
|
|
4682
4675
|
var Muicon7 = __toESM(require("@mui/icons-material"), 1);
|
|
4683
4676
|
var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" }) => {
|
|
4684
|
-
const [selectedIndex, setSelectedIndex] =
|
|
4685
|
-
const [value, setValue] =
|
|
4677
|
+
const [selectedIndex, setSelectedIndex] = import_react45.default.useState("1");
|
|
4678
|
+
const [value, setValue] = import_react45.default.useState("1");
|
|
4686
4679
|
options.map(function(option, index, array) {
|
|
4687
4680
|
if (option == null ? void 0 : option.iconLeft) {
|
|
4688
4681
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
@@ -4701,26 +4694,26 @@ var SCListContent = ({ options, iconLeftType = "Icon", iconRightType = "Icon" })
|
|
|
4701
4694
|
}
|
|
4702
4695
|
}
|
|
4703
4696
|
});
|
|
4704
|
-
return /* @__PURE__ */
|
|
4697
|
+
return /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement(import_material30.List, { sx: { width: "100%", bgcolor: "background.paper", padding: "0px !important" } }, options.map((option, index) => {
|
|
4705
4698
|
var _a, _b;
|
|
4706
|
-
return /* @__PURE__ */
|
|
4699
|
+
return /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, { key: index }, /* @__PURE__ */ import_react45.default.createElement(
|
|
4707
4700
|
import_material30.ListItemButton,
|
|
4708
4701
|
{
|
|
4709
4702
|
disabled: option.disable,
|
|
4710
4703
|
onClick: option.fn,
|
|
4711
4704
|
sx: { gap: 1, padding: iconLeftType == "Icon" ? "8px 8px" : "8px 8px 8px 0px" }
|
|
4712
4705
|
},
|
|
4713
|
-
option.iconLeft ? iconLeftType == "Icon" ? /* @__PURE__ */
|
|
4714
|
-
/* @__PURE__ */
|
|
4706
|
+
option.iconLeft ? iconLeftType == "Icon" ? /* @__PURE__ */ import_react45.default.createElement(import_material30.ListItemIcon, { sx: { minWidth: "0px !important" } }, /* @__PURE__ */ import_react45.default.createElement(import_material30.SvgIcon, { fontSize: "small", sx: { color: option.iconLeftColor || "action" }, component: option.iconLeft })) : /* @__PURE__ */ import_react45.default.createElement(import_Avatar.default, { sx: { width: 25, height: 25, fontSize: "11px", bgcolor: option.iconLeftColor ? `${option.iconLeftColor}.main` : "default" } }, ((_a = option.iconLeft) == null ? void 0 : _a.type) != void 0 ? /* @__PURE__ */ import_react45.default.createElement(import_material30.SvgIcon, { fontSize: "small", component: option.iconLeft }) : option.iconLeft) : "",
|
|
4707
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
4715
4708
|
import_material30.ListItemText,
|
|
4716
4709
|
{
|
|
4717
4710
|
sx: { color: option.colorDisabled == true ? "text.disabled" : "default" },
|
|
4718
4711
|
primary: option.title,
|
|
4719
|
-
secondary: /* @__PURE__ */
|
|
4712
|
+
secondary: /* @__PURE__ */ import_react45.default.createElement(import_Grid5.default, { gap: 0.5 }, /* @__PURE__ */ import_react45.default.createElement(import_Grid5.default, { container: true, gap: 0.5, sx: { color: option.colorDisabled == true ? "text.disabled" : "default" } }, option.subtitle), /* @__PURE__ */ import_react45.default.createElement(import_Grid5.default, { container: true, gap: 0.5, sx: { color: option.colorDisabled == true ? "text.disabled" : "default" } }, option.description))
|
|
4720
4713
|
}
|
|
4721
4714
|
),
|
|
4722
|
-
option.iconRight ? iconRightType == "Icon" ? /* @__PURE__ */
|
|
4723
|
-
), option.divider == true ? /* @__PURE__ */
|
|
4715
|
+
option.iconRight ? iconRightType == "Icon" ? /* @__PURE__ */ import_react45.default.createElement(import_material30.ListItemIcon, { sx: { minWidth: "0px !important", marginRight: "8px" } }, /* @__PURE__ */ import_react45.default.createElement(import_material30.SvgIcon, { fontSize: "small", sx: { color: option.iconRightColor || "action" }, component: option.iconRight })) : /* @__PURE__ */ import_react45.default.createElement(import_Avatar.default, { variant: "circular", sx: { width: 20, height: 20 } }, ((_b = option.iconRight) == null ? void 0 : _b.type) != void 0 ? /* @__PURE__ */ import_react45.default.createElement(import_material30.SvgIcon, { fontSize: "small", color: option.iconRightColor || "action", component: option.iconRight }) : option.iconRight) : ""
|
|
4716
|
+
), option.divider == true ? /* @__PURE__ */ import_react45.default.createElement(import_material30.Divider, null) : "");
|
|
4724
4717
|
})));
|
|
4725
4718
|
};
|
|
4726
4719
|
|
|
@@ -4746,22 +4739,22 @@ var SCActivityCalendar = ({
|
|
|
4746
4739
|
configRangeHour
|
|
4747
4740
|
}) => {
|
|
4748
4741
|
let convertFecha;
|
|
4749
|
-
const [fecha, setFecha] = (0,
|
|
4750
|
-
const [fechaSeleccionada, setFechaSeleccionada] = (0,
|
|
4751
|
-
const [stateVal, setstateVal] =
|
|
4752
|
-
const [openCalendar, setOpenCalendar] =
|
|
4753
|
-
const [anchorPopoverFiltro, setAnchorPopoverFiltro] = (0,
|
|
4754
|
-
const [datosEventos, setDatosEventos] =
|
|
4742
|
+
const [fecha, setFecha] = (0, import_react46.useState)(/* @__PURE__ */ new Date());
|
|
4743
|
+
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react46.useState)();
|
|
4744
|
+
const [stateVal, setstateVal] = import_react46.default.useState(/* @__PURE__ */ new Date());
|
|
4745
|
+
const [openCalendar, setOpenCalendar] = import_react46.default.useState(false);
|
|
4746
|
+
const [anchorPopoverFiltro, setAnchorPopoverFiltro] = (0, import_react46.useState)(null);
|
|
4747
|
+
const [datosEventos, setDatosEventos] = import_react46.default.useState(events);
|
|
4755
4748
|
const openPopoverFiltro = Boolean(anchorPopoverFiltro);
|
|
4756
4749
|
const hoy = /* @__PURE__ */ new Date();
|
|
4757
4750
|
const inicioSemana = (0, import_date_fns.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
4758
4751
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns.addDays)(inicioSemana, i));
|
|
4759
|
-
|
|
4752
|
+
import_react46.default.useEffect(() => {
|
|
4760
4753
|
if (fecha != null) {
|
|
4761
4754
|
handleConvertFecha(fecha);
|
|
4762
4755
|
}
|
|
4763
4756
|
}, [fecha]);
|
|
4764
|
-
|
|
4757
|
+
import_react46.default.useEffect(() => {
|
|
4765
4758
|
if (events != null) {
|
|
4766
4759
|
setDatosEventos(events);
|
|
4767
4760
|
}
|
|
@@ -4801,7 +4794,7 @@ var SCActivityCalendar = ({
|
|
|
4801
4794
|
setDatosEventos(resultado);
|
|
4802
4795
|
}
|
|
4803
4796
|
};
|
|
4804
|
-
return /* @__PURE__ */
|
|
4797
|
+
return /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement(import_LocalizationProvider2.LocalizationProvider, { dateAdapter: import_AdapterDateFns.AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { sx: { width: "100%", padding: "0px", background: "transparent" } }, /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 16px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns.format)(dia, "EEEE", { locale: import_locale.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react46.default.createElement(
|
|
4805
4798
|
import_material31.Box,
|
|
4806
4799
|
{
|
|
4807
4800
|
onClick: () => setFecha(dia),
|
|
@@ -4814,8 +4807,8 @@ var SCActivityCalendar = ({
|
|
|
4814
4807
|
position: "relative"
|
|
4815
4808
|
}
|
|
4816
4809
|
},
|
|
4817
|
-
/* @__PURE__ */
|
|
4818
|
-
)))), /* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { sx: { fontSize: "12px !important", color: (0, import_date_fns.isSameDay)(dia, fecha) ? "white" : "#101840DE" } }, (0, import_date_fns.format)(dia, "d"))
|
|
4811
|
+
)))), /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react46.default.createElement(import_material31.IconButton, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ import_react46.default.createElement(import_KeyboardDoubleArrowDown.default, { color: "action" }))))) : /* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ import_react46.default.createElement(
|
|
4819
4812
|
import_StaticDatePicker.StaticDatePicker,
|
|
4820
4813
|
{
|
|
4821
4814
|
orientation: "landscape",
|
|
@@ -4840,7 +4833,7 @@ var SCActivityCalendar = ({
|
|
|
4840
4833
|
},
|
|
4841
4834
|
onChange: (newValue) => setFecha(newValue)
|
|
4842
4835
|
}
|
|
4843
|
-
), /* @__PURE__ */
|
|
4836
|
+
), /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react46.default.createElement(import_material31.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react46.default.createElement(import_KeyboardDoubleArrowUp.default, { color: "action" }))))), /* @__PURE__ */ import_react46.default.createElement(import_material31.IconButton, { onClick: handleClickPopoverFiltro, sx: { position: "fixed", right: "calc(100% - 96%)", top: openCalendar == false ? "220px" : "444px" } }, /* @__PURE__ */ import_react46.default.createElement(import_FilterList.default, { color: "action" })), /* @__PURE__ */ import_react46.default.createElement(
|
|
4844
4837
|
import_material31.Popover,
|
|
4845
4838
|
{
|
|
4846
4839
|
open: openPopoverFiltro,
|
|
@@ -4851,7 +4844,7 @@ var SCActivityCalendar = ({
|
|
|
4851
4844
|
horizontal: "right"
|
|
4852
4845
|
}
|
|
4853
4846
|
},
|
|
4854
|
-
/* @__PURE__ */
|
|
4847
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
4855
4848
|
import_material31.Menu,
|
|
4856
4849
|
{
|
|
4857
4850
|
id: "basic-menu",
|
|
@@ -4864,24 +4857,24 @@ var SCActivityCalendar = ({
|
|
|
4864
4857
|
}
|
|
4865
4858
|
}
|
|
4866
4859
|
},
|
|
4867
|
-
/* @__PURE__ */
|
|
4868
|
-
/* @__PURE__ */
|
|
4869
|
-
/* @__PURE__ */
|
|
4870
|
-
/* @__PURE__ */
|
|
4860
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Todo") }, /* @__PURE__ */ import_react46.default.createElement(import_material31.ListItemIcon, null, /* @__PURE__ */ import_react46.default.createElement(import_CalendarMonthOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "inherit" }, "Ver todo")),
|
|
4861
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Finalizada") }, /* @__PURE__ */ import_react46.default.createElement(import_material31.ListItemIcon, null, /* @__PURE__ */ import_react46.default.createElement(import_CheckCircleOutlineOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "inherit" }, "Ver finalizadas")),
|
|
4862
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.MenuItem, { onClick: (event2) => filtrarActividad(event2, "Aplazada") }, /* @__PURE__ */ import_react46.default.createElement(import_material31.ListItemIcon, null, /* @__PURE__ */ import_react46.default.createElement(import_EventBusyOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "inherit" }, "Ver aplazadas")),
|
|
4863
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.MenuItem, { onClick: (event2) => filtrarActividad(event2, "En progreso") }, /* @__PURE__ */ import_react46.default.createElement(import_material31.ListItemIcon, null, /* @__PURE__ */ import_react46.default.createElement(import_PendingOutlined.default, { fontSize: "small" })), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "inherit" }, "Ver en progreso"))
|
|
4871
4864
|
)
|
|
4872
|
-
), /* @__PURE__ */
|
|
4865
|
+
), /* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { sx: { boxSizing: "border-box", padding: "0px 16px", width: "100%", height: openCalendar ? "calc(91% - 316px)" : "calc(91% - 100px)", background: "white", display: "flex", flexDirection: "column", overflowY: "auto", gap: "8px", scrollSnapType: "x mandatory", paddingBottom: "10px" } }, diasSemana.map((day, dayIndex) => /* @__PURE__ */ import_react46.default.createElement(
|
|
4873
4866
|
import_material31.Box,
|
|
4874
4867
|
{
|
|
4875
4868
|
key: dayIndex
|
|
4876
4869
|
},
|
|
4877
|
-
/* @__PURE__ */
|
|
4870
|
+
/* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { container: true }, /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "subtitle1", sx: { color: (0, import_date_fns.isSameDay)(day, fecha) ? "info.dark" : "text.secondary" } }, day.toLocaleDateString("es-ES", {
|
|
4878
4871
|
day: "numeric"
|
|
4879
4872
|
}), " de ", day.toLocaleDateString("es-ES", {
|
|
4880
4873
|
month: "short"
|
|
4881
4874
|
}), ", ", day.toLocaleDateString("es-ES", {
|
|
4882
4875
|
weekday: "long"
|
|
4883
4876
|
}))),
|
|
4884
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ import_react46.default.createElement(import_material31.Box, { sx: {
|
|
4885
4878
|
display: "flex",
|
|
4886
4879
|
flexDirection: "column"
|
|
4887
4880
|
} }, (() => {
|
|
@@ -4890,16 +4883,16 @@ var SCActivityCalendar = ({
|
|
|
4890
4883
|
(event2) => (/* @__PURE__ */ new Date(event2.date + "T00:00:00")).toDateString() === day.toDateString()
|
|
4891
4884
|
);
|
|
4892
4885
|
if (eventosDelDia.length > 0) {
|
|
4893
|
-
return eventosDelDia.map((event2, idx) => /* @__PURE__ */
|
|
4886
|
+
return eventosDelDia.map((event2, idx) => /* @__PURE__ */ import_react46.default.createElement(
|
|
4894
4887
|
SCListContent,
|
|
4895
4888
|
{
|
|
4896
4889
|
key: idx,
|
|
4897
4890
|
options: [{
|
|
4898
4891
|
title: event2.activityDescription,
|
|
4899
|
-
subtitle: /* @__PURE__ */
|
|
4892
|
+
subtitle: /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, configRangeHour && (/* @__PURE__ */ new Date(event2.date + "T" + event2.startTime)).getHours() === (/* @__PURE__ */ new Date(event2.date + "T" + configRangeHour.split("-")[0])).getHours() && (/* @__PURE__ */ new Date(event2.date + "T" + event2.finalTime)).getHours() === (/* @__PURE__ */ new Date(event2.date + "T" + configRangeHour.split("-")[1])).getHours() && (/* @__PURE__ */ new Date(event2.date + "T" + event2.startTime)).getMinutes() === (/* @__PURE__ */ new Date(event2.date + "T" + configRangeHour.split("-")[0])).getMinutes() && (/* @__PURE__ */ new Date(event2.date + "T" + event2.finalTime)).getMinutes() === (/* @__PURE__ */ new Date(event2.date + "T" + configRangeHour.split("-")[1])).getMinutes() ? /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "body2" }, "Todo el dia"), /* @__PURE__ */ import_react46.default.createElement(import_LightModeOutlined.default, { fontSize: "small" })) : /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "body2" }, (/* @__PURE__ */ new Date(event2.date + "T" + event2.startTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })), /* @__PURE__ */ import_react46.default.createElement(import_ArrowForward.default, { fontSize: "small" }), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "body2" }, (/* @__PURE__ */ new Date(event2.date + "T" + event2.finalTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })))),
|
|
4900
4893
|
iconLeftColor: event2.state === "Finalizada" ? "#C7E49D" : "action",
|
|
4901
4894
|
iconLeft: event2.state === "Finalizada" ? "CheckCircle" : event2.state === "Aplazada" ? "EventBusyOutlined" : event2.state === "En progreso" ? "PendingOutlined" : "RadioButtonUnchecked",
|
|
4902
|
-
description: /* @__PURE__ */
|
|
4895
|
+
description: /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { display: "flex", flexDirection: "column", alignItems: "flex-start" }, event2.state === "Aplazada" || event2.state === "En progreso" || event2.state === "Auto asignada" ? /* @__PURE__ */ import_react46.default.createElement(import_Grid6.default, { display: "flex", flexDirection: "row", alignItems: "center", gap: 0.5, sx: { marginLeft: "7px" } }, /* @__PURE__ */ import_react46.default.createElement(import_material31.Badge, { variant: "dot", badgeContent: "", sx: { display: "flex", alignItems: "center", "& .MuiBadge-badge": { top: "50%", transform: "translateY(-50%)" }, color: "action" } }), /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "body2" }, event2.state == "Auto asignada" ? "Adicional" : event2.state)) : null, /* @__PURE__ */ import_react46.default.createElement(import_material31.Typography, { variant: "body1" }, event2.equipmentDescription)),
|
|
4903
4896
|
divider: eventosDelDia.length === idx + 1 ? false : true,
|
|
4904
4897
|
colorDisabled: event2.state === "Finalizada" || event2.state === "Aplazada" || event2.state === "En progreso" ? true : false,
|
|
4905
4898
|
fn: fn ? () => fn(event2) : void 0
|
|
@@ -4907,7 +4900,7 @@ var SCActivityCalendar = ({
|
|
|
4907
4900
|
}
|
|
4908
4901
|
));
|
|
4909
4902
|
} else {
|
|
4910
|
-
return /* @__PURE__ */
|
|
4903
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
4911
4904
|
SCListContent,
|
|
4912
4905
|
{
|
|
4913
4906
|
options: [{
|
|
@@ -4923,7 +4916,7 @@ var SCActivityCalendar = ({
|
|
|
4923
4916
|
};
|
|
4924
4917
|
|
|
4925
4918
|
// src/Components/SCAlert.tsx
|
|
4926
|
-
var
|
|
4919
|
+
var import_react47 = __toESM(require("react"), 1);
|
|
4927
4920
|
var import_material32 = require("@mui/material");
|
|
4928
4921
|
var SCAlert = ({
|
|
4929
4922
|
title,
|
|
@@ -4938,7 +4931,7 @@ var SCAlert = ({
|
|
|
4938
4931
|
const handleClose = (event2) => {
|
|
4939
4932
|
setOpenState(false);
|
|
4940
4933
|
};
|
|
4941
|
-
return /* @__PURE__ */
|
|
4934
|
+
return /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null, openState && /* @__PURE__ */ import_react47.default.createElement(
|
|
4942
4935
|
import_material32.Alert,
|
|
4943
4936
|
__spreadProps(__spreadValues({
|
|
4944
4937
|
severity,
|
|
@@ -4953,16 +4946,16 @@ var SCAlert = ({
|
|
|
4953
4946
|
}
|
|
4954
4947
|
})
|
|
4955
4948
|
}),
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
subtitle ? /* @__PURE__ */
|
|
4949
|
+
/* @__PURE__ */ import_react47.default.createElement(import_material32.AlertTitle, null, title),
|
|
4950
|
+
subtitle ? /* @__PURE__ */ import_react47.default.createElement(import_material32.Typography, { variant: "body3" }, subtitle) : null
|
|
4958
4951
|
));
|
|
4959
4952
|
};
|
|
4960
4953
|
|
|
4961
4954
|
// src/Components/SCAppBar.tsx
|
|
4962
|
-
var
|
|
4955
|
+
var import_react48 = __toESM(require("react"), 1);
|
|
4963
4956
|
var import_material33 = require("@mui/material");
|
|
4964
4957
|
var import_Grid7 = __toESM(require("@mui/material/Grid"), 1);
|
|
4965
|
-
var
|
|
4958
|
+
var import_es4 = require("dayjs/locale/es");
|
|
4966
4959
|
var import_Menu = __toESM(require("@mui/icons-material/Menu"), 1);
|
|
4967
4960
|
var import_ArrowBack = __toESM(require("@mui/icons-material/ArrowBack"), 1);
|
|
4968
4961
|
var import_icons_material14 = require("@mui/icons-material");
|
|
@@ -4975,8 +4968,8 @@ var SCAppBar = ({
|
|
|
4975
4968
|
visibleConexion = true,
|
|
4976
4969
|
visibleMenu = true
|
|
4977
4970
|
}) => {
|
|
4978
|
-
const [isOnline, setIsOnline] = (0,
|
|
4979
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
4971
|
+
const [isOnline, setIsOnline] = (0, import_react48.useState)(window.navigator.onLine);
|
|
4972
|
+
const [anchorEl, setAnchorEl] = (0, import_react48.useState)(null);
|
|
4980
4973
|
const openMenu = Boolean(anchorEl);
|
|
4981
4974
|
const handleMenuClick = (event2) => {
|
|
4982
4975
|
setAnchorEl(event2.currentTarget);
|
|
@@ -4984,7 +4977,7 @@ var SCAppBar = ({
|
|
|
4984
4977
|
const handleMenuClose = () => {
|
|
4985
4978
|
setAnchorEl(null);
|
|
4986
4979
|
};
|
|
4987
|
-
(0,
|
|
4980
|
+
(0, import_react48.useEffect)(() => {
|
|
4988
4981
|
const handleOnline = () => {
|
|
4989
4982
|
setIsOnline(true);
|
|
4990
4983
|
};
|
|
@@ -4998,7 +4991,7 @@ var SCAppBar = ({
|
|
|
4998
4991
|
window.removeEventListener("offline", handleOffline);
|
|
4999
4992
|
};
|
|
5000
4993
|
}, []);
|
|
5001
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(import_Grid7.default, { sx: { display: "flex", flexDirection: "column" } }, /* @__PURE__ */ import_react48.default.createElement(import_Grid7.default, { size: 12, sx: { display: "flex", flexDirection: "row", alignItems: "center", background, padding: "0px 16px", justifyContent: "space-between" } }, visibleVolver && /* @__PURE__ */ import_react48.default.createElement(import_material33.IconButton, { size: "medium", onClick: fnVolver }, /* @__PURE__ */ import_react48.default.createElement(import_ArrowBack.default, { color: "action" })), /* @__PURE__ */ import_react48.default.createElement(import_Grid7.default, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, visibleConexion && /* @__PURE__ */ import_react48.default.createElement(import_Grid7.default, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, isOnline ? /* @__PURE__ */ import_react48.default.createElement(import_icons_material14.Wifi, { color: "action", sx: { marginRight: "8px" } }) : /* @__PURE__ */ import_react48.default.createElement(import_icons_material14.WifiOff, { color: "action", sx: { marginRight: "8px" } }), /* @__PURE__ */ import_react48.default.createElement(
|
|
5002
4995
|
import_material33.Badge,
|
|
5003
4996
|
{
|
|
5004
4997
|
anchorOrigin: {
|
|
@@ -5013,7 +5006,7 @@ var SCAppBar = ({
|
|
|
5013
5006
|
},
|
|
5014
5007
|
color: isOnline ? "success" : "error"
|
|
5015
5008
|
}
|
|
5016
|
-
), /* @__PURE__ */
|
|
5009
|
+
), /* @__PURE__ */ import_react48.default.createElement(import_material33.Typography, { variant: "caption", color: "text.secondary" }, isOnline ? "Online" : "Offline")), visibleMenu && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(import_material33.IconButton, { size: "medium", onClick: handleMenuClick }, /* @__PURE__ */ import_react48.default.createElement(import_Menu.default, { color: "action" })), /* @__PURE__ */ import_react48.default.createElement(
|
|
5017
5010
|
import_material33.Menu,
|
|
5018
5011
|
{
|
|
5019
5012
|
anchorEl,
|
|
@@ -5029,12 +5022,12 @@ var SCAppBar = ({
|
|
|
5029
5022
|
},
|
|
5030
5023
|
sx: { zIndex: "2000" }
|
|
5031
5024
|
},
|
|
5032
|
-
options.map((option, index) => /* @__PURE__ */
|
|
5033
|
-
)))), /* @__PURE__ */
|
|
5025
|
+
options.map((option, index) => /* @__PURE__ */ import_react48.default.createElement(import_material33.MenuItem, { onClick: option.fn, disabled: option.disabled, key: index }, /* @__PURE__ */ import_react48.default.createElement(import_material33.Typography, { variant: "body2" }, option.name)))
|
|
5026
|
+
)))), /* @__PURE__ */ import_react48.default.createElement(import_material33.Box, { sx: { padding: "8px 16px 0px 16px" } }, contenidoExtra)));
|
|
5034
5027
|
};
|
|
5035
5028
|
|
|
5036
5029
|
// src/Components/SCCalendarSwipeable.tsx
|
|
5037
|
-
var
|
|
5030
|
+
var import_react49 = __toESM(require("react"), 1);
|
|
5038
5031
|
var import_material34 = require("@mui/material");
|
|
5039
5032
|
var import_Grid8 = __toESM(require("@mui/material/Grid"), 1);
|
|
5040
5033
|
var import_AdapterDateFns2 = require("@mui/x-date-pickers/AdapterDateFns");
|
|
@@ -5053,14 +5046,14 @@ var SCCalendarSwipeable = ({
|
|
|
5053
5046
|
state
|
|
5054
5047
|
}) => {
|
|
5055
5048
|
let convertFecha;
|
|
5056
|
-
const [fecha, setFecha] = (0,
|
|
5057
|
-
const [fechaSeleccionada, setFechaSeleccionada] = (0,
|
|
5058
|
-
const [stateVal, setstateVal] =
|
|
5059
|
-
const [openCalendar, setOpenCalendar] =
|
|
5049
|
+
const [fecha, setFecha] = (0, import_react49.useState)(/* @__PURE__ */ new Date());
|
|
5050
|
+
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react49.useState)();
|
|
5051
|
+
const [stateVal, setstateVal] = import_react49.default.useState(/* @__PURE__ */ new Date());
|
|
5052
|
+
const [openCalendar, setOpenCalendar] = import_react49.default.useState(false);
|
|
5060
5053
|
const hoy = /* @__PURE__ */ new Date();
|
|
5061
5054
|
const inicioSemana = (0, import_date_fns2.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
5062
5055
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns2.addDays)(inicioSemana, i));
|
|
5063
|
-
|
|
5056
|
+
import_react49.default.useEffect(() => {
|
|
5064
5057
|
if (fecha != null) {
|
|
5065
5058
|
handleConvertFecha(fecha);
|
|
5066
5059
|
}
|
|
@@ -5084,7 +5077,7 @@ var SCCalendarSwipeable = ({
|
|
|
5084
5077
|
// 0 = domingo, 1 = lunes
|
|
5085
5078
|
})
|
|
5086
5079
|
});
|
|
5087
|
-
return /* @__PURE__ */
|
|
5080
|
+
return /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(import_LocalizationProvider3.LocalizationProvider, { dateAdapter: import_AdapterDateFns2.AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ import_react49.default.createElement(import_material34.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react49.default.createElement(import_material34.Box, { sx: { width: "100%", padding: "0px 16px", background: "transparent" } }, /* @__PURE__ */ import_react49.default.createElement(import_Grid8.default, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 0px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ import_react49.default.createElement(import_Grid8.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react49.default.createElement(import_material34.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react49.default.createElement(import_material34.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns2.format)(dia, "EEEE", { locale: import_locale2.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react49.default.createElement(
|
|
5088
5081
|
import_material34.Box,
|
|
5089
5082
|
{
|
|
5090
5083
|
onClick: () => setFecha(dia),
|
|
@@ -5100,8 +5093,8 @@ var SCCalendarSwipeable = ({
|
|
|
5100
5093
|
//height: '36px',
|
|
5101
5094
|
}
|
|
5102
5095
|
},
|
|
5103
|
-
/* @__PURE__ */
|
|
5104
|
-
)))), /* @__PURE__ */
|
|
5096
|
+
/* @__PURE__ */ import_react49.default.createElement(import_material34.Typography, { sx: { fontSize: "12px !important", color: (0, import_date_fns2.isSameDay)(dia, fecha) ? "white" : "#101840DE" } }, (0, import_date_fns2.format)(dia, "d"))
|
|
5097
|
+
)))), /* @__PURE__ */ import_react49.default.createElement(import_Grid8.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react49.default.createElement(import_material34.IconButton, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ import_react49.default.createElement(import_KeyboardDoubleArrowDown2.default, null))))) : /* @__PURE__ */ import_react49.default.createElement(import_material34.Box, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ import_react49.default.createElement(
|
|
5105
5098
|
import_StaticDatePicker2.StaticDatePicker,
|
|
5106
5099
|
{
|
|
5107
5100
|
orientation: "landscape",
|
|
@@ -5126,11 +5119,11 @@ var SCCalendarSwipeable = ({
|
|
|
5126
5119
|
},
|
|
5127
5120
|
onChange: (newValue) => setFecha(newValue)
|
|
5128
5121
|
}
|
|
5129
|
-
), /* @__PURE__ */
|
|
5122
|
+
), /* @__PURE__ */ import_react49.default.createElement(import_Grid8.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react49.default.createElement(import_material34.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react49.default.createElement(import_KeyboardDoubleArrowUp2.default, null))))));
|
|
5130
5123
|
};
|
|
5131
5124
|
|
|
5132
5125
|
// src/Components/SCCard.tsx
|
|
5133
|
-
var
|
|
5126
|
+
var import_react50 = __toESM(require("react"), 1);
|
|
5134
5127
|
var import_material35 = require("@mui/material");
|
|
5135
5128
|
var import_IconButton = __toESM(require("@mui/material/IconButton"), 1);
|
|
5136
5129
|
var import_Card = __toESM(require("@mui/material/Card"), 1);
|
|
@@ -5144,7 +5137,7 @@ var Muicon8 = __toESM(require("@mui/icons-material"), 1);
|
|
|
5144
5137
|
var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, dividerHeader, content, actions, dividerActions, contentExpand }) => {
|
|
5145
5138
|
let iconTitleValidation = "";
|
|
5146
5139
|
let IconTitle;
|
|
5147
|
-
const [expanded, setExpanded] =
|
|
5140
|
+
const [expanded, setExpanded] = import_react50.default.useState(false);
|
|
5148
5141
|
if (iconTitle) {
|
|
5149
5142
|
if (typeof iconTitle === "string" && /\.(png|jpg|jpeg|gif|svg|webp)$/i.test(iconTitle)) {
|
|
5150
5143
|
iconTitleValidation = "image";
|
|
@@ -5160,11 +5153,11 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, dividerH
|
|
|
5160
5153
|
const handleExpandClick = () => {
|
|
5161
5154
|
setExpanded(!expanded);
|
|
5162
5155
|
};
|
|
5163
|
-
return /* @__PURE__ */
|
|
5156
|
+
return /* @__PURE__ */ import_react50.default.createElement(import_Card.default, { sx: { width: width || "auto" } }, title && /* @__PURE__ */ import_react50.default.createElement(
|
|
5164
5157
|
import_CardHeader.default,
|
|
5165
5158
|
{
|
|
5166
|
-
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */
|
|
5167
|
-
action: actionsTitle == "expand" ? /* @__PURE__ */
|
|
5159
|
+
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ import_react50.default.createElement(import_material35.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react50.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react50.default.createElement(import_material35.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
5160
|
+
action: actionsTitle == "expand" ? /* @__PURE__ */ import_react50.default.createElement(import_IconButton.default, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ import_react50.default.createElement(import_ExpandMore2.default, { fontSize: "small" })) : actionsTitle,
|
|
5168
5161
|
title,
|
|
5169
5162
|
subheader: subtitle,
|
|
5170
5163
|
sx: {
|
|
@@ -5183,18 +5176,18 @@ var SCCard = ({ width, title, image, iconTitle, actionsTitle, subtitle, dividerH
|
|
|
5183
5176
|
}
|
|
5184
5177
|
}
|
|
5185
5178
|
}
|
|
5186
|
-
), dividerHeader && title && /* @__PURE__ */
|
|
5179
|
+
), dividerHeader && title && /* @__PURE__ */ import_react50.default.createElement(import_material35.Divider, { variant: "fullWidth" }), image && /* @__PURE__ */ import_react50.default.createElement(
|
|
5187
5180
|
import_CardMedia.default,
|
|
5188
5181
|
{
|
|
5189
5182
|
component: "img",
|
|
5190
5183
|
height: "194",
|
|
5191
5184
|
image
|
|
5192
5185
|
}
|
|
5193
|
-
), content && /* @__PURE__ */
|
|
5186
|
+
), content && /* @__PURE__ */ import_react50.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, content), dividerActions && /* @__PURE__ */ import_react50.default.createElement(import_material35.Divider, { variant: "fullWidth" }), actions && /* @__PURE__ */ import_react50.default.createElement(import_CardActions.default, null, actions), contentExpand && /* @__PURE__ */ import_react50.default.createElement(import_Collapse.default, { in: expanded, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ import_react50.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, contentExpand)));
|
|
5194
5187
|
};
|
|
5195
5188
|
|
|
5196
5189
|
// src/Components/SCDataGrid.tsx
|
|
5197
|
-
var
|
|
5190
|
+
var import_react51 = __toESM(require("react"), 1);
|
|
5198
5191
|
var import_x_data_grid_pro = require("@mui/x-data-grid-pro");
|
|
5199
5192
|
var import_x_license2 = require("@mui/x-license");
|
|
5200
5193
|
var import_KeyboardArrowDown = __toESM(require("@mui/icons-material/KeyboardArrowDown"), 1);
|
|
@@ -5285,7 +5278,7 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5285
5278
|
label = label;
|
|
5286
5279
|
}
|
|
5287
5280
|
}
|
|
5288
|
-
return /* @__PURE__ */
|
|
5281
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
5289
5282
|
"div",
|
|
5290
5283
|
{
|
|
5291
5284
|
style: {
|
|
@@ -5303,7 +5296,7 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5303
5296
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
5304
5297
|
}
|
|
5305
5298
|
},
|
|
5306
|
-
params.rowNode.type === "group" && /* @__PURE__ */
|
|
5299
|
+
params.rowNode.type === "group" && /* @__PURE__ */ import_react51.default.createElement(
|
|
5307
5300
|
"span",
|
|
5308
5301
|
{
|
|
5309
5302
|
style: {
|
|
@@ -5316,7 +5309,7 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5316
5309
|
params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
5317
5310
|
}
|
|
5318
5311
|
},
|
|
5319
|
-
params.rowNode.childrenExpanded ? /* @__PURE__ */
|
|
5312
|
+
params.rowNode.childrenExpanded ? /* @__PURE__ */ import_react51.default.createElement(import_KeyboardArrowUp.default, { fontSize: "small", color: "action" }) : /* @__PURE__ */ import_react51.default.createElement(import_KeyboardArrowDown.default, { fontSize: "small", color: "action" })
|
|
5320
5313
|
),
|
|
5321
5314
|
label
|
|
5322
5315
|
);
|
|
@@ -5358,18 +5351,18 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5358
5351
|
let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 31 : 32;
|
|
5359
5352
|
let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
|
|
5360
5353
|
let validationGroupingColDef = groupingColDefs || {};
|
|
5361
|
-
const [groupDataLenght, setGroupDataLengh] = (0,
|
|
5362
|
-
const [pageSize, setPageSize] = (0,
|
|
5363
|
-
const [arrayRows, setArrayRows] = (0,
|
|
5364
|
-
const [selectionModel, setSelectionModel] = (0,
|
|
5365
|
-
(0,
|
|
5354
|
+
const [groupDataLenght, setGroupDataLengh] = (0, import_react51.useState)(0);
|
|
5355
|
+
const [pageSize, setPageSize] = (0, import_react51.useState)(rows);
|
|
5356
|
+
const [arrayRows, setArrayRows] = (0, import_react51.useState)([]);
|
|
5357
|
+
const [selectionModel, setSelectionModel] = (0, import_react51.useState)([]);
|
|
5358
|
+
(0, import_react51.useEffect)(() => {
|
|
5366
5359
|
var _a;
|
|
5367
5360
|
if (setSelectedRow) {
|
|
5368
5361
|
setSelectedRow(arrayRows[selectedIndex]);
|
|
5369
5362
|
setSelectionModel(((_a = arrayRows[selectedIndex]) == null ? void 0 : _a.id) ? [arrayRows[selectedIndex].id] : []);
|
|
5370
5363
|
}
|
|
5371
5364
|
}, [selectedIndex]);
|
|
5372
|
-
(0,
|
|
5365
|
+
(0, import_react51.useEffect)(() => {
|
|
5373
5366
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
5374
5367
|
dataConvertRows(data, void 0);
|
|
5375
5368
|
}
|
|
@@ -5458,12 +5451,12 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5458
5451
|
if (Object.keys(columnVisibilityModel).length > 0) {
|
|
5459
5452
|
initialState.columns = { columnVisibilityModel };
|
|
5460
5453
|
}
|
|
5461
|
-
(0,
|
|
5454
|
+
(0, import_react51.useEffect)(() => {
|
|
5462
5455
|
if (apiRef.current && Object.keys(columnVisibilityModel).length > 0) {
|
|
5463
5456
|
apiRef.current.setColumnVisibilityModel(columnVisibilityModel);
|
|
5464
5457
|
}
|
|
5465
5458
|
}, [columnVisibilityModel, apiRef]);
|
|
5466
|
-
return /* @__PURE__ */
|
|
5459
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, data && /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, /* @__PURE__ */ import_react51.default.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ import_react51.default.createElement(
|
|
5467
5460
|
import_x_data_grid_pro.DataGridPro,
|
|
5468
5461
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
5469
5462
|
getRowId,
|
|
@@ -5627,22 +5620,22 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, titleRowsPag
|
|
|
5627
5620
|
})
|
|
5628
5621
|
))));
|
|
5629
5622
|
}
|
|
5630
|
-
var SCDataGrid =
|
|
5623
|
+
var SCDataGrid = import_react51.default.memo(SCDataGridInitial, (prevProps, nextProps) => {
|
|
5631
5624
|
const isEqual = prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight;
|
|
5632
5625
|
return isEqual;
|
|
5633
5626
|
});
|
|
5634
5627
|
|
|
5635
5628
|
// src/Components/SCDatePicker.tsx
|
|
5636
|
-
var
|
|
5629
|
+
var import_react52 = __toESM(require("react"), 1);
|
|
5637
5630
|
var import_DatePicker = require("@mui/x-date-pickers/DatePicker");
|
|
5638
|
-
var import_es4 = require("dayjs/locale/es");
|
|
5639
|
-
var import_dayjs10 = __toESM(require("dayjs"), 1);
|
|
5640
5631
|
var import_es5 = require("dayjs/locale/es");
|
|
5632
|
+
var import_dayjs10 = __toESM(require("dayjs"), 1);
|
|
5633
|
+
var import_es6 = require("dayjs/locale/es");
|
|
5641
5634
|
var import_LocalizationProvider4 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
5642
5635
|
var import_AdapterDayjs2 = require("@mui/x-date-pickers/AdapterDayjs");
|
|
5643
5636
|
var import_InsertInvitationOutlined2 = __toESM(require("@mui/icons-material/InsertInvitationOutlined"), 1);
|
|
5644
5637
|
var SCDatePicker = ({ label, required, disabled, background, state, setState, width, minDate, maxDate }) => {
|
|
5645
|
-
return /* @__PURE__ */
|
|
5638
|
+
return /* @__PURE__ */ import_react52.default.createElement(import_LocalizationProvider4.LocalizationProvider, { dateAdapter: import_AdapterDayjs2.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5646
5639
|
import_DatePicker.DatePicker,
|
|
5647
5640
|
{
|
|
5648
5641
|
disabled,
|
|
@@ -5698,7 +5691,7 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
|
|
|
5698
5691
|
};
|
|
5699
5692
|
|
|
5700
5693
|
// src/Components/SCDialog.tsx
|
|
5701
|
-
var
|
|
5694
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
5702
5695
|
var import_material36 = require("@mui/material");
|
|
5703
5696
|
var import_Grid9 = __toESM(require("@mui/material/Grid"), 1);
|
|
5704
5697
|
var import_ToggleButton = __toESM(require("@mui/material/ToggleButton"), 1);
|
|
@@ -5710,8 +5703,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5710
5703
|
let iconTitleValidation = "";
|
|
5711
5704
|
let IconTitle;
|
|
5712
5705
|
let ButtonIcon;
|
|
5713
|
-
const [open, setOpen] = (0,
|
|
5714
|
-
(0,
|
|
5706
|
+
const [open, setOpen] = (0, import_react53.useState)(show);
|
|
5707
|
+
(0, import_react53.useEffect)(() => {
|
|
5715
5708
|
if (show) {
|
|
5716
5709
|
handleOpen();
|
|
5717
5710
|
} else {
|
|
@@ -5763,8 +5756,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5763
5756
|
}
|
|
5764
5757
|
};
|
|
5765
5758
|
const dialogActions = actions == false ? false : actions != void 0 ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
5766
|
-
content = content != null ? content : { component: /* @__PURE__ */
|
|
5767
|
-
return /* @__PURE__ */
|
|
5759
|
+
content = content != null ? content : { component: /* @__PURE__ */ import_react53.default.createElement(import_material36.Box, null, " Aqui va el contenido ") };
|
|
5760
|
+
return /* @__PURE__ */ import_react53.default.createElement("div", null, buttonDialog ? /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ import_react53.default.createElement(import_material36.Tooltip, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react53.default.createElement(import_material36.Button, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ import_react53.default.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ import_react53.default.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ import_react53.default.createElement(import_material36.IconButton, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ import_react53.default.createElement(import_material36.Modal, { open: open || false, onClose: handleClose }, /* @__PURE__ */ import_react53.default.createElement(
|
|
5768
5761
|
import_material36.Dialog,
|
|
5769
5762
|
{
|
|
5770
5763
|
fullScreen: typeView === "mobile" ? true : false,
|
|
@@ -5779,8 +5772,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5779
5772
|
}
|
|
5780
5773
|
}
|
|
5781
5774
|
},
|
|
5782
|
-
title && /* @__PURE__ */
|
|
5783
|
-
/* @__PURE__ */
|
|
5775
|
+
title && /* @__PURE__ */ import_react53.default.createElement(import_material36.DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ import_react53.default.createElement(import_Grid9.default, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, typeView == "web" ? /* @__PURE__ */ import_react53.default.createElement(import_Grid9.default, { container: true, size: 11, sx: { alignItems: "center", flexWrap: "nowrap" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ import_react53.default.createElement(import_material36.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react53.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ import_react53.default.createElement(import_Grid9.default, { sx: { width: "98%" } }, /* @__PURE__ */ import_react53.default.createElement(import_material36.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), subtitle ? subtitle : "")) : /* @__PURE__ */ import_react53.default.createElement(import_Grid9.default, { container: true, size: 11, sx: { alignItems: "center", flexWrap: "nowrap" } }), disableClose != true ? /* @__PURE__ */ import_react53.default.createElement(import_material36.IconButton, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ import_react53.default.createElement(import_Close2.default, { color: "action" })) : ""), typeView == "mobile" ? /* @__PURE__ */ import_react53.default.createElement(import_Grid9.default, { sx: { display: "flex", flexDirection: "column", padding: "12px 0px 4px 0px" }, gap: 1.5 }, /* @__PURE__ */ import_react53.default.createElement(import_material36.Typography, { color: "text.primary", variant: "h5" }, title ? title : ""), subtitle ? subtitle : "") : ""),
|
|
5776
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
5784
5777
|
import_material36.DialogContent,
|
|
5785
5778
|
{
|
|
5786
5779
|
"data-testid": "dialog-content",
|
|
@@ -5809,7 +5802,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5809
5802
|
})
|
|
5810
5803
|
}
|
|
5811
5804
|
},
|
|
5812
|
-
content.url ? /* @__PURE__ */
|
|
5805
|
+
content.url ? /* @__PURE__ */ import_react53.default.createElement(
|
|
5813
5806
|
"iframe",
|
|
5814
5807
|
{
|
|
5815
5808
|
style: { border: "none", minWidth: "100%", minHeight: "100%" },
|
|
@@ -5819,7 +5812,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5819
5812
|
}
|
|
5820
5813
|
) : content.component
|
|
5821
5814
|
),
|
|
5822
|
-
dialogActions != void 0 && dialogActions != false ? Array.isArray(dialogActions) && (dialogActions == null ? void 0 : dialogActions.length) > 0 ? /* @__PURE__ */
|
|
5815
|
+
dialogActions != void 0 && dialogActions != false ? Array.isArray(dialogActions) && (dialogActions == null ? void 0 : dialogActions.length) > 0 ? /* @__PURE__ */ import_react53.default.createElement(import_material36.DialogActions, { sx: { zIndex: 1200, gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, typeView !== "mobile" ? /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, dialogActions.length >= 3 ? /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, /* @__PURE__ */ import_react53.default.createElement(
|
|
5823
5816
|
import_material36.Button,
|
|
5824
5817
|
{
|
|
5825
5818
|
variant: "text",
|
|
@@ -5827,11 +5820,11 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5827
5820
|
size: "small",
|
|
5828
5821
|
onClick: dialogActions[0].fn,
|
|
5829
5822
|
disabled: dialogActions[0].disabled || false,
|
|
5830
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */
|
|
5823
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
5831
5824
|
},
|
|
5832
5825
|
dialogActions[0].text
|
|
5833
|
-
), /* @__PURE__ */
|
|
5834
|
-
return /* @__PURE__ */
|
|
5826
|
+
), /* @__PURE__ */ import_react53.default.createElement(import_material36.Box, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
5827
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
5835
5828
|
import_material36.Button,
|
|
5836
5829
|
{
|
|
5837
5830
|
key: index + 1,
|
|
@@ -5840,12 +5833,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5840
5833
|
size: "small",
|
|
5841
5834
|
onClick: boton.fn,
|
|
5842
5835
|
disabled: boton.disabled || false,
|
|
5843
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
5836
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
5844
5837
|
},
|
|
5845
5838
|
boton.text
|
|
5846
5839
|
);
|
|
5847
5840
|
}))) : dialogActions.map((boton, index) => {
|
|
5848
|
-
return /* @__PURE__ */
|
|
5841
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
5849
5842
|
import_material36.Button,
|
|
5850
5843
|
{
|
|
5851
5844
|
key: index,
|
|
@@ -5854,19 +5847,19 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
5854
5847
|
size: "small",
|
|
5855
5848
|
onClick: boton.fn,
|
|
5856
5849
|
disabled: boton.disabled || false,
|
|
5857
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
5850
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
5858
5851
|
},
|
|
5859
5852
|
boton.text
|
|
5860
5853
|
);
|
|
5861
|
-
})) : /* @__PURE__ */
|
|
5854
|
+
})) : /* @__PURE__ */ import_react53.default.createElement(import_material36.Box, { sx: { width: "100%", display: "flex", flexDirection: "row", justifyContent: "center" } }, /* @__PURE__ */ import_react53.default.createElement(import_ToggleButtonGroup.default, { size: "large", fullWidth: true }, dialogActions.map((boton, index) => {
|
|
5862
5855
|
var _a;
|
|
5863
|
-
return /* @__PURE__ */
|
|
5856
|
+
return /* @__PURE__ */ import_react53.default.createElement(import_ToggleButton.default, { sx: { color: "primary.main" }, disabled: boton.disabled || false, fullWidth: boton.text ? true : false, size: "medium", value: "text", onClick: boton.fn }, (_a = boton.text) != null ? _a : /* @__PURE__ */ import_react53.default.createElement(import_material36.SvgIcon, { fontSize: "small", component: boton.icon }));
|
|
5864
5857
|
})))) : "" : ""
|
|
5865
5858
|
)));
|
|
5866
5859
|
};
|
|
5867
5860
|
|
|
5868
5861
|
// src/Components/SCDownloadExcelTable.tsx
|
|
5869
|
-
var
|
|
5862
|
+
var import_react54 = __toESM(require("react"), 1);
|
|
5870
5863
|
var import_material37 = require("@mui/material");
|
|
5871
5864
|
var import_FileDownloadOutlined2 = __toESM(require("@mui/icons-material/FileDownloadOutlined"), 1);
|
|
5872
5865
|
var XLSX = __toESM(require("xlsx"), 1);
|
|
@@ -5899,11 +5892,11 @@ var SCDownloadExcelTable = ({
|
|
|
5899
5892
|
XLSX.utils.book_append_sheet(workbook, worksheet, "Hoja1");
|
|
5900
5893
|
XLSX.writeFile(workbook, `${fileName}.xlsx`);
|
|
5901
5894
|
};
|
|
5902
|
-
return /* @__PURE__ */
|
|
5895
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
5903
5896
|
import_material37.Button,
|
|
5904
5897
|
{
|
|
5905
5898
|
onClick: descargaExcel,
|
|
5906
|
-
startIcon: /* @__PURE__ */
|
|
5899
|
+
startIcon: /* @__PURE__ */ import_react54.default.createElement(import_FileDownloadOutlined2.default, null),
|
|
5907
5900
|
size: (downloadButton == null ? void 0 : downloadButton.size) || "small",
|
|
5908
5901
|
color: (downloadButton == null ? void 0 : downloadButton.color) || "primary",
|
|
5909
5902
|
variant: (downloadButton == null ? void 0 : downloadButton.variant) || "text",
|
|
@@ -5914,12 +5907,12 @@ var SCDownloadExcelTable = ({
|
|
|
5914
5907
|
};
|
|
5915
5908
|
|
|
5916
5909
|
// src/Components/SCMenu.tsx
|
|
5917
|
-
var
|
|
5910
|
+
var import_react56 = __toESM(require("react"), 1);
|
|
5918
5911
|
var import_material38 = require("@mui/material");
|
|
5919
5912
|
var import_Grid10 = __toESM(require("@mui/material/Grid"), 1);
|
|
5920
5913
|
|
|
5921
5914
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
5922
|
-
var
|
|
5915
|
+
var import_react55 = require("react");
|
|
5923
5916
|
function getWindowDimensions() {
|
|
5924
5917
|
const { innerWidth: width, innerHeight: height } = window;
|
|
5925
5918
|
return {
|
|
@@ -5928,8 +5921,8 @@ function getWindowDimensions() {
|
|
|
5928
5921
|
};
|
|
5929
5922
|
}
|
|
5930
5923
|
function useWindowDimensions() {
|
|
5931
|
-
const [windowDimensions, setWindowDimensions] = (0,
|
|
5932
|
-
(0,
|
|
5924
|
+
const [windowDimensions, setWindowDimensions] = (0, import_react55.useState)(getWindowDimensions());
|
|
5925
|
+
(0, import_react55.useEffect)(() => {
|
|
5933
5926
|
function handleResize() {
|
|
5934
5927
|
setWindowDimensions(getWindowDimensions());
|
|
5935
5928
|
}
|
|
@@ -5947,12 +5940,12 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
5947
5940
|
const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
|
|
5948
5941
|
const widthContainer = menuSize + pageSize;
|
|
5949
5942
|
let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
5950
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5951
|
-
const [value, setValue] =
|
|
5952
|
-
|
|
5943
|
+
const [selectedIndex, setSelectedIndex] = import_react56.default.useState("1");
|
|
5944
|
+
const [value, setValue] = import_react56.default.useState("1");
|
|
5945
|
+
import_react56.default.useEffect(() => {
|
|
5953
5946
|
heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
5954
5947
|
}, [height]);
|
|
5955
|
-
|
|
5948
|
+
import_react56.default.useEffect(() => {
|
|
5956
5949
|
if (defaultOption) {
|
|
5957
5950
|
handleClickMenusItem(event, void 0);
|
|
5958
5951
|
}
|
|
@@ -5982,7 +5975,7 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
5982
5975
|
setValue(String(index + 1));
|
|
5983
5976
|
}
|
|
5984
5977
|
};
|
|
5985
|
-
return /* @__PURE__ */
|
|
5978
|
+
return /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement(import_Grid10.default, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ import_react56.default.createElement(import_material38.Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ import_react56.default.createElement(import_material38.MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement(
|
|
5986
5979
|
import_material38.MenuItem,
|
|
5987
5980
|
{
|
|
5988
5981
|
disabled: disable == true ? true : false,
|
|
@@ -5990,51 +5983,9 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
5990
5983
|
selected: String(index + 1) === selectedIndex,
|
|
5991
5984
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
5992
5985
|
},
|
|
5993
|
-
option.iconLeft ? /* @__PURE__ */
|
|
5994
|
-
/* @__PURE__ */
|
|
5995
|
-
), option.divider == true ? /* @__PURE__ */
|
|
5996
|
-
};
|
|
5997
|
-
|
|
5998
|
-
// src/Components/SCSnackBar.tsx
|
|
5999
|
-
var import_react56 = __toESM(require("react"), 1);
|
|
6000
|
-
var import_Alert = __toESM(require("@mui/material/Alert"), 1);
|
|
6001
|
-
var import_es6 = require("dayjs/locale/es");
|
|
6002
|
-
var import_Snackbar = __toESM(require("@mui/material/Snackbar"), 1);
|
|
6003
|
-
var SCSnackBar = ({
|
|
6004
|
-
type = "success",
|
|
6005
|
-
close = true,
|
|
6006
|
-
openState,
|
|
6007
|
-
setOpenState,
|
|
6008
|
-
mensaje,
|
|
6009
|
-
duration = 3e3,
|
|
6010
|
-
position = "Center"
|
|
6011
|
-
}) => {
|
|
6012
|
-
const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
|
|
6013
|
-
const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
|
|
6014
|
-
const handleClose = (event2, reason) => {
|
|
6015
|
-
if (reason === "clickaway") {
|
|
6016
|
-
return;
|
|
6017
|
-
}
|
|
6018
|
-
setOpenState(false);
|
|
6019
|
-
};
|
|
6020
|
-
return /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement(
|
|
6021
|
-
import_Snackbar.default,
|
|
6022
|
-
__spreadProps(__spreadValues({
|
|
6023
|
-
anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },
|
|
6024
|
-
open: openState,
|
|
6025
|
-
autoHideDuration: duration
|
|
6026
|
-
}, close ? { onClose: handleClose } : {}), {
|
|
6027
|
-
sx: { zIndex: 2e3 }
|
|
6028
|
-
}),
|
|
6029
|
-
/* @__PURE__ */ import_react56.default.createElement(
|
|
6030
|
-
import_Alert.default,
|
|
6031
|
-
__spreadProps(__spreadValues({}, close ? { onClose: handleClose } : {}), {
|
|
6032
|
-
severity: type,
|
|
6033
|
-
sx: { backgroundColor: type == "success" ? "success.50" : type == "error" ? "#F9E8E8" : type == "warning" ? "#FFF0E0" : "#E6F3F8" }
|
|
6034
|
-
}),
|
|
6035
|
-
mensaje
|
|
6036
|
-
)
|
|
6037
|
-
));
|
|
5986
|
+
option.iconLeft ? /* @__PURE__ */ import_react56.default.createElement(import_material38.ListItemIcon, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react56.default.createElement(import_material38.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
5987
|
+
/* @__PURE__ */ import_react56.default.createElement(import_Grid10.default, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ import_react56.default.createElement(import_material38.Typography, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ import_react56.default.createElement(import_material38.ListItemIcon, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react56.default.createElement(import_material38.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
5988
|
+
), option.divider == true ? /* @__PURE__ */ import_react56.default.createElement(import_material38.Divider, null) : "")))), /* @__PURE__ */ import_react56.default.createElement(import_Grid10.default, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ import_react56.default.createElement(import_material38.Box, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ import_react56.default.createElement(import_material38.Typography, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
6038
5989
|
};
|
|
6039
5990
|
|
|
6040
5991
|
// src/Components/SCTabs.tsx
|