componentes-sinco 1.0.25 → 1.0.26
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/create-KZGO2OZA.svg +18 -0
- package/dist/empty-3NEKE7WO.svg +13 -0
- package/dist/error-RUCZUXDN.svg +5 -0
- package/dist/index.cjs +962 -1985
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -84
- package/dist/index.d.ts +14 -84
- package/dist/index.js +908 -1928
- package/dist/index.js.map +1 -1
- package/dist/search-OKSCVF2W.svg +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,731 +29,22 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/Components/Adjuntar/Adjuntar.tsx
|
|
54
|
-
import React4, { useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
55
|
-
import { Box as Box3, Button as Button3, CircularProgress, IconButton as IconButton3, Stack as Stack3, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
56
|
-
import { CloudUploadOutlined, AttachFileOutlined, DeleteOutline, UploadFileOutlined, FileDownload } from "@mui/icons-material";
|
|
57
|
-
|
|
58
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
59
|
-
import React, { useEffect as useEffect2, useState as useState2 } from "react";
|
|
60
|
-
import { Stack, LinearProgress, Divider, Box, Typography, IconButton, Button } from "@mui/material";
|
|
61
|
-
import { Close, InfoRounded, CheckCircleRounded, WarningRounded, ErrorRounded, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
|
|
62
|
-
|
|
63
|
-
// src/Components/ToastNotification/useProgress.ts
|
|
64
|
-
import { useEffect, useState } from "react";
|
|
65
|
-
var useProgress = (timeProgress, lote) => {
|
|
66
|
-
const [progress, setProgress] = useState(0);
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
const interval = setInterval(() => {
|
|
69
|
-
setProgress((prev) => {
|
|
70
|
-
if (prev >= 100) {
|
|
71
|
-
clearInterval(interval);
|
|
72
|
-
}
|
|
73
|
-
if (lote) {
|
|
74
|
-
const nextProgress = prev + lote;
|
|
75
|
-
return nextProgress <= 100 ? nextProgress : 100;
|
|
76
|
-
} else {
|
|
77
|
-
return prev + 1;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}, timeProgress * 10);
|
|
81
|
-
return () => {
|
|
82
|
-
clearInterval(interval);
|
|
83
|
-
};
|
|
84
|
-
}, [timeProgress, lote]);
|
|
85
|
-
return {
|
|
86
|
-
progress
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
var ToastProgress = (timeProgress) => {
|
|
90
|
-
const [progress, setProgress] = useState(100);
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
const interval = setInterval(() => {
|
|
93
|
-
setProgress((prev) => {
|
|
94
|
-
if (prev <= 0) {
|
|
95
|
-
clearInterval(interval);
|
|
96
|
-
}
|
|
97
|
-
return prev - 1;
|
|
98
|
-
});
|
|
99
|
-
}, timeProgress * 10);
|
|
100
|
-
return () => {
|
|
101
|
-
clearInterval(interval);
|
|
102
|
-
};
|
|
103
|
-
}, [timeProgress]);
|
|
104
|
-
return {
|
|
105
|
-
progressToast: progress
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
110
|
-
var SCToastNotification = (toast) => {
|
|
111
|
-
var _a;
|
|
112
|
-
const [stateOptions, setStateOptions] = useState2(true);
|
|
113
|
-
const [stateToast, setStateToast] = useState2(true);
|
|
114
|
-
const timeProgress = toast.time || 10;
|
|
115
|
-
const { progress } = useProgress(timeProgress);
|
|
116
|
-
const toastColorConfig = toast.type || "info";
|
|
117
|
-
const toastIconOption = {
|
|
118
|
-
success: /* @__PURE__ */ React.createElement(CheckCircleRounded, { color: "success" }),
|
|
119
|
-
error: /* @__PURE__ */ React.createElement(ErrorRounded, { color: "error" }),
|
|
120
|
-
warning: /* @__PURE__ */ React.createElement(WarningRounded, { color: "warning" }),
|
|
121
|
-
info: /* @__PURE__ */ React.createElement(InfoRounded, { color: "info" })
|
|
122
|
-
};
|
|
123
|
-
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
124
|
-
alert("");
|
|
125
|
-
} }, { text: "Consultar", fn: () => {
|
|
126
|
-
} }]];
|
|
127
|
-
const ToastIconConfig = toastIconOption[toast.type];
|
|
128
|
-
const closeToast = () => {
|
|
129
|
-
setStateToast(false);
|
|
130
|
-
};
|
|
131
|
-
const toggleToastOptions = () => {
|
|
132
|
-
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
133
|
-
};
|
|
134
|
-
useEffect2(() => {
|
|
135
|
-
progress >= 100 && setStateToast(false);
|
|
136
|
-
}, [progress]);
|
|
137
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, stateToast && /* @__PURE__ */ React.createElement(
|
|
138
|
-
Stack,
|
|
139
|
-
{
|
|
140
|
-
position: "fixed",
|
|
141
|
-
zIndex: 1400,
|
|
142
|
-
right: 16,
|
|
143
|
-
top: 16,
|
|
144
|
-
width: 370,
|
|
145
|
-
sx: {
|
|
146
|
-
boxShadow: (theme) => theme.shadows[8]
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
/* @__PURE__ */ React.createElement(
|
|
150
|
-
Box,
|
|
151
|
-
{
|
|
152
|
-
padding: 1.5,
|
|
153
|
-
gap: 1.5,
|
|
154
|
-
display: "flex",
|
|
155
|
-
alignItems: "center",
|
|
156
|
-
sx: {
|
|
157
|
-
backgroundColor: {
|
|
158
|
-
success: "success.50",
|
|
159
|
-
error: "error.50",
|
|
160
|
-
warning: "warning.50",
|
|
161
|
-
info: "info.50"
|
|
162
|
-
}[toastColorConfig]
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
/* @__PURE__ */ React.createElement(
|
|
166
|
-
Stack,
|
|
167
|
-
{
|
|
168
|
-
p: 1,
|
|
169
|
-
gap: 1,
|
|
170
|
-
borderRadius: 50,
|
|
171
|
-
bgcolor: {
|
|
172
|
-
success: "success.100",
|
|
173
|
-
error: "error.100",
|
|
174
|
-
warning: "warning.100",
|
|
175
|
-
info: "info.100"
|
|
176
|
-
}[(_a = toast.type) != null ? _a : "info"]
|
|
177
|
-
},
|
|
178
|
-
/* @__PURE__ */ React.createElement(Stack, null, ToastIconConfig)
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", flexItem: true }),
|
|
181
|
-
/* @__PURE__ */ React.createElement(Stack, { width: 285 }, /* @__PURE__ */ React.createElement(
|
|
182
|
-
Stack,
|
|
183
|
-
{
|
|
184
|
-
justifyContent: "space-between",
|
|
185
|
-
flexDirection: "row",
|
|
186
|
-
alignItems: "center"
|
|
187
|
-
},
|
|
188
|
-
/* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
189
|
-
/* @__PURE__ */ React.createElement(
|
|
190
|
-
IconButton,
|
|
191
|
-
{
|
|
192
|
-
size: "small",
|
|
193
|
-
"data-testid": "close-icon",
|
|
194
|
-
onClick: closeToast
|
|
195
|
-
},
|
|
196
|
-
/* @__PURE__ */ React.createElement(Close, { fontSize: "small" })
|
|
197
|
-
)
|
|
198
|
-
), /* @__PURE__ */ React.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React.createElement(Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ React.createElement(Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ React.createElement(Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ React.createElement(Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ React.createElement(Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ React.createElement(
|
|
199
|
-
Button,
|
|
200
|
-
{
|
|
201
|
-
key: index,
|
|
202
|
-
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
203
|
-
variant: "text",
|
|
204
|
-
onClick: button.fn,
|
|
205
|
-
disabled: button.disabled || false,
|
|
206
|
-
size: "small"
|
|
207
|
-
},
|
|
208
|
-
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
209
|
-
))), toast.seeMore && /* @__PURE__ */ React.createElement(
|
|
210
|
-
Button,
|
|
211
|
-
{
|
|
212
|
-
onClick: toggleToastOptions,
|
|
213
|
-
size: "small",
|
|
214
|
-
variant: "text",
|
|
215
|
-
color: toastColorConfig
|
|
216
|
-
},
|
|
217
|
-
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
218
|
-
stateOptions ? /* @__PURE__ */ React.createElement(KeyboardArrowDown, null) : /* @__PURE__ */ React.createElement(KeyboardArrowUp, null)
|
|
219
|
-
)))
|
|
220
|
-
),
|
|
221
|
-
/* @__PURE__ */ React.createElement(
|
|
222
|
-
LinearProgress,
|
|
223
|
-
{
|
|
224
|
-
sx: {
|
|
225
|
-
".MuiLinearProgress-bar": {
|
|
226
|
-
transition: "0.1s linear !important",
|
|
227
|
-
transform: "scaleX(-1)"
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
color: toastColorConfig,
|
|
231
|
-
variant: "determinate",
|
|
232
|
-
value: 100 - progress
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
));
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
// src/Components/Modal/Helpers/Data.tsx
|
|
239
|
-
import React2 from "react";
|
|
240
|
-
import { Info, Warning } from "@mui/icons-material";
|
|
241
|
-
var modalStateConfig = {
|
|
242
|
-
info: {
|
|
243
|
-
color: "info",
|
|
244
|
-
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
245
|
-
icon: /* @__PURE__ */ React2.createElement(Info, { color: "info", fontSize: "medium" })
|
|
246
|
-
},
|
|
247
|
-
delete: {
|
|
248
|
-
color: "delete",
|
|
249
|
-
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
250
|
-
icon: /* @__PURE__ */ React2.createElement(Info, { color: "error", fontSize: "medium" })
|
|
251
|
-
},
|
|
252
|
-
warning: {
|
|
253
|
-
color: "warning",
|
|
254
|
-
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
255
|
-
icon: /* @__PURE__ */ React2.createElement(Warning, { color: "warning", fontSize: "medium" })
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
// src/Components/Modal/Helpers/Utils.tsx
|
|
260
|
-
import * as MuiIcons from "@mui/icons-material";
|
|
261
|
-
import { FilterListOutlined } from "@mui/icons-material";
|
|
262
|
-
var getIconComponent = (iconName) => {
|
|
263
|
-
return iconName && MuiIcons[iconName] ? MuiIcons[iconName] : FilterListOutlined;
|
|
264
|
-
};
|
|
265
|
-
var getModalColor = (state) => {
|
|
266
|
-
var _a;
|
|
267
|
-
const colors = {
|
|
268
|
-
info: "info.100",
|
|
269
|
-
delete: "error.100",
|
|
270
|
-
warning: "warning.100"
|
|
271
|
-
};
|
|
272
|
-
return (_a = colors[state]) != null ? _a : "warning.100";
|
|
273
|
-
};
|
|
274
|
-
var getButtonColor = (state) => {
|
|
275
|
-
var _a;
|
|
276
|
-
const colorMap = {
|
|
277
|
-
info: "info",
|
|
278
|
-
delete: "error",
|
|
279
|
-
warning: "warning"
|
|
280
|
-
};
|
|
281
|
-
return (_a = colorMap[state]) != null ? _a : "info";
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// src/Components/Modal/SCModal.tsx
|
|
285
|
-
import React3, { useCallback, useMemo, useState as useState3 } from "react";
|
|
286
|
-
import { Modal, Box as Box2, Typography as Typography2, IconButton as IconButton2, Button as Button2, Stack as Stack2 } from "@mui/material";
|
|
287
|
-
import { Close as Close2 } from "@mui/icons-material";
|
|
288
|
-
|
|
289
|
-
// src/generales/capitalize.tsx
|
|
290
|
-
function capitalize(text) {
|
|
291
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// src/Components/Modal/SCModal.tsx
|
|
295
|
-
var SCModal = ({
|
|
296
|
-
buttonModal,
|
|
297
|
-
state = "info",
|
|
298
|
-
open,
|
|
299
|
-
setOpen,
|
|
300
|
-
title,
|
|
301
|
-
description,
|
|
302
|
-
action
|
|
303
|
-
}) => {
|
|
304
|
-
var _a, _b, _c, _d, _e;
|
|
305
|
-
const [internalOpen, setInternalOpen] = useState3(open != null ? open : false);
|
|
306
|
-
const isControlled = Boolean(setOpen);
|
|
307
|
-
const modalOpen = isControlled ? open != null ? open : false : internalOpen;
|
|
308
|
-
const setModalOpen = isControlled ? setOpen : setInternalOpen;
|
|
309
|
-
const handleToggle = useCallback(() => setModalOpen((prev) => !prev), [setModalOpen]);
|
|
310
|
-
const handleClose = useCallback(() => setModalOpen(false), [setModalOpen]);
|
|
311
|
-
const Icon = useMemo(() => getIconComponent(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
312
|
-
const prevAction = useMemo(
|
|
313
|
-
() => action != null ? action : [
|
|
314
|
-
{ text: "Cancelar", fn: handleClose },
|
|
315
|
-
{ text: "Consultar", fn: () => {
|
|
316
|
-
} }
|
|
317
|
-
],
|
|
318
|
-
[action, handleClose]
|
|
319
|
-
);
|
|
320
|
-
const { icon, defaultDescription } = modalStateConfig[state];
|
|
321
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, buttonModal && /* @__PURE__ */ React3.createElement(
|
|
322
|
-
Button2,
|
|
323
|
-
{
|
|
324
|
-
"data-testid": "test-buttonModal",
|
|
325
|
-
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
326
|
-
onClick: handleToggle,
|
|
327
|
-
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
328
|
-
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
329
|
-
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React3.createElement(Icon, null),
|
|
330
|
-
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React3.createElement(Icon, null)
|
|
331
|
-
},
|
|
332
|
-
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
333
|
-
), /* @__PURE__ */ React3.createElement(Modal, { open: modalOpen, onClose: handleClose, sx: { boxShadow: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
334
|
-
Box2,
|
|
335
|
-
{
|
|
336
|
-
sx: {
|
|
337
|
-
position: "absolute",
|
|
338
|
-
top: "50%",
|
|
339
|
-
left: "50%",
|
|
340
|
-
transform: "translate(-50%, -50%)",
|
|
341
|
-
width: 400,
|
|
342
|
-
bgcolor: "background.paper",
|
|
343
|
-
borderRadius: 1,
|
|
344
|
-
boxShadow: 24
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
/* @__PURE__ */ React3.createElement(Stack2, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React3.createElement(Stack2, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React3.createElement(
|
|
348
|
-
Box2,
|
|
349
|
-
{
|
|
350
|
-
display: "flex",
|
|
351
|
-
justifyContent: "center",
|
|
352
|
-
alignItems: "center",
|
|
353
|
-
borderRadius: "50%",
|
|
354
|
-
height: 36,
|
|
355
|
-
width: 36,
|
|
356
|
-
bgcolor: getModalColor(state)
|
|
357
|
-
},
|
|
358
|
-
icon
|
|
359
|
-
), /* @__PURE__ */ React3.createElement(Typography2, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React3.createElement(IconButton2, { onClick: handleClose, "data-testid": "test-buttonClose" }, /* @__PURE__ */ React3.createElement(Close2, { color: "action" }))),
|
|
360
|
-
/* @__PURE__ */ React3.createElement(Stack2, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React3.createElement(Typography2, { variant: "body1" }, description || defaultDescription)),
|
|
361
|
-
action && /* @__PURE__ */ React3.createElement(
|
|
362
|
-
Stack2,
|
|
363
|
-
{
|
|
364
|
-
id: "Action",
|
|
365
|
-
direction: "row",
|
|
366
|
-
gap: 1,
|
|
367
|
-
p: 1,
|
|
368
|
-
justifyContent: "end",
|
|
369
|
-
bgcolor: "grey.50",
|
|
370
|
-
sx: { borderRadius: 1 }
|
|
371
|
-
},
|
|
372
|
-
/* @__PURE__ */ React3.createElement(
|
|
373
|
-
Button2,
|
|
374
|
-
{
|
|
375
|
-
color: "inherit",
|
|
376
|
-
variant: "text",
|
|
377
|
-
onClick: handleClose,
|
|
378
|
-
size: "small"
|
|
379
|
-
},
|
|
380
|
-
capitalize("cancelar")
|
|
381
|
-
),
|
|
382
|
-
/* @__PURE__ */ React3.createElement(
|
|
383
|
-
Button2,
|
|
384
|
-
{
|
|
385
|
-
"data-testid": "test-aceptar",
|
|
386
|
-
color: getButtonColor(state),
|
|
387
|
-
variant: "contained",
|
|
388
|
-
onClick: (_e = action[0]) == null ? void 0 : _e.fn,
|
|
389
|
-
disabled: false,
|
|
390
|
-
size: "small"
|
|
391
|
-
},
|
|
392
|
-
capitalize(action[0].text)
|
|
393
|
-
)
|
|
394
|
-
)
|
|
395
|
-
)));
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
// src/Components/Adjuntar/Adjuntar.tsx
|
|
399
|
-
var Attachment = ({
|
|
400
|
-
sx,
|
|
401
|
-
compact,
|
|
402
|
-
error,
|
|
403
|
-
maxSize = 400,
|
|
404
|
-
fileAccepted = "",
|
|
405
|
-
onLoading,
|
|
406
|
-
onChange,
|
|
407
|
-
downloadAction,
|
|
408
|
-
deleteAction,
|
|
409
|
-
initialFiles = []
|
|
410
|
-
}) => {
|
|
411
|
-
const [files, setFiles] = useState4([]);
|
|
412
|
-
const [fileToDelete, setFileToDelete] = useState4(null);
|
|
413
|
-
const [toast, setToast] = useState4(null);
|
|
414
|
-
const [openModal, setOpenModal] = useState4(false);
|
|
415
|
-
const [isDragFile, setIsDragFile] = useState4(false);
|
|
416
|
-
const inputRef = useRef(null);
|
|
417
|
-
useEffect4(() => {
|
|
418
|
-
if (initialFiles && initialFiles.length > 0) {
|
|
419
|
-
setFiles(initialFiles);
|
|
420
|
-
}
|
|
421
|
-
}, []);
|
|
422
|
-
const handleDrop = (event2) => {
|
|
423
|
-
event2.preventDefault();
|
|
424
|
-
setIsDragFile(false);
|
|
425
|
-
const filesDropped = event2.dataTransfer.files;
|
|
426
|
-
if (filesDropped && filesDropped.length > 0) {
|
|
427
|
-
const fakeEvent = {
|
|
428
|
-
target: { files: filesDropped }
|
|
429
|
-
};
|
|
430
|
-
handleUpload(fakeEvent);
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
const handleDragOver = (event2) => {
|
|
434
|
-
event2.preventDefault();
|
|
435
|
-
setIsDragFile(true);
|
|
436
|
-
};
|
|
437
|
-
const handleDragLeave = (event2) => {
|
|
438
|
-
event2.preventDefault();
|
|
439
|
-
setIsDragFile(false);
|
|
440
|
-
};
|
|
441
|
-
const handleUpload = (event2) => {
|
|
442
|
-
const newFiles = event2.target.files;
|
|
443
|
-
if (!newFiles) return;
|
|
444
|
-
const nuevosArchivos = [];
|
|
445
|
-
const archivosValidos = [];
|
|
446
|
-
Array.from(newFiles).forEach((file) => {
|
|
447
|
-
const isDuplicatedFile = files.findIndex(
|
|
448
|
-
(e) => e.name === file.name && e.size === file.size
|
|
449
|
-
);
|
|
450
|
-
const sizeMB = file.size / (1024 * 1024);
|
|
451
|
-
if (isDuplicatedFile !== -1) {
|
|
452
|
-
setToast({
|
|
453
|
-
type: "error",
|
|
454
|
-
title: "Archivo duplicado",
|
|
455
|
-
listITems: ["No se permiten archivos duplicados."],
|
|
456
|
-
seeMore: true,
|
|
457
|
-
time: 10
|
|
458
|
-
});
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
if (sizeMB > maxSize) {
|
|
462
|
-
nuevosArchivos.push({
|
|
463
|
-
name: file.name,
|
|
464
|
-
size: file.size,
|
|
465
|
-
type: file.type,
|
|
466
|
-
progress: 0,
|
|
467
|
-
uploadError: true
|
|
468
|
-
});
|
|
469
|
-
setToast({
|
|
470
|
-
type: "error",
|
|
471
|
-
title: "Carga fallida",
|
|
472
|
-
seeMore: true,
|
|
473
|
-
listITems: [`El archivo supera el l\xEDmite de ${maxSize}MB.`],
|
|
474
|
-
time: 10
|
|
475
|
-
});
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
if (fileAccepted && !file.name.match(
|
|
479
|
-
new RegExp(
|
|
480
|
-
`(${fileAccepted.replace(/\./g, "\\.").replace(/,/g, "|")})$`,
|
|
481
|
-
"i"
|
|
482
|
-
)
|
|
483
|
-
)) {
|
|
484
|
-
setToast({
|
|
485
|
-
type: "error",
|
|
486
|
-
title: "Tipo de archivo no permitido",
|
|
487
|
-
listITems: [`El archivo ${file.name} no es un tipo permitido.`],
|
|
488
|
-
seeMore: true,
|
|
489
|
-
time: 10
|
|
490
|
-
});
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
nuevosArchivos.push({
|
|
494
|
-
name: file.name,
|
|
495
|
-
size: file.size,
|
|
496
|
-
type: file.type,
|
|
497
|
-
progress: 0,
|
|
498
|
-
uploadError: false
|
|
499
|
-
});
|
|
500
|
-
archivosValidos.push(file);
|
|
501
|
-
});
|
|
502
|
-
if (nuevosArchivos.length > 0) {
|
|
503
|
-
setFiles((prev) => {
|
|
504
|
-
const actualizados = [...prev, ...nuevosArchivos];
|
|
505
|
-
onChange == null ? void 0 : onChange([
|
|
506
|
-
...archivosValidos,
|
|
507
|
-
...prev.map((f) => new File([], f.name, { type: f.type }))
|
|
508
|
-
]);
|
|
509
|
-
return actualizados;
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
event2.target.value = "";
|
|
513
|
-
};
|
|
514
|
-
const deleteFiles = (nameFile) => {
|
|
515
|
-
setFiles((prev) => {
|
|
516
|
-
const filtered = prev.filter((e) => e.name !== nameFile);
|
|
517
|
-
onChange == null ? void 0 : onChange(
|
|
518
|
-
filtered.map((f) => new File([], f.name, { type: f.type }))
|
|
519
|
-
);
|
|
520
|
-
return filtered;
|
|
521
|
-
});
|
|
522
|
-
};
|
|
523
|
-
return /* @__PURE__ */ React4.createElement(Stack3, { spacing: 2 }, toast && /* @__PURE__ */ React4.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React4.createElement(
|
|
524
|
-
"input",
|
|
525
|
-
{
|
|
526
|
-
type: "file",
|
|
527
|
-
multiple: true,
|
|
528
|
-
hidden: true,
|
|
529
|
-
ref: inputRef,
|
|
530
|
-
onChange: handleUpload
|
|
531
|
-
}
|
|
532
|
-
), /* @__PURE__ */ React4.createElement(
|
|
533
|
-
Stack3,
|
|
534
|
-
{
|
|
535
|
-
id: "ZonaAdjuntos",
|
|
536
|
-
justifyContent: "center",
|
|
537
|
-
alignItems: "center",
|
|
538
|
-
bgcolor: "transparent",
|
|
539
|
-
padding: compact ? "12px 16px" : "16px 24px",
|
|
540
|
-
height: compact ? "56px" : "100%",
|
|
541
|
-
flexDirection: compact ? "row" : "column",
|
|
542
|
-
gap: 1,
|
|
543
|
-
borderRadius: 1,
|
|
544
|
-
onClick: () => {
|
|
545
|
-
var _a;
|
|
546
|
-
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
547
|
-
},
|
|
548
|
-
onDrop: handleDrop,
|
|
549
|
-
onDragOver: handleDragOver,
|
|
550
|
-
onDragLeave: handleDragLeave,
|
|
551
|
-
sx: __spreadValues({
|
|
552
|
-
border: error ? (theme) => `1px solid ${theme.palette.error.main}` : (theme) => `1px dashed ${theme.palette.grey[500]}`,
|
|
553
|
-
cursor: "pointer",
|
|
554
|
-
":hover": {
|
|
555
|
-
backgroundColor: error ? "error.50" : "action.hover"
|
|
556
|
-
}
|
|
557
|
-
}, sx)
|
|
558
|
-
},
|
|
559
|
-
onLoading ? /* @__PURE__ */ React4.createElement(
|
|
560
|
-
Box3,
|
|
561
|
-
{
|
|
562
|
-
display: "flex",
|
|
563
|
-
alignItems: "center",
|
|
564
|
-
justifyContent: "center",
|
|
565
|
-
width: "100%",
|
|
566
|
-
height: "450px"
|
|
567
|
-
},
|
|
568
|
-
/* @__PURE__ */ React4.createElement(
|
|
569
|
-
CircularProgress,
|
|
570
|
-
{
|
|
571
|
-
sx: { width: "60px", height: "60px" },
|
|
572
|
-
variant: "indeterminate"
|
|
573
|
-
}
|
|
574
|
-
)
|
|
575
|
-
) : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
|
|
576
|
-
Box3,
|
|
577
|
-
{
|
|
578
|
-
display: "flex",
|
|
579
|
-
bgcolor: error ? "error.50" : "primary.50",
|
|
580
|
-
borderRadius: "100%",
|
|
581
|
-
p: 1
|
|
582
|
-
},
|
|
583
|
-
/* @__PURE__ */ React4.createElement(
|
|
584
|
-
CloudUploadOutlined,
|
|
585
|
-
{
|
|
586
|
-
color: error ? "error" : "primary",
|
|
587
|
-
fontSize: "medium"
|
|
588
|
-
}
|
|
589
|
-
)
|
|
590
|
-
), /* @__PURE__ */ React4.createElement(
|
|
591
|
-
Stack3,
|
|
592
|
-
{
|
|
593
|
-
width: "100%",
|
|
594
|
-
flexDirection: compact ? "row" : "column",
|
|
595
|
-
alignItems: "center",
|
|
596
|
-
justifyContent: compact ? "space-between" : "center",
|
|
597
|
-
gap: 1
|
|
598
|
-
},
|
|
599
|
-
/* @__PURE__ */ React4.createElement(
|
|
600
|
-
Stack3,
|
|
601
|
-
{
|
|
602
|
-
flexDirection: "column",
|
|
603
|
-
alignItems: compact ? "start" : "center",
|
|
604
|
-
gap: 0.5
|
|
605
|
-
},
|
|
606
|
-
/* @__PURE__ */ React4.createElement(Typography3, { variant: "body2", color: "text.primary" }, "Arrastrar o adjuntar archivos"),
|
|
607
|
-
/* @__PURE__ */ React4.createElement(
|
|
608
|
-
Typography3,
|
|
609
|
-
{
|
|
610
|
-
variant: "caption",
|
|
611
|
-
color: error ? "error" : "text.secondary",
|
|
612
|
-
whiteSpace: "nowrap",
|
|
613
|
-
overflow: "hidden",
|
|
614
|
-
textOverflow: "ellipsis",
|
|
615
|
-
maxWidth: "450px"
|
|
616
|
-
},
|
|
617
|
-
error ? `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Archivo no soportado` : `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Max. ${maxSize}MB`
|
|
618
|
-
)
|
|
619
|
-
),
|
|
620
|
-
/* @__PURE__ */ React4.createElement(
|
|
621
|
-
Button3,
|
|
622
|
-
{
|
|
623
|
-
variant: "text",
|
|
624
|
-
color: "primary",
|
|
625
|
-
size: "small",
|
|
626
|
-
startIcon: /* @__PURE__ */ React4.createElement(AttachFileOutlined, { color: "primary", fontSize: "small" })
|
|
627
|
-
},
|
|
628
|
-
"Adjuntar"
|
|
629
|
-
)
|
|
630
|
-
))
|
|
631
|
-
), files.length > 0 && /* @__PURE__ */ React4.createElement(
|
|
632
|
-
Stack3,
|
|
633
|
-
{
|
|
634
|
-
id: "ContenedorArchivosAdjuntos",
|
|
635
|
-
width: "100%",
|
|
636
|
-
sx: __spreadValues({
|
|
637
|
-
overflowY: "auto"
|
|
638
|
-
}, files.length > 5 && {
|
|
639
|
-
maxHeight: 250
|
|
640
|
-
}),
|
|
641
|
-
spacing: 1
|
|
642
|
-
},
|
|
643
|
-
files.map((file) => /* @__PURE__ */ React4.createElement(
|
|
644
|
-
Stack3,
|
|
645
|
-
{
|
|
646
|
-
height: 46,
|
|
647
|
-
key: file.name + (file.uploadError ? "_error" : ""),
|
|
648
|
-
direction: "row",
|
|
649
|
-
alignItems: "center",
|
|
650
|
-
justifyContent: "space-between",
|
|
651
|
-
gap: 2,
|
|
652
|
-
padding: 1,
|
|
653
|
-
borderRadius: 1,
|
|
654
|
-
sx: {
|
|
655
|
-
backgroundColor: file.uploadError ? "error.50" : "transparent",
|
|
656
|
-
":hover": {
|
|
657
|
-
backgroundColor: file.uploadError ? "error.100" : "primary.50"
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
|
-
/* @__PURE__ */ React4.createElement(Stack3, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(
|
|
662
|
-
UploadFileOutlined,
|
|
663
|
-
{
|
|
664
|
-
color: file.uploadError ? "error" : "primary",
|
|
665
|
-
fontSize: "small"
|
|
666
|
-
}
|
|
667
|
-
), /* @__PURE__ */ React4.createElement(Stack3, { width: "100%" }, /* @__PURE__ */ React4.createElement(
|
|
668
|
-
Typography3,
|
|
669
|
-
{
|
|
670
|
-
variant: "body2",
|
|
671
|
-
color: "text.primary",
|
|
672
|
-
whiteSpace: "nowrap",
|
|
673
|
-
overflow: "hidden",
|
|
674
|
-
textOverflow: "ellipsis",
|
|
675
|
-
maxWidth: "310px"
|
|
676
|
-
},
|
|
677
|
-
file.name
|
|
678
|
-
), /* @__PURE__ */ React4.createElement(
|
|
679
|
-
Typography3,
|
|
680
|
-
{
|
|
681
|
-
variant: "caption",
|
|
682
|
-
color: file.uploadError ? "error" : "text.secondary"
|
|
683
|
-
},
|
|
684
|
-
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}`
|
|
685
|
-
))),
|
|
686
|
-
/* @__PURE__ */ React4.createElement(Tooltip, { title: "Descargar" }, /* @__PURE__ */ React4.createElement(IconButton3, { size: "small", onClick: () => downloadAction == null ? void 0 : downloadAction(file.name) }, /* @__PURE__ */ React4.createElement(FileDownload, { fontSize: "small", color: "action" }))),
|
|
687
|
-
/* @__PURE__ */ React4.createElement(Tooltip, { title: "Eliminar" }, /* @__PURE__ */ React4.createElement(
|
|
688
|
-
IconButton3,
|
|
689
|
-
{
|
|
690
|
-
size: "small",
|
|
691
|
-
onClick: () => {
|
|
692
|
-
setFileToDelete(file);
|
|
693
|
-
setOpenModal(true);
|
|
694
|
-
}
|
|
695
|
-
},
|
|
696
|
-
/* @__PURE__ */ React4.createElement(DeleteOutline, { fontSize: "small", color: "action" })
|
|
697
|
-
))
|
|
698
|
-
))
|
|
699
|
-
), /* @__PURE__ */ React4.createElement(
|
|
700
|
-
SCModal,
|
|
701
|
-
{
|
|
702
|
-
state: "delete",
|
|
703
|
-
open: openModal,
|
|
704
|
-
setOpen: setOpenModal,
|
|
705
|
-
title: "Eliminar archivo",
|
|
706
|
-
description: `\xBFEst\xE1s seguro que deseas eliminar "${fileToDelete == null ? void 0 : fileToDelete.name}"?`,
|
|
707
|
-
action: [
|
|
708
|
-
{
|
|
709
|
-
text: "Eliminar",
|
|
710
|
-
fn: () => __async(void 0, null, function* () {
|
|
711
|
-
if (fileToDelete) {
|
|
712
|
-
try {
|
|
713
|
-
if (deleteAction) {
|
|
714
|
-
yield deleteAction(fileToDelete.name);
|
|
715
|
-
}
|
|
716
|
-
deleteFiles(fileToDelete.name);
|
|
717
|
-
setToast({
|
|
718
|
-
title: "Archivo eliminado",
|
|
719
|
-
type: "success",
|
|
720
|
-
time: 2
|
|
721
|
-
});
|
|
722
|
-
} catch (error2) {
|
|
723
|
-
setToast({
|
|
724
|
-
title: "Error al eliminar archivo",
|
|
725
|
-
type: "error",
|
|
726
|
-
time: 4
|
|
727
|
-
});
|
|
728
|
-
} finally {
|
|
729
|
-
setFileToDelete(null);
|
|
730
|
-
setOpenModal(false);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
})
|
|
734
|
-
}
|
|
735
|
-
]
|
|
736
|
-
}
|
|
737
|
-
));
|
|
738
|
-
};
|
|
739
32
|
|
|
740
33
|
// src/Components/Drawer/SCDrawer.tsx
|
|
741
|
-
import
|
|
742
|
-
import { Box as
|
|
34
|
+
import React7 from "react";
|
|
35
|
+
import { Box as Box7, Drawer, Typography as Typography7, IconButton as IconButton5, Button as Button4, Stack as Stack3, Chip as Chip2 } from "@mui/material";
|
|
743
36
|
import Grid4 from "@mui/material/Grid2";
|
|
744
37
|
import CloseIcon from "@mui/icons-material/Close";
|
|
745
|
-
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
|
|
746
|
-
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
|
747
38
|
|
|
748
39
|
// src/Components/Textfield/SCTextField.tsx
|
|
749
|
-
import
|
|
750
|
-
import { FormControl, IconButton
|
|
40
|
+
import React, { useEffect, useState } from "react";
|
|
41
|
+
import { FormControl, IconButton, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover, Input, Box, Typography, SvgIcon, Tooltip } from "@mui/material";
|
|
751
42
|
import Grid from "@mui/material/Grid2";
|
|
752
43
|
import { Visibility, VisibilityOff, InfoOutlined } from "@mui/icons-material";
|
|
753
44
|
|
|
754
45
|
// src/Components/Textfield/Helpers/validateIcon.tsx
|
|
755
46
|
import * as Muicon from "@mui/icons-material";
|
|
756
|
-
function
|
|
47
|
+
function getIconComponent(name) {
|
|
757
48
|
if (typeof name !== "string") return name;
|
|
758
49
|
return name in Muicon ? Muicon[name] : void 0;
|
|
759
50
|
}
|
|
@@ -835,13 +126,13 @@ var SCTextField = ({
|
|
|
835
126
|
let IconInputStart;
|
|
836
127
|
let IconInputEnd;
|
|
837
128
|
let IconTitle;
|
|
838
|
-
const [showPassword, setShowPassword] =
|
|
839
|
-
const [error, setError] =
|
|
840
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
129
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
130
|
+
const [error, setError] = useState(false);
|
|
131
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = useState(null);
|
|
841
132
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
842
|
-
const [anchorInfoElement, setAnchorInfoElement] =
|
|
133
|
+
const [anchorInfoElement, setAnchorInfoElement] = useState(null);
|
|
843
134
|
const openInfoElement = Boolean(anchorInfoElement);
|
|
844
|
-
|
|
135
|
+
useEffect(() => {
|
|
845
136
|
if (error) {
|
|
846
137
|
setTimeout(() => {
|
|
847
138
|
setError(false);
|
|
@@ -850,14 +141,14 @@ var SCTextField = ({
|
|
|
850
141
|
}, [error]);
|
|
851
142
|
if (iconInputStart) {
|
|
852
143
|
IconInputStartValidation = getIconValidation(iconInputStart);
|
|
853
|
-
IconInputStart =
|
|
144
|
+
IconInputStart = getIconComponent(iconInputStart);
|
|
854
145
|
}
|
|
855
146
|
if (iconInputEnd) {
|
|
856
147
|
IconInputEndValidation = getIconValidation(iconInputEnd);
|
|
857
|
-
IconInputEnd =
|
|
148
|
+
IconInputEnd = getIconComponent(iconInputEnd);
|
|
858
149
|
}
|
|
859
150
|
if (iconTitle) {
|
|
860
|
-
IconTitle =
|
|
151
|
+
IconTitle = getIconComponent(iconTitle);
|
|
861
152
|
}
|
|
862
153
|
const handleClickShowPassword = () => setShowPassword((show) => !show);
|
|
863
154
|
const handleMouseDownPassword = (event2) => {
|
|
@@ -891,7 +182,7 @@ var SCTextField = ({
|
|
|
891
182
|
const handleCloseInfoElement = () => {
|
|
892
183
|
setAnchorInfoElement(null);
|
|
893
184
|
};
|
|
894
|
-
return /* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ React.createElement(Box, { sx: { width } }, /* @__PURE__ */ React.createElement(Grid, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ React.createElement(SvgIcon, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ React.createElement(Typography, { mx: 0.5, variant: "subtitle2", color: "text.secondary" }, title) : "", infoTitle ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
895
186
|
InfoOutlined,
|
|
896
187
|
{
|
|
897
188
|
color: "action",
|
|
@@ -899,7 +190,7 @@ var SCTextField = ({
|
|
|
899
190
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
900
191
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
901
192
|
}
|
|
902
|
-
), /* @__PURE__ */
|
|
193
|
+
), /* @__PURE__ */ React.createElement(
|
|
903
194
|
Popover,
|
|
904
195
|
{
|
|
905
196
|
sx: {
|
|
@@ -921,14 +212,14 @@ var SCTextField = ({
|
|
|
921
212
|
},
|
|
922
213
|
disableRestoreFocus: true
|
|
923
214
|
},
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
)) : /* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ React.createElement(Typography, { p: 2 }, infoTitle.text)
|
|
216
|
+
)) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoTitle.text, "data-testid": "test-infoTitle", placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
|
|
926
217
|
InfoOutlined,
|
|
927
218
|
{
|
|
928
219
|
color: "action",
|
|
929
220
|
fontSize: "small"
|
|
930
221
|
}
|
|
931
|
-
))) : ""), /* @__PURE__ */
|
|
222
|
+
))) : ""), /* @__PURE__ */ React.createElement(Grid, { container: true, sx: { flexWrap: "nowrap", alignItems: "center" } }, /* @__PURE__ */ React.createElement(
|
|
932
223
|
FormControl,
|
|
933
224
|
{
|
|
934
225
|
color,
|
|
@@ -937,7 +228,7 @@ var SCTextField = ({
|
|
|
937
228
|
variant,
|
|
938
229
|
sx: { background: background || "transparent", borderRadius: "4px" }
|
|
939
230
|
},
|
|
940
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ React.createElement(
|
|
941
232
|
InputLabel,
|
|
942
233
|
{
|
|
943
234
|
"data-testid": "test-label",
|
|
@@ -948,7 +239,7 @@ var SCTextField = ({
|
|
|
948
239
|
},
|
|
949
240
|
label ? label : ""
|
|
950
241
|
),
|
|
951
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ React.createElement(
|
|
952
243
|
InputComponent,
|
|
953
244
|
{
|
|
954
245
|
size: size ? size : "medium",
|
|
@@ -964,17 +255,17 @@ var SCTextField = ({
|
|
|
964
255
|
type: !showPassword && format2 === "password" ? "password" : (format2 || "text").toUpperCase() === "INT" || (format2 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
|
|
965
256
|
className: format2 === "password" && !showPassword ? "" : "",
|
|
966
257
|
placeholder,
|
|
967
|
-
startAdornment: iconInputStart ? /* @__PURE__ */
|
|
968
|
-
endAdornment: /* @__PURE__ */
|
|
969
|
-
|
|
258
|
+
startAdornment: iconInputStart ? /* @__PURE__ */ React.createElement(InputAdornment, { position: "start" }, IconInputStartValidation === "text" ? iconInputStart : IconInputStart ? /* @__PURE__ */ React.createElement(IconInputStart, { fontSize: "small" }) : null) : "",
|
|
259
|
+
endAdornment: /* @__PURE__ */ React.createElement(InputAdornment, { position: "end" }, format2 === "password" ? /* @__PURE__ */ React.createElement(
|
|
260
|
+
IconButton,
|
|
970
261
|
{
|
|
971
262
|
"aria-label": "toggle password visibility",
|
|
972
263
|
onClick: handleClickShowPassword,
|
|
973
264
|
onMouseDown: handleMouseDownPassword,
|
|
974
265
|
edge: "end"
|
|
975
266
|
},
|
|
976
|
-
showPassword ? /* @__PURE__ */
|
|
977
|
-
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */
|
|
267
|
+
showPassword ? /* @__PURE__ */ React.createElement(VisibilityOff, null) : /* @__PURE__ */ React.createElement(Visibility, null)
|
|
268
|
+
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
978
269
|
InfoOutlined,
|
|
979
270
|
{
|
|
980
271
|
"data-testid": "test-infoElement",
|
|
@@ -985,7 +276,7 @@ var SCTextField = ({
|
|
|
985
276
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
986
277
|
onMouseLeave: () => handleCloseInfoElement()
|
|
987
278
|
}
|
|
988
|
-
), /* @__PURE__ */
|
|
279
|
+
), /* @__PURE__ */ React.createElement(
|
|
989
280
|
Popover,
|
|
990
281
|
{
|
|
991
282
|
sx: {
|
|
@@ -1007,69 +298,249 @@ var SCTextField = ({
|
|
|
1007
298
|
},
|
|
1008
299
|
disableRestoreFocus: true
|
|
1009
300
|
},
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
)) : /* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ React.createElement(Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
302
|
+
)) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
|
|
1012
303
|
InfoOutlined,
|
|
1013
304
|
{
|
|
1014
305
|
color: "action",
|
|
1015
306
|
fontSize: "small"
|
|
1016
307
|
}
|
|
1017
|
-
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */
|
|
1018
|
-
label: label ? label + (format2 === "password" && !showPassword ? "" : "") : "",
|
|
1019
|
-
autoComplete: format2 === "password" ? "new-password" : "off"
|
|
308
|
+
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */ React.createElement(IconInputEnd, { fontSize: "small" }) : null : ""),
|
|
309
|
+
label: label ? label + (format2 === "password" && !showPassword ? "" : "") : "",
|
|
310
|
+
autoComplete: format2 === "password" ? "new-password" : "off"
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
), (iconInputEnd !== void 0 || format2 === "password") && infoElement ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
314
|
+
InfoOutlined,
|
|
315
|
+
{
|
|
316
|
+
"data-testid": "test-infoElement",
|
|
317
|
+
component: "svg",
|
|
318
|
+
sx: { marginLeft: "4px" },
|
|
319
|
+
color: "action",
|
|
320
|
+
fontSize: "small",
|
|
321
|
+
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
322
|
+
onMouseLeave: handleCloseInfoElement
|
|
323
|
+
}
|
|
324
|
+
), /* @__PURE__ */ React.createElement(
|
|
325
|
+
Popover,
|
|
326
|
+
{
|
|
327
|
+
sx: { pointerEvents: "none" },
|
|
328
|
+
open: openInfoElement,
|
|
329
|
+
anchorEl: anchorInfoElement,
|
|
330
|
+
onClose: handleCloseInfoElement,
|
|
331
|
+
anchorOrigin: {
|
|
332
|
+
vertical: "bottom",
|
|
333
|
+
horizontal: "left"
|
|
334
|
+
},
|
|
335
|
+
transformOrigin: {
|
|
336
|
+
vertical: "top",
|
|
337
|
+
horizontal: "left"
|
|
338
|
+
},
|
|
339
|
+
disableRestoreFocus: true
|
|
340
|
+
},
|
|
341
|
+
/* @__PURE__ */ React.createElement(Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
342
|
+
)) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
|
|
343
|
+
InfoOutlined,
|
|
344
|
+
{
|
|
345
|
+
sx: { marginLeft: "4px" },
|
|
346
|
+
color: "action",
|
|
347
|
+
fontSize: "small"
|
|
348
|
+
}
|
|
349
|
+
))) : ""));
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
353
|
+
import React2, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
354
|
+
import { Stack, LinearProgress, Divider, Box as Box2, Typography as Typography2, IconButton as IconButton2, Button } from "@mui/material";
|
|
355
|
+
import { Close, InfoRounded, CheckCircleRounded, WarningRounded, ErrorRounded, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
|
|
356
|
+
|
|
357
|
+
// src/Components/ToastNotification/useProgress.ts
|
|
358
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
359
|
+
var useProgress = (timeProgress, lote) => {
|
|
360
|
+
const [progress, setProgress] = useState2(0);
|
|
361
|
+
useEffect2(() => {
|
|
362
|
+
const interval = setInterval(() => {
|
|
363
|
+
setProgress((prev) => {
|
|
364
|
+
if (prev >= 100) {
|
|
365
|
+
clearInterval(interval);
|
|
366
|
+
}
|
|
367
|
+
if (lote) {
|
|
368
|
+
const nextProgress = prev + lote;
|
|
369
|
+
return nextProgress <= 100 ? nextProgress : 100;
|
|
370
|
+
} else {
|
|
371
|
+
return prev + 1;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}, timeProgress * 10);
|
|
375
|
+
return () => {
|
|
376
|
+
clearInterval(interval);
|
|
377
|
+
};
|
|
378
|
+
}, [timeProgress, lote]);
|
|
379
|
+
return {
|
|
380
|
+
progress
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
var ToastProgress = (timeProgress) => {
|
|
384
|
+
const [progress, setProgress] = useState2(100);
|
|
385
|
+
useEffect2(() => {
|
|
386
|
+
const interval = setInterval(() => {
|
|
387
|
+
setProgress((prev) => {
|
|
388
|
+
if (prev <= 0) {
|
|
389
|
+
clearInterval(interval);
|
|
390
|
+
}
|
|
391
|
+
return prev - 1;
|
|
392
|
+
});
|
|
393
|
+
}, timeProgress * 10);
|
|
394
|
+
return () => {
|
|
395
|
+
clearInterval(interval);
|
|
396
|
+
};
|
|
397
|
+
}, [timeProgress]);
|
|
398
|
+
return {
|
|
399
|
+
progressToast: progress
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
404
|
+
var SCToastNotification = (toast) => {
|
|
405
|
+
var _a;
|
|
406
|
+
const [stateOptions, setStateOptions] = useState3(true);
|
|
407
|
+
const [stateToast, setStateToast] = useState3(true);
|
|
408
|
+
const timeProgress = toast.time || 10;
|
|
409
|
+
const { progress } = useProgress(timeProgress);
|
|
410
|
+
const toastColorConfig = toast.type || "info";
|
|
411
|
+
const toastIconOption = {
|
|
412
|
+
success: /* @__PURE__ */ React2.createElement(CheckCircleRounded, { color: "success" }),
|
|
413
|
+
error: /* @__PURE__ */ React2.createElement(ErrorRounded, { color: "error" }),
|
|
414
|
+
warning: /* @__PURE__ */ React2.createElement(WarningRounded, { color: "warning" }),
|
|
415
|
+
info: /* @__PURE__ */ React2.createElement(InfoRounded, { color: "info" })
|
|
416
|
+
};
|
|
417
|
+
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
418
|
+
alert("");
|
|
419
|
+
} }, { text: "Consultar", fn: () => {
|
|
420
|
+
} }]];
|
|
421
|
+
const ToastIconConfig = toastIconOption[toast.type];
|
|
422
|
+
const closeToast = () => {
|
|
423
|
+
setStateToast(false);
|
|
424
|
+
};
|
|
425
|
+
const toggleToastOptions = () => {
|
|
426
|
+
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
427
|
+
};
|
|
428
|
+
useEffect3(() => {
|
|
429
|
+
progress >= 100 && setStateToast(false);
|
|
430
|
+
}, [progress]);
|
|
431
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, stateToast && /* @__PURE__ */ React2.createElement(
|
|
432
|
+
Stack,
|
|
433
|
+
{
|
|
434
|
+
position: "fixed",
|
|
435
|
+
zIndex: 1400,
|
|
436
|
+
right: 16,
|
|
437
|
+
top: 16,
|
|
438
|
+
width: 370,
|
|
439
|
+
sx: {
|
|
440
|
+
boxShadow: (theme) => theme.shadows[8]
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
/* @__PURE__ */ React2.createElement(
|
|
444
|
+
Box2,
|
|
445
|
+
{
|
|
446
|
+
padding: 1.5,
|
|
447
|
+
gap: 1.5,
|
|
448
|
+
display: "flex",
|
|
449
|
+
alignItems: "center",
|
|
450
|
+
sx: {
|
|
451
|
+
backgroundColor: {
|
|
452
|
+
success: "success.50",
|
|
453
|
+
error: "error.50",
|
|
454
|
+
warning: "warning.50",
|
|
455
|
+
info: "info.50"
|
|
456
|
+
}[toastColorConfig]
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
/* @__PURE__ */ React2.createElement(
|
|
460
|
+
Stack,
|
|
461
|
+
{
|
|
462
|
+
p: 1,
|
|
463
|
+
gap: 1,
|
|
464
|
+
borderRadius: 50,
|
|
465
|
+
bgcolor: {
|
|
466
|
+
success: "success.100",
|
|
467
|
+
error: "error.100",
|
|
468
|
+
warning: "warning.100",
|
|
469
|
+
info: "info.100"
|
|
470
|
+
}[(_a = toast.type) != null ? _a : "info"]
|
|
471
|
+
},
|
|
472
|
+
/* @__PURE__ */ React2.createElement(Stack, null, ToastIconConfig)
|
|
473
|
+
),
|
|
474
|
+
/* @__PURE__ */ React2.createElement(Divider, { orientation: "vertical", flexItem: true }),
|
|
475
|
+
/* @__PURE__ */ React2.createElement(Stack, { width: 285 }, /* @__PURE__ */ React2.createElement(
|
|
476
|
+
Stack,
|
|
477
|
+
{
|
|
478
|
+
justifyContent: "space-between",
|
|
479
|
+
flexDirection: "row",
|
|
480
|
+
alignItems: "center"
|
|
481
|
+
},
|
|
482
|
+
/* @__PURE__ */ React2.createElement(Typography2, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
483
|
+
/* @__PURE__ */ React2.createElement(
|
|
484
|
+
IconButton2,
|
|
485
|
+
{
|
|
486
|
+
size: "small",
|
|
487
|
+
"data-testid": "close-icon",
|
|
488
|
+
onClick: closeToast
|
|
489
|
+
},
|
|
490
|
+
/* @__PURE__ */ React2.createElement(Close, { fontSize: "small" })
|
|
491
|
+
)
|
|
492
|
+
), /* @__PURE__ */ React2.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React2.createElement(Typography2, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ React2.createElement(Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ React2.createElement(Typography2, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ React2.createElement(Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ React2.createElement(Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ React2.createElement(
|
|
493
|
+
Button,
|
|
494
|
+
{
|
|
495
|
+
key: index,
|
|
496
|
+
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
497
|
+
variant: "text",
|
|
498
|
+
onClick: button.fn,
|
|
499
|
+
disabled: button.disabled || false,
|
|
500
|
+
size: "small"
|
|
501
|
+
},
|
|
502
|
+
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
503
|
+
))), toast.seeMore && /* @__PURE__ */ React2.createElement(
|
|
504
|
+
Button,
|
|
505
|
+
{
|
|
506
|
+
onClick: toggleToastOptions,
|
|
507
|
+
size: "small",
|
|
508
|
+
variant: "text",
|
|
509
|
+
color: toastColorConfig
|
|
510
|
+
},
|
|
511
|
+
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
512
|
+
stateOptions ? /* @__PURE__ */ React2.createElement(KeyboardArrowDown, null) : /* @__PURE__ */ React2.createElement(KeyboardArrowUp, null)
|
|
513
|
+
)))
|
|
514
|
+
),
|
|
515
|
+
/* @__PURE__ */ React2.createElement(
|
|
516
|
+
LinearProgress,
|
|
517
|
+
{
|
|
518
|
+
sx: {
|
|
519
|
+
".MuiLinearProgress-bar": {
|
|
520
|
+
transition: "0.1s linear !important",
|
|
521
|
+
transform: "scaleX(-1)"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
color: toastColorConfig,
|
|
525
|
+
variant: "determinate",
|
|
526
|
+
value: 100 - progress
|
|
1020
527
|
}
|
|
1021
528
|
)
|
|
1022
|
-
)
|
|
1023
|
-
InfoOutlined,
|
|
1024
|
-
{
|
|
1025
|
-
"data-testid": "test-infoElement",
|
|
1026
|
-
component: "svg",
|
|
1027
|
-
sx: { marginLeft: "4px" },
|
|
1028
|
-
color: "action",
|
|
1029
|
-
fontSize: "small",
|
|
1030
|
-
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
1031
|
-
onMouseLeave: handleCloseInfoElement
|
|
1032
|
-
}
|
|
1033
|
-
), /* @__PURE__ */ React5.createElement(
|
|
1034
|
-
Popover,
|
|
1035
|
-
{
|
|
1036
|
-
sx: { pointerEvents: "none" },
|
|
1037
|
-
open: openInfoElement,
|
|
1038
|
-
anchorEl: anchorInfoElement,
|
|
1039
|
-
onClose: handleCloseInfoElement,
|
|
1040
|
-
anchorOrigin: {
|
|
1041
|
-
vertical: "bottom",
|
|
1042
|
-
horizontal: "left"
|
|
1043
|
-
},
|
|
1044
|
-
transformOrigin: {
|
|
1045
|
-
vertical: "top",
|
|
1046
|
-
horizontal: "left"
|
|
1047
|
-
},
|
|
1048
|
-
disableRestoreFocus: true
|
|
1049
|
-
},
|
|
1050
|
-
/* @__PURE__ */ React5.createElement(Typography4, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
1051
|
-
)) : /* @__PURE__ */ React5.createElement(Tooltip2, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React5.createElement(
|
|
1052
|
-
InfoOutlined,
|
|
1053
|
-
{
|
|
1054
|
-
sx: { marginLeft: "4px" },
|
|
1055
|
-
color: "action",
|
|
1056
|
-
fontSize: "small"
|
|
1057
|
-
}
|
|
1058
|
-
))) : ""));
|
|
529
|
+
));
|
|
1059
530
|
};
|
|
1060
531
|
|
|
1061
532
|
// src/Components/TextArea/Helpers/validateIcon.tsx
|
|
1062
|
-
import * as
|
|
533
|
+
import * as MuiIcons from "@mui/icons-material";
|
|
1063
534
|
function getIcon(name) {
|
|
1064
|
-
if (!name || !(name in
|
|
535
|
+
if (!name || !(name in MuiIcons)) {
|
|
1065
536
|
return null;
|
|
1066
537
|
}
|
|
1067
|
-
return
|
|
538
|
+
return MuiIcons[name];
|
|
1068
539
|
}
|
|
1069
540
|
|
|
1070
541
|
// src/Components/TextArea/SCTextArea.tsx
|
|
1071
|
-
import
|
|
1072
|
-
import { Typography as
|
|
542
|
+
import React3, { useEffect as useEffect4, useState as useState4 } from "react";
|
|
543
|
+
import { Typography as Typography3, Stack as Stack2, TextField, Box as Box3, Popover as Popover2, Tooltip as Tooltip2, SvgIcon as SvgIcon2, Grid as Grid2 } from "@mui/material";
|
|
1073
544
|
import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
|
|
1074
545
|
var SCTextArea = ({
|
|
1075
546
|
//informativas
|
|
@@ -1092,11 +563,11 @@ var SCTextArea = ({
|
|
|
1092
563
|
state,
|
|
1093
564
|
onBlur
|
|
1094
565
|
}) => {
|
|
1095
|
-
const [helperCount, setHelperCount] =
|
|
1096
|
-
const [stateError, setStateError] =
|
|
1097
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
566
|
+
const [helperCount, setHelperCount] = useState4(0);
|
|
567
|
+
const [stateError, setStateError] = useState4(false);
|
|
568
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = React3.useState(null);
|
|
1098
569
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
1099
|
-
|
|
570
|
+
useEffect4(() => {
|
|
1100
571
|
setHelperCount(state == null ? void 0 : state.length);
|
|
1101
572
|
}, [state]);
|
|
1102
573
|
const IconTitle = getIcon(iconTitle);
|
|
@@ -1118,7 +589,7 @@ var SCTextArea = ({
|
|
|
1118
589
|
const handleCloseInfoTitle = () => {
|
|
1119
590
|
setAnchorInfoTitle(null);
|
|
1120
591
|
};
|
|
1121
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Box3, { sx: { width } }, /* @__PURE__ */ React3.createElement(Grid2, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ React3.createElement(SvgIcon2, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ React3.createElement(Typography3, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
1122
593
|
InfoOutlined2,
|
|
1123
594
|
{
|
|
1124
595
|
color: "action",
|
|
@@ -1126,7 +597,7 @@ var SCTextArea = ({
|
|
|
1126
597
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
1127
598
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
1128
599
|
}
|
|
1129
|
-
), /* @__PURE__ */
|
|
600
|
+
), /* @__PURE__ */ React3.createElement(
|
|
1130
601
|
Popover2,
|
|
1131
602
|
{
|
|
1132
603
|
sx: { pointerEvents: "none" },
|
|
@@ -1143,14 +614,14 @@ var SCTextArea = ({
|
|
|
1143
614
|
},
|
|
1144
615
|
disableRestoreFocus: true
|
|
1145
616
|
},
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
)) : /* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ React3.createElement(Typography3, { sx: { p: 2 } }, infoTitle.text)
|
|
618
|
+
)) : /* @__PURE__ */ React3.createElement(Tooltip2, { title: infoTitle.text, placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React3.createElement(
|
|
1148
619
|
InfoOutlined2,
|
|
1149
620
|
{
|
|
1150
621
|
color: "action",
|
|
1151
622
|
fontSize: "small"
|
|
1152
623
|
}
|
|
1153
|
-
))) : ""), /* @__PURE__ */
|
|
624
|
+
))) : ""), /* @__PURE__ */ React3.createElement(Stack2, null, /* @__PURE__ */ React3.createElement(
|
|
1154
625
|
TextField,
|
|
1155
626
|
{
|
|
1156
627
|
required,
|
|
@@ -1172,8 +643,8 @@ var SCTextArea = ({
|
|
|
1172
643
|
},
|
|
1173
644
|
autoComplete: "off"
|
|
1174
645
|
}
|
|
1175
|
-
)), /* @__PURE__ */
|
|
1176
|
-
|
|
646
|
+
)), /* @__PURE__ */ React3.createElement(Stack2, null, /* @__PURE__ */ React3.createElement(
|
|
647
|
+
Typography3,
|
|
1177
648
|
{
|
|
1178
649
|
variant: "caption",
|
|
1179
650
|
color: "text.secondary",
|
|
@@ -1186,8 +657,8 @@ var SCTextArea = ({
|
|
|
1186
657
|
};
|
|
1187
658
|
|
|
1188
659
|
// src/Components/SCSelect.tsx
|
|
1189
|
-
import
|
|
1190
|
-
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as
|
|
660
|
+
import React4, { useEffect as useEffect5 } from "react";
|
|
661
|
+
import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as Box4 } from "@mui/material";
|
|
1191
662
|
import Select from "@mui/material/Select";
|
|
1192
663
|
import * as Muicon2 from "@mui/icons-material";
|
|
1193
664
|
function SCSelect({
|
|
@@ -1197,23 +668,25 @@ function SCSelect({
|
|
|
1197
668
|
width = "100%",
|
|
1198
669
|
size = "small",
|
|
1199
670
|
variant = "outlined",
|
|
1200
|
-
|
|
671
|
+
deleteType = "button",
|
|
1201
672
|
required,
|
|
1202
673
|
disabled,
|
|
674
|
+
background,
|
|
675
|
+
fnAplicar,
|
|
1203
676
|
setState,
|
|
1204
677
|
state
|
|
1205
678
|
}) {
|
|
1206
679
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
1207
|
-
const [prevData, setPrevData] =
|
|
1208
|
-
const [error, setError] =
|
|
1209
|
-
|
|
680
|
+
const [prevData, setPrevData] = React4.useState(data);
|
|
681
|
+
const [error, setError] = React4.useState(false);
|
|
682
|
+
useEffect5(() => {
|
|
1210
683
|
if (error) {
|
|
1211
684
|
setTimeout(() => {
|
|
1212
685
|
setError(false);
|
|
1213
686
|
}, 1e3);
|
|
1214
687
|
}
|
|
1215
688
|
}, [error]);
|
|
1216
|
-
|
|
689
|
+
useEffect5(() => {
|
|
1217
690
|
let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
1218
691
|
if (dataChangeValidation == false) {
|
|
1219
692
|
setState({ hiddenValue: "", textValue: "" });
|
|
@@ -1247,25 +720,25 @@ function SCSelect({
|
|
|
1247
720
|
}
|
|
1248
721
|
}
|
|
1249
722
|
};
|
|
1250
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, data && /* @__PURE__ */ React4.createElement(Box4, { sx: { width } }, /* @__PURE__ */ React4.createElement(
|
|
1251
724
|
FormControl2,
|
|
1252
725
|
{
|
|
1253
726
|
fullWidth: true,
|
|
1254
727
|
size: size ? size : "medium",
|
|
1255
728
|
variant
|
|
1256
729
|
},
|
|
1257
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ React4.createElement(
|
|
1258
731
|
InputLabel2,
|
|
1259
732
|
{
|
|
1260
733
|
error
|
|
1261
734
|
},
|
|
1262
|
-
required ? /* @__PURE__ */
|
|
735
|
+
required ? /* @__PURE__ */ React4.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label
|
|
1263
736
|
),
|
|
1264
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ React4.createElement(
|
|
1265
738
|
Select,
|
|
1266
739
|
{
|
|
1267
740
|
value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
|
|
1268
|
-
label: required ? /* @__PURE__ */
|
|
741
|
+
label: required ? /* @__PURE__ */ React4.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
1269
742
|
onChange: handleChange,
|
|
1270
743
|
onBlur: handleBlur,
|
|
1271
744
|
variant,
|
|
@@ -1274,32 +747,26 @@ function SCSelect({
|
|
|
1274
747
|
MenuProps: {
|
|
1275
748
|
PaperProps: {
|
|
1276
749
|
sx: {
|
|
1277
|
-
|
|
1278
|
-
minWidth: "100%"
|
|
750
|
+
left: "0px !important"
|
|
1279
751
|
}
|
|
1280
752
|
},
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
vertical: "top",
|
|
1287
|
-
horizontal: "left"
|
|
1288
|
-
},
|
|
1289
|
-
disableAutoFocusItem: true,
|
|
1290
|
-
marginThreshold: 0
|
|
753
|
+
sx: {
|
|
754
|
+
"& .MuiPaper-root": {
|
|
755
|
+
left: "0px !important"
|
|
756
|
+
}
|
|
757
|
+
}
|
|
1291
758
|
}
|
|
1292
759
|
},
|
|
1293
760
|
data.map((option, index) => {
|
|
1294
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ React4.createElement(MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React4.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React4.createElement(SvgIcon3, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ React4.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
|
|
1295
762
|
})
|
|
1296
763
|
)
|
|
1297
764
|
)));
|
|
1298
765
|
}
|
|
1299
766
|
|
|
1300
767
|
// src/Components/SCAutocomplete.tsx
|
|
1301
|
-
import
|
|
1302
|
-
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as
|
|
768
|
+
import React5, { useEffect as useEffect6 } from "react";
|
|
769
|
+
import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography5, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton4, Chip, Box as Box5, Button as Button3 } from "@mui/material";
|
|
1303
770
|
import Grid3 from "@mui/material/Grid2";
|
|
1304
771
|
import { Search, Clear } from "@mui/icons-material";
|
|
1305
772
|
import * as Muicon3 from "@mui/icons-material";
|
|
@@ -1319,16 +786,17 @@ function SCAutocomplete({
|
|
|
1319
786
|
state,
|
|
1320
787
|
inputChange,
|
|
1321
788
|
maxCheck
|
|
789
|
+
// Agregar el parámetro maxCheck
|
|
1322
790
|
}) {
|
|
1323
791
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
1324
792
|
let group = "";
|
|
1325
793
|
let isSelected = false;
|
|
1326
|
-
const [selectedOptions, setSelectedOptions] =
|
|
1327
|
-
const [prevData, setPrevData] =
|
|
1328
|
-
const [originalData, setOriginalData] =
|
|
1329
|
-
const [inputValue, setInputValue] =
|
|
1330
|
-
const [isUserTyping, setIsUserTyping] =
|
|
1331
|
-
|
|
794
|
+
const [selectedOptions, setSelectedOptions] = React5.useState([]);
|
|
795
|
+
const [prevData, setPrevData] = React5.useState(data);
|
|
796
|
+
const [originalData, setOriginalData] = React5.useState(data);
|
|
797
|
+
const [inputValue, setInputValue] = React5.useState("");
|
|
798
|
+
const [isUserTyping, setIsUserTyping] = React5.useState(false);
|
|
799
|
+
useEffect6(() => {
|
|
1332
800
|
const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
1333
801
|
if (!dataChangeValidation && !isUserTyping) {
|
|
1334
802
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
@@ -1339,7 +807,7 @@ function SCAutocomplete({
|
|
|
1339
807
|
}
|
|
1340
808
|
setPrevData(data);
|
|
1341
809
|
}, [data, isUserTyping]);
|
|
1342
|
-
|
|
810
|
+
useEffect6(() => {
|
|
1343
811
|
if (typeFormat == "multiselect") {
|
|
1344
812
|
if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
|
|
1345
813
|
const newSelectedOptions = originalData.filter(
|
|
@@ -1349,7 +817,7 @@ function SCAutocomplete({
|
|
|
1349
817
|
}
|
|
1350
818
|
}
|
|
1351
819
|
}, [state.hiddenValue, originalData, typeFormat]);
|
|
1352
|
-
|
|
820
|
+
useEffect6(() => {
|
|
1353
821
|
if (inputValue === "") {
|
|
1354
822
|
setIsUserTyping(false);
|
|
1355
823
|
}
|
|
@@ -1407,12 +875,11 @@ function SCAutocomplete({
|
|
|
1407
875
|
const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
|
|
1408
876
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
1409
877
|
) || null;
|
|
1410
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, data && /* @__PURE__ */ React5.createElement(
|
|
1411
879
|
Autocomplete,
|
|
1412
880
|
{
|
|
1413
881
|
multiple: typeFormat === "multiselect",
|
|
1414
882
|
clearOnEscape: true,
|
|
1415
|
-
noOptionsText: "No se encuentra",
|
|
1416
883
|
disabled,
|
|
1417
884
|
options: data,
|
|
1418
885
|
isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
|
|
@@ -1434,9 +901,9 @@ function SCAutocomplete({
|
|
|
1434
901
|
limitTags: 2,
|
|
1435
902
|
renderTags: (value, getTagProps) => {
|
|
1436
903
|
const limit = 2;
|
|
1437
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, value.slice(0, limit).map((option, index) => {
|
|
1438
905
|
const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
|
|
1439
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1440
907
|
Chip,
|
|
1441
908
|
__spreadProps(__spreadValues({
|
|
1442
909
|
key,
|
|
@@ -1448,7 +915,7 @@ function SCAutocomplete({
|
|
|
1448
915
|
style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
1449
916
|
})
|
|
1450
917
|
);
|
|
1451
|
-
}), value.length > limit && /* @__PURE__ */
|
|
918
|
+
}), value.length > limit && /* @__PURE__ */ React5.createElement(Box5, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
|
|
1452
919
|
},
|
|
1453
920
|
renderOption: (props, option) => {
|
|
1454
921
|
const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
|
|
@@ -1466,7 +933,7 @@ function SCAutocomplete({
|
|
|
1466
933
|
isValid = group == option[columnGroup];
|
|
1467
934
|
group = option[columnGroup];
|
|
1468
935
|
}
|
|
1469
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(React5.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React5.createElement(Typography5, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React5.createElement(
|
|
1470
937
|
MenuItem2,
|
|
1471
938
|
__spreadProps(__spreadValues({}, optionProps), {
|
|
1472
939
|
disabled: isDisabled,
|
|
@@ -1476,8 +943,8 @@ function SCAutocomplete({
|
|
|
1476
943
|
opacity: isDisabled ? 0.5 : 1
|
|
1477
944
|
}
|
|
1478
945
|
}),
|
|
1479
|
-
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */
|
|
1480
|
-
typeFormat == "multiselect" ? /* @__PURE__ */
|
|
946
|
+
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React5.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React5.createElement(SvgIcon4, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
|
|
947
|
+
typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(
|
|
1481
948
|
Checkbox,
|
|
1482
949
|
{
|
|
1483
950
|
checked: isSelected,
|
|
@@ -1486,25 +953,25 @@ function SCAutocomplete({
|
|
|
1486
953
|
color: "primary"
|
|
1487
954
|
}
|
|
1488
955
|
) : "",
|
|
1489
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ React5.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }),
|
|
1490
957
|
getItemValue(option).component != void 0 ? getItemValue(option).component : ""
|
|
1491
958
|
)));
|
|
1492
959
|
},
|
|
1493
|
-
renderInput: (params) => /* @__PURE__ */
|
|
960
|
+
renderInput: (params) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
1494
961
|
TextField3,
|
|
1495
962
|
__spreadProps(__spreadValues({}, params), {
|
|
1496
|
-
label: required ? /* @__PURE__ */
|
|
963
|
+
label: required ? /* @__PURE__ */ React5.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
1497
964
|
placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
|
|
1498
965
|
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
1499
|
-
endAdornment: /* @__PURE__ */
|
|
966
|
+
endAdornment: /* @__PURE__ */ React5.createElement(React5.Fragment, null, deleteType == "icon" && (state.hiddenValue.toString() != "-1" && state.hiddenValue.toString() != "") ? /* @__PURE__ */ React5.createElement(IconButton4, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ React5.createElement(Clear, { fontSize: "small" })) : "", /* @__PURE__ */ React5.createElement(InputAdornment3, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ React5.createElement(Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
|
|
1500
967
|
})
|
|
1501
968
|
})
|
|
1502
969
|
)),
|
|
1503
970
|
slotProps: {
|
|
1504
971
|
listbox: {
|
|
1505
|
-
component:
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
|
|
972
|
+
component: React5.forwardRef(function ListboxComponent(props, ref) {
|
|
973
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
974
|
+
Box5,
|
|
1508
975
|
__spreadProps(__spreadValues({
|
|
1509
976
|
ref
|
|
1510
977
|
}, props), {
|
|
@@ -1514,9 +981,9 @@ function SCAutocomplete({
|
|
|
1514
981
|
backgroundColor: "white"
|
|
1515
982
|
}, props.sx)
|
|
1516
983
|
}),
|
|
1517
|
-
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */
|
|
984
|
+
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(FormControlLabel2, { control: /* @__PURE__ */ React5.createElement(Checkbox, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los items", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ React5.createElement(Divider3, null)) : "",
|
|
1518
985
|
props.children,
|
|
1519
|
-
deleteType == "button" || fnAplicar ? /* @__PURE__ */
|
|
986
|
+
deleteType == "button" || fnAplicar ? /* @__PURE__ */ React5.createElement(
|
|
1520
987
|
Grid3,
|
|
1521
988
|
{
|
|
1522
989
|
container: true,
|
|
@@ -1531,8 +998,8 @@ function SCAutocomplete({
|
|
|
1531
998
|
justifyContent: "space-between"
|
|
1532
999
|
}
|
|
1533
1000
|
},
|
|
1534
|
-
deleteType == "button" ? /* @__PURE__ */
|
|
1535
|
-
|
|
1001
|
+
deleteType == "button" ? /* @__PURE__ */ React5.createElement(
|
|
1002
|
+
Button3,
|
|
1536
1003
|
{
|
|
1537
1004
|
variant: "text",
|
|
1538
1005
|
color: "primary",
|
|
@@ -1544,8 +1011,8 @@ function SCAutocomplete({
|
|
|
1544
1011
|
},
|
|
1545
1012
|
"Limpiar"
|
|
1546
1013
|
) : "",
|
|
1547
|
-
fnAplicar && /* @__PURE__ */
|
|
1548
|
-
|
|
1014
|
+
fnAplicar && /* @__PURE__ */ React5.createElement(
|
|
1015
|
+
Button3,
|
|
1549
1016
|
{
|
|
1550
1017
|
variant: "contained",
|
|
1551
1018
|
color: "primary",
|
|
@@ -1564,8 +1031,8 @@ function SCAutocomplete({
|
|
|
1564
1031
|
}
|
|
1565
1032
|
|
|
1566
1033
|
// src/Components/SCDateRange.tsx
|
|
1567
|
-
import
|
|
1568
|
-
import { Box as
|
|
1034
|
+
import React6 from "react";
|
|
1035
|
+
import { Box as Box6, InputAdornment as InputAdornment4 } from "@mui/material";
|
|
1569
1036
|
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
1570
1037
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
1571
1038
|
import { DateRangePicker } from "@mui/x-date-pickers-pro/DateRangePicker";
|
|
@@ -1596,7 +1063,7 @@ var SCDateRange = ({
|
|
|
1596
1063
|
];
|
|
1597
1064
|
setState(convertedValue);
|
|
1598
1065
|
};
|
|
1599
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ React6.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React6.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React6.createElement(
|
|
1600
1067
|
DateRangePicker,
|
|
1601
1068
|
{
|
|
1602
1069
|
value: state,
|
|
@@ -1615,7 +1082,7 @@ var SCDateRange = ({
|
|
|
1615
1082
|
required,
|
|
1616
1083
|
error: position === "start" ? isStartEmpty : isEndEmpty,
|
|
1617
1084
|
InputProps: {
|
|
1618
|
-
endAdornment: /* @__PURE__ */
|
|
1085
|
+
endAdornment: /* @__PURE__ */ React6.createElement(InputAdornment4, { position: "end" }, /* @__PURE__ */ React6.createElement(
|
|
1619
1086
|
EventIcon,
|
|
1620
1087
|
{
|
|
1621
1088
|
color: hasError ? "error" : "action",
|
|
@@ -1656,81 +1123,29 @@ var getIcon2 = (iconName) => {
|
|
|
1656
1123
|
};
|
|
1657
1124
|
|
|
1658
1125
|
// src/Components/Drawer/Helpers/validateInput.tsx
|
|
1659
|
-
var validateInputs = (arrayElements, onError, onSuccess
|
|
1660
|
-
var _a
|
|
1126
|
+
var validateInputs = (arrayElements, onError, onSuccess) => {
|
|
1127
|
+
var _a;
|
|
1661
1128
|
let requiredValues = 0;
|
|
1662
1129
|
let filledValues = 0;
|
|
1663
1130
|
for (let i = 0; i < arrayElements.length; i++) {
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1131
|
+
if (arrayElements[i].component === void 0) {
|
|
1132
|
+
if (arrayElements[i].required) {
|
|
1133
|
+
requiredValues++;
|
|
1134
|
+
}
|
|
1135
|
+
if (arrayElements[i].required && ((_a = arrayElements[i].state) == null ? void 0 : _a.trim()) !== "") {
|
|
1670
1136
|
filledValues++;
|
|
1671
1137
|
}
|
|
1672
1138
|
}
|
|
1673
1139
|
}
|
|
1674
1140
|
if (requiredValues === filledValues) {
|
|
1675
1141
|
onSuccess();
|
|
1676
|
-
setChipFilters(true);
|
|
1677
1142
|
} else {
|
|
1678
1143
|
onError({
|
|
1679
1144
|
type: "error",
|
|
1680
1145
|
title: "Algunos campos son requeridos",
|
|
1681
1146
|
time: 10
|
|
1682
1147
|
});
|
|
1683
|
-
setChipFilters(false);
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
|
-
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
1688
|
-
import React10 from "react";
|
|
1689
|
-
var validateTypeElements = (element) => {
|
|
1690
|
-
var _a;
|
|
1691
|
-
let validation = "";
|
|
1692
|
-
let typeElement = element;
|
|
1693
|
-
if (element.type == "textField") {
|
|
1694
|
-
validation = "textField";
|
|
1695
|
-
typeElement = element;
|
|
1696
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextField") {
|
|
1697
|
-
validation = "textField";
|
|
1698
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1699
|
-
} else if (element.type == "textArea") {
|
|
1700
|
-
validation = "textArea";
|
|
1701
|
-
typeElement = element;
|
|
1702
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextArea") {
|
|
1703
|
-
validation = "textArea";
|
|
1704
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1705
|
-
} else if (element.type == "dateRange") {
|
|
1706
|
-
validation = "dateRange";
|
|
1707
|
-
typeElement = element;
|
|
1708
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCDateRange") {
|
|
1709
|
-
validation = "dateRange";
|
|
1710
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1711
|
-
} else if (element.type == "autocomplete") {
|
|
1712
|
-
validation = "autocomplete";
|
|
1713
|
-
typeElement = element;
|
|
1714
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCAutocomplete") {
|
|
1715
|
-
validation = "autocomplete";
|
|
1716
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1717
|
-
} else if (element.typeFormat == "multiselect") {
|
|
1718
|
-
validation = "multiselect";
|
|
1719
|
-
typeElement = element;
|
|
1720
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_a = element == null ? void 0 : element.component) == null ? void 0 : _a.props).typeFormat == "multiselect") {
|
|
1721
|
-
validation = "multiselect";
|
|
1722
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1723
|
-
} else if (element.type == "select") {
|
|
1724
|
-
validation = "select";
|
|
1725
|
-
typeElement = element;
|
|
1726
|
-
} else if (React10.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCSelect") {
|
|
1727
|
-
validation = "select";
|
|
1728
|
-
typeElement = element == null ? void 0 : element.component.props;
|
|
1729
1148
|
}
|
|
1730
|
-
return {
|
|
1731
|
-
validation,
|
|
1732
|
-
element: typeElement
|
|
1733
|
-
};
|
|
1734
1149
|
};
|
|
1735
1150
|
|
|
1736
1151
|
// src/Components/Drawer/SCDrawer.tsx
|
|
@@ -1745,42 +1160,16 @@ function SCDrawer({
|
|
|
1745
1160
|
anchor = "left",
|
|
1746
1161
|
width,
|
|
1747
1162
|
//Funcionales
|
|
1748
|
-
open
|
|
1749
|
-
setOpen,
|
|
1750
|
-
chipFilters
|
|
1163
|
+
open
|
|
1751
1164
|
}) {
|
|
1752
1165
|
var _a, _b;
|
|
1753
|
-
const
|
|
1754
|
-
const [
|
|
1755
|
-
const [toast, setToast] = React11.useState(null);
|
|
1756
|
-
const [stateChipFilters, setChipFilters] = React11.useState(false);
|
|
1757
|
-
const [textFilters, setTextFilters] = React11.useState([]);
|
|
1758
|
-
useEffect10(() => {
|
|
1759
|
-
if (chipFilters != void 0) {
|
|
1760
|
-
if (chipFilters.length > 0) {
|
|
1761
|
-
setTextFilters([]);
|
|
1762
|
-
inputValidation();
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
}, [chipFilters]);
|
|
1766
|
-
useEffect10(() => {
|
|
1767
|
-
if (open) {
|
|
1768
|
-
toggleDrawer(true);
|
|
1769
|
-
} else {
|
|
1770
|
-
handleDrawerClose();
|
|
1771
|
-
}
|
|
1772
|
-
}, [open]);
|
|
1166
|
+
const [drawerOpen, setDrawerOpen] = React7.useState(open);
|
|
1167
|
+
const [toast, setToast] = React7.useState(null);
|
|
1773
1168
|
const handleDrawerClose = () => {
|
|
1774
1169
|
setDrawerOpen(false);
|
|
1775
|
-
if (setOpen) {
|
|
1776
|
-
setOpen(false);
|
|
1777
|
-
}
|
|
1778
1170
|
};
|
|
1779
1171
|
const toggleDrawer = (newOpen) => () => {
|
|
1780
1172
|
setDrawerOpen(newOpen);
|
|
1781
|
-
if (setOpen) {
|
|
1782
|
-
setOpen(true);
|
|
1783
|
-
}
|
|
1784
1173
|
};
|
|
1785
1174
|
const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
|
|
1786
1175
|
const setToastWithDelay = (toastContent) => {
|
|
@@ -1789,179 +1178,39 @@ function SCDrawer({
|
|
|
1789
1178
|
setToast(toastContent);
|
|
1790
1179
|
}, 10);
|
|
1791
1180
|
};
|
|
1792
|
-
const inputValidation = () =>
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
chipFilters.forEach((chipFilter) => {
|
|
1808
|
-
const chipValue = String(chipFilter).trim();
|
|
1809
|
-
if (currentValue === chipValue && currentValue !== "" && currentValue !== ",") {
|
|
1810
|
-
setTextFilters((prevFilters) => {
|
|
1811
|
-
const newFilter = { value: currentValue, arrayElement: typeElement };
|
|
1812
|
-
const existingFilterIndex = prevFilters.findIndex(
|
|
1813
|
-
(filter) => filter.arrayElement.label === arrayElement.label
|
|
1814
|
-
);
|
|
1815
|
-
if (existingFilterIndex !== -1) {
|
|
1816
|
-
const updatedFilters = [...prevFilters];
|
|
1817
|
-
updatedFilters[existingFilterIndex] = newFilter;
|
|
1818
|
-
return updatedFilters;
|
|
1819
|
-
} else {
|
|
1820
|
-
return [...prevFilters, newFilter];
|
|
1821
|
-
}
|
|
1822
|
-
});
|
|
1823
|
-
}
|
|
1824
|
-
});
|
|
1825
|
-
});
|
|
1826
|
-
}
|
|
1827
|
-
} else {
|
|
1828
|
-
const newFiltersToAdd = [];
|
|
1829
|
-
for (let i = 0; i < arrayElements.length; i++) {
|
|
1830
|
-
const element = arrayElements[i];
|
|
1831
|
-
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1832
|
-
const textValue = ((_a2 = typeElement.state) == null ? void 0 : _a2.textValue) !== void 0 ? String((_b2 = typeElement.state) == null ? void 0 : _b2.textValue) : String(typeElement.state);
|
|
1833
|
-
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1834
|
-
let newFilter;
|
|
1835
|
-
switch (validation) {
|
|
1836
|
-
case "dateRange":
|
|
1837
|
-
const values = `${(_c = typeElement.state[0]) == null ? void 0 : _c.format("DD/MM/YYYY")} - ${(_d = typeElement.state[1]) == null ? void 0 : _d.format("DD/MM/YYYY")}`;
|
|
1838
|
-
newFilter = { value: values, arrayElement: typeElement };
|
|
1839
|
-
break;
|
|
1840
|
-
default:
|
|
1841
|
-
newFilter = { value: textValue, arrayElement: typeElement };
|
|
1842
|
-
break;
|
|
1843
|
-
}
|
|
1844
|
-
const existingFilterByLabel = newFiltersToAdd.find(
|
|
1845
|
-
(filter) => filter.arrayElement.label === element.label
|
|
1846
|
-
);
|
|
1847
|
-
if (existingFilterByLabel) {
|
|
1848
|
-
existingFilterByLabel.value = newFilter.value;
|
|
1849
|
-
existingFilterByLabel.arrayElement = newFilter.arrayElement;
|
|
1181
|
+
const inputValidation = () => validateInputs(arrayElements, setToastWithDelay, handleDrawerClose);
|
|
1182
|
+
const clean = () => {
|
|
1183
|
+
arrayElements.forEach((element, index) => {
|
|
1184
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
1185
|
+
if (element.setState || React7.isValidElement(element == null ? void 0 : element.component) && ((_a2 = element.component.props) == null ? void 0 : _a2.setState)) {
|
|
1186
|
+
if (element.type === "textField" || React7.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name === "SCtextField" || (element.type === "textArea" || React7.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name === "SCtextArea")) {
|
|
1187
|
+
element.setState != void 0 ? element.setState("") : null;
|
|
1188
|
+
React7.isValidElement(element == null ? void 0 : element.component) && ((_b2 = element.component.props) == null ? void 0 : _b2.setState) && ((_d = (_c = element == null ? void 0 : element.component) == null ? void 0 : _c.props) == null ? void 0 : _d.setState(""));
|
|
1189
|
+
} else if (element.type === "dateRange" || React7.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name === "SCDateRange") {
|
|
1190
|
+
element.setState != void 0 ? element.setState([null, null]) : null;
|
|
1191
|
+
React7.isValidElement(element == null ? void 0 : element.component) && typeof ((_e = element.component.props) == null ? void 0 : _e.setState) === "function" && element.component.props.setState([null, null]);
|
|
1192
|
+
} else {
|
|
1193
|
+
if (element.type == "autocomplete" || React7.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name === "SCAutocomplete" || (element.typeFormat == "multiselect" || React7.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_f = element == null ? void 0 : element.component) == null ? void 0 : _f.props).typeFormat == "multiselect")) {
|
|
1194
|
+
element.setState != void 0 ? element.setState({ hiddenValue: [], textValue: [] }) : null;
|
|
1195
|
+
React7.isValidElement(element == null ? void 0 : element.component) && typeof ((_g = element.component.props) == null ? void 0 : _g.setState) === "function" && element.component.props.setState({ hiddenValue: [], textValue: [] });
|
|
1850
1196
|
} else {
|
|
1851
|
-
|
|
1197
|
+
element.setState != void 0 ? element.setState({ hiddenValue: "-1", textValue: "" }) : null;
|
|
1198
|
+
React7.isValidElement(element == null ? void 0 : element.component) && typeof ((_h = element.component.props) == null ? void 0 : _h.setState) === "function" && element.component.props.setState({ hiddenValue: "-1", textValue: "" });
|
|
1852
1199
|
}
|
|
1853
1200
|
}
|
|
1854
1201
|
}
|
|
1855
|
-
setTextFilters((prevFilters) => {
|
|
1856
|
-
let updatedFilters = [...prevFilters];
|
|
1857
|
-
newFiltersToAdd.forEach((newFilter) => {
|
|
1858
|
-
const existingFilterIndex = updatedFilters.findIndex(
|
|
1859
|
-
(filter) => filter.arrayElement.label === newFilter.arrayElement.label
|
|
1860
|
-
);
|
|
1861
|
-
if (existingFilterIndex !== -1) {
|
|
1862
|
-
updatedFilters[existingFilterIndex] = newFilter;
|
|
1863
|
-
} else {
|
|
1864
|
-
updatedFilters.push(newFilter);
|
|
1865
|
-
}
|
|
1866
|
-
});
|
|
1867
|
-
return updatedFilters;
|
|
1868
|
-
});
|
|
1869
|
-
validateInputs(arrayElements, setToastWithDelay, handleDrawerClose, setChipFilters, setTextFilters);
|
|
1870
|
-
}
|
|
1871
|
-
};
|
|
1872
|
-
const resetElementByType = (originalElement, validation, typeElement) => {
|
|
1873
|
-
let defaultValue;
|
|
1874
|
-
switch (validation) {
|
|
1875
|
-
case "textField":
|
|
1876
|
-
case "textArea":
|
|
1877
|
-
defaultValue = "";
|
|
1878
|
-
break;
|
|
1879
|
-
case "dateRange":
|
|
1880
|
-
defaultValue = [null, null];
|
|
1881
|
-
break;
|
|
1882
|
-
case "multiselect":
|
|
1883
|
-
defaultValue = { hiddenValue: [], textValue: [] };
|
|
1884
|
-
break;
|
|
1885
|
-
default:
|
|
1886
|
-
defaultValue = { hiddenValue: "-1", textValue: "" };
|
|
1887
|
-
}
|
|
1888
|
-
if (typeElement.setState) {
|
|
1889
|
-
typeElement.setState(defaultValue);
|
|
1890
|
-
}
|
|
1891
|
-
};
|
|
1892
|
-
const cleanFilters = () => {
|
|
1893
|
-
arrayElements.forEach((element) => {
|
|
1894
|
-
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1895
|
-
if (typeElement.setState) {
|
|
1896
|
-
resetElementByType(element, validation, typeElement);
|
|
1897
|
-
}
|
|
1898
|
-
});
|
|
1899
|
-
setTextFilters([]);
|
|
1900
|
-
};
|
|
1901
|
-
const deleteFilter = (element) => {
|
|
1902
|
-
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1903
|
-
if (typeElement.setState && shouldShowChips == true) {
|
|
1904
|
-
resetElementByType(element, validation, typeElement);
|
|
1905
|
-
setTextFilters(
|
|
1906
|
-
(prevFilters) => prevFilters.filter((filter) => filter.arrayElement.label !== element.label)
|
|
1907
|
-
);
|
|
1908
|
-
}
|
|
1909
|
-
};
|
|
1910
|
-
const scroll = (offset) => {
|
|
1911
|
-
if (scrollRef.current) {
|
|
1912
|
-
scrollRef.current.scrollLeft += offset;
|
|
1913
|
-
}
|
|
1914
|
-
};
|
|
1915
|
-
const hasActiveFilters = () => {
|
|
1916
|
-
return arrayElements.some((arrayElement) => {
|
|
1917
|
-
const { validation, element: typeElement } = validateTypeElements(arrayElement);
|
|
1918
|
-
if (typeElement.state.textValue !== void 0) {
|
|
1919
|
-
return String(typeElement.state.textValue).trim() !== "";
|
|
1920
|
-
} else if (validation === "dateRange") {
|
|
1921
|
-
return typeElement.state && typeElement.state[0] !== null && typeElement.state[1] !== null;
|
|
1922
|
-
} else {
|
|
1923
|
-
return String(typeElement.state).trim() !== "" && String(typeElement.state).trim() !== ",";
|
|
1924
|
-
}
|
|
1925
1202
|
});
|
|
1926
1203
|
};
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1929
|
-
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, toast && /* @__PURE__ */ React11.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ React11.createElement(Grid4, { container: true, justifyContent: "flex-start", flexWrap: "nowrap", alignItems: "center", sx: { width: "100%" } }, shouldShowChips && /* @__PURE__ */ React11.createElement(Box9, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ React11.createElement(IconButton7, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ React11.createElement(ArrowBackIosIcon, { fontSize: "small" })), /* @__PURE__ */ React11.createElement(
|
|
1930
|
-
Box9,
|
|
1931
|
-
{
|
|
1932
|
-
ref: scrollRef,
|
|
1933
|
-
gap: 0.3,
|
|
1934
|
-
sx: {
|
|
1935
|
-
display: "flex",
|
|
1936
|
-
overflowX: "auto",
|
|
1937
|
-
scrollBehavior: "smooth",
|
|
1938
|
-
"&::-webkit-scrollbar": { display: "none" }
|
|
1939
|
-
}
|
|
1940
|
-
},
|
|
1941
|
-
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */ React11.createElement(
|
|
1942
|
-
Chip2,
|
|
1943
|
-
__spreadProps(__spreadValues({
|
|
1944
|
-
key: index,
|
|
1945
|
-
label: chipData.value
|
|
1946
|
-
}, chipData.arrayElement.required == false || chipData.arrayElement.required == void 0 ? { onDelete: () => deleteFilter(chipData.arrayElement) } : {}), {
|
|
1947
|
-
color: "default",
|
|
1948
|
-
variant: "filled",
|
|
1949
|
-
size: "small",
|
|
1950
|
-
sx: {
|
|
1951
|
-
flexShrink: 0,
|
|
1952
|
-
minWidth: "auto"
|
|
1953
|
-
}
|
|
1954
|
-
})
|
|
1955
|
-
))
|
|
1956
|
-
), /* @__PURE__ */ React11.createElement(IconButton7, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ React11.createElement(ArrowForwardIosIcon, { fontSize: "small" }))), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ React11.createElement(
|
|
1204
|
+
const actionsA = actions == false ? false : actions != void 0 ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: clean }];
|
|
1205
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, toast && /* @__PURE__ */ React7.createElement(SCToastNotification, __spreadValues({}, toast)), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ React7.createElement(
|
|
1957
1206
|
Chip2,
|
|
1958
1207
|
__spreadProps(__spreadValues({
|
|
1959
1208
|
onClick: toggleDrawer(true),
|
|
1960
1209
|
color: buttonDrawer == null ? void 0 : buttonDrawer.color,
|
|
1961
1210
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) == "contained" ? "filled" : "outlined",
|
|
1962
1211
|
label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
|
|
1963
|
-
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */
|
|
1964
|
-
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1212
|
+
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
|
|
1213
|
+
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : void 0
|
|
1965
1214
|
}, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
|
|
1966
1215
|
} } : {}), {
|
|
1967
1216
|
sx: {
|
|
@@ -1971,8 +1220,8 @@ function SCDrawer({
|
|
|
1971
1220
|
textTransform: "capitalize"
|
|
1972
1221
|
}
|
|
1973
1222
|
})
|
|
1974
|
-
) : /* @__PURE__ */
|
|
1975
|
-
|
|
1223
|
+
) : /* @__PURE__ */ React7.createElement(
|
|
1224
|
+
Button4,
|
|
1976
1225
|
{
|
|
1977
1226
|
"data-testid": "test-buttonDrawer",
|
|
1978
1227
|
sx: { textTransform: "capitalize" },
|
|
@@ -1980,11 +1229,11 @@ function SCDrawer({
|
|
|
1980
1229
|
onClick: toggleDrawer(true),
|
|
1981
1230
|
size: "small",
|
|
1982
1231
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
|
|
1983
|
-
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */
|
|
1984
|
-
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
1232
|
+
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : null,
|
|
1233
|
+
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : null
|
|
1985
1234
|
},
|
|
1986
1235
|
(_b = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _b : ""
|
|
1987
|
-
)
|
|
1236
|
+
), /* @__PURE__ */ React7.createElement(
|
|
1988
1237
|
Drawer,
|
|
1989
1238
|
{
|
|
1990
1239
|
open: drawerOpen,
|
|
@@ -1998,15 +1247,15 @@ function SCDrawer({
|
|
|
1998
1247
|
}
|
|
1999
1248
|
}
|
|
2000
1249
|
},
|
|
2001
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ React7.createElement(Stack3, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ React7.createElement(Grid4, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ React7.createElement(Typography7, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ React7.createElement(IconButton5, { onClick: handleDrawerClose }, /* @__PURE__ */ React7.createElement(CloseIcon, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ React7.createElement(Stack3, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
|
|
2002
1251
|
var _a2, _b2, _c, _d, _e, _f;
|
|
2003
|
-
return /* @__PURE__ */
|
|
2004
|
-
|
|
1252
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1253
|
+
Box7,
|
|
2005
1254
|
{
|
|
2006
1255
|
key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b2 = arrayElement.label) != null ? _b2 : ""}${index}`,
|
|
2007
1256
|
sx: { width: "100%" }
|
|
2008
1257
|
},
|
|
2009
|
-
arrayElement.component ? /* @__PURE__ */
|
|
1258
|
+
arrayElement.component ? /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ React7.createElement(
|
|
2010
1259
|
SCTextField,
|
|
2011
1260
|
{
|
|
2012
1261
|
title: arrayElement.title,
|
|
@@ -2032,7 +1281,7 @@ function SCDrawer({
|
|
|
2032
1281
|
onBlur: arrayElement.onBlur,
|
|
2033
1282
|
onKeyDown: arrayElement.onKeyDown
|
|
2034
1283
|
}
|
|
2035
|
-
) : arrayElement.type === "textArea" ? /* @__PURE__ */
|
|
1284
|
+
) : arrayElement.type === "textArea" ? /* @__PURE__ */ React7.createElement(
|
|
2036
1285
|
SCTextArea,
|
|
2037
1286
|
{
|
|
2038
1287
|
title: arrayElement.title,
|
|
@@ -2051,7 +1300,7 @@ function SCDrawer({
|
|
|
2051
1300
|
state: arrayElement.state || "",
|
|
2052
1301
|
onBlur: arrayElement.onBlur
|
|
2053
1302
|
}
|
|
2054
|
-
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */
|
|
1303
|
+
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ React7.createElement(
|
|
2055
1304
|
SCAutocomplete,
|
|
2056
1305
|
{
|
|
2057
1306
|
label: arrayElement.label,
|
|
@@ -2069,7 +1318,7 @@ function SCDrawer({
|
|
|
2069
1318
|
state: arrayElement.state || "",
|
|
2070
1319
|
inputChange: arrayElement.inputChange
|
|
2071
1320
|
}
|
|
2072
|
-
) : arrayElement.type === "select" ? /* @__PURE__ */
|
|
1321
|
+
) : arrayElement.type === "select" ? /* @__PURE__ */ React7.createElement(
|
|
2073
1322
|
SCSelect,
|
|
2074
1323
|
{
|
|
2075
1324
|
label: arrayElement.label,
|
|
@@ -2078,6 +1327,7 @@ function SCDrawer({
|
|
|
2078
1327
|
width: arrayElement.width,
|
|
2079
1328
|
size: arrayElement.size,
|
|
2080
1329
|
variant: arrayElement.variant,
|
|
1330
|
+
deleteType: arrayElement.deleteType,
|
|
2081
1331
|
required: arrayElement.required,
|
|
2082
1332
|
disabled: arrayElement.disabled,
|
|
2083
1333
|
background: arrayElement.background,
|
|
@@ -2085,7 +1335,7 @@ function SCDrawer({
|
|
|
2085
1335
|
setState: arrayElement.setState,
|
|
2086
1336
|
state: arrayElement.state || ""
|
|
2087
1337
|
}
|
|
2088
|
-
) : arrayElement.type === "dateRange" ? /* @__PURE__ */
|
|
1338
|
+
) : arrayElement.type === "dateRange" ? /* @__PURE__ */ React7.createElement(
|
|
2089
1339
|
SCDateRange,
|
|
2090
1340
|
{
|
|
2091
1341
|
labelDateInitial: arrayElement.labelDateInitial,
|
|
@@ -2098,7 +1348,7 @@ function SCDrawer({
|
|
|
2098
1348
|
}
|
|
2099
1349
|
) : null
|
|
2100
1350
|
);
|
|
2101
|
-
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */
|
|
1351
|
+
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */ React7.createElement(
|
|
2102
1352
|
Grid4,
|
|
2103
1353
|
{
|
|
2104
1354
|
sx: { borderTop: 1, borderColor: "#1018403B" },
|
|
@@ -2110,8 +1360,8 @@ function SCDrawer({
|
|
|
2110
1360
|
justifyContent: actionsA.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
|
|
2111
1361
|
flexDirection: anchor != "right" ? "row-reverse" : "row"
|
|
2112
1362
|
},
|
|
2113
|
-
actionsA.map((btn, index) => /* @__PURE__ */
|
|
2114
|
-
|
|
1363
|
+
actionsA.map((btn, index) => /* @__PURE__ */ React7.createElement(
|
|
1364
|
+
Button4,
|
|
2115
1365
|
{
|
|
2116
1366
|
key: index,
|
|
2117
1367
|
variant: index === 0 || actionsA.length < 2 ? "contained" : "text",
|
|
@@ -2127,61 +1377,207 @@ function SCDrawer({
|
|
|
2127
1377
|
}
|
|
2128
1378
|
|
|
2129
1379
|
// src/Components/FooterAction/FooterAction.tsx
|
|
2130
|
-
import
|
|
2131
|
-
import { AppBar, Toolbar, Box as
|
|
1380
|
+
import React8 from "react";
|
|
1381
|
+
import { AppBar, Toolbar, Box as Box8, Typography as Typography8 } from "@mui/material";
|
|
2132
1382
|
var FooterAction = ({
|
|
2133
1383
|
leftContent,
|
|
2134
1384
|
rightContent,
|
|
2135
1385
|
label,
|
|
2136
1386
|
variant
|
|
2137
1387
|
}) => {
|
|
2138
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2139
1389
|
AppBar,
|
|
2140
1390
|
{
|
|
2141
1391
|
color: "inherit",
|
|
2142
1392
|
sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
|
|
2143
1393
|
},
|
|
2144
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ React8.createElement(
|
|
2145
1395
|
Toolbar,
|
|
2146
1396
|
{
|
|
2147
1397
|
id: "footer-toolbar",
|
|
2148
1398
|
sx: { gap: 1.5, minHeight: "50px !important" }
|
|
2149
1399
|
},
|
|
2150
1400
|
leftContent,
|
|
2151
|
-
/* @__PURE__ */
|
|
2152
|
-
label && /* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ React8.createElement(Box8, { flexGrow: 1 }),
|
|
1402
|
+
label && /* @__PURE__ */ React8.createElement(Typography8, { variant: "body2", color: "text.secondary" }, label),
|
|
2153
1403
|
rightContent
|
|
2154
1404
|
)
|
|
2155
|
-
);
|
|
1405
|
+
);
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
// src/Components/Modal/Helpers/Data.tsx
|
|
1409
|
+
import React9 from "react";
|
|
1410
|
+
import { Info, Warning } from "@mui/icons-material";
|
|
1411
|
+
var modalStateConfig = {
|
|
1412
|
+
info: {
|
|
1413
|
+
color: "info",
|
|
1414
|
+
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
1415
|
+
icon: /* @__PURE__ */ React9.createElement(Info, { color: "info", fontSize: "medium" })
|
|
1416
|
+
},
|
|
1417
|
+
delete: {
|
|
1418
|
+
color: "delete",
|
|
1419
|
+
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
1420
|
+
icon: /* @__PURE__ */ React9.createElement(Info, { color: "error", fontSize: "medium" })
|
|
1421
|
+
},
|
|
1422
|
+
warning: {
|
|
1423
|
+
color: "warning",
|
|
1424
|
+
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
1425
|
+
icon: /* @__PURE__ */ React9.createElement(Warning, { color: "warning", fontSize: "medium" })
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
// src/Components/Modal/Helpers/Utils.tsx
|
|
1430
|
+
import * as MuiIcons2 from "@mui/icons-material";
|
|
1431
|
+
import { FilterListOutlined } from "@mui/icons-material";
|
|
1432
|
+
var getIconComponent2 = (iconName) => {
|
|
1433
|
+
return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] : FilterListOutlined;
|
|
1434
|
+
};
|
|
1435
|
+
var getModalColor = (state) => {
|
|
1436
|
+
var _a;
|
|
1437
|
+
const colors = {
|
|
1438
|
+
info: "info.100",
|
|
1439
|
+
delete: "error.100",
|
|
1440
|
+
warning: "warning.100"
|
|
1441
|
+
};
|
|
1442
|
+
return (_a = colors[state]) != null ? _a : "warning.100";
|
|
1443
|
+
};
|
|
1444
|
+
var getButtonColor = (state) => {
|
|
1445
|
+
var _a;
|
|
1446
|
+
const colorMap = {
|
|
1447
|
+
info: "info",
|
|
1448
|
+
delete: "error",
|
|
1449
|
+
warning: "warning"
|
|
1450
|
+
};
|
|
1451
|
+
return (_a = colorMap[state]) != null ? _a : "info";
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
// src/Components/Modal/SCModal.tsx
|
|
1455
|
+
import React10, { useCallback, useEffect as useEffect7, useMemo, useState as useState5 } from "react";
|
|
1456
|
+
import { Modal, Box as Box9, Typography as Typography9, IconButton as IconButton6, Button as Button5, Stack as Stack4 } from "@mui/material";
|
|
1457
|
+
import { Close as Close2 } from "@mui/icons-material";
|
|
1458
|
+
|
|
1459
|
+
// src/generales/capitalize.tsx
|
|
1460
|
+
function capitalize(text) {
|
|
1461
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
// src/Components/Modal/SCModal.tsx
|
|
1465
|
+
var SCModal = ({
|
|
1466
|
+
buttonModal,
|
|
1467
|
+
state = "info",
|
|
1468
|
+
open,
|
|
1469
|
+
title,
|
|
1470
|
+
description,
|
|
1471
|
+
action
|
|
1472
|
+
}) => {
|
|
1473
|
+
var _a, _b, _c, _d, _e;
|
|
1474
|
+
const [openModal, setOpenModal] = useState5(open != null ? open : false);
|
|
1475
|
+
useEffect7(() => {
|
|
1476
|
+
if (open !== void 0) {
|
|
1477
|
+
setOpenModal(open);
|
|
1478
|
+
}
|
|
1479
|
+
}, [open]);
|
|
1480
|
+
const Icon = useMemo(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
1481
|
+
const handleClose = useCallback(() => setOpenModal(false), []);
|
|
1482
|
+
const toggleModal = (newOpen) => () => setOpenModal(newOpen);
|
|
1483
|
+
const prevAction = useMemo(
|
|
1484
|
+
() => action != null ? action : [{ text: "Cancelar", fn: handleClose }, { text: "Consultar", fn: () => {
|
|
1485
|
+
} }],
|
|
1486
|
+
[action, handleClose]
|
|
1487
|
+
);
|
|
1488
|
+
const { icon, defaultDescription } = modalStateConfig[state];
|
|
1489
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
1490
|
+
Button5,
|
|
1491
|
+
{
|
|
1492
|
+
"data-testid": "test-buttonModal",
|
|
1493
|
+
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
1494
|
+
onClick: toggleModal(true),
|
|
1495
|
+
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
1496
|
+
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
1497
|
+
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React10.createElement(Icon, null),
|
|
1498
|
+
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React10.createElement(Icon, null)
|
|
1499
|
+
},
|
|
1500
|
+
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
1501
|
+
), /* @__PURE__ */ React10.createElement(Modal, { open: openModal, onClose: toggleModal(false), sx: { boxShadow: 8 } }, /* @__PURE__ */ React10.createElement(
|
|
1502
|
+
Box9,
|
|
1503
|
+
{
|
|
1504
|
+
sx: {
|
|
1505
|
+
position: "absolute",
|
|
1506
|
+
top: "50%",
|
|
1507
|
+
left: "50%",
|
|
1508
|
+
transform: "translate(-50%, -50%)",
|
|
1509
|
+
width: 400,
|
|
1510
|
+
bgcolor: "background.paper",
|
|
1511
|
+
borderRadius: 1,
|
|
1512
|
+
boxShadow: 24
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
/* @__PURE__ */ React10.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React10.createElement(Stack4, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Box9, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ React10.createElement(Typography9, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React10.createElement(IconButton6, { onClick: toggleModal(false), "data-testid": "test-buttonClose" }, /* @__PURE__ */ React10.createElement(Close2, { color: "action" }))),
|
|
1516
|
+
/* @__PURE__ */ React10.createElement(Stack4, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Typography9, { variant: "body1" }, description || defaultDescription)),
|
|
1517
|
+
action && /* @__PURE__ */ React10.createElement(
|
|
1518
|
+
Stack4,
|
|
1519
|
+
{
|
|
1520
|
+
id: "Action",
|
|
1521
|
+
direction: "row",
|
|
1522
|
+
gap: 1,
|
|
1523
|
+
p: 1,
|
|
1524
|
+
justifyContent: "end",
|
|
1525
|
+
bgcolor: "grey.50",
|
|
1526
|
+
sx: { borderRadius: 1 }
|
|
1527
|
+
},
|
|
1528
|
+
/* @__PURE__ */ React10.createElement(
|
|
1529
|
+
Button5,
|
|
1530
|
+
{
|
|
1531
|
+
color: "inherit",
|
|
1532
|
+
variant: "text",
|
|
1533
|
+
onClick: handleClose,
|
|
1534
|
+
size: "small"
|
|
1535
|
+
},
|
|
1536
|
+
capitalize("cancelar")
|
|
1537
|
+
),
|
|
1538
|
+
/* @__PURE__ */ React10.createElement(
|
|
1539
|
+
Button5,
|
|
1540
|
+
{
|
|
1541
|
+
"data-testid": "test-aceptar",
|
|
1542
|
+
color: getButtonColor(state),
|
|
1543
|
+
variant: "contained",
|
|
1544
|
+
onClick: (_e = action[0]) == null ? void 0 : _e.fn,
|
|
1545
|
+
disabled: false,
|
|
1546
|
+
size: "small"
|
|
1547
|
+
},
|
|
1548
|
+
capitalize(action[0].text)
|
|
1549
|
+
)
|
|
1550
|
+
)
|
|
1551
|
+
)));
|
|
2156
1552
|
};
|
|
2157
1553
|
|
|
2158
1554
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
2159
|
-
import
|
|
2160
|
-
import { Button as
|
|
1555
|
+
import React11, { useEffect as useEffect8, useMemo as useMemo3 } from "react";
|
|
1556
|
+
import { Button as Button6, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack5, TextField as TextField4 } from "@mui/material";
|
|
2161
1557
|
import { SearchOutlined } from "@mui/icons-material";
|
|
2162
1558
|
|
|
2163
1559
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
2164
|
-
import { useCallback as
|
|
1560
|
+
import { useCallback as useCallback2, useState as useState6 } from "react";
|
|
2165
1561
|
function useMultiSelectHandlers() {
|
|
2166
|
-
const [anchorEl, setAnchorEl] =
|
|
2167
|
-
const [open, setOpen] =
|
|
2168
|
-
const [selectedItems, setSelectedItems] =
|
|
2169
|
-
const [filterValue, setFilterValue] =
|
|
2170
|
-
const handleOpen =
|
|
1562
|
+
const [anchorEl, setAnchorEl] = useState6(null);
|
|
1563
|
+
const [open, setOpen] = useState6(false);
|
|
1564
|
+
const [selectedItems, setSelectedItems] = useState6([]);
|
|
1565
|
+
const [filterValue, setFilterValue] = useState6("");
|
|
1566
|
+
const handleOpen = useCallback2((e) => {
|
|
2171
1567
|
setAnchorEl(e.currentTarget);
|
|
2172
1568
|
setOpen(true);
|
|
2173
1569
|
}, []);
|
|
2174
|
-
const handleClose =
|
|
1570
|
+
const handleClose = useCallback2(() => {
|
|
2175
1571
|
setAnchorEl(null);
|
|
2176
1572
|
setOpen(false);
|
|
2177
1573
|
}, []);
|
|
2178
|
-
const handleFilterChange =
|
|
1574
|
+
const handleFilterChange = useCallback2(
|
|
2179
1575
|
(e) => {
|
|
2180
1576
|
setFilterValue(e.target.value);
|
|
2181
1577
|
},
|
|
2182
1578
|
[]
|
|
2183
1579
|
);
|
|
2184
|
-
const handleCheckboxToggle =
|
|
1580
|
+
const handleCheckboxToggle = useCallback2((item) => {
|
|
2185
1581
|
setSelectedItems(
|
|
2186
1582
|
(prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
|
|
2187
1583
|
);
|
|
@@ -2208,15 +1604,15 @@ function getIconMultiSelect(name) {
|
|
|
2208
1604
|
}
|
|
2209
1605
|
|
|
2210
1606
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
2211
|
-
import { useMemo as
|
|
1607
|
+
import { useMemo as useMemo2 } from "react";
|
|
2212
1608
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
2213
|
-
const filteredItems =
|
|
1609
|
+
const filteredItems = useMemo2(
|
|
2214
1610
|
() => items.filter(
|
|
2215
1611
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
2216
1612
|
),
|
|
2217
1613
|
[items, filterValue, getItemLabel]
|
|
2218
1614
|
);
|
|
2219
|
-
const sortedItems =
|
|
1615
|
+
const sortedItems = useMemo2(() => {
|
|
2220
1616
|
return [
|
|
2221
1617
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
2222
1618
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -2250,16 +1646,16 @@ function MultiSelect({
|
|
|
2250
1646
|
handleCheckboxToggle,
|
|
2251
1647
|
setOpen
|
|
2252
1648
|
} = useMultiSelectHandlers();
|
|
2253
|
-
|
|
1649
|
+
useEffect8(() => {
|
|
2254
1650
|
if (open !== void 0) {
|
|
2255
1651
|
setOpen(open);
|
|
2256
1652
|
}
|
|
2257
1653
|
}, [open, setOpen]);
|
|
2258
|
-
|
|
1654
|
+
useEffect8(() => {
|
|
2259
1655
|
setSelectedItems([]);
|
|
2260
1656
|
}, [items, setSelectedItems]);
|
|
2261
1657
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
2262
|
-
const Icon =
|
|
1658
|
+
const Icon = useMemo3(() => {
|
|
2263
1659
|
var _a2;
|
|
2264
1660
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
2265
1661
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -2273,19 +1669,19 @@ function MultiSelect({
|
|
|
2273
1669
|
{ text: "Aplicar", fn: () => {
|
|
2274
1670
|
} }
|
|
2275
1671
|
];
|
|
2276
|
-
return /* @__PURE__ */
|
|
2277
|
-
|
|
1672
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
1673
|
+
Button6,
|
|
2278
1674
|
{
|
|
2279
1675
|
"test-id": "multiselect-button",
|
|
2280
1676
|
color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
|
|
2281
1677
|
onClick: handleOpen,
|
|
2282
1678
|
variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
|
|
2283
1679
|
size: "small",
|
|
2284
|
-
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */
|
|
2285
|
-
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */
|
|
1680
|
+
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ React11.createElement(Icon, null) : null,
|
|
1681
|
+
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ React11.createElement(Icon, null) : null
|
|
2286
1682
|
},
|
|
2287
1683
|
capitalize(textButton != null ? textButton : "MultiSelect")
|
|
2288
|
-
), /* @__PURE__ */
|
|
1684
|
+
), /* @__PURE__ */ React11.createElement(
|
|
2289
1685
|
Popover3,
|
|
2290
1686
|
{
|
|
2291
1687
|
elevation: 8,
|
|
@@ -2294,7 +1690,7 @@ function MultiSelect({
|
|
|
2294
1690
|
open: openMultiselect,
|
|
2295
1691
|
onClose: () => setOpen(false)
|
|
2296
1692
|
},
|
|
2297
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ React11.createElement(Stack5, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ React11.createElement(Stack5, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ React11.createElement(FormControl3, { fullWidth: true, size: "small" }, /* @__PURE__ */ React11.createElement(
|
|
2298
1694
|
TextField4,
|
|
2299
1695
|
{
|
|
2300
1696
|
"data-testid": "multiselect-input",
|
|
@@ -2306,18 +1702,18 @@ function MultiSelect({
|
|
|
2306
1702
|
onChange: handleFilterChange,
|
|
2307
1703
|
slotProps: {
|
|
2308
1704
|
input: {
|
|
2309
|
-
endAdornment: /* @__PURE__ */
|
|
1705
|
+
endAdornment: /* @__PURE__ */ React11.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React11.createElement(SearchOutlined, { fontSize: "small" }))
|
|
2310
1706
|
}
|
|
2311
1707
|
}
|
|
2312
1708
|
}
|
|
2313
|
-
))), /* @__PURE__ */
|
|
1709
|
+
))), /* @__PURE__ */ React11.createElement(Stack5, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ React11.createElement(MenuItem3, { dense, onClick: handleSelectAll }, /* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(Checkbox2, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ React11.createElement(
|
|
2314
1710
|
MenuItem3,
|
|
2315
1711
|
{
|
|
2316
1712
|
key: getItemLabel(item),
|
|
2317
1713
|
dense,
|
|
2318
1714
|
onClick: () => handleCheckboxToggle(item)
|
|
2319
1715
|
},
|
|
2320
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(
|
|
2321
1717
|
Checkbox2,
|
|
2322
1718
|
{
|
|
2323
1719
|
checked: selectedItems.includes(item),
|
|
@@ -2325,10 +1721,10 @@ function MultiSelect({
|
|
|
2325
1721
|
}
|
|
2326
1722
|
)),
|
|
2327
1723
|
getItemLabel(item)
|
|
2328
|
-
)) : /* @__PURE__ */
|
|
1724
|
+
)) : /* @__PURE__ */ React11.createElement(MenuItem3, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ React11.createElement(Stack5, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
|
|
2329
1725
|
var _a2;
|
|
2330
|
-
return /* @__PURE__ */
|
|
2331
|
-
|
|
1726
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1727
|
+
Button6,
|
|
2332
1728
|
{
|
|
2333
1729
|
key: index,
|
|
2334
1730
|
variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
|
|
@@ -2343,8 +1739,8 @@ function MultiSelect({
|
|
|
2343
1739
|
}
|
|
2344
1740
|
|
|
2345
1741
|
// src/Components/PageHeader/PageHeader.tsx
|
|
2346
|
-
import
|
|
2347
|
-
import { Stack as
|
|
1742
|
+
import React12 from "react";
|
|
1743
|
+
import { Stack as Stack6, Typography as Typography10 } from "@mui/material";
|
|
2348
1744
|
var PageHeader = ({
|
|
2349
1745
|
title,
|
|
2350
1746
|
subtitle,
|
|
@@ -2353,8 +1749,8 @@ var PageHeader = ({
|
|
|
2353
1749
|
fixed,
|
|
2354
1750
|
shadow = true
|
|
2355
1751
|
}) => {
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
|
|
1752
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1753
|
+
Stack6,
|
|
2358
1754
|
{
|
|
2359
1755
|
"data-testid": "main-container",
|
|
2360
1756
|
justifyContent: "center",
|
|
@@ -2365,13 +1761,13 @@ var PageHeader = ({
|
|
|
2365
1761
|
zIndex: 10,
|
|
2366
1762
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
2367
1763
|
},
|
|
2368
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ React12.createElement(Stack6, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React12.createElement(Stack6, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ React12.createElement(Stack6, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ React12.createElement(Typography10, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ React12.createElement(Typography10, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.primary" }, subtitle))), actions && /* @__PURE__ */ React12.createElement(Stack6, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
2369
1765
|
);
|
|
2370
1766
|
};
|
|
2371
1767
|
|
|
2372
1768
|
// src/Components/SCCalendarSwipeable.tsx
|
|
2373
|
-
import
|
|
2374
|
-
import { Typography as
|
|
1769
|
+
import React13, { useState as useState7 } from "react";
|
|
1770
|
+
import { Typography as Typography11, IconButton as IconButton7, Box as Box10 } from "@mui/material";
|
|
2375
1771
|
import Grid5 from "@mui/material/Grid2";
|
|
2376
1772
|
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
2377
1773
|
import { LocalizationProvider as LocalizationProvider2 } from "@mui/x-date-pickers/LocalizationProvider";
|
|
@@ -2389,14 +1785,14 @@ var SCCalendarSwipeable = ({
|
|
|
2389
1785
|
state
|
|
2390
1786
|
}) => {
|
|
2391
1787
|
let convertFecha;
|
|
2392
|
-
const [fecha, setFecha] =
|
|
2393
|
-
const [fechaSeleccionada, setFechaSeleccionada] =
|
|
2394
|
-
const [stateVal, setstateVal] =
|
|
2395
|
-
const [openCalendar, setOpenCalendar] =
|
|
1788
|
+
const [fecha, setFecha] = useState7(/* @__PURE__ */ new Date());
|
|
1789
|
+
const [fechaSeleccionada, setFechaSeleccionada] = useState7();
|
|
1790
|
+
const [stateVal, setstateVal] = React13.useState(/* @__PURE__ */ new Date());
|
|
1791
|
+
const [openCalendar, setOpenCalendar] = React13.useState(false);
|
|
2396
1792
|
const hoy = /* @__PURE__ */ new Date();
|
|
2397
1793
|
const inicioSemana = startOfWeek(fecha, { weekStartsOn: 0 });
|
|
2398
1794
|
const diasSemana = Array.from({ length: 7 }, (_, i) => addDays(inicioSemana, i));
|
|
2399
|
-
|
|
1795
|
+
React13.useEffect(() => {
|
|
2400
1796
|
if (fecha != null) {
|
|
2401
1797
|
handleConvertFecha(fecha);
|
|
2402
1798
|
}
|
|
@@ -2415,12 +1811,12 @@ var SCCalendarSwipeable = ({
|
|
|
2415
1811
|
setOpenCalendar(newOpen);
|
|
2416
1812
|
};
|
|
2417
1813
|
const locale = __spreadValues({}, es);
|
|
2418
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(LocalizationProvider2, { dateAdapter: AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React13.createElement(Box10, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ React13.createElement(Grid5, { container: true, gap: 0.5, sx: {
|
|
2419
1815
|
justifyContent: "space-between",
|
|
2420
1816
|
padding: "12px 0px",
|
|
2421
1817
|
background: "transparent"
|
|
2422
|
-
} }, diasSemana.map((dia) => /* @__PURE__ */
|
|
2423
|
-
|
|
1818
|
+
} }, diasSemana.map((dia) => /* @__PURE__ */ React13.createElement(Grid5, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: "#10184099" } }, format(dia, "EEEE", { locale: es }).charAt(0).toUpperCase())), /* @__PURE__ */ React13.createElement(
|
|
1819
|
+
Box10,
|
|
2424
1820
|
{
|
|
2425
1821
|
onClick: () => setFecha(dia),
|
|
2426
1822
|
sx: {
|
|
@@ -2435,8 +1831,8 @@ var SCCalendarSwipeable = ({
|
|
|
2435
1831
|
//height: '36px',
|
|
2436
1832
|
}
|
|
2437
1833
|
},
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
)))), /* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: isSameDay(dia, fecha) ? "white" : "#101840DE" } }, format(dia, "d"))
|
|
1835
|
+
)))), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowDownIcon, null))))) : /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ React13.createElement(
|
|
2440
1836
|
StaticDatePicker,
|
|
2441
1837
|
{
|
|
2442
1838
|
orientation: "landscape",
|
|
@@ -2446,17 +1842,17 @@ var SCCalendarSwipeable = ({
|
|
|
2446
1842
|
sx: { fontSize: "12px !important", height: "300px !important", background: background ? background : "white", "& .MuiDayCalendar-header": { justifyContent: "space-between" }, "& .MuiDayCalendar-weekContainer": { justifyContent: "space-between" }, "& .MuiPickersCalendarHeader-root": { paddingLeft: "0px", paddingRight: "0px", color: "#10184099" }, "& .MuiPickersDay-root": { fontSize: "12px !important" }, "& .MuiDayCalendar-weekDayLabel": { fontSize: "12px !important" } },
|
|
2447
1843
|
onChange: (newValue) => setFecha(newValue)
|
|
2448
1844
|
}
|
|
2449
|
-
), /* @__PURE__ */
|
|
1845
|
+
), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowUpIcon, null))))));
|
|
2450
1846
|
};
|
|
2451
1847
|
|
|
2452
1848
|
// src/Components/SCDataGrid.tsx
|
|
2453
|
-
import
|
|
1849
|
+
import React14, { useEffect as useEffect10, useState as useState8 } from "react";
|
|
2454
1850
|
import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
|
|
2455
1851
|
import { LicenseInfo as LicenseInfo2 } from "@mui/x-license-pro";
|
|
2456
1852
|
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
2457
1853
|
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
|
2458
1854
|
import { useTheme } from "@mui/material/styles";
|
|
2459
|
-
|
|
1855
|
+
var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }) => {
|
|
2460
1856
|
LicenseInfo2.setLicenseKey(
|
|
2461
1857
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
2462
1858
|
);
|
|
@@ -2467,80 +1863,45 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2467
1863
|
return Math.floor(Math.random() * 1e6);
|
|
2468
1864
|
}
|
|
2469
1865
|
const getTreeDataPaths = (row) => {
|
|
2470
|
-
var _a, _b, _c;
|
|
2471
|
-
const group1Value = groupColumns && ((_a = groupColumns(row)) == null ? void 0 : _a.valueGroup1);
|
|
2472
|
-
const group2Value = groupColumns && ((_b = groupColumns(row)) == null ? void 0 : _b.valueGroup2);
|
|
2473
|
-
const fieldValue = groupColumns && ((_c = groupColumns(row)) == null ? void 0 : _c.fieldFirstColumn);
|
|
2474
1866
|
return [
|
|
2475
|
-
|
|
2476
|
-
...
|
|
2477
|
-
`${
|
|
1867
|
+
row[groupColumns[0].split("[")[1].split("]")[0].trim()],
|
|
1868
|
+
...groupColumns.length > 2 ? [row[groupColumns[1].split("[")[1].split("]")[0].trim()]] : [],
|
|
1869
|
+
`${row[groupColumns[groupColumns.length - 1].split("[")[1].split("]")[0].trim()].toString()}/${generateRandomId()}`
|
|
2478
1870
|
];
|
|
2479
1871
|
};
|
|
2480
1872
|
const groupingColDefs = {
|
|
2481
1873
|
field: "grouping",
|
|
2482
|
-
headerName: groupColumns ? groupColumns(
|
|
1874
|
+
headerName: groupColumns != void 0 ? groupColumns[groupColumns.length - 1].split("[").length == 2 ? groupColumns[groupColumns.length - 1].split("[")[0].trim() : "Agrupador" : "",
|
|
2483
1875
|
renderCell: (params) => {
|
|
2484
|
-
var _a
|
|
1876
|
+
var _a;
|
|
2485
1877
|
let label = params.value.toString().includes("/") ? params.value.split("/")[0].toString() : params.value.toString();
|
|
2486
|
-
|
|
2487
|
-
if (groupColumns
|
|
2488
|
-
const sampleItem = groupColumns(data[0]);
|
|
2489
|
-
if (sampleItem.valueGroup1) maxDepth++;
|
|
2490
|
-
if (sampleItem.valueGroup2) maxDepth++;
|
|
2491
|
-
maxDepth = Math.max(0, maxDepth - 1);
|
|
2492
|
-
}
|
|
2493
|
-
if (groupColumns) {
|
|
1878
|
+
const maxDepth = groupColumns ? groupColumns.length - 2 : 0;
|
|
1879
|
+
if (groupColumns != void 0) {
|
|
2494
1880
|
if (params.rowNode.depth === 0) {
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}
|
|
2502
|
-
);
|
|
2503
|
-
if (originalItem) {
|
|
2504
|
-
const itemValue = groupColumns(originalItem);
|
|
2505
|
-
customLabel = itemValue.textGroup1 || label;
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
const subgroup1 = arrayRows.filter((r) => {
|
|
2509
|
-
var _a2;
|
|
2510
|
-
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === label;
|
|
2511
|
-
}).map((r) => {
|
|
2512
|
-
var _a2;
|
|
2513
|
-
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup2);
|
|
2514
|
-
});
|
|
1881
|
+
const textBegin = groupColumns[0] ? groupColumns[0].split("[")[0].trim() : "";
|
|
1882
|
+
const textEnd = groupColumns[0] ? groupColumns[0].split("]")[1].trim() : "";
|
|
1883
|
+
const labelGrouping1 = `${textBegin} ${label} ${textEnd}`;
|
|
1884
|
+
const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
|
|
1885
|
+
const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
|
|
1886
|
+
const subgroup1 = arrayRows.filter((r) => r[fieldGrouping1].toString() === label).map((r) => r[fieldGrouping2]);
|
|
2515
1887
|
const groupedDataLength1 = subgroup1.filter((valor, indiceActual, arreglo) => arreglo.indexOf(valor) === indiceActual);
|
|
2516
|
-
label = `${
|
|
2517
|
-
} else if (
|
|
2518
|
-
const labelGrouping1 = (
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
return String((_a2 = groupColumns(item)) == null ? void 0 : _a2.valueGroup2) === label;
|
|
2525
|
-
}
|
|
2526
|
-
);
|
|
2527
|
-
if (originalItem) {
|
|
2528
|
-
const itemValue = groupColumns(originalItem);
|
|
2529
|
-
customLabel = itemValue.textGroup2 || label;
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
1888
|
+
label = `${labelGrouping1} (${groupedDataLength1.length})`;
|
|
1889
|
+
} else if (groupColumns.length > 2 && params.rowNode.depth === 1) {
|
|
1890
|
+
const labelGrouping1 = (_a = params.api.getRowNode(params.rowNode.parent)) == null ? void 0 : _a.groupingKey;
|
|
1891
|
+
const textBegin = groupColumns[1] ? groupColumns[1].split("[")[0] : "";
|
|
1892
|
+
const textEnd = groupColumns[1] ? groupColumns[1].split("]")[1].trim() : "";
|
|
1893
|
+
const labelGrouping2 = `${textBegin} ${label} ${textEnd}`;
|
|
1894
|
+
const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
|
|
1895
|
+
const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
|
|
2532
1896
|
const groupedDataLength2 = arrayRows.filter(
|
|
2533
|
-
(r) =>
|
|
2534
|
-
var _a2, _b2;
|
|
2535
|
-
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === labelGrouping1 && groupColumns && String((_b2 = groupColumns(r)) == null ? void 0 : _b2.valueGroup2) === label;
|
|
2536
|
-
}
|
|
1897
|
+
(r) => r[fieldGrouping1] === labelGrouping1 && r[fieldGrouping2] === label
|
|
2537
1898
|
).length;
|
|
2538
|
-
label = `${
|
|
1899
|
+
label = `${labelGrouping2} (${groupedDataLength2})`;
|
|
2539
1900
|
} else {
|
|
2540
1901
|
label = label;
|
|
2541
1902
|
}
|
|
2542
1903
|
}
|
|
2543
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ React14.createElement(
|
|
2544
1905
|
"div",
|
|
2545
1906
|
{
|
|
2546
1907
|
style: {
|
|
@@ -2557,7 +1918,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2557
1918
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
2558
1919
|
}
|
|
2559
1920
|
},
|
|
2560
|
-
params.rowNode.type === "group" && /* @__PURE__ */
|
|
1921
|
+
params.rowNode.type === "group" && /* @__PURE__ */ React14.createElement(
|
|
2561
1922
|
"span",
|
|
2562
1923
|
{
|
|
2563
1924
|
style: {
|
|
@@ -2570,32 +1931,25 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2570
1931
|
params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
2571
1932
|
}
|
|
2572
1933
|
},
|
|
2573
|
-
params.rowNode.childrenExpanded ? /* @__PURE__ */
|
|
1934
|
+
params.rowNode.childrenExpanded ? /* @__PURE__ */ React14.createElement(KeyboardArrowUpIcon, { fontSize: "small", color: "action" }) : /* @__PURE__ */ React14.createElement(KeyboardArrowDownIcon, { fontSize: "small", color: "action" })
|
|
2574
1935
|
),
|
|
2575
1936
|
label
|
|
2576
1937
|
);
|
|
2577
1938
|
},
|
|
2578
1939
|
colSpan: (params) => {
|
|
2579
|
-
var _a, _b;
|
|
2580
1940
|
const value = String(params);
|
|
2581
|
-
const fieldGrouping1 = groupColumns
|
|
2582
|
-
const fieldGrouping2 = groupColumns
|
|
1941
|
+
const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
|
|
1942
|
+
const fieldGrouping2 = groupColumns.length > 2 ? groupColumns[1].split("[")[1].split("]")[0].trim() : void 0;
|
|
2583
1943
|
let agrupado1 = false;
|
|
2584
1944
|
let agrupado2 = false;
|
|
2585
1945
|
if (fieldGrouping1 != void 0) {
|
|
2586
1946
|
agrupado1 = arrayRows.some(
|
|
2587
|
-
(row) =>
|
|
2588
|
-
var _a2;
|
|
2589
|
-
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup1) === value;
|
|
2590
|
-
}
|
|
1947
|
+
(row) => String(row[fieldGrouping1]) === value
|
|
2591
1948
|
);
|
|
2592
1949
|
}
|
|
2593
1950
|
if (fieldGrouping2 != void 0) {
|
|
2594
1951
|
agrupado2 = arrayRows.some(
|
|
2595
|
-
(row) =>
|
|
2596
|
-
var _a2;
|
|
2597
|
-
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup2) === value;
|
|
2598
|
-
}
|
|
1952
|
+
(row) => String(row[fieldGrouping2]) === value
|
|
2599
1953
|
);
|
|
2600
1954
|
}
|
|
2601
1955
|
if (agrupado1 || agrupado2) {
|
|
@@ -2612,11 +1966,11 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2612
1966
|
let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
|
|
2613
1967
|
let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
|
|
2614
1968
|
let validationGroupingColDef = groupingColDefs || {};
|
|
2615
|
-
const [groupDataLenght, setGroupDataLengh] =
|
|
2616
|
-
const [pageSize, setPageSize] =
|
|
2617
|
-
const [arrayRows, setArrayRows] =
|
|
2618
|
-
const [selectionModel, setSelectionModel] =
|
|
2619
|
-
|
|
1969
|
+
const [groupDataLenght, setGroupDataLengh] = useState8(0);
|
|
1970
|
+
const [pageSize, setPageSize] = useState8(rows);
|
|
1971
|
+
const [arrayRows, setArrayRows] = useState8([]);
|
|
1972
|
+
const [selectionModel, setSelectionModel] = useState8([]);
|
|
1973
|
+
useEffect10(() => {
|
|
2620
1974
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
2621
1975
|
dataConvertRows(data, void 0);
|
|
2622
1976
|
}
|
|
@@ -2672,7 +2026,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2672
2026
|
setSelectionModel([...newSelection]);
|
|
2673
2027
|
}
|
|
2674
2028
|
};
|
|
2675
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, data && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ React14.createElement(
|
|
2676
2030
|
DataGridPro,
|
|
2677
2031
|
{
|
|
2678
2032
|
apiRef,
|
|
@@ -2706,6 +2060,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2706
2060
|
},
|
|
2707
2061
|
sx: {
|
|
2708
2062
|
maxHeight: maxHeight ? `${maxHeight}px` : "none",
|
|
2063
|
+
//overflow: 'auto',
|
|
2709
2064
|
"& .MuiDataGrid-filler": {
|
|
2710
2065
|
display: "none !important"
|
|
2711
2066
|
},
|
|
@@ -2735,54 +2090,42 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2735
2090
|
}
|
|
2736
2091
|
}
|
|
2737
2092
|
))));
|
|
2738
|
-
}
|
|
2739
|
-
var SCDataGrid =
|
|
2740
|
-
const isEqual = prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
|
|
2093
|
+
};
|
|
2094
|
+
var SCDataGrid = React14.memo(SCDataGridInitial, (prevProps, nextProps) => {
|
|
2095
|
+
const isEqual = prevProps.data === nextProps.data && prevProps.columns === nextProps.columns && prevProps.groupColumns === nextProps.groupColumns && prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
|
|
2741
2096
|
return isEqual;
|
|
2742
2097
|
});
|
|
2743
2098
|
|
|
2744
2099
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2745
|
-
import
|
|
2746
|
-
import { Button as
|
|
2100
|
+
import React15 from "react";
|
|
2101
|
+
import { Button as Button8, Stack as Stack7, Typography as Typography12 } from "@mui/material";
|
|
2747
2102
|
|
|
2748
|
-
// src/assets/ImgEmptyState/create.
|
|
2749
|
-
|
|
2750
|
-
var Create = () => {
|
|
2751
|
-
return /* @__PURE__ */ React17.createElement("svg", { width: "45", height: "41", viewBox: "0 0 45 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React17.createElement("g", { "clip-path": "url(#clip0_1283_39624)" }, /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.4956 13.1869C44.4386 13.8714 43.8367 14.3801 43.1514 14.3231L39.9978 14.0608C39.3124 14.0038 38.8032 13.4027 38.8602 12.7182C38.9173 12.0336 39.5191 11.525 40.2044 11.582L43.3581 11.8443C44.0434 11.9013 44.5527 12.5024 44.4956 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M41.0393 1.01388C41.4429 1.57002 41.3187 2.34766 40.7619 2.75078L38.099 4.6787C37.5423 5.08182 36.7637 4.95777 36.3601 4.40163C35.9565 3.84548 36.0807 3.06785 36.6375 2.66473L39.3004 0.736804C39.8572 0.333685 40.6357 0.457736 41.0393 1.01388Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M36.6656 21.2361C36.1755 21.7179 36.1692 22.5054 36.6515 22.9949L38.9584 25.3363C39.4408 25.8258 40.2291 25.8321 40.7193 25.3503C41.2094 24.8685 41.2157 24.0811 40.7333 23.5915L38.4264 21.2502C37.9441 20.7606 37.1557 20.7543 36.6656 21.2361Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.504365 13.1869C0.561439 13.8714 1.16326 14.3801 1.84856 14.323L5.00224 14.0607C5.68755 14.0037 6.19683 13.4026 6.13976 12.7181C6.08268 12.0336 5.48087 11.5249 4.79556 11.5819L1.64188 11.8442C0.956574 11.9012 0.447291 12.5023 0.504365 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.95913 1.01431C3.55554 1.57046 3.67974 2.34809 4.23653 2.75121L6.8994 4.67914C7.45619 5.08225 8.23473 4.9582 8.63832 4.40206C9.04191 3.84592 8.91771 3.06828 8.36092 2.66516L5.69805 0.737237C5.14126 0.334118 4.36272 0.458169 3.95913 1.01431Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.33389 21.236C8.82403 21.7178 8.83033 22.5053 8.34796 22.9949L6.04107 25.3362C5.5587 25.8257 4.77034 25.832 4.28021 25.3502C3.79008 24.8684 3.78378 24.081 4.26614 23.5914L6.57304 21.2501C7.0554 20.7605 7.84376 20.7542 8.33389 21.236Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { d: "M19.1448 37.3573H25.5804L25.1621 38.889C25.0636 39.2498 24.7356 39.5 24.3613 39.5H20.3638C19.9895 39.5 19.6615 39.2498 19.563 38.889L19.1448 37.3573Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { d: "M17.6534 35.3665C17.5381 34.8487 17.9326 34.3575 18.4637 34.3575H26.3983C26.9294 34.3575 27.3239 34.8487 27.2087 35.3665L26.9829 36.3814C26.8563 36.9504 26.351 37.3553 25.7674 37.3553H19.0946C18.511 37.3553 18.0057 36.9504 17.8791 36.3814L17.6534 35.3665Z", fill: "#CED1D4" }), /* @__PURE__ */ React17.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.85423 13.9906C8.85423 6.60807 14.935 0.652473 22.3998 0.652473C29.8646 0.652473 35.9455 6.60807 35.9455 13.9906C35.9455 17.6153 34.4759 20.9015 32.0983 23.3022C31.9627 23.4392 31.8257 23.5745 31.6935 23.7052L31.6917 23.707C30.7961 24.5922 30.1385 25.2699 29.8494 26.1116C29.7242 26.4761 29.6012 27.1915 29.4988 28.0885C29.4002 28.9527 29.3306 29.8872 29.2854 30.6281C29.2099 31.864 28.1896 32.8547 26.9266 32.8547H17.8731C16.6101 32.8547 15.5898 31.864 15.5143 30.6281C15.469 29.8872 15.3995 28.9527 15.3009 28.0885C15.1985 27.1915 15.0755 26.4761 14.9503 26.1116C14.6612 25.2699 14.0036 24.5922 13.108 23.707L13.106 23.7051C12.9739 23.5744 12.837 23.4391 12.7014 23.3022C10.3238 20.9015 8.85423 17.6153 8.85423 13.9906ZM22.3998 2.85676C16.1214 2.85676 11.0611 7.85765 11.0611 13.9906C11.0611 17.0068 12.2813 19.7437 14.2703 21.752C14.3969 21.8798 14.526 22.0075 14.6602 22.1401C14.6831 22.1627 14.7062 22.1855 14.7294 22.2085C15.5402 23.0091 16.5655 24.0215 17.0377 25.3961C17.2505 26.0156 17.3925 26.9534 17.4936 27.8388C17.5983 28.757 17.6707 29.7342 17.7171 30.4939C17.723 30.59 17.8001 30.6504 17.8731 30.6504H26.9266C26.9996 30.6504 27.0767 30.59 27.0826 30.4939C27.129 29.7342 27.2013 28.757 27.3061 27.8388C27.4072 26.9534 27.5492 26.0156 27.762 25.3961C28.2342 24.0215 29.2594 23.0091 30.0702 22.2085C30.0935 22.1855 30.1166 22.1627 30.1395 22.1401C30.2737 22.0075 30.4028 21.8798 30.5294 21.752C32.5184 19.7437 33.7386 17.0068 33.7386 13.9906C33.7386 7.85765 28.6783 2.85676 22.3998 2.85676Z", fill: "#B9BDC1" })), /* @__PURE__ */ React17.createElement("defs", null, /* @__PURE__ */ React17.createElement("clipPath", { id: "clip0_1283_39624" }, /* @__PURE__ */ React17.createElement("rect", { width: "44", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2752
|
-
};
|
|
2103
|
+
// src/assets/ImgEmptyState/create.svg
|
|
2104
|
+
var create_default = "./create-KZGO2OZA.svg";
|
|
2753
2105
|
|
|
2754
|
-
// src/assets/ImgEmptyState/
|
|
2755
|
-
|
|
2756
|
-
var Empty = () => {
|
|
2757
|
-
return /* @__PURE__ */ React18.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React18.createElement("g", { "clip-path": "url(#clip0_1283_39626)" }, /* @__PURE__ */ React18.createElement("path", { d: "M36.1351 20.9955C25.1396 25.3151 16.1875 30.5689 11.8186 30.9221L14.7134 35.4696L36.1351 20.9955Z", fill: "#CED1D4" }), /* @__PURE__ */ React18.createElement("path", { d: "M37.4531 24.9937C39.7468 28.137 42.9751 35.0522 37.4531 35.3441C34.9101 35.4058 31.3306 32.981 37.4531 24.9937Z", fill: "#CED1D4" }), /* @__PURE__ */ React18.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M25.6074 1.30001C25.1055 0.501016 24.051 0.26003 23.2522 0.761943L19.6474 3.02673C17.5114 2.68138 14.5326 2.642 12.1799 3.71891C10.8937 4.30766 9.75284 5.25155 9.09396 6.68863C8.65845 7.63849 8.46029 8.74589 8.52317 10.0159L1.2996 14.5543C0.500747 15.0562 0.260156 16.1108 0.762045 16.9098L12.7907 36.0589C13.2926 36.8579 14.3471 37.0989 15.1459 36.597L37.0985 22.8046C37.8973 22.3027 38.1379 21.2481 37.636 20.4491L25.6074 1.30001ZM2.79326 16.1347L8.88857 12.3051C8.91842 12.3953 8.95405 12.4868 8.99634 12.5777C9.70948 14.1097 11.2554 15.9861 13.7088 16.7327C16.2084 17.4934 19.3887 17.0049 23.1824 14.2981L23.3709 14.1636L22.1324 12.4273L21.9439 12.5618C18.5121 15.0104 16.0132 15.2048 14.3292 14.6924C12.5992 14.1659 11.458 12.8132 10.9295 11.6778C10.9197 11.6569 10.9072 11.6225 10.8968 11.5772C10.8595 11.4156 10.8267 11.2584 10.7981 11.1054L24.0275 2.79363L35.6048 21.2243L14.3706 34.5653L2.79326 16.1347ZM13.0675 5.65821C14.0932 5.18871 15.3429 4.98089 16.5902 4.94754L10.716 8.63821C10.7826 8.23367 10.8925 7.88269 11.0323 7.57786C11.4327 6.70447 12.1364 6.08441 13.0675 5.65821Z", fill: "#B9BDC1" }), /* @__PURE__ */ React18.createElement("path", { d: "M24.3482 14.3207C24.0493 15.6305 22.7454 16.4497 21.4358 16.1505C20.1262 15.8513 19.3069 14.547 19.6058 13.2372C19.9047 11.9274 21.2086 11.1082 22.5182 11.4074C23.8278 11.7066 24.6471 13.011 24.3482 14.3207Z", fill: "#CED1D4" })), /* @__PURE__ */ React18.createElement("defs", null, /* @__PURE__ */ React18.createElement("clipPath", { id: "clip0_1283_39626" }, /* @__PURE__ */ React18.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2758
|
-
};
|
|
2106
|
+
// src/assets/ImgEmptyState/error.svg
|
|
2107
|
+
var error_default = "./error-RUCZUXDN.svg";
|
|
2759
2108
|
|
|
2760
|
-
// src/assets/ImgEmptyState/
|
|
2761
|
-
|
|
2762
|
-
var Error2 = () => {
|
|
2763
|
-
return /* @__PURE__ */ React19.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React19.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.8035 3.2925C17.0304 3.2925 16.358 3.82772 16.1913 4.58349L14.0944 13.8188C13.8625 14.8535 14.6474 15.8412 15.7066 15.8412H25.4175C26.4764 15.8412 27.2677 14.8538 27.0297 13.8185L24.9328 4.58323C24.7608 3.82996 24.0975 3.29514 23.3264 3.2925H17.8035ZM15.9436 13.9945L17.9555 5.13336L23.1745 5.12121L25.1863 13.9945H15.9436Z", fill: "#B9BDC1" }), /* @__PURE__ */ React19.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5449 28.1551C10.7717 28.1551 10.0993 28.6904 9.93264 29.4462L8.54048 35.6049C8.46109 35.7863 8.54048 35.6049 8.46109 35.7863H5.42145C4.91308 35.7863 4.50096 36.1984 4.50096 36.7068C4.50096 37.2152 4.91308 37.6273 5.42145 37.6273H35.5795C36.0879 37.6273 36.5 37.2152 36.5 36.7068C36.5 36.1984 36.0879 35.7863 35.5795 35.7863H32.595C32.5443 35.6284 32.5801 35.745 32.5443 35.5928L31.1121 29.4342C30.9394 28.6844 30.2672 28.1551 29.5 28.1551H11.5449ZM10.3781 35.7863L11.6854 29.9961H29.3426L30.6891 35.7863H10.3781Z", fill: "#B9BDC1" }), /* @__PURE__ */ React19.createElement("path", { d: "M13.7368 17.4381H28.0252C28.2486 17.4381 28.4434 17.5928 28.495 17.8162L30.271 25.9114C30.334 26.2094 30.1106 26.4901 29.8012 26.4901H11.6743C11.3649 26.4901 11.1358 26.1979 11.2102 25.8943L13.2727 17.799C13.3243 17.587 13.519 17.4381 13.7368 17.4381Z", fill: "#CED1D4" }));
|
|
2764
|
-
};
|
|
2109
|
+
// src/assets/ImgEmptyState/empty.svg
|
|
2110
|
+
var empty_default = "./empty-3NEKE7WO.svg";
|
|
2765
2111
|
|
|
2766
|
-
// src/assets/ImgEmptyState/search.
|
|
2767
|
-
|
|
2768
|
-
var Search2 = () => {
|
|
2769
|
-
return /* @__PURE__ */ React20.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React20.createElement("g", { "clip-path": "url(#clip0_1283_39628)" }, /* @__PURE__ */ React20.createElement("path", { d: "M29.421 4.71198C28.943 2.92749 30.0021 1.09315 31.7865 0.61487C33.5709 0.136592 35.405 1.19549 35.883 2.97998L40.3853 19.7878C40.8633 21.5723 39.8042 23.4066 38.0198 23.8849C36.2354 24.3632 34.4013 23.3043 33.9233 21.5198L29.421 4.71198Z", fill: "#CED1D4" }), /* @__PURE__ */ React20.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.607749 18.613C0.158895 16.9369 1.15336 15.2141 2.82895 14.7649C4.50454 14.3157 6.22674 15.3102 6.67559 16.9862L8.06043 22.1573C8.50928 23.8333 7.51482 25.5561 5.83923 26.0054C4.16364 26.4546 2.44144 25.46 1.99259 23.784L0.607749 18.613ZM3.41576 16.9561C2.95002 17.0809 2.67359 17.5598 2.79836 18.0257L4.18319 23.1967C4.30796 23.6626 4.78667 23.939 5.25242 23.8142C5.71816 23.6893 5.99459 23.2104 5.86982 22.7445L4.48499 17.5735C4.36022 17.1076 3.88151 16.8312 3.41576 16.9561Z", fill: "#B9BDC1" }), /* @__PURE__ */ React20.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.0672 23.7222C17.6115 24.3518 16.9814 24.8602 16.2239 25.1659L23.5692 38.9314C23.929 39.6056 23.6742 40.4438 23.0003 40.8037C22.3263 41.1635 21.4883 40.9087 21.1286 40.2346L14.2002 27.2506L6.15159 39.7788C5.73857 40.4217 4.88273 40.6079 4.24003 40.1948C3.59732 39.7816 3.41113 38.9255 3.82416 38.2826L12.4422 24.8681C11.8201 24.4937 11.2926 23.9601 10.9267 23.3057L6.9728 23.4848C6.43282 23.5092 5.94855 23.1546 5.80865 22.6324L4.48764 17.7008C4.34775 17.1786 4.5899 16.6293 5.06976 16.3804L11.2775 13.1606L11.2169 12.934C11.0764 12.4095 11.3213 11.8581 11.8046 11.6107L26.5904 4.04383C26.8999 3.88542 27.2644 3.87542 27.5822 4.01662C27.8999 4.15781 28.1369 4.43508 28.2269 4.77102L32.7303 21.5831C32.8203 21.9191 32.7537 22.2777 32.5491 22.5589C32.3445 22.8401 32.0238 23.0137 31.6766 23.0314L18.0672 23.7222ZM17.9643 23.1894C18.1495 22.8739 18.2903 22.5322 18.3806 22.1748C18.4139 22.0434 18.4403 21.9098 18.4596 21.7746C18.4048 22.1588 18.2927 22.5298 18.1297 22.876C18.0793 22.983 18.0241 23.0876 17.9643 23.1894ZM18.8739 21.375L30.1375 20.8032L26.3713 6.7432L13.6819 13.2372L14.6854 16.9834C16.5391 17.0063 18.2272 18.2517 18.7306 20.1311C18.8421 20.5473 18.8877 20.9656 18.8739 21.375ZM12.4612 17.5793C11.2373 18.3061 10.4581 19.6082 10.3898 21.0243L7.79324 21.142L6.95134 17.999L11.8877 15.4386L12.4612 17.5793ZM15.1332 23.1064C16.1692 22.8287 16.784 21.7635 16.5064 20.7272C16.2288 19.6909 15.164 19.0759 14.128 19.3536C13.092 19.6313 12.4772 20.6965 12.7547 21.7328C12.9527 22.4718 13.5511 22.9972 14.2553 23.1365C14.2923 23.1351 14.3294 23.1351 14.3667 23.1366C14.4569 23.1402 14.5456 23.1526 14.6318 23.1732C14.797 23.173 14.9652 23.1515 15.1332 23.1064Z", fill: "#B9BDC1" })), /* @__PURE__ */ React20.createElement("defs", null, /* @__PURE__ */ React20.createElement("clipPath", { id: "clip0_1283_39628" }, /* @__PURE__ */ React20.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2770
|
-
};
|
|
2112
|
+
// src/assets/ImgEmptyState/search.svg
|
|
2113
|
+
var search_default = "./search-OKSCVF2W.svg";
|
|
2771
2114
|
|
|
2772
2115
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2773
2116
|
var EmptyStateImageUrls = {
|
|
2774
|
-
create:
|
|
2775
|
-
error:
|
|
2776
|
-
noResult:
|
|
2777
|
-
search:
|
|
2117
|
+
create: create_default,
|
|
2118
|
+
error: error_default,
|
|
2119
|
+
noResult: empty_default,
|
|
2120
|
+
search: search_default
|
|
2778
2121
|
};
|
|
2779
2122
|
var DefaultIcon = ({
|
|
2780
2123
|
state = "create",
|
|
2781
2124
|
size = "large"
|
|
2782
2125
|
}) => {
|
|
2783
|
-
const
|
|
2126
|
+
const imageUrl = EmptyStateImageUrls[state];
|
|
2784
2127
|
const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
|
|
2785
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ React15.createElement("img", { src: imageUrl, alt: state, style: iconSize });
|
|
2786
2129
|
};
|
|
2787
2130
|
var EmptyState = ({
|
|
2788
2131
|
state = "create",
|
|
@@ -2791,12 +2134,12 @@ var EmptyState = ({
|
|
|
2791
2134
|
subtitle,
|
|
2792
2135
|
actions,
|
|
2793
2136
|
containerHeight = "100vh",
|
|
2794
|
-
icon = /* @__PURE__ */
|
|
2137
|
+
icon = /* @__PURE__ */ React15.createElement(DefaultIcon, { state, size })
|
|
2795
2138
|
}) => {
|
|
2796
2139
|
const titleVariant = size === "small" ? "subtitle2" : "h6";
|
|
2797
2140
|
const subtitleVariant = size === "small" ? "caption" : "body1";
|
|
2798
|
-
return /* @__PURE__ */
|
|
2799
|
-
|
|
2141
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2142
|
+
Stack7,
|
|
2800
2143
|
{
|
|
2801
2144
|
alignItems: "center",
|
|
2802
2145
|
justifyContent: "center",
|
|
@@ -2804,17 +2147,17 @@ var EmptyState = ({
|
|
|
2804
2147
|
height: containerHeight,
|
|
2805
2148
|
"data-testid": "empty-state-container"
|
|
2806
2149
|
},
|
|
2807
|
-
icon && /* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
|
|
2150
|
+
icon && /* @__PURE__ */ React15.createElement(Stack7, null, icon),
|
|
2151
|
+
/* @__PURE__ */ React15.createElement(Stack7, { gap: 0.5 }, /* @__PURE__ */ React15.createElement(Typography12, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ React15.createElement(
|
|
2152
|
+
Typography12,
|
|
2810
2153
|
{
|
|
2811
2154
|
variant: subtitleVariant,
|
|
2812
2155
|
textAlign: "center",
|
|
2813
2156
|
color: "text.secondary"
|
|
2814
2157
|
},
|
|
2815
2158
|
subtitle
|
|
2816
|
-
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */
|
|
2817
|
-
|
|
2159
|
+
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ React15.createElement(
|
|
2160
|
+
Stack7,
|
|
2818
2161
|
{
|
|
2819
2162
|
direction: "row",
|
|
2820
2163
|
spacing: 2,
|
|
@@ -2823,15 +2166,15 @@ var EmptyState = ({
|
|
|
2823
2166
|
},
|
|
2824
2167
|
actions.map((action, index) => {
|
|
2825
2168
|
var _a, _b, _c, _d;
|
|
2826
|
-
return /* @__PURE__ */
|
|
2827
|
-
|
|
2169
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2170
|
+
Button8,
|
|
2828
2171
|
{
|
|
2829
2172
|
key: index,
|
|
2830
2173
|
color: (_a = action.color) != null ? _a : "primary",
|
|
2831
2174
|
variant: (_b = action.variant) != null ? _b : "text",
|
|
2832
2175
|
size: (_c = action.size) != null ? _c : "small",
|
|
2833
|
-
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */
|
|
2834
|
-
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */
|
|
2176
|
+
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2177
|
+
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2835
2178
|
onClick: action.onClick
|
|
2836
2179
|
},
|
|
2837
2180
|
capitalize((_d = action.text) != null ? _d : "action")
|
|
@@ -2842,8 +2185,8 @@ var EmptyState = ({
|
|
|
2842
2185
|
};
|
|
2843
2186
|
|
|
2844
2187
|
// src/Components/SCDialog.tsx
|
|
2845
|
-
import
|
|
2846
|
-
import { Button as
|
|
2188
|
+
import React16, { useEffect as useEffect11, useState as useState9 } from "react";
|
|
2189
|
+
import { Button as Button9, Typography as Typography13, Modal as Modal2, Dialog, DialogActions, DialogContent, DialogTitle, IconButton as IconButton8, Tooltip as Tooltip3, Box as Box11, SvgIcon as SvgIcon5 } from "@mui/material";
|
|
2847
2190
|
import Grid6 from "@mui/material/Grid2";
|
|
2848
2191
|
import CloseIcon2 from "@mui/icons-material/Close";
|
|
2849
2192
|
import * as Muicon5 from "@mui/icons-material";
|
|
@@ -2852,8 +2195,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2852
2195
|
let iconTitleValidation = "";
|
|
2853
2196
|
let IconTitle;
|
|
2854
2197
|
let ButtonIcon;
|
|
2855
|
-
const [open, setOpen] =
|
|
2856
|
-
|
|
2198
|
+
const [open, setOpen] = useState9(show);
|
|
2199
|
+
useEffect11(() => {
|
|
2857
2200
|
if (show) {
|
|
2858
2201
|
handleOpen();
|
|
2859
2202
|
} else {
|
|
@@ -2878,7 +2221,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2878
2221
|
});
|
|
2879
2222
|
if (iconTitle) {
|
|
2880
2223
|
if (Muicon5[iconTitle] == void 0) {
|
|
2881
|
-
if (iconTitle &&
|
|
2224
|
+
if (iconTitle && React16.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
2882
2225
|
iconTitleValidation = "image";
|
|
2883
2226
|
IconTitle = iconTitle;
|
|
2884
2227
|
} else {
|
|
@@ -2903,8 +2246,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2903
2246
|
}
|
|
2904
2247
|
};
|
|
2905
2248
|
const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
2906
|
-
content = content != null ? content : { component: /* @__PURE__ */
|
|
2907
|
-
return /* @__PURE__ */
|
|
2249
|
+
content = content != null ? content : { component: /* @__PURE__ */ React16.createElement(Box11, null, " Aqui va el contenido ") };
|
|
2250
|
+
return /* @__PURE__ */ React16.createElement("div", null, buttonDialog ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React16.createElement(Tooltip3, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React16.createElement(Button9, { 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__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React16.createElement(IconButton8, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React16.createElement(Modal2, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React16.createElement(
|
|
2908
2251
|
Dialog,
|
|
2909
2252
|
{
|
|
2910
2253
|
"data-testid": "dialog-element",
|
|
@@ -2918,8 +2261,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2918
2261
|
}
|
|
2919
2262
|
}
|
|
2920
2263
|
},
|
|
2921
|
-
title && /* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2264
|
+
title && /* @__PURE__ */ React16.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React16.createElement(Box11, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React16.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React16.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React16.createElement(Grid6, null, /* @__PURE__ */ React16.createElement(Typography13, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React16.createElement(Typography13, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React16.createElement(IconButton8, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React16.createElement(CloseIcon2, null)) : "")),
|
|
2265
|
+
/* @__PURE__ */ React16.createElement(
|
|
2923
2266
|
DialogContent,
|
|
2924
2267
|
{
|
|
2925
2268
|
"data-testid": "dialog-content",
|
|
@@ -2947,7 +2290,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2947
2290
|
}
|
|
2948
2291
|
}
|
|
2949
2292
|
},
|
|
2950
|
-
content.url ? /* @__PURE__ */
|
|
2293
|
+
content.url ? /* @__PURE__ */ React16.createElement(
|
|
2951
2294
|
"iframe",
|
|
2952
2295
|
{
|
|
2953
2296
|
style: { border: "none", minWidth: "100%", minHeight: "100%" },
|
|
@@ -2957,20 +2300,20 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2957
2300
|
}
|
|
2958
2301
|
) : content.component
|
|
2959
2302
|
),
|
|
2960
|
-
dialogActions.length > 0 ? /* @__PURE__ */
|
|
2961
|
-
|
|
2303
|
+
dialogActions.length > 0 ? /* @__PURE__ */ React16.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
2304
|
+
Button9,
|
|
2962
2305
|
{
|
|
2963
2306
|
variant: "text",
|
|
2964
2307
|
color: dialogActions[0].color || "primary",
|
|
2965
2308
|
size: "small",
|
|
2966
2309
|
onClick: dialogActions[0].fn,
|
|
2967
2310
|
disabled: dialogActions[0].disabled || false,
|
|
2968
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */
|
|
2311
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
2969
2312
|
},
|
|
2970
2313
|
dialogActions[0].text
|
|
2971
|
-
), /* @__PURE__ */
|
|
2972
|
-
return /* @__PURE__ */
|
|
2973
|
-
|
|
2314
|
+
), /* @__PURE__ */ React16.createElement(Box11, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
2315
|
+
return /* @__PURE__ */ React16.createElement(
|
|
2316
|
+
Button9,
|
|
2974
2317
|
{
|
|
2975
2318
|
key: index + 1,
|
|
2976
2319
|
variant: index === dialogActions.length - 2 ? "contained" : "text",
|
|
@@ -2978,13 +2321,13 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2978
2321
|
size: "small",
|
|
2979
2322
|
onClick: boton.fn,
|
|
2980
2323
|
disabled: boton.disabled || false,
|
|
2981
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2324
|
+
startIcon: boton.icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
|
|
2982
2325
|
},
|
|
2983
2326
|
boton.text
|
|
2984
2327
|
);
|
|
2985
2328
|
}))) : dialogActions.map((boton, index) => {
|
|
2986
|
-
return /* @__PURE__ */
|
|
2987
|
-
|
|
2329
|
+
return /* @__PURE__ */ React16.createElement(
|
|
2330
|
+
Button9,
|
|
2988
2331
|
{
|
|
2989
2332
|
key: index,
|
|
2990
2333
|
variant: index === dialogActions.length - 1 ? "contained" : "text",
|
|
@@ -2992,7 +2335,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2992
2335
|
size: "small",
|
|
2993
2336
|
onClick: boton.fn,
|
|
2994
2337
|
disabled: boton.disabled || false,
|
|
2995
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
2338
|
+
startIcon: boton.icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
|
|
2996
2339
|
},
|
|
2997
2340
|
boton.text
|
|
2998
2341
|
);
|
|
@@ -3001,12 +2344,12 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
3001
2344
|
};
|
|
3002
2345
|
|
|
3003
2346
|
// src/Components/SCMenu.tsx
|
|
3004
|
-
import
|
|
3005
|
-
import { Box as
|
|
2347
|
+
import React17 from "react";
|
|
2348
|
+
import { Box as Box12, Typography as Typography14, Paper, Divider as Divider4, MenuList, MenuItem as MenuItem4, ListItemIcon as ListItemIcon4, SvgIcon as SvgIcon6 } from "@mui/material";
|
|
3006
2349
|
import Grid7 from "@mui/material/Grid2";
|
|
3007
2350
|
|
|
3008
2351
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
3009
|
-
import { useState as
|
|
2352
|
+
import { useState as useState10, useEffect as useEffect12 } from "react";
|
|
3010
2353
|
function getWindowDimensions() {
|
|
3011
2354
|
const { innerWidth: width, innerHeight: height } = window;
|
|
3012
2355
|
return {
|
|
@@ -3015,8 +2358,8 @@ function getWindowDimensions() {
|
|
|
3015
2358
|
};
|
|
3016
2359
|
}
|
|
3017
2360
|
function useWindowDimensions() {
|
|
3018
|
-
const [windowDimensions, setWindowDimensions] =
|
|
3019
|
-
|
|
2361
|
+
const [windowDimensions, setWindowDimensions] = useState10(getWindowDimensions());
|
|
2362
|
+
useEffect12(() => {
|
|
3020
2363
|
function handleResize() {
|
|
3021
2364
|
setWindowDimensions(getWindowDimensions());
|
|
3022
2365
|
}
|
|
@@ -3034,12 +2377,12 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
3034
2377
|
const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
|
|
3035
2378
|
const widthContainer = menuSize + pageSize;
|
|
3036
2379
|
let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
3037
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3038
|
-
const [value, setValue] =
|
|
3039
|
-
|
|
2380
|
+
const [selectedIndex, setSelectedIndex] = React17.useState("1");
|
|
2381
|
+
const [value, setValue] = React17.useState("1");
|
|
2382
|
+
React17.useEffect(() => {
|
|
3040
2383
|
heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
3041
2384
|
}, [height]);
|
|
3042
|
-
|
|
2385
|
+
React17.useEffect(() => {
|
|
3043
2386
|
if (defaultOption) {
|
|
3044
2387
|
handleClickMenusItem(event, void 0);
|
|
3045
2388
|
}
|
|
@@ -3069,7 +2412,7 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
3069
2412
|
setValue(String(index + 1));
|
|
3070
2413
|
}
|
|
3071
2414
|
};
|
|
3072
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(Grid7, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ React17.createElement(Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ React17.createElement(MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
3073
2416
|
MenuItem4,
|
|
3074
2417
|
{
|
|
3075
2418
|
disabled: disable == true ? true : false,
|
|
@@ -3077,26 +2420,26 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
3077
2420
|
selected: String(index + 1) === selectedIndex,
|
|
3078
2421
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
3079
2422
|
},
|
|
3080
|
-
option.iconLeft ? /* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3082
|
-
), option.divider == true ? /* @__PURE__ */
|
|
2423
|
+
option.iconLeft ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
2424
|
+
/* @__PURE__ */ React17.createElement(Grid7, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React17.createElement(Typography14, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
2425
|
+
), option.divider == true ? /* @__PURE__ */ React17.createElement(Divider4, null) : "")))), /* @__PURE__ */ React17.createElement(Grid7, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React17.createElement(Box12, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React17.createElement(Typography14, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
3083
2426
|
};
|
|
3084
2427
|
|
|
3085
2428
|
// src/Components/SCTabs.tsx
|
|
3086
|
-
import
|
|
3087
|
-
import { Typography as
|
|
2429
|
+
import React18, { useEffect as useEffect13 } from "react";
|
|
2430
|
+
import { Typography as Typography15, Box as Box13, SvgIcon as SvgIcon7, Tab, Tabs, Badge } from "@mui/material";
|
|
3088
2431
|
import TabPanel from "@mui/lab/TabPanel";
|
|
3089
2432
|
import TabContext from "@mui/lab/TabContext";
|
|
3090
2433
|
import * as Muicon7 from "@mui/icons-material";
|
|
3091
2434
|
var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
|
|
3092
|
-
const [toast, setToast] =
|
|
2435
|
+
const [toast, setToast] = React18.useState(null);
|
|
3093
2436
|
let i = 0;
|
|
3094
2437
|
let j = 0;
|
|
3095
2438
|
let k = 0;
|
|
3096
2439
|
let l = 0;
|
|
3097
2440
|
let validateTypeIcon = true;
|
|
3098
|
-
const [value, setValue] =
|
|
3099
|
-
|
|
2441
|
+
const [value, setValue] = React18.useState("1");
|
|
2442
|
+
useEffect13(() => {
|
|
3100
2443
|
if (defaultOption) {
|
|
3101
2444
|
handleChange(event, void 0);
|
|
3102
2445
|
}
|
|
@@ -3146,7 +2489,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
3146
2489
|
setValue(newValue);
|
|
3147
2490
|
}
|
|
3148
2491
|
};
|
|
3149
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ React18.createElement(Box13, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ React18.createElement(TabContext, { value }, /* @__PURE__ */ React18.createElement(
|
|
3150
2493
|
Tabs,
|
|
3151
2494
|
{
|
|
3152
2495
|
"data-testid": "tab-container",
|
|
@@ -3160,7 +2503,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
3160
2503
|
orientation: orientation || "horizontal",
|
|
3161
2504
|
sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
|
|
3162
2505
|
},
|
|
3163
|
-
options.map((option) => /* @__PURE__ */
|
|
2506
|
+
options.map((option) => /* @__PURE__ */ React18.createElement(
|
|
3164
2507
|
Tab,
|
|
3165
2508
|
{
|
|
3166
2509
|
"data-testid": "tab-item",
|
|
@@ -3169,7 +2512,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
3169
2512
|
label: option.name || "",
|
|
3170
2513
|
disabled: option.disabled || false,
|
|
3171
2514
|
iconPosition: iconPosition || "end",
|
|
3172
|
-
icon: typeIcon == "badge" ? /* @__PURE__ */
|
|
2515
|
+
icon: typeIcon == "badge" ? /* @__PURE__ */ React18.createElement(
|
|
3173
2516
|
Badge,
|
|
3174
2517
|
{
|
|
3175
2518
|
sx: {
|
|
@@ -3184,38 +2527,33 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
3184
2527
|
badgeContent: option.iconOrBadge,
|
|
3185
2528
|
color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
|
|
3186
2529
|
}
|
|
3187
|
-
) : typeIcon == "icon" ? /* @__PURE__ */
|
|
2530
|
+
) : typeIcon == "icon" ? /* @__PURE__ */ React18.createElement(SvgIcon7, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
|
|
3188
2531
|
sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
|
|
3189
2532
|
}
|
|
3190
2533
|
))
|
|
3191
|
-
), children, options.map((option) => /* @__PURE__ */
|
|
2534
|
+
), children, options.map((option) => /* @__PURE__ */ React18.createElement(
|
|
3192
2535
|
TabPanel,
|
|
3193
2536
|
{
|
|
3194
2537
|
key: k = k + 1,
|
|
3195
2538
|
value: String(l = l + 1),
|
|
3196
2539
|
sx: { padding: "16px" }
|
|
3197
2540
|
},
|
|
3198
|
-
option.page ? option.page : /* @__PURE__ */
|
|
3199
|
-
)))) : /* @__PURE__ */
|
|
2541
|
+
option.page ? option.page : /* @__PURE__ */ React18.createElement(Typography15, null, "No se ha configurado el componente a visualizar ")
|
|
2542
|
+
)))) : /* @__PURE__ */ React18.createElement(Box13, { sx: { height: "200px" } }, toast && /* @__PURE__ */ React18.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
|
|
3200
2543
|
};
|
|
3201
2544
|
|
|
3202
2545
|
// src/Components/Calendario/Calendar.tsx
|
|
3203
|
-
import
|
|
3204
|
-
import { Box as
|
|
2546
|
+
import React24, { useState as useState12 } from "react";
|
|
2547
|
+
import { Box as Box19 } from "@mui/material";
|
|
2548
|
+
import dayjs7 from "dayjs";
|
|
3205
2549
|
|
|
3206
2550
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
3207
|
-
import
|
|
2551
|
+
import React19, { useState as useState11 } from "react";
|
|
3208
2552
|
import { ChevronLeft, ChevronRight, KeyboardArrowDown as KeyboardArrowDown2, LightModeOutlined } from "@mui/icons-material";
|
|
3209
|
-
import { Box as
|
|
2553
|
+
import { Box as Box14, Chip as Chip3, IconButton as IconButton9, Menu, MenuItem as MenuItem5, Stack as Stack8, Typography as Typography16 } from "@mui/material";
|
|
3210
2554
|
import dayjs2 from "dayjs";
|
|
3211
|
-
import updateLocale from "dayjs/plugin/updateLocale";
|
|
3212
2555
|
import "dayjs/locale/es";
|
|
3213
2556
|
dayjs2.locale("es");
|
|
3214
|
-
dayjs2.extend(updateLocale);
|
|
3215
|
-
dayjs2.updateLocale("en", {
|
|
3216
|
-
weekStart: 0
|
|
3217
|
-
// 0 = domingo
|
|
3218
|
-
});
|
|
3219
2557
|
var CalendarToolbar = ({
|
|
3220
2558
|
labelDate,
|
|
3221
2559
|
view,
|
|
@@ -3223,7 +2561,7 @@ var CalendarToolbar = ({
|
|
|
3223
2561
|
onNavigate,
|
|
3224
2562
|
children
|
|
3225
2563
|
}) => {
|
|
3226
|
-
const [anchorEl, setAnchorEl] =
|
|
2564
|
+
const [anchorEl, setAnchorEl] = useState11(null);
|
|
3227
2565
|
const open = Boolean(anchorEl);
|
|
3228
2566
|
const handleMenuOpen = (event2) => {
|
|
3229
2567
|
setAnchorEl(event2.currentTarget);
|
|
@@ -3236,25 +2574,23 @@ var CalendarToolbar = ({
|
|
|
3236
2574
|
handleMenuClose();
|
|
3237
2575
|
};
|
|
3238
2576
|
const getFormattedDate = () => {
|
|
3239
|
-
const sunday = labelDate.day(0);
|
|
3240
2577
|
if (view === "month") {
|
|
3241
|
-
|
|
3242
|
-
return textMonth.charAt(0).toUpperCase() + textMonth.slice(1);
|
|
2578
|
+
return labelDate.format("MMMM YYYY");
|
|
3243
2579
|
}
|
|
3244
2580
|
if (view === "week") {
|
|
3245
|
-
return `${labelDate.startOf("week").format("DD MMM")} - ${labelDate.endOf("week").format("DD MMM YYYY")}`;
|
|
2581
|
+
return `${labelDate.startOf("week").add(1, "day").format("DD MMM")} - ${labelDate.endOf("week").format("DD MMM YYYY")}`;
|
|
3246
2582
|
}
|
|
3247
2583
|
return labelDate.format(" DD MMMM YYYY");
|
|
3248
2584
|
};
|
|
3249
|
-
return /* @__PURE__ */
|
|
2585
|
+
return /* @__PURE__ */ React19.createElement(Stack8, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 0.5, px: 1, py: 0.5 }, /* @__PURE__ */ React19.createElement(Box14, null, /* @__PURE__ */ React19.createElement(
|
|
3250
2586
|
Chip3,
|
|
3251
2587
|
{
|
|
3252
2588
|
label: "Hoy",
|
|
3253
|
-
icon: /* @__PURE__ */
|
|
2589
|
+
icon: /* @__PURE__ */ React19.createElement(LightModeOutlined, { fontSize: "small" }),
|
|
3254
2590
|
color: "primary",
|
|
3255
2591
|
onClick: () => onNavigate("TODAY")
|
|
3256
2592
|
}
|
|
3257
|
-
)), /* @__PURE__ */
|
|
2593
|
+
)), /* @__PURE__ */ React19.createElement(Stack8, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React19.createElement(IconButton9, { "aria-label": "Anterior", onClick: () => onNavigate("PREV"), size: "small", color: "primary" }, /* @__PURE__ */ React19.createElement(ChevronLeft, { fontSize: "small" })), /* @__PURE__ */ React19.createElement(IconButton9, { "aria-label": "Siguiente", onClick: () => onNavigate("NEXT"), size: "small", color: "primary" }, /* @__PURE__ */ React19.createElement(ChevronRight, { fontSize: "small" })), /* @__PURE__ */ React19.createElement(Typography16, { variant: "h6", color: "primary", "data-testid": "currentDate" }, getFormattedDate()), /* @__PURE__ */ React19.createElement(IconButton9, { onClick: handleMenuOpen, size: "small", color: "primary", "aria-label": "Cambiar vista" }, /* @__PURE__ */ React19.createElement(KeyboardArrowDown2, { fontSize: "small" })), /* @__PURE__ */ React19.createElement(
|
|
3258
2594
|
Menu,
|
|
3259
2595
|
{
|
|
3260
2596
|
anchorEl,
|
|
@@ -3263,15 +2599,15 @@ var CalendarToolbar = ({
|
|
|
3263
2599
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
3264
2600
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
3265
2601
|
},
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3268
|
-
/* @__PURE__ */
|
|
3269
|
-
)), children ? /* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ React19.createElement(MenuItem5, { onClick: () => handleViewChange("month") }, "Mes"),
|
|
2603
|
+
/* @__PURE__ */ React19.createElement(MenuItem5, { onClick: () => handleViewChange("week") }, "Semana"),
|
|
2604
|
+
/* @__PURE__ */ React19.createElement(MenuItem5, { onClick: () => handleViewChange("day") }, "D\xEDa")
|
|
2605
|
+
)), children ? /* @__PURE__ */ React19.createElement(Box14, null, children) : /* @__PURE__ */ React19.createElement(Box14, { width: "24px" }), " ");
|
|
3270
2606
|
};
|
|
3271
2607
|
|
|
3272
2608
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
3273
|
-
import
|
|
3274
|
-
import { Box as
|
|
2609
|
+
import React21 from "react";
|
|
2610
|
+
import { Box as Box16, Typography as Typography18, IconButton as IconButton10, Paper as Paper2, Tooltip as Tooltip4, Stack as Stack10, Divider as Divider6 } from "@mui/material";
|
|
3275
2611
|
import AddIcon from "@mui/icons-material/Add";
|
|
3276
2612
|
import dayjs4 from "dayjs";
|
|
3277
2613
|
import localeData from "dayjs/plugin/localeData";
|
|
@@ -3297,32 +2633,21 @@ var stateColors = {
|
|
|
3297
2633
|
Asignada: "warning.main",
|
|
3298
2634
|
Finalizado: "primary.main",
|
|
3299
2635
|
Vencida: "error.main",
|
|
3300
|
-
EnProgreso: "success.main"
|
|
3301
|
-
Aplazada: "grey.400",
|
|
3302
|
-
Generada: "secondary.main"
|
|
2636
|
+
EnProgreso: "success.main"
|
|
3303
2637
|
};
|
|
3304
2638
|
|
|
3305
2639
|
// src/Components/Calendario/Event.tsx
|
|
3306
|
-
import
|
|
3307
|
-
import { Box as
|
|
3308
|
-
var CalendarEventCard = ({ event: event2, color, sx, onClick
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
setAnchorEl(event3.currentTarget);
|
|
3312
|
-
};
|
|
3313
|
-
const handlePopoverClose = () => {
|
|
3314
|
-
setAnchorEl(null);
|
|
3315
|
-
};
|
|
3316
|
-
const open = Boolean(anchorEl);
|
|
3317
|
-
return /* @__PURE__ */ React26.createElement(
|
|
3318
|
-
Stack10,
|
|
2640
|
+
import React20 from "react";
|
|
2641
|
+
import { Box as Box15, Stack as Stack9, Typography as Typography17, Divider as Divider5 } from "@mui/material";
|
|
2642
|
+
var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
2643
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2644
|
+
Stack9,
|
|
3319
2645
|
{
|
|
3320
2646
|
direction: "row",
|
|
3321
2647
|
padding: 0.5,
|
|
3322
2648
|
borderRadius: 0.5,
|
|
3323
2649
|
alignItems: "flex-start",
|
|
3324
2650
|
minHeight: "20px",
|
|
3325
|
-
onMouseOver: () => onHover == null ? void 0 : onHover(event2),
|
|
3326
2651
|
onClick: (e) => {
|
|
3327
2652
|
e.stopPropagation();
|
|
3328
2653
|
onClick == null ? void 0 : onClick(event2);
|
|
@@ -3335,7 +2660,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3335
2660
|
cursor: onClick ? "pointer" : "default"
|
|
3336
2661
|
}, sx)
|
|
3337
2662
|
},
|
|
3338
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ React20.createElement(
|
|
3339
2664
|
Divider5,
|
|
3340
2665
|
{
|
|
3341
2666
|
orientation: "vertical",
|
|
@@ -3347,8 +2672,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3347
2672
|
}
|
|
3348
2673
|
}
|
|
3349
2674
|
),
|
|
3350
|
-
/* @__PURE__ */
|
|
3351
|
-
|
|
2675
|
+
/* @__PURE__ */ React20.createElement(
|
|
2676
|
+
Box15,
|
|
3352
2677
|
{
|
|
3353
2678
|
px: 1,
|
|
3354
2679
|
py: 0.5,
|
|
@@ -3357,8 +2682,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3357
2682
|
display: "flex",
|
|
3358
2683
|
alignItems: "center"
|
|
3359
2684
|
},
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
|
|
2685
|
+
/* @__PURE__ */ React20.createElement(
|
|
2686
|
+
Typography17,
|
|
3362
2687
|
{
|
|
3363
2688
|
color: "text.primary",
|
|
3364
2689
|
variant: "caption",
|
|
@@ -3367,65 +2692,29 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3367
2692
|
overflow: "hidden",
|
|
3368
2693
|
textOverflow: "ellipsis",
|
|
3369
2694
|
whiteSpace: "nowrap"
|
|
3370
|
-
}
|
|
3371
|
-
onMouseEnter: handlePopoverOpen,
|
|
3372
|
-
onMouseLeave: handlePopoverClose
|
|
3373
|
-
},
|
|
3374
|
-
event2.title.charAt(0).toUpperCase() + event2.title.slice(1).toLowerCase()
|
|
3375
|
-
),
|
|
3376
|
-
/* @__PURE__ */ React26.createElement(
|
|
3377
|
-
Popover4,
|
|
3378
|
-
{
|
|
3379
|
-
id: "mouse-over-popover",
|
|
3380
|
-
sx: { pointerEvents: "none" },
|
|
3381
|
-
open,
|
|
3382
|
-
anchorEl,
|
|
3383
|
-
anchorOrigin: {
|
|
3384
|
-
vertical: "top",
|
|
3385
|
-
horizontal: "right"
|
|
3386
|
-
},
|
|
3387
|
-
transformOrigin: {
|
|
3388
|
-
vertical: "bottom",
|
|
3389
|
-
horizontal: "right"
|
|
3390
|
-
},
|
|
3391
|
-
onClose: handlePopoverClose,
|
|
3392
|
-
disableRestoreFocus: true
|
|
2695
|
+
}
|
|
3393
2696
|
},
|
|
3394
|
-
|
|
2697
|
+
capitalize(event2.title)
|
|
3395
2698
|
)
|
|
3396
2699
|
)
|
|
3397
2700
|
);
|
|
3398
2701
|
};
|
|
3399
2702
|
|
|
3400
|
-
// src/assets/LogoCalendario.tsx
|
|
3401
|
-
import React27 from "react";
|
|
3402
|
-
var LogoCalendario = () => {
|
|
3403
|
-
return /* @__PURE__ */ React27.createElement("svg", { width: "60", height: "61", viewBox: "0 0 60 61", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React27.createElement("g", { "clip-path": "url(#clip0_5353_24891)" }, /* @__PURE__ */ React27.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40.7361 11.1589C39.7792 11.1589 39.0106 11.9722 39.0106 12.9661V15.4375H20.0309V12.9661C20.0309 11.964 19.2545 11.1589 18.3055 11.1589C17.3487 11.1589 16.5801 11.9722 16.5801 12.9661V15.4375H12.8819C12.0652 15.4375 11.4038 16.0918 11.4038 16.8998V20.6551C11.4038 21.463 12.0652 22.1174 12.8819 22.1174H46.8383C47.655 22.1174 48.3165 21.463 48.3165 20.6551V16.8998C48.3165 16.0918 47.655 15.4375 46.8383 15.4375H42.4615V12.9661C42.4615 11.964 41.6851 11.1589 40.7361 11.1589ZM19.4827 19.2049C19.6528 19.1343 19.7361 19.006 19.7724 18.8352C19.6916 18.9714 19.594 19.0957 19.4827 19.2049Z", fill: "#00BCD4" }), /* @__PURE__ */ React27.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.2037 25.8653C13.7579 25.8653 13.425 26.2168 13.425 26.6093V47.3669C13.425 47.7595 13.7579 48.1109 14.2037 48.1109H46.0004C46.4782 48.1109 46.8656 47.7236 46.8656 47.2458V26.6093C46.8656 26.2168 46.5327 25.8653 46.087 25.8653H14.2037ZM11.6948 26.6093C11.6948 25.2255 12.8384 24.135 14.2037 24.135H46.087C47.4522 24.135 48.5959 25.2255 48.5959 26.6093V47.2458C48.5959 48.6792 47.4339 49.8412 46.0004 49.8412H14.2037C12.8384 49.8412 11.6948 48.7508 11.6948 47.3669V26.6093Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M19.481 30.9138C19.481 30.5164 20.1155 30.1903 20.9058 30.1903C21.6894 30.1903 22.3305 30.5131 22.3305 30.9138V32.8862C22.3305 33.2836 21.6894 33.6097 20.9058 33.6097C20.1222 33.6097 19.481 33.2869 19.481 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M30.0242 30.1903C29.2339 30.1903 28.5995 30.5164 28.5995 30.9138V32.8862C28.5995 33.2869 29.2406 33.6097 30.0242 33.6097C30.8079 33.6097 31.449 33.2836 31.449 32.8862V30.9138C31.449 30.5131 30.8079 30.1903 30.0242 30.1903Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M37.7179 30.9138C37.7179 30.5164 38.3524 30.1903 39.1427 30.1903C39.608 30.1903 40.022 30.3038 40.2825 30.4797C40.3515 30.5276 40.4116 30.5788 40.4561 30.6344C40.5274 30.7201 40.5675 30.8147 40.5675 30.9138V32.8862C40.5675 33.2836 39.9263 33.6097 39.1427 33.6097C38.3591 33.6097 37.7179 33.2869 37.7179 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M20.9058 39.8787C20.1155 39.8787 19.481 40.2048 19.481 40.6022V42.5746C19.481 42.687 19.5322 42.7927 19.6213 42.8874C19.7036 42.9731 19.8172 43.0499 19.9552 43.1122C20.2068 43.228 20.5407 43.2981 20.9058 43.2981C21.6894 43.2981 22.3305 42.972 22.3305 42.5746V40.6022C22.3305 40.2015 21.6894 39.8787 20.9058 39.8787Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M29.524 39.9477C29.7087 39.9032 29.9158 39.8787 30.1339 39.8787C30.9176 39.8787 31.5587 40.2015 31.5587 40.6022V42.5746C31.5587 42.972 30.9176 43.2981 30.1339 43.2981C29.3503 43.2981 28.7092 42.9753 28.7092 42.5746V40.6022C28.7092 40.315 29.0409 40.0646 29.524 39.9477Z", fill: "#6392BD" }), /* @__PURE__ */ React27.createElement("path", { d: "M38.5141 39.9482C38.6989 39.9037 38.9059 39.8792 39.1241 39.8792C39.9077 39.8792 40.5488 40.202 40.5488 40.6027V42.5751C40.5488 42.9725 39.9077 43.2986 39.1241 43.2986C38.3405 43.2986 37.6993 42.9758 37.6993 42.5751V40.6027C37.6993 40.3155 38.031 40.0651 38.5141 39.9482Z", fill: "#6392BD" })), /* @__PURE__ */ React27.createElement("defs", null, /* @__PURE__ */ React27.createElement("clipPath", { id: "clip0_5353_24891" }, /* @__PURE__ */ React27.createElement("rect", { width: "60", height: "60", fill: "white", transform: "translate(0 0.5)" }))));
|
|
3404
|
-
};
|
|
3405
|
-
|
|
3406
2703
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
3407
2704
|
dayjs4.extend(localeData);
|
|
3408
2705
|
dayjs4.extend(isBetween);
|
|
3409
|
-
var MonthView = ({ events,
|
|
3410
|
-
const noEvents = events.length === 0;
|
|
2706
|
+
var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick }) => {
|
|
3411
2707
|
const days = getMonthDays(currentDate);
|
|
3412
2708
|
const weekDays = Array.from({ length: 7 }, (_, i) => dayjs4().day(i));
|
|
3413
|
-
const [openDrawer, setOpenDrawer] =
|
|
3414
|
-
const [selectedDay, setSelectedDay] =
|
|
3415
|
-
const [selectedEvents, setSelectedEvents] =
|
|
3416
|
-
return /* @__PURE__ */
|
|
3417
|
-
EmptyState,
|
|
3418
|
-
{
|
|
3419
|
-
title: "Inicia la gesti\xF3n de las actividades",
|
|
3420
|
-
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3421
|
-
icon: /* @__PURE__ */ React28.createElement(LogoCalendario, null)
|
|
3422
|
-
}
|
|
3423
|
-
) : /* @__PURE__ */ React28.createElement(Box17, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5 }, days.map((day) => {
|
|
2709
|
+
const [openDrawer, setOpenDrawer] = React21.useState(false);
|
|
2710
|
+
const [selectedDay, setSelectedDay] = React21.useState(null);
|
|
2711
|
+
const [selectedEvents, setSelectedEvents] = React21.useState([]);
|
|
2712
|
+
return /* @__PURE__ */ React21.createElement(Box16, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ React21.createElement(Box16, { minWidth: "1050px" }, /* @__PURE__ */ React21.createElement(Box16, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ React21.createElement(Box16, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ React21.createElement(Typography18, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), /* @__PURE__ */ React21.createElement(Box16, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5 }, days.map((day) => {
|
|
3424
2713
|
const dayEvents = events.filter(
|
|
3425
2714
|
(e) => day.isBetween(e.start.startOf("day"), e.end.endOf("day"), null, "[]")
|
|
3426
2715
|
);
|
|
3427
2716
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
3428
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3429
2718
|
Paper2,
|
|
3430
2719
|
{
|
|
3431
2720
|
key: day.toString(),
|
|
@@ -3442,8 +2731,8 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3442
2731
|
overflow: "hidden"
|
|
3443
2732
|
}
|
|
3444
2733
|
},
|
|
3445
|
-
/* @__PURE__ */
|
|
3446
|
-
|
|
2734
|
+
/* @__PURE__ */ React21.createElement(Box16, { p: 1, flexShrink: 0 }, /* @__PURE__ */ React21.createElement(Box16, { display: "flex", alignItems: "center", justifyContent: "flex-start" }, /* @__PURE__ */ React21.createElement(
|
|
2735
|
+
Box16,
|
|
3447
2736
|
{
|
|
3448
2737
|
sx: {
|
|
3449
2738
|
width: 24,
|
|
@@ -3455,16 +2744,16 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3455
2744
|
justifyContent: "center"
|
|
3456
2745
|
}
|
|
3457
2746
|
},
|
|
3458
|
-
/* @__PURE__ */
|
|
3459
|
-
|
|
2747
|
+
/* @__PURE__ */ React21.createElement(
|
|
2748
|
+
Typography18,
|
|
3460
2749
|
{
|
|
3461
2750
|
variant: "body2",
|
|
3462
2751
|
sx: { color: isToday(day) ? "white" : "text.secondary" }
|
|
3463
2752
|
},
|
|
3464
2753
|
day.date()
|
|
3465
2754
|
)
|
|
3466
|
-
), dayEvents.length > 2 && /* @__PURE__ */
|
|
3467
|
-
|
|
2755
|
+
), dayEvents.length > 2 && /* @__PURE__ */ React21.createElement(Tooltip4, { title: "M\xE1s eventos" }, /* @__PURE__ */ React21.createElement(
|
|
2756
|
+
IconButton10,
|
|
3468
2757
|
{
|
|
3469
2758
|
color: "primary",
|
|
3470
2759
|
size: "small",
|
|
@@ -3475,46 +2764,64 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3475
2764
|
setSelectedEvents(dayEvents);
|
|
3476
2765
|
}
|
|
3477
2766
|
},
|
|
3478
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ React21.createElement(AddIcon, { fontSize: "small" })
|
|
3479
2768
|
)))),
|
|
3480
|
-
/* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ React21.createElement(Box16, { display: "flex", flexDirection: "column", gap: 0.5, p: 1, pt: 0, overflow: "hidden" }, dayEvents.slice(0, 2).map((event2) => /* @__PURE__ */ React21.createElement(
|
|
3481
2770
|
CalendarEventCard,
|
|
3482
2771
|
{
|
|
3483
2772
|
key: `${event2.id}-${day.toString()}`,
|
|
3484
2773
|
event: event2,
|
|
3485
2774
|
color: stateColors[event2.state],
|
|
3486
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day)
|
|
3487
|
-
onHover: onEventHover
|
|
2775
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day)
|
|
3488
2776
|
}
|
|
3489
2777
|
))),
|
|
3490
|
-
dayEvents.length > 2 && /* @__PURE__ */
|
|
3491
|
-
|
|
2778
|
+
dayEvents.length > 2 && /* @__PURE__ */ React21.createElement(Stack10, { justifyContent: "flex-end", px: 1, pb: 0.5, onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React21.createElement(
|
|
2779
|
+
SCDrawer,
|
|
3492
2780
|
{
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
2781
|
+
width: "350px",
|
|
2782
|
+
title: day.format("DD [de] MMMM YYYY"),
|
|
2783
|
+
open: openDrawer,
|
|
2784
|
+
buttonDrawer: { text: `+ ${dayEvents.length}` },
|
|
2785
|
+
anchor: "right",
|
|
2786
|
+
actions: false,
|
|
2787
|
+
arrayElements: [{
|
|
2788
|
+
component: (() => {
|
|
2789
|
+
const [first, ...rest] = dayEvents;
|
|
2790
|
+
return /* @__PURE__ */ React21.createElement(Box16, { display: "flex", width: "100%", flexDirection: "column", height: "100%", pr: 1.5 }, /* @__PURE__ */ React21.createElement(Typography18, { width: "100%", color: "text.secondary" }, " Proximo evento "), first && /* @__PURE__ */ React21.createElement(Box16, { p: 1, pb: 1, width: "100%" }, /* @__PURE__ */ React21.createElement(
|
|
2791
|
+
CalendarEventCard,
|
|
2792
|
+
{
|
|
2793
|
+
event: first,
|
|
2794
|
+
color: stateColors[first.state],
|
|
2795
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(first, day),
|
|
2796
|
+
sx: {
|
|
2797
|
+
whiteSpace: "normal",
|
|
2798
|
+
"& .MuiTypography-root": {
|
|
2799
|
+
whiteSpace: "normal",
|
|
2800
|
+
overflow: "visible",
|
|
2801
|
+
textOverflow: "unset"
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
)), /* @__PURE__ */ React21.createElement(Divider6, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ React21.createElement(Typography18, { width: "100%", py: 1, color: "text.secondary" }, " Eventos restantes "), /* @__PURE__ */ React21.createElement(
|
|
2806
|
+
Box16,
|
|
2807
|
+
{
|
|
2808
|
+
width: "100%",
|
|
2809
|
+
height: "100%",
|
|
2810
|
+
flex: 1,
|
|
2811
|
+
overflow: "auto",
|
|
2812
|
+
p: 1,
|
|
2813
|
+
pt: 1,
|
|
2814
|
+
display: "flex",
|
|
2815
|
+
flexDirection: "column",
|
|
2816
|
+
gap: 1.5
|
|
2817
|
+
},
|
|
2818
|
+
rest.map((event2) => /* @__PURE__ */ React21.createElement(
|
|
3512
2819
|
CalendarEventCard,
|
|
3513
2820
|
{
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
2821
|
+
key: `${event2.id}-${day.toString()}`,
|
|
2822
|
+
event: event2,
|
|
2823
|
+
color: stateColors[event2.state],
|
|
2824
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3518
2825
|
sx: {
|
|
3519
2826
|
whiteSpace: "normal",
|
|
3520
2827
|
"& .MuiTypography-root": {
|
|
@@ -3524,68 +2831,26 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3524
2831
|
}
|
|
3525
2832
|
}
|
|
3526
2833
|
}
|
|
3527
|
-
))
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
overflow: "auto",
|
|
3534
|
-
p: 1,
|
|
3535
|
-
pt: 1,
|
|
3536
|
-
display: "flex",
|
|
3537
|
-
flexDirection: "column",
|
|
3538
|
-
gap: 1.5
|
|
3539
|
-
},
|
|
3540
|
-
rest.map((event2) => /* @__PURE__ */ React28.createElement(
|
|
3541
|
-
CalendarEventCard,
|
|
3542
|
-
{
|
|
3543
|
-
key: `${event2.id}-${day.toString()}`,
|
|
3544
|
-
event: event2,
|
|
3545
|
-
color: stateColors[event2.state],
|
|
3546
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3547
|
-
onHover: onEventHover,
|
|
3548
|
-
sx: {
|
|
3549
|
-
whiteSpace: "normal",
|
|
3550
|
-
"& .MuiTypography-root": {
|
|
3551
|
-
whiteSpace: "normal",
|
|
3552
|
-
overflow: "visible",
|
|
3553
|
-
textOverflow: "unset"
|
|
3554
|
-
}
|
|
3555
|
-
}
|
|
3556
|
-
}
|
|
3557
|
-
))
|
|
3558
|
-
));
|
|
3559
|
-
})()
|
|
3560
|
-
}]
|
|
3561
|
-
}
|
|
3562
|
-
)
|
|
3563
|
-
)
|
|
2834
|
+
))
|
|
2835
|
+
));
|
|
2836
|
+
})()
|
|
2837
|
+
}]
|
|
2838
|
+
}
|
|
2839
|
+
))
|
|
3564
2840
|
);
|
|
3565
2841
|
}))));
|
|
3566
2842
|
};
|
|
3567
2843
|
|
|
3568
2844
|
// src/Components/Calendario/Views/WeekView.tsx
|
|
3569
|
-
import
|
|
3570
|
-
import { Box as
|
|
2845
|
+
import React22 from "react";
|
|
2846
|
+
import { Box as Box17, Typography as Typography19 } from "@mui/material";
|
|
3571
2847
|
import dayjs5 from "dayjs";
|
|
3572
2848
|
import localeData2 from "dayjs/plugin/localeData";
|
|
3573
2849
|
dayjs5.extend(localeData2);
|
|
3574
|
-
var WeekView = ({
|
|
3575
|
-
events,
|
|
3576
|
-
currentDate,
|
|
3577
|
-
isLoading,
|
|
3578
|
-
onDayClick,
|
|
3579
|
-
onEventClick,
|
|
3580
|
-
onEventHover,
|
|
3581
|
-
startHour = 0,
|
|
3582
|
-
endHour = 23
|
|
3583
|
-
}) => {
|
|
3584
|
-
const noEvents = events.length === 0;
|
|
3585
|
-
const todayString = dayjs5().format("YYYY-MM-DD");
|
|
2850
|
+
var WeekView = ({ events, currentDate, onDayClick, onEventClick }) => {
|
|
3586
2851
|
const startOfWeek2 = currentDate.startOf("week");
|
|
3587
2852
|
const days = Array.from({ length: 7 }, (_, i) => startOfWeek2.add(i, "day"));
|
|
3588
|
-
const
|
|
2853
|
+
const hours2 = Array.from({ length: 24 }, (_, i) => i);
|
|
3589
2854
|
const getCellBorderType = (cellHour, dayEvents) => {
|
|
3590
2855
|
for (const event2 of dayEvents) {
|
|
3591
2856
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -3593,7 +2858,8 @@ var WeekView = ({
|
|
|
3593
2858
|
const cellStart = cellHour;
|
|
3594
2859
|
const cellEnd = cellHour + 1;
|
|
3595
2860
|
if (cellEnd > start && cellStart < end) {
|
|
3596
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2861
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2862
|
+
return "full";
|
|
3597
2863
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
3598
2864
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
3599
2865
|
return "middle";
|
|
@@ -3601,122 +2867,92 @@ var WeekView = ({
|
|
|
3601
2867
|
}
|
|
3602
2868
|
return "none";
|
|
3603
2869
|
};
|
|
3604
|
-
return /* @__PURE__ */
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
2870
|
+
return /* @__PURE__ */ React22.createElement(Box17, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ React22.createElement(Box17, { display: "flex", bgcolor: "background.default" }, /* @__PURE__ */ React22.createElement(Box17, { width: 45, bgcolor: "background.default" }), days.map((day) => /* @__PURE__ */ React22.createElement(
|
|
2871
|
+
Box17,
|
|
2872
|
+
{
|
|
2873
|
+
key: day.toString(),
|
|
2874
|
+
height: 40,
|
|
2875
|
+
flex: 1,
|
|
2876
|
+
pl: 0.5,
|
|
2877
|
+
textAlign: "center",
|
|
2878
|
+
display: "flex",
|
|
2879
|
+
flexDirection: "column",
|
|
2880
|
+
justifyContent: "center",
|
|
2881
|
+
alignItems: "flex-start"
|
|
2882
|
+
},
|
|
2883
|
+
/* @__PURE__ */ React22.createElement(Typography19, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
2884
|
+
))), /* @__PURE__ */ React22.createElement(Box17, { display: "flex", flex: 1 }, /* @__PURE__ */ React22.createElement(Box17, { width: 45, bgcolor: "background.default" }, hours2.map((h) => /* @__PURE__ */ React22.createElement(
|
|
2885
|
+
Box17,
|
|
2886
|
+
{
|
|
2887
|
+
key: h,
|
|
2888
|
+
height: 60,
|
|
2889
|
+
textAlign: "right",
|
|
2890
|
+
pr: 1,
|
|
2891
|
+
borderTop: "1px solid",
|
|
2892
|
+
borderColor: "divider"
|
|
2893
|
+
},
|
|
2894
|
+
/* @__PURE__ */ React22.createElement(Typography19, { variant: "caption", color: "text.secondary" }, dayjs5().hour(h).format("h A"))
|
|
2895
|
+
))), days.map((day) => {
|
|
2896
|
+
const dayEvents = events.filter(
|
|
2897
|
+
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
2898
|
+
);
|
|
2899
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2900
|
+
Box17,
|
|
3608
2901
|
{
|
|
3609
2902
|
key: day.toString(),
|
|
3610
|
-
height: 40,
|
|
3611
2903
|
flex: 1,
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
alignItems: "flex-start",
|
|
3618
|
-
bgcolor: isToday2 ? "primary.100" : "transparent",
|
|
3619
|
-
borderRadius: isToday2 ? "6px 6px 0 0" : "0",
|
|
3620
|
-
borderBottom: isToday2 ? 2 : 0,
|
|
3621
|
-
borderColor: isToday2 ? "primary.main" : "transparent"
|
|
3622
|
-
},
|
|
3623
|
-
/* @__PURE__ */ React29.createElement(Typography20, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3624
|
-
/* @__PURE__ */ React29.createElement(Typography20, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3625
|
-
);
|
|
3626
|
-
})), isLoading ? /* @__PURE__ */ React29.createElement(Box18, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ React29.createElement(CircularProgress3, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ React29.createElement(
|
|
3627
|
-
EmptyState,
|
|
3628
|
-
{
|
|
3629
|
-
title: "Inicia la gesti\xF3n de las actividades",
|
|
3630
|
-
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3631
|
-
icon: /* @__PURE__ */ React29.createElement(LogoCalendario, null)
|
|
3632
|
-
}
|
|
3633
|
-
) : (
|
|
3634
|
-
// Grid de horas y eventos
|
|
3635
|
-
/* @__PURE__ */ React29.createElement(Box18, { display: "flex", flex: 1 }, /* @__PURE__ */ React29.createElement(Box18, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ React29.createElement(
|
|
3636
|
-
Box18,
|
|
3637
|
-
{
|
|
3638
|
-
key: h,
|
|
3639
|
-
height: 60,
|
|
3640
|
-
textAlign: "right",
|
|
3641
|
-
pr: 1,
|
|
3642
|
-
borderColor: "divider"
|
|
2904
|
+
borderLeft: "1px solid",
|
|
2905
|
+
borderColor: "divider",
|
|
2906
|
+
position: "relative",
|
|
2907
|
+
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
2908
|
+
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
3643
2909
|
},
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
}),
|
|
3677
|
-
dayEvents.map((event2) => {
|
|
3678
|
-
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(startHour).minute(0);
|
|
3679
|
-
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
3680
|
-
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
3681
|
-
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
3682
|
-
return /* @__PURE__ */ React29.createElement(
|
|
3683
|
-
CalendarEventCard,
|
|
3684
|
-
{
|
|
3685
|
-
key: `${event2.id}-${day.toString()}`,
|
|
3686
|
-
event: event2,
|
|
3687
|
-
color: stateColors[event2.state],
|
|
3688
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3689
|
-
onHover: onEventHover,
|
|
3690
|
-
sx: {
|
|
3691
|
-
position: "absolute",
|
|
3692
|
-
top: `${startMinutes}px`,
|
|
3693
|
-
left: 4,
|
|
3694
|
-
right: 4,
|
|
3695
|
-
cursor: "pointer",
|
|
3696
|
-
height: `${durationMinutes}px`
|
|
3697
|
-
}
|
|
2910
|
+
hours2.map((hourIdx) => {
|
|
2911
|
+
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
2912
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2913
|
+
Box17,
|
|
2914
|
+
{
|
|
2915
|
+
key: hourIdx,
|
|
2916
|
+
height: 60,
|
|
2917
|
+
borderTop: "1px solid",
|
|
2918
|
+
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
2919
|
+
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
2920
|
+
}
|
|
2921
|
+
);
|
|
2922
|
+
}),
|
|
2923
|
+
dayEvents.map((event2) => {
|
|
2924
|
+
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(0).minute(0);
|
|
2925
|
+
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(23).minute(59);
|
|
2926
|
+
const startMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
2927
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
2928
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2929
|
+
CalendarEventCard,
|
|
2930
|
+
{
|
|
2931
|
+
key: `${event2.id}-${day.toString()}`,
|
|
2932
|
+
event: event2,
|
|
2933
|
+
color: stateColors[event2.state],
|
|
2934
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
2935
|
+
sx: {
|
|
2936
|
+
position: "absolute",
|
|
2937
|
+
top: `${startMinutes + 15}px`,
|
|
2938
|
+
left: 4,
|
|
2939
|
+
right: 4,
|
|
2940
|
+
cursor: "pointer",
|
|
2941
|
+
height: "auto"
|
|
3698
2942
|
}
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
)
|
|
3702
|
-
|
|
3703
|
-
));
|
|
2943
|
+
}
|
|
2944
|
+
);
|
|
2945
|
+
})
|
|
2946
|
+
);
|
|
2947
|
+
})));
|
|
3704
2948
|
};
|
|
3705
2949
|
|
|
3706
2950
|
// src/Components/Calendario/Views/DayView.tsx
|
|
3707
|
-
import
|
|
3708
|
-
import { Box as
|
|
2951
|
+
import React23 from "react";
|
|
2952
|
+
import { Box as Box18, Typography as Typography20 } from "@mui/material";
|
|
3709
2953
|
import dayjs6 from "dayjs";
|
|
3710
|
-
var
|
|
3711
|
-
|
|
3712
|
-
currentDate,
|
|
3713
|
-
isLoading,
|
|
3714
|
-
onEventClick,
|
|
3715
|
-
onEventHover,
|
|
3716
|
-
startHour = 0,
|
|
3717
|
-
endHour = 24
|
|
3718
|
-
}) => {
|
|
3719
|
-
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
2954
|
+
var hours = Array.from({ length: 24 }, (_, i) => i);
|
|
2955
|
+
var DayView = ({ events, currentDate, onEventClick }) => {
|
|
3720
2956
|
const getCellBorderType = (cellHour, dayEvents2) => {
|
|
3721
2957
|
for (const event2 of dayEvents2) {
|
|
3722
2958
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -3724,7 +2960,8 @@ var DayView = ({
|
|
|
3724
2960
|
const cellStart = cellHour;
|
|
3725
2961
|
const cellEnd = cellHour + 1;
|
|
3726
2962
|
if (cellEnd > start && cellStart < end) {
|
|
3727
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2963
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2964
|
+
return "full";
|
|
3728
2965
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
3729
2966
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
3730
2967
|
return "middle";
|
|
@@ -3735,16 +2972,21 @@ var DayView = ({
|
|
|
3735
2972
|
const dayEvents = events.filter(
|
|
3736
2973
|
(event2) => currentDate.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3737
2974
|
);
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
EmptyState,
|
|
2975
|
+
return /* @__PURE__ */ React23.createElement(Box18, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ React23.createElement(Box18, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ React23.createElement(Box18, { width: 47, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ React23.createElement(
|
|
2976
|
+
Box18,
|
|
3741
2977
|
{
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
2978
|
+
flex: 1,
|
|
2979
|
+
display: "flex",
|
|
2980
|
+
flexDirection: "column",
|
|
2981
|
+
textAlign: "start",
|
|
2982
|
+
gap: 0.5,
|
|
2983
|
+
py: 1,
|
|
2984
|
+
bgcolor: "primary.50"
|
|
2985
|
+
},
|
|
2986
|
+
/* @__PURE__ */ React23.createElement(Typography20, { variant: "h6", color: "text.secondary" }, currentDate.format("D")),
|
|
2987
|
+
/* @__PURE__ */ React23.createElement(Typography20, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd"))
|
|
2988
|
+
)), /* @__PURE__ */ React23.createElement(Box18, { display: "flex", flex: 1 }, /* @__PURE__ */ React23.createElement(Box18, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ React23.createElement(
|
|
2989
|
+
Box18,
|
|
3748
2990
|
{
|
|
3749
2991
|
key: h,
|
|
3750
2992
|
height: 60,
|
|
@@ -3754,11 +2996,11 @@ var DayView = ({
|
|
|
3754
2996
|
borderRight: "1px solid",
|
|
3755
2997
|
borderColor: "divider"
|
|
3756
2998
|
},
|
|
3757
|
-
/* @__PURE__ */
|
|
3758
|
-
))), /* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ React23.createElement(Typography20, { variant: "caption", color: "text.secondary" }, dayjs6().hour(h).format("h A"))
|
|
3000
|
+
))), /* @__PURE__ */ React23.createElement(Box18, { flex: 1, position: "relative" }, hours.map((hourIdx) => {
|
|
3759
3001
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3760
|
-
return /* @__PURE__ */
|
|
3761
|
-
|
|
3002
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3003
|
+
Box18,
|
|
3762
3004
|
{
|
|
3763
3005
|
key: hourIdx,
|
|
3764
3006
|
height: 60,
|
|
@@ -3768,26 +3010,20 @@ var DayView = ({
|
|
|
3768
3010
|
}
|
|
3769
3011
|
);
|
|
3770
3012
|
}), dayEvents.map((event2) => {
|
|
3771
|
-
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day");
|
|
3772
|
-
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day");
|
|
3773
|
-
const
|
|
3774
|
-
const
|
|
3775
|
-
|
|
3776
|
-
const clampedEnd = eventEnd.isAfter(maxEnd) ? maxEnd : eventEnd;
|
|
3777
|
-
const startMinutes = (clampedStart.hour() - startHour) * 60 + clampedStart.minute();
|
|
3778
|
-
const durationMinutes = clampedEnd.diff(clampedStart, "minute");
|
|
3779
|
-
return /* @__PURE__ */ React30.createElement(
|
|
3013
|
+
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day").hour(0).minute(0);
|
|
3014
|
+
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day").hour(23).minute(59);
|
|
3015
|
+
const startMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
3016
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
3017
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3780
3018
|
CalendarEventCard,
|
|
3781
3019
|
{
|
|
3782
3020
|
key: `${event2.id}-${currentDate.toString()}`,
|
|
3783
3021
|
event: event2,
|
|
3784
3022
|
color: stateColors[event2.state],
|
|
3785
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2
|
|
3786
|
-
onHover: onEventHover,
|
|
3023
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2),
|
|
3787
3024
|
sx: {
|
|
3788
3025
|
position: "absolute",
|
|
3789
|
-
top: `${startMinutes}px`,
|
|
3790
|
-
height: `${durationMinutes}px`,
|
|
3026
|
+
top: `${startMinutes + 15}px`,
|
|
3791
3027
|
left: 4,
|
|
3792
3028
|
right: 4
|
|
3793
3029
|
}
|
|
@@ -3797,23 +3033,17 @@ var DayView = ({
|
|
|
3797
3033
|
};
|
|
3798
3034
|
|
|
3799
3035
|
// src/Components/Calendario/Calendar.tsx
|
|
3800
|
-
import dayjs7 from "dayjs";
|
|
3801
3036
|
var Calendar = ({
|
|
3802
3037
|
events,
|
|
3803
3038
|
onDayClick,
|
|
3804
3039
|
onMoreClick,
|
|
3805
3040
|
onEventClick,
|
|
3806
|
-
onEventHover,
|
|
3807
3041
|
view: initialView = "month",
|
|
3808
3042
|
onViewChange,
|
|
3809
|
-
toolbar
|
|
3810
|
-
isLoading = false,
|
|
3811
|
-
startHour = 0,
|
|
3812
|
-
// <- valor por defecto
|
|
3813
|
-
endHour = 23
|
|
3043
|
+
toolbar
|
|
3814
3044
|
}) => {
|
|
3815
|
-
const [view, setView] =
|
|
3816
|
-
const [currentDate, setCurrentDate] =
|
|
3045
|
+
const [view, setView] = useState12(initialView);
|
|
3046
|
+
const [currentDate, setCurrentDate] = useState12(dayjs7());
|
|
3817
3047
|
const handleViewChange = (newView) => {
|
|
3818
3048
|
setView(newView);
|
|
3819
3049
|
onViewChange == null ? void 0 : onViewChange(newView);
|
|
@@ -3821,18 +3051,12 @@ var Calendar = ({
|
|
|
3821
3051
|
const handleNavigate = (action) => {
|
|
3822
3052
|
let newDate = currentDate;
|
|
3823
3053
|
const unit = view === "month" ? "month" : "day";
|
|
3824
|
-
if (action === "PREV")
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
if (view === "month") newDate = currentDate.subtract(1, "month");
|
|
3828
|
-
} else if (action === "NEXT") {
|
|
3829
|
-
if (view === "day") newDate = currentDate.add(1, "day");
|
|
3830
|
-
if (view === "week") newDate = currentDate.add(1, "week");
|
|
3831
|
-
if (view === "month") newDate = currentDate.add(1, "month");
|
|
3832
|
-
} else if (action === "TODAY") newDate = dayjs7();
|
|
3054
|
+
if (action === "PREV") newDate = currentDate.subtract(1, unit);
|
|
3055
|
+
else if (action === "NEXT") newDate = currentDate.add(1, unit);
|
|
3056
|
+
else if (action === "TODAY") newDate = dayjs7();
|
|
3833
3057
|
setCurrentDate(newDate);
|
|
3834
3058
|
};
|
|
3835
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ React24.createElement(Box19, null, /* @__PURE__ */ React24.createElement(
|
|
3836
3060
|
CalendarToolbar,
|
|
3837
3061
|
{
|
|
3838
3062
|
labelDate: currentDate,
|
|
@@ -3841,280 +3065,39 @@ var Calendar = ({
|
|
|
3841
3065
|
onNavigate: handleNavigate
|
|
3842
3066
|
},
|
|
3843
3067
|
toolbar
|
|
3844
|
-
),
|
|
3845
|
-
Box20,
|
|
3846
|
-
{
|
|
3847
|
-
display: "flex",
|
|
3848
|
-
justifyContent: "center",
|
|
3849
|
-
alignItems: "center",
|
|
3850
|
-
height: "400px"
|
|
3851
|
-
},
|
|
3852
|
-
/* @__PURE__ */ React31.createElement(CircularProgress5, { variant: "indeterminate" })
|
|
3853
|
-
))) : /* @__PURE__ */ React31.createElement(React31.Fragment, null, view === "month" && /* @__PURE__ */ React31.createElement(
|
|
3068
|
+
), view === "month" && /* @__PURE__ */ React24.createElement(
|
|
3854
3069
|
MonthView,
|
|
3855
3070
|
{
|
|
3856
3071
|
events,
|
|
3857
|
-
currentDate,
|
|
3858
3072
|
onDayClick,
|
|
3859
3073
|
onMoreClick,
|
|
3860
3074
|
onEventClick,
|
|
3861
|
-
|
|
3075
|
+
currentDate
|
|
3862
3076
|
}
|
|
3863
|
-
), view === "week" && /* @__PURE__ */
|
|
3077
|
+
), view === "week" && /* @__PURE__ */ React24.createElement(
|
|
3864
3078
|
WeekView,
|
|
3865
3079
|
{
|
|
3866
3080
|
events,
|
|
3867
3081
|
currentDate,
|
|
3868
3082
|
onDayClick,
|
|
3869
3083
|
onMoreClick,
|
|
3870
|
-
onEventClick
|
|
3871
|
-
onEventHover,
|
|
3872
|
-
startHour,
|
|
3873
|
-
endHour
|
|
3084
|
+
onEventClick
|
|
3874
3085
|
}
|
|
3875
|
-
), view === "day" && /* @__PURE__ */
|
|
3086
|
+
), view === "day" && /* @__PURE__ */ React24.createElement(
|
|
3876
3087
|
DayView,
|
|
3877
3088
|
{
|
|
3878
3089
|
events,
|
|
3879
3090
|
currentDate,
|
|
3880
|
-
onEventClick
|
|
3881
|
-
onEventHover,
|
|
3882
|
-
startHour,
|
|
3883
|
-
endHour
|
|
3884
|
-
}
|
|
3885
|
-
)));
|
|
3886
|
-
};
|
|
3887
|
-
|
|
3888
|
-
// src/Components/SCTime.tsx
|
|
3889
|
-
import React32, { useState as useState14 } from "react";
|
|
3890
|
-
import { Box as Box21, InputAdornment as InputAdornment6, Popover as Popover5, ClickAwayListener } from "@mui/material";
|
|
3891
|
-
import { LocalizationProvider as LocalizationProvider3 } from "@mui/x-date-pickers/LocalizationProvider";
|
|
3892
|
-
import { AdapterDayjs as AdapterDayjs2 } from "@mui/x-date-pickers/AdapterDayjs";
|
|
3893
|
-
import dayjs8 from "dayjs";
|
|
3894
|
-
import "dayjs/locale/es";
|
|
3895
|
-
import { LicenseInfo as LicenseInfo3 } from "@mui/x-license-pro";
|
|
3896
|
-
import AccessTimeIcon from "@mui/icons-material/AccessTime";
|
|
3897
|
-
import { TimeField } from "@mui/x-date-pickers/TimeField";
|
|
3898
|
-
import { DigitalClock } from "@mui/x-date-pickers/DigitalClock";
|
|
3899
|
-
var SCTime = ({
|
|
3900
|
-
label = "Hora",
|
|
3901
|
-
required = false,
|
|
3902
|
-
disabled = false,
|
|
3903
|
-
background = "transparent",
|
|
3904
|
-
timeStep = 5,
|
|
3905
|
-
state,
|
|
3906
|
-
setState
|
|
3907
|
-
}) => {
|
|
3908
|
-
LicenseInfo3.setLicenseKey(
|
|
3909
|
-
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
3910
|
-
);
|
|
3911
|
-
const isTimeEmpty = required && !state;
|
|
3912
|
-
const hasError = isTimeEmpty;
|
|
3913
|
-
const [anchorEl, setAnchorEl] = useState14(null);
|
|
3914
|
-
const [isOpenPopover, setIsOpenPopover] = useState14(false);
|
|
3915
|
-
const [popoverPlacement, setPopoverPlacement] = useState14("bottom");
|
|
3916
|
-
const detectPlacement = (element) => {
|
|
3917
|
-
const rect = element.getBoundingClientRect();
|
|
3918
|
-
const windowHeight = window.innerHeight;
|
|
3919
|
-
const spaceBelow = windowHeight - rect.bottom;
|
|
3920
|
-
const spaceAbove = rect.top;
|
|
3921
|
-
const popoverHeight = 300;
|
|
3922
|
-
if (spaceBelow < popoverHeight && spaceAbove > spaceBelow) {
|
|
3923
|
-
setPopoverPlacement("top");
|
|
3924
|
-
} else {
|
|
3925
|
-
setPopoverPlacement("bottom");
|
|
3926
|
-
}
|
|
3927
|
-
};
|
|
3928
|
-
const handleTimeFieldClick = (event2) => {
|
|
3929
|
-
if (!disabled) {
|
|
3930
|
-
const target = event2.currentTarget;
|
|
3931
|
-
setAnchorEl(target);
|
|
3932
|
-
detectPlacement(target);
|
|
3933
|
-
setIsOpenPopover(true);
|
|
3934
|
-
}
|
|
3935
|
-
};
|
|
3936
|
-
const handleTimeChange = (newValue) => {
|
|
3937
|
-
const dayjsValue = newValue ? dayjs8(newValue) : null;
|
|
3938
|
-
setState(dayjsValue);
|
|
3939
|
-
setIsOpenPopover(false);
|
|
3940
|
-
setAnchorEl(null);
|
|
3941
|
-
};
|
|
3942
|
-
const handleClose = () => {
|
|
3943
|
-
setIsOpenPopover(false);
|
|
3944
|
-
setAnchorEl(null);
|
|
3945
|
-
};
|
|
3946
|
-
return /* @__PURE__ */ React32.createElement(LocalizationProvider3, { dateAdapter: AdapterDayjs2 }, /* @__PURE__ */ React32.createElement(Box21, { sx: { position: "relative", width: "120px" } }, /* @__PURE__ */ React32.createElement(
|
|
3947
|
-
TimeField,
|
|
3948
|
-
{
|
|
3949
|
-
label,
|
|
3950
|
-
value: state,
|
|
3951
|
-
disabled,
|
|
3952
|
-
required,
|
|
3953
|
-
error: hasError,
|
|
3954
|
-
onClick: handleTimeFieldClick,
|
|
3955
|
-
slotProps: {
|
|
3956
|
-
textField: {
|
|
3957
|
-
InputProps: {
|
|
3958
|
-
endAdornment: /* @__PURE__ */ React32.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React32.createElement(
|
|
3959
|
-
AccessTimeIcon,
|
|
3960
|
-
{
|
|
3961
|
-
color: disabled ? "disabled" : "action",
|
|
3962
|
-
sx: { cursor: disabled ? "default" : "pointer" },
|
|
3963
|
-
fontSize: "small"
|
|
3964
|
-
}
|
|
3965
|
-
)),
|
|
3966
|
-
sx: {
|
|
3967
|
-
backgroundColor: background,
|
|
3968
|
-
padding: "8px 12px",
|
|
3969
|
-
cursor: disabled ? "default" : "pointer",
|
|
3970
|
-
"& input": {
|
|
3971
|
-
cursor: disabled ? "default" : "pointer"
|
|
3972
|
-
}
|
|
3973
|
-
}
|
|
3974
|
-
}
|
|
3975
|
-
}
|
|
3976
|
-
},
|
|
3977
|
-
sx: {
|
|
3978
|
-
width: "100%",
|
|
3979
|
-
"& .MuiInputBase-input": {
|
|
3980
|
-
cursor: disabled ? "default" : "pointer"
|
|
3981
|
-
},
|
|
3982
|
-
"& .MuiPickersSectionList-root": {
|
|
3983
|
-
padding: "0px !important"
|
|
3984
|
-
}
|
|
3985
|
-
}
|
|
3986
|
-
}
|
|
3987
|
-
), /* @__PURE__ */ React32.createElement(
|
|
3988
|
-
Popover5,
|
|
3989
|
-
{
|
|
3990
|
-
open: isOpenPopover,
|
|
3991
|
-
anchorEl,
|
|
3992
|
-
onClose: handleClose,
|
|
3993
|
-
anchorOrigin: {
|
|
3994
|
-
vertical: popoverPlacement === "top" ? "top" : "bottom",
|
|
3995
|
-
horizontal: "left"
|
|
3996
|
-
},
|
|
3997
|
-
transformOrigin: {
|
|
3998
|
-
vertical: popoverPlacement === "top" ? "bottom" : "top",
|
|
3999
|
-
horizontal: "left"
|
|
4000
|
-
},
|
|
4001
|
-
marginThreshold: 0,
|
|
4002
|
-
disableScrollLock: true,
|
|
4003
|
-
slotProps: {
|
|
4004
|
-
paper: {
|
|
4005
|
-
sx: {
|
|
4006
|
-
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.1)",
|
|
4007
|
-
borderRadius: 1,
|
|
4008
|
-
border: "1px solid #e0e0e0",
|
|
4009
|
-
maxHeight: "300px",
|
|
4010
|
-
overflow: "visible"
|
|
4011
|
-
}
|
|
4012
|
-
}
|
|
4013
|
-
}
|
|
4014
|
-
},
|
|
4015
|
-
/* @__PURE__ */ React32.createElement(ClickAwayListener, { onClickAway: handleClose }, /* @__PURE__ */ React32.createElement(Box21, { sx: { p: 0 } }, /* @__PURE__ */ React32.createElement(
|
|
4016
|
-
DigitalClock,
|
|
4017
|
-
{
|
|
4018
|
-
value: state,
|
|
4019
|
-
onChange: handleTimeChange,
|
|
4020
|
-
timeStep,
|
|
4021
|
-
sx: {
|
|
4022
|
-
"& .MuiList-root": {
|
|
4023
|
-
maxHeight: "250px",
|
|
4024
|
-
overflow: "auto"
|
|
4025
|
-
},
|
|
4026
|
-
"& .MuiMenuItem-root": {
|
|
4027
|
-
fontSize: "0.875rem",
|
|
4028
|
-
py: 0.5
|
|
4029
|
-
}
|
|
4030
|
-
}
|
|
4031
|
-
}
|
|
4032
|
-
)))
|
|
4033
|
-
)));
|
|
4034
|
-
};
|
|
4035
|
-
|
|
4036
|
-
// src/Components/SCCard.tsx
|
|
4037
|
-
import React33 from "react";
|
|
4038
|
-
import { Button as Button12, Box as Box22, SvgIcon as SvgIcon8 } from "@mui/material";
|
|
4039
|
-
import IconButton12 from "@mui/material/IconButton";
|
|
4040
|
-
import Card from "@mui/material/Card";
|
|
4041
|
-
import CardHeader from "@mui/material/CardHeader";
|
|
4042
|
-
import CardMedia from "@mui/material/CardMedia";
|
|
4043
|
-
import CardContent from "@mui/material/CardContent";
|
|
4044
|
-
import CardActions from "@mui/material/CardActions";
|
|
4045
|
-
import Collapse from "@mui/material/Collapse";
|
|
4046
|
-
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4047
|
-
import * as Muicon8 from "@mui/icons-material";
|
|
4048
|
-
var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, actions, expand }) => {
|
|
4049
|
-
let iconTitleValidation = "";
|
|
4050
|
-
let IconTitle;
|
|
4051
|
-
const [expanded, setExpanded] = React33.useState(false);
|
|
4052
|
-
if (iconTitle) {
|
|
4053
|
-
if (Muicon8[iconTitle] == void 0) {
|
|
4054
|
-
if (iconTitle && React33.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
4055
|
-
iconTitleValidation = "image";
|
|
4056
|
-
IconTitle = iconTitle;
|
|
4057
|
-
} else {
|
|
4058
|
-
iconTitleValidation = "icon";
|
|
4059
|
-
IconTitle = iconTitle;
|
|
4060
|
-
}
|
|
4061
|
-
} else {
|
|
4062
|
-
iconTitleValidation = "icon";
|
|
4063
|
-
IconTitle = Muicon8[iconTitle];
|
|
4064
|
-
}
|
|
4065
|
-
}
|
|
4066
|
-
const handleExpandClick = () => {
|
|
4067
|
-
setExpanded(!expanded);
|
|
4068
|
-
};
|
|
4069
|
-
return /* @__PURE__ */ React33.createElement(Card, { sx: { maxWidth: 345 } }, title && /* @__PURE__ */ React33.createElement(
|
|
4070
|
-
CardHeader,
|
|
4071
|
-
{
|
|
4072
|
-
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ React33.createElement(Box22, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React33.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React33.createElement(SvgIcon8, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
4073
|
-
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ React33.createElement(Button12, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ React33.createElement(IconButton12, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ React33.createElement(ExpandMoreIcon, { fontSize: "small" })) : actionsTitle,
|
|
4074
|
-
title,
|
|
4075
|
-
subheader: subtitle,
|
|
4076
|
-
sx: {
|
|
4077
|
-
"& .MuiCardHeader-title": {
|
|
4078
|
-
fontSize: "14px",
|
|
4079
|
-
color: "text.primary"
|
|
4080
|
-
},
|
|
4081
|
-
"& .MuiCardHeader-subheader": {
|
|
4082
|
-
fontSize: "13px",
|
|
4083
|
-
color: "text.secondary"
|
|
4084
|
-
},
|
|
4085
|
-
"& .MuiCardHeader-action": {
|
|
4086
|
-
height: "40px !important",
|
|
4087
|
-
display: "flex",
|
|
4088
|
-
alignItems: "center"
|
|
4089
|
-
}
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
|
-
), image && /* @__PURE__ */ React33.createElement(
|
|
4093
|
-
CardMedia,
|
|
4094
|
-
{
|
|
4095
|
-
component: "img",
|
|
4096
|
-
height: "194",
|
|
4097
|
-
image
|
|
3091
|
+
onEventClick
|
|
4098
3092
|
}
|
|
4099
|
-
)
|
|
4100
|
-
Button12,
|
|
4101
|
-
{
|
|
4102
|
-
key: index,
|
|
4103
|
-
size: "small",
|
|
4104
|
-
color: action.color || "primary",
|
|
4105
|
-
variant: action.variant || "text",
|
|
4106
|
-
onClick: action.fn,
|
|
4107
|
-
disabled: action.disabled || false
|
|
4108
|
-
},
|
|
4109
|
-
action.text
|
|
4110
|
-
)) : ""), expand && /* @__PURE__ */ React33.createElement(Collapse, { in: expanded, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React33.createElement(CardContent, { sx: { padding: "8px 16px !important" } }, expand.content)));
|
|
3093
|
+
));
|
|
4111
3094
|
};
|
|
4112
3095
|
|
|
4113
3096
|
// src/Theme/index.ts
|
|
4114
3097
|
import { createTheme } from "@mui/material/styles";
|
|
4115
3098
|
|
|
4116
3099
|
// src/Theme/components.ts
|
|
4117
|
-
import
|
|
3100
|
+
import React25 from "react";
|
|
4118
3101
|
import {
|
|
4119
3102
|
InfoRounded as InfoRounded2,
|
|
4120
3103
|
CheckCircleRounded as CheckCircleRounded2,
|
|
@@ -4817,10 +3800,10 @@ var components = {
|
|
|
4817
3800
|
MuiAlert: {
|
|
4818
3801
|
defaultProps: {
|
|
4819
3802
|
iconMapping: {
|
|
4820
|
-
success:
|
|
4821
|
-
error:
|
|
4822
|
-
warning:
|
|
4823
|
-
info:
|
|
3803
|
+
success: React25.createElement(CheckCircleRounded2),
|
|
3804
|
+
error: React25.createElement(ErrorRounded2),
|
|
3805
|
+
warning: React25.createElement(WarningRounded2),
|
|
3806
|
+
info: React25.createElement(InfoRounded2)
|
|
4824
3807
|
}
|
|
4825
3808
|
},
|
|
4826
3809
|
variants: [
|
|
@@ -5861,7 +4844,6 @@ var ADCSincoTheme = createTheme(__spreadValues({}, ADCTheme));
|
|
|
5861
4844
|
export {
|
|
5862
4845
|
ADCSincoTheme,
|
|
5863
4846
|
AdproSincoTheme,
|
|
5864
|
-
Attachment,
|
|
5865
4847
|
Calendar,
|
|
5866
4848
|
EmptyState,
|
|
5867
4849
|
FooterAction,
|
|
@@ -5869,7 +4851,6 @@ export {
|
|
|
5869
4851
|
PageHeader,
|
|
5870
4852
|
SCAutocomplete,
|
|
5871
4853
|
SCCalendarSwipeable,
|
|
5872
|
-
SCCard,
|
|
5873
4854
|
SCDataGrid,
|
|
5874
4855
|
SCDataGridInitial,
|
|
5875
4856
|
SCDateRange,
|
|
@@ -5881,14 +4862,13 @@ export {
|
|
|
5881
4862
|
SCTabs,
|
|
5882
4863
|
SCTextArea,
|
|
5883
4864
|
SCTextField,
|
|
5884
|
-
SCTime,
|
|
5885
4865
|
SCToastNotification,
|
|
5886
4866
|
SincoTheme,
|
|
5887
4867
|
ToastProgress,
|
|
5888
4868
|
capitalize,
|
|
5889
4869
|
getButtonColor,
|
|
5890
4870
|
getIcon,
|
|
5891
|
-
getIconComponent,
|
|
4871
|
+
getIconComponent2 as getIconComponent,
|
|
5892
4872
|
getIconMultiSelect,
|
|
5893
4873
|
getModalColor,
|
|
5894
4874
|
modalStateConfig,
|