@acontplus/ng-components 1.1.0 → 1.3.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.
- package/README.md +284 -49
- package/fesm2022/acontplus-ng-components.mjs +280 -252
- package/fesm2022/acontplus-ng-components.mjs.map +1 -1
- package/index.d.ts +178 -170
- package/package.json +23 -20
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @acontplus/ng-components
|
|
2
2
|
|
|
3
|
-
Angular UI
|
|
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,352 @@ npm install @acontplus/ng-components
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **UI Components**:
|
|
14
|
-
- **Directives**: Text transformation
|
|
15
|
-
- **Pipes**: Data transformation
|
|
16
|
-
- **Services**: Dialog management, overlay
|
|
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
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
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
|
-
|
|
28
|
+
#### DynamicCard
|
|
29
|
+
|
|
30
|
+
Versatile card component wrapping Angular Material's mat-card with additional functionality.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { DynamicCard } from '@acontplus/ng-components';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
template: `
|
|
37
|
+
<acp-dynamic-card
|
|
38
|
+
[cardTitle]="'Product Details'"
|
|
39
|
+
[cardSubtitle]="'Premium Package'"
|
|
40
|
+
[isHeaderVisible]="true"
|
|
41
|
+
[areActionsVisible]="true"
|
|
42
|
+
[primaryButtonText]="'Buy Now'"
|
|
43
|
+
[secondaryButtonText]="'Learn More'"
|
|
44
|
+
(primaryButtonClicked)="onPurchase()"
|
|
45
|
+
(secondaryButtonClicked)="onLearnMore()"
|
|
46
|
+
>
|
|
47
|
+
<p>Card content goes here</p>
|
|
48
|
+
</acp-dynamic-card>
|
|
49
|
+
`,
|
|
50
|
+
imports: [DynamicCard],
|
|
51
|
+
})
|
|
52
|
+
export class ProductComponent {}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Buttons
|
|
56
|
+
|
|
57
|
+
#### Button
|
|
58
|
+
|
|
59
|
+
Flexible button component with multiple Material Design variants.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { Button } from '@acontplus/ng-components';
|
|
63
|
+
|
|
64
|
+
@Component({
|
|
65
|
+
template: `
|
|
66
|
+
<acp-button
|
|
67
|
+
[variant]="'primary'"
|
|
68
|
+
[text]="'Save'"
|
|
69
|
+
[icon]="'save'"
|
|
70
|
+
[matStyle]="'elevated'"
|
|
71
|
+
[disabled]="false"
|
|
72
|
+
(handleClick)="onSave()"
|
|
73
|
+
>
|
|
74
|
+
</acp-button>
|
|
75
|
+
`,
|
|
76
|
+
imports: [Button],
|
|
77
|
+
})
|
|
78
|
+
export class FormComponent {}
|
|
79
|
+
```
|
|
27
80
|
|
|
28
81
|
### Dialog Wrapper
|
|
29
82
|
|
|
30
|
-
Enhanced dialog components with wrapper functionality.
|
|
83
|
+
Enhanced dialog components with wrapper functionality for consistent dialog management.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { DialogWrapper } from '@acontplus/ng-components';
|
|
87
|
+
```
|
|
31
88
|
|
|
32
89
|
### Icons
|
|
33
90
|
|
|
91
|
+
#### UserIcon & SvgIcon
|
|
92
|
+
|
|
34
93
|
Icon components for consistent iconography.
|
|
35
94
|
|
|
36
|
-
|
|
95
|
+
```typescript
|
|
96
|
+
import { UserIcon, SvgIcon } from '@acontplus/ng-components';
|
|
97
|
+
```
|
|
37
98
|
|
|
38
|
-
|
|
99
|
+
### Input Chip
|
|
39
100
|
|
|
40
|
-
|
|
101
|
+
Chip input components integrated with Angular Material for tag/chip selection.
|
|
41
102
|
|
|
42
|
-
|
|
103
|
+
```typescript
|
|
104
|
+
import { InputChip } from '@acontplus/ng-components';
|
|
105
|
+
```
|
|
43
106
|
|
|
44
107
|
### Spinner
|
|
45
108
|
|
|
46
|
-
Loading spinner components.
|
|
109
|
+
Loading spinner components for async operations.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { Spinner } from '@acontplus/ng-components';
|
|
113
|
+
```
|
|
47
114
|
|
|
48
115
|
### Tables
|
|
49
116
|
|
|
50
|
-
|
|
117
|
+
- **DynamicTable**: Angular Material-based dynamic table with advanced features
|
|
118
|
+
- **TabulatorTable**: Advanced table with Tabulator.js integration
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { DynamicTable, TabulatorTable } from '@acontplus/ng-components';
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Dynamic Table Features
|
|
125
|
+
|
|
126
|
+
- **Row Selection**: Single/multiple selection with disabled rows support
|
|
127
|
+
- **Row Styling**: Theme-aware dynamic row colors based on data properties
|
|
128
|
+
- **Expandable Rows**: Collapsible detail views
|
|
129
|
+
- **Pagination**: Built-in pagination support
|
|
130
|
+
- **Column Templates**: Custom column rendering
|
|
131
|
+
- **Sorting & Filtering**: Material table sorting capabilities
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
// Row styling example
|
|
135
|
+
interface TableRow {
|
|
136
|
+
rowStyle?: {
|
|
137
|
+
backgroundColor?: string;
|
|
138
|
+
color?: string;
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
};
|
|
141
|
+
disableSelection?: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Usage with theme-aware colors
|
|
145
|
+
const data = [
|
|
146
|
+
{
|
|
147
|
+
id: 1,
|
|
148
|
+
name: 'Item 1',
|
|
149
|
+
status: 'active',
|
|
150
|
+
rowStyle: {
|
|
151
|
+
backgroundColor: 'var(--mat-sys-primary-container)',
|
|
152
|
+
color: 'var(--mat-sys-on-primary-container)',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 2,
|
|
157
|
+
name: 'Item 2',
|
|
158
|
+
status: 'processing',
|
|
159
|
+
disableSelection: true,
|
|
160
|
+
rowStyle: {
|
|
161
|
+
backgroundColor: '#e3f2fd',
|
|
162
|
+
color: '#1565c0',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Tabulator Table Features
|
|
169
|
+
|
|
170
|
+
- **Row Styling**: Same rowStyle property support as Dynamic Table
|
|
171
|
+
- **Advanced Filtering**: Built-in Tabulator filtering
|
|
172
|
+
- **Virtual Scrolling**: Performance optimization for large datasets
|
|
173
|
+
- **Tree Data**: Hierarchical data support
|
|
174
|
+
- **Custom Themes**: Material Design integration
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// Tabulator with row styling
|
|
178
|
+
<acp-tabulator-table
|
|
179
|
+
[data]="tableData"
|
|
180
|
+
[columns]="columns"
|
|
181
|
+
[height]="400"
|
|
182
|
+
[theme]="{ name: 'materialize' }"
|
|
183
|
+
/>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Note**: Tabulator tables require `tabulator-tables` as a peer dependency:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npm install tabulator-tables
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### Theme Integration
|
|
193
|
+
|
|
194
|
+
Both table components support automatic theme adaptation:
|
|
195
|
+
|
|
196
|
+
```scss
|
|
197
|
+
// Import Tabulator Material theme
|
|
198
|
+
@import 'tabulator-tables/dist/css/tabulator_materialize.min.css';
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Row colors automatically adapt to light/dark themes using Material Design tokens or custom theme detection.
|
|
51
202
|
|
|
52
203
|
### Theme Toggle
|
|
53
204
|
|
|
54
|
-
Dark/light mode toggle component.
|
|
205
|
+
Dark/light mode toggle component for theme switching.
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
import { ThemeToggle } from '@acontplus/ng-components';
|
|
209
|
+
```
|
|
55
210
|
|
|
56
211
|
### Autocomplete Wrapper
|
|
57
212
|
|
|
58
|
-
Enhanced autocomplete components.
|
|
213
|
+
Enhanced autocomplete components with custom functionality.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { AutocompleteWrapperComponent } from '@acontplus/ng-components';
|
|
217
|
+
```
|
|
59
218
|
|
|
60
219
|
## Directives
|
|
61
220
|
|
|
62
|
-
###
|
|
221
|
+
### ToUpperCase
|
|
222
|
+
|
|
223
|
+
Transforms input text to uppercase automatically.
|
|
63
224
|
|
|
64
|
-
|
|
225
|
+
```typescript
|
|
226
|
+
import { ToUpperCase } from '@acontplus/ng-components';
|
|
227
|
+
```
|
|
65
228
|
|
|
66
229
|
## Pipes
|
|
67
230
|
|
|
68
|
-
###
|
|
231
|
+
### GetTotalPipe
|
|
232
|
+
|
|
233
|
+
Calculates totals from arrays of objects.
|
|
69
234
|
|
|
70
|
-
|
|
235
|
+
```typescript
|
|
236
|
+
import { GetTotalPipe } from '@acontplus/ng-components';
|
|
237
|
+
```
|
|
71
238
|
|
|
72
|
-
###
|
|
239
|
+
### StatusDisplayPipe
|
|
73
240
|
|
|
74
|
-
|
|
241
|
+
Formats status values for display.
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
import { StatusDisplayPipe } from '@acontplus/ng-components';
|
|
245
|
+
```
|
|
75
246
|
|
|
76
247
|
## Services
|
|
77
248
|
|
|
78
|
-
###
|
|
249
|
+
### AdvancedDialogService
|
|
79
250
|
|
|
80
|
-
|
|
251
|
+
Manages dialog creation and lifecycle with advanced features.
|
|
81
252
|
|
|
82
|
-
|
|
253
|
+
```typescript
|
|
254
|
+
import { AdvancedDialogService } from '@acontplus/ng-components';
|
|
255
|
+
```
|
|
83
256
|
|
|
84
|
-
|
|
257
|
+
### OverlayService
|
|
85
258
|
|
|
86
|
-
|
|
259
|
+
Manages overlay components and positioning.
|
|
87
260
|
|
|
88
|
-
|
|
261
|
+
```typescript
|
|
262
|
+
import { OverlayService } from '@acontplus/ng-components';
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### ThemeSwitcher
|
|
266
|
+
|
|
267
|
+
Manages application theme (dark/light mode) with persistence.
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
import { ThemeSwitcher } from '@acontplus/ng-components';
|
|
271
|
+
```
|
|
89
272
|
|
|
90
|
-
###
|
|
273
|
+
### AutocompleteWrapperService
|
|
91
274
|
|
|
92
|
-
|
|
275
|
+
Provides autocomplete functionality and data management.
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
import { AutocompleteWrapperService } from '@acontplus/ng-components';
|
|
279
|
+
```
|
|
93
280
|
|
|
94
281
|
## Form Controls
|
|
95
282
|
|
|
96
|
-
###
|
|
283
|
+
### DynamicInput
|
|
97
284
|
|
|
98
|
-
Dynamic form input components.
|
|
285
|
+
Dynamic form input components for flexible form creation.
|
|
99
286
|
|
|
100
|
-
|
|
287
|
+
```typescript
|
|
288
|
+
import { DynamicInput } from '@acontplus/ng-components';
|
|
289
|
+
```
|
|
101
290
|
|
|
102
|
-
|
|
291
|
+
## Models
|
|
292
|
+
|
|
293
|
+
Exported models for type safety:
|
|
294
|
+
|
|
295
|
+
- **Mat Table Models**: Material table configuration models
|
|
296
|
+
- **Pagination**: Pagination models and interfaces
|
|
297
|
+
- **Autocomplete Wrapper**: Autocomplete configuration models
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
import { PaginationModel, AutocompleteWrapperModel } from '@acontplus/ng-components';
|
|
301
|
+
```
|
|
103
302
|
|
|
104
|
-
|
|
105
|
-
- Custom dialog styles
|
|
106
|
-
- Mixins for reusable styles
|
|
107
|
-
- CSS variables for theming
|
|
303
|
+
## Types
|
|
108
304
|
|
|
109
|
-
|
|
305
|
+
### Tabulator Types
|
|
110
306
|
|
|
111
|
-
|
|
307
|
+
TypeScript definitions for Tabulator table configurations.
|
|
112
308
|
|
|
113
309
|
```typescript
|
|
114
|
-
import {
|
|
310
|
+
import { TabulatorTypes } from '@acontplus/ng-components';
|
|
115
311
|
```
|
|
116
312
|
|
|
117
|
-
|
|
118
|
-
To use table components, install Tabulator in your application:
|
|
313
|
+
## Styling
|
|
119
314
|
|
|
120
|
-
|
|
121
|
-
|
|
315
|
+
The library includes custom SCSS files:
|
|
316
|
+
|
|
317
|
+
- **\_mixins.scss**: Reusable SCSS mixins
|
|
318
|
+
- **\_variables.scss**: Theme variables and constants
|
|
319
|
+
- **\_custom-dialog.scss**: Custom dialog styles
|
|
320
|
+
- **index.scss**: Main stylesheet entry point
|
|
321
|
+
|
|
322
|
+
Import styles in your application:
|
|
323
|
+
|
|
324
|
+
```scss
|
|
325
|
+
@import '@acontplus/ng-components/styles';
|
|
326
|
+
// For Tabulator Material theme
|
|
327
|
+
@import 'tabulator-tables/dist/css/tabulator_materialize.min.css';
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Theme-Aware Row Styling
|
|
331
|
+
|
|
332
|
+
Components support dynamic row styling that adapts to Material Design themes:
|
|
333
|
+
|
|
334
|
+
```typescript
|
|
335
|
+
// Theme detection utility
|
|
336
|
+
const isDark = document.documentElement.classList.contains('dark-theme');
|
|
337
|
+
|
|
338
|
+
// Status-based styling
|
|
339
|
+
function getStatusStyle(status: string) {
|
|
340
|
+
switch (status) {
|
|
341
|
+
case 'success':
|
|
342
|
+
return isDark
|
|
343
|
+
? { backgroundColor: '#1b5e20', color: '#81c784' }
|
|
344
|
+
: { backgroundColor: '#e8f5e8', color: '#2e7d32' };
|
|
345
|
+
case 'error':
|
|
346
|
+
return isDark
|
|
347
|
+
? { backgroundColor: '#b71c1c', color: '#ffcdd2' }
|
|
348
|
+
: { backgroundColor: '#ffebee', color: '#c62828' };
|
|
349
|
+
default:
|
|
350
|
+
return {};
|
|
351
|
+
}
|
|
352
|
+
}
|
|
122
353
|
```
|
|
123
354
|
|
|
124
|
-
##
|
|
355
|
+
## Peer Dependencies
|
|
125
356
|
|
|
126
|
-
|
|
357
|
+
- `@angular/cdk`: ^20.2.5
|
|
358
|
+
- `@angular/common`: ^20.3.2
|
|
359
|
+
- `@angular/core`: ^20.3.2
|
|
360
|
+
- `@angular/material`: ^20.2.5
|
|
361
|
+
- `tabulator-tables`: ^6.3.1
|