@acontplus/ng-components 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @acontplus/ng-components
2
2
 
3
- Angular UI components library for AcontPlus applications, providing reusable components, directives, pipes, and services built with Angular Material.
3
+ Angular Material UI component library with dynamic tables, theming support, dialog wrappers, and comprehensive styling utilities for AcontPlus applications.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,117 +10,343 @@ npm install @acontplus/ng-components
10
10
 
11
11
  ## Features
12
12
 
13
- - **UI Components**: Cards, dialogs, icons, input chips, theme buttons, spinners, tables, theme toggle, autocomplete wrapper
14
- - **Directives**: Text transformation directives (to-upper-case)
15
- - **Pipes**: Data transformation pipes (get-total, status-display)
16
- - **Services**: Dialog management, overlay services, theme management, autocomplete functionality
13
+ - **UI Components**: Dynamic cards, dialogs, icons, input chips, buttons, spinners, dynamic/tabulator tables, theme toggle, autocomplete wrapper
14
+ - **Directives**: Text transformation (to-upper-case)
15
+ - **Pipes**: Data transformation (get-total, status-display)
16
+ - **Services**: Dialog management, overlay, theme management (dark/light mode), autocomplete
17
17
  - **Form Controls**: Dynamic input components
18
- - **Styling**: Custom SCSS mixins, variables, and theme support including dark mode
19
- - **Angular Material Integration**: Built on top of Angular Material for consistent design
20
- - **TypeScript Support**: Full type safety with comprehensive TypeScript definitions
18
+ - **Models**: Table models, pagination, autocomplete wrapper models
19
+ - **Types**: Tabulator table type definitions
20
+ - **Styling**: Custom SCSS mixins, variables, dialog styles, and theme support
21
+ - **Angular Material Integration**: Built on Angular Material for consistent design
22
+ - **TypeScript Support**: Full type safety with comprehensive definitions
21
23
 
22
24
  ## Components
23
25
 
24
26
  ### Cards
25
27
 
26
- Reusable card components for displaying content.
28
+ - **DynamicCardComponent**: Flexible card component for displaying content
29
+
30
+ ```typescript
31
+ import { DynamicCardComponent } from '@acontplus/ng-components';
32
+ ```
33
+
34
+ ### Buttons
35
+
36
+ - **ButtonComponent**: Themed button component with Material Design
37
+
38
+ ```typescript
39
+ import { ButtonComponent } from '@acontplus/ng-components';
40
+ ```
27
41
 
28
42
  ### Dialog Wrapper
29
43
 
30
- Enhanced dialog components with wrapper functionality.
44
+ Enhanced dialog components with wrapper functionality for consistent dialog management.
45
+
46
+ ```typescript
47
+ import { DialogWrapperComponent } from '@acontplus/ng-components';
48
+ ```
31
49
 
32
50
  ### Icons
33
51
 
34
- Icon components for consistent iconography.
52
+ Icon components for consistent iconography across the application.
35
53
 
36
- ### Material Input Chip
54
+ ```typescript
55
+ import { IconsComponent } from '@acontplus/ng-components';
56
+ ```
37
57
 
38
- Chip input components integrated with Angular Material.
58
+ ### Input Chip
39
59
 
40
- ### Material Theme Button
60
+ Chip input components integrated with Angular Material for tag/chip selection.
41
61
 
42
- Themed button components.
62
+ ```typescript
63
+ import { InputChipComponent } from '@acontplus/ng-components';
64
+ ```
43
65
 
44
66
  ### Spinner
45
67
 
46
- Loading spinner components.
68
+ Loading spinner components for async operations.
69
+
70
+ ```typescript
71
+ import { SpinnerComponent } from '@acontplus/ng-components';
72
+ ```
47
73
 
48
74
  ### Tables
49
75
 
