@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.
- package/CHANGELOG.md +34 -0
- package/cjs/core/Alert/Alert.js +1 -1
- package/cjs/core/Badge/Badge.js +1 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/cjs/core/Buttons/Button/Button.js +2 -2
- package/cjs/core/Buttons/IconButton/IconButton.js +2 -2
- package/cjs/core/Carousel/Carousel.js +1 -1
- package/cjs/core/Carousel/CarouselDotsList.js +1 -1
- package/cjs/core/Carousel/CarouselSlider.js +1 -1
- package/cjs/core/Checkbox/Checkbox.js +1 -1
- package/cjs/core/ColorPicker/ColorBuilder.js +3 -3
- package/cjs/core/ColorPicker/ColorInputPanel.js +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +1 -1
- package/cjs/core/ComboBox/ComboBox.js +9 -6
- package/cjs/core/DatePicker/DatePicker.js +2 -2
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/cjs/core/Footer/Footer.js +2 -2
- package/cjs/core/Header/HeaderBreadcrumbs.js +1 -1
- package/cjs/core/Header/HeaderButton.js +1 -0
- package/cjs/core/InformationPanel/InformationPanel.js +2 -2
- package/cjs/core/Input/Input.js +1 -1
- package/cjs/core/Menu/Menu.js +8 -3
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
- package/cjs/core/Radio/Radio.js +1 -1
- package/cjs/core/Select/Select.js +3 -3
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +50 -0
- package/cjs/core/SkipToContentLink/index.d.ts +4 -0
- package/cjs/core/SkipToContentLink/index.js +10 -0
- package/cjs/core/Slider/Slider.js +1 -1
- package/cjs/core/Slider/Thumb.js +1 -1
- package/cjs/core/Slider/Track.js +1 -1
- package/cjs/core/Surface/Surface.d.ts +32 -0
- package/cjs/core/Surface/Surface.js +70 -0
- package/cjs/core/Surface/index.d.ts +4 -0
- package/cjs/core/Surface/index.js +10 -0
- package/cjs/core/Table/Table.d.ts +7 -0
- package/cjs/core/Table/Table.js +44 -21
- package/cjs/core/Table/TableCell.js +3 -3
- package/cjs/core/Table/TablePaginator.js +6 -6
- package/cjs/core/Table/TableRowMemoized.js +13 -8
- package/cjs/core/Table/actionHandlers/index.d.ts +2 -1
- package/cjs/core/Table/actionHandlers/index.js +5 -1
- package/cjs/core/Table/cells/DefaultCell.d.ts +1 -1
- package/cjs/core/Table/cells/DefaultCell.js +5 -2
- package/cjs/core/Table/columns/actionColumn.d.ts +35 -0
- package/cjs/core/Table/columns/actionColumn.js +91 -0
- package/cjs/core/Table/columns/expanderColumn.d.ts +47 -0
- package/cjs/core/Table/columns/expanderColumn.js +81 -0
- package/cjs/core/Table/columns/index.d.ts +3 -0
- package/cjs/core/Table/columns/index.js +15 -0
- package/cjs/core/Table/columns/selectionColumn.d.ts +35 -0
- package/cjs/core/Table/columns/selectionColumn.js +67 -0
- package/cjs/core/Table/hooks/index.d.ts +2 -2
- package/cjs/core/Table/hooks/index.js +1 -3
- package/cjs/core/Table/hooks/useExpanderCell.d.ts +0 -1
- package/cjs/core/Table/hooks/useExpanderCell.js +25 -39
- package/cjs/core/Table/hooks/useResizeColumns.js +8 -2
- package/cjs/core/Table/hooks/useSelectionCell.d.ts +1 -2
- package/cjs/core/Table/hooks/useSelectionCell.js +8 -53
- package/cjs/core/Table/index.d.ts +1 -0
- package/cjs/core/Table/index.js +5 -1
- package/cjs/core/Table/utils.js +5 -5
- package/cjs/core/Tabs/Tabs.d.ts +1 -1
- package/cjs/core/Tabs/Tabs.js +7 -8
- package/cjs/core/Tag/Tag.js +6 -3
- package/cjs/core/Tag/TagContainer.js +1 -1
- package/cjs/core/Tile/Tile.d.ts +6 -2
- package/cjs/core/Tile/Tile.js +8 -3
- package/cjs/core/Toast/Toast.js +3 -3
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +2 -2
- package/cjs/core/Typography/Anchor/Anchor.d.ts +1 -0
- package/cjs/core/Typography/Anchor/Anchor.js +1 -0
- package/cjs/core/Typography/Text/Text.js +1 -1
- package/cjs/core/UserIcon/UserIcon.js +2 -2
- package/cjs/core/UserIconGroup/UserIconGroup.js +3 -3
- package/cjs/core/Wizard/Step.js +1 -1
- package/cjs/core/Wizard/Wizard.js +1 -1
- package/cjs/core/index.d.ts +5 -1
- package/cjs/core/index.js +9 -2
- package/cjs/core/utils/color/ColorValue.js +11 -11
- package/cjs/core/utils/color/index.js +5 -1
- package/cjs/core/utils/components/FocusTrap.js +6 -8
- package/cjs/core/utils/components/InputContainer.js +1 -1
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -1
- package/cjs/core/utils/components/Popover.js +13 -1
- package/cjs/core/utils/components/VirtualScroll.js +1 -1
- package/cjs/core/utils/components/WithCSSTransition.js +5 -5
- package/cjs/core/utils/components/index.js +5 -1
- package/cjs/core/utils/functions/focusable.js +1 -1
- package/cjs/core/utils/functions/index.js +5 -1
- package/cjs/core/utils/hooks/index.js +5 -1
- package/cjs/core/utils/hooks/useOverflow.js +3 -3
- package/cjs/core/utils/hooks/useTheme.js +1 -1
- package/cjs/core/utils/index.js +5 -1
- package/cjs/index.js +5 -1
- package/cjs/types/react-table-config.d.ts +18 -0
- package/esm/core/Alert/Alert.js +1 -1
- package/esm/core/Badge/Badge.js +1 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/esm/core/Buttons/Button/Button.js +2 -2
- package/esm/core/Buttons/IconButton/IconButton.js +2 -2
- package/esm/core/Carousel/Carousel.js +1 -1
- package/esm/core/Carousel/CarouselDotsList.js +1 -1
- package/esm/core/Carousel/CarouselSlider.js +1 -1
- package/esm/core/Checkbox/Checkbox.js +1 -1
- package/esm/core/ColorPicker/ColorBuilder.js +3 -3
- package/esm/core/ColorPicker/ColorInputPanel.js +1 -1
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +1 -1
- package/esm/core/ComboBox/ComboBox.js +9 -6
- package/esm/core/DatePicker/DatePicker.js +2 -2
- package/esm/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/esm/core/Footer/Footer.js +2 -2
- package/esm/core/Header/HeaderBreadcrumbs.js +1 -1
- package/esm/core/Header/HeaderButton.js +1 -0
- package/esm/core/InformationPanel/InformationPanel.js +2 -2
- package/esm/core/Input/Input.js +1 -1
- package/esm/core/Menu/Menu.js +8 -3
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
- package/esm/core/Radio/Radio.js +1 -1
- package/esm/core/Select/Select.js +3 -3
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +33 -0
- package/esm/core/SkipToContentLink/SkipToContentLink.js +44 -0
- package/esm/core/SkipToContentLink/index.d.ts +4 -0
- package/esm/core/SkipToContentLink/index.js +6 -0
- package/esm/core/Slider/Slider.js +1 -1
- package/esm/core/Slider/Thumb.js +1 -1
- package/esm/core/Slider/Track.js +1 -1
- package/esm/core/Surface/Surface.d.ts +32 -0
- package/esm/core/Surface/Surface.js +64 -0
- package/esm/core/Surface/index.d.ts +4 -0
- package/esm/core/Surface/index.js +6 -0
- package/esm/core/Table/Table.d.ts +7 -0
- package/esm/core/Table/Table.js +40 -17
- package/esm/core/Table/TableCell.js +2 -2
- package/esm/core/Table/TablePaginator.js +6 -6
- package/esm/core/Table/TableRowMemoized.js +13 -8
- package/esm/core/Table/actionHandlers/index.d.ts +2 -1
- package/esm/core/Table/actionHandlers/index.js +2 -1
- package/esm/core/Table/cells/DefaultCell.d.ts +1 -1
- package/esm/core/Table/cells/DefaultCell.js +5 -2
- package/esm/core/Table/columns/actionColumn.d.ts +35 -0
- package/esm/core/Table/columns/actionColumn.js +84 -0
- package/esm/core/Table/columns/expanderColumn.d.ts +47 -0
- package/esm/core/Table/columns/expanderColumn.js +74 -0
- package/esm/core/Table/columns/index.d.ts +3 -0
- package/esm/core/Table/columns/index.js +7 -0
- package/esm/core/Table/columns/selectionColumn.d.ts +35 -0
- package/esm/core/Table/columns/selectionColumn.js +60 -0
- package/esm/core/Table/hooks/index.d.ts +2 -2
- package/esm/core/Table/hooks/index.js +2 -2
- package/esm/core/Table/hooks/useExpanderCell.d.ts +0 -1
- package/esm/core/Table/hooks/useExpanderCell.js +24 -35
- package/esm/core/Table/hooks/useResizeColumns.js +8 -2
- package/esm/core/Table/hooks/useSelectionCell.d.ts +1 -2
- package/esm/core/Table/hooks/useSelectionCell.js +7 -49
- package/esm/core/Table/index.d.ts +1 -0
- package/esm/core/Table/index.js +1 -0
- package/esm/core/Table/utils.js +5 -5
- package/esm/core/Tabs/Tabs.d.ts +1 -1
- package/esm/core/Tabs/Tabs.js +7 -8
- package/esm/core/Tag/Tag.js +6 -3
- package/esm/core/Tag/TagContainer.js +1 -1
- package/esm/core/Tile/Tile.d.ts +6 -2
- package/esm/core/Tile/Tile.js +8 -3
- package/esm/core/Toast/Toast.js +3 -3
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -2
- package/esm/core/Typography/Anchor/Anchor.d.ts +1 -0
- package/esm/core/Typography/Anchor/Anchor.js +1 -0
- package/esm/core/Typography/Text/Text.js +1 -1
- package/esm/core/UserIcon/UserIcon.js +2 -2
- package/esm/core/UserIconGroup/UserIconGroup.js +3 -3
- package/esm/core/Wizard/Step.js +1 -1
- package/esm/core/Wizard/Wizard.js +1 -1
- package/esm/core/index.d.ts +5 -1
- package/esm/core/index.js +3 -1
- package/esm/core/utils/color/ColorValue.js +11 -11
- package/esm/core/utils/components/FocusTrap.js +6 -8
- package/esm/core/utils/components/InputContainer.js +1 -1
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -1
- package/esm/core/utils/components/Popover.js +13 -1
- package/esm/core/utils/components/VirtualScroll.js +1 -1
- package/esm/core/utils/components/WithCSSTransition.js +5 -5
- package/esm/core/utils/functions/focusable.js +1 -1
- package/esm/core/utils/hooks/useOverflow.js +3 -3
- package/esm/core/utils/hooks/useTheme.js +1 -1
- package/esm/types/react-table-config.d.ts +18 -0
- 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 "#"
|
|
331
|
+
return "#".concat("00000000".concat(value.toString(16)).slice(-8));
|
|
332
332
|
}
|
|
333
|
-
return "#"
|
|
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
|
|
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("
|
|
496
|
+
return "rgba(".concat(rgbString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
497
497
|
}
|
|
498
|
-
return "rgb("
|
|
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)
|
|
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("
|
|
507
|
+
return "hsla(".concat(hslString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
508
508
|
}
|
|
509
|
-
return "hsl("
|
|
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
|
|
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("
|
|
518
|
+
return "hsva(".concat(hsvString, ", ").concat(ColorValue.getFormattedColorNumber(alpha, 2), ")");
|
|
519
519
|
}
|
|
520
|
-
return "hsv("
|
|
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,
|
|
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
|
-
|
|
24
|
+
lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
|
|
26
25
|
}
|
|
27
26
|
else {
|
|
28
|
-
|
|
27
|
+
firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
|
29
28
|
}
|
|
30
29
|
};
|
|
31
30
|
var onLastFocus = function (event) {
|
|
32
|
-
var _a,
|
|
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
|
-
|
|
33
|
+
firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
|
36
34
|
}
|
|
37
35
|
else {
|
|
38
|
-
|
|
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-"
|
|
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 ""
|
|
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
|
-
|
|
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("
|
|
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"
|
|
34
|
+
node.style["min".concat(dimensionCamelCase)] = 'initial';
|
|
35
35
|
node.style[dimension] = '0px';
|
|
36
36
|
}, onEntering: function (node) {
|
|
37
|
-
node.style[dimension] = expandedSize.current
|
|
37
|
+
node.style[dimension] = "".concat(expandedSize.current, "px");
|
|
38
38
|
}, onEntered: function (node) {
|
|
39
|
-
node.style["min"
|
|
39
|
+
node.style["min".concat(dimensionCamelCase)] = '';
|
|
40
40
|
node.style[dimension] = '';
|
|
41
41
|
}, onExit: function (node) {
|
|
42
|
-
node.style[dimension] = expandedSize.current
|
|
42
|
+
node.style[dimension] = "".concat(expandedSize.current, "px");
|
|
43
43
|
}, onExiting: function (node) {
|
|
44
|
-
node.style["min"
|
|
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
|
|
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"
|
|
65
|
-
var requiredSize = containerRef.current["scroll"
|
|
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"
|
|
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.
|
|
@@ -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.
|
|
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
|
|
27
|
-
"build:watch": "yarn clean && yarn
|
|
28
|
-
"clean": "yarn clean:coverage &&
|
|
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
|
-
"
|
|
35
|
-
"lint": "eslint
|
|
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
|
|
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.
|
|
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": "^
|
|
77
|
-
"@typescript-eslint/parser": "^
|
|
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": "^
|
|
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"
|