@verisoft/ui-primeng 20.0.0 → 20.1.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 (219) hide show
  1. package/.eslintrc.json +43 -0
  2. package/assets/.gitkeep +0 -0
  3. package/jest.config.ts +22 -0
  4. package/ng-package.json +14 -0
  5. package/package.json +6 -18
  6. package/project.json +36 -0
  7. package/src/index.ts +34 -0
  8. package/src/lib/components/breadcrumb/breadcrumb.component.html +11 -0
  9. package/src/lib/components/breadcrumb/breadcrumb.component.scss +18 -0
  10. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +21 -0
  11. package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +36 -0
  12. package/src/lib/components/breadcrumb/breadcrumb.component.ts +27 -0
  13. package/src/lib/components/breadcrumb/breadcrumb.pipe.ts +13 -0
  14. package/src/lib/components/breadcrumb/index.ts +1 -0
  15. package/src/lib/components/button/button-severity.pipe.ts +20 -0
  16. package/src/lib/components/button/button.component.html +20 -0
  17. package/src/lib/components/button/button.component.scss +0 -0
  18. package/src/lib/components/button/button.component.spec.ts +21 -0
  19. package/src/lib/components/button/button.component.ts +49 -0
  20. package/src/lib/components/button/index.ts +1 -0
  21. package/src/lib/components/calendar/calendar.component.html +53 -0
  22. package/src/lib/components/calendar/calendar.component.scss +0 -0
  23. package/src/lib/components/calendar/calendar.component.spec.ts +21 -0
  24. package/src/lib/components/calendar/calendar.component.ts +70 -0
  25. package/src/lib/components/calendar/index.ts +1 -0
  26. package/src/lib/components/checkbox/checkbox.component.html +20 -0
  27. package/src/lib/components/checkbox/checkbox.component.scss +15 -0
  28. package/src/lib/components/checkbox/checkbox.component.spec.ts +21 -0
  29. package/src/lib/components/checkbox/checkbox.component.stories.ts +72 -0
  30. package/src/lib/components/checkbox/checkbox.component.ts +46 -0
  31. package/src/lib/components/checkbox/index.ts +1 -0
  32. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +51 -0
  33. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +3 -0
  34. package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +21 -0
  35. package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +74 -0
  36. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +73 -0
  37. package/src/lib/components/confirm-dialog/index.ts +1 -0
  38. package/src/lib/components/dropdown/dropdown.component.html +93 -0
  39. package/src/lib/components/dropdown/dropdown.component.scss +16 -0
  40. package/src/lib/components/dropdown/dropdown.component.spec.ts +21 -0
  41. package/src/lib/components/dropdown/dropdown.component.ts +139 -0
  42. package/src/lib/components/dropdown/index.ts +1 -0
  43. package/src/lib/components/dropdown-button/dropdown-button.component.html +1 -0
  44. package/src/lib/components/dropdown-button/dropdown-button.component.ts +20 -0
  45. package/src/lib/components/dropdown-button/index.ts +1 -0
  46. package/src/lib/components/errors/error.component.html +7 -0
  47. package/src/lib/components/errors/error.component.scss +3 -0
  48. package/src/lib/components/errors/error.component.ts +34 -0
  49. package/src/lib/components/errors/index.ts +1 -0
  50. package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +32 -0
  51. package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +8 -0
  52. package/src/lib/components/feature-list/feature-list-filter.pipe.ts +21 -0
  53. package/src/lib/components/feature-list/feature-list-page.component.ts +32 -0
  54. package/src/lib/components/feature-list/feature-list-page.model.ts +42 -0
  55. package/src/lib/components/feature-list/feature-list.component.html +59 -0
  56. package/src/lib/components/feature-list/feature-list.component.scss +10 -0
  57. package/src/lib/components/feature-list/feature-list.component.ts +341 -0
  58. package/src/lib/components/feature-list/index.ts +5 -0
  59. package/src/lib/components/filter/directives/filter-field.directive.ts +34 -0
  60. package/src/lib/components/filter/filter.component.html +68 -0
  61. package/src/lib/components/filter/filter.component.scss +0 -0
  62. package/src/lib/components/filter/filter.component.spec.ts +21 -0
  63. package/src/lib/components/filter/filter.component.stories.ts +23 -0
  64. package/src/lib/components/filter/filter.component.ts +281 -0
  65. package/src/lib/components/filter/filter.model.ts +18 -0
  66. package/src/lib/components/filter/index.ts +2 -0
  67. package/src/lib/components/form-field/form-field.component.html +42 -0
  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 +21 -0
  70. package/src/lib/components/form-field/form-field.component.stories.ts +69 -0
  71. package/src/lib/components/form-field/form-field.component.ts +37 -0
  72. package/src/lib/components/form-field/index.ts +1 -0
  73. package/src/lib/components/header/header.component.html +84 -0
  74. package/src/lib/components/header/header.component.scss +0 -0
  75. package/src/lib/components/header/header.component.spec.ts +21 -0
  76. package/src/lib/components/header/header.component.stories.ts +24 -0
  77. package/src/lib/components/header/header.component.ts +65 -0
  78. package/src/lib/components/header/index.ts +2 -0
  79. package/src/lib/components/header/services/header-provider.service.ts +15 -0
  80. package/src/lib/components/icon/icon.component.html +2 -0
  81. package/src/lib/components/icon/icon.component.scss +51 -0
  82. package/src/lib/components/icon/icon.component.ts +86 -0
  83. package/src/lib/components/icon/index.ts +2 -0
  84. package/src/lib/components/input-group/index.ts +1 -0
  85. package/src/lib/components/input-group/input-group.component.html +34 -0
  86. package/src/lib/components/input-group/input-group.component.spec.ts +21 -0
  87. package/src/lib/components/input-group/input-group.component.ts +58 -0
  88. package/src/lib/components/loader/index.ts +1 -0
  89. package/src/lib/components/loader/loader.component.html +5 -0
  90. package/src/lib/components/loader/loader.component.scss +0 -0
  91. package/src/lib/components/loader/loader.component.spec.ts +21 -0
  92. package/src/lib/components/loader/loader.component.ts +16 -0
  93. package/src/lib/components/multiselect/index.ts +1 -0
  94. package/src/lib/components/multiselect/multiselect.component.html +67 -0
  95. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  96. package/src/lib/components/multiselect/multiselect.component.spec.ts +21 -0
  97. package/src/lib/components/multiselect/multiselect.component.ts +120 -0
  98. package/src/lib/components/number-input/index.ts +1 -0
  99. package/src/lib/components/number-input/number-input.component.html +22 -0
  100. package/src/lib/components/number-input/number-input.component.spec.ts +21 -0
  101. package/src/lib/components/number-input/number-input.component.ts +55 -0
  102. package/src/lib/components/page-header/index.ts +1 -0
  103. package/src/lib/components/page-header/page-header.component.html +35 -0
  104. package/src/lib/components/page-header/page-header.component.scss +0 -0
  105. package/src/lib/components/page-header/page-header.component.spec.ts +21 -0
  106. package/src/lib/components/page-header/page-header.component.ts +31 -0
  107. package/src/lib/components/password/index.ts +1 -0
  108. package/src/lib/components/password/password.component.html +24 -0
  109. package/src/lib/components/password/password.component.scss +0 -0
  110. package/src/lib/components/password/password.component.spec.ts +21 -0
  111. package/src/lib/components/password/password.component.ts +56 -0
  112. package/src/lib/components/radiobutton/index.ts +1 -0
  113. package/src/lib/components/radiobutton/radiobutton.component.html +34 -0
  114. package/src/lib/components/radiobutton/radiobutton.component.scss +6 -0
  115. package/src/lib/components/radiobutton/radiobutton.component.spec.ts +21 -0
  116. package/src/lib/components/radiobutton/radiobutton.component.stories.ts +71 -0
  117. package/src/lib/components/radiobutton/radiobutton.component.ts +61 -0
  118. package/src/lib/components/section/index.ts +1 -0
  119. package/src/lib/components/section/section.component.html +25 -0
  120. package/src/lib/components/section/section.component.scss +0 -0
  121. package/src/lib/components/section/section.component.spec.ts +21 -0
  122. package/src/lib/components/section/section.component.ts +31 -0
  123. package/src/lib/components/shared-components/.eslintrc.json +42 -0
  124. package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +25 -0
  125. package/src/lib/components/shared-components/action-button-group/action-button-group.component.scss +0 -0
  126. package/src/lib/components/shared-components/action-button-group/action-button-group.component.spec.ts +21 -0
  127. package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +111 -0
  128. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +10 -0
  129. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.scss +0 -0
  130. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.spec.ts +21 -0
  131. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +69 -0
  132. package/src/lib/components/shared-components/action-button-group/index.ts +2 -0
  133. package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +142 -0
  134. package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +56 -0
  135. package/src/lib/components/shared-components/dynamic-component/index.ts +2 -0
  136. package/src/lib/components/shared-components/generic-field/generic-field.component.html +98 -0
  137. package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +21 -0
  138. package/src/lib/components/shared-components/generic-field/generic-field.component.ts +90 -0
  139. package/src/lib/components/shared-components/generic-field/index.ts +1 -0
  140. package/src/lib/components/shared-components/generic-form/generic-form.component.html +46 -0
  141. package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +21 -0
  142. package/src/lib/components/shared-components/generic-form/generic-form.component.ts +56 -0
  143. package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +82 -0
  144. package/src/lib/components/shared-components/generic-form/generic-form.model.ts +68 -0
  145. package/src/lib/components/shared-components/generic-form/index.ts +2 -0
  146. package/src/lib/components/shared-components/index.ts +4 -0
  147. package/src/lib/components/side-menu/index.ts +2 -0
  148. package/src/lib/components/side-menu/side-menu.component.html +53 -0
  149. package/src/lib/components/side-menu/side-menu.component.scss +0 -0
  150. package/src/lib/components/side-menu/side-menu.component.spec.ts +21 -0
  151. package/src/lib/components/side-menu/side-menu.component.ts +96 -0
  152. package/src/lib/components/side-menu/side-menu.module.ts +66 -0
  153. package/src/lib/components/slider/index.ts +1 -0
  154. package/src/lib/components/slider/slider.component.html +19 -0
  155. package/src/lib/components/slider/slider.component.spec.ts +21 -0
  156. package/src/lib/components/slider/slider.component.ts +56 -0
  157. package/src/lib/components/snackbar/index.ts +2 -0
  158. package/src/lib/components/snackbar/services/snackbar.service.ts +45 -0
  159. package/src/lib/components/snackbar/snackbar.component.html +3 -0
  160. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  161. package/src/lib/components/snackbar/snackbar.component.spec.ts +21 -0
  162. package/src/lib/components/snackbar/snackbar.component.stories.ts +70 -0
  163. package/src/lib/components/snackbar/snackbar.component.ts +25 -0
  164. package/src/lib/components/stepper/index.ts +1 -0
  165. package/src/lib/components/stepper/stepper.component.html +35 -0
  166. package/src/lib/components/stepper/stepper.component.spec.ts +21 -0
  167. package/src/lib/components/stepper/stepper.component.ts +39 -0
  168. package/src/lib/components/switch/index.ts +1 -0
  169. package/src/lib/components/switch/switch.component.html +18 -0
  170. package/src/lib/components/switch/switch.component.scss +0 -0
  171. package/src/lib/components/switch/switch.component.spec.ts +21 -0
  172. package/src/lib/components/switch/switch.component.stories.ts +65 -0
  173. package/src/lib/components/switch/switch.component.ts +52 -0
  174. package/src/lib/components/tab-view/index.ts +2 -0
  175. package/src/lib/components/tab-view/tab-view-item.component.ts +22 -0
  176. package/src/lib/components/tab-view/tab-view.component.html +41 -0
  177. package/src/lib/components/tab-view/tab-view.component.ts +55 -0
  178. package/src/lib/components/table/index.ts +1 -0
  179. package/src/lib/components/table/table-filter.pipe.ts +59 -0
  180. package/src/lib/components/table/table.component.html +127 -0
  181. package/src/lib/components/table/table.component.scss +11 -0
  182. package/src/lib/components/table/table.component.spec.ts +21 -0
  183. package/src/lib/components/table/table.component.stories.ts +55 -0
  184. package/src/lib/components/table/table.component.ts +288 -0
  185. package/src/lib/components/table/table.models.ts +26 -0
  186. package/src/lib/components/tag/index.ts +2 -0
  187. package/src/lib/components/tag/tag.component.html +12 -0
  188. package/src/lib/components/tag/tag.component.scss +33 -0
  189. package/src/lib/components/tag/tag.component.ts +83 -0
  190. package/src/lib/components/textarea/index.ts +1 -0
  191. package/src/lib/components/textarea/textarea.component.html +40 -0
  192. package/src/lib/components/textarea/textarea.component.scss +5 -0
  193. package/src/lib/components/textarea/textarea.component.spec.ts +21 -0
  194. package/src/lib/components/textarea/textarea.component.stories.ts +98 -0
  195. package/src/lib/components/textarea/textarea.component.ts +62 -0
  196. package/src/lib/components/textfield/index.ts +1 -0
  197. package/src/lib/components/textfield/textfield.component.html +82 -0
  198. package/src/lib/components/textfield/textfield.component.scss +23 -0
  199. package/src/lib/components/textfield/textfield.component.spec.ts +21 -0
  200. package/src/lib/components/textfield/textfield.component.stories.ts +85 -0
  201. package/src/lib/components/textfield/textfield.component.ts +68 -0
  202. package/src/lib/components/tooltip/index.ts +1 -0
  203. package/src/lib/components/tooltip/tooltip.component.html +3 -0
  204. package/src/lib/components/tooltip/tooltip.component.ts +17 -0
  205. package/src/lib/icons.ts +36 -0
  206. package/src/lib/interceptors/http-error-message.interceptor.ts +35 -0
  207. package/src/lib/pages/not-found-page/not-found-page.component.html +26 -0
  208. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  209. package/src/lib/pages/not-found-page/not-found-page.component.spec.ts +21 -0
  210. package/src/lib/pages/not-found-page/not-found-page.component.ts +16 -0
  211. package/src/tab-view.ts +1 -0
  212. package/src/test-setup.ts +8 -0
  213. package/tsconfig.json +29 -0
  214. package/tsconfig.lib.json +18 -0
  215. package/tsconfig.lib.prod.json +9 -0
  216. package/tsconfig.spec.json +16 -0
  217. package/fesm2022/verisoft-ui-primeng.mjs +0 -2866
  218. package/fesm2022/verisoft-ui-primeng.mjs.map +0 -1
  219. package/index.d.ts +0 -729
