@jetbrains/ring-ui-built 6.0.64 → 6.0.65
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/components/auth/iframe-flow.js +4 -0
- package/components/auth-dialog/auth-dialog.js +4 -0
- package/components/auth-dialog-service/auth-dialog-service.js +4 -0
- package/components/confirm/confirm.js +6 -2
- package/components/confirm-service/confirm-service.js +4 -0
- package/components/dialog/dialog.d.ts +1 -22
- package/components/dialog/dialog.js +42 -43
- package/components/login-dialog/login-dialog.js +5 -1
- package/components/login-dialog/service.js +4 -0
- package/components/user-agreement/user-agreement.js +6 -2
- package/package.json +1 -1
@@ -64,6 +64,10 @@ import 'core-js/modules/es.weak-map.js';
|
|
64
64
|
import '../link/clickableLink.js';
|
65
65
|
import '../_helpers/button__classes.js';
|
66
66
|
import '../popup/popup.target.js';
|
67
|
+
import '../popup/popup.js';
|
68
|
+
import '../popup/position.js';
|
69
|
+
import 'core-js/modules/es.array.sort.js';
|
70
|
+
import '../popup/popup.consts.js';
|
67
71
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
68
72
|
import 'scrollbar-width';
|
69
73
|
import '../loader-screen/loader-screen.js';
|
@@ -47,6 +47,10 @@ import 'core-js/modules/es.string.split.js';
|
|
47
47
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
48
48
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
49
49
|
import '../popup/popup.target.js';
|
50
|
+
import '../popup/popup.js';
|
51
|
+
import '../popup/position.js';
|
52
|
+
import 'core-js/modules/es.array.sort.js';
|
53
|
+
import '../popup/popup.consts.js';
|
50
54
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
51
55
|
import 'scrollbar-width';
|
52
56
|
import '@jetbrains/icons/chevron-down';
|
@@ -60,6 +60,10 @@ import 'core-js/modules/es.weak-map.js';
|
|
60
60
|
import '../link/clickableLink.js';
|
61
61
|
import '../_helpers/button__classes.js';
|
62
62
|
import '../popup/popup.target.js';
|
63
|
+
import '../popup/popup.js';
|
64
|
+
import '../popup/position.js';
|
65
|
+
import 'core-js/modules/es.array.sort.js';
|
66
|
+
import '../popup/popup.consts.js';
|
63
67
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
64
68
|
import 'scrollbar-width';
|
65
69
|
import '../heading/heading.js';
|
@@ -43,19 +43,23 @@ import 'core-js/modules/es.string.split.js';
|
|
43
43
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
44
44
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
45
45
|
import '../popup/popup.target.js';
|
46
|
+
import '../popup/popup.js';
|
47
|
+
import 'core-js/modules/es.string.replace.js';
|
48
|
+
import '../global/schedule-raf.js';
|
49
|
+
import '../popup/position.js';
|
50
|
+
import 'core-js/modules/es.array.sort.js';
|
51
|
+
import '../popup/popup.consts.js';
|
46
52
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
53
|
import 'scrollbar-width';
|
48
54
|
import '../island/adaptive-island-hoc.js';
|
49
55
|
import '../global/linear-function.js';
|
50
56
|
import '../_helpers/island.js';
|
51
57
|
import 'element-resize-detector';
|
52
|
-
import '../global/schedule-raf.js';
|
53
58
|
import '@jetbrains/icons/chevron-down';
|
54
59
|
import '../icon/icon.js';
|
55
60
|
import 'util-deprecate';
|
56
61
|
import '../icon/icon__constants.js';
|
57
62
|
import '../_helpers/icon__svg.js';
|
58
|
-
import 'core-js/modules/es.string.replace.js';
|
59
63
|
import 'core-js/modules/es.string.starts-with.js';
|
60
64
|
import '../global/memoize.js';
|
61
65
|
import 'core-js/modules/es.map.js';
|
@@ -63,6 +63,10 @@ import 'core-js/modules/es.weak-map.js';
|
|
63
63
|
import '../link/clickableLink.js';
|
64
64
|
import '../_helpers/button__classes.js';
|
65
65
|
import '../popup/popup.target.js';
|
66
|
+
import '../popup/popup.js';
|
67
|
+
import '../popup/position.js';
|
68
|
+
import 'core-js/modules/es.array.sort.js';
|
69
|
+
import '../popup/popup.consts.js';
|
66
70
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
67
71
|
import 'scrollbar-width';
|
68
72
|
import '../panel/panel.js';
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { PureComponent } from 'react';
|
2
2
|
import * as React from 'react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
import TabTrap, { TabTrapProps } from '../tab-trap/tab-trap';
|
5
4
|
import type { ShortcutsScopeOptions } from '../shortcuts/core';
|
6
5
|
export interface DialogProps extends Partial<TabTrapProps> {
|
@@ -24,26 +23,6 @@ export interface DialogProps extends Partial<TabTrapProps> {
|
|
24
23
|
preventBodyScroll?: boolean;
|
25
24
|
}
|
26
25
|
export default class Dialog extends PureComponent<DialogProps> {
|
27
|
-
static propTypes: {
|
28
|
-
label: PropTypes.Requireable<string>;
|
29
|
-
className: PropTypes.Requireable<string>;
|
30
|
-
contentClassName: PropTypes.Requireable<string>;
|
31
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
32
|
-
show: PropTypes.Validator<boolean>;
|
33
|
-
showCloseButton: PropTypes.Requireable<boolean>;
|
34
|
-
closeButtonInside: PropTypes.Requireable<boolean>;
|
35
|
-
closeButtonTitle: PropTypes.Requireable<string>;
|
36
|
-
onOverlayClick: PropTypes.Requireable<(...args: any[]) => any>;
|
37
|
-
onEscPress: PropTypes.Requireable<(...args: any[]) => any>;
|
38
|
-
onCloseClick: PropTypes.Requireable<(...args: any[]) => any>;
|
39
|
-
shortcutOptions: PropTypes.Requireable<object>;
|
40
|
-
onCloseAttempt: PropTypes.Requireable<(...args: any[]) => any>;
|
41
|
-
trapFocus: PropTypes.Requireable<boolean>;
|
42
|
-
portalTarget: PropTypes.Requireable<HTMLElement>;
|
43
|
-
autoFocusFirst: PropTypes.Requireable<boolean>;
|
44
|
-
'data-test': PropTypes.Requireable<string>;
|
45
|
-
preventBodyScroll: PropTypes.Requireable<boolean>;
|
46
|
-
};
|
47
26
|
static defaultProps: Partial<DialogProps>;
|
48
27
|
state: {
|
49
28
|
shortcutsScope: string;
|
@@ -68,4 +47,4 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
68
47
|
nativeDialog: React.RefObject<HTMLDialogElement>;
|
69
48
|
render(): false | React.JSX.Element;
|
70
49
|
}
|
71
|
-
export type DialogAttrs = JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
50
|
+
export type DialogAttrs = React.JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
@@ -2,7 +2,6 @@ import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWi
|
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
3
|
import { PureComponent, createRef } from 'react';
|
4
4
|
import { createPortal } from 'react-dom';
|
5
|
-
import PropTypes from 'prop-types';
|
6
5
|
import classNames from 'classnames';
|
7
6
|
import closeIcon from '@jetbrains/icons/close';
|
8
7
|
import { AdaptiveIsland } from '../island/island.js';
|
@@ -11,9 +10,11 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
11
10
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
12
11
|
import TabTrap from '../tab-trap/tab-trap.js';
|
13
12
|
import { Button } from '../button/button.js';
|
14
|
-
import { PopupTarget } from '../popup/popup.target.js';
|
13
|
+
import { PopupTarget, PopupTargetContext } from '../popup/popup.target.js';
|
14
|
+
import { getPopupContainer } from '../popup/popup.js';
|
15
15
|
import { m as modules_5e9b8c03, p as preventerFactory } from '../_helpers/dialog__body-scroll-preventer.js';
|
16
16
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
17
|
+
import 'prop-types';
|
17
18
|
import '../island/adaptive-island-hoc.js';
|
18
19
|
import '../global/linear-function.js';
|
19
20
|
import '../_helpers/island.js';
|
@@ -58,6 +59,9 @@ import 'core-js/modules/es.weak-map.js';
|
|
58
59
|
import '../link/clickableLink.js';
|
59
60
|
import '../global/controls-height.js';
|
60
61
|
import '../_helpers/button__classes.js';
|
62
|
+
import '../popup/position.js';
|
63
|
+
import 'core-js/modules/es.array.sort.js';
|
64
|
+
import '../popup/popup.consts.js';
|
61
65
|
import 'scrollbar-width';
|
62
66
|
|
63
67
|
var _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions", "native", "modal", "preventBodyScroll"];
|
@@ -140,7 +144,11 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
140
144
|
if (this.nativeDialog.current != null) {
|
141
145
|
if (show) {
|
142
146
|
this.nativeDialog.current.removeAttribute('open');
|
143
|
-
|
147
|
+
if (modal) {
|
148
|
+
this.nativeDialog.current.showModal();
|
149
|
+
} else {
|
150
|
+
this.nativeDialog.current.show();
|
151
|
+
}
|
144
152
|
} else {
|
145
153
|
this.nativeDialog.current.close();
|
146
154
|
}
|
@@ -169,7 +177,7 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
169
177
|
onCloseAttempt = _this$props4.onCloseAttempt;
|
170
178
|
_this$props4.onEscPress;
|
171
179
|
_this$props4.onCloseClick;
|
172
|
-
var
|
180
|
+
var _children = _this$props4.children,
|
173
181
|
className = _this$props4.className,
|
174
182
|
contentClassName = _this$props4.contentClassName,
|
175
183
|
trapFocus = _this$props4.trapFocus,
|
@@ -195,7 +203,8 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
195
203
|
// click handler is duplicated in close button
|
196
204
|
role: "presentation",
|
197
205
|
className: modules_5e9b8c03.clickableOverlay,
|
198
|
-
onClick: this.handleClick
|
206
|
+
onClick: this.handleClick,
|
207
|
+
"data-test": "ring-dialog-overlay"
|
199
208
|
}), /*#__PURE__*/jsx("div", {
|
200
209
|
className: modules_5e9b8c03.innerContainer,
|
201
210
|
children: /*#__PURE__*/jsxs(AdaptiveIsland, {
|
@@ -205,7 +214,7 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
205
214
|
"data-test": "ring-dialog",
|
206
215
|
role: "dialog",
|
207
216
|
"aria-label": label,
|
208
|
-
children: [
|
217
|
+
children: [_children, showCloseButton && /*#__PURE__*/jsx(Button, {
|
209
218
|
icon: closeIcon,
|
210
219
|
"data-test": "ring-dialog-close-button",
|
211
220
|
className: classNames(modules_5e9b8c03.closeButton, {
|
@@ -235,47 +244,37 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
235
244
|
})
|
236
245
|
});
|
237
246
|
}
|
238
|
-
return show && /*#__PURE__*/
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
}
|
249
|
-
|
250
|
-
|
247
|
+
return show && /*#__PURE__*/jsx(PopupTargetContext.Consumer, {
|
248
|
+
children: function children(contextTarget) {
|
249
|
+
var targetElement = document.body;
|
250
|
+
if (portalTarget instanceof HTMLElement) {
|
251
|
+
targetElement = portalTarget;
|
252
|
+
} else if (contextTarget != null) {
|
253
|
+
var container = getPopupContainer(contextTarget);
|
254
|
+
if (container != null) {
|
255
|
+
targetElement = container;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
return /*#__PURE__*/createPortal( /*#__PURE__*/jsx(PopupTarget, {
|
259
|
+
id: _this2.uid,
|
260
|
+
className: modules_5e9b8c03.popupTarget,
|
261
|
+
children: function children(target) {
|
262
|
+
return /*#__PURE__*/jsxs(TabTrap, _objectSpread2(_objectSpread2({
|
263
|
+
trapDisabled: !trapFocus,
|
264
|
+
"data-test": joinDataTestAttributes('ring-dialog-container', dataTest),
|
265
|
+
ref: _this2.dialogRef,
|
266
|
+
className: classes,
|
267
|
+
role: "presentation"
|
268
|
+
}, restProps), {}, {
|
269
|
+
children: [content, target]
|
270
|
+
}));
|
271
|
+
}
|
272
|
+
}), targetElement);
|
251
273
|
}
|
252
|
-
})
|
274
|
+
});
|
253
275
|
}
|
254
276
|
}]);
|
255
277
|
}(PureComponent);
|
256
|
-
_defineProperty(Dialog, "propTypes", {
|
257
|
-
label: PropTypes.string,
|
258
|
-
className: PropTypes.string,
|
259
|
-
contentClassName: PropTypes.string,
|
260
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
261
|
-
show: PropTypes.bool.isRequired,
|
262
|
-
showCloseButton: PropTypes.bool,
|
263
|
-
closeButtonInside: PropTypes.bool,
|
264
|
-
closeButtonTitle: PropTypes.string,
|
265
|
-
onOverlayClick: PropTypes.func,
|
266
|
-
onEscPress: PropTypes.func,
|
267
|
-
onCloseClick: PropTypes.func,
|
268
|
-
shortcutOptions: PropTypes.object,
|
269
|
-
// onCloseAttempt is a common callback for ESC pressing and overlay clicking.
|
270
|
-
// Use it if you don't need different behaviors for this cases.
|
271
|
-
onCloseAttempt: PropTypes.func,
|
272
|
-
// focusTrap may break popups inside dialog, so use it carefully
|
273
|
-
trapFocus: PropTypes.bool,
|
274
|
-
portalTarget: PropTypes.instanceOf(HTMLElement),
|
275
|
-
autoFocusFirst: PropTypes.bool,
|
276
|
-
'data-test': PropTypes.string,
|
277
|
-
preventBodyScroll: PropTypes.bool
|
278
|
-
});
|
279
278
|
_defineProperty(Dialog, "defaultProps", {
|
280
279
|
label: 'Dialog',
|
281
280
|
onOverlayClick: noop,
|
@@ -54,6 +54,11 @@ import '../link/clickableLink.js';
|
|
54
54
|
import '../global/controls-height.js';
|
55
55
|
import '../_helpers/button__classes.js';
|
56
56
|
import '../popup/popup.target.js';
|
57
|
+
import '../popup/popup.js';
|
58
|
+
import '../global/schedule-raf.js';
|
59
|
+
import '../popup/position.js';
|
60
|
+
import 'core-js/modules/es.array.sort.js';
|
61
|
+
import '../popup/popup.consts.js';
|
57
62
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
58
63
|
import 'scrollbar-width';
|
59
64
|
import '../island/adaptive-island-hoc.js';
|
@@ -61,7 +66,6 @@ import '../global/linear-function.js';
|
|
61
66
|
import '../_helpers/island.js';
|
62
67
|
import '../island/header.js';
|
63
68
|
import 'element-resize-detector';
|
64
|
-
import '../global/schedule-raf.js';
|
65
69
|
import '../loader/loader.js';
|
66
70
|
import '../loader/loader__core.js';
|
67
71
|
import 'core-js/modules/es.array.fill.js';
|
@@ -60,6 +60,10 @@ import 'core-js/modules/es.weak-map.js';
|
|
60
60
|
import '../link/clickableLink.js';
|
61
61
|
import '../_helpers/button__classes.js';
|
62
62
|
import '../popup/popup.target.js';
|
63
|
+
import '../popup/popup.js';
|
64
|
+
import '../popup/position.js';
|
65
|
+
import 'core-js/modules/es.array.sort.js';
|
66
|
+
import '../popup/popup.consts.js';
|
63
67
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
64
68
|
import 'scrollbar-width';
|
65
69
|
import '../loader-screen/loader-screen.js';
|
@@ -42,19 +42,23 @@ import 'core-js/modules/es.string.split.js';
|
|
42
42
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
43
43
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
44
44
|
import '../popup/popup.target.js';
|
45
|
+
import '../popup/popup.js';
|
46
|
+
import 'core-js/modules/es.string.replace.js';
|
47
|
+
import '../global/schedule-raf.js';
|
48
|
+
import '../popup/position.js';
|
49
|
+
import 'core-js/modules/es.array.sort.js';
|
50
|
+
import '../popup/popup.consts.js';
|
45
51
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
46
52
|
import 'scrollbar-width';
|
47
53
|
import '../island/adaptive-island-hoc.js';
|
48
54
|
import '../global/linear-function.js';
|
49
55
|
import '../_helpers/island.js';
|
50
56
|
import 'element-resize-detector';
|
51
|
-
import '../global/schedule-raf.js';
|
52
57
|
import '@jetbrains/icons/chevron-down';
|
53
58
|
import '../icon/icon.js';
|
54
59
|
import 'util-deprecate';
|
55
60
|
import '../icon/icon__constants.js';
|
56
61
|
import '../_helpers/icon__svg.js';
|
57
|
-
import 'core-js/modules/es.string.replace.js';
|
58
62
|
import 'core-js/modules/es.string.starts-with.js';
|
59
63
|
import '../global/memoize.js';
|
60
64
|
import 'core-js/modules/es.map.js';
|