@itwin/itwinui-react 1.34.2 → 1.37.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 (158) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/cjs/core/ButtonGroup/ButtonGroup.js +1 -0
  3. package/cjs/core/Carousel/Carousel.d.ts +68 -0
  4. package/cjs/core/Carousel/Carousel.js +130 -0
  5. package/cjs/core/Carousel/CarouselContext.d.ts +37 -0
  6. package/cjs/core/Carousel/CarouselContext.js +12 -0
  7. package/cjs/core/Carousel/CarouselDot.d.ts +13 -0
  8. package/cjs/core/Carousel/CarouselDot.js +46 -0
  9. package/cjs/core/Carousel/CarouselDotsList.d.ts +32 -0
  10. package/cjs/core/Carousel/CarouselDotsList.js +132 -0
  11. package/cjs/core/Carousel/CarouselNavigation.d.ts +15 -0
  12. package/cjs/core/Carousel/CarouselNavigation.js +88 -0
  13. package/cjs/core/Carousel/CarouselSlide.d.ts +14 -0
  14. package/cjs/core/Carousel/CarouselSlide.js +63 -0
  15. package/cjs/core/Carousel/CarouselSlider.d.ts +5 -0
  16. package/cjs/core/Carousel/CarouselSlider.js +94 -0
  17. package/cjs/core/Carousel/index.d.ts +4 -0
  18. package/cjs/core/Carousel/index.js +10 -0
  19. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  20. package/cjs/core/DatePicker/DatePicker.d.ts +5 -0
  21. package/cjs/core/DatePicker/DatePicker.js +38 -13
  22. package/cjs/core/Header/HeaderButton.js +1 -0
  23. package/cjs/core/Menu/Menu.js +8 -3
  24. package/cjs/core/Modal/Modal.d.ts +5 -0
  25. package/cjs/core/Modal/Modal.js +11 -9
  26. package/cjs/core/Modal/ModalContent.d.ts +14 -0
  27. package/cjs/core/Modal/ModalContent.js +46 -0
  28. package/cjs/core/Modal/index.d.ts +2 -0
  29. package/cjs/core/Modal/index.js +3 -1
  30. package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
  31. package/cjs/core/SkipToContentLink/SkipToContentLink.js +50 -0
  32. package/cjs/core/SkipToContentLink/index.d.ts +4 -0
  33. package/cjs/core/SkipToContentLink/index.js +10 -0
  34. package/cjs/core/Surface/Surface.d.ts +32 -0
  35. package/cjs/core/Surface/Surface.js +70 -0
  36. package/cjs/core/Surface/index.d.ts +4 -0
  37. package/cjs/core/Surface/index.js +10 -0
  38. package/cjs/core/Table/Table.d.ts +7 -0
  39. package/cjs/core/Table/Table.js +51 -27
  40. package/cjs/core/Table/TableCell.js +3 -3
  41. package/cjs/core/Table/TableRowMemoized.js +12 -7
  42. package/cjs/core/Table/actionHandlers/index.d.ts +2 -1
  43. package/cjs/core/Table/actionHandlers/index.js +5 -1
  44. package/cjs/core/Table/cells/DefaultCell.d.ts +1 -1
  45. package/cjs/core/Table/cells/DefaultCell.js +5 -2
  46. package/cjs/core/Table/columns/actionColumn.d.ts +35 -0
  47. package/cjs/core/Table/columns/actionColumn.js +91 -0
  48. package/cjs/core/Table/columns/expanderColumn.d.ts +47 -0
  49. package/cjs/core/Table/columns/expanderColumn.js +81 -0
  50. package/cjs/core/Table/columns/index.d.ts +3 -0
  51. package/cjs/core/Table/columns/index.js +15 -0
  52. package/cjs/core/Table/columns/selectionColumn.d.ts +35 -0
  53. package/cjs/core/Table/columns/selectionColumn.js +67 -0
  54. package/cjs/core/Table/hooks/index.d.ts +2 -2
  55. package/cjs/core/Table/hooks/index.js +1 -3
  56. package/cjs/core/Table/hooks/useExpanderCell.d.ts +0 -1
  57. package/cjs/core/Table/hooks/useExpanderCell.js +25 -39
  58. package/cjs/core/Table/hooks/useResizeColumns.js +8 -2
  59. package/cjs/core/Table/hooks/useSelectionCell.d.ts +1 -2
  60. package/cjs/core/Table/hooks/useSelectionCell.js +8 -53
  61. package/cjs/core/Table/index.d.ts +1 -0
  62. package/cjs/core/Table/index.js +5 -1
  63. package/cjs/core/Table/utils.js +1 -1
  64. package/cjs/core/Tag/Tag.js +6 -3
  65. package/cjs/core/Tile/Tile.d.ts +6 -2
  66. package/cjs/core/Tile/Tile.js +7 -2
  67. package/cjs/core/Toast/Toast.js +1 -1
  68. package/cjs/core/Typography/Anchor/Anchor.d.ts +1 -0
  69. package/cjs/core/Typography/Anchor/Anchor.js +1 -0
  70. package/cjs/core/index.d.ts +9 -3
  71. package/cjs/core/index.js +13 -2
  72. package/cjs/core/utils/components/Popover.js +13 -1
  73. package/cjs/core/utils/hooks/index.d.ts +1 -0
  74. package/cjs/core/utils/hooks/index.js +1 -0
  75. package/cjs/core/utils/hooks/useMediaQuery.d.ts +2 -0
  76. package/cjs/core/utils/hooks/useMediaQuery.js +46 -0
  77. package/cjs/core/utils/hooks/useTheme.d.ts +5 -0
  78. package/cjs/core/utils/hooks/useTheme.js +20 -14
  79. package/cjs/types/react-table-config.d.ts +18 -0
  80. package/esm/core/ButtonGroup/ButtonGroup.js +1 -0
  81. package/esm/core/Carousel/Carousel.d.ts +68 -0
  82. package/esm/core/Carousel/Carousel.js +124 -0
  83. package/esm/core/Carousel/CarouselContext.d.ts +37 -0
  84. package/esm/core/Carousel/CarouselContext.js +6 -0
  85. package/esm/core/Carousel/CarouselDot.d.ts +13 -0
  86. package/esm/core/Carousel/CarouselDot.js +40 -0
  87. package/esm/core/Carousel/CarouselDotsList.d.ts +32 -0
  88. package/esm/core/Carousel/CarouselDotsList.js +126 -0
  89. package/esm/core/Carousel/CarouselNavigation.d.ts +15 -0
  90. package/esm/core/Carousel/CarouselNavigation.js +82 -0
  91. package/esm/core/Carousel/CarouselSlide.d.ts +14 -0
  92. package/esm/core/Carousel/CarouselSlide.js +57 -0
  93. package/esm/core/Carousel/CarouselSlider.d.ts +5 -0
  94. package/esm/core/Carousel/CarouselSlider.js +88 -0
  95. package/esm/core/Carousel/index.d.ts +4 -0
  96. package/esm/core/Carousel/index.js +6 -0
  97. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  98. package/esm/core/DatePicker/DatePicker.d.ts +5 -0
  99. package/esm/core/DatePicker/DatePicker.js +38 -13
  100. package/esm/core/Header/HeaderButton.js +1 -0
  101. package/esm/core/Menu/Menu.js +8 -3
  102. package/esm/core/Modal/Modal.d.ts +5 -0
  103. package/esm/core/Modal/Modal.js +11 -9
  104. package/esm/core/Modal/ModalContent.d.ts +14 -0
  105. package/esm/core/Modal/ModalContent.js +39 -0
  106. package/esm/core/Modal/index.d.ts +2 -0
  107. package/esm/core/Modal/index.js +1 -0
  108. package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
  109. package/esm/core/SkipToContentLink/SkipToContentLink.js +44 -0
  110. package/esm/core/SkipToContentLink/index.d.ts +4 -0
  111. package/esm/core/SkipToContentLink/index.js +6 -0
  112. package/esm/core/Surface/Surface.d.ts +32 -0
  113. package/esm/core/Surface/Surface.js +64 -0
  114. package/esm/core/Surface/index.d.ts +4 -0
  115. package/esm/core/Surface/index.js +6 -0
  116. package/esm/core/Table/Table.d.ts +7 -0
  117. package/esm/core/Table/Table.js +47 -23
  118. package/esm/core/Table/TableCell.js +2 -2
  119. package/esm/core/Table/TableRowMemoized.js +12 -7
  120. package/esm/core/Table/actionHandlers/index.d.ts +2 -1
  121. package/esm/core/Table/actionHandlers/index.js +2 -1
  122. package/esm/core/Table/cells/DefaultCell.d.ts +1 -1
  123. package/esm/core/Table/cells/DefaultCell.js +5 -2
  124. package/esm/core/Table/columns/actionColumn.d.ts +35 -0
  125. package/esm/core/Table/columns/actionColumn.js +84 -0
  126. package/esm/core/Table/columns/expanderColumn.d.ts +47 -0
  127. package/esm/core/Table/columns/expanderColumn.js +74 -0
  128. package/esm/core/Table/columns/index.d.ts +3 -0
  129. package/esm/core/Table/columns/index.js +7 -0
  130. package/esm/core/Table/columns/selectionColumn.d.ts +35 -0
  131. package/esm/core/Table/columns/selectionColumn.js +60 -0
  132. package/esm/core/Table/hooks/index.d.ts +2 -2
  133. package/esm/core/Table/hooks/index.js +2 -2
  134. package/esm/core/Table/hooks/useExpanderCell.d.ts +0 -1
  135. package/esm/core/Table/hooks/useExpanderCell.js +24 -35
  136. package/esm/core/Table/hooks/useResizeColumns.js +8 -2
  137. package/esm/core/Table/hooks/useSelectionCell.d.ts +1 -2
  138. package/esm/core/Table/hooks/useSelectionCell.js +7 -49
  139. package/esm/core/Table/index.d.ts +1 -0
  140. package/esm/core/Table/index.js +1 -0
  141. package/esm/core/Table/utils.js +1 -1
  142. package/esm/core/Tag/Tag.js +6 -3
  143. package/esm/core/Tile/Tile.d.ts +6 -2
  144. package/esm/core/Tile/Tile.js +7 -2
  145. package/esm/core/Toast/Toast.js +1 -1
  146. package/esm/core/Typography/Anchor/Anchor.d.ts +1 -0
  147. package/esm/core/Typography/Anchor/Anchor.js +1 -0
  148. package/esm/core/index.d.ts +9 -3
  149. package/esm/core/index.js +5 -2
  150. package/esm/core/utils/components/Popover.js +13 -1
  151. package/esm/core/utils/hooks/index.d.ts +1 -0
  152. package/esm/core/utils/hooks/index.js +1 -0
  153. package/esm/core/utils/hooks/useMediaQuery.d.ts +2 -0
  154. package/esm/core/utils/hooks/useMediaQuery.js +39 -0
  155. package/esm/core/utils/hooks/useTheme.d.ts +5 -0
  156. package/esm/core/utils/hooks/useTheme.js +20 -14
  157. package/esm/types/react-table-config.d.ts +18 -0
  158. package/package.json +3 -2
