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