@itwin/itwinui-react 3.15.4 → 3.16.0

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +2 -2
  3. package/DEV-cjs/core/Checkbox/Checkbox.js +4 -6
  4. package/DEV-cjs/core/ComboBox/ComboBox.js +10 -6
  5. package/DEV-cjs/core/DatePicker/DatePicker.js +9 -1
  6. package/DEV-cjs/core/Dialog/Dialog.js +1 -1
  7. package/DEV-cjs/core/Panels/Panels.js +319 -0
  8. package/DEV-cjs/core/Panels/helpers.js +62 -0
  9. package/DEV-cjs/core/Radio/Radio.js +4 -6
  10. package/DEV-cjs/core/RadioTiles/RadioTileGroup.js +9 -2
  11. package/DEV-cjs/core/Select/SelectTag.js +9 -11
  12. package/DEV-cjs/core/Select/SelectTagContainer.js +2 -2
  13. package/DEV-cjs/core/Stepper/Stepper.js +1 -0
  14. package/DEV-cjs/core/Stepper/StepperStep.js +2 -1
  15. package/DEV-cjs/core/Table/Table.js +64 -47
  16. package/DEV-cjs/core/Table/TablePaginator.js +15 -3
  17. package/DEV-cjs/core/Table/actionHandlers/selectHandler.js +10 -7
  18. package/DEV-cjs/core/Table/columns/selectionColumn.js +6 -1
  19. package/DEV-cjs/core/Tree/Tree.js +1 -0
  20. package/DEV-cjs/index.js +4 -0
  21. package/DEV-cjs/styles.js +1 -1
  22. package/DEV-cjs/utils/components/MiddleTextTruncation.js +22 -4
  23. package/DEV-cjs/utils/components/OverflowContainer.js +170 -27
  24. package/DEV-cjs/utils/hooks/index.js +1 -1
  25. package/DEV-cjs/utils/hooks/useInstance.js +38 -0
  26. package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
  27. package/DEV-esm/core/Checkbox/Checkbox.js +5 -10
  28. package/DEV-esm/core/ComboBox/ComboBox.js +10 -6
  29. package/DEV-esm/core/DatePicker/DatePicker.js +11 -1
  30. package/DEV-esm/core/Dialog/Dialog.js +1 -1
  31. package/DEV-esm/core/Panels/Panels.js +301 -0
  32. package/DEV-esm/core/Panels/helpers.js +42 -0
  33. package/DEV-esm/core/Radio/Radio.js +4 -9
  34. package/DEV-esm/core/RadioTiles/RadioTileGroup.js +8 -2
  35. package/DEV-esm/core/Select/SelectTag.js +9 -11
  36. package/DEV-esm/core/Select/SelectTagContainer.js +2 -2
  37. package/DEV-esm/core/Stepper/Stepper.js +1 -0
  38. package/DEV-esm/core/Stepper/StepperStep.js +2 -1
  39. package/DEV-esm/core/Table/Table.js +61 -47
  40. package/DEV-esm/core/Table/TablePaginator.js +16 -3
  41. package/DEV-esm/core/Table/actionHandlers/selectHandler.js +10 -7
  42. package/DEV-esm/core/Table/columns/selectionColumn.js +6 -1
  43. package/DEV-esm/core/Tree/Tree.js +1 -0
  44. package/DEV-esm/index.js +1 -0
  45. package/DEV-esm/styles.js +1 -1
  46. package/DEV-esm/utils/components/MiddleTextTruncation.js +22 -4
  47. package/DEV-esm/utils/components/OverflowContainer.js +143 -4
  48. package/DEV-esm/utils/hooks/index.js +1 -1
  49. package/DEV-esm/utils/hooks/useInstance.js +18 -0
  50. package/cjs/core/Breadcrumbs/Breadcrumbs.js +2 -2
  51. package/cjs/core/Checkbox/Checkbox.js +4 -6
  52. package/cjs/core/ComboBox/ComboBox.d.ts +13 -0
  53. package/cjs/core/ComboBox/ComboBox.js +10 -6
  54. package/cjs/core/DatePicker/DatePicker.d.ts +2 -2
  55. package/cjs/core/DatePicker/DatePicker.js +2 -1
  56. package/cjs/core/Dialog/Dialog.js +1 -1
  57. package/cjs/core/Dialog/DialogContext.d.ts +6 -2
  58. package/cjs/core/NonIdealState/NonIdealState.d.ts +15 -11
  59. package/cjs/core/Panels/Panels.d.ts +174 -0
  60. package/cjs/core/Panels/Panels.js +312 -0
  61. package/cjs/core/Panels/helpers.d.ts +23 -0
  62. package/cjs/core/Panels/helpers.js +61 -0
  63. package/cjs/core/Radio/Radio.js +4 -6
  64. package/cjs/core/RadioTiles/RadioTileGroup.d.ts +3 -1
  65. package/cjs/core/RadioTiles/RadioTileGroup.js +9 -2
  66. package/cjs/core/Select/SelectTag.d.ts +3 -1
  67. package/cjs/core/Select/SelectTag.js +9 -11
  68. package/cjs/core/Select/SelectTagContainer.js +2 -2
  69. package/cjs/core/Stepper/Stepper.d.ts +4 -0
  70. package/cjs/core/Stepper/Stepper.js +1 -0
  71. package/cjs/core/Stepper/StepperStep.d.ts +4 -0
  72. package/cjs/core/Stepper/StepperStep.js +2 -1
  73. package/cjs/core/Table/Table.d.ts +1 -0
  74. package/cjs/core/Table/Table.js +64 -47
  75. package/cjs/core/Table/TablePaginator.js +15 -3
  76. package/cjs/core/Table/actionHandlers/selectHandler.js +10 -7
  77. package/cjs/core/Table/columns/selectionColumn.js +6 -1
  78. package/cjs/core/Tree/Tree.js +1 -0
  79. package/cjs/index.d.ts +1 -0
  80. package/cjs/index.js +4 -0
  81. package/cjs/styles.js +1 -1
  82. package/cjs/utils/components/MiddleTextTruncation.d.ts +5 -7
  83. package/cjs/utils/components/MiddleTextTruncation.js +22 -4
  84. package/cjs/utils/components/OverflowContainer.d.ts +1 -0
  85. package/cjs/utils/components/OverflowContainer.js +170 -27
  86. package/cjs/utils/hooks/index.d.ts +1 -1
  87. package/cjs/utils/hooks/index.js +1 -1
  88. package/cjs/utils/hooks/useInstance.d.ts +22 -0
  89. package/cjs/utils/hooks/useInstance.js +38 -0
  90. package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
  91. package/esm/core/Checkbox/Checkbox.js +5 -10
  92. package/esm/core/ComboBox/ComboBox.d.ts +13 -0
  93. package/esm/core/ComboBox/ComboBox.js +10 -6
  94. package/esm/core/DatePicker/DatePicker.d.ts +2 -2
  95. package/esm/core/DatePicker/DatePicker.js +4 -1
  96. package/esm/core/Dialog/Dialog.js +1 -1
  97. package/esm/core/Dialog/DialogContext.d.ts +6 -2
  98. package/esm/core/NonIdealState/NonIdealState.d.ts +15 -11
  99. package/esm/core/Panels/Panels.d.ts +174 -0
  100. package/esm/core/Panels/Panels.js +294 -0
  101. package/esm/core/Panels/helpers.d.ts +23 -0
  102. package/esm/core/Panels/helpers.js +41 -0
  103. package/esm/core/Radio/Radio.js +4 -9
  104. package/esm/core/RadioTiles/RadioTileGroup.d.ts +3 -1
  105. package/esm/core/RadioTiles/RadioTileGroup.js +8 -2
  106. package/esm/core/Select/SelectTag.d.ts +3 -1
  107. package/esm/core/Select/SelectTag.js +9 -11
  108. package/esm/core/Select/SelectTagContainer.js +2 -2
  109. package/esm/core/Stepper/Stepper.d.ts +4 -0
  110. package/esm/core/Stepper/Stepper.js +1 -0
  111. package/esm/core/Stepper/StepperStep.d.ts +4 -0
  112. package/esm/core/Stepper/StepperStep.js +2 -1
  113. package/esm/core/Table/Table.d.ts +1 -0
  114. package/esm/core/Table/Table.js +61 -47
  115. package/esm/core/Table/TablePaginator.js +16 -3
  116. package/esm/core/Table/actionHandlers/selectHandler.js +10 -7
  117. package/esm/core/Table/columns/selectionColumn.js +6 -1
  118. package/esm/core/Tree/Tree.js +1 -0
  119. package/esm/index.d.ts +1 -0
  120. package/esm/index.js +1 -0
  121. package/esm/styles.js +1 -1
  122. package/esm/utils/components/MiddleTextTruncation.d.ts +5 -7
  123. package/esm/utils/components/MiddleTextTruncation.js +22 -4
  124. package/esm/utils/components/OverflowContainer.d.ts +1 -0
  125. package/esm/utils/components/OverflowContainer.js +143 -4
  126. package/esm/utils/hooks/index.d.ts +1 -1
  127. package/esm/utils/hooks/index.js +1 -1
  128. package/esm/utils/hooks/useInstance.d.ts +22 -0
  129. package/esm/utils/hooks/useInstance.js +18 -0
  130. package/package.json +2 -2
  131. package/styles.css +8 -8
  132. package/DEV-cjs/utils/hooks/useOverflow.js +0 -76
  133. package/DEV-esm/utils/hooks/useOverflow.js +0 -63
  134. package/cjs/utils/hooks/useOverflow.d.ts +0 -23
  135. package/cjs/utils/hooks/useOverflow.js +0 -76
  136. package/esm/utils/hooks/useOverflow.d.ts +0 -23
  137. package/esm/utils/hooks/useOverflow.js +0 -63