@@ -0,0 +1,98 @@
1
+ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
2
+ import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
3
+ import { TextareaComponent } from './textarea.component';
4
+
5
+ const meta: Meta<TextareaComponent> = {
6
+ component: TextareaComponent,
7
+ title: 'TextareaComponent',
8
+ decorators: [
9
+ moduleMetadata({
10
+ imports: [ReactiveFormsModule],
11
+ }),
12
+ ],
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<TextareaComponent>;
16
+ const formGroup = new FormGroup({
17
+ textarea: new FormControl(''),
18
+ });
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-textarea
29
+ formControlName="textarea"
30
+ [label]="label"
31
+ [rows]="rows"
32
+ [cols]="cols"
33
+ [disabled]="disabled"
34
+ [readonly]="readonly"
35
+ [required]="required"
36
+ [tooltip]="tooltip"
37
+ [placeholder]="placeholder"
38
+ [testId]="testId"
39
+ [formDisplay]="formDisplay"
40
+ [autoResize]="autoResize"
41
+ ></v-textarea>
42
+ </form>
43
+ `,
44
+ }),
45
+ args: {
46
+ label: 'Description',
47
+ rows: 5,
48
+ cols: 30,
49
+ formDisplay: 'block',
50
+ autoResize: false,
51
+ required: false,
52
+ disabled: false,
53
+ readonly: false,
54
+ placeholder:
55
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
56
+ testId: 'testId',
57
+ tooltip: 'This is a tooltip lorem ipsum',
58
+ },
59
+ argTypes: {
60
+ formDisplay: {
61
+ options: ['block', 'flex'],
62
+ control: { type: 'radio' },
63
+ description:
64
+ 'Defines if the **TextareaComponent** is in `flex` or `block` display mode',
65
+ },
66
+ label: {
67
+ description:
68
+ 'Label shown on the (top)left side of the **TextareaComponent** input',
69
+ },
70
+ rows: {
71
+ description: 'Number of `rows` of the **TextareaComponent** input',
72
+ },
73
+ cols: {
74
+ description: 'Number of `columns` of the **TextareaComponent** input',
75
+ },
76
+ tooltip: { description: 'Tooltip text of the **TextareaComponent**' },
77
+ required: {
78
+ description: 'Defines if the **TextareaComponent** is `required`',
79
+ },
80
+ autoResize: {
81
+ description:
82
+ 'Defines if the **TextareaComponent** should be auto-resized',
83
+ },
84
+ disabled: {
85
+ description: 'Defines if the **TextareaComponent** is `disabled`',
86
+ },
87
+ readonly: {
88
+ description: 'Defines if the **TextareaComponent** is `readonly`',
89
+ },
90
+ testId: { description: 'Test ID of the **TextareaComponent**' },
91
+ placeholder: {
92
+ description: 'Placeholder text for the **TextareaComponent**',
93
+ },
94
+ },
95
+ parameters: {
96
+ controls: { expanded: true },
97
+ },
98
+ };
@@ -0,0 +1,62 @@
1
+
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 { Textarea } from 'primeng/textarea';
17
+ import { ErrorComponent } from '../errors';
18
+ import { FormFieldComponent } from '../form-field/form-field.component';
19
+
20
+ @Component({
21
+ selector: 'v-textarea',
22
+ imports: [
23
+ Textarea,
24
+ ReactiveFormsModule,
25
+ FormFieldComponent,
26
+ FloatLabelModule,
27
+ ErrorComponent
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,82 @@
1
+ <div class="v-text-field">
2
+ @if (!floatLabel && label) {
3
+ <v-form-field
4
+ class="w-100"
5
+ [label]="label"
6
+ [tooltip]="tooltip"
7
+ [required]="isRequired()"
8
+ [testId]="testId"
9
+ [display]="formDisplay"
10
+ >
11
+ <span
12
+ class="w-100 flex-grow-1"
13
+ [ngClass]="{ 'p-input-icon-right': type === 'search' }"
14
+ >
15
+ <input
16
+ pInputText
17
+ [id]="inputId"
18
+ [formControl]="formControl"
19
+ [type]="type === 'search' ? 'text' : type"
20
+ class="w-100 flex-grow-1 v-text-field"
21
+ [required]="isRequired()"
22
+ [readOnly]="readonly"
23
+ [title]="label"
24
+ [placeholder]="placeholder ? placeholder : ''"
25
+ [ngClass]="{
26
+ 'p-inputtext-sm': size === 'small',
27
+ 'p-inputtext-lg': size === 'large'
28
+ }"
29
+ />
30
+ @if (type === 'search') {
31
+ <i
32
+ class="pi ms-2 v-text-field__icon"
33
+ [ngStyle]="{
34
+ cursor: ngControl && ngControl.value ? 'pointer' : 'default'
35
+ }"
36
+ [ngClass]="{
37
+ 'pi-search': ngControl && !ngControl.value,
38
+ 'pi-times': ngControl && ngControl.value,
39
+ }"
40
+ (click)="ngControl && ngControl.value ? ngControl.reset() : null"
41
+ ></i>
42
+ }
43
+ </span>
44
+ </v-form-field>
45
+ <v-validation-message [ngControl]="ngControl"></v-validation-message>
46
+ } @else {
47
+ <span
48
+ class="w-100 flex-grow-1"
49
+ [ngClass]="{ 'p-input-icon-right': type === 'search' }"
50
+ >
51
+ <p-floatLabel>
52
+ <input
53
+ pInputText
54
+ type="text"
55
+ [id]="inputId"
56
+ class="w-100 flex-grow-1"
57
+ [required]="isRequired()"
58
+ [formControl]="formControl"
59
+ [placeholder]="placeholder ? placeholder : ''"
60
+ [ngClass]="{
61
+ 'p-inputtext-sm': size === 'small',
62
+ 'p-inputtext-lg': size === 'large'
63
+ }"
64
+ />
65
+ <label [for]="inputId" class="v-text-field__label">{{ label }}</label>
66
+ </p-floatLabel>
67
+ @if (type === 'search') {
68
+ <i
69
+ class="pi ms-2 v-text-field__icon"
70
+ [ngStyle]="{
71
+ cursor: ngControl && ngControl.value ? 'pointer' : 'default'
72
+ }"
73
+ [ngClass]="{
74
+ 'pi-search': ngControl && !ngControl.value,
75
+ 'pi-times': ngControl && ngControl.value,
76
+ }"
77
+ (click)="ngControl && ngControl.value ? ngControl.reset() : null"
78
+ ></i>
79
+ }
80
+ </span>
81
+ }
82
+ </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,68 @@
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 { Icons } from '../../icons';
28
+ import { ErrorComponent } from '../errors';
29
+ import { FormFieldComponent } from '../form-field/form-field.component';
30
+
31
+ @Component({
32
+ selector: 'v-textfield',
33
+ imports: [
34
+ CommonModule,
35
+ InputTextModule,
36
+ ReactiveFormsModule,
37
+ FormFieldComponent,
38
+ FloatLabelModule,
39
+ ErrorComponent
40
+ ],
41
+ templateUrl: './textfield.component.html',
42
+ styleUrl: './textfield.component.scss',
43
+ changeDetection: ChangeDetectionStrategy.OnPush,
44
+ providers: [
45
+ {
46
+ provide: BaseInputControls,
47
+ useExisting: forwardRef(() => TextfieldComponent),
48
+ },
49
+ {
50
+ provide: TEXTFIELD_COMPONENT_TOKEN,
51
+ useExisting: TextfieldComponent,
52
+ },
53
+ ]
54
+ })
55
+ export class TextfieldComponent
56
+ extends BaseFormInputComponent
57
+ implements ControlValueAccessor, TextfieldCore
58
+ {
59
+ icons = Icons;
60
+
61
+ constructor(@Optional() @Self() ngControl: NgControl) {
62
+ super(ngControl);
63
+ }
64
+
65
+ @Input() size: FieldSizeType | undefined = FieldSize.medium;
66
+ @Input() type: FieldTypeType = FieldType.text;
67
+ @Input() floatLabel = false;
68
+ }
@@ -0,0 +1 @@
1
+ export * from './tooltip.component';
@@ -0,0 +1,3 @@
1
+ <div class="d-inline-block v-tooltip" [pTooltip]="tooltipText()" [tooltipPosition]="position()">
2
+ <ng-content></ng-content>
3
+ </div>
@@ -0,0 +1,17 @@
1
+ import { Component, input } from "@angular/core";
2
+ import { ControlSeverityType, FieldSizeType, PositionType, TooltipCore } from "@verisoft/ui-core";
3
+ import { TooltipModule } from "primeng/tooltip";
4
+
5
+ @Component({
6
+ selector: "v-tooltip",
7
+ templateUrl: './tooltip.component.html',
8
+ imports: [
9
+ TooltipModule,
10
+ ]
11
+ })
12
+ export class TooltipComponent implements TooltipCore {
13
+ color = input<ControlSeverityType | undefined>(undefined);
14
+ position = input<PositionType | undefined>(undefined);
15
+ size = input<FieldSizeType | undefined>(undefined);
16
+ tooltipText = input<string | undefined>(undefined);
17
+ }
@@ -0,0 +1,36 @@
1
+ import { CommonIcons } from '@verisoft/ui-core';
2
+
3
+ export const Icons: CommonIcons = {
4
+ add: 'pi pi-plus',
5
+ minus: 'pi pi-minus',
6
+ delete: 'pi pi-trash',
7
+ filter: 'pi pi-filter',
8
+ download: 'pi pi-download',
9
+ save: 'pi pi-save',
10
+ print: 'pi pi-print',
11
+ calendar: 'pi pi-calendar',
12
+ edit: 'pi pi-pencil',
13
+ settings: 'pi pi-cog',
14
+ house: 'pi pi-home',
15
+ chevronRight: 'pi pi-chevron-right',
16
+ chevronLeft: 'pi pi-chevron-left',
17
+ chevronDown: 'pi pi-chevron-down',
18
+ chevronUp: 'pi pi-chevron-up',
19
+ checkbox: 'pi pi-check',
20
+ warning: 'pi pi-exclamation-triangle',
21
+ search: 'pi pi-search',
22
+ action: 'pi pi-bars',
23
+ user: 'pi pi-user',
24
+ logout: 'pi pi-user',
25
+ crossCircle: 'pi pi-times-circle',
26
+ infoCircle: 'pi pi-info-circle',
27
+ cross: 'pi pi-times',
28
+ arrowLeft: 'pi pi-arrow-left',
29
+ arrowRight: 'pi pi-arrow-right',
30
+ questionCircle: 'pi pi-question-circle',
31
+ checkCircle: 'pi pi-check-circle',
32
+ sitemap: 'pi pi-sitemap',
33
+ check: 'pi pi-check',
34
+ envelope: 'pi pi-envelope',
35
+ loader: 'pi pi-loader',
36
+ };
@@ -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,26 @@
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
+ Sorry, the page you are looking for does not exist or has been moved.
6
+ </p>
7
+ <v-button
8
+ class="back-button"
9
+ size="small"
10
+ label="Take me back"
11
+ (click)="navigationBack()"
12
+ />
13
+ </div>
14
+ <div class="images">
15
+ <img
16
+ src="assets/images/_global/hafan.jpeg"
17
+ alt="Dog Image"
18
+ class="dog-image"
19
+ />
20
+ <img
21
+ src="assets/images/_global/bouda.png"
22
+ alt="House Image"
23
+ class="house-image"
24
+ />
25
+ </div>
26
+ </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,16 @@
1
+
2
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { ButtonComponent } from '../../components/button';
4
+
5
+ @Component({
6
+ selector: 'v-not-found-page',
7
+ imports: [ButtonComponent],
8
+ templateUrl: './not-found-page.component.html',
9
+ styleUrl: './not-found-page.component.scss',
10
+ changeDetection: ChangeDetectionStrategy.OnPush
11
+ })
12
+ export class NotFoundPageComponent {
13
+ navigationBack() {
14
+ history.back();
15
+ }
16
+ }
@@ -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
+ }