@m4l/components 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/components/AccountPopover/{index.404f01d4.js → index.97a78be9.js} +1 -1
  2. package/components/AppBar/{index.a153e334.js → index.47dbe6f1.js} +1 -1
  3. package/components/CommonActions/components/ActionFormCancel/{index.108b4887.js → index.ad1b361f.js} +1 -1
  4. package/components/DataGrid/formatters/ColumnBooleanFormatter/{index.aa98f7b6.js → index.3e0b387f.js} +1 -1
  5. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/{index.59b04e57.js → index.f33eb24e.js} +1 -1
  6. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/{index.7fc4c5f0.js → index.381342ab.js} +1 -1
  7. package/components/DataGrid/{index.d05b9542.js → index.804af87c.js} +2 -2
  8. package/components/DataGrid/subcomponents/Actions/{index.afc466b3.js → index.7421063b.js} +6 -6
  9. package/components/DragResizeWindow/{index.2b36dc1f.js → index.c957a1e6.js} +2 -2
  10. package/components/DynamicFilter/{dictionary.ce375e8f.js → dictionary.3b52457e.js} +1 -1
  11. package/components/DynamicFilter/helpers/{index.0eab89ef.js → index.32ea6e4a.js} +7 -2
  12. package/components/DynamicFilter/{index.ef6c3a4f.js → index.107ff9cd.js} +2 -2
  13. package/components/DynamicFilter/slots/constants.13968194.js +34 -0
  14. package/components/DynamicFilter/slots/{index.6f8fcccb.js → index.1590336a.js} +30 -61
  15. package/components/DynamicFilter/store/{index.6319d445.js → index.17676a1e.js} +1 -1
  16. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index.99e063cc.js +60 -0
  17. package/components/DynamicFilter/subcomponents/AppliedFilters/index.883e90f5.js +26 -0
  18. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index.909c1836.js +40 -0
  19. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.b718be41.js +56 -0
  20. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.d44591da.js +53 -0
  21. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.3e5853fd.js +55 -0
  22. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.740042db.js +48 -0
  23. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.636d6e6e.js +40 -0
  24. package/components/DynamicFilter/subcomponents/FieldTypes/index.339d175f.js +34 -0
  25. package/components/DynamicFilter/subcomponents/FilterActions/index.c549da68.js +88 -0
  26. package/components/DynamicFilter/subcomponents/InputFilter/index.ce036c20.js +168 -0
  27. package/components/DynamicFilter/subcomponents/PopoverFilter/index.3655469c.js +157 -0
  28. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.50fc58b0.js +63 -0
  29. package/components/FieldLabel/{index.b220bfbb.js → index.e951e11f.js} +1 -1
  30. package/components/Icon/{index.717cf69c.js → index.9615b1f6.js} +2 -2
  31. package/components/LoadingError/{index.4cfeee6f.js → index.2cdebf59.js} +1 -1
  32. package/components/MFLoader/{index.46805ba6.js → index.fb82993d.js} +1 -1
  33. package/components/ObjectLogs/{index.86dd71c3.js → index.6bd7a872.js} +5 -5
  34. package/components/PaperForm/{index.7a73a394.js → index.afbd86d1.js} +1 -1
  35. package/components/Period/{index.0d3ea00c.js → index.a6ea5000.js} +1 -1
  36. package/components/PropertyValue/{index.d02bea18.js → index.914a6cad.js} +2 -2
  37. package/components/SideBar/{index.90321e9f.js → index.a25eaad8.js} +2 -2
  38. package/components/ToastContainer/{index.f5bff00f.js → index.d2064c6b.js} +1 -1
  39. package/components/areas/components/AreasAdmin/{index.8290b7ac.js → index.15bd47d9.js} +5 -5
  40. package/components/areas/components/AreasViewer/{index.c1b3b741.js → index.316d5487.js} +7 -7
  41. package/components/areas/contexts/AreasContext/{index.8a80127b.js → index.765faaee.js} +2 -2
  42. package/components/areas/hooks/useAreas/{index.16d6b5a7.js → index.1b499976.js} +1 -1
  43. package/components/commercial/TopBar/{index.9eb26752.js → index.c55da9c3.js} +2 -2
  44. package/components/commercial/{index.192900c0.js → index.1248a029.js} +2 -2
  45. package/components/formatters/BooleanFormatter/{index.790bdc9d.js → index.117465b4.js} +2 -2
  46. package/components/formatters/{index.0b95012a.js → index.a8f46cab.js} +1 -1
  47. package/components/hook-form/RHFAutocomplete/{index.4caa6e3d.js → index.709756f6.js} +2 -2
  48. package/components/hook-form/RHFAutocompleteAsync/{index.21fe8f74.js → index.92180d10.js} +1 -1
  49. package/components/hook-form/RHFCheckbox/{index.d6c22f91.js → index.8c3ed4a0.js} +1 -1
  50. package/components/hook-form/RHFColorPicker/{index.e7f1ddab.js → index.fe1a3466.js} +2 -2
  51. package/components/hook-form/RHFDateTime/{index.d3683024.js → index.07030dcc.js} +2 -2
  52. package/components/hook-form/RHFPeriod/{index.b871e169.js → index.755de1db.js} +2 -2
  53. package/components/hook-form/RHFTextField/{index.ea988842.js → index.e1c51719.js} +2 -2
  54. package/components/maps/components/GpsTools/{index.16d5fdbf.js → index.a8ece5d5.js} +11 -11
  55. package/components/maps/components/Map/{index.b259ecde.js → index.e4045b3e.js} +8 -8
  56. package/components/modal/{WindowBase.f6adf7bc.js → WindowBase.2f606ead.js} +2 -2
  57. package/components/modal/{WindowConfirm.3e0d2457.js → WindowConfirm.6eea8ea6.js} +1 -1
  58. package/components/mui_extended/Accordion/{index.59a7e7e8.js → index.c4551873.js} +2 -2
  59. package/components/mui_extended/{CheckBox.c2f296af.js → CheckBox.09cbd444.js} +1 -1
  60. package/components/mui_extended/IconButton/{index.7ff17cea.js → index.47be7d35.js} +1 -1
  61. package/components/mui_extended/MenuActions/{index.5b65b116.js → index.ab55b9b7.js} +2 -2
  62. package/components/mui_extended/Pager/{index.4231bc79.js → index.a453d8b5.js} +2 -2
  63. package/components/mui_extended/ToggleIconButton/{index.709e2a4b.js → index.61269519.js} +1 -1
  64. package/components/popups/PopupsProvider/{index.59c39aa5.js → index.88f09c2a.js} +1 -1
  65. package/components/popups/PopupsViewer/{index.a10114d0.js → index.e80c69c5.js} +4 -4
  66. package/hooks/useFormAddEdit/{index.e53d7d2c.js → index.d718efd0.js} +1 -1
  67. package/index.js +66 -53
  68. package/package.json +1 -1
  69. package/components/DynamicFilter/subcomponents/index.f5d4a81d.js +0 -787
