@m4l/components 9.38.0 → 9.40.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/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.js +6 -6
- package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.js +1 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +13 -13
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +14 -14
- package/components/DynamicFilter/types.d.ts +3 -1
- package/components/DynamicFilter/types.d.ts.map +1 -1
- 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/AppliedSortChip/useAppliedSortChip.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +5 -5
- 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/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +36 -36
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +58 -46
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +15 -15
- 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 +8 -1
- package/components/DynamicSort/types.d.ts.map +1 -1
- package/components/extended/mui/Accordion/types.d.ts +5 -2
- package/components/extended/mui/Accordion/types.d.ts.map +1 -1
- package/components/extended/mui/Tab/Tab.styles.d.ts.map +1 -1
- package/components/extended/mui/Tab/Tab.styles.js +8 -0
- 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 +7 -7
|
@@ -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
|
};
|
|
@@ -7,7 +7,7 @@ import { SortFieldApplied } from '../../types';
|
|
|
7
7
|
declare function useAppliedSortChip(sort: SortFieldApplied): {
|
|
8
8
|
onDelete: () => void;
|
|
9
9
|
onEditSort: (_event: MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
-
iconFieldUrl: string;
|
|
10
|
+
iconFieldUrl: string | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | undefined;
|
|
11
11
|
labels: import('../../types').DataTypeFilerLabels;
|
|
12
12
|
SortDirectionIcon: import('react').FunctionComponent<{}>;
|
|
13
13
|
};
|
|
@@ -8,16 +8,16 @@ function E(o) {
|
|
|
8
8
|
const { getLabel: e } = u(), t = p(), { hidePopoverSort: r, removeSort: n, showPopoverSortForEdit: c } = D(
|
|
9
9
|
(i) => i.actions
|
|
10
10
|
), l = o.operator === "asc" ? a : d, m = S(() => v().getLabels(o, e, t, o.field), [o, e, t]);
|
|
11
|
-
function
|
|
11
|
+
function f() {
|
|
12
12
|
r(!1), n(o.id);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function s(i) {
|
|
15
15
|
r(!1), setTimeout(() => c(o), 10);
|
|
16
16
|
}
|
|
17
17
|
return {
|
|
18
|
-
onDelete:
|
|
19
|
-
onEditSort:
|
|
20
|
-
iconFieldUrl: o.field?.urlIcon,
|
|
18
|
+
onDelete: f,
|
|
19
|
+
onEditSort: s,
|
|
20
|
+
iconFieldUrl: o.field?.icon ?? o.field?.urlIcon,
|
|
21
21
|
labels: m,
|
|
22
22
|
SortDirectionIcon: l
|
|
23
23
|
};
|
|
@@ -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"}
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useModuleSkeleton as
|
|
3
|
-
import { useDynamicSortStore as
|
|
4
|
-
import { useChipsOverflow as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
() => [...
|
|
8
|
-
(e,
|
|
1
|
+
import { useMemo as d } from "react";
|
|
2
|
+
import { useModuleSkeleton as a } from "@m4l/core";
|
|
3
|
+
import { useDynamicSortStore as c } from "../../store/useDynamicSortStore.js";
|
|
4
|
+
import { useChipsOverflow as R } from "../../../DynamicFilter/hooks/useChipsOverflow.js";
|
|
5
|
+
function C() {
|
|
6
|
+
const o = c((e) => e.appliedSorts), r = a(), i = d(
|
|
7
|
+
() => [...o].sort(
|
|
8
|
+
(e, t) => e.isSet !== t.isSet ? Number(e.isSet) - Number(t.isSet) : t.id - e.id
|
|
9
9
|
),
|
|
10
|
-
[
|
|
10
|
+
[o]
|
|
11
11
|
), {
|
|
12
12
|
visibleFilters: s,
|
|
13
13
|
overflowFilters: p,
|
|
14
|
-
parentRef:
|
|
15
|
-
containerRef:
|
|
16
|
-
setChipRef:
|
|
17
|
-
setMoreChipRef:
|
|
18
|
-
setActionsRef: m
|
|
19
|
-
|
|
14
|
+
parentRef: f,
|
|
15
|
+
containerRef: l,
|
|
16
|
+
setChipRef: n,
|
|
17
|
+
setMoreChipRef: S,
|
|
18
|
+
setActionsRef: m,
|
|
19
|
+
setLeadingRef: u
|
|
20
|
+
} = R(i);
|
|
20
21
|
return {
|
|
21
22
|
appliedSortsSorted: i,
|
|
22
23
|
visibleSorts: s,
|
|
23
24
|
overflowSorts: p,
|
|
24
25
|
isSkeleton: r,
|
|
25
|
-
parentRef:
|
|
26
|
-
containerRef:
|
|
27
|
-
setChipRef:
|
|
28
|
-
setMoreChipRef:
|
|
29
|
-
setActionsRef: m
|
|
26
|
+
parentRef: f,
|
|
27
|
+
containerRef: l,
|
|
28
|
+
setChipRef: n,
|
|
29
|
+
setMoreChipRef: S,
|
|
30
|
+
setActionsRef: m,
|
|
31
|
+
setLeadingRef: u
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
export {
|
|
33
|
-
|
|
35
|
+
C as default
|
|
34
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicSortBase.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicSortBase.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C;;;GAGG;AACH,iBAAS,eAAe,CAAE,KAAK,EAAC,oBAAoB,oDAmBnD;AACD,eAAe,eAAe,CAAC"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as S } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { getPropDataTestId as m } from "../../../../test/getNameDataTestId.js";
|
|
3
|
-
import { getComponentSlotRoot as
|
|
3
|
+
import { getComponentSlotRoot as c } from "../../../../utils/getComponentSlotRoot.js";
|
|
4
4
|
import { DYNAMIC_SORT_KEY_COMPONENT as t } from "../../constants.js";
|
|
5
|
-
import
|
|
5
|
+
import l from "./useDynamicSortBase.js";
|
|
6
6
|
import f from "clsx";
|
|
7
|
-
import { RootStyled as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import C from "../PopoverSort/PopoverSort.js";
|
|
7
|
+
import { RootStyled as d, InnerContainerStyled as y } from "../../slots/DynamicSortSlots.js";
|
|
8
|
+
import C from "../AppliedSorts/AppliedSorts.js";
|
|
9
|
+
import D from "../PopoverSort/PopoverSort.js";
|
|
11
10
|
import { DynamicSortSlots as n } from "../../slots/SlotsEnum.js";
|
|
12
|
-
function
|
|
13
|
-
const { className: i } = a, { ownerState: r, dataTestId: e } =
|
|
11
|
+
function _(a) {
|
|
12
|
+
const { className: i, leadingSeparator: s } = a, { ownerState: r, dataTestId: e } = l(), p = c(t);
|
|
14
13
|
return /* @__PURE__ */ o(
|
|
15
|
-
|
|
14
|
+
d,
|
|
16
15
|
{
|
|
17
|
-
className: f(
|
|
16
|
+
className: f(p, i),
|
|
18
17
|
ownerState: { ...r },
|
|
19
18
|
...m(t, n.root, e),
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
|
|
19
|
+
children: /* @__PURE__ */ S(
|
|
20
|
+
y,
|
|
22
21
|
{
|
|
23
22
|
ownerState: { ...r },
|
|
24
23
|
...m(t, n.innerContainer, e),
|
|
25
24
|
children: [
|
|
26
|
-
/* @__PURE__ */ o(
|
|
27
|
-
/* @__PURE__ */ o(
|
|
28
|
-
/* @__PURE__ */ o(C, {})
|
|
25
|
+
/* @__PURE__ */ o(C, { leadingSeparator: s }),
|
|
26
|
+
/* @__PURE__ */ o(D, {})
|
|
29
27
|
]
|
|
30
28
|
}
|
|
31
29
|
)
|
|
@@ -33,5 +31,5 @@ function h(a) {
|
|
|
33
31
|
);
|
|
34
32
|
}
|
|
35
33
|
export {
|
|
36
|
-
|
|
34
|
+
_ as default
|
|
37
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/DynamicSortBase/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/DynamicSortBase/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B"}
|
package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowSortPopover.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"OverflowSortPopover.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,oDA4G3D;AACD,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useModuleDictionary as
|
|
3
|
-
import { ActionsCloseSmOutlined as
|
|
4
|
-
import { useFormatter as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { Chip as
|
|
7
|
-
import { useDynamicSortStore as
|
|
8
|
-
import
|
|
9
|
-
import { fieldFactory as
|
|
10
|
-
import { usePopoverContainer as
|
|
11
|
-
import { OverflowSortPopoverStyled as
|
|
12
|
-
import { Icon as
|
|
13
|
-
import { IconButton as
|
|
14
|
-
function
|
|
15
|
-
const { anchorEl:
|
|
2
|
+
import { useModuleDictionary as E } from "@m4l/core";
|
|
3
|
+
import { ActionsCloseSmOutlined as I } from "@m4l/icons";
|
|
4
|
+
import { useFormatter as O } from "@m4l/graphics";
|
|
5
|
+
import { useState as x, useEffect as D, cloneElement as g, isValidElement as k } from "react";
|
|
6
|
+
import { Chip as C } from "../../../Chip/Chip.js";
|
|
7
|
+
import { useDynamicSortStore as F } from "../../store/useDynamicSortStore.js";
|
|
8
|
+
import L from "../DynamicSortBase/useDynamicSortBase.js";
|
|
9
|
+
import { fieldFactory as P } from "../FieldTypes/fieldFactory.js";
|
|
10
|
+
import { usePopoverContainer as z } from "../../../../hooks/usePopoverContainer/usePopoverContainer.js";
|
|
11
|
+
import { OverflowSortPopoverStyled as A, OverflowSortListStyled as j, OverflowSortItemStyled as B, OverflowSortItemHeaderStyled as R, OverflowSortItemLabelStyled as H } from "../../slots/DynamicSortSlots.js";
|
|
12
|
+
import { Icon as K } from "../../../Icon/Icon.js";
|
|
13
|
+
import { IconButton as M } from "../../../extended/mui/IconButton/IconButton.js";
|
|
14
|
+
function $(p) {
|
|
15
|
+
const { anchorEl: d, sorts: i, onClose: a } = p, { size: l } = L(), { getLabel: u } = E(), S = O(), y = z(d), { hidePopoverSort: c, removeSort: w, showPopoverSortForEdit: h } = F(
|
|
16
16
|
(e) => e.actions
|
|
17
|
-
), [n,
|
|
18
|
-
function
|
|
19
|
-
|
|
17
|
+
), [n, f] = x(-1);
|
|
18
|
+
function s(e) {
|
|
19
|
+
a(), c(!1), setTimeout(() => h(e), 10);
|
|
20
20
|
}
|
|
21
21
|
function v(e, o) {
|
|
22
|
-
e.stopPropagation(),
|
|
22
|
+
e.stopPropagation(), c(!1), w(o.id);
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return D(() => {
|
|
25
25
|
const e = (o) => {
|
|
26
|
-
o.key === "ArrowDown" ? (o.preventDefault(),
|
|
26
|
+
o.key === "ArrowDown" ? (o.preventDefault(), f((t) => t < i.length - 1 ? t + 1 : t)) : o.key === "ArrowUp" ? (o.preventDefault(), f((t) => t > 0 ? t - 1 : 0)) : o.key === "Enter" && n >= 0 && n < i.length ? (o.preventDefault(), s(i[n])) : o.key === "Escape" && a();
|
|
27
27
|
};
|
|
28
28
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
29
29
|
}, [i, n]), /* @__PURE__ */ r(
|
|
30
|
-
|
|
30
|
+
A,
|
|
31
31
|
{
|
|
32
32
|
open: !0,
|
|
33
33
|
disableAutoFocus: !0,
|
|
@@ -37,26 +37,26 @@ function Z(p) {
|
|
|
37
37
|
sx: (e) => ({
|
|
38
38
|
mt: e.vars.size.baseSpacings.sp2
|
|
39
39
|
}),
|
|
40
|
-
anchorEl:
|
|
41
|
-
onClose:
|
|
40
|
+
anchorEl: d,
|
|
41
|
+
onClose: a,
|
|
42
42
|
container: y ?? void 0,
|
|
43
|
-
children: /* @__PURE__ */ r(
|
|
44
|
-
const t =
|
|
43
|
+
children: /* @__PURE__ */ r(j, { children: i.map((e, o) => {
|
|
44
|
+
const t = P(e.field.type).getLabels(e, u, S, e.field);
|
|
45
45
|
return /* @__PURE__ */ m(
|
|
46
|
-
|
|
46
|
+
B,
|
|
47
47
|
{
|
|
48
48
|
ownerState: { selected: o === n },
|
|
49
49
|
"data-testid": "dynamic-sort-overflow-item",
|
|
50
50
|
"data-field-name": e.field.name,
|
|
51
|
-
onClick: () =>
|
|
51
|
+
onClick: () => s(e),
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */ r(
|
|
54
|
-
/* @__PURE__ */ m(
|
|
55
|
-
/* @__PURE__ */ r(
|
|
53
|
+
k(e.field.icon ?? e.field.urlIcon) ? g(e.field.icon ?? e.field.urlIcon, { size: l, color: "text.secondary" }) : /* @__PURE__ */ r(K, { src: e.field.urlIcon ?? "", size: l, color: "text.secondary" }),
|
|
54
|
+
/* @__PURE__ */ m(R, { children: [
|
|
55
|
+
/* @__PURE__ */ r(H, { children: t.labelField }),
|
|
56
56
|
/* @__PURE__ */ r(
|
|
57
|
-
|
|
57
|
+
C,
|
|
58
58
|
{
|
|
59
|
-
size:
|
|
59
|
+
size: l,
|
|
60
60
|
variant: "contained",
|
|
61
61
|
opacity: !0,
|
|
62
62
|
color: "default",
|
|
@@ -65,10 +65,10 @@ function Z(p) {
|
|
|
65
65
|
)
|
|
66
66
|
] }),
|
|
67
67
|
!e.fixed && /* @__PURE__ */ r(
|
|
68
|
-
|
|
68
|
+
M,
|
|
69
69
|
{
|
|
70
|
-
size:
|
|
71
|
-
icon: /* @__PURE__ */ r(
|
|
70
|
+
size: l,
|
|
71
|
+
icon: /* @__PURE__ */ r(I, {}),
|
|
72
72
|
onClick: (b) => v(b, e)
|
|
73
73
|
}
|
|
74
74
|
)
|
|
@@ -81,5 +81,5 @@ function Z(p) {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
$ as default
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverMenuFields.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAqB,MAAM,OAAO,CAAC;AASlJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,MAAM,MAAM,sBAAsB,GAAG;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,kBAAkB,EAAE;QAClB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACvD,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACzD,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;KAC7D,CAAC;IACF,sDAAsD;IACtD,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"PopoverMenuFields.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAqB,MAAM,OAAO,CAAC;AASlJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,MAAM,MAAM,sBAAsB,GAAG;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,kBAAkB,EAAE;QAClB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACvD,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACzD,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;KAC7D,CAAC;IACF,sDAAsD;IACtD,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAoBF;;GAEG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2DAsFvD;AACD,eAAe,iBAAiB,CAAC"}
|