@m4l/components 9.5.5 → 9.5.6-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.
Files changed (61) hide show
  1. package/components/Chip/types.d.ts +4 -2
  2. package/components/Chip/types.d.ts.map +1 -1
  3. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  4. package/components/DynamicFilter/DynamicFilter.styles.js +276 -110
  5. package/components/DynamicFilter/dictionary.d.ts +2 -0
  6. package/components/DynamicFilter/dictionary.d.ts.map +1 -1
  7. package/components/DynamicFilter/dictionary.js +2 -0
  8. package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts +12 -0
  9. package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts.map +1 -0
  10. package/components/DynamicFilter/helpers/calculateVisibleChipsCount.js +16 -0
  11. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +30 -0
  12. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -0
  13. package/components/DynamicFilter/hooks/useChipsOverflow.js +68 -0
  14. package/components/DynamicFilter/slots/SlotsEnum.d.ts +10 -1
  15. package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
  16. package/components/DynamicFilter/slots/SlotsEnum.js +2 -2
  17. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +27 -0
  18. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
  19. package/components/DynamicFilter/slots/dynamicFilterSlots.js +101 -63
  20. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts +4 -1
  21. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
  22. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +18 -14
  23. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts +3 -1
  24. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
  25. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +58 -8
  26. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +9 -1
  27. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts.map +1 -1
  28. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.js +22 -14
  29. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts.map +1 -1
  30. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +10 -12
  31. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +1 -1
  32. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +10 -10
  33. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts +4 -2
  34. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts.map +1 -1
  35. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +34 -31
  36. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +2 -7
  37. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts.map +1 -1
  38. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +15 -22
  39. package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts +3 -1
  40. package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts.map +1 -1
  41. package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +47 -45
  42. package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts +4 -4
  43. package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts.map +1 -1
  44. package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.js +46 -43
  45. package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.d.ts +9 -0
  46. package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.d.ts.map +1 -0
  47. package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.js +87 -0
  48. package/components/DynamicFilter/subcomponents/OverflowPopover/index.d.ts +2 -0
  49. package/components/DynamicFilter/subcomponents/OverflowPopover/index.d.ts.map +1 -0
  50. package/components/DynamicFilter/subcomponents/OverflowPopover/types.d.ts +13 -0
  51. package/components/DynamicFilter/subcomponents/OverflowPopover/types.d.ts.map +1 -0
  52. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.d.ts.map +1 -1
  53. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +50 -46
  54. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +25 -1
  55. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  56. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +50 -27
  57. package/components/DynamicFilter/types.d.ts +21 -2
  58. package/components/DynamicFilter/types.d.ts.map +1 -1
  59. package/package.json +3 -3
  60. package/test/mocks/dictionary-mock.d.ts +1 -0
  61. 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,SA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,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
+ {"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,sBA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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,mBA+SjC,CAAC"}
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,mBAmdjC,CAAC"}
@@ -1,248 +1,279 @@
1
1
  import { getTypographyStyles as e } from "../../utils/getTypographyStyles.js";
2
2
  import { getSizeStyles as o } from "../../utils/getSizeStyles/getSizeStyles.js";
