@jetbrains/ring-ui 6.0.81 → 6.0.83
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.
|
@@ -8,7 +8,7 @@ export interface AlertItem extends Partial<Omit<AlertProps, 'children'>> {
|
|
|
8
8
|
/**
|
|
9
9
|
* @name Alert Service
|
|
10
10
|
*/
|
|
11
|
-
declare class AlertService {
|
|
11
|
+
export declare class AlertService {
|
|
12
12
|
defaultTimeout: number;
|
|
13
13
|
showingAlerts: AlertItem[];
|
|
14
14
|
containerElement: HTMLDivElement;
|
|
@@ -4,7 +4,7 @@ import Alert, { ANIMATION_TIME, Container as AlertContainer } from '../alert/ale
|
|
|
4
4
|
/**
|
|
5
5
|
* @name Alert Service
|
|
6
6
|
*/
|
|
7
|
-
class AlertService {
|
|
7
|
+
export class AlertService {
|
|
8
8
|
defaultTimeout = 0;
|
|
9
9
|
// This alerts are stored in inverse order (last shown is first in array)
|
|
10
10
|
showingAlerts = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDocumentScrollLeft, getDocumentScrollTop, getRect,
|
|
1
|
+
import { getDocumentScrollLeft, getDocumentScrollTop, getRect, isMounted } from '../global/dom';
|
|
2
2
|
import { Dimension, Directions, MaxHeight, MinWidth } from './popup.consts';
|
|
3
3
|
export { Dimension, Directions, MaxHeight, MinWidth };
|
|
4
4
|
function getScrollingCoordinates(container) {
|
|
@@ -42,7 +42,7 @@ function getPositionStyles(popup, anchorRect, anchorLeft, anchorTop, offset) {
|
|
|
42
42
|
function verticalOverflow(styles, scrollingCoordinates, attrs) {
|
|
43
43
|
const containerHeight = attrs.container !== null
|
|
44
44
|
? attrs.container.clientHeight
|
|
45
|
-
:
|
|
45
|
+
: document.documentElement.clientHeight;
|
|
46
46
|
const viewportMinX = scrollingCoordinates.top + attrs.sidePadding;
|
|
47
47
|
const viewportMaxX = scrollingCoordinates.top + containerHeight - attrs.sidePadding;
|
|
48
48
|
const topOverflow = Math.max(viewportMinX - styles.top, 0);
|
|
@@ -52,7 +52,9 @@ function verticalOverflow(styles, scrollingCoordinates, attrs) {
|
|
|
52
52
|
return topOverflow + bottomOverflow;
|
|
53
53
|
}
|
|
54
54
|
function horizontalOverflow(styles, scrollingCoordinates, attrs) {
|
|
55
|
-
const containerWidth = attrs.container !== null
|
|
55
|
+
const containerWidth = attrs.container !== null
|
|
56
|
+
? attrs.container.clientWidth
|
|
57
|
+
: document.documentElement.clientWidth;
|
|
56
58
|
const viewportMinY = scrollingCoordinates.left + attrs.sidePadding;
|
|
57
59
|
const viewportMaxY = scrollingCoordinates.left + containerWidth - attrs.sidePadding;
|
|
58
60
|
const leftOverflow = Math.max(viewportMinY - styles.left, 0);
|