@m4l/components 0.2.35 → 1.0.0

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 (529) hide show
  1. package/@types/export.d.ts +274 -441
  2. package/@types/types.d.ts +25 -0
  3. package/components/AccountPopover/classes/types.d.ts +1 -1
  4. package/components/AccountPopover/index.efc74d5c.js +330 -0
  5. package/components/AccountPopover/style.d.ts +2 -0
  6. package/components/AccountPopover/subcomponents/MyAvatar/types.d.ts +6 -6
  7. package/components/AccountPopover/subcomponents/PopOver/types.d.ts +8 -8
  8. package/components/AccountPopover/types.d.ts +3 -3
  9. package/components/AppBar/classes/types.d.ts +1 -1
  10. package/components/AppBar/index.fc126a22.js +94 -0
  11. package/components/AppBar/styles.d.ts +2 -0
  12. package/components/AppBar/tests/utils.d.ts +1 -1
  13. package/components/AppBar/types.d.ts +9 -9
  14. package/components/CommonActions/classes/types.d.ts +1 -1
  15. package/components/CommonActions/components/Actions/index.d.ts +2 -1
  16. package/components/CommonActions/components/Actions/styles.d.ts +2 -0
  17. package/components/CommonActions/components/Actions/types.d.ts +2 -2
  18. package/components/CommonActions/tests/utils.d.ts +1 -1
  19. package/components/DataGrid/assets/icons/datagrid.svg +4 -4
  20. package/components/DataGrid/classes/types.d.ts +1 -1
  21. package/components/DataGrid/styles.d.ts +2 -0
  22. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +8 -0
  23. package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +2 -0
  24. package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +6 -0
  25. package/components/DragResizeWindow/DragResizeWindow.d.ts +3 -3
  26. package/components/DragResizeWindow/classes/types.d.ts +1 -1
  27. package/components/DragResizeWindow/index.46b380e1.js +477 -0
  28. package/components/DragResizeWindow/styled.d.ts +2 -0
  29. package/components/DragResizeWindow/types.d.ts +4 -5
  30. package/components/DragResizeWindow/utils.d.ts +1 -1
  31. package/components/DynamicFilter/DynamicFilter.d.ts +1 -7
  32. package/components/DynamicFilter/constants.d.ts +3 -11
  33. package/components/DynamicFilter/dictionary.d.ts +1 -2
  34. package/components/DynamicFilter/dynamicFilterSlots.d.ts +87 -0
  35. package/components/DynamicFilter/helpers/formatToInitialFilters.d.ts +7 -0
  36. package/components/DynamicFilter/helpers/formatToRowFilter.d.ts +7 -0
  37. package/components/DynamicFilter/helpers/getPurgedInitialFiltersApplied.d.ts +11 -0
  38. package/components/DynamicFilter/index.d.ts +1 -2
  39. package/components/DynamicFilter/index.d9168c12.js +2012 -0
  40. package/components/DynamicFilter/store/DynamicFilterContext.d.ts +16 -0
  41. package/components/DynamicFilter/{contexts/DynamicFilterContext/store.d.ts → store/DynamicFilterStore.d.ts} +28 -60
  42. package/components/DynamicFilter/store/useDynamicFilterStore.d.ts +2 -0
  43. package/components/DynamicFilter/subcomponents/AppliedFilterChip/AppliedFilterChip.d.ts +3 -0
  44. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index.d.ts +1 -0
  45. package/components/DynamicFilter/subcomponents/AppliedFilterChip/useAppliedFilterChip.d.ts +10 -0
  46. package/components/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.d.ts +2 -0
  47. package/components/DynamicFilter/subcomponents/AppliedFilters/index.d.ts +1 -0
  48. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +5 -0
  49. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts +2 -0
  50. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index.d.ts +1 -0
  51. package/components/DynamicFilter/subcomponents/DynamicFilterBase/useDynamicFilterBase.d.ts +4 -0
  52. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.d.ts +14 -0
  53. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.d.ts +1 -0
  54. package/components/DynamicFilter/subcomponents/FieldTypes/DataTypeComponent.d.ts +7 -0
  55. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts +14 -0
  56. package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts +21 -0
  57. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.d.ts +14 -0
  58. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.d.ts +21 -0
  59. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.d.ts +14 -0
  60. package/components/DynamicFilter/subcomponents/FieldTypes/fieldFactory.d.ts +7 -0
  61. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.d.ts +2 -0
  62. package/components/DynamicFilter/subcomponents/FilterActions/FilterActionsSkeleton.d.ts +2 -0
  63. package/components/DynamicFilter/subcomponents/FilterActions/index.d.ts +1 -0
  64. package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +18 -0
  65. package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.d.ts +2 -0
  66. package/components/DynamicFilter/subcomponents/InputFilter/InputFilterSkeleton.d.ts +2 -0
  67. package/components/DynamicFilter/subcomponents/InputFilter/index.d.ts +1 -7
  68. package/components/DynamicFilter/subcomponents/InputFilter/useInputFilter.d.ts +40 -0
  69. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.d.ts +2 -0
  70. package/components/DynamicFilter/subcomponents/PopoverFilter/index.d.ts +1 -14
  71. package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +24 -0
  72. package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.d.ts +7 -0
  73. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.d.ts +1 -11
  74. package/components/DynamicFilter/subcomponents/PopoverMenuFields/usePopoverMenuFields.d.ts +9 -0
  75. package/components/DynamicFilter/types.d.ts +101 -30
  76. package/components/FieldLabel/classes/types.d.ts +1 -1
  77. package/components/FieldLabel/index.f9cdcc27.js +54 -0
  78. package/components/FieldLabel/styles.d.ts +2 -0
  79. package/components/GridLayout/{index.65470f01.js → index.bb3b7769.js} +526 -501
  80. package/components/GridLayout/styles.d.ts +2 -0
  81. package/components/GridLayout/subcomponents/Griditem/index.bb23f651.js +398 -0
  82. package/components/GridLayout/subcomponents/Responsive/{index.5b3e0521.js → index.b8a2a121.js} +51 -31
  83. package/components/GridLayout/subcomponents/SizeProvider/index.094bc6b5.js +65 -0
  84. package/components/HamburgerMenu/index.5997af31.js +82 -0
  85. package/components/HelperText/{index.7d2afdb3.js → index.be949cdf.js} +14 -22
  86. package/components/HelperText/styles.d.ts +2 -0
  87. package/components/Icon/index.d5fed418.js +420 -0
  88. package/components/Icon/styles.d.ts +4 -0
  89. package/components/Image/index.36a3d440.js +459 -0
  90. package/components/Image/styles.d.ts +2 -0
  91. package/components/Image/tests/utils.d.ts +1 -1
  92. package/components/Image/utils/getRatioValues.d.ts +1 -1
  93. package/components/LanguagePopover/index.e6fa2336.js +184 -0
  94. package/components/LanguagePopover/styles.d.ts +6 -0
  95. package/components/LanguagePopover/tests/utils.d.ts +1 -1
  96. package/components/LinearProgressIndeterminate/classes/types.d.ts +1 -1
  97. package/components/LinearProgressIndeterminate/index.de9d447c.js +53 -0
  98. package/components/LinearProgressIndeterminate/styles.d.ts +2 -0
  99. package/components/Loadable/{index.e994fc3e.js → index.e83cdb4e.js} +3 -8
  100. package/components/LoadingError/classes/types.d.ts +1 -1
  101. package/components/LoadingError/{index.ee29dd48.js → index.9f00c83c.js} +34 -55
  102. package/components/LoadingError/styles.d.ts +2 -0
  103. package/components/LoadingError/types.d.ts +1 -1
  104. package/components/MFLoader/classes/types.d.ts +1 -1
  105. package/components/MFLoader/{index.3a37407c.js → index.402c1acc.js} +55 -75
  106. package/components/MFLoader/styles.d.ts +2 -0
  107. package/components/MFLoader/types.d.ts +4 -4
  108. package/components/ModalDialog/index.ea9189c3.js +68 -0
  109. package/components/NavLink/index.4e548cee.js +55 -0
  110. package/components/NavLink/styles.d.ts +2 -0
  111. package/components/NavLink/tests/utils.d.ts +1 -1
  112. package/components/NavLink/types.d.ts +2 -2
  113. package/components/NoItemSelected/classes/types.d.ts +1 -1
  114. package/components/NoItemSelected/{index.3a479c64.js → index.418c8316.js} +22 -57
  115. package/components/NoItemSelected/styles.d.ts +5 -0
  116. package/components/ObjectLogs/index.bfa7dad3.js +236 -0
  117. package/components/ObjectLogs/styles.d.ts +4 -0
  118. package/components/PDFViewer/classes/types.d.ts +1 -1
  119. package/components/PDFViewer/{index.88c6ff6a.js → index.bb2eca5a.js} +8 -19
  120. package/components/PDFViewer/styles.d.ts +2 -0
  121. package/components/Page/index.fdf04592.js +364 -0
  122. package/components/PaperForm/classes/types.d.ts +1 -1
  123. package/components/PaperForm/index.8121e3da.js +96 -0
  124. package/components/PaperForm/styles.d.ts +7 -0
  125. package/components/PaperForm/types.d.ts +1 -2
  126. package/components/Period/classes/types.d.ts +1 -1
  127. package/components/Period/index.5233694b.js +424 -0
  128. package/components/Period/styles.d.ts +7 -0
  129. package/components/PrintingSystem/classes/types.d.ts +1 -1
  130. package/components/PrintingSystem/{index.27f1f209.js → index.fb176a93.js} +46 -58
  131. package/components/PrintingSystem/styles.d.ts +2 -0
  132. package/components/PrintingSystem/subcomponents/BodyNode/index.c1d61038.js +49 -0
  133. package/components/PrintingSystem/subcomponents/BodyNode/types.d.ts +1 -1
  134. package/components/PrintingSystem/subcomponents/ChartNode/{index.990e164c.js → index.18bd9bad.js} +28 -32
  135. package/components/PrintingSystem/subcomponents/ChartNode/types.d.ts +1 -2
  136. package/components/PrintingSystem/subcomponents/DividerNode/index.67d9f1b4.js +20 -0
  137. package/components/PrintingSystem/subcomponents/DividerNode/types.d.ts +2 -3
  138. package/components/PrintingSystem/subcomponents/FooterNode/index.eaee152a.js +49 -0
  139. package/components/PrintingSystem/subcomponents/FooterNode/types.d.ts +1 -1
  140. package/components/PrintingSystem/subcomponents/GridNode/index.f5f63a2a.js +70 -0
  141. package/components/PrintingSystem/subcomponents/GridNode/types.d.ts +2 -2
  142. package/components/PrintingSystem/subcomponents/HeaderNode/index.7de4e411.js +49 -0
  143. package/components/PrintingSystem/subcomponents/HeaderNode/types.d.ts +1 -1
  144. package/components/PrintingSystem/subcomponents/ImageNode/types.d.ts +2 -3
  145. package/components/PrintingSystem/subcomponents/Pager/types.d.ts +2 -2
  146. package/components/PrintingSystem/subcomponents/PaperNode/index.f9ccf22b.js +30 -0
  147. package/components/PrintingSystem/subcomponents/PaperNode/types.d.ts +2 -2
  148. package/components/PrintingSystem/subcomponents/PropertyValueNode/index.f2f2e903.js +47 -0
  149. package/components/PrintingSystem/subcomponents/PropertyValueNode/types.d.ts +2 -2
  150. package/components/PrintingSystem/subcomponents/QRImageNode/types.d.ts +2 -3
  151. package/components/PrintingSystem/subcomponents/SectionNode/index.540a4b19.js +49 -0
  152. package/components/PrintingSystem/subcomponents/SectionNode/types.d.ts +1 -1
  153. package/components/PrintingSystem/subcomponents/TextBoxNode/index.41e7fcb0.js +24 -0
  154. package/components/PrintingSystem/subcomponents/TextBoxNode/types.d.ts +2 -3
  155. package/components/PrintingSystem/utils/FactoryRender/types.d.ts +1 -1
  156. package/components/PrintingSystem/utils/PageRender/types.d.ts +1 -1
  157. package/components/PropertyValue/classes/types.d.ts +1 -1
  158. package/components/PropertyValue/index.9572c347.js +261 -0
  159. package/components/PropertyValue/styles.d.ts +2 -0
  160. package/components/Resizeable/{index.cb5aad75.js → index.1f0c1359.js} +21 -28
  161. package/components/ResizeableWindow/styles.d.ts +5 -0
  162. package/components/ScrollBar/classes/types.d.ts +1 -1
  163. package/components/ScrollBar/{index.7dfc2f29.js → index.adf0eade.js} +32 -54
  164. package/components/ScrollBar/styles.d.ts +9 -0
  165. package/components/SideBar/classes/index.d.ts +1 -1
  166. package/components/SideBar/context/sideBarContext/index.d.ts +4 -4
  167. package/components/SideBar/index.629ba840.js +849 -0
  168. package/components/SideBar/styles.d.ts +20 -0
  169. package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/styles.d.ts +3 -0
  170. package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +4 -0
  171. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +2 -0
  172. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/styles.d.ts +2 -0
  173. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/styles.d.ts +9 -0
  174. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/type.d.ts +2 -2
  175. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/styles.d.ts +2 -0
  176. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +6 -0
  177. package/components/SideBar/subcomponents/ContentMobile/styles.d.ts +3 -0
  178. package/components/SideBar/subcomponents/ContentMobile/subcomponents/types.d.ts +4 -4
  179. package/components/SideBar/tests/constants.d.ts +1 -1
  180. package/components/SideBar/tests/utils.d.ts +1 -1
  181. package/components/SideBar/types.d.ts +2 -2
  182. package/components/SplitLayout/SplitLayout.d.ts +1 -1
  183. package/components/SplitLayout/classes/types.d.ts +1 -1
  184. package/components/SplitLayout/{index.7302ceb3.js → index.74091a81.js} +41 -32
  185. package/components/SplitLayout/styles.d.ts +4 -0
  186. package/components/SplitLayout/tests/utils.d.ts +1 -1
  187. package/components/ToastContainer/ToastContainer.d.ts +1 -1
  188. package/components/ToastContainer/classes/types.d.ts +1 -1
  189. package/components/ToastContainer/{index.4d44ce53.js → index.f9b507b9.js} +15 -31
  190. package/components/ToastContainer/styles.d.ts +2 -0
  191. package/components/ToastContainer/subcomponents/ToastMessage/index.d.ts +1 -1
  192. package/components/ToastContainer/subcomponents/ToastMessage/types.d.ts +1 -1
  193. package/components/ToastContainer/types.d.ts +1 -1
  194. package/components/WrapperComponent/index.57964195.js +14 -0
  195. package/components/animate/AnimatedScroll/styles.d.ts +6 -0
  196. package/components/animate/AnimatedScroll/types.d.ts +3 -3
  197. package/components/animate/LoadingScreen/{index.1d0c4307.js → index.779690a7.js} +26 -42
  198. package/components/animate/LoadingScreen/styles.d.ts +7 -0
  199. package/components/animate/MotionContainer/index.3032bd8f.js +34 -0
  200. package/components/animate/MotionContainer/index.d.ts +9 -9
  201. package/components/animate/MotionLazyContainer/index.d.ts +2 -2
  202. package/components/animate/MotionLazyContainer/{index.572dd012.js → index.d2902a6c.js} +3 -9
  203. package/components/animate/PropagateLoader/index.a9da8d00.js +23 -0
  204. package/components/animate/PropagateLoader/syles.d.ts +2 -0
  205. package/components/animate/{index.5d4575bc.js → index.b8497385.js} +38 -58
  206. package/components/areas/components/AreasAdmin/styles.d.ts +5 -0
  207. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +4 -0
  208. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/types.d.ts +1 -1
  209. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/index.d.ts +1 -1
  210. package/components/areas/components/AreasViewer/styles.d.ts +2 -0
  211. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/subcomponents/ResizeHandle/index.d.ts +1 -1
  212. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +2 -0
  213. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.d.ts +3 -0
  214. package/components/areas/constants.5387d83e.js +412 -0
  215. package/components/areas/contexts/AreasContext/{index.c5a3b322.js → index.bb316000.js} +32 -78
  216. package/components/areas/contexts/DynamicMFParmsContext/{index.1607c78e.js → index.37d1d444.js} +5 -11
  217. package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +2 -2
  218. package/components/areas/contexts/WindowToolsMFContext/{index.8f3e2a04.js → index.69d95c15.js} +5 -13
  219. package/components/areas/contexts/WindowToolsMFContext/types.d.ts +29 -29
  220. package/components/areas/dictionary.7e74022a.js +286 -0
  221. package/components/areas/hooks/useAreas/{index.caa92660.js → index.e24bd74d.js} +1 -1
  222. package/components/areas/hooks/useDynamicMFParameters/{index.e52c5392.js → index.03ce6078.js} +2 -4
  223. package/components/areas/hooks/useWindowToolsMF/{index.b7afaf88.js → index.09801b66.js} +1 -1
  224. package/components/areas/icons.504ec098.js +83 -0
  225. package/components/areas/types.d.ts +17 -17
  226. package/components/commercial/AppBarCommercial/classes/types.d.ts +1 -1
  227. package/components/commercial/AppBarCommercial/styles.d.ts +2 -0
  228. package/components/commercial/AppBarCommercial/types.d.ts +1 -1
  229. package/components/commercial/HamburgerMenu/classes/type.d.ts +1 -1
  230. package/components/commercial/HamburgerMenu/styles.d.ts +13 -0
  231. package/components/commercial/HamburgerMenu/test/utils.d.ts +1 -1
  232. package/components/commercial/HamburgerMenu/types.d.ts +1 -1
  233. package/components/commercial/SectionCommercial/classes/types.d.ts +1 -1
  234. package/components/commercial/SectionCommercial/styles.d.ts +6 -0
  235. package/components/commercial/SectionCommercial/types.d.ts +3 -4
  236. package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/index.d.ts +1 -1
  237. package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/subcomponents/ArrowIcon/styles.d.ts +2 -0
  238. package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/types.d.ts +1 -1
  239. package/components/commercial/TopBar/context/index.d.ts +1 -1
  240. package/components/commercial/TopBar/context/type.d.ts +2 -2
  241. package/components/commercial/TopBar/style.d.ts +2 -0
  242. package/components/commercial/TopBar/type.d.ts +2 -2
  243. package/components/commercial/TopBar/utils/isActive/index.d.ts +1 -1
  244. package/components/formatters/FormatterRoot/styles.d.ts +2 -0
  245. package/components/formatters/FormatterRoot/types.d.ts +1 -1
  246. package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
  247. package/components/hook-form/RHFAutocomplete/styles.d.ts +2 -0
  248. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +2 -0
  249. package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +5 -0
  250. package/components/hook-form/RHFAutocompleteAsync/tests/utils.d.ts +1 -1
  251. package/components/hook-form/RHFCheckbox/styles.d.ts +7 -0
  252. package/components/hook-form/RHFCheckbox/test/utils.d.ts +1 -1
  253. package/components/hook-form/RHFColorPicker/classes/types.d.ts +1 -1
  254. package/components/hook-form/RHFColorPicker/styles.d.ts +2 -0
  255. package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/types.d.ts +2 -3
  256. package/components/hook-form/RHFColorPicker/types.d.ts +7 -7
  257. package/components/hook-form/RHFDateTime/classes/types.d.ts +1 -1
  258. package/components/hook-form/RHFDateTime/styles.d.ts +2 -0
  259. package/components/hook-form/RHFDateTime/types.d.ts +1 -1
  260. package/components/hook-form/RHFPeriod/classes/types.d.ts +1 -1
  261. package/components/hook-form/RHFPeriod/styles.d.ts +2 -0
  262. package/components/hook-form/RHFRadioGroup/types.d.ts +1 -1
  263. package/components/hook-form/RHFTextField/styles.d.ts +3 -0
  264. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +3 -0
  265. package/components/hook-form/RHFTextField/tests/utils.d.ts +1 -1
  266. package/components/hook-form/RHFTextFieldPassword/styles.d.ts +2 -0
  267. package/components/hook-form/RHFTextFieldPassword/tests/utils.d.ts +1 -1
  268. package/components/hook-form/RHFTextFieldPassword/types.d.ts +1 -2
  269. package/components/hook-form/RHFUpload/RHFUploadImage/classes/types.d.ts +1 -1
  270. package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +2 -0
  271. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +2 -0
  272. package/components/maps/components/GpsTools/constants.d.ts +1 -1
  273. package/components/maps/components/GpsTools/contexts/GpsToolsContext/types.d.ts +3 -3
  274. package/components/maps/components/GpsTools/{index.d93188ad.js → index.75880ce0.js} +740 -881
  275. package/components/maps/components/GpsTools/styles.d.ts +2 -0
  276. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/styles.d.ts +1 -0
  277. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/GeneralData/types.d.ts +2 -2
  278. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/types.d.ts +1 -1
  279. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/StyleData/types.d.ts +2 -2
  280. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useColumns.d.ts +1 -1
  281. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +6 -0
  282. package/components/maps/components/GpsTools/types.d.ts +1 -1
  283. package/components/maps/components/Map/contexts/MapContext/helper.d.ts +1 -1
  284. package/components/maps/components/Map/contexts/MapContext/index.d.ts +1 -1
  285. package/components/maps/components/Map/contexts/MapContext/types.d.ts +6 -6
  286. package/components/maps/components/Map/external/googleMutant/index.d.ts +94 -94
  287. package/components/maps/components/Map/featureRenders/CommonFeatureRender/index.d.ts +1 -1
  288. package/components/maps/components/Map/featureRenders/CommonFeatureRender/subcomponents/FeatureDivIconLabel/types.d.ts +1 -1
  289. package/components/maps/components/Map/featureRenders/CommonFeatureRender/subcomponents/MarkerIconLabel/types.d.ts +2 -2
  290. package/components/maps/components/Map/featureRenders/MarkerFeatureRender/index.d.ts +1 -1
  291. package/components/maps/components/Map/hooks/useAutoFocus/types.d.ts +2 -2
  292. package/components/maps/components/Map/index.d.ts +1 -1
  293. package/components/maps/components/Map/styled.d.ts +2 -0
  294. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/bing.d.ts +1 -1
  295. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/google.d.ts +1 -1
  296. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/sourceTypes/osm.d.ts +1 -1
  297. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/hooks/useMeasure/helpers.d.ts +1 -1
  298. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/subcomponents/MeasureData/types.d.ts +1 -1
  299. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/types.d.ts +1 -1
  300. package/components/maps/components/Map/subcomponents/Controls/types.d.ts +1 -1
  301. package/components/maps/components/Map/subcomponents/LayersContainer/subcomponents/MyLayer/subcomponents/MarkerClusterGroup/types.d.ts +2 -2
  302. package/components/maps/components/Map/types.d.ts +2 -2
  303. package/components/maps/{components/Map/index.accb1f77.js → index.8ec46ce4.js} +726 -940
  304. package/components/maps/index.d.ts +2 -2
  305. package/components/maps/leaflet-geoman.d.ts +1476 -1633
  306. package/components/modal/WindowBase.a3ac7adc.js +43 -0
  307. package/components/modal/WindowConfirm/types.d.ts +4 -4
  308. package/components/modal/WindowConfirm.e35da619.js +62 -0
  309. package/components/modal/classes/types.d.ts +1 -1
  310. package/components/modal/{index.61389369.js → index.a0e30c8b.js} +8 -6
  311. package/components/mui_extended/Accordion/classes/types.d.ts +1 -1
  312. package/components/mui_extended/Accordion/styles.d.ts +4 -0
  313. package/components/mui_extended/Avatar/classes/types.d.ts +1 -1
  314. package/components/mui_extended/Avatar/styles.d.ts +2 -0
  315. package/components/mui_extended/Avatar/tests/utils.d.ts +1 -1
  316. package/components/mui_extended/Badge/Badge.d.ts +1 -1
  317. package/components/mui_extended/Badge/classes/types.d.ts +1 -1
  318. package/components/mui_extended/Badge/styles.d.ts +2 -0
  319. package/components/mui_extended/Badge/types.d.ts +1 -1
  320. package/components/mui_extended/Button/classes/types.d.ts +2 -2
  321. package/components/mui_extended/Button/styles.d.ts +5 -0
  322. package/components/mui_extended/CheckBox/classes/types.d.ts +1 -1
  323. package/components/mui_extended/CheckBox/styles.d.ts +2 -0
  324. package/components/mui_extended/CheckBox/subcomponents/Skeleton/types.d.ts +1 -1
  325. package/components/mui_extended/CheckBox/types.d.ts +2 -2
  326. package/components/mui_extended/IconButton/styles.d.ts +2 -0
  327. package/components/mui_extended/ImageButton/styles.d.ts +2 -0
  328. package/components/mui_extended/ImageButton/tests/utils.d.ts +1 -1
  329. package/components/mui_extended/LoadingButton/styles.d.ts +2 -0
  330. package/components/mui_extended/LoadingButton/tests/utils.d.ts +1 -1
  331. package/components/mui_extended/MenuActions/classes/types.d.ts +1 -1
  332. package/components/mui_extended/MenuActions/styles.d.ts +5 -0
  333. package/components/mui_extended/Pager/classes/types.d.ts +1 -1
  334. package/components/mui_extended/Pager/styles.d.ts +2 -0
  335. package/components/mui_extended/Pager/subcomponents/CustomTablePagination/types.d.ts +2 -2
  336. package/components/mui_extended/Pager/subcomponents/PagerActions/types.d.ts +1 -1
  337. package/components/mui_extended/Popover/styles.d.ts +1 -0
  338. package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +3 -0
  339. package/components/mui_extended/Stack/Stack.d.ts +1 -1
  340. package/components/mui_extended/Stack/classes/types.d.ts +1 -1
  341. package/components/mui_extended/Stack/styles.d.ts +4 -0
  342. package/components/mui_extended/Stack/types.d.ts +1 -1
  343. package/components/mui_extended/Tab/classes/types.d.ts +1 -1
  344. package/components/mui_extended/Tab/styles.d.ts +3 -0
  345. package/components/mui_extended/TabContent/TabContent.d.ts +1 -1
  346. package/components/mui_extended/TabContent/classes/types.d.ts +1 -1
  347. package/components/mui_extended/TabContent/styles.d.ts +2 -0
  348. package/components/mui_extended/TabContent/types.d.ts +1 -1
  349. package/components/mui_extended/Tabs/classes/types.d.ts +1 -1
  350. package/components/mui_extended/Tabs/styles.d.ts +4 -0
  351. package/components/mui_extended/ToggleButton/ToggleButton.d.ts +1 -1
  352. package/components/mui_extended/ToggleIconButton/ToggleIconButton.d.ts +1 -1
  353. package/components/mui_extended/ToggleIconButton/types.d.ts +2 -2
  354. package/components/mui_extended/Tooltip/classes/types.d.ts +1 -1
  355. package/components/mui_extended/Tooltip/types.d.ts +3 -3
  356. package/components/mui_extended/Typography/styles.d.ts +2 -0
  357. package/components/mui_extended/Typography/tests/utils.d.ts +1 -1
  358. package/components/popups/PopupsProvider/{index.d7409f48.js → index.18669fb4.js} +12 -26
  359. package/components/popups/PopupsViewer/index.ba354267.js +166 -0
  360. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +4 -4
  361. package/components/popups/components/PopupsViewer/classes/types.d.ts +1 -1
  362. package/components/popups/components/PopupsViewer/styled.d.ts +2 -0
  363. package/components/popups/components/PopupsViewer/subcomponents/Popup/types.d.ts +1 -1
  364. package/contexts/ModalContext/{index.2368bb19.js → index.cf02e6bd.js} +18 -19
  365. package/contexts/RHFormContext/classes/types.d.ts +1 -1
  366. package/contexts/RHFormContext/{index.7b2a8723.js → index.dc955a09.js} +16 -26
  367. package/contexts/RHFormContext/styles.d.ts +2 -0
  368. package/hocs/index.d.ts +1 -0
  369. package/hocs/withToggle/{index.50aec5e4.js → index.548aeace.js} +3 -11
  370. package/hooks/useFormAddEdit/index.f156a2cd.js +86 -0
  371. package/hooks/useFormFocus/index.d.ts +2 -2
  372. package/hooks/useFormFocus/types.d.ts +1 -1
  373. package/hooks/useModal/index.ef54bcf2.js +66 -0
  374. package/hooks/useSizeContainer/{index.62b4e0c4.js → index.3c48670c.js} +1 -1
  375. package/hooks/useTab/{index.976d5e1e.js → index.bce8b99e.js} +1 -1
  376. package/index.d.ts +1 -1
  377. package/index.js +278 -362
  378. package/package.json +13 -2
  379. package/{react-draggable.e4725f3a.js → react-draggable.5331add7.js} +1 -1
  380. package/{react-resizable.c07d63fb.js → react-resizable.37bfb965.js} +3 -5
  381. package/styles/DynamicFilter.styles.d.ts +2 -0
  382. package/test/getNameDataTestId.aee44365.js +10 -0
  383. package/test/getNameDataTestId.d.ts +10 -0
  384. package/test/index.6d4b98b9.js +4 -0
  385. package/utils/containerQuery.d.ts +2 -0
  386. package/utils/{index.6469f148.js → index.9ee4c99a.js} +117 -3
  387. package/utils/index.d.ts +1 -1
  388. package/vendor.a1ce6777.js +6352 -0
  389. package/vite-env.d.ts +4 -4
  390. package/assets/Logo/index.228dcb5a.js +0 -93
  391. package/assets/Logo.d.ts +0 -6
  392. package/components/AccountPopover/index.39efc8f0.js +0 -302
  393. package/components/AppBar/index.c8850b99.js +0 -109
  394. package/components/CommonActions/components/ActionCancel/index.416cbf9b.js +0 -20
  395. package/components/CommonActions/components/ActionFormCancel/index.78267f7c.js +0 -61
  396. package/components/CommonActions/components/ActionFormIntro/index.dcb4d280.js +0 -40
  397. package/components/CommonActions/components/ActionIntro/index.094290fd.js +0 -26
  398. package/components/CommonActions/components/Actions/index.fa7ab18c.js +0 -66
  399. package/components/DataGrid/constants.e334cd50.js +0 -10
  400. package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cd6e553a.js +0 -27
  401. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.0c439ac3.js +0 -30
  402. package/components/DataGrid/formatters/ColumnDateFormatter/index.704db1ca.js +0 -27
  403. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.867b8745.js +0 -26
  404. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.925387d2.js +0 -19
  405. package/components/DataGrid/formatters/ColumnPointsFormatter/index.4335c26b.js +0 -13
  406. package/components/DataGrid/formatters/ColumnPriceFormatter/index.d717405e.js +0 -13
  407. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.0b23ba88.js +0 -40
  408. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.aeea65aa.js +0 -13
  409. package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
  410. package/components/DataGrid/index.abe0f9b9.js +0 -979
  411. package/components/DataGrid/subcomponents/Actions/index.4f2071ee.js +0 -663
  412. package/components/DataGrid/subcomponents/editors/TextEditor/index.eac1749c.js +0 -75
  413. package/components/DragResizeWindow/index.13ef022e.js +0 -489
  414. package/components/DynamicFilter/classes/index.d.ts +0 -5
  415. package/components/DynamicFilter/classes/types.d.ts +0 -35
  416. package/components/DynamicFilter/contexts/DynamicFilterContext/helpers.d.ts +0 -23
  417. package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +0 -18
  418. package/components/DynamicFilter/contexts/DynamicFilterContext/types.d.ts +0 -5
  419. package/components/DynamicFilter/hooks/useDynamicFilter.d.ts +0 -2
  420. package/components/DynamicFilter/index.c52a8e96.js +0 -1954
  421. package/components/DynamicFilter/subcomponents/ApplyedFilters/index.d.ts +0 -6
  422. package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/index.d.ts +0 -2
  423. package/components/DynamicFilter/subcomponents/ClearFilters/index.d.ts +0 -1
  424. package/components/DynamicFilter/subcomponents/FilterButton/index.d.ts +0 -11
  425. package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +0 -5
  426. package/components/DynamicFilter/subcomponents/PopoverMenuFields/types.d.ts +0 -6
  427. package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/helpers.d.ts +0 -39
  428. package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/index.d.ts +0 -5
  429. package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/helpers.d.ts +0 -42
  430. package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/helpers.d.ts +0 -36
  431. package/components/DynamicFilter/subcomponents/fieldstypes/SelectFilter/helpers.d.ts +0 -51
  432. package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/helpers.d.ts +0 -39
  433. package/components/DynamicFilter/subcomponents/fieldstypes/factory.d.ts +0 -82
  434. package/components/DynamicFilter/subcomponents/fieldstypes/validations.d.ts +0 -32
  435. package/components/DynamicFilter/tests/contants.d.ts +0 -5
  436. package/components/FieldLabel/index.0412576c.js +0 -82
  437. package/components/GridLayout/subcomponents/Griditem/index.30016fc1.js +0 -366
  438. package/components/GridLayout/subcomponents/SizeProvider/index.0328ad0a.js +0 -62
  439. package/components/Icon/index.ad330e78.js +0 -184
  440. package/components/Image/index.b799c514.js +0 -203
  441. package/components/LanguagePopover/index.93c48ec5.js +0 -196
  442. package/components/LinearProgressIndeterminate/index.c46da124.js +0 -43
  443. package/components/ModalDialog/index.78c9650a.js +0 -92
  444. package/components/NavLink/index.b75c91e1.js +0 -59
  445. package/components/ObjectLogs/index.1d85a021.js +0 -293
  446. package/components/Page/index.5d34dc4d.js +0 -127
  447. package/components/PaperForm/index.d08b43f6.js +0 -138
  448. package/components/Period/index.3f89d8a4.js +0 -306
  449. package/components/PrintingSystem/subcomponents/BodyNode/index.319a3bb9.js +0 -48
  450. package/components/PrintingSystem/subcomponents/DividerNode/index.e504dbd2.js +0 -19
  451. package/components/PrintingSystem/subcomponents/FooterNode/index.9a19a7cb.js +0 -48
  452. package/components/PrintingSystem/subcomponents/GridNode/index.8d14e1b6.js +0 -71
  453. package/components/PrintingSystem/subcomponents/HeaderNode/index.89e4eaab.js +0 -48
  454. package/components/PrintingSystem/subcomponents/PaperNode/index.dd4ca449.js +0 -46
  455. package/components/PrintingSystem/subcomponents/PropertyValueNode/index.048d7ebf.js +0 -41
  456. package/components/PrintingSystem/subcomponents/SectionNode/index.83f1efea.js +0 -48
  457. package/components/PrintingSystem/subcomponents/TextBoxNode/index.5427cb75.js +0 -28
  458. package/components/PropertyValue/index.15c61a4b.js +0 -209
  459. package/components/SideBar/index.b0359a2b.js +0 -916
  460. package/components/SplitLayout/index.d.ts +0 -2
  461. package/components/WrapperComponent/index.5e872594.js +0 -18
  462. package/components/animate/MotionContainer/index.8d9f9d80.js +0 -33
  463. package/components/animate/PropagateLoader/index.7fab43c8.js +0 -30
  464. package/components/animate/variants/index.7a912140.js +0 -1
  465. package/components/areas/components/AreasAdmin/index.820a00ab.js +0 -737
  466. package/components/areas/components/AreasViewer/index.6d7194e2.js +0 -1086
  467. package/components/areas/components/index.558684b3.js +0 -1
  468. package/components/areas/constants.66529246.js +0 -6
  469. package/components/areas/contexts/index.24025b97.js +0 -1
  470. package/components/areas/dictionary.08cfc4c9.js +0 -36
  471. package/components/areas/hooks/index.d9dc1e21.js +0 -1
  472. package/components/areas/icons.8266ccc8.js +0 -26
  473. package/components/areas/index.4cc6a221.js +0 -22
  474. package/components/commercial/AppBarCommercial/index.9cf586a2.js +0 -30
  475. package/components/commercial/SectionCommercial/index.4dbfc0a7.js +0 -48
  476. package/components/commercial/TopBar/index.93a7d26a.js +0 -275
  477. package/components/commercial/index.89ad149c.js +0 -82
  478. package/components/formatters/BooleanFormatter/index.9ccf9298.js +0 -54
  479. package/components/formatters/DateFormatter/index.578a9f53.js +0 -52
  480. package/components/formatters/PointsFormatter/index.8a4fa393.js +0 -32
  481. package/components/formatters/PriceFormatter/index.83cbe7be.js +0 -43
  482. package/components/formatters/UncertaintyFormatter/index.08e1b79f.js +0 -34
  483. package/components/formatters/index.03471e3f.js +0 -140
  484. package/components/hook-form/HelperError/index.66bbcac3.js +0 -30
  485. package/components/hook-form/RHFAutocomplete/index.1f2afb6b.js +0 -429
  486. package/components/hook-form/RHFAutocompleteAsync/index.bc278965.js +0 -156
  487. package/components/hook-form/RHFCheckbox/index.eca64469.js +0 -143
  488. package/components/hook-form/RHFColorPicker/index.dc13d5a3.js +0 -204
  489. package/components/hook-form/RHFDateTime/index.e554b068.js +0 -203
  490. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
  491. package/components/hook-form/RHFPeriod/index.e4e4530f.js +0 -112
  492. package/components/hook-form/RHFRadioGroup/index.1ddb3d93.js +0 -45
  493. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
  494. package/components/hook-form/RHFTextField/index.1bfa601f.js +0 -358
  495. package/components/hook-form/RHFUpload/index.6e98b291.js +0 -242
  496. package/components/maps/index.34ab6a68.js +0 -7
  497. package/components/modal/WindowBase.fd86f575.js +0 -74
  498. package/components/modal/WindowConfirm.ee6de236.js +0 -105
  499. package/components/mui_extended/Accordion/index.7dcdfd3a.js +0 -126
  500. package/components/mui_extended/Avatar/index.75e6ed57.js +0 -71
  501. package/components/mui_extended/Badge/index.09f5aee5.js +0 -36
  502. package/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
  503. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -94
  504. package/components/mui_extended/Button/index.c3084916.js +0 -221
  505. package/components/mui_extended/CheckBox.2a3b86c5.js +0 -86
  506. package/components/mui_extended/CircularProgress/index.ad569afd.js +0 -10
  507. package/components/mui_extended/IconButton/index.f8a3021b.js +0 -125
  508. package/components/mui_extended/LinearProgress/index.c92b9ba9.js +0 -13
  509. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +0 -30
  510. package/components/mui_extended/MenuActions/index.90f53670.js +0 -175
  511. package/components/mui_extended/Pager/index.ea2a4f3e.js +0 -254
  512. package/components/mui_extended/Popover/index.d85de73b.js +0 -179
  513. package/components/mui_extended/Stack/index.0e53197c.js +0 -39
  514. package/components/mui_extended/Tab/index.9214d9cc.js +0 -156
  515. package/components/mui_extended/ToggleButton/index.191711f3.js +0 -19
  516. package/components/mui_extended/ToggleIconButton/index.d9dbf650.js +0 -19
  517. package/components/mui_extended/Tooltip/index.24a2bc3f.js +0 -43
  518. package/components/mui_extended/Typography/index.379dd374.js +0 -68
  519. package/components/mui_extended/index.b606cd9d.js +0 -1
  520. package/components/popups/PopupsViewer/index.1500ce72.js +0 -186
  521. package/hooks/useFormAddEdit/index.000ce60b.js +0 -94
  522. package/hooks/useModal/index.f73d7e42.js +0 -11
  523. package/style.css +0 -65
  524. package/test/constants_no_mock.86c553a9.js +0 -4
  525. package/test/getNameDataTestId.14875ec7.js +0 -6
  526. /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/DateTimeFilter/index.d.ts +0 -0
  527. /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/NumberFilter/index.d.ts +0 -0
  528. /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/SelectFilter/index.d.ts +0 -0
  529. /package/components/DynamicFilter/subcomponents/{fieldstypes → FieldTypes}/StringFilter/index.d.ts +0 -0