50
- Table components for data display.
76
+ - **DynamicTableComponent**: Angular Material-based dynamic table with advanced features
77
+ - **TabulatorTableComponent**: Advanced table with Tabulator.js integration
78
+
79
+ ```typescript
80
+ import { DynamicTableComponent, TabulatorTableComponent } from '@acontplus/ng-components';
81
+ ```
82
+
83
+ #### Dynamic Table Features
84
+
85
+ - **Row Selection**: Single/multiple selection with disabled rows support
86
+ - **Row Styling**: Theme-aware dynamic row colors based on data properties
87
+ - **Expandable Rows**: Collapsible detail views
88
+ - **Pagination**: Built-in pagination support
89
+ - **Column Templates**: Custom column rendering
90
+ - **Sorting & Filtering**: Material table sorting capabilities
91
+
92
+ ```typescript
93
+ // Row styling example
94
+ interface TableRow {
95
+ rowStyle?: {
96
+ backgroundColor?: string;
97
+ color?: string;
98
+ [key: string]: any;
99
+ };
100
+ disableSelection?: boolean;
101
+ }
102
+
103
+ // Usage with theme-aware colors
104
+ const data = [
105
+ {
106
+ id: 1,
107
+ name: 'Item 1',
108
+ status: 'active',
109
+ rowStyle: {
110
+ backgroundColor: 'var(--mat-sys-primary-container)',
111
+ color: 'var(--mat-sys-on-primary-container)',
112
+ },
113
+ },
114
+ {
115
+ id: 2,
116
+ name: 'Item 2',
117
+ status: 'processing',
118
+ disableSelection: true,
119
+ rowStyle: {
120
+ backgroundColor: '#e3f2fd',
121
+ color: '#1565c0',
122
+ },
123
+ },
124
+ ];
125
+ ```
126
+
127
+ #### Tabulator Table Features
128
+
129
+ - **Row Styling**: Same rowStyle property support as Dynamic Table
130
+ - **Advanced Filtering**: Built-in Tabulator filtering
131
+ - **Virtual Scrolling**: Performance optimization for large datasets
132
+ - **Tree Data**: Hierarchical data support
133
+ - **Custom Themes**: Material Design integration
134
+
135
+ ```typescript
136
+ // Tabulator with row styling
137
+ <acp-tabulator-table
138
+ [data]="tableData"
139
+ [columns]="columns"
140
+ [height]="400"
141
+ [theme]="{ name: 'materialize' }"
142
+ />
143
+ ```
144
+
145
+ **Note**: Tabulator tables require `tabulator-tables` as a peer dependency:
146
+
147
+ ```bash
148
+ npm install tabulator-tables
149
+ ```
150
+
151
+ #### Theme Integration
152
+
153
+ Both table components support automatic theme adaptation:
154
+
155
+ ```scss
156
+ // Import Tabulator Material theme
157
+ @import 'tabulator-tables/dist/css/tabulator_materialize.min.css';
158
+ ```
159
+
160
+ Row colors automatically adapt to light/dark themes using Material Design tokens or custom theme detection.
51
161
 
52
162
  ### Theme Toggle
53
163
 
54
- Dark/light mode toggle component.
164
+ Dark/light mode toggle component for theme switching.
165
+
166
+ ```typescript
167
+ import { ThemeToggleComponent } from '@acontplus/ng-components';
168
+ ```
55
169
 
56
170
  ### Autocomplete Wrapper
57
171
 
58
- Enhanced autocomplete components.
172
+ Enhanced autocomplete components with custom functionality.
173
+
174
+ ```typescript
175
+ import { AutocompleteWrapperComponent } from '@acontplus/ng-components';
176
+ ```
59
177
 
60
178
  ## Directives
61
179
 
62
- ### To Upper Case
180
+ ### ToUpperCaseDirective
181
+
182
+ Transforms input text to uppercase automatically.
63
183
 
64
- Directive to transform text to uppercase.
184
+ ```typescript
185
+ import { ToUpperCaseDirective } from '@acontplus/ng-components';
186
+ ```
65
187
 
66
188
  ## Pipes
67
189
 
68
- ### Get Total
190
+ ### GetTotalPipe
191
+
192
+ Calculates totals from arrays of objects.
69
193
 
70
- Pipe for calculating totals from arrays.
194
+ ```typescript
195
+ import { GetTotalPipe } from '@acontplus/ng-components';
196
+ ```
71
197
 
72
- ### Status Display
198
+ ### StatusDisplayPipe
73
199
 
74
- Pipe for formatting status values.
200
+ Formats status values for display.
201
+
202
+ ```typescript
203
+ import { StatusDisplayPipe } from '@acontplus/ng-components';
204
+ ```
75
205
 
76
206
  ## Services
77
207
 
78
- ### Dialog Service
208
+ ### DialogService
209
+
210
+ Manages dialog creation and lifecycle.
79
211
 
80
- Service for managing dialogs.
212
+ ```typescript
213
+ import { DialogService } from '@acontplus/ng-components';
214
+ ```
215
+
216
+ ### OverlayService
217
+
218
+ Manages overlay components and positioning.
219
+
220
+ ```typescript
221
+ import { OverlayService } from '@acontplus/ng-components';
222
+ ```
81
223
 
82
- ### Overlay Service
224
+ ### ThemeService
83
225
 
84
- Service for overlay management.
226
+ Manages application theme (dark/light mode) with persistence.
85
227
 
86
- ### Theme Service
228
+ ```typescript
229
+ import { ThemeService } from '@acontplus/ng-components';
230
+ ```
87
231
 
