@itwin/itwinui-react 1.42.0 → 1.44.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 +30 -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/Menu/Menu.js +0 -3
- 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/Select/Select.d.ts +23 -8
- package/cjs/core/Select/Select.js +82 -25
- package/cjs/core/Select/SelectTag.d.ts +15 -0
- package/cjs/core/Select/SelectTag.js +48 -0
- package/cjs/core/Select/index.d.ts +1 -1
- 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 +8 -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/useScrollToRow.d.ts +1 -1
- package/cjs/core/Table/hooks/useScrollToRow.js +3 -3
- package/cjs/core/index.d.ts +4 -2
- 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/useOverflow.js +4 -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/Menu/Menu.js +0 -3
- 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/Select/Select.d.ts +23 -8
- package/esm/core/Select/Select.js +83 -26
- package/esm/core/Select/SelectTag.d.ts +15 -0
- package/esm/core/Select/SelectTag.js +41 -0
- package/esm/core/Select/index.d.ts +1 -1
- 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 +8 -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/useScrollToRow.d.ts +1 -1
- package/esm/core/Table/hooks/useScrollToRow.js +3 -3
- package/esm/core/index.d.ts +4 -2
- 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/useOverflow.js +4 -1
- package/package.json +6 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Dialog } from './Dialog';
|
|
2
|
+
export type { DialogProps } from './Dialog';
|
|
3
|
+
export type { DialogMainProps } from './DialogMain';
|
|
4
|
+
export type { DialogTitleBarProps } from './DialogTitleBar';
|
|
5
|
+
export type { DialogContentProps } from './DialogContent';
|
|
6
|
+
export type { DialogButtonBarProps } from './DialogButtonBar';
|
|
7
|
+
declare const _default: "./Dialog";
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
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 { Dialog } from './Dialog';
|
|
6
|
+
export default './Dialog';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { StylingProps } from '../utils';
|
|
3
3
|
import '@itwin/itwinui-css/css/footer.css';
|
|
4
4
|
export declare type TitleTranslations = {
|
|
@@ -19,6 +19,11 @@ export declare type FooterProps = {
|
|
|
19
19
|
* Provide localized strings.
|
|
20
20
|
*/
|
|
21
21
|
translatedTitles?: TitleTranslations;
|
|
22
|
+
/**
|
|
23
|
+
* Custom footer content. If provided, it will render only what you passed.
|
|
24
|
+
* Use `defaultFooterElements` to get the default footer elements.
|
|
25
|
+
*/
|
|
26
|
+
children?: React.ReactNode;
|
|
22
27
|
} & StylingProps;
|
|
23
28
|
export declare type FooterElement = {
|
|
24
29
|
/**
|
|
@@ -34,6 +39,7 @@ export declare type FooterElement = {
|
|
|
34
39
|
*/
|
|
35
40
|
key?: keyof TitleTranslations | 'copyright' | (string & Record<never, never>);
|
|
36
41
|
};
|
|
42
|
+
export declare const defaultFooterElements: FooterElement[];
|
|
37
43
|
/**
|
|
38
44
|
* Footer element with all needed legal and info links.
|
|
39
45
|
* Be sure to place it manually at the bottom of your page.
|
|
@@ -47,5 +53,13 @@ export declare type FooterElement = {
|
|
|
47
53
|
* @example <caption>Changing a url</caption>
|
|
48
54
|
* <Footer customElements={(defaultElements) => defaultElements.map(element => ({ ...element, url: element.key === 'privacy' ? customPrivacyUrl : element.url }))} />
|
|
49
55
|
*/
|
|
50
|
-
export declare const Footer: (props: FooterProps) => JSX.Element
|
|
56
|
+
export declare const Footer: ((props: FooterProps) => JSX.Element) & {
|
|
57
|
+
List: (props: Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "key" | keyof React.HTMLAttributes<HTMLUListElement>> & {
|
|
58
|
+
ref?: ((instance: HTMLUListElement | null) => void) | React.RefObject<HTMLUListElement> | null | undefined;
|
|
59
|
+
}) => JSX.Element;
|
|
60
|
+
Item: (props: Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof React.LiHTMLAttributes<HTMLLIElement>> & {
|
|
61
|
+
ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
|
|
62
|
+
}) => JSX.Element;
|
|
63
|
+
Separator: (props: import("./FooterSeparator").FooterSeparatorProps) => JSX.Element;
|
|
64
|
+
};
|
|
51
65
|
export default Footer;
|
|
@@ -37,6 +37,9 @@ import React from 'react';
|
|
|
37
37
|
import cx from 'classnames';
|
|
38
38
|
import { useTheme } from '../utils';
|
|
39
39
|
import '@itwin/itwinui-css/css/footer.css';
|
|
40
|
+
import { FooterItem } from './FooterItem';
|
|
41
|
+
import { FooterSeparator } from './FooterSeparator';
|
|
42
|
+
import { FooterList } from './FooterList';
|
|
40
43
|
var footerTranslations = {
|
|
41
44
|
cookies: 'Cookies',
|
|
42
45
|
legalNotices: 'Legal notices',
|
|
@@ -44,6 +47,37 @@ var footerTranslations = {
|
|
|
44
47
|
termsOfService: 'Terms of service',
|
|
45
48
|
termsOfUse: 'Terms of use',
|
|
46
49
|
};
|
|
50
|
+
export var defaultFooterElements = [
|
|
51
|
+
{
|
|
52
|
+
key: 'copyright',
|
|
53
|
+
title: "\u00A9 ".concat(new Date().getFullYear(), " Bentley Systems, Incorporated"),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'termsOfService',
|
|
57
|
+
title: footerTranslations.termsOfService,
|
|
58
|
+
url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: 'privacy',
|
|
62
|
+
title: footerTranslations.privacy,
|
|
63
|
+
url: 'https://www.bentley.com/en/privacy-policy',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 'termsOfUse',
|
|
67
|
+
title: footerTranslations.termsOfUse,
|
|
68
|
+
url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: 'cookies',
|
|
72
|
+
title: footerTranslations.cookies,
|
|
73
|
+
url: 'https://www.bentley.com/en/cookie-policy',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'legalNotices',
|
|
77
|
+
title: footerTranslations.legalNotices,
|
|
78
|
+
url: 'https://connect.bentley.com/Legal',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
47
81
|
/**
|
|
48
82
|
* Footer element with all needed legal and info links.
|
|
49
83
|
* Be sure to place it manually at the bottom of your page.
|
|
@@ -57,53 +91,32 @@ var footerTranslations = {
|
|
|
57
91
|
* @example <caption>Changing a url</caption>
|
|
58
92
|
* <Footer customElements={(defaultElements) => defaultElements.map(element => ({ ...element, url: element.key === 'privacy' ? customPrivacyUrl : element.url }))} />
|
|
59
93
|
*/
|
|
60
|
-
export var Footer = function (props) {
|
|
61
|
-
var customElements = props.customElements, translatedTitles = props.translatedTitles, className = props.className, rest = __rest(props, ["customElements", "translatedTitles", "className"]);
|
|
94
|
+
export var Footer = Object.assign(function (props) {
|
|
95
|
+
var children = props.children, customElements = props.customElements, translatedTitles = props.translatedTitles, className = props.className, rest = __rest(props, ["children", "customElements", "translatedTitles", "className"]);
|
|
62
96
|
useTheme();
|
|
63
97
|
var titles = __assign(__assign({}, footerTranslations), translatedTitles);
|
|
64
|
-
var
|
|
65
|
-
{
|
|
66
|
-
key
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: 'privacy',
|
|
76
|
-
title: titles.privacy,
|
|
77
|
-
url: 'https://www.bentley.com/en/privacy-policy',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: 'termsOfUse',
|
|
81
|
-
title: titles.termsOfUse,
|
|
82
|
-
url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
key: 'cookies',
|
|
86
|
-
title: titles.cookies,
|
|
87
|
-
url: 'https://www.bentley.com/en/cookie-policy',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
key: 'legalNotices',
|
|
91
|
-
title: titles.legalNotices,
|
|
92
|
-
url: 'https://connect.bentley.com/Legal',
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
var elements = defaultElements;
|
|
98
|
+
var translatedElements = defaultFooterElements.map(function (element) {
|
|
99
|
+
if (element.key && titles.hasOwnProperty(element.key)) {
|
|
100
|
+
var key = element.key;
|
|
101
|
+
return __assign(__assign({}, element), { title: titles[key] });
|
|
102
|
+
}
|
|
103
|
+
return element;
|
|
104
|
+
});
|
|
105
|
+
var elements = translatedElements;
|
|
96
106
|
if (customElements) {
|
|
97
107
|
elements =
|
|
98
108
|
typeof customElements === 'function'
|
|
99
|
-
? customElements(
|
|
100
|
-
: __spreadArray(__spreadArray([],
|
|
109
|
+
? customElements(translatedElements)
|
|
110
|
+
: __spreadArray(__spreadArray([], translatedElements, true), customElements, true);
|
|
101
111
|
}
|
|
102
|
-
return (React.createElement("footer", __assign({ className: cx('iui-legal-footer', className) }, rest),
|
|
103
|
-
React.createElement(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
return (React.createElement("footer", __assign({ className: cx('iui-legal-footer', className) }, rest), children ? (children) : (React.createElement(FooterList, null, elements.map(function (element, index) {
|
|
113
|
+
return (React.createElement(React.Fragment, { key: element.key || "".concat(element.title, "-").concat(index) },
|
|
114
|
+
index > 0 && React.createElement(FooterSeparator, null),
|
|
115
|
+
React.createElement(FooterItem, null, element.url ? (React.createElement("a", { href: element.url, target: '_blank', rel: 'noreferrer' }, element.title)) : (element.title))));
|
|
116
|
+
})))));
|
|
117
|
+
}, {
|
|
118
|
+
List: FooterList,
|
|
119
|
+
Item: FooterItem,
|
|
120
|
+
Separator: FooterSeparator,
|
|
121
|
+
});
|
|
109
122
|
export default Footer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
3
|
+
export declare type FooterItemProps = React.ComponentPropsWithRef<'li'>;
|
|
4
|
+
/**
|
|
5
|
+
* Footer item. Recommended to use inside `Footer.List`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FooterItem: (props: FooterItemProps) => JSX.Element;
|
|
8
|
+
export default FooterItem;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { useTheme } from '../utils';
|
|
29
|
+
import cx from 'classnames';
|
|
30
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
31
|
+
/**
|
|
32
|
+
* Footer item. Recommended to use inside `Footer.List`.
|
|
33
|
+
*/
|
|
34
|
+
export var FooterItem = function (props) {
|
|
35
|
+
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
36
|
+
useTheme();
|
|
37
|
+
return (React.createElement("li", __assign({ className: cx('iui-legal-footer-item', className) }, rest), children));
|
|
38
|
+
};
|
|
39
|
+
export default FooterItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
3
|
+
export declare type FooterListProps = React.ComponentPropsWithRef<'ul'>;
|
|
4
|
+
/**
|
|
5
|
+
* Footer list. Recommended to use inside `Footer` with `Footer.Item` and `Footer.Separator`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FooterList: (props: FooterListProps) => JSX.Element;
|
|
8
|
+
export default FooterList;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { useTheme } from '../utils';
|
|
29
|
+
import cx from 'classnames';
|
|
30
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
31
|
+
/**
|
|
32
|
+
* Footer list. Recommended to use inside `Footer` with `Footer.Item` and `Footer.Separator`.
|
|
33
|
+
*/
|
|
34
|
+
export var FooterList = function (props) {
|
|
35
|
+
var className = props.className, children = props.children, rest = __rest(props, ["className", "children"]);
|
|
36
|
+
useTheme();
|
|
37
|
+
return (React.createElement("ul", __assign({ className: cx('iui-legal-footer-list', className) }, rest), children));
|
|
38
|
+
};
|
|
39
|
+
export default FooterList;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
3
|
+
export declare type FooterSeparatorProps = Omit<React.ComponentPropsWithRef<'li'>, 'children'>;
|
|
4
|
+
/**
|
|
5
|
+
* Footer separator. Recommended to use inside `Footer.List`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FooterSeparator: (props: FooterSeparatorProps) => JSX.Element;
|
|
8
|
+
export default FooterSeparator;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { useTheme } from '../utils';
|
|
29
|
+
import cx from 'classnames';
|
|
30
|
+
import '@itwin/itwinui-css/css/footer.css';
|
|
31
|
+
/**
|
|
32
|
+
* Footer separator. Recommended to use inside `Footer.List`.
|
|
33
|
+
*/
|
|
34
|
+
export var FooterSeparator = function (props) {
|
|
35
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
36
|
+
useTheme();
|
|
37
|
+
return (React.createElement("li", __assign({ className: cx('iui-legal-footer-separator', className), "aria-hidden": true }, rest)));
|
|
38
|
+
};
|
|
39
|
+
export default FooterSeparator;
|
package/esm/core/Footer/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
export { Footer } from './Footer';
|
|
5
|
+
export { Footer, defaultFooterElements } from './Footer';
|
|
6
6
|
export default './Footer';
|
package/esm/core/Menu/Menu.js
CHANGED
|
@@ -37,9 +37,6 @@ export var Menu = React.forwardRef(function (props, ref) {
|
|
|
37
37
|
var _c = React.useState(), focusedIndex = _c[0], setFocusedIndex = _c[1];
|
|
38
38
|
var menuRef = React.useRef(null);
|
|
39
39
|
var refs = useMergedRefs(menuRef, ref);
|
|
40
|
-
React.useEffect(function () {
|
|
41
|
-
setFocusedIndex(null);
|
|
42
|
-
}, [children]);
|
|
43
40
|
var getFocusableNodes = React.useCallback(function () {
|
|
44
41
|
var focusableItems = getFocusableElements(menuRef.current);
|
|
45
42
|
// Filter out focusable elements that are inside each menu item, e.g. checkbox, anchor
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonProps } from '../utils';
|
|
3
3
|
import '@itwin/itwinui-css/css/dialog.css';
|
|
4
|
-
import '
|
|
4
|
+
import { DialogMainProps } from '../Dialog';
|
|
5
5
|
export declare type ModalProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Flag whether modal should be shown.
|
|
8
|
-
* @default false
|
|
9
|
-
*/
|
|
10
|
-
isOpen?: boolean;
|
|
11
6
|
/**
|
|
12
7
|
* Modal title.
|
|
13
8
|
*/
|
|
@@ -46,16 +41,11 @@ export declare type ModalProps = {
|
|
|
46
41
|
* @default document
|
|
47
42
|
*/
|
|
48
43
|
ownerDocument?: Document;
|
|
49
|
-
/**
|
|
50
|
-
* Type of the modal.
|
|
51
|
-
* @default 'default'
|
|
52
|
-
*/
|
|
53
|
-
styleType?: 'default' | 'fullPage';
|
|
54
44
|
/**
|
|
55
45
|
* Content of the modal.
|
|
56
46
|
*/
|
|
57
47
|
children: React.ReactNode;
|
|
58
|
-
} & Omit<CommonProps, 'title'>;
|
|
48
|
+
} & Pick<DialogMainProps, 'isOpen' | 'styleType'> & Omit<CommonProps, 'title'>;
|
|
59
49
|
/**
|
|
60
50
|
* Modal component which can wrap any content.
|
|
61
51
|
* @example
|
|
@@ -64,9 +54,9 @@ export declare type ModalProps = {
|
|
|
64
54
|
* title='My modal'
|
|
65
55
|
* onClose={onClose}
|
|
66
56
|
* >
|
|
67
|
-
* <
|
|
57
|
+
* <ModalContent>
|
|
68
58
|
* Here is my modal content
|
|
69
|
-
* </
|
|
59
|
+
* </ModalContent>
|
|
70
60
|
* <ModalButtonBar>
|
|
71
61
|
* <Button styleType='high-visibility'>
|
|
72
62
|
* Primary button
|
package/esm/core/Modal/Modal.js
CHANGED
|
@@ -26,13 +26,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
26
|
*--------------------------------------------------------------------------------------------*/
|
|
27
27
|
import React from 'react';
|
|
28
28
|
import ReactDOM from 'react-dom';
|
|
29
|
-
import
|
|
30
|
-
import SvgClose from '@itwin/itwinui-icons-react/cjs/icons/Close';
|
|
31
|
-
import { useTheme, getContainer, getDocument, FocusTrap, } from '../utils';
|
|
29
|
+
import { useTheme, getContainer, getDocument } from '../utils';
|
|
32
30
|
import '@itwin/itwinui-css/css/dialog.css';
|
|
33
|
-
import '
|
|
34
|
-
import { IconButton } from '../Buttons/IconButton';
|
|
35
|
-
import { CSSTransition } from 'react-transition-group';
|
|
31
|
+
import { Dialog } from '../Dialog';
|
|
36
32
|
/**
|
|
37
33
|
* Modal component which can wrap any content.
|
|
38
34
|
* @example
|
|
@@ -41,9 +37,9 @@ import { CSSTransition } from 'react-transition-group';
|
|
|
41
37
|
* title='My modal'
|
|
42
38
|
* onClose={onClose}
|
|
43
39
|
* >
|
|
44
|
-
* <
|
|
40
|
+
* <ModalContent>
|
|
45
41
|
* Here is my modal content
|
|
46
|
-
* </
|
|
42
|
+
* </ModalContent>
|
|
47
43
|
* <ModalButtonBar>
|
|
48
44
|
* <Button styleType='high-visibility'>
|
|
49
45
|
* Primary button
|
|
@@ -55,74 +51,13 @@ import { CSSTransition } from 'react-transition-group';
|
|
|
55
51
|
* </Modal>
|
|
56
52
|
*/
|
|
57
53
|
export var Modal = function (props) {
|
|
58
|
-
var _a = props.isOpen, isOpen = _a === void 0 ? false : _a, _b = props.isDismissible, isDismissible = _b === void 0 ? true : _b, _c = props.closeOnEsc, closeOnEsc = _c === void 0 ? true : _c, _d = props.closeOnExternalClick, closeOnExternalClick = _d === void 0 ? true : _d, onClose = props.onClose, title = props.title,
|
|
54
|
+
var _a = props.isOpen, isOpen = _a === void 0 ? false : _a, _b = props.isDismissible, isDismissible = _b === void 0 ? true : _b, _c = props.closeOnEsc, closeOnEsc = _c === void 0 ? true : _c, _d = props.closeOnExternalClick, closeOnExternalClick = _d === void 0 ? true : _d, onClose = props.onClose, title = props.title, children = props.children, _e = props.modalRootId, modalRootId = _e === void 0 ? 'iui-react-portal-container' : _e, _f = props.ownerDocument, ownerDocument = _f === void 0 ? getDocument() : _f, rest = __rest(props, ["isOpen", "isDismissible", "closeOnEsc", "closeOnExternalClick", "onClose", "title", "children", "modalRootId", "ownerDocument"]);
|
|
59
55
|
useTheme();
|
|
60
56
|
var container = getContainer(modalRootId, ownerDocument);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _a, _b;
|
|
67
|
-
if (isOpen) {
|
|
68
|
-
previousFocusedElement.current = document.activeElement;
|
|
69
|
-
(_a = overlayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
(_b = previousFocusedElement.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
73
|
-
}
|
|
74
|
-
var modalOverlayRef = overlayRef.current;
|
|
75
|
-
return function () {
|
|
76
|
-
var _a;
|
|
77
|
-
(modalOverlayRef === null || modalOverlayRef === void 0 ? void 0 : modalOverlayRef.contains(document.activeElement)) &&
|
|
78
|
-
((_a = previousFocusedElement.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
79
|
-
};
|
|
80
|
-
}, [isOpen]);
|
|
81
|
-
React.useEffect(function () {
|
|
82
|
-
if (!ownerDocument) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (isOpen) {
|
|
86
|
-
originalBodyOverflow.current = ownerDocument.body.style.overflow;
|
|
87
|
-
ownerDocument.body.style.overflow = 'hidden';
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
ownerDocument.body.style.overflow = originalBodyOverflow.current;
|
|
91
|
-
}
|
|
92
|
-
return function () {
|
|
93
|
-
ownerDocument.body.style.overflow = originalBodyOverflow.current;
|
|
94
|
-
};
|
|
95
|
-
}, [isOpen, ownerDocument]);
|
|
96
|
-
var handleKeyDown = function (event) {
|
|
97
|
-
// Prevents React from resetting its properties
|
|
98
|
-
event.persist();
|
|
99
|
-
if (isDismissible && closeOnEsc && event.key === 'Escape' && onClose) {
|
|
100
|
-
onClose(event);
|
|
101
|
-
}
|
|
102
|
-
if (onKeyDown) {
|
|
103
|
-
onKeyDown(event);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
var handleMouseDown = function (event) {
|
|
107
|
-
// Prevents React from resetting its properties
|
|
108
|
-
event.persist();
|
|
109
|
-
if (event.target !== overlayRef.current) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (isDismissible && closeOnExternalClick && onClose) {
|
|
113
|
-
onClose(event);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
return !!container ? (ReactDOM.createPortal(React.createElement(React.Fragment, null,
|
|
117
|
-
React.createElement("div", { className: cx('iui-backdrop', { 'iui-backdrop-visible': isOpen }), tabIndex: -1, onKeyDown: handleKeyDown, ref: overlayRef, onMouseDown: handleMouseDown }),
|
|
118
|
-
React.createElement(FocusTrap, null,
|
|
119
|
-
React.createElement("div", null,
|
|
120
|
-
React.createElement(CSSTransition, { in: isOpen, classNames: 'iui-dialog-animation', timeout: { exit: 600 }, unmountOnExit: true },
|
|
121
|
-
React.createElement("div", __assign({ className: cx('iui-dialog', { 'iui-dialog-default': styleType === 'default' }, { 'iui-dialog-full-page': styleType === 'fullPage' }, { 'iui-dialog-visible': isOpen }, className), id: id, style: style, role: 'dialog', "aria-modal": 'true' }, rest),
|
|
122
|
-
React.createElement("div", { className: 'iui-dialog-title-bar' },
|
|
123
|
-
React.createElement("div", { className: 'iui-dialog-title' }, title),
|
|
124
|
-
isDismissible && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
|
|
125
|
-
React.createElement(SvgClose, null)))),
|
|
126
|
-
children))))), container)) : (React.createElement(React.Fragment, null));
|
|
57
|
+
return !!container ? (ReactDOM.createPortal(React.createElement(Dialog, { isOpen: isOpen, closeOnEsc: closeOnEsc, closeOnExternalClick: closeOnExternalClick, isDismissible: isDismissible, onClose: onClose, preventDocumentScroll: true, trapFocus: true },
|
|
58
|
+
React.createElement(Dialog.Backdrop, null),
|
|
59
|
+
React.createElement(Dialog.Main, __assign({ "aria-modal": true }, rest),
|
|
60
|
+
React.createElement(Dialog.TitleBar, { titleText: title }),
|
|
61
|
+
children)), container)) : (React.createElement(React.Fragment, null));
|
|
127
62
|
};
|
|
128
63
|
export default Modal;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonProps } from '../utils';
|
|
3
|
-
import '@itwin/itwinui-css/css/dialog.css';
|
|
4
3
|
export declare type ModalButtonBarProps = {
|
|
5
4
|
/**
|
|
6
5
|
* Buttons in the modal bar.
|
|
@@ -10,5 +9,5 @@ export declare type ModalButtonBarProps = {
|
|
|
10
9
|
/**
|
|
11
10
|
* Container for Buttons in modal.
|
|
12
11
|
*/
|
|
13
|
-
export declare const ModalButtonBar: (
|
|
12
|
+
export declare const ModalButtonBar: React.ForwardRefExoticComponent<Pick<import("../Dialog/DialogButtonBar").DialogButtonBarProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
14
13
|
export default ModalButtonBar;
|
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
|
|
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';
|
|
1
|
+
import { DialogButtonBar } from '../Dialog/DialogButtonBar';
|
|
31
2
|
/**
|
|
32
3
|
* Container for Buttons in modal.
|
|
33
4
|
*/
|
|
34
|
-
export var ModalButtonBar =
|
|
35
|
-
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
36
|
-
useTheme();
|
|
37
|
-
return (React.createElement("div", __assign({ className: cx('iui-dialog-button-bar', className) }, rest), children));
|
|
38
|
-
};
|
|
5
|
+
export var ModalButtonBar = DialogButtonBar;
|
|
39
6
|
export default ModalButtonBar;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonProps } from '../utils';
|
|
3
|
-
import '@itwin/itwinui-css/css/dialog.css';
|
|
4
3
|
export declare type ModalContentProps = {
|
|
5
4
|
/**
|
|
6
5
|
* Main content in the `Modal`.
|
|
@@ -10,5 +9,5 @@ export declare type ModalContentProps = {
|
|
|
10
9
|
/**
|
|
11
10
|
* Container for content in `Modal`.
|
|
12
11
|
*/
|
|
13
|
-
export declare const ModalContent: (
|
|
12
|
+
export declare const ModalContent: React.ForwardRefExoticComponent<Pick<import("../Dialog/DialogContent").DialogContentProps, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
14
13
|
export default ModalContent;
|
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
|
|
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';
|
|
1
|
+
import { DialogContent } from '../Dialog/DialogContent';
|
|
31
2
|
/**
|
|
32
3
|
* Container for content in `Modal`.
|
|
33
4
|
*/
|
|
34
|
-
export var ModalContent =
|
|
35
|
-
var children = props.children, className = props.className, rest = __rest(props, ["children", "className"]);
|
|
36
|
-
useTheme();
|
|
37
|
-
return (React.createElement("div", __assign({ className: cx('iui-dialog-content', className) }, rest), children));
|
|
38
|
-
};
|
|
5
|
+
export var ModalContent = DialogContent;
|
|
39
6
|
export default ModalContent;
|