@verisoft/ui-core 19.0.0-rc001 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +314 -3
  2. package/fesm2022/verisoft-ui-core.mjs +90 -82
  3. package/fesm2022/verisoft-ui-core.mjs.map +1 -1
  4. package/index.d.ts +1107 -6
  5. package/package.json +15 -18
  6. package/lib/common/angular-helper.d.ts +0 -1
  7. package/lib/common/constants.d.ts +0 -3
  8. package/lib/common/control.models.d.ts +0 -62
  9. package/lib/common/datasource-component.model.d.ts +0 -19
  10. package/lib/common/deactivate-guard.model.d.ts +0 -4
  11. package/lib/common/download-file.d.ts +0 -2
  12. package/lib/common/filter.d.ts +0 -1
  13. package/lib/common/icons.d.ts +0 -34
  14. package/lib/common/index.d.ts +0 -10
  15. package/lib/common/notificable-property.model.d.ts +0 -4
  16. package/lib/common/rxjs.d.ts +0 -2
  17. package/lib/components/action-button-group/action-button-group.model.d.ts +0 -12
  18. package/lib/components/action-button-group/action-button.model.d.ts +0 -14
  19. package/lib/components/action-button-group/index.d.ts +0 -2
  20. package/lib/components/base-form/base-form-input.component.d.ts +0 -30
  21. package/lib/components/base-form/base-form.component.d.ts +0 -50
  22. package/lib/components/base-form/directives/detail-store.directive.d.ts +0 -35
  23. package/lib/components/base-form/index.d.ts +0 -4
  24. package/lib/components/base-form/models/base-form-input.models.d.ts +0 -7
  25. package/lib/components/base-form/models/base-form.models.d.ts +0 -18
  26. package/lib/components/base-form/models/index.d.ts +0 -2
  27. package/lib/components/breadcrumb/breadcrumb.model.d.ts +0 -16
  28. package/lib/components/breadcrumb/breadcrumb.service.d.ts +0 -8
  29. package/lib/components/breadcrumb/breadcrumbcore.component.d.ts +0 -30
  30. package/lib/components/breadcrumb/index.d.ts +0 -3
  31. package/lib/components/button/button.model.d.ts +0 -17
  32. package/lib/components/button/index.d.ts +0 -1
  33. package/lib/components/calendar/calendar.model.d.ts +0 -12
  34. package/lib/components/calendar/index.d.ts +0 -1
  35. package/lib/components/checkbox/checkbox.model.d.ts +0 -6
  36. package/lib/components/checkbox/index.d.ts +0 -1
  37. package/lib/components/confirm-dialog/confirm-dialog.model.d.ts +0 -25
  38. package/lib/components/confirm-dialog/index.d.ts +0 -1
  39. package/lib/components/dropdown/dropdown.model.d.ts +0 -12
  40. package/lib/components/dropdown/index.d.ts +0 -1
  41. package/lib/components/dropdown-button/dropdown-button.model.d.ts +0 -14
  42. package/lib/components/dropdown-button/index.d.ts +0 -1
  43. package/lib/components/dynamic-component/dynamic-component.model.d.ts +0 -3
  44. package/lib/components/dynamic-component/index.d.ts +0 -1
  45. package/lib/components/filter/filter.model.d.ts +0 -13
  46. package/lib/components/filter/index.d.ts +0 -1
  47. package/lib/components/form-field/form-field.model.d.ts +0 -11
  48. package/lib/components/form-field/index.d.ts +0 -1
  49. package/lib/components/generic-field/generic-field.model.d.ts +0 -6
  50. package/lib/components/generic-field/index.d.ts +0 -1
  51. package/lib/components/generic-form/generic-form.component.d.ts +0 -30
  52. package/lib/components/generic-form/index.d.ts +0 -1
  53. package/lib/components/header/header.model.d.ts +0 -11
  54. package/lib/components/header/index.d.ts +0 -1
  55. package/lib/components/icons/icons.component.d.ts +0 -6
  56. package/lib/components/icons/icons.model.d.ts +0 -6
  57. package/lib/components/icons/index.d.ts +0 -2
  58. package/lib/components/index.d.ts +0 -35
  59. package/lib/components/input-group/index.d.ts +0 -1
  60. package/lib/components/input-group/input-group.model.d.ts +0 -12
  61. package/lib/components/loader/index.d.ts +0 -1
  62. package/lib/components/loader/loader.model.d.ts +0 -3
  63. package/lib/components/multiselect/index.d.ts +0 -1
  64. package/lib/components/multiselect/mutiselect.model.d.ts +0 -9
  65. package/lib/components/number-input/index.d.ts +0 -1
  66. package/lib/components/number-input/number-input.model.d.ts +0 -10
  67. package/lib/components/page-header/index.d.ts +0 -3
  68. package/lib/components/page-header/page-header.model.d.ts +0 -7
  69. package/lib/components/page-header/page-header.service.d.ts +0 -8
  70. package/lib/components/page-header/page-headercore.component.d.ts +0 -20
  71. package/lib/components/password/index.d.ts +0 -1
  72. package/lib/components/password/password.model.d.ts +0 -19
  73. package/lib/components/radiobutton/index.d.ts +0 -1
  74. package/lib/components/radiobutton/radiobutton.model.d.ts +0 -11
  75. package/lib/components/section/index.d.ts +0 -1
  76. package/lib/components/section/section.model.d.ts +0 -7
  77. package/lib/components/side-menu/directives/side-menu-service.directive.d.ts +0 -11
  78. package/lib/components/side-menu/index.d.ts +0 -4
  79. package/lib/components/side-menu/services/side-menu-provider.service.d.ts +0 -10
  80. package/lib/components/side-menu/services/side-menu.service.d.ts +0 -15
  81. package/lib/components/side-menu/side-menu.model.d.ts +0 -42
  82. package/lib/components/slider/index.d.ts +0 -1
  83. package/lib/components/slider/slider.model.d.ts +0 -9
  84. package/lib/components/snackbar/index.d.ts +0 -1
  85. package/lib/components/snackbar/snackbar.model.d.ts +0 -3
  86. package/lib/components/stepper/index.d.ts +0 -1
  87. package/lib/components/stepper/stepper.model.d.ts +0 -19
  88. package/lib/components/switch/index.d.ts +0 -1
  89. package/lib/components/switch/switch.model.d.ts +0 -4
  90. package/lib/components/tab-view/index.d.ts +0 -1
  91. package/lib/components/tab-view/tab-view.model.d.ts +0 -17
  92. package/lib/components/table/column-configuration.d.ts +0 -12
  93. package/lib/components/table/index.d.ts +0 -4
  94. package/lib/components/table/table-builder.d.ts +0 -15
  95. package/lib/components/table/table-column.directive.d.ts +0 -25
  96. package/lib/components/table/table.models.d.ts +0 -132
  97. package/lib/components/table-filter/index.d.ts +0 -1
  98. package/lib/components/table-filter/table-filter.model.d.ts +0 -17
  99. package/lib/components/textarea/index.d.ts +0 -1
  100. package/lib/components/textarea/textarea.model.d.ts +0 -9
  101. package/lib/components/textfield/index.d.ts +0 -1
  102. package/lib/components/textfield/textfield.model.d.ts +0 -9
  103. package/lib/components/unsubscribe.component.d.ts +0 -9
  104. package/lib/directives/datasource.directive.d.ts +0 -32
  105. package/lib/directives/index.d.ts +0 -4
  106. package/lib/directives/shortcut.directive.d.ts +0 -11
  107. package/lib/directives/table-datasource.directive.d.ts +0 -29
  108. package/lib/directives/table-filter.directive.d.ts +0 -17
  109. package/lib/format/format.d.ts +0 -9
  110. package/lib/pipes/error/error.codes.d.ts +0 -5
  111. package/lib/pipes/error/error.models.d.ts +0 -8
  112. package/lib/pipes/error/error.pipe.d.ts +0 -8
  113. package/lib/pipes/error/warning.codes.d.ts +0 -5
  114. package/lib/pipes/error/warning.pipe.d.ts +0 -8
  115. package/lib/pipes/helper/enumToList.pipe.d.ts +0 -7
  116. package/lib/pipes/index.d.ts +0 -7
  117. package/lib/pipes/keyOrFn/keyOrFn.pipe.d.ts +0 -7
  118. package/lib/services/confirm-dialog.service.d.ts +0 -12
  119. package/lib/services/index.d.ts +0 -4
  120. package/lib/services/leave-form.service.d.ts +0 -13
  121. package/lib/services/screen-size.service.d.ts +0 -10
  122. package/lib/services/table.service.d.ts +0 -13
