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
@@ -169,13 +170,15 @@ Note: If you want to add a tooltip/popover to a sortable header, in the `transfo
169
170
The built in display for sorting is not fully responsive, as the column headers will be displayed per row when the screen size is small. The example below showcases how sorting may have a custom control display that can be used for small screen sizes.
170
171
171
172
```ts file="LegacyTableSortable.tsx"
173
+
172
174
```
173
175
174
176
### Sortable - custom control
175
177
176
178
Sorting a table may also be controlled with a toolbar. This toolbar item may also be hidden at large screen sizes and only displayed when the screen size is small to support responsive tables.
177
179
178
180
```ts file="LegacyTableSortableCustom.tsx"
181
+
179
182
```
180
183
181
184
### Selectable with checkbox
@@ -196,6 +199,7 @@ of using `td` elements, the cells in that column use `th` elements.
196
199
checking checkboxes will check intermediate rows' checkboxes.
197
200
198
201
```ts file="LegacyTableSelectable.tsx"
202
+
199
203
```
200
204
201
205
### Selectable radio input
@@ -206,13 +210,15 @@ To enable row radio selection, set the `onSelect` callback prop on the Table, an
206
210
To disable selection for a row, set `disableSelection: true` on the row definition.
207
211
208
212
```ts file="LegacyTableSelectableRadio.tsx"
213
+
209
214
```
210
215
211
216
### Clickable rows, selectable rows, and header cell tooltips/popovers
212
217
213
218
This selectable rows feature is intended for use when a table is used to present a list of objects in a Primary-detail view.
214
219
215
220
```ts file="LegacyTableClickable.tsx"
221
+
216
222
```
217
223
218
224
### Actions and first cell in body rows as th
@@ -222,6 +228,7 @@ To use actions you can either specify an array of actions and pass that into the
222
228
If actions menus are getting clipped by other items on the page, such as sticky columns or rows, the `Table` can be passed a `actionsMenuAppendTo` prop to adjust where the actions menu is appended.
223
229
224
230
```ts file="LegacyTableActions.tsx"
231
+
225
232
```
226
233
227
234
### Expandable
@@ -232,6 +239,7 @@ The parent row can have an `isOpen` field for managing the expanded state of the
232
239
Also, pass an `onCollapse` event handler via the prop on the Table
233
240
234
241
```ts file="LegacyTableExpandable.tsx"
242
+
235
243
```
236
244
237
245
### Compound expandable
@@ -248,26 +256,31 @@ To build a compound expandable table:
248
256
4. An `onExpand` event handler prop should be passed to the Table.
249
257
250
258
```ts file="LegacyTableCompoundExpandable.tsx"
259
+
251
260
```
252
261
253
262
### With width and breakpoint visibility modifiers
254
263
255
264
```ts file="LegacyTableCellWidth.tsx"
265
+
256
266
```
257
267
258
268
### Controlling text
259
269
260
270
```ts file="LegacyTableControllingText.tsx"
271
+
261
272
```
262
273
263
274
### Modifiers with table text
264
275
265
276
```ts file="LegacyTableTextModifiers.tsx"
277
+
266
278
```
267
279
268
280
### Empty state
269
281
270
282
```ts file="LegacyTableEmptyState.tsx"
283
+
271
284
```
272
285
273
286
### Editable rows
@@ -330,13 +343,13 @@ class EditableRowsTable extends React.Component {
330
343
],
331
344
rows: [
332
345
{
333
-
rowEditBtnAriaLabel:idx=>`Edit row ${idx}`,
334
-
rowSaveBtnAriaLabel:idx=>`Save edits for row ${idx}`,
335
-
rowCancelBtnAriaLabel:idx=>`Cancel edits for row ${idx}`,
346
+
rowEditBtnAriaLabel:(idx)=>`Edit row ${idx}`,
347
+
rowSaveBtnAriaLabel:(idx)=>`Save edits for row ${idx}`,
348
+
rowCancelBtnAriaLabel:(idx)=>`Cancel edits for row ${idx}`,
336
349
rowEditValidationRules: [
337
350
{
338
351
name:'required',
339
-
validator:value=>value.trim() !=='',
352
+
validator:(value)=>value.trim() !=='',
340
353
errorText:'This field is required'
341
354
}
342
355
],
@@ -537,22 +550,22 @@ class EditableRowsTable extends React.Component {
0 commit comments