@m4l/components 9.16.0 → 9.17.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 (65) hide show
  1. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  2. package/components/DynamicFilter/DynamicFilter.styles.js +12 -2
  3. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
  4. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +13 -13
  5. package/components/DynamicSort/DynamicSort.js +5 -5
  6. package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
  7. package/components/DynamicSort/DynamicSort.styles.js +217 -93
  8. package/components/DynamicSort/constants.js +4 -11
  9. package/components/DynamicSort/dictionary.d.ts +2 -0
  10. package/components/DynamicSort/dictionary.d.ts.map +1 -1
  11. package/components/DynamicSort/dictionary.js +10 -8
  12. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +36 -0
  13. package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
  14. package/components/DynamicSort/slots/DynamicSortSlots.js +102 -64
  15. package/components/DynamicSort/slots/SlotsEnum.d.ts +10 -1
  16. package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
  17. package/components/DynamicSort/slots/SlotsEnum.js +2 -2
  18. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts.map +1 -1
  19. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +20 -15
  20. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +3 -2
  21. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts.map +1 -1
  22. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +19 -19
  23. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +3 -1
  24. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
  25. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +86 -16
  26. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +10 -1
  27. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
  28. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +29 -9
  29. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
  30. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
  31. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +9 -11
  32. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts +2 -2
  33. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts.map +1 -1
  34. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +21 -21
  35. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +2 -1
  36. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts.map +1 -1
  37. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.js +2 -2
  38. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +2 -1
  39. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts.map +1 -1
  40. package/components/DynamicSort/subcomponents/InputSort/InputSort.js +44 -35
  41. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts +17 -41
  42. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts.map +1 -1
  43. package/components/DynamicSort/subcomponents/InputSort/useInputSort.js +57 -81
  44. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts +9 -0
  45. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -0
  46. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +85 -0
  47. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts +3 -0
  48. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts.map +1 -0
  49. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts +11 -0
  50. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts.map +1 -0
  51. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +16 -1
  52. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  53. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +52 -30
  54. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts +5 -4
  55. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
  56. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +35 -32
  57. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +4 -3
  58. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts.map +1 -1
  59. package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +17 -18
  60. package/components/DynamicSort/types.d.ts +4 -0
  61. package/components/DynamicSort/types.d.ts.map +1 -1
  62. package/package.json +8 -8
  63. package/test/mocks/dictionary-mock.d.ts +3 -0
  64. package/test/mocks/dictionary-mock.d.ts.map +1 -1
  65. package/components/DynamicSort/icons.js +0 -7
