@verisoft/ui-govcz 20.1.1 → 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 (244) hide show
  1. package/fesm2022/verisoft-ui-govcz.mjs +3770 -0
  2. package/fesm2022/verisoft-ui-govcz.mjs.map +1 -0
  3. package/index.d.ts +1013 -0
  4. package/package.json +19 -7
  5. package/.eslintrc.json +0 -60
  6. package/jest.config.ts +0 -21
  7. package/ng-package.json +0 -28
  8. package/project.json +0 -49
  9. package/src/config.d.ts +0 -10
  10. package/src/index.ts +0 -1
  11. package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -25
  12. package/src/lib/components/breadcrumb/breadcrumb.component.scss +0 -0
  13. package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +0 -21
  14. package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -28
  15. package/src/lib/components/breadcrumb/index.ts +0 -1
  16. package/src/lib/components/button/button.component.html +0 -28
  17. package/src/lib/components/button/button.component.scss +0 -21
  18. package/src/lib/components/button/button.component.ts +0 -77
  19. package/src/lib/components/button/index.ts +0 -1
  20. package/src/lib/components/calendar/calendar.component.html +0 -28
  21. package/src/lib/components/calendar/calendar.component.scss +0 -0
  22. package/src/lib/components/calendar/calendar.component.ts +0 -77
  23. package/src/lib/components/calendar/index.ts +0 -1
  24. package/src/lib/components/checkbox/checkbox.component.html +0 -23
  25. package/src/lib/components/checkbox/checkbox.component.scss +0 -0
  26. package/src/lib/components/checkbox/checkbox.component.ts +0 -61
  27. package/src/lib/components/checkbox/index.ts +0 -1
  28. package/src/lib/components/confirm-dialog/confirm-dialog.component.html +0 -50
  29. package/src/lib/components/confirm-dialog/confirm-dialog.component.scss +0 -4
  30. package/src/lib/components/confirm-dialog/confirm-dialog.component.ts +0 -79
  31. package/src/lib/components/confirm-dialog/index.ts +0 -1
  32. package/src/lib/components/dropdown/dropdown-item.component.html +0 -8
  33. package/src/lib/components/dropdown/dropdown-item.component.ts +0 -18
  34. package/src/lib/components/dropdown/dropdown.component.html +0 -91
  35. package/src/lib/components/dropdown/dropdown.component.scss +0 -108
  36. package/src/lib/components/dropdown/dropdown.component.spec.ts +0 -21
  37. package/src/lib/components/dropdown/dropdown.component.ts +0 -296
  38. package/src/lib/components/dropdown/dropdown.model.ts +0 -6
  39. package/src/lib/components/dropdown/index.ts +0 -1
  40. package/src/lib/components/dropdown-button/dropdown-button.component.html +0 -31
  41. package/src/lib/components/dropdown-button/dropdown-button.component.ts +0 -34
  42. package/src/lib/components/dropdown-button/index.ts +0 -1
  43. package/src/lib/components/errors/error.component.html +0 -11
  44. package/src/lib/components/errors/error.component.scss +0 -0
  45. package/src/lib/components/errors/error.component.spec.ts +0 -19
  46. package/src/lib/components/errors/error.component.ts +0 -29
  47. package/src/lib/components/errors/index.ts +0 -1
  48. package/src/lib/components/feature-list/directives/feature-list-column.directive.ts +0 -32
  49. package/src/lib/components/feature-list/directives/feature-list-filter-field.directive.ts +0 -8
  50. package/src/lib/components/feature-list/feature-list-filter.pipe.ts +0 -20
  51. package/src/lib/components/feature-list/feature-list-page.component.ts +0 -30
  52. package/src/lib/components/feature-list/feature-list-page.model.ts +0 -42
  53. package/src/lib/components/feature-list/feature-list.component.html +0 -67
  54. package/src/lib/components/feature-list/feature-list.component.scss +0 -10
  55. package/src/lib/components/feature-list/feature-list.component.ts +0 -360
  56. package/src/lib/components/feature-list/index.ts +0 -5
  57. package/src/lib/components/filter/directives/filter-field.directive.ts +0 -35
  58. package/src/lib/components/filter/filter.component.html +0 -78
  59. package/src/lib/components/filter/filter.component.scss +0 -32
  60. package/src/lib/components/filter/filter.component.spec.ts +0 -21
  61. package/src/lib/components/filter/filter.component.stories.ts +0 -23
  62. package/src/lib/components/filter/filter.component.ts +0 -286
  63. package/src/lib/components/filter/filter.model.ts +0 -18
  64. package/src/lib/components/filter/index.ts +0 -2
  65. package/src/lib/components/form-field/form-field.component.html +0 -14
  66. package/src/lib/components/form-field/form-field.component.scss +0 -0
  67. package/src/lib/components/form-field/form-field.component.spec.ts +0 -21
  68. package/src/lib/components/form-field/form-field.component.ts +0 -76
  69. package/src/lib/components/form-field/index.ts +0 -1
  70. package/src/lib/components/header/header.component.html +0 -122
  71. package/src/lib/components/header/header.component.scss +0 -0
  72. package/src/lib/components/header/header.component.ts +0 -90
  73. package/src/lib/components/header/index.ts +0 -1
  74. package/src/lib/components/icon/icon.component.html +0 -11
  75. package/src/lib/components/icon/icon.component.scss +0 -20
  76. package/src/lib/components/icon/icon.component.ts +0 -110
  77. package/src/lib/components/icon/index.ts +0 -2
  78. package/src/lib/components/index.ts +0 -37
  79. package/src/lib/components/input-group/index.ts +0 -1
  80. package/src/lib/components/input-group/input-group.component.html +0 -41
  81. package/src/lib/components/input-group/input-group.component.scss +0 -0
  82. package/src/lib/components/input-group/input-group.component.ts +0 -75
  83. package/src/lib/components/loader/index.ts +0 -1
  84. package/src/lib/components/loader/loader.component.html +0 -7
  85. package/src/lib/components/loader/loader.component.scss +0 -0
  86. package/src/lib/components/loader/loader.component.spec.ts +0 -21
  87. package/src/lib/components/loader/loader.component.ts +0 -33
  88. package/src/lib/components/multiselect/index.ts +0 -1
  89. package/src/lib/components/multiselect/multiselect.component.html +0 -21
  90. package/src/lib/components/multiselect/multiselect.component.scss +0 -0
  91. package/src/lib/components/multiselect/multiselect.component.spec.ts +0 -21
  92. package/src/lib/components/multiselect/multiselect.component.ts +0 -117
  93. package/src/lib/components/number-input/index.ts +0 -1
  94. package/src/lib/components/number-input/number-input.component.html +0 -48
  95. package/src/lib/components/number-input/number-input.component.scss +0 -0
  96. package/src/lib/components/number-input/number-input.component.ts +0 -80
  97. package/src/lib/components/page-header/index.ts +0 -1
  98. package/src/lib/components/page-header/page-header.component.html +0 -3
  99. package/src/lib/components/page-header/page-header.component.scss +0 -11
  100. package/src/lib/components/page-header/page-header.component.spec.ts +0 -21
  101. package/src/lib/components/page-header/page-header.component.ts +0 -27
  102. package/src/lib/components/password/index.ts +0 -1
  103. package/src/lib/components/password/password.component.html +0 -31
  104. package/src/lib/components/password/password.component.scss +0 -0
  105. package/src/lib/components/password/password.component.spec.ts +0 -21
  106. package/src/lib/components/password/password.component.ts +0 -83
  107. package/src/lib/components/radiobutton/index.ts +0 -1
  108. package/src/lib/components/radiobutton/radiobutton.component.html +0 -23
  109. package/src/lib/components/radiobutton/radiobutton.component.scss +0 -0
  110. package/src/lib/components/radiobutton/radiobutton.component.ts +0 -61
  111. package/src/lib/components/search/index.ts +0 -1
  112. package/src/lib/components/search/search.component.html +0 -23
  113. package/src/lib/components/search/search.component.scss +0 -0
  114. package/src/lib/components/search/search.component.ts +0 -45
  115. package/src/lib/components/section/index.ts +0 -1
  116. package/src/lib/components/section/section.component.html +0 -26
  117. package/src/lib/components/section/section.component.scss +0 -0
  118. package/src/lib/components/section/section.component.ts +0 -55
  119. package/src/lib/components/shared-components/action-button-group/action-button-group.component.html +0 -25
  120. package/src/lib/components/shared-components/action-button-group/action-button-group.component.scss +0 -0
  121. package/src/lib/components/shared-components/action-button-group/action-button-group.component.spec.ts +0 -21
  122. package/src/lib/components/shared-components/action-button-group/action-button-group.component.ts +0 -111
  123. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.html +0 -10
  124. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.scss +0 -0
  125. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.spec.ts +0 -21
  126. package/src/lib/components/shared-components/action-button-group/components/action-button/action-button.component.ts +0 -69
  127. package/src/lib/components/shared-components/action-button-group/index.ts +0 -2
  128. package/src/lib/components/shared-components/dynamic-component/dynamic-component-factory.service.ts +0 -142
  129. package/src/lib/components/shared-components/dynamic-component/dynamic-component.component.ts +0 -56
  130. package/src/lib/components/shared-components/dynamic-component/index.ts +0 -2
  131. package/src/lib/components/shared-components/generic-field/generic-field.component.html +0 -98
  132. package/src/lib/components/shared-components/generic-field/generic-field.component.spec.ts +0 -21
  133. package/src/lib/components/shared-components/generic-field/generic-field.component.ts +0 -90
  134. package/src/lib/components/shared-components/generic-field/index.ts +0 -1
  135. package/src/lib/components/shared-components/generic-form/generic-form.component.html +0 -46
  136. package/src/lib/components/shared-components/generic-form/generic-form.component.spec.ts +0 -21
  137. package/src/lib/components/shared-components/generic-form/generic-form.component.ts +0 -56
  138. package/src/lib/components/shared-components/generic-form/generic-form.model.spec.ts +0 -82
  139. package/src/lib/components/shared-components/generic-form/generic-form.model.ts +0 -68
  140. package/src/lib/components/shared-components/generic-form/index.ts +0 -2
  141. package/src/lib/components/shared-components/index.ts +0 -4
  142. package/src/lib/components/side-menu/index.ts +0 -2
  143. package/src/lib/components/side-menu/side-menu.component.html +0 -22
  144. package/src/lib/components/side-menu/side-menu.component.scss +0 -17
  145. package/src/lib/components/side-menu/side-menu.component.ts +0 -42
  146. package/src/lib/components/side-menu/side-menu.module.ts +0 -56
  147. package/src/lib/components/snackbar/index.ts +0 -2
  148. package/src/lib/components/snackbar/services/snackbar.service.ts +0 -73
  149. package/src/lib/components/snackbar/snackbar.component.html +0 -14
  150. package/src/lib/components/snackbar/snackbar.component.scss +0 -0
  151. package/src/lib/components/snackbar/snackbar.component.spec.ts +0 -21
  152. package/src/lib/components/snackbar/snackbar.component.ts +0 -44
  153. package/src/lib/components/snackbar/snackbar.model.ts +0 -10
  154. package/src/lib/components/stepper/index.ts +0 -1
  155. package/src/lib/components/stepper/stepper.component.html +0 -35
  156. package/src/lib/components/stepper/stepper.component.scss +0 -9
  157. package/src/lib/components/stepper/stepper.component.ts +0 -60
  158. package/src/lib/components/switch/index.ts +0 -1
  159. package/src/lib/components/switch/switch.component.html +0 -16
  160. package/src/lib/components/switch/switch.component.scss +0 -0
  161. package/src/lib/components/switch/switch.component.ts +0 -39
  162. package/src/lib/components/tab-view/index.ts +0 -2
  163. package/src/lib/components/tab-view/tab-view-item.component.ts +0 -23
  164. package/src/lib/components/tab-view/tab-view.component.html +0 -51
  165. package/src/lib/components/tab-view/tab-view.component.scss +0 -43
  166. package/src/lib/components/tab-view/tab-view.component.ts +0 -64
  167. package/src/lib/components/tab-view/tab-view.module.ts +0 -25
  168. package/src/lib/components/table/index.ts +0 -1
  169. package/src/lib/components/table/table-pagination-info.component.html +0 -9
  170. package/src/lib/components/table/table-pagination-info.component.ts +0 -22
  171. package/src/lib/components/table/table.component.html +0 -199
  172. package/src/lib/components/table/table.component.scss +0 -192
  173. package/src/lib/components/table/table.component.ts +0 -390
  174. package/src/lib/components/table/table.model.ts +0 -17
  175. package/src/lib/components/table/table.models.ts +0 -12
  176. package/src/lib/components/tag/index.ts +0 -3
  177. package/src/lib/components/tag/tag.component.html +0 -12
  178. package/src/lib/components/tag/tag.component.scss +0 -4
  179. package/src/lib/components/tag/tag.component.ts +0 -44
  180. package/src/lib/components/tag/tag.model.ts +0 -7
  181. package/src/lib/components/textarea/index.ts +0 -1
  182. package/src/lib/components/textarea/textarea.component.html +0 -50
  183. package/src/lib/components/textarea/textarea.component.scss +0 -0
  184. package/src/lib/components/textarea/textarea.component.ts +0 -77
  185. package/src/lib/components/textfield/index.ts +0 -1
  186. package/src/lib/components/textfield/textfield.component.html +0 -34
  187. package/src/lib/components/textfield/textfield.component.scss +0 -0
  188. package/src/lib/components/textfield/textfield.component.ts +0 -112
  189. package/src/lib/components/tooltip/index.ts +0 -1
  190. package/src/lib/components/tooltip/tooltip.component.html +0 -9
  191. package/src/lib/components/tooltip/tooltip.component.ts +0 -19
  192. package/src/lib/icons.ts +0 -36
  193. package/src/lib/index.ts +0 -5
  194. package/src/lib/init.service.ts +0 -11
  195. package/src/lib/interceptors/http-error-message.interceptor.ts +0 -45
  196. package/src/lib/pages/bad-request-page/bad-request-page.component.html +0 -5
  197. package/src/lib/pages/bad-request-page/bad-request-page.component.scss +0 -0
  198. package/src/lib/pages/bad-request-page/bad-request-page.component.ts +0 -14
  199. package/src/lib/pages/error-page/error-page.component.html +0 -5
  200. package/src/lib/pages/error-page/error-page.component.scss +0 -0
  201. package/src/lib/pages/error-page/error-page.component.ts +0 -31
  202. package/src/lib/pages/error-page/error-page.constants.ts +0 -19
  203. package/src/lib/pages/index.ts +0 -3
  204. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.html +0 -5
  205. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.scss +0 -0
  206. package/src/lib/pages/internal-server-error-page/internal-server-error-page.component.ts +0 -15
  207. package/src/lib/pages/not-authenticated/index.ts +0 -1
  208. package/src/lib/pages/not-authenticated/not-authenticated.component.html +0 -5
  209. package/src/lib/pages/not-authenticated/not-authenticated.component.ts +0 -13
  210. package/src/lib/pages/not-authorized/index.ts +0 -1
  211. package/src/lib/pages/not-authorized/not-authorized.component.html +0 -5
  212. package/src/lib/pages/not-authorized/not-authorized.component.ts +0 -17
  213. package/src/lib/pages/not-found/index.ts +0 -1
  214. package/src/lib/pages/not-found/not-found.component.html +0 -5
  215. package/src/lib/pages/not-found/not-found.component.ts +0 -17
  216. package/src/lib/pages/not-found-page/not-found-page.component.html +0 -6
  217. package/src/lib/pages/not-found-page/not-found-page.component.scss +0 -0
  218. package/src/lib/pages/not-found-page/not-found-page.component.ts +0 -15
  219. package/src/lib/pipes/color/color.pipe.ts +0 -24
  220. package/src/lib/pipes/index.ts +0 -3
  221. package/src/lib/pipes/multiselect/multiselect-options.pipe.ts +0 -61
  222. package/src/lib/pipes/size/size.pipe.ts +0 -24
  223. package/src/test-setup.ts +0 -8
  224. package/tsconfig.json +0 -30
  225. package/tsconfig.lib.json +0 -17
  226. package/tsconfig.lib.prod.json +0 -9
  227. package/tsconfig.spec.json +0 -16
  228. /package/{src → styles}/sass/foundations/_colors.scss +0 -0
  229. /package/{src → styles}/sass/foundations/index.scss +0 -0
  230. /package/{src → styles}/sass/header.css +0 -0
  231. /package/{src → styles}/sass/header.scss +0 -0
  232. /package/{src → styles}/sass/integrations/_bootstrap.scss +0 -0
  233. /package/{src → styles}/sass/integrations/index.scss +0 -0
  234. /package/{src → styles}/sass/main.scss +0 -0
  235. /package/{src → styles}/sass/overrides/_gov.scss +0 -0
  236. /package/{src → styles}/sass/overrides/index.scss +0 -0
  237. /package/{src → styles}/sass/scrollbar.scss +0 -0
  238. /package/{src → styles}/sass/tokens/_theme-dark.scss +0 -0
  239. /package/{src → styles}/sass/tokens/_theme-light.scss +0 -0
  240. /package/{src → styles}/sass/tokens/index.scss +0 -0
  241. /package/{src → styles}/sass/utils/_table_filter.scss +0 -0
  242. /package/{src → styles}/sass/utils/_utils.scss +0 -0
  243. /package/{src → styles}/sass/utils/index.scss +0 -0
  244. /package/{src → styles}/sass/vendors/_bootstrap.scss +0 -0
