@verisoft/ui-primeng 20.1.0 → 20.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/fesm2022/verisoft-ui-primeng.mjs +3003 -0
  2. package/fesm2022/verisoft-ui-primeng.mjs.map +1 -0
  3. package/index.d.ts +752 -0
  4. package/package.json +18 -6
  5. package/.eslintrc.json +0 -43
  6. package/assets/.gitkeep +0 -0
  7. package/jest.config.ts +0 -22
  8. package/ng-package.json +0 -14
  9. package/project.json +0 -36
  10. package/src/index.ts +0 -34
  11. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -11
  12. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -18
  13. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
  14. package/src/lib/components/breadcrumb/breadcrumb.component.stories.ts +0 -36
  15. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -27
  16. package/src/lib/components/breadcrumb/breadcrumb.pipe.ts +0 -13
  17. package/src/lib/components/breadcrumb/index.ts +0 -1
  18. package/src/lib/components/button/button-severity.pipe.ts +0 -20
  19. package/src/lib/components/button/button.component.html +0 -20
  20. package/src/lib/components/button/button.component.scss +0 -0
  21. package/src/lib/components/button/button.component.spec.ts +0 -21
  22. package/src/lib/components/button/button.component.ts +0 -49
  23. package/src/lib/components/button/index.ts +0 -1
  24. package/src/lib/components/calendar/calendar.component.html +0 -53
  25. package/src/lib/components/calendar/calendar.component.scss +0 -0
  26. package/src/lib/components/calendar/calendar.component.spec.ts +0 -21
  27. package/src/lib/components/calendar/calendar.component.ts +0 -70
  28. package/src/lib/components/calendar/index.ts +0 -1
  29. package/src/lib/components/checkbox/checkbox.component.html +0 -20
  30. package/src/lib/components/checkbox/checkbox.component.scss +0 -15
  31. package/src/lib/components/checkbox/checkbox.component.spec.ts +0 -21
  32. package/src/lib/components/checkbox/checkbox.component.stories.ts +0 -72
  33. package/src/lib/components/checkbox/checkbox.component.ts +0 -46
  34. package/src/lib/components/checkbox/index.ts +0 -1
  35. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -51
  36. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -3
  37. package/src/lib/components/confirm-dialog/confirm-dialog.component.spec.ts +0 -21
  38. package/src/lib/components/confirm-dialog/confirm-dialog.component.stories.ts +0 -74
  39. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -73
  40. package/src/lib/components/confirm-dialog/index.ts +0 -1
  41. package/src/lib/components/dropdown/dropdown.component.html +0 -93
  42. package/src/lib/components/dropdown/dropdown.component.scss +0 -16
  43. package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
  44. package/src/lib/components/dropdown/dropdown.component.ts +0 -139
  45. package/src/lib/components/dropdown/index.ts +0 -1
  46. package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -1
  47. package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -20
  48. package/src/lib/components/dropdown-button/index.ts +0 -1
  49. package/src/lib/components/errors/error.component.html +0 -7
  50. package/src/lib/components/errors/error.component.scss +0 -3
  51. package/src/lib/components/errors/error.component.ts +0 -34
  52. package/src/lib/components/errors/index.ts +0 -1
  53. package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +0 -32
  54. package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +0 -8
  55. package/src/lib/components/feature-list/feature-list-filter.pipe.ts +0 -21
  56. package/src/lib/components/feature-list/feature-list-page.component.ts +0 -32
  57. package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
  58. package/src/lib/components/feature-list/feature-list.component.html +0 -59
  59. package/src/lib/components/feature-list/feature-list.component.scss +0 -10
  60. package/src/lib/components/feature-list/feature-list.component.ts +0 -341
  61. package/src/lib/components/feature-list/index.ts +0 -5
  62. package/src/lib/components/filter/directives/filter-field.directive.ts +0 -34
  63. package/src/lib/components/filter/filter.component.html +0 -68
  64. package/src/lib/components/filter/filter.component.scss +0 -0
  65. package/src/lib/components/filter/filter.component.spec.ts +0 -21
  66. package/src/lib/components/filter/filter.component.stories.ts +0 -23
  67. package/src/lib/components/filter/filter.component.ts +0 -281
  68. package/src/lib/components/filter/filter.model.ts +0 -18
  69. package/src/lib/components/filter/index.ts +0 -2
  70. package/src/lib/components/form-field/form-field.component.html +0 -42
  71. package/src/lib/components/form-field/form-field.component.scss +0 -0
  72. package/src/lib/components/form-field/form-field.component.spec.ts +0 -21
  73. package/src/lib/components/form-field/form-field.component.stories.ts +0 -69
  74. package/src/lib/components/form-field/form-field.component.ts +0 -37
  75. package/src/lib/components/form-field/index.ts +0 -1
  76. package/src/lib/components/header/header.component.html +0 -84
  77. package/src/lib/components/header/header.component.scss +0 -0
  78. package/src/lib/components/header/header.component.spec.ts +0 -21
  79. package/src/lib/components/header/header.component.stories.ts +0 -24
  80. package/src/lib/components/header/header.component.ts +0 -65
  81. package/src/lib/components/header/index.ts +0 -2
  82. package/src/lib/components/header/services/header-provider.service.ts +0 -15
  83. package/src/lib/components/icon/icon.component.html +0 -2
  84. package/src/lib/components/icon/icon.component.scss +0 -51
  85. package/src/lib/components/icon/icon.component.ts +0 -86
  86. package/src/lib/components/icon/index.ts +0 -2
  87. package/src/lib/components/input-group/index.ts +0 -1
  88. package/src/lib/components/input-group/input-group.component.html +0 -34
  89. package/src/lib/components/input-group/input-group.component.spec.ts +0 -21
  90. package/src/lib/components/input-group/input-group.component.ts +0 -58
  91. package/src/lib/components/loader/index.ts +0 -1
  92. package/src/lib/components/loader/loader.component.html +0 -5
  93. package/src/lib/components/loader/loader.component.scss +0 -0
  94. package/src/lib/components/loader/loader.component.spec.ts +0 -21
  95. package/src/lib/components/loader/loader.component.ts +0 -16
  96. package/src/lib/components/multiselect/index.ts +0 -1
  97. package/src/lib/components/multiselect/multiselect.component.html +0 -67
  98. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  99. package/src/lib/components/multiselect/multiselect.component.spec.ts +0 -21
  100. package/src/lib/components/multiselect/multiselect.component.ts +0 -120
  101. package/src/lib/components/number-input/index.ts +0 -1
  102. package/src/lib/components/number-input/number-input.component.html +0 -22
  103. package/src/lib/components/number-input/number-input.component.spec.ts +0 -21
  104. package/src/lib/components/number-input/number-input.component.ts +0 -55
  105. package/src/lib/components/page-header/index.ts +0 -1
  106. package/src/lib/components/page-header/page-header.component.html +0 -35
  107. package/src/lib/components/page-header/page-header.component.scss +0 -0
  108. package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
  109. package/src/lib/components/page-header/page-header.component.ts +0 -31
  110. package/src/lib/components/password/index.ts +0 -1
  111. package/src/lib/components/password/password.component.html +0 -24
  112. package/src/lib/components/password/password.component.scss +0 -0
  113. package/src/lib/components/password/password.component.spec.ts +0 -21
  114. package/src/lib/components/password/password.component.ts +0 -56
  115. package/src/lib/components/radiobutton/index.ts +0 -1
  116. package/src/lib/components/radiobutton/radiobutton.component.html +0 -34
  117. package/src/lib/components/radiobutton/radiobutton.component.scss +0 -6
  118. package/src/lib/components/radiobutton/radiobutton.component.spec.ts +0 -21
  119. package/src/lib/components/radiobutton/radiobutton.component.stories.ts +0 -71
  120. package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
  121. package/src/lib/components/section/index.ts +0 -1
  122. package/src/lib/components/section/section.component.html +0 -25
  123. package/src/lib/components/section/section.component.scss +0 -0
  124. package/src/lib/components/section/section.component.spec.ts +0 -21
  125. package/src/lib/components/section/section.component.ts +0 -31
  126. package/src/lib/components/shared-components/.eslintrc.json +0 -42
  127. package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +0 -25
  128. package/src/lib/components/shared-components/action-button-group/action-button-group.component.scss +0 -0
  129. package/src/lib/components/shared-components/action-button-group/action-button-group.component.spec.ts +0 -21
  130. package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +0 -111
  131. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +0 -10
  132. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.scss +0 -0
  133. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.spec.ts +0 -21
  134. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +0 -69
  135. package/src/lib/components/shared-components/action-button-group/index.ts +0 -2
  136. package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +0 -142
  137. package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +0 -56
  138. package/src/lib/components/shared-components/dynamic-component/index.ts +0 -2
  139. package/src/lib/components/shared-components/generic-field/generic-field.component.html +0 -98
  140. package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +0 -21
  141. package/src/lib/components/shared-components/generic-field/generic-field.component.ts +0 -90
  142. package/src/lib/components/shared-components/generic-field/index.ts +0 -1
  143. package/src/lib/components/shared-components/generic-form/generic-form.component.html +0 -46
  144. package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +0 -21
  145. package/src/lib/components/shared-components/generic-form/generic-form.component.ts +0 -56
  146. package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +0 -82
  147. package/src/lib/components/shared-components/generic-form/generic-form.model.ts +0 -68
  148. package/src/lib/components/shared-components/generic-form/index.ts +0 -2
  149. package/src/lib/components/shared-components/index.ts +0 -4
  150. package/src/lib/components/side-menu/index.ts +0 -2
  151. package/src/lib/components/side-menu/side-menu.component.html +0 -53
  152. package/src/lib/components/side-menu/side-menu.component.scss +0 -0
  153. package/src/lib/components/side-menu/side-menu.component.spec.ts +0 -21
  154. package/src/lib/components/side-menu/side-menu.component.ts +0 -96
  155. package/src/lib/components/side-menu/side-menu.module.ts +0 -66
  156. package/src/lib/components/slider/index.ts +0 -1
  157. package/src/lib/components/slider/slider.component.html +0 -19
  158. package/src/lib/components/slider/slider.component.spec.ts +0 -21
  159. package/src/lib/components/slider/slider.component.ts +0 -56
  160. package/src/lib/components/snackbar/index.ts +0 -2
  161. package/src/lib/components/snackbar/services/snackbar.service.ts +0 -45
  162. package/src/lib/components/snackbar/snackbar.component.html +0 -3
  163. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  164. package/src/lib/components/snackbar/snackbar.component.spec.ts +0 -21
  165. package/src/lib/components/snackbar/snackbar.component.stories.ts +0 -70
  166. package/src/lib/components/snackbar/snackbar.component.ts +0 -25
  167. package/src/lib/components/stepper/index.ts +0 -1
  168. package/src/lib/components/stepper/stepper.component.html +0 -35
  169. package/src/lib/components/stepper/stepper.component.spec.ts +0 -21
  170. package/src/lib/components/stepper/stepper.component.ts +0 -39
  171. package/src/lib/components/switch/index.ts +0 -1
  172. package/src/lib/components/switch/switch.component.html +0 -18
  173. package/src/lib/components/switch/switch.component.scss +0 -0
  174. package/src/lib/components/switch/switch.component.spec.ts +0 -21
  175. package/src/lib/components/switch/switch.component.stories.ts +0 -65
  176. package/src/lib/components/switch/switch.component.ts +0 -52
  177. package/src/lib/components/tab-view/index.ts +0 -2
  178. package/src/lib/components/tab-view/tab-view-item.component.ts +0 -22
  179. package/src/lib/components/tab-view/tab-view.component.html +0 -41
  180. package/src/lib/components/tab-view/tab-view.component.ts +0 -55
  181. package/src/lib/components/table/index.ts +0 -1
  182. package/src/lib/components/table/table-filter.pipe.ts +0 -59
  183. package/src/lib/components/table/table.component.html +0 -127
  184. package/src/lib/components/table/table.component.scss +0 -11
  185. package/src/lib/components/table/table.component.spec.ts +0 -21
  186. package/src/lib/components/table/table.component.stories.ts +0 -55
  187. package/src/lib/components/table/table.component.ts +0 -288
  188. package/src/lib/components/table/table.models.ts +0 -26
  189. package/src/lib/components/tag/index.ts +0 -2
  190. package/src/lib/components/tag/tag.component.html +0 -12
  191. package/src/lib/components/tag/tag.component.scss +0 -33
  192. package/src/lib/components/tag/tag.component.ts +0 -83
  193. package/src/lib/components/textarea/index.ts +0 -1
  194. package/src/lib/components/textarea/textarea.component.html +0 -40
  195. package/src/lib/components/textarea/textarea.component.scss +0 -5
  196. package/src/lib/components/textarea/textarea.component.spec.ts +0 -21
  197. package/src/lib/components/textarea/textarea.component.stories.ts +0 -98
  198. package/src/lib/components/textarea/textarea.component.ts +0 -62
  199. package/src/lib/components/textfield/index.ts +0 -1
  200. package/src/lib/components/textfield/textfield.component.html +0 -82
  201. package/src/lib/components/textfield/textfield.component.scss +0 -23
  202. package/src/lib/components/textfield/textfield.component.spec.ts +0 -21
  203. package/src/lib/components/textfield/textfield.component.stories.ts +0 -85
  204. package/src/lib/components/textfield/textfield.component.ts +0 -68
  205. package/src/lib/components/tooltip/index.ts +0 -1
  206. package/src/lib/components/tooltip/tooltip.component.html +0 -3
  207. package/src/lib/components/tooltip/tooltip.component.ts +0 -17
  208. package/src/lib/icons.ts +0 -36
  209. package/src/lib/interceptors/http-error-message.interceptor.ts +0 -35
  210. package/src/lib/pages/not-found-page/not-found-page.component.html +0 -26
  211. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  212. package/src/lib/pages/not-found-page/not-found-page.component.spec.ts +0 -21
  213. package/src/lib/pages/not-found-page/not-found-page.component.ts +0 -16
  214. package/src/tab-view.ts +0 -1
  215. package/src/test-setup.ts +0 -8
  216. package/tsconfig.json +0 -29
  217. package/tsconfig.lib.json +0 -18
  218. package/tsconfig.lib.prod.json +0 -9
  219. package/tsconfig.spec.json +0 -16
