@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.
- package/@types/types.d.ts +11 -0
- package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
- package/components/DynamicFilter/DynamicFilter.styles.js +12 -2
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts.map +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +13 -13
- package/components/DynamicSort/DynamicSort.js +5 -5
- package/components/DynamicSort/DynamicSort.styles.d.ts.map +1 -1
- package/components/DynamicSort/DynamicSort.styles.js +217 -93
- package/components/DynamicSort/constants.js +4 -11
- package/components/DynamicSort/dictionary.d.ts +2 -0
- package/components/DynamicSort/dictionary.d.ts.map +1 -1
- package/components/DynamicSort/dictionary.js +10 -8
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +36 -0
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts.map +1 -1
- package/components/DynamicSort/slots/DynamicSortSlots.js +102 -64
- package/components/DynamicSort/slots/SlotsEnum.d.ts +10 -1
- package/components/DynamicSort/slots/SlotsEnum.d.ts.map +1 -1
- package/components/DynamicSort/slots/SlotsEnum.js +2 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +20 -15
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +3 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +19 -19
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +3 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +86 -16
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +10 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +29 -9
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +9 -11
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts +2 -2
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +21 -21
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +2 -1
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.js +2 -2
- package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +2 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +44 -35
- package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts +17 -41
- package/components/DynamicSort/subcomponents/InputSort/useInputSort.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/InputSort/useInputSort.js +57 -81
- package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts +9 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.d.ts.map +1 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/OverflowSortPopover.js +85 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts +3 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/index.d.ts.map +1 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts +11 -0
- package/components/DynamicSort/subcomponents/OverflowSortPopover/types.d.ts.map +1 -0
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +16 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +52 -30
- package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts +5 -4
- package/components/DynamicSort/subcomponents/SortActions/SortActions.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +35 -32
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +4 -3
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts.map +1 -1
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +17 -18
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/DynamicSort/types.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +6 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +247 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +3 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +297 -0
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +82 -0
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/constants.js +149 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +11 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.js +7 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +59 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +1063 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +6 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +7 -0
- package/components/extended/ReactSimpleCodeEditor/index.d.ts +4 -0
- package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +18 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +4 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +84 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +63 -0
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +3 -0
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts +15 -0
- package/components/extended/ReactSimpleCodeEditor/storybookRuntime.d.ts.map +1 -0
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +127 -0
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -0
- package/components/extended/index.d.ts +1 -0
- package/components/extended/index.d.ts.map +1 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +7 -0
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +1 -0
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +6 -0
- package/components/hook-form/RHFCodeEditor/index.d.ts +3 -0
- package/components/hook-form/RHFCodeEditor/index.d.ts.map +1 -0
- package/components/hook-form/index.d.ts +1 -0
- package/components/hook-form/index.d.ts.map +1 -1
- package/index.js +561 -548
- package/package.json +9 -6
- package/test/mocks/dictionary-mock.d.ts +3 -0
- package/test/mocks/dictionary-mock.d.ts.map +1 -1
- package/components/DynamicSort/icons.js +0 -7
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
33
|
+
w as default
|
|
14
34
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamicSortBaseProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* DynamicSortBase
|
|
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":"
|
|
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
|
|
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 "../
|
|
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
|
|
14
|
-
const { className:
|
|
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(
|
|
17
|
+
className: f(s, i),
|
|
19
18
|
ownerState: { ...r },
|
|
20
|
-
...
|
|
19
|
+
...m(t, n.root, e),
|
|
21
20
|
children: /* @__PURE__ */ p(
|
|
22
21
|
d,
|
|
23
22
|
{
|
|
24
23
|
ownerState: { ...r },
|
|
25
|
-
...
|
|
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
|
-
|
|
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
|
-
* @
|
|
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,
|
|
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
|
|
2
|
-
import { useModuleDictionary as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { RHFSelect as
|
|
9
|
-
function
|
|
10
|
-
const { getLabel:
|
|
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:
|
|
15
|
-
startAdornment: /* @__PURE__ */
|
|
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:
|
|
20
|
-
startAdornment: /* @__PURE__ */
|
|
19
|
+
label: t(r("label_descending")),
|
|
20
|
+
startAdornment: /* @__PURE__ */ o(e, { size: "small", src: /* @__PURE__ */ o(a, {}) })
|
|
21
21
|
}
|
|
22
22
|
],
|
|
23
|
-
[
|
|
23
|
+
[t]
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
25
|
+
return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
|
|
26
|
+
f,
|
|
27
27
|
{
|
|
28
|
-
size:
|
|
28
|
+
size: i,
|
|
29
29
|
name: "formValueOperator",
|
|
30
|
-
options:
|
|
31
|
-
label:
|
|
30
|
+
options: n,
|
|
31
|
+
label: t(r(p.input_placeholder))
|
|
32
32
|
}
|
|
33
33
|
) });
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
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,
|
|
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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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":"
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
const
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
inputHandlersProps: i,
|
|
10
|
+
isSkeleton: n,
|
|
11
|
+
inputPlaceHolder: i,
|
|
12
|
+
inputData: s,
|
|
13
|
+
inputHandlersProps: l,
|
|
15
14
|
sortFields: a,
|
|
16
|
-
selectedFieldIndex:
|
|
17
|
-
setElementRef:
|
|
18
|
-
isOpenPopoverMenuFields:
|
|
19
|
-
isOpenPopoverSort:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
34
|
+
"aria-expanded": e || d,
|
|
35
|
+
ownerState: { ...c, selected: e },
|
|
36
|
+
onClick: u
|
|
38
37
|
}
|
|
39
38
|
),
|
|
40
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
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;
|
|
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 {
|
|
2
|
-
import { useState as f, useEffect as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 ??
|
|
17
|
+
(e) => (e.label ?? p(e.dictionaryId)).includes(l)
|
|
19
18
|
)
|
|
20
|
-
),
|
|
21
|
-
}, [
|
|
22
|
-
function
|
|
23
|
-
|
|
19
|
+
), a(-1)) : d([]);
|
|
20
|
+
}, [i, l, u, p]);
|
|
21
|
+
function y(e) {
|
|
22
|
+
s(), g(e);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
+
t.length > 0 && o > -1 && (n = o - 1), a(n);
|
|
49
45
|
}
|
|
50
|
-
if (e.key === "Escape" &&
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
|
|
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
|
-
|
|
53
|
+
y(t[o]);
|
|
58
54
|
}
|
|
59
55
|
};
|
|
60
56
|
return {
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
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"}
|