@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.
Files changed (223) hide show
  1. package/fesm2022/verisoft-ui-govcz.mjs +3770 -0
  2. package/fesm2022/verisoft-ui-govcz.mjs.map +1 -0
  3. package/index.d.ts +1013 -0
  4. package/package.json +19 -7
  5. package/styles/dist/main.css +13 -0
  6. package/styles/dist/main.css.map +1 -0
  7. package/.eslintrc.json +0 -60
  8. package/jest.config.ts +0 -21
  9. package/ng-package.json +0 -28
  10. package/project.json +0 -49
  11. package/src/config.d.ts +0 -10
  12. package/src/index.ts +0 -1
  13. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -25
  14. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -0
  15. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
  16. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -28
  17. package/src/lib/components/breadcrumb/index.ts +0 -1
  18. package/src/lib/components/button/button.component.html +0 -28
  19. package/src/lib/components/button/button.component.scss +0 -21
  20. package/src/lib/components/button/button.component.ts +0 -77
  21. package/src/lib/components/button/index.ts +0 -1
  22. package/src/lib/components/calendar/calendar.component.html +0 -28
  23. package/src/lib/components/calendar/calendar.component.scss +0 -0
  24. package/src/lib/components/calendar/calendar.component.ts +0 -77
  25. package/src/lib/components/calendar/index.ts +0 -1
  26. package/src/lib/components/checkbox/checkbox.component.html +0 -23
  27. package/src/lib/components/checkbox/checkbox.component.scss +0 -0
  28. package/src/lib/components/checkbox/checkbox.component.ts +0 -61
  29. package/src/lib/components/checkbox/index.ts +0 -1
  30. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -50
  31. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -4
  32. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -79
  33. package/src/lib/components/confirm-dialog/index.ts +0 -1
  34. package/src/lib/components/dropdown/dropdown-item.component.html +0 -8
  35. package/src/lib/components/dropdown/dropdown-item.component.ts +0 -18
  36. package/src/lib/components/dropdown/dropdown.component.html +0 -91
  37. package/src/lib/components/dropdown/dropdown.component.scss +0 -108
  38. package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
  39. package/src/lib/components/dropdown/dropdown.component.ts +0 -296
  40. package/src/lib/components/dropdown/dropdown.model.ts +0 -6
  41. package/src/lib/components/dropdown/index.ts +0 -1
  42. package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -31
  43. package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -34
  44. package/src/lib/components/dropdown-button/index.ts +0 -1
  45. package/src/lib/components/errors/error.component.html +0 -11
  46. package/src/lib/components/errors/error.component.scss +0 -0
  47. package/src/lib/components/errors/error.component.spec.ts +0 -19
  48. package/src/lib/components/errors/error.component.ts +0 -29
  49. package/src/lib/components/errors/index.ts +0 -1
  50. package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +0 -32
  51. package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +0 -8
  52. package/src/lib/components/feature-list/feature-list-filter.pipe.ts +0 -20
  53. package/src/lib/components/feature-list/feature-list-page.component.ts +0 -30
  54. package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
  55. package/src/lib/components/feature-list/feature-list.component.html +0 -67
  56. package/src/lib/components/feature-list/feature-list.component.scss +0 -10
  57. package/src/lib/components/feature-list/feature-list.component.ts +0 -360
  58. package/src/lib/components/feature-list/index.ts +0 -5
  59. package/src/lib/components/filter/directives/filter-field.directive.ts +0 -35
  60. package/src/lib/components/filter/filter.component.html +0 -78
  61. package/src/lib/components/filter/filter.component.scss +0 -32
  62. package/src/lib/components/filter/filter.component.spec.ts +0 -21
  63. package/src/lib/components/filter/filter.component.stories.ts +0 -23
  64. package/src/lib/components/filter/filter.component.ts +0 -286
  65. package/src/lib/components/filter/filter.model.ts +0 -18
  66. package/src/lib/components/filter/index.ts +0 -2
  67. package/src/lib/components/form-field/form-field.component.html +0 -14
  68. package/src/lib/components/form-field/form-field.component.scss +0 -0
  69. package/src/lib/components/form-field/form-field.component.spec.ts +0 -21
  70. package/src/lib/components/form-field/form-field.component.ts +0 -76
  71. package/src/lib/components/form-field/index.ts +0 -1
  72. package/src/lib/components/header/header.component.html +0 -122
  73. package/src/lib/components/header/header.component.scss +0 -0
  74. package/src/lib/components/header/header.component.ts +0 -90
  75. package/src/lib/components/header/index.ts +0 -1
  76. package/src/lib/components/icon/icon.component.html +0 -11
  77. package/src/lib/components/icon/icon.component.scss +0 -20
  78. package/src/lib/components/icon/icon.component.ts +0 -110
  79. package/src/lib/components/icon/index.ts +0 -2
  80. package/src/lib/components/index.ts +0 -37
  81. package/src/lib/components/input-group/index.ts +0 -1
  82. package/src/lib/components/input-group/input-group.component.html +0 -41
  83. package/src/lib/components/input-group/input-group.component.scss +0 -0
  84. package/src/lib/components/input-group/input-group.component.ts +0 -75
  85. package/src/lib/components/loader/index.ts +0 -1
  86. package/src/lib/components/loader/loader.component.html +0 -7
  87. package/src/lib/components/loader/loader.component.scss +0 -0
  88. package/src/lib/components/loader/loader.component.spec.ts +0 -21
  89. package/src/lib/components/loader/loader.component.ts +0 -33
  90. package/src/lib/components/multiselect/index.ts +0 -1
  91. package/src/lib/components/multiselect/multiselect.component.html +0 -21
  92. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  93. package/src/lib/components/multiselect/multiselect.component.spec.ts +0 -21
  94. package/src/lib/components/multiselect/multiselect.component.ts +0 -117
  95. package/src/lib/components/number-input/index.ts +0 -1
  96. package/src/lib/components/number-input/number-input.component.html +0 -48
  97. package/src/lib/components/number-input/number-input.component.scss +0 -0
  98. package/src/lib/components/number-input/number-input.component.ts +0 -80
  99. package/src/lib/components/page-header/index.ts +0 -1
  100. package/src/lib/components/page-header/page-header.component.html +0 -3
  101. package/src/lib/components/page-header/page-header.component.scss +0 -11
  102. package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
  103. package/src/lib/components/page-header/page-header.component.ts +0 -27
  104. package/src/lib/components/password/index.ts +0 -1
  105. package/src/lib/components/password/password.component.html +0 -31
  106. package/src/lib/components/password/password.component.scss +0 -0
  107. package/src/lib/components/password/password.component.spec.ts +0 -21
  108. package/src/lib/components/password/password.component.ts +0 -83
  109. package/src/lib/components/radiobutton/index.ts +0 -1
  110. package/src/lib/components/radiobutton/radiobutton.component.html +0 -23
  111. package/src/lib/components/radiobutton/radiobutton.component.scss +0 -0
  112. package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
  113. package/src/lib/components/search/index.ts +0 -1
  114. package/src/lib/components/search/search.component.html +0 -23
  115. package/src/lib/components/search/search.component.scss +0 -0
  116. package/src/lib/components/search/search.component.ts +0 -45
  117. package/src/lib/components/section/index.ts +0 -1
  118. package/src/lib/components/section/section.component.html +0 -26
  119. package/src/lib/components/section/section.component.scss +0 -0
  120. package/src/lib/components/section/section.component.ts +0 -55
  121. package/src/lib/components/side-menu/index.ts +0 -2
  122. package/src/lib/components/side-menu/side-menu.component.html +0 -22
  123. package/src/lib/components/side-menu/side-menu.component.scss +0 -17
  124. package/src/lib/components/side-menu/side-menu.component.ts +0 -42
  125. package/src/lib/components/side-menu/side-menu.module.ts +0 -56
  126. package/src/lib/components/snackbar/index.ts +0 -2
  127. package/src/lib/components/snackbar/services/snackbar.service.ts +0 -73
  128. package/src/lib/components/snackbar/snackbar.component.html +0 -14
  129. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  130. package/src/lib/components/snackbar/snackbar.component.spec.ts +0 -21
  131. package/src/lib/components/snackbar/snackbar.component.ts +0 -44
  132. package/src/lib/components/snackbar/snackbar.model.ts +0 -10
  133. package/src/lib/components/stepper/index.ts +0 -1
  134. package/src/lib/components/stepper/stepper.component.html +0 -35
  135. package/src/lib/components/stepper/stepper.component.scss +0 -9
  136. package/src/lib/components/stepper/stepper.component.ts +0 -60
  137. package/src/lib/components/switch/index.ts +0 -1
  138. package/src/lib/components/switch/switch.component.html +0 -16
  139. package/src/lib/components/switch/switch.component.scss +0 -0
  140. package/src/lib/components/switch/switch.component.ts +0 -39
  141. package/src/lib/components/tab-view/index.ts +0 -2
  142. package/src/lib/components/tab-view/tab-view-item.component.ts +0 -23
  143. package/src/lib/components/tab-view/tab-view.component.html +0 -51
  144. package/src/lib/components/tab-view/tab-view.component.scss +0 -43
  145. package/src/lib/components/tab-view/tab-view.component.ts +0 -64
  146. package/src/lib/components/tab-view/tab-view.module.ts +0 -25
  147. package/src/lib/components/table/index.ts +0 -1
  148. package/src/lib/components/table/table-pagination-info.component.html +0 -9
  149. package/src/lib/components/table/table-pagination-info.component.ts +0 -22
  150. package/src/lib/components/table/table.component.html +0 -199
  151. package/src/lib/components/table/table.component.scss +0 -192
  152. package/src/lib/components/table/table.component.ts +0 -390
  153. package/src/lib/components/table/table.model.ts +0 -17
  154. package/src/lib/components/table/table.models.ts +0 -12
  155. package/src/lib/components/tag/index.ts +0 -3
  156. package/src/lib/components/tag/tag.component.html +0 -12
  157. package/src/lib/components/tag/tag.component.scss +0 -4
  158. package/src/lib/components/tag/tag.component.ts +0 -44
  159. package/src/lib/components/tag/tag.model.ts +0 -7
  160. package/src/lib/components/textarea/index.ts +0 -1
  161. package/src/lib/components/textarea/textarea.component.html +0 -50
  162. package/src/lib/components/textarea/textarea.component.scss +0 -0
  163. package/src/lib/components/textarea/textarea.component.ts +0 -77
  164. package/src/lib/components/textfield/index.ts +0 -1
  165. package/src/lib/components/textfield/textfield.component.html +0 -34
  166. package/src/lib/components/textfield/textfield.component.scss +0 -0
  167. package/src/lib/components/textfield/textfield.component.ts +0 -112
  168. package/src/lib/components/tooltip/index.ts +0 -1
  169. package/src/lib/components/tooltip/tooltip.component.html +0 -9
  170. package/src/lib/components/tooltip/tooltip.component.ts +0 -19
  171. package/src/lib/icons.ts +0 -36
  172. package/src/lib/index.ts +0 -5
  173. package/src/lib/init.service.ts +0 -11
  174. package/src/lib/interceptors/http-error-message.interceptor.ts +0 -45
  175. package/src/lib/pages/bad-request-page/bad-request-page.component.html +0 -5
  176. package/src/lib/pages/bad-request-page/bad-request-page.component.scss +0 -0
  177. package/src/lib/pages/bad-request-page/bad-request-page.component.ts +0 -14
  178. package/src/lib/pages/error-page/error-page.component.html +0 -5
  179. package/src/lib/pages/error-page/error-page.component.scss +0 -0
  180. package/src/lib/pages/error-page/error-page.component.ts +0 -31
  181. package/src/lib/pages/error-page/error-page.constants.ts +0 -19
  182. package/src/lib/pages/index.ts +0 -3
  183. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.html +0 -5
  184. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.scss +0 -0
  185. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.ts +0 -15
  186. package/src/lib/pages/not-authenticated/index.ts +0 -1
  187. package/src/lib/pages/not-authenticated/not-authenticated.component.html +0 -5
  188. package/src/lib/pages/not-authenticated/not-authenticated.component.ts +0 -13
  189. package/src/lib/pages/not-authorized/index.ts +0 -1
  190. package/src/lib/pages/not-authorized/not-authorized.component.html +0 -5
  191. package/src/lib/pages/not-authorized/not-authorized.component.ts +0 -17
  192. package/src/lib/pages/not-found/index.ts +0 -1
  193. package/src/lib/pages/not-found/not-found.component.html +0 -5
  194. package/src/lib/pages/not-found/not-found.component.ts +0 -17
  195. package/src/lib/pages/not-found-page/not-found-page.component.html +0 -6
  196. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  197. package/src/lib/pages/not-found-page/not-found-page.component.ts +0 -15
  198. package/src/lib/pipes/color/color.pipe.ts +0 -24
  199. package/src/lib/pipes/index.ts +0 -3
  200. package/src/lib/pipes/multiselect/multiselect-options.pipe.ts +0 -61
  201. package/src/lib/pipes/size/size.pipe.ts +0 -24
  202. package/src/test-setup.ts +0 -8
  203. package/tsconfig.json +0 -30
  204. package/tsconfig.lib.json +0 -17
  205. package/tsconfig.lib.prod.json +0 -9
  206. package/tsconfig.spec.json +0 -16
  207. /package/{src → styles}/sass/foundations/_colors.scss +0 -0
  208. /package/{src → styles}/sass/foundations/index.scss +0 -0
  209. /package/{src → styles}/sass/header.css +0 -0
  210. /package/{src → styles}/sass/header.scss +0 -0
  211. /package/{src → styles}/sass/integrations/_bootstrap.scss +0 -0
  212. /package/{src → styles}/sass/integrations/index.scss +0 -0
  213. /package/{src → styles}/sass/main.scss +0 -0
  214. /package/{src → styles}/sass/overrides/_gov.scss +0 -0
  215. /package/{src → styles}/sass/overrides/index.scss +0 -0
  216. /package/{src → styles}/sass/scrollbar.scss +0 -0
  217. /package/{src → styles}/sass/tokens/_theme-dark.scss +0 -0
  218. /package/{src → styles}/sass/tokens/_theme-light.scss +0 -0
  219. /package/{src → styles}/sass/tokens/index.scss +0 -0
  220. /package/{src → styles}/sass/utils/_table_filter.scss +0 -0
  221. /package/{src → styles}/sass/utils/_utils.scss +0 -0
  222. /package/{src → styles}/sass/utils/index.scss +0 -0
  223. /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,9 +0,0 @@
