componentes-sinco 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2155 -949
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -14
- package/dist/index.d.ts +112 -14
- package/dist/index.js +2101 -900
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/create-KZGO2OZA.svg +0 -18
- package/dist/empty-3NEKE7WO.svg +0 -13
- package/dist/error-RUCZUXDN.svg +0 -5
- package/dist/search-OKSCVF2W.svg +0 -12
package/dist/index.cjs
CHANGED
|
@@ -55,37 +55,62 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
55
55
|
mod
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
var __async = (__this, __arguments, generator) => {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
var fulfilled = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
step(generator.next(value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var rejected = (value) => {
|
|
68
|
+
try {
|
|
69
|
+
step(generator.throw(value));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
reject(e);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
75
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
76
|
+
});
|
|
77
|
+
};
|
|
58
78
|
|
|
59
79
|
// src/index.ts
|
|
60
80
|
var src_exports = {};
|
|
61
81
|
__export(src_exports, {
|
|
62
82
|
ADCSincoTheme: () => ADCSincoTheme,
|
|
63
83
|
AdproSincoTheme: () => AdproSincoTheme,
|
|
84
|
+
Attachment: () => Attachment,
|
|
64
85
|
Calendar: () => Calendar,
|
|
65
86
|
EmptyState: () => EmptyState,
|
|
66
87
|
FooterAction: () => FooterAction,
|
|
67
88
|
MultiSelect: () => MultiSelect,
|
|
68
89
|
PageHeader: () => PageHeader,
|
|
90
|
+
SCActivityCalendar: () => SCActivityCalendar,
|
|
69
91
|
SCAutocomplete: () => SCAutocomplete,
|
|
70
92
|
SCCalendarSwipeable: () => SCCalendarSwipeable,
|
|
93
|
+
SCCard: () => SCCard,
|
|
71
94
|
SCDataGrid: () => SCDataGrid,
|
|
72
95
|
SCDataGridInitial: () => SCDataGridInitial,
|
|
73
96
|
SCDateRange: () => SCDateRange,
|
|
74
97
|
SCDialog: () => SCDialog,
|
|
75
98
|
SCDrawer: () => SCDrawer,
|
|
99
|
+
SCListContent: () => SCListContent,
|
|
76
100
|
SCMenu: () => SCMenu,
|
|
77
101
|
SCModal: () => SCModal,
|
|
78
102
|
SCSelect: () => SCSelect,
|
|
79
103
|
SCTabs: () => SCTabs,
|
|
80
104
|
SCTextArea: () => SCTextArea,
|
|
81
105
|
SCTextField: () => SCTextField,
|
|
106
|
+
SCTime: () => SCTime,
|
|
82
107
|
SCToastNotification: () => SCToastNotification,
|
|
83
108
|
SincoTheme: () => SincoTheme,
|
|
84
109
|
ToastProgress: () => ToastProgress,
|
|
85
110
|
capitalize: () => capitalize,
|
|
86
111
|
getButtonColor: () => getButtonColor,
|
|
87
112
|
getIcon: () => getIcon,
|
|
88
|
-
getIconComponent: () =>
|
|
113
|
+
getIconComponent: () => getIconComponent,
|
|
89
114
|
getIconMultiSelect: () => getIconMultiSelect,
|
|
90
115
|
getModalColor: () => getModalColor,
|
|
91
116
|
modalStateConfig: () => modalStateConfig,
|
|
@@ -95,21 +120,710 @@ __export(src_exports, {
|
|
|
95
120
|
});
|
|
96
121
|
module.exports = __toCommonJS(src_exports);
|
|
97
122
|
|
|
98
|
-
// src/Components/
|
|
99
|
-
var
|
|
100
|
-
var
|
|
123
|
+
// src/Components/Adjuntar/Adjuntar.tsx
|
|
124
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
125
|
+
var import_material3 = require("@mui/material");
|
|
126
|
+
var import_icons_material5 = require("@mui/icons-material");
|
|
127
|
+
|
|
128
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
129
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
130
|
+
var import_material = require("@mui/material");
|
|
131
|
+
var import_icons_material = require("@mui/icons-material");
|
|
132
|
+
|
|
133
|
+
// src/Components/ToastNotification/useProgress.ts
|
|
134
|
+
var import_react = require("react");
|
|
135
|
+
var useProgress = (timeProgress, lote) => {
|
|
136
|
+
const [progress, setProgress] = (0, import_react.useState)(0);
|
|
137
|
+
(0, import_react.useEffect)(() => {
|
|
138
|
+
const interval = setInterval(() => {
|
|
139
|
+
setProgress((prev) => {
|
|
140
|
+
if (prev >= 100) {
|
|
141
|
+
clearInterval(interval);
|
|
142
|
+
}
|
|
143
|
+
if (lote) {
|
|
144
|
+
const nextProgress = prev + lote;
|
|
145
|
+
return nextProgress <= 100 ? nextProgress : 100;
|
|
146
|
+
} else {
|
|
147
|
+
return prev + 1;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}, timeProgress * 10);
|
|
151
|
+
return () => {
|
|
152
|
+
clearInterval(interval);
|
|
153
|
+
};
|
|
154
|
+
}, [timeProgress, lote]);
|
|
155
|
+
return {
|
|
156
|
+
progress
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
var ToastProgress = (timeProgress) => {
|
|
160
|
+
const [progress, setProgress] = (0, import_react.useState)(100);
|
|
161
|
+
(0, import_react.useEffect)(() => {
|
|
162
|
+
const interval = setInterval(() => {
|
|
163
|
+
setProgress((prev) => {
|
|
164
|
+
if (prev <= 0) {
|
|
165
|
+
clearInterval(interval);
|
|
166
|
+
}
|
|
167
|
+
return prev - 1;
|
|
168
|
+
});
|
|
169
|
+
}, timeProgress * 10);
|
|
170
|
+
return () => {
|
|
171
|
+
clearInterval(interval);
|
|
172
|
+
};
|
|
173
|
+
}, [timeProgress]);
|
|
174
|
+
return {
|
|
175
|
+
progressToast: progress
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
180
|
+
var SCToastNotification = (toast) => {
|
|
181
|
+
var _a;
|
|
182
|
+
const [stateOptions, setStateOptions] = (0, import_react2.useState)(true);
|
|
183
|
+
const [stateToast, setStateToast] = (0, import_react2.useState)(true);
|
|
184
|
+
const timeProgress = toast.time || 10;
|
|
185
|
+
const { progress } = useProgress(timeProgress);
|
|
186
|
+
const toastColorConfig = toast.type || "info";
|
|
187
|
+
const toastIconOption = {
|
|
188
|
+
success: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.CheckCircleRounded, { color: "success" }),
|
|
189
|
+
error: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.ErrorRounded, { color: "error" }),
|
|
190
|
+
warning: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.WarningRounded, { color: "warning" }),
|
|
191
|
+
info: /* @__PURE__ */ import_react2.default.createElement(import_icons_material.InfoRounded, { color: "info" })
|
|
192
|
+
};
|
|
193
|
+
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
194
|
+
alert("");
|
|
195
|
+
} }, { text: "Consultar", fn: () => {
|
|
196
|
+
} }]];
|
|
197
|
+
const ToastIconConfig = toastIconOption[toast.type];
|
|
198
|
+
const closeToast = () => {
|
|
199
|
+
setStateToast(false);
|
|
200
|
+
};
|
|
201
|
+
const toggleToastOptions = () => {
|
|
202
|
+
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
203
|
+
};
|
|
204
|
+
(0, import_react2.useEffect)(() => {
|
|
205
|
+
progress >= 100 && setStateToast(false);
|
|
206
|
+
}, [progress]);
|
|
207
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, stateToast && /* @__PURE__ */ import_react2.default.createElement(
|
|
208
|
+
import_material.Stack,
|
|
209
|
+
{
|
|
210
|
+
position: "fixed",
|
|
211
|
+
zIndex: 1400,
|
|
212
|
+
right: 16,
|
|
213
|
+
top: 16,
|
|
214
|
+
width: 370,
|
|
215
|
+
sx: {
|
|
216
|
+
boxShadow: (theme) => theme.shadows[8]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
220
|
+
import_material.Box,
|
|
221
|
+
{
|
|
222
|
+
padding: 1.5,
|
|
223
|
+
gap: 1.5,
|
|
224
|
+
display: "flex",
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
sx: {
|
|
227
|
+
backgroundColor: {
|
|
228
|
+
success: "success.50",
|
|
229
|
+
error: "error.50",
|
|
230
|
+
warning: "warning.50",
|
|
231
|
+
info: "info.50"
|
|
232
|
+
}[toastColorConfig]
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
236
|
+
import_material.Stack,
|
|
237
|
+
{
|
|
238
|
+
p: 1,
|
|
239
|
+
gap: 1,
|
|
240
|
+
borderRadius: 50,
|
|
241
|
+
bgcolor: {
|
|
242
|
+
success: "success.100",
|
|
243
|
+
error: "error.100",
|
|
244
|
+
warning: "warning.100",
|
|
245
|
+
info: "info.100"
|
|
246
|
+
}[(_a = toast.type) != null ? _a : "info"]
|
|
247
|
+
},
|
|
248
|
+
/* @__PURE__ */ import_react2.default.createElement(import_material.Stack, null, ToastIconConfig)
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ import_react2.default.createElement(import_material.Divider, { orientation: "vertical", flexItem: true }),
|
|
251
|
+
/* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { width: 285 }, /* @__PURE__ */ import_react2.default.createElement(
|
|
252
|
+
import_material.Stack,
|
|
253
|
+
{
|
|
254
|
+
justifyContent: "space-between",
|
|
255
|
+
flexDirection: "row",
|
|
256
|
+
alignItems: "center"
|
|
257
|
+
},
|
|
258
|
+
/* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
259
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
260
|
+
import_material.IconButton,
|
|
261
|
+
{
|
|
262
|
+
size: "small",
|
|
263
|
+
"data-testid": "close-icon",
|
|
264
|
+
onClick: closeToast
|
|
265
|
+
},
|
|
266
|
+
/* @__PURE__ */ import_react2.default.createElement(import_icons_material.Close, { fontSize: "small" })
|
|
267
|
+
)
|
|
268
|
+
), /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ import_react2.default.createElement(import_material.Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ import_react2.default.createElement(import_material.Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ import_react2.default.createElement(
|
|
269
|
+
import_material.Button,
|
|
270
|
+
{
|
|
271
|
+
key: index,
|
|
272
|
+
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
273
|
+
variant: "text",
|
|
274
|
+
onClick: button.fn,
|
|
275
|
+
disabled: button.disabled || false,
|
|
276
|
+
size: "small"
|
|
277
|
+
},
|
|
278
|
+
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
279
|
+
))), toast.seeMore && /* @__PURE__ */ import_react2.default.createElement(
|
|
280
|
+
import_material.Button,
|
|
281
|
+
{
|
|
282
|
+
onClick: toggleToastOptions,
|
|
283
|
+
size: "small",
|
|
284
|
+
variant: "text",
|
|
285
|
+
color: toastColorConfig
|
|
286
|
+
},
|
|
287
|
+
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
288
|
+
stateOptions ? /* @__PURE__ */ import_react2.default.createElement(import_icons_material.KeyboardArrowDown, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons_material.KeyboardArrowUp, null)
|
|
289
|
+
)))
|
|
290
|
+
),
|
|
291
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
292
|
+
import_material.LinearProgress,
|
|
293
|
+
{
|
|
294
|
+
sx: {
|
|
295
|
+
".MuiLinearProgress-bar": {
|
|
296
|
+
transition: "0.1s linear !important",
|
|
297
|
+
transform: "scaleX(-1)"
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
color: toastColorConfig,
|
|
301
|
+
variant: "determinate",
|
|
302
|
+
value: 100 - progress
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
));
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
// src/Components/Modal/Helpers/Data.tsx
|
|
309
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
310
|
+
var import_icons_material2 = require("@mui/icons-material");
|
|
311
|
+
var modalStateConfig = {
|
|
312
|
+
info: {
|
|
313
|
+
color: "info",
|
|
314
|
+
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
315
|
+
icon: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.Info, { color: "info", fontSize: "medium" })
|
|
316
|
+
},
|
|
317
|
+
delete: {
|
|
318
|
+
color: "delete",
|
|
319
|
+
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
320
|
+
icon: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.Info, { color: "error", fontSize: "medium" })
|
|
321
|
+
},
|
|
322
|
+
warning: {
|
|
323
|
+
color: "warning",
|
|
324
|
+
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
325
|
+
icon: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.Warning, { color: "warning", fontSize: "medium" })
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/Components/Modal/Helpers/Utils.tsx
|
|
330
|
+
var MuiIcons = __toESM(require("@mui/icons-material"), 1);
|
|
331
|
+
var import_icons_material3 = require("@mui/icons-material");
|
|
332
|
+
var getIconComponent = (iconName) => {
|
|
333
|
+
return iconName && MuiIcons[iconName] ? MuiIcons[iconName] : import_icons_material3.FilterListOutlined;
|
|
334
|
+
};
|
|
335
|
+
var getModalColor = (state) => {
|
|
336
|
+
var _a;
|
|
337
|
+
const colors = {
|
|
338
|
+
info: "info.100",
|
|
339
|
+
delete: "error.100",
|
|
340
|
+
warning: "warning.100"
|
|
341
|
+
};
|
|
342
|
+
return (_a = colors[state]) != null ? _a : "warning.100";
|
|
343
|
+
};
|
|
344
|
+
var getButtonColor = (state) => {
|
|
345
|
+
var _a;
|
|
346
|
+
const colorMap = {
|
|
347
|
+
info: "info",
|
|
348
|
+
delete: "error",
|
|
349
|
+
warning: "warning"
|
|
350
|
+
};
|
|
351
|
+
return (_a = colorMap[state]) != null ? _a : "info";
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// src/Components/Modal/SCModal.tsx
|
|
355
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
356
|
+
var import_material2 = require("@mui/material");
|
|
357
|
+
var import_icons_material4 = require("@mui/icons-material");
|
|
358
|
+
|
|
359
|
+
// src/generales/capitalize.tsx
|
|
360
|
+
function capitalize(text) {
|
|
361
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/Components/Modal/SCModal.tsx
|
|
365
|
+
var SCModal = ({
|
|
366
|
+
buttonModal,
|
|
367
|
+
state = "info",
|
|
368
|
+
open,
|
|
369
|
+
setOpen,
|
|
370
|
+
title,
|
|
371
|
+
description,
|
|
372
|
+
action
|
|
373
|
+
}) => {
|
|
374
|
+
var _a, _b, _c, _d, _e;
|
|
375
|
+
const [internalOpen, setInternalOpen] = (0, import_react4.useState)(open != null ? open : false);
|
|
376
|
+
const isControlled = Boolean(setOpen);
|
|
377
|
+
const modalOpen = isControlled ? open != null ? open : false : internalOpen;
|
|
378
|
+
const setModalOpen = isControlled ? setOpen : setInternalOpen;
|
|
379
|
+
const handleToggle = (0, import_react4.useCallback)(() => setModalOpen((prev) => !prev), [setModalOpen]);
|
|
380
|
+
const handleClose = (0, import_react4.useCallback)(() => setModalOpen(false), [setModalOpen]);
|
|
381
|
+
const Icon = (0, import_react4.useMemo)(() => getIconComponent(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
382
|
+
const prevAction = (0, import_react4.useMemo)(
|
|
383
|
+
() => action != null ? action : [
|
|
384
|
+
{ text: "Cancelar", fn: handleClose },
|
|
385
|
+
{ text: "Consultar", fn: () => {
|
|
386
|
+
} }
|
|
387
|
+
],
|
|
388
|
+
[action, handleClose]
|
|
389
|
+
);
|
|
390
|
+
const { icon, defaultDescription } = modalStateConfig[state];
|
|
391
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, buttonModal && /* @__PURE__ */ import_react4.default.createElement(
|
|
392
|
+
import_material2.Button,
|
|
393
|
+
{
|
|
394
|
+
"data-testid": "test-buttonModal",
|
|
395
|
+
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
396
|
+
onClick: handleToggle,
|
|
397
|
+
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
398
|
+
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
399
|
+
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ import_react4.default.createElement(Icon, null),
|
|
400
|
+
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ import_react4.default.createElement(Icon, null)
|
|
401
|
+
},
|
|
402
|
+
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
403
|
+
), /* @__PURE__ */ import_react4.default.createElement(import_material2.Modal, { open: modalOpen, onClose: handleClose, sx: { boxShadow: 8 } }, /* @__PURE__ */ import_react4.default.createElement(
|
|
404
|
+
import_material2.Box,
|
|
405
|
+
{
|
|
406
|
+
sx: {
|
|
407
|
+
position: "absolute",
|
|
408
|
+
top: "50%",
|
|
409
|
+
left: "50%",
|
|
410
|
+
transform: "translate(-50%, -50%)",
|
|
411
|
+
width: 400,
|
|
412
|
+
bgcolor: "background.paper",
|
|
413
|
+
borderRadius: 1,
|
|
414
|
+
boxShadow: 24
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
/* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ import_react4.default.createElement(
|
|
418
|
+
import_material2.Box,
|
|
419
|
+
{
|
|
420
|
+
display: "flex",
|
|
421
|
+
justifyContent: "center",
|
|
422
|
+
alignItems: "center",
|
|
423
|
+
borderRadius: "50%",
|
|
424
|
+
height: 36,
|
|
425
|
+
width: 36,
|
|
426
|
+
bgcolor: getModalColor(state)
|
|
427
|
+
},
|
|
428
|
+
icon
|
|
429
|
+
), /* @__PURE__ */ import_react4.default.createElement(import_material2.Typography, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ import_react4.default.createElement(import_material2.IconButton, { onClick: handleClose, "data-testid": "test-buttonClose" }, /* @__PURE__ */ import_react4.default.createElement(import_icons_material4.Close, { color: "action" }))),
|
|
430
|
+
/* @__PURE__ */ import_react4.default.createElement(import_material2.Stack, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ import_react4.default.createElement(import_material2.Typography, { variant: "body1" }, description || defaultDescription)),
|
|
431
|
+
action && /* @__PURE__ */ import_react4.default.createElement(
|
|
432
|
+
import_material2.Stack,
|
|
433
|
+
{
|
|
434
|
+
id: "Action",
|
|
435
|
+
direction: "row",
|
|
436
|
+
gap: 1,
|
|
437
|
+
p: 1,
|
|
438
|
+
justifyContent: "end",
|
|
439
|
+
bgcolor: "grey.50",
|
|
440
|
+
sx: { borderRadius: 1 }
|
|
441
|
+
},
|
|
442
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
443
|
+
import_material2.Button,
|
|
444
|
+
{
|
|
445
|
+
color: "inherit",
|
|
446
|
+
variant: "text",
|
|
447
|
+
onClick: handleClose,
|
|
448
|
+
size: "small"
|
|
449
|
+
},
|
|
450
|
+
capitalize("cancelar")
|
|
451
|
+
),
|
|
452
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
|
453
|
+
import_material2.Button,
|
|
454
|
+
{
|
|
455
|
+
"data-testid": "test-aceptar",
|
|
456
|
+
color: getButtonColor(state),
|
|
457
|
+
variant: "contained",
|
|
458
|
+
onClick: (_e = action[0]) == null ? void 0 : _e.fn,
|
|
459
|
+
disabled: false,
|
|
460
|
+
size: "small"
|
|
461
|
+
},
|
|
462
|
+
capitalize(action[0].text)
|
|
463
|
+
)
|
|
464
|
+
)
|
|
465
|
+
)));
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
// src/Components/Adjuntar/Adjuntar.tsx
|
|
469
|
+
var Attachment = ({
|
|
470
|
+
sx,
|
|
471
|
+
compact,
|
|
472
|
+
error,
|
|
473
|
+
maxSize = 400,
|
|
474
|
+
fileAccepted = "",
|
|
475
|
+
onLoading,
|
|
476
|
+
onChange,
|
|
477
|
+
downloadAction,
|
|
478
|
+
deleteAction,
|
|
479
|
+
initialFiles = []
|
|
480
|
+
}) => {
|
|
481
|
+
const [files, setFiles] = (0, import_react5.useState)([]);
|
|
482
|
+
const [fileToDelete, setFileToDelete] = (0, import_react5.useState)(null);
|
|
483
|
+
const [toast, setToast] = (0, import_react5.useState)(null);
|
|
484
|
+
const [openModal, setOpenModal] = (0, import_react5.useState)(false);
|
|
485
|
+
const [isDragFile, setIsDragFile] = (0, import_react5.useState)(false);
|
|
486
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
487
|
+
(0, import_react5.useEffect)(() => {
|
|
488
|
+
if (initialFiles && initialFiles.length > 0) {
|
|
489
|
+
setFiles(initialFiles);
|
|
490
|
+
}
|
|
491
|
+
}, []);
|
|
492
|
+
const handleDrop = (event2) => {
|
|
493
|
+
event2.preventDefault();
|
|
494
|
+
setIsDragFile(false);
|
|
495
|
+
const filesDropped = event2.dataTransfer.files;
|
|
496
|
+
if (filesDropped && filesDropped.length > 0) {
|
|
497
|
+
const fakeEvent = {
|
|
498
|
+
target: { files: filesDropped }
|
|
499
|
+
};
|
|
500
|
+
handleUpload(fakeEvent);
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
const handleDragOver = (event2) => {
|
|
504
|
+
event2.preventDefault();
|
|
505
|
+
setIsDragFile(true);
|
|
506
|
+
};
|
|
507
|
+
const handleDragLeave = (event2) => {
|
|
508
|
+
event2.preventDefault();
|
|
509
|
+
setIsDragFile(false);
|
|
510
|
+
};
|
|
511
|
+
const handleUpload = (event2) => {
|
|
512
|
+
const newFiles = event2.target.files;
|
|
513
|
+
if (!newFiles) return;
|
|
514
|
+
const nuevosArchivos = [];
|
|
515
|
+
const archivosValidos = [];
|
|
516
|
+
Array.from(newFiles).forEach((file) => {
|
|
517
|
+
const isDuplicatedFile = files.findIndex(
|
|
518
|
+
(e) => e.name === file.name && e.size === file.size
|
|
519
|
+
);
|
|
520
|
+
const sizeMB = file.size / (1024 * 1024);
|
|
521
|
+
if (isDuplicatedFile !== -1) {
|
|
522
|
+
setToast({
|
|
523
|
+
type: "error",
|
|
524
|
+
title: "Archivo duplicado",
|
|
525
|
+
listITems: ["No se permiten archivos duplicados."],
|
|
526
|
+
seeMore: true,
|
|
527
|
+
time: 10
|
|
528
|
+
});
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
if (sizeMB > maxSize) {
|
|
532
|
+
nuevosArchivos.push({
|
|
533
|
+
name: file.name,
|
|
534
|
+
size: file.size,
|
|
535
|
+
type: file.type,
|
|
536
|
+
progress: 0,
|
|
537
|
+
uploadError: true
|
|
538
|
+
});
|
|
539
|
+
setToast({
|
|
540
|
+
type: "error",
|
|
541
|
+
title: "Carga fallida",
|
|
542
|
+
seeMore: true,
|
|
543
|
+
listITems: [`El archivo supera el l\xEDmite de ${maxSize}MB.`],
|
|
544
|
+
time: 10
|
|
545
|
+
});
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (fileAccepted && !file.name.match(
|
|
549
|
+
new RegExp(
|
|
550
|
+
`(${fileAccepted.replace(/\./g, "\\.").replace(/,/g, "|")})$`,
|
|
551
|
+
"i"
|
|
552
|
+
)
|
|
553
|
+
)) {
|
|
554
|
+
setToast({
|
|
555
|
+
type: "error",
|
|
556
|
+
title: "Tipo de archivo no permitido",
|
|
557
|
+
listITems: [`El archivo ${file.name} no es un tipo permitido.`],
|
|
558
|
+
seeMore: true,
|
|
559
|
+
time: 10
|
|
560
|
+
});
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
nuevosArchivos.push({
|
|
564
|
+
name: file.name,
|
|
565
|
+
size: file.size,
|
|
566
|
+
type: file.type,
|
|
567
|
+
progress: 0,
|
|
568
|
+
uploadError: false
|
|
569
|
+
});
|
|
570
|
+
archivosValidos.push(file);
|
|
571
|
+
});
|
|
572
|
+
if (nuevosArchivos.length > 0) {
|
|
573
|
+
setFiles((prev) => {
|
|
574
|
+
const actualizados = [...prev, ...nuevosArchivos];
|
|
575
|
+
onChange == null ? void 0 : onChange([
|
|
576
|
+
...archivosValidos,
|
|
577
|
+
...prev.map((f) => new File([], f.name, { type: f.type }))
|
|
578
|
+
]);
|
|
579
|
+
return actualizados;
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
event2.target.value = "";
|
|
583
|
+
};
|
|
584
|
+
const deleteFiles = (nameFile) => {
|
|
585
|
+
setFiles((prev) => {
|
|
586
|
+
const filtered = prev.filter((e) => e.name !== nameFile);
|
|
587
|
+
onChange == null ? void 0 : onChange(
|
|
588
|
+
filtered.map((f) => new File([], f.name, { type: f.type }))
|
|
589
|
+
);
|
|
590
|
+
return filtered;
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_material3.Stack, { spacing: 2 }, toast && /* @__PURE__ */ import_react5.default.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ import_react5.default.createElement(
|
|
594
|
+
"input",
|
|
595
|
+
{
|
|
596
|
+
type: "file",
|
|
597
|
+
multiple: true,
|
|
598
|
+
hidden: true,
|
|
599
|
+
ref: inputRef,
|
|
600
|
+
onChange: handleUpload
|
|
601
|
+
}
|
|
602
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
603
|
+
import_material3.Stack,
|
|
604
|
+
{
|
|
605
|
+
id: "ZonaAdjuntos",
|
|
606
|
+
justifyContent: "center",
|
|
607
|
+
alignItems: "center",
|
|
608
|
+
bgcolor: "transparent",
|
|
609
|
+
padding: compact ? "12px 16px" : "16px 24px",
|
|
610
|
+
height: compact ? "56px" : "100%",
|
|
611
|
+
flexDirection: compact ? "row" : "column",
|
|
612
|
+
gap: 1,
|
|
613
|
+
borderRadius: 1,
|
|
614
|
+
onClick: () => {
|
|
615
|
+
var _a;
|
|
616
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
617
|
+
},
|
|
618
|
+
onDrop: handleDrop,
|
|
619
|
+
onDragOver: handleDragOver,
|
|
620
|
+
onDragLeave: handleDragLeave,
|
|
621
|
+
sx: __spreadValues({
|
|
622
|
+
border: error ? (theme) => `1px solid ${theme.palette.error.main}` : (theme) => `1px dashed ${theme.palette.grey[500]}`,
|
|
623
|
+
cursor: "pointer",
|
|
624
|
+
":hover": {
|
|
625
|
+
backgroundColor: error ? "error.50" : "action.hover"
|
|
626
|
+
}
|
|
627
|
+
}, sx)
|
|
628
|
+
},
|
|
629
|
+
onLoading ? /* @__PURE__ */ import_react5.default.createElement(
|
|
630
|
+
import_material3.Box,
|
|
631
|
+
{
|
|
632
|
+
display: "flex",
|
|
633
|
+
alignItems: "center",
|
|
634
|
+
justifyContent: "center",
|
|
635
|
+
width: "100%",
|
|
636
|
+
height: "450px"
|
|
637
|
+
},
|
|
638
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
639
|
+
import_material3.CircularProgress,
|
|
640
|
+
{
|
|
641
|
+
sx: { width: "60px", height: "60px" },
|
|
642
|
+
variant: "indeterminate"
|
|
643
|
+
}
|
|
644
|
+
)
|
|
645
|
+
) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(
|
|
646
|
+
import_material3.Box,
|
|
647
|
+
{
|
|
648
|
+
display: "flex",
|
|
649
|
+
bgcolor: error ? "error.50" : "primary.50",
|
|
650
|
+
borderRadius: "100%",
|
|
651
|
+
p: 1
|
|
652
|
+
},
|
|
653
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
654
|
+
import_icons_material5.CloudUploadOutlined,
|
|
655
|
+
{
|
|
656
|
+
color: error ? "error" : "primary",
|
|
657
|
+
fontSize: "medium"
|
|
658
|
+
}
|
|
659
|
+
)
|
|
660
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
661
|
+
import_material3.Stack,
|
|
662
|
+
{
|
|
663
|
+
width: "100%",
|
|
664
|
+
flexDirection: compact ? "row" : "column",
|
|
665
|
+
alignItems: "center",
|
|
666
|
+
justifyContent: compact ? "space-between" : "center",
|
|
667
|
+
gap: 1
|
|
668
|
+
},
|
|
669
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
670
|
+
import_material3.Stack,
|
|
671
|
+
{
|
|
672
|
+
flexDirection: "column",
|
|
673
|
+
alignItems: compact ? "start" : "center",
|
|
674
|
+
gap: 0.5
|
|
675
|
+
},
|
|
676
|
+
/* @__PURE__ */ import_react5.default.createElement(import_material3.Typography, { variant: "body2", color: "text.primary" }, "Arrastrar o adjuntar archivos"),
|
|
677
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
678
|
+
import_material3.Typography,
|
|
679
|
+
{
|
|
680
|
+
variant: "caption",
|
|
681
|
+
color: error ? "error" : "text.secondary",
|
|
682
|
+
whiteSpace: "nowrap",
|
|
683
|
+
overflow: "hidden",
|
|
684
|
+
textOverflow: "ellipsis",
|
|
685
|
+
maxWidth: "450px"
|
|
686
|
+
},
|
|
687
|
+
error ? `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Archivo no soportado` : `${fileAccepted || "DOCX, XML, PNG, JPG"} \u2022 Max. ${maxSize}MB`
|
|
688
|
+
)
|
|
689
|
+
),
|
|
690
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
691
|
+
import_material3.Button,
|
|
692
|
+
{
|
|
693
|
+
variant: "text",
|
|
694
|
+
color: "primary",
|
|
695
|
+
size: "small",
|
|
696
|
+
startIcon: /* @__PURE__ */ import_react5.default.createElement(import_icons_material5.AttachFileOutlined, { color: "primary", fontSize: "small" })
|
|
697
|
+
},
|
|
698
|
+
"Adjuntar"
|
|
699
|
+
)
|
|
700
|
+
))
|
|
701
|
+
), files.length > 0 && /* @__PURE__ */ import_react5.default.createElement(
|
|
702
|
+
import_material3.Stack,
|
|
703
|
+
{
|
|
704
|
+
id: "ContenedorArchivosAdjuntos",
|
|
705
|
+
width: "100%",
|
|
706
|
+
sx: __spreadValues({
|
|
707
|
+
overflowY: "auto"
|
|
708
|
+
}, files.length > 5 && {
|
|
709
|
+
maxHeight: 250
|
|
710
|
+
}),
|
|
711
|
+
spacing: 1
|
|
712
|
+
},
|
|
713
|
+
files.map((file) => /* @__PURE__ */ import_react5.default.createElement(
|
|
714
|
+
import_material3.Stack,
|
|
715
|
+
{
|
|
716
|
+
height: 46,
|
|
717
|
+
key: file.name + (file.uploadError ? "_error" : ""),
|
|
718
|
+
direction: "row",
|
|
719
|
+
alignItems: "center",
|
|
720
|
+
justifyContent: "space-between",
|
|
721
|
+
gap: 2,
|
|
722
|
+
padding: 1,
|
|
723
|
+
borderRadius: 1,
|
|
724
|
+
sx: {
|
|
725
|
+
backgroundColor: file.uploadError ? "error.50" : "transparent",
|
|
726
|
+
":hover": {
|
|
727
|
+
backgroundColor: file.uploadError ? "error.100" : "primary.50"
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
/* @__PURE__ */ import_react5.default.createElement(import_material3.Stack, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ import_react5.default.createElement(
|
|
732
|
+
import_icons_material5.UploadFileOutlined,
|
|
733
|
+
{
|
|
734
|
+
color: file.uploadError ? "error" : "primary",
|
|
735
|
+
fontSize: "small"
|
|
736
|
+
}
|
|
737
|
+
), /* @__PURE__ */ import_react5.default.createElement(import_material3.Stack, { width: "100%" }, /* @__PURE__ */ import_react5.default.createElement(
|
|
738
|
+
import_material3.Typography,
|
|
739
|
+
{
|
|
740
|
+
variant: "body2",
|
|
741
|
+
color: "text.primary",
|
|
742
|
+
whiteSpace: "nowrap",
|
|
743
|
+
overflow: "hidden",
|
|
744
|
+
textOverflow: "ellipsis",
|
|
745
|
+
maxWidth: "310px"
|
|
746
|
+
},
|
|
747
|
+
file.name
|
|
748
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
749
|
+
import_material3.Typography,
|
|
750
|
+
{
|
|
751
|
+
variant: "caption",
|
|
752
|
+
color: file.uploadError ? "error" : "text.secondary"
|
|
753
|
+
},
|
|
754
|
+
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}`
|
|
755
|
+
))),
|
|
756
|
+
/* @__PURE__ */ import_react5.default.createElement(import_material3.Tooltip, { title: "Descargar" }, /* @__PURE__ */ import_react5.default.createElement(import_material3.IconButton, { size: "small", onClick: () => downloadAction == null ? void 0 : downloadAction(file.name) }, /* @__PURE__ */ import_react5.default.createElement(import_icons_material5.FileDownload, { fontSize: "small", color: "action" }))),
|
|
757
|
+
/* @__PURE__ */ import_react5.default.createElement(import_material3.Tooltip, { title: "Eliminar" }, /* @__PURE__ */ import_react5.default.createElement(
|
|
758
|
+
import_material3.IconButton,
|
|
759
|
+
{
|
|
760
|
+
size: "small",
|
|
761
|
+
onClick: () => {
|
|
762
|
+
setFileToDelete(file);
|
|
763
|
+
setOpenModal(true);
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
/* @__PURE__ */ import_react5.default.createElement(import_icons_material5.DeleteOutline, { fontSize: "small", color: "action" })
|
|
767
|
+
))
|
|
768
|
+
))
|
|
769
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
770
|
+
SCModal,
|
|
771
|
+
{
|
|
772
|
+
state: "delete",
|
|
773
|
+
open: openModal,
|
|
774
|
+
setOpen: setOpenModal,
|
|
775
|
+
title: "Eliminar archivo",
|
|
776
|
+
description: `\xBFEst\xE1s seguro que deseas eliminar "${fileToDelete == null ? void 0 : fileToDelete.name}"?`,
|
|
777
|
+
action: [
|
|
778
|
+
{
|
|
779
|
+
text: "Eliminar",
|
|
780
|
+
fn: () => __async(void 0, null, function* () {
|
|
781
|
+
if (fileToDelete) {
|
|
782
|
+
try {
|
|
783
|
+
if (deleteAction) {
|
|
784
|
+
yield deleteAction(fileToDelete.name);
|
|
785
|
+
}
|
|
786
|
+
deleteFiles(fileToDelete.name);
|
|
787
|
+
setToast({
|
|
788
|
+
title: "Archivo eliminado",
|
|
789
|
+
type: "success",
|
|
790
|
+
time: 2
|
|
791
|
+
});
|
|
792
|
+
} catch (error2) {
|
|
793
|
+
setToast({
|
|
794
|
+
title: "Error al eliminar archivo",
|
|
795
|
+
type: "error",
|
|
796
|
+
time: 2
|
|
797
|
+
});
|
|
798
|
+
} finally {
|
|
799
|
+
setFileToDelete(null);
|
|
800
|
+
setOpenModal(false);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
})
|
|
804
|
+
}
|
|
805
|
+
]
|
|
806
|
+
}
|
|
807
|
+
));
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// src/Components/Drawer/SCDrawer.tsx
|
|
811
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
812
|
+
var import_material9 = require("@mui/material");
|
|
101
813
|
var import_Grid23 = __toESM(require("@mui/material/Grid2"), 1);
|
|
102
814
|
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
815
|
+
var import_ArrowBackIos = __toESM(require("@mui/icons-material/ArrowBackIos"), 1);
|
|
816
|
+
var import_ArrowForwardIos = __toESM(require("@mui/icons-material/ArrowForwardIos"), 1);
|
|
103
817
|
|
|
104
818
|
// src/Components/Textfield/SCTextField.tsx
|
|
105
|
-
var
|
|
106
|
-
var
|
|
819
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
820
|
+
var import_material4 = require("@mui/material");
|
|
107
821
|
var import_Grid2 = __toESM(require("@mui/material/Grid2"), 1);
|
|
108
|
-
var
|
|
822
|
+
var import_icons_material6 = require("@mui/icons-material");
|
|
109
823
|
|
|
110
824
|
// src/Components/Textfield/Helpers/validateIcon.tsx
|
|
111
825
|
var Muicon = __toESM(require("@mui/icons-material"), 1);
|
|
112
|
-
function
|
|
826
|
+
function getIconComponent2(name) {
|
|
113
827
|
if (typeof name !== "string") return name;
|
|
114
828
|
return name in Muicon ? Muicon[name] : void 0;
|
|
115
829
|
}
|
|
@@ -121,13 +835,13 @@ function getIconValidation(name) {
|
|
|
121
835
|
}
|
|
122
836
|
|
|
123
837
|
// src/Components/Textfield/Helpers/validateKeyDown.tsx
|
|
124
|
-
function validateKeyDown(event2,
|
|
838
|
+
function validateKeyDown(event2, format3) {
|
|
125
839
|
const key = event2.key;
|
|
126
840
|
const target = event2.target;
|
|
127
|
-
if (
|
|
841
|
+
if (format3 === "int" && !/^[0-9]$/.test(key)) {
|
|
128
842
|
event2.preventDefault();
|
|
129
843
|
}
|
|
130
|
-
if (
|
|
844
|
+
if (format3 === "decimal" && (target.value === "" && key === "." || key === "-" || key === "+")) {
|
|
131
845
|
event2.preventDefault();
|
|
132
846
|
}
|
|
133
847
|
if (target.type === "text") {
|
|
@@ -166,7 +880,7 @@ var SCTextField = ({
|
|
|
166
880
|
maxLength,
|
|
167
881
|
//Apariencia
|
|
168
882
|
variant = "outlined",
|
|
169
|
-
format:
|
|
883
|
+
format: format3,
|
|
170
884
|
disabled,
|
|
171
885
|
required,
|
|
172
886
|
size,
|
|
@@ -181,23 +895,23 @@ var SCTextField = ({
|
|
|
181
895
|
onKeyDown
|
|
182
896
|
}) => {
|
|
183
897
|
const inputComponents = {
|
|
184
|
-
outlined:
|
|
185
|
-
filled:
|
|
186
|
-
standard:
|
|
898
|
+
outlined: import_material4.OutlinedInput,
|
|
899
|
+
filled: import_material4.FilledInput,
|
|
900
|
+
standard: import_material4.Input
|
|
187
901
|
};
|
|
188
|
-
const InputComponent = inputComponents[variant] ||
|
|
902
|
+
const InputComponent = inputComponents[variant] || import_material4.OutlinedInput;
|
|
189
903
|
let IconInputStartValidation;
|
|
190
904
|
let IconInputEndValidation;
|
|
191
905
|
let IconInputStart;
|
|
192
906
|
let IconInputEnd;
|
|
193
907
|
let IconTitle;
|
|
194
|
-
const [showPassword, setShowPassword] = (0,
|
|
195
|
-
const [error, setError] = (0,
|
|
196
|
-
const [anchorInfoTitle, setAnchorInfoTitle] = (0,
|
|
908
|
+
const [showPassword, setShowPassword] = (0, import_react6.useState)(false);
|
|
909
|
+
const [error, setError] = (0, import_react6.useState)(false);
|
|
910
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = (0, import_react6.useState)(null);
|
|
197
911
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
198
|
-
const [anchorInfoElement, setAnchorInfoElement] = (0,
|
|
912
|
+
const [anchorInfoElement, setAnchorInfoElement] = (0, import_react6.useState)(null);
|
|
199
913
|
const openInfoElement = Boolean(anchorInfoElement);
|
|
200
|
-
(0,
|
|
914
|
+
(0, import_react6.useEffect)(() => {
|
|
201
915
|
if (error) {
|
|
202
916
|
setTimeout(() => {
|
|
203
917
|
setError(false);
|
|
@@ -206,21 +920,21 @@ var SCTextField = ({
|
|
|
206
920
|
}, [error]);
|
|
207
921
|
if (iconInputStart) {
|
|
208
922
|
IconInputStartValidation = getIconValidation(iconInputStart);
|
|
209
|
-
IconInputStart =
|
|
923
|
+
IconInputStart = getIconComponent2(iconInputStart);
|
|
210
924
|
}
|
|
211
925
|
if (iconInputEnd) {
|
|
212
926
|
IconInputEndValidation = getIconValidation(iconInputEnd);
|
|
213
|
-
IconInputEnd =
|
|
927
|
+
IconInputEnd = getIconComponent2(iconInputEnd);
|
|
214
928
|
}
|
|
215
929
|
if (iconTitle) {
|
|
216
|
-
IconTitle =
|
|
930
|
+
IconTitle = getIconComponent2(iconTitle);
|
|
217
931
|
}
|
|
218
932
|
const handleClickShowPassword = () => setShowPassword((show) => !show);
|
|
219
933
|
const handleMouseDownPassword = (event2) => {
|
|
220
934
|
event2.preventDefault();
|
|
221
935
|
};
|
|
222
936
|
const handleKeyDown = (event2) => {
|
|
223
|
-
validateKeyDown(event2,
|
|
937
|
+
validateKeyDown(event2, format3);
|
|
224
938
|
if (onKeyDown) onKeyDown(event2);
|
|
225
939
|
};
|
|
226
940
|
const handleInputChange = (event2) => {
|
|
@@ -247,16 +961,16 @@ var SCTextField = ({
|
|
|
247
961
|
const handleCloseInfoElement = () => {
|
|
248
962
|
setAnchorInfoElement(null);
|
|
249
963
|
};
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
|
|
964
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_material4.Box, { sx: { width } }, /* @__PURE__ */ import_react6.default.createElement(import_Grid2.default, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ import_react6.default.createElement(import_material4.SvgIcon, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ import_react6.default.createElement(import_material4.Typography, { mx: 0.5, variant: "subtitle2", color: "text.secondary" }, title) : "", infoTitle ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
|
965
|
+
import_icons_material6.InfoOutlined,
|
|
252
966
|
{
|
|
253
967
|
color: "action",
|
|
254
968
|
fontSize: "small",
|
|
255
969
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
256
970
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
257
971
|
}
|
|
258
|
-
), /* @__PURE__ */
|
|
259
|
-
|
|
972
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
973
|
+
import_material4.Popover,
|
|
260
974
|
{
|
|
261
975
|
sx: {
|
|
262
976
|
pointerEvents: "none",
|
|
@@ -277,15 +991,15 @@ var SCTextField = ({
|
|
|
277
991
|
},
|
|
278
992
|
disableRestoreFocus: true
|
|
279
993
|
},
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
)) : /* @__PURE__ */
|
|
282
|
-
|
|
994
|
+
/* @__PURE__ */ import_react6.default.createElement(import_material4.Typography, { p: 2 }, infoTitle.text)
|
|
995
|
+
)) : /* @__PURE__ */ import_react6.default.createElement(import_material4.Tooltip, { title: infoTitle.text, "data-testid": "test-infoTitle", placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
996
|
+
import_icons_material6.InfoOutlined,
|
|
283
997
|
{
|
|
284
998
|
color: "action",
|
|
285
999
|
fontSize: "small"
|
|
286
1000
|
}
|
|
287
|
-
))) : ""), /* @__PURE__ */
|
|
288
|
-
|
|
1001
|
+
))) : ""), /* @__PURE__ */ import_react6.default.createElement(import_Grid2.default, { container: true, sx: { flexWrap: "nowrap", alignItems: "center" } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1002
|
+
import_material4.FormControl,
|
|
289
1003
|
{
|
|
290
1004
|
color,
|
|
291
1005
|
fullWidth: true,
|
|
@@ -293,8 +1007,8 @@ var SCTextField = ({
|
|
|
293
1007
|
variant,
|
|
294
1008
|
sx: { background: background || "transparent", borderRadius: "4px" }
|
|
295
1009
|
},
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
|
|
1010
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1011
|
+
import_material4.InputLabel,
|
|
298
1012
|
{
|
|
299
1013
|
"data-testid": "test-label",
|
|
300
1014
|
htmlFor: "",
|
|
@@ -304,7 +1018,7 @@ var SCTextField = ({
|
|
|
304
1018
|
},
|
|
305
1019
|
label ? label : ""
|
|
306
1020
|
),
|
|
307
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
308
1022
|
InputComponent,
|
|
309
1023
|
{
|
|
310
1024
|
size: size ? size : "medium",
|
|
@@ -317,21 +1031,21 @@ var SCTextField = ({
|
|
|
317
1031
|
onChange: handleInputChange,
|
|
318
1032
|
onBlur: handleBlur,
|
|
319
1033
|
inputProps: { maxLength: maxLength ? maxLength : 50 },
|
|
320
|
-
type: !showPassword &&
|
|
321
|
-
className:
|
|
1034
|
+
type: !showPassword && format3 === "password" ? "password" : (format3 || "text").toUpperCase() === "INT" || (format3 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
|
|
1035
|
+
className: format3 === "password" && !showPassword ? "" : "",
|
|
322
1036
|
placeholder,
|
|
323
|
-
startAdornment: iconInputStart ? /* @__PURE__ */
|
|
324
|
-
endAdornment: /* @__PURE__ */
|
|
325
|
-
|
|
1037
|
+
startAdornment: iconInputStart ? /* @__PURE__ */ import_react6.default.createElement(import_material4.InputAdornment, { position: "start" }, IconInputStartValidation === "text" ? iconInputStart : IconInputStart ? /* @__PURE__ */ import_react6.default.createElement(IconInputStart, { fontSize: "small" }) : null) : "",
|
|
1038
|
+
endAdornment: /* @__PURE__ */ import_react6.default.createElement(import_material4.InputAdornment, { position: "end" }, format3 === "password" ? /* @__PURE__ */ import_react6.default.createElement(
|
|
1039
|
+
import_material4.IconButton,
|
|
326
1040
|
{
|
|
327
1041
|
"aria-label": "toggle password visibility",
|
|
328
1042
|
onClick: handleClickShowPassword,
|
|
329
1043
|
onMouseDown: handleMouseDownPassword,
|
|
330
1044
|
edge: "end"
|
|
331
1045
|
},
|
|
332
|
-
showPassword ? /* @__PURE__ */
|
|
333
|
-
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */
|
|
334
|
-
|
|
1046
|
+
showPassword ? /* @__PURE__ */ import_react6.default.createElement(import_icons_material6.VisibilityOff, null) : /* @__PURE__ */ import_react6.default.createElement(import_icons_material6.Visibility, null)
|
|
1047
|
+
) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
|
1048
|
+
import_icons_material6.InfoOutlined,
|
|
335
1049
|
{
|
|
336
1050
|
"data-testid": "test-infoElement",
|
|
337
1051
|
sx: { ml: 0.5 },
|
|
@@ -341,8 +1055,8 @@ var SCTextField = ({
|
|
|
341
1055
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
342
1056
|
onMouseLeave: () => handleCloseInfoElement()
|
|
343
1057
|
}
|
|
344
|
-
), /* @__PURE__ */
|
|
345
|
-
|
|
1058
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
1059
|
+
import_material4.Popover,
|
|
346
1060
|
{
|
|
347
1061
|
sx: {
|
|
348
1062
|
pointerEvents: "none",
|
|
@@ -363,20 +1077,20 @@ var SCTextField = ({
|
|
|
363
1077
|
},
|
|
364
1078
|
disableRestoreFocus: true
|
|
365
1079
|
},
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
)) : /* @__PURE__ */
|
|
368
|
-
|
|
1080
|
+
/* @__PURE__ */ import_react6.default.createElement(import_material4.Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
1081
|
+
)) : /* @__PURE__ */ import_react6.default.createElement(import_material4.Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1082
|
+
import_icons_material6.InfoOutlined,
|
|
369
1083
|
{
|
|
370
1084
|
color: "action",
|
|
371
1085
|
fontSize: "small"
|
|
372
1086
|
}
|
|
373
|
-
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */
|
|
374
|
-
label: label ? label + (
|
|
375
|
-
autoComplete:
|
|
1087
|
+
))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */ import_react6.default.createElement(IconInputEnd, { fontSize: "small" }) : null : ""),
|
|
1088
|
+
label: label ? label + (format3 === "password" && !showPassword ? "" : "") : "",
|
|
1089
|
+
autoComplete: format3 === "password" ? "new-password" : "off"
|
|
376
1090
|
}
|
|
377
1091
|
)
|
|
378
|
-
), (iconInputEnd !== void 0 ||
|
|
379
|
-
|
|
1092
|
+
), (iconInputEnd !== void 0 || format3 === "password") && infoElement ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
|
1093
|
+
import_icons_material6.InfoOutlined,
|
|
380
1094
|
{
|
|
381
1095
|
"data-testid": "test-infoElement",
|
|
382
1096
|
component: "svg",
|
|
@@ -386,8 +1100,8 @@ var SCTextField = ({
|
|
|
386
1100
|
onMouseEnter: (event2) => handleOpenInfoElement(event2),
|
|
387
1101
|
onMouseLeave: handleCloseInfoElement
|
|
388
1102
|
}
|
|
389
|
-
), /* @__PURE__ */
|
|
390
|
-
|
|
1103
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
1104
|
+
import_material4.Popover,
|
|
391
1105
|
{
|
|
392
1106
|
sx: { pointerEvents: "none" },
|
|
393
1107
|
open: openInfoElement,
|
|
@@ -403,9 +1117,9 @@ var SCTextField = ({
|
|
|
403
1117
|
},
|
|
404
1118
|
disableRestoreFocus: true
|
|
405
1119
|
},
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
)) : /* @__PURE__ */
|
|
408
|
-
|
|
1120
|
+
/* @__PURE__ */ import_react6.default.createElement(import_material4.Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
|
|
1121
|
+
)) : /* @__PURE__ */ import_react6.default.createElement(import_material4.Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1122
|
+
import_icons_material6.InfoOutlined,
|
|
409
1123
|
{
|
|
410
1124
|
sx: { marginLeft: "4px" },
|
|
411
1125
|
color: "action",
|
|
@@ -414,199 +1128,19 @@ var SCTextField = ({
|
|
|
414
1128
|
))) : ""));
|
|
415
1129
|
};
|
|
416
1130
|
|
|
417
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
418
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
419
|
-
var import_material2 = require("@mui/material");
|
|
420
|
-
var import_icons_material2 = require("@mui/icons-material");
|
|
421
|
-
|
|
422
|
-
// src/Components/ToastNotification/useProgress.ts
|
|
423
|
-
var import_react2 = require("react");
|
|
424
|
-
var useProgress = (timeProgress, lote) => {
|
|
425
|
-
const [progress, setProgress] = (0, import_react2.useState)(0);
|
|
426
|
-
(0, import_react2.useEffect)(() => {
|
|
427
|
-
const interval = setInterval(() => {
|
|
428
|
-
setProgress((prev) => {
|
|
429
|
-
if (prev >= 100) {
|
|
430
|
-
clearInterval(interval);
|
|
431
|
-
}
|
|
432
|
-
if (lote) {
|
|
433
|
-
const nextProgress = prev + lote;
|
|
434
|
-
return nextProgress <= 100 ? nextProgress : 100;
|
|
435
|
-
} else {
|
|
436
|
-
return prev + 1;
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
}, timeProgress * 10);
|
|
440
|
-
return () => {
|
|
441
|
-
clearInterval(interval);
|
|
442
|
-
};
|
|
443
|
-
}, [timeProgress, lote]);
|
|
444
|
-
return {
|
|
445
|
-
progress
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
var ToastProgress = (timeProgress) => {
|
|
449
|
-
const [progress, setProgress] = (0, import_react2.useState)(100);
|
|
450
|
-
(0, import_react2.useEffect)(() => {
|
|
451
|
-
const interval = setInterval(() => {
|
|
452
|
-
setProgress((prev) => {
|
|
453
|
-
if (prev <= 0) {
|
|
454
|
-
clearInterval(interval);
|
|
455
|
-
}
|
|
456
|
-
return prev - 1;
|
|
457
|
-
});
|
|
458
|
-
}, timeProgress * 10);
|
|
459
|
-
return () => {
|
|
460
|
-
clearInterval(interval);
|
|
461
|
-
};
|
|
462
|
-
}, [timeProgress]);
|
|
463
|
-
return {
|
|
464
|
-
progressToast: progress
|
|
465
|
-
};
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
// src/Components/ToastNotification/SCToastNotification.tsx
|
|
469
|
-
var SCToastNotification = (toast) => {
|
|
470
|
-
var _a;
|
|
471
|
-
const [stateOptions, setStateOptions] = (0, import_react3.useState)(true);
|
|
472
|
-
const [stateToast, setStateToast] = (0, import_react3.useState)(true);
|
|
473
|
-
const timeProgress = toast.time || 10;
|
|
474
|
-
const { progress } = useProgress(timeProgress);
|
|
475
|
-
const toastColorConfig = toast.type || "info";
|
|
476
|
-
const toastIconOption = {
|
|
477
|
-
success: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.CheckCircleRounded, { color: "success" }),
|
|
478
|
-
error: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.ErrorRounded, { color: "error" }),
|
|
479
|
-
warning: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.WarningRounded, { color: "warning" }),
|
|
480
|
-
info: /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.InfoRounded, { color: "info" })
|
|
481
|
-
};
|
|
482
|
-
const acciones = [...toast.actions || [{ text: "Action", fn: () => {
|
|
483
|
-
alert("");
|
|
484
|
-
} }, { text: "Consultar", fn: () => {
|
|
485
|
-
} }]];
|
|
486
|
-
const ToastIconConfig = toastIconOption[toast.type];
|
|
487
|
-
const closeToast = () => {
|
|
488
|
-
setStateToast(false);
|
|
489
|
-
};
|
|
490
|
-
const toggleToastOptions = () => {
|
|
491
|
-
setStateOptions((prevShowOptions) => !prevShowOptions);
|
|
492
|
-
};
|
|
493
|
-
(0, import_react3.useEffect)(() => {
|
|
494
|
-
progress >= 100 && setStateToast(false);
|
|
495
|
-
}, [progress]);
|
|
496
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, stateToast && /* @__PURE__ */ import_react3.default.createElement(
|
|
497
|
-
import_material2.Stack,
|
|
498
|
-
{
|
|
499
|
-
position: "fixed",
|
|
500
|
-
zIndex: 1400,
|
|
501
|
-
right: 16,
|
|
502
|
-
top: 16,
|
|
503
|
-
width: 370,
|
|
504
|
-
sx: {
|
|
505
|
-
boxShadow: (theme) => theme.shadows[8]
|
|
506
|
-
}
|
|
507
|
-
},
|
|
508
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
|
509
|
-
import_material2.Box,
|
|
510
|
-
{
|
|
511
|
-
padding: 1.5,
|
|
512
|
-
gap: 1.5,
|
|
513
|
-
display: "flex",
|
|
514
|
-
alignItems: "center",
|
|
515
|
-
sx: {
|
|
516
|
-
backgroundColor: {
|
|
517
|
-
success: "success.50",
|
|
518
|
-
error: "error.50",
|
|
519
|
-
warning: "warning.50",
|
|
520
|
-
info: "info.50"
|
|
521
|
-
}[toastColorConfig]
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
|
525
|
-
import_material2.Stack,
|
|
526
|
-
{
|
|
527
|
-
p: 1,
|
|
528
|
-
gap: 1,
|
|
529
|
-
borderRadius: 50,
|
|
530
|
-
bgcolor: {
|
|
531
|
-
success: "success.100",
|
|
532
|
-
error: "error.100",
|
|
533
|
-
warning: "warning.100",
|
|
534
|
-
info: "info.100"
|
|
535
|
-
}[(_a = toast.type) != null ? _a : "info"]
|
|
536
|
-
},
|
|
537
|
-
/* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, null, ToastIconConfig)
|
|
538
|
-
),
|
|
539
|
-
/* @__PURE__ */ import_react3.default.createElement(import_material2.Divider, { orientation: "vertical", flexItem: true }),
|
|
540
|
-
/* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, { width: 285 }, /* @__PURE__ */ import_react3.default.createElement(
|
|
541
|
-
import_material2.Stack,
|
|
542
|
-
{
|
|
543
|
-
justifyContent: "space-between",
|
|
544
|
-
flexDirection: "row",
|
|
545
|
-
alignItems: "center"
|
|
546
|
-
},
|
|
547
|
-
/* @__PURE__ */ import_react3.default.createElement(import_material2.Typography, { variant: "subtitle2", color: "text.primary" }, toast.title),
|
|
548
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
|
549
|
-
import_material2.IconButton,
|
|
550
|
-
{
|
|
551
|
-
size: "small",
|
|
552
|
-
"data-testid": "close-icon",
|
|
553
|
-
onClick: closeToast
|
|
554
|
-
},
|
|
555
|
-
/* @__PURE__ */ import_react3.default.createElement(import_icons_material2.Close, { fontSize: "small" })
|
|
556
|
-
)
|
|
557
|
-
), /* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react3.default.createElement(import_material2.Typography, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ import_react3.default.createElement(import_material2.Typography, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ import_react3.default.createElement(import_material2.Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ import_react3.default.createElement(
|
|
558
|
-
import_material2.Button,
|
|
559
|
-
{
|
|
560
|
-
key: index,
|
|
561
|
-
color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
|
|
562
|
-
variant: "text",
|
|
563
|
-
onClick: button.fn,
|
|
564
|
-
disabled: button.disabled || false,
|
|
565
|
-
size: "small"
|
|
566
|
-
},
|
|
567
|
-
button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
|
|
568
|
-
))), toast.seeMore && /* @__PURE__ */ import_react3.default.createElement(
|
|
569
|
-
import_material2.Button,
|
|
570
|
-
{
|
|
571
|
-
onClick: toggleToastOptions,
|
|
572
|
-
size: "small",
|
|
573
|
-
variant: "text",
|
|
574
|
-
color: toastColorConfig
|
|
575
|
-
},
|
|
576
|
-
stateOptions ? "Ver m\xE1s" : "Ver menos",
|
|
577
|
-
stateOptions ? /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.KeyboardArrowDown, null) : /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.KeyboardArrowUp, null)
|
|
578
|
-
)))
|
|
579
|
-
),
|
|
580
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
|
581
|
-
import_material2.LinearProgress,
|
|
582
|
-
{
|
|
583
|
-
sx: {
|
|
584
|
-
".MuiLinearProgress-bar": {
|
|
585
|
-
transition: "0.1s linear !important",
|
|
586
|
-
transform: "scaleX(-1)"
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
color: toastColorConfig,
|
|
590
|
-
variant: "determinate",
|
|
591
|
-
value: 100 - progress
|
|
592
|
-
}
|
|
593
|
-
)
|
|
594
|
-
));
|
|
595
|
-
};
|
|
596
|
-
|
|
597
1131
|
// src/Components/TextArea/Helpers/validateIcon.tsx
|
|
598
|
-
var
|
|
1132
|
+
var MuiIcons2 = __toESM(require("@mui/icons-material"), 1);
|
|
599
1133
|
function getIcon(name) {
|
|
600
|
-
if (!name || !(name in
|
|
1134
|
+
if (!name || !(name in MuiIcons2)) {
|
|
601
1135
|
return null;
|
|
602
1136
|
}
|
|
603
|
-
return
|
|
1137
|
+
return MuiIcons2[name];
|
|
604
1138
|
}
|
|
605
1139
|
|
|
606
1140
|
// src/Components/TextArea/SCTextArea.tsx
|
|
607
|
-
var
|
|
608
|
-
var
|
|
609
|
-
var
|
|
1141
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
1142
|
+
var import_material5 = require("@mui/material");
|
|
1143
|
+
var import_icons_material7 = require("@mui/icons-material");
|
|
610
1144
|
var SCTextArea = ({
|
|
611
1145
|
//informativas
|
|
612
1146
|
title,
|
|
@@ -628,11 +1162,11 @@ var SCTextArea = ({
|
|
|
628
1162
|
state,
|
|
629
1163
|
onBlur
|
|
630
1164
|
}) => {
|
|
631
|
-
const [helperCount, setHelperCount] = (0,
|
|
632
|
-
const [stateError, setStateError] = (0,
|
|
633
|
-
const [anchorInfoTitle, setAnchorInfoTitle] =
|
|
1165
|
+
const [helperCount, setHelperCount] = (0, import_react7.useState)(0);
|
|
1166
|
+
const [stateError, setStateError] = (0, import_react7.useState)(false);
|
|
1167
|
+
const [anchorInfoTitle, setAnchorInfoTitle] = import_react7.default.useState(null);
|
|
634
1168
|
const openInfoTitle = Boolean(anchorInfoTitle);
|
|
635
|
-
(0,
|
|
1169
|
+
(0, import_react7.useEffect)(() => {
|
|
636
1170
|
setHelperCount(state == null ? void 0 : state.length);
|
|
637
1171
|
}, [state]);
|
|
638
1172
|
const IconTitle = getIcon(iconTitle);
|
|
@@ -654,16 +1188,16 @@ var SCTextArea = ({
|
|
|
654
1188
|
const handleCloseInfoTitle = () => {
|
|
655
1189
|
setAnchorInfoTitle(null);
|
|
656
1190
|
};
|
|
657
|
-
return /* @__PURE__ */
|
|
658
|
-
|
|
1191
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(import_material5.Box, { sx: { width } }, /* @__PURE__ */ import_react7.default.createElement(import_material5.Grid, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ import_react7.default.createElement(import_material5.SvgIcon, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ import_react7.default.createElement(import_material5.Typography, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(
|
|
1192
|
+
import_icons_material7.InfoOutlined,
|
|
659
1193
|
{
|
|
660
1194
|
color: "action",
|
|
661
1195
|
fontSize: "small",
|
|
662
1196
|
onMouseEnter: (event2) => handleOpenInfoTitle(event2),
|
|
663
1197
|
onMouseLeave: () => handleCloseInfoTitle()
|
|
664
1198
|
}
|
|
665
|
-
), /* @__PURE__ */
|
|
666
|
-
|
|
1199
|
+
), /* @__PURE__ */ import_react7.default.createElement(
|
|
1200
|
+
import_material5.Popover,
|
|
667
1201
|
{
|
|
668
1202
|
sx: { pointerEvents: "none" },
|
|
669
1203
|
open: openInfoTitle,
|
|
@@ -679,15 +1213,15 @@ var SCTextArea = ({
|
|
|
679
1213
|
},
|
|
680
1214
|
disableRestoreFocus: true
|
|
681
1215
|
},
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
)) : /* @__PURE__ */
|
|
684
|
-
|
|
1216
|
+
/* @__PURE__ */ import_react7.default.createElement(import_material5.Typography, { sx: { p: 2 } }, infoTitle.text)
|
|
1217
|
+
)) : /* @__PURE__ */ import_react7.default.createElement(import_material5.Tooltip, { title: infoTitle.text, placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
1218
|
+
import_icons_material7.InfoOutlined,
|
|
685
1219
|
{
|
|
686
1220
|
color: "action",
|
|
687
1221
|
fontSize: "small"
|
|
688
1222
|
}
|
|
689
|
-
))) : ""), /* @__PURE__ */
|
|
690
|
-
|
|
1223
|
+
))) : ""), /* @__PURE__ */ import_react7.default.createElement(import_material5.Stack, null, /* @__PURE__ */ import_react7.default.createElement(
|
|
1224
|
+
import_material5.TextField,
|
|
691
1225
|
{
|
|
692
1226
|
required,
|
|
693
1227
|
placeholder,
|
|
@@ -708,8 +1242,8 @@ var SCTextArea = ({
|
|
|
708
1242
|
},
|
|
709
1243
|
autoComplete: "off"
|
|
710
1244
|
}
|
|
711
|
-
)), /* @__PURE__ */
|
|
712
|
-
|
|
1245
|
+
)), /* @__PURE__ */ import_react7.default.createElement(import_material5.Stack, null, /* @__PURE__ */ import_react7.default.createElement(
|
|
1246
|
+
import_material5.Typography,
|
|
713
1247
|
{
|
|
714
1248
|
variant: "caption",
|
|
715
1249
|
color: "text.secondary",
|
|
@@ -722,8 +1256,8 @@ var SCTextArea = ({
|
|
|
722
1256
|
};
|
|
723
1257
|
|
|
724
1258
|
// src/Components/SCSelect.tsx
|
|
725
|
-
var
|
|
726
|
-
var
|
|
1259
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
1260
|
+
var import_material6 = require("@mui/material");
|
|
727
1261
|
var import_Select = __toESM(require("@mui/material/Select"), 1);
|
|
728
1262
|
var Muicon2 = __toESM(require("@mui/icons-material"), 1);
|
|
729
1263
|
function SCSelect({
|
|
@@ -733,25 +1267,23 @@ function SCSelect({
|
|
|
733
1267
|
width = "100%",
|
|
734
1268
|
size = "small",
|
|
735
1269
|
variant = "outlined",
|
|
736
|
-
|
|
1270
|
+
background = "white",
|
|
737
1271
|
required,
|
|
738
1272
|
disabled,
|
|
739
|
-
background,
|
|
740
|
-
fnAplicar,
|
|
741
1273
|
setState,
|
|
742
1274
|
state
|
|
743
1275
|
}) {
|
|
744
1276
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
745
|
-
const [prevData, setPrevData] =
|
|
746
|
-
const [error, setError] =
|
|
747
|
-
(0,
|
|
1277
|
+
const [prevData, setPrevData] = import_react8.default.useState(data);
|
|
1278
|
+
const [error, setError] = import_react8.default.useState(false);
|
|
1279
|
+
(0, import_react8.useEffect)(() => {
|
|
748
1280
|
if (error) {
|
|
749
1281
|
setTimeout(() => {
|
|
750
1282
|
setError(false);
|
|
751
1283
|
}, 1e3);
|
|
752
1284
|
}
|
|
753
1285
|
}, [error]);
|
|
754
|
-
(0,
|
|
1286
|
+
(0, import_react8.useEffect)(() => {
|
|
755
1287
|
let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
756
1288
|
if (dataChangeValidation == false) {
|
|
757
1289
|
setState({ hiddenValue: "", textValue: "" });
|
|
@@ -785,25 +1317,25 @@ function SCSelect({
|
|
|
785
1317
|
}
|
|
786
1318
|
}
|
|
787
1319
|
};
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
-
|
|
1320
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, data && /* @__PURE__ */ import_react8.default.createElement(import_material6.Box, { sx: { width } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
1321
|
+
import_material6.FormControl,
|
|
790
1322
|
{
|
|
791
1323
|
fullWidth: true,
|
|
792
1324
|
size: size ? size : "medium",
|
|
793
1325
|
variant
|
|
794
1326
|
},
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
|
|
1327
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
1328
|
+
import_material6.InputLabel,
|
|
797
1329
|
{
|
|
798
1330
|
error
|
|
799
1331
|
},
|
|
800
|
-
required ? /* @__PURE__ */
|
|
1332
|
+
required ? /* @__PURE__ */ import_react8.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label
|
|
801
1333
|
),
|
|
802
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
803
1335
|
import_Select.default,
|
|
804
1336
|
{
|
|
805
1337
|
value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
|
|
806
|
-
label: required ? /* @__PURE__ */
|
|
1338
|
+
label: required ? /* @__PURE__ */ import_react8.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
807
1339
|
onChange: handleChange,
|
|
808
1340
|
onBlur: handleBlur,
|
|
809
1341
|
variant,
|
|
@@ -812,28 +1344,34 @@ function SCSelect({
|
|
|
812
1344
|
MenuProps: {
|
|
813
1345
|
PaperProps: {
|
|
814
1346
|
sx: {
|
|
815
|
-
|
|
1347
|
+
maxHeight: "300px",
|
|
1348
|
+
minWidth: "100%"
|
|
816
1349
|
}
|
|
817
1350
|
},
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1351
|
+
anchorOrigin: {
|
|
1352
|
+
vertical: "bottom",
|
|
1353
|
+
horizontal: "left"
|
|
1354
|
+
},
|
|
1355
|
+
transformOrigin: {
|
|
1356
|
+
vertical: "top",
|
|
1357
|
+
horizontal: "left"
|
|
1358
|
+
},
|
|
1359
|
+
disableAutoFocusItem: true,
|
|
1360
|
+
marginThreshold: 0
|
|
823
1361
|
}
|
|
824
1362
|
},
|
|
825
1363
|
data.map((option, index) => {
|
|
826
|
-
return /* @__PURE__ */
|
|
1364
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_material6.MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ import_react8.default.createElement(import_material6.ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ import_react8.default.createElement(import_material6.SvgIcon, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ import_react8.default.createElement(import_material6.ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
|
|
827
1365
|
})
|
|
828
1366
|
)
|
|
829
1367
|
)));
|
|
830
1368
|
}
|
|
831
1369
|
|
|
832
1370
|
// src/Components/SCAutocomplete.tsx
|
|
833
|
-
var
|
|
834
|
-
var
|
|
1371
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
1372
|
+
var import_material7 = require("@mui/material");
|
|
835
1373
|
var import_Grid22 = __toESM(require("@mui/material/Grid2"), 1);
|
|
836
|
-
var
|
|
1374
|
+
var import_icons_material8 = require("@mui/icons-material");
|
|
837
1375
|
var Muicon3 = __toESM(require("@mui/icons-material"), 1);
|
|
838
1376
|
function SCAutocomplete({
|
|
839
1377
|
label = "",
|
|
@@ -851,17 +1389,16 @@ function SCAutocomplete({
|
|
|
851
1389
|
state,
|
|
852
1390
|
inputChange,
|
|
853
1391
|
maxCheck
|
|
854
|
-
// Agregar el parámetro maxCheck
|
|
855
1392
|
}) {
|
|
856
1393
|
const labelContent = `<span style="color: red;">* </span>` + label;
|
|
857
1394
|
let group = "";
|
|
858
1395
|
let isSelected = false;
|
|
859
|
-
const [selectedOptions, setSelectedOptions] =
|
|
860
|
-
const [prevData, setPrevData] =
|
|
861
|
-
const [originalData, setOriginalData] =
|
|
862
|
-
const [inputValue, setInputValue] =
|
|
863
|
-
const [isUserTyping, setIsUserTyping] =
|
|
864
|
-
(0,
|
|
1396
|
+
const [selectedOptions, setSelectedOptions] = import_react9.default.useState([]);
|
|
1397
|
+
const [prevData, setPrevData] = import_react9.default.useState(data);
|
|
1398
|
+
const [originalData, setOriginalData] = import_react9.default.useState(data);
|
|
1399
|
+
const [inputValue, setInputValue] = import_react9.default.useState("");
|
|
1400
|
+
const [isUserTyping, setIsUserTyping] = import_react9.default.useState(false);
|
|
1401
|
+
(0, import_react9.useEffect)(() => {
|
|
865
1402
|
const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
|
|
866
1403
|
if (!dataChangeValidation && !isUserTyping) {
|
|
867
1404
|
setState({ hiddenValue: "-1", textValue: "" });
|
|
@@ -872,7 +1409,7 @@ function SCAutocomplete({
|
|
|
872
1409
|
}
|
|
873
1410
|
setPrevData(data);
|
|
874
1411
|
}, [data, isUserTyping]);
|
|
875
|
-
(0,
|
|
1412
|
+
(0, import_react9.useEffect)(() => {
|
|
876
1413
|
if (typeFormat == "multiselect") {
|
|
877
1414
|
if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
|
|
878
1415
|
const newSelectedOptions = originalData.filter(
|
|
@@ -882,7 +1419,7 @@ function SCAutocomplete({
|
|
|
882
1419
|
}
|
|
883
1420
|
}
|
|
884
1421
|
}, [state.hiddenValue, originalData, typeFormat]);
|
|
885
|
-
(0,
|
|
1422
|
+
(0, import_react9.useEffect)(() => {
|
|
886
1423
|
if (inputValue === "") {
|
|
887
1424
|
setIsUserTyping(false);
|
|
888
1425
|
}
|
|
@@ -940,11 +1477,12 @@ function SCAutocomplete({
|
|
|
940
1477
|
const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
|
|
941
1478
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
942
1479
|
) || null;
|
|
943
|
-
return /* @__PURE__ */
|
|
944
|
-
|
|
1480
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, data && /* @__PURE__ */ import_react9.default.createElement(
|
|
1481
|
+
import_material7.Autocomplete,
|
|
945
1482
|
{
|
|
946
1483
|
multiple: typeFormat === "multiselect",
|
|
947
1484
|
clearOnEscape: true,
|
|
1485
|
+
noOptionsText: "No se encuentra",
|
|
948
1486
|
disabled,
|
|
949
1487
|
options: data,
|
|
950
1488
|
isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
|
|
@@ -966,10 +1504,10 @@ function SCAutocomplete({
|
|
|
966
1504
|
limitTags: 2,
|
|
967
1505
|
renderTags: (value, getTagProps) => {
|
|
968
1506
|
const limit = 2;
|
|
969
|
-
return /* @__PURE__ */
|
|
1507
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, value.slice(0, limit).map((option, index) => {
|
|
970
1508
|
const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
|
|
971
|
-
return /* @__PURE__ */
|
|
972
|
-
|
|
1509
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
1510
|
+
import_material7.Chip,
|
|
973
1511
|
__spreadProps(__spreadValues({
|
|
974
1512
|
key,
|
|
975
1513
|
color: "default",
|
|
@@ -980,7 +1518,7 @@ function SCAutocomplete({
|
|
|
980
1518
|
style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
981
1519
|
})
|
|
982
1520
|
);
|
|
983
|
-
}), value.length > limit && /* @__PURE__ */
|
|
1521
|
+
}), value.length > limit && /* @__PURE__ */ import_react9.default.createElement(import_material7.Box, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
|
|
984
1522
|
},
|
|
985
1523
|
renderOption: (props, option) => {
|
|
986
1524
|
const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
|
|
@@ -998,8 +1536,8 @@ function SCAutocomplete({
|
|
|
998
1536
|
isValid = group == option[columnGroup];
|
|
999
1537
|
group = option[columnGroup];
|
|
1000
1538
|
}
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
-
|
|
1539
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ import_react9.default.createElement(import_material7.Typography, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ import_react9.default.createElement(
|
|
1540
|
+
import_material7.MenuItem,
|
|
1003
1541
|
__spreadProps(__spreadValues({}, optionProps), {
|
|
1004
1542
|
disabled: isDisabled,
|
|
1005
1543
|
style: {
|
|
@@ -1008,9 +1546,9 @@ function SCAutocomplete({
|
|
|
1008
1546
|
opacity: isDisabled ? 0.5 : 1
|
|
1009
1547
|
}
|
|
1010
1548
|
}),
|
|
1011
|
-
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */
|
|
1012
|
-
typeFormat == "multiselect" ? /* @__PURE__ */
|
|
1013
|
-
|
|
1549
|
+
typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ import_react9.default.createElement(import_material7.ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ import_react9.default.createElement(import_material7.SvgIcon, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
|
|
1550
|
+
typeFormat == "multiselect" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1551
|
+
import_material7.Checkbox,
|
|
1014
1552
|
{
|
|
1015
1553
|
checked: isSelected,
|
|
1016
1554
|
disabled: isDisabled,
|
|
@@ -1018,25 +1556,25 @@ function SCAutocomplete({
|
|
|
1018
1556
|
color: "primary"
|
|
1019
1557
|
}
|
|
1020
1558
|
) : "",
|
|
1021
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ import_react9.default.createElement(import_material7.ListItemText, { primary: getItemValue(option).text, color: "text.primary" }),
|
|
1022
1560
|
getItemValue(option).component != void 0 ? getItemValue(option).component : ""
|
|
1023
1561
|
)));
|
|
1024
1562
|
},
|
|
1025
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1026
|
-
|
|
1563
|
+
renderInput: (params) => /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(
|
|
1564
|
+
import_material7.TextField,
|
|
1027
1565
|
__spreadProps(__spreadValues({}, params), {
|
|
1028
|
-
label: required ? /* @__PURE__ */
|
|
1566
|
+
label: required ? /* @__PURE__ */ import_react9.default.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
|
|
1029
1567
|
placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
|
|
1030
1568
|
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
1031
|
-
endAdornment: /* @__PURE__ */
|
|
1569
|
+
endAdornment: /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, deleteType == "icon" && (state.hiddenValue.toString() != "-1" && state.hiddenValue.toString() != "") ? /* @__PURE__ */ import_react9.default.createElement(import_material7.IconButton, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ import_react9.default.createElement(import_icons_material8.Clear, { fontSize: "small" })) : "", /* @__PURE__ */ import_react9.default.createElement(import_material7.InputAdornment, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ import_react9.default.createElement(import_icons_material8.Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
|
|
1032
1570
|
})
|
|
1033
1571
|
})
|
|
1034
1572
|
)),
|
|
1035
1573
|
slotProps: {
|
|
1036
1574
|
listbox: {
|
|
1037
|
-
component:
|
|
1038
|
-
return /* @__PURE__ */
|
|
1039
|
-
|
|
1575
|
+
component: import_react9.default.forwardRef(function ListboxComponent(props, ref) {
|
|
1576
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(
|
|
1577
|
+
import_material7.Box,
|
|
1040
1578
|
__spreadProps(__spreadValues({
|
|
1041
1579
|
ref
|
|
1042
1580
|
}, props), {
|
|
@@ -1046,9 +1584,9 @@ function SCAutocomplete({
|
|
|
1046
1584
|
backgroundColor: "white"
|
|
1047
1585
|
}, props.sx)
|
|
1048
1586
|
}),
|
|
1049
|
-
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */
|
|
1587
|
+
checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(import_material7.FormControlLabel, { control: /* @__PURE__ */ import_react9.default.createElement(import_material7.Checkbox, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los items", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ import_react9.default.createElement(import_material7.Divider, null)) : "",
|
|
1050
1588
|
props.children,
|
|
1051
|
-
deleteType == "button" || fnAplicar ? /* @__PURE__ */
|
|
1589
|
+
deleteType == "button" || fnAplicar ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1052
1590
|
import_Grid22.default,
|
|
1053
1591
|
{
|
|
1054
1592
|
container: true,
|
|
@@ -1063,8 +1601,8 @@ function SCAutocomplete({
|
|
|
1063
1601
|
justifyContent: "space-between"
|
|
1064
1602
|
}
|
|
1065
1603
|
},
|
|
1066
|
-
deleteType == "button" ? /* @__PURE__ */
|
|
1067
|
-
|
|
1604
|
+
deleteType == "button" ? /* @__PURE__ */ import_react9.default.createElement(
|
|
1605
|
+
import_material7.Button,
|
|
1068
1606
|
{
|
|
1069
1607
|
variant: "text",
|
|
1070
1608
|
color: "primary",
|
|
@@ -1076,8 +1614,8 @@ function SCAutocomplete({
|
|
|
1076
1614
|
},
|
|
1077
1615
|
"Limpiar"
|
|
1078
1616
|
) : "",
|
|
1079
|
-
fnAplicar && /* @__PURE__ */
|
|
1080
|
-
|
|
1617
|
+
fnAplicar && /* @__PURE__ */ import_react9.default.createElement(
|
|
1618
|
+
import_material7.Button,
|
|
1081
1619
|
{
|
|
1082
1620
|
variant: "contained",
|
|
1083
1621
|
color: "primary",
|
|
@@ -1096,8 +1634,8 @@ function SCAutocomplete({
|
|
|
1096
1634
|
}
|
|
1097
1635
|
|
|
1098
1636
|
// src/Components/SCDateRange.tsx
|
|
1099
|
-
var
|
|
1100
|
-
var
|
|
1637
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1638
|
+
var import_material8 = require("@mui/material");
|
|
1101
1639
|
var import_LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
1102
1640
|
var import_AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
|
|
1103
1641
|
var import_DateRangePicker = require("@mui/x-date-pickers-pro/DateRangePicker");
|
|
@@ -1128,7 +1666,7 @@ var SCDateRange = ({
|
|
|
1128
1666
|
];
|
|
1129
1667
|
setState(convertedValue);
|
|
1130
1668
|
};
|
|
1131
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_LocalizationProvider.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react10.default.createElement(import_material8.Box, { sx: { width: "100%" } }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1132
1670
|
import_DateRangePicker.DateRangePicker,
|
|
1133
1671
|
{
|
|
1134
1672
|
value: state,
|
|
@@ -1147,7 +1685,7 @@ var SCDateRange = ({
|
|
|
1147
1685
|
required,
|
|
1148
1686
|
error: position === "start" ? isStartEmpty : isEndEmpty,
|
|
1149
1687
|
InputProps: {
|
|
1150
|
-
endAdornment: /* @__PURE__ */
|
|
1688
|
+
endAdornment: /* @__PURE__ */ import_react10.default.createElement(import_material8.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1151
1689
|
import_Event.default,
|
|
1152
1690
|
{
|
|
1153
1691
|
color: hasError ? "error" : "action",
|
|
@@ -1188,29 +1726,81 @@ var getIcon2 = (iconName) => {
|
|
|
1188
1726
|
};
|
|
1189
1727
|
|
|
1190
1728
|
// src/Components/Drawer/Helpers/validateInput.tsx
|
|
1191
|
-
var validateInputs = (arrayElements, onError, onSuccess) => {
|
|
1192
|
-
var _a;
|
|
1729
|
+
var validateInputs = (arrayElements, onError, onSuccess, setChipFilters, setTextFilters) => {
|
|
1730
|
+
var _a, _b;
|
|
1193
1731
|
let requiredValues = 0;
|
|
1194
1732
|
let filledValues = 0;
|
|
1195
1733
|
for (let i = 0; i < arrayElements.length; i++) {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1734
|
+
const element = arrayElements[i];
|
|
1735
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1736
|
+
const textValue = ((_a = typeElement.state) == null ? void 0 : _a.textValue) !== void 0 ? String((_b = typeElement.state) == null ? void 0 : _b.textValue) : String(typeElement.state);
|
|
1737
|
+
if (typeElement == null ? void 0 : typeElement.required) {
|
|
1738
|
+
requiredValues++;
|
|
1739
|
+
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1201
1740
|
filledValues++;
|
|
1202
1741
|
}
|
|
1203
1742
|
}
|
|
1204
1743
|
}
|
|
1205
1744
|
if (requiredValues === filledValues) {
|
|
1206
1745
|
onSuccess();
|
|
1746
|
+
setChipFilters(true);
|
|
1207
1747
|
} else {
|
|
1208
1748
|
onError({
|
|
1209
1749
|
type: "error",
|
|
1210
1750
|
title: "Algunos campos son requeridos",
|
|
1211
1751
|
time: 10
|
|
1212
1752
|
});
|
|
1753
|
+
setChipFilters(false);
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
// src/Components/Drawer/Helpers/validateTypeElement.tsx
|
|
1758
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
1759
|
+
var validateTypeElements = (element) => {
|
|
1760
|
+
var _a;
|
|
1761
|
+
let validation = "";
|
|
1762
|
+
let typeElement = element;
|
|
1763
|
+
if (element.type == "textField") {
|
|
1764
|
+
validation = "textField";
|
|
1765
|
+
typeElement = element;
|
|
1766
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextField") {
|
|
1767
|
+
validation = "textField";
|
|
1768
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1769
|
+
} else if (element.type == "textArea") {
|
|
1770
|
+
validation = "textArea";
|
|
1771
|
+
typeElement = element;
|
|
1772
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCtextArea") {
|
|
1773
|
+
validation = "textArea";
|
|
1774
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1775
|
+
} else if (element.type == "dateRange") {
|
|
1776
|
+
validation = "dateRange";
|
|
1777
|
+
typeElement = element;
|
|
1778
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCDateRange") {
|
|
1779
|
+
validation = "dateRange";
|
|
1780
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1781
|
+
} else if (element.type == "autocomplete") {
|
|
1782
|
+
validation = "autocomplete";
|
|
1783
|
+
typeElement = element;
|
|
1784
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCAutocomplete") {
|
|
1785
|
+
validation = "autocomplete";
|
|
1786
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1787
|
+
} else if (element.typeFormat == "multiselect") {
|
|
1788
|
+
validation = "multiselect";
|
|
1789
|
+
typeElement = element;
|
|
1790
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.props && ((_a = element == null ? void 0 : element.component) == null ? void 0 : _a.props).typeFormat == "multiselect") {
|
|
1791
|
+
validation = "multiselect";
|
|
1792
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1793
|
+
} else if (element.type == "select") {
|
|
1794
|
+
validation = "select";
|
|
1795
|
+
typeElement = element;
|
|
1796
|
+
} else if (import_react11.default.isValidElement(element == null ? void 0 : element.component) && element.component.type && element.component.type.name == "SCSelect") {
|
|
1797
|
+
validation = "select";
|
|
1798
|
+
typeElement = element == null ? void 0 : element.component.props;
|
|
1213
1799
|
}
|
|
1800
|
+
return {
|
|
1801
|
+
validation,
|
|
1802
|
+
element: typeElement
|
|
1803
|
+
};
|
|
1214
1804
|
};
|
|
1215
1805
|
|
|
1216
1806
|
// src/Components/Drawer/SCDrawer.tsx
|
|
@@ -1225,16 +1815,42 @@ function SCDrawer({
|
|
|
1225
1815
|
anchor = "left",
|
|
1226
1816
|
width,
|
|
1227
1817
|
//Funcionales
|
|
1228
|
-
open
|
|
1818
|
+
open,
|
|
1819
|
+
setOpen,
|
|
1820
|
+
chipFilters
|
|
1229
1821
|
}) {
|
|
1230
1822
|
var _a, _b;
|
|
1231
|
-
const
|
|
1232
|
-
const [
|
|
1823
|
+
const scrollRef = (0, import_react12.useRef)(null);
|
|
1824
|
+
const [drawerOpen, setDrawerOpen] = import_react12.default.useState(open);
|
|
1825
|
+
const [toast, setToast] = import_react12.default.useState(null);
|
|
1826
|
+
const [stateChipFilters, setChipFilters] = import_react12.default.useState(false);
|
|
1827
|
+
const [textFilters, setTextFilters] = import_react12.default.useState([]);
|
|
1828
|
+
(0, import_react12.useEffect)(() => {
|
|
1829
|
+
if (chipFilters != void 0) {
|
|
1830
|
+
if (chipFilters.length > 0) {
|
|
1831
|
+
setTextFilters([]);
|
|
1832
|
+
inputValidation();
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}, [chipFilters]);
|
|
1836
|
+
(0, import_react12.useEffect)(() => {
|
|
1837
|
+
if (open) {
|
|
1838
|
+
toggleDrawer(true);
|
|
1839
|
+
} else {
|
|
1840
|
+
handleDrawerClose();
|
|
1841
|
+
}
|
|
1842
|
+
}, [open]);
|
|
1233
1843
|
const handleDrawerClose = () => {
|
|
1234
1844
|
setDrawerOpen(false);
|
|
1845
|
+
if (setOpen) {
|
|
1846
|
+
setOpen(false);
|
|
1847
|
+
}
|
|
1235
1848
|
};
|
|
1236
1849
|
const toggleDrawer = (newOpen) => () => {
|
|
1237
1850
|
setDrawerOpen(newOpen);
|
|
1851
|
+
if (setOpen) {
|
|
1852
|
+
setOpen(true);
|
|
1853
|
+
}
|
|
1238
1854
|
};
|
|
1239
1855
|
const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
|
|
1240
1856
|
const setToastWithDelay = (toastContent) => {
|
|
@@ -1243,39 +1859,179 @@ function SCDrawer({
|
|
|
1243
1859
|
setToast(toastContent);
|
|
1244
1860
|
}, 10);
|
|
1245
1861
|
};
|
|
1246
|
-
const inputValidation = () =>
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
element
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1862
|
+
const inputValidation = () => {
|
|
1863
|
+
var _a2, _b2, _c, _d;
|
|
1864
|
+
if (chipFilters != void 0 && chipFilters.length > 0) {
|
|
1865
|
+
if (chipFilters && chipFilters.length > 0) {
|
|
1866
|
+
arrayElements.forEach((arrayElement) => {
|
|
1867
|
+
var _a3, _b3, _c2;
|
|
1868
|
+
const { validation, element: typeElement } = validateTypeElements(arrayElement);
|
|
1869
|
+
let currentValue = "";
|
|
1870
|
+
if (validation === "dateRange") {
|
|
1871
|
+
if (typeElement.state && typeElement.state[0] && typeElement.state[1]) {
|
|
1872
|
+
currentValue = `${(_a3 = typeElement.state[0]) == null ? void 0 : _a3.format("DD/MM/YYYY")} - ${(_b3 = typeElement.state[1]) == null ? void 0 : _b3.format("DD/MM/YYYY")}`;
|
|
1873
|
+
}
|
|
1874
|
+
} else {
|
|
1875
|
+
currentValue = ((_c2 = typeElement.state) == null ? void 0 : _c2.textValue) !== void 0 ? String(typeElement.state.textValue).trim() : String(typeElement.state).trim();
|
|
1876
|
+
}
|
|
1877
|
+
chipFilters.forEach((chipFilter) => {
|
|
1878
|
+
const chipValue = String(chipFilter).trim();
|
|
1879
|
+
if (currentValue === chipValue && currentValue !== "" && currentValue !== ",") {
|
|
1880
|
+
setTextFilters((prevFilters) => {
|
|
1881
|
+
const newFilter = { value: currentValue, arrayElement: typeElement };
|
|
1882
|
+
const existingFilterIndex = prevFilters.findIndex(
|
|
1883
|
+
(filter) => filter.arrayElement.label === arrayElement.label
|
|
1884
|
+
);
|
|
1885
|
+
if (existingFilterIndex !== -1) {
|
|
1886
|
+
const updatedFilters = [...prevFilters];
|
|
1887
|
+
updatedFilters[existingFilterIndex] = newFilter;
|
|
1888
|
+
return updatedFilters;
|
|
1889
|
+
} else {
|
|
1890
|
+
return [...prevFilters, newFilter];
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
} else {
|
|
1898
|
+
const newFiltersToAdd = [];
|
|
1899
|
+
for (let i = 0; i < arrayElements.length; i++) {
|
|
1900
|
+
const element = arrayElements[i];
|
|
1901
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1902
|
+
const textValue = ((_a2 = typeElement.state) == null ? void 0 : _a2.textValue) !== void 0 ? String((_b2 = typeElement.state) == null ? void 0 : _b2.textValue) : String(typeElement.state);
|
|
1903
|
+
if (textValue.trim() !== "" && textValue.trim() !== ",") {
|
|
1904
|
+
let newFilter;
|
|
1905
|
+
switch (validation) {
|
|
1906
|
+
case "dateRange":
|
|
1907
|
+
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")}`;
|
|
1908
|
+
newFilter = { value: values, arrayElement: typeElement };
|
|
1909
|
+
break;
|
|
1910
|
+
default:
|
|
1911
|
+
newFilter = { value: textValue, arrayElement: typeElement };
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
const existingFilterByLabel = newFiltersToAdd.find(
|
|
1915
|
+
(filter) => filter.arrayElement.label === element.label
|
|
1916
|
+
);
|
|
1917
|
+
if (existingFilterByLabel) {
|
|
1918
|
+
existingFilterByLabel.value = newFilter.value;
|
|
1919
|
+
existingFilterByLabel.arrayElement = newFilter.arrayElement;
|
|
1261
1920
|
} else {
|
|
1262
|
-
|
|
1263
|
-
import_react8.default.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: "" });
|
|
1921
|
+
newFiltersToAdd.push(newFilter);
|
|
1264
1922
|
}
|
|
1265
1923
|
}
|
|
1266
1924
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1925
|
+
setTextFilters((prevFilters) => {
|
|
1926
|
+
let updatedFilters = [...prevFilters];
|
|
1927
|
+
newFiltersToAdd.forEach((newFilter) => {
|
|
1928
|
+
const existingFilterIndex = updatedFilters.findIndex(
|
|
1929
|
+
(filter) => filter.arrayElement.label === newFilter.arrayElement.label
|
|
1930
|
+
);
|
|
1931
|
+
if (existingFilterIndex !== -1) {
|
|
1932
|
+
updatedFilters[existingFilterIndex] = newFilter;
|
|
1933
|
+
} else {
|
|
1934
|
+
updatedFilters.push(newFilter);
|
|
1935
|
+
}
|
|
1936
|
+
});
|
|
1937
|
+
return updatedFilters;
|
|
1938
|
+
});
|
|
1939
|
+
validateInputs(arrayElements, setToastWithDelay, handleDrawerClose, setChipFilters, setTextFilters);
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
const resetElementByType = (originalElement, validation, typeElement) => {
|
|
1943
|
+
let defaultValue;
|
|
1944
|
+
switch (validation) {
|
|
1945
|
+
case "textField":
|
|
1946
|
+
case "textArea":
|
|
1947
|
+
defaultValue = "";
|
|
1948
|
+
break;
|
|
1949
|
+
case "dateRange":
|
|
1950
|
+
defaultValue = [null, null];
|
|
1951
|
+
break;
|
|
1952
|
+
case "multiselect":
|
|
1953
|
+
defaultValue = { hiddenValue: [], textValue: [] };
|
|
1954
|
+
break;
|
|
1955
|
+
default:
|
|
1956
|
+
defaultValue = { hiddenValue: "-1", textValue: "" };
|
|
1957
|
+
}
|
|
1958
|
+
if (typeElement.setState) {
|
|
1959
|
+
typeElement.setState(defaultValue);
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
const cleanFilters = () => {
|
|
1963
|
+
arrayElements.forEach((element) => {
|
|
1964
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1965
|
+
if (typeElement.setState) {
|
|
1966
|
+
resetElementByType(element, validation, typeElement);
|
|
1967
|
+
}
|
|
1968
|
+
});
|
|
1969
|
+
setTextFilters([]);
|
|
1970
|
+
};
|
|
1971
|
+
const deleteFilter = (element) => {
|
|
1972
|
+
const { validation, element: typeElement } = validateTypeElements(element);
|
|
1973
|
+
if (typeElement.setState && shouldShowChips == true) {
|
|
1974
|
+
resetElementByType(element, validation, typeElement);
|
|
1975
|
+
setTextFilters(
|
|
1976
|
+
(prevFilters) => prevFilters.filter((filter) => filter.arrayElement.label !== element.label)
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
};
|
|
1980
|
+
const scroll = (offset) => {
|
|
1981
|
+
if (scrollRef.current) {
|
|
1982
|
+
scrollRef.current.scrollLeft += offset;
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
const hasActiveFilters = () => {
|
|
1986
|
+
return arrayElements.some((arrayElement) => {
|
|
1987
|
+
const { validation, element: typeElement } = validateTypeElements(arrayElement);
|
|
1988
|
+
if (typeElement.state.textValue !== void 0) {
|
|
1989
|
+
return String(typeElement.state.textValue).trim() !== "";
|
|
1990
|
+
} else if (validation === "dateRange") {
|
|
1991
|
+
return typeElement.state && typeElement.state[0] !== null && typeElement.state[1] !== null;
|
|
1992
|
+
} else {
|
|
1993
|
+
return String(typeElement.state).trim() !== "" && String(typeElement.state).trim() !== ",";
|
|
1994
|
+
}
|
|
1995
|
+
});
|
|
1996
|
+
};
|
|
1997
|
+
const shouldShowChips = chipFilters != void 0 && chipFilters.length > 0 ? true : stateChipFilters === true && hasActiveFilters();
|
|
1998
|
+
const actionsA = actions == false ? false : actions != void 0 ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: cleanFilters }];
|
|
1999
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, toast && /* @__PURE__ */ import_react12.default.createElement(SCToastNotification, __spreadValues({}, toast)), /* @__PURE__ */ import_react12.default.createElement(import_Grid23.default, { container: true, justifyContent: "flex-start", flexWrap: "nowrap", alignItems: "center", sx: { width: "100%" } }, shouldShowChips && /* @__PURE__ */ import_react12.default.createElement(import_material9.Box, { display: "flex", alignItems: "center", sx: { maxWidth: "78%" } }, /* @__PURE__ */ import_react12.default.createElement(import_material9.IconButton, { onClick: () => scroll(-150), size: "small" }, /* @__PURE__ */ import_react12.default.createElement(import_ArrowBackIos.default, { fontSize: "small" })), /* @__PURE__ */ import_react12.default.createElement(
|
|
2000
|
+
import_material9.Box,
|
|
2001
|
+
{
|
|
2002
|
+
ref: scrollRef,
|
|
2003
|
+
gap: 0.3,
|
|
2004
|
+
sx: {
|
|
2005
|
+
display: "flex",
|
|
2006
|
+
overflowX: "auto",
|
|
2007
|
+
scrollBehavior: "smooth",
|
|
2008
|
+
"&::-webkit-scrollbar": { display: "none" }
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
textFilters == null ? void 0 : textFilters.map((chipData, index) => /* @__PURE__ */ import_react12.default.createElement(
|
|
2012
|
+
import_material9.Chip,
|
|
2013
|
+
__spreadProps(__spreadValues({
|
|
2014
|
+
key: index,
|
|
2015
|
+
label: chipData.value
|
|
2016
|
+
}, chipData.arrayElement.required == false || chipData.arrayElement.required == void 0 ? { onDelete: () => deleteFilter(chipData.arrayElement) } : {}), {
|
|
2017
|
+
color: "default",
|
|
2018
|
+
variant: "filled",
|
|
2019
|
+
size: "small",
|
|
2020
|
+
sx: {
|
|
2021
|
+
flexShrink: 0,
|
|
2022
|
+
minWidth: "auto"
|
|
2023
|
+
}
|
|
2024
|
+
})
|
|
2025
|
+
))
|
|
2026
|
+
), /* @__PURE__ */ import_react12.default.createElement(import_material9.IconButton, { onClick: () => scroll(150), size: "small" }, /* @__PURE__ */ import_react12.default.createElement(import_ArrowForwardIos.default, { fontSize: "small" }))), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
2027
|
+
import_material9.Chip,
|
|
1272
2028
|
__spreadProps(__spreadValues({
|
|
1273
2029
|
onClick: toggleDrawer(true),
|
|
1274
2030
|
color: buttonDrawer == null ? void 0 : buttonDrawer.color,
|
|
1275
2031
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) == "contained" ? "filled" : "outlined",
|
|
1276
2032
|
label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
|
|
1277
|
-
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */
|
|
1278
|
-
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
2033
|
+
icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
|
|
2034
|
+
deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : void 0
|
|
1279
2035
|
}, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
|
|
1280
2036
|
} } : {}), {
|
|
1281
2037
|
sx: {
|
|
@@ -1285,8 +2041,8 @@ function SCDrawer({
|
|
|
1285
2041
|
textTransform: "capitalize"
|
|
1286
2042
|
}
|
|
1287
2043
|
})
|
|
1288
|
-
) : /* @__PURE__ */
|
|
1289
|
-
|
|
2044
|
+
) : /* @__PURE__ */ import_react12.default.createElement(
|
|
2045
|
+
import_material9.Button,
|
|
1290
2046
|
{
|
|
1291
2047
|
"data-testid": "test-buttonDrawer",
|
|
1292
2048
|
sx: { textTransform: "capitalize" },
|
|
@@ -1294,12 +2050,12 @@ function SCDrawer({
|
|
|
1294
2050
|
onClick: toggleDrawer(true),
|
|
1295
2051
|
size: "small",
|
|
1296
2052
|
variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
|
|
1297
|
-
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */
|
|
1298
|
-
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */
|
|
2053
|
+
startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : null,
|
|
2054
|
+
endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ import_react12.default.createElement(ButtonIcon, { fontSize: "small" }) : null
|
|
1299
2055
|
},
|
|
1300
2056
|
(_b = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _b : ""
|
|
1301
|
-
), /* @__PURE__ */
|
|
1302
|
-
|
|
2057
|
+
)), /* @__PURE__ */ import_react12.default.createElement(
|
|
2058
|
+
import_material9.Drawer,
|
|
1303
2059
|
{
|
|
1304
2060
|
open: drawerOpen,
|
|
1305
2061
|
onClose: toggleDrawer(false),
|
|
@@ -1312,15 +2068,15 @@ function SCDrawer({
|
|
|
1312
2068
|
}
|
|
1313
2069
|
}
|
|
1314
2070
|
},
|
|
1315
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react12.default.createElement(import_Grid23.default, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ import_react12.default.createElement(import_material9.Typography, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ import_react12.default.createElement(import_material9.IconButton, { onClick: handleDrawerClose }, /* @__PURE__ */ import_react12.default.createElement(import_Close.default, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
|
|
1316
2072
|
var _a2, _b2, _c, _d, _e, _f;
|
|
1317
|
-
return /* @__PURE__ */
|
|
1318
|
-
|
|
2073
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
2074
|
+
import_material9.Box,
|
|
1319
2075
|
{
|
|
1320
2076
|
key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b2 = arrayElement.label) != null ? _b2 : ""}${index}`,
|
|
1321
2077
|
sx: { width: "100%" }
|
|
1322
2078
|
},
|
|
1323
|
-
arrayElement.component ? /* @__PURE__ */
|
|
2079
|
+
arrayElement.component ? /* @__PURE__ */ import_react12.default.createElement(import_material9.Stack, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1324
2080
|
SCTextField,
|
|
1325
2081
|
{
|
|
1326
2082
|
title: arrayElement.title,
|
|
@@ -1346,7 +2102,7 @@ function SCDrawer({
|
|
|
1346
2102
|
onBlur: arrayElement.onBlur,
|
|
1347
2103
|
onKeyDown: arrayElement.onKeyDown
|
|
1348
2104
|
}
|
|
1349
|
-
) : arrayElement.type === "textArea" ? /* @__PURE__ */
|
|
2105
|
+
) : arrayElement.type === "textArea" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1350
2106
|
SCTextArea,
|
|
1351
2107
|
{
|
|
1352
2108
|
title: arrayElement.title,
|
|
@@ -1365,7 +2121,7 @@ function SCDrawer({
|
|
|
1365
2121
|
state: arrayElement.state || "",
|
|
1366
2122
|
onBlur: arrayElement.onBlur
|
|
1367
2123
|
}
|
|
1368
|
-
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */
|
|
2124
|
+
) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1369
2125
|
SCAutocomplete,
|
|
1370
2126
|
{
|
|
1371
2127
|
label: arrayElement.label,
|
|
@@ -1383,7 +2139,7 @@ function SCDrawer({
|
|
|
1383
2139
|
state: arrayElement.state || "",
|
|
1384
2140
|
inputChange: arrayElement.inputChange
|
|
1385
2141
|
}
|
|
1386
|
-
) : arrayElement.type === "select" ? /* @__PURE__ */
|
|
2142
|
+
) : arrayElement.type === "select" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1387
2143
|
SCSelect,
|
|
1388
2144
|
{
|
|
1389
2145
|
label: arrayElement.label,
|
|
@@ -1392,7 +2148,6 @@ function SCDrawer({
|
|
|
1392
2148
|
width: arrayElement.width,
|
|
1393
2149
|
size: arrayElement.size,
|
|
1394
2150
|
variant: arrayElement.variant,
|
|
1395
|
-
deleteType: arrayElement.deleteType,
|
|
1396
2151
|
required: arrayElement.required,
|
|
1397
2152
|
disabled: arrayElement.disabled,
|
|
1398
2153
|
background: arrayElement.background,
|
|
@@ -1400,7 +2155,7 @@ function SCDrawer({
|
|
|
1400
2155
|
setState: arrayElement.setState,
|
|
1401
2156
|
state: arrayElement.state || ""
|
|
1402
2157
|
}
|
|
1403
|
-
) : arrayElement.type === "dateRange" ? /* @__PURE__ */
|
|
2158
|
+
) : arrayElement.type === "dateRange" ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1404
2159
|
SCDateRange,
|
|
1405
2160
|
{
|
|
1406
2161
|
labelDateInitial: arrayElement.labelDateInitial,
|
|
@@ -1413,7 +2168,7 @@ function SCDrawer({
|
|
|
1413
2168
|
}
|
|
1414
2169
|
) : null
|
|
1415
2170
|
);
|
|
1416
|
-
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */
|
|
2171
|
+
})), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */ import_react12.default.createElement(
|
|
1417
2172
|
import_Grid23.default,
|
|
1418
2173
|
{
|
|
1419
2174
|
sx: { borderTop: 1, borderColor: "#1018403B" },
|
|
@@ -1425,8 +2180,8 @@ function SCDrawer({
|
|
|
1425
2180
|
justifyContent: actionsA.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
|
|
1426
2181
|
flexDirection: anchor != "right" ? "row-reverse" : "row"
|
|
1427
2182
|
},
|
|
1428
|
-
actionsA.map((btn, index) => /* @__PURE__ */
|
|
1429
|
-
|
|
2183
|
+
actionsA.map((btn, index) => /* @__PURE__ */ import_react12.default.createElement(
|
|
2184
|
+
import_material9.Button,
|
|
1430
2185
|
{
|
|
1431
2186
|
key: index,
|
|
1432
2187
|
variant: index === 0 || actionsA.length < 2 ? "contained" : "text",
|
|
@@ -1442,207 +2197,61 @@ function SCDrawer({
|
|
|
1442
2197
|
}
|
|
1443
2198
|
|
|
1444
2199
|
// src/Components/FooterAction/FooterAction.tsx
|
|
1445
|
-
var
|
|
1446
|
-
var
|
|
2200
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2201
|
+
var import_material10 = require("@mui/material");
|
|
1447
2202
|
var FooterAction = ({
|
|
1448
2203
|
leftContent,
|
|
1449
2204
|
rightContent,
|
|
1450
2205
|
label,
|
|
1451
2206
|
variant
|
|
1452
2207
|
}) => {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
|
|
2208
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2209
|
+
import_material10.AppBar,
|
|
1455
2210
|
{
|
|
1456
2211
|
color: "inherit",
|
|
1457
2212
|
sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
|
|
1458
2213
|
},
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
|
|
2214
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
2215
|
+
import_material10.Toolbar,
|
|
1461
2216
|
{
|
|
1462
2217
|
id: "footer-toolbar",
|
|
1463
2218
|
sx: { gap: 1.5, minHeight: "50px !important" }
|
|
1464
2219
|
},
|
|
1465
2220
|
leftContent,
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
label && /* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ import_react13.default.createElement(import_material10.Box, { flexGrow: 1 }),
|
|
2222
|
+
label && /* @__PURE__ */ import_react13.default.createElement(import_material10.Typography, { variant: "body2", color: "text.secondary" }, label),
|
|
1468
2223
|
rightContent
|
|
1469
2224
|
)
|
|
1470
2225
|
);
|
|
1471
2226
|
};
|
|
1472
2227
|
|
|
1473
|
-
// src/Components/Modal/Helpers/Data.tsx
|
|
1474
|
-
var import_react10 = __toESM(require("react"), 1);
|
|
1475
|
-
var import_icons_material5 = require("@mui/icons-material");
|
|
1476
|
-
var modalStateConfig = {
|
|
1477
|
-
info: {
|
|
1478
|
-
color: "info",
|
|
1479
|
-
defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
|
|
1480
|
-
icon: /* @__PURE__ */ import_react10.default.createElement(import_icons_material5.Info, { color: "info", fontSize: "medium" })
|
|
1481
|
-
},
|
|
1482
|
-
delete: {
|
|
1483
|
-
color: "delete",
|
|
1484
|
-
defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
|
|
1485
|
-
icon: /* @__PURE__ */ import_react10.default.createElement(import_icons_material5.Info, { color: "error", fontSize: "medium" })
|
|
1486
|
-
},
|
|
1487
|
-
warning: {
|
|
1488
|
-
color: "warning",
|
|
1489
|
-
defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
|
|
1490
|
-
icon: /* @__PURE__ */ import_react10.default.createElement(import_icons_material5.Warning, { color: "warning", fontSize: "medium" })
|
|
1491
|
-
}
|
|
1492
|
-
};
|
|
1493
|
-
|
|
1494
|
-
// src/Components/Modal/Helpers/Utils.tsx
|
|
1495
|
-
var MuiIcons2 = __toESM(require("@mui/icons-material"), 1);
|
|
1496
|
-
var import_icons_material6 = require("@mui/icons-material");
|
|
1497
|
-
var getIconComponent2 = (iconName) => {
|
|
1498
|
-
return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] : import_icons_material6.FilterListOutlined;
|
|
1499
|
-
};
|
|
1500
|
-
var getModalColor = (state) => {
|
|
1501
|
-
var _a;
|
|
1502
|
-
const colors = {
|
|
1503
|
-
info: "info.100",
|
|
1504
|
-
delete: "error.100",
|
|
1505
|
-
warning: "warning.100"
|
|
1506
|
-
};
|
|
1507
|
-
return (_a = colors[state]) != null ? _a : "warning.100";
|
|
1508
|
-
};
|
|
1509
|
-
var getButtonColor = (state) => {
|
|
1510
|
-
var _a;
|
|
1511
|
-
const colorMap = {
|
|
1512
|
-
info: "info",
|
|
1513
|
-
delete: "error",
|
|
1514
|
-
warning: "warning"
|
|
1515
|
-
};
|
|
1516
|
-
return (_a = colorMap[state]) != null ? _a : "info";
|
|
1517
|
-
};
|
|
1518
|
-
|
|
1519
|
-
// src/Components/Modal/SCModal.tsx
|
|
1520
|
-
var import_react11 = __toESM(require("react"), 1);
|
|
1521
|
-
var import_material9 = require("@mui/material");
|
|
1522
|
-
var import_icons_material7 = require("@mui/icons-material");
|
|
1523
|
-
|
|
1524
|
-
// src/generales/capitalize.tsx
|
|
1525
|
-
function capitalize(text) {
|
|
1526
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
// src/Components/Modal/SCModal.tsx
|
|
1530
|
-
var SCModal = ({
|
|
1531
|
-
buttonModal,
|
|
1532
|
-
state = "info",
|
|
1533
|
-
open,
|
|
1534
|
-
title,
|
|
1535
|
-
description,
|
|
1536
|
-
action
|
|
1537
|
-
}) => {
|
|
1538
|
-
var _a, _b, _c, _d, _e;
|
|
1539
|
-
const [openModal, setOpenModal] = (0, import_react11.useState)(open != null ? open : false);
|
|
1540
|
-
(0, import_react11.useEffect)(() => {
|
|
1541
|
-
if (open !== void 0) {
|
|
1542
|
-
setOpenModal(open);
|
|
1543
|
-
}
|
|
1544
|
-
}, [open]);
|
|
1545
|
-
const Icon = (0, import_react11.useMemo)(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
|
|
1546
|
-
const handleClose = (0, import_react11.useCallback)(() => setOpenModal(false), []);
|
|
1547
|
-
const toggleModal = (newOpen) => () => setOpenModal(newOpen);
|
|
1548
|
-
const prevAction = (0, import_react11.useMemo)(
|
|
1549
|
-
() => action != null ? action : [{ text: "Cancelar", fn: handleClose }, { text: "Consultar", fn: () => {
|
|
1550
|
-
} }],
|
|
1551
|
-
[action, handleClose]
|
|
1552
|
-
);
|
|
1553
|
-
const { icon, defaultDescription } = modalStateConfig[state];
|
|
1554
|
-
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
1555
|
-
import_material9.Button,
|
|
1556
|
-
{
|
|
1557
|
-
"data-testid": "test-buttonModal",
|
|
1558
|
-
color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
|
|
1559
|
-
onClick: toggleModal(true),
|
|
1560
|
-
variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
|
|
1561
|
-
size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
|
|
1562
|
-
startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ import_react11.default.createElement(Icon, null),
|
|
1563
|
-
endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ import_react11.default.createElement(Icon, null)
|
|
1564
|
-
},
|
|
1565
|
-
capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
|
|
1566
|
-
), /* @__PURE__ */ import_react11.default.createElement(import_material9.Modal, { open: openModal, onClose: toggleModal(false), sx: { boxShadow: 8 } }, /* @__PURE__ */ import_react11.default.createElement(
|
|
1567
|
-
import_material9.Box,
|
|
1568
|
-
{
|
|
1569
|
-
sx: {
|
|
1570
|
-
position: "absolute",
|
|
1571
|
-
top: "50%",
|
|
1572
|
-
left: "50%",
|
|
1573
|
-
transform: "translate(-50%, -50%)",
|
|
1574
|
-
width: 400,
|
|
1575
|
-
bgcolor: "background.paper",
|
|
1576
|
-
borderRadius: 1,
|
|
1577
|
-
boxShadow: 24
|
|
1578
|
-
}
|
|
1579
|
-
},
|
|
1580
|
-
/* @__PURE__ */ import_react11.default.createElement(import_material9.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ import_react11.default.createElement(import_material9.Stack, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ import_react11.default.createElement(import_material9.Box, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ import_react11.default.createElement(import_material9.Typography, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ import_react11.default.createElement(import_material9.IconButton, { onClick: toggleModal(false), "data-testid": "test-buttonClose" }, /* @__PURE__ */ import_react11.default.createElement(import_icons_material7.Close, { color: "action" }))),
|
|
1581
|
-
/* @__PURE__ */ import_react11.default.createElement(import_material9.Stack, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ import_react11.default.createElement(import_material9.Typography, { variant: "body1" }, description || defaultDescription)),
|
|
1582
|
-
action && /* @__PURE__ */ import_react11.default.createElement(
|
|
1583
|
-
import_material9.Stack,
|
|
1584
|
-
{
|
|
1585
|
-
id: "Action",
|
|
1586
|
-
direction: "row",
|
|
1587
|
-
gap: 1,
|
|
1588
|
-
p: 1,
|
|
1589
|
-
justifyContent: "end",
|
|
1590
|
-
bgcolor: "grey.50",
|
|
1591
|
-
sx: { borderRadius: 1 }
|
|
1592
|
-
},
|
|
1593
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
|
1594
|
-
import_material9.Button,
|
|
1595
|
-
{
|
|
1596
|
-
color: "inherit",
|
|
1597
|
-
variant: "text",
|
|
1598
|
-
onClick: handleClose,
|
|
1599
|
-
size: "small"
|
|
1600
|
-
},
|
|
1601
|
-
capitalize("cancelar")
|
|
1602
|
-
),
|
|
1603
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
|
1604
|
-
import_material9.Button,
|
|
1605
|
-
{
|
|
1606
|
-
"data-testid": "test-aceptar",
|
|
1607
|
-
color: getButtonColor(state),
|
|
1608
|
-
variant: "contained",
|
|
1609
|
-
onClick: (_e = action[0]) == null ? void 0 : _e.fn,
|
|
1610
|
-
disabled: false,
|
|
1611
|
-
size: "small"
|
|
1612
|
-
},
|
|
1613
|
-
capitalize(action[0].text)
|
|
1614
|
-
)
|
|
1615
|
-
)
|
|
1616
|
-
)));
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
2228
|
// src/Components/MultiSelect/MultiSelect.tsx
|
|
1620
|
-
var
|
|
1621
|
-
var
|
|
1622
|
-
var
|
|
2229
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2230
|
+
var import_material11 = require("@mui/material");
|
|
2231
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
1623
2232
|
|
|
1624
2233
|
// src/Components/MultiSelect/helpers/useHandlers.tsx
|
|
1625
|
-
var
|
|
2234
|
+
var import_react14 = require("react");
|
|
1626
2235
|
function useMultiSelectHandlers() {
|
|
1627
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
1628
|
-
const [open, setOpen] = (0,
|
|
1629
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
1630
|
-
const [filterValue, setFilterValue] = (0,
|
|
1631
|
-
const handleOpen = (0,
|
|
2236
|
+
const [anchorEl, setAnchorEl] = (0, import_react14.useState)(null);
|
|
2237
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
2238
|
+
const [selectedItems, setSelectedItems] = (0, import_react14.useState)([]);
|
|
2239
|
+
const [filterValue, setFilterValue] = (0, import_react14.useState)("");
|
|
2240
|
+
const handleOpen = (0, import_react14.useCallback)((e) => {
|
|
1632
2241
|
setAnchorEl(e.currentTarget);
|
|
1633
2242
|
setOpen(true);
|
|
1634
2243
|
}, []);
|
|
1635
|
-
const handleClose = (0,
|
|
2244
|
+
const handleClose = (0, import_react14.useCallback)(() => {
|
|
1636
2245
|
setAnchorEl(null);
|
|
1637
2246
|
setOpen(false);
|
|
1638
2247
|
}, []);
|
|
1639
|
-
const handleFilterChange = (0,
|
|
2248
|
+
const handleFilterChange = (0, import_react14.useCallback)(
|
|
1640
2249
|
(e) => {
|
|
1641
2250
|
setFilterValue(e.target.value);
|
|
1642
2251
|
},
|
|
1643
2252
|
[]
|
|
1644
2253
|
);
|
|
1645
|
-
const handleCheckboxToggle = (0,
|
|
2254
|
+
const handleCheckboxToggle = (0, import_react14.useCallback)((item) => {
|
|
1646
2255
|
setSelectedItems(
|
|
1647
2256
|
(prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
|
|
1648
2257
|
);
|
|
@@ -1663,21 +2272,21 @@ function useMultiSelectHandlers() {
|
|
|
1663
2272
|
|
|
1664
2273
|
// src/Components/MultiSelect/helpers/Utils.tsx
|
|
1665
2274
|
var MuiIcons3 = __toESM(require("@mui/icons-material"), 1);
|
|
1666
|
-
var
|
|
2275
|
+
var import_icons_material9 = require("@mui/icons-material");
|
|
1667
2276
|
function getIconMultiSelect(name) {
|
|
1668
|
-
return name in MuiIcons3 ? MuiIcons3[name] :
|
|
2277
|
+
return name in MuiIcons3 ? MuiIcons3[name] : import_icons_material9.FilterListOutlined;
|
|
1669
2278
|
}
|
|
1670
2279
|
|
|
1671
2280
|
// src/Components/MultiSelect/helpers/useFilteredItems.tsx
|
|
1672
|
-
var
|
|
2281
|
+
var import_react15 = require("react");
|
|
1673
2282
|
function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
|
|
1674
|
-
const filteredItems = (0,
|
|
2283
|
+
const filteredItems = (0, import_react15.useMemo)(
|
|
1675
2284
|
() => items.filter(
|
|
1676
2285
|
(item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
|
|
1677
2286
|
),
|
|
1678
2287
|
[items, filterValue, getItemLabel]
|
|
1679
2288
|
);
|
|
1680
|
-
const sortedItems = (0,
|
|
2289
|
+
const sortedItems = (0, import_react15.useMemo)(() => {
|
|
1681
2290
|
return [
|
|
1682
2291
|
...filteredItems.filter((item) => selectedItems.includes(item)),
|
|
1683
2292
|
...filteredItems.filter((item) => !selectedItems.includes(item))
|
|
@@ -1711,16 +2320,16 @@ function MultiSelect({
|
|
|
1711
2320
|
handleCheckboxToggle,
|
|
1712
2321
|
setOpen
|
|
1713
2322
|
} = useMultiSelectHandlers();
|
|
1714
|
-
(0,
|
|
2323
|
+
(0, import_react16.useEffect)(() => {
|
|
1715
2324
|
if (open !== void 0) {
|
|
1716
2325
|
setOpen(open);
|
|
1717
2326
|
}
|
|
1718
2327
|
}, [open, setOpen]);
|
|
1719
|
-
(0,
|
|
2328
|
+
(0, import_react16.useEffect)(() => {
|
|
1720
2329
|
setSelectedItems([]);
|
|
1721
2330
|
}, [items, setSelectedItems]);
|
|
1722
2331
|
const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
|
|
1723
|
-
const Icon = (0,
|
|
2332
|
+
const Icon = (0, import_react16.useMemo)(() => {
|
|
1724
2333
|
var _a2;
|
|
1725
2334
|
return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
|
|
1726
2335
|
}, [button == null ? void 0 : button.icon]);
|
|
@@ -1734,20 +2343,20 @@ function MultiSelect({
|
|
|
1734
2343
|
{ text: "Aplicar", fn: () => {
|
|
1735
2344
|
} }
|
|
1736
2345
|
];
|
|
1737
|
-
return /* @__PURE__ */
|
|
1738
|
-
|
|
2346
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
2347
|
+
import_material11.Button,
|
|
1739
2348
|
{
|
|
1740
2349
|
"test-id": "multiselect-button",
|
|
1741
2350
|
color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
|
|
1742
2351
|
onClick: handleOpen,
|
|
1743
2352
|
variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
|
|
1744
2353
|
size: "small",
|
|
1745
|
-
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */
|
|
1746
|
-
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */
|
|
2354
|
+
startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ import_react16.default.createElement(Icon, null) : null,
|
|
2355
|
+
endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ import_react16.default.createElement(Icon, null) : null
|
|
1747
2356
|
},
|
|
1748
2357
|
capitalize(textButton != null ? textButton : "MultiSelect")
|
|
1749
|
-
), /* @__PURE__ */
|
|
1750
|
-
|
|
2358
|
+
), /* @__PURE__ */ import_react16.default.createElement(
|
|
2359
|
+
import_material11.Popover,
|
|
1751
2360
|
{
|
|
1752
2361
|
elevation: 8,
|
|
1753
2362
|
anchorEl,
|
|
@@ -1755,8 +2364,8 @@ function MultiSelect({
|
|
|
1755
2364
|
open: openMultiselect,
|
|
1756
2365
|
onClose: () => setOpen(false)
|
|
1757
2366
|
},
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
|
|
2367
|
+
/* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ import_react16.default.createElement(import_material11.FormControl, { fullWidth: true, size: "small" }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2368
|
+
import_material11.TextField,
|
|
1760
2369
|
{
|
|
1761
2370
|
"data-testid": "multiselect-input",
|
|
1762
2371
|
fullWidth: true,
|
|
@@ -1767,29 +2376,29 @@ function MultiSelect({
|
|
|
1767
2376
|
onChange: handleFilterChange,
|
|
1768
2377
|
slotProps: {
|
|
1769
2378
|
input: {
|
|
1770
|
-
endAdornment: /* @__PURE__ */
|
|
2379
|
+
endAdornment: /* @__PURE__ */ import_react16.default.createElement(import_material11.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react16.default.createElement(import_icons_material10.SearchOutlined, { fontSize: "small" }))
|
|
1771
2380
|
}
|
|
1772
2381
|
}
|
|
1773
2382
|
}
|
|
1774
|
-
))), /* @__PURE__ */
|
|
1775
|
-
|
|
2383
|
+
))), /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ import_react16.default.createElement(import_material11.MenuItem, { dense, onClick: handleSelectAll }, /* @__PURE__ */ import_react16.default.createElement(import_material11.ListItemIcon, null, /* @__PURE__ */ import_react16.default.createElement(import_material11.Checkbox, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ import_react16.default.createElement(
|
|
2384
|
+
import_material11.MenuItem,
|
|
1776
2385
|
{
|
|
1777
2386
|
key: getItemLabel(item),
|
|
1778
2387
|
dense,
|
|
1779
2388
|
onClick: () => handleCheckboxToggle(item)
|
|
1780
2389
|
},
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
|
|
2390
|
+
/* @__PURE__ */ import_react16.default.createElement(import_material11.ListItemIcon, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
2391
|
+
import_material11.Checkbox,
|
|
1783
2392
|
{
|
|
1784
2393
|
checked: selectedItems.includes(item),
|
|
1785
2394
|
color: "primary"
|
|
1786
2395
|
}
|
|
1787
2396
|
)),
|
|
1788
2397
|
getItemLabel(item)
|
|
1789
|
-
)) : /* @__PURE__ */
|
|
2398
|
+
)) : /* @__PURE__ */ import_react16.default.createElement(import_material11.MenuItem, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ import_react16.default.createElement(import_material11.Stack, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
|
|
1790
2399
|
var _a2;
|
|
1791
|
-
return /* @__PURE__ */
|
|
1792
|
-
|
|
2400
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2401
|
+
import_material11.Button,
|
|
1793
2402
|
{
|
|
1794
2403
|
key: index,
|
|
1795
2404
|
variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
|
|
@@ -1804,8 +2413,8 @@ function MultiSelect({
|
|
|
1804
2413
|
}
|
|
1805
2414
|
|
|
1806
2415
|
// src/Components/PageHeader/PageHeader.tsx
|
|
1807
|
-
var
|
|
1808
|
-
var
|
|
2416
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2417
|
+
var import_material12 = require("@mui/material");
|
|
1809
2418
|
var PageHeader = ({
|
|
1810
2419
|
title,
|
|
1811
2420
|
subtitle,
|
|
@@ -1814,8 +2423,8 @@ var PageHeader = ({
|
|
|
1814
2423
|
fixed,
|
|
1815
2424
|
shadow = true
|
|
1816
2425
|
}) => {
|
|
1817
|
-
return /* @__PURE__ */
|
|
1818
|
-
|
|
2426
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
2427
|
+
import_material12.Stack,
|
|
1819
2428
|
{
|
|
1820
2429
|
"data-testid": "main-container",
|
|
1821
2430
|
justifyContent: "center",
|
|
@@ -1826,13 +2435,13 @@ var PageHeader = ({
|
|
|
1826
2435
|
zIndex: 10,
|
|
1827
2436
|
sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
|
|
1828
2437
|
},
|
|
1829
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ import_react17.default.createElement(import_material12.Stack, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ import_react17.default.createElement(import_material12.Stack, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ import_react17.default.createElement(import_material12.Stack, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ import_react17.default.createElement(import_material12.Typography, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ import_react17.default.createElement(import_material12.Typography, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.primary" }, subtitle))), actions && /* @__PURE__ */ import_react17.default.createElement(import_material12.Stack, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
|
|
1830
2439
|
);
|
|
1831
2440
|
};
|
|
1832
2441
|
|
|
1833
2442
|
// src/Components/SCCalendarSwipeable.tsx
|
|
1834
|
-
var
|
|
1835
|
-
var
|
|
2443
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
2444
|
+
var import_material13 = require("@mui/material");
|
|
1836
2445
|
var import_Grid24 = __toESM(require("@mui/material/Grid2"), 1);
|
|
1837
2446
|
var import_AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
1838
2447
|
var import_LocalizationProvider2 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
@@ -1850,14 +2459,14 @@ var SCCalendarSwipeable = ({
|
|
|
1850
2459
|
state
|
|
1851
2460
|
}) => {
|
|
1852
2461
|
let convertFecha;
|
|
1853
|
-
const [fecha, setFecha] = (0,
|
|
1854
|
-
const [fechaSeleccionada, setFechaSeleccionada] = (0,
|
|
1855
|
-
const [stateVal, setstateVal] =
|
|
1856
|
-
const [openCalendar, setOpenCalendar] =
|
|
2462
|
+
const [fecha, setFecha] = (0, import_react18.useState)(/* @__PURE__ */ new Date());
|
|
2463
|
+
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react18.useState)();
|
|
2464
|
+
const [stateVal, setstateVal] = import_react18.default.useState(/* @__PURE__ */ new Date());
|
|
2465
|
+
const [openCalendar, setOpenCalendar] = import_react18.default.useState(false);
|
|
1857
2466
|
const hoy = /* @__PURE__ */ new Date();
|
|
1858
2467
|
const inicioSemana = (0, import_date_fns.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
1859
2468
|
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns.addDays)(inicioSemana, i));
|
|
1860
|
-
|
|
2469
|
+
import_react18.default.useEffect(() => {
|
|
1861
2470
|
if (fecha != null) {
|
|
1862
2471
|
handleConvertFecha(fecha);
|
|
1863
2472
|
}
|
|
@@ -1876,12 +2485,8 @@ var SCCalendarSwipeable = ({
|
|
|
1876
2485
|
setOpenCalendar(newOpen);
|
|
1877
2486
|
};
|
|
1878
2487
|
const locale = __spreadValues({}, import_locale.es);
|
|
1879
|
-
return /* @__PURE__ */
|
|
1880
|
-
|
|
1881
|
-
padding: "12px 0px",
|
|
1882
|
-
background: "transparent"
|
|
1883
|
-
} }, diasSemana.map((dia) => /* @__PURE__ */ import_react16.default.createElement(import_Grid24.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react16.default.createElement(import_material12.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react16.default.createElement(import_material12.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns.format)(dia, "EEEE", { locale: import_locale.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react16.default.createElement(
|
|
1884
|
-
import_material12.Box,
|
|
2488
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_LocalizationProvider2.LocalizationProvider, { dateAdapter: import_AdapterDateFns.AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ import_react18.default.createElement(import_material13.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react18.default.createElement(import_material13.Box, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ import_react18.default.createElement(import_Grid24.default, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 0px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ import_react18.default.createElement(import_Grid24.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react18.default.createElement(import_material13.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react18.default.createElement(import_material13.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns.format)(dia, "EEEE", { locale: import_locale.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react18.default.createElement(
|
|
2489
|
+
import_material13.Box,
|
|
1885
2490
|
{
|
|
1886
2491
|
onClick: () => setFecha(dia),
|
|
1887
2492
|
sx: {
|
|
@@ -1896,8 +2501,8 @@ var SCCalendarSwipeable = ({
|
|
|
1896
2501
|
//height: '36px',
|
|
1897
2502
|
}
|
|
1898
2503
|
},
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
)))), /* @__PURE__ */
|
|
2504
|
+
/* @__PURE__ */ import_react18.default.createElement(import_material13.Typography, { sx: { fontSize: "12px !important", color: (0, import_date_fns.isSameDay)(dia, fecha) ? "white" : "#101840DE" } }, (0, import_date_fns.format)(dia, "d"))
|
|
2505
|
+
)))), /* @__PURE__ */ import_react18.default.createElement(import_Grid24.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react18.default.createElement(import_material13.IconButton, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ import_react18.default.createElement(import_KeyboardDoubleArrowDown.default, null))))) : /* @__PURE__ */ import_react18.default.createElement(import_material13.Box, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ import_react18.default.createElement(
|
|
1901
2506
|
import_StaticDatePicker.StaticDatePicker,
|
|
1902
2507
|
{
|
|
1903
2508
|
orientation: "landscape",
|
|
@@ -1907,17 +2512,17 @@ var SCCalendarSwipeable = ({
|
|
|
1907
2512
|
sx: { fontSize: "12px !important", height: "300px !important", background: background ? background : "white", "& .MuiDayCalendar-header": { justifyContent: "space-between" }, "& .MuiDayCalendar-weekContainer": { justifyContent: "space-between" }, "& .MuiPickersCalendarHeader-root": { paddingLeft: "0px", paddingRight: "0px", color: "#10184099" }, "& .MuiPickersDay-root": { fontSize: "12px !important" }, "& .MuiDayCalendar-weekDayLabel": { fontSize: "12px !important" } },
|
|
1908
2513
|
onChange: (newValue) => setFecha(newValue)
|
|
1909
2514
|
}
|
|
1910
|
-
), /* @__PURE__ */
|
|
2515
|
+
), /* @__PURE__ */ import_react18.default.createElement(import_Grid24.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react18.default.createElement(import_material13.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react18.default.createElement(import_KeyboardDoubleArrowUp.default, null))))));
|
|
1911
2516
|
};
|
|
1912
2517
|
|
|
1913
2518
|
// src/Components/SCDataGrid.tsx
|
|
1914
|
-
var
|
|
2519
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
1915
2520
|
var import_x_data_grid_pro = require("@mui/x-data-grid-pro");
|
|
1916
2521
|
var import_x_license_pro2 = require("@mui/x-license-pro");
|
|
1917
2522
|
var import_KeyboardArrowDown = __toESM(require("@mui/icons-material/KeyboardArrowDown"), 1);
|
|
1918
2523
|
var import_KeyboardArrowUp = __toESM(require("@mui/icons-material/KeyboardArrowUp"), 1);
|
|
1919
2524
|
var import_styles = require("@mui/material/styles");
|
|
1920
|
-
|
|
2525
|
+
function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }) {
|
|
1921
2526
|
import_x_license_pro2.LicenseInfo.setLicenseKey(
|
|
1922
2527
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
1923
2528
|
);
|
|
@@ -1928,45 +2533,80 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1928
2533
|
return Math.floor(Math.random() * 1e6);
|
|
1929
2534
|
}
|
|
1930
2535
|
const getTreeDataPaths = (row) => {
|
|
2536
|
+
var _a, _b, _c;
|
|
2537
|
+
const group1Value = groupColumns && ((_a = groupColumns(row)) == null ? void 0 : _a.valueGroup1);
|
|
2538
|
+
const group2Value = groupColumns && ((_b = groupColumns(row)) == null ? void 0 : _b.valueGroup2);
|
|
2539
|
+
const fieldValue = groupColumns && ((_c = groupColumns(row)) == null ? void 0 : _c.fieldFirstColumn);
|
|
1931
2540
|
return [
|
|
1932
|
-
|
|
1933
|
-
...
|
|
1934
|
-
`${
|
|
2541
|
+
String(group1Value || ""),
|
|
2542
|
+
...group2Value ? [String(group2Value)] : [],
|
|
2543
|
+
`${String(fieldValue || "")}/${generateRandomId()}`
|
|
1935
2544
|
];
|
|
1936
2545
|
};
|
|
1937
2546
|
const groupingColDefs = {
|
|
1938
2547
|
field: "grouping",
|
|
1939
|
-
headerName: groupColumns
|
|
2548
|
+
headerName: groupColumns ? groupColumns(data[0]).headerNameFirstColumn : "Agrupador",
|
|
1940
2549
|
renderCell: (params) => {
|
|
1941
|
-
var _a;
|
|
2550
|
+
var _a, _b;
|
|
1942
2551
|
let label = params.value.toString().includes("/") ? params.value.split("/")[0].toString() : params.value.toString();
|
|
1943
|
-
|
|
1944
|
-
if (groupColumns
|
|
2552
|
+
let maxDepth = 0;
|
|
2553
|
+
if (groupColumns && data.length > 0) {
|
|
2554
|
+
const sampleItem = groupColumns(data[0]);
|
|
2555
|
+
if (sampleItem.valueGroup1) maxDepth++;
|
|
2556
|
+
if (sampleItem.valueGroup2) maxDepth++;
|
|
2557
|
+
maxDepth = Math.max(0, maxDepth - 1);
|
|
2558
|
+
}
|
|
2559
|
+
if (groupColumns) {
|
|
1945
2560
|
if (params.rowNode.depth === 0) {
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
2561
|
+
let customLabel = label;
|
|
2562
|
+
if (groupColumns) {
|
|
2563
|
+
const originalItem = data.find(
|
|
2564
|
+
(item) => {
|
|
2565
|
+
var _a2;
|
|
2566
|
+
return String((_a2 = groupColumns(item)) == null ? void 0 : _a2.valueGroup1) === label;
|
|
2567
|
+
}
|
|
2568
|
+
);
|
|
2569
|
+
if (originalItem) {
|
|
2570
|
+
const itemValue = groupColumns(originalItem);
|
|
2571
|
+
customLabel = itemValue.textGroup1 || label;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
const subgroup1 = arrayRows.filter((r) => {
|
|
2575
|
+
var _a2;
|
|
2576
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === label;
|
|
2577
|
+
}).map((r) => {
|
|
2578
|
+
var _a2;
|
|
2579
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup2);
|
|
2580
|
+
});
|
|
1952
2581
|
const groupedDataLength1 = subgroup1.filter((valor, indiceActual, arreglo) => arreglo.indexOf(valor) === indiceActual);
|
|
1953
|
-
label = `${
|
|
1954
|
-
} else if (groupColumns
|
|
1955
|
-
const labelGrouping1 = (
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2582
|
+
label = `${customLabel} (${groupedDataLength1.length})`;
|
|
2583
|
+
} else if (((_a = groupColumns(data[0])) == null ? void 0 : _a.valueGroup2) && params.rowNode.depth === 1) {
|
|
2584
|
+
const labelGrouping1 = (_b = params.api.getRowNode(params.rowNode.parent)) == null ? void 0 : _b.groupingKey.toString();
|
|
2585
|
+
let customLabel = label;
|
|
2586
|
+
if (groupColumns) {
|
|
2587
|
+
const originalItem = data.find(
|
|
2588
|
+
(item) => {
|
|
2589
|
+
var _a2;
|
|
2590
|
+
return String((_a2 = groupColumns(item)) == null ? void 0 : _a2.valueGroup2) === label;
|
|
2591
|
+
}
|
|
2592
|
+
);
|
|
2593
|
+
if (originalItem) {
|
|
2594
|
+
const itemValue = groupColumns(originalItem);
|
|
2595
|
+
customLabel = itemValue.textGroup2 || label;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
1961
2598
|
const groupedDataLength2 = arrayRows.filter(
|
|
1962
|
-
(r) =>
|
|
2599
|
+
(r) => {
|
|
2600
|
+
var _a2, _b2;
|
|
2601
|
+
return groupColumns && String((_a2 = groupColumns(r)) == null ? void 0 : _a2.valueGroup1) === labelGrouping1 && groupColumns && String((_b2 = groupColumns(r)) == null ? void 0 : _b2.valueGroup2) === label;
|
|
2602
|
+
}
|
|
1963
2603
|
).length;
|
|
1964
|
-
label = `${
|
|
2604
|
+
label = `${customLabel} (${groupedDataLength2})`;
|
|
1965
2605
|
} else {
|
|
1966
2606
|
label = label;
|
|
1967
2607
|
}
|
|
1968
2608
|
}
|
|
1969
|
-
return /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1970
2610
|
"div",
|
|
1971
2611
|
{
|
|
1972
2612
|
style: {
|
|
@@ -1983,7 +2623,7 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1983
2623
|
fontWeight: params.rowNode.type == "group" ? "400" : "300"
|
|
1984
2624
|
}
|
|
1985
2625
|
},
|
|
1986
|
-
params.rowNode.type === "group" && /* @__PURE__ */
|
|
2626
|
+
params.rowNode.type === "group" && /* @__PURE__ */ import_react19.default.createElement(
|
|
1987
2627
|
"span",
|
|
1988
2628
|
{
|
|
1989
2629
|
style: {
|
|
@@ -1996,25 +2636,32 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
1996
2636
|
params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
|
|
1997
2637
|
}
|
|
1998
2638
|
},
|
|
1999
|
-
params.rowNode.childrenExpanded ? /* @__PURE__ */
|
|
2639
|
+
params.rowNode.childrenExpanded ? /* @__PURE__ */ import_react19.default.createElement(import_KeyboardArrowUp.default, { fontSize: "small", color: "action" }) : /* @__PURE__ */ import_react19.default.createElement(import_KeyboardArrowDown.default, { fontSize: "small", color: "action" })
|
|
2000
2640
|
),
|
|
2001
2641
|
label
|
|
2002
2642
|
);
|
|
2003
2643
|
},
|
|
2004
2644
|
colSpan: (params) => {
|
|
2645
|
+
var _a, _b;
|
|
2005
2646
|
const value = String(params);
|
|
2006
|
-
const fieldGrouping1 = groupColumns[0]
|
|
2007
|
-
const fieldGrouping2 = groupColumns
|
|
2647
|
+
const fieldGrouping1 = groupColumns ? (_a = groupColumns(data[0])) == null ? void 0 : _a.valueGroup1 : void 0;
|
|
2648
|
+
const fieldGrouping2 = groupColumns ? (_b = groupColumns(data[0])) == null ? void 0 : _b.valueGroup2 : void 0;
|
|
2008
2649
|
let agrupado1 = false;
|
|
2009
2650
|
let agrupado2 = false;
|
|
2010
2651
|
if (fieldGrouping1 != void 0) {
|
|
2011
2652
|
agrupado1 = arrayRows.some(
|
|
2012
|
-
(row) =>
|
|
2653
|
+
(row) => {
|
|
2654
|
+
var _a2;
|
|
2655
|
+
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup1) === value;
|
|
2656
|
+
}
|
|
2013
2657
|
);
|
|
2014
2658
|
}
|
|
2015
2659
|
if (fieldGrouping2 != void 0) {
|
|
2016
2660
|
agrupado2 = arrayRows.some(
|
|
2017
|
-
(row) =>
|
|
2661
|
+
(row) => {
|
|
2662
|
+
var _a2;
|
|
2663
|
+
return groupColumns && String((_a2 = groupColumns(row)) == null ? void 0 : _a2.valueGroup2) === value;
|
|
2664
|
+
}
|
|
2018
2665
|
);
|
|
2019
2666
|
}
|
|
2020
2667
|
if (agrupado1 || agrupado2) {
|
|
@@ -2031,11 +2678,11 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2031
2678
|
let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
|
|
2032
2679
|
let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
|
|
2033
2680
|
let validationGroupingColDef = groupingColDefs || {};
|
|
2034
|
-
const [groupDataLenght, setGroupDataLengh] = (0,
|
|
2035
|
-
const [pageSize, setPageSize] = (0,
|
|
2036
|
-
const [arrayRows, setArrayRows] = (0,
|
|
2037
|
-
const [selectionModel, setSelectionModel] = (0,
|
|
2038
|
-
(0,
|
|
2681
|
+
const [groupDataLenght, setGroupDataLengh] = (0, import_react19.useState)(0);
|
|
2682
|
+
const [pageSize, setPageSize] = (0, import_react19.useState)(rows);
|
|
2683
|
+
const [arrayRows, setArrayRows] = (0, import_react19.useState)([]);
|
|
2684
|
+
const [selectionModel, setSelectionModel] = (0, import_react19.useState)([]);
|
|
2685
|
+
(0, import_react19.useEffect)(() => {
|
|
2039
2686
|
if ((data == null ? void 0 : data.length) > 0) {
|
|
2040
2687
|
dataConvertRows(data, void 0);
|
|
2041
2688
|
}
|
|
@@ -2091,7 +2738,7 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2091
2738
|
setSelectionModel([...newSelection]);
|
|
2092
2739
|
}
|
|
2093
2740
|
};
|
|
2094
|
-
return /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, data && /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2095
2742
|
import_x_data_grid_pro.DataGridPro,
|
|
2096
2743
|
{
|
|
2097
2744
|
apiRef,
|
|
@@ -2125,7 +2772,6 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2125
2772
|
},
|
|
2126
2773
|
sx: {
|
|
2127
2774
|
maxHeight: maxHeight ? `${maxHeight}px` : "none",
|
|
2128
|
-
//overflow: 'auto',
|
|
2129
2775
|
"& .MuiDataGrid-filler": {
|
|
2130
2776
|
display: "none !important"
|
|
2131
2777
|
},
|
|
@@ -2155,42 +2801,54 @@ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelec
|
|
|
2155
2801
|
}
|
|
2156
2802
|
}
|
|
2157
2803
|
))));
|
|
2158
|
-
}
|
|
2159
|
-
var SCDataGrid =
|
|
2160
|
-
const isEqual = prevProps.
|
|
2804
|
+
}
|
|
2805
|
+
var SCDataGrid = import_react19.default.memo(SCDataGridInitial, (prevProps, nextProps) => {
|
|
2806
|
+
const isEqual = prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
|
|
2161
2807
|
return isEqual;
|
|
2162
2808
|
});
|
|
2163
2809
|
|
|
2164
2810
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2165
|
-
var
|
|
2166
|
-
var
|
|
2811
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
2812
|
+
var import_material14 = require("@mui/material");
|
|
2167
2813
|
|
|
2168
|
-
// src/assets/ImgEmptyState/create.
|
|
2169
|
-
var
|
|
2814
|
+
// src/assets/ImgEmptyState/create.tsx
|
|
2815
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
2816
|
+
var Create = () => {
|
|
2817
|
+
return /* @__PURE__ */ import_react20.default.createElement("svg", { width: "45", height: "41", viewBox: "0 0 45 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react20.default.createElement("g", { "clip-path": "url(#clip0_1283_39624)" }, /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.4956 13.1869C44.4386 13.8714 43.8367 14.3801 43.1514 14.3231L39.9978 14.0608C39.3124 14.0038 38.8032 13.4027 38.8602 12.7182C38.9173 12.0336 39.5191 11.525 40.2044 11.582L43.3581 11.8443C44.0434 11.9013 44.5527 12.5024 44.4956 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M41.0393 1.01388C41.4429 1.57002 41.3187 2.34766 40.7619 2.75078L38.099 4.6787C37.5423 5.08182 36.7637 4.95777 36.3601 4.40163C35.9565 3.84548 36.0807 3.06785 36.6375 2.66473L39.3004 0.736804C39.8572 0.333685 40.6357 0.457736 41.0393 1.01388Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M36.6656 21.2361C36.1755 21.7179 36.1692 22.5054 36.6515 22.9949L38.9584 25.3363C39.4408 25.8258 40.2291 25.8321 40.7193 25.3503C41.2094 24.8685 41.2157 24.0811 40.7333 23.5915L38.4264 21.2502C37.9441 20.7606 37.1557 20.7543 36.6656 21.2361Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.504365 13.1869C0.561439 13.8714 1.16326 14.3801 1.84856 14.323L5.00224 14.0607C5.68755 14.0037 6.19683 13.4026 6.13976 12.7181C6.08268 12.0336 5.48087 11.5249 4.79556 11.5819L1.64188 11.8442C0.956574 11.9012 0.447291 12.5023 0.504365 13.1869Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.95913 1.01431C3.55554 1.57046 3.67974 2.34809 4.23653 2.75121L6.8994 4.67914C7.45619 5.08225 8.23473 4.9582 8.63832 4.40206C9.04191 3.84592 8.91771 3.06828 8.36092 2.66516L5.69805 0.737237C5.14126 0.334118 4.36272 0.458169 3.95913 1.01431Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.33389 21.236C8.82403 21.7178 8.83033 22.5053 8.34796 22.9949L6.04107 25.3362C5.5587 25.8257 4.77034 25.832 4.28021 25.3502C3.79008 24.8684 3.78378 24.081 4.26614 23.5914L6.57304 21.2501C7.0554 20.7605 7.84376 20.7542 8.33389 21.236Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { d: "M19.1448 37.3573H25.5804L25.1621 38.889C25.0636 39.2498 24.7356 39.5 24.3613 39.5H20.3638C19.9895 39.5 19.6615 39.2498 19.563 38.889L19.1448 37.3573Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { d: "M17.6534 35.3665C17.5381 34.8487 17.9326 34.3575 18.4637 34.3575H26.3983C26.9294 34.3575 27.3239 34.8487 27.2087 35.3665L26.9829 36.3814C26.8563 36.9504 26.351 37.3553 25.7674 37.3553H19.0946C18.511 37.3553 18.0057 36.9504 17.8791 36.3814L17.6534 35.3665Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react20.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.85423 13.9906C8.85423 6.60807 14.935 0.652473 22.3998 0.652473C29.8646 0.652473 35.9455 6.60807 35.9455 13.9906C35.9455 17.6153 34.4759 20.9015 32.0983 23.3022C31.9627 23.4392 31.8257 23.5745 31.6935 23.7052L31.6917 23.707C30.7961 24.5922 30.1385 25.2699 29.8494 26.1116C29.7242 26.4761 29.6012 27.1915 29.4988 28.0885C29.4002 28.9527 29.3306 29.8872 29.2854 30.6281C29.2099 31.864 28.1896 32.8547 26.9266 32.8547H17.8731C16.6101 32.8547 15.5898 31.864 15.5143 30.6281C15.469 29.8872 15.3995 28.9527 15.3009 28.0885C15.1985 27.1915 15.0755 26.4761 14.9503 26.1116C14.6612 25.2699 14.0036 24.5922 13.108 23.707L13.106 23.7051C12.9739 23.5744 12.837 23.4391 12.7014 23.3022C10.3238 20.9015 8.85423 17.6153 8.85423 13.9906ZM22.3998 2.85676C16.1214 2.85676 11.0611 7.85765 11.0611 13.9906C11.0611 17.0068 12.2813 19.7437 14.2703 21.752C14.3969 21.8798 14.526 22.0075 14.6602 22.1401C14.6831 22.1627 14.7062 22.1855 14.7294 22.2085C15.5402 23.0091 16.5655 24.0215 17.0377 25.3961C17.2505 26.0156 17.3925 26.9534 17.4936 27.8388C17.5983 28.757 17.6707 29.7342 17.7171 30.4939C17.723 30.59 17.8001 30.6504 17.8731 30.6504H26.9266C26.9996 30.6504 27.0767 30.59 27.0826 30.4939C27.129 29.7342 27.2013 28.757 27.3061 27.8388C27.4072 26.9534 27.5492 26.0156 27.762 25.3961C28.2342 24.0215 29.2594 23.0091 30.0702 22.2085C30.0935 22.1855 30.1166 22.1627 30.1395 22.1401C30.2737 22.0075 30.4028 21.8798 30.5294 21.752C32.5184 19.7437 33.7386 17.0068 33.7386 13.9906C33.7386 7.85765 28.6783 2.85676 22.3998 2.85676Z", fill: "#B9BDC1" })), /* @__PURE__ */ import_react20.default.createElement("defs", null, /* @__PURE__ */ import_react20.default.createElement("clipPath", { id: "clip0_1283_39624" }, /* @__PURE__ */ import_react20.default.createElement("rect", { width: "44", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2818
|
+
};
|
|
2170
2819
|
|
|
2171
|
-
// src/assets/ImgEmptyState/
|
|
2172
|
-
var
|
|
2820
|
+
// src/assets/ImgEmptyState/empty.tsx
|
|
2821
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
2822
|
+
var Empty = () => {
|
|
2823
|
+
return /* @__PURE__ */ import_react21.default.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement("g", { "clip-path": "url(#clip0_1283_39626)" }, /* @__PURE__ */ import_react21.default.createElement("path", { d: "M36.1351 20.9955C25.1396 25.3151 16.1875 30.5689 11.8186 30.9221L14.7134 35.4696L36.1351 20.9955Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M37.4531 24.9937C39.7468 28.137 42.9751 35.0522 37.4531 35.3441C34.9101 35.4058 31.3306 32.981 37.4531 24.9937Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react21.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M25.6074 1.30001C25.1055 0.501016 24.051 0.26003 23.2522 0.761943L19.6474 3.02673C17.5114 2.68138 14.5326 2.642 12.1799 3.71891C10.8937 4.30766 9.75284 5.25155 9.09396 6.68863C8.65845 7.63849 8.46029 8.74589 8.52317 10.0159L1.2996 14.5543C0.500747 15.0562 0.260156 16.1108 0.762045 16.9098L12.7907 36.0589C13.2926 36.8579 14.3471 37.0989 15.1459 36.597L37.0985 22.8046C37.8973 22.3027 38.1379 21.2481 37.636 20.4491L25.6074 1.30001ZM2.79326 16.1347L8.88857 12.3051C8.91842 12.3953 8.95405 12.4868 8.99634 12.5777C9.70948 14.1097 11.2554 15.9861 13.7088 16.7327C16.2084 17.4934 19.3887 17.0049 23.1824 14.2981L23.3709 14.1636L22.1324 12.4273L21.9439 12.5618C18.5121 15.0104 16.0132 15.2048 14.3292 14.6924C12.5992 14.1659 11.458 12.8132 10.9295 11.6778C10.9197 11.6569 10.9072 11.6225 10.8968 11.5772C10.8595 11.4156 10.8267 11.2584 10.7981 11.1054L24.0275 2.79363L35.6048 21.2243L14.3706 34.5653L2.79326 16.1347ZM13.0675 5.65821C14.0932 5.18871 15.3429 4.98089 16.5902 4.94754L10.716 8.63821C10.7826 8.23367 10.8925 7.88269 11.0323 7.57786C11.4327 6.70447 12.1364 6.08441 13.0675 5.65821Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M24.3482 14.3207C24.0493 15.6305 22.7454 16.4497 21.4358 16.1505C20.1262 15.8513 19.3069 14.547 19.6058 13.2372C19.9047 11.9274 21.2086 11.1082 22.5182 11.4074C23.8278 11.7066 24.6471 13.011 24.3482 14.3207Z", fill: "#CED1D4" })), /* @__PURE__ */ import_react21.default.createElement("defs", null, /* @__PURE__ */ import_react21.default.createElement("clipPath", { id: "clip0_1283_39626" }, /* @__PURE__ */ import_react21.default.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2824
|
+
};
|
|
2173
2825
|
|
|
2174
|
-
// src/assets/ImgEmptyState/
|
|
2175
|
-
var
|
|
2826
|
+
// src/assets/ImgEmptyState/error.tsx
|
|
2827
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
2828
|
+
var Error2 = () => {
|
|
2829
|
+
return /* @__PURE__ */ import_react22.default.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.8035 3.2925C17.0304 3.2925 16.358 3.82772 16.1913 4.58349L14.0944 13.8188C13.8625 14.8535 14.6474 15.8412 15.7066 15.8412H25.4175C26.4764 15.8412 27.2677 14.8538 27.0297 13.8185L24.9328 4.58323C24.7608 3.82996 24.0975 3.29514 23.3264 3.2925H17.8035ZM15.9436 13.9945L17.9555 5.13336L23.1745 5.12121L25.1863 13.9945H15.9436Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react22.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5449 28.1551C10.7717 28.1551 10.0993 28.6904 9.93264 29.4462L8.54048 35.6049C8.46109 35.7863 8.54048 35.6049 8.46109 35.7863H5.42145C4.91308 35.7863 4.50096 36.1984 4.50096 36.7068C4.50096 37.2152 4.91308 37.6273 5.42145 37.6273H35.5795C36.0879 37.6273 36.5 37.2152 36.5 36.7068C36.5 36.1984 36.0879 35.7863 35.5795 35.7863H32.595C32.5443 35.6284 32.5801 35.745 32.5443 35.5928L31.1121 29.4342C30.9394 28.6844 30.2672 28.1551 29.5 28.1551H11.5449ZM10.3781 35.7863L11.6854 29.9961H29.3426L30.6891 35.7863H10.3781Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react22.default.createElement("path", { d: "M13.7368 17.4381H28.0252C28.2486 17.4381 28.4434 17.5928 28.495 17.8162L30.271 25.9114C30.334 26.2094 30.1106 26.4901 29.8012 26.4901H11.6743C11.3649 26.4901 11.1358 26.1979 11.2102 25.8943L13.2727 17.799C13.3243 17.587 13.519 17.4381 13.7368 17.4381Z", fill: "#CED1D4" }));
|
|
2830
|
+
};
|
|
2176
2831
|
|
|
2177
|
-
// src/assets/ImgEmptyState/search.
|
|
2178
|
-
var
|
|
2832
|
+
// src/assets/ImgEmptyState/search.tsx
|
|
2833
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
2834
|
+
var Search2 = () => {
|
|
2835
|
+
return /* @__PURE__ */ import_react23.default.createElement("svg", { width: "41", height: "41", viewBox: "0 0 41 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react23.default.createElement("g", { "clip-path": "url(#clip0_1283_39628)" }, /* @__PURE__ */ import_react23.default.createElement("path", { d: "M29.421 4.71198C28.943 2.92749 30.0021 1.09315 31.7865 0.61487C33.5709 0.136592 35.405 1.19549 35.883 2.97998L40.3853 19.7878C40.8633 21.5723 39.8042 23.4066 38.0198 23.8849C36.2354 24.3632 34.4013 23.3043 33.9233 21.5198L29.421 4.71198Z", fill: "#CED1D4" }), /* @__PURE__ */ import_react23.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.607749 18.613C0.158895 16.9369 1.15336 15.2141 2.82895 14.7649C4.50454 14.3157 6.22674 15.3102 6.67559 16.9862L8.06043 22.1573C8.50928 23.8333 7.51482 25.5561 5.83923 26.0054C4.16364 26.4546 2.44144 25.46 1.99259 23.784L0.607749 18.613ZM3.41576 16.9561C2.95002 17.0809 2.67359 17.5598 2.79836 18.0257L4.18319 23.1967C4.30796 23.6626 4.78667 23.939 5.25242 23.8142C5.71816 23.6893 5.99459 23.2104 5.86982 22.7445L4.48499 17.5735C4.36022 17.1076 3.88151 16.8312 3.41576 16.9561Z", fill: "#B9BDC1" }), /* @__PURE__ */ import_react23.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.0672 23.7222C17.6115 24.3518 16.9814 24.8602 16.2239 25.1659L23.5692 38.9314C23.929 39.6056 23.6742 40.4438 23.0003 40.8037C22.3263 41.1635 21.4883 40.9087 21.1286 40.2346L14.2002 27.2506L6.15159 39.7788C5.73857 40.4217 4.88273 40.6079 4.24003 40.1948C3.59732 39.7816 3.41113 38.9255 3.82416 38.2826L12.4422 24.8681C11.8201 24.4937 11.2926 23.9601 10.9267 23.3057L6.9728 23.4848C6.43282 23.5092 5.94855 23.1546 5.80865 22.6324L4.48764 17.7008C4.34775 17.1786 4.5899 16.6293 5.06976 16.3804L11.2775 13.1606L11.2169 12.934C11.0764 12.4095 11.3213 11.8581 11.8046 11.6107L26.5904 4.04383C26.8999 3.88542 27.2644 3.87542 27.5822 4.01662C27.8999 4.15781 28.1369 4.43508 28.2269 4.77102L32.7303 21.5831C32.8203 21.9191 32.7537 22.2777 32.5491 22.5589C32.3445 22.8401 32.0238 23.0137 31.6766 23.0314L18.0672 23.7222ZM17.9643 23.1894C18.1495 22.8739 18.2903 22.5322 18.3806 22.1748C18.4139 22.0434 18.4403 21.9098 18.4596 21.7746C18.4048 22.1588 18.2927 22.5298 18.1297 22.876C18.0793 22.983 18.0241 23.0876 17.9643 23.1894ZM18.8739 21.375L30.1375 20.8032L26.3713 6.7432L13.6819 13.2372L14.6854 16.9834C16.5391 17.0063 18.2272 18.2517 18.7306 20.1311C18.8421 20.5473 18.8877 20.9656 18.8739 21.375ZM12.4612 17.5793C11.2373 18.3061 10.4581 19.6082 10.3898 21.0243L7.79324 21.142L6.95134 17.999L11.8877 15.4386L12.4612 17.5793ZM15.1332 23.1064C16.1692 22.8287 16.784 21.7635 16.5064 20.7272C16.2288 19.6909 15.164 19.0759 14.128 19.3536C13.092 19.6313 12.4772 20.6965 12.7547 21.7328C12.9527 22.4718 13.5511 22.9972 14.2553 23.1365C14.2923 23.1351 14.3294 23.1351 14.3667 23.1366C14.4569 23.1402 14.5456 23.1526 14.6318 23.1732C14.797 23.173 14.9652 23.1515 15.1332 23.1064Z", fill: "#B9BDC1" })), /* @__PURE__ */ import_react23.default.createElement("defs", null, /* @__PURE__ */ import_react23.default.createElement("clipPath", { id: "clip0_1283_39628" }, /* @__PURE__ */ import_react23.default.createElement("rect", { width: "40", height: "40", fill: "white", transform: "translate(0.5 0.5)" }))));
|
|
2836
|
+
};
|
|
2179
2837
|
|
|
2180
2838
|
// src/Components/EmptyState/EmptyState.tsx
|
|
2181
2839
|
var EmptyStateImageUrls = {
|
|
2182
|
-
create:
|
|
2183
|
-
error:
|
|
2184
|
-
noResult:
|
|
2185
|
-
search:
|
|
2840
|
+
create: /* @__PURE__ */ import_react24.default.createElement(Create, null),
|
|
2841
|
+
error: /* @__PURE__ */ import_react24.default.createElement(Error2, null),
|
|
2842
|
+
noResult: /* @__PURE__ */ import_react24.default.createElement(Empty, null),
|
|
2843
|
+
search: /* @__PURE__ */ import_react24.default.createElement(Search2, null)
|
|
2186
2844
|
};
|
|
2187
2845
|
var DefaultIcon = ({
|
|
2188
2846
|
state = "create",
|
|
2189
2847
|
size = "large"
|
|
2190
2848
|
}) => {
|
|
2191
|
-
const
|
|
2849
|
+
const Icon = EmptyStateImageUrls[state];
|
|
2192
2850
|
const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
|
|
2193
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", null, Icon);
|
|
2194
2852
|
};
|
|
2195
2853
|
var EmptyState = ({
|
|
2196
2854
|
state = "create",
|
|
@@ -2199,12 +2857,12 @@ var EmptyState = ({
|
|
|
2199
2857
|
subtitle,
|
|
2200
2858
|
actions,
|
|
2201
2859
|
containerHeight = "100vh",
|
|
2202
|
-
icon = /* @__PURE__ */
|
|
2860
|
+
icon = /* @__PURE__ */ import_react24.default.createElement(DefaultIcon, { state, size })
|
|
2203
2861
|
}) => {
|
|
2204
2862
|
const titleVariant = size === "small" ? "subtitle2" : "h6";
|
|
2205
2863
|
const subtitleVariant = size === "small" ? "caption" : "body1";
|
|
2206
|
-
return /* @__PURE__ */
|
|
2207
|
-
|
|
2864
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
2865
|
+
import_material14.Stack,
|
|
2208
2866
|
{
|
|
2209
2867
|
alignItems: "center",
|
|
2210
2868
|
justifyContent: "center",
|
|
@@ -2212,17 +2870,17 @@ var EmptyState = ({
|
|
|
2212
2870
|
height: containerHeight,
|
|
2213
2871
|
"data-testid": "empty-state-container"
|
|
2214
2872
|
},
|
|
2215
|
-
icon && /* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
|
|
2873
|
+
icon && /* @__PURE__ */ import_react24.default.createElement(import_material14.Stack, null, icon),
|
|
2874
|
+
/* @__PURE__ */ import_react24.default.createElement(import_material14.Stack, { gap: 0.5 }, /* @__PURE__ */ import_react24.default.createElement(import_material14.Typography, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ import_react24.default.createElement(
|
|
2875
|
+
import_material14.Typography,
|
|
2218
2876
|
{
|
|
2219
2877
|
variant: subtitleVariant,
|
|
2220
2878
|
textAlign: "center",
|
|
2221
2879
|
color: "text.secondary"
|
|
2222
2880
|
},
|
|
2223
2881
|
subtitle
|
|
2224
|
-
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */
|
|
2225
|
-
|
|
2882
|
+
), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ import_react24.default.createElement(
|
|
2883
|
+
import_material14.Stack,
|
|
2226
2884
|
{
|
|
2227
2885
|
direction: "row",
|
|
2228
2886
|
spacing: 2,
|
|
@@ -2231,15 +2889,15 @@ var EmptyState = ({
|
|
|
2231
2889
|
},
|
|
2232
2890
|
actions.map((action, index) => {
|
|
2233
2891
|
var _a, _b, _c, _d;
|
|
2234
|
-
return /* @__PURE__ */
|
|
2235
|
-
|
|
2892
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
2893
|
+
import_material14.Button,
|
|
2236
2894
|
{
|
|
2237
2895
|
key: index,
|
|
2238
2896
|
color: (_a = action.color) != null ? _a : "primary",
|
|
2239
2897
|
variant: (_b = action.variant) != null ? _b : "text",
|
|
2240
2898
|
size: (_c = action.size) != null ? _c : "small",
|
|
2241
|
-
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */
|
|
2242
|
-
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */
|
|
2899
|
+
startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ import_react24.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2900
|
+
endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ import_react24.default.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
|
|
2243
2901
|
onClick: action.onClick
|
|
2244
2902
|
},
|
|
2245
2903
|
capitalize((_d = action.text) != null ? _d : "action")
|
|
@@ -2250,8 +2908,8 @@ var EmptyState = ({
|
|
|
2250
2908
|
};
|
|
2251
2909
|
|
|
2252
2910
|
// src/Components/SCDialog.tsx
|
|
2253
|
-
var
|
|
2254
|
-
var
|
|
2911
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
2912
|
+
var import_material15 = require("@mui/material");
|
|
2255
2913
|
var import_Grid25 = __toESM(require("@mui/material/Grid2"), 1);
|
|
2256
2914
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
|
|
2257
2915
|
var Muicon5 = __toESM(require("@mui/icons-material"), 1);
|
|
@@ -2260,8 +2918,8 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2260
2918
|
let iconTitleValidation = "";
|
|
2261
2919
|
let IconTitle;
|
|
2262
2920
|
let ButtonIcon;
|
|
2263
|
-
const [open, setOpen] = (0,
|
|
2264
|
-
(0,
|
|
2921
|
+
const [open, setOpen] = (0, import_react25.useState)(show);
|
|
2922
|
+
(0, import_react25.useEffect)(() => {
|
|
2265
2923
|
if (show) {
|
|
2266
2924
|
handleOpen();
|
|
2267
2925
|
} else {
|
|
@@ -2286,7 +2944,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2286
2944
|
});
|
|
2287
2945
|
if (iconTitle) {
|
|
2288
2946
|
if (Muicon5[iconTitle] == void 0) {
|
|
2289
|
-
if (iconTitle &&
|
|
2947
|
+
if (iconTitle && import_react25.default.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
2290
2948
|
iconTitleValidation = "image";
|
|
2291
2949
|
IconTitle = iconTitle;
|
|
2292
2950
|
} else {
|
|
@@ -2311,9 +2969,9 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2311
2969
|
}
|
|
2312
2970
|
};
|
|
2313
2971
|
const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
|
|
2314
|
-
content = content != null ? content : { component: /* @__PURE__ */
|
|
2315
|
-
return /* @__PURE__ */
|
|
2316
|
-
|
|
2972
|
+
content = content != null ? content : { component: /* @__PURE__ */ import_react25.default.createElement(import_material15.Box, null, " Aqui va el contenido ") };
|
|
2973
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", null, buttonDialog ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ import_react25.default.createElement(import_material15.Tooltip, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ import_react25.default.createElement(import_material15.Button, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ import_react25.default.createElement(ButtonIcon, null) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ import_react25.default.createElement(ButtonIcon, null) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ import_react25.default.createElement(import_material15.IconButton, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ import_react25.default.createElement(import_material15.SvgIcon, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ import_react25.default.createElement(import_material15.Modal, { open: open || false, onClose: handleClose }, /* @__PURE__ */ import_react25.default.createElement(
|
|
2974
|
+
import_material15.Dialog,
|
|
2317
2975
|
{
|
|
2318
2976
|
"data-testid": "dialog-element",
|
|
2319
2977
|
open: open || false,
|
|
@@ -2326,9 +2984,9 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2326
2984
|
}
|
|
2327
2985
|
}
|
|
2328
2986
|
},
|
|
2329
|
-
title && /* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
|
|
2987
|
+
title && /* @__PURE__ */ import_react25.default.createElement(import_material15.DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ import_react25.default.createElement(import_Grid25.default, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ import_react25.default.createElement(import_Grid25.default, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ import_react25.default.createElement(import_material15.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react25.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react25.default.createElement(import_material15.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ import_react25.default.createElement(import_Grid25.default, null, /* @__PURE__ */ import_react25.default.createElement(import_material15.Typography, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ import_react25.default.createElement(import_material15.Typography, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ import_react25.default.createElement(import_material15.IconButton, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ import_react25.default.createElement(import_Close2.default, null)) : "")),
|
|
2988
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
2989
|
+
import_material15.DialogContent,
|
|
2332
2990
|
{
|
|
2333
2991
|
"data-testid": "dialog-content",
|
|
2334
2992
|
dividers: dividers ? dividers : false,
|
|
@@ -2355,7 +3013,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2355
3013
|
}
|
|
2356
3014
|
}
|
|
2357
3015
|
},
|
|
2358
|
-
content.url ? /* @__PURE__ */
|
|
3016
|
+
content.url ? /* @__PURE__ */ import_react25.default.createElement(
|
|
2359
3017
|
"iframe",
|
|
2360
3018
|
{
|
|
2361
3019
|
style: { border: "none", minWidth: "100%", minHeight: "100%" },
|
|
@@ -2365,20 +3023,20 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2365
3023
|
}
|
|
2366
3024
|
) : content.component
|
|
2367
3025
|
),
|
|
2368
|
-
dialogActions.length > 0 ? /* @__PURE__ */
|
|
2369
|
-
|
|
3026
|
+
dialogActions.length > 0 ? /* @__PURE__ */ import_react25.default.createElement(import_material15.DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement(
|
|
3027
|
+
import_material15.Button,
|
|
2370
3028
|
{
|
|
2371
3029
|
variant: "text",
|
|
2372
3030
|
color: dialogActions[0].color || "primary",
|
|
2373
3031
|
size: "small",
|
|
2374
3032
|
onClick: dialogActions[0].fn,
|
|
2375
3033
|
disabled: dialogActions[0].disabled || false,
|
|
2376
|
-
startIcon: dialogActions[0].icon ? /* @__PURE__ */
|
|
3034
|
+
startIcon: dialogActions[0].icon ? /* @__PURE__ */ import_react25.default.createElement(import_material15.SvgIcon, { fontSize: "small", component: dialogActions[0].icon }) : void 0
|
|
2377
3035
|
},
|
|
2378
3036
|
dialogActions[0].text
|
|
2379
|
-
), /* @__PURE__ */
|
|
2380
|
-
return /* @__PURE__ */
|
|
2381
|
-
|
|
3037
|
+
), /* @__PURE__ */ import_react25.default.createElement(import_material15.Box, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
|
|
3038
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3039
|
+
import_material15.Button,
|
|
2382
3040
|
{
|
|
2383
3041
|
key: index + 1,
|
|
2384
3042
|
variant: index === dialogActions.length - 2 ? "contained" : "text",
|
|
@@ -2386,13 +3044,13 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2386
3044
|
size: "small",
|
|
2387
3045
|
onClick: boton.fn,
|
|
2388
3046
|
disabled: boton.disabled || false,
|
|
2389
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
3047
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react25.default.createElement(import_material15.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
2390
3048
|
},
|
|
2391
3049
|
boton.text
|
|
2392
3050
|
);
|
|
2393
3051
|
}))) : dialogActions.map((boton, index) => {
|
|
2394
|
-
return /* @__PURE__ */
|
|
2395
|
-
|
|
3052
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3053
|
+
import_material15.Button,
|
|
2396
3054
|
{
|
|
2397
3055
|
key: index,
|
|
2398
3056
|
variant: index === dialogActions.length - 1 ? "contained" : "text",
|
|
@@ -2400,7 +3058,7 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2400
3058
|
size: "small",
|
|
2401
3059
|
onClick: boton.fn,
|
|
2402
3060
|
disabled: boton.disabled || false,
|
|
2403
|
-
startIcon: boton.icon ? /* @__PURE__ */
|
|
3061
|
+
startIcon: boton.icon ? /* @__PURE__ */ import_react25.default.createElement(import_material15.SvgIcon, { fontSize: "small", component: boton.icon }) : void 0
|
|
2404
3062
|
},
|
|
2405
3063
|
boton.text
|
|
2406
3064
|
);
|
|
@@ -2408,13 +3066,55 @@ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, di
|
|
|
2408
3066
|
)));
|
|
2409
3067
|
};
|
|
2410
3068
|
|
|
2411
|
-
// src/Components/
|
|
2412
|
-
var
|
|
2413
|
-
var
|
|
3069
|
+
// src/Components/SCListContent.tsx
|
|
3070
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
3071
|
+
var import_material16 = require("@mui/material");
|
|
2414
3072
|
var import_Grid26 = __toESM(require("@mui/material/Grid2"), 1);
|
|
3073
|
+
var Muicon6 = __toESM(require("@mui/icons-material"), 1);
|
|
3074
|
+
var SCListContent = ({ options }) => {
|
|
3075
|
+
const [selectedIndex, setSelectedIndex] = import_react26.default.useState("1");
|
|
3076
|
+
const [value, setValue] = import_react26.default.useState("1");
|
|
3077
|
+
options.map(function(option, index, array) {
|
|
3078
|
+
if (option == null ? void 0 : option.iconLeft) {
|
|
3079
|
+
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
3080
|
+
option.iconLeft = Muicon6[option == null ? void 0 : option.iconLeft];
|
|
3081
|
+
} else {
|
|
3082
|
+
option;
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
if (option == null ? void 0 : option.iconRight) {
|
|
3086
|
+
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
3087
|
+
option.iconRight = Muicon6[option == null ? void 0 : option.iconRight];
|
|
3088
|
+
} else {
|
|
3089
|
+
option;
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(import_material16.List, { sx: { width: "100%", maxWidth: 360, bgcolor: "background.paper", padding: "0px !important" } }, options.map((option, index) => /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, { key: index }, /* @__PURE__ */ import_react26.default.createElement(
|
|
3094
|
+
import_material16.ListItemButton,
|
|
3095
|
+
{
|
|
3096
|
+
disabled: option.disable,
|
|
3097
|
+
onClick: option.fn
|
|
3098
|
+
},
|
|
3099
|
+
option.iconLeft ? /* @__PURE__ */ import_react26.default.createElement(import_material16.ListItemIcon, { sx: { minWidth: "30px !important" } }, /* @__PURE__ */ import_react26.default.createElement(import_material16.SvgIcon, { fontSize: "small", color: option.iconLeftColor || "action", component: option.iconLeft })) : "",
|
|
3100
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
3101
|
+
import_material16.ListItemText,
|
|
3102
|
+
{
|
|
3103
|
+
primary: option.title,
|
|
3104
|
+
secondary: /* @__PURE__ */ import_react26.default.createElement(import_Grid26.default, { gap: 0.5 }, /* @__PURE__ */ import_react26.default.createElement(import_Grid26.default, { container: true, gap: 0.5 }, option.subtitle), /* @__PURE__ */ import_react26.default.createElement(import_Grid26.default, { container: true, gap: 0.5 }, option.description))
|
|
3105
|
+
}
|
|
3106
|
+
),
|
|
3107
|
+
option.iconRight ? /* @__PURE__ */ import_react26.default.createElement(import_material16.ListItemIcon, { sx: { minWidth: "0px !important" } }, /* @__PURE__ */ import_react26.default.createElement(import_material16.SvgIcon, { fontSize: "small", color: option.iconRightColor || "action", component: option.iconRight })) : ""
|
|
3108
|
+
), option.divider == true ? /* @__PURE__ */ import_react26.default.createElement(import_material16.Divider, null) : ""))));
|
|
3109
|
+
};
|
|
3110
|
+
|
|
3111
|
+
// src/Components/SCMenu.tsx
|
|
3112
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
3113
|
+
var import_material17 = require("@mui/material");
|
|
3114
|
+
var import_Grid27 = __toESM(require("@mui/material/Grid2"), 1);
|
|
2415
3115
|
|
|
2416
3116
|
// src/Components/Hooks/useWindowDimensions.ts
|
|
2417
|
-
var
|
|
3117
|
+
var import_react27 = require("react");
|
|
2418
3118
|
function getWindowDimensions() {
|
|
2419
3119
|
const { innerWidth: width, innerHeight: height } = window;
|
|
2420
3120
|
return {
|
|
@@ -2423,8 +3123,8 @@ function getWindowDimensions() {
|
|
|
2423
3123
|
};
|
|
2424
3124
|
}
|
|
2425
3125
|
function useWindowDimensions() {
|
|
2426
|
-
const [windowDimensions, setWindowDimensions] = (0,
|
|
2427
|
-
(0,
|
|
3126
|
+
const [windowDimensions, setWindowDimensions] = (0, import_react27.useState)(getWindowDimensions());
|
|
3127
|
+
(0, import_react27.useEffect)(() => {
|
|
2428
3128
|
function handleResize() {
|
|
2429
3129
|
setWindowDimensions(getWindowDimensions());
|
|
2430
3130
|
}
|
|
@@ -2435,19 +3135,19 @@ function useWindowDimensions() {
|
|
|
2435
3135
|
}
|
|
2436
3136
|
|
|
2437
3137
|
// src/Components/SCMenu.tsx
|
|
2438
|
-
var
|
|
3138
|
+
var Muicon7 = __toESM(require("@mui/icons-material"), 1);
|
|
2439
3139
|
var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }) => {
|
|
2440
3140
|
const { height, width } = useWindowDimensions();
|
|
2441
3141
|
const menuSize = widthMenu ? parseInt(widthMenu) : 284;
|
|
2442
3142
|
const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
|
|
2443
3143
|
const widthContainer = menuSize + pageSize;
|
|
2444
3144
|
let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2445
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2446
|
-
const [value, setValue] =
|
|
2447
|
-
|
|
3145
|
+
const [selectedIndex, setSelectedIndex] = import_react28.default.useState("1");
|
|
3146
|
+
const [value, setValue] = import_react28.default.useState("1");
|
|
3147
|
+
import_react28.default.useEffect(() => {
|
|
2448
3148
|
heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
|
|
2449
3149
|
}, [height]);
|
|
2450
|
-
|
|
3150
|
+
import_react28.default.useEffect(() => {
|
|
2451
3151
|
if (defaultOption) {
|
|
2452
3152
|
handleClickMenusItem(event, void 0);
|
|
2453
3153
|
}
|
|
@@ -2455,14 +3155,14 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2455
3155
|
options.map(function(option, index, array) {
|
|
2456
3156
|
if (option == null ? void 0 : option.iconLeft) {
|
|
2457
3157
|
if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
|
|
2458
|
-
option.iconLeft =
|
|
3158
|
+
option.iconLeft = Muicon7[option == null ? void 0 : option.iconLeft];
|
|
2459
3159
|
} else {
|
|
2460
3160
|
option;
|
|
2461
3161
|
}
|
|
2462
3162
|
}
|
|
2463
3163
|
if (option == null ? void 0 : option.iconRight) {
|
|
2464
3164
|
if ((option == null ? void 0 : option.iconRight.type) == void 0) {
|
|
2465
|
-
option.iconRight =
|
|
3165
|
+
option.iconRight = Muicon7[option == null ? void 0 : option.iconRight];
|
|
2466
3166
|
} else {
|
|
2467
3167
|
option;
|
|
2468
3168
|
}
|
|
@@ -2477,34 +3177,34 @@ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu,
|
|
|
2477
3177
|
setValue(String(index + 1));
|
|
2478
3178
|
}
|
|
2479
3179
|
};
|
|
2480
|
-
return /* @__PURE__ */
|
|
2481
|
-
|
|
3180
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement(import_Grid27.default, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ import_react28.default.createElement(import_material17.Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ import_react28.default.createElement(import_material17.MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement(
|
|
3181
|
+
import_material17.MenuItem,
|
|
2482
3182
|
{
|
|
2483
3183
|
disabled: disable == true ? true : false,
|
|
2484
3184
|
key: index,
|
|
2485
3185
|
selected: String(index + 1) === selectedIndex,
|
|
2486
3186
|
onClick: (event2) => handleClickMenusItem(event2, index)
|
|
2487
3187
|
},
|
|
2488
|
-
option.iconLeft ? /* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
), option.divider == true ? /* @__PURE__ */
|
|
3188
|
+
option.iconLeft ? /* @__PURE__ */ import_react28.default.createElement(import_material17.ListItemIcon, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react28.default.createElement(import_material17.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
|
|
3189
|
+
/* @__PURE__ */ import_react28.default.createElement(import_Grid27.default, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ import_react28.default.createElement(import_material17.Typography, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ import_react28.default.createElement(import_material17.ListItemIcon, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ import_react28.default.createElement(import_material17.SvgIcon, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
|
|
3190
|
+
), option.divider == true ? /* @__PURE__ */ import_react28.default.createElement(import_material17.Divider, null) : "")))), /* @__PURE__ */ import_react28.default.createElement(import_Grid27.default, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ import_react28.default.createElement(import_material17.Box, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ import_react28.default.createElement(import_material17.Typography, { color: "error" }, "No se ha configurado el componente a visualizar")))));
|
|
2491
3191
|
};
|
|
2492
3192
|
|
|
2493
3193
|
// src/Components/SCTabs.tsx
|
|
2494
|
-
var
|
|
2495
|
-
var
|
|
3194
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
3195
|
+
var import_material18 = require("@mui/material");
|
|
2496
3196
|
var import_TabPanel = __toESM(require("@mui/lab/TabPanel"), 1);
|
|
2497
3197
|
var import_TabContext = __toESM(require("@mui/lab/TabContext"), 1);
|
|
2498
|
-
var
|
|
3198
|
+
var Muicon8 = __toESM(require("@mui/icons-material"), 1);
|
|
2499
3199
|
var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
|
|
2500
|
-
const [toast, setToast] =
|
|
3200
|
+
const [toast, setToast] = import_react29.default.useState(null);
|
|
2501
3201
|
let i = 0;
|
|
2502
3202
|
let j = 0;
|
|
2503
3203
|
let k = 0;
|
|
2504
3204
|
let l = 0;
|
|
2505
3205
|
let validateTypeIcon = true;
|
|
2506
|
-
const [value, setValue] =
|
|
2507
|
-
(0,
|
|
3206
|
+
const [value, setValue] = import_react29.default.useState("1");
|
|
3207
|
+
(0, import_react29.useEffect)(() => {
|
|
2508
3208
|
if (defaultOption) {
|
|
2509
3209
|
handleChange(event, void 0);
|
|
2510
3210
|
}
|
|
@@ -2513,9 +3213,9 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2513
3213
|
const optionsLength = options.length;
|
|
2514
3214
|
if (option == null ? void 0 : option.iconOrBadge) {
|
|
2515
3215
|
if (typeIcon == "icon") {
|
|
2516
|
-
if ((option == null ? void 0 : option.iconOrBadge) in
|
|
3216
|
+
if ((option == null ? void 0 : option.iconOrBadge) in Muicon8 == true) {
|
|
2517
3217
|
validateTypeIcon = true;
|
|
2518
|
-
option.iconOrBadge =
|
|
3218
|
+
option.iconOrBadge = Muicon8[option == null ? void 0 : option.iconOrBadge];
|
|
2519
3219
|
} else {
|
|
2520
3220
|
validateTypeIcon = false;
|
|
2521
3221
|
setTimeout(() => {
|
|
@@ -2529,7 +3229,7 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2529
3229
|
return;
|
|
2530
3230
|
}
|
|
2531
3231
|
} else if (typeIcon == "badge") {
|
|
2532
|
-
if ((option == null ? void 0 : option.iconOrBadge) in
|
|
3232
|
+
if ((option == null ? void 0 : option.iconOrBadge) in Muicon8 == false) {
|
|
2533
3233
|
validateTypeIcon = true;
|
|
2534
3234
|
option;
|
|
2535
3235
|
} else {
|
|
@@ -2554,8 +3254,8 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2554
3254
|
setValue(newValue);
|
|
2555
3255
|
}
|
|
2556
3256
|
};
|
|
2557
|
-
return /* @__PURE__ */
|
|
2558
|
-
|
|
3257
|
+
return /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ import_react29.default.createElement(import_material18.Box, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ import_react29.default.createElement(import_TabContext.default, { value }, /* @__PURE__ */ import_react29.default.createElement(
|
|
3258
|
+
import_material18.Tabs,
|
|
2559
3259
|
{
|
|
2560
3260
|
"data-testid": "tab-container",
|
|
2561
3261
|
value,
|
|
@@ -2568,8 +3268,8 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2568
3268
|
orientation: orientation || "horizontal",
|
|
2569
3269
|
sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
|
|
2570
3270
|
},
|
|
2571
|
-
options.map((option) => /* @__PURE__ */
|
|
2572
|
-
|
|
3271
|
+
options.map((option) => /* @__PURE__ */ import_react29.default.createElement(
|
|
3272
|
+
import_material18.Tab,
|
|
2573
3273
|
{
|
|
2574
3274
|
"data-testid": "tab-item",
|
|
2575
3275
|
value: String(i = i + 1),
|
|
@@ -2577,8 +3277,8 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2577
3277
|
label: option.name || "",
|
|
2578
3278
|
disabled: option.disabled || false,
|
|
2579
3279
|
iconPosition: iconPosition || "end",
|
|
2580
|
-
icon: typeIcon == "badge" ? /* @__PURE__ */
|
|
2581
|
-
|
|
3280
|
+
icon: typeIcon == "badge" ? /* @__PURE__ */ import_react29.default.createElement(
|
|
3281
|
+
import_material18.Badge,
|
|
2582
3282
|
{
|
|
2583
3283
|
sx: {
|
|
2584
3284
|
width: "20px",
|
|
@@ -2592,33 +3292,38 @@ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colo
|
|
|
2592
3292
|
badgeContent: option.iconOrBadge,
|
|
2593
3293
|
color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
|
|
2594
3294
|
}
|
|
2595
|
-
) : typeIcon == "icon" ? /* @__PURE__ */
|
|
3295
|
+
) : typeIcon == "icon" ? /* @__PURE__ */ import_react29.default.createElement(import_material18.SvgIcon, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
|
|
2596
3296
|
sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
|
|
2597
3297
|
}
|
|
2598
3298
|
))
|
|
2599
|
-
), children, options.map((option) => /* @__PURE__ */
|
|
3299
|
+
), children, options.map((option) => /* @__PURE__ */ import_react29.default.createElement(
|
|
2600
3300
|
import_TabPanel.default,
|
|
2601
3301
|
{
|
|
2602
3302
|
key: k = k + 1,
|
|
2603
3303
|
value: String(l = l + 1),
|
|
2604
3304
|
sx: { padding: "16px" }
|
|
2605
3305
|
},
|
|
2606
|
-
option.page ? option.page : /* @__PURE__ */
|
|
2607
|
-
)))) : /* @__PURE__ */
|
|
3306
|
+
option.page ? option.page : /* @__PURE__ */ import_react29.default.createElement(import_material18.Typography, null, "No se ha configurado el componente a visualizar ")
|
|
3307
|
+
)))) : /* @__PURE__ */ import_react29.default.createElement(import_material18.Box, { sx: { height: "200px" } }, toast && /* @__PURE__ */ import_react29.default.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
|
|
2608
3308
|
};
|
|
2609
3309
|
|
|
2610
3310
|
// src/Components/Calendario/Calendar.tsx
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2613
|
-
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
3311
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
3312
|
+
var import_material24 = require("@mui/material");
|
|
2614
3313
|
|
|
2615
3314
|
// src/Components/Calendario/CalendarToolbar.tsx
|
|
2616
|
-
var
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
3315
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
3316
|
+
var import_icons_material11 = require("@mui/icons-material");
|
|
3317
|
+
var import_material19 = require("@mui/material");
|
|
2619
3318
|
var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
3319
|
+
var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"), 1);
|
|
2620
3320
|
var import_es2 = require("dayjs/locale/es");
|
|
2621
3321
|
import_dayjs2.default.locale("es");
|
|
3322
|
+
import_dayjs2.default.extend(import_updateLocale.default);
|
|
3323
|
+
import_dayjs2.default.updateLocale("en", {
|
|
3324
|
+
weekStart: 0
|
|
3325
|
+
// 0 = domingo
|
|
3326
|
+
});
|
|
2622
3327
|
var CalendarToolbar = ({
|
|
2623
3328
|
labelDate,
|
|
2624
3329
|
view,
|
|
@@ -2626,7 +3331,7 @@ var CalendarToolbar = ({
|
|
|
2626
3331
|
onNavigate,
|
|
2627
3332
|
children
|
|
2628
3333
|
}) => {
|
|
2629
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
3334
|
+
const [anchorEl, setAnchorEl] = (0, import_react30.useState)(null);
|
|
2630
3335
|
const open = Boolean(anchorEl);
|
|
2631
3336
|
const handleMenuOpen = (event2) => {
|
|
2632
3337
|
setAnchorEl(event2.currentTarget);
|
|
@@ -2639,24 +3344,26 @@ var CalendarToolbar = ({
|
|
|
2639
3344
|
handleMenuClose();
|
|
2640
3345
|
};
|
|
2641
3346
|
const getFormattedDate = () => {
|
|
3347
|
+
const sunday = labelDate.day(0);
|
|
2642
3348
|
if (view === "month") {
|
|
2643
|
-
|
|
3349
|
+
const textMonth = labelDate.format("MMMM YYYY");
|
|
3350
|
+
return textMonth.charAt(0).toUpperCase() + textMonth.slice(1);
|
|
2644
3351
|
}
|
|
2645
3352
|
if (view === "week") {
|
|
2646
|
-
return `${labelDate.startOf("week").
|
|
3353
|
+
return `${labelDate.startOf("week").format("DD MMM")} - ${labelDate.endOf("week").format("DD MMM YYYY")}`;
|
|
2647
3354
|
}
|
|
2648
3355
|
return labelDate.format(" DD MMMM YYYY");
|
|
2649
3356
|
};
|
|
2650
|
-
return /* @__PURE__ */
|
|
2651
|
-
|
|
3357
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_material19.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", gap: 0.5, px: 1, py: 0.5 }, /* @__PURE__ */ import_react30.default.createElement(import_material19.Box, null, /* @__PURE__ */ import_react30.default.createElement(
|
|
3358
|
+
import_material19.Chip,
|
|
2652
3359
|
{
|
|
2653
3360
|
label: "Hoy",
|
|
2654
|
-
icon: /* @__PURE__ */
|
|
3361
|
+
icon: /* @__PURE__ */ import_react30.default.createElement(import_icons_material11.LightModeOutlined, { fontSize: "small" }),
|
|
2655
3362
|
color: "primary",
|
|
2656
3363
|
onClick: () => onNavigate("TODAY")
|
|
2657
3364
|
}
|
|
2658
|
-
)), /* @__PURE__ */
|
|
2659
|
-
|
|
3365
|
+
)), /* @__PURE__ */ import_react30.default.createElement(import_material19.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react30.default.createElement(import_material19.IconButton, { "aria-label": "Anterior", onClick: () => onNavigate("PREV"), size: "small", color: "primary" }, /* @__PURE__ */ import_react30.default.createElement(import_icons_material11.ChevronLeft, { fontSize: "small" })), /* @__PURE__ */ import_react30.default.createElement(import_material19.IconButton, { "aria-label": "Siguiente", onClick: () => onNavigate("NEXT"), size: "small", color: "primary" }, /* @__PURE__ */ import_react30.default.createElement(import_icons_material11.ChevronRight, { fontSize: "small" })), /* @__PURE__ */ import_react30.default.createElement(import_material19.Typography, { variant: "h6", color: "primary", "data-testid": "currentDate" }, getFormattedDate()), /* @__PURE__ */ import_react30.default.createElement(import_material19.IconButton, { onClick: handleMenuOpen, size: "small", color: "primary", "aria-label": "Cambiar vista" }, /* @__PURE__ */ import_react30.default.createElement(import_icons_material11.KeyboardArrowDown, { fontSize: "small" })), /* @__PURE__ */ import_react30.default.createElement(
|
|
3366
|
+
import_material19.Menu,
|
|
2660
3367
|
{
|
|
2661
3368
|
anchorEl,
|
|
2662
3369
|
open,
|
|
@@ -2664,15 +3371,15 @@ var CalendarToolbar = ({
|
|
|
2664
3371
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
2665
3372
|
transformOrigin: { vertical: "top", horizontal: "center" }
|
|
2666
3373
|
},
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
)), children ? /* @__PURE__ */
|
|
3374
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material19.MenuItem, { onClick: () => handleViewChange("month") }, "Mes"),
|
|
3375
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material19.MenuItem, { onClick: () => handleViewChange("week") }, "Semana"),
|
|
3376
|
+
/* @__PURE__ */ import_react30.default.createElement(import_material19.MenuItem, { onClick: () => handleViewChange("day") }, "D\xEDa")
|
|
3377
|
+
)), children ? /* @__PURE__ */ import_react30.default.createElement(import_material19.Box, null, children) : /* @__PURE__ */ import_react30.default.createElement(import_material19.Box, { width: "24px" }), " ");
|
|
2671
3378
|
};
|
|
2672
3379
|
|
|
2673
3380
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
2674
|
-
var
|
|
2675
|
-
var
|
|
3381
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
3382
|
+
var import_material21 = require("@mui/material");
|
|
2676
3383
|
var import_Add = __toESM(require("@mui/icons-material/Add"), 1);
|
|
2677
3384
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
2678
3385
|
var import_localeData = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
@@ -2698,21 +3405,32 @@ var stateColors = {
|
|
|
2698
3405
|
Asignada: "warning.main",
|
|
2699
3406
|
Finalizado: "primary.main",
|
|
2700
3407
|
Vencida: "error.main",
|
|
2701
|
-
EnProgreso: "success.main"
|
|
3408
|
+
EnProgreso: "success.main",
|
|
3409
|
+
Aplazada: "grey.400",
|
|
3410
|
+
Generada: "secondary.main"
|
|
2702
3411
|
};
|
|
2703
3412
|
|
|
2704
3413
|
// src/Components/Calendario/Event.tsx
|
|
2705
|
-
var
|
|
2706
|
-
var
|
|
2707
|
-
var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
2708
|
-
|
|
2709
|
-
|
|
3414
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3415
|
+
var import_material20 = require("@mui/material");
|
|
3416
|
+
var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
3417
|
+
const [anchorEl, setAnchorEl] = import_react31.default.useState(null);
|
|
3418
|
+
const handlePopoverOpen = (event3) => {
|
|
3419
|
+
setAnchorEl(event3.currentTarget);
|
|
3420
|
+
};
|
|
3421
|
+
const handlePopoverClose = () => {
|
|
3422
|
+
setAnchorEl(null);
|
|
3423
|
+
};
|
|
3424
|
+
const open = Boolean(anchorEl);
|
|
3425
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
3426
|
+
import_material20.Stack,
|
|
2710
3427
|
{
|
|
2711
3428
|
direction: "row",
|
|
2712
3429
|
padding: 0.5,
|
|
2713
3430
|
borderRadius: 0.5,
|
|
2714
3431
|
alignItems: "flex-start",
|
|
2715
3432
|
minHeight: "20px",
|
|
3433
|
+
onMouseOver: () => onHover == null ? void 0 : onHover(event2),
|
|
2716
3434
|
onClick: (e) => {
|
|
2717
3435
|
e.stopPropagation();
|
|
2718
3436
|
onClick == null ? void 0 : onClick(event2);
|
|
@@ -2725,8 +3443,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2725
3443
|
cursor: onClick ? "pointer" : "default"
|
|
2726
3444
|
}, sx)
|
|
2727
3445
|
},
|
|
2728
|
-
/* @__PURE__ */
|
|
2729
|
-
|
|
3446
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
3447
|
+
import_material20.Divider,
|
|
2730
3448
|
{
|
|
2731
3449
|
orientation: "vertical",
|
|
2732
3450
|
flexItem: true,
|
|
@@ -2737,8 +3455,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2737
3455
|
}
|
|
2738
3456
|
}
|
|
2739
3457
|
),
|
|
2740
|
-
/* @__PURE__ */
|
|
2741
|
-
|
|
3458
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
3459
|
+
import_material20.Box,
|
|
2742
3460
|
{
|
|
2743
3461
|
px: 1,
|
|
2744
3462
|
py: 0.5,
|
|
@@ -2747,8 +3465,8 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2747
3465
|
display: "flex",
|
|
2748
3466
|
alignItems: "center"
|
|
2749
3467
|
},
|
|
2750
|
-
/* @__PURE__ */
|
|
2751
|
-
|
|
3468
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
3469
|
+
import_material20.Typography,
|
|
2752
3470
|
{
|
|
2753
3471
|
color: "text.primary",
|
|
2754
3472
|
variant: "caption",
|
|
@@ -2757,30 +3475,66 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick }) => {
|
|
|
2757
3475
|
overflow: "hidden",
|
|
2758
3476
|
textOverflow: "ellipsis",
|
|
2759
3477
|
whiteSpace: "nowrap"
|
|
2760
|
-
}
|
|
3478
|
+
},
|
|
3479
|
+
onMouseEnter: handlePopoverOpen,
|
|
3480
|
+
onMouseLeave: handlePopoverClose
|
|
3481
|
+
},
|
|
3482
|
+
event2.title.charAt(0).toUpperCase() + event2.title.slice(1).toLowerCase()
|
|
3483
|
+
),
|
|
3484
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
3485
|
+
import_material20.Popover,
|
|
3486
|
+
{
|
|
3487
|
+
id: "mouse-over-popover",
|
|
3488
|
+
sx: { pointerEvents: "none" },
|
|
3489
|
+
open,
|
|
3490
|
+
anchorEl,
|
|
3491
|
+
anchorOrigin: {
|
|
3492
|
+
vertical: "top",
|
|
3493
|
+
horizontal: "right"
|
|
3494
|
+
},
|
|
3495
|
+
transformOrigin: {
|
|
3496
|
+
vertical: "bottom",
|
|
3497
|
+
horizontal: "right"
|
|
3498
|
+
},
|
|
3499
|
+
onClose: handlePopoverClose,
|
|
3500
|
+
disableRestoreFocus: true
|
|
2761
3501
|
},
|
|
2762
|
-
|
|
3502
|
+
onHover ? onHover(event2) : " "
|
|
2763
3503
|
)
|
|
2764
3504
|
)
|
|
2765
3505
|
);
|
|
2766
3506
|
};
|
|
2767
3507
|
|
|
3508
|
+
// src/assets/LogoCalendario.tsx
|
|
3509
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
3510
|
+
var LogoCalendario = () => {
|
|
3511
|
+
return /* @__PURE__ */ import_react32.default.createElement("svg", { width: "60", height: "61", viewBox: "0 0 60 61", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react32.default.createElement("g", { "clip-path": "url(#clip0_5353_24891)" }, /* @__PURE__ */ import_react32.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40.7361 11.1589C39.7792 11.1589 39.0106 11.9722 39.0106 12.9661V15.4375H20.0309V12.9661C20.0309 11.964 19.2545 11.1589 18.3055 11.1589C17.3487 11.1589 16.5801 11.9722 16.5801 12.9661V15.4375H12.8819C12.0652 15.4375 11.4038 16.0918 11.4038 16.8998V20.6551C11.4038 21.463 12.0652 22.1174 12.8819 22.1174H46.8383C47.655 22.1174 48.3165 21.463 48.3165 20.6551V16.8998C48.3165 16.0918 47.655 15.4375 46.8383 15.4375H42.4615V12.9661C42.4615 11.964 41.6851 11.1589 40.7361 11.1589ZM19.4827 19.2049C19.6528 19.1343 19.7361 19.006 19.7724 18.8352C19.6916 18.9714 19.594 19.0957 19.4827 19.2049Z", fill: "#00BCD4" }), /* @__PURE__ */ import_react32.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.2037 25.8653C13.7579 25.8653 13.425 26.2168 13.425 26.6093V47.3669C13.425 47.7595 13.7579 48.1109 14.2037 48.1109H46.0004C46.4782 48.1109 46.8656 47.7236 46.8656 47.2458V26.6093C46.8656 26.2168 46.5327 25.8653 46.087 25.8653H14.2037ZM11.6948 26.6093C11.6948 25.2255 12.8384 24.135 14.2037 24.135H46.087C47.4522 24.135 48.5959 25.2255 48.5959 26.6093V47.2458C48.5959 48.6792 47.4339 49.8412 46.0004 49.8412H14.2037C12.8384 49.8412 11.6948 48.7508 11.6948 47.3669V26.6093Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M19.481 30.9138C19.481 30.5164 20.1155 30.1903 20.9058 30.1903C21.6894 30.1903 22.3305 30.5131 22.3305 30.9138V32.8862C22.3305 33.2836 21.6894 33.6097 20.9058 33.6097C20.1222 33.6097 19.481 33.2869 19.481 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M30.0242 30.1903C29.2339 30.1903 28.5995 30.5164 28.5995 30.9138V32.8862C28.5995 33.2869 29.2406 33.6097 30.0242 33.6097C30.8079 33.6097 31.449 33.2836 31.449 32.8862V30.9138C31.449 30.5131 30.8079 30.1903 30.0242 30.1903Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M37.7179 30.9138C37.7179 30.5164 38.3524 30.1903 39.1427 30.1903C39.608 30.1903 40.022 30.3038 40.2825 30.4797C40.3515 30.5276 40.4116 30.5788 40.4561 30.6344C40.5274 30.7201 40.5675 30.8147 40.5675 30.9138V32.8862C40.5675 33.2836 39.9263 33.6097 39.1427 33.6097C38.3591 33.6097 37.7179 33.2869 37.7179 32.8862V30.9138Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M20.9058 39.8787C20.1155 39.8787 19.481 40.2048 19.481 40.6022V42.5746C19.481 42.687 19.5322 42.7927 19.6213 42.8874C19.7036 42.9731 19.8172 43.0499 19.9552 43.1122C20.2068 43.228 20.5407 43.2981 20.9058 43.2981C21.6894 43.2981 22.3305 42.972 22.3305 42.5746V40.6022C22.3305 40.2015 21.6894 39.8787 20.9058 39.8787Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M29.524 39.9477C29.7087 39.9032 29.9158 39.8787 30.1339 39.8787C30.9176 39.8787 31.5587 40.2015 31.5587 40.6022V42.5746C31.5587 42.972 30.9176 43.2981 30.1339 43.2981C29.3503 43.2981 28.7092 42.9753 28.7092 42.5746V40.6022C28.7092 40.315 29.0409 40.0646 29.524 39.9477Z", fill: "#6392BD" }), /* @__PURE__ */ import_react32.default.createElement("path", { d: "M38.5141 39.9482C38.6989 39.9037 38.9059 39.8792 39.1241 39.8792C39.9077 39.8792 40.5488 40.202 40.5488 40.6027V42.5751C40.5488 42.9725 39.9077 43.2986 39.1241 43.2986C38.3405 43.2986 37.6993 42.9758 37.6993 42.5751V40.6027C37.6993 40.3155 38.031 40.0651 38.5141 39.9482Z", fill: "#6392BD" })), /* @__PURE__ */ import_react32.default.createElement("defs", null, /* @__PURE__ */ import_react32.default.createElement("clipPath", { id: "clip0_5353_24891" }, /* @__PURE__ */ import_react32.default.createElement("rect", { width: "60", height: "60", fill: "white", transform: "translate(0 0.5)" }))));
|
|
3512
|
+
};
|
|
3513
|
+
|
|
2768
3514
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
2769
3515
|
import_dayjs4.default.extend(import_localeData.default);
|
|
2770
3516
|
import_dayjs4.default.extend(import_isBetween.default);
|
|
2771
|
-
var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick }) => {
|
|
3517
|
+
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover }) => {
|
|
3518
|
+
const noEvents = events.length === 0;
|
|
2772
3519
|
const days = getMonthDays(currentDate);
|
|
2773
3520
|
const weekDays = Array.from({ length: 7 }, (_, i) => (0, import_dayjs4.default)().day(i));
|
|
2774
|
-
const [openDrawer, setOpenDrawer] =
|
|
2775
|
-
const [selectedDay, setSelectedDay] =
|
|
2776
|
-
const [selectedEvents, setSelectedEvents] =
|
|
2777
|
-
return /* @__PURE__ */
|
|
3521
|
+
const [openDrawer, setOpenDrawer] = import_react33.default.useState(false);
|
|
3522
|
+
const [selectedDay, setSelectedDay] = import_react33.default.useState(null);
|
|
3523
|
+
const [selectedEvents, setSelectedEvents] = import_react33.default.useState([]);
|
|
3524
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { minWidth: "1050px" }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react33.default.createElement(import_material21.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react33.default.createElement(
|
|
3525
|
+
EmptyState,
|
|
3526
|
+
{
|
|
3527
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3528
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3529
|
+
icon: /* @__PURE__ */ import_react33.default.createElement(LogoCalendario, null)
|
|
3530
|
+
}
|
|
3531
|
+
) : /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: "repeat(7, minmax(150px, 1fr))", gap: 0.5 }, days.map((day) => {
|
|
2778
3532
|
const dayEvents = events.filter(
|
|
2779
3533
|
(e) => day.isBetween(e.start.startOf("day"), e.end.endOf("day"), null, "[]")
|
|
2780
3534
|
);
|
|
2781
3535
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
2782
|
-
return /* @__PURE__ */
|
|
2783
|
-
|
|
3536
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
3537
|
+
import_material21.Paper,
|
|
2784
3538
|
{
|
|
2785
3539
|
key: day.toString(),
|
|
2786
3540
|
onClick: () => onDayClick == null ? void 0 : onDayClick(day),
|
|
@@ -2796,8 +3550,8 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2796
3550
|
overflow: "hidden"
|
|
2797
3551
|
}
|
|
2798
3552
|
},
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
|
|
3553
|
+
/* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { p: 1, flexShrink: 0 }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "flex-start" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3554
|
+
import_material21.Box,
|
|
2801
3555
|
{
|
|
2802
3556
|
sx: {
|
|
2803
3557
|
width: 24,
|
|
@@ -2809,16 +3563,16 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2809
3563
|
justifyContent: "center"
|
|
2810
3564
|
}
|
|
2811
3565
|
},
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
|
|
3566
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
3567
|
+
import_material21.Typography,
|
|
2814
3568
|
{
|
|
2815
3569
|
variant: "body2",
|
|
2816
3570
|
sx: { color: isToday(day) ? "white" : "text.secondary" }
|
|
2817
3571
|
},
|
|
2818
3572
|
day.date()
|
|
2819
3573
|
)
|
|
2820
|
-
), dayEvents.length > 2 && /* @__PURE__ */
|
|
2821
|
-
|
|
3574
|
+
), dayEvents.length > 2 && /* @__PURE__ */ import_react33.default.createElement(import_material21.Tooltip, { title: "M\xE1s eventos" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3575
|
+
import_material21.IconButton,
|
|
2822
3576
|
{
|
|
2823
3577
|
color: "primary",
|
|
2824
3578
|
size: "small",
|
|
@@ -2829,64 +3583,46 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2829
3583
|
setSelectedEvents(dayEvents);
|
|
2830
3584
|
}
|
|
2831
3585
|
},
|
|
2832
|
-
/* @__PURE__ */
|
|
3586
|
+
/* @__PURE__ */ import_react33.default.createElement(import_Add.default, { fontSize: "small" })
|
|
2833
3587
|
)))),
|
|
2834
|
-
/* @__PURE__ */
|
|
3588
|
+
/* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", flexDirection: "column", gap: 0.5, p: 1, pt: 0, overflow: "hidden" }, dayEvents.slice(0, 2).map((event2) => /* @__PURE__ */ import_react33.default.createElement(
|
|
2835
3589
|
CalendarEventCard,
|
|
2836
3590
|
{
|
|
2837
3591
|
key: `${event2.id}-${day.toString()}`,
|
|
2838
3592
|
event: event2,
|
|
2839
3593
|
color: stateColors[event2.state],
|
|
2840
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day)
|
|
3594
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3595
|
+
onHover: onEventHover
|
|
2841
3596
|
}
|
|
2842
3597
|
))),
|
|
2843
|
-
dayEvents.length > 2 && /* @__PURE__ */
|
|
2844
|
-
|
|
3598
|
+
dayEvents.length > 2 && /* @__PURE__ */ import_react33.default.createElement(
|
|
3599
|
+
import_material21.Stack,
|
|
2845
3600
|
{
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
overflow: "visible",
|
|
2866
|
-
textOverflow: "unset"
|
|
2867
|
-
}
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
)), /* @__PURE__ */ import_react25.default.createElement(import_material19.Divider, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ import_react25.default.createElement(import_material19.Typography, { width: "100%", py: 1, color: "text.secondary" }, " Eventos restantes "), /* @__PURE__ */ import_react25.default.createElement(
|
|
2871
|
-
import_material19.Box,
|
|
2872
|
-
{
|
|
2873
|
-
width: "100%",
|
|
2874
|
-
height: "100%",
|
|
2875
|
-
flex: 1,
|
|
2876
|
-
overflow: "auto",
|
|
2877
|
-
p: 1,
|
|
2878
|
-
pt: 1,
|
|
2879
|
-
display: "flex",
|
|
2880
|
-
flexDirection: "column",
|
|
2881
|
-
gap: 1.5
|
|
2882
|
-
},
|
|
2883
|
-
rest.map((event2) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3601
|
+
justifyItems: "center",
|
|
3602
|
+
px: 1,
|
|
3603
|
+
pb: 0.5,
|
|
3604
|
+
onClick: (e) => e.stopPropagation(),
|
|
3605
|
+
sx: { "& .MuiButtonBase-root": { width: "100%" } }
|
|
3606
|
+
},
|
|
3607
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
3608
|
+
SCDrawer,
|
|
3609
|
+
{
|
|
3610
|
+
width: "350px",
|
|
3611
|
+
title: day.format("DD [de] MMMM YYYY"),
|
|
3612
|
+
open: openDrawer,
|
|
3613
|
+
buttonDrawer: { text: `+ ${dayEvents.length}` },
|
|
3614
|
+
anchor: "right",
|
|
3615
|
+
actions: false,
|
|
3616
|
+
arrayElements: [{
|
|
3617
|
+
component: (() => {
|
|
3618
|
+
const [first, ...rest] = dayEvents;
|
|
3619
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { display: "flex", width: "100%", flexDirection: "column", height: "100%", pr: 1.5 }, /* @__PURE__ */ import_react33.default.createElement(import_material21.Typography, { width: "100%", color: "text.secondary" }, " Proximo evento "), first && /* @__PURE__ */ import_react33.default.createElement(import_material21.Box, { p: 1, pb: 1, width: "100%" }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2884
3620
|
CalendarEventCard,
|
|
2885
3621
|
{
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
3622
|
+
event: first,
|
|
3623
|
+
color: stateColors[first.state],
|
|
3624
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(first, day),
|
|
3625
|
+
onHover: onEventHover,
|
|
2890
3626
|
sx: {
|
|
2891
3627
|
whiteSpace: "normal",
|
|
2892
3628
|
"& .MuiTypography-root": {
|
|
@@ -2896,26 +3632,68 @@ var MonthView = ({ events, onDayClick, onMoreClick, currentDate, onEventClick })
|
|
|
2896
3632
|
}
|
|
2897
3633
|
}
|
|
2898
3634
|
}
|
|
2899
|
-
))
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
3635
|
+
)), /* @__PURE__ */ import_react33.default.createElement(import_material21.Divider, { flexItem: true, sx: { width: "100%" } }), /* @__PURE__ */ import_react33.default.createElement(import_material21.Typography, { width: "100%", py: 1, color: "text.secondary" }, " Eventos restantes "), /* @__PURE__ */ import_react33.default.createElement(
|
|
3636
|
+
import_material21.Box,
|
|
3637
|
+
{
|
|
3638
|
+
width: "100%",
|
|
3639
|
+
height: "100%",
|
|
3640
|
+
flex: 1,
|
|
3641
|
+
overflow: "auto",
|
|
3642
|
+
p: 1,
|
|
3643
|
+
pt: 1,
|
|
3644
|
+
display: "flex",
|
|
3645
|
+
flexDirection: "column",
|
|
3646
|
+
gap: 1.5
|
|
3647
|
+
},
|
|
3648
|
+
rest.map((event2) => /* @__PURE__ */ import_react33.default.createElement(
|
|
3649
|
+
CalendarEventCard,
|
|
3650
|
+
{
|
|
3651
|
+
key: `${event2.id}-${day.toString()}`,
|
|
3652
|
+
event: event2,
|
|
3653
|
+
color: stateColors[event2.state],
|
|
3654
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3655
|
+
onHover: onEventHover,
|
|
3656
|
+
sx: {
|
|
3657
|
+
whiteSpace: "normal",
|
|
3658
|
+
"& .MuiTypography-root": {
|
|
3659
|
+
whiteSpace: "normal",
|
|
3660
|
+
overflow: "visible",
|
|
3661
|
+
textOverflow: "unset"
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
}
|
|
3665
|
+
))
|
|
3666
|
+
));
|
|
3667
|
+
})()
|
|
3668
|
+
}]
|
|
3669
|
+
}
|
|
3670
|
+
)
|
|
3671
|
+
)
|
|
2905
3672
|
);
|
|
2906
3673
|
}))));
|
|
2907
3674
|
};
|
|
2908
3675
|
|
|
2909
3676
|
// src/Components/Calendario/Views/WeekView.tsx
|
|
2910
|
-
var
|
|
2911
|
-
var
|
|
3677
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
3678
|
+
var import_material22 = require("@mui/material");
|
|
2912
3679
|
var import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
2913
3680
|
var import_localeData2 = __toESM(require("dayjs/plugin/localeData"), 1);
|
|
2914
3681
|
import_dayjs5.default.extend(import_localeData2.default);
|
|
2915
|
-
var WeekView = ({
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
3682
|
+
var WeekView = ({
|
|
3683
|
+
events,
|
|
3684
|
+
currentDate,
|
|
3685
|
+
isLoading,
|
|
3686
|
+
onDayClick,
|
|
3687
|
+
onEventClick,
|
|
3688
|
+
onEventHover,
|
|
3689
|
+
startHour = 0,
|
|
3690
|
+
endHour = 23
|
|
3691
|
+
}) => {
|
|
3692
|
+
const noEvents = events.length === 0;
|
|
3693
|
+
const todayString = (0, import_dayjs5.default)().format("YYYY-MM-DD");
|
|
3694
|
+
const startOfWeek3 = currentDate.startOf("week");
|
|
3695
|
+
const days = Array.from({ length: 7 }, (_, i) => startOfWeek3.add(i, "day"));
|
|
3696
|
+
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
2919
3697
|
const getCellBorderType = (cellHour, dayEvents) => {
|
|
2920
3698
|
for (const event2 of dayEvents) {
|
|
2921
3699
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -2923,8 +3701,7 @@ var WeekView = ({ events, currentDate, onDayClick, onEventClick }) => {
|
|
|
2923
3701
|
const cellStart = cellHour;
|
|
2924
3702
|
const cellEnd = cellHour + 1;
|
|
2925
3703
|
if (cellEnd > start && cellStart < end) {
|
|
2926
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
2927
|
-
return "full";
|
|
3704
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01) return "full";
|
|
2928
3705
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
2929
3706
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
2930
3707
|
return "middle";
|
|
@@ -2932,92 +3709,122 @@ var WeekView = ({ events, currentDate, onDayClick, onEventClick }) => {
|
|
|
2932
3709
|
}
|
|
2933
3710
|
return "none";
|
|
2934
3711
|
};
|
|
2935
|
-
return /* @__PURE__ */
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
height: 40,
|
|
2940
|
-
flex: 1,
|
|
2941
|
-
pl: 0.5,
|
|
2942
|
-
textAlign: "center",
|
|
2943
|
-
display: "flex",
|
|
2944
|
-
flexDirection: "column",
|
|
2945
|
-
justifyContent: "center",
|
|
2946
|
-
alignItems: "flex-start"
|
|
2947
|
-
},
|
|
2948
|
-
/* @__PURE__ */ import_react26.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
2949
|
-
))), /* @__PURE__ */ import_react26.default.createElement(import_material20.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react26.default.createElement(import_material20.Box, { width: 45, bgcolor: "background.default" }, hours2.map((h) => /* @__PURE__ */ import_react26.default.createElement(
|
|
2950
|
-
import_material20.Box,
|
|
2951
|
-
{
|
|
2952
|
-
key: h,
|
|
2953
|
-
height: 60,
|
|
2954
|
-
textAlign: "right",
|
|
2955
|
-
pr: 1,
|
|
2956
|
-
borderTop: "1px solid",
|
|
2957
|
-
borderColor: "divider"
|
|
2958
|
-
},
|
|
2959
|
-
/* @__PURE__ */ import_react26.default.createElement(import_material20.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs5.default)().hour(h).format("h A"))
|
|
2960
|
-
))), days.map((day) => {
|
|
2961
|
-
const dayEvents = events.filter(
|
|
2962
|
-
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
2963
|
-
);
|
|
2964
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2965
|
-
import_material20.Box,
|
|
3712
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", bgcolor: "transparent" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { width: 45, bgcolor: "transparent" }), days.map((day) => {
|
|
3713
|
+
const isToday2 = day.format("YYYY-MM-DD") === todayString;
|
|
3714
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
3715
|
+
import_material22.Box,
|
|
2966
3716
|
{
|
|
2967
3717
|
key: day.toString(),
|
|
3718
|
+
height: 40,
|
|
2968
3719
|
flex: 1,
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
3720
|
+
pl: 0.5,
|
|
3721
|
+
textAlign: "center",
|
|
3722
|
+
display: "flex",
|
|
3723
|
+
flexDirection: "column",
|
|
3724
|
+
justifyContent: "center",
|
|
3725
|
+
alignItems: "flex-start",
|
|
3726
|
+
bgcolor: isToday2 ? "primary.100" : "transparent",
|
|
3727
|
+
borderRadius: isToday2 ? "6px 6px 0 0" : "0",
|
|
3728
|
+
borderBottom: isToday2 ? 2 : 0,
|
|
3729
|
+
borderColor: isToday2 ? "primary.main" : "transparent"
|
|
2974
3730
|
},
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2978
|
-
import_material20.Box,
|
|
2979
|
-
{
|
|
2980
|
-
key: hourIdx,
|
|
2981
|
-
height: 60,
|
|
2982
|
-
borderTop: "1px solid",
|
|
2983
|
-
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
2984
|
-
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
2985
|
-
}
|
|
2986
|
-
);
|
|
2987
|
-
}),
|
|
2988
|
-
dayEvents.map((event2) => {
|
|
2989
|
-
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(0).minute(0);
|
|
2990
|
-
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(23).minute(59);
|
|
2991
|
-
const startMinutes = eventStart.hour() * 60 + eventStart.minute();
|
|
2992
|
-
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
2993
|
-
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2994
|
-
CalendarEventCard,
|
|
2995
|
-
{
|
|
2996
|
-
key: `${event2.id}-${day.toString()}`,
|
|
2997
|
-
event: event2,
|
|
2998
|
-
color: stateColors[event2.state],
|
|
2999
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3000
|
-
sx: {
|
|
3001
|
-
position: "absolute",
|
|
3002
|
-
top: `${startMinutes + 15}px`,
|
|
3003
|
-
left: 4,
|
|
3004
|
-
right: 4,
|
|
3005
|
-
cursor: "pointer",
|
|
3006
|
-
height: "auto"
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
);
|
|
3010
|
-
})
|
|
3731
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3732
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3011
3733
|
);
|
|
3012
|
-
})))
|
|
3734
|
+
})), isLoading ? /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react34.default.createElement(import_material22.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && noEvents ? /* @__PURE__ */ import_react34.default.createElement(
|
|
3735
|
+
EmptyState,
|
|
3736
|
+
{
|
|
3737
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3738
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3739
|
+
icon: /* @__PURE__ */ import_react34.default.createElement(LogoCalendario, null)
|
|
3740
|
+
}
|
|
3741
|
+
) : (
|
|
3742
|
+
// Grid de horas y eventos
|
|
3743
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react34.default.createElement(import_material22.Box, { width: 45, bgcolor: "transparent" }, hours.map((h) => /* @__PURE__ */ import_react34.default.createElement(
|
|
3744
|
+
import_material22.Box,
|
|
3745
|
+
{
|
|
3746
|
+
key: h,
|
|
3747
|
+
height: 60,
|
|
3748
|
+
textAlign: "right",
|
|
3749
|
+
pr: 1,
|
|
3750
|
+
borderColor: "divider"
|
|
3751
|
+
},
|
|
3752
|
+
/* @__PURE__ */ import_react34.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs5.default)().hour(h).format("h A"))
|
|
3753
|
+
))), days.map((day) => {
|
|
3754
|
+
const dayEvents = events.filter(
|
|
3755
|
+
(event2) => day.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3756
|
+
).filter((event2) => {
|
|
3757
|
+
const startsInRange = event2.start.hour() >= startHour && event2.start.hour() <= endHour;
|
|
3758
|
+
const endsInRange = event2.end.hour() >= startHour && event2.end.hour() <= endHour;
|
|
3759
|
+
return startsInRange || endsInRange;
|
|
3760
|
+
}).sort((a, b) => a.start.valueOf() - b.start.valueOf());
|
|
3761
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
3762
|
+
import_material22.Box,
|
|
3763
|
+
{
|
|
3764
|
+
key: day.toString(),
|
|
3765
|
+
flex: 1,
|
|
3766
|
+
borderLeft: "1px solid",
|
|
3767
|
+
borderColor: "divider",
|
|
3768
|
+
position: "relative",
|
|
3769
|
+
"data-testid": `week-day-column-${day.format("YYYY-MM-DD")}`,
|
|
3770
|
+
onClick: () => onDayClick == null ? void 0 : onDayClick(day)
|
|
3771
|
+
},
|
|
3772
|
+
hours.map((hourIdx) => {
|
|
3773
|
+
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3774
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
3775
|
+
import_material22.Box,
|
|
3776
|
+
{
|
|
3777
|
+
key: hourIdx,
|
|
3778
|
+
height: 60,
|
|
3779
|
+
borderTop: "1px solid",
|
|
3780
|
+
borderColor: borderType === "start" || borderType === "full" || borderType === "none" ? "divider" : "transparent",
|
|
3781
|
+
borderBottom: borderType === "end" || borderType === "full" ? "1px solid divider" : void 0
|
|
3782
|
+
}
|
|
3783
|
+
);
|
|
3784
|
+
}),
|
|
3785
|
+
dayEvents.map((event2) => {
|
|
3786
|
+
const eventStart = day.isSame(event2.start, "day") ? event2.start : day.startOf("day").hour(startHour).minute(0);
|
|
3787
|
+
const eventEnd = day.isSame(event2.end, "day") ? event2.end : day.endOf("day").hour(endHour).minute(59);
|
|
3788
|
+
const startMinutes = (eventStart.hour() - startHour) * 60 + eventStart.minute();
|
|
3789
|
+
const durationMinutes = eventEnd.diff(eventStart, "minute");
|
|
3790
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
3791
|
+
CalendarEventCard,
|
|
3792
|
+
{
|
|
3793
|
+
key: `${event2.id}-${day.toString()}`,
|
|
3794
|
+
event: event2,
|
|
3795
|
+
color: stateColors[event2.state],
|
|
3796
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, day),
|
|
3797
|
+
onHover: onEventHover,
|
|
3798
|
+
sx: {
|
|
3799
|
+
position: "absolute",
|
|
3800
|
+
top: `${startMinutes}px`,
|
|
3801
|
+
left: 4,
|
|
3802
|
+
right: 4,
|
|
3803
|
+
cursor: "pointer",
|
|
3804
|
+
height: `${durationMinutes}px`
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
);
|
|
3808
|
+
})
|
|
3809
|
+
);
|
|
3810
|
+
}))
|
|
3811
|
+
));
|
|
3013
3812
|
};
|
|
3014
3813
|
|
|
3015
3814
|
// src/Components/Calendario/Views/DayView.tsx
|
|
3016
|
-
var
|
|
3017
|
-
var
|
|
3815
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
3816
|
+
var import_material23 = require("@mui/material");
|
|
3018
3817
|
var import_dayjs6 = __toESM(require("dayjs"), 1);
|
|
3019
|
-
var
|
|
3020
|
-
|
|
3818
|
+
var DayView = ({
|
|
3819
|
+
events,
|
|
3820
|
+
currentDate,
|
|
3821
|
+
isLoading,
|
|
3822
|
+
onEventClick,
|
|
3823
|
+
onEventHover,
|
|
3824
|
+
startHour = 0,
|
|
3825
|
+
endHour = 24
|
|
3826
|
+
}) => {
|
|
3827
|
+
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
3021
3828
|
const getCellBorderType = (cellHour, dayEvents2) => {
|
|
3022
3829
|
for (const event2 of dayEvents2) {
|
|
3023
3830
|
const start = event2.start.hour() + event2.start.minute() / 60;
|
|
@@ -3025,8 +3832,7 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3025
3832
|
const cellStart = cellHour;
|
|
3026
3833
|
const cellEnd = cellHour + 1;
|
|
3027
3834
|
if (cellEnd > start && cellStart < end) {
|
|
3028
|
-
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01)
|
|
3029
|
-
return "full";
|
|
3835
|
+
if (Math.abs(cellStart - start) < 0.01 && Math.abs(cellEnd - end) < 0.01) return "full";
|
|
3030
3836
|
if (Math.abs(cellStart - start) < 0.01) return "start";
|
|
3031
3837
|
if (Math.abs(cellEnd - end) < 0.01) return "end";
|
|
3032
3838
|
return "middle";
|
|
@@ -3037,21 +3843,16 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3037
3843
|
const dayEvents = events.filter(
|
|
3038
3844
|
(event2) => currentDate.isBetween(event2.start.startOf("day"), event2.end.endOf("day"), null, "[]")
|
|
3039
3845
|
);
|
|
3040
|
-
|
|
3041
|
-
|
|
3846
|
+
const noEvents = events.length === 0;
|
|
3847
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { width: 47, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react35.default.createElement(import_material23.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : noEvents ? /* @__PURE__ */ import_react35.default.createElement(
|
|
3848
|
+
EmptyState,
|
|
3042
3849
|
{
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
bgcolor: "primary.50"
|
|
3050
|
-
},
|
|
3051
|
-
/* @__PURE__ */ import_react27.default.createElement(import_material21.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")),
|
|
3052
|
-
/* @__PURE__ */ import_react27.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd"))
|
|
3053
|
-
)), /* @__PURE__ */ import_react27.default.createElement(import_material21.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react27.default.createElement(import_material21.Box, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ import_react27.default.createElement(
|
|
3054
|
-
import_material21.Box,
|
|
3850
|
+
title: "Inicia la gesti\xF3n de las actividades",
|
|
3851
|
+
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3852
|
+
icon: /* @__PURE__ */ import_react35.default.createElement(LogoCalendario, null)
|
|
3853
|
+
}
|
|
3854
|
+
) : /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { display: "flex", flex: 1 }, /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { width: 47, bgcolor: "background.default" }, hours.map((h) => /* @__PURE__ */ import_react35.default.createElement(
|
|
3855
|
+
import_material23.Box,
|
|
3055
3856
|
{
|
|
3056
3857
|
key: h,
|
|
3057
3858
|
height: 60,
|
|
@@ -3061,11 +3862,11 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3061
3862
|
borderRight: "1px solid",
|
|
3062
3863
|
borderColor: "divider"
|
|
3063
3864
|
},
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
))), /* @__PURE__ */
|
|
3865
|
+
/* @__PURE__ */ import_react35.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, (0, import_dayjs6.default)().hour(h).format("h A"))
|
|
3866
|
+
))), /* @__PURE__ */ import_react35.default.createElement(import_material23.Box, { flex: 1, position: "relative" }, hours.map((hourIdx) => {
|
|
3066
3867
|
const borderType = getCellBorderType(hourIdx, dayEvents);
|
|
3067
|
-
return /* @__PURE__ */
|
|
3068
|
-
|
|
3868
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
3869
|
+
import_material23.Box,
|
|
3069
3870
|
{
|
|
3070
3871
|
key: hourIdx,
|
|
3071
3872
|
height: 60,
|
|
@@ -3075,20 +3876,26 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3075
3876
|
}
|
|
3076
3877
|
);
|
|
3077
3878
|
}), dayEvents.map((event2) => {
|
|
3078
|
-
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day")
|
|
3079
|
-
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day")
|
|
3080
|
-
const
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3879
|
+
const eventStart = currentDate.isSame(event2.start, "day") ? event2.start : currentDate.startOf("day");
|
|
3880
|
+
const eventEnd = currentDate.isSame(event2.end, "day") ? event2.end : currentDate.endOf("day");
|
|
3881
|
+
const minStart = currentDate.hour(startHour).minute(0);
|
|
3882
|
+
const maxEnd = currentDate.hour(endHour).minute(0);
|
|
3883
|
+
const clampedStart = eventStart.isBefore(minStart) ? minStart : eventStart;
|
|
3884
|
+
const clampedEnd = eventEnd.isAfter(maxEnd) ? maxEnd : eventEnd;
|
|
3885
|
+
const startMinutes = (clampedStart.hour() - startHour) * 60 + clampedStart.minute();
|
|
3886
|
+
const durationMinutes = clampedEnd.diff(clampedStart, "minute");
|
|
3887
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
3083
3888
|
CalendarEventCard,
|
|
3084
3889
|
{
|
|
3085
3890
|
key: `${event2.id}-${currentDate.toString()}`,
|
|
3086
3891
|
event: event2,
|
|
3087
3892
|
color: stateColors[event2.state],
|
|
3088
|
-
onClick: () => onEventClick == null ? void 0 : onEventClick(event2),
|
|
3893
|
+
onClick: () => onEventClick == null ? void 0 : onEventClick(event2, currentDate),
|
|
3894
|
+
onHover: onEventHover,
|
|
3089
3895
|
sx: {
|
|
3090
3896
|
position: "absolute",
|
|
3091
|
-
top: `${startMinutes
|
|
3897
|
+
top: `${startMinutes}px`,
|
|
3898
|
+
height: `${durationMinutes}px`,
|
|
3092
3899
|
left: 4,
|
|
3093
3900
|
right: 4
|
|
3094
3901
|
}
|
|
@@ -3098,17 +3905,27 @@ var DayView = ({ events, currentDate, onEventClick }) => {
|
|
|
3098
3905
|
};
|
|
3099
3906
|
|
|
3100
3907
|
// src/Components/Calendario/Calendar.tsx
|
|
3908
|
+
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
3101
3909
|
var Calendar = ({
|
|
3102
3910
|
events,
|
|
3103
3911
|
onDayClick,
|
|
3104
3912
|
onMoreClick,
|
|
3105
3913
|
onEventClick,
|
|
3914
|
+
onEventHover,
|
|
3915
|
+
onDateChange,
|
|
3106
3916
|
view: initialView = "month",
|
|
3107
3917
|
onViewChange,
|
|
3108
|
-
toolbar
|
|
3918
|
+
toolbar,
|
|
3919
|
+
isLoading = false,
|
|
3920
|
+
startHour = 0,
|
|
3921
|
+
// <- valor por defecto
|
|
3922
|
+
endHour = 23
|
|
3109
3923
|
}) => {
|
|
3110
|
-
const [view, setView] = (0,
|
|
3111
|
-
const [currentDate, setCurrentDate] = (0,
|
|
3924
|
+
const [view, setView] = (0, import_react36.useState)(initialView);
|
|
3925
|
+
const [currentDate, setCurrentDate] = (0, import_react36.useState)((0, import_dayjs7.default)());
|
|
3926
|
+
(0, import_react36.useEffect)(() => {
|
|
3927
|
+
onDateChange == null ? void 0 : onDateChange(currentDate);
|
|
3928
|
+
}, []);
|
|
3112
3929
|
const handleViewChange = (newView) => {
|
|
3113
3930
|
setView(newView);
|
|
3114
3931
|
onViewChange == null ? void 0 : onViewChange(newView);
|
|
@@ -3116,12 +3933,19 @@ var Calendar = ({
|
|
|
3116
3933
|
const handleNavigate = (action) => {
|
|
3117
3934
|
let newDate = currentDate;
|
|
3118
3935
|
const unit = view === "month" ? "month" : "day";
|
|
3119
|
-
if (action === "PREV")
|
|
3120
|
-
|
|
3121
|
-
|
|
3936
|
+
if (action === "PREV") {
|
|
3937
|
+
if (view === "day") newDate = currentDate.subtract(1, "day");
|
|
3938
|
+
if (view === "week") newDate = currentDate.subtract(1, "week");
|
|
3939
|
+
if (view === "month") newDate = currentDate.subtract(1, "month");
|
|
3940
|
+
} else if (action === "NEXT") {
|
|
3941
|
+
if (view === "day") newDate = currentDate.add(1, "day");
|
|
3942
|
+
if (view === "week") newDate = currentDate.add(1, "week");
|
|
3943
|
+
if (view === "month") newDate = currentDate.add(1, "month");
|
|
3944
|
+
} else if (action === "TODAY") newDate = (0, import_dayjs7.default)();
|
|
3122
3945
|
setCurrentDate(newDate);
|
|
3946
|
+
onDateChange == null ? void 0 : onDateChange(newDate);
|
|
3123
3947
|
};
|
|
3124
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ import_react36.default.createElement(import_material24.Box, null, /* @__PURE__ */ import_react36.default.createElement(
|
|
3125
3949
|
CalendarToolbar,
|
|
3126
3950
|
{
|
|
3127
3951
|
labelDate: currentDate,
|
|
@@ -3130,40 +3954,417 @@ var Calendar = ({
|
|
|
3130
3954
|
onNavigate: handleNavigate
|
|
3131
3955
|
},
|
|
3132
3956
|
toolbar
|
|
3133
|
-
),
|
|
3957
|
+
), isLoading ? /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, /* @__PURE__ */ import_react36.default.createElement(import_material24.Box, null, /* @__PURE__ */ import_react36.default.createElement(
|
|
3958
|
+
import_material24.Box,
|
|
3959
|
+
{
|
|
3960
|
+
display: "flex",
|
|
3961
|
+
justifyContent: "center",
|
|
3962
|
+
alignItems: "center",
|
|
3963
|
+
height: "400px"
|
|
3964
|
+
},
|
|
3965
|
+
/* @__PURE__ */ import_react36.default.createElement(import_material24.CircularProgress, { variant: "indeterminate" })
|
|
3966
|
+
))) : /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, view === "month" && /* @__PURE__ */ import_react36.default.createElement(
|
|
3134
3967
|
MonthView,
|
|
3135
3968
|
{
|
|
3136
3969
|
events,
|
|
3970
|
+
currentDate,
|
|
3137
3971
|
onDayClick,
|
|
3138
3972
|
onMoreClick,
|
|
3139
3973
|
onEventClick,
|
|
3140
|
-
|
|
3974
|
+
onEventHover
|
|
3141
3975
|
}
|
|
3142
|
-
), view === "week" && /* @__PURE__ */
|
|
3976
|
+
), view === "week" && /* @__PURE__ */ import_react36.default.createElement(
|
|
3143
3977
|
WeekView,
|
|
3144
3978
|
{
|
|
3145
3979
|
events,
|
|
3146
3980
|
currentDate,
|
|
3147
3981
|
onDayClick,
|
|
3148
3982
|
onMoreClick,
|
|
3149
|
-
onEventClick
|
|
3983
|
+
onEventClick,
|
|
3984
|
+
onEventHover,
|
|
3985
|
+
startHour,
|
|
3986
|
+
endHour
|
|
3150
3987
|
}
|
|
3151
|
-
), view === "day" && /* @__PURE__ */
|
|
3988
|
+
), view === "day" && /* @__PURE__ */ import_react36.default.createElement(
|
|
3152
3989
|
DayView,
|
|
3153
3990
|
{
|
|
3154
3991
|
events,
|
|
3155
3992
|
currentDate,
|
|
3156
|
-
onEventClick
|
|
3993
|
+
onEventClick,
|
|
3994
|
+
onEventHover,
|
|
3995
|
+
startHour,
|
|
3996
|
+
endHour
|
|
3157
3997
|
}
|
|
3158
|
-
));
|
|
3998
|
+
)));
|
|
3999
|
+
};
|
|
4000
|
+
|
|
4001
|
+
// src/Components/SCTime.tsx
|
|
4002
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
4003
|
+
var import_material25 = require("@mui/material");
|
|
4004
|
+
var import_LocalizationProvider3 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
4005
|
+
var import_AdapterDayjs2 = require("@mui/x-date-pickers/AdapterDayjs");
|
|
4006
|
+
var import_dayjs8 = __toESM(require("dayjs"), 1);
|
|
4007
|
+
var import_es3 = require("dayjs/locale/es");
|
|
4008
|
+
var import_x_license_pro3 = require("@mui/x-license-pro");
|
|
4009
|
+
var import_AccessTime = __toESM(require("@mui/icons-material/AccessTime"), 1);
|
|
4010
|
+
var import_TimeField = require("@mui/x-date-pickers/TimeField");
|
|
4011
|
+
var import_DigitalClock = require("@mui/x-date-pickers/DigitalClock");
|
|
4012
|
+
var SCTime = ({
|
|
4013
|
+
label = "Hora",
|
|
4014
|
+
required = false,
|
|
4015
|
+
disabled = false,
|
|
4016
|
+
background = "transparent",
|
|
4017
|
+
timeStep = 5,
|
|
4018
|
+
state,
|
|
4019
|
+
setState
|
|
4020
|
+
}) => {
|
|
4021
|
+
import_x_license_pro3.LicenseInfo.setLicenseKey(
|
|
4022
|
+
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
4023
|
+
);
|
|
4024
|
+
const isTimeEmpty = required && !state;
|
|
4025
|
+
const hasError = isTimeEmpty;
|
|
4026
|
+
const [anchorEl, setAnchorEl] = (0, import_react37.useState)(null);
|
|
4027
|
+
const [isOpenPopover, setIsOpenPopover] = (0, import_react37.useState)(false);
|
|
4028
|
+
const [popoverPlacement, setPopoverPlacement] = (0, import_react37.useState)("bottom");
|
|
4029
|
+
const detectPlacement = (element) => {
|
|
4030
|
+
const rect = element.getBoundingClientRect();
|
|
4031
|
+
const windowHeight = window.innerHeight;
|
|
4032
|
+
const spaceBelow = windowHeight - rect.bottom;
|
|
4033
|
+
const spaceAbove = rect.top;
|
|
4034
|
+
const popoverHeight = 300;
|
|
4035
|
+
if (spaceBelow < popoverHeight && spaceAbove > spaceBelow) {
|
|
4036
|
+
setPopoverPlacement("top");
|
|
4037
|
+
} else {
|
|
4038
|
+
setPopoverPlacement("bottom");
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
const handleTimeFieldClick = (event2) => {
|
|
4042
|
+
if (!disabled) {
|
|
4043
|
+
const target = event2.currentTarget;
|
|
4044
|
+
setAnchorEl(target);
|
|
4045
|
+
detectPlacement(target);
|
|
4046
|
+
setIsOpenPopover(true);
|
|
4047
|
+
}
|
|
4048
|
+
};
|
|
4049
|
+
const handleTimeChange = (newValue) => {
|
|
4050
|
+
const dayjsValue = newValue ? (0, import_dayjs8.default)(newValue) : null;
|
|
4051
|
+
setState(dayjsValue);
|
|
4052
|
+
setIsOpenPopover(false);
|
|
4053
|
+
setAnchorEl(null);
|
|
4054
|
+
};
|
|
4055
|
+
const handleClose = () => {
|
|
4056
|
+
setIsOpenPopover(false);
|
|
4057
|
+
setAnchorEl(null);
|
|
4058
|
+
};
|
|
4059
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_LocalizationProvider3.LocalizationProvider, { dateAdapter: import_AdapterDayjs2.AdapterDayjs }, /* @__PURE__ */ import_react37.default.createElement(import_material25.Box, { sx: { position: "relative", width: "120px" } }, /* @__PURE__ */ import_react37.default.createElement(
|
|
4060
|
+
import_TimeField.TimeField,
|
|
4061
|
+
{
|
|
4062
|
+
label,
|
|
4063
|
+
value: state,
|
|
4064
|
+
disabled,
|
|
4065
|
+
required,
|
|
4066
|
+
error: hasError,
|
|
4067
|
+
onClick: handleTimeFieldClick,
|
|
4068
|
+
slotProps: {
|
|
4069
|
+
textField: {
|
|
4070
|
+
InputProps: {
|
|
4071
|
+
endAdornment: /* @__PURE__ */ import_react37.default.createElement(import_material25.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react37.default.createElement(
|
|
4072
|
+
import_AccessTime.default,
|
|
4073
|
+
{
|
|
4074
|
+
color: disabled ? "disabled" : "action",
|
|
4075
|
+
sx: { cursor: disabled ? "default" : "pointer" },
|
|
4076
|
+
fontSize: "small"
|
|
4077
|
+
}
|
|
4078
|
+
)),
|
|
4079
|
+
sx: {
|
|
4080
|
+
backgroundColor: background,
|
|
4081
|
+
padding: "8px 12px",
|
|
4082
|
+
cursor: disabled ? "default" : "pointer",
|
|
4083
|
+
"& input": {
|
|
4084
|
+
cursor: disabled ? "default" : "pointer"
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
},
|
|
4090
|
+
sx: {
|
|
4091
|
+
width: "100%",
|
|
4092
|
+
"& .MuiInputBase-input": {
|
|
4093
|
+
cursor: disabled ? "default" : "pointer"
|
|
4094
|
+
},
|
|
4095
|
+
"& .MuiPickersSectionList-root": {
|
|
4096
|
+
padding: "0px !important"
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
), /* @__PURE__ */ import_react37.default.createElement(
|
|
4101
|
+
import_material25.Popover,
|
|
4102
|
+
{
|
|
4103
|
+
open: isOpenPopover,
|
|
4104
|
+
anchorEl,
|
|
4105
|
+
onClose: handleClose,
|
|
4106
|
+
anchorOrigin: {
|
|
4107
|
+
vertical: popoverPlacement === "top" ? "top" : "bottom",
|
|
4108
|
+
horizontal: "left"
|
|
4109
|
+
},
|
|
4110
|
+
transformOrigin: {
|
|
4111
|
+
vertical: popoverPlacement === "top" ? "bottom" : "top",
|
|
4112
|
+
horizontal: "left"
|
|
4113
|
+
},
|
|
4114
|
+
marginThreshold: 0,
|
|
4115
|
+
disableScrollLock: true,
|
|
4116
|
+
slotProps: {
|
|
4117
|
+
paper: {
|
|
4118
|
+
sx: {
|
|
4119
|
+
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.1)",
|
|
4120
|
+
borderRadius: 1,
|
|
4121
|
+
border: "1px solid #e0e0e0",
|
|
4122
|
+
maxHeight: "300px",
|
|
4123
|
+
overflow: "visible"
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
},
|
|
4128
|
+
/* @__PURE__ */ import_react37.default.createElement(import_material25.ClickAwayListener, { onClickAway: handleClose }, /* @__PURE__ */ import_react37.default.createElement(import_material25.Box, { sx: { p: 0 } }, /* @__PURE__ */ import_react37.default.createElement(
|
|
4129
|
+
import_DigitalClock.DigitalClock,
|
|
4130
|
+
{
|
|
4131
|
+
value: state,
|
|
4132
|
+
onChange: handleTimeChange,
|
|
4133
|
+
timeStep,
|
|
4134
|
+
sx: {
|
|
4135
|
+
"& .MuiList-root": {
|
|
4136
|
+
maxHeight: "250px",
|
|
4137
|
+
overflow: "auto"
|
|
4138
|
+
},
|
|
4139
|
+
"& .MuiMenuItem-root": {
|
|
4140
|
+
fontSize: "0.875rem",
|
|
4141
|
+
py: 0.5
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4145
|
+
)))
|
|
4146
|
+
)));
|
|
4147
|
+
};
|
|
4148
|
+
|
|
4149
|
+
// src/Components/SCCard.tsx
|
|
4150
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
4151
|
+
var import_material26 = require("@mui/material");
|
|
4152
|
+
var import_IconButton = __toESM(require("@mui/material/IconButton"), 1);
|
|
4153
|
+
var import_Card = __toESM(require("@mui/material/Card"), 1);
|
|
4154
|
+
var import_CardHeader = __toESM(require("@mui/material/CardHeader"), 1);
|
|
4155
|
+
var import_CardMedia = __toESM(require("@mui/material/CardMedia"), 1);
|
|
4156
|
+
var import_CardContent = __toESM(require("@mui/material/CardContent"), 1);
|
|
4157
|
+
var import_CardActions = __toESM(require("@mui/material/CardActions"), 1);
|
|
4158
|
+
var import_Collapse = __toESM(require("@mui/material/Collapse"), 1);
|
|
4159
|
+
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
|
|
4160
|
+
var Muicon9 = __toESM(require("@mui/icons-material"), 1);
|
|
4161
|
+
var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, actions, expand }) => {
|
|
4162
|
+
let iconTitleValidation = "";
|
|
4163
|
+
let IconTitle;
|
|
4164
|
+
const [expanded, setExpanded] = import_react38.default.useState(false);
|
|
4165
|
+
if (iconTitle) {
|
|
4166
|
+
if (Muicon9[iconTitle] == void 0) {
|
|
4167
|
+
if (iconTitle && import_react38.default.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
4168
|
+
iconTitleValidation = "image";
|
|
4169
|
+
IconTitle = iconTitle;
|
|
4170
|
+
} else {
|
|
4171
|
+
iconTitleValidation = "icon";
|
|
4172
|
+
IconTitle = iconTitle;
|
|
4173
|
+
}
|
|
4174
|
+
} else {
|
|
4175
|
+
iconTitleValidation = "icon";
|
|
4176
|
+
IconTitle = Muicon9[iconTitle];
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
const handleExpandClick = () => {
|
|
4180
|
+
setExpanded(!expanded);
|
|
4181
|
+
};
|
|
4182
|
+
return /* @__PURE__ */ import_react38.default.createElement(import_Card.default, { sx: { maxWidth: 345 } }, title && /* @__PURE__ */ import_react38.default.createElement(
|
|
4183
|
+
import_CardHeader.default,
|
|
4184
|
+
{
|
|
4185
|
+
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ import_react38.default.createElement(import_material26.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react38.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react38.default.createElement(import_material26.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
4186
|
+
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ import_react38.default.createElement(import_material26.Button, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ import_react38.default.createElement(import_IconButton.default, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ import_react38.default.createElement(import_ExpandMore.default, { fontSize: "small" })) : actionsTitle,
|
|
4187
|
+
title,
|
|
4188
|
+
subheader: subtitle,
|
|
4189
|
+
sx: {
|
|
4190
|
+
"& .MuiCardHeader-title": {
|
|
4191
|
+
fontSize: "14px",
|
|
4192
|
+
color: "text.primary"
|
|
4193
|
+
},
|
|
4194
|
+
"& .MuiCardHeader-subheader": {
|
|
4195
|
+
fontSize: "13px",
|
|
4196
|
+
color: "text.secondary"
|
|
4197
|
+
},
|
|
4198
|
+
"& .MuiCardHeader-action": {
|
|
4199
|
+
height: "40px !important",
|
|
4200
|
+
display: "flex",
|
|
4201
|
+
alignItems: "center"
|
|
4202
|
+
}
|
|
4203
|
+
}
|
|
4204
|
+
}
|
|
4205
|
+
), image && /* @__PURE__ */ import_react38.default.createElement(
|
|
4206
|
+
import_CardMedia.default,
|
|
4207
|
+
{
|
|
4208
|
+
component: "img",
|
|
4209
|
+
height: "194",
|
|
4210
|
+
image
|
|
4211
|
+
}
|
|
4212
|
+
), content && /* @__PURE__ */ import_react38.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, content), ((expand == null ? void 0 : expand.position) == "bottom" || actions != void 0) && /* @__PURE__ */ import_react38.default.createElement(import_CardActions.default, { disableSpacing: true, sx: { justifyContent: "flex-end" } }, (expand == null ? void 0 : expand.position) === "bottom" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ import_react38.default.createElement(import_material26.Button, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ import_react38.default.createElement(import_IconButton.default, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, /* @__PURE__ */ import_react38.default.createElement(import_ExpandMore.default, null)) : null, actions && actions.length > 0 ? actions.map((action, index) => /* @__PURE__ */ import_react38.default.createElement(
|
|
4213
|
+
import_material26.Button,
|
|
4214
|
+
{
|
|
4215
|
+
key: index,
|
|
4216
|
+
size: "small",
|
|
4217
|
+
color: action.color || "primary",
|
|
4218
|
+
variant: action.variant || "text",
|
|
4219
|
+
onClick: action.fn,
|
|
4220
|
+
disabled: action.disabled || false
|
|
4221
|
+
},
|
|
4222
|
+
action.text
|
|
4223
|
+
)) : ""), expand && /* @__PURE__ */ import_react38.default.createElement(import_Collapse.default, { in: expanded, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ import_react38.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, expand.content)));
|
|
4224
|
+
};
|
|
4225
|
+
|
|
4226
|
+
// src/Components/SCActivityCalendar.tsx
|
|
4227
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
4228
|
+
var import_material27 = require("@mui/material");
|
|
4229
|
+
var import_Grid28 = __toESM(require("@mui/material/Grid2"), 1);
|
|
4230
|
+
var import_AdapterDateFns2 = require("@mui/x-date-pickers/AdapterDateFns");
|
|
4231
|
+
var import_LocalizationProvider4 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
4232
|
+
var import_StaticDatePicker2 = require("@mui/x-date-pickers/StaticDatePicker");
|
|
4233
|
+
var import_locale2 = require("date-fns/locale");
|
|
4234
|
+
var import_date_fns2 = require("date-fns");
|
|
4235
|
+
var import_KeyboardDoubleArrowDown2 = __toESM(require("@mui/icons-material/KeyboardDoubleArrowDown"), 1);
|
|
4236
|
+
var import_KeyboardDoubleArrowUp2 = __toESM(require("@mui/icons-material/KeyboardDoubleArrowUp"), 1);
|
|
4237
|
+
var import_ArrowForward = __toESM(require("@mui/icons-material/ArrowForward"), 1);
|
|
4238
|
+
var import_LightModeOutlined = __toESM(require("@mui/icons-material/LightModeOutlined"), 1);
|
|
4239
|
+
var SCActivityCalendar = ({
|
|
4240
|
+
//informativas
|
|
4241
|
+
//apariencia
|
|
4242
|
+
background,
|
|
4243
|
+
//funcionales
|
|
4244
|
+
setState,
|
|
4245
|
+
state,
|
|
4246
|
+
events,
|
|
4247
|
+
fn,
|
|
4248
|
+
configRangeHour
|
|
4249
|
+
}) => {
|
|
4250
|
+
let convertFecha;
|
|
4251
|
+
const [fecha, setFecha] = (0, import_react39.useState)(/* @__PURE__ */ new Date());
|
|
4252
|
+
const [fechaSeleccionada, setFechaSeleccionada] = (0, import_react39.useState)();
|
|
4253
|
+
const [stateVal, setstateVal] = import_react39.default.useState(/* @__PURE__ */ new Date());
|
|
4254
|
+
const [openCalendar, setOpenCalendar] = import_react39.default.useState(false);
|
|
4255
|
+
const hoy = /* @__PURE__ */ new Date();
|
|
4256
|
+
const inicioSemana = (0, import_date_fns2.startOfWeek)(fecha, { weekStartsOn: 0 });
|
|
4257
|
+
const diasSemana = Array.from({ length: 7 }, (_, i) => (0, import_date_fns2.addDays)(inicioSemana, i));
|
|
4258
|
+
import_react39.default.useEffect(() => {
|
|
4259
|
+
if (fecha != null) {
|
|
4260
|
+
handleConvertFecha(fecha);
|
|
4261
|
+
}
|
|
4262
|
+
}, [fecha]);
|
|
4263
|
+
const handleConvertFecha = (fecha2) => {
|
|
4264
|
+
if (fecha2) {
|
|
4265
|
+
let day = (fecha2.getDate() < 10 ? "0" : "") + fecha2.getDate();
|
|
4266
|
+
let month = (fecha2.getMonth() + 1 < 10 ? "0" : "") + (fecha2.getMonth() + 1);
|
|
4267
|
+
let year = fecha2.getFullYear();
|
|
4268
|
+
convertFecha = day + "/" + month + "/" + year;
|
|
4269
|
+
setState(convertFecha);
|
|
4270
|
+
setFecha(fecha2);
|
|
4271
|
+
}
|
|
4272
|
+
};
|
|
4273
|
+
const toggleCalendar = (newOpen) => () => {
|
|
4274
|
+
setOpenCalendar(newOpen);
|
|
4275
|
+
};
|
|
4276
|
+
const locale = __spreadProps(__spreadValues({}, import_locale2.es), {
|
|
4277
|
+
options: {
|
|
4278
|
+
weekStartsOn: 0
|
|
4279
|
+
// 0 para domingo, 1 para lunes, etc.
|
|
4280
|
+
}
|
|
4281
|
+
});
|
|
4282
|
+
return /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(import_LocalizationProvider4.LocalizationProvider, { dateAdapter: import_AdapterDateFns2.AdapterDateFns, adapterLocale: import_locale2.es }, openCalendar == false ? /* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ import_react39.default.createElement(import_Grid28.default, { container: true, gap: 0.5, sx: { justifyContent: "space-between", padding: "12px 0px", background: "transparent" } }, diasSemana.map((dia) => /* @__PURE__ */ import_react39.default.createElement(import_Grid28.default, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, { sx: { fontSize: "12px !important", color: "#10184099" } }, (0, import_date_fns2.format)(dia, "EEEE", { locale: import_locale2.es }).charAt(0).toUpperCase())), /* @__PURE__ */ import_react39.default.createElement(
|
|
4283
|
+
import_material27.Box,
|
|
4284
|
+
{
|
|
4285
|
+
onClick: () => setFecha(dia),
|
|
4286
|
+
sx: {
|
|
4287
|
+
padding: "10px",
|
|
4288
|
+
textAlign: "center",
|
|
4289
|
+
backgroundColor: (0, import_date_fns2.isSameDay)(dia, fecha) ? "#2063a0" : "transparent",
|
|
4290
|
+
cursor: "pointer",
|
|
4291
|
+
borderRadius: "50%",
|
|
4292
|
+
//border: '1px solid lightgray',
|
|
4293
|
+
position: "relative"
|
|
4294
|
+
//width: '36px',
|
|
4295
|
+
//height: '36px',
|
|
4296
|
+
}
|
|
4297
|
+
},
|
|
4298
|
+
/* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, { sx: { fontSize: "12px !important", color: (0, import_date_fns2.isSameDay)(dia, fecha) ? "white" : "#101840DE" } }, (0, import_date_fns2.format)(dia, "d"))
|
|
4299
|
+
)))), /* @__PURE__ */ import_react39.default.createElement(import_Grid28.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react39.default.createElement(import_material27.IconButton, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ import_react39.default.createElement(import_KeyboardDoubleArrowDown2.default, { color: "action" }))))) : /* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ import_react39.default.createElement(
|
|
4300
|
+
import_StaticDatePicker2.StaticDatePicker,
|
|
4301
|
+
{
|
|
4302
|
+
orientation: "landscape",
|
|
4303
|
+
openTo: "day",
|
|
4304
|
+
value: fecha,
|
|
4305
|
+
slotProps: { toolbar: { hidden: true }, actionBar: { actions: [] } },
|
|
4306
|
+
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" } },
|
|
4307
|
+
onChange: (newValue) => setFecha(newValue)
|
|
4308
|
+
}
|
|
4309
|
+
), /* @__PURE__ */ import_react39.default.createElement(import_Grid28.default, { container: true, justifyContent: "center" }, /* @__PURE__ */ import_react39.default.createElement(import_material27.IconButton, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ import_react39.default.createElement(import_KeyboardDoubleArrowUp2.default, { color: "action" }))))), /* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { sx: { width: "100%", height: openCalendar ? "calc(91% - 300px)" : "calc(91% - 100px)", background: "white", display: "flex", flexDirection: "column", overflowY: "auto", gap: "8px", scrollSnapType: "x mandatory", paddingBottom: "10px" } }, diasSemana.map((day, dayIndex) => /* @__PURE__ */ import_react39.default.createElement(
|
|
4310
|
+
import_material27.Box,
|
|
4311
|
+
{
|
|
4312
|
+
key: dayIndex
|
|
4313
|
+
},
|
|
4314
|
+
/* @__PURE__ */ import_react39.default.createElement(import_Grid28.default, { container: true }, /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, { variant: "subtitle1", sx: { color: (0, import_date_fns2.isSameDay)(day, fecha) ? "info.dark" : "text.secondary" } }, day.toLocaleDateString("es-ES", {
|
|
4315
|
+
day: "numeric"
|
|
4316
|
+
}), " de ", day.toLocaleDateString("es-ES", {
|
|
4317
|
+
month: "short"
|
|
4318
|
+
}), ", ", day.toLocaleDateString("es-ES", {
|
|
4319
|
+
weekday: "long"
|
|
4320
|
+
}))),
|
|
4321
|
+
/* @__PURE__ */ import_react39.default.createElement(import_material27.Box, { sx: {
|
|
4322
|
+
display: "flex",
|
|
4323
|
+
flexDirection: "column"
|
|
4324
|
+
} }, (() => {
|
|
4325
|
+
const esDomingo = day.getDay() === 0;
|
|
4326
|
+
const eventosDelDia = events.filter(
|
|
4327
|
+
(event2) => new Date(event2.date).toDateString() === day.toDateString()
|
|
4328
|
+
);
|
|
4329
|
+
if (eventosDelDia.length > 0) {
|
|
4330
|
+
return eventosDelDia.map((event2, idx) => /* @__PURE__ */ import_react39.default.createElement(
|
|
4331
|
+
SCListContent,
|
|
4332
|
+
{
|
|
4333
|
+
key: idx,
|
|
4334
|
+
options: [{
|
|
4335
|
+
title: event2.description,
|
|
4336
|
+
subtitle: /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, configRangeHour && new Date(event2.date.replace("00:00:00", event2.startTime)).getHours() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[0])).getHours() && new Date(event2.date.replace("00:00:00", event2.finalTime)).getHours() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[1])).getHours() && new Date(event2.date.replace("00:00:00", event2.startTime)).getMinutes() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[0])).getMinutes() && new Date(event2.date.replace("00:00:00", event2.finalTime)).getMinutes() === new Date(event2.date.replace("00:00:00", configRangeHour.split("-")[1])).getMinutes() ? /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, null, "Todo el dia"), /* @__PURE__ */ import_react39.default.createElement(import_LightModeOutlined.default, { fontSize: "small" })) : /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, null, new Date(event2.date.replace("00:00:00", event2.startTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })), /* @__PURE__ */ import_react39.default.createElement(import_ArrowForward.default, { fontSize: "small" }), /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, null, new Date(event2.date.replace("00:00:00", event2.finalTime)).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: true })))),
|
|
4337
|
+
iconLeftColor: event2.state === "Finalizada" ? "success" : "action",
|
|
4338
|
+
iconLeft: event2.state === "Finalizada" ? "CheckCircle" : event2.state === "Aplazada" ? "EventBusyOutlined" : event2.state === "En progreso" ? "PendingOutlined" : "RadioButtonUnchecked",
|
|
4339
|
+
description: /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, event2.state === "Aplazada" || event2.state === "En progreso" || event2.state === "Auto asignada" ? /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(import_material27.Badge, { variant: "dot", badgeContent: "", sx: { display: "flex", alignItems: "center", "& .MuiBadge-badge": { top: "50%", transform: "translateY(-50%)" }, color: "action" } }), /* @__PURE__ */ import_react39.default.createElement(import_material27.Typography, null, event2.state == "Auto asignada" ? "Adicional" : event2.state)) : null),
|
|
4340
|
+
divider: eventosDelDia.length === idx + 1 ? false : true,
|
|
4341
|
+
disable: event2.state === "Finalizada" || event2.state === "Aplazada" || event2.state === "En progreso" ? true : false,
|
|
4342
|
+
fn: fn ? () => fn(event2) : void 0
|
|
4343
|
+
}]
|
|
4344
|
+
}
|
|
4345
|
+
));
|
|
4346
|
+
} else {
|
|
4347
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
4348
|
+
SCListContent,
|
|
4349
|
+
{
|
|
4350
|
+
options: [{
|
|
4351
|
+
title: esDomingo == true ? "No disponible" : "No hay actividades asignadas",
|
|
4352
|
+
iconLeft: esDomingo == true ? "BlockOutlined" : "HandymanOutlined",
|
|
4353
|
+
disable: true
|
|
4354
|
+
}]
|
|
4355
|
+
}
|
|
4356
|
+
);
|
|
4357
|
+
}
|
|
4358
|
+
})())
|
|
4359
|
+
))));
|
|
3159
4360
|
};
|
|
3160
4361
|
|
|
3161
4362
|
// src/Theme/index.ts
|
|
3162
4363
|
var import_styles3 = require("@mui/material/styles");
|
|
3163
4364
|
|
|
3164
4365
|
// src/Theme/components.ts
|
|
3165
|
-
var
|
|
3166
|
-
var
|
|
4366
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
4367
|
+
var import_icons_material12 = require("@mui/icons-material");
|
|
3167
4368
|
var components = {
|
|
3168
4369
|
MuiSelect: {
|
|
3169
4370
|
styleOverrides: {
|
|
@@ -3860,10 +5061,10 @@ var components = {
|
|
|
3860
5061
|
MuiAlert: {
|
|
3861
5062
|
defaultProps: {
|
|
3862
5063
|
iconMapping: {
|
|
3863
|
-
success:
|
|
3864
|
-
error:
|
|
3865
|
-
warning:
|
|
3866
|
-
info:
|
|
5064
|
+
success: import_react40.default.createElement(import_icons_material12.CheckCircleRounded),
|
|
5065
|
+
error: import_react40.default.createElement(import_icons_material12.ErrorRounded),
|
|
5066
|
+
warning: import_react40.default.createElement(import_icons_material12.WarningRounded),
|
|
5067
|
+
info: import_react40.default.createElement(import_icons_material12.InfoRounded)
|
|
3867
5068
|
}
|
|
3868
5069
|
},
|
|
3869
5070
|
variants: [
|
|
@@ -4905,24 +6106,29 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
4905
6106
|
0 && (module.exports = {
|
|
4906
6107
|
ADCSincoTheme,
|
|
4907
6108
|
AdproSincoTheme,
|
|
6109
|
+
Attachment,
|
|
4908
6110
|
Calendar,
|
|
4909
6111
|
EmptyState,
|
|
4910
6112
|
FooterAction,
|
|
4911
6113
|
MultiSelect,
|
|
4912
6114
|
PageHeader,
|
|
6115
|
+
SCActivityCalendar,
|
|
4913
6116
|
SCAutocomplete,
|
|
4914
6117
|
SCCalendarSwipeable,
|
|
6118
|
+
SCCard,
|
|
4915
6119
|
SCDataGrid,
|
|
4916
6120
|
SCDataGridInitial,
|
|
4917
6121
|
SCDateRange,
|
|
4918
6122
|
SCDialog,
|
|
4919
6123
|
SCDrawer,
|
|
6124
|
+
SCListContent,
|
|
4920
6125
|
SCMenu,
|
|
4921
6126
|
SCModal,
|
|
4922
6127
|
SCSelect,
|
|
4923
6128
|
SCTabs,
|
|
4924
6129
|
SCTextArea,
|
|
4925
6130
|
SCTextField,
|
|
6131
|
+
SCTime,
|
|
4926
6132
|
SCToastNotification,
|
|
4927
6133
|
SincoTheme,
|
|
4928
6134
|
ToastProgress,
|