@itwin/itwinui-react 1.48.0 → 2.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +4 -22
- package/cjs/core/Alert/Alert.d.ts +7 -6
- package/cjs/core/Alert/Alert.js +12 -7
- package/cjs/core/Avatar/Avatar.d.ts +69 -0
- package/cjs/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +15 -11
- package/cjs/core/Avatar/index.d.ts +4 -0
- package/cjs/core/{UserIcon → Avatar}/index.js +5 -4
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +70 -0
- package/cjs/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +23 -19
- package/cjs/core/AvatarGroup/index.d.ts +4 -0
- package/cjs/core/{UserIconGroup → AvatarGroup}/index.js +5 -4
- package/cjs/core/Badge/Badge.js +2 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/cjs/core/Buttons/Button/Button.js +5 -14
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +3 -9
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +1 -1
- package/cjs/core/Buttons/SplitButton/SplitButton.js +4 -6
- package/cjs/core/Checkbox/Checkbox.d.ts +1 -29
- package/cjs/core/Checkbox/Checkbox.js +3 -3
- package/cjs/core/ColorPicker/ColorBuilder.js +16 -27
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +1 -6
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.js +2 -4
- package/cjs/core/Dialog/Dialog.d.ts +4 -4
- package/cjs/core/Dialog/Dialog.js +1 -1
- package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/cjs/core/Dialog/DialogBackdrop.js +5 -2
- package/cjs/core/Dialog/DialogMain.d.ts +1 -1
- package/cjs/core/Dialog/DialogMain.js +7 -1
- package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +4 -4
- package/cjs/core/Header/Header.d.ts +16 -6
- package/cjs/core/Header/Header.js +7 -9
- package/cjs/core/Header/HeaderBasicButton.d.ts +6 -0
- package/cjs/core/Header/HeaderBasicButton.js +52 -0
- package/cjs/core/Header/HeaderBreadcrumbs.js +6 -4
- package/cjs/core/Header/HeaderButton.d.ts +3 -2
- package/cjs/core/Header/HeaderButton.js +10 -18
- package/cjs/core/Header/HeaderDropdownButton.d.ts +6 -0
- package/cjs/core/Header/HeaderDropdownButton.js +56 -0
- package/cjs/core/Header/HeaderLogo.js +3 -3
- package/cjs/core/Header/HeaderSplitButton.d.ts +6 -0
- package/cjs/core/Header/HeaderSplitButton.js +56 -0
- package/cjs/core/Input/Input.d.ts +1 -1
- package/cjs/core/Input/Input.js +3 -4
- package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
- package/cjs/core/InputGroup/InputGroup.js +1 -1
- package/cjs/core/Label/Label.d.ts +1 -1
- package/cjs/core/Label/Label.js +1 -1
- package/cjs/core/LabeledInput/LabeledInput.d.ts +2 -2
- package/cjs/core/LabeledInput/LabeledInput.js +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +1 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/cjs/core/Radio/Radio.d.ts +1 -29
- package/cjs/core/Radio/Radio.js +3 -3
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +1 -1
- package/cjs/core/Select/Select.d.ts +1 -1
- package/cjs/core/Select/Select.js +9 -12
- package/cjs/core/Select/SelectTag.d.ts +1 -1
- package/cjs/core/Select/SelectTag.js +1 -1
- package/cjs/core/SideNavigation/SidenavButton.js +1 -2
- package/cjs/core/Stepper/Stepper.d.ts +40 -0
- package/cjs/core/{Wizard/Wizard.js → Stepper/Stepper.js} +11 -28
- package/cjs/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
- package/cjs/core/{Wizard/Step.js → Stepper/StepperStep.js} +10 -10
- package/cjs/core/Stepper/Wizard.d.ts +46 -0
- package/cjs/core/Stepper/Wizard.js +55 -0
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +6 -0
- package/cjs/core/Stepper/WorkflowDiagram.js +43 -0
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
- package/cjs/core/Stepper/WorkflowDiagramStep.js +42 -0
- package/cjs/core/Stepper/index.d.ts +8 -0
- package/cjs/core/{Wizard → Stepper}/index.js +5 -1
- package/cjs/core/Surface/Surface.js +2 -4
- package/cjs/core/Table/SubRowExpander.js +1 -1
- package/cjs/core/Table/Table.d.ts +5 -4
- package/cjs/core/Table/Table.js +30 -21
- package/cjs/core/Table/TableCell.js +4 -4
- package/cjs/core/Table/TablePaginator.js +14 -15
- package/cjs/core/Table/TableRowMemoized.d.ts +2 -0
- package/cjs/core/Table/TableRowMemoized.js +10 -13
- package/cjs/core/Table/cells/DefaultCell.js +4 -9
- package/cjs/core/Table/columns/actionColumn.js +1 -1
- package/cjs/core/Table/columns/expanderColumn.js +1 -1
- package/cjs/core/Table/filters/BaseFilter.js +1 -1
- package/cjs/core/Table/filters/FilterToggle.js +1 -1
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +4 -4
- package/cjs/core/Table/hooks/useResizeColumns.js +110 -106
- package/cjs/core/Tabs/Tab.d.ts +0 -8
- package/cjs/core/Tabs/Tab.js +1 -5
- package/cjs/core/Tabs/Tabs.js +8 -11
- package/cjs/core/Tabs/index.d.ts +2 -2
- package/cjs/core/Tabs/index.js +1 -2
- package/cjs/core/Textarea/Textarea.d.ts +1 -1
- package/cjs/core/Textarea/Textarea.js +2 -2
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +27 -17
- package/cjs/core/ThemeProvider/ThemeProvider.js +64 -7
- package/cjs/core/Tile/Tile.d.ts +19 -1
- package/cjs/core/Tile/Tile.js +35 -12
- package/cjs/core/Toast/Toast.d.ts +3 -3
- package/cjs/core/Toast/Toast.js +3 -3
- package/cjs/core/Toast/ToastWrapper.d.ts +1 -1
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +1 -7
- package/cjs/core/index.d.ts +8 -8
- package/cjs/core/index.js +13 -10
- package/cjs/core/utils/components/Popover.d.ts +2 -2
- package/cjs/core/utils/components/Popover.js +1 -1
- package/cjs/core/utils/components/Resizer.d.ts +5 -0
- package/cjs/core/utils/components/Resizer.js +7 -1
- package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -0
- package/cjs/core/utils/components/VisuallyHidden.js +1 -0
- package/cjs/core/utils/functions/colors.d.ts +1 -1
- package/cjs/core/utils/functions/colors.js +1 -1
- package/cjs/core/utils/functions/dom.js +1 -0
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +17 -0
- package/cjs/core/utils/hooks/useMediaQuery.js +2 -1
- package/cjs/core/utils/hooks/useTheme.d.ts +20 -3
- package/cjs/core/utils/hooks/useTheme.js +57 -58
- package/esm/core/Alert/Alert.d.ts +7 -6
- package/esm/core/Alert/Alert.js +12 -7
- package/esm/core/Avatar/Avatar.d.ts +69 -0
- package/esm/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +13 -9
- package/esm/core/Avatar/index.d.ts +4 -0
- package/esm/core/{UserIcon → Avatar}/index.js +2 -2
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +70 -0
- package/esm/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +21 -17
- package/esm/core/AvatarGroup/index.d.ts +4 -0
- package/esm/core/{UserIconGroup → AvatarGroup}/index.js +2 -2
- package/esm/core/Badge/Badge.js +3 -5
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/core/Buttons/Button/Button.js +5 -14
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/esm/core/Buttons/IconButton/IconButton.js +3 -9
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +1 -1
- package/esm/core/Buttons/SplitButton/SplitButton.js +4 -6
- package/esm/core/Checkbox/Checkbox.d.ts +1 -29
- package/esm/core/Checkbox/Checkbox.js +3 -3
- package/esm/core/ColorPicker/ColorBuilder.js +17 -28
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +2 -7
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.js +2 -4
- package/esm/core/Dialog/Dialog.d.ts +4 -4
- package/esm/core/Dialog/Dialog.js +1 -1
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +5 -2
- package/esm/core/Dialog/DialogMain.d.ts +1 -1
- package/esm/core/Dialog/DialogMain.js +7 -1
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/ExpandableBlock/ExpandableBlock.js +4 -4
- package/esm/core/Header/Header.d.ts +16 -6
- package/esm/core/Header/Header.js +7 -9
- package/esm/core/Header/HeaderBasicButton.d.ts +6 -0
- package/esm/core/Header/HeaderBasicButton.js +46 -0
- package/esm/core/Header/HeaderBreadcrumbs.js +6 -4
- package/esm/core/Header/HeaderButton.d.ts +3 -2
- package/esm/core/Header/HeaderButton.js +10 -18
- package/esm/core/Header/HeaderDropdownButton.d.ts +6 -0
- package/esm/core/Header/HeaderDropdownButton.js +50 -0
- package/esm/core/Header/HeaderLogo.js +3 -3
- package/esm/core/Header/HeaderSplitButton.d.ts +6 -0
- package/esm/core/Header/HeaderSplitButton.js +50 -0
- package/esm/core/Input/Input.d.ts +1 -1
- package/esm/core/Input/Input.js +3 -4
- package/esm/core/InputGroup/InputGroup.d.ts +1 -1
- package/esm/core/InputGroup/InputGroup.js +1 -1
- package/esm/core/Label/Label.d.ts +1 -1
- package/esm/core/Label/Label.js +1 -1
- package/esm/core/LabeledInput/LabeledInput.d.ts +2 -2
- package/esm/core/LabeledInput/LabeledInput.js +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +1 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/esm/core/Radio/Radio.d.ts +1 -29
- package/esm/core/Radio/Radio.js +3 -3
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +1 -1
- package/esm/core/Select/Select.d.ts +1 -1
- package/esm/core/Select/Select.js +9 -12
- package/esm/core/Select/SelectTag.d.ts +1 -1
- package/esm/core/Select/SelectTag.js +1 -1
- package/esm/core/SideNavigation/SidenavButton.js +1 -2
- package/esm/core/Stepper/Stepper.d.ts +40 -0
- package/esm/core/{Wizard/Wizard.js → Stepper/Stepper.js} +10 -27
- package/esm/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
- package/esm/core/{Wizard/Step.js → Stepper/StepperStep.js} +8 -8
- package/esm/core/Stepper/Wizard.d.ts +46 -0
- package/esm/core/Stepper/Wizard.js +49 -0
- package/esm/core/Stepper/WorkflowDiagram.d.ts +6 -0
- package/esm/core/Stepper/WorkflowDiagram.js +37 -0
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
- package/esm/core/Stepper/WorkflowDiagramStep.js +35 -0
- package/esm/core/Stepper/index.d.ts +8 -0
- package/esm/core/{Wizard → Stepper}/index.js +2 -0
- package/esm/core/Surface/Surface.js +3 -5
- package/esm/core/Table/SubRowExpander.js +1 -1
- package/esm/core/Table/Table.d.ts +5 -4
- package/esm/core/Table/Table.js +30 -21
- package/esm/core/Table/TableCell.js +4 -4
- package/esm/core/Table/TablePaginator.js +14 -15
- package/esm/core/Table/TableRowMemoized.d.ts +2 -0
- package/esm/core/Table/TableRowMemoized.js +10 -13
- package/esm/core/Table/cells/DefaultCell.js +4 -9
- package/esm/core/Table/columns/actionColumn.js +1 -1
- package/esm/core/Table/columns/expanderColumn.js +1 -1
- package/esm/core/Table/filters/BaseFilter.js +1 -1
- package/esm/core/Table/filters/FilterToggle.js +1 -1
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +4 -4
- package/esm/core/Table/hooks/useResizeColumns.js +110 -106
- package/esm/core/Tabs/Tab.d.ts +0 -8
- package/esm/core/Tabs/Tab.js +0 -4
- package/esm/core/Tabs/Tabs.js +9 -12
- package/esm/core/Tabs/index.d.ts +2 -2
- package/esm/core/Tabs/index.js +1 -1
- package/esm/core/Textarea/Textarea.d.ts +1 -1
- package/esm/core/Textarea/Textarea.js +2 -2
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +27 -17
- package/esm/core/ThemeProvider/ThemeProvider.js +64 -6
- package/esm/core/Tile/Tile.d.ts +19 -1
- package/esm/core/Tile/Tile.js +36 -13
- package/esm/core/Toast/Toast.d.ts +3 -3
- package/esm/core/Toast/Toast.js +3 -3
- package/esm/core/Toast/ToastWrapper.d.ts +1 -1
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -8
- package/esm/core/index.d.ts +8 -8
- package/esm/core/index.js +4 -4
- package/esm/core/utils/components/Popover.d.ts +2 -2
- package/esm/core/utils/components/Popover.js +1 -1
- package/esm/core/utils/components/Resizer.d.ts +5 -0
- package/esm/core/utils/components/Resizer.js +7 -1
- package/esm/core/utils/components/VisuallyHidden.d.ts +1 -0
- package/esm/core/utils/components/VisuallyHidden.js +1 -0
- package/esm/core/utils/functions/colors.d.ts +1 -1
- package/esm/core/utils/functions/colors.js +1 -1
- package/esm/core/utils/functions/dom.js +1 -0
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/esm/core/utils/hooks/useMediaQuery.js +2 -1
- package/esm/core/utils/hooks/useTheme.d.ts +20 -3
- package/esm/core/utils/hooks/useTheme.js +56 -57
- package/package.json +3 -2
- package/cjs/core/UserIcon/UserIcon.d.ts +0 -57
- package/cjs/core/UserIcon/index.d.ts +0 -4
- package/cjs/core/UserIconGroup/UserIconGroup.d.ts +0 -62
- package/cjs/core/UserIconGroup/index.d.ts +0 -4
- package/cjs/core/Wizard/Wizard.d.ts +0 -54
- package/cjs/core/Wizard/index.d.ts +0 -4
- package/esm/core/UserIcon/UserIcon.d.ts +0 -57
- package/esm/core/UserIcon/index.d.ts +0 -4
- package/esm/core/UserIconGroup/UserIconGroup.d.ts +0 -62
- package/esm/core/UserIconGroup/index.d.ts +0 -4
- package/esm/core/Wizard/Wizard.d.ts +0 -54
- package/esm/core/Wizard/index.d.ts +0 -4
|
@@ -61,11 +61,11 @@ var defaultLocalization = {
|
|
|
61
61
|
* />
|
|
62
62
|
*/
|
|
63
63
|
var TablePaginator = function (props) {
|
|
64
|
-
var currentPage = props.currentPage, totalRowsCount = props.totalRowsCount, pageSize = props.pageSize, onPageChange = props.onPageChange, _a = props.focusActivationMode, focusActivationMode =
|
|
64
|
+
var currentPage = props.currentPage, totalRowsCount = props.totalRowsCount, pageSize = props.pageSize, onPageChange = props.onPageChange, _a = props.totalSelectedRowsCount, totalSelectedRowsCount = _a === void 0 ? 0 : _a, _b = props.focusActivationMode, focusActivationMode = _b === void 0 ? 'manual' : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.size, size = _d === void 0 ? 'default' : _d, pageSizeList = props.pageSizeList, onPageSizeChange = props.onPageSizeChange, userLocalization = props.localization, className = props.className, rest = __rest(props, ["currentPage", "totalRowsCount", "pageSize", "onPageChange", "totalSelectedRowsCount", "focusActivationMode", "isLoading", "size", "pageSizeList", "onPageSizeChange", "localization", "className"]);
|
|
65
65
|
(0, utils_1.useTheme)();
|
|
66
66
|
var localization = react_1.default.useMemo(function () { return (__assign(__assign({}, defaultLocalization), userLocalization)); }, [userLocalization]);
|
|
67
67
|
var pageListRef = react_1.default.useRef(null);
|
|
68
|
-
var
|
|
68
|
+
var _e = react_1.default.useState(currentPage), focusedIndex = _e[0], setFocusedIndex = _e[1];
|
|
69
69
|
react_1.default.useEffect(function () {
|
|
70
70
|
setFocusedIndex(currentPage);
|
|
71
71
|
}, [currentPage]);
|
|
@@ -76,7 +76,7 @@ var TablePaginator = function (props) {
|
|
|
76
76
|
// Checking `isMounted.current` prevents from focusing on initial load.
|
|
77
77
|
// Checking `needFocus.current` prevents from focusing page when clicked on previous/next page.
|
|
78
78
|
if (isMounted.current && needFocus.current) {
|
|
79
|
-
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(); });
|
|
79
|
+
var buttonToFocus = Array.from((_b = (_a = pageListRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.iui-table-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(); });
|
|
80
80
|
buttonToFocus === null || buttonToFocus === void 0 ? void 0 : buttonToFocus.focus();
|
|
81
81
|
needFocus.current = false;
|
|
82
82
|
}
|
|
@@ -85,10 +85,9 @@ var TablePaginator = function (props) {
|
|
|
85
85
|
var buttonSize = size != 'default' ? 'small' : undefined;
|
|
86
86
|
var pageButton = react_1.default.useCallback(function (index, tabIndex) {
|
|
87
87
|
if (tabIndex === void 0) { tabIndex = index === focusedIndex ? 0 : -1; }
|
|
88
|
-
return (react_1.default.createElement("button", { key: index, className: (0, classnames_1.default)('iui-paginator-page-button', {
|
|
89
|
-
'iui-
|
|
90
|
-
|
|
91
|
-
}), onClick: function () { return onPageChange(index); }, "aria-current": index === currentPage, "aria-label": localization.goToPageLabel(index + 1), tabIndex: tabIndex }, index + 1));
|
|
88
|
+
return (react_1.default.createElement("button", { key: index, className: (0, classnames_1.default)('iui-table-paginator-page-button', {
|
|
89
|
+
'iui-table-paginator-page-button-small': buttonSize === 'small',
|
|
90
|
+
}), "data-iui-active": index === currentPage, onClick: function () { return onPageChange(index); }, "aria-current": index === currentPage, "aria-label": localization.goToPageLabel(index + 1), tabIndex: tabIndex }, index + 1));
|
|
92
91
|
}, [focusedIndex, currentPage, localization, buttonSize, onPageChange]);
|
|
93
92
|
var totalPagesCount = Math.ceil(totalRowsCount / pageSize);
|
|
94
93
|
var pageList = react_1.default.useMemo(function () {
|
|
@@ -96,8 +95,8 @@ var TablePaginator = function (props) {
|
|
|
96
95
|
.fill(null)
|
|
97
96
|
.map(function (_, index) { return pageButton(index); });
|
|
98
97
|
}, [pageButton, totalPagesCount]);
|
|
99
|
-
var
|
|
100
|
-
var
|
|
98
|
+
var _f = (0, utils_1.useOverflow)(pageList), overflowRef = _f[0], visibleCount = _f[1];
|
|
99
|
+
var _g = (0, utils_1.useContainerWidth)(), paginatorResizeRef = _g[0], paginatorWidth = _g[1];
|
|
101
100
|
var onKeyDown = function (event) {
|
|
102
101
|
// alt + arrow keys are used by browser/assistive technologies
|
|
103
102
|
if (event.altKey) {
|
|
@@ -150,19 +149,19 @@ var TablePaginator = function (props) {
|
|
|
150
149
|
var hasNoRows = totalPagesCount === 0;
|
|
151
150
|
var showPagesList = totalPagesCount > 1 || isLoading;
|
|
152
151
|
var showPageSizeList = pageSizeList && !!onPageSizeChange && !!totalRowsCount;
|
|
153
|
-
var ellipsis = (react_1.default.createElement("span", { className: (0, classnames_1.default)('iui-paginator-ellipsis', {
|
|
154
|
-
'iui-paginator-ellipsis-small': size === 'small',
|
|
152
|
+
var ellipsis = (react_1.default.createElement("span", { className: (0, classnames_1.default)('iui-table-paginator-ellipsis', {
|
|
153
|
+
'iui-table-paginator-ellipsis-small': size === 'small',
|
|
155
154
|
}) }, "\u2026"));
|
|
156
155
|
var noRowsContent = (react_1.default.createElement(react_1.default.Fragment, null, isLoading ? (react_1.default.createElement(ProgressIndicators_1.ProgressRadial, { indeterminate: true, size: 'small' })) : (react_1.default.createElement(Buttons_1.Button, { styleType: 'borderless', disabled: true, size: buttonSize }, "1"))));
|
|
157
156
|
if (!showPagesList && !showPageSizeList) {
|
|
158
157
|
return null;
|
|
159
158
|
}
|
|
160
|
-
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-paginator', className), ref: paginatorResizeRef }, rest),
|
|
161
|
-
react_1.default.createElement("div", { className: 'iui-left' }),
|
|
159
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-table-paginator', className), ref: paginatorResizeRef }, rest),
|
|
160
|
+
react_1.default.createElement("div", { className: 'iui-left' }, totalSelectedRowsCount > 0 && (react_1.default.createElement("span", null, "".concat(totalSelectedRowsCount, " ").concat(totalSelectedRowsCount === 1 ? 'row' : 'rows', " selected")))),
|
|
162
161
|
showPagesList && (react_1.default.createElement("div", { className: 'iui-center', ref: overflowRef },
|
|
163
162
|
react_1.default.createElement(Buttons_1.IconButton, { styleType: 'borderless', disabled: currentPage === 0, onClick: function () { return onPageChange(currentPage - 1); }, size: buttonSize, "aria-label": localization.previousPage },
|
|
164
163
|
react_1.default.createElement(ChevronLeft_1.default, null)),
|
|
165
|
-
react_1.default.createElement("span", { className: 'iui-paginator-pages-group', onKeyDown: onKeyDown, ref: pageListRef }, (function () {
|
|
164
|
+
react_1.default.createElement("span", { className: 'iui-table-paginator-pages-group', onKeyDown: onKeyDown, ref: pageListRef }, (function () {
|
|
166
165
|
if (hasNoRows) {
|
|
167
166
|
return noRowsContent;
|
|
168
167
|
}
|
|
@@ -185,7 +184,7 @@ var TablePaginator = function (props) {
|
|
|
185
184
|
react_1.default.createElement(ChevronRight_1.default, null)))),
|
|
186
185
|
react_1.default.createElement("div", { className: 'iui-right' }, showPageSizeList && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
187
186
|
localization.rowsPerPageLabel !== null &&
|
|
188
|
-
paginatorWidth >= 1024 && (react_1.default.createElement("span", { className: 'iui-paginator-page-size-label' }, localization.rowsPerPageLabel)),
|
|
187
|
+
paginatorWidth >= 1024 && (react_1.default.createElement("span", { className: 'iui-table-paginator-page-size-label' }, localization.rowsPerPageLabel)),
|
|
189
188
|
react_1.default.createElement(Buttons_1.DropdownButton, { styleType: 'borderless', size: buttonSize, menuItems: function (close) {
|
|
190
189
|
return pageSizeList.map(function (size) { return (react_1.default.createElement(Menu_1.MenuItem, { key: size, isSelected: size === pageSize, onClick: function () {
|
|
191
190
|
close();
|
|
@@ -12,6 +12,7 @@ export declare const TableRow: <T extends Record<string, unknown>>(props: {
|
|
|
12
12
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
13
13
|
} & {
|
|
14
14
|
status?: "positive" | "warning" | "negative" | undefined;
|
|
15
|
+
isLoading?: boolean | undefined;
|
|
15
16
|
}) | undefined;
|
|
16
17
|
isLast: boolean;
|
|
17
18
|
onRowInViewport: React.MutableRefObject<((rowData: T) => void) | undefined>;
|
|
@@ -33,6 +34,7 @@ export declare const TableRowMemoized: <T extends Record<string, unknown>>(props
|
|
|
33
34
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
34
35
|
} & {
|
|
35
36
|
status?: "positive" | "warning" | "negative" | undefined;
|
|
37
|
+
isLoading?: boolean | undefined;
|
|
36
38
|
}) | undefined;
|
|
37
39
|
isLast: boolean;
|
|
38
40
|
onRowInViewport: React.MutableRefObject<((rowData: T) => void) | undefined>;
|
|
@@ -42,7 +42,6 @@ var TableCell_1 = require("./TableCell");
|
|
|
42
42
|
*/
|
|
43
43
|
var TableRow = function (props) {
|
|
44
44
|
var _a;
|
|
45
|
-
var _b;
|
|
46
45
|
var row = props.row, rowProps = props.rowProps, isLast = props.isLast, onRowInViewport = props.onRowInViewport, onBottomReached = props.onBottomReached, intersectionMargin = props.intersectionMargin, onClick = props.onClick, subComponent = props.subComponent, isDisabled = props.isDisabled, tableHasSubRows = props.tableHasSubRows, tableInstance = props.tableInstance, expanderCell = props.expanderCell, bodyRef = props.bodyRef, tableRowRef = props.tableRowRef;
|
|
47
46
|
var onIntersect = react_1.default.useCallback(function () {
|
|
48
47
|
var _a, _b;
|
|
@@ -63,16 +62,16 @@ var TableRow = function (props) {
|
|
|
63
62
|
rootMargin: "".concat(intersectionMargin, "px"),
|
|
64
63
|
root: intersectionRoot,
|
|
65
64
|
});
|
|
66
|
-
var userRowProps = (
|
|
67
|
-
var status = userRowProps.status, restUserRowProps = __rest(userRowProps, ["status"]);
|
|
65
|
+
var userRowProps = (_a = rowProps === null || rowProps === void 0 ? void 0 : rowProps(row)) !== null && _a !== void 0 ? _a : {};
|
|
66
|
+
var status = userRowProps.status, isLoading = userRowProps.isLoading, restUserRowProps = __rest(userRowProps, ["status", "isLoading"]);
|
|
68
67
|
var mergedProps = __assign(__assign(__assign({}, row.getRowProps({ style: { flex: "0 0 auto", minWidth: '100%' } })), restUserRowProps), {
|
|
69
|
-
className: (0, classnames_1.default)('iui-row',
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
className: (0, classnames_1.default)('iui-table-row', {
|
|
69
|
+
'iui-table-row-expanded': row.isExpanded && subComponent,
|
|
70
|
+
'iui-loading': isLoading,
|
|
71
|
+
}, userRowProps === null || userRowProps === void 0 ? void 0 : userRowProps.className),
|
|
72
|
+
'aria-selected': row.isSelected || undefined,
|
|
73
|
+
'aria-disabled': isDisabled || undefined,
|
|
74
|
+
'data-iui-status': status,
|
|
76
75
|
});
|
|
77
76
|
var refs = (0, utils_1.useMergedRefs)(intersectionRef, mergedProps.ref, tableRowRef);
|
|
78
77
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -84,9 +83,7 @@ var TableRow = function (props) {
|
|
|
84
83
|
return (react_1.default.createElement(TableCell_1.TableCell, { key: cell.getCellProps().key, cell: cell, cellIndex: index, isDisabled: isDisabled, tableHasSubRows: tableHasSubRows, tableInstance: tableInstance, expanderCell: expanderCell }));
|
|
85
84
|
})),
|
|
86
85
|
subComponent && (react_1.default.createElement(utils_1.WithCSSTransition, { in: row.isExpanded },
|
|
87
|
-
react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-row', 'iui-expanded-content',
|
|
88
|
-
'iui-disabled': isDisabled,
|
|
89
|
-
}) }, subComponent(row))))));
|
|
86
|
+
react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-table-row', 'iui-table-expanded-content'), "aria-disabled": isDisabled }, subComponent(row))))));
|
|
90
87
|
};
|
|
91
88
|
exports.TableRow = TableRow;
|
|
92
89
|
var hasAnySelectedSubRow = function (row, selectedRowIds) {
|
|
@@ -44,18 +44,13 @@ var classnames_1 = __importDefault(require("classnames"));
|
|
|
44
44
|
* }
|
|
45
45
|
*/
|
|
46
46
|
var DefaultCell = function (props) {
|
|
47
|
-
var _a;
|
|
48
47
|
// Omitting `cellProps`
|
|
49
48
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
50
|
-
var
|
|
51
|
-
return (react_1.default.createElement("div", __assign({}, cellElementProps, rest, { className: (0, classnames_1.default)(cellElementClassName, className, (
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
_a["iui-".concat(status)] = !!status,
|
|
55
|
-
_a)), style: __assign(__assign({}, cellElementStyle), style) }),
|
|
56
|
-
startIcon && react_1.default.createElement("div", { className: 'iui-cell-start-icon' }, startIcon),
|
|
49
|
+
var _a = props.cellElementProps, cellElementClassName = _a.className, cellElementStyle = _a.style, cellElementProps = __rest(_a, ["className", "style"]), children = props.children, startIcon = props.startIcon, endIcon = props.endIcon, cellProps = props.cellProps, isDisabled = props.isDisabled, className = props.className, style = props.style, status = props.status, rest = __rest(props, ["cellElementProps", "children", "startIcon", "endIcon", "cellProps", "isDisabled", "className", "style", "status"]);
|
|
50
|
+
return (react_1.default.createElement("div", __assign({}, cellElementProps, rest, { className: (0, classnames_1.default)(cellElementClassName, className), "aria-disabled": (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(cellProps.row.original)) || undefined, "data-iui-status": status, style: __assign(__assign({}, cellElementStyle), style) }),
|
|
51
|
+
startIcon && (react_1.default.createElement("div", { className: 'iui-table-cell-start-icon' }, startIcon)),
|
|
57
52
|
children,
|
|
58
|
-
endIcon && react_1.default.createElement("div", { className: 'iui-cell-end-icon' }, endIcon)));
|
|
53
|
+
endIcon && react_1.default.createElement("div", { className: 'iui-table-cell-end-icon' }, endIcon)));
|
|
59
54
|
};
|
|
60
55
|
exports.DefaultCell = DefaultCell;
|
|
61
56
|
exports.default = exports.DefaultCell;
|
|
@@ -113,7 +113,7 @@ var ActionColumn = function (_a) {
|
|
|
113
113
|
var _a;
|
|
114
114
|
setIsOpen(true);
|
|
115
115
|
(_a = dropdownMenuProps.onShow) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, i);
|
|
116
|
-
},
|
|
116
|
+
}, className: (0, classnames_1.default)('iui-scroll', dropdownMenuProps.className) }),
|
|
117
117
|
react_1.default.createElement(IconButton_1.IconButton, { styleType: 'borderless', isActive: isOpen, ref: buttonRef },
|
|
118
118
|
react_1.default.createElement(ColumnManager_1.default, null))));
|
|
119
119
|
},
|
|
@@ -69,7 +69,7 @@ var ExpanderColumn = function (props) {
|
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
return (react_1.default.createElement(Buttons_1.IconButton, { className: 'iui-row-expander', styleType: 'borderless', size: 'small', onClick: function (e) {
|
|
72
|
+
return (react_1.default.createElement(Buttons_1.IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: function (e) {
|
|
73
73
|
e.stopPropagation();
|
|
74
74
|
row.toggleRowExpanded();
|
|
75
75
|
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original) }, react_1.default.createElement(ChevronRight_1.default, null)));
|
|
@@ -29,7 +29,7 @@ var utils_1 = require("../../utils");
|
|
|
29
29
|
var BaseFilter = function (props) {
|
|
30
30
|
var children = props.children, className = props.className, style = props.style, id = props.id;
|
|
31
31
|
(0, utils_1.useTheme)();
|
|
32
|
-
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-column-filter', className), style: style,
|
|
32
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-table-column-filter', className), style: style,
|
|
33
33
|
// Prevents from triggering sort
|
|
34
34
|
onClick: function (e) {
|
|
35
35
|
e.stopPropagation();
|
|
@@ -55,7 +55,7 @@ var FilterToggle = function (props) {
|
|
|
55
55
|
}, [close, column]);
|
|
56
56
|
var isColumnFiltered = column.filterValue != null && column.filterValue !== '';
|
|
57
57
|
return (react_1.default.createElement(react_1.default.Fragment, null, column.canFilter && column.Filter && (react_1.default.createElement(utils_1.Popover, { content: column.render('Filter', { close: close, setFilter: setFilter, clearFilter: clearFilter }), placement: 'bottom-start', visible: isVisible, onClickOutside: close },
|
|
58
|
-
react_1.default.createElement(Buttons_1.IconButton, __assign({ styleType: 'borderless', isActive: isVisible || isColumnFiltered, className: (0, classnames_1.default)('iui-filter-button', className), onClick: function (e) {
|
|
58
|
+
react_1.default.createElement(Buttons_1.IconButton, __assign({ styleType: 'borderless', isActive: isVisible || isColumnFiltered, className: (0, classnames_1.default)('iui-table-filter-button', className), onClick: function (e) {
|
|
59
59
|
setIsVisible(function (v) { return !v; });
|
|
60
60
|
// Prevents from triggering sort
|
|
61
61
|
e.stopPropagation();
|
|
@@ -45,13 +45,13 @@ var defaultGetDragAndDropProps = function (isEnabled) { return function (props,
|
|
|
45
45
|
};
|
|
46
46
|
var setOnDragColumnStyle = function (event, position) {
|
|
47
47
|
var columnElement = event.currentTarget;
|
|
48
|
-
columnElement.classList.remove('iui-reorder-column-right');
|
|
49
|
-
columnElement.classList.remove('iui-reorder-column-left');
|
|
48
|
+
columnElement.classList.remove('iui-table-reorder-column-right');
|
|
49
|
+
columnElement.classList.remove('iui-table-reorder-column-left');
|
|
50
50
|
if (position === 'left') {
|
|
51
|
-
columnElement.classList.add('iui-reorder-column-left');
|
|
51
|
+
columnElement.classList.add('iui-table-reorder-column-left');
|
|
52
52
|
}
|
|
53
53
|
else if (position === 'right') {
|
|
54
|
-
columnElement.classList.add('iui-reorder-column-right');
|
|
54
|
+
columnElement.classList.add('iui-table-reorder-column-right');
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
var reorderColumns = function (tableColumns, srcIndex, dstIndex) {
|
|
@@ -22,123 +22,127 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.useResizeColumns = void 0;
|
|
24
24
|
var react_table_1 = require("react-table");
|
|
25
|
-
var useResizeColumns = function (ownerDocument) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
var useResizeColumns = function (ownerDocument) {
|
|
26
|
+
return function (hooks) {
|
|
27
|
+
hooks.getResizerProps = [defaultGetResizerProps(ownerDocument)];
|
|
28
|
+
hooks.stateReducers.push(reducer);
|
|
29
|
+
hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
30
32
|
exports.useResizeColumns = useResizeColumns;
|
|
31
33
|
var isTouchEvent = function (event) {
|
|
32
34
|
return event.type === 'touchstart';
|
|
33
35
|
};
|
|
34
|
-
var defaultGetResizerProps = function (ownerDocument) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
d
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
36
|
+
var defaultGetResizerProps = function (ownerDocument) {
|
|
37
|
+
return function (props, _a) {
|
|
38
|
+
var instance = _a.instance, header = _a.header, nextHeader = _a.nextHeader;
|
|
39
|
+
var dispatch = instance.dispatch;
|
|
40
|
+
var onResizeStart = function (e, header) {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
// lets not respond to multiple touches (e.g. 2 or 3 fingers)
|
|
43
|
+
if (isTouchEvent(e) && e.touches && e.touches.length > 1) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
var headerIdWidths = getLeafHeaders(header).map(function (d) { return [
|
|
47
|
+
d.id,
|
|
48
|
+
getHeaderWidth(d),
|
|
49
|
+
]; });
|
|
50
|
+
var nextHeaderIdWidths = nextHeader
|
|
51
|
+
? getLeafHeaders(nextHeader).map(function (d) { return [d.id, getHeaderWidth(d)]; })
|
|
52
|
+
: [];
|
|
53
|
+
var clientX = isTouchEvent(e)
|
|
54
|
+
? Math.round(e.touches[0].clientX)
|
|
55
|
+
: e.clientX;
|
|
56
|
+
var dispatchMove = function (clientXPos) {
|
|
57
|
+
return dispatch({ type: react_table_1.actions.columnResizing, clientX: clientXPos });
|
|
58
|
+
};
|
|
59
|
+
var dispatchEnd = function () {
|
|
60
|
+
return dispatch({
|
|
61
|
+
type: react_table_1.actions.columnDoneResizing,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
var handlersAndEvents = {
|
|
65
|
+
mouse: {
|
|
66
|
+
moveEvent: 'mousemove',
|
|
67
|
+
moveHandler: function (e) { return dispatchMove(e.clientX); },
|
|
68
|
+
upEvent: 'mouseup',
|
|
69
|
+
upHandler: function () {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
(_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler);
|
|
72
|
+
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler);
|
|
73
|
+
(_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
|
|
74
|
+
dispatchEnd();
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
touch: {
|
|
78
|
+
moveEvent: 'touchmove',
|
|
79
|
+
moveHandler: function (e) {
|
|
80
|
+
if (e.cancelable) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
}
|
|
84
|
+
dispatchMove(e.touches[0].clientX);
|
|
85
|
+
},
|
|
86
|
+
upEvent: 'touchend',
|
|
87
|
+
upHandler: function () {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
(_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(handlersAndEvents.touch.moveEvent, handlersAndEvents.touch.moveHandler);
|
|
90
|
+
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);
|
|
91
|
+
dispatchEnd();
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
var events = isTouchEvent(e)
|
|
96
|
+
? handlersAndEvents.touch
|
|
97
|
+
: handlersAndEvents.mouse;
|
|
98
|
+
var passiveIfSupported = passiveEventSupported()
|
|
99
|
+
? { passive: false }
|
|
100
|
+
: false;
|
|
101
|
+
(_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);
|
|
102
|
+
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);
|
|
103
|
+
if (!isTouchEvent(e)) {
|
|
104
|
+
(_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', handlersAndEvents.mouse.upHandler, passiveIfSupported);
|
|
105
|
+
}
|
|
106
|
+
dispatch({
|
|
107
|
+
type: react_table_1.actions.columnStartResizing,
|
|
108
|
+
columnId: header.id,
|
|
109
|
+
columnWidth: getHeaderWidth(header),
|
|
110
|
+
nextColumnWidth: getHeaderWidth(nextHeader),
|
|
111
|
+
headerIdWidths: headerIdWidths,
|
|
112
|
+
nextHeaderIdWidths: nextHeaderIdWidths,
|
|
113
|
+
clientX: clientX,
|
|
59
114
|
});
|
|
60
115
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _a, _b, _c;
|
|
68
|
-
(_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler);
|
|
69
|
-
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler);
|
|
70
|
-
(_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
|
|
71
|
-
dispatchEnd();
|
|
116
|
+
return [
|
|
117
|
+
props,
|
|
118
|
+
{
|
|
119
|
+
onClick: function (e) {
|
|
120
|
+
// Prevents from triggering sort
|
|
121
|
+
e.stopPropagation();
|
|
72
122
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
dispatchMove(e.touches[0].clientX);
|
|
123
|
+
onMouseDown: function (e) {
|
|
124
|
+
e.persist();
|
|
125
|
+
// Prevents from triggering drag'n'drop
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
// Prevents from triggering sort
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
onResizeStart(e, header);
|
|
82
130
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(
|
|
88
|
-
dispatchEnd();
|
|
131
|
+
onTouchStart: function (e) {
|
|
132
|
+
e.persist();
|
|
133
|
+
// Prevents from triggering drag'n'drop
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
onResizeStart(e, header);
|
|
89
136
|
},
|
|
137
|
+
style: {
|
|
138
|
+
cursor: 'col-resize',
|
|
139
|
+
},
|
|
140
|
+
draggable: false,
|
|
141
|
+
role: 'separator',
|
|
90
142
|
},
|
|
91
|
-
|
|
92
|
-
var events = isTouchEvent(e)
|
|
93
|
-
? handlersAndEvents.touch
|
|
94
|
-
: handlersAndEvents.mouse;
|
|
95
|
-
var passiveIfSupported = passiveEventSupported()
|
|
96
|
-
? { passive: false }
|
|
97
|
-
: false;
|
|
98
|
-
(_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);
|
|
99
|
-
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);
|
|
100
|
-
if (!isTouchEvent(e)) {
|
|
101
|
-
(_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', handlersAndEvents.mouse.upHandler, passiveIfSupported);
|
|
102
|
-
}
|
|
103
|
-
dispatch({
|
|
104
|
-
type: react_table_1.actions.columnStartResizing,
|
|
105
|
-
columnId: header.id,
|
|
106
|
-
columnWidth: getHeaderWidth(header),
|
|
107
|
-
nextColumnWidth: getHeaderWidth(nextHeader),
|
|
108
|
-
headerIdWidths: headerIdWidths,
|
|
109
|
-
nextHeaderIdWidths: nextHeaderIdWidths,
|
|
110
|
-
clientX: clientX,
|
|
111
|
-
});
|
|
143
|
+
];
|
|
112
144
|
};
|
|
113
|
-
|
|
114
|
-
props,
|
|
115
|
-
{
|
|
116
|
-
onClick: function (e) {
|
|
117
|
-
// Prevents from triggering sort
|
|
118
|
-
e.stopPropagation();
|
|
119
|
-
},
|
|
120
|
-
onMouseDown: function (e) {
|
|
121
|
-
e.persist();
|
|
122
|
-
// Prevents from triggering drag'n'drop
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
// Prevents from triggering sort
|
|
125
|
-
e.stopPropagation();
|
|
126
|
-
onResizeStart(e, header);
|
|
127
|
-
},
|
|
128
|
-
onTouchStart: function (e) {
|
|
129
|
-
e.persist();
|
|
130
|
-
// Prevents from triggering drag'n'drop
|
|
131
|
-
e.preventDefault();
|
|
132
|
-
onResizeStart(e, header);
|
|
133
|
-
},
|
|
134
|
-
style: {
|
|
135
|
-
cursor: 'col-resize',
|
|
136
|
-
},
|
|
137
|
-
draggable: false,
|
|
138
|
-
role: 'separator',
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
}; };
|
|
145
|
+
};
|
|
142
146
|
exports.useResizeColumns.pluginName = 'useResizeColumns';
|
|
143
147
|
var reducer = function (newState, action, previousState, instance) {
|
|
144
148
|
if (action.type === react_table_1.actions.init) {
|
package/cjs/core/Tabs/Tab.d.ts
CHANGED
|
@@ -22,10 +22,6 @@ export declare type TabProps = {
|
|
|
22
22
|
*/
|
|
23
23
|
children?: React.ReactNode;
|
|
24
24
|
} & React.HTMLAttributes<HTMLButtonElement>;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use `TabProps` instead.
|
|
27
|
-
*/
|
|
28
|
-
export declare type HorizontalTabProps = TabProps;
|
|
29
25
|
/**
|
|
30
26
|
* Individual tab component to be used in the `labels` prop of `Tabs`.
|
|
31
27
|
* @example
|
|
@@ -35,8 +31,4 @@ export declare type HorizontalTabProps = TabProps;
|
|
|
35
31
|
* ];
|
|
36
32
|
*/
|
|
37
33
|
export declare const Tab: (props: TabProps) => JSX.Element;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use `Tab` instead.
|
|
40
|
-
*/
|
|
41
|
-
export declare const HorizontalTab: (props: TabProps) => JSX.Element;
|
|
42
34
|
export default TabProps;
|
package/cjs/core/Tabs/Tab.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
28
|
+
exports.Tab = void 0;
|
|
29
29
|
/*---------------------------------------------------------------------------------------------
|
|
30
30
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
31
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -57,7 +57,3 @@ var Tab = function (props) {
|
|
|
57
57
|
children));
|
|
58
58
|
};
|
|
59
59
|
exports.Tab = Tab;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use `Tab` instead.
|
|
62
|
-
*/
|
|
63
|
-
exports.HorizontalTab = exports.Tab;
|
package/cjs/core/Tabs/Tabs.js
CHANGED
|
@@ -60,24 +60,23 @@ var Tab_1 = require("./Tab");
|
|
|
60
60
|
* <Tabs labels={tabsWithIcons} type='pill' />
|
|
61
61
|
*/
|
|
62
62
|
var Tabs = function (props) {
|
|
63
|
-
var _a, _b, _c;
|
|
64
|
-
var labels = props.labels, activeIndex = props.activeIndex, onTabSelected = props.onTabSelected, _d = props.focusActivationMode, focusActivationMode = _d === void 0 ? 'auto' : _d, _e = props.type, type = _e === void 0 ? 'default' : _e, _f = props.color, color = _f === void 0 ? 'blue' : _f, _g = props.orientation, orientation = _g === void 0 ? 'horizontal' : _g, tabsClassName = props.tabsClassName, contentClassName = props.contentClassName, wrapperClassName = props.wrapperClassName, children = props.children, rest = __rest(props, ["labels", "activeIndex", "onTabSelected", "focusActivationMode", "type", "color", "orientation", "tabsClassName", "contentClassName", "wrapperClassName", "children"]);
|
|
63
|
+
var labels = props.labels, activeIndex = props.activeIndex, onTabSelected = props.onTabSelected, _a = props.focusActivationMode, focusActivationMode = _a === void 0 ? 'auto' : _a, _b = props.type, type = _b === void 0 ? 'default' : _b, _c = props.color, color = _c === void 0 ? 'blue' : _c, _d = props.orientation, orientation = _d === void 0 ? 'horizontal' : _d, tabsClassName = props.tabsClassName, contentClassName = props.contentClassName, wrapperClassName = props.wrapperClassName, children = props.children, rest = __rest(props, ["labels", "activeIndex", "onTabSelected", "focusActivationMode", "type", "color", "orientation", "tabsClassName", "contentClassName", "wrapperClassName", "children"]);
|
|
65
64
|
(0, utils_1.useTheme)();
|
|
66
65
|
var tablistRef = react_1.default.useRef(null);
|
|
67
|
-
var
|
|
66
|
+
var _e = (0, utils_1.useContainerWidth)(type !== 'default'), tablistSizeRef = _e[0], tabsWidth = _e[1];
|
|
68
67
|
var refs = (0, utils_1.useMergedRefs)(tablistRef, tablistSizeRef);
|
|
69
|
-
var
|
|
68
|
+
var _f = react_1.default.useState(function () {
|
|
70
69
|
return activeIndex != null
|
|
71
70
|
? (0, utils_1.getBoundedValue)(activeIndex, 0, labels.length - 1)
|
|
72
71
|
: 0;
|
|
73
|
-
}), currentActiveIndex =
|
|
72
|
+
}), currentActiveIndex = _f[0], setCurrentActiveIndex = _f[1];
|
|
74
73
|
react_1.default.useLayoutEffect(function () {
|
|
75
74
|
if (activeIndex != null && currentActiveIndex !== activeIndex) {
|
|
76
75
|
setCurrentActiveIndex((0, utils_1.getBoundedValue)(activeIndex, 0, labels.length - 1));
|
|
77
76
|
}
|
|
78
77
|
}, [activeIndex, currentActiveIndex, labels.length]);
|
|
79
78
|
// CSS custom properties to place the active stripe
|
|
80
|
-
var
|
|
79
|
+
var _g = react_1.default.useState({}), stripeProperties = _g[0], setStripeProperties = _g[1];
|
|
81
80
|
react_1.default.useLayoutEffect(function () {
|
|
82
81
|
if (type !== 'default' && tablistRef.current != undefined) {
|
|
83
82
|
var activeTab = tablistRef.current.children[currentActiveIndex];
|
|
@@ -91,14 +90,14 @@ var Tabs = function (props) {
|
|
|
91
90
|
})));
|
|
92
91
|
}
|
|
93
92
|
}, [currentActiveIndex, type, orientation, tabsWidth]);
|
|
94
|
-
var
|
|
93
|
+
var _h = react_1.default.useState(), focusedIndex = _h[0], setFocusedIndex = _h[1];
|
|
95
94
|
react_1.default.useEffect(function () {
|
|
96
95
|
if (tablistRef.current && focusedIndex !== undefined) {
|
|
97
96
|
var tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
|
|
98
97
|
tab === null || tab === void 0 ? void 0 : tab.focus();
|
|
99
98
|
}
|
|
100
99
|
}, [focusedIndex]);
|
|
101
|
-
var
|
|
100
|
+
var _j = react_1.default.useState(false), hasSublabel = _j[0], setHasSublabel = _j[1]; // used for setting size
|
|
102
101
|
react_1.default.useLayoutEffect(function () {
|
|
103
102
|
var _a;
|
|
104
103
|
setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
|
|
@@ -171,12 +170,10 @@ var Tabs = function (props) {
|
|
|
171
170
|
break;
|
|
172
171
|
}
|
|
173
172
|
};
|
|
174
|
-
var isIE = !((_c = (_b = (_a = (0, utils_1.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'));
|
|
175
173
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-tabs-wrapper', "iui-".concat(orientation), wrapperClassName), style: stripeProperties },
|
|
176
174
|
react_1.default.createElement("ul", __assign({ className: (0, classnames_1.default)('iui-tabs', "iui-".concat(type), {
|
|
177
175
|
'iui-green': color === 'green',
|
|
178
|
-
'iui-animated': type !== 'default'
|
|
179
|
-
'iui-not-animated': isIE,
|
|
176
|
+
'iui-animated': type !== 'default',
|
|
180
177
|
'iui-large': hasSublabel,
|
|
181
178
|
}, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown }, rest), labels.map(function (label, index) {
|
|
182
179
|
var onClick = function () {
|
package/cjs/core/Tabs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { VerticalTabs, HorizontalTabs } from './Tabs';
|
|
2
2
|
export type { VerticalTabsProps, HorizontalTabsProps } from './Tabs';
|
|
3
|
-
export { Tab
|
|
4
|
-
export type { TabProps
|
|
3
|
+
export { Tab } from './Tab';
|
|
4
|
+
export type { TabProps } from './Tab';
|
package/cjs/core/Tabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Tab = exports.HorizontalTabs = exports.VerticalTabs = void 0;
|
|
4
4
|
/*---------------------------------------------------------------------------------------------
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -10,4 +10,3 @@ Object.defineProperty(exports, "VerticalTabs", { enumerable: true, get: function
|
|
|
10
10
|
Object.defineProperty(exports, "HorizontalTabs", { enumerable: true, get: function () { return Tabs_1.HorizontalTabs; } });
|
|
11
11
|
var Tab_1 = require("./Tab");
|
|
12
12
|
Object.defineProperty(exports, "Tab", { enumerable: true, get: function () { return Tab_1.Tab; } });
|
|
13
|
-
Object.defineProperty(exports, "HorizontalTab", { enumerable: true, get: function () { return Tab_1.HorizontalTab; } });
|
|
@@ -33,7 +33,7 @@ exports.Textarea = void 0;
|
|
|
33
33
|
var classnames_1 = __importDefault(require("classnames"));
|
|
34
34
|
var react_1 = __importDefault(require("react"));
|
|
35
35
|
var utils_1 = require("../utils");
|
|
36
|
-
require("@itwin/itwinui-css/css/
|
|
36
|
+
require("@itwin/itwinui-css/css/input.css");
|
|
37
37
|
/**
|
|
38
38
|
* Basic textarea component
|
|
39
39
|
* @example
|
|
@@ -50,6 +50,6 @@ exports.Textarea = react_1.default.forwardRef(function (props, ref) {
|
|
|
50
50
|
textAreaRef.current.focus();
|
|
51
51
|
}
|
|
52
52
|
}, [setFocus]);
|
|
53
|
-
return (react_1.default.createElement("textarea", __assign({ className: (0, classnames_1.default)('iui-
|
|
53
|
+
return (react_1.default.createElement("textarea", __assign({ className: (0, classnames_1.default)('iui-input', className), rows: rows, ref: refs }, rest)));
|
|
54
54
|
});
|
|
55
55
|
exports.default = exports.Textarea;
|