@m4l/components 1.0.15 → 1.0.17
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/AccountPopover/{index.e29a3c5c.js → index.f2226cb9.js} +1 -1
- package/components/AppBar/{index.4f4bb61f.js → index.50d090b7.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.b325f1e2.js → index.03a5915a.js} +1 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/{index.ff18b2a6.js → index.e0dbec18.js} +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/{index.1487b238.js → index.671116f2.js} +1 -1
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/{index.2999445b.js → index.f7b20493.js} +1 -1
- package/components/DataGrid/{index.4a2e0f22.js → index.447c4e44.js} +2 -2
- package/components/DataGrid/subcomponents/Actions/{index.0a3db350.js → index.aff74341.js} +6 -6
- package/components/DragResizeWindow/{index.f23525c7.js → index.132406ef.js} +2 -2
- package/components/DynamicFilter/{constants.1dddd09c.js → constants.095f1dbb.js} +4 -4
- package/components/DynamicFilter/{dictionary.da8046c7.js → dictionary.80fc7baf.js} +1 -1
- package/components/DynamicFilter/{index.952f8480.js → index.a7cb7710.js} +106 -3
- package/components/DynamicFilter/slots/{index.b55f3ebc.js → index.e2218307.js} +30 -30
- package/components/DynamicFilter/store/{index.370765c1.js → index.b9c2fe0b.js} +2 -2
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index.f0fe22f7.js +60 -0
- package/components/DynamicFilter/subcomponents/AppliedFilters/index.30d89b6c.js +26 -0
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index.edd7ed6f.js +40 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.f926af49.js +126 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.2382297a.js +169 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.7b4dccf7.js +151 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.2258fceb.js +145 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.82ca3e32.js +112 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/index.f4457f31.js +38 -0
- package/components/DynamicFilter/subcomponents/FilterActions/index.ba70cf6a.js +88 -0
- package/components/DynamicFilter/subcomponents/InputFilter/index.c7d72fb4.js +168 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/index.c2014303.js +157 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.895fbe45.js +63 -0
- package/components/FieldLabel/{index.31998491.js → index.9fd6697a.js} +1 -1
- package/components/Icon/{index.7c470582.js → index.5cf594aa.js} +2 -2
- package/components/LoadingError/{index.42a55f4c.js → index.427a569c.js} +1 -1
- package/components/MFLoader/{index.aa7f5a2e.js → index.12ccba1a.js} +1 -1
- package/components/ObjectLogs/{index.92ef4170.js → index.a3ed9816.js} +5 -5
- package/components/PaperForm/{index.c7495338.js → index.9ed65352.js} +1 -1
- package/components/Period/{index.798f8392.js → index.78867b45.js} +1 -1
- package/components/PropertyValue/{index.2d2911e8.js → index.4f0da54d.js} +2 -2
- package/components/SideBar/{index.6cfca08a.js → index.0298ead4.js} +2 -2
- package/components/ToastContainer/{index.18d8fe7c.js → index.e6d48658.js} +1 -1
- package/components/areas/components/AreasAdmin/{index.4b10abad.js → index.5af510af.js} +5 -5
- package/components/areas/components/AreasViewer/{index.7573f13c.js → index.343f0452.js} +7 -7
- package/components/areas/contexts/AreasContext/{index.11779442.js → index.91e1acfc.js} +2 -2
- package/components/areas/hooks/useAreas/{index.62f5aa0a.js → index.98ea6788.js} +1 -1
- package/components/commercial/TopBar/{index.7c61f79e.js → index.df994f5f.js} +2 -2
- package/components/commercial/{index.ecc02533.js → index.73cf794c.js} +2 -2
- package/components/formatters/BooleanFormatter/{index.a9d5ac7d.js → index.699e0aee.js} +2 -2
- package/components/formatters/{index.7b777849.js → index.8abccc30.js} +1 -1
- package/components/hook-form/RHFAutocomplete/{index.e5e8baae.js → index.1efaddc9.js} +2 -2
- package/components/hook-form/RHFAutocompleteAsync/{index.5d539214.js → index.2f123535.js} +1 -1
- package/components/hook-form/RHFCheckbox/{index.63c87daa.js → index.a9cf6faf.js} +1 -1
- package/components/hook-form/RHFColorPicker/{index.9d34e1f3.js → index.963323e4.js} +2 -2
- package/components/hook-form/RHFDateTime/{index.64804ca3.js → index.b3d0b2de.js} +2 -2
- package/components/hook-form/RHFPeriod/{index.15a61515.js → index.d1f45273.js} +2 -2
- package/components/hook-form/RHFTextField/{index.d2af30c0.js → index.97ba17ae.js} +2 -2
- package/components/maps/components/GpsTools/{index.6d2dab3c.js → index.0c6dff10.js} +11 -11
- package/components/maps/components/Map/{index.2c31ea9e.js → index.50447504.js} +8 -8
- package/components/modal/{WindowBase.6bf7201e.js → WindowBase.bf119f28.js} +2 -2
- package/components/modal/{WindowConfirm.ca443b26.js → WindowConfirm.b70c4b0f.js} +1 -1
- package/components/mui_extended/Accordion/{index.c51c5787.js → index.427d380a.js} +2 -2
- package/components/mui_extended/{CheckBox.511980a0.js → CheckBox.84c57702.js} +1 -1
- package/components/mui_extended/IconButton/{index.31343834.js → index.ee45bba2.js} +1 -1
- package/components/mui_extended/MenuActions/{index.520a26d8.js → index.06aaa091.js} +2 -2
- package/components/mui_extended/Pager/{index.225cd67f.js → index.c77a7694.js} +2 -2
- package/components/mui_extended/ToggleIconButton/{index.27848408.js → index.50ce11e4.js} +1 -1
- package/components/popups/PopupsProvider/{index.13be398e.js → index.7ed83556.js} +1 -1
- package/components/popups/PopupsViewer/{index.31407dfb.js → index.9b734a0a.js} +4 -4
- package/hooks/useFormAddEdit/{index.ab256ea9.js → index.3468c18c.js} +1 -1
- package/index.js +65 -54
- package/package.json +1 -1
- package/components/DynamicFilter/helpers/index.a13deed7.js +0 -557
- package/components/DynamicFilter/subcomponents/index.e32811b5.js +0 -788
|
@@ -7,7 +7,7 @@ import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
|
|
|
7
7
|
import { A as Avatar } from "../mui_extended/Avatar/index.fb9ad158.js";
|
|
8
8
|
import { C as CircularProgress } from "../mui_extended/CircularProgress/index.967e70b7.js";
|
|
9
9
|
import { P as Popover } from "../mui_extended/Popover/index.2348fc4f.js";
|
|
10
|
-
import { I as Icon } from "../Icon/index.
|
|
10
|
+
import { I as Icon } from "../Icon/index.5cf594aa.js";
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
const componentName = "M4LAccountPopover";
|
|
13
13
|
generateUtilityClasses(
|
|
@@ -7,7 +7,7 @@ import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
|
7
7
|
import { unstable_composeClasses } from "@mui/base";
|
|
8
8
|
import { I as Image } from "../Image/index.19aa7ff5.js";
|
|
9
9
|
import { T as Typography } from "../mui_extended/Typography/index.642798f1.js";
|
|
10
|
-
import { I as IconButton } from "../mui_extended/IconButton/index.
|
|
10
|
+
import { I as IconButton } from "../mui_extended/IconButton/index.ee45bba2.js";
|
|
11
11
|
const AppBarRoot = styled("header")(({ theme }) => ({
|
|
12
12
|
...theme.components?.M4LAppBar?.styleOverrides
|
|
13
13
|
}));
|
package/components/CommonActions/components/ActionFormCancel/{index.b325f1e2.js → index.03a5915a.js}
RENAMED
|
@@ -6,7 +6,7 @@ import { useCallback, useEffect } from "react";
|
|
|
6
6
|
import { u as useModal } from "../../../../hooks/useModal/index.2003c854.js";
|
|
7
7
|
import { u as useCommonActionsUtilityClasses } from "../Actions/index.258bf919.js";
|
|
8
8
|
import { u as useWindowToolsMF } from "../../../areas/hooks/useWindowToolsMF/index.2fbae9dc.js";
|
|
9
|
-
import { W as WindowConfirm } from "../../../modal/WindowConfirm.
|
|
9
|
+
import { W as WindowConfirm } from "../../../modal/WindowConfirm.b70c4b0f.js";
|
|
10
10
|
function ActionFormCancel() {
|
|
11
11
|
const { getLabel } = useModuleDictionary();
|
|
12
12
|
const { openModal } = useModal();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
|
-
import { B as BooleanFormatter } from "../../../formatters/BooleanFormatter/index.
|
|
3
|
+
import { B as BooleanFormatter } from "../../../formatters/BooleanFormatter/index.699e0aee.js";
|
|
4
4
|
function ColumnBooleanFormatter(props) {
|
|
5
5
|
const { fieldValue, presentationType, Component } = props;
|
|
6
6
|
return (obProps) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
|
-
import { C as ConcatenatedFormatter } from "../../../formatters/index.
|
|
3
|
+
import { C as ConcatenatedFormatter } from "../../../formatters/index.8abccc30.js";
|
|
4
4
|
function ColumnConcatenatedValueFormatter(props) {
|
|
5
5
|
const { fieldValue, fieldSeparator, Component } = props;
|
|
6
6
|
return (obProps) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox } from "@mui/material";
|
|
3
|
-
import { d as dataGridClasses } from "../../index.
|
|
3
|
+
import { d as dataGridClasses } from "../../index.447c4e44.js";
|
|
4
4
|
function ColumnInteractiveCheckFormatter(props) {
|
|
5
5
|
const { row, onRowChange, column } = props;
|
|
6
6
|
const handleChange = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getModalDialogComponentsDictionary } from "../ModalDialog/index.0dd5af28.js";
|
|
2
|
-
import { g as getPagerComponentsDictionary } from "../mui_extended/Pager/index.
|
|
2
|
+
import { g as getPagerComponentsDictionary } from "../mui_extended/Pager/index.c77a7694.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { styled } from "@mui/material/styles";
|
|
5
5
|
import { forwardRef, createContext, useState, useMemo, useEffect, useCallback, useContext, useRef, useLayoutEffect } from "react";
|
|
@@ -9,7 +9,7 @@ import { HTML5Backend } from "react-dnd-html5-backend";
|
|
|
9
9
|
import { SvgIcon, Checkbox, InputBase, styled as styled$1, Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
10
10
|
import { D as DATAGRID_SELECT_COLUMN_KEY, c as componentName, a as DATAGRID_PREFIX_NAME } from "./constants.e334cd50.js";
|
|
11
11
|
import { voidFunction, useModuleDictionary, useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
12
|
-
import { A as ActionsColumn, a as Actions } from "./subcomponents/Actions/index.
|
|
12
|
+
import { A as ActionsColumn, a as Actions } from "./subcomponents/Actions/index.aff74341.js";
|
|
13
13
|
import { unstable_composeClasses } from "@mui/base";
|
|
14
14
|
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
|
|
15
15
|
import { g as getNameDataTestId } from "../../test/getNameDataTestId.0faeade8.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.
|
|
3
|
-
import { u as useDataGrid, a as useFilters, D as DataGridRoot, b as dictionary } from "../../index.
|
|
2
|
+
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.06aaa091.js";
|
|
3
|
+
import { u as useDataGrid, a as useFilters, D as DataGridRoot, b as dictionary } from "../../index.447c4e44.js";
|
|
4
4
|
import { useTheme, Skeleton } from "@mui/material";
|
|
5
5
|
import { b as DATAGRID_ACTIONS_COLUMN_KEY } from "../../constants.e334cd50.js";
|
|
6
|
-
import { P as Pager } from "../../../mui_extended/Pager/index.
|
|
7
|
-
import { I as IconButton } from "../../../mui_extended/IconButton/index.
|
|
6
|
+
import { P as Pager } from "../../../mui_extended/Pager/index.c77a7694.js";
|
|
7
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/index.ee45bba2.js";
|
|
8
8
|
import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
9
9
|
import { useIsMobile, useResponsiveContainerStore } from "@m4l/graphics";
|
|
10
10
|
import { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect, useCallback } from "react";
|
|
11
11
|
import { D as DataGrid$1 } from "../../../../react-data-grid.c5377916.js";
|
|
12
12
|
import { styled } from "@mui/material/styles";
|
|
13
|
-
import { C as ColumnInteractiveCheckFormatter } from "../../formatters/ColumnInteractiveCheckFormatter/index.
|
|
13
|
+
import { C as ColumnInteractiveCheckFormatter } from "../../formatters/ColumnInteractiveCheckFormatter/index.f7b20493.js";
|
|
14
14
|
import { u as useModal } from "../../../../hooks/useModal/index.2003c854.js";
|
|
15
|
-
import { W as WindowBase } from "../../../modal/WindowBase.
|
|
15
|
+
import { W as WindowBase } from "../../../modal/WindowBase.bf119f28.js";
|
|
16
16
|
import { A as Actions$1 } from "../../../CommonActions/components/Actions/index.258bf919.js";
|
|
17
17
|
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.609a78ca.js";
|
|
18
18
|
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.ebac0bc1.js";
|
|
@@ -3,9 +3,9 @@ import { forwardRef, useState, useRef, useImperativeHandle, useCallback, useEffe
|
|
|
3
3
|
import { D as DraggableCore_1 } from "../../react-draggable.1c1ba224.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { styled, generateUtilityClasses } from "@mui/material";
|
|
6
|
-
import { M as MAP_ZINDEX_OVER_MAP } from "../maps/components/Map/index.
|
|
6
|
+
import { M as MAP_ZINDEX_OVER_MAP } from "../maps/components/Map/index.50447504.js";
|
|
7
7
|
import "@mui/base";
|
|
8
|
-
import { M as MAP_ZINDEX_OVER_MAP$1 } from "../popups/PopupsViewer/index.
|
|
8
|
+
import { M as MAP_ZINDEX_OVER_MAP$1 } from "../popups/PopupsViewer/index.9b734a0a.js";
|
|
9
9
|
import { R as Resizable } from "../../react-resizable.a59c14f4.js";
|
|
10
10
|
const WrapperWindowRoot = styled("div")`
|
|
11
11
|
position: absolute;
|
|
@@ -23,9 +23,9 @@ const DATE_TIME_OPERATORS = [
|
|
|
23
23
|
export {
|
|
24
24
|
ALL_FIELD as A,
|
|
25
25
|
BOOLEAN_OPERATORS as B,
|
|
26
|
-
|
|
26
|
+
DYNAMIC_FILTER_KEY_COMPONENT as D,
|
|
27
27
|
NUMBER_OPERATORS as N,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
SELECT_OPERATORS as S,
|
|
29
|
+
DATE_TIME_OPERATORS as a,
|
|
30
|
+
STRING_OPERATORS as b
|
|
31
31
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.258bf919.js";
|
|
2
|
-
import { g as getRHFAutocompleteComponentsDictionary } from "../hook-form/RHFAutocomplete/index.
|
|
2
|
+
import { g as getRHFAutocompleteComponentsDictionary } from "../hook-form/RHFAutocomplete/index.1efaddc9.js";
|
|
3
3
|
const DYNAMIC_FILTER_DICTIONARY_ID = "dynamic_filter";
|
|
4
4
|
function getDynamicFilterComponentsDictionary() {
|
|
5
5
|
return [DYNAMIC_FILTER_DICTIONARY_ID].concat(
|
|
@@ -1,9 +1,109 @@
|
|
|
1
|
+
import { f as fieldFactory } from "./subcomponents/FieldTypes/index.f4457f31.js";
|
|
2
|
+
import { f as filterValidOperandsArraySelect } from "./subcomponents/FieldTypes/SelectFilter/index.2258fceb.js";
|
|
1
3
|
import { alpha } from "@mui/material";
|
|
2
4
|
import { c as containerQuery } from "../../utils/index.14912462.js";
|
|
3
5
|
import { jsx } from "react/jsx-runtime";
|
|
4
6
|
import { useFlagsPresent, CommonFlags } from "@m4l/core";
|
|
5
|
-
import { D as DynamicFilterProvider } from "./store/index.
|
|
6
|
-
import {
|
|
7
|
+
import { D as DynamicFilterProvider } from "./store/index.b9c2fe0b.js";
|
|
8
|
+
import { D as DynamicFilterBase } from "./subcomponents/DynamicFilterBase/index.edd7ed6f.js";
|
|
9
|
+
function getPurgedInitialFiltersApplied(fields, initialFilters, getFieldByName) {
|
|
10
|
+
const newFilters = [];
|
|
11
|
+
const fixedFields = [];
|
|
12
|
+
for (let index = 0; index < initialFilters.length; index++) {
|
|
13
|
+
try {
|
|
14
|
+
const initialFilter = initialFilters[index];
|
|
15
|
+
const field = getFieldByName(initialFilter.name);
|
|
16
|
+
const filter = {
|
|
17
|
+
id: 0,
|
|
18
|
+
isSet: true,
|
|
19
|
+
fixed: false,
|
|
20
|
+
field,
|
|
21
|
+
fieldType: field.type,
|
|
22
|
+
operator: initialFilters[index].operator,
|
|
23
|
+
operand1: initialFilters[index].operand1,
|
|
24
|
+
operand2: initialFilters[index].operand2,
|
|
25
|
+
operandsArray: initialFilters[index].operandsArray
|
|
26
|
+
};
|
|
27
|
+
if (!field)
|
|
28
|
+
continue;
|
|
29
|
+
const canAddField = fieldFactory(field.type).verifyFilter(initialFilter, field);
|
|
30
|
+
if (canAddField) {
|
|
31
|
+
if (filter.fieldType === "datetime") {
|
|
32
|
+
filter.operand1 = new Date(filter.operand1 + "");
|
|
33
|
+
filter.operand2 = new Date(filter.operand2 + "");
|
|
34
|
+
}
|
|
35
|
+
if (field.presence === "fixed") {
|
|
36
|
+
if (fixedFields.findIndex((f) => f === field.name) === -1) {
|
|
37
|
+
filter.fixed = true;
|
|
38
|
+
fixedFields.push(field.name);
|
|
39
|
+
} else {
|
|
40
|
+
filter.fixed = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
filter.isSet = true;
|
|
44
|
+
filter.id = newFilters.length + 1;
|
|
45
|
+
newFilters.push(filter);
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (let index = 0; index < fields.length; index++) {
|
|
51
|
+
const field = fields[index];
|
|
52
|
+
if (field.presence === "initialized" || field.presence === "fixed") {
|
|
53
|
+
if (!initialFilters.find((f) => f.name === field.name)) {
|
|
54
|
+
const newFilter = fieldFactory(field.type).getDefaultFilter(
|
|
55
|
+
field,
|
|
56
|
+
field.presence === "fixed"
|
|
57
|
+
);
|
|
58
|
+
newFilter.id = newFilters.length + 1;
|
|
59
|
+
newFilters.push(newFilter);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return newFilters;
|
|
64
|
+
}
|
|
65
|
+
const formatToRawFilter = (appliedFilters) => {
|
|
66
|
+
return appliedFilters.map((af) => {
|
|
67
|
+
let oa = void 0;
|
|
68
|
+
if (af.field.type === "select" && af.operandsArray) {
|
|
69
|
+
oa = Array.isArray(af.operandsArray) ? af.operandsArray.map(af.field.selectOptions.getOptionId) : [af.field.selectOptions.getOptionId(af.operandsArray)];
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
n: af.field.name,
|
|
73
|
+
o: af.operator,
|
|
74
|
+
o1: af.operand1,
|
|
75
|
+
o2: af.operator === "b" ? af.operand2 : void 0,
|
|
76
|
+
oa
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
function formatToInitialFilters(appliedFilters) {
|
|
81
|
+
return appliedFilters.map((appliedFilter) => {
|
|
82
|
+
const ret = {
|
|
83
|
+
name: appliedFilter.field.name,
|
|
84
|
+
operator: appliedFilter.operator,
|
|
85
|
+
operand1: appliedFilter.operand1,
|
|
86
|
+
operand2: appliedFilter.operator === "b" ? appliedFilter.operand2 : void 0
|
|
87
|
+
};
|
|
88
|
+
if (appliedFilter.fieldType === "datetime") {
|
|
89
|
+
ret.operand1 = appliedFilter.operand1.toISOString();
|
|
90
|
+
ret.operand2 = appliedFilter.operator === "b" ? appliedFilter.operand2.toISOString() : void 0;
|
|
91
|
+
}
|
|
92
|
+
if (appliedFilter.fieldType === "select") {
|
|
93
|
+
const validOperandsArray = filterValidOperandsArraySelect(
|
|
94
|
+
appliedFilter.operandsArray,
|
|
95
|
+
appliedFilter.field
|
|
96
|
+
);
|
|
97
|
+
if (validOperandsArray && validOperandsArray?.length > 0) {
|
|
98
|
+
ret.operandsArray = validOperandsArray;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (ret.operand2 === void 0) {
|
|
102
|
+
delete ret.operand2;
|
|
103
|
+
}
|
|
104
|
+
return ret;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
7
107
|
const CONTAINER_QUERY_NAME = "dynamic";
|
|
8
108
|
const dynamicFilterStyles = {
|
|
9
109
|
root: {
|
|
@@ -327,5 +427,8 @@ function DynamicFilter(props) {
|
|
|
327
427
|
}
|
|
328
428
|
export {
|
|
329
429
|
DynamicFilter as D,
|
|
330
|
-
|
|
430
|
+
formatToRawFilter as a,
|
|
431
|
+
dynamicFilterStyles as d,
|
|
432
|
+
formatToInitialFilters as f,
|
|
433
|
+
getPurgedInitialFiltersApplied as g
|
|
331
434
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import {
|
|
2
|
+
import { D as DYNAMIC_FILTER_KEY_COMPONENT } from "../constants.095f1dbb.js";
|
|
3
3
|
import { D as DynamicFilterSlots } from "./constants.13968194.js";
|
|
4
|
-
import { d as dynamicFilterStyles } from "../index.
|
|
4
|
+
import { d as dynamicFilterStyles } from "../index.a7cb7710.js";
|
|
5
5
|
import { MenuItem } from "@mui/material";
|
|
6
6
|
import { A as Actions } from "../../CommonActions/components/Actions/index.258bf919.js";
|
|
7
|
-
import { I as Icon } from "../../Icon/index.
|
|
8
|
-
import { I as IconButton } from "../../mui_extended/IconButton/index.
|
|
7
|
+
import { I as Icon } from "../../Icon/index.5cf594aa.js";
|
|
8
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.ee45bba2.js";
|
|
9
9
|
import { P as Popover } from "../../mui_extended/Popover/index.2348fc4f.js";
|
|
10
10
|
import { T as Typography } from "../../mui_extended/Typography/index.642798f1.js";
|
|
11
11
|
const RootStyled = styled("div", { name: DYNAMIC_FILTER_KEY_COMPONENT, slot: DynamicFilterSlots.root })(
|
|
@@ -121,31 +121,31 @@ const PopoverHeaderActionsStyled = styled(Actions, {
|
|
|
121
121
|
})(dynamicFilterStyles?.popoverFilterActions);
|
|
122
122
|
export {
|
|
123
123
|
AppliedFilterChipStyled as A,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
InnerContainerStyled as I,
|
|
125
|
+
PopoverStyled as P,
|
|
126
126
|
RootStyled as R,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
127
|
+
AppliedFilterChipIconStyled as a,
|
|
128
|
+
AppliedFilterChipInfoStyled as b,
|
|
129
|
+
AppliedFilterChipInfoFieldNameStyled as c,
|
|
130
|
+
AppliedFilterChipInfoOperatorStyled as d,
|
|
131
|
+
AppliedFilterChipInfoOperandsStyled as e,
|
|
132
|
+
AppliedFilterChipRemoveButtonStyled as f,
|
|
133
|
+
AppliedFiltersStyled as g,
|
|
134
|
+
AppliedFilterInnerContainerStyled as h,
|
|
135
|
+
ActionsSkeletonButtonStyled as i,
|
|
136
|
+
ActionsStyled as j,
|
|
137
|
+
ActionsClearButtonStyled as k,
|
|
138
|
+
ActionsSubmitButtonStyled as l,
|
|
139
|
+
InputFilterStyled as m,
|
|
140
|
+
InputFilterIconStyled as n,
|
|
141
|
+
InputFilterInputStyled as o,
|
|
142
|
+
PopoverHeaderStyled as p,
|
|
143
|
+
PopoverHeaderIconStyled as q,
|
|
144
|
+
PopoverHeaderTitleStyled as r,
|
|
145
|
+
PopoverContainerFieldsStyled as s,
|
|
146
|
+
PopoverHeaderActionsStyled as t,
|
|
147
|
+
PopoverMenuStyled as u,
|
|
148
|
+
PopoverMenuItemStyled as v,
|
|
149
|
+
PopoverMenuItemIconStyled as w,
|
|
150
|
+
PopoverMenuItemLabelStyled as x
|
|
151
151
|
};
|
|
@@ -4,8 +4,8 @@ import { shallow } from "zustand/shallow";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useModuleDictionary, useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
6
6
|
import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
7
|
-
import { A as ALL_FIELD } from "../constants.
|
|
8
|
-
import { g as getPurgedInitialFiltersApplied, f as formatToInitialFilters, a as formatToRawFilter } from "../
|
|
7
|
+
import { A as ALL_FIELD } from "../constants.095f1dbb.js";
|
|
8
|
+
import { g as getPurgedInitialFiltersApplied, f as formatToInitialFilters, a as formatToRawFilter } from "../index.a7cb7710.js";
|
|
9
9
|
import { devtools } from "zustand/middleware";
|
|
10
10
|
import { immer } from "zustand/middleware/immer";
|
|
11
11
|
function useDynamicFilterStore(selector, equalityFn) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { A as AppliedFilterChipStyled, a as AppliedFilterChipIconStyled, b as AppliedFilterChipInfoStyled, c as AppliedFilterChipInfoFieldNameStyled, d as AppliedFilterChipInfoOperatorStyled, e as AppliedFilterChipInfoOperandsStyled, f as AppliedFilterChipRemoveButtonStyled } from "../../slots/index.e2218307.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
5
|
+
import { useFormatter } from "@m4l/graphics";
|
|
6
|
+
import { u as useDynamicFilterStore } from "../../store/index.b9c2fe0b.js";
|
|
7
|
+
import { f as fieldFactory } from "../FieldTypes/index.f4457f31.js";
|
|
8
|
+
function useAppliedFilterChip(filter) {
|
|
9
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
10
|
+
const { getLabel } = useModuleDictionary();
|
|
11
|
+
const formatters = useFormatter();
|
|
12
|
+
const { hidePopoverFilter, removeFilter, showPopoverFilterForEdit } = useDynamicFilterStore(
|
|
13
|
+
(state) => state.actions
|
|
14
|
+
);
|
|
15
|
+
const removeIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/clear.svg`;
|
|
16
|
+
const labels = useMemo(() => {
|
|
17
|
+
return fieldFactory(filter.field.type).getLabels(filter, getLabel, formatters, filter.field);
|
|
18
|
+
}, [filter, getLabel]);
|
|
19
|
+
function onDelete() {
|
|
20
|
+
hidePopoverFilter(false);
|
|
21
|
+
removeFilter(filter.id);
|
|
22
|
+
}
|
|
23
|
+
function onEditFilter(event) {
|
|
24
|
+
hidePopoverFilter(false);
|
|
25
|
+
const currentTarget = event.currentTarget;
|
|
26
|
+
setTimeout(() => showPopoverFilterForEdit(currentTarget, filter), 10);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
onDelete,
|
|
30
|
+
onEditFilter,
|
|
31
|
+
removeIconUrl,
|
|
32
|
+
iconFieldUrl: filter.field?.urlIcon,
|
|
33
|
+
labels
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function AppliedFilterChip(props) {
|
|
37
|
+
const { fixed } = props;
|
|
38
|
+
const { onEditFilter, onDelete, iconFieldUrl, removeIconUrl, labels } = useAppliedFilterChip(props);
|
|
39
|
+
return /* @__PURE__ */ jsxs(AppliedFilterChipStyled, { ownerState: {}, children: [
|
|
40
|
+
iconFieldUrl && /* @__PURE__ */ jsx(AppliedFilterChipIconStyled, { onClick: onEditFilter, src: iconFieldUrl, ownerState: {} }),
|
|
41
|
+
/* @__PURE__ */ jsxs(AppliedFilterChipInfoStyled, { onClick: onEditFilter, ownerState: {}, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(AppliedFilterChipInfoFieldNameStyled, { ownerState: {}, children: labels.labelField }),
|
|
43
|
+
/* @__PURE__ */ jsx(AppliedFilterChipInfoOperatorStyled, { ownerState: {}, children: labels.labelOperator }),
|
|
44
|
+
/* @__PURE__ */ jsx(AppliedFilterChipInfoOperandsStyled, { ownerState: {}, children: labels.labelOperands })
|
|
45
|
+
] }),
|
|
46
|
+
!fixed && /* @__PURE__ */ jsx(
|
|
47
|
+
AppliedFilterChipRemoveButtonStyled,
|
|
48
|
+
{
|
|
49
|
+
src: removeIconUrl,
|
|
50
|
+
size: "small",
|
|
51
|
+
dictionaryTooltipId: "dynamic_filter.tooltip_clear_filter",
|
|
52
|
+
onClick: onDelete,
|
|
53
|
+
ownerState: {}
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
AppliedFilterChip as A
|
|
60
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { S as ScrollBar } from "../../../ScrollBar/index.21bc5025.js";
|
|
3
|
+
import { g as AppliedFiltersStyled, h as AppliedFilterInnerContainerStyled } from "../../slots/index.e2218307.js";
|
|
4
|
+
import { u as useDynamicFilterStore } from "../../store/index.b9c2fe0b.js";
|
|
5
|
+
import { A as AppliedFilterChip } from "../AppliedFilterChip/index.f0fe22f7.js";
|
|
6
|
+
function useAppliedFilters() {
|
|
7
|
+
const appliedFilter = useDynamicFilterStore((state) => state.appliedFilters);
|
|
8
|
+
const isSkeleton = useDynamicFilterStore((state) => state.ownerState.isSkeleton);
|
|
9
|
+
const appliedFiltersSorted = [...appliedFilter].sort(
|
|
10
|
+
(filterA, filterB) => filterA.isSet !== filterB.isSet ? Number(filterA.isSet) - Number(filterB.isSet) : filterB.id - filterA.id
|
|
11
|
+
);
|
|
12
|
+
return {
|
|
13
|
+
appliedFiltersSorted,
|
|
14
|
+
isSkeleton
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function AppliedFilters() {
|
|
18
|
+
const { appliedFiltersSorted, isSkeleton } = useAppliedFilters();
|
|
19
|
+
if (isSkeleton) {
|
|
20
|
+
return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {} });
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx(AppliedFilterInnerContainerStyled, { ownerState: {}, children: appliedFiltersSorted?.map((filter) => /* @__PURE__ */ jsx(AppliedFilterChip, { ...filter }, filter.id)) }) }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
AppliedFilters as A
|
|
26
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { u as useDynamicFilterStore } from "../../store/index.b9c2fe0b.js";
|
|
3
|
+
import { R as RootStyled, I as InnerContainerStyled } from "../../slots/index.e2218307.js";
|
|
4
|
+
import { a as getPropDataTestId } from "../../../../test/getNameDataTestId.0faeade8.js";
|
|
5
|
+
import { D as DynamicFilterSlots } from "../../slots/constants.13968194.js";
|
|
6
|
+
import { I as InputFilter } from "../InputFilter/index.c7d72fb4.js";
|
|
7
|
+
import { A as AppliedFilters } from "../AppliedFilters/index.30d89b6c.js";
|
|
8
|
+
import { F as FilterActions } from "../FilterActions/index.ba70cf6a.js";
|
|
9
|
+
import { P as PopoverFilter } from "../PopoverFilter/index.c2014303.js";
|
|
10
|
+
function useDynamicFilterBase() {
|
|
11
|
+
const ownerState = useDynamicFilterStore((state) => state.ownerState);
|
|
12
|
+
const dataTestId = useDynamicFilterStore((state) => state.dataTestId);
|
|
13
|
+
return { ownerState, dataTestId };
|
|
14
|
+
}
|
|
15
|
+
function DynamicFilterBase() {
|
|
16
|
+
const { ownerState, dataTestId } = useDynamicFilterBase();
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
RootStyled,
|
|
19
|
+
{
|
|
20
|
+
ownerState: { ...ownerState },
|
|
21
|
+
...getPropDataTestId(dataTestId, DynamicFilterSlots.root),
|
|
22
|
+
children: /* @__PURE__ */ jsxs(
|
|
23
|
+
InnerContainerStyled,
|
|
24
|
+
{
|
|
25
|
+
ownerState: { ...ownerState },
|
|
26
|
+
...getPropDataTestId(dataTestId, DynamicFilterSlots.innerContainer),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx(InputFilter, {}),
|
|
29
|
+
/* @__PURE__ */ jsx(AppliedFilters, {}),
|
|
30
|
+
/* @__PURE__ */ jsx(FilterActions, {}),
|
|
31
|
+
/* @__PURE__ */ jsx(PopoverFilter, {})
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
DynamicFilterBase as D
|
|
40
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary.80fc7baf.js";
|
|
3
|
+
import { B as BOOLEAN_OPERATORS } from "../../../constants.095f1dbb.js";
|
|
4
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
7
|
+
import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index.1efaddc9.js";
|
|
8
|
+
function BooleanFilter() {
|
|
9
|
+
const { getLabel } = useModuleDictionary();
|
|
10
|
+
const operators = useMemo(
|
|
11
|
+
() => BOOLEAN_OPERATORS.map((o) => ({
|
|
12
|
+
id: o,
|
|
13
|
+
label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
|
|
14
|
+
})),
|
|
15
|
+
[getLabel]
|
|
16
|
+
);
|
|
17
|
+
const optionsYesNo = useMemo(
|
|
18
|
+
() => [
|
|
19
|
+
{
|
|
20
|
+
value: true,
|
|
21
|
+
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.operand_true))
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: false,
|
|
25
|
+
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.operand_false))
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
[getLabel]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
RHFAutocomplete,
|
|
33
|
+
{
|
|
34
|
+
name: "formValueOperator",
|
|
35
|
+
autoComplete: "off",
|
|
36
|
+
options: operators,
|
|
37
|
+
getOptionLabel: (option) => option.label,
|
|
38
|
+
isOptionEqualToValue: (option, value) => option.id === value.id,
|
|
39
|
+
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operator))
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
RHFAutocomplete,
|
|
44
|
+
{
|
|
45
|
+
name: "formValueOperand1",
|
|
46
|
+
autoComplete: "off",
|
|
47
|
+
options: optionsYesNo,
|
|
48
|
+
getOptionLabel: (option) => option.label,
|
|
49
|
+
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
50
|
+
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operand1))
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
class BooleanFilterHelpers {
|
|
56
|
+
getComponent() {
|
|
57
|
+
return BooleanFilter;
|
|
58
|
+
}
|
|
59
|
+
getDefaultFilter(field, fixed) {
|
|
60
|
+
const defaultOperand1 = field.defaultOperand1;
|
|
61
|
+
const defaultFilter = {
|
|
62
|
+
id: 0,
|
|
63
|
+
fieldType: "boolean",
|
|
64
|
+
field,
|
|
65
|
+
fixed,
|
|
66
|
+
isSet: true,
|
|
67
|
+
operator: "e",
|
|
68
|
+
operand1: true
|
|
69
|
+
};
|
|
70
|
+
if (defaultOperand1 !== void 0 && typeof defaultOperand1 === "boolean") {
|
|
71
|
+
defaultFilter.operand1 = defaultOperand1;
|
|
72
|
+
}
|
|
73
|
+
return defaultFilter;
|
|
74
|
+
}
|
|
75
|
+
getFilterFromFormValue(formFilterValue) {
|
|
76
|
+
const operator = formFilterValue.formValueOperator.id;
|
|
77
|
+
const operand1 = formFilterValue.formValueOperand1?.value || false;
|
|
78
|
+
return {
|
|
79
|
+
fieldType: "boolean",
|
|
80
|
+
operator,
|
|
81
|
+
operand1
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
getFormValue(field, getLabel, filterValue) {
|
|
85
|
+
const filterValueBoolean = filterValue ? filterValue : void 0;
|
|
86
|
+
const operator = filterValueBoolean ? filterValueBoolean.operator : field.defaultOperator ?? "e";
|
|
87
|
+
const formValueOperand1 = filterValueBoolean ? {
|
|
88
|
+
value: filterValueBoolean.operand1,
|
|
89
|
+
label: getLabel(getDynamicFilterDictionary(`operand_${filterValueBoolean.operand1}`))
|
|
90
|
+
} : null;
|
|
91
|
+
return {
|
|
92
|
+
fieldType: "boolean",
|
|
93
|
+
formValueOperator: {
|
|
94
|
+
id: operator,
|
|
95
|
+
label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
|
|
96
|
+
},
|
|
97
|
+
formValueOperand1
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
getLabels(filter, getLabel, _formatters, _field) {
|
|
101
|
+
const labelOperands = filter.operand1 ? getLabel(getDynamicFilterDictionary("operand_true")) : getLabel(getDynamicFilterDictionary("operand_false"));
|
|
102
|
+
return {
|
|
103
|
+
labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
|
|
104
|
+
labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
|
|
105
|
+
labelOperands
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
getSchema(getLabel) {
|
|
109
|
+
return Yup.object({
|
|
110
|
+
formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
|
|
111
|
+
formValueOperand1: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operand_required`))
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
verifyFilter(filter, _field) {
|
|
115
|
+
if (typeof filter.operator !== "string") {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (BOOLEAN_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return typeof filter.operand1 === "boolean";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
BooleanFilterHelpers as B
|
|
126
|
+
};
|