@@ -45,6 +45,11 @@ export declare type ModalProps = {
45
45
  * @default document
46
46
  */
47
47
  ownerDocument?: Document;
48
+ /**
49
+ * Type of the modal.
50
+ * @default 'default'
51
+ */
52
+ styleType?: 'default' | 'fullPage';
48
53
  /**
49
54
  * Content of the modal.
50
55
  */
@@ -31,6 +31,7 @@ import SvgClose from '@itwin/itwinui-icons-react/cjs/icons/Close';
31
31
  import { useTheme, getContainer, getDocument, FocusTrap, } from '../utils';
32
32
  import '@itwin/itwinui-css/css/modal.css';
33
33
  import { IconButton } from '../Buttons/IconButton';
34
+ import { CSSTransition } from 'react-transition-group';
34
35
  /**
35
36
  * Modal component which can wrap any content.
36
37
  * @example
@@ -53,7 +54,7 @@ import { IconButton } from '../Buttons/IconButton';
53
54
  * </Modal>
54
55
  */
55
56
  export var Modal = function (props) {
56
- var _a = props.isOpen, isOpen = _a === void 0 ? false : _a, _b = props.isDismissible, isDismissible = _b === void 0 ? true : _b, _c = props.closeOnEsc, closeOnEsc = _c === void 0 ? true : _c, _d = props.closeOnExternalClick, closeOnExternalClick = _d === void 0 ? true : _d, onClose = props.onClose, title = props.title, onKeyDown = props.onKeyDown, id = props.id, className = props.className, style = props.style, children = props.children, _e = props.modalRootId, modalRootId = _e === void 0 ? 'iui-react-portal-container' : _e, _f = props.ownerDocument, ownerDocument = _f === void 0 ? getDocument() : _f, rest = __rest(props, ["isOpen", "isDismissible", "closeOnEsc", "closeOnExternalClick", "onClose", "title", "onKeyDown", "id", "className", "style", "children", "modalRootId", "ownerDocument"]);
57
+ var _a = props.isOpen, isOpen = _a === void 0 ? false : _a, _b = props.isDismissible, isDismissible = _b === void 0 ? true : _b, _c = props.closeOnEsc, closeOnEsc = _c === void 0 ? true : _c, _d = props.closeOnExternalClick, closeOnExternalClick = _d === void 0 ? true : _d, onClose = props.onClose, title = props.title, onKeyDown = props.onKeyDown, id = props.id, className = props.className, style = props.style, children = props.children, _e = props.styleType, styleType = _e === void 0 ? 'default' : _e, _f = props.modalRootId, modalRootId = _f === void 0 ? 'iui-react-portal-container' : _f, _g = props.ownerDocument, ownerDocument = _g === void 0 ? getDocument() : _g, rest = __rest(props, ["isOpen", "isDismissible", "closeOnEsc", "closeOnExternalClick", "onClose", "title", "onKeyDown", "id", "className", "style", "children", "styleType", "modalRootId", "ownerDocument"]);
57
58
  useTheme();
58
59
  var container = getContainer(modalRootId, ownerDocument);
59
60
  var overlayRef = React.useRef(null);
@@ -111,13 +112,14 @@ export var Modal = function (props) {
111
112
  onClose(event);
112
113
  }
113
114
  };
114
- return !!container ? (ReactDOM.createPortal(isOpen && (React.createElement(FocusTrap, null,
115
- React.createElement("div", __assign({ className: cx('iui-modal', 'iui-modal-visible', className), tabIndex: -1, onKeyDown: handleKeyDown, ref: overlayRef, onMouseDown: handleMouseDown }, rest),
116
- React.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true' },
117
- React.createElement("div", { className: 'iui-title-bar' },
118
- React.createElement("div", { className: 'iui-title' }, title),
119
- isDismissible && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
120
- React.createElement(SvgClose, null)))),
121
- children)))), container)) : (React.createElement(React.Fragment, null));
115
+ return !!container ? (ReactDOM.createPortal(React.createElement(CSSTransition, { in: isOpen, classNames: 'iui-modal-animation', timeout: { exit: 600 }, unmountOnExit: true },
116
+ React.createElement(FocusTrap, null,
117
+ React.createElement("div", __assign({ className: cx('iui-modal', { 'iui-modal-full-page': styleType === 'fullPage' }, { 'iui-modal-visible': isOpen }, className), tabIndex: -1, onKeyDown: handleKeyDown, ref: overlayRef, onMouseDown: handleMouseDown }, rest),
118
+ React.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true' },
119
+ React.createElement("div", { className: 'iui-title-bar' },
120
+ React.createElement("div", { className: 'iui-title' }, title),
121
+ isDismissible && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
122
+ React.createElement(SvgClose, null)))),
123
+ children)))), container)) : (React.createElement(React.Fragment, null));
122
124
  };