@@ -28,7 +28,7 @@ const Radio = _react.forwardRef((props, ref) => {
28
28
  let refs = (0, _index.useMergedRefs)(inputElementRef, ref);
29
29
  let radio = _react.createElement(_index.Box, {
30
30
  as: 'input',
31
- className: (0, _classnames.default)('iui-radio', className),
31
+ className: (0, _classnames.default)('iui-checkbox', 'iui-radio', className),
32
32
  style: style,
33
33
  disabled: disabled,
34
34
  type: 'radio',
@@ -42,13 +42,11 @@ const Radio = _react.forwardRef((props, ref) => {
42
42
  as: 'label',
43
43
  ...wrapperProps,
44
44
  className: (0, _classnames.default)(
45
- 'iui-radio-wrapper',
46
- {
47
- 'iui-disabled': disabled,
48
- [`iui-${status}`]: !!status,
49
- },
45
+ 'iui-checkbox-wrapper',
50
46
  wrapperProps?.className,
51
47
  ),
48
+ 'data-iui-status': status,
49
+ 'data-iui-disabled': disabled ? 'true' : void 0,
52
50
  },
53
51
  radio,
54
52
  label &&
@@ -1,7 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { InputGroup } from '../InputGroup/InputGroup.js';
3
3
  import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
4
- type RadioTileGroupProps = Omit<React.ComponentProps<typeof InputGroup>, 'displayStyle' | 'disabled'>;
4
+ type RadioTileGroupProps = {
5
+ tileContainerProps?: React.ComponentProps<'div'>;
6
+ } & Omit<React.ComponentProps<typeof InputGroup>, 'displayStyle' | 'disabled'>;
5
7
  /**
6
8
  * RadioTileGroup component to group RadioTile components together
7
9
  * @example
@@ -8,12 +8,14 @@ Object.defineProperty(exports, 'RadioTileGroup', {
8
8
  return RadioTileGroup;
9
9
  },
10
10
  });
11
+ const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
11
12
  const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
12
13
  const _react = _interop_require_wildcard._(require('react'));
13
14
  const _InputGroup = require('../InputGroup/InputGroup.js');
14
15
  const _index = require('../../utils/index.js');
16
+ const _classnames = _interop_require_default._(require('classnames'));
15
17
  const RadioTileGroup = _react.forwardRef((props, forwardedRef) => {
16
- let { children, label, ...rest } = props;
18
+ let { children, label, tileContainerProps, ...rest } = props;
17
19
  return _react.createElement(
18
20
  _InputGroup.InputGroup,
19
21
  {
@@ -24,7 +26,12 @@ const RadioTileGroup = _react.forwardRef((props, forwardedRef) => {
24
26
  _react.createElement(
25
27
  _index.Box,
26
28
  {
27
- className: 'iui-radio-tile-container',
29
+ as: 'div',
30
+ ...tileContainerProps,
31
+ className: (0, _classnames.default)(
32
+ 'iui-radio-tile-container',
33
+ tileContainerProps?.className,
34
+ ),
28
35
  },
29
36
  children,
30
37
  ),
@@ -1,10 +1,12 @@
1
+ import * as React from 'react';
2
+ import { Tag } from '../Tag/Tag.js';
1
3
  import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
2
4
  type SelectTagProps = {
3
5
  /**
4
6
  * Text inside the tag.
5
7
  */
6
8
  label: string;
7
- };
9
+ } & Pick<React.ComponentProps<typeof Tag>, 'onClick' | 'onRemove'>;
8
10
  /**
9
11
  * Tag for showing selected value in `Select`.
10
12
  * @private
@@ -12,24 +12,22 @@ const _interop_require_default = require('@swc/helpers/_/_interop_require_defaul
12
12
  const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
13
13
  const _classnames = _interop_require_default._(require('classnames'));
14
14
  const _react = _interop_require_wildcard._(require('react'));
15
- const _index = require('../../utils/index.js');
15
+ const _Tag = require('../Tag/Tag.js');
16
16
  const SelectTag = _react.forwardRef((props, forwardedRef) => {
17
17
  let { className, label, ...rest } = props;
18
18
  return _react.createElement(
19
- _index.Box,
19
+ _Tag.Tag,
20
20
  {
21
- as: 'span',
22
21
  className: (0, _classnames.default)('iui-select-tag', className),
22
+ labelProps: {
23
+ className: 'iui-select-tag-label',
24
+ },
25
+ removeButtonProps: {
26
+ className: 'iui-select-tag-button',
27
+ },
23
28
  ref: forwardedRef,
24
29
  ...rest,
25
30
  },
26
- _react.createElement(
27
- _index.Box,
28
- {
29
- as: 'span',
30
- className: 'iui-select-tag-label',
31
- },
32
- label,
33
- ),
31
+ label,
34
32
  );
35
33
  });
@@ -14,7 +14,7 @@ const _react = _interop_require_wildcard._(require('react'));
14
14
  const _classnames = _interop_require_default._(require('classnames'));
15
15
  const _SelectTag = require('./SelectTag.js');
16
16
  const _index = require('../../utils/index.js');
17
- const SelectTagContainer = _react.forwardRef((props, ref) => {
17
+ const SelectTagContainer = _react.forwardRef((props, forwardedRef) => {
18
18
  let { tags: tagsProp, className, ...rest } = props;
19
19
  let tags = _react.useMemo(
20
20
  () => _react.Children.toArray(tagsProp),
@@ -28,7 +28,7 @@ const SelectTagContainer = _react.forwardRef((props, ref) => {
28
28
  'iui-select-tag-container',
29
29
  className,
30
30
  ),
31
- ref: ref,
31
+ ref: forwardedRef,
32
32
  ...rest,
33
33
  },
34
34
  _react.createElement(SelectTagContainerContent, {
@@ -12,6 +12,10 @@ export type StepProperties = {
12
12
  * A tooltip giving detailed description to this step.
13
13
  */
14
14
  description?: string;
15
+ /**
16
+ * Custom content displayed in the step's circle.
17
+ */
18
+ stepContent?: () => React.ReactNode;
15
19
  } & React.ComponentProps<'li'>;
16
20
  export type StepperProps = {
17
21
  /**
@@ -65,6 +65,7 @@ const Stepper = _react.forwardRef((props, ref) => {
65
65
  type: type,
66
66
  onClick: onStepClick,
67
67
  description: s.description,
68
+ stepContent: s.stepContent,
68
69
  });
69
70
  }),
70
71
  ),
@@ -29,6 +29,10 @@ export type StepperStepProps = {
29
29
  * A tooltip giving detailed description to this step.
30
30
  */
31
31
  description?: string;
32
+ /**
33
+ * Custom content displayed in the step's circle.
34
+ */
35
+ stepContent?: () => React.ReactNode;
32
36
  /**
33
37
  * Allows props to be passed for stepper step.
34
38
  */
@@ -29,6 +29,7 @@ const StepperStep = _react.forwardRef((props, forwardedRef) => {
29
29
  trackContentProps,
30
30
  circleProps,
31
31
  nameProps,
32
+ stepContent,
32
33
  ...rest
33
34
  } = props;
34
35
  let isPast = currentStepNumber > index;
@@ -89,7 +90,7 @@ const StepperStep = _react.forwardRef((props, forwardedRef) => {
89
90
  circleProps?.className,
90
91
  ),
91
92
  },
92
- index + 1,
93
+ stepContent ? stepContent() : index + 1,
93
94
  ),
94
95
  ),
95
96
  'default' === type &&
@@ -3,6 +3,7 @@ import type { CellProps, TableOptions, Row, TableState } from '../../react-table
3
3
  import type { CommonProps } from '../../utils/index.js';
4
4
  import type { TableFilterValue } from './filters/index.js';
5
5
  export declare const tableResizeStartAction = "tableResizeStart";
6
+ export declare const iuiId: unique symbol;
6
7
  export type TablePaginatorRendererProps = {
7
8
  /**
8
9
  * The zero-based index of the current page.
@@ -13,6 +13,9 @@ _export(exports, {
13
13
  Table: function () {
14
14
  return Table;
15
15
  },
16
+ iuiId: function () {
17
+ return iuiId;
18
+ },
16
19
  tableResizeStartAction: function () {
17
20
  return tableResizeStartAction;
18
21
  },
@@ -36,6 +39,7 @@ const singleRowSelectedAction = 'singleRowSelected';
36
39
  const shiftRowSelectedAction = 'shiftRowSelected';
37
40
  const tableResizeStartAction = 'tableResizeStart';
38
41
  const tableResizeEndAction = 'tableResizeEnd';
42
+ const iuiId = Symbol('iui-id');
39
43
  const flattenColumns = (columns) => {
40
44
  let flatColumns = [];
41
45
  columns.forEach((column) => {
@@ -88,6 +92,7 @@ const Table = (props) => {
88
92
  headerProps,
89
93
  bodyProps,
90
94
  emptyTableContentProps,
95
+ getRowId,
91
96
  ...rest
92
97
  } = props;
93
98
  (0, _index.useGlobals)();
@@ -225,16 +230,30 @@ const Table = (props) => {
225
230
  ),
226
231
  [data, getSubRows],
227
232
  );
228
- let [rowHasParent] = _react.useState(() => new WeakSet());
229
233
  let getSubRowsWithSubComponents = _react.useCallback(
230
- (originalRow) => {
231
- if (!rowHasParent.has(originalRow)) {
232
- rowHasParent.add(originalRow);
233
- return [originalRow];
234
- }
235
- return originalRow.subRows || [];
234
+ (originalRow, relativeIndex) => {
235
+ if (originalRow[iuiId]) return [];
236
+ if (originalRow.subRows) return originalRow.subRows;
237
+ return [
238
+ {
239
+ [iuiId]: `subcomponent-${relativeIndex}`,
240
+ ...originalRow,
241
+ },
242
+ ];
236
243
  },
237
- [rowHasParent],
244
+ [],
245
+ );
246
+ let getRowIdWithSubComponents = _react.useCallback(
247
+ (originalRow, relativeIndex, parent) => {
248
+ let defaultRowId = parent
249
+ ? `${parent.id}.${relativeIndex}`
250
+ : `${relativeIndex}`;
251
+ let rowIdFromUser = getRowId?.(originalRow, relativeIndex, parent);
252
+ if (void 0 !== rowIdFromUser && originalRow[iuiId])
253
+ return `${rowIdFromUser}-${defaultRowId}`;
254
+ return rowIdFromUser ?? defaultRowId;
255
+ },
256
+ [getRowId],
238
257
  );
239
258
  let instance = (0, _reacttable.useTable)(
240
259
  {
@@ -254,6 +273,7 @@ const Table = (props) => {
254
273
  ...props.initialState,
255
274
  },
256
275
  columnResizeMode,
276
+ getRowId: subComponent ? getRowIdWithSubComponents : getRowId,
257
277
  },
258
278
  _reacttable.useFlexLayout,
259
279
  (0, _index1.useResizeColumns)(ownerDocument),
@@ -451,51 +471,52 @@ const Table = (props) => {
451
471
  (index, virtualItem, virtualizer) => {
452
472
  let row = page[index];
453
473
  prepareRow(row);
454
- if (row.subRows.length > 0 || !subComponent)
455
- return _react.createElement(_TableRowMemoized.TableRowMemoized, {
456
- row: row,
457
- rowProps: rowProps,
458
- isLast: index === page.length - 1,
459
- onRowInViewport: onRowInViewportRef,
460
- onBottomReached: onBottomReachedRef,
461
- intersectionMargin: intersectionMargin,
462
- state: state,
463
- key: row.getRowProps().key,
464
- onClick: onRowClickHandler,
465
- subComponent: subComponent,
466
- isDisabled: !!isRowDisabled?.(row.original),
467
- tableHasSubRows: hasAnySubRows,
468
- tableInstance: instance,
469
- expanderCell: expanderCell,
470
- scrollContainerRef: tableRef.current,
471
- tableRowRef: enableVirtualization ? void 0 : tableRowRef(row),
472
- density: density,
473
- virtualItem: virtualItem,
474
- virtualizer: virtualizer,
475
- });
476
- return _react.createElement(
477
- _TableExpandableContentMemoized.TableExpandableContentMemoized,
478
- {
479
- key: row.getRowProps().key,
480
- virtualItem: virtualItem,
481
- ref: enableVirtualization
482
- ? virtualizer?.measureElement
483
- : tableRowRef(row),
484
- isDisabled: !!isRowDisabled?.(row.original),
485
- },
486
- subComponent(row),
487
- );
474
+ let isRowASubComponent = !!row.original[iuiId] && !!subComponent;
475
+ if (isRowASubComponent)
476
+ return _react.createElement(
477
+ _TableExpandableContentMemoized.TableExpandableContentMemoized,
478
+ {
479
+ key: row.getRowProps().key,
480
+ virtualItem: virtualItem,
481
+ ref: enableVirtualization
482
+ ? virtualizer?.measureElement
483
+ : tableRowRef(row),
484
+ isDisabled: !!isRowDisabled?.(row.original),
485
+ },
486
+ subComponent(row),
487
+ );
488
+ return _react.createElement(_TableRowMemoized.TableRowMemoized, {
489
+ row: row,
490
+ rowProps: rowProps,
491
+ isLast: index === page.length - 1,
492
+ onRowInViewport: onRowInViewportRef,
493
+ onBottomReached: onBottomReachedRef,
494
+ intersectionMargin: intersectionMargin,
495
+ state: state,
496
+ key: row.getRowProps().key,
497
+ onClick: onRowClickHandler,
498
+ subComponent: subComponent,
499
+ isDisabled: !!isRowDisabled?.(row.original),
500
+ tableHasSubRows: hasAnySubRows,
501
+ tableInstance: instance,
502
+ expanderCell: expanderCell,
503
+ scrollContainerRef: tableRef.current,
504
+ tableRowRef: enableVirtualization ? void 0 : tableRowRef(row),
505
+ density: density,
506
+ virtualItem: virtualItem,
507
+ virtualizer: virtualizer,
508
+ });
488
509
  },
489
510
  [
490
511
  page,
491
512
  prepareRow,
513
+ subComponent,
492
514
  rowProps,
493
515
  onRowInViewportRef,
494
516
  onBottomReachedRef,
495
517
  intersectionMargin,
496
518
  state,
497
519
  onRowClickHandler,
498
- subComponent,
499
520
  isRowDisabled,
500
521
  hasAnySubRows,
501
522
  instance,
@@ -632,11 +653,7 @@ const Table = (props) => {
632
653
  },
633
654
  bodyProps?.className,
634
655
  ),
635
- style: {
636
- outline: 0,
637
- },
638
656
  }),
639
- tabIndex: -1,
640
657
  'aria-multiselectable':
641
658
  (isSelectable && 'multi' === selectionMode) || void 0,
642
659
  },
@@ -60,7 +60,7 @@ const TablePaginator = (props) => {
60
60
  );
61
61
  let pageListRef = _react.useRef(null);
62
62
  let [focusedIndex, setFocusedIndex] = _react.useState(currentPage);
63
- _react.useLayoutEffect(() => {
63
+ (0, _index.useLayoutEffect)(() => {
64
64
  setFocusedIndex(currentPage);
65
65
  }, [currentPage]);
66
66
  let needFocus = _react.useRef(false);
@@ -182,6 +182,7 @@ const TablePaginator = (props) => {
182
182
  : _react.createElement(TablePaginatorPageButtons, {
183
183
  size: size,
184
184
  focusedIndex: focusedIndex,
185
+ setFocusedIndex: setFocusedIndex,
185
186
  totalPagesCount: totalPagesCount,
186
187
  onPageChange: onPageChange,
187
188
  currentPage: currentPage,
@@ -255,6 +256,7 @@ const TablePaginator = (props) => {
255
256
  const TablePaginatorPageButtons = (props) => {
256
257
  let {
257
258
  focusedIndex,
259
+ setFocusedIndex,
258
260
  totalPagesCount,
259
261
  onPageChange,
260
262
  currentPage,
@@ -274,14 +276,24 @@ const TablePaginatorPageButtons = (props) => {
274
276
  styleType: 'borderless',
275
277
  size: buttonSize,
276
278
  'data-iui-active': index === currentPage,
277
- onClick: () => onPageChange(index),
279
+ onClick: () => {
280
+ setFocusedIndex(index);
281
+ onPageChange(index);
282
+ },
278
283
  'aria-current': index === currentPage,
279
284
  'aria-label': localization.goToPageLabel?.(index + 1),
280
285
  tabIndex: tabIndex,
281
286
  },
282
287
  index + 1,
283
288
  ),
284
- [focusedIndex, currentPage, localization, buttonSize, onPageChange],
289
+ [
290
+ focusedIndex,
291
+ buttonSize,
292
+ currentPage,
293
+ localization,
294
+ setFocusedIndex,
295
+ onPageChange,
296
+ ],
285
297
  );
286
298
  let pageList = _react.useMemo(
287
299
  () =>
@@ -20,6 +20,7 @@ _export(exports, {
20
20
  return onToggleHandler;
21
21
  },
22
22
  });
23
+ const _Table = require('../Table.js');
23
24
  const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
24
25
  if (!instance?.rows.length) {
25
26
  onSelect?.([], newState);
@@ -29,14 +30,16 @@ const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
29
30
  let handleRow = (row) => {
30
31
  if (isRowDisabled?.(row.original)) return false;
31
32
  let isAllSubSelected = true;
32
- row.initialSubRows.forEach((subRow) => {
33
- let result = handleRow(subRow);
34
- if (!result) isAllSubSelected = false;
35
- });
33
+ if (row.initialSubRows[0]?.original[_Table.iuiId] === void 0)
34
+ row.initialSubRows.forEach((subRow) => {
35
+ let result = handleRow(subRow);
36
+ if (!result) isAllSubSelected = false;
37
+ });
36
38
  if (
37
- (!instance.selectSubRows && newState.selectedRowIds[row.id]) ||
38
- (!row.initialSubRows.length && newState.selectedRowIds[row.id]) ||
39
- (row.initialSubRows.length && isAllSubSelected)
39
+ newState.selectedRowIds[row.id] &&
40
+ (!instance.selectSubRows ||
41
+ !row.initialSubRows.length ||
42
+ isAllSubSelected)
40
43
  )
41
44
  newSelectedRowIds[row.id] = true;
42
45
  return !!newSelectedRowIds[row.id];
@@ -21,6 +21,7 @@ const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildc
21
21
  const _react = _interop_require_wildcard._(require('react'));
22
22
  const _Checkbox = require('../../Checkbox/Checkbox.js');
23
23
  const _index = require('../cells/index.js');
24
+ const _Table = require('../Table.js');
24
25
  const SELECTION_CELL_ID = 'iui-table-checkbox-selector';
25
26
  const SelectionColumn = (props = {}) => {
26
27
  let { isDisabled, density } = props;
@@ -70,7 +71,11 @@ const SelectionColumn = (props = {}) => {
70
71
  disabled: isDisabled?.(row.original),
71
72
  onClick: (e) => e.stopPropagation(),
72
73
  onChange: () => {
73
- if (row.subRows.length > 0 && selectSubRows)
74
+ if (
75
+ row.subRows.length > 0 &&
76
+ selectSubRows &&
77
+ void 0 === row.initialSubRows[0].original[_Table.iuiId]
78
+ )
74
79
  row.toggleRowSelected(
75
80
  !row.subRows.every(
76
81
  (subRow) => subRow.isSelected || isDisabled?.(subRow.original),
@@ -170,6 +170,7 @@ const Tree = (props) => {
170
170
  onKeyDown: handleKeyDown,
171
171
  ref: treeRef,
172
172
  className: className,
173
+ 'data-iui-size': 'small' === size ? 'small' : void 0,
173
174
  style: style,
174
175
  ...rest,
175
176
  })
package/cjs/index.d.ts CHANGED
@@ -62,6 +62,7 @@ export { ModalContent } from './core/Modal/ModalContent.js';
62
62
  export { ModalButtonBar } from './core/Modal/ModalButtonBar.js';
63
63
  export { NotificationMarker } from './core/NotificationMarker/NotificationMarker.js';
64
64
  export { Overlay } from './core/Overlay/Overlay.js';
65
+ export { Panels as unstable_Panels } from './core/Panels/Panels.js';
65
66
  export { ProgressLinear } from './core/ProgressIndicators/ProgressLinear.js';
66
67
  export { ProgressRadial } from './core/ProgressIndicators/ProgressRadial.js';
67
68
  export { Radio } from './core/Radio/Radio.js';
package/cjs/index.js CHANGED
@@ -371,6 +371,9 @@ _export(exports, {
371
371
  tableFilters: function () {
372
372
  return _index.tableFilters;
373
373
  },
374
+ unstable_Panels: function () {
375
+ return _Panels.Panels;
376
+ },
374
377
  useToaster: function () {
375
378
  return _Toaster.useToaster;
376
379
  },
@@ -437,6 +440,7 @@ const _ModalContent = require('./core/Modal/ModalContent.js');
437
440
  const _ModalButtonBar = require('./core/Modal/ModalButtonBar.js');
438
441
  const _NotificationMarker = require('./core/NotificationMarker/NotificationMarker.js');
439
442
  const _Overlay = require('./core/Overlay/Overlay.js');
443
+ const _Panels = require('./core/Panels/Panels.js');
440
444
  const _ProgressLinear = require('./core/ProgressIndicators/ProgressLinear.js');
441
445
  const _ProgressRadial = require('./core/ProgressIndicators/ProgressRadial.js');
442
446
  const _Radio = require('./core/Radio/Radio.js');
package/cjs/styles.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const e = '3.15.4';
3
+ const e = '3.16.0';
4
4
  const u = new Proxy(
5
5
  {},
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { CommonProps } from '../props.js';
3
- export type MiddleTextTruncationProps = {
2
+ import type { PolymorphicForwardRefComponent } from '../props.js';
3
+ type MiddleTextTruncationProps = {
4
4
  /**
5
5
  * Text to truncate.
6
6
  */
@@ -14,7 +14,7 @@ export type MiddleTextTruncationProps = {
14
14
  * Custom renderer for the truncated text.
15
15
  */
16
16
  textRenderer?: (truncatedText: string, originalText: string) => React.ReactNode;
17
- } & CommonProps;
17
+ };
18
18
  /**
19
19
  * Truncates text with the ellipsis in the middle,
20
20
  * leaving defined number of chars at the end.
@@ -31,7 +31,5 @@ export type MiddleTextTruncationProps = {
31
31
  * )}
32
32
  * />
33
33
  */
34
- export declare const MiddleTextTruncation: {
35
- (props: MiddleTextTruncationProps): React.JSX.Element;
36
- displayName: string;
37
- };
34
+ export declare const MiddleTextTruncation: PolymorphicForwardRefComponent<"span", MiddleTextTruncationProps>;
35
+ export {};
@@ -11,9 +11,11 @@ Object.defineProperty(exports, 'MiddleTextTruncation', {
11
11
  const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
12
12
  const _react = _interop_require_wildcard._(require('react'));
13
13
  const _OverflowContainer = require('./OverflowContainer.js');
14
+ const _VisuallyHidden = require('../../core/VisuallyHidden/VisuallyHidden.js');
15
+ const _ShadowRoot = require('./ShadowRoot.js');
14
16
  const ELLIPSIS_CHAR = '…';
15
- const MiddleTextTruncation = (props) => {
16
- let { text, style, ...rest } = props;
17
+ const MiddleTextTruncation = _react.forwardRef((props, forwardedRef) => {
18
+ let { text, endCharsCount, textRenderer, style, ...rest } = props;
17
19
  return _react.createElement(
18
20
  _OverflowContainer.OverflowContainer,
19
21
  {
@@ -27,10 +29,26 @@ const MiddleTextTruncation = (props) => {
27
29
  },
28
30
  itemsCount: text.length,
29
31
  ...rest,
32
+ ref: forwardedRef,
30
33
  },
31
- _react.createElement(MiddleTextTruncationContent, props),
34
+ _react.createElement(
35
+ _ShadowRoot.ShadowRoot,
36
+ null,
37
+ _react.createElement(_VisuallyHidden.VisuallyHidden, null, text),
38
+ _react.createElement('slot', {
39
+ 'aria-hidden': true,
40
+ style: {
41
+ pointerEvents: 'none',
42
+ },
43
+ }),
44
+ ),
45
+ _react.createElement(MiddleTextTruncationContent, {
46
+ text: text,
47
+ endCharsCount: endCharsCount,
48
+ textRenderer: textRenderer,
49
+ }),
32
50
  );
33
- };
51
+ });
34
52
  const MiddleTextTruncationContent = (props) => {
35
53
  let { text, endCharsCount = 6, textRenderer } = props;
36
54
  let { visibleCount } = _OverflowContainer.OverflowContainer.useContext();
@@ -15,6 +15,7 @@ type OverflowContainerOverflowNodeProps = {
15
15
  children: React.ReactNode;
16
16
  };
17
17
  /**
18
+ * @private
18
19
  * Wrapper over `useOverflow`.
19
20
  *
20
21
  * - Use `OverflowContainer.useContext()` to get overflow related properties.