@itwin/itwinui-react 1.37.0 → 1.37.3
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 +19 -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/InformationPanel/InformationPanel.js +2 -2
- package/cjs/core/Input/Input.js +1 -1
- 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/Slider/Slider.js +1 -1
- package/cjs/core/Slider/Thumb.js +16 -2
- package/cjs/core/Slider/Track.js +24 -13
- package/cjs/core/Surface/Surface.js +1 -1
- package/cjs/core/Table/Table.js +18 -6
- package/cjs/core/Table/TablePaginator.js +6 -6
- package/cjs/core/Table/TableRowMemoized.js +1 -1
- package/cjs/core/Table/cells/EditableCell.js +2 -1
- package/cjs/core/Table/columns/actionColumn.js +2 -2
- 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/TagContainer.js +1 -1
- package/cjs/core/Tile/Tile.js +1 -1
- package/cjs/core/Toast/Toast.js +2 -2
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +2 -2
- 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/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/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/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/InformationPanel/InformationPanel.js +2 -2
- package/esm/core/Input/Input.js +1 -1
- 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/Slider/Slider.js +1 -1
- package/esm/core/Slider/Thumb.js +16 -2
- package/esm/core/Slider/Track.js +24 -13
- package/esm/core/Surface/Surface.js +1 -1
- package/esm/core/Table/Table.js +18 -6
- package/esm/core/Table/TablePaginator.js +6 -6
- package/esm/core/Table/TableRowMemoized.js +1 -1
- package/esm/core/Table/cells/EditableCell.js +2 -1
- package/esm/core/Table/columns/actionColumn.js +2 -2
- 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/TagContainer.js +1 -1
- package/esm/core/Tile/Tile.js +1 -1
- package/esm/core/Toast/Toast.js +2 -2
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -2
- 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/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/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/package.json +21 -20
package/esm/core/Table/Table.js
CHANGED
|
@@ -43,6 +43,16 @@ import { SELECTION_CELL_ID } from './columns';
|
|
|
43
43
|
var singleRowSelectedAction = 'singleRowSelected';
|
|
44
44
|
export var tableResizeStartAction = 'tableResizeStart';
|
|
45
45
|
var tableResizeEndAction = 'tableResizeEnd';
|
|
46
|
+
var flattenColumns = function (columns) {
|
|
47
|
+
var flatColumns = [];
|
|
48
|
+
columns.forEach(function (column) {
|
|
49
|
+
flatColumns.push(column);
|
|
50
|
+
if (column.columns) {
|
|
51
|
+
flatColumns.push.apply(flatColumns, flattenColumns(column.columns));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return flatColumns;
|
|
55
|
+
};
|
|
46
56
|
/**
|
|
47
57
|
* Table based on [react-table](https://react-table.tanstack.com/docs/api/overview).
|
|
48
58
|
* @example
|
|
@@ -87,10 +97,9 @@ var tableResizeEndAction = 'tableResizeEnd';
|
|
|
87
97
|
*/
|
|
88
98
|
export var Table = function (props) {
|
|
89
99
|
var _a;
|
|
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"]);
|
|
100
|
+
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.selectionMode, selectionMode = _d === void 0 ? 'multi' : _d, _e = props.isSortable, isSortable = _e === void 0 ? false : _e, onSort = props.onSort, stateReducer = props.stateReducer, onBottomReached = props.onBottomReached, onRowInViewport = props.onRowInViewport, _f = props.intersectionMargin, intersectionMargin = _f === void 0 ? 300 : _f, subComponent = props.subComponent, onExpand = props.onExpand, onFilter = props.onFilter, emptyFilteredTableContent = props.emptyFilteredTableContent, filterFunctions = props.filterTypes, expanderCell = props.expanderCell, isRowDisabled = props.isRowDisabled, rowProps = props.rowProps, _g = props.density, density = _g === void 0 ? 'default' : _g, _h = props.selectSubRows, selectSubRows = _h === void 0 ? true : _h, getSubRows = props.getSubRows, _j = props.selectRowOnClick, selectRowOnClick = _j === void 0 ? true : _j, paginatorRenderer = props.paginatorRenderer, _k = props.pageSize, pageSize = _k === void 0 ? 25 : _k, _l = props.isResizable, isResizable = _l === void 0 ? false : _l, _m = props.styleType, styleType = _m === void 0 ? 'default' : _m, _o = props.enableVirtualization, enableVirtualization = _o === void 0 ? false : _o, _p = props.enableColumnReordering, enableColumnReordering = _p === void 0 ? false : _p, 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
101
|
useTheme();
|
|
93
|
-
var
|
|
102
|
+
var _q = React.useState(), ownerDocument = _q[0], setOwnerDocument = _q[1];
|
|
94
103
|
var defaultColumn = React.useMemo(function () { return ({
|
|
95
104
|
maxWidth: 0,
|
|
96
105
|
minWidth: 0,
|
|
@@ -103,7 +112,10 @@ export var Table = function (props) {
|
|
|
103
112
|
onBottomReachedRef.current = onBottomReached;
|
|
104
113
|
onRowInViewportRef.current = onRowInViewport;
|
|
105
114
|
}, [onBottomReached, onRowInViewport]);
|
|
106
|
-
var hasManualSelectionColumn =
|
|
115
|
+
var hasManualSelectionColumn = React.useMemo(function () {
|
|
116
|
+
var flatColumns = flattenColumns(columns);
|
|
117
|
+
return flatColumns.some(function (column) { return column.id === SELECTION_CELL_ID; });
|
|
118
|
+
}, [columns]);
|
|
107
119
|
var tableStateReducer = React.useCallback(function (newState, action, previousState, instance) {
|
|
108
120
|
switch (action.type) {
|
|
109
121
|
case TableActions.toggleSortBy:
|
|
@@ -276,7 +288,7 @@ export var Table = function (props) {
|
|
|
276
288
|
resizeRef(element);
|
|
277
289
|
}
|
|
278
290
|
}, id: id }, getTableProps({
|
|
279
|
-
className: cx('iui-table', (_a = {}, _a["iui-"
|
|
291
|
+
className: cx('iui-table', (_a = {}, _a["iui-".concat(density)] = density !== 'default', _a), className),
|
|
280
292
|
style: style,
|
|
281
293
|
}), ariaDataAttributes),
|
|
282
294
|
React.createElement("div", { className: 'iui-table-header', ref: headerRef }, headerGroups.slice(1).map(function (headerGroup) {
|
|
@@ -293,7 +305,7 @@ export var Table = function (props) {
|
|
|
293
305
|
} }),
|
|
294
306
|
column.render('Header'),
|
|
295
307
|
(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(
|
|
308
|
+
data.length !== 0 && column.canSort && (React.createElement("div", { className: 'iui-cell-end-icon' }, column.isSorted && column.isSortedDesc ? (React.createElement(SvgSortDown, { className: 'iui-icon iui-sort', "aria-hidden": true })) : (React.createElement(SvgSortUp, { className: 'iui-icon iui-sort', "aria-hidden": true })))),
|
|
297
309
|
isResizable &&
|
|
298
310
|
column.isResizerVisible &&
|
|
299
311
|
index !== headerGroup.headers.length - 1 && (React.createElement("div", __assign({}, column.getResizerProps(), { className: 'iui-resizer' }),
|
|
@@ -34,15 +34,15 @@ import { ProgressRadial } from '../ProgressIndicators';
|
|
|
34
34
|
import { MenuItem } from '../Menu';
|
|
35
35
|
import { getBoundedValue, useTheme, useOverflow, useContainerWidth, } from '../utils';
|
|
36
36
|
var defaultLocalization = {
|
|
37
|
-
pageSizeLabel: function (size) { return size
|
|
37
|
+
pageSizeLabel: function (size) { return "".concat(size, " per page"); },
|
|
38
38
|
rangeLabel: function (startIndex, endIndex, totalRows, isLoading) {
|
|
39
39
|
return isLoading
|
|
40
|
-
? startIndex
|
|
41
|
-
: startIndex
|
|
40
|
+
? "".concat(startIndex, "-").concat(endIndex, "\u2026")
|
|
41
|
+
: "".concat(startIndex, "-").concat(endIndex, " of ").concat(totalRows);
|
|
42
42
|
},
|
|
43
43
|
previousPage: 'Previous page',
|
|
44
44
|
nextPage: 'Next page',
|
|
45
|
-
goToPageLabel: function (page) { return "Go to page "
|
|
45
|
+
goToPageLabel: function (page) { return "Go to page ".concat(page); },
|
|
46
46
|
rowsPerPageLabel: 'Rows per page',
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
@@ -66,12 +66,12 @@ export var TablePaginator = function (props) {
|
|
|
66
66
|
var needFocus = React.useRef(false);
|
|
67
67
|
var isMounted = React.useRef(false);
|
|
68
68
|
React.useEffect(function () {
|
|
69
|
-
var _a, _b
|
|
69
|
+
var _a, _b;
|
|
70
70
|
// Checking `isMounted.current` prevents from focusing on initial load.
|
|
71
71
|
// Checking `needFocus.current` prevents from focusing page when clicked on previous/next page.
|
|
72
72
|
if (isMounted.current && needFocus.current) {
|
|
73
73
|
var buttonToFocus = Array.from((_b = (_a = pageListRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.iui-paginator-page-button')) !== null && _b !== void 0 ? _b : []).find(function (el) { var _a; return ((_a = el.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === (focusedIndex + 1).toString(); });
|
|
74
|
-
|
|
74
|
+
buttonToFocus === null || buttonToFocus === void 0 ? void 0 : buttonToFocus.focus();
|
|
75
75
|
needFocus.current = false;
|
|
76
76
|
}
|
|
77
77
|
isMounted.current = true;
|
|
@@ -31,7 +31,7 @@ export var TableRow = function (props) {
|
|
|
31
31
|
isLast && ((_b = onBottomReached.current) === null || _b === void 0 ? void 0 : _b.call(onBottomReached));
|
|
32
32
|
}, [isLast, onBottomReached, onRowInViewport, row.original]);
|
|
33
33
|
var rowRef = useIntersection(onIntersect, {
|
|
34
|
-
rootMargin: intersectionMargin
|
|
34
|
+
rootMargin: "".concat(intersectionMargin, "px"),
|
|
35
35
|
});
|
|
36
36
|
var userRowProps = rowProps === null || rowProps === void 0 ? void 0 : rowProps(row);
|
|
37
37
|
var mergedProps = __assign(__assign(__assign({}, row.getRowProps({ style: { flex: "0 0 auto", minWidth: '100%' } })), userRowProps), {
|
|
@@ -36,7 +36,8 @@ import React from 'react';
|
|
|
36
36
|
* }
|
|
37
37
|
*/
|
|
38
38
|
export var EditableCell = function (props) {
|
|
39
|
-
var cellElementProps = props.cellElementProps, cellProps = props.cellProps, onCellEdit = props.onCellEdit, children = props.children, rest = __rest(props, ["cellElementProps", "cellProps", "onCellEdit", "children"]);
|
|
39
|
+
var cellElementProps = props.cellElementProps, cellProps = props.cellProps, onCellEdit = props.onCellEdit, children = props.children, isDisabled = props.isDisabled, rest = __rest(props, ["cellElementProps", "cellProps", "onCellEdit", "children", "isDisabled"]);
|
|
40
|
+
isDisabled; // To omit and prevent eslint error.
|
|
40
41
|
var sanitizeString = function (text) {
|
|
41
42
|
return text.replace(/(\r\n|\n|\r)+/gm, ' ');
|
|
42
43
|
};
|
|
@@ -72,8 +72,8 @@ export var ActionColumn = function (_a) {
|
|
|
72
72
|
// Triggers an update to resize the widths of all visible columns
|
|
73
73
|
dispatch({ type: tableResizeStartAction });
|
|
74
74
|
};
|
|
75
|
-
return (React.createElement(MenuItem, { key: column.id, icon: React.createElement(Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: function (e) { return e.stopPropagation(); }, onChange: onClick, "aria-labelledby": "iui-column-"
|
|
76
|
-
React.createElement("div", { id: "iui-column-"
|
|
75
|
+
return (React.createElement(MenuItem, { key: column.id, icon: React.createElement(Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: function (e) { return e.stopPropagation(); }, onChange: onClick, "aria-labelledby": "iui-column-".concat(column.id) }), onClick: onClick, disabled: column.disableToggleVisibility },
|
|
76
|
+
React.createElement("div", { id: "iui-column-".concat(column.id) }, column.render('Header'))));
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
return (React.createElement(DropdownMenu, { menuItems: headerCheckBoxes, onHide: function () { return setIsOpen(false); }, onShow: function () { return setIsOpen(true); } },
|
package/esm/core/Table/utils.js
CHANGED
|
@@ -2,21 +2,21 @@ export var getCellStyle = function (column, isTableResizing) {
|
|
|
2
2
|
var style = {};
|
|
3
3
|
style.flex = "1 1 145px";
|
|
4
4
|
if (column.width) {
|
|
5
|
-
var width = typeof column.width === 'string' ? column.width : column.width
|
|
5
|
+
var width = typeof column.width === 'string' ? column.width : "".concat(column.width, "px");
|
|
6
6
|
style.width = width;
|
|
7
7
|
// This allows flexbox to handle the width of the column on table resize
|
|
8
8
|
if (isTableResizing && column.canResize) {
|
|
9
|
-
style.flex = Number(column.width)
|
|
9
|
+
style.flex = "".concat(Number(column.width), " ").concat(Number(column.width), " ").concat(width);
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
style.flex = "0 0 "
|
|
12
|
+
style.flex = "0 0 ".concat(width);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
if (column.maxWidth) {
|
|
16
|
-
style.maxWidth = column.maxWidth
|
|
16
|
+
style.maxWidth = "".concat(column.maxWidth, "px");
|
|
17
17
|
}
|
|
18
18
|
if (column.minWidth) {
|
|
19
|
-
style.minWidth = column.minWidth
|
|
19
|
+
style.minWidth = "".concat(column.minWidth, "px");
|
|
20
20
|
}
|
|
21
21
|
return style;
|
|
22
22
|
};
|
package/esm/core/Tabs/Tabs.d.ts
CHANGED
package/esm/core/Tabs/Tabs.js
CHANGED
|
@@ -77,20 +77,19 @@ export var Tabs = function (props) {
|
|
|
77
77
|
var activeTab = tablistRef.current.children[currentActiveIndex];
|
|
78
78
|
var activeTabRect = activeTab.getBoundingClientRect();
|
|
79
79
|
setStripeProperties(__assign(__assign({}, (orientation === 'horizontal' && {
|
|
80
|
-
'--stripe-width': activeTabRect.width
|
|
81
|
-
'--stripe-left': activeTab.offsetLeft
|
|
80
|
+
'--stripe-width': "".concat(activeTabRect.width, "px"),
|
|
81
|
+
'--stripe-left': "".concat(activeTab.offsetLeft, "px"),
|
|
82
82
|
})), (orientation === 'vertical' && {
|
|
83
|
-
'--stripe-height': activeTabRect.height
|
|
84
|
-
'--stripe-top': activeTab.offsetTop
|
|
83
|
+
'--stripe-height': "".concat(activeTabRect.height, "px"),
|
|
84
|
+
'--stripe-top': "".concat(activeTab.offsetTop, "px"),
|
|
85
85
|
})));
|
|
86
86
|
}
|
|
87
87
|
}, [currentActiveIndex, type, orientation, tabsWidth]);
|
|
88
88
|
var _l = React.useState(), focusedIndex = _l[0], setFocusedIndex = _l[1];
|
|
89
89
|
React.useEffect(function () {
|
|
90
|
-
var _a;
|
|
91
90
|
if (tablistRef.current && focusedIndex !== undefined) {
|
|
92
91
|
var tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
|
|
93
|
-
|
|
92
|
+
tab === null || tab === void 0 ? void 0 : tab.focus();
|
|
94
93
|
}
|
|
95
94
|
}, [focusedIndex]);
|
|
96
95
|
var _m = React.useState(false), hasSublabel = _m[0], setHasSublabel = _m[1]; // used for setting size
|
|
@@ -167,8 +166,8 @@ export var Tabs = function (props) {
|
|
|
167
166
|
}
|
|
168
167
|
};
|
|
169
168
|
var isIE = !((_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, '--stripe-width', '100px'));
|
|
170
|
-
return (React.createElement("div", { className: cx('iui-tabs-wrapper', "iui-"
|
|
171
|
-
React.createElement("ul", __assign({ className: cx('iui-tabs', "iui-"
|
|
169
|
+
return (React.createElement("div", { className: cx('iui-tabs-wrapper', "iui-".concat(orientation), wrapperClassName), style: stripeProperties },
|
|
170
|
+
React.createElement("ul", __assign({ className: cx('iui-tabs', "iui-".concat(type), {
|
|
172
171
|
'iui-green': color === 'green',
|
|
173
172
|
'iui-animated': type !== 'default' && !isIE,
|
|
174
173
|
'iui-not-animated': isIE,
|
|
@@ -39,7 +39,7 @@ export var TagContainer = function (props) {
|
|
|
39
39
|
var className = props.className, children = props.children, overflow = props.overflow, _b = props.background, background = _b === void 0 ? 'none' : _b, rest = __rest(props, ["className", "children", "overflow", "background"]);
|
|
40
40
|
useTheme();
|
|
41
41
|
return (React.createElement("div", __assign({ className: cx('iui-tag-container', (_a = {},
|
|
42
|
-
_a["iui-"
|
|
42
|
+
_a["iui-".concat(overflow)] = !!overflow,
|
|
43
43
|
_a['iui-visible'] = background !== 'none',
|
|
44
44
|
_a), className) }, rest), children));
|
|
45
45
|
};
|
package/esm/core/Tile/Tile.js
CHANGED
|
@@ -63,7 +63,7 @@ export var Tile = function (props) {
|
|
|
63
63
|
'iui-actionable': isActionable,
|
|
64
64
|
}, className), tabIndex: isActionable ? 0 : undefined }, rest),
|
|
65
65
|
thumbnail && (React.createElement("div", { className: 'iui-tile-thumbnail' },
|
|
66
|
-
typeof thumbnail === 'string' ? (React.createElement("div", { className: 'iui-tile-thumbnail-picture', style: { backgroundImage: "url("
|
|
66
|
+
typeof thumbnail === 'string' ? (React.createElement("div", { className: 'iui-tile-thumbnail-picture', style: { backgroundImage: "url(".concat(thumbnail, ")") } })) : thumbnail && thumbnail.type === 'img' ? (React.cloneElement(thumbnail, {
|
|
67
67
|
className: 'iui-tile-thumbnail-picture',
|
|
68
68
|
})) : React.isValidElement(thumbnail) ? (React.cloneElement(thumbnail, {
|
|
69
69
|
className: cx('iui-thumbnail-icon', thumbnail.props.className),
|
package/esm/core/Toast/Toast.js
CHANGED
|
@@ -117,7 +117,7 @@ export var Toast = function (props) {
|
|
|
117
117
|
}, onExiting: function (node) {
|
|
118
118
|
var _a = calculateOutAnimation(node), translateX = _a.translateX, translateY = _a.translateY;
|
|
119
119
|
node.style.transform = animateOutTo
|
|
120
|
-
? "scale(0.9) translate("
|
|
120
|
+
? "scale(0.9) translate(".concat(translateX, "px,").concat(translateY, "px)")
|
|
121
121
|
: "scale(0.9)";
|
|
122
122
|
node.style.opacity = '0';
|
|
123
123
|
node.style.transitionDuration = animateOutTo ? '400ms' : '120ms';
|
|
@@ -133,7 +133,7 @@ export var Toast = function (props) {
|
|
|
133
133
|
export var ToastPresentation = function (props) {
|
|
134
134
|
var content = props.content, category = props.category, _a = props.type, type = _a === void 0 ? 'temporary' : _a, link = props.link, hasCloseButton = props.hasCloseButton, onClose = props.onClose, className = props.className, rest = __rest(props, ["content", "category", "type", "link", "hasCloseButton", "onClose", "className"]);
|
|
135
135
|
var StatusIcon = StatusIconMap[category];
|
|
136
|
-
return (React.createElement("div", __assign({ className: cx("iui-toast iui-"
|
|
136
|
+
return (React.createElement("div", __assign({ className: cx("iui-toast iui-".concat(category), className) }, rest),
|
|
137
137
|
React.createElement("div", { className: 'iui-status-area' }, React.createElement(StatusIcon, { className: 'iui-icon' })),
|
|
138
138
|
React.createElement("div", { className: 'iui-message' }, content),
|
|
139
139
|
link && (React.createElement("a", { className: 'iui-toast-anchor', onClick: link.onClick }, link.title)),
|
|
@@ -20,7 +20,7 @@ import Toast from './Toast';
|
|
|
20
20
|
export var ToastWrapper = function (props) {
|
|
21
21
|
var toasts = props.toasts, _a = props.placement, placement = _a === void 0 ? 'top' : _a;
|
|
22
22
|
var placementPosition = placement.startsWith('top') ? 'top' : 'bottom';
|
|
23
|
-
return (React.createElement("span", { className: cx("iui-toast-wrapper", "iui-placement-"
|
|
23
|
+
return (React.createElement("span", { className: cx("iui-toast-wrapper", "iui-placement-".concat(placement)) }, toasts.map(function (toastProps) {
|
|
24
24
|
return (React.createElement(Toast, __assign({ key: toastProps.id, placementPosition: placementPosition }, toastProps)));
|
|
25
25
|
})));
|
|
26
26
|
};
|
|
@@ -57,7 +57,7 @@ export var TreeNode = function (props) {
|
|
|
57
57
|
var nodeRef = React.useRef(null);
|
|
58
58
|
var styleDepth = React.useMemo(function () {
|
|
59
59
|
var _a, _b, _c;
|
|
60
|
-
return ((_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, "--level: "
|
|
60
|
+
return ((_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, "--level: ".concat(nodeDepth)))
|
|
61
61
|
? { '--level': nodeDepth }
|
|
62
62
|
: { marginLeft: nodeDepth ? nodeDepth * 28 : 0 };
|
|
63
63
|
}, [nodeDepth]);
|
|
@@ -73,7 +73,7 @@ export var TreeNode = function (props) {
|
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
75
|
if (parentNodeId) {
|
|
76
|
-
var parentNode = (_b = nodeRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.querySelector("#"
|
|
76
|
+
var parentNode = (_b = nodeRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.querySelector("#".concat(parentNodeId));
|
|
77
77
|
parentNode === null || parentNode === void 0 ? void 0 : parentNode.focus();
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
@@ -43,7 +43,7 @@ export var Text = React.forwardRef(function (props, ref) {
|
|
|
43
43
|
var _b = props.variant, variant = _b === void 0 ? 'body' : _b, _c = props.as, Element = _c === void 0 ? 'div' : _c, className = props.className, _d = props.isMuted, isMuted = _d === void 0 ? false : _d, _e = props.isSkeleton, isSkeleton = _e === void 0 ? false : _e, rest = __rest(props, ["variant", "as", "className", "isMuted", "isSkeleton"]);
|
|
44
44
|
useTheme();
|
|
45
45
|
return (React.createElement(Element, __assign({ className: cx((_a = {},
|
|
46
|
-
_a["iui-text-"
|
|
46
|
+
_a["iui-text-".concat(variant)] = variant !== 'body',
|
|
47
47
|
_a['iui-text-block'] = variant === 'body',
|
|
48
48
|
_a['iui-text-muted'] = isMuted,
|
|
49
49
|
_a['iui-skeleton'] = isSkeleton,
|
|
@@ -54,10 +54,10 @@ export var UserIcon = function (props) {
|
|
|
54
54
|
var _c = props.size, size = _c === void 0 ? 'small' : _c, status = props.status, abbreviation = props.abbreviation, image = props.image, _d = props.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, title = props.title, translatedStatusTitles = props.translatedStatusTitles, className = props.className, style = props.style, rest = __rest(props, ["size", "status", "abbreviation", "image", "backgroundColor", "title", "translatedStatusTitles", "className", "style"]);
|
|
55
55
|
useTheme();
|
|
56
56
|
var statusTitles = __assign(__assign({}, defaultStatusTitles), translatedStatusTitles);
|
|
57
|
-
return (React.createElement("span", __assign({ className: cx('iui-user-icon', (_a = {}, _a["iui-"
|
|
57
|
+
return (React.createElement("span", __assign({ className: cx('iui-user-icon', (_a = {}, _a["iui-".concat(size)] = size !== 'medium', _a), className), title: title, style: style }, rest), image !== null && image !== void 0 ? image : (React.createElement("abbr", { className: 'iui-initials', style: { backgroundColor: backgroundColor } }, abbreviation === null || abbreviation === void 0 ? void 0 : abbreviation.substring(0, 2))),
|
|
58
58
|
React.createElement("span", { className: 'iui-stroke' }),
|
|
59
59
|
status && (React.createElement("span", { title: statusTitles[status], className: cx('iui-status', (_b = {},
|
|
60
|
-
_b["iui-"
|
|
60
|
+
_b["iui-".concat(status)] = !!status,
|
|
61
61
|
_b)), "aria-label": statusTitles[status] }))));
|
|
62
62
|
};
|
|
63
63
|
export default UserIcon;
|
|
@@ -78,10 +78,10 @@ export var UserIconGroup = function (props) {
|
|
|
78
78
|
childrenArray.length <= maxIcons + 1 && getUserIconList(maxIcons + 1),
|
|
79
79
|
childrenArray.length > maxIcons + 1 && (React.createElement(React.Fragment, null,
|
|
80
80
|
getUserIconList(maxIcons),
|
|
81
|
-
React.createElement("div", __assign({}, countIconProps, { className: cx('iui-user-icon', (_a = {}, _a["iui-"
|
|
81
|
+
React.createElement("div", __assign({}, countIconProps, { className: cx('iui-user-icon', (_a = {}, _a["iui-".concat(iconSize)] = iconSize !== 'medium', _a), 'iui-user-icon-count', countIconProps === null || countIconProps === void 0 ? void 0 : countIconProps.className) }),
|
|
82
82
|
React.createElement("abbr", { className: 'iui-initials' }, childrenLength <= maxLength
|
|
83
|
-
? ""
|
|
84
|
-
: maxLength
|
|
83
|
+
? "".concat(childrenLength - maxIcons)
|
|
84
|
+
: "".concat(maxLength, "+")),
|
|
85
85
|
React.createElement("span", { className: 'iui-stroke' })))))));
|
|
86
86
|
};
|
|
87
87
|
export default UserIconGroup;
|
package/esm/core/Wizard/Step.js
CHANGED
|
@@ -48,7 +48,7 @@ export var Step = function (props) {
|
|
|
48
48
|
var stepShape = (React.createElement("li", __assign({ className: cx('iui-wizard-step', {
|
|
49
49
|
'iui-current': isActive,
|
|
50
50
|
'iui-clickable': isClickable,
|
|
51
|
-
}, className), style: __assign({ width: type === 'default' ? 100 / totalSteps
|
|
51
|
+
}, className), style: __assign({ width: type === 'default' ? "".concat(100 / totalSteps, "%") : undefined }, style), onClick: onCompletedClick, onKeyDown: onKeyDown, "aria-current": isActive ? 'step' : undefined, tabIndex: isClickable ? 0 : undefined }, rest),
|
|
52
52
|
React.createElement("div", { className: 'iui-wizard-track-content' },
|
|
53
53
|
React.createElement("span", { className: 'iui-wizard-circle' }, type === 'workflow' ? title : index + 1)),
|
|
54
54
|
type === 'default' && (React.createElement("span", { className: 'iui-wizard-step-name' }, title))));
|
|
@@ -31,7 +31,7 @@ import '@itwin/itwinui-css/css/wizard.css';
|
|
|
31
31
|
import { Step } from './Step';
|
|
32
32
|
var defaultWizardLocalization = {
|
|
33
33
|
stepsCountLabel: function (currentStep, totalSteps) {
|
|
34
|
-
return "Step "
|
|
34
|
+
return "Step ".concat(currentStep, " of ").concat(totalSteps, ":");
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
@@ -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;
|
|
@@ -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.
|