@jetbrains/ring-ui-built 7.0.60 → 7.0.61
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/input.js +1 -1
- package/components/alert/alert.js +2 -0
- package/components/alert-service/alert-service.js +2 -0
- package/components/auth/auth.js +2 -0
- package/components/auth/auth__core.js +2 -0
- package/components/auth/down-notification.js +2 -0
- package/components/auth/iframe-flow.js +3 -1
- package/components/auth/storage.js +2 -0
- package/components/auth-dialog/auth-dialog.js +2 -0
- package/components/auth-dialog-service/auth-dialog-service.js +3 -1
- package/components/avatar-stack/avatar-stack.js +2 -0
- package/components/banner/banner.js +2 -0
- package/components/button/button.d.ts +1 -1
- package/components/button/button.js +2 -1
- package/components/clipboard/clipboard.js +2 -0
- package/components/confirm/confirm.js +2 -0
- package/components/confirm-service/confirm-service.js +2 -0
- package/components/data-list/data-list.js +1 -0
- package/components/data-list/data-list.mock.js +1 -0
- package/components/data-list/item.js +1 -0
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.js +2 -0
- package/components/date-picker/date-popup.js +1 -0
- package/components/dialog/dialog.js +2 -0
- package/components/dropdown/anchor.js +1 -0
- package/components/dropdown/dropdown.js +1 -0
- package/components/dropdown-menu/dropdown-menu.js +2 -0
- package/components/editable-heading/editable-heading.js +1 -0
- package/components/error-bubble/error-bubble.js +2 -0
- package/components/global/configuration.d.ts +11 -0
- package/components/global/configuration.js +25 -0
- package/components/global/controls-height.d.ts +4 -7
- package/components/global/controls-height.js +11 -12
- package/components/global/theme.js +2 -0
- package/components/header/header-icon.js +1 -0
- package/components/header/header.js +2 -0
- package/components/header/profile.js +2 -0
- package/components/header/services.js +2 -0
- package/components/header/smart-profile.js +2 -0
- package/components/header/smart-services.js +2 -0
- package/components/input/input.d.ts +3 -2
- package/components/input/input.js +1 -0
- package/components/login-dialog/login-dialog.js +2 -0
- package/components/login-dialog/service.js +3 -1
- package/components/message/message.js +2 -0
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +2 -0
- package/components/popup/popup.d.ts +2 -0
- package/components/popup/popup.js +53 -25
- package/components/popup/position-css.d.ts +14 -0
- package/components/popup/position-css.js +89 -0
- package/components/popup/position.d.ts +1 -0
- package/components/popup/position.js +13 -6
- package/components/popup-menu/popup-menu.js +2 -0
- package/components/query-assist/query-assist.js +3 -1
- package/components/select/select.d.ts +3 -2
- package/components/select/select.js +4 -2
- package/components/select/select__filter.js +1 -0
- package/components/select/select__popup.js +3 -1
- package/components/storage/storage.js +2 -0
- package/components/storage/storage__local.js +2 -0
- package/components/style.css +1 -1
- package/components/table/row-with-focus-sensor.js +2 -0
- package/components/table/row.js +2 -0
- package/components/table/simple-table.js +2 -0
- package/components/table/smart-table.js +2 -0
- package/components/table/table.js +2 -0
- package/components/tabs/collapsible-more.js +2 -0
- package/components/tabs/collapsible-tabs.js +2 -0
- package/components/tabs/dumb-tabs.js +2 -0
- package/components/tabs/smart-tabs.js +2 -0
- package/components/tabs/tabs.js +2 -0
- package/components/tag/tag.js +2 -1
- package/components/tags-input/tags-input.d.ts +3 -2
- package/components/tags-input/tags-input.js +3 -1
- package/components/tags-list/tags-list.js +1 -0
- package/components/tooltip/tooltip.js +2 -0
- package/components/user-agreement/service.js +2 -0
- package/components/user-agreement/user-agreement.js +2 -0
- package/components/user-card/card.js +2 -0
- package/components/user-card/smart-user-card-tooltip.js +2 -0
- package/components/user-card/tooltip.js +2 -0
- package/components/user-card/user-card.js +2 -0
- package/package.json +2 -2
@@ -37,12 +37,14 @@ import 'core-js/modules/es.string.replace.js';
|
|
37
37
|
import '../global/memoize.js';
|
38
38
|
import '../link/clickableLink.js';
|
39
39
|
import '../global/controls-height.js';
|
40
|
+
import '../global/configuration.js';
|
40
41
|
import '../_helpers/button__classes.js';
|
41
42
|
import '../popup/popup.target.js';
|
42
43
|
import '../popup/popup.js';
|
43
44
|
import '../popup/position.js';
|
44
45
|
import 'core-js/modules/es.array.sort.js';
|
45
46
|
import '../popup/popup.consts.js';
|
47
|
+
import '../popup/position-css.js';
|
46
48
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
49
|
import 'scrollbar-width';
|
48
50
|
import '../loader/loader.js';
|
@@ -4,6 +4,8 @@ import { createRoot } from 'react-dom/client';
|
|
4
4
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height.js';
|
5
5
|
import LoginDialog from './login-dialog.js';
|
6
6
|
import 'react';
|
7
|
+
import 'util-deprecate';
|
8
|
+
import '../global/configuration.js';
|
7
9
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
8
10
|
import '../dialog/dialog.js';
|
9
11
|
import 'react-dom';
|
@@ -30,7 +32,6 @@ import '../global/dom.js';
|
|
30
32
|
import '../button/button.js';
|
31
33
|
import '@jetbrains/icons/chevron-down';
|
32
34
|
import '@jetbrains/icons/chevron-12px-down';
|
33
|
-
import 'util-deprecate';
|
34
35
|
import '../icon/icon.js';
|
35
36
|
import '../icon/icon__constants.js';
|
36
37
|
import '../_helpers/icon__svg.js';
|
@@ -43,6 +44,7 @@ import '../popup/popup.js';
|
|
43
44
|
import '../popup/position.js';
|
44
45
|
import 'core-js/modules/es.array.sort.js';
|
45
46
|
import '../popup/popup.consts.js';
|
47
|
+
import '../popup/position-css.js';
|
46
48
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
49
|
import 'scrollbar-width';
|
48
50
|
import '../loader-screen/loader-screen.js';
|
@@ -24,9 +24,11 @@ import '../global/sniffer.js';
|
|
24
24
|
import 'sniffr';
|
25
25
|
import '../global/data-tests.js';
|
26
26
|
import '../tab-trap/tab-trap.js';
|
27
|
+
import '../global/configuration.js';
|
27
28
|
import '../popup/position.js';
|
28
29
|
import 'core-js/modules/es.array.sort.js';
|
29
30
|
import '../popup/popup.target.js';
|
31
|
+
import '../popup/position-css.js';
|
30
32
|
import 'util-deprecate';
|
31
33
|
import '../icon/icon__constants.js';
|
32
34
|
import '../_helpers/icon__svg.js';
|
@@ -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 139", "and_ff 142", "and_qq 14.9", "and_uc 15.5", "android 139", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 125", "chrome 112", "chrome 109", "edge 139", "edge 138", "edge 137", "firefox 142", "firefox 141", "firefox 140", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5-18.6", "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 16.6-16.7", "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
|
11
|
+
if (!["and_chr 139", "and_ff 142", "and_qq 14.9", "and_uc 15.5", "android 139", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 125", "chrome 112", "chrome 109", "edge 140", "edge 139", "edge 138", "edge 137", "firefox 142", "firefox 141", "firefox 140", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5-18.6", "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 16.6-16.7", "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 121", "opera 120", "safari 18.5-18.6", "safari 18.4", "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 139", "and_ff 142", "and_qq 14.9", "and_uc 15.5", "android 139", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 125", "chrome 112", "chrome 109", "edge 139", "edge 138", "edge 137", "firefox 142", "firefox 141", "firefox 140", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5-18.6", "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 16.6-16.7", "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
|
15
|
+
const SUPPORTED = ["and_chr 139", "and_ff 142", "and_qq 14.9", "and_uc 15.5", "android 139", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 125", "chrome 112", "chrome 109", "edge 140", "edge 139", "edge 138", "edge 137", "firefox 142", "firefox 141", "firefox 140", "firefox 128", "firefox 118", "firefox 115", "ios_saf 18.5-18.6", "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 16.6-16.7", "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 121", "opera 120", "safari 18.5-18.6", "safari 18.4", "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;
|
@@ -18,6 +18,7 @@ import '@jetbrains/icons/chevron-12px-down';
|
|
18
18
|
import 'util-deprecate';
|
19
19
|
import '../link/clickableLink.js';
|
20
20
|
import '../global/controls-height.js';
|
21
|
+
import '../global/configuration.js';
|
21
22
|
import '../_helpers/button__classes.js';
|
22
23
|
import '../icon/icon__constants.js';
|
23
24
|
import '../_helpers/icon__svg.js';
|
@@ -53,6 +54,7 @@ import '../popup/position.js';
|
|
53
54
|
import 'core-js/modules/es.array.sort.js';
|
54
55
|
import '../popup/popup.consts.js';
|
55
56
|
import '../popup/popup.target.js';
|
57
|
+
import '../popup/position-css.js';
|
56
58
|
import '../list/list.js';
|
57
59
|
import 'core-js/modules/es.symbol.description.js';
|
58
60
|
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;
|
@@ -117,6 +118,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
117
118
|
direction: Directions | null;
|
118
119
|
};
|
119
120
|
private _updateDirection;
|
121
|
+
private shouldUseCssPositioning;
|
120
122
|
private _updatePosition;
|
121
123
|
private _redraw;
|
122
124
|
private _getAnchor;
|
@@ -12,16 +12,18 @@ import { Listeners, getStyles } from '../global/dom.js';
|
|
12
12
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
13
13
|
import joinDataTestAttributes from '../global/data-tests.js';
|
14
14
|
import TabTrap from '../tab-trap/tab-trap.js';
|
15
|
+
import { getConfiguration } from '../global/configuration.js';
|
15
16
|
import position from './position.js';
|
16
17
|
import { DEFAULT_DIRECTIONS, MaxHeight, MinWidth, Dimension, Directions, Display } from './popup.consts.js';
|
17
18
|
import { PopupTargetContext, PopupTarget } from './popup.target.js';
|
19
|
+
import { setCSSAnchorPositioning, supportsCSSAnchorPositioning } from './position-css.js';
|
18
20
|
import '../shortcuts/core.js';
|
19
21
|
import 'combokeys';
|
20
22
|
import '../global/sniffer.js';
|
21
23
|
import 'sniffr';
|
22
24
|
import 'core-js/modules/es.array.sort.js';
|
23
25
|
|
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"};
|
26
|
+
var styles = {"popup":"ring-popup-popup ring-global-font","cssAnchoredPopup":"ring-popup-cssAnchoredPopup","largeBorderRadius":"ring-popup-largeBorderRadius","hidden":"ring-popup-hidden","showing":"ring-popup-showing","attached":"ring-popup-attached"};
|
25
27
|
|
26
28
|
const isPossibleClientSideNavigation = event => {
|
27
29
|
const target = event.target;
|
@@ -103,24 +105,39 @@ class Popup extends PureComponent {
|
|
103
105
|
});
|
104
106
|
_defineProperty(this, "_updatePosition", () => {
|
105
107
|
const popup = this.popup;
|
108
|
+
const anchor = this._getAnchor();
|
106
109
|
if (popup) {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
} else {
|
119
|
-
popup.style[propKey] = value.toString();
|
120
|
-
}
|
110
|
+
if (this.shouldUseCssPositioning() && anchor) {
|
111
|
+
// Use CSS Anchor positioning
|
112
|
+
setCSSAnchorPositioning({
|
113
|
+
popup,
|
114
|
+
anchor,
|
115
|
+
uid: this.uid,
|
116
|
+
minWidth: this.props.minWidth,
|
117
|
+
top: this.props.top,
|
118
|
+
left: this.props.left,
|
119
|
+
directions: this.props.directions,
|
120
|
+
offset: this.props.offset
|
121
121
|
});
|
122
|
-
|
123
|
-
|
122
|
+
} else {
|
123
|
+
popup.style.position = 'absolute';
|
124
|
+
if (this.isVisible()) {
|
125
|
+
const {
|
126
|
+
styles: style,
|
127
|
+
direction
|
128
|
+
} = this.position();
|
129
|
+
Object.entries(style).forEach(_ref => {
|
130
|
+
let [key, value] = _ref;
|
131
|
+
const propKey = key;
|
132
|
+
if (typeof value === 'number') {
|
133
|
+
popup.style[propKey] = "".concat(value, "px");
|
134
|
+
} else {
|
135
|
+
popup.style[propKey] = value.toString();
|
136
|
+
}
|
137
|
+
});
|
138
|
+
if (direction != null) {
|
139
|
+
this._updateDirection(direction);
|
140
|
+
}
|
124
141
|
}
|
125
142
|
}
|
126
143
|
this.setState(this.calculateDisplay);
|
@@ -217,6 +234,12 @@ class Popup extends PureComponent {
|
|
217
234
|
minWidth
|
218
235
|
});
|
219
236
|
}
|
237
|
+
shouldUseCssPositioning() {
|
238
|
+
if (!supportsCSSAnchorPositioning()) {
|
239
|
+
return false;
|
240
|
+
}
|
241
|
+
return this.props.cssPositioning !== undefined ? this.props.cssPositioning : getConfiguration().popupsCssPositioning;
|
242
|
+
}
|
220
243
|
_getAnchor() {
|
221
244
|
return this.props.anchorElement || this.parent;
|
222
245
|
}
|
@@ -229,16 +252,20 @@ class Popup extends PureComponent {
|
|
229
252
|
clearTimeout(this._prevTimeout);
|
230
253
|
this._prevTimeout = window.setTimeout(() => {
|
231
254
|
this._listenersEnabled = true;
|
232
|
-
|
233
|
-
if
|
234
|
-
|
255
|
+
// CSS positioning doesn't need resize/scroll listeners as it's handled by CSS
|
256
|
+
// But we need them if CSS positioning isn't supported
|
257
|
+
if (!this.shouldUseCssPositioning()) {
|
258
|
+
this.listeners.add(window, 'resize', this._redraw);
|
259
|
+
if (this.props.autoPositioningOnScroll) {
|
260
|
+
this.listeners.add(window, 'scroll', this._redraw);
|
261
|
+
}
|
262
|
+
let el = this._getAnchor();
|
263
|
+
while (el) {
|
264
|
+
this.listeners.add(el, 'scroll', this._redraw);
|
265
|
+
el = el.parentElement;
|
266
|
+
}
|
235
267
|
}
|
236
268
|
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
269
|
}, 0);
|
243
270
|
return;
|
244
271
|
}
|
@@ -288,6 +315,7 @@ class Popup extends PureComponent {
|
|
288
315
|
} = this.props;
|
289
316
|
const showing = this.state.display === Display.SHOWING;
|
290
317
|
const classes = classNames(className, styles.popup, {
|
318
|
+
[styles.cssAnchoredPopup]: this.shouldUseCssPositioning(),
|
291
319
|
[styles.attached]: attached,
|
292
320
|
[styles.hidden]: hidden,
|
293
321
|
[styles.showing]: showing,
|
@@ -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 {};
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
2
|
+
import { getRect } from '../global/dom.js';
|
3
|
+
import { calculateMinWidth } from './position.js';
|
4
|
+
import { Directions } from './popup.consts.js';
|
5
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
6
|
+
import 'core-js/modules/es.regexp.exec.js';
|
7
|
+
import 'core-js/modules/es.array.sort.js';
|
8
|
+
|
9
|
+
const supportsCSSAnchorPositioning = () => {
|
10
|
+
var _CSS, _CSS$supports;
|
11
|
+
return (_CSS = CSS) === null || _CSS === void 0 || (_CSS$supports = _CSS.supports) === null || _CSS$supports === void 0 ? void 0 : _CSS$supports.call(_CSS, 'anchor-name', 'none');
|
12
|
+
};
|
13
|
+
const getPositionArea = direction => {
|
14
|
+
switch (direction) {
|
15
|
+
case Directions.BOTTOM_RIGHT:
|
16
|
+
return ['block-end span-inline-end', '--bottom-right'];
|
17
|
+
case Directions.BOTTOM_LEFT:
|
18
|
+
return ['block-end span-inline-start', '--bottom-left'];
|
19
|
+
case Directions.BOTTOM_CENTER:
|
20
|
+
return ['block-end center', '--bottom-center'];
|
21
|
+
case Directions.TOP_CENTER:
|
22
|
+
return ['block-start center', '--top-center'];
|
23
|
+
case Directions.TOP_RIGHT:
|
24
|
+
return ['block-start span-inline-end', '--top-right'];
|
25
|
+
case Directions.TOP_LEFT:
|
26
|
+
return ['block-start span-inline-start', '--top-left'];
|
27
|
+
case Directions.RIGHT_CENTER:
|
28
|
+
return ['center inline-end', '--right-center'];
|
29
|
+
case Directions.RIGHT_TOP:
|
30
|
+
return ['span-block-start inline-end', '--right-top'];
|
31
|
+
case Directions.RIGHT_BOTTOM:
|
32
|
+
return ['span-block-end inline-end', '--right-bottom'];
|
33
|
+
case Directions.LEFT_CENTER:
|
34
|
+
return ['center inline-start', '--left-center'];
|
35
|
+
case Directions.LEFT_TOP:
|
36
|
+
return ['span-block-start inline-start', '--left-top'];
|
37
|
+
case Directions.LEFT_BOTTOM:
|
38
|
+
return ['span-block-end inline-start', '--left-bottom'];
|
39
|
+
default:
|
40
|
+
return ['block-end span-inline-end', '--bottom-right'];
|
41
|
+
}
|
42
|
+
};
|
43
|
+
const getPositionFallbacks = directions => {
|
44
|
+
return directions.slice(1).map(direction => getPositionArea(direction)[1]).join(', ');
|
45
|
+
};
|
46
|
+
const setCSSAnchorPositioning = _ref => {
|
47
|
+
let {
|
48
|
+
popup,
|
49
|
+
anchor,
|
50
|
+
uid,
|
51
|
+
minWidth,
|
52
|
+
top,
|
53
|
+
left,
|
54
|
+
directions,
|
55
|
+
offset
|
56
|
+
} = _ref;
|
57
|
+
const anchorName = anchor.style.getPropertyValue('anchor-name') || "--anchor-".concat(uid);
|
58
|
+
if (!anchor.style.getPropertyValue('anchor-name')) {
|
59
|
+
anchor.style.setProperty('anchor-name', anchorName);
|
60
|
+
}
|
61
|
+
popup.style.setProperty('position-anchor', anchorName);
|
62
|
+
const calculatedMinWidth = calculateMinWidth(getRect(anchor).width, minWidth);
|
63
|
+
if (calculatedMinWidth !== null) {
|
64
|
+
popup.style.minWidth = "".concat(calculatedMinWidth, "px");
|
65
|
+
}
|
66
|
+
if (top) {
|
67
|
+
popup.style.transform = "translateY(".concat(top, "px)");
|
68
|
+
}
|
69
|
+
if (left) {
|
70
|
+
popup.style.left = "".concat(left, "px");
|
71
|
+
}
|
72
|
+
const [initialPositionStyle, initialPositionName] = getPositionArea(directions[0]);
|
73
|
+
popup.style.setProperty('position-area', initialPositionStyle);
|
74
|
+
if (offset) {
|
75
|
+
popup.style.setProperty('--ring-popup-offset', "".concat(offset, "px"));
|
76
|
+
if (initialPositionName.startsWith('--bottom') || initialPositionName.startsWith('--top')) {
|
77
|
+
popup.style.margin = "".concat(offset, "px 0");
|
78
|
+
} else {
|
79
|
+
popup.style.margin = "0 ".concat(offset, "px");
|
80
|
+
}
|
81
|
+
}
|
82
|
+
// Add fallbacks for better positioning if there are multiple directions
|
83
|
+
const fallbacks = getPositionFallbacks(directions);
|
84
|
+
if (fallbacks) {
|
85
|
+
popup.style.setProperty('position-try-fallbacks', fallbacks);
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
export { setCSSAnchorPositioning, supportsCSSAnchorPositioning };
|
@@ -24,6 +24,7 @@ export interface PositionAttrs {
|
|
24
24
|
}
|
25
25
|
export declare const positionPropKeys: readonly ["directions", "autoPositioning", "autoCorrectTopOverflow", "sidePadding", "top", "left", "offset", "maxHeight", "minWidth"];
|
26
26
|
export declare function maxHeightForDirection(direction: Directions, anchorNode: Element, containerNode?: Element | null): number | null;
|
27
|
+
export declare function calculateMinWidth(anchorWidth: number, minWidth: PositionAttrs['minWidth']): number | null;
|
27
28
|
export default function position(attrs: PositionAttrs): {
|
28
29
|
styles: PositionStyles;
|
29
30
|
direction: Directions | null;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.sort.js';
|
3
3
|
import { getRect, isMounted, getDocumentScrollLeft, getDocumentScrollTop, getWindowHeight } from '../global/dom.js';
|
4
|
-
import { MaxHeight, Dimension,
|
4
|
+
import { MaxHeight, Dimension, Directions, MinWidth } from './popup.consts.js';
|
5
5
|
import 'core-js/modules/es.regexp.exec.js';
|
6
6
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
7
7
|
|
@@ -171,6 +171,14 @@ function maxHeightForDirection(direction, anchorNode, containerNode) {
|
|
171
171
|
return null;
|
172
172
|
}
|
173
173
|
}
|
174
|
+
function calculateMinWidth(anchorWidth, minWidth) {
|
175
|
+
if (minWidth === MinWidth.TARGET || minWidth === 'target') {
|
176
|
+
return anchorWidth;
|
177
|
+
} else if (minWidth) {
|
178
|
+
return anchorWidth < minWidth ? minWidth : anchorWidth;
|
179
|
+
}
|
180
|
+
return null;
|
181
|
+
}
|
174
182
|
function position(attrs) {
|
175
183
|
const {
|
176
184
|
popup,
|
@@ -250,10 +258,9 @@ function position(attrs) {
|
|
250
258
|
scroll
|
251
259
|
});
|
252
260
|
}
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
styles.minWidth = anchorRect.width < minWidth ? minWidth : anchorRect.width;
|
261
|
+
const newMinWidth = calculateMinWidth(anchorRect.width, minWidth);
|
262
|
+
if (newMinWidth !== null) {
|
263
|
+
styles.minWidth = newMinWidth;
|
257
264
|
}
|
258
265
|
return {
|
259
266
|
styles,
|
@@ -261,4 +268,4 @@ function position(attrs) {
|
|
261
268
|
};
|
262
269
|
}
|
263
270
|
|
264
|
-
export { Dimension, Directions, MaxHeight, MinWidth, position as default, maxHeightForDirection, positionPropKeys };
|
271
|
+
export { Dimension, Directions, MaxHeight, MinWidth, calculateMinWidth, position as default, maxHeightForDirection, positionPropKeys };
|
@@ -18,10 +18,12 @@ import '../global/sniffer.js';
|
|
18
18
|
import 'sniffr';
|
19
19
|
import '../global/data-tests.js';
|
20
20
|
import '../tab-trap/tab-trap.js';
|
21
|
+
import '../global/configuration.js';
|
21
22
|
import '../popup/position.js';
|
22
23
|
import 'core-js/modules/es.array.sort.js';
|
23
24
|
import '../popup/popup.consts.js';
|
24
25
|
import '../popup/popup.target.js';
|
26
|
+
import '../popup/position-css.js';
|
25
27
|
import 'core-js/modules/es.symbol.description.js';
|
26
28
|
import 'core-js/modules/es.string.trim.js';
|
27
29
|
import 'react-virtualized/dist/es/List';
|
@@ -21,10 +21,11 @@ import Shortcuts from '../shortcuts/shortcuts.js';
|
|
21
21
|
import rerenderHOC from '../global/rerender-hoc.js';
|
22
22
|
import { Button } from '../button/button.js';
|
23
23
|
import Icon from '../icon/icon.js';
|
24
|
-
import { ControlsHeightContext
|
24
|
+
import { ControlsHeightContext } from '../global/controls-height.js';
|
25
25
|
import { S as Size, i as inputStyles } from '../_helpers/input.js';
|
26
26
|
import { I18nContext } from '../i18n/i18n-context.js';
|
27
27
|
import { Q as QueryAssistSuggestions, s as styles } from '../_helpers/query-assist__suggestions.js';
|
28
|
+
import { ControlsHeight } from '../global/configuration.js';
|
28
29
|
import 'react-dom/server';
|
29
30
|
import '../popup/popup.js';
|
30
31
|
import 'react-dom';
|
@@ -34,6 +35,7 @@ import '../popup/position.js';
|
|
34
35
|
import 'core-js/modules/es.array.sort.js';
|
35
36
|
import '../popup/popup.consts.js';
|
36
37
|
import '../popup/popup.target.js';
|
38
|
+
import '../popup/position-css.js';
|
37
39
|
import '../list/list.js';
|
38
40
|
import 'core-js/modules/es.string.trim.js';
|
39
41
|
import 'react-virtualized/dist/es/List';
|
@@ -5,7 +5,7 @@ import { Size } from '../input/input';
|
|
5
5
|
import { LabelType } from '../control-label/control-label';
|
6
6
|
import { ListDataItem } from '../list/consts';
|
7
7
|
import { Directions } from '../popup/popup.consts';
|
8
|
-
import { ControlsHeight } from '../global/controls-height';
|
8
|
+
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
9
9
|
import SelectPopup, { Filter, FilterFn, Multiple, Tags } from './select__popup';
|
10
10
|
/**
|
11
11
|
* @name Select
|
@@ -206,7 +206,8 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
206
206
|
static getDerivedStateFromProps<T = unknown>(nextProps: SelectProps<T>, prevState: SelectState<T>): Partial<SelectState<T>>;
|
207
207
|
state: SelectState<T>;
|
208
208
|
componentDidUpdate(prevProps: SelectProps<T>, prevState: SelectState<T>): void;
|
209
|
-
static contextType: React.Context<ControlsHeight>;
|
209
|
+
static contextType: React.Context<ControlsHeight | (() => ControlsHeight)>;
|
210
|
+
context: React.ContextType<typeof ControlsHeightContext>;
|
210
211
|
static Type: typeof Type;
|
211
212
|
static Size: typeof Size;
|
212
213
|
id: string;
|
@@ -25,8 +25,9 @@ import memoize from '../global/memoize.js';
|
|
25
25
|
import { I18nContext } from '../i18n/i18n-context.js';
|
26
26
|
import { createComposedRef } from '../global/composeRefs.js';
|
27
27
|
import { isArray } from '../global/typescript-utils.js';
|
28
|
-
import { ControlsHeightContext
|
28
|
+
import { ControlsHeightContext } from '../global/controls-height.js';
|
29
29
|
import SelectPopup from './select__popup.js';
|
30
|
+
import { ControlsHeight } from '../global/configuration.js';
|
30
31
|
import { Size as Size$1 } from '../avatar/avatar-size.js';
|
31
32
|
import { A as Anchor } from '../_helpers/anchor.js';
|
32
33
|
import '@jetbrains/icons/chevron-12px-down';
|
@@ -47,6 +48,7 @@ import '../popup/position.js';
|
|
47
48
|
import 'core-js/modules/es.array.sort.js';
|
48
49
|
import '../popup/popup.consts.js';
|
49
50
|
import '../popup/popup.target.js';
|
51
|
+
import '../popup/position-css.js';
|
50
52
|
import '../shortcuts/core.js';
|
51
53
|
import 'combokeys';
|
52
54
|
import '../global/sniffer.js';
|
@@ -889,7 +891,7 @@ class Select extends Component {
|
|
889
891
|
hideArrow
|
890
892
|
} = this.props;
|
891
893
|
const icons = [];
|
892
|
-
const height = this.props.height || this.context;
|
894
|
+
const height = this.props.height || (typeof this.context === 'function' ? this.context() : this.context);
|
893
895
|
if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {
|
894
896
|
icons.push(jsx("button", {
|
895
897
|
title: "Toggle options popup",
|
@@ -21,6 +21,7 @@ import 'core-js/modules/es.string.replace.js';
|
|
21
21
|
import '../global/memoize.js';
|
22
22
|
import '../link/clickableLink.js';
|
23
23
|
import '../global/controls-height.js';
|
24
|
+
import '../global/configuration.js';
|
24
25
|
import '../_helpers/button__classes.js';
|
25
26
|
import '../global/get-uid.js';
|
26
27
|
import '../global/composeRefs.js';
|
@@ -20,10 +20,11 @@ import Caret from '../caret/caret.js';
|
|
20
20
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
21
21
|
import { Button } from '../button/button.js';
|
22
22
|
import Text from '../text/text.js';
|
23
|
-
import
|
23
|
+
import '../global/controls-height.js';
|
24
24
|
import { createComposedRef } from '../global/composeRefs.js';
|
25
25
|
import { DEFAULT_DIRECTIONS } from '../popup/popup.consts.js';
|
26
26
|
import { s as styles, S as SelectFilter } from '../_helpers/select__filter.js';
|
27
|
+
import { ControlsHeight } from '../global/configuration.js';
|
27
28
|
import 'util-deprecate';
|
28
29
|
import '../icon/icon__constants.js';
|
29
30
|
import '../_helpers/icon__svg.js';
|
@@ -33,6 +34,7 @@ import 'react-dom';
|
|
33
34
|
import '../global/schedule-raf.js';
|
34
35
|
import '../global/data-tests.js';
|
35
36
|
import '../tab-trap/tab-trap.js';
|
37
|
+
import '../popup/position-css.js';
|
36
38
|
import 'core-js/modules/es.array.sort.js';
|
37
39
|
import 'core-js/modules/es.symbol.description.js';
|
38
40
|
import 'core-js/modules/es.string.trim.js';
|
@@ -27,6 +27,7 @@ import '@jetbrains/icons/chevron-down';
|
|
27
27
|
import '@jetbrains/icons/chevron-12px-down';
|
28
28
|
import '../link/clickableLink.js';
|
29
29
|
import '../global/controls-height.js';
|
30
|
+
import '../global/configuration.js';
|
30
31
|
import '../_helpers/button__classes.js';
|
31
32
|
import '../_helpers/theme.js';
|
32
33
|
import 'react-dom';
|
@@ -42,6 +43,7 @@ import '../tab-trap/tab-trap.js';
|
|
42
43
|
import '../popup/position.js';
|
43
44
|
import 'core-js/modules/es.array.sort.js';
|
44
45
|
import '../popup/popup.consts.js';
|
46
|
+
import '../popup/position-css.js';
|
45
47
|
import '../alert/container.js';
|
46
48
|
|
47
49
|
|
@@ -26,6 +26,7 @@ import '@jetbrains/icons/chevron-down';
|
|
26
26
|
import '@jetbrains/icons/chevron-12px-down';
|
27
27
|
import '../link/clickableLink.js';
|
28
28
|
import '../global/controls-height.js';
|
29
|
+
import '../global/configuration.js';
|
29
30
|
import '../_helpers/button__classes.js';
|
30
31
|
import '../_helpers/theme.js';
|
31
32
|
import 'react-dom';
|
@@ -41,6 +42,7 @@ import '../tab-trap/tab-trap.js';
|
|
41
42
|
import '../popup/position.js';
|
42
43
|
import 'core-js/modules/es.array.sort.js';
|
43
44
|
import '../popup/popup.consts.js';
|
45
|
+
import '../popup/position-css.js';
|
44
46
|
import '../alert/container.js';
|
45
47
|
|
46
48
|
/**
|