@itwin/itwinui-react 1.42.0 → 1.43.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 +14 -0
- package/cjs/core/Backdrop/Backdrop.d.ts +10 -0
- package/cjs/core/Backdrop/Backdrop.js +41 -0
- package/cjs/core/Backdrop/index.d.ts +2 -0
- package/cjs/core/Backdrop/index.js +9 -0
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +18 -18
- package/cjs/core/ButtonGroup/ButtonGroup.js +11 -4
- package/cjs/core/Dialog/Dialog.d.ts +41 -0
- package/cjs/core/Dialog/Dialog.js +59 -0
- package/cjs/core/Dialog/DialogBackdrop.d.ts +12 -0
- package/cjs/core/Dialog/DialogBackdrop.js +61 -0
- package/cjs/core/Dialog/DialogButtonBar.d.ts +18 -0
- package/cjs/core/Dialog/DialogButtonBar.js +50 -0
- package/cjs/core/Dialog/DialogContent.d.ts +17 -0
- package/cjs/core/Dialog/DialogContent.js +49 -0
- package/cjs/core/Dialog/DialogContext.d.ts +39 -0
- package/cjs/core/Dialog/DialogContext.js +16 -0
- package/cjs/core/Dialog/DialogMain.d.ts +36 -0
- package/cjs/core/Dialog/DialogMain.js +120 -0
- package/cjs/core/Dialog/DialogTitleBar.d.ts +34 -0
- package/cjs/core/Dialog/DialogTitleBar.js +69 -0
- package/cjs/core/Dialog/DialogTitleBarTitle.d.ts +15 -0
- package/cjs/core/Dialog/DialogTitleBarTitle.js +47 -0
- package/cjs/core/Dialog/index.d.ts +8 -0
- package/cjs/core/Dialog/index.js +10 -0
- package/cjs/core/Footer/Footer.d.ts +16 -2
- package/cjs/core/Footer/Footer.js +57 -45
- package/cjs/core/Footer/FooterItem.d.ts +8 -0
- package/cjs/core/Footer/FooterItem.js +46 -0
- package/cjs/core/Footer/FooterList.d.ts +8 -0
- package/cjs/core/Footer/FooterList.js +46 -0
- package/cjs/core/Footer/FooterSeparator.d.ts +8 -0
- package/cjs/core/Footer/FooterSeparator.js +46 -0
- package/cjs/core/Footer/index.d.ts +1 -1
- package/cjs/core/Footer/index.js +2 -1
- package/cjs/core/Modal/Modal.d.ts +4 -14
- package/cjs/core/Modal/Modal.js +9 -74
- package/cjs/core/Modal/ModalButtonBar.d.ts +1 -2
- package/cjs/core/Modal/ModalButtonBar.js +2 -39
- package/cjs/core/Modal/ModalContent.d.ts +1 -2
- package/cjs/core/Modal/ModalContent.js +2 -39
- package/cjs/core/Slider/Slider.d.ts +10 -0
- package/cjs/core/Slider/Slider.js +20 -14
- package/cjs/core/Slider/Thumb.d.ts +2 -1
- package/cjs/core/Slider/Thumb.js +5 -3
- package/cjs/core/Slider/Track.d.ts +2 -1
- package/cjs/core/Slider/Track.js +23 -4
- package/cjs/core/Table/Table.d.ts +2 -1
- package/cjs/core/Table/Table.js +6 -1
- package/cjs/core/Table/columns/actionColumn.d.ts +8 -3
- package/cjs/core/Table/columns/actionColumn.js +33 -2
- package/cjs/core/Table/hooks/useScrollToRow.d.ts +1 -1
- package/cjs/core/Table/hooks/useScrollToRow.js +3 -3
- package/cjs/core/index.d.ts +3 -1
- package/cjs/core/index.js +6 -3
- package/cjs/core/utils/components/FocusTrap.js +1 -1
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -1
- package/esm/core/Backdrop/Backdrop.d.ts +10 -0
- package/esm/core/Backdrop/Backdrop.js +35 -0
- package/esm/core/Backdrop/index.d.ts +2 -0
- package/esm/core/Backdrop/index.js +5 -0
- package/esm/core/Breadcrumbs/Breadcrumbs.js +18 -18
- package/esm/core/ButtonGroup/ButtonGroup.js +11 -4
- package/esm/core/Dialog/Dialog.d.ts +41 -0
- package/esm/core/Dialog/Dialog.js +53 -0
- package/esm/core/Dialog/DialogBackdrop.d.ts +12 -0
- package/esm/core/Dialog/DialogBackdrop.js +55 -0
- package/esm/core/Dialog/DialogButtonBar.d.ts +18 -0
- package/esm/core/Dialog/DialogButtonBar.js +44 -0
- package/esm/core/Dialog/DialogContent.d.ts +17 -0
- package/esm/core/Dialog/DialogContent.js +43 -0
- package/esm/core/Dialog/DialogContext.d.ts +39 -0
- package/esm/core/Dialog/DialogContext.js +9 -0
- package/esm/core/Dialog/DialogMain.d.ts +36 -0
- package/esm/core/Dialog/DialogMain.js +114 -0
- package/esm/core/Dialog/DialogTitleBar.d.ts +34 -0
- package/esm/core/Dialog/DialogTitleBar.js +63 -0
- package/esm/core/Dialog/DialogTitleBarTitle.d.ts +15 -0
- package/esm/core/Dialog/DialogTitleBarTitle.js +41 -0
- package/esm/core/Dialog/index.d.ts +8 -0
- package/esm/core/Dialog/index.js +6 -0
- package/esm/core/Footer/Footer.d.ts +16 -2
- package/esm/core/Footer/Footer.js +56 -43
- package/esm/core/Footer/FooterItem.d.ts +8 -0
- package/esm/core/Footer/FooterItem.js +39 -0
- package/esm/core/Footer/FooterList.d.ts +8 -0
- package/esm/core/Footer/FooterList.js +39 -0
- package/esm/core/Footer/FooterSeparator.d.ts +8 -0
- package/esm/core/Footer/FooterSeparator.js +39 -0
- package/esm/core/Footer/index.d.ts +1 -1
- package/esm/core/Footer/index.js +1 -1
- package/esm/core/Modal/Modal.d.ts +4 -14
- package/esm/core/Modal/Modal.js +10 -75
- package/esm/core/Modal/ModalButtonBar.d.ts +1 -2
- package/esm/core/Modal/ModalButtonBar.js +2 -35
- package/esm/core/Modal/ModalContent.d.ts +1 -2
- package/esm/core/Modal/ModalContent.js +2 -35
- package/esm/core/Slider/Slider.d.ts +10 -0
- package/esm/core/Slider/Slider.js +20 -14
- package/esm/core/Slider/Thumb.d.ts +2 -1
- package/esm/core/Slider/Thumb.js +5 -3
- package/esm/core/Slider/Track.d.ts +2 -1
- package/esm/core/Slider/Track.js +23 -4
- package/esm/core/Table/Table.d.ts +2 -1
- package/esm/core/Table/Table.js +6 -1
- package/esm/core/Table/columns/actionColumn.d.ts +8 -3
- package/esm/core/Table/columns/actionColumn.js +33 -2
- package/esm/core/Table/hooks/useScrollToRow.d.ts +1 -1
- package/esm/core/Table/hooks/useScrollToRow.js +3 -3
- package/esm/core/index.d.ts +3 -1
- package/esm/core/index.js +2 -1
- package/esm/core/utils/components/FocusTrap.js +1 -1
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -1
- package/package.json +6 -5
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -17,6 +28,7 @@ var Menu_1 = require("../../Menu");
|
|
|
17
28
|
var Table_1 = require("../Table");
|
|
18
29
|
var selectionColumn_1 = require("./selectionColumn");
|
|
19
30
|
var expanderColumn_1 = require("./expanderColumn");
|
|
31
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
20
32
|
var ACTION_CELL_ID = 'iui-table-action';
|
|
21
33
|
/**
|
|
22
34
|
* Action column that adds column manager to the Table header.
|
|
@@ -52,6 +64,7 @@ var ActionColumn = function (_a) {
|
|
|
52
64
|
Header: function (_a) {
|
|
53
65
|
var allColumns = _a.allColumns, dispatch = _a.dispatch, state = _a.state;
|
|
54
66
|
var _b = react_1.default.useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
67
|
+
var buttonRef = react_1.default.useRef(null);
|
|
55
68
|
if (!columnManager) {
|
|
56
69
|
return null;
|
|
57
70
|
}
|
|
@@ -77,13 +90,31 @@ var ActionColumn = function (_a) {
|
|
|
77
90
|
}
|
|
78
91
|
// Triggers an update to resize the widths of all visible columns
|
|
79
92
|
dispatch({ type: Table_1.tableResizeStartAction });
|
|
93
|
+
// If some columns were resized and some columns visibility was enabled, then horizontal scrollbar appears
|
|
94
|
+
// and table is scrolled to the very left which means our visibility dropdown menu is not visible.
|
|
95
|
+
// So for better UX we need to scroll to that dropdown menu.
|
|
96
|
+
queueMicrotask(function () {
|
|
97
|
+
var _a;
|
|
98
|
+
(_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
99
|
+
});
|
|
80
100
|
};
|
|
81
101
|
return (react_1.default.createElement(Menu_1.MenuItem, { key: column.id, icon: react_1.default.createElement(Checkbox_1.Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: function (e) { return e.stopPropagation(); }, onChange: onClick, "aria-labelledby": "iui-column-".concat(column.id) }), onClick: onClick, disabled: column.disableToggleVisibility },
|
|
82
102
|
react_1.default.createElement("div", { id: "iui-column-".concat(column.id) }, column.render('Header'))));
|
|
83
103
|
});
|
|
84
104
|
};
|
|
85
|
-
|
|
86
|
-
|
|
105
|
+
var dropdownMenuProps = typeof columnManager !== 'boolean'
|
|
106
|
+
? columnManager.dropdownMenuProps
|
|
107
|
+
: {};
|
|
108
|
+
return (react_1.default.createElement(DropdownMenu_1.DropdownMenu, __assign({}, dropdownMenuProps, { menuItems: headerCheckBoxes, onHide: function (i) {
|
|
109
|
+
var _a;
|
|
110
|
+
setIsOpen(false);
|
|
111
|
+
(_a = dropdownMenuProps.onHide) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, i);
|
|
112
|
+
}, onShow: function (i) {
|
|
113
|
+
var _a;
|
|
114
|
+
setIsOpen(true);
|
|
115
|
+
(_a = dropdownMenuProps.onShow) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, i);
|
|
116
|
+
}, style: __assign({ maxHeight: '315px' }, dropdownMenuProps.style), className: (0, classnames_1.default)('iui-scroll', dropdownMenuProps.className) }),
|
|
117
|
+
react_1.default.createElement(IconButton_1.IconButton, { styleType: 'borderless', isActive: isOpen, ref: buttonRef },
|
|
87
118
|
react_1.default.createElement(ColumnManager_1.default, null))));
|
|
88
119
|
},
|
|
89
120
|
};
|
|
@@ -7,5 +7,5 @@ declare type ScrollToRow<T extends Record<string, unknown>> = {
|
|
|
7
7
|
declare type ScrollToRowProps<T extends Record<string, unknown>> = TableProps<T> & {
|
|
8
8
|
page: Row<T>[];
|
|
9
9
|
};
|
|
10
|
-
export declare function useScrollToRow<T extends Record<string, unknown>>({ data, enableVirtualization, page, paginatorRenderer, scrollToRow,
|
|
10
|
+
export declare function useScrollToRow<T extends Record<string, unknown>>({ data, enableVirtualization, page, paginatorRenderer, scrollToRow, }: ScrollToRowProps<T>): ScrollToRow<T>;
|
|
11
11
|
export {};
|
|
@@ -10,7 +10,7 @@ exports.useScrollToRow = void 0;
|
|
|
10
10
|
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
var react_1 = __importDefault(require("react"));
|
|
12
12
|
function useScrollToRow(_a) {
|
|
13
|
-
var data = _a.data, enableVirtualization = _a.enableVirtualization, page = _a.page, paginatorRenderer = _a.paginatorRenderer, scrollToRow = _a.scrollToRow
|
|
13
|
+
var data = _a.data, enableVirtualization = _a.enableVirtualization, page = _a.page, paginatorRenderer = _a.paginatorRenderer, scrollToRow = _a.scrollToRow;
|
|
14
14
|
var rowRefs = react_1.default.useRef({});
|
|
15
15
|
// Refs prevents from having `page` and `data` as dependencies
|
|
16
16
|
// therefore we avoid unnecessary scroll to row.
|
|
@@ -21,12 +21,12 @@ function useScrollToRow(_a) {
|
|
|
21
21
|
// For virtualized tables, all we need to do is pass the index of the item
|
|
22
22
|
// to the VirtualScroll component
|
|
23
23
|
var scrollToIndex = react_1.default.useMemo(function () {
|
|
24
|
-
if (!scrollToRow || paginatorRenderer
|
|
24
|
+
if (!scrollToRow || paginatorRenderer) {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
27
|
var index = scrollToRow(pageRef.current, dataRef.current);
|
|
28
28
|
return index < 0 ? undefined : index;
|
|
29
|
-
}, [
|
|
29
|
+
}, [paginatorRenderer, scrollToRow]);
|
|
30
30
|
// For non-virtualized tables, we need to add a ref to each row
|
|
31
31
|
// and scroll to the element
|
|
32
32
|
react_1.default.useEffect(function () {
|
package/cjs/core/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Alert } from './Alert';
|
|
2
2
|
export type { AlertProps } from './Alert';
|
|
3
|
+
export { Backdrop } from './Backdrop';
|
|
4
|
+
export type { BackdropProps } from './Backdrop';
|
|
3
5
|
export { Badge } from './Badge';
|
|
4
6
|
export type { BadgeProps } from './Badge';
|
|
5
7
|
export { Breadcrumbs } from './Breadcrumbs';
|
|
@@ -28,7 +30,7 @@ export { Fieldset } from './Fieldset';
|
|
|
28
30
|
export type { FieldsetProps } from './Fieldset';
|
|
29
31
|
export { FileUpload, FileUploadTemplate } from './FileUpload';
|
|
30
32
|
export type { FileUploadProps, FileUploadTemplateProps } from './FileUpload';
|
|
31
|
-
export { Footer } from './Footer';
|
|
33
|
+
export { Footer, defaultFooterElements } from './Footer';
|
|
32
34
|
export type { FooterProps, FooterElement, TitleTranslations } from './Footer';
|
|
33
35
|
export { Header, HeaderBreadcrumbs, HeaderButton, HeaderLogo } from './Header';
|
|
34
36
|
export type { HeaderProps, HeaderBreadcrumbsProps, HeaderButtonProps, HeaderLogoProps, } from './Header';
|
package/cjs/core/index.js
CHANGED
|
@@ -3,15 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = exports.UserIcon = void 0;
|
|
6
|
+
exports.MenuDivider = exports.MenuItem = exports.Menu = exports.LabeledTextarea = exports.LabeledSelect = exports.InputGroup = exports.LabeledInput = exports.Label = exports.Input = exports.InformationPanelContent = exports.InformationPanelBody = exports.InformationPanelHeader = exports.InformationPanelWrapper = exports.InformationPanel = exports.HorizontalTab = exports.HorizontalTabs = exports.Tab = exports.VerticalTabs = exports.HeaderLogo = exports.HeaderButton = exports.HeaderBreadcrumbs = exports.Header = exports.defaultFooterElements = exports.Footer = exports.FileUploadTemplate = exports.FileUpload = exports.Fieldset = exports.ExpandableBlock = exports.ErrorPage = exports.DropdownMenu = exports.generateLocalizedStrings = exports.DatePicker = exports.ComboBox = exports.ColorPalette = exports.ColorInputPanel = exports.ColorBuilder = exports.ColorSwatch = exports.ColorPicker = exports.Checkbox = exports.Carousel = exports.ButtonGroup = exports.SplitButton = exports.IdeasButton = exports.IconButton = exports.DropdownButton = exports.Button = exports.Breadcrumbs = exports.Badge = exports.Backdrop = exports.Alert = void 0;
|
|
7
|
+
exports.Kbd = exports.Code = exports.Blockquote = exports.Title = exports.Subheading = exports.Small = exports.Leading = exports.Headline = exports.Body = exports.Anchor = exports.TreeNodeExpander = exports.TreeNode = exports.Tree = exports.Tooltip = exports.ToggleSwitch = exports.ThemeProvider = exports.toaster = exports.TimePicker = exports.Tile = exports.Textarea = exports.TagContainer = exports.Tag = exports.SelectionColumn = exports.ExpanderColumn = exports.ActionColumn = exports.TablePaginator = exports.EditableCell = exports.DefaultCell = exports.FilterButtonBar = exports.tableFilters = exports.Table = exports.Surface = exports.StatusMessage = exports.Slider = exports.SkipToContentLink = exports.SidenavSubmenuHeader = exports.SidenavSubmenu = exports.SidenavButton = exports.SideNavigation = exports.Select = exports.RadioTileGroup = exports.RadioTile = exports.Radio = exports.ProgressRadial = exports.ProgressLinear = exports.ModalContent = exports.ModalButtonBar = exports.Modal = exports.MenuItemSkeleton = exports.MenuExtraContent = void 0;
|
|
8
|
+
exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = exports.UserIcon = exports.Text = exports.KbdKeys = void 0;
|
|
9
9
|
/*---------------------------------------------------------------------------------------------
|
|
10
10
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
11
11
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
12
12
|
*--------------------------------------------------------------------------------------------*/
|
|
13
13
|
var Alert_1 = require("./Alert");
|
|
14
14
|
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return Alert_1.Alert; } });
|
|
15
|
+
var Backdrop_1 = require("./Backdrop");
|
|
16
|
+
Object.defineProperty(exports, "Backdrop", { enumerable: true, get: function () { return Backdrop_1.Backdrop; } });
|
|
15
17
|
var Badge_1 = require("./Badge");
|
|
16
18
|
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return Badge_1.Badge; } });
|
|
17
19
|
var Breadcrumbs_1 = require("./Breadcrumbs");
|
|
@@ -52,6 +54,7 @@ Object.defineProperty(exports, "FileUpload", { enumerable: true, get: function (
|
|
|
52
54
|
Object.defineProperty(exports, "FileUploadTemplate", { enumerable: true, get: function () { return FileUpload_1.FileUploadTemplate; } });
|
|
53
55
|
var Footer_1 = require("./Footer");
|
|
54
56
|
Object.defineProperty(exports, "Footer", { enumerable: true, get: function () { return Footer_1.Footer; } });
|
|
57
|
+
Object.defineProperty(exports, "defaultFooterElements", { enumerable: true, get: function () { return Footer_1.defaultFooterElements; } });
|
|
55
58
|
var Header_1 = require("./Header");
|
|
56
59
|
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return Header_1.Header; } });
|
|
57
60
|
Object.defineProperty(exports, "HeaderBreadcrumbs", { enumerable: true, get: function () { return Header_1.HeaderBreadcrumbs; } });
|
|
@@ -42,7 +42,7 @@ var FocusTrap = function (props) {
|
|
|
42
42
|
lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
return (react_1.default.createElement(
|
|
45
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
46
46
|
react_1.default.createElement("div", { tabIndex: 0, onFocus: onFirstFocus, "aria-hidden": true }),
|
|
47
47
|
react_1.default.cloneElement(children, {
|
|
48
48
|
ref: (0, useMergedRefs_1.mergeRefs)(children.ref, childRef),
|
|
@@ -44,7 +44,7 @@ var MiddleTextTruncation = function (props) {
|
|
|
44
44
|
var _b = (0, useOverflow_1.useOverflow)(text), ref = _b[0], visibleCount = _b[1];
|
|
45
45
|
var truncatedText = react_1.default.useMemo(function () {
|
|
46
46
|
if (visibleCount < text.length) {
|
|
47
|
-
return "".concat(text.
|
|
47
|
+
return "".concat(text.substring(0, visibleCount - endCharsCount - ELLIPSIS_CHAR.length)).concat(ELLIPSIS_CHAR).concat(text.substring(text.length - endCharsCount));
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
50
|
return text;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/backdrop.css';
|
|
3
|
+
export declare type BackdropProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Flag whether backdrop should be shown.
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
isVisible?: boolean;
|
|
9
|
+
} & React.ComponentPropsWithRef<'div'>;
|
|
10
|
+
export declare const Backdrop: React.ForwardRefExoticComponent<Pick<BackdropProps, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "isVisible"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
import { useTheme } from '../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/backdrop.css';
|
|
31
|
+
export var Backdrop = React.forwardRef(function (props, ref) {
|
|
32
|
+
var _a = props.isVisible, isVisible = _a === void 0 ? true : _a, className = props.className, rest = __rest(props, ["isVisible", "className"]);
|
|
33
|
+
useTheme();
|
|
34
|
+
return (React.createElement("div", __assign({ className: cx('iui-backdrop', { 'iui-backdrop-visible': isVisible }, className), ref: ref }, rest)));
|
|
35
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { Backdrop } from './Backdrop';
|
|
@@ -56,28 +56,15 @@ export var Breadcrumbs = React.forwardRef(function (props, ref) {
|
|
|
56
56
|
useTheme();
|
|
57
57
|
var _b = useOverflow(items), overflowRef = _b[0], visibleCount = _b[1];
|
|
58
58
|
var refs = useMergedRefs(overflowRef, ref);
|
|
59
|
-
var Separator = function () { return (React.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : React.createElement(SvgChevronRight, null))); };
|
|
60
|
-
var ListItem = function (_a) {
|
|
61
|
-
var _b;
|
|
62
|
-
var index = _a.index;
|
|
63
|
-
var item = items[index];
|
|
64
|
-
return (React.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' }, React.isValidElement(item)
|
|
65
|
-
? React.cloneElement(item, {
|
|
66
|
-
'aria-current': ((_b = item.props['aria-current']) !== null && _b !== void 0 ? _b : currentIndex === index)
|
|
67
|
-
? 'location'
|
|
68
|
-
: undefined,
|
|
69
|
-
})
|
|
70
|
-
: item));
|
|
71
|
-
};
|
|
72
59
|
return (React.createElement("nav", __assign({ className: cx('iui-breadcrumbs', className), ref: refs, "aria-label": 'Breadcrumb' }, rest),
|
|
73
60
|
React.createElement("ol", { className: 'iui-breadcrumbs-list' },
|
|
74
61
|
visibleCount > 1 && (React.createElement(React.Fragment, null,
|
|
75
|
-
React.createElement(ListItem, {
|
|
76
|
-
React.createElement(Separator,
|
|
62
|
+
React.createElement(ListItem, { item: items[0], isActive: currentIndex === 0 }),
|
|
63
|
+
React.createElement(Separator, { separator: separator }))),
|
|
77
64
|
items.length - visibleCount > 0 && (React.createElement(React.Fragment, null,
|
|
78
65
|
React.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' },
|
|
79
66
|
React.createElement("span", { className: 'iui-breadcrumbs-text' }, "\u2026")),
|
|
80
|
-
React.createElement(Separator,
|
|
67
|
+
React.createElement(Separator, { separator: separator }))),
|
|
81
68
|
items
|
|
82
69
|
.slice(visibleCount > 1
|
|
83
70
|
? items.length - visibleCount + 1
|
|
@@ -87,8 +74,21 @@ export var Breadcrumbs = React.forwardRef(function (props, ref) {
|
|
|
87
74
|
? 1 + (items.length - visibleCount) + _index
|
|
88
75
|
: items.length - 1;
|
|
89
76
|
return (React.createElement(React.Fragment, { key: index },
|
|
90
|
-
React.createElement(ListItem, { index: index }),
|
|
91
|
-
index < items.length - 1 && React.createElement(Separator,
|
|
77
|
+
React.createElement(ListItem, { item: items[index], isActive: currentIndex === index }),
|
|
78
|
+
index < items.length - 1 && (React.createElement(Separator, { separator: separator }))));
|
|
92
79
|
}))));
|
|
93
80
|
});
|
|
81
|
+
var ListItem = function (_a) {
|
|
82
|
+
var _b;
|
|
83
|
+
var item = _a.item, isActive = _a.isActive;
|
|
84
|
+
return (React.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' }, React.isValidElement(item)
|
|
85
|
+
? React.cloneElement(item, {
|
|
86
|
+
'aria-current': ((_b = item.props['aria-current']) !== null && _b !== void 0 ? _b : isActive) ? 'location' : undefined,
|
|
87
|
+
})
|
|
88
|
+
: item));
|
|
89
|
+
};
|
|
90
|
+
var Separator = function (_a) {
|
|
91
|
+
var separator = _a.separator;
|
|
92
|
+
return (React.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : React.createElement(SvgChevronRight, null)));
|
|
93
|
+
};
|
|
94
94
|
export default Breadcrumbs;
|
|
@@ -66,9 +66,16 @@ export var ButtonGroup = React.forwardRef(function (props, ref) {
|
|
|
66
66
|
'iui-button-group': orientation === 'horizontal',
|
|
67
67
|
'iui-button-group-vertical': orientation === 'vertical',
|
|
68
68
|
'iui-button-group-overflow-x': !!overflowButton && orientation === 'horizontal',
|
|
69
|
-
}, className), "aria-orientation": orientation, ref: refs }, rest),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
}, className), "aria-orientation": orientation, ref: refs }, rest),
|
|
70
|
+
React.createElement(React.Fragment, null,
|
|
71
|
+
visibleCount < items.length &&
|
|
72
|
+
overflowButton &&
|
|
73
|
+
overflowPlacement === 'start' && (React.createElement("div", null, overflowButton(visibleCount))),
|
|
74
|
+
visibleCount < items.length
|
|
75
|
+
? items.slice(0, visibleCount - 1)
|
|
76
|
+
: items,
|
|
77
|
+
visibleCount < items.length &&
|
|
78
|
+
overflowButton &&
|
|
79
|
+
overflowPlacement === 'end' && (React.createElement("div", null, overflowButton(visibleCount))))));
|
|
73
80
|
});
|
|
74
81
|
export default ButtonGroup;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
3
|
+
import { DialogContextProps } from './DialogContext';
|
|
4
|
+
export declare type DialogProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Dialog content.
|
|
7
|
+
*/
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
} & DialogContextProps;
|
|
10
|
+
/**
|
|
11
|
+
* Dialog component.
|
|
12
|
+
* @example
|
|
13
|
+
* <Dialog
|
|
14
|
+
* isOpen={isOpen}
|
|
15
|
+
* onClose={() => setIsOpen(false)}
|
|
16
|
+
* trapFocus
|
|
17
|
+
* preventDocumentScroll
|
|
18
|
+
* >
|
|
19
|
+
* <Dialog.Backdrop />
|
|
20
|
+
* <Dialog.Main aria-modal>
|
|
21
|
+
* <Dialog.TitleBar>My dialog title</Dialog.TitleBar>
|
|
22
|
+
* <Dialog.Content>
|
|
23
|
+
* Here is my dialog content
|
|
24
|
+
* </Dialog.Content>
|
|
25
|
+
* <Dialog.ButtonBar>
|
|
26
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
27
|
+
* <Button>Close</Button>
|
|
28
|
+
* </Dialog.ButtonBar>
|
|
29
|
+
* </Dialog.Main>
|
|
30
|
+
* </Dialog>
|
|
31
|
+
*/
|
|
32
|
+
export declare const Dialog: ((props: DialogProps) => JSX.Element) & {
|
|
33
|
+
Backdrop: React.ForwardRefExoticComponent<Pick<import("./DialogBackdrop").DialogBackdropProps, "onClose" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "isVisible" | "isDismissible" | "closeOnExternalClick"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
Main: React.ForwardRefExoticComponent<Pick<import("./DialogMain").DialogMainProps, "onClose" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "styleType" | "isOpen" | "isDismissible" | "closeOnEsc" | "trapFocus" | "preventDocumentScroll"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
TitleBar: React.ForwardRefExoticComponent<Pick<import("./DialogTitleBar").DialogTitleBarProps, "onClose" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "isDismissible" | "titleText"> & React.RefAttributes<HTMLDivElement>> & {
|
|
36
|
+
Title: React.ForwardRefExoticComponent<Pick<import("./DialogTitleBarTitle").DialogTitleBarTitleProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
};
|
|
38
|
+
Content: React.ForwardRefExoticComponent<Pick<import("./DialogContent").DialogContentProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
ButtonBar: React.ForwardRefExoticComponent<Pick<import("./DialogButtonBar").DialogButtonBarProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
};
|
|
41
|
+
export default Dialog;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
7
|
+
import { DialogTitleBar } from './DialogTitleBar';
|
|
8
|
+
import { DialogContent } from './DialogContent';
|
|
9
|
+
import { DialogBackdrop } from './DialogBackdrop';
|
|
10
|
+
import { DialogContext } from './DialogContext';
|
|
11
|
+
import { DialogButtonBar } from './DialogButtonBar';
|
|
12
|
+
import DialogMain from './DialogMain';
|
|
13
|
+
/**
|
|
14
|
+
* Dialog component.
|
|
15
|
+
* @example
|
|
16
|
+
* <Dialog
|
|
17
|
+
* isOpen={isOpen}
|
|
18
|
+
* onClose={() => setIsOpen(false)}
|
|
19
|
+
* trapFocus
|
|
20
|
+
* preventDocumentScroll
|
|
21
|
+
* >
|
|
22
|
+
* <Dialog.Backdrop />
|
|
23
|
+
* <Dialog.Main aria-modal>
|
|
24
|
+
* <Dialog.TitleBar>My dialog title</Dialog.TitleBar>
|
|
25
|
+
* <Dialog.Content>
|
|
26
|
+
* Here is my dialog content
|
|
27
|
+
* </Dialog.Content>
|
|
28
|
+
* <Dialog.ButtonBar>
|
|
29
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
30
|
+
* <Button>Close</Button>
|
|
31
|
+
* </Dialog.ButtonBar>
|
|
32
|
+
* </Dialog.Main>
|
|
33
|
+
* </Dialog>
|
|
34
|
+
*/
|
|
35
|
+
export var Dialog = Object.assign(function (props) {
|
|
36
|
+
var children = props.children, _a = props.trapFocus, trapFocus = _a === void 0 ? false : _a, _b = props.preventDocumentScroll, preventDocumentScroll = _b === void 0 ? false : _b, _c = props.isOpen, isOpen = _c === void 0 ? false : _c, _d = props.isDismissible, isDismissible = _d === void 0 ? true : _d, _e = props.closeOnEsc, closeOnEsc = _e === void 0 ? true : _e, _f = props.closeOnExternalClick, closeOnExternalClick = _f === void 0 ? false : _f, onClose = props.onClose;
|
|
37
|
+
return (React.createElement(DialogContext.Provider, { value: {
|
|
38
|
+
isOpen: isOpen,
|
|
39
|
+
onClose: onClose,
|
|
40
|
+
closeOnEsc: closeOnEsc,
|
|
41
|
+
closeOnExternalClick: closeOnExternalClick,
|
|
42
|
+
isDismissible: isDismissible,
|
|
43
|
+
preventDocumentScroll: preventDocumentScroll,
|
|
44
|
+
trapFocus: trapFocus,
|
|
45
|
+
} }, children));
|
|
46
|
+
}, {
|
|
47
|
+
Backdrop: DialogBackdrop,
|
|
48
|
+
Main: DialogMain,
|
|
49
|
+
TitleBar: DialogTitleBar,
|
|
50
|
+
Content: DialogContent,
|
|
51
|
+
ButtonBar: DialogButtonBar,
|
|
52
|
+
});
|
|
53
|
+
export default Dialog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BackdropProps } from '../Backdrop';
|
|
3
|
+
import { DialogContextProps } from './DialogContext';
|
|
4
|
+
export declare type DialogBackdropProps = BackdropProps & Pick<DialogContextProps, 'onClose' | 'isDismissible' | 'closeOnExternalClick'>;
|
|
5
|
+
/**
|
|
6
|
+
* Backdrop component for dialog. Recommended to be used with `Dialog`
|
|
7
|
+
* then its visibility is being controlled by dialog's `isOpen` prop.
|
|
8
|
+
* @example
|
|
9
|
+
* <Dialog.Backdrop />
|
|
10
|
+
*/
|
|
11
|
+
export declare const DialogBackdrop: React.ForwardRefExoticComponent<Pick<DialogBackdropProps, "onClose" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "isVisible" | "isDismissible" | "closeOnExternalClick"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default DialogBackdrop;
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { Backdrop } from '../Backdrop';
|
|
29
|
+
import { useMergedRefs } from '../utils';
|
|
30
|
+
import { useDialogContext } from './DialogContext';
|
|
31
|
+
/**
|
|
32
|
+
* Backdrop component for dialog. Recommended to be used with `Dialog`
|
|
33
|
+
* then its visibility is being controlled by dialog's `isOpen` prop.
|
|
34
|
+
* @example
|
|
35
|
+
* <Dialog.Backdrop />
|
|
36
|
+
*/
|
|
37
|
+
export var DialogBackdrop = React.forwardRef(function (props, ref) {
|
|
38
|
+
var dialogContext = useDialogContext();
|
|
39
|
+
var _a = props.isVisible, isVisible = _a === void 0 ? dialogContext.isOpen : _a, _b = props.isDismissible, isDismissible = _b === void 0 ? dialogContext.isDismissible : _b, _c = props.onClose, onClose = _c === void 0 ? dialogContext.onClose : _c, _d = props.closeOnExternalClick, closeOnExternalClick = _d === void 0 ? dialogContext.closeOnExternalClick : _d, onMouseDown = props.onMouseDown, rest = __rest(props, ["isVisible", "isDismissible", "onClose", "closeOnExternalClick", "onMouseDown"]);
|
|
40
|
+
var backdropRef = React.useRef(null);
|
|
41
|
+
var refs = useMergedRefs(backdropRef, ref);
|
|
42
|
+
var handleMouseDown = function (event) {
|
|
43
|
+
// Prevents React from resetting its properties
|
|
44
|
+
event.persist();
|
|
45
|
+
if (event.target !== backdropRef.current) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (isDismissible && closeOnExternalClick && onClose) {
|
|
49
|
+
onClose(event);
|
|
50
|
+
}
|
|
51
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
|
|
52
|
+
};
|
|
53
|
+
return (React.createElement(Backdrop, __assign({ isVisible: isVisible, ref: refs, onMouseDown: handleMouseDown }, rest)));
|
|
54
|
+
});
|
|
55
|
+
export default DialogBackdrop;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
3
|
+
export declare type DialogButtonBarProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Buttons in the dialog bar.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
} & React.ComponentPropsWithRef<'div'>;
|
|
9
|
+
/**
|
|
10
|
+
* Container for Buttons in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
11
|
+
* @example
|
|
12
|
+
* <Dialog.ButtonBar>
|
|
13
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
14
|
+
* <Button>Close</Button>
|
|
15
|
+
* </Dialog.ButtonBar>
|
|
16
|
+
*/
|
|
17
|
+
export declare const DialogButtonBar: React.ForwardRefExoticComponent<Pick<DialogButtonBarProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default DialogButtonBar;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
import { useTheme } from '../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
31
|
+
/**
|
|
32
|
+
* Container for Buttons in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
33
|
+
* @example
|
|
34
|
+
* <Dialog.ButtonBar>
|
|
35
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
36
|
+
* <Button>Close</Button>
|
|
37
|
+
* </Dialog.ButtonBar>
|
|
38
|
+
*/
|
|
39
|
+
export var DialogButtonBar = React.forwardRef(function (props, ref) {
|
|
40
|
+
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
41
|
+
useTheme();
|
|
42
|
+
return (React.createElement("div", __assign({ className: cx('iui-dialog-button-bar', className), ref: ref }, rest), children));
|
|
43
|
+
});
|
|
44
|
+
export default DialogButtonBar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
3
|
+
export declare type DialogContentProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Main content in the `Dialog`.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
} & React.ComponentPropsWithRef<'div'>;
|
|
9
|
+
/**
|
|
10
|
+
* Container for content in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
11
|
+
* @example
|
|
12
|
+
* <Dialog.Content>
|
|
13
|
+
* My dialog content
|
|
14
|
+
* </Dialog.Content>
|
|
15
|
+
*/
|
|
16
|
+
export declare const DialogContent: React.ForwardRefExoticComponent<Pick<DialogContentProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export default DialogContent;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
import { useTheme } from '../utils';
|
|
30
|
+
import '@itwin/itwinui-css/css/dialog.css';
|
|
31
|
+
/**
|
|
32
|
+
* Container for content in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
33
|
+
* @example
|
|
34
|
+
* <Dialog.Content>
|
|
35
|
+
* My dialog content
|
|
36
|
+
* </Dialog.Content>
|
|
37
|
+
*/
|
|
38
|
+
export var DialogContent = React.forwardRef(function (props, ref) {
|
|
39
|
+
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
40
|
+
useTheme();
|
|
41
|
+
return (React.createElement("div", __assign({ className: cx('iui-dialog-content', className), ref: ref }, rest), children));
|
|
42
|
+
});
|
|
43
|
+
export default DialogContent;
|