@m4l/components 3.1.7 → 3.1.9

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 (232) hide show
  1. package/@types/export.d.ts +0 -3
  2. package/@types/types.d.ts +29 -11
  3. package/components/DynamicSort/constants.d.ts +12 -0
  4. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +84 -0
  5. package/components/DynamicSort/slots/SlotsEnum.d.ts +30 -0
  6. package/components/DynamicSort/slots/index.d.ts +2 -0
  7. package/components/DynamicSort/types.d.ts +183 -0
  8. package/components/FieldLabel/types.d.ts +1 -0
  9. package/components/ObjectLogs/types.d.ts +1 -1
  10. package/components/areas/contexts/AreasContext/helper.d.ts +3 -0
  11. package/components/hook-form/RHFTextField/constant.d.ts +1 -0
  12. package/components/hook-form/RHFTextField/index.d.ts +0 -1
  13. package/components/hook-form/RHFTextField/slots/RHFTextFieldEnum.d.ts +7 -0
  14. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +18 -0
  15. package/components/hook-form/RHFTextField/slots/index.d.ts +2 -0
  16. package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +3 -4
  17. package/components/hook-form/RHFTextField/types.d.ts +11 -3
  18. package/helpers/cookies/cookies.d.ts +4 -0
  19. package/helpers/cookies/index.d.ts +1 -0
  20. package/helpers/cookies/types.d.ts +42 -0
  21. package/index.js +180 -340
  22. package/node_modules-CQtkw0uG.js +7350 -0
  23. package/package.json +1 -1
  24. package/styles/DynamicSort.styles.d.ts +2 -0
  25. package/styles/MenuActions.styles.d.ts +1 -1
  26. package/styles/RHFTextField.styles.d.ts +2 -0
  27. package/utils/index.d.ts +1 -1
  28. package/vendor-BDLrgGjq.js +24692 -0
  29. package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
  30. package/components/AppBar/index-i0rhG3J1.js +0 -93
  31. package/components/BaseModule/index-CiNNlxzS.js +0 -30
  32. package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
  33. package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
  34. package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
  35. package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
  36. package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
  37. package/components/DataGrid/constants-8L7QgBKi.js +0 -10
  38. package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
  39. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
  40. package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
  41. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
  42. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
  43. package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
  44. package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
  45. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
  46. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
  47. package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
  48. package/components/DataGrid/index-BZ-lbmuU.js +0 -908
  49. package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
  50. package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
  51. package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
  52. package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
  53. package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
  54. package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
  55. package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
  56. package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
  57. package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
  58. package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
  59. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
  60. package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
  61. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
  62. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
  63. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
  64. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
  65. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
  66. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
  67. package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
  68. package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
  69. package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
  70. package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
  71. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
  72. package/components/FieldLabel/index-CI57EizR.js +0 -54
  73. package/components/GridLayout/index-C4HyxNYX.js +0 -1044
  74. package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
  75. package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
  76. package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
  77. package/components/HelperText/index-Crn_XIPF.js +0 -50
  78. package/components/Icon/index-C89MAkeH.js +0 -176
  79. package/components/Image/index-COp8vP0X.js +0 -175
  80. package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
  81. package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
  82. package/components/Loadable/index-BMbi9ISF.js +0 -9
  83. package/components/LoadingError/index-Cf0oGUrL.js +0 -89
  84. package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
  85. package/components/MFLoader/index-BI8vQZSH.js +0 -299
  86. package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
  87. package/components/NavLink/index-D1S_vtFO.js +0 -55
  88. package/components/NoItemSelected/index-B9oM26AX.js +0 -54
  89. package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
  90. package/components/PDFViewer/index-GVN2rfd6.js +0 -51
  91. package/components/Page/index-DZMkYmr4.js +0 -117
  92. package/components/PaperForm/index-DwgAfjci.js +0 -59
  93. package/components/Period/index-2pJG3VmY.js +0 -238
  94. package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
  95. package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
  96. package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
  97. package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
  98. package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
  99. package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
  100. package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
  101. package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
  102. package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
  103. package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
  104. package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
  105. package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
  106. package/components/Resizeable/index-DdP1xfE9.js +0 -20
  107. package/components/ScrollBar/index-f2URPPE2.js +0 -35
  108. package/components/ScrollToTop/index-TxORk5dB.js +0 -12
  109. package/components/SideBar/index-PUBBe0yH.js +0 -758
  110. package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
  111. package/components/ToastContainer/index-DK1d8NNd.js +0 -191
  112. package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
  113. package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
  114. package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
  115. package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
  116. package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
  117. package/components/animate/features-BbnE33u3.js +0 -5
  118. package/components/animate/index-BsWiJfzp.js +0 -89
  119. package/components/animate/variants/bounce-DanQqHAX.js +0 -101
  120. package/components/animate/variants/container-Dmpr6tg5.js +0 -22
  121. package/components/animate/variants/fade-CAOJNn06.js +0 -65
  122. package/components/animate/variants/index-l0sNRNKZ.js +0 -1
  123. package/components/animate/variants/transition-B9W5SWTa.js +0 -20
  124. package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
  125. package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
  126. package/components/areas/components/index-l0sNRNKZ.js +0 -1
  127. package/components/areas/constants-rqODZNZe.js +0 -6
  128. package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
  129. package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
  130. package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
  131. package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
  132. package/components/areas/dictionary-YUsP9beq.js +0 -36
  133. package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
  134. package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
  135. package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
  136. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
  137. package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
  138. package/components/areas/icons-CwFr-alN.js +0 -24
  139. package/components/areas/index-B_Odny9h.js +0 -22
  140. package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
  141. package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
  142. package/components/commercial/TopBar/index-F1repmti.js +0 -232
  143. package/components/commercial/index-CxDzs6Ax.js +0 -81
  144. package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
  145. package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
  146. package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
  147. package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
  148. package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
  149. package/components/formatters/index-pnJhDYKe.js +0 -109
  150. package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
  151. package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
  152. package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
  153. package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
  154. package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
  155. package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
  156. package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
  157. package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
  158. package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
  159. package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
  160. package/components/hook-form/RHFTextField/classes/constants.d.ts +0 -1
  161. package/components/hook-form/RHFTextField/classes/index.d.ts +0 -8
  162. package/components/hook-form/RHFTextField/classes/types.d.ts +0 -17
  163. package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
  164. package/components/hook-form/RHFTextField/styles.d.ts +0 -3
  165. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +0 -3
  166. package/components/hook-form/RHFTextField/tests/constants.d.ts +0 -3
  167. package/components/hook-form/RHFTextField/tests/utils.d.ts +0 -2
  168. package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
  169. package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
  170. package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
  171. package/components/maps/index-Ci-7-FHg.js +0 -7
  172. package/components/modal/WindowBase-Gd27v5FU.js +0 -44
  173. package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
  174. package/components/modal/index-CydPIpKZ.js +0 -65
  175. package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
  176. package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
  177. package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
  178. package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
  179. package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
  180. package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
  181. package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
  182. package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
  183. package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
  184. package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
  185. package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
  186. package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
  187. package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
  188. package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
  189. package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
  190. package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
  191. package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
  192. package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
  193. package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
  194. package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
  195. package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
  196. package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
  197. package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
  198. package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
  199. package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
  200. package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
  201. package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
  202. package/components/mui_extended/index-l0sNRNKZ.js +0 -1
  203. package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
  204. package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
  205. package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
  206. package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
  207. package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
  208. package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
  209. package/components/popups/index-l0sNRNKZ.js +0 -1
  210. package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
  211. package/contexts/RHFormContext/index-D_nK759o.js +0 -78
  212. package/hocs/withToggle/index-C1_DMZD3.js +0 -14
  213. package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
  214. package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
  215. package/hooks/useModal/index-BJSQOX3U.js +0 -10
  216. package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
  217. package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
  218. package/hooks/useTab/index-B_GEQFOP.js +0 -12
  219. package/react-data-grid-BfYuZ6AK.js +0 -2606
  220. package/react-draggable-DsCPdgQP.js +0 -811
  221. package/react-json-view-bhqIAaNg.js +0 -2576
  222. package/react-resizable-eBbFl2dX.js +0 -618
  223. package/react-spinners-TpKN9lZg.js +0 -123
  224. package/react-splitter-layout-C-JTsNGs.js +0 -158
  225. package/styles/DynamicFilter-CJFsIegc.js +0 -319
  226. package/styles/MenuActions-lTi-ynPM.js +0 -42
  227. package/styles/index-DKj6m8SL.js +0 -1691
  228. package/test/constants_no_mock-CF-669v-.js +0 -4
  229. package/test/getNameDataTestId-BaBTWhBr.js +0 -10
  230. package/utils/index-DiMrtgIu.js +0 -502
  231. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
  232. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
