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.
- package/.github/workflows/ci.yml +69 -0
- package/.github/workflows/pages.yml +6 -12
- package/.storybook/main.ts +20 -0
- package/.storybook/preview.ts +18 -0
- package/.storybook/tsconfig.json +24 -0
- package/AGENTS.md +70 -27
- package/README.md +51 -34
- package/angular.json +66 -0
- package/biome.json +66 -0
- package/demo-app/e2e/selection-screenshot.spec.ts +20 -0
- package/docs/AG-GRID-COMPARISON.md +725 -0
- package/docs/CELL-RENDERER-GUIDE.md +241 -0
- package/docs/CONTEXT-MENU-GUIDE.md +371 -0
- package/docs/LIVE-DATA-OPTIMIZATIONS.md +497 -0
- package/docs/PERFORMANCE-OPTIMIZATIONS-PHASE1.md +162 -0
- package/docs/PERFORMANCE-REVIEW.md +571 -0
- package/docs/RESEARCH-STATUS.md +234 -0
- package/docs/STATE-PERSISTENCE-GUIDE.md +370 -0
- package/docs/STORYBOOK-REFACTOR.md +215 -0
- package/docs/STORYBOOK-STATUS.md +156 -0
- package/docs/TEST-COVERAGE-REPORT.md +276 -0
- package/docs/THEME-API-GUIDE.md +445 -0
- package/docs/THEME-API-PLAN.md +364 -0
- package/e2e/advanced.spec.ts +109 -0
- package/e2e/argentgrid.spec.ts +65 -0
- package/e2e/benchmark.spec.ts +52 -0
- package/e2e/cell-renderers.spec.ts +152 -0
- package/e2e/debug-streaming.spec.ts +31 -0
- package/e2e/dnd.spec.ts +73 -0
- package/e2e/screenshots.spec.ts +52 -0
- package/e2e/theming.spec.ts +35 -0
- package/e2e/visual.spec.ts +112 -0
- package/e2e/visual.spec.ts-snapshots/checkbox-renderer-mixed.png +0 -0
- package/e2e/visual.spec.ts-snapshots/debug.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-column-group-headers.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-default.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-empty-state.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-filter-popup.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-scroll-borders.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-sidebar-buttons.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-text-filter.png +0 -0
- package/e2e/visual.spec.ts-snapshots/grid-with-selection.png +0 -0
- package/e2e/visual.spec.ts-snapshots/rating-renderer-varied.png +0 -0
- package/package.json +21 -7
- package/plan.md +56 -28
- package/playwright.config.ts +38 -0
- package/setup-vitest.ts +10 -13
- package/src/lib/argent-grid.module.ts +10 -12
- package/src/lib/components/argent-grid.component.css +281 -321
- package/src/lib/components/argent-grid.component.html +295 -207
- package/src/lib/components/argent-grid.component.spec.ts +120 -160
- package/src/lib/components/argent-grid.component.ts +1193 -290
- package/src/lib/components/argent-grid.regressions.spec.ts +301 -0
- package/src/lib/components/argent-grid.selection.spec.ts +132 -0
- package/src/lib/components/set-filter/set-filter.component.spec.ts +191 -0
- package/src/lib/components/set-filter/set-filter.component.ts +307 -0
- package/src/lib/directives/ag-grid-compatibility.directive.ts +16 -26
- package/src/lib/directives/click-outside.directive.ts +19 -0
- package/src/lib/rendering/canvas-renderer.spec.ts +513 -0
- package/src/lib/rendering/canvas-renderer.ts +456 -452
- package/src/lib/rendering/live-data-handler.ts +110 -0
- package/src/lib/rendering/live-data-optimizations.ts +133 -0
- package/src/lib/rendering/render/blit.spec.ts +16 -27
- package/src/lib/rendering/render/blit.ts +48 -36
- package/src/lib/rendering/render/cells.spec.ts +132 -0
- package/src/lib/rendering/render/cells.ts +167 -28
- package/src/lib/rendering/render/column-utils.ts +95 -0
- package/src/lib/rendering/render/hit-test.ts +50 -0
- package/src/lib/rendering/render/index.ts +88 -76
- package/src/lib/rendering/render/lines.ts +53 -47
- package/src/lib/rendering/render/primitives.ts +423 -0
- package/src/lib/rendering/render/theme.spec.ts +8 -12
- package/src/lib/rendering/render/theme.ts +7 -10
- package/src/lib/rendering/render/types.ts +3 -2
- package/src/lib/rendering/render/walk.spec.ts +35 -38
- package/src/lib/rendering/render/walk.ts +94 -64
- package/src/lib/rendering/utils/damage-tracker.spec.ts +8 -7
- package/src/lib/rendering/utils/damage-tracker.ts +6 -18
- package/src/lib/rendering/utils/index.ts +1 -1
- package/src/lib/services/grid.service.set-filter.spec.ts +219 -0
- package/src/lib/services/grid.service.spec.ts +1241 -201
- package/src/lib/services/grid.service.ts +1204 -235
- package/src/lib/themes/parts/color-schemes.ts +132 -0
- package/src/lib/themes/parts/icon-sets.ts +258 -0
- package/src/lib/themes/theme-builder.ts +347 -0
- package/src/lib/themes/theme-quartz.ts +72 -0
- package/src/lib/themes/types.ts +238 -0
- package/src/lib/types/ag-grid-types.ts +573 -14
- package/src/public-api.ts +39 -9
- package/src/stories/Advanced.stories.ts +249 -0
- package/src/stories/ArgentGrid.stories.ts +301 -0
- package/src/stories/Benchmark.stories.ts +76 -0
- package/src/stories/CellRenderers.stories.ts +395 -0
- package/src/stories/Filtering.stories.ts +292 -0
- package/src/stories/Grouping.stories.ts +290 -0
- package/src/stories/Streaming.stories.ts +57 -0
- package/src/stories/Theming.stories.ts +137 -0
- package/src/stories/Tooltips.stories.ts +381 -0
- package/src/stories/benchmark-wrapper.component.ts +355 -0
- package/src/stories/story-utils.ts +88 -0
- package/src/stories/streaming-wrapper.component.ts +441 -0
- package/tsconfig.json +1 -0
- package/tsconfig.storybook.json +10 -0
- package/vitest.config.ts +9 -9
- package/demo-app/README.md +0 -70
- package/demo-app/angular.json +0 -78
- package/demo-app/e2e/benchmark.spec.ts +0 -53
- package/demo-app/e2e/demo-page.spec.ts +0 -77
- package/demo-app/e2e/grid-features.spec.ts +0 -269
- package/demo-app/package-lock.json +0 -14023
- package/demo-app/package.json +0 -36
- package/demo-app/playwright-test-menu.js +0 -19
- package/demo-app/playwright.config.ts +0 -23
- package/demo-app/src/app/app.component.ts +0 -10
- package/demo-app/src/app/app.config.ts +0 -13
- package/demo-app/src/app/app.routes.ts +0 -7
- package/demo-app/src/app/demo-page/demo-page.component.css +0 -313
- package/demo-app/src/app/demo-page/demo-page.component.html +0 -124
- package/demo-app/src/app/demo-page/demo-page.component.ts +0 -366
- package/demo-app/src/index.html +0 -19
- package/demo-app/src/main.ts +0 -6
- 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+
|