snice 3.4.0 → 3.5.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/bin/templates/base/package.json +2 -2
- package/bin/templates/social/package.json +2 -2
- package/bin/templates/social/src/styles/global.css +56 -47
- package/dist/components/avatar/snice-avatar.d.ts +2 -2
- package/dist/components/avatar/snice-avatar.js +20 -21
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +8 -2
- package/dist/components/calendar/snice-calendar.js +160 -82
- package/dist/components/calendar/snice-calendar.js.map +1 -1
- package/dist/components/chart/snice-chart.js +50 -18
- package/dist/components/chart/snice-chart.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +4 -1
- package/dist/components/checkbox/snice-checkbox.js +46 -17
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/code-block/highlighter.d.ts +5 -0
- package/dist/components/code-block/highlighter.js +137 -0
- package/dist/components/code-block/highlighter.js.map +1 -0
- package/dist/components/code-block/highlighters/highlight.d.ts +64 -0
- package/dist/components/code-block/highlighters/highlight.js +108 -0
- package/dist/components/code-block/highlighters/highlight.js.map +1 -0
- package/dist/components/code-block/highlighters/prism.d.ts +41 -0
- package/dist/components/code-block/highlighters/prism.js +73 -0
- package/dist/components/code-block/highlighters/prism.js.map +1 -0
- package/dist/components/code-block/snice-code-block.d.ts +19 -1
- package/dist/components/code-block/snice-code-block.js +128 -29
- package/dist/components/code-block/snice-code-block.js.map +1 -1
- package/dist/components/code-block/snice-code-block.types.d.ts +15 -1
- package/dist/components/color-picker/snice-color-picker.d.ts +1 -0
- package/dist/components/color-picker/snice-color-picker.js +17 -6
- package/dist/components/color-picker/snice-color-picker.js.map +1 -1
- package/dist/components/date-picker/snice-date-picker.d.ts +1 -0
- package/dist/components/date-picker/snice-date-picker.js +16 -5
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +27 -73
- package/dist/components/doc/snice-doc.js +385 -534
- package/dist/components/doc/snice-doc.js.map +1 -1
- package/dist/components/draw/snice-draw.d.ts +4 -0
- package/dist/components/draw/snice-draw.js +134 -14
- package/dist/components/draw/snice-draw.js.map +1 -1
- package/dist/components/draw/snice-draw.types.d.ts +5 -0
- package/dist/components/file-upload/snice-file-upload.js +1 -1
- package/dist/components/input/snice-input.d.ts +2 -0
- package/dist/components/input/snice-input.js +34 -9
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kanban/snice-kanban.d.ts +13 -1
- package/dist/components/kanban/snice-kanban.js +191 -36
- package/dist/components/kanban/snice-kanban.js.map +1 -1
- package/dist/components/kanban/snice-kanban.types.d.ts +11 -1
- package/dist/components/kpi/snice-kpi.js +5 -1
- package/dist/components/kpi/snice-kpi.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.js +1 -1
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout.js +1 -1
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/location/snice-location.js +1 -1
- package/dist/components/location/snice-location.js.map +1 -1
- package/dist/components/radio/snice-radio.d.ts +1 -0
- package/dist/components/radio/snice-radio.js +17 -6
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -0
- package/dist/components/select/snice-select.js +48 -19
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +2 -0
- package/dist/components/slider/snice-slider.js +34 -14
- package/dist/components/slider/snice-slider.js.map +1 -1
- package/dist/components/snice-cell-HZ2iIBIC.js +4 -0
- package/dist/components/snice-cell-HZ2iIBIC.js.map +1 -0
- package/dist/components/split-pane/snice-split-pane.js +1 -1
- package/dist/components/split-pane/snice-split-pane.js.map +1 -1
- package/dist/components/switch/snice-switch.d.ts +1 -0
- package/dist/components/switch/snice-switch.js +16 -6
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.js +1 -1
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.js +1 -1
- package/dist/components/table/snice-cell-color.js +1 -1
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.js +1 -1
- package/dist/components/table/snice-cell-date.js +1 -1
- package/dist/components/table/snice-cell-duration.js +1 -1
- package/dist/components/table/snice-cell-email.js +1 -1
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.js +1 -1
- package/dist/components/table/snice-cell-image.js +1 -1
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.js +1 -1
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.js +1 -1
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.js +1 -1
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.js +1 -1
- package/dist/components/table/snice-cell-percentage.js +1 -1
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.js +1 -1
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.js +3 -3
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.js +2 -2
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.js +2 -2
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.js +1 -1
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.js +1 -1
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.js +1 -1
- package/dist/components/table/snice-cell.js +15 -10
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-header.js +1 -1
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-row.js +2 -2
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +1 -0
- package/dist/components/table/snice-table.js +24 -4
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/terminal/snice-terminal.d.ts +40 -0
- package/dist/components/terminal/snice-terminal.js +371 -0
- package/dist/components/terminal/snice-terminal.js.map +1 -0
- package/dist/components/terminal/snice-terminal.types.d.ts +20 -24
- package/dist/components/textarea/snice-textarea.d.ts +2 -0
- package/dist/components/textarea/snice-textarea.js +25 -6
- package/dist/components/textarea/snice-textarea.js.map +1 -1
- package/dist/components/theme/theme.css +16 -0
- package/dist/components/tree/snice-tree-item.d.ts +18 -4
- package/dist/components/tree/snice-tree-item.js +271 -88
- package/dist/components/tree/snice-tree-item.js.map +1 -1
- package/dist/components/tree/snice-tree-item.types.d.ts +3 -0
- package/dist/components/tree/snice-tree.d.ts +18 -2
- package/dist/components/tree/snice-tree.js +422 -56
- package/dist/components/tree/snice-tree.js.map +1 -1
- package/dist/components/tree/snice-tree.types.d.ts +1 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js +4 -2
- package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -1
- package/dist/index.cjs +42 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +42 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +42 -23
- package/dist/index.iife.js.map +1 -1
- package/dist/render-tracker.d.ts +1 -0
- package/dist/symbols.cjs +13 -14
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.esm.js +13 -14
- package/dist/symbols.esm.js.map +1 -1
- package/dist/template.d.ts +1 -0
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/api.md +37 -4
- package/docs/ai/components/doc.md +41 -106
- package/docs/ai/components/kanban.md +31 -9
- package/docs/ai/components/kpi.md +15 -0
- package/docs/components/doc.md +96 -212
- package/docs/components/kanban.md +119 -4
- package/docs/components/kpi.md +27 -0
- package/package.json +4 -1
- package/dist/components/actions/snice-actions.d.ts +0 -28
- package/dist/components/actions/snice-actions.js +0 -220
- package/dist/components/actions/snice-actions.js.map +0 -1
- package/dist/components/actions/snice-actions.types.d.ts +0 -27
- package/dist/components/doc/snice-doc.types.d.ts +0 -118
- package/dist/components/gantt/snice-gantt.d.ts +0 -29
- package/dist/components/gantt/snice-gantt.js +0 -268
- package/dist/components/gantt/snice-gantt.js.map +0 -1
- package/dist/components/gantt/snice-gantt.types.d.ts +0 -23
- package/dist/components/snice-cell-C0slgOpe.js +0 -4
- package/dist/components/snice-cell-C0slgOpe.js.map +0 -1
- package/dist/components/stat/snice-stat.d.ts +0 -14
- package/dist/components/stat/snice-stat.js +0 -140
- package/dist/components/stat/snice-stat.js.map +0 -1
- package/dist/components/stat/snice-stat.types.d.ts +0 -12
- package/docs/ai/components/actions.md +0 -81
- package/docs/ai/components/gantt.md +0 -95
- package/docs/ai/components/stat.md +0 -29
- package/docs/components/actions.md +0 -317
- package/docs/components/gantt.md +0 -347
- package/docs/components/stat.md +0 -45
package/docs/components/gantt.md
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
# Gantt Chart Component
|
|
2
|
-
|
|
3
|
-
Visual project timeline with task bars and progress tracking.
|
|
4
|
-
|
|
5
|
-
## Basic Usage
|
|
6
|
-
|
|
7
|
-
```javascript
|
|
8
|
-
const gantt = document.querySelector('snice-gantt');
|
|
9
|
-
|
|
10
|
-
gantt.tasks = [
|
|
11
|
-
{
|
|
12
|
-
id: 1,
|
|
13
|
-
name: 'Planning',
|
|
14
|
-
start: new Date(2024, 0, 1),
|
|
15
|
-
end: new Date(2024, 0, 7),
|
|
16
|
-
progress: 100
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
id: 2,
|
|
20
|
-
name: 'Development',
|
|
21
|
-
start: new Date(2024, 0, 8),
|
|
22
|
-
end: new Date(2024, 0, 31),
|
|
23
|
-
progress: 45
|
|
24
|
-
}
|
|
25
|
-
];
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Properties
|
|
29
|
-
|
|
30
|
-
| Property | Type | Default | Description |
|
|
31
|
-
|----------|------|---------|-------------|
|
|
32
|
-
| `tasks` | `GanttTask[]` | `[]` | Project tasks |
|
|
33
|
-
| `viewMode` | `'day' \| 'week' \| 'month' \| 'year'` | `'day'` | Timeline granularity |
|
|
34
|
-
| `showToday` | `boolean` | `true` | Highlight today |
|
|
35
|
-
| `showProgress` | `boolean` | `true` | Show progress bars |
|
|
36
|
-
| `showDependencies` | `boolean` | `false` | Show task dependencies |
|
|
37
|
-
| `minDate` | `Date \| string` | `''` | Timeline start date |
|
|
38
|
-
| `maxDate` | `Date \| string` | `''` | Timeline end date |
|
|
39
|
-
|
|
40
|
-
## GanttTask Interface
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
interface GanttTask {
|
|
44
|
-
id: string | number;
|
|
45
|
-
name: string;
|
|
46
|
-
start: Date | string;
|
|
47
|
-
end: Date | string;
|
|
48
|
-
progress?: number; // 0-100
|
|
49
|
-
dependencies?: (string | number)[];
|
|
50
|
-
color?: string;
|
|
51
|
-
data?: any;
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Methods
|
|
56
|
-
|
|
57
|
-
### `getTask(id: string | number): GanttTask | undefined`
|
|
58
|
-
Get task by ID.
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
const task = gantt.getTask(1);
|
|
62
|
-
console.log(task.name, task.progress);
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### `scrollToToday(): void`
|
|
66
|
-
Scroll viewport to today's date.
|
|
67
|
-
|
|
68
|
-
```javascript
|
|
69
|
-
gantt.scrollToToday();
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### `scrollToTask(id: string | number): void`
|
|
73
|
-
Scroll to specific task.
|
|
74
|
-
|
|
75
|
-
```javascript
|
|
76
|
-
gantt.scrollToTask(5);
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Events
|
|
80
|
-
|
|
81
|
-
### `@snice/gantt-task-click`
|
|
82
|
-
Dispatched when task bar is clicked.
|
|
83
|
-
|
|
84
|
-
```javascript
|
|
85
|
-
gantt.addEventListener('@snice/gantt-task-click', (e) => {
|
|
86
|
-
console.log('Task:', e.detail.task);
|
|
87
|
-
showTaskDetails(e.detail.task);
|
|
88
|
-
});
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Detail:** `{ task: GanttTask, gantt: SniceGanttElement }`
|
|
92
|
-
|
|
93
|
-
## Examples
|
|
94
|
-
|
|
95
|
-
### Basic Timeline
|
|
96
|
-
|
|
97
|
-
```javascript
|
|
98
|
-
gantt.tasks = [
|
|
99
|
-
{
|
|
100
|
-
id: 1,
|
|
101
|
-
name: 'Task 1',
|
|
102
|
-
start: new Date(2024, 0, 1),
|
|
103
|
-
end: new Date(2024, 0, 10)
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 2,
|
|
107
|
-
name: 'Task 2',
|
|
108
|
-
start: new Date(2024, 0, 11),
|
|
109
|
-
end: new Date(2024, 0, 20)
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### With Progress
|
|
115
|
-
|
|
116
|
-
```javascript
|
|
117
|
-
gantt.tasks = [
|
|
118
|
-
{
|
|
119
|
-
id: 1,
|
|
120
|
-
name: 'Design',
|
|
121
|
-
start: new Date(2024, 0, 1),
|
|
122
|
-
end: new Date(2024, 0, 14),
|
|
123
|
-
progress: 80
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 2,
|
|
127
|
-
name: 'Development',
|
|
128
|
-
start: new Date(2024, 0, 8),
|
|
129
|
-
end: new Date(2024, 0, 31),
|
|
130
|
-
progress: 35
|
|
131
|
-
}
|
|
132
|
-
];
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Color-Coded Tasks
|
|
136
|
-
|
|
137
|
-
```javascript
|
|
138
|
-
gantt.tasks = [
|
|
139
|
-
{
|
|
140
|
-
id: 1,
|
|
141
|
-
name: 'Planning',
|
|
142
|
-
start: new Date(2024, 0, 1),
|
|
143
|
-
end: new Date(2024, 0, 7),
|
|
144
|
-
color: '#4caf50',
|
|
145
|
-
progress: 100
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
id: 2,
|
|
149
|
-
name: 'In Progress',
|
|
150
|
-
start: new Date(2024, 0, 8),
|
|
151
|
-
end: new Date(2024, 0, 21),
|
|
152
|
-
color: '#ff9800',
|
|
153
|
-
progress: 40
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 3,
|
|
157
|
-
name: 'Not Started',
|
|
158
|
-
start: new Date(2024, 0, 22),
|
|
159
|
-
end: new Date(2024, 0, 31),
|
|
160
|
-
color: '#f44336',
|
|
161
|
-
progress: 0
|
|
162
|
-
}
|
|
163
|
-
];
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Different View Modes
|
|
167
|
-
|
|
168
|
-
```html
|
|
169
|
-
<button onclick="gantt.viewMode = 'day'">Day</button>
|
|
170
|
-
<button onclick="gantt.viewMode = 'week'">Week</button>
|
|
171
|
-
<button onclick="gantt.viewMode = 'month'">Month</button>
|
|
172
|
-
<button onclick="gantt.viewMode = 'year'">Year</button>
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### With Dependencies
|
|
176
|
-
|
|
177
|
-
```javascript
|
|
178
|
-
gantt.showDependencies = true;
|
|
179
|
-
|
|
180
|
-
gantt.tasks = [
|
|
181
|
-
{
|
|
182
|
-
id: 1,
|
|
183
|
-
name: 'Task A',
|
|
184
|
-
start: new Date(2024, 0, 1),
|
|
185
|
-
end: new Date(2024, 0, 5)
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: 2,
|
|
189
|
-
name: 'Task B',
|
|
190
|
-
start: new Date(2024, 0, 6),
|
|
191
|
-
end: new Date(2024, 0, 12),
|
|
192
|
-
dependencies: [1] // Depends on Task A
|
|
193
|
-
}
|
|
194
|
-
];
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Date Range
|
|
198
|
-
|
|
199
|
-
```html
|
|
200
|
-
<snice-gantt
|
|
201
|
-
min-date="2024-01-01"
|
|
202
|
-
max-date="2024-12-31">
|
|
203
|
-
</snice-gantt>
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Event Handling
|
|
207
|
-
|
|
208
|
-
```javascript
|
|
209
|
-
gantt.addEventListener('@snice/gantt-task-click', (e) => {
|
|
210
|
-
const task = e.detail.task;
|
|
211
|
-
|
|
212
|
-
// Show task modal
|
|
213
|
-
showModal({
|
|
214
|
-
title: task.name,
|
|
215
|
-
content: `
|
|
216
|
-
Start: ${task.start.toLocaleDateString()}
|
|
217
|
-
End: ${task.end.toLocaleDateString()}
|
|
218
|
-
Progress: ${task.progress}%
|
|
219
|
-
`
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Software Project
|
|
225
|
-
|
|
226
|
-
```javascript
|
|
227
|
-
gantt.tasks = [
|
|
228
|
-
{
|
|
229
|
-
id: 1,
|
|
230
|
-
name: 'Requirements Gathering',
|
|
231
|
-
start: new Date(2024, 0, 1),
|
|
232
|
-
end: new Date(2024, 0, 14),
|
|
233
|
-
progress: 100,
|
|
234
|
-
color: '#4caf50'
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: 2,
|
|
238
|
-
name: 'Design',
|
|
239
|
-
start: new Date(2024, 0, 15),
|
|
240
|
-
end: new Date(2024, 0, 31),
|
|
241
|
-
progress: 75,
|
|
242
|
-
color: '#2196f3',
|
|
243
|
-
dependencies: [1]
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
id: 3,
|
|
247
|
-
name: 'Development',
|
|
248
|
-
start: new Date(2024, 1, 1),
|
|
249
|
-
end: new Date(2024, 2, 31),
|
|
250
|
-
progress: 40,
|
|
251
|
-
color: '#ff9800',
|
|
252
|
-
dependencies: [2]
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
id: 4,
|
|
256
|
-
name: 'Testing',
|
|
257
|
-
start: new Date(2024, 3, 1),
|
|
258
|
-
end: new Date(2024, 3, 30),
|
|
259
|
-
progress: 0,
|
|
260
|
-
color: '#9c27b0',
|
|
261
|
-
dependencies: [3]
|
|
262
|
-
}
|
|
263
|
-
];
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
### Construction Project
|
|
267
|
-
|
|
268
|
-
```javascript
|
|
269
|
-
gantt.viewMode = 'week';
|
|
270
|
-
|
|
271
|
-
gantt.tasks = [
|
|
272
|
-
{ id: 1, name: 'Site Preparation', start: '2024-01-01', end: '2024-01-14', progress: 100 },
|
|
273
|
-
{ id: 2, name: 'Foundation', start: '2024-01-15', end: '2024-02-15', progress: 60 },
|
|
274
|
-
{ id: 3, name: 'Framing', start: '2024-02-16', end: '2024-03-30', progress: 20 },
|
|
275
|
-
{ id: 4, name: 'Roofing', start: '2024-04-01', end: '2024-04-21', progress: 0 },
|
|
276
|
-
{ id: 5, name: 'Interior', start: '2024-04-22', end: '2024-06-30', progress: 0 }
|
|
277
|
-
];
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
### Marketing Campaign
|
|
281
|
-
|
|
282
|
-
```javascript
|
|
283
|
-
gantt.tasks = [
|
|
284
|
-
{
|
|
285
|
-
id: 1,
|
|
286
|
-
name: 'Campaign Planning',
|
|
287
|
-
start: new Date(2024, 0, 1),
|
|
288
|
-
end: new Date(2024, 0, 7),
|
|
289
|
-
progress: 100
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
id: 2,
|
|
293
|
-
name: 'Content Creation',
|
|
294
|
-
start: new Date(2024, 0, 8),
|
|
295
|
-
end: new Date(2024, 0, 21),
|
|
296
|
-
progress: 70
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: 3,
|
|
300
|
-
name: 'Social Media',
|
|
301
|
-
start: new Date(2024, 0, 15),
|
|
302
|
-
end: new Date(2024, 1, 15),
|
|
303
|
-
progress: 30
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
id: 4,
|
|
307
|
-
name: 'Email Campaign',
|
|
308
|
-
start: new Date(2024, 0, 22),
|
|
309
|
-
end: new Date(2024, 1, 10),
|
|
310
|
-
progress: 10
|
|
311
|
-
}
|
|
312
|
-
];
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Dynamic Updates
|
|
316
|
-
|
|
317
|
-
```javascript
|
|
318
|
-
// Update progress
|
|
319
|
-
function updateProgress(taskId, progress) {
|
|
320
|
-
gantt.tasks = gantt.tasks.map(task =>
|
|
321
|
-
task.id === taskId ? { ...task, progress } : task
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Add task
|
|
326
|
-
function addTask(task) {
|
|
327
|
-
gantt.tasks = [...gantt.tasks, task];
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Remove task
|
|
331
|
-
function removeTask(taskId) {
|
|
332
|
-
gantt.tasks = gantt.tasks.filter(t => t.id !== taskId);
|
|
333
|
-
}
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
## Accessibility
|
|
337
|
-
|
|
338
|
-
- Keyboard navigation
|
|
339
|
-
- ARIA labels for tasks
|
|
340
|
-
- Screen reader friendly
|
|
341
|
-
- High contrast support
|
|
342
|
-
|
|
343
|
-
## Browser Support
|
|
344
|
-
|
|
345
|
-
- Modern browsers with Custom Elements v1 support
|
|
346
|
-
- Date calculations via Date API
|
|
347
|
-
- Responsive timeline scaling
|
package/docs/components/stat.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Stat Component
|
|
2
|
-
|
|
3
|
-
Display statistics with labels, values, trends, and icons.
|
|
4
|
-
|
|
5
|
-
## Basic Usage
|
|
6
|
-
|
|
7
|
-
```html
|
|
8
|
-
<snice-stat
|
|
9
|
-
label="Total Revenue"
|
|
10
|
-
value="$45,231"
|
|
11
|
-
change="+12%"
|
|
12
|
-
trend="up"
|
|
13
|
-
icon="💰">
|
|
14
|
-
</snice-stat>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Properties
|
|
18
|
-
|
|
19
|
-
| Property | Type | Default | Description |
|
|
20
|
-
|----------|------|---------|-------------|
|
|
21
|
-
| `label` | `string` | `''` | Stat label |
|
|
22
|
-
| `value` | `string \| number` | `''` | Stat value |
|
|
23
|
-
| `change` | `string \| number` | `''` | Change indicator |
|
|
24
|
-
| `trend` | `'up' \| 'down' \| 'neutral'` | `'neutral'` | Trend direction |
|
|
25
|
-
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Stat size |
|
|
26
|
-
| `icon` | `string` | `''` | Text/emoji icon |
|
|
27
|
-
| `iconImage` | `string` | `''` | Icon image URL |
|
|
28
|
-
| `colorValue` | `boolean` | `false` | Color value by trend |
|
|
29
|
-
|
|
30
|
-
## Examples
|
|
31
|
-
|
|
32
|
-
```html
|
|
33
|
-
<!-- With trend -->
|
|
34
|
-
<snice-stat label="Sales" value="$1,234" change="+25%" trend="up"></snice-stat>
|
|
35
|
-
|
|
36
|
-
<!-- Colored value -->
|
|
37
|
-
<snice-stat label="Revenue" value="$5,678" trend="up" color-value></snice-stat>
|
|
38
|
-
|
|
39
|
-
<!-- Different sizes -->
|
|
40
|
-
<snice-stat label="Users" value="1,234" size="small"></snice-stat>
|
|
41
|
-
<snice-stat label="Revenue" value="$56,789" size="large"></snice-stat>
|
|
42
|
-
|
|
43
|
-
<!-- With icons -->
|
|
44
|
-
<snice-stat label="Traffic" value="12.5K" icon="📊"></snice-stat>
|
|
45
|
-
```
|