apexgrid-skill 2.2.0 → 2.3.1

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 CHANGED
@@ -88,7 +88,6 @@ const cols = await readFile(referencePath('columns-and-templates.md'), 'utf8');
88
88
  - [apex-grid GitHub](https://github.com/apexcharts/apexgrid)
89
89
  - [npm: apex-grid](https://www.npmjs.com/package/apex-grid)
90
90
  - [Lit framework](https://lit.dev)
91
- - [igniteui-webcomponents](https://www.npmjs.com/package/igniteui-webcomponents) (transitive dep — installs automatically)
92
91
 
93
92
  ## License
94
93
 
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, the UI-only event
12
- model, and the `dataPipelineConfiguration` hooks for server-side data.
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.2.0"
16
- library_version: "3.4.0"
16
+ version: "2.3.1"
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
@@ -33,9 +34,11 @@ The grid styles itself out of the box (borders, row separators, sort/filter UI)
33
34
  npm install apex-grid lit
34
35
  ```
35
36
 
36
- `igniteui-webcomponents` is a regular (transitive) dependency — it installs automatically, and you do **not** import any theme CSS from it.
37
+ That is the whole install. `apex-grid` brings its own runtime dependencies (`lit`, `@lit/context`, `@lit-labs/virtualizer`) and there is **no theme CSS to import** from anywhere.
37
38
 
38
- > Confirmed working versions: `apex-grid@3.0.1`, `lit@^3.0.0`.
39
+ > **Changed in 3.5.0:** earlier versions also pulled in `igniteui-webcomponents` and `igniteui-theming` transitively. Both are gone. The grid never registered an Ignite UI element, so nothing you wrote against the grid is affected, but code that relied on `igc-*` elements being installed as a side effect must now depend on that package directly.
40
+
41
+ > Confirmed working versions: `apex-grid@3.5.0`, `lit@^3.0.0`.
39
42
 
40
43
  ### 1.2 Register the element + size the host — `setup()` does both
41
44
 
@@ -72,7 +75,7 @@ apex-grid {
72
75
  }
73
76
  ```
74
77
 
75
- > The deprecated `theme` option (and `igniteui-webcomponents`' `configureTheme()`) does **not** change the grid's appearance — it only forwards to igniteui for apps that embed igniteui components alongside the grid. Omit it; use `--ag-*` variables instead.
78
+ > The deprecated `setup({ theme })` option does **not** change the grid's appearance. It only ever forwarded to Ignite UI's `configureTheme()`, and since 3.5.0 it is inert and warns once. Omit it; use `--ag-*` variables instead.
76
79
 
77
80
  ### 1.4 Minimal example — a styled, sortable, filterable table
78
81
 
@@ -114,6 +117,8 @@ render(
114
117
 
115
118
  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
119
 
120
+ > 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.
121
+
117
122
  > **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
123
 
119
124
  ---
@@ -337,6 +342,7 @@ Declarative validators (`column.validators`), column groups (`columnGroups`), un
337
342
  | row pinning | `pinRow(row, 'top' \| 'bottom')`, `unpinRow(row)` (needs `rowPinning.enabled`) |
338
343
  | row reorder | `moveRow(from, to, position?)` (needs `rowReordering.enabled`) |
339
344
  | editing | `commitEdit()`, `cancelEdit()` (used with `mode: 'row'`) |
345
+ | `applyEdits(edits)` | Write many cells as **one** operation: one undo step, one pipeline run. Returns a tally, not a count. (3.5) |
340
346
  | undo/redo | `undo()`, `redo()`, `clearHistory()` (needs `editing.history.enabled`) |
341
347
  | state | `getState(options?)` → `GridState`, `setState(partial, options?)` → `SetStateResult`, `getSchema()` → `GridSchema` |
342
348
  | `ApexGrid.register()` / `ApexGrid.tagName` | Static element registration / `'apex-grid'`. |
@@ -373,7 +379,7 @@ Single-shot events (no `-ing` pair):
373
379
 
374
380
  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
381
 
376
- ### Keyboard & accessibility (3.4)
382
+ ### Keyboard & accessibility (3.4, 3.5)
377
383
 
378
384
  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
385
 
@@ -391,6 +397,20 @@ Keyboard-driven commit (Enter) or cancel (Escape) returns focus to the cell, so
391
397
 
392
398
  **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
399
 
400
+ **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.
401
+
402
+ ### Right-to-left (3.5)
403
+
404
+ 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.
405
+
406
+ ```html
407
+ <html dir="rtl">
408
+ <apex-grid></apex-grid> <!-- inherits; no grid-level config -->
409
+ </html>
410
+ ```
411
+
412
+ 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.
413
+
394
414
  ---
395
415
 
396
416
  ## 6. Pitfalls — ❌ Wrong vs ✅ Correct
@@ -404,7 +424,7 @@ Keyboard-driven commit (Enter) or cancel (Escape) returns focus to the cell, so
404
424
  ✅ `setup()` (or `import 'apex-grid/define'`) once at app startup.
405
425
 
406
426
  ### 3. Importing a theme CSS that no longer exists
407
- ❌ `import 'igniteui-webcomponents/themes/light/bootstrap.css'` + `configureTheme('bootstrap')` — obsolete; does not affect the grid.
427
+ ❌ `import 'igniteui-webcomponents/themes/light/bootstrap.css'` + `setup({ theme: 'bootstrap' })` is obsolete; it never affected the grid, and as of 3.5.0 the option is inert and that package is not even installed.
408
428
  ✅ Nothing to import — the grid styles itself; retheme via `--ag-*` CSS variables. The only required CSS is a host **height**.
409
429
 
410
430
  ### 4. Stringified `columns` attribute
@@ -444,6 +464,6 @@ Keyboard-driven commit (Enter) or cancel (Escape) returns focus to the cell, so
444
464
  | Column types, templates, auto-generation, per-column styling, header/editor templates | `references/columns-and-templates.md` |
445
465
  | Sort & filter — operands, expressions, multi-column, quick-filter, events | `references/sort-and-filter.md` |
446
466
  | 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` |
467
+ | 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
468
  | End-to-end vanilla JS (no Lit `render`) | `references/vanilla-js.md` |
449
469
  | 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.2.0",
3
+ "version": "2.3.1",
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",
@@ -124,13 +124,15 @@ const columns: ColumnConfiguration<User>[] = [
124
124
  <input type="checkbox" .checked=${value} disabled />
125
125
  <small>${row.name}</small>` },
126
126
 
127
- // Embedded igniteui-webcomponents control
128
- { key: 'avatar',
129
- cellTemplate: ({ value }) => html`<igc-avatar shape="circle" .src=${value}></igc-avatar>` },
130
-
131
- // Rating widget tied to data type
132
- { key: 'satisfaction', type: 'number',
133
- cellTemplate: ({ value }) => html`<igc-rating readonly .value=${value}></igc-rating>` },
127
+ // Prefer the built-in type over a template where one exists:
128
+ // `avatar` and `rating` are column types, no template needed.
129
+ { key: 'avatar', type: 'avatar' },
130
+ { key: 'satisfaction', type: 'rating' },
131
+
132
+ // Any custom element works, but YOU must install and register it:
133
+ // the grid ships no third-party components (see SKILL.md §1.1).
134
+ { key: 'status',
135
+ cellTemplate: ({ value }) => html`<my-status-chip .value=${value}></my-status-chip>` },
134
136
  ];
135
137
  ```
136
138
 
@@ -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.