@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.
- package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
- package/components/DynamicFilter/DynamicFilter.styles.js +82 -60
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +1 -0
- package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -1
- package/components/DynamicFilter/hooks/useChipsOverflow.js +50 -44
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +1 -0
- package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicFilter/slots/SlotsEnum.js +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +3 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +43 -39
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +26 -19
- package/components/DynamicSort/DynamicSort.js +6 -6
- package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
- package/components/DynamicSort/DynamicSort.styles.js +40 -14
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +3 -0
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
- package/components/DynamicSort/slots/DynamicSortSlots.js +44 -40
- package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -0
- package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicSort/slots/SlotsEnum.js +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +2 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +70 -54
- package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts +5 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts.map +1 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -0
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +23 -21
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +15 -17
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +2 -0
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +58 -46
- package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +30 -30
- package/components/DynamicSort/types.d.ts +6 -0
- package/components/DynamicSort/types.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/constants.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/constants.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/constants.js +4 -3
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +2 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +2 -2
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +19 -15
- package/hooks/useDynamicFilterAndSort/styles.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/styles.js +58 -37
- package/hooks/useDynamicFilterAndSort/types.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts.map +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +204 -172
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppliedFilterChip.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppliedFilterChip.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD;;;;;GAKG;AACH,iBAAS,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,oDAoCpD;AACD,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isValidElement as
|
|
3
|
-
import { Chip as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as m } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { isValidElement as f, cloneElement as b } from "react";
|
|
3
|
+
import { Chip as h } from "../../../Chip/Chip.js";
|
|
4
|
+
import F from "../DynamicFilterBase/useDynamicFilterBase.js";
|
|
5
|
+
import u from "./useAppliedFilterChip.js";
|
|
6
|
+
import { AppliedFilterChipLabelStyled as $ } from "../../slots/dynamicFilterSlots.js";
|
|
7
|
+
import { Typography as y } from "../../../extended/mui/Typography/Typography.js";
|
|
7
8
|
function j(i) {
|
|
8
|
-
const { fixed: n, isSet: a, field:
|
|
9
|
+
const { fixed: n, isSet: a, field: p } = i, { size: o } = F(), { onEditFilter: c, onDelete: d, iconFieldUrl: l, labels: e } = u(i), r = a ? p.color ?? "default" : "error", s = f(l) ? b(l, {
|
|
9
10
|
size: o,
|
|
10
|
-
color: `chips.${
|
|
11
|
-
}) :
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
11
|
+
color: `chips.${r}.contained.color`
|
|
12
|
+
}) : l;
|
|
13
|
+
return /* @__PURE__ */ t(
|
|
14
|
+
h,
|
|
14
15
|
{
|
|
15
16
|
size: o,
|
|
16
17
|
opacity: !0,
|
|
17
|
-
color:
|
|
18
|
+
color: r,
|
|
18
19
|
variant: "contained",
|
|
19
|
-
onClick:
|
|
20
|
-
startIcon:
|
|
21
|
-
label: /* @__PURE__ */ m(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
onClick: c,
|
|
21
|
+
startIcon: s,
|
|
22
|
+
label: /* @__PURE__ */ m(
|
|
23
|
+
$,
|
|
24
|
+
{
|
|
25
|
+
title: `${e.labelField} ${e.labelOperator} ${e.labelOperands}`,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ t(y, { component: "span", variant: "bodyDens", size: o, color: "inherit", children: `${e.labelField} ${e.labelOperator} ` }),
|
|
28
|
+
` ${e.labelOperands}`
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
onDeleted: n ? void 0 : d
|
|
26
33
|
}
|
|
27
34
|
);
|
|
28
35
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import { useFlagsPresent as n, CommonFlags as
|
|
4
|
-
import { DynamicSortProvider as
|
|
3
|
+
import { useFlagsPresent as n, CommonFlags as i } from "@m4l/core";
|
|
4
|
+
import { DynamicSortProvider as l } from "./store/DynamicSortContext.js";
|
|
5
5
|
import c from "./subcomponents/DynamicSortBase/DynamicSortBase.js";
|
|
6
6
|
const h = m(
|
|
7
|
-
(o,
|
|
8
|
-
const { className:
|
|
7
|
+
(o, t) => {
|
|
8
|
+
const { className: e, leadingSeparator: s, ...a } = o;
|
|
9
9
|
return n([
|
|
10
|
-
|
|
11
|
-
]) ? /* @__PURE__ */ r(
|
|
10
|
+
i.FLAG_DICTIONARY_LOADED
|
|
11
|
+
]) ? /* @__PURE__ */ r(l, { ...a, ref: t, children: /* @__PURE__ */ r(c, { className: e, leadingSeparator: s }) }) : null;
|
|
12
12
|
}
|
|
13
13
|
);
|
|
14
14
|
export {
|
|
@@ -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,
|
|
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,iBAmc/B,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { getTypographyStyles as
|
|
1
|
+
import { getTypographyStyles as s } from "../../utils/getTypographyStyles.js";
|
|
2
2
|
import { getSizeStyles as o } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
-
const
|
|
3
|
+
const n = "dynamic", l = {
|
|
4
4
|
/**
|
|
5
5
|
* Root: Estilos del contenedor principal del componente.
|
|
6
6
|
*/
|
|
7
7
|
root: ({ theme: r, ownerState: i }) => ({
|
|
8
|
-
containerName:
|
|
8
|
+
containerName: n,
|
|
9
9
|
containerType: "inline-size",
|
|
10
10
|
width: "100%",
|
|
11
11
|
height: "auto",
|
|
@@ -76,7 +76,7 @@ const s = "dynamic", p = {
|
|
|
76
76
|
})
|
|
77
77
|
),
|
|
78
78
|
fontFamily: "inherit",
|
|
79
|
-
...
|
|
79
|
+
...s(
|
|
80
80
|
r.generalSettings.isMobile,
|
|
81
81
|
i?.size || "medium",
|
|
82
82
|
"bodyStandard"
|
|
@@ -106,6 +106,11 @@ const s = "dynamic", p = {
|
|
|
106
106
|
height: "fit-content",
|
|
107
107
|
display: "flex",
|
|
108
108
|
alignItems: "center",
|
|
109
|
+
// Standalone reads left-to-right (flex-start). The toolbar hook right-aligns
|
|
110
|
+
// it (flex-end) only when it shares a row with the filter, by setting this
|
|
111
|
+
// inherited variable — which also works in production, where Emotion strips
|
|
112
|
+
// the slot labels that class-based selectors would rely on.
|
|
113
|
+
justifyContent: "var(--m4l-dynamic-sort-justify-content, flex-start)",
|
|
109
114
|
// Gap sp1 (4px) entre el contenedor de chips y el chip "Más", idéntico al
|
|
110
115
|
// DynamicFilter (appliedFilters). Sin esto el chip "Más" queda pegado a los chips.
|
|
111
116
|
gap: r.vars.size.baseSpacings.sp1,
|
|
@@ -113,6 +118,9 @@ const s = "dynamic", p = {
|
|
|
113
118
|
margin: "0px",
|
|
114
119
|
padding: "0px",
|
|
115
120
|
flex: 1,
|
|
121
|
+
// min-width:0 lets this flex item shrink below its content min-content so
|
|
122
|
+
// the empty-state label can truncate with ellipsis instead of overflowing.
|
|
123
|
+
minWidth: 0,
|
|
116
124
|
overflow: "hidden",
|
|
117
125
|
...o(
|
|
118
126
|
r,
|
|
@@ -133,6 +141,15 @@ const s = "dynamic", p = {
|
|
|
133
141
|
}))
|
|
134
142
|
}
|
|
135
143
|
}),
|
|
144
|
+
/**
|
|
145
|
+
* inputSortLeading: Wrapper medible del divisor + trigger en el grupo derecho.
|
|
146
|
+
*/
|
|
147
|
+
inputSortLeading: ({ theme: r }) => ({
|
|
148
|
+
display: "flex",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
flexShrink: 0,
|
|
151
|
+
gap: r.vars.size.baseSpacings["sp1-5"]
|
|
152
|
+
}),
|
|
136
153
|
/**
|
|
137
154
|
* appliedSortInnerContainer: Contenedor de los chips de sorts.
|
|
138
155
|
* flex: '0 1 auto' — no crece, solo encoge. Igual que DynamicFilter.
|
|
@@ -181,12 +198,16 @@ const s = "dynamic", p = {
|
|
|
181
198
|
borderTopRightRadius: r.vars.size.borderRadius.r1,
|
|
182
199
|
borderBottomRightRadius: r.vars.size.borderRadius.r1,
|
|
183
200
|
flexShrink: 0,
|
|
184
|
-
// minWidth
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
201
|
+
// minWidth guarantees useChipsOverflow always measures a width > 0 before the
|
|
202
|
+
// container-type:inline-size layout resolves. Reserve only the buttons actually
|
|
203
|
+
// rendered (actionsCount) — a fixed 2 inflated the wrapper around a lone refresh
|
|
204
|
+
// and collapsed chips to "Más" ~1 button early.
|
|
205
|
+
...o(r, i?.size || "medium", "action", (a) => {
|
|
206
|
+
const e = Number(i?.actionsCount) || 1, t = Math.max(e - 1, 0);
|
|
207
|
+
return {
|
|
208
|
+
minWidth: `calc(${a} * ${e} + ${r.vars.size.baseSpacings["sp0-5"]} * ${t} + ${r.vars.size.baseSpacings.sp1} * 2)`
|
|
209
|
+
};
|
|
210
|
+
}),
|
|
190
211
|
...!i?.visibleRefresh && !i?.isDirty && {
|
|
191
212
|
display: "none"
|
|
192
213
|
}
|
|
@@ -342,8 +363,13 @@ const s = "dynamic", p = {
|
|
|
342
363
|
*/
|
|
343
364
|
// Igual que DynamicFilter.emptyStateLabel + cursor pointer para abrir el popover al hacer clic
|
|
344
365
|
emptyStateLabel: ({ theme: r }) => ({
|
|
345
|
-
|
|
346
|
-
|
|
366
|
+
// Truncate with ellipsis when the label does not fit (e.g. narrow column).
|
|
367
|
+
display: "block",
|
|
368
|
+
minWidth: 0,
|
|
369
|
+
maxWidth: "100%",
|
|
370
|
+
overflow: "hidden",
|
|
371
|
+
textOverflow: "ellipsis",
|
|
372
|
+
whiteSpace: "nowrap",
|
|
347
373
|
color: r.vars.palette.text.secondary,
|
|
348
374
|
cursor: "pointer",
|
|
349
375
|
userSelect: "none"
|
|
@@ -414,7 +440,7 @@ const s = "dynamic", p = {
|
|
|
414
440
|
}),
|
|
415
441
|
/** overflowSortItemLabel: Field name label text inside the overflow item. */
|
|
416
442
|
overflowSortItemLabel: ({ theme: r }) => ({
|
|
417
|
-
...
|
|
443
|
+
...s(!1, "medium", "body"),
|
|
418
444
|
color: r.vars.palette.text.primary,
|
|
419
445
|
flex: 1,
|
|
420
446
|
whiteSpace: "normal",
|
|
@@ -422,5 +448,5 @@ const s = "dynamic", p = {
|
|
|
422
448
|
})
|
|
423
449
|
};
|
|
424
450
|
export {
|
|
425
|
-
|
|
451
|
+
l as dynamicSortStyles
|
|
426
452
|
};
|
|
@@ -13,6 +13,9 @@ export declare const InputSortInputStyled: import('@emotion/styled').StyledCompo
|
|
|
13
13
|
export declare const AppliedSortsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
14
14
|
ownerState?: (Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>) | undefined;
|
|
15
15
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const InputSortLeadingStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
16
19
|
export declare const AppliedSortInnerContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
17
20
|
ownerState?: (Partial<import('../types').DynamicSortOwnerState> & Record<string, unknown>) | undefined;
|
|
18
21
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicSortSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicSort/slots/DynamicSortSlots.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU;;6NAGI,CAAC;AAC5B,eAAO,MAAM,oBAAoB;;6NAGI,CAAC;AACtC,eAAO,MAAM,eAAe;;6NAGI,CAAC;AACjC,eAAO,MAAM,oBAAoB;;+OAGI,CAAC;AACtC,eAAO,MAAM,kBAAkB;;6NAGI,CAAC;
|
|
1
|
+
{"version":3,"file":"DynamicSortSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicSort/slots/DynamicSortSlots.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU;;6NAGI,CAAC;AAC5B,eAAO,MAAM,oBAAoB;;6NAGI,CAAC;AACtC,eAAO,MAAM,eAAe;;6NAGI,CAAC;AACjC,eAAO,MAAM,oBAAoB;;+OAGI,CAAC;AACtC,eAAO,MAAM,kBAAkB;;6NAGI,CAAC;AAEpC,eAAO,MAAM,sBAAsB;;6NAGI,CAAC;AACxC,eAAO,MAAM,+BAA+B;;6NAGI,CAAC;AACjD,eAAO,MAAM,aAAa;;6NAGI,CAAC;AAC/B,eAAO,MAAM,wBAAwB;;UAGI,CAAC;AAC1C,eAAO,MAAM,yBAAyB;;UAGI,CAAC;AAC3C,eAAO,MAAM,iBAAiB;;UAGI,CAAC;AACnC,eAAO,MAAM,aAAa;;UAGQ,CAAC;AACnC,eAAO,MAAM,4BAA4B;;6NAGQ,CAAC;AAClD,eAAO,MAAM,0BAA0B;;UAGE,CAAC;AAE1C,eAAO,MAAM,4BAA4B;;UAGD,CAAC;AAEzC,+GAA+G;AAC/G,eAAO,MAAM,qBAAqB;;6NAGA,CAAC;AAEnC,wFAAwF;AACxF,eAAO,MAAM,4BAA4B;;UAGI,CAAC;AAE9C,uDAAuD;AACvD,eAAO,MAAM,qBAAqB;;UAGI,CAAC;AAEvC,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB;;UAGI,CAAC;AAExC,wDAAwD;AACxD,eAAO,MAAM,yBAAyB;;UAGI,CAAC;AAE3C,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB;;6NAGI,CAAC;AAExC,mDAAmD;AACnD,eAAO,MAAM,sBAAsB;;6NAGI,CAAC;AAExC,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B;;6NAGI,CAAC;AAE9C,gDAAgD;AAChD,eAAO,MAAM,2BAA2B;;iOAGI,CAAC"}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { styled as o } from "@mui/material/styles";
|
|
2
|
-
import { Chip as
|
|
2
|
+
import { Chip as i } from "../../Chip/Chip.js";
|
|
3
3
|
import { dynamicSortStyles as t } from "../DynamicSort.styles.js";
|
|
4
4
|
import { DYNAMIC_SORT_KEY_COMPONENT as e } from "../constants.js";
|
|
5
5
|
import { DynamicSortSlots as r } from "./SlotsEnum.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Typography as i } from "../../extended/mui/Typography/Typography.js";
|
|
6
|
+
import { Typography as p } from "../../extended/mui/Typography/Typography.js";
|
|
8
7
|
import { ActionsContainer as S } from "../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
8
|
+
import { IconButton as n } from "../../extended/mui/IconButton/IconButton.js";
|
|
9
9
|
import { Skeleton as s } from "../../extended/mui/Skeleton/Skeleton.js";
|
|
10
10
|
import { Popover as l } from "../../extended/mui/Popover/Popover.js";
|
|
11
11
|
const w = o("div", {
|
|
12
12
|
name: e,
|
|
13
13
|
slot: r.root
|
|
14
|
-
})(t?.root),
|
|
14
|
+
})(t?.root), L = o("div", {
|
|
15
15
|
name: e,
|
|
16
16
|
slot: r.innerContainer
|
|
17
|
-
})(t?.innerContainer),
|
|
17
|
+
})(t?.innerContainer), g = o("div", {
|
|
18
18
|
name: e,
|
|
19
19
|
slot: r.inputSort
|
|
20
|
-
})(t?.inputSort),
|
|
20
|
+
})(t?.inputSort), A = o("input", {
|
|
21
21
|
name: e,
|
|
22
22
|
slot: r.inputSortInput
|
|
23
|
-
})(t?.inputSortInput),
|
|
23
|
+
})(t?.inputSortInput), B = o("div", {
|
|
24
24
|
name: e,
|
|
25
25
|
slot: r.appliedSorts
|
|
26
|
-
})(t?.appliedSorts),
|
|
26
|
+
})(t?.appliedSorts), b = o("div", {
|
|
27
|
+
name: e,
|
|
28
|
+
slot: r.inputSortLeading
|
|
29
|
+
})(t?.inputSortLeading), O = o("div", {
|
|
27
30
|
name: e,
|
|
28
31
|
slot: r.appliedSortInnerContainer
|
|
29
32
|
})(t?.appliedSortInnerContainer), P = o("div", {
|
|
@@ -35,46 +38,46 @@ const w = o("div", {
|
|
|
35
38
|
})(t?.actionsClearButton), M = o(n, {
|
|
36
39
|
name: e,
|
|
37
40
|
slot: r.actionsSubmitButton
|
|
38
|
-
})(t?.actionsSubmitButton),
|
|
41
|
+
})(t?.actionsSubmitButton), T = o(l, {
|
|
39
42
|
name: e,
|
|
40
43
|
slot: r.popoverMenu
|
|
41
|
-
})(t?.popoverMenu),
|
|
44
|
+
})(t?.popoverMenu), k = o(l, {
|
|
42
45
|
name: e,
|
|
43
46
|
slot: r.popoverSort
|
|
44
|
-
})(t?.popoverSort),
|
|
47
|
+
})(t?.popoverSort), H = o("div", {
|
|
45
48
|
name: e,
|
|
46
49
|
slot: r.popoverSortContainerFields
|
|
47
|
-
})(t?.popoverSortContainerFields),
|
|
50
|
+
})(t?.popoverSortContainerFields), E = o(S, {
|
|
48
51
|
name: e,
|
|
49
52
|
slot: r.popoverSortActions
|
|
50
|
-
})(t?.popoverSortActions),
|
|
53
|
+
})(t?.popoverSortActions), F = o(s, {
|
|
51
54
|
name: e,
|
|
52
55
|
slot: r.inputSortSkeleton
|
|
53
|
-
})(t?.inputSortSkeleton),
|
|
56
|
+
})(t?.inputSortSkeleton), N = o("div", {
|
|
54
57
|
name: e,
|
|
55
58
|
slot: r.chipWrapper
|
|
56
|
-
})(t?.chipWrapper),
|
|
59
|
+
})(t?.chipWrapper), W = o(n, {
|
|
57
60
|
name: e,
|
|
58
61
|
slot: r.inputSortTriggerButton
|
|
59
|
-
})(t?.inputSortTriggerButton),
|
|
62
|
+
})(t?.inputSortTriggerButton), _ = o(p, {
|
|
60
63
|
name: e,
|
|
61
64
|
slot: r.emptyStateLabel
|
|
62
|
-
})(t?.emptyStateLabel),
|
|
65
|
+
})(t?.emptyStateLabel), D = o(i, {
|
|
63
66
|
name: e,
|
|
64
67
|
slot: r.overflowMoreChip
|
|
65
|
-
})(t?.overflowMoreChip),
|
|
68
|
+
})(t?.overflowMoreChip), R = o(l, {
|
|
66
69
|
name: e,
|
|
67
70
|
slot: r.overflowSortPopover
|
|
68
|
-
})(t?.overflowSortPopover),
|
|
71
|
+
})(t?.overflowSortPopover), Y = o("div", {
|
|
69
72
|
name: e,
|
|
70
73
|
slot: r.overflowSortList
|
|
71
|
-
})(t?.overflowSortList),
|
|
74
|
+
})(t?.overflowSortList), x = o("div", {
|
|
72
75
|
name: e,
|
|
73
76
|
slot: r.overflowSortItem
|
|
74
|
-
})(t?.overflowSortItem),
|
|
77
|
+
})(t?.overflowSortItem), K = o("div", {
|
|
75
78
|
name: e,
|
|
76
79
|
slot: r.overflowSortItemHeader
|
|
77
|
-
})(t?.overflowSortItemHeader),
|
|
80
|
+
})(t?.overflowSortItemHeader), j = o("span", {
|
|
78
81
|
name: e,
|
|
79
82
|
slot: r.overflowSortItemLabel
|
|
80
83
|
})(t?.overflowSortItemLabel);
|
|
@@ -83,23 +86,24 @@ export {
|
|
|
83
86
|
P as ActionsStyled,
|
|
84
87
|
M as ActionsSubmitButtonStyled,
|
|
85
88
|
O as AppliedSortInnerContainerStyled,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
K as
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
H as
|
|
102
|
-
|
|
103
|
-
T as
|
|
89
|
+
B as AppliedSortsStyled,
|
|
90
|
+
N as ChipSortWrapperStyled,
|
|
91
|
+
_ as EmptyStateLabelStyled,
|
|
92
|
+
L as InnerContainerStyled,
|
|
93
|
+
F as InputSortInputSkeletonStyled,
|
|
94
|
+
A as InputSortInputStyled,
|
|
95
|
+
b as InputSortLeadingStyled,
|
|
96
|
+
g as InputSortStyled,
|
|
97
|
+
W as InputSortTriggerButtonStyled,
|
|
98
|
+
D as OverflowMoreChipStyled,
|
|
99
|
+
K as OverflowSortItemHeaderStyled,
|
|
100
|
+
j as OverflowSortItemLabelStyled,
|
|
101
|
+
x as OverflowSortItemStyled,
|
|
102
|
+
Y as OverflowSortListStyled,
|
|
103
|
+
R as OverflowSortPopoverStyled,
|
|
104
|
+
H as PopoverContainerFieldsStyled,
|
|
105
|
+
E as PopoverHeaderActionsStyled,
|
|
106
|
+
T as PopoverMenuStyled,
|
|
107
|
+
k as PopoverStyled,
|
|
104
108
|
w as RootStyled
|
|
105
109
|
};
|
|
@@ -4,6 +4,7 @@ export declare enum DynamicSortSlots {
|
|
|
4
4
|
inputSort = "inputSort",
|
|
5
5
|
inputSortInput = "inputSortInput",
|
|
6
6
|
appliedSorts = "appliedSorts",
|
|
7
|
+
inputSortLeading = "inputSortLeading",
|
|
7
8
|
appliedSortInnerContainer = "appliedSortInnerContainer",
|
|
8
9
|
actions = "actions",
|
|
9
10
|
actionsClearButton = "actionsClearButton",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlotsEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicSort/slots/SlotsEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,yBAAyB,8BAA8B;IACvD,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,0BAA0B,+BAA+B;IACzD,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,qBAAqB,0BAA0B;CAChD"}
|
|
1
|
+
{"version":3,"file":"SlotsEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/DynamicSort/slots/SlotsEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,yBAAyB,8BAA8B;IACvD,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,0BAA0B,+BAA+B;IACzD,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,qBAAqB,0BAA0B;CAChD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var r = /* @__PURE__ */ ((e) => (e.root = "root", e.innerContainer = "innerContainer", e.inputSort = "inputSort", e.inputSortInput = "inputSortInput", e.appliedSorts = "appliedSorts", e.appliedSortInnerContainer = "appliedSortInnerContainer", e.actions = "actions", e.actionsClearButton = "actionsClearButton", e.actionsSubmitButton = "actionsSubmitButton", e.popoverMenu = "popoverMenu", e.popoverSort = "popoverSort", e.popoverSortContainerFields = "popoverSortContainerFields", e.popoverSortActions = "popoverSortActions", e.inputSortSkeleton = "inputSortSkeleton", e.chipWrapper = "chipWrapper", e.inputSortTriggerButton = "inputSortTriggerButton", e.emptyStateLabel = "emptyStateLabel", e.overflowMoreChip = "overflowMoreChip", e.overflowSortPopover = "overflowSortPopover", e.overflowSortList = "overflowSortList", e.overflowSortItem = "overflowSortItem", e.overflowSortItemHeader = "overflowSortItemHeader", e.overflowSortItemLabel = "overflowSortItemLabel", e))(r || {});
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.root = "root", e.innerContainer = "innerContainer", e.inputSort = "inputSort", e.inputSortInput = "inputSortInput", e.appliedSorts = "appliedSorts", e.inputSortLeading = "inputSortLeading", e.appliedSortInnerContainer = "appliedSortInnerContainer", e.actions = "actions", e.actionsClearButton = "actionsClearButton", e.actionsSubmitButton = "actionsSubmitButton", e.popoverMenu = "popoverMenu", e.popoverSort = "popoverSort", e.popoverSortContainerFields = "popoverSortContainerFields", e.popoverSortActions = "popoverSortActions", e.inputSortSkeleton = "inputSortSkeleton", e.chipWrapper = "chipWrapper", e.inputSortTriggerButton = "inputSortTriggerButton", e.emptyStateLabel = "emptyStateLabel", e.overflowMoreChip = "overflowMoreChip", e.overflowSortPopover = "overflowSortPopover", e.overflowSortList = "overflowSortList", e.overflowSortItem = "overflowSortItem", e.overflowSortItemHeader = "overflowSortItemHeader", e.overflowSortItemLabel = "overflowSortItemLabel", e))(r || {});
|
|
2
2
|
export {
|
|
3
3
|
r as DynamicSortSlots
|
|
4
4
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AppliedSortsProps } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* AppliedSorts: Renderiza los chips de sorts aplicados con detección de overflow.
|
|
3
4
|
* Cuando los chips no caben en el ancho disponible, muestra un chip "Más (N)"
|
|
4
5
|
* que abre el OverflowSortPopover con los sorts ocultos.
|
|
5
6
|
*/
|
|
6
|
-
declare function AppliedSorts(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AppliedSorts({ leadingSeparator }: AppliedSortsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default AppliedSorts;
|
|
8
9
|
//# sourceMappingURL=AppliedSorts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppliedSorts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppliedSorts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AACH,iBAAS,YAAY,CAAC,EAAE,gBAAgB,EAAE,EAAE,iBAAiB,oDAoG5D;AACD,eAAe,YAAY,CAAC"}
|
|
@@ -1,86 +1,102 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useModuleDictionary as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { getPropDataTestId as
|
|
5
|
-
import { DYNAMIC_SORT_KEY_COMPONENT as
|
|
6
|
-
import { getDynamicSortDictionary as
|
|
7
|
-
import { DynamicSortSlots as
|
|
8
|
-
import
|
|
9
|
-
import { useDynamicSortStore as
|
|
10
|
-
import
|
|
11
|
-
import { AppliedSortsStyled as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
1
|
+
import { jsx as e, jsxs as n } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useModuleDictionary as k } from "@m4l/core";
|
|
3
|
+
import { useState as N, useCallback as f } from "react";
|
|
4
|
+
import { getPropDataTestId as S } from "../../../../test/getNameDataTestId.js";
|
|
5
|
+
import { DYNAMIC_SORT_KEY_COMPONENT as h } from "../../constants.js";
|
|
6
|
+
import { getDynamicSortDictionary as u, DICCTIONARY as y } from "../../dictionary.js";
|
|
7
|
+
import { DynamicSortSlots as C } from "../../slots/SlotsEnum.js";
|
|
8
|
+
import P from "../DynamicSortBase/useDynamicSortBase.js";
|
|
9
|
+
import { useDynamicSortStore as x } from "../../store/useDynamicSortStore.js";
|
|
10
|
+
import Y from "./useAppliedSorts.js";
|
|
11
|
+
import { AppliedSortsStyled as v, InputSortLeadingStyled as g, AppliedSortInnerContainerStyled as j, ChipSortWrapperStyled as $, EmptyStateLabelStyled as z, OverflowMoreChipStyled as B } from "../../slots/DynamicSortSlots.js";
|
|
12
|
+
import w from "../InputSort/InputSort.js";
|
|
13
|
+
import F from "../AppliedSortChip/AppliedSortChip.js";
|
|
14
|
+
import { Typography as K } from "../../../extended/mui/Typography/Typography.js";
|
|
15
|
+
import W from "../SortActions/SortActions.js";
|
|
16
|
+
import q from "../OverflowSortPopover/OverflowSortPopover.js";
|
|
17
|
+
function ae({ leadingSeparator: l }) {
|
|
17
18
|
const {
|
|
18
|
-
visibleSorts:
|
|
19
|
+
visibleSorts: p,
|
|
19
20
|
overflowSorts: t,
|
|
20
|
-
isSkeleton:
|
|
21
|
-
parentRef:
|
|
22
|
-
containerRef:
|
|
23
|
-
setChipRef:
|
|
24
|
-
setMoreChipRef:
|
|
25
|
-
setActionsRef:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
isSkeleton: A,
|
|
22
|
+
parentRef: b,
|
|
23
|
+
containerRef: D,
|
|
24
|
+
setChipRef: O,
|
|
25
|
+
setMoreChipRef: I,
|
|
26
|
+
setActionsRef: R,
|
|
27
|
+
setLeadingRef: a
|
|
28
|
+
} = Y(), { dataTestId: s, ownerState: m, size: i } = P(), { getLabel: c } = k(), { openPopoverMenuFields: T } = x((o) => o.actions), [r, d] = N(null), E = f((o) => {
|
|
29
|
+
d(o.currentTarget);
|
|
30
|
+
}, []), _ = f(() => {
|
|
31
|
+
d(null);
|
|
30
32
|
}, []);
|
|
31
|
-
if (
|
|
32
|
-
return /* @__PURE__ */ e(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (A)
|
|
34
|
+
return /* @__PURE__ */ e(v, { ownerState: { ...m }, children: /* @__PURE__ */ n(g, { ref: a, children: [
|
|
35
|
+
l,
|
|
36
|
+
/* @__PURE__ */ e(w, {})
|
|
37
|
+
] }) });
|
|
38
|
+
const M = p.length === 0 && t.length === 0;
|
|
39
|
+
return /* @__PURE__ */ n(
|
|
40
|
+
v,
|
|
36
41
|
{
|
|
37
|
-
ref:
|
|
38
|
-
...
|
|
39
|
-
ownerState: { ...
|
|
42
|
+
ref: b,
|
|
43
|
+
...S(h, C.appliedSorts, s),
|
|
44
|
+
ownerState: { ...m },
|
|
40
45
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
/* @__PURE__ */ n(
|
|
47
|
+
g,
|
|
48
|
+
{
|
|
49
|
+
ref: a,
|
|
50
|
+
...S(h, C.inputSortLeading, s),
|
|
51
|
+
children: [
|
|
52
|
+
l,
|
|
53
|
+
/* @__PURE__ */ e(w, {})
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ n(j, { ref: D, children: [
|
|
58
|
+
p.map((o) => /* @__PURE__ */ e(
|
|
59
|
+
$,
|
|
44
60
|
{
|
|
45
|
-
ref: (
|
|
46
|
-
children: /* @__PURE__ */ e(
|
|
61
|
+
ref: (L) => O(o.id, L),
|
|
62
|
+
children: /* @__PURE__ */ e(F, { ...o })
|
|
47
63
|
},
|
|
48
64
|
o.id
|
|
49
65
|
)),
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
M && /* @__PURE__ */ e(
|
|
67
|
+
z,
|
|
52
68
|
{
|
|
53
69
|
"data-testid": "empty-state-label",
|
|
54
70
|
component: "span",
|
|
55
71
|
variant: "body",
|
|
56
|
-
size:
|
|
72
|
+
size: i,
|
|
57
73
|
color: "inherit",
|
|
58
|
-
onClick:
|
|
59
|
-
children:
|
|
74
|
+
onClick: T,
|
|
75
|
+
children: c(u(y.label_no_sorts_applied))
|
|
60
76
|
}
|
|
61
77
|
)
|
|
62
78
|
] }),
|
|
63
79
|
t.length > 0 && /* @__PURE__ */ e(
|
|
64
|
-
|
|
80
|
+
B,
|
|
65
81
|
{
|
|
66
|
-
ref:
|
|
67
|
-
size:
|
|
82
|
+
ref: I,
|
|
83
|
+
size: i,
|
|
68
84
|
variant: "contained",
|
|
69
85
|
color: r ? "info" : "default",
|
|
70
86
|
opacity: !0,
|
|
71
87
|
dataTestId: "overflow-more-chip",
|
|
72
88
|
ownerState: { selected: !!r },
|
|
73
|
-
label: /* @__PURE__ */ e(
|
|
74
|
-
onClick:
|
|
89
|
+
label: /* @__PURE__ */ e(K, { component: "span", variant: "bodyDens", size: i, color: "inherit", children: `${c(u(y.label_more))} (${t.length})` }),
|
|
90
|
+
onClick: E
|
|
75
91
|
}
|
|
76
92
|
),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
93
|
+
/* @__PURE__ */ e(W, { ref: R }),
|
|
78
94
|
r && t.length > 0 && /* @__PURE__ */ e(
|
|
79
|
-
|
|
95
|
+
q,
|
|
80
96
|
{
|
|
81
97
|
anchorEl: r,
|
|
82
98
|
sorts: t,
|
|
83
|
-
onClose:
|
|
99
|
+
onClose: _
|
|
84
100
|
}
|
|
85
101
|
)
|
|
86
102
|
]
|
|
@@ -88,5 +104,5 @@ function re() {
|
|
|
88
104
|
);
|
|
89
105
|
}
|
|
90
106
|
export {
|
|
91
|
-
|
|
107
|
+
ae as default
|
|
92
108
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/AppliedSorts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAEhC,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B"}
|
|
@@ -13,6 +13,7 @@ declare function useAppliedSorts(): {
|
|
|
13
13
|
setChipRef: (id: number, el: HTMLElement | null) => void;
|
|
14
14
|
setMoreChipRef: (el: HTMLElement | null) => void;
|
|
15
15
|
setActionsRef: (el: HTMLElement | null) => void;
|
|
16
|
+
setLeadingRef: (el: HTMLElement | null) => void;
|
|
16
17
|
};
|
|
17
18
|
export default useAppliedSorts;
|
|
18
19
|
//# sourceMappingURL=useAppliedSorts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppliedSorts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,iBAAS,eAAe
|
|
1
|
+
{"version":3,"file":"useAppliedSorts.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,iBAAS,eAAe;;;;;;;;;;;EAqCvB;AACD,eAAe,eAAe,CAAC"}
|