@itwin/itwinui-react 1.35.0 → 1.37.1

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 (196) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/cjs/core/Alert/Alert.js +1 -1
  3. package/cjs/core/Badge/Badge.js +1 -1
  4. package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  5. package/cjs/core/Buttons/Button/Button.js +2 -2
  6. package/cjs/core/Buttons/IconButton/IconButton.js +2 -2
  7. package/cjs/core/Carousel/Carousel.js +1 -1
  8. package/cjs/core/Carousel/CarouselDotsList.js +1 -1
  9. package/cjs/core/Carousel/CarouselSlider.js +1 -1
  10. package/cjs/core/Checkbox/Checkbox.js +1 -1
  11. package/cjs/core/ColorPicker/ColorBuilder.js +3 -3
  12. package/cjs/core/ColorPicker/ColorInputPanel.js +1 -1
  13. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  14. package/cjs/core/ColorPicker/ColorSwatch.js +1 -1
  15. package/cjs/core/ComboBox/ComboBox.js +9 -6
  16. package/cjs/core/DatePicker/DatePicker.js +2 -2
  17. package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
  18. package/cjs/core/Footer/Footer.js +2 -2
  19. package/cjs/core/Header/HeaderBreadcrumbs.js +1 -1
  20. package/cjs/core/Header/HeaderButton.js +1 -0
  21. package/cjs/core/InformationPanel/InformationPanel.js +2 -2
  22. package/cjs/core/Input/Input.js +1 -1
  23. package/cjs/core/Menu/Menu.js +8 -3
  24. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
  25. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
  26. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
  27. package/cjs/core/Radio/Radio.js +1 -1
  28. package/cjs/core/Select/Select.js +3 -3
  29. package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
  30. package/cjs/core/SkipToContentLink/SkipToContentLink.js +50 -0
  31. package/cjs/core/SkipToContentLink/index.d.ts +4 -0
  32. package/cjs/core/SkipToContentLink/index.js +10 -0
  33. package/cjs/core/Slider/Slider.js +1 -1
  34. package/cjs/core/Slider/Thumb.js +1 -1
  35. package/cjs/core/Slider/Track.js +1 -1
  36. package/cjs/core/Surface/Surface.d.ts +32 -0
  37. package/cjs/core/Surface/Surface.js +70 -0
  38. package/cjs/core/Surface/index.d.ts +4 -0
  39. package/cjs/core/Surface/index.js +10 -0
  40. package/cjs/core/Table/Table.d.ts +7 -0
  41. package/cjs/core/Table/Table.js +44 -21
  42. package/cjs/core/Table/TableCell.js +3 -3
  43. package/cjs/core/Table/TablePaginator.js +6 -6
  44. package/cjs/core/Table/TableRowMemoized.js +13 -8
  45. package/cjs/core/Table/actionHandlers/index.d.ts +2 -1
  46. package/cjs/core/Table/actionHandlers/index.js +5 -1
  47. package/cjs/core/Table/cells/DefaultCell.d.ts +1 -1
  48. package/cjs/core/Table/cells/DefaultCell.js +5 -2
  49. package/cjs/core/Table/columns/actionColumn.d.ts +35 -0
  50. package/cjs/core/Table/columns/actionColumn.js +91 -0
  51. package/cjs/core/Table/columns/expanderColumn.d.ts +47 -0
  52. package/cjs/core/Table/columns/expanderColumn.js +81 -0
  53. package/cjs/core/Table/columns/index.d.ts +3 -0
  54. package/cjs/core/Table/columns/index.js +15 -0
  55. package/cjs/core/Table/columns/selectionColumn.d.ts +35 -0
  56. package/cjs/core/Table/columns/selectionColumn.js +67 -0
  57. package/cjs/core/Table/hooks/index.d.ts +2 -2
  58. package/cjs/core/Table/hooks/index.js +1 -3
  59. package/cjs/core/Table/hooks/useExpanderCell.d.ts +0 -1
  60. package/cjs/core/Table/hooks/useExpanderCell.js +25 -39
  61. package/cjs/core/Table/hooks/useResizeColumns.js +8 -2
  62. package/cjs/core/Table/hooks/useSelectionCell.d.ts +1 -2
  63. package/cjs/core/Table/hooks/useSelectionCell.js +8 -53
  64. package/cjs/core/Table/index.d.ts +1 -0
  65. package/cjs/core/Table/index.js +5 -1
  66. package/cjs/core/Table/utils.js +5 -5
  67. package/cjs/core/Tabs/Tabs.d.ts +1 -1
  68. package/cjs/core/Tabs/Tabs.js +7 -8
  69. package/cjs/core/Tag/Tag.js +6 -3
  70. package/cjs/core/Tag/TagContainer.js +1 -1
  71. package/cjs/core/Tile/Tile.d.ts +6 -2
  72. package/cjs/core/Tile/Tile.js +8 -3
  73. package/cjs/core/Toast/Toast.js +3 -3
  74. package/cjs/core/Toast/ToastWrapper.js +1 -1
  75. package/cjs/core/Tree/TreeNode.js +2 -2
  76. package/cjs/core/Typography/Anchor/Anchor.d.ts +1 -0
  77. package/cjs/core/Typography/Anchor/Anchor.js +1 -0
  78. package/cjs/core/Typography/Text/Text.js +1 -1
  79. package/cjs/core/UserIcon/UserIcon.js +2 -2
  80. package/cjs/core/UserIconGroup/UserIconGroup.js +3 -3
  81. package/cjs/core/Wizard/Step.js +1 -1
  82. package/cjs/core/Wizard/Wizard.js +1 -1
  83. package/cjs/core/index.d.ts +5 -1
  84. package/cjs/core/index.js +9 -2
  85. package/cjs/core/utils/color/ColorValue.js +11 -11
  86. package/cjs/core/utils/color/index.js +5 -1
  87. package/cjs/core/utils/components/FocusTrap.js +6 -8
  88. package/cjs/core/utils/components/InputContainer.js +1 -1
  89. package/cjs/core/utils/components/MiddleTextTruncation.js +1 -1
  90. package/cjs/core/utils/components/Popover.js +13 -1
  91. package/cjs/core/utils/components/VirtualScroll.js +1 -1
  92. package/cjs/core/utils/components/WithCSSTransition.js +5 -5
  93. package/cjs/core/utils/components/index.js +5 -1
  94. package/cjs/core/utils/functions/focusable.js +1 -1
  95. package/cjs/core/utils/functions/index.js +5 -1
  96. package/cjs/core/utils/hooks/index.js +5 -1
  97. package/cjs/core/utils/hooks/useOverflow.js +3 -3
  98. package/cjs/core/utils/hooks/useTheme.js +1 -1
  99. package/cjs/core/utils/index.js +5 -1
  100. package/cjs/index.js +5 -1
  101. package/cjs/types/react-table-config.d.ts +18 -0
  102. package/esm/core/Alert/Alert.js +1 -1
  103. package/esm/core/Badge/Badge.js +1 -1
  104. package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  105. package/esm/core/Buttons/Button/Button.js +2 -2
  106. package/esm/core/Buttons/IconButton/IconButton.js +2 -2
  107. package/esm/core/Carousel/Carousel.js +1 -1
  108. package/esm/core/Carousel/CarouselDotsList.js +1 -1
  109. package/esm/core/Carousel/CarouselSlider.js +1 -1
  110. package/esm/core/Checkbox/Checkbox.js +1 -1
  111. package/esm/core/ColorPicker/ColorBuilder.js +3 -3
  112. package/esm/core/ColorPicker/ColorInputPanel.js +1 -1
  113. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  114. package/esm/core/ColorPicker/ColorSwatch.js +1 -1
  115. package/esm/core/ComboBox/ComboBox.js +9 -6
  116. package/esm/core/DatePicker/DatePicker.js +2 -2
  117. package/esm/core/ExpandableBlock/ExpandableBlock.js +1 -1
  118. package/esm/core/Footer/Footer.js +2 -2
  119. package/esm/core/Header/HeaderBreadcrumbs.js +1 -1
  120. package/esm/core/Header/HeaderButton.js +1 -0
  121. package/esm/core/InformationPanel/InformationPanel.js +2 -2
  122. package/esm/core/Input/Input.js +1 -1
  123. package/esm/core/Menu/Menu.js +8 -3
  124. package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
  125. package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
  126. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
  127. package/esm/core/Radio/Radio.js +1 -1
  128. package/esm/core/Select/Select.js +3 -3
  129. package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
  130. package/esm/core/SkipToContentLink/SkipToContentLink.js +44 -0
  131. package/esm/core/SkipToContentLink/index.d.ts +4 -0
  132. package/esm/core/SkipToContentLink/index.js +6 -0
  133. package/esm/core/Slider/Slider.js +1 -1
  134. package/esm/core/Slider/Thumb.js +1 -1
  135. package/esm/core/Slider/Track.js +1 -1
  136. package/esm/core/Surface/Surface.d.ts +32 -0
  137. package/esm/core/Surface/Surface.js +64 -0
  138. package/esm/core/Surface/index.d.ts +4 -0
  139. package/esm/core/Surface/index.js +6 -0
  140. package/esm/core/Table/Table.d.ts +7 -0
  141. package/esm/core/Table/Table.js +40 -17
  142. package/esm/core/Table/TableCell.js +2 -2
  143. package/esm/core/Table/TablePaginator.js +6 -6
  144. package/esm/core/Table/TableRowMemoized.js +13 -8
  145. package/esm/core/Table/actionHandlers/index.d.ts +2 -1
  146. package/esm/core/Table/actionHandlers/index.js +2 -1
  147. package/esm/core/Table/cells/DefaultCell.d.ts +1 -1
  148. package/esm/core/Table/cells/DefaultCell.js +5 -2
  149. package/esm/core/Table/columns/actionColumn.d.ts +35 -0
  150. package/esm/core/Table/columns/actionColumn.js +84 -0
  151. package/esm/core/Table/columns/expanderColumn.d.ts +47 -0
  152. package/esm/core/Table/columns/expanderColumn.js +74 -0
  153. package/esm/core/Table/columns/index.d.ts +3 -0
  154. package/esm/core/Table/columns/index.js +7 -0
  155. package/esm/core/Table/columns/selectionColumn.d.ts +35 -0
  156. package/esm/core/Table/columns/selectionColumn.js +60 -0
  157. package/esm/core/Table/hooks/index.d.ts +2 -2
  158. package/esm/core/Table/hooks/index.js +2 -2
  159. package/esm/core/Table/hooks/useExpanderCell.d.ts +0 -1
  160. package/esm/core/Table/hooks/useExpanderCell.js +24 -35
  161. package/esm/core/Table/hooks/useResizeColumns.js +8 -2
  162. package/esm/core/Table/hooks/useSelectionCell.d.ts +1 -2
  163. package/esm/core/Table/hooks/useSelectionCell.js +7 -49
  164. package/esm/core/Table/index.d.ts +1 -0
  165. package/esm/core/Table/index.js +1 -0
  166. package/esm/core/Table/utils.js +5 -5
  167. package/esm/core/Tabs/Tabs.d.ts +1 -1
  168. package/esm/core/Tabs/Tabs.js +7 -8
  169. package/esm/core/Tag/Tag.js +6 -3
  170. package/esm/core/Tag/TagContainer.js +1 -1
  171. package/esm/core/Tile/Tile.d.ts +6 -2
  172. package/esm/core/Tile/Tile.js +8 -3
  173. package/esm/core/Toast/Toast.js +3 -3
  174. package/esm/core/Toast/ToastWrapper.js +1 -1
  175. package/esm/core/Tree/TreeNode.js +2 -2
  176. package/esm/core/Typography/Anchor/Anchor.d.ts +1 -0
  177. package/esm/core/Typography/Anchor/Anchor.js +1 -0
  178. package/esm/core/Typography/Text/Text.js +1 -1
  179. package/esm/core/UserIcon/UserIcon.js +2 -2
  180. package/esm/core/UserIconGroup/UserIconGroup.js +3 -3
  181. package/esm/core/Wizard/Step.js +1 -1
  182. package/esm/core/Wizard/Wizard.js +1 -1
  183. package/esm/core/index.d.ts +5 -1
  184. package/esm/core/index.js +3 -1
  185. package/esm/core/utils/color/ColorValue.js +11 -11
  186. package/esm/core/utils/components/FocusTrap.js +6 -8
  187. package/esm/core/utils/components/InputContainer.js +1 -1
  188. package/esm/core/utils/components/MiddleTextTruncation.js +1 -1
  189. package/esm/core/utils/components/Popover.js +13 -1
  190. package/esm/core/utils/components/VirtualScroll.js +1 -1
  191. package/esm/core/utils/components/WithCSSTransition.js +5 -5
  192. package/esm/core/utils/functions/focusable.js +1 -1
  193. package/esm/core/utils/hooks/useOverflow.js +3 -3
  194. package/esm/core/utils/hooks/useTheme.js +1 -1
  195. package/esm/types/react-table-config.d.ts +18 -0
  196. package/package.json +21 -20
