@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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
/*---------------------------------------------------------------------------------------------
|
|
13
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
14
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
15
|
+
*--------------------------------------------------------------------------------------------*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { Checkbox } from '../../Checkbox';
|
|
18
|
+
import { DefaultCell } from '../cells';
|
|
19
|
+
export var SELECTION_CELL_ID = 'iui-table-checkbox-selector';
|
|
20
|
+
/**
|
|
21
|
+
* Selection column that adds selection checkbox column to the Table.
|
|
22
|
+
* It is recommended to use it as the first column.
|
|
23
|
+
* @example
|
|
24
|
+
* const isCheckboxDisabled = useCallback((rowData) => {
|
|
25
|
+
* return rowData.name === 'Name1';
|
|
26
|
+
* }, []);
|
|
27
|
+
* const columns = useMemo(() => [
|
|
28
|
+
* Header: 'Table',
|
|
29
|
+
* columns: [
|
|
30
|
+
* SelectionColumn({ isDisabled: isCheckboxDisabled }),
|
|
31
|
+
* // Rest of your columns
|
|
32
|
+
* ],
|
|
33
|
+
* ], [isCheckboxDisabled]);
|
|
34
|
+
*/
|
|
35
|
+
export var SelectionColumn = function (props) {
|
|
36
|
+
if (props === void 0) { props = {}; }
|
|
37
|
+
var isDisabled = props.isDisabled;
|
|
38
|
+
return {
|
|
39
|
+
id: SELECTION_CELL_ID,
|
|
40
|
+
disableResizing: true,
|
|
41
|
+
disableGroupBy: true,
|
|
42
|
+
disableReordering: true,
|
|
43
|
+
minWidth: 48,
|
|
44
|
+
width: 48,
|
|
45
|
+
maxWidth: 48,
|
|
46
|
+
columnClassName: 'iui-slot',
|
|
47
|
+
cellClassName: 'iui-slot',
|
|
48
|
+
Header: function (_a) {
|
|
49
|
+
var getToggleAllRowsSelectedProps = _a.getToggleAllRowsSelectedProps, rows = _a.rows, initialRows = _a.initialRows, state = _a.state;
|
|
50
|
+
var disabled = rows.every(function (row) { return isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(row.original); });
|
|
51
|
+
var checked = initialRows.every(function (row) { return state.selectedRowIds[row.id] || (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(row.original)); });
|
|
52
|
+
return (React.createElement(Checkbox, __assign({}, getToggleAllRowsSelectedProps(), { style: {}, checked: checked && !disabled, indeterminate: !checked && Object.keys(state.selectedRowIds).length > 0, disabled: disabled })));
|
|
53
|
+
},
|
|
54
|
+
Cell: function (_a) {
|
|
55
|
+
var row = _a.row;
|
|
56
|
+
return (React.createElement(Checkbox, __assign({}, row.getToggleRowSelectedProps(), { style: {}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(row.original), onClick: function (e) { return e.stopPropagation(); } })));
|
|
57
|
+
},
|
|
58
|
+
cellRenderer: function (props) { return (React.createElement(DefaultCell, __assign({}, props, { isDisabled: function (rowData) { return !!(isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(rowData)); } }))); },
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { useExpanderCell } from './useExpanderCell';
|
|
2
|
+
export { useSelectionCell } from './useSelectionCell';
|
|
3
3
|
export { useSubRowFiltering } from './useSubRowFiltering';
|
|
4
4
|
export { useSubRowSelection } from './useSubRowSelection';
|
|
5
5
|
export { useResizeColumns } from './useResizeColumns';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { useExpanderCell } from './useExpanderCell';
|
|
6
|
+
export { useSelectionCell } from './useSelectionCell';
|
|
7
7
|
export { useSubRowFiltering } from './useSubRowFiltering';
|
|
8
8
|
export { useSubRowSelection } from './useSubRowSelection';
|
|
9
9
|
export { useResizeColumns } from './useResizeColumns';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CellProps, Hooks, Row } from 'react-table';
|
|
3
|
-
export declare const EXPANDER_CELL_ID = "iui-table-expander";
|
|
4
3
|
export declare const useExpanderCell: <T extends Record<string, unknown>>(subComponent?: ((row: Row<T>) => React.ReactNode) | undefined, expanderCell?: ((cellProps: CellProps<T, any>) => React.ReactNode) | undefined, isRowDisabled?: ((rowData: T) => boolean) | undefined) => (hooks: Hooks<T>) => void;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
13
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
14
|
if (ar || !(i in from)) {
|
|
@@ -7,44 +18,22 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7
18
|
}
|
|
8
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
20
|
};
|
|
10
|
-
|
|
11
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
12
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
13
|
-
*--------------------------------------------------------------------------------------------*/
|
|
14
|
-
import SvgChevronRight from '@itwin/itwinui-icons-react/cjs/icons/ChevronRight';
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { IconButton } from '../../Buttons';
|
|
17
|
-
export var EXPANDER_CELL_ID = 'iui-table-expander';
|
|
21
|
+
import { ExpanderColumn, EXPANDER_CELL_ID } from '../columns';
|
|
18
22
|
export var useExpanderCell = function (subComponent, expanderCell, isRowDisabled) { return function (hooks) {
|
|
19
23
|
if (!subComponent) {
|
|
20
24
|
return;
|
|
21
25
|
}
|
|
22
|
-
hooks.allColumns.push(function (columns) {
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
disableGroupBy: true,
|
|
27
|
-
minWidth: 48,
|
|
28
|
-
width: 48,
|
|
29
|
-
maxWidth: 48,
|
|
30
|
-
columnClassName: 'iui-slot',
|
|
31
|
-
cellClassName: 'iui-slot',
|
|
32
|
-
disableReordering: true,
|
|
33
|
-
Cell: function (props) {
|
|
34
|
-
var row = props.row;
|
|
35
|
-
if (!subComponent(row)) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
else if (expanderCell) {
|
|
39
|
-
return expanderCell(props);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return (React.createElement(IconButton, { className: 'iui-row-expander', styleType: 'borderless', size: 'small', onClick: function (e) {
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
row.toggleRowExpanded();
|
|
45
|
-
}, disabled: isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(props.row.original) }, React.createElement(SvgChevronRight, null)));
|
|
46
|
-
}
|
|
47
|
-
},
|
|
26
|
+
hooks.allColumns.push(function (columns) {
|
|
27
|
+
var hasExpanderColumn = columns.find(function (c) { return c.id === EXPANDER_CELL_ID; });
|
|
28
|
+
if (hasExpanderColumn) {
|
|
29
|
+
return columns;
|
|
48
30
|
}
|
|
49
|
-
|
|
31
|
+
var expanderColumn = ExpanderColumn({
|
|
32
|
+
subComponent: subComponent,
|
|
33
|
+
isDisabled: isRowDisabled,
|
|
34
|
+
});
|
|
35
|
+
return __spreadArray([
|
|
36
|
+
__assign(__assign({}, expanderColumn), { Cell: expanderCell !== null && expanderCell !== void 0 ? expanderCell : expanderColumn.Cell })
|
|
37
|
+
], columns, true);
|
|
38
|
+
});
|
|
50
39
|
}; };
|
|
@@ -225,7 +225,10 @@ var useInstanceBeforeDimensions = function (instance) {
|
|
|
225
225
|
};
|
|
226
226
|
var getPreviousResizableHeader = function (headerColumn, instance) {
|
|
227
227
|
var _a;
|
|
228
|
-
var headersList = ((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders
|
|
228
|
+
var headersList = (((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders).filter(function (_a) {
|
|
229
|
+
var isVisible = _a.isVisible;
|
|
230
|
+
return isVisible;
|
|
231
|
+
});
|
|
229
232
|
var headerIndex = headersList.findIndex(function (h) { return h.id === headerColumn.id; });
|
|
230
233
|
return __spreadArray([], headersList, true).slice(0, headerIndex)
|
|
231
234
|
.reverse()
|
|
@@ -233,7 +236,10 @@ var getPreviousResizableHeader = function (headerColumn, instance) {
|
|
|
233
236
|
};
|
|
234
237
|
var getNextResizableHeader = function (headerColumn, instance) {
|
|
235
238
|
var _a;
|
|
236
|
-
var headersList = ((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders
|
|
239
|
+
var headersList = (((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders).filter(function (_a) {
|
|
240
|
+
var isVisible = _a.isVisible;
|
|
241
|
+
return isVisible;
|
|
242
|
+
});
|
|
237
243
|
var headerIndex = headersList.findIndex(function (h) { return h.id === headerColumn.id; });
|
|
238
244
|
return __spreadArray([], headersList, true).slice(headerIndex + 1)
|
|
239
245
|
.find(function (h) { return !h.disableResizing; });
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { Hooks } from 'react-table';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const useSelectionCell: <T extends Record<string, unknown>>(isSelectable: boolean, isRowDisabled?: ((rowData: T) => boolean) | undefined) => (hooks: Hooks<T>) => void;
|
|
2
|
+
export declare const useSelectionCell: <T extends Record<string, unknown>>(isSelectable: boolean, selectionMode: 'multi' | 'single', isRowDisabled?: ((rowData: T) => boolean) | undefined) => (hooks: Hooks<T>) => void;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
2
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
3
|
if (ar || !(i in from)) {
|
|
@@ -18,46 +7,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
18
7
|
}
|
|
19
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
9
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
24
|
-
*--------------------------------------------------------------------------------------------*/
|
|
25
|
-
import React from 'react';
|
|
26
|
-
import { Checkbox } from '../../Checkbox';
|
|
27
|
-
export var SELECTION_CELL_ID = 'iui-table-checkbox-selector';
|
|
28
|
-
export var useSelectionCell = function (isSelectable, isRowDisabled) { return function (hooks) {
|
|
10
|
+
import { SelectionColumn, SELECTION_CELL_ID } from '../columns';
|
|
11
|
+
export var useSelectionCell = function (isSelectable, selectionMode, isRowDisabled) { return function (hooks) {
|
|
29
12
|
if (!isSelectable) {
|
|
30
13
|
return;
|
|
31
14
|
}
|
|
32
|
-
hooks.allColumns.push(function (columns) {
|
|
33
|
-
|
|
34
|
-
id
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
minWidth: 48,
|
|
38
|
-
width: 48,
|
|
39
|
-
maxWidth: 48,
|
|
40
|
-
columnClassName: 'iui-slot',
|
|
41
|
-
cellClassName: 'iui-slot',
|
|
42
|
-
disableReordering: true,
|
|
43
|
-
Header: function (_a) {
|
|
44
|
-
var getToggleAllRowsSelectedProps = _a.getToggleAllRowsSelectedProps, rows = _a.rows, initialRows = _a.initialRows, state = _a.state;
|
|
45
|
-
var disabled = rows.every(function (row) { return isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original); });
|
|
46
|
-
var checked = initialRows.every(function (row) {
|
|
47
|
-
return state.selectedRowIds[row.id] || (isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original));
|
|
48
|
-
});
|
|
49
|
-
return (React.createElement(Checkbox, __assign({}, getToggleAllRowsSelectedProps(), { checked: checked && !disabled, indeterminate: !checked && Object.keys(state.selectedRowIds).length > 0, disabled: disabled })));
|
|
50
|
-
},
|
|
51
|
-
Cell: function (_a) {
|
|
52
|
-
var row = _a.row;
|
|
53
|
-
return (React.createElement(Checkbox, __assign({}, row.getToggleRowSelectedProps(), { disabled: isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original), onClick: function (e) { return e.stopPropagation(); } })));
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
], columns, true); });
|
|
57
|
-
hooks.useInstanceBeforeDimensions.push(function (_a) {
|
|
58
|
-
var headerGroups = _a.headerGroups;
|
|
59
|
-
// Fix the parent group of the selection button to not be resizable
|
|
60
|
-
var selectionGroupHeader = headerGroups[0].headers[0];
|
|
61
|
-
selectionGroupHeader.canResize = false;
|
|
15
|
+
hooks.allColumns.push(function (columns) {
|
|
16
|
+
return selectionMode === 'single' ||
|
|
17
|
+
columns.find(function (c) { return c.id === SELECTION_CELL_ID; })
|
|
18
|
+
? columns
|
|
19
|
+
: __spreadArray([SelectionColumn({ isDisabled: isRowDisabled })], columns, true);
|
|
62
20
|
});
|
|
63
21
|
}; };
|
|
@@ -6,5 +6,6 @@ export { DefaultCell, EditableCell } from './cells';
|
|
|
6
6
|
export type { DefaultCellProps, EditableCellProps } from './cells';
|
|
7
7
|
export { TablePaginator } from './TablePaginator';
|
|
8
8
|
export type { TablePaginatorProps } from './TablePaginator';
|
|
9
|
+
export { ActionColumn, ExpanderColumn, SelectionColumn } from './columns';
|
|
9
10
|
declare const _default: "./Table";
|
|
10
11
|
export default _default;
|
package/esm/core/Table/index.js
CHANGED
|
@@ -6,4 +6,5 @@ export { Table } from './Table';
|
|
|
6
6
|
export { BaseFilter, FilterButtonBar, tableFilters } from './filters';
|
|
7
7
|
export { DefaultCell, EditableCell } from './cells';
|
|
8
8
|
export { TablePaginator } from './TablePaginator';
|
|
9
|
+
export { ActionColumn, ExpanderColumn, SelectionColumn } from './columns';
|
|
9
10
|
export default './Table';
|
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,
|
package/esm/core/Tag/Tag.js
CHANGED
|
@@ -39,9 +39,12 @@ import { IconButton } from '../Buttons';
|
|
|
39
39
|
export var Tag = function (props) {
|
|
40
40
|
var className = props.className, _a = props.variant, variant = _a === void 0 ? 'default' : _a, children = props.children, onRemove = props.onRemove, rest = __rest(props, ["className", "variant", "children", "onRemove"]);
|
|
41
41
|
useTheme();
|
|
42
|
-
return (React.createElement("span", __assign({ className: cx(
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return (React.createElement("span", __assign({ className: cx({
|
|
43
|
+
'iui-tag-basic': variant === 'basic',
|
|
44
|
+
'iui-tag': variant === 'default',
|
|
45
|
+
}, className) }, rest),
|
|
46
|
+
variant === 'default' ? (React.createElement("span", { className: 'iui-tag-label' }, children)) : (children),
|
|
47
|
+
onRemove && (React.createElement(IconButton, { styleType: 'borderless', size: 'small', onClick: onRemove, "aria-label": 'Delete tag', className: 'iui-tag-button' },
|
|
45
48
|
React.createElement(SvgCloseSmall, { "aria-hidden": true })))));
|
|
46
49
|
};
|
|
47
50
|
export default Tag;
|
|
@@ -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.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CommonProps } from '../utils';
|
|
3
2
|
import '@itwin/itwinui-css/css/tile.css';
|
|
4
3
|
export declare type TileProps = {
|
|
5
4
|
/**
|
|
@@ -80,7 +79,12 @@ export declare type TileProps = {
|
|
|
80
79
|
* Any custom nodes that will be appended to the tile's main content.
|
|
81
80
|
*/
|
|
82
81
|
children?: React.ReactNode;
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Whether the tile is expected to be interactable (i.e. `onClick`).
|
|
84
|
+
* It becomes focusable and gets on hover styling.
|
|
85
|
+
*/
|
|
86
|
+
isActionable?: boolean;
|
|
87
|
+
} & React.ComponentPropsWithoutRef<'div'>;
|
|
84
88
|
/**
|
|
85
89
|
* Tile component that displays content and actions in a card-like format.
|
|
86
90
|
* @example
|
package/esm/core/Tile/Tile.js
CHANGED
|
@@ -51,14 +51,19 @@ import { IconButton } from '../Buttons';
|
|
|
51
51
|
* />
|
|
52
52
|
*/
|
|
53
53
|
export var Tile = function (props) {
|
|
54
|
-
var className = props.className, name = props.name, description = props.description, metadata = props.metadata, thumbnail = props.thumbnail, buttons = props.buttons, leftIcon = props.leftIcon, rightIcon = props.rightIcon, badge = props.badge, isNew = props.isNew, isSelected = props.isSelected, moreOptions = props.moreOptions, _a = props.variant, variant = _a === void 0 ? 'default' : _a, children = props.children, rest = __rest(props, ["className", "name", "description", "metadata", "thumbnail", "buttons", "leftIcon", "rightIcon", "badge", "isNew", "isSelected", "moreOptions", "variant", "children"]);
|
|
54
|
+
var className = props.className, name = props.name, description = props.description, metadata = props.metadata, thumbnail = props.thumbnail, buttons = props.buttons, leftIcon = props.leftIcon, rightIcon = props.rightIcon, badge = props.badge, isNew = props.isNew, isSelected = props.isSelected, moreOptions = props.moreOptions, _a = props.variant, variant = _a === void 0 ? 'default' : _a, children = props.children, isActionable = props.isActionable, rest = __rest(props, ["className", "name", "description", "metadata", "thumbnail", "buttons", "leftIcon", "rightIcon", "badge", "isNew", "isSelected", "moreOptions", "variant", "children", "isActionable"]);
|
|
55
55
|
useTheme();
|
|
56
56
|
var _b = React.useState(false), isMenuVisible = _b[0], setIsMenuVisible = _b[1];
|
|
57
57
|
var showMenu = React.useCallback(function () { return setIsMenuVisible(true); }, []);
|
|
58
58
|
var hideMenu = React.useCallback(function () { return setIsMenuVisible(false); }, []);
|
|
59
|
-
return (React.createElement("div", __assign({ className: cx('iui-tile', {
|
|
59
|
+
return (React.createElement("div", __assign({ className: cx('iui-tile', {
|
|
60
|
+
'iui-folder': variant === 'folder',
|
|
61
|
+
'iui-new': isNew,
|
|
62
|
+
'iui-selected': isSelected,
|
|
63
|
+
'iui-actionable': isActionable,
|
|
64
|
+
}, className), tabIndex: isActionable ? 0 : undefined }, rest),
|
|
60
65
|
thumbnail && (React.createElement("div", { className: 'iui-tile-thumbnail' },
|
|
61
|
-
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, {
|
|
62
67
|
className: 'iui-tile-thumbnail-picture',
|
|
63
68
|
})) : React.isValidElement(thumbnail) ? (React.cloneElement(thumbnail, {
|
|
64
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,10 +133,10 @@ 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
|
-
link && (React.createElement("a", { className: 'iui-anchor', onClick: link.onClick }, link.title)),
|
|
139
|
+
link && (React.createElement("a", { className: 'iui-toast-anchor', onClick: link.onClick }, link.title)),
|
|
140
140
|
(type === 'persisting' || hasCloseButton) && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
|
|
141
141
|
React.createElement(SvgCloseSmall, null)))));
|
|
142
142
|
};
|
|
@@ -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
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/anchor.css';
|
|
2
3
|
export declare const Anchor: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & React.RefAttributes<HTMLAnchorElement>>;
|
|
3
4
|
export default Anchor;
|
|
@@ -27,6 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import React from 'react';
|
|
28
28
|
import cx from 'classnames';
|
|
29
29
|
import { useTheme } from '../../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/anchor.css';
|
|
30
31
|
export var Anchor = React.forwardRef(function (_a, ref) {
|
|
31
32
|
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
32
33
|
useTheme();
|
|
@@ -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
|
/**
|
package/esm/core/index.d.ts
CHANGED
|
@@ -62,11 +62,15 @@ export { Select } from './Select';
|
|
|
62
62
|
export type { SelectProps, SelectOption, ItemRendererProps } from './Select';
|
|
63
63
|
export { SideNavigation, SidenavButton, SidenavSubmenu, SidenavSubmenuHeader, } from './SideNavigation';
|
|
64
64
|
export type { SideNavigationProps, SidenavButtonProps, SidenavSubmenuProps, SidenavSubmenuHeaderProps, } from './SideNavigation';
|
|
65
|
+
export { SkipToContentLink } from './SkipToContentLink';
|
|
66
|
+
export type { SkipToContentLinkProps } from './SkipToContentLink';
|
|
65
67
|
export { Slider } from './Slider';
|
|
66
68
|
export type { SliderProps } from './Slider';
|
|
67
69
|
export { StatusMessage } from './StatusMessage';
|
|
68
70
|
export type { StatusMessageProps } from './StatusMessage';
|
|
69
|
-
export {
|
|
71
|
+
export { Surface } from './Surface';
|
|
72
|
+
export type { SurfaceProps } from './Surface';
|
|
73
|
+
export { Table, tableFilters, FilterButtonBar, DefaultCell, EditableCell, TablePaginator, ActionColumn, ExpanderColumn, SelectionColumn, } from './Table';
|
|
70
74
|
export type { TableProps, TableFilterProps, TableFilterValue, DateRangeFilterOptions, FilterButtonBarProps, DefaultCellProps, EditableCellProps, TablePaginatorProps, TablePaginatorRendererProps, } from './Table';
|
|
71
75
|
export { Tag, TagContainer } from './Tag';
|
|
72
76
|
export type { TagProps, TagContainerProps } from './Tag';
|
package/esm/core/index.js
CHANGED
|
@@ -34,9 +34,11 @@ export { Radio } from './Radio';
|
|
|
34
34
|
export { RadioTile, RadioTileGroup } from './RadioTiles';
|
|
35
35
|
export { Select } from './Select';
|
|
36
36
|
export { SideNavigation, SidenavButton, SidenavSubmenu, SidenavSubmenuHeader, } from './SideNavigation';
|
|
37
|
+
export { SkipToContentLink } from './SkipToContentLink';
|
|
37
38
|
export { Slider } from './Slider';
|
|
38
39
|
export { StatusMessage } from './StatusMessage';
|
|
39
|
-
export {
|
|
40
|
+
export { Surface } from './Surface';
|
|
41
|
+
export { Table, tableFilters, FilterButtonBar, DefaultCell, EditableCell, TablePaginator, ActionColumn, ExpanderColumn, SelectionColumn, } from './Table';
|
|
40
42
|
export { Tag, TagContainer } from './Tag';
|
|
41
43
|
export { Textarea } from './Textarea';
|
|
42
44
|
export { Tile } from './Tile';
|