@itwin/itwinui-react 3.15.4 → 3.15.5
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 +7 -0
- package/DEV-cjs/core/Table/Table.js +61 -43
- package/DEV-cjs/styles.js +1 -1
- package/DEV-esm/core/Table/Table.js +61 -43
- package/DEV-esm/styles.js +1 -1
- package/cjs/core/NonIdealState/NonIdealState.d.ts +15 -11
- package/cjs/core/Table/Table.js +61 -43
- package/cjs/styles.js +1 -1
- package/esm/core/NonIdealState/NonIdealState.d.ts +15 -11
- package/esm/core/Table/Table.js +61 -43
- package/esm/styles.js +1 -1
- package/package.json +1 -1
- package/styles.css +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.15.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2306](https://github.com/iTwin/iTwinUI/pull/2306): Fixed broken expandable content (`subComponent`) when `Table` is asynchronously re-rendered.
|
|
8
|
+
- [#2306](https://github.com/iTwin/iTwinUI/pull/2306): Fixed `Table`'s max depth reached error caused when passing the `getRowId` prop.
|
|
9
|
+
|
|
3
10
|
## 3.15.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -36,6 +36,7 @@ const singleRowSelectedAction = 'singleRowSelected';
|
|
|
36
36
|
const shiftRowSelectedAction = 'shiftRowSelected';
|
|
37
37
|
const tableResizeStartAction = 'tableResizeStart';
|
|
38
38
|
const tableResizeEndAction = 'tableResizeEnd';
|
|
39
|
+
const iuiId = Symbol('iui-id');
|
|
39
40
|
const flattenColumns = (columns) => {
|
|
40
41
|
let flatColumns = [];
|
|
41
42
|
columns.forEach((column) => {
|
|
@@ -88,6 +89,7 @@ const Table = (props) => {
|
|
|
88
89
|
headerProps,
|
|
89
90
|
bodyProps,
|
|
90
91
|
emptyTableContentProps,
|
|
92
|
+
getRowId,
|
|
91
93
|
...rest
|
|
92
94
|
} = props;
|
|
93
95
|
(0, _index.useGlobals)();
|
|
@@ -225,16 +227,30 @@ const Table = (props) => {
|
|
|
225
227
|
),
|
|
226
228
|
[data, getSubRows],
|
|
227
229
|
);
|
|
228
|
-
let [rowHasParent] = _react.useState(() => new WeakSet());
|
|
229
230
|
let getSubRowsWithSubComponents = _react.useCallback(
|
|
230
|
-
(originalRow) => {
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
(originalRow, relativeIndex) => {
|
|
232
|
+
if (originalRow[iuiId]) return [];
|
|
233
|
+
if (originalRow.subRows) return originalRow.subRows;
|
|
234
|
+
return [
|
|
235
|
+
{
|
|
236
|
+
[iuiId]: `subcomponent-${relativeIndex}`,
|
|
237
|
+
...originalRow,
|
|
238
|
+
},
|
|
239
|
+
];
|
|
240
|
+
},
|
|
241
|
+
[],
|
|
242
|
+
);
|
|
243
|
+
let getRowIdWithSubComponents = _react.useCallback(
|
|
244
|
+
(originalRow, relativeIndex, parent) => {
|
|
245
|
+
let defaultRowId = parent
|
|
246
|
+
? `${parent.id}.${relativeIndex}`
|
|
247
|
+
: `${relativeIndex}`;
|
|
248
|
+
let rowIdFromUser = getRowId?.(originalRow, relativeIndex, parent);
|
|
249
|
+
if (void 0 !== rowIdFromUser && originalRow[iuiId])
|
|
250
|
+
return `${rowIdFromUser}-${defaultRowId}`;
|
|
251
|
+
return rowIdFromUser ?? defaultRowId;
|
|
236
252
|
},
|
|
237
|
-
[
|
|
253
|
+
[getRowId],
|
|
238
254
|
);
|
|
239
255
|
let instance = (0, _reacttable.useTable)(
|
|
240
256
|
{
|
|
@@ -254,6 +270,7 @@ const Table = (props) => {
|
|
|
254
270
|
...props.initialState,
|
|
255
271
|
},
|
|
256
272
|
columnResizeMode,
|
|
273
|
+
getRowId: subComponent ? getRowIdWithSubComponents : getRowId,
|
|
257
274
|
},
|
|
258
275
|
_reacttable.useFlexLayout,
|
|
259
276
|
(0, _index1.useResizeColumns)(ownerDocument),
|
|
@@ -459,51 +476,52 @@ const Table = (props) => {
|
|
|
459
476
|
(index, virtualItem, virtualizer) => {
|
|
460
477
|
let row = page[index];
|
|
461
478
|
prepareRow(row);
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
479
|
+
let isRowASubComponent = !!row.original[iuiId] && !!subComponent;
|
|
480
|
+
if (isRowASubComponent)
|
|
481
|
+
return _react.createElement(
|
|
482
|
+
_TableExpandableContentMemoized.TableExpandableContentMemoized,
|
|
483
|
+
{
|
|
484
|
+
key: row.getRowProps().key,
|
|
485
|
+
virtualItem: virtualItem,
|
|
486
|
+
ref: enableVirtualization
|
|
487
|
+
? virtualizer?.measureElement
|
|
488
|
+
: tableRowRef(row),
|
|
489
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
490
|
+
},
|
|
491
|
+
subComponent(row),
|
|
492
|
+
);
|
|
493
|
+
return _react.createElement(_TableRowMemoized.TableRowMemoized, {
|
|
494
|
+
row: row,
|
|
495
|
+
rowProps: rowProps,
|
|
496
|
+
isLast: index === page.length - 1,
|
|
497
|
+
onRowInViewport: onRowInViewportRef,
|
|
498
|
+
onBottomReached: onBottomReachedRef,
|
|
499
|
+
intersectionMargin: intersectionMargin,
|
|
500
|
+
state: state,
|
|
501
|
+
key: row.getRowProps().key,
|
|
502
|
+
onClick: onRowClickHandler,
|
|
503
|
+
subComponent: subComponent,
|
|
504
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
505
|
+
tableHasSubRows: hasAnySubRows,
|
|
506
|
+
tableInstance: instance,
|
|
507
|
+
expanderCell: expanderCell,
|
|
508
|
+
scrollContainerRef: tableRef.current,
|
|
509
|
+
tableRowRef: enableVirtualization ? void 0 : tableRowRef(row),
|
|
510
|
+
density: density,
|
|
511
|
+
virtualItem: virtualItem,
|
|
512
|
+
virtualizer: virtualizer,
|
|
513
|
+
});
|
|
496
514
|
},
|
|
497
515
|
[
|
|
498
516
|
page,
|
|
499
517
|
prepareRow,
|
|
518
|
+
subComponent,
|
|
500
519
|
rowProps,
|
|
501
520
|
onRowInViewportRef,
|
|
502
521
|
onBottomReachedRef,
|
|
503
522
|
intersectionMargin,
|
|
504
523
|
state,
|
|
505
524
|
onRowClickHandler,
|
|
506
|
-
subComponent,
|
|
507
525
|
isRowDisabled,
|
|
508
526
|
hasAnySubRows,
|
|
509
527
|
instance,
|
package/DEV-cjs/styles.js
CHANGED
|
@@ -53,6 +53,7 @@ let singleRowSelectedAction = 'singleRowSelected';
|
|
|
53
53
|
let shiftRowSelectedAction = 'shiftRowSelected';
|
|
54
54
|
export const tableResizeStartAction = 'tableResizeStart';
|
|
55
55
|
let tableResizeEndAction = 'tableResizeEnd';
|
|
56
|
+
let iuiId = Symbol('iui-id');
|
|
56
57
|
let flattenColumns = (columns) => {
|
|
57
58
|
let flatColumns = [];
|
|
58
59
|
columns.forEach((column) => {
|
|
@@ -105,6 +106,7 @@ export const Table = (props) => {
|
|
|
105
106
|
headerProps,
|
|
106
107
|
bodyProps,
|
|
107
108
|
emptyTableContentProps,
|
|
109
|
+
getRowId,
|
|
108
110
|
...rest
|
|
109
111
|
} = props;
|
|
110
112
|
useGlobals();
|
|
@@ -240,16 +242,30 @@ export const Table = (props) => {
|
|
|
240
242
|
),
|
|
241
243
|
[data, getSubRows],
|
|
242
244
|
);
|
|
243
|
-
let [rowHasParent] = React.useState(() => new WeakSet());
|
|
244
245
|
let getSubRowsWithSubComponents = React.useCallback(
|
|
245
|
-
(originalRow) => {
|
|
246
|
-
if (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
(originalRow, relativeIndex) => {
|
|
247
|
+
if (originalRow[iuiId]) return [];
|
|
248
|
+
if (originalRow.subRows) return originalRow.subRows;
|
|
249
|
+
return [
|
|
250
|
+
{
|
|
251
|
+
[iuiId]: `subcomponent-${relativeIndex}`,
|
|
252
|
+
...originalRow,
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
},
|
|
256
|
+
[],
|
|
257
|
+
);
|
|
258
|
+
let getRowIdWithSubComponents = React.useCallback(
|
|
259
|
+
(originalRow, relativeIndex, parent) => {
|
|
260
|
+
let defaultRowId = parent
|
|
261
|
+
? `${parent.id}.${relativeIndex}`
|
|
262
|
+
: `${relativeIndex}`;
|
|
263
|
+
let rowIdFromUser = getRowId?.(originalRow, relativeIndex, parent);
|
|
264
|
+
if (void 0 !== rowIdFromUser && originalRow[iuiId])
|
|
265
|
+
return `${rowIdFromUser}-${defaultRowId}`;
|
|
266
|
+
return rowIdFromUser ?? defaultRowId;
|
|
251
267
|
},
|
|
252
|
-
[
|
|
268
|
+
[getRowId],
|
|
253
269
|
);
|
|
254
270
|
let instance = useTable(
|
|
255
271
|
{
|
|
@@ -269,6 +285,7 @@ export const Table = (props) => {
|
|
|
269
285
|
...props.initialState,
|
|
270
286
|
},
|
|
271
287
|
columnResizeMode,
|
|
288
|
+
getRowId: subComponent ? getRowIdWithSubComponents : getRowId,
|
|
272
289
|
},
|
|
273
290
|
useFlexLayout,
|
|
274
291
|
useResizeColumns(ownerDocument),
|
|
@@ -469,51 +486,52 @@ export const Table = (props) => {
|
|
|
469
486
|
(index, virtualItem, virtualizer) => {
|
|
470
487
|
let row = page[index];
|
|
471
488
|
prepareRow(row);
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
489
|
+
let isRowASubComponent = !!row.original[iuiId] && !!subComponent;
|
|
490
|
+
if (isRowASubComponent)
|
|
491
|
+
return React.createElement(
|
|
492
|
+
TableExpandableContentMemoized,
|
|
493
|
+
{
|
|
494
|
+
key: row.getRowProps().key,
|
|
495
|
+
virtualItem: virtualItem,
|
|
496
|
+
ref: enableVirtualization
|
|
497
|
+
? virtualizer?.measureElement
|
|
498
|
+
: tableRowRef(row),
|
|
499
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
500
|
+
},
|
|
501
|
+
subComponent(row),
|
|
502
|
+
);
|
|
503
|
+
return React.createElement(TableRowMemoized, {
|
|
504
|
+
row: row,
|
|
505
|
+
rowProps: rowProps,
|
|
506
|
+
isLast: index === page.length - 1,
|
|
507
|
+
onRowInViewport: onRowInViewportRef,
|
|
508
|
+
onBottomReached: onBottomReachedRef,
|
|
509
|
+
intersectionMargin: intersectionMargin,
|
|
510
|
+
state: state,
|
|
511
|
+
key: row.getRowProps().key,
|
|
512
|
+
onClick: onRowClickHandler,
|
|
513
|
+
subComponent: subComponent,
|
|
514
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
515
|
+
tableHasSubRows: hasAnySubRows,
|
|
516
|
+
tableInstance: instance,
|
|
517
|
+
expanderCell: expanderCell,
|
|
518
|
+
scrollContainerRef: tableRef.current,
|
|
519
|
+
tableRowRef: enableVirtualization ? void 0 : tableRowRef(row),
|
|
520
|
+
density: density,
|
|
521
|
+
virtualItem: virtualItem,
|
|
522
|
+
virtualizer: virtualizer,
|
|
523
|
+
});
|
|
506
524
|
},
|
|
507
525
|
[
|
|
508
526
|
page,
|
|
509
527
|
prepareRow,
|
|
528
|
+
subComponent,
|
|
510
529
|
rowProps,
|
|
511
530
|
onRowInViewportRef,
|
|
512
531
|
onBottomReachedRef,
|
|
513
532
|
intersectionMargin,
|
|
514
533
|
state,
|
|
515
534
|
onRowClickHandler,
|
|
516
|
-
subComponent,
|
|
517
535
|
isRowDisabled,
|
|
518
536
|
hasAnySubRows,
|
|
519
537
|
instance,
|
package/DEV-esm/styles.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
|
|
3
3
|
type NonIdealStateProps = {
|
|
4
4
|
/**
|
|
5
|
-
* An svg component, preferably from
|
|
5
|
+
* An svg component, preferably from `@itwin/itwinui-illustrations-react`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* import { Svg404 } from '@itwin/itwinui-illustrations-react';
|
|
@@ -10,13 +10,17 @@ type NonIdealStateProps = {
|
|
|
10
10
|
*/
|
|
11
11
|
svg: React.ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
* Primary heading for the
|
|
13
|
+
* Primary heading for the `NonIdealState`
|
|
14
14
|
*/
|
|
15
15
|
heading?: React.ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Secondary text to explain the error
|
|
18
18
|
* Can include html in order to provide a hyperlink
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <>
|
|
22
|
+
* Please visit <Anchor href="https://www.bentley.com/help">our support page</Anchor> for help.
|
|
23
|
+
* </>
|
|
20
24
|
*/
|
|
21
25
|
description?: React.ReactNode;
|
|
22
26
|
/**
|
|
@@ -24,13 +28,13 @@ type NonIdealStateProps = {
|
|
|
24
28
|
* Typically should be a primary and secondary button.
|
|
25
29
|
*
|
|
26
30
|
* @example
|
|
27
|
-
* <
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* <NonIdealState
|
|
32
|
+
* actions={
|
|
33
|
+
* <>
|
|
34
|
+
* <Button styleType={'high-visibility'}>Retry</Button>
|
|
35
|
+
* <Button>Contact us</Button>
|
|
36
|
+
* </>
|
|
37
|
+
* }
|
|
34
38
|
* />
|
|
35
39
|
*/
|
|
36
40
|
actions?: React.ReactNode;
|
|
@@ -53,7 +57,7 @@ type NonIdealStateProps = {
|
|
|
53
57
|
};
|
|
54
58
|
/**
|
|
55
59
|
* A stylized display to communicate common http errors and other non-ideal states.
|
|
56
|
-
* Works well with svgs from
|
|
60
|
+
* Works well with svgs from `@itwin/itwinui-illustrations-react`.
|
|
57
61
|
*
|
|
58
62
|
* @example
|
|
59
63
|
* <NonIdealState svg={<Svg404 />} heading='Not found' />
|
package/cjs/core/Table/Table.js
CHANGED
|
@@ -36,6 +36,7 @@ const singleRowSelectedAction = 'singleRowSelected';
|
|
|
36
36
|
const shiftRowSelectedAction = 'shiftRowSelected';
|
|
37
37
|
const tableResizeStartAction = 'tableResizeStart';
|
|
38
38
|
const tableResizeEndAction = 'tableResizeEnd';
|
|
39
|
+
const iuiId = Symbol('iui-id');
|
|
39
40
|
const flattenColumns = (columns) => {
|
|
40
41
|
let flatColumns = [];
|
|
41
42
|
columns.forEach((column) => {
|
|
@@ -88,6 +89,7 @@ const Table = (props) => {
|
|
|
88
89
|
headerProps,
|
|
89
90
|
bodyProps,
|
|
90
91
|
emptyTableContentProps,
|
|
92
|
+
getRowId,
|
|
91
93
|
...rest
|
|
92
94
|
} = props;
|
|
93
95
|
(0, _index.useGlobals)();
|
|
@@ -225,16 +227,30 @@ const Table = (props) => {
|
|
|
225
227
|
),
|
|
226
228
|
[data, getSubRows],
|
|
227
229
|
);
|
|
228
|
-
let [rowHasParent] = _react.useState(() => new WeakSet());
|
|
229
230
|
let getSubRowsWithSubComponents = _react.useCallback(
|
|
230
|
-
(originalRow) => {
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
(originalRow, relativeIndex) => {
|
|
232
|
+
if (originalRow[iuiId]) return [];
|
|
233
|
+
if (originalRow.subRows) return originalRow.subRows;
|
|
234
|
+
return [
|
|
235
|
+
{
|
|
236
|
+
[iuiId]: `subcomponent-${relativeIndex}`,
|
|
237
|
+
...originalRow,
|
|
238
|
+
},
|
|
239
|
+
];
|
|
240
|
+
},
|
|
241
|
+
[],
|
|
242
|
+
);
|
|
243
|
+
let getRowIdWithSubComponents = _react.useCallback(
|
|
244
|
+
(originalRow, relativeIndex, parent) => {
|
|
245
|
+
let defaultRowId = parent
|
|
246
|
+
? `${parent.id}.${relativeIndex}`
|
|
247
|
+
: `${relativeIndex}`;
|
|
248
|
+
let rowIdFromUser = getRowId?.(originalRow, relativeIndex, parent);
|
|
249
|
+
if (void 0 !== rowIdFromUser && originalRow[iuiId])
|
|
250
|
+
return `${rowIdFromUser}-${defaultRowId}`;
|
|
251
|
+
return rowIdFromUser ?? defaultRowId;
|
|
236
252
|
},
|
|
237
|
-
[
|
|
253
|
+
[getRowId],
|
|
238
254
|
);
|
|
239
255
|
let instance = (0, _reacttable.useTable)(
|
|
240
256
|
{
|
|
@@ -254,6 +270,7 @@ const Table = (props) => {
|
|
|
254
270
|
...props.initialState,
|
|
255
271
|
},
|
|
256
272
|
columnResizeMode,
|
|
273
|
+
getRowId: subComponent ? getRowIdWithSubComponents : getRowId,
|
|
257
274
|
},
|
|
258
275
|
_reacttable.useFlexLayout,
|
|
259
276
|
(0, _index1.useResizeColumns)(ownerDocument),
|
|
@@ -451,51 +468,52 @@ const Table = (props) => {
|
|
|
451
468
|
(index, virtualItem, virtualizer) => {
|
|
452
469
|
let row = page[index];
|
|
453
470
|
prepareRow(row);
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
471
|
+
let isRowASubComponent = !!row.original[iuiId] && !!subComponent;
|
|
472
|
+
if (isRowASubComponent)
|
|
473
|
+
return _react.createElement(
|
|
474
|
+
_TableExpandableContentMemoized.TableExpandableContentMemoized,
|
|
475
|
+
{
|
|
476
|
+
key: row.getRowProps().key,
|
|
477
|
+
virtualItem: virtualItem,
|
|
478
|
+
ref: enableVirtualization
|
|
479
|
+
? virtualizer?.measureElement
|
|
480
|
+
: tableRowRef(row),
|
|
481
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
482
|
+
},
|
|
483
|
+
subComponent(row),
|
|
484
|
+
);
|
|
485
|
+
return _react.createElement(_TableRowMemoized.TableRowMemoized, {
|
|
486
|
+
row: row,
|
|
487
|
+
rowProps: rowProps,
|
|
488
|
+
isLast: index === page.length - 1,
|
|
489
|
+
onRowInViewport: onRowInViewportRef,
|
|
490
|
+
onBottomReached: onBottomReachedRef,
|
|
491
|
+
intersectionMargin: intersectionMargin,
|
|
492
|
+
state: state,
|
|
493
|
+
key: row.getRowProps().key,
|
|
494
|
+
onClick: onRowClickHandler,
|
|
495
|
+
subComponent: subComponent,
|
|
496
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
497
|
+
tableHasSubRows: hasAnySubRows,
|
|
498
|
+
tableInstance: instance,
|
|
499
|
+
expanderCell: expanderCell,
|
|
500
|
+
scrollContainerRef: tableRef.current,
|
|
501
|
+
tableRowRef: enableVirtualization ? void 0 : tableRowRef(row),
|
|
502
|
+
density: density,
|
|
503
|
+
virtualItem: virtualItem,
|
|
504
|
+
virtualizer: virtualizer,
|
|
505
|
+
});
|
|
488
506
|
},
|
|
489
507
|
[
|
|
490
508
|
page,
|
|
491
509
|
prepareRow,
|
|
510
|
+
subComponent,
|
|
492
511
|
rowProps,
|
|
493
512
|
onRowInViewportRef,
|
|
494
513
|
onBottomReachedRef,
|
|
495
514
|
intersectionMargin,
|
|
496
515
|
state,
|
|
497
516
|
onRowClickHandler,
|
|
498
|
-
subComponent,
|
|
499
517
|
isRowDisabled,
|
|
500
518
|
hasAnySubRows,
|
|
501
519
|
instance,
|
package/cjs/styles.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
|
|
3
3
|
type NonIdealStateProps = {
|
|
4
4
|
/**
|
|
5
|
-
* An svg component, preferably from
|
|
5
|
+
* An svg component, preferably from `@itwin/itwinui-illustrations-react`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* import { Svg404 } from '@itwin/itwinui-illustrations-react';
|
|
@@ -10,13 +10,17 @@ type NonIdealStateProps = {
|
|
|
10
10
|
*/
|
|
11
11
|
svg: React.ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
* Primary heading for the
|
|
13
|
+
* Primary heading for the `NonIdealState`
|
|
14
14
|
*/
|
|
15
15
|
heading?: React.ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Secondary text to explain the error
|
|
18
18
|
* Can include html in order to provide a hyperlink
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <>
|
|
22
|
+
* Please visit <Anchor href="https://www.bentley.com/help">our support page</Anchor> for help.
|
|
23
|
+
* </>
|
|
20
24
|
*/
|
|
21
25
|
description?: React.ReactNode;
|
|
22
26
|
/**
|
|
@@ -24,13 +28,13 @@ type NonIdealStateProps = {
|
|
|
24
28
|
* Typically should be a primary and secondary button.
|
|
25
29
|
*
|
|
26
30
|
* @example
|
|
27
|
-
* <
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* <NonIdealState
|
|
32
|
+
* actions={
|
|
33
|
+
* <>
|
|
34
|
+
* <Button styleType={'high-visibility'}>Retry</Button>
|
|
35
|
+
* <Button>Contact us</Button>
|
|
36
|
+
* </>
|
|
37
|
+
* }
|
|
34
38
|
* />
|
|
35
39
|
*/
|
|
36
40
|
actions?: React.ReactNode;
|
|
@@ -53,7 +57,7 @@ type NonIdealStateProps = {
|
|
|
53
57
|
};
|
|
54
58
|
/**
|
|
55
59
|
* A stylized display to communicate common http errors and other non-ideal states.
|
|
56
|
-
* Works well with svgs from
|
|
60
|
+
* Works well with svgs from `@itwin/itwinui-illustrations-react`.
|
|
57
61
|
*
|
|
58
62
|
* @example
|
|
59
63
|
* <NonIdealState svg={<Svg404 />} heading='Not found' />
|