@multiplatform.one/backoffice 7.28.1 → 7.29.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 (269) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/desk/DeskSurface.native.js.map +1 -1
  3. package/dist/cjs/form/DocFormScreen.cjs +167 -224
  4. package/dist/cjs/form/DocFormScreen.native.js +182 -259
  5. package/dist/cjs/form/DocFormScreen.native.js.map +1 -1
  6. package/dist/cjs/i18n/en.cjs +1 -0
  7. package/dist/cjs/i18n/en.native.js +1 -0
  8. package/dist/cjs/i18n/en.native.js.map +1 -1
  9. package/dist/cjs/list/ListBulkActionsBar.cjs +30 -18
  10. package/dist/cjs/list/ListBulkActionsBar.native.js +43 -31
  11. package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
  12. package/dist/cjs/list/sidebar-section.cjs +15 -7
  13. package/dist/cjs/list/sidebar-section.native.js +16 -7
  14. package/dist/cjs/list/sidebar-section.native.js.map +1 -1
  15. package/dist/cjs/report/DoctypeReportView.cjs +20 -374
  16. package/dist/cjs/report/DoctypeReportView.native.js +23 -455
  17. package/dist/cjs/report/DoctypeReportView.native.js.map +1 -1
  18. package/dist/cjs/report/QueryReportScreen.cjs +33 -23
  19. package/dist/cjs/report/QueryReportScreen.native.js +33 -23
  20. package/dist/cjs/report/QueryReportScreen.native.js.map +1 -1
  21. package/dist/cjs/report/queryReportColumns.cjs +3 -105
  22. package/dist/cjs/report/queryReportColumns.native.js +2 -129
  23. package/dist/cjs/report/queryReportColumns.native.js.map +1 -1
  24. package/dist/cjs/report/queryReportFilterBar.cjs +3 -4
  25. package/dist/cjs/report/queryReportFilterBar.native.js +3 -4
  26. package/dist/cjs/report/queryReportFilterBar.native.js.map +1 -1
  27. package/dist/cjs/report/queryReportUrlState.cjs +2 -2
  28. package/dist/cjs/report/queryReportUrlState.native.js +2 -2
  29. package/dist/cjs/report/queryReportUrlState.native.js.map +1 -1
  30. package/dist/cjs/report/report-grid.cjs +2 -426
  31. package/dist/cjs/report/report-grid.native.js +1 -479
  32. package/dist/cjs/report/report-grid.native.js.map +1 -1
  33. package/dist/cjs/report/report-toolbar.cjs +2 -228
  34. package/dist/cjs/report/report-toolbar.native.js +1 -274
  35. package/dist/cjs/report/report-toolbar.native.js.map +1 -1
  36. package/dist/cjs/report/reportShapes.cjs +12 -383
  37. package/dist/cjs/report/reportShapes.native.js +12 -501
  38. package/dist/cjs/report/reportShapes.native.js.map +1 -1
  39. package/dist/cjs/report/reportViewModel.cjs +20 -360
  40. package/dist/cjs/report/reportViewModel.native.js +19 -627
  41. package/dist/cjs/report/reportViewModel.native.js.map +1 -1
  42. package/dist/cjs/report/savedReports.cjs +2 -106
  43. package/dist/cjs/report/savedReports.native.js +1 -132
  44. package/dist/cjs/report/savedReports.native.js.map +1 -1
  45. package/dist/cjs/report/useQueryReport.cjs +11 -219
  46. package/dist/cjs/report/useQueryReport.native.js +11 -244
  47. package/dist/cjs/report/useQueryReport.native.js.map +1 -1
  48. package/dist/cjs/shared/measures.cjs +3 -5
  49. package/dist/cjs/shared/measures.native.js +3 -5
  50. package/dist/cjs/shared/measures.native.js.map +1 -1
  51. package/dist/cjs/views/ReportView.cjs +3 -256
  52. package/dist/cjs/views/ReportView.native.js +3 -382
  53. package/dist/cjs/views/ReportView.native.js.map +1 -1
  54. package/dist/cjs/views/report-controls.cjs +6 -6
  55. package/dist/cjs/views/report-controls.native.js +6 -6
  56. package/dist/cjs/views/report-controls.native.js.map +1 -1
  57. package/dist/esm/desk/DeskSurface.mjs.map +1 -1
  58. package/dist/esm/desk/DeskSurface.native.js.map +1 -1
  59. package/dist/esm/form/DocFormScreen.mjs +169 -226
  60. package/dist/esm/form/DocFormScreen.mjs.map +1 -1
  61. package/dist/esm/form/DocFormScreen.native.js +184 -261
  62. package/dist/esm/form/DocFormScreen.native.js.map +1 -1
  63. package/dist/esm/i18n/en.mjs +1 -0
  64. package/dist/esm/i18n/en.mjs.map +1 -1
  65. package/dist/esm/i18n/en.native.js +1 -0
  66. package/dist/esm/i18n/en.native.js.map +1 -1
  67. package/dist/esm/list/ListBulkActionsBar.mjs +31 -19
  68. package/dist/esm/list/ListBulkActionsBar.mjs.map +1 -1
  69. package/dist/esm/list/ListBulkActionsBar.native.js +37 -25
  70. package/dist/esm/list/ListBulkActionsBar.native.js.map +1 -1
  71. package/dist/esm/list/sidebar-section.mjs +16 -8
  72. package/dist/esm/list/sidebar-section.mjs.map +1 -1
  73. package/dist/esm/list/sidebar-section.native.js +17 -8
  74. package/dist/esm/list/sidebar-section.native.js.map +1 -1
  75. package/dist/esm/report/DoctypeReportView.mjs +21 -375
  76. package/dist/esm/report/DoctypeReportView.mjs.map +1 -1
  77. package/dist/esm/report/DoctypeReportView.native.js +24 -456
  78. package/dist/esm/report/DoctypeReportView.native.js.map +1 -1
  79. package/dist/esm/report/QueryReportScreen.mjs +26 -16
  80. package/dist/esm/report/QueryReportScreen.mjs.map +1 -1
  81. package/dist/esm/report/QueryReportScreen.native.js +26 -16
  82. package/dist/esm/report/QueryReportScreen.native.js.map +1 -1
  83. package/dist/esm/report/queryReportColumns.mjs +1 -103
  84. package/dist/esm/report/queryReportColumns.mjs.map +1 -1
  85. package/dist/esm/report/queryReportColumns.native.js +1 -117
  86. package/dist/esm/report/queryReportColumns.native.js.map +1 -1
  87. package/dist/esm/report/queryReportFilterBar.mjs +1 -2
  88. package/dist/esm/report/queryReportFilterBar.mjs.map +1 -1
  89. package/dist/esm/report/queryReportFilterBar.native.js +1 -2
  90. package/dist/esm/report/queryReportFilterBar.native.js.map +1 -1
  91. package/dist/esm/report/queryReportUrlState.mjs +1 -1
  92. package/dist/esm/report/queryReportUrlState.native.js +1 -1
  93. package/dist/esm/report/report-grid.mjs +1 -425
  94. package/dist/esm/report/report-grid.mjs.map +1 -1
  95. package/dist/esm/report/report-grid.native.js +1 -468
  96. package/dist/esm/report/report-grid.native.js.map +1 -1
  97. package/dist/esm/report/report-toolbar.mjs +2 -228
  98. package/dist/esm/report/report-toolbar.mjs.map +1 -1
  99. package/dist/esm/report/report-toolbar.native.js +2 -264
  100. package/dist/esm/report/report-toolbar.native.js.map +1 -1
  101. package/dist/esm/report/reportShapes.mjs +2 -373
  102. package/dist/esm/report/reportShapes.mjs.map +1 -1
  103. package/dist/esm/report/reportShapes.native.js +2 -491
  104. package/dist/esm/report/reportShapes.native.js.map +1 -1
  105. package/dist/esm/report/reportViewModel.mjs +2 -342
  106. package/dist/esm/report/reportViewModel.mjs.map +1 -1
  107. package/dist/esm/report/reportViewModel.native.js +2 -610
  108. package/dist/esm/report/reportViewModel.native.js.map +1 -1
  109. package/dist/esm/report/savedReports.mjs +1 -105
  110. package/dist/esm/report/savedReports.mjs.map +1 -1
  111. package/dist/esm/report/savedReports.native.js +1 -132
  112. package/dist/esm/report/savedReports.native.js.map +1 -1
  113. package/dist/esm/report/useQueryReport.mjs +2 -210
  114. package/dist/esm/report/useQueryReport.mjs.map +1 -1
  115. package/dist/esm/report/useQueryReport.native.js +2 -235
  116. package/dist/esm/report/useQueryReport.native.js.map +1 -1
  117. package/dist/esm/shared/measures.mjs +1 -3
  118. package/dist/esm/shared/measures.mjs.map +1 -1
  119. package/dist/esm/shared/measures.native.js +1 -3
  120. package/dist/esm/shared/measures.native.js.map +1 -1
  121. package/dist/esm/views/ReportView.mjs +3 -256
  122. package/dist/esm/views/ReportView.mjs.map +1 -1
  123. package/dist/esm/views/ReportView.native.js +3 -382
  124. package/dist/esm/views/ReportView.native.js.map +1 -1
  125. package/dist/esm/views/report-controls.mjs +3 -3
  126. package/dist/esm/views/report-controls.mjs.map +1 -1
  127. package/dist/esm/views/report-controls.native.js +3 -3
  128. package/dist/esm/views/report-controls.native.js.map +1 -1
  129. package/dist/jsx/desk/DeskSurface.mjs.map +1 -1
  130. package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
  131. package/dist/jsx/form/DocFormScreen.mjs +169 -226
  132. package/dist/jsx/form/DocFormScreen.mjs.map +1 -1
  133. package/dist/jsx/form/DocFormScreen.native.js +182 -259
  134. package/dist/jsx/form/DocFormScreen.native.js.map +1 -1
  135. package/dist/jsx/i18n/en.mjs +1 -0
  136. package/dist/jsx/i18n/en.mjs.map +1 -1
  137. package/dist/jsx/i18n/en.native.js +1 -0
  138. package/dist/jsx/i18n/en.native.js.map +1 -1
  139. package/dist/jsx/list/ListBulkActionsBar.mjs +31 -19
  140. package/dist/jsx/list/ListBulkActionsBar.mjs.map +1 -1
  141. package/dist/jsx/list/ListBulkActionsBar.native.js +43 -31
  142. package/dist/jsx/list/ListBulkActionsBar.native.js.map +1 -1
  143. package/dist/jsx/list/sidebar-section.mjs +16 -8
  144. package/dist/jsx/list/sidebar-section.mjs.map +1 -1
  145. package/dist/jsx/list/sidebar-section.native.js +16 -7
  146. package/dist/jsx/list/sidebar-section.native.js.map +1 -1
  147. package/dist/jsx/report/DoctypeReportView.mjs +21 -375
  148. package/dist/jsx/report/DoctypeReportView.mjs.map +1 -1
  149. package/dist/jsx/report/DoctypeReportView.native.js +23 -455
  150. package/dist/jsx/report/DoctypeReportView.native.js.map +1 -1
  151. package/dist/jsx/report/QueryReportScreen.mjs +26 -16
  152. package/dist/jsx/report/QueryReportScreen.mjs.map +1 -1
  153. package/dist/jsx/report/QueryReportScreen.native.js +33 -23
  154. package/dist/jsx/report/QueryReportScreen.native.js.map +1 -1
  155. package/dist/jsx/report/queryReportColumns.mjs +1 -103
  156. package/dist/jsx/report/queryReportColumns.mjs.map +1 -1
  157. package/dist/jsx/report/queryReportColumns.native.js +2 -129
  158. package/dist/jsx/report/queryReportColumns.native.js.map +1 -1
  159. package/dist/jsx/report/queryReportFilterBar.mjs +1 -2
  160. package/dist/jsx/report/queryReportFilterBar.mjs.map +1 -1
  161. package/dist/jsx/report/queryReportFilterBar.native.js +3 -4
  162. package/dist/jsx/report/queryReportFilterBar.native.js.map +1 -1
  163. package/dist/jsx/report/queryReportUrlState.mjs +1 -1
  164. package/dist/jsx/report/queryReportUrlState.native.js +2 -2
  165. package/dist/jsx/report/queryReportUrlState.native.js.map +1 -1
  166. package/dist/jsx/report/report-grid.mjs +1 -425
  167. package/dist/jsx/report/report-grid.mjs.map +1 -1
  168. package/dist/jsx/report/report-grid.native.js +1 -479
  169. package/dist/jsx/report/report-grid.native.js.map +1 -1
  170. package/dist/jsx/report/report-toolbar.mjs +2 -228
  171. package/dist/jsx/report/report-toolbar.mjs.map +1 -1
  172. package/dist/jsx/report/report-toolbar.native.js +1 -274
  173. package/dist/jsx/report/report-toolbar.native.js.map +1 -1
  174. package/dist/jsx/report/reportShapes.mjs +2 -373
  175. package/dist/jsx/report/reportShapes.mjs.map +1 -1
  176. package/dist/jsx/report/reportShapes.native.js +12 -501
  177. package/dist/jsx/report/reportShapes.native.js.map +1 -1
  178. package/dist/jsx/report/reportViewModel.mjs +2 -342
  179. package/dist/jsx/report/reportViewModel.mjs.map +1 -1
  180. package/dist/jsx/report/reportViewModel.native.js +19 -627
  181. package/dist/jsx/report/reportViewModel.native.js.map +1 -1
  182. package/dist/jsx/report/savedReports.mjs +1 -105
  183. package/dist/jsx/report/savedReports.mjs.map +1 -1
  184. package/dist/jsx/report/savedReports.native.js +1 -132
  185. package/dist/jsx/report/savedReports.native.js.map +1 -1
  186. package/dist/jsx/report/useQueryReport.mjs +2 -210
  187. package/dist/jsx/report/useQueryReport.mjs.map +1 -1
  188. package/dist/jsx/report/useQueryReport.native.js +11 -244
  189. package/dist/jsx/report/useQueryReport.native.js.map +1 -1
  190. package/dist/jsx/shared/measures.mjs +1 -3
  191. package/dist/jsx/shared/measures.mjs.map +1 -1
  192. package/dist/jsx/shared/measures.native.js +3 -5
  193. package/dist/jsx/shared/measures.native.js.map +1 -1
  194. package/dist/jsx/views/ReportView.mjs +3 -256
  195. package/dist/jsx/views/ReportView.mjs.map +1 -1
  196. package/dist/jsx/views/ReportView.native.js +3 -382
  197. package/dist/jsx/views/ReportView.native.js.map +1 -1
  198. package/dist/jsx/views/report-controls.mjs +3 -3
  199. package/dist/jsx/views/report-controls.mjs.map +1 -1
  200. package/dist/jsx/views/report-controls.native.js +6 -6
  201. package/dist/jsx/views/report-controls.native.js.map +1 -1
  202. package/package.json +12 -12
  203. package/src/backofficeScreens.designLaw.spec.ts +0 -5
  204. package/src/desk/DeskSurface.tsx +4 -7
  205. package/src/form/DocFormScreen.chrome.spec.ts +77 -0
  206. package/src/form/DocFormScreen.guest.screen.spec.tsx +175 -0
  207. package/src/form/DocFormScreen.rights.spec.tsx +7 -3
  208. package/src/form/DocFormScreen.tsx +214 -315
  209. package/src/i18n/en.ts +1 -0
  210. package/src/list/ListBulkActionsBar.rights.spec.tsx +134 -0
  211. package/src/list/ListBulkActionsBar.screen.spec.tsx +7 -1
  212. package/src/list/ListBulkActionsBar.tsx +76 -57
  213. package/src/list/ListFilterBar.screen.spec.tsx +14 -13
  214. package/src/list/sidebar-section.tsx +11 -3
  215. package/src/report/DoctypeReportView.tsx +28 -550
  216. package/src/report/QueryReportScreen.spec.tsx +75 -1
  217. package/src/report/QueryReportScreen.tsx +38 -22
  218. package/src/report/queryReportColumns.tsx +4 -123
  219. package/src/report/queryReportFilterBar.tsx +3 -5
  220. package/src/report/queryReportUrlState.ts +1 -1
  221. package/src/report/report-grid.tsx +4 -529
  222. package/src/report/report-toolbar.tsx +4 -308
  223. package/src/report/reportShapes.ts +25 -613
  224. package/src/report/reportShim.spec.ts +162 -0
  225. package/src/report/reportViewModel.ts +32 -605
  226. package/src/report/savedReports.ts +4 -161
  227. package/src/report/useQueryReport.ts +9 -347
  228. package/src/shared/measures.ts +3 -11
  229. package/src/views/ReportView.screen.spec.tsx +25 -20
  230. package/src/views/ReportView.tsx +7 -439
  231. package/src/views/report-controls.tsx +12 -20
  232. package/types/desk/DeskSurface.d.ts.map +1 -1
  233. package/types/form/DocFormScreen.d.ts +2 -2
  234. package/types/form/DocFormScreen.d.ts.map +1 -1
  235. package/types/i18n/en.d.ts +1 -0
  236. package/types/i18n/en.d.ts.map +1 -1
  237. package/types/list/ListBulkActionsBar.d.ts.map +1 -1
  238. package/types/list/sidebar-section.d.ts.map +1 -1
  239. package/types/report/DoctypeReportView.d.ts.map +1 -1
  240. package/types/report/QueryReportScreen.d.ts +1 -1
  241. package/types/report/QueryReportScreen.d.ts.map +1 -1
  242. package/types/report/queryReportColumns.d.ts +2 -11
  243. package/types/report/queryReportColumns.d.ts.map +1 -1
  244. package/types/report/queryReportFilterBar.d.ts +1 -1
  245. package/types/report/queryReportFilterBar.d.ts.map +1 -1
  246. package/types/report/queryReportUrlState.d.ts +1 -1
  247. package/types/report/queryReportUrlState.d.ts.map +1 -1
  248. package/types/report/report-grid.d.ts +2 -19
  249. package/types/report/report-grid.d.ts.map +1 -1
  250. package/types/report/report-toolbar.d.ts +2 -29
  251. package/types/report/report-toolbar.d.ts.map +1 -1
  252. package/types/report/reportShapes.d.ts +2 -115
  253. package/types/report/reportShapes.d.ts.map +1 -1
  254. package/types/report/reportViewModel.d.ts +2 -135
  255. package/types/report/reportViewModel.d.ts.map +1 -1
  256. package/types/report/savedReports.d.ts +2 -18
  257. package/types/report/savedReports.d.ts.map +1 -1
  258. package/types/report/useQueryReport.d.ts +2 -35
  259. package/types/report/useQueryReport.d.ts.map +1 -1
  260. package/types/shared/measures.d.ts +1 -2
  261. package/types/shared/measures.d.ts.map +1 -1
  262. package/types/views/ReportView.d.ts +3 -22
  263. package/types/views/ReportView.d.ts.map +1 -1
  264. package/types/views/report-controls.d.ts +2 -5
  265. package/types/views/report-controls.d.ts.map +1 -1
  266. package/src/report/report-grid.spec.tsx +0 -175
  267. package/src/report/report-toolbar.spec.tsx +0 -90
  268. package/src/report/reportShapes.spec.ts +0 -391
  269. package/src/report/reportViewModel.spec.ts +0 -393