3
- const s = "dynamic", d = {
3
+ const n = "dynamic", d = {
4
4
  /**
5
5
  * root: Estilos del contenedor principal del componente.
6
6
  */
7
- root: ({ theme: i, ownerState: r }) => ({
8
- containerName: s,
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
- i,
15
- r?.size || "medium",
14
+ r,
15
+ a?.size || "medium",
16
16
  "container",
17
- (a) => ({
18
- height: a,
19
- maxHeight: a,
20
- minHeight: a
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: i, ownerState: r }) => ({
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: i.vars.size.borderRadius.r2,
34
- background: i.vars.palette.background.default,
35
- boxShadow: r?.isValid ? `inset 0px 0px 0px 1px ${i.vars.palette.border.secondary}` : `inset 0px 0px 0px 1px ${i.vars.palette.error.enabled}`,
36
- overflow: "hidden",
37
- '&:has([aria-expanded="true"])': {
38
- boxShadow: r?.isValid ? `inset 0px 0px 0px 1.3px ${i.vars.palette.border.main}` : `inset 0px 0px 0px 1px ${i.vars.palette.error.enabled}`
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: i, ownerState: r }) => ({
48
+ inputFilter: ({ theme: r, ownerState: a }) => ({
45
49
  display: "flex",
46
50
  flexDirection: "row",
47
- paddingLeft: i.vars.size.baseSpacings.sp2,
48
- paddingRight: i.vars.size.baseSpacings.sp1,
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
- borderTopLeftRadius: i.vars.size.borderRadius.r1,
55
- borderBottomLeftRadius: i.vars.size.borderRadius.r1,
56
- background: "#ffffff00",
56
+ borderRadius: r.vars.size.borderRadius["r1-5"],
57
+ backgroundColor: r.vars.palette.default.enabledOpacity,
57
58
  ...o(
58
- i,
59
- r?.size || "medium",
59
+ r,
60
+ a?.size || "medium",
60
61
  "container",
61
- (a) => ({
62
- height: a
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: i, ownerState: r }) => ({
92
+ inputFilterInput: ({ theme: r, ownerState: a }) => ({
70
93
  width: "100%",
71
94
  background: "#ffffff00",
72
95
  ...o(
73
- i,
74
- r?.size || "medium",
96
+ r,
97
+ a?.size || "medium",
75
98
  "action",
76
- (a) => ({
77
- height: a,
78
- minHeight: a,
79
- maxHeight: a
99
+ (i) => ({
100
+ height: i,
101
+ minHeight: i,
102
+ maxHeight: i
80
103
  })
81
104
  ),
82
105
  fontFamily: "inherit",
83
106
  ...e(
84
- i.generalSettings.isMobile,
85
- r?.size || "medium",
107
+ r.generalSettings.isMobile,
108
+ a?.size || "medium",
86
109
  "body"
87
110
  ),
88
- color: i.vars.palette.text.secondary,
111
+ color: r.vars.palette.text.secondary,
89
112
  border: 0,
90
113
  borderColor: "transparent",
91
- paddingLeft: i.vars.size.baseSpacings.sp2,
92
- paddingRight: i.vars.size.baseSpacings.sp2,
114
+ paddingLeft: r.vars.size.baseSpacings.sp1,
115
+ paddingRight: r.vars.size.baseSpacings.sp1,
93
116
  height: "100%",
94
117
  "&::placeholder": {
95
- color: i.vars.palette.text.secondary
118
+ color: r.vars.palette.text.secondary
96
119
  },
97
120
  "&:focus-visible": {
98
- color: i.vars.palette.text.secondary,
121
+ color: r.vars.palette.text.secondary,
99
122
  border: "unset",
100
- borderColor: i.vars.palette.primary.opacity,
101
- BorderRadius: i.vars.size.borderRadius["r0-5"],
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: i, ownerState: r }) => ({
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: `0px ${i.vars.size.baseSpacings.sp1}`,
138
+ padding: "0px",
116
139
  flex: 1,
117
140
  overflow: "hidden",
118
141
  ...o(
119
- i,
120
- r?.size || "medium",
142
+ r,
143
+ a?.size || "medium",
121
144
  "container",
122
- (a) => ({
123
- height: a,
124
- maxHeight: a,
125
- minHeight: a
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: i, ownerState: r }) => ({
133
- padding: i.vars.size.baseSpacings["sp0-5"],
134
- gap: i.vars.size.baseSpacings.sp1,
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
- width: "100%",
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: "auto hidden",
169
+ overflow: "hidden",
142
170
  position: "relative",
143
171
  "& .M4LChip-root": {
144
- borderRadius: i.vars.size.borderRadius.r1,
172
+ borderRadius: r.vars.size.borderRadius.r1,
145
173
  ...o(
146
- i,
147
- r?.size || "medium",
174
+ r,
175
+ a?.size || "medium",
148
176
  "action",
149
- (a) => ({
150
- height: a
177
+ (i) => ({
178
+ height: i
151
179
  })
152
180
  ),
153
181
  "& .M4LIconButton-styledMUIIconButton:hover": {
154
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundHover} !important`,
182
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
155
183
  "& .M4LIcon-icon": {
156
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundColorTone} !important`
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: i, ownerState: r }) => ({
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: i.vars.size.baseSpacings["sp0-5"],
170
- padding: i.vars.size.baseSpacings.sp1,
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: i.vars.size.borderRadius.r1,
174
- borderBottomRightRadius: i.vars.size.borderRadius.r1,
175
- boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.border.secondary}`,
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: i }) => ({
220
+ actionsClearButton: ({ theme: r }) => ({
190
221
  "&:hover": {
191
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundHover} !important`,
222
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
192
223
  "& .M4LIcon-icon": {
193
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundColorTone} !important`
224
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundColorTone} !important`
194
225
  }
195
226
  }
196
227
  }),
197
228
  /**
198
229
  * actionsSubmitButton: Estilos del botón de acción de filtrado.
199
230
  */
200
- actionsSubmitButton: ({ theme: i, ownerState: r }) => ({
201
- ...r?.isDirty ? {
231
+ actionsSubmitButton: ({ theme: r, ownerState: a }) => ({
232
+ ...a?.isDirty ? {
202
233
  animation: "changeBgColor 0.9s ease infinite",
203
234
  "& .M4LIcon-icon": {
204
- background: `${i.vars.palette.primary.main} !important`
235
+ background: `${r.vars.palette.primary.main} !important`
205
236
  }
206
237
  } : null,
207
238
  //Create and apply animation with change background color red and green
208
239
  "@keyframes changeBgColor": {
209
240
  "0%": {
210
- background: i.vars.palette.primary.hoverOpacity
241
+ background: r.vars.palette.primary.hoverOpacity
211
242
  },
212
243
  "50%": {
213
- background: i.vars.palette.primary.activeOpacity
244
+ background: r.vars.palette.primary.activeOpacity
214
245
  },
215
246
  "100%": {
216
- background: i.vars.palette.primary.hoverOpacity
247
+ background: r.vars.palette.primary.hoverOpacity
217
248
  }
218
249
  }
219
250
  }),
220
251
  /**
221
252
  * popoverMenu: Estilos del menú emergente.
222
253
  */
223
- popoverMenu: ({ theme: i }) => ({
254
+ popoverMenu: ({ theme: r }) => ({
224
255
  "& .MuiPaper-root": {
225
256
  display: "flex",
226
257
  flexDirection: "column",
227
- padding: i.vars.size.baseSpacings.sp3,
228
- gap: i.vars.size.baseSpacings.sp1,
229
- borderRadius: i.vars.size.borderRadius.r1,
230
- backgroundColor: i.vars.palette.background.default
258
+ padding: r.vars.size.baseSpacings.sp3,
259
+ gap: r.vars.size.baseSpacings.sp1,
260
+ borderRadius: r.vars.size.borderRadius.r1,
261
+ backgroundColor: r.vars.palette.background.default
231
262
  }
232
263
  }),
233
264
  /**
234
265
  * popoverFilter: Estilos del menú emergente de filtro.
235
266
  */
236
- popoverFilter: ({ theme: i }) => ({
267
+ popoverFilter: ({ theme: r }) => ({
237
268
  width: "auto",
238
269
  "& .MuiPaper-root": {
239
- borderRadius: `${i.vars.size.borderRadius.r3}!important`,
270
+ borderRadius: `${r.vars.size.borderRadius.r3}!important`,
240
271
  padding: "0 !important",
241
272
  minWidth: "220px",
242
273
  maxWidth: "100%",
243
274
  minHeight: "auto",
244
- backgroundColor: i.vars.palette.background.default,
245
- boxShadow: i.customShadows?.z3,
275
+ backgroundColor: r.vars.palette.background.default,
276
+ boxShadow: r.customShadows?.z3,
246
277
  "& .M4LPopover-arrowStyle": {
247
278
  display: "none"
248
279
  },
@@ -255,7 +286,7 @@ const s = "dynamic", d = {
255
286
  overflow: "visible"
256
287
  },
257
288
  "& .M4LWindowBase-root": {
258
- borderRadius: `${i.vars.size.borderRadius.r3}!important`,
289
+ borderRadius: `${r.vars.size.borderRadius.r3}!important`,
259
290
  border: "unset!important",
260
291
  "& .M4LWindowBase-headerWindowComponent": {
261
292
  cursor: "unset"
@@ -266,35 +297,170 @@ const s = "dynamic", d = {
266
297
  /**
267
298
  * popoverFilterActions: Estilos del contenedor de acciones del menú emergente de filtro.
268
299
  */
269
- popoverFilterActions: ({ theme: i }) => ({
270
- paddingTop: i.vars.size.baseSpacings.sp6
300
+ popoverFilterActions: ({ theme: r }) => ({
301
+ paddingTop: r.vars.size.baseSpacings.sp6
271
302
  }),
272
303
  /**
273
304
  * inputSortInputSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
274
305
  */
275
- inputFilterInputSkeleton: ({ theme: i, ownerState: r }) => ({
306
+ inputFilterInputSkeleton: ({ theme: r, ownerState: a }) => ({
276
307
  width: "100%",
277
308
  minWidth: "80px",
278
- marginLeft: i.vars.size.baseSpacings.sp2,
279
- marginRight: i.vars.size.baseSpacings.sp2,
309
+ marginLeft: r.vars.size.baseSpacings.sp2,
310
+ marginRight: r.vars.size.baseSpacings.sp2,
280
311
  ...o(
281
- i,
282
- r?.size || "medium",
312
+ r,
313
+ a?.size || "medium",
283
314
  "base",
284
- (a) => ({
285
- height: a,
286
- minHeight: a,
287
- maxHeight: a
315
+ (i) => ({
316
+ height: i,
317
+ minHeight: i,
318
+ maxHeight: i
288
319
  })
289
320
  )
290
321
  }),
291
322
  /**
292
323
  * popoverFilterContainerFields: Estilos del contenedor de los campos del menú emergente de filtro.
293
324
  */
294
- popoverFilterContainerFields: ({ theme: i }) => ({
325
+ popoverFilterContainerFields: ({ theme: r }) => ({
295
326
  display: "flex",
296
327
  flexDirection: "column",
297
- gap: i.vars.size.baseSpacings.sp3
328
+ gap: r.vars.size.baseSpacings.sp3
329
+ }),
330
+ /**
331
+ * chipWrapper: Wrapper for each chip used for overflow measurement.
332
+ */
333
+ chipWrapper: ({ theme: r, ownerState: a }) => ({
334
+ display: "inline-flex",
335
+ flexShrink: 0,
336
+ ...a?.isWarning && {
337
+ "@keyframes m4lDynamicFilterWarningPulse": {
338
+ "0%, 100%": {
339
+ backgroundColor: r.vars.palette.chips.warning.contained.backgroundColor
340
+ },
341
+ "50%": {
342
+ backgroundColor: r.vars.palette.chips.warning.contained.backgroundHover
343
+ }
344
+ },
345
+ '& .MuiChip-root, & [class*="M4LChip-root"]': {
346
+ animation: "m4lDynamicFilterWarningPulse 1.6s ease-in-out infinite"
347
+ }
348
+ }
349
+ }),
350
+ /**
351
+ * overflowMoreChip: Styles for the "More (N)..." chip button that appears when filters overflow.
352
+ */
353
+ overflowMoreChip: ({ theme: r, ownerState: a }) => ({
354
+ flexShrink: 0,
355
+ cursor: "pointer",
356
+ borderRadius: r.vars.size.borderRadius.r1,
357
+ ...o(
358
+ r,
359
+ a?.size || "medium",
360
+ "action",
361
+ (i) => ({
362
+ height: i
363
+ })
364
+ ),
365
+ // While the overflow popover is open, lock the chip to the info palette's
366
+ // background and add the container border in `info.semanticText` so the
367
+ // chip visually stays active regardless of hover/focus transitions.
368
+ ...a?.selected && {
369
+ backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
370
+ border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
371
+ outline: "none !important",
372
+ "&:hover, &:focus, &:focus-visible": {
373
+ backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
374
+ border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
375
+ outline: "none !important"
376
+ }
377
+ }
378
+ }),
379
+ /**
380
+ * overflowPopover: Styles for the popover that shows hidden overflow filters.
381
+ */
382
+ overflowPopover: ({ theme: r }) => ({
383
+ "& .MuiPaper-root": {
384
+ display: "flex",
385
+ flexDirection: "column",
386
+ padding: `${r.vars.size.baseSpacings.sp3} ${r.vars.size.baseSpacings.sp2}`,
387
+ gap: r.vars.size.baseSpacings.sp1,
388
+ borderRadius: r.vars.size.borderRadius.r2,
389
+ backgroundColor: r.vars.palette.background.default,
390
+ boxShadow: r.customShadows?.z3,
391
+ width: "280px"
392
+ }
393
+ }),
394
+ /**
395
+ * overflowPopoverList: Styles for the list container inside the overflow popover.
396
+ */
397
+ overflowPopoverList: ({ theme: r }) => ({
398
+ display: "flex",
399
+ flexDirection: "column",
400
+ gap: r.vars.size.baseSpacings.sp2
401
+ }),
402
+ /**
403
+ * overflowPopoverItem: Styles for each filter item inside the overflow popover.
404
+ * Row layout: icon | text column | close button, all vertically centered.
405
+ */
406
+ overflowPopoverItem: ({ theme: r, ownerState: a }) => ({
407
+ display: "flex",
408
+ alignItems: "center",
409
+ alignSelf: "stretch",
410
+ gap: r.vars.size.baseSpacings.sp2,
411
+ padding: r.vars.size.baseSpacings.sp2,
412
+ borderBottom: `1px solid ${r.vars.palette.border.disabled}`,
413
+ background: r.vars.palette.background.default,
414
+ borderRadius: r.vars.size.borderRadius["r1-5"],
415
+ cursor: "pointer",
416
+ transition: "background-color 0.3s ease",
417
+ "&:hover": {
418
+ backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
419
+ },
420
+ ...a?.selected && {
421
+ backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
422
+ },
423
+ "&:last-child": {
424
+ borderBottom: "none"
425
+ }
426
+ }),
427
+ /**
428
+ * overflowPopoverItemHeader: Column container for label and value text.
429
+ */
430
+ overflowPopoverItemHeader: ({ theme: r }) => ({
431
+ display: "flex",
432
+ flexDirection: "row",
433
+ flexWrap: "wrap",
434
+ alignItems: "center",
435
+ flex: 1,
436
+ minWidth: 0,
437
+ rowGap: r.vars.size.baseSpacings["sp0-5"],
438
+ columnGap: r.vars.size.baseSpacings.sp1,
439
+ // The label occupies the full first row so the value chips wrap below it.
440
+ "& > span:first-of-type": {
441
+ flexBasis: "100%"
442
+ },
443
+ "& .M4LChip-root": {
444
+ height: "auto",
445
+ minHeight: "auto",
446
+ maxWidth: "100%"
447
+ },
448
+ "& .M4LChip-root .M4LTypography-root": {
449
+ whiteSpace: "normal",
450
+ wordBreak: "break-word",
451
+ overflow: "visible",
452
+ textOverflow: "clip"
453
+ }
454
+ }),
455
+ /**
456
+ * overflowPopoverItemLabel: Label text for the filter field name inside the overflow item.
457
+ */
458
+ overflowPopoverItemLabel: ({ theme: r }) => ({
459
+ ...e(!1, "medium", "body"),
460
+ color: r.vars.palette.text.primary,
461
+ flex: 1,
462
+ whiteSpace: "normal",
463
+ wordBreak: "break-word"
298
464
  })
299
465
  };
300
466
  export {
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDd,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,WAAW,CAAC"}
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
+ };