@ringcentral/juno 2.4.0 → 2.5.0-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/components/Downshift/SuggestionList/SuggestionList.d.ts +74 -2
- package/components/Downshift/SuggestionList/SuggestionList.js +4 -1
- package/components/Grid/Grid.d.ts +1 -1
- package/components/Pagination/Pagination/Pagination.d.ts +1 -1
- package/components/Stepper/StepButton/StepButton.d.ts +1 -1
- package/components/Stepper/StepLabel/StepLabel.d.ts +1 -1
- package/components/Table/TableCell/styles/TableCellStyle.js +3 -1
- package/components/Table/types.d.ts +1 -1
- package/components/TablePagination/TablePagination.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenu.js +11 -0
- package/components/VirtualizedMenu/VirtualizedMenuList.js +7 -14
- package/components/Virtuoso/react-virtuoso/AATree.js +15 -15
- package/components/Virtuoso/react-virtuoso/Grid.d.ts +193 -106
- package/components/Virtuoso/react-virtuoso/Grid.js +19 -24
- package/components/Virtuoso/react-virtuoso/List.d.ts +2664 -596
- package/components/Virtuoso/react-virtuoso/List.js +83 -70
- package/components/Virtuoso/react-virtuoso/Table.d.ts +6253 -0
- package/components/Virtuoso/react-virtuoso/Table.js +184 -0
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +153 -37
- package/components/Virtuoso/react-virtuoso/components.d.ts +248 -41
- package/components/Virtuoso/react-virtuoso/components.js +2 -0
- package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +2 -4
- package/components/Virtuoso/react-virtuoso/domIOSystem.js +12 -10
- package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +146 -27
- package/components/Virtuoso/react-virtuoso/followOutputSystem.js +28 -15
- package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +67 -52
- package/components/Virtuoso/react-virtuoso/gridSystem.js +17 -15
- package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +17 -3
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +2 -1
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +32 -7
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +40 -26
- package/components/Virtuoso/react-virtuoso/hooks/useSize.d.ts +2 -2
- package/components/Virtuoso/react-virtuoso/hooks/useSize.js +26 -28
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +32 -12
- package/components/Virtuoso/react-virtuoso/index.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/index.js +2 -0
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +165 -35
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +1 -8
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +160 -38
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +54 -12
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +26 -10
- package/components/Virtuoso/react-virtuoso/interfaces.d.ts +134 -28
- package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +141 -32
- package/components/Virtuoso/react-virtuoso/listStateSystem.js +1 -2
- package/components/Virtuoso/react-virtuoso/listSystem.d.ts +2123 -407
- package/components/Virtuoso/react-virtuoso/listSystem.js +10 -7
- package/components/Virtuoso/react-virtuoso/loggerSystem.d.ts +17 -0
- package/components/Virtuoso/react-virtuoso/loggerSystem.js +37 -0
- package/components/Virtuoso/react-virtuoso/propsReadySystem.d.ts +8 -1
- package/components/Virtuoso/react-virtuoso/propsReadySystem.js +8 -2
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +641 -0
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +42 -0
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +52 -67
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +11 -25
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +26 -5
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +37 -13
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +11 -4
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +44 -15
- package/components/Virtuoso/react-virtuoso/sizeSystem.d.ts +12 -2
- package/components/Virtuoso/react-virtuoso/sizeSystem.js +109 -52
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +17 -5
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +87 -18
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +145 -33
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +149 -35
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +183 -42
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +37 -26
- package/components/Virtuoso/react-virtuoso/utils/correctItemSize.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/correctItemSize.js +6 -0
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +7 -4
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +9 -7
- package/components/Virtuoso/utils/useHighlightScroll.d.ts +4 -0
- package/components/Virtuoso/utils/useHighlightScroll.js +17 -0
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +5 -2
- package/es6/components/Table/TableCell/TableCell.js +2 -2
- package/es6/components/Table/TableCell/styles/TableCellStyle.js +3 -1
- package/es6/components/VirtualizedMenu/VirtualizedMenu.js +13 -2
- package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +9 -16
- package/es6/components/Virtuoso/react-virtuoso/AATree.js +15 -15
- package/es6/components/Virtuoso/react-virtuoso/Grid.js +20 -25
- package/es6/components/Virtuoso/react-virtuoso/List.js +84 -72
- package/es6/components/Virtuoso/react-virtuoso/Table.js +182 -0
- package/es6/components/Virtuoso/react-virtuoso/components.js +2 -0
- package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +13 -10
- package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +28 -15
- package/es6/components/Virtuoso/react-virtuoso/gridSystem.js +17 -15
- package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +31 -6
- package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +40 -26
- package/es6/components/Virtuoso/react-virtuoso/hooks/useSize.js +27 -29
- package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +32 -12
- package/es6/components/Virtuoso/react-virtuoso/index.js +1 -0
- package/es6/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +1 -8
- package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +25 -10
- package/es6/components/Virtuoso/react-virtuoso/listStateSystem.js +2 -3
- package/es6/components/Virtuoso/react-virtuoso/listSystem.js +10 -7
- package/es6/components/Virtuoso/react-virtuoso/loggerSystem.js +34 -0
- package/es6/components/Virtuoso/react-virtuoso/propsReadySystem.js +9 -2
- package/es6/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +40 -0
- package/es6/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +11 -25
- package/es6/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +37 -13
- package/es6/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +39 -11
- package/es6/components/Virtuoso/react-virtuoso/sizeSystem.js +109 -52
- package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +87 -18
- package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +39 -28
- package/es6/components/Virtuoso/react-virtuoso/utils/correctItemSize.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +9 -7
- package/es6/components/Virtuoso/utils/useHighlightScroll.js +16 -0
- package/es6/foundation/index.js +1 -1
- package/es6/foundation/isWebKit154.js +57 -0
- package/es6/foundation/theme/ThemeProvider.js +4 -4
- package/foundation/index.d.ts +1 -1
- package/foundation/index.js +1 -1
- package/foundation/isWebKit154.d.ts +20 -0
- package/foundation/isWebKit154.js +59 -0
- package/foundation/theme/ThemeProvider.d.ts +6 -0
- package/foundation/theme/ThemeProvider.js +4 -4
- package/package.json +2 -2
- package/es6/foundation/isSafari154.js +0 -50
- package/foundation/isSafari154.d.ts +0 -15
- package/foundation/isSafari154.js +0 -52
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { __read } from "tslib";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
3
|
import * as u from '@virtuoso.dev/urx';
|
|
3
4
|
import { domIOSystem } from './domIOSystem';
|
|
5
|
+
export var UP = 'up';
|
|
6
|
+
export var DOWN = 'down';
|
|
7
|
+
export var NONE = 'none';
|
|
4
8
|
var INITIAL_BOTTOM_STATE = {
|
|
5
9
|
atBottom: false,
|
|
6
10
|
notAtBottomBecause: 'NOT_SHOWING_LAST_ITEM',
|
|
@@ -8,42 +12,54 @@ var INITIAL_BOTTOM_STATE = {
|
|
|
8
12
|
offsetBottom: 0,
|
|
9
13
|
scrollTop: 0,
|
|
10
14
|
viewportHeight: 0,
|
|
11
|
-
|
|
15
|
+
scrollHeight: 0,
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
export var stateFlagsSystem = u.system(function (_a) {
|
|
15
|
-
var _b = __read(_a, 1), _c = _b[0], scrollTop = _c.scrollTop, viewportHeight = _c.viewportHeight;
|
|
19
|
+
var _b = __read(_a, 1), _c = _b[0], scrollContainerState = _c.scrollContainerState, scrollTop = _c.scrollTop, viewportHeight = _c.viewportHeight, headerHeight = _c.headerHeight, footerHeight = _c.footerHeight, scrollBy = _c.scrollBy;
|
|
16
20
|
var isAtBottom = u.statefulStream(false);
|
|
17
21
|
var isAtTop = u.statefulStream(true);
|
|
18
22
|
var atBottomStateChange = u.stream();
|
|
19
23
|
var atTopStateChange = u.stream();
|
|
20
|
-
var
|
|
24
|
+
var atBottomThreshold = u.statefulStream(4);
|
|
21
25
|
// skip 1 to avoid an initial on/off flick
|
|
22
26
|
var isScrolling = u.streamFromEmitter(u.pipe(u.merge(u.pipe(u.duc(scrollTop), u.skip(1), u.mapTo(true)), u.pipe(u.duc(scrollTop), u.skip(1), u.mapTo(false), u.debounceTime(100))), u.distinctUntilChanged()));
|
|
27
|
+
var isScrollingBy = u.statefulStreamFromEmitter(u.pipe(u.merge(u.pipe(scrollBy, u.mapTo(true)), u.pipe(scrollBy, u.mapTo(false), u.debounceTime(200))), u.distinctUntilChanged()), false);
|
|
28
|
+
// u.subscribe(isScrollingBy, (isScrollingBy) => console.log({ isScrollingBy }))
|
|
23
29
|
u.connect(u.pipe(u.duc(scrollTop), u.map(function (top) { return top === 0; }), u.distinctUntilChanged()), isAtTop);
|
|
24
30
|
u.connect(isAtTop, atTopStateChange);
|
|
25
|
-
var atBottomState = u.streamFromEmitter(u.pipe(u.combineLatest(
|
|
26
|
-
var _b = __read(_a,
|
|
27
|
-
var isAtBottom =
|
|
31
|
+
var atBottomState = u.streamFromEmitter(u.pipe(u.combineLatest(scrollContainerState, u.duc(viewportHeight), u.duc(headerHeight), u.duc(footerHeight), u.duc(atBottomThreshold)), u.scan(function (current, _a) {
|
|
32
|
+
var _b = __read(_a, 5), _c = __read(_b[0], 2), scrollTop = _c[0], scrollHeight = _c[1], viewportHeight = _b[1], _headerHeight = _b[2], _footerHeight = _b[3], atBottomThreshold = _b[4];
|
|
33
|
+
var isAtBottom = scrollTop + viewportHeight - scrollHeight > -atBottomThreshold;
|
|
28
34
|
var state = {
|
|
29
35
|
viewportHeight: viewportHeight,
|
|
30
36
|
scrollTop: scrollTop,
|
|
31
|
-
|
|
32
|
-
totalHeight: bottom + offsetBottom,
|
|
37
|
+
scrollHeight: scrollHeight,
|
|
33
38
|
};
|
|
34
39
|
if (isAtBottom) {
|
|
40
|
+
var atBottomBecause = void 0;
|
|
41
|
+
var scrollTopDelta = void 0;
|
|
42
|
+
if (scrollTop > current.state.scrollTop) {
|
|
43
|
+
atBottomBecause = 'SCROLLED_DOWN';
|
|
44
|
+
scrollTopDelta = current.state.scrollTop - scrollTop;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
atBottomBecause = 'SIZE_DECREASED';
|
|
48
|
+
scrollTopDelta =
|
|
49
|
+
current.state.scrollTop - scrollTop ||
|
|
50
|
+
current.scrollTopDelta;
|
|
51
|
+
}
|
|
35
52
|
return {
|
|
36
53
|
atBottom: true,
|
|
37
54
|
state: state,
|
|
55
|
+
atBottomBecause: atBottomBecause,
|
|
56
|
+
scrollTopDelta: scrollTopDelta,
|
|
38
57
|
};
|
|
39
58
|
}
|
|
40
59
|
var notAtBottomBecause;
|
|
41
|
-
if (state.
|
|
60
|
+
if (state.scrollHeight > current.state.scrollHeight) {
|
|
42
61
|
notAtBottomBecause = 'SIZE_INCREASED';
|
|
43
62
|
}
|
|
44
|
-
else if (offsetBottom !== 0) {
|
|
45
|
-
notAtBottomBecause = 'NOT_SHOWING_LAST_ITEM';
|
|
46
|
-
}
|
|
47
63
|
else if (viewportHeight < current.state.viewportHeight) {
|
|
48
64
|
notAtBottomBecause = 'VIEWPORT_HEIGHT_DECREASING';
|
|
49
65
|
}
|
|
@@ -59,14 +75,64 @@ export var stateFlagsSystem = u.system(function (_a) {
|
|
|
59
75
|
state: state,
|
|
60
76
|
};
|
|
61
77
|
}, INITIAL_BOTTOM_STATE), u.distinctUntilChanged(function (prev, next) {
|
|
62
|
-
// prev && console.log(prev.atBottom, next.atBottom)
|
|
63
78
|
return prev && prev.atBottom === next.atBottom;
|
|
64
79
|
})));
|
|
80
|
+
var lastJumpDueToItemResize = u.statefulStreamFromEmitter(u.pipe(scrollContainerState, u.scan(function (current, _a) {
|
|
81
|
+
var _b = __read(_a, 2), scrollTop = _b[0], scrollHeight = _b[1];
|
|
82
|
+
if (current.scrollHeight !== scrollHeight) {
|
|
83
|
+
if (current.scrollTop !== scrollTop) {
|
|
84
|
+
return {
|
|
85
|
+
scrollHeight: scrollHeight,
|
|
86
|
+
scrollTop: scrollTop,
|
|
87
|
+
jump: current.scrollTop - scrollTop,
|
|
88
|
+
changed: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
scrollHeight: scrollHeight,
|
|
93
|
+
scrollTop: scrollTop,
|
|
94
|
+
jump: 0,
|
|
95
|
+
changed: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
scrollTop: scrollTop,
|
|
100
|
+
scrollHeight: scrollHeight,
|
|
101
|
+
jump: 0,
|
|
102
|
+
changed: false,
|
|
103
|
+
};
|
|
104
|
+
}, { scrollHeight: 0, jump: 0, scrollTop: 0, changed: false }), u.filter(function (value) { return value.changed; }), u.map(function (value) { return value.jump; })), 0);
|
|
65
105
|
u.connect(u.pipe(atBottomState, u.map(function (state) { return state.atBottom; })), isAtBottom);
|
|
66
|
-
u.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
106
|
+
u.connect(u.pipe(isAtBottom, u.throttleTime(50)), atBottomStateChange);
|
|
107
|
+
var scrollDirection = u.statefulStream(DOWN);
|
|
108
|
+
u.connect(u.pipe(scrollContainerState, u.map(function (_a) {
|
|
109
|
+
var _b = __read(_a, 1), scrollTop = _b[0];
|
|
110
|
+
return scrollTop;
|
|
111
|
+
}), u.distinctUntilChanged(), u.scan(function (acc, scrollTop) {
|
|
112
|
+
// if things change while compensating for items, ignore,
|
|
113
|
+
// but store the new scrollTop
|
|
114
|
+
if (u.getValue(isScrollingBy)) {
|
|
115
|
+
return { direction: acc.direction, prevScrollTop: scrollTop };
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
direction: scrollTop < acc.prevScrollTop ? UP : DOWN,
|
|
119
|
+
prevScrollTop: scrollTop,
|
|
120
|
+
};
|
|
121
|
+
}, { direction: DOWN, prevScrollTop: 0 }), u.map(function (value) { return value.direction; })), scrollDirection);
|
|
122
|
+
u.connect(u.pipe(scrollContainerState, u.throttleTime(50), u.mapTo(NONE)), scrollDirection);
|
|
123
|
+
var scrollVelocity = u.statefulStream(0);
|
|
124
|
+
u.connect(u.pipe(isScrolling, u.filter(function (value) { return !value; }), u.mapTo(0)), scrollVelocity);
|
|
125
|
+
u.connect(u.pipe(scrollTop, u.throttleTime(100), u.withLatestFrom(isScrolling), u.filter(function (_a) {
|
|
126
|
+
var _b = __read(_a, 2), _ = _b[0], isScrolling = _b[1];
|
|
127
|
+
return !!isScrolling;
|
|
128
|
+
}), u.scan(function (_a, _b) {
|
|
129
|
+
var _c = __read(_a, 2), _ = _c[0], prev = _c[1];
|
|
130
|
+
var _d = __read(_b, 1), next = _d[0];
|
|
131
|
+
return [prev, next];
|
|
132
|
+
}, [0, 0]), u.map(function (_a) {
|
|
133
|
+
var _b = __read(_a, 2), prev = _b[0], next = _b[1];
|
|
134
|
+
return next - prev;
|
|
135
|
+
})), scrollVelocity);
|
|
70
136
|
return {
|
|
71
137
|
isScrolling: isScrolling,
|
|
72
138
|
isAtTop: isAtTop,
|
|
@@ -74,6 +140,9 @@ export var stateFlagsSystem = u.system(function (_a) {
|
|
|
74
140
|
atBottomState: atBottomState,
|
|
75
141
|
atTopStateChange: atTopStateChange,
|
|
76
142
|
atBottomStateChange: atBottomStateChange,
|
|
77
|
-
|
|
143
|
+
scrollDirection: scrollDirection,
|
|
144
|
+
atBottomThreshold: atBottomThreshold,
|
|
145
|
+
scrollVelocity: scrollVelocity,
|
|
146
|
+
lastJumpDueToItemResize: lastJumpDueToItemResize,
|
|
78
147
|
};
|
|
79
148
|
}, u.tup(domIOSystem));
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { __read } from "tslib";
|
|
2
2
|
/* eslint-disable no-continue */
|
|
3
3
|
import * as u from '@virtuoso.dev/urx';
|
|
4
|
-
import { domIOSystem
|
|
4
|
+
import { domIOSystem } from './domIOSystem';
|
|
5
5
|
import { listStateSystem } from './listStateSystem';
|
|
6
|
+
import { loggerSystem, LogLevel } from './loggerSystem';
|
|
6
7
|
import { sizeSystem } from './sizeSystem';
|
|
7
|
-
import { stateFlagsSystem } from './stateFlagsSystem';
|
|
8
|
+
import { stateFlagsSystem, UP } from './stateFlagsSystem';
|
|
8
9
|
/**
|
|
9
10
|
* Fixes upward scrolling by calculating and compensation from changed item heights, using scrollBy.
|
|
10
11
|
*/
|
|
11
12
|
export var upwardScrollFixSystem = u.system(function (_a) {
|
|
12
|
-
var _b = __read(_a,
|
|
13
|
-
var deviationOffset = u.streamFromEmitter(u.pipe(listState, u.withLatestFrom(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _c = __read(_a, 2), prevItems = _c[1];
|
|
21
|
-
var items = _b.items;
|
|
13
|
+
var _b = __read(_a, 5), _c = _b[0], scrollBy = _c.scrollBy, scrollTop = _c.scrollTop, deviation = _c.deviation, scrollingInProgress = _c.scrollingInProgress, _d = _b[1], isScrolling = _d.isScrolling, isAtBottom = _d.isAtBottom, atBottomState = _d.atBottomState, scrollDirection = _d.scrollDirection, lastJumpDueToItemResize = _d.lastJumpDueToItemResize, listState = _b[2].listState, _e = _b[3], beforeUnshiftWith = _e.beforeUnshiftWith, shiftWithOffset = _e.shiftWithOffset, sizes = _e.sizes, log = _b[4].log;
|
|
14
|
+
var deviationOffset = u.streamFromEmitter(u.pipe(listState, u.withLatestFrom(lastJumpDueToItemResize), u.scan(function (_a,
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
_b) {
|
|
17
|
+
var _c = __read(_a, 3), prevItems = _c[1], prevTotalCount = _c[2];
|
|
18
|
+
var
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
_d = __read(_b, 2), _e = _d[0], items = _e.items, totalCount = _e.totalCount, lastJumpDueToItemResize = _d[1];
|
|
22
21
|
var newDev = 0;
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
newDev = items[0].size - prevItems[0].size;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
22
|
+
if (prevTotalCount === totalCount) {
|
|
23
|
+
if (prevItems.length > 0 && items.length > 0) {
|
|
24
|
+
var firstItemIndex = items[0].originalIndex;
|
|
25
|
+
var prevFirstItemIndex = prevItems[0].originalIndex;
|
|
26
|
+
var atStart = firstItemIndex === 0 && prevFirstItemIndex === 0;
|
|
27
|
+
var onlyItem = items.length === 1;
|
|
28
|
+
if (!atStart) {
|
|
33
29
|
var _loop_1 = function (index) {
|
|
34
30
|
var item = items[index];
|
|
35
31
|
var prevItem = prevItems.find(function (pItem) { return pItem.originalIndex === item.originalIndex; });
|
|
36
32
|
if (!prevItem) {
|
|
37
33
|
return "continue";
|
|
38
34
|
}
|
|
39
|
-
if (item.offset !== prevItem.offset) {
|
|
40
|
-
newDev =
|
|
35
|
+
if (item.offset !== prevItem.offset || onlyItem) {
|
|
36
|
+
newDev =
|
|
37
|
+
item.offset -
|
|
38
|
+
prevItem.offset +
|
|
39
|
+
item.size -
|
|
40
|
+
prevItem.size;
|
|
41
41
|
return "break";
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -48,13 +48,21 @@ export var upwardScrollFixSystem = u.system(function (_a) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
if (newDev !== 0) {
|
|
52
|
+
newDev += lastJumpDueToItemResize;
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
|
-
return [newDev, items];
|
|
53
|
-
}, [0, []]), u.filter(function (_a) {
|
|
55
|
+
return [newDev, items, totalCount];
|
|
56
|
+
}, [0, [], 0]), u.filter(function (_a) {
|
|
54
57
|
var _b = __read(_a, 1), amount = _b[0];
|
|
55
58
|
return amount !== 0;
|
|
59
|
+
}), u.withLatestFrom(scrollTop, scrollDirection, scrollingInProgress, log, isAtBottom, atBottomState), u.filter(function (_a) {
|
|
60
|
+
var _b = __read(_a, 4), scrollTop = _b[1], scrollDirection = _b[2], scrollingInProgress = _b[3];
|
|
61
|
+
// console.log({ amount, scrollTop, scrollDirection, scrollingInProgress, isAtBottom, atBottomState })
|
|
62
|
+
return (!scrollingInProgress && scrollTop !== 0 && scrollDirection === UP); // && (isAtBottom ? amount > 0 : true)
|
|
56
63
|
}), u.map(function (_a) {
|
|
57
|
-
var _b = __read(_a, 1), amount =
|
|
64
|
+
var _b = __read(_a, 5), _c = __read(_b[0], 1), amount = _c[0], log = _b[4];
|
|
65
|
+
log('Upward scrolling compensation', { amount: amount }, LogLevel.DEBUG);
|
|
58
66
|
return amount;
|
|
59
67
|
})));
|
|
60
68
|
u.connect(u.pipe(deviationOffset, u.withLatestFrom(deviation), u.map(function (_a) {
|
|
@@ -79,9 +87,12 @@ export var upwardScrollFixSystem = u.system(function (_a) {
|
|
|
79
87
|
u.publish(scrollBy, { top: -offset, behavior: 'auto' });
|
|
80
88
|
}
|
|
81
89
|
});
|
|
90
|
+
u.connect(u.pipe(shiftWithOffset, u.map(function (offset) {
|
|
91
|
+
return { top: -offset };
|
|
92
|
+
})), scrollBy);
|
|
82
93
|
u.connect(u.pipe(beforeUnshiftWith, u.withLatestFrom(sizes), u.map(function (_a) {
|
|
83
94
|
var _b = __read(_a, 2), offset = _b[0], lastSize = _b[1].lastSize;
|
|
84
95
|
return offset * lastSize;
|
|
85
96
|
})), deviationOffset);
|
|
86
97
|
return { deviation: deviation };
|
|
87
|
-
}, u.tup(domIOSystem, stateFlagsSystem, listStateSystem, sizeSystem));
|
|
98
|
+
}, u.tup(domIOSystem, stateFlagsSystem, listStateSystem, sizeSystem, loggerSystem));
|
|
@@ -2,15 +2,16 @@ import { __assign, __read } from "tslib";
|
|
|
2
2
|
import * as u from '@virtuoso.dev/urx';
|
|
3
3
|
import { domIOSystem } from './domIOSystem';
|
|
4
4
|
export var windowScrollerSystem = u.system(function (_a) {
|
|
5
|
-
var _b = __read(_a, 1), _c = _b[0],
|
|
5
|
+
var _b = __read(_a, 1), _c = _b[0], scrollTo = _c.scrollTo, scrollContainerState = _c.scrollContainerState;
|
|
6
|
+
var windowScrollContainerState = u.stream();
|
|
6
7
|
var windowViewportRect = u.stream();
|
|
7
|
-
var windowScrollTop = u.stream();
|
|
8
8
|
var windowScrollTo = u.stream();
|
|
9
9
|
var useWindowScroll = u.statefulStream(false);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var customScrollParent = u.statefulStream(undefined);
|
|
11
|
+
u.connect(u.pipe(u.combineLatest(windowScrollContainerState, windowViewportRect), u.map(function (_a) {
|
|
12
|
+
var _b = __read(_a, 2), _c = __read(_b[0], 2), windowScrollTop = _c[0], scrollHeight = _c[1], offsetTop = _b[1].offsetTop;
|
|
13
|
+
return [Math.max(0, windowScrollTop - offsetTop), scrollHeight];
|
|
14
|
+
})), scrollContainerState);
|
|
14
15
|
u.connect(u.pipe(scrollTo, u.withLatestFrom(windowViewportRect), u.map(function (_a) {
|
|
15
16
|
var _b = __read(_a, 2), scrollTo = _b[0], offsetTop = _b[1].offsetTop;
|
|
16
17
|
return __assign(__assign({}, scrollTo), { top: scrollTo.top + offsetTop });
|
|
@@ -18,8 +19,9 @@ export var windowScrollerSystem = u.system(function (_a) {
|
|
|
18
19
|
return {
|
|
19
20
|
// config
|
|
20
21
|
useWindowScroll: useWindowScroll,
|
|
22
|
+
customScrollParent: customScrollParent,
|
|
21
23
|
// input
|
|
22
|
-
|
|
24
|
+
windowScrollContainerState: windowScrollContainerState,
|
|
23
25
|
windowViewportRect: windowViewportRect,
|
|
24
26
|
// signals
|
|
25
27
|
windowScrollTo: windowScrollTo,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
|
+
import { fixWebKitTransitionStyle } from '../../../foundation';
|
|
2
3
|
/**
|
|
3
4
|
* scroll into current highlight index
|
|
4
5
|
*/
|
|
@@ -98,3 +99,18 @@ export function useHighlightScroll(_a) {
|
|
|
98
99
|
itemsRendered: function (e) { return (renderedItemsRef.current = e); },
|
|
99
100
|
};
|
|
100
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* modify virtuoso style to fix safari scroll bug
|
|
104
|
+
*/
|
|
105
|
+
export function modifyVlScrollerStyle(scrollElm, position) {
|
|
106
|
+
if (position === void 0) { position = 'absolute'; }
|
|
107
|
+
if (scrollElm) {
|
|
108
|
+
scrollElm.style.transition = fixWebKitTransitionStyle;
|
|
109
|
+
if (position) {
|
|
110
|
+
var viewPortElm = scrollElm.firstChild;
|
|
111
|
+
if (viewPortElm) {
|
|
112
|
+
viewPortElm.style.position = position;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
package/es6/foundation/index.js
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { createGlobalStyle } from 'styled-components';
|
|
3
|
+
import { RcClasses } from './utils/classes';
|
|
4
|
+
import { combineProps } from './utils/combineProps';
|
|
5
|
+
// * this whole file should be remove after webkit154 issue be fixed
|
|
6
|
+
/**
|
|
7
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
8
|
+
* Remove this workaround once the WebKit bug fix is released.
|
|
9
|
+
*
|
|
10
|
+
* follow up:
|
|
11
|
+
* https://github.com/mui/material-ui/pull/31975/files
|
|
12
|
+
* https://github.com/mui/material-ui/pull/32202/files
|
|
13
|
+
*/
|
|
14
|
+
export var isWebKit154 = typeof navigator !== 'undefined' &&
|
|
15
|
+
/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) &&
|
|
16
|
+
/(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);
|
|
17
|
+
var FixWebKit154Classes = RcClasses(['paper'], 'RcFixWebKit154');
|
|
18
|
+
/**
|
|
19
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
20
|
+
* Remove this workaround once the Safari bug is fixed.
|
|
21
|
+
*/
|
|
22
|
+
export var getWebKit154Theme = function (theme, enable) {
|
|
23
|
+
if (enable !== null && enable !== void 0 ? enable : isWebKit154) {
|
|
24
|
+
return combineProps({
|
|
25
|
+
props: {
|
|
26
|
+
// * set all grow related to only have one transition to make animation not shake after safari 15.4
|
|
27
|
+
MuiMenu: {
|
|
28
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
29
|
+
},
|
|
30
|
+
RcVirtualizedMenu: {
|
|
31
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
32
|
+
},
|
|
33
|
+
MuiPopover: {
|
|
34
|
+
PaperProps: { className: FixWebKit154Classes.paper },
|
|
35
|
+
},
|
|
36
|
+
// mui tooltip prop will cover all existing props
|
|
37
|
+
RcTooltip: {
|
|
38
|
+
classes: {
|
|
39
|
+
tooltip: FixWebKit154Classes.paper,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
// mui grow not accept global prop
|
|
43
|
+
RcGrow: {
|
|
44
|
+
className: FixWebKit154Classes.paper,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}, theme);
|
|
48
|
+
}
|
|
49
|
+
return theme;
|
|
50
|
+
};
|
|
51
|
+
export var fixWebKitTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
|
|
52
|
+
/**
|
|
53
|
+
* A global style that can be used to
|
|
54
|
+
* apply a workaround for the CSS transition bug after WebKit 15.4.
|
|
55
|
+
*/
|
|
56
|
+
export var GlobalFixWebKitStyle = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixWebKit154Classes.paper, fixWebKitTransitionStyle);
|
|
57
|
+
var templateObject_1;
|
|
@@ -3,7 +3,7 @@ import 'focus-visible';
|
|
|
3
3
|
import React, { createContext, useContext, } from 'react';
|
|
4
4
|
import { createGenerateClassName, MuiThemeProvider, StylesProvider, } from '@material-ui/core/styles';
|
|
5
5
|
import { useResultRef } from '../hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { getWebKit154Theme, GlobalFixWebKitStyle, isWebKit154, } from '../isWebKit154';
|
|
7
7
|
import { ThemeProvider as StyledThemeProvider, useTheme, } from '../styled-components';
|
|
8
8
|
import createTheme from './createTheme';
|
|
9
9
|
var NestedThemeContext = createContext(false);
|
|
@@ -13,16 +13,16 @@ var NestedThemeContext = createContext(false);
|
|
|
13
13
|
* that will user parent's theme when not set theme
|
|
14
14
|
*/
|
|
15
15
|
var SubThemeProvider = function (_a) {
|
|
16
|
-
var themeProp = _a.theme, children = _a.children;
|
|
16
|
+
var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
|
|
17
17
|
var _b, _c;
|
|
18
18
|
var parentTheme = useTheme();
|
|
19
19
|
var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
|
|
20
20
|
// TODO: can be remove after safari fix that bug, maybe after v16
|
|
21
|
-
var theme =
|
|
21
|
+
var theme = getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme(themeProp), fixWebKit154);
|
|
22
22
|
return (React.createElement(MuiThemeProvider, { theme: theme },
|
|
23
23
|
React.createElement(StyledThemeProvider, { theme: theme },
|
|
24
24
|
React.createElement(React.Fragment, null,
|
|
25
|
-
|
|
25
|
+
(fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154) && React.createElement(GlobalFixWebKitStyle, null),
|
|
26
26
|
children))));
|
|
27
27
|
};
|
|
28
28
|
/**
|
package/foundation/index.d.ts
CHANGED
package/foundation/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var styled_components_1 = tslib_1.__importDefault(require("./styled-components"));
|
|
5
5
|
exports.styled = styled_components_1.default;
|
|
6
6
|
tslib_1.__exportStar(require("./config"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./
|
|
7
|
+
tslib_1.__exportStar(require("./isWebKit154"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./contexts"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./hoc"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./hooks"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
3
|
+
* Remove this workaround once the WebKit bug fix is released.
|
|
4
|
+
*
|
|
5
|
+
* follow up:
|
|
6
|
+
* https://github.com/mui/material-ui/pull/31975/files
|
|
7
|
+
* https://github.com/mui/material-ui/pull/32202/files
|
|
8
|
+
*/
|
|
9
|
+
export declare const isWebKit154: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
12
|
+
* Remove this workaround once the Safari bug is fixed.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getWebKit154Theme: (theme: any, enable?: boolean | undefined) => any;
|
|
15
|
+
export declare const fixWebKitTransitionStyle = "all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms";
|
|
16
|
+
/**
|
|
17
|
+
* A global style that can be used to
|
|
18
|
+
* apply a workaround for the CSS transition bug after WebKit 15.4.
|
|
19
|
+
*/
|
|
20
|
+
export declare const GlobalFixWebKitStyle: import("styled-components").GlobalStyleClass<{}, import("styled-components").DefaultTheme>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var styled_components_1 = require("styled-components");
|
|
5
|
+
var classes_1 = require("./utils/classes");
|
|
6
|
+
var combineProps_1 = require("./utils/combineProps");
|
|
7
|
+
// * this whole file should be remove after webkit154 issue be fixed
|
|
8
|
+
/**
|
|
9
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
|
|
10
|
+
* Remove this workaround once the WebKit bug fix is released.
|
|
11
|
+
*
|
|
12
|
+
* follow up:
|
|
13
|
+
* https://github.com/mui/material-ui/pull/31975/files
|
|
14
|
+
* https://github.com/mui/material-ui/pull/32202/files
|
|
15
|
+
*/
|
|
16
|
+
exports.isWebKit154 = typeof navigator !== 'undefined' &&
|
|
17
|
+
/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) &&
|
|
18
|
+
/(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);
|
|
19
|
+
var FixWebKit154Classes = classes_1.RcClasses(['paper'], 'RcFixWebKit154');
|
|
20
|
+
/**
|
|
21
|
+
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
22
|
+
* Remove this workaround once the Safari bug is fixed.
|
|
23
|
+
*/
|
|
24
|
+
exports.getWebKit154Theme = function (theme, enable) {
|
|
25
|
+
if (enable !== null && enable !== void 0 ? enable : exports.isWebKit154) {
|
|
26
|
+
return combineProps_1.combineProps({
|
|
27
|
+
props: {
|
|
28
|
+
// * set all grow related to only have one transition to make animation not shake after safari 15.4
|
|
29
|
+
MuiMenu: {
|
|
30
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
31
|
+
},
|
|
32
|
+
RcVirtualizedMenu: {
|
|
33
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
34
|
+
},
|
|
35
|
+
MuiPopover: {
|
|
36
|
+
PaperProps: { className: FixWebKit154Classes.paper },
|
|
37
|
+
},
|
|
38
|
+
// mui tooltip prop will cover all existing props
|
|
39
|
+
RcTooltip: {
|
|
40
|
+
classes: {
|
|
41
|
+
tooltip: FixWebKit154Classes.paper,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
// mui grow not accept global prop
|
|
45
|
+
RcGrow: {
|
|
46
|
+
className: FixWebKit154Classes.paper,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}, theme);
|
|
50
|
+
}
|
|
51
|
+
return theme;
|
|
52
|
+
};
|
|
53
|
+
exports.fixWebKitTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
|
|
54
|
+
/**
|
|
55
|
+
* A global style that can be used to
|
|
56
|
+
* apply a workaround for the CSS transition bug after WebKit 15.4.
|
|
57
|
+
*/
|
|
58
|
+
exports.GlobalFixWebKitStyle = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixWebKit154Classes.paper, exports.fixWebKitTransitionStyle);
|
|
59
|
+
var templateObject_1;
|
|
@@ -4,6 +4,12 @@ import { RcThemeInput } from './theme.type';
|
|
|
4
4
|
declare type SubThemeProviderProps = {
|
|
5
5
|
/** custom theme */
|
|
6
6
|
theme?: RcThemeInput;
|
|
7
|
+
/**
|
|
8
|
+
* workaround for fix safari 15.4~.9 bug
|
|
9
|
+
*
|
|
10
|
+
* use for when your environment need that fix but userAgent not have safari
|
|
11
|
+
*/
|
|
12
|
+
fixWebKit154?: boolean;
|
|
7
13
|
children?: ReactNode;
|
|
8
14
|
};
|
|
9
15
|
declare type RootThemeProviderProps = {
|
|
@@ -5,7 +5,7 @@ require("focus-visible");
|
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var styles_1 = require("@material-ui/core/styles");
|
|
7
7
|
var hooks_1 = require("../hooks");
|
|
8
|
-
var
|
|
8
|
+
var isWebKit154_1 = require("../isWebKit154");
|
|
9
9
|
var styled_components_1 = require("../styled-components");
|
|
10
10
|
var createTheme_1 = tslib_1.__importDefault(require("./createTheme"));
|
|
11
11
|
var NestedThemeContext = react_1.createContext(false);
|
|
@@ -15,16 +15,16 @@ var NestedThemeContext = react_1.createContext(false);
|
|
|
15
15
|
* that will user parent's theme when not set theme
|
|
16
16
|
*/
|
|
17
17
|
var SubThemeProvider = function (_a) {
|
|
18
|
-
var themeProp = _a.theme, children = _a.children;
|
|
18
|
+
var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
|
|
19
19
|
var _b, _c;
|
|
20
20
|
var parentTheme = styled_components_1.useTheme();
|
|
21
21
|
var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
|
|
22
22
|
// TODO: can be remove after safari fix that bug, maybe after v16
|
|
23
|
-
var theme =
|
|
23
|
+
var theme = isWebKit154_1.getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme_1.default(themeProp), fixWebKit154);
|
|
24
24
|
return (react_1.default.createElement(styles_1.MuiThemeProvider, { theme: theme },
|
|
25
25
|
react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
26
26
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
-
|
|
27
|
+
(fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154_1.isWebKit154) && react_1.default.createElement(isWebKit154_1.GlobalFixWebKitStyle, null),
|
|
28
28
|
children))));
|
|
29
29
|
};
|
|
30
30
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ringcentral/juno",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.0",
|
|
4
4
|
"author": "RingCentral",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"focus-visible": "^5.1.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"react-beautiful-dnd": "^13.0.0",
|
|
30
|
-
"react-virtuoso": "^
|
|
30
|
+
"react-virtuoso": "^2.8.3",
|
|
31
31
|
"resize-observer-polyfill": "^1.5.1",
|
|
32
32
|
"typeface-lato": "^0.0.75",
|
|
33
33
|
"tslib": ">=2.0.0"
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { createGlobalStyle } from 'styled-components';
|
|
3
|
-
import { RcClasses } from './utils/classes';
|
|
4
|
-
import { combineProps } from './utils/combineProps';
|
|
5
|
-
/**
|
|
6
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
7
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
8
|
-
*/
|
|
9
|
-
export var isSafari154 = typeof navigator !== 'undefined' &&
|
|
10
|
-
/^((?!chrome|android).)*safari/i.test(navigator.userAgent) &&
|
|
11
|
-
/version\/15\.[4-9]/i.test(navigator.userAgent);
|
|
12
|
-
var FixSafari154Classes = RcClasses(['paper'], 'RcFixSafari154');
|
|
13
|
-
/**
|
|
14
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
15
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
16
|
-
*/
|
|
17
|
-
export var getSafari154Theme = function (theme) {
|
|
18
|
-
if (!isSafari154)
|
|
19
|
-
return theme;
|
|
20
|
-
return combineProps({
|
|
21
|
-
props: {
|
|
22
|
-
// * set all grow related to only have one transition to make animation not shake after safari 15.4
|
|
23
|
-
MuiMenu: {
|
|
24
|
-
PopoverClasses: { paper: FixSafari154Classes.paper },
|
|
25
|
-
},
|
|
26
|
-
RcVirtualizedMenu: {
|
|
27
|
-
PopoverClasses: { paper: FixSafari154Classes.paper },
|
|
28
|
-
},
|
|
29
|
-
MuiPopover: {
|
|
30
|
-
PaperProps: { className: FixSafari154Classes.paper },
|
|
31
|
-
},
|
|
32
|
-
// mui tooltip prop will cover all existing props
|
|
33
|
-
RcTooltip: {
|
|
34
|
-
classes: {
|
|
35
|
-
tooltip: FixSafari154Classes.paper,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
// mui grow not accept global prop
|
|
39
|
-
RcGrow: {
|
|
40
|
-
className: FixSafari154Classes.paper,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}, theme);
|
|
44
|
-
};
|
|
45
|
-
export var fixSafariTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
|
|
46
|
-
/**
|
|
47
|
-
* A global style that can be used to apply a workaround for the CSS transition bug in Safari 15.4.
|
|
48
|
-
*/
|
|
49
|
-
export var GlobalFixSafariStyle = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixSafari154Classes.paper, fixSafariTransitionStyle);
|
|
50
|
-
var templateObject_1;
|