@@ -1,107 +1,3 @@
1
- import { useFrappeConfig } from "@multiplatform.one/frappe-ui";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
- import { useFrappeApp } from "../shared/useFrappeApp.mjs";
4
- import { toDeskReportSettings, fromDeskReportSettings } from "./reportViewModel.mjs";
5
- function useSavedReports(doctype) {
6
- const app = useFrappeApp();
7
- const config = useFrappeConfig();
8
- const fixtureMode = Boolean(config?.fixtures);
9
- const [reports, setReports] = useState([]);
10
- const [loading, setLoading] = useState(false);
11
- const [generation, setGeneration] = useState(0);
12
- const memoryConfigs = useRef(/* @__PURE__ */new Map());
13
- useEffect(() => {
14
- memoryConfigs.current = /* @__PURE__ */new Map();
15
- setReports([]);
16
- }, [doctype]);
17
- useEffect(() => {
18
- if (!app || fixtureMode) return;
19
- let cancelled = false;
20
- setLoading(true);
21
- app.call().get("frappe.client.get_list", {
22
- doctype: "Report",
23
- filters: JSON.stringify([["ref_doctype", "=", doctype], ["report_type", "=", "Report Builder"], ["disabled", "=", 0]]),
24
- fields: JSON.stringify(["name", "report_name", "json"]),
25
- limit_page_length: 0,
26
- order_by: "report_name asc"
27
- }).then(res => {
28
- if (cancelled) return;
29
- const rows = res.payload?.message ?? [];
30
- setReports(rows.map(row => ({
31
- name: row.name,
32
- reportName: row.report_name || row.name,
33
- json: row.json
34
- })));
35
- setLoading(false);
36
- }).catch(() => {
37
- if (cancelled) return;
38
- setReports([]);
39
- setLoading(false);
40
- });
41
- return () => {
42
- cancelled = true;
43
- };
44
- }, [app, fixtureMode, doctype, generation]);
45
- const load = useCallback(async name => {
46
- if (fixtureMode) return memoryConfigs.current.get(name);
47
- const summary = reports.find(report => report.name === name);
48
- let json = summary?.json;
49
- if (json === void 0 && app) {
50
- const res = await app.call().get("frappe.client.get_value", {
51
- doctype: "Report",
52
- filters: JSON.stringify({
53
- name
54
- }),
55
- fieldname: JSON.stringify(["json"])
56
- });
57
- json = res.payload?.message?.json;
58
- }
59
- if (!json) return void 0;
60
- try {
61
- return fromDeskReportSettings(doctype, JSON.parse(json));
62
- } catch {
63
- return void 0;
64
- }
65
- }, [app, fixtureMode, reports, doctype]);
66
- const save = useCallback(async (name, viewConfig) => {
67
- const trimmed = name.trim();
68
- if (!trimmed) throw new Error("Report name is required");
69
- if (fixtureMode || !app) {
70
- memoryConfigs.current.set(trimmed, viewConfig);
71
- setReports(previous => [...previous.filter(report => report.name !== trimmed), {
72
- name: trimmed,
73
- reportName: trimmed
74
- }]);
75
- return trimmed;
76
- }
77
- const res = await app.call().post("frappe.desk.reportview.save_report", {
78
- name: trimmed,
79
- doctype,
80
- report_settings: JSON.stringify(toDeskReportSettings(doctype, viewConfig))
81
- });
82
- setGeneration(value => value + 1);
83
- return res.payload?.message ?? trimmed;
84
- }, [app, fixtureMode, doctype]);
85
- const remove = useCallback(async name => {
86
- if (fixtureMode || !app) {
87
- memoryConfigs.current.delete(name);
88
- setReports(previous => previous.filter(report => report.name !== name));
89
- return;
90
- }
91
- await app.call().post("frappe.desk.reportview.delete_report", {
92
- name
93
- });
94
- setGeneration(value => value + 1);
95
- }, [app, fixtureMode, doctype]);
96
- const refresh = useCallback(() => setGeneration(value => value + 1), []);
97
- return useMemo(() => ({
98
- reports,
99
- loading,
100
- load,
101
- save,
102
- remove,
103
- refresh
104
- }), [reports, loading, load, save, remove, refresh]);
105
- }
1
+ import { useSavedReports } from "@multiplatform.one/frappe-ui";
106
2
  export { useSavedReports };