@@ -1,70 +0,0 @@
1
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2
- import { ActivatedRoute } from '@angular/router';
3
- import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
4
- import { MessageService } from 'primeng/api';
5
- import { ToastModule } from 'primeng/toast';
6
- import { ButtonComponent } from '../button/button.component';
7
- import { SnackbarService } from './services/snackbar.service';
8
- import { SnackbarComponent } from './snackbar.component';
9
-
10
- const meta: Meta<SnackbarComponent> = {
11
- component: SnackbarComponent,
12
- title: 'SnackbarComponent',
13
- decorators: [
14
- moduleMetadata({
15
- imports: [ButtonComponent, BrowserAnimationsModule, ToastModule],
16
- providers: [
17
- MessageService,
18
- SnackbarService,
19
- {
20
- provide: ActivatedRoute,
21
- useValue: {},
22
- },
23
- ],
24
- }),
25
- ],
26
- };
27
-
28
- export default meta;
29
- type Story = StoryObj<SnackbarComponent>;
30
- const messageService = new MessageService();
31
- const snackbarService = new SnackbarService(messageService);
32
-
33
- export const Primary: Story = {
34
- render: () => {
35
- return {
36
- props: {
37
- showSuccess: () => snackbarService.showSuccess('Snackbar works!'),
38
- showInfo: () => snackbarService.showInfo('Snackbar works!'),
39
- showWarn: () => snackbarService.showWarn('Snackbar works!'),
40
- showError: () => snackbarService.showError('Snackbar works!'),
41
- },
42
- template: `
43
- <v-snackbar class="mt-2" />
44
- <div class="d-flex gap-3 mt-2">
45
- <v-button
46
- label="Show Success"
47
- severity="success"
48
- (click)='showSuccess()'
49
- ></v-button>
50
- <v-button
51
- label="Show Info"
52
- severity="info"
53
- (click)='showInfo()'
54
- ></v-button>
55
- <v-button
56
- label="Show Warn"
57
- severity="warn"
58
- (click)='showWarn()'
59
- ></v-button>
60
- <v-button
61
- label="Show Error"
62
- severity="danger"
63
- (click)='showError()'
64
- ></v-button>
65
- </div>
66
- `,
67
- };
68
- },
69
- args: {},
70
- };
@@ -1,25 +0,0 @@
1
-
2
- import { Component } from '@angular/core';
3
- import { SNACKBAR_COMPONENT_TOKEN, SnackbarCore } from '@verisoft/ui-core';
4
- import { RippleModule } from 'primeng/ripple';
5
- import { ToastModule } from 'primeng/toast';
6
- import { SnackbarService } from './services/snackbar.service';
7
-
8
- @Component({
9
- selector: 'v-snackbar',
10
- imports: [ToastModule, RippleModule],
11
- templateUrl: './snackbar.component.html',
12
- styleUrl: './snackbar.component.scss',
13
- providers: [
14
- SnackbarService,
15
- {
16
- provide: SNACKBAR_COMPONENT_TOKEN,
17
- useExisting: SnackbarComponent,
18
- },
19
- ]
20
- })
21
- export class SnackbarComponent
22
- implements SnackbarCore
23
- {
24
- constructor(private snackbarService: SnackbarService) {}
25
- }
@@ -1 +0,0 @@
1
- export * from './stepper.component';
@@ -1,35 +0,0 @@
1
- <div class="v-stepper">
2
- <p-stepper>
3
- <p-step-list>
4
- @for(item of items; track item; let idx = $index) {
5
- <p-step [value]="idx">{{ item.header }}</p-step>
6
- }
7
- </p-step-list>
8
- <p-step-panels>
9
- @for(item of items; track item; let idx = $index) {
10
- <p-step-panel [value]="idx">
11
- <ng-template pTemplate="content" let-nextCallback="nextCallback" let-prevCallback="prevCallback"
12
- let-index="index">
13
- @if (item.template && item.template.elementRef) {
14
- <ng-template *ngTemplateOutlet="
15
- item.template;
16
- context: { item: item, index: index }
17
- " />
18
- }
19
- <div class="d-flex pt-4 justify-content-between">
20
- @if (index > 0) {
21
- <v-button label="Back" [icon]="icons.arrowLeft" size="small" [outlined]="true"
22
- (click)="prevCallback.emit()" />
23
- }
24
-
25
- @if (index < items.length - 1) {
26
- <v-button label="Next" size="small" [icon]="icons.arrowRight"
27
- iconPos="right" (click)="nextCallback.emit()" />
28
- }
29
- </div>
30
- </ng-template>
31
- </p-step-panel>
32
- }
33
- </p-step-panels>
34
- </p-stepper>
35
- </div>
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { StepperComponent } from './stepper.component';
3
-
4
- describe('StepperComponent', () => {
5
- let component: StepperComponent;
6
- let fixture: ComponentFixture<StepperComponent>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [StepperComponent],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(StepperComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,39 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
3
- import {
4
- StepperCore,
5
- STEPPER_COMPONENT_TOKEN,
6
- StepperItem,
7
- LayoutType,
8
- LayoutTypeType,
9
- FieldSizeType,
10
- FieldSize
11
- } from '@verisoft/ui-core';
12
- import { StepperModule } from 'primeng/stepper';
13
- import { Icons } from '../../icons';
14
- import { ButtonComponent } from '../button';
15
-
16
- @Component({
17
- selector: 'v-stepper',
18
- imports: [CommonModule, ButtonComponent, StepperModule],
19
- templateUrl: './stepper.component.html',
20
- changeDetection: ChangeDetectionStrategy.OnPush,
21
- providers: [
22
- { provide: STEPPER_COMPONENT_TOKEN, useExisting: StepperComponent },
23
- ]
24
- })
25
- export class StepperComponent
26
- implements StepperCore
27
- {
28
- @Input() items!: StepperItem[];
29
-
30
- icons = Icons;
31
- @Input() prefix!: string;
32
- @Input() label!: string;
33
- @Input() size: FieldSizeType | undefined = FieldSize.medium;
34
- @Input() layout: LayoutTypeType = LayoutType.horizontal;
35
- @Input() icon!: string;
36
- @Input() activeIndex = 0;
37
- @Input() annotation!: string;
38
- @Output() activeIndexChange = new EventEmitter<number>();
39
- }
@@ -1 +0,0 @@
1
- export * from './switch.component';
@@ -1,18 +0,0 @@
1
- <div class="v-switch d-flex align-items-center">
2
- <v-form-field
3
- class="w-100"
4
- [label]="label"
5
- [tooltip]="tooltip"
6
- [required]="isRequired()"
7
- [testId]="testId"
8
- [display]="formDisplay"
9
- >
10
- <p-toggle-switch
11
- [formControl]="formControl"
12
- [required]="isRequired()"
13
- [title]="label"
14
- [readonly]="readonly"
15
- [inputId]="id"
16
- /><v-validation-message [ngControl]="ngControl"></v-validation-message>
17
- </v-form-field>
18
- </div>
File without changes
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { SwitchComponent } from './switch.component';
3
-
4
- describe('SwitchComponent', () => {
5
- let component: SwitchComponent;
6
- let fixture: ComponentFixture<SwitchComponent>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [SwitchComponent],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(SwitchComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,65 +0,0 @@
1
- import {
2
- FormControl,
3
- FormGroup,
4
- ReactiveFormsModule,
5
- Validators,
6
- } from '@angular/forms';
7
- import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
8
- import { SwitchComponent } from './switch.component';
9
-
10
- const meta: Meta<SwitchComponent> = {
11
- component: SwitchComponent,
12
- title: 'SwitchComponent',
13
- decorators: [
14
- moduleMetadata({
15
- imports: [ReactiveFormsModule],
16
- }),
17
- ],
18
- };
19
- export default meta;
20
- type Story = StoryObj<SwitchComponent>;
21
- const formGroup = new FormGroup({
22
- switch: new FormControl(null),
23
- switchRequired: new FormControl(null, [Validators.requiredTrue]),
24
- });
25
- export const Primary: Story = {
26
- render: (args: any) => ({
27
- props: {
28
- ...args,
29
- formGroup: formGroup,
30
- },
31
- template: `
32
- <form [formGroup]="formGroup">
33
- <v-switch
34
- [disabled]="disabled"
35
- [readonly]="readonly"
36
- formControlName="switch"
37
- [required]="required"/>
38
- </form>`,
39
- }),
40
- args: {
41
- disabled: false,
42
- readonly: false,
43
- },
44
- };
45
-
46
- export const SwitchRequired: Story = {
47
- render: (args: any) => ({
48
- props: {
49
- ...args,
50
- formGroup: formGroup,
51
- },
52
- template: `
53
- <form [formGroup]="formGroup">
54
- <v-switch
55
- [disabled]="disabled"
56
- [readonly]="readonly"
57
- formControlName="switchRequired"
58
- [required]="required"/>
59
- </form>`,
60
- }),
61
- args: {
62
- disabled: false,
63
- readonly: false,
64
- },
65
- };
@@ -1,52 +0,0 @@
1
-
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- forwardRef,
6
- Optional,
7
- Self,
8
- } from '@angular/core';
9
- import {
10
- ControlValueAccessor,
11
- NgControl,
12
- ReactiveFormsModule,
13
- } from '@angular/forms';
14
- import { BaseFormInputComponent, BaseInputControls, SWITCH_COMPONENT_TOKEN, SwitchCore } from '@verisoft/ui-core';
15
- import { ToggleSwitch } from 'primeng/toggleswitch';
16
- import { v4 as uuidv4 } from 'uuid';
17
- import { ErrorComponent } from '../errors';
18
- import { FormFieldComponent } from '../form-field';
19
-
20
- @Component({
21
- selector: 'v-switch',
22
- imports: [
23
- ToggleSwitch,
24
- ReactiveFormsModule,
25
- FormFieldComponent,
26
- ErrorComponent
27
- ],
28
- templateUrl: './switch.component.html',
29
- styleUrl: './switch.component.scss',
30
- changeDetection: ChangeDetectionStrategy.OnPush,
31
- providers: [
32
- {
33
- provide: BaseInputControls,
34
- useExisting: forwardRef(() => SwitchComponent),
35
- multi: true,
36
- },
37
- {
38
- provide: SWITCH_COMPONENT_TOKEN,
39
- useExisting: SwitchComponent,
40
- },
41
- ]
42
- })
43
- export class SwitchComponent
44
- extends BaseFormInputComponent
45
- implements ControlValueAccessor, SwitchCore
46
- {
47
- constructor(@Optional() @Self() ngControl: NgControl) {
48
- super(ngControl);
49
- }
50
-
51
- id = uuidv4();
52
- }
@@ -1,2 +0,0 @@
1
- export * from './tab-view.component';
2
- export * from './tab-view-item.component';
@@ -1,22 +0,0 @@
1
- import { Component, Input, TemplateRef, ViewChild } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'v-tab-view-item',
5
- template: `<ng-template #contentTemplate>
6
- <ng-content></ng-content>
7
- </ng-template>`,
8
-
9
- })
10
- export class TabViewItemComponent {
11
- @ViewChild('contentTemplate', { static: true }) contentTemplate!: TemplateRef<any>;
12
-
13
- @Input() title!: string;
14
-
15
- @Input() url?: string;
16
-
17
- @Input() icon?: string;
18
-
19
- @Input() disabled?: boolean;
20
-
21
- @Input() content?: string;
22
- }
@@ -1,41 +0,0 @@
1
- <div class="v-tab-view">
2
- @if (useRouting) {
3
- <p-tabs [value]="activeIndex">
4
- <p-tablist>
5
- @for(tab of mergedItems; track tab.url; let index = $index){
6
- <p-tab [value]="index" [routerLink]="tab.url" (valueChange)="activeItemChanged(index)">
7
- @if (tab.icon) {
8
- <i [class]="tab.icon"></i>
9
- }
10
- <span>{{ tab.title }}</span>
11
- </p-tab>
12
- }
13
- </p-tablist>
14
- </p-tabs>
15
- <router-outlet></router-outlet>
16
- } @else {
17
- <p-tabs [value]="activeIndex">
18
- <p-tablist>
19
- @for (tab of mergedItems; track tab; let index = $index) {
20
- <p-tab [value]="index" (valueChange)="activeItemChanged(index)">
21
- @if (tab.icon) {
22
- <i [class]="tab.icon"></i>
23
- }
24
- <span>{{ tab.title }}</span>
25
- </p-tab>
26
- }
27
- </p-tablist>
28
- <p-tabpanels>
29
- @for (tab of mergedItems; track tab; let index = $index) {
30
- <p-tabpanel [value]="index">
31
- @if (tab.contentTemplate){
32
- <ng-container *ngTemplateOutlet="tab.contentTemplate"></ng-container>
33
- } @else if (tab.content) {
34
- {{ tab.content }}
35
- }
36
- </p-tabpanel>
37
- }
38
- </p-tabpanels>
39
- </p-tabs>
40
- }
41
- </div>
@@ -1,55 +0,0 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import {
3
- AfterContentInit,
4
- Component,
5
- ContentChildren,
6
- EventEmitter,
7
- Input,
8
- Output,
9
- QueryList,
10
- } from '@angular/core';
11
- import { RouterLink, RouterOutlet } from '@angular/router';
12
- import { TAB_VIEW_COMPONENT_TOKEN, TabViewCore, TabViewItemCore } from '@verisoft/ui-core';
13
- import { MenuItem } from 'primeng/api';
14
- import { TabsModule } from 'primeng/tabs';
15
- import { TabViewItemComponent } from './tab-view-item.component';
16
- @Component({
17
- selector: 'v-tab-view',
18
- templateUrl: './tab-view.component.html',
19
- imports: [RouterOutlet, RouterLink, TabsModule, NgTemplateOutlet],
20
- providers: [
21
- { provide: TAB_VIEW_COMPONENT_TOKEN, useExisting: TabViewComponent }],
22
-
23
- })
24
- export class TabViewComponent
25
- implements AfterContentInit, TabViewCore {
26
- @ContentChildren(TabViewItemComponent)
27
- children!: QueryList<TabViewItemComponent>;
28
-
29
- @Input() items: TabViewItemCore[] = [];
30
-
31
- @Input() useRouting = false;
32
-
33
- @Input() activeIndex = 0;
34
-
35
- @Output() activeIndexChange = new EventEmitter<number>();
36
-
37
- mergedItems: TabViewItemCore[] = [];
38
-
39
- ngAfterContentInit(): void {
40
- this.mergedItems = [...this.items, ...this.children.toArray()];
41
- }
42
-
43
- protected activeItemChanged(item: MenuItem | number): void {
44
- let index: number;
45
- if (typeof item === 'number') {
46
- index = item;
47
- } else {
48
- index = this.items.indexOf(item as TabViewItemCore);
49
- }
50
-
51
- if (index != -1) {
52
- this.activeIndexChange.emit(index);
53
- }
54
- }
55
- }
@@ -1 +0,0 @@
1
- export * from './table.component';
@@ -1,59 +0,0 @@
1
- import { Pipe, PipeTransform } from '@angular/core';
2
- import { FilterMetadata } from 'primeng/api';
3
-
4
- type PrimeNgFilterDefinition = {
5
- [s: string]: FilterMetadata | FilterMetadata[];
6
- };
7
-
8
- @Pipe({
9
- name: 'primengFilter',
10
- standalone: true,
11
- })
12
- export class TableFilterPipe<T> implements PipeTransform {
13
- transform(value: Partial<T>): PrimeNgFilterDefinition | undefined {
14
- if (value == undefined) {
15
- return undefined;
16
- }
17
-
18
- return Object.entries(value)
19
- .filter((x) => x[0] != undefined)
20
- .reduce((currentFilter: PrimeNgFilterDefinition, [key, value]) => {
21
- const filterValue = this.convertToFilterMetadata(value);
22
- if (filterValue) {
23
- if (key === 'searchField') {
24
- key = 'global';
25
- }
26
-
27
- currentFilter[key] = filterValue;
28
- }
29
-
30
- return currentFilter;
31
- }, {});
32
- }
33
-
34
- private convertToFilterMetadata(
35
- value: unknown
36
- ): FilterMetadata | FilterMetadata[] | undefined {
37
- if (value == undefined) {
38
- return undefined;
39
- }
40
-
41
- if (typeof value == 'string') {
42
- return {
43
- matchMode: 'contains',
44
- value: value,
45
- };
46
- }
47
-
48
- if (Array.isArray(value)) {
49
- return value.map((x) =>
50
- this.convertToFilterMetadata(x)
51
- ) as FilterMetadata[];
52
- }
53
-
54
- return {
55
- matchMode: 'equals',
56
- value: value,
57
- };
58
- }
59
- }
@@ -1,127 +0,0 @@
1
- <div class="v-table">
2
- <p-table
3
- #table
4
- class="v-table"
5
- [value]="tableRows"
6
- [filters]="filter | primengFilter"
7
- [paginator]="showPaginator"
8
- [rows]="pageSize"
9
- [totalRecords]="total"
10
- [loading]="loading"
11
- [lazy]="lazy"
12
- dataKey="id"
13
- [scrollable]="scrollable"
14
- [sortMode]="sortMultiple ? 'multiple' : 'single'"
15
- [scrollHeight]="'flex'"
16
- [selectionMode]="selectionMode"
17
- [selection]="tableSelection"
18
- [rowsPerPageOptions]="[10, 25, 50, 100]"
19
- [expandedRowKeys]="expandedRows"
20
- [showCurrentPageReport]="true"
21
- currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries"
22
- [customSort]="lazy"
23
- [multiSortMeta]="sortMeta"
24
- [resizableColumns]="true"
25
- columnResizeMode="expand"
26
- [globalFilterFields]="globalFilterFields"
27
- (onPage)="pageChanged($event)"
28
- (onSort)="sortChanged($event)"
29
- (selectionChange)="selectionChanged($event)"
30
- (onLazyLoad)="fireLazyLoad($event)"
31
- >
32
- <ng-template pTemplate="header">
33
- <tr>
34
- @if (selectionMode === 'multiple') {
35
- <th>
36
- <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
37
- </th>
38
- } @for (column of tableColumns; track column; let index = $index) {
39
- @if (column.sortable) {
40
- <th
41
- pResizableColumn
42
- [pSortableColumn]="'row.' + column.id"
43
- [style.width]="column.width"
44
- >
45
- {{ column.headerGetter(column.id, index) }}
46
- <p-sortIcon [field]="'row.' + column.id"></p-sortIcon>
47
- </th>
48
- }
49
- @if (!column.sortable) {
50
- <th
51
- pResizableColumn
52
- [class.v-auto-cell]="column.template"
53
- [style.width]="column.width"
54
- >
55
- {{ column.headerGetter(column.id, index) }}
56
- </th>
57
- }
58
- } @if (rowDetailTemplate){
59
- <th></th>
60
- }
61
- </tr>
62
- </ng-template>
63
- <ng-template pTemplate="body" let-row let-expanded="expanded">
64
- <tr
65
- [pSelectableRow]="row"
66
- [pSelectableRowDisabled]="selectionMode !== 'single'"
67
- (dblclick)="
68
- router.navigate(['./' + row.row[entityKey ?? 'id']], {
69
- relativeTo: route
70
- })
71
- "
72
- >
73
- @if (selectionMode === 'multiple'){
74
- <td>
75
- <p-tableCheckbox [value]="row"></p-tableCheckbox>
76
- </td>
77
- }
78
- @for (cd of tableColumns; track cd; let index = $index) {
79
- <td
80
- [class]="cd.columnClass!"
81
- [class.v-auto-cell]="cd.template"
82
- >
83
- @if (cd.template) {
84
- <ng-container
85
- *ngTemplateOutlet="cd.template; context: { $implicit: row.row }"
86
- ></ng-container>
87
- }
88
- @if (!row.template) {
89
- <span
90
- [queryParams]="cd.queryParams ? cd.queryParams : undefined"
91
- [routerLink]="cd.routerLink ? cd.routerLink(row.row) : undefined"
92
- [innerHTML]="cd.valueGetter(row.row, index)"
93
- ></span>
94
- }
95
- </td>
96
- }
97
- @if (rowDetailTemplate){
98
- <td>
99
- <p-button
100
- type="button"
101
- pRipple
102
- severity="primary"
103
- [pRowToggler]="row"
104
- [text]="true"
105
- [rounded]="true"
106
- [plain]="true"
107
- [icon]="expanded ? icons.chevronDown : icons.chevronRight"
108
- />
109
- </td>
110
- }
111
- </tr>
112
- </ng-template>
113
- <ng-template pTemplate="rowexpansion" let-row>
114
- <tr>
115
- <td [attr.colspan]="tableColumns.length + 1">
116
- <ng-container
117
- class="w-100"
118
- *ngTemplateOutlet="
119
- expansionTemplate.template;
120
- context: { $implicit: row.row }
121
- "
122
- ></ng-container>
123
- </td>
124
- </tr>
125
- </ng-template>
126
- </p-table>
127
- </div>