componentes-sinco 1.0.3-rc.1 → 1.0.4

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