@toolbox-web/grid 2.6.0 → 2.7.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/all.d.ts +1 -0
- package/all.js +2 -2
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/internal/aria.d.ts +4 -0
- package/lib/core/types.d.ts +43 -0
- package/lib/features/sticky-rows.d.ts +9 -0
- package/lib/features/sticky-rows.js +2 -0
- package/lib/features/sticky-rows.js.map +1 -0
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +15 -0
- package/lib/plugins/grouping-rows/index.js +2 -2
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder-columns/index.js.map +1 -1
- package/lib/plugins/reorder-rows/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-drag-drop/index.js.map +1 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/sticky-rows/StickyRowsPlugin.d.ts +114 -0
- package/lib/plugins/sticky-rows/index.d.ts +7 -0
- package/lib/plugins/sticky-rows/index.js +2 -0
- package/lib/plugins/sticky-rows/index.js.map +1 -0
- package/lib/plugins/sticky-rows/types.d.ts +67 -0
- package/lib/plugins/tooltip/index.js.map +1 -1
- package/lib/plugins/tree/index.js +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/types.d.ts +4 -0
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +1 -1
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/sticky-rows.umd.js +2 -0
- package/umd/plugins/sticky-rows.umd.js.map +1 -0
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
|
@@ -10,8 +10,12 @@ export interface AriaState {
|
|
|
10
10
|
colCount: number;
|
|
11
11
|
/** Last set aria-label */
|
|
12
12
|
ariaLabel: string | undefined;
|
|
13
|
+
/** Last set aria-labelledby */
|
|
14
|
+
ariaLabelledBy: string | undefined;
|
|
13
15
|
/** Last set aria-describedby */
|
|
14
16
|
ariaDescribedBy: string | undefined;
|
|
17
|
+
/** Last set aria-roledescription */
|
|
18
|
+
ariaRoleDescription: string | undefined;
|
|
15
19
|
/** Last source row count announced via `dataLoaded`; used to suppress duplicate announcements */
|
|
16
20
|
lastAnnouncedSourceCount: number;
|
|
17
21
|
}
|
package/lib/core/types.d.ts
CHANGED
|
@@ -2493,12 +2493,36 @@ export interface GridConfig<TRow = any> {
|
|
|
2493
2493
|
*
|
|
2494
2494
|
* If not provided and `shell.header.title` is set, the title is used automatically.
|
|
2495
2495
|
*
|
|
2496
|
+
* If [`gridAriaLabelledBy`](#gridarialabelledby) is also set, `aria-labelledby`
|
|
2497
|
+
* takes precedence per WAI-ARIA accessible-name computation and `aria-label`
|
|
2498
|
+
* is omitted.
|
|
2499
|
+
*
|
|
2496
2500
|
* @example
|
|
2497
2501
|
* ```ts
|
|
2498
2502
|
* gridConfig = { gridAriaLabel: 'Employee data' };
|
|
2499
2503
|
* ```
|
|
2500
2504
|
*/
|
|
2501
2505
|
gridAriaLabel?: string;
|
|
2506
|
+
/**
|
|
2507
|
+
* ID of an element that labels the grid.
|
|
2508
|
+
* Sets `aria-labelledby` on the grid's internal table element so screen
|
|
2509
|
+
* readers can use the referenced element's text as the accessible name —
|
|
2510
|
+
* useful when the grid already sits next to a heading.
|
|
2511
|
+
*
|
|
2512
|
+
* Per WAI-ARIA accessible-name precedence, `aria-labelledby` takes priority
|
|
2513
|
+
* over `aria-label` and over the auto-derived shell title. When this option
|
|
2514
|
+
* is set, the grid omits `aria-label` to avoid conflicting names.
|
|
2515
|
+
*
|
|
2516
|
+
* @example
|
|
2517
|
+
* ```html
|
|
2518
|
+
* <h2 id="grid-heading">Employees</h2>
|
|
2519
|
+
* <tbw-grid></tbw-grid>
|
|
2520
|
+
* ```
|
|
2521
|
+
* ```ts
|
|
2522
|
+
* gridConfig = { gridAriaLabelledBy: 'grid-heading' };
|
|
2523
|
+
* ```
|
|
2524
|
+
*/
|
|
2525
|
+
gridAriaLabelledBy?: string;
|
|
2502
2526
|
/**
|
|
2503
2527
|
* ID of an element that describes the grid.
|
|
2504
2528
|
* Sets `aria-describedby` on the grid's internal table element.
|
|
@@ -2513,6 +2537,25 @@ export interface GridConfig<TRow = any> {
|
|
|
2513
2537
|
* ```
|
|
2514
2538
|
*/
|
|
2515
2539
|
gridAriaDescribedBy?: string;
|
|
2540
|
+
/**
|
|
2541
|
+
* Override the screen-reader-announced role name for the grid via
|
|
2542
|
+
* `aria-roledescription`. Useful for localization (e.g. `"Tabell"` in
|
|
2543
|
+
* Norwegian) or domain-specific naming (e.g. `"Employee table"`).
|
|
2544
|
+
*
|
|
2545
|
+
* :::caution
|
|
2546
|
+
* Per [WAI-ARIA 1.2](https://www.w3.org/TR/wai-aria-1.2/#aria-roledescription),
|
|
2547
|
+
* the value should still describe a grid-like widget. Overriding with an
|
|
2548
|
+
* unrelated label confuses assistive-technology users about the available
|
|
2549
|
+
* interactions (cell navigation, sort, etc.). Leave unset to use the
|
|
2550
|
+
* default role name announced by the AT.
|
|
2551
|
+
* :::
|
|
2552
|
+
*
|
|
2553
|
+
* @example
|
|
2554
|
+
* ```ts
|
|
2555
|
+
* gridConfig = { gridAriaRoleDescription: 'Employee table' };
|
|
2556
|
+
* ```
|
|
2557
|
+
*/
|
|
2558
|
+
gridAriaRoleDescription?: string;
|
|
2516
2559
|
/**
|
|
2517
2560
|
* Accessibility configuration for screen reader announcements.
|
|
2518
2561
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StickyRowsConfig } from '../plugins/sticky-rows';
|
|
2
|
+
declare module '../core/types' {
|
|
3
|
+
interface FeatureConfig {
|
|
4
|
+
/** Pin selected data rows below the header as the user scrolls past them. */
|
|
5
|
+
stickyRows?: StickyRowsConfig;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */
|
|
9
|
+
export type _Augmentation = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-rows.js","sources":["../../../../../libs/grid/src/lib/features/sticky-rows.ts"],"sourcesContent":["/**\n * Sticky Rows feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/sticky-rows';\n *\n * grid.gridConfig = { features: { stickyRows: { isSticky: 'isSection' } } };\n * ```\n */\n\nimport { StickyRowsPlugin, type StickyRowsConfig } from '../plugins/sticky-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Pin selected data rows below the header as the user scrolls past them. */\n stickyRows?: StickyRowsConfig;\n }\n}\n\nregisterFeature('stickyRows', (config) => {\n // `stickyRows` requires an `isSticky` value — `boolean` shorthand is not\n // meaningful. The TS type prevents `true`/`false` callers from compiling;\n // at runtime we coerce to a no-op predicate for safety.\n const options = (config as StickyRowsConfig | undefined) ?? { isSticky: () => false };\n return new StickyRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"names":["registerFeature","config","StickyRowsPlugin","isSticky"],"mappings":"+IAqBAA,EAAgB,aAAeC,GAKtB,IAAIC,EADMD,GAA2C,CAAEE,SAAU,KAAM"}
|