@patternfly/react-table 6.0.0-alpha.58 → 6.0.0-alpha.59
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/CHANGELOG.md +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/Table/package.json +1 -1
- package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
- package/dist/dynamic/components/Table/utils/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/esm/components/Table/Td.js +3 -3
- package/dist/esm/components/Table/Td.js.map +1 -1
- package/dist/esm/components/Table/Th.js +3 -3
- package/dist/esm/components/Table/Th.js.map +1 -1
- package/dist/js/components/Table/Td.js +3 -3
- package/dist/js/components/Table/Td.js.map +1 -1
- package/dist/js/components/Table/Th.js +3 -3
- package/dist/js/components/Table/Th.js.map +1 -1
- package/dist/umd/react-table.min.js +3 -3
- package/package.json +6 -6
- package/src/components/Table/Td.tsx +4 -4
- package/src/components/Table/Th.tsx +4 -4
- package/src/components/Table/examples/Table.md +35 -4
- package/src/components/Table/examples/TableMisc.tsx +2 -2
- package/src/components/Table/utils/transformers.test.tsx +2 -4
- package/src/demos/Table.md +0 -1
- package/src/demos/examples/TableEmptyStateError.tsx +2 -3
- package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +2 -2
- package/src/deprecated/components/Table/examples/Table.md +46 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-table",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.59",
|
|
4
4
|
"description": "This library provides a set of React table components for use with the PatternFly 4",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-core": "^6.0.0-alpha.
|
|
44
|
-
"@patternfly/react-icons": "^6.0.0-alpha.
|
|
45
|
-
"@patternfly/react-styles": "^6.0.0-alpha.
|
|
46
|
-
"@patternfly/react-tokens": "^6.0.0-alpha.
|
|
43
|
+
"@patternfly/react-core": "^6.0.0-alpha.59",
|
|
44
|
+
"@patternfly/react-icons": "^6.0.0-alpha.21",
|
|
45
|
+
"@patternfly/react-styles": "^6.0.0-alpha.21",
|
|
46
|
+
"@patternfly/react-tokens": "^6.0.0-alpha.21",
|
|
47
47
|
"lodash": "^4.17.19",
|
|
48
48
|
"tslib": "^2.5.0"
|
|
49
49
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"react": "^17 || ^18",
|
|
56
56
|
"react-dom": "^17 || ^18"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6101cfe558acec0474dd1c0649e44c38bf01383f"
|
|
59
59
|
}
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
TdTreeRowType
|
|
31
31
|
} from './base/types';
|
|
32
32
|
import cssStickyCellMinWidth from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth';
|
|
33
|
-
import
|
|
34
|
-
import
|
|
33
|
+
import cssStickyCellInlineStart from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineStart';
|
|
34
|
+
import cssStickyCellInlineEnd from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineEnd';
|
|
35
35
|
|
|
36
36
|
export interface TdProps extends BaseCellProps, Omit<React.HTMLProps<HTMLTableDataCellElement>, 'onSelect' | 'width'> {
|
|
37
37
|
/**
|
|
@@ -294,8 +294,8 @@ const TdBase: React.FunctionComponent<TdProps> = ({
|
|
|
294
294
|
{...(isStickyColumn && {
|
|
295
295
|
style: {
|
|
296
296
|
[cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
|
|
297
|
-
[
|
|
298
|
-
[
|
|
297
|
+
[cssStickyCellInlineStart.name]: stickyLeftOffset ? stickyLeftOffset : 0,
|
|
298
|
+
[cssStickyCellInlineEnd.name]: stickyRightOffset ? stickyRightOffset : 0,
|
|
299
299
|
...props.style
|
|
300
300
|
} as React.CSSProperties
|
|
301
301
|
})}
|
|
@@ -10,8 +10,8 @@ import { Tooltip, TooltipProps } from '@patternfly/react-core/dist/esm/component
|
|
|
10
10
|
import { BaseCellProps } from './Table';
|
|
11
11
|
import { IFormatterValueType, IColumn } from './TableTypes';
|
|
12
12
|
import cssStickyCellMinWidth from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import cssStickyCellInlineStart from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineStart';
|
|
14
|
+
import cssStickyCellInlineEnd from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineEnd';
|
|
15
15
|
|
|
16
16
|
export interface ThProps
|
|
17
17
|
extends BaseCellProps,
|
|
@@ -224,8 +224,8 @@ const ThBase: React.FunctionComponent<ThProps> = ({
|
|
|
224
224
|
{...(isStickyColumn && {
|
|
225
225
|
style: {
|
|
226
226
|
[cssStickyCellMinWidth.name]: stickyMinWidth ? stickyMinWidth : undefined,
|
|
227
|
-
[
|
|
228
|
-
[
|
|
227
|
+
[cssStickyCellInlineStart.name]: stickyLeftOffset ? stickyLeftOffset : 0,
|
|
228
|
+
[cssStickyCellInlineEnd.name]: stickyRightOffset ? stickyRightOffset : 0,
|
|
229
229
|
...props.style
|
|
230
230
|
} as React.CSSProperties
|
|
231
231
|
})}
|
|
@@ -56,7 +56,7 @@ import { css } from '@patternfly/react-styles';
|
|
|
56
56
|
import styles from '@patternfly/react-styles/css/components/Table/table';
|
|
57
57
|
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
58
58
|
import textStyles from '@patternfly/react-styles/css/utilities/Text/text';
|
|
59
|
-
import
|
|
59
|
+
import global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/global_background_color_secondary_default';
|
|
60
60
|
|
|
61
61
|
## Table examples
|
|
62
62
|
|
|
@@ -71,6 +71,7 @@ Some general notes:
|
|
|
71
71
|
### Basic
|
|
72
72
|
|
|
73
73
|
```ts file="TableBasic.tsx"
|
|
74
|
+
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
### Custom row wrapper, header tooltips & popovers
|
|
@@ -82,6 +83,7 @@ Some general notes:
|
|
|
82
83
|
To add a header tooltip or popover to `Th`, pass a `ThInfoType` object via the `info` prop.
|
|
83
84
|
|
|
84
85
|
```ts file="TableMisc.tsx"
|
|
86
|
+
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
### Sortable & wrapping headers
|
|
@@ -103,6 +105,7 @@ type OnSort = (
|
|
|
103
105
|
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. To see a full page demo of a responsive sortable table, utilizing a toolbar item to control sorting for small screens, view the `Sortable - responsive` demo in the `React demos` tab.
|
|
104
106
|
|
|
105
107
|
```ts file="TableSortable.tsx"
|
|
108
|
+
|
|
106
109
|
```
|
|
107
110
|
|
|
108
111
|
### Sortable - custom control
|
|
@@ -110,6 +113,7 @@ The built in display for sorting is not fully responsive, as the column headers
|
|
|
110
113
|
Sorting a table may also be controlled manually with a toolbar control. To see a full page demo of a responsive table, view the `Sortable - responsive` demo in the `React demos` tab.
|
|
111
114
|
|
|
112
115
|
```ts file="TableSortableCustom.tsx"
|
|
116
|
+
|
|
113
117
|
```
|
|
114
118
|
|
|
115
119
|
### Selectable with checkbox
|
|
@@ -140,6 +144,7 @@ type OnSelect = (
|
|
|
140
144
|
checking checkboxes will check intermediate rows' checkboxes.
|
|
141
145
|
|
|
142
146
|
```ts file="TableSelectable.tsx"
|
|
147
|
+
|
|
143
148
|
```
|
|
144
149
|
|
|
145
150
|
### Selectable radio input
|
|
@@ -147,6 +152,7 @@ checking checkboxes will check intermediate rows' checkboxes.
|
|
|
147
152
|
Similarly to the selectable example above, the radio buttons use the first column. The first header cell is empty, and each body row's first cell has radio button props.
|
|
148
153
|
|
|
149
154
|
```ts file="TableSelectableRadio.tsx"
|
|
155
|
+
|
|
150
156
|
```
|
|
151
157
|
|
|
152
158
|
### Row click handler, clickable rows
|
|
@@ -154,6 +160,7 @@ Similarly to the selectable example above, the radio buttons use the first colum
|
|
|
154
160
|
This selectable rows feature is intended for use when a table is used to present a list of objects in a Primary-detail view.
|
|
155
161
|
|
|
156
162
|
```ts file="TableClickable.tsx"
|
|
163
|
+
|
|
157
164
|
```
|
|
158
165
|
|
|
159
166
|
### Actions
|
|
@@ -165,6 +172,7 @@ To make a cell an action cell, render an `ActionsColumn` component inside a row'
|
|
|
165
172
|
If actions menus are getting clipped by other items on the page, such as sticky columns or rows, the `ActionsColumn` can be passed a `menuAppendTo` prop to adjust where the actions menu is appended.
|
|
166
173
|
|
|
167
174
|
```ts file="TableActions.tsx"
|
|
175
|
+
|
|
168
176
|
```
|
|
169
177
|
|
|
170
178
|
### Actions Overflow
|
|
@@ -172,6 +180,7 @@ If actions menus are getting clipped by other items on the page, such as sticky
|
|
|
172
180
|
Useing an `OverflowMenu` in the actions column, allowing the actions to condense into a dropdown if necessary for space.
|
|
173
181
|
|
|
174
182
|
```ts file="TableActionsOverflow.tsx"
|
|
183
|
+
|
|
175
184
|
```
|
|
176
185
|
|
|
177
186
|
### Expandable
|
|
@@ -197,6 +206,7 @@ type OnCollapse = (
|
|
|
197
206
|
Note: Table column widths will respond automatically when toggling expanded rows. To retain column widths between expanded and collapsed states, column header and/or data cell widths must be set.
|
|
198
207
|
|
|
199
208
|
```ts file="TableExpandable.tsx"
|
|
209
|
+
|
|
200
210
|
```
|
|
201
211
|
|
|
202
212
|
### Compound expandable
|
|
@@ -221,16 +231,19 @@ export type OnExpand = (
|
|
|
221
231
|
```
|
|
222
232
|
|
|
223
233
|
```ts file="TableCompoundExpandable.tsx"
|
|
234
|
+
|
|
224
235
|
```
|
|
225
236
|
|
|
226
237
|
### Cell width, breakpoint modifiers
|
|
227
238
|
|
|
228
239
|
```ts file="TableCellWidth.tsx"
|
|
240
|
+
|
|
229
241
|
```
|
|
230
242
|
|
|
231
243
|
### Controlling text
|
|
232
244
|
|
|
233
245
|
```ts file="TableControllingText.tsx"
|
|
246
|
+
|
|
234
247
|
```
|
|
235
248
|
|
|
236
249
|
### Modifiers with table text
|
|
@@ -238,11 +251,13 @@ export type OnExpand = (
|
|
|
238
251
|
If the "wrapModifier" property is set to "truncate", it's needed to ensure that the corresponding tooltip can be opened using both keyboard and screen reader. Since this particular Td element is generic and doesn't have any predefined decorators, the focus management required to trigger the tooltip needs to be handled manually by defining and manipulating the requisite props.
|
|
239
252
|
|
|
240
253
|
```ts file="TableTextModifiers.tsx"
|
|
254
|
+
|
|
241
255
|
```
|
|
242
256
|
|
|
243
257
|
### Empty state
|
|
244
258
|
|
|
245
259
|
```ts file="TableEmptyState.tsx"
|
|
260
|
+
|
|
246
261
|
```
|
|
247
262
|
|
|
248
263
|
### Favoritable (implemented with sortable)
|
|
@@ -265,6 +280,7 @@ type OnFavorite = (
|
|
|
265
280
|
To make a favoritable column sortable, pass a `ThSortType` object to the favoritable column's `Th` with `isFavorites` set to true.
|
|
266
281
|
|
|
267
282
|
```ts file="TableFavoritable.tsx"
|
|
283
|
+
|
|
268
284
|
```
|
|
269
285
|
|
|
270
286
|
### Tree table
|
|
@@ -298,6 +314,7 @@ aria-posinset, and aria-setsize as violations. This is an intentional choice at
|
|
|
298
314
|
the voice over technologies will recognize the flat table structure as a tree.
|
|
299
315
|
|
|
300
316
|
```ts file="TableTree.tsx"
|
|
317
|
+
|
|
301
318
|
```
|
|
302
319
|
|
|
303
320
|
### Flat tree table with no inset
|
|
@@ -305,6 +322,7 @@ the voice over technologies will recognize the flat table structure as a tree.
|
|
|
305
322
|
To remove the inset used to leave space for the expand/collapse toggle in a flat tree table, use the `hasNoInset` prop on the `Table` component.
|
|
306
323
|
|
|
307
324
|
```ts file="TableTreeNoInset.tsx"
|
|
325
|
+
|
|
308
326
|
```
|
|
309
327
|
|
|
310
328
|
### Draggable row table
|
|
@@ -318,6 +336,7 @@ To make a row draggable:
|
|
|
318
336
|
5. The draggable `Td` in each row needs a `TdDraggableType` object passed to its `draggable` prop.
|
|
319
337
|
|
|
320
338
|
```ts isBeta file="TableDraggable.tsx"
|
|
339
|
+
|
|
321
340
|
```
|
|
322
341
|
|
|
323
342
|
### Sticky table modifiers
|
|
@@ -334,7 +353,7 @@ There are a few ways this can be handled:
|
|
|
334
353
|
|
|
335
354
|
### Sticky column
|
|
336
355
|
|
|
337
|
-
To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky:
|
|
356
|
+
To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the following properties to the `Th` or `Td` that should be sticky:
|
|
338
357
|
|
|
339
358
|
- `isStickyColumn`
|
|
340
359
|
- `hasRightBorder` for a left-aligned sticky column, or `hasLeftBorder` for a right-aligned sticky column.
|
|
@@ -342,6 +361,7 @@ To make a column sticky, wrap `Table` with `InnerScrollContainer` and add the fo
|
|
|
342
361
|
To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property. To set the minimum width of the sticky column, use the `stickyMinWidth` property. For multiple sticky columns, use the `stickyLeftOffset` and `stickyRightOffset` properties for additional left or right sticky columns.
|
|
343
362
|
|
|
344
363
|
```ts file="TableStickyColumn.tsx"
|
|
364
|
+
|
|
345
365
|
```
|
|
346
366
|
|
|
347
367
|
### Multiple left-aligned sticky columns
|
|
@@ -351,11 +371,12 @@ To make multiple left-aligned columns sticky:
|
|
|
351
371
|
- wrap `Table` with `InnerScrollContainer`
|
|
352
372
|
- add `isStickyColumn` to all columns that should be sticky
|
|
353
373
|
- add `hasRightBorder` to the rightmost sticky column
|
|
354
|
-
- add `stickyLeftOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the previous sticky columns. The leftmost sticky column should have a value of `0`, which is the default of this property.
|
|
374
|
+
- add `stickyLeftOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the previous sticky columns. The leftmost sticky column should have a value of `0`, which is the default of this property.
|
|
355
375
|
|
|
356
376
|
To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
|
|
357
377
|
|
|
358
378
|
```ts file="TableMultipleStickyColumns.tsx"
|
|
379
|
+
|
|
359
380
|
```
|
|
360
381
|
|
|
361
382
|
### Multiple right-aligned sticky columns
|
|
@@ -365,11 +386,12 @@ To make multiple right-aligned columns sticky:
|
|
|
365
386
|
- wrap `Table` with `InnerScrollContainer`
|
|
366
387
|
- add `isStickyColumn` to all columns that should be sticky
|
|
367
388
|
- add `hasLeftBorder` to the leftmost sticky column
|
|
368
|
-
- add `stickyRightOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the next sticky columns. The rightmost sticky column should have a value of `0`, which is the default of this property.
|
|
389
|
+
- add `stickyRightOffset` to each sticky column with a value that equals the combined width - set by `stickyMindWidth` - of the next sticky columns. The rightmost sticky column should have a value of `0`, which is the default of this property.
|
|
369
390
|
|
|
370
391
|
To prevent the default text wrapping behavior and allow horizontal scrolling, all `Th` or `Td` cells should also have the `modifier="nowrap"` property.
|
|
371
392
|
|
|
372
393
|
```ts file="TableRightStickyColumn.tsx"
|
|
394
|
+
|
|
373
395
|
```
|
|
374
396
|
|
|
375
397
|
### Sticky columns and header
|
|
@@ -377,6 +399,7 @@ To prevent the default text wrapping behavior and allow horizontal scrolling, al
|
|
|
377
399
|
To maintain proper sticky behavior across sticky columns and header, `Table` must be wrapped with `OuterScrollContainer` and `InnerScrollContainer`.
|
|
378
400
|
|
|
379
401
|
```ts file="TableStickyColumnsAndHeader.tsx"
|
|
402
|
+
|
|
380
403
|
```
|
|
381
404
|
|
|
382
405
|
### Nested column headers
|
|
@@ -393,21 +416,25 @@ The first `Tr` represents the top level of columns, and each must pass either `r
|
|
|
393
416
|
The second `Tr` represents the second level of sub columns. The `Th` in this row each should pass `isSubHeader`, and the last sub column of a column should also pass `hasRightBorder`.
|
|
394
417
|
|
|
395
418
|
```ts file="TableNestedHeaders.tsx"
|
|
419
|
+
|
|
396
420
|
```
|
|
397
421
|
|
|
398
422
|
### Nested column headers and expandable rows
|
|
399
423
|
|
|
400
424
|
```ts file="TableNestedExpandable.tsx"
|
|
425
|
+
|
|
401
426
|
```
|
|
402
427
|
|
|
403
428
|
### Expandable with nested table
|
|
404
429
|
|
|
405
430
|
```ts file="TableNestedTableExpandable.tsx"
|
|
431
|
+
|
|
406
432
|
```
|
|
407
433
|
|
|
408
434
|
### Nested sticky header
|
|
409
435
|
|
|
410
436
|
```ts file="TableNestedStickyHeader.tsx"
|
|
437
|
+
|
|
411
438
|
```
|
|
412
439
|
|
|
413
440
|
### Striped
|
|
@@ -415,6 +442,7 @@ The second `Tr` represents the second level of sub columns. The `Th` in this row
|
|
|
415
442
|
To apply striping to a basic table, add the `isStriped` property to `Table`.
|
|
416
443
|
|
|
417
444
|
```ts file="TableStriped.tsx"
|
|
445
|
+
|
|
418
446
|
```
|
|
419
447
|
|
|
420
448
|
### Striped expandable
|
|
@@ -422,6 +450,7 @@ To apply striping to a basic table, add the `isStriped` property to `Table`.
|
|
|
422
450
|
To apply striping to an expandable table, add the `isStriped` and `isExpandable` properties to `Table`.
|
|
423
451
|
|
|
424
452
|
```ts file="TableStripedExpandable.tsx"
|
|
453
|
+
|
|
425
454
|
```
|
|
426
455
|
|
|
427
456
|
### Striped multiple tobdy
|
|
@@ -429,6 +458,7 @@ To apply striping to an expandable table, add the `isStriped` and `isExpandable`
|
|
|
429
458
|
When there are multiple `Tbody` components within a table, a more granular application of striping may be controlled by adding either the `isEvenStriped` or `isOddStriped` properties to `Tbody`. These properties will stripe even or odd rows within that `Tbody` respectively.
|
|
430
459
|
|
|
431
460
|
```ts file="TableStripedMultipleTbody.tsx"
|
|
461
|
+
|
|
432
462
|
```
|
|
433
463
|
|
|
434
464
|
### Striped tr
|
|
@@ -436,4 +466,5 @@ When there are multiple `Tbody` components within a table, a more granular appli
|
|
|
436
466
|
To manually control striping, add the `isStriped` property to each desired `Tr`. This replaces adding the `isStriped` property to `Table`.
|
|
437
467
|
|
|
438
468
|
```ts file="TableStripedTr.tsx"
|
|
469
|
+
|
|
439
470
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
3
3
|
/* eslint-disable camelcase */
|
|
4
|
-
import
|
|
4
|
+
import global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/global_background_color_secondary_default';
|
|
5
5
|
|
|
6
6
|
interface Repository {
|
|
7
7
|
name: string;
|
|
@@ -67,7 +67,7 @@ export const TableMisc: React.FunctionComponent = () => {
|
|
|
67
67
|
{repositories.map((repo, rowIndex) => {
|
|
68
68
|
const isOddRow = (rowIndex + 1) % 2;
|
|
69
69
|
const customStyle = {
|
|
70
|
-
backgroundColor:
|
|
70
|
+
backgroundColor: global_background_color_secondary_default.var
|
|
71
71
|
};
|
|
72
72
|
// Some arbitrary logic to demonstrate that cell styles can be based on anything
|
|
73
73
|
const nameColSpan = repo.branches === null && repo.prs === null ? 3 : 1;
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from '../TableTypes';
|
|
31
31
|
import { css } from '@patternfly/react-styles';
|
|
32
32
|
import tableStyles from '@patternfly/react-styles/css/components/Table/table';
|
|
33
|
-
import
|
|
33
|
+
import menuStyles from '@patternfly/react-styles/css/components/Menu/menu';
|
|
34
34
|
|
|
35
35
|
const testCellActions = async ({
|
|
36
36
|
actions,
|
|
@@ -76,9 +76,7 @@ const testCellActions = async ({
|
|
|
76
76
|
await user.click(screen.getAllByRole('button')[0]);
|
|
77
77
|
await waitFor(() =>
|
|
78
78
|
// eslint-disable-next-line testing-library/no-container
|
|
79
|
-
expect(container.querySelectorAll(`.${
|
|
80
|
-
expectDisabled ? 0 : 1
|
|
81
|
-
)
|
|
79
|
+
expect(container.querySelectorAll(`.${menuStyles.menu} li button`)).toHaveLength(expectDisabled ? 0 : 1)
|
|
82
80
|
);
|
|
83
81
|
}
|
|
84
82
|
};
|
package/src/demos/Table.md
CHANGED
|
@@ -57,7 +57,6 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclam
|
|
|
57
57
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
58
58
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
59
59
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
60
|
-
import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
|
|
61
60
|
import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
|
|
62
61
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
63
62
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
PageSection
|
|
12
12
|
} from '@patternfly/react-core';
|
|
13
13
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
14
|
-
import globalDangerColor200 from '@patternfly/react-tokens/dist/esm/global_danger_color_200';
|
|
15
14
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
16
15
|
|
|
17
16
|
export const TableEmptyStateError: React.FunctionComponent = () => (
|
|
@@ -32,10 +31,10 @@ export const TableEmptyStateError: React.FunctionComponent = () => (
|
|
|
32
31
|
<Tr>
|
|
33
32
|
<Td colSpan={8}>
|
|
34
33
|
<Bullseye>
|
|
35
|
-
<EmptyState variant={EmptyStateVariant.sm}>
|
|
34
|
+
<EmptyState variant={EmptyStateVariant.sm} titleText="">
|
|
36
35
|
<EmptyStateHeader
|
|
37
36
|
titleText="Unable to connect"
|
|
38
|
-
icon={<EmptyStateIcon icon={ExclamationCircleIcon}
|
|
37
|
+
icon={<EmptyStateIcon icon={ExclamationCircleIcon} />}
|
|
39
38
|
headingLevel="h2"
|
|
40
39
|
/>
|
|
41
40
|
<EmptyStateBody>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Table, TableHeader, TableBody, TableProps } from '@patternfly/react-table/deprecated';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
/* eslint-disable camelcase */
|
|
5
|
-
import
|
|
5
|
+
import global_color_brand_default from '@patternfly/react-tokens/dist/esm/global_color_brand_default';
|
|
6
6
|
|
|
7
7
|
interface Repository {
|
|
8
8
|
name: string;
|
|
@@ -32,7 +32,7 @@ export const LegacyTableMisc: React.FunctionComponent = () => {
|
|
|
32
32
|
const customRowWrapper: TableProps['rowWrapper'] = ({ trRef, className, rowProps, row: _row }) => {
|
|
33
33
|
const isOddRow = rowProps ? !!((rowProps.rowIndex + 1) % 2) : true;
|
|
34
34
|
const customStyle = {
|
|
35
|
-
borderLeft: `3px solid ${
|
|
35
|
+
borderLeft: `3px solid ${global_color_brand_default.var}`
|
|
36
36
|
};
|
|
37
37
|
return (
|
|
38
38
|
<tr
|