107
3
  //# sourceMappingURL=savedReports.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFrappeConfig","useCallback","useEffect","useMemo","useRef","useState","useFrappeApp","toDeskReportSettings","fromDeskReportSettings","useSavedReports","doctype","app","config","fixtureMode","Boolean","fixtures","reports","setReports","loading","setLoading","generation","setGeneration","memoryConfigs","Map","current","cancelled","call","get","filters","JSON","stringify","fields","limit_page_length","order_by","then","res","rows","payload","message","map","row","name","reportName","report_name","json","catch","load","summary","find","report","fieldname","parse","save","viewConfig","trimmed","trim","Error","set","previous","filter","post","report_settings","value","remove","delete","refresh"],"sources":["../../../src/report/savedReports.ts"],"sourcesContent":[null],"mappings":"AAMA,SAASA,eAAA,QAAuB;AAChC,SAASC,WAAA,EAAaC,SAAA,EAAWC,OAAA,EAASC,MAAA,EAAQC,QAA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AAA,IAAaA,QAAA,CAASC,MAAA,CAAQV,MAAA,IAAWA,MAAA,CAAOR,IAAA,KAASA,IAAI,CAAC;MAC1E;IACF;IACA,MAAM9B,GAAA,CAAIe,IAAA,CAAK,EAAEkC,IAAA,CAAK,wCAAwC;MAAEnB;IAAK,CAAC;IACtEpB,aAAA,CAAeyC,KAAA,IAAUA,KAAA,GAAQ,CAAC;EACpC,GACA,CAACnD,GAAA,EAAKE,WAAA,EAAaH,OAAO,CAC5B;EAEA,MAAMuD,OAAA,GAAUhE,WAAA,CAAY,MAAMoB,aAAA,CAAeyC,KAAA,IAAUA,KAAA,GAAQ,CAAC,GAAG,EAAE;EAEzE,OAAO3D,OAAA,CACL,OAAO;IAAEa,OAAA;IAASE,OAAA;IAAS4B,IAAA;IAAMM,IAAA;IAAMW,MAAA;IAAQE;EAAQ,IACvD,CAACjD,OAAA,EAASE,OAAA,EAAS4B,IAAA,EAAMM,IAAA,EAAMW,MAAA,EAAQE,OAAO,CAChD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useSavedReports"],"sources":["../../../src/report/savedReports.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,eAAA,QAAuB","ignoreList":[]}
