@jetbrains/ring-ui-built 6.0.36 → 6.0.38
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/_helpers/dialog__body-scroll-preventer.js +1 -1
- package/components/_helpers/input.js +3 -2
- package/components/auth/request-builder.d.ts +0 -1
- package/components/auth/token-validator.d.ts +1 -1
- package/components/auth-dialog-service/auth-dialog-service.d.ts +0 -1
- package/components/avatar/fallback-avatar.d.ts +0 -1
- package/components/checkbox/checkbox.js +1 -0
- package/components/code/code.d.ts +0 -1
- package/components/collapse/collapse-context.d.ts +0 -1
- package/components/confirm/confirm.d.ts +1 -0
- package/components/confirm/confirm.js +3 -1
- package/components/data-list/data-list.d.ts +4 -4
- package/components/data-list/data-list.js +1 -0
- package/components/data-list/item.js +1 -0
- package/components/data-list/title.js +1 -0
- package/components/date-picker/date-input.js +1 -0
- package/components/date-picker/date-picker.js +1 -0
- package/components/date-picker/date-popup.js +1 -0
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/month-names.d.ts +0 -1
- package/components/date-picker/month.d.ts +0 -1
- package/components/date-picker/months.d.ts +0 -1
- package/components/date-picker/weekdays.d.ts +0 -1
- package/components/dialog/dialog.d.ts +5 -1
- package/components/dialog/dialog.js +103 -55
- package/components/dropdown/anchor.d.ts +0 -1
- package/components/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +1 -0
- package/components/global/composeRefs.d.ts +2 -2
- package/components/global/composeRefs.js +7 -3
- package/components/global/controls-height.d.ts +0 -1
- package/components/global/dom.d.ts +2 -2
- package/components/global/focus-sensor-hoc.js +1 -0
- package/components/global/rerender-hoc.js +1 -0
- package/components/global/typescript-utils.d.ts +1 -1
- package/components/input/input.d.ts +1 -0
- package/components/input/input.js +1 -0
- package/components/island/adaptive-island-hoc.d.ts +4 -4
- package/components/island/content.js +3 -5
- package/components/island/island.d.ts +4 -4
- package/components/link/link.d.ts +8 -8
- package/components/list/list.d.ts +1 -1
- package/components/list/list__item.js +1 -0
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/popup/popup.d.ts +2 -2
- package/components/query-assist/query-assist__suggestions.d.ts +0 -1
- package/components/select/select__filter.js +1 -1
- package/components/select/select__popup.d.ts +1 -34
- package/components/shortcuts/shortcuts-hoc.d.ts +4 -4
- package/components/style.css +1 -1
- package/components/table/disable-hover-hoc.d.ts +4 -4
- package/components/table/header.js +1 -0
- package/components/table/row-with-focus-sensor.js +1 -0
- package/components/table/row.js +1 -0
- package/components/table/smart-table.d.ts +1 -1
- package/components/table/smart-table.js +1 -0
- package/components/table/table.d.ts +4 -4
- package/components/table/table.js +1 -0
- package/components/tabs/collapsible-more.d.ts +1 -1
- package/components/tabs/custom-item.d.ts +1 -1
- package/package.json +1 -1
@@ -4,7 +4,7 @@ import 'core-js/modules/es.set.js';
|
|
4
4
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
5
5
|
import scrollbarWidth from 'scrollbar-width';
|
6
6
|
|
7
|
-
var modules_5e9b8c03 = {"header":"header_rui_c019","light":"light_rui_2ac4","container":"container_rui_027b","innerContainer":"innerContainer_rui_027b","content":"content_rui_027b","panel":"panel_rui_027b","clickableOverlay":"clickableOverlay_rui_027b","closeIcon":"closeIcon_rui_027b","closeButton":"closeButton_rui_027b","closeButtonOutside":"closeButtonOutside_rui_027b","closeButtonInside":"closeButtonInside_rui_027b","documentWithoutScroll":"documentWithoutScroll_rui_027b","popupTarget":"popupTarget_rui_027b","dense":"dense_rui_027b"};
|
7
|
+
var modules_5e9b8c03 = {"header":"header_rui_c019","scrollableWrapper":"scrollableWrapper_rui_c019","light":"light_rui_2ac4","container":"container_rui_027b","nativeDialog":"nativeDialog_rui_027b","innerContainer":"innerContainer_rui_027b","content":"content_rui_027b","panel":"panel_rui_027b","clickableOverlay":"clickableOverlay_rui_027b","closeIcon":"closeIcon_rui_027b","closeButton":"closeButton_rui_027b","closeButtonOutside":"closeButtonOutside_rui_027b","closeButtonInside":"closeButtonInside_rui_027b","documentWithoutScroll":"documentWithoutScroll_rui_027b","popupTarget":"popupTarget_rui_027b","dense":"dense_rui_027b"};
|
8
8
|
|
9
9
|
var isPrevented = new Set();
|
10
10
|
var previousDocumentWidth = null;
|
@@ -10,7 +10,7 @@ import { Button } from '../button/button.js';
|
|
10
10
|
import getUID from '../global/get-uid.js';
|
11
11
|
import Icon from '../icon/icon.js';
|
12
12
|
import { I18nContext } from '../i18n/i18n-context.js';
|
13
|
-
import
|
13
|
+
import { createComposedRef } from '../global/composeRefs.js';
|
14
14
|
import { ControlsHeightContext } from '../global/controls-height.js';
|
15
15
|
import { ControlLabel } from '../control-label/control-label.js';
|
16
16
|
import ControlHelp from '../control-help/control-help.js';
|
@@ -48,6 +48,7 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
48
48
|
_defineProperty(_this, "inputRef", function (el) {
|
49
49
|
_this.input = el;
|
50
50
|
});
|
51
|
+
_defineProperty(_this, "composedInputRef", createComposedRef());
|
51
52
|
_defineProperty(_this, "clear", function (e) {
|
52
53
|
_this.props.onClear && _this.props.onClear(e);
|
53
54
|
});
|
@@ -160,7 +161,7 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
160
161
|
var inputClasses = classNames(modules_88cfaf40.input, inputClassName);
|
161
162
|
var text = value != null ? value : children;
|
162
163
|
var commonProps = {
|
163
|
-
ref:
|
164
|
+
ref: this.composedInputRef(this.inputRef, inputRef),
|
164
165
|
className: inputClasses,
|
165
166
|
value: text,
|
166
167
|
disabled,
|
@@ -68,7 +68,7 @@ export default class TokenValidator {
|
|
68
68
|
* @param {string} error
|
69
69
|
* @return {boolean}
|
70
70
|
*/
|
71
|
-
static shouldRefreshToken(error: string | undefined):
|
71
|
+
static shouldRefreshToken(error: string | undefined): error is "invalid_grant" | "invalid_request" | "invalid_token";
|
72
72
|
/**
|
73
73
|
* Check scopes
|
74
74
|
* @param {StoredToken} storedToken
|
@@ -23,6 +23,7 @@ import 'core-js/modules/es.object.to-string.js';
|
|
23
23
|
import 'core-js/modules/es.weak-map.js';
|
24
24
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
25
25
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
26
|
+
import 'memoize-one';
|
26
27
|
|
27
28
|
var modules_3199090e = {"checkboxSize":"14px","light":"light_rui_2ac4","checkbox":"checkbox_rui_219d","cell":"cell_rui_219d","icon":"icon_rui_219d","check":"check_rui_219d icon_rui_219d","minus":"minus_rui_219d icon_rui_219d","input":"input_rui_219d","cellWrapper":"cellWrapper_rui_219d","focus":"focus_rui_219d","label":"label_rui_219d"};
|
28
29
|
|
@@ -95,7 +95,8 @@ var Confirm = /*#__PURE__*/function (_PureComponent) {
|
|
95
95
|
confirmLabel = _this$props.confirmLabel,
|
96
96
|
rejectLabel = _this$props.rejectLabel,
|
97
97
|
onConfirm = _this$props.onConfirm,
|
98
|
-
onReject = _this$props.onReject
|
98
|
+
onReject = _this$props.onReject,
|
99
|
+
native = _this$props.native;
|
99
100
|
return /*#__PURE__*/jsxs(Dialog, {
|
100
101
|
label: text || (typeof description === 'string' ? description : undefined),
|
101
102
|
className: className,
|
@@ -103,6 +104,7 @@ var Confirm = /*#__PURE__*/function (_PureComponent) {
|
|
103
104
|
show: show,
|
104
105
|
trapFocus: true,
|
105
106
|
"data-test": "ring-confirm",
|
107
|
+
native: native,
|
106
108
|
children: [text && /*#__PURE__*/jsx(HeaderWrapper, {
|
107
109
|
children: text
|
108
110
|
}), description && /*#__PURE__*/jsx(ContentWrapper, {
|
@@ -32,7 +32,7 @@ export default class DataListContainer<T extends SelectionItem> extends Componen
|
|
32
32
|
onKeyDown: (e: KeyboardEvent) => void;
|
33
33
|
render(): import("react").JSX.Element;
|
34
34
|
context: unknown;
|
35
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>) =>
|
35
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>) => Pick<{}, K> | {} | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
36
36
|
forceUpdate(callback?: (() => void) | undefined): void;
|
37
37
|
readonly props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>;
|
38
38
|
refs: {
|
@@ -40,7 +40,7 @@ export default class DataListContainer<T extends SelectionItem> extends Componen
|
|
40
40
|
};
|
41
41
|
shouldComponentUpdate?(nextProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
42
42
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
43
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>): any;
|
43
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>): any | null;
|
44
44
|
componentDidUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>, snapshot?: any): void;
|
45
45
|
componentWillMount?(): void;
|
46
46
|
UNSAFE_componentWillMount?(): void;
|
@@ -59,7 +59,7 @@ export default class DataListContainer<T extends SelectionItem> extends Componen
|
|
59
59
|
onKeyDown: (e: KeyboardEvent) => void;
|
60
60
|
render(): import("react").JSX.Element;
|
61
61
|
context: unknown;
|
62
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>) =>
|
62
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>) => Pick<{}, K> | {} | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
63
63
|
forceUpdate(callback?: (() => void) | undefined): void;
|
64
64
|
readonly props: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>;
|
65
65
|
refs: {
|
@@ -67,7 +67,7 @@ export default class DataListContainer<T extends SelectionItem> extends Componen
|
|
67
67
|
};
|
68
68
|
shouldComponentUpdate?(nextProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
69
69
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
70
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>): any;
|
70
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>): any | null;
|
71
71
|
componentDidUpdate?(prevProps: Readonly<import("../table/disable-hover-hoc").DisableHoverProps<import("../table/selection-shortcuts-hoc").SelectionShortcutsProps<T, FocusableProps<T>>>>, prevState: Readonly<{}>, snapshot?: any): void;
|
72
72
|
componentWillMount?(): void;
|
73
73
|
UNSAFE_componentWillMount?(): void;
|
@@ -18,6 +18,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
18
|
import '../global/composeRefs.js';
|
19
19
|
import 'core-js/modules/es.object.to-string.js';
|
20
20
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
21
|
+
import 'memoize-one';
|
21
22
|
import '../table/selection.js';
|
22
23
|
import 'core-js/modules/es.array.filter.js';
|
23
24
|
import 'core-js/modules/es.array.index-of.js';
|
@@ -41,6 +41,7 @@ import '../global/focus-sensor-hoc.js';
|
|
41
41
|
import '../global/prop-types.js';
|
42
42
|
import '../global/composeRefs.js';
|
43
43
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
44
|
+
import 'memoize-one';
|
44
45
|
import '../checkbox/checkbox.js';
|
45
46
|
import '@jetbrains/icons/checkmark-12px';
|
46
47
|
import '@jetbrains/icons/remove-12px';
|
@@ -12,6 +12,7 @@ import 'react/jsx-runtime';
|
|
12
12
|
import '../global/composeRefs.js';
|
13
13
|
import 'core-js/modules/es.object.to-string.js';
|
14
14
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
15
|
+
import 'memoize-one';
|
15
16
|
import '@jetbrains/icons/checkmark-12px';
|
16
17
|
import '@jetbrains/icons/remove-12px';
|
17
18
|
import '../icon/icon.js';
|
@@ -34,6 +34,7 @@ import '../global/get-uid.js';
|
|
34
34
|
import 'core-js/modules/es.regexp.to-string.js';
|
35
35
|
import '../global/composeRefs.js';
|
36
36
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
37
|
+
import 'memoize-one';
|
37
38
|
import '../control-label/control-label.js';
|
38
39
|
import '../control-help/control-help.js';
|
39
40
|
import '../i18n/i18n.js';
|
@@ -77,6 +77,7 @@ import '../_helpers/link.js';
|
|
77
77
|
import '@jetbrains/icons/close-12px';
|
78
78
|
import '../global/prop-types.js';
|
79
79
|
import '../global/composeRefs.js';
|
80
|
+
import 'memoize-one';
|
80
81
|
import '../control-label/control-label.js';
|
81
82
|
import '../control-help/control-help.js';
|
82
83
|
import '../i18n/i18n.js';
|
@@ -48,6 +48,7 @@ import '../i18n/i18n.js';
|
|
48
48
|
import 'core-js/modules/es.set.js';
|
49
49
|
import '../global/composeRefs.js';
|
50
50
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
51
|
+
import 'memoize-one';
|
51
52
|
import '../control-label/control-label.js';
|
52
53
|
import '../control-help/control-help.js';
|
53
54
|
import 'date-fns/addMonths';
|
@@ -23,7 +23,7 @@ export default class Day extends Component<DayProps> {
|
|
23
23
|
handleMouseOver: () => void;
|
24
24
|
handleMouseOut: () => void;
|
25
25
|
isDay: (date: Date) => boolean;
|
26
|
-
is: (name:
|
26
|
+
is: (name: "date" | "from" | "to" | "activeDate") => boolean;
|
27
27
|
inRange: (range: [Date, Date] | null) => boolean | null;
|
28
28
|
isDisabled: (date: Date) => boolean;
|
29
29
|
parse(text: string | null | undefined): Date | null;
|
@@ -19,6 +19,8 @@ export interface DialogProps extends Partial<TabTrapProps> {
|
|
19
19
|
portalTarget?: Element | null | undefined;
|
20
20
|
'data-test'?: string | null | undefined;
|
21
21
|
dense?: boolean | null | undefined;
|
22
|
+
native?: boolean;
|
23
|
+
modal?: boolean;
|
22
24
|
}
|
23
25
|
export default class Dialog extends PureComponent<DialogProps> {
|
24
26
|
static propTypes: {
|
@@ -52,6 +54,7 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
52
54
|
reset: () => void;
|
53
55
|
};
|
54
56
|
uid: string;
|
57
|
+
toggleNativeDialog(): void;
|
55
58
|
toggleScrollPreventer(): void;
|
56
59
|
handleClick: (event: React.MouseEvent<HTMLElement>) => void;
|
57
60
|
onCloseClick: (event: React.MouseEvent<HTMLElement>) => void;
|
@@ -60,6 +63,7 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
60
63
|
};
|
61
64
|
dialog?: HTMLElement | null;
|
62
65
|
dialogRef: (tabTrap: TabTrap | null) => void;
|
63
|
-
|
66
|
+
nativeDialog: React.RefObject<HTMLDialogElement>;
|
67
|
+
render(): false | React.JSX.Element;
|
64
68
|
}
|
65
69
|
export type DialogAttrs = JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
|
-
import { PureComponent } from 'react';
|
3
|
+
import { PureComponent, createRef } from 'react';
|
4
4
|
import { createPortal } from 'react-dom';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
@@ -13,7 +13,7 @@ import TabTrap from '../tab-trap/tab-trap.js';
|
|
13
13
|
import { Button } from '../button/button.js';
|
14
14
|
import { PopupTarget } from '../popup/popup.target.js';
|
15
15
|
import { m as modules_5e9b8c03, p as preventerFactory } from '../_helpers/dialog__body-scroll-preventer.js';
|
16
|
-
import {
|
16
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
17
17
|
import '../island/adaptive-island-hoc.js';
|
18
18
|
import '../global/linear-function.js';
|
19
19
|
import '../_helpers/island.js';
|
@@ -60,7 +60,7 @@ import '../global/controls-height.js';
|
|
60
60
|
import '../_helpers/button__classes.js';
|
61
61
|
import 'scrollbar-width';
|
62
62
|
|
63
|
-
var _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions"];
|
63
|
+
var _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions", "native", "modal"];
|
64
64
|
function noop() {}
|
65
65
|
var Dialog = /*#__PURE__*/function (_PureComponent) {
|
66
66
|
function Dialog() {
|
@@ -98,17 +98,30 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
98
98
|
_defineProperty(_this, "dialogRef", function (tabTrap) {
|
99
99
|
_this.dialog = tabTrap && tabTrap.node;
|
100
100
|
});
|
101
|
+
_defineProperty(_this, "nativeDialog", /*#__PURE__*/createRef());
|
101
102
|
return _this;
|
102
103
|
}
|
103
104
|
_inherits(Dialog, _PureComponent);
|
104
105
|
return _createClass(Dialog, [{
|
105
106
|
key: "componentDidMount",
|
106
107
|
value: function componentDidMount() {
|
108
|
+
var _this$props = this.props,
|
109
|
+
show = _this$props.show,
|
110
|
+
native = _this$props.native;
|
111
|
+
if (native && show) {
|
112
|
+
this.toggleNativeDialog();
|
113
|
+
}
|
107
114
|
this.toggleScrollPreventer();
|
108
115
|
}
|
109
116
|
}, {
|
110
117
|
key: "componentDidUpdate",
|
111
118
|
value: function componentDidUpdate(prevProps) {
|
119
|
+
var _this$props2 = this.props,
|
120
|
+
show = _this$props2.show,
|
121
|
+
native = _this$props2.native;
|
122
|
+
if (native && show !== prevProps.show) {
|
123
|
+
this.toggleNativeDialog();
|
124
|
+
}
|
112
125
|
if (prevProps.show !== this.props.show) {
|
113
126
|
this.toggleScrollPreventer();
|
114
127
|
}
|
@@ -118,6 +131,20 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
118
131
|
value: function componentWillUnmount() {
|
119
132
|
this.scrollPreventer.reset();
|
120
133
|
}
|
134
|
+
}, {
|
135
|
+
key: "toggleNativeDialog",
|
136
|
+
value: function toggleNativeDialog() {
|
137
|
+
var _this$props3 = this.props,
|
138
|
+
show = _this$props3.show,
|
139
|
+
modal = _this$props3.modal;
|
140
|
+
if (this.nativeDialog.current != null) {
|
141
|
+
if (show) {
|
142
|
+
modal ? this.nativeDialog.current.showModal() : this.nativeDialog.current.show();
|
143
|
+
} else {
|
144
|
+
this.nativeDialog.current.close();
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
121
148
|
}, {
|
122
149
|
key: "toggleScrollPreventer",
|
123
150
|
value: function toggleScrollPreventer() {
|
@@ -131,27 +158,78 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
131
158
|
key: "render",
|
132
159
|
value: function render() {
|
133
160
|
var _this2 = this;
|
134
|
-
var _this$
|
135
|
-
show = _this$
|
136
|
-
showCloseButton = _this$
|
137
|
-
onOverlayClick = _this$
|
138
|
-
onCloseAttempt = _this$
|
139
|
-
_this$
|
140
|
-
_this$
|
141
|
-
var
|
142
|
-
className = _this$
|
143
|
-
contentClassName = _this$
|
144
|
-
trapFocus = _this$
|
145
|
-
dataTest = _this$
|
146
|
-
closeButtonInside = _this$
|
147
|
-
portalTarget = _this$
|
148
|
-
label = _this$
|
149
|
-
closeButtonTitle = _this$
|
150
|
-
dense = _this$
|
151
|
-
_this$
|
152
|
-
var
|
161
|
+
var _this$props4 = this.props,
|
162
|
+
show = _this$props4.show,
|
163
|
+
showCloseButton = _this$props4.showCloseButton,
|
164
|
+
onOverlayClick = _this$props4.onOverlayClick,
|
165
|
+
onCloseAttempt = _this$props4.onCloseAttempt;
|
166
|
+
_this$props4.onEscPress;
|
167
|
+
_this$props4.onCloseClick;
|
168
|
+
var children = _this$props4.children,
|
169
|
+
className = _this$props4.className,
|
170
|
+
contentClassName = _this$props4.contentClassName,
|
171
|
+
trapFocus = _this$props4.trapFocus,
|
172
|
+
dataTest = _this$props4['data-test'],
|
173
|
+
closeButtonInside = _this$props4.closeButtonInside,
|
174
|
+
portalTarget = _this$props4.portalTarget,
|
175
|
+
label = _this$props4.label,
|
176
|
+
closeButtonTitle = _this$props4.closeButtonTitle,
|
177
|
+
dense = _this$props4.dense;
|
178
|
+
_this$props4.shortcutOptions;
|
179
|
+
var native = _this$props4.native;
|
180
|
+
_this$props4.modal;
|
181
|
+
var restProps = _objectWithoutProperties(_this$props4, _excluded);
|
153
182
|
var classes = classNames(modules_5e9b8c03.container, className);
|
154
183
|
var shortcutsMap = this.getShortcutsMap();
|
184
|
+
var content = /*#__PURE__*/jsxs(Fragment, {
|
185
|
+
children: [/*#__PURE__*/jsx(Shortcuts, {
|
186
|
+
map: shortcutsMap,
|
187
|
+
scope: this.state.shortcutsScope,
|
188
|
+
options: this.props.shortcutOptions
|
189
|
+
}), (onOverlayClick !== noop || onCloseAttempt !== noop) && /*#__PURE__*/jsx("div", {
|
190
|
+
// click handler is duplicated in close button
|
191
|
+
role: "presentation",
|
192
|
+
className: modules_5e9b8c03.clickableOverlay,
|
193
|
+
onClick: this.handleClick
|
194
|
+
}), /*#__PURE__*/jsx("div", {
|
195
|
+
className: modules_5e9b8c03.innerContainer,
|
196
|
+
children: /*#__PURE__*/jsxs(AdaptiveIsland, {
|
197
|
+
className: classNames(modules_5e9b8c03.content, contentClassName, {
|
198
|
+
[modules_5e9b8c03.dense]: dense
|
199
|
+
}),
|
200
|
+
"data-test": "ring-dialog",
|
201
|
+
role: "dialog",
|
202
|
+
"aria-label": label,
|
203
|
+
children: [children, showCloseButton && /*#__PURE__*/jsx(Button, {
|
204
|
+
icon: closeIcon,
|
205
|
+
"data-test": "ring-dialog-close-button",
|
206
|
+
className: classNames(modules_5e9b8c03.closeButton, {
|
207
|
+
[modules_5e9b8c03.closeButtonOutside]: !closeButtonInside,
|
208
|
+
[modules_5e9b8c03.closeButtonInside]: closeButtonInside
|
209
|
+
}),
|
210
|
+
iconClassName: modules_5e9b8c03.closeIcon,
|
211
|
+
onClick: this.onCloseClick,
|
212
|
+
title: closeButtonTitle,
|
213
|
+
"aria-label": closeButtonTitle || 'close dialog'
|
214
|
+
})]
|
215
|
+
})
|
216
|
+
})]
|
217
|
+
});
|
218
|
+
if (native) {
|
219
|
+
return /*#__PURE__*/jsx("dialog", {
|
220
|
+
className: classNames(modules_5e9b8c03.nativeDialog, className),
|
221
|
+
ref: this.nativeDialog,
|
222
|
+
children: /*#__PURE__*/jsx(PopupTarget, {
|
223
|
+
id: this.uid,
|
224
|
+
className: modules_5e9b8c03.popupTarget,
|
225
|
+
children: function children(target) {
|
226
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
227
|
+
children: [content, target]
|
228
|
+
});
|
229
|
+
}
|
230
|
+
})
|
231
|
+
});
|
232
|
+
}
|
155
233
|
return show && /*#__PURE__*/createPortal( /*#__PURE__*/jsx(PopupTarget, {
|
156
234
|
id: this.uid,
|
157
235
|
className: modules_5e9b8c03.popupTarget,
|
@@ -163,38 +241,7 @@ var Dialog = /*#__PURE__*/function (_PureComponent) {
|
|
163
241
|
className: classes,
|
164
242
|
role: "presentation"
|
165
243
|
}, restProps), {}, {
|
166
|
-
children: [
|
167
|
-
map: shortcutsMap,
|
168
|
-
scope: _this2.state.shortcutsScope,
|
169
|
-
options: _this2.props.shortcutOptions
|
170
|
-
}), (onOverlayClick !== noop || onCloseAttempt !== noop) && /*#__PURE__*/jsx("div", {
|
171
|
-
// click handler is duplicated in close button
|
172
|
-
role: "presentation",
|
173
|
-
className: modules_5e9b8c03.clickableOverlay,
|
174
|
-
onClick: _this2.handleClick
|
175
|
-
}), /*#__PURE__*/jsx("div", {
|
176
|
-
className: modules_5e9b8c03.innerContainer,
|
177
|
-
children: /*#__PURE__*/jsxs(AdaptiveIsland, {
|
178
|
-
className: classNames(modules_5e9b8c03.content, contentClassName, {
|
179
|
-
[modules_5e9b8c03.dense]: dense
|
180
|
-
}),
|
181
|
-
"data-test": "ring-dialog",
|
182
|
-
role: "dialog",
|
183
|
-
"aria-label": label,
|
184
|
-
children: [_children, showCloseButton && /*#__PURE__*/jsx(Button, {
|
185
|
-
icon: closeIcon,
|
186
|
-
"data-test": "ring-dialog-close-button",
|
187
|
-
className: classNames(modules_5e9b8c03.closeButton, {
|
188
|
-
[modules_5e9b8c03.closeButtonOutside]: !closeButtonInside,
|
189
|
-
[modules_5e9b8c03.closeButtonInside]: closeButtonInside
|
190
|
-
}),
|
191
|
-
iconClassName: modules_5e9b8c03.closeIcon,
|
192
|
-
onClick: _this2.onCloseClick,
|
193
|
-
title: closeButtonTitle,
|
194
|
-
"aria-label": closeButtonTitle || 'close dialog'
|
195
|
-
})]
|
196
|
-
})
|
197
|
-
}), target]
|
244
|
+
children: [content, target]
|
198
245
|
}));
|
199
246
|
}
|
200
247
|
}), portalTarget instanceof HTMLElement ? portalTarget : document.body);
|
@@ -235,7 +282,8 @@ _defineProperty(Dialog, "defaultProps", {
|
|
235
282
|
modal: false
|
236
283
|
},
|
237
284
|
trapFocus: false,
|
238
|
-
autoFocusFirst: true
|
285
|
+
autoFocusFirst: true,
|
286
|
+
modal: true
|
239
287
|
});
|
240
288
|
|
241
289
|
export { Dialog as default };
|
@@ -16,8 +16,8 @@ export interface DropdownMenuProps<T = unknown> extends Omit<DropdownAttrs, 'anc
|
|
16
16
|
menuProps?: PopupMenuAttrs<T> | null | undefined;
|
17
17
|
}
|
18
18
|
declare const _default: (<T = unknown>(props: DropdownMenuProps<T> & {
|
19
|
-
ref?: Ref<PopupMenu
|
20
|
-
}) => ReactElement
|
19
|
+
ref?: Ref<PopupMenu>;
|
20
|
+
}) => ReactElement | null) & {
|
21
21
|
ListProps: {
|
22
22
|
Type: typeof import("../list/consts").Type;
|
23
23
|
Dimension: {
|
@@ -37,6 +37,7 @@ import '../i18n/i18n.js';
|
|
37
37
|
import 'core-js/modules/es.set.js';
|
38
38
|
import '../global/composeRefs.js';
|
39
39
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
40
|
+
import 'memoize-one';
|
40
41
|
import '../control-label/control-label.js';
|
41
42
|
import '../control-help/control-help.js';
|
42
43
|
import 'core-js/modules/es.regexp.to-string.js';
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { Ref } from 'react';
|
2
|
-
|
3
|
-
export
|
2
|
+
export default function composeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void;
|
3
|
+
export declare function createComposedRef<T>(): import("memoize-one").MemoizedFn<(...refs: (Ref<T> | undefined)[]) => (value: T | null) => void>;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import 'core-js/modules/es.object.to-string.js';
|
2
2
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
3
|
+
import memoizeOne from 'memoize-one';
|
3
4
|
|
4
|
-
|
5
|
+
function composeRefs() {
|
5
6
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
6
7
|
refs[_key] = arguments[_key];
|
7
8
|
}
|
@@ -14,6 +15,9 @@ var composeRefs = (function () {
|
|
14
15
|
}
|
15
16
|
});
|
16
17
|
};
|
17
|
-
}
|
18
|
+
}
|
19
|
+
function createComposedRef() {
|
20
|
+
return memoizeOne(composeRefs);
|
21
|
+
}
|
18
22
|
|
19
|
-
export { composeRefs as default };
|
23
|
+
export { createComposedRef, composeRefs as default };
|
@@ -3,7 +3,7 @@
|
|
3
3
|
*/
|
4
4
|
import { SyntheticEvent } from 'react';
|
5
5
|
import type { PropertiesHyphen } from 'csstype';
|
6
|
-
export declare const getStyles: ((elt: Element, pseudoElt?: string | null
|
6
|
+
export declare const getStyles: ((elt: Element, pseudoElt?: string | null) => CSSStyleDeclaration) & typeof getComputedStyle;
|
7
7
|
export declare function isMounted(node: Node | Range | null | undefined): boolean;
|
8
8
|
export interface Rect {
|
9
9
|
top: number;
|
@@ -20,7 +20,7 @@ export declare function getWindowWidth(): number;
|
|
20
20
|
export declare function isNodeInVisiblePartOfPage(node: Element | Range): boolean;
|
21
21
|
export declare function getDocumentScrollTop(): number;
|
22
22
|
export declare function getDocumentScrollLeft(): number;
|
23
|
-
export declare const applyMethodToClasses: (method:
|
23
|
+
export declare const applyMethodToClasses: (method: "add" | "remove") => (classList: DOMTokenList, classes?: string) => void;
|
24
24
|
export declare const addClasses: (classList: DOMTokenList, classes?: string) => void;
|
25
25
|
export declare const removeClasses: (classList: DOMTokenList, classes?: string) => void;
|
26
26
|
export declare const toggleClasses: (classList: DOMTokenList, classes: Record<string, boolean>) => void;
|
@@ -7,6 +7,7 @@ import composeRefs from './composeRefs.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
8
8
|
import 'core-js/modules/es.object.to-string.js';
|
9
9
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
10
|
+
import 'memoize-one';
|
10
11
|
|
11
12
|
var _excluded = ["innerRef", "focused", "onFocusReset", "onFocusRestore"],
|
12
13
|
_excluded2 = ["autofocus", "focused", "onFocus", "onBlur", "innerRef", "scrollOnTableFocus"];
|
@@ -5,6 +5,7 @@ import composeRefs from './composeRefs.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
6
6
|
import 'core-js/modules/es.object.to-string.js';
|
7
7
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
8
|
+
import 'memoize-one';
|
8
9
|
|
9
10
|
function rerenderHOC(ComposedComponent) {
|
10
11
|
var Rerenderer = /*#__PURE__*/function (_Component) {
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export declare const isArray: (arg: unknown) => arg is readonly unknown[];
|
2
|
-
export declare const isTruthy: <T>(arg: T | false |
|
2
|
+
export declare const isTruthy: <T>(arg: T | false | "" | 0 | null | undefined) => arg is T;
|
@@ -64,6 +64,7 @@ export declare class Input extends PureComponent<InputProps> {
|
|
64
64
|
stretch(el: HTMLElement | null | undefined): void;
|
65
65
|
adapt(): void;
|
66
66
|
inputRef: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
|
67
|
+
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: HTMLInputElement | HTMLTextAreaElement | null) => void>;
|
67
68
|
clear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
68
69
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
69
70
|
handleTextareaChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|