1
- <gov-tooltip
2
- class="ms-2"
3
- [color]="color"
4
- [size]="size() | govSize"
5
- [position]="position()"
6
- [message]="tooltipText()"
7
- >
8
- <ng-content></ng-content>
9
- </gov-tooltip>
@@ -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
@@ -1,5 +0,0 @@
1
- export * from './components';
2
- export * from './pipes';
3
- export * from './init.service';
4
- export * from './pages';
5
- export * from './icons';
@@ -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>
@@ -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
- }
@@ -1,5 +0,0 @@
1
- <gov-error-code>
2
- <gov-icon type="complex" [name]="errorDetails.iconName" slot="icon"></gov-icon>
3
- <p>{{errorDetails.message}}</p>
4
- <gov-button color="primary" size="m" type="solid" (gov-click)="navigateToUrl()">Go back</gov-button>
5
- </gov-error-code>
@@ -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
- };
@@ -1,3 +0,0 @@
1
- export * from './not-authenticated';
2
- export * from './not-authorized';
3
- export * from './not-found';
@@ -1,5 +0,0 @@
1
- <gov-error-code>
2
- <gov-icon type="complex" name="card-500" slot="icon"></gov-icon>
3
- <p>Sorry, an unexpected condition was encountered</p>
4
- <gov-button color="primary" size="m" type="solid" (gov-click)="navigationBack()">Go back</gov-button>
5
- </gov-error-code>
@@ -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,5 +0,0 @@
1
- <gov-error-code>
2
- <gov-icon type="complex" name="card-401" slot="icon"></gov-icon>
3
- <p>You are not logged in, please do so.</p>
4
- <v-button color="primary" size="medium" type="solid" label="Login" [routerLink]="['/login']" />
5
- </gov-error-code>
@@ -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,5 +0,0 @@
1
- <gov-error-code>
2
- <gov-icon type="complex" name="card-403" slot="icon"></gov-icon>
3
- <p>You are not authorized to view this content.</p>
4
- <v-button color="primary" size="medium" type="solid" label="Go back" (click)="goBack()" />
5
- </gov-error-code>
@@ -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,5 +0,0 @@
1
- <gov-error-code>
2
- <gov-icon type="complex" name="card-404" slot="icon"></gov-icon>
3
- <p>The item you are looking for does not exist.</p>
4
- <v-button color="primary" size="medium" type="solid" label="Go back" (click)="goBack()" />
5
- </gov-error-code>
@@ -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>
@@ -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
- }
@@ -1,3 +0,0 @@
1
- export * from './color/color.pipe';
2
- export * from './multiselect/multiselect-options.pipe';
3
- export * from './size/size.pipe';
@@ -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
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {
7
- "compilationMode": "partial"
8
- }
9
- }