@@ -1,129 +0,0 @@
1
- import * as Yup from "yup";
2
- import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary-PrbXU3VZ.js";
3
- import { B as BOOLEAN_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
- 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
- type: "text",
35
- name: "formValueOperator",
36
- autoComplete: "off",
37
- options: operators,
38
- getOptionLabel: (option) => option.label,
39
- isOptionEqualToValue: (option, value) => option.id === value.id,
40
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operator))
41
- }
42
- ),
43
- /* @__PURE__ */ jsx(
44
- RHFAutocomplete,
45
- {
46
- type: "text",
47
- name: "formValueOperand1",
48
- autoComplete: "off",
49
- options: optionsYesNo,
50
- getOptionLabel: (option) => option.label,
51
- isOptionEqualToValue: (option, value) => option.value === value.value,
52
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operand1))
53
- }
54
- )
55
- ] });
56
- }
57
- class BooleanFilterHelpers {
58
- getComponent() {
59
- return BooleanFilter;
60
- }
61
- getDefaultFilter(field, fixed) {
62
- const defaultOperand1 = field.defaultOperand1;
63
- const defaultFilter = {
64
- id: 0,
65
- fieldType: "boolean",
66
- field,
67
- fixed,
68
- isSet: true,
69
- operator: "e",
70
- operand1: true
71
- };
72
- if (defaultOperand1 !== void 0 && typeof defaultOperand1 === "boolean") {
73
- defaultFilter.operand1 = defaultOperand1;
74
- }
75
- return defaultFilter;
76
- }
77
- getFilterFromFormValue(formFilterValue) {
78
- const operator = formFilterValue.formValueOperator.id;
79
- const operand1 = formFilterValue.formValueOperand1?.value || false;
80
- return {
81
- fieldType: "boolean",
82
- operator,
83
- operand1
84
- };
85
- }
86
- getFormValue(field, getLabel, filterValue) {
87
- const filterValueBoolean = filterValue ? filterValue : void 0;
88
- const operator = filterValueBoolean ? filterValueBoolean.operator : field.defaultOperator ?? "e";
89
- const formValueOperand1 = filterValueBoolean ? {
90
- value: filterValueBoolean.operand1,
91
- label: getLabel(getDynamicFilterDictionary(`operand_${filterValueBoolean.operand1}`))
92
- } : null;
93
- return {
94
- fieldType: "boolean",
95
- formValueOperator: {
96
- id: operator,
97
- label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
98
- },
99
- formValueOperand1
100
- };
101
- }
102
- getLabels(filter, getLabel, _formatters, _field) {
103
- const labelOperands = filter.operand1 ? getLabel(getDynamicFilterDictionary("operand_true")) : getLabel(getDynamicFilterDictionary("operand_false"));
104
- return {
105
- labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
106
- labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
107
- labelOperands
108
- };
109
- }
110
- getSchema(getLabel) {
111
- return Yup.object({
112
- formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
113
- formValueOperand1: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operand_required`))
114
- });
115
- }
116
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
117
- verifyFilter(filter, _field) {
118
- if (typeof filter.operator !== "string") {
119
- return false;
120
- }
121
- if (BOOLEAN_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
122
- return false;
123
- }
124
- return typeof filter.operand1 === "boolean";
125
- }
126
- }
127
- export {
128
- BooleanFilterHelpers as B
129
- };
@@ -1,171 +0,0 @@
1
- import * as Yup from "yup";
2
- import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary-PrbXU3VZ.js";
3
- import { a as DATE_TIME_OPERATORS } from "../../../constants-ByqmFATV.js";
4
- import { jsxs, jsx } from "react/jsx-runtime";
5
- import { useMemo } from "react";
6
- import { useFormContext, useWatch } from "react-hook-form";
7
- import { useModuleDictionary } from "@m4l/core";
8
- import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index-BtPL16HR.js";
9
- import { R as RHFDateTime } from "../../../../hook-form/RHFDateTime/index-CW1Slb-f.js";
10
- import { i as isValidDate } from "../../../../../utils/index-DiMrtgIu.js";
11
- function DateTimeFilter() {
12
- const { getLabel } = useModuleDictionary();
13
- const { control } = useFormContext();
14
- const operator = useWatch({
15
- control,
16
- name: "formValueOperator"
17
- });
18
- const operators = useMemo(
19
- () => DATE_TIME_OPERATORS.map((o) => ({
20
- id: o,
21
- label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
22
- })),
23
- [getLabel]
24
- );
25
- return /* @__PURE__ */ jsxs("div", { children: [
26
- /* @__PURE__ */ jsx(
27
- RHFAutocomplete,
28
- {
29
- type: "text",
30
- name: "formValueOperator",
31
- autoComplete: "off",
32
- options: operators,
33
- getOptionLabel: (option) => option.label,
34
- isOptionEqualToValue: (option, value) => option.id === value.id,
35
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_date_time))
36
- }
37
- ),
38
- /* @__PURE__ */ jsx(
39
- RHFDateTime,
40
- {
41
- name: "formValueOperand1",
42
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_date_time))
43
- }
44
- ),
45
- operator && operator.id === "b" && /* @__PURE__ */ jsx(
46
- RHFDateTime,
47
- {
48
- name: "formValueOperand2",
49
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand2_date_time))
50
- }
51
- )
52
- ] });
53
- }
54
- class DateTimeFilterHelpers {
55
- getComponent() {
56
- return DateTimeFilter;
57
- }
58
- getDefaultFilter(field, fixed) {
59
- const defaultStartDate = /* @__PURE__ */ new Date();
60
- const defaultEndDate = /* @__PURE__ */ new Date();
61
- defaultStartDate.setHours(0, 0, 0, 0);
62
- defaultEndDate.setHours(23, 59, 59, 999);
63
- const defaultOperand1 = field.defaultOperand1 && field.defaultOperand1 instanceof Date ? field.defaultOperand1 : defaultStartDate;
64
- const defaultOperand2 = field.defaultOperand2 && field.defaultOperand2 instanceof Date ? field.defaultOperand2 : defaultEndDate;
65
- return {
66
- id: 0,
67
- fieldType: "datetime",
68
- field,
69
- fixed,
70
- isSet: true,
71
- operator: "b",
72
- operand1: defaultOperand1,
73
- operand2: defaultOperand2
74
- };
75
- }
76
- getFormValue(field, getLabel, filterValueDateTime) {
77
- const filterValue = filterValueDateTime;
78
- const operator = filterValue ? filterValue.operator : field.defaultOperator ?? "b";
79
- const defaultStartDate = /* @__PURE__ */ new Date();
80
- const defaultEndDate = /* @__PURE__ */ new Date();
81
- const defaultOperand1 = field.defaultOperand1 && field.defaultOperand1 instanceof Date ? field.defaultOperand1 : defaultStartDate;
82
- const defaultOperand2 = field.defaultOperand2 && field.defaultOperand2 instanceof Date ? field.defaultOperand2 : defaultEndDate;
83
- const formValueOperand1 = filterValue ? filterValue.operand1 : defaultOperand1;
84
- const formValueOperand2 = filterValue && filterValue.operator === "b" ? filterValue.operand2 : defaultOperand2;
85
- return {
86
- fieldType: "datetime",
87
- formValueOperator: {
88
- id: operator,
89
- label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
90
- },
91
- formValueOperand1,
92
- formValueOperand2
93
- };
94
- }
95
- getFilterFromFormValue(formFilterValue) {
96
- const operator = formFilterValue.formValueOperator.id;
97
- const operand1 = formFilterValue.formValueOperand1;
98
- if (operator === "b") {
99
- const operand2 = formFilterValue.formValueOperand2;
100
- return {
101
- fieldType: "datetime",
102
- operator,
103
- operand1,
104
- operand2
105
- };
106
- } else {
107
- return {
108
- fieldType: "datetime",
109
- operator,
110
- operand1
111
- };
112
- }
113
- }
114
- getLabels(filter, getLabel, formatters, _field) {
115
- const { dateFormatter } = formatters;
116
- let labelOperands;
117
- if (filter.operator === "b") {
118
- labelOperands = filter.operand1 && filter.operand2 ? `${dateFormatter.formatDate(
119
- filter.operand1,
120
- dateFormatter.datetimeFormat
121
- )} - ${dateFormatter.formatDate(filter.operand2, dateFormatter.datetimeFormat)}` : "";
122
- } else {
123
- labelOperands = filter.operand1 ? dateFormatter.formatDate(filter.operand1, dateFormatter.datetimeFormat) : "";
124
- }
125
- return {
126
- labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
127
- labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
128
- labelOperands
129
- };
130
- }
131
- getSchema(getLabel) {
132
- return Yup.object({
133
- formValueOperator: Yup.object().nullable().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.operator_required))),
134
- formValueOperand1: Yup.date().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))).typeError(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))),
135
- formValueOperand2: Yup.mixed().when(["formValueOperator.id"], {
136
- is: "b",
137
- then: Yup.date().typeError(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))).min(
138
- Yup.ref("formValueOperand1"),
139
- getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))
140
- )
141
- })
142
- });
143
- }
144
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
145
- verifyFilter(filter, _field) {
146
- if (typeof filter.operator !== "string") {
147
- return false;
148
- }
149
- if (DATE_TIME_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
150
- return false;
151
- }
152
- if (typeof filter.operand1 !== "string") {
153
- return false;
154
- }
155
- if (!isValidDate(new Date(filter.operand1))) {
156
- return false;
157
- }
158
- if (filter.operator === "b") {
159
- if (typeof filter.operand2 !== "string") {
160
- return false;
161
- }
162
- if (!isValidDate(new Date(filter.operand1))) {
163
- return false;
164
- }
165
- }
166
- return true;
167
- }
168
- }
169
- export {
170
- DateTimeFilterHelpers as D
171
- };
@@ -1,153 +0,0 @@
1
- import * as Yup from "yup";
2
- import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary-PrbXU3VZ.js";
3
- import { jsxs, jsx } from "react/jsx-runtime";
4
- import { useMemo } from "react";
5
- import { useFormContext, useWatch } from "react-hook-form";
6
- import { useModuleDictionary } from "@m4l/core";
7
- import { N as NUMBER_OPERATORS } from "../../../constants-ByqmFATV.js";
8
- import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index-BtPL16HR.js";
9
- import { R as RHFTextField } from "../../../../hook-form/RHFTextField/index-B6ufruSB.js";
10
- function NumberFilter() {
11
- const { getLabel } = useModuleDictionary();
12
- const { control } = useFormContext();
13
- const operator = useWatch({
14
- control,
15
- name: "formValueOperator"
16
- });
17
- const operators = useMemo(
18
- () => NUMBER_OPERATORS.map((o) => ({
19
- id: o,
20
- label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
21
- })),
22
- [getLabel]
23
- );
24
- return /* @__PURE__ */ jsxs("div", { children: [
25
- /* @__PURE__ */ jsx(
26
- RHFAutocomplete,
27
- {
28
- type: "text",
29
- name: "formValueOperator",
30
- autoComplete: "off",
31
- options: operators,
32
- getOptionLabel: (option) => option.label,
33
- isOptionEqualToValue: (option, value) => option.id === value.id,
34
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_number))
35
- }
36
- ),
37
- /* @__PURE__ */ jsx(
38
- RHFTextField,
39
- {
40
- name: "formValueOperand1",
41
- type: "number",
42
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_number))
43
- }
44
- ),
45
- operator && operator.id === "b" && /* @__PURE__ */ jsx(
46
- RHFTextField,
47
- {
48
- name: "formValueOperand2",
49
- type: "number",
50
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand2_number))
51
- }
52
- )
53
- ] });
54
- }
55
- class NumberFilterHelpers {
56
- getComponent() {
57
- return NumberFilter;
58
- }
59
- getDefaultFilter(fieldNumber, fixed) {
60
- const field = fieldNumber;
61
- const dOperator = field.defaultOperator ?? "e";
62
- const defaultOperand1 = field.defaultOperand1 ?? null;
63
- const defaultOperand2 = field.defaultOperand2 ?? null;
64
- return {
65
- id: 0,
66
- fieldType: "number",
67
- field,
68
- fixed,
69
- isSet: false,
70
- operator: dOperator,
71
- operand1: defaultOperand1,
72
- operand2: defaultOperand2
73
- };
74
- }
75
- getFormValue(field, getLabel, filterValue) {
76
- const filterValueNumber = filterValue;
77
- const operator = filterValueNumber ? filterValueNumber.operator : field.defaultOperator ?? "e";
78
- const formValueOperand1 = filterValueNumber ? filterValueNumber.operand1 : null;
79
- const formValueOperand2 = filterValueNumber && filterValueNumber?.operator === "b" ? filterValueNumber.operand2 : null;
80
- return {
81
- fieldType: "number",
82
- formValueOperator: {
83
- id: operator,
84
- label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
85
- },
86
- formValueOperand1,
87
- formValueOperand2
88
- };
89
- }
90
- getFilterFromFormValue(formFilterValue) {
91
- const operator = formFilterValue.formValueOperator.id;
92
- const operand1 = formFilterValue.formValueOperand1 ? formFilterValue.formValueOperand1 : 0;
93
- if (operator === "b") {
94
- const operand2 = formFilterValue.formValueOperand2 ? formFilterValue.formValueOperand2 : 0;
95
- return {
96
- fieldType: "number",
97
- operator,
98
- operand1,
99
- operand2
100
- };
101
- } else {
102
- return {
103
- fieldType: "number",
104
- operator,
105
- operand1
106
- };
107
- }
108
- }
109
- getLabels(filter, getLabel, _formatters, _field) {
110
- let labelOperands;
111
- if (filter.operator === "b") {
112
- labelOperands = filter.operand1 && filter.operand2 ? `${filter.operand1} - ${filter.operand2}` : "";
113
- } else {
114
- labelOperands = filter.operand1 !== void 0 ? filter.operand1 + "" : "";
115
- }
116
- return {
117
- labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
118
- labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
119
- labelOperands
120
- };
121
- }
122
- getSchema(getLabel) {
123
- return Yup.object({
124
- formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
125
- formValueOperand1: Yup.number().typeError(
126
- getLabel(`dynamic_filter.error_operand_mustbe_number`)
127
- ),
128
- formValueOperand2: Yup.mixed().when(["formValueOperator.id"], {
129
- is: "b",
130
- then: Yup.number().typeError(getLabel(`dynamic_filter.error_operand_mustbe_number`)).min(Yup.ref("formValueOperand1"), getLabel(`dynamic_filter.error_less_than_start`))
131
- })
132
- });
133
- }
134
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
135
- verifyFilter(filter, _field) {
136
- if (typeof filter.operator !== "number") {
137
- return false;
138
- }
139
- if (NUMBER_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
140
- return false;
141
- }
142
- if (typeof filter.operand1 !== "number") {
143
- return false;
144
- }
145
- if (filter.operator === "b" && typeof filter.operand2 !== "number") {
146
- return false;
147
- }
148
- return true;
149
- }
150
- }
151
- export {
152
- NumberFilterHelpers as N
153
- };
@@ -1,146 +0,0 @@
1
- import * as Yup from "yup";
2
- import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../../../dictionary-PrbXU3VZ.js";
3
- import { jsxs, jsx } from "react/jsx-runtime";
4
- import { useMemo } from "react";
5
- import { useModuleDictionary } from "@m4l/core";
6
- import { S as SELECT_OPERATORS } from "../../../constants-ByqmFATV.js";
7
- import { u as useDynamicFilterStore } from "../../../store/index-BT-eWVnJ.js";
8
- import { R as RHFAutocomplete } from "../../../../hook-form/RHFAutocomplete/index-BtPL16HR.js";
9
- import { R as RHFAutocompleteAsync } from "../../../../hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js";
10
- function SelectFilter() {
11
- const { getLabel } = useModuleDictionary();
12
- const field = useDynamicFilterStore((state) => state.popoverFilterData?.field);
13
- if (!field?.selectOptions?.endPoint) {
14
- throw new Error("El filtro tipo Select requiere la configuración del Endpoint");
15
- }
16
- const autocompleteProps = field?.selectOptions;
17
- const operators = useMemo(
18
- () => SELECT_OPERATORS.map((o) => ({
19
- id: o,
20
- label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
21
- })),
22
- [getLabel]
23
- );
24
- return /* @__PURE__ */ jsxs("div", { children: [
25
- /* @__PURE__ */ jsx(
26
- RHFAutocomplete,
27
- {
28
- type: "text",
29
- name: "formValueOperator",
30
- autoComplete: "off",
31
- options: operators,
32
- getOptionLabel: (option) => option.label,
33
- isOptionEqualToValue: (option, value) => option.id === value.id,
34
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operator))
35
- }
36
- ),
37
- /* @__PURE__ */ jsx(
38
- RHFAutocompleteAsync,
39
- {
40
- ...autocompleteProps,
41
- name: "formValueOperandsArray",
42
- autoComplete: "off",
43
- label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operands_array))
44
- }
45
- )
46
- ] });
47
- }
48
- function filterValidOperandsArraySelect(operandsArray, field) {
49
- const operandsArrayFormatted = Array.isArray(operandsArray) ? operandsArray : [operandsArray];
50
- const getOptionId = field?.selectOptions?.getOptionId;
51
- const getOptionLabel = field?.selectOptions?.getOptionLabel;
52
- return operandsArrayFormatted?.filter((operand) => {
53
- return typeof operand === "object" && getOptionId?.(operand) && getOptionLabel?.(operand);
54
- });
55
- }
56
- class SelectFilterHelpers {
57
- getComponent() {
58
- return SelectFilter;
59
- }
60
- getDefaultFilter(field, fixed) {
61
- const defaultOperand = field.defaultOperandsArray;
62
- const defaultFilter = {
63
- id: 0,
64
- fieldType: "select",
65
- field,
66
- fixed,
67
- isSet: true,
68
- operator: "in",
69
- operandsArray: []
70
- };
71
- if (defaultOperand !== void 0 && Array.isArray(defaultOperand)) {
72
- const validOperandsArray = filterValidOperandsArraySelect(defaultOperand, field);
73
- defaultFilter.operandsArray = validOperandsArray || [];
74
- }
75
- return defaultFilter;
76
- }
77
- getFormValue(field, getLabel, filterValueSelect) {
78
- const filterValue = filterValueSelect ? filterValueSelect : void 0;
79
- const isMultiple = field?.selectOptions?.multiple ?? false;
80
- const formValueOperandsArray = isMultiple ? filterValueSelect?.operandsArray : filterValueSelect?.operandsArray?.[0] || filterValueSelect?.operandsArray;
81
- const operator = filterValue ? filterValue.operator : field.defaultOperator ?? "in";
82
- return {
83
- fieldType: "select",
84
- formValueOperator: {
85
- id: operator,
86
- label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
87
- },
88
- formValueOperandsArray
89
- };
90
- }
91
- getFilterFromFormValue(formFilterValue) {
92
- const operator = formFilterValue.formValueOperator.id;
93
- const operandsArray = Array.isArray(formFilterValue.formValueOperandsArray) ? formFilterValue.formValueOperandsArray : [formFilterValue.formValueOperandsArray];
94
- return {
95
- fieldType: "select",
96
- operator,
97
- operandsArray
98
- };
99
- }
100
- getLabels(filter, getLabel, _formatters, field) {
101
- const operandsArray = filter.operandsArray;
102
- const labelOperands = operandsArray?.reduce?.((label, operand) => {
103
- const textLabel = field.selectOptions?.getOptionLabel?.(operand) || "";
104
- return label ? `${label} | ${textLabel}` : textLabel;
105
- }, "")?.toString() || "";
106
- return {
107
- labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
108
- labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
109
- labelOperands
110
- };
111
- }
112
- getSchema(getLabel) {
113
- return Yup.object({
114
- formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
115
- formValueOperandsArray: Yup.lazy((value) => {
116
- return Array.isArray(value) ? Yup.array().min(1, getLabel(`dynamic_filter.error_operand_required`)).of(Yup.object().nullable()).required(getLabel(`dynamic_filter.error_operand_required`)) : Yup.object().nullable().required(getLabel(`dynamic_filter.error_operand_required`));
117
- })
118
- });
119
- }
120
- verifyFilter(filter, field) {
121
- if (typeof filter.operator !== "string") {
122
- return false;
123
- }
124
- if (!field) {
125
- return false;
126
- }
127
- if (SELECT_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
128
- return false;
129
- }
130
- if (!filter.operandsArray || typeof filter.operandsArray !== "object") {
131
- return false;
132
- }
133
- const validOperandsArray = filterValidOperandsArraySelect(
134
- filter.operandsArray,
135
- field
136
- );
137
- if (!validOperandsArray || validOperandsArray?.length === 0) {
138
- return false;
139
- }
140
- return true;
141
- }
142
- }
143
- export {
144
- SelectFilterHelpers as S,
145
- filterValidOperandsArraySelect as f
146
- };