componentes-sinco 1.0.4 → 1.0.5

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.js ADDED
@@ -0,0 +1,4322 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/Components/Drawer/SCDrawer.tsx
34
+ import React7 from "react";
35
+ import { Box as Box7, Drawer, Typography as Typography7, IconButton as IconButton5, Button as Button4, Stack as Stack3, Chip as Chip2 } from "@mui/material";
36
+ import Grid4 from "@mui/material/Grid2";
37
+ import CloseIcon from "@mui/icons-material/Close";
38
+
39
+ // src/Components/Textfield/SCTextField.tsx
40
+ import React, { useEffect, useState } from "react";
41
+ import { FormControl, IconButton, InputAdornment, InputLabel, OutlinedInput, FilledInput, Popover, Input, Box, Typography, SvgIcon, Tooltip } from "@mui/material";
42
+ import Grid from "@mui/material/Grid2";
43
+ import { Visibility, VisibilityOff, InfoOutlined } from "@mui/icons-material";
44
+
45
+ // src/Components/Textfield/Helpers/validateIcon.tsx
46
+ import * as Muicon from "@mui/icons-material";
47
+ function getIconComponent(name) {
48
+ if (typeof name !== "string") return name;
49
+ return name in Muicon ? Muicon[name] : void 0;
50
+ }
51
+ function getIconValidation(name) {
52
+ if (typeof name !== "string") {
53
+ return (name == null ? void 0 : name.type) ? "icon" : "text";
54
+ }
55
+ return name in Muicon ? "icon" : "text";
56
+ }
57
+
58
+ // src/Components/Textfield/Helpers/validateKeyDown.tsx
59
+ function validateKeyDown(event2, format2) {
60
+ const key = event2.key;
61
+ const target = event2.target;
62
+ if (format2 === "int" && !/^[0-9]$/.test(key)) {
63
+ event2.preventDefault();
64
+ }
65
+ if (format2 === "decimal" && (target.value === "" && key === "." || key === "-" || key === "+")) {
66
+ event2.preventDefault();
67
+ }
68
+ if (target.type === "text") {
69
+ const regex = /^[a-zA-ZáéíóúÁÉÍÓÚñÑ0-9\s_\-.,@]+$/;
70
+ if (!regex.test(key)) {
71
+ event2.preventDefault();
72
+ }
73
+ }
74
+ }
75
+
76
+ // src/Components/Textfield/Helpers/validateOnBlur.tsx
77
+ var validateOnBlurField = ({
78
+ state,
79
+ required = false,
80
+ setError,
81
+ onBlur
82
+ }) => (event2) => {
83
+ const isError = !state.trim() && required;
84
+ setError(isError);
85
+ if (onBlur) {
86
+ onBlur(event2);
87
+ }
88
+ };
89
+
90
+ // src/Components/Textfield/SCTextField.tsx
91
+ var SCTextField = ({
92
+ //informativas
93
+ title,
94
+ iconTitle,
95
+ infoTitle,
96
+ label = "",
97
+ placeholder = "",
98
+ infoElement,
99
+ iconInputStart,
100
+ iconInputEnd,
101
+ maxLength,
102
+ //Apariencia
103
+ variant = "outlined",
104
+ format: format2,
105
+ disabled,
106
+ required,
107
+ size,
108
+ width = "100%",
109
+ color,
110
+ background,
111
+ //Funcionales
112
+ setState,
113
+ state,
114
+ onChange,
115
+ onBlur,
116
+ onKeyDown
117
+ }) => {
118
+ const inputComponents = {
119
+ outlined: OutlinedInput,
120
+ filled: FilledInput,
121
+ standard: Input
122
+ };
123
+ const InputComponent = inputComponents[variant] || OutlinedInput;
124
+ let IconInputStartValidation;
125
+ let IconInputEndValidation;
126
+ let IconInputStart;
127
+ let IconInputEnd;
128
+ let IconTitle;
129
+ const [showPassword, setShowPassword] = useState(false);
130
+ const [error, setError] = useState(false);
131
+ const [anchorInfoTitle, setAnchorInfoTitle] = useState(null);
132
+ const openInfoTitle = Boolean(anchorInfoTitle);
133
+ const [anchorInfoElement, setAnchorInfoElement] = useState(null);
134
+ const openInfoElement = Boolean(anchorInfoElement);
135
+ useEffect(() => {
136
+ if (error) {
137
+ setTimeout(() => {
138
+ setError(false);
139
+ }, 1e3);
140
+ }
141
+ }, [error]);
142
+ if (iconInputStart) {
143
+ IconInputStartValidation = getIconValidation(iconInputStart);
144
+ IconInputStart = getIconComponent(iconInputStart);
145
+ }
146
+ if (iconInputEnd) {
147
+ IconInputEndValidation = getIconValidation(iconInputEnd);
148
+ IconInputEnd = getIconComponent(iconInputEnd);
149
+ }
150
+ if (iconTitle) {
151
+ IconTitle = getIconComponent(iconTitle);
152
+ }
153
+ const handleClickShowPassword = () => setShowPassword((show) => !show);
154
+ const handleMouseDownPassword = (event2) => {
155
+ event2.preventDefault();
156
+ };
157
+ const handleKeyDown = (event2) => {
158
+ validateKeyDown(event2, format2);
159
+ if (onKeyDown) onKeyDown(event2);
160
+ };
161
+ const handleInputChange = (event2) => {
162
+ let valueMax = maxLength ? maxLength + 1 : 50;
163
+ if (event2.target.value.length < valueMax) {
164
+ if (setState) {
165
+ setState(event2.target.value);
166
+ }
167
+ if (onChange) {
168
+ onChange(event2);
169
+ }
170
+ }
171
+ };
172
+ const handleBlur = validateOnBlurField({ state, required, setError, onBlur });
173
+ const handleOpenInfoTitle = (event2) => {
174
+ setAnchorInfoTitle(event2.currentTarget);
175
+ };
176
+ const handleCloseInfoTitle = () => {
177
+ setAnchorInfoTitle(null);
178
+ };
179
+ const handleOpenInfoElement = (event2) => {
180
+ setAnchorInfoElement(event2.currentTarget);
181
+ };
182
+ const handleCloseInfoElement = () => {
183
+ setAnchorInfoElement(null);
184
+ };
185
+ return /* @__PURE__ */ React.createElement(Box, { sx: { width } }, /* @__PURE__ */ React.createElement(Grid, { container: true, alignItems: "center", mb: 1.25, gap: 0.5 }, iconTitle && IconTitle ? /* @__PURE__ */ React.createElement(SvgIcon, { color: "action", fontSize: "small", component: IconTitle }) : "", title ? /* @__PURE__ */ React.createElement(Typography, { mx: 0.5, variant: "subtitle2", color: "text.secondary" }, title) : "", infoTitle ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
186
+ InfoOutlined,
187
+ {
188
+ color: "action",
189
+ fontSize: "small",
190
+ onMouseEnter: (event2) => handleOpenInfoTitle(event2),
191
+ onMouseLeave: () => handleCloseInfoTitle()
192
+ }
193
+ ), /* @__PURE__ */ React.createElement(
194
+ Popover,
195
+ {
196
+ sx: {
197
+ pointerEvents: "none",
198
+ "& .MuiBackdrop-root": {
199
+ backgroundColor: "transparent"
200
+ }
201
+ },
202
+ open: openInfoTitle,
203
+ anchorEl: anchorInfoTitle,
204
+ onClose: handleCloseInfoTitle,
205
+ anchorOrigin: {
206
+ vertical: "bottom",
207
+ horizontal: "left"
208
+ },
209
+ transformOrigin: {
210
+ vertical: "top",
211
+ horizontal: "left"
212
+ },
213
+ disableRestoreFocus: true
214
+ },
215
+ /* @__PURE__ */ React.createElement(Typography, { p: 2 }, infoTitle.text)
216
+ )) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoTitle.text, "data-testid": "test-infoTitle", placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
217
+ InfoOutlined,
218
+ {
219
+ color: "action",
220
+ fontSize: "small"
221
+ }
222
+ ))) : ""), /* @__PURE__ */ React.createElement(Grid, { container: true, sx: { flexWrap: "nowrap", alignItems: "center" } }, /* @__PURE__ */ React.createElement(
223
+ FormControl,
224
+ {
225
+ color,
226
+ fullWidth: true,
227
+ size: size ? size : "medium",
228
+ variant,
229
+ sx: { background: background || "transparent", borderRadius: "4px" }
230
+ },
231
+ /* @__PURE__ */ React.createElement(
232
+ InputLabel,
233
+ {
234
+ "data-testid": "test-label",
235
+ htmlFor: "",
236
+ required: required && label !== "" ? true : false,
237
+ error,
238
+ disabled: disabled || false
239
+ },
240
+ label ? label : ""
241
+ ),
242
+ /* @__PURE__ */ React.createElement(
243
+ InputComponent,
244
+ {
245
+ size: size ? size : "medium",
246
+ fullWidth: true,
247
+ value: state,
248
+ error,
249
+ id: label == null ? void 0 : label.replace(/\s+/g, ""),
250
+ disabled: disabled != null ? disabled : false,
251
+ onKeyDown: handleKeyDown,
252
+ onChange: handleInputChange,
253
+ onBlur: handleBlur,
254
+ inputProps: { maxLength: maxLength ? maxLength : 50 },
255
+ type: !showPassword && format2 === "password" ? "password" : (format2 || "text").toUpperCase() === "INT" || (format2 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
256
+ className: format2 === "password" && !showPassword ? "" : "",
257
+ placeholder,
258
+ startAdornment: iconInputStart ? /* @__PURE__ */ React.createElement(InputAdornment, { position: "start" }, IconInputStartValidation === "text" ? iconInputStart : IconInputStart ? /* @__PURE__ */ React.createElement(IconInputStart, { fontSize: "small" }) : null) : "",
259
+ endAdornment: /* @__PURE__ */ React.createElement(InputAdornment, { position: "end" }, format2 === "password" ? /* @__PURE__ */ React.createElement(
260
+ IconButton,
261
+ {
262
+ "aria-label": "toggle password visibility",
263
+ onClick: handleClickShowPassword,
264
+ onMouseDown: handleMouseDownPassword,
265
+ edge: "end"
266
+ },
267
+ showPassword ? /* @__PURE__ */ React.createElement(VisibilityOff, null) : /* @__PURE__ */ React.createElement(Visibility, null)
268
+ ) : iconInputEnd === void 0 && infoElement !== void 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
269
+ InfoOutlined,
270
+ {
271
+ "data-testid": "test-infoElement",
272
+ sx: { ml: 0.5 },
273
+ color: "action",
274
+ fontSize: "small",
275
+ component: "svg",
276
+ onMouseEnter: (event2) => handleOpenInfoElement(event2),
277
+ onMouseLeave: () => handleCloseInfoElement()
278
+ }
279
+ ), /* @__PURE__ */ React.createElement(
280
+ Popover,
281
+ {
282
+ sx: {
283
+ pointerEvents: "none",
284
+ "& .MuiBackdrop-root": {
285
+ backgroundColor: "transparent"
286
+ }
287
+ },
288
+ open: openInfoElement,
289
+ anchorEl: anchorInfoElement,
290
+ onClose: handleCloseInfoElement,
291
+ anchorOrigin: {
292
+ vertical: "bottom",
293
+ horizontal: "left"
294
+ },
295
+ transformOrigin: {
296
+ vertical: "top",
297
+ horizontal: "left"
298
+ },
299
+ disableRestoreFocus: true
300
+ },
301
+ /* @__PURE__ */ React.createElement(Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
302
+ )) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
303
+ InfoOutlined,
304
+ {
305
+ color: "action",
306
+ fontSize: "small"
307
+ }
308
+ ))) : iconInputEnd !== void 0 ? IconInputEndValidation === "text" ? iconInputEnd : IconInputEnd ? /* @__PURE__ */ React.createElement(IconInputEnd, { fontSize: "small" }) : null : ""),
309
+ label: label ? label + (format2 === "password" && !showPassword ? "" : "") : "",
310
+ autoComplete: format2 === "password" ? "new-password" : "off"
311
+ }
312
+ )
313
+ ), (iconInputEnd !== void 0 || format2 === "password") && infoElement ? /* @__PURE__ */ React.createElement(React.Fragment, null, infoElement.component === "popover" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
314
+ InfoOutlined,
315
+ {
316
+ "data-testid": "test-infoElement",
317
+ component: "svg",
318
+ sx: { marginLeft: "4px" },
319
+ color: "action",
320
+ fontSize: "small",
321
+ onMouseEnter: (event2) => handleOpenInfoElement(event2),
322
+ onMouseLeave: handleCloseInfoElement
323
+ }
324
+ ), /* @__PURE__ */ React.createElement(
325
+ Popover,
326
+ {
327
+ sx: { pointerEvents: "none" },
328
+ open: openInfoElement,
329
+ anchorEl: anchorInfoElement,
330
+ onClose: handleCloseInfoElement,
331
+ anchorOrigin: {
332
+ vertical: "bottom",
333
+ horizontal: "left"
334
+ },
335
+ transformOrigin: {
336
+ vertical: "top",
337
+ horizontal: "left"
338
+ },
339
+ disableRestoreFocus: true
340
+ },
341
+ /* @__PURE__ */ React.createElement(Typography, { "data-testid": "test-popover-text", p: 2 }, infoElement.text)
342
+ )) : /* @__PURE__ */ React.createElement(Tooltip, { title: infoElement.text, placement: "bottom-end", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React.createElement(
343
+ InfoOutlined,
344
+ {
345
+ sx: { marginLeft: "4px" },
346
+ color: "action",
347
+ fontSize: "small"
348
+ }
349
+ ))) : ""));
350
+ };
351
+
352
+ // src/Components/ToastNotification/SCToastNotification.tsx
353
+ import React2, { useEffect as useEffect3, useState as useState3 } from "react";
354
+ import { Stack, LinearProgress, Divider, Box as Box2, Typography as Typography2, IconButton as IconButton2, Button } from "@mui/material";
355
+ import { Close, InfoRounded, CheckCircleRounded, WarningRounded, ErrorRounded, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
356
+
357
+ // src/Components/ToastNotification/useProgress.ts
358
+ import { useEffect as useEffect2, useState as useState2 } from "react";
359
+ var useProgress = (timeProgress, lote) => {
360
+ const [progress, setProgress] = useState2(0);
361
+ useEffect2(() => {
362
+ const interval = setInterval(() => {
363
+ setProgress((prev) => {
364
+ if (prev >= 100) {
365
+ clearInterval(interval);
366
+ }
367
+ if (lote) {
368
+ const nextProgress = prev + lote;
369
+ return nextProgress <= 100 ? nextProgress : 100;
370
+ } else {
371
+ return prev + 1;
372
+ }
373
+ });
374
+ }, timeProgress * 10);
375
+ return () => {
376
+ clearInterval(interval);
377
+ };
378
+ }, [timeProgress, lote]);
379
+ return {
380
+ progress
381
+ };
382
+ };
383
+ var ToastProgress = (timeProgress) => {
384
+ const [progress, setProgress] = useState2(100);
385
+ useEffect2(() => {
386
+ const interval = setInterval(() => {
387
+ setProgress((prev) => {
388
+ if (prev <= 0) {
389
+ clearInterval(interval);
390
+ }
391
+ return prev - 1;
392
+ });
393
+ }, timeProgress * 10);
394
+ return () => {
395
+ clearInterval(interval);
396
+ };
397
+ }, [timeProgress]);
398
+ return {
399
+ progressToast: progress
400
+ };
401
+ };
402
+
403
+ // src/Components/ToastNotification/SCToastNotification.tsx
404
+ var SCToastNotification = (toast) => {
405
+ var _a;
406
+ const [stateOptions, setStateOptions] = useState3(true);
407
+ const [stateToast, setStateToast] = useState3(true);
408
+ const timeProgress = toast.time || 10;
409
+ const { progress } = useProgress(timeProgress);
410
+ const toastColorConfig = toast.type || "info";
411
+ const toastIconOption = {
412
+ success: /* @__PURE__ */ React2.createElement(CheckCircleRounded, { color: "success" }),
413
+ error: /* @__PURE__ */ React2.createElement(ErrorRounded, { color: "error" }),
414
+ warning: /* @__PURE__ */ React2.createElement(WarningRounded, { color: "warning" }),
415
+ info: /* @__PURE__ */ React2.createElement(InfoRounded, { color: "info" })
416
+ };
417
+ const acciones = [...toast.actions || [{ text: "Action", fn: () => {
418
+ alert("");
419
+ } }, { text: "Consultar", fn: () => {
420
+ } }]];
421
+ const ToastIconConfig = toastIconOption[toast.type];
422
+ const closeToast = () => {
423
+ setStateToast(false);
424
+ };
425
+ const toggleToastOptions = () => {
426
+ setStateOptions((prevShowOptions) => !prevShowOptions);
427
+ };
428
+ useEffect3(() => {
429
+ progress >= 100 && setStateToast(false);
430
+ }, [progress]);
431
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, stateToast && /* @__PURE__ */ React2.createElement(
432
+ Stack,
433
+ {
434
+ position: "fixed",
435
+ zIndex: 1400,
436
+ right: 16,
437
+ top: 16,
438
+ width: 370,
439
+ sx: {
440
+ boxShadow: (theme) => theme.shadows[8]
441
+ }
442
+ },
443
+ /* @__PURE__ */ React2.createElement(
444
+ Box2,
445
+ {
446
+ padding: 1.5,
447
+ gap: 1.5,
448
+ display: "flex",
449
+ alignItems: "center",
450
+ sx: {
451
+ backgroundColor: {
452
+ success: "success.50",
453
+ error: "error.50",
454
+ warning: "warning.50",
455
+ info: "info.50"
456
+ }[toastColorConfig]
457
+ }
458
+ },
459
+ /* @__PURE__ */ React2.createElement(
460
+ Stack,
461
+ {
462
+ p: 1,
463
+ gap: 1,
464
+ borderRadius: 50,
465
+ bgcolor: {
466
+ success: "success.100",
467
+ error: "error.100",
468
+ warning: "warning.100",
469
+ info: "info.100"
470
+ }[(_a = toast.type) != null ? _a : "info"]
471
+ },
472
+ /* @__PURE__ */ React2.createElement(Stack, null, ToastIconConfig)
473
+ ),
474
+ /* @__PURE__ */ React2.createElement(Divider, { orientation: "vertical", flexItem: true }),
475
+ /* @__PURE__ */ React2.createElement(Stack, { width: 285 }, /* @__PURE__ */ React2.createElement(
476
+ Stack,
477
+ {
478
+ justifyContent: "space-between",
479
+ flexDirection: "row",
480
+ alignItems: "center"
481
+ },
482
+ /* @__PURE__ */ React2.createElement(Typography2, { variant: "subtitle2", color: "text.primary" }, toast.title),
483
+ /* @__PURE__ */ React2.createElement(
484
+ IconButton2,
485
+ {
486
+ size: "small",
487
+ "data-testid": "close-icon",
488
+ onClick: closeToast
489
+ },
490
+ /* @__PURE__ */ React2.createElement(Close, { fontSize: "small" })
491
+ )
492
+ ), /* @__PURE__ */ React2.createElement(Stack, { gap: 0.5 }, /* @__PURE__ */ React2.createElement(Typography2, { color: "text.primary", variant: "body2" }, toast.subtitle), !stateOptions && toast.listITems && toast.listITems.length > 0 && /* @__PURE__ */ React2.createElement(Stack, null, toast.listITems.map((element, i) => /* @__PURE__ */ React2.createElement(Typography2, { variant: "caption", key: i }, "\u2022 ", element)))), /* @__PURE__ */ React2.createElement(Stack, { justifyContent: "flex-end", flexDirection: "row", gap: 0.5 }, toast.actions && toast.actions.length > 0 && /* @__PURE__ */ React2.createElement(Stack, { flexDirection: "row", gap: 0.5 }, toast.actions.map((button, index) => /* @__PURE__ */ React2.createElement(
493
+ Button,
494
+ {
495
+ key: index,
496
+ color: toast.type === "info" ? "info" : toast.type === "success" ? "success" : toast.type === "error" ? "error" : "warning",
497
+ variant: "text",
498
+ onClick: button.fn,
499
+ disabled: button.disabled || false,
500
+ size: "small"
501
+ },
502
+ button.text.charAt(0).toUpperCase() + button.text.slice(1).toLowerCase()
503
+ ))), toast.seeMore && /* @__PURE__ */ React2.createElement(
504
+ Button,
505
+ {
506
+ onClick: toggleToastOptions,
507
+ size: "small",
508
+ variant: "text",
509
+ color: toastColorConfig
510
+ },
511
+ stateOptions ? "Ver m\xE1s" : "Ver menos",
512
+ stateOptions ? /* @__PURE__ */ React2.createElement(KeyboardArrowDown, null) : /* @__PURE__ */ React2.createElement(KeyboardArrowUp, null)
513
+ )))
514
+ ),
515
+ /* @__PURE__ */ React2.createElement(
516
+ LinearProgress,
517
+ {
518
+ sx: {
519
+ ".MuiLinearProgress-bar": {
520
+ transition: "0.1s linear !important",
521
+ transform: "scaleX(-1)"
522
+ }
523
+ },
524
+ color: toastColorConfig,
525
+ variant: "determinate",
526
+ value: 100 - progress
527
+ }
528
+ )
529
+ ));
530
+ };
531
+
532
+ // src/Components/TextArea/Helpers/validateIcon.tsx
533
+ import * as MuiIcons from "@mui/icons-material";
534
+ function getIcon(name) {
535
+ if (!name || !(name in MuiIcons)) {
536
+ return null;
537
+ }
538
+ return MuiIcons[name];
539
+ }
540
+
541
+ // src/Components/TextArea/SCTextArea.tsx
542
+ import React3, { useEffect as useEffect4, useState as useState4 } from "react";
543
+ import { Typography as Typography3, Stack as Stack2, TextField, Box as Box3, Popover as Popover2, Tooltip as Tooltip2, SvgIcon as SvgIcon2, Grid as Grid2 } from "@mui/material";
544
+ import { InfoOutlined as InfoOutlined2 } from "@mui/icons-material";
545
+ var SCTextArea = ({
546
+ //informativas
547
+ title,
548
+ iconTitle,
549
+ infoTitle,
550
+ label = "",
551
+ placeholder,
552
+ maxLength = 200,
553
+ //apariencia
554
+ variant,
555
+ disabled,
556
+ required,
557
+ width = "100%",
558
+ rows = 3,
559
+ colorTitle,
560
+ background,
561
+ //funcionales
562
+ setState,
563
+ state,
564
+ onBlur
565
+ }) => {
566
+ const [helperCount, setHelperCount] = useState4(0);
567
+ const [stateError, setStateError] = useState4(false);
568
+ const [anchorInfoTitle, setAnchorInfoTitle] = React3.useState(null);
569
+ const openInfoTitle = Boolean(anchorInfoTitle);
570
+ useEffect4(() => {
571
+ setHelperCount(state == null ? void 0 : state.length);
572
+ }, [state]);
573
+ const IconTitle = getIcon(iconTitle);
574
+ const handleBlur = (event2) => {
575
+ if (required && state.trim() === "") {
576
+ setStateError(true);
577
+ setTimeout(() => {
578
+ setStateError(false);
579
+ }, 1e3);
580
+ return;
581
+ }
582
+ if (onBlur) {
583
+ onBlur(event2);
584
+ }
585
+ };
586
+ const handleOpenInfoTitle = (event2) => {
587
+ setAnchorInfoTitle(event2.currentTarget);
588
+ };
589
+ const handleCloseInfoTitle = () => {
590
+ setAnchorInfoTitle(null);
591
+ };
592
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Box3, { sx: { width } }, /* @__PURE__ */ React3.createElement(Grid2, { container: true, sx: { alignItems: "center" }, gap: 0.5 }, iconTitle && IconTitle && /* @__PURE__ */ React3.createElement(SvgIcon2, { color: "action", fontSize: "small", component: IconTitle }), title && /* @__PURE__ */ React3.createElement(Typography3, { color: colorTitle || "text.secondary", variant: "subtitle2" }, title), infoTitle ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, infoTitle.component === "popover" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
593
+ InfoOutlined2,
594
+ {
595
+ color: "action",
596
+ fontSize: "small",
597
+ onMouseEnter: (event2) => handleOpenInfoTitle(event2),
598
+ onMouseLeave: () => handleCloseInfoTitle()
599
+ }
600
+ ), /* @__PURE__ */ React3.createElement(
601
+ Popover2,
602
+ {
603
+ sx: { pointerEvents: "none" },
604
+ open: openInfoTitle,
605
+ anchorEl: anchorInfoTitle,
606
+ onClose: handleCloseInfoTitle,
607
+ anchorOrigin: {
608
+ vertical: "bottom",
609
+ horizontal: "left"
610
+ },
611
+ transformOrigin: {
612
+ vertical: "top",
613
+ horizontal: "left"
614
+ },
615
+ disableRestoreFocus: true
616
+ },
617
+ /* @__PURE__ */ React3.createElement(Typography3, { sx: { p: 2 } }, infoTitle.text)
618
+ )) : /* @__PURE__ */ React3.createElement(Tooltip2, { title: infoTitle.text, placement: "bottom-start", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React3.createElement(
619
+ InfoOutlined2,
620
+ {
621
+ color: "action",
622
+ fontSize: "small"
623
+ }
624
+ ))) : ""), /* @__PURE__ */ React3.createElement(Stack2, null, /* @__PURE__ */ React3.createElement(
625
+ TextField,
626
+ {
627
+ required,
628
+ placeholder,
629
+ error: stateError,
630
+ variant,
631
+ sx: { mt: "10px", background: background || "transparent", borderRadius: "4px" },
632
+ id: "outlined-multiline-static",
633
+ label,
634
+ multiline: true,
635
+ disabled,
636
+ rows,
637
+ value: state,
638
+ onBlur: handleBlur,
639
+ onChange: (e) => {
640
+ if (setState) {
641
+ setState(e.target.value.substring(0, maxLength));
642
+ }
643
+ },
644
+ autoComplete: "off"
645
+ }
646
+ )), /* @__PURE__ */ React3.createElement(Stack2, null, /* @__PURE__ */ React3.createElement(
647
+ Typography3,
648
+ {
649
+ variant: "caption",
650
+ color: "text.secondary",
651
+ mr: 1,
652
+ mt: 1,
653
+ align: "right"
654
+ },
655
+ helperCount + "/" + maxLength
656
+ ))));
657
+ };
658
+
659
+ // src/Components/SCSelect.tsx
660
+ import React4, { useEffect as useEffect5 } from "react";
661
+ import { InputLabel as InputLabel2, FormControl as FormControl2, MenuItem, SvgIcon as SvgIcon3, ListItemIcon, ListItemText, Box as Box4 } from "@mui/material";
662
+ import Select from "@mui/material/Select";
663
+ import * as Muicon2 from "@mui/icons-material";
664
+ function SCSelect({
665
+ label = "",
666
+ data,
667
+ getItemValue,
668
+ width = "100%",
669
+ size = "small",
670
+ variant = "outlined",
671
+ deleteType = "button",
672
+ required,
673
+ disabled,
674
+ background,
675
+ fnAplicar,
676
+ setState,
677
+ state
678
+ }) {
679
+ const labelContent = `<span style="color: red;">* </span>` + label;
680
+ const [prevData, setPrevData] = React4.useState(data);
681
+ const [error, setError] = React4.useState(false);
682
+ useEffect5(() => {
683
+ if (error) {
684
+ setTimeout(() => {
685
+ setError(false);
686
+ }, 1e3);
687
+ }
688
+ }, [error]);
689
+ useEffect5(() => {
690
+ let dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
691
+ if (dataChangeValidation == false) {
692
+ setState({ hiddenValue: "", textValue: "" });
693
+ setPrevData(data);
694
+ }
695
+ }, [data]);
696
+ data.map(function(option, index, array) {
697
+ if (option == null ? void 0 : option.icon) {
698
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
699
+ option.icon = Muicon2[option == null ? void 0 : option.icon];
700
+ } else {
701
+ option;
702
+ }
703
+ }
704
+ });
705
+ const handleBlur = () => {
706
+ const currentValue = Array.isArray(state.hiddenValue) ? state.hiddenValue[0] : state.hiddenValue;
707
+ const isError = !currentValue && !!required;
708
+ setError(Boolean(isError));
709
+ };
710
+ const handleChange = (event2) => {
711
+ const selectedValue = event2.target.value;
712
+ if (selectedValue) {
713
+ const selectedOption = data.find((item) => getItemValue(item).value === selectedValue);
714
+ if (selectedOption) {
715
+ const itemValue = getItemValue(selectedOption);
716
+ setState({
717
+ hiddenValue: itemValue.value,
718
+ textValue: itemValue.text
719
+ });
720
+ }
721
+ }
722
+ };
723
+ return /* @__PURE__ */ React4.createElement(React4.Fragment, null, data && /* @__PURE__ */ React4.createElement(Box4, { sx: { width } }, /* @__PURE__ */ React4.createElement(
724
+ FormControl2,
725
+ {
726
+ fullWidth: true,
727
+ size: size ? size : "medium",
728
+ variant
729
+ },
730
+ /* @__PURE__ */ React4.createElement(
731
+ InputLabel2,
732
+ {
733
+ error
734
+ },
735
+ required ? /* @__PURE__ */ React4.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label
736
+ ),
737
+ /* @__PURE__ */ React4.createElement(
738
+ Select,
739
+ {
740
+ value: Array.isArray(state.hiddenValue) ? state.hiddenValue[0] || "" : state.hiddenValue != "-1" ? state.hiddenValue : "",
741
+ label: required ? /* @__PURE__ */ React4.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
742
+ onChange: handleChange,
743
+ onBlur: handleBlur,
744
+ variant,
745
+ disabled: disabled || false,
746
+ error,
747
+ MenuProps: {
748
+ PaperProps: {
749
+ sx: {
750
+ left: "0px !important"
751
+ }
752
+ },
753
+ sx: {
754
+ "& .MuiPaper-root": {
755
+ left: "0px !important"
756
+ }
757
+ }
758
+ }
759
+ },
760
+ data.map((option, index) => {
761
+ return /* @__PURE__ */ React4.createElement(MenuItem, { key: index, value: getItemValue(option).value }, getItemValue(option).icon != void 0 ? /* @__PURE__ */ React4.createElement(ListItemIcon, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React4.createElement(SvgIcon3, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "", /* @__PURE__ */ React4.createElement(ListItemText, { primary: getItemValue(option).text, color: "text.primary" }));
762
+ })
763
+ )
764
+ )));
765
+ }
766
+
767
+ // src/Components/SCAutocomplete.tsx
768
+ import React5, { useEffect as useEffect6 } from "react";
769
+ import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography5, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton4, Chip, Box as Box5, Button as Button3 } from "@mui/material";
770
+ import Grid3 from "@mui/material/Grid2";
771
+ import { Search, Clear } from "@mui/icons-material";
772
+ import * as Muicon3 from "@mui/icons-material";
773
+ function SCAutocomplete({
774
+ label = "",
775
+ data,
776
+ columnGroup,
777
+ getItemValue,
778
+ typeFormat = "normal",
779
+ checkMassive = false,
780
+ deleteType = "button",
781
+ fnAplicar,
782
+ required,
783
+ disabled,
784
+ background,
785
+ setState,
786
+ state,
787
+ inputChange,
788
+ maxCheck
789
+ // Agregar el parámetro maxCheck
790
+ }) {
791
+ const labelContent = `<span style="color: red;">* </span>` + label;
792
+ let group = "";
793
+ let isSelected = false;
794
+ const [selectedOptions, setSelectedOptions] = React5.useState([]);
795
+ const [prevData, setPrevData] = React5.useState(data);
796
+ const [originalData, setOriginalData] = React5.useState(data);
797
+ const [inputValue, setInputValue] = React5.useState("");
798
+ const [isUserTyping, setIsUserTyping] = React5.useState(false);
799
+ useEffect6(() => {
800
+ const dataChangeValidation = JSON.stringify(prevData) === JSON.stringify(data);
801
+ if (!dataChangeValidation && !isUserTyping) {
802
+ setState({ hiddenValue: "-1", textValue: "" });
803
+ setSelectedOptions([]);
804
+ setOriginalData(data);
805
+ } else if (!isUserTyping) {
806
+ setOriginalData(data);
807
+ }
808
+ setPrevData(data);
809
+ }, [data, isUserTyping]);
810
+ useEffect6(() => {
811
+ if (typeFormat == "multiselect") {
812
+ if (state.hiddenValue != "-1" && Array.isArray(state.hiddenValue)) {
813
+ const newSelectedOptions = originalData.filter(
814
+ (item) => state.hiddenValue.includes(getItemValue(item).value)
815
+ );
816
+ setSelectedOptions(newSelectedOptions);
817
+ }
818
+ }
819
+ }, [state.hiddenValue, originalData, typeFormat]);
820
+ useEffect6(() => {
821
+ if (inputValue === "") {
822
+ setIsUserTyping(false);
823
+ }
824
+ }, [inputValue]);
825
+ data.map(function(option) {
826
+ if (option == null ? void 0 : option.icon) {
827
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
828
+ option.icon = Muicon3[option == null ? void 0 : option.icon];
829
+ } else {
830
+ option;
831
+ }
832
+ }
833
+ });
834
+ const cleanOptions = (event2) => {
835
+ setState({ hiddenValue: "-1", textValue: "" });
836
+ setSelectedOptions([]);
837
+ setInputValue("");
838
+ setIsUserTyping(false);
839
+ };
840
+ const handleCheckAll = (event2) => {
841
+ if (event2.target.checked) {
842
+ const itemsToSelect = maxCheck ? data.slice(0, maxCheck) : data;
843
+ setSelectedOptions(itemsToSelect);
844
+ setState({
845
+ hiddenValue: itemsToSelect.map((item) => getItemValue(item).value),
846
+ textValue: itemsToSelect.map((item) => getItemValue(item).text)
847
+ });
848
+ } else {
849
+ setSelectedOptions([]);
850
+ setState({ hiddenValue: "-1", textValue: "" });
851
+ setInputValue("");
852
+ setIsUserTyping(false);
853
+ }
854
+ };
855
+ const allSelected = data.length > 0 && selectedOptions.length === data.length;
856
+ const handleChange = (event2, value) => {
857
+ if (typeFormat === "multiselect") {
858
+ if (maxCheck && value.length > maxCheck) {
859
+ value = value.slice(0, maxCheck);
860
+ }
861
+ const ids = value.map((v) => getItemValue ? getItemValue(v).value : "");
862
+ const texts = value.map((v) => getItemValue ? getItemValue(v).text : "");
863
+ setSelectedOptions(value);
864
+ setState({
865
+ hiddenValue: ids,
866
+ textValue: texts
867
+ });
868
+ } else {
869
+ setState({
870
+ hiddenValue: getItemValue(value).value,
871
+ textValue: getItemValue(value).text
872
+ });
873
+ }
874
+ };
875
+ const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
876
+ (item) => getItemValue(item).value === state.hiddenValue
877
+ ) || null;
878
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, data && /* @__PURE__ */ React5.createElement(
879
+ Autocomplete,
880
+ {
881
+ multiple: typeFormat === "multiselect",
882
+ clearOnEscape: true,
883
+ disabled,
884
+ options: data,
885
+ isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
886
+ onInputChange: (event2, value) => {
887
+ setInputValue(value);
888
+ setIsUserTyping(value.length > 0);
889
+ if (inputChange) {
890
+ inputChange(value);
891
+ }
892
+ },
893
+ onChange: handleChange,
894
+ getOptionLabel: (option) => getItemValue(option).text,
895
+ value: selectedValue,
896
+ sx: {
897
+ background: background || "transparent",
898
+ width: "100%",
899
+ maxWidth: "100%"
900
+ },
901
+ limitTags: 2,
902
+ renderTags: (value, getTagProps) => {
903
+ const limit = 2;
904
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, value.slice(0, limit).map((option, index) => {
905
+ const _a = getTagProps({ index }), { key } = _a, chipProps = __objRest(_a, ["key"]);
906
+ return /* @__PURE__ */ React5.createElement(
907
+ Chip,
908
+ __spreadProps(__spreadValues({
909
+ key,
910
+ color: "default",
911
+ size: "small",
912
+ variant: "filled",
913
+ label: getItemValue(option).text
914
+ }, chipProps), {
915
+ style: { maxWidth: 120, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
916
+ })
917
+ );
918
+ }), value.length > limit && /* @__PURE__ */ React5.createElement(Box5, { sx: { ml: 0.5, fontSize: 13, color: "#666", display: "flex", alignItems: "center" } }, `+${value.length - limit}`));
919
+ },
920
+ renderOption: (props, option) => {
921
+ const _a = props, { key } = _a, optionProps = __objRest(_a, ["key"]);
922
+ let isValid;
923
+ let isDisabled = false;
924
+ if (typeFormat == "multiselect") {
925
+ isSelected = selectedOptions.some(
926
+ (selected) => getItemValue(selected).value === getItemValue(option).value
927
+ );
928
+ if (maxCheck && selectedOptions.length >= maxCheck && !isSelected) {
929
+ isDisabled = true;
930
+ }
931
+ }
932
+ if (columnGroup) {
933
+ isValid = group == option[columnGroup];
934
+ group = option[columnGroup];
935
+ }
936
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(React5.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React5.createElement(Typography5, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React5.createElement(
937
+ MenuItem2,
938
+ __spreadProps(__spreadValues({}, optionProps), {
939
+ disabled: isDisabled,
940
+ style: {
941
+ background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#dfe6ec" : "white" : "white",
942
+ padding: "7px 16px",
943
+ opacity: isDisabled ? 0.5 : 1
944
+ }
945
+ }),
946
+ typeFormat != "multiselect" && getItemValue(option).icon != void 0 ? /* @__PURE__ */ React5.createElement(ListItemIcon2, { sx: { minWidth: "10px !important" } }, /* @__PURE__ */ React5.createElement(SvgIcon4, { fontSize: "small", color: "action", component: getItemValue(option).icon })) : "",
947
+ typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(
948
+ Checkbox,
949
+ {
950
+ checked: isSelected,
951
+ disabled: isDisabled,
952
+ value: getItemValue(option).text,
953
+ color: "primary"
954
+ }
955
+ ) : "",
956
+ /* @__PURE__ */ React5.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }),
957
+ getItemValue(option).component != void 0 ? getItemValue(option).component : ""
958
+ )));
959
+ },
960
+ renderInput: (params) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
961
+ TextField3,
962
+ __spreadProps(__spreadValues({}, params), {
963
+ label: required ? /* @__PURE__ */ React5.createElement("span", { dangerouslySetInnerHTML: { __html: labelContent } }) : label,
964
+ placeholder: selectedOptions.length == 0 ? "B\xFAsqueda" : "",
965
+ InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
966
+ endAdornment: /* @__PURE__ */ React5.createElement(React5.Fragment, null, deleteType == "icon" && (state.hiddenValue.toString() != "-1" && state.hiddenValue.toString() != "") ? /* @__PURE__ */ React5.createElement(IconButton4, { size: "small", onClick: cleanOptions, sx: { marginLeft: "auto", textAlign: "right", padding: "0px" } }, /* @__PURE__ */ React5.createElement(Clear, { fontSize: "small" })) : "", /* @__PURE__ */ React5.createElement(InputAdornment3, { style: { zIndex: 1, position: "relative" }, position: "end" }, /* @__PURE__ */ React5.createElement(Search, { fontSize: "small", color: "action", style: { cursor: "pointer" } })))
967
+ })
968
+ })
969
+ )),
970
+ slotProps: {
971
+ listbox: {
972
+ component: React5.forwardRef(function ListboxComponent(props, ref) {
973
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
974
+ Box5,
975
+ __spreadProps(__spreadValues({
976
+ ref
977
+ }, props), {
978
+ sx: __spreadValues({
979
+ position: "relative",
980
+ paddingBottom: "56px",
981
+ backgroundColor: "white"
982
+ }, props.sx)
983
+ }),
984
+ checkMassive && typeFormat == "multiselect" ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(FormControlLabel2, { control: /* @__PURE__ */ React5.createElement(Checkbox, { checked: allSelected, indeterminate: selectedOptions.length > 0 && selectedOptions.length < data.length, onChange: handleCheckAll, color: "primary" }), label: "Todos los items", sx: { marginLeft: "0px !important", marginRight: "0px !important", padding: "7px 16px" } }), /* @__PURE__ */ React5.createElement(Divider3, null)) : "",
985
+ props.children,
986
+ deleteType == "button" || fnAplicar ? /* @__PURE__ */ React5.createElement(
987
+ Grid3,
988
+ {
989
+ container: true,
990
+ sx: {
991
+ position: "sticky",
992
+ bottom: -8,
993
+ left: 0,
994
+ width: "100%",
995
+ backgroundColor: "grey.50",
996
+ padding: "8px 16px",
997
+ textAlign: "left",
998
+ justifyContent: "space-between"
999
+ }
1000
+ },
1001
+ deleteType == "button" ? /* @__PURE__ */ React5.createElement(
1002
+ Button3,
1003
+ {
1004
+ variant: "text",
1005
+ color: "primary",
1006
+ size: "small",
1007
+ onClick: (event2) => {
1008
+ event2.stopPropagation();
1009
+ cleanOptions(event2);
1010
+ }
1011
+ },
1012
+ "Limpiar"
1013
+ ) : "",
1014
+ fnAplicar && /* @__PURE__ */ React5.createElement(
1015
+ Button3,
1016
+ {
1017
+ variant: "contained",
1018
+ color: "primary",
1019
+ size: "small",
1020
+ onClick: fnAplicar
1021
+ },
1022
+ "Aplicar"
1023
+ )
1024
+ ) : ""
1025
+ ));
1026
+ })
1027
+ }
1028
+ }
1029
+ }
1030
+ ));
1031
+ }
1032
+
1033
+ // src/Components/SCDateRange.tsx
1034
+ import React6 from "react";
1035
+ import { Box as Box6, InputAdornment as InputAdornment4 } from "@mui/material";
1036
+ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
1037
+ import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
1038
+ import { DateRangePicker } from "@mui/x-date-pickers-pro/DateRangePicker";
1039
+ import { MultiInputDateRangeField } from "@mui/x-date-pickers-pro/MultiInputDateRangeField";
1040
+ import dayjs from "dayjs";
1041
+ import "dayjs/locale/es";
1042
+ import { LicenseInfo } from "@mui/x-license-pro";
1043
+ import EventIcon from "@mui/icons-material/Event";
1044
+ var SCDateRange = ({
1045
+ labelDateInitial = "Fecha inicial",
1046
+ labelDateFinal = "Fecha final",
1047
+ required = false,
1048
+ disabled = false,
1049
+ background = "transparent",
1050
+ state,
1051
+ setState
1052
+ }) => {
1053
+ LicenseInfo.setLicenseKey(
1054
+ "77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
1055
+ );
1056
+ const isStartEmpty = required && !state[0];
1057
+ const isEndEmpty = required && !state[1];
1058
+ const hasError = isStartEmpty || isEndEmpty;
1059
+ const handleDateChange = (newValue) => {
1060
+ const convertedValue = [
1061
+ newValue[0] ? dayjs(newValue[0]) : null,
1062
+ newValue[1] ? dayjs(newValue[1]) : null
1063
+ ];
1064
+ setState(convertedValue);
1065
+ };
1066
+ return /* @__PURE__ */ React6.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ React6.createElement(Box6, { sx: { width: "100%" } }, /* @__PURE__ */ React6.createElement(
1067
+ DateRangePicker,
1068
+ {
1069
+ value: state,
1070
+ onChange: handleDateChange,
1071
+ disabled,
1072
+ slots: {
1073
+ field: MultiInputDateRangeField
1074
+ },
1075
+ slotProps: {
1076
+ field: {
1077
+ slotProps: {
1078
+ textField: ({ position }) => ({
1079
+ label: position === "start" ? labelDateInitial : labelDateFinal,
1080
+ size: "small",
1081
+ variant: "outlined",
1082
+ required,
1083
+ error: position === "start" ? isStartEmpty : isEndEmpty,
1084
+ InputProps: {
1085
+ endAdornment: /* @__PURE__ */ React6.createElement(InputAdornment4, { position: "end" }, /* @__PURE__ */ React6.createElement(
1086
+ EventIcon,
1087
+ {
1088
+ color: hasError ? "error" : "action",
1089
+ fontSize: "small"
1090
+ }
1091
+ ))
1092
+ },
1093
+ sx: {
1094
+ mr: position === "start" ? 1 : 0,
1095
+ "& .MuiOutlinedInput-root": {
1096
+ backgroundColor: background === "transparent" ? "transparent" : background
1097
+ },
1098
+ "& .MuiInputLabel-asterisk": {
1099
+ color: "error.main"
1100
+ },
1101
+ background: background != null ? background : "transparent"
1102
+ }
1103
+ })
1104
+ }
1105
+ }
1106
+ },
1107
+ sx: {
1108
+ display: "flex",
1109
+ gap: 1,
1110
+ width: "100%"
1111
+ }
1112
+ }
1113
+ )));
1114
+ };
1115
+
1116
+ // src/Components/Drawer/Helpers/Utils.tsx
1117
+ import * as Muicon4 from "@mui/icons-material";
1118
+ var getIcon2 = (iconName) => {
1119
+ if (iconName && iconName in Muicon4) {
1120
+ return Muicon4[iconName];
1121
+ }
1122
+ return null;
1123
+ };
1124
+
1125
+ // src/Components/Drawer/Helpers/validateInput.tsx
1126
+ var validateInputs = (arrayElements, onError, onSuccess) => {
1127
+ var _a;
1128
+ let requiredValues = 0;
1129
+ let filledValues = 0;
1130
+ for (let i = 0; i < arrayElements.length; i++) {
1131
+ if (arrayElements[i].component === void 0) {
1132
+ if (arrayElements[i].required) {
1133
+ requiredValues++;
1134
+ }
1135
+ if (arrayElements[i].required && ((_a = arrayElements[i].state) == null ? void 0 : _a.trim()) !== "") {
1136
+ filledValues++;
1137
+ }
1138
+ }
1139
+ }
1140
+ if (requiredValues === filledValues) {
1141
+ onSuccess();
1142
+ } else {
1143
+ onError({
1144
+ type: "error",
1145
+ title: "Algunos campos son requeridos",
1146
+ time: 10
1147
+ });
1148
+ }
1149
+ };
1150
+
1151
+ // src/Components/Drawer/SCDrawer.tsx
1152
+ function SCDrawer({
1153
+ //informativas
1154
+ title,
1155
+ arrayElements = [],
1156
+ actions,
1157
+ buttonDrawer,
1158
+ //Apariencia
1159
+ colorTitle,
1160
+ anchor = "left",
1161
+ width,
1162
+ //Funcionales
1163
+ open
1164
+ }) {
1165
+ var _a, _b;
1166
+ const [drawerOpen, setDrawerOpen] = React7.useState(open);
1167
+ const [toast, setToast] = React7.useState(null);
1168
+ const handleDrawerClose = () => {
1169
+ setDrawerOpen(false);
1170
+ };
1171
+ const toggleDrawer = (newOpen) => () => {
1172
+ setDrawerOpen(newOpen);
1173
+ };
1174
+ const ButtonIcon = getIcon2(buttonDrawer == null ? void 0 : buttonDrawer.icon);
1175
+ const setToastWithDelay = (toastContent) => {
1176
+ setToast(null);
1177
+ setTimeout(() => {
1178
+ setToast(toastContent);
1179
+ }, 10);
1180
+ };
1181
+ const inputValidation = () => validateInputs(arrayElements, setToastWithDelay, handleDrawerClose);
1182
+ const clean = () => {
1183
+ arrayElements.forEach((element, index) => {
1184
+ if (element.setState) {
1185
+ if (element.type === "textField" || element.type === "textArea") {
1186
+ element.setState("");
1187
+ } else if (element.type === "dateRange") {
1188
+ element.setState([null, null]);
1189
+ } else {
1190
+ if (element.type == "autocomplete" && element.typeFormat == "multiselect") {
1191
+ element.setState({ hiddenValue: [], textValue: [] });
1192
+ } else {
1193
+ element.setState({ hiddenValue: "-1", textValue: "" });
1194
+ }
1195
+ }
1196
+ }
1197
+ });
1198
+ };
1199
+ const actionsA = actions == false ? false : actions != void 0 ? actions : [{ text: "Aplicar filtros", fn: inputValidation }, { text: "Limpiar filtros", fn: clean }];
1200
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, toast && /* @__PURE__ */ React7.createElement(SCToastNotification, __spreadValues({}, toast)), (buttonDrawer == null ? void 0 : buttonDrawer.type) == "chip" ? /* @__PURE__ */ React7.createElement(
1201
+ Chip2,
1202
+ __spreadProps(__spreadValues({
1203
+ onClick: toggleDrawer(true),
1204
+ color: buttonDrawer == null ? void 0 : buttonDrawer.color,
1205
+ variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) == "contained" ? "filled" : "outlined",
1206
+ label: (_a = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _a : "",
1207
+ icon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : void 0,
1208
+ deleteIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : void 0
1209
+ }, (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? { onDelete: () => {
1210
+ } } : {}), {
1211
+ sx: {
1212
+ "& .MuiChip-icon": {
1213
+ color: "inherit"
1214
+ },
1215
+ textTransform: "capitalize"
1216
+ }
1217
+ })
1218
+ ) : /* @__PURE__ */ React7.createElement(
1219
+ Button4,
1220
+ {
1221
+ "data-testid": "test-buttonDrawer",
1222
+ sx: { textTransform: "capitalize" },
1223
+ color: buttonDrawer == null ? void 0 : buttonDrawer.color,
1224
+ onClick: toggleDrawer(true),
1225
+ size: "small",
1226
+ variant: (buttonDrawer == null ? void 0 : buttonDrawer.variant) != void 0 ? buttonDrawer == null ? void 0 : buttonDrawer.variant : "text",
1227
+ startIcon: ((buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "left" || !(buttonDrawer == null ? void 0 : buttonDrawer.iconPosition)) && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : null,
1228
+ endIcon: (buttonDrawer == null ? void 0 : buttonDrawer.iconPosition) === "right" && ButtonIcon ? /* @__PURE__ */ React7.createElement(ButtonIcon, { fontSize: "small" }) : null
1229
+ },
1230
+ (_b = buttonDrawer == null ? void 0 : buttonDrawer.text) != null ? _b : ""
1231
+ ), /* @__PURE__ */ React7.createElement(
1232
+ Drawer,
1233
+ {
1234
+ open: drawerOpen,
1235
+ onClose: toggleDrawer(false),
1236
+ anchor: anchor != null ? anchor : "left",
1237
+ sx: {
1238
+ "& .MuiDrawer-paper": {
1239
+ width: width != null ? width : "450px",
1240
+ boxSizing: "border-box",
1241
+ borderRadius: anchor !== "right" ? "0px 4px 4px 0px" : "4px 0px 0px 4px"
1242
+ }
1243
+ }
1244
+ },
1245
+ /* @__PURE__ */ React7.createElement(Stack3, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ React7.createElement(Grid4, { container: true, sx: { backgroundColor: "primary.50", alignItems: "center", height: "42px", textAlign: "left", padding: "8px 12px", justifyContent: "space-between", alignContent: "center" } }, /* @__PURE__ */ React7.createElement(Typography7, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"), /* @__PURE__ */ React7.createElement(IconButton5, { onClick: handleDrawerClose }, /* @__PURE__ */ React7.createElement(CloseIcon, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))), /* @__PURE__ */ React7.createElement(Stack3, { alignItems: "flex-start", height: "100%", gap: "16px", flex: 1, overflow: "auto", padding: "16px" }, arrayElements == null ? void 0 : arrayElements.map((arrayElement, index) => {
1246
+ var _a2, _b2, _c, _d, _e, _f;
1247
+ return /* @__PURE__ */ React7.createElement(
1248
+ Box7,
1249
+ {
1250
+ key: `Stack_${(_a2 = arrayElement.type) != null ? _a2 : ""} ${(_b2 = arrayElement.label) != null ? _b2 : ""}${index}`,
1251
+ sx: { width: "100%" }
1252
+ },
1253
+ arrayElement.component ? /* @__PURE__ */ React7.createElement(Stack3, { direction: "row", alignItems: "left", gap: 1 }, arrayElement.component) : arrayElement.type === "textField" ? /* @__PURE__ */ React7.createElement(
1254
+ SCTextField,
1255
+ {
1256
+ title: arrayElement.title,
1257
+ iconTitle: arrayElement.iconTitle,
1258
+ infoTitle: arrayElement.infoTitle,
1259
+ label: arrayElement.label,
1260
+ placeholder: arrayElement.placeholder,
1261
+ infoElement: arrayElement.infoElement,
1262
+ iconInputStart: arrayElement.iconInputStart,
1263
+ iconInputEnd: arrayElement.iconInputEnd,
1264
+ maxLength: arrayElement.maxLength,
1265
+ variant: arrayElement.variant,
1266
+ format: arrayElement.format,
1267
+ disabled: arrayElement.disabled,
1268
+ required: arrayElement.required,
1269
+ size: arrayElement.size,
1270
+ width: arrayElement.width,
1271
+ color: arrayElement.color,
1272
+ background: arrayElement.background,
1273
+ setState: arrayElement.setState,
1274
+ state: arrayElement.state || "",
1275
+ onChange: arrayElement.onChange,
1276
+ onBlur: arrayElement.onBlur,
1277
+ onKeyDown: arrayElement.onKeyDown
1278
+ }
1279
+ ) : arrayElement.type === "textArea" ? /* @__PURE__ */ React7.createElement(
1280
+ SCTextArea,
1281
+ {
1282
+ title: arrayElement.title,
1283
+ iconTitle: arrayElement.iconTitle,
1284
+ infoTitle: arrayElement.infoTitle,
1285
+ label: arrayElement.label,
1286
+ placeholder: arrayElement.placeholder,
1287
+ maxLength: arrayElement.maxLength,
1288
+ variant: arrayElement.variant,
1289
+ disabled: arrayElement.disabled,
1290
+ required: arrayElement.required,
1291
+ width: arrayElement.width,
1292
+ rows: arrayElement.rows,
1293
+ background: arrayElement.background,
1294
+ setState: arrayElement.setState,
1295
+ state: arrayElement.state || "",
1296
+ onBlur: arrayElement.onBlur
1297
+ }
1298
+ ) : arrayElement.type === "autocomplete" ? /* @__PURE__ */ React7.createElement(
1299
+ SCAutocomplete,
1300
+ {
1301
+ label: arrayElement.label,
1302
+ data: (_c = arrayElement.data) != null ? _c : [],
1303
+ columnGroup: arrayElement.columnGroup,
1304
+ getItemValue: (_d = arrayElement.getItemValue) != null ? _d : () => ({ text: "", value: "" }),
1305
+ typeFormat: arrayElement.typeFormat,
1306
+ checkMassive: arrayElement.checkMassive,
1307
+ deleteType: arrayElement.deleteType,
1308
+ required: arrayElement.required,
1309
+ disabled: arrayElement.disabled,
1310
+ background: arrayElement.background,
1311
+ fnAplicar: arrayElement.fnAplicar,
1312
+ setState: arrayElement.setState,
1313
+ state: arrayElement.state || "",
1314
+ inputChange: arrayElement.inputChange
1315
+ }
1316
+ ) : arrayElement.type === "select" ? /* @__PURE__ */ React7.createElement(
1317
+ SCSelect,
1318
+ {
1319
+ label: arrayElement.label,
1320
+ data: (_e = arrayElement.data) != null ? _e : [],
1321
+ getItemValue: (_f = arrayElement.getItemValue) != null ? _f : () => ({ text: "", value: "" }),
1322
+ width: arrayElement.width,
1323
+ size: arrayElement.size,
1324
+ variant: arrayElement.variant,
1325
+ deleteType: arrayElement.deleteType,
1326
+ required: arrayElement.required,
1327
+ disabled: arrayElement.disabled,
1328
+ background: arrayElement.background,
1329
+ fnAplicar: arrayElement.fnAplicar,
1330
+ setState: arrayElement.setState,
1331
+ state: arrayElement.state || ""
1332
+ }
1333
+ ) : arrayElement.type === "dateRange" ? /* @__PURE__ */ React7.createElement(
1334
+ SCDateRange,
1335
+ {
1336
+ labelDateInitial: arrayElement.labelDateInitial,
1337
+ labelDateFinal: arrayElement.labelDateFinal,
1338
+ required: arrayElement.required,
1339
+ disabled: arrayElement.disabled,
1340
+ background: arrayElement.background,
1341
+ state: arrayElement.state || [],
1342
+ setState: arrayElement.setState
1343
+ }
1344
+ ) : null
1345
+ );
1346
+ })), actionsA != void 0 && actionsA != false ? Array.isArray(actionsA) && (actionsA == null ? void 0 : actionsA.length) > 0 ? /* @__PURE__ */ React7.createElement(
1347
+ Grid4,
1348
+ {
1349
+ sx: { borderTop: 1, borderColor: "#1018403B" },
1350
+ container: true,
1351
+ gap: 2,
1352
+ padding: "8px 12px",
1353
+ height: "42px",
1354
+ alignItems: "center",
1355
+ justifyContent: actionsA.length > 1 ? "space-between" : !anchor && anchor != "right" ? "flex-end" : "flex-start",
1356
+ flexDirection: anchor != "right" ? "row-reverse" : "row"
1357
+ },
1358
+ actionsA.map((btn, index) => /* @__PURE__ */ React7.createElement(
1359
+ Button4,
1360
+ {
1361
+ key: index,
1362
+ variant: index === 0 || actionsA.length < 2 ? "contained" : "text",
1363
+ color: "primary",
1364
+ onClick: btn.fn,
1365
+ disabled: btn.disabled || false,
1366
+ size: "small"
1367
+ },
1368
+ btn.text
1369
+ ))
1370
+ ) : "" : "")
1371
+ ));
1372
+ }
1373
+
1374
+ // src/Components/FooterAction/FooterAction.tsx
1375
+ import React8 from "react";
1376
+ import { AppBar, Toolbar, Box as Box8, Typography as Typography8 } from "@mui/material";
1377
+ var FooterAction = ({
1378
+ leftContent,
1379
+ rightContent,
1380
+ label,
1381
+ variant
1382
+ }) => {
1383
+ return /* @__PURE__ */ React8.createElement(
1384
+ AppBar,
1385
+ {
1386
+ color: "inherit",
1387
+ sx: { position: variant == "float" ? "relative" : "fixed", left: 0, right: "auto", width: "100%", top: "auto", bottom: 0 }
1388
+ },
1389
+ /* @__PURE__ */ React8.createElement(
1390
+ Toolbar,
1391
+ {
1392
+ id: "footer-toolbar",
1393
+ sx: { gap: 1.5, minHeight: "50px !important" }
1394
+ },
1395
+ leftContent,
1396
+ /* @__PURE__ */ React8.createElement(Box8, { flexGrow: 1 }),
1397
+ label && /* @__PURE__ */ React8.createElement(Typography8, { variant: "body2", color: "text.secondary" }, label),
1398
+ rightContent
1399
+ )
1400
+ );
1401
+ };
1402
+
1403
+ // src/Components/Modal/Helpers/Data.tsx
1404
+ import React9 from "react";
1405
+ import { Info, Warning } from "@mui/icons-material";
1406
+ var modalStateConfig = {
1407
+ info: {
1408
+ color: "info",
1409
+ defaultDescription: "Se [sincronizar\xE1n] los datos trabajados en modo offline y se [subir\xE1n] a los servidores.",
1410
+ icon: /* @__PURE__ */ React9.createElement(Info, { color: "info", fontSize: "medium" })
1411
+ },
1412
+ delete: {
1413
+ color: "delete",
1414
+ defaultDescription: "[Elemento espec\xEDfico] [dejar\xE1 de existir en todos los lugares donde est\xE9 en uso]. Esta acci\xF3n es irreversible.",
1415
+ icon: /* @__PURE__ */ React9.createElement(Info, { color: "error", fontSize: "medium" })
1416
+ },
1417
+ warning: {
1418
+ color: "warning",
1419
+ defaultDescription: "Se descartar\xE1 la [creaci\xF3n] y los cambios se perder\xE1n.",
1420
+ icon: /* @__PURE__ */ React9.createElement(Warning, { color: "warning", fontSize: "medium" })
1421
+ }
1422
+ };
1423
+
1424
+ // src/Components/Modal/Helpers/Utils.tsx
1425
+ import * as MuiIcons2 from "@mui/icons-material";
1426
+ import { FilterListOutlined } from "@mui/icons-material";
1427
+ var getIconComponent2 = (iconName) => {
1428
+ return iconName && MuiIcons2[iconName] ? MuiIcons2[iconName] : FilterListOutlined;
1429
+ };
1430
+ var getModalColor = (state) => {
1431
+ var _a;
1432
+ const colors = {
1433
+ info: "info.100",
1434
+ delete: "error.100",
1435
+ warning: "warning.100"
1436
+ };
1437
+ return (_a = colors[state]) != null ? _a : "warning.100";
1438
+ };
1439
+ var getButtonColor = (state) => {
1440
+ var _a;
1441
+ const colorMap = {
1442
+ info: "info",
1443
+ delete: "error",
1444
+ warning: "warning"
1445
+ };
1446
+ return (_a = colorMap[state]) != null ? _a : "info";
1447
+ };
1448
+
1449
+ // src/Components/Modal/SCModal.tsx
1450
+ import React10, { useCallback, useEffect as useEffect7, useMemo, useState as useState5 } from "react";
1451
+ import { Modal, Box as Box9, Typography as Typography9, IconButton as IconButton6, Button as Button5, Stack as Stack4 } from "@mui/material";
1452
+ import { Close as Close2 } from "@mui/icons-material";
1453
+
1454
+ // src/generales/capitalize.tsx
1455
+ function capitalize(text) {
1456
+ return text.charAt(0).toUpperCase() + text.slice(1);
1457
+ }
1458
+
1459
+ // src/Components/Modal/SCModal.tsx
1460
+ var SCModal = ({
1461
+ buttonModal,
1462
+ state = "info",
1463
+ open,
1464
+ title,
1465
+ description,
1466
+ action
1467
+ }) => {
1468
+ var _a, _b, _c, _d, _e;
1469
+ const [openModal, setOpenModal] = useState5(open != null ? open : false);
1470
+ useEffect7(() => {
1471
+ if (open !== void 0) {
1472
+ setOpenModal(open);
1473
+ }
1474
+ }, [open]);
1475
+ const Icon = useMemo(() => getIconComponent2(buttonModal == null ? void 0 : buttonModal.icon), [buttonModal == null ? void 0 : buttonModal.icon]);
1476
+ const handleClose = useCallback(() => setOpenModal(false), []);
1477
+ const toggleModal = (newOpen) => () => setOpenModal(newOpen);
1478
+ const prevAction = useMemo(
1479
+ () => action != null ? action : [{ text: "Cancelar", fn: handleClose }, { text: "Consultar", fn: () => {
1480
+ } }],
1481
+ [action, handleClose]
1482
+ );
1483
+ const { icon, defaultDescription } = modalStateConfig[state];
1484
+ return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
1485
+ Button5,
1486
+ {
1487
+ "data-testid": "test-buttonModal",
1488
+ color: (_a = buttonModal == null ? void 0 : buttonModal.color) != null ? _a : "primary",
1489
+ onClick: toggleModal(true),
1490
+ variant: (_b = buttonModal == null ? void 0 : buttonModal.variant) != null ? _b : "text",
1491
+ size: (_c = buttonModal == null ? void 0 : buttonModal.size) != null ? _c : "small",
1492
+ startIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "left" && /* @__PURE__ */ React10.createElement(Icon, null),
1493
+ endIcon: (buttonModal == null ? void 0 : buttonModal.iconPosition) === "right" && /* @__PURE__ */ React10.createElement(Icon, null)
1494
+ },
1495
+ capitalize((_d = buttonModal == null ? void 0 : buttonModal.text) != null ? _d : "filtrar")
1496
+ ), /* @__PURE__ */ React10.createElement(Modal, { open: openModal, onClose: toggleModal(false), sx: { boxShadow: 8 } }, /* @__PURE__ */ React10.createElement(
1497
+ Box9,
1498
+ {
1499
+ sx: {
1500
+ position: "absolute",
1501
+ top: "50%",
1502
+ left: "50%",
1503
+ transform: "translate(-50%, -50%)",
1504
+ width: 400,
1505
+ bgcolor: "background.paper",
1506
+ borderRadius: 1,
1507
+ boxShadow: 24
1508
+ }
1509
+ },
1510
+ /* @__PURE__ */ React10.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React10.createElement(Stack4, { direction: "row", alignItems: "center", p: 1, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Box9, { display: "flex", justifyContent: "center", alignItems: "center", borderRadius: "50%", height: 36, width: 36, bgcolor: getModalColor(state) }, icon), /* @__PURE__ */ React10.createElement(Typography9, { variant: "h6", color: "text.primary" }, title)), /* @__PURE__ */ React10.createElement(IconButton6, { onClick: toggleModal(false), "data-testid": "test-buttonClose" }, /* @__PURE__ */ React10.createElement(Close2, { color: "action" }))),
1511
+ /* @__PURE__ */ React10.createElement(Stack4, { py: 1, px: 3, gap: 1.5 }, /* @__PURE__ */ React10.createElement(Typography9, { variant: "body1" }, description || defaultDescription)),
1512
+ action && /* @__PURE__ */ React10.createElement(
1513
+ Stack4,
1514
+ {
1515
+ id: "Action",
1516
+ direction: "row",
1517
+ gap: 1,
1518
+ p: 1,
1519
+ justifyContent: "end",
1520
+ bgcolor: "grey.50",
1521
+ sx: { borderRadius: 1 }
1522
+ },
1523
+ /* @__PURE__ */ React10.createElement(
1524
+ Button5,
1525
+ {
1526
+ color: "inherit",
1527
+ variant: "text",
1528
+ onClick: handleClose,
1529
+ size: "small"
1530
+ },
1531
+ capitalize("cancelar")
1532
+ ),
1533
+ /* @__PURE__ */ React10.createElement(
1534
+ Button5,
1535
+ {
1536
+ "data-testid": "test-aceptar",
1537
+ color: getButtonColor(state),
1538
+ variant: "contained",
1539
+ onClick: (_e = action[0]) == null ? void 0 : _e.fn,
1540
+ disabled: false,
1541
+ size: "small"
1542
+ },
1543
+ capitalize(action[0].text)
1544
+ )
1545
+ )
1546
+ )));
1547
+ };
1548
+
1549
+ // src/Components/MultiSelect/MultiSelect.tsx
1550
+ import React11, { useEffect as useEffect8, useMemo as useMemo3 } from "react";
1551
+ import { Button as Button6, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack5, TextField as TextField4 } from "@mui/material";
1552
+ import { SearchOutlined } from "@mui/icons-material";
1553
+
1554
+ // src/Components/MultiSelect/helpers/useHandlers.tsx
1555
+ import { useCallback as useCallback2, useState as useState6 } from "react";
1556
+ function useMultiSelectHandlers() {
1557
+ const [anchorEl, setAnchorEl] = useState6(null);
1558
+ const [open, setOpen] = useState6(false);
1559
+ const [selectedItems, setSelectedItems] = useState6([]);
1560
+ const [filterValue, setFilterValue] = useState6("");
1561
+ const handleOpen = useCallback2((e) => {
1562
+ setAnchorEl(e.currentTarget);
1563
+ setOpen(true);
1564
+ }, []);
1565
+ const handleClose = useCallback2(() => {
1566
+ setAnchorEl(null);
1567
+ setOpen(false);
1568
+ }, []);
1569
+ const handleFilterChange = useCallback2(
1570
+ (e) => {
1571
+ setFilterValue(e.target.value);
1572
+ },
1573
+ []
1574
+ );
1575
+ const handleCheckboxToggle = useCallback2((item) => {
1576
+ setSelectedItems(
1577
+ (prev) => prev.includes(item) ? prev.filter((i) => i !== item) : [...prev, item]
1578
+ );
1579
+ }, []);
1580
+ return {
1581
+ anchorEl,
1582
+ open,
1583
+ selectedItems,
1584
+ filterValue,
1585
+ setSelectedItems,
1586
+ handleOpen,
1587
+ handleClose,
1588
+ handleFilterChange,
1589
+ handleCheckboxToggle,
1590
+ setOpen
1591
+ };
1592
+ }
1593
+
1594
+ // src/Components/MultiSelect/helpers/Utils.tsx
1595
+ import * as MuiIcons3 from "@mui/icons-material";
1596
+ import { FilterListOutlined as FilterListOutlined2 } from "@mui/icons-material";
1597
+ function getIconMultiSelect(name) {
1598
+ return name in MuiIcons3 ? MuiIcons3[name] : FilterListOutlined2;
1599
+ }
1600
+
1601
+ // src/Components/MultiSelect/helpers/useFilteredItems.tsx
1602
+ import { useMemo as useMemo2 } from "react";
1603
+ function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
1604
+ const filteredItems = useMemo2(
1605
+ () => items.filter(
1606
+ (item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
1607
+ ),
1608
+ [items, filterValue, getItemLabel]
1609
+ );
1610
+ const sortedItems = useMemo2(() => {
1611
+ return [
1612
+ ...filteredItems.filter((item) => selectedItems.includes(item)),
1613
+ ...filteredItems.filter((item) => !selectedItems.includes(item))
1614
+ ];
1615
+ }, [filteredItems, selectedItems]);
1616
+ return { filteredItems, sortedItems };
1617
+ }
1618
+
1619
+ // src/Components/MultiSelect/MultiSelect.tsx
1620
+ function MultiSelect({
1621
+ textButton,
1622
+ button,
1623
+ items,
1624
+ topPanel,
1625
+ actions,
1626
+ dense = false,
1627
+ open,
1628
+ selectAll = false,
1629
+ getItemLabel
1630
+ }) {
1631
+ var _a, _b;
1632
+ const {
1633
+ anchorEl,
1634
+ open: openMultiselect,
1635
+ selectedItems,
1636
+ filterValue,
1637
+ setSelectedItems,
1638
+ handleOpen,
1639
+ handleClose,
1640
+ handleFilterChange,
1641
+ handleCheckboxToggle,
1642
+ setOpen
1643
+ } = useMultiSelectHandlers();
1644
+ useEffect8(() => {
1645
+ if (open !== void 0) {
1646
+ setOpen(open);
1647
+ }
1648
+ }, [open, setOpen]);
1649
+ useEffect8(() => {
1650
+ setSelectedItems([]);
1651
+ }, [items, setSelectedItems]);
1652
+ const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
1653
+ const Icon = useMemo3(() => {
1654
+ var _a2;
1655
+ return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
1656
+ }, [button == null ? void 0 : button.icon]);
1657
+ const handleSelectAll = () => {
1658
+ const allSelected2 = selectedItems.length === filteredItems.length;
1659
+ setSelectedItems(allSelected2 ? [] : filteredItems);
1660
+ };
1661
+ const allSelected = filteredItems.length > 0 && selectedItems.length === filteredItems.length;
1662
+ const resolvedActions = actions != null ? actions : [
1663
+ { text: "Limpiar", fn: handleClose },
1664
+ { text: "Aplicar", fn: () => {
1665
+ } }
1666
+ ];
1667
+ return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
1668
+ Button6,
1669
+ {
1670
+ "test-id": "multiselect-button",
1671
+ color: (_a = button == null ? void 0 : button.color) != null ? _a : "primary",
1672
+ onClick: handleOpen,
1673
+ variant: (_b = button == null ? void 0 : button.variant) != null ? _b : "text",
1674
+ size: "small",
1675
+ startIcon: (button == null ? void 0 : button.iconPosition) === "left" || !(button == null ? void 0 : button.iconPosition) ? /* @__PURE__ */ React11.createElement(Icon, null) : null,
1676
+ endIcon: (button == null ? void 0 : button.iconPosition) === "right" ? /* @__PURE__ */ React11.createElement(Icon, null) : null
1677
+ },
1678
+ capitalize(textButton != null ? textButton : "MultiSelect")
1679
+ ), /* @__PURE__ */ React11.createElement(
1680
+ Popover3,
1681
+ {
1682
+ elevation: 8,
1683
+ anchorEl,
1684
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
1685
+ open: openMultiselect,
1686
+ onClose: () => setOpen(false)
1687
+ },
1688
+ /* @__PURE__ */ React11.createElement(Stack5, { minWidth: "320px", "data-testid": "multiselect-container", bgcolor: "white", boxShadow: 3, borderRadius: 1 }, /* @__PURE__ */ React11.createElement(Stack5, { py: 1, px: 2 }, topPanel != null ? topPanel : /* @__PURE__ */ React11.createElement(FormControl3, { fullWidth: true, size: "small" }, /* @__PURE__ */ React11.createElement(
1689
+ TextField4,
1690
+ {
1691
+ "data-testid": "multiselect-input",
1692
+ fullWidth: true,
1693
+ size: "small",
1694
+ variant: "outlined",
1695
+ placeholder: "Buscar",
1696
+ value: filterValue,
1697
+ onChange: handleFilterChange,
1698
+ slotProps: {
1699
+ input: {
1700
+ endAdornment: /* @__PURE__ */ React11.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React11.createElement(SearchOutlined, { fontSize: "small" }))
1701
+ }
1702
+ }
1703
+ }
1704
+ ))), /* @__PURE__ */ React11.createElement(Stack5, { maxHeight: "300px", overflow: "auto" }, selectAll && /* @__PURE__ */ React11.createElement(MenuItem3, { dense, onClick: handleSelectAll }, /* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(Checkbox2, { checked: allSelected, color: "primary" })), "Todos los items"), sortedItems.length > 0 ? sortedItems.map((item) => /* @__PURE__ */ React11.createElement(
1705
+ MenuItem3,
1706
+ {
1707
+ key: getItemLabel(item),
1708
+ dense,
1709
+ onClick: () => handleCheckboxToggle(item)
1710
+ },
1711
+ /* @__PURE__ */ React11.createElement(ListItemIcon3, null, /* @__PURE__ */ React11.createElement(
1712
+ Checkbox2,
1713
+ {
1714
+ checked: selectedItems.includes(item),
1715
+ color: "primary"
1716
+ }
1717
+ )),
1718
+ getItemLabel(item)
1719
+ )) : /* @__PURE__ */ React11.createElement(MenuItem3, { disabled: true }, "No se encontraron resultados")), /* @__PURE__ */ React11.createElement(Stack5, { direction: "row", gap: 1, p: 1, justifyContent: "space-between", bgcolor: "grey.50" }, resolvedActions.map((button2, index) => {
1720
+ var _a2;
1721
+ return /* @__PURE__ */ React11.createElement(
1722
+ Button6,
1723
+ {
1724
+ key: index,
1725
+ variant: index === 0 || resolvedActions.length < 2 ? "text" : "contained",
1726
+ onClick: button2.fn,
1727
+ disabled: (_a2 = button2.disabled) != null ? _a2 : false,
1728
+ size: "small"
1729
+ },
1730
+ capitalize(button2.text)
1731
+ );
1732
+ })))
1733
+ ));
1734
+ }
1735
+
1736
+ // src/Components/PageHeader/PageHeader.tsx
1737
+ import React12 from "react";
1738
+ import { Stack as Stack6, Typography as Typography10 } from "@mui/material";
1739
+ var PageHeader = ({
1740
+ title,
1741
+ subtitle,
1742
+ actions,
1743
+ buttonBack,
1744
+ fixed,
1745
+ shadow = true
1746
+ }) => {
1747
+ return /* @__PURE__ */ React12.createElement(
1748
+ Stack6,
1749
+ {
1750
+ "data-testid": "main-container",
1751
+ justifyContent: "center",
1752
+ height: 48,
1753
+ position: fixed ? "fixed" : "relative",
1754
+ width: fixed ? "100%" : "inherit",
1755
+ bgcolor: "background.paper",
1756
+ zIndex: 10,
1757
+ sx: { boxShadow: shadow ? (theme) => theme.shadows[1] : "none" }
1758
+ },
1759
+ /* @__PURE__ */ React12.createElement(Stack6, { "data-testid": "page-header-content", height: 40, px: 3, pl: buttonBack ? 1 : 3, direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React12.createElement(Stack6, { id: "left-section", direction: "row", alignItems: "center", gap: 1 }, buttonBack, /* @__PURE__ */ React12.createElement(Stack6, { id: "text-section", gap: 0.5 }, /* @__PURE__ */ React12.createElement(Typography10, { "data-testid": "page-header-title", variant: "h6", color: "text.primary" }, title), subtitle && /* @__PURE__ */ React12.createElement(Typography10, { "data-testid": "page-header-subtitle", variant: "caption", color: "text.primary" }, subtitle))), actions && /* @__PURE__ */ React12.createElement(Stack6, { id: "right-actions", direction: "row", alignItems: "center", gap: 1 }, actions))
1760
+ );
1761
+ };
1762
+
1763
+ // src/Components/SCCalendarSwipeable.tsx
1764
+ import React13, { useState as useState7 } from "react";
1765
+ import { Typography as Typography11, IconButton as IconButton7, Box as Box10 } from "@mui/material";
1766
+ import Grid5 from "@mui/material/Grid2";
1767
+ import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
1768
+ import { LocalizationProvider as LocalizationProvider2 } from "@mui/x-date-pickers/LocalizationProvider";
1769
+ import { StaticDatePicker } from "@mui/x-date-pickers/StaticDatePicker";
1770
+ import { es } from "date-fns/locale";
1771
+ import { format, startOfWeek, addDays, isSameDay } from "date-fns";
1772
+ import KeyboardDoubleArrowDownIcon from "@mui/icons-material/KeyboardDoubleArrowDown";
1773
+ import KeyboardDoubleArrowUpIcon from "@mui/icons-material/KeyboardDoubleArrowUp";
1774
+ var SCCalendarSwipeable = ({
1775
+ //informativas
1776
+ //apariencia
1777
+ background,
1778
+ //funcionales
1779
+ setState,
1780
+ state
1781
+ }) => {
1782
+ let convertFecha;
1783
+ const [fecha, setFecha] = useState7(/* @__PURE__ */ new Date());
1784
+ const [fechaSeleccionada, setFechaSeleccionada] = useState7();
1785
+ const [stateVal, setstateVal] = React13.useState(/* @__PURE__ */ new Date());
1786
+ const [openCalendar, setOpenCalendar] = React13.useState(false);
1787
+ const hoy = /* @__PURE__ */ new Date();
1788
+ const inicioSemana = startOfWeek(fecha, { weekStartsOn: 0 });
1789
+ const diasSemana = Array.from({ length: 7 }, (_, i) => addDays(inicioSemana, i));
1790
+ React13.useEffect(() => {
1791
+ if (fecha != null) {
1792
+ handleConvertFecha(fecha);
1793
+ }
1794
+ }, [fecha]);
1795
+ const handleConvertFecha = (fecha2) => {
1796
+ if (fecha2) {
1797
+ let day = (fecha2.getDate() < 10 ? "0" : "") + fecha2.getDate();
1798
+ let month = (fecha2.getMonth() + 1 < 10 ? "0" : "") + (fecha2.getMonth() + 1);
1799
+ let year = fecha2.getFullYear();
1800
+ convertFecha = day + "/" + month + "/" + year;
1801
+ setState(convertFecha);
1802
+ setFecha(fecha2);
1803
+ }
1804
+ };
1805
+ const toggleCalendar = (newOpen) => () => {
1806
+ setOpenCalendar(newOpen);
1807
+ };
1808
+ const locale = __spreadValues({}, es);
1809
+ return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(LocalizationProvider2, { dateAdapter: AdapterDateFns, adapterLocale: locale }, openCalendar == false ? /* @__PURE__ */ React13.createElement(Box10, { "data-testid": "calendar-mobile", sx: { width: "100%", background: background ? background : "white", display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", maxWidth: "320px", background: "transparent" } }, /* @__PURE__ */ React13.createElement(Grid5, { container: true, gap: 0.5, sx: {
1810
+ justifyContent: "space-between",
1811
+ padding: "12px 0px",
1812
+ background: "transparent"
1813
+ } }, diasSemana.map((dia) => /* @__PURE__ */ React13.createElement(Grid5, { sx: { width: "36px" }, key: dia.toString() }, /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "36px", height: "40px", display: "flex", alignItems: "center", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: "#10184099" } }, format(dia, "EEEE", { locale: es }).charAt(0).toUpperCase())), /* @__PURE__ */ React13.createElement(
1814
+ Box10,
1815
+ {
1816
+ onClick: () => setFecha(dia),
1817
+ sx: {
1818
+ padding: "10px",
1819
+ textAlign: "center",
1820
+ backgroundColor: isSameDay(dia, fecha) ? "#2063a0" : "transparent",
1821
+ cursor: "pointer",
1822
+ borderRadius: "50%",
1823
+ //border: '1px solid lightgray',
1824
+ position: "relative"
1825
+ //width: '36px',
1826
+ //height: '36px',
1827
+ }
1828
+ },
1829
+ /* @__PURE__ */ React13.createElement(Typography11, { sx: { fontSize: "12px !important", color: isSameDay(dia, fecha) ? "white" : "#101840DE" } }, format(dia, "d"))
1830
+ )))), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "open-calendar-button", onClick: toggleCalendar(true) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowDownIcon, null))))) : /* @__PURE__ */ React13.createElement(Box10, { sx: { width: "100%", background: "white" } }, /* @__PURE__ */ React13.createElement(
1831
+ StaticDatePicker,
1832
+ {
1833
+ orientation: "landscape",
1834
+ openTo: "day",
1835
+ value: fecha,
1836
+ slotProps: { toolbar: { hidden: true }, actionBar: { actions: [] } },
1837
+ 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" } },
1838
+ onChange: (newValue) => setFecha(newValue)
1839
+ }
1840
+ ), /* @__PURE__ */ React13.createElement(Grid5, { container: true, justifyContent: "center" }, /* @__PURE__ */ React13.createElement(IconButton7, { "data-testid": "close-calendar-button", onClick: toggleCalendar(false) }, /* @__PURE__ */ React13.createElement(KeyboardDoubleArrowUpIcon, null))))));
1841
+ };
1842
+
1843
+ // src/Components/SCDataGrid.tsx
1844
+ import React14, { useEffect as useEffect10, useState as useState8 } from "react";
1845
+ import { DataGridPro, useGridApiRef } from "@mui/x-data-grid-pro";
1846
+ import { LicenseInfo as LicenseInfo2 } from "@mui/x-license-pro";
1847
+ import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
1848
+ import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
1849
+ import { useTheme } from "@mui/material/styles";
1850
+ var SCDataGridInitial = ({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }) => {
1851
+ LicenseInfo2.setLicenseKey(
1852
+ "77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
1853
+ );
1854
+ const theme = useTheme();
1855
+ const apiRef = useGridApiRef();
1856
+ const isRowSelectable = (params) => params.row.bloqueoChecked == false ? false : true;
1857
+ function generateRandomId() {
1858
+ return Math.floor(Math.random() * 1e6);
1859
+ }
1860
+ const getTreeDataPaths = (row) => {
1861
+ return [
1862
+ row[groupColumns[0].split("[")[1].split("]")[0].trim()],
1863
+ ...groupColumns.length > 2 ? [row[groupColumns[1].split("[")[1].split("]")[0].trim()]] : [],
1864
+ `${row[groupColumns[groupColumns.length - 1].split("[")[1].split("]")[0].trim()].toString()}/${generateRandomId()}`
1865
+ ];
1866
+ };
1867
+ const groupingColDefs = {
1868
+ field: "grouping",
1869
+ headerName: groupColumns != void 0 ? groupColumns[groupColumns.length - 1].split("[").length == 2 ? groupColumns[groupColumns.length - 1].split("[")[0].trim() : "Agrupador" : "",
1870
+ renderCell: (params) => {
1871
+ var _a;
1872
+ let label = params.value.toString().includes("/") ? params.value.split("/")[0].toString() : params.value.toString();
1873
+ const maxDepth = groupColumns ? groupColumns.length - 2 : 0;
1874
+ if (groupColumns != void 0) {
1875
+ if (params.rowNode.depth === 0) {
1876
+ const textBegin = groupColumns[0] ? groupColumns[0].split("[")[0].trim() : "";
1877
+ const textEnd = groupColumns[0] ? groupColumns[0].split("]")[1].trim() : "";
1878
+ const labelGrouping1 = `${textBegin} ${label} ${textEnd}`;
1879
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1880
+ const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
1881
+ const subgroup1 = arrayRows.filter((r) => r[fieldGrouping1].toString() === label).map((r) => r[fieldGrouping2]);
1882
+ const groupedDataLength1 = subgroup1.filter((valor, indiceActual, arreglo) => arreglo.indexOf(valor) === indiceActual);
1883
+ label = `${labelGrouping1} (${groupedDataLength1.length})`;
1884
+ } else if (groupColumns.length > 2 && params.rowNode.depth === 1) {
1885
+ const labelGrouping1 = (_a = params.api.getRowNode(params.rowNode.parent)) == null ? void 0 : _a.groupingKey;
1886
+ const textBegin = groupColumns[1] ? groupColumns[1].split("[")[0] : "";
1887
+ const textEnd = groupColumns[1] ? groupColumns[1].split("]")[1].trim() : "";
1888
+ const labelGrouping2 = `${textBegin} ${label} ${textEnd}`;
1889
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1890
+ const fieldGrouping2 = groupColumns[1].split("[")[1].split("]")[0].trim();
1891
+ const groupedDataLength2 = arrayRows.filter(
1892
+ (r) => r[fieldGrouping1] === labelGrouping1 && r[fieldGrouping2] === label
1893
+ ).length;
1894
+ label = `${labelGrouping2} (${groupedDataLength2})`;
1895
+ } else {
1896
+ label = label;
1897
+ }
1898
+ }
1899
+ return /* @__PURE__ */ React14.createElement(
1900
+ "div",
1901
+ {
1902
+ style: {
1903
+ width: "100%",
1904
+ boxSizing: "border-box",
1905
+ overflow: "hidden",
1906
+ textOverflow: "ellipsis",
1907
+ whiteSpace: "nowrap",
1908
+ color: "#101840DE",
1909
+ display: "flex",
1910
+ alignItems: "center",
1911
+ paddingLeft: params.rowNode.depth == 0 ? "5px" : params.rowNode.depth == 1 ? "15px" : "25px",
1912
+ backgroundColor: params.rowNode.type === "group" ? theme.palette.grey[100 + (maxDepth - params.rowNode.depth) * 100] : "#FFFFFF",
1913
+ fontWeight: params.rowNode.type == "group" ? "400" : "300"
1914
+ }
1915
+ },
1916
+ params.rowNode.type === "group" && /* @__PURE__ */ React14.createElement(
1917
+ "span",
1918
+ {
1919
+ style: {
1920
+ cursor: "pointer",
1921
+ marginRight: 8,
1922
+ userSelect: "none"
1923
+ },
1924
+ onClick: (e) => {
1925
+ e.stopPropagation();
1926
+ params.api.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
1927
+ }
1928
+ },
1929
+ params.rowNode.childrenExpanded ? /* @__PURE__ */ React14.createElement(KeyboardArrowUpIcon, { fontSize: "small", color: "action" }) : /* @__PURE__ */ React14.createElement(KeyboardArrowDownIcon, { fontSize: "small", color: "action" })
1930
+ ),
1931
+ label
1932
+ );
1933
+ },
1934
+ colSpan: (params) => {
1935
+ const value = String(params);
1936
+ const fieldGrouping1 = groupColumns[0].split("[")[1].split("]")[0].trim();
1937
+ const fieldGrouping2 = groupColumns.length > 2 ? groupColumns[1].split("[")[1].split("]")[0].trim() : void 0;
1938
+ let agrupado1 = false;
1939
+ let agrupado2 = false;
1940
+ if (fieldGrouping1 != void 0) {
1941
+ agrupado1 = arrayRows.some(
1942
+ (row) => String(row[fieldGrouping1]) === value
1943
+ );
1944
+ }
1945
+ if (fieldGrouping2 != void 0) {
1946
+ agrupado2 = arrayRows.some(
1947
+ (row) => String(row[fieldGrouping2]) === value
1948
+ );
1949
+ }
1950
+ if (agrupado1 || agrupado2) {
1951
+ return columns.length + 1;
1952
+ } else {
1953
+ return 1;
1954
+ }
1955
+ }
1956
+ };
1957
+ let validationTreeData = groupColumns ? true : false;
1958
+ let validationCheckboxSelection = checkboxSelection || false;
1959
+ let styleDensity = density || "compact";
1960
+ let styleTopContainerHeight = styleDensity === "compact" ? "26px" : styleDensity === "standard" ? "38px" : styleDensity === "comfortable" ? "60px" : "27px";
1961
+ let styleRowHeight = density == "compact" ? 32 : density == "standard" ? 28 : density == "comfortable" ? 36 : 32;
1962
+ let rows = rowsTable ? rowsTable : validationTreeData != false ? parseInt(data.length.toString()) : data.length < 10 ? parseInt(data.length.toString()) : 10;
1963
+ let validationGroupingColDef = groupingColDefs || {};
1964
+ const [groupDataLenght, setGroupDataLengh] = useState8(0);
1965
+ const [pageSize, setPageSize] = useState8(rows);
1966
+ const [arrayRows, setArrayRows] = useState8([]);
1967
+ const [selectionModel, setSelectionModel] = useState8([]);
1968
+ useEffect10(() => {
1969
+ if ((data == null ? void 0 : data.length) > 0) {
1970
+ dataConvertRows(data, void 0);
1971
+ }
1972
+ }, [data]);
1973
+ const dataConvertRows = (data2, columnId) => {
1974
+ let dataConvert = [];
1975
+ if ((data2 == null ? void 0 : data2.length) > 0) {
1976
+ const dataKeys = Object.keys(data2[0]);
1977
+ data2.map((item) => {
1978
+ const newKeys = {};
1979
+ let i = 0;
1980
+ let id = dataConvert.length + 1;
1981
+ for (i = 0; i < dataKeys.length; i++) {
1982
+ newKeys[dataKeys[i]] = item[dataKeys[i]];
1983
+ }
1984
+ newKeys.id = columnId ? item[columnId] : id;
1985
+ dataConvert = [...dataConvert, newKeys];
1986
+ });
1987
+ }
1988
+ setArrayRows(dataConvert);
1989
+ };
1990
+ const handleSelectionChange = (newSelection) => {
1991
+ if (groupDataLenght > 0 && validationTreeData == true) {
1992
+ let numberGrouped = 0;
1993
+ let idsRowSelectBefore = [];
1994
+ let idRowSelect = [];
1995
+ for (let i = 0; i < newSelection.length; i++) {
1996
+ if (typeof newSelection[i] === "string") {
1997
+ if (newSelection[i].includes("auto-generated-row-null")) {
1998
+ numberGrouped = i;
1999
+ }
2000
+ } else {
2001
+ idsRowSelectBefore.push(newSelection[i]);
2002
+ }
2003
+ }
2004
+ arrayRows.forEach((array) => {
2005
+ if (typeof newSelection[numberGrouped] === "string") {
2006
+ if (newSelection[numberGrouped].includes(array.name)) {
2007
+ idRowSelect.push(array.id);
2008
+ }
2009
+ }
2010
+ });
2011
+ if (idRowSelect !== null) {
2012
+ const soloEnArr1 = idsRowSelectBefore.filter((elemento) => !idRowSelect.includes(elemento));
2013
+ const hasCommonElements = idsRowSelectBefore.some((element) => idRowSelect.includes(element));
2014
+ if (hasCommonElements == true) {
2015
+ setSelectionModel([...soloEnArr1]);
2016
+ } else {
2017
+ setSelectionModel([...idsRowSelectBefore, ...idRowSelect]);
2018
+ }
2019
+ }
2020
+ } else {
2021
+ setSelectionModel([...newSelection]);
2022
+ }
2023
+ };
2024
+ return /* @__PURE__ */ React14.createElement(React14.Fragment, null, data && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { style: { width: width || "100%", maxHeight: maxHeight ? `${maxHeight}px` : "none" } }, /* @__PURE__ */ React14.createElement(
2025
+ DataGridPro,
2026
+ {
2027
+ apiRef,
2028
+ rowHeight: styleRowHeight,
2029
+ rows: arrayRows,
2030
+ columns,
2031
+ density: styleDensity,
2032
+ treeData: validationTreeData,
2033
+ getTreeDataPath: validationTreeData == true ? getTreeDataPaths : void 0,
2034
+ groupingColDef: validationTreeData == true ? validationGroupingColDef : void 0,
2035
+ pagination: true,
2036
+ initialState: {
2037
+ pagination: { paginationModel: { pageSize: rows } }
2038
+ },
2039
+ checkboxSelection: validationCheckboxSelection,
2040
+ rowSelectionModel: selectionModel,
2041
+ onRowSelectionModelChange: (newSelection) => handleSelectionChange(newSelection),
2042
+ isRowSelectable,
2043
+ disableRowSelectionOnClick: true,
2044
+ hideFooter: validationTreeData == true ? true : false,
2045
+ localeText: {
2046
+ noRowsLabel: "No hay filas",
2047
+ columnMenuLabel: "Men\xFA de columna",
2048
+ footerTotalRows: "Filas Totales:",
2049
+ footerRowSelected: (count) => `${count.toLocaleString()} fila(s) seleccionada(s)`,
2050
+ // Ejemplo de traducción dinámica
2051
+ MuiTablePagination: {
2052
+ labelRowsPerPage: "Filas por p\xE1gina:",
2053
+ labelDisplayedRows: ({ from, to, count }) => `${from}\u2013${to} de ${count !== -1 ? count : `m\xE1s de ${to}`}`
2054
+ }
2055
+ },
2056
+ sx: {
2057
+ maxHeight: maxHeight ? `${maxHeight}px` : "none",
2058
+ //overflow: 'auto',
2059
+ "& .MuiDataGrid-filler": {
2060
+ display: "none !important"
2061
+ },
2062
+ "& .MuiDataGrid-footerContainer": {
2063
+ minHeight: "26px !important",
2064
+ height: "26px !important"
2065
+ },
2066
+ "& .MuiTablePagination-toolbar": {
2067
+ minHeight: "25px !important",
2068
+ height: "25px !important"
2069
+ },
2070
+ "& .MuiTablePagination-actions .MuiIconButton-root": {
2071
+ padding: "0px !important"
2072
+ },
2073
+ "&.MuiDataGrid-root": {
2074
+ [`--DataGrid-topContainerHeight`]: `${styleTopContainerHeight} !important`
2075
+ },
2076
+ "MuiDataGrid-root .MuiDataGrid-virtualScrollerContent .MuiDataGrid-row": {
2077
+ "--height": "0px !important",
2078
+ "minHeight": "0px !important",
2079
+ "maxHeight": "0px !important"
2080
+ },
2081
+ "& .MuiDataGrid-cell": {
2082
+ padding: "0 !important",
2083
+ background: "white"
2084
+ }
2085
+ }
2086
+ }
2087
+ ))));
2088
+ };
2089
+ var SCDataGrid = React14.memo(SCDataGridInitial, (prevProps, nextProps) => {
2090
+ const isEqual = prevProps.data === nextProps.data && prevProps.columns === nextProps.columns && prevProps.groupColumns === nextProps.groupColumns && prevProps.rowsTable === nextProps.rowsTable && prevProps.checkboxSelection === nextProps.checkboxSelection && prevProps.width === nextProps.width && prevProps.maxHeight === nextProps.maxHeight && prevProps.density === nextProps.density;
2091
+ return isEqual;
2092
+ });
2093
+
2094
+ // src/Components/EmptyState/EmptyState.tsx
2095
+ import React15 from "react";
2096
+ import { Button as Button8, Stack as Stack7, Typography as Typography12 } from "@mui/material";
2097
+
2098
+ // src/assets/ImgEmptyState/create.svg
2099
+ var create_default = "./create-KZGO2OZA.svg";
2100
+
2101
+ // src/assets/ImgEmptyState/error.svg
2102
+ var error_default = "./error-RUCZUXDN.svg";
2103
+
2104
+ // src/assets/ImgEmptyState/empty.svg
2105
+ var empty_default = "./empty-3NEKE7WO.svg";
2106
+
2107
+ // src/assets/ImgEmptyState/search.svg
2108
+ var search_default = "./search-OKSCVF2W.svg";
2109
+
2110
+ // src/Components/EmptyState/EmptyState.tsx
2111
+ var EmptyStateImageUrls = {
2112
+ create: create_default,
2113
+ error: error_default,
2114
+ noResult: empty_default,
2115
+ search: search_default
2116
+ };
2117
+ var DefaultIcon = ({
2118
+ state = "create",
2119
+ size = "large"
2120
+ }) => {
2121
+ const imageUrl = EmptyStateImageUrls[state];
2122
+ const iconSize = size === "small" ? { width: "40px", height: "40px" } : { width: "60px", height: "60px" };
2123
+ return /* @__PURE__ */ React15.createElement("img", { src: imageUrl, alt: state, style: iconSize });
2124
+ };
2125
+ var EmptyState = ({
2126
+ state = "create",
2127
+ size = "large",
2128
+ title,
2129
+ subtitle,
2130
+ actions,
2131
+ containerHeight = "100vh",
2132
+ icon = /* @__PURE__ */ React15.createElement(DefaultIcon, { state, size })
2133
+ }) => {
2134
+ const titleVariant = size === "small" ? "subtitle2" : "h6";
2135
+ const subtitleVariant = size === "small" ? "caption" : "body1";
2136
+ return /* @__PURE__ */ React15.createElement(
2137
+ Stack7,
2138
+ {
2139
+ alignItems: "center",
2140
+ justifyContent: "center",
2141
+ spacing: 2,
2142
+ height: containerHeight,
2143
+ "data-testid": "empty-state-container"
2144
+ },
2145
+ icon && /* @__PURE__ */ React15.createElement(Stack7, null, icon),
2146
+ /* @__PURE__ */ React15.createElement(Stack7, { gap: 0.5 }, /* @__PURE__ */ React15.createElement(Typography12, { color: "text.primary", variant: titleVariant, textAlign: "center" }, title), subtitle && /* @__PURE__ */ React15.createElement(
2147
+ Typography12,
2148
+ {
2149
+ variant: subtitleVariant,
2150
+ textAlign: "center",
2151
+ color: "text.secondary"
2152
+ },
2153
+ subtitle
2154
+ ), actions && (actions == null ? void 0 : actions.length) > 0 && /* @__PURE__ */ React15.createElement(
2155
+ Stack7,
2156
+ {
2157
+ direction: "row",
2158
+ spacing: 2,
2159
+ alignItems: "center",
2160
+ justifyContent: "center"
2161
+ },
2162
+ actions.map((action, index) => {
2163
+ var _a, _b, _c, _d;
2164
+ return /* @__PURE__ */ React15.createElement(
2165
+ Button8,
2166
+ {
2167
+ key: index,
2168
+ color: (_a = action.color) != null ? _a : "primary",
2169
+ variant: (_b = action.variant) != null ? _b : "text",
2170
+ size: (_c = action.size) != null ? _c : "small",
2171
+ startIcon: action.icon && action.iconPosition === "left" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
2172
+ endIcon: action.icon && action.iconPosition === "right" ? /* @__PURE__ */ React15.createElement("img", { src: action.icon, alt: "icon" }) : void 0,
2173
+ onClick: action.onClick
2174
+ },
2175
+ capitalize((_d = action.text) != null ? _d : "action")
2176
+ );
2177
+ })
2178
+ ))
2179
+ );
2180
+ };
2181
+
2182
+ // src/Components/SCDialog.tsx
2183
+ import React16, { useEffect as useEffect11, useState as useState9 } from "react";
2184
+ import { Button as Button9, Typography as Typography13, Modal as Modal2, Dialog, DialogActions, DialogContent, DialogTitle, IconButton as IconButton8, Tooltip as Tooltip3, Box as Box11, SvgIcon as SvgIcon5 } from "@mui/material";
2185
+ import Grid6 from "@mui/material/Grid2";
2186
+ import CloseIcon2 from "@mui/icons-material/Close";
2187
+ import * as Muicon5 from "@mui/icons-material";
2188
+ var SCDialog = ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }) => {
2189
+ let i = 0;
2190
+ let iconTitleValidation = "";
2191
+ let IconTitle;
2192
+ let ButtonIcon;
2193
+ const [open, setOpen] = useState9(show);
2194
+ useEffect11(() => {
2195
+ if (show) {
2196
+ handleOpen();
2197
+ } else {
2198
+ handleClose();
2199
+ }
2200
+ }, [show]);
2201
+ if ((buttonDialog == null ? void 0 : buttonDialog.icon) != void 0) {
2202
+ if (Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon] == void 0) {
2203
+ ButtonIcon = buttonDialog == null ? void 0 : buttonDialog.icon;
2204
+ } else {
2205
+ ButtonIcon = Muicon5[buttonDialog == null ? void 0 : buttonDialog.icon];
2206
+ }
2207
+ }
2208
+ actions == null ? void 0 : actions.map(function(option, index, array) {
2209
+ if (option == null ? void 0 : option.icon) {
2210
+ if ((option == null ? void 0 : option.icon.type) == void 0) {
2211
+ option.icon = Muicon5[option == null ? void 0 : option.icon];
2212
+ } else {
2213
+ option;
2214
+ }
2215
+ }
2216
+ });
2217
+ if (iconTitle) {
2218
+ if (Muicon5[iconTitle] == void 0) {
2219
+ if (iconTitle && React16.isValidElement(iconTitle) && iconTitle.type == void 0) {
2220
+ iconTitleValidation = "image";
2221
+ IconTitle = iconTitle;
2222
+ } else {
2223
+ iconTitleValidation = "icon";
2224
+ IconTitle = iconTitle;
2225
+ }
2226
+ } else {
2227
+ iconTitleValidation = "icon";
2228
+ IconTitle = Muicon5[iconTitle];
2229
+ }
2230
+ }
2231
+ const handleOpen = () => {
2232
+ setOpen(true);
2233
+ if (setShow) {
2234
+ setShow(true);
2235
+ }
2236
+ };
2237
+ const handleClose = () => {
2238
+ setOpen(false);
2239
+ if (setShow) {
2240
+ setShow(false);
2241
+ }
2242
+ };
2243
+ const dialogActions = actions != null ? actions : [{ text: "Cerrar", fn: handleClose }];
2244
+ content = content != null ? content : { component: /* @__PURE__ */ React16.createElement(Box11, null, " Aqui va el contenido ") };
2245
+ return /* @__PURE__ */ React16.createElement("div", null, buttonDialog ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, buttonDialog.text != void 0 ? /* @__PURE__ */ React16.createElement(Tooltip3, { placement: "bottom-start", title: buttonDialog.tooltip != void 0 ? buttonDialog.tooltip : "", slotProps: { popper: { modifiers: [{ name: "offset", options: { offset: [0, -14] } }] } } }, /* @__PURE__ */ React16.createElement(Button9, { size: "small", color: buttonDialog.color != void 0 ? buttonDialog.color : "primary", variant: (buttonDialog == null ? void 0 : buttonDialog.variant) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.variant : "text", startIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "left" ? /* @__PURE__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", endIcon: (buttonDialog == null ? void 0 : buttonDialog.iconPosition) != void 0 ? (buttonDialog == null ? void 0 : buttonDialog.iconPosition) == "right" ? /* @__PURE__ */ React16.createElement(ButtonIcon, { color: buttonDialog.color != void 0 ? buttonDialog.color : "primary" }) : "" : "", onClick: handleOpen }, " ", (buttonDialog == null ? void 0 : buttonDialog.text) != void 0 ? buttonDialog.text : "", " ")) : /* @__PURE__ */ React16.createElement(IconButton8, { style: { cursor: "pointer" }, onClick: handleOpen }, /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", color: (buttonDialog == null ? void 0 : buttonDialog.color) != void 0 ? buttonDialog == null ? void 0 : buttonDialog.color : "action", component: ButtonIcon }))) : "", /* @__PURE__ */ React16.createElement(Modal2, { open: open || false, onClose: handleClose }, /* @__PURE__ */ React16.createElement(
2246
+ Dialog,
2247
+ {
2248
+ "data-testid": "dialog-element",
2249
+ open: open || false,
2250
+ onClose: disableClose ? void 0 : handleClose,
2251
+ maxWidth: "xl",
2252
+ sx: {
2253
+ width: "100% !important",
2254
+ "& .MuiBackdrop-root": {
2255
+ backdropFilter: "blur(0px) !important"
2256
+ }
2257
+ }
2258
+ },
2259
+ title && /* @__PURE__ */ React16.createElement(DialogTitle, { sx: { m: 0, padding: "8px 16px 8px 16px" }, "data-testid": "dialog-icon-title" }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 12, sx: { justifyContent: "space-between", flexWrap: "nowrap" } }, /* @__PURE__ */ React16.createElement(Grid6, { container: true, size: 11, sx: { alignItems: "center" } }, iconTitle ? iconTitleValidation == "image" ? /* @__PURE__ */ React16.createElement(Box11, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ React16.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ React16.createElement(SvgIcon5, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : "", /* @__PURE__ */ React16.createElement(Grid6, null, /* @__PURE__ */ React16.createElement(Typography13, { color: "text.primary", variant: "h6", gutterBottom: true }, title ? title : ""), /* @__PURE__ */ React16.createElement(Typography13, { color: "text.secondary", variant: "body2", gutterBottom: true }, subtitle ? subtitle : ""))), disableClose != true ? /* @__PURE__ */ React16.createElement(IconButton8, { "data-testid": "close-dialog-button", onClick: handleClose, size: "small", color: "default", sx: { height: 22, width: 22 } }, /* @__PURE__ */ React16.createElement(CloseIcon2, null)) : "")),
2260
+ /* @__PURE__ */ React16.createElement(
2261
+ DialogContent,
2262
+ {
2263
+ "data-testid": "dialog-content",
2264
+ dividers: dividers ? dividers : false,
2265
+ sx: {
2266
+ m: 0,
2267
+ padding: "12px 16px 8px 16px",
2268
+ background: background ? background : "white",
2269
+ height: !heightContent ? { xs: "60vh", sm: "70vh", md: "508px" } : heightContent,
2270
+ width: () => {
2271
+ switch (widthContent) {
2272
+ case "extra-small":
2273
+ return { xs: "48vw", md: "33vw" };
2274
+ case "small":
2275
+ return { xs: "54vw", md: "39vw" };
2276
+ case "medium":
2277
+ return { xs: "64vw", md: "56vw" };
2278
+ case "large":
2279
+ return { xs: "74vw", md: "78vw" };
2280
+ case "extra-large":
2281
+ return { xs: "84vw", md: "93vw" };
2282
+ default:
2283
+ return { xs: "64vw", md: "56vw" };
2284
+ }
2285
+ }
2286
+ }
2287
+ },
2288
+ content.url ? /* @__PURE__ */ React16.createElement(
2289
+ "iframe",
2290
+ {
2291
+ style: { border: "none", minWidth: "100%", minHeight: "100%" },
2292
+ id: "inlineFrameExample",
2293
+ title: "Inline Frame Example",
2294
+ src: content.url
2295
+ }
2296
+ ) : content.component
2297
+ ),
2298
+ dialogActions.length > 0 ? /* @__PURE__ */ React16.createElement(DialogActions, { sx: { gap: 1, m: 0, padding: "12px 16px 12px 16px", justifyContent: dialogActions.length >= 3 ? "space-between" : "flex-end" } }, dialogActions.length >= 3 ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
2299
+ Button9,
2300
+ {
2301
+ variant: "text",
2302
+ color: dialogActions[0].color || "primary",
2303
+ size: "small",
2304
+ onClick: dialogActions[0].fn,
2305
+ disabled: dialogActions[0].disabled || false,
2306
+ startIcon: dialogActions[0].icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: dialogActions[0].icon }) : void 0
2307
+ },
2308
+ dialogActions[0].text
2309
+ ), /* @__PURE__ */ React16.createElement(Box11, { sx: { display: "flex", gap: 1 } }, dialogActions.slice(1).map((boton, index) => {
2310
+ return /* @__PURE__ */ React16.createElement(
2311
+ Button9,
2312
+ {
2313
+ key: index + 1,
2314
+ variant: index === dialogActions.length - 2 ? "contained" : "text",
2315
+ color: boton.color || "primary",
2316
+ size: "small",
2317
+ onClick: boton.fn,
2318
+ disabled: boton.disabled || false,
2319
+ startIcon: boton.icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
2320
+ },
2321
+ boton.text
2322
+ );
2323
+ }))) : dialogActions.map((boton, index) => {
2324
+ return /* @__PURE__ */ React16.createElement(
2325
+ Button9,
2326
+ {
2327
+ key: index,
2328
+ variant: index === dialogActions.length - 1 ? "contained" : "text",
2329
+ color: boton.color || "primary",
2330
+ size: "small",
2331
+ onClick: boton.fn,
2332
+ disabled: boton.disabled || false,
2333
+ startIcon: boton.icon ? /* @__PURE__ */ React16.createElement(SvgIcon5, { fontSize: "small", component: boton.icon }) : void 0
2334
+ },
2335
+ boton.text
2336
+ );
2337
+ })) : ""
2338
+ )));
2339
+ };
2340
+
2341
+ // src/Components/SCMenu.tsx
2342
+ import React17 from "react";
2343
+ import { Box as Box12, Typography as Typography14, Paper, Divider as Divider4, MenuList, MenuItem as MenuItem4, ListItemIcon as ListItemIcon4, SvgIcon as SvgIcon6 } from "@mui/material";
2344
+ import Grid7 from "@mui/material/Grid2";
2345
+
2346
+ // src/Components/Hooks/useWindowDimensions.ts
2347
+ import { useState as useState10, useEffect as useEffect12 } from "react";
2348
+ function getWindowDimensions() {
2349
+ const { innerWidth: width, innerHeight: height } = window;
2350
+ return {
2351
+ width,
2352
+ height
2353
+ };
2354
+ }
2355
+ function useWindowDimensions() {
2356
+ const [windowDimensions, setWindowDimensions] = useState10(getWindowDimensions());
2357
+ useEffect12(() => {
2358
+ function handleResize() {
2359
+ setWindowDimensions(getWindowDimensions());
2360
+ }
2361
+ window.addEventListener("resize", handleResize);
2362
+ return () => window.removeEventListener("resize", handleResize);
2363
+ }, []);
2364
+ return windowDimensions;
2365
+ }
2366
+
2367
+ // src/Components/SCMenu.tsx
2368
+ import * as Muicon6 from "@mui/icons-material";
2369
+ var SCMenu = ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }) => {
2370
+ const { height, width } = useWindowDimensions();
2371
+ const menuSize = widthMenu ? parseInt(widthMenu) : 284;
2372
+ const pageSize = widthPage ? parseInt(widthPage) : width - menuSize;
2373
+ const widthContainer = menuSize + pageSize;
2374
+ let heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
2375
+ const [selectedIndex, setSelectedIndex] = React17.useState("1");
2376
+ const [value, setValue] = React17.useState("1");
2377
+ React17.useEffect(() => {
2378
+ heightContainer = heightMenu ? parseInt(heightMenu) : height - 76;
2379
+ }, [height]);
2380
+ React17.useEffect(() => {
2381
+ if (defaultOption) {
2382
+ handleClickMenusItem(event, void 0);
2383
+ }
2384
+ }, [defaultOption]);
2385
+ options.map(function(option, index, array) {
2386
+ if (option == null ? void 0 : option.iconLeft) {
2387
+ if ((option == null ? void 0 : option.iconLeft.type) == void 0) {
2388
+ option.iconLeft = Muicon6[option == null ? void 0 : option.iconLeft];
2389
+ } else {
2390
+ option;
2391
+ }
2392
+ }
2393
+ if (option == null ? void 0 : option.iconRight) {
2394
+ if ((option == null ? void 0 : option.iconRight.type) == void 0) {
2395
+ option.iconRight = Muicon6[option == null ? void 0 : option.iconRight];
2396
+ } else {
2397
+ option;
2398
+ }
2399
+ }
2400
+ });
2401
+ const handleClickMenusItem = (event2, index) => {
2402
+ if (defaultOption && index == void 0) {
2403
+ setSelectedIndex(defaultOption);
2404
+ setValue(defaultOption);
2405
+ } else if (index != void 0) {
2406
+ setSelectedIndex(String(index + 1));
2407
+ setValue(String(index + 1));
2408
+ }
2409
+ };
2410
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(Grid7, { container: true, sx: { height: heightContainer, width: widthContainer, flexDirection: "column" } }, /* @__PURE__ */ React17.createElement(Paper, { "data-testid": "menu-content", sx: { width: menuSize, height: heightContainer, overflow: "auto" } }, header && header.component, /* @__PURE__ */ React17.createElement(MenuList, { sx: { height: options.length * 45, padding: "8px 0px" } }, options.map((option, index) => /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
2411
+ MenuItem4,
2412
+ {
2413
+ disabled: disable == true ? true : false,
2414
+ key: index,
2415
+ selected: String(index + 1) === selectedIndex,
2416
+ onClick: (event2) => handleClickMenusItem(event2, index)
2417
+ },
2418
+ option.iconLeft ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconLeft })) : "",
2419
+ /* @__PURE__ */ React17.createElement(Grid7, { container: true, size: 12, sx: { maxWidth: 220, flexWrap: "noWrap", alignItems: "center" } }, /* @__PURE__ */ React17.createElement(Typography14, { noWrap: true, variant: "caption", color: String(index + 1) === selectedIndex ? "primary" : "active" }, option.name), option.iconRight ? /* @__PURE__ */ React17.createElement(ListItemIcon4, { sx: { minWidth: "0px !important", color: String(index + 1) === selectedIndex ? "primary" : "active" } }, /* @__PURE__ */ React17.createElement(SvgIcon6, { fontSize: "small", color: String(index + 1) === selectedIndex ? "primary" : "action", component: option.iconRight })) : "")
2420
+ ), option.divider == true ? /* @__PURE__ */ React17.createElement(Divider4, null) : "")))), /* @__PURE__ */ React17.createElement(Grid7, { container: true }, options.map((option, index) => option.page ? String(index + 1) == value ? /* @__PURE__ */ React17.createElement(Box12, { "data-testid": "menu-page-content", sx: { padding: "16px", width: pageSize, height: heightContainer }, key: index }, option.page) : "" : /* @__PURE__ */ React17.createElement(Typography14, { color: "error" }, "No se ha configurado el componente a visualizar")))));
2421
+ };
2422
+
2423
+ // src/Components/SCTabs.tsx
2424
+ import React18, { useEffect as useEffect13 } from "react";
2425
+ import { Typography as Typography15, Box as Box13, SvgIcon as SvgIcon7, Tab, Tabs, Badge } from "@mui/material";
2426
+ import TabPanel from "@mui/lab/TabPanel";
2427
+ import TabContext from "@mui/lab/TabContext";
2428
+ import * as Muicon7 from "@mui/icons-material";
2429
+ var SCTabs = ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }) => {
2430
+ const [toast, setToast] = React18.useState(null);
2431
+ let i = 0;
2432
+ let j = 0;
2433
+ let k = 0;
2434
+ let l = 0;
2435
+ let validateTypeIcon = true;
2436
+ const [value, setValue] = React18.useState("1");
2437
+ useEffect13(() => {
2438
+ if (defaultOption) {
2439
+ handleChange(event, void 0);
2440
+ }
2441
+ }, [defaultOption]);
2442
+ options.map(function(option) {
2443
+ const optionsLength = options.length;
2444
+ if (option == null ? void 0 : option.iconOrBadge) {
2445
+ if (typeIcon == "icon") {
2446
+ if ((option == null ? void 0 : option.iconOrBadge) in Muicon7 == true) {
2447
+ validateTypeIcon = true;
2448
+ option.iconOrBadge = Muicon7[option == null ? void 0 : option.iconOrBadge];
2449
+ } else {
2450
+ validateTypeIcon = false;
2451
+ setTimeout(() => {
2452
+ setToast({
2453
+ type: "error",
2454
+ title: "Componente SCTabs",
2455
+ subtitle: "En Option todos los iconOrBadge deben ser iconos de MUI, por favor verificar.",
2456
+ time: 50
2457
+ });
2458
+ }, 10);
2459
+ return;
2460
+ }
2461
+ } else if (typeIcon == "badge") {
2462
+ if ((option == null ? void 0 : option.iconOrBadge) in Muicon7 == false) {
2463
+ validateTypeIcon = true;
2464
+ option;
2465
+ } else {
2466
+ validateTypeIcon = false;
2467
+ setTimeout(() => {
2468
+ setToast({
2469
+ type: "error",
2470
+ title: "Componente SCTabs",
2471
+ subtitle: "En Option todos los iconOrBadge deben ser numeros para el badge, por favor verificar.",
2472
+ time: 10
2473
+ });
2474
+ }, 10);
2475
+ return;
2476
+ }
2477
+ }
2478
+ }
2479
+ });
2480
+ const handleChange = (event2, newValue) => {
2481
+ if (defaultOption && newValue == void 0) {
2482
+ setValue(defaultOption);
2483
+ } else if (newValue != void 0) {
2484
+ setValue(newValue);
2485
+ }
2486
+ };
2487
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, validateTypeIcon == true ? /* @__PURE__ */ React18.createElement(Box13, { sx: { height: orientation == "vertical" ? "100%" : "auto", display: "flex", flexDirection: orientation == "vertical" ? "row" : "column" }, id: "tabsitos" }, /* @__PURE__ */ React18.createElement(TabContext, { value }, /* @__PURE__ */ React18.createElement(
2488
+ Tabs,
2489
+ {
2490
+ "data-testid": "tab-container",
2491
+ value,
2492
+ onChange: handleChange,
2493
+ variant: variant ? orientation == "vertical" && variant == "fullWidth" ? "standard" : variant : "standard",
2494
+ scrollButtons: scrollButtons == false ? false : true,
2495
+ visibleScrollbar: scrollButtons == false ? true : false,
2496
+ textColor: colorTab,
2497
+ indicatorColor: colorTab,
2498
+ orientation: orientation || "horizontal",
2499
+ sx: { borderBottom: orientation == "vertical" ? 0 : 1, borderRight: orientation == "vertical" ? 1 : 0, borderColor: "divider", background: background || "" }
2500
+ },
2501
+ options.map((option) => /* @__PURE__ */ React18.createElement(
2502
+ Tab,
2503
+ {
2504
+ "data-testid": "tab-item",
2505
+ value: String(i = i + 1),
2506
+ key: j = j + 1,
2507
+ label: option.name || "",
2508
+ disabled: option.disabled || false,
2509
+ iconPosition: iconPosition || "end",
2510
+ icon: typeIcon == "badge" ? /* @__PURE__ */ React18.createElement(
2511
+ Badge,
2512
+ {
2513
+ sx: {
2514
+ width: "20px",
2515
+ height: "20px",
2516
+ "& .MuiBadge-badge": {
2517
+ top: "10px",
2518
+ right: "10px"
2519
+ }
2520
+ },
2521
+ variant: "standard",
2522
+ badgeContent: option.iconOrBadge,
2523
+ color: value == String(i) ? colorTab ? colorTab : "primary" : "default"
2524
+ }
2525
+ ) : typeIcon == "icon" ? /* @__PURE__ */ React18.createElement(SvgIcon7, { fontSize: "small", component: option.iconOrBadge, color: value == String(i) ? colorTab ? colorTab : "primary" : "action", sx: { width: "20px", height: "20px" } }) : "",
2526
+ sx: { "& .MuiTab-icon": { margin: "0px !important" }, padding: "10px 16px", gap: "4px" }
2527
+ }
2528
+ ))
2529
+ ), children, options.map((option) => /* @__PURE__ */ React18.createElement(
2530
+ TabPanel,
2531
+ {
2532
+ key: k = k + 1,
2533
+ value: String(l = l + 1),
2534
+ sx: { padding: "16px" }
2535
+ },
2536
+ option.page ? option.page : /* @__PURE__ */ React18.createElement(Typography15, null, "No se ha configurado el componente a visualizar ")
2537
+ )))) : /* @__PURE__ */ React18.createElement(Box13, { sx: { height: "200px" } }, toast && /* @__PURE__ */ React18.createElement(SCToastNotification, __spreadValues({ "data-testid": "error-tab-message" }, toast))));
2538
+ };
2539
+
2540
+ // src/Theme/index.ts
2541
+ import { createTheme } from "@mui/material/styles";
2542
+
2543
+ // src/Theme/components.ts
2544
+ import React19 from "react";
2545
+ import {
2546
+ InfoRounded as InfoRounded2,
2547
+ CheckCircleRounded as CheckCircleRounded2,
2548
+ WarningRounded as WarningRounded2,
2549
+ ErrorRounded as ErrorRounded2
2550
+ } from "@mui/icons-material";
2551
+ var components = {
2552
+ MuiSelect: {
2553
+ styleOverrides: {
2554
+ outlined: {
2555
+ paddingBlock: "13px"
2556
+ },
2557
+ iconStandard: {
2558
+ "&.MuiSelect-iconStandard.MuiSvgIcon-root": {
2559
+ top: "calc(50% - .4em)"
2560
+ }
2561
+ },
2562
+ iconFilled: {
2563
+ "&.MuiSelect-iconFilled.MuiSvgIcon-root": {
2564
+ top: "calc(50% - .15em)"
2565
+ }
2566
+ },
2567
+ iconOutlined: {
2568
+ "&.MuiSelect-iconOutlined.MuiSvgIcon-root": {
2569
+ top: "calc(50% - .35em)"
2570
+ }
2571
+ },
2572
+ icon: {
2573
+ width: 16,
2574
+ height: 16
2575
+ },
2576
+ root: {
2577
+ fontSize: 13,
2578
+ fontStyle: "normal",
2579
+ fontWeight: 400,
2580
+ letterSpacing: "0.15px",
2581
+ lineHeight: "19px"
2582
+ }
2583
+ }
2584
+ },
2585
+ MuiSpeedDialIcon: {
2586
+ styleOverrides: {
2587
+ icon: {
2588
+ height: 24,
2589
+ width: 24
2590
+ }
2591
+ }
2592
+ },
2593
+ MuiSpeedDialAction: {
2594
+ styleOverrides: {
2595
+ fab: {
2596
+ height: 40,
2597
+ width: 40
2598
+ }
2599
+ }
2600
+ },
2601
+ MuiBadge: {
2602
+ styleOverrides: {
2603
+ badge: {
2604
+ fontSize: "11px",
2605
+ fontWeight: 400,
2606
+ lineHeight: "11px",
2607
+ letterSpacing: ".14px"
2608
+ }
2609
+ }
2610
+ },
2611
+ MuiSpeedDial: {
2612
+ styleOverrides: {
2613
+ fab: {
2614
+ height: 56,
2615
+ width: 56
2616
+ }
2617
+ }
2618
+ },
2619
+ MuiAccordion: {
2620
+ styleOverrides: {
2621
+ root: {
2622
+ ".MuiButtonBase-root.MuiAccordionSummary-root": {
2623
+ minHeight: 44,
2624
+ height: 44
2625
+ }
2626
+ }
2627
+ }
2628
+ },
2629
+ MuiTabs: {
2630
+ styleOverrides: {
2631
+ root: {
2632
+ minHeight: 40
2633
+ }
2634
+ }
2635
+ },
2636
+ MuiTab: {
2637
+ styleOverrides: {
2638
+ labelIcon: {
2639
+ paddingBlock: 10
2640
+ },
2641
+ root: {
2642
+ textTransform: "none",
2643
+ minHeight: 40
2644
+ }
2645
+ }
2646
+ },
2647
+ MuiDataGrid: {
2648
+ defaultProps: {
2649
+ density: "compact"
2650
+ },
2651
+ styleOverrides: {
2652
+ columnHeader: {
2653
+ variants: [
2654
+ {
2655
+ props: { density: "compact" },
2656
+ style: {
2657
+ "--height": "24px",
2658
+ minHeight: "24px !important",
2659
+ maxHeight: "24px !important"
2660
+ }
2661
+ },
2662
+ {
2663
+ props: { density: "standard" },
2664
+ style: {
2665
+ "--height": "36px",
2666
+ minHeight: "36px !important",
2667
+ maxHeight: "36px !important"
2668
+ }
2669
+ },
2670
+ {
2671
+ props: { density: "comfortable" },
2672
+ style: {
2673
+ "--height": "52px",
2674
+ minHeight: "52px !important",
2675
+ maxHeight: "52px !important"
2676
+ }
2677
+ }
2678
+ ]
2679
+ },
2680
+ columnSeparator: {
2681
+ variants: [
2682
+ {
2683
+ props: { density: "compact" },
2684
+ style: {
2685
+ "--height": "24px",
2686
+ minHeight: "24px !important",
2687
+ maxHeight: "24px !important"
2688
+ }
2689
+ },
2690
+ {
2691
+ props: { density: "standard" },
2692
+ style: {
2693
+ "--height": "36px",
2694
+ minHeight: "36px !important",
2695
+ maxHeight: "36px !important"
2696
+ }
2697
+ },
2698
+ {
2699
+ props: { density: "comfortable" },
2700
+ style: {
2701
+ "--height": "52px",
2702
+ minHeight: "52px !important",
2703
+ maxHeight: "52px !important"
2704
+ }
2705
+ }
2706
+ ]
2707
+ },
2708
+ iconButtonContainer: {
2709
+ fontSize: 16
2710
+ },
2711
+ columnHeaderDraggableContainer: {
2712
+ variants: [
2713
+ {
2714
+ props: { density: "compact" },
2715
+ style: {
2716
+ "--height": "24px",
2717
+ minHeight: "24px !important",
2718
+ maxHeight: "24px !important"
2719
+ }
2720
+ },
2721
+ {
2722
+ props: { density: "standard" },
2723
+ style: {
2724
+ "--height": "36px",
2725
+ minHeight: "36px !important",
2726
+ maxHeight: "36px !important"
2727
+ }
2728
+ },
2729
+ {
2730
+ props: { density: "comfortable" },
2731
+ style: {
2732
+ "--height": "52px",
2733
+ minHeight: "52px !important",
2734
+ maxHeight: "52px !important"
2735
+ }
2736
+ }
2737
+ ]
2738
+ },
2739
+ columnHeaderTitle: {
2740
+ fontFamily: "Roboto",
2741
+ fontWeight: 500,
2742
+ fontSize: 13,
2743
+ lineHeight: 1.5,
2744
+ letterSpacing: 0.17
2745
+ },
2746
+ row: {
2747
+ variants: [
2748
+ {
2749
+ props: { density: "compact" },
2750
+ style: {
2751
+ "--height": "22px",
2752
+ minHeight: "22px !important",
2753
+ maxHeight: "22px !important"
2754
+ }
2755
+ },
2756
+ {
2757
+ props: { density: "standard" },
2758
+ style: {
2759
+ "--height": "28px",
2760
+ minHeight: "28px !important",
2761
+ maxHeight: "28px !important"
2762
+ }
2763
+ },
2764
+ {
2765
+ props: { density: "comfortable" },
2766
+ style: {
2767
+ "--height": "48px",
2768
+ minHeight: "48px !important",
2769
+ maxHeight: "48px !important"
2770
+ }
2771
+ }
2772
+ ]
2773
+ },
2774
+ cell: {
2775
+ fontFamily: "Roboto",
2776
+ fontWeight: 300,
2777
+ fontSize: 12,
2778
+ lineHeight: 1.5,
2779
+ letterSpacing: 0.17,
2780
+ display: "flex",
2781
+ alignItems: "center",
2782
+ variants: [
2783
+ {
2784
+ props: { density: "compact" },
2785
+ style: {
2786
+ "--height": "22px",
2787
+ minHeight: "22px !important",
2788
+ maxHeight: "22px !important"
2789
+ }
2790
+ },
2791
+ {
2792
+ props: { density: "standard" },
2793
+ style: {
2794
+ "--height": "28px",
2795
+ minHeight: "28px !important",
2796
+ maxHeight: "28px !important"
2797
+ }
2798
+ },
2799
+ {
2800
+ props: { density: "comfortable" },
2801
+ style: {
2802
+ "--height": "48px",
2803
+ minHeight: "48px !important",
2804
+ maxHeight: "48px !important"
2805
+ }
2806
+ }
2807
+ ],
2808
+ // COMPONENTES DENTRO DE CELDAS
2809
+ ".MuiButtonBase-root": {
2810
+ lineHeight: 0,
2811
+ textTransform: "capitalize"
2812
+ },
2813
+ // CELDA ENFOCADA
2814
+ ".MuiDataGrid-cell": {
2815
+ "&:focus": {
2816
+ outline: "transparent",
2817
+ borderWidth: 0
2818
+ }
2819
+ }
2820
+ },
2821
+ // BOTOM MENU EN LAS CABECERA DE CADA COLUMNA
2822
+ menuIconButton: {
2823
+ svg: {
2824
+ fontSize: "16px"
2825
+ }
2826
+ },
2827
+ menu: {
2828
+ svg: {
2829
+ fontSize: "16px !important"
2830
+ },
2831
+ ".MuiMenuItem-root": {
2832
+ minHeight: "28px",
2833
+ height: "28px"
2834
+ }
2835
+ },
2836
+ pinnedRows: {
2837
+ borderTop: "1px solid rgba(228, 236, 244, 1)"
2838
+ },
2839
+ root: {
2840
+ // FONT-SIZE DE CELDA EN MODO EDICION
2841
+ ".MuiInputBase-root": {
2842
+ fontFamily: "Roboto",
2843
+ fontWeight: 300,
2844
+ fontSize: 12,
2845
+ letterSpacing: 0.17,
2846
+ borderRadius: "0px"
2847
+ },
2848
+ // CELDA FOCUS
2849
+ ".Mui-focused, .MuiOutlinedInput-notchedOutline": {
2850
+ borderWidth: "0px !important"
2851
+ },
2852
+ // TAMAÑO PEQUEÑO
2853
+ "&.MuiDataGrid-root--densityCompact": {
2854
+ ".MuiSvgIcon-root": {
2855
+ fontSize: 16
2856
+ },
2857
+ ".MuiDataGrid-cellCheckbox": {
2858
+ ".MuiButtonBase-root": {
2859
+ padding: 4
2860
+ }
2861
+ }
2862
+ }
2863
+ }
2864
+ }
2865
+ },
2866
+ MuiRating: {
2867
+ defaultProps: {
2868
+ size: "small"
2869
+ },
2870
+ styleOverrides: {
2871
+ sizeSmall: {
2872
+ fontSize: 18
2873
+ },
2874
+ sizeMedium: {
2875
+ fontSize: 24
2876
+ },
2877
+ sizeLarge: {
2878
+ fontSize: 30
2879
+ }
2880
+ }
2881
+ },
2882
+ MuiDrawer: {
2883
+ styleOverrides: {
2884
+ root: {
2885
+ boxShadow: "0px 3px 1px -2px rgba(24, 39, 75, 0.20), 0px 2px 2px 0px rgba(24, 39, 75, 0.14), 0px 1px 5px 0px rgba(24, 39, 75, 0.12)"
2886
+ }
2887
+ }
2888
+ },
2889
+ MuiTooltip: {
2890
+ styleOverrides: {
2891
+ tooltip: {
2892
+ backgroundColor: "#424242"
2893
+ }
2894
+ }
2895
+ },
2896
+ MuiDialog: {
2897
+ styleOverrides: {
2898
+ root: ({ theme }) => ({
2899
+ boxShadow: "0px 11px 15px -7px rgba(24, 39, 75, 0.2), 0px 24px 38px 3px rgba(24, 39, 75, 0.14), 0px 9px 46px 8px rgba(24, 39, 75, 0.12)",
2900
+ "& .MuiBackdrop-root": {
2901
+ backgroundColor: "#00000047"
2902
+ }
2903
+ })
2904
+ }
2905
+ },
2906
+ MuiBackdrop: {
2907
+ styleOverrides: {
2908
+ root: {
2909
+ backgroundColor: "transparent"
2910
+ }
2911
+ }
2912
+ },
2913
+ MuiDialogTitle: {
2914
+ styleOverrides: {
2915
+ root: {
2916
+ padding: "8px 16px !important"
2917
+ }
2918
+ }
2919
+ },
2920
+ MuiDialogContent: {
2921
+ styleOverrides: {
2922
+ root: {
2923
+ padding: "8px 16px !important"
2924
+ }
2925
+ }
2926
+ },
2927
+ MuiDialogActions: {
2928
+ styleOverrides: {
2929
+ root: {
2930
+ padding: "12px 16px !important"
2931
+ }
2932
+ }
2933
+ },
2934
+ MuiCheckbox: {
2935
+ variants: [
2936
+ {
2937
+ props: { size: "large" },
2938
+ style: {
2939
+ padding: 9,
2940
+ "& .MuiSvgIcon-fontSizeLarge": {
2941
+ height: 24,
2942
+ width: 24,
2943
+ fontSize: 24
2944
+ }
2945
+ }
2946
+ },
2947
+ {
2948
+ props: { size: "small" },
2949
+ style: {
2950
+ padding: 3
2951
+ }
2952
+ },
2953
+ {
2954
+ props: { size: "medium" },
2955
+ style: {
2956
+ padding: 4
2957
+ }
2958
+ }
2959
+ ],
2960
+ defaultProps: {
2961
+ size: "small"
2962
+ }
2963
+ },
2964
+ MuiToggleButton: {
2965
+ styleOverrides: {
2966
+ sizeSmall: {
2967
+ height: 32
2968
+ },
2969
+ sizeMedium: {
2970
+ height: 38
2971
+ },
2972
+ sizeLarge: {
2973
+ height: 48
2974
+ }
2975
+ }
2976
+ },
2977
+ MuiChip: {
2978
+ defaultProps: {
2979
+ size: "small",
2980
+ variant: "standard",
2981
+ color: "default"
2982
+ },
2983
+ styleOverrides: {
2984
+ icon: {
2985
+ opacity: "70%"
2986
+ },
2987
+ deleteIconSmall: {
2988
+ height: 16,
2989
+ width: 16
2990
+ },
2991
+ deleteIconMedium: {
2992
+ height: 20,
2993
+ width: 20
2994
+ },
2995
+ sizeSmall: {
2996
+ height: 16
2997
+ },
2998
+ sizeMedium: {
2999
+ height: 20
3000
+ },
3001
+ avatarSmall: {
3002
+ height: 14,
3003
+ width: 14
3004
+ },
3005
+ avatarMedium: {
3006
+ height: 18,
3007
+ width: 18
3008
+ },
3009
+ iconColorPrimary: ({ theme }) => ({
3010
+ color: theme.palette.primary.main
3011
+ }),
3012
+ colorDefault: ({ theme }) => ({
3013
+ backgroundColor: theme.palette.default.main,
3014
+ color: theme.palette.default.contrastText
3015
+ }),
3016
+ deleteIcon: ({ theme }) => ({
3017
+ variants: [
3018
+ {
3019
+ props: { variant: "filled" },
3020
+ style: {
3021
+ color: theme.palette.background.paper,
3022
+ opacity: "50%"
3023
+ }
3024
+ },
3025
+ {
3026
+ props: { variant: "standard" },
3027
+ style: {
3028
+ color: theme.palette.default.contrastText,
3029
+ opacity: "30%",
3030
+ ":hover": {
3031
+ color: theme.palette.default.contrastText,
3032
+ opacity: "30%"
3033
+ }
3034
+ }
3035
+ },
3036
+ {
3037
+ props: { variant: "outlined" },
3038
+ style: {
3039
+ color: theme.palette.action.active,
3040
+ opacity: "54%",
3041
+ ":hover": {
3042
+ color: theme.palette.action.active,
3043
+ opacity: "54%"
3044
+ }
3045
+ }
3046
+ },
3047
+ {
3048
+ props: { variant: "filled", color: "default" },
3049
+ style: {
3050
+ color: theme.palette.default.contrastText,
3051
+ opacity: "30%"
3052
+ }
3053
+ }
3054
+ ]
3055
+ }),
3056
+ avatar: ({ theme }) => ({
3057
+ lineHeight: 1.8,
3058
+ variants: [
3059
+ {
3060
+ props: { variant: "filled" },
3061
+ style: {
3062
+ backgroundColor: theme.palette.background.paper,
3063
+ opacity: "70%",
3064
+ color: theme.palette.default.contrastText
3065
+ }
3066
+ },
3067
+ {
3068
+ props: { variant: "standard" },
3069
+ style: {
3070
+ backgroundColor: theme.palette.default.contrastText,
3071
+ color: theme.palette.primary.contrastText
3072
+ }
3073
+ },
3074
+ {
3075
+ props: { variant: "outlined", color: "error" },
3076
+ style: {
3077
+ backgroundColor: theme.palette.error.main,
3078
+ color: theme.palette.background.paper
3079
+ }
3080
+ },
3081
+ {
3082
+ props: { variant: "outlined", color: "success" },
3083
+ style: {
3084
+ backgroundColor: theme.palette.success.main,
3085
+ color: theme.palette.background.paper
3086
+ }
3087
+ },
3088
+ {
3089
+ props: { variant: "outlined", color: "info" },
3090
+ style: {
3091
+ backgroundColor: theme.palette.info.main,
3092
+ color: theme.palette.background.paper
3093
+ }
3094
+ },
3095
+ {
3096
+ props: { variant: "outlined", color: "warning" },
3097
+ style: {
3098
+ backgroundColor: theme.palette.warning.main,
3099
+ color: theme.palette.background.paper
3100
+ }
3101
+ },
3102
+ {
3103
+ props: { variant: "outlined", color: "default" },
3104
+ style: {
3105
+ backgroundColor: theme.palette.grey[400],
3106
+ color: theme.palette.background.paper
3107
+ }
3108
+ },
3109
+ {
3110
+ props: { variant: "filled", color: "default" },
3111
+ style: {
3112
+ backgroundColor: theme.palette.default.contrastText,
3113
+ color: theme.palette.background.paper
3114
+ }
3115
+ }
3116
+ ]
3117
+ }),
3118
+ label: ({ theme }) => __spreadValues({}, theme.typography.caption),
3119
+ root: ({ theme }) => ({
3120
+ height: "inherit",
3121
+ borderRadius: 4,
3122
+ variants: [
3123
+ {
3124
+ props: { variant: "outlined", color: "default" },
3125
+ style: {
3126
+ border: `1px solid ${theme.palette.grey[400]}`,
3127
+ backgroundColor: "transparent ",
3128
+ color: theme.palette.default.contrastText,
3129
+ ":hover": {
3130
+ backgroundColor: theme.palette.default.main
3131
+ }
3132
+ }
3133
+ },
3134
+ {
3135
+ props: { variant: "standard", color: "default" },
3136
+ style: {
3137
+ backgroundColor: theme.palette.default.main,
3138
+ color: theme.palette.default.contrastText,
3139
+ ":hover": {
3140
+ backgroundColor: theme.palette.default.dark
3141
+ }
3142
+ }
3143
+ },
3144
+ {
3145
+ props: { variant: "filled", color: "default" },
3146
+ style: {
3147
+ backgroundColor: theme.palette.grey[50],
3148
+ color: theme.palette.default.contrastText,
3149
+ ":hover": {
3150
+ backgroundColor: theme.palette.grey[100]
3151
+ }
3152
+ }
3153
+ },
3154
+ {
3155
+ props: { variant: "filled", color: "default" },
3156
+ style: {
3157
+ backgroundColor: theme.palette.grey[50],
3158
+ color: theme.palette.default.contrastText,
3159
+ ":hover": {
3160
+ backgroundColor: theme.palette.grey[100]
3161
+ }
3162
+ }
3163
+ },
3164
+ {
3165
+ props: { variant: "standard", avatar: true },
3166
+ style: {
3167
+ backgroundColor: theme.palette.default.contrastText,
3168
+ color: theme.palette.default.contrastText
3169
+ }
3170
+ },
3171
+ {
3172
+ props: { variant: "standard" },
3173
+ style: {
3174
+ backgroundColor: theme.palette.default.contrastText,
3175
+ color: theme.palette.default.contrastText
3176
+ }
3177
+ },
3178
+ {
3179
+ props: { variant: "standard", color: "primary" },
3180
+ style: {
3181
+ backgroundColor: theme.palette.chipPrimary.main,
3182
+ ":hover": {
3183
+ backgroundColor: theme.palette.chipPrimary.dark
3184
+ }
3185
+ }
3186
+ },
3187
+ {
3188
+ props: { variant: "standard", color: "secondary" },
3189
+ style: {
3190
+ backgroundColor: theme.palette.chipSecondary.main,
3191
+ ":hover": {
3192
+ backgroundColor: theme.palette.chipSecondary.dark
3193
+ }
3194
+ }
3195
+ },
3196
+ {
3197
+ props: { variant: "standard", color: "info" },
3198
+ style: {
3199
+ backgroundColor: theme.palette.chipInfo.main,
3200
+ ":hover": {
3201
+ backgroundColor: theme.palette.chipInfo.dark
3202
+ }
3203
+ }
3204
+ },
3205
+ {
3206
+ props: { variant: "standard", color: "error" },
3207
+ style: {
3208
+ backgroundColor: theme.palette.chipError.main,
3209
+ ":hover": {
3210
+ backgroundColor: theme.palette.chipError.dark
3211
+ }
3212
+ }
3213
+ },
3214
+ {
3215
+ props: { variant: "standard", color: "success" },
3216
+ style: {
3217
+ backgroundColor: theme.palette.chipSuccess.main,
3218
+ ":hover": {
3219
+ backgroundColor: theme.palette.chipSuccess.dark
3220
+ }
3221
+ }
3222
+ },
3223
+ {
3224
+ props: { variant: "standard", color: "warning" },
3225
+ style: {
3226
+ backgroundColor: theme.palette.chipWarning.main,
3227
+ ":hover": {
3228
+ backgroundColor: theme.palette.chipWarning.dark
3229
+ }
3230
+ }
3231
+ }
3232
+ ]
3233
+ })
3234
+ }
3235
+ },
3236
+ MuiAvatar: {
3237
+ styleOverrides: {
3238
+ root: {
3239
+ display: "flex",
3240
+ alignContent: "center"
3241
+ }
3242
+ }
3243
+ },
3244
+ MuiAlert: {
3245
+ defaultProps: {
3246
+ iconMapping: {
3247
+ success: React19.createElement(CheckCircleRounded2),
3248
+ error: React19.createElement(ErrorRounded2),
3249
+ warning: React19.createElement(WarningRounded2),
3250
+ info: React19.createElement(InfoRounded2)
3251
+ }
3252
+ },
3253
+ variants: [
3254
+ {
3255
+ props: { variant: "filled" },
3256
+ style: {
3257
+ color: "#fff"
3258
+ }
3259
+ },
3260
+ {
3261
+ props: { variant: "outlined" },
3262
+ style: {
3263
+ padding: "7px 12px 7px 12px"
3264
+ }
3265
+ }
3266
+ ],
3267
+ styleOverrides: {
3268
+ message: ({ theme }) => ({
3269
+ padding: "0px 4px",
3270
+ minWidth: 0,
3271
+ variants: [
3272
+ {
3273
+ props: { variant: "standard" },
3274
+ style: {
3275
+ color: theme.palette.text.primary
3276
+ }
3277
+ },
3278
+ {
3279
+ props: { variant: "outlined" },
3280
+ style: {
3281
+ color: theme.palette.text.primary
3282
+ }
3283
+ }
3284
+ ]
3285
+ }),
3286
+ icon: ({ theme }) => ({
3287
+ padding: "4px",
3288
+ marginRight: 0,
3289
+ display: "flex",
3290
+ alignItems: "center",
3291
+ borderRadius: 100,
3292
+ variants: [
3293
+ {
3294
+ props: { variant: "standard", color: "success" },
3295
+ style: {
3296
+ backgroundColor: theme.palette.success[100]
3297
+ }
3298
+ },
3299
+ {
3300
+ props: { variant: "standard", color: "error" },
3301
+ style: {
3302
+ backgroundColor: theme.palette.error[100]
3303
+ }
3304
+ },
3305
+ {
3306
+ props: { variant: "standard", color: "info" },
3307
+ style: {
3308
+ backgroundColor: theme.palette.info[100]
3309
+ }
3310
+ },
3311
+ {
3312
+ props: { variant: "standard", color: "warning" },
3313
+ style: {
3314
+ backgroundColor: theme.palette.warning[100]
3315
+ }
3316
+ }
3317
+ ]
3318
+ }),
3319
+ action: ({ theme }) => ({
3320
+ display: "flex",
3321
+ gap: 1.5,
3322
+ padding: "0px",
3323
+ variants: [
3324
+ {
3325
+ props: { variant: "standard" },
3326
+ style: {
3327
+ color: theme.palette.action.active
3328
+ }
3329
+ },
3330
+ {
3331
+ props: { variant: "outlined" },
3332
+ style: {
3333
+ color: theme.palette.action.active
3334
+ }
3335
+ }
3336
+ ]
3337
+ }),
3338
+ root: {
3339
+ padding: "8px 12px 8px 12px",
3340
+ borderRadius: "8px",
3341
+ display: "flex",
3342
+ alignItems: "center",
3343
+ gap: 1.5,
3344
+ minWidth: "296px"
3345
+ }
3346
+ }
3347
+ },
3348
+ MuiAlertTitle: {
3349
+ defaultProps: {
3350
+ variant: "subtitle2"
3351
+ },
3352
+ styleOverrides: {
3353
+ root: {
3354
+ marginBottom: 0,
3355
+ marginTop: 2.5
3356
+ }
3357
+ }
3358
+ },
3359
+ MuiButton: {
3360
+ styleOverrides: {
3361
+ root: {
3362
+ fontFamily: "Roboto",
3363
+ textTransform: "unset",
3364
+ fontWeightLight: 300,
3365
+ fontSize: "13px",
3366
+ lineHeight: "normal",
3367
+ "@media(max-width: 885px)": {
3368
+ fontSize: 14
3369
+ }
3370
+ },
3371
+ startIcon: {
3372
+ marginLeft: 2
3373
+ },
3374
+ endIcon: {
3375
+ marginRight: 2
3376
+ },
3377
+ sizeSmall: {
3378
+ height: 26,
3379
+ ".MuiSvgIcon-fontSizeSmall": {
3380
+ height: 16,
3381
+ width: 16
3382
+ },
3383
+ ".MuiSvgIcon-fontSizeMedium": {
3384
+ height: 18,
3385
+ width: 18
3386
+ },
3387
+ ".MuiSvgIcon-fontSizeLarge": {
3388
+ height: 20,
3389
+ width: 20
3390
+ }
3391
+ },
3392
+ sizeMedium: {
3393
+ height: 32,
3394
+ ".MuiSvgIcon-fontSizeSmall": {
3395
+ height: 16,
3396
+ width: 16
3397
+ },
3398
+ ".MuiSvgIcon-fontSizeMedium": {
3399
+ height: 18,
3400
+ width: 18
3401
+ },
3402
+ ".MuiSvgIcon-fontSizeLarge": {
3403
+ height: 20,
3404
+ width: 20
3405
+ }
3406
+ },
3407
+ sizeLarge: {
3408
+ height: 38,
3409
+ ".MuiSvgIcon-fontSizeSmall": {
3410
+ height: 16,
3411
+ width: 16
3412
+ },
3413
+ "&.MuiSvgIcon-fontSizeMedium": {
3414
+ height: 18,
3415
+ width: 18
3416
+ }
3417
+ }
3418
+ }
3419
+ },
3420
+ MuiButtonGroup: {
3421
+ defaultProps: {
3422
+ size: "small"
3423
+ }
3424
+ },
3425
+ MuiFab: {
3426
+ defaultProps: {
3427
+ size: "small"
3428
+ },
3429
+ styleOverrides: {
3430
+ circular: {
3431
+ boxShadow: "0px 1px 18px 0px rgba(24, 39, 75, 0.12), 0px 6px 10px 0px rgba(24, 39, 75, 0.14), 0px 3px 5px -1px rgba(24, 39, 75, 0.20)",
3432
+ sizeSmall: {
3433
+ height: 36,
3434
+ width: 36,
3435
+ svg: {
3436
+ height: 20,
3437
+ width: 20
3438
+ }
3439
+ },
3440
+ sizeMedium: {
3441
+ height: 48,
3442
+ width: 48,
3443
+ svg: {
3444
+ height: 22,
3445
+ width: 22
3446
+ }
3447
+ },
3448
+ sizeLarge: {
3449
+ height: 56,
3450
+ width: 56,
3451
+ svg: {
3452
+ height: 24,
3453
+ width: 24
3454
+ }
3455
+ }
3456
+ },
3457
+ extended: {
3458
+ gap: 1,
3459
+ boxShadow: " 0px 1px 18px 0px rgba(24, 39, 75, 0.12), 0px 6px 10px 0px rgba(24, 39, 75, 0.14), 0px 3px 5px -1px rgba(24, 39, 75, 0.20)",
3460
+ sizeSmall: {
3461
+ height: 32,
3462
+ svg: {
3463
+ height: 20,
3464
+ width: 20,
3465
+ marginRight: 4
3466
+ }
3467
+ },
3468
+ sizeMedium: {
3469
+ height: 38,
3470
+ svg: {
3471
+ height: 22,
3472
+ width: 22,
3473
+ marginRight: 4
3474
+ }
3475
+ },
3476
+ sizeLarge: {
3477
+ height: 48,
3478
+ svg: {
3479
+ height: 24,
3480
+ width: 24,
3481
+ marginRight: 4
3482
+ }
3483
+ }
3484
+ },
3485
+ root: {
3486
+ textTransform: "capitalize"
3487
+ }
3488
+ }
3489
+ },
3490
+ MuiFormControl: {
3491
+ defaultProps: {
3492
+ size: "small",
3493
+ margin: "none"
3494
+ }
3495
+ },
3496
+ MuiFormHelperText: {
3497
+ defaultProps: {
3498
+ margin: "dense"
3499
+ }
3500
+ },
3501
+ MuiSvgIcon: {
3502
+ styleOverrides: {
3503
+ fontSizeLarge: {
3504
+ width: 35,
3505
+ height: 35,
3506
+ fontSize: 35
3507
+ },
3508
+ fontSizeMedium: {
3509
+ width: 20,
3510
+ height: 20,
3511
+ fontSize: 20
3512
+ },
3513
+ fontSizeSmall: {
3514
+ width: 16,
3515
+ height: 16,
3516
+ fontSize: 16
3517
+ }
3518
+ }
3519
+ },
3520
+ MuiIconButton: {
3521
+ defaultProps: {
3522
+ color: "inherit"
3523
+ },
3524
+ styleOverrides: {
3525
+ sizeSmall: {
3526
+ padding: 3
3527
+ },
3528
+ sizeMedium: {
3529
+ padding: 8
3530
+ },
3531
+ sizeLarge: {
3532
+ padding: 12
3533
+ }
3534
+ }
3535
+ },
3536
+ MuiInputBase: {
3537
+ defaultProps: {
3538
+ margin: "none"
3539
+ },
3540
+ styleOverrides: {
3541
+ root: {
3542
+ "&.MuiInput-underline": {
3543
+ marginTop: 9
3544
+ },
3545
+ ".MuiOutlinedInput-input.MuiInputBase-inputSizeSmall": {
3546
+ paddingBlock: 6.51
3547
+ },
3548
+ ".MuiOutlinedInput-input": {
3549
+ paddingBlock: 14
3550
+ }
3551
+ }
3552
+ }
3553
+ },
3554
+ MuiOutlinedInput: {
3555
+ styleOverrides: {
3556
+ notchedOutline: {
3557
+ borderColor: "rgba(16, 24, 64, 0.23)"
3558
+ }
3559
+ }
3560
+ },
3561
+ MuiAutocomplete: {
3562
+ defaultProps: {
3563
+ size: "small"
3564
+ },
3565
+ styleOverrides: {
3566
+ root: {
3567
+ "&.MuiAutocomplete-root .MuiOutlinedInput-root": {
3568
+ padding: "6px 14px 6px 10px"
3569
+ },
3570
+ "& .MuiAutocomplete-endAdornment": {
3571
+ top: "calc(50% - 12px)",
3572
+ transform: "none"
3573
+ },
3574
+ "&.MuiAutocomplete-root .MuiOutlinedInput-root.MuiInputBase-sizeSmall": {
3575
+ paddingBlock: 3.5,
3576
+ paddingRight: 14,
3577
+ ".MuiIconButton-sizeSmall .MuiAutocomplete-popupIndicator": {
3578
+ padding: 5
3579
+ }
3580
+ }
3581
+ }
3582
+ }
3583
+ },
3584
+ MuiInputLabel: {
3585
+ styleOverrides: {
3586
+ asterisk: ({ theme }) => ({
3587
+ color: theme.palette.error.main
3588
+ }),
3589
+ root: {
3590
+ display: "flex",
3591
+ gap: ".2rem",
3592
+ flexDirection: "row-reverse",
3593
+ fontSize: 13,
3594
+ fontStyle: "normal",
3595
+ fontWeight: 400,
3596
+ letterSpacing: "0.15px"
3597
+ },
3598
+ filled: {
3599
+ "&.MuiInputLabel-filled.MuiInputLabel-sizeSmall:not(.MuiInputLabel-shrink)": {
3600
+ transform: "translate(12px,15px) scale(1)"
3601
+ },
3602
+ "&.MuiInputLabel-filled.MuiInputLabel-sizeMedium:not(.MuiInputLabel-shrink)": {
3603
+ transform: "translate(12px,19px) scale(1)"
3604
+ }
3605
+ },
3606
+ standard: {
3607
+ "&.MuiInputLabel-standard.MuiInputLabel-sizeSmall:not(.MuiInputLabel-shrink)": {
3608
+ transform: "translate(0, 14px) scale(1)"
3609
+ },
3610
+ "&.MuiInputLabel-standard.MuiInputLabel-sizeMedium:not(.MuiInputLabel-shrink)": {
3611
+ transform: "translate(0, 16px) scale(1)"
3612
+ }
3613
+ },
3614
+ outlined: {
3615
+ "&.MuiInputLabel-outlined.MuiInputLabel-sizeSmall ": {
3616
+ transform: "translate(14px,8px) scale(1)"
3617
+ },
3618
+ "&.MuiInputLabel-outlined ": {
3619
+ transform: "translate(14px, 14px) scale(1)",
3620
+ "&.MuiInputLabel-shrink": {
3621
+ transform: "translate(14px, -7px) scale(0.75)"
3622
+ }
3623
+ }
3624
+ }
3625
+ },
3626
+ defaultProps: {
3627
+ margin: "dense"
3628
+ }
3629
+ },
3630
+ MuiCard: {
3631
+ styleOverrides: {
3632
+ root: {
3633
+ overflow: "initial",
3634
+ boxShadow: "0px 2px 1px -2px rgba(24, 39, 75, 0.20), 0px 1px 1px -1px rgba(24, 39, 75, 0.14), 0px 1px 3px 0px rgba(24, 39, 75, 0.12)"
3635
+ }
3636
+ }
3637
+ },
3638
+ MuiCardHeader: {
3639
+ styleOverrides: {
3640
+ root: {
3641
+ padding: "8px 16px "
3642
+ }
3643
+ }
3644
+ },
3645
+ MuiCardContent: {
3646
+ styleOverrides: {
3647
+ root: {
3648
+ padding: "8px 16px "
3649
+ }
3650
+ }
3651
+ },
3652
+ MuiCardActions: {
3653
+ styleOverrides: {
3654
+ root: {
3655
+ padding: "8px 16px"
3656
+ }
3657
+ }
3658
+ },
3659
+ MuiRadio: {
3660
+ variants: [
3661
+ {
3662
+ props: { size: "small" },
3663
+ style: {
3664
+ padding: 3
3665
+ }
3666
+ },
3667
+ {
3668
+ props: { size: "medium" },
3669
+ style: {
3670
+ padding: 4
3671
+ }
3672
+ },
3673
+ {
3674
+ props: { size: "large" },
3675
+ style: {
3676
+ padding: 9,
3677
+ "& .MuiSvgIcon-fontSizeLarge": {
3678
+ width: 24,
3679
+ height: 24,
3680
+ fontSize: 24
3681
+ }
3682
+ }
3683
+ }
3684
+ ],
3685
+ defaultProps: {
3686
+ size: "small"
3687
+ }
3688
+ },
3689
+ MuiSwitch: {
3690
+ variants: [
3691
+ {
3692
+ props: { size: "small" },
3693
+ style: {
3694
+ height: 22,
3695
+ ".MuiSwitch-switchBase": {
3696
+ padding: 3
3697
+ }
3698
+ }
3699
+ }
3700
+ ],
3701
+ defaultProps: {
3702
+ size: "small"
3703
+ }
3704
+ },
3705
+ MuiTextField: {
3706
+ defaultProps: {
3707
+ size: "small",
3708
+ margin: "none"
3709
+ },
3710
+ variants: [
3711
+ {
3712
+ props: { variant: "standard" },
3713
+ style: {
3714
+ ".MuiInputBase-input.MuiInputBase-inputSizeSmall": {
3715
+ padding: 1.5
3716
+ }
3717
+ }
3718
+ }
3719
+ ]
3720
+ },
3721
+ MuiList: {
3722
+ defaultProps: {
3723
+ dense: false
3724
+ },
3725
+ styleOverrides: {
3726
+ padding: {
3727
+ ".MuiListItem-padding": {
3728
+ paddingBlock: 1
3729
+ }
3730
+ },
3731
+ dense: {
3732
+ ".MuiListItem-dense": {
3733
+ padding: "0.25px 0px 0.25px 16px"
3734
+ }
3735
+ }
3736
+ }
3737
+ },
3738
+ MuiListItemButton: {
3739
+ styleOverrides: {
3740
+ dense: {
3741
+ padding: "4px 16px 4px 16px "
3742
+ },
3743
+ root: {
3744
+ padding: "8.21px 16px",
3745
+ ".MuiListItemText-multiline": {
3746
+ marginBlock: "4px"
3747
+ }
3748
+ }
3749
+ }
3750
+ },
3751
+ MuiMenuItem: {
3752
+ styleOverrides: {
3753
+ dense: {
3754
+ height: 30,
3755
+ minHeight: 30,
3756
+ ".MuiListItemText-root > .MuiTypography-root": {
3757
+ lineHeight: "14.3px",
3758
+ letterSpacing: 0.15
3759
+ }
3760
+ },
3761
+ root: {
3762
+ padding: "7px 16px 7px 16px",
3763
+ ".MuiMenuList-root": {
3764
+ height: 34,
3765
+ minHeight: 34
3766
+ },
3767
+ ".MuiListItemText-root > .MuiTypography-root": {
3768
+ lineHeight: "20px",
3769
+ letterSpacing: 0.17
3770
+ },
3771
+ ".MuiListItemIcon-root": {
3772
+ minWidth: 32
3773
+ }
3774
+ }
3775
+ }
3776
+ },
3777
+ MuiTableBody: {
3778
+ styleOverrides: {
3779
+ root: {
3780
+ ".MuiTableCell-body.MuiTableCell-sizeMedium": {
3781
+ padding: "16px !important"
3782
+ }
3783
+ }
3784
+ }
3785
+ },
3786
+ MuiTableCell: {
3787
+ styleOverrides: {
3788
+ sizeMedium: {
3789
+ padding: 13
3790
+ }
3791
+ }
3792
+ },
3793
+ MuiTable: {
3794
+ defaultProps: {
3795
+ size: "small"
3796
+ },
3797
+ styleOverrides: {
3798
+ root: {
3799
+ minWidth: 630
3800
+ }
3801
+ }
3802
+ }
3803
+ };
3804
+
3805
+ // src/Theme/palette.ts
3806
+ var BasicPalette = {
3807
+ default: {
3808
+ main: "#E4E5E7",
3809
+ dark: "#D1D3D7",
3810
+ light: "#F2F2F3",
3811
+ contrastText: "#5A5E73"
3812
+ },
3813
+ chipInfo: {
3814
+ main: "#C0E8FC",
3815
+ dark: "#9CD8FA",
3816
+ light: "#E0F4FE",
3817
+ contrastText: "#5A5E73"
3818
+ },
3819
+ chipWarning: {
3820
+ main: "#FCE4C0",
3821
+ dark: "#FAD19C",
3822
+ light: "#F3F2F0",
3823
+ contrastText: "#5A5E73"
3824
+ },
3825
+ chipError: {
3826
+ main: "#FCD4D4",
3827
+ dark: "#F4B9B9",
3828
+ light: "#FEEAEA",
3829
+ contrastText: "#5A5E73"
3830
+ },
3831
+ chipSuccess: {
3832
+ main: "#DDF8C3",
3833
+ dark: "#C8F3A2",
3834
+ light: "#EFFCE2",
3835
+ contrastText: "#5A5E73"
3836
+ },
3837
+ error: {
3838
+ 50: "#F9E8E8",
3839
+ 100: "#F1C7C7",
3840
+ 200: "#E8A1A1",
3841
+ 300: "#DF7B7B",
3842
+ light: "#D85F5F",
3843
+ main: "#D14343",
3844
+ 600: "#CC3D3D",
3845
+ 700: "#C63434",
3846
+ 800: "#C02C2C",
3847
+ dark: "#B51E1E",
3848
+ A100: "#FFECEC",
3849
+ A200: "#FFB9B9",
3850
+ A400: "#FF8686",
3851
+ A700: "#FF6D6D",
3852
+ contrastText: "#ffffff"
3853
+ },
3854
+ warning: {
3855
+ 50: "#FFF0E0",
3856
+ 100: "#FEDAB3",
3857
+ 200: "#FDC280",
3858
+ 300: "#FCAA4D",
3859
+ light: "#FC9726",
3860
+ main: "#FB8500",
3861
+ 600: "#FA7D00",
3862
+ 700: "#FA7200",
3863
+ 800: "#F96800",
3864
+ dark: "#F85500",
3865
+ A100: "#FFFFFF",
3866
+ A200: "#FFF1EB",
3867
+ A400: "#FFCCB8",
3868
+ A700: "#FFBA9F",
3869
+ contrastText: "#ffffff"
3870
+ },
3871
+ info: {
3872
+ 50: "#E6F3F8",
3873
+ 100: "#C0E2EE",
3874
+ 200: "#96CFE2",
3875
+ 300: "#6CBCD6",
3876
+ light: "#4DADCE",
3877
+ main: "#2D9FC5",
3878
+ 600: "#2897BF",
3879
+ 700: "#228DB8",
3880
+ 800: "#1C83B0",
3881
+ dark: "#1172A3",
3882
+ A100: "#D4EFFF",
3883
+ A200: "#A1DCFF",
3884
+ A400: "#6ECAFF",
3885
+ A700: "#54C1FF",
3886
+ contrastText: "#ffffff"
3887
+ },
3888
+ success: {
3889
+ 50: "#F2F9E7",
3890
+ 100: "#DDEFC4",
3891
+ 200: "#C7E49D",
3892
+ 300: "#B1D975",
3893
+ light: "#A0D158",
3894
+ main: "#8FC93A",
3895
+ 600: "#87C334",
3896
+ 700: "#7CBC2C",
3897
+ 800: "#72B525",
3898
+ dark: "#60A918",
3899
+ A100: "#EDFFDE",
3900
+ A200: "#D2FFAB",
3901
+ A400: "#B6FF78",
3902
+ A700: "#A9FF5E",
3903
+ contrastText: "#ffffff"
3904
+ },
3905
+ grey: {
3906
+ 50: "#FBFBFB",
3907
+ 100: "#F5F5F6",
3908
+ 200: "#EAEBEC",
3909
+ 300: "#DCDEE0",
3910
+ 400: "#CED1D4",
3911
+ 500: "#C4C7CA",
3912
+ 600: "#B9BDC1",
3913
+ 700: "#B2B7BB",
3914
+ 800: "#AAAEB3",
3915
+ 900: "#A2A6AB",
3916
+ A100: "#FFFFFF",
3917
+ A200: "#FFFFFF",
3918
+ A400: "#D4EAFF",
3919
+ A700: "#BBDDFF"
3920
+ },
3921
+ text: {
3922
+ primary: "#101840de",
3923
+ secondary: "#10184099",
3924
+ disabled: "#10184061"
3925
+ },
3926
+ action: {
3927
+ active: "#1018408a",
3928
+ hover: "#1018400a",
3929
+ selected: "#10184014",
3930
+ disabled: "#10184042",
3931
+ disabledBackground: "#1018401f",
3932
+ focus: "#1018401f"
3933
+ },
3934
+ background: {
3935
+ default: "#f5f5f5",
3936
+ paper: "#fff"
3937
+ },
3938
+ common: {
3939
+ black: "#000",
3940
+ white: "#fff"
3941
+ },
3942
+ divider: "#0000001f"
3943
+ };
3944
+ var paletteERP = __spreadValues({
3945
+ primary: {
3946
+ 50: "#E4ECF4",
3947
+ 100: "#BCD0E3",
3948
+ 200: "#8FB1D0",
3949
+ 300: "#6392BD",
3950
+ light: "#417AAE",
3951
+ main: "#2063A0",
3952
+ 600: "#1C5B98",
3953
+ 700: "#18518E",
3954
+ 800: "#134784",
3955
+ dark: "#0B3573",
3956
+ A100: "#A5C5FF",
3957
+ A200: "#72A4FF",
3958
+ A400: "#3F83FF",
3959
+ A700: "#2572FF",
3960
+ contrastText: "#ffffff"
3961
+ },
3962
+ secondary: {
3963
+ 50: "#E0F7FA",
3964
+ 100: "#B3EBF2",
3965
+ 200: "#80DEEA",
3966
+ 300: "#4DD0E1",
3967
+ light: "#26C6DA",
3968
+ main: "#00BCD4",
3969
+ 600: "#00B6CF",
3970
+ 700: "#00ADC9",
3971
+ 800: "#00A5C3",
3972
+ dark: "#0097B9",
3973
+ A100: "#E2F9FF",
3974
+ A200: "#AFEEFF",
3975
+ A400: "#7CE3FF",
3976
+ A700: "#63DDFF",
3977
+ contrastText: "#ffffff"
3978
+ },
3979
+ chipPrimary: {
3980
+ main: "#C4E1F5",
3981
+ dark: "#A2CDEE",
3982
+ light: "#E2F0FA",
3983
+ contrastText: "#5A5E73"
3984
+ },
3985
+ chipSecondary: {
3986
+ main: "#C4F6FD",
3987
+ dark: "#A8F1FB",
3988
+ light: "#E0FBFE",
3989
+ contrastText: "#545E73"
3990
+ }
3991
+ }, BasicPalette);
3992
+ var paletteADPRO = __spreadValues({
3993
+ primary: {
3994
+ 50: "#F8FAFB",
3995
+ 100: "#E6EFF0",
3996
+ 200: "#D2E3E4",
3997
+ 300: "#82C6CB",
3998
+ light: "#2B9DA7",
3999
+ main: "#058C97",
4000
+ 600: "#04848F",
4001
+ 700: "#047984",
4002
+ 800: "#036F7A",
4003
+ dark: "#015C69",
4004
+ A100: "#98F0FF",
4005
+ A200: "#65E9FF",
4006
+ A400: "#32E1FF",
4007
+ A700: "#32E1FF"
4008
+ },
4009
+ secondary: {
4010
+ 50: "#E0F7FA",
4011
+ 100: "#B3EBF2",
4012
+ 200: "#80DEEA",
4013
+ 300: "#4DD0E1",
4014
+ light: "#26C6DA",
4015
+ main: "#00BCD4",
4016
+ 600: "#00B6CF",
4017
+ 700: "#00ADC9",
4018
+ 800: "#00A5C3",
4019
+ dark: "#0097B9",
4020
+ A100: "#E2F9FF",
4021
+ A200: "#AFEEFF",
4022
+ A400: "#7CE3FF",
4023
+ A700: "#63DDFF",
4024
+ contrastText: "#ffffff"
4025
+ },
4026
+ chipPrimary: {
4027
+ main: "#CEE7E9",
4028
+ dark: "#B2D9DC",
4029
+ light: "#E3F1F2",
4030
+ contrastText: "#5A5E73"
4031
+ },
4032
+ chipSecondary: {
4033
+ main: "#C4F6FD",
4034
+ dark: "#A8F1FB",
4035
+ light: "#E0FBFE",
4036
+ contrastText: "#545E73"
4037
+ }
4038
+ }, BasicPalette);
4039
+ var paletteADC = __spreadValues({
4040
+ primary: {
4041
+ 50: "#F8FAFB",
4042
+ 100: "#E6EFF0",
4043
+ 200: "#D2E3E4",
4044
+ 300: "#82C6CB",
4045
+ light: "#2B9DA7",
4046
+ main: "#058C97",
4047
+ 600: "#04848F",
4048
+ 700: "#047984",
4049
+ 800: "#036F7A",
4050
+ dark: "#015C69",
4051
+ A100: "#98F0FF",
4052
+ A200: "#65E9FF",
4053
+ A400: "#32E1FF",
4054
+ A700: "#32E1FF"
4055
+ },
4056
+ secondary: {
4057
+ 50: "#E0F7FA",
4058
+ 100: "#B3EBF2",
4059
+ 200: "#80DEEA",
4060
+ 300: "#4DD0E1",
4061
+ light: "#26C6DA",
4062
+ main: "#00BCD4",
4063
+ 600: "#00B6CF",
4064
+ 700: "#00ADC9",
4065
+ 800: "#00A5C3",
4066
+ dark: "#0097B9",
4067
+ A100: "#E2F9FF",
4068
+ A200: "#AFEEFF",
4069
+ A400: "#7CE3FF",
4070
+ A700: "#63DDFF",
4071
+ contrastText: "#ffffff"
4072
+ },
4073
+ chipPrimary: {
4074
+ main: "#D4D8F7",
4075
+ dark: "#B2B9F0",
4076
+ light: "#E5E8FA",
4077
+ contrastText: "#5A5E73"
4078
+ },
4079
+ chipSecondary: {
4080
+ main: "#E0E0E0",
4081
+ dark: "#D1D1D1",
4082
+ light: "#EBEBEB",
4083
+ contrastText: "#545E73"
4084
+ }
4085
+ }, BasicPalette);
4086
+
4087
+ // src/Theme/breakpoints.ts
4088
+ import { createBreakpoints } from "@mui/system";
4089
+ var breakpoints = createBreakpoints({
4090
+ values: {
4091
+ xs: 0,
4092
+ sm: 600,
4093
+ md: 960,
4094
+ lg: 1280,
4095
+ xl: 1920
4096
+ }
4097
+ });
4098
+
4099
+ // src/Theme/mixins.ts
4100
+ var mixins = {
4101
+ toolbar: {
4102
+ minHeight: 48,
4103
+ [breakpoints.down("md")]: {
4104
+ minHeight: 52
4105
+ }
4106
+ }
4107
+ };
4108
+
4109
+ // src/Theme/module.ts
4110
+ import "@mui/material/Typography";
4111
+ import "@mui/material/Radio";
4112
+ import "@mui/material/Chip";
4113
+ import "@mui/material/Checkbox";
4114
+ import "@mui/material/styles";
4115
+
4116
+ // src/Theme/typography.ts
4117
+ var typography = {
4118
+ fontSize: 13,
4119
+ body1: {
4120
+ fontFamily: "Roboto",
4121
+ fontSize: 14,
4122
+ fontWeight: 400,
4123
+ lineHeight: "16px",
4124
+ letterSpacing: "0.15px",
4125
+ "@media(max-width: 885px)": {
4126
+ fontSize: 15
4127
+ }
4128
+ },
4129
+ body2: {
4130
+ fontFamily: "Roboto",
4131
+ fontSize: 13,
4132
+ fontWeight: 400,
4133
+ lineHeight: "16px",
4134
+ letterSpacing: "0.17px",
4135
+ "@media(max-width: 885px)": {
4136
+ fontSize: 14
4137
+ }
4138
+ },
4139
+ body3: {
4140
+ fontFamily: "Roboto",
4141
+ fontWeight: 300,
4142
+ fontSize: 12,
4143
+ lineHeight: "16px",
4144
+ letterSpacing: "0.17px",
4145
+ [breakpoints.down("md")]: {
4146
+ fontSize: 11
4147
+ }
4148
+ },
4149
+ subtitle1: {
4150
+ fontFamily: "Roboto",
4151
+ fontSize: 14,
4152
+ fontWeight: 500,
4153
+ lineHeight: "16px",
4154
+ letterSpacing: "0.15px",
4155
+ "@media(max-width: 885px)": {
4156
+ fontSize: 15
4157
+ }
4158
+ },
4159
+ subtitle2: {
4160
+ fontFamily: "Roboto",
4161
+ fontSize: 13,
4162
+ fontWeight: 500,
4163
+ lineHeight: "16px",
4164
+ letterSpacing: "0.1px",
4165
+ "@media(max-width: 885px)": {
4166
+ fontSize: 14
4167
+ }
4168
+ },
4169
+ caption: {
4170
+ fontFamily: "Roboto",
4171
+ fontSize: 11,
4172
+ fontWeight: 400,
4173
+ lineHeight: "14px",
4174
+ letterSpacing: "0.4px",
4175
+ "@media(max-width: 885px)": {
4176
+ fontSize: 12
4177
+ }
4178
+ },
4179
+ overline: {
4180
+ fontFamily: "Roboto",
4181
+ fontSize: 11,
4182
+ fontWeight: 400,
4183
+ lineHeight: "24px",
4184
+ letterSpacing: "1px",
4185
+ "@media(max-width: 885px)": {
4186
+ fontSize: 12
4187
+ }
4188
+ },
4189
+ h6: {
4190
+ fontFamily: "Nunito",
4191
+ fontSize: 16,
4192
+ fontWeight: 600,
4193
+ lineHeight: "16px",
4194
+ letterSpacing: "0.15px",
4195
+ "@media(max-width: 885px)": {
4196
+ fontSize: 17
4197
+ }
4198
+ },
4199
+ h5: {
4200
+ fontFamily: "Nunito",
4201
+ fontSize: 18,
4202
+ fontWeight: 600,
4203
+ letterSpacing: 0,
4204
+ lineHeight: "24px"
4205
+ },
4206
+ h4: {
4207
+ fontFamily: "Nunito",
4208
+ fontSize: 22,
4209
+ fontWeight: 600,
4210
+ lineHeight: "24px",
4211
+ letterSpacing: "0.25px"
4212
+ },
4213
+ h3: {
4214
+ fontFamily: "Nunito",
4215
+ fontSize: 28,
4216
+ fontWeight: 500,
4217
+ lineHeight: "32px",
4218
+ letterSpacing: 0
4219
+ },
4220
+ h2: {
4221
+ fontFamily: "Nunito",
4222
+ fontSize: 32,
4223
+ fontWeight: 400,
4224
+ lineHeight: "40px",
4225
+ letterSpacing: -0.5
4226
+ },
4227
+ h1: {
4228
+ fontFamily: "Nunito",
4229
+ fontSize: 40,
4230
+ fontWeight: 300,
4231
+ letterSpacing: -1.5,
4232
+ lineHeight: "48px"
4233
+ }
4234
+ };
4235
+
4236
+ // src/Theme/shadows.ts
4237
+ var shadows = [
4238
+ "none",
4239
+ "0px 1px 3px rgba(24, 39, 75, 0.12), 0px 1px 1px -1px rgba(24, 39, 75, 0.14), 0px 2px 1px -2px rgba(24, 39, 75, 0.2)",
4240
+ "0px 1px 5px rgba(24, 39, 75, 0.12), 0px 2px 2px rgba(24, 39, 75, 0.14), 0px 3px 1px -2px rgba(24, 39, 75, 0.2)",
4241
+ "0px 1px 8px rgba(24, 39, 75, 0.12), 0px 3px 4px rgba(24, 39, 75, 0.14), 0px 3px 3px -2px rgba(24, 39, 75, 0.2)",
4242
+ "0px 2px 4px -1px rgba(24, 39, 75, 0.2), 0px 4px 5px rgba(24, 39, 75, 0.14), 0px 1px 10px rgba(24, 39, 75, 0.12)",
4243
+ "0px 3px 5px -1px rgba(24, 39, 75, 0.2), 0px 5px 8px rgba(24, 39, 75, 0.14), 0px 1px 14px rgba(24, 39, 75, 0.12)",
4244
+ "0px 3px 5px -1px rgba(24, 39, 75, 0.2), 0px 6px 10px rgba(24, 39, 75, 0.14), 0px 1px 18px rgba(24, 39, 75, 0.12)",
4245
+ "0px 4px 5px -2px rgba(24, 39, 75, 0.2), 0px 7px 10px 1px rgba(24, 39, 75, 0.14), 0px 2px 16px 1px rgba(24, 39, 75, 0.12)",
4246
+ "0px 5px 5px -3px rgba(24, 39, 75, 0.2), 0px 8px 10px 1px rgba(24, 39, 75, 0.14), 0px 3px 14px 2px rgba(24, 39, 75, 0.12)",
4247
+ "0px 5px 6px -3px rgba(24, 39, 75, 0.2), 0px 9px 12px 1px rgba(24, 39, 75, 0.14), 0px 3px 16px 2px rgba(24, 39, 75, 0.12)",
4248
+ "0px 6px 6px -3px rgba(24, 39, 75, 0.2), 0px 10px 14px 1px rgba(24, 39, 75, 0.14), 0px 4px 18px 3px rgba(24, 39, 75, 0.12)",
4249
+ "0px 6px 7px -4px rgba(24, 39, 75, 0.2), 0px 11px 15px 1px rgba(24, 39, 75, 0.14), 0px 4px 20px 3px rgba(24, 39, 75, 0.12)",
4250
+ "0px 7px 8px -4px rgba(24, 39, 75, 0.2), 0px 12px 17px 2px rgba(24, 39, 75, 0.14), 0px 5px 22px 4px rgba(24, 39, 75, 0.12)",
4251
+ "0px 7px 8px -4px rgba(24, 39, 75, 0.2), 0px 13px 19px 2px rgba(24, 39, 75, 0.14), 0px 5px 24px 4px rgba(24, 39, 75, 0.12)",
4252
+ "0px 7px 9px -4px rgba(24, 39, 75, 0.2), 0px 14px 21px 2px rgba(24, 39, 75, 0.14), 0px 5px 26px 4px rgba(24, 39, 75, 0.12)",
4253
+ "0px 8px 9px -5px rgba(24, 39, 75, 0.2), 0px 15px 22px 2px rgba(24, 39, 75, 0.14), 0px 6px 28px 5px rgba(24, 39, 75, 0.12)",
4254
+ "0px 8px 10px -5px rgba(24, 39, 75, 0.2), 0px 16px 24px 2px rgba(24, 39, 75, 0.14), 0px 6px 30px 5px rgba(24, 39, 75, 0.12)",
4255
+ "0px 8px 11px -5px rgba(24, 39, 75, 0.2), 0px 17px 26px 2px rgba(24, 39, 75, 0.14), 0px 6px 32px 5px rgba(24, 39, 75, 0.12)",
4256
+ "0px 9px 11px -5px rgba(24, 39, 75, 0.2), 0px 18px 28px 2px rgba(24, 39, 75, 0.14), 0px 7px 34px 6px rgba(24, 39, 75, 0.12)",
4257
+ "0px 9px 12px -6px rgba(24, 39, 75, 0.2), 0px 19px 29px 2px rgba(24, 39, 75, 0.14), 0px 7px 36px 6px rgba(24, 39, 75, 0.12)",
4258
+ "0px 10px 13px -6px rgba(24, 39, 75, 0.2), 0px 20px 31px 3px rgba(24, 39, 75, 0.14), 0px 8px 38px 7px rgba(24, 39, 75, 0.12)",
4259
+ "0px 10px 13px -6px rgba(24, 39, 75, 0.2), 0px 21px 33px 3px rgba(24, 39, 75, 0.14), 0px 8px 40px 7px rgba(24, 39, 75, 0.12)",
4260
+ "0px 10px 14px -6px rgba(24, 39, 75, 0.2), 0px 22px 35px 3px rgba(24, 39, 75, 0.14), 0px 8px 42px 7px rgba(24, 39, 75, 0.12)",
4261
+ "0px 11px 14px -7px rgba(24, 39, 75, 0.2), 0px 23px 36px 3px rgba(24, 39, 75, 0.14), 0px 9px 44px 8px rgba(24, 39, 75, 0.12)",
4262
+ "0px 11px 15px -7px rgba(24, 39, 75, 0.2), 0px 24px 38px 3px rgba(24, 39, 75, 0.14), 0px 9px 46px 8px rgba(24, 39, 75, 0.12)"
4263
+ ];
4264
+
4265
+ // src/Theme/theme.ts
4266
+ var BasicTheme = {
4267
+ components,
4268
+ typography,
4269
+ spacing: 8,
4270
+ mixins,
4271
+ breakpoints,
4272
+ shadows
4273
+ };
4274
+ var ERPTheme = __spreadValues({
4275
+ palette: paletteERP
4276
+ }, BasicTheme);
4277
+ var ADPROTheme = __spreadValues({
4278
+ palette: paletteADPRO
4279
+ }, BasicTheme);
4280
+ var ADCTheme = __spreadValues({
4281
+ palette: paletteADC
4282
+ }, BasicTheme);
4283
+
4284
+ // src/Theme/index.ts
4285
+ var SincoTheme = createTheme(__spreadValues({}, ERPTheme));
4286
+ var AdproSincoTheme = createTheme(__spreadValues({}, ADPROTheme));
4287
+ var ADCSincoTheme = createTheme(__spreadValues({}, ADCTheme));
4288
+ export {
4289
+ ADCSincoTheme,
4290
+ AdproSincoTheme,
4291
+ EmptyState,
4292
+ FooterAction,
4293
+ MultiSelect,
4294
+ PageHeader,
4295
+ SCAutocomplete,
4296
+ SCCalendarSwipeable,
4297
+ SCDataGrid,
4298
+ SCDataGridInitial,
4299
+ SCDateRange,
4300
+ SCDialog,
4301
+ SCDrawer,
4302
+ SCMenu,
4303
+ SCModal,
4304
+ SCSelect,
4305
+ SCTabs,
4306
+ SCTextArea,
4307
+ SCTextField,
4308
+ SCToastNotification,
4309
+ SincoTheme,
4310
+ ToastProgress,
4311
+ capitalize,
4312
+ getButtonColor,
4313
+ getIcon,
4314
+ getIconComponent2 as getIconComponent,
4315
+ getIconMultiSelect,
4316
+ getModalColor,
4317
+ modalStateConfig,
4318
+ useFilteredItems,
4319
+ useMultiSelectHandlers,
4320
+ useProgress
4321
+ };
4322
+ //# sourceMappingURL=index.js.map