123
125
  export default Modal;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { CommonProps } from '../utils';
3
+ import '@itwin/itwinui-css/css/modal.css';
4
+ export declare type ModalContentProps = {
5
+ /**
6
+ * Main content in the `Modal`.
7
+ */
8
+ children: React.ReactNode;
9
+ } & Omit<CommonProps, 'title'>;
10
+ /**
11
+ * Container for content in `Modal`.
12
+ */
13
+ export declare const ModalContent: (props: ModalContentProps) => JSX.Element;
14
+ export default ModalContent;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
27
+ import React from 'react';
28
+ import cx from 'classnames';
29
+ import { useTheme } from '../utils';
30
+ import '@itwin/itwinui-css/css/modal.css';
31
+ /**
32
+ * Container for content in `Modal`.
33
+ */
34
+ export var ModalContent = function (props) {
35
+ var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
36
+ useTheme();
37
+ return (React.createElement("div", __assign({ className: cx('iui-modal-content', className) }, rest), children));
38
+ };
39
+ export default ModalContent;
@@ -2,5 +2,7 @@ export { Modal } from './Modal';
2
2
  export type { ModalProps } from './Modal';
3
3
  export { ModalButtonBar } from './ModalButtonBar';
4
4
  export type { ModalButtonBarProps } from './ModalButtonBar';
5
+ export { ModalContent } from './ModalContent';
6
+ export type { ModalContentProps } from './ModalContent';
5
7
  declare const _default: "./Modal";
6
8
  export default _default;
@@ -4,4 +4,5 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  export { Modal } from './Modal';
6
6
  export { ModalButtonBar } from './ModalButtonBar';
