@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.
Files changed (72) hide show
  1. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  2. package/components/DynamicFilter/DynamicFilter.styles.js +82 -60
  3. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts +1 -0
  4. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -1
  5. package/components/DynamicFilter/hooks/useChipsOverflow.js +50 -44
  6. package/components/DynamicFilter/slots/SlotsEnum.d.ts +1 -0
  7. package/components/DynamicFilter/slots/SlotsEnum.d.ts.map +1 -1
  8. package/components/DynamicFilter/slots/SlotsEnum.js +1 -1
  9. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +3 -0
  10. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts.map +1 -1
  11. package/components/DynamicFilter/slots/dynamicFilterSlots.js +43 -39
  12. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts.map +1 -1
  13. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.js +26 -19
  14. package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.d.ts +1 -1
  15. package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.js +6 -6
  16. package/components/DynamicFilter/subcomponents/OverflowPopover/OverflowPopover.js +1 -1
  17. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +13 -13
  18. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +14 -14
  19. package/components/DynamicFilter/types.d.ts +3 -1
  20. package/components/DynamicFilter/types.d.ts.map +1 -1
  21. package/components/DynamicSort/DynamicSort.js +6 -6
  22. package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
  23. package/components/DynamicSort/DynamicSort.styles.js +40 -14
  24. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +3 -0
  25. package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
  26. package/components/DynamicSort/slots/DynamicSortSlots.js +44 -40
  27. package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -0
  28. package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
  29. package/components/DynamicSort/slots/SlotsEnum.js +1 -1
  30. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +1 -1
  31. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +5 -5
  32. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +2 -1
  33. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
  34. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +70 -54
  35. package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts +5 -0
  36. package/components/DynamicSort/subcomponents/AppliedSorts/types.d.ts.map +1 -0
  37. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -0
  38. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
  39. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +23 -21
  40. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
  41. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +15 -17
  42. package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +2 -0
  43. package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts.map +1 -1
  44. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -1
  45. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +36 -36
  46. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  47. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +58 -46
  48. package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +15 -15
  49. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
  50. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +30 -30
  51. package/components/DynamicSort/types.d.ts +8 -1
  52. package/components/DynamicSort/types.d.ts.map +1 -1
  53. package/components/extended/mui/Accordion/types.d.ts +5 -2
  54. package/components/extended/mui/Accordion/types.d.ts.map +1 -1
  55. package/components/extended/mui/Tab/Tab.styles.d.ts.map +1 -1
  56. package/components/extended/mui/Tab/Tab.styles.js +8 -0
  57. package/hooks/useDynamicFilterAndSort/constants.d.ts +1 -0
  58. package/hooks/useDynamicFilterAndSort/constants.d.ts.map +1 -1
  59. package/hooks/useDynamicFilterAndSort/constants.js +4 -3
  60. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +2 -1
  61. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts.map +1 -1
  62. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +2 -2
  63. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +3 -0
  64. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts.map +1 -1
  65. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +19 -15
  66. package/hooks/useDynamicFilterAndSort/styles.d.ts.map +1 -1
  67. package/hooks/useDynamicFilterAndSort/styles.js +58 -37
  68. package/hooks/useDynamicFilterAndSort/types.d.ts +1 -0
  69. package/hooks/useDynamicFilterAndSort/types.d.ts.map +1 -1
  70. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts.map +1 -1
  71. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +204 -172
  72. 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 s() {
11
+ function f() {
12
12
  r(!1), n(o.id);
13
13
  }
14
- function f(i) {
14
+ function s(i) {
15
15
  r(!1), setTimeout(() => c(o), 10);
16
16
  }
17
17
  return {
18
- onDelete: s,
19
- onEditSort: f,
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":"AAqBA;;;;GAIG;AACH,iBAAS,YAAY,qDAqFpB;AACD,eAAe,YAAY,CAAC"}
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 p } from "@emotion/react/jsx-runtime";
2
- import { useModuleDictionary as T } from "@m4l/core";
3
- import { useState as E, useCallback as s } from "react";
4
- import { getPropDataTestId as I } from "../../../../test/getNameDataTestId.js";
5
- import { DYNAMIC_SORT_KEY_COMPONENT as R } from "../../constants.js";
6
- import { getDynamicSortDictionary as m, DICCTIONARY as c } from "../../dictionary.js";
7
- import { DynamicSortSlots as _ } from "../../slots/SlotsEnum.js";
8
- import M from "../DynamicSortBase/useDynamicSortBase.js";
9
- import { useDynamicSortStore as k } from "../../store/useDynamicSortStore.js";
10
- import N from "./useAppliedSorts.js";
11
- import { AppliedSortsStyled as f, AppliedSortInnerContainerStyled as P, ChipSortWrapperStyled as x, EmptyStateLabelStyled as Y, OverflowMoreChipStyled as j } from "../../slots/DynamicSortSlots.js";
12
- import L from "../AppliedSortChip/AppliedSortChip.js";
13
- import { Typography as $ } from "../../../extended/mui/Typography/Typography.js";
14
- import z from "../SortActions/SortActions.js";
15
- import B from "../OverflowSortPopover/OverflowSortPopover.js";
16
- function re() {
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: i,
19
+ visibleSorts: p,
19
20
  overflowSorts: t,
20
- isSkeleton: d,
21
- parentRef: S,
22
- containerRef: h,
23
- setChipRef: y,
24
- setMoreChipRef: u,
25
- setActionsRef: C
26
- } = N(), { dataTestId: v, ownerState: w, size: n } = M(), { getLabel: l } = T(), { openPopoverMenuFields: A } = k((o) => o.actions), [r, a] = E(null), b = s((o) => {
27
- a(o.currentTarget);
28
- }, []), g = s(() => {
29
- a(null);
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 (d)
32
- return /* @__PURE__ */ e(f, {});
33
- const D = i.length === 0 && t.length === 0;
34
- return /* @__PURE__ */ p(
35
- f,
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: S,
38
- ...I(R, _.appliedSorts, v),
39
- ownerState: { ...w },
42
+ ref: b,
43
+ ...S(h, C.appliedSorts, s),
44
+ ownerState: { ...m },
40
45
  children: [
41
- /* @__PURE__ */ p(P, { ref: h, children: [
42
- i.map((o) => /* @__PURE__ */ e(
43
- x,
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: (O) => y(o.id, O),
46
- children: /* @__PURE__ */ e(L, { ...o })
61
+ ref: (L) => O(o.id, L),
62
+ children: /* @__PURE__ */ e(F, { ...o })
47
63
  },
48
64
  o.id
49
65
  )),
50
- D && /* @__PURE__ */ e(
51
- Y,
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: n,
72
+ size: i,
57
73
  color: "inherit",
58
- onClick: A,
59
- children: l(m(c.label_no_sorts_applied))
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
- j,
80
+ B,
65
81
  {
66
- ref: u,
67
- size: n,
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($, { component: "span", variant: "bodyDens", size: n, color: "inherit", children: `${l(m(c.label_more))} (${t.length})` }),
74
- onClick: b
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(z, { ref: C }),
93
+ /* @__PURE__ */ e(W, { ref: R }),
78
94
  r && t.length > 0 && /* @__PURE__ */ e(
79
- B,
95
+ q,
80
96
  {
81
97
  anchorEl: r,
82
98
  sorts: t,
83
- onClose: g
99
+ onClose: _
84
100
  }
85
101
  )
86
102
  ]
@@ -88,5 +104,5 @@ function re() {
88
104
  );
89
105
  }
90
106
  export {
91
- re as default
107
+ ae as default
92
108
  };
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export interface AppliedSortsProps {
3
+ leadingSeparator?: ReactNode;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -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;;;;;;;;;;EAmCvB;AACD,eAAe,eAAe,CAAC"}
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 u } from "react";
2
- import { useModuleSkeleton as d } from "@m4l/core";
3
- import { useDynamicSortStore as a } from "../../store/useDynamicSortStore.js";
4
- import { useChipsOverflow as c } from "../../../DynamicFilter/hooks/useChipsOverflow.js";
5
- function w() {
6
- const t = a((e) => e.appliedSorts), r = d(), i = u(
7
- () => [...t].sort(
8
- (e, o) => e.isSet !== o.isSet ? Number(e.isSet) - Number(o.isSet) : o.id - e.id
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
- [t]
10
+ [o]
11
11
  ), {
12
12
  visibleFilters: s,
13
13
  overflowFilters: p,
14
- parentRef: l,
15
- containerRef: S,
16
- setChipRef: f,
17
- setMoreChipRef: n,
18
- setActionsRef: m
19
- } = c(i);
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: l,
26
- containerRef: S,
27
- setChipRef: f,
28
- setMoreChipRef: n,
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
- w as default
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":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C;;;GAGG;AACH,iBAAS,eAAe,CAAE,KAAK,EAAC,oBAAoB,oDAoBnD;AACD,eAAe,eAAe,CAAC"}
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 p } from "@emotion/react/jsx-runtime";
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 S } from "../../../../utils/getComponentSlotRoot.js";
3
+ import { getComponentSlotRoot as c } from "../../../../utils/getComponentSlotRoot.js";
4
4
  import { DYNAMIC_SORT_KEY_COMPONENT as t } from "../../constants.js";
5
- import c from "./useDynamicSortBase.js";
5
+ import l from "./useDynamicSortBase.js";
6
6
  import f from "clsx";
7
- import { RootStyled as l, InnerContainerStyled as d } from "../../slots/DynamicSortSlots.js";
8
- import u from "../InputSort/InputSort.js";
9
- import y from "../AppliedSorts/AppliedSorts.js";
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 h(a) {
13
- const { className: i } = a, { ownerState: r, dataTestId: e } = c(), s = S(t);
11
+ function _(a) {
12
+ const { className: i, leadingSeparator: s } = a, { ownerState: r, dataTestId: e } = l(), p = c(t);
14
13
  return /* @__PURE__ */ o(
15
- l,
14
+ d,
16
15
  {
17
- className: f(s, i),
16
+ className: f(p, i),
18
17
  ownerState: { ...r },
19
18
  ...m(t, n.root, e),
20
- children: /* @__PURE__ */ p(
21
- d,
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(u, {}),
27
- /* @__PURE__ */ o(y, {}),
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
- h as default
34
+ _ as default
37
35
  };
@@ -1,4 +1,6 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface DynamicSortBaseProps {
2
3
  className?: string;
4
+ leadingSeparator?: ReactNode;
3
5
  }
4
6
  //# sourceMappingURL=types.d.ts.map
@@ -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;CACpB"}
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"}
@@ -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,oDAyG3D;AACD,eAAe,mBAAmB,CAAC"}
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 O } from "@m4l/core";
3
- import { ActionsCloseSmOutlined as D } from "@m4l/icons";
4
- import { useFormatter as g } from "@m4l/graphics";
5
- import { useState as k, useEffect as x } from "react";
6
- import { Chip as E } from "../../../Chip/Chip.js";
7
- import { useDynamicSortStore as I } from "../../store/useDynamicSortStore.js";
8
- import C from "../DynamicSortBase/useDynamicSortBase.js";
9
- import { fieldFactory as F } from "../FieldTypes/fieldFactory.js";
10
- import { usePopoverContainer as L } from "../../../../hooks/usePopoverContainer/usePopoverContainer.js";
11
- import { OverflowSortPopoverStyled as P, OverflowSortListStyled as z, OverflowSortItemStyled as A, OverflowSortItemHeaderStyled as j, OverflowSortItemLabelStyled as B } from "../../slots/DynamicSortSlots.js";
12
- import { Icon as R } from "../../../Icon/Icon.js";
13
- import { IconButton as H } from "../../../extended/mui/IconButton/IconButton.js";
14
- function Z(p) {
15
- const { anchorEl: s, sorts: i, onClose: l } = p, { size: a } = C(), { getLabel: u } = O(), S = g(), y = L(s), { hidePopoverSort: d, removeSort: w, showPopoverSortForEdit: h } = I(
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, c] = k(-1);
18
- function f(e) {
19
- l(), d(!1), setTimeout(() => h(e), 10);
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(), d(!1), w(o.id);
22
+ e.stopPropagation(), c(!1), w(o.id);
23
23
  }
24
- return x(() => {
24
+ return D(() => {
25
25
  const e = (o) => {
26
- o.key === "ArrowDown" ? (o.preventDefault(), c((t) => t < i.length - 1 ? t + 1 : t)) : o.key === "ArrowUp" ? (o.preventDefault(), c((t) => t > 0 ? t - 1 : 0)) : o.key === "Enter" && n >= 0 && n < i.length ? (o.preventDefault(), f(i[n])) : o.key === "Escape" && l();
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
- P,
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: s,
41
- onClose: l,
40
+ anchorEl: d,
41
+ onClose: a,
42
42
  container: y ?? void 0,
43
- children: /* @__PURE__ */ r(z, { children: i.map((e, o) => {
44
- const t = F(e.field.type).getLabels(e, u, S, e.field);
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
- A,
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: () => f(e),
51
+ onClick: () => s(e),
52
52
  children: [
53
- /* @__PURE__ */ r(R, { src: e.field.urlIcon, size: a, color: "text.secondary" }),
54
- /* @__PURE__ */ m(j, { children: [
55
- /* @__PURE__ */ r(B, { children: t.labelField }),
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
- E,
57
+ C,
58
58
  {
59
- size: a,
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
- H,
68
+ M,
69
69
  {
70
- size: a,
71
- icon: /* @__PURE__ */ r(D, {}),
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
- Z as default
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;AAEF;;GAEG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2DAkFvD;AACD,eAAe,iBAAiB,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"}