@m4l/components 9.38.0 → 9.39.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 (56) hide show
  1. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  2. package/components/DynamicFilter/DynamicFilter.styles.js +82 -60
  3. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +1 -0
  4. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -1
  5. package/components/DynamicFilter/hooks/useChipsOverflow.js +50 -44
  6. package/components/DynamicFilter/slots/SlotsEnum.d.ts +1 -0
  7. package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
  8. package/components/DynamicFilter/slots/SlotsEnum.js +1 -1
  9. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +3 -0
  10. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
  11. package/components/DynamicFilter/slots/dynamicFilterSlots.js +43 -39
  12. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
  13. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +26 -19
  14. package/components/DynamicSort/DynamicSort.js +6 -6
  15. package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
  16. package/components/DynamicSort/DynamicSort.styles.js +40 -14
  17. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +3 -0
  18. package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
  19. package/components/DynamicSort/slots/DynamicSortSlots.js +44 -40
  20. package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -0
  21. package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
  22. package/components/DynamicSort/slots/SlotsEnum.js +1 -1
  23. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +2 -1
  24. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
  25. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +70 -54
  26. package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts +5 -0
  27. package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts.map +1 -0
  28. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -0
  29. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
  30. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +23 -21
  31. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
  32. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +15 -17
  33. package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +2 -0
  34. package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts.map +1 -1
  35. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  36. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +58 -46
  37. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
  38. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +30 -30
  39. package/components/DynamicSort/types.d.ts +6 -0
  40. package/components/DynamicSort/types.d.ts.map +1 -1
  41. package/hooks/useDynamicFilterAndSort/constants.d.ts +1 -0
  42. package/hooks/useDynamicFilterAndSort/constants.d.ts.map +1 -1
  43. package/hooks/useDynamicFilterAndSort/constants.js +4 -3
  44. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +2 -1
  45. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts.map +1 -1
  46. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +2 -2
  47. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +3 -0
  48. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts.map +1 -1
  49. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +19 -15
  50. package/hooks/useDynamicFilterAndSort/styles.d.ts.map +1 -1
  51. package/hooks/useDynamicFilterAndSort/styles.js +58 -37
  52. package/hooks/useDynamicFilterAndSort/types.d.ts +1 -0
  53. package/hooks/useDynamicFilterAndSort/types.d.ts.map +1 -1
  54. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts.map +1 -1
  55. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +204 -172
  56. package/package.json +8 -8
@@ -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,mBAkejC,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,mBAwfjC,CAAC"}
@@ -1,23 +1,23 @@
1
1
  import { getTypographyStyles as e } from "../../utils/getTypographyStyles.js";