@@ -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,mBAwdjC,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,mBAkejC,CAAC"}
@@ -165,7 +165,13 @@ const n = "dynamic", p = {
165
165
  overflow: "hidden",
166
166
  position: "relative",
167
167
  "& .M4LChip-root": {
168
- borderRadius: r.vars.size.borderRadius.r1,
168
+ // Applied filter chips must use the design-system radius (r1-5 = 6px).
169
+ // This descendant override wins over the base Chip radius by specificity,
170
+ // so it has to set r1-5 explicitly to stay consistent with the design.
171
+ // Los chips de filtro aplicados deben usar el radio del design system
172
+ // (r1-5 = 6px). Este override por descendencia gana por especificidad
173
+ // sobre el radio base del Chip, por eso debe fijar r1-5 explícitamente.
174
+ borderRadius: r.vars.size.borderRadius["r1-5"],
169
175
  ...o(
170
176
  r,
171
177
  a?.size || "medium",
@@ -358,7 +364,11 @@ const n = "dynamic", p = {
358
364
  overflowMoreChip: ({ theme: r, ownerState: a }) => ({
359
365
  flexShrink: 0,
360
366
  cursor: "pointer",
361
- borderRadius: r.vars.size.borderRadius.r1,
367
+ // Match the applied filter chips radius (r1-5 = 6px) so the "More (N)"
368
+ // button is visually consistent with the rest of the chip row.
369
+ // Igualar el radio de los chips aplicados (r1-5 = 6px) para que el botón
370
+ // "More (N)" sea visualmente consistente con el resto de la fila de chips.
371
+ borderRadius: r.vars.size.borderRadius["r1-5"],
362
372
  ...o(
363
373
  r,
364
374
  a?.size || "medium",
@@ -1 +1 @@
1
- {"version":3,"file":"AppliedFilters.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,iBAAS,cAAc,qDAmEtB;AACD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AppliedFilters.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,iBAAS,cAAc,qDAyEtB;AACD,eAAe,cAAc,CAAC"}
@@ -5,44 +5,44 @@ import { DICCTIONARY as c } from "../../dictionary.js";
5
5
  import O from "../DynamicFilterBase/useDynamicFilterBase.js";
6
6
  import R from "./useAppliedFilters.js";
7
7
  import { useDynamicFilterStore as D } from "../../store/useDynamicFilterStore.js";
8
- import { AppliedFiltersStyled as f, AppliedFilterInnerContainerStyled as E, ChipWrapperStyled as M, EmptyStateLabelStyled as k, OverflowMoreChipStyled as I } from "../../slots/dynamicFilterSlots.js";
8
+ import { AppliedFiltersStyled as d, AppliedFilterInnerContainerStyled as E, ChipWrapperStyled as M, EmptyStateLabelStyled as k, OverflowMoreChipStyled as I } from "../../slots/dynamicFilterSlots.js";
9
9
  import T from "../AppliedFilterChip/AppliedFilterChip.js";
10
10
  import { Typography as _ } from "../../../extended/mui/Typography/Typography.js";
11
11
  import x from "../FilterActions/FilterActions.js";
12
12
  import P from "../OverflowPopover/OverflowPopover.js";
13
13
  function K() {
14
- const { visibleFilters: i, overflowFilters: r, isSkeleton: d, parentRef: m, containerRef: h, setChipRef: u, setMoreChipRef: y, setActionsRef: v } = R(), { size: l } = O(), { getLabel: n } = g(), C = D((e) => e.actions.openPopoverMenuFields), [t, p] = A(null), F = a((e) => {
14
+ const { visibleFilters: l, overflowFilters: r, isSkeleton: f, parentRef: m, containerRef: h, setChipRef: u, setMoreChipRef: y, setActionsRef: v } = R(), { size: i } = O(), { getLabel: n } = g(), C = D((e) => e.actions.openPopoverMenuFields), [t, p] = A(null), F = a((e) => {
15
15
  p(e.currentTarget);
16
- }, []), w = a(() => {
16
+ }, []), S = a(() => {
17
17
  p(null);
18
18
  }, []);
19
- if (d)
20
- return /* @__PURE__ */ o(f, {});
21
- const S = i.length === 0 && r.length === 0;
22
- return /* @__PURE__ */ s(f, { ref: m, children: [
19
+ if (f)
20
+ return /* @__PURE__ */ o(d, {});
21
+ const w = l.length === 0 && r.length === 0;
22
+ return /* @__PURE__ */ s(d, { ref: m, children: [
23
23
  /* @__PURE__ */ s(E, { ref: h, children: [
24
- i.map((e) => /* @__PURE__ */ o(
24
+ l.map((e) => /* @__PURE__ */ o(
25
25
  M,
26
26
  {
27
27
  ref: (b) => u(e.id, b),
28
- ownerState: { isWarning: e.field.color === "warning" },
28
+ ownerState: { isWarning: e.isSet && e.field.color === "warning" },
29
29
  children: /* @__PURE__ */ o(T, { ...e })
30
30
  },
31
31
  e.id
32
32
  )),
33
- S && /* @__PURE__ */ o(k, { "data-testid": "empty-state-label", component: "span", variant: "body", size: l, color: "inherit", onClick: C, children: n(c.label_no_filters_applied) })
33
+ w && /* @__PURE__ */ o(k, { "data-testid": "empty-state-label", component: "span", variant: "body", size: i, color: "inherit", onClick: C, children: n(c.label_no_filters_applied) })
34
34
  ] }),
35
35
  r.length > 0 && /* @__PURE__ */ o(
36
36
  I,
37
37
  {
38
38
  ref: y,
39
- size: l,
39
+ size: i,
40
40
  variant: "contained",
41
41
  color: t ? "info" : "default",
42
42
  opacity: !0,
43
43
  dataTestId: "overflow-more-chip",
44
44
  ownerState: { selected: !!t },
45
- label: /* @__PURE__ */ o(_, { component: "span", variant: "bodyDens", size: l, color: "inherit", children: `${n(c.label_more)} (${r.length})` }),
45
+ label: /* @__PURE__ */ o(_, { component: "span", variant: "bodyDens", size: i, color: "inherit", children: `${n(c.label_more)} (${r.length})` }),
46
46
  onClick: F
47
47
  }
48
48
  ),
@@ -52,7 +52,7 @@ function K() {
52
52
  {
53
53
  anchorEl: t,
54
54
  filters: r,
55
- onClose: w
55
+ onClose: S
56
56
  }
57
57
  )
58
58
  ] });
@@ -1,13 +1,13 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { useFlagsPresent as m, CommonFlags as n } from "@m4l/core";
3
- import { forwardRef as a } from "react";
2
+ import { forwardRef as m } from "react";
3
+ import { useFlagsPresent as n, CommonFlags as a } from "@m4l/core";
4
4
  import { DynamicSortProvider as i } from "./store/DynamicSortContext.js";
5
5
  import c from "./subcomponents/DynamicSortBase/DynamicSortBase.js";
6
- const h = a(
6
+ const h = m(
7
7
  (o, s) => {
8
8
  const { className: t, ...e } = o;
9
- return m([
10
- n.FLAG_DICTIONARY_LOADED
9
+ return n([
10
+ a.FLAG_DICTIONARY_LOADED
11
11
  ]) ? /* @__PURE__ */ r(i, { ...e, ref: s, children: /* @__PURE__ */ r(c, { className: t }) }) : null;
12
12
  }
13
13
  );
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicSort.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicSort/DynamicSort.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,eAAO,MAAM,iBAAiB,EAAE,iBA8S/B,CAAC"}
1
+ {"version":3,"file":"DynamicSort.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DynamicSort/DynamicSort.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,eAAO,MAAM,iBAAiB,EAAE,iBAwa/B,CAAC"}
@@ -1,18 +1,18 @@
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 s = "dynamic", p = {
4
4
  /**
5
5
  * Root: Estilos del contenedor principal del componente.
6
6
  */
7
- root: ({ theme: i, ownerState: r }) => ({
7
+ root: ({ theme: r, ownerState: i }) => ({
8
8
  containerName: s,
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
+ i?.size || "medium",
16
16
  "container",
17
17
  (a) => ({
18
18
  height: a,
@@ -24,38 +24,35 @@ const s = "dynamic", d = {
24
24
  /**
25
25
  * innerContainer: Estilos del contenedor interno del componente.
26
26
  */
27
- innerContainer: ({ theme: i, ownerState: r }) => ({
27
+ innerContainer: ({ theme: r }) => ({
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
+ overflow: "hidden"
40
37
  }),
41
38
  /**
42
- * inputSort: Estilos del contenedor del campo de entrada de ordenamiento.
39
+ * inputSort: Contenedor del input "Ordenar por" dentro del PopoverMenuFields.
40
+ * Estilos idénticos al inputFilter del DynamicFilter:
41
+ * fondo gris enabledOpacity, borderRadius r1-5, sin borderBottom.
43
42
  */
44
- inputSort: ({ theme: i, ownerState: r }) => ({
43
+ inputSort: ({ theme: r, ownerState: i }) => ({
45
44
  display: "flex",
46
45
  flexDirection: "row",
47
- paddingLeft: i.vars.size.baseSpacings.sp2,
48
- paddingRight: i.vars.size.baseSpacings.sp1,
49
- height: "100%",
46
+ paddingLeft: r.vars.size.baseSpacings.sp2,
47
+ paddingRight: r.vars.size.baseSpacings.sp1,
50
48
  overflow: "hidden",
51
- maxWidth: "120px",
52
49
  width: "100%",
53
50
  alignItems: "center",
54
- borderTopLeftRadius: i.vars.size.borderRadius.r1,
55
- borderBottomLeftRadius: i.vars.size.borderRadius.r1,
51
+ borderRadius: r.vars.size.borderRadius["r1-5"],
52
+ backgroundColor: r.vars.palette.default.enabledOpacity,
56
53
  ...o(
57
- i,
58
- r?.size || "medium",
54
+ r,
55
+ i?.size || "medium",
59
56
  "container",
60
57
  (a) => ({
61
58
  height: a
@@ -65,12 +62,12 @@ const s = "dynamic", d = {
65
62
  /**
66
63
  * inputSortInput: Estilos del campo de entrada de ordenamiento.
67
64
  */
68
- inputSortInput: ({ theme: i, ownerState: r }) => ({
65
+ inputSortInput: ({ theme: r, ownerState: i }) => ({
69
66
  width: "100%",
70
67
  background: "#ffffff00",
71
68
  ...o(
72
- i,
73
- r?.size || "medium",
69
+ r,
70
+ i?.size || "medium",
74
71
  "action",
75
72
  (a) => ({
76
73
  height: a,
@@ -80,79 +77,92 @@ const s = "dynamic", d = {
80
77
  ),
81
78
  fontFamily: "inherit",
82
79
  ...e(
83
- i.generalSettings.isMobile,
84
- r?.size || "medium",
80
+ r.generalSettings.isMobile,
81
+ i?.size || "medium",
85
82
  "bodyStandard"
86
83
  ),
87
- color: i.vars.palette.text.secondary,
84
+ color: r.vars.palette.text.secondary,
88
85
  border: 0,
89
86
  borderColor: "transparent",
90
- paddingLeft: i.vars.size.baseSpacings.sp2,
91
- paddingRight: i.vars.size.baseSpacings.sp2,
87
+ paddingLeft: r.vars.size.baseSpacings.sp2,
88
+ paddingRight: r.vars.size.baseSpacings.sp2,
92
89
  height: "100%",
93
90
  "&::placeholder": {
94
- color: i.vars.palette.text.secondary
91
+ color: r.vars.palette.text.secondary
95
92
  },
96
93
  "&:focus-visible": {
97
- color: i.vars.palette.text.secondary,
94
+ color: r.vars.palette.text.secondary,
98
95
  border: "unset",
99
- borderColor: i.vars.palette.primary.opacity,
100
- BorderRadius: i.vars.size.borderRadius["r0-5"],
96
+ borderColor: r.vars.palette.primary.opacity,
97
+ BorderRadius: r.vars.size.borderRadius["r0-5"],
101
98
  outline: "none!important"
102
99
  }
103
100
  }),
104
101
  /**
105
102
  * appliedSorts: Estilos del contenedor de los campos de ordenamiento aplicados.
106
103
  */
107
- appliedSorts: ({ theme: i, ownerState: r }) => ({
104
+ appliedSorts: ({ theme: r, ownerState: i }) => ({
108
105
  width: "100%",
109
106
  height: "fit-content",
110
107
  display: "flex",
111
108
  alignItems: "center",
109
+ // Gap sp1 (4px) entre el contenedor de chips y el chip "Más", idéntico al
110
+ // DynamicFilter (appliedFilters). Sin esto el chip "Más" queda pegado a los chips.
111
+ gap: r.vars.size.baseSpacings.sp1,
112
112
  borderLeft: "none",
113
113
  margin: "0px",
114
- padding: `0px ${i.vars.size.baseSpacings.sp1}`,
114
+ padding: "0px",
115
115
  flex: 1,
116
116
  overflow: "hidden",
117
117
  ...o(
118
- i,
119
- r?.size || "medium",
118
+ r,
119
+ i?.size || "medium",
120
120
  "container",
121
121
  (a) => ({
122
122
  height: a,
123
123
  maxHeight: a,
124
124
  minHeight: a
125
125
  })
126
- )
126
+ ),
127
+ // Fuerza la misma altura en TODOS los chips del contenedor (incluido el chip "Más")
128
+ "& .M4LChip-root": {
129
+ ...o(r, i?.size || "medium", "action", (a) => ({
130
+ height: a,
131
+ minHeight: a,
132
+ maxHeight: a
133
+ }))
134
+ }
127
135
  }),
128
136
  /**
129
- * appliedSortInnerContainer: Estilos del contenedor interno de los campos de ordenamiento aplicados.
137
+ * appliedSortInnerContainer: Contenedor de los chips de sorts.
138
+ * flex: '0 1 auto' — no crece, solo encoge. Igual que DynamicFilter.
130
139
  */
131
- appliedSortInnerContainer: ({ theme: i, ownerState: r }) => ({
132
- padding: i.vars.size.baseSpacings["sp0-5"],
133
- gap: i.vars.size.baseSpacings.sp1,
140
+ appliedSortInnerContainer: ({ theme: r, ownerState: i }) => ({
141
+ padding: r.vars.size.baseSpacings["sp0-5"],
142
+ gap: r.vars.size.baseSpacings.sp1,
134
143
  height: "fit-content",
135
144
  display: "flex",
136
145
  flexWrap: "nowrap",
137
- width: "100%",
146
+ flex: "0 1 auto",
147
+ minWidth: 0,
138
148
  justifyContent: "flex-start",
139
149
  alignItems: "center",
140
- overflow: "auto hidden",
150
+ overflow: "hidden",
141
151
  position: "relative",
142
152
  "& .M4LChip-root": {
143
- borderRadius: i.vars.size.borderRadius.r1,
153
+ borderRadius: r.vars.size.borderRadius["r1-5"],
144
154
  ...o(
145
- i,
146
- r?.size || "medium",
155
+ r,
156
+ i?.size || "medium",
147
157
  "action",
148
158
  (a) => ({
149
159
  height: a
150
160
  })
151
161
  ),
152
162
  "& .M4LIconButton-styledMUIIconButton:hover": {
153
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundHover} !important`,
163
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
154
164
  "& .M4LIcon-icon": {
155
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundColorTone} !important`
165
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundColorTone} !important`
156
166
  }
157
167
  }
158
168
  }
@@ -160,89 +170,96 @@ const s = "dynamic", d = {
160
170
  /**
161
171
  * actions: Estilos del contenedor de los botones de acción.
162
172
  */
163
- actions: ({ theme: i, ownerState: r }) => ({
164
- gridArea: "actions-filter",
173
+ actions: ({ theme: r, ownerState: i }) => ({
165
174
  overflow: "hidden",
166
175
  display: "flex",
167
176
  flexDirection: "row",
168
- gap: i.vars.size.baseSpacings["sp0-5"],
169
- padding: i.vars.size.baseSpacings.sp1,
177
+ gap: r.vars.size.baseSpacings["sp0-5"],
178
+ padding: r.vars.size.baseSpacings.sp1,
170
179
  height: "100%",
171
180
  alignItems: "center",
172
- borderTopRightRadius: i.vars.size.borderRadius.r1,
173
- borderBottomRightRadius: i.vars.size.borderRadius.r1,
174
- boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.border.secondary}`,
175
- ...!r?.visibleRefresh && !r?.isDirty && {
181
+ borderTopRightRadius: r.vars.size.borderRadius.r1,
182
+ borderBottomRightRadius: r.vars.size.borderRadius.r1,
183
+ flexShrink: 0,
184
+ // minWidth garantiza que useChipsOverflow siempre mida un ancho > 0
185
+ // incluso antes de que el layout del container-type:inline-size se resuelva.
186
+ // Se calcula como 2 botones (action size) + gap + padding horizontal.
187
+ ...o(r, i?.size || "medium", "action", (a) => ({
188
+ minWidth: `calc(${a} * 2 + ${r.vars.size.baseSpacings["sp0-5"]} + ${r.vars.size.baseSpacings.sp1} * 2)`
189
+ })),
190
+ ...!i?.visibleRefresh && !i?.isDirty && {
176
191
  display: "none"
177
- },
178
- ...r?.inEdition && r?.isValid && {
179
- boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.border.main}`
180
- },
181
- ...!r?.isValid && {
182
- boxShadow: `inset 1px 0px 0px 0px ${i.vars.palette.error.enabled}`
183
192
  }
184
193
  }),
185
194
  /**
186
195
  * actionsClearButton: Estilos del botón de acción de limpiar.
187
196
  */
188
- actionsClearButton: ({ theme: i }) => ({
197
+ actionsClearButton: ({ theme: r }) => ({
189
198
  visibility: "visible",
190
199
  "&:hover": {
191
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundHover} !important`,
200
+ backgroundColor: `${r.vars.palette.chips.error.contained.backgroundHover} !important`,
201
+ // mask strategy icons: color via backgroundColor
192
202
  "& .M4LIcon-icon": {
193
- backgroundColor: `${i.vars.palette.chips.error.contained.backgroundColorTone} !important`
203
+ backgroundColor: `${r.vars.palette.error.semanticText} !important`
204
+ },
205
+ // component strategy icons (createSvgIcon): color via fill on SVG paths
206
+ "& .MuiSvgIcon-root svg path, & .MuiSvgIcon-root path": {
207
+ fill: `${r.vars.palette.error.semanticText} !important`
194
208
  }
195
209
  }
196
210
  }),
197
211
  /**
198
212
  * actionsSubmitButton: Estilos del botón de acción de envío de formulario.
199
213
  */
200
- actionsSubmitButton: ({ theme: i, ownerState: r }) => ({
201
- ...r?.isDirty ? {
214
+ actionsSubmitButton: ({ theme: r, ownerState: i }) => ({
215
+ ...i?.isDirty ? {
202
216
  animation: "changeBgColor 0.9s ease infinite",
203
217
  "& .M4LIcon-icon": {
204
- background: `${i.vars.palette.primary.main} !important`
218
+ background: `${r.vars.palette.primary.main} !important`
219
+ },
220
+ "& .MuiSvgIcon-root svg path, & .MuiSvgIcon-root path": {
221
+ fill: `${r.vars.palette.chips.info.contained.color} !important`
205
222
  }
206
223
  } : null,
207
224
  //Create and apply animation with change background color red and green
208
225
  "@keyframes changeBgColor": {
209
226
  "0%": {
210
- background: i.vars.palette.primary.hoverOpacity
227
+ background: r.vars.palette.primary.hoverOpacity
211
228
  },
212
229
  "50%": {
213
- background: i.vars.palette.primary.activeOpacity
230
+ background: r.vars.palette.primary.activeOpacity
214
231
  },
215
232
  "100%": {
216
- background: i.vars.palette.primary.hoverOpacity
233
+ background: r.vars.palette.primary.hoverOpacity
217
234
  }
218
235
  }
219
236
  }),
220
237
  /**
221
238
  * popoverMenu: Estilos del menú emergente.
222
239
  */
223
- popoverMenu: ({ theme: i }) => ({
240
+ popoverMenu: ({ theme: r }) => ({
224
241
  "& .MuiPaper-root": {
225
242
  display: "flex",
226
243
  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
244
+ padding: r.vars.size.baseSpacings.sp3,
245
+ gap: r.vars.size.baseSpacings.sp1,
246
+ borderRadius: r.vars.size.borderRadius.r1,
247
+ backgroundColor: r.vars.palette.background.default
231
248
  }
232
249
  }),
233
250
  /**
234
251
  * popoverSort: Estilos del menú emergente de ordenamiento.
235
252
  */
236
- popoverSort: ({ theme: i }) => ({
253
+ popoverSort: ({ theme: r }) => ({
237
254
  width: "auto",
238
255
  "& .MuiPaper-root": {
239
256
  padding: "0 !important",
240
257
  minWidth: "220px",
241
258
  maxWidth: "100%",
242
259
  minHeight: "auto",
243
- borderRadius: `${i.vars.size.borderRadius.r3}!important`,
244
- backgroundColor: i.vars.palette.background.default,
245
- boxShadow: i.customShadows?.z3,
260
+ borderRadius: `${r.vars.size.borderRadius.r3}!important`,
261
+ backgroundColor: r.vars.palette.background.default,
262
+ boxShadow: r.customShadows?.z3,
246
263
  "& .M4LPopover-arrowStyle": {
247
264
  display: "none"
248
265
  },
@@ -255,7 +272,7 @@ const s = "dynamic", d = {
255
272
  overflow: "visible"
256
273
  },
257
274
  "& .M4LWindowBase-root": {
258
- borderRadius: `${i.vars.size.borderRadius.r3} !important`,
275
+ borderRadius: `${r.vars.size.borderRadius.r3} !important`,
259
276
  border: "unset!important",
260
277
  "& .M4LWindowBase-headerWindowComponent": {
261
278
  cursor: "unset"
@@ -266,28 +283,28 @@ const s = "dynamic", d = {
266
283
  /**
267
284
  * popoverSortContainerFields: Estilos del contenedor de campos del menú emergente de ordenamiento.
268
285
  */
269
- popoverSortContainerFields: ({ theme: i }) => ({
286
+ popoverSortContainerFields: ({ theme: r }) => ({
270
287
  display: "flex",
271
288
  flexDirection: "column",
272
- gap: i.vars.size.baseSpacings.sp3
289
+ gap: r.vars.size.baseSpacings.sp3
273
290
  }),
274
291
  /**
275
292
  * popoverSortActions: Estilos del contenedor de acciones del menú emergente de ordenamiento.
276
293
  */
277
- popoverSortActions: ({ theme: i }) => ({
278
- paddingTop: i.vars.size.baseSpacings.sp6
294
+ popoverSortActions: ({ theme: r }) => ({
295
+ paddingTop: r.vars.size.baseSpacings.sp6
279
296
  }),
280
297
  /**
281
298
  * inputSortSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
282
299
  */
283
- inputSortSkeleton: ({ theme: i, ownerState: r }) => ({
300
+ inputSortSkeleton: ({ theme: r, ownerState: i }) => ({
284
301
  width: "100%",
285
302
  minWidth: "80px",
286
- marginLeft: i.vars.size.baseSpacings.sp2,
287
- marginRight: i.vars.size.baseSpacings.sp2,
303
+ marginLeft: r.vars.size.baseSpacings.sp2,
304
+ marginRight: r.vars.size.baseSpacings.sp2,
288
305
  ...o(
289
- i,
290
- r?.size || "medium",
306
+ r,
307
+ i?.size || "medium",
291
308
  "base",
292
309
  (a) => ({
293
310
  height: a,
@@ -295,8 +312,115 @@ const s = "dynamic", d = {
295
312
  maxHeight: a
296
313
  })
297
314
  )
315
+ }),
316
+ /** chipWrapper: Wrapper de cada chip — inline-flex y flexShrink:0 son críticos para useChipsOverflow. */
317
+ chipWrapper: () => ({
318
+ display: "inline-flex",
319
+ flexShrink: 0
320
+ }),
321
+ /**
322
+ * inputSortTriggerButton: Botón trigger cuadrado que reemplaza el input visible.
323
+ * Patrón idéntico al inputFilterTriggerButton del DynamicFilter.
324
+ */
325
+ inputSortTriggerButton: ({ theme: r, ownerState: i }) => ({
326
+ flexShrink: 0,
327
+ cursor: "pointer",
328
+ borderRadius: r.vars.size.borderRadius.r1,
329
+ ...i?.selected && {
330
+ backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
331
+ border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
332
+ outline: "none !important",
333
+ "&:hover, &:focus, &:focus-visible": {
334
+ backgroundColor: `${r.vars.palette.chips.info.contained.backgroundColor} !important`,
335
+ border: `${r.vars.size.borderStroke.container} ${r.vars.palette.info.semanticText}`,
336
+ outline: "none !important"
337
+ }
338
+ }
339
+ }),
340
+ /**
341
+ * emptyStateLabel: Label "Sin sorts aplicados" cuando el array de sorts está vacío.
342
+ */
343
+ // Igual que DynamicFilter.emptyStateLabel + cursor pointer para abrir el popover al hacer clic
344
+ emptyStateLabel: ({ theme: r }) => ({
345
+ display: "inline-flex",
346
+ alignItems: "center",
347
+ color: r.vars.palette.text.secondary,
348
+ cursor: "pointer",
349
+ userSelect: "none"
350
+ }),
351
+ /**
352
+ * overflowMoreChip: Chip "Más (N)" que agrupa los sorts que no caben.
353
+ */
354
+ overflowMoreChip: ({ theme: r }) => ({
355
+ flexShrink: 0,
356
+ cursor: "pointer",
357
+ // Mismo radius que los chips aplicados (r1-5, 6px) para alinear el chip "Más".
358
+ borderRadius: r.vars.size.borderRadius["r1-5"]
359
+ }),
360
+ /** overflowSortPopover: Popover container for overflow sorts, identical to DynamicFilter.overflowPopover. */
361
+ overflowSortPopover: ({ theme: r }) => ({
362
+ "& .MuiPaper-root": {
363
+ display: "flex",
364
+ flexDirection: "column",
365
+ padding: `${r.vars.size.baseSpacings.sp3} ${r.vars.size.baseSpacings.sp2}`,
366
+ gap: r.vars.size.baseSpacings.sp1,
367
+ borderRadius: r.vars.size.borderRadius.r2,
368
+ backgroundColor: r.vars.palette.background.default,
369
+ boxShadow: r.customShadows?.z3,
370
+ width: "280px"
371
+ }
372
+ }),
373
+ /** overflowSortList: Vertical list inside the overflow popover, identical to DynamicFilter.overflowPopoverList. */
374
+ overflowSortList: ({ theme: r }) => ({
375
+ display: "flex",
376
+ flexDirection: "column",
377
+ gap: r.vars.size.baseSpacings.sp2
378
+ }),
379
+ /** overflowSortItem: Clickable item row inside the overflow popover, identical to DynamicFilter.overflowPopoverItem. */
380
+ overflowSortItem: ({ theme: r, ownerState: i }) => ({
381
+ display: "flex",
382
+ alignItems: "center",
383
+ alignSelf: "stretch",
384
+ gap: r.vars.size.baseSpacings.sp2,
385
+ padding: r.vars.size.baseSpacings.sp2,
386
+ borderBottom: `1px solid ${r.vars.palette.border.disabled}`,
387
+ background: r.vars.palette.background.default,
388
+ borderRadius: r.vars.size.borderRadius["r1-5"],
389
+ cursor: "pointer",
390
+ transition: "background-color 0.3s ease",
391
+ "&:hover": {
392
+ backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
393
+ },
394
+ ...i?.selected && {
395
+ backgroundColor: `${r.vars.palette.default.hoverOpacity} !important`
396
+ },
397
+ "&:last-child": {
398
+ borderBottom: "none"
399
+ }
400
+ }),
401
+ /** overflowSortItemHeader: Center section of each overflow item showing label and direction chip. */
402
+ overflowSortItemHeader: ({ theme: r }) => ({
403
+ display: "flex",
404
+ flexDirection: "row",
405
+ flexWrap: "wrap",
406
+ alignItems: "center",
407
+ flex: 1,
408
+ minWidth: 0,
409
+ rowGap: r.vars.size.baseSpacings["sp0-5"],
410
+ columnGap: r.vars.size.baseSpacings.sp1,
411
+ "& > span:first-of-type": {
412
+ flexBasis: "100%"
413
+ }
414
+ }),
415
+ /** overflowSortItemLabel: Field name label text inside the overflow item. */
416
+ overflowSortItemLabel: ({ theme: r }) => ({
417
+ ...e(!1, "medium", "body"),
418
+ color: r.vars.palette.text.primary,
419
+ flex: 1,
420
+ whiteSpace: "normal",
421
+ wordBreak: "break-word"
298
422
  })
299
423
  };
300
424
  export {
301
- d as dynamicSortStyles
425
+ p as dynamicSortStyles
302
426
  };
@@ -1,13 +1,6 @@
1
- const s = "M4LDynamicSort", t = "M4LDynamicSortStore", o = "frontend/components/Dynamic_sort/assets/icons", e = {
2
- refresh: "restart.svg",
3
- sort: "sort.svg",
4
- list_bulleted: "list_bulleted.svg",
5
- clean: "clean.svg"
6
- }, n = ["asc", "desc"];
1
+ const c = "M4LDynamicSort", o = "M4LDynamicSortStore", t = ["asc", "desc"];
7
2
  export {
8
- e as ASSETS,
9
- o as ASSETS_URL,
10
- s as DYNAMIC_SORT_KEY_COMPONENT,
11
- t as DYNAMIC_SORT_STORE_ID,
12
- n as OPERATORS
3
+ c as DYNAMIC_SORT_KEY_COMPONENT,
4
+ o as DYNAMIC_SORT_STORE_ID,
5
+ t as OPERATORS
13
6
  };
@@ -16,6 +16,8 @@ export declare const DICCTIONARY: {
16
16
  readonly operator_desc: "operator_desc";
17
17
  readonly label_boolean_operand1: "label_boolean_operand1";
18
18
  readonly label_no_fields_available: "label_no_fields_available";
19
+ readonly label_no_sorts_applied: "label_no_sorts_applied";
20
+ readonly label_more: "label_more";
19
21
  };
20
22
  export type TypeDictionary = typeof DICCTIONARY;
21
23
  /**