7
+ export { ModalContent } from './ModalContent';
7
8
  export default './Modal';
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import '@itwin/itwinui-css/css/skip-to-content.css';
3
+ export declare type SkipToContentLinkProps = {
4
+ /**
5
+ * The id of the main content that the link directs to. Don't forget the #!
6
+ */
7
+ href: string;
8
+ /**
9
+ * Localize 'Skip to main content' label.
10
+ * @default 'Skip to main content'
11
+ */
12
+ children?: React.ReactNode;
13
+ } & Omit<React.ComponentPropsWithoutRef<'a'>, 'href'>;
14
+ /**
15
+ * `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
16
+ * Provides a shortcut to the main content of the page without navigating through the header, etc.
17
+ * Should be placed just inside the body. Set `href` to the id of your main content component. Don't forget the `#`!
18
+ * @example
19
+ * <body><SkipToContentLink href='#main-content-id' /> ... </body>
20
+ * <body><SkipToContentLink href='#main-content-id'>{localizedLabel}</SkipToContentLink> ... </body>
21
+ */
22
+ export declare const SkipToContentLink: React.ForwardRefExoticComponent<{
23
+ /**
24
+ * The id of the main content that the link directs to. Don't forget the #!
25
+ */
26
+ href: string;
27
+ /**
28
+ * Localize 'Skip to main content' label.
29
+ * @default 'Skip to main content'
30
+ */
31
+ children?: React.ReactNode;
32
+ } & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>>, "href"> & React.RefAttributes<HTMLAnchorElement>>;
33
+ export default SkipToContentLink;
@@ -0,0 +1,44 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
27
+ import React from 'react';
28
+ import cx from 'classnames';
29
+ import { useTheme } from '../utils';
30
+ import '@itwin/itwinui-css/css/skip-to-content.css';
31
+ /**
32
+ * `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
33
+ * Provides a shortcut to the main content of the page without navigating through the header, etc.
34
+ * Should be placed just inside the body. Set `href` to the id of your main content component. Don't forget the `#`!
35
+ * @example
36
+ * <body><SkipToContentLink href='#main-content-id' /> ... </body>
37
+ * <body><SkipToContentLink href='#main-content-id'>{localizedLabel}</SkipToContentLink> ... </body>
38
+ */
39
+ export var SkipToContentLink = React.forwardRef(function (props, ref) {
40
+ var _a = props.children, children = _a === void 0 ? 'Skip to main content' : _a, className = props.className, rest = __rest(props, ["children", "className"]);
41
+ useTheme();
42
+ return (React.createElement("a", __assign({ ref: ref, className: cx('iui-skip-to-content-link', className) }, rest), children));
43
+ });
44
+ export default SkipToContentLink;
@@ -0,0 +1,4 @@
1
+ export { SkipToContentLink } from './SkipToContentLink';
2
+ export type { SkipToContentLinkProps } from './SkipToContentLink';
3
+ declare const _default: "./SkipToContentLink";
4
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export { SkipToContentLink } from './SkipToContentLink';
6
+ export default './SkipToContentLink';
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { CommonProps } from '../utils';
3
+ import '@itwin/itwinui-css/css/surface.css';
4
+ export declare type SurfaceProps = {
5
+ /**
6
+ * Sets the elevation of the surface
7
+ * @default 0
8
+ */
9
+ elevation?: 0 | 1 | 2 | 3 | 4 | 5;
10
+ /**
11
+ * Content in the surface.
12
+ */
13
+ children: React.ReactNode;
14
+ } & Omit<CommonProps, 'title'>;
15
+ /**
16
+ * The Surface container allows content to appear elevated through the use of a drop shadow
17
+ * @example
18
+ * <Surface>Surface Content</Surface>
19
+ * <Surface elevation={2}>Surface Content</Surface>
20
+ */
21
+ export declare const Surface: React.ForwardRefExoticComponent<{
22
+ /**
23
+ * Sets the elevation of the surface
24
+ * @default 0
25
+ */
26
+ elevation?: 0 | 1 | 2 | 3 | 4 | 5 | undefined;
27
+ /**
28
+ * Content in the surface.
29
+ */
30
+ children: React.ReactNode;
31
+ } & Omit<CommonProps, "title"> & React.RefAttributes<HTMLDivElement>>;
32
+ export default Surface;
@@ -0,0 +1,64 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
27
+ import React from 'react';
28
+ import cx from 'classnames';
29
+ import { useTheme, getWindow } from '../utils';
30
+ import '@itwin/itwinui-css/css/surface.css';
31
+ /**
32
+ * Helper function that returns one of the preset surface elevation values.
33
+ */
34
+ var getSurfaceElevationValue = function (elevation) {
35
+ switch (elevation) {
36
+ case 1:
37
+ return '0 1px 5px rgba(0, 0, 0, 0.25)';
38
+ case 2:
39
+ return '0 1px 10px rgba(0, 0, 0, 0.25)';
40
+ case 3:
41
+ return '0 3px 14px rgba(0, 0, 0, 0.25)';
42
+ case 4:
43
+ return '0 6px 30px rgba(0, 0, 0, 0.25)';
44
+ case 5:
45
+ return '0 9px 46px rgba(0, 0, 0, 0.25)';
46
+ default:
47
+ return 'none';
48
+ }
49
+ };
50
+ /**
51
+ * The Surface container allows content to appear elevated through the use of a drop shadow
52
+ * @example
53
+ * <Surface>Surface Content</Surface>
54
+ * <Surface elevation={2}>Surface Content</Surface>
55
+ */
56
+ export var Surface = React.forwardRef(function (props, ref) {
57
+ var _a, _b, _c;
58
+ var _d = props.elevation, elevation = _d === void 0 ? 0 : _d, className = props.className, style = props.style, children = props.children, rest = __rest(props, ["elevation", "className", "style", "children"]);
59
+ useTheme();
60
+ var _style = ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-surface-elevation: " + getSurfaceElevationValue(elevation)))
61
+ ? __assign({ '--iui-surface-elevation': getSurfaceElevationValue(elevation) }, style) : __assign({ boxShadow: getSurfaceElevationValue(elevation) }, style);
62
+ return (React.createElement("div", __assign({ className: cx('iui-surface', className), style: _style, ref: ref }, rest), children));
63
+ });
64
+ export default Surface;
@@ -0,0 +1,4 @@
1
+ export { Surface } from './Surface';
2
+ export type { SurfaceProps } from './Surface';
3
+ declare const _default: "./Surface";
4
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export { Surface } from './Surface';
6
+ export default './Surface';
@@ -3,6 +3,7 @@ import { CellProps, TableOptions, Row, TableState } from 'react-table';
3
3
  import { CommonProps } from '../utils';
4
4
  import '@itwin/itwinui-css/css/table.css';
5
5
  import { TableFilterValue } from './filters';
