@itwin/itwinui-react 1.40.1 → 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 +42 -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/ComboBox/ComboBox.js +22 -18
- 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/ErrorPage/ErrorPage.d.ts +3 -1
- package/cjs/core/ErrorPage/ErrorPage.js +31 -1
- 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 -13
- package/cjs/core/Modal/Modal.js +9 -71
- 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 +24 -0
- package/cjs/core/Table/Table.js +21 -10
- package/cjs/core/Table/TableRowMemoized.d.ts +4 -0
- package/cjs/core/Table/TableRowMemoized.js +15 -3
- package/cjs/core/Table/cells/EditableCell.js +7 -2
- package/cjs/core/Table/columns/actionColumn.d.ts +8 -3
- package/cjs/core/Table/columns/actionColumn.js +33 -2
- package/cjs/core/Table/hooks/index.d.ts +1 -0
- package/cjs/core/Table/hooks/index.js +3 -1
- package/cjs/core/Table/hooks/useScrollToRow.d.ts +11 -0
- package/cjs/core/Table/hooks/useScrollToRow.js +49 -0
- package/cjs/core/Tree/Tree.d.ts +9 -0
- package/cjs/core/Tree/Tree.js +67 -19
- package/cjs/core/Tree/TreeContext.d.ts +4 -0
- package/cjs/core/Tree/TreeNode.js +8 -9
- package/cjs/core/Typography/Small/Small.js +1 -1
- 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/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useLatestRef.d.ts +9 -0
- package/cjs/core/utils/hooks/useLatestRef.js +26 -0
- 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/ComboBox/ComboBox.js +23 -19
- 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/ErrorPage/ErrorPage.d.ts +3 -1
- package/esm/core/ErrorPage/ErrorPage.js +31 -1
- 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 -13
- package/esm/core/Modal/Modal.js +10 -72
- 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 +24 -0
- package/esm/core/Table/Table.js +23 -12
- package/esm/core/Table/TableRowMemoized.d.ts +4 -0
- package/esm/core/Table/TableRowMemoized.js +15 -3
- package/esm/core/Table/cells/EditableCell.js +7 -2
- package/esm/core/Table/columns/actionColumn.d.ts +8 -3
- package/esm/core/Table/columns/actionColumn.js +33 -2
- package/esm/core/Table/hooks/index.d.ts +1 -0
- package/esm/core/Table/hooks/index.js +1 -0
- package/esm/core/Table/hooks/useScrollToRow.d.ts +11 -0
- package/esm/core/Table/hooks/useScrollToRow.js +42 -0
- package/esm/core/Tree/Tree.d.ts +9 -0
- package/esm/core/Tree/Tree.js +68 -20
- package/esm/core/Tree/TreeContext.d.ts +4 -0
- package/esm/core/Tree/TreeNode.js +8 -9
- package/esm/core/Typography/Small/Small.js +1 -1
- 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/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useLatestRef.d.ts +9 -0
- package/esm/core/utils/hooks/useLatestRef.js +19 -0
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.43.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.42.0...v1.43.0) (2022-08-17)
|
|
4
|
+
|
|
5
|
+
### What's new
|
|
6
|
+
|
|
7
|
+
* **Footer:** Allows to use composition to customize Footer as you wish ([#754](https://www.github.com/iTwin/iTwinUI-react/issues/754)) ([48dfe52](https://www.github.com/iTwin/iTwinUI-react/commit/48dfe524f4ac45a81cd98504f38c50420f47664a))
|
|
8
|
+
* **Slider:** Adding vertical orientation support ([#747](https://www.github.com/iTwin/iTwinUI-react/issues/747)) ([18cb893](https://www.github.com/iTwin/iTwinUI-react/commit/18cb89317118081ab425606f5679be56e1b60552))
|
|
9
|
+
* **Table:** Style `DropdownMenu` inside of `ActionColumn` in `Table` ([#756](https://www.github.com/iTwin/iTwinUI-react/issues/756)) ([1116369](https://www.github.com/iTwin/iTwinUI-react/commit/111636962076797cbbc0f0b8b5ae4077a7e5a8d2))
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
* **Breadcrumbs**, **ButtonGroup**: Fix focus getting lost while resizing on overflow ([#777](https://www.github.com/iTwin/iTwinUI-react/issues/777)) ([8ee9c7b](https://www.github.com/iTwin/iTwinUI-react/commit/8ee9c7b57829b330cea7db5f89864c90211ec4d1))
|
|
14
|
+
* **Table:** Enabled scrollToRow for lazy-loading tables ([#775](https://www.github.com/iTwin/iTwinUI-react/issues/775)) ([c57b458](https://www.github.com/iTwin/iTwinUI-react/commit/c57b458e7d74609d44d3f0d304e49ee2c1f22d54))
|
|
15
|
+
* **Table:** Syncing header and body horizontal scroll state ([#760](https://www.github.com/iTwin/iTwinUI-react/issues/760)) ([5ceeec2](https://www.github.com/iTwin/iTwinUI-react/commit/5ceeec279585ca5af92f1b26440c354ee6eeb027))
|
|
16
|
+
|
|
17
|
+
## [1.42.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.41.0...v1.42.0) (2022-07-26)
|
|
18
|
+
|
|
19
|
+
### Fixes
|
|
20
|
+
|
|
21
|
+
* **ComboBox:** Prevent infinite loop when `options` change ([#738](https://www.github.com/iTwin/iTwinUI-react/issues/738)) ([7788f45](https://www.github.com/iTwin/iTwinUI-react/commit/7788f451fcbf9dd7959d3fa727c0cdee3485bbcd))
|
|
22
|
+
* **Small:** Use `small` element instead of `p` ([#735](https://www.github.com/iTwin/iTwinUI-react/issues/735)) ([c59f213](https://www.github.com/iTwin/iTwinUI-react/commit/c59f21326e049bce50e24c729a46482b74ef63c3))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### What's new
|
|
26
|
+
|
|
27
|
+
* **Table:** Scroll table to selected item ([#689](https://www.github.com/iTwin/iTwinUI-react/issues/689)) ([afa947b](https://www.github.com/iTwin/iTwinUI-react/commit/afa947b15411305c1bfc57b239d916fc599acfbe))
|
|
28
|
+
* **Tree:** Virtualization ([#713](https://www.github.com/iTwin/iTwinUI-react/issues/713)) ([d4d3575](https://www.github.com/iTwin/iTwinUI-react/commit/d4d35758fa0c8f00811f387cc8453b82e9773c85))
|
|
29
|
+
|
|
30
|
+
## [1.41.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.40.1...v1.41.0) (2022-07-13)
|
|
31
|
+
|
|
32
|
+
### What's new
|
|
33
|
+
|
|
34
|
+
* **ErrorPage:** Add time-out and redirect status codes ([#715](https://www.github.com/iTwin/iTwinUI-react/issues/715)) ([a5fb85f](https://www.github.com/iTwin/iTwinUI-react/commit/a5fb85f1f0ef9517a065db02384875d7c5d87f95))
|
|
35
|
+
* **Modal:** Update classes through the css package update ([#724](https://www.github.com/iTwin/iTwinUI-react/issues/724)) ([d13e0bf](https://www.github.com/iTwin/iTwinUI-react/commit/d13e0bf7941581a3b8d275b744bf77ebd7ae95d4))
|
|
36
|
+
- Now `style` and `className` props are applied on the dialog element itself.
|
|
37
|
+
* Border radius was changed from `3px` to `4px` through the css package update in all elements ([#724](https://www.github.com/iTwin/iTwinUI-react/issues/724)) ([d13e0bf](https://www.github.com/iTwin/iTwinUI-react/commit/d13e0bf7941581a3b8d275b744bf77ebd7ae95d4))
|
|
38
|
+
|
|
39
|
+
### Fixes
|
|
40
|
+
|
|
41
|
+
* **Combobox:** Allow users to reset the value ([#728](https://www.github.com/iTwin/iTwinUI-react/issues/728)) ([f6c0b0d](https://www.github.com/iTwin/iTwinUI-react/commit/f6c0b0d66ac9ac725a23e07980c9dd7298084ae4))
|
|
42
|
+
* **Table:** Prevent crashing when clearing editable cell ([#732](https://www.github.com/iTwin/iTwinUI-react/issues/732)) ([0dedd3b](https://www.github.com/iTwin/iTwinUI-react/commit/0dedd3b8804ce98ce836d4bbbf58db83a4f9bfde))
|
|
43
|
+
* **Table:** Set correct intersection root for margin to work ([#708](https://www.github.com/iTwin/iTwinUI-react/issues/708)) ([55e4848](https://www.github.com/iTwin/iTwinUI-react/commit/55e48481f95c3351c127d495bd3c20134fd4a77f))
|
|
44
|
+
|
|
3
45
|
### [1.40.1](https://www.github.com/iTwin/iTwinUI-react/compare/v1.40.0...v1.40.1) (2022-06-17)
|
|
4
46
|
|
|
5
47
|
### Fixes
|
|
@@ -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,41 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Backdrop = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
+
var utils_1 = require("../utils");
|
|
36
|
+
require("@itwin/itwinui-css/css/backdrop.css");
|
|
37
|
+
exports.Backdrop = react_1.default.forwardRef(function (props, ref) {
|
|
38
|
+
var _a = props.isVisible, isVisible = _a === void 0 ? true : _a, className = props.className, rest = __rest(props, ["isVisible", "className"]);
|
|
39
|
+
(0, utils_1.useTheme)();
|
|
40
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-backdrop', { 'iui-backdrop-visible': isVisible }, className), ref: ref }, rest)));
|
|
41
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Backdrop = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
var Backdrop_1 = require("./Backdrop");
|
|
9
|
+
Object.defineProperty(exports, "Backdrop", { enumerable: true, get: function () { return Backdrop_1.Backdrop; } });
|
|
@@ -62,28 +62,15 @@ exports.Breadcrumbs = react_1.default.forwardRef(function (props, ref) {
|
|
|
62
62
|
(0, utils_1.useTheme)();
|
|
63
63
|
var _b = (0, utils_1.useOverflow)(items), overflowRef = _b[0], visibleCount = _b[1];
|
|
64
64
|
var refs = (0, utils_1.useMergedRefs)(overflowRef, ref);
|
|
65
|
-
var Separator = function () { return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : react_1.default.createElement(ChevronRight_1.default, null))); };
|
|
66
|
-
var ListItem = function (_a) {
|
|
67
|
-
var _b;
|
|
68
|
-
var index = _a.index;
|
|
69
|
-
var item = items[index];
|
|
70
|
-
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' }, react_1.default.isValidElement(item)
|
|
71
|
-
? react_1.default.cloneElement(item, {
|
|
72
|
-
'aria-current': ((_b = item.props['aria-current']) !== null && _b !== void 0 ? _b : currentIndex === index)
|
|
73
|
-
? 'location'
|
|
74
|
-
: undefined,
|
|
75
|
-
})
|
|
76
|
-
: item));
|
|
77
|
-
};
|
|
78
65
|
return (react_1.default.createElement("nav", __assign({ className: (0, classnames_1.default)('iui-breadcrumbs', className), ref: refs, "aria-label": 'Breadcrumb' }, rest),
|
|
79
66
|
react_1.default.createElement("ol", { className: 'iui-breadcrumbs-list' },
|
|
80
67
|
visibleCount > 1 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
|
-
react_1.default.createElement(ListItem, {
|
|
82
|
-
react_1.default.createElement(Separator,
|
|
68
|
+
react_1.default.createElement(ListItem, { item: items[0], isActive: currentIndex === 0 }),
|
|
69
|
+
react_1.default.createElement(Separator, { separator: separator }))),
|
|
83
70
|
items.length - visibleCount > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
84
71
|
react_1.default.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' },
|
|
85
72
|
react_1.default.createElement("span", { className: 'iui-breadcrumbs-text' }, "\u2026")),
|
|
86
|
-
react_1.default.createElement(Separator,
|
|
73
|
+
react_1.default.createElement(Separator, { separator: separator }))),
|
|
87
74
|
items
|
|
88
75
|
.slice(visibleCount > 1
|
|
89
76
|
? items.length - visibleCount + 1
|
|
@@ -93,8 +80,21 @@ exports.Breadcrumbs = react_1.default.forwardRef(function (props, ref) {
|
|
|
93
80
|
? 1 + (items.length - visibleCount) + _index
|
|
94
81
|
: items.length - 1;
|
|
95
82
|
return (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
96
|
-
react_1.default.createElement(ListItem, { index: index }),
|
|
97
|
-
index < items.length - 1 && react_1.default.createElement(Separator,
|
|
83
|
+
react_1.default.createElement(ListItem, { item: items[index], isActive: currentIndex === index }),
|
|
84
|
+
index < items.length - 1 && (react_1.default.createElement(Separator, { separator: separator }))));
|
|
98
85
|
}))));
|
|
99
86
|
});
|
|
87
|
+
var ListItem = function (_a) {
|
|
88
|
+
var _b;
|
|
89
|
+
var item = _a.item, isActive = _a.isActive;
|
|
90
|
+
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-item iui-breadcrumbs-item-overrides' }, react_1.default.isValidElement(item)
|
|
91
|
+
? react_1.default.cloneElement(item, {
|
|
92
|
+
'aria-current': ((_b = item.props['aria-current']) !== null && _b !== void 0 ? _b : isActive) ? 'location' : undefined,
|
|
93
|
+
})
|
|
94
|
+
: item));
|
|
95
|
+
};
|
|
96
|
+
var Separator = function (_a) {
|
|
97
|
+
var separator = _a.separator;
|
|
98
|
+
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : react_1.default.createElement(ChevronRight_1.default, null)));
|
|
99
|
+
};
|
|
100
100
|
exports.default = exports.Breadcrumbs;
|
|
@@ -72,9 +72,16 @@ exports.ButtonGroup = react_1.default.forwardRef(function (props, ref) {
|
|
|
72
72
|
'iui-button-group': orientation === 'horizontal',
|
|
73
73
|
'iui-button-group-vertical': orientation === 'vertical',
|
|
74
74
|
'iui-button-group-overflow-x': !!overflowButton && orientation === 'horizontal',
|
|
75
|
-
}, className), "aria-orientation": orientation, ref: refs }, rest),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
}, className), "aria-orientation": orientation, ref: refs }, rest),
|
|
76
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
|
+
visibleCount < items.length &&
|
|
78
|
+
overflowButton &&
|
|
79
|
+
overflowPlacement === 'start' && (react_1.default.createElement("div", null, overflowButton(visibleCount))),
|
|
80
|
+
visibleCount < items.length
|
|
81
|
+
? items.slice(0, visibleCount - 1)
|
|
82
|
+
: items,
|
|
83
|
+
visibleCount < items.length &&
|
|
84
|
+
overflowButton &&
|
|
85
|
+
overflowPlacement === 'end' && (react_1.default.createElement("div", null, overflowButton(visibleCount))))));
|
|
79
86
|
});
|
|
80
87
|
exports.default = exports.ButtonGroup;
|
|
@@ -74,11 +74,10 @@ var ComboBox = function (props) {
|
|
|
74
74
|
var inputRef = react_1.default.useRef(null);
|
|
75
75
|
var menuRef = react_1.default.useRef(null);
|
|
76
76
|
var toggleButtonRef = react_1.default.useRef(null);
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, [onChange]);
|
|
77
|
+
var mounted = react_1.default.useRef(false);
|
|
78
|
+
var valuePropRef = (0, utils_1.useLatestRef)(valueProp);
|
|
79
|
+
var onChangeProp = (0, utils_1.useLatestRef)(onChange);
|
|
80
|
+
var optionsRef = (0, utils_1.useLatestRef)(options);
|
|
82
81
|
// Record to store all extra information (e.g. original indexes), where the key is the id of the option
|
|
83
82
|
var optionsExtraInfoRef = react_1.default.useRef({});
|
|
84
83
|
// Clear the extra info when the options change so that it can be reinitialized below
|
|
@@ -97,7 +96,9 @@ var ComboBox = function (props) {
|
|
|
97
96
|
// Reducer where all the component-wide state is stored
|
|
98
97
|
var _e = react_1.default.useReducer(helpers_1.comboBoxReducer, {
|
|
99
98
|
isOpen: false,
|
|
100
|
-
selectedIndex:
|
|
99
|
+
selectedIndex: valueProp
|
|
100
|
+
? optionsRef.current.findIndex(function (option) { return option.value === valueProp; })
|
|
101
|
+
: -1,
|
|
101
102
|
focusedIndex: -1,
|
|
102
103
|
}), _f = _e[0], isOpen = _f.isOpen, selectedIndex = _f.selectedIndex, focusedIndex = _f.focusedIndex, dispatch = _e[1];
|
|
103
104
|
react_1.default.useLayoutEffect(function () {
|
|
@@ -105,7 +106,7 @@ var ComboBox = function (props) {
|
|
|
105
106
|
// When the dropdown opens
|
|
106
107
|
if (isOpen) {
|
|
107
108
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // Focus the input
|
|
108
|
-
setFilteredOptions(
|
|
109
|
+
setFilteredOptions(optionsRef.current); // Reset the filtered list
|
|
109
110
|
dispatch(['focus']);
|
|
110
111
|
}
|
|
111
112
|
// When the dropdown closes
|
|
@@ -114,10 +115,10 @@ var ComboBox = function (props) {
|
|
|
114
115
|
dispatch(['focus']);
|
|
115
116
|
// Reset the input value
|
|
116
117
|
setInputValue(selectedIndex != undefined && selectedIndex >= 0
|
|
117
|
-
? (_b =
|
|
118
|
+
? (_b = optionsRef.current[selectedIndex]) === null || _b === void 0 ? void 0 : _b.label
|
|
118
119
|
: '');
|
|
119
120
|
}
|
|
120
|
-
}, [isOpen,
|
|
121
|
+
}, [isOpen, optionsRef, selectedIndex]);
|
|
121
122
|
// Set min-width of menu to be same as input
|
|
122
123
|
var _g = react_1.default.useState(0), minWidth = _g[0], setMinWidth = _g[1];
|
|
123
124
|
react_1.default.useEffect(function () {
|
|
@@ -148,14 +149,14 @@ var ComboBox = function (props) {
|
|
|
148
149
|
var value = event.currentTarget.value;
|
|
149
150
|
setInputValue(value);
|
|
150
151
|
dispatch(['open']); // reopen when typing
|
|
151
|
-
setFilteredOptions((_a = filterFunction === null || filterFunction === void 0 ? void 0 : filterFunction(
|
|
152
|
+
setFilteredOptions((_a = filterFunction === null || filterFunction === void 0 ? void 0 : filterFunction(optionsRef.current, value)) !== null && _a !== void 0 ? _a : optionsRef.current.filter(function (option) {
|
|
152
153
|
return option.label.toLowerCase().includes(value.toLowerCase());
|
|
153
154
|
}));
|
|
154
155
|
if (focusedIndex != -1) {
|
|
155
156
|
dispatch(['focus', -1]);
|
|
156
157
|
}
|
|
157
158
|
(_b = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) === null || _b === void 0 ? void 0 : _b.call(inputProps, event);
|
|
158
|
-
}, [filterFunction, focusedIndex, inputProps,
|
|
159
|
+
}, [filterFunction, focusedIndex, inputProps, optionsRef]);
|
|
159
160
|
// When the value prop changes, update the selectedIndex
|
|
160
161
|
react_1.default.useEffect(function () {
|
|
161
162
|
dispatch([
|
|
@@ -166,14 +167,17 @@ var ComboBox = function (props) {
|
|
|
166
167
|
// Call user-defined onChange when the value actually changes
|
|
167
168
|
react_1.default.useEffect(function () {
|
|
168
169
|
var _a, _b;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
// Prevent user-defined onChange to be called on mount
|
|
171
|
+
if (!mounted.current) {
|
|
172
|
+
mounted.current = true;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
var currentValue = (_a = optionsRef.current[selectedIndex]) === null || _a === void 0 ? void 0 : _a.value;
|
|
176
|
+
if (currentValue === valuePropRef.current || selectedIndex === -1) {
|
|
177
|
+
return;
|
|
175
178
|
}
|
|
176
|
-
|
|
179
|
+
(_b = onChangeProp.current) === null || _b === void 0 ? void 0 : _b.call(onChangeProp, currentValue);
|
|
180
|
+
}, [onChangeProp, optionsRef, selectedIndex, valuePropRef]);
|
|
177
181
|
var getMenuItem = react_1.default.useCallback(function (option, filteredIndex) {
|
|
178
182
|
var optionId = getOptionId(option, id);
|
|
179
183
|
var __originalIndex = optionsExtraInfoRef.current[optionId].__originalIndex;
|
|
@@ -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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Dialog = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
12
|
+
require("@itwin/itwinui-css/css/dialog.css");
|
|
13
|
+
var DialogTitleBar_1 = require("./DialogTitleBar");
|
|
14
|
+
var DialogContent_1 = require("./DialogContent");
|
|
15
|
+
var DialogBackdrop_1 = require("./DialogBackdrop");
|
|
16
|
+
var DialogContext_1 = require("./DialogContext");
|
|
17
|
+
var DialogButtonBar_1 = require("./DialogButtonBar");
|
|
18
|
+
var DialogMain_1 = __importDefault(require("./DialogMain"));
|
|
19
|
+
/**
|
|
20
|
+
* Dialog component.
|
|
21
|
+
* @example
|
|
22
|
+
* <Dialog
|
|
23
|
+
* isOpen={isOpen}
|
|
24
|
+
* onClose={() => setIsOpen(false)}
|
|
25
|
+
* trapFocus
|
|
26
|
+
* preventDocumentScroll
|
|
27
|
+
* >
|
|
28
|
+
* <Dialog.Backdrop />
|
|
29
|
+
* <Dialog.Main aria-modal>
|
|
30
|
+
* <Dialog.TitleBar>My dialog title</Dialog.TitleBar>
|
|
31
|
+
* <Dialog.Content>
|
|
32
|
+
* Here is my dialog content
|
|
33
|
+
* </Dialog.Content>
|
|
34
|
+
* <Dialog.ButtonBar>
|
|
35
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
36
|
+
* <Button>Close</Button>
|
|
37
|
+
* </Dialog.ButtonBar>
|
|
38
|
+
* </Dialog.Main>
|
|
39
|
+
* </Dialog>
|
|
40
|
+
*/
|
|
41
|
+
exports.Dialog = Object.assign(function (props) {
|
|
42
|
+
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;
|
|
43
|
+
return (react_1.default.createElement(DialogContext_1.DialogContext.Provider, { value: {
|
|
44
|
+
isOpen: isOpen,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
closeOnEsc: closeOnEsc,
|
|
47
|
+
closeOnExternalClick: closeOnExternalClick,
|
|
48
|
+
isDismissible: isDismissible,
|
|
49
|
+
preventDocumentScroll: preventDocumentScroll,
|
|
50
|
+
trapFocus: trapFocus,
|
|
51
|
+
} }, children));
|
|
52
|
+
}, {
|
|
53
|
+
Backdrop: DialogBackdrop_1.DialogBackdrop,
|
|
54
|
+
Main: DialogMain_1.default,
|
|
55
|
+
TitleBar: DialogTitleBar_1.DialogTitleBar,
|
|
56
|
+
Content: DialogContent_1.DialogContent,
|
|
57
|
+
ButtonBar: DialogButtonBar_1.DialogButtonBar,
|
|
58
|
+
});
|
|
59
|
+
exports.default = exports.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,61 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.DialogBackdrop = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var Backdrop_1 = require("../Backdrop");
|
|
35
|
+
var utils_1 = require("../utils");
|
|
36
|
+
var DialogContext_1 = require("./DialogContext");
|
|
37
|
+
/**
|
|
38
|
+
* Backdrop component for dialog. Recommended to be used with `Dialog`
|
|
39
|
+
* then its visibility is being controlled by dialog's `isOpen` prop.
|
|
40
|
+
* @example
|
|
41
|
+
* <Dialog.Backdrop />
|
|
42
|
+
*/
|
|
43
|
+
exports.DialogBackdrop = react_1.default.forwardRef(function (props, ref) {
|
|
44
|
+
var dialogContext = (0, DialogContext_1.useDialogContext)();
|
|
45
|
+
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"]);
|
|
46
|
+
var backdropRef = react_1.default.useRef(null);
|
|
47
|
+
var refs = (0, utils_1.useMergedRefs)(backdropRef, ref);
|
|
48
|
+
var handleMouseDown = function (event) {
|
|
49
|
+
// Prevents React from resetting its properties
|
|
50
|
+
event.persist();
|
|
51
|
+
if (event.target !== backdropRef.current) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (isDismissible && closeOnExternalClick && onClose) {
|
|
55
|
+
onClose(event);
|
|
56
|
+
}
|
|
57
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
|
|
58
|
+
};
|
|
59
|
+
return (react_1.default.createElement(Backdrop_1.Backdrop, __assign({ isVisible: isVisible, ref: refs, onMouseDown: handleMouseDown }, rest)));
|
|
60
|
+
});
|
|
61
|
+
exports.default = exports.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,50 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.DialogButtonBar = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
+
var utils_1 = require("../utils");
|
|
36
|
+
require("@itwin/itwinui-css/css/dialog.css");
|
|
37
|
+
/**
|
|
38
|
+
* Container for Buttons in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
39
|
+
* @example
|
|
40
|
+
* <Dialog.ButtonBar>
|
|
41
|
+
* <Button styleType='high-visibility'>Confirm</Button>
|
|
42
|
+
* <Button>Close</Button>
|
|
43
|
+
* </Dialog.ButtonBar>
|
|
44
|
+
*/
|
|
45
|
+
exports.DialogButtonBar = react_1.default.forwardRef(function (props, ref) {
|
|
46
|
+
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
47
|
+
(0, utils_1.useTheme)();
|
|
48
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-dialog-button-bar', className), ref: ref }, rest), children));
|
|
49
|
+
});
|
|
50
|
+
exports.default = exports.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,49 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.DialogContent = void 0;
|
|
29
|
+
/*---------------------------------------------------------------------------------------------
|
|
30
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
|
+
*--------------------------------------------------------------------------------------------*/
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
34
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
35
|
+
var utils_1 = require("../utils");
|
|
36
|
+
require("@itwin/itwinui-css/css/dialog.css");
|
|
37
|
+
/**
|
|
38
|
+
* Container for content in `Dialog`. Recommended to be used as a child of `Dialog`.
|
|
39
|
+
* @example
|
|
40
|
+
* <Dialog.Content>
|
|
41
|
+
* My dialog content
|
|
42
|
+
* </Dialog.Content>
|
|
43
|
+
*/
|
|
44
|
+
exports.DialogContent = react_1.default.forwardRef(function (props, ref) {
|
|
45
|
+
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
46
|
+
(0, utils_1.useTheme)();
|
|
47
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-dialog-content', className), ref: ref }, rest), children));
|
|
48
|
+
});
|
|
49
|
+
exports.default = exports.DialogContent;
|