@jetbrains/ring-ui-built 7.0.58 → 7.0.60-beta.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/README.md +1 -0
- package/components/alert/alert.js +1 -0
- package/components/alert-service/alert-service.d.ts +2 -1
- package/components/alert-service/alert-service.js +4 -2
- package/components/auth/auth.js +1 -0
- package/components/auth/auth__core.js +1 -0
- package/components/auth/down-notification.js +1 -0
- package/components/auth/iframe-flow.js +1 -0
- package/components/auth/storage.js +1 -0
- package/components/auth-dialog/auth-dialog.js +1 -0
- package/components/auth-dialog-service/auth-dialog-service.js +1 -0
- package/components/avatar-stack/avatar-stack.js +1 -0
- package/components/clipboard/clipboard.js +1 -0
- package/components/confirm/confirm.js +1 -0
- package/components/confirm-service/confirm-service.js +1 -0
- package/components/data-list/item.js +2 -0
- package/components/date-picker/date-picker.js +3 -0
- package/components/dialog/dialog.js +1 -0
- package/components/dropdown-menu/dropdown-menu.js +1 -0
- package/components/error-bubble/error-bubble.js +2 -0
- package/components/global/theme.js +1 -0
- package/components/header/header.js +1 -0
- package/components/header/profile.js +1 -0
- package/components/header/services.js +2 -0
- package/components/header/smart-profile.js +1 -0
- package/components/header/smart-services.js +1 -0
- package/components/input/input.d.ts +4 -4
- package/components/login-dialog/login-dialog.js +1 -0
- package/components/login-dialog/service.js +1 -0
- package/components/message/message.js +2 -0
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +1 -0
- package/components/popup/popup.d.ts +2 -0
- package/components/popup/popup.js +50 -26
- package/components/popup/position-css.d.ts +14 -0
- package/components/popup/position-css.js +91 -0
- package/components/popup/position.d.ts +1 -0
- package/components/popup/position.js +13 -6
- package/components/popup-menu/popup-menu.d.ts +1 -0
- package/components/popup-menu/popup-menu.js +1 -0
- package/components/query-assist/query-assist.js +2 -0
- package/components/select/select.js +1 -0
- package/components/select/select__popup.js +2 -0
- package/components/storage/storage.js +1 -0
- package/components/storage/storage__local.js +1 -0
- package/components/style.css +1 -1
- package/components/table/row-with-focus-sensor.js +1 -0
- package/components/table/row.js +1 -0
- package/components/table/simple-table.js +1 -0
- package/components/table/smart-table.js +1 -0
- package/components/table/table.js +1 -0
- package/components/tabs/collapsible-more.js +2 -0
- package/components/tabs/collapsible-tabs.js +1 -0
- package/components/tabs/dumb-tabs.js +1 -0
- package/components/tabs/smart-tabs.js +1 -0
- package/components/tabs/tabs.js +1 -0
- package/components/tags-input/tags-input.js +1 -0
- package/components/text/text.d.ts +14 -3
- package/components/text/text.js +5 -2
- package/components/tooltip/tooltip.js +1 -0
- package/components/user-agreement/service.js +1 -0
- package/components/user-agreement/user-agreement.js +1 -0
- package/components/user-card/card.js +1 -0
- package/components/user-card/smart-user-card-tooltip.js +1 -0
- package/components/user-card/tooltip.js +2 -0
- package/components/user-card/user-card.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[](https://github.com/JetBrains#jetbrains-on-github)
|
5
5
|
|
6
6
|
- [Design guildelines](https://www.jetbrains.com/help/ring-ui/welcome.html)
|
7
|
+
- [Figma library](https://www.figma.com/design/j7UivSrGze5xCDKrqzR7Fa/RingUI--Community)
|
7
8
|
- [Usage examples in Storybook][docsite]
|
8
9
|
- [GitHub repository](https://github.com/JetBrains/ring-ui)
|
9
10
|
- [Issues in YouTrack](https://youtrack.jetbrains.com/issues/RG)
|
@@ -39,6 +39,7 @@ import '../tab-trap/tab-trap.js';
|
|
39
39
|
import '../popup/position.js';
|
40
40
|
import 'core-js/modules/es.array.sort.js';
|
41
41
|
import '../popup/popup.consts.js';
|
42
|
+
import '../popup/position-css.js';
|
42
43
|
|
43
44
|
var styles = {"alert":"ring-alert-alert","alertInline":"ring-alert-alertInline","error":"ring-alert-error","icon":"ring-alert-icon","caption":"ring-alert-caption","withCloseButton":"ring-alert-withCloseButton","badge":"ring-alert-badge","loader":"ring-alert-loader","close":"ring-alert-close","animationOpen":"ring-alert-animationOpen","show":"ring-alert-show","animationClosing":"ring-alert-animationClosing","animationShaking":"ring-alert-animationShaking","shaking":"ring-alert-shaking"};
|
44
45
|
|
@@ -5,10 +5,11 @@ export interface AlertItem extends Partial<Omit<AlertProps, 'children'>> {
|
|
5
5
|
message: ReactNode;
|
6
6
|
ref?: Ref<Alert>;
|
7
7
|
}
|
8
|
+
export declare const DEFAULT_ALERT_TIMEOUT = 10000;
|
8
9
|
/**
|
9
10
|
* @name Alert Service
|
10
11
|
*/
|
11
|
-
declare class AlertService {
|
12
|
+
export declare class AlertService {
|
12
13
|
defaultTimeout: number;
|
13
14
|
showingAlerts: AlertItem[];
|
14
15
|
containerElement: HTMLDivElement;
|
@@ -41,15 +41,17 @@ import '../tab-trap/tab-trap.js';
|
|
41
41
|
import '../popup/position.js';
|
42
42
|
import 'core-js/modules/es.array.sort.js';
|
43
43
|
import '../popup/popup.consts.js';
|
44
|
+
import '../popup/position-css.js';
|
44
45
|
|
45
46
|
const _excluded = ["message", "key"],
|
46
47
|
_excluded2 = ["onCloseRequest", "onClose"];
|
48
|
+
const DEFAULT_ALERT_TIMEOUT = 10000; // 10 seconds
|
47
49
|
/**
|
48
50
|
* @name Alert Service
|
49
51
|
*/
|
50
52
|
class AlertService {
|
51
53
|
constructor() {
|
52
|
-
_defineProperty(this, "defaultTimeout",
|
54
|
+
_defineProperty(this, "defaultTimeout", DEFAULT_ALERT_TIMEOUT);
|
53
55
|
// This alerts are stored in inverse order (last shown is first in array)
|
54
56
|
_defineProperty(this, "showingAlerts", []);
|
55
57
|
_defineProperty(this, "containerElement", document.createElement('div'));
|
@@ -161,4 +163,4 @@ class AlertService {
|
|
161
163
|
}
|
162
164
|
const alertService = new AlertService();
|
163
165
|
|
164
|
-
export { alertService as default };
|
166
|
+
export { AlertService, DEFAULT_ALERT_TIMEOUT, alertService as default };
|
package/components/auth/auth.js
CHANGED
@@ -47,6 +47,7 @@ import '../tab-trap/tab-trap.js';
|
|
47
47
|
import '../popup/position.js';
|
48
48
|
import 'core-js/modules/es.array.sort.js';
|
49
49
|
import '../popup/popup.consts.js';
|
50
|
+
import '../popup/position-css.js';
|
50
51
|
import '../alert/container.js';
|
51
52
|
import '../link/link.js';
|
52
53
|
import '../_helpers/link.js';
|
@@ -44,6 +44,7 @@ import '../tab-trap/tab-trap.js';
|
|
44
44
|
import '../popup/position.js';
|
45
45
|
import 'core-js/modules/es.array.sort.js';
|
46
46
|
import '../popup/popup.consts.js';
|
47
|
+
import '../popup/position-css.js';
|
47
48
|
import '../_helpers/link.js';
|
48
49
|
|
49
50
|
var styles = {"title":"ring-down-notification-title","error":"ring-down-notification-error"};
|
@@ -46,6 +46,7 @@ import '../popup/popup.js';
|
|
46
46
|
import '../popup/position.js';
|
47
47
|
import 'core-js/modules/es.array.sort.js';
|
48
48
|
import '../popup/popup.consts.js';
|
49
|
+
import '../popup/position-css.js';
|
49
50
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
50
51
|
import 'scrollbar-width';
|
51
52
|
import '../loader-screen/loader-screen.js';
|
@@ -32,6 +32,7 @@ import '../popup/popup.js';
|
|
32
32
|
import '../popup/position.js';
|
33
33
|
import 'core-js/modules/es.array.sort.js';
|
34
34
|
import '../popup/popup.consts.js';
|
35
|
+
import '../popup/position-css.js';
|
35
36
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
36
37
|
import 'scrollbar-width';
|
37
38
|
import '@jetbrains/icons/chevron-down';
|
@@ -43,6 +43,7 @@ import '../popup/popup.js';
|
|
43
43
|
import '../popup/position.js';
|
44
44
|
import 'core-js/modules/es.array.sort.js';
|
45
45
|
import '../popup/popup.consts.js';
|
46
|
+
import '../popup/position-css.js';
|
46
47
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
48
|
import 'scrollbar-width';
|
48
49
|
import '../heading/heading.js';
|
@@ -67,6 +67,7 @@ import '../popup/position.js';
|
|
67
67
|
import 'core-js/modules/es.array.sort.js';
|
68
68
|
import '../popup/popup.consts.js';
|
69
69
|
import '../popup/popup.target.js';
|
70
|
+
import '../popup/position-css.js';
|
70
71
|
|
71
72
|
var styles = {"avatarStack":"ring-avatar-stack-avatarStack","extraText":"ring-avatar-stack-extraText","item":"ring-avatar-stack-item","size20":"ring-avatar-stack-size20","size24":"ring-avatar-stack-size24","size28":"ring-avatar-stack-size28","size32":"ring-avatar-stack-size32","size40":"ring-avatar-stack-size40","size56":"ring-avatar-stack-size56","hovered":"ring-avatar-stack-hovered","extra":"ring-avatar-stack-extra ring-avatar-stack-item","extraButton":"ring-avatar-stack-extraButton ring-global-resetButton"};
|
72
73
|
|
@@ -33,6 +33,7 @@ import 'core-js/modules/es.string.replace.js';
|
|
33
33
|
import '../popup/position.js';
|
34
34
|
import 'core-js/modules/es.array.sort.js';
|
35
35
|
import '../popup/popup.consts.js';
|
36
|
+
import '../popup/position-css.js';
|
36
37
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
37
38
|
import 'scrollbar-width';
|
38
39
|
import '@jetbrains/icons/chevron-down';
|
@@ -44,6 +44,7 @@ import '../popup/popup.js';
|
|
44
44
|
import '../popup/position.js';
|
45
45
|
import 'core-js/modules/es.array.sort.js';
|
46
46
|
import '../popup/popup.consts.js';
|
47
|
+
import '../popup/position-css.js';
|
47
48
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
48
49
|
import 'scrollbar-width';
|
49
50
|
import '../panel/panel.js';
|
@@ -122,6 +122,7 @@ class Item extends PureComponent {
|
|
122
122
|
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
123
123
|
moreLessButton = jsxs(Text, {
|
124
124
|
info: true,
|
125
|
+
size: Text.Size.S,
|
125
126
|
children: [jsx(Link, {
|
126
127
|
inherit: true,
|
127
128
|
pseudo: true,
|
@@ -134,6 +135,7 @@ class Item extends PureComponent {
|
|
134
135
|
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
135
136
|
moreLessButton = jsx(Text, {
|
136
137
|
info: true,
|
138
|
+
size: Text.Size.S,
|
137
139
|
children: jsx(Link, {
|
138
140
|
inherit: true,
|
139
141
|
pseudo: true,
|
@@ -40,6 +40,7 @@ import '../popup/position.js';
|
|
40
40
|
import 'core-js/modules/es.array.sort.js';
|
41
41
|
import '../popup/popup.consts.js';
|
42
42
|
import '../popup/popup.target.js';
|
43
|
+
import '../popup/position-css.js';
|
43
44
|
import '../global/typescript-utils.js';
|
44
45
|
import '../_helpers/anchor.js';
|
45
46
|
import '@jetbrains/icons/chevron-12px-down';
|
@@ -103,6 +104,7 @@ const PopupComponent = _ref => {
|
|
103
104
|
} = _ref,
|
104
105
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
105
106
|
return jsx(Popup, _objectSpread2(_objectSpread2({
|
107
|
+
cssPositioning: true,
|
106
108
|
hidden: hidden,
|
107
109
|
className: className,
|
108
110
|
ref: popupRef,
|
@@ -268,6 +270,7 @@ class DatePicker extends PureComponent {
|
|
268
270
|
}, dropdownProps), {}, {
|
269
271
|
children: jsx(PopupComponent, {
|
270
272
|
className: popupClassName,
|
273
|
+
cssPositioning: true,
|
271
274
|
popupRef: this.popupRef,
|
272
275
|
onClear: clear ? this.clear : null,
|
273
276
|
datePopupProps: _objectSpread2(_objectSpread2({}, datePopupProps), {}, {
|
@@ -41,6 +41,7 @@ import '../_helpers/button__classes.js';
|
|
41
41
|
import '../popup/position.js';
|
42
42
|
import 'core-js/modules/es.array.sort.js';
|
43
43
|
import '../popup/popup.consts.js';
|
44
|
+
import '../popup/position-css.js';
|
44
45
|
import 'scrollbar-width';
|
45
46
|
|
46
47
|
const _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions", "native", "modal", "preventBodyScroll"];
|
@@ -66,6 +66,7 @@ import '../popup/position.js';
|
|
66
66
|
import 'core-js/modules/es.array.sort.js';
|
67
67
|
import '../popup/popup.consts.js';
|
68
68
|
import '../popup/popup.target.js';
|
69
|
+
import '../popup/position-css.js';
|
69
70
|
|
70
71
|
const _excluded = ["anchor", "pinned", "active", "activeListItemId", "listId"],
|
71
72
|
_excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps", "children"],
|
@@ -21,6 +21,7 @@ import '../tab-trap/tab-trap.js';
|
|
21
21
|
import '../popup/position.js';
|
22
22
|
import 'core-js/modules/es.array.sort.js';
|
23
23
|
import '../popup/popup.target.js';
|
24
|
+
import '../popup/position-css.js';
|
24
25
|
|
25
26
|
var styles = {"errorBubblePopup":"ring-error-bubble-errorBubblePopup","errorBubbleWrapper":"ring-error-bubble-errorBubbleWrapper","errorBubble":"ring-error-bubble-errorBubble"};
|
26
27
|
|
@@ -41,6 +42,7 @@ class ErrorBubble extends PureComponent {
|
|
41
42
|
className: styles.errorBubbleWrapper,
|
42
43
|
"data-test": "ring-error-bubble-wrapper",
|
43
44
|
children: [children && Children.map(children, child => /*#__PURE__*/cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), restProps))), restProps.error && jsx(Popup, {
|
45
|
+
cssPositioning: true,
|
44
46
|
trapFocus: false,
|
45
47
|
className: styles.errorBubblePopup,
|
46
48
|
hidden: false,
|
@@ -30,6 +30,7 @@ import '../tab-trap/tab-trap.js';
|
|
30
30
|
import '../popup/position.js';
|
31
31
|
import 'core-js/modules/es.array.sort.js';
|
32
32
|
import '../popup/popup.consts.js';
|
33
|
+
import '../popup/position-css.js';
|
33
34
|
import '../icon/icon.js';
|
34
35
|
import 'util-deprecate';
|
35
36
|
import '../icon/icon__constants.js';
|
@@ -69,6 +69,7 @@ import '../popup/position.js';
|
|
69
69
|
import 'core-js/modules/es.array.sort.js';
|
70
70
|
import '../popup/popup.consts.js';
|
71
71
|
import '../popup/popup.target.js';
|
72
|
+
import '../popup/position-css.js';
|
72
73
|
import '../i18n/i18n.js';
|
73
74
|
|
74
75
|
const _excluded = ["className", "activeClassName", "closeOnSelect", "hasUpdates", "onLogout", "user", "profileUrl", "LinkComponent", "onSwitchUser", "renderPopupItems", "onRevertPostponement", "showApplyChangedUser", "showName", "showLogIn", "showLogOut", "showSwitchUser", "renderGuest", "translations", "size", "round", "loading", "onLogin", "menuProps", "onShow", "onHide"];
|
@@ -39,6 +39,7 @@ import '../tab-trap/tab-trap.js';
|
|
39
39
|
import '../popup/position.js';
|
40
40
|
import '../popup/popup.consts.js';
|
41
41
|
import '../popup/popup.target.js';
|
42
|
+
import '../popup/position-css.js';
|
42
43
|
import '../_helpers/header.js';
|
43
44
|
import '../link/link.js';
|
44
45
|
import '../_helpers/link.js';
|
@@ -89,6 +90,7 @@ class Services extends PureComponent {
|
|
89
90
|
anchor: makeAnchor(loading),
|
90
91
|
initShown: initShown,
|
91
92
|
children: jsxs(Popup, {
|
93
|
+
cssPositioning: true,
|
92
94
|
className: classNames(styles.services, {
|
93
95
|
[darkStyles.dark]: theme === Theme.DARK
|
94
96
|
}),
|
@@ -47,6 +47,7 @@ import '../tab-trap/tab-trap.js';
|
|
47
47
|
import '../popup/position.js';
|
48
48
|
import 'core-js/modules/es.array.sort.js';
|
49
49
|
import '../popup/popup.consts.js';
|
50
|
+
import '../popup/position-css.js';
|
50
51
|
import '../alert/container.js';
|
51
52
|
import '../link/link.js';
|
52
53
|
import '../_helpers/link.js';
|
@@ -39,6 +39,7 @@ import '../tab-trap/tab-trap.js';
|
|
39
39
|
import '../popup/position.js';
|
40
40
|
import '../popup/popup.consts.js';
|
41
41
|
import '../popup/popup.target.js';
|
42
|
+
import '../popup/position-css.js';
|
42
43
|
import '../_helpers/theme.js';
|
43
44
|
import './header-icon.js';
|
44
45
|
import '../_helpers/header.js';
|
@@ -17,8 +17,8 @@ export interface InputTranslations {
|
|
17
17
|
clear: string;
|
18
18
|
}
|
19
19
|
export interface InputBaseProps {
|
20
|
-
size
|
21
|
-
enableShortcuts
|
20
|
+
size?: Size;
|
21
|
+
enableShortcuts?: boolean | string[];
|
22
22
|
children?: string | undefined;
|
23
23
|
inputClassName?: string | null | undefined;
|
24
24
|
label?: ReactNode;
|
@@ -37,11 +37,11 @@ export interface InputBaseProps {
|
|
37
37
|
type Override<D, S> = Omit<D, keyof S> & S;
|
38
38
|
export type InputSpecificProps = Override<InputHTMLAttributes<HTMLInputElement>, InputBaseProps> & {
|
39
39
|
multiline?: false | undefined;
|
40
|
-
inputRef
|
40
|
+
inputRef?: Ref<HTMLInputElement>;
|
41
41
|
};
|
42
42
|
type TextAreaSpecificProps = Override<TextareaHTMLAttributes<HTMLTextAreaElement>, InputBaseProps> & {
|
43
43
|
multiline: true;
|
44
|
-
inputRef
|
44
|
+
inputRef?: Ref<HTMLTextAreaElement>;
|
45
45
|
};
|
46
46
|
export type InputProps = InputSpecificProps | TextAreaSpecificProps;
|
47
47
|
export declare class Input extends PureComponent<InputProps> {
|
@@ -43,6 +43,7 @@ import '../popup/popup.js';
|
|
43
43
|
import '../popup/position.js';
|
44
44
|
import 'core-js/modules/es.array.sort.js';
|
45
45
|
import '../popup/popup.consts.js';
|
46
|
+
import '../popup/position-css.js';
|
46
47
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
48
|
import 'scrollbar-width';
|
48
49
|
import '../loader/loader.js';
|
@@ -43,6 +43,7 @@ import '../popup/popup.js';
|
|
43
43
|
import '../popup/position.js';
|
44
44
|
import 'core-js/modules/es.array.sort.js';
|
45
45
|
import '../popup/popup.consts.js';
|
46
|
+
import '../popup/position-css.js';
|
46
47
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
48
|
import 'scrollbar-width';
|
48
49
|
import '../loader-screen/loader-screen.js';
|
@@ -27,6 +27,7 @@ import '../tab-trap/tab-trap.js';
|
|
27
27
|
import '../popup/position.js';
|
28
28
|
import 'core-js/modules/es.array.sort.js';
|
29
29
|
import '../popup/popup.target.js';
|
30
|
+
import '../popup/position-css.js';
|
30
31
|
import 'util-deprecate';
|
31
32
|
import '../icon/icon__constants.js';
|
32
33
|
import '../_helpers/icon__svg.js';
|
@@ -178,6 +179,7 @@ class Message extends Component {
|
|
178
179
|
var _translations$gotIt, _translations$dismiss;
|
179
180
|
return jsx(Popup, _objectSpread2(_objectSpread2({
|
180
181
|
ref: this.popupRef,
|
182
|
+
cssPositioning: true,
|
181
183
|
hidden: false,
|
182
184
|
directions: popupDirections,
|
183
185
|
className: classNames(classes, themeClasses),
|
@@ -8,11 +8,11 @@ const MAJOR_VERSION_INDEX = 0;
|
|
8
8
|
/**
|
9
9
|
* SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
|
10
10
|
*/
|
11
|
-
if (!["and_chr
|
11
|
+
if (!["and_chr 138", "and_ff 140", "and_qq 14.9", "and_uc 15.5", "android 138", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 125", "chrome 123", "chrome 116", "chrome 112", "chrome 109", "edge 138", "edge 137", "edge 136", "firefox 141", "firefox 140", "firefox 139", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 16.6-16.7", "ios_saf 16.3", "ios_saf 16.1", "ios_saf 15.6-15.8", "ios_saf 11.0-11.2", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 117", "opera 116", "safari 18.5", "safari 18.4", "safari 18.3", "safari 17.6", "safari 17.1", "safari 16.6", "safari 15.6", "samsung 28", "samsung 27"]) {
|
12
12
|
// eslint-disable-next-line no-console
|
13
13
|
console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
|
14
14
|
}
|
15
|
-
const SUPPORTED = ["and_chr
|
15
|
+
const SUPPORTED = ["and_chr 138", "and_ff 140", "and_qq 14.9", "and_uc 15.5", "android 138", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 125", "chrome 123", "chrome 116", "chrome 112", "chrome 109", "edge 138", "edge 137", "edge 136", "firefox 141", "firefox 140", "firefox 139", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 16.6-16.7", "ios_saf 16.3", "ios_saf 16.1", "ios_saf 15.6-15.8", "ios_saf 11.0-11.2", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 117", "opera 116", "safari 18.5", "safari 18.4", "safari 18.3", "safari 17.6", "safari 17.1", "safari 16.6", "safari 15.6", "samsung 28", "samsung 27"] || [];
|
16
16
|
const WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
|
17
17
|
const WHITE_LIST = SUPPORTED.reduce((acc, item) => {
|
18
18
|
var _item$match;
|
@@ -53,6 +53,7 @@ import '../popup/position.js';
|
|
53
53
|
import 'core-js/modules/es.array.sort.js';
|
54
54
|
import '../popup/popup.consts.js';
|
55
55
|
import '../popup/popup.target.js';
|
56
|
+
import '../popup/position-css.js';
|
56
57
|
import '../list/list.js';
|
57
58
|
import 'core-js/modules/es.symbol.description.js';
|
58
59
|
import 'react-virtualized/dist/es/List';
|
@@ -32,6 +32,7 @@ export interface BasePopupProps {
|
|
32
32
|
withTail?: boolean;
|
33
33
|
tailOffset?: number;
|
34
34
|
largeBorderRadius?: boolean;
|
35
|
+
cssPositioning?: boolean;
|
35
36
|
anchorElement?: HTMLElement | null | undefined;
|
36
37
|
target?: string | Element | null | undefined;
|
37
38
|
className?: string | null | undefined;
|
@@ -83,6 +84,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
83
84
|
trapFocus: boolean;
|
84
85
|
autoFocusFirst: boolean;
|
85
86
|
legacy: boolean;
|
87
|
+
cssPositioning: boolean;
|
86
88
|
};
|
87
89
|
state: PopupState;
|
88
90
|
componentDidMount(): void;
|
@@ -15,13 +15,14 @@ import TabTrap from '../tab-trap/tab-trap.js';
|
|
15
15
|
import position from './position.js';
|
16
16
|
import { DEFAULT_DIRECTIONS, MaxHeight, MinWidth, Dimension, Directions, Display } from './popup.consts.js';
|
17
17
|
import { PopupTargetContext, PopupTarget } from './popup.target.js';
|
18
|
+
import { supportsCSSAnchorPositioning, setCSSAnchorPositioning } from './position-css.js';
|
18
19
|
import '../shortcuts/core.js';
|
19
20
|
import 'combokeys';
|
20
21
|
import '../global/sniffer.js';
|
21
22
|
import 'sniffr';
|
22
23
|
import 'core-js/modules/es.array.sort.js';
|
23
24
|
|
24
|
-
var styles = {"popup":"ring-popup-popup ring-global-font","largeBorderRadius":"ring-popup-largeBorderRadius","hidden":"ring-popup-hidden","showing":"ring-popup-showing","attached":"ring-popup-attached"};
|
25
|
+
var styles = {"popup":"ring-popup-popup ring-global-font","jsAnchoredPopup":"ring-popup-jsAnchoredPopup","cssAnchoredPopup":"ring-popup-cssAnchoredPopup","largeBorderRadius":"ring-popup-largeBorderRadius","hidden":"ring-popup-hidden","showing":"ring-popup-showing","attached":"ring-popup-attached"};
|
25
26
|
|
26
27
|
const isPossibleClientSideNavigation = event => {
|
27
28
|
const target = event.target;
|
@@ -103,24 +104,39 @@ class Popup extends PureComponent {
|
|
103
104
|
});
|
104
105
|
_defineProperty(this, "_updatePosition", () => {
|
105
106
|
const popup = this.popup;
|
107
|
+
const anchor = this._getAnchor();
|
106
108
|
if (popup) {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
} else {
|
119
|
-
popup.style[propKey] = value.toString();
|
120
|
-
}
|
109
|
+
if (this.props.cssPositioning && supportsCSSAnchorPositioning() && anchor) {
|
110
|
+
// Use CSS Anchor positioning
|
111
|
+
setCSSAnchorPositioning({
|
112
|
+
popup,
|
113
|
+
anchor,
|
114
|
+
uid: this.uid,
|
115
|
+
minWidth: this.props.minWidth,
|
116
|
+
top: this.props.top,
|
117
|
+
left: this.props.left,
|
118
|
+
directions: this.props.directions,
|
119
|
+
offset: this.props.offset
|
121
120
|
});
|
122
|
-
|
123
|
-
|
121
|
+
} else {
|
122
|
+
popup.style.position = 'absolute';
|
123
|
+
if (this.isVisible()) {
|
124
|
+
const {
|
125
|
+
styles: style,
|
126
|
+
direction
|
127
|
+
} = this.position();
|
128
|
+
Object.entries(style).forEach(_ref => {
|
129
|
+
let [key, value] = _ref;
|
130
|
+
const propKey = key;
|
131
|
+
if (typeof value === 'number') {
|
132
|
+
popup.style[propKey] = "".concat(value, "px");
|
133
|
+
} else {
|
134
|
+
popup.style[propKey] = value.toString();
|
135
|
+
}
|
136
|
+
});
|
137
|
+
if (direction != null) {
|
138
|
+
this._updateDirection(direction);
|
139
|
+
}
|
124
140
|
}
|
125
141
|
}
|
126
142
|
this.setState(this.calculateDisplay);
|
@@ -229,16 +245,20 @@ class Popup extends PureComponent {
|
|
229
245
|
clearTimeout(this._prevTimeout);
|
230
246
|
this._prevTimeout = window.setTimeout(() => {
|
231
247
|
this._listenersEnabled = true;
|
232
|
-
|
233
|
-
if
|
234
|
-
|
248
|
+
// CSS positioning doesn't need resize/scroll listeners as it's handled by CSS
|
249
|
+
// But we need them if CSS positioning isn't supported
|
250
|
+
if (!this.props.cssPositioning || !supportsCSSAnchorPositioning()) {
|
251
|
+
this.listeners.add(window, 'resize', this._redraw);
|
252
|
+
if (this.props.autoPositioningOnScroll) {
|
253
|
+
this.listeners.add(window, 'scroll', this._redraw);
|
254
|
+
}
|
255
|
+
let el = this._getAnchor();
|
256
|
+
while (el) {
|
257
|
+
this.listeners.add(el, 'scroll', this._redraw);
|
258
|
+
el = el.parentElement;
|
259
|
+
}
|
235
260
|
}
|
236
261
|
this.listeners.add(document, 'pointerdown', this._onDocumentClick, true);
|
237
|
-
let el = this._getAnchor();
|
238
|
-
while (el) {
|
239
|
-
this.listeners.add(el, 'scroll', this._redraw);
|
240
|
-
el = el.parentElement;
|
241
|
-
}
|
242
262
|
}, 0);
|
243
263
|
return;
|
244
264
|
}
|
@@ -286,8 +306,11 @@ class Popup extends PureComponent {
|
|
286
306
|
'data-test': dataTest,
|
287
307
|
largeBorderRadius
|
288
308
|
} = this.props;
|
309
|
+
const useCssPositioning = this.props.cssPositioning && supportsCSSAnchorPositioning();
|
289
310
|
const showing = this.state.display === Display.SHOWING;
|
290
311
|
const classes = classNames(className, styles.popup, {
|
312
|
+
[styles.jsAnchoredPopup]: !useCssPositioning,
|
313
|
+
[styles.cssAnchoredPopup]: useCssPositioning,
|
291
314
|
[styles.attached]: attached,
|
292
315
|
[styles.hidden]: hidden,
|
293
316
|
[styles.showing]: showing,
|
@@ -352,7 +375,8 @@ _defineProperty(Popup, "defaultProps", {
|
|
352
375
|
attached: false,
|
353
376
|
trapFocus: false,
|
354
377
|
autoFocusFirst: false,
|
355
|
-
legacy: false
|
378
|
+
legacy: false,
|
379
|
+
cssPositioning: false
|
356
380
|
});
|
357
381
|
_defineProperty(Popup, "PopupProps", {
|
358
382
|
Directions,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Directions } from './popup.consts';
|
2
|
+
export declare const supportsCSSAnchorPositioning: () => boolean;
|
3
|
+
interface SetCSSAnchorPositioningParams {
|
4
|
+
popup: HTMLElement;
|
5
|
+
anchor: HTMLElement;
|
6
|
+
uid: string;
|
7
|
+
minWidth?: number | 'target' | null;
|
8
|
+
top?: number;
|
9
|
+
left?: number;
|
10
|
+
directions: readonly Directions[];
|
11
|
+
offset?: number;
|
12
|
+
}
|
13
|
+
export declare const setCSSAnchorPositioning: ({ popup, anchor, uid, minWidth, top, left, directions, offset, }: SetCSSAnchorPositioningParams) => void;
|
14
|
+
export {};
|