@@ -1,134 +1,3 @@
1
- import { useFrappeConfig } from "@multiplatform.one/frappe-ui";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
- import { useFrappeApp } from "../shared/useFrappeApp.native.js";
4
- import { toDeskReportSettings, fromDeskReportSettings } from "./reportViewModel.native.js";
5
- function useSavedReports(doctype) {
6
- var app = useFrappeApp();
7
- var config = useFrappeConfig();
8
- var fixtureMode = Boolean(config === null || config === void 0 ? void 0 : config.fixtures);
9
- var [reports, setReports] = useState([]);
10
- var [loading, setLoading] = useState(false);
11
- var [generation, setGeneration] = useState(0);
12
- var memoryConfigs = useRef(/* @__PURE__ */new Map());
13
- useEffect(function () {
14
- memoryConfigs.current = /* @__PURE__ */new Map();
15
- setReports([]);
16
- }, [doctype]);
17
- useEffect(function () {
18
- if (!app || fixtureMode) return;
19
- var cancelled = false;
20
- setLoading(true);
21
- app.call().get("frappe.client.get_list", {
22
- doctype: "Report",
23
- filters: JSON.stringify([["ref_doctype", "=", doctype], ["report_type", "=", "Report Builder"], ["disabled", "=", 0]]),
24
- fields: JSON.stringify(["name", "report_name", "json"]),
25
- limit_page_length: 0,
26
- order_by: "report_name asc"
27
- }).then(function (res) {
28
- var _ref;
29
- var _res_payload;
30
- if (cancelled) return;
31
- var rows = (_ref = (_res_payload = res.payload) === null || _res_payload === void 0 ? void 0 : _res_payload.message) !== null && _ref !== void 0 ? _ref : [];
32
- setReports(rows.map(function (row) {
33
- return {
34
- name: row.name,
35
- reportName: row.report_name || row.name,
36
- json: row.json
37
- };
38
- }));
39
- setLoading(false);
40
- }).catch(function () {
41
- if (cancelled) return;
42
- setReports([]);
43
- setLoading(false);
44
- });
45
- return function () {
46
- cancelled = true;
47
- };
48
- }, [app, fixtureMode, doctype, generation]);
49
- var load = useCallback(async function (name) {
50
- if (fixtureMode) return memoryConfigs.current.get(name);
51
- var summary = reports.find(function (report) {
52
- return report.name === name;
53
- });
54
- var json = summary === null || summary === void 0 ? void 0 : summary.json;
55
- if (json === void 0 && app) {
56
- var _res_payload_message, _res_payload;
57
- var res = await app.call().get("frappe.client.get_value", {
58
- doctype: "Report",
59
- filters: JSON.stringify({
60
- name
61
- }),
62
- fieldname: JSON.stringify(["json"])
63
- });
64
- json = (_res_payload = res.payload) === null || _res_payload === void 0 ? void 0 : (_res_payload_message = _res_payload.message) === null || _res_payload_message === void 0 ? void 0 : _res_payload_message.json;
65
- }
66
- if (!json) return void 0;
67
- try {
68
- return fromDeskReportSettings(doctype, JSON.parse(json));
69
- } catch (unused) {
70
- return void 0;
71
- }
72
- }, [app, fixtureMode, reports, doctype]);
73
- var save = useCallback(async function (name, viewConfig) {
74
- var _ref;
75
- var _res_payload;
76
- var trimmed = name.trim();
77
- if (!trimmed) throw new Error("Report name is required");
78
- if (fixtureMode || !app) {
79
- memoryConfigs.current.set(trimmed, viewConfig);
80
- setReports(function (previous) {
81
- return [...previous.filter(function (report) {
82
- return report.name !== trimmed;
83
- }), {
84
- name: trimmed,
85
- reportName: trimmed
86
- }];
87
- });
88
- return trimmed;
89
- }
90
- var res = await app.call().post("frappe.desk.reportview.save_report", {
91
- name: trimmed,
92
- doctype,
93
- report_settings: JSON.stringify(toDeskReportSettings(doctype, viewConfig))
94
- });
95
- setGeneration(function (value) {
96
- return value + 1;
97
- });
98
- return (_ref = (_res_payload = res.payload) === null || _res_payload === void 0 ? void 0 : _res_payload.message) !== null && _ref !== void 0 ? _ref : trimmed;
99
- }, [app, fixtureMode, doctype]);
100
- var remove = useCallback(async function (name) {
101
- if (fixtureMode || !app) {
102
- memoryConfigs.current.delete(name);
103
- setReports(function (previous) {
104
- return previous.filter(function (report) {
105
- return report.name !== name;
106
- });
107
- });
108
- return;
109
- }
110
- await app.call().post("frappe.desk.reportview.delete_report", {
111
- name
112
- });
113
- setGeneration(function (value) {
114
- return value + 1;
115
- });
116
- }, [app, fixtureMode, doctype]);
117
- var refresh = useCallback(function () {
118
- return setGeneration(function (value) {
119
- return value + 1;
120
- });
121
- }, []);
122
- return useMemo(function () {
123
- return {
124
- reports,
125
- loading,
126
- load,
127
- save,
128
- remove,
129
- refresh
130
- };
131
- }, [reports, loading, load, save, remove, refresh]);
132
- }
1
+ import { useSavedReports } from "@multiplatform.one/frappe-ui";
133
2
  export { useSavedReports };