package/README.md CHANGED
@@ -1,7 +1,318 @@
1
- # ui-core
1
+ # @verisoft/ui-core
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ A foundational Angular library that provides core UI functionalities, directives, interfaces, and base classes for building consistent user interfaces. This library serves as the architectural foundation for all UI component libraries within the Verisoft ecosystem, offering shared utilities, base components, and common interfaces without implementing concrete UI components.
4
4
 
5
- ## Running unit tests
5
+ ## Overview
6
+
7
+ The `@verisoft/ui-core` library provides essential infrastructure and utilities that enable other UI libraries to build consistent, accessible, and well-structured components. It includes base classes, interfaces, directives, services, and utilities that standardize component behavior across the entire Verisoft UI ecosystem.
8
+
9
+ ## Features
10
+
11
+ ### Core Infrastructure
12
+ - **Base Classes**: Abstract base classes for form components, input controls, and lifecycle management
13
+ - **Component Interfaces**: TypeScript interfaces defining component contracts and APIs
14
+ - **Tokens & Providers**: Injection tokens for component registration and dependency injection
15
+ - **Type Definitions**: Comprehensive type definitions for component properties and events
16
+
17
+ ### Directives
18
+ - **Form Directives**: Enhanced form behavior, validation helpers, and form state management
19
+ - **Utility Directives**: Common DOM manipulation, event handling, and accessibility helpers
20
+ - **Validation Directives**: Custom validators and validation feedback mechanisms
21
+
22
+ ### Services & Utilities
23
+ - **Format Services**: Date, number, currency, and text formatting utilities
24
+ - **Screen Service**: Responsive design utilities and screen size detection
25
+ - **Menu Service**: Navigation and menu state management
26
+ - **Common Services**: Shared utilities for HTTP, storage, and application state
27
+
28
+ ### Base Components
29
+ - **UnsubscribeComponent**: Automatic subscription cleanup and memory leak prevention
30
+ - **BaseFormComponent**: Foundation for all form-related functionality
31
+ - **BaseInputComponent**: Core input control behavior and validation integration
32
+
33
+ ### Key Features
34
+ - ✅ **Architecture Foundation**: Provides the structural foundation for all UI libraries
35
+ - ✅ **Type Safety**: Full TypeScript support with comprehensive type definitions
36
+ - ✅ **Extensibility**: Designed to be extended by specialized UI component libraries
37
+ - ✅ **Consistency**: Ensures consistent behavior across all UI components
38
+ - ✅ **Performance**: Optimized base classes with OnPush change detection support
39
+ - ✅ **Accessibility**: Built-in accessibility patterns and ARIA support
40
+ - ✅ **Form Integration**: Deep Angular Reactive Forms integration and validation
41
+ - ✅ **State Management**: Integration with `@verisoft/store` for application state
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ npm install @verisoft/ui-core
47
+ ```
48
+
49
+ ### Peer Dependencies
50
+
51
+ Make sure you have the following peer dependencies installed:
52
+
53
+ ```bash
54
+ npm install @verisoft/core @verisoft/store @angular/core @angular/common @angular/forms @angular/platform-browser
55
+ ```
56
+
57
+ ## Quick Start
58
+
59
+ 1. **Import base classes and interfaces** in your component library:
60
+
61
+ ```typescript
62
+ import {
63
+ BaseFormInputComponent,
64
+ ButtonCore,
65
+ TextfieldCore,
66
+ BUTTON_COMPONENT_TOKEN
67
+ } from '@verisoft/ui-core';
68
+
69
+ @Component({
70
+ selector: 'my-button',
71
+ providers: [{
72
+ provide: BUTTON_COMPONENT_TOKEN,
73
+ useExisting: MyButtonComponent
74
+ }]
75
+ })
76
+ export class MyButtonComponent extends BaseFormInputComponent implements ButtonCore {
77
+ // Component implementation
78
+ }
79
+ ```
80
+
81
+ 2. **Use services and utilities**:
82
+
83
+ ```typescript
84
+ import { ScreenSizeService, FormatService } from '@verisoft/ui-core';
85
+
86
+ @Component({
87
+ // ...
88
+ })
89
+ export class MyComponent {
90
+ constructor(
91
+ private screenService: ScreenSizeService,
92
+ private formatService: FormatService
93
+ ) {}
94
+
95
+ get isMobile() {
96
+ return this.screenService.isMobile();
97
+ }
98
+
99
+ formatCurrency(value: number) {
100
+ return this.formatService.currency(value);
101
+ }
102
+ }
103
+ ```
104
+
105
+ ## Usage Examples
106
+
107
+ ### Creating a Custom Component with Base Classes
108
+ ```typescript
109
+ import {
110
+ BaseFormInputComponent,
111
+ TextfieldCore,
112
+ TEXTFIELD_COMPONENT_TOKEN,
113
+ FieldSizeType,
114
+ FieldTypeType
115
+ } from '@verisoft/ui-core';
116
+ import { Component, Input, Optional, Self } from '@angular/core';
117
+ import { ControlValueAccessor, NgControl } from '@angular/forms';
118
+
119
+ @Component({
120
+ selector: 'custom-textfield',
121
+ template: `
122
+ <input
123
+ [type]="type"
124
+ [value]="value"
125
+ [disabled]="disabled"
126
+ (input)="onInput($event)"
127
+ (blur)="onBlur()"
128
+ [class]="getInputClasses()"
129
+ />
130
+ `,
131
+ providers: [{
132
+ provide: TEXTFIELD_COMPONENT_TOKEN,
133
+ useExisting: CustomTextfieldComponent
134
+ }]
135
+ })
136
+ export class CustomTextfieldComponent
137
+ extends BaseFormInputComponent
138
+ implements ControlValueAccessor, TextfieldCore {
139
+
140
+ @Input() type: FieldTypeType = 'text';
141
+ @Input() size: FieldSizeType = 'medium';
142
+
143
+ constructor(@Optional() @Self() ngControl: NgControl) {
144
+ super(ngControl);
145
+ }
146
+
147
+ protected getInputClasses(): string {
148
+ return `input input--${this.size} ${this.disabled ? 'input--disabled' : ''}`;
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### Using Core Services
154
+ ```typescript
155
+ import {
156
+ ScreenSizeService,
157
+ SideMenuService,
158
+ FormatService
159
+ } from '@verisoft/ui-core';
160
+
161
+ @Component({
162
+ selector: 'my-responsive-component',
163
+ template: `
164
+ <div [class]="containerClass">
165
+ <span>{{ formattedPrice }}</span>
166
+ <button (click)="toggleMenu()" *ngIf="!isMobile">Menu</button>
167
+ </div>
168
+ `
169
+ })
170
+ export class ResponsiveComponent {
171
+ constructor(
172
+ private screenService: ScreenSizeService,
173
+ private menuService: SideMenuService,
174
+ private formatService: FormatService
175
+ ) {}
176
+
177
+ get isMobile(): boolean {
178
+ return this.screenService.isMobile();
179
+ }
180
+
181
+ get containerClass(): string {
182
+ return this.isMobile ? 'container-mobile' : 'container-desktop';
183
+ }
184
+
185
+ get formattedPrice(): string {
186
+ return this.formatService.currency(99.99, 'EUR');
187
+ }
188
+
189
+ toggleMenu(): void {
190
+ this.menuService.toggle();
191
+ }
192
+ }
193
+ ```
194
+
195
+ ### Implementing Component Interfaces
196
+ ```typescript
197
+ import { ButtonCore, IconPositionType } from '@verisoft/ui-core';
198
+
199
+ export class MyButtonComponent implements ButtonCore {
200
+ @Input() primary: boolean = false;
201
+ @Input() disabled: boolean = false;
202
+ @Input() icon?: string;
203
+ @Input() iconPosition: IconPositionType = 'left';
204
+ @Input() loading: boolean = false;
205
+ @Input() size: 'small' | 'medium' | 'large' = 'medium';
206
+
207
+ // Implement required methods from ButtonCore interface
208
+ onClick(): void {
209
+ if (!this.disabled && !this.loading) {
210
+ // Handle click
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ ## Architecture
217
+
218
+ ### Base Classes
219
+ - **BaseFormComponent**: Foundation for all form-related components with validation integration
220
+ - **BaseFormInputComponent**: Base class for form input controls with ControlValueAccessor implementation
221
+ - **UnsubscribeComponent**: Automatic subscription management and memory leak prevention
222
+ - **BaseInputControls**: Core input control behavior and common properties
223
+
224
+ ### Component Interfaces
225
+ - **ButtonCore**: Interface defining button component contract
226
+ - **TextfieldCore**: Interface for text input components
227
+ - **DropdownCore**: Interface for dropdown/select components
228
+ - **TableCore**: Interface for data table components
229
+ - **FormFieldCore**: Interface for form field wrapper components
230
+
231
+ ### Injection Tokens
232
+ - **BUTTON_COMPONENT_TOKEN**: Token for registering button implementations
233
+ - **TEXTFIELD_COMPONENT_TOKEN**: Token for registering textfield implementations
234
+ - **DROPDOWN_COMPONENT_TOKEN**: Token for registering dropdown implementations
235
+ - **TABLE_COMPONENT_TOKEN**: Token for registering table implementations
236
+
237
+ ### Services
238
+ - **ScreenSizeService**: Responsive design utilities and breakpoint detection
239
+ - **SideMenuService**: Navigation menu state management
240
+ - **FormatService**: Formatting utilities for dates, numbers, and currencies
241
+ - **ValidationService**: Custom validation logic and error handling
242
+
243
+ ### Type Definitions
244
+ - **FieldSizeType**: Standardized size options ('small' | 'medium' | 'large')
245
+ - **FieldTypeType**: Input field types ('text' | 'email' | 'password' | etc.)
246
+ - **IconPositionType**: Icon positioning ('left' | 'right')
247
+ - **ControlSeverityType**: Validation state types ('success' | 'warning' | 'error')
248
+
249
+ ## API Documentation
250
+
251
+ For detailed component APIs, properties, and methods, please refer to the component documentation or use your IDE's IntelliSense for comprehensive inline documentation.
252
+
253
+ ## API Documentation
254
+
255
+ For detailed APIs, interfaces, and base class documentation, please refer to:
256
+ - TypeScript definitions and IntelliSense in your IDE
257
+ - Base class documentation for extension patterns
258
+ - Interface definitions for component contracts
259
+ - Service documentation for utility functions
260
+
261
+ ## Development
262
+
263
+ ### Running unit tests
6
264
 
7
265
  Run `nx test ui-core` to execute the unit tests.
266
+
267
+ ### Building the library
268
+
269
+ Run `nx build ui-core` to build the library.
270
+
271
+ ### Linting
272
+
273
+ Run `nx lint ui-core` to run ESLint on the library.
274
+
275
+ ## Extending the Library
276
+
277
+ The `ui-core` library is designed to be extended by other UI component libraries. Here's how to create a new UI library:
278
+
279
+ ### Creating a Component Library
280
+ ```typescript
281
+ // 1. Extend base classes
282
+ import { BaseFormInputComponent, ButtonCore } from '@verisoft/ui-core';
283
+
284
+ export class MyButtonComponent extends BaseFormInputComponent implements ButtonCore {
285
+ // Your implementation
286
+ }
287
+
288
+ // 2. Provide component tokens
289
+ @Component({
290
+ providers: [{
291
+ provide: BUTTON_COMPONENT_TOKEN,
292
+ useExisting: MyButtonComponent
293
+ }]
294
+ })
295
+
296
+ // 3. Use core services
297
+ constructor(
298
+ private screenService: ScreenSizeService,
299
+ private formatService: FormatService
300
+ ) {
301
+ super();
302
+ }
303
+ ```
304
+
305
+ ### Best Practices
306
+ - Always extend `BaseFormInputComponent` for form controls
307
+ - Implement the appropriate Core interface for your component type
308
+ - Use injection tokens to register your components
309
+ - Leverage core services for consistent behavior
310
+ - Follow the established type definitions and naming conventions
311
+
312
+ ## Contributing
313
+
314
+ This library is part of the Verisoft framework. Please follow the established coding standards and architectural patterns when contributing.
315
+
316
+ ## License
317
+
318
+ Copyright © Verisoft. All rights reserved.