@@ -0,0 +1,2012 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useModuleDictionary, useEnvironment, useModuleSkeleton, useFlagsPresent, CommonFlags } from "@m4l/core";
3
+ import { useMemo, useContext, createContext, useRef, useEffect, useState, useCallback } from "react";
4
+ import { useStore, createStore } from "zustand";
5
+ import { shallow } from "zustand/shallow";
6
+ import { useResponsiveDesktop, useFirstRender, useFormatter } from "@m4l/graphics";
7
+ import { devtools } from "zustand/middleware";
8
+ import { immer } from "zustand/middleware/immer";
9
+ import * as Yup from "yup";
10
+ import { g as getDynamicFilterDictionary, D as DICCTIONARY } from "../areas/dictionary.7e74022a.js";
11
+ import { B as BOOLEAN_OPERATORS, S as STRING_OPERATORS, b as DATE_TIME_OPERATORS, N as NUMBER_OPERATORS, c as SELECT_OPERATORS, A as ALL_FIELD, d as DYNAMIC_FILTER_KEY_COMPONENT } from "../areas/constants.5387d83e.js";
12
+ import { R as RHFAutocomplete, a as RHFTextField, b as RHFDateTime, c as RHFAutocompleteAsync, P as Popover, T as Typography, d as Actions, e as ActionCancel, f as ActionIntro } from "../../vendor.a1ce6777.js";
13
+ import { useFormContext, useWatch } from "react-hook-form";
14
+ import { i as isValidDate, c as containerQuery } from "../../utils/index.9ee4c99a.js";
15
+ import { styled } from "@mui/material/styles";
16
+ import { Skeleton, alpha, MenuItem } from "@mui/material";
17
+ import { I as Icon, a as IconButton } from "../Icon/index.d5fed418.js";
18
+ import { g as getPropDataTestId } from "../../test/getNameDataTestId.aee44365.js";
19
+ import { S as ScrollBar } from "../ScrollBar/index.adf0eade.js";
20
+ import { R as RHFormProvider } from "../../contexts/RHFormContext/index.dc955a09.js";
21
+ function BooleanFilter() {
22
+ const { getLabel } = useModuleDictionary();
23
+ const operators = useMemo(
24
+ () => BOOLEAN_OPERATORS.map((o) => ({
25
+ id: o,
26
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
27
+ })),
28
+ [getLabel]
29
+ );
30
+ const optionsYesNo = useMemo(
31
+ () => [
32
+ {
33
+ value: true,
34
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.operand_true))
35
+ },
36
+ {
37
+ value: false,
38
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.operand_false))
39
+ }
40
+ ],
41
+ [getLabel]
42
+ );
43
+ return /* @__PURE__ */ jsxs("div", { children: [
44
+ /* @__PURE__ */ jsx(
45
+ RHFAutocomplete,
46
+ {
47
+ name: "formValueOperator",
48
+ autoComplete: "off",
49
+ options: operators,
50
+ getOptionLabel: (option) => option.label,
51
+ isOptionEqualToValue: (option, value) => option.id === value.id,
52
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operator))
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsx(
56
+ RHFAutocomplete,
57
+ {
58
+ name: "formValueOperand1",
59
+ autoComplete: "off",
60
+ options: optionsYesNo,
61
+ getOptionLabel: (option) => option.label,
62
+ isOptionEqualToValue: (option, value) => option.value === value.value,
63
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_boolean_operand1))
64
+ }
65
+ )
66
+ ] });
67
+ }
68
+ class BooleanFilterHelpers {
69
+ getComponent() {
70
+ return BooleanFilter;
71
+ }
72
+ getDefaultFilter(field, fixed) {
73
+ const defaultOperand1 = field.defaultOperand1;
74
+ const defaultFilter = {
75
+ id: 0,
76
+ fieldType: "boolean",
77
+ field,
78
+ fixed,
79
+ isSet: true,
80
+ operator: "e",
81
+ operand1: true
82
+ };
83
+ if (defaultOperand1 !== void 0 && typeof defaultOperand1 === "boolean") {
84
+ defaultFilter.operand1 = defaultOperand1;
85
+ }
86
+ return defaultFilter;
87
+ }
88
+ getFilterFromFormValue(formFilterValue) {
89
+ const operator = formFilterValue.formValueOperator.id;
90
+ const operand1 = formFilterValue.formValueOperand1?.value || false;
91
+ return {
92
+ fieldType: "boolean",
93
+ operator,
94
+ operand1
95
+ };
96
+ }
97
+ getFormValue(field, getLabel, filterValue) {
98
+ const filterValueBoolean = filterValue ? filterValue : void 0;
99
+ const operator = filterValueBoolean ? filterValueBoolean.operator : field.defaultOperator ?? "e";
100
+ const formValueOperand1 = filterValueBoolean ? {
101
+ value: filterValueBoolean.operand1,
102
+ label: getLabel(getDynamicFilterDictionary(`operand_${filterValueBoolean.operand1}`))
103
+ } : null;
104
+ return {
105
+ fieldType: "boolean",
106
+ formValueOperator: {
107
+ id: operator,
108
+ label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
109
+ },
110
+ formValueOperand1
111
+ };
112
+ }
113
+ getLabels(filter, getLabel, _formatters, _field) {
114
+ const labelOperands = filter.operand1 ? getLabel(getDynamicFilterDictionary("operand_true")) : getLabel(getDynamicFilterDictionary("operand_false"));
115
+ return {
116
+ labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
117
+ labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
118
+ labelOperands
119
+ };
120
+ }
121
+ getSchema(getLabel) {
122
+ return Yup.object({
123
+ formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
124
+ formValueOperand1: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operand_required`))
125
+ });
126
+ }
127
+ verifyFilter(filter, _field) {
128
+ if (typeof filter.operator !== "string") {
129
+ return false;
130
+ }
131
+ if (BOOLEAN_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
132
+ return false;
133
+ }
134
+ return typeof filter.operand1 === "boolean";
135
+ }
136
+ }
137
+ function StringFilter() {
138
+ const { getLabel } = useModuleDictionary();
139
+ const operators = useMemo(
140
+ () => STRING_OPERATORS.map((o) => ({
141
+ id: o,
142
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
143
+ })),
144
+ [getLabel]
145
+ );
146
+ return /* @__PURE__ */ jsxs("div", { children: [
147
+ /* @__PURE__ */ jsx(
148
+ RHFAutocomplete,
149
+ {
150
+ name: "formValueOperator",
151
+ autoComplete: "off",
152
+ options: operators,
153
+ getOptionLabel: (option) => option.label,
154
+ isOptionEqualToValue: (option, value) => option.id === value.id,
155
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_string))
156
+ }
157
+ ),
158
+ /* @__PURE__ */ jsx(
159
+ RHFTextField,
160
+ {
161
+ name: "formValueOperand1",
162
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_string))
163
+ }
164
+ )
165
+ ] });
166
+ }
167
+ class StringFilterHelpers {
168
+ getComponent() {
169
+ return StringFilter;
170
+ }
171
+ getDefaultFilter(field, fixed) {
172
+ const defaultOperand1 = field.defaultOperand1;
173
+ const defaultFilter = {
174
+ id: 0,
175
+ fieldType: "string",
176
+ field,
177
+ fixed,
178
+ isSet: false,
179
+ operator: "c",
180
+ operand1: ""
181
+ };
182
+ if (defaultOperand1 !== void 0 && typeof defaultOperand1 === "string") {
183
+ defaultFilter.operand1 = defaultOperand1;
184
+ }
185
+ return defaultFilter;
186
+ }
187
+ getFilterFromFormValue(formFilterValue) {
188
+ const operator = formFilterValue.formValueOperator.id;
189
+ const operand1 = formFilterValue.formValueOperand1;
190
+ return {
191
+ fieldType: "string",
192
+ operator,
193
+ operand1
194
+ };
195
+ }
196
+ getFormValue(field, getLabel, filterValue) {
197
+ const filterValueString = filterValue;
198
+ const operator = filterValueString ? filterValueString.operator : field.defaultOperator ?? "c";
199
+ const formValueOperand1 = filterValueString ? filterValueString.operand1 : "";
200
+ return {
201
+ fieldType: "string",
202
+ formValueOperator: {
203
+ id: operator,
204
+ label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
205
+ },
206
+ formValueOperand1
207
+ };
208
+ }
209
+ getLabels(filter, getLabel, _formatters, _field) {
210
+ const labelOperands = filter.operand1 !== void 0 ? filter.operand1 + "" : "";
211
+ return {
212
+ labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
213
+ labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
214
+ labelOperands
215
+ };
216
+ }
217
+ getSchema(getLabel) {
218
+ return Yup.object({
219
+ formValueOperator: Yup.object().nullable().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.operator_required))),
220
+ formValueOperand1: Yup.string().required(
221
+ getLabel(getDynamicFilterDictionary(DICCTIONARY.error_operand_required))
222
+ )
223
+ });
224
+ }
225
+ verifyFilter(filter, _field) {
226
+ if (typeof filter.operator !== "string") {
227
+ return false;
228
+ }
229
+ if (STRING_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
230
+ return false;
231
+ }
232
+ if (typeof filter.operand1 !== "string") {
233
+ return false;
234
+ }
235
+ return true;
236
+ }
237
+ }
238
+ function DateTimeFilter() {
239
+ const { getLabel } = useModuleDictionary();
240
+ const { control } = useFormContext();
241
+ const operator = useWatch({
242
+ control,
243
+ name: "formValueOperator"
244
+ });
245
+ const operators = useMemo(
246
+ () => DATE_TIME_OPERATORS.map((o) => ({
247
+ id: o,
248
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
249
+ })),
250
+ [getLabel]
251
+ );
252
+ return /* @__PURE__ */ jsxs("div", { children: [
253
+ /* @__PURE__ */ jsx(
254
+ RHFAutocomplete,
255
+ {
256
+ name: "formValueOperator",
257
+ autoComplete: "off",
258
+ options: operators,
259
+ getOptionLabel: (option) => option.label,
260
+ isOptionEqualToValue: (option, value) => option.id === value.id,
261
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_date_time))
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsx(
265
+ RHFDateTime,
266
+ {
267
+ name: "formValueOperand1",
268
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_date_time))
269
+ }
270
+ ),
271
+ operator && operator.id === "b" && /* @__PURE__ */ jsx(
272
+ RHFDateTime,
273
+ {
274
+ name: "formValueOperand2",
275
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand2_date_time))
276
+ }
277
+ )
278
+ ] });
279
+ }
280
+ class DateTimeFilterHelpers {
281
+ getComponent() {
282
+ return DateTimeFilter;
283
+ }
284
+ getDefaultFilter(field, fixed) {
285
+ const defaultStartDate = new Date();
286
+ const defaultEndDate = new Date();
287
+ defaultStartDate.setHours(0, 0, 0, 0);
288
+ defaultEndDate.setHours(23, 59, 59, 999);
289
+ const defaultOperand1 = field.defaultOperand1 && field.defaultOperand1 instanceof Date ? field.defaultOperand1 : defaultStartDate;
290
+ const defaultOperand2 = field.defaultOperand2 && field.defaultOperand2 instanceof Date ? field.defaultOperand2 : defaultEndDate;
291
+ return {
292
+ id: 0,
293
+ fieldType: "datetime",
294
+ field,
295
+ fixed,
296
+ isSet: true,
297
+ operator: "b",
298
+ operand1: defaultOperand1,
299
+ operand2: defaultOperand2
300
+ };
301
+ }
302
+ getFormValue(field, getLabel, filterValueDateTime) {
303
+ const filterValue = filterValueDateTime;
304
+ const operator = filterValue ? filterValue.operator : field.defaultOperator ?? "b";
305
+ const defaultStartDate = new Date();
306
+ const defaultEndDate = new Date();
307
+ const defaultOperand1 = field.defaultOperand1 && field.defaultOperand1 instanceof Date ? field.defaultOperand1 : defaultStartDate;
308
+ const defaultOperand2 = field.defaultOperand2 && field.defaultOperand2 instanceof Date ? field.defaultOperand2 : defaultEndDate;
309
+ const formValueOperand1 = filterValue ? filterValue.operand1 : defaultOperand1;
310
+ const formValueOperand2 = filterValue && filterValue.operator === "b" ? filterValue.operand2 : defaultOperand2;
311
+ return {
312
+ fieldType: "datetime",
313
+ formValueOperator: {
314
+ id: operator,
315
+ label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
316
+ },
317
+ formValueOperand1,
318
+ formValueOperand2
319
+ };
320
+ }
321
+ getFilterFromFormValue(formFilterValue) {
322
+ const operator = formFilterValue.formValueOperator.id;
323
+ const operand1 = formFilterValue.formValueOperand1;
324
+ if (operator === "b") {
325
+ const operand2 = formFilterValue.formValueOperand2;
326
+ return {
327
+ fieldType: "datetime",
328
+ operator,
329
+ operand1,
330
+ operand2
331
+ };
332
+ } else {
333
+ return {
334
+ fieldType: "datetime",
335
+ operator,
336
+ operand1
337
+ };
338
+ }
339
+ }
340
+ getLabels(filter, getLabel, formatters, _field) {
341
+ const { dateFormatter } = formatters;
342
+ let labelOperands;
343
+ if (filter.operator === "b") {
344
+ labelOperands = filter.operand1 && filter.operand2 ? `${dateFormatter.formatDate(
345
+ filter.operand1,
346
+ dateFormatter.datetimeFormat
347
+ )} - ${dateFormatter.formatDate(filter.operand2, dateFormatter.datetimeFormat)}` : "";
348
+ } else {
349
+ labelOperands = filter.operand1 ? dateFormatter.formatDate(filter.operand1, dateFormatter.datetimeFormat) : "";
350
+ }
351
+ return {
352
+ labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
353
+ labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
354
+ labelOperands
355
+ };
356
+ }
357
+ getSchema(getLabel) {
358
+ return Yup.object({
359
+ formValueOperator: Yup.object().nullable().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.operator_required))),
360
+ formValueOperand1: Yup.date().required(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))).typeError(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))),
361
+ formValueOperand2: Yup.mixed().when(["formValueOperator.id"], {
362
+ is: "b",
363
+ then: Yup.date().typeError(getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))).min(
364
+ Yup.ref("formValueOperand1"),
365
+ getLabel(getDynamicFilterDictionary(DICCTIONARY.error_invalid_date))
366
+ )
367
+ })
368
+ });
369
+ }
370
+ verifyFilter(filter, _field) {
371
+ if (typeof filter.operator !== "string") {
372
+ return false;
373
+ }
374
+ if (DATE_TIME_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
375
+ return false;
376
+ }
377
+ if (typeof filter.operand1 !== "string") {
378
+ return false;
379
+ }
380
+ if (!isValidDate(new Date(filter.operand1))) {
381
+ return false;
382
+ }
383
+ if (filter.operator === "b") {
384
+ if (typeof filter.operand2 !== "string") {
385
+ return false;
386
+ }
387
+ if (!isValidDate(new Date(filter.operand1))) {
388
+ return false;
389
+ }
390
+ }
391
+ return true;
392
+ }
393
+ }
394
+ function NumberFilter() {
395
+ const { getLabel } = useModuleDictionary();
396
+ const { control } = useFormContext();
397
+ const operator = useWatch({
398
+ control,
399
+ name: "formValueOperator"
400
+ });
401
+ const operators = useMemo(
402
+ () => NUMBER_OPERATORS.map((o) => ({
403
+ id: o,
404
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
405
+ })),
406
+ [getLabel]
407
+ );
408
+ return /* @__PURE__ */ jsxs("div", { children: [
409
+ /* @__PURE__ */ jsx(
410
+ RHFAutocomplete,
411
+ {
412
+ name: "formValueOperator",
413
+ autoComplete: "off",
414
+ options: operators,
415
+ getOptionLabel: (option) => option.label,
416
+ isOptionEqualToValue: (option, value) => option.id === value.id,
417
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operator_number))
418
+ }
419
+ ),
420
+ /* @__PURE__ */ jsx(
421
+ RHFTextField,
422
+ {
423
+ name: "formValueOperand1",
424
+ type: "number",
425
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand1_number))
426
+ }
427
+ ),
428
+ operator && operator.id === "b" && /* @__PURE__ */ jsx(
429
+ RHFTextField,
430
+ {
431
+ name: "formValueOperand2",
432
+ type: "number",
433
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_operand2_number))
434
+ }
435
+ )
436
+ ] });
437
+ }
438
+ class NumberFilterHelpers {
439
+ getComponent() {
440
+ return NumberFilter;
441
+ }
442
+ getDefaultFilter(fieldNumber, fixed) {
443
+ const field = fieldNumber;
444
+ const dOperator = field.defaultOperator ?? "e";
445
+ const defaultOperand1 = field.defaultOperand1 ?? null;
446
+ const defaultOperand2 = field.defaultOperand2 ?? null;
447
+ return {
448
+ id: 0,
449
+ fieldType: "number",
450
+ field,
451
+ fixed,
452
+ isSet: false,
453
+ operator: dOperator,
454
+ operand1: defaultOperand1,
455
+ operand2: defaultOperand2
456
+ };
457
+ }
458
+ getFormValue(field, getLabel, filterValue) {
459
+ const filterValueNumber = filterValue;
460
+ const operator = filterValueNumber ? filterValueNumber.operator : field.defaultOperator ?? "e";
461
+ const formValueOperand1 = filterValueNumber ? filterValueNumber.operand1 : null;
462
+ const formValueOperand2 = filterValueNumber && filterValueNumber?.operator === "b" ? filterValueNumber.operand2 : null;
463
+ return {
464
+ fieldType: "number",
465
+ formValueOperator: {
466
+ id: operator,
467
+ label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
468
+ },
469
+ formValueOperand1,
470
+ formValueOperand2
471
+ };
472
+ }
473
+ getFilterFromFormValue(formFilterValue) {
474
+ const operator = formFilterValue.formValueOperator.id;
475
+ const operand1 = formFilterValue.formValueOperand1 ? formFilterValue.formValueOperand1 : 0;
476
+ if (operator === "b") {
477
+ const operand2 = formFilterValue.formValueOperand2 ? formFilterValue.formValueOperand2 : 0;
478
+ return {
479
+ fieldType: "number",
480
+ operator,
481
+ operand1,
482
+ operand2
483
+ };
484
+ } else {
485
+ return {
486
+ fieldType: "number",
487
+ operator,
488
+ operand1
489
+ };
490
+ }
491
+ }
492
+ getLabels(filter, getLabel, _formatters, _field) {
493
+ let labelOperands;
494
+ if (filter.operator === "b") {
495
+ labelOperands = filter.operand1 && filter.operand2 ? `${filter.operand1} - ${filter.operand2}` : "";
496
+ } else {
497
+ labelOperands = filter.operand1 !== void 0 ? filter.operand1 + "" : "";
498
+ }
499
+ return {
500
+ labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
501
+ labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
502
+ labelOperands
503
+ };
504
+ }
505
+ getSchema(getLabel) {
506
+ return Yup.object({
507
+ formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
508
+ formValueOperand1: Yup.number().typeError(
509
+ getLabel(`dynamic_filter.error_operand_mustbe_number`)
510
+ ),
511
+ formValueOperand2: Yup.mixed().when(["formValueOperator.id"], {
512
+ is: "b",
513
+ then: Yup.number().typeError(getLabel(`dynamic_filter.error_operand_mustbe_number`)).min(Yup.ref("formValueOperand1"), getLabel(`dynamic_filter.error_less_than_start`))
514
+ })
515
+ });
516
+ }
517
+ verifyFilter(filter, _field) {
518
+ if (typeof filter.operator !== "number") {
519
+ return false;
520
+ }
521
+ if (NUMBER_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
522
+ return false;
523
+ }
524
+ if (typeof filter.operand1 !== "number") {
525
+ return false;
526
+ }
527
+ if (filter.operator === "b" && typeof filter.operand2 !== "number") {
528
+ return false;
529
+ }
530
+ return true;
531
+ }
532
+ }
533
+ function useDynamicFilterStore(selector, equalityFn) {
534
+ const store = useContext(DynamicFilterContext);
535
+ if (!store)
536
+ throw new Error("useDynamicFilterStore context must be use inside DynamicFilterContext");
537
+ return useStore(store, selector, equalityFn ?? shallow);
538
+ }
539
+ function SelectFilter() {
540
+ const { getLabel } = useModuleDictionary();
541
+ const field = useDynamicFilterStore((state) => state.popoverFilterData?.field);
542
+ if (!field?.selectOptions?.endPoint) {
543
+ throw new Error("El filtro tipo Select requiere la configuraci\xF3n del Endpoint");
544
+ }
545
+ const autocompleteProps = field?.selectOptions;
546
+ const operators = useMemo(
547
+ () => SELECT_OPERATORS.map((o) => ({
548
+ id: o,
549
+ label: getLabel(getDynamicFilterDictionary(`operator_${o}`))
550
+ })),
551
+ [getLabel]
552
+ );
553
+ return /* @__PURE__ */ jsxs("div", { children: [
554
+ /* @__PURE__ */ jsx(
555
+ RHFAutocomplete,
556
+ {
557
+ name: "formValueOperator",
558
+ autoComplete: "off",
559
+ options: operators,
560
+ getOptionLabel: (option) => option.label,
561
+ isOptionEqualToValue: (option, value) => option.id === value.id,
562
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operator))
563
+ }
564
+ ),
565
+ /* @__PURE__ */ jsx(
566
+ RHFAutocompleteAsync,
567
+ {
568
+ ...autocompleteProps,
569
+ name: "formValueOperandsArray",
570
+ autoComplete: "off",
571
+ label: getLabel(getDynamicFilterDictionary(DICCTIONARY.label_select_operands_array))
572
+ }
573
+ )
574
+ ] });
575
+ }
576
+ function filterValidOperandsArraySelect(operandsArray, field) {
577
+ const operandsArrayFormatted = Array.isArray(operandsArray) ? operandsArray : [operandsArray];
578
+ const getOptionId = field?.selectOptions?.getOptionId;
579
+ const getOptionLabel = field?.selectOptions?.getOptionLabel;
580
+ return operandsArrayFormatted?.filter((operand) => {
581
+ return typeof operand === "object" && getOptionId?.(operand) && getOptionLabel?.(operand);
582
+ });
583
+ }
584
+ class SelectFilterHelpers {
585
+ getComponent() {
586
+ return SelectFilter;
587
+ }
588
+ getDefaultFilter(field, fixed) {
589
+ const defaultOperand = field.defaultOperandsArray;
590
+ const defaultFilter = {
591
+ id: 0,
592
+ fieldType: "select",
593
+ field,
594
+ fixed,
595
+ isSet: true,
596
+ operator: "in",
597
+ operandsArray: []
598
+ };
599
+ if (defaultOperand !== void 0 && Array.isArray(defaultOperand)) {
600
+ const validOperandsArray = filterValidOperandsArraySelect(defaultOperand, field);
601
+ defaultFilter.operandsArray = validOperandsArray || [];
602
+ }
603
+ return defaultFilter;
604
+ }
605
+ getFormValue(field, getLabel, filterValueSelect) {
606
+ const filterValue = filterValueSelect ? filterValueSelect : void 0;
607
+ const isMultiple = field?.selectOptions?.multiple ?? false;
608
+ const formValueOperandsArray = isMultiple ? filterValueSelect?.operandsArray : filterValueSelect?.operandsArray?.[0] || filterValueSelect?.operandsArray;
609
+ const operator = filterValue ? filterValue.operator : field.defaultOperator ?? "in";
610
+ return {
611
+ fieldType: "select",
612
+ formValueOperator: {
613
+ id: operator,
614
+ label: getLabel(getDynamicFilterDictionary(`operator_${operator}`))
615
+ },
616
+ formValueOperandsArray
617
+ };
618
+ }
619
+ getFilterFromFormValue(formFilterValue) {
620
+ const operator = formFilterValue.formValueOperator.id;
621
+ const operandsArray = Array.isArray(formFilterValue.formValueOperandsArray) ? formFilterValue.formValueOperandsArray : [formFilterValue.formValueOperandsArray];
622
+ return {
623
+ fieldType: "select",
624
+ operator,
625
+ operandsArray
626
+ };
627
+ }
628
+ getLabels(filter, getLabel, _formatters, field) {
629
+ const operandsArray = filter.operandsArray;
630
+ const labelOperands = operandsArray?.reduce?.((label, operand) => {
631
+ const textLabel = field.selectOptions?.getOptionLabel?.(operand) || "";
632
+ return label ? `${label} | ${textLabel}` : textLabel;
633
+ }, "")?.toString() || "";
634
+ return {
635
+ labelField: filter.field.label ?? getLabel(filter.field.dictionaryId),
636
+ labelOperator: getLabel(getDynamicFilterDictionary(`operator_${filter.operator}`)),
637
+ labelOperands
638
+ };
639
+ }
640
+ getSchema(getLabel) {
641
+ return Yup.object({
642
+ formValueOperator: Yup.object().nullable().required(getLabel(`dynamic_filter.error_operator_required`)),
643
+ formValueOperandsArray: Yup.lazy((value) => {
644
+ 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`));
645
+ })
646
+ });
647
+ }
648
+ verifyFilter(filter, field) {
649
+ if (typeof filter.operator !== "string") {
650
+ return false;
651
+ }
652
+ if (!field) {
653
+ return false;
654
+ }
655
+ if (SELECT_OPERATORS.findIndex((f) => f === filter.operator) === -1) {
656
+ return false;
657
+ }
658
+ if (!filter.operandsArray || typeof filter.operandsArray !== "object") {
659
+ return false;
660
+ }
661
+ const validOperandsArray = filterValidOperandsArraySelect(
662
+ filter.operandsArray,
663
+ field
664
+ );
665
+ if (!validOperandsArray || validOperandsArray?.length === 0) {
666
+ return false;
667
+ }
668
+ return true;
669
+ }
670
+ }
671
+ const helpersStrategies = {
672
+ boolean: new BooleanFilterHelpers(),
673
+ string: new StringFilterHelpers(),
674
+ number: new NumberFilterHelpers(),
675
+ datetime: new DateTimeFilterHelpers(),
676
+ select: new SelectFilterHelpers(),
677
+ __default__: () => {
678
+ throw new Error("Type no defined");
679
+ }
680
+ };
681
+ function fieldFactory(type) {
682
+ const selectedHelper = helpersStrategies?.[type];
683
+ if (!selectedHelper) {
684
+ return helpersStrategies.__default__();
685
+ }
686
+ return selectedHelper;
687
+ }
688
+ function getPurgedInitialFiltersApplied(fields, initialFilters, getFieldByName) {
689
+ const newFilters = [];
690
+ const fixedFields = [];
691
+ for (let index = 0; index < initialFilters.length; index++) {
692
+ try {
693
+ const initialFilter = initialFilters[index];
694
+ const field = getFieldByName(initialFilter.name);
695
+ const filter = {
696
+ id: 0,
697
+ isSet: true,
698
+ fixed: false,
699
+ field,
700
+ fieldType: field.type,
701
+ operator: initialFilters[index].operator,
702
+ operand1: initialFilters[index].operand1,
703
+ operand2: initialFilters[index].operand2,
704
+ operandsArray: initialFilters[index].operandsArray
705
+ };
706
+ if (!field)
707
+ continue;
708
+ const canAddField = fieldFactory(field.type).verifyFilter(initialFilter, field);
709
+ if (canAddField) {
710
+ if (filter.fieldType === "datetime") {
711
+ filter.operand1 = new Date(filter.operand1 + "");
712
+ filter.operand2 = new Date(filter.operand2 + "");
713
+ }
714
+ if (field.presence === "fixed") {
715
+ if (fixedFields.findIndex((f) => f === field.name) === -1) {
716
+ filter.fixed = true;
717
+ fixedFields.push(field.name);
718
+ } else {
719
+ filter.fixed = false;
720
+ }
721
+ }
722
+ filter.isSet = true;
723
+ filter.id = newFilters.length + 1;
724
+ newFilters.push(filter);
725
+ }
726
+ } catch (error) {
727
+ }
728
+ }
729
+ for (let index = 0; index < fields.length; index++) {
730
+ const field = fields[index];
731
+ if (field.presence === "initialized" || field.presence === "fixed") {
732
+ if (!initialFilters.find((f) => f.name === field.name)) {
733
+ const newFilter = fieldFactory(field.type).getDefaultFilter(
734
+ field,
735
+ field.presence === "fixed"
736
+ );
737
+ newFilter.id = newFilters.length + 1;
738
+ newFilters.push(newFilter);
739
+ }
740
+ }
741
+ }
742
+ return newFilters;
743
+ }
744
+ function updateAvailableFields(state) {
745
+ state.availableFields = state.fields.filter((field) => {
746
+ if (field.multiple === void 0 || field.multiple) {
747
+ return true;
748
+ }
749
+ const appliedFilterNames = new Set(state.appliedFilters.map((f) => f.field.name));
750
+ return !appliedFilterNames.has(field.name);
751
+ });
752
+ }
753
+ function updateOwnerStateIsValid(state) {
754
+ state.ownerState.isValid = state.appliedFilters.every((filter) => filter.isSet);
755
+ }
756
+ const updateAutomatic = (state) => {
757
+ updateOwnerStateIsValid(state);
758
+ updateAvailableFields(state);
759
+ if (state.ownerState.isValid && state.automatic) {
760
+ state.ownerState.isDirty = false;
761
+ state.countOnChangeFiltersApplied++;
762
+ }
763
+ };
764
+ const createAreaStore = (initProps) => {
765
+ const startProps = {
766
+ countOnChangeFiltersApplied: 0,
767
+ appliedFilters: [],
768
+ availableFields: [],
769
+ fnAnchorEl: void 0,
770
+ popoverFilterData: void 0,
771
+ inputData: "",
772
+ ...initProps
773
+ };
774
+ return createStore(
775
+ devtools(
776
+ immer((set, get) => ({
777
+ ...startProps,
778
+ actions: {
779
+ init: (initialFiltersApplied) => {
780
+ set((state) => {
781
+ state.appliedFilters = getPurgedInitialFiltersApplied(
782
+ state.fields,
783
+ initialFiltersApplied,
784
+ state.actions.getFieldByName
785
+ );
786
+ state.ownerState.isEmpty = state.appliedFilters.length <= 0;
787
+ updateAutomatic(state);
788
+ });
789
+ },
790
+ getFieldByName: (name) => {
791
+ const field = (get().withAllField ? get().fields.concat(get().allField) : get().fields).find((f) => {
792
+ return f.name === name;
793
+ });
794
+ if (field) {
795
+ return field;
796
+ }
797
+ throw new Error("No exist field");
798
+ },
799
+ removeFilter: (id) => {
800
+ set((state) => {
801
+ const indexToRemoved = state.appliedFilters.findIndex((f) => id === f.id && !f.fixed);
802
+ if (indexToRemoved > -1) {
803
+ state.appliedFilters.splice(indexToRemoved, 1);
804
+ state.ownerState.isEmpty = state.appliedFilters.length === 0;
805
+ updateAutomatic(state);
806
+ }
807
+ });
808
+ },
809
+ showPopoverFilterForAdd: (anchorEl, field) => {
810
+ set((state) => {
811
+ state.fnAnchorEl = void 0;
812
+ state.inputData = "";
813
+ state.popoverFilterData = {
814
+ openFor: "add",
815
+ fnAnchorEl: () => anchorEl,
816
+ field
817
+ };
818
+ });
819
+ get().actions.setInEdition(true);
820
+ },
821
+ showPopoverFilterForEdit: (anchorEl, filterToEdit) => {
822
+ set((state) => {
823
+ state.popoverFilterData = {
824
+ openFor: "edit",
825
+ fnAnchorEl: () => anchorEl,
826
+ filter: filterToEdit,
827
+ field: filterToEdit.field
828
+ };
829
+ });
830
+ get().actions.setInEdition(true);
831
+ },
832
+ hidePopoverFilter: (stayInEdition) => {
833
+ set((state) => {
834
+ state.popoverFilterData = void 0;
835
+ });
836
+ get().actions.setInEdition(stayInEdition);
837
+ },
838
+ clearFilters: () => {
839
+ set((state) => {
840
+ state.appliedFilters = state.appliedFilters.filter((f) => f.fixed);
841
+ state.ownerState.isEmpty = state.appliedFilters.length === 0;
842
+ updateAvailableFields(state);
843
+ });
844
+ },
845
+ fireOnChangeFilters: () => {
846
+ set((state) => {
847
+ if (state.ownerState.isValid) {
848
+ state.ownerState.isDirty = false;
849
+ state.countOnChangeFiltersApplied++;
850
+ }
851
+ });
852
+ },
853
+ getNewId: () => {
854
+ return get().appliedFilters.reduce((prev, filterField) => {
855
+ return filterField.id > prev ? filterField.id : prev;
856
+ }, 0) + 1;
857
+ },
858
+ addFilter: (newFilter) => {
859
+ set((state) => {
860
+ state.appliedFilters.push(newFilter);
861
+ state.ownerState.isEmpty = state.appliedFilters.length === 0;
862
+ updateAutomatic(state);
863
+ });
864
+ },
865
+ updateFilter: (editFilter) => {
866
+ set((state) => {
867
+ const index = state.appliedFilters.findIndex(
868
+ (filterField) => filterField.id === editFilter.id
869
+ );
870
+ if (index > -1) {
871
+ state.appliedFilters[index] = editFilter;
872
+ }
873
+ updateAutomatic(state);
874
+ });
875
+ },
876
+ setInputData: (inputData) => {
877
+ set((state) => {
878
+ state.inputData = inputData;
879
+ });
880
+ },
881
+ setInEdition: (newInEdition) => {
882
+ set((state) => {
883
+ state.ownerState.inEdition = newInEdition;
884
+ });
885
+ },
886
+ setExternalState: (newExternalState) => {
887
+ set((state) => {
888
+ state.ownerState = { ...state.ownerState, ...newExternalState };
889
+ });
890
+ },
891
+ openPopoverMenuFields: (anchorEl) => {
892
+ set((state) => {
893
+ state.fnAnchorEl = () => anchorEl;
894
+ });
895
+ },
896
+ closePopoverMenuFields: (newInEdition) => {
897
+ set((state) => {
898
+ state.fnAnchorEl = void 0;
899
+ state.ownerState.inEdition = newInEdition || false;
900
+ });
901
+ }
902
+ }
903
+ })),
904
+ { name: `Dynamic filter` }
905
+ )
906
+ );
907
+ };
908
+ const formatToRawFilter = (appliedFilters) => {
909
+ return appliedFilters.map((af) => {
910
+ let oa = void 0;
911
+ if (af.field.type === "select" && af.operandsArray) {
912
+ oa = Array.isArray(af.operandsArray) ? af.operandsArray.map(af.field.selectOptions.getOptionId) : [af.field.selectOptions.getOptionId(af.operandsArray)];
913
+ }
914
+ return {
915
+ n: af.field.name,
916
+ o: af.operator,
917
+ o1: af.operand1,
918
+ o2: af.operator === "b" ? af.operand2 : void 0,
919
+ oa
920
+ };
921
+ });
922
+ };
923
+ function formatToInitialFilters(appliedFilters) {
924
+ return appliedFilters.map((appliedFilter) => {
925
+ const ret = {
926
+ name: appliedFilter.field.name,
927
+ operator: appliedFilter.operator,
928
+ operand1: appliedFilter.operand1,
929
+ operand2: appliedFilter.operator === "b" ? appliedFilter.operand2 : void 0
930
+ };
931
+ if (appliedFilter.fieldType === "datetime") {
932
+ ret.operand1 = appliedFilter.operand1.toISOString();
933
+ ret.operand2 = appliedFilter.operator === "b" ? appliedFilter.operand2.toISOString() : void 0;
934
+ }
935
+ if (appliedFilter.fieldType === "select") {
936
+ const validOperandsArray = filterValidOperandsArraySelect(
937
+ appliedFilter.operandsArray,
938
+ appliedFilter.field
939
+ );
940
+ if (validOperandsArray && validOperandsArray?.length > 0) {
941
+ ret.operandsArray = validOperandsArray;
942
+ }
943
+ }
944
+ if (ret.operand2 === void 0) {
945
+ delete ret.operand2;
946
+ }
947
+ return ret;
948
+ });
949
+ }
950
+ const DynamicFilterContext = createContext(null);
951
+ function DynamicFilterProvider(props) {
952
+ const {
953
+ automatic = true,
954
+ withAllField = true,
955
+ fields,
956
+ initialAppliedFilters = [],
957
+ onChangeFilters,
958
+ dataTestId = "",
959
+ children
960
+ } = props;
961
+ const { getLabel } = useModuleDictionary();
962
+ const dynamicFilterStoreRef = useRef();
963
+ const { host_static_assets, environment_assets } = useEnvironment();
964
+ const isDesktop = useResponsiveDesktop();
965
+ const isSkeleton = useModuleSkeleton();
966
+ const isFirstRender = useFirstRender([isDesktop, isSkeleton]);
967
+ if (!dynamicFilterStoreRef.current) {
968
+ dynamicFilterStoreRef.current = createAreaStore({
969
+ allField: {
970
+ ...ALL_FIELD,
971
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
972
+ },
973
+ withAllField,
974
+ fields,
975
+ automatic,
976
+ getLabel,
977
+ dataTestId,
978
+ ownerState: {
979
+ isSkeleton,
980
+ isDirty: !automatic,
981
+ inEdition: false,
982
+ isValid: true,
983
+ isMobile: !isDesktop,
984
+ isEmpty: true
985
+ }
986
+ });
987
+ dynamicFilterStoreRef.current.getState().actions.init(initialAppliedFilters);
988
+ }
989
+ const countOnChangeFiltersApplied = useStore(
990
+ dynamicFilterStoreRef.current,
991
+ (state) => state.countOnChangeFiltersApplied,
992
+ shallow
993
+ );
994
+ useEffect(() => {
995
+ if (countOnChangeFiltersApplied === 0) {
996
+ return;
997
+ }
998
+ const state = dynamicFilterStoreRef.current?.getState();
999
+ if (state) {
1000
+ onChangeFilters?.(
1001
+ formatToInitialFilters(state.appliedFilters),
1002
+ formatToRawFilter(state.appliedFilters)
1003
+ );
1004
+ }
1005
+ }, [countOnChangeFiltersApplied]);
1006
+ useEffect(() => {
1007
+ if (isFirstRender) {
1008
+ return;
1009
+ }
1010
+ dynamicFilterStoreRef.current?.getState().actions.setExternalState({ isMobile: !isDesktop, isSkeleton });
1011
+ }, [isDesktop, isSkeleton]);
1012
+ useEffect(() => {
1013
+ if (automatic) {
1014
+ dynamicFilterStoreRef.current?.getState().actions.fireOnChangeFilters();
1015
+ return;
1016
+ }
1017
+ }, []);
1018
+ return /* @__PURE__ */ jsx(DynamicFilterContext.Provider, { value: dynamicFilterStoreRef.current, children });
1019
+ }
1020
+ function useDynamicFilterBase() {
1021
+ const ownerState = useDynamicFilterStore((state) => state.ownerState);
1022
+ const dataTestId = useDynamicFilterStore((state) => state.dataTestId);
1023
+ return { ownerState, dataTestId };
1024
+ }
1025
+ function useInputFilter() {
1026
+ const [selectedFieldIndex, setSelectedFieldIndex] = useState(-1);
1027
+ const [filteredFields, setFilteredFields] = useState([]);
1028
+ const { host_static_assets, environment_assets } = useEnvironment();
1029
+ const { getLabel } = useModuleDictionary();
1030
+ const isSkeleton = useModuleSkeleton();
1031
+ const anchorEl = useDynamicFilterStore((state) => state.fnAnchorEl);
1032
+ const withAllField = useDynamicFilterStore((state) => state.withAllField);
1033
+ const availableFields = useDynamicFilterStore((state) => state.availableFields);
1034
+ const inputData = useDynamicFilterStore((state) => state.inputData);
1035
+ const {
1036
+ addFilter,
1037
+ closePopoverMenuFields,
1038
+ getFieldByName,
1039
+ getNewId,
1040
+ hidePopoverFilter,
1041
+ openPopoverMenuFields,
1042
+ setInEdition,
1043
+ setInputData,
1044
+ showPopoverFilterForAdd
1045
+ } = useDynamicFilterStore((state) => state.actions);
1046
+ useEffect(() => {
1047
+ if (!anchorEl) {
1048
+ setFilteredFields([]);
1049
+ } else {
1050
+ setFilteredFields(
1051
+ availableFields.filter(
1052
+ (field) => (field.label ?? getLabel(field.dictionaryId)).includes(inputData)
1053
+ )
1054
+ );
1055
+ setSelectedFieldIndex(-1);
1056
+ }
1057
+ }, [anchorEl, inputData, availableFields, getLabel]);
1058
+ function handleOpenPopUpClickItem(field) {
1059
+ closePopoverMenuFields();
1060
+ if (anchorEl)
1061
+ showPopoverFilterForAdd(anchorEl(), field);
1062
+ }
1063
+ const inputHandlersProps = {
1064
+ onFocus: (event) => {
1065
+ openPopoverMenuFields(event.currentTarget);
1066
+ setInEdition(true);
1067
+ },
1068
+ onChange: (event) => {
1069
+ setInputData(event.target.value);
1070
+ if (!anchorEl) {
1071
+ openPopoverMenuFields(event.currentTarget);
1072
+ }
1073
+ hidePopoverFilter(true);
1074
+ },
1075
+ onKeyDown: (event) => {
1076
+ if (event.key === "ArrowDown") {
1077
+ let newIndex = -1;
1078
+ if (filteredFields.length > 0) {
1079
+ if (selectedFieldIndex < filteredFields.length - 1) {
1080
+ newIndex = selectedFieldIndex + 1;
1081
+ } else {
1082
+ newIndex = filteredFields.length - 1;
1083
+ }
1084
+ }
1085
+ setSelectedFieldIndex(newIndex);
1086
+ }
1087
+ if (event.key === "ArrowUp") {
1088
+ let newIndex = -1;
1089
+ if (filteredFields.length > 0) {
1090
+ if (selectedFieldIndex > -1) {
1091
+ newIndex = selectedFieldIndex - 1;
1092
+ }
1093
+ }
1094
+ setSelectedFieldIndex(newIndex);
1095
+ }
1096
+ if (event.key === "Escape") {
1097
+ closePopoverMenuFields();
1098
+ }
1099
+ if (event.key !== "Enter")
1100
+ return;
1101
+ if (selectedFieldIndex === -1) {
1102
+ if (inputData.trim() === "") {
1103
+ closePopoverMenuFields();
1104
+ return;
1105
+ }
1106
+ if (withAllField) {
1107
+ addFilter({
1108
+ id: getNewId(),
1109
+ fieldType: "string",
1110
+ field: getFieldByName(ALL_FIELD.name),
1111
+ isSet: true,
1112
+ fixed: false,
1113
+ operator: "c",
1114
+ operand1: inputData
1115
+ });
1116
+ setInputData("");
1117
+ closePopoverMenuFields();
1118
+ }
1119
+ } else {
1120
+ handleOpenPopUpClickItem(filteredFields[selectedFieldIndex]);
1121
+ }
1122
+ }
1123
+ };
1124
+ return {
1125
+ iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/filter.svg`,
1126
+ isSkeleton,
1127
+ inputPlaceHolder: getLabel(getDynamicFilterDictionary(DICCTIONARY.input_placeholder)),
1128
+ inputData,
1129
+ inputHandlersProps,
1130
+ canRender: !(!withAllField && availableFields.length === 0),
1131
+ filteredFields,
1132
+ selectedFieldIndex
1133
+ };
1134
+ }
1135
+ function InputFilterSkeleton() {
1136
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1137
+ /* @__PURE__ */ jsx(
1138
+ Skeleton,
1139
+ {
1140
+ variant: "circular",
1141
+ width: "16px",
1142
+ height: "16px",
1143
+ sx: { minWidth: "16px", minHeight: "16px" }
1144
+ }
1145
+ ),
1146
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "16px", sx: { minWidth: "80px" } })
1147
+ ] });
1148
+ }
1149
+ var DynamicFilterSlots = /* @__PURE__ */ ((DynamicFilterSlots2) => {
1150
+ DynamicFilterSlots2["root"] = "root";
1151
+ DynamicFilterSlots2["innerContainer"] = "innerContainer";
1152
+ DynamicFilterSlots2["inputFilter"] = "inputFilter";
1153
+ DynamicFilterSlots2["inputFilterInput"] = "inputFilterInput";
1154
+ DynamicFilterSlots2["inputFilterIcon"] = "inputFilterIcon";
1155
+ DynamicFilterSlots2["appliedFilters"] = "appliedFilters";
1156
+ DynamicFilterSlots2["appliedFilterInnerContainer"] = "appliedFilterInnerContainer";
1157
+ DynamicFilterSlots2["appliedFilterChip"] = "appliedFilterChip";
1158
+ DynamicFilterSlots2["appliedFilterChipIcon"] = "appliedFilterChipIcon";
1159
+ DynamicFilterSlots2["appliedFilterChipInfo"] = "appliedFilterChipInfo";
1160
+ DynamicFilterSlots2["appliedFilterChipInfoFieldName"] = "appliedFilterChipInfoFieldName";
1161
+ DynamicFilterSlots2["appliedFilterChipInfoOperator"] = "appliedFilterChipInfoOperator";
1162
+ DynamicFilterSlots2["appliedFilterChipInfoOperands"] = "appliedFilterChipInfoOperands";
1163
+ DynamicFilterSlots2["appliedFilterChipRemoveButton"] = "appliedFilterChipRemoveButton";
1164
+ DynamicFilterSlots2["actions"] = "actions";
1165
+ DynamicFilterSlots2["actionsSkeletonButton"] = "actionsSkeletonButton";
1166
+ DynamicFilterSlots2["actionsClearButton"] = "actionsClearButton";
1167
+ DynamicFilterSlots2["actionsSubmitButton"] = "actionsSubmitButton";
1168
+ DynamicFilterSlots2["popoverMenu"] = "popoverMenu";
1169
+ DynamicFilterSlots2["popoverMenuItem"] = "popoverMenuItem";
1170
+ DynamicFilterSlots2["popoverMenuItemIcon"] = "popoverMenuItemIcon";
1171
+ DynamicFilterSlots2["popoverMenuItemLabel"] = "popoverMenuItemLabel";
1172
+ DynamicFilterSlots2["popoverFilter"] = "popoverFilter";
1173
+ DynamicFilterSlots2["popoverFilterContainerFields"] = "popoverFilterContainerFields";
1174
+ DynamicFilterSlots2["popoverFilterHeader"] = "popoverFilterHeader";
1175
+ DynamicFilterSlots2["popoverFilterHeaderIcon"] = "popoverFilterHeaderIcon";
1176
+ DynamicFilterSlots2["popoverFilterHeaderTitle"] = "popoverFilterHeaderTitle";
1177
+ DynamicFilterSlots2["popoverFilterActions"] = "popoverFilterActions";
1178
+ return DynamicFilterSlots2;
1179
+ })(DynamicFilterSlots || {});
1180
+ const CONTAINER_QUERY_NAME = "dynamic";
1181
+ const dynamicFilterStyles = {
1182
+ root: {
1183
+ containerName: CONTAINER_QUERY_NAME,
1184
+ containerType: "inline-size",
1185
+ width: "100%",
1186
+ height: "auto",
1187
+ padding: 0
1188
+ },
1189
+ innerContainer: ({ theme, ownerState }) => ({
1190
+ display: "grid",
1191
+ gridTemplateColumns: "auto 1fr auto",
1192
+ gridTemplateAreas: '"input-filter applied-filters actions-filter"',
1193
+ alignItems: "center",
1194
+ justifyContent: "flex-start",
1195
+ width: "100%",
1196
+ height: "fit-content",
1197
+ border: "1px solid",
1198
+ borderRadius: "4px",
1199
+ borderColor: theme.vars.palette.state?.borderPrimary,
1200
+ background: theme.vars.palette.background.default,
1201
+ [containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
1202
+ minHeight: "auto",
1203
+ height: "auto",
1204
+ gridTemplateColumns: "1fr auto",
1205
+ gridTemplateAreas: `"input-filter actions-filter"
1206
+ "applied-filters applied-filters"`
1207
+ },
1208
+ "&:focus-within": {
1209
+ borderColor: !ownerState.isValid ? theme.vars.palette.state.error.normal : theme.vars.palette.state?.focus
1210
+ },
1211
+ ...ownerState.isValid === false ? {
1212
+ borderColor: theme.palette.state.error.normal
1213
+ } : {}
1214
+ }),
1215
+ inputFilter: ({ theme }) => ({
1216
+ gridArea: "input-filter",
1217
+ display: "flex",
1218
+ flexDirection: "row",
1219
+ gap: "8px",
1220
+ padding: "4px 6px 4px 4px",
1221
+ height: "100%",
1222
+ maxWidth: "135px",
1223
+ width: "100%",
1224
+ alignItems: "center",
1225
+ borderTopLeftRadius: "4px",
1226
+ borderBottomLeftRadius: "4px",
1227
+ borderRight: "1px solid",
1228
+ borderColor: theme.vars.palette.state?.borderPrimary,
1229
+ [containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
1230
+ height: "32px",
1231
+ width: "100%",
1232
+ maxWidth: "100%",
1233
+ borderRight: "none"
1234
+ },
1235
+ [theme.breakpoints.down("sm")]: {
1236
+ height: "44px",
1237
+ justifyContent: "center"
1238
+ }
1239
+ }),
1240
+ inputFilterInput: ({ theme }) => ({
1241
+ ...theme.typography.body,
1242
+ background: theme.vars.palette.background.default,
1243
+ color: theme.vars.palette.text.secondary,
1244
+ border: "1px solid",
1245
+ borderColor: "transparent",
1246
+ padding: "4px 8px",
1247
+ width: "100%",
1248
+ height: "100%",
1249
+ "&::placeholder": {
1250
+ color: theme.vars.palette.text.secondary
1251
+ },
1252
+ "&:focus-visible": {
1253
+ color: theme.vars.palette.text.secondary,
1254
+ border: "1px solid",
1255
+ borderColor: theme.vars.palette.state?.active12,
1256
+ background: theme.vars.palette.state?.active12,
1257
+ BorderRadius: "2px",
1258
+ outline: "none!important"
1259
+ },
1260
+ "&:hover": {
1261
+ borderColor: theme.vars.palette.state?.toneOp,
1262
+ background: theme.vars.palette.state?.hoverDefault
1263
+ }
1264
+ }),
1265
+ inputFilterIcon: {},
1266
+ appliedFilters: ({ theme }) => ({
1267
+ gridArea: "applied-filters",
1268
+ width: "100%",
1269
+ height: "fit-content",
1270
+ paddingLeft: theme.spacing(1),
1271
+ borderLeft: "none",
1272
+ margin: "0px",
1273
+ padding: "0px 4px",
1274
+ [containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
1275
+ height: "auto",
1276
+ padding: "4px",
1277
+ display: "flex",
1278
+ borderTop: "1px solid ",
1279
+ borderColor: theme.vars.palette.state?.borderSecondary,
1280
+ "&:has(div[class*=appliedFilterInnerContainer]:empty), &:empty": {
1281
+ display: "none"
1282
+ }
1283
+ }
1284
+ }),
1285
+ appliedFilterInnerContainer: ({ theme }) => ({
1286
+ padding: "2px",
1287
+ gap: "4px",
1288
+ height: "fit-content",
1289
+ display: "flex",
1290
+ flexWrap: "nowrap",
1291
+ width: "100%",
1292
+ justifyContent: "flex-start",
1293
+ alignItems: "center",
1294
+ [containerQuery(theme.breakpoints, CONTAINER_QUERY_NAME)]: {
1295
+ height: "32px",
1296
+ padding: 0,
1297
+ margin: 0,
1298
+ border: 0
1299
+ },
1300
+ [theme.breakpoints.down("sm")]: {
1301
+ padding: 0,
1302
+ height: "44px"
1303
+ }
1304
+ }),
1305
+ appliedFilterChip: ({ theme }) => ({
1306
+ display: "flex",
1307
+ justifyContent: "center",
1308
+ alignItems: "center",
1309
+ overflow: "visible",
1310
+ width: "auto",
1311
+ height: "24px",
1312
+ minHeight: theme.spacing(3),
1313
+ paddingLeft: theme.spacing(1),
1314
+ borderColor: alpha(`${theme.palette.divider}`, 0.1),
1315
+ border: "none",
1316
+ borderRadius: "4px",
1317
+ backgroundColor: theme.palette.state?.default,
1318
+ color: theme.palette.text.secondary,
1319
+ ...theme.typography.body,
1320
+ [theme.breakpoints.down("sm")]: {
1321
+ height: "fit-content"
1322
+ }
1323
+ }),
1324
+ appliedFilterChipIcon: {},
1325
+ appliedFilterChipInfo: ({ theme }) => ({
1326
+ ...theme.typography.body2,
1327
+ display: "flex",
1328
+ justifyContent: "center",
1329
+ alignItems: "center",
1330
+ width: "auto",
1331
+ height: "100%",
1332
+ marginRight: theme.spacing(1),
1333
+ marginLeft: theme.spacing(1),
1334
+ whiteSpace: "nowrap",
1335
+ border: "none",
1336
+ backgroundColor: "transparent"
1337
+ }),
1338
+ appliedFilterChipInfoFieldName: ({ theme }) => ({
1339
+ ...theme.typography.subtitle2,
1340
+ color: theme.palette.text.secondary
1341
+ }),
1342
+ appliedFilterChipInfoOperator: ({ theme }) => ({
1343
+ ...theme.typography.body2,
1344
+ marginLeft: theme.spacing(1.5),
1345
+ fontStyle: "italic",
1346
+ color: theme.palette.text.secondary
1347
+ }),
1348
+ appliedFilterChipInfoOperands: ({ theme }) => ({
1349
+ ...theme.typography.body2,
1350
+ marginLeft: theme.spacing(1.5),
1351
+ color: theme.palette.text.secondary
1352
+ }),
1353
+ appliedFilterChipRemoveButton: {},
1354
+ actions: ({ theme }) => ({
1355
+ gridArea: "actions-filter",
1356
+ display: "flex",
1357
+ flexDirection: "row",
1358
+ gap: "8px",
1359
+ padding: "4px",
1360
+ height: "100%",
1361
+ alignItems: "center",
1362
+ borderTopRightRadius: "4px",
1363
+ borderBottomRightRadius: "4px",
1364
+ borderLeft: "1px solid",
1365
+ borderColor: theme.palette.state?.borderPrimary
1366
+ }),
1367
+ actionsSkeletonButton: {
1368
+ display: "flex",
1369
+ justifyContent: "center",
1370
+ alignItems: "center",
1371
+ width: "24px",
1372
+ height: "24px"
1373
+ },
1374
+ actionsClearButton: {},
1375
+ actionsSubmitButton: ({ theme, ownerState }) => ({
1376
+ ...ownerState.isValid === false ? { border: `1px dashed ${theme.palette.error.main}` } : {}
1377
+ }),
1378
+ popoverMenu: ({ theme }) => ({
1379
+ "& .MuiPaper-root": {
1380
+ display: "flex",
1381
+ flexDirection: "column",
1382
+ padding: "8px !important",
1383
+ gap: "4px",
1384
+ borderRadius: "6px",
1385
+ [theme.breakpoints.down("md")]: {
1386
+ gap: "4px"
1387
+ },
1388
+ "& .M4LPopover-arrowStyle": {
1389
+ display: "none"
1390
+ }
1391
+ }
1392
+ }),
1393
+ popoverMenuItem: ({ theme }) => ({
1394
+ paddingLeft: "4px",
1395
+ paddingRight: "4px",
1396
+ borderRadius: "4px",
1397
+ "&:hover": {
1398
+ ...theme.typography.body,
1399
+ color: theme.palette.state?.hover,
1400
+ background: theme.palette.state?.default,
1401
+ borderRadius: "4px",
1402
+ padding: "4px 12px 4px 8px"
1403
+ }
1404
+ }),
1405
+ popoverMenuItemLabel: ({ theme }) => ({
1406
+ ...theme.typography.body,
1407
+ color: theme.palette.text.primary
1408
+ }),
1409
+ popoverMenuItemIcon: {},
1410
+ popoverFilter: ({ theme }) => ({
1411
+ width: "auto",
1412
+ "& .MuiPaper-root": {
1413
+ padding: "0 !important",
1414
+ minWidth: "220px",
1415
+ maxWidth: "100%",
1416
+ minHeight: "auto",
1417
+ boxShadow: theme.customShadows?.z3,
1418
+ "& .M4LPopover-arrowStyle": {
1419
+ display: "none"
1420
+ },
1421
+ "& .M4LRHFormProvider-root": {
1422
+ gap: "0px",
1423
+ width: "max-content",
1424
+ minWidth: "220px",
1425
+ maxWidth: "420px",
1426
+ height: "fit-content"
1427
+ }
1428
+ }
1429
+ }),
1430
+ popoverFilterHeader: ({ theme }) => ({
1431
+ backgroundColor: theme.palette.state?.default,
1432
+ display: "flex",
1433
+ alignItems: "center",
1434
+ gap: "8px",
1435
+ padding: "4px 4px 4px 8px",
1436
+ borderTopLeftRadius: "4px",
1437
+ borderTopRightRadius: "4px",
1438
+ borderBottom: "0px",
1439
+ height: "28px",
1440
+ [theme.breakpoints.down("sm")]: {
1441
+ height: "36px"
1442
+ }
1443
+ }),
1444
+ popoverFilterHeaderIcon: {},
1445
+ popoverFilterHeaderTitle: ({ theme }) => ({
1446
+ ...theme.typography.paragraphDens,
1447
+ color: theme.palette.text.primary
1448
+ }),
1449
+ popoverFilterContainerFields: ({ theme }) => ({
1450
+ height: "fit-content",
1451
+ "& > div": {
1452
+ display: "flex",
1453
+ height: "auto",
1454
+ flexDirection: "column",
1455
+ padding: "12px 12px 0 12px",
1456
+ gap: "8px",
1457
+ [theme.breakpoints.down("sm")]: {
1458
+ padding: "16px 16px 0 16px",
1459
+ gap: "12px"
1460
+ }
1461
+ }
1462
+ }),
1463
+ popoverFilterActions: ({ theme }) => ({
1464
+ display: "flex",
1465
+ flexDirection: "row",
1466
+ gap: "16px",
1467
+ padding: "16px 12px 12px 12px !important",
1468
+ [theme.breakpoints.down("sm")]: {
1469
+ padding: "24px 16px 16px 16px !important"
1470
+ },
1471
+ "& > .M4LButton-root": {
1472
+ height: "24px",
1473
+ minHeight: "24px",
1474
+ [theme.breakpoints.down("sm")]: {
1475
+ height: "36px"
1476
+ }
1477
+ }
1478
+ })
1479
+ };
1480
+ const RootStyled = styled("div", { name: DYNAMIC_FILTER_KEY_COMPONENT, slot: DynamicFilterSlots.root })(
1481
+ dynamicFilterStyles?.root
1482
+ );
1483
+ const InnerContainerStyled = styled("div", {
1484
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1485
+ slot: DynamicFilterSlots.innerContainer
1486
+ })(dynamicFilterStyles?.innerContainer);
1487
+ const InputFilterStyled = styled("div", {
1488
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1489
+ slot: DynamicFilterSlots.inputFilter
1490
+ })(dynamicFilterStyles?.inputFilter);
1491
+ const InputFilterInputStyled = styled("input", {
1492
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1493
+ slot: DynamicFilterSlots.inputFilterInput
1494
+ })(dynamicFilterStyles?.inputFilterInput);
1495
+ const InputFilterIconStyled = styled(Icon, {
1496
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1497
+ slot: DynamicFilterSlots.inputFilterIcon
1498
+ })(dynamicFilterStyles?.inputFilterIcon);
1499
+ const AppliedFiltersStyled = styled("div", {
1500
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1501
+ slot: DynamicFilterSlots.appliedFilters
1502
+ })(dynamicFilterStyles?.appliedFilters);
1503
+ const AppliedFilterInnerContainerStyled = styled("div", {
1504
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1505
+ slot: DynamicFilterSlots.appliedFilterInnerContainer
1506
+ })(dynamicFilterStyles?.appliedFilterInnerContainer);
1507
+ const AppliedFilterChipStyled = styled("div", {
1508
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1509
+ slot: DynamicFilterSlots.appliedFilterChip
1510
+ })(dynamicFilterStyles?.appliedFilterChip);
1511
+ const AppliedFilterChipIconStyled = styled(IconButton, {
1512
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1513
+ slot: DynamicFilterSlots.appliedFilterChipIcon
1514
+ })(dynamicFilterStyles?.appliedFilterChipIcon);
1515
+ const AppliedFilterChipInfoStyled = styled("button", {
1516
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1517
+ slot: DynamicFilterSlots.appliedFilterChipInfo
1518
+ })(dynamicFilterStyles?.appliedFilterChipInfo);
1519
+ const AppliedFilterChipInfoFieldNameStyled = styled("span", {
1520
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1521
+ slot: DynamicFilterSlots.appliedFilterChipInfoFieldName
1522
+ })(dynamicFilterStyles?.appliedFilterChipInfoFieldName);
1523
+ const AppliedFilterChipInfoOperatorStyled = styled("span", {
1524
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1525
+ slot: DynamicFilterSlots.appliedFilterChipInfoOperator
1526
+ })(dynamicFilterStyles?.appliedFilterChipInfoOperator);
1527
+ const AppliedFilterChipInfoOperandsStyled = styled("span", {
1528
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1529
+ slot: DynamicFilterSlots.appliedFilterChipInfoOperands
1530
+ })(dynamicFilterStyles?.appliedFilterChipInfoOperands);
1531
+ const AppliedFilterChipRemoveButtonStyled = styled(IconButton, {
1532
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1533
+ slot: DynamicFilterSlots.appliedFilterChipRemoveButton
1534
+ })(dynamicFilterStyles?.appliedFilterChipRemoveButton);
1535
+ const ActionsStyled = styled("div", {
1536
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1537
+ slot: DynamicFilterSlots.actions
1538
+ })(dynamicFilterStyles?.actions);
1539
+ const ActionsSkeletonButtonStyled = styled("div", {
1540
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1541
+ slot: DynamicFilterSlots.actionsSkeletonButton
1542
+ })(dynamicFilterStyles?.actionsSkeletonButton);
1543
+ const ActionsClearButtonStyled = styled(IconButton, {
1544
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1545
+ slot: DynamicFilterSlots.actionsClearButton
1546
+ })(dynamicFilterStyles?.actionsClearButton);
1547
+ const ActionsSubmitButtonStyled = styled(IconButton, {
1548
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1549
+ slot: DynamicFilterSlots.actionsSubmitButton
1550
+ })(dynamicFilterStyles?.actionsSubmitButton);
1551
+ const PopoverMenuStyled = styled(Popover, {
1552
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1553
+ slot: DynamicFilterSlots.popoverMenu
1554
+ })(dynamicFilterStyles?.popoverMenu);
1555
+ const PopoverMenuItemStyled = styled(MenuItem, {
1556
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1557
+ slot: DynamicFilterSlots.popoverMenuItem
1558
+ })(dynamicFilterStyles?.popoverMenuItem);
1559
+ const PopoverMenuItemIconStyled = styled(Icon, {
1560
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1561
+ slot: DynamicFilterSlots.popoverMenuItemIcon
1562
+ })(dynamicFilterStyles?.popoverMenuItemIcon);
1563
+ const PopoverMenuItemLabelStyled = styled("div", {
1564
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1565
+ slot: DynamicFilterSlots.popoverMenuItemLabel
1566
+ })(dynamicFilterStyles?.popoverMenuItemLabel);
1567
+ const PopoverStyled = styled(Popover, {
1568
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1569
+ slot: DynamicFilterSlots.popoverFilter
1570
+ })(dynamicFilterStyles?.popoverFilter);
1571
+ const PopoverContainerFieldsStyled = styled("div", {
1572
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1573
+ slot: DynamicFilterSlots.popoverFilterContainerFields
1574
+ })(dynamicFilterStyles?.popoverFilterContainerFields);
1575
+ const PopoverHeaderStyled = styled("div", {
1576
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1577
+ slot: DynamicFilterSlots.popoverFilterHeader
1578
+ })(dynamicFilterStyles?.popoverFilterHeader);
1579
+ const PopoverHeaderIconStyled = styled(Icon, {
1580
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1581
+ slot: DynamicFilterSlots.popoverFilterHeaderIcon
1582
+ })(dynamicFilterStyles?.popoverFilterHeaderIcon);
1583
+ const PopoverHeaderTitleStyled = styled(Typography, {
1584
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1585
+ slot: DynamicFilterSlots.popoverFilterHeaderTitle
1586
+ })(dynamicFilterStyles?.popoverFilterHeaderTitle);
1587
+ const PopoverHeaderActionsStyled = styled(Actions, {
1588
+ name: DYNAMIC_FILTER_KEY_COMPONENT,
1589
+ slot: DynamicFilterSlots.popoverFilterActions
1590
+ })(dynamicFilterStyles?.popoverFilterActions);
1591
+ function usePopoverMenuFields() {
1592
+ const { getLabel } = useModuleDictionary();
1593
+ const fnAnchorEl = useDynamicFilterStore((state) => state.fnAnchorEl);
1594
+ const { showPopoverFilterForAdd, closePopoverMenuFields } = useDynamicFilterStore(
1595
+ (state) => state.actions
1596
+ );
1597
+ function handleOpenPopUpClickItem(_event, field) {
1598
+ if (fnAnchorEl) {
1599
+ showPopoverFilterForAdd(fnAnchorEl(), field);
1600
+ }
1601
+ }
1602
+ function handleClosePopover() {
1603
+ closePopoverMenuFields(false);
1604
+ }
1605
+ function getItemLabel(field) {
1606
+ return field.label ?? getLabel(field.dictionaryId);
1607
+ }
1608
+ return {
1609
+ fnAnchorEl,
1610
+ getItemLabel,
1611
+ handleClosePopover,
1612
+ handleOpenPopUpClickItem
1613
+ };
1614
+ }
1615
+ function PopoverMenuFields(props) {
1616
+ const { fields, selectFieldIndex } = props;
1617
+ const { fnAnchorEl, handleOpenPopUpClickItem, handleClosePopover, getItemLabel } = usePopoverMenuFields();
1618
+ return /* @__PURE__ */ jsx(
1619
+ PopoverMenuStyled,
1620
+ {
1621
+ disableAutoFocus: true,
1622
+ disableRestoreFocus: true,
1623
+ arrowType: "top-left",
1624
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
1625
+ transformOrigin: { vertical: "top", horizontal: "left" },
1626
+ open: Boolean(fnAnchorEl),
1627
+ onClose: handleClosePopover,
1628
+ anchorEl: fnAnchorEl?.(),
1629
+ ownerState: {},
1630
+ children: Boolean(fnAnchorEl) && fields.map((field, index) => /* @__PURE__ */ jsxs(
1631
+ PopoverMenuItemStyled,
1632
+ {
1633
+ dense: true,
1634
+ selected: index === selectFieldIndex,
1635
+ onClick: (event) => handleOpenPopUpClickItem(event, field),
1636
+ ownerState: {},
1637
+ children: [
1638
+ /* @__PURE__ */ jsx(PopoverMenuItemIconStyled, { src: field.urlIcon, ownerState: {} }),
1639
+ /* @__PURE__ */ jsx(PopoverMenuItemLabelStyled, { ownerState: {}, children: getItemLabel(field) })
1640
+ ]
1641
+ },
1642
+ `menu_action_${getItemLabel(field)}`
1643
+ ))
1644
+ }
1645
+ );
1646
+ }
1647
+ const InputFilter = () => {
1648
+ const {
1649
+ iconUrl,
1650
+ isSkeleton,
1651
+ inputPlaceHolder,
1652
+ inputData,
1653
+ inputHandlersProps,
1654
+ canRender,
1655
+ filteredFields,
1656
+ selectedFieldIndex
1657
+ } = useInputFilter();
1658
+ if (!canRender)
1659
+ return null;
1660
+ if (isSkeleton) {
1661
+ return /* @__PURE__ */ jsx(InputFilterStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(InputFilterSkeleton, {}) });
1662
+ }
1663
+ return /* @__PURE__ */ jsxs(InputFilterStyled, { ownerState: {}, children: [
1664
+ /* @__PURE__ */ jsx(InputFilterIconStyled, { src: iconUrl, ownerState: {} }),
1665
+ /* @__PURE__ */ jsx(
1666
+ InputFilterInputStyled,
1667
+ {
1668
+ type: "text",
1669
+ value: inputData,
1670
+ placeholder: inputPlaceHolder,
1671
+ ownerState: {},
1672
+ ...inputHandlersProps
1673
+ }
1674
+ ),
1675
+ /* @__PURE__ */ jsx(PopoverMenuFields, { fields: filteredFields, selectFieldIndex: selectedFieldIndex })
1676
+ ] });
1677
+ };
1678
+ const InputFilter$1 = InputFilter;
1679
+ function useAppliedFilters() {
1680
+ const appliedFilter = useDynamicFilterStore((state) => state.appliedFilters);
1681
+ const isSkeleton = useDynamicFilterStore((state) => state.ownerState.isSkeleton);
1682
+ const appliedFiltersSorted = [...appliedFilter].sort(
1683
+ (filterA, filterB) => filterA.isSet !== filterB.isSet ? Number(filterA.isSet) - Number(filterB.isSet) : filterB.id - filterA.id
1684
+ );
1685
+ return {
1686
+ appliedFiltersSorted,
1687
+ isSkeleton
1688
+ };
1689
+ }
1690
+ function useAppliedFilterChip(filter) {
1691
+ const { host_static_assets, environment_assets } = useEnvironment();
1692
+ const { getLabel } = useModuleDictionary();
1693
+ const formatters = useFormatter();
1694
+ const { hidePopoverFilter, removeFilter, showPopoverFilterForEdit } = useDynamicFilterStore(
1695
+ (state) => state.actions
1696
+ );
1697
+ const removeIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/clear.svg`;
1698
+ const labels = useMemo(() => {
1699
+ return fieldFactory(filter.field.type).getLabels(filter, getLabel, formatters, filter.field);
1700
+ }, [filter, getLabel]);
1701
+ function onDelete() {
1702
+ hidePopoverFilter(false);
1703
+ removeFilter(filter.id);
1704
+ }
1705
+ function onEditFilter(event) {
1706
+ hidePopoverFilter(false);
1707
+ const currentTarget = event.currentTarget;
1708
+ setTimeout(() => showPopoverFilterForEdit(currentTarget, filter), 10);
1709
+ }
1710
+ return {
1711
+ onDelete,
1712
+ onEditFilter,
1713
+ removeIconUrl,
1714
+ iconFieldUrl: filter.field?.urlIcon,
1715
+ labels
1716
+ };
1717
+ }
1718
+ function AppliedFilterChip(props) {
1719
+ const { fixed } = props;
1720
+ const { onEditFilter, onDelete, iconFieldUrl, removeIconUrl, labels } = useAppliedFilterChip(props);
1721
+ return /* @__PURE__ */ jsxs(AppliedFilterChipStyled, { ownerState: {}, children: [
1722
+ iconFieldUrl && /* @__PURE__ */ jsx(AppliedFilterChipIconStyled, { onClick: onEditFilter, src: iconFieldUrl, ownerState: {} }),
1723
+ /* @__PURE__ */ jsxs(AppliedFilterChipInfoStyled, { onClick: onEditFilter, ownerState: {}, children: [
1724
+ /* @__PURE__ */ jsx(AppliedFilterChipInfoFieldNameStyled, { ownerState: {}, children: labels.labelField }),
1725
+ /* @__PURE__ */ jsx(AppliedFilterChipInfoOperatorStyled, { ownerState: {}, children: labels.labelOperator }),
1726
+ /* @__PURE__ */ jsx(AppliedFilterChipInfoOperandsStyled, { ownerState: {}, children: labels.labelOperands })
1727
+ ] }),
1728
+ !fixed && /* @__PURE__ */ jsx(
1729
+ AppliedFilterChipRemoveButtonStyled,
1730
+ {
1731
+ src: removeIconUrl,
1732
+ size: "small",
1733
+ dictionaryTooltipId: "dynamic_filter.tooltip_clear_filter",
1734
+ onClick: onDelete,
1735
+ ownerState: {}
1736
+ }
1737
+ )
1738
+ ] });
1739
+ }
1740
+ function AppliedFilters() {
1741
+ const { appliedFiltersSorted, isSkeleton } = useAppliedFilters();
1742
+ if (isSkeleton) {
1743
+ return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {} });
1744
+ }
1745
+ return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx(AppliedFilterInnerContainerStyled, { ownerState: {}, children: appliedFiltersSorted?.map((filter) => /* @__PURE__ */ jsx(AppliedFilterChip, { ...filter }, filter.id)) }) }) });
1746
+ }
1747
+ const ASSETS_URL = "frontend/components/dynamic_filter/assets/icons";
1748
+ const ASSETS = {
1749
+ refresh: "restart.svg",
1750
+ search: "search.svg"
1751
+ };
1752
+ function useFilterActions() {
1753
+ const { host_static_assets, environment_assets } = useEnvironment();
1754
+ const automatic = useDynamicFilterStore((state) => state.automatic);
1755
+ const isSkeleton = useDynamicFilterStore((state) => state.ownerState.isSkeleton);
1756
+ const isValid = useDynamicFilterStore((state) => state.ownerState.isValid);
1757
+ const isDirty = useDynamicFilterStore((state) => state.ownerState.isDirty);
1758
+ const appliedFilters = useDynamicFilterStore((state) => state.appliedFilters);
1759
+ const { hidePopoverFilter, clearFilters, fireOnChangeFilters } = useDynamicFilterStore(
1760
+ (state) => state.actions
1761
+ );
1762
+ function onClickClearFilters() {
1763
+ hidePopoverFilter(false);
1764
+ clearFilters();
1765
+ fireOnChangeFilters();
1766
+ }
1767
+ const filterIconUrl = `${host_static_assets}/${environment_assets}/${ASSETS_URL}/${automatic ? ASSETS.refresh : ASSETS.search}`;
1768
+ const clearIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/close.svg`;
1769
+ const canShowRemoveAction = appliedFilters.findIndex((f) => !f.fixed) > -1;
1770
+ const filterButtonDictionaryTooltip = getDynamicFilterDictionary(
1771
+ isValid ? isDirty ? DICCTIONARY.filter_tooltip_dirty : DICCTIONARY.filter_tooltip_refresh : DICCTIONARY.filter_tooltip_invalid
1772
+ );
1773
+ return {
1774
+ isSkeleton,
1775
+ filterIconUrl,
1776
+ clearIconUrl,
1777
+ canShowRemoveAction,
1778
+ onClickClearFilters,
1779
+ onClickFilter: fireOnChangeFilters,
1780
+ filterButtonDictionaryTooltip,
1781
+ ownerState: { isValid }
1782
+ };
1783
+ }
1784
+ function FilterActionsSkeleton() {
1785
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1786
+ /* @__PURE__ */ jsx(ActionsSkeletonButtonStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: "16px", height: "16px" }) }),
1787
+ /* @__PURE__ */ jsx(ActionsSkeletonButtonStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: "16px", height: "16px" }) })
1788
+ ] });
1789
+ }
1790
+ function FilterActions() {
1791
+ const {
1792
+ isSkeleton,
1793
+ filterIconUrl,
1794
+ clearIconUrl,
1795
+ canShowRemoveAction,
1796
+ onClickClearFilters,
1797
+ onClickFilter,
1798
+ filterButtonDictionaryTooltip,
1799
+ ownerState
1800
+ } = useFilterActions();
1801
+ if (isSkeleton) {
1802
+ return /* @__PURE__ */ jsx(ActionsStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(FilterActionsSkeleton, {}) });
1803
+ }
1804
+ return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: {}, children: [
1805
+ canShowRemoveAction && /* @__PURE__ */ jsx(
1806
+ ActionsClearButtonStyled,
1807
+ {
1808
+ src: clearIconUrl,
1809
+ onClick: onClickClearFilters,
1810
+ dictionaryTooltipId: "dynamic_filter.tooltip_clear_filters",
1811
+ ownerState: {}
1812
+ }
1813
+ ),
1814
+ /* @__PURE__ */ jsx(
1815
+ ActionsSubmitButtonStyled,
1816
+ {
1817
+ src: filterIconUrl,
1818
+ "aria-label": "settings",
1819
+ dictionaryTooltipId: filterButtonDictionaryTooltip,
1820
+ onClick: onClickFilter,
1821
+ ownerState: { ...ownerState }
1822
+ }
1823
+ )
1824
+ ] });
1825
+ }
1826
+ function usePopoverFilter() {
1827
+ let anchorEl;
1828
+ let field;
1829
+ let formFilter;
1830
+ let filterFormValue;
1831
+ let popupValidationSchema;
1832
+ const { getLabel } = useModuleDictionary();
1833
+ const popoverFilterData = useDynamicFilterStore((state) => state.popoverFilterData);
1834
+ const { hidePopoverFilter, addFilter, updateFilter, getNewId } = useDynamicFilterStore(
1835
+ (state) => state.actions
1836
+ );
1837
+ const refPreviousPopoverFilterData = useRef(popoverFilterData);
1838
+ const statusLoad = useMemo(() => {
1839
+ let returnStatus;
1840
+ if (popoverFilterData && refPreviousPopoverFilterData.current === void 0) {
1841
+ returnStatus = "ready";
1842
+ } else if (!popoverFilterData) {
1843
+ returnStatus = "initial";
1844
+ } else {
1845
+ returnStatus = "reload_values_provider";
1846
+ }
1847
+ refPreviousPopoverFilterData.current = popoverFilterData;
1848
+ return returnStatus;
1849
+ }, [popoverFilterData]);
1850
+ if (popoverFilterData?.openFor === "add") {
1851
+ anchorEl = popoverFilterData?.fnAnchorEl();
1852
+ field = popoverFilterData.field;
1853
+ const helperField = fieldFactory(field.type);
1854
+ popupValidationSchema = helperField.getSchema(getLabel);
1855
+ filterFormValue = helperField.getFormValue(field, getLabel);
1856
+ formFilter = {
1857
+ field,
1858
+ id: getNewId(),
1859
+ isSet: true,
1860
+ fixed: false,
1861
+ ...filterFormValue
1862
+ };
1863
+ } else if (popoverFilterData) {
1864
+ anchorEl = popoverFilterData?.fnAnchorEl();
1865
+ field = popoverFilterData?.filter.field;
1866
+ const helperField = fieldFactory(field.type);
1867
+ popupValidationSchema = helperField.getSchema(getLabel);
1868
+ filterFormValue = helperField.getFormValue(field, getLabel, popoverFilterData.filter);
1869
+ formFilter = { ...popoverFilterData?.filter, ...filterFormValue };
1870
+ } else {
1871
+ filterFormValue = {};
1872
+ field = {};
1873
+ formFilter = {};
1874
+ anchorEl = {};
1875
+ }
1876
+ const onClose = useCallback(() => {
1877
+ hidePopoverFilter(false);
1878
+ }, []);
1879
+ const handleKeyDownPopper = useCallback((event) => {
1880
+ if (event.key === "Escape") {
1881
+ onClose();
1882
+ }
1883
+ }, []);
1884
+ function handleClosePopover() {
1885
+ hidePopoverFilter(false);
1886
+ }
1887
+ async function onSubmit(dataFieldValues) {
1888
+ const filterField = { ...filterFormValue, ...dataFieldValues };
1889
+ const newFilter = {
1890
+ ...formFilter,
1891
+ ...fieldFactory(filterField.fieldType).getFilterFromFormValue(filterField),
1892
+ isSet: true
1893
+ };
1894
+ if (popoverFilterData?.openFor === "add") {
1895
+ addFilter(newFilter);
1896
+ } else {
1897
+ updateFilter(newFilter);
1898
+ }
1899
+ hidePopoverFilter(false);
1900
+ }
1901
+ const labelField = field?.label ?? getLabel(field?.dictionaryId ?? "");
1902
+ return {
1903
+ field,
1904
+ labelField,
1905
+ canRender: Boolean(popoverFilterData),
1906
+ anchorEl,
1907
+ handleKeyDownPopper,
1908
+ handleClosePopover,
1909
+ onSubmit,
1910
+ onClose,
1911
+ filterFormValue,
1912
+ formFilter,
1913
+ popupValidationSchema,
1914
+ statusLoad
1915
+ };
1916
+ }
1917
+ function DataTypeComponent(props) {
1918
+ const { formFilter, statusLoad } = props;
1919
+ const { setFocus } = useFormContext();
1920
+ const Component = fieldFactory(formFilter.field.type).getComponent();
1921
+ useEffect(() => {
1922
+ setTimeout(() => setFocus("formValueOperand1"), 100);
1923
+ }, [statusLoad]);
1924
+ return /* @__PURE__ */ jsx(Component, {});
1925
+ }
1926
+ function PopoverFilter() {
1927
+ const {
1928
+ field,
1929
+ labelField,
1930
+ anchorEl,
1931
+ handleKeyDownPopper,
1932
+ handleClosePopover,
1933
+ onSubmit,
1934
+ onClose,
1935
+ filterFormValue,
1936
+ formFilter,
1937
+ popupValidationSchema,
1938
+ statusLoad,
1939
+ canRender
1940
+ } = usePopoverFilter();
1941
+ if (!canRender) {
1942
+ return null;
1943
+ }
1944
+ return /* @__PURE__ */ jsx(
1945
+ PopoverStyled,
1946
+ {
1947
+ open: true,
1948
+ disableRestoreFocus: true,
1949
+ transitionDuration: 0,
1950
+ anchorOrigin: { vertical: "bottom", horizontal: "left" },
1951
+ transformOrigin: { vertical: "top", horizontal: "left" },
1952
+ arrowType: "top-left",
1953
+ anchorEl,
1954
+ onKeyDown: handleKeyDownPopper,
1955
+ onClose: handleClosePopover,
1956
+ ownerState: {},
1957
+ children: /* @__PURE__ */ jsxs(
1958
+ RHFormProvider,
1959
+ {
1960
+ onSubmit,
1961
+ values: filterFormValue,
1962
+ validationSchema: popupValidationSchema,
1963
+ statusLoad,
1964
+ children: [
1965
+ /* @__PURE__ */ jsxs(PopoverHeaderStyled, { ownerState: {}, children: [
1966
+ field.urlIcon && /* @__PURE__ */ jsx(PopoverHeaderIconStyled, { src: field.urlIcon, ownerState: {} }),
1967
+ /* @__PURE__ */ jsx(PopoverHeaderTitleStyled, { variant: "paragraphDens", ownerState: {}, children: labelField })
1968
+ ] }),
1969
+ /* @__PURE__ */ jsx(PopoverContainerFieldsStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(DataTypeComponent, { formFilter, statusLoad }) }),
1970
+ /* @__PURE__ */ jsxs(PopoverHeaderActionsStyled, { ownerState: {}, children: [
1971
+ /* @__PURE__ */ jsx(ActionCancel, { onClick: onClose, skeletonWidth: "68px" }),
1972
+ /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "64px" })
1973
+ ] })
1974
+ ]
1975
+ }
1976
+ )
1977
+ }
1978
+ );
1979
+ }
1980
+ function DynamicFilterBase() {
1981
+ const { ownerState, dataTestId } = useDynamicFilterBase();
1982
+ return /* @__PURE__ */ jsx(
1983
+ RootStyled,
1984
+ {
1985
+ ownerState: { ...ownerState },
1986
+ ...getPropDataTestId(dataTestId, DynamicFilterSlots.root),
1987
+ children: /* @__PURE__ */ jsxs(
1988
+ InnerContainerStyled,
1989
+ {
1990
+ ownerState: { ...ownerState },
1991
+ ...getPropDataTestId(dataTestId, DynamicFilterSlots.innerContainer),
1992
+ children: [
1993
+ /* @__PURE__ */ jsx(InputFilter$1, {}),
1994
+ /* @__PURE__ */ jsx(AppliedFilters, {}),
1995
+ /* @__PURE__ */ jsx(FilterActions, {}),
1996
+ /* @__PURE__ */ jsx(PopoverFilter, {})
1997
+ ]
1998
+ }
1999
+ )
2000
+ }
2001
+ );
2002
+ }
2003
+ function DynamicFilter(props) {
2004
+ const hasPresentFlags = useFlagsPresent([CommonFlags.FLAG_DICTIONARY_LOADED]);
2005
+ if (!hasPresentFlags) {
2006
+ return null;
2007
+ }
2008
+ return /* @__PURE__ */ jsx(DynamicFilterProvider, { ...props, children: /* @__PURE__ */ jsx(DynamicFilterBase, {}) });
2009
+ }
2010
+ export {
2011
+ DynamicFilter as D
2012
+ };