88
- Service for theme management including dark mode.
232
+ ### AutocompleteWrapperService
89
233
 
90
- ### Autocomplete Wrapper Service
234
+ Provides autocomplete functionality and data management.
91
235
 
92
- Service for autocomplete functionality.
236
+ ```typescript
237
+ import { AutocompleteWrapperService } from '@acontplus/ng-components';
238
+ ```
93
239
 
94
240
  ## Form Controls
95
241
 
96
- ### Dynamic Input
242
+ ### DynamicInput
97
243
 
98
- Dynamic form input components.
244
+ Dynamic form input components for flexible form creation.
245
+
246
+ ```typescript
247
+ import { DynamicInput } from '@acontplus/ng-components';
248
+ ```
249
+
250
+ ## Models
251
+
252
+ Exported models for type safety:
253
+
254
+ - **Mat Table Models**: Material table configuration models
255
+ - **Pagination**: Pagination models and interfaces
256
+ - **Autocomplete Wrapper**: Autocomplete configuration models
257
+
258
+ ```typescript
259
+ import { PaginationModel, AutocompleteWrapperModel } from '@acontplus/ng-components';
260
+ ```
261
+
262
+ ## Types
263
+
264
+ ### Tabulator Types
265
+
266
+ TypeScript definitions for Tabulator table configurations.
267
+
268
+ ```typescript
269
+ import { TabulatorTypes } from '@acontplus/ng-components';
270
+ ```
99
271
 
100
272
  ## Styling
101
273
 
102
- The library includes custom SCSS files for theming and styling:
274
+ The library includes custom SCSS files:
103
275
 
104
- - Custom button styles
105
- - Custom dialog styles
106
- - Mixins for reusable styles
107
- - CSS variables for theming
276
+ - **\_mixins.scss**: Reusable SCSS mixins
277
+ - **\_variables.scss**: Theme variables and constants
278
+ - **\_custom-dialog.scss**: Custom dialog styles
279
+ - **index.scss**: Main stylesheet entry point
108
280
 
109
- ## Usage
281
+ Import styles in your application:
110
282
 
111
- Import the components you need:
283
+ ```scss
284
+ @import '@acontplus/ng-components/styles';
285
+ // For Tabulator Material theme
286
+ @import 'tabulator-tables/dist/css/tabulator_materialize.min.css';
287
+ ```
288
+
289
+ ### Theme-Aware Row Styling
290
+
291
+ Components support dynamic row styling that adapts to Material Design themes:
112
292
 
113
293
  ```typescript
114
- import { CardsComponent, ThemeToggleComponent } from '@acontplus/ng-components';
294
+ // Theme detection utility
295
+ const isDark = document.documentElement.classList.contains('dark-theme');
296
+
297
+ // Status-based styling
298
+ function getStatusStyle(status: string) {
299
+ switch (status) {
300
+ case 'success':
301
+ return isDark
302
+ ? { backgroundColor: '#1b5e20', color: '#81c784' }
303
+ : { backgroundColor: '#e8f5e8', color: '#2e7d32' };
304
+ case 'error':
305
+ return isDark
306
+ ? { backgroundColor: '#b71c1c', color: '#ffcdd2' }
307
+ : { backgroundColor: '#ffebee', color: '#c62828' };
308
+ default:
309
+ return {};
310
+ }
311
+ }
115
312
  ```
116
313
 
117
- Note: `tabulator-tables` is a runtime dependency and is installed alongside this package.
118
- To use table components, install Tabulator in your application:
314
+ ## Peer Dependencies
315
+
316
+ - `@angular/cdk`: ^20.2.5
317
+ - `@angular/common`: ^20.3.2
318
+ - `@angular/core`: ^20.3.2
319
+ - `@angular/material`: ^20.2.5
320
+ - `tabulator-tables`: ^6.3.1
321
+
322
+ ## Development
323
+
324
+ ### Running Unit Tests
119
325
 
120
326
  ```bash
121
- npm install tabulator-tables
327
+ nx test ng-components
122
328
  ```
123
329
 
124
- ## Running unit tests
330
+ ### Building
331
+
332
+ ```bash
333
+ nx build ng-components
334
+ ```
335
+
336
+ ### Linting
337
+
338
+ ```bash
339
+ nx lint ng-components
340
+ ```
341
+
342
+ ## License
343
+
344
+ MIT
345
+
346
+ ## Author
347
+
348
+ Ivan Paz <ifer343@gmail.com>
349
+
350
+ ## Repository
125
351
 
126
- Run `nx test ng-components` to execute the unit tests.
352
+ https://github.com/Acontplus-S-A-S/acontplus-libs