@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.28.8 → 4.29.1
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/dpr/all.js +6 -8
- package/dpr/all.js.map +3 -3
- package/dpr/all.scss +296 -414
- package/dpr/all.ts +6 -11
- package/dpr/components/_catalogue/catalogue-list/utils.test.ts +1 -1
- package/dpr/components/_charts/chart/ChartTimeseries.js +3 -2
- package/dpr/components/_charts/chart/ChartTimeseries.js.map +2 -2
- package/dpr/components/_charts/chart/ChartTimeseries.ts +4 -2
- package/dpr/components/_charts/chart/clientClass.js +1 -0
- package/dpr/components/_charts/chart/clientClass.js.map +2 -2
- package/dpr/components/_charts/chart/clientClass.ts +1 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js.map +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.js +1 -1
- package/dpr/components/_reports/report-heading/report-actions/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.ts +1 -1
- package/dpr/components/_reports/report-heading/report-actions/types.d.js.map +7 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.ts +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js.map +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.test.ts +2 -2
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.js +1 -3
- package/dpr/components/_reports/report-heading/report-columns/report-columns-form/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.ts +1 -3
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js.map +1 -1
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.js +1 -1
- package/dpr/components/_reports/report-heading/report-columns/report-columns-form/utils.js.map +7 -0
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.ts +2 -2
- package/dpr/components/_reports/{report-columns → report-heading/report-columns}/view.njk +1 -1
- package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.js +1 -1
- package/dpr/components/_reports/report-heading/report-download-message/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.ts +1 -1
- package/dpr/components/_reports/{report-filters → report-heading/report-filters}/view.njk +1 -1
- package/dpr/components/_reports/report-heading/view.njk +4 -4
- package/dpr/components/_reports/report-page/report-print-message/view.njk +10 -0
- package/dpr/components/_reports/report-page/report-template/report-no-data-message/styles.scss +8 -0
- package/dpr/components/_reports/report-page/report-template/report-no-data-message/view.njk +11 -0
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.js +1 -1
- package/dpr/components/_reports/report-page/report-template/report-pagination/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.ts +1 -1
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.js.map +1 -1
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js.map +1 -1
- package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/styles.scss +88 -0
- package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/view.njk +29 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.js +17 -10
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.ts +20 -10
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/style.scss +35 -185
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/types.d.js.map +7 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/types.d.ts +2 -2
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/view.njk +27 -0
- package/dpr/components/_reports/report-page/report-template/report-section/styles.scss +33 -0
- package/dpr/components/_reports/report-page/report-template/report-section/view.njk +58 -0
- package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/styles.scss +21 -4
- package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js.map +1 -1
- package/dpr/components/_reports/report-page/report-template/styles.scss +5 -0
- package/dpr/components/_reports/report-page/report-template/template-config.js +66 -0
- package/dpr/components/_reports/report-page/report-template/template-config.js.map +7 -0
- package/dpr/components/_reports/report-page/report-template/template-config.ts +45 -0
- package/dpr/components/_reports/report-page/report-template/utils.js +82 -0
- package/dpr/components/_reports/report-page/report-template/utils.js.map +7 -0
- package/dpr/components/_reports/report-page/report-template/utils.ts +100 -0
- package/dpr/components/_reports/report-page/report-template/view.njk +61 -0
- package/dpr/components/_reports/{report-wrapper → report-page}/styles.scss +7 -5
- package/dpr/components/_reports/report-page/view.njk +26 -0
- package/dpr/components/card-group/view.njk +0 -4
- package/dpr/components/report-list/utils.js +11 -3
- package/dpr/components/report-list/utils.js.map +2 -2
- package/dpr/components/report-list/utils.ts +11 -1
- package/dpr/components/report-list/view.njk +2 -2
- package/dpr/components/show-more/style.scss +3 -4
- package/dpr/data/reportingClient.js.map +2 -2
- package/dpr/data/reportingClient.ts +4 -4
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +1 -1
- package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/controller.ts +0 -1
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +207 -56
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.ts +333 -64
- package/dpr/routes/journeys/view-report/async/report/utils.js +9 -17
- package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/report/utils.ts +12 -22
- package/dpr/routes/journeys/view-report/report.njk +2 -2
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.ts +1 -1
- package/dpr/routes/journeys/view-report/sync/report/utils.js +38 -11
- package/dpr/routes/journeys/view-report/sync/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/report/utils.ts +39 -14
- package/dpr/routes/journeys/view-report/utils.js +1 -1
- package/dpr/routes/journeys/view-report/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/utils.ts +1 -1
- package/dpr/services/reportingService.js.map +2 -2
- package/dpr/services/reportingService.ts +2 -2
- package/dpr/types/ReportQuery.js +1 -1
- package/dpr/types/ReportQuery.js.map +1 -1
- package/dpr/types/ReportQuery.ts +1 -1
- package/dpr/types/UserReports.js.map +1 -1
- package/dpr/types/UserReports.ts +3 -3
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js +193 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.ts +203 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.ts +36 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js +114 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.ts +117 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.ts +6 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js +202 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js.map +7 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.ts +246 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js +17 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js.map +7 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.ts +41 -0
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.js → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js} +6 -8
- package/dpr/utils/TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js.map +7 -0
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.test.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.test.ts} +4 -4
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.ts} +6 -9
- package/dpr/utils/TemplateBuilder/TemplateBuilder.js +74 -0
- package/dpr/utils/TemplateBuilder/TemplateBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/TemplateBuilder.ts +68 -0
- package/dpr/utils/definitionUtils.js +22 -2
- package/dpr/utils/definitionUtils.js.map +2 -2
- package/dpr/utils/definitionUtils.ts +26 -1
- package/package.json +1 -1
- package/dpr/DprLoadingHelper.js +0 -51
- package/dpr/DprLoadingHelper.js.map +0 -7
- package/dpr/DprLoadingHelper.ts +0 -27
- package/dpr/components/_reports/report/view.njk +0 -40
- package/dpr/components/_reports/report-actions/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-actions/types.d.js.map +0 -7
- package/dpr/components/_reports/report-columns-form/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-columns-form/utils.js.map +0 -7
- package/dpr/components/_reports/report-data-table/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-data-table/types.d.js.map +0 -7
- package/dpr/components/_reports/report-data-table/utils.js +0 -123
- package/dpr/components/_reports/report-data-table/utils.js.map +0 -7
- package/dpr/components/_reports/report-data-table/utils.test.ts +0 -604
- package/dpr/components/_reports/report-data-table/utils.ts +0 -150
- package/dpr/components/_reports/report-data-table/view.njk +0 -24
- package/dpr/components/_reports/report-data-table-wrapper/view.njk +0 -27
- package/dpr/components/_reports/report-download-message/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-no-data-message/styles.scss +0 -4
- package/dpr/components/_reports/report-no-data-message/view.njk +0 -13
- package/dpr/components/_reports/report-pagination/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-print-message/view.njk +0 -8
- package/dpr/components/_reports/report-template/view.njk +0 -44
- package/dpr/components/_reports/report-wrapper/view.njk +0 -19
- package/dpr/components/loading-anim/styles.scss +0 -117
- package/dpr/components/loading-anim/view.njk +0 -18
- package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +0 -202
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.test.ts +0 -503
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.ts +0 -224
- package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/types.d.ts +0 -11
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +0 -311
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +0 -7
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.test.ts +0 -492
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.ts +0 -342
- package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +0 -7
- package/dpr/utils/SectionedDataTableBuilder/types.d.ts +0 -5
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +0 -146
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +0 -7
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.test.ts +0 -140
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.ts +0 -150
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.ts +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/style.scss +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/view.njk +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/style.scss +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.ts +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/view.njk +0 -0
- /package/dpr/components/_reports/{report-columns → report-heading/report-columns}/styles.scss +0 -0
- /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/style.scss +0 -0
- /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/view.njk +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/style.scss +0 -0
- /package/dpr/components/_reports/{report-data-table → report-page/report-template/report-pagination}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.test.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/view.njk +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-section/report-data-table}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/view.njk +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/style.scss +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/view.njk +0 -0
- /package/dpr/utils/{ParentChildDataTableBuilder → TemplateBuilder/ParentChildDataBuilder}/types.d.js +0 -0
- /package/dpr/utils/{SectionedDataTableBuilder → TemplateBuilder/ReportBuilder}/types.d.js +0 -0
|
@@ -63,7 +63,10 @@ export const getCurrentVariantDefinition = (
|
|
|
63
63
|
return undefined
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export const getFieldDisplayName = (
|
|
66
|
+
export const getFieldDisplayName = (
|
|
67
|
+
fields: components['schemas']['FieldDefinition'][] | components['schemas']['SummaryField'][],
|
|
68
|
+
fieldId: string,
|
|
69
|
+
) => {
|
|
67
70
|
const ids = fieldId.split('.')
|
|
68
71
|
const field = fields.find((f) => {
|
|
69
72
|
return f.name === ids[0]
|
|
@@ -100,6 +103,28 @@ export const getFilters = (
|
|
|
100
103
|
return filters.length ? filters : []
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
export const getFieldsByName = (
|
|
107
|
+
names: string[],
|
|
108
|
+
fields: components['schemas']['FieldDefinition'][],
|
|
109
|
+
): components['schemas']['FieldDefinition'][] => {
|
|
110
|
+
return names.map((s) => fields.find((field) => field.name === s)).filter((field) => field !== undefined)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const validateDefinition = (definition: components['schemas']['SingleVariantReportDefinition']) => {
|
|
114
|
+
const { variant } = definition
|
|
115
|
+
return validateVariant(variant)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const validateVariant = (variant: components['schemas']['VariantDefinition']) => {
|
|
119
|
+
const { specification } = variant
|
|
120
|
+
|
|
121
|
+
if (!specification) {
|
|
122
|
+
throw new Error('No specification in definition')
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return { variant, specification }
|
|
126
|
+
}
|
|
127
|
+
|
|
103
128
|
export const getReportSummary = (
|
|
104
129
|
reportId: string,
|
|
105
130
|
reportingService: ReportingService,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
|
|
3
3
|
"description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.29.1",
|
|
5
5
|
"main": "dpr/all",
|
|
6
6
|
"sass": "dpr/all.scss",
|
|
7
7
|
"engines": {
|
package/dpr/DprLoadingHelper.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var DprLoadingHelper_exports = {};
|
|
20
|
-
__export(DprLoadingHelper_exports, {
|
|
21
|
-
DprLoadingHelper: () => DprLoadingHelper,
|
|
22
|
-
default: () => DprLoadingHelper_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(DprLoadingHelper_exports);
|
|
25
|
-
class DprLoadingHelper {
|
|
26
|
-
showLoadingAnimation(wrapperClass) {
|
|
27
|
-
const loadingPanelClass = ".dpr-loading-panel";
|
|
28
|
-
document.querySelectorAll(loadingPanelClass).forEach((l) => {
|
|
29
|
-
l.classList.add("show");
|
|
30
|
-
});
|
|
31
|
-
let loadingAnimClass = ".dpr-loading-anim";
|
|
32
|
-
if (wrapperClass) loadingAnimClass = `.${wrapperClass} ${loadingAnimClass}`;
|
|
33
|
-
document.querySelectorAll(loadingAnimClass).forEach((l) => {
|
|
34
|
-
l.classList.add("show");
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
hideLoadingAnimation() {
|
|
38
|
-
document.querySelectorAll(".dpr-loading-panel").forEach((l) => {
|
|
39
|
-
l.classList.remove("show");
|
|
40
|
-
});
|
|
41
|
-
document.querySelectorAll(".dpr-loading-anim").forEach((l) => {
|
|
42
|
-
l.classList.remove("show");
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
var DprLoadingHelper_default = DprLoadingHelper;
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
DprLoadingHelper
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=DprLoadingHelper.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../dpr/DprLoadingHelper.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-nocheck\nclass DprLoadingHelper {\n showLoadingAnimation(wrapperClass) {\n const loadingPanelClass = '.dpr-loading-panel'\n document.querySelectorAll(loadingPanelClass).forEach((l) => {\n l.classList.add('show')\n })\n\n let loadingAnimClass = '.dpr-loading-anim'\n if (wrapperClass) loadingAnimClass = `.${wrapperClass} ${loadingAnimClass}`\n document.querySelectorAll(loadingAnimClass).forEach((l) => {\n l.classList.add('show')\n })\n }\n\n hideLoadingAnimation() {\n document.querySelectorAll('.dpr-loading-panel').forEach((l) => {\n l.classList.remove('show')\n })\n document.querySelectorAll('.dpr-loading-anim').forEach((l) => {\n l.classList.remove('show')\n })\n }\n}\n\nexport { DprLoadingHelper }\nexport default DprLoadingHelper\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,MAAM,iBAAiB;AAAA,EACrB,qBAAqB,cAAc;AACjC,UAAM,oBAAoB;AAC1B,aAAS,iBAAiB,iBAAiB,EAAE,QAAQ,CAAC,MAAM;AAC1D,QAAE,UAAU,IAAI,MAAM;AAAA,IACxB,CAAC;AAED,QAAI,mBAAmB;AACvB,QAAI,aAAc,oBAAmB,IAAI,YAAY,IAAI,gBAAgB;AACzE,aAAS,iBAAiB,gBAAgB,EAAE,QAAQ,CAAC,MAAM;AACzD,QAAE,UAAU,IAAI,MAAM;AAAA,IACxB,CAAC;AAAA,EACH;AAAA,EAEA,uBAAuB;AACrB,aAAS,iBAAiB,oBAAoB,EAAE,QAAQ,CAAC,MAAM;AAC7D,QAAE,UAAU,OAAO,MAAM;AAAA,IAC3B,CAAC;AACD,aAAS,iBAAiB,mBAAmB,EAAE,QAAQ,CAAC,MAAM;AAC5D,QAAE,UAAU,OAAO,MAAM;AAAA,IAC3B,CAAC;AAAA,EACH;AACF;AAGA,IAAO,2BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dpr/DprLoadingHelper.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
class DprLoadingHelper {
|
|
3
|
-
showLoadingAnimation(wrapperClass) {
|
|
4
|
-
const loadingPanelClass = '.dpr-loading-panel'
|
|
5
|
-
document.querySelectorAll(loadingPanelClass).forEach((l) => {
|
|
6
|
-
l.classList.add('show')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
let loadingAnimClass = '.dpr-loading-anim'
|
|
10
|
-
if (wrapperClass) loadingAnimClass = `.${wrapperClass} ${loadingAnimClass}`
|
|
11
|
-
document.querySelectorAll(loadingAnimClass).forEach((l) => {
|
|
12
|
-
l.classList.add('show')
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
hideLoadingAnimation() {
|
|
17
|
-
document.querySelectorAll('.dpr-loading-panel').forEach((l) => {
|
|
18
|
-
l.classList.remove('show')
|
|
19
|
-
})
|
|
20
|
-
document.querySelectorAll('.dpr-loading-anim').forEach((l) => {
|
|
21
|
-
l.classList.remove('show')
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { DprLoadingHelper }
|
|
27
|
-
export default DprLoadingHelper
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{% from "../report-data-table-wrapper/view.njk" import dprDataTableWrapper %}
|
|
2
|
-
{% from "../report-summary-table/view.njk" import dprReportSummary %}
|
|
3
|
-
{% from "../report-totals/view.njk" import dprReportTotals %}
|
|
4
|
-
{% from "../report-no-data-message/view.njk" import dprReportNoDataMessage %}
|
|
5
|
-
{% from "../../code-block/view.njk" import dprCodeBlock %}
|
|
6
|
-
|
|
7
|
-
{% macro dprReport(options, count, template) %}
|
|
8
|
-
{% set reportSummaries = options.reportSummaries %}
|
|
9
|
-
{% set dataTable = options.dataTable %}
|
|
10
|
-
{% set pagination = options.pagination %}
|
|
11
|
-
{% set classification = options.classification %}
|
|
12
|
-
{% set template = options.template %}
|
|
13
|
-
|
|
14
|
-
{% if not count or count === 0 %}
|
|
15
|
-
{{ dprReportNoDataMessage(url) }}
|
|
16
|
-
{% else %}
|
|
17
|
-
|
|
18
|
-
{{ dprReportSummary(reportSummaries, 'page-header') }}
|
|
19
|
-
{{ dprReportTotals(options.totals) }}
|
|
20
|
-
<div class='dpr-table-container dpr-table-container--{{ template }}'>
|
|
21
|
-
{% if template === 'summary-section' %}
|
|
22
|
-
{% for datatable in dataTable[0].rows %}
|
|
23
|
-
{% if datatable[0].html %}
|
|
24
|
-
{{ datatable[0].html | safe }}
|
|
25
|
-
{% endif %}
|
|
26
|
-
{% endfor %}
|
|
27
|
-
{% else %}
|
|
28
|
-
{{ dprDataTableWrapper(dataTable, classification) }}
|
|
29
|
-
{% endif %}
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div class='govuk-!-margin-bottom-6 govuk-!-margin-top-6'>
|
|
33
|
-
{{ dprReportTotals(options.totals) }}
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
{{ dprReportSummary(reportSummaries, 'page-footer') }}
|
|
37
|
-
|
|
38
|
-
{% endif %}
|
|
39
|
-
|
|
40
|
-
{% endmacro %}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-actions/clientClass.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-nocheck\nimport { DprClientClass } from '../../../DprClientClass'\n\nclass IconButtonList extends DprClientClass {\n static getModuleName() {\n return 'report-actions'\n }\n\n initialise() {\n this.refreshButton = document.getElementById('dpr-button-refresh')\n this.printButton = document.getElementById('dpr-button-printable')\n this.shareButton = document.getElementById('dpr-button-sharable')\n this.downloadButton = document.getElementById('dpr-button-downloadable')\n this.copyButton = document.getElementById('dpr-button-copy')\n\n this.initRefreshEvent()\n this.initPrintButtonEvent()\n this.initShareButtonEvent()\n this.initCopyButtonEvent()\n }\n\n initPrintButtonEvent() {\n if (this.printButton) {\n const disabled = this.printButton.getAttribute('data-disabled')\n this.printButton.addEventListener('click', () => {\n if (disabled !== 'true') {\n window.print()\n }\n })\n\n this.printButton.addEventListener('keyup', (e) => {\n if (e.key === 'Enter') {\n if (disabled !== 'true') {\n window.print()\n }\n }\n })\n }\n }\n\n initShareButtonEvent() {\n if (this.shareButton) {\n const href = this.shareButton.getAttribute('data-href')\n this.shareButton.addEventListener('click', () => {\n window.location = href\n })\n\n this.shareButton.addEventListener('keyup', (e) => {\n if (e.key === 'Enter') {\n window.location = href\n }\n })\n }\n }\n\n initCopyButtonEvent() {\n if (this.copyButton) {\n const href = this.copyButton.getAttribute('data-href')\n this.copyButton.addEventListener('click', () => {\n navigator.clipboard.writeText(href)\n })\n\n this.copyButton.addEventListener('keyup', (e) => {\n if (e.key === 'Enter') {\n navigator.clipboard.writeText(href)\n }\n })\n }\n }\n\n initRefreshEvent() {\n if (this.refreshButton) {\n const href = this.refreshButton.getAttribute('data-href')\n this.refreshButton.addEventListener('click', () => {\n window.location = href\n })\n\n this.refreshButton.addEventListener('keyup', (e) => {\n if (e.key === 'Enter') {\n window.location = href\n }\n })\n }\n }\n}\n\nexport { IconButtonList }\nexport default IconButtonList\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAA+B;AAE/B,MAAM,uBAAuB,qCAAe;AAAA,EAC1C,OAAO,gBAAgB;AACrB,WAAO;AAAA,EACT;AAAA,EAEA,aAAa;AACX,SAAK,gBAAgB,SAAS,eAAe,oBAAoB;AACjE,SAAK,cAAc,SAAS,eAAe,sBAAsB;AACjE,SAAK,cAAc,SAAS,eAAe,qBAAqB;AAChE,SAAK,iBAAiB,SAAS,eAAe,yBAAyB;AACvE,SAAK,aAAa,SAAS,eAAe,iBAAiB;AAE3D,SAAK,iBAAiB;AACtB,SAAK,qBAAqB;AAC1B,SAAK,qBAAqB;AAC1B,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEA,uBAAuB;AACrB,QAAI,KAAK,aAAa;AACpB,YAAM,WAAW,KAAK,YAAY,aAAa,eAAe;AAC9D,WAAK,YAAY,iBAAiB,SAAS,MAAM;AAC/C,YAAI,aAAa,QAAQ;AACvB,iBAAO,MAAM;AAAA,QACf;AAAA,MACF,CAAC;AAED,WAAK,YAAY,iBAAiB,SAAS,CAAC,MAAM;AAChD,YAAI,EAAE,QAAQ,SAAS;AACrB,cAAI,aAAa,QAAQ;AACvB,mBAAO,MAAM;AAAA,UACf;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,QAAI,KAAK,aAAa;AACpB,YAAM,OAAO,KAAK,YAAY,aAAa,WAAW;AACtD,WAAK,YAAY,iBAAiB,SAAS,MAAM;AAC/C,eAAO,WAAW;AAAA,MACpB,CAAC;AAED,WAAK,YAAY,iBAAiB,SAAS,CAAC,MAAM;AAChD,YAAI,EAAE,QAAQ,SAAS;AACrB,iBAAO,WAAW;AAAA,QACpB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,sBAAsB;AACpB,QAAI,KAAK,YAAY;AACnB,YAAM,OAAO,KAAK,WAAW,aAAa,WAAW;AACrD,WAAK,WAAW,iBAAiB,SAAS,MAAM;AAC9C,kBAAU,UAAU,UAAU,IAAI;AAAA,MACpC,CAAC;AAED,WAAK,WAAW,iBAAiB,SAAS,CAAC,MAAM;AAC/C,YAAI,EAAE,QAAQ,SAAS;AACrB,oBAAU,UAAU,UAAU,IAAI;AAAA,QACpC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,mBAAmB;AACjB,QAAI,KAAK,eAAe;AACtB,YAAM,OAAO,KAAK,cAAc,aAAa,WAAW;AACxD,WAAK,cAAc,iBAAiB,SAAS,MAAM;AACjD,eAAO,WAAW;AAAA,MACpB,CAAC;AAED,WAAK,cAAc,iBAAiB,SAAS,CAAC,MAAM;AAClD,YAAI,EAAE,QAAQ,SAAS;AACrB,iBAAO,WAAW;AAAA,QACpB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-actions/types.d.ts"],
|
|
4
|
-
"sourcesContent": ["import { LoadType, ReportType } from '../../../types/UserReports'\n\nexport interface DownloadActionParams {\n enabled: boolean\n csrfToken: string\n reportId: string\n reportName: string\n name: string\n id: string\n tableId?: string\n columns: string[]\n definitionPath: string\n canDownload: boolean\n loadType: LoadType\n currentUrl: string\n currentQueryParams?: string | undefined\n nestedBaseUrl: string\n sortColumn?: string\n sortedAsc?: string\n}\n\nexport interface ShareActionParams {\n reportName: string\n name: string\n url: string\n}\n\nexport interface RefreshActionParams {\n url: string\n executionId: string\n}\n\nexport interface PrintActionParams {\n enabled: boolean\n}\n\nexport interface CopyActionParams {\n url: string\n}\n\nexport interface GetActionsParams {\n refresh?: RefreshActionParams\n print?: PrintActionParams\n copy?: CopyActionParams\n share?: ShareActionParams\n download?: DownloadActionParams\n}\n\nexport interface ActionTemplate {\n id: string\n disabled: boolean\n text: string\n ariaLabelText: string\n}\n\nexport interface ActionTemplates {\n refresh: ActionTemplate\n printable: ActionTemplate\n sharable: ActionTemplate\n copy: ActionTemplate\n downloadable: ActionTemplate\n}\n\nexport interface ReportAction {\n id: string\n disabled: boolean\n text: string\n ariaLabelText: string\n href?: string\n attributes?: {\n reportId?: string\n id?: string\n csrfToken?: string\n tableId?: string\n type?: ReportType\n reportName?: string\n name?: string\n columns: string[]\n definitionPath: string\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-columns-form/clientClass.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-nocheck\nimport DprQueryParamClass from '../../../DprQueryParamClass'\n\nclass Columns extends DprQueryParamClass {\n static getModuleName() {\n return 'columns'\n }\n\n initialise() {\n this.form = this.getElement()\n this.embbeddedReportList = document.getElementById('dpr-embedded-report-list')\n this.submitButton = this.getElement().querySelector('.dpr-apply-columns-button')\n this.resetButton = this.getElement().querySelector('.dpr-reset-columns-button')\n\n this.initInputsFromQueryParams()\n this.initQueryParamsFromInputs(this.form.elements)\n this.initInputEvents(this.form.elements)\n\n this.initSubmitButton()\n this.initResetButton()\n }\n\n initSubmitButton() {\n this.submitButton.addEventListener('click', (e) => {\n e.preventDefault()\n this.loadingHelper.showLoadingAnimation()\n\n if (this.embbeddedReportList) {\n window.location.reload()\n } else {\n this.form.requestSubmit()\n }\n })\n }\n\n initResetButton() {\n this.resetButton.addEventListener('click', (e) => {\n e.preventDefault()\n this.loadingHelper.showLoadingAnimation()\n this.clearQueryParams('columns')\n window.location.reload()\n })\n }\n}\n\nexport { Columns }\nexport default Columns\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gCAA+B;AAE/B,MAAM,gBAAgB,0BAAAA,QAAmB;AAAA,EACvC,OAAO,gBAAgB;AACrB,WAAO;AAAA,EACT;AAAA,EAEA,aAAa;AACX,SAAK,OAAO,KAAK,WAAW;AAC5B,SAAK,sBAAsB,SAAS,eAAe,0BAA0B;AAC7E,SAAK,eAAe,KAAK,WAAW,EAAE,cAAc,2BAA2B;AAC/E,SAAK,cAAc,KAAK,WAAW,EAAE,cAAc,2BAA2B;AAE9E,SAAK,0BAA0B;AAC/B,SAAK,0BAA0B,KAAK,KAAK,QAAQ;AACjD,SAAK,gBAAgB,KAAK,KAAK,QAAQ;AAEvC,SAAK,iBAAiB;AACtB,SAAK,gBAAgB;AAAA,EACvB;AAAA,EAEA,mBAAmB;AACjB,SAAK,aAAa,iBAAiB,SAAS,CAAC,MAAM;AACjD,QAAE,eAAe;AACjB,WAAK,cAAc,qBAAqB;AAExC,UAAI,KAAK,qBAAqB;AAC5B,eAAO,SAAS,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,KAAK,cAAc;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBAAkB;AAChB,SAAK,YAAY,iBAAiB,SAAS,CAAC,MAAM;AAChD,QAAE,eAAe;AACjB,WAAK,cAAc,qBAAqB;AACxC,WAAK,iBAAiB,SAAS;AAC/B,aAAO,SAAS,OAAO;AAAA,IACzB,CAAC;AAAA,EACH;AACF;AAGA,IAAO,sBAAQ;",
|
|
6
|
-
"names": ["DprQueryParamClass"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-columns-form/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { Request } from 'express'\nimport { components } from '../../../types/api'\nimport { Column, Columns } from './types'\nimport { distinct } from '../../../utils/arrayUtils'\n\nexport const mandatoryColumns = (fields: Array<components['schemas']['FieldDefinition']>) =>\n fields.filter((field) => field.mandatory).map((field) => field.name)\n\nconst visibleColumns = (fields: Array<components['schemas']['FieldDefinition']>) =>\n fields.filter((field) => field.visible).map((field) => field.name)\n\nexport const ensureMandatoryColumns = (\n fields: Array<components['schemas']['FieldDefinition']>,\n queryColumns?: string[] | string,\n) => {\n let queryCols\n if (queryColumns) {\n queryCols = Array.isArray(queryColumns) ? queryColumns : [queryColumns]\n }\n const visibleCols = visibleColumns(fields)\n const mandatoryCols = mandatoryColumns(fields)\n\n const columns = queryCols || visibleCols\n return [...mandatoryCols, ...columns].reduce(distinct, [])\n}\n\n/**\n * Converts the columns from a DPD into a column readable format\n *\n * @param specification\n * @param requestedColumns\n */\nexport const getColumns = (specification: components['schemas']['Specification'], req: Request): Columns => {\n const requestedColumns = <string[] | string | undefined>req.query['columns']\n const { fields } = specification\n\n const options: Column[] = fields\n .filter((field) => !specification.sections || !specification.sections.includes(field.name))\n .map((field) => ({\n text: field.display,\n value: field.name,\n disabled: field.mandatory,\n }))\n\n return {\n name: 'columns',\n options,\n text: 'Select report columns',\n value: ensureMandatoryColumns(fields, requestedColumns),\n }\n}\n\nexport default {\n getColumns,\n ensureMandatoryColumns,\n mandatoryColumns,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyB;AAElB,MAAM,mBAAmB,CAAC,WAC/B,OAAO,OAAO,CAAC,UAAU,MAAM,SAAS,EAAE,IAAI,CAAC,UAAU,MAAM,IAAI;AAErE,MAAM,iBAAiB,CAAC,WACtB,OAAO,OAAO,CAAC,UAAU,MAAM,OAAO,EAAE,IAAI,CAAC,UAAU,MAAM,IAAI;AAE5D,MAAM,yBAAyB,CACpC,QACA,iBACG;AACH,MAAI;AACJ,MAAI,cAAc;AAChB,gBAAY,MAAM,QAAQ,YAAY,IAAI,eAAe,CAAC,YAAY;AAAA,EACxE;AACA,QAAM,cAAc,eAAe,MAAM;AACzC,QAAM,gBAAgB,iBAAiB,MAAM;AAE7C,QAAM,UAAU,aAAa;AAC7B,SAAO,CAAC,GAAG,eAAe,GAAG,OAAO,EAAE,OAAO,4BAAU,CAAC,CAAC;AAC3D;AAQO,MAAM,aAAa,CAAC,eAAuD,QAA0B;AAC1G,QAAM,mBAAkD,IAAI,MAAM,SAAS;AAC3E,QAAM,EAAE,OAAO,IAAI;AAEnB,QAAM,UAAoB,OACvB,OAAO,CAAC,UAAU,CAAC,cAAc,YAAY,CAAC,cAAc,SAAS,SAAS,MAAM,IAAI,CAAC,EACzF,IAAI,CAAC,WAAW;AAAA,IACf,MAAM,MAAM;AAAA,IACZ,OAAO,MAAM;AAAA,IACb,UAAU,MAAM;AAAA,EAClB,EAAE;AAEJ,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,MAAM;AAAA,IACN,OAAO,uBAAuB,QAAQ,gBAAgB;AAAA,EACxD;AACF;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-data-table/clientClass.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-nocheck\nimport { DprClientClass } from '../../../DprClientClass'\n\nclass DataTable extends DprClientClass {\n static getModuleName() {\n return 'data-table'\n }\n\n initialise() {\n this.tableContainer = document.getElementById('dpr-table-wrapper')\n this.table = document.getElementById('dpr-data-table')\n this.overflowGradient = document.getElementById('dpr-overflow-gradient')\n this.createTableHeaderAndFooter()\n this.initTableScrollListener()\n }\n\n initTableScrollListener() {\n this.checkOffsetWidths()\n\n window.addEventListener('resize', () => {\n this.checkOffsetWidths()\n })\n\n this.tableContainer.addEventListener('scroll', (event) => {\n const endOfScroll = this.table.offsetWidth\n const currentScroll = event.target.offsetWidth + event.target.scrollLeft\n if (endOfScroll === currentScroll) {\n this.overflowGradient.style.display = 'none'\n } else {\n this.overflowGradient.style.display = 'block'\n }\n })\n }\n\n checkOffsetWidths() {\n if (this.tableContainer.offsetWidth >= this.table.offsetWidth) {\n this.overflowGradient.style.display = 'none'\n } else {\n this.overflowGradient.style.display = 'block'\n }\n }\n\n createTableHeaderAndFooter() {\n if (this.table) {\n const classification = this.table.getAttribute('data-classification')\n const headLength = Number(this.table.getAttribute('data-col-length'))\n const classificationContent = `<b>${classification}</b>`\n\n // Headers\n const header = this.table.createTHead()\n\n const classificationHeaderRow = header.insertRow(0)\n const classificationHeaderCell = classificationHeaderRow.insertCell(0)\n classificationHeaderCell.outerHTML = `<th class=\"govuk-table__header govuk-table__cell--content print-header-footer\" colspan=${headLength}>${classificationContent}</th>`\n\n // Footers\n const footer = this.table.createTFoot()\n\n const classificationFooterRow = footer.insertRow(0)\n const classificationFooterCell = classificationFooterRow.insertCell(0)\n classificationFooterCell.outerHTML = `<td class=\"govuk-table__cell govuk-table__cell--content print-header-footer table-row--no-border\" colspan=${headLength}>${classificationContent}</td>`\n }\n }\n}\n\nexport { DataTable }\nexport default DataTable\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAA+B;AAE/B,MAAM,kBAAkB,qCAAe;AAAA,EACrC,OAAO,gBAAgB;AACrB,WAAO;AAAA,EACT;AAAA,EAEA,aAAa;AACX,SAAK,iBAAiB,SAAS,eAAe,mBAAmB;AACjE,SAAK,QAAQ,SAAS,eAAe,gBAAgB;AACrD,SAAK,mBAAmB,SAAS,eAAe,uBAAuB;AACvE,SAAK,2BAA2B;AAChC,SAAK,wBAAwB;AAAA,EAC/B;AAAA,EAEA,0BAA0B;AACxB,SAAK,kBAAkB;AAEvB,WAAO,iBAAiB,UAAU,MAAM;AACtC,WAAK,kBAAkB;AAAA,IACzB,CAAC;AAED,SAAK,eAAe,iBAAiB,UAAU,CAAC,UAAU;AACxD,YAAM,cAAc,KAAK,MAAM;AAC/B,YAAM,gBAAgB,MAAM,OAAO,cAAc,MAAM,OAAO;AAC9D,UAAI,gBAAgB,eAAe;AACjC,aAAK,iBAAiB,MAAM,UAAU;AAAA,MACxC,OAAO;AACL,aAAK,iBAAiB,MAAM,UAAU;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,oBAAoB;AAClB,QAAI,KAAK,eAAe,eAAe,KAAK,MAAM,aAAa;AAC7D,WAAK,iBAAiB,MAAM,UAAU;AAAA,IACxC,OAAO;AACL,WAAK,iBAAiB,MAAM,UAAU;AAAA,IACxC;AAAA,EACF;AAAA,EAEA,6BAA6B;AAC3B,QAAI,KAAK,OAAO;AACd,YAAM,iBAAiB,KAAK,MAAM,aAAa,qBAAqB;AACpE,YAAM,aAAa,OAAO,KAAK,MAAM,aAAa,iBAAiB,CAAC;AACpE,YAAM,wBAAwB,MAAM,cAAc;AAGlD,YAAM,SAAS,KAAK,MAAM,YAAY;AAEtC,YAAM,0BAA0B,OAAO,UAAU,CAAC;AAClD,YAAM,2BAA2B,wBAAwB,WAAW,CAAC;AACrE,+BAAyB,YAAY,0FAA0F,UAAU,IAAI,qBAAqB;AAGlK,YAAM,SAAS,KAAK,MAAM,YAAY;AAEtC,YAAM,0BAA0B,OAAO,UAAU,CAAC;AAClD,YAAM,2BAA2B,wBAAwB,WAAW,CAAC;AACrE,+BAAyB,YAAY,6GAA6G,UAAU,IAAI,qBAAqB;AAAA,IACvL;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-data-table/types.d.ts"],
|
|
4
|
-
"sourcesContent": ["import { DataTable } from '../../../utils/DataTableBuilder/types'\nimport { Pagination } from '../report-pagination/types'\n\nexport interface DataTableOptions {\n dataTable: DataTable\n classification: string\n printable?: boolean\n pagination: Pagination\n totals: string\n count?: number\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var utils_exports = {};
|
|
30
|
-
__export(utils_exports, {
|
|
31
|
-
createDataTable: () => createDataTable,
|
|
32
|
-
default: () => utils_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(utils_exports);
|
|
35
|
-
var import_CollatedSummaryBuilder = __toESM(require("../../../utils/CollatedSummaryBuilder/CollatedSummaryBuilder"));
|
|
36
|
-
var import_DataTableBuilder = __toESM(require("../../../utils/DataTableBuilder/DataTableBuilder"));
|
|
37
|
-
var import_ParentChildDataTableBuilder = __toESM(require("../../../utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder"));
|
|
38
|
-
var import_SectionedDataTableBuilder = __toESM(require("../../../utils/SectionedDataTableBuilder/SectionedDataTableBuilder"));
|
|
39
|
-
var import_SectionedFieldsTableBuilder = __toESM(require("../../../utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder"));
|
|
40
|
-
const validateDefinition = (definition) => {
|
|
41
|
-
const { variant } = definition;
|
|
42
|
-
const { specification } = variant;
|
|
43
|
-
if (!specification) {
|
|
44
|
-
throw new Error("No specification in definition");
|
|
45
|
-
}
|
|
46
|
-
return { variant, specification };
|
|
47
|
-
};
|
|
48
|
-
const buildListTable = (definition, columns, reportData, summariesData, reportQuery) => {
|
|
49
|
-
const { variant, specification } = validateDefinition(definition);
|
|
50
|
-
const { interactive } = variant;
|
|
51
|
-
const collatedSummaryBuilder = new import_CollatedSummaryBuilder.default(specification, summariesData);
|
|
52
|
-
return new import_DataTableBuilder.default(specification.fields).withSummaries(collatedSummaryBuilder.collateDataTableSummaries()).withHeaderOptions({
|
|
53
|
-
columns: columns.value,
|
|
54
|
-
reportQuery,
|
|
55
|
-
interactive: Boolean(interactive)
|
|
56
|
-
}).buildTable(reportData);
|
|
57
|
-
};
|
|
58
|
-
const buildParentChildTable = (definition, columns, reportData, childData) => {
|
|
59
|
-
return new import_ParentChildDataTableBuilder.default(definition.variant).withNoHeaderOptions(columns.value).withChildData(childData).buildTable(reportData);
|
|
60
|
-
};
|
|
61
|
-
const buildSummarySectionTable = (definition, columns, reportData, summariesData, reportQuery) => {
|
|
62
|
-
const { variant, specification } = validateDefinition(definition);
|
|
63
|
-
const { interactive } = variant;
|
|
64
|
-
const collatedSummaryBuilder = new import_CollatedSummaryBuilder.default(specification, summariesData);
|
|
65
|
-
return new import_SectionedDataTableBuilder.default(specification).withSummaries(collatedSummaryBuilder.collateDataTableSummaries()).withHeaderOptions({
|
|
66
|
-
columns: columns.value,
|
|
67
|
-
reportQuery,
|
|
68
|
-
interactive: Boolean(interactive)
|
|
69
|
-
}).buildTable(reportData);
|
|
70
|
-
};
|
|
71
|
-
const buildRowSectionedTable = (definition, reportData, childData) => {
|
|
72
|
-
const { variant } = definition;
|
|
73
|
-
const { interactive } = variant;
|
|
74
|
-
return reportData.map((rowData) => {
|
|
75
|
-
return new import_SectionedFieldsTableBuilder.default(variant).withHeaderOptions({
|
|
76
|
-
columns: new Array(2),
|
|
77
|
-
interactive: Boolean(interactive)
|
|
78
|
-
}).withChildData(childData).buildTable([rowData]);
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
const createDataTable = (definition, columns, reportData, childData, summariesData, reportQuery) => {
|
|
82
|
-
let dataTables = [];
|
|
83
|
-
const { specification } = validateDefinition(definition);
|
|
84
|
-
const { template } = specification;
|
|
85
|
-
switch (template) {
|
|
86
|
-
case "summary-section":
|
|
87
|
-
case "list-section": {
|
|
88
|
-
const dataTable = buildSummarySectionTable(definition, columns, reportData, summariesData, reportQuery);
|
|
89
|
-
dataTables.push(dataTable);
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
case "parent-child":
|
|
93
|
-
case "parent-child-section": {
|
|
94
|
-
const dataTable = buildParentChildTable(definition, columns, reportData, childData);
|
|
95
|
-
dataTables.push(dataTable);
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
case "list": {
|
|
99
|
-
const dataTable = buildListTable(definition, columns, reportData, summariesData, reportQuery);
|
|
100
|
-
dataTables.push(dataTable);
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
case "row-section-child":
|
|
104
|
-
case "row-section": {
|
|
105
|
-
dataTables = buildRowSectionedTable(definition, reportData, childData);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
default: {
|
|
109
|
-
const dataTable = buildListTable(definition, columns, reportData, summariesData, reportQuery);
|
|
110
|
-
dataTables.push(dataTable);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return dataTables;
|
|
115
|
-
};
|
|
116
|
-
var utils_default = {
|
|
117
|
-
createDataTable
|
|
118
|
-
};
|
|
119
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
-
0 && (module.exports = {
|
|
121
|
-
createDataTable
|
|
122
|
-
});
|
|
123
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../dpr/components/_reports/report-data-table/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { components } from '../../../types/api'\nimport Dict = NodeJS.Dict\nimport ReportQuery from '../../../types/ReportQuery'\nimport { AsyncSummary } from '../../../types/UserReports'\nimport CollatedSummaryBuilder from '../../../utils/CollatedSummaryBuilder/CollatedSummaryBuilder'\nimport DataTableBuilder from '../../../utils/DataTableBuilder/DataTableBuilder'\nimport { Columns } from '../report-columns-form/types'\nimport { ChildData } from '../../../utils/ParentChildDataTableBuilder/types'\nimport ParentChildDataTableBuilder from '../../../utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder'\nimport SectionedDataTableBuilder from '../../../utils/SectionedDataTableBuilder/SectionedDataTableBuilder'\nimport SectionedFieldsDataTableBuilder from '../../../utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder'\nimport { DataTable } from '../../../utils/DataTableBuilder/types'\nimport type { Template } from '../../../types/Templates'\n\nconst validateDefinition = (definition: components['schemas']['SingleVariantReportDefinition']) => {\n const { variant } = definition\n const { specification } = variant\n\n if (!specification) {\n throw new Error('No specification in definition')\n }\n\n return { variant, specification }\n}\n\nconst buildListTable = (\n definition: components['schemas']['SingleVariantReportDefinition'],\n columns: Columns,\n reportData: Dict<string>[],\n summariesData: AsyncSummary[],\n reportQuery: ReportQuery,\n): DataTable => {\n const { variant, specification } = validateDefinition(definition)\n const { interactive } = variant\n\n const collatedSummaryBuilder = new CollatedSummaryBuilder(specification, summariesData)\n return new DataTableBuilder(specification.fields)\n .withSummaries(collatedSummaryBuilder.collateDataTableSummaries())\n .withHeaderOptions({\n columns: columns.value,\n reportQuery,\n interactive: Boolean(interactive),\n })\n .buildTable(reportData)\n}\n\nconst buildParentChildTable = (\n definition: components['schemas']['SingleVariantReportDefinition'],\n columns: Columns,\n reportData: Dict<string>[],\n childData: ChildData[],\n): DataTable => {\n return new ParentChildDataTableBuilder(definition.variant)\n .withNoHeaderOptions(columns.value)\n .withChildData(childData)\n .buildTable(reportData)\n}\n\nconst buildSummarySectionTable = (\n definition: components['schemas']['SingleVariantReportDefinition'],\n columns: Columns,\n reportData: Dict<string>[],\n summariesData: AsyncSummary[],\n reportQuery: ReportQuery,\n): DataTable => {\n const { variant, specification } = validateDefinition(definition)\n const { interactive } = variant\n\n const collatedSummaryBuilder = new CollatedSummaryBuilder(specification, summariesData)\n return new SectionedDataTableBuilder(specification)\n .withSummaries(collatedSummaryBuilder.collateDataTableSummaries())\n .withHeaderOptions({\n columns: columns.value,\n reportQuery,\n interactive: Boolean(interactive),\n })\n .buildTable(reportData)\n}\n\nconst buildRowSectionedTable = (\n definition: components['schemas']['SingleVariantReportDefinition'],\n reportData: Dict<string>[],\n childData: ChildData[],\n): DataTable[] => {\n const { variant } = definition\n const { interactive } = variant\n\n return reportData.map((rowData) => {\n return new SectionedFieldsDataTableBuilder(variant)\n .withHeaderOptions({\n columns: new Array(2),\n interactive: Boolean(interactive),\n })\n .withChildData(childData)\n .buildTable([rowData])\n })\n}\n\nexport const createDataTable = (\n definition: components['schemas']['SingleVariantReportDefinition'],\n columns: Columns,\n reportData: Dict<string>[],\n childData: ChildData[],\n summariesData: AsyncSummary[],\n reportQuery: ReportQuery,\n): DataTable[] => {\n let dataTables: DataTable[] = []\n const { specification } = validateDefinition(definition)\n const { template } = specification\n\n switch (template as Template) {\n case 'summary-section':\n case 'list-section': {\n const dataTable = buildSummarySectionTable(definition, columns, reportData, summariesData, reportQuery)\n dataTables.push(dataTable)\n break\n }\n\n case 'parent-child':\n case 'parent-child-section': {\n const dataTable = buildParentChildTable(definition, columns, reportData, childData)\n dataTables.push(dataTable)\n break\n }\n\n case 'list': {\n const dataTable = buildListTable(definition, columns, reportData, summariesData, reportQuery)\n dataTables.push(dataTable)\n break\n }\n\n case 'row-section-child':\n case 'row-section': {\n dataTables = buildRowSectionedTable(definition, reportData, childData)\n break\n }\n\n default: {\n const dataTable = buildListTable(definition, columns, reportData, summariesData, reportQuery)\n dataTables.push(dataTable)\n break\n }\n }\n\n return dataTables\n}\n\nexport default {\n createDataTable,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oCAAmC;AACnC,8BAA6B;AAG7B,yCAAwC;AACxC,uCAAsC;AACtC,yCAA4C;AAI5C,MAAM,qBAAqB,CAAC,eAAuE;AACjG,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,EAAE,cAAc,IAAI;AAE1B,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AAEA,SAAO,EAAE,SAAS,cAAc;AAClC;AAEA,MAAM,iBAAiB,CACrB,YACA,SACA,YACA,eACA,gBACc;AACd,QAAM,EAAE,SAAS,cAAc,IAAI,mBAAmB,UAAU;AAChE,QAAM,EAAE,YAAY,IAAI;AAExB,QAAM,yBAAyB,IAAI,8BAAAA,QAAuB,eAAe,aAAa;AACtF,SAAO,IAAI,wBAAAC,QAAiB,cAAc,MAAM,EAC7C,cAAc,uBAAuB,0BAA0B,CAAC,EAChE,kBAAkB;AAAA,IACjB,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA,aAAa,QAAQ,WAAW;AAAA,EAClC,CAAC,EACA,WAAW,UAAU;AAC1B;AAEA,MAAM,wBAAwB,CAC5B,YACA,SACA,YACA,cACc;AACd,SAAO,IAAI,mCAAAC,QAA4B,WAAW,OAAO,EACtD,oBAAoB,QAAQ,KAAK,EACjC,cAAc,SAAS,EACvB,WAAW,UAAU;AAC1B;AAEA,MAAM,2BAA2B,CAC/B,YACA,SACA,YACA,eACA,gBACc;AACd,QAAM,EAAE,SAAS,cAAc,IAAI,mBAAmB,UAAU;AAChE,QAAM,EAAE,YAAY,IAAI;AAExB,QAAM,yBAAyB,IAAI,8BAAAF,QAAuB,eAAe,aAAa;AACtF,SAAO,IAAI,iCAAAG,QAA0B,aAAa,EAC/C,cAAc,uBAAuB,0BAA0B,CAAC,EAChE,kBAAkB;AAAA,IACjB,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA,aAAa,QAAQ,WAAW;AAAA,EAClC,CAAC,EACA,WAAW,UAAU;AAC1B;AAEA,MAAM,yBAAyB,CAC7B,YACA,YACA,cACgB;AAChB,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,EAAE,YAAY,IAAI;AAExB,SAAO,WAAW,IAAI,CAAC,YAAY;AACjC,WAAO,IAAI,mCAAAC,QAAgC,OAAO,EAC/C,kBAAkB;AAAA,MACjB,SAAS,IAAI,MAAM,CAAC;AAAA,MACpB,aAAa,QAAQ,WAAW;AAAA,IAClC,CAAC,EACA,cAAc,SAAS,EACvB,WAAW,CAAC,OAAO,CAAC;AAAA,EACzB,CAAC;AACH;AAEO,MAAM,kBAAkB,CAC7B,YACA,SACA,YACA,WACA,eACA,gBACgB;AAChB,MAAI,aAA0B,CAAC;AAC/B,QAAM,EAAE,cAAc,IAAI,mBAAmB,UAAU;AACvD,QAAM,EAAE,SAAS,IAAI;AAErB,UAAQ,UAAsB;AAAA,IAC5B,KAAK;AAAA,IACL,KAAK,gBAAgB;AACnB,YAAM,YAAY,yBAAyB,YAAY,SAAS,YAAY,eAAe,WAAW;AACtG,iBAAW,KAAK,SAAS;AACzB;AAAA,IACF;AAAA,IAEA,KAAK;AAAA,IACL,KAAK,wBAAwB;AAC3B,YAAM,YAAY,sBAAsB,YAAY,SAAS,YAAY,SAAS;AAClF,iBAAW,KAAK,SAAS;AACzB;AAAA,IACF;AAAA,IAEA,KAAK,QAAQ;AACX,YAAM,YAAY,eAAe,YAAY,SAAS,YAAY,eAAe,WAAW;AAC5F,iBAAW,KAAK,SAAS;AACzB;AAAA,IACF;AAAA,IAEA,KAAK;AAAA,IACL,KAAK,eAAe;AAClB,mBAAa,uBAAuB,YAAY,YAAY,SAAS;AACrE;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,YAAY,eAAe,YAAY,SAAS,YAAY,eAAe,WAAW;AAC5F,iBAAW,KAAK,SAAS;AACzB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,gBAAQ;AAAA,EACb;AACF;",
|
|
6
|
-
"names": ["CollatedSummaryBuilder", "DataTableBuilder", "ParentChildDataTableBuilder", "SectionedDataTableBuilder", "SectionedFieldsDataTableBuilder"]
|
|
7
|
-
}
|