134
3
  //# sourceMappingURL=savedReports.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFrappeConfig","useCallback","useEffect","useMemo","useRef","useState","useFrappeApp","toDeskReportSettings","fromDeskReportSettings","useSavedReports","doctype","app","config","fixtureMode","Boolean","fixtures","reports","setReports","loading","setLoading","generation","setGeneration","memoryConfigs","Map","current","cancelled","call","get","filters","JSON","stringify","fields","limit_page_length","order_by","then","res","_ref","_res_payload","rows","payload","message","map","row","name","reportName","report_name","json","catch","load","summary","find","report","_res_payload_message","fieldname","parse","unused","save","viewConfig","trimmed","trim","Error","set","previous"],"sources":["../../../src/report/savedReports.ts"],"sourcesContent":[null],"mappings":"AAMA,SAASA,eAAA,QAAuB;AAChC,SAASC,WAAA,EAAaC,SAAA,EAAWC,OAAA,EAASC,MAAA,EAAQC,QAAA,QAAgB;AAClE,SAASC,YAAA,QAAoB;AAC7B,SAAAC,oBAAA,EAAAC,sBAAA;AAAA,SACEC,gBAAAC,OAAA;EACA,IAAAC,GAAA,GAAAL,YAAA;EAAA,IAAAM,MAEK,GAAAZ,eAAA;EAsBA,IAAAa,WAAS,GAAAC,OAAgB,CAAAF,MAAwC,aAAAA,MAAA,uBAAAA,MAAA,CAAAG,QAAA;EACtE,KAAAC,OAAY,EAAAC,UAAA,CAAa,GAAAZ,QAAA;EACzB,KAAAa,OAAM,EAAAC,UAAS,IAAAd,QAAgB;EAC/B,KAAAe,UAAM,EAAAC,aAAsB,IAAAhB,QAAQ,EAAQ;EAC5C,IAAAiB,aAAgB,GAAAlB,MAAU,gBAAqC,IAAAmB,GAAA;EAC/DrB,SAAO,aAAS;IAChBoB,aAAO,CAAAE,OAAY,kBAAiB,IAAUD,GAAA;IAE9CN,UAAM;EAEN,IACEP,OAAA,CACA;EACFR,SAAI,aAAQ;IAEZ,KAAAS,GAAU,IAAAE,WAAM;IACd,IAAIY,SAAQ;IACZN,UAAI,MAAY;IAChBR,GAAA,CAAAe,IAAA,GAAWC,GAAA,CAAI;MACfjB,OACQ,EACL,QAAmC;MAClCkB,OAAA,EAASC,IAAA,CAAAC,SAAA,EACT,CACG,eACA,KACApB,OAAA,CACF,EACD,CACA,eACA,KAED,gBAAc,CACb,EACA,CACA,YACE,GAAK,EACH,EAAU,CACyB;MACzBqB,MACV,EAAAF,IAAA,CAAAC,SAAA,EACJ,QACA,aAAW,EAEZ,MAAM,CAGL;MACAE,iBAAa;MACbC,QAAA;IACF,CAAC,EAAAC,IAAA,WAAAC,GAAA;MACH,IAAAC,IAAO;MACL,IAAAC,YAAY;MACd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,GAAU,CAAAI,OAAS,cAAAF,YAAA,wBAAAe,oBAAA,GAAAf,YAAA,CAAAG,OAAA,cAAAY,oBAAA,uBAAAA,oBAAA,CAAAN,IAAA;IAClC;IACF,KAAAA,IAAA;IACA,IAAC;MACH,OAAAtC,sBAAA,CAAAE,OAAA,EAAAmB,IAAA,CAAAyB,KAAA,CAAAR,IAAA;IAEA,SAAMS,MAAS;MACb,OAAO;IACL;EACE,IACA5C,GAAA,EACAE,WAAA,EAAAG,OACF,EACAN,OAAA,CACA;EAAkC,IACpC8C,IAAA,GAAAvD,WAAA,iBAAA0C,IAAA,EAAAc,UAAA;IACA,IAACrB,IAAK;IACR,IAAAC,YAAA;IAEA,IAAMqB,OAAA,GAAUf,IAAA,CAAAgB,IAAA;IAEhB,KAAOD,OAAA,YAAAE,KAAA;IACL,IAAA/C,WAAS,IAAS,CAAAF,GAAA;MACjBW,aAAS,CAAAE,OAAS,CAAAqC,GAAM,CAAAH,OAAM,EAAAD,UAAe;MAChDxC,UAAA,WAAA6C,QAAA;QACF,Q","ignoreList":[]}
