@verisoft/ui-primeng 18.0.0

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 (233) hide show
  1. package/.eslintrc.json +43 -0
  2. package/README.md +7 -0
  3. package/jest.config.ts +22 -0
  4. package/ng-package.json +7 -0
  5. package/package.json +21 -0
  6. package/project.json +36 -0
  7. package/src/assets/.gitkeep +0 -0
  8. package/src/assets/fonts/orbitron-black.ttf +0 -0
  9. package/src/assets/fonts/orbitron-bold.otf +0 -0
  10. package/src/assets/icons/complex/v-logo.svg +4 -0
  11. package/src/assets/images/_global/elon.jpg +0 -0
  12. package/src/assets/images/_global/jara.png +0 -0
  13. package/src/assets/images/_global/logos/v-logo.webp +0 -0
  14. package/src/assets/sass/base/_scrollbar.scss +18 -0
  15. package/src/assets/sass/base/_typography.scss +25 -0
  16. package/src/assets/sass/layout/_app.scss +27 -0
  17. package/src/assets/sass/layout/_button.scss +57 -0
  18. package/src/assets/sass/layout/_checkbox.scss +33 -0
  19. package/src/assets/sass/layout/_dialog.scss +13 -0
  20. package/src/assets/sass/layout/_dropdown.scss +9 -0
  21. package/src/assets/sass/layout/_formField.scss +5 -0
  22. package/src/assets/sass/layout/_header.scss +63 -0
  23. package/src/assets/sass/layout/_icons.scss +13 -0
  24. package/src/assets/sass/layout/_inputSwitch.scss +13 -0
  25. package/src/assets/sass/layout/_layout.scss +6 -0
  26. package/src/assets/sass/layout/_loader.scss +9 -0
  27. package/src/assets/sass/layout/_radiobutton.scss +21 -0
  28. package/src/assets/sass/layout/_sidemenu.scss +187 -0
  29. package/src/assets/sass/layout/_snackbar.scss +8 -0
  30. package/src/assets/sass/layout/_tables.scss +5 -0
  31. package/src/assets/sass/layout/_tree.scss +12 -0
  32. package/src/assets/sass/layout/_tristatecheckbox.scss +15 -0
  33. package/src/assets/sass/main.scss +28 -0
  34. package/src/assets/sass/themes/_verisoft_theme.scss +46 -0
  35. package/src/assets/sass/utils/_mixins.scss +0 -0
  36. package/src/assets/sass/utils/_utils.scss +39 -0
  37. package/src/assets/sass/utils/_variables.scss +12 -0
  38. package/src/assets/sass/vendors/_bootstrap.scss +2 -0
  39. package/src/assets/sass/vendors/_primeng.scss +2 -0
  40. package/src/index.ts +31 -0
  41. package/src/lib/components/action-button-group/action-button-group.component.html +29 -0
  42. package/src/lib/components/action-button-group/action-button-group.component.scss +0 -0
  43. package/src/lib/components/action-button-group/action-button-group.component.spec.ts +21 -0
  44. package/src/lib/components/action-button-group/action-button-group.component.ts +104 -0
  45. package/src/lib/components/action-button-group/components/action-button/action-button.component.html +12 -0
  46. package/src/lib/components/action-button-group/components/action-button/action-button.component.scss +0 -0
  47. package/src/lib/components/action-button-group/components/action-button/action-button.component.spec.ts +21 -0
  48. package/src/lib/components/action-button-group/components/action-button/action-button.component.ts +36 -0
  49. package/src/lib/components/action-button-group/index.ts +2 -0
  50. package/src/lib/components/breadcrumb/breadcrumb.component.html +12 -0
  51. package/src/lib/components/breadcrumb/breadcrumb.component.scss +18 -0
  52. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +21 -0
  53. package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +36 -0
  54. package/src/lib/components/breadcrumb/breadcrumb.component.ts +24 -0
  55. package/src/lib/components/breadcrumb/index.ts +1 -0
  56. package/src/lib/components/button/button.component.html +20 -0
  57. package/src/lib/components/button/button.component.scss +0 -0
  58. package/src/lib/components/button/button.component.spec.ts +21 -0
  59. package/src/lib/components/button/button.component.ts +43 -0
  60. package/src/lib/components/button/directives/shortcut.directive.ts +37 -0
  61. package/src/lib/components/button/index.ts +2 -0
  62. package/src/lib/components/calendar/calendar.component.html +53 -0
  63. package/src/lib/components/calendar/calendar.component.scss +0 -0
  64. package/src/lib/components/calendar/calendar.component.spec.ts +21 -0
  65. package/src/lib/components/calendar/calendar.component.ts +67 -0
  66. package/src/lib/components/calendar/index.ts +1 -0
  67. package/src/lib/components/checkbox/checkbox.component.html +19 -0
  68. package/src/lib/components/checkbox/checkbox.component.scss +15 -0
  69. package/src/lib/components/checkbox/checkbox.component.spec.ts +21 -0
  70. package/src/lib/components/checkbox/checkbox.component.stories.ts +72 -0
  71. package/src/lib/components/checkbox/checkbox.component.ts +41 -0
  72. package/src/lib/components/checkbox/index.ts +1 -0
  73. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +48 -0
  74. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +3 -0
  75. package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +21 -0
  76. package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +74 -0
  77. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +74 -0
  78. package/src/lib/components/confirm-dialog/index.ts +2 -0
  79. package/src/lib/components/confirm-dialog/services/confirm-dialog.service.ts +14 -0
  80. package/src/lib/components/dropdown/dropdown.component.html +96 -0
  81. package/src/lib/components/dropdown/dropdown.component.scss +16 -0
  82. package/src/lib/components/dropdown/dropdown.component.spec.ts +21 -0
  83. package/src/lib/components/dropdown/dropdown.component.stories.ts +90 -0
  84. package/src/lib/components/dropdown/dropdown.component.ts +139 -0
  85. package/src/lib/components/dropdown/index.ts +1 -0
  86. package/src/lib/components/dynamic-component/dynamic-component-factory.service.ts +90 -0
  87. package/src/lib/components/dynamic-component/dynamic-component.component.ts +55 -0
  88. package/src/lib/components/filter/directives/filter-field.directive.ts +25 -0
  89. package/src/lib/components/filter/directives/table-filter.directive.ts +22 -0
  90. package/src/lib/components/filter/filter.component.html +67 -0
  91. package/src/lib/components/filter/filter.component.scss +0 -0
  92. package/src/lib/components/filter/filter.component.spec.ts +21 -0
  93. package/src/lib/components/filter/filter.component.stories.ts +23 -0
  94. package/src/lib/components/filter/filter.component.ts +257 -0
  95. package/src/lib/components/filter/filter.model.ts +18 -0
  96. package/src/lib/components/filter/index.ts +3 -0
  97. package/src/lib/components/form-field/form-field.component.html +41 -0
  98. package/src/lib/components/form-field/form-field.component.scss +0 -0
  99. package/src/lib/components/form-field/form-field.component.spec.ts +21 -0
  100. package/src/lib/components/form-field/form-field.component.stories.ts +69 -0
  101. package/src/lib/components/form-field/form-field.component.ts +34 -0
  102. package/src/lib/components/form-field/index.ts +1 -0
  103. package/src/lib/components/generic-field/generic-field.component.html +54 -0
  104. package/src/lib/components/generic-field/generic-field.component.spec.ts +21 -0
  105. package/src/lib/components/generic-field/generic-field.component.ts +76 -0
  106. package/src/lib/components/generic-field/generic-field.model.ts +9 -0
  107. package/src/lib/components/generic-field/index.ts +2 -0
  108. package/src/lib/components/generic-form/generic-form.component.html +33 -0
  109. package/src/lib/components/generic-form/generic-form.component.spec.ts +21 -0
  110. package/src/lib/components/generic-form/generic-form.component.ts +48 -0
  111. package/src/lib/components/generic-form/generic-form.model.spec.ts +82 -0
  112. package/src/lib/components/generic-form/generic-form.model.ts +76 -0
  113. package/src/lib/components/generic-form/index.ts +2 -0
  114. package/src/lib/components/header/header.component.html +85 -0
  115. package/src/lib/components/header/header.component.scss +0 -0
  116. package/src/lib/components/header/header.component.spec.ts +21 -0
  117. package/src/lib/components/header/header.component.stories.ts +24 -0
  118. package/src/lib/components/header/header.component.ts +64 -0
  119. package/src/lib/components/header/index.ts +2 -0
  120. package/src/lib/components/header/services/header-provider.service.ts +15 -0
  121. package/src/lib/components/input-group/index.ts +1 -0
  122. package/src/lib/components/input-group/input-group.component.html +32 -0
  123. package/src/lib/components/input-group/input-group.component.spec.ts +21 -0
  124. package/src/lib/components/input-group/input-group.component.ts +60 -0
  125. package/src/lib/components/loader/index.ts +1 -0
  126. package/src/lib/components/loader/loader.component.html +5 -0
  127. package/src/lib/components/loader/loader.component.scss +0 -0
  128. package/src/lib/components/loader/loader.component.spec.ts +21 -0
  129. package/src/lib/components/loader/loader.component.ts +17 -0
  130. package/src/lib/components/multiselect/index.ts +1 -0
  131. package/src/lib/components/multiselect/multiselect.component.html +69 -0
  132. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  133. package/src/lib/components/multiselect/multiselect.component.spec.ts +21 -0
  134. package/src/lib/components/multiselect/multiselect.component.ts +120 -0
  135. package/src/lib/components/number-input/index.ts +1 -0
  136. package/src/lib/components/number-input/number-input.component.html +22 -0
  137. package/src/lib/components/number-input/number-input.component.spec.ts +21 -0
  138. package/src/lib/components/number-input/number-input.component.ts +54 -0
  139. package/src/lib/components/page-header/index.ts +2 -0
  140. package/src/lib/components/page-header/page-header.component.html +31 -0
  141. package/src/lib/components/page-header/page-header.component.scss +0 -0
  142. package/src/lib/components/page-header/page-header.component.spec.ts +21 -0
  143. package/src/lib/components/page-header/page-header.component.ts +60 -0
  144. package/src/lib/components/page-header/services/page-header.service.ts +9 -0
  145. package/src/lib/components/password/index.ts +1 -0
  146. package/src/lib/components/password/password.component.html +24 -0
  147. package/src/lib/components/password/password.component.scss +0 -0
  148. package/src/lib/components/password/password.component.spec.ts +21 -0
  149. package/src/lib/components/password/password.component.ts +56 -0
  150. package/src/lib/components/radiobutton/index.ts +1 -0
  151. package/src/lib/components/radiobutton/radiobutton.component.html +32 -0
  152. package/src/lib/components/radiobutton/radiobutton.component.scss +6 -0
  153. package/src/lib/components/radiobutton/radiobutton.component.spec.ts +21 -0
  154. package/src/lib/components/radiobutton/radiobutton.component.stories.ts +71 -0
  155. package/src/lib/components/radiobutton/radiobutton.component.ts +60 -0
  156. package/src/lib/components/section/index.ts +1 -0
  157. package/src/lib/components/section/section.component.html +24 -0
  158. package/src/lib/components/section/section.component.scss +0 -0
  159. package/src/lib/components/section/section.component.spec.ts +21 -0
  160. package/src/lib/components/section/section.component.ts +30 -0
  161. package/src/lib/components/side-menu/index.ts +2 -0
  162. package/src/lib/components/side-menu/side-menu.component.html +55 -0
  163. package/src/lib/components/side-menu/side-menu.component.scss +0 -0
  164. package/src/lib/components/side-menu/side-menu.component.spec.ts +21 -0
  165. package/src/lib/components/side-menu/side-menu.component.ts +97 -0
  166. package/src/lib/components/side-menu/side-menu.module.ts +66 -0
  167. package/src/lib/components/slider/index.ts +1 -0
  168. package/src/lib/components/slider/slider.component.html +19 -0
  169. package/src/lib/components/slider/slider.component.spec.ts +21 -0
  170. package/src/lib/components/slider/slider.component.ts +56 -0
  171. package/src/lib/components/snackbar/index.ts +2 -0
  172. package/src/lib/components/snackbar/services/snackbar.service.ts +45 -0
  173. package/src/lib/components/snackbar/snackbar.component.html +3 -0
  174. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  175. package/src/lib/components/snackbar/snackbar.component.spec.ts +21 -0
  176. package/src/lib/components/snackbar/snackbar.component.stories.ts +70 -0
  177. package/src/lib/components/snackbar/snackbar.component.ts +26 -0
  178. package/src/lib/components/stepper/index.ts +1 -0
  179. package/src/lib/components/stepper/stepper.component.html +43 -0
  180. package/src/lib/components/stepper/stepper.component.spec.ts +21 -0
  181. package/src/lib/components/stepper/stepper.component.ts +25 -0
  182. package/src/lib/components/switch/index.ts +1 -0
  183. package/src/lib/components/switch/switch.component.html +19 -0
  184. package/src/lib/components/switch/switch.component.scss +0 -0
  185. package/src/lib/components/switch/switch.component.spec.ts +21 -0
  186. package/src/lib/components/switch/switch.component.stories.ts +65 -0
  187. package/src/lib/components/switch/switch.component.ts +52 -0
  188. package/src/lib/components/tab-view/index.ts +3 -0
  189. package/src/lib/components/tab-view/tab-view-item.component.ts +20 -0
  190. package/src/lib/components/tab-view/tab-view.component.html +24 -0
  191. package/src/lib/components/tab-view/tab-view.component.ts +50 -0
  192. package/src/lib/components/tab-view/tab-view.module.ts +18 -0
  193. package/src/lib/components/table/directives/table-store.directive.ts +61 -0
  194. package/src/lib/components/table/index.ts +2 -0
  195. package/src/lib/components/table/table.component.html +183 -0
  196. package/src/lib/components/table/table.component.scss +0 -0
  197. package/src/lib/components/table/table.component.spec.ts +21 -0
  198. package/src/lib/components/table/table.component.stories.ts +55 -0
  199. package/src/lib/components/table/table.component.ts +256 -0
  200. package/src/lib/components/table-filter/filter.component.html +205 -0
  201. package/src/lib/components/table-filter/filter.component.scss +0 -0
  202. package/src/lib/components/table-filter/filter.component.spec.ts +21 -0
  203. package/src/lib/components/table-filter/filter.component.stories.ts +23 -0
  204. package/src/lib/components/textarea/index.ts +1 -0
  205. package/src/lib/components/textarea/textarea.component.html +40 -0
  206. package/src/lib/components/textarea/textarea.component.scss +5 -0
  207. package/src/lib/components/textarea/textarea.component.spec.ts +21 -0
  208. package/src/lib/components/textarea/textarea.component.stories.ts +98 -0
  209. package/src/lib/components/textarea/textarea.component.ts +62 -0
  210. package/src/lib/components/textfield/index.ts +1 -0
  211. package/src/lib/components/textfield/textfield.component.html +83 -0
  212. package/src/lib/components/textfield/textfield.component.scss +23 -0
  213. package/src/lib/components/textfield/textfield.component.spec.ts +21 -0
  214. package/src/lib/components/textfield/textfield.component.stories.ts +85 -0
  215. package/src/lib/components/textfield/textfield.component.ts +64 -0
  216. package/src/lib/components/tristatecheckbox/index.ts +1 -0
  217. package/src/lib/components/tristatecheckbox/tristatecheckbox.component.html +23 -0
  218. package/src/lib/components/tristatecheckbox/tristatecheckbox.component.scss +0 -0
  219. package/src/lib/components/tristatecheckbox/tristatecheckbox.component.spec.ts +21 -0
  220. package/src/lib/components/tristatecheckbox/tristatecheckbox.component.stories.ts +22 -0
  221. package/src/lib/components/tristatecheckbox/tristatecheckbox.component.ts +46 -0
  222. package/src/lib/interceptors/http-error-message.interceptor.ts +35 -0
  223. package/src/lib/pages/not-found-page/not-found-page.component.html +27 -0
  224. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  225. package/src/lib/pages/not-found-page/not-found-page.component.spec.ts +21 -0
  226. package/src/lib/pages/not-found-page/not-found-page.component.ts +17 -0
  227. package/src/lib/services/screen-size.service.ts +25 -0
  228. package/src/tab-view.ts +1 -0
  229. package/src/test-setup.ts +8 -0
  230. package/tsconfig.json +29 -0
  231. package/tsconfig.lib.json +18 -0
  232. package/tsconfig.lib.prod.json +9 -0
  233. package/tsconfig.spec.json +16 -0
