@verisoft/ui-govcz 20.1.0 → 20.1.2
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/verisoft-ui-govcz.mjs +3770 -0
- package/fesm2022/verisoft-ui-govcz.mjs.map +1 -0
- package/index.d.ts +1013 -0
- package/package.json +19 -7
- package/styles/dist/main.css +13 -0
- package/styles/dist/main.css.map +1 -0
- package/.eslintrc.json +0 -60
- package/jest.config.ts +0 -21
- package/ng-package.json +0 -28
- package/project.json +0 -49
- package/src/config.d.ts +0 -10
- package/src/index.ts +0 -1
- package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -25
- package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -28
- package/src/lib/components/breadcrumb/index.ts +0 -1
- package/src/lib/components/button/button.component.html +0 -28
- package/src/lib/components/button/button.component.scss +0 -21
- package/src/lib/components/button/button.component.ts +0 -77
- package/src/lib/components/button/index.ts +0 -1
- package/src/lib/components/calendar/calendar.component.html +0 -28
- package/src/lib/components/calendar/calendar.component.scss +0 -0
- package/src/lib/components/calendar/calendar.component.ts +0 -77
- package/src/lib/components/calendar/index.ts +0 -1
- package/src/lib/components/checkbox/checkbox.component.html +0 -23
- package/src/lib/components/checkbox/checkbox.component.scss +0 -0
- package/src/lib/components/checkbox/checkbox.component.ts +0 -61
- package/src/lib/components/checkbox/index.ts +0 -1
- package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -50
- package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -4
- package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -79
- package/src/lib/components/confirm-dialog/index.ts +0 -1
- package/src/lib/components/dropdown/dropdown-item.component.html +0 -8
- package/src/lib/components/dropdown/dropdown-item.component.ts +0 -18
- package/src/lib/components/dropdown/dropdown.component.html +0 -91
- package/src/lib/components/dropdown/dropdown.component.scss +0 -108
- package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
- package/src/lib/components/dropdown/dropdown.component.ts +0 -296
- package/src/lib/components/dropdown/dropdown.model.ts +0 -6
- package/src/lib/components/dropdown/index.ts +0 -1
- package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -31
- package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -34
- package/src/lib/components/dropdown-button/index.ts +0 -1
- package/src/lib/components/errors/error.component.html +0 -11
- package/src/lib/components/errors/error.component.scss +0 -0
- package/src/lib/components/errors/error.component.spec.ts +0 -19
- package/src/lib/components/errors/error.component.ts +0 -29
- package/src/lib/components/errors/index.ts +0 -1
- package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +0 -32
- package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +0 -8
- package/src/lib/components/feature-list/feature-list-filter.pipe.ts +0 -20
- package/src/lib/components/feature-list/feature-list-page.component.ts +0 -30
- package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
- package/src/lib/components/feature-list/feature-list.component.html +0 -67
- package/src/lib/components/feature-list/feature-list.component.scss +0 -10
- package/src/lib/components/feature-list/feature-list.component.ts +0 -360
- package/src/lib/components/feature-list/index.ts +0 -5
- package/src/lib/components/filter/directives/filter-field.directive.ts +0 -35
- package/src/lib/components/filter/filter.component.html +0 -78
- package/src/lib/components/filter/filter.component.scss +0 -32
- package/src/lib/components/filter/filter.component.spec.ts +0 -21
- package/src/lib/components/filter/filter.component.stories.ts +0 -23
- package/src/lib/components/filter/filter.component.ts +0 -286
- package/src/lib/components/filter/filter.model.ts +0 -18
- package/src/lib/components/filter/index.ts +0 -2
- package/src/lib/components/form-field/form-field.component.html +0 -14
- package/src/lib/components/form-field/form-field.component.scss +0 -0
- package/src/lib/components/form-field/form-field.component.spec.ts +0 -21
- package/src/lib/components/form-field/form-field.component.ts +0 -76
- package/src/lib/components/form-field/index.ts +0 -1
- package/src/lib/components/header/header.component.html +0 -122
- package/src/lib/components/header/header.component.scss +0 -0
- package/src/lib/components/header/header.component.ts +0 -90
- package/src/lib/components/header/index.ts +0 -1
- package/src/lib/components/icon/icon.component.html +0 -11
- package/src/lib/components/icon/icon.component.scss +0 -20
- package/src/lib/components/icon/icon.component.ts +0 -110
- package/src/lib/components/icon/index.ts +0 -2
- package/src/lib/components/index.ts +0 -37
- package/src/lib/components/input-group/index.ts +0 -1
- package/src/lib/components/input-group/input-group.component.html +0 -41
- package/src/lib/components/input-group/input-group.component.scss +0 -0
- package/src/lib/components/input-group/input-group.component.ts +0 -75
- package/src/lib/components/loader/index.ts +0 -1
- package/src/lib/components/loader/loader.component.html +0 -7
- package/src/lib/components/loader/loader.component.scss +0 -0
- package/src/lib/components/loader/loader.component.spec.ts +0 -21
- package/src/lib/components/loader/loader.component.ts +0 -33
- package/src/lib/components/multiselect/index.ts +0 -1
- package/src/lib/components/multiselect/multiselect.component.html +0 -21
- package/src/lib/components/multiselect/multiselect.component.scss +0 -0
- package/src/lib/components/multiselect/multiselect.component.spec.ts +0 -21
- package/src/lib/components/multiselect/multiselect.component.ts +0 -117
- package/src/lib/components/number-input/index.ts +0 -1
- package/src/lib/components/number-input/number-input.component.html +0 -48
- package/src/lib/components/number-input/number-input.component.scss +0 -0
- package/src/lib/components/number-input/number-input.component.ts +0 -80
- package/src/lib/components/page-header/index.ts +0 -1
- package/src/lib/components/page-header/page-header.component.html +0 -3
- package/src/lib/components/page-header/page-header.component.scss +0 -11
- package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
- package/src/lib/components/page-header/page-header.component.ts +0 -27
- package/src/lib/components/password/index.ts +0 -1
- package/src/lib/components/password/password.component.html +0 -31
- package/src/lib/components/password/password.component.scss +0 -0
- package/src/lib/components/password/password.component.spec.ts +0 -21
- package/src/lib/components/password/password.component.ts +0 -83
- package/src/lib/components/radiobutton/index.ts +0 -1
- package/src/lib/components/radiobutton/radiobutton.component.html +0 -23
- package/src/lib/components/radiobutton/radiobutton.component.scss +0 -0
- package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
- package/src/lib/components/search/index.ts +0 -1
- package/src/lib/components/search/search.component.html +0 -23
- package/src/lib/components/search/search.component.scss +0 -0
- package/src/lib/components/search/search.component.ts +0 -45
- package/src/lib/components/section/index.ts +0 -1
- package/src/lib/components/section/section.component.html +0 -26
- package/src/lib/components/section/section.component.scss +0 -0
- package/src/lib/components/section/section.component.ts +0 -55
- package/src/lib/components/side-menu/index.ts +0 -2
- package/src/lib/components/side-menu/side-menu.component.html +0 -22
- package/src/lib/components/side-menu/side-menu.component.scss +0 -17
- package/src/lib/components/side-menu/side-menu.component.ts +0 -42
- package/src/lib/components/side-menu/side-menu.module.ts +0 -56
- package/src/lib/components/snackbar/index.ts +0 -2
- package/src/lib/components/snackbar/services/snackbar.service.ts +0 -73
- package/src/lib/components/snackbar/snackbar.component.html +0 -14
- package/src/lib/components/snackbar/snackbar.component.scss +0 -0
- package/src/lib/components/snackbar/snackbar.component.spec.ts +0 -21
- package/src/lib/components/snackbar/snackbar.component.ts +0 -44
- package/src/lib/components/snackbar/snackbar.model.ts +0 -10
- package/src/lib/components/stepper/index.ts +0 -1
- package/src/lib/components/stepper/stepper.component.html +0 -35
- package/src/lib/components/stepper/stepper.component.scss +0 -9
- package/src/lib/components/stepper/stepper.component.ts +0 -60
- package/src/lib/components/switch/index.ts +0 -1
- package/src/lib/components/switch/switch.component.html +0 -16
- package/src/lib/components/switch/switch.component.scss +0 -0
- package/src/lib/components/switch/switch.component.ts +0 -39
- package/src/lib/components/tab-view/index.ts +0 -2
- package/src/lib/components/tab-view/tab-view-item.component.ts +0 -23
- package/src/lib/components/tab-view/tab-view.component.html +0 -51
- package/src/lib/components/tab-view/tab-view.component.scss +0 -43
- package/src/lib/components/tab-view/tab-view.component.ts +0 -64
- package/src/lib/components/tab-view/tab-view.module.ts +0 -25
- package/src/lib/components/table/index.ts +0 -1
- package/src/lib/components/table/table-pagination-info.component.html +0 -9
- package/src/lib/components/table/table-pagination-info.component.ts +0 -22
- package/src/lib/components/table/table.component.html +0 -199
- package/src/lib/components/table/table.component.scss +0 -192
- package/src/lib/components/table/table.component.ts +0 -390
- package/src/lib/components/table/table.model.ts +0 -17
- package/src/lib/components/table/table.models.ts +0 -12
- package/src/lib/components/tag/index.ts +0 -3
- package/src/lib/components/tag/tag.component.html +0 -12
- package/src/lib/components/tag/tag.component.scss +0 -4
- package/src/lib/components/tag/tag.component.ts +0 -44
- package/src/lib/components/tag/tag.model.ts +0 -7
- package/src/lib/components/textarea/index.ts +0 -1
- package/src/lib/components/textarea/textarea.component.html +0 -50
- package/src/lib/components/textarea/textarea.component.scss +0 -0
- package/src/lib/components/textarea/textarea.component.ts +0 -77
- package/src/lib/components/textfield/index.ts +0 -1
- package/src/lib/components/textfield/textfield.component.html +0 -34
- package/src/lib/components/textfield/textfield.component.scss +0 -0
- package/src/lib/components/textfield/textfield.component.ts +0 -112
- package/src/lib/components/tooltip/index.ts +0 -1
- package/src/lib/components/tooltip/tooltip.component.html +0 -9
- package/src/lib/components/tooltip/tooltip.component.ts +0 -19
- package/src/lib/icons.ts +0 -36
- package/src/lib/index.ts +0 -5
- package/src/lib/init.service.ts +0 -11
- package/src/lib/interceptors/http-error-message.interceptor.ts +0 -45
- package/src/lib/pages/bad-request-page/bad-request-page.component.html +0 -5
- package/src/lib/pages/bad-request-page/bad-request-page.component.scss +0 -0
- package/src/lib/pages/bad-request-page/bad-request-page.component.ts +0 -14
- package/src/lib/pages/error-page/error-page.component.html +0 -5
- package/src/lib/pages/error-page/error-page.component.scss +0 -0
- package/src/lib/pages/error-page/error-page.component.ts +0 -31
- package/src/lib/pages/error-page/error-page.constants.ts +0 -19
- package/src/lib/pages/index.ts +0 -3
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.html +0 -5
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.scss +0 -0
- package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.ts +0 -15
- package/src/lib/pages/not-authenticated/index.ts +0 -1
- package/src/lib/pages/not-authenticated/not-authenticated.component.html +0 -5
- package/src/lib/pages/not-authenticated/not-authenticated.component.ts +0 -13
- package/src/lib/pages/not-authorized/index.ts +0 -1
- package/src/lib/pages/not-authorized/not-authorized.component.html +0 -5
- package/src/lib/pages/not-authorized/not-authorized.component.ts +0 -17
- package/src/lib/pages/not-found/index.ts +0 -1
- package/src/lib/pages/not-found/not-found.component.html +0 -5
- package/src/lib/pages/not-found/not-found.component.ts +0 -17
- package/src/lib/pages/not-found-page/not-found-page.component.html +0 -6
- package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
- package/src/lib/pages/not-found-page/not-found-page.component.ts +0 -15
- package/src/lib/pipes/color/color.pipe.ts +0 -24
- package/src/lib/pipes/index.ts +0 -3
- package/src/lib/pipes/multiselect/multiselect-options.pipe.ts +0 -61
- package/src/lib/pipes/size/size.pipe.ts +0 -24
- package/src/test-setup.ts +0 -8
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -16
- /package/{src → styles}/sass/foundations/_colors.scss +0 -0
- /package/{src → styles}/sass/foundations/index.scss +0 -0
- /package/{src → styles}/sass/header.css +0 -0
- /package/{src → styles}/sass/header.scss +0 -0
- /package/{src → styles}/sass/integrations/_bootstrap.scss +0 -0
- /package/{src → styles}/sass/integrations/index.scss +0 -0
- /package/{src → styles}/sass/main.scss +0 -0
- /package/{src → styles}/sass/overrides/_gov.scss +0 -0
- /package/{src → styles}/sass/overrides/index.scss +0 -0
- /package/{src → styles}/sass/scrollbar.scss +0 -0
- /package/{src → styles}/sass/tokens/_theme-dark.scss +0 -0
- /package/{src → styles}/sass/tokens/_theme-light.scss +0 -0
- /package/{src → styles}/sass/tokens/index.scss +0 -0
- /package/{src → styles}/sass/utils/_table_filter.scss +0 -0
- /package/{src → styles}/sass/utils/_utils.scss +0 -0
- /package/{src → styles}/sass/utils/index.scss +0 -0
- /package/{src → styles}/sass/vendors/_bootstrap.scss +0 -0
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
Input,
|
|
6
|
-
OnInit,
|
|
7
|
-
Optional,
|
|
8
|
-
Self,
|
|
9
|
-
} from '@angular/core';
|
|
10
|
-
import {
|
|
11
|
-
ControlValueAccessor,
|
|
12
|
-
FormControl,
|
|
13
|
-
NgControl,
|
|
14
|
-
ReactiveFormsModule,
|
|
15
|
-
Validators,
|
|
16
|
-
} from '@angular/forms';
|
|
17
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
18
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
19
|
-
import {
|
|
20
|
-
TextfieldCore,
|
|
21
|
-
TEXTFIELD_COMPONENT_TOKEN,
|
|
22
|
-
FieldType,
|
|
23
|
-
BaseFormInputComponent,
|
|
24
|
-
FieldSizeType,
|
|
25
|
-
FieldSize,
|
|
26
|
-
IconPositionType,
|
|
27
|
-
IconPosition,
|
|
28
|
-
SlotPositionType,
|
|
29
|
-
SlotPosition,
|
|
30
|
-
FieldTypeType,
|
|
31
|
-
} from '@verisoft/ui-core';
|
|
32
|
-
import { GovSizePipe } from '../../pipes';
|
|
33
|
-
import { ErrorComponent } from '../errors';
|
|
34
|
-
import { TooltipComponent } from '../tooltip';
|
|
35
|
-
@Component({
|
|
36
|
-
selector: 'v-textfield',
|
|
37
|
-
imports: [
|
|
38
|
-
ReactiveFormsModule,
|
|
39
|
-
GovDesignSystemModule,
|
|
40
|
-
TooltipComponent,
|
|
41
|
-
GovSizePipe,
|
|
42
|
-
TranslateModule,
|
|
43
|
-
ErrorComponent
|
|
44
|
-
],
|
|
45
|
-
templateUrl: './textfield.component.html',
|
|
46
|
-
styleUrl: './textfield.component.scss',
|
|
47
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
48
|
-
providers: [
|
|
49
|
-
{
|
|
50
|
-
provide: TEXTFIELD_COMPONENT_TOKEN,
|
|
51
|
-
useExisting: TextfieldComponent,
|
|
52
|
-
},
|
|
53
|
-
]
|
|
54
|
-
})
|
|
55
|
-
export class TextfieldComponent
|
|
56
|
-
extends BaseFormInputComponent
|
|
57
|
-
implements ControlValueAccessor, TextfieldCore, OnInit
|
|
58
|
-
{
|
|
59
|
-
@Input() floatLabel!: boolean;
|
|
60
|
-
@Input() type: FieldTypeType = FieldType.text;
|
|
61
|
-
@Input() minlength = 0;
|
|
62
|
-
@Input() maxlength = 524288;
|
|
63
|
-
@Input() min = -2147483648;
|
|
64
|
-
@Input() max = 2147483647;
|
|
65
|
-
@Input() prefix!: string;
|
|
66
|
-
@Input() sufix!: string;
|
|
67
|
-
@Input() message!: string;
|
|
68
|
-
@Input() name!: string;
|
|
69
|
-
@Input() role!: string;
|
|
70
|
-
@Input() size: FieldSizeType | undefined = FieldSize.medium;
|
|
71
|
-
@Input() icon!: string;
|
|
72
|
-
@Input() iconPos: IconPositionType = IconPosition.right;
|
|
73
|
-
@Input() labelSlot: SlotPositionType = SlotPosition.top;
|
|
74
|
-
@Input() errorSlot: SlotPositionType = SlotPosition.bottom;
|
|
75
|
-
@Input() messageSlot: SlotPositionType = SlotPosition.bottom;
|
|
76
|
-
|
|
77
|
-
constructor(@Optional() @Self() ngControl: NgControl) {
|
|
78
|
-
super(ngControl);
|
|
79
|
-
if (ngControl) {
|
|
80
|
-
ngControl.valueAccessor = this;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
override ngOnInit(): void {
|
|
85
|
-
super.ngOnInit();
|
|
86
|
-
|
|
87
|
-
if (!this.formControl && this.ngControl) {
|
|
88
|
-
this.formControl = this.ngControl.control as FormControl;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (this.formControl && this.type === FieldType.number) {
|
|
92
|
-
this.setMinMaxNumberInputValidators();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
private setMinMaxNumberInputValidators(): void {
|
|
97
|
-
if (!this.formControl) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const validators = [];
|
|
102
|
-
if (this.min !== undefined && this.min !== null) {
|
|
103
|
-
validators.push(Validators.min(this.min));
|
|
104
|
-
}
|
|
105
|
-
if (this.max !== undefined && this.max !== null) {
|
|
106
|
-
validators.push(Validators.max(this.max));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
this.formControl.addValidators(validators);
|
|
110
|
-
this.formControl.updateValueAndValidity({ onlySelf: true, emitEvent: true });
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tooltip.component';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component, input } from "@angular/core";
|
|
2
|
-
import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
|
|
3
|
-
import { ControlSeverityType, FieldSizeType, PositionType, TooltipCore } from "@verisoft/ui-core";
|
|
4
|
-
import { GovSizePipe } from "../../pipes";
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: "v-tooltip",
|
|
8
|
-
templateUrl: './tooltip.component.html',
|
|
9
|
-
imports: [
|
|
10
|
-
GovDesignSystemModule,
|
|
11
|
-
GovSizePipe
|
|
12
|
-
]
|
|
13
|
-
})
|
|
14
|
-
export class TooltipComponent implements TooltipCore {
|
|
15
|
-
color = input<ControlSeverityType | undefined>(undefined);
|
|
16
|
-
position = input<PositionType | undefined>(undefined);
|
|
17
|
-
size = input<FieldSizeType | undefined>(undefined);
|
|
18
|
-
tooltipText = input<string | undefined>(undefined);
|
|
19
|
-
}
|
package/src/lib/icons.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CommonIcons } from '@verisoft/ui-core';
|
|
2
|
-
|
|
3
|
-
export const Icons: CommonIcons = {
|
|
4
|
-
add: 'plus-lg',
|
|
5
|
-
minus: 'dash',
|
|
6
|
-
delete: 'trash',
|
|
7
|
-
filter: 'filter',
|
|
8
|
-
download: 'upload',
|
|
9
|
-
save: 'download',
|
|
10
|
-
print: 'print-fill',
|
|
11
|
-
edit: 'pencil',
|
|
12
|
-
calendar: 'calendar',
|
|
13
|
-
settings: 'gear',
|
|
14
|
-
house: 'house-door-fill',
|
|
15
|
-
chevronRight: 'chevron-right',
|
|
16
|
-
chevronDown: 'chevron-down',
|
|
17
|
-
chevronLeft: 'chevron-left',
|
|
18
|
-
chevronUp: 'chevron-up',
|
|
19
|
-
checkbox: 'check-square',
|
|
20
|
-
warning: 'exclamation-triangle-fill',
|
|
21
|
-
search: 'search',
|
|
22
|
-
action: 'bars',
|
|
23
|
-
user: 'user',
|
|
24
|
-
logout: 'logout',
|
|
25
|
-
crossCircle: 'x-circle',
|
|
26
|
-
infoCircle: 'info-circle',
|
|
27
|
-
cross: 'x-lg',
|
|
28
|
-
arrowLeft: 'arrow-left',
|
|
29
|
-
arrowRight: 'arrow-right',
|
|
30
|
-
questionCircle: 'question-circle',
|
|
31
|
-
checkCircle: 'check-circle',
|
|
32
|
-
sitemap: 'diagram',
|
|
33
|
-
check: 'check-lg',
|
|
34
|
-
envelope: 'envelope',
|
|
35
|
-
loader: 'loader',
|
|
36
|
-
};
|
package/src/lib/index.ts
DELETED
package/src/lib/init.service.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { defineCustomElements } from "@gov-design-system-ce/components/loader";
|
|
3
|
-
|
|
4
|
-
@Injectable({
|
|
5
|
-
providedIn: 'root',
|
|
6
|
-
})
|
|
7
|
-
export class GovInitService {
|
|
8
|
-
constructor() {
|
|
9
|
-
defineCustomElements(window);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HttpErrorResponse,
|
|
3
|
-
HttpEvent,
|
|
4
|
-
HttpHandler,
|
|
5
|
-
HttpInterceptor,
|
|
6
|
-
HttpRequest,
|
|
7
|
-
} from '@angular/common/http';
|
|
8
|
-
import { inject, Injectable } from '@angular/core';
|
|
9
|
-
import { catchError, Observable, throwError } from 'rxjs';
|
|
10
|
-
import { SnackbarService } from '../components';
|
|
11
|
-
|
|
12
|
-
@Injectable()
|
|
13
|
-
export class HttpErrorMessageInterceptor implements HttpInterceptor {
|
|
14
|
-
|
|
15
|
-
snackbarService = inject(SnackbarService);
|
|
16
|
-
|
|
17
|
-
intercept(
|
|
18
|
-
req: HttpRequest<any>,
|
|
19
|
-
next: HttpHandler
|
|
20
|
-
): Observable<HttpEvent<any>> {
|
|
21
|
-
return next.handle(req).pipe(
|
|
22
|
-
catchError((errorResponse: HttpErrorResponse) => {
|
|
23
|
-
if (!errorResponse.ok) {
|
|
24
|
-
|
|
25
|
-
if (errorResponse.status === 400) {
|
|
26
|
-
console.error('Bad request');
|
|
27
|
-
} if (errorResponse.status === 403) {
|
|
28
|
-
this.snackbarService.showError('Unauthorized request');
|
|
29
|
-
console.error('Unauthorized request');
|
|
30
|
-
} if (errorResponse.status === 404) {
|
|
31
|
-
console.error('Entity not found');
|
|
32
|
-
} if (errorResponse.status === 422) {
|
|
33
|
-
console.error('Error occured during validation');
|
|
34
|
-
console.log(errorResponse);
|
|
35
|
-
} else {
|
|
36
|
-
this.snackbarService.showError(errorResponse.message);
|
|
37
|
-
console.error(errorResponse);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return throwError(() => errorResponse);
|
|
42
|
-
})
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<gov-error-code>
|
|
2
|
-
<gov-icon type="complex" name="card-400" slot="icon"></gov-icon>
|
|
3
|
-
<p>Sorry, the server cannot or will not process the request</p>
|
|
4
|
-
<gov-button color="primary" size="m" type="solid" (gov-click)="navigationBack()">Go back</gov-button>
|
|
5
|
-
</gov-error-code>
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'v-bad-request-page',
|
|
6
|
-
imports: [GovDesignSystemModule],
|
|
7
|
-
templateUrl: './bad-request-page.component.html',
|
|
8
|
-
styleUrl: './bad-request-page.component.scss'
|
|
9
|
-
})
|
|
10
|
-
export class BadRequestPageComponent {
|
|
11
|
-
navigationBack() {
|
|
12
|
-
history.back();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
File without changes
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Component, Input } from '@angular/core';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
5
|
-
import { ErrorDetails, ERROR_MAP } from './error-page.constants';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'v-error-page',
|
|
9
|
-
imports: [GovDesignSystemModule],
|
|
10
|
-
templateUrl: './error-page.component.html',
|
|
11
|
-
styleUrl: './error-page.component.scss'
|
|
12
|
-
})
|
|
13
|
-
export class ErrorPageComponent {
|
|
14
|
-
@Input() url!: string;
|
|
15
|
-
@Input() code = 404;
|
|
16
|
-
|
|
17
|
-
constructor(private router: Router) {}
|
|
18
|
-
|
|
19
|
-
get errorDetails(): ErrorDetails {
|
|
20
|
-
return ERROR_MAP[this.code];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
navigateToUrl() {
|
|
24
|
-
if (this.url) {
|
|
25
|
-
this.router.navigate([this.url]);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
history.back();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface ErrorDetails {
|
|
2
|
-
message: string;
|
|
3
|
-
iconName: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const ERROR_MAP: Record<number, ErrorDetails> = {
|
|
7
|
-
400: {
|
|
8
|
-
message: 'Sorry, the server cannot or will not process the request.',
|
|
9
|
-
iconName: 'card-400'
|
|
10
|
-
},
|
|
11
|
-
404: {
|
|
12
|
-
message: 'Sorry, the page you are looking for does not exist or has been moved.',
|
|
13
|
-
iconName: 'card-404'
|
|
14
|
-
},
|
|
15
|
-
500: {
|
|
16
|
-
message: 'Sorry, an unexpected condition was encountered.',
|
|
17
|
-
iconName: 'card-500'
|
|
18
|
-
}
|
|
19
|
-
};
|
package/src/lib/pages/index.ts
DELETED
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'v-internal-server-error-page',
|
|
7
|
-
imports: [GovDesignSystemModule],
|
|
8
|
-
templateUrl: './internal-server-error-page.component.html',
|
|
9
|
-
styleUrl: './internal-server-error-page.component.scss'
|
|
10
|
-
})
|
|
11
|
-
export class InternalServerErrorPageComponent {
|
|
12
|
-
navigationBack() {
|
|
13
|
-
history.back();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './not-authenticated.component';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
|
|
3
|
-
import { ButtonComponent } from "./../../components";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'v-not-authenticated',
|
|
7
|
-
templateUrl: "./not-authenticated.component.html",
|
|
8
|
-
imports: [
|
|
9
|
-
GovDesignSystemModule,
|
|
10
|
-
ButtonComponent,
|
|
11
|
-
]
|
|
12
|
-
})
|
|
13
|
-
export class NotAuthenticatedComponent { }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './not-authorized.component';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
|
|
3
|
-
import { ButtonComponent } from "../../components";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'v-not-authorized',
|
|
7
|
-
templateUrl: "./not-authorized.component.html",
|
|
8
|
-
imports: [
|
|
9
|
-
GovDesignSystemModule,
|
|
10
|
-
ButtonComponent,
|
|
11
|
-
]
|
|
12
|
-
})
|
|
13
|
-
export class NotAuthorizedComponent {
|
|
14
|
-
goBack(): void {
|
|
15
|
-
history.back();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './not-found.component';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
|
|
3
|
-
import { ButtonComponent } from "../../components";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'v-not-found',
|
|
7
|
-
templateUrl: "./not-found.component.html",
|
|
8
|
-
imports: [
|
|
9
|
-
GovDesignSystemModule,
|
|
10
|
-
ButtonComponent
|
|
11
|
-
]
|
|
12
|
-
})
|
|
13
|
-
export class NotFoundComponent {
|
|
14
|
-
goBack(): void {
|
|
15
|
-
history.back();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<gov-error-code>
|
|
2
|
-
<gov-icon type="complex" name="card-404" slot="icon"></gov-icon>
|
|
3
|
-
<p>This is not the page you are looking for.<br />Try searching for something
|
|
4
|
-
else.</p>
|
|
5
|
-
<gov-button color="primary" size="m" type="solid" (gov-click)="navigationBack()">Go back</gov-button>
|
|
6
|
-
</gov-error-code>
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Component } from '@angular/core';
|
|
3
|
-
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'v-not-found-page',
|
|
7
|
-
imports: [GovDesignSystemModule],
|
|
8
|
-
templateUrl: './not-found-page.component.html',
|
|
9
|
-
styleUrl: './not-found-page.component.scss'
|
|
10
|
-
})
|
|
11
|
-
export class NotFoundPageComponent {
|
|
12
|
-
navigationBack() {
|
|
13
|
-
history.back();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Pipe, PipeTransform } from "@angular/core";
|
|
2
|
-
import { ControlSeverity, ControlSeverityType, GovControlSeverity } from "@verisoft/ui-core";
|
|
3
|
-
|
|
4
|
-
@Pipe({
|
|
5
|
-
name: 'govColor',
|
|
6
|
-
standalone: true,
|
|
7
|
-
})
|
|
8
|
-
export class GovColorPipe implements PipeTransform {
|
|
9
|
-
transform(color: ControlSeverityType | undefined): string | undefined {
|
|
10
|
-
switch (color) {
|
|
11
|
-
case ControlSeverity.danger:
|
|
12
|
-
return GovControlSeverity.error;
|
|
13
|
-
|
|
14
|
-
case ControlSeverity.info:
|
|
15
|
-
return GovControlSeverity.neutral;
|
|
16
|
-
|
|
17
|
-
case ControlSeverity.help:
|
|
18
|
-
case ControlSeverity.contrast:
|
|
19
|
-
return GovControlSeverity.primary;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return color;
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/lib/pipes/index.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
-
import { GovFormMultiSelectItem } from '@gov-design-system-ce/components';
|
|
3
|
-
|
|
4
|
-
@Pipe({
|
|
5
|
-
name: 'govMultiselectOptions',
|
|
6
|
-
standalone: true,
|
|
7
|
-
})
|
|
8
|
-
export class GovMultiselectOptionsPipe implements PipeTransform {
|
|
9
|
-
transform(
|
|
10
|
-
options: any[] | undefined,
|
|
11
|
-
optionLabel?: string,
|
|
12
|
-
optionValue?: string,
|
|
13
|
-
addEmptyOption = false,
|
|
14
|
-
): GovFormMultiSelectItem[] {
|
|
15
|
-
if (!options?.length) return [];
|
|
16
|
-
|
|
17
|
-
return this.convertToGovOption(options, addEmptyOption, optionLabel, optionValue);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private convertToGovOption(
|
|
21
|
-
options: any[],
|
|
22
|
-
addEmptyOption: boolean,
|
|
23
|
-
optionLabel?: string,
|
|
24
|
-
optionValue?: string
|
|
25
|
-
): GovFormMultiSelectItem[] {
|
|
26
|
-
const convertedOptions: GovFormMultiSelectItem[] = [];
|
|
27
|
-
options.forEach((obj) => {
|
|
28
|
-
let stringKey = '';
|
|
29
|
-
let numberKey = '';
|
|
30
|
-
|
|
31
|
-
if (optionLabel && optionValue) {
|
|
32
|
-
stringKey = optionLabel;
|
|
33
|
-
numberKey = optionValue;
|
|
34
|
-
} else {
|
|
35
|
-
const keys = Object.keys(obj);
|
|
36
|
-
|
|
37
|
-
keys.forEach((key) => {
|
|
38
|
-
if (typeof obj[key] === 'string') {
|
|
39
|
-
stringKey = key;
|
|
40
|
-
} else if (typeof obj[key] === 'number') {
|
|
41
|
-
numberKey = key;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
convertedOptions.push({
|
|
47
|
-
label: obj[stringKey] as string,
|
|
48
|
-
value: (obj[numberKey] as string)?.toString() ?? 'VALUE NOT SET',
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (addEmptyOption) {
|
|
53
|
-
convertedOptions.unshift({
|
|
54
|
-
label: '',
|
|
55
|
-
value: 'null',
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return convertedOptions;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Pipe, PipeTransform } from "@angular/core";
|
|
2
|
-
import { FieldSize, FieldSizeType } from "@verisoft/ui-core";
|
|
3
|
-
|
|
4
|
-
@Pipe({
|
|
5
|
-
name: 'govSize',
|
|
6
|
-
standalone: true,
|
|
7
|
-
})
|
|
8
|
-
export class GovSizePipe implements PipeTransform {
|
|
9
|
-
transform(size: FieldSizeType | undefined): string | undefined {
|
|
10
|
-
switch (size) {
|
|
11
|
-
case FieldSize.small:
|
|
12
|
-
return 's';
|
|
13
|
-
case FieldSize.medium:
|
|
14
|
-
case undefined:
|
|
15
|
-
return 'm';
|
|
16
|
-
case FieldSize.large:
|
|
17
|
-
return 'l';
|
|
18
|
-
case FieldSize.xl:
|
|
19
|
-
return 'xl';
|
|
20
|
-
default:
|
|
21
|
-
return size;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/test-setup.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
2
|
-
globalThis.ngJest = {
|
|
3
|
-
testEnvironmentOptions: {
|
|
4
|
-
errorOnUnknownElements: true,
|
|
5
|
-
errorOnUnknownProperties: true,
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
import 'jest-preset-angular/setup-jest';
|
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2022",
|
|
4
|
-
"forceConsistentCasingInFileNames": true,
|
|
5
|
-
"strict": true,
|
|
6
|
-
"noImplicitOverride": true,
|
|
7
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
8
|
-
"noImplicitReturns": true,
|
|
9
|
-
"noFallthroughCasesInSwitch": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
},
|
|
13
|
-
"files": [],
|
|
14
|
-
"include": [],
|
|
15
|
-
"references": [
|
|
16
|
-
{
|
|
17
|
-
"path": "./tsconfig.lib.json"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"path": "./tsconfig.spec.json"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"extends": "../../../tsconfig.base.json",
|
|
24
|
-
"angularCompilerOptions": {
|
|
25
|
-
"enableI18nLegacyMessageIdFormat": false,
|
|
26
|
-
"strictInjectionParameters": true,
|
|
27
|
-
"strictInputAccessModifiers": true,
|
|
28
|
-
"strictTemplates": true
|
|
29
|
-
}
|
|
30
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../../dist/out-tsc",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"declarationMap": true,
|
|
7
|
-
"inlineSources": true,
|
|
8
|
-
"types": []
|
|
9
|
-
},
|
|
10
|
-
"exclude": [
|
|
11
|
-
"src/**/*.spec.ts",
|
|
12
|
-
"src/test-setup.ts",
|
|
13
|
-
"jest.config.ts",
|
|
14
|
-
"src/**/*.test.ts"
|
|
15
|
-
],
|
|
16
|
-
"include": ["src/**/*.ts"]
|
|
17
|
-
}
|