@autobest-ui/components 2.2.1 → 2.4.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/esm/accordion/Item.js +6 -23
- package/esm/accordion/index.js +8 -36
- package/esm/accordion/style/index.css +1 -0
- package/esm/affix/PortalAffix.js +7 -11
- package/esm/affix/index.js +30 -70
- package/esm/affix/style/index.css +1 -1
- package/esm/base.css +1 -1
- package/esm/carousel/index.js +45 -141
- package/esm/checkbox/index.js +12 -37
- package/esm/checkbox/style/index.css +1 -1
- package/esm/collapse/index.js +11 -49
- package/esm/confirm/index.d.ts +8 -0
- package/esm/confirm/index.js +23 -31
- package/esm/confirm/style/index.css +1 -1
- package/esm/date-picker/DateEnum.js +0 -3
- package/esm/date-picker/calendar/Day.js +62 -78
- package/esm/date-picker/calendar/MonthYear.js +20 -53
- package/esm/date-picker/calendar/grid/index.js +7 -12
- package/esm/date-picker/calendar/index.js +4 -31
- package/esm/date-picker/index.js +11 -51
- package/esm/date-picker/style/index.css +1 -1
- package/esm/date-picker/utils.js +6 -11
- package/esm/drawer/Child.js +10 -20
- package/esm/drawer/index.js +22 -71
- package/esm/drawer/style/index.css +1 -1
- package/esm/ellipsis/index.js +9 -17
- package/esm/ellipsis/style/index.css +1 -1
- package/esm/guide/index.js +25 -63
- package/esm/guide/style/index.css +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/input-number/ControlArrow.js +0 -2
- package/esm/input-number/constants.js +2 -2
- package/esm/input-number/index.js +26 -106
- package/esm/input-number/style/index.css +1 -1
- package/esm/lazy-image/index.js +10 -55
- package/esm/lazy-image/style/index.css +1 -1
- package/esm/link-list/index.js +11 -35
- package/esm/link-list/style/index.css +1 -1
- package/esm/loading/index.js +15 -42
- package/esm/loading/style/index.css +1 -1
- package/esm/loading-bar/style/index.css +1 -1
- package/esm/loading-container/index.js +3 -6
- package/esm/loading-container/style/index.css +1 -1
- package/esm/loading-icon/index.js +0 -2
- package/esm/loading-icon/style/index.css +1 -1
- package/esm/mask/index.js +6 -9
- package/esm/mask/style/index.css +1 -1
- package/esm/message/index.d.ts +17 -6
- package/esm/message/index.js +68 -96
- package/esm/message/renderMessage.d.ts +17 -0
- package/esm/message/renderMessage.js +137 -0
- package/esm/message/style/index.css +1 -1
- package/esm/modal/Title.js +5 -12
- package/esm/modal/getPopupLocation.js +5 -7
- package/esm/modal/index.js +44 -125
- package/esm/modal/style/index.css +1 -1
- package/esm/move/index.js +32 -132
- package/esm/move/range.js +6 -12
- package/esm/move/utils.js +3 -10
- package/esm/popover/index.js +9 -28
- package/esm/popover/style/index.css +1 -1
- package/esm/portal/index.js +1 -22
- package/esm/script/index.js +19 -59
- package/esm/select/index.js +28 -106
- package/esm/select/style/index.css +1 -1
- package/esm/show-more/index.js +40 -103
- package/esm/skeleton/Item.js +1 -3
- package/esm/skeleton/index.js +5 -11
- package/esm/skeleton/style/index.css +1 -1
- package/esm/style.css +1 -33
- package/esm/table/body/BodyRow.js +11 -28
- package/esm/table/body/CheckIcon.js +10 -18
- package/esm/table/body/index.js +8 -12
- package/esm/table/header/CheckIcon.js +3 -11
- package/esm/table/header/HeaderCell.js +12 -33
- package/esm/table/header/HeaderRow.js +6 -17
- package/esm/table/index.js +30 -100
- package/esm/table/style/index.css +1 -1
- package/esm/tabs/index.js +35 -118
- package/esm/tabs/style/index.css +1 -1
- package/esm/tooltip/index.js +0 -4
- package/esm/tooltip/style/index.css +1 -1
- package/esm/trigger/align.js +6 -6
- package/esm/trigger/bottomAlign.js +33 -45
- package/esm/trigger/constants.js +0 -1
- package/esm/trigger/getPopupLocation.js +48 -68
- package/esm/trigger/index.js +52 -187
- package/esm/trigger/leftAlign.js +33 -47
- package/esm/trigger/ref.js +2 -7
- package/esm/trigger/rightAlign.js +33 -45
- package/esm/trigger/topAlign.js +33 -45
- package/esm/trigger/utils.js +28 -45
- package/lib/accordion/Item.js +6 -27
- package/lib/accordion/index.js +8 -41
- package/lib/accordion/style/index.css +1 -0
- package/lib/affix/PortalAffix.js +7 -17
- package/lib/affix/index.js +30 -75
- package/lib/affix/style/index.css +1 -1
- package/lib/base.css +1 -1
- package/lib/carousel/index.js +45 -146
- package/lib/checkbox/index.js +12 -41
- package/lib/checkbox/style/index.css +1 -1
- package/lib/collapse/index.js +11 -53
- package/lib/confirm/index.d.ts +8 -0
- package/lib/confirm/index.js +23 -38
- package/lib/confirm/style/index.css +1 -1
- package/lib/date-picker/DateEnum.js +0 -3
- package/lib/date-picker/calendar/Day.js +62 -87
- package/lib/date-picker/calendar/MonthYear.js +20 -62
- package/lib/date-picker/calendar/grid/index.js +7 -16
- package/lib/date-picker/calendar/index.js +4 -37
- package/lib/date-picker/index.js +9 -58
- package/lib/date-picker/style/index.css +1 -1
- package/lib/date-picker/utils.js +6 -26
- package/lib/drawer/Child.js +10 -25
- package/lib/drawer/index.js +22 -78
- package/lib/drawer/style/index.css +1 -1
- package/lib/ellipsis/index.js +9 -23
- package/lib/ellipsis/style/index.css +1 -1
- package/lib/guide/index.js +25 -71
- package/lib/guide/style/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -29
- package/lib/input-number/ControlArrow.js +0 -4
- package/lib/input-number/constants.js +2 -2
- package/lib/input-number/index.js +26 -114
- package/lib/input-number/style/index.css +1 -1
- package/lib/lazy-image/index.js +10 -58
- package/lib/lazy-image/style/index.css +1 -1
- package/lib/link-list/index.js +11 -40
- package/lib/link-list/style/index.css +1 -1
- package/lib/loading/index.js +13 -48
- package/lib/loading/style/index.css +1 -1
- package/lib/loading-bar/index.js +0 -5
- package/lib/loading-bar/style/index.css +1 -1
- package/lib/loading-container/index.js +3 -11
- package/lib/loading-container/style/index.css +1 -1
- package/lib/loading-icon/index.js +0 -7
- package/lib/loading-icon/style/index.css +1 -1
- package/lib/mask/index.js +6 -17
- package/lib/mask/style/index.css +1 -1
- package/lib/message/index.d.ts +17 -6
- package/lib/message/index.js +67 -104
- package/lib/message/renderMessage.d.ts +17 -0
- package/lib/message/renderMessage.js +144 -0
- package/lib/message/style/index.css +1 -1
- package/lib/modal/Affix.js +0 -4
- package/lib/modal/Title.js +5 -15
- package/lib/modal/getPopupLocation.js +5 -9
- package/lib/modal/index.js +44 -135
- package/lib/modal/style/index.css +1 -1
- package/lib/move/index.js +32 -144
- package/lib/move/range.js +6 -14
- package/lib/move/utils.js +3 -12
- package/lib/popover/index.js +9 -33
- package/lib/popover/style/index.css +1 -1
- package/lib/portal/index.js +1 -25
- package/lib/script/index.js +19 -61
- package/lib/select/index.js +28 -113
- package/lib/select/style/index.css +1 -1
- package/lib/show-more/index.js +40 -110
- package/lib/skeleton/Item.js +1 -8
- package/lib/skeleton/index.js +5 -16
- package/lib/skeleton/style/index.css +1 -1
- package/lib/style.css +1 -33
- package/lib/table/body/BodyRow.js +11 -33
- package/lib/table/body/CheckIcon.js +10 -22
- package/lib/table/body/index.js +8 -17
- package/lib/table/header/CheckIcon.js +3 -15
- package/lib/table/header/HeaderCell.js +12 -37
- package/lib/table/header/HeaderRow.js +6 -22
- package/lib/table/index.js +30 -107
- package/lib/table/style/index.css +1 -1
- package/lib/tabs/index.js +35 -122
- package/lib/tabs/style/index.css +1 -1
- package/lib/tooltip/index.js +0 -9
- package/lib/tooltip/style/index.css +1 -1
- package/lib/trigger/align.js +0 -4
- package/lib/trigger/bottomAlign.js +33 -48
- package/lib/trigger/constants.js +0 -2
- package/lib/trigger/getPopupLocation.js +48 -74
- package/lib/trigger/index.js +52 -198
- package/lib/trigger/leftAlign.js +33 -50
- package/lib/trigger/ref.js +2 -12
- package/lib/trigger/rightAlign.js +33 -48
- package/lib/trigger/topAlign.js +33 -48
- package/lib/trigger/utils.js +28 -53
- package/package.json +9 -3
- package/esm/accordion/style/index.d.ts +0 -1
- package/esm/accordion/style/index.js +0 -5
- package/esm/affix/style/index.d.ts +0 -1
- package/esm/affix/style/index.js +0 -5
- package/esm/affix/style/index.scss +0 -35
- package/esm/base.scss +0 -42
- package/esm/carousel/style/index.d.ts +0 -1
- package/esm/carousel/style/index.js +0 -5
- package/esm/carousel/style/index.scss +0 -37
- package/esm/checkbox/style/index.d.ts +0 -1
- package/esm/checkbox/style/index.js +0 -5
- package/esm/checkbox/style/index.scss +0 -118
- package/esm/collapse/style/index.d.ts +0 -1
- package/esm/collapse/style/index.js +0 -5
- package/esm/collapse/style/index.scss +0 -43
- package/esm/confirm/style/index.d.ts +0 -1
- package/esm/confirm/style/index.js +0 -7
- package/esm/confirm/style/index.scss +0 -44
- package/esm/date-picker/calendar/grid/index.scss +0 -90
- package/esm/date-picker/calendar/index.scss +0 -58
- package/esm/date-picker/style/index.d.ts +0 -1
- package/esm/date-picker/style/index.js +0 -11
- package/esm/date-picker/style/index.scss +0 -24
- package/esm/drawer/style/index.d.ts +0 -1
- package/esm/drawer/style/index.js +0 -7
- package/esm/drawer/style/index.scss +0 -44
- package/esm/ellipsis/style/index.d.ts +0 -1
- package/esm/ellipsis/style/index.js +0 -5
- package/esm/ellipsis/style/index.scss +0 -35
- package/esm/guide/style/index.d.ts +0 -1
- package/esm/guide/style/index.js +0 -7
- package/esm/guide/style/index.scss +0 -18
- package/esm/input-number/style/index.d.ts +0 -1
- package/esm/input-number/style/index.js +0 -5
- package/esm/input-number/style/index.scss +0 -70
- package/esm/lazy-image/style/index.d.ts +0 -1
- package/esm/lazy-image/style/index.js +0 -5
- package/esm/lazy-image/style/index.scss +0 -25
- package/esm/link-list/style/index.d.ts +0 -1
- package/esm/link-list/style/index.js +0 -7
- package/esm/link-list/style/index.scss +0 -125
- package/esm/loading/style/index.d.ts +0 -1
- package/esm/loading/style/index.js +0 -7
- package/esm/loading/style/index.scss +0 -21
- package/esm/loading-bar/style/index.d.ts +0 -1
- package/esm/loading-bar/style/index.js +0 -5
- package/esm/loading-bar/style/index.scss +0 -62
- package/esm/loading-container/style/index.d.ts +0 -1
- package/esm/loading-container/style/index.js +0 -7
- package/esm/loading-container/style/index.scss +0 -28
- package/esm/loading-icon/style/index.d.ts +0 -1
- package/esm/loading-icon/style/index.js +0 -5
- package/esm/loading-icon/style/index.scss +0 -24
- package/esm/mask/style/index.d.ts +0 -1
- package/esm/mask/style/index.js +0 -5
- package/esm/mask/style/index.scss +0 -35
- package/esm/message/style/index.d.ts +0 -1
- package/esm/message/style/index.js +0 -5
- package/esm/message/style/index.scss +0 -71
- package/esm/modal/style/index.d.ts +0 -1
- package/esm/modal/style/index.js +0 -7
- package/esm/modal/style/index.scss +0 -112
- package/esm/move/style/index.d.ts +0 -1
- package/esm/move/style/index.js +0 -5
- package/esm/move/style/index.scss +0 -7
- package/esm/popover/style/index.d.ts +0 -1
- package/esm/popover/style/index.js +0 -7
- package/esm/popover/style/index.scss +0 -60
- package/esm/portal/style/index.d.ts +0 -1
- package/esm/portal/style/index.js +0 -5
- package/esm/portal/style/index.scss +0 -0
- package/esm/script/style/index.d.ts +0 -1
- package/esm/script/style/index.js +0 -1
- package/esm/script/style/index.scss +0 -0
- package/esm/select/style/index.d.ts +0 -1
- package/esm/select/style/index.js +0 -7
- package/esm/select/style/index.scss +0 -126
- package/esm/show-more/style/index.d.ts +0 -1
- package/esm/show-more/style/index.js +0 -5
- package/esm/show-more/style/index.scss +0 -23
- package/esm/skeleton/style/index.d.ts +0 -1
- package/esm/skeleton/style/index.js +0 -5
- package/esm/skeleton/style/index.scss +0 -27
- package/esm/table/style/index.d.ts +0 -1
- package/esm/table/style/index.js +0 -9
- package/esm/table/style/index.scss +0 -45
- package/esm/tabs/style/index.d.ts +0 -1
- package/esm/tabs/style/index.js +0 -5
- package/esm/tabs/style/index.scss +0 -62
- package/esm/tooltip/style/index.d.ts +0 -1
- package/esm/tooltip/style/index.js +0 -7
- package/esm/tooltip/style/index.scss +0 -62
- package/esm/trigger/style/index.d.ts +0 -1
- package/esm/trigger/style/index.js +0 -5
- package/esm/trigger/style/index.scss +0 -79
- package/lib/accordion/style/index.d.ts +0 -1
- package/lib/accordion/style/index.js +0 -7
- package/lib/affix/style/index.d.ts +0 -1
- package/lib/affix/style/index.js +0 -7
- package/lib/affix/style/index.scss +0 -35
- package/lib/base.scss +0 -42
- package/lib/carousel/style/index.d.ts +0 -1
- package/lib/carousel/style/index.js +0 -7
- package/lib/carousel/style/index.scss +0 -37
- package/lib/checkbox/style/index.d.ts +0 -1
- package/lib/checkbox/style/index.js +0 -7
- package/lib/checkbox/style/index.scss +0 -118
- package/lib/collapse/style/index.d.ts +0 -1
- package/lib/collapse/style/index.js +0 -7
- package/lib/collapse/style/index.scss +0 -43
- package/lib/confirm/style/index.d.ts +0 -1
- package/lib/confirm/style/index.js +0 -9
- package/lib/confirm/style/index.scss +0 -44
- package/lib/date-picker/calendar/grid/index.scss +0 -90
- package/lib/date-picker/calendar/index.scss +0 -58
- package/lib/date-picker/style/index.d.ts +0 -1
- package/lib/date-picker/style/index.js +0 -13
- package/lib/date-picker/style/index.scss +0 -24
- package/lib/drawer/style/index.d.ts +0 -1
- package/lib/drawer/style/index.js +0 -9
- package/lib/drawer/style/index.scss +0 -44
- package/lib/ellipsis/style/index.d.ts +0 -1
- package/lib/ellipsis/style/index.js +0 -7
- package/lib/ellipsis/style/index.scss +0 -35
- package/lib/guide/style/index.d.ts +0 -1
- package/lib/guide/style/index.js +0 -9
- package/lib/guide/style/index.scss +0 -18
- package/lib/input-number/style/index.d.ts +0 -1
- package/lib/input-number/style/index.js +0 -7
- package/lib/input-number/style/index.scss +0 -70
- package/lib/lazy-image/style/index.d.ts +0 -1
- package/lib/lazy-image/style/index.js +0 -7
- package/lib/lazy-image/style/index.scss +0 -25
- package/lib/link-list/style/index.d.ts +0 -1
- package/lib/link-list/style/index.js +0 -9
- package/lib/link-list/style/index.scss +0 -125
- package/lib/loading/style/index.d.ts +0 -1
- package/lib/loading/style/index.js +0 -9
- package/lib/loading/style/index.scss +0 -21
- package/lib/loading-bar/style/index.d.ts +0 -1
- package/lib/loading-bar/style/index.js +0 -7
- package/lib/loading-bar/style/index.scss +0 -62
- package/lib/loading-container/style/index.d.ts +0 -1
- package/lib/loading-container/style/index.js +0 -9
- package/lib/loading-container/style/index.scss +0 -28
- package/lib/loading-icon/style/index.d.ts +0 -1
- package/lib/loading-icon/style/index.js +0 -7
- package/lib/loading-icon/style/index.scss +0 -24
- package/lib/mask/style/index.d.ts +0 -1
- package/lib/mask/style/index.js +0 -7
- package/lib/mask/style/index.scss +0 -35
- package/lib/message/style/index.d.ts +0 -1
- package/lib/message/style/index.js +0 -7
- package/lib/message/style/index.scss +0 -71
- package/lib/modal/style/index.d.ts +0 -1
- package/lib/modal/style/index.js +0 -9
- package/lib/modal/style/index.scss +0 -112
- package/lib/move/style/index.d.ts +0 -1
- package/lib/move/style/index.js +0 -7
- package/lib/move/style/index.scss +0 -7
- package/lib/popover/style/index.d.ts +0 -1
- package/lib/popover/style/index.js +0 -9
- package/lib/popover/style/index.scss +0 -60
- package/lib/portal/style/index.d.ts +0 -1
- package/lib/portal/style/index.js +0 -7
- package/lib/portal/style/index.scss +0 -0
- package/lib/script/style/index.d.ts +0 -1
- package/lib/script/style/index.js +0 -1
- package/lib/script/style/index.scss +0 -0
- package/lib/select/style/index.d.ts +0 -1
- package/lib/select/style/index.js +0 -9
- package/lib/select/style/index.scss +0 -126
- package/lib/show-more/style/index.d.ts +0 -1
- package/lib/show-more/style/index.js +0 -7
- package/lib/show-more/style/index.scss +0 -23
- package/lib/skeleton/style/index.d.ts +0 -1
- package/lib/skeleton/style/index.js +0 -7
- package/lib/skeleton/style/index.scss +0 -27
- package/lib/table/style/index.d.ts +0 -1
- package/lib/table/style/index.js +0 -11
- package/lib/table/style/index.scss +0 -45
- package/lib/tabs/style/index.d.ts +0 -1
- package/lib/tabs/style/index.js +0 -7
- package/lib/tabs/style/index.scss +0 -62
- package/lib/tooltip/style/index.d.ts +0 -1
- package/lib/tooltip/style/index.js +0 -9
- package/lib/tooltip/style/index.scss +0 -62
- package/lib/trigger/style/index.d.ts +0 -1
- package/lib/trigger/style/index.js +0 -7
- package/lib/trigger/style/index.scss +0 -79
package/lib/trigger/leftAlign.js
CHANGED
|
@@ -6,33 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getLeftBottomLocationInfo = getLeftBottomLocationInfo;
|
|
7
7
|
exports.getLeftLocationInfo = getLeftLocationInfo;
|
|
8
8
|
exports.getLeftTopLocationInfo = getLeftTopLocationInfo;
|
|
9
|
-
|
|
10
9
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
10
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
11
|
__assign = Object.assign || function (t) {
|
|
14
12
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15
13
|
s = arguments[i];
|
|
16
|
-
|
|
17
14
|
for (var p in s) {
|
|
18
15
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
return t;
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
return __assign.apply(this, arguments);
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
function getLeftCommon(_a) {
|
|
29
23
|
var left = _a.left,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
rootInfo = _a.rootInfo,
|
|
25
|
+
popInfo = _a.popInfo,
|
|
26
|
+
arrowTop = _a.arrowTop,
|
|
27
|
+
hiddenArrow = _a.hiddenArrow,
|
|
28
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
29
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection;
|
|
36
30
|
return {
|
|
37
31
|
rootWidth: rootInfo.width,
|
|
38
32
|
width: popInfo.width,
|
|
@@ -47,23 +41,19 @@ function getLeftCommon(_a) {
|
|
|
47
41
|
};
|
|
48
42
|
}
|
|
49
43
|
/* 具体方位 */
|
|
50
|
-
|
|
51
|
-
|
|
52
44
|
function getLeftLocationInfo(_a) {
|
|
53
45
|
var rootInfo = _a.rootInfo,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
popInfo = _a.popInfo,
|
|
47
|
+
_b = _a.translateY,
|
|
48
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
49
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
50
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
51
|
+
hiddenArrow = _a.hiddenArrow,
|
|
52
|
+
isInsertNode = _a.isInsertNode;
|
|
61
53
|
var arrowTop = (0, _utils.getArrowTop)(popInfo.height / 2 - translateY, popInfo.height);
|
|
62
|
-
|
|
63
54
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
left = _c.left,
|
|
56
|
+
top = _c.top;
|
|
67
57
|
return __assign(__assign({}, getLeftCommon({
|
|
68
58
|
left: left,
|
|
69
59
|
rootInfo: rootInfo,
|
|
@@ -77,23 +67,19 @@ function getLeftLocationInfo(_a) {
|
|
|
77
67
|
});
|
|
78
68
|
}
|
|
79
69
|
/* 其他方位 */
|
|
80
|
-
|
|
81
|
-
|
|
82
70
|
function getLeftTopLocationInfo(_a) {
|
|
83
71
|
var rootInfo = _a.rootInfo,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
popInfo = _a.popInfo,
|
|
73
|
+
_b = _a.translateY,
|
|
74
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
75
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
76
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
77
|
+
hiddenArrow = _a.hiddenArrow,
|
|
78
|
+
isInsertNode = _a.isInsertNode;
|
|
91
79
|
var arrowTop = (0, _utils.getArrowTop)(rootInfo.height / 2 - translateY, popInfo.height);
|
|
92
|
-
|
|
93
80
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
81
|
+
left = _c.left,
|
|
82
|
+
top = _c.top;
|
|
97
83
|
return __assign(__assign({}, getLeftCommon({
|
|
98
84
|
left: left,
|
|
99
85
|
rootInfo: rootInfo,
|
|
@@ -106,22 +92,19 @@ function getLeftTopLocationInfo(_a) {
|
|
|
106
92
|
top: top + translateY
|
|
107
93
|
});
|
|
108
94
|
}
|
|
109
|
-
|
|
110
95
|
function getLeftBottomLocationInfo(_a) {
|
|
111
96
|
var rootInfo = _a.rootInfo,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
97
|
+
popInfo = _a.popInfo,
|
|
98
|
+
_b = _a.translateY,
|
|
99
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
100
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
101
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
102
|
+
hiddenArrow = _a.hiddenArrow,
|
|
103
|
+
isInsertNode = _a.isInsertNode;
|
|
119
104
|
var arrowTop = (0, _utils.getArrowTop)(popInfo.height - rootInfo.height / 2 - translateY, popInfo.height);
|
|
120
|
-
|
|
121
105
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
106
|
+
left = _c.left,
|
|
107
|
+
top = _c.top;
|
|
125
108
|
return __assign(__assign({}, getLeftCommon({
|
|
126
109
|
left: left,
|
|
127
110
|
rootInfo: rootInfo,
|
package/lib/trigger/ref.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.composeRef = composeRef;
|
|
9
8
|
exports.fillRef = fillRef;
|
|
10
9
|
exports.supportRef = supportRef;
|
|
11
|
-
|
|
12
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
11
|
function fillRef(ref, node) {
|
|
15
12
|
if (typeof ref === 'function') {
|
|
16
13
|
ref(node);
|
|
@@ -21,32 +18,25 @@ function fillRef(ref, node) {
|
|
|
21
18
|
/**
|
|
22
19
|
* Merge refs into one ref function to support ref passing.
|
|
23
20
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
21
|
function composeRef() {
|
|
27
22
|
var refs = [];
|
|
28
|
-
|
|
29
23
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
30
24
|
refs[_i] = arguments[_i];
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
return function (node) {
|
|
34
27
|
refs.forEach(function (ref) {
|
|
35
28
|
fillRef(ref, node);
|
|
36
29
|
});
|
|
37
30
|
};
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
function supportRef(nodeOrComponent) {
|
|
41
33
|
// Function component node
|
|
42
34
|
if (nodeOrComponent.type && nodeOrComponent.type.prototype && !nodeOrComponent.type.prototype.render) {
|
|
43
35
|
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
}
|
|
37
|
+
// Class component
|
|
47
38
|
if (typeof nodeOrComponent === 'function' && nodeOrComponent.prototype && !nodeOrComponent.prototype.render) {
|
|
48
39
|
return false;
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
return true;
|
|
52
42
|
}
|
|
@@ -6,33 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getRightBottomLocationInfo = getRightBottomLocationInfo;
|
|
7
7
|
exports.getRightLocationInfo = getRightLocationInfo;
|
|
8
8
|
exports.getRightTopLocationInfo = getRightTopLocationInfo;
|
|
9
|
-
|
|
10
9
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
10
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
11
|
__assign = Object.assign || function (t) {
|
|
14
12
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15
13
|
s = arguments[i];
|
|
16
|
-
|
|
17
14
|
for (var p in s) {
|
|
18
15
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
return t;
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
return __assign.apply(this, arguments);
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
function getRightCommon(_a) {
|
|
29
23
|
var left = _a.left,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
rootInfo = _a.rootInfo,
|
|
25
|
+
popInfo = _a.popInfo,
|
|
26
|
+
arrowTop = _a.arrowTop,
|
|
27
|
+
hiddenArrow = _a.hiddenArrow,
|
|
28
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
29
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection;
|
|
36
30
|
return {
|
|
37
31
|
rootWidth: rootInfo.width,
|
|
38
32
|
width: popInfo.width,
|
|
@@ -46,22 +40,19 @@ function getRightCommon(_a) {
|
|
|
46
40
|
transformOrigin: isTransformHorizontalDirection ? 'left center' : "left ".concat(arrowTop, "px")
|
|
47
41
|
};
|
|
48
42
|
}
|
|
49
|
-
|
|
50
43
|
function getRightLocationInfo(_a) {
|
|
51
44
|
var rootInfo = _a.rootInfo,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
popInfo = _a.popInfo,
|
|
46
|
+
_b = _a.translateY,
|
|
47
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
48
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
49
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
50
|
+
hiddenArrow = _a.hiddenArrow,
|
|
51
|
+
isInsertNode = _a.isInsertNode;
|
|
59
52
|
var arrowTop = (0, _utils.getArrowTop)(popInfo.height / 2 - translateY, popInfo.height);
|
|
60
|
-
|
|
61
53
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
left = _c.left,
|
|
55
|
+
top = _c.top;
|
|
65
56
|
return __assign(__assign({}, getRightCommon({
|
|
66
57
|
left: left,
|
|
67
58
|
rootInfo: rootInfo,
|
|
@@ -74,22 +65,19 @@ function getRightLocationInfo(_a) {
|
|
|
74
65
|
top: top - (popInfo.height / 2 - rootInfo.height / 2) + translateY
|
|
75
66
|
});
|
|
76
67
|
}
|
|
77
|
-
|
|
78
68
|
function getRightTopLocationInfo(_a) {
|
|
79
69
|
var rootInfo = _a.rootInfo,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
popInfo = _a.popInfo,
|
|
71
|
+
_b = _a.translateY,
|
|
72
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
73
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
74
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
75
|
+
hiddenArrow = _a.hiddenArrow,
|
|
76
|
+
isInsertNode = _a.isInsertNode;
|
|
87
77
|
var arrowTop = (0, _utils.getArrowTop)(rootInfo.height / 2 - translateY, popInfo.height);
|
|
88
|
-
|
|
89
78
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
left = _c.left,
|
|
80
|
+
top = _c.top;
|
|
93
81
|
return __assign(__assign({}, getRightCommon({
|
|
94
82
|
left: left,
|
|
95
83
|
rootInfo: rootInfo,
|
|
@@ -102,22 +90,19 @@ function getRightTopLocationInfo(_a) {
|
|
|
102
90
|
top: top + translateY
|
|
103
91
|
});
|
|
104
92
|
}
|
|
105
|
-
|
|
106
93
|
function getRightBottomLocationInfo(_a) {
|
|
107
94
|
var rootInfo = _a.rootInfo,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
popInfo = _a.popInfo,
|
|
96
|
+
_b = _a.translateY,
|
|
97
|
+
translateY = _b === void 0 ? 0 : _b,
|
|
98
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
99
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
100
|
+
hiddenArrow = _a.hiddenArrow,
|
|
101
|
+
isInsertNode = _a.isInsertNode;
|
|
115
102
|
var arrowTop = (0, _utils.getArrowTop)(popInfo.height - rootInfo.height / 2 - translateY, popInfo.height);
|
|
116
|
-
|
|
117
103
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
left = _c.left,
|
|
105
|
+
top = _c.top;
|
|
121
106
|
return __assign(__assign({}, getRightCommon({
|
|
122
107
|
left: left,
|
|
123
108
|
rootInfo: rootInfo,
|
package/lib/trigger/topAlign.js
CHANGED
|
@@ -6,33 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getTopLeftLocationInfo = getTopLeftLocationInfo;
|
|
7
7
|
exports.getTopLocationInfo = getTopLocationInfo;
|
|
8
8
|
exports.getTopRightLocationInfo = getTopRightLocationInfo;
|
|
9
|
-
|
|
10
9
|
var _utils = require("./utils");
|
|
11
|
-
|
|
12
10
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
13
11
|
__assign = Object.assign || function (t) {
|
|
14
12
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15
13
|
s = arguments[i];
|
|
16
|
-
|
|
17
14
|
for (var p in s) {
|
|
18
15
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
return t;
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
return __assign.apply(this, arguments);
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
function getTopCommon(_a) {
|
|
29
23
|
var top = _a.top,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
rootInfo = _a.rootInfo,
|
|
25
|
+
popInfo = _a.popInfo,
|
|
26
|
+
arrowLeft = _a.arrowLeft,
|
|
27
|
+
hiddenArrow = _a.hiddenArrow,
|
|
28
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
29
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection;
|
|
36
30
|
return {
|
|
37
31
|
rootWidth: rootInfo.width,
|
|
38
32
|
width: popInfo.width,
|
|
@@ -46,22 +40,19 @@ function getTopCommon(_a) {
|
|
|
46
40
|
transformOrigin: isTransformHorizontalDirection ? 'center bottom' : "".concat(arrowLeft, "px bottom")
|
|
47
41
|
};
|
|
48
42
|
}
|
|
49
|
-
|
|
50
43
|
function getTopLocationInfo(_a) {
|
|
51
44
|
var rootInfo = _a.rootInfo,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
popInfo = _a.popInfo,
|
|
46
|
+
_b = _a.translateX,
|
|
47
|
+
translateX = _b === void 0 ? 0 : _b,
|
|
48
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
49
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
50
|
+
hiddenArrow = _a.hiddenArrow,
|
|
51
|
+
isInsertNode = _a.isInsertNode;
|
|
59
52
|
var arrowLeft = (0, _utils.getArrowLeft)(popInfo.width / 2 - translateX, popInfo.width);
|
|
60
|
-
|
|
61
53
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
left = _c.left,
|
|
55
|
+
top = _c.top;
|
|
65
56
|
return __assign(__assign({}, getTopCommon({
|
|
66
57
|
top: top,
|
|
67
58
|
rootInfo: rootInfo,
|
|
@@ -74,22 +65,19 @@ function getTopLocationInfo(_a) {
|
|
|
74
65
|
left: left + rootInfo.width / 2 - popInfo.width / 2 + translateX
|
|
75
66
|
});
|
|
76
67
|
}
|
|
77
|
-
|
|
78
68
|
function getTopLeftLocationInfo(_a) {
|
|
79
69
|
var rootInfo = _a.rootInfo,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
popInfo = _a.popInfo,
|
|
71
|
+
_b = _a.translateX,
|
|
72
|
+
translateX = _b === void 0 ? 0 : _b,
|
|
73
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
74
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
75
|
+
hiddenArrow = _a.hiddenArrow,
|
|
76
|
+
isInsertNode = _a.isInsertNode;
|
|
87
77
|
var arrowLeft = (0, _utils.getArrowLeft)(rootInfo.width / 2 - translateX, popInfo.width);
|
|
88
|
-
|
|
89
78
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
left = _c.left,
|
|
80
|
+
top = _c.top;
|
|
93
81
|
return __assign(__assign({}, getTopCommon({
|
|
94
82
|
top: top,
|
|
95
83
|
rootInfo: rootInfo,
|
|
@@ -102,22 +90,19 @@ function getTopLeftLocationInfo(_a) {
|
|
|
102
90
|
left: left + translateX
|
|
103
91
|
});
|
|
104
92
|
}
|
|
105
|
-
|
|
106
93
|
function getTopRightLocationInfo(_a) {
|
|
107
94
|
var rootInfo = _a.rootInfo,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
popInfo = _a.popInfo,
|
|
96
|
+
_b = _a.translateX,
|
|
97
|
+
translateX = _b === void 0 ? 0 : _b,
|
|
98
|
+
rootToPopupSpacing = _a.rootToPopupSpacing,
|
|
99
|
+
isTransformHorizontalDirection = _a.isTransformHorizontalDirection,
|
|
100
|
+
hiddenArrow = _a.hiddenArrow,
|
|
101
|
+
isInsertNode = _a.isInsertNode;
|
|
115
102
|
var arrowLeft = (0, _utils.getArrowLeft)(popInfo.width - rootInfo.width / 2 - translateX, popInfo.width);
|
|
116
|
-
|
|
117
103
|
var _c = (0, _utils.getAvailPosition)(rootInfo, isInsertNode),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
left = _c.left,
|
|
105
|
+
top = _c.top;
|
|
121
106
|
return __assign(__assign({}, getTopCommon({
|
|
122
107
|
top: top,
|
|
123
108
|
rootInfo: rootInfo,
|
package/lib/trigger/utils.js
CHANGED
|
@@ -10,25 +10,20 @@ exports.getLocationMethodByPlacement = getLocationMethodByPlacement;
|
|
|
10
10
|
exports.getTranslate = getTranslate;
|
|
11
11
|
exports.isLeftMoreThanRight = isLeftMoreThanRight;
|
|
12
12
|
exports.isTopMoreThanBottom = isTopMoreThanBottom;
|
|
13
|
-
|
|
14
13
|
var _constants = require("./constants");
|
|
15
|
-
|
|
16
14
|
var ArrowLimit = 8;
|
|
17
15
|
/**
|
|
18
16
|
* 获取悬浮框箭头left位置,处理临界点
|
|
19
17
|
* @param value
|
|
20
18
|
* @param popWidth
|
|
21
19
|
*/
|
|
22
|
-
|
|
23
20
|
function getArrowLeft(value, popWidth) {
|
|
24
21
|
if (value < 0) {
|
|
25
22
|
return 0;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
if (value > popWidth - ArrowLimit) {
|
|
29
25
|
return popWidth - ArrowLimit;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
return value;
|
|
33
28
|
}
|
|
34
29
|
/**
|
|
@@ -36,20 +31,15 @@ function getArrowLeft(value, popWidth) {
|
|
|
36
31
|
* @param value
|
|
37
32
|
* @param popHeight
|
|
38
33
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
34
|
function getArrowTop(value, popHeight) {
|
|
42
35
|
if (value < 0) {
|
|
43
36
|
return 0;
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
if (value > popHeight - ArrowLimit) {
|
|
47
39
|
return popHeight - ArrowLimit;
|
|
48
40
|
}
|
|
49
|
-
|
|
50
41
|
return value;
|
|
51
42
|
}
|
|
52
|
-
|
|
53
43
|
function getAvailPosition(rootInfo, isInsertNode) {
|
|
54
44
|
return isInsertNode ? {
|
|
55
45
|
left: rootInfo.offsetLeft,
|
|
@@ -65,17 +55,15 @@ function getAvailPosition(rootInfo, isInsertNode) {
|
|
|
65
55
|
* @param scrollValue 滚动信息
|
|
66
56
|
* @param availValue 浏览器可用大小
|
|
67
57
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
58
|
function getTranslate(_a) {
|
|
71
59
|
var initTranslate = _a.initTranslate,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var limit = initTranslate ? 0 : popupLimitSpacing;
|
|
78
|
-
|
|
60
|
+
popupLimitSpacing = _a.popupLimitSpacing,
|
|
61
|
+
currentValue = _a.currentValue,
|
|
62
|
+
positionValue = _a.positionValue,
|
|
63
|
+
scrollValue = _a.scrollValue,
|
|
64
|
+
availValue = _a.availValue;
|
|
65
|
+
var limit = initTranslate ? 0 : popupLimitSpacing;
|
|
66
|
+
// 小于设备大小
|
|
79
67
|
if (currentValue < availValue - limit * 2) {
|
|
80
68
|
if (positionValue - scrollValue < limit) {
|
|
81
69
|
return {
|
|
@@ -83,7 +71,6 @@ function getTranslate(_a) {
|
|
|
83
71
|
maxValue: null
|
|
84
72
|
};
|
|
85
73
|
}
|
|
86
|
-
|
|
87
74
|
if (positionValue - scrollValue + currentValue + limit > availValue) {
|
|
88
75
|
return {
|
|
89
76
|
translateValue: availValue - (positionValue + currentValue + limit) + scrollValue,
|
|
@@ -98,7 +85,6 @@ function getTranslate(_a) {
|
|
|
98
85
|
maxValue: maxValue
|
|
99
86
|
};
|
|
100
87
|
}
|
|
101
|
-
|
|
102
88
|
return {
|
|
103
89
|
translateValue: initTranslate,
|
|
104
90
|
maxValue: null
|
|
@@ -112,21 +98,18 @@ function getTranslate(_a) {
|
|
|
112
98
|
* @param useHeight
|
|
113
99
|
* @param placement
|
|
114
100
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
101
|
function isTopMoreThanBottom(_a) {
|
|
118
102
|
var rootInfo = _a.rootInfo,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
103
|
+
availHeight = _a.availHeight,
|
|
104
|
+
scrollTop = _a.scrollTop,
|
|
105
|
+
useHeight = _a.useHeight,
|
|
106
|
+
placement = _a.placement;
|
|
123
107
|
var topDistance = rootInfo.top - scrollTop;
|
|
124
|
-
var bottomDistance = availHeight - rootInfo.top + scrollTop - rootInfo.height;
|
|
125
|
-
|
|
108
|
+
var bottomDistance = availHeight - rootInfo.top + scrollTop - rootInfo.height;
|
|
109
|
+
// 当都满足要求时,优先使用给定的位置
|
|
126
110
|
if (topDistance > useHeight && bottomDistance > useHeight) {
|
|
127
111
|
return placement === _constants.LocationType.Top.value || placement === _constants.LocationType.TopLeft.value || placement === _constants.LocationType.TopRight.value;
|
|
128
112
|
}
|
|
129
|
-
|
|
130
113
|
return topDistance > bottomDistance;
|
|
131
114
|
}
|
|
132
115
|
/**
|
|
@@ -137,21 +120,18 @@ function isTopMoreThanBottom(_a) {
|
|
|
137
120
|
* @param useWidth
|
|
138
121
|
* @param placement
|
|
139
122
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
123
|
function isLeftMoreThanRight(_a) {
|
|
143
124
|
var rootInfo = _a.rootInfo,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
125
|
+
availWidth = _a.availWidth,
|
|
126
|
+
scrollLeft = _a.scrollLeft,
|
|
127
|
+
useWidth = _a.useWidth,
|
|
128
|
+
placement = _a.placement;
|
|
148
129
|
var leftDistance = rootInfo.left - scrollLeft;
|
|
149
|
-
var rightDistance = availWidth - rootInfo.left + scrollLeft - rootInfo.width;
|
|
150
|
-
|
|
130
|
+
var rightDistance = availWidth - rootInfo.left + scrollLeft - rootInfo.width;
|
|
131
|
+
// 当都满足要求时,优先使用给定的位置
|
|
151
132
|
if (leftDistance > useWidth && rightDistance > useWidth) {
|
|
152
133
|
return placement === _constants.LocationType.Left.value || placement === _constants.LocationType.LeftTop.value || placement === _constants.LocationType.LeftBottom.value;
|
|
153
134
|
}
|
|
154
|
-
|
|
155
135
|
return leftDistance > rightDistance;
|
|
156
136
|
}
|
|
157
137
|
/**
|
|
@@ -164,20 +144,16 @@ function isLeftMoreThanRight(_a) {
|
|
|
164
144
|
* @param availSize
|
|
165
145
|
* @param rootToPopupSpacing
|
|
166
146
|
*/
|
|
167
|
-
|
|
168
|
-
|
|
169
147
|
function getLocationMethodByPlacement(_a) {
|
|
170
148
|
var rootInfo = _a.rootInfo,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
149
|
+
popInfo = _a.popInfo,
|
|
150
|
+
scrollInfo = _a.scrollInfo,
|
|
151
|
+
placement = _a.placement,
|
|
152
|
+
availSize = _a.availSize,
|
|
153
|
+
rootToPopupSpacing = _a.rootToPopupSpacing;
|
|
177
154
|
var _b = (0, _constants.getLocationInfo)(placement),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
155
|
+
isVertical = _b.isVertical,
|
|
156
|
+
splitArr = _b.splitArr;
|
|
181
157
|
if (isVertical) {
|
|
182
158
|
var useTopLocation = isTopMoreThanBottom({
|
|
183
159
|
rootInfo: rootInfo,
|
|
@@ -190,9 +166,8 @@ function getLocationMethodByPlacement(_a) {
|
|
|
190
166
|
methodStr: useTopLocation ? "Top".concat(splitArr[1]) : "Bottom".concat(splitArr[1]),
|
|
191
167
|
isVertical: true
|
|
192
168
|
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
169
|
+
}
|
|
170
|
+
// 判断悬浮框最终位置
|
|
196
171
|
var useLeftLocation = isLeftMoreThanRight({
|
|
197
172
|
rootInfo: rootInfo,
|
|
198
173
|
placement: placement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobest-ui/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "components common ui for React",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,12 +39,18 @@
|
|
|
39
39
|
"ie 11"
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"registry": "https://registry.npmjs.org/",
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
42
46
|
"homepage": "https://autobest.visualstudio.com/AutoBestChina/_git/AutobestFrontendCommon#readme",
|
|
43
47
|
"peerDependencies": {
|
|
44
|
-
"@autobest-ui/utils": ">=2.0.1",
|
|
45
48
|
"intersection-observer": ">=0.12.0",
|
|
46
49
|
"react": ">=16.8.6",
|
|
47
50
|
"react-transition-group": ">=4.2.2"
|
|
48
51
|
},
|
|
49
|
-
"
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@autobest-ui/utils": "^2.1.0"
|
|
54
|
+
},
|
|
55
|
+
"gitHead": "56e873adb2a68d99dcd56f83cb68f5d4b5d618d6"
|
|
50
56
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|