apexgrid-skill 2.2.0 → 2.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/SKILL.md +24 -6
- package/package.json +1 -1
- package/references/state-and-features.md +26 -0
package/SKILL.md
CHANGED
|
@@ -8,12 +8,13 @@ description: >
|
|
|
8
8
|
the grid styles itself via `--ag-*` CSS variables), the generic
|
|
9
9
|
`ColumnConfiguration<T>` shape with its 13 column types, Lit `cellTemplate`
|
|
10
10
|
requirements, sorting / filtering / quick-filter, pagination, inline editing,
|
|
11
|
-
row selection, master-detail and tree rows, CSV export,
|
|
12
|
-
|
|
11
|
+
row selection, master-detail and tree rows, CSV export, batch writes via
|
|
12
|
+
`applyEdits`, right-to-left layout, the UI-only event model, and the
|
|
13
|
+
`dataPipelineConfiguration` hooks for server-side data.
|
|
13
14
|
metadata:
|
|
14
15
|
author: ApexCharts
|
|
15
|
-
version: "2.
|
|
16
|
-
library_version: "3.
|
|
16
|
+
version: "2.3.0"
|
|
17
|
+
library_version: "3.5.0"
|
|
17
18
|
category: data-visualization
|
|
18
19
|
tags: [grid, data-grid, table, web-component, lit, apex-grid]
|
|
19
20
|
docs: https://github.com/apexcharts/apexgrid
|
|
@@ -114,6 +115,8 @@ render(
|
|
|
114
115
|
|
|
115
116
|
If rows don't render at all, it's almost always the host height (§1.2). If the grid looks bare, you don't need a theme import — check your `--ag-*` overrides aren't fighting the defaults.
|
|
116
117
|
|
|
118
|
+
> One non-obvious case, fixed in **3.5.0**: a grid first laid out while it is off-screen (inside an iframe the host page has not sized yet, or below the fold on a page still settling) could render zero rows while reporting a correct row count and scroll height, and stay that way until something forced a re-render. On 3.5.0 and later the body detects this and re-measures itself. On earlier versions, reassign `grid.data = grid.data.slice()` once the layout settles.
|
|
119
|
+
|
|
117
120
|
> **Dev-server reminder.** ES module imports need an HTTP server — opening via `file://` fails with CORS errors. Use Vite (`npm create vite@latest`), any static server, or your framework's dev server.
|
|
118
121
|
|
|
119
122
|
---
|
|
@@ -337,6 +340,7 @@ Declarative validators (`column.validators`), column groups (`columnGroups`), un
|
|
|
337
340
|
| row pinning | `pinRow(row, 'top' \| 'bottom')`, `unpinRow(row)` (needs `rowPinning.enabled`) |
|
|
338
341
|
| row reorder | `moveRow(from, to, position?)` (needs `rowReordering.enabled`) |
|
|
339
342
|
| editing | `commitEdit()`, `cancelEdit()` (used with `mode: 'row'`) |
|
|
343
|
+
| `applyEdits(edits)` | Write many cells as **one** operation: one undo step, one pipeline run. Returns a tally, not a count. (3.5) |
|
|
340
344
|
| undo/redo | `undo()`, `redo()`, `clearHistory()` (needs `editing.history.enabled`) |
|
|
341
345
|
| state | `getState(options?)` → `GridState`, `setState(partial, options?)` → `SetStateResult`, `getSchema()` → `GridSchema` |
|
|
342
346
|
| `ApexGrid.register()` / `ApexGrid.tagName` | Static element registration / `'apex-grid'`. |
|
|
@@ -373,7 +377,7 @@ Single-shot events (no `-ing` pair):
|
|
|
373
377
|
|
|
374
378
|
Operand reference, multi-column sort, and server-side hooks: `references/sort-and-filter.md` and `references/data-pipeline.md`. Row pinning/reorder, undo/redo, validators, column groups, state/schema, and localization: `references/state-and-features.md`.
|
|
375
379
|
|
|
376
|
-
### Keyboard & accessibility (3.4)
|
|
380
|
+
### Keyboard & accessibility (3.4, 3.5)
|
|
377
381
|
|
|
378
382
|
The grid ships full keyboard operation and screen-reader support out of the box; there's nothing to enable. The body uses a **roving-tabindex** focus model: the active cell is the body's single tab stop, so `Tab` moves into and out of the grid in one step, and real focus follows arrow-key navigation (screen readers track cell-to-cell movement).
|
|
379
383
|
|
|
@@ -391,6 +395,20 @@ Keyboard-driven commit (Enter) or cancel (Escape) returns focus to the cell, so
|
|
|
391
395
|
|
|
392
396
|
**Announcements:** sorting, filtering, selection, paging, row pinning, row reorder, expansion, and undo / redo each announce through a localized live region, and the host applies a localized `aria-label` ("Data grid") plus `aria-multiselectable` when multi-row selection is on. The strings are locale keys (`announce.*`, `header.*`, `grid.label`, `editor.rating`); override them via `localeText` (see `references/state-and-features.md`).
|
|
393
397
|
|
|
398
|
+
**New in 3.5, all automatic:** the grid honours `prefers-reduced-motion` (every transition routes through the `--ag-dur-*` tokens, which zero under the media query), it stays usable under forced colors / Windows High Contrast (the active-cell ring, invalid-cell ring, selected-row bar and focus rings are painted as outlines, which forced colors recolours rather than drops), and interactive targets meet the WCAG 2.2 AA 24x24 minimum. The only visible change is that the paginator bar is 2px taller.
|
|
399
|
+
|
|
400
|
+
### Right-to-left (3.5)
|
|
401
|
+
|
|
402
|
+
Set `dir="rtl"` on the grid or any ancestor and it mirrors completely. There is no property to set and nothing to import: direction is read from the computed style, so an inherited `dir` works.
|
|
403
|
+
|
|
404
|
+
```html
|
|
405
|
+
<html dir="rtl">
|
|
406
|
+
<apex-grid></apex-grid> <!-- inherits; no grid-level config -->
|
|
407
|
+
</html>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Arrow-key navigation, column resize and column reorder all follow inline order rather than screen direction, so ArrowLeft moves to the *next* column in RTL. Column pinning `'start'` / `'end'` were already logical and are unchanged.
|
|
411
|
+
|
|
394
412
|
---
|
|
395
413
|
|
|
396
414
|
## 6. Pitfalls — ❌ Wrong vs ✅ Correct
|
|
@@ -444,6 +462,6 @@ Keyboard-driven commit (Enter) or cancel (Escape) returns focus to the cell, so
|
|
|
444
462
|
| Column types, templates, auto-generation, per-column styling, header/editor templates | `references/columns-and-templates.md` |
|
|
445
463
|
| Sort & filter — operands, expressions, multi-column, quick-filter, events | `references/sort-and-filter.md` |
|
|
446
464
|
| Server-side data hooks (sort/filter/pagination/quickFilter), virtualization, `dataView` | `references/data-pipeline.md` |
|
|
447
|
-
| Row pinning / reordering, undo-redo, validators, column groups, state & schema (`getState`/`setState`/`getSchema`), localization, export source | `references/state-and-features.md` |
|
|
465
|
+
| Row pinning / reordering, undo-redo, batch edits (`applyEdits`), validators, column groups, state & schema (`getState`/`setState`/`getSchema`), localization, export source | `references/state-and-features.md` |
|
|
448
466
|
| End-to-end vanilla JS (no Lit `render`) | `references/vanilla-js.md` |
|
|
449
467
|
| Lit, React, Vue, Angular integration | `references/framework-integration.md` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apexgrid-skill",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "AI coding skill for the apex-grid web component — structured reference docs that help AI assistants (Claude, Cursor, Copilot, etc.) generate correct apex-grid code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex-grid",
|
|
@@ -52,6 +52,32 @@ grid.canUndo; grid.canRedo; // getters (false unless history
|
|
|
52
52
|
|
|
53
53
|
`stackSize` defaults to `100` (older commands evicted past the cap). Event: `historyChanged` — `CustomEvent<{ canUndo: boolean; canRedo: boolean }>`, fires after any record / undo / redo / clear (drive toolbar button enablement from it).
|
|
54
54
|
|
|
55
|
+
## Batch edits: `applyEdits()` (3.5)
|
|
56
|
+
|
|
57
|
+
Writes many cells as a single operation. Each write still goes through the same choke point interactive editing uses, so it emits the cancellable `cellValueChanging` and then `cellValueChanged`, and runs the column's validators. What differs from looping `editCell` + `commitEdit` is that the whole set lands as **one undo step and one pipeline run**: a thousand round-trips would otherwise mean a thousand undo entries and a thousand re-renders.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const tally = grid.applyEdits([
|
|
61
|
+
{ rowIndex: 0, column: 'discount', value: 0 },
|
|
62
|
+
{ rowIndex: 3, column: 'discount', value: 0 },
|
|
63
|
+
]);
|
|
64
|
+
// { applied: 2, unchanged: 0, invalid: 0, cancelled: 0, skipped: 0 }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`rowIndex` is **view-relative** and matches `grid.pageItems`, the same as `editCell`. Order is preserved, so a later edit to the same cell wins.
|
|
68
|
+
|
|
69
|
+
It returns a per-outcome tally rather than a count, because "nothing changed" and "everything was rejected" are different answers:
|
|
70
|
+
|
|
71
|
+
| Key | Means |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `applied` | The value actually changed. |
|
|
74
|
+
| `unchanged` | The cell already held that value. |
|
|
75
|
+
| `invalid` | A `column.validators` rule rejected it. |
|
|
76
|
+
| `cancelled` | A `cellValueChanging` listener called `preventDefault()`. |
|
|
77
|
+
| `skipped` | Unknown column, `rowIndex` out of range, or a column the user could not edit either (editing off, not `editable`, or hidden). |
|
|
78
|
+
|
|
79
|
+
Skipping rather than throwing means a partially stale batch still applies what it can. Needs `editing.enabled` and per-column `editable`, the same gate as interactive editing; without `editing.history.enabled` the batch simply is not recorded.
|
|
80
|
+
|
|
55
81
|
## Declarative column validators
|
|
56
82
|
|
|
57
83
|
`column.validators: Validator[]` run **before** a candidate value is written. Each returns an error `string` (reject) or `null` (pass). All run and every message is collected, so one commit can surface multiple errors. A failing commit keeps the editor open, marks the cell `aria-invalid`, and emits `cellValidationFailed`. Covers bulk edits (paste / fill) too.
|