@@ -0,0 +1,48 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { a as SELECT_OPERATORS } from "../../../constants.1dddd09c.js";
5
+ import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary.3b52457e.js";
6
+ import { u as useDynamicFilterStore } from "../../../store/index.17676a1e.js";
7
+ import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index.709756f6.js";
8
+ import { R as RHFAutocompleteAsync } from "../../../../hook-form/RHFAutocompleteAsync/index.92180d10.js";
9
+ function SelectFilter() {
10
+ const { getLabel } = useModuleDictionary();
11
+ const field = useDynamicFilterStore((state) => state.popoverFilterData?.field);
12
+ if (!field?.selectOptions?.endPoint) {
13
+ throw new Error("El filtro tipo Select requiere la configuraci\xF3n del Endpoint");
14
+ }
15
+ const autocompleteProps = field?.selectOptions;
16
+ const operators = useMemo(
17
+ () => SELECT_OPERATORS.map((o) => ({
18
+ id: o,
19
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
20
+ })),
21
+ [getLabel]
22
+ );
23
+ return /* @__PURE__ */ jsxs("div", { children: [
24
+ /* @__PURE__ */ jsx(
25
+ RHFAutocomplete,
26
+ {
27
+ name: "formValueOperator",
28
+ autoComplete: "off",
29
+ options: operators,
30
+ getOptionLabel: (option) => option.label,
31
+ isOptionEqualToValue: (option, value) => option.id === value.id,
32
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operator))
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(
36
+ RHFAutocompleteAsync,
37
+ {
38
+ ...autocompleteProps,
39
+ name: "formValueOperandsArray",
40
+ autoComplete: "off",
41
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operands_array))
42
+ }
43
+ )
44
+ ] });
45
+ }
46
+ export {
47
+ SelectFilter as S
48
+ };
@@ -0,0 +1,40 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { S as STRING_OPERATORS } from "../../../constants.1dddd09c.js";
5
+ import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary.3b52457e.js";
6
+ import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index.709756f6.js";
7
+ import { R as RHFTextField } from "../../../../hook-form/RHFTextField/index.e1c51719.js";
8
+ function StringFilter() {
9
+ const { getLabel } = useModuleDictionary();
10
+ const operators = useMemo(
11
+ () => STRING_OPERATORS.map((o) => ({
12
+ id: o,
13
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
14
+ })),
15
+ [getLabel]
16
+ );
17
+ return /* @__PURE__ */ jsxs("div", { children: [
18
+ /* @__PURE__ */ jsx(
19
+ RHFAutocomplete,
20
+ {
21
+ name: "formValueOperator",
22
+ autoComplete: "off",
23
+ options: operators,
24
+ getOptionLabel: (option) => option.label,
25
+ isOptionEqualToValue: (option, value) => option.id === value.id,
26
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_string))
27
+ }
28
+ ),
29
+ /* @__PURE__ */ jsx(
30
+ RHFTextField,
31
+ {
32
+ name: "formValueOperand1",
33
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_string))
34
+ }
35
+ )
36
+ ] });
37
+ }
38
+ export {
39
+ StringFilter as S
40
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { useFormContext } from "react-hook-form";
4
+ import { B as BooleanFilterHelpers, S as StringFilterHelpers, N as NumberFilterHelpers, D as DateTimeFilterHelpers, b as SelectFilterHelpers } from "../../helpers/index.32ea6e4a.js";
5
+ const helpersStrategies = {
6
+ boolean: new BooleanFilterHelpers(),
7
+ string: new StringFilterHelpers(),
8
+ number: new NumberFilterHelpers(),
9
+ datetime: new DateTimeFilterHelpers(),
10
+ select: new SelectFilterHelpers(),
11
+ __default__: () => {
12
+ throw new Error("Type no defined");
13
+ }
14
+ };
15
+ function fieldFactory(type) {
16
+ const selectedHelper = helpersStrategies?.[type];
17
+ if (!selectedHelper) {
18
+ return helpersStrategies.__default__();
19
+ }
20
+ return selectedHelper;
21
+ }
22
+ function DataTypeComponent(props) {
23
+ const { formFilter, statusLoad } = props;
24
+ const { setFocus } = useFormContext();
25
+ const Component = fieldFactory(formFilter.field.type).getComponent();
26
+ useEffect(() => {
27
+ setTimeout(() => setFocus("formValueOperand1"), 100);
28
+ }, [statusLoad]);
29
+ return /* @__PURE__ */ jsx(Component, {});
30
+ }
31
+ export {
32
+ DataTypeComponent as D,
33
+ fieldFactory as f
34
+ };
@@ -0,0 +1,88 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { i as ActionsSkeletonButtonStyled, j as ActionsStyled, k as ActionsClearButtonStyled, l as ActionsSubmitButtonStyled } from "../../slots/index.1590336a.js";
3
+ import { useEnvironment } from "@m4l/core";
4
+ import { u as useDynamicFilterStore } from "../../store/index.17676a1e.js";
5
+ import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../dictionary.3b52457e.js";
6
+ import { Skeleton } from "@mui/material";
7
+ const ASSETS_URL = "frontend/components/dynamic_filter/assets/icons";
8
+ const ASSETS = {
9
+ refresh: "restart.svg",
10
+ search: "search.svg"
11
+ };
12
+ function useFilterActions() {
13
+ const { host_static_assets, environment_assets } = useEnvironment();
14
+ const automatic = useDynamicFilterStore((state) => state.automatic);
15
+ const isSkeleton = useDynamicFilterStore((state) => state.ownerState.isSkeleton);
16
+ const isValid = useDynamicFilterStore((state) => state.ownerState.isValid);
17
+ const isDirty = useDynamicFilterStore((state) => state.ownerState.isDirty);
18
+ const appliedFilters = useDynamicFilterStore((state) => state.appliedFilters);
19
+ const { hidePopoverFilter, clearFilters, fireOnChangeFilters } = useDynamicFilterStore(
20
+ (state) => state.actions
21
+ );
22
+ function onClickClearFilters() {
23
+ hidePopoverFilter(false);
24
+ clearFilters();
25
+ fireOnChangeFilters();
26
+ }
27
+ const filterIconUrl = `${host_static_assets}/${environment_assets}/${ASSETS_URL}/${automatic ? ASSETS.refresh : ASSETS.search}`;
28
+ const clearIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/close.svg`;
29
+ const canShowRemoveAction = appliedFilters.findIndex((f) => !f.fixed) > -1;
30
+ const filterButtonDictionaryTooltip = getDynamicFilterDictionary(
31
+ isValid ? isDirty ? DICCTIONARY.filter_tooltip_dirty : DICCTIONARY.filter_tooltip_refresh : DICCTIONARY.filter_tooltip_invalid
32
+ );
33
+ return {
34
+ isSkeleton,
35
+ filterIconUrl,
36
+ clearIconUrl,
37
+ canShowRemoveAction,
38
+ onClickClearFilters,
39
+ onClickFilter: fireOnChangeFilters,
40
+ filterButtonDictionaryTooltip,
41
+ ownerState: { isValid }
42
+ };
43
+ }
44
+ function FilterActionsSkeleton() {
45
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
46
+ /* @__PURE__ */ jsx(ActionsSkeletonButtonStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: "16px", height: "16px" }) }),
47
+ /* @__PURE__ */ jsx(ActionsSkeletonButtonStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: "16px", height: "16px" }) })
48
+ ] });
49
+ }
50
+ function FilterActions() {
51
+ const {
52
+ isSkeleton,
53
+ filterIconUrl,
54
+ clearIconUrl,
55
+ canShowRemoveAction,
56
+ onClickClearFilters,
57
+ onClickFilter,
58
+ filterButtonDictionaryTooltip,
59
+ ownerState
60
+ } = useFilterActions();
61
+ if (isSkeleton) {
62
+ return /* @__PURE__ */ jsx(ActionsStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(FilterActionsSkeleton, {}) });
63
+ }
64
+ return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: {}, children: [
65
+ canShowRemoveAction && /* @__PURE__ */ jsx(
66
+ ActionsClearButtonStyled,
67
+ {
68
+ src: clearIconUrl,
69
+ onClick: onClickClearFilters,
70
+ dictionaryTooltipId: "dynamic_filter.tooltip_clear_filters",
71
+ ownerState: {}
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsx(
75
+ ActionsSubmitButtonStyled,
76
+ {
77
+ src: filterIconUrl,
78
+ "aria-label": "settings",
79
+ dictionaryTooltipId: filterButtonDictionaryTooltip,
80
+ onClick: onClickFilter,
81
+ ownerState: { ...ownerState }
82
+ }
83
+ )
84
+ ] });
85
+ }
86
+ export {
87
+ FilterActions as F
88
+ };
@@ -0,0 +1,168 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
4
+ import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../dictionary.3b52457e.js";
5
+ import { u as useDynamicFilterStore } from "../../store/index.17676a1e.js";
6
+ import { A as ALL_FIELD } from "../../constants.1dddd09c.js";
7
+ import { Skeleton } from "@mui/material";
8
+ import { m as InputFilterStyled, n as InputFilterIconStyled, o as InputFilterInputStyled } from "../../slots/index.1590336a.js";
9
+ import { P as PopoverMenuFields } from "../PopoverMenuFields/index.50fc58b0.js";
10
+ function useInputFilter() {
11
+ const [selectedFieldIndex, setSelectedFieldIndex] = useState(-1);
12
+ const [filteredFields, setFilteredFields] = useState([]);
13
+ const { host_static_assets, environment_assets } = useEnvironment();
14
+ const { getLabel } = useModuleDictionary();
15
+ const isSkeleton = useModuleSkeleton();
16
+ const anchorEl = useDynamicFilterStore((state) => state.fnAnchorEl);
17
+ const withAllField = useDynamicFilterStore((state) => state.withAllField);
18
+ const availableFields = useDynamicFilterStore((state) => state.availableFields);
19
+ const inputData = useDynamicFilterStore((state) => state.inputData);
20
+ const {
21
+ addFilter,
22
+ closePopoverMenuFields,
23
+ getFieldByName,
24
+ getNewId,
25
+ hidePopoverFilter,
26
+ openPopoverMenuFields,
27
+ setInEdition,
28
+ setInputData,
29
+ showPopoverFilterForAdd
30
+ } = useDynamicFilterStore((state) => state.actions);
31
+ useEffect(() => {
32
+ if (!anchorEl) {
33
+ setFilteredFields([]);
34
+ } else {
35
+ setFilteredFields(
36
+ availableFields.filter(
37
+ (field) => (field.label ?? getLabel(field.dictionaryId)).includes(inputData)
38
+ )
39
+ );
40
+ setSelectedFieldIndex(-1);
41
+ }
42
+ }, [anchorEl, inputData, availableFields, getLabel]);
43
+ function handleOpenPopUpClickItem(field) {
44
+ closePopoverMenuFields();
45
+ if (anchorEl)
46
+ showPopoverFilterForAdd(anchorEl(), field);
47
+ }
48
+ const inputHandlersProps = {
49
+ onFocus: (event) => {
50
+ openPopoverMenuFields(event.currentTarget);
51
+ setInEdition(true);
52
+ },
53
+ onChange: (event) => {
54
+ setInputData(event.target.value);
55
+ if (!anchorEl) {
56
+ openPopoverMenuFields(event.currentTarget);
57
+ }
58
+ hidePopoverFilter(true);
59
+ },
60
+ onKeyDown: (event) => {
61
+ if (event.key === "ArrowDown") {
62
+ let newIndex = -1;
63
+ if (filteredFields.length > 0) {
64
+ if (selectedFieldIndex < filteredFields.length - 1) {
65
+ newIndex = selectedFieldIndex + 1;
66
+ } else {
67
+ newIndex = filteredFields.length - 1;
68
+ }
69
+ }
70
+ setSelectedFieldIndex(newIndex);
71
+ }
72
+ if (event.key === "ArrowUp") {
73
+ let newIndex = -1;
74
+ if (filteredFields.length > 0) {
75
+ if (selectedFieldIndex > -1) {
76
+ newIndex = selectedFieldIndex - 1;
77
+ }
78
+ }
79
+ setSelectedFieldIndex(newIndex);
80
+ }
81
+ if (event.key === "Escape") {
82
+ closePopoverMenuFields();
83
+ }
84
+ if (event.key !== "Enter")
85
+ return;
86
+ if (selectedFieldIndex === -1) {
87
+ if (inputData.trim() === "") {
88
+ closePopoverMenuFields();
89
+ return;
90
+ }
91
+ if (withAllField) {
92
+ addFilter({
93
+ id: getNewId(),
94
+ fieldType: "string",
95
+ field: getFieldByName(ALL_FIELD.name),
96
+ isSet: true,
97
+ fixed: false,
98
+ operator: "c",
99
+ operand1: inputData
100
+ });
101
+ setInputData("");
102
+ closePopoverMenuFields();
103
+ }
104
+ } else {
105
+ handleOpenPopUpClickItem(filteredFields[selectedFieldIndex]);
106
+ }
107
+ }
108
+ };
109
+ return {
110
+ iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/filter.svg`,
111
+ isSkeleton,
112
+ inputPlaceHolder: getLabel(getDynamicFilterDictionary(DICCTIONARY.input_placeholder)),
113
+ inputData,
114
+ inputHandlersProps,
115
+ canRender: !(!withAllField && availableFields.length === 0),
116
+ filteredFields,
117
+ selectedFieldIndex
118
+ };
119
+ }
120
+ function InputFilterSkeleton() {
121
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
122
+ /* @__PURE__ */ jsx(
123
+ Skeleton,
124
+ {
125
+ variant: "circular",
126
+ width: "16px",
127
+ height: "16px",
128
+ sx: { minWidth: "16px", minHeight: "16px" }
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "16px", sx: { minWidth: "80px" } })
132
+ ] });
133
+ }
134
+ const InputFilter = () => {
135
+ const {
136
+ iconUrl,
137
+ isSkeleton,
138
+ inputPlaceHolder,
139
+ inputData,
140
+ inputHandlersProps,
141
+ canRender,
142
+ filteredFields,
143
+ selectedFieldIndex
144
+ } = useInputFilter();
145
+ if (!canRender)
146
+ return null;
147
+ if (isSkeleton) {
148
+ return /* @__PURE__ */ jsx(InputFilterStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(InputFilterSkeleton, {}) });
149
+ }
150
+ return /* @__PURE__ */ jsxs(InputFilterStyled, { ownerState: {}, children: [
151
+ /* @__PURE__ */ jsx(InputFilterIconStyled, { src: iconUrl, ownerState: {} }),
152
+ /* @__PURE__ */ jsx(
153
+ InputFilterInputStyled,
154
+ {
155
+ type: "text",
156
+ value: inputData,
157
+ placeholder: inputPlaceHolder,
158
+ ownerState: {},
159
+ ...inputHandlersProps
160
+ }
161
+ ),
162
+ /* @__PURE__ */ jsx(PopoverMenuFields, { fields: filteredFields, selectFieldIndex: selectedFieldIndex })
163
+ ] });
164
+ };
165
+ const InputFilter$1 = InputFilter;
166
+ export {
167
+ InputFilter$1 as I
168
+ };
@@ -0,0 +1,157 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { P as PopoverStyled, p as PopoverHeaderStyled, q as PopoverHeaderIconStyled, r as PopoverHeaderTitleStyled, s as PopoverContainerFieldsStyled, t as PopoverHeaderActionsStyled } from "../../slots/index.1590336a.js";
3
+ import { useRef, useMemo, useCallback } from "react";
4
+ import { useModuleDictionary } from "@m4l/core";
5
+ import { u as useDynamicFilterStore } from "../../store/index.17676a1e.js";
6
+ import { f as fieldFactory, D as DataTypeComponent } from "../FieldTypes/index.339d175f.js";
7
+ import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index.bf3a2812.js";
8
+ import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.609a78ca.js";
9
+ import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.ebac0bc1.js";
10
+ function usePopoverFilter() {
11
+ let anchorEl;
12
+ let field;
13
+ let formFilter;
14
+ let filterFormValue;
15
+ let popupValidationSchema;
16
+ const { getLabel } = useModuleDictionary();
17
+ const popoverFilterData = useDynamicFilterStore((state) => state.popoverFilterData);
18
+ const { hidePopoverFilter, addFilter, updateFilter, getNewId } = useDynamicFilterStore(
19
+ (state) => state.actions
20
+ );
21
+ const refPreviousPopoverFilterData = useRef(popoverFilterData);
22
+ const statusLoad = useMemo(() => {
23
+ let returnStatus;
24
+ if (popoverFilterData && refPreviousPopoverFilterData.current === void 0) {
25
+ returnStatus = "ready";
26
+ } else if (!popoverFilterData) {
27
+ returnStatus = "initial";
28
+ } else {
29
+ returnStatus = "reload_values_provider";
30
+ }
31
+ refPreviousPopoverFilterData.current = popoverFilterData;
32
+ return returnStatus;
33
+ }, [popoverFilterData]);
34
+ if (popoverFilterData?.openFor === "add") {
35
+ anchorEl = popoverFilterData?.fnAnchorEl();
36
+ field = popoverFilterData.field;
37
+ const helperField = fieldFactory(field.type);
38
+ popupValidationSchema = helperField.getSchema(getLabel);
39
+ filterFormValue = helperField.getFormValue(field, getLabel);
40
+ formFilter = {
41
+ field,
42
+ id: getNewId(),
43
+ isSet: true,
44
+ fixed: false,
45
+ ...filterFormValue
46
+ };
47
+ } else if (popoverFilterData) {
48
+ anchorEl = popoverFilterData?.fnAnchorEl();
49
+ field = popoverFilterData?.filter.field;
50
+ const helperField = fieldFactory(field.type);
51
+ popupValidationSchema = helperField.getSchema(getLabel);
52
+ filterFormValue = helperField.getFormValue(field, getLabel, popoverFilterData.filter);
53
+ formFilter = { ...popoverFilterData?.filter, ...filterFormValue };
54
+ } else {
55
+ filterFormValue = {};
56
+ field = {};
57
+ formFilter = {};
58
+ anchorEl = {};
59
+ }
60
+ const onClose = useCallback(() => {
61
+ hidePopoverFilter(false);
62
+ }, []);
63
+ const handleKeyDownPopper = useCallback((event) => {
64
+ if (event.key === "Escape") {
65
+ onClose();
66
+ }
67
+ }, []);
68
+ function handleClosePopover() {
69
+ hidePopoverFilter(false);
70
+ }
71
+ async function onSubmit(dataFieldValues) {
72
+ const filterField = { ...filterFormValue, ...dataFieldValues };
73
+ const newFilter = {
74
+ ...formFilter,
75
+ ...fieldFactory(filterField.fieldType).getFilterFromFormValue(filterField),
76
+ isSet: true
77
+ };
78
+ if (popoverFilterData?.openFor === "add") {
79
+ addFilter(newFilter);
80
+ } else {
81
+ updateFilter(newFilter);
82
+ }
83
+ hidePopoverFilter(false);
84
+ }
85
+ const labelField = field?.label ?? getLabel(field?.dictionaryId ?? "");
86
+ return {
87
+ field,
88
+ labelField,
89
+ canRender: Boolean(popoverFilterData),
90
+ anchorEl,
91
+ handleKeyDownPopper,
92
+ handleClosePopover,
93
+ onSubmit,
94
+ onClose,
95
+ filterFormValue,
96
+ formFilter,
97
+ popupValidationSchema,
98
+ statusLoad
99
+ };
100
+ }
101
+ function PopoverFilter() {
102
+ const {
103
+ field,
104
+ labelField,
105
+ anchorEl,
106
+ handleKeyDownPopper,
107
+ handleClosePopover,
108
+ onSubmit,
109
+ onClose,
110
+ filterFormValue,
111
+ formFilter,
112
+ popupValidationSchema,
113
+ statusLoad,
114
+ canRender
115
+ } = usePopoverFilter();
116
+ if (!canRender) {
117
+ return null;
118
+ }
119
+ return /* @__PURE__ */ jsx(
120
+ PopoverStyled,
121
+ {
122
+ open: true,
123
+ disableRestoreFocus: true,
124
+ transitionDuration: 0,
125
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
126
+ transformOrigin: { vertical: "top", horizontal: "left" },
127
+ arrowType: "top-left",
128
+ anchorEl,
129
+ onKeyDown: handleKeyDownPopper,
130
+ onClose: handleClosePopover,
131
+ ownerState: {},
132
+ children: /* @__PURE__ */ jsxs(
133
+ RHFormProvider,
134
+ {
135
+ onSubmit,
136
+ values: filterFormValue,
137
+ validationSchema: popupValidationSchema,
138
+ statusLoad,
139
+ children: [
140
+ /* @__PURE__ */ jsxs(PopoverHeaderStyled, { ownerState: {}, children: [
141
+ field.urlIcon && /* @__PURE__ */ jsx(PopoverHeaderIconStyled, { src: field.urlIcon, ownerState: {} }),
142
+ /* @__PURE__ */ jsx(PopoverHeaderTitleStyled, { variant: "paragraphDens", ownerState: {}, children: labelField })
143
+ ] }),
144
+ /* @__PURE__ */ jsx(PopoverContainerFieldsStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(DataTypeComponent, { formFilter, statusLoad }) }),
145
+ /* @__PURE__ */ jsxs(PopoverHeaderActionsStyled, { ownerState: {}, children: [
146
+ /* @__PURE__ */ jsx(ActionCancel, { onClick: onClose, skeletonWidth: "68px" }),
147
+ /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "64px" })
148
+ ] })
149
+ ]
150
+ }
151
+ )
152
+ }
153
+ );
154
+ }
155
+ export {
156
+ PopoverFilter as P
157
+ };
@@ -0,0 +1,63 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { u as PopoverMenuStyled, v as PopoverMenuItemStyled, w as PopoverMenuItemIconStyled, x as PopoverMenuItemLabelStyled } from "../../slots/index.1590336a.js";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { u as useDynamicFilterStore } from "../../store/index.17676a1e.js";
5
+ function usePopoverMenuFields() {
6
+ const { getLabel } = useModuleDictionary();
7
+ const fnAnchorEl = useDynamicFilterStore((state) => state.fnAnchorEl);
8
+ const { showPopoverFilterForAdd, closePopoverMenuFields } = useDynamicFilterStore(
9
+ (state) => state.actions
10
+ );
11
+ function handleOpenPopUpClickItem(_event, field) {
12
+ if (fnAnchorEl) {
13
+ showPopoverFilterForAdd(fnAnchorEl(), field);
14
+ }
15
+ }
16
+ function handleClosePopover() {
17
+ closePopoverMenuFields(false);
18
+ }
19
+ function getItemLabel(field) {
20
+ return field.label ?? getLabel(field.dictionaryId);
21
+ }
22
+ return {
23
+ fnAnchorEl,
24
+ getItemLabel,
25
+ handleClosePopover,
26
+ handleOpenPopUpClickItem
27
+ };
28
+ }
29
+ function PopoverMenuFields(props) {
30
+ const { fields, selectFieldIndex } = props;
31
+ const { fnAnchorEl, handleOpenPopUpClickItem, handleClosePopover, getItemLabel } = usePopoverMenuFields();
32
+ return /* @__PURE__ */ jsx(
33
+ PopoverMenuStyled,
34
+ {
35
+ disableAutoFocus: true,
36
+ disableRestoreFocus: true,
37
+ arrowType: "top-left",
38
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
39
+ transformOrigin: { vertical: "top", horizontal: "left" },
40
+ open: Boolean(fnAnchorEl),
41
+ onClose: handleClosePopover,
42
+ anchorEl: fnAnchorEl?.(),
43
+ ownerState: {},
44
+ children: Boolean(fnAnchorEl) && fields.map((field, index) => /* @__PURE__ */ jsxs(
45
+ PopoverMenuItemStyled,
46
+ {
47
+ dense: true,
48
+ selected: index === selectFieldIndex,
49
+ onClick: (event) => handleOpenPopUpClickItem(event, field),
50
+ ownerState: {},
51
+ children: [
52
+ /* @__PURE__ */ jsx(PopoverMenuItemIconStyled, { src: field.urlIcon, ownerState: {} }),
53
+ /* @__PURE__ */ jsx(PopoverMenuItemLabelStyled, { ownerState: {}, children: getItemLabel(field) })
54
+ ]
55
+ },
56
+ `menu_action_${getItemLabel(field)}`
57
+ ))
58
+ }
59
+ );
60
+ }
61
+ export {
62
+ PopoverMenuFields as P
63
+ };
@@ -5,7 +5,7 @@ import { unstable_composeClasses } from "@mui/base";
5
5
  import { g as getComponentUtilityClass } from "../../utils/index.14912462.js";
