@ministryofjustice/hmpps-digital-prison-reporting-frontend 7.0.2 → 7.1.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/_networkMocks/dashboard/definitions/visualisations/complete-dataset/bar/vis-definitions/cols-as-labels.d.ts +2 -0
- package/all.bundle.js +21 -33
- package/all.bundle.js.map +1 -1
- package/all.js +21 -33
- package/all.js.map +1 -1
- package/cjs/dpr/components/_catalogue/catalogue-list/utils.js +2 -2
- package/cjs/dpr/components/_catalogue/catalogue-list/utils.js.map +1 -1
- package/cjs/dpr/components/_charts/utils.js.map +1 -1
- package/cjs/dpr/components/_dashboards/dashboard-visualisation/types.js.map +1 -1
- package/cjs/dpr/components/truncate/utils.js +28 -0
- package/cjs/dpr/components/truncate/utils.js.map +1 -0
- package/cjs/dpr/routes/journeys/view-report/async/dashboard/validate.js.map +1 -1
- package/cjs/dpr/setUpNunjucksFilters.js +33 -0
- package/cjs/dpr/setUpNunjucksFilters.js.map +1 -1
- package/cjs/dpr/utils/Dashboards/VisualisationDatasetHelper.js.map +1 -1
- package/cjs/dpr/utils/reportListsHelper.js +1 -1
- package/cjs/dpr/utils/reportListsHelper.js.map +1 -1
- package/dpr/all.scss +8 -32
- package/dpr/components/_async/request-details/view.njk +2 -2
- package/dpr/components/_catalogue/catalogue-list/utils.js +2 -2
- package/dpr/components/_catalogue/catalogue-list/utils.js.map +1 -1
- package/dpr/components/_charts/utils.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-section/view.njk +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/view.njk +1 -1
- package/dpr/components/_inputs/date-range/view.njk +12 -8
- package/dpr/components/_reports/report-heading/view.njk +1 -1
- package/dpr/components/_reports/report-page/report-template/report-totals/view.njk +2 -1
- package/dpr/components/my-reports/my-reports-list-help/view.njk +14 -14
- package/dpr/components/my-reports/my-reports-notification/view.njk +1 -1
- package/dpr/components/truncate/render.njk +3 -0
- package/dpr/components/truncate/utils.js +25 -0
- package/dpr/components/truncate/utils.js.map +1 -0
- package/dpr/components/truncate/view.njk +36 -0
- package/dpr/routes/journeys/view-report/async/dashboard/validate.js.map +1 -1
- package/dpr/setUpNunjucksFilters.js +33 -0
- package/dpr/setUpNunjucksFilters.js.map +1 -1
- package/dpr/utils/Dashboards/VisualisationDatasetHelper.js.map +1 -1
- package/dpr/utils/reportListsHelper.js +1 -1
- package/dpr/utils/reportListsHelper.js.map +1 -1
- package/package.json +3 -1
- package/src/dpr/components/_charts/utils.d.ts +3 -3
- package/src/dpr/components/_dashboards/dashboard-visualisation/types.d.ts +8 -8
- package/src/dpr/components/{show-more → truncate}/clientClass.d.ts +1 -3
- package/src/dpr/components/truncate/utils.d.ts +15 -0
- package/test-app/mocks/mockClients/dashboards/dashboard-definitions.d.ts +1 -0
- package/test-app/mocks/mockClients/dashboards/definitions/data-quality/visualisations/index.d.ts +4 -0
- package/test-app/mocks/mockClients/dashboards/definitions/data-quality/visualisations/scorecard-definitions.d.ts +13 -5
- package/test-app/mocks/mockClients/dashboards/definitions/examples/bar/bar-chart-stacked-dashboard.d.ts +47 -0
- package/test-app/mocks/mockClients/dashboards/definitions/examples/bar/index.d.ts +2 -1
- package/test-app/mocks/mockClients/dashboards/definitions/examples/visualisations/bar.d.ts +58 -0
- package/test-app/mocks/mockClients/dashboards/definitions/test-dashboard/dashboard-definiton-1.d.ts +1 -0
- package/test-app/mocks/mockClients/dashboards/definitions/test-dashboard/index.d.ts +1 -0
- package/test-app/mocks/mockClients/dashboards/mock-client.d.ts +2 -0
- package/test-app/mocks/mockClients/reports/mockReportDefinition.d.ts +1 -0
- package/test-app/mocks/mockClients/reports/mockReportingClient.d.ts +2 -0
- package/test-app/routes/components/truncate/controller.d.ts +4 -0
- package/test-app/routes/components/truncate/routes.d.ts +2 -0
- package/cjs/dpr/components/show-more/utils.js +0 -18
- package/cjs/dpr/components/show-more/utils.js.map +0 -1
- package/dpr/components/show-more/utils.js +0 -13
- package/dpr/components/show-more/utils.js.map +0 -1
- package/dpr/components/show-more/view.njk +0 -5
- package/src/dpr/components/show-more/utils.d.ts +0 -5
|
@@ -7,3 +7,5 @@ export declare const dataQualityAllBar: components['schemas']['DashboardVisualis
|
|
|
7
7
|
export declare const dataQualityAllBarHorizontal: components['schemas']['DashboardVisualisationDefinition'];
|
|
8
8
|
export declare const dataQualityAllBarWithUnit: components['schemas']['DashboardVisualisationDefinition'];
|
|
9
9
|
export declare const dataQualityAllBarWithUnitHorizontal: components['schemas']['DashboardVisualisationDefinition'];
|
|
10
|
+
export declare const verticalStackedBarChart: components['schemas']['DashboardVisualisationDefinition'];
|
|
11
|
+
export declare const horizontalStackedBarChart: components['schemas']['DashboardVisualisationDefinition'];
|
package/all.bundle.js
CHANGED
|
@@ -182,47 +182,35 @@ class BookmarkButton extends DprClientClass {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
class
|
|
185
|
+
class dprTruncate extends DprClientClass {
|
|
186
186
|
static getModuleName() {
|
|
187
|
-
return '
|
|
187
|
+
return 'dpr-truncate';
|
|
188
188
|
}
|
|
189
189
|
initialise() {
|
|
190
190
|
this.initShowMore();
|
|
191
191
|
}
|
|
192
192
|
initShowMore() {
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
const button =
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const shortString = textContent.replaceAll(/<[^>]+>/g, '').substring(0, length);
|
|
199
|
-
if (textContent.length > length) {
|
|
200
|
-
if (textContainer) {
|
|
201
|
-
textContainer.innerHTML = `${shortString}... `;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
if (textContainer) {
|
|
206
|
-
textContainer.innerHTML = `${textContent}`;
|
|
207
|
-
}
|
|
208
|
-
if (button) {
|
|
209
|
-
button.style.display = 'none';
|
|
210
|
-
}
|
|
193
|
+
const container = this.getElement();
|
|
194
|
+
const content = container.querySelector('.js-content');
|
|
195
|
+
const button = container.querySelector('.js-show-more');
|
|
196
|
+
if (!content || !button) {
|
|
197
|
+
return;
|
|
211
198
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
button.
|
|
199
|
+
const fullHtml = content.dataset['fullHtml'] ?? '';
|
|
200
|
+
const truncatedHtml = content.dataset['truncatedHtml'] ?? '';
|
|
201
|
+
button.addEventListener('click', () => {
|
|
202
|
+
const expanded = container.dataset['expanded'] === 'true';
|
|
203
|
+
if (expanded) {
|
|
204
|
+
content.innerHTML = truncatedHtml;
|
|
205
|
+
button.textContent = 'Show more';
|
|
206
|
+
button.setAttribute('aria-expanded', String(!expanded));
|
|
219
207
|
}
|
|
220
|
-
else
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
button.innerHTML = 'show more';
|
|
208
|
+
else {
|
|
209
|
+
content.innerHTML = fullHtml;
|
|
210
|
+
button.textContent = 'Show less';
|
|
211
|
+
button.setAttribute('aria-expanded', String(!expanded));
|
|
225
212
|
}
|
|
213
|
+
container.dataset['expanded'] = String(!expanded);
|
|
226
214
|
});
|
|
227
215
|
}
|
|
228
216
|
}
|
|
@@ -19324,7 +19312,7 @@ function initAll() {
|
|
|
19324
19312
|
BookmarkButton,
|
|
19325
19313
|
DateInput,
|
|
19326
19314
|
DateRangeInput,
|
|
19327
|
-
|
|
19315
|
+
dprTruncate,
|
|
19328
19316
|
BarChartVisualisation,
|
|
19329
19317
|
DoughnutChartVisualisation,
|
|
19330
19318
|
LineChartVisualisation,
|