2
- import { getSizeStyles as i } from "../../utils/getSizeStyles/getSizeStyles.js";
3
- const n = "dynamic", p = {
2
+ import { getSizeStyles as o } from "../../utils/getSizeStyles/getSizeStyles.js";
3
+ const t = "dynamic", p = {
4
4
  /**
5
5
  * root: Estilos del contenedor principal del componente.
6
6
  */
7
- root: ({ theme: r, ownerState: a }) => ({
8
- containerName: n,
7
+ root: ({ theme: r, ownerState: i }) => ({
8
+ containerName: t,
9
9
  containerType: "inline-size",
10
10
  width: "100%",
11
11
  height: "auto",
12
12
  padding: 0,
13
- ...i(
13
+ ...o(
14
14
  r,
15
- a?.size || "medium",
15
+ i?.size || "medium",
16
16
  "container",
17
- (o) => ({
18
- height: o,
19
- maxHeight: o,
20
- minHeight: o
17
+ (a) => ({
18
+ height: a,
19
+ maxHeight: a,
20
+ minHeight: a
21
21
  })
22
22
  )
23
23
  }),
@@ -40,7 +40,7 @@ const n = "dynamic", p = {
40
40
  * Ahora se usa como header dentro del `PopoverMenuFields`, donde el icono
41
41
  * queda a la izquierda y el input "Filtrar por" se alinea a continuación.
42
42
  */
43
- inputFilter: ({ theme: r, ownerState: a }) => ({
43
+ inputFilter: ({ theme: r, ownerState: i }) => ({
44
44
  display: "flex",
45
45
  flexDirection: "row",
46
46
  paddingLeft: r.vars.size.baseSpacings.sp2,
@@ -50,12 +50,12 @@ const n = "dynamic", p = {
50
50
  alignItems: "center",
51
51
  borderRadius: r.vars.size.borderRadius["r1-5"],
52
52
  backgroundColor: r.vars.palette.default.enabledOpacity,
53
- ...i(
53
+ ...o(
54
54
  r,
55
- a?.size || "medium",
55
+ i?.size || "medium",
56
56
  "container",
57
- (o) => ({
58
- height: o
57
+ (a) => ({
58
+ height: a
59
59
  })
60
60
  )
61
61
  }),
@@ -66,11 +66,11 @@ const n = "dynamic", p = {
66
66
  * el chip "Más" activo — fondo `info.contained.backgroundColor` y border
67
67
  * `info.semanticText` — para mantener consistencia visual.
68
68
  */
69
- inputFilterTriggerButton: ({ theme: r, ownerState: a }) => ({
69
+ inputFilterTriggerButton: ({ theme: r, ownerState: i }) => ({
70
70
  flexShrink: 0,
71
71
  cursor: "pointer",
72
72
  borderRadius: r.vars.size.borderRadius.r1,
73
- ...a?.selected && {
73
+ ...i?.selected && {
74
74
  backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
75
75
  border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
76
76
  outline: "none !important",
@@ -84,23 +84,23 @@ const n = "dynamic", p = {
84
84
  /**
85
85
  * inputFilterInput: Estilos del campo de entrada de filtrado.
86
86
  */
87
- inputFilterInput: ({ theme: r, ownerState: a }) => ({
87
+ inputFilterInput: ({ theme: r, ownerState: i }) => ({
88
88
  width: "100%",
89
89
  background: "#ffffff00",
90
- ...i(
90
+ ...o(
91
91
  r,
92
- a?.size || "medium",
92
+ i?.size || "medium",
93
93
  "action",
94
- (o) => ({
95
- height: o,
96
- minHeight: o,
97
- maxHeight: o
94
+ (a) => ({
95
+ height: a,
96
+ minHeight: a,
97
+ maxHeight: a
98
98
  })
99
99
  ),
100
100
  fontFamily: "inherit",
101
101
  ...e(
102
102
  r.generalSettings.isMobile,
103
- a?.size || "medium",
103
+ i?.size || "medium",
104
104
  "bodyStandard"
105
105
  ),
106
106
  color: r.vars.palette.text.secondary,
@@ -123,7 +123,7 @@ const n = "dynamic", p = {
123
123
  /**
124
124
  * appliedFilters: Estilos del contenedor de los filtros aplicados.
125
125
  */
126
- appliedFilters: ({ theme: r, ownerState: a }) => ({
126
+ appliedFilters: ({ theme: r, ownerState: i }) => ({
127
127
  width: "100%",
128
128
  height: "fit-content",
129
129
  display: "flex",
@@ -133,22 +133,25 @@ const n = "dynamic", p = {
133
133
  margin: "0px",
134
134
  padding: "0px",
135
135
  flex: 1,
136
+ // min-width:0 lets this flex item shrink below its content min-content so
137
+ // the empty-state label can truncate with ellipsis instead of overflowing.
138
+ minWidth: 0,
136
139
  overflow: "hidden",
137
- ...i(
140
+ ...o(
138
141
  r,
139
- a?.size || "medium",
142
+ i?.size || "medium",
140
143
  "container",
141
- (o) => ({
142
- height: o,
143
- maxHeight: o,
144
- minHeight: o
144
+ (a) => ({
145
+ height: a,
146
+ maxHeight: a,
147
+ minHeight: a
145
148
  })
146
149
  )
147
150
  }),
148
151
  /**
149
152
  * appliedFilterInnerContainer: Estilos del contenedor interno de los filtros aplicados.
150
153
  */
151
- appliedFilterInnerContainer: ({ theme: r, ownerState: a }) => ({
154
+ appliedFilterInnerContainer: ({ theme: r, ownerState: i }) => ({
152
155
  padding: r.vars.size.baseSpacings["sp0-5"],
153
156
  gap: r.vars.size.baseSpacings.sp1,
154
157
  height: "fit-content",
@@ -172,12 +175,12 @@ const n = "dynamic", p = {
172
175
  // (r1-5 = 6px). Este override por descendencia gana por especificidad
173
176
  // sobre el radio base del Chip, por eso debe fijar r1-5 explícitamente.
174
177
  borderRadius: r.vars.size.borderRadius["r1-5"],
175
- ...i(
178
+ ...o(
176
179
  r,
177
- a?.size || "medium",
180
+ i?.size || "medium",
178
181
  "action",
179
- (o) => ({
180
- height: o
182
+ (a) => ({
183
+ height: a
181
184
  })
182
185
  ),
183
186
  "& .M4LIconButton-styledMUIIconButton:hover": {
@@ -194,15 +197,34 @@ const n = "dynamic", p = {
194
197
  * para desaturar el mensaje y no competir visualmente con los chips.
195
198
  */
196
199
  emptyStateLabel: ({ theme: r }) => ({
197
- display: "inline-flex",
198
- alignItems: "center",
200
+ // Truncate with ellipsis when the label does not fit (e.g. narrow column).
201
+ display: "block",
202
+ minWidth: 0,
203
+ maxWidth: "100%",
204
+ overflow: "hidden",
205
+ textOverflow: "ellipsis",
206
+ whiteSpace: "nowrap",
199
207
  color: r.vars.palette.text.secondary,
200
208
  cursor: "pointer"
201
209
  }),
210
+ /**
211
+ * appliedFilterChipLabel: Acota el ancho del label del chip en la barra y lo
212
+ * trunca con ellipsis. Evita que un valor largo infle el filtro y empuje el
213
+ * sort a otro renglón; el valor completo sigue visible en "Más (N)".
214
+ */
215
+ appliedFilterChipLabel: () => ({
216
+ display: "inline-block",
217
+ maxWidth: 300,
218
+ minWidth: 0,
219
+ overflow: "hidden",
220
+ textOverflow: "ellipsis",
221
+ whiteSpace: "nowrap",
222
+ verticalAlign: "middle"
223
+ }),
202
224
  /**
203
225
  * actions: Estilos del contenedor de los botones de acción.
204
226
  */
205
- actions: ({ theme: r, ownerState: a }) => ({
227
+ actions: ({ theme: r, ownerState: i }) => ({
206
228
  gridArea: "actions-filter",
207
229
  overflow: "hidden",
208
230
  display: "flex",
@@ -213,7 +235,7 @@ const n = "dynamic", p = {
213
235
  alignItems: "center",
214
236
  borderTopRightRadius: r.vars.size.borderRadius.r1,
215
237
  borderBottomRightRadius: r.vars.size.borderRadius.r1,
216
- ...!a?.visibleRefresh && !a?.isDirty && {
238
+ ...!i?.visibleRefresh && !i?.isDirty && {
217
239
  display: "none"
218
240
  }
219
241
  }),
@@ -236,8 +258,8 @@ const n = "dynamic", p = {
236
258
  /**
237
259
  * actionsSubmitButton: Estilos del botón de acción de filtrado.
238
260
  */
239
- actionsSubmitButton: ({ theme: r, ownerState: a }) => ({
240
- ...a?.isDirty ? {
261
+ actionsSubmitButton: ({ theme: r, ownerState: i }) => ({
262
+ ...i?.isDirty ? {
241
263
  animation: "changeBgColor 0.9s ease infinite",
242
264
  "& .M4LIcon-icon": {
243
265
  background: `${r.vars.palette.primary.main} !important`
@@ -314,19 +336,19 @@ const n = "dynamic", p = {
314
336
  /**
315
337
  * inputSortInputSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
316
338
  */
317
- inputFilterInputSkeleton: ({ theme: r, ownerState: a }) => ({
339
+ inputFilterInputSkeleton: ({ theme: r, ownerState: i }) => ({
318
340
  width: "100%",
319
341
  minWidth: "80px",
320
342
  marginLeft: r.vars.size.baseSpacings.sp2,
321
343
  marginRight: r.vars.size.baseSpacings.sp2,
322
- ...i(
344
+ ...o(
323
345
  r,
324
- a?.size || "medium",
346
+ i?.size || "medium",
325
347
  "base",
326
- (o) => ({
327
- height: o,
328
- minHeight: o,
329
- maxHeight: o
348
+ (a) => ({
349
+ height: a,
350
+ minHeight: a,
351
+ maxHeight: a
330
352
  })
331
353
  )
332
354
  }),
@@ -341,10 +363,10 @@ const n = "dynamic", p = {
341
363
  /**
342
364
  * chipWrapper: Wrapper for each chip used for overflow measurement.
343
365
  */
344
- chipWrapper: ({ theme: r, ownerState: a }) => ({
366
+ chipWrapper: ({ theme: r, ownerState: i }) => ({
345
367
  display: "inline-flex",
346
368
  flexShrink: 0,
347
- ...a?.isWarning && {
369
+ ...i?.isWarning && {
348
370
  "@keyframes m4lDynamicFilterWarningPulse": {
349
371
  "0%, 100%": {
350
372
  backgroundColor: r.vars.palette.chips.warning.contained.backgroundColor
@@ -361,7 +383,7 @@ const n = "dynamic", p = {
361
383
  /**
362
384
  * overflowMoreChip: Styles for the "More (N)..." chip button that appears when filters overflow.
363
385
  */
364
- overflowMoreChip: ({ theme: r, ownerState: a }) => ({
386
+ overflowMoreChip: ({ theme: r, ownerState: i }) => ({
365
387
  flexShrink: 0,
366
388
  cursor: "pointer",
367
389
  // Match the applied filter chips radius (r1-5 = 6px) so the "More (N)"
@@ -369,18 +391,18 @@ const n = "dynamic", p = {
369
391
  // Igualar el radio de los chips aplicados (r1-5 = 6px) para que el botón
370
392
  // "More (N)" sea visualmente consistente con el resto de la fila de chips.
371
393
  borderRadius: r.vars.size.borderRadius["r1-5"],
372
- ...i(
394
+ ...o(
373
395
  r,
374
- a?.size || "medium",
396
+ i?.size || "medium",
375
397
  "action",
376
- (o) => ({
377
- height: o
398
+ (a) => ({
399
+ height: a
378
400
  })
379
401
  ),
380
402
  // While the overflow popover is open, lock the chip to the info palette's
381
403
  // background and add the container border in `info.semanticText` so the
382
404
  // chip visually stays active regardless of hover/focus transitions.
383
- ...a?.selected && {
405
+ ...i?.selected && {
384
406
  backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
385
407
  border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
386
408
  outline: "none !important",
@@ -418,7 +440,7 @@ const n = "dynamic", p = {
418
440
  * overflowPopoverItem: Styles for each filter item inside the overflow popover.
419
441
  * Row layout: icon | text column | close button, all vertically centered.
420
442
  */
421
- overflowPopoverItem: ({ theme: r, ownerState: a }) => ({
443
+ overflowPopoverItem: ({ theme: r, ownerState: i }) => ({
422
444
  display: "flex",
423
445
  alignItems: "center",
424
446
  alignSelf: "stretch",
@@ -432,7 +454,7 @@ const n = "dynamic", p = {
432
454
  "&:hover": {
433
455
  backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
434
456
  },
435
- ...a?.selected && {
457
+ ...i?.selected && {
436
458
  backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
437
459
  },
438
460
  "&:last-child": {
@@ -26,5 +26,6 @@ export declare function useChipsOverflow(filters: FilterFieldApplied[]): {
26
26
  setChipRef: (id: number, el: HTMLElement | null) => void;
27
27
  setMoreChipRef: (el: HTMLElement | null) => void;
28
28
  setActionsRef: (el: HTMLElement | null) => void;
29
+ setLeadingRef: (el: HTMLElement | null) => void;
29
30
  };
30
31
  //# sourceMappingURL=useChipsOverflow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChipsOverflow.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/hooks/useChipsOverflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE;;;;;qBAmHxB,MAAM,MAAM,WAAW,GAAG,IAAI;yBAc3D,WAAW,GAAG,IAAI;wBAalB,WAAW,GAAG,IAAI;EA6D1B"}
1
+ {"version":3,"file":"useChipsOverflow.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/hooks/useChipsOverflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE;;;;;qBA2HxB,MAAM,MAAM,WAAW,GAAG,IAAI;yBAc3D,WAAW,GAAG,IAAI;wBAalB,WAAW,GAAG,IAAI;wBAYlB,WAAW,GAAG,IAAI;EA8D1B"}
@@ -1,77 +1,83 @@
1
- import { useRef as i, useState as j, useEffect as m, useCallback as d, useMemo as D } from "react";
2
- import { calculateVisibleChipsCount as S } from "../helpers/calculateVisibleChipsCount.js";
3
- function K(t) {
4
- const h = i(null), v = i(null), R = i(null), C = i(null), p = i(/* @__PURE__ */ new Map()), s = i(/* @__PURE__ */ new Map()), [a, u] = j(null);
5
- m(() => {
1
+ import { useRef as s, useState as J, useEffect as R, useCallback as u, useMemo as K } from "react";
2
+ import { calculateVisibleChipsCount as L } from "../helpers/calculateVisibleChipsCount.js";
3
+ function X(t) {
4
+ const h = s(null), m = s(null), v = s(null), C = s(null), W = s(null), p = s(/* @__PURE__ */ new Map()), i = s(/* @__PURE__ */ new Map()), [a, d] = J(null);
5
+ R(() => {
6
6
  const e = new Set(t.map((r) => r.id));
7
- for (const r of s.current.keys())
8
- e.has(r) || s.current.delete(r);
9
- t.some((r) => !s.current.has(r.id)) && u(null);
7
+ for (const r of i.current.keys())
8
+ e.has(r) || i.current.delete(r);
9
+ t.some((r) => !i.current.has(r.id)) && d(null);
10
10
  }, [t]);
11
- const o = d(() => {
12
- const e = h.current, n = v.current;
13
- if (!e || !n || t.length === 0) {
14
- u(null);
11
+ const n = u(() => {
12
+ const e = h.current, o = m.current;
13
+ if (!e || !o || t.length === 0) {
14
+ d(null);
15
15
  return;
16
16
  }
17
17
  if (t.forEach((c) => {
18
18
  const g = p.current.get(c.id);
19
- g && g.offsetWidth > 0 && s.current.set(c.id, g.offsetWidth);
20
- }), !t.every((c) => s.current.has(c.id)))
19
+ g && g.offsetWidth > 0 && i.current.set(c.id, g.offsetWidth);
20
+ }), !t.every((c) => i.current.has(c.id)))
21
21
  return;
22
- const b = getComputedStyle(e), f = getComputedStyle(n), k = parseFloat(b.paddingLeft) || 0, I = parseFloat(b.paddingRight) || 0, U = parseFloat(f.paddingLeft) || 0, V = parseFloat(f.paddingRight) || 0, l = parseFloat(f.gap) || 0, F = e.getBoundingClientRect().width || e.clientWidth;
22
+ const b = getComputedStyle(e), f = getComputedStyle(o), V = parseFloat(b.paddingLeft) || 0, q = parseFloat(b.paddingRight) || 0, x = parseFloat(f.paddingLeft) || 0, z = parseFloat(f.paddingRight) || 0, l = parseFloat(f.gap) || 0, F = e.getBoundingClientRect().width || e.clientWidth;
23
23
  if (F === 0)
24
24
  return;
25
- const W = C.current?.offsetWidth ?? 0, q = W > 0 ? W + l : 0, w = F - k - I - U - V - q, M = t.map((c) => s.current.get(c.id) ?? 0);
26
- if (S(w, l, M) >= t.length) {
27
- u(t.length);
25
+ const w = C.current?.offsetWidth ?? 0, B = w > 0 ? w + l : 0, M = W.current?.offsetWidth ?? 0, j = M > 0 ? M + l : 0, y = F - V - q - x - z - B - j, S = t.map((c) => i.current.get(c.id) ?? 0);
26
+ if (L(y, l, S) >= t.length) {
27
+ d(t.length);
28
28
  return;
29
29
  }
30
- const y = R.current?.offsetWidth ?? 0, x = y > 0 ? y + l : 0, z = w - x, B = S(z, l, M);
31
- u(B);
32
- }, [t]), E = d((e, n) => {
33
- n ? p.current.set(e, n) : p.current.delete(e);
34
- }, []), A = d(
30
+ const E = v.current?.offsetWidth ?? 0, D = E > 0 ? E + l : 0, G = y - D, H = L(G, l, S);
31
+ d(H);
32
+ }, [t]), A = u((e, o) => {
33
+ o ? p.current.set(e, o) : p.current.delete(e);
34
+ }, []), P = u(
35
35
  (e) => {
36
- R.current = e, o();
36
+ v.current = e, n();
37
37
  },
38
- [o]
39
- ), L = d(
38
+ [n]
39
+ ), O = u(
40
40
  (e) => {
41
- C.current = e, o();
41
+ C.current = e, n();
42
42
  },
43
- [o]
43
+ [n]
44
+ ), k = u(
45
+ (e) => {
46
+ W.current = e, n();
47
+ },
48
+ [n]
44
49
  );
45
- m(() => {
50
+ R(() => {
46
51
  const e = h.current;
47
52
  if (!e)
48
53
  return;
49
- const n = new ResizeObserver(() => {
50
- o();
54
+ const o = new ResizeObserver(() => {
55
+ n();
51
56
  });
52
- return n.observe(e), () => {
53
- n.disconnect();
57
+ return o.observe(e), () => {
58
+ o.disconnect();
54
59
  };
55
- }, [o]), m(() => {
60
+ }, [n]), R(() => {
56
61
  const e = requestAnimationFrame(() => {
57
- o();
62
+ n();
58
63
  });
59
64
  return () => cancelAnimationFrame(e);
60
- }, [t, o]);
61
- const { visibleFilters: P, overflowFilters: O } = D(() => a === null || a >= t.length ? { visibleFilters: t, overflowFilters: [] } : {
65
+ }, [t, n]);
66
+ const { visibleFilters: I, overflowFilters: U } = K(() => a === null || a >= t.length ? { visibleFilters: t, overflowFilters: [] } : {
62
67
  visibleFilters: t.slice(0, a),
63
68
  overflowFilters: t.slice(a)
64
69
  }, [t, a]);
65
70
  return {
66
- visibleFilters: P,
67
- overflowFilters: O,
71
+ visibleFilters: I,
72
+ overflowFilters: U,
68
73
  parentRef: h,
69
- containerRef: v,
70
- setChipRef: E,
71
- setMoreChipRef: A,
72
- setActionsRef: L
74
+ containerRef: m,
75
+ setChipRef: A,
76
+ setMoreChipRef: P,
77
+ setActionsRef: O,
78
+ setLeadingRef: k
73
79
  };
74
80
  }
75
81
  export {
76
- K as useChipsOverflow
82
+ X as useChipsOverflow
77
83
  };
@@ -16,6 +16,7 @@ export declare enum DynamicFilterSlots {
16
16
  popoverFilterActions = "popoverFilterActions",
17
17
  inputFilterInputSkeleton = "inputFilterInputSkeleton",
18
18
  chipWrapper = "chipWrapper",
19
+ appliedFilterChipLabel = "appliedFilterChipLabel",
19
20
  overflowMoreChip = "overflowMoreChip",
20
21
  overflowPopover = "overflowPopover",
21
22
  overflowPopoverList = "overflowPopoverList",
@@ -1 +1 @@
1
- {"version":3,"file":"SlotsEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/slots/SlotsEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;IAC3B,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,2BAA2B,gCAAgC;IAC3D,eAAe,oBAAoB;IACnC,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,4BAA4B,iCAAiC;IAC7D,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA4B;IACpD,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;CACtD"}
1
+ {"version":3,"file":"SlotsEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/slots/SlotsEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;IAC3B,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,2BAA2B,gCAAgC;IAC3D,eAAe,oBAAoB;IACnC,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,4BAA4B,iCAAiC;IAC7D,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA4B;IACpD,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IACvD,wBAAwB,6BAA6B;CACtD"}
@@ -1,4 +1,4 @@
1
- var o = /* @__PURE__ */ ((e) => (e.root = "root", e.innerContainer = "innerContainer", e.inputFilter = "inputFilter", e.inputFilterTriggerButton = "inputFilterTriggerButton", e.inputFilterInput = "inputFilterInput", e.appliedFilters = "appliedFilters", e.appliedFilterInnerContainer = "appliedFilterInnerContainer", e.emptyStateLabel = "emptyStateLabel", e.actions = "actions", e.actionsClearButton = "actionsClearButton", e.actionsSubmitButton = "actionsSubmitButton", e.popoverMenu = "popoverMenu", e.popoverFilter = "popoverFilter", e.popoverFilterContainerFields = "popoverFilterContainerFields", e.popoverFilterActions = "popoverFilterActions", e.inputFilterInputSkeleton = "inputFilterInputSkeleton", e.chipWrapper = "chipWrapper", e.overflowMoreChip = "overflowMoreChip", e.overflowPopover = "overflowPopover", e.overflowPopoverList = "overflowPopoverList", e.overflowPopoverItem = "overflowPopoverItem", e.overflowPopoverItemHeader = "overflowPopoverItemHeader", e.overflowPopoverItemLabel = "overflowPopoverItemLabel", e))(o || {});
1
+ var o = /* @__PURE__ */ ((e) => (e.root = "root", e.innerContainer = "innerContainer", e.inputFilter = "inputFilter", e.inputFilterTriggerButton = "inputFilterTriggerButton", e.inputFilterInput = "inputFilterInput", e.appliedFilters = "appliedFilters", e.appliedFilterInnerContainer = "appliedFilterInnerContainer", e.emptyStateLabel = "emptyStateLabel", e.actions = "actions", e.actionsClearButton = "actionsClearButton", e.actionsSubmitButton = "actionsSubmitButton", e.popoverMenu = "popoverMenu", e.popoverFilter = "popoverFilter", e.popoverFilterContainerFields = "popoverFilterContainerFields", e.popoverFilterActions = "popoverFilterActions", e.inputFilterInputSkeleton = "inputFilterInputSkeleton", e.chipWrapper = "chipWrapper", e.appliedFilterChipLabel = "appliedFilterChipLabel", e.overflowMoreChip = "overflowMoreChip", e.overflowPopover = "overflowPopover", e.overflowPopoverList = "overflowPopoverList", e.overflowPopoverItem = "overflowPopoverItem", e.overflowPopoverItemHeader = "overflowPopoverItemHeader", e.overflowPopoverItemLabel = "overflowPopoverItemLabel", e))(o || {});
2
2
  export {
3
3
  o as DynamicFilterSlots
4
4
  };
@@ -49,6 +49,9 @@ export declare const InputFilterInputSkeletonStyled: import('@emotion/styled').S
49
49
  export declare const ChipWrapperStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
50
50
  ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
51
51
  }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
52
+ export declare const AppliedFilterChipLabelStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
53
+ ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
54
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
52
55
  export declare const OverflowMoreChipStyled: import('@emotion/styled').StyledComponent<Pick<import('../..').ChipProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../..').ChipProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
53
56
  ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
54
57
  }, {}, {}>;
@@ -1 +1 @@
1
- {"version":3,"file":"dynamicFilterSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/slots/dynamicFilterSlots.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU;;6NAGM,CAAC;AAC9B,eAAO,MAAM,oBAAoB;;6NAGM,CAAC;AACxC,eAAO,MAAM,iBAAiB;;6NAGM,CAAC;AACrC,eAAO,MAAM,8BAA8B;;UAGM,CAAC;AAClD,eAAO,MAAM,sBAAsB;;+OAGM,CAAC;AAC1C,eAAO,MAAM,oBAAoB;;6NAGM,CAAC;AACxC,eAAO,MAAM,iCAAiC;;6NAGM,CAAC;AACrD,eAAO,MAAM,qBAAqB;;UAGM,CAAC;AACzC,eAAO,MAAM,aAAa;;6NAGM,CAAC;AACjC,eAAO,MAAM,wBAAwB;;UAGM,CAAC;AAC5C,eAAO,MAAM,yBAAyB;;UAGM,CAAC;AAC7C,eAAO,MAAM,iBAAiB;;UAGM,CAAC;AACrC,eAAO,MAAM,aAAa;;UAGY,CAAC;AACvC,eAAO,MAAM,4BAA4B;;6NAGY,CAAC;AACtD,eAAO,MAAM,0BAA0B;;UAGM,CAAC;AAE9C,eAAO,MAAM,8BAA8B;;UAGM,CAAC;AAElD,eAAO,MAAM,iBAAiB;;6NAGM,CAAC;AAErC,eAAO,MAAM,sBAAsB;;UAGM,CAAC;AAC1C,eAAO,MAAM,qBAAqB;;UAGM,CAAC;AACzC,eAAO,MAAM,yBAAyB;;6NAGM,CAAC;AAC7C,eAAO,MAAM,yBAAyB;;6NAGM,CAAC;AAC7C,eAAO,MAAM,+BAA+B;;6NAGM,CAAC;AACnD,eAAO,MAAM,8BAA8B;;iOAGM,CAAC"}
1
+ {"version":3,"file":"dynamicFilterSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicFilter/slots/dynamicFilterSlots.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU;;6NAGM,CAAC;AAC9B,eAAO,MAAM,oBAAoB;;6NAGM,CAAC;AACxC,eAAO,MAAM,iBAAiB;;6NAGM,CAAC;AACrC,eAAO,MAAM,8BAA8B;;UAGM,CAAC;AAClD,eAAO,MAAM,sBAAsB;;+OAGM,CAAC;AAC1C,eAAO,MAAM,oBAAoB;;6NAGM,CAAC;AACxC,eAAO,MAAM,iCAAiC;;6NAGM,CAAC;AACrD,eAAO,MAAM,qBAAqB;;UAGM,CAAC;AACzC,eAAO,MAAM,aAAa;;6NAGM,CAAC;AACjC,eAAO,MAAM,wBAAwB;;UAGM,CAAC;AAC5C,eAAO,MAAM,yBAAyB;;UAGM,CAAC;AAC7C,eAAO,MAAM,iBAAiB;;UAGM,CAAC;AACrC,eAAO,MAAM,aAAa;;UAGY,CAAC;AACvC,eAAO,MAAM,4BAA4B;;6NAGY,CAAC;AACtD,eAAO,MAAM,0BAA0B;;UAGM,CAAC;AAE9C,eAAO,MAAM,8BAA8B;;UAGM,CAAC;AAElD,eAAO,MAAM,iBAAiB;;6NAGM,CAAC;AAErC,eAAO,MAAM,4BAA4B;;iOAGM,CAAC;AAEhD,eAAO,MAAM,sBAAsB;;UAGM,CAAC;AAC1C,eAAO,MAAM,qBAAqB;;UAGM,CAAC;AACzC,eAAO,MAAM,yBAAyB;;6NAGM,CAAC;AAC7C,eAAO,MAAM,yBAAyB;;6NAGM,CAAC;AAC7C,eAAO,MAAM,+BAA+B;;6NAGM,CAAC;AACnD,eAAO,MAAM,8BAA8B;;iOAGM,CAAC"}
@@ -1,105 +1,109 @@
1
- import { styled as o } from "@mui/material/styles";
1
+ import { styled as e } from "@mui/material/styles";
2
2
  import { Chip as i } from "../../Chip/Chip.js";
3
3
  import { DYNAMIC_FILTER_KEY_COMPONENT as t } from "../constants.js";
4
- import { dynamicFilterStyles as e } from "../DynamicFilter.styles.js";
4
+ import { dynamicFilterStyles as o } from "../DynamicFilter.styles.js";
5
5
  import { DynamicFilterSlots as r } from "./SlotsEnum.js";
6
6
  import { IconButton as n } from "../../extended/mui/IconButton/IconButton.js";
7
7
  import { Typography as p } from "../../extended/mui/Typography/Typography.js";
8
8
  import { ActionsContainer as s } from "../../CommonActions/components/ActionsContainer/ActionsContainer.js";
9
9
  import { Skeleton as a } from "../../extended/mui/Skeleton/Skeleton.js";
10
10
  import { Popover as l } from "../../extended/mui/Popover/Popover.js";
11
- const P = o("div", {
11
+ const C = e("div", {
12
12
  name: t,
13
13
  slot: r.root
14
- })(e?.root), C = o("div", {
14
+ })(o?.root), P = e("div", {
15
15
  name: t,
16
16
  slot: r.innerContainer
17
- })(e?.innerContainer), w = o("div", {
17
+ })(o?.innerContainer), w = e("div", {
18
18
  name: t,
19
19
  slot: r.inputFilter
20
- })(e?.inputFilter), A = o(n, {
20
+ })(o?.inputFilter), L = e(n, {
21
21
  name: t,
22
22
  slot: r.inputFilterTriggerButton
23
- })(e?.inputFilterTriggerButton), B = o("input", {
23
+ })(o?.inputFilterTriggerButton), b = e("input", {
24
24
  name: t,
25
25
  slot: r.inputFilterInput
26
- })(e?.inputFilterInput), L = o("div", {
26
+ })(o?.inputFilterInput), h = e("div", {
27
27
  name: t,
28
28
  slot: r.appliedFilters
29
- })(e?.appliedFilters), b = o("div", {
29
+ })(o?.appliedFilters), A = e("div", {
30
30
  name: t,
31
31
  slot: r.appliedFilterInnerContainer
32
- })(e?.appliedFilterInnerContainer), h = o(p, {
32
+ })(o?.appliedFilterInnerContainer), B = e(p, {
33
33
  name: t,
34
34
  slot: r.emptyStateLabel
35
- })(e?.emptyStateLabel), M = o("div", {
35
+ })(o?.emptyStateLabel), M = e("div", {
36
36
  name: t,
37
37
  slot: r.actions
38
- })(e?.actions), O = o(n, {
38
+ })(o?.actions), O = e(n, {
39
39
  name: t,
40
40
  slot: r.actionsClearButton
41
- })(e?.actionsClearButton), g = o(n, {
41
+ })(o?.actionsClearButton), g = e(n, {
42
42
  name: t,
43
43
  slot: r.actionsSubmitButton
44
- })(e?.actionsSubmitButton), T = o(l, {
44
+ })(o?.actionsSubmitButton), T = e(l, {
45
45
  name: t,
46
46
  slot: r.popoverMenu
47
- })(e?.popoverMenu), k = o(l, {
47
+ })(o?.popoverMenu), k = e(l, {
48
48
  name: t,
49
49
  slot: r.popoverFilter
50
- })(e?.popoverFilter), E = o("div", {
50
+ })(o?.popoverFilter), E = e("div", {
51
51
  name: t,
52
52
  slot: r.popoverFilterContainerFields
53
- })(e?.popoverFilterContainerFields), H = o(s, {
53
+ })(o?.popoverFilterContainerFields), H = e(s, {
54
54
  name: t,
55
55
  slot: r.popoverFilterActions
56
- })(e?.popoverFilterActions), N = o(a, {
56
+ })(o?.popoverFilterActions), N = e(a, {
57
57
  name: t,
58
58
  slot: r.inputFilterInputSkeleton
59
- })(e?.inputFilterInputSkeleton), W = o("div", {
59
+ })(o?.inputFilterInputSkeleton), W = e("div", {
60
60
  name: t,
61
61
  slot: r.chipWrapper
62
- })(e?.chipWrapper), _ = o(i, {
62
+ })(o?.chipWrapper), _ = e("span", {
63
+ name: t,
64
+ slot: r.appliedFilterChipLabel
65
+ })(o?.appliedFilterChipLabel), D = e(i, {
63
66
  name: t,
64
67
  slot: r.overflowMoreChip
65
- })(e?.overflowMoreChip), D = o(l, {
68
+ })(o?.overflowMoreChip), R = e(l, {
66
69
  name: t,
67
70
  slot: r.overflowPopover
68
- })(e?.overflowPopover), R = o("div", {
71
+ })(o?.overflowPopover), Y = e("div", {
69
72
  name: t,
70
73
  slot: r.overflowPopoverList
71
- })(e?.overflowPopoverList), Y = o("div", {
74
+ })(o?.overflowPopoverList), x = e("div", {
72
75
  name: t,
73
76
  slot: r.overflowPopoverItem
74
- })(e?.overflowPopoverItem), x = o("div", {
77
+ })(o?.overflowPopoverItem), K = e("div", {
75
78
  name: t,
76
79
  slot: r.overflowPopoverItemHeader
77
- })(e?.overflowPopoverItemHeader), K = o("span", {
80
+ })(o?.overflowPopoverItemHeader), j = e("span", {
78
81
  name: t,
79
82
  slot: r.overflowPopoverItemLabel
80
- })(e?.overflowPopoverItemLabel);
83
+ })(o?.overflowPopoverItemLabel);
81
84
  export {
82
85
  O as ActionsClearButtonStyled,
83
86
  M as ActionsStyled,
84
87
  g as ActionsSubmitButtonStyled,
85
- b as AppliedFilterInnerContainerStyled,
86
- L as AppliedFiltersStyled,
88
+ _ as AppliedFilterChipLabelStyled,
89
+ A as AppliedFilterInnerContainerStyled,
90
+ h as AppliedFiltersStyled,
87
91
  W as ChipWrapperStyled,
88
- h as EmptyStateLabelStyled,
89
- C as InnerContainerStyled,
92
+ B as EmptyStateLabelStyled,
93
+ P as InnerContainerStyled,
90
94
  N as InputFilterInputSkeletonStyled,
91
- B as InputFilterInputStyled,
95
+ b as InputFilterInputStyled,
92
96
  w as InputFilterStyled,
93
- A as InputFilterTriggerButtonStyled,
94
- _ as OverflowMoreChipStyled,
95
- x as OverflowPopoverItemHeaderStyled,
96
- K as OverflowPopoverItemLabelStyled,
97
- Y as OverflowPopoverItemStyled,
98
- R as OverflowPopoverListStyled,
99
- D as OverflowPopoverStyled,
97
+ L as InputFilterTriggerButtonStyled,
98
+ D as OverflowMoreChipStyled,
99
+ K as OverflowPopoverItemHeaderStyled,
100
+ j as OverflowPopoverItemLabelStyled,
101
+ x as OverflowPopoverItemStyled,
102
+ Y as OverflowPopoverListStyled,
103
+ R as OverflowPopoverStyled,
100
104
  E as PopoverContainerFieldsStyled,
101
105
  H as PopoverHeaderActionsStyled,
102
106
  T as PopoverMenuStyled,
103
107
  k as PopoverStyled,
104
- P as RootStyled
108
+ C as RootStyled
105
109
  };