@m4l/components 9.16.0 → 9.17.1-beta-feature-731-m4l-components-code-editor.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 (108) hide show
  1. package/@types/types.d.ts +11 -0
  2. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  3. package/components/DynamicFilter/DynamicFilter.styles.js +12 -2
  4. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
  5. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +13 -13
  6. package/components/DynamicSort/DynamicSort.js +5 -5
  7. package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
  8. package/components/DynamicSort/DynamicSort.styles.js +217 -93
  9. package/components/DynamicSort/constants.js +4 -11
  10. package/components/DynamicSort/dictionary.d.ts +2 -0
  11. package/components/DynamicSort/dictionary.d.ts.map +1 -1
  12. package/components/DynamicSort/dictionary.js +10 -8
  13. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +36 -0
  14. package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
  15. package/components/DynamicSort/slots/DynamicSortSlots.js +102 -64
  16. package/components/DynamicSort/slots/SlotsEnum.d.ts +10 -1
  17. package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
  18. package/components/DynamicSort/slots/SlotsEnum.js +2 -2
  19. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts.map +1 -1
  20. package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +20 -15
  21. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +3 -2
  22. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts.map +1 -1
  23. package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +19 -19
  24. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +3 -1
  25. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
  26. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +86 -16
  27. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +10 -1
  28. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
  29. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +29 -9
  30. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
  31. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
  32. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +9 -11
  33. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts +2 -2
  34. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts.map +1 -1
  35. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +21 -21
  36. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +2 -1
  37. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts.map +1 -1
  38. package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.js +2 -2
  39. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +2 -1
  40. package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts.map +1 -1
  41. package/components/DynamicSort/subcomponents/InputSort/InputSort.js +44 -35
  42. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts +17 -41
  43. package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts.map +1 -1
  44. package/components/DynamicSort/subcomponents/InputSort/useInputSort.js +57 -81
  45. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts +9 -0
  46. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -0
  47. package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +85 -0
  48. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts +3 -0
  49. package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts.map +1 -0
  50. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts +11 -0
  51. package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts.map +1 -0
  52. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +16 -1
  53. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
  54. package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +52 -30
  55. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts +5 -4
  56. package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
  57. package/components/DynamicSort/subcomponents/SortActions/SortActions.js +35 -32
  58. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +4 -3
  59. package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts.map +1 -1
  60. package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +17 -18
  61. package/components/DynamicSort/types.d.ts +4 -0
  62. package/components/DynamicSort/types.d.ts.map +1 -1
  63. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +6 -0
  64. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -0
  65. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +247 -0
  66. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +3 -0
  67. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -0
  68. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +297 -0
  69. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +82 -0
  70. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -0
  71. package/components/extended/ReactSimpleCodeEditor/constants.js +149 -0
  72. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +11 -0
  73. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -0
  74. package/components/extended/ReactSimpleCodeEditor/dictionary.js +7 -0
  75. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +59 -0
  76. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +1 -0
  77. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +1063 -0
  78. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +6 -0
  79. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +1 -0
  80. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +7 -0
  81. package/components/extended/ReactSimpleCodeEditor/index.d.ts +4 -0
  82. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +1 -0
  83. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +18 -0
  84. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -0
  85. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +4 -0
  86. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +84 -0
  87. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -0
  88. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +63 -0
  89. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +3 -0
  90. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +1 -0
  91. package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts +15 -0
  92. package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts.map +1 -0
  93. package/components/extended/ReactSimpleCodeEditor/types.d.ts +127 -0
  94. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -0
  95. package/components/extended/index.d.ts +1 -0
  96. package/components/extended/index.d.ts.map +1 -1
  97. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +7 -0
  98. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +1 -0
  99. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +6 -0
  100. package/components/hook-form/RHFCodeEditor/index.d.ts +3 -0
  101. package/components/hook-form/RHFCodeEditor/index.d.ts.map +1 -0
  102. package/components/hook-form/index.d.ts +1 -0
  103. package/components/hook-form/index.d.ts.map +1 -1
  104. package/index.js +561 -548
  105. package/package.json +9 -6
  106. package/test/mocks/dictionary-mock.d.ts +3 -0
  107. package/test/mocks/dictionary-mock.d.ts.map +1 -1
  108. package/components/DynamicSort/icons.js +0 -7