6
6
  import clsx from "clsx";
7
7
  import { T as Typography } from "../mui_extended/Typography/index.642798f1.js";
8
- import { I as Icon } from "../Icon/index.717cf69c.js";
8
+ import { I as Icon } from "../Icon/index.9615b1f6.js";
9
9
  const FieldLabelRoot = styled("label")(({ theme }) => ({
10
10
  ...theme.components?.M4LFieldLabel?.styleOverrides
11
11
  }));
@@ -1,11 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Marker } from "react-leaflet";
3
3
  import L__default from "leaflet";
4
- import { m as mapClasses, L as LABEL_BK_COLOR_DEFAULT, a as LABEL_COLOR_DEFAULT } from "../maps/components/Map/index.b259ecde.js";
4
+ import { m as mapClasses, L as LABEL_BK_COLOR_DEFAULT, a as LABEL_COLOR_DEFAULT } from "../maps/components/Map/index.e4045b3e.js";
5
5
  import clsx from "clsx";
6
6
  import { useEnvironment } from "@m4l/core";
7
7
  import { generateUtilityClasses, generateUtilityClass, styled as styled$1 } from "@mui/material";
8
- import { u as useSideBar, g as getNameDataTestId$1 } from "../SideBar/index.90321e9f.js";
8
+ import { u as useSideBar, g as getNameDataTestId$1 } from "../SideBar/index.a25eaad8.js";
9
9
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
10
10
  import { styled } from "@mui/material/styles";
