ngx-core-components 0.0.3
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 +158 -0
- package/fesm2022/ngx-core-components.mjs +3588 -0
- package/fesm2022/ngx-core-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/charts/bar-chart/bar-chart.component.d.ts +44 -0
- package/lib/charts/line-chart/line-chart.component.d.ts +45 -0
- package/lib/charts/pie-chart/pie-chart.component.d.ts +53 -0
- package/lib/charts/shared/chart-utils.d.ts +19 -0
- package/lib/charts/sparkline/sparkline.component.d.ts +26 -0
- package/lib/data-grid/data-grid.component.d.ts +61 -0
- package/lib/gantt-chart/gantt-chart.component.d.ts +81 -0
- package/lib/gantt-chart/models/gantt-config.model.d.ts +25 -0
- package/lib/gantt-chart/models/gantt-dependency.model.d.ts +13 -0
- package/lib/gantt-chart/models/gantt-event.model.d.ts +21 -0
- package/lib/gantt-chart/models/gantt-task.model.d.ts +14 -0
- package/lib/gantt-chart/models/index.d.ts +4 -0
- package/lib/gantt-chart/services/gantt-keyboard.service.d.ts +12 -0
- package/lib/gantt-chart/services/gantt-layout.service.d.ts +14 -0
- package/lib/gantt-chart/services/gantt-scale.service.d.ts +10 -0
- package/lib/gantt-chart/utils/date-utils.d.ts +18 -0
- package/lib/gantt-chart/utils/svg-utils.d.ts +8 -0
- package/lib/inputs/date-picker/date-picker.component.d.ts +35 -0
- package/lib/inputs/dropdown/dropdown.component.d.ts +30 -0
- package/lib/inputs/multi-select/multi-select.component.d.ts +32 -0
- package/lib/inputs/textbox/textbox.component.d.ts +19 -0
- package/lib/list-view/list-view.component.d.ts +29 -0
- package/lib/tooltip/popover.component.d.ts +12 -0
- package/lib/tooltip/tooltip.directive.d.ts +15 -0
- package/lib/tree-view/tree-view.component.d.ts +40 -0
- package/package.json +46 -0
- package/public-api.d.ts +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# ngx-core-components
|
|
2
|
+
|
|
3
|
+
Angular 19+ component library featuring a full-featured **SVG Gantt Chart**.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/ngx-core-components)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Task bars** with progress indicators
|
|
11
|
+
- **Dependency arrows** (FS, SS, FF, SF)
|
|
12
|
+
- **Drag-to-move** and **drag-to-resize** tasks
|
|
13
|
+
- **Zoom levels** — Day / Week / Month
|
|
14
|
+
- **Today marker** — dashed vertical line
|
|
15
|
+
- **Milestones** — diamond-shaped markers
|
|
16
|
+
- **Tree hierarchy** — collapsible task groups in a sidebar
|
|
17
|
+
- **Keyboard accessible** — Arrow keys, Enter, Escape
|
|
18
|
+
- **Fully themeable** via CSS custom properties
|
|
19
|
+
- **Zero runtime dependencies** — only Angular peer deps
|
|
20
|
+
- **OnPush change detection** + Angular Signals
|
|
21
|
+
- **Standalone components** (no NgModules)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install ngx-core-components
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { Component } from '@angular/core';
|
|
33
|
+
import { GanttChartComponent, GanttTask, GanttDependency, DependencyType } from 'ngx-core-components';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
standalone: true,
|
|
37
|
+
imports: [GanttChartComponent],
|
|
38
|
+
template: `
|
|
39
|
+
<ngx-gantt-chart
|
|
40
|
+
[tasks]="tasks"
|
|
41
|
+
[dependencies]="dependencies"
|
|
42
|
+
[config]="{ zoomLevel: 'day', rowHeight: 40 }"
|
|
43
|
+
(taskChange)="onTaskChange($event)"
|
|
44
|
+
(taskClick)="onTaskClick($event)"
|
|
45
|
+
/>
|
|
46
|
+
`,
|
|
47
|
+
styles: [`
|
|
48
|
+
ngx-gantt-chart { height: 500px; }
|
|
49
|
+
`]
|
|
50
|
+
})
|
|
51
|
+
export class MyComponent {
|
|
52
|
+
tasks: GanttTask[] = [
|
|
53
|
+
{
|
|
54
|
+
id: '1', name: 'Design', progress: 100,
|
|
55
|
+
start: new Date('2026-04-01'), end: new Date('2026-04-05'),
|
|
56
|
+
parentId: null, collapsed: false, isMilestone: false,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: '2', name: 'Development', progress: 40,
|
|
60
|
+
start: new Date('2026-04-06'), end: new Date('2026-04-15'),
|
|
61
|
+
parentId: null, collapsed: false, isMilestone: false,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
dependencies: GanttDependency[] = [
|
|
66
|
+
{ fromId: '1', toId: '2', type: DependencyType.FinishToStart },
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
onTaskChange(event: any) { /* handle drag/resize */ }
|
|
70
|
+
onTaskClick(event: any) { /* handle click */ }
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## API
|
|
75
|
+
|
|
76
|
+
### Inputs
|
|
77
|
+
|
|
78
|
+
| Input | Type | Default | Description |
|
|
79
|
+
|-------|------|---------|-------------|
|
|
80
|
+
| `tasks` | `GanttTask[]` | **required** | Array of tasks to display |
|
|
81
|
+
| `dependencies` | `GanttDependency[]` | `[]` | Dependency links between tasks |
|
|
82
|
+
| `config` | `Partial<GanttConfig>` | `{}` | Configuration options (merged with defaults) |
|
|
83
|
+
|
|
84
|
+
### Outputs
|
|
85
|
+
|
|
86
|
+
| Output | Type | Description |
|
|
87
|
+
|--------|------|-------------|
|
|
88
|
+
| `taskChange` | `GanttTaskChangeEvent` | Emitted after drag/resize completes |
|
|
89
|
+
| `taskClick` | `GanttTaskClickEvent` | Task bar clicked |
|
|
90
|
+
| `taskDblClick` | `GanttTaskClickEvent` | Task bar double-clicked |
|
|
91
|
+
| `dependencyClick` | `GanttDependencyClickEvent` | Dependency arrow clicked |
|
|
92
|
+
| `scroll` | `GanttScrollEvent` | Chart scrolled |
|
|
93
|
+
| `zoomChange` | `ZoomLevel` | Zoom level changed |
|
|
94
|
+
|
|
95
|
+
### GanttConfig
|
|
96
|
+
|
|
97
|
+
| Property | Type | Default | Description |
|
|
98
|
+
|----------|------|---------|-------------|
|
|
99
|
+
| `zoomLevel` | `'day' \| 'week' \| 'month'` | `'day'` | Timeline granularity |
|
|
100
|
+
| `rowHeight` | `number` | `40` | Height of each row in pixels |
|
|
101
|
+
| `columnWidth` | `number` | `40` | Width of each time-unit column |
|
|
102
|
+
| `sidebarWidth` | `number` | `280` | Width of the tree sidebar |
|
|
103
|
+
| `headerHeight` | `number` | `60` | Height of the timeline header |
|
|
104
|
+
| `showTodayMarker` | `boolean` | `true` | Show today indicator line |
|
|
105
|
+
| `showGrid` | `boolean` | `true` | Show grid lines |
|
|
106
|
+
| `collapsible` | `boolean` | `true` | Allow tree collapse/expand |
|
|
107
|
+
| `snapTo` | `'none' \| 'day' \| 'hour'` | `'day'` | Snap granularity for drag |
|
|
108
|
+
| `locale` | `string` | `'en-US'` | Locale for date formatting |
|
|
109
|
+
|
|
110
|
+
### GanttTask
|
|
111
|
+
|
|
112
|
+
| Property | Type | Description |
|
|
113
|
+
|----------|------|-------------|
|
|
114
|
+
| `id` | `string` | Unique identifier |
|
|
115
|
+
| `name` | `string` | Display name |
|
|
116
|
+
| `start` | `Date` | Start date |
|
|
117
|
+
| `end` | `Date` | End date |
|
|
118
|
+
| `progress` | `number` | 0–100 completion percentage |
|
|
119
|
+
| `parentId` | `string \| null` | Parent task ID for hierarchy |
|
|
120
|
+
| `collapsed` | `boolean` | Whether children are collapsed |
|
|
121
|
+
| `isMilestone` | `boolean` | Render as diamond marker |
|
|
122
|
+
| `color?` | `string` | Bar color override |
|
|
123
|
+
| `draggable?` | `boolean` | Enable drag/resize (default: true) |
|
|
124
|
+
| `cssClass?` | `string` | Custom CSS class |
|
|
125
|
+
| `meta?` | `Record<string, unknown>` | Arbitrary data |
|
|
126
|
+
|
|
127
|
+
## Theming
|
|
128
|
+
|
|
129
|
+
Override CSS custom properties on the `ngx-gantt-chart` element:
|
|
130
|
+
|
|
131
|
+
```css
|
|
132
|
+
ngx-gantt-chart {
|
|
133
|
+
--ngx-gantt-bar-bg: #27ae60;
|
|
134
|
+
--ngx-gantt-bar-progress-bg: #1e8449;
|
|
135
|
+
--ngx-gantt-today-color: #e74c3c;
|
|
136
|
+
--ngx-gantt-header-bg: #2c3e50;
|
|
137
|
+
--ngx-gantt-header-text-color: #ecf0f1;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
All available CSS custom properties: `--ngx-gantt-bg`, `--ngx-gantt-border-color`, `--ngx-gantt-grid-line-color`, `--ngx-gantt-weekend-bg`, `--ngx-gantt-header-bg`, `--ngx-gantt-header-text-color`, `--ngx-gantt-bar-bg`, `--ngx-gantt-bar-progress-bg`, `--ngx-gantt-bar-text-color`, `--ngx-gantt-milestone-color`, `--ngx-gantt-arrow-color`, `--ngx-gantt-today-color`, `--ngx-gantt-sidebar-bg`, `--ngx-gantt-sidebar-hover-bg`, `--ngx-gantt-focus-ring-color`, `--ngx-gantt-font-family`, `--ngx-gantt-font-size`, `--ngx-gantt-header-font-size`.
|
|
142
|
+
|
|
143
|
+
## Public Methods
|
|
144
|
+
|
|
145
|
+
Access via `ViewChild`:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
@ViewChild(GanttChartComponent) gantt!: GanttChartComponent;
|
|
149
|
+
|
|
150
|
+
this.gantt.scrollToDate(new Date('2026-04-15'));
|
|
151
|
+
this.gantt.scrollToTask('task-42');
|
|
152
|
+
this.gantt.expandAll();
|
|
153
|
+
this.gantt.collapseAll();
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT
|