@hmcts/opal-frontend-common 0.0.23 → 0.0.25
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/components/custom/custom-horizontal-scroll-pane/index.d.ts +8 -0
- package/components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/index.d.ts +10 -0
- package/components/custom/custom-scrollable-panes/index.d.ts +9 -0
- package/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane/index.d.ts +10 -0
- package/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane/index.d.ts +9 -0
- package/components/custom/custom-vertical-scroll-pane/index.d.ts +8 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +28 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +22 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +28 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +22 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +30 -0
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +30 -6
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +1 -1
- package/package.json +36 -1
- package/pipes/national-insurance/index.d.ts +10 -0
- package/services/permissions-service/index.d.ts +22 -1
- package/styles/custom/_custom-scrollable-panes.scss +7 -0
- package/styles/styles.scss +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomHorizontalScrollPaneComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomHorizontalScrollPaneComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomHorizontalScrollPaneComponent, "opal-lib-custom-horizontal-scroll-pane", never, {}, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { CustomHorizontalScrollPaneComponent };
|
package/components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomScrollablePanesInnerPaneComponent {
|
|
4
|
+
stickyHeadersEnabled: boolean;
|
|
5
|
+
maxHeight: string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomScrollablePanesInnerPaneComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomScrollablePanesInnerPaneComponent, "opal-lib-custom-scrollable-panes-inner-pane", never, { "stickyHeadersEnabled": { "alias": "stickyHeadersEnabled"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CustomScrollablePanesInnerPaneComponent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomScrollablePanesComponent {
|
|
4
|
+
height: string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomScrollablePanesComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomScrollablePanesComponent, "opal-lib-custom-scrollable-panes", never, { "height": { "alias": "height"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { CustomScrollablePanesComponent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomVerticalScrollPaneInnerPaneComponent {
|
|
4
|
+
maxHeight: string;
|
|
5
|
+
stickyHeadersEnabled: boolean;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomVerticalScrollPaneInnerPaneComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomVerticalScrollPaneInnerPaneComponent, "opal-lib-custom-vertical-scroll-pane-inner-pane", never, { "maxHeight": { "alias": "maxHeight"; "required": false; }; "stickyHeadersEnabled": { "alias": "stickyHeadersEnabled"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CustomVerticalScrollPaneInnerPaneComponent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomVerticalScrollPaneOuterPaneComponent {
|
|
4
|
+
height: string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomVerticalScrollPaneOuterPaneComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomVerticalScrollPaneOuterPaneComponent, "opal-lib-custom-vertical-scroll-pane-outer-pane", never, { "height": { "alias": "height"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { CustomVerticalScrollPaneOuterPaneComponent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomVerticalScrollPaneComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomVerticalScrollPaneComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomVerticalScrollPaneComponent, "opal-lib-custom-vertical-scroll-pane", never, {}, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { CustomVerticalScrollPaneComponent };
|
package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class CustomHorizontalScrollPaneComponent {
|
|
5
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomHorizontalScrollPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomHorizontalScrollPaneComponent, isStandalone: true, selector: "opal-lib-custom-horizontal-scroll-pane", ngImport: i0, template: "<div class=\"custom-horizontal-scroll-pane\">\n <ng-content></ng-content>\n</div>\n", styles: [".custom-horizontal-scroll-pane{overflow-x:auto;overflow-y:hidden;width:100%}\n"] });
|
|
7
|
+
}
|
|
8
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomHorizontalScrollPaneComponent, decorators: [{
|
|
9
|
+
type: Component,
|
|
10
|
+
args: [{ selector: 'opal-lib-custom-horizontal-scroll-pane', template: "<div class=\"custom-horizontal-scroll-pane\">\n <ng-content></ng-content>\n</div>\n", styles: [".custom-horizontal-scroll-pane{overflow-x:auto;overflow-y:hidden;width:100%}\n"] }]
|
|
11
|
+
}] });
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Generated bundle index. Do not edit.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { CustomHorizontalScrollPaneComponent };
|
|
18
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map
|
package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-horizontal-scroll-pane/custom-horizontal-scroll-pane.component.ts","../../../projects/opal-frontend-common/components/custom/custom-horizontal-scroll-pane/custom-horizontal-scroll-pane.component.html","../../../projects/opal-frontend-common/components/custom/custom-horizontal-scroll-pane/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-horizontal-scroll-pane',\n templateUrl: './custom-horizontal-scroll-pane.component.html',\n styleUrl: './custom-horizontal-scroll-pane.component.scss',\n})\nexport class CustomHorizontalScrollPaneComponent {}\n","<div class=\"custom-horizontal-scroll-pane\">\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAOa,mCAAmC,CAAA;wGAAnC,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mCAAmC,kGCPhD,sFAGA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,CAAA;;4FDIa,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAL/C,SAAS;+BACE,wCAAwC,EAAA,QAAA,EAAA,sFAAA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA;;;AEHpD;;AAEG;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Input, Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
class CustomScrollablePanesInnerPaneComponent {
|
|
7
|
+
stickyHeadersEnabled = true;
|
|
8
|
+
maxHeight = '500px';
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomScrollablePanesInnerPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomScrollablePanesInnerPaneComponent, isStandalone: true, selector: "opal-lib-custom-scrollable-panes-inner-pane", inputs: { stickyHeadersEnabled: "stickyHeadersEnabled", maxHeight: "maxHeight" }, ngImport: i0, template: "<div\n class=\"custom-scrollable-panes-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollable-panes-inner-pane{overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
11
|
+
}
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomScrollablePanesInnerPaneComponent, decorators: [{
|
|
13
|
+
type: Component,
|
|
14
|
+
args: [{ selector: 'opal-lib-custom-scrollable-panes-inner-pane', imports: [CommonModule], template: "<div\n class=\"custom-scrollable-panes-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollable-panes-inner-pane{overflow-y:auto}\n"] }]
|
|
15
|
+
}], propDecorators: { stickyHeadersEnabled: [{
|
|
16
|
+
type: Input,
|
|
17
|
+
args: [{ required: false }]
|
|
18
|
+
}], maxHeight: [{
|
|
19
|
+
type: Input,
|
|
20
|
+
args: [{ required: false }]
|
|
21
|
+
}] } });
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generated bundle index. Do not edit.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export { CustomScrollablePanesInnerPaneComponent };
|
|
28
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/custom-scrollable-panes-inner-pane.component.ts","../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/custom-scrollable-panes-inner-pane.component.html","../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-scrollable-panes-inner-pane',\n imports: [CommonModule],\n templateUrl: './custom-scrollable-panes-inner-pane.component.html',\n styleUrl: './custom-scrollable-panes-inner-pane.component.scss',\n})\nexport class CustomScrollablePanesInnerPaneComponent {\n @Input({ required: false }) stickyHeadersEnabled: boolean = true;\n @Input({ required: false }) maxHeight: string = '500px';\n}\n","<div\n class=\"custom-scrollable-panes-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MASa,uCAAuC,CAAA;IACtB,oBAAoB,GAAY,IAAI;IACpC,SAAS,GAAW,OAAO;wGAF5C,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAvC,uCAAuC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6CAAA,EAAA,MAAA,EAAA,EAAA,oBAAA,EAAA,sBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTpD,gMAOA,EAAA,MAAA,EAAA,CAAA,wDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIX,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBANnD,SAAS;+BACE,6CAA6C,EAAA,OAAA,EAC9C,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,gMAAA,EAAA,MAAA,EAAA,CAAA,wDAAA,CAAA,EAAA;8BAKK,oBAAoB,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACE,SAAS,EAAA,CAAA;sBAApC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AEX5B;;AAEG;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class CustomScrollablePanesComponent {
|
|
5
|
+
height = '100%';
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomScrollablePanesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomScrollablePanesComponent, isStandalone: true, selector: "opal-lib-custom-scrollable-panes", inputs: { height: "height" }, ngImport: i0, template: "<div class=\"custom-scrollable-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollable-pane{width:100%}\n"] });
|
|
8
|
+
}
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomScrollablePanesComponent, decorators: [{
|
|
10
|
+
type: Component,
|
|
11
|
+
args: [{ selector: 'opal-lib-custom-scrollable-panes', template: "<div class=\"custom-scrollable-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollable-pane{width:100%}\n"] }]
|
|
12
|
+
}], propDecorators: { height: [{
|
|
13
|
+
type: Input,
|
|
14
|
+
args: [{ required: false }]
|
|
15
|
+
}] } });
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generated bundle index. Do not edit.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export { CustomScrollablePanesComponent };
|
|
22
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/custom-scrollable-panes.component.ts","../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/custom-scrollable-panes.component.html","../../../projects/opal-frontend-common/components/custom/custom-scrollable-panes/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-scrollable-panes',\n templateUrl: './custom-scrollable-panes.component.html',\n styleUrl: './custom-scrollable-panes.component.scss',\n})\nexport class CustomScrollablePanesComponent {\n @Input({ required: false }) public height: string = '100%';\n}\n","<div class=\"custom-scrollable-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAOa,8BAA8B,CAAA;IACN,MAAM,GAAW,MAAM;wGAD/C,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,8BAA8B,0HCP3C,yGAGA,EAAA,MAAA,EAAA,CAAA,uCAAA,CAAA,EAAA,CAAA;;4FDIa,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,SAAS;+BACE,kCAAkC,EAAA,QAAA,EAAA,yGAAA,EAAA,MAAA,EAAA,CAAA,uCAAA,CAAA,EAAA;8BAKT,MAAM,EAAA,CAAA;sBAAxC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AER5B;;AAEG;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Input, Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
class CustomVerticalScrollPaneInnerPaneComponent {
|
|
7
|
+
maxHeight = '500px';
|
|
8
|
+
stickyHeadersEnabled = true;
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneInnerPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomVerticalScrollPaneInnerPaneComponent, isStandalone: true, selector: "opal-lib-custom-vertical-scroll-pane-inner-pane", inputs: { maxHeight: "maxHeight", stickyHeadersEnabled: "stickyHeadersEnabled" }, ngImport: i0, template: "<div\n class=\"custom-vertical-scroll-pane-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-vertical-scroll-pane-inner-pane{overflow-y:auto;overflow-x:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
11
|
+
}
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneInnerPaneComponent, decorators: [{
|
|
13
|
+
type: Component,
|
|
14
|
+
args: [{ selector: 'opal-lib-custom-vertical-scroll-pane-inner-pane', imports: [CommonModule], template: "<div\n class=\"custom-vertical-scroll-pane-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-vertical-scroll-pane-inner-pane{overflow-y:auto;overflow-x:hidden}\n"] }]
|
|
15
|
+
}], propDecorators: { maxHeight: [{
|
|
16
|
+
type: Input,
|
|
17
|
+
args: [{ required: false }]
|
|
18
|
+
}], stickyHeadersEnabled: [{
|
|
19
|
+
type: Input,
|
|
20
|
+
args: [{ required: false }]
|
|
21
|
+
}] } });
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generated bundle index. Do not edit.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export { CustomVerticalScrollPaneInnerPaneComponent };
|
|
28
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane/custom-vertical-scroll-pane-inner-pane.component.ts","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane/custom-vertical-scroll-pane-inner-pane.component.html","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-vertical-scroll-pane-inner-pane',\n imports: [CommonModule],\n templateUrl: './custom-vertical-scroll-pane-inner-pane.component.html',\n styleUrl: './custom-vertical-scroll-pane-inner-pane.component.scss',\n})\nexport class CustomVerticalScrollPaneInnerPaneComponent {\n @Input({ required: false }) maxHeight: string = '500px';\n @Input({ required: false }) stickyHeadersEnabled: boolean = true;\n}\n","<div\n class=\"custom-vertical-scroll-pane-inner-pane\"\n [style.max-height]=\"maxHeight\"\n [ngClass]=\"{ 'sticky-headers': stickyHeadersEnabled }\"\n>\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MASa,0CAA0C,CAAA;IACzB,SAAS,GAAW,OAAO;IAC3B,oBAAoB,GAAY,IAAI;wGAFrD,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA1C,0CAA0C,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iDAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,oBAAA,EAAA,sBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTvD,oMAOA,EAAA,MAAA,EAAA,CAAA,8EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIX,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBANtD,SAAS;+BACE,iDAAiD,EAAA,OAAA,EAClD,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,oMAAA,EAAA,MAAA,EAAA,CAAA,8EAAA,CAAA,EAAA;8BAKK,SAAS,EAAA,CAAA;sBAApC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACE,oBAAoB,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AEX5B;;AAEG;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class CustomVerticalScrollPaneOuterPaneComponent {
|
|
5
|
+
height = '100%';
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneOuterPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomVerticalScrollPaneOuterPaneComponent, isStandalone: true, selector: "opal-lib-custom-vertical-scroll-pane-outer-pane", inputs: { height: "height" }, ngImport: i0, template: "<div class=\"custom-vertical-scroll-pane-outer-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n" });
|
|
8
|
+
}
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneOuterPaneComponent, decorators: [{
|
|
10
|
+
type: Component,
|
|
11
|
+
args: [{ selector: 'opal-lib-custom-vertical-scroll-pane-outer-pane', template: "<div class=\"custom-vertical-scroll-pane-outer-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
12
|
+
}], propDecorators: { height: [{
|
|
13
|
+
type: Input,
|
|
14
|
+
args: [{ required: false }]
|
|
15
|
+
}] } });
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generated bundle index. Do not edit.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export { CustomVerticalScrollPaneOuterPaneComponent };
|
|
22
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane/custom-vertical-scroll-pane-outer-pane.component.ts","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane/custom-vertical-scroll-pane-outer-pane.component.html","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-vertical-scroll-pane-outer-pane',\n templateUrl: './custom-vertical-scroll-pane-outer-pane.component.html',\n})\nexport class CustomVerticalScrollPaneOuterPaneComponent {\n @Input({ required: false }) height: string = '100%';\n}\n","<div class=\"custom-vertical-scroll-pane-outer-pane\" [style.height]=\"height\">\n <ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,0CAA0C,CAAA;IACzB,MAAM,GAAW,MAAM;wGADxC,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA1C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,0CAA0C,yICNvD,yHAGA,EAAA,CAAA;;4FDGa,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBAJtD,SAAS;+BACE,iDAAiD,EAAA,QAAA,EAAA,yHAAA,EAAA;8BAI/B,MAAM,EAAA,CAAA;sBAAjC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AEP5B;;AAEG;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class CustomVerticalScrollPaneComponent {
|
|
5
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CustomVerticalScrollPaneComponent, isStandalone: true, selector: "opal-lib-custom-vertical-scroll-pane", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
7
|
+
}
|
|
8
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CustomVerticalScrollPaneComponent, decorators: [{
|
|
9
|
+
type: Component,
|
|
10
|
+
args: [{ selector: 'opal-lib-custom-vertical-scroll-pane', template: "<ng-content></ng-content>\n" }]
|
|
11
|
+
}] });
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Generated bundle index. Do not edit.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { CustomVerticalScrollPaneComponent };
|
|
18
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map
|
package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs","sources":["../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane.component.ts","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane.component.html","../../../projects/opal-frontend-common/components/custom/custom-vertical-scroll-pane/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-custom-vertical-scroll-pane',\n templateUrl: './custom-vertical-scroll-pane.component.html',\n})\nexport class CustomVerticalScrollPaneComponent {}\n","<ng-content></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,iCAAiC,CAAA;wGAAjC,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iCAAiC,gGCN9C,6BACA,EAAA,CAAA;;4FDKa,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAJ7C,SAAS;+BACE,sCAAsC,EAAA,QAAA,EAAA,6BAAA,EAAA;;;AEHlD;;AAEG;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class NationalInsurancePipe {
|
|
5
|
+
transform(value) {
|
|
6
|
+
if (!value) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
const cleaned = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();
|
|
10
|
+
if (cleaned.length < 9)
|
|
11
|
+
return value;
|
|
12
|
+
return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;
|
|
13
|
+
}
|
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NationalInsurancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
15
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NationalInsurancePipe, isStandalone: true, name: "nationalInsurance" });
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NationalInsurancePipe, decorators: [{
|
|
18
|
+
type: Pipe,
|
|
19
|
+
args: [{
|
|
20
|
+
name: 'nationalInsurance',
|
|
21
|
+
standalone: true,
|
|
22
|
+
}]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generated bundle index. Do not edit.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export { NationalInsurancePipe };
|
|
30
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-pipes-national-insurance.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-pipes-national-insurance.mjs","sources":["../../../projects/opal-frontend-common/pipes/national-insurance/national-insurance.pipe.ts","../../../projects/opal-frontend-common/pipes/national-insurance/hmcts-opal-frontend-common-pipes-national-insurance.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nationalInsurance',\n standalone: true,\n})\nexport class NationalInsurancePipe implements PipeTransform {\n transform(value: string | null): string {\n if (!value) {\n return '';\n }\n\n const cleaned = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();\n\n if (cleaned.length < 9) return value;\n\n return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAoB,EAAA;QAC5B,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AAEA,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AAEhE,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,KAAK;QAEpC,OAAO,CAAA,EAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC1H;wGAXW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;sGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA;;4FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -18,13 +18,37 @@ class PermissionsService {
|
|
|
18
18
|
}
|
|
19
19
|
return this.storedUniquePermissionIds;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether the user has access to a specific permission based on their roles.
|
|
23
|
+
*
|
|
24
|
+
* This method short-circuits and returns as soon as a matching permission is found for efficiency.
|
|
25
|
+
*
|
|
26
|
+
* @param permissionId - The ID of the permission to check for access.
|
|
27
|
+
* @param roles - An array of user roles, each containing a list of permissions.
|
|
28
|
+
* @returns `true` if the user has the specified permission in any of their roles,
|
|
29
|
+
* or if no roles are provided; otherwise, returns `false`.
|
|
30
|
+
*/
|
|
31
|
+
hasPermissionAccess(permissionId, roles) {
|
|
32
|
+
if (roles?.length) {
|
|
33
|
+
return roles.some((role) => role.permissions.some((permission) => permission.permission_id === permissionId));
|
|
34
|
+
}
|
|
35
|
+
// if we don't have any roles, we can't have any permissions
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Checks if the user has access to a specific permission within a given business unit.
|
|
40
|
+
*
|
|
41
|
+
* This method short-circuits and returns as soon as a matching permission is found for efficiency.
|
|
42
|
+
*
|
|
43
|
+
* @param permissionId - The ID of the permission to check.
|
|
44
|
+
* @param businessUnitId - The ID of the business unit to check against.
|
|
45
|
+
* @param roles - An array of user roles, each containing permissions and associated business unit IDs.
|
|
46
|
+
* @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.
|
|
47
|
+
*/
|
|
48
|
+
hasBusinessUnitPermissionAccess(permissionId, businessUnitId, roles) {
|
|
22
49
|
if (roles?.length) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Then we need to find the matching permission
|
|
26
|
-
const hasPermission = !!role?.permissions.find((permission) => permission.permission_id === permissionId);
|
|
27
|
-
return hasPermission;
|
|
50
|
+
return roles.some((role) => role.business_unit_id === businessUnitId &&
|
|
51
|
+
role.permissions.some((permission) => permission.permission_id === permissionId));
|
|
28
52
|
}
|
|
29
53
|
// if we don't have any roles, we can't have any permissions
|
|
30
54
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n ISessionUserStateRole,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: ISessionUserState | null): number[] {\n const roles = userState ? userState['business_unit_user'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n /**\n * Determines whether the user has access to a specific permission based on their roles.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check for access.\n * @param roles - An array of user roles, each containing a list of permissions.\n * @returns `true` if the user has the specified permission in any of their roles,\n * or if no roles are provided; otherwise, returns `false`.\n */\n public hasPermissionAccess(permissionId: number, roles: ISessionUserStateRole[]): boolean {\n if (roles?.length) {\n return roles.some((role) => role.permissions.some((permission) => permission.permission_id === permissionId));\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n\n /**\n * Checks if the user has access to a specific permission within a given business unit.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check.\n * @param businessUnitId - The ID of the business unit to check against.\n * @param roles - An array of user roles, each containing permissions and associated business unit IDs.\n * @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.\n */\n public hasBusinessUnitPermissionAccess(\n permissionId: number,\n businessUnitId: number,\n roles: ISessionUserStateRole[],\n ): boolean {\n if (roles?.length) {\n return roles.some(\n (role) =>\n role.business_unit_id === businessUnitId &&\n role.permissions.some((permission) => permission.permission_id === permissionId),\n );\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAmC,EAAA;AAC7D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI;QAEhE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC3C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,YAAY,CAAC;AAChF,YAAA,CAAC,CAAC;YAEF,IAAI,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QAC9D;QAEA,OAAO,IAAI,CAAC,yBAAyB;IACvC;AAEA;;;;;;;;;AASG;IACI,mBAAmB,CAAC,YAAoB,EAAE,KAA8B,EAAA;AAC7E,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;YACjB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CAAC,CAAC;QAC/G;;AAEA,QAAA,OAAO,IAAI;IACb;AAEA;;;;;;;;;AASG;AACI,IAAA,+BAA+B,CACpC,YAAoB,EACpB,cAAsB,EACtB,KAA8B,EAAA;AAE9B,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;AACjB,YAAA,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,IAAI,KACH,IAAI,CAAC,gBAAgB,KAAK,cAAc;AACxC,gBAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CAAC,CACnF;QACH;;AAEA,QAAA,OAAO,IAAI;IACb;wGAhEW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA;;4FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmcts/opal-frontend-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^18.2.0 || ^19.0.0",
|
|
@@ -174,6 +174,36 @@
|
|
|
174
174
|
"./components/custom/custom-page-header/custom-page-header-action-buttons-container": {
|
|
175
175
|
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header-custom-page-header-action-buttons-container.mjs"
|
|
176
176
|
},
|
|
177
|
+
"./components/custom/custom-horizontal-scroll-pane": {
|
|
178
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs",
|
|
179
|
+
"types": "./components/custom/custom-horizontal-scroll-pane/index.d.ts",
|
|
180
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs"
|
|
181
|
+
},
|
|
182
|
+
"./components/custom/custom-scrollable-panes": {
|
|
183
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs",
|
|
184
|
+
"types": "./components/custom/custom-scrollable-panes/index.d.ts",
|
|
185
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs"
|
|
186
|
+
},
|
|
187
|
+
"./components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane": {
|
|
188
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs",
|
|
189
|
+
"types": "./components/custom/custom-scrollable-panes/custom-scrollable-panes-inner-pane/index.d.ts",
|
|
190
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs"
|
|
191
|
+
},
|
|
192
|
+
"./components/custom/custom-vertical-scroll-pane": {
|
|
193
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs",
|
|
194
|
+
"types": "./components/custom/custom-vertical-scroll-pane/index.d.ts",
|
|
195
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs"
|
|
196
|
+
},
|
|
197
|
+
"./components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane": {
|
|
198
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs",
|
|
199
|
+
"types": "./components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-inner-pane/index.d.ts",
|
|
200
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs"
|
|
201
|
+
},
|
|
202
|
+
"./components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane": {
|
|
203
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs",
|
|
204
|
+
"types": "./components/custom/custom-vertical-scroll-pane/custom-vertical-scroll-pane-outer-pane/index.d.ts",
|
|
205
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs"
|
|
206
|
+
},
|
|
177
207
|
"./components/govuk/govuk-accordion": {
|
|
178
208
|
"import": "./fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs",
|
|
179
209
|
"types": "./components/govuk/govuk-accordion/index.d.ts",
|
|
@@ -560,6 +590,11 @@
|
|
|
560
590
|
"types": "./pipes/days-ago/index.d.ts",
|
|
561
591
|
"default": "./fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs"
|
|
562
592
|
},
|
|
593
|
+
"./pipes/national-insurance": {
|
|
594
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs",
|
|
595
|
+
"types": "./pipes/national-insurance/index.d.ts",
|
|
596
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs"
|
|
597
|
+
},
|
|
563
598
|
"./resolvers/title": {
|
|
564
599
|
"import": "./fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs",
|
|
565
600
|
"types": "./resolvers/title/index.d.ts",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { PipeTransform } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class NationalInsurancePipe implements PipeTransform {
|
|
5
|
+
transform(value: string | null): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NationalInsurancePipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<NationalInsurancePipe, "nationalInsurance", true>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { NationalInsurancePipe };
|
|
@@ -9,7 +9,28 @@ declare class PermissionsService {
|
|
|
9
9
|
* @returns An array of unique permission IDs.
|
|
10
10
|
*/
|
|
11
11
|
getUniquePermissions(userState: ISessionUserState | null): number[];
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Determines whether the user has access to a specific permission based on their roles.
|
|
14
|
+
*
|
|
15
|
+
* This method short-circuits and returns as soon as a matching permission is found for efficiency.
|
|
16
|
+
*
|
|
17
|
+
* @param permissionId - The ID of the permission to check for access.
|
|
18
|
+
* @param roles - An array of user roles, each containing a list of permissions.
|
|
19
|
+
* @returns `true` if the user has the specified permission in any of their roles,
|
|
20
|
+
* or if no roles are provided; otherwise, returns `false`.
|
|
21
|
+
*/
|
|
22
|
+
hasPermissionAccess(permissionId: number, roles: ISessionUserStateRole[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the user has access to a specific permission within a given business unit.
|
|
25
|
+
*
|
|
26
|
+
* This method short-circuits and returns as soon as a matching permission is found for efficiency.
|
|
27
|
+
*
|
|
28
|
+
* @param permissionId - The ID of the permission to check.
|
|
29
|
+
* @param businessUnitId - The ID of the business unit to check against.
|
|
30
|
+
* @param roles - An array of user roles, each containing permissions and associated business unit IDs.
|
|
31
|
+
* @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.
|
|
32
|
+
*/
|
|
33
|
+
hasBusinessUnitPermissionAccess(permissionId: number, businessUnitId: number, roles: ISessionUserStateRole[]): boolean;
|
|
13
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<PermissionsService, never>;
|
|
14
35
|
static ɵprov: i0.ɵɵInjectableDeclaration<PermissionsService>;
|
|
15
36
|
}
|