@itwin/itwinui-react 3.19.0 → 3.19.2
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 +18 -0
- package/DEV-cjs/core/Avatar/Avatar.js +0 -2
- package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +10 -5
- package/DEV-cjs/core/Table/columns/expanderColumn.js +20 -25
- package/DEV-cjs/core/Table/columns/selectionColumn.js +8 -14
- package/DEV-cjs/core/Table/hooks/useExpanderCell.js +6 -10
- package/DEV-cjs/styles.js +1 -1
- package/DEV-esm/core/Avatar/Avatar.js +0 -2
- package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +11 -5
- package/DEV-esm/core/Table/columns/expanderColumn.js +20 -25
- package/DEV-esm/core/Table/columns/selectionColumn.js +8 -14
- package/DEV-esm/core/Table/hooks/useExpanderCell.js +6 -10
- package/DEV-esm/styles.js +1 -1
- package/cjs/core/Avatar/Avatar.d.ts +4 -8
- package/cjs/core/Avatar/Avatar.js +0 -2
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +0 -3
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +10 -5
- package/cjs/core/Buttons/IconButton.d.ts +1 -1
- package/cjs/core/Carousel/Carousel.d.ts +4 -4
- package/cjs/core/Carousel/CarouselNavigation.d.ts +4 -4
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -2
- package/cjs/core/Table/columns/expanderColumn.js +20 -25
- package/cjs/core/Table/columns/selectionColumn.d.ts +2 -2
- package/cjs/core/Table/columns/selectionColumn.js +8 -14
- package/cjs/core/Table/hooks/useExpanderCell.js +6 -10
- package/cjs/core/Tile/Tile.d.ts +2 -2
- package/cjs/core/TransferList/TransferList.d.ts +7 -5
- package/cjs/core/Typography/Kbd.d.ts +1 -1
- package/cjs/styles.js +1 -1
- package/esm/core/Avatar/Avatar.d.ts +4 -8
- package/esm/core/Avatar/Avatar.js +0 -2
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +0 -3
- package/esm/core/Breadcrumbs/Breadcrumbs.js +11 -5
- package/esm/core/Buttons/IconButton.d.ts +1 -1
- package/esm/core/Carousel/Carousel.d.ts +4 -4
- package/esm/core/Carousel/CarouselNavigation.d.ts +4 -4
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -2
- package/esm/core/Table/columns/expanderColumn.js +20 -25
- package/esm/core/Table/columns/selectionColumn.d.ts +2 -2
- package/esm/core/Table/columns/selectionColumn.js +8 -14
- package/esm/core/Table/hooks/useExpanderCell.js +6 -10
- package/esm/core/Tile/Tile.d.ts +2 -2
- package/esm/core/TransferList/TransferList.d.ts +7 -5
- package/esm/core/Typography/Kbd.d.ts +1 -1
- package/esm/styles.js +1 -1
- package/package.json +1 -1
- package/styles.css +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { CellRendererProps, HeaderProps } from '../../../react-table/react-table.js';
|
|
2
|
+
import type { CellProps, CellRendererProps, HeaderProps } from '../../../react-table/react-table.js';
|
|
3
3
|
export declare const SELECTION_CELL_ID = "iui-table-checkbox-selector";
|
|
4
4
|
/**
|
|
5
5
|
* Selection column that adds selection checkbox column to the Table.
|
|
@@ -28,6 +28,6 @@ export declare const SelectionColumn: <T extends Record<string, unknown>>(props?
|
|
|
28
28
|
columnClassName: string;
|
|
29
29
|
cellClassName: string;
|
|
30
30
|
Header: ({ getToggleAllRowsSelectedProps, toggleAllRowsSelected, rows, preFilteredFlatRows, state, }: HeaderProps<T>) => React.JSX.Element;
|
|
31
|
-
Cell: () =>
|
|
31
|
+
Cell: ({ row, selectSubRows }: CellProps<T>) => React.JSX.Element;
|
|
32
32
|
cellRenderer: (props: CellRendererProps<T>) => React.JSX.Element;
|
|
33
33
|
};
|
|
@@ -64,10 +64,8 @@ const SelectionColumn = (props = {}) => {
|
|
|
64
64
|
onChange: () => toggleAllRowsSelected(nextToggleState),
|
|
65
65
|
});
|
|
66
66
|
},
|
|
67
|
-
Cell: () =>
|
|
68
|
-
|
|
69
|
-
let { row, selectSubRows = true } = props.cellProps;
|
|
70
|
-
let children = _react.createElement(_Checkbox.Checkbox, {
|
|
67
|
+
Cell: ({ row, selectSubRows = true }) =>
|
|
68
|
+
_react.createElement(_Checkbox.Checkbox, {
|
|
71
69
|
...row.getToggleRowSelectedProps(),
|
|
72
70
|
style: {},
|
|
73
71
|
title: '',
|
|
@@ -87,15 +85,11 @@ const SelectionColumn = (props = {}) => {
|
|
|
87
85
|
);
|
|
88
86
|
else row.toggleRowSelected(!row.isSelected);
|
|
89
87
|
},
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
children,
|
|
98
|
-
);
|
|
99
|
-
},
|
|
88
|
+
}),
|
|
89
|
+
cellRenderer: (props) =>
|
|
90
|
+
_react.createElement(_index.DefaultCell, {
|
|
91
|
+
...props,
|
|
92
|
+
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
93
|
+
}),
|
|
100
94
|
};
|
|
101
95
|
};
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, 'useExpanderCell', {
|
|
|
11
11
|
const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require('react'));
|
|
13
13
|
const _index = require('../columns/index.js');
|
|
14
|
-
const _DefaultCell = require('../cells/DefaultCell.js');
|
|
15
14
|
const useExpanderCell =
|
|
16
15
|
(subComponent, expanderCell, isRowDisabled) => (hooks) => {
|
|
17
16
|
if (!subComponent) return;
|
|
@@ -27,17 +26,14 @@ const useExpanderCell =
|
|
|
27
26
|
return [
|
|
28
27
|
{
|
|
29
28
|
...expanderColumn,
|
|
30
|
-
|
|
31
|
-
? (
|
|
29
|
+
Cell: expanderCell
|
|
30
|
+
? (cellProps) =>
|
|
32
31
|
_react.createElement(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
isDisabled: (rowData) => !!isRowDisabled?.(rowData),
|
|
37
|
-
},
|
|
38
|
-
expanderCell(props.cellProps),
|
|
32
|
+
_react.Fragment,
|
|
33
|
+
null,
|
|
34
|
+
expanderCell(cellProps),
|
|
39
35
|
)
|
|
40
|
-
: expanderColumn.
|
|
36
|
+
: expanderColumn.Cell,
|
|
41
37
|
},
|
|
42
38
|
...columns,
|
|
43
39
|
];
|
package/cjs/core/Tile/Tile.d.ts
CHANGED
|
@@ -247,13 +247,13 @@ export declare const Tile: PolymorphicForwardRefComponent<"div", TileLegacyProps
|
|
|
247
247
|
/**
|
|
248
248
|
* `IconButton` subcomponent: custom icon for `QuickAction` and `TypeIndicator` buttons.
|
|
249
249
|
*/
|
|
250
|
-
IconButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
250
|
+
IconButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
251
251
|
isActive?: boolean;
|
|
252
252
|
label?: React.ReactNode;
|
|
253
253
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
254
254
|
iconProps?: React.ComponentProps<"span">;
|
|
255
255
|
title?: string;
|
|
256
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
256
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
257
257
|
as?: "button" | undefined;
|
|
258
258
|
}, "ref">>;
|
|
259
259
|
/**
|
|
@@ -32,25 +32,27 @@ type TransferListListboxLabelOwnProps = {
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const TransferList: PolymorphicForwardRefComponent<"div", {}> & {
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* TransferList listbox wrapper subcomponent
|
|
36
36
|
*/
|
|
37
37
|
ListboxWrapper: PolymorphicForwardRefComponent<"div", TransferListListboxWrapperOwnProps>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* TransferList listbox subcomponent
|
|
40
40
|
*/
|
|
41
41
|
Listbox: PolymorphicForwardRefComponent<"ul", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as"> & {
|
|
42
42
|
as?: "div" | undefined;
|
|
43
43
|
}>;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* TransferList item subcomponent.
|
|
46
|
+
*
|
|
47
|
+
* Renders a `ListItem` and is compatible with `ListItem`'s [subcomponents](https://itwinui.bentley.com/docs/list#with-subcomponents).
|
|
46
48
|
*/
|
|
47
49
|
Item: PolymorphicForwardRefComponent<"li", TransferListItemOwnProps>;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* TransferList listbox label subcomponent
|
|
50
52
|
*/
|
|
51
53
|
ListboxLabel: PolymorphicForwardRefComponent<"div", TransferListListboxLabelOwnProps>;
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
55
|
+
* TransferList toolbar subcomponent
|
|
54
56
|
*/
|
|
55
57
|
Toolbar: PolymorphicForwardRefComponent<"div", object>;
|
|
56
58
|
};
|
package/cjs/styles.js
CHANGED
|
@@ -15,10 +15,6 @@ type AvatarProps = {
|
|
|
15
15
|
* Status/Availability of a user.
|
|
16
16
|
*/
|
|
17
17
|
status?: AvatarStatus;
|
|
18
|
-
/**
|
|
19
|
-
* Text which will appear when hovering over the icon.
|
|
20
|
-
*/
|
|
21
|
-
title?: string;
|
|
22
18
|
/**
|
|
23
19
|
* Abbreviation to be displayed.
|
|
24
20
|
*/
|
|
@@ -41,16 +37,16 @@ export declare const defaultStatusTitles: StatusTitles;
|
|
|
41
37
|
* Basic avatar component
|
|
42
38
|
* @example
|
|
43
39
|
* <caption>Small icon with abbreviation</caption>
|
|
44
|
-
* <Avatar size='small'
|
|
40
|
+
* <Avatar size='small' abbreviation='TR' backgroundColor='green'/>
|
|
45
41
|
* @example
|
|
46
42
|
* <caption>Medium icon with image</caption>
|
|
47
|
-
* <Avatar size='medium'
|
|
43
|
+
* <Avatar size='medium' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
48
44
|
* @example
|
|
49
45
|
* <caption>Large icon with status</caption>
|
|
50
|
-
* <Avatar size='large'
|
|
46
|
+
* <Avatar size='large' abbreviation='TR' backgroundColor='green' status='online' />
|
|
51
47
|
* @example
|
|
52
48
|
* <caption>X-large icon with image</caption>
|
|
53
|
-
* <Avatar size='x-large'
|
|
49
|
+
* <Avatar size='x-large' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
54
50
|
*/
|
|
55
51
|
export declare const Avatar: PolymorphicForwardRefComponent<"span", AvatarProps>;
|
|
56
52
|
export {};
|
|
@@ -19,7 +19,6 @@ export const Avatar = React.forwardRef((props, ref) => {
|
|
|
19
19
|
abbreviation,
|
|
20
20
|
image,
|
|
21
21
|
backgroundColor,
|
|
22
|
-
title,
|
|
23
22
|
translatedStatusTitles,
|
|
24
23
|
className,
|
|
25
24
|
style,
|
|
@@ -36,7 +35,6 @@ export const Avatar = React.forwardRef((props, ref) => {
|
|
|
36
35
|
className: cx('iui-avatar', className),
|
|
37
36
|
'data-iui-size': 'medium' !== size ? size : void 0,
|
|
38
37
|
'data-iui-status': status,
|
|
39
|
-
title: title,
|
|
40
38
|
style: {
|
|
41
39
|
backgroundColor: getBackground(backgroundColor),
|
|
42
40
|
...style,
|
|
@@ -43,17 +43,14 @@ type AvatarGroupProps = {
|
|
|
43
43
|
* <Avatar
|
|
44
44
|
* abbreviation="TR"
|
|
45
45
|
* backgroundColor={getUserColor("Terry Rivers")}
|
|
46
|
-
* title="Terry Rivers"
|
|
47
46
|
* />
|
|
48
47
|
* <Avatar
|
|
49
48
|
* abbreviation="RM"
|
|
50
49
|
* backgroundColor={getUserColor("Robin Mercer")}
|
|
51
|
-
* title="Robin Mercer"
|
|
52
50
|
* />
|
|
53
51
|
* <Avatar
|
|
54
52
|
* abbreviation="JM"
|
|
55
53
|
* backgroundColor={getUserColor("Jean Mullins")}
|
|
56
|
-
* title="Jean Mullins"
|
|
57
54
|
* />
|
|
58
55
|
* </AvatarGroup>
|
|
59
56
|
*/
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Box,
|
|
6
6
|
OverflowContainer,
|
|
7
7
|
useWarningLogger,
|
|
8
|
+
cloneElementWithRef,
|
|
8
9
|
} from '../../utils/index.js';
|
|
9
10
|
import { Button } from '../Buttons/Button.js';
|
|
10
11
|
import { Anchor } from '../Typography/Anchor.js';
|
|
@@ -134,17 +135,22 @@ let ListItem = ({ item, isActive }) => {
|
|
|
134
135
|
);
|
|
135
136
|
children = React.createElement(BreadcrumbsItem, children.props);
|
|
136
137
|
}
|
|
138
|
+
let getProps = React.useCallback(
|
|
139
|
+
(children) => {
|
|
140
|
+
let defaultAriaCurrent = isActive ? 'location' : void 0;
|
|
141
|
+
return {
|
|
142
|
+
'aria-current': children.props['aria-current'] ?? defaultAriaCurrent,
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
[isActive],
|
|
146
|
+
);
|
|
137
147
|
return React.createElement(
|
|
138
148
|
Box,
|
|
139
149
|
{
|
|
140
150
|
as: 'li',
|
|
141
151
|
className: 'iui-breadcrumbs-item',
|
|
142
152
|
},
|
|
143
|
-
children
|
|
144
|
-
React.cloneElement(children, {
|
|
145
|
-
'aria-current':
|
|
146
|
-
children.props['aria-current'] ?? isActive ? 'location' : void 0,
|
|
147
|
-
}),
|
|
153
|
+
children ? cloneElementWithRef(children, getProps) : null,
|
|
148
154
|
);
|
|
149
155
|
};
|
|
150
156
|
let Separator = ({ separator }) =>
|
|
@@ -25,7 +25,7 @@ export type IconButtonProps = {
|
|
|
25
25
|
* @deprecated Use `label` instead.
|
|
26
26
|
*/
|
|
27
27
|
title?: string;
|
|
28
|
-
} & Omit<ButtonProps, 'startIcon' | 'endIcon' | 'startIconProps' | 'endIconProps' | 'labelProps' | 'loading'>;
|
|
28
|
+
} & Omit<ButtonProps, 'startIcon' | 'endIcon' | 'startIconProps' | 'endIconProps' | 'labelProps' | 'loading' | 'stretched'>;
|
|
29
29
|
/**
|
|
30
30
|
* Icon button
|
|
31
31
|
* @example
|
|
@@ -40,22 +40,22 @@ export declare const Carousel: PolymorphicForwardRefComponent<"section", Carouse
|
|
|
40
40
|
* Contains the dots and previous/next buttons for navigating the slides. Must be present _before_ the slides in DOM.
|
|
41
41
|
*/
|
|
42
42
|
Navigation: PolymorphicForwardRefComponent<"div", {}> & {
|
|
43
|
-
PreviousButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
43
|
+
PreviousButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
44
44
|
isActive?: boolean;
|
|
45
45
|
label?: React.ReactNode;
|
|
46
46
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
47
47
|
iconProps?: React.ComponentProps<"span">;
|
|
48
48
|
title?: string;
|
|
49
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
49
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
50
50
|
as?: "button" | undefined;
|
|
51
51
|
}>;
|
|
52
|
-
NextButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
52
|
+
NextButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
53
53
|
isActive?: boolean;
|
|
54
54
|
label?: React.ReactNode;
|
|
55
55
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
56
56
|
iconProps?: React.ComponentProps<"span">;
|
|
57
57
|
title?: string;
|
|
58
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
58
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
59
59
|
as?: "button" | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
};
|
|
@@ -7,22 +7,22 @@ import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
|
|
|
7
7
|
* `children` can be specified to override what is shown in this navigation section.
|
|
8
8
|
*/
|
|
9
9
|
export declare const CarouselNavigation: PolymorphicForwardRefComponent<"div", {}> & {
|
|
10
|
-
PreviousButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
10
|
+
PreviousButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
11
11
|
isActive?: boolean;
|
|
12
12
|
label?: React.ReactNode;
|
|
13
13
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
14
14
|
iconProps?: React.ComponentProps<"span">;
|
|
15
15
|
title?: string;
|
|
16
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
16
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
17
17
|
as?: "button" | undefined;
|
|
18
18
|
}>;
|
|
19
|
-
NextButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
19
|
+
NextButton: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
20
20
|
isActive?: boolean;
|
|
21
21
|
label?: React.ReactNode;
|
|
22
22
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
23
23
|
iconProps?: React.ComponentProps<"span">;
|
|
24
24
|
title?: string;
|
|
25
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
25
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
26
26
|
as?: "button" | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
};
|
|
@@ -28,7 +28,7 @@ export declare const InputWithDecorations: PolymorphicForwardRefComponent<"div",
|
|
|
28
28
|
* Although similar to `IconButton`, this subcomponent additionally collapses the padding between the button and the input/textarea
|
|
29
29
|
* in `InputWithDecorations`.
|
|
30
30
|
*/
|
|
31
|
-
Button: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
31
|
+
Button: PolymorphicForwardRefComponent<"button", Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & Omit<import("../Buttons/IconButton.js").IconButtonProps, "styleType"> & {
|
|
32
32
|
styleType?: import("../Buttons/IconButton.js").IconButtonProps["styleType"];
|
|
33
33
|
} & {
|
|
34
34
|
as?: "button" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { CellRendererProps, Row } from '../../../react-table/react-table.js';
|
|
2
|
+
import type { CellProps, CellRendererProps, Row } from '../../../react-table/react-table.js';
|
|
3
3
|
export declare const EXPANDER_CELL_ID = "iui-table-expander";
|
|
4
4
|
/**
|
|
5
5
|
* Expander column that adds sub-content expander column to the Table.
|
|
@@ -39,6 +39,6 @@ export declare const ExpanderColumn: <T extends Record<string, unknown>>(props?:
|
|
|
39
39
|
maxWidth: number;
|
|
40
40
|
columnClassName: string;
|
|
41
41
|
cellClassName: string;
|
|
42
|
-
Cell: () => null;
|
|
42
|
+
Cell: (props: CellProps<T>) => React.JSX.Element | null;
|
|
43
43
|
cellRenderer: (props: CellRendererProps<T>) => React.JSX.Element;
|
|
44
44
|
};
|
|
@@ -15,35 +15,30 @@ export const ExpanderColumn = (props = {}) => {
|
|
|
15
15
|
maxWidth: 48,
|
|
16
16
|
columnClassName: 'iui-slot',
|
|
17
17
|
cellClassName: 'iui-slot',
|
|
18
|
-
Cell: () =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let children = subComponent?.(row)
|
|
22
|
-
? React.createElement(
|
|
23
|
-
IconButton,
|
|
24
|
-
{
|
|
25
|
-
'aria-label': 'Toggle expandable content',
|
|
26
|
-
className: 'iui-table-row-expander',
|
|
27
|
-
styleType: 'borderless',
|
|
28
|
-
size: 'small',
|
|
29
|
-
onClick: (e) => {
|
|
30
|
-
e.stopPropagation();
|
|
31
|
-
row.toggleRowExpanded();
|
|
32
|
-
},
|
|
33
|
-
disabled: isDisabled?.(row.original),
|
|
34
|
-
'aria-expanded': row.isExpanded,
|
|
35
|
-
},
|
|
36
|
-
React.createElement(SvgChevronRight, null),
|
|
37
|
-
)
|
|
38
|
-
: null;
|
|
18
|
+
Cell: (props) => {
|
|
19
|
+
let { row } = props;
|
|
20
|
+
if (!subComponent?.(row)) return null;
|
|
39
21
|
return React.createElement(
|
|
40
|
-
|
|
22
|
+
IconButton,
|
|
41
23
|
{
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
'aria-label': 'Toggle expandable content',
|
|
25
|
+
className: 'iui-table-row-expander',
|
|
26
|
+
styleType: 'borderless',
|
|
27
|
+
size: 'small',
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
row.toggleRowExpanded();
|
|
31
|
+
},
|
|
32
|
+
disabled: isDisabled?.(props.row.original),
|
|
33
|
+
'aria-expanded': row.isExpanded,
|
|
44
34
|
},
|
|
45
|
-
|
|
35
|
+
React.createElement(SvgChevronRight, null),
|
|
46
36
|
);
|
|
47
37
|
},
|
|
38
|
+
cellRenderer: (props) =>
|
|
39
|
+
React.createElement(DefaultCell, {
|
|
40
|
+
...props,
|
|
41
|
+
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
42
|
+
}),
|
|
48
43
|
};
|
|
49
44
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { CellRendererProps, HeaderProps } from '../../../react-table/react-table.js';
|
|
2
|
+
import type { CellProps, CellRendererProps, HeaderProps } from '../../../react-table/react-table.js';
|
|
3
3
|
export declare const SELECTION_CELL_ID = "iui-table-checkbox-selector";
|
|
4
4
|
/**
|
|
5
5
|
* Selection column that adds selection checkbox column to the Table.
|
|
@@ -28,6 +28,6 @@ export declare const SelectionColumn: <T extends Record<string, unknown>>(props?
|
|
|
28
28
|
columnClassName: string;
|
|
29
29
|
cellClassName: string;
|
|
30
30
|
Header: ({ getToggleAllRowsSelectedProps, toggleAllRowsSelected, rows, preFilteredFlatRows, state, }: HeaderProps<T>) => React.JSX.Element;
|
|
31
|
-
Cell: () =>
|
|
31
|
+
Cell: ({ row, selectSubRows }: CellProps<T>) => React.JSX.Element;
|
|
32
32
|
cellRenderer: (props: CellRendererProps<T>) => React.JSX.Element;
|
|
33
33
|
};
|
|
@@ -44,10 +44,8 @@ export const SelectionColumn = (props = {}) => {
|
|
|
44
44
|
onChange: () => toggleAllRowsSelected(nextToggleState),
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
|
-
Cell: () =>
|
|
48
|
-
|
|
49
|
-
let { row, selectSubRows = true } = props.cellProps;
|
|
50
|
-
let children = React.createElement(Checkbox, {
|
|
47
|
+
Cell: ({ row, selectSubRows = true }) =>
|
|
48
|
+
React.createElement(Checkbox, {
|
|
51
49
|
...row.getToggleRowSelectedProps(),
|
|
52
50
|
style: {},
|
|
53
51
|
title: '',
|
|
@@ -67,15 +65,11 @@ export const SelectionColumn = (props = {}) => {
|
|
|
67
65
|
);
|
|
68
66
|
else row.toggleRowSelected(!row.isSelected);
|
|
69
67
|
},
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
children,
|
|
78
|
-
);
|
|
79
|
-
},
|
|
68
|
+
}),
|
|
69
|
+
cellRenderer: (props) =>
|
|
70
|
+
React.createElement(DefaultCell, {
|
|
71
|
+
...props,
|
|
72
|
+
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
73
|
+
}),
|
|
80
74
|
};
|
|
81
75
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ExpanderColumn, EXPANDER_CELL_ID } from '../columns/index.js';
|
|
3
|
-
import { DefaultCell } from '../cells/DefaultCell.js';
|
|
4
3
|
export const useExpanderCell =
|
|
5
4
|
(subComponent, expanderCell, isRowDisabled) => (hooks) => {
|
|
6
5
|
if (!subComponent) return;
|
|
@@ -14,17 +13,14 @@ export const useExpanderCell =
|
|
|
14
13
|
return [
|
|
15
14
|
{
|
|
16
15
|
...expanderColumn,
|
|
17
|
-
|
|
18
|
-
? (
|
|
16
|
+
Cell: expanderCell
|
|
17
|
+
? (cellProps) =>
|
|
19
18
|
React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isDisabled: (rowData) => !!isRowDisabled?.(rowData),
|
|
24
|
-
},
|
|
25
|
-
expanderCell(props.cellProps),
|
|
19
|
+
React.Fragment,
|
|
20
|
+
null,
|
|
21
|
+
expanderCell(cellProps),
|
|
26
22
|
)
|
|
27
|
-
: expanderColumn.
|
|
23
|
+
: expanderColumn.Cell,
|
|
28
24
|
},
|
|
29
25
|
...columns,
|
|
30
26
|
];
|
package/esm/core/Tile/Tile.d.ts
CHANGED
|
@@ -247,13 +247,13 @@ export declare const Tile: PolymorphicForwardRefComponent<"div", TileLegacyProps
|
|
|
247
247
|
/**
|
|
248
248
|
* `IconButton` subcomponent: custom icon for `QuickAction` and `TypeIndicator` buttons.
|
|
249
249
|
*/
|
|
250
|
-
IconButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "
|
|
250
|
+
IconButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "title" | "as" | "size" | "htmlDisabled" | "styleType" | "labelProps" | "isActive" | "iconProps"> & {
|
|
251
251
|
isActive?: boolean;
|
|
252
252
|
label?: React.ReactNode;
|
|
253
253
|
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof import("../Tooltip/Tooltip.js").Tooltip>, "content" | "reference" | "ariaStrategy" | "children">;
|
|
254
254
|
iconProps?: React.ComponentProps<"span">;
|
|
255
255
|
title?: string;
|
|
256
|
-
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
|
|
256
|
+
} & Omit<import("../Buttons/Button.js").ButtonProps, "loading" | "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps" | "stretched"> & {
|
|
257
257
|
as?: "button" | undefined;
|
|
258
258
|
}, "ref">>;
|
|
259
259
|
/**
|
|
@@ -32,25 +32,27 @@ type TransferListListboxLabelOwnProps = {
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const TransferList: PolymorphicForwardRefComponent<"div", {}> & {
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* TransferList listbox wrapper subcomponent
|
|
36
36
|
*/
|
|
37
37
|
ListboxWrapper: PolymorphicForwardRefComponent<"div", TransferListListboxWrapperOwnProps>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* TransferList listbox subcomponent
|
|
40
40
|
*/
|
|
41
41
|
Listbox: PolymorphicForwardRefComponent<"ul", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as"> & {
|
|
42
42
|
as?: "div" | undefined;
|
|
43
43
|
}>;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* TransferList item subcomponent.
|
|
46
|
+
*
|
|
47
|
+
* Renders a `ListItem` and is compatible with `ListItem`'s [subcomponents](https://itwinui.bentley.com/docs/list#with-subcomponents).
|
|
46
48
|
*/
|
|
47
49
|
Item: PolymorphicForwardRefComponent<"li", TransferListItemOwnProps>;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* TransferList listbox label subcomponent
|
|
50
52
|
*/
|
|
51
53
|
ListboxLabel: PolymorphicForwardRefComponent<"div", TransferListListboxLabelOwnProps>;
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
55
|
+
* TransferList toolbar subcomponent
|
|
54
56
|
*/
|
|
55
57
|
Toolbar: PolymorphicForwardRefComponent<"div", object>;
|
|
56
58
|
};
|
package/esm/styles.js
CHANGED