@m4l/components 3.1.6 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/components/mui_extended/IconButton/index.d.ts +1 -1
  2. package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +2 -4
  3. package/index.js +183 -339
  4. package/node_modules-CQtkw0uG.js +7350 -0
  5. package/package.json +1 -1
  6. package/vendor-AfIOyqRr.js +24636 -0
  7. package/components/AccountPopover/index-BdnzI23R.js +0 -334
  8. package/components/AppBar/index-Dvrx1jsr.js +0 -93
  9. package/components/BaseModule/index-BQ2UIUCy.js +0 -30
  10. package/components/CommonActions/components/ActionCancel/index-DSVEMl41.js +0 -12
  11. package/components/CommonActions/components/ActionFormCancel/index-DMsGH0wx.js +0 -56
  12. package/components/CommonActions/components/ActionFormIntro/index-C8zb7R3W.js +0 -33
  13. package/components/CommonActions/components/ActionIntro/index-BNIG3KAH.js +0 -25
  14. package/components/CommonActions/components/Actions/index-90JsZTzb.js +0 -70
  15. package/components/DataGrid/constants-8L7QgBKi.js +0 -10
  16. package/components/DataGrid/formatters/ColumnBooleanFormatter/index-ZsSxUL_T.js +0 -26
  17. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-D-gZpvcm.js +0 -22
  18. package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
  19. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-kZGiDU5k.js +0 -23
  20. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
  21. package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
  22. package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
  23. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
  24. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
  25. package/components/DataGrid/formatters/index-iKq2iRoa.js +0 -13
  26. package/components/DataGrid/index-DGHnRo8z.js +0 -908
  27. package/components/DataGrid/subcomponents/Actions/index-BhBvobKS.js +0 -549
  28. package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
  29. package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
  30. package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
  31. package/components/DynamicFilter/dictionary-D9Z9YGDb.js +0 -51
  32. package/components/DynamicFilter/index-CRmtRWlr.js +0 -116
  33. package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
  34. package/components/DynamicFilter/slots/dynamicFilterSlots-CQiB8TmY.js +0 -151
  35. package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
  36. package/components/DynamicFilter/store/index-DoIifWTk.js +0 -254
  37. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-DQESCg04.js +0 -60
  38. package/components/DynamicFilter/subcomponents/AppliedFilters/index-CGmflaoY.js +0 -26
  39. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BfH6YHNi.js +0 -40
  40. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-Dv3KjuYK.js +0 -129
  41. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BnhNICK4.js +0 -171
  42. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-CNN6DeHY.js +0 -153
  43. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-C2dNPFtM.js +0 -146
  44. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-B03ahaU6.js +0 -114
  45. package/components/DynamicFilter/subcomponents/FieldTypes/index-EF7A6WnZ.js +0 -38
  46. package/components/DynamicFilter/subcomponents/FilterActions/index-CQtA2ELu.js +0 -88
  47. package/components/DynamicFilter/subcomponents/InputFilter/index-EXbXDSZA.js +0 -188
  48. package/components/DynamicFilter/subcomponents/PopoverFilter/index-BX8YCh9v.js +0 -158
  49. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DvAYf5-a.js +0 -63
  50. package/components/FieldLabel/index-C8od8D0w.js +0 -54
  51. package/components/GridLayout/index-EPw3AYiQ.js +0 -1044
  52. package/components/GridLayout/subcomponents/Griditem/index-B8Q7iMhr.js +0 -395
  53. package/components/GridLayout/subcomponents/Responsive/index-D6BbBdVx.js +0 -348
  54. package/components/GridLayout/subcomponents/SizeProvider/index-OhbtnEN4.js +0 -71
  55. package/components/HelperText/index-sLK3dYG0.js +0 -50
  56. package/components/Icon/index-BJF_0F6d.js +0 -176
  57. package/components/Image/index-BxphCFC7.js +0 -175
  58. package/components/LanguagePopover/index-CkKie1Ph.js +0 -179
  59. package/components/LinearProgressIndeterminate/index-CTvXOPRx.js +0 -55
  60. package/components/Loadable/index-BMbi9ISF.js +0 -9
  61. package/components/LoadingError/index-BaaPhmyF.js +0 -89
  62. package/components/MFIsolationApp/index-BfHLGDcN.js +0 -169
  63. package/components/MFLoader/index-B8FmSpE7.js +0 -299
  64. package/components/ModalDialog/index-WSVr5sZr.js +0 -77
  65. package/components/NavLink/index-CKgi5l5M.js +0 -55
  66. package/components/NoItemSelected/index-BKsZKc_f.js +0 -54
  67. package/components/ObjectLogs/index-BJkjYQaa.js +0 -233
  68. package/components/PDFViewer/index-Cnbioqzo.js +0 -51
  69. package/components/Page/index-DSSwuNSp.js +0 -117
  70. package/components/PaperForm/index-C1OKDnuY.js +0 -59
  71. package/components/Period/index-DYE7Bj45.js +0 -238
  72. package/components/PrintingSystem/index-BkfHXcTV.js +0 -187
  73. package/components/PrintingSystem/subcomponents/BodyNode/index-Btg2zXVQ.js +0 -49
  74. package/components/PrintingSystem/subcomponents/ChartNode/index-GLjhqKd2.js +0 -105
  75. package/components/PrintingSystem/subcomponents/DividerNode/index-D9T1MWQd.js +0 -20
  76. package/components/PrintingSystem/subcomponents/FooterNode/index-C3LET1ZY.js +0 -49
  77. package/components/PrintingSystem/subcomponents/GridNode/index-BPz7lGvC.js +0 -74
  78. package/components/PrintingSystem/subcomponents/HeaderNode/index-DY4Yci1r.js +0 -49
  79. package/components/PrintingSystem/subcomponents/PaperNode/index-BYoGJll5.js +0 -30
  80. package/components/PrintingSystem/subcomponents/PropertyValueNode/index-vFZ5Skyl.js +0 -47
  81. package/components/PrintingSystem/subcomponents/SectionNode/index-BNqGWpcj.js +0 -49
  82. package/components/PrintingSystem/subcomponents/TextBoxNode/index-wgdfWbfF.js +0 -24
  83. package/components/PropertyValue/index-dwO3Qo0Y.js +0 -264
  84. package/components/Resizeable/index-CHseEYjL.js +0 -20
  85. package/components/ScrollBar/index-BYMy_qJE.js +0 -35
  86. package/components/ScrollToTop/index-TxORk5dB.js +0 -12
  87. package/components/SideBar/index-DqKD_S9_.js +0 -758
  88. package/components/SplitLayout/index-D4lxi0ig.js +0 -89
  89. package/components/ToastContainer/index-jnQcIcV1.js +0 -191
  90. package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
  91. package/components/animate/LoadingScreen/index-CTGGa4Yt.js +0 -70
  92. package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
  93. package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
  94. package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
  95. package/components/animate/features-BbnE33u3.js +0 -5
  96. package/components/animate/index-9dC9NmWv.js +0 -89
  97. package/components/animate/variants/bounce-DanQqHAX.js +0 -101
  98. package/components/animate/variants/container-Dmpr6tg5.js +0 -22
  99. package/components/animate/variants/fade-CAOJNn06.js +0 -65
  100. package/components/animate/variants/index-l0sNRNKZ.js +0 -1
  101. package/components/animate/variants/transition-B9W5SWTa.js +0 -20
  102. package/components/areas/components/AreasAdmin/index-BU9AX60_.js +0 -699
  103. package/components/areas/components/AreasViewer/index-CPlZxIzK.js +0 -805
  104. package/components/areas/components/index-l0sNRNKZ.js +0 -1
  105. package/components/areas/constants-rqODZNZe.js +0 -6
  106. package/components/areas/contexts/AreasContext/index-DGguLxcX.js +0 -1110
  107. package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
  108. package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
  109. package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
  110. package/components/areas/dictionary-YUsP9beq.js +0 -36
  111. package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
  112. package/components/areas/hooks/useAreas/index-DBXtbtIu.js +0 -11
  113. package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
  114. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
  115. package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
  116. package/components/areas/icons-CwFr-alN.js +0 -24
  117. package/components/areas/index-B_Odny9h.js +0 -22
  118. package/components/commercial/AppBarCommercial/index-faX1fxjn.js +0 -28
  119. package/components/commercial/SectionCommercial/index-Dspd2Hd7.js +0 -56
  120. package/components/commercial/TopBar/index-zACdM_C0.js +0 -232
  121. package/components/commercial/index-9P0yOdH4.js +0 -81
  122. package/components/formatters/BooleanFormatter/index-PoFZ3r_m.js +0 -44
  123. package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
  124. package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
  125. package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
  126. package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
  127. package/components/formatters/index-CEJ6VCMb.js +0 -109
  128. package/components/hook-form/HelperError/index-DRvAkpwm.js +0 -19
  129. package/components/hook-form/RHFAutocomplete/index-DS57m8AX.js +0 -657
  130. package/components/hook-form/RHFAutocompleteAsync/index-Bu6NYmG_.js +0 -226
  131. package/components/hook-form/RHFCheckbox/index-BsB42rRc.js +0 -132
  132. package/components/hook-form/RHFColorPicker/index-Dox0FPrV.js +0 -191
  133. package/components/hook-form/RHFDateTime/index-ef19Az1N.js +0 -190
  134. package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
  135. package/components/hook-form/RHFPeriod/index-DyRLTD0w.js +0 -98
  136. package/components/hook-form/RHFRadioGroup/index-pgTLVF9t.js +0 -52
  137. package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
  138. package/components/hook-form/RHFTextField/index-BgsElxUF.js +0 -337
  139. package/components/hook-form/RHFUpload/index-B6m3ypzh.js +0 -253
  140. package/components/maps/components/GpsTools/index-CeLi75XZ.js +0 -1948
  141. package/components/maps/components/Map/index-D4B8Lfgv.js +0 -2545
  142. package/components/maps/index-Ci-7-FHg.js +0 -7
  143. package/components/modal/WindowBase-CkftshqR.js +0 -44
  144. package/components/modal/WindowConfirm-C5YnzF-B.js +0 -73
  145. package/components/modal/index-CydPIpKZ.js +0 -65
  146. package/components/mui_extended/Accordion/index-jF2uxSmi.js +0 -124
  147. package/components/mui_extended/Avatar/index-CHmsrmfc.js +0 -64
  148. package/components/mui_extended/Badge/index-B_BGIjkQ.js +0 -29
  149. package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
  150. package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
  151. package/components/mui_extended/Button/index-CgvCim_g.js +0 -222
  152. package/components/mui_extended/CheckBox-H73kpinr.js +0 -76
  153. package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
  154. package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
  155. package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
  156. package/components/mui_extended/IconButton/index-B8lOMybH.js +0 -117
  157. package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
  158. package/components/mui_extended/IconButton/types-l0sNRNKZ.js +0 -1
  159. package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
  160. package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
  161. package/components/mui_extended/MenuActions/MenuActions-DA_aS7o5.js +0 -149
  162. package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
  163. package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
  164. package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
  165. package/components/mui_extended/MenuActions/slots/MenuActionsSlots-BVp0M8fu.js +0 -47
  166. package/components/mui_extended/Pager/index-Dtk4aUiU.js +0 -257
  167. package/components/mui_extended/Popover/index-Dl1PwIS2.js +0 -153
  168. package/components/mui_extended/Stack/index-CRzpVi2a.js +0 -31
  169. package/components/mui_extended/Tab/index-DmrsMLOq.js +0 -129
  170. package/components/mui_extended/ToggleButton/index-CAnHC1N-.js +0 -18
  171. package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
  172. package/components/mui_extended/Typography/index-DXq1fG8k.js +0 -54
  173. package/components/mui_extended/index-l0sNRNKZ.js +0 -1
  174. package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
  175. package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
  176. package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
  177. package/components/popups/PopupsViewer/index-CMI1SK_O.js +0 -172
  178. package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
  179. package/components/popups/PopupsViewer/slots/popupsViewerSlots-DOkmuvnx.js +0 -46
  180. package/components/popups/index-l0sNRNKZ.js +0 -1
  181. package/contexts/ModalContext/index-Bp_s1qUm.js +0 -39
  182. package/contexts/RHFormContext/index-BQ0XWrpK.js +0 -78
  183. package/hocs/withToggle/index-C1_DMZD3.js +0 -14
  184. package/hooks/useFormAddEdit/index-dLVQB7hC.js +0 -90
  185. package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
  186. package/hooks/useModal/index-69rbrQ0v.js +0 -10
  187. package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
  188. package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
  189. package/hooks/useTab/index-DYRxOmMI.js +0 -12
  190. package/react-data-grid-BfYuZ6AK.js +0 -2606
  191. package/react-draggable-DsCPdgQP.js +0 -811
  192. package/react-json-view-bhqIAaNg.js +0 -2576
  193. package/react-resizable-eBbFl2dX.js +0 -618
  194. package/react-spinners-TpKN9lZg.js +0 -123
  195. package/react-splitter-layout-C-JTsNGs.js +0 -158
  196. package/styles/DynamicFilter-CJFsIegc.js +0 -319
  197. package/styles/MenuActions-lTi-ynPM.js +0 -42
  198. package/styles/index-CqpubQQr.js +0 -1691
  199. package/test/constants_no_mock-CF-669v-.js +0 -4
  200. package/test/getNameDataTestId-BaBTWhBr.js +0 -10
  201. package/utils/index-DiMrtgIu.js +0 -502
  202. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
  203. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
