@verisoft/ui-govcz 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/.eslintrc.json +48 -0
  2. package/README.md +7 -0
  3. package/jest.config.ts +21 -0
  4. package/ng-package.json +10 -0
  5. package/package.json +14 -0
  6. package/project.json +36 -0
  7. package/src/assets/icons/colored/cactus.svg +8 -0
  8. package/src/assets/icons/colored/card-503.svg +12 -0
  9. package/src/assets/icons/colored/card-504.svg +15 -0
  10. package/src/assets/icons/colored/city-office.svg +11 -0
  11. package/src/assets/icons/colored/doc-search.svg +9 -0
  12. package/src/assets/icons/colored/empty-file.svg +13 -0
  13. package/src/assets/icons/colored/error.svg +12 -0
  14. package/src/assets/icons/colored/globe.svg +9 -0
  15. package/src/assets/icons/colored/hand-503.svg +10 -0
  16. package/src/assets/icons/colored/hand-504.svg +7 -0
  17. package/src/assets/icons/colored/packet.svg +5 -0
  18. package/src/assets/icons/colored/port-card.svg +8 -0
  19. package/src/assets/icons/complex/24-7.svg +12 -0
  20. package/src/assets/icons/complex/all.svg +3 -0
  21. package/src/assets/icons/complex/arrival.svg +12 -0
  22. package/src/assets/icons/complex/bell.svg +4 -0
  23. package/src/assets/icons/complex/big-help.svg +12 -0
  24. package/src/assets/icons/complex/business-file.svg +14 -0
  25. package/src/assets/icons/complex/businessman.svg +3 -0
  26. package/src/assets/icons/complex/cactus.svg +14 -0
  27. package/src/assets/icons/complex/camera.svg +5 -0
  28. package/src/assets/icons/complex/car.svg +5 -0
  29. package/src/assets/icons/complex/certification.svg +14 -0
  30. package/src/assets/icons/complex/chamber-deputies-cr.svg +11 -0
  31. package/src/assets/icons/complex/chamber-deputies.svg +13 -0
  32. package/src/assets/icons/complex/chat.svg +11 -0
  33. package/src/assets/icons/complex/cities.svg +17 -0
  34. package/src/assets/icons/complex/city-office.svg +17 -0
  35. package/src/assets/icons/complex/coins.svg +14 -0
  36. package/src/assets/icons/complex/communication.svg +4 -0
  37. package/src/assets/icons/complex/confusion.svg +8 -0
  38. package/src/assets/icons/complex/contact.svg +6 -0
  39. package/src/assets/icons/complex/court.svg +5 -0
  40. package/src/assets/icons/complex/covid.svg +5 -0
  41. package/src/assets/icons/complex/czech-lion.svg +134 -0
  42. package/src/assets/icons/complex/digital.svg +10 -0
  43. package/src/assets/icons/complex/disability.svg +5 -0
  44. package/src/assets/icons/complex/doc-agreement.svg +7 -0
  45. package/src/assets/icons/complex/doc-basic-info.svg +18 -0
  46. package/src/assets/icons/complex/doc-business.svg +8 -0
  47. package/src/assets/icons/complex/doc-car-point-list.svg +16 -0
  48. package/src/assets/icons/complex/doc-diploma.svg +17 -0
  49. package/src/assets/icons/complex/doc-driver-info.svg +8 -0
  50. package/src/assets/icons/complex/doc-election.svg +13 -0
  51. package/src/assets/icons/complex/doc-filled.svg +16 -0
  52. package/src/assets/icons/complex/doc-health.svg +3 -0
  53. package/src/assets/icons/complex/doc-judgment.svg +8 -0
  54. package/src/assets/icons/complex/doc-patient.svg +8 -0
  55. package/src/assets/icons/complex/doc-personal-info.svg +11 -0
  56. package/src/assets/icons/complex/doc-petition.svg +8 -0
  57. package/src/assets/icons/complex/doc-registers.svg +7 -0
  58. package/src/assets/icons/complex/doc-review.svg +20 -0
  59. package/src/assets/icons/complex/doc-search.svg +8 -0
  60. package/src/assets/icons/complex/doc-stamp.svg +15 -0
  61. package/src/assets/icons/complex/doc-state.svg +13 -0
  62. package/src/assets/icons/complex/doc-taxes.svg +16 -0
  63. package/src/assets/icons/complex/doc-universal.svg +13 -0
  64. package/src/assets/icons/complex/doc-visa.svg +14 -0
  65. package/src/assets/icons/complex/documents.svg +11 -0
  66. package/src/assets/icons/complex/driver-file.svg +14 -0
  67. package/src/assets/icons/complex/driver.svg +7 -0
  68. package/src/assets/icons/complex/driving-licence.svg +7 -0
  69. package/src/assets/icons/complex/email-notification.svg +12 -0
  70. package/src/assets/icons/complex/energy.svg +11 -0
  71. package/src/assets/icons/complex/envelope.svg +3 -0
  72. package/src/assets/icons/complex/european-parliament.svg +11 -0
  73. package/src/assets/icons/complex/family.svg +12 -0
  74. package/src/assets/icons/complex/globe.svg +12 -0
  75. package/src/assets/icons/complex/graduate.svg +4 -0
  76. package/src/assets/icons/complex/hand.svg +14 -0
  77. package/src/assets/icons/complex/health.svg +5 -0
  78. package/src/assets/icons/complex/help.svg +4 -0
  79. package/src/assets/icons/complex/history.svg +4 -0
  80. package/src/assets/icons/complex/holiday.svg +13 -0
  81. package/src/assets/icons/complex/hourglass.svg +4 -0
  82. package/src/assets/icons/complex/house.svg +13 -0
  83. package/src/assets/icons/complex/id-card.svg +6 -0
  84. package/src/assets/icons/complex/id-info.svg +9 -0
  85. package/src/assets/icons/complex/id.svg +6 -0
  86. package/src/assets/icons/complex/illness.svg +9 -0
  87. package/src/assets/icons/complex/info-list.svg +14 -0
  88. package/src/assets/icons/complex/info.svg +3 -0
  89. package/src/assets/icons/complex/institute-file.svg +23 -0
  90. package/src/assets/icons/complex/institution.svg +10 -0
  91. package/src/assets/icons/complex/job-loss.svg +4 -0
  92. package/src/assets/icons/complex/job.svg +3 -0
  93. package/src/assets/icons/complex/map.svg +11 -0
  94. package/src/assets/icons/complex/mobile-phone.svg +13 -0
  95. package/src/assets/icons/complex/mouse.svg +3 -0
  96. package/src/assets/icons/complex/my-filing.svg +15 -0
  97. package/src/assets/icons/complex/my-state-data.svg +19 -0
  98. package/src/assets/icons/complex/new-comments.svg +6 -0
  99. package/src/assets/icons/complex/newborn.svg +16 -0
  100. package/src/assets/icons/complex/news.svg +20 -0
  101. package/src/assets/icons/complex/packet.svg +11 -0
  102. package/src/assets/icons/complex/passport.svg +7 -0
  103. package/src/assets/icons/complex/personal-file.svg +14 -0
  104. package/src/assets/icons/complex/pet.svg +10 -0
  105. package/src/assets/icons/complex/petrol-station.svg +14 -0
  106. package/src/assets/icons/complex/pills.svg +4 -0
  107. package/src/assets/icons/complex/population-register.svg +12 -0
  108. package/src/assets/icons/complex/portal.svg +8 -0
  109. package/src/assets/icons/complex/pregnant.svg +11 -0
  110. package/src/assets/icons/complex/president.svg +13 -0
  111. package/src/assets/icons/complex/presidential-election.svg +12 -0
  112. package/src/assets/icons/complex/profile-settings.svg +13 -0
  113. package/src/assets/icons/complex/property.svg +4 -0
  114. package/src/assets/icons/complex/queue.svg +13 -0
  115. package/src/assets/icons/complex/quotes.svg +6 -0
  116. package/src/assets/icons/complex/region.svg +11 -0
  117. package/src/assets/icons/complex/regional-elections-clear.svg +11 -0
  118. package/src/assets/icons/complex/regional-elections.svg +12 -0
  119. package/src/assets/icons/complex/register-of-persons.svg +7 -0
  120. package/src/assets/icons/complex/retiree.svg +8 -0
  121. package/src/assets/icons/complex/rings.svg +5 -0
  122. package/src/assets/icons/complex/senate.svg +11 -0
  123. package/src/assets/icons/complex/senior.svg +4 -0
  124. package/src/assets/icons/complex/settings.svg +13 -0
  125. package/src/assets/icons/complex/simple-envelope.svg +3 -0
  126. package/src/assets/icons/complex/sms-notification.svg +7 -0
  127. package/src/assets/icons/complex/sos.svg +6 -0
  128. package/src/assets/icons/complex/state-file.svg +8 -0
  129. package/src/assets/icons/complex/time.svg +4 -0
  130. package/src/assets/icons/complex/tombstone.svg +7 -0
  131. package/src/assets/icons/complex/user-login.svg +13 -0
  132. package/src/assets/icons/complex/vaccine.svg +11 -0
  133. package/src/assets/icons/components/book.svg +10 -0
  134. package/src/assets/icons/components/bookmarks.svg +11 -0
  135. package/src/assets/icons/components/box-arrow-up-right.svg +11 -0
  136. package/src/assets/icons/components/caret-right-fill.svg +3 -0
  137. package/src/assets/icons/components/check-lg.svg +3 -0
  138. package/src/assets/icons/components/chevron-double-left.svg +4 -0
  139. package/src/assets/icons/components/chevron-double-right.svg +4 -0
  140. package/src/assets/icons/components/chevron-down.svg +3 -0
  141. package/src/assets/icons/components/chevron-left.svg +3 -0
  142. package/src/assets/icons/components/chevron-right.svg +3 -0
  143. package/src/assets/icons/components/chevron-up.svg +3 -0
  144. package/src/assets/icons/components/copy.svg +10 -0
  145. package/src/assets/icons/components/dash-lg.svg +3 -0
  146. package/src/assets/icons/components/envelope-fill.svg +3 -0
  147. package/src/assets/icons/components/exclamation-lg.svg +3 -0
  148. package/src/assets/icons/components/exclamation-triangle-fill.svg +10 -0
  149. package/src/assets/icons/components/eye.svg +4 -0
  150. package/src/assets/icons/components/gear.svg +11 -0
  151. package/src/assets/icons/components/geo-alt-fill.svg +10 -0
  152. package/src/assets/icons/components/house-door-fill.svg +3 -0
  153. package/src/assets/icons/components/info-circle-fill.svg +10 -0
  154. package/src/assets/icons/components/info-circle.svg +11 -0
  155. package/src/assets/icons/components/info.svg +3 -0
  156. package/src/assets/icons/components/lightbulb-fill.svg +10 -0
  157. package/src/assets/icons/components/list.svg +3 -0
  158. package/src/assets/icons/components/loader.svg +3 -0
  159. package/src/assets/icons/components/moon.svg +10 -0
  160. package/src/assets/icons/components/search.svg +10 -0
  161. package/src/assets/icons/components/star-fill.svg +10 -0
  162. package/src/assets/icons/components/sun.svg +10 -0
  163. package/src/assets/icons/components/telephone.svg +10 -0
  164. package/src/assets/icons/components/twitter-x.svg +10 -0
  165. package/src/assets/icons/components/upload.svg +4 -0
  166. package/src/assets/icons/components/x-lg.svg +3 -0
  167. package/src/assets/icons/components/x.svg +3 -0
  168. package/src/assets/logos/gacr_logo_en.svg +1 -0
  169. package/src/gov-config.d.ts +10 -0
  170. package/src/index.ts +1 -0
  171. package/src/lib/components/gov-breadcrumb/gov-breadcrumb.component.html +14 -0
  172. package/src/lib/components/gov-breadcrumb/gov-breadcrumb.component.scss +0 -0
  173. package/src/lib/components/gov-breadcrumb/gov-breadcrumb.component.spec.ts +21 -0
  174. package/src/lib/components/gov-breadcrumb/gov-breadcrumb.component.ts +22 -0
  175. package/src/lib/components/gov-breadcrumb/index.ts +1 -0
  176. package/src/lib/components/gov-button/gov-button.component.html +24 -0
  177. package/src/lib/components/gov-button/gov-button.component.scss +0 -0
  178. package/src/lib/components/gov-button/gov-button.component.ts +56 -0
  179. package/src/lib/components/gov-button/index.ts +1 -0
  180. package/src/lib/components/gov-checkbox/gov-checkbox.component.html +35 -0
  181. package/src/lib/components/gov-checkbox/gov-checkbox.component.scss +0 -0
  182. package/src/lib/components/gov-checkbox/gov-checkbox.component.ts +54 -0
  183. package/src/lib/components/gov-checkbox/index.ts +1 -0
  184. package/src/lib/components/gov-header/gov-header.component.html +73 -0
  185. package/src/lib/components/gov-header/gov-header.component.scss +20 -0
  186. package/src/lib/components/gov-header/gov-header.component.ts +51 -0
  187. package/src/lib/components/gov-header/index.ts +1 -0
  188. package/src/lib/components/gov-loader/gov-loader.component.html +7 -0
  189. package/src/lib/components/gov-loader/gov-loader.component.scss +0 -0
  190. package/src/lib/components/gov-loader/gov-loader.component.spec.ts +21 -0
  191. package/src/lib/components/gov-loader/gov-loader.component.ts +33 -0
  192. package/src/lib/components/gov-loader/index.ts +1 -0
  193. package/src/lib/components/gov-multiselect/gov-multiselect.component.html +31 -0
  194. package/src/lib/components/gov-multiselect/gov-multiselect.component.scss +0 -0
  195. package/src/lib/components/gov-multiselect/gov-multiselect.component.spec.ts +21 -0
  196. package/src/lib/components/gov-multiselect/gov-multiselect.component.ts +116 -0
  197. package/src/lib/components/gov-multiselect/index.ts +1 -0
  198. package/src/lib/components/gov-password/gov-password.component.html +21 -0
  199. package/src/lib/components/gov-password/gov-password.component.scss +0 -0
  200. package/src/lib/components/gov-password/gov-password.component.spec.ts +21 -0
  201. package/src/lib/components/gov-password/gov-password.component.ts +58 -0
  202. package/src/lib/components/gov-password/index.ts +1 -0
  203. package/src/lib/components/gov-radiobutton/gov-radiobutton.component.html +25 -0
  204. package/src/lib/components/gov-radiobutton/gov-radiobutton.component.scss +0 -0
  205. package/src/lib/components/gov-radiobutton/gov-radiobutton.component.ts +58 -0
  206. package/src/lib/components/gov-radiobutton/index.ts +1 -0
  207. package/src/lib/components/gov-switch/gov-switch.component.html +21 -0
  208. package/src/lib/components/gov-switch/gov-switch.component.scss +0 -0
  209. package/src/lib/components/gov-switch/gov-switch.component.ts +35 -0
  210. package/src/lib/components/gov-switch/index.ts +1 -0
  211. package/src/lib/components/gov-text-field/gov-text-field.component.html +58 -0
  212. package/src/lib/components/gov-text-field/gov-text-field.component.scss +0 -0
  213. package/src/lib/components/gov-text-field/gov-text-field.component.ts +70 -0
  214. package/src/lib/components/gov-text-field/index.ts +1 -0
  215. package/src/lib/components/index.ts +11 -0
  216. package/src/lib/index.ts +2 -0
  217. package/src/lib/init.service.ts +12 -0
  218. package/src/sass/gov-header.css +574 -0
  219. package/src/sass/main.scss +77 -0
  220. package/src/test-setup.ts +8 -0
  221. package/tsconfig.json +28 -0
  222. package/tsconfig.lib.json +17 -0
  223. package/tsconfig.lib.prod.json +9 -0
  224. package/tsconfig.spec.json +16 -0