@@ -0,0 +1,62 @@
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 { BaseFormInputComponent, BaseInputControls, TEXTAREA_COMPONENT_TOKEN, TextareaCore } from '@verisoft/ui-core';
15
+ import { FloatLabelModule } from 'primeng/floatlabel';
16
+ import { InputTextareaModule } from 'primeng/inputtextarea';
17
+ import { FormFieldComponent } from '../form-field/form-field.component';
18
+
19
+ @Component({
20
+ selector: 'v-textarea',
21
+ standalone: true,
22
+ imports: [
23
+ CommonModule,
24
+ InputTextareaModule,
25
+ ReactiveFormsModule,
26
+ FormFieldComponent,
27
+ FloatLabelModule,
28
+ ],
29
+ templateUrl: './textarea.component.html',
30
+ styleUrl: './textarea.component.scss',
31
+ changeDetection: ChangeDetectionStrategy.OnPush,
32
+ providers: [
33
+ {
34
+ provide: BaseInputControls,
35
+ useExisting: TextareaComponent,
36
+ },
37
+ {
38
+ provide: TEXTAREA_COMPONENT_TOKEN,
39
+ useExisting: TextareaComponent,
40
+ },
41
+ ],
42
+ })
43
+ export class TextareaComponent
44
+ extends BaseFormInputComponent
45
+ implements ControlValueAccessor, TextareaCore
46
+ {
47
+ @Input()
48
+ rows = 5;
49
+
50
+ @Input()
51
+ cols = 30;
52
+
53
+ @Input()
54
+ autoResize = false;
55
+
56
+ @Input()
57
+ floatLabel: string | undefined;
58
+
59
+ constructor(@Optional() @Self() ngControl: NgControl) {
60
+ super(ngControl);
61
+ }
62
+ }
@@ -0,0 +1 @@
1
+ export * from './textfield.component';
@@ -0,0 +1,83 @@
1
+ <div class="v-text-field">
2
+ <ng-container *ngIf="!floatLabel && label; else floatLabelInput">
3
+ <v-form-field
4
+ class="w-100"
5
+ [label]="label"
6
+ [tooltip]="tooltip"
7
+ [required]="isRequired()"
8
+ [ngControl]="ngControl"
9
+ [testId]="testId"
10
+ [display]="formDisplay"
11
+ >
12
+ <span
13
+ class="w-100 flex-grow-1"
14
+ [ngClass]="{ 'p-input-icon-right': type === 'search' }"
15
+ >
16
+ <input
17
+ pInputText
18
+ [id]="inputId"
19
+ [formControl]="formControl"
20
+ [type]="type === 'search' ? 'text' : type"
21
+ class="w-100 flex-grow-1 v-text-field"
22
+ [required]="isRequired()"
23
+ [readOnly]="readonly"
24
+ [title]="label"
25
+ [placeholder]="placeholder ? placeholder : ''"
26
+ [ngClass]="{
27
+ 'p-inputtext-sm': size === 'small',
28
+ 'p-inputtext-lg': size === 'large'
29
+ }"
30
+ />
31
+ <ng-container *ngIf="type === 'search'">
32
+ <i
33
+ class="pi ms-2 v-text-field__icon"
34
+ [ngStyle]="{
35
+ cursor: ngControl && ngControl.value ? 'pointer' : 'default'
36
+ }"
37
+ [ngClass]="{
38
+ 'pi-search': ngControl && !ngControl.value,
39
+ 'pi-times': ngControl && ngControl.value,
40
+ }"
41
+ (click)="ngControl && ngControl.value ? ngControl.reset() : null"
42
+ ></i>
43
+ </ng-container>
44
+ </span>
45
+ </v-form-field>
46
+ </ng-container>
47
+ <ng-template #floatLabelInput>
48
+ <span
49
+ class="w-100 flex-grow-1"
50
+ [ngClass]="{ 'p-input-icon-right': type === 'search' }"
51
+ >
52
+ <p-floatLabel>
53
+ <input
54
+ pInputText
55
+ type="text"
56
+ [id]="inputId"
57
+ class="w-100 flex-grow-1"
58
+ [required]="isRequired()"
59
+ [formControl]="formControl"
60
+ [placeholder]="placeholder ? placeholder : ''"
61
+ [ngClass]="{
62
+ 'p-inputtext-sm': size === 'small',
63
+ 'p-inputtext-lg': size === 'large'
64
+ }"
65
+ />
66
+ <label [for]="inputId" class="v-text-field__label">{{ label }}</label>
67
+ </p-floatLabel>
68
+ <ng-container *ngIf="type === 'search'">
69
+ <i
70
+ class="pi ms-2 v-text-field__icon"
71
+ [ngStyle]="{
72
+ cursor: ngControl && ngControl.value ? 'pointer' : 'default'
73
+ }"
74
+ [ngClass]="{
75
+ 'pi-search': ngControl && !ngControl.value,
76
+ 'pi-times': ngControl && ngControl.value,
77
+ }"
78
+ (click)="ngControl && ngControl.value ? ngControl.reset() : null"
79
+ ></i>
80
+ </ng-container>
81
+ </span>
82
+ </ng-template>
83
+ </div>
@@ -0,0 +1,23 @@
1
+ .p-inputtext:focus .ng-invalid.ng-dirty {
2
+ border-color: var(--error-color);
3
+ }
4
+
5
+ .p-inputtext.ng-dirty.ng-invalid {
6
+ border-color: var(--error-color);
7
+ }
8
+
9
+ .verisoft-text-field {
10
+ justify-content: center;
11
+ width: 100%;
12
+ }
13
+
14
+ .p-input-icon-right {
15
+ i.pi-times:hover {
16
+ cursor: pointer;
17
+ }
18
+ }
19
+
20
+ .p-inputtext.p-inputtext-lg {
21
+ font-size: 1rem;
22
+ padding: 0.75rem;
23
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { TextfieldComponent } from './textfield.component';
3
+
4
+ describe('TextfieldComponent', () => {
5
+ let component: TextfieldComponent;
6
+ let fixture: ComponentFixture<TextfieldComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [TextfieldComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(TextfieldComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,85 @@
1
+ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
2
+ import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
3
+ import { FieldSize, FieldType } from '@verisoft/ui-core';
4
+ import { TextfieldComponent } from './textfield.component';
5
+
6
+ const meta: Meta<TextfieldComponent> = {
7
+ component: TextfieldComponent,
8
+ title: 'TextfieldComponent',
9
+ decorators: [
10
+ moduleMetadata({
11
+ imports: [ReactiveFormsModule],
12
+ }),
13
+ ],
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<TextfieldComponent>;
17
+ const formGroup = new FormGroup({
18
+ formField: new FormControl(''),
19
+ });
20
+ export const Primary: Story = {
21
+ render: (args: any) => ({
22
+ props: {
23
+ ...args,
24
+ formGroup,
25
+ },
26
+ template: `
27
+ <form [formGroup]="formGroup">
28
+ <v-textfield
29
+ formControlName="formField"
30
+ [label]="label"
31
+ [size]="size"
32
+ [type]="type"
33
+ [disabled]="disabled"
34
+ [readonly]="readonly"
35
+ [required]="required"
36
+ [tooltip]="tooltip"
37
+ [placeholder]="placeholder"
38
+ [testId]="testId"
39
+ ></v-textfield>
40
+ </form>
41
+ `,
42
+ }),
43
+ args: {
44
+ label: 'Description',
45
+ size: FieldSize.medium,
46
+ type: FieldType.text,
47
+ required: false,
48
+ disabled: false,
49
+ readonly: false,
50
+ placeholder:
51
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
52
+ testId: 'testId',
53
+ tooltip: 'This is a tooltip lorem ipsum',
54
+ },
55
+ argTypes: {
56
+ size: {
57
+ options: ['small', 'medium', 'large'],
58
+ control: { type: 'radio' },
59
+ description: 'Defines the size of the `TextfieldComponent`',
60
+ },
61
+ type: {
62
+ options: ['text', 'number', 'password', 'search'],
63
+ control: { type: 'radio' },
64
+ description: 'Defines the type of the `TextfieldComponent`',
65
+ },
66
+ label: {
67
+ description:
68
+ 'Label shown on the left side of the `TextfieldComponent` input',
69
+ },
70
+ tooltip: { description: 'Tooltip text of the `TextfieldComponent`' },
71
+ required: {
72
+ description: 'Defines if the `TextfieldComponent` is `required`',
73
+ },
74
+ disabled: {
75
+ description: 'Defines if the `TextfieldComponent` is `disabled`',
76
+ },
77
+ readonly: {
78
+ description: 'Defines if the `TextfieldComponent` is `readonly`',
79
+ },
80
+ testId: { description: 'Test ID of the `TextfieldComponent`' },
81
+ },
82
+ parameters: {
83
+ controls: { expanded: true },
84
+ },
85
+ };
@@ -0,0 +1,64 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ forwardRef,
6
+ Input,
7
+ Optional,
8
+ Self,
9
+ } from '@angular/core';
10
+ import {
11
+ ControlValueAccessor,
12
+ NgControl,
13
+ ReactiveFormsModule,
14
+ } from '@angular/forms';
15
+ import {
16
+ BaseFormInputComponent,
17
+ BaseInputControls,
18
+ FieldSize,
19
+ FieldSizeType,
20
+ FieldType,
21
+ FieldTypeType,
22
+ TEXTFIELD_COMPONENT_TOKEN,
23
+ TextfieldCore,
24
+ } from '@verisoft/ui-core';
25
+ import { FloatLabelModule } from 'primeng/floatlabel';
26
+ import { InputTextModule } from 'primeng/inputtext';
27
+ import { FormFieldComponent } from '../form-field/form-field.component';
28
+
29
+ @Component({
30
+ selector: 'v-textfield',
31
+ standalone: true,
32
+ imports: [
33
+ CommonModule,
34
+ InputTextModule,
35
+ ReactiveFormsModule,
36
+ FormFieldComponent,
37
+ FloatLabelModule,
38
+ ],
39
+ templateUrl: './textfield.component.html',
40
+ styleUrl: './textfield.component.scss',
41
+ changeDetection: ChangeDetectionStrategy.OnPush,
42
+ providers: [
43
+ {
44
+ provide: BaseInputControls,
45
+ useExisting: forwardRef(() => TextfieldComponent),
46
+ },
47
+ {
48
+ provide: TEXTFIELD_COMPONENT_TOKEN,
49
+ useExisting: TextfieldComponent,
50
+ },
51
+ ],
52
+ })
53
+ export class TextfieldComponent
54
+ extends BaseFormInputComponent
55
+ implements ControlValueAccessor, TextfieldCore
56
+ {
57
+ constructor(@Optional() @Self() ngControl: NgControl) {
58
+ super(ngControl);
59
+ }
60
+
61
+ @Input() size?: FieldSizeType = FieldSize.medium;
62
+ @Input() type: FieldTypeType = FieldType.text;
63
+ @Input() floatLabel = false;
64
+ }
@@ -0,0 +1 @@
1
+ export * from './tristatecheckbox.component';
@@ -0,0 +1,23 @@
1
+ <div class="v-tristatecheckbox d-flex align-items-center mt-2">
2
+ <v-form-field
3
+ class="w-100"
4
+ [label]="label"
5
+ [tooltip]="tooltip"
6
+ [required]="isRequired()"
7
+ [ngControl]="ngControl"
8
+ [testId]="testId"
9
+ [display]="formDisplay"
10
+ >
11
+ <p-triStateCheckbox
12
+ [ngClass]="{
13
+ 'tristate-error':
14
+ ngControl?.invalid && ngControl?.dirty && ngControl?.value === false
15
+ }"
16
+ [formControl]="formControl"
17
+ [required]="required"
18
+ [readonly]="readonly"
19
+ [inputId]="testId"
20
+ checkboxFalseIcon="pi pi-minus"
21
+ />
22
+ </v-form-field>
23
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { TristatecheckboxComponent } from './tristatecheckbox.component';
3
+
4
+ describe('TristatecheckboxComponent', () => {
5
+ let component: TristatecheckboxComponent;
6
+ let fixture: ComponentFixture<TristatecheckboxComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [TristatecheckboxComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(TristatecheckboxComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/angular';
2
+ import { within, expect } from '@storybook/test';
3
+ import { TristatecheckboxComponent } from './tristatecheckbox.component';
4
+
5
+ const meta: Meta<TristatecheckboxComponent> = {
6
+ component: TristatecheckboxComponent,
7
+ title: 'VerisoftTristatecheckboxComponent',
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<TristatecheckboxComponent>;
11
+
12
+ export const Primary: Story = {
13
+ args: {},
14
+ };
15
+
16
+ export const Heading: Story = {
17
+ args: {},
18
+ play: async ({ canvasElement }: any) => {
19
+ const canvas = within(canvasElement);
20
+ expect(canvas.getByText(/verisoft-tristatecheckbox works!/gi)).toBeTruthy();
21
+ },
22
+ };
@@ -0,0 +1,46 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, Optional, Self } from '@angular/core';
3
+ import {
4
+ ControlValueAccessor,
5
+ NgControl,
6
+ ReactiveFormsModule,
7
+ } from '@angular/forms';
8
+ import {
9
+ BaseFormInputComponent,
10
+ BaseInputControls,
11
+ TRISTATE_CHECKBOX_COMPONENT_TOKEN,
12
+ TristateCheckboxCore,
13
+ } from '@verisoft/ui-core';
14
+ import { TriStateCheckboxModule } from 'primeng/tristatecheckbox';
15
+ import { FormFieldComponent } from '../form-field';
16
+
17
+ @Component({
18
+ selector: 'v-tristatecheckbox',
19
+ standalone: true,
20
+ imports: [
21
+ CommonModule,
22
+ TriStateCheckboxModule,
23
+ ReactiveFormsModule,
24
+ FormFieldComponent,
25
+ ],
26
+ templateUrl: './tristatecheckbox.component.html',
27
+ styleUrl: './tristatecheckbox.component.scss',
28
+ providers: [
29
+ {
30
+ provide: BaseInputControls,
31
+ useExisting: TristatecheckboxComponent,
32
+ },
33
+ {
34
+ provide: TRISTATE_CHECKBOX_COMPONENT_TOKEN,
35
+ useExisting: TristatecheckboxComponent,
36
+ },
37
+ ],
38
+ })
39
+ export class TristatecheckboxComponent
40
+ extends BaseFormInputComponent
41
+ implements ControlValueAccessor, TristateCheckboxCore
42
+ {
43
+ constructor(@Optional() @Self() ngControl: NgControl) {
44
+ super(ngControl);
45
+ }
46
+ }
@@ -0,0 +1,35 @@
1
+ import {
2
+ HttpErrorResponse,
3
+ HttpEvent,
4
+ HttpHandler,
5
+ HttpInterceptor,
6
+ HttpRequest,
7
+ } from '@angular/common/http';
8
+ import { Injectable } from '@angular/core';
9
+ import { catchError, Observable, throwError } from 'rxjs';
10
+ import { SnackbarService } from '../components/snackbar';
11
+
12
+ @Injectable()
13
+ export class HttpErrorMessageInterceptor implements HttpInterceptor {
14
+ constructor(private readonly snackbarService: SnackbarService) {}
15
+ intercept(
16
+ req: HttpRequest<any>,
17
+ next: HttpHandler
18
+ ): Observable<HttpEvent<any>> {
19
+ return next.handle(req).pipe(
20
+ catchError((errorResponse: HttpErrorResponse) => {
21
+ if (!errorResponse.ok) {
22
+ if (errorResponse.status === 403) {
23
+ this.snackbarService.showError('Unauthorized request');
24
+ console.error('Unauthorized request');
25
+ } else {
26
+ this.snackbarService.showError(errorResponse.message);
27
+ console.error(errorResponse);
28
+ }
29
+ }
30
+
31
+ return throwError(() => errorResponse);
32
+ })
33
+ );
34
+ }
35
+ }
@@ -0,0 +1,27 @@
1
+ <div class="v-not-found">
2
+ <div class="error-message p-4">
3
+ <h1 class="text-primary">404 - PAGE NOT FOUND</h1>
4
+ <p class="text-default">
5
+ This is not the page you are looking for.<br />Try searching for something
6
+ else.
7
+ </p>
8
+ <v-button
9
+ class="back-button"
10
+ size="small"
11
+ label="Take me back"
12
+ (click)="navigationBack()"
13
+ />
14
+ </div>
15
+ <div class="images">
16
+ <img
17
+ src="assets/images/_global/hafan.jpeg"
18
+ alt="Dog Image"
19
+ class="dog-image"
20
+ />
21
+ <img
22
+ src="assets/images/_global/bouda.png"
23
+ alt="House Image"
24
+ class="house-image"
25
+ />
26
+ </div>
27
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { NotFoundPageComponent } from './not-found-page.component';
3
+
4
+ describe('NotFoundPageComponent', () => {
5
+ let component: NotFoundPageComponent;
6
+ let fixture: ComponentFixture<NotFoundPageComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [NotFoundPageComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(NotFoundPageComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,17 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { ButtonComponent } from '../../components/button';
4
+
5
+ @Component({
6
+ selector: 'v-not-found-page',
7
+ standalone: true,
8
+ imports: [CommonModule, ButtonComponent],
9
+ templateUrl: './not-found-page.component.html',
10
+ styleUrl: './not-found-page.component.scss',
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ })
13
+ export class NotFoundPageComponent {
14
+ navigationBack() {
15
+ history.back();
16
+ }
17
+ }
@@ -0,0 +1,25 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+
4
+ @Injectable({
5
+ providedIn: 'root',
6
+ })
7
+ export class ScreenSizeService {
8
+ isMobileBlock = new BehaviorSubject<boolean>(false);
9
+ prevState = false;
10
+
11
+ constructor() {
12
+ this.checkScreenSize();
13
+ window.addEventListener('resize', async () => {
14
+ await this.checkScreenSize();
15
+ });
16
+ }
17
+
18
+ async checkScreenSize() {
19
+ const isMobile = window.matchMedia('(max-width: 768px)').matches;
20
+ if (isMobile !== this.prevState) {
21
+ this.prevState = isMobile;
22
+ this.isMobileBlock.next(isMobile);
23
+ }
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/components/tab-view';
@@ -0,0 +1,8 @@
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 ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022",
4
+ "useDefineForClassFields": false,
5
+ "forceConsistentCasingInFileNames": true,
6
+ "strict": true,
7
+ "noImplicitOverride": true,
8
+ "noPropertyAccessFromIndexSignature": true,
9
+ "noImplicitReturns": true,
10
+ "noFallthroughCasesInSwitch": true
11
+ },
12
+ "files": [],
13
+ "include": [],
14
+ "references": [
15
+ {
16
+ "path": "./tsconfig.lib.json"
17
+ },
18
+ {
19
+ "path": "./tsconfig.spec.json"
20
+ }
21
+ ],
22
+ "extends": "../../../tsconfig.base.json",
23
+ "angularCompilerOptions": {
24
+ "enableI18nLegacyMessageIdFormat": false,
25
+ "strictInjectionParameters": true,
26
+ "strictInputAccessModifiers": true,
27
+ "strictTemplates": true
28
+ }
29
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../../dist/out-tsc",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "inlineSources": true,
8
+ "sourceMap": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "src/**/*.spec.ts",
13
+ "src/test-setup.ts",
14
+ "jest.config.ts",
15
+ "src/**/*.test.ts"
16
+ ],
17
+ "include": ["src/**/*.ts"]
18
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.lib.json",
3
+ "compilerOptions": {
4
+ "declarationMap": false
5
+ },
6
+ "angularCompilerOptions": {
7
+ "compilationMode": "partial"
8
+ }
9
+ }