@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.
- package/README.md +1 -1
- package/dist/cjs/desk/DeskSurface.native.js.map +1 -1
- package/dist/cjs/form/DocFormScreen.cjs +167 -224
- package/dist/cjs/form/DocFormScreen.native.js +182 -259
- package/dist/cjs/form/DocFormScreen.native.js.map +1 -1
- package/dist/cjs/i18n/en.cjs +1 -0
- package/dist/cjs/i18n/en.native.js +1 -0
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/list/ListBulkActionsBar.cjs +30 -18
- package/dist/cjs/list/ListBulkActionsBar.native.js +43 -31
- package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/cjs/list/sidebar-section.cjs +15 -7
- package/dist/cjs/list/sidebar-section.native.js +16 -7
- package/dist/cjs/list/sidebar-section.native.js.map +1 -1
- package/dist/cjs/report/DoctypeReportView.cjs +20 -374
- package/dist/cjs/report/DoctypeReportView.native.js +23 -455
- package/dist/cjs/report/DoctypeReportView.native.js.map +1 -1
- package/dist/cjs/report/QueryReportScreen.cjs +33 -23
- package/dist/cjs/report/QueryReportScreen.native.js +33 -23
- package/dist/cjs/report/QueryReportScreen.native.js.map +1 -1
- package/dist/cjs/report/queryReportColumns.cjs +3 -105
- package/dist/cjs/report/queryReportColumns.native.js +2 -129
- package/dist/cjs/report/queryReportColumns.native.js.map +1 -1
- package/dist/cjs/report/queryReportFilterBar.cjs +3 -4
- package/dist/cjs/report/queryReportFilterBar.native.js +3 -4
- package/dist/cjs/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/cjs/report/queryReportUrlState.cjs +2 -2
- package/dist/cjs/report/queryReportUrlState.native.js +2 -2
- package/dist/cjs/report/queryReportUrlState.native.js.map +1 -1
- package/dist/cjs/report/report-grid.cjs +2 -426
- package/dist/cjs/report/report-grid.native.js +1 -479
- package/dist/cjs/report/report-grid.native.js.map +1 -1
- package/dist/cjs/report/report-toolbar.cjs +2 -228
- package/dist/cjs/report/report-toolbar.native.js +1 -274
- package/dist/cjs/report/report-toolbar.native.js.map +1 -1
- package/dist/cjs/report/reportShapes.cjs +12 -383
- package/dist/cjs/report/reportShapes.native.js +12 -501
- package/dist/cjs/report/reportShapes.native.js.map +1 -1
- package/dist/cjs/report/reportViewModel.cjs +20 -360
- package/dist/cjs/report/reportViewModel.native.js +19 -627
- package/dist/cjs/report/reportViewModel.native.js.map +1 -1
- package/dist/cjs/report/savedReports.cjs +2 -106
- package/dist/cjs/report/savedReports.native.js +1 -132
- package/dist/cjs/report/savedReports.native.js.map +1 -1
- package/dist/cjs/report/useQueryReport.cjs +11 -219
- package/dist/cjs/report/useQueryReport.native.js +11 -244
- package/dist/cjs/report/useQueryReport.native.js.map +1 -1
- package/dist/cjs/shared/measures.cjs +3 -5
- package/dist/cjs/shared/measures.native.js +3 -5
- package/dist/cjs/shared/measures.native.js.map +1 -1
- package/dist/cjs/views/ReportView.cjs +3 -256
- package/dist/cjs/views/ReportView.native.js +3 -382
- package/dist/cjs/views/ReportView.native.js.map +1 -1
- package/dist/cjs/views/report-controls.cjs +6 -6
- package/dist/cjs/views/report-controls.native.js +6 -6
- package/dist/cjs/views/report-controls.native.js.map +1 -1
- package/dist/esm/desk/DeskSurface.mjs.map +1 -1
- package/dist/esm/desk/DeskSurface.native.js.map +1 -1
- package/dist/esm/form/DocFormScreen.mjs +169 -226
- package/dist/esm/form/DocFormScreen.mjs.map +1 -1
- package/dist/esm/form/DocFormScreen.native.js +184 -261
- package/dist/esm/form/DocFormScreen.native.js.map +1 -1
- package/dist/esm/i18n/en.mjs +1 -0
- package/dist/esm/i18n/en.mjs.map +1 -1
- package/dist/esm/i18n/en.native.js +1 -0
- package/dist/esm/i18n/en.native.js.map +1 -1
- package/dist/esm/list/ListBulkActionsBar.mjs +31 -19
- package/dist/esm/list/ListBulkActionsBar.mjs.map +1 -1
- package/dist/esm/list/ListBulkActionsBar.native.js +37 -25
- package/dist/esm/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/esm/list/sidebar-section.mjs +16 -8
- package/dist/esm/list/sidebar-section.mjs.map +1 -1
- package/dist/esm/list/sidebar-section.native.js +17 -8
- package/dist/esm/list/sidebar-section.native.js.map +1 -1
- package/dist/esm/report/DoctypeReportView.mjs +21 -375
- package/dist/esm/report/DoctypeReportView.mjs.map +1 -1
- package/dist/esm/report/DoctypeReportView.native.js +24 -456
- package/dist/esm/report/DoctypeReportView.native.js.map +1 -1
- package/dist/esm/report/QueryReportScreen.mjs +26 -16
- package/dist/esm/report/QueryReportScreen.mjs.map +1 -1
- package/dist/esm/report/QueryReportScreen.native.js +26 -16
- package/dist/esm/report/QueryReportScreen.native.js.map +1 -1
- package/dist/esm/report/queryReportColumns.mjs +1 -103
- package/dist/esm/report/queryReportColumns.mjs.map +1 -1
- package/dist/esm/report/queryReportColumns.native.js +1 -117
- package/dist/esm/report/queryReportColumns.native.js.map +1 -1
- package/dist/esm/report/queryReportFilterBar.mjs +1 -2
- package/dist/esm/report/queryReportFilterBar.mjs.map +1 -1
- package/dist/esm/report/queryReportFilterBar.native.js +1 -2
- package/dist/esm/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/esm/report/queryReportUrlState.mjs +1 -1
- package/dist/esm/report/queryReportUrlState.native.js +1 -1
- package/dist/esm/report/report-grid.mjs +1 -425
- package/dist/esm/report/report-grid.mjs.map +1 -1
- package/dist/esm/report/report-grid.native.js +1 -468
- package/dist/esm/report/report-grid.native.js.map +1 -1
- package/dist/esm/report/report-toolbar.mjs +2 -228
- package/dist/esm/report/report-toolbar.mjs.map +1 -1
- package/dist/esm/report/report-toolbar.native.js +2 -264
- package/dist/esm/report/report-toolbar.native.js.map +1 -1
- package/dist/esm/report/reportShapes.mjs +2 -373
- package/dist/esm/report/reportShapes.mjs.map +1 -1
- package/dist/esm/report/reportShapes.native.js +2 -491
- package/dist/esm/report/reportShapes.native.js.map +1 -1
- package/dist/esm/report/reportViewModel.mjs +2 -342
- package/dist/esm/report/reportViewModel.mjs.map +1 -1
- package/dist/esm/report/reportViewModel.native.js +2 -610
- package/dist/esm/report/reportViewModel.native.js.map +1 -1
- package/dist/esm/report/savedReports.mjs +1 -105
- package/dist/esm/report/savedReports.mjs.map +1 -1
- package/dist/esm/report/savedReports.native.js +1 -132
- package/dist/esm/report/savedReports.native.js.map +1 -1
- package/dist/esm/report/useQueryReport.mjs +2 -210
- package/dist/esm/report/useQueryReport.mjs.map +1 -1
- package/dist/esm/report/useQueryReport.native.js +2 -235
- package/dist/esm/report/useQueryReport.native.js.map +1 -1
- package/dist/esm/shared/measures.mjs +1 -3
- package/dist/esm/shared/measures.mjs.map +1 -1
- package/dist/esm/shared/measures.native.js +1 -3
- package/dist/esm/shared/measures.native.js.map +1 -1
- package/dist/esm/views/ReportView.mjs +3 -256
- package/dist/esm/views/ReportView.mjs.map +1 -1
- package/dist/esm/views/ReportView.native.js +3 -382
- package/dist/esm/views/ReportView.native.js.map +1 -1
- package/dist/esm/views/report-controls.mjs +3 -3
- package/dist/esm/views/report-controls.mjs.map +1 -1
- package/dist/esm/views/report-controls.native.js +3 -3
- package/dist/esm/views/report-controls.native.js.map +1 -1
- package/dist/jsx/desk/DeskSurface.mjs.map +1 -1
- package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
- package/dist/jsx/form/DocFormScreen.mjs +169 -226
- package/dist/jsx/form/DocFormScreen.mjs.map +1 -1
- package/dist/jsx/form/DocFormScreen.native.js +182 -259
- package/dist/jsx/form/DocFormScreen.native.js.map +1 -1
- package/dist/jsx/i18n/en.mjs +1 -0
- package/dist/jsx/i18n/en.mjs.map +1 -1
- package/dist/jsx/i18n/en.native.js +1 -0
- package/dist/jsx/i18n/en.native.js.map +1 -1
- package/dist/jsx/list/ListBulkActionsBar.mjs +31 -19
- package/dist/jsx/list/ListBulkActionsBar.mjs.map +1 -1
- package/dist/jsx/list/ListBulkActionsBar.native.js +43 -31
- package/dist/jsx/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/jsx/list/sidebar-section.mjs +16 -8
- package/dist/jsx/list/sidebar-section.mjs.map +1 -1
- package/dist/jsx/list/sidebar-section.native.js +16 -7
- package/dist/jsx/list/sidebar-section.native.js.map +1 -1
- package/dist/jsx/report/DoctypeReportView.mjs +21 -375
- package/dist/jsx/report/DoctypeReportView.mjs.map +1 -1
- package/dist/jsx/report/DoctypeReportView.native.js +23 -455
- package/dist/jsx/report/DoctypeReportView.native.js.map +1 -1
- package/dist/jsx/report/QueryReportScreen.mjs +26 -16
- package/dist/jsx/report/QueryReportScreen.mjs.map +1 -1
- package/dist/jsx/report/QueryReportScreen.native.js +33 -23
- package/dist/jsx/report/QueryReportScreen.native.js.map +1 -1
- package/dist/jsx/report/queryReportColumns.mjs +1 -103
- package/dist/jsx/report/queryReportColumns.mjs.map +1 -1
- package/dist/jsx/report/queryReportColumns.native.js +2 -129
- package/dist/jsx/report/queryReportColumns.native.js.map +1 -1
- package/dist/jsx/report/queryReportFilterBar.mjs +1 -2
- package/dist/jsx/report/queryReportFilterBar.mjs.map +1 -1
- package/dist/jsx/report/queryReportFilterBar.native.js +3 -4
- package/dist/jsx/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/jsx/report/queryReportUrlState.mjs +1 -1
- package/dist/jsx/report/queryReportUrlState.native.js +2 -2
- package/dist/jsx/report/queryReportUrlState.native.js.map +1 -1
- package/dist/jsx/report/report-grid.mjs +1 -425
- package/dist/jsx/report/report-grid.mjs.map +1 -1
- package/dist/jsx/report/report-grid.native.js +1 -479
- package/dist/jsx/report/report-grid.native.js.map +1 -1
- package/dist/jsx/report/report-toolbar.mjs +2 -228
- package/dist/jsx/report/report-toolbar.mjs.map +1 -1
- package/dist/jsx/report/report-toolbar.native.js +1 -274
- package/dist/jsx/report/report-toolbar.native.js.map +1 -1
- package/dist/jsx/report/reportShapes.mjs +2 -373
- package/dist/jsx/report/reportShapes.mjs.map +1 -1
- package/dist/jsx/report/reportShapes.native.js +12 -501
- package/dist/jsx/report/reportShapes.native.js.map +1 -1
- package/dist/jsx/report/reportViewModel.mjs +2 -342
- package/dist/jsx/report/reportViewModel.mjs.map +1 -1
- package/dist/jsx/report/reportViewModel.native.js +19 -627
- package/dist/jsx/report/reportViewModel.native.js.map +1 -1
- package/dist/jsx/report/savedReports.mjs +1 -105
- package/dist/jsx/report/savedReports.mjs.map +1 -1
- package/dist/jsx/report/savedReports.native.js +1 -132
- package/dist/jsx/report/savedReports.native.js.map +1 -1
- package/dist/jsx/report/useQueryReport.mjs +2 -210
- package/dist/jsx/report/useQueryReport.mjs.map +1 -1
- package/dist/jsx/report/useQueryReport.native.js +11 -244
- package/dist/jsx/report/useQueryReport.native.js.map +1 -1
- package/dist/jsx/shared/measures.mjs +1 -3
- package/dist/jsx/shared/measures.mjs.map +1 -1
- package/dist/jsx/shared/measures.native.js +3 -5
- package/dist/jsx/shared/measures.native.js.map +1 -1
- package/dist/jsx/views/ReportView.mjs +3 -256
- package/dist/jsx/views/ReportView.mjs.map +1 -1
- package/dist/jsx/views/ReportView.native.js +3 -382
- package/dist/jsx/views/ReportView.native.js.map +1 -1
- package/dist/jsx/views/report-controls.mjs +3 -3
- package/dist/jsx/views/report-controls.mjs.map +1 -1
- package/dist/jsx/views/report-controls.native.js +6 -6
- package/dist/jsx/views/report-controls.native.js.map +1 -1
- package/package.json +12 -12
- package/src/backofficeScreens.designLaw.spec.ts +0 -5
- package/src/desk/DeskSurface.tsx +4 -7
- package/src/form/DocFormScreen.chrome.spec.ts +77 -0
- package/src/form/DocFormScreen.guest.screen.spec.tsx +175 -0
- package/src/form/DocFormScreen.rights.spec.tsx +7 -3
- package/src/form/DocFormScreen.tsx +214 -315
- package/src/i18n/en.ts +1 -0
- package/src/list/ListBulkActionsBar.rights.spec.tsx +134 -0
- package/src/list/ListBulkActionsBar.screen.spec.tsx +7 -1
- package/src/list/ListBulkActionsBar.tsx +76 -57
- package/src/list/ListFilterBar.screen.spec.tsx +14 -13
- package/src/list/sidebar-section.tsx +11 -3
- package/src/report/DoctypeReportView.tsx +28 -550
- package/src/report/QueryReportScreen.spec.tsx +75 -1
- package/src/report/QueryReportScreen.tsx +38 -22
- package/src/report/queryReportColumns.tsx +4 -123
- package/src/report/queryReportFilterBar.tsx +3 -5
- package/src/report/queryReportUrlState.ts +1 -1
- package/src/report/report-grid.tsx +4 -529
- package/src/report/report-toolbar.tsx +4 -308
- package/src/report/reportShapes.ts +25 -613
- package/src/report/reportShim.spec.ts +162 -0
- package/src/report/reportViewModel.ts +32 -605
- package/src/report/savedReports.ts +4 -161
- package/src/report/useQueryReport.ts +9 -347
- package/src/shared/measures.ts +3 -11
- package/src/views/ReportView.screen.spec.tsx +25 -20
- package/src/views/ReportView.tsx +7 -439
- package/src/views/report-controls.tsx +12 -20
- package/types/desk/DeskSurface.d.ts.map +1 -1
- package/types/form/DocFormScreen.d.ts +2 -2
- package/types/form/DocFormScreen.d.ts.map +1 -1
- package/types/i18n/en.d.ts +1 -0
- package/types/i18n/en.d.ts.map +1 -1
- package/types/list/ListBulkActionsBar.d.ts.map +1 -1
- package/types/list/sidebar-section.d.ts.map +1 -1
- package/types/report/DoctypeReportView.d.ts.map +1 -1
- package/types/report/QueryReportScreen.d.ts +1 -1
- package/types/report/QueryReportScreen.d.ts.map +1 -1
- package/types/report/queryReportColumns.d.ts +2 -11
- package/types/report/queryReportColumns.d.ts.map +1 -1
- package/types/report/queryReportFilterBar.d.ts +1 -1
- package/types/report/queryReportFilterBar.d.ts.map +1 -1
- package/types/report/queryReportUrlState.d.ts +1 -1
- package/types/report/queryReportUrlState.d.ts.map +1 -1
- package/types/report/report-grid.d.ts +2 -19
- package/types/report/report-grid.d.ts.map +1 -1
- package/types/report/report-toolbar.d.ts +2 -29
- package/types/report/report-toolbar.d.ts.map +1 -1
- package/types/report/reportShapes.d.ts +2 -115
- package/types/report/reportShapes.d.ts.map +1 -1
- package/types/report/reportViewModel.d.ts +2 -135
- package/types/report/reportViewModel.d.ts.map +1 -1
- package/types/report/savedReports.d.ts +2 -18
- package/types/report/savedReports.d.ts.map +1 -1
- package/types/report/useQueryReport.d.ts +2 -35
- package/types/report/useQueryReport.d.ts.map +1 -1
- package/types/shared/measures.d.ts +1 -2
- package/types/shared/measures.d.ts.map +1 -1
- package/types/views/ReportView.d.ts +3 -22
- package/types/views/ReportView.d.ts.map +1 -1
- package/types/views/report-controls.d.ts +2 -5
- package/types/views/report-controls.d.ts.map +1 -1
- package/src/report/report-grid.spec.tsx +0 -175
- package/src/report/report-toolbar.spec.tsx +0 -90
- package/src/report/reportShapes.spec.ts +0 -391
- package/src/report/reportViewModel.spec.ts +0 -393
|
@@ -1,343 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const REPORT_NUMERIC_FIELDTYPES = /* @__PURE__ */new Set(["Int", "Float", "Currency", "Percent", "Rating", "Duration"]);
|
|
4
|
-
const WIDE_FIELDTYPES = /* @__PURE__ */new Set(["Small Text", "Text", "Long Text", "Text Editor", "Markdown Editor", "Code", "JSON"]);
|
|
5
|
-
const REPORT_PAGE_SIZES = [20, 100, 500];
|
|
6
|
-
const DEFAULT_REPORT_PAGE_SIZE = REPORT_PAGE_SIZES[0];
|
|
7
|
-
function defaultColumnWidth(fieldtype) {
|
|
8
|
-
if (fieldtype === "Check") return 90;
|
|
9
|
-
if (REPORT_NUMERIC_FIELDTYPES.has(fieldtype)) return 110;
|
|
10
|
-
if (fieldtype === "Date") return 120;
|
|
11
|
-
if (fieldtype === "Datetime") return 165;
|
|
12
|
-
if (WIDE_FIELDTYPES.has(fieldtype)) return 240;
|
|
13
|
-
return 160;
|
|
14
|
-
}
|
|
15
|
-
function columnAlign(fieldtype) {
|
|
16
|
-
if (fieldtype === "Check") return "center";
|
|
17
|
-
return REPORT_NUMERIC_FIELDTYPES.has(fieldtype) ? "right" : "left";
|
|
18
|
-
}
|
|
19
|
-
function toColumnDef(field) {
|
|
20
|
-
const fieldtype = String(field.fieldtype);
|
|
21
|
-
return {
|
|
22
|
-
fieldname: field.fieldname,
|
|
23
|
-
label: field.label || field.fieldname,
|
|
24
|
-
fieldtype,
|
|
25
|
-
kind: fieldKind(fieldtype),
|
|
26
|
-
options: field.options,
|
|
27
|
-
width: defaultColumnWidth(fieldtype),
|
|
28
|
-
align: columnAlign(fieldtype)
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function standardReportColumns() {
|
|
32
|
-
return [{
|
|
33
|
-
fieldname: "name",
|
|
34
|
-
label: "ID",
|
|
35
|
-
fieldtype: "Data",
|
|
36
|
-
kind: "text",
|
|
37
|
-
width: 160,
|
|
38
|
-
align: "left"
|
|
39
|
-
}, {
|
|
40
|
-
fieldname: "owner",
|
|
41
|
-
label: "Created By",
|
|
42
|
-
fieldtype: "Link",
|
|
43
|
-
kind: "link",
|
|
44
|
-
options: "User",
|
|
45
|
-
width: 160,
|
|
46
|
-
align: "left"
|
|
47
|
-
}, {
|
|
48
|
-
fieldname: "creation",
|
|
49
|
-
label: "Created On",
|
|
50
|
-
fieldtype: "Datetime",
|
|
51
|
-
kind: "date",
|
|
52
|
-
width: 165,
|
|
53
|
-
align: "left"
|
|
54
|
-
}, {
|
|
55
|
-
fieldname: "modified",
|
|
56
|
-
label: "Last Updated On",
|
|
57
|
-
fieldtype: "Datetime",
|
|
58
|
-
kind: "date",
|
|
59
|
-
width: 165,
|
|
60
|
-
align: "left"
|
|
61
|
-
}, {
|
|
62
|
-
fieldname: "modified_by",
|
|
63
|
-
label: "Last Updated By",
|
|
64
|
-
fieldtype: "Link",
|
|
65
|
-
kind: "link",
|
|
66
|
-
options: "User",
|
|
67
|
-
width: 160,
|
|
68
|
-
align: "left"
|
|
69
|
-
}];
|
|
70
|
-
}
|
|
71
|
-
function reportColumnsFromMeta(meta) {
|
|
72
|
-
const out = [];
|
|
73
|
-
const seen = /* @__PURE__ */new Set();
|
|
74
|
-
const push = column => {
|
|
75
|
-
if (!column.fieldname || seen.has(column.fieldname)) return;
|
|
76
|
-
seen.add(column.fieldname);
|
|
77
|
-
out.push(column);
|
|
78
|
-
};
|
|
79
|
-
push(standardReportColumns()[0]);
|
|
80
|
-
for (const field of meta?.fields ?? []) {
|
|
81
|
-
const fieldtype = String(field.fieldtype);
|
|
82
|
-
if (VALUELESS_FIELDTYPES.has(fieldtype) || fieldtype.startsWith("Table")) continue;
|
|
83
|
-
push(toColumnDef(field));
|
|
84
|
-
}
|
|
85
|
-
for (const standard of standardReportColumns()) push(standard);
|
|
86
|
-
return out;
|
|
87
|
-
}
|
|
88
|
-
function defaultReportFieldnames(meta) {
|
|
89
|
-
const out = [];
|
|
90
|
-
const seen = /* @__PURE__ */new Set();
|
|
91
|
-
const push = fieldname => {
|
|
92
|
-
if (!fieldname || seen.has(fieldname)) return;
|
|
93
|
-
seen.add(fieldname);
|
|
94
|
-
out.push(fieldname);
|
|
95
|
-
};
|
|
96
|
-
const pickable = field => {
|
|
97
|
-
const fieldtype = String(field.fieldtype);
|
|
98
|
-
return !VALUELESS_FIELDTYPES.has(fieldtype) && !fieldtype.startsWith("Table") && field.report_hide !== 1;
|
|
99
|
-
};
|
|
100
|
-
const fields = meta?.fields ?? [];
|
|
101
|
-
push("name");
|
|
102
|
-
const status = fields.find(field => field.fieldname === "status");
|
|
103
|
-
if (status && pickable(status)) push("status");
|
|
104
|
-
push(meta?.title_field);
|
|
105
|
-
push(meta?.image_field);
|
|
106
|
-
const flagged = fields.filter(field => pickable(field) && (field.in_list_view === 1 || field.in_standard_filter === 1));
|
|
107
|
-
for (const field of flagged) push(field.fieldname);
|
|
108
|
-
for (const field of flagged) {
|
|
109
|
-
if (String(field.fieldtype) !== "Currency" || !field.options) continue;
|
|
110
|
-
push(field.options.includes(":") ? field.options.split(":")[1] : field.options);
|
|
111
|
-
}
|
|
112
|
-
push("modified");
|
|
113
|
-
return out;
|
|
114
|
-
}
|
|
115
|
-
function resolveSelectedColumns(all, fieldnames) {
|
|
116
|
-
const byName = new Map(all.map(column => [column.fieldname, column]));
|
|
117
|
-
const out = [];
|
|
118
|
-
for (const fieldname of fieldnames) {
|
|
119
|
-
const column = byName.get(fieldname);
|
|
120
|
-
if (column) out.push(column);
|
|
121
|
-
}
|
|
122
|
-
return out;
|
|
123
|
-
}
|
|
124
|
-
const COMPARISON_PREFIXES = [">=", "<=", "!=", ">", "<", "="];
|
|
125
|
-
const CHECK_TRUE = /* @__PURE__ */new Set(["1", "true", "yes", "y", "\u2713"]);
|
|
126
|
-
const CHECK_FALSE = /* @__PURE__ */new Set(["0", "false", "no", "n"]);
|
|
127
|
-
function columnFilterTuple(column, raw) {
|
|
128
|
-
const text = raw.trim();
|
|
129
|
-
if (!text) return null;
|
|
130
|
-
switch (column.kind) {
|
|
131
|
-
case "check":
|
|
132
|
-
{
|
|
133
|
-
const lowered = text.toLowerCase();
|
|
134
|
-
if (CHECK_TRUE.has(lowered)) return [column.fieldname, "=", 1];
|
|
135
|
-
if (CHECK_FALSE.has(lowered)) return [column.fieldname, "=", 0];
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
case "select":
|
|
139
|
-
{
|
|
140
|
-
const match = selectOptionsFromField(column.options).find(option => option.value.toLowerCase() === text.toLowerCase());
|
|
141
|
-
if (match) return [column.fieldname, "=", match.value];
|
|
142
|
-
return [column.fieldname, "like", text.includes("%") ? text : `%${text}%`];
|
|
143
|
-
}
|
|
144
|
-
case "number":
|
|
145
|
-
case "date":
|
|
146
|
-
{
|
|
147
|
-
for (const prefix of COMPARISON_PREFIXES) {
|
|
148
|
-
if (text.startsWith(prefix)) {
|
|
149
|
-
const value = text.slice(prefix.length).trim();
|
|
150
|
-
return value ? [column.fieldname, prefix, value] : null;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return [column.fieldname, "=", text];
|
|
154
|
-
}
|
|
155
|
-
default:
|
|
156
|
-
return [column.fieldname, "like", text.includes("%") ? text : `%${text}%`];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function columnFilterTuples(columns, filters) {
|
|
160
|
-
const out = [];
|
|
161
|
-
for (const column of columns) {
|
|
162
|
-
const raw = filters[column.fieldname];
|
|
163
|
-
if (raw === void 0) continue;
|
|
164
|
-
const tuple = columnFilterTuple(column, raw);
|
|
165
|
-
if (tuple) out.push(tuple);
|
|
166
|
-
}
|
|
167
|
-
return out;
|
|
168
|
-
}
|
|
169
|
-
function parseReportFiltersParam(raw) {
|
|
170
|
-
if (typeof raw !== "string" || !raw) return void 0;
|
|
171
|
-
const candidates = [raw];
|
|
172
|
-
try {
|
|
173
|
-
const decoded = decodeURIComponent(raw);
|
|
174
|
-
if (decoded !== raw) candidates.push(decoded);
|
|
175
|
-
} catch {}
|
|
176
|
-
for (const candidate of candidates) {
|
|
177
|
-
try {
|
|
178
|
-
const parsed = JSON.parse(candidate);
|
|
179
|
-
if (!Array.isArray(parsed)) continue;
|
|
180
|
-
const filters = [];
|
|
181
|
-
for (const tuple of parsed) {
|
|
182
|
-
if (Array.isArray(tuple) && tuple.length === 3 && typeof tuple[0] === "string" && typeof tuple[1] === "string") {
|
|
183
|
-
filters.push([tuple[0], tuple[1], tuple[2]]);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (filters.length > 0) return filters;
|
|
187
|
-
} catch {}
|
|
188
|
-
}
|
|
189
|
-
return void 0;
|
|
190
|
-
}
|
|
191
|
-
const BACKTICK_FIELD_RE = /`tab([^`]+)`\.`([^`]+)`/;
|
|
192
|
-
function toDeskFieldExpr(doctype, fieldname) {
|
|
193
|
-
return `\`tab${doctype}\`.\`${fieldname}\``;
|
|
194
|
-
}
|
|
195
|
-
function parseDeskOrderBy(orderBy) {
|
|
196
|
-
if (typeof orderBy !== "string" || !orderBy.trim()) return void 0;
|
|
197
|
-
const [expr, direction] = orderBy.trim().split(/\s+/);
|
|
198
|
-
const backticked = expr.match(BACKTICK_FIELD_RE);
|
|
199
|
-
const field = backticked ? backticked[2] : expr.replace(/`/g, "");
|
|
200
|
-
if (!field) return void 0;
|
|
201
|
-
return {
|
|
202
|
-
field,
|
|
203
|
-
order: direction?.toLowerCase() === "asc" ? "asc" : "desc"
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function toDeskReportSettings(doctype, config) {
|
|
207
|
-
const sort = config.sort ?? {
|
|
208
|
-
field: "modified",
|
|
209
|
-
order: "desc"
|
|
210
|
-
};
|
|
211
|
-
return {
|
|
212
|
-
fields: config.fieldnames.map(fieldname => [fieldname, doctype]),
|
|
213
|
-
filters: config.filters.map(([fieldname, operator, value]) => [doctype, fieldname, operator, value]),
|
|
214
|
-
order_by: `${toDeskFieldExpr(doctype, sort.field)} ${sort.order}`,
|
|
215
|
-
add_totals_row: config.addTotals ? 1 : 0,
|
|
216
|
-
page_length: config.pageSize ?? DEFAULT_REPORT_PAGE_SIZE,
|
|
217
|
-
column_widths: {},
|
|
218
|
-
group_by: config.groupBy ? {
|
|
219
|
-
group_by: toDeskFieldExpr(doctype, config.groupBy),
|
|
220
|
-
aggregate_function: "count",
|
|
221
|
-
aggregate_on: null
|
|
222
|
-
} : null
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
function fromDeskReportSettings(doctype, json) {
|
|
226
|
-
if (!json || typeof json !== "object") return void 0;
|
|
227
|
-
const raw = json;
|
|
228
|
-
const fieldnames = [];
|
|
229
|
-
if (Array.isArray(raw.fields)) {
|
|
230
|
-
for (const entry of raw.fields) {
|
|
231
|
-
if (typeof entry === "string") {
|
|
232
|
-
fieldnames.push(entry);
|
|
233
|
-
} else if (Array.isArray(entry) && typeof entry[0] === "string") {
|
|
234
|
-
const fieldDoctype = typeof entry[1] === "string" ? entry[1] : doctype;
|
|
235
|
-
if (fieldDoctype === doctype) fieldnames.push(entry[0]);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
const filters = [];
|
|
240
|
-
if (Array.isArray(raw.filters)) {
|
|
241
|
-
for (const entry of raw.filters) {
|
|
242
|
-
if (!Array.isArray(entry)) continue;
|
|
243
|
-
if (entry.length === 4) {
|
|
244
|
-
const [filterDoctype, fieldname, operator, value] = entry;
|
|
245
|
-
if (filterDoctype === doctype && typeof fieldname === "string" && typeof operator === "string") {
|
|
246
|
-
filters.push([fieldname, operator, value]);
|
|
247
|
-
}
|
|
248
|
-
} else if (entry.length === 3 && typeof entry[0] === "string" && typeof entry[1] === "string") {
|
|
249
|
-
filters.push([entry[0], entry[1], entry[2]]);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
const groupByRaw = raw.group_by;
|
|
254
|
-
const groupByExpr = typeof groupByRaw?.group_by === "string" ? groupByRaw.group_by : void 0;
|
|
255
|
-
const groupByMatch = groupByExpr?.match(BACKTICK_FIELD_RE);
|
|
256
|
-
return {
|
|
257
|
-
fieldnames,
|
|
258
|
-
filters,
|
|
259
|
-
sort: parseDeskOrderBy(raw.order_by),
|
|
260
|
-
pageSize: typeof raw.page_length === "number" && raw.page_length > 0 ? raw.page_length : void 0,
|
|
261
|
-
groupBy: groupByMatch ? groupByMatch[2] : null,
|
|
262
|
-
addTotals: raw.add_totals_row === 1
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
function isNullish(value) {
|
|
266
|
-
return value === null || value === void 0;
|
|
267
|
-
}
|
|
268
|
-
function compareCellValues(a, b) {
|
|
269
|
-
if (isNullish(a) && isNullish(b)) return 0;
|
|
270
|
-
if (isNullish(a)) return 1;
|
|
271
|
-
if (isNullish(b)) return -1;
|
|
272
|
-
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
273
|
-
const left = String(a);
|
|
274
|
-
const right = String(b);
|
|
275
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
276
|
-
}
|
|
277
|
-
function orderReportRows(rows, sort, groupBy) {
|
|
278
|
-
const direction = sort.order === "asc" ? 1 : -1;
|
|
279
|
-
const sorted = [...rows];
|
|
280
|
-
sorted.sort((a, b) => {
|
|
281
|
-
if (groupBy) {
|
|
282
|
-
const grouped = compareCellValues(a[groupBy], b[groupBy]);
|
|
283
|
-
if (grouped !== 0) return grouped;
|
|
284
|
-
}
|
|
285
|
-
const left = a[sort.field];
|
|
286
|
-
const right = b[sort.field];
|
|
287
|
-
const ordered = isNullish(left) || isNullish(right) ? compareCellValues(left, right) : direction * compareCellValues(left, right);
|
|
288
|
-
return ordered || compareCellValues(a.name, b.name);
|
|
289
|
-
});
|
|
290
|
-
return sorted;
|
|
291
|
-
}
|
|
292
|
-
function buildGridRows(orderedRows, pageStart, pageSize, groupBy) {
|
|
293
|
-
const page = orderedRows.slice(pageStart, pageStart + pageSize);
|
|
294
|
-
const out = [];
|
|
295
|
-
let previousGroup;
|
|
296
|
-
const counts = /* @__PURE__ */new Map();
|
|
297
|
-
if (groupBy) {
|
|
298
|
-
for (const row of orderedRows) {
|
|
299
|
-
const groupKey = String(row[groupBy] ?? "");
|
|
300
|
-
counts.set(groupKey, (counts.get(groupKey) ?? 0) + 1);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
page.forEach((row, index) => {
|
|
304
|
-
if (groupBy) {
|
|
305
|
-
const groupKey = String(row[groupBy] ?? "");
|
|
306
|
-
if (previousGroup === void 0 || groupKey !== previousGroup) {
|
|
307
|
-
previousGroup = groupKey;
|
|
308
|
-
out.push({
|
|
309
|
-
kind: "group",
|
|
310
|
-
key: `group:${groupKey}:${pageStart + index}`,
|
|
311
|
-
value: row[groupBy],
|
|
312
|
-
count: counts.get(groupKey) ?? 0
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
out.push({
|
|
317
|
-
kind: "row",
|
|
318
|
-
key: row.name,
|
|
319
|
-
row,
|
|
320
|
-
index: pageStart + index + 1
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
return out;
|
|
324
|
-
}
|
|
325
|
-
function computeTotals(columns, rows) {
|
|
326
|
-
if (rows.length === 0) return [];
|
|
327
|
-
return columns.filter(column => REPORT_NUMERIC_FIELDTYPES.has(column.fieldtype)).map(column => ({
|
|
328
|
-
fieldname: column.fieldname,
|
|
329
|
-
fieldtype: column.fieldtype,
|
|
330
|
-
value: rows.reduce((sum, row) => sum + (Number(row[column.fieldname]) || 0), 0)
|
|
331
|
-
}));
|
|
332
|
-
}
|
|
333
|
-
function escapeCsvCell(value) {
|
|
334
|
-
if (value === null || value === void 0) return "";
|
|
335
|
-
const text = String(value);
|
|
336
|
-
return /[",\n]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
|
|
337
|
-
}
|
|
338
|
-
function buildReportCsv(columns, rows) {
|
|
339
|
-
const lines = [columns.map(column => escapeCsvCell(column.label)).join(","), ...rows.map(row => columns.map(column => escapeCsvCell(row[column.fieldname])).join(","))];
|
|
340
|
-
return lines.join("\n");
|
|
341
|
-
}
|
|
342
|
-
export { DEFAULT_REPORT_PAGE_SIZE, REPORT_NUMERIC_FIELDTYPES, REPORT_PAGE_SIZES, buildGridRows, buildReportCsv, columnAlign, columnFilterTuple, columnFilterTuples, compareCellValues, computeTotals, defaultColumnWidth, defaultReportFieldnames, fromDeskReportSettings, orderReportRows, parseDeskOrderBy, parseReportFiltersParam, reportColumnsFromMeta, resolveSelectedColumns, toDeskReportSettings };
|
|
1
|
+
import { buildReportGridRows, buildReportCsv, reportColumnAlign, reportColumnFilterTuple, reportColumnFilterTuples, compareReportCellValues, computeReportTotals, DEFAULT_REPORT_PAGE_SIZE, defaultReportColumnWidth, defaultReportFieldnames, fromDeskReportSettings, orderReportRows, parseDeskOrderBy, parseReportFiltersParam, REPORT_NUMERIC_FIELDTYPES, REPORT_PAGE_SIZES, reportColumnsFromMeta, resolveReportColumns, toDeskReportSettings } from "@multiplatform.one/frappe-ui";
|
|
2
|
+
export { DEFAULT_REPORT_PAGE_SIZE, REPORT_NUMERIC_FIELDTYPES, REPORT_PAGE_SIZES, buildReportGridRows as buildGridRows, buildReportCsv, reportColumnAlign as columnAlign, reportColumnFilterTuple as columnFilterTuple, reportColumnFilterTuples as columnFilterTuples, compareReportCellValues as compareCellValues, computeReportTotals as computeTotals, defaultReportColumnWidth as defaultColumnWidth, defaultReportFieldnames, fromDeskReportSettings, orderReportRows, parseDeskOrderBy, parseReportFiltersParam, reportColumnsFromMeta, resolveReportColumns as resolveSelectedColumns, toDeskReportSettings };
|
|
343
3
|
//# sourceMappingURL=reportViewModel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fieldKind","selectOptionsFromField","VALUELESS_FIELDTYPES","Set","REPORT_NUMERIC_FIELDTYPES","WIDE_FIELDTYPES","REPORT_PAGE_SIZES","DEFAULT_REPORT_PAGE_SIZE","defaultColumnWidth","fieldtype","has","columnAlign","toColumnDef","field","String","fieldname","label","kind","options","width","align","standardReportColumns","reportColumnsFromMeta","meta","out","seen","push","column","add","fields","startsWith","standard","defaultReportFieldnames","pickable","report_hide","status","find","title_field","image_field","flagged","filter","in_list_view","in_standard_filter","includes","split","resolveSelectedColumns","all","fieldnames","byName","Map","map","get","COMPARISON_PREFIXES","CHECK_TRUE","CHECK_FALSE","columnFilterTuple","raw","text","trim","lowered","toLowerCase","match","option","value","prefix","slice","length","columnFilterTuples","columns","filters","tuple","parseReportFiltersParam","candidates","decoded","decodeURIComponent","candidate","parsed","JSON","parse","Array","isArray","BACKTICK_FIELD_RE","toDeskFieldExpr","doctype","parseDeskOrderBy","orderBy","expr","direction","backticked","replace","order","toDeskReportSettings","config","sort","operator","order_by","add_totals_row","addTotals","page_length","pageSize","column_widths","group_by","groupBy","aggregate_function","aggregate_on","fromDeskReportSettings","json","entry","fieldDoctype","filterDoctype","groupByRaw","groupByExpr","groupByMatch","isNullish","compareCellValues","a","b","left","right","orderReportRows","rows","sorted","grouped","ordered","name","buildGridRows","orderedRows","pageStart","page","previousGroup","counts","row","groupKey","set","forEach","index","key","count","computeTotals","reduce","sum","Number","escapeCsvCell","test","buildReportCsv","lines","join"],"sources":["../../../src/report/reportViewModel.ts"],"sourcesContent":[null],"mappings":"AAMA,SACEA,SAAA,EACAC,sBAAA,QAE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C,EAAEmI,IAAA,CAAK,GAAG,CAAC,EAC9F;EACA,OAAOD,KAAA,CAAMC,IAAA,CAAK,IAAI;AACxB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["buildReportGridRows","buildReportCsv","reportColumnAlign","reportColumnFilterTuple","reportColumnFilterTuples","compareReportCellValues","computeReportTotals","DEFAULT_REPORT_PAGE_SIZE","defaultReportColumnWidth","defaultReportFieldnames","fromDeskReportSettings","orderReportRows","parseDeskOrderBy","parseReportFiltersParam","REPORT_NUMERIC_FIELDTYPES","REPORT_PAGE_SIZES","reportColumnsFromMeta","resolveReportColumns","toDeskReportSettings"],"sources":["../../../src/report/reportViewModel.ts"],"sourcesContent":[null],"mappings":"AAGA,SACyBA,mBAAA,EACvBC,cAAA,EACqBC,iBAAA,EACMC,uBAAA,EACCC,wBAAA,EACDC,uBAAA,EACJC,mBAAA,EACvBC,wBAAA,EAC4BC,wBAAA,EAC5BC,uBAAA,EACAC,sBAAA,EACAC,eAAA,EACAC,gBAAA,EACAC,uBAAA,EACAC,yBAAA,EACAC,iBAAA,EACAC,qBAAA,EACwBC,oBAAA,EACxBC,oBAAA,QACK","ignoreList":[]}
|