ngx-core-components 0.1.0 → 0.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.
- package/README.md +338 -13
- package/fesm2022/ngx-core-components-grid.mjs +740 -107
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +203 -60
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +48 -13
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +87 -15
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +132 -14
- package/grid/public-api.d.ts +1 -1
- package/inputs/numeric-textbox/numeric-textbox.component.d.ts +6 -2
- package/inputs/time-picker/time-picker.component.d.ts +17 -7
- package/layout/splitter/splitter.component.d.ts +9 -2
- package/package.json +5 -5
- package/public-api.d.ts +2 -2
- package/views/list-view/list-view.component.d.ts +19 -1
- package/views/public-api.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# ngx-core-components
|
|
2
2
|
|
|
3
|
-
Angular 19 / 20 / 21 component library
|
|
3
|
+
Angular 19 / 20 / 21 standalone component library with enterprise-ready UI building blocks including a full-featured **SVG Gantt Chart**, inputs, data grid, dialogs, charts, navigation, layout, feedback, and barcode components.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ngx-core-components)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
10
|
+
- **Gantt chart** with task bars, dependencies, milestones, drag/resize, zoom, and hierarchy
|
|
11
|
+
- **Input controls** including text, dropdown, multi-select, autocomplete, date/time, slider, switch, rating, and color picker
|
|
12
|
+
- **Charts** including bar, line, pie, donut, and sparkline
|
|
13
|
+
- **Data presentation** with grid, tree view, and list view
|
|
14
|
+
- **Dialogs, tooltips, and popovers** for overlays and contextual UI
|
|
15
|
+
- **Buttons, chips, menus, breadcrumbs, tabs, cards, accordions, steppers, and splitters**
|
|
16
|
+
- **Feedback components** including badge, progress bar, skeleton, and notifications
|
|
17
|
+
- **Barcode and QR code generation** with no external runtime dependency
|
|
18
18
|
- **Fully themeable** via CSS custom properties
|
|
19
|
-
- **Zero runtime dependencies** — only Angular peer
|
|
19
|
+
- **Zero runtime dependencies** — only Angular peer dependencies
|
|
20
20
|
- **OnPush change detection** + Angular Signals
|
|
21
21
|
- **Standalone components** (no NgModules)
|
|
22
22
|
|
|
@@ -26,8 +26,110 @@ Angular 19 / 20 / 21 component library featuring a full-featured **SVG Gantt Cha
|
|
|
26
26
|
npm install ngx-core-components
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
## Entry Points
|
|
30
|
+
|
|
31
|
+
You can import from the primary package for convenience:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { GanttChartComponent, TextBoxComponent, DataGridComponent } from 'ngx-core-components';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or use secondary entry points for more focused imports:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { TextBoxComponent, DropdownComponent } from 'ngx-core-components/inputs';
|
|
41
|
+
import { BarChartComponent, GanttChartComponent } from 'ngx-core-components/charts';
|
|
42
|
+
import { DataGridComponent } from 'ngx-core-components/grid';
|
|
43
|
+
import { DialogService } from 'ngx-core-components/dialog';
|
|
44
|
+
import { ButtonComponent } from 'ngx-core-components/buttons';
|
|
45
|
+
import { CardComponent } from 'ngx-core-components/layout';
|
|
46
|
+
import { BadgeComponent } from 'ngx-core-components/feedback';
|
|
47
|
+
import { BreadcrumbComponent } from 'ngx-core-components/navigation';
|
|
48
|
+
import { TreeViewComponent, ListViewComponent } from 'ngx-core-components/views';
|
|
49
|
+
import { QrCodeComponent, BarcodeComponent } from 'ngx-core-components/barcodes';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Included Components
|
|
53
|
+
|
|
54
|
+
### Charts
|
|
55
|
+
|
|
56
|
+
- `GanttChartComponent`
|
|
57
|
+
- `BarChartComponent`
|
|
58
|
+
- `LineChartComponent`
|
|
59
|
+
- `PieChartComponent`
|
|
60
|
+
- `SparklineComponent`
|
|
61
|
+
|
|
62
|
+
### Inputs
|
|
63
|
+
|
|
64
|
+
- `TextBoxComponent`
|
|
65
|
+
- `CheckboxComponent`
|
|
66
|
+
- `RadioGroupComponent`
|
|
67
|
+
- `DropdownComponent`
|
|
68
|
+
- `MultiSelectComponent`
|
|
69
|
+
- `AutocompleteComponent`
|
|
70
|
+
- `DatePickerComponent`
|
|
71
|
+
- `SliderComponent`
|
|
72
|
+
- `SwitchComponent`
|
|
73
|
+
- `RatingComponent`
|
|
74
|
+
- `NumericTextBoxComponent`
|
|
75
|
+
- `TextareaComponent`
|
|
76
|
+
- `ColorPickerComponent`
|
|
77
|
+
- `TimePickerComponent`
|
|
78
|
+
- `DateRangePickerComponent`
|
|
79
|
+
|
|
80
|
+
### Data Views
|
|
81
|
+
|
|
82
|
+
- `DataGridComponent`
|
|
83
|
+
- `TreeViewComponent`
|
|
84
|
+
- `ListViewComponent`
|
|
85
|
+
|
|
86
|
+
### Dialog and Overlay
|
|
87
|
+
|
|
88
|
+
- `DialogService`
|
|
89
|
+
- `DialogContainerComponent`
|
|
90
|
+
- `TooltipDirective`
|
|
91
|
+
- `PopoverComponent`
|
|
92
|
+
|
|
93
|
+
### Buttons and Actions
|
|
94
|
+
|
|
95
|
+
- `ButtonComponent`
|
|
96
|
+
- `ButtonGroupComponent`
|
|
97
|
+
- `ChipComponent`
|
|
98
|
+
- `ChipListComponent`
|
|
99
|
+
- `SplitButtonComponent`
|
|
100
|
+
- `DropDownButtonComponent`
|
|
101
|
+
|
|
102
|
+
### Layout
|
|
103
|
+
|
|
104
|
+
- `CardComponent`
|
|
105
|
+
- `TabStripComponent`
|
|
106
|
+
- `TabComponent`
|
|
107
|
+
- `AccordionComponent`
|
|
108
|
+
- `StepperComponent`
|
|
109
|
+
- `SplitterComponent`
|
|
110
|
+
|
|
111
|
+
### Feedback
|
|
112
|
+
|
|
113
|
+
- `BadgeComponent`
|
|
114
|
+
- `ProgressBarComponent`
|
|
115
|
+
- `SkeletonComponent`
|
|
116
|
+
- `NotificationService`
|
|
117
|
+
- `NotificationContainerComponent`
|
|
118
|
+
|
|
119
|
+
### Navigation
|
|
120
|
+
|
|
121
|
+
- `BreadcrumbComponent`
|
|
122
|
+
- `MenuComponent`
|
|
123
|
+
|
|
124
|
+
### Barcodes
|
|
125
|
+
|
|
126
|
+
- `QrCodeComponent`
|
|
127
|
+
- `BarcodeComponent`
|
|
128
|
+
|
|
29
129
|
## Quick Start
|
|
30
130
|
|
|
131
|
+
### Gantt Chart
|
|
132
|
+
|
|
31
133
|
```typescript
|
|
32
134
|
import { Component } from '@angular/core';
|
|
33
135
|
import { GanttChartComponent, GanttTask, GanttDependency, DependencyType } from 'ngx-core-components';
|
|
@@ -71,8 +173,218 @@ export class MyComponent {
|
|
|
71
173
|
}
|
|
72
174
|
```
|
|
73
175
|
|
|
176
|
+
### Form Controls
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
import { Component, signal } from '@angular/core';
|
|
180
|
+
import { TextBoxComponent, DropdownComponent, type DropdownOption } from 'ngx-core-components';
|
|
181
|
+
|
|
182
|
+
@Component({
|
|
183
|
+
standalone: true,
|
|
184
|
+
imports: [TextBoxComponent, DropdownComponent],
|
|
185
|
+
template: `
|
|
186
|
+
<ngx-textbox
|
|
187
|
+
[value]="name()"
|
|
188
|
+
label="Full Name"
|
|
189
|
+
placeholder="Enter your name"
|
|
190
|
+
(valueChange)="name.set($event)"
|
|
191
|
+
/>
|
|
192
|
+
|
|
193
|
+
<ngx-dropdown
|
|
194
|
+
[options]="countries"
|
|
195
|
+
[value]="country()"
|
|
196
|
+
label="Country"
|
|
197
|
+
placeholder="Select country"
|
|
198
|
+
(valueChange)="country.set($event)"
|
|
199
|
+
/>
|
|
200
|
+
`,
|
|
201
|
+
})
|
|
202
|
+
export class MyFormComponent {
|
|
203
|
+
name = signal('');
|
|
204
|
+
country = signal<unknown>(null);
|
|
205
|
+
|
|
206
|
+
countries: DropdownOption[] = [
|
|
207
|
+
{ label: 'United States', value: 'us' },
|
|
208
|
+
{ label: 'Germany', value: 'de' },
|
|
209
|
+
{ label: 'Japan', value: 'jp' },
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Structured Inputs
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
import { Component, signal } from '@angular/core';
|
|
218
|
+
import { NumericTextBoxComponent, TimePickerComponent } from 'ngx-core-components/inputs';
|
|
219
|
+
|
|
220
|
+
@Component({
|
|
221
|
+
standalone: true,
|
|
222
|
+
imports: [NumericTextBoxComponent, TimePickerComponent],
|
|
223
|
+
template: `
|
|
224
|
+
<ngx-numeric-textbox
|
|
225
|
+
[value]="quantity()"
|
|
226
|
+
label="Quantity"
|
|
227
|
+
[min]="0"
|
|
228
|
+
[max]="25"
|
|
229
|
+
[step]="1"
|
|
230
|
+
(valueChange)="quantity.set($event)"
|
|
231
|
+
/>
|
|
232
|
+
|
|
233
|
+
<ngx-time-picker
|
|
234
|
+
[value]="meetingTime()"
|
|
235
|
+
label="Meeting Time"
|
|
236
|
+
[use12h]="true"
|
|
237
|
+
(timeChange)="meetingTime.set($event)"
|
|
238
|
+
/>
|
|
239
|
+
`,
|
|
240
|
+
})
|
|
241
|
+
export class MyStructuredInputsComponent {
|
|
242
|
+
quantity = signal(3);
|
|
243
|
+
meetingTime = signal('14:30');
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`NumericTextBoxComponent` supports controlled values and keyboard stepping with the up and down arrow keys. `TimePickerComponent` accepts typed input such as `14:30` or `2:30 PM` and normalizes emitted values to `HH:mm`.
|
|
248
|
+
|
|
249
|
+
### List View
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { Component, computed, signal } from '@angular/core';
|
|
253
|
+
import { ListViewComponent, type ListViewPageChangeEvent } from 'ngx-core-components/views';
|
|
254
|
+
|
|
255
|
+
@Component({
|
|
256
|
+
standalone: true,
|
|
257
|
+
imports: [ListViewComponent],
|
|
258
|
+
template: `
|
|
259
|
+
<ngx-list-view
|
|
260
|
+
[items]="filteredPeople()"
|
|
261
|
+
[pageSize]="5"
|
|
262
|
+
[selectable]="true"
|
|
263
|
+
(pageChange)="onPageChange($event)"
|
|
264
|
+
(selectionChange)="selected.set($event.selectedItems)"
|
|
265
|
+
/>
|
|
266
|
+
`,
|
|
267
|
+
})
|
|
268
|
+
export class MyListComponent {
|
|
269
|
+
search = signal('');
|
|
270
|
+
selected = signal<unknown[]>([]);
|
|
271
|
+
people = [
|
|
272
|
+
{ name: 'Alice', dept: 'Engineering' },
|
|
273
|
+
{ name: 'Bob', dept: 'Product' },
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
filteredPeople = computed(() => this.people);
|
|
277
|
+
|
|
278
|
+
onPageChange(event: ListViewPageChangeEvent): void {
|
|
279
|
+
console.log(event.page, event.totalPages);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Splitter
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
import { Component, signal } from '@angular/core';
|
|
288
|
+
import { SplitterComponent } from 'ngx-core-components/layout';
|
|
289
|
+
|
|
290
|
+
@Component({
|
|
291
|
+
standalone: true,
|
|
292
|
+
imports: [SplitterComponent],
|
|
293
|
+
template: `
|
|
294
|
+
<div style="height: 320px; border: 1px solid #e9ecef; overflow: hidden;">
|
|
295
|
+
<ngx-splitter [size]="paneSize()" [min]="180" (sizeChange)="paneSize.set($event)">
|
|
296
|
+
<div pane1>Navigation</div>
|
|
297
|
+
<div pane2>Content</div>
|
|
298
|
+
</ngx-splitter>
|
|
299
|
+
</div>
|
|
300
|
+
`,
|
|
301
|
+
})
|
|
302
|
+
export class MyLayoutComponent {
|
|
303
|
+
paneSize = signal('35%');
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Data Grid
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
import { Component } from '@angular/core';
|
|
311
|
+
import { DataGridComponent, type GridColumnDef } from 'ngx-core-components';
|
|
312
|
+
|
|
313
|
+
@Component({
|
|
314
|
+
standalone: true,
|
|
315
|
+
imports: [DataGridComponent],
|
|
316
|
+
template: `<ngx-data-grid [data]="rows" [columns]="columns" [pageSize]="5" />`,
|
|
317
|
+
})
|
|
318
|
+
export class MyGridComponent {
|
|
319
|
+
columns: GridColumnDef[] = [
|
|
320
|
+
{ field: 'id', title: 'ID', width: 80 },
|
|
321
|
+
{ field: 'name', title: 'Name', sortable: true },
|
|
322
|
+
{ field: 'status', title: 'Status' },
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
rows = [
|
|
326
|
+
{ id: 1, name: 'Alpha', status: 'Active' },
|
|
327
|
+
{ id: 2, name: 'Beta', status: 'Paused' },
|
|
328
|
+
];
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
74
332
|
## API
|
|
75
333
|
|
|
334
|
+
This README focuses on the primary Gantt API because it is the largest surface in the package. The demo application under `projects/demo` shows usage and API reference coverage for the other components.
|
|
335
|
+
|
|
336
|
+
### Notable Secondary APIs
|
|
337
|
+
|
|
338
|
+
#### ListView Inputs
|
|
339
|
+
|
|
340
|
+
| Input | Type | Default | Description |
|
|
341
|
+
|-------|------|---------|-------------|
|
|
342
|
+
| `items` | `T[]` | `[]` | Items rendered in the list. |
|
|
343
|
+
| `labelField` | `string` | `'label'` | Field used by the default item renderer. |
|
|
344
|
+
| `selectable` | `boolean` | `true` | Enables row selection. |
|
|
345
|
+
| `multiselect` | `boolean` | `false` | Allows multi-selection. |
|
|
346
|
+
| `loading` | `boolean` | `false` | Shows the loading state. |
|
|
347
|
+
| `pageSize` | `number` | `0` | Enables built-in pagination when greater than `0`. |
|
|
348
|
+
|
|
349
|
+
#### ListView Outputs
|
|
350
|
+
|
|
351
|
+
| Output | Type | Description |
|
|
352
|
+
|--------|------|-------------|
|
|
353
|
+
| `itemClick` | `ListViewItemClickEvent<T>` | Fired when an item is clicked. |
|
|
354
|
+
| `selectionChange` | `ListViewSelectionEvent<T>` | Fired when selected items change. |
|
|
355
|
+
| `pageChange` | `ListViewPageChangeEvent` | Fired when the built-in pager changes pages. |
|
|
356
|
+
|
|
357
|
+
#### NumericTextBox Inputs
|
|
358
|
+
|
|
359
|
+
| Input | Type | Default | Description |
|
|
360
|
+
|-------|------|---------|-------------|
|
|
361
|
+
| `value` | `number` | `0` | Controlled numeric value displayed in the input. |
|
|
362
|
+
| `min` | `number` | `-Infinity` | Lower bound for allowed values. |
|
|
363
|
+
| `max` | `number` | `Infinity` | Upper bound for allowed values. |
|
|
364
|
+
| `step` | `number` | `1` | Increment and decrement amount. |
|
|
365
|
+
|
|
366
|
+
#### TimePicker Inputs
|
|
367
|
+
|
|
368
|
+
| Input | Type | Default | Description |
|
|
369
|
+
|-------|------|---------|-------------|
|
|
370
|
+
| `value` | `string` | `'09:00'` | Controlled time value. Accepts `HH:mm` or `h:mm AM/PM`. |
|
|
371
|
+
| `use12h` | `boolean` | `false` | Shows AM/PM controls while still emitting `HH:mm`. |
|
|
372
|
+
|
|
373
|
+
#### Splitter Inputs
|
|
374
|
+
|
|
375
|
+
| Input | Type | Default | Description |
|
|
376
|
+
|-------|------|---------|-------------|
|
|
377
|
+
| `size` | `string \| number` | `null` | Controlled size of the first pane in pixels or percent. |
|
|
378
|
+
| `initialSize` | `string \| number` | `'50%'` | Initial pane size when uncontrolled. |
|
|
379
|
+
| `min` | `number` | `60` | Minimum size of the first pane in pixels. |
|
|
380
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Split direction. |
|
|
381
|
+
|
|
382
|
+
#### Splitter Outputs
|
|
383
|
+
|
|
384
|
+
| Output | Type | Description |
|
|
385
|
+
|--------|------|-------------|
|
|
386
|
+
| `sizeChange` | `string` | Fired while the divider is dragged. |
|
|
387
|
+
|
|
76
388
|
### Inputs
|
|
77
389
|
|
|
78
390
|
| Input | Type | Default | Description |
|
|
@@ -104,7 +416,7 @@ export class MyComponent {
|
|
|
104
416
|
| `showTodayMarker` | `boolean` | `true` | Show today indicator line |
|
|
105
417
|
| `showGrid` | `boolean` | `true` | Show grid lines |
|
|
106
418
|
| `collapsible` | `boolean` | `true` | Allow tree collapse/expand |
|
|
107
|
-
| `snapTo` | `'
|
|
419
|
+
| `snapTo` | `'day' \| 'week' \| 'month'` | `'day'` | Snap granularity for drag and resize |
|
|
108
420
|
| `locale` | `string` | `'en-US'` | Locale for date formatting |
|
|
109
421
|
|
|
110
422
|
### GanttTask
|
|
@@ -134,11 +446,20 @@ ngx-gantt-chart {
|
|
|
134
446
|
--ngx-gantt-bar-progress-bg: #1e8449;
|
|
135
447
|
--ngx-gantt-today-color: #e74c3c;
|
|
136
448
|
--ngx-gantt-header-bg: #2c3e50;
|
|
137
|
-
--ngx-gantt-
|
|
449
|
+
--ngx-gantt-text: #ecf0f1;
|
|
138
450
|
}
|
|
139
451
|
```
|
|
140
452
|
|
|
141
|
-
|
|
453
|
+
Common Gantt custom properties include `--ngx-gantt-bg`, `--ngx-gantt-border`, `--ngx-gantt-grid-line`, `--ngx-gantt-header-bg`, `--ngx-gantt-text`, `--ngx-gantt-bar-bg`, `--ngx-gantt-bar-progress-bg`, and `--ngx-gantt-today-color`.
|
|
454
|
+
|
|
455
|
+
Other component groups expose their own CSS variable namespaces as well:
|
|
456
|
+
|
|
457
|
+
- Inputs: `--ngx-input-*`
|
|
458
|
+
- Charts: `--ngx-chart-*`
|
|
459
|
+
- Grid: `--ngx-grid-*`
|
|
460
|
+
- Tree/List: `--ngx-tree-*`, `--ngx-list-*`
|
|
461
|
+
- Tooltip/Popover: `--ngx-tooltip-*`, `--ngx-popover-*`
|
|
462
|
+
- Buttons and chips: `--ngx-btn-*`, `--ngx-chip-*`
|
|
142
463
|
|
|
143
464
|
## Public Methods
|
|
144
465
|
|
|
@@ -153,6 +474,10 @@ this.gantt.expandAll();
|
|
|
153
474
|
this.gantt.collapseAll();
|
|
154
475
|
```
|
|
155
476
|
|
|
477
|
+
## Demo Application
|
|
478
|
+
|
|
479
|
+
The repository includes a demo app under `projects/demo` covering live examples, how-to snippets, and API reference tables for the library components.
|
|
480
|
+
|
|
156
481
|
## License
|
|
157
482
|
|
|
158
483
|
MIT
|