argent-grid 0.1.0 → 0.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.
Files changed (122) hide show
  1. package/.github/workflows/ci.yml +69 -0
  2. package/.github/workflows/pages.yml +6 -12
  3. package/.storybook/main.ts +20 -0
  4. package/.storybook/preview.ts +18 -0
  5. package/.storybook/tsconfig.json +24 -0
  6. package/AGENTS.md +70 -27
  7. package/README.md +51 -34
  8. package/angular.json +66 -0
  9. package/biome.json +66 -0
  10. package/demo-app/e2e/selection-screenshot.spec.ts +20 -0
  11. package/docs/AG-GRID-COMPARISON.md +725 -0
  12. package/docs/CELL-RENDERER-GUIDE.md +241 -0
  13. package/docs/CONTEXT-MENU-GUIDE.md +371 -0
  14. package/docs/LIVE-DATA-OPTIMIZATIONS.md +497 -0
  15. package/docs/PERFORMANCE-OPTIMIZATIONS-PHASE1.md +162 -0
  16. package/docs/PERFORMANCE-REVIEW.md +571 -0
  17. package/docs/RESEARCH-STATUS.md +234 -0
  18. package/docs/STATE-PERSISTENCE-GUIDE.md +370 -0
  19. package/docs/STORYBOOK-REFACTOR.md +215 -0
  20. package/docs/STORYBOOK-STATUS.md +156 -0
  21. package/docs/TEST-COVERAGE-REPORT.md +276 -0
  22. package/docs/THEME-API-GUIDE.md +445 -0
  23. package/docs/THEME-API-PLAN.md +364 -0
  24. package/e2e/advanced.spec.ts +109 -0
  25. package/e2e/argentgrid.spec.ts +65 -0
  26. package/e2e/benchmark.spec.ts +52 -0
  27. package/e2e/cell-renderers.spec.ts +152 -0
  28. package/e2e/debug-streaming.spec.ts +31 -0
  29. package/e2e/dnd.spec.ts +73 -0
  30. package/e2e/screenshots.spec.ts +52 -0
  31. package/e2e/theming.spec.ts +35 -0
  32. package/e2e/visual.spec.ts +112 -0
  33. package/e2e/visual.spec.ts-snapshots/checkbox-renderer-mixed.png +0 -0
  34. package/e2e/visual.spec.ts-snapshots/debug.png +0 -0
  35. package/e2e/visual.spec.ts-snapshots/grid-column-group-headers.png +0 -0
  36. package/e2e/visual.spec.ts-snapshots/grid-default.png +0 -0
  37. package/e2e/visual.spec.ts-snapshots/grid-empty-state.png +0 -0
  38. package/e2e/visual.spec.ts-snapshots/grid-filter-popup.png +0 -0
  39. package/e2e/visual.spec.ts-snapshots/grid-scroll-borders.png +0 -0
  40. package/e2e/visual.spec.ts-snapshots/grid-sidebar-buttons.png +0 -0
  41. package/e2e/visual.spec.ts-snapshots/grid-text-filter.png +0 -0
  42. package/e2e/visual.spec.ts-snapshots/grid-with-selection.png +0 -0
  43. package/e2e/visual.spec.ts-snapshots/rating-renderer-varied.png +0 -0
  44. package/package.json +21 -7
  45. package/plan.md +56 -28
  46. package/playwright.config.ts +38 -0
  47. package/setup-vitest.ts +10 -13
  48. package/src/lib/argent-grid.module.ts +10 -12
  49. package/src/lib/components/argent-grid.component.css +281 -321
  50. package/src/lib/components/argent-grid.component.html +295 -207
  51. package/src/lib/components/argent-grid.component.spec.ts +120 -160
  52. package/src/lib/components/argent-grid.component.ts +1193 -290
  53. package/src/lib/components/argent-grid.regressions.spec.ts +301 -0
  54. package/src/lib/components/argent-grid.selection.spec.ts +132 -0
  55. package/src/lib/components/set-filter/set-filter.component.spec.ts +191 -0
  56. package/src/lib/components/set-filter/set-filter.component.ts +307 -0
  57. package/src/lib/directives/ag-grid-compatibility.directive.ts +16 -26
  58. package/src/lib/directives/click-outside.directive.ts +19 -0
  59. package/src/lib/rendering/canvas-renderer.spec.ts +513 -0
  60. package/src/lib/rendering/canvas-renderer.ts +456 -452
  61. package/src/lib/rendering/live-data-handler.ts +110 -0
  62. package/src/lib/rendering/live-data-optimizations.ts +133 -0
  63. package/src/lib/rendering/render/blit.spec.ts +16 -27
  64. package/src/lib/rendering/render/blit.ts +48 -36
  65. package/src/lib/rendering/render/cells.spec.ts +132 -0
  66. package/src/lib/rendering/render/cells.ts +167 -28
  67. package/src/lib/rendering/render/column-utils.ts +95 -0
  68. package/src/lib/rendering/render/hit-test.ts +50 -0
  69. package/src/lib/rendering/render/index.ts +88 -76
  70. package/src/lib/rendering/render/lines.ts +53 -47
  71. package/src/lib/rendering/render/primitives.ts +423 -0
  72. package/src/lib/rendering/render/theme.spec.ts +8 -12
  73. package/src/lib/rendering/render/theme.ts +7 -10
  74. package/src/lib/rendering/render/types.ts +3 -2
  75. package/src/lib/rendering/render/walk.spec.ts +35 -38
  76. package/src/lib/rendering/render/walk.ts +94 -64
  77. package/src/lib/rendering/utils/damage-tracker.spec.ts +8 -7
  78. package/src/lib/rendering/utils/damage-tracker.ts +6 -18
  79. package/src/lib/rendering/utils/index.ts +1 -1
  80. package/src/lib/services/grid.service.set-filter.spec.ts +219 -0
  81. package/src/lib/services/grid.service.spec.ts +1241 -201
  82. package/src/lib/services/grid.service.ts +1204 -235
  83. package/src/lib/themes/parts/color-schemes.ts +132 -0
  84. package/src/lib/themes/parts/icon-sets.ts +258 -0
  85. package/src/lib/themes/theme-builder.ts +347 -0
  86. package/src/lib/themes/theme-quartz.ts +72 -0
  87. package/src/lib/themes/types.ts +238 -0
  88. package/src/lib/types/ag-grid-types.ts +573 -14
  89. package/src/public-api.ts +39 -9
  90. package/src/stories/Advanced.stories.ts +249 -0
  91. package/src/stories/ArgentGrid.stories.ts +301 -0
  92. package/src/stories/Benchmark.stories.ts +76 -0
  93. package/src/stories/CellRenderers.stories.ts +395 -0
  94. package/src/stories/Filtering.stories.ts +292 -0
  95. package/src/stories/Grouping.stories.ts +290 -0
  96. package/src/stories/Streaming.stories.ts +57 -0
  97. package/src/stories/Theming.stories.ts +137 -0
  98. package/src/stories/Tooltips.stories.ts +381 -0
  99. package/src/stories/benchmark-wrapper.component.ts +355 -0
  100. package/src/stories/story-utils.ts +88 -0
  101. package/src/stories/streaming-wrapper.component.ts +441 -0
  102. package/tsconfig.json +1 -0
  103. package/tsconfig.storybook.json +10 -0
  104. package/vitest.config.ts +9 -9
  105. package/demo-app/README.md +0 -70
  106. package/demo-app/angular.json +0 -78
  107. package/demo-app/e2e/benchmark.spec.ts +0 -53
  108. package/demo-app/e2e/demo-page.spec.ts +0 -77
  109. package/demo-app/e2e/grid-features.spec.ts +0 -269
  110. package/demo-app/package-lock.json +0 -14023
  111. package/demo-app/package.json +0 -36
  112. package/demo-app/playwright-test-menu.js +0 -19
  113. package/demo-app/playwright.config.ts +0 -23
  114. package/demo-app/src/app/app.component.ts +0 -10
  115. package/demo-app/src/app/app.config.ts +0 -13
  116. package/demo-app/src/app/app.routes.ts +0 -7
  117. package/demo-app/src/app/demo-page/demo-page.component.css +0 -313
  118. package/demo-app/src/app/demo-page/demo-page.component.html +0 -124
  119. package/demo-app/src/app/demo-page/demo-page.component.ts +0 -366
  120. package/demo-app/src/index.html +0 -19
  121. package/demo-app/src/main.ts +0 -6
  122. package/demo-app/tsconfig.json +0 -31
