@m4l/components 9.1.130 → 9.1.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Chip/types.d.ts +2 -2
- package/components/DynamicSort/DynamicSort.d.ts +4 -1
- package/components/DynamicSort/DynamicSort.styles.js +91 -126
- package/components/DynamicSort/constants.d.ts +0 -1
- package/components/DynamicSort/constants.js +0 -1
- package/components/DynamicSort/icons.d.ts +2 -0
- package/components/DynamicSort/icons.js +6 -0
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +23 -43
- package/components/DynamicSort/slots/DynamicSortSlots.js +30 -57
- package/components/DynamicSort/slots/SlotsEnum.d.ts +2 -9
- package/components/DynamicSort/slots/SlotsEnum.js +1 -8
- package/components/DynamicSort/store/DynamicSortContext.d.ts +3 -3
- package/components/DynamicSort/store/DynamicSortContext.js +10 -4
- package/components/DynamicSort/store/DynamicSortStore.d.ts +1 -177
- package/components/DynamicSort/store/DynamicSortStore.js +10 -1
- package/components/DynamicSort/store/type.d.ts +186 -0
- package/components/DynamicSort/store/useDynamicSortStore.d.ts +2 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +18 -20
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +2 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +4 -4
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +14 -2
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +4 -3
- package/components/DynamicSort/subcomponents/DynamicSortBase/useDynamicSortBase.d.ts +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/useDynamicSortBase.js +2 -1
- package/components/DynamicSort/subcomponents/FieldTypes/DataTypeComponent.d.ts +1 -1
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.d.ts +8 -8
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.js +11 -14
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +16 -12
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +1 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +1 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +8 -10
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +9 -8
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +8 -6
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +8 -9
- package/components/DynamicSort/tests/DynamicSort.test.d.ts +1 -0
- package/components/DynamicSort/types.d.ts +9 -2
- package/package.json +1 -1
- package/components/DynamicSort/DynamicSort.stories.d.ts +0 -21
- package/components/DynamicSort/subcomponents/InputSort/InputSortSkeleton.d.ts +0 -5
- package/components/DynamicSort/subcomponents/InputSort/InputSortSkeleton.js +0 -19
- package/components/DynamicSort/subcomponents/SortActions/SortActionsSkeleton.d.ts +0 -5
- package/components/DynamicSort/subcomponents/SortActions/SortActionsSkeleton.js +0 -12
|
@@ -29,7 +29,7 @@ export interface ChipProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Defines the variant of the `Chip` (default 'contained').
|
|
31
31
|
*/
|
|
32
|
-
variant?: ChipVariants;
|
|
32
|
+
variant?: ChipVariants | string;
|
|
33
33
|
/**
|
|
34
34
|
* Defines the color of the `Chip`.
|
|
35
35
|
*/
|
|
@@ -49,7 +49,7 @@ export interface ChipProps {
|
|
|
49
49
|
/**
|
|
50
50
|
* Function to be executed when the `Chip` is clicked.
|
|
51
51
|
*/
|
|
52
|
-
onClick?: () => void;
|
|
52
|
+
onClick?: (() => void) | ((event: any) => void);
|
|
53
53
|
/**
|
|
54
54
|
* Props for the close icon button.
|
|
55
55
|
*/
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DynamicSortProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* El DynamicSort es un componente que permite ordenar de manera acendentente o descendente una lista de elementos.
|
|
4
|
+
*
|
|
5
|
+
* ### Dependecias:
|
|
6
|
+
*- **`useFlagsPresent:`** Hook que permite verificar si una lista de flags se encuentran presentes.
|
|
4
7
|
*/
|
|
5
8
|
export declare function DynamicSort(props: DynamicSortProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { alpha } from "@mui/material";
|
|
2
1
|
import { c as containerQuery } from "../../utils/containerQuery.js";
|
|
2
|
+
import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
|
|
3
|
+
import { a as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
4
|
const CONTAINER_QUERY_NAME = "dynamic";
|
|
4
5
|
const dynamicSortStyles = {
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Root: Estilos del contenedor principal del componente.
|
|
8
|
+
*/
|
|
9
|
+
root: () => ({
|
|
6
10
|
containerName: CONTAINER_QUERY_NAME,
|
|
7
11
|
containerType: "inline-size",
|
|
8
12
|
width: "100%",
|
|
9
13
|
height: "auto",
|
|
10
14
|
padding: 0
|
|
11
|
-
},
|
|
15
|
+
}),
|
|
12
16
|
/**
|
|
13
|
-
*
|
|
17
|
+
* innerContainer: Estilos del contenedor interno del componente.
|
|
14
18
|
*/
|
|
15
19
|
innerContainer: ({ theme, ownerState }) => ({
|
|
16
20
|
display: "grid",
|
|
@@ -39,15 +43,27 @@ const dynamicSortStyles = {
|
|
|
39
43
|
} : {}
|
|
40
44
|
}),
|
|
41
45
|
/**
|
|
42
|
-
*
|
|
46
|
+
* inputSort: Estilos del contenedor del campo de entrada de ordenamiento.
|
|
43
47
|
*/
|
|
44
|
-
inputSort: ({ theme }) => ({
|
|
48
|
+
inputSort: ({ theme, ownerState }) => ({
|
|
45
49
|
gridArea: "input-sort",
|
|
46
50
|
display: "flex",
|
|
47
51
|
flexDirection: "row",
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
53
|
+
paddingRight: theme.vars.size.baseSpacings.sp1,
|
|
50
54
|
height: "100%",
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
...getSizeStyles(
|
|
57
|
+
theme,
|
|
58
|
+
theme.generalSettings.isMobile,
|
|
59
|
+
ownerState.size || "medium",
|
|
60
|
+
"container",
|
|
61
|
+
(height) => ({
|
|
62
|
+
height,
|
|
63
|
+
minHeight: height,
|
|
64
|
+
maxHeight: height
|
|
65
|
+
})
|
|
66
|
+
),
|
|
51
67
|
maxWidth: "135px",
|
|
52
68
|
width: "100%",
|
|
53
69
|
alignItems: "center",
|
|
@@ -56,26 +72,35 @@ const dynamicSortStyles = {
|
|
|
56
72
|
borderRight: "1px solid",
|
|
57
73
|
borderColor: theme.vars.palette.border?.default,
|
|
58
74
|
[containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
|
|
59
|
-
height: "32px",
|
|
60
|
-
width: "100%",
|
|
61
|
-
maxWidth: "100%",
|
|
62
75
|
borderRight: "none"
|
|
63
|
-
},
|
|
64
|
-
[theme.breakpoints.down("sm")]: {
|
|
65
|
-
height: "44px",
|
|
66
|
-
justifyContent: "center"
|
|
67
76
|
}
|
|
68
77
|
}),
|
|
69
78
|
/**
|
|
70
|
-
*
|
|
79
|
+
* inputSortInput: Estilos del campo de entrada de ordenamiento.
|
|
71
80
|
*/
|
|
72
|
-
inputSortInput: ({ theme }) => ({
|
|
73
|
-
...
|
|
81
|
+
inputSortInput: ({ theme, ownerState }) => ({
|
|
82
|
+
...getSizeStyles(
|
|
83
|
+
theme,
|
|
84
|
+
theme.generalSettings.isMobile,
|
|
85
|
+
ownerState.size || "medium",
|
|
86
|
+
"action",
|
|
87
|
+
(height) => ({
|
|
88
|
+
height,
|
|
89
|
+
minHeight: height,
|
|
90
|
+
maxHeight: height
|
|
91
|
+
})
|
|
92
|
+
),
|
|
93
|
+
...getTypographyStyles(
|
|
94
|
+
theme.generalSettings.isMobile,
|
|
95
|
+
ownerState.size || "medium",
|
|
96
|
+
"body"
|
|
97
|
+
),
|
|
74
98
|
background: theme.vars.palette.background.default,
|
|
75
99
|
color: theme.vars.palette.text.secondary,
|
|
76
|
-
border:
|
|
100
|
+
border: 0,
|
|
77
101
|
borderColor: "transparent",
|
|
78
|
-
|
|
102
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
103
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
79
104
|
width: "100%",
|
|
80
105
|
height: "100%",
|
|
81
106
|
"&::placeholder": {
|
|
@@ -96,19 +121,19 @@ const dynamicSortStyles = {
|
|
|
96
121
|
}),
|
|
97
122
|
inputSortIcon: {},
|
|
98
123
|
/**
|
|
99
|
-
*
|
|
124
|
+
* appliedSorts: Estilos del contenedor de los campos de ordenamiento aplicados.
|
|
100
125
|
*/
|
|
101
126
|
appliedSorts: ({ theme }) => ({
|
|
102
127
|
gridArea: "applied-sorts",
|
|
103
128
|
width: "100%",
|
|
104
129
|
height: "fit-content",
|
|
130
|
+
overflow: "hidden",
|
|
105
131
|
paddingLeft: theme.spacing(1),
|
|
106
132
|
borderLeft: "none",
|
|
107
133
|
margin: "0px",
|
|
108
134
|
padding: "0px 4px",
|
|
109
135
|
[containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
|
|
110
136
|
height: "auto",
|
|
111
|
-
padding: "4px",
|
|
112
137
|
display: "flex",
|
|
113
138
|
borderTop: "1px solid ",
|
|
114
139
|
borderColor: theme.vars.palette.border?.secondary,
|
|
@@ -118,7 +143,7 @@ const dynamicSortStyles = {
|
|
|
118
143
|
}
|
|
119
144
|
}),
|
|
120
145
|
/**
|
|
121
|
-
*
|
|
146
|
+
* appliedSortInnerContainer: Estilos del contenedor interno de los campos de ordenamiento aplicados.
|
|
122
147
|
*/
|
|
123
148
|
appliedSortInnerContainer: ({ theme }) => ({
|
|
124
149
|
padding: "2px",
|
|
@@ -141,107 +166,48 @@ const dynamicSortStyles = {
|
|
|
141
166
|
}
|
|
142
167
|
}),
|
|
143
168
|
/**
|
|
144
|
-
*
|
|
169
|
+
* appliedSortChip: Estilos del chip de ordenamiento aplicado.
|
|
145
170
|
*/
|
|
146
171
|
appliedSortChip: ({ theme }) => ({
|
|
147
|
-
|
|
148
|
-
justifyContent: "center",
|
|
149
|
-
alignItems: "center",
|
|
150
|
-
overflow: "visible",
|
|
151
|
-
width: "auto",
|
|
152
|
-
height: "24px",
|
|
153
|
-
minHeight: theme.spacing(3),
|
|
154
|
-
paddingLeft: theme.spacing(1),
|
|
155
|
-
borderColor: alpha(`${theme.colorSchemes.finalTheme.palette.divider}`, 0.1),
|
|
156
|
-
border: "none",
|
|
157
|
-
borderRadius: "4px",
|
|
158
|
-
backgroundColor: theme.vars.palette.background?.surface,
|
|
159
|
-
color: theme.vars.palette.text.secondary,
|
|
160
|
-
...theme.typography.body,
|
|
161
|
-
[theme.breakpoints.down("sm")]: {
|
|
162
|
-
height: "fit-content"
|
|
163
|
-
}
|
|
164
|
-
}),
|
|
165
|
-
appliedSortChipIcon: {},
|
|
166
|
-
/**
|
|
167
|
-
* TODO: Documentar
|
|
168
|
-
*/
|
|
169
|
-
appliedSortChipInfo: ({ theme }) => ({
|
|
170
|
-
...theme.typography.body2,
|
|
171
|
-
display: "flex",
|
|
172
|
-
justifyContent: "center",
|
|
173
|
-
alignItems: "center",
|
|
174
|
-
width: "auto",
|
|
175
|
-
height: "100%",
|
|
176
|
-
marginRight: theme.spacing(1),
|
|
177
|
-
marginLeft: theme.spacing(1),
|
|
178
|
-
whiteSpace: "nowrap",
|
|
179
|
-
border: "none",
|
|
180
|
-
backgroundColor: "transparent"
|
|
181
|
-
}),
|
|
182
|
-
/**
|
|
183
|
-
* TODO: Documentar
|
|
184
|
-
*/
|
|
185
|
-
appliedSortChipInfoFieldName: ({ theme }) => ({
|
|
186
|
-
...theme.typography.subtitle2,
|
|
187
|
-
color: theme.vars.palette.text.secondary
|
|
188
|
-
}),
|
|
189
|
-
/**
|
|
190
|
-
* TODO: Documentar
|
|
191
|
-
*/
|
|
192
|
-
appliedSortChipInfoOperator: ({ theme }) => ({
|
|
193
|
-
...theme.typography.body2,
|
|
194
|
-
marginLeft: theme.spacing(1.5),
|
|
195
|
-
fontStyle: "italic",
|
|
196
|
-
color: theme.vars.palette.text.secondary
|
|
197
|
-
}),
|
|
198
|
-
/**
|
|
199
|
-
* TODO: Documentar
|
|
200
|
-
*/
|
|
201
|
-
appliedSortChipInfoOperands: ({ theme }) => ({
|
|
202
|
-
...theme.typography.body2,
|
|
203
|
-
marginLeft: theme.spacing(1.5),
|
|
172
|
+
backgroundColor: theme.vars.palette.chips?.defaultContained.backgroundColor,
|
|
204
173
|
color: theme.vars.palette.text.secondary
|
|
205
174
|
}),
|
|
206
|
-
appliedSortChipRemoveButton: {},
|
|
207
175
|
/**
|
|
208
|
-
*
|
|
176
|
+
* actions: Estilos del contenedor de los botones de acción.
|
|
209
177
|
*/
|
|
210
178
|
actions: ({ theme }) => ({
|
|
179
|
+
overflow: "hidden",
|
|
211
180
|
gridArea: "actions-sort",
|
|
212
181
|
display: "flex",
|
|
213
182
|
flexDirection: "row",
|
|
214
|
-
gap: "
|
|
215
|
-
padding:
|
|
183
|
+
gap: theme.vars.size.baseSpacings["sp0-5"],
|
|
184
|
+
padding: theme.vars.size.baseSpacings.sp1,
|
|
216
185
|
height: "100%",
|
|
217
186
|
alignItems: "center",
|
|
218
|
-
borderTopRightRadius:
|
|
219
|
-
borderBottomRightRadius:
|
|
220
|
-
borderLeft:
|
|
187
|
+
borderTopRightRadius: theme.vars.size.borderRadius.r1,
|
|
188
|
+
borderBottomRightRadius: theme.vars.size.borderRadius.r1,
|
|
189
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
221
190
|
borderColor: theme.vars.palette.border?.default
|
|
222
191
|
}),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
justifyContent: "center",
|
|
226
|
-
alignItems: "center",
|
|
227
|
-
width: "24px",
|
|
228
|
-
height: "24px"
|
|
192
|
+
actionsClearButton: {
|
|
193
|
+
visibility: "visible"
|
|
229
194
|
},
|
|
230
|
-
actionsClearButton: {},
|
|
231
195
|
/**
|
|
232
|
-
*
|
|
196
|
+
* actionsSubmitButton: Estilos del botón de acción de envío de formulario.
|
|
233
197
|
*/
|
|
234
198
|
actionsSubmitButton: ({ theme, ownerState }) => ({
|
|
235
|
-
...ownerState.isValid === false ? { border: `1px dashed ${theme.vars.palette.error.main}` } : {
|
|
199
|
+
...ownerState.isValid === false ? { border: `1px dashed ${theme.vars.palette.error.main}` } : {
|
|
200
|
+
visibility: "visible"
|
|
201
|
+
}
|
|
236
202
|
}),
|
|
237
203
|
/**
|
|
238
|
-
*
|
|
204
|
+
* popoverMenu: Estilos del menú emergente.
|
|
239
205
|
*/
|
|
240
206
|
popoverMenu: ({ theme }) => ({
|
|
241
207
|
"& .MuiPaper-root": {
|
|
242
208
|
display: "flex",
|
|
243
209
|
flexDirection: "column",
|
|
244
|
-
padding: "8px !important",
|
|
210
|
+
padding: "8px 0 !important",
|
|
245
211
|
gap: "4px",
|
|
246
212
|
borderRadius: "6px",
|
|
247
213
|
[theme.breakpoints.down("md")]: {
|
|
@@ -252,31 +218,10 @@ const dynamicSortStyles = {
|
|
|
252
218
|
}
|
|
253
219
|
}
|
|
254
220
|
}),
|
|
255
|
-
|
|
256
|
-
* TODO: Documentar
|
|
257
|
-
*/
|
|
258
|
-
popoverMenuItem: ({ theme }) => ({
|
|
259
|
-
paddingLeft: "4px",
|
|
260
|
-
paddingRight: "4px",
|
|
261
|
-
borderRadius: "4px",
|
|
262
|
-
"&:hover": {
|
|
263
|
-
...theme.typography.body,
|
|
264
|
-
color: theme.vars.palette.primary?.hover,
|
|
265
|
-
background: theme.vars.palette.background?.surface,
|
|
266
|
-
borderRadius: "4px",
|
|
267
|
-
padding: "4px 12px 4px 8px"
|
|
268
|
-
}
|
|
269
|
-
}),
|
|
270
|
-
/**
|
|
271
|
-
* TODO: Documentar
|
|
272
|
-
*/
|
|
273
|
-
popoverMenuItemLabel: ({ theme }) => ({
|
|
274
|
-
...theme.typography.body,
|
|
275
|
-
color: theme.vars.palette.text.primary
|
|
276
|
-
}),
|
|
221
|
+
popoverMenuItem: {},
|
|
277
222
|
popoverMenuItemIcon: {},
|
|
278
223
|
/**
|
|
279
|
-
*
|
|
224
|
+
* popoverSort: Estilos del menú emergente de ordenamiento.
|
|
280
225
|
*/
|
|
281
226
|
popoverSort: ({ theme }) => ({
|
|
282
227
|
width: "auto",
|
|
@@ -299,7 +244,7 @@ const dynamicSortStyles = {
|
|
|
299
244
|
}
|
|
300
245
|
}),
|
|
301
246
|
/**
|
|
302
|
-
*
|
|
247
|
+
* popoverSortHeader: Estilos del encabezado del menú emergente de ordenamiento.
|
|
303
248
|
*/
|
|
304
249
|
popoverSortHeader: ({ theme }) => ({
|
|
305
250
|
backgroundColor: theme.vars.palette.background?.surface,
|
|
@@ -317,14 +262,14 @@ const dynamicSortStyles = {
|
|
|
317
262
|
}),
|
|
318
263
|
popoverSortHeaderIcon: {},
|
|
319
264
|
/**
|
|
320
|
-
*
|
|
265
|
+
* popoverSortHeaderTitle: Estilos del título del menú emergente de ordenamiento.
|
|
321
266
|
*/
|
|
322
267
|
popoverSortHeaderTitle: ({ theme }) => ({
|
|
323
268
|
...theme.typography.paragraphDens,
|
|
324
269
|
color: theme.vars.palette.text.primary
|
|
325
270
|
}),
|
|
326
271
|
/**
|
|
327
|
-
*
|
|
272
|
+
* popoverSortContainerFields: Estilos del contenedor de campos del menú emergente de ordenamiento.
|
|
328
273
|
*/
|
|
329
274
|
popoverSortContainerFields: ({ theme }) => ({
|
|
330
275
|
height: "fit-content",
|
|
@@ -341,7 +286,7 @@ const dynamicSortStyles = {
|
|
|
341
286
|
}
|
|
342
287
|
}),
|
|
343
288
|
/**
|
|
344
|
-
*
|
|
289
|
+
* popoverSortActions: Estilos del contenedor de acciones del menú emergente de ordenamiento.
|
|
345
290
|
*/
|
|
346
291
|
popoverSortActions: ({ theme }) => ({
|
|
347
292
|
display: "flex",
|
|
@@ -358,6 +303,26 @@ const dynamicSortStyles = {
|
|
|
358
303
|
height: "36px"
|
|
359
304
|
}
|
|
360
305
|
}
|
|
306
|
+
}),
|
|
307
|
+
/**
|
|
308
|
+
* inputSortInputSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
|
|
309
|
+
*/
|
|
310
|
+
inputSortInputSkeleton: ({ theme, ownerState }) => ({
|
|
311
|
+
width: "100%",
|
|
312
|
+
minWidth: "80px",
|
|
313
|
+
marginLeft: theme.vars.size.baseSpacings.sp2,
|
|
314
|
+
marginRight: theme.vars.size.baseSpacings.sp2,
|
|
315
|
+
...getSizeStyles(
|
|
316
|
+
theme,
|
|
317
|
+
theme.generalSettings.isMobile,
|
|
318
|
+
ownerState.size || "medium",
|
|
319
|
+
"base",
|
|
320
|
+
(height) => ({
|
|
321
|
+
height,
|
|
322
|
+
minHeight: height,
|
|
323
|
+
maxHeight: height
|
|
324
|
+
})
|
|
325
|
+
)
|
|
361
326
|
})
|
|
362
327
|
};
|
|
363
328
|
export {
|
|
@@ -4,7 +4,6 @@ export declare const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons
|
|
|
4
4
|
export declare const ASSETS: {
|
|
5
5
|
readonly refresh: "restart.svg";
|
|
6
6
|
readonly sort: "sort.svg";
|
|
7
|
-
readonly close: "close.svg";
|
|
8
7
|
readonly list_bulleted: "list_bulleted.svg";
|
|
9
8
|
readonly clean: "clean.svg";
|
|
10
9
|
};
|