@@ -0,0 +1,73 @@
1
+ <div class="g-header">
2
+ <header class="gov-container--no-y-offset gov-header">
3
+ <div class="gov-container__content">
4
+ <div class="gov-header__holder">
5
+ <div class="gov-header__left">
6
+ <a href="/" class="gov-link--inversed gov-header__logo" [attr.aria-label]="title"></a>
7
+ <a class="gov-logo gov-logo--inversed" href="/" [attr.aria-label]="title">
8
+ <div class="gov-pictogram--logo gov-pictogram--inversed">
9
+ @if (logoUrl) {
10
+ <img src="{{ logoUrl }}" height="100%" width="100%" alt="GACR logo">
11
+ }
12
+ </div>
13
+
14
+ <span *ngIf="title" class="gov-logo__sitename">
15
+ {{ title }}
16
+ </span>
17
+ </a>
18
+ </div>
19
+ <div class="gov-header__right">
20
+ <div class="gov-header__item gov-header__user-info">
21
+ <span class="gov-header__item-user-info">{{ userName }}</span>
22
+ <button class="gov-header__button">
23
+ <gov-icon type="complex" name="user-login" size="xl" />
24
+ </button>
25
+ </div>
26
+ <div class="gov-header__fixed-items">
27
+ <div class="gov-header__item gov-header__item--mobile">
28
+ <button
29
+ class="gov-header__hamburger"
30
+ [ngClass]="this.menuVisible ? 'active' : ''"
31
+ (click)="toggleMenu()"
32
+ >
33
+ <span></span>
34
+ <span></span>
35
+ <div>MENU</div>
36
+ </button>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
+ <hr class="gov-header__separator">
43
+
44
+ <div
45
+ class="gov-header__overlay"
46
+ [ngClass]="this.menuVisible ? 'active' : ''"
47
+ ></div>
48
+ <nav
49
+ class="gov-header__nav"
50
+ [ngClass]="this.menuVisible ? 'active' : ''"
51
+ >
52
+ <div
53
+ class="gov-header__nav-logo"
54
+ [ngClass]="this.menuVisible ? 'active' : ''"
55
+ ></div>
56
+
57
+ <div class="gov-header__nav-holder">
58
+ @for (item of tabsService.menuItems$ | async; track item) {
59
+ <div class="gov-header__link">
60
+ <a
61
+ href="{{ item.url }}"
62
+ class="gov-link gov-link--standalone gov-link--large gov-link--inversed"
63
+ [attr.aria-label]="item.label"
64
+ >
65
+ {{ item.label }}
66
+ </a>
67
+ </div>
68
+ }
69
+ </div>
70
+ </nav>
71
+ </div>
72
+ </header>
73
+ </div>
@@ -0,0 +1,20 @@
1
+ .gov-header__button {
2
+ color: var(--gov-color-white);
3
+
4
+ &:hover {
5
+ color: var(--gov-color-blue);
6
+ }
7
+ }
8
+
9
+ .gov-header__user-info {
10
+ text-align: right;
11
+ color: var(--gov-color-white);
12
+ }
13
+
14
+ .gov-header__link .gov-link {
15
+ color: var(--gov-color-white);
16
+ }
17
+
18
+ .gov-header__item-user-info {
19
+ margin-right: 1rem;
20
+ }
@@ -0,0 +1,51 @@
1
+ import { AsyncPipe, CommonModule } from "@angular/common";
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ inject,
6
+ Input
7
+ } from "@angular/core";
8
+ import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
9
+ import {
10
+ HEADER_COMPONENT_TOKEN,
11
+ HeaderCore,
12
+ MenuItem,
13
+ SideMenuService
14
+ } from "@verisoft/ui-core";
15
+
16
+ @Component({
17
+ selector: "v-header",
18
+ standalone: true,
19
+ styleUrls: [
20
+ "./gov-header.component.scss"
21
+ ],
22
+ templateUrl: './gov-header.component.html',
23
+ imports: [
24
+ CommonModule, GovDesignSystemModule, AsyncPipe
25
+ ],
26
+ changeDetection: ChangeDetectionStrategy.OnPush,
27
+ providers: [
28
+ {
29
+ provide: HEADER_COMPONENT_TOKEN,
30
+ useExisting: HeaderComponent
31
+ }
32
+ ],
33
+ })
34
+ export class HeaderComponent
35
+ implements HeaderCore
36
+ {
37
+ @Input() title!: string;
38
+ @Input() userName!: string;
39
+ @Input() logoUrl!: string;
40
+ @Input() userRole!: any;
41
+ @Input() menuRef!: HTMLDivElement;
42
+ @Input() items: MenuItem[] = [];
43
+
44
+ protected menuVisible = false;
45
+
46
+ tabsService = inject(SideMenuService);
47
+
48
+ toggleMenu() {
49
+ this.menuVisible = !this.menuVisible;
50
+ }
51
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-header.component'
@@ -0,0 +1,7 @@
1
+ <div style="min-height: 300px;">
2
+ <gov-loading
3
+ [size]="size | govSize"
4
+ >
5
+ {{ message }}
6
+ </gov-loading>
7
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { LoaderComponent } from './gov-loader.component';
3
+
4
+ describe('LoaderComponent', () => {
5
+ let component: LoaderComponent;
6
+ let fixture: ComponentFixture<LoaderComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [LoaderComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(LoaderComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,33 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
3
+ import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
4
+ import {
5
+ LOADER_COMPONENT_TOKEN,
6
+ LoaderCore,
7
+ FieldSize,
8
+ FieldSizeType,
9
+ GovSizePipe
10
+ } from '@verisoft/ui-core';
11
+
12
+ @Component({
13
+ selector: 'v-loader',
14
+ standalone: true,
15
+ imports: [
16
+ CommonModule, GovDesignSystemModule, GovSizePipe
17
+ ],
18
+ templateUrl: './gov-loader.component.html',
19
+ styleUrl: './gov-loader.component.scss',
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ providers: [
22
+ {
23
+ provide: LOADER_COMPONENT_TOKEN,
24
+ useExisting: LoaderComponent,
25
+ }
26
+ ],
27
+ })
28
+ export class LoaderComponent
29
+ implements LoaderCore
30
+ {
31
+ @Input() size: FieldSizeType = FieldSize.medium;
32
+ @Input() message!: string;
33
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-loader.component';
@@ -0,0 +1,31 @@
1
+ <div class="v-multiple-select">
2
+ <gov-form-control>
3
+ @if (ngControl && ngControl.errors) {
4
+ <gov-form-message
5
+ [slot]="errorSlot"
6
+ color="error"
7
+ >
8
+ {{ngControl.errors | error}}
9
+ <gov-icon
10
+ type="components"
11
+ name="exclamation-triangle-fill"
12
+ slot="icon"
13
+ />
14
+ </gov-form-message>
15
+ }
16
+ <gov-form-label
17
+ [slot]="label"
18
+ [size]="size | govSize"
19
+ >
20
+ {{ label }}
21
+ </gov-form-label>
22
+ <gov-form-multi-select
23
+ [size]="size | govSize"
24
+ [formControl]="formControl"
25
+ [required]="required"
26
+ [invalid]="ngControl && ngControl.errors"
27
+ [options]="options"
28
+ >
29
+ </gov-form-multi-select>
30
+ </gov-form-control>
31
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { MultiselectComponent } from './gov-multiselect.component';
3
+
4
+ describe('MultiselectComponent', () => {
5
+ let component: MultiselectComponent<any>;
6
+ let fixture: ComponentFixture<MultiselectComponent<any>>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [MultiselectComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(MultiselectComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,116 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ EventEmitter,
6
+ Input,
7
+ OnChanges,
8
+ Optional,
9
+ Output,
10
+ Self,
11
+ SimpleChanges,
12
+ inject,
13
+ ChangeDetectorRef
14
+ } from '@angular/core';
15
+ import {
16
+ ControlValueAccessor,
17
+ NgControl,
18
+ ReactiveFormsModule,
19
+ } from '@angular/forms';
20
+ import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
21
+ import {
22
+ FilterEvent,
23
+ LazyLoadEvent,
24
+ } from '@verisoft/core';
25
+ import {
26
+ BaseFormInputComponent,
27
+ ErrorPipe,
28
+ MULTISELECT_COMPONENT_TOKEN,
29
+ MultiselectCore,
30
+ GovSizePipe,
31
+ FieldSize,
32
+ FieldSizeType,
33
+ SlotPositionType,
34
+ SlotPosition
35
+ } from '@verisoft/ui-core';
36
+
37
+ @Component({
38
+ selector: 'v-multiselect',
39
+ standalone: true,
40
+ imports: [
41
+ CommonModule,
42
+ ReactiveFormsModule,
43
+ GovDesignSystemModule,
44
+ ErrorPipe,
45
+ GovSizePipe,
46
+ ],
47
+ templateUrl: './gov-multiselect.component.html',
48
+ styleUrl: './gov-multiselect.component.scss',
49
+ changeDetection: ChangeDetectionStrategy.OnPush,
50
+ providers: [
51
+ {
52
+ provide: MULTISELECT_COMPONENT_TOKEN,
53
+ useExisting: MultiselectComponent,
54
+ },
55
+ ],
56
+ })
57
+ export class MultiselectComponent<T>
58
+ extends BaseFormInputComponent
59
+ implements ControlValueAccessor, OnChanges, MultiselectCore<T>
60
+ {
61
+ constructor(@Optional() @Self() ngControl: NgControl) {
62
+ super(ngControl);
63
+ }
64
+
65
+ @Input() options: any[] = [];
66
+ @Input() optionLabel!: string;
67
+ @Input() optionValue!: string;
68
+ @Input() dropdownIcon: string | undefined;
69
+ @Input() floatLabel: string | undefined;
70
+ @Input() editable = true;
71
+ @Input() display!: 'flex' | 'block';
72
+ @Input() errorSlot: SlotPositionType = SlotPosition.top
73
+ @Input() lazy!: boolean;
74
+ @Input() filter!: boolean;
75
+ @Input() loading = false;
76
+ @Input() size: FieldSizeType = FieldSize.medium;
77
+
78
+ @Output() changed = new EventEmitter<any>();
79
+ @Output() showed = new EventEmitter<any>();
80
+ @Output() cleared = new EventEmitter<any>();
81
+ @Output() lazyLoad = new EventEmitter<LazyLoadEvent>();
82
+ @Output() filtered = new EventEmitter<FilterEvent>();
83
+ @Output() lazyLoadEvent = new EventEmitter<LazyLoadEvent>();
84
+
85
+ lazyLoadOptions: LazyLoadEvent = {
86
+ limit: 50,
87
+ offset: 0,
88
+ };
89
+
90
+ cdRef = inject(ChangeDetectorRef);
91
+
92
+ ngOnChanges(changes: SimpleChanges): void {
93
+ if (changes['options'] && !changes['options'].firstChange) {
94
+ this.cdRef.detectChanges();
95
+ }
96
+ }
97
+
98
+ onLazyLoad(event: any): void {
99
+ if (this.options.length - event.last <= 0) {
100
+ this.lazyLoadOptions.offset = event.last;
101
+ this.lazyLoadEvent.emit(this.lazyLoadOptions);
102
+ }
103
+ }
104
+
105
+ selectionChange(event: any): void {
106
+ this.cleared.emit(event);
107
+ }
108
+
109
+ onDropdownShow(): void {
110
+ this.showed.emit();
111
+ }
112
+
113
+ onDropdownClear(): void {
114
+ this.cleared.emit();
115
+ }
116
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-multiselect.component';
@@ -0,0 +1,21 @@
1
+ <gov-form-control>
2
+ @if (ngControl && ngControl.errors) {
3
+ <gov-form-message color="error">
4
+ {{ ngControl.errors | error }}
5
+ <gov-icon type="components" name="exclamation-triangle-fill" slot="icon" />
6
+ </gov-form-message>
7
+ }
8
+ <gov-form-label [slot]="labelSlot">
9
+ {{ label }}
10
+ </gov-form-label>
11
+ <gov-form-group>
12
+ <gov-form-password-power *ngIf="feedback" [power]="passwordStrength - 1" />
13
+ <gov-form-input
14
+ [formControl]="formControl"
15
+ [attr.input-type]="type"
16
+ [placeholder]="placeholder"
17
+ [invalid]="ngControl?.errors"
18
+ (ngModelChange)="valueChange($event)"
19
+ />
20
+ </gov-form-group>
21
+ </gov-form-control>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { PasswordComponent } from './gov-password.component';
3
+
4
+ describe('PasswordComponent', () => {
5
+ let component: PasswordComponent;
6
+ let fixture: ComponentFixture< PasswordComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [PasswordComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(PasswordComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,58 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component, Input, Optional, Self } from '@angular/core';
3
+ import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
4
+ import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
5
+ import {
6
+ BaseFormInputComponent,
7
+ FieldType,
8
+ PASSWORD_COMPONENT_TOKEN,
9
+ PasswordCore,
10
+ ErrorPipe
11
+ } from '@verisoft/ui-core';
12
+ import zxcvbn from 'zxcvbn';
13
+
14
+ @Component({
15
+ selector: 'v-password',
16
+ standalone: true,
17
+ imports: [
18
+ CommonModule,
19
+ ReactiveFormsModule,
20
+ GovDesignSystemModule,
21
+ ErrorPipe
22
+ ],
23
+ templateUrl: './gov-password.component.html',
24
+ styleUrl: './gov-password.component.scss',
25
+ changeDetection: ChangeDetectionStrategy.OnPush,
26
+ providers: [
27
+ {
28
+ provide: PASSWORD_COMPONENT_TOKEN,
29
+ useExisting: PasswordComponent
30
+ }
31
+ ],
32
+ })
33
+
34
+ export class PasswordComponent
35
+ extends BaseFormInputComponent
36
+ implements ControlValueAccessor, PasswordCore
37
+ {
38
+ @Input() toggleMask = true;
39
+ @Input() feedback = false;
40
+ @Input() labelSlot: 'top' | 'bottom' = 'top';
41
+
42
+ passwordStrength: 0 | 1 | 2 | 3 | 4 = 0;
43
+ type = FieldType.password;
44
+
45
+ constructor(@Optional() @Self() ngControl: NgControl) {
46
+ super(ngControl);
47
+ }
48
+
49
+ valueChange(value: string) {
50
+ if (!value) {
51
+ this.passwordStrength = 0;
52
+ return;
53
+ }
54
+
55
+ const result = zxcvbn(value);
56
+ this.passwordStrength = result.score;
57
+ }
58
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-password.component';
@@ -0,0 +1,25 @@
1
+ <h6>{{ label }}</h6>
2
+ <gov-form-control>
3
+ @if (ngControl?.errors) {
4
+ <gov-form-message [slot]="errorSlot" color="error">
5
+ {{ ngControl?.errors | error }}
6
+ <gov-icon type="components" name="exclamation-triangle-fill" slot="icon" />
7
+ </gov-form-message>
8
+ }
9
+ <gov-form-radio-group [formControl]="formControl">
10
+ @if (items) { @for(item of items; track item) {
11
+ <gov-form-radio
12
+ [size]="size"
13
+ [value]="item.value"
14
+ [required]="required"
15
+ [identifier]="item.id"
16
+ [name]="radioGroupName"
17
+ [invalid]="ngControl?.errors"
18
+ >
19
+ <gov-form-label [size]="size" slot="label">
20
+ {{ item.value }}
21
+ </gov-form-label>
22
+ </gov-form-radio>
23
+ } }
24
+ </gov-form-radio-group>
25
+ </gov-form-control>
@@ -0,0 +1,58 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ Input,
6
+ Optional,
7
+ Self,
8
+ } from '@angular/core';
9
+ import {
10
+ ControlValueAccessor,
11
+ NgControl,
12
+ ReactiveFormsModule,
13
+ } from '@angular/forms';
14
+ import { RouterModule } from '@angular/router';
15
+ import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
16
+ import {
17
+ BaseFormInputComponent,
18
+ ErrorPipe,
19
+ RADIOBUTTON_COMPONENT_TOKEN,
20
+ RadiobuttonCore,
21
+ RadioButtonItem,
22
+ } from '@verisoft/ui-core';
23
+
24
+ @Component({
25
+ selector: "v-radiobutton",
26
+ standalone: true,
27
+ styleUrls: [
28
+ "./gov-radiobutton.component.scss"
29
+ ],
30
+ templateUrl: './gov-radiobutton.component.html',
31
+ imports: [
32
+ CommonModule, GovDesignSystemModule, RouterModule, ReactiveFormsModule, ErrorPipe
33
+ ],
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ providers: [
36
+ {
37
+ provide: RADIOBUTTON_COMPONENT_TOKEN,
38
+ useExisting: RadioButtonComponent,
39
+ },
40
+ ],
41
+ })
42
+
43
+ export class RadioButtonComponent<T>
44
+ extends BaseFormInputComponent
45
+ implements ControlValueAccessor, RadiobuttonCore<T>
46
+ {
47
+ @Input() radioGroupName = Math.random().toString();
48
+
49
+ @Input() items: RadioButtonItem<T>[] = [];
50
+
51
+ @Input() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';
52
+
53
+ @Input() errorSlot: 'top' | 'bottom' = 'top';
54
+
55
+ constructor(@Optional() @Self() ngControl: NgControl) {
56
+ super(ngControl);
57
+ }
58
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-radiobutton.component';
@@ -0,0 +1,21 @@
1
+ <gov-form-control>
2
+ @if (ngControl && ngControl.errors) {
3
+ <gov-form-message *ngIf="ngControl?.errors" [slot]="errorSlot" color="error">
4
+ {{ ngControl.errors | error }}
5
+ <gov-icon type="components" name="exclamation-triangle-fill" slot="icon" />
6
+ </gov-form-message>
7
+ }
8
+ <gov-form-switch
9
+ [formControl]="formControl"
10
+ [size]="size"
11
+ [required]="required"
12
+ [name]="name"
13
+ [invalid]="ngControl?.errors"
14
+ >
15
+ @if (label && !noLabel) {
16
+ <gov-form-label [size]="size" slot="label">
17
+ {{ label }}
18
+ </gov-form-label>
19
+ }
20
+ </gov-form-switch>
21
+ </gov-form-control>
@@ -0,0 +1,35 @@
1
+ import { CommonModule } from "@angular/common";
2
+ import { ChangeDetectionStrategy, Component, Input, Optional, Self } from "@angular/core";
3
+ import { ReactiveFormsModule, NgControl } from "@angular/forms";
4
+ import { GovDesignSystemModule } from "@gov-design-system-ce/angular";
5
+ import { SWITCH_COMPONENT_TOKEN, SwitchCore, ErrorPipe, BaseFormInputComponent } from "@verisoft/ui-core";
6
+
7
+ @Component({
8
+ selector: "v-switch",
9
+ standalone: true,
10
+ styleUrls: [
11
+ "./gov-switch.component.scss"
12
+ ],
13
+ templateUrl: './gov-switch.component.html',
14
+ imports: [
15
+ CommonModule, GovDesignSystemModule, ErrorPipe, ReactiveFormsModule
16
+ ],
17
+ changeDetection: ChangeDetectionStrategy.OnPush,
18
+ providers: [{
19
+ provide: SWITCH_COMPONENT_TOKEN,
20
+ useExisting: SwitchComponent,
21
+ }],
22
+ })
23
+ export class SwitchComponent
24
+ extends BaseFormInputComponent
25
+ implements SwitchCore
26
+ {
27
+ @Input() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';
28
+ @Input() errorSlot: "top" | "bottom" = "top";
29
+ @Input() noLabel = false;
30
+ @Input() name!: string;
31
+
32
+ constructor(@Optional() @Self() ngControl: NgControl) {
33
+ super(ngControl);
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ export * from './gov-switch.component'