@@ -1,116 +0,0 @@
1
- import { f as fieldFactory } from "./subcomponents/FieldTypes/index-EF7A6WnZ.js";
2
- import { f as filterValidOperandsArraySelect } from "./subcomponents/FieldTypes/SelectFilter/index-C2dNPFtM.js";
3
- import { jsx } from "react/jsx-runtime";
4
- import { useFlagsPresent, CommonFlags } from "@m4l/core";
5
- import { D as DynamicFilterProvider } from "./store/index-DoIifWTk.js";
6
- import { D as DynamicFilterBase } from "./subcomponents/DynamicFilterBase/index-BfH6YHNi.js";
7
- function getPurgedInitialFiltersApplied(fields, initialFilters, getFieldByName) {
8
- const newFilters = [];
9
- const fixedFields = [];
10
- for (let index = 0; index < initialFilters.length; index++) {
11
- try {
12
- const initialFilter = initialFilters[index];
13
- const field = getFieldByName(initialFilter.name);
14
- const filter = {
15
- id: 0,
16
- isSet: true,
17
- fixed: false,
18
- field,
19
- fieldType: field.type,
20
- operator: initialFilters[index].operator,
21
- operand1: initialFilters[index].operand1,
22
- operand2: initialFilters[index].operand2,
23
- operandsArray: initialFilters[index].operandsArray
24
- };
25
- if (!field) continue;
26
- const canAddField = fieldFactory(field.type).verifyFilter(initialFilter, field);
27
- if (canAddField) {
28
- if (filter.fieldType === "datetime") {
29
- filter.operand1 = /* @__PURE__ */ new Date(filter.operand1 + "");
30
- filter.operand2 = /* @__PURE__ */ new Date(filter.operand2 + "");
31
- }
32
- if (field.presence === "fixed") {
33
- if (fixedFields.findIndex((f) => f === field.name) === -1) {
34
- filter.fixed = true;
35
- fixedFields.push(field.name);
36
- } else {
37
- filter.fixed = false;
38
- }
39
- }
40
- filter.isSet = true;
41
- filter.id = newFilters.length + 1;
42
- newFilters.push(filter);
43
- }
44
- } catch (error) {
45
- }
46
- }
47
- for (let index = 0; index < fields.length; index++) {
48
- const field = fields[index];
49
- if (field.presence === "initialized" || field.presence === "fixed") {
50
- if (!initialFilters.find((f) => f.name === field.name)) {
51
- const newFilter = fieldFactory(field.type).getDefaultFilter(
52
- field,
53
- field.presence === "fixed"
54
- );
55
- newFilter.id = newFilters.length + 1;
56
- newFilters.push(newFilter);
57
- }
58
- }
59
- }
60
- return newFilters;
61
- }
62
- const formatToRawFilter = (appliedFilters) => {
63
- return appliedFilters.map((af) => {
64
- let oa = void 0;
65
- if (af.field.type === "select" && af.operandsArray) {
66
- oa = Array.isArray(af.operandsArray) ? af.operandsArray.map(af.field.selectOptions.getOptionId) : [af.field.selectOptions.getOptionId(af.operandsArray)];
67
- }
68
- return {
69
- n: af.field.name,
70
- o: af.operator,
71
- o1: af.operand1,
72
- o2: af.operator === "b" ? af.operand2 : void 0,
73
- oa
74
- };
75
- });
76
- };
77
- function formatToInitialFilters(appliedFilters) {
78
- return appliedFilters.map((appliedFilter) => {
79
- const ret = {
80
- name: appliedFilter.field.name,
81
- operator: appliedFilter.operator,
82
- operand1: appliedFilter.operand1,
83
- operand2: appliedFilter.operator === "b" ? appliedFilter.operand2 : void 0
84
- };
85
- if (appliedFilter.fieldType === "datetime") {
86
- ret.operand1 = appliedFilter.operand1.toISOString();
87
- ret.operand2 = appliedFilter.operator === "b" ? appliedFilter.operand2.toISOString() : void 0;
88
- }
89
- if (appliedFilter.fieldType === "select") {
90
- const validOperandsArray = filterValidOperandsArraySelect(
91
- appliedFilter.operandsArray,
92
- appliedFilter.field
93
- );
94
- if (validOperandsArray && validOperandsArray?.length > 0) {
95
- ret.operandsArray = validOperandsArray;
96
- }
97
- }
98
- if (ret.operand2 === void 0) {
99
- delete ret.operand2;
100
- }
101
- return ret;
102
- });
103
- }
104
- function DynamicFilter(props) {
105
- const hasPresentFlags = useFlagsPresent([CommonFlags.FLAG_DICTIONARY_LOADED]);
106
- if (!hasPresentFlags) {
107
- return null;
108
- }
109
- return /* @__PURE__ */ jsx(DynamicFilterProvider, { ...props, children: /* @__PURE__ */ jsx(DynamicFilterBase, {}) });
110
- }
111
- export {
112
- DynamicFilter as D,
113
- formatToRawFilter as a,
114
- formatToInitialFilters as f,
115
- getPurgedInitialFiltersApplied as g
116
- };
@@ -1,34 +0,0 @@
1
- var DynamicFilterSlots = /* @__PURE__ */ ((DynamicFilterSlots2) => {
2
- DynamicFilterSlots2["root"] = "root";
3
- DynamicFilterSlots2["innerContainer"] = "innerContainer";
4
- DynamicFilterSlots2["inputFilter"] = "inputFilter";
5
- DynamicFilterSlots2["inputFilterInput"] = "inputFilterInput";
6
- DynamicFilterSlots2["inputFilterIcon"] = "inputFilterIcon";
7
- DynamicFilterSlots2["appliedFilters"] = "appliedFilters";
8
- DynamicFilterSlots2["appliedFilterInnerContainer"] = "appliedFilterInnerContainer";
9
- DynamicFilterSlots2["appliedFilterChip"] = "appliedFilterChip";
10
- DynamicFilterSlots2["appliedFilterChipIcon"] = "appliedFilterChipIcon";
11
- DynamicFilterSlots2["appliedFilterChipInfo"] = "appliedFilterChipInfo";
12
- DynamicFilterSlots2["appliedFilterChipInfoFieldName"] = "appliedFilterChipInfoFieldName";
13
- DynamicFilterSlots2["appliedFilterChipInfoOperator"] = "appliedFilterChipInfoOperator";
14
- DynamicFilterSlots2["appliedFilterChipInfoOperands"] = "appliedFilterChipInfoOperands";
15
- DynamicFilterSlots2["appliedFilterChipRemoveButton"] = "appliedFilterChipRemoveButton";
16
- DynamicFilterSlots2["actions"] = "actions";
17
- DynamicFilterSlots2["actionsSkeletonButton"] = "actionsSkeletonButton";
18
- DynamicFilterSlots2["actionsClearButton"] = "actionsClearButton";
19
- DynamicFilterSlots2["actionsSubmitButton"] = "actionsSubmitButton";
20
- DynamicFilterSlots2["popoverMenu"] = "popoverMenu";
21
- DynamicFilterSlots2["popoverMenuItem"] = "popoverMenuItem";
22
- DynamicFilterSlots2["popoverMenuItemIcon"] = "popoverMenuItemIcon";
23
- DynamicFilterSlots2["popoverMenuItemLabel"] = "popoverMenuItemLabel";
24
- DynamicFilterSlots2["popoverFilter"] = "popoverFilter";
25
- DynamicFilterSlots2["popoverFilterContainerFields"] = "popoverFilterContainerFields";
26
- DynamicFilterSlots2["popoverFilterHeader"] = "popoverFilterHeader";
27
- DynamicFilterSlots2["popoverFilterHeaderIcon"] = "popoverFilterHeaderIcon";
28
- DynamicFilterSlots2["popoverFilterHeaderTitle"] = "popoverFilterHeaderTitle";
29
- DynamicFilterSlots2["popoverFilterActions"] = "popoverFilterActions";
30
- return DynamicFilterSlots2;
31
- })(DynamicFilterSlots || {});
32
- export {
33
- DynamicFilterSlots as D
34
- };
@@ -1,151 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
- import { D as DYNAMIC_FILTER_KEY_COMPONENT } from "../constants-ByqmFATV.js";
3
- import { D as DynamicFilterSlots } from "./SlotsEnum-cawFeNzx.js";
4
- import { d as dynamicFilterStyles } from "../../../styles/DynamicFilter-CJFsIegc.js";
5
- import { MenuItem } from "@mui/material";
6
- import { A as Actions } from "../../CommonActions/components/Actions/index-90JsZTzb.js";
7
- import { I as Icon } from "../../Icon/index-BJF_0F6d.js";
8
- import { I as IconButton } from "../../mui_extended/IconButton/index-B8lOMybH.js";
9
- import { P as Popover } from "../../mui_extended/Popover/index-Dl1PwIS2.js";
10
- import { T as Typography } from "../../mui_extended/Typography/index-DXq1fG8k.js";
11
- const RootStyled = styled("div", { name: DYNAMIC_FILTER_KEY_COMPONENT, slot: DynamicFilterSlots.root })(
12
- dynamicFilterStyles?.root
13
- );
14
- const InnerContainerStyled = styled("div", {
15
- name: DYNAMIC_FILTER_KEY_COMPONENT,
16
- slot: DynamicFilterSlots.innerContainer
17
- })(dynamicFilterStyles?.innerContainer);
18
- const InputFilterStyled = styled("div", {
19
- name: DYNAMIC_FILTER_KEY_COMPONENT,
20
- slot: DynamicFilterSlots.inputFilter
21
- })(dynamicFilterStyles?.inputFilter);
22
- const InputFilterInputStyled = styled("input", {
23
- name: DYNAMIC_FILTER_KEY_COMPONENT,
24
- slot: DynamicFilterSlots.inputFilterInput
25
- })(dynamicFilterStyles?.inputFilterInput);
26
- const InputFilterIconStyled = styled(Icon, {
27
- name: DYNAMIC_FILTER_KEY_COMPONENT,
28
- slot: DynamicFilterSlots.inputFilterIcon
29
- })(dynamicFilterStyles?.inputFilterIcon);
30
- const AppliedFiltersStyled = styled("div", {
31
- name: DYNAMIC_FILTER_KEY_COMPONENT,
32
- slot: DynamicFilterSlots.appliedFilters
33
- })(dynamicFilterStyles?.appliedFilters);
34
- const AppliedFilterInnerContainerStyled = styled("div", {
35
- name: DYNAMIC_FILTER_KEY_COMPONENT,
36
- slot: DynamicFilterSlots.appliedFilterInnerContainer
37
- })(dynamicFilterStyles?.appliedFilterInnerContainer);
38
- const AppliedFilterChipStyled = styled("div", {
39
- name: DYNAMIC_FILTER_KEY_COMPONENT,
40
- slot: DynamicFilterSlots.appliedFilterChip
41
- })(dynamicFilterStyles?.appliedFilterChip);
42
- const AppliedFilterChipIconStyled = styled(IconButton, {
43
- name: DYNAMIC_FILTER_KEY_COMPONENT,
44
- slot: DynamicFilterSlots.appliedFilterChipIcon
45
- })(dynamicFilterStyles?.appliedFilterChipIcon);
46
- const AppliedFilterChipInfoStyled = styled("button", {
47
- name: DYNAMIC_FILTER_KEY_COMPONENT,
48
- slot: DynamicFilterSlots.appliedFilterChipInfo
49
- })(dynamicFilterStyles?.appliedFilterChipInfo);
50
- const AppliedFilterChipInfoFieldNameStyled = styled("span", {
51
- name: DYNAMIC_FILTER_KEY_COMPONENT,
52
- slot: DynamicFilterSlots.appliedFilterChipInfoFieldName
53
- })(dynamicFilterStyles?.appliedFilterChipInfoFieldName);
54
- const AppliedFilterChipInfoOperatorStyled = styled("span", {
55
- name: DYNAMIC_FILTER_KEY_COMPONENT,
56
- slot: DynamicFilterSlots.appliedFilterChipInfoOperator
57
- })(dynamicFilterStyles?.appliedFilterChipInfoOperator);
58
- const AppliedFilterChipInfoOperandsStyled = styled("span", {
59
- name: DYNAMIC_FILTER_KEY_COMPONENT,
60
- slot: DynamicFilterSlots.appliedFilterChipInfoOperands
61
- })(dynamicFilterStyles?.appliedFilterChipInfoOperands);
62
- const AppliedFilterChipRemoveButtonStyled = styled(IconButton, {
63
- name: DYNAMIC_FILTER_KEY_COMPONENT,
64
- slot: DynamicFilterSlots.appliedFilterChipRemoveButton
65
- })(dynamicFilterStyles?.appliedFilterChipRemoveButton);
66
- const ActionsStyled = styled("div", {
67
- name: DYNAMIC_FILTER_KEY_COMPONENT,
68
- slot: DynamicFilterSlots.actions
69
- })(dynamicFilterStyles?.actions);
70
- const ActionsSkeletonButtonStyled = styled("div", {
71
- name: DYNAMIC_FILTER_KEY_COMPONENT,
72
- slot: DynamicFilterSlots.actionsSkeletonButton
73
- })(dynamicFilterStyles?.actionsSkeletonButton);
74
- const ActionsClearButtonStyled = styled(IconButton, {
75
- name: DYNAMIC_FILTER_KEY_COMPONENT,
76
- slot: DynamicFilterSlots.actionsClearButton
77
- })(dynamicFilterStyles?.actionsClearButton);
78
- const ActionsSubmitButtonStyled = styled(IconButton, {
79
- name: DYNAMIC_FILTER_KEY_COMPONENT,
80
- slot: DynamicFilterSlots.actionsSubmitButton
81
- })(dynamicFilterStyles?.actionsSubmitButton);
82
- const PopoverMenuStyled = styled(Popover, {
83
- name: DYNAMIC_FILTER_KEY_COMPONENT,
84
- slot: DynamicFilterSlots.popoverMenu
85
- })(dynamicFilterStyles?.popoverMenu);
86
- const PopoverMenuItemStyled = styled(MenuItem, {
87
- name: DYNAMIC_FILTER_KEY_COMPONENT,
88
- slot: DynamicFilterSlots.popoverMenuItem
89
- })(dynamicFilterStyles?.popoverMenuItem);
90
- const PopoverMenuItemIconStyled = styled(Icon, {
91
- name: DYNAMIC_FILTER_KEY_COMPONENT,
92
- slot: DynamicFilterSlots.popoverMenuItemIcon
93
- })(dynamicFilterStyles?.popoverMenuItemIcon);
94
- const PopoverMenuItemLabelStyled = styled("div", {
95
- name: DYNAMIC_FILTER_KEY_COMPONENT,
96
- slot: DynamicFilterSlots.popoverMenuItemLabel
97
- })(dynamicFilterStyles?.popoverMenuItemLabel);
98
- const PopoverStyled = styled(Popover, {
99
- name: DYNAMIC_FILTER_KEY_COMPONENT,
100
- slot: DynamicFilterSlots.popoverFilter
101
- })(dynamicFilterStyles?.popoverFilter);
102
- const PopoverContainerFieldsStyled = styled("div", {
103
- name: DYNAMIC_FILTER_KEY_COMPONENT,
104
- slot: DynamicFilterSlots.popoverFilterContainerFields
105
- })(dynamicFilterStyles?.popoverFilterContainerFields);
106
- const PopoverHeaderStyled = styled("div", {
107
- name: DYNAMIC_FILTER_KEY_COMPONENT,
108
- slot: DynamicFilterSlots.popoverFilterHeader
109
- })(dynamicFilterStyles?.popoverFilterHeader);
110
- const PopoverHeaderIconStyled = styled(Icon, {
111
- name: DYNAMIC_FILTER_KEY_COMPONENT,
112
- slot: DynamicFilterSlots.popoverFilterHeaderIcon
113
- })(dynamicFilterStyles?.popoverFilterHeaderIcon);
114
- const PopoverHeaderTitleStyled = styled(Typography, {
115
- name: DYNAMIC_FILTER_KEY_COMPONENT,
116
- slot: DynamicFilterSlots.popoverFilterHeaderTitle
117
- })(dynamicFilterStyles?.popoverFilterHeaderTitle);
118
- const PopoverHeaderActionsStyled = styled(Actions, {
119
- name: DYNAMIC_FILTER_KEY_COMPONENT,
120
- slot: DynamicFilterSlots.popoverFilterActions
121
- })(dynamicFilterStyles?.popoverFilterActions);
122
- export {
123
- AppliedFilterChipStyled as A,
124
- InnerContainerStyled as I,
125
- PopoverStyled as P,
126
- RootStyled as R,
127
- AppliedFilterChipIconStyled as a,
128
- AppliedFilterChipInfoStyled as b,
129
- AppliedFilterChipInfoFieldNameStyled as c,
130
- AppliedFilterChipInfoOperatorStyled as d,
131
- AppliedFilterChipInfoOperandsStyled as e,
132
- AppliedFilterChipRemoveButtonStyled as f,
133
- AppliedFiltersStyled as g,
134
- AppliedFilterInnerContainerStyled as h,
135
- ActionsSkeletonButtonStyled as i,
136
- ActionsStyled as j,
137
- ActionsClearButtonStyled as k,
138
- ActionsSubmitButtonStyled as l,
139
- InputFilterStyled as m,
140
- InputFilterIconStyled as n,
141
- InputFilterInputStyled as o,
142
- PopoverHeaderStyled as p,
143
- PopoverHeaderIconStyled as q,
144
- PopoverHeaderTitleStyled as r,
145
- PopoverContainerFieldsStyled as s,
146
- PopoverHeaderActionsStyled as t,
147
- PopoverMenuStyled as u,
148
- PopoverMenuItemStyled as v,
149
- PopoverMenuItemIconStyled as w,
150
- PopoverMenuItemLabelStyled as x
151
- };
@@ -1,254 +0,0 @@
1
- import { useContext, createContext, useRef, useEffect } from "react";
2
- import { useStore, createStore } from "zustand";
3
- import { shallow } from "zustand/shallow";
4
- import { jsx } from "react/jsx-runtime";
5
- import { useModuleDictionary, useEnvironment, useModuleSkeleton } from "@m4l/core";
6
- import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
7
- import { A as ALL_FIELD } from "../constants-ByqmFATV.js";
8
- import { g as getPurgedInitialFiltersApplied, f as formatToInitialFilters, a as formatToRawFilter } from "../index-CRmtRWlr.js";
9
- import { devtools } from "zustand/middleware";
10
- import { immer } from "zustand/middleware/immer";
11
- function useDynamicFilterStore(selector, equalityFn) {
12
- const store = useContext(DynamicFilterContext);
13
- if (!store)
14
- throw new Error("useDynamicFilterStore context must be use inside DynamicFilterContext");
15
- return useStore(store, selector, shallow);
16
- }
17
- function updateAvailableFields(state) {
18
- state.availableFields = state.fields.filter((field) => {
19
- if (field.multiple === void 0 || field.multiple) {
20
- return true;
21
- }
22
- const appliedFilterNames = new Set(state.appliedFilters.map((f) => f.field.name));
23
- return !appliedFilterNames.has(field.name);
24
- });
25
- }
26
- function updateOwnerStateIsValid(state) {
27
- state.ownerState.isValid = state.appliedFilters.every((filter) => filter.isSet);
28
- }
29
- const updateAutomatic = (state) => {
30
- updateOwnerStateIsValid(state);
31
- updateAvailableFields(state);
32
- if (state.ownerState.isValid && state.automatic) {
33
- state.ownerState.isDirty = false;
34
- state.countOnChangeFiltersApplied++;
35
- }
36
- };
37
- const createAreaStore = (initProps) => {
38
- const startProps = {
39
- countOnChangeFiltersApplied: 0,
40
- appliedFilters: [],
41
- availableFields: [],
42
- fnAnchorEl: void 0,
43
- popoverFilterData: void 0,
44
- inputData: "",
45
- ...initProps
46
- };
47
- return createStore(
48
- devtools(
49
- immer((set, get) => ({
50
- ...startProps,
51
- actions: {
52
- init: (initialFiltersApplied) => {
53
- set((state) => {
54
- state.appliedFilters = getPurgedInitialFiltersApplied(
55
- state.fields,
56
- initialFiltersApplied,
57
- state.actions.getFieldByName
58
- );
59
- state.ownerState.isEmpty = state.appliedFilters.length <= 0;
60
- updateAutomatic(state);
61
- });
62
- },
63
- getFieldByName: (name) => {
64
- const field = (get().withAllField ? get().fields.concat(get().allField) : get().fields).find((f) => {
65
- return f.name === name;
66
- });
67
- if (field) {
68
- return field;
69
- }
70
- throw new Error("No exist field");
71
- },
72
- removeFilter: (id) => {
73
- set((state) => {
74
- const indexToRemoved = state.appliedFilters.findIndex((f) => id === f.id && !f.fixed);
75
- if (indexToRemoved > -1) {
76
- state.appliedFilters.splice(indexToRemoved, 1);
77
- state.ownerState.isEmpty = state.appliedFilters.length === 0;
78
- updateAutomatic(state);
79
- }
80
- });
81
- },
82
- showPopoverFilterForAdd: (anchorEl, field) => {
83
- set((state) => {
84
- state.fnAnchorEl = void 0;
85
- state.inputData = "";
86
- state.popoverFilterData = {
87
- openFor: "add",
88
- fnAnchorEl: () => anchorEl,
89
- field
90
- };
91
- });
92
- get().actions.setInEdition(true);
93
- },
94
- showPopoverFilterForEdit: (anchorEl, filterToEdit) => {
95
- set((state) => {
96
- state.popoverFilterData = {
97
- openFor: "edit",
98
- fnAnchorEl: () => anchorEl,
99
- filter: filterToEdit,
100
- field: filterToEdit.field
101
- };
102
- });
103
- get().actions.setInEdition(true);
104
- },
105
- hidePopoverFilter: (stayInEdition) => {
106
- set((state) => {
107
- state.popoverFilterData = void 0;
108
- });
109
- get().actions.setInEdition(stayInEdition);
110
- },
111
- clearFilters: () => {
112
- set((state) => {
113
- state.appliedFilters = state.appliedFilters.filter((f) => f.fixed);
114
- state.ownerState.isEmpty = state.appliedFilters.length === 0;
115
- updateAvailableFields(state);
116
- });
117
- },
118
- fireOnChangeFilters: () => {
119
- set((state) => {
120
- if (state.ownerState.isValid) {
121
- state.ownerState.isDirty = false;
122
- state.countOnChangeFiltersApplied++;
123
- }
124
- });
125
- },
126
- getNewId: () => {
127
- return get().appliedFilters.reduce((prev, filterField) => {
128
- return filterField.id > prev ? filterField.id : prev;
129
- }, 0) + 1;
130
- },
131
- addFilter: (newFilter) => {
132
- set((state) => {
133
- state.appliedFilters.push(newFilter);
134
- state.ownerState.isEmpty = state.appliedFilters.length === 0;
135
- updateAutomatic(state);
136
- });
137
- },
138
- updateFilter: (editFilter) => {
139
- set((state) => {
140
- const index = state.appliedFilters.findIndex(
141
- (filterField) => filterField.id === editFilter.id
142
- );
143
- if (index > -1) {
144
- state.appliedFilters[index] = editFilter;
145
- }
146
- updateAutomatic(state);
147
- });
148
- },
149
- setInputData: (inputData) => {
150
- set((state) => {
151
- state.inputData = inputData;
152
- });
153
- },
154
- setInEdition: (newInEdition) => {
155
- set((state) => {
156
- state.ownerState.inEdition = newInEdition;
157
- });
158
- },
159
- setExternalState: (newExternalState) => {
160
- set((state) => {
161
- state.ownerState = { ...state.ownerState, ...newExternalState };
162
- });
163
- },
164
- openPopoverMenuFields: (anchorEl) => {
165
- set((state) => {
166
- state.fnAnchorEl = () => anchorEl;
167
- });
168
- },
169
- closePopoverMenuFields: (newInEdition) => {
170
- set((state) => {
171
- state.fnAnchorEl = void 0;
172
- state.ownerState.inEdition = newInEdition || false;
173
- });
174
- }
175
- }
176
- })),
177
- { name: `Dynamic filter` }
178
- )
179
- );
180
- };
181
- const DynamicFilterContext = createContext(null);
182
- function DynamicFilterProvider(props) {
183
- const {
184
- automatic = true,
185
- withAllField = true,
186
- fields,
187
- initialAppliedFilters = [],
188
- onChangeFilters,
189
- dataTestId = "",
190
- children
191
- } = props;
192
- const { getLabel } = useModuleDictionary();
193
- const dynamicFilterStoreRef = useRef();
194
- const { host_static_assets, environment_assets } = useEnvironment();
195
- const isDesktop = useResponsiveDesktop();
196
- const isSkeleton = useModuleSkeleton();
197
- const isFirstRender = useFirstRender([isDesktop, isSkeleton]);
198
- if (!dynamicFilterStoreRef.current) {
199
- dynamicFilterStoreRef.current = createAreaStore({
200
- allField: {
201
- ...ALL_FIELD,
202
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
203
- },
204
- withAllField,
205
- fields,
206
- automatic,
207
- getLabel,
208
- dataTestId,
209
- ownerState: {
210
- isSkeleton,
211
- isDirty: !automatic,
212
- inEdition: false,
213
- isValid: true,
214
- isMobile: !isDesktop,
215
- isEmpty: true
216
- }
217
- });
218
- dynamicFilterStoreRef.current.getState().actions.init(initialAppliedFilters);
219
- }
220
- const countOnChangeFiltersApplied = useStore(
221
- dynamicFilterStoreRef.current,
222
- (state) => state.countOnChangeFiltersApplied,
223
- shallow
224
- );
225
- useEffect(() => {
226
- if (countOnChangeFiltersApplied === 0) {
227
- return;
228
- }
229
- const state = dynamicFilterStoreRef.current?.getState();
230
- if (state) {
231
- onChangeFilters?.(
232
- formatToInitialFilters(state.appliedFilters),
233
- formatToRawFilter(state.appliedFilters)
234
- );
235
- }
236
- }, [countOnChangeFiltersApplied]);
237
- useEffect(() => {
238
- if (isFirstRender) {
239
- return;
240
- }
241
- dynamicFilterStoreRef.current?.getState().actions.setExternalState({ isMobile: !isDesktop, isSkeleton });
242
- }, [isDesktop, isSkeleton]);
243
- useEffect(() => {
244
- if (automatic) {
245
- dynamicFilterStoreRef.current?.getState().actions.fireOnChangeFilters();
246
- return;
247
- }
248
- }, []);
249
- return /* @__PURE__ */ jsx(DynamicFilterContext.Provider, { value: dynamicFilterStoreRef.current, children });
250
- }
251
- export {
252
- DynamicFilterProvider as D,
253
- useDynamicFilterStore as u
254
- };
@@ -1,60 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
4
- import { useFormatter } from "@m4l/graphics";
5
- import { u as useDynamicFilterStore } from "../../store/index-DoIifWTk.js";
6
- import { f as fieldFactory } from "../FieldTypes/index-EF7A6WnZ.js";
7
- import { A as AppliedFilterChipStyled, a as AppliedFilterChipIconStyled, b as AppliedFilterChipInfoStyled, c as AppliedFilterChipInfoFieldNameStyled, d as AppliedFilterChipInfoOperatorStyled, e as AppliedFilterChipInfoOperandsStyled, f as AppliedFilterChipRemoveButtonStyled } from "../../slots/dynamicFilterSlots-CQiB8TmY.js";
8
- function useAppliedFilterChip(filter) {
9
- const { host_static_assets, environment_assets } = useEnvironment();
10
- const { getLabel } = useModuleDictionary();
11
- const formatters = useFormatter();
12
- const { hidePopoverFilter, removeFilter, showPopoverFilterForEdit } = useDynamicFilterStore(
13
- (state) => state.actions
14
- );
15
- const removeIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/clear.svg`;
16
- const labels = useMemo(() => {
17
- return fieldFactory(filter.field.type).getLabels(filter, getLabel, formatters, filter.field);
18
- }, [filter, getLabel]);
19
- function onDelete() {
20
- hidePopoverFilter(false);
21
- removeFilter(filter.id);
22
- }
23
- function onEditFilter(event) {
24
- hidePopoverFilter(false);
25
- const currentTarget = event.currentTarget;
26
- setTimeout(() => showPopoverFilterForEdit(currentTarget, filter), 10);
27
- }
28
- return {
29
- onDelete,
30
- onEditFilter,
31
- removeIconUrl,
32
- iconFieldUrl: filter.field?.urlIcon,
33
- labels
34
- };
35
- }
36
- function AppliedFilterChip(props) {
37
- const { fixed } = props;
38
- const { onEditFilter, onDelete, iconFieldUrl, removeIconUrl, labels } = useAppliedFilterChip(props);
39
- return /* @__PURE__ */ jsxs(AppliedFilterChipStyled, { ownerState: {}, children: [
40
- iconFieldUrl && /* @__PURE__ */ jsx(AppliedFilterChipIconStyled, { onClick: onEditFilter, src: iconFieldUrl, ownerState: {} }),
41
- /* @__PURE__ */ jsxs(AppliedFilterChipInfoStyled, { onClick: onEditFilter, ownerState: {}, children: [
42
- /* @__PURE__ */ jsx(AppliedFilterChipInfoFieldNameStyled, { ownerState: {}, children: labels.labelField }),
43
- /* @__PURE__ */ jsx(AppliedFilterChipInfoOperatorStyled, { ownerState: {}, children: labels.labelOperator }),
44
- /* @__PURE__ */ jsx(AppliedFilterChipInfoOperandsStyled, { ownerState: {}, children: labels.labelOperands })
45
- ] }),
46
- !fixed && /* @__PURE__ */ jsx(
47
- AppliedFilterChipRemoveButtonStyled,
48
- {
49
- src: removeIconUrl,
50
- size: "small",
51
- dictionaryTooltipId: "dynamic_filter.tooltip_clear_filter",
52
- onClick: onDelete,
53
- ownerState: {}
54
- }
55
- )
56
- ] });
57
- }
58
- export {
59
- AppliedFilterChip as A
60
- };
@@ -1,26 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { S as ScrollBar } from "../../../ScrollBar/index-BYMy_qJE.js";
3
- import { u as useDynamicFilterStore } from "../../store/index-DoIifWTk.js";
4
- import { g as AppliedFiltersStyled, h as AppliedFilterInnerContainerStyled } from "../../slots/dynamicFilterSlots-CQiB8TmY.js";
5
- import { A as AppliedFilterChip } from "../AppliedFilterChip/index-DQESCg04.js";
6
- function useAppliedFilters() {
7
- const appliedFilter = useDynamicFilterStore((state) => state.appliedFilters);
8
- const isSkeleton = useDynamicFilterStore((state) => state.ownerState.isSkeleton);
9
- const appliedFiltersSorted = [...appliedFilter].sort(
10
- (filterA, filterB) => filterA.isSet !== filterB.isSet ? Number(filterA.isSet) - Number(filterB.isSet) : filterB.id - filterA.id
11
- );
12
- return {
13
- appliedFiltersSorted,
14
- isSkeleton
15
- };
16
- }
17
- function AppliedFilters() {
18
- const { appliedFiltersSorted, isSkeleton } = useAppliedFilters();
19
- if (isSkeleton) {
20
- return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {} });
21
- }
22
- return /* @__PURE__ */ jsx(AppliedFiltersStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx(AppliedFilterInnerContainerStyled, { ownerState: {}, children: appliedFiltersSorted?.map((filter) => /* @__PURE__ */ jsx(AppliedFilterChip, { ...filter }, filter.id)) }) }) });
23
- }
24
- export {
25
- AppliedFilters as A
26
- };
@@ -1,40 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { u as useDynamicFilterStore } from "../../store/index-DoIifWTk.js";
3
- import { a as getPropDataTestId } from "../../../../test/getNameDataTestId-BaBTWhBr.js";
4
- import { R as RootStyled, I as InnerContainerStyled } from "../../slots/dynamicFilterSlots-CQiB8TmY.js";
5
- import { D as DynamicFilterSlots } from "../../slots/SlotsEnum-cawFeNzx.js";
6
- import { I as InputFilter } from "../InputFilter/index-EXbXDSZA.js";
7
- import { A as AppliedFilters } from "../AppliedFilters/index-CGmflaoY.js";
8
- import { F as FilterActions } from "../FilterActions/index-CQtA2ELu.js";
9
- import { P as PopoverFilter } from "../PopoverFilter/index-BX8YCh9v.js";
10
- function useDynamicFilterBase() {
11
- const ownerState = useDynamicFilterStore((state) => state.ownerState);
12
- const dataTestId = useDynamicFilterStore((state) => state.dataTestId);
13
- return { ownerState, dataTestId };
14
- }
15
- function DynamicFilterBase() {
16
- const { ownerState, dataTestId } = useDynamicFilterBase();
17
- return /* @__PURE__ */ jsx(
18
- RootStyled,
19
- {
20
- ownerState: { ...ownerState },
21
- ...getPropDataTestId(dataTestId, DynamicFilterSlots.root),
22
- children: /* @__PURE__ */ jsxs(
23
- InnerContainerStyled,
24
- {
25
- ownerState: { ...ownerState },
26
- ...getPropDataTestId(dataTestId, DynamicFilterSlots.innerContainer),
27
- children: [
28
- /* @__PURE__ */ jsx(InputFilter, {}),
29
- /* @__PURE__ */ jsx(AppliedFilters, {}),
30
- /* @__PURE__ */ jsx(FilterActions, {}),
31
- /* @__PURE__ */ jsx(PopoverFilter, {})
32
- ]
33
- }
34
- )
35
- }
36
- );
37
- }
38
- export {
39
- DynamicFilterBase as D
40
- };