@@ -328,9 +328,9 @@ var ColorValue = /** @class */ (function () {
328
328
  if (value < 0) {
329
329
  value = 0xffffffff + value + 1;
330
330
  }
331
- return "#" + ("00000000" + value.toString(16)).slice(-8);
331
+ return "#".concat("00000000".concat(value.toString(16)).slice(-8));
332
332
  }
333
- return "#" + ("000000" + this.getRgb().toString(16)).slice(-6);
333
+ return "#".concat("000000".concat(this.getRgb().toString(16)).slice(-6));
334
334
  };
335
335
  /**
336
336
  * Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values.
@@ -490,34 +490,34 @@ var ColorValue = /** @class */ (function () {
490
490
  ColorValue.prototype.toRgbString = function (includeAlpha) {
491
491
  var _a;
492
492
  var rgb = this.toRgbColor();
493
- var rgbString = rgb.r + ", " + rgb.g + ", " + rgb.b;
493
+ var rgbString = "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b);
494
494
  if (includeAlpha) {
495
495
  var alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
496
- return "rgba(" + rgbString + ", " + ColorValue.getFormattedColorNumber(alpha, 2) + ")";
496
+ return "rgba(".concat(rgbString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
497
497
  }
498
- return "rgb(" + rgbString + ")";
498
+ return "rgb(".concat(rgbString, ")");
499
499
  };
500
500
  /** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
501
501
  ColorValue.prototype.toHslString = function (includeAlpha) {
502
502
  var _a, _b;
503
503
  var hsl = this.toHslColor();
504
- var hslString = ColorValue.getFormattedColorNumber((_a = this._hue) !== null && _a !== void 0 ? _a : hsl.h) + ", " + ColorValue.getFormattedColorNumber(hsl.s) + "%, " + ColorValue.getFormattedColorNumber(hsl.l) + "%";
504
+ var hslString = "".concat(ColorValue.getFormattedColorNumber((_a = this._hue) !== null && _a !== void 0 ? _a : hsl.h), ", ").concat(ColorValue.getFormattedColorNumber(hsl.s), "%, ").concat(ColorValue.getFormattedColorNumber(hsl.l), "%");
505
505
  if (includeAlpha) {
506
506
  var alpha = (_b = hsl.a) !== null && _b !== void 0 ? _b : 1;
507
- return "hsla(" + hslString + ", " + ColorValue.getFormattedColorNumber(alpha, 2) + ")";
507
+ return "hsla(".concat(hslString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
508
508
  }
509
- return "hsl(" + hslString + ")";
509
+ return "hsl(".concat(hslString, ")");
510
510
  };
511
511
  /** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
512
512
  ColorValue.prototype.toHsvString = function (includeAlpha) {
513
513
  var _a, _b;
514
514
  var hsv = this.toHsvColor();
515
- var hsvString = ((_a = this._hue) !== null && _a !== void 0 ? _a : hsv.h) + ", " + hsv.s + "%, " + hsv.v + "%";
515
+ var hsvString = "".concat((_a = this._hue) !== null && _a !== void 0 ? _a : hsv.h, ", ").concat(hsv.s, "%, ").concat(hsv.v, "%");
516
516
  if (includeAlpha) {
517
517
  var alpha = (_b = hsv.a) !== null && _b !== void 0 ? _b : 1;
518
- return "hsva(" + hsvString + ", " + ColorValue.getFormattedColorNumber(alpha, 2) + ")";
518
+ return "hsva(".concat(hsvString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
519
519
  }
520
- return "hsv(" + hsvString + ")";
520
+ return "hsv(".concat(hsvString, ")");
521
521
  };
522
522
  return ColorValue;
523
523
  }());
@@ -19,23 +19,21 @@ export var FocusTrap = function (props) {
19
19
  return [firstElement, lastElement];
20
20
  };
21
21
  var onFirstFocus = function (event) {
22
- var _a, _b;
23
- var _c = getFirstLastFocusables(), firstElement = _c[0], lastElement = _c[1];
22
+ var _a = getFirstLastFocusables(), firstElement = _a[0], lastElement = _a[1];
24
23
  if (event.relatedTarget === firstElement) {
25
- (_a = lastElement) === null || _a === void 0 ? void 0 : _a.focus();
24
+ lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
26
25
  }
27
26
  else {
28
- (_b = firstElement) === null || _b === void 0 ? void 0 : _b.focus();
27
+ firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
29
28
  }
30
29
  };
31
30
  var onLastFocus = function (event) {
32
- var _a, _b;
33
- var _c = getFirstLastFocusables(), firstElement = _c[0], lastElement = _c[1];
31
+ var _a = getFirstLastFocusables(), firstElement = _a[0], lastElement = _a[1];
34
32
  if (event.relatedTarget === lastElement) {
35
- (_a = firstElement) === null || _a === void 0 ? void 0 : _a.focus();
33
+ firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
36
34
  }
37
35
  else {
38
- (_b = lastElement) === null || _b === void 0 ? void 0 : _b.focus();
36
+ lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
39
37
  }
40
38
  };
41
39
  return (React.createElement("div", null,
@@ -37,7 +37,7 @@ export var InputContainer = function (props) {
37
37
  return (React.createElement(Element, __assign({ className: cx('iui-input-container', (_a = {
38
38
  'iui-disabled': disabled
39
39
  },
40
- _a["iui-" + status] = !!status,
40
+ _a["iui-".concat(status)] = !!status,
41
41
  _a['iui-inline-label'] = isLabelInline,
42
42
  _a['iui-inline-icon'] = isIconInline,
43
43
  _a['iui-with-message'] = (!!message || !!icon || !!statusMessage) && !isLabelInline,
@@ -38,7 +38,7 @@ export var MiddleTextTruncation = function (props) {
38
38
  var _b = useOverflow(text), ref = _b[0], visibleCount = _b[1];
39
39
  var truncatedText = React.useMemo(function () {
40
40
  if (visibleCount < text.length) {
41
- return "" + text.substr(0, visibleCount - endCharsCount - ELLIPSIS_CHAR.length) + ELLIPSIS_CHAR + text.substr(text.length - endCharsCount);
41
+ return "".concat(text.substr(0, visibleCount - endCharsCount - ELLIPSIS_CHAR.length)).concat(ELLIPSIS_CHAR).concat(text.substr(text.length - endCharsCount));
42
42
  }
43
43
  else {
44
44
  return text;
@@ -72,7 +72,19 @@ export var Popover = React.forwardRef(function (props, ref) {
72
72
  };
73
73
  }
74
74
  else {
75
- computedProps.content = mounted ? props.content : '';
75
+ // Fixing issue where elements below Popover gets click events.
76
+ // Tippy uses react Portal, which propagates events by react tree, not dom tree.
77
+ // Read more: https://reactjs.org/docs/portals.html#event-bubbling-through-portals
78
+ var clonedContent = React.isValidElement(props.content)
79
+ ? React.cloneElement(props.content, {
80
+ onClick: function (e) {
81
+ var _a, _b;
82
+ e.stopPropagation();
83
+ (_b = (_a = props.content.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
84
+ },
85
+ })
86
+ : props.content;
87
+ computedProps.content = mounted ? clonedContent : '';
76
88
  }
77
89
  return React.createElement(Tippy, __assign({}, computedProps, { ref: refs }));
78
90
  });
@@ -131,7 +131,7 @@ export var VirtualScroll = React.forwardRef(function (_a, ref) {
131
131
  if (!parentRef.current) {
132
132
  return;
133
133
  }
134
- parentRef.current.style.transform = "translateY(" + getTranslateValue(childHeight.current, startIndex) + "px)";
134
+ parentRef.current.style.transform = "translateY(".concat(getTranslateValue(childHeight.current, startIndex), "px)");
135
135
  }, [bufferSize, itemsLength]);
136
136
  var removeScrollListener = React.useCallback(function () {
137
137
  var _a, _b;
@@ -31,17 +31,17 @@ export var WithCSSTransition = function (props) {
31
31
  var expandedSize = React.useRef(0);
32
32
  var dimensionCamelCase = dimension === 'height' ? 'Height' : 'Width';
33
33
  return (React.createElement(CSSTransition, __assign({ in: visible, timeout: 200, unmountOnExit: true, onEnter: function (node) {
34
- node.style["min" + dimensionCamelCase] = 'initial';
34
+ node.style["min".concat(dimensionCamelCase)] = 'initial';
35
35
  node.style[dimension] = '0px';
36
36
  }, onEntering: function (node) {
37
- node.style[dimension] = expandedSize.current + "px";
37
+ node.style[dimension] = "".concat(expandedSize.current, "px");
38
38
  }, onEntered: function (node) {
39
- node.style["min" + dimensionCamelCase] = '';
39
+ node.style["min".concat(dimensionCamelCase)] = '';
40
40
  node.style[dimension] = '';
41
41
  }, onExit: function (node) {
42
- node.style[dimension] = expandedSize.current + "px";
42
+ node.style[dimension] = "".concat(expandedSize.current, "px");
43
43
  }, onExiting: function (node) {
44
- node.style["min" + dimensionCamelCase] = 'initial';
44
+ node.style["min".concat(dimensionCamelCase)] = 'initial';
45
45
  node.style[dimension] = '0px';
46
46
  }, classNames: 'iui' }, rest), React.cloneElement(children, {
47
47
  ref: function (el) {
@@ -24,7 +24,7 @@ export var getFocusableElements = function (container) {
24
24
  if (!container) {
25
25
  return [];
26
26
  }
27
- var elements = container.querySelectorAll(tabbableElementsSelector + ", [tabindex=\"-1\"]");
27
+ var elements = container.querySelectorAll("".concat(tabbableElementsSelector, ", [tabindex=\"-1\"]"));
28
28
  return Array.from(elements).filter(function (el) {
29
29
  return !el.hasAttribute('disabled') &&
30
30
  !el.classList.contains('iui-disabled') &&
@@ -61,15 +61,15 @@ export var useOverflow = function (items, disabled, orientation) {
61
61
  return;
62
62
  }
63
63
  var dimension = orientation === 'horizontal' ? 'Width' : 'Height';
64
- var availableSize = containerRef.current["offset" + dimension];
65
- var requiredSize = containerRef.current["scroll" + dimension];
64
+ var availableSize = containerRef.current["offset".concat(dimension)];
65
+ var requiredSize = containerRef.current["scroll".concat(dimension)];
66
66
  if (availableSize < requiredSize) {
67
67
  var avgItemSize = requiredSize / visibleCount;
68
68
  var visibleItems = Math.floor(availableSize / avgItemSize);
69
69
  setVisibleCount(visibleItems);
70
70
  }
71
71
  else if (needsFullRerender.current) {
72
- var childrenSize = Array.from(containerRef.current.children).reduce(function (sum, child) { return sum + child["offset" + dimension]; }, 0);
72
+ var childrenSize = Array.from(containerRef.current.children).reduce(function (sum, child) { return sum + child["offset".concat(dimension)]; }, 0);
73
73
  var avgItemSize = childrenSize / visibleCount;
74
74
  var visibleItems = Math.floor(availableSize / avgItemSize);
75
75
  // Doubling the visible items to overflow the container. Just to be safe.
@@ -75,5 +75,5 @@ var applyTheme = function (theme, _a) {
75
75
  if (currentTheme) {
76
76
  classList.remove(currentTheme);
77
77
  }
78
- classList.add("iui-theme-" + theme + (highContrast ? '-hc' : ''));
78
+ classList.add("iui-theme-".concat(theme).concat(highContrast ? '-hc' : ''));
79
79
  };
@@ -2,9 +2,22 @@
2
2
  declare module 'react-table' {
3
3
  type FieldType = 'text' | 'number' | 'date' | string;
4
4
  type CellRendererProps<D extends object = {}> = {
5
+ /**
6
+ * Cell HTML props passed from the Table.
7
+ */
5
8
  cellElementProps: TableCellProps;
9
+ /**
10
+ * Table specific cell props like `column`, `row`.
11
+ */
6
12
  cellProps: CellProps<D>;
13
+ /**
14
+ * Cell's content.
15
+ */
7
16
  children: React.ReactNode;
17
+ /**
18
+ * Function that returns whether the cell is disabled.
19
+ */
20
+ isDisabled?: (rowData: D) => boolean;
8
21
  };
9
22
  interface TableOptions<D extends object = {}> extends Omit<UseTableOptions<D>, 'data'>, UseRowSelectOptions<D>, UseExpandedOptions<D>, UseFiltersOptions<D>, UsePaginationOptions<D>, Omit<UseResizeColumnsOptions<D>, 'disableResizing'>, UseSortByOptions<D> {
10
23
  /**
@@ -73,6 +86,11 @@ declare module 'react-table' {
73
86
  * @default false
74
87
  */
75
88
  disableReordering?: boolean;
89
+ /**
90
+ * If true, column's visibility cannot be toggled.
91
+ * @default false
92
+ */
93
+ disableToggleVisibility?: boolean;
76
94
  }
77
95
  interface ColumnInstance<D extends object = {}> extends UseFiltersColumnProps<D>, UseGroupByColumnProps<D>, UseResizeColumnsColumnProps<D>, UseSortByColumnProps<D> {
78
96
  originalWidth: number;
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "1.35.0",
3
+ "version": "1.37.1",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "cjs/index.js",
7
7
  "module": "esm/index.js",
8
8
  "typings": "cjs/index.d.ts",
9
+ "files": [
10
+ "cjs",
11
+ "esm",
12
+ "CHANGELOG.md",
13
+ "LICENSE.md"
14
+ ],
9
15
  "description": "A react implementation of our iTwinUI UX standards",
10
16
  "homepage": "https://github.com/iTwin/iTwinUI-react",
11
17
  "keywords": [
@@ -23,24 +29,24 @@
23
29
  "ux"
24
30
  ],
25
31
  "scripts": {
26
- "build": "yarn clean && yarn mkdirp lib/ && yarn copy-files && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json",
27
- "build:watch": "yarn clean && yarn mkdirp lib/ && yarn copy-files && concurrently \"tsc -p tsconfig.cjs.json --watch\" \"tsc -p tsconfig.esm.json --watch\"",
28
- "clean": "yarn clean:coverage && yarn clean:lib",
32
+ "build": "yarn clean && yarn copy-files && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json",
33
+ "build:watch": "yarn clean && yarn copy-files && concurrently \"tsc -p tsconfig.cjs.json --watch\" \"tsc -p tsconfig.esm.json --watch\"",
34
+ "clean": "yarn clean:coverage && rimraf esm && rimraf cjs",
29
35
  "clean:coverage": "rimraf coverage",
30
- "clean:lib": "rimraf lib",
31
36
  "test": "jest",
32
37
  "test:watch": "jest --watch",
33
38
  "createComponent": "node scripts/createComponent.js",
34
- "pretty": "prettier --config .prettierrc \"scripts/**/*\" src/{__tests__,core,style,utils}/**/*{tsx,ts,jsx,js,css,scss} --write",
35
- "lint": "eslint */**/*.{js,ts,tsx} --max-warnings=0",
39
+ "format": "prettier --config .prettierrc **/*.{tsx,ts,js} --ignore-path .gitignore --write",
40
+ "lint": "eslint \"**/*.{js,ts,tsx}\" --max-warnings=0",
36
41
  "lint:fix": "yarn lint --fix && yarn lint:copyright --fix */**/*.{js,ts,tsx}",
37
42
  "lint:copyright": "node scripts/copyrightLinter.js",
38
- "copy-files": "cpx package.json lib && cpx \"{README,LICENSE,CHANGELOG}.md \" lib",
43
+ "copy-files": "cpx \"../../{README,LICENSE}.md\" .",
39
44
  "storybook": "start-storybook -p 6006",
45
+ "dev": "yarn storybook",
40
46
  "build-storybook": "build-storybook"
41
47
  },
42
48
  "dependencies": {
43
- "@itwin/itwinui-css": "^0.53.3",
49
+ "@itwin/itwinui-css": "^0.55.0",
44
50
  "@itwin/itwinui-icons-react": "^1.5.0",
45
51
  "@itwin/itwinui-illustrations-react": "^1.0.1",
46
52
  "@tippyjs/react": "^4.2.5",
@@ -73,18 +79,13 @@
73
79
  "@types/react": "^17.0.3",
74
80
  "@types/react-dom": "^17.0.3",
75
81
  "@types/react-transition-group": "^2.9.2",
76
- "@typescript-eslint/eslint-plugin": "^4.31.1",
77
- "@typescript-eslint/parser": "^4.31.1",
82
+ "@typescript-eslint/eslint-plugin": "^5.17.0",
83
+ "@typescript-eslint/parser": "^5.17.0",
78
84
  "babel-loader": "^8.2.2",
79
85
  "concurrently": "^5.3.0",
86
+ "configs": "*",
80
87
  "cpx": "^1.5.0",
81
88
  "creevey": "^0.8.0-beta.0",
82
- "eslint": "^7.32.0",
83
- "eslint-config-prettier": "^8.3.0",
84
- "eslint-plugin-prettier": "^4.0.0",
85
- "eslint-plugin-react": "^7.25.1",
86
- "eslint-plugin-react-hooks": "^4.2.0",
87
- "eslint-plugin-storybook": "^0.5.7",
88
89
  "fast-glob": "^3.2.5",
89
90
  "husky": "^4.0.0",
90
91
  "inquirer": "^6.2.2",
@@ -94,14 +95,13 @@
94
95
  "lint-staged": "^12.1.2",
95
96
  "markdown-to-jsx": "6.11.4",
96
97
  "mkdirp": "^1.0.4",
97
- "prettier": "2.2.1",
98
98
  "react": "^17.0.2",
99
99
  "react-dom": "^17.0.2",
100
100
  "rimraf": "^2.6.2",
101
101
  "storybook-dark-mode": "^1.0.9",
102
102
  "tippy.js": "^6.3.1",
103
103
  "ts-jest": "^27.0.4",
104
- "ts-loader": "^8.0.1",
104
+ "ts-loader": "^9.2.8",
105
105
  "ts-node": "^8.0.2",
106
106
  "typescript": "^4.4.3",
107
107
  "webpack": "5"
@@ -134,10 +134,11 @@
134
134
  "lint-staged": {
135
135
  "*.{tsx,ts,jsx,js}": [
136
136
  "prettier --write",
137
- "eslint --fix",
137
+ "eslint --max-warnings=0 --fix",
138
138
  "yarn lint:copyright --fix"
139
139
  ]
140
140
  },
141
+ "prettier": "configs/prettier-config",
141
142
  "sideEffects": [
142
143
  "**/*.scss",
143
144
  "**/*.css"