@m4l/components 0.1.51 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CommonActions/components/ActionFormCancel/{index.27e301c5.js → index.8dedf1d5.js} +15 -16
- package/components/CommonActions/components/ActionIntro/{index.d567aebb.js → index.5d5294f2.js} +5 -0
- package/components/CommonActions/components/ActionIntro/test/contants.d.ts +1 -0
- package/components/CommonActions/components/Actions/{index.c06ea173.js → index.93c9823a.js} +14 -14
- package/components/DataGrid/{index.eb1bdc97.js → index.1a6508e2.js} +20 -20
- package/components/DynamicFilter/DynamicFilter.d.ts +9 -0
- package/components/DynamicFilter/classes/index.d.ts +5 -0
- package/components/DynamicFilter/classes/types.d.ts +22 -0
- package/components/DynamicFilter/constants.d.ts +14 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/helpers.d.ts +24 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +18 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/store.d.ts +213 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/types.d.ts +5 -0
- package/components/DynamicFilter/dictionary.d.ts +21 -0
- package/components/DynamicFilter/hooks/useDynamicFilter.d.ts +2 -0
- package/components/DynamicFilter/index.2189989e.js +1808 -0
- package/components/DynamicFilter/index.d.ts +4 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/index.d.ts +3 -0
- package/components/DynamicFilter/subcomponents/ClearFilters/index.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/FilterButton/index.d.ts +10 -0
- package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +6 -0
- package/components/DynamicFilter/subcomponents/InputFilter/index.d.ts +7 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/index.d.ts +15 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.d.ts +12 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/types.d.ts +6 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/helpers.d.ts +39 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/helpers.d.ts +42 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/index.d.ts +4 -3
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/helpers.d.ts +36 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/helpers.d.ts +39 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/factory.d.ts +72 -4
- package/components/DynamicFilter/subcomponents/fieldstypes/validations.d.ts +25 -6
- package/components/DynamicFilter/tests/contants.d.ts +6 -0
- package/components/DynamicFilter/tests/types.d.ts +2 -0
- package/components/DynamicFilter/tests/utils.d.ts +2 -0
- package/components/DynamicFilter/types.d.ts +173 -42
- package/components/ErrorLabel/{index.78553a1e.js → index.12994bff.js} +5 -5
- package/components/Icon/{index.f6e8d810.js → index.b29ff2d9.js} +1 -1
- package/components/LanguagePopover/{index.5047b444.js → index.628fe97f.js} +5 -5
- package/components/ModalDialog/{index.de10969f.js → index.49c40899.js} +5 -5
- package/components/ObjectLogs/{index.338656c6.js → index.d7c0092a.js} +23 -23
- package/components/PaperForm/{index.0114aa9b.js → index.c04000a9.js} +1 -1
- package/components/Period/{index.89daad51.js → index.4f6e419d.js} +15 -15
- package/components/Resizeable/{index.8a442a8b.js → index.04fa8de5.js} +1 -1
- package/components/ScrollBar/{index.39eeb2de.js → index.35ebe9a1.js} +8 -3
- package/components/areas/components/Area/subcomponents/InnerForHooks/index.d.ts +2 -0
- package/components/areas/components/AreasAdmin/{index.3e586e9b.js → index.25e50e70.js} +6 -8
- package/components/areas/components/AreasContainer/{index.15e4628d.js → index.432b9d4c.js} +3 -8
- package/components/areas/components/GridLayout/{index.f38f5b74.js → index.359e777e.js} +33 -31
- package/components/areas/components/Window/{index.d1a59be4.js → index.2b9f12fe.js} +129 -54
- package/components/areas/components/Window/subcomponents/InnerForHooks/index.d.ts +2 -2
- package/components/areas/components/WindowPopUp/{index.90566fca.js → index.d5fa0d74.js} +36 -38
- package/components/areas/components/WindowsPanel/index.d.ts +2 -0
- package/components/areas/components/{index.29809e82.js → index.912056a0.js} +23 -18
- package/components/areas/contexts/AreaContext/helper.d.ts +27 -0
- package/components/areas/contexts/AreaContext/{index.c787aee6.js → index.b1439daf.js} +151 -23
- package/components/areas/contexts/AreaContext/store.d.ts +17 -1
- package/components/areas/contexts/AreasContext/{index.4f938baa.js → index.fb21af84.js} +1 -5
- package/components/areas/contexts/{index.4cfa6ea9.js → index.1e46147e.js} +1 -13
- package/components/areas/hooks/{index.b15baf14.js → index.5feefc73.js} +1 -1
- package/components/areas/hooks/useArea/{index.575c2abe.js → index.6f45f930.js} +2 -2
- package/components/areas/index.3df8c6d4.js +21 -0
- package/components/formatters/BooleanFormatter/{index.b3fb8a75.js → index.a50933fb.js} +1 -1
- package/components/formatters/{index.90a19f9f.js → index.7d2ad9ca.js} +2 -1
- package/components/hook-form/RHFAutocomplete/{index.74add0d0.js → index.0ffa2185.js} +69 -59
- package/components/hook-form/RHFAutocomplete/test/contants.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.0aa3c224.js → index.2dfbe7aa.js} +1 -1
- package/components/hook-form/RHFCheckbox/{index.ca94a050.js → index.1fcf42c8.js} +1 -1
- package/components/hook-form/RHFDateTime/{index.7f1cbd85.js → index.6c129ce4.js} +14 -25
- package/components/hook-form/RHFPeriod/{index.47cf646d.js → index.1f6aa4c6.js} +2 -2
- package/components/hook-form/RHFTextField/classes/index.d.ts +0 -1
- package/components/hook-form/RHFTextField/{index.57f138f7.js → index.a021a2b3.js} +21 -12
- package/components/hook-form/RHFTextField/tests/contants.d.ts +2 -0
- package/components/index.d.ts +1 -4
- package/components/modal/{WindowBase.ed279350.js → WindowBase.66ef3c9a.js} +3 -3
- package/components/modal/{WindowConfirm.72de5ce8.js → WindowConfirm.b31ed329.js} +16 -16
- package/components/modal/index.6d5b19ef.js +29 -0
- package/components/mui_extended/Accordion/{index.1d513477.js → index.002bad72.js} +2 -2
- package/components/mui_extended/IconButton/{index.1318a283.js → index.460c0476.js} +1 -1
- package/components/mui_extended/MenuActions/{index.1261168c.js → index.aaafafc3.js} +1 -1
- package/components/mui_extended/Pager/{index.984aac44.js → index.458f9f0d.js} +1 -1
- package/components/mui_extended/{index.cb9d48d2.js → index.915e84dc.js} +5 -5
- package/contexts/ModalContext/{index.e94f0e72.js → index.d1aaddbc.js} +1 -1
- package/contexts/RHFormContext/{index.828b60ad.js → index.3dc6e2f5.js} +1 -0
- package/hooks/useModal/{index.56c03c00.js → index.f77ab08b.js} +1 -1
- package/index.js +197 -257
- package/package.json +2 -2
- package/{react-draggable.0eef011c.js → react-draggable.6471b07e.js} +1 -1
- package/{react-resizable.bb58c8fc.js → react-resizable.b620abed.js} +2 -2
- package/test/constants_no_mock.d.ts +1 -0
- package/utils/{index.e882b264.js → index.b6ae791a.js} +12 -3
- package/utils/index.d.ts +2 -0
- package/vendor.d5904857.js +145 -0
- package/components/CmpDisenoTest/index.d.ts +0 -4
- package/components/CmpDisenoTest/types.d.ts +0 -20
- package/components/DynamicFilter/contexts/BaseContext/index.d.ts +0 -5
- package/components/DynamicFilter/contexts/BaseContext/types.d.ts +0 -45
- package/components/DynamicFilter/hooks/useFilter.d.ts +0 -1
- package/components/DynamicFilter/index.17731fda.js +0 -1756
- package/components/DynamicFilter/subcomponents/ApplyedFilters/components/ApplyedFilter/index.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/PopupEditFilter/index.d.ts +0 -2
- package/components/DynamicFilter/utils/Clases/index.d.ts +0 -20
- package/components/DynamicFilter/utils/Clases/types.d.ts +0 -17
- package/components/areas/index.8c6f9e65.js +0 -21
- package/components/modal/index.7197145d.js +0 -29
package/components/CommonActions/components/ActionFormCancel/{index.27e301c5.js → index.8dedf1d5.js}
RENAMED
|
@@ -3,28 +3,28 @@ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
4
|
import { B as Button } from "../../../mui_extended/Button/index.8406ed5b.js";
|
|
5
5
|
import { useCallback } from "react";
|
|
6
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
7
|
-
import "../../../../react-draggable.
|
|
8
|
-
import "../../../ModalDialog/index.
|
|
9
|
-
import "../../../Resizeable/index.
|
|
6
|
+
import { u as useModal } from "../../../../hooks/useModal/index.f77ab08b.js";
|
|
7
|
+
import "../../../../react-draggable.6471b07e.js";
|
|
8
|
+
import "../../../ModalDialog/index.49c40899.js";
|
|
9
|
+
import "../../../Resizeable/index.04fa8de5.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
import "@m4l/graphics";
|
|
12
|
-
import { W as WindowConfirm } from "../../../modal/WindowConfirm.
|
|
13
|
-
import "../../../modal/WindowBase.
|
|
14
|
-
import "../../../Icon/index.
|
|
12
|
+
import { W as WindowConfirm } from "../../../modal/WindowConfirm.b31ed329.js";
|
|
13
|
+
import "../../../modal/WindowBase.66ef3c9a.js";
|
|
14
|
+
import "../../../Icon/index.b29ff2d9.js";
|
|
15
15
|
import "@mui/material/styles";
|
|
16
|
-
import "../../../areas/components/index.
|
|
17
|
-
import "../../../areas/components/AreasAdmin/index.
|
|
18
|
-
import "../../../mui_extended/IconButton/index.
|
|
16
|
+
import "../../../areas/components/index.912056a0.js";
|
|
17
|
+
import "../../../areas/components/AreasAdmin/index.25e50e70.js";
|
|
18
|
+
import "../../../mui_extended/IconButton/index.460c0476.js";
|
|
19
19
|
import "zustand";
|
|
20
|
-
import "../../../areas/contexts/AreasContext/index.
|
|
20
|
+
import "../../../areas/contexts/AreasContext/index.fb21af84.js";
|
|
21
21
|
import "zustand/shallow";
|
|
22
|
-
import "../../../areas/components/AreasContainer/index.
|
|
22
|
+
import "../../../areas/components/AreasContainer/index.432b9d4c.js";
|
|
23
23
|
import "react-grid-layout/css/styles.css";
|
|
24
|
-
import "../../../../react-resizable.
|
|
25
|
-
import "../../../areas/contexts/index.
|
|
24
|
+
import "../../../../react-resizable.b620abed.js";
|
|
25
|
+
import "../../../areas/contexts/index.1e46147e.js";
|
|
26
26
|
import "../../../areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
27
|
-
import { u as useWindowToolsMF } from "../../../areas/hooks/index.
|
|
27
|
+
import { u as useWindowToolsMF } from "../../../areas/hooks/index.5feefc73.js";
|
|
28
28
|
function ActionFormCancel() {
|
|
29
29
|
const {
|
|
30
30
|
getLabel
|
|
@@ -45,7 +45,6 @@ function ActionFormCancel() {
|
|
|
45
45
|
control
|
|
46
46
|
});
|
|
47
47
|
const onConfirmQuit = useCallback(() => {
|
|
48
|
-
console.log("onConfirmQuit");
|
|
49
48
|
closeWindow();
|
|
50
49
|
}, []);
|
|
51
50
|
const onClickCancel = useCallback(() => {
|
package/components/CommonActions/components/ActionIntro/{index.d567aebb.js → index.5d5294f2.js}
RENAMED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
2
|
import { B as Button } from "../../../mui_extended/Button/index.8406ed5b.js";
|
|
3
|
+
import { T as TEST_PROP_ID } from "../../../../vendor.d5904857.js";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
const ACTIONINTRO_TEST_ID = "m4lactions";
|
|
4
6
|
const ActionIntro = (props) => {
|
|
5
7
|
const {
|
|
6
8
|
getLabel
|
|
7
9
|
} = useModuleDictionary();
|
|
8
10
|
return /* @__PURE__ */ jsx(Button, {
|
|
11
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
12
|
+
[TEST_PROP_ID]: ACTIONINTRO_TEST_ID
|
|
13
|
+
} : {},
|
|
9
14
|
variant: "contained",
|
|
10
15
|
type: "submit",
|
|
11
16
|
color: "primary",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ACTIONINTRO_TEST_ID = "m4lactions";
|
|
@@ -6,25 +6,25 @@ import "@mui/material/Button";
|
|
|
6
6
|
import "../../../mui_extended/Button/index.8406ed5b.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import "react";
|
|
9
|
-
import "../../../../contexts/ModalContext/index.
|
|
10
|
-
import "../../../../react-draggable.
|
|
11
|
-
import "../../../ModalDialog/index.
|
|
12
|
-
import "../../../Resizeable/index.
|
|
9
|
+
import "../../../../contexts/ModalContext/index.d1aaddbc.js";
|
|
10
|
+
import "../../../../react-draggable.6471b07e.js";
|
|
11
|
+
import "../../../ModalDialog/index.49c40899.js";
|
|
12
|
+
import "../../../Resizeable/index.04fa8de5.js";
|
|
13
13
|
import "@m4l/graphics";
|
|
14
14
|
import "@mui/lab";
|
|
15
|
-
import "../../../modal/WindowConfirm.
|
|
16
|
-
import "../../../Icon/index.
|
|
17
|
-
import "../../../modal/WindowBase.
|
|
18
|
-
import "../../../areas/components/index.
|
|
19
|
-
import "../../../areas/components/AreasAdmin/index.
|
|
20
|
-
import "../../../mui_extended/IconButton/index.
|
|
15
|
+
import "../../../modal/WindowConfirm.b31ed329.js";
|
|
16
|
+
import "../../../Icon/index.b29ff2d9.js";
|
|
17
|
+
import "../../../modal/WindowBase.66ef3c9a.js";
|
|
18
|
+
import "../../../areas/components/index.912056a0.js";
|
|
19
|
+
import "../../../areas/components/AreasAdmin/index.25e50e70.js";
|
|
20
|
+
import "../../../mui_extended/IconButton/index.460c0476.js";
|
|
21
21
|
import "zustand";
|
|
22
|
-
import "../../../areas/contexts/AreasContext/index.
|
|
22
|
+
import "../../../areas/contexts/AreasContext/index.fb21af84.js";
|
|
23
23
|
import "zustand/shallow";
|
|
24
|
-
import "../../../areas/components/AreasContainer/index.
|
|
24
|
+
import "../../../areas/components/AreasContainer/index.432b9d4c.js";
|
|
25
25
|
import "react-grid-layout/css/styles.css";
|
|
26
|
-
import "../../../../react-resizable.
|
|
27
|
-
import "../../../areas/contexts/index.
|
|
26
|
+
import "../../../../react-resizable.b620abed.js";
|
|
27
|
+
import "../../../areas/contexts/index.1e46147e.js";
|
|
28
28
|
import "../../../areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
29
29
|
const WrapperStandarActions = styled("div")(({
|
|
30
30
|
theme
|
|
@@ -6,37 +6,37 @@ import { HTML5Backend } from "react-dnd-html5-backend";
|
|
|
6
6
|
import { SvgIcon, Checkbox, InputBase, Skeleton } from "@mui/material";
|
|
7
7
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
8
8
|
import { voidFunction, useModuleDictionary, useModuleSkeleton, getPropertyByString, useEnvironment } from "@m4l/core";
|
|
9
|
-
import { M as MenuActions } from "../mui_extended/MenuActions/index.
|
|
10
|
-
import { P as Pager, g as getPagerComponentsDictionary } from "../mui_extended/Pager/index.
|
|
11
|
-
import { I as IconButton } from "../mui_extended/IconButton/index.
|
|
12
|
-
import { u as useModal } from "../../hooks/useModal/index.
|
|
9
|
+
import { M as MenuActions } from "../mui_extended/MenuActions/index.aaafafc3.js";
|
|
10
|
+
import { P as Pager, g as getPagerComponentsDictionary } from "../mui_extended/Pager/index.458f9f0d.js";
|
|
11
|
+
import { I as IconButton } from "../mui_extended/IconButton/index.460c0476.js";
|
|
12
|
+
import { u as useModal } from "../../hooks/useModal/index.f77ab08b.js";
|
|
13
13
|
import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.a81752ef.js";
|
|
14
|
-
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.
|
|
15
|
-
import "../../react-draggable.
|
|
16
|
-
import { g as getModalDialogComponentsDictionary } from "../ModalDialog/index.
|
|
17
|
-
import "../Resizeable/index.
|
|
14
|
+
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.5d5294f2.js";
|
|
15
|
+
import "../../react-draggable.6471b07e.js";
|
|
16
|
+
import { g as getModalDialogComponentsDictionary } from "../ModalDialog/index.49c40899.js";
|
|
17
|
+
import "../Resizeable/index.04fa8de5.js";
|
|
18
18
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
19
|
-
import { A as Actions$1 } from "../CommonActions/components/Actions/index.
|
|
19
|
+
import { A as Actions$1 } from "../CommonActions/components/Actions/index.93c9823a.js";
|
|
20
20
|
import "react-hook-form";
|
|
21
21
|
import "@mui/material/Button";
|
|
22
22
|
import "../mui_extended/Button/index.8406ed5b.js";
|
|
23
|
-
import "../areas/components/index.
|
|
24
|
-
import "../areas/components/AreasAdmin/index.
|
|
23
|
+
import "../areas/components/index.912056a0.js";
|
|
24
|
+
import "../areas/components/AreasAdmin/index.25e50e70.js";
|
|
25
25
|
import "zustand";
|
|
26
|
-
import "../areas/contexts/AreasContext/index.
|
|
26
|
+
import "../areas/contexts/AreasContext/index.fb21af84.js";
|
|
27
27
|
import "zustand/shallow";
|
|
28
|
-
import "../areas/components/AreasContainer/index.
|
|
28
|
+
import "../areas/components/AreasContainer/index.432b9d4c.js";
|
|
29
29
|
import "react-grid-layout/css/styles.css";
|
|
30
|
-
import "../../react-resizable.
|
|
31
|
-
import "../areas/contexts/index.
|
|
30
|
+
import "../../react-resizable.b620abed.js";
|
|
31
|
+
import "../areas/contexts/index.1e46147e.js";
|
|
32
32
|
import "../areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
33
33
|
import "@mui/lab";
|
|
34
|
-
import "../modal/WindowConfirm.
|
|
35
|
-
import "../Icon/index.
|
|
36
|
-
import { W as WindowBase } from "../modal/WindowBase.
|
|
37
|
-
import { B as BooleanFormatter } from "../formatters/BooleanFormatter/index.
|
|
34
|
+
import "../modal/WindowConfirm.b31ed329.js";
|
|
35
|
+
import "../Icon/index.b29ff2d9.js";
|
|
36
|
+
import { W as WindowBase } from "../modal/WindowBase.66ef3c9a.js";
|
|
37
|
+
import { B as BooleanFormatter } from "../formatters/BooleanFormatter/index.a50933fb.js";
|
|
38
38
|
import { D as DateFormatter } from "../formatters/DateFormatter/index.578a9f53.js";
|
|
39
|
-
import { C as ConcatenatedFormatter } from "../formatters/index.
|
|
39
|
+
import { C as ConcatenatedFormatter } from "../formatters/index.7d2ad9ca.js";
|
|
40
40
|
const WrapperGrid = styled("div")(() => ({
|
|
41
41
|
display: "flex",
|
|
42
42
|
flexDirection: "column",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DynamicFilterProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @description Punto de entrada del componente
|
|
5
|
+
* El componente inicia su renderización cuando si el Flag FLAG_DICTIONARY_LOADED ha llegado.
|
|
6
|
+
* @param inProps
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const DynamicFilter: (inProps: DynamicFilterProps) => JSX.Element | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DynamicFilterClasses } from './types';
|
|
2
|
+
import { OwnerState } from '../contexts/DynamicFilterContext/store';
|
|
3
|
+
export declare const dynamicFilterClasses: DynamicFilterClasses;
|
|
4
|
+
export declare const useUtilityClasses: (ownerState: OwnerState) => Record<"root" | "containerFistRow" | "filterButton" | "containerInputFilter" | "wrapperApplyedFilters" | "containerApplyedFilters" | "applyedFilter" | "popUpMenuFields" | "popoverMenuFieldsItem" | "popoverFilterPaper" | "popoverFilterHeader" | "containerBooleanFilter" | "containerDateTimeFilter" | "containerNumberFilter" | "containerStringFilter" | "clearFilters", string>;
|
|
5
|
+
export declare type Classes = ReturnType<typeof useUtilityClasses>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DynamicFilterClasses {
|
|
2
|
+
root: string;
|
|
3
|
+
containerFistRow: string;
|
|
4
|
+
filterButton: string;
|
|
5
|
+
containerInputFilter: string;
|
|
6
|
+
wrapperApplyedFilters: string;
|
|
7
|
+
containerApplyedFilters: string;
|
|
8
|
+
applyedFilter: string;
|
|
9
|
+
popUpMenuFields: string;
|
|
10
|
+
popoverMenuFieldsItem: string;
|
|
11
|
+
popoverFilterPaper: string;
|
|
12
|
+
popoverFilterHeader: string;
|
|
13
|
+
containerBooleanFilter: string;
|
|
14
|
+
containerDateTimeFilter: string;
|
|
15
|
+
containerNumberFilter: string;
|
|
16
|
+
containerStringFilter: string;
|
|
17
|
+
inEdition: string;
|
|
18
|
+
isValid: string;
|
|
19
|
+
isDirty: string;
|
|
20
|
+
isMobile: string;
|
|
21
|
+
}
|
|
22
|
+
export declare type DynamicFilterClassesKey = keyof DynamicFilterClasses;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BooleanOperator, DateTimeOperator, Field, NumberOperator, Operator, StringOperator } from './types';
|
|
2
|
+
export declare const COMPONENT_TEST_ID = "m4ldynamicfilter";
|
|
3
|
+
export declare const COMPONENT_CLASS_NAME = "M4LDynamicFilter";
|
|
4
|
+
export declare const ASSETS_URL = "/frontend/components/dynamic_filter/assets/icons/";
|
|
5
|
+
export declare const ASSETS: {
|
|
6
|
+
readonly refresh: "refresh.svg";
|
|
7
|
+
readonly search: "search.svg";
|
|
8
|
+
};
|
|
9
|
+
export declare const ALL_FIELDS: Field;
|
|
10
|
+
export declare const OPERATORS: Array<Operator>;
|
|
11
|
+
export declare const STRING_OPERATORS: Array<StringOperator>;
|
|
12
|
+
export declare const NUMBER_OPERATORS: Array<NumberOperator>;
|
|
13
|
+
export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
|
|
14
|
+
export declare const DATE_TIME_OPERATORS: Array<DateTimeOperator>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Field, FilterFieldApplyed, InitialFilterApplyed, RawFilterFieldApply } from '../../types';
|
|
2
|
+
export declare const getFilterById: (id: number, applyedFilters: Array<FilterFieldApplyed>) => number;
|
|
3
|
+
/**
|
|
4
|
+
* @description Función formateadora filtros como el DynamicFilter los usa a nivel interno a como se guardan en las cookies
|
|
5
|
+
* @param applyedFilters Filtros actualmente aplicados
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const formatToInitialFilters: (applyedFilters: Array<FilterFieldApplyed>) => Array<InitialFilterApplyed>;
|
|
9
|
+
/**
|
|
10
|
+
* @description Función formateadora filtros como el DynamicFilter los usa a nivel interno a como se envían a la API
|
|
11
|
+
* @param applyedFilters Filtros actualmente aplicados
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare const formatToRawFilter: (applyedFilters: Array<FilterFieldApplyed>) => Array<RawFilterFieldApply>;
|
|
15
|
+
/**
|
|
16
|
+
* @name getPurgedInitialFiltersApplyed
|
|
17
|
+
* @description Función encargada de purgar cualquier error que pueda venir del endpoint, por algun cambio de versión
|
|
18
|
+
*
|
|
19
|
+
* @param fields todos los campos que pueden aparecer en el filtro no Inclute el AllField
|
|
20
|
+
* @param initialFilters Filtros que van a ser purgados (Eliminados si tienen errores)
|
|
21
|
+
* @param getFieldByName Funcion para obtener el Field a través del nombre
|
|
22
|
+
* @returns Array de filtros aplicados excluyendo los que tengan errores
|
|
23
|
+
*/
|
|
24
|
+
export declare const getPurgedInitialFiltersApplyed: (fields: Array<Field>, initialFilters: Array<InitialFilterApplyed>, getFieldByName: (name: string) => Field) => Array<FilterFieldApplyed>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DynamicFilterProviderProps } from './types';
|
|
3
|
+
declare const DynamicFilterContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./store").DynamicFilterStateWithActions>, "setState"> & {
|
|
4
|
+
setState<A extends string | {
|
|
5
|
+
type: unknown;
|
|
6
|
+
}>(partial: import("./store").DynamicFilterStateWithActions | Partial<import("./store").DynamicFilterStateWithActions> | ((state: import("./store").DynamicFilterStateWithActions) => import("./store").DynamicFilterStateWithActions | Partial<import("./store").DynamicFilterStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
|
+
}, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: import("./store").DynamicFilterStateWithActions | Partial<import("./store").DynamicFilterStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").DynamicFilterStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
} | undefined): void;
|
|
11
|
+
}) | null>;
|
|
12
|
+
/**
|
|
13
|
+
* @description Contexto que crea y da alcance al Store (Zustand) para ser usado desde cualquier parte del componente.
|
|
14
|
+
* @param props DynamicFilterProviderProps
|
|
15
|
+
* @returns Proveedor de contexto, y el contexto
|
|
16
|
+
*/
|
|
17
|
+
declare function DynamicFilterProvider(props: DynamicFilterProviderProps): JSX.Element;
|
|
18
|
+
export { DynamicFilterProvider, DynamicFilterContext };
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
import { Field, FilterFieldApplyed, FilterToEditApply, InitialFilterApplyed, OnChangeFilters } from '../../types';
|
|
3
|
+
import { Classes } from '../../classes';
|
|
4
|
+
import { WritableDraft } from 'immer/dist/internal';
|
|
5
|
+
export declare type OpenFor = 'add' | 'edit';
|
|
6
|
+
export interface PopoverFilterDataBase {
|
|
7
|
+
/**
|
|
8
|
+
* "openFor" motivo de apertura del popup
|
|
9
|
+
*/
|
|
10
|
+
openFor: OpenFor;
|
|
11
|
+
/**
|
|
12
|
+
* "fnAnchorEl" Anchor para ubicar el popup y se pone como función debido a que Immer no soporta un draft de Element
|
|
13
|
+
*/
|
|
14
|
+
fnAnchorEl: () => Element;
|
|
15
|
+
}
|
|
16
|
+
export interface PopoverFilterDataAdd extends PopoverFilterDataBase {
|
|
17
|
+
openFor: 'add';
|
|
18
|
+
/**
|
|
19
|
+
* "field" Campo por el cual se va a filtrar
|
|
20
|
+
*/
|
|
21
|
+
field: Field;
|
|
22
|
+
}
|
|
23
|
+
export interface PopoverFilterDataEdit extends PopoverFilterDataBase {
|
|
24
|
+
openFor: 'edit';
|
|
25
|
+
/**
|
|
26
|
+
* "filter" filtro que se va a editar
|
|
27
|
+
*/
|
|
28
|
+
filter: FilterFieldApplyed;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @description Tipo usado para cuado se va agregar o modificar un filtro
|
|
33
|
+
*/
|
|
34
|
+
export declare type PopoverFilterData = PopoverFilterDataAdd | PopoverFilterDataEdit;
|
|
35
|
+
/**
|
|
36
|
+
* @interface
|
|
37
|
+
* @name OwnerState
|
|
38
|
+
* @description Interface que define la variables que se van a usar en clases del componente
|
|
39
|
+
*/
|
|
40
|
+
export declare type OwnerState = {
|
|
41
|
+
/**
|
|
42
|
+
* "inEdition" se establece cuando se está en edición.
|
|
43
|
+
*/
|
|
44
|
+
inEdition: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* "isDirty" cuando el comnponente tiene filtros por aplicar
|
|
47
|
+
*/
|
|
48
|
+
isDirty: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* "isValid" cuando el comnponente está en un estado invalido
|
|
51
|
+
*/
|
|
52
|
+
isValid: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* "isMobile" cuando el navegador está en modo celular
|
|
55
|
+
*/
|
|
56
|
+
isMobile: boolean;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @interface DynamicFilterState
|
|
60
|
+
* @name DynamicFilterState
|
|
61
|
+
* @description Interface que define el estado del componente
|
|
62
|
+
*/
|
|
63
|
+
export interface DynamicFilterState {
|
|
64
|
+
/**
|
|
65
|
+
* "fields" Campos por los que se puede filtrar
|
|
66
|
+
*/
|
|
67
|
+
fields: Array<Field>;
|
|
68
|
+
/**
|
|
69
|
+
* "withAllField" indica si permite o no filtrar por todos los campos
|
|
70
|
+
*/
|
|
71
|
+
withAllField: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* "ownerState" estado a nivel de clases del componente
|
|
74
|
+
*/
|
|
75
|
+
ownerState: OwnerState;
|
|
76
|
+
/**
|
|
77
|
+
* "allField" Campo que se usa cuando se puede buscar por todos los campos
|
|
78
|
+
*/
|
|
79
|
+
allField: Field;
|
|
80
|
+
/**
|
|
81
|
+
* "automatic" Configura si el filtro se ejecuta automaticamente cuando se agrega o se modifica un filtro
|
|
82
|
+
*/
|
|
83
|
+
automatic: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @description Funcion que retorna el elemento (inputFilter) desde donde se desprende el listado de campos
|
|
86
|
+
* Si no está definida, el menú de campos no se muestra
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
fnAnchorEl?: () => Element;
|
|
90
|
+
/**
|
|
91
|
+
* "inputData" texto en el InputFilter
|
|
92
|
+
*/
|
|
93
|
+
inputData: string;
|
|
94
|
+
/**
|
|
95
|
+
* @description Campos disponibles para filtrar
|
|
96
|
+
*/
|
|
97
|
+
availableFields: Array<Field>;
|
|
98
|
+
applyedFilters: Array<FilterFieldApplyed>;
|
|
99
|
+
onChangeFilters: OnChangeFilters;
|
|
100
|
+
/** popoverFilterData: para emerger el popuup de modificación campos */
|
|
101
|
+
popoverFilterData?: PopoverFilterData;
|
|
102
|
+
classes: Classes;
|
|
103
|
+
getLabel: GetLabelType;
|
|
104
|
+
}
|
|
105
|
+
export interface DynamicFilterStateWithActions extends DynamicFilterState {
|
|
106
|
+
actions: {
|
|
107
|
+
/**
|
|
108
|
+
* @description inicializa el estado del componente con los filtros que provienen desde afuera
|
|
109
|
+
* @param initialFiltersApplyed Filtros iniciales
|
|
110
|
+
*/
|
|
111
|
+
init: (initialFiltersApplyed: Array<InitialFilterApplyed>) => void;
|
|
112
|
+
/**
|
|
113
|
+
* @description Objetiene el Campo dado el nombre
|
|
114
|
+
* @param name
|
|
115
|
+
* @returns Field o undefined si no se encuentra
|
|
116
|
+
*/
|
|
117
|
+
getFieldByName: (name: string) => Field;
|
|
118
|
+
/**
|
|
119
|
+
* @description remueve un filtro si existe, y dispara el trigger de onChangeFilters
|
|
120
|
+
* @param id //identificador unico de un filtro
|
|
121
|
+
*/
|
|
122
|
+
removeFilter: (id: number) => void;
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @param anchorEl Elemento de donde va emerger el popup
|
|
126
|
+
* @param field Campo por el cual se va filtrar
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
showPopoverFilterForAdd: (anchorEl: Element, field: Field) => void;
|
|
130
|
+
/**
|
|
131
|
+
* @description Muestra la ventan de edición de un filtro aplicado
|
|
132
|
+
* @param anchorEl Anchor de elemento desde donde debe emerger
|
|
133
|
+
* @param filterToEdit Filtro a editar
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
showPopoverFilterForEdit: (anchorEl: Element, filterToEdit: FilterFieldApplyed) => void;
|
|
137
|
+
/**
|
|
138
|
+
* @description Oculta la ventana de edición
|
|
139
|
+
* @param stayInEditon determina si continua en edicióin
|
|
140
|
+
*/
|
|
141
|
+
hidePopoverFilter: (stayInEditon: boolean) => void;
|
|
142
|
+
/**
|
|
143
|
+
* @description Limpia todos los filtros aplicados menos los fixed
|
|
144
|
+
*/
|
|
145
|
+
clearFilters: VoidFunction;
|
|
146
|
+
/**
|
|
147
|
+
* @description llama al onChangeFilters proporcionado en los props del componente
|
|
148
|
+
*/
|
|
149
|
+
fireOnChangeFilters: VoidFunction;
|
|
150
|
+
/**
|
|
151
|
+
* @description Función encargada de encontrar un Id par un nuevo filtro
|
|
152
|
+
* @returns Id de filtro
|
|
153
|
+
*/
|
|
154
|
+
getNewId: () => number;
|
|
155
|
+
/**
|
|
156
|
+
* @description Agrega un filtro setedo y correcto a los filtros aplicados (applyedFilters)
|
|
157
|
+
* @param newFilter Filtro a agregar
|
|
158
|
+
* @returns
|
|
159
|
+
*/
|
|
160
|
+
addFilter: (newFilter: FilterFieldApplyed) => void;
|
|
161
|
+
/**
|
|
162
|
+
* @description Modifica un filtro que se encuentra en applyedFilters
|
|
163
|
+
* @param filterToEdit filtro a editar
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
166
|
+
updateFilter: (filterToEdit: FilterToEditApply) => void;
|
|
167
|
+
/**
|
|
168
|
+
* @description Modifica el texto que se visuliza en el InputFilter
|
|
169
|
+
* @param text texto en el input
|
|
170
|
+
* @returns
|
|
171
|
+
*/
|
|
172
|
+
setInputData: (inputData: string) => void;
|
|
173
|
+
/**
|
|
174
|
+
* @description Modifica el estado de edición del componente
|
|
175
|
+
* @param newInEdition Estado de edición
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
setInEdition: (newInEdition: boolean) => void;
|
|
179
|
+
/**
|
|
180
|
+
* @description Modifica el estado de isMobile del componente
|
|
181
|
+
* @param newIsMobile
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
setIsMobile: (newIsMobile: boolean) => void;
|
|
185
|
+
/**
|
|
186
|
+
* @description Establece la función de apertura del menuu de campos
|
|
187
|
+
* @param anchorEl
|
|
188
|
+
* @returns
|
|
189
|
+
*/
|
|
190
|
+
openPopoverMenuFields: (anchorEl: Element) => void;
|
|
191
|
+
/**
|
|
192
|
+
* @description Limpia la función de apertura del menu de campos (por el valor anchorEl = undefined)
|
|
193
|
+
*/
|
|
194
|
+
closePopoverMenuFields: (newInEdition?: boolean) => void;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
declare type InitialStoreProps = Pick<DynamicFilterState, 'automatic' | 'onChangeFilters' | 'automatic' | 'fields' | 'withAllField' | 'getLabel' | 'getLabel' | 'allField' | 'ownerState'>;
|
|
198
|
+
/**
|
|
199
|
+
* @description Crea el store de zustand para el componente DynamicFilter
|
|
200
|
+
* @param initProps Variables iniciales que necesita store para poder inicializarlo
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
export declare const createAreaStore: (initProps: InitialStoreProps) => Omit<Omit<import("zustand").StoreApi<DynamicFilterStateWithActions>, "setState"> & {
|
|
204
|
+
setState<A extends string | {
|
|
205
|
+
type: unknown;
|
|
206
|
+
}>(partial: DynamicFilterStateWithActions | Partial<DynamicFilterStateWithActions> | ((state: DynamicFilterStateWithActions) => DynamicFilterStateWithActions | Partial<DynamicFilterStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
207
|
+
}, "setState"> & {
|
|
208
|
+
setState(nextStateOrUpdater: DynamicFilterStateWithActions | Partial<DynamicFilterStateWithActions> | ((state: WritableDraft<DynamicFilterStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
209
|
+
type: unknown;
|
|
210
|
+
} | undefined): void;
|
|
211
|
+
};
|
|
212
|
+
export declare type DynamicFilterStore = ReturnType<typeof createAreaStore>;
|
|
213
|
+
export {};
|
|
@@ -1,3 +1,24 @@
|
|
|
1
1
|
import { Dictionary } from '@m4l/core';
|
|
2
|
+
export declare const DYNAMICFILTER_DICTIONARY_ID = "dynamic_filter";
|
|
2
3
|
export declare function getDynamicFilterComponentsDictionary(): string[];
|
|
3
4
|
export declare const defaultDynamicFilterDictionary: Dictionary;
|
|
5
|
+
export declare const LABEL_FILTER_BUTTON = "filter_tooltip";
|
|
6
|
+
export declare const DICCTIONARY: {
|
|
7
|
+
readonly input_placeholder: "input_placeholder";
|
|
8
|
+
readonly operand_true: "true";
|
|
9
|
+
readonly operand_false: "false";
|
|
10
|
+
readonly filter_tooltip_refresh: "filter_tooltip_refresh";
|
|
11
|
+
readonly filter_tooltip_dirty: "filter_tooltip_dirty";
|
|
12
|
+
readonly filter_tooltip_invalid: "filter_tooltip_invalid";
|
|
13
|
+
readonly operator_b: "operator_b";
|
|
14
|
+
readonly operator_e: "operator_e";
|
|
15
|
+
readonly operator_ne: "operator_ne";
|
|
16
|
+
readonly operator_gt: "operator_gt";
|
|
17
|
+
readonly operator_gte: "operator_gte";
|
|
18
|
+
readonly operator_lt: "operator_lt";
|
|
19
|
+
readonly operator_lte: "operator_lte";
|
|
20
|
+
readonly operator_c: "operator_c";
|
|
21
|
+
readonly operator_nc: "operator_nc";
|
|
22
|
+
};
|
|
23
|
+
export declare type TypeDictionary = typeof DICCTIONARY;
|
|
24
|
+
export declare const getDynamicFilterDictionary: (key: keyof TypeDictionary) => string;
|