@@ -1,14 +1,34 @@
1
- import { useModuleSkeleton as r } from "@m4l/core";
2
- import { useDynamicSortStore as S } from "../../store/useDynamicSortStore.js";
3
- function l() {
4
- const o = S((e) => e.appliedSorts), i = r();
5
- return {
6
- appliedSortsSorted: [...o].sort(
7
- (e, t) => e.isSet !== t.isSet ? Number(e.isSet) - Number(t.isSet) : t.id - e.id
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
8
9
  ),
9
- isSkeleton: i
10
+ [t]
11
+ ), {
12
+ visibleFilters: s,
13
+ overflowFilters: p,
14
+ parentRef: l,
15
+ containerRef: S,
16
+ setChipRef: f,
17
+ setMoreChipRef: n,
18
+ setActionsRef: m
19
+ } = c(i);
20
+ return {
21
+ appliedSortsSorted: i,
22
+ visibleSorts: s,
23
+ overflowSorts: p,
24
+ isSkeleton: r,
25
+ parentRef: l,
26
+ containerRef: S,
27
+ setChipRef: f,
28
+ setMoreChipRef: n,
29
+ setActionsRef: m
10
30
  };
11
31
  }
12
32
  export {
13
- l as default
33
+ w as default
14
34
  };
@@ -1,6 +1,7 @@
1
1
  import { DynamicSortBaseProps } from './types';
2
2
  /**
3
- * DynamicSortBase es un componente base que contiene los subcomponentes InputSort, AppliedSorts, SortActions y PopoverSort.
3
+ * DynamicSortBase: Componente base del DynamicSort.
4
+ * SortActions vive dentro de AppliedSorts (patrón idéntico al DynamicFilter).
4
5
  */
