@m4l/components 9.5.10 → 9.5.11-beta-pkg-670-dynamicfilter-mejoras.0
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 +4 -2
- package/components/Chip/types.d.ts.map +1 -1
- package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
- package/components/DynamicFilter/DynamicFilter.styles.js +282 -111
- package/components/DynamicFilter/dictionary.d.ts +2 -0
- package/components/DynamicFilter/dictionary.d.ts.map +1 -1
- package/components/DynamicFilter/dictionary.js +2 -0
- package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts +12 -0
- package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts.map +1 -0
- package/components/DynamicFilter/helpers/calculateVisibleChipsCount.js +16 -0
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +30 -0
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -0
- package/components/DynamicFilter/hooks/useChipsOverflow.js +68 -0
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +10 -1
- package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicFilter/slots/SlotsEnum.js +2 -2
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +27 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +101 -63
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts +4 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +18 -14
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts +3 -1
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +58 -8
- package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +9 -1
- package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.js +22 -14
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +10 -12
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +1 -1
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +10 -10
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +34 -31
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +2 -7
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +15 -22
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts +3 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +47 -45
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts +4 -4
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.js +46 -43
- package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.d.ts +9 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.d.ts.map +1 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.js +87 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/index.d.ts +2 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/index.d.ts.map +1 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/types.d.ts +13 -0
- package/components/DynamicFilter/subcomponents/OverflowPopover/types.d.ts.map +1 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +50 -46
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +25 -1
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +50 -27
- package/components/DynamicFilter/types.d.ts +21 -2
- package/components/DynamicFilter/types.d.ts.map +1 -1
- package/components/datagrids/Datagrid.styles.js +1 -1
- package/package.json +7 -7
- package/test/mocks/dictionary-mock.d.ts +1 -0
- package/test/mocks/dictionary-mock.d.ts.map +1 -1
|
@@ -24,9 +24,11 @@ export interface ChipProps {
|
|
|
24
24
|
*/
|
|
25
25
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
26
26
|
/**
|
|
27
|
-
* Text describing the `Chip`.
|
|
27
|
+
* Text describing the `Chip`. Accepts a plain string or a React node
|
|
28
|
+
* (for example a `Typography` element) when callers need to style parts
|
|
29
|
+
* of the label independently while keeping the chip's layout intact.
|
|
28
30
|
*/
|
|
29
|
-
label?: Maybe<string
|
|
31
|
+
label?: Maybe<string> | ReactNode;
|
|
30
32
|
/**
|
|
31
33
|
* Secondary text shown below the chip label.
|
|
32
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAG,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,MAAM,MAAM,YAAY,GAAI,WAAW,GAAG,UAAU,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAG,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,MAAM,MAAM,YAAY,GAAI,WAAW,GAAG,UAAU,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAE;QAAC,eAAe,EAAE,MAAM,CAAA;KAAC,CAAC;IAC3D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAC/C;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC,CAAC;IAClF;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACjH,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AACD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,SAAS,CAAC;AACnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,sBAAsB,CAAC,aAAa,EAAE,OAAO,kBAAkB,EAAE,KAAK,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/DynamicFilter.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"DynamicFilter.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/DynamicFilter.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,EAAE,mBAwdjC,CAAC"}
|
|
@@ -1,248 +1,284 @@
|
|
|
1
1
|
import { getTypographyStyles as e } from "../../utils/getTypographyStyles.js";
|
|
2
2
|
import { getSizeStyles as o } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
-
const
|
|
3
|
+
const n = "dynamic", p = {
|
|
4
4
|
/**
|
|
5
5
|
* root: Estilos del contenedor principal del componente.
|
|
6
6
|
*/
|
|
7
|
-
root: ({ theme:
|
|
8
|
-
containerName:
|
|
7
|
+
root: ({ theme: r, ownerState: a }) => ({
|
|
8
|
+
containerName: n,
|
|
9
9
|
containerType: "inline-size",
|
|
10
10
|
width: "100%",
|
|
11
11
|
height: "auto",
|
|
12
12
|
padding: 0,
|
|
13
13
|
...o(
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
r,
|
|
15
|
+
a?.size || "medium",
|
|
16
16
|
"container",
|
|
17
|
-
(
|
|
18
|
-
height:
|
|
19
|
-
maxHeight:
|
|
20
|
-
minHeight:
|
|
17
|
+
(i) => ({
|
|
18
|
+
height: i,
|
|
19
|
+
maxHeight: i,
|
|
20
|
+
minHeight: i
|
|
21
21
|
})
|
|
22
22
|
)
|
|
23
23
|
}),
|
|
24
24
|
/**
|
|
25
25
|
* innerContainer: Estilos del contenedor interno del componente.
|
|
26
26
|
*/
|
|
27
|
-
innerContainer: ({ theme:
|
|
27
|
+
innerContainer: ({ theme: r, ownerState: a }) => ({
|
|
28
28
|
display: "flex",
|
|
29
29
|
alignItems: "center",
|
|
30
30
|
justifyContent: "flex-start",
|
|
31
|
+
gap: r.vars.size.baseSpacings["sp1-5"],
|
|
31
32
|
width: "100%",
|
|
32
33
|
height: "fit-content",
|
|
33
|
-
borderRadius:
|
|
34
|
-
background:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
boxShadow:
|
|
39
|
-
}
|
|
34
|
+
borderRadius: r.vars.size.borderRadius.r2,
|
|
35
|
+
background: r.vars.palette.background.default,
|
|
36
|
+
// Keep the error outline when the filter is invalid; otherwise the
|
|
37
|
+
// container has no visible border per the latest design.
|
|
38
|
+
...!a?.isValid && {
|
|
39
|
+
boxShadow: `inset 0px 0px 0px 1px ${r.vars.palette.error.enabled}`
|
|
40
|
+
},
|
|
41
|
+
overflow: "hidden"
|
|
40
42
|
}),
|
|
41
43
|
/**
|
|
42
44
|
* inputFilter: Estilos del contenedor del campo de entrada de filtrado.
|
|
45
|
+
* Ahora se usa como header dentro del `PopoverMenuFields`, donde el icono
|
|
46
|
+
* queda a la izquierda y el input "Filtrar por" se alinea a continuación.
|
|
43
47
|
*/
|
|
44
|
-
inputFilter: ({ theme:
|
|
48
|
+
inputFilter: ({ theme: r, ownerState: a }) => ({
|
|
45
49
|
display: "flex",
|
|
46
50
|
flexDirection: "row",
|
|
47
|
-
paddingLeft:
|
|
48
|
-
paddingRight:
|
|
49
|
-
height: "100%",
|
|
51
|
+
paddingLeft: r.vars.size.baseSpacings.sp2,
|
|
52
|
+
paddingRight: r.vars.size.baseSpacings.sp1,
|
|
50
53
|
overflow: "hidden",
|
|
51
|
-
maxWidth: "120px",
|
|
52
54
|
width: "100%",
|
|
53
55
|
alignItems: "center",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
background: "#ffffff00",
|
|
56
|
+
borderRadius: r.vars.size.borderRadius["r1-5"],
|
|
57
|
+
backgroundColor: r.vars.palette.default.enabledOpacity,
|
|
57
58
|
...o(
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
r,
|
|
60
|
+
a?.size || "medium",
|
|
60
61
|
"container",
|
|
61
|
-
(
|
|
62
|
-
height:
|
|
62
|
+
(i) => ({
|
|
63
|
+
height: i
|
|
63
64
|
})
|
|
64
65
|
)
|
|
65
66
|
}),
|
|
67
|
+
/**
|
|
68
|
+
* inputFilterTriggerButton: IconButton que sustituye al input en el header
|
|
69
|
+
* principal. Al hacerle clic abre el `PopoverMenuFields`. Cuando el popover
|
|
70
|
+
* está abierto (`ownerState.selected`) se pinta con los mismos tokens que
|
|
71
|
+
* el chip "Más" activo — fondo `info.contained.backgroundColor` y border
|
|
72
|
+
* `info.semanticText` — para mantener consistencia visual.
|
|
73
|
+
*/
|
|
74
|
+
inputFilterTriggerButton: ({ theme: r, ownerState: a }) => ({
|
|
75
|
+
flexShrink: 0,
|
|
76
|
+
cursor: "pointer",
|
|
77
|
+
borderRadius: r.vars.size.borderRadius.r1,
|
|
78
|
+
...a?.selected && {
|
|
79
|
+
backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
|
|
80
|
+
border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
|
|
81
|
+
outline: "none !important",
|
|
82
|
+
"&:hover, &:focus, &:focus-visible": {
|
|
83
|
+
backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
|
|
84
|
+
border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
|
|
85
|
+
outline: "none !important"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
66
89
|
/**
|
|
67
90
|
* inputFilterInput: Estilos del campo de entrada de filtrado.
|
|
68
91
|
*/
|
|
69
|
-
inputFilterInput: ({ theme:
|
|
92
|
+
inputFilterInput: ({ theme: r, ownerState: a }) => ({
|
|
70
93
|
width: "100%",
|
|
71
94
|
background: "#ffffff00",
|
|
72
95
|
...o(
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
r,
|
|
97
|
+
a?.size || "medium",
|
|
75
98
|
"action",
|
|
76
|
-
(
|
|
77
|
-
height:
|
|
78
|
-
minHeight:
|
|
79
|
-
maxHeight:
|
|
99
|
+
(i) => ({
|
|
100
|
+
height: i,
|
|
101
|
+
minHeight: i,
|
|
102
|
+
maxHeight: i
|
|
80
103
|
})
|
|
81
104
|
),
|
|
82
105
|
fontFamily: "inherit",
|
|
83
106
|
...e(
|
|
84
|
-
|
|
85
|
-
|
|
107
|
+
r.generalSettings.isMobile,
|
|
108
|
+
a?.size || "medium",
|
|
86
109
|
"body"
|
|
87
110
|
),
|
|
88
|
-
color:
|
|
111
|
+
color: r.vars.palette.text.secondary,
|
|
89
112
|
border: 0,
|
|
90
113
|
borderColor: "transparent",
|
|
91
|
-
paddingLeft:
|
|
92
|
-
paddingRight:
|
|
114
|
+
paddingLeft: r.vars.size.baseSpacings.sp1,
|
|
115
|
+
paddingRight: r.vars.size.baseSpacings.sp1,
|
|
93
116
|
height: "100%",
|
|
94
117
|
"&::placeholder": {
|
|
95
|
-
color:
|
|
118
|
+
color: r.vars.palette.text.secondary
|
|
96
119
|
},
|
|
97
120
|
"&:focus-visible": {
|
|
98
|
-
color:
|
|
121
|
+
color: r.vars.palette.text.secondary,
|
|
99
122
|
border: "unset",
|
|
100
|
-
borderColor:
|
|
101
|
-
BorderRadius:
|
|
123
|
+
borderColor: r.vars.palette.primary.opacity,
|
|
124
|
+
BorderRadius: r.vars.size.borderRadius["r0-5"],
|
|
102
125
|
outline: "none!important"
|
|
103
126
|
}
|
|
104
127
|
}),
|
|
105
128
|
/**
|
|
106
129
|
* appliedFilters: Estilos del contenedor de los filtros aplicados.
|
|
107
130
|
*/
|
|
108
|
-
appliedFilters: ({ theme:
|
|
131
|
+
appliedFilters: ({ theme: r, ownerState: a }) => ({
|
|
109
132
|
width: "100%",
|
|
110
133
|
height: "fit-content",
|
|
111
134
|
display: "flex",
|
|
112
135
|
alignItems: "center",
|
|
113
136
|
borderLeft: "none",
|
|
114
137
|
margin: "0px",
|
|
115
|
-
padding:
|
|
138
|
+
padding: "0px",
|
|
116
139
|
flex: 1,
|
|
117
140
|
overflow: "hidden",
|
|
118
141
|
...o(
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
r,
|
|
143
|
+
a?.size || "medium",
|
|
121
144
|
"container",
|
|
122
|
-
(
|
|
123
|
-
height:
|
|
124
|
-
maxHeight:
|
|
125
|
-
minHeight:
|
|
145
|
+
(i) => ({
|
|
146
|
+
height: i,
|
|
147
|
+
maxHeight: i,
|
|
148
|
+
minHeight: i
|
|
126
149
|
})
|
|
127
150
|
)
|
|
128
151
|
}),
|
|
129
152
|
/**
|
|
130
153
|
* appliedFilterInnerContainer: Estilos del contenedor interno de los filtros aplicados.
|
|
131
154
|
*/
|
|
132
|
-
appliedFilterInnerContainer: ({ theme:
|
|
133
|
-
padding:
|
|
134
|
-
gap:
|
|
155
|
+
appliedFilterInnerContainer: ({ theme: r, ownerState: a }) => ({
|
|
156
|
+
padding: r.vars.size.baseSpacings["sp0-5"],
|
|
157
|
+
gap: r.vars.size.baseSpacings.sp1,
|
|
135
158
|
height: "fit-content",
|
|
136
159
|
display: "flex",
|
|
137
160
|
flexWrap: "nowrap",
|
|
138
|
-
|
|
161
|
+
// Only take the space the visible chips need (do not grow). Shrinks
|
|
162
|
+
// when content overflows to leave room for the sibling "More" chip.
|
|
163
|
+
// The "More" chip then sits flush against the last visible chip with
|
|
164
|
+
// any leftover space appearing AFTER it.
|
|
165
|
+
flex: "0 1 auto",
|
|
166
|
+
minWidth: 0,
|
|
139
167
|
justifyContent: "flex-start",
|
|
140
168
|
alignItems: "center",
|
|
141
|
-
overflow: "
|
|
169
|
+
overflow: "hidden",
|
|
142
170
|
position: "relative",
|
|
143
171
|
"& .M4LChip-root": {
|
|
144
|
-
borderRadius:
|
|
172
|
+
borderRadius: r.vars.size.borderRadius.r1,
|
|
145
173
|
...o(
|
|
146
|
-
|
|
147
|
-
|
|
174
|
+
r,
|
|
175
|
+
a?.size || "medium",
|
|
148
176
|
"action",
|
|
149
|
-
(
|
|
150
|
-
height:
|
|
177
|
+
(i) => ({
|
|
178
|
+
height: i
|
|
151
179
|
})
|
|
152
180
|
),
|
|
153
181
|
"& .M4LIconButton-styledMUIIconButton:hover": {
|
|
154
|
-
backgroundColor: `${
|
|
182
|
+
backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
|
|
155
183
|
"& .M4LIcon-icon": {
|
|
156
|
-
backgroundColor: `${
|
|
184
|
+
backgroundColor: `${r.vars.palette.chips.error.contained.backgroundColorTone} !important`
|
|
157
185
|
}
|
|
158
186
|
}
|
|
159
187
|
}
|
|
160
188
|
}),
|
|
189
|
+
/**
|
|
190
|
+
* emptyStateLabel: Texto mostrado dentro de `AppliedFilters` cuando no
|
|
191
|
+
* hay filtros aplicados ("Sin filtros aplicados"). Usa `text.secondary`
|
|
192
|
+
* para desaturar el mensaje y no competir visualmente con los chips.
|
|
193
|
+
*/
|
|
194
|
+
emptyStateLabel: ({ theme: r }) => ({
|
|
195
|
+
display: "inline-flex",
|
|
196
|
+
alignItems: "center",
|
|
197
|
+
color: r.vars.palette.text.secondary
|
|
198
|
+
}),
|
|
161
199
|
/**
|
|
162
200
|
* actions: Estilos del contenedor de los botones de acción.
|
|
163
201
|
*/
|
|
164
|
-
actions: ({ theme:
|
|
202
|
+
actions: ({ theme: r, ownerState: a }) => ({
|
|
165
203
|
gridArea: "actions-filter",
|
|
166
204
|
overflow: "hidden",
|
|
167
205
|
display: "flex",
|
|
168
206
|
flexDirection: "row",
|
|
169
|
-
gap:
|
|
170
|
-
padding:
|
|
207
|
+
gap: r.vars.size.baseSpacings["sp0-5"],
|
|
208
|
+
padding: r.vars.size.baseSpacings.sp1,
|
|
171
209
|
height: "100%",
|
|
172
210
|
alignItems: "center",
|
|
173
|
-
borderTopRightRadius:
|
|
174
|
-
borderBottomRightRadius:
|
|
175
|
-
|
|
176
|
-
...!r?.visibleRefresh && !r?.isDirty && {
|
|
211
|
+
borderTopRightRadius: r.vars.size.borderRadius.r1,
|
|
212
|
+
borderBottomRightRadius: r.vars.size.borderRadius.r1,
|
|
213
|
+
...!a?.visibleRefresh && !a?.isDirty && {
|
|
177
214
|
display: "none"
|
|
178
|
-
},
|
|
179
|
-
...r?.inEdition && r?.isValid && {
|
|
180
|
-
boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.border.main}`
|
|
181
|
-
},
|
|
182
|
-
...!r?.isValid && {
|
|
183
|
-
boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.error.enabled}`
|
|
184
215
|
}
|
|
185
216
|
}),
|
|
186
217
|
/**
|
|
187
218
|
* actionsClearButton: Estilos del botón de acción de limpiar.
|
|
188
219
|
*/
|
|
189
|
-
actionsClearButton: ({ theme:
|
|
220
|
+
actionsClearButton: ({ theme: r }) => ({
|
|
190
221
|
"&:hover": {
|
|
191
|
-
backgroundColor: `${
|
|
222
|
+
backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
|
|
223
|
+
// mask strategy icons: color via backgroundColor
|
|
192
224
|
"& .M4LIcon-icon": {
|
|
193
|
-
backgroundColor: `${
|
|
225
|
+
backgroundColor: `${r.vars.palette.error.semanticText} !important`
|
|
226
|
+
},
|
|
227
|
+
// component strategy icons (createSvgIcon): color via fill on SVG paths
|
|
228
|
+
"& .MuiSvgIcon-root svg path, & .MuiSvgIcon-root path": {
|
|
229
|
+
fill: `${r.vars.palette.error.semanticText} !important`
|
|
194
230
|
}
|
|
195
231
|
}
|
|
196
232
|
}),
|
|
197
233
|
/**
|
|
198
234
|
* actionsSubmitButton: Estilos del botón de acción de filtrado.
|
|
199
235
|
*/
|
|
200
|
-
actionsSubmitButton: ({ theme:
|
|
201
|
-
...
|
|
236
|
+
actionsSubmitButton: ({ theme: r, ownerState: a }) => ({
|
|
237
|
+
...a?.isDirty ? {
|
|
202
238
|
animation: "changeBgColor 0.9s ease infinite",
|
|
203
239
|
"& .M4LIcon-icon": {
|
|
204
|
-
background: `${
|
|
240
|
+
background: `${r.vars.palette.primary.main} !important`
|
|
205
241
|
}
|
|
206
242
|
} : null,
|
|
207
243
|
//Create and apply animation with change background color red and green
|
|
208
244
|
"@keyframes changeBgColor": {
|
|
209
245
|
"0%": {
|
|
210
|
-
background:
|
|
246
|
+
background: r.vars.palette.primary.hoverOpacity
|
|
211
247
|
},
|
|
212
248
|
"50%": {
|
|
213
|
-
background:
|
|
249
|
+
background: r.vars.palette.primary.activeOpacity
|
|
214
250
|
},
|
|
215
251
|
"100%": {
|
|
216
|
-
background:
|
|
252
|
+
background: r.vars.palette.primary.hoverOpacity
|
|
217
253
|
}
|
|
218
254
|
}
|
|
219
255
|
}),
|
|
220
256
|
/**
|
|
221
257
|
* popoverMenu: Estilos del menú emergente.
|
|
222
258
|
*/
|
|
223
|
-
popoverMenu: ({ theme:
|
|
259
|
+
popoverMenu: ({ theme: r }) => ({
|
|
224
260
|
"& .MuiPaper-root": {
|
|
225
261
|
display: "flex",
|
|
226
262
|
flexDirection: "column",
|
|
227
|
-
padding:
|
|
228
|
-
gap:
|
|
229
|
-
borderRadius:
|
|
230
|
-
backgroundColor:
|
|
263
|
+
padding: r.vars.size.baseSpacings.sp3,
|
|
264
|
+
gap: r.vars.size.baseSpacings.sp1,
|
|
265
|
+
borderRadius: r.vars.size.borderRadius.r1,
|
|
266
|
+
backgroundColor: r.vars.palette.background.default
|
|
231
267
|
}
|
|
232
268
|
}),
|
|
233
269
|
/**
|
|
234
270
|
* popoverFilter: Estilos del menú emergente de filtro.
|
|
235
271
|
*/
|
|
236
|
-
popoverFilter: ({ theme:
|
|
272
|
+
popoverFilter: ({ theme: r }) => ({
|
|
237
273
|
width: "auto",
|
|
238
274
|
"& .MuiPaper-root": {
|
|
239
|
-
borderRadius: `${
|
|
275
|
+
borderRadius: `${r.vars.size.borderRadius.r3}!important`,
|
|
240
276
|
padding: "0 !important",
|
|
241
277
|
minWidth: "220px",
|
|
242
278
|
maxWidth: "100%",
|
|
243
279
|
minHeight: "auto",
|
|
244
|
-
backgroundColor:
|
|
245
|
-
boxShadow:
|
|
280
|
+
backgroundColor: r.vars.palette.background.default,
|
|
281
|
+
boxShadow: r.customShadows?.z3,
|
|
246
282
|
"& .M4LPopover-arrowStyle": {
|
|
247
283
|
display: "none"
|
|
248
284
|
},
|
|
@@ -255,7 +291,7 @@ const s = "dynamic", d = {
|
|
|
255
291
|
overflow: "visible"
|
|
256
292
|
},
|
|
257
293
|
"& .M4LWindowBase-root": {
|
|
258
|
-
borderRadius: `${
|
|
294
|
+
borderRadius: `${r.vars.size.borderRadius.r3}!important`,
|
|
259
295
|
border: "unset!important",
|
|
260
296
|
"& .M4LWindowBase-headerWindowComponent": {
|
|
261
297
|
cursor: "unset"
|
|
@@ -266,37 +302,172 @@ const s = "dynamic", d = {
|
|
|
266
302
|
/**
|
|
267
303
|
* popoverFilterActions: Estilos del contenedor de acciones del menú emergente de filtro.
|
|
268
304
|
*/
|
|
269
|
-
popoverFilterActions: ({ theme:
|
|
270
|
-
paddingTop:
|
|
305
|
+
popoverFilterActions: ({ theme: r }) => ({
|
|
306
|
+
paddingTop: r.vars.size.baseSpacings.sp6
|
|
271
307
|
}),
|
|
272
308
|
/**
|
|
273
309
|
* inputSortInputSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
|
|
274
310
|
*/
|
|
275
|
-
inputFilterInputSkeleton: ({ theme:
|
|
311
|
+
inputFilterInputSkeleton: ({ theme: r, ownerState: a }) => ({
|
|
276
312
|
width: "100%",
|
|
277
313
|
minWidth: "80px",
|
|
278
|
-
marginLeft:
|
|
279
|
-
marginRight:
|
|
314
|
+
marginLeft: r.vars.size.baseSpacings.sp2,
|
|
315
|
+
marginRight: r.vars.size.baseSpacings.sp2,
|
|
280
316
|
...o(
|
|
281
|
-
|
|
282
|
-
|
|
317
|
+
r,
|
|
318
|
+
a?.size || "medium",
|
|
283
319
|
"base",
|
|
284
|
-
(
|
|
285
|
-
height:
|
|
286
|
-
minHeight:
|
|
287
|
-
maxHeight:
|
|
320
|
+
(i) => ({
|
|
321
|
+
height: i,
|
|
322
|
+
minHeight: i,
|
|
323
|
+
maxHeight: i
|
|
288
324
|
})
|
|
289
325
|
)
|
|
290
326
|
}),
|
|
291
327
|
/**
|
|
292
328
|
* popoverFilterContainerFields: Estilos del contenedor de los campos del menú emergente de filtro.
|
|
293
329
|
*/
|
|
294
|
-
popoverFilterContainerFields: ({ theme:
|
|
330
|
+
popoverFilterContainerFields: ({ theme: r }) => ({
|
|
331
|
+
display: "flex",
|
|
332
|
+
flexDirection: "column",
|
|
333
|
+
gap: r.vars.size.baseSpacings.sp3
|
|
334
|
+
}),
|
|
335
|
+
/**
|
|
336
|
+
* chipWrapper: Wrapper for each chip used for overflow measurement.
|
|
337
|
+
*/
|
|
338
|
+
chipWrapper: ({ theme: r, ownerState: a }) => ({
|
|
339
|
+
display: "inline-flex",
|
|
340
|
+
flexShrink: 0,
|
|
341
|
+
...a?.isWarning && {
|
|
342
|
+
"@keyframes m4lDynamicFilterWarningPulse": {
|
|
343
|
+
"0%, 100%": {
|
|
344
|
+
backgroundColor: r.vars.palette.chips.warning.contained.backgroundColor
|
|
345
|
+
},
|
|
346
|
+
"50%": {
|
|
347
|
+
backgroundColor: r.vars.palette.chips.warning.contained.backgroundHover
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
'& .MuiChip-root, & [class*="M4LChip-root"]': {
|
|
351
|
+
animation: "m4lDynamicFilterWarningPulse 1.6s ease-in-out infinite"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}),
|
|
355
|
+
/**
|
|
356
|
+
* overflowMoreChip: Styles for the "More (N)..." chip button that appears when filters overflow.
|
|
357
|
+
*/
|
|
358
|
+
overflowMoreChip: ({ theme: r, ownerState: a }) => ({
|
|
359
|
+
flexShrink: 0,
|
|
360
|
+
cursor: "pointer",
|
|
361
|
+
borderRadius: r.vars.size.borderRadius.r1,
|
|
362
|
+
...o(
|
|
363
|
+
r,
|
|
364
|
+
a?.size || "medium",
|
|
365
|
+
"action",
|
|
366
|
+
(i) => ({
|
|
367
|
+
height: i
|
|
368
|
+
})
|
|
369
|
+
),
|
|
370
|
+
// While the overflow popover is open, lock the chip to the info palette's
|
|
371
|
+
// background and add the container border in `info.semanticText` so the
|
|
372
|
+
// chip visually stays active regardless of hover/focus transitions.
|
|
373
|
+
...a?.selected && {
|
|
374
|
+
backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
|
|
375
|
+
border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
|
|
376
|
+
outline: "none !important",
|
|
377
|
+
"&:hover, &:focus, &:focus-visible": {
|
|
378
|
+
backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
|
|
379
|
+
border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
|
|
380
|
+
outline: "none !important"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}),
|
|
384
|
+
/**
|
|
385
|
+
* overflowPopover: Styles for the popover that shows hidden overflow filters.
|
|
386
|
+
*/
|
|
387
|
+
overflowPopover: ({ theme: r }) => ({
|
|
388
|
+
"& .MuiPaper-root": {
|
|
389
|
+
display: "flex",
|
|
390
|
+
flexDirection: "column",
|
|
391
|
+
padding: `${r.vars.size.baseSpacings.sp3} ${r.vars.size.baseSpacings.sp2}`,
|
|
392
|
+
gap: r.vars.size.baseSpacings.sp1,
|
|
393
|
+
borderRadius: r.vars.size.borderRadius.r2,
|
|
394
|
+
backgroundColor: r.vars.palette.background.default,
|
|
395
|
+
boxShadow: r.customShadows?.z3,
|
|
396
|
+
width: "280px"
|
|
397
|
+
}
|
|
398
|
+
}),
|
|
399
|
+
/**
|
|
400
|
+
* overflowPopoverList: Styles for the list container inside the overflow popover.
|
|
401
|
+
*/
|
|
402
|
+
overflowPopoverList: ({ theme: r }) => ({
|
|
295
403
|
display: "flex",
|
|
296
404
|
flexDirection: "column",
|
|
297
|
-
gap:
|
|
405
|
+
gap: r.vars.size.baseSpacings.sp2
|
|
406
|
+
}),
|
|
407
|
+
/**
|
|
408
|
+
* overflowPopoverItem: Styles for each filter item inside the overflow popover.
|
|
409
|
+
* Row layout: icon | text column | close button, all vertically centered.
|
|
410
|
+
*/
|
|
411
|
+
overflowPopoverItem: ({ theme: r, ownerState: a }) => ({
|
|
412
|
+
display: "flex",
|
|
413
|
+
alignItems: "center",
|
|
414
|
+
alignSelf: "stretch",
|
|
415
|
+
gap: r.vars.size.baseSpacings.sp2,
|
|
416
|
+
padding: r.vars.size.baseSpacings.sp2,
|
|
417
|
+
borderBottom: `1px solid ${r.vars.palette.border.disabled}`,
|
|
418
|
+
background: r.vars.palette.background.default,
|
|
419
|
+
borderRadius: r.vars.size.borderRadius["r1-5"],
|
|
420
|
+
cursor: "pointer",
|
|
421
|
+
transition: "background-color 0.3s ease",
|
|
422
|
+
"&:hover": {
|
|
423
|
+
backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
|
|
424
|
+
},
|
|
425
|
+
...a?.selected && {
|
|
426
|
+
backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
|
|
427
|
+
},
|
|
428
|
+
"&:last-child": {
|
|
429
|
+
borderBottom: "none"
|
|
430
|
+
}
|
|
431
|
+
}),
|
|
432
|
+
/**
|
|
433
|
+
* overflowPopoverItemHeader: Column container for label and value text.
|
|
434
|
+
*/
|
|
435
|
+
overflowPopoverItemHeader: ({ theme: r }) => ({
|
|
436
|
+
display: "flex",
|
|
437
|
+
flexDirection: "row",
|
|
438
|
+
flexWrap: "wrap",
|
|
439
|
+
alignItems: "center",
|
|
440
|
+
flex: 1,
|
|
441
|
+
minWidth: 0,
|
|
442
|
+
rowGap: r.vars.size.baseSpacings["sp0-5"],
|
|
443
|
+
columnGap: r.vars.size.baseSpacings.sp1,
|
|
444
|
+
// The label occupies the full first row so the value chips wrap below it.
|
|
445
|
+
"& > span:first-of-type": {
|
|
446
|
+
flexBasis: "100%"
|
|
447
|
+
},
|
|
448
|
+
"& .M4LChip-root": {
|
|
449
|
+
height: "auto",
|
|
450
|
+
minHeight: "auto",
|
|
451
|
+
maxWidth: "100%"
|
|
452
|
+
},
|
|
453
|
+
"& .M4LChip-root .M4LTypography-root": {
|
|
454
|
+
whiteSpace: "normal",
|
|
455
|
+
wordBreak: "break-word",
|
|
456
|
+
overflow: "visible",
|
|
457
|
+
textOverflow: "clip"
|
|
458
|
+
}
|
|
459
|
+
}),
|
|
460
|
+
/**
|
|
461
|
+
* overflowPopoverItemLabel: Label text for the filter field name inside the overflow item.
|
|
462
|
+
*/
|
|
463
|
+
overflowPopoverItemLabel: ({ theme: r }) => ({
|
|
464
|
+
...e(!1, "medium", "body"),
|
|
465
|
+
color: r.vars.palette.text.primary,
|
|
466
|
+
flex: 1,
|
|
467
|
+
whiteSpace: "normal",
|
|
468
|
+
wordBreak: "break-word"
|
|
298
469
|
})
|
|
299
470
|
};
|
|
300
471
|
export {
|
|
301
|
-
|
|
472
|
+
p as dynamicFilterStyles
|
|
302
473
|
};
|
|
@@ -40,6 +40,8 @@ export declare const DICCTIONARY: {
|
|
|
40
40
|
readonly label_select_async_operand1: "dynamic_filter.label_select_async_operand1";
|
|
41
41
|
readonly label_select_async_operands_array: "dynamic_filter.label_select_async_operands_array";
|
|
42
42
|
readonly label_no_fields_available: "dynamic_filter.label_no_fields_available";
|
|
43
|
+
readonly label_no_filters_applied: "dynamic_filter.label_no_filters_applied";
|
|
44
|
+
readonly label_more: "dynamic_filter.label_more";
|
|
43
45
|
readonly error_operand_required: "dynamic_filter.error_operand_required";
|
|
44
46
|
readonly error_operator_required: "dynamic_filter.error_operator_required";
|
|
45
47
|
readonly error_invalid_date: "dynamic_filter.error_invalid_date";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAC7D;;;GAGG;AACH,wBAAgB,oCAAoC,aAInD;AACD,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicFilter/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAC7D;;;GAGG;AACH,wBAAgB,oCAAoC,aAInD;AACD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Dd,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,WAAW,CAAC"}
|
|
@@ -31,6 +31,8 @@ const t = {
|
|
|
31
31
|
label_select_async_operand1: `${e}.label_select_async_operand1`,
|
|
32
32
|
label_select_async_operands_array: `${e}.label_select_async_operands_array`,
|
|
33
33
|
label_no_fields_available: `${e}.label_no_fields_available`,
|
|
34
|
+
label_no_filters_applied: `${e}.label_no_filters_applied`,
|
|
35
|
+
label_more: `${e}.label_more`,
|
|
34
36
|
//Validations
|
|
35
37
|
error_operand_required: `${e}.error_operand_required`,
|
|
36
38
|
error_operator_required: `${e}.error_operator_required`,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates how many chips fit within a given available width.
|
|
3
|
+
* Pure function — all measurements are passed in by the caller.
|
|
4
|
+
* @param availableWidth - Total width available for the chips (already
|
|
5
|
+
* excluding any sibling element such as the
|
|
6
|
+
* "More" chip and any padding).
|
|
7
|
+
* @param gap - Gap between chips in pixels.
|
|
8
|
+
* @param chipWidths - Natural width of each chip in display order.
|
|
9
|
+
* @returns The number of chips that fit within the available width.
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateVisibleChipsCount(availableWidth: number, gap: number, chipWidths: number[]): number;
|
|
12
|
+
//# sourceMappingURL=calculateVisibleChipsCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateVisibleChipsCount.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/helpers/calculateVisibleChipsCount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAAE,GACnB,MAAM,CAsBR"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function r(l, u, i) {
|
|
2
|
+
let n = 0, o = 0;
|
|
3
|
+
for (let t = 0; t < i.length; t++) {
|
|
4
|
+
const e = i[t];
|
|
5
|
+
if (e <= 0)
|
|
6
|
+
continue;
|
|
7
|
+
const h = t > 0 ? e + u : e, c = n + h;
|
|
8
|
+
if (c > l)
|
|
9
|
+
break;
|
|
10
|
+
n = c, o++;
|
|
11
|
+
}
|
|
12
|
+
return o;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
r as calculateVisibleChipsCount
|
|
16
|
+
};
|