@m4l/components 3.1.7 → 3.1.8
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/index.js +183 -340
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
- package/components/AppBar/index-i0rhG3J1.js +0 -93
- package/components/BaseModule/index-CiNNlxzS.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
- package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
- package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
- package/components/DataGrid/index-BZ-lbmuU.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
- package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
- package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
- package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
- package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
- package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
- package/components/FieldLabel/index-CI57EizR.js +0 -54
- package/components/GridLayout/index-C4HyxNYX.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
- package/components/HelperText/index-Crn_XIPF.js +0 -50
- package/components/Icon/index-C89MAkeH.js +0 -176
- package/components/Image/index-COp8vP0X.js +0 -175
- package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
- package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-Cf0oGUrL.js +0 -89
- package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
- package/components/MFLoader/index-BI8vQZSH.js +0 -299
- package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
- package/components/NavLink/index-D1S_vtFO.js +0 -55
- package/components/NoItemSelected/index-B9oM26AX.js +0 -54
- package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
- package/components/PDFViewer/index-GVN2rfd6.js +0 -51
- package/components/Page/index-DZMkYmr4.js +0 -117
- package/components/PaperForm/index-DwgAfjci.js +0 -59
- package/components/Period/index-2pJG3VmY.js +0 -238
- package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
- package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
- package/components/Resizeable/index-DdP1xfE9.js +0 -20
- package/components/ScrollBar/index-f2URPPE2.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-PUBBe0yH.js +0 -758
- package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
- package/components/ToastContainer/index-DK1d8NNd.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
- package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
- package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
- package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
- package/components/animate/features-BbnE33u3.js +0 -5
- package/components/animate/index-BsWiJfzp.js +0 -89
- package/components/animate/variants/bounce-DanQqHAX.js +0 -101
- package/components/animate/variants/container-Dmpr6tg5.js +0 -22
- package/components/animate/variants/fade-CAOJNn06.js +0 -65
- package/components/animate/variants/index-l0sNRNKZ.js +0 -1
- package/components/animate/variants/transition-B9W5SWTa.js +0 -20
- package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
- package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
- package/components/areas/components/index-l0sNRNKZ.js +0 -1
- package/components/areas/constants-rqODZNZe.js +0 -6
- package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
- package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
- package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
- package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
- package/components/areas/dictionary-YUsP9beq.js +0 -36
- package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
- package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
- package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
- package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
- package/components/areas/icons-CwFr-alN.js +0 -24
- package/components/areas/index-B_Odny9h.js +0 -22
- package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
- package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
- package/components/commercial/TopBar/index-F1repmti.js +0 -232
- package/components/commercial/index-CxDzs6Ax.js +0 -81
- package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
- package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
- package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
- package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
- package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
- package/components/formatters/index-pnJhDYKe.js +0 -109
- package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
- package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
- package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
- package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
- package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
- package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-Gd27v5FU.js +0 -44
- package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
- package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
- package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
- package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
- package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
- package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
- package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
- package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
- package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
- package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
- package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
- package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
- package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
- package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
- package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
- package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
- package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
- package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
- package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
- package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
- package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
- package/components/mui_extended/index-l0sNRNKZ.js +0 -1
- package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
- package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
- package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
- package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
- package/contexts/RHFormContext/index-D_nK759o.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-BJSQOX3U.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-B_GEQFOP.js +0 -12
- package/react-data-grid-BfYuZ6AK.js +0 -2606
- package/react-draggable-DsCPdgQP.js +0 -811
- package/react-json-view-bhqIAaNg.js +0 -2576
- package/react-resizable-eBbFl2dX.js +0 -618
- package/react-spinners-TpKN9lZg.js +0 -123
- package/react-splitter-layout-C-JTsNGs.js +0 -158
- package/styles/DynamicFilter-CJFsIegc.js +0 -319
- package/styles/MenuActions-lTi-ynPM.js +0 -42
- package/styles/index-DKj6m8SL.js +0 -1691
- package/test/constants_no_mock-CF-669v-.js +0 -4
- package/test/getNameDataTestId-BaBTWhBr.js +0 -10
- package/utils/index-DiMrtgIu.js +0 -502
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as Yup from "yup";
|
|
2
|
-
import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary-PrbXU3VZ.js";
|
|
3
|
-
import { b as STRING_OPERATORS } from "../../../constants-ByqmFATV.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-BtPL16HR.js";
|
|
8
|
-
import { R as RHFTextField } from "../../../../hook-form/RHFTextField/index-B6ufruSB.js";
|
|
9
|
-
function StringFilter() {
|
|
10
|
-
const { getLabel } = useModuleDictionary();
|
|
11
|
-
const operators = useMemo(
|
|
12
|
-
() => STRING_OPERATORS.map((o) => ({
|
|
13
|
-
id: o,
|
|
14
|
-
label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
|
|
15
|
-
})),
|
|
16
|
-
[getLabel]
|
|
17
|
-
);
|
|
18
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
19
|
-
/* @__PURE__ */ jsx(
|
|
20
|
-
RHFAutocomplete,
|
|
21
|
-
{
|
|
22
|
-
type: "text",
|
|
23
|
-
name: "formValueOperator",
|
|
24
|
-
autoComplete: "off",
|
|
25
|
-
options: operators,
|
|
26
|
-
getOptionLabel: (option) => option.label,
|
|
27
|
-
isOptionEqualToValue: (option, value) => option.id === value.id,
|
|
28
|
-
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_string))
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
RHFTextField,
|
|
33
|
-
{
|
|
34
|
-
name: "formValueOperand1",
|
|
35
|
-
label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_string))
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
] });
|
|
39
|
-
}
|
|
40
|
-
class StringFilterHelpers {
|
|
41
|
-
getComponent() {
|
|
42
|
-
return StringFilter;
|
|
43
|
-
}
|
|
44
|
-
getDefaultFilter(field, fixed) {
|
|
45
|
-
const defaultOperand1 = field.defaultOperand1;
|
|
46
|
-
const defaultFilter = {
|
|
47
|
-
id: 0,
|
|
48
|
-
fieldType: "string",
|
|
49
|
-
field,
|
|
50
|
-
fixed,
|
|
51
|
-
isSet: false,
|
|
52
|
-
operator: "c",
|
|
53
|
-
operand1: ""
|
|
54
|
-
};
|
|
55
|
-
if (defaultOperand1 !== void 0 && typeof defaultOperand1 === "string") {
|
|
56
|
-
defaultFilter.operand1 = defaultOperand1;
|
|
57
|
-
}
|
|
58
|
-
return defaultFilter;
|
|
59
|
-
}
|
|
60
|
-
getFilterFromFormValue(formFilterValue) {
|
|
61
|
-
const operator = formFilterValue.formValueOperator.id;
|
|
62
|
-
const operand1 = formFilterValue.formValueOperand1;
|
|
63
|
-
return {
|
|
64
|
-
fieldType: "string",
|
|
65
|
-
operator,
|
|
66
|
-
operand1
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
getFormValue(field, getLabel, filterValue) {
|
|
70
|
-
const filterValueString = filterValue;
|
|
71
|
-
const operator = filterValueString ? filterValueString.operator : field.defaultOperator ?? "c";
|
|
72
|
-
const formValueOperand1 = filterValueString ? filterValueString.operand1 : "";
|
|
73
|
-
return {
|
|
74
|
-
fieldType: "string",
|
|
75
|
-
formValueOperator: {
|
|
76
|
-
id: operator,
|
|
77
|
-
label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
|
|
78
|
-
},
|
|
79
|
-
formValueOperand1
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
getLabels(filter, getLabel, _formatters, _field) {
|
|
83
|
-
const labelOperands = filter.operand1 !== void 0 ? filter.operand1 + "" : "";
|
|
84
|
-
return {
|
|
85
|
-
labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
|
|
86
|
-
labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
|
|
87
|
-
labelOperands
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
getSchema(getLabel) {
|
|
91
|
-
return Yup.object({
|
|
92
|
-
formValueOperator: Yup.object().nullable().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.operator_required))),
|
|
93
|
-
formValueOperand1: Yup.string().required(
|
|
94
|
-
getLabel(getDynamicFilterDictionary(DICCTIONARY.error_operand_required))
|
|
95
|
-
)
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
99
|
-
verifyFilter(filter, _field) {
|
|
100
|
-
if (typeof filter.operator !== "string") {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
if (STRING_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
if (typeof filter.operand1 !== "string") {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
export {
|
|
113
|
-
StringFilterHelpers as S
|
|
114
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { useFormContext } from "react-hook-form";
|
|
4
|
-
import { B as BooleanFilterHelpers } from "./BooleanFilter/index-BcO3SlP5.js";
|
|
5
|
-
import { S as StringFilterHelpers } from "./StringFilter/index-D-NFIVnK.js";
|
|
6
|
-
import { D as DateTimeFilterHelpers } from "./DateTimeFilter/index-BCJhpNS8.js";
|
|
7
|
-
import { N as NumberFilterHelpers } from "./NumberFilter/index-DCNhz68u.js";
|
|
8
|
-
import { S as SelectFilterHelpers } from "./SelectFilter/index-BdypjM1Y.js";
|
|
9
|
-
const helpersStrategies = {
|
|
10
|
-
boolean: new BooleanFilterHelpers(),
|
|
11
|
-
string: new StringFilterHelpers(),
|
|
12
|
-
number: new NumberFilterHelpers(),
|
|
13
|
-
datetime: new DateTimeFilterHelpers(),
|
|
14
|
-
select: new SelectFilterHelpers(),
|
|
15
|
-
__default__: () => {
|
|
16
|
-
throw new Error("Type no defined");
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
function fieldFactory(type) {
|
|
20
|
-
const selectedHelper = helpersStrategies?.[type];
|
|
21
|
-
if (!selectedHelper) {
|
|
22
|
-
return helpersStrategies.__default__();
|
|
23
|
-
}
|
|
24
|
-
return selectedHelper;
|
|
25
|
-
}
|
|
26
|
-
function DataTypeComponent(props) {
|
|
27
|
-
const { formFilter, statusLoad } = props;
|
|
28
|
-
const { setFocus } = useFormContext();
|
|
29
|
-
const Component = fieldFactory(formFilter.field.type).getComponent();
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
setTimeout(() => setFocus("formValueOperand1"), 100);
|
|
32
|
-
}, [statusLoad]);
|
|
33
|
-
return /* @__PURE__ */ jsx(Component, {});
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
DataTypeComponent as D,
|
|
37
|
-
fieldFactory as f
|
|
38
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEnvironment } from "@m4l/core";
|
|
3
|
-
import { u as useDynamicFilterStore } from "../../store/index-BT-eWVnJ.js";
|
|
4
|
-
import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../dictionary-PrbXU3VZ.js";
|
|
5
|
-
import { Skeleton } from "@mui/material";
|
|
6
|
-
import { i as ActionsSkeletonButtonStyled, j as ActionsStyled, k as ActionsClearButtonStyled, l as ActionsSubmitButtonStyled } from "../../slots/dynamicFilterSlots-DHxelhXP.js";
|
|
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
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
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-PrbXU3VZ.js";
|
|
5
|
-
import { u as useDynamicFilterStore } from "../../store/index-BT-eWVnJ.js";
|
|
6
|
-
import { A as ALL_FIELD } from "../../constants-ByqmFATV.js";
|
|
7
|
-
import { Skeleton } from "@mui/material";
|
|
8
|
-
import { m as InputFilterStyled, n as InputFilterIconStyled, o as InputFilterInputStyled } from "../../slots/dynamicFilterSlots-DHxelhXP.js";
|
|
9
|
-
import { P as PopoverMenuFields } from "../PopoverMenuFields/index-DSegwAm2.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) showPopoverFilterForAdd(anchorEl(), field);
|
|
46
|
-
}
|
|
47
|
-
const inputHandlersProps = {
|
|
48
|
-
onFocus: (event) => {
|
|
49
|
-
openPopoverMenuFields(event.currentTarget);
|
|
50
|
-
setInEdition(true);
|
|
51
|
-
},
|
|
52
|
-
onChange: (event) => {
|
|
53
|
-
setInputData(event.target.value);
|
|
54
|
-
if (!anchorEl) {
|
|
55
|
-
openPopoverMenuFields(event.currentTarget);
|
|
56
|
-
}
|
|
57
|
-
hidePopoverFilter(true);
|
|
58
|
-
},
|
|
59
|
-
onKeyDown: (event) => {
|
|
60
|
-
if (event.key === "ArrowDown") {
|
|
61
|
-
let newIndex = -1;
|
|
62
|
-
if (filteredFields.length > 0) {
|
|
63
|
-
if (selectedFieldIndex < filteredFields.length - 1) {
|
|
64
|
-
newIndex = selectedFieldIndex + 1;
|
|
65
|
-
} else {
|
|
66
|
-
newIndex = filteredFields.length - 1;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
setSelectedFieldIndex(newIndex);
|
|
70
|
-
}
|
|
71
|
-
if (event.key === "ArrowUp") {
|
|
72
|
-
let newIndex = -1;
|
|
73
|
-
if (filteredFields.length > 0) {
|
|
74
|
-
if (selectedFieldIndex > -1) {
|
|
75
|
-
newIndex = selectedFieldIndex - 1;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
setSelectedFieldIndex(newIndex);
|
|
79
|
-
}
|
|
80
|
-
if (event.key === "Escape") {
|
|
81
|
-
closePopoverMenuFields();
|
|
82
|
-
}
|
|
83
|
-
if (event.key !== "Enter") return;
|
|
84
|
-
if (selectedFieldIndex === -1) {
|
|
85
|
-
if (inputData.trim() === "") {
|
|
86
|
-
closePopoverMenuFields();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (withAllField) {
|
|
90
|
-
addFilter({
|
|
91
|
-
id: getNewId(),
|
|
92
|
-
fieldType: "string",
|
|
93
|
-
field: getFieldByName(ALL_FIELD.name),
|
|
94
|
-
isSet: true,
|
|
95
|
-
fixed: false,
|
|
96
|
-
operator: "c",
|
|
97
|
-
operand1: inputData
|
|
98
|
-
});
|
|
99
|
-
setInputData("");
|
|
100
|
-
closePopoverMenuFields();
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
handleOpenPopUpClickItem(filteredFields[selectedFieldIndex]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
return {
|
|
108
|
-
/**
|
|
109
|
-
* URL del icono del inputFilter
|
|
110
|
-
*/
|
|
111
|
-
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/filter.svg`,
|
|
112
|
-
/**
|
|
113
|
-
* Si es esqueleto mostrar la versión de esqueleton
|
|
114
|
-
*/
|
|
115
|
-
isSkeleton,
|
|
116
|
-
/**
|
|
117
|
-
* Texto de placeholder del inputFilter
|
|
118
|
-
*/
|
|
119
|
-
inputPlaceHolder: getLabel(getDynamicFilterDictionary(DICCTIONARY.input_placeholder)),
|
|
120
|
-
/**
|
|
121
|
-
* Texto del inputFilter
|
|
122
|
-
*/
|
|
123
|
-
inputData,
|
|
124
|
-
/**
|
|
125
|
-
* Props para el handler de eventos del inputFilter
|
|
126
|
-
*/
|
|
127
|
-
inputHandlersProps,
|
|
128
|
-
/**
|
|
129
|
-
* Si no hay campos disponibles y no se permite filtrar por todos, no se renderiza el inputFilter
|
|
130
|
-
*/
|
|
131
|
-
canRender: !(!withAllField && availableFields.length === 0),
|
|
132
|
-
/**
|
|
133
|
-
* Campos filtrados por el inputFilter
|
|
134
|
-
*/
|
|
135
|
-
filteredFields,
|
|
136
|
-
/**
|
|
137
|
-
* Indice del campo seleccionado
|
|
138
|
-
*/
|
|
139
|
-
selectedFieldIndex
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function InputFilterSkeleton() {
|
|
143
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
|
-
/* @__PURE__ */ jsx(
|
|
145
|
-
Skeleton,
|
|
146
|
-
{
|
|
147
|
-
variant: "circular",
|
|
148
|
-
width: "16px",
|
|
149
|
-
height: "16px",
|
|
150
|
-
sx: { minWidth: "16px", minHeight: "16px" }
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "16px", sx: { minWidth: "80px" } })
|
|
154
|
-
] });
|
|
155
|
-
}
|
|
156
|
-
const InputFilter = () => {
|
|
157
|
-
const {
|
|
158
|
-
iconUrl,
|
|
159
|
-
isSkeleton,
|
|
160
|
-
inputPlaceHolder,
|
|
161
|
-
inputData,
|
|
162
|
-
inputHandlersProps,
|
|
163
|
-
canRender,
|
|
164
|
-
filteredFields,
|
|
165
|
-
selectedFieldIndex
|
|
166
|
-
} = useInputFilter();
|
|
167
|
-
if (!canRender) return null;
|
|
168
|
-
if (isSkeleton) {
|
|
169
|
-
return /* @__PURE__ */ jsx(InputFilterStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(InputFilterSkeleton, {}) });
|
|
170
|
-
}
|
|
171
|
-
return /* @__PURE__ */ jsxs(InputFilterStyled, { ownerState: {}, children: [
|
|
172
|
-
/* @__PURE__ */ jsx(InputFilterIconStyled, { src: iconUrl, ownerState: {} }),
|
|
173
|
-
/* @__PURE__ */ jsx(
|
|
174
|
-
InputFilterInputStyled,
|
|
175
|
-
{
|
|
176
|
-
type: "text",
|
|
177
|
-
value: inputData,
|
|
178
|
-
placeholder: inputPlaceHolder,
|
|
179
|
-
ownerState: {},
|
|
180
|
-
...inputHandlersProps
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ jsx(PopoverMenuFields, { fields: filteredFields, selectFieldIndex: selectedFieldIndex })
|
|
184
|
-
] });
|
|
185
|
-
};
|
|
186
|
-
export {
|
|
187
|
-
InputFilter as I
|
|
188
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useMemo, useCallback } from "react";
|
|
3
|
-
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { u as useDynamicFilterStore } from "../../store/index-BT-eWVnJ.js";
|
|
5
|
-
import { f as fieldFactory, D as DataTypeComponent } from "../FieldTypes/index-BwQHJqk9.js";
|
|
6
|
-
import { P as PopoverStyled, p as PopoverHeaderStyled, q as PopoverHeaderIconStyled, r as PopoverHeaderTitleStyled, s as PopoverContainerFieldsStyled, t as PopoverHeaderActionsStyled } from "../../slots/dynamicFilterSlots-DHxelhXP.js";
|
|
7
|
-
import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index-D_nK759o.js";
|
|
8
|
-
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index-CIdpDXkr.js";
|
|
9
|
-
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index-CqqDZZcG.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
|
-
// todo: mejorar el tipado que se le envía a getFilterFromFormValue
|
|
76
|
-
...fieldFactory(filterField.fieldType).getFilterFromFormValue(filterField),
|
|
77
|
-
isSet: true
|
|
78
|
-
};
|
|
79
|
-
if (popoverFilterData?.openFor === "add") {
|
|
80
|
-
addFilter(newFilter);
|
|
81
|
-
} else {
|
|
82
|
-
updateFilter(newFilter);
|
|
83
|
-
}
|
|
84
|
-
hidePopoverFilter(false);
|
|
85
|
-
}
|
|
86
|
-
const labelField = field?.label ?? getLabel(field?.dictionaryId ?? "");
|
|
87
|
-
return {
|
|
88
|
-
field,
|
|
89
|
-
labelField,
|
|
90
|
-
canRender: Boolean(popoverFilterData),
|
|
91
|
-
anchorEl,
|
|
92
|
-
handleKeyDownPopper,
|
|
93
|
-
handleClosePopover,
|
|
94
|
-
onSubmit,
|
|
95
|
-
onClose,
|
|
96
|
-
filterFormValue,
|
|
97
|
-
formFilter,
|
|
98
|
-
popupValidationSchema,
|
|
99
|
-
statusLoad
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function PopoverFilter() {
|
|
103
|
-
const {
|
|
104
|
-
field,
|
|
105
|
-
labelField,
|
|
106
|
-
anchorEl,
|
|
107
|
-
handleKeyDownPopper,
|
|
108
|
-
handleClosePopover,
|
|
109
|
-
onSubmit,
|
|
110
|
-
onClose,
|
|
111
|
-
filterFormValue,
|
|
112
|
-
formFilter,
|
|
113
|
-
popupValidationSchema,
|
|
114
|
-
statusLoad,
|
|
115
|
-
canRender
|
|
116
|
-
} = usePopoverFilter();
|
|
117
|
-
if (!canRender) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
return /* @__PURE__ */ jsx(
|
|
121
|
-
PopoverStyled,
|
|
122
|
-
{
|
|
123
|
-
open: true,
|
|
124
|
-
disableRestoreFocus: true,
|
|
125
|
-
transitionDuration: 0,
|
|
126
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
127
|
-
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
128
|
-
arrowType: "top-left",
|
|
129
|
-
anchorEl,
|
|
130
|
-
onKeyDown: handleKeyDownPopper,
|
|
131
|
-
onClose: handleClosePopover,
|
|
132
|
-
ownerState: {},
|
|
133
|
-
children: /* @__PURE__ */ jsxs(
|
|
134
|
-
RHFormProvider,
|
|
135
|
-
{
|
|
136
|
-
onSubmit,
|
|
137
|
-
values: filterFormValue,
|
|
138
|
-
validationSchema: popupValidationSchema,
|
|
139
|
-
statusLoad,
|
|
140
|
-
children: [
|
|
141
|
-
/* @__PURE__ */ jsxs(PopoverHeaderStyled, { ownerState: {}, children: [
|
|
142
|
-
field.urlIcon && /* @__PURE__ */ jsx(PopoverHeaderIconStyled, { src: field.urlIcon, ownerState: {} }),
|
|
143
|
-
/* @__PURE__ */ jsx(PopoverHeaderTitleStyled, { variant: "paragraphDens", ownerState: {}, children: labelField })
|
|
144
|
-
] }),
|
|
145
|
-
/* @__PURE__ */ jsx(PopoverContainerFieldsStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(DataTypeComponent, { formFilter, statusLoad }) }),
|
|
146
|
-
/* @__PURE__ */ jsxs(PopoverHeaderActionsStyled, { ownerState: {}, children: [
|
|
147
|
-
/* @__PURE__ */ jsx(ActionCancel, { onClick: onClose, skeletonWidth: "68px" }),
|
|
148
|
-
/* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "64px" })
|
|
149
|
-
] })
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
export {
|
|
157
|
-
PopoverFilter as P
|
|
158
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleDictionary } from "@m4l/core";
|
|
3
|
-
import { u as useDynamicFilterStore } from "../../store/index-BT-eWVnJ.js";
|
|
4
|
-
import { u as PopoverMenuStyled, v as PopoverMenuItemStyled, w as PopoverMenuItemIconStyled, x as PopoverMenuItemLabelStyled } from "../../slots/dynamicFilterSlots-DHxelhXP.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
|
-
};
|