5
6
  declare function DynamicSortBase(props: DynamicSortBaseProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
7
  export default DynamicSortBase;
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicSortBase.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C;;GAEG;AACH,iBAAS,eAAe,CAAE,KAAK,EAAC,oBAAoB,oDAqBnD;AACD,eAAe,eAAe,CAAC"}
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,5 +1,5 @@
1
1
  import { jsx as o, jsxs as p } from "@emotion/react/jsx-runtime";
2
- import { getPropDataTestId as e } from "../../../../test/getNameDataTestId.js";
2
+ import { getPropDataTestId as m } from "../../../../test/getNameDataTestId.js";
3
3
  import { getComponentSlotRoot as S } from "../../../../utils/getComponentSlotRoot.js";
4
4
  import { DYNAMIC_SORT_KEY_COMPONENT as t } from "../../constants.js";
5
5
  import c from "./useDynamicSortBase.js";
@@ -7,27 +7,25 @@ import f from "clsx";
7
7
  import { RootStyled as l, InnerContainerStyled as d } from "../../slots/DynamicSortSlots.js";
8
8
  import u from "../InputSort/InputSort.js";
9
9
  import y from "../AppliedSorts/AppliedSorts.js";
10
- import C from "../SortActions/SortActions.js";
11
- import D from "../PopoverSort/PopoverSort.js";
10
+ import C from "../PopoverSort/PopoverSort.js";
12
11
  import { DynamicSortSlots as n } from "../../slots/SlotsEnum.js";
13
- function j(i) {
14
- const { className: s } = i, { ownerState: r, dataTestId: m } = c(), a = S(t);
12
+ function h(a) {
13
+ const { className: i } = a, { ownerState: r, dataTestId: e } = c(), s = S(t);
15
14
  return /* @__PURE__ */ o(
16
15
  l,
17
16
  {
18
- className: f(a, s),
17
+ className: f(s, i),
19
18
  ownerState: { ...r },
20
- ...e(t, n.root, m),
19
+ ...m(t, n.root, e),
21
20
  children: /* @__PURE__ */ p(
22
21
  d,
23
22
  {
24
23
  ownerState: { ...r },
25
- ...e(t, n.innerContainer, m),
24
+ ...m(t, n.innerContainer, e),
26
25
  children: [
27
26
  /* @__PURE__ */ o(u, {}),
28
27
  /* @__PURE__ */ o(y, {}),
29
- /* @__PURE__ */ o(C, {}),
30
- /* @__PURE__ */ o(D, {})
28
+ /* @__PURE__ */ o(C, {})
31
29
  ]
32
30
  }
33
31
  )
@@ -35,5 +33,5 @@ function j(i) {
35
33
  );
36
34
  }
37
35
  export {
38
- j as default
36
+ h as default
39
37
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Subcomponente encargado de los sorts con el tipo de dato "string"
3
- * @returns
2
+ * Subcomponente encargado de los sorts con el tipo de dato "string".
3
+ * Usa @m4l/icons directamente — sin URLs de S3.
4
4
  */
5
5
  export declare function StringSort(): import("@emotion/react/jsx-runtime").JSX.Element;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.tsx"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,UAAU,qDAgCzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.tsx"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,UAAU,qDA+BzB"}
@@ -1,37 +1,37 @@
1
- import { jsx as t, Fragment as c } from "@emotion/react/jsx-runtime";
2
- import { useModuleDictionary as l, useEnvironment as p } from "@m4l/core";
3
- import { useMemo as d } from "react";
4
- import { SORT_ICONS as s } from "../../../icons.js";
5
- import { Icon as i } from "@m4l/base";
6
- import { getDynamicSortDictionary as n, DICCTIONARY as f } from "../../../dictionary.js";
7
- import u from "../../DynamicSortBase/useDynamicSortBase.js";
8
- import { RHFSelect as S } from "../../../../hook-form/RHFSelect/RHFSelect.js";
9
- function y() {
10
- const { getLabel: o } = l(), { host_static_assets: e, environment_assets: r } = p(), { size: m } = u(), a = d(
1
+ import { jsx as o, Fragment as s } from "@emotion/react/jsx-runtime";
2
+ import { useModuleDictionary as m } from "@m4l/core";
3
+ import { ActionsSortAscOutlined as l, ActionsSortDescOutlined as a } from "@m4l/icons";
4
+ import { useMemo as c } from "react";
5
+ import { getDynamicSortDictionary as r, DICCTIONARY as p } from "../../../dictionary.js";
6
+ import d from "../../DynamicSortBase/useDynamicSortBase.js";
7
+ import { Icon as e } from "../../../../Icon/Icon.js";
8
+ import { RHFSelect as f } from "../../../../hook-form/RHFSelect/RHFSelect.js";
9
+ function z() {
10
+ const { getLabel: t } = m(), { size: i } = d(), n = c(
11
11
  () => [
12
12
  {
13
13
  id: "asc",
14
- label: o(n("label_ascending")),
15
- startAdornment: /* @__PURE__ */ t(i, { src: `${e}/${r}/${s.ASCENDING}` })
14
+ label: t(r("label_ascending")),
15
+ startAdornment: /* @__PURE__ */ o(e, { size: "small", src: /* @__PURE__ */ o(l, {}) })
16
16
  },
17
17
  {
18
18
  id: "desc",
19
- label: o(n("label_descending")),
20
- startAdornment: /* @__PURE__ */ t(i, { src: `${e}/${r}/${s.DESCENDING}` })
19
+ label: t(r("label_descending")),
20
+ startAdornment: /* @__PURE__ */ o(e, { size: "small", src: /* @__PURE__ */ o(a, {}) })
21
21
  }
22
22
  ],
23
- [o, e, r]
23
+ [t]
24
24
  );
25
- return /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
26
- S,
25
+ return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
26
+ f,
27
27
  {
28
- size: m,
28
+ size: i,
29
29
  name: "formValueOperator",
30
- options: a,
31
- label: o(n(f.input_placeholder))
30
+ options: n,
31
+ label: t(r(p.input_placeholder))
32
32
  }
33
33
  ) });
34
34
  }
35
35
  export {
36
- y as StringSort
36
+ z as StringSort
37
37
  };
@@ -1,6 +1,7 @@
1
+ import { SortFieldType } from '../../types';
1
2
  import { SortHelpers } from './StringSort/helpers';
2
3
  /**
3
4
  * Factory que retorna el helper correspondiente al tipo de campo
4
5
  */
5
- export declare function fieldFactory(): SortHelpers;
6
+ export declare function fieldFactory(_type?: SortFieldType): SortHelpers;
6
7
  //# sourceMappingURL=fieldFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldFactory.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOnD;;GAEG;AACH,wBAAgB,YAAY,gBAM3B"}
1
+ {"version":3,"file":"fieldFactory.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOnD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,aAAa,eAMjD"}
@@ -5,10 +5,10 @@ const r = {
5
5
  throw new Error("Type no defined");
6
6
  }
7
7
  };
8
- function o() {
8
+ function _(n) {
9
9
  const e = r?.string;
10
10
  return e || r.__default__();
11
11
  }
12
12
  export {
13
- o as fieldFactory
13
+ _ as fieldFactory
14
14
  };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Componente encargado de mostrar el input de búsqueda y el menú de campos para ordenar
2
+ * InputSort: IconButton trigger que abre/cierra el PopoverMenuFields.
3
+ * El input "Ordenar por" vive dentro del popover — patrón idéntico al DynamicFilter.
3
4
  */
4
5
  declare const InputSort: () => import("@emotion/react/jsx-runtime").JSX.Element;
5
6
  export default InputSort;
@@ -1 +1 @@
1
- {"version":3,"file":"InputSort.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/InputSort/InputSort.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,QAAA,MAAM,SAAS,wDAwCd,CAAC;AACF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"InputSort.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/InputSort/InputSort.tsx"],"names":[],"mappings":"AAOA;;;GAGG;AACH,QAAA,MAAM,SAAS,wDA6Cd,CAAC;AACF,eAAe,SAAS,CAAC"}
@@ -1,45 +1,54 @@
1
- import { jsxs as S, jsx as e } from "@emotion/react/jsx-runtime";
2
- import { useRef as f, useEffect as I } from "react";
3
- import { Icon as x } from "@m4l/base";
4
- import v from "../DynamicSortBase/useDynamicSortBase.js";
5
- import y from "./useInputSort.js";
6
- import { InputSortStyled as F, InputSortInputSkeletonStyled as P, InputSortInputStyled as h } from "../../slots/DynamicSortSlots.js";
7
- import w from "../PopoverMenuFields/PopoverMenuFields.js";
8
- const M = () => {
1
+ import { jsxs as f, Fragment as S, jsx as o } from "@emotion/react/jsx-runtime";
2
+ import { useRef as x, useEffect as F } from "react";
3
+ import { ActionsSortDuotone as g } from "@m4l/icons";
4
+ import I from "../DynamicSortBase/useDynamicSortBase.js";
5
+ import P from "./useInputSort.js";
6
+ import { InputSortTriggerButtonStyled as v } from "../../slots/DynamicSortSlots.js";
7
+ import h from "../PopoverMenuFields/PopoverMenuFields.js";
8
+ const B = () => {
9
9
  const {
10
- iconUrl: n,
11
- isSkeleton: s,
12
- inputPlaceHolder: l,
13
- inputData: p,
14
- inputHandlersProps: i,
10
+ isSkeleton: n,
11
+ inputPlaceHolder: i,
12
+ inputData: s,
13
+ inputHandlersProps: l,
15
14
  sortFields: a,
16
- selectedFieldIndex: d,
17
- setElementRef: o,
18
- isOpenPopoverMenuFields: u,
19
- isOpenPopoverSort: m
20
- } = y(), r = f(null);
21
- I(() => {
22
- o(r);
23
- }, [o]);
24
- const { ownerState: t, size: c } = v();
25
- return /* @__PURE__ */ S(F, { ownerState: { ...t }, "aria-expanded": u || m, children: [
26
- /* @__PURE__ */ e(x, { src: n, size: c }),
27
- s ? /* @__PURE__ */ e(P, { ownerState: { ...t }, variant: "rounded" }) : /* @__PURE__ */ e(
28
- h,
15
+ selectedFieldIndex: p,
16
+ setElementRef: r,
17
+ isOpenPopoverMenuFields: e,
18
+ isOpenPopoverSort: d,
19
+ handleTriggerClick: u
20
+ } = P(), t = x(null), { ownerState: c, size: m } = I();
21
+ return F(() => {
22
+ r(t);
23
+ }, [r, t]), /* @__PURE__ */ f(S, { children: [
24
+ /* @__PURE__ */ o(
25
+ v,
29
26
  {
30
- ref: r,
31
- type: "text",
32
- value: p,
33
- placeholder: l,
34
- ownerState: { ...t },
35
- role: "searchbox",
27
+ ref: t,
28
+ icon: /* @__PURE__ */ o(g, {}),
29
+ variant: "outline",
30
+ color: e ? "info" : "default",
31
+ selected: e,
32
+ size: m,
36
33
  "aria-label": "searchbox",
37
- ...i
34
+ "aria-expanded": e || d,
35
+ ownerState: { ...c, selected: e },
36
+ onClick: u
38
37
  }
39
38
  ),
40
- /* @__PURE__ */ e(w, { fields: a, selectFieldIndex: d })
39
+ /* @__PURE__ */ o(
40
+ h,
41
+ {
42
+ fields: a,
43
+ selectFieldIndex: p,
44
+ inputData: s,
45
+ inputPlaceHolder: i,
46
+ inputHandlersProps: l,
47
+ isSkeleton: n
48
+ }
49
+ )
41
50
  ] });
42
51
  };
43
52
  export {
44
- M as default
53
+ B as default
45
54
  };
@@ -1,62 +1,38 @@
1
1
  import { ChangeEvent, FocusEvent, KeyboardEvent } from 'react';
2
2
  import { SortField } from '../../types';
3
3
  /**
4
- * Hook que maneja la lógica del inputSort
4
+ * Hook que maneja la lógica del InputSort — trigger button que abre/cierra
5
+ * el PopoverMenuFields. El input "Ordenar por" vive dentro del popover,
6
+ * igual que el patrón del DynamicFilter.
5
7
  */
6
8
  declare function useInputSort(): {
7
- /**
8
- * URL del icono del inputSort `${host_static_assets}/${environment_assets}/${ASSETS_URL}/${ASSETS.close}`;
9
- */
10
- iconUrl: string;
11
- /**
12
- * Si es esqueleto mostrar la versión de esqueleton
13
- */
9
+ /** Modo skeleton mientras cargan los módulos. */
14
10
  isSkeleton: boolean;
15
- /**
16
- * Texto de placeholder del inputSort
17
- */
11
+ /** Placeholder del input dentro del popover. */
18
12
  inputPlaceHolder: string;
19
- /**
20
- * Texto del inputSort
21
- */
13
+ /** Texto actual del input. */
22
14
  inputData: string;
23
- /**
24
- * Props para el handler de eventos del inputSort
25
- */
15
+ /** Props de eventos para el input interno del popover. */
26
16
  inputHandlersProps: {
27
- /**
28
- * Evento de foco del inputSort
29
- */
17
+ /** Evento de foco del input dentro del popover. */
30
18
  onFocus: (_event: FocusEvent<HTMLInputElement>) => void;
31
- /**
32
- * Evento de cambio del inputSort
33
- */
19
+ /** Evento de cambio del input dentro del popover. */
34
20
  onChange: (event: ChangeEvent<HTMLInputElement>) => void;
35
- /**
36
- * Evento de teclado del inputSort
37
- */
21
+ /** Evento de teclado del input dentro del popover. */
38
22
  onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
39
23
  };
40
- /**
41
- * Campos filtrados por el inputSort
42
- */
24
+ /** Campos filtrados por el texto del input. */
43
25
  sortFields: SortField[];
44
- /**
45
- * Indice del campo seleccionado
46
- */
26
+ /** Índice del campo actualmente seleccionado por teclado. */
47
27
  selectedFieldIndex: number;
48
- /**
49
- * Actualiza la referencia del elemento (inputSort)
50
- */
28
+ /** Setter de la referencia del trigger button (anchorEl del popover). */
51
29
  setElementRef: (ref: import('react').MutableRefObject<HTMLElement | null>) => void;
52
- /**
53
- * Indica si el menú de campos está abierto
54
- */
30
+ /** Si el PopoverMenuFields está abierto. */
55
31
  isOpenPopoverMenuFields: boolean | undefined;
56
- /**
57
- * Indica si el popoverSort está abierto
58
- */
32
+ /** Si el PopoverSort está abierto. */
59
33
  isOpenPopoverSort: boolean;
34
+ /** Alterna apertura/cierre del PopoverMenuFields al hacer click en el trigger. */
35
+ handleTriggerClick: () => void;
60
36
  };
61
37
  export default useInputSort;
62
38
  //# sourceMappingURL=useInputSort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputSort.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/InputSort/useInputSort.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAuB,MAAM,OAAO,CAAC;AAInG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,iBAAS,YAAY;IA6FjB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;QAzEH;;WAEG;0BACe,UAAU,CAAC,gBAAgB,CAAC;QAG9C;;WAEG;0BACe,WAAW,CAAC,gBAAgB,CAAC;QAO/C;;WAEG;2BACgB,aAAa,CAAC,gBAAgB,CAAC;;IAwDlD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAIN;AACD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"useInputSort.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DynamicSort/subcomponents/InputSort/useInputSort.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAuB,MAAM,OAAO,CAAC;AAGnG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,iBAAS,YAAY;IAqGjB,iDAAiD;;IAEjD,gDAAgD;;IAEhD,8BAA8B;;IAE9B,0DAA0D;;QAxD1D,mDAAmD;0BACjC,UAAU,CAAC,gBAAgB,CAAC;QAG9C,qDAAqD;0BACnC,WAAW,CAAC,gBAAgB,CAAC;QAO/C,sDAAsD;2BACnC,aAAa,CAAC,gBAAgB,CAAC;;IA6ClD,+CAA+C;;IAE/C,6DAA6D;;IAE7D,yEAAyE;;IAEzE,4CAA4C;;IAE5C,sCAAsC;;IAEtC,kFAAkF;;EAGrF;AACD,eAAe,YAAY,CAAC"}
@@ -1,105 +1,81 @@
1
- import { useEnvironment as k, useModuleDictionary as w, useModuleSkeleton as E } from "@m4l/core";
2
- import { useState as f, useEffect as _ } from "react";
3
- import { ASSETS_URL as A, ASSETS as M } from "../../constants.js";
4
- import { getDynamicSortDictionary as b, DICCTIONARY as x } from "../../dictionary.js";
5
- import { useDynamicSortStore as i } from "../../store/useDynamicSortStore.js";
6
- function T() {
7
- const [t, l] = f(-1), [o, c] = f([]), { host_static_assets: S, environment_assets: m } = k(), { getLabel: a } = w(), F = E(), s = i((e) => e.isOpenPopoverMenuFields), u = i((e) => e.availableFields), r = i((e) => e.inputData), v = i((e) => !!e.popoverSortData), {
8
- closePopoverMenuFields: p,
9
- hidePopoverSort: D,
10
- openPopoverMenuFields: d,
11
- setInputData: h,
12
- showPopoverSortForAdd: y,
13
- setElementRef: I
14
- } = i((e) => e.actions);
15
- _(() => {
16
- s ? (c(
1
+ import { useModuleDictionary as v, useModuleSkeleton as k } from "@m4l/core";
2
+ import { useState as f, useEffect as w } from "react";
3
+ import { getDynamicSortDictionary as M, DICCTIONARY as x } from "../../dictionary.js";
4
+ import { useDynamicSortStore as r } from "../../store/useDynamicSortStore.js";
5
+ function E() {
6
+ const [o, a] = f(-1), [t, d] = f([]), { getLabel: p } = v(), m = k(), i = r((e) => e.isOpenPopoverMenuFields), u = r((e) => e.availableFields), l = r((e) => e.inputData), S = r((e) => !!e.popoverSortData), {
7
+ closePopoverMenuFields: s,
8
+ hidePopoverSort: F,
9
+ openPopoverMenuFields: c,
10
+ setInputData: D,
11
+ showPopoverSortForAdd: g,
12
+ setElementRef: h
13
+ } = r((e) => e.actions);
14
+ w(() => {
15
+ i ? (d(
17
16
  u.filter(
18
- (e) => (e.label ?? a(e.dictionaryId)).includes(r)
17
+ (e) => (e.label ?? p(e.dictionaryId)).includes(l)
19
18
  )
20
- ), l(-1)) : c([]);
21
- }, [s, r, u, a]);
22
- function P(e) {
23
- p(), y(e);
19
+ ), a(-1)) : d([]);
20
+ }, [i, l, u, p]);
21
+ function y(e) {
22
+ s(), g(e);
24
23
  }
25
- const g = {
26
- /**
27
- * Evento de foco del inputSort
28
- */
24
+ function I() {
25
+ i ? s() : c();
26
+ }
27
+ const P = {
28
+ /** Evento de foco del input dentro del popover. */
29
29
  onFocus: (e) => {
30
- d();
30
+ c();
31
31
  },
32
- /**
33
- * Evento de cambio del inputSort
34
- */
32
+ /** Evento de cambio del input dentro del popover. */
35
33
  onChange: (e) => {
36
- h(e.target.value), s || d(), D(!0);
34
+ D(e.target.value), i || c(), F(!0);
37
35
  },
38
- /**
39
- * Evento de teclado del inputSort
40
- */
36
+ /** Evento de teclado del input dentro del popover. */
41
37
  onKeyDown: (e) => {
42
38
  if (e.key === "ArrowDown") {
43
39
  let n = -1;
44
- o.length > 0 && (t < o.length - 1 ? n = t + 1 : n = o.length - 1), l(n);
40
+ t.length > 0 && (o < t.length - 1 ? n = o + 1 : n = t.length - 1), a(n);
45
41
  }
46
42
  if (e.key === "ArrowUp") {
47
43
  let n = -1;
48
- o.length > 0 && t > -1 && (n = t - 1), l(n);
44
+ t.length > 0 && o > -1 && (n = o - 1), a(n);
49
45
  }
50
- if (e.key === "Escape" && p(), e.key === "Enter")
51
- if (t === -1) {
52
- if (r.trim() === "") {
53
- p();
46
+ if (e.key === "Escape" && s(), e.key === "Enter")
47
+ if (o === -1) {
48
+ if (l.trim() === "") {
49
+ s();
54
50
  return;
55
51
  }
56
52
  } else
57
- P(o[t]);
53
+ y(t[o]);
58
54
  }
59
55
  };
60
56
  return {
61
- /**
62
- * URL del icono del inputSort `${host_static_assets}/${environment_assets}/${ASSETS_URL}/${ASSETS.close}`;
63
- */
64
- iconUrl: `${S}/${m}/${A}/${M.list_bulleted}`,
65
- /**
66
- * Si es esqueleto mostrar la versión de esqueleton
67
- */
68
- isSkeleton: F,
69
- /**
70
- * Texto de placeholder del inputSort
71
- */
72
- inputPlaceHolder: a(b(x.input_placeholder)),
73
- /**
74
- * Texto del inputSort
75
- */
76
- inputData: r,
77
- /**
78
- * Props para el handler de eventos del inputSort
79
- */
80
- inputHandlersProps: g,
81
- /**
82
- * Campos filtrados por el inputSort
83
- */
84
- sortFields: o,
85
- /**
86
- * Indice del campo seleccionado
87
- */
88
- selectedFieldIndex: t,
89
- /**
90
- * Actualiza la referencia del elemento (inputSort)
91
- */
92
- setElementRef: I,
93
- /**
94
- * Indica si el menú de campos está abierto
95
- */
96
- isOpenPopoverMenuFields: s,
97
- /**
98
- * Indica si el popoverSort está abierto
99
- */
100
- isOpenPopoverSort: v
57
+ /** Modo skeleton mientras cargan los módulos. */
58
+ isSkeleton: m,
59
+ /** Placeholder del input dentro del popover. */
60
+ inputPlaceHolder: p(M(x.input_placeholder)),
61
+ /** Texto actual del input. */
62
+ inputData: l,
63
+ /** Props de eventos para el input interno del popover. */
64
+ inputHandlersProps: P,
65
+ /** Campos filtrados por el texto del input. */
66
+ sortFields: t,
67
+ /** Índice del campo actualmente seleccionado por teclado. */
68
+ selectedFieldIndex: o,
69
+ /** Setter de la referencia del trigger button (anchorEl del popover). */
70
+ setElementRef: h,
71
+ /** Si el PopoverMenuFields está abierto. */
72
+ isOpenPopoverMenuFields: i,
73
+ /** Si el PopoverSort está abierto. */
74
+ isOpenPopoverSort: S,
75
+ /** Alterna apertura/cierre del PopoverMenuFields al hacer click en el trigger. */
76
+ handleTriggerClick: I
101
77
  };
102
78
  }
103
79
  export {
104
- T as default
80
+ E as default
105
81
  };
@@ -0,0 +1,9 @@
1
+ import { OverflowSortPopoverProps } from './types';
2
+ /**
3
+ * OverflowSortPopover: Popover que muestra los sorts que no caben en el header.
4
+ * Estructura idéntica al OverflowPopover del DynamicFilter:
5
+ * icono del campo | label + chip de dirección | botón eliminar (si no fixed).
6
+ */
7
+ declare function OverflowSortPopover(props: OverflowSortPopoverProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
8
+ export default OverflowSortPopover;
9
+ //# sourceMappingURL=OverflowSortPopover.d.ts.map
@@ -0,0 +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;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2DA6G3D;AACD,eAAe,mBAAmB,CAAC"}