@hmcts/rpx-xui-common-lib 3.2.17-pofcc-156 → 3.2.18-innerHtml-update
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/fesm2022/hmcts-rpx-xui-common-lib.mjs +208 -204
- package/fesm2022/hmcts-rpx-xui-common-lib.mjs.map +1 -1
- package/index.d.ts +38 -31
- package/package.json +2 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, EventEmitter, ViewEncapsulation, Input, Output, Injectable, InjectionToken, DOCUMENT, Inject, ViewChild, Pipe, ChangeDetectionStrategy, Directive,
|
|
2
|
+
import { Component, EventEmitter, ViewEncapsulation, Input, Output, Injectable, InjectionToken, DOCUMENT, Inject, ViewChild, Pipe, ChangeDetectionStrategy, Directive, ElementRef, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from 'rpx-xui-translation';
|
|
4
4
|
import { RpxTranslationModule } from 'rpx-xui-translation';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
6
|
-
import { formatDate, CommonModule } from '@angular/common';
|
|
6
|
+
import { formatDate, DOCUMENT as DOCUMENT$1, CommonModule } from '@angular/common';
|
|
7
7
|
import * as i2$3 from '@angular/forms';
|
|
8
8
|
import { FormGroup, FormControl, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { combineLatest, BehaviorSubject, Subject, of as of$1, forkJoin, zip, iif } from 'rxjs';
|
|
@@ -21,6 +21,7 @@ import * as i2$2 from '@ng-idle/keepalive';
|
|
|
21
21
|
import * as i4 from '@angular/material/legacy-autocomplete';
|
|
22
22
|
import { MatLegacyAutocompleteModule } from '@angular/material/legacy-autocomplete';
|
|
23
23
|
import * as i5 from '@angular/material/legacy-core';
|
|
24
|
+
import DOMPurify from 'dompurify';
|
|
24
25
|
import * as i1$4 from '@angular/material/legacy-tabs';
|
|
25
26
|
import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
|
|
26
27
|
import * as i2$4 from 'ngx-pagination';
|
|
@@ -1541,13 +1542,13 @@ var BookingCheckType;
|
|
|
1541
1542
|
BookingCheckType["POSSIBLE_BOOKINGS"] = "POSSIBLE_BOOKINGS";
|
|
1542
1543
|
})(BookingCheckType || (BookingCheckType = {}));
|
|
1543
1544
|
|
|
1545
|
+
// used as settings for filters and components
|
|
1544
1546
|
var PersonRole;
|
|
1545
1547
|
(function (PersonRole) {
|
|
1546
1548
|
PersonRole["JUDICIAL"] = "Judicial";
|
|
1547
1549
|
PersonRole["LEGAL_OPERATIONS"] = "Legal Ops";
|
|
1548
1550
|
PersonRole["ADMIN"] = "Admin";
|
|
1549
1551
|
PersonRole["CTSC"] = "CTSC";
|
|
1550
|
-
PersonRole["ENFORCEMENT"] = "Enforcement";
|
|
1551
1552
|
PersonRole["ALL"] = "All";
|
|
1552
1553
|
})(PersonRole || (PersonRole = {}));
|
|
1553
1554
|
// Role categories used in application
|
|
@@ -1559,128 +1560,8 @@ var RoleCategory;
|
|
|
1559
1560
|
RoleCategory["CTSC"] = "CTSC";
|
|
1560
1561
|
RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
|
|
1561
1562
|
RoleCategory["CITIZEN"] = "CITIZEN";
|
|
1562
|
-
RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
|
|
1563
1563
|
RoleCategory["ALL"] = "ALL";
|
|
1564
1564
|
})(RoleCategory || (RoleCategory = {}));
|
|
1565
|
-
function getRoleCategoryTitle(roleCategory) {
|
|
1566
|
-
switch (roleCategory) {
|
|
1567
|
-
case RoleCategory.LEGAL_OPERATIONS: {
|
|
1568
|
-
return 'legal Ops';
|
|
1569
|
-
}
|
|
1570
|
-
case RoleCategory.JUDICIAL: {
|
|
1571
|
-
return 'judicial';
|
|
1572
|
-
}
|
|
1573
|
-
case RoleCategory.ADMIN: {
|
|
1574
|
-
return 'admin';
|
|
1575
|
-
}
|
|
1576
|
-
case RoleCategory.CTSC: {
|
|
1577
|
-
return 'CTSC';
|
|
1578
|
-
}
|
|
1579
|
-
case RoleCategory.ENFORCEMENT: {
|
|
1580
|
-
return 'enforcement';
|
|
1581
|
-
}
|
|
1582
|
-
default:
|
|
1583
|
-
return 'legal Ops';
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
function getRoleCategoryForWorkAllocation(personRole) {
|
|
1587
|
-
if (personRole === PersonRole.JUDICIAL) {
|
|
1588
|
-
return RoleCategory.JUDICIAL;
|
|
1589
|
-
}
|
|
1590
|
-
else if (personRole === PersonRole.LEGAL_OPERATIONS) {
|
|
1591
|
-
return RoleCategory.LEGAL_OPERATIONS;
|
|
1592
|
-
}
|
|
1593
|
-
else if (personRole === PersonRole.ADMIN) {
|
|
1594
|
-
return RoleCategory.ADMIN;
|
|
1595
|
-
}
|
|
1596
|
-
else if (personRole === PersonRole.CTSC) {
|
|
1597
|
-
return RoleCategory.CTSC;
|
|
1598
|
-
}
|
|
1599
|
-
else if (personRole === PersonRole.ENFORCEMENT) {
|
|
1600
|
-
return RoleCategory.ENFORCEMENT;
|
|
1601
|
-
}
|
|
1602
|
-
return null;
|
|
1603
|
-
}
|
|
1604
|
-
function getRoleCategory(personRole) {
|
|
1605
|
-
let roleCategory = RoleCategory.ALL;
|
|
1606
|
-
if (!(personRole === PersonRole.ALL)) {
|
|
1607
|
-
if (personRole === PersonRole.LEGAL_OPERATIONS) {
|
|
1608
|
-
roleCategory = RoleCategory.LEGAL_OPERATIONS;
|
|
1609
|
-
}
|
|
1610
|
-
else if (personRole === PersonRole.ADMIN) {
|
|
1611
|
-
roleCategory = RoleCategory.ADMIN;
|
|
1612
|
-
}
|
|
1613
|
-
else if (personRole === PersonRole.CTSC) {
|
|
1614
|
-
roleCategory = RoleCategory.CTSC;
|
|
1615
|
-
}
|
|
1616
|
-
else if (personRole === PersonRole.ENFORCEMENT) {
|
|
1617
|
-
roleCategory = RoleCategory.ENFORCEMENT;
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
return roleCategory;
|
|
1621
|
-
}
|
|
1622
|
-
function getPersonRole(roleCategories) {
|
|
1623
|
-
if (roleCategories.includes(RoleCategory.ADMIN)) {
|
|
1624
|
-
return PersonRole.ADMIN;
|
|
1625
|
-
}
|
|
1626
|
-
if (roleCategories.includes(RoleCategory.CTSC)) {
|
|
1627
|
-
return PersonRole.CTSC;
|
|
1628
|
-
}
|
|
1629
|
-
if (roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
|
|
1630
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1631
|
-
}
|
|
1632
|
-
if (roleCategories.includes(RoleCategory.ENFORCEMENT)) {
|
|
1633
|
-
return PersonRole.ENFORCEMENT;
|
|
1634
|
-
}
|
|
1635
|
-
// return default role if no match found
|
|
1636
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1637
|
-
}
|
|
1638
|
-
function getPersonRoleForAllocateRole(roleCategory) {
|
|
1639
|
-
if (roleCategory === RoleCategory.LEGAL_OPERATIONS) {
|
|
1640
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1641
|
-
}
|
|
1642
|
-
else if (roleCategory === RoleCategory.ADMIN) {
|
|
1643
|
-
return PersonRole.ADMIN;
|
|
1644
|
-
}
|
|
1645
|
-
else if (roleCategory === RoleCategory.CTSC) {
|
|
1646
|
-
return PersonRole.CTSC;
|
|
1647
|
-
}
|
|
1648
|
-
else if (roleCategory === RoleCategory.ENFORCEMENT) {
|
|
1649
|
-
return PersonRole.ENFORCEMENT;
|
|
1650
|
-
}
|
|
1651
|
-
return null;
|
|
1652
|
-
}
|
|
1653
|
-
function getPersonRoleForTaskAssignment(roleCategory) {
|
|
1654
|
-
if (roleCategory === RoleCategory.JUDICIAL) {
|
|
1655
|
-
return PersonRole.JUDICIAL;
|
|
1656
|
-
}
|
|
1657
|
-
else if (roleCategory === RoleCategory.LEGAL_OPERATIONS) {
|
|
1658
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1659
|
-
}
|
|
1660
|
-
else if (roleCategory === RoleCategory.ADMIN) {
|
|
1661
|
-
return PersonRole.ADMIN;
|
|
1662
|
-
}
|
|
1663
|
-
else if (roleCategory === RoleCategory.ENFORCEMENT) {
|
|
1664
|
-
return PersonRole.ENFORCEMENT;
|
|
1665
|
-
}
|
|
1666
|
-
return PersonRole.ALL;
|
|
1667
|
-
}
|
|
1668
|
-
function getPersonRoleForWorkAllocation(roleCategory) {
|
|
1669
|
-
switch (roleCategory) {
|
|
1670
|
-
case RoleCategory.ADMIN:
|
|
1671
|
-
return PersonRole.ADMIN;
|
|
1672
|
-
case RoleCategory.JUDICIAL:
|
|
1673
|
-
return PersonRole.JUDICIAL;
|
|
1674
|
-
case RoleCategory.LEGAL_OPERATIONS:
|
|
1675
|
-
return PersonRole.LEGAL_OPERATIONS;
|
|
1676
|
-
case RoleCategory.CTSC:
|
|
1677
|
-
return PersonRole.CTSC;
|
|
1678
|
-
case RoleCategory.ENFORCEMENT:
|
|
1679
|
-
return PersonRole.ENFORCEMENT;
|
|
1680
|
-
default:
|
|
1681
|
-
throw new Error(`Invalid roleCategory ${roleCategory}`);
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
1565
|
|
|
1685
1566
|
var AddressType;
|
|
1686
1567
|
(function (AddressType) {
|
|
@@ -1828,11 +1709,11 @@ class GoogleAnalyticsService {
|
|
|
1828
1709
|
script1.src = `https://www.googletagmanager.com/gtag/js?id=${this.googleAnalyticsKey}`;
|
|
1829
1710
|
this.document.head.appendChild(script1);
|
|
1830
1711
|
const script2 = this.document.createElement('script');
|
|
1831
|
-
script2.
|
|
1712
|
+
script2.text = `
|
|
1832
1713
|
window.dataLayer = window.dataLayer || [];
|
|
1833
1714
|
function gtag(){dataLayer.push(arguments);}
|
|
1834
1715
|
gtag('js', new Date());
|
|
1835
|
-
gtag('config',
|
|
1716
|
+
gtag('config', ${JSON.stringify(this.googleAnalyticsKey)}, {'send_page_view': false});
|
|
1836
1717
|
`;
|
|
1837
1718
|
this.document.head.appendChild(script2);
|
|
1838
1719
|
}
|
|
@@ -1844,11 +1725,11 @@ class GoogleAnalyticsService {
|
|
|
1844
1725
|
}
|
|
1845
1726
|
listenForRouteChanges() {
|
|
1846
1727
|
if (this.googleAnalyticsKey) {
|
|
1847
|
-
this.router.events.subscribe(event => {
|
|
1728
|
+
this.router.events.subscribe((event) => {
|
|
1848
1729
|
if (event instanceof NavigationEnd) {
|
|
1849
1730
|
this.window.gtag('config', this.googleAnalyticsKey, {
|
|
1850
1731
|
page_path: event.urlAfterRedirects,
|
|
1851
|
-
page_title: this.title.getTitle()
|
|
1732
|
+
page_title: this.title.getTitle()
|
|
1852
1733
|
});
|
|
1853
1734
|
}
|
|
1854
1735
|
});
|
|
@@ -2558,8 +2439,7 @@ class FindAPersonService {
|
|
|
2558
2439
|
id: caseworker.idamId,
|
|
2559
2440
|
// EXUI-4758 - If user has admin role, set domain to admin
|
|
2560
2441
|
// For more specific domain we need service specific role category (or other technique)
|
|
2561
|
-
|
|
2562
|
-
domain: getPersonRole(caseworker.roleCategories)
|
|
2442
|
+
domain: this.setDomain(caseworker)
|
|
2563
2443
|
// knownAs can be added if required
|
|
2564
2444
|
};
|
|
2565
2445
|
if (caseworker.roleCategories.includes(roleCategory) || roleCategory === RoleCategory.ALL || caseworker.idamId === this.userId) {
|
|
@@ -2569,7 +2449,18 @@ class FindAPersonService {
|
|
|
2569
2449
|
return people;
|
|
2570
2450
|
}
|
|
2571
2451
|
searchInCaseworkers(caseworkers, searchOptions) {
|
|
2572
|
-
|
|
2452
|
+
let roleCategory = RoleCategory.ALL;
|
|
2453
|
+
if (!(searchOptions.userRole === PersonRole.ALL)) {
|
|
2454
|
+
if (searchOptions.userRole === PersonRole.LEGAL_OPERATIONS) {
|
|
2455
|
+
roleCategory = RoleCategory.LEGAL_OPERATIONS;
|
|
2456
|
+
}
|
|
2457
|
+
else if (searchOptions.userRole === PersonRole.ADMIN) {
|
|
2458
|
+
roleCategory = RoleCategory.ADMIN;
|
|
2459
|
+
}
|
|
2460
|
+
else if (searchOptions.userRole === PersonRole.CTSC) {
|
|
2461
|
+
roleCategory = RoleCategory.CTSC;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2573
2464
|
const searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
|
|
2574
2465
|
const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
|
|
2575
2466
|
const finalPeopleList = people.filter((person) => person && person.name && person.name.toLowerCase().includes(searchTerm));
|
|
@@ -2581,33 +2472,19 @@ class FindAPersonService {
|
|
|
2581
2472
|
searchJudicial(value, serviceId) {
|
|
2582
2473
|
return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
|
|
2583
2474
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
const ids = selectedPersons.map(({ id }) => id);
|
|
2589
|
-
return persons.filter(({ id }) => !ids.includes(id));
|
|
2590
|
-
}));
|
|
2591
|
-
}
|
|
2592
|
-
case PersonRole.ALL: {
|
|
2593
|
-
return zip(this.findJudicialOrCTSCPeople(searchTerm, personRole, services, userIncluded, assignedUser), this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser)).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2594
|
-
}
|
|
2595
|
-
case PersonRole.CTSC:
|
|
2596
|
-
case PersonRole.LEGAL_OPERATIONS:
|
|
2597
|
-
case PersonRole.ADMIN:
|
|
2598
|
-
case PersonRole.ENFORCEMENT: {
|
|
2599
|
-
return this.findCaseworkersOrAdminsOrCtsc(searchTerm, personRole, services, userIncluded, assignedUser);
|
|
2600
|
-
}
|
|
2601
|
-
default: {
|
|
2602
|
-
return of([]);
|
|
2603
|
-
}
|
|
2475
|
+
// Note: Domain only used internally to set the PersonRole for the Person object
|
|
2476
|
+
setDomain(caseworker) {
|
|
2477
|
+
if (caseworker.roleCategories.includes(RoleCategory.ADMIN)) {
|
|
2478
|
+
return PersonRole.ADMIN;
|
|
2604
2479
|
}
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2480
|
+
if (caseworker.roleCategories.includes(RoleCategory.CTSC)) {
|
|
2481
|
+
return PersonRole.CTSC;
|
|
2482
|
+
}
|
|
2483
|
+
if (caseworker.roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
|
|
2484
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2485
|
+
}
|
|
2486
|
+
// return default role if no match found
|
|
2487
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2611
2488
|
}
|
|
2612
2489
|
static { this.ɵfac = function FindAPersonService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FindAPersonService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(SessionStorageService)); }; }
|
|
2613
2490
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FindAPersonService, factory: FindAPersonService.ɵfac, providedIn: 'root' }); }
|
|
@@ -2722,8 +2599,28 @@ class FindPersonComponent {
|
|
|
2722
2599
|
});
|
|
2723
2600
|
}
|
|
2724
2601
|
filter(searchTerm) {
|
|
2602
|
+
const findJudicialOrCTSCPeople = this.findPersonService.find({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2603
|
+
const findCaseworkersOrAdminsOrCtsc = this.findPersonService.findCaseworkers({ searchTerm, userRole: this.domain, services: [this.services], userIncluded: this.userIncluded, assignedUser: this.assignedUser });
|
|
2725
2604
|
if (searchTerm && searchTerm.length > this.minSearchCharacters) {
|
|
2726
|
-
|
|
2605
|
+
switch (this.domain) {
|
|
2606
|
+
case PersonRole.JUDICIAL: {
|
|
2607
|
+
return findJudicialOrCTSCPeople.pipe(map((persons) => {
|
|
2608
|
+
const ids = this.selectedPersons.map(({ id }) => id);
|
|
2609
|
+
return persons.filter(({ id }) => !ids.includes(id));
|
|
2610
|
+
}));
|
|
2611
|
+
}
|
|
2612
|
+
case PersonRole.ALL: {
|
|
2613
|
+
return zip(findJudicialOrCTSCPeople, findCaseworkersOrAdminsOrCtsc).pipe(map((separatePeople) => separatePeople[0].concat(separatePeople[1])));
|
|
2614
|
+
}
|
|
2615
|
+
case PersonRole.CTSC:
|
|
2616
|
+
case PersonRole.LEGAL_OPERATIONS:
|
|
2617
|
+
case PersonRole.ADMIN: {
|
|
2618
|
+
return findCaseworkersOrAdminsOrCtsc;
|
|
2619
|
+
}
|
|
2620
|
+
default: {
|
|
2621
|
+
return of([]);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2727
2624
|
}
|
|
2728
2625
|
return of([]);
|
|
2729
2626
|
}
|
|
@@ -2735,7 +2632,6 @@ class FindPersonComponent {
|
|
|
2735
2632
|
if (!selectedPerson) {
|
|
2736
2633
|
return '';
|
|
2737
2634
|
}
|
|
2738
|
-
// The judiciary people contain a different object which has a fullName property
|
|
2739
2635
|
if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
|
|
2740
2636
|
return `${selectedPerson.fullName} (${selectedPerson.email})`;
|
|
2741
2637
|
}
|
|
@@ -6621,26 +6517,134 @@ class SelectedCaseListComponent {
|
|
|
6621
6517
|
}] }); })();
|
|
6622
6518
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectedCaseListComponent, { className: "SelectedCaseListComponent", filePath: "lib/components/selected-case-list/selected-case-list.component.ts", lineNumber: 12 }); })();
|
|
6623
6519
|
|
|
6520
|
+
class SafeHtmlDirective {
|
|
6521
|
+
constructor(elementRef, renderer, document) {
|
|
6522
|
+
this.elementRef = elementRef;
|
|
6523
|
+
this.renderer = renderer;
|
|
6524
|
+
this.document = document;
|
|
6525
|
+
this.allowedAttributes = [
|
|
6526
|
+
'aria-label',
|
|
6527
|
+
'class',
|
|
6528
|
+
'href',
|
|
6529
|
+
'rel',
|
|
6530
|
+
'target',
|
|
6531
|
+
'title'
|
|
6532
|
+
];
|
|
6533
|
+
this.allowedTags = [
|
|
6534
|
+
'a',
|
|
6535
|
+
'b',
|
|
6536
|
+
'br',
|
|
6537
|
+
'div',
|
|
6538
|
+
'em',
|
|
6539
|
+
'h1',
|
|
6540
|
+
'h2',
|
|
6541
|
+
'h3',
|
|
6542
|
+
'h4',
|
|
6543
|
+
'h5',
|
|
6544
|
+
'h6',
|
|
6545
|
+
'li',
|
|
6546
|
+
'ol',
|
|
6547
|
+
'p',
|
|
6548
|
+
'span',
|
|
6549
|
+
'strong',
|
|
6550
|
+
'u',
|
|
6551
|
+
'ul'
|
|
6552
|
+
];
|
|
6553
|
+
}
|
|
6554
|
+
ngOnChanges() {
|
|
6555
|
+
this.clearContent();
|
|
6556
|
+
if (!this.xuilibSafeHtml) {
|
|
6557
|
+
return;
|
|
6558
|
+
}
|
|
6559
|
+
// DOMPurify is the primary XSS sanitisation boundary.
|
|
6560
|
+
const sanitizedContent = DOMPurify.sanitize(this.xuilibSafeHtml, {
|
|
6561
|
+
ALLOWED_ATTR: this.allowedAttributes,
|
|
6562
|
+
ALLOWED_TAGS: this.allowedTags
|
|
6563
|
+
});
|
|
6564
|
+
const parsedDocument = new DOMParser().parseFromString(sanitizedContent, 'text/html');
|
|
6565
|
+
Array.from(parsedDocument.body.childNodes).forEach((node) => {
|
|
6566
|
+
this.renderer.appendChild(this.elementRef.nativeElement, this.createSafeNode(node));
|
|
6567
|
+
});
|
|
6568
|
+
}
|
|
6569
|
+
clearContent() {
|
|
6570
|
+
const element = this.elementRef.nativeElement;
|
|
6571
|
+
while (element.firstChild) {
|
|
6572
|
+
this.renderer.removeChild(element, element.firstChild);
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
/**
|
|
6576
|
+
* Rebuild the DOM instead of assigning sanitized content to innerHTML.
|
|
6577
|
+
*
|
|
6578
|
+
* DOMPurify performs the security sanitisation. Rebuilding the DOM also
|
|
6579
|
+
* avoids introducing another innerHTML sink that security tooling may flag.
|
|
6580
|
+
*/
|
|
6581
|
+
createSafeNode(node) {
|
|
6582
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
6583
|
+
return this.renderer.createText(node.textContent ?? '');
|
|
6584
|
+
}
|
|
6585
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
6586
|
+
return this.renderer.createText('');
|
|
6587
|
+
}
|
|
6588
|
+
const sourceElement = node;
|
|
6589
|
+
const tagName = sourceElement.tagName.toLowerCase();
|
|
6590
|
+
if (!this.allowedTags.includes(tagName)) {
|
|
6591
|
+
return this.createSafeFragment(sourceElement);
|
|
6592
|
+
}
|
|
6593
|
+
const safeElement = this.renderer.createElement(tagName);
|
|
6594
|
+
Array.from(sourceElement.attributes).forEach((attribute) => {
|
|
6595
|
+
if (!this.allowedAttributes.includes(attribute.name.toLowerCase())) {
|
|
6596
|
+
return;
|
|
6597
|
+
}
|
|
6598
|
+
this.renderer.setAttribute(safeElement, attribute.name, attribute.value);
|
|
6599
|
+
});
|
|
6600
|
+
// Defence in depth for links opened in a new browsing context.
|
|
6601
|
+
if (tagName === 'a' &&
|
|
6602
|
+
safeElement.getAttribute('target')?.toLowerCase() === '_blank') {
|
|
6603
|
+
this.renderer.setAttribute(safeElement, 'rel', 'noopener noreferrer');
|
|
6604
|
+
}
|
|
6605
|
+
Array.from(sourceElement.childNodes).forEach((childNode) => {
|
|
6606
|
+
this.renderer.appendChild(safeElement, this.createSafeNode(childNode));
|
|
6607
|
+
});
|
|
6608
|
+
return safeElement;
|
|
6609
|
+
}
|
|
6610
|
+
createSafeFragment(element) {
|
|
6611
|
+
const fragment = this.document.createDocumentFragment();
|
|
6612
|
+
Array.from(element.childNodes).forEach((childNode) => {
|
|
6613
|
+
fragment.appendChild(this.createSafeNode(childNode));
|
|
6614
|
+
});
|
|
6615
|
+
return fragment;
|
|
6616
|
+
}
|
|
6617
|
+
static { this.ɵfac = function SafeHtmlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SafeHtmlDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(DOCUMENT$1)); }; }
|
|
6618
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SafeHtmlDirective, selectors: [["", "xuilibSafeHtml", ""]], inputs: { xuilibSafeHtml: "xuilibSafeHtml" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature] }); }
|
|
6619
|
+
}
|
|
6620
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SafeHtmlDirective, [{
|
|
6621
|
+
type: Directive,
|
|
6622
|
+
args: [{
|
|
6623
|
+
selector: '[xuilibSafeHtml]',
|
|
6624
|
+
standalone: false
|
|
6625
|
+
}]
|
|
6626
|
+
}], () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: Document, decorators: [{
|
|
6627
|
+
type: Inject,
|
|
6628
|
+
args: [DOCUMENT$1]
|
|
6629
|
+
}] }], { xuilibSafeHtml: [{
|
|
6630
|
+
type: Input
|
|
6631
|
+
}] }); })();
|
|
6632
|
+
|
|
6624
6633
|
function ServiceMessageComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
6625
6634
|
i0.ɵɵelement(0, "h2", 5);
|
|
6626
6635
|
} if (rf & 2) {
|
|
6627
6636
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
6628
|
-
i0.ɵɵproperty("
|
|
6637
|
+
i0.ɵɵproperty("xuilibSafeHtml", ctx_r0.message_cy);
|
|
6629
6638
|
} }
|
|
6630
6639
|
class ServiceMessageComponent {
|
|
6631
|
-
constructor(
|
|
6632
|
-
this.sanitizer = sanitizer;
|
|
6640
|
+
constructor() {
|
|
6633
6641
|
this.hideMessage = new EventEmitter();
|
|
6634
6642
|
}
|
|
6635
6643
|
onHideMessageEvent(key) {
|
|
6636
6644
|
this.hideMessage.emit(key);
|
|
6637
6645
|
}
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
return this.sanitizer.sanitize(SecurityContext.HTML, content ?? '') ?? '';
|
|
6641
|
-
}
|
|
6642
|
-
static { this.ɵfac = function ServiceMessageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessageComponent)(i0.ɵɵdirectiveInject(i2$1.DomSanitizer)); }; }
|
|
6643
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessageComponent, selectors: [["xuilib-service-message"]], inputs: { message_en: "message_en", message_cy: "message_cy", key: "key" }, outputs: { hideMessage: "hideMessage" }, standalone: false, decls: 12, vars: 8, consts: [[1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "img", "aria-label", "hmcts-warning-icon", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s", 3, "innerHTML"], ["tabindex", "0", 1, "govuk-link--no-visited-state", 3, "click", "keyup.enter", "routerLink"]], template: function ServiceMessageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6646
|
+
static { this.ɵfac = function ServiceMessageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessageComponent)(); }; }
|
|
6647
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessageComponent, selectors: [["xuilib-service-message"]], inputs: { message_en: "message_en", message_cy: "message_cy", key: "key" }, outputs: { hideMessage: "hideMessage" }, standalone: false, decls: 12, vars: 8, consts: [[1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "img", "aria-label", "hmcts-warning-icon", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s", 3, "xuilibSafeHtml"], ["tabindex", "0", 1, "govuk-link--no-visited-state", 3, "click", "keyup.enter", "routerLink"]], template: function ServiceMessageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6644
6648
|
i0.ɵɵelementStart(0, "div", 0);
|
|
6645
6649
|
i0.ɵɵnamespaceSVG();
|
|
6646
6650
|
i0.ɵɵelementStart(1, "svg", 1);
|
|
@@ -6662,17 +6666,17 @@ class ServiceMessageComponent {
|
|
|
6662
6666
|
i0.ɵɵadvance(5);
|
|
6663
6667
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Warning"));
|
|
6664
6668
|
i0.ɵɵadvance(2);
|
|
6665
|
-
i0.ɵɵproperty("
|
|
6669
|
+
i0.ɵɵproperty("xuilibSafeHtml", ctx.message_en);
|
|
6666
6670
|
i0.ɵɵadvance();
|
|
6667
6671
|
i0.ɵɵconditional(ctx.message_cy ? 8 : -1);
|
|
6668
6672
|
i0.ɵɵadvance(2);
|
|
6669
6673
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 6, "Hide message"));
|
|
6670
|
-
} }, dependencies: [i1$1.RouterLink, i2.RpxTranslatePipe], styles: [".govuk-link--no-visited-state[_ngcontent-%COMP%]{cursor:pointer}"] }); }
|
|
6674
|
+
} }, dependencies: [i1$1.RouterLink, SafeHtmlDirective, i2.RpxTranslatePipe], styles: [".govuk-link--no-visited-state[_ngcontent-%COMP%]{cursor:pointer}"] }); }
|
|
6671
6675
|
}
|
|
6672
6676
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ServiceMessageComponent, [{
|
|
6673
6677
|
type: Component,
|
|
6674
|
-
args: [{ selector: 'xuilib-service-message', standalone: false, template: "<div class=\"hmcts-banner hmcts-banner--warning\">\n\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"img\" aria-label=\"hmcts-warning-icon\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\" [
|
|
6675
|
-
}], () => [
|
|
6678
|
+
args: [{ selector: 'xuilib-service-message', standalone: false, template: "<div class=\"hmcts-banner hmcts-banner--warning\">\n\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"img\" aria-label=\"hmcts-warning-icon\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\" [xuilibSafeHtml]=\"message_en\"></h2>\n @if (message_cy) {\n <h2 class=\"govuk-heading-s\" [xuilibSafeHtml]=\"message_cy\"></h2>\n }\n <a [routerLink]=\"\" tabindex=\"0\" class=\"govuk-link--no-visited-state\" (click)=\"onHideMessageEvent(key)\" (keyup.enter)=\"onHideMessageEvent(key)\">{{'Hide message' | rpxTranslate}}</a>\n </div>\n\n</div>\n", styles: [".govuk-link--no-visited-state{cursor:pointer}\n"] }]
|
|
6679
|
+
}], () => [], { message_en: [{
|
|
6676
6680
|
type: Input
|
|
6677
6681
|
}], message_cy: [{
|
|
6678
6682
|
type: Input
|
|
@@ -6681,7 +6685,7 @@ class ServiceMessageComponent {
|
|
|
6681
6685
|
}], hideMessage: [{
|
|
6682
6686
|
type: Output
|
|
6683
6687
|
}] }); })();
|
|
6684
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessageComponent, { className: "ServiceMessageComponent", filePath: "lib/components/service-message/service-message.component.ts", lineNumber:
|
|
6688
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessageComponent, { className: "ServiceMessageComponent", filePath: "lib/components/service-message/service-message.component.ts", lineNumber: 10 }); })();
|
|
6685
6689
|
|
|
6686
6690
|
function ServiceMessagesComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
6687
6691
|
i0.ɵɵelementStart(0, "div", 1);
|
|
@@ -6697,18 +6701,19 @@ function ServiceMessagesComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf
|
|
|
6697
6701
|
i0.ɵɵelementStart(7, "h2", 6);
|
|
6698
6702
|
i0.ɵɵtext(8, "Error:");
|
|
6699
6703
|
i0.ɵɵelementEnd();
|
|
6700
|
-
i0.ɵɵ
|
|
6701
|
-
i0.ɵɵ
|
|
6704
|
+
i0.ɵɵelementStart(9, "p");
|
|
6705
|
+
i0.ɵɵtext(10);
|
|
6706
|
+
i0.ɵɵelementEnd()()();
|
|
6702
6707
|
} if (rf & 2) {
|
|
6703
6708
|
const errMsg_r1 = ctx.$implicit;
|
|
6704
6709
|
i0.ɵɵadvance(5);
|
|
6705
6710
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 2, "Warning"));
|
|
6706
|
-
i0.ɵɵadvance(
|
|
6707
|
-
i0.ɵɵ
|
|
6711
|
+
i0.ɵɵadvance(5);
|
|
6712
|
+
i0.ɵɵtextInterpolate(errMsg_r1.message);
|
|
6708
6713
|
} }
|
|
6709
6714
|
function ServiceMessagesComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
6710
6715
|
i0.ɵɵelementStart(0, "div", 0);
|
|
6711
|
-
i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_0_For_2_Template,
|
|
6716
|
+
i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_0_For_2_Template, 11, 4, "div", 1, i0.ɵɵrepeaterTrackByIdentity);
|
|
6712
6717
|
i0.ɵɵelementEnd();
|
|
6713
6718
|
} if (rf & 2) {
|
|
6714
6719
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -6717,7 +6722,7 @@ function ServiceMessagesComponent_Conditional_0_Template(rf, ctx) { if (rf & 1)
|
|
|
6717
6722
|
} }
|
|
6718
6723
|
function ServiceMessagesComponent_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
6719
6724
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
6720
|
-
i0.ɵɵelementStart(0, "xuilib-service-message",
|
|
6725
|
+
i0.ɵɵelementStart(0, "xuilib-service-message", 8);
|
|
6721
6726
|
i0.ɵɵpipe(1, "rpxTranslate");
|
|
6722
6727
|
i0.ɵɵpipe(2, "rpxTranslate");
|
|
6723
6728
|
i0.ɵɵlistener("hideMessage", function ServiceMessagesComponent_Conditional_1_For_2_Template_xuilib_service_message_hideMessage_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.hideMessage($event)); });
|
|
@@ -6728,7 +6733,7 @@ function ServiceMessagesComponent_Conditional_1_For_2_Template(rf, ctx) { if (rf
|
|
|
6728
6733
|
} }
|
|
6729
6734
|
function ServiceMessagesComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
6730
6735
|
i0.ɵɵelementStart(0, "div", 0);
|
|
6731
|
-
i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_1_For_2_Template, 3, 7, "xuilib-service-message",
|
|
6736
|
+
i0.ɵɵrepeaterCreate(1, ServiceMessagesComponent_Conditional_1_For_2_Template, 3, 7, "xuilib-service-message", 7, i0.ɵɵrepeaterTrackByIdentity);
|
|
6732
6737
|
i0.ɵɵelementEnd();
|
|
6733
6738
|
} if (rf & 2) {
|
|
6734
6739
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -6830,7 +6835,7 @@ class ServiceMessagesComponent {
|
|
|
6830
6835
|
return cookie ? JSON.parse(decodeURIComponent(cookie.split("=")[1])) : [];
|
|
6831
6836
|
}
|
|
6832
6837
|
static { this.ɵfac = function ServiceMessagesComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessagesComponent)(i0.ɵɵdirectiveInject(FeatureToggleService)); }; }
|
|
6833
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessagesComponent, selectors: [["xuilib-service-messages"]], inputs: { userRoles: "userRoles", featureToggleKey: "featureToggleKey", serviceMessageCookie: "serviceMessageCookie" }, standalone: false, decls: 2, vars: 2, consts: [[1, "govuk-width-container", "govuk-!-margin-top-6"], [1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s"], [3, "
|
|
6838
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessagesComponent, selectors: [["xuilib-service-messages"]], inputs: { userRoles: "userRoles", featureToggleKey: "featureToggleKey", serviceMessageCookie: "serviceMessageCookie" }, standalone: false, decls: 2, vars: 2, consts: [[1, "govuk-width-container", "govuk-!-margin-top-6"], [1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s"], [3, "key", "message_en", "message_cy"], [3, "hideMessage", "key", "message_en", "message_cy"]], template: function ServiceMessagesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6834
6839
|
i0.ɵɵconditionalCreate(0, ServiceMessagesComponent_Conditional_0_Template, 3, 0, "div", 0);
|
|
6835
6840
|
i0.ɵɵconditionalCreate(1, ServiceMessagesComponent_Conditional_1_Template, 3, 0, "div", 0);
|
|
6836
6841
|
} if (rf & 2) {
|
|
@@ -6841,7 +6846,7 @@ class ServiceMessagesComponent {
|
|
|
6841
6846
|
}
|
|
6842
6847
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ServiceMessagesComponent, [{
|
|
6843
6848
|
type: Component,
|
|
6844
|
-
args: [{ selector: "xuilib-service-messages", standalone: false, template: "@if (isBannerError) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (errMsg of bannerErrorMsgs; track errMsg) {\n <div class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\">Error:</h2>\n <p
|
|
6849
|
+
args: [{ selector: "xuilib-service-messages", standalone: false, template: "@if (isBannerError) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (errMsg of bannerErrorMsgs; track errMsg) {\n <div class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\">Error:</h2>\n <p>{{ errMsg.message }}</p>\n </div>\n </div>\n }\n </div>\n}\n@if (filteredMessages?.length > 0) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (message of filteredMessages; track message) {\n <xuilib-service-message [key]=\"message\"\n [message_en]=\"message?.message_en | rpxTranslate\"\n [message_cy]=\"message?.message_cy | rpxTranslate\"\n (hideMessage)=\"hideMessage($event)\">\n </xuilib-service-message>\n }\n </div>\n}\n" }]
|
|
6845
6850
|
}], () => [{ type: FeatureToggleService }], { userRoles: [{
|
|
6846
6851
|
type: Input
|
|
6847
6852
|
}], featureToggleKey: [{
|
|
@@ -7688,7 +7693,7 @@ function TermsAndConditionsComponent_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
7688
7693
|
} if (rf & 2) {
|
|
7689
7694
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
7690
7695
|
i0.ɵɵadvance();
|
|
7691
|
-
i0.ɵɵproperty("
|
|
7696
|
+
i0.ɵɵproperty("xuilibSafeHtml", i0.ɵɵpipeBind1(2, 1, ctx_r0.document.content));
|
|
7692
7697
|
} }
|
|
7693
7698
|
function TermsAndConditionsComponent_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
7694
7699
|
i0.ɵɵelementStart(0, "xuilib-tc-display-plain");
|
|
@@ -7710,28 +7715,22 @@ function TermsAndConditionsComponent_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
7710
7715
|
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "An error occured. Please try again."), " ");
|
|
7711
7716
|
} }
|
|
7712
7717
|
class TermsAndConditionsComponent {
|
|
7713
|
-
constructor(
|
|
7714
|
-
|
|
7715
|
-
}
|
|
7716
|
-
// ensure no dangerous HTML is rendered in the terms and conditions document
|
|
7717
|
-
sanitizeHtml(content) {
|
|
7718
|
-
return this.sanitizer.sanitize(SecurityContext.HTML, content ?? '') ?? '';
|
|
7719
|
-
}
|
|
7720
|
-
static { this.ɵfac = function TermsAndConditionsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TermsAndConditionsComponent)(i0.ɵɵdirectiveInject(i2$1.DomSanitizer)); }; }
|
|
7721
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TermsAndConditionsComponent, selectors: [["xuilib-terms-and-conditions"]], inputs: { document: "document" }, standalone: false, decls: 3, vars: 1, consts: [[3, "innerHTML"]], template: function TermsAndConditionsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7718
|
+
constructor() { }
|
|
7719
|
+
static { this.ɵfac = function TermsAndConditionsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TermsAndConditionsComponent)(); }; }
|
|
7720
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TermsAndConditionsComponent, selectors: [["xuilib-terms-and-conditions"]], inputs: { document: "document" }, standalone: false, decls: 3, vars: 1, consts: [[3, "xuilibSafeHtml"]], template: function TermsAndConditionsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7722
7721
|
i0.ɵɵconditionalCreate(0, TermsAndConditionsComponent_Case_0_Template, 3, 3, "xuilib-tc-display-html")(1, TermsAndConditionsComponent_Case_1_Template, 3, 3, "xuilib-tc-display-plain")(2, TermsAndConditionsComponent_Case_2_Template, 3, 3, "div");
|
|
7723
7722
|
} if (rf & 2) {
|
|
7724
7723
|
let tmp_0_0;
|
|
7725
7724
|
i0.ɵɵconditional((tmp_0_0 = ctx.document.mimeType) === "text/html" ? 0 : tmp_0_0 === "text/plain" ? 1 : 2);
|
|
7726
|
-
} }, dependencies: [TcDisplayHtmlComponent, TcDisplayPlainComponent, i2.RpxTranslatePipe], styles: ["[_nghost-%COMP%]{display:block;width:100%}"] }); }
|
|
7725
|
+
} }, dependencies: [TcDisplayHtmlComponent, TcDisplayPlainComponent, SafeHtmlDirective, i2.RpxTranslatePipe], styles: ["[_nghost-%COMP%]{display:block;width:100%}"] }); }
|
|
7727
7726
|
}
|
|
7728
7727
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TermsAndConditionsComponent, [{
|
|
7729
7728
|
type: Component,
|
|
7730
|
-
args: [{ selector: 'xuilib-terms-and-conditions', standalone: false, template: "\n@switch (document.mimeType) {\n @case ('text/html') {\n <xuilib-tc-display-html>\n <div [
|
|
7731
|
-
}], () => [
|
|
7729
|
+
args: [{ selector: 'xuilib-terms-and-conditions', standalone: false, template: "\n@switch (document.mimeType) {\n @case ('text/html') {\n <xuilib-tc-display-html>\n <div [xuilibSafeHtml]=\"document.content | rpxTranslate\"></div>\n </xuilib-tc-display-html>\n }\n @case ('text/plain') {\n <xuilib-tc-display-plain>\n {{ document.content | rpxTranslate}}\n </xuilib-tc-display-plain>\n }\n @default {\n <div>\n {{'An error occured. Please try again.' | rpxTranslate}}\n </div>\n }\n}\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
7730
|
+
}], () => [], { document: [{
|
|
7732
7731
|
type: Input
|
|
7733
7732
|
}] }); })();
|
|
7734
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TermsAndConditionsComponent, { className: "TermsAndConditionsComponent", filePath: "lib/components/terms-and-conditions/terms-and-conditions.component.ts", lineNumber:
|
|
7733
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TermsAndConditionsComponent, { className: "TermsAndConditionsComponent", filePath: "lib/components/terms-and-conditions/terms-and-conditions.component.ts", lineNumber: 10 }); })();
|
|
7735
7734
|
|
|
7736
7735
|
function UserDetailsComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
7737
7736
|
i0.ɵɵelementStart(0, "div", 0)(1, "span", 4);
|
|
@@ -10445,21 +10444,23 @@ function HmctsPrimaryNavigationComponent_Conditional_0_Conditional_2_Template(rf
|
|
|
10445
10444
|
i0.ɵɵelement(0, "div", 2);
|
|
10446
10445
|
} }
|
|
10447
10446
|
function HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
10448
|
-
i0.ɵɵelementStart(0, "li", 4);
|
|
10449
|
-
i0.ɵɵ
|
|
10450
|
-
i0.ɵɵpipe(
|
|
10451
|
-
i0.ɵɵelementEnd();
|
|
10447
|
+
i0.ɵɵelementStart(0, "li", 4)(1, "a", 5);
|
|
10448
|
+
i0.ɵɵtext(2);
|
|
10449
|
+
i0.ɵɵpipe(3, "rpxTranslate");
|
|
10450
|
+
i0.ɵɵelementEnd()();
|
|
10452
10451
|
} if (rf & 2) {
|
|
10453
10452
|
const item_r1 = ctx.$implicit;
|
|
10454
10453
|
i0.ɵɵadvance();
|
|
10455
|
-
i0.ɵɵproperty("routerLink", item_r1.href)
|
|
10454
|
+
i0.ɵɵproperty("routerLink", item_r1.href);
|
|
10456
10455
|
i0.ɵɵattribute("aria-current", item_r1.active ? true : null);
|
|
10456
|
+
i0.ɵɵadvance();
|
|
10457
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 3, item_r1.text));
|
|
10457
10458
|
} }
|
|
10458
10459
|
function HmctsPrimaryNavigationComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
10459
10460
|
i0.ɵɵelementStart(0, "nav", 0)(1, "div", 1);
|
|
10460
10461
|
i0.ɵɵconditionalCreate(2, HmctsPrimaryNavigationComponent_Conditional_0_Conditional_2_Template, 1, 0, "div", 2);
|
|
10461
10462
|
i0.ɵɵelementStart(3, "ul", 3);
|
|
10462
|
-
i0.ɵɵrepeaterCreate(4, HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template,
|
|
10463
|
+
i0.ɵɵrepeaterCreate(4, HmctsPrimaryNavigationComponent_Conditional_0_For_5_Template, 4, 5, "li", 4, i0.ɵɵrepeaterTrackByIdentity);
|
|
10463
10464
|
i0.ɵɵelementEnd()()();
|
|
10464
10465
|
} if (rf & 2) {
|
|
10465
10466
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -10476,7 +10477,7 @@ class HmctsPrimaryNavigationComponent {
|
|
|
10476
10477
|
constructor() {
|
|
10477
10478
|
}
|
|
10478
10479
|
static { this.ɵfac = function HmctsPrimaryNavigationComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HmctsPrimaryNavigationComponent)(); }; }
|
|
10479
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HmctsPrimaryNavigationComponent, selectors: [["xuilib-hmcts-primary-navigation"]], inputs: { userLoggedIn: "userLoggedIn", label: "label", items: "items", isBrandedHeader: "isBrandedHeader" }, standalone: false, decls: 1, vars: 1, consts: [[1, "hmcts-primary-navigation"], [1, "hmcts-primary-navigation__container"], [1, "govuk-header__logo"], [1, "hmcts-primary-navigation__list"], [1, "hmcts-primary-navigation__item"], [1, "hmcts-primary-navigation__link", 3, "routerLink"
|
|
10480
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HmctsPrimaryNavigationComponent, selectors: [["xuilib-hmcts-primary-navigation"]], inputs: { userLoggedIn: "userLoggedIn", label: "label", items: "items", isBrandedHeader: "isBrandedHeader" }, standalone: false, decls: 1, vars: 1, consts: [[1, "hmcts-primary-navigation"], [1, "hmcts-primary-navigation__container"], [1, "govuk-header__logo"], [1, "hmcts-primary-navigation__list"], [1, "hmcts-primary-navigation__item"], [1, "hmcts-primary-navigation__link", 3, "routerLink"]], template: function HmctsPrimaryNavigationComponent_Template(rf, ctx) { if (rf & 1) {
|
|
10480
10481
|
i0.ɵɵconditionalCreate(0, HmctsPrimaryNavigationComponent_Conditional_0_Template, 6, 2, "nav", 0);
|
|
10481
10482
|
} if (rf & 2) {
|
|
10482
10483
|
i0.ɵɵconditional(ctx.isUserLoggedIn ? 0 : -1);
|
|
@@ -10484,7 +10485,7 @@ class HmctsPrimaryNavigationComponent {
|
|
|
10484
10485
|
}
|
|
10485
10486
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HmctsPrimaryNavigationComponent, [{
|
|
10486
10487
|
type: Component,
|
|
10487
|
-
args: [{ selector: 'xuilib-hmcts-primary-navigation', standalone: false, template: "@if (isUserLoggedIn) {\n <nav class=\"hmcts-primary-navigation\" [attr.aria-label]=\"label\">\n <div class=\"hmcts-primary-navigation__container\">\n @if (isBrandedHeader) {\n <div class=\"govuk-header__logo\"></div>\n }\n <ul class=\"hmcts-primary-navigation__list\">\n @for (item of items; track item) {\n <li class=\"hmcts-primary-navigation__item\" >\n <a class=\"hmcts-primary-navigation__link\" [attr.aria-current]=\"item.active ? true: null\" [routerLink]=\"item.href\"
|
|
10488
|
+
args: [{ selector: 'xuilib-hmcts-primary-navigation', standalone: false, template: "@if (isUserLoggedIn) {\n <nav class=\"hmcts-primary-navigation\" [attr.aria-label]=\"label\">\n <div class=\"hmcts-primary-navigation__container\">\n @if (isBrandedHeader) {\n <div class=\"govuk-header__logo\"></div>\n }\n <ul class=\"hmcts-primary-navigation__list\">\n @for (item of items; track item) {\n <li class=\"hmcts-primary-navigation__item\" >\n <a class=\"hmcts-primary-navigation__link\" [attr.aria-current]=\"item.active ? true: null\" [routerLink]=\"item.href\">{{ item.text | rpxTranslate }}</a>\n </li>\n }\n </ul>\n </div>\n </nav>\n}\n" }]
|
|
10488
10489
|
}], () => [], { userLoggedIn: [{
|
|
10489
10490
|
type: Input
|
|
10490
10491
|
}], label: [{
|
|
@@ -10558,6 +10559,7 @@ const COMMON_COMPONENTS = [
|
|
|
10558
10559
|
ContactDetailsComponent,
|
|
10559
10560
|
FeatureToggleDirective,
|
|
10560
10561
|
LetDirective,
|
|
10562
|
+
SafeHtmlDirective,
|
|
10561
10563
|
HmctsSessionDialogComponent,
|
|
10562
10564
|
UserListComponent,
|
|
10563
10565
|
UserDetailsComponent,
|
|
@@ -10672,6 +10674,7 @@ class ExuiCommonLibModule {
|
|
|
10672
10674
|
ContactDetailsComponent,
|
|
10673
10675
|
FeatureToggleDirective,
|
|
10674
10676
|
LetDirective,
|
|
10677
|
+
SafeHtmlDirective,
|
|
10675
10678
|
HmctsSessionDialogComponent,
|
|
10676
10679
|
UserListComponent,
|
|
10677
10680
|
UserDetailsComponent,
|
|
@@ -10738,6 +10741,7 @@ class ExuiCommonLibModule {
|
|
|
10738
10741
|
ContactDetailsComponent,
|
|
10739
10742
|
FeatureToggleDirective,
|
|
10740
10743
|
LetDirective,
|
|
10744
|
+
SafeHtmlDirective,
|
|
10741
10745
|
HmctsSessionDialogComponent,
|
|
10742
10746
|
UserListComponent,
|
|
10743
10747
|
UserDetailsComponent,
|
|
@@ -10873,5 +10877,5 @@ function radioGroupValidator() {
|
|
|
10873
10877
|
* Generated bundle index. Do not edit.
|
|
10874
10878
|
*/
|
|
10875
10879
|
|
|
10876
|
-
export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator,
|
|
10880
|
+
export { AccessibilityComponent, AddressMessageEnum, AddressModel, AddressOption, AddressService, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CapitalizePipe, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, FindServiceComponent, FindTaskNameComponent, FindWorkTypeComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LocationService, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RefDataService, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SafeHtmlDirective, SearchJudicialsComponent, SearchLocationComponent, SearchServiceComponent, SearchVenueComponent, SearchWorkTypeComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TaskService, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, WriteAddressFieldComponent, WriteAddressInputsComponent, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, windowProvider, windowToken };
|
|
10877
10881
|
//# sourceMappingURL=hmcts-rpx-xui-common-lib.mjs.map
|