@@ -0,0 +1,445 @@
1
+ # ArgentGrid Theme API Guide
2
+
3
+ **Compatible with AG Grid's New Theming API (v32.2+)**
4
+
5
+ ---
6
+
7
+ ## 🎨 Overview
8
+
9
+ ArgentGrid now supports a **programmatic Theme API** that allows you to customize the grid's appearance using JavaScript/TypeScript instead of CSS. This provides:
10
+
11
+ - ✅ **TypeScript validation** and autocomplete
12
+ - ✅ **Chainable customization** with `withParams()` and `withPart()`
13
+ - ✅ **Modular theming** with reusable parts
14
+ - ✅ **No CSS required** for most customizations
15
+
16
+ ---
17
+
18
+ ## 🚀 Quick Start
19
+
20
+ ### 1. Import a Built-in Theme
21
+
22
+ ```typescript
23
+ import { themeQuartz } from 'argent-grid';
24
+
25
+ // Apply theme to grid
26
+ gridOptions.theme = themeQuartz;
27
+ ```
28
+
29
+ ### 2. Customize with Parameters
30
+
31
+ ```typescript
32
+ import { themeQuartz } from 'argent-grid';
33
+
34
+ const myTheme = themeQuartz.withParams({
35
+ spacing: 12,
36
+ accentColor: 'red',
37
+ fontSize: 14,
38
+ rowHeight: 48,
39
+ });
40
+
41
+ gridOptions.theme = myTheme;
42
+ ```
43
+
44
+ ### 3. Mix and Match Parts
45
+
46
+ ```typescript
47
+ import { themeQuartz, colorSchemeDark, iconSetMaterial } from 'argent-grid';
48
+
49
+ const myTheme = themeQuartz
50
+ .withPart(colorSchemeDark)
51
+ .withPart(iconSetMaterial);
52
+
53
+ gridOptions.theme = myTheme;
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 📦 Built-in Themes
59
+
60
+ ### themeQuartz ⭐ **Recommended**
61
+
62
+ Modern, high-contrast theme suitable for most applications.
63
+
64
+ ```typescript
65
+ import { themeQuartz } from 'argent-grid';
66
+
67
+ gridOptions.theme = themeQuartz;
68
+ ```
69
+
70
+ ### themeBalham
71
+
72
+ Spreadsheet-style, compact theme for dense data display.
73
+
74
+ ```typescript
75
+ import { themeBalham } from 'argent-grid';
76
+
77
+ gridOptions.theme = themeBalham;
78
+ ```
79
+
80
+ ### themeAlpine
81
+
82
+ Classic, clean theme (legacy, but still supported).
83
+
84
+ ```typescript
85
+ import { themeAlpine } from 'argent-grid';
86
+
87
+ gridOptions.theme = themeAlpine;
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 🎨 Theme Customization
93
+
94
+ ### withParams() Method
95
+
96
+ Customize theme parameters:
97
+
98
+ ```typescript
99
+ const myTheme = themeQuartz.withParams({
100
+ // Colors
101
+ accentColor: '#ff5722',
102
+ backgroundColor: '#ffffff',
103
+ foregroundColor: '#333333',
104
+
105
+ // Typography
106
+ fontFamily: 'Inter, sans-serif',
107
+ fontSize: 14,
108
+ fontWeight: 400,
109
+
110
+ // Spacing
111
+ spacing: 8,
112
+ rowHeight: 48,
113
+ headerHeight: 48,
114
+ cellPadding: 12,
115
+
116
+ // Borders
117
+ borderColor: '#e0e0e0',
118
+ borderWidth: 1,
119
+ borderRadius: 4,
120
+ });
121
+ ```
122
+
123
+ ### Available Parameters
124
+
125
+ | Category | Parameters |
126
+ |----------|------------|
127
+ | **Colors** | `accentColor`, `backgroundColor`, `foregroundColor`, `secondaryForegroundColor` |
128
+ | **Typography** | `fontFamily`, `fontSize`, `fontWeight`, `headerFontWeight` |
129
+ | **Spacing** | `spacing`, `rowHeight`, `headerHeight`, `cellPadding` |
130
+ | **Borders** | `borderColor`, `borderWidth`, `borderRadius` |
131
+ | **Specific** | `headerBackgroundColor`, `rowBackgroundColor`, `rowEvenBackgroundColor`, `rowHoverBackgroundColor`, `rowSelectedBackgroundColor` |
132
+ | **Group Row** | `groupRowBackgroundColor`, `groupRowIndentWidth` |
133
+ | **Icons** | `iconColor`, `iconSize` |
134
+ | **Focus** | `focusBorderColor`, `focusBorderWidth` |
135
+
136
+ ---
137
+
138
+ ## 🧩 Theme Parts
139
+
140
+ Parts are modular theme components that can be mixed and matched.
141
+
142
+ ### Color Schemes
143
+
144
+ ```typescript
145
+ import { themeQuartz, colorSchemeDark } from 'argent-grid';
146
+
147
+ // Apply dark color scheme
148
+ const myTheme = themeQuartz.withPart(colorSchemeDark);
149
+ ```
150
+
151
+ **Available Color Schemes:**
152
+ - `colorSchemeLight` - Default light mode
153
+ - `colorSchemeDark` - Dark mode
154
+ - `colorSchemeAuto` - Follows system preference
155
+
156
+ ### Icon Sets
157
+
158
+ ```typescript
159
+ import { themeQuartz, iconSetMaterial } from 'argent-grid';
160
+
161
+ // Use Material Design icons
162
+ const myTheme = themeQuartz.withPart(iconSetMaterial);
163
+ ```
164
+
165
+ **Available Icon Sets:**
166
+ - `iconSetQuartz` - Default Quartz icons
167
+ - `iconSetMaterial` - Material Design icons
168
+ - `iconSetMinimal` - Minimal line icons
169
+
170
+ ### Chaining Parts
171
+
172
+ ```typescript
173
+ import {
174
+ themeQuartz,
175
+ colorSchemeDark,
176
+ iconSetMaterial
177
+ } from 'argent-grid';
178
+
179
+ const myTheme = themeQuartz
180
+ .withPart(colorSchemeDark)
181
+ .withPart(iconSetMaterial);
182
+ ```
183
+
184
+ ---
185
+
186
+ ## 🛠️ Advanced Usage
187
+
188
+ ### createPart() API
189
+
190
+ Create custom reusable parts:
191
+
192
+ ```typescript
193
+ import { createPart, themeQuartz } from 'argent-grid';
194
+
195
+ const myCustomPart = createPart('myCustomPart')
196
+ .withCSS(`
197
+ .ag-cell {
198
+ border-left: 1px solid ${params.borderColor};
199
+ }
200
+ `)
201
+ .withAdditionalParams({
202
+ customColor: { ref: 'accentColor', mix: 0.5 },
203
+ });
204
+
205
+ const myTheme = themeQuartz.withPart(myCustomPart);
206
+ ```
207
+
208
+ ### extendTheme()
209
+
210
+ Quick theme extension:
211
+
212
+ ```typescript
213
+ import { themeQuartz, extendTheme } from 'argent-grid';
214
+
215
+ const myTheme = extendTheme(themeQuartz, {
216
+ accentColor: 'blue',
217
+ spacing: 12,
218
+ });
219
+ ```
220
+
221
+ ### mergeThemes()
222
+
223
+ Merge multiple themes:
224
+
225
+ ```typescript
226
+ import { themeQuartz, themeBalham, mergeThemes } from 'argent-grid';
227
+
228
+ const myTheme = mergeThemes(themeQuartz, themeBalham);
229
+ ```
230
+
231
+ ### applyTheme()
232
+
233
+ Apply theme to a container:
234
+
235
+ ```typescript
236
+ import { themeQuartz, applyTheme } from 'argent-grid';
237
+
238
+ // Apply to document
239
+ applyTheme(themeQuartz);
240
+
241
+ // Apply to specific container
242
+ applyTheme(themeQuartz, document.getElementById('my-container'));
243
+
244
+ // Apply to Shadow DOM
245
+ applyTheme(themeQuartz, shadowRoot);
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 📊 Theme Presets
251
+
252
+ ### Compact Theme
253
+
254
+ ```typescript
255
+ import { themeQuartz } from 'argent-grid';
256
+
257
+ const compactTheme = themeQuartz.withParams({
258
+ rowHeight: 32,
259
+ fontSize: 12,
260
+ cellPadding: 8,
261
+ spacing: 4,
262
+ });
263
+ ```
264
+
265
+ ### Comfortable Theme
266
+
267
+ ```typescript
268
+ import { themeQuartz } from 'argent-grid';
269
+
270
+ const comfortableTheme = themeQuartz.withParams({
271
+ rowHeight: 56,
272
+ fontSize: 16,
273
+ cellPadding: 16,
274
+ spacing: 12,
275
+ });
276
+ ```
277
+
278
+ ### Blue Accent Theme
279
+
280
+ ```typescript
281
+ import { themeQuartz } from 'argent-grid';
282
+
283
+ const blueTheme = themeQuartz.withParams({
284
+ accentColor: '#2196f3',
285
+ rowSelectedBackgroundColor: '#bbdefb',
286
+ rowHoverBackgroundColor: '#e3f2fd',
287
+ });
288
+ ```
289
+
290
+ ---
291
+
292
+ ## 🎯 Migration from Old Theme System
293
+
294
+ ### Before (Old System)
295
+
296
+ ```typescript
297
+ import { DEFAULT_THEME, mergeTheme } from 'argent-grid';
298
+
299
+ const myTheme = mergeTheme(DEFAULT_THEME, {
300
+ bgCell: '#ffffff',
301
+ bgHeader: '#f5f5f5',
302
+ rowHeight: 48,
303
+ });
304
+ ```
305
+
306
+ ### After (New Theme API)
307
+
308
+ ```typescript
309
+ import { themeQuartz } from 'argent-grid';
310
+
311
+ const myTheme = themeQuartz.withParams({
312
+ backgroundColor: '#ffffff',
313
+ headerBackgroundColor: '#f5f5f5',
314
+ rowHeight: 48,
315
+ });
316
+ ```
317
+
318
+ ---
319
+
320
+ ## 📚 API Reference
321
+
322
+ ### ThemeBuilder Interface
323
+
324
+ ```typescript
325
+ interface ThemeBuilder {
326
+ readonly name: string;
327
+ readonly description?: string;
328
+ readonly parameters: ThemeParameters;
329
+ readonly parts: ThemePart[];
330
+
331
+ withParams(params: PartialThemeParameters): ThemeBuilder;
332
+ withPart(part: ThemePart): ThemeBuilder;
333
+ build(): Theme;
334
+ toCSS(): string;
335
+ }
336
+ ```
337
+
338
+ ### ThemeParameters Interface
339
+
340
+ ```typescript
341
+ interface ThemeParameters {
342
+ // Colors
343
+ accentColor?: string;
344
+ backgroundColor?: string;
345
+ foregroundColor?: string;
346
+
347
+ // Typography
348
+ fontFamily?: string;
349
+ fontSize?: number;
350
+ fontWeight?: number | string;
351
+
352
+ // Spacing
353
+ spacing?: number;
354
+ rowHeight?: number;
355
+ headerHeight?: number;
356
+ cellPadding?: number;
357
+
358
+ // Borders
359
+ borderColor?: string;
360
+ borderWidth?: number;
361
+ borderRadius?: number;
362
+
363
+ // ... and more
364
+ }
365
+ ```
366
+
367
+ ---
368
+
369
+ ## 🔗 Related Documentation
370
+
371
+ - [THEME-API-PLAN.md](./THEME-API-PLAN.md) - Implementation plan
372
+ - [AG Grid Theming API](https://www.ag-grid.com/react-data-grid/theming-api/) - Original API reference
373
+ - [AG Grid Theme Builder](https://www.ag-grid.com/theme-builder/) - Visual theme designer
374
+
375
+ ---
376
+
377
+ ## 💡 Tips & Best Practices
378
+
379
+ ### 1. Start with a Built-in Theme
380
+
381
+ Always start with a built-in theme (`themeQuartz`, `themeBalham`, etc.) and customize from there.
382
+
383
+ ### 2. Use TypeScript Autocomplete
384
+
385
+ The Theme API provides full TypeScript support. Use your IDE's autocomplete to discover available parameters.
386
+
387
+ ### 3. Chain withParams() Calls
388
+
389
+ ```typescript
390
+ const myTheme = themeQuartz
391
+ .withParams({ spacing: 12 })
392
+ .withParams({ accentColor: 'red' })
393
+ .withParams({ fontSize: 14 });
394
+ ```
395
+
396
+ ### 4. Reuse Custom Parts
397
+
398
+ ```typescript
399
+ // Create once
400
+ const myCustomPart = createPart('myPart')
401
+ .withCSS('...')
402
+ .withAdditionalParams({...});
403
+
404
+ // Reuse across themes
405
+ const theme1 = themeQuartz.withPart(myCustomPart);
406
+ const theme2 = themeBalham.withPart(myCustomPart);
407
+ ```
408
+
409
+ ### 5. Test with Different Color Schemes
410
+
411
+ ```typescript
412
+ // Test light mode
413
+ const lightTheme = themeQuartz.withPart(colorSchemeLight);
414
+
415
+ // Test dark mode
416
+ const darkTheme = themeQuartz.withPart(colorSchemeDark);
417
+ ```
418
+
419
+ ---
420
+
421
+ ## 🐛 Troubleshooting
422
+
423
+ ### Theme Not Applying
424
+
425
+ 1. Ensure you're setting `gridOptions.theme`
426
+ 2. Check browser console for errors
427
+ 3. Verify theme is imported correctly
428
+
429
+ ### TypeScript Errors
430
+
431
+ 1. Ensure you're importing from `'argent-grid'`
432
+ 2. Check that parameters match `ThemeParameters` interface
433
+ 3. Use `withParams()` for customization, not direct mutation
434
+
435
+ ### Parts Not Working
436
+
437
+ 1. Ensure parts are imported correctly
438
+ 2. Check that part type matches (`color-scheme`, `icon-set`, etc.)
439
+ 3. Verify part is compatible with base theme
440
+
441
+ ---
442
+
443
+ **Last Updated:** February 28, 2026
444
+ **Version:** 1.0.0
445
+ **Compatible with:** AG Grid Theming API v32.2+