You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/components/table/advanced-table/partials/accessibility/accessibility.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The table row element cannot receive interactions, meaning actions cannot be att
12
12
13
13
### Focus in Advanced Tables
14
14
15
-
Unlike the Table component, each cell receives focus in the Advanced Table to let users navigate through the table efficiently with a keyboard. For any other interactions, you must use interactive elements (buttons, links, etc.) within the cells.
15
+
Unlike the Table component, each cell receives focus in the Advanced Table to support users navigating through the table efficiently with a keyboard. For any other interactions, you must use interactive elements (buttons, links, etc.) within the cells.
Copy file name to clipboardexpand all lines: website/docs/components/table/advanced-table/partials/code/component-api.md
+26-15
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
## Component API
2
2
3
-
The AdvancedTable component itself is where most of the options will be applied. However, the APIs for the child components are also documented here, in case a custom implementation is desired.
3
+
The Advanced Table component itself is where most of the options will be applied. However, the APIs for the child components are also documented here in case a custom implementation is desired.
4
4
5
5
### AdvancedTable
6
6
7
7
<Doc::ComponentApi as |C|>
8
8
<C.Property @name="<:body>" @type="named block">
9
-
This is a named block where the content for the AdvancedTable body is rendered.
9
+
This is a named block where the content for the Advanced Table body is rendered.
The value of the index associated with the `@each` loop. Returns a number when there are no nested rows. Returns a string in the form `${parentIndex}.${childIndex}` when there are nested rows.
@@ -23,10 +23,10 @@ The AdvancedTable component itself is where most of the options will be applied.
23
23
</Doc::ComponentApi>
24
24
</C.Property>
25
25
<C.Property @name="model" @type="array">
26
-
The data model to be used by the AdvancedTable. The model can have any shape, but for nested rows there are two expected keys.
26
+
The data model to be used by the Advanced Table. The model can have any shape, but for nested rows there are two expected keys.
27
27
<Doc::ComponentApi as |C|>
28
28
<C.Property @name="children" @type="array">
29
-
If there are nested rows, the AdvancedTable will use the `children` key in the model to render the child content. The key can be changed by setting `childrenKey` argument on the `Hds::AdvancedTable`.
29
+
If there are nested rows, the Advanced Table will use the `children` key in the model to render the child content. The key can be changed by setting `childrenKey` argument on the `Hds::AdvancedTable`.
30
30
</C.Property>
31
31
<C.Property @name="isExpanded" @type="boolean">
32
32
If there are nested rows, the default state of the toggle can be set by adding `isExpanded` to the row in the model.
@@ -44,7 +44,7 @@ The AdvancedTable component itself is where most of the options will be applied.
Determines the horizontal content alignment (sometimes referred to as text alignment) for the column header.
@@ -56,10 +56,10 @@ The AdvancedTable component itself is where most of the options will be applied.
56
56
If set to `true`, it visually hides the column’s text content (it will still be available to screen readers for accessibility). <em>Only available for non-sortable columns.</em>
Callback function to provide support for custom sorting logic. It should implement a typical bubble-sorting algorithm using two elements and comparing them. For more details, see the example of custom sorting in the How To Use section.
59
+
Callback function to provide support for custom sorting logic. It should implement a typical bubble-sorting algorithm using two elements and comparing them. For more details, see the example of custom sorting in the [How To Use section](#sortable-advanced-table).
60
60
</C.Property>
61
61
<C.Property @name="tooltip" @type="string">
62
-
Text string which will appear in the tooltip (see [`Tooltip`](/components/tooltip) for details). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
62
+
Text string which will appear in [`Tooltip`](/components/tooltip). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
63
63
</C.Property>
64
64
</Doc::ComponentApi>
65
65
</C.Property>
@@ -79,18 +79,18 @@ The AdvancedTable component itself is where most of the options will be applied.
79
79
When called, this function receives an object as argument, with different keys corresponding to different information:
80
80
<ul>
81
81
<li>`selectionKey`: the value of the `@selectionKey` argument associated with the row selected/deselected by the user or `all` if the “select all” checkbox has been toggled</li>
82
-
<li>`selectionCheckboxElement`: the checkbox (DOM element) that has been toggled by the user</li>
83
-
<li>`selectedRowsKeys`: an array containing all the `@selectionKey`s of the selected rows in the table (an empty array is returned if no row is selected)</li>
84
-
<li>`selectableRowsStates`: an array of objects corresponding to all the rows displayed in the table when the user changed a selection; each object contains the `@selectionKey` value for the associated row and its `isSelected` boolean state (if the checkbox is checked or not)<br><br>
82
+
<li>`selectionCheckboxElement`: the checkbox (DOM element) that has been toggled by the user.</li>
83
+
<li>`selectedRowsKeys`: an array containing all the `@selectionKey`s of the selected rows in the table (an empty array is returned if no row is selected).</li>
84
+
<li>`selectableRowsStates`: an array of objects corresponding to all the rows displayed in the table when the user changed a selection; each object contains the `@selectionKey` value for the associated row and its `isSelected` boolean state (if the checkbox is checked or not).<br><br>
85
85
**Important**: the order of the rows in the array doesn’t necessarily follow the order of the rows in the table/DOM.</li>
If set, determines the density (height) of the body’s rows.
@@ -123,19 +123,23 @@ The AdvancedTable component itself is where most of the options will be applied.
123
123
124
124
### AdvancedTable::Tr
125
125
126
+
!!! Info
127
+
126
128
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Th`, `AdvancedTable::Td` components.
127
129
130
+
!!!
131
+
128
132
This component can contain `Hds::AdvancedTable::Th` or `Hds::AdvancedTable::Td` components.
129
133
130
134
<Doc::ComponentApi as |C|>
131
135
<C.Property @name="yield">
132
136
Elements passed as children are yielded as inner content of a `<div role="row">` HTML element.
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the `AdvancedTable` and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
142
+
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the Advanced Table and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
Descriptive `aria-label` attribute applied to the checkbox used to select the row (used in conjunction with setting `isSelectable` on the `AdvancedTable`). The component automatically prepends “Select/Deselect” to the string, depending on the selection status. It’s required if `isSelectable={{true}}`.
@@ -147,8 +151,12 @@ This component can contain `Hds::AdvancedTable::Th` or `Hds::AdvancedTable::Td`
147
151
148
152
### AdvancedTable::Th
149
153
154
+
!!! Info
155
+
150
156
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Th` component.
151
157
158
+
!!!
159
+
152
160
If the `Th` component is passed as the first cell of a body row, `role="rowheader"` is automatically applied for accessibility purposes.
153
161
154
162
<Doc::ComponentApi as |C|>
@@ -162,7 +170,7 @@ If the `Th` component is passed as the first cell of a body row, `role="rowheade
162
170
If set, determines the column’s width.
163
171
</C.Property>
164
172
<C.Property @name="tooltip" @type="string">
165
-
Text string which will appear in the tooltip (see [`Tooltip`](/components/tooltip) for details). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
173
+
Text string which will appear in the [`Tooltip`](/components/tooltip). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
If set to `true`, it visually hides the column’s text content (it will still be available to screen readers for accessibility).
@@ -182,9 +190,12 @@ If the `Th` component is passed as the first cell of a body row, `role="rowheade
182
190
</Doc::ComponentApi>
183
191
184
192
### AdvancedTable::Td
193
+
!!! Info
185
194
186
195
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Td` component.
0 commit comments