1
+ {"version":3,"names":["useSavedReports"],"sources":["../../../src/report/savedReports.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,eAAA,QAAuB","ignoreList":[]}
@@ -1,211 +1,3 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import { useFrappeApp } from "../shared/useFrappeApp.mjs";
3
- import { buildRunFilters, defaultFilterValues, extractScriptFilters, humanizeFrappeError, isEmptyFilterValue, normalizeFilterMeta, normalizeQueryReportColumns, normalizeQueryReportRows } from "./reportShapes.mjs";
4
- import { buildRunFilters as buildRunFilters2, compactQueryReportFilters, defaultFilterValues as defaultFilterValues2, extractScriptFilters as extractScriptFilters2, isEmptyFilterValue as isEmptyFilterValue2, normalizeQueryReportColumns as normalizeQueryReportColumns2, normalizeQueryReportRows as normalizeQueryReportRows2, scrubFieldname, stripHtml } from "./reportShapes.mjs";
5
- const RUN_METHOD = "frappe.desk.query_report.run";
6
- const SCRIPT_METHOD = "frappe.desk.query_report.get_script";
7
- async function fetchReportMeta(app, reportName) {
8
- const res = await app.call().get("frappe.client.get", {
9
- doctype: "Report",
10
- name: reportName
11
- });
12
- const doc = res.payload?.message;
13
- if (!doc) throw new Error(`Report "${reportName}" not found`);
14
- return doc;
15
- }
16
- async function fetchReportScript(app, reportName) {
17
- const res = await app.call().get(SCRIPT_METHOD, {
18
- report_name: reportName
19
- });
20
- const script = res.payload?.message?.script;
21
- return typeof script === "string" ? script : void 0;
22
- }
23
- function useQueryReport(reportName, options = {}) {
24
- const {
25
- fixture
26
- } = options;
27
- const app = useFrappeApp();
28
- const initialFiltersRef = useRef(options.initialFilters);
29
- initialFiltersRef.current = options.initialFilters;
30
- const [meta, setMeta] = useState(void 0);
31
- const [script, setScript] = useState(void 0);
32
- const [sourcesSettled, setSourcesSettled] = useState(false);
33
- const [filters, setFiltersState] = useState(() => ({
34
- ...initialFiltersRef.current
35
- }));
36
- const [columns, setColumns] = useState([]);
37
- const [rows, setRows] = useState([]);
38
- const [loading, setLoading] = useState(true);
39
- const [running, setRunning] = useState(false);
40
- const [error, setError] = useState(void 0);
41
- const [serverMessage, setServerMessage] = useState(void 0);
42
- const [executionTime, setExecutionTime] = useState(void 0);
43
- const [generation, setGeneration] = useState(0);
44
- const seededFor = useRef(void 0);
45
- const lastReport = useRef(reportName);
46
- useEffect(() => {
47
- if (lastReport.current === reportName) return;
48
- lastReport.current = reportName;
49
- setFiltersState({
50
- ...initialFiltersRef.current
51
- });
52
- setMeta(void 0);
53
- setScript(void 0);
54
- setSourcesSettled(false);
55
- setColumns([]);
56
- setRows([]);
57
- setError(void 0);
58
- setServerMessage(void 0);
59
- setExecutionTime(void 0);
60
- setLoading(true);
61
- }, [reportName]);
62
- useEffect(() => {
63
- if (fixture) return;
64
- if (!app) {
65
- setSourcesSettled(true);
66
- return;
67
- }
68
- let cancelled = false;
69
- setSourcesSettled(false);
70
- Promise.allSettled([fetchReportMeta(app, reportName), fetchReportScript(app, reportName)]).then(([metaResult, scriptResult]) => {
71
- if (cancelled) return;
72
- const doc = metaResult.status === "fulfilled" ? metaResult.value : void 0;
73
- const scriptText = scriptResult.status === "fulfilled" ? scriptResult.value : void 0;
74
- if (doc) setMeta(doc);
75
- if (scriptText) setScript(scriptText);
76
- if (seededFor.current !== reportName) {
77
- seededFor.current = reportName;
78
- const extraction = extractScriptFilters(scriptText);
79
- const merged = extraction.declared ? extraction.filters : normalizeFilterMeta(doc?.filters);
80
- const defaults = defaultFilterValues(merged);
81
- if (Object.keys(defaults).length > 0) setFiltersState(previous => ({
82
- ...defaults,
83
- ...previous
84
- }));
85
- }
86
- setSourcesSettled(true);
87
- });
88
- return () => {
89
- cancelled = true;
90
- };
91
- }, [app, fixture, reportName]);
92
- const scriptExtraction = useMemo(() => extractScriptFilters(fixture ? fixture.script : script), [fixture, script]);
93
- const docFilterMeta = useMemo(() => normalizeFilterMeta(fixture ? fixture.meta?.filters : meta?.filters), [fixture, meta]);
94
- const filterMeta = useMemo(() => scriptExtraction.declared ? scriptExtraction.filters : docFilterMeta, [scriptExtraction, docFilterMeta]);
95
- const scriptFilterGap = scriptExtraction.declaredCount > scriptExtraction.filters.length;
96
- useEffect(() => {
97
- if (!fixture) return;
98
- if (seededFor.current === reportName) return;
99
- seededFor.current = reportName;
100
- const defaults = defaultFilterValues(filterMeta);
101
- if (Object.keys(defaults).length > 0) setFiltersState(previous => ({
102
- ...defaults,
103
- ...previous
104
- }));
105
- }, [fixture, reportName, filterMeta]);
106
- const missingRequired = useMemo(() => filterMeta.filter(filter => filter.mandatory === 1 && isEmptyFilterValue(filters[filter.fieldname])), [filterMeta, filters]);
107
- const hasMissingRequired = missingRequired.length > 0;
108
- const metaDisabled = (fixture ? fixture.meta?.disabled : meta?.disabled) === 1;
109
- useEffect(() => {
110
- if (fixture) return;
111
- if (!sourcesSettled) return;
112
- if (metaDisabled) {
113
- setLoading(false);
114
- return;
115
- }
116
- if (hasMissingRequired) {
117
- setColumns([]);
118
- setRows([]);
119
- setError(void 0);
120
- setLoading(false);
121
- return;
122
- }
123
- if (!app) {
124
- setError(new Error("No Frappe connection configured"));
125
- setLoading(false);
126
- return;
127
- }
128
- let cancelled = false;
129
- setRunning(true);
130
- app.call().post(RUN_METHOD, {
131
- report_name: reportName,
132
- filters: buildRunFilters(filterMeta, filters),
133
- ignore_prepared_report: 1
134
- }).then(res => {
135
- if (cancelled) return;
136
- const message = res.payload?.message;
137
- const nextColumns = normalizeQueryReportColumns(message?.columns);
138
- setColumns(nextColumns);
139
- setRows(normalizeQueryReportRows(message?.result, nextColumns));
140
- setServerMessage(typeof message?.message === "string" ? message.message : void 0);
141
- setExecutionTime(typeof message?.execution_time === "number" ? message.execution_time : void 0);
142
- setError(void 0);
143
- }).catch(err => {
144
- if (cancelled) return;
145
- setColumns([]);
146
- setRows([]);
147
- setError(humanizeFrappeError(err));
148
- }).finally(() => {
149
- if (cancelled) return;
150
- setRunning(false);
151
- setLoading(false);
152
- });
153
- return () => {
154
- cancelled = true;
155
- };
156
- }, [app, fixture, reportName, filters, filterMeta, generation, sourcesSettled, metaDisabled, hasMissingRequired]);
157
- const setFilters = useCallback(next => {
158
- setFiltersState(next);
159
- }, []);
160
- const reload = useCallback(() => {
161
- setGeneration(previous => previous + 1);
162
- }, []);
163
- const fixtureResult = useMemo(() => {
164
- if (!fixture) return void 0;
165
- const fixtureColumns = normalizeQueryReportColumns(fixture.columns);
166
- return {
167
- columns: fixtureColumns,
168
- rows: normalizeQueryReportRows(fixture.rows, fixtureColumns),
169
- meta: fixture.meta ? {
170
- name: reportName,
171
- ...fixture.meta
172
- } : void 0
173
- };
174
- }, [fixture, reportName]);
175
- if (fixtureResult) {
176
- return {
177
- meta: fixtureResult.meta,
178
- columns: fixtureResult.columns,
179
- rows: hasMissingRequired ? [] : fixtureResult.rows,
180
- loading: false,
181
- running: false,
182
- error: void 0,
183
- serverMessage: fixture?.message,
184
- executionTime: void 0,
185
- filterMeta,
186
- scriptFilterGap,
187
- missingRequired,
188
- filters,
189
- setFilters,
190
- reload
191
- };
192
- }
193
- return {
194
- meta,
195
- columns,
196
- rows,
197
- loading,
198
- running,
199
- error,
200
- serverMessage,
201
- executionTime,
202
- filterMeta,
203
- scriptFilterGap,
204
- missingRequired,
205
- filters,
206
- setFilters,
207
- reload
208
- };
209
- }
210
- export { buildRunFilters2 as buildRunFilters, compactQueryReportFilters, defaultFilterValues2 as defaultFilterValues, extractScriptFilters2 as extractScriptFilters, isEmptyFilterValue2 as isEmptyFilterValue, normalizeQueryReportColumns2 as normalizeQueryReportColumns, normalizeQueryReportRows2 as normalizeQueryReportRows, scrubFieldname, stripHtml, useQueryReport };
1
+ import { buildRunFilters, compactQueryReportFilters, defaultFilterValues, extractScriptFilters, isEmptyFilterValue, normalizeQueryReportColumns, normalizeQueryReportRows, scrubFieldname, stripReportHtml, useQueryReport } from "@multiplatform.one/frappe-ui";
2
+ export { buildRunFilters, compactQueryReportFilters, defaultFilterValues, extractScriptFilters, isEmptyFilterValue, normalizeQueryReportColumns, normalizeQueryReportRows, scrubFieldname, stripReportHtml as stripHtml, useQueryReport };
211
3
  //# sourceMappingURL=useQueryReport.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useMemo","useRef","useState","useFrappeApp","buildRunFilters","defaultFilterValues","extractScriptFilters","humanizeFrappeError","isEmptyFilterValue","normalizeFilterMeta","normalizeQueryReportColumns","normalizeQueryReportRows","buildRunFilters2","compactQueryReportFilters","defaultFilterValues2","extractScriptFilters2","isEmptyFilterValue2","normalizeQueryReportColumns2","normalizeQueryReportRows2","scrubFieldname","stripHtml","RUN_METHOD","SCRIPT_METHOD","fetchReportMeta","app","reportName","res","call","get","doctype","name","doc","payload","message","Error","fetchReportScript","report_name","script","useQueryReport","options","fixture","initialFiltersRef","initialFilters","current","meta","setMeta","setScript","sourcesSettled","setSourcesSettled","filters","setFiltersState","columns","setColumns","rows","setRows","loading","setLoading","running","setRunning","error","setError","serverMessage","setServerMessage","executionTime","setExecutionTime","generation","setGeneration","seededFor","lastReport","cancelled","Promise","allSettled","then","metaResult","scriptResult","status","value","scriptText","extraction","merged","declared","defaults","Object","keys","length","previous","scriptExtraction","docFilterMeta","filterMeta","scriptFilterGap","declaredCount","missingRequired","filter","mandatory","fieldname","hasMissingRequired","metaDisabled","disabled","post","ignore_prepared_report","nextColumns","result","execution_time","catch","err","finally","setFilters","next","reload","fixtureResult","fixtureColumns"],"sources":["../../../src/report/useQueryReport.ts"],"sourcesContent":[null],"mappings":"AAwBA,SAASA,WAAA,EAAaC,SAAA,EAAWC,OAAA,EAASC,MAAA,EAAQC,QAAA,QAAgB;AAClE,SAASC,YAAA,QAAoB;AAC7B,SAQEC,eAAA,EACAC,mBAAA,EACAC,oBAAA,EACAC,mBAAA,EACAC,kBAAA,EACAC,mBAAA,EACAC,2BAAA,EACAC,wBAAA,QACK;AAEP,SACEP,eAAA,IAAAQ,gBAAA,EACAC,yBAAA,EACAR,mBAAA,IAAAS,oBAAA,EACAR,oBAAA,IAAAS,qBAAA,EACAP,kBAAA,IAAAQ,mBAAA,EACAN,2BAAA,IAAAO,4BAAA,EACAN,wBAAA,IAAAO,yBAAA,EACAC,cAAA,EACAC,SAAA,QACK;AAWP,MAAMC,UAAA,GAAa;AACnB,MAAMC,aAAA,GAAgB;AAmCtB,eAAeC,gBAAgBC,GAAA,EAAgBC,UAAA,EAA8C;EAC3F,MAAMC,GAAA,GAAM,MAAMF,GAAA,CAAIG,IAAA,CAAK,EAAEC,GAAA,CAAmC,qBAAqB;IACnFC,OAAA,EAAS;IACTC,IAAA,EAAML;EACR,CAAC;EACD,MAAMM,GAAA,GAAML,GAAA,CAAIM,OAAA,EAASC,OAAA;EACzB,IAAI,CAACF,GAAA,EAAK,MAAM,IAAIG,KAAA,CAAM,WAAWT,UAAU,aAAa;EAC5D,OAAOM,GAAA;AACT;AAEA,eAAeI,kBAAkBX,GAAA,EAAgBC,UAAA,EAAiD;EAChG,MAAMC,GAAA,G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names":["buildRunFilters","compactQueryReportFilters","defaultFilterValues","extractScriptFilters","isEmptyFilterValue","normalizeQueryReportColumns","normalizeQueryReportRows","scrubFieldname","stripReportHtml","useQueryReport"],"sources":["../../../src/report/useQueryReport.ts"],"sourcesContent":[null],"mappings":"AAGA,SACEA,eAAA,EACAC,yBAAA,EACAC,mBAAA,EACAC,oBAAA,EACAC,kBAAA,EACAC,2BAAA,EACAC,wBAAA,EACAC,cAAA,EACmBC,eAAA,EACnBC,cAAA,QACK","ignoreList":[]}