@@ -1,69 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- EventEmitter,
5
- inject,
6
- Input,
7
- OnChanges,
8
- Output,
9
- SimpleChanges,
10
- } from '@angular/core';
11
- import {
12
- ACTION_BUTTON_GROUP_COMPONENT_TOKEN,
13
- ActionButton,
14
- ActionButtonGroupCore,
15
- ControlSeverityType,
16
- FieldSizeType,
17
- } from '@verisoft/ui-core';
18
- import { Observable, Subject } from 'rxjs';
19
- import { Icons } from '../../../../../icons';
20
- import { ButtonComponent } from '../../../../button';
21
-
22
- @Component({
23
- selector: 'v-action-button',
24
- imports: [ButtonComponent],
25
- templateUrl: './action-button.component.html',
26
- styleUrl: './action-button.component.scss',
27
- changeDetection: ChangeDetectionStrategy.OnPush
28
- })
29
- export class ActionButtonComponent implements ActionButton, OnChanges {
30
- @Input() disabled = false;
31
- @Input() toolTip?: string;
32
- @Input() id?: string;
33
- @Input() icon?: string;
34
- @Input() outlined = false;
35
- @Input() raised = false;
36
- @Input() severity?: ControlSeverityType;
37
- @Input() label?: string;
38
- @Input() size?: FieldSizeType;
39
- // eslint-disable-next-line @angular-eslint/no-output-native
40
- @Output() click = new EventEmitter<MouseEvent>();
41
-
42
- icons = Icons
43
-
44
- private propertyChangeSubject = new Subject();
45
-
46
- propertyChanged: Observable<unknown> =
47
- this.propertyChangeSubject.asObservable();
48
-
49
- buttonGroup: ActionButtonGroupCore | null = inject<ActionButtonGroupCore>(
50
- ACTION_BUTTON_GROUP_COMPONENT_TOKEN,
51
- {
52
- optional: true,
53
- }
54
- );
55
-
56
- ngOnChanges(changes: SimpleChanges): void {
57
- const isValueChange = Object.keys(changes).some(
58
- (x) => !changes[x].firstChange
59
- );
60
- if (isValueChange) {
61
- this.propertyChangeSubject.next(null);
62
- }
63
- }
64
-
65
- handleClick(event: MouseEvent) {
66
- event.stopPropagation();
67
- this.click.emit(event);
68
- }
69
- }
@@ -1,2 +0,0 @@
1
- export * from './action-button-group.component';
2
- export * from './components/action-button/action-button.component';
@@ -1,142 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import {
3
- Injectable,
4
- ViewContainerRef,
5
- Type,
6
- ComponentFactoryResolver,
7
- Injector,
8
- ComponentRef,
9
- ComponentFactory,
10
- OnChanges,
11
- SimpleChanges,
12
- SimpleChange,
13
- EventEmitter,
14
- OnDestroy,
15
- } from '@angular/core';
16
- import { ExtendedComponent } from '@verisoft/ui-core';
17
- import { Subscription } from 'rxjs';
18
-
19
- @Injectable({
20
- providedIn: 'root',
21
- })
22
- export class DynamicComponentFactoryService implements OnDestroy {
23
- constructor(private componentFactoryResolver: ComponentFactoryResolver) { }
24
-
25
- ngOnDestroy(): void {
26
- this.unsubscribeComponentEvents(this);
27
- }
28
-
29
- async createDynamicComponent<TComponent>(
30
- componentType: Type<TComponent>,
31
- viewContainerRef: ViewContainerRef,
32
- inputs: ExtendedComponent<TComponent>,
33
- injector: Injector | undefined = undefined
34
- ) {
35
- const componentFactory =
36
- this.componentFactoryResolver.resolveComponentFactory(componentType);
37
- viewContainerRef.clear();
38
- const component = viewContainerRef.createComponent(
39
- componentFactory,
40
- undefined,
41
- injector
42
- );
43
- this.setComponentDataInt(componentFactory, component, inputs);
44
- this.fireComponentEvents(component.instance, inputs);
45
- return component;
46
- }
47
-
48
- setComponentData<TComponent>(
49
- component: ComponentRef<TComponent>,
50
- inputs: Partial<TComponent>
51
- ) {
52
- const factory = this.componentFactoryResolver.resolveComponentFactory(
53
- component.componentType
54
- );
55
-
56
- this.setComponentDataInt(factory, component, inputs);
57
- }
58
-
59
- private unsubscribeComponentEvents<TComponent>(instance: TComponent) {
60
- const subscriptionStoreKey = '__outputSubscriptions__';
61
- const subscriptions = (instance as any)[subscriptionStoreKey] as Map<string, Subscription>;
62
-
63
- if (subscriptions) {
64
- subscriptions.forEach((sub) => sub.unsubscribe());
65
- subscriptions.clear();
66
- }
67
- }
68
-
69
- private fireComponentEvents<TComponent>(
70
- instance: TComponent,
71
- inputs: ExtendedComponent<TComponent>
72
- ) {
73
- if (!instance || typeof instance !== 'object') return;
74
-
75
- this.fireInputComponentEvents(instance, inputs);
76
- this.fireOutputComponentEvents(instance, inputs);
77
- }
78
-
79
- private setComponentDataInt<TComponent>(
80
- factory: ComponentFactory<TComponent>,
81
- component: ComponentRef<TComponent>,
82
- inputs: Partial<TComponent>
83
- ) {
84
- if (inputs) {
85
- const propertyNames = factory.inputs.map((x) => x.propName);
86
- const inputsHash = new Set(propertyNames);
87
- Object.keys(inputs)
88
- .filter((x) => inputsHash.has(x))
89
- .forEach((x) => {
90
- (<{ [key: string]: unknown }>component.instance)[x] = (<
91
- { [key: string]: unknown }
92
- >inputs)[x];
93
- });
94
- }
95
- }
96
-
97
- private fireInputComponentEvents<TComponent>(
98
- instance: TComponent,
99
- inputs: ExtendedComponent<TComponent>
100
- ) {
101
- const onChangeComponent = instance as unknown as OnChanges;
102
- if (onChangeComponent.ngOnChanges && inputs) {
103
- const changeEventArgs = Object.keys(inputs).reduce((changes: SimpleChanges, key: string) => {
104
- const inputValue = (inputs as { [key: string]: unknown })[key];
105
- changes[key] = new SimpleChange(undefined, inputValue, true);
106
- return changes;
107
- }, {} as SimpleChanges);
108
-
109
- onChangeComponent.ngOnChanges(changeEventArgs);
110
- }
111
- }
112
-
113
- private fireOutputComponentEvents<TComponent>(
114
- instance: TComponent & object,
115
- inputs: ExtendedComponent<TComponent>
116
- ) {
117
- const outputs = Object.keys(inputs).filter((key) => {
118
- const emitter = (instance as Record<string, any>)[key];
119
- return emitter instanceof EventEmitter;
120
- });
121
-
122
- const subscriptionStoreKey = '__outputSubscriptions__';
123
- if (!(subscriptionStoreKey in instance)) {
124
- (instance as any)[subscriptionStoreKey] = new Map<string, Subscription>();
125
- }
126
- const subscriptions = (instance as any)[subscriptionStoreKey] as Map<string, Subscription>;
127
-
128
- for (const outputKey of outputs) {
129
- const eventEmitter = (instance as Record<string, any>)[outputKey] as EventEmitter<any>;
130
- const callback = inputs[outputKey] as (value: any) => void;
131
-
132
- if (eventEmitter && typeof callback === 'function') {
133
- if (subscriptions.has(outputKey)) {
134
- subscriptions.get(outputKey)!.unsubscribe();
135
- }
136
-
137
- const subscription = eventEmitter.subscribe((value: any) => callback(value));
138
- subscriptions.set(outputKey, subscription);
139
- }
140
- }
141
- }
142
- }
@@ -1,56 +0,0 @@
1
- import {
2
- AfterViewInit,
3
- ChangeDetectionStrategy,
4
- ChangeDetectorRef,
5
- Component,
6
- inject,
7
- Injector,
8
- Input,
9
- OnChanges,
10
- Type,
11
- ViewChild,
12
- ViewContainerRef,
13
- } from '@angular/core';
14
- import { ExtendedComponent } from '@verisoft/ui-core';
15
- import { DynamicComponentFactoryService } from './dynamic-component-factory.service';
16
-
17
- @Component({
18
- selector: 'v-dynamic-component',
19
- standalone: true,
20
- changeDetection: ChangeDetectionStrategy.OnPush,
21
- template: `<ng-container #dynamicContainer></ng-container>`,
22
- })
23
- export class DynamicComponent<TComponent> implements AfterViewInit, OnChanges {
24
- @Input() componentType!: Type<TComponent>;
25
-
26
- @Input() data!: ExtendedComponent<TComponent>;
27
-
28
- @ViewChild('dynamicContainer', { read: ViewContainerRef, static: true })
29
- container!: ViewContainerRef;
30
-
31
- private factoryServices = inject(DynamicComponentFactoryService);
32
-
33
- private changeDetectorRef = inject(ChangeDetectorRef);
34
-
35
- private injector = inject(Injector);
36
-
37
- ngOnChanges(): void {
38
- this.createComponent();
39
- }
40
-
41
- ngAfterViewInit(): void {
42
- this.createComponent();
43
- this.changeDetectorRef.detectChanges();
44
- }
45
-
46
- private createComponent() {
47
- if (this.container) {
48
- this.factoryServices.createDynamicComponent(
49
- this.componentType,
50
- this.container,
51
- this.data,
52
- this.injector
53
- );
54
- }
55
- }
56
- }
@@ -1,2 +0,0 @@
1
- export * from './dynamic-component-factory.service';
2
- export * from './dynamic-component.component';
@@ -1,98 +0,0 @@
1
- @if (!type || type === fieldTypes.text) {
2
- <v-textfield
3
- [label]="label"
4
- [floatLabel]="floatLabel === true"
5
- [size]="size"
6
- [formControl]="formControl"
7
- />
8
- } @else if (type === fieldTypes.dropdown && !datasource) {
9
- <v-dropdown
10
- [label]="!floatLabel ? label : ''"
11
- [floatLabel]="floatLabel ? label : ''"
12
- [testId]="testId"
13
- [options]="options"
14
- [optionLabel]="optionLabel"
15
- [optionValue]="optionValue ?? optionLabel"
16
- [loading]="loading"
17
- [forceMinWidth]="true"
18
- [formControl]="formControl"
19
- [showFilter]="showFilter ?? false"
20
- [localSearch]="localSearch ?? false"
21
- (changeEvent)="changed.emit($event)"
22
- (clearEvent)="cleared.emit($event)"
23
- (lazyLoadEvent)="lazyLoad.emit($any($event))"
24
- (showEvent)="showed.emit($event)"
25
- />
26
- } @else if (type === fieldTypes.dropdown && datasource) {
27
- <v-dropdown
28
- useDatasource
29
- [forceMinWidth]="true"
30
- [datasource]="datasource"
31
- [optionLabel]="optionLabel"
32
- [optionValue]="optionValue ?? optionLabel"
33
- [label]="!floatLabel ? label : ''"
34
- [floatLabel]="floatLabel ? label : ''"
35
- [testId]="testId"
36
- [loading]="loading"
37
- [formControl]="formControl"
38
- [showFilter]="showFilter ?? false"
39
- [filterField]="filterField ?? 'fulltext'"
40
- [localSearch]="localSearch ?? false"
41
- (changeEvent)="changed.emit($event)"
42
- (clearEvent)="cleared.emit($event)"
43
- (lazyLoadEvent)="lazyLoad.emit($any($event))"
44
- (showEvent)="showed.emit($event)"
45
- />
46
- } @else if (type === fieldTypes.multiselect && !datasource) {
47
- <v-multiselect
48
- [label]="!floatLabel ? label : ''"
49
- [floatLabel]="floatLabel ? label : ''"
50
- [testId]="testId"
51
- [options]="options"
52
- [optionLabel]="optionLabel"
53
- [optionValue]="optionValue ?? optionLabel"
54
- [loading]="loading"
55
- [formControl]="formControl"
56
- (changeEvent)="changed.emit($event)"
57
- (clearEvent)="cleared.emit($event)"
58
- (lazyLoadEvent)="lazyLoad.emit($any($event))"
59
- (showEvent)="showed.emit($event)"
60
- />
61
- } @else if (type === fieldTypes.multiselect && datasource) {
62
- <v-multiselect
63
- useDatasource
64
- [datasource]="datasource"
65
- [optionLabel]="optionLabel"
66
- [optionValue]="optionValue ?? optionLabel"
67
- [label]="!floatLabel ? label : ''"
68
- [floatLabel]="floatLabel ? label : ''"
69
- [testId]="testId"
70
- [loading]="loading"
71
- [formControl]="formControl"
72
- (changeEvent)="changed.emit($event)"
73
- (clearEvent)="cleared.emit($event)"
74
- (lazyLoadEvent)="lazyLoad.emit($any($event))"
75
- (showEvent)="showed.emit($event)"
76
- />
77
- } @else if (type === fieldTypes.checkbox) {
78
- <v-checkbox
79
- [label]="label"
80
- [testId]="testId"
81
- [formControl]="formControl"
82
- [indeterminate]="true"
83
- />
84
- } @else if (type === fieldTypes.simplecheckbox) {
85
- <v-checkbox
86
- [label]="label"
87
- [testId]="testId"
88
- [formControl]="formControl"
89
- />
90
- } @else if (type === fieldTypes.calendar) {
91
- <v-calendar
92
- [label]="!floatLabel ? label : ''"
93
- [floatLabel]="floatLabel ? label : ''"
94
- [testId]="testId"
95
- [formControl]="formControl"
96
- [icon]="icons.calendar"
97
- />
98
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { GenericFieldComponent } from './generic-field.component';
3
-
4
- describe('GenericFieldComponent', () => {
5
- let component: GenericFieldComponent<string>;
6
- let fixture: ComponentFixture<GenericFieldComponent<string>>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [GenericFieldComponent],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(GenericFieldComponent<string>);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,90 +0,0 @@
1
-
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- EventEmitter,
6
- Input,
7
- Output,
8
- } from '@angular/core';
9
- import { ReactiveFormsModule } from '@angular/forms';
10
- import {
11
- DatasourceType,
12
- FilterEvent,
13
- LazyLoadEvent,
14
- } from '@verisoft/core';
15
- import {
16
- BaseFormInputComponent,
17
- DatasourceDirective,
18
- FieldSize,
19
- FieldSizeType,
20
- GENERIC_FIELD_COMPONENT_TOKEN,
21
- GenericFieldCore,
22
- GenericFieldType,
23
- GenericFieldTypeType,
24
- } from '@verisoft/ui-core';
25
- import { Icons } from '../../../icons';
26
- import { CalendarComponent } from '../../calendar';
27
- import { CheckboxComponent } from '../../checkbox';
28
- import { DropdownComponent } from '../../dropdown';
29
- import { MultiselectComponent } from '../../multiselect';
30
- import { TextfieldComponent } from '../../textfield';
31
-
32
- @Component({
33
- selector: 'v-generic-field',
34
- imports: [
35
- DropdownComponent,
36
- CalendarComponent,
37
- MultiselectComponent,
38
- TextfieldComponent,
39
- ReactiveFormsModule,
40
- CheckboxComponent,
41
- DatasourceDirective
42
- ],
43
- providers: [
44
- {
45
- provide: GENERIC_FIELD_COMPONENT_TOKEN,
46
- useExisting: GenericFieldComponent,
47
- },
48
- ],
49
- templateUrl: './generic-field.component.html',
50
- changeDetection: ChangeDetectionStrategy.OnPush
51
- })
52
- export class GenericFieldComponent<T>
53
- extends BaseFormInputComponent
54
- implements GenericFieldCore<T>
55
- {
56
- @Input() type?: GenericFieldTypeType = GenericFieldType.text;
57
-
58
- @Input() floatLabel?: boolean;
59
-
60
- @Input() optionLabel: string | undefined;
61
-
62
- @Input() optionValue: string | undefined;
63
-
64
- @Input() options: T[] | undefined;
65
-
66
- @Input() size?: FieldSizeType = FieldSize.medium;
67
-
68
- @Input() loading = false;
69
-
70
- @Input() lazy = false;
71
-
72
- @Input() filter = true;
73
-
74
- @Input() datasource?: DatasourceType<T>
75
-
76
- @Input() filterField?: string;
77
-
78
- @Input() showFilter?: boolean;
79
-
80
- @Input() localSearch?: boolean;
81
-
82
- @Output() changed = new EventEmitter<any>();
83
- @Output() showed = new EventEmitter<any>();
84
- @Output() cleared = new EventEmitter<any>();
85
- @Output() lazyLoad = new EventEmitter<LazyLoadEvent>();
86
- @Output() filtered = new EventEmitter<FilterEvent>();
87
-
88
- fieldTypes = GenericFieldType;
89
- icons = Icons;
90
- }
@@ -1 +0,0 @@
1
- export * from './generic-field.component';
@@ -1,46 +0,0 @@
1
- @if (formGroupComputed) {
2
- <div
3
- class="v-generic-form"
4
- [ngClass]="showAsRow ? 'd-flex flex-row' : 'row'"
5
- [formGroup]="formGroupComputed"
6
- >
7
- @for(field of fields; track field) { @if (columnClass) {
8
- <div class="v-generic-form__column {{ columnClass }}">
9
- <v-generic-field
10
- [type]="field.type"
11
- [label]="field.label ?? 'NOT SET' | translate"
12
- [floatLabel]="field.floatLabel"
13
- [testId]="field.testId"
14
- [options]="field.options"
15
- [optionLabel]="field.optionLabel"
16
- [optionValue]="field.optionValue ?? field.optionLabel"
17
- [options]="field.options"
18
- [size]="field.size"
19
- [formControlName]="field.name"
20
- [datasource]="field.datasource"
21
- [showFilter]="field.showFilter"
22
- [filterField]="field.filterField"
23
- [localSearch]="field.localSearch"
24
- ></v-generic-field>
25
- </div>
26
- } @else {
27
- <v-generic-field
28
- class="me-4"
29
- [type]="field.type"
30
- [label]="field.label ?? 'NOT SET' | translate"
31
- [floatLabel]="field.floatLabel"
32
- [testId]="field.testId"
33
- [options]="field.options"
34
- [optionLabel]="field.optionLabel"
35
- [optionValue]="field.optionValue ?? field.optionLabel"
36
- [options]="field.options"
37
- [size]="field.size"
38
- [formControlName]="field.name"
39
- [datasource]="field.datasource"
40
- [showFilter]="field.showFilter"
41
- [filterField]="field.filterField"
42
- [localSearch]="field.localSearch"
43
- ></v-generic-field>
44
- } }
45
- </div>
46
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
- import { GenericFormComponent } from './generic-form.component';
3
-
4
- describe('GenericFormComponent', () => {
5
- let component: GenericFormComponent;
6
- let fixture: ComponentFixture<GenericFormComponent>;
7
-
8
- beforeEach(async () => {
9
- await TestBed.configureTestingModule({
10
- imports: [GenericFormComponent],
11
- }).compileComponents();
12
-
13
- fixture = TestBed.createComponent(GenericFormComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });
@@ -1,56 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- Input,
6
- OnChanges,
7
- SimpleChanges,
8
- } from '@angular/core';
9
- import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
10
- import { TranslateModule } from '@ngx-translate/core';
11
- import { GenericFieldDefinition } from '@verisoft/ui-core';
12
- import { GenericFieldComponent } from '../generic-field';
13
- import {
14
- generateFormGroup,
15
- getColumnClass,
16
- } from './generic-form.model';
17
-
18
- @Component({
19
- selector: 'v-generic-form',
20
- imports: [
21
- CommonModule,
22
- GenericFieldComponent,
23
- ReactiveFormsModule,
24
- TranslateModule,
25
- ],
26
- templateUrl: './generic-form.component.html',
27
- changeDetection: ChangeDetectionStrategy.OnPush
28
- })
29
- export class GenericFormComponent implements OnChanges {
30
- @Input() formGroup?: UntypedFormGroup;
31
-
32
- @Input() fields?: GenericFieldDefinition[];
33
-
34
- @Input() columns?: number;
35
-
36
- @Input() showAsRow!: boolean;
37
-
38
- formGroupComputed!: UntypedFormGroup;
39
-
40
- columnClass?: string;
41
-
42
- ngOnChanges(changes: SimpleChanges): void {
43
- if (changes['fields'] || changes['formGroup']) {
44
- this.formGroupComputed = generateFormGroup(
45
- this.fields,
46
- this.formGroupComputed,
47
- this.formGroup,
48
- !!changes['formGroup']
49
- );
50
- }
51
-
52
- if (changes['columns']) {
53
- this.columnClass = getColumnClass(this.columns);
54
- }
55
- }
56
- }