simple-table-core 3.7.0 → 3.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/dist/cjs/index.js +1 -1
- package/dist/cjs/src/utils/bodyCell/types.d.ts +6 -0
- package/dist/cjs/src/utils/collapseUtils.d.ts +7 -0
- package/dist/cjs/stories/tests/45-AriaSemanticsTests.stories.d.ts +83 -0
- package/dist/index.es.js +1 -1
- package/dist/src/utils/bodyCell/types.d.ts +6 -0
- package/dist/src/utils/collapseUtils.d.ts +7 -0
- package/dist/stories/tests/45-AriaSemanticsTests.stories.d.ts +83 -0
- package/package.json +1 -1
|
@@ -71,6 +71,12 @@ export interface CellRenderContext {
|
|
|
71
71
|
useOddEvenRowBackground?: boolean;
|
|
72
72
|
rowGrouping?: string[];
|
|
73
73
|
headers: HeaderObject[];
|
|
74
|
+
/**
|
|
75
|
+
* Accessor of the column whose body cells identify the row and should carry
|
|
76
|
+
* `role="rowheader"` (the first non-selection leaf column). Other data cells
|
|
77
|
+
* remain `role="gridcell"`.
|
|
78
|
+
*/
|
|
79
|
+
rowHeaderAccessor?: Accessor;
|
|
74
80
|
rowHeight: number;
|
|
75
81
|
/** Number of header rows (for aria-rowindex: position + maxHeaderDepth + 1) */
|
|
76
82
|
maxHeaderDepth?: number;
|
|
@@ -17,6 +17,13 @@ export declare const getAllChildHeaders: (header: HeaderObject) => HeaderObject[
|
|
|
17
17
|
* Check if a header has collapsible children
|
|
18
18
|
*/
|
|
19
19
|
export declare const hasCollapsibleChildren: (header: HeaderObject) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Number of visible leaf (bottom-level) columns a header spans, for
|
|
22
|
+
* `aria-colspan` on grouped/nested header cells. Leaf headers that are hidden
|
|
23
|
+
* (`hide`) or suppressed by their parent's collapsed state are excluded so the
|
|
24
|
+
* announced span matches the columns actually rendered. Leaf headers return 1.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getHeaderColspan: (header: HeaderObject, rootHeaders: HeaderObject[], collapsedHeaders: Set<Accessor>) => number;
|
|
20
27
|
/**
|
|
21
28
|
* Get all leaf (bottom-level) headers that should be visible when a parent is collapsed
|
|
22
29
|
* Uses flattenHeaders for consistent leaf detection
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ARIA SEMANTICS TESTS
|
|
3
|
+
*
|
|
4
|
+
* These tests assert the ARIA state/relationship semantics that a non-native
|
|
5
|
+
* (role="grid") table must apply by hand: selection state, expansion/treegrid
|
|
6
|
+
* levels, grouped-header span, row headers, nested/state rows in the hierarchy,
|
|
7
|
+
* header rowspan, and collapsible column-header expansion.
|
|
8
|
+
*/
|
|
9
|
+
import type { Meta } from "@storybook/html";
|
|
10
|
+
declare const meta: Meta;
|
|
11
|
+
export default meta;
|
|
12
|
+
export declare const SelectedRowsExposeAriaSelected: {
|
|
13
|
+
render: () => HTMLDivElement & {
|
|
14
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
15
|
+
};
|
|
16
|
+
play: ({ canvasElement }: {
|
|
17
|
+
canvasElement: HTMLElement;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export declare const GridExposesAriaMultiselectable: {
|
|
21
|
+
render: () => HTMLDivElement & {
|
|
22
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
23
|
+
};
|
|
24
|
+
play: ({ canvasElement }: {
|
|
25
|
+
canvasElement: HTMLElement;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export declare const ExpandableRowsExposeAriaExpandedOnRow: {
|
|
29
|
+
render: () => HTMLDivElement & {
|
|
30
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
31
|
+
};
|
|
32
|
+
play: ({ canvasElement }: {
|
|
33
|
+
canvasElement: HTMLElement;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
export declare const ExpandableGridExposesTreegridLevels: {
|
|
37
|
+
render: () => HTMLDivElement & {
|
|
38
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
39
|
+
};
|
|
40
|
+
play: ({ canvasElement }: {
|
|
41
|
+
canvasElement: HTMLElement;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
export declare const GroupedHeadersExposeAriaColspan: {
|
|
45
|
+
render: () => HTMLDivElement & {
|
|
46
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
47
|
+
};
|
|
48
|
+
play: ({ canvasElement }: {
|
|
49
|
+
canvasElement: HTMLElement;
|
|
50
|
+
}) => Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
export declare const IdentityColumnExposesRowHeader: {
|
|
53
|
+
render: () => HTMLDivElement & {
|
|
54
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
55
|
+
};
|
|
56
|
+
play: ({ canvasElement }: {
|
|
57
|
+
canvasElement: HTMLElement;
|
|
58
|
+
}) => Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
export declare const NestedTableRowsAreInRowHierarchy: {
|
|
61
|
+
render: () => HTMLDivElement & {
|
|
62
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
63
|
+
};
|
|
64
|
+
play: ({ canvasElement }: {
|
|
65
|
+
canvasElement: HTMLElement;
|
|
66
|
+
}) => Promise<void>;
|
|
67
|
+
};
|
|
68
|
+
export declare const LeafHeadersExposeRowSpan: {
|
|
69
|
+
render: () => HTMLDivElement & {
|
|
70
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
71
|
+
};
|
|
72
|
+
play: ({ canvasElement }: {
|
|
73
|
+
canvasElement: HTMLElement;
|
|
74
|
+
}) => Promise<void>;
|
|
75
|
+
};
|
|
76
|
+
export declare const CollapsibleColumnHeaderExposesAriaExpanded: {
|
|
77
|
+
render: () => HTMLDivElement & {
|
|
78
|
+
_table?: import("../../src/index").SimpleTableVanilla | undefined;
|
|
79
|
+
};
|
|
80
|
+
play: ({ canvasElement }: {
|
|
81
|
+
canvasElement: HTMLElement;
|
|
82
|
+
}) => Promise<void>;
|
|
83
|
+
};
|