11
11
  import { unstable_composeClasses } from "@mui/base";
@@ -5,7 +5,7 @@ import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
5
5
  import { unstable_composeClasses } from "@mui/base";
6
6
  import { styled } from "@mui/material/styles";
7
7
  import { L as LinearProgressIndeterminate } from "../LinearProgressIndeterminate/index.ea9c8518.js";
8
- import { I as Icon } from "../Icon/index.717cf69c.js";
8
+ import { I as Icon } from "../Icon/index.9615b1f6.js";
9
9
  import { T as Typography } from "../mui_extended/Typography/index.642798f1.js";
10
10
  import { B as Button } from "../mui_extended/Button/index.d742e9ee.js";
11
11
  const componentName = "M4LoadingError";
@@ -12,7 +12,7 @@ import debounce from "lodash/debounce";
12
12
  import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/material";
13
13
  import { unstable_composeClasses } from "@mui/base";
14
14
  import { L as LinearProgress } from "../mui_extended/LinearProgress/index.4092bb69.js";
15
- import { L as LoadingError } from "../LoadingError/index.4cfeee6f.js";
15
+ import { L as LoadingError } from "../LoadingError/index.2cdebf59.js";
16
16
  const componentName = "M4LMFLoader";
17
17
  const mfLoaderClasses = generateUtilityClasses(componentName, [
18
18
  "root",
@@ -2,19 +2,19 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback, useMemo } from "react";
3
3
  import { useNetwork, useModuleDictionary, useEnvironment, usePaginate } from "@m4l/core";
4
4
  import { styled } from "@mui/material/styles";
5
- import { c as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.d05b9542.js";
5
+ import { c as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.804af87c.js";
6
6
  import { D as DateFormatter } from "../formatters/DateFormatter/index.2ef6f261.js";
7
7
  import { Tooltip, IconButton } from "@mui/material";
8
8
  import { useHostTheme, useResponsiveDesktop } from "@m4l/graphics";
9
9
  import { R as ReactJson } from "../../react-json-view.57125fcf.js";
10
10
  import { S as ScrollBar } from "../ScrollBar/index.21bc5025.js";
11
11
  import { u as useModal } from "../../hooks/useModal/index.2003c854.js";
12
- import { I as Icon } from "../Icon/index.717cf69c.js";
12
+ import { I as Icon } from "../Icon/index.9615b1f6.js";
13
13
  import { S as Stack } from "../mui_extended/Stack/index.fe363ca5.js";
14
- import { W as WindowBase } from "../modal/WindowBase.f6adf7bc.js";
15
- import { D as DynamicFilter } from "../DynamicFilter/index.ef6c3a4f.js";
14
+ import { W as WindowBase } from "../modal/WindowBase.2f606ead.js";
15
+ import { D as DynamicFilter } from "../DynamicFilter/index.107ff9cd.js";
16
16
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
17
- import { a as getDynamicFilterComponentsDictionary } from "../DynamicFilter/dictionary.ce375e8f.js";
17
+ import { a as getDynamicFilterComponentsDictionary } from "../DynamicFilter/dictionary.3b52457e.js";
18
18
  const Container = styled("div")(() => ({
19
19
  height: "100%",
20
20
  width: "100%",