6
+ export declare const tableResizeStartAction = "tableResizeStart";
6
7
  export declare type TablePaginatorRendererProps = {
7
8
  /**
8
9
  * The zero-based index of the current page.
@@ -63,6 +64,12 @@ export declare type TableProps<T extends Record<string, unknown> = Record<string
63
64
  * Handler for when a row is clicked. Must be memoized.
64
65
  */
65
66
  onRowClick?: (event: React.MouseEvent, row: Row<T>) => void;
67
+ /**
68
+ * Modify the selection mode of the table.
69
+ * The column with checkboxes will not be present with 'single' selection mode.
70
+ * @default 'multi'
71
+ */
72
+ selectionMode?: 'multi' | 'single';
66
73
  /**
67
74
  * Flag whether table columns can be sortable.
68
75
  * @default false
@@ -37,12 +37,11 @@ import { TableRowMemoized } from './TableRowMemoized';
37
37
  import { FilterToggle } from './filters';
38
38
  import { customFilterFunctions } from './filters/customFilterFunctions';
39
39
  import { useExpanderCell, useSelectionCell, useSubRowFiltering, useSubRowSelection, useResizeColumns, useColumnDragAndDrop, } from './hooks';
40
- import { onExpandHandler, onFilterHandler, onSelectHandler, } from './actionHandlers';
41
- import { onSingleSelectHandler } from './actionHandlers/selectHandler';
42
- import { onTableResizeEnd, onTableResizeStart, } from './actionHandlers/resizeHandler';
40
+ import { onExpandHandler, onFilterHandler, onSelectHandler, onSingleSelectHandler, onTableResizeEnd, onTableResizeStart, } from './actionHandlers';
43
41
  import VirtualScroll from '../utils/components/VirtualScroll';
42
+ import { SELECTION_CELL_ID } from './columns';
44
43
  var singleRowSelectedAction = 'singleRowSelected';
45
- var tableResizeStartAction = 'tableResizeStart';
44
+ export var tableResizeStartAction = 'tableResizeStart';
46
45
  var tableResizeEndAction = 'tableResizeEnd';
47
46
  /**
48
47
  * Table based on [react-table](https://react-table.tanstack.com/docs/api/overview).
@@ -88,9 +87,10 @@ var tableResizeEndAction = 'tableResizeEnd';
88
87
  */
89
88
  export var Table = function (props) {
90
89
  var _a;
91
- var data = props.data, columns = props.columns, _b = props.isLoading, isLoading = _b === void 0 ? false : _b, emptyTableContent = props.emptyTableContent, className = props.className, style = props.style, id = props.id, _c = props.isSelectable, isSelectable = _c === void 0 ? false : _c, onSelect = props.onSelect, onRowClick = props.onRowClick, _d = props.isSortable, isSortable = _d === void 0 ? false : _d, onSort = props.onSort, stateReducer = props.stateReducer, onBottomReached = props.onBottomReached, onRowInViewport = props.onRowInViewport, _e = props.intersectionMargin, intersectionMargin = _e === void 0 ? 300 : _e, subComponent = props.subComponent, onExpand = props.onExpand, onFilter = props.onFilter, emptyFilteredTableContent = props.emptyFilteredTableContent, filterFunctions = props.filterTypes, expanderCell = props.expanderCell, isRowDisabled = props.isRowDisabled, rowProps = props.rowProps, _f = props.density, density = _f === void 0 ? 'default' : _f, _g = props.selectSubRows, selectSubRows = _g === void 0 ? true : _g, getSubRows = props.getSubRows, _h = props.selectRowOnClick, selectRowOnClick = _h === void 0 ? true : _h, paginatorRenderer = props.paginatorRenderer, _j = props.pageSize, pageSize = _j === void 0 ? 25 : _j, _k = props.isResizable, isResizable = _k === void 0 ? false : _k, _l = props.styleType, styleType = _l === void 0 ? 'default' : _l, _m = props.enableVirtualization, enableVirtualization = _m === void 0 ? false : _m, _o = props.enableColumnReordering, enableColumnReordering = _o === void 0 ? false : _o, rest = __rest(props, ["data", "columns", "isLoading", "emptyTableContent", "className", "style", "id", "isSelectable", "onSelect", "onRowClick", "isSortable", "onSort", "stateReducer", "onBottomReached", "onRowInViewport", "intersectionMargin", "subComponent", "onExpand", "onFilter", "emptyFilteredTableContent", "filterTypes", "expanderCell", "isRowDisabled", "rowProps", "density", "selectSubRows", "getSubRows", "selectRowOnClick", "paginatorRenderer", "pageSize", "isResizable", "styleType", "enableVirtualization", "enableColumnReordering"]);
90
+ var _b;
91
+ var data = props.data, columns = props.columns, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, emptyTableContent = props.emptyTableContent, className = props.className, style = props.style, id = props.id, _d = props.isSelectable, isSelectable = _d === void 0 ? false : _d, onSelect = props.onSelect, onRowClick = props.onRowClick, _e = props.selectionMode, selectionMode = _e === void 0 ? 'multi' : _e, _f = props.isSortable, isSortable = _f === void 0 ? false : _f, onSort = props.onSort, stateReducer = props.stateReducer, onBottomReached = props.onBottomReached, onRowInViewport = props.onRowInViewport, _g = props.intersectionMargin, intersectionMargin = _g === void 0 ? 300 : _g, subComponent = props.subComponent, onExpand = props.onExpand, onFilter = props.onFilter, emptyFilteredTableContent = props.emptyFilteredTableContent, filterFunctions = props.filterTypes, expanderCell = props.expanderCell, isRowDisabled = props.isRowDisabled, rowProps = props.rowProps, _h = props.density, density = _h === void 0 ? 'default' : _h, _j = props.selectSubRows, selectSubRows = _j === void 0 ? true : _j, getSubRows = props.getSubRows, _k = props.selectRowOnClick, selectRowOnClick = _k === void 0 ? true : _k, paginatorRenderer = props.paginatorRenderer, _l = props.pageSize, pageSize = _l === void 0 ? 25 : _l, _m = props.isResizable, isResizable = _m === void 0 ? false : _m, _o = props.styleType, styleType = _o === void 0 ? 'default' : _o, _p = props.enableVirtualization, enableVirtualization = _p === void 0 ? false : _p, _q = props.enableColumnReordering, enableColumnReordering = _q === void 0 ? false : _q, rest = __rest(props, ["data", "columns", "isLoading", "emptyTableContent", "className", "style", "id", "isSelectable", "onSelect", "onRowClick", "selectionMode", "isSortable", "onSort", "stateReducer", "onBottomReached", "onRowInViewport", "intersectionMargin", "subComponent", "onExpand", "onFilter", "emptyFilteredTableContent", "filterTypes", "expanderCell", "isRowDisabled", "rowProps", "density", "selectSubRows", "getSubRows", "selectRowOnClick", "paginatorRenderer", "pageSize", "isResizable", "styleType", "enableVirtualization", "enableColumnReordering"]);
92
92
  useTheme();
93
- var _p = React.useState(), ownerDocument = _p[0], setOwnerDocument = _p[1];
93
+ var _r = React.useState(), ownerDocument = _r[0], setOwnerDocument = _r[1];
94
94
  var defaultColumn = React.useMemo(function () { return ({
95
95
  maxWidth: 0,
96
96
  minWidth: 0,
@@ -103,6 +103,7 @@ export var Table = function (props) {
103
103
  onBottomReachedRef.current = onBottomReached;
104
104
  onRowInViewportRef.current = onRowInViewport;
105
105
  }, [onBottomReached, onRowInViewport]);
106
+ var hasManualSelectionColumn = (_b = columns[0]) === null || _b === void 0 ? void 0 : _b.columns.some(function (column) { return column.id === SELECTION_CELL_ID; });
106
107
  var tableStateReducer = React.useCallback(function (newState, action, previousState, instance) {
107
108
  switch (action.type) {
108
109
  case TableActions.toggleSortBy:
@@ -116,13 +117,17 @@ export var Table = function (props) {
116
117
  onExpandHandler(newState, instance, onExpand);
117
118
  break;
118
119
  case singleRowSelectedAction: {
119
- newState = onSingleSelectHandler(newState, action, instance, onSelect, isRowDisabled);
120
+ newState = onSingleSelectHandler(newState, action, instance, onSelect,
121
+ // If it has manual selection column, then we can't check whether row is disabled
122
+ hasManualSelectionColumn ? undefined : isRowDisabled);
120
123
  break;
121
124
  }
122
125
  case TableActions.toggleRowSelected:
123
126
  case TableActions.toggleAllRowsSelected:
124
127
  case TableActions.toggleAllPageRowsSelected: {
125
- onSelectHandler(newState, instance, onSelect, isRowDisabled);
128
+ onSelectHandler(newState, instance, onSelect,
129
+ // If it has manual selection column, then we can't check whether row is disabled
130
+ hasManualSelectionColumn ? undefined : isRowDisabled);
126
131
  break;
127
132
  }
128
133
  case tableResizeStartAction: {
@@ -139,14 +144,22 @@ export var Table = function (props) {
139
144
  return stateReducer
140
145
  ? stateReducer(newState, action, previousState, instance)
141
146
  : newState;
142
- }, [isRowDisabled, onExpand, onFilter, onSelect, onSort, stateReducer]);
147
+ }, [
148
+ hasManualSelectionColumn,
149
+ isRowDisabled,
150
+ onExpand,
151
+ onFilter,
152
+ onSelect,
153
+ onSort,
154
+ stateReducer,
155
+ ]);
143
156
  var filterTypes = React.useMemo(function () { return (__assign(__assign({}, customFilterFunctions), filterFunctions)); }, [filterFunctions]);
144
157
  var hasAnySubRows = React.useMemo(function () {
145
158
  return data.some(function (item, index) {
146
159
  return getSubRows ? getSubRows(item, index) : item.subRows;
147
160
  });
148
161
  }, [data, getSubRows]);
149
- var instance = useTable(__assign(__assign({ manualPagination: !paginatorRenderer, paginateExpandedRows: false }, props), { columns: columns, defaultColumn: defaultColumn, disableSortBy: !isSortable, stateReducer: tableStateReducer, filterTypes: filterTypes, selectSubRows: selectSubRows, data: data, getSubRows: getSubRows, initialState: __assign({ pageSize: pageSize }, props.initialState) }), useFlexLayout, useResizeColumns(ownerDocument), useFilters, useSubRowFiltering(hasAnySubRows), useSortBy, useExpanded, usePagination, useRowSelect, useSubRowSelection, useExpanderCell(subComponent, expanderCell, isRowDisabled), useSelectionCell(isSelectable, isRowDisabled), useColumnOrder, useColumnDragAndDrop(enableColumnReordering));
162
+ var instance = useTable(__assign(__assign({ manualPagination: !paginatorRenderer, paginateExpandedRows: false }, props), { columns: columns, defaultColumn: defaultColumn, disableSortBy: !isSortable, stateReducer: tableStateReducer, filterTypes: filterTypes, selectSubRows: selectSubRows, data: data, getSubRows: getSubRows, initialState: __assign({ pageSize: pageSize }, props.initialState) }), useFlexLayout, useResizeColumns(ownerDocument), useFilters, useSubRowFiltering(hasAnySubRows), useSortBy, useExpanded, usePagination, useRowSelect, useSubRowSelection, useExpanderCell(subComponent, expanderCell, isRowDisabled), useSelectionCell(isSelectable, selectionMode, isRowDisabled), useColumnOrder, useColumnDragAndDrop(enableColumnReordering));
150
163
  var getTableProps = instance.getTableProps, rows = instance.rows, headerGroups = instance.headerGroups, getTableBodyProps = instance.getTableBodyProps, prepareRow = instance.prepareRow, state = instance.state, allColumns = instance.allColumns, filteredFlatRows = instance.filteredFlatRows, dispatch = instance.dispatch, page = instance.page, gotoPage = instance.gotoPage, setPageSize = instance.setPageSize, flatHeaders = instance.flatHeaders;
151
164
  var ariaDataAttributes = Object.entries(rest).reduce(function (result, _a) {
152
165
  var key = _a[0], value = _a[1];
@@ -158,8 +171,14 @@ export var Table = function (props) {
158
171
  var areFiltersSet = allColumns.some(function (column) { return !!column.filterValue; });
159
172
  var onRowClickHandler = React.useCallback(function (event, row) {
160
173
  var isDisabled = isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original);
161
- if (isSelectable && !isDisabled && selectRowOnClick) {
162
- if (!row.isSelected && !event.ctrlKey) {
174
+ if (!isDisabled) {
175
+ onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(event, row);
176
+ }
177
+ if (isSelectable &&
178
+ !isDisabled &&
179
+ selectRowOnClick &&
180
+ !event.isDefaultPrevented()) {
181
+ if (!row.isSelected && (selectionMode === 'single' || !event.ctrlKey)) {
163
182
  dispatch({
164
183
  type: singleRowSelectedAction,
165
184
  id: row.id,
@@ -169,10 +188,14 @@ export var Table = function (props) {
169
188
  row.toggleRowSelected(!row.isSelected);
170
189
  }
171
190
  }
172
- if (!isDisabled) {
173
- onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(event, row);
174
- }
175
- }, [isRowDisabled, isSelectable, selectRowOnClick, dispatch, onRowClick]);
191
+ }, [
192
+ isRowDisabled,
193
+ isSelectable,
194
+ selectRowOnClick,
195
+ selectionMode,
196
+ dispatch,
197
+ onRowClick,
198
+ ]);
176
199
  React.useEffect(function () {
177
200
  setPageSize(pageSize);
178
201
  }, [pageSize, setPageSize]);
@@ -228,11 +251,12 @@ export var Table = function (props) {
228
251
  });
229
252
  var headerRef = React.useRef(null);
230
253
  var bodyRef = React.useRef(null);
231
- var getPreparedRow = React.useCallback(function (row) {
254
+ var getPreparedRow = React.useCallback(function (index) {
255
+ var row = page[index];
232
256
  prepareRow(row);
233
- return (React.createElement(TableRowMemoized, { row: row, rowProps: rowProps, isLast: row.index === data.length - 1, onRowInViewport: onRowInViewportRef, onBottomReached: onBottomReachedRef, intersectionMargin: intersectionMargin, state: state, key: row.getRowProps().key, onClick: onRowClickHandler, subComponent: subComponent, isDisabled: !!(isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original)), tableHasSubRows: hasAnySubRows, tableInstance: instance, expanderCell: expanderCell }));
257
+ return (React.createElement(TableRowMemoized, { row: row, rowProps: rowProps, isLast: index === page.length - 1, onRowInViewport: onRowInViewportRef, onBottomReached: onBottomReachedRef, intersectionMargin: intersectionMargin, state: state, key: row.getRowProps().key, onClick: onRowClickHandler, subComponent: subComponent, isDisabled: !!(isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original)), tableHasSubRows: hasAnySubRows, tableInstance: instance, expanderCell: expanderCell }));
234
258
  }, [
235
- data.length,
259
+ page,
236
260
  expanderCell,
237
261
  hasAnySubRows,
238
262
  instance,
@@ -244,7 +268,7 @@ export var Table = function (props) {
244
268
  state,
245
269
  subComponent,
246
270
  ]);
247
- var virtualizedItemRenderer = React.useCallback(function (index) { return getPreparedRow(page[index]); }, [getPreparedRow, page]);
271
+ var virtualizedItemRenderer = React.useCallback(function (index) { return getPreparedRow(index); }, [getPreparedRow]);
248
272
  return (React.createElement(React.Fragment, null,
249
273
  React.createElement("div", __assign({ ref: function (element) {
250
274
  setOwnerDocument(element === null || element === void 0 ? void 0 : element.ownerDocument);
@@ -268,8 +292,8 @@ export var Table = function (props) {
268
292
  }
269
293
  } }),
270
294
  column.render('Header'),
271
- !isLoading && (data.length != 0 || areFiltersSet) && (React.createElement(FilterToggle, { column: column, ownerDocument: ownerDocument })),
272
- !isLoading && data.length != 0 && column.canSort && (React.createElement("div", { className: 'iui-cell-end-icon' }, column.isSorted && column.isSortedDesc ? (React.createElement(SvgSortUp, { className: 'iui-icon iui-sort', "aria-hidden": true })) : (React.createElement(SvgSortDown, { className: 'iui-icon iui-sort', "aria-hidden": true })))),
295
+ (data.length !== 0 || areFiltersSet) && (React.createElement(FilterToggle, { column: column, ownerDocument: ownerDocument })),
296
+ data.length !== 0 && column.canSort && (React.createElement("div", { className: 'iui-cell-end-icon' }, column.isSorted && column.isSortedDesc ? (React.createElement(SvgSortUp, { className: 'iui-icon iui-sort', "aria-hidden": true })) : (React.createElement(SvgSortDown, { className: 'iui-icon iui-sort', "aria-hidden": true })))),
273
297
  isResizable &&
274
298
  column.isResizerVisible &&
275
299
  index !== headerGroup.headers.length - 1 && (React.createElement("div", __assign({}, column.getResizerProps(), { className: 'iui-resizer' }),
@@ -287,7 +311,7 @@ export var Table = function (props) {
287
311
  headerRef.current.scrollLeft = bodyRef.current.scrollLeft;
288
312
  }
289
313
  }, tabIndex: -1 }),
290
- data.length !== 0 && (React.createElement(React.Fragment, null, enableVirtualization ? (React.createElement(VirtualScroll, { itemsLength: page.length, itemRenderer: virtualizedItemRenderer })) : (page.map(function (row) { return getPreparedRow(row); })))),
314
+ data.length !== 0 && (React.createElement(React.Fragment, null, enableVirtualization ? (React.createElement(VirtualScroll, { itemsLength: page.length, itemRenderer: virtualizedItemRenderer })) : (page.map(function (_, index) { return getPreparedRow(index); })))),
291
315
  isLoading && data.length === 0 && (React.createElement("div", { className: 'iui-table-empty' },
292
316
  React.createElement(ProgressRadial, { indeterminate: true }))),
293
317
  isLoading && data.length !== 0 && (React.createElement("div", { className: 'iui-row' },
@@ -17,7 +17,7 @@ import React from 'react';
17
17
  import cx from 'classnames';
18
18
  import { getCellStyle } from './utils';
19
19
  import { SubRowExpander } from './SubRowExpander';
20
- import { SELECTION_CELL_ID } from './hooks';
20
+ import { SELECTION_CELL_ID } from './columns';
21
21
  import { DefaultCell } from './cells';
22
22
  export var TableCell = function (props) {
23
23
  var cell = props.cell, cellIndex = props.cellIndex, isDisabled = props.isDisabled, tableHasSubRows = props.tableHasSubRows, tableInstance = props.tableInstance, expanderCell = props.expanderCell;
@@ -46,6 +46,6 @@ export var TableCell = function (props) {
46
46
  cellProps: cellProps,
47
47
  children: cellContent,
48
48
  };
49
- return (React.createElement(React.Fragment, null, cell.column.cellRenderer ? (cell.column.cellRenderer(cellRendererProps)) : (React.createElement(DefaultCell, __assign({}, cellRendererProps)))));
49
+ return (React.createElement(React.Fragment, null, cell.column.cellRenderer ? (cell.column.cellRenderer(__assign(__assign({}, cellRendererProps), { isDisabled: function () { return isDisabled; } }))) : (React.createElement(DefaultCell, __assign({}, cellRendererProps, { isDisabled: function () { return isDisabled; } })))));
50
50
  };
51
51
  export default TableCell;
@@ -51,7 +51,9 @@ export var TableRow = function (props) {
51
51
  return (React.createElement(TableCell, { key: cell.getCellProps().key, cell: cell, cellIndex: index, isDisabled: isDisabled, tableHasSubRows: tableHasSubRows, tableInstance: tableInstance, expanderCell: expanderCell }));
52
52
  })),
53
53
  subComponent && (React.createElement(WithCSSTransition, { in: row.isExpanded },
54
- React.createElement("div", { className: 'iui-row iui-expanded-content' }, subComponent(row))))));
54
+ React.createElement("div", { className: cx('iui-row', 'iui-expanded-content', {
55
+ 'iui-disabled': isDisabled,
56
+ }) }, subComponent(row))))));
55
57
  };
56
58
  var hasAnySelectedSubRow = function (row, selectedRowIds) {
57
59
  if (selectedRowIds === null || selectedRowIds === void 0 ? void 0 : selectedRowIds[row.id]) {
@@ -62,14 +64,17 @@ var hasAnySelectedSubRow = function (row, selectedRowIds) {
62
64
  });
63
65
  };
64
66
  export var TableRowMemoized = React.memo(TableRow, function (prevProp, nextProp) {
65
- var _a, _b, _c, _d;
67
+ var _a, _b, _c, _d, _e, _f, _g;
66
68
  return prevProp.isLast === nextProp.isLast &&
69
+ ((_a = prevProp.state.hiddenColumns) === null || _a === void 0 ? void 0 : _a.length) ===
70
+ ((_b = nextProp.state.hiddenColumns) === null || _b === void 0 ? void 0 : _b.length) &&
71
+ !!((_c = prevProp.state.hiddenColumns) === null || _c === void 0 ? void 0 : _c.every(function (column, index) { var _a; return ((_a = nextProp.state.hiddenColumns) === null || _a === void 0 ? void 0 : _a[index]) === column; })) &&
67
72
  prevProp.onRowInViewport === nextProp.onRowInViewport &&
68
73
  prevProp.onBottomReached === nextProp.onBottomReached &&
69
74
  prevProp.onClick === nextProp.onClick &&
70
75
  prevProp.row.original === nextProp.row.original &&
71
- ((_a = prevProp.state.selectedRowIds) === null || _a === void 0 ? void 0 : _a[prevProp.row.id]) ===
72
- ((_b = nextProp.state.selectedRowIds) === null || _b === void 0 ? void 0 : _b[nextProp.row.id]) &&
76
+ ((_d = prevProp.state.selectedRowIds) === null || _d === void 0 ? void 0 : _d[prevProp.row.id]) ===
77
+ ((_e = nextProp.state.selectedRowIds) === null || _e === void 0 ? void 0 : _e[nextProp.row.id]) &&
73
78
  // Check if sub-rows selection has changed and whether to show indeterminate state or not
74
79
  prevProp.row.subRows.some(function (subRow) {
75
80
  return hasAnySelectedSubRow(subRow, prevProp.state.selectedRowIds);
@@ -77,8 +82,8 @@ export var TableRowMemoized = React.memo(TableRow, function (prevProp, nextProp)
77
82
  nextProp.row.subRows.some(function (subRow) {
78
83
  return hasAnySelectedSubRow(subRow, nextProp.state.selectedRowIds);
79
84
  }) &&
80
- ((_c = prevProp.state.expanded) === null || _c === void 0 ? void 0 : _c[prevProp.row.id]) ===
81
- ((_d = nextProp.state.expanded) === null || _d === void 0 ? void 0 : _d[nextProp.row.id]) &&
85
+ ((_f = prevProp.state.expanded) === null || _f === void 0 ? void 0 : _f[prevProp.row.id]) ===
86
+ ((_g = nextProp.state.expanded) === null || _g === void 0 ? void 0 : _g[nextProp.row.id]) &&
82
87
  prevProp.subComponent === nextProp.subComponent &&
83
88
  prevProp.row.cells.every(function (cell, index) { return nextProp.row.cells[index].column === cell.column; }) &&
84
89
  prevProp.isDisabled === nextProp.isDisabled &&
@@ -87,5 +92,5 @@ export var TableRowMemoized = React.memo(TableRow, function (prevProp, nextProp)
87
92
  prevProp.tableHasSubRows === nextProp.tableHasSubRows &&
88
93
  prevProp.state.columnOrder === nextProp.state.columnOrder &&
89
94
  !nextProp.state.columnResizing.isResizingColumn &&
90
- !nextProp.state.isTableResizing;
95
+ prevProp.state.isTableResizing === nextProp.state.isTableResizing;
91
96
  });
@@ -1,3 +1,4 @@
1
1
  export { onExpandHandler } from './expandHandler';
2
2
  export { onFilterHandler } from './filterHandler';
3
- export { onSelectHandler } from './selectHandler';
3
+ export { onSelectHandler, onSingleSelectHandler } from './selectHandler';
4
+ export { onTableResizeStart, onTableResizeEnd } from './resizeHandler';
@@ -4,4 +4,5 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  export { onExpandHandler } from './expandHandler';
6
6
  export { onFilterHandler } from './filterHandler';
7
- export { onSelectHandler } from './selectHandler';
7
+ export { onSelectHandler, onSingleSelectHandler } from './selectHandler';
8
+ export { onTableResizeStart, onTableResizeEnd } from './resizeHandler';
@@ -12,5 +12,5 @@ export declare type DefaultCellProps<T extends Record<string, unknown>> = CellRe
12
12
  * cellRenderer: (props) => <DefaultCell {...props} />,
13
13
  * }
14
14
  */
15
- export declare const DefaultCell: <T extends Record<string, unknown>>(props: CellRendererProps<T>) => JSX.Element;
15
+ export declare const DefaultCell: <T extends Record<string, unknown>>(props: DefaultCellProps<T>) => JSX.Element;
16
16
  export default DefaultCell;