@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/link-list/index.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _utils = require("@autobest-ui/utils");
|
|
15
|
-
|
|
16
11
|
var _popover = _interopRequireDefault(require("../popover"));
|
|
17
|
-
|
|
18
12
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
19
13
|
var _extendStatics = function extendStatics(d, b) {
|
|
20
14
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -26,48 +20,34 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
26
20
|
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
27
21
|
}
|
|
28
22
|
};
|
|
29
|
-
|
|
30
23
|
return _extendStatics(d, b);
|
|
31
24
|
};
|
|
32
|
-
|
|
33
25
|
return function (d, b) {
|
|
34
26
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
35
|
-
|
|
36
27
|
_extendStatics(d, b);
|
|
37
|
-
|
|
38
28
|
function __() {
|
|
39
29
|
this.constructor = d;
|
|
40
30
|
}
|
|
41
|
-
|
|
42
31
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
43
32
|
};
|
|
44
33
|
}();
|
|
45
|
-
|
|
46
|
-
var LinkList =
|
|
47
|
-
/** @class */
|
|
48
|
-
function (_super) {
|
|
34
|
+
var LinkList = /** @class */function (_super) {
|
|
49
35
|
__extends(LinkList, _super);
|
|
50
|
-
|
|
51
36
|
function LinkList(props) {
|
|
52
37
|
var _this = _super.call(this, props) || this;
|
|
53
|
-
|
|
54
38
|
_this.prefixCls = 'ab-link-list';
|
|
55
|
-
|
|
56
39
|
_this.onVisibleChange = function () {
|
|
57
40
|
_this.setState({
|
|
58
41
|
visible: !_this.state.visible
|
|
59
42
|
});
|
|
60
43
|
};
|
|
61
|
-
|
|
62
44
|
_this.state = {
|
|
63
45
|
visible: props.defaultVisible
|
|
64
46
|
};
|
|
65
47
|
return _this;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
LinkList.prototype.renderItemContent = function (item) {
|
|
69
50
|
var _a;
|
|
70
|
-
|
|
71
51
|
var hrefTarget = this.props.hrefTarget;
|
|
72
52
|
var cls = this.prefixCls;
|
|
73
53
|
return item.url ? /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -80,13 +60,11 @@ function (_super) {
|
|
|
80
60
|
className: (0, _classnames.default)((_a = {}, _a["".concat(cls, "-hidden")] = item.isHidden, _a))
|
|
81
61
|
}, "".concat(item.name, " "));
|
|
82
62
|
};
|
|
83
|
-
|
|
84
63
|
LinkList.prototype.renderItem = function (item) {
|
|
85
64
|
// 判断hiddenPopover和是否有具体的popover参数
|
|
86
65
|
if (this.props.hiddenPopover || (0, _utils.isEmptyObject)(item.subInfo)) {
|
|
87
66
|
return this.renderItemContent(item);
|
|
88
67
|
}
|
|
89
|
-
|
|
90
68
|
var subInfo = item.subInfo;
|
|
91
69
|
var cls = this.prefixCls;
|
|
92
70
|
return /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
@@ -107,37 +85,32 @@ function (_super) {
|
|
|
107
85
|
mouseEnterDelay: 0.1
|
|
108
86
|
}, this.renderItemContent(item));
|
|
109
87
|
};
|
|
110
|
-
|
|
111
88
|
LinkList.prototype.renderContent = function () {
|
|
112
89
|
var _this = this;
|
|
113
|
-
|
|
114
90
|
var _a = this.props,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
91
|
+
hiddenPopover = _a.hiddenPopover,
|
|
92
|
+
options = _a.options;
|
|
93
|
+
// 隐藏popover和忽略分列
|
|
118
94
|
if (hiddenPopover) {
|
|
119
95
|
return options.map(function (item) {
|
|
120
96
|
return _this.renderItemContent(item);
|
|
121
97
|
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
98
|
+
}
|
|
99
|
+
// 忽略分列
|
|
125
100
|
return options.map(function (item) {
|
|
126
101
|
return _this.renderItem(item);
|
|
127
102
|
});
|
|
128
103
|
};
|
|
129
|
-
|
|
130
104
|
LinkList.prototype.render = function () {
|
|
131
105
|
var _a, _b;
|
|
132
|
-
|
|
133
106
|
var cls = this.prefixCls;
|
|
134
107
|
var visible = this.state.visible;
|
|
135
108
|
var _c = this.props,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
109
|
+
className = _c.className,
|
|
110
|
+
title = _c.title,
|
|
111
|
+
extraTopElement = _c.extraTopElement,
|
|
112
|
+
extraBottomElement = _c.extraBottomElement,
|
|
113
|
+
columnCount = _c.columnCount;
|
|
141
114
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
142
115
|
className: (0, _classnames.default)(cls, className)
|
|
143
116
|
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -151,7 +124,6 @@ function (_super) {
|
|
|
151
124
|
className: (0, _classnames.default)("".concat(cls, "-content"), "".concat(cls, "-col").concat(columnCount))
|
|
152
125
|
}, this.renderContent()), extraBottomElement));
|
|
153
126
|
};
|
|
154
|
-
|
|
155
127
|
LinkList.defaultProps = {
|
|
156
128
|
className: '',
|
|
157
129
|
hrefTarget: '_self',
|
|
@@ -162,6 +134,5 @@ function (_super) {
|
|
|
162
134
|
};
|
|
163
135
|
return LinkList;
|
|
164
136
|
}(_react.default.Component);
|
|
165
|
-
|
|
166
137
|
var _default = LinkList;
|
|
167
138
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-link-list-title{font-size:.16rem;margin:0
|
|
1
|
+
.ab-trigger-wrap{position:absolute;top:0;left:0;z-index:101}.ab-trigger-wrap.ab-trigger-hidden{display:none}.ab-trigger-mask{position:fixed;top:0;left:0;bottom:0;right:0;z-index:101;background-color:transparent;display:none}.ab-trigger-mask.ab-trigger-mask-show{display:block}.ab-trigger-fade-appear,.ab-trigger-fade-enter,.ab-trigger-fade-hr-appear,.ab-trigger-fade-hr-enter{opacity:0}.ab-trigger-fade-appear,.ab-trigger-fade-enter{transform:scale(.7)}.ab-trigger-fade-hr-appear,.ab-trigger-fade-hr-enter{opacity:0;transform:scaleY(.7)}.ab-trigger-fade-appear-active,.ab-trigger-fade-enter-active,.ab-trigger-fade-hr-appear-active,.ab-trigger-fade-hr-enter-active{opacity:1;transition:opacity .2s,transform .2s}.ab-trigger-fade-appear-active,.ab-trigger-fade-enter-active{transform:scale(1)}.ab-trigger-fade-hr-appear-active,.ab-trigger-fade-hr-enter-active{transform:scaleY(1)}.ab-trigger-fade-exit,.ab-trigger-fade-hr-exit{opacity:1}.ab-trigger-fade-exit-active,.ab-trigger-fade-hr-exit-active{opacity:0;transition:opacity .2s,transform .2s}.ab-trigger-fade-exit-active{transform:scale(.7)}.ab-trigger-fade-hr-exit-active{transform:scaleY(.7)}.ab-trigger-fade-exit-done,.ab-trigger-fade-hr-exit-done{display:none}.ab-popover-wrap{background-color:#fff;background-clip:padding-box;box-shadow:0 2px 8px rgba(0,0,0,.15);padding:.08rem .11rem .05rem;min-width:210px;border-radius:4px}.ab-popover-inner{position:relative;width:100%;overflow:hidden;font-size:.12rem}.ab-popover-inner-expand{padding-right:.1rem}.ab-popover-arrow{position:absolute;display:block;width:8px;height:8px;border-style:solid;background-color:#fff;border-color:transparent #fff #fff transparent;border-width:4px;box-shadow:3px 3px 7px rgba(0,0,0,.07)}.ab-popover-close{position:absolute;right:.02rem;top:.05rem;cursor:pointer;padding:0 .05rem;color:#bfbfbf;font-size:.2rem;line-height:1;z-index:2}.ab-popover-close:hover{color:#4a4a4a}@media only screen and (max-width:767px){.ab-popover-wrap{width:calc(100% - .3rem)}}.ab-link-list-title{font-size:.16rem;margin:0;padding:0 0 .12rem;display:flex;justify-content:space-between;align-items:center}.ab-link-list-icon{display:none}.ab-link-list-content{flex-wrap:wrap;width:auto;margin-right:-.15rem}.ab-link-list-content.ab-link-list-col2>a,.ab-link-list-content.ab-link-list-col2>span{min-width:calc(100% / 2 - .15rem);max-width:calc(100% / 2 - .15rem)}.ab-link-list-content.ab-link-list-col4>a,.ab-link-list-content.ab-link-list-col4>span{min-width:calc(100% / 4 - .15rem);max-width:calc(100% / 4 - .15rem)}.ab-link-list-content.ab-link-list-col5>a,.ab-link-list-content.ab-link-list-col5>span{min-width:calc(100% / 5 - .15rem);max-width:calc(100% / 5 - .15rem)}.ab-link-list-content.ab-link-list-col6>a,.ab-link-list-content.ab-link-list-col6>span{min-width:calc(100% / 6 - .15rem);max-width:calc(100% / 6 - .15rem)}.ab-link-list-content.ab-link-list-col8>a,.ab-link-list-content.ab-link-list-col8>span{min-width:calc(100% / 8 - .15rem);max-width:calc(100% / 8 - .15rem)}.ab-link-list-content>a,.ab-link-list-content>span{cursor:pointer;border:.5px solid #d0d0d0;margin-bottom:8px;display:inline-block;justify-content:space-between;align-items:center;width:100%;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.085rem .15rem .085rem .12rem;color:#333;margin-right:.15rem}.ab-link-list-content>a::after,.ab-link-list-content>span::after{content:">";position:absolute;right:.1rem;top:50%;transform:translateY(-50%);color:grey;font-size:.12rem}.ab-link-list-content>a:hover,.ab-link-list-content>span:hover{text-decoration:underline;color:#f97601}.ab-link-list-content>.ab-link-list-hidden{display:none}.ab-link-list-wrap-popover.ab-popover-wrap{max-width:3.5rem;min-width:3rem}.ab-link-list-sub-title{display:block;padding-bottom:.06rem;font-size:.12rem}.ab-link-list-sub-link{text-decoration:underline;color:#333;font-size:.12rem;padding:0 .05rem .05rem 0;display:inline-block}@media only screen and (max-width:767px){.ab-link-list-divider{border-bottom:1px solid #d0d0d0}.ab-link-list-body{height:0;width:0;overflow:hidden}.ab-link-list-body.ab-link-list-active{height:auto;width:auto}.ab-link-list-content.ab-link-list-col2>a,.ab-link-list-content.ab-link-list-col2>span,.ab-link-list-content.ab-link-list-col4>a,.ab-link-list-content.ab-link-list-col4>span,.ab-link-list-content.ab-link-list-col5>a,.ab-link-list-content.ab-link-list-col5>span,.ab-link-list-content.ab-link-list-col6>a,.ab-link-list-content.ab-link-list-col6>span,.ab-link-list-content.ab-link-list-col8>a,.ab-link-list-content.ab-link-list-col8>span{min-width:calc(50% - .15rem);max-width:calc(50% - .15rem)}.ab-link-list-icon{font-weight:700;font-size:.22rem;cursor:pointer;width:.2rem;height:.2rem;display:flex;align-items:center;justify-content:center}}
|
package/lib/loading/index.js
CHANGED
|
@@ -1,79 +1,59 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("@autobest-ui/utils");
|
|
17
|
-
|
|
18
12
|
var _loadingIcon = _interopRequireDefault(require("../loading-icon"));
|
|
19
|
-
|
|
20
13
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
21
14
|
__assign = Object.assign || function (t) {
|
|
22
15
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23
16
|
s = arguments[i];
|
|
24
|
-
|
|
25
17
|
for (var p in s) {
|
|
26
18
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
27
19
|
}
|
|
28
20
|
}
|
|
29
|
-
|
|
30
21
|
return t;
|
|
31
22
|
};
|
|
32
|
-
|
|
33
23
|
return __assign.apply(this, arguments);
|
|
34
24
|
};
|
|
35
|
-
|
|
36
25
|
// 缓存创建的loading元素
|
|
37
26
|
var loadingElement = null;
|
|
38
27
|
var loadingTimer = null;
|
|
39
28
|
var closeTimer = null;
|
|
40
29
|
var prevCustomIcon = null;
|
|
41
30
|
var cls = 'ab-loading';
|
|
42
|
-
|
|
43
31
|
function getLoadingContainer(customIcon, className) {
|
|
44
32
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
45
33
|
className: (0, _classnames.default)("".concat(cls, "-wrap"), className)
|
|
46
34
|
}, customIcon || /*#__PURE__*/_react.default.createElement(_loadingIcon.default, {
|
|
47
35
|
className: "".concat(cls, "-content")
|
|
48
36
|
}));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
}
|
|
38
|
+
// openIds 容器
|
|
39
|
+
var openIds = [];
|
|
40
|
+
// closeIds 容器
|
|
54
41
|
var closeIds = [];
|
|
55
|
-
|
|
56
42
|
function createLoading(customIcon, className) {
|
|
57
43
|
loadingElement = document.createElement('div');
|
|
58
44
|
document.body.appendChild(loadingElement);
|
|
59
|
-
|
|
60
45
|
_reactDom.default.render(getLoadingContainer(customIcon, className), loadingElement);
|
|
61
46
|
}
|
|
62
|
-
|
|
63
|
-
var Loading =
|
|
64
|
-
/** @class */
|
|
65
|
-
function () {
|
|
47
|
+
var Loading = /** @class */function () {
|
|
66
48
|
function Loading() {}
|
|
67
|
-
|
|
68
49
|
Loading.open = function (config) {
|
|
69
50
|
if (!_utils.canUseDOM) {
|
|
70
51
|
return null;
|
|
71
52
|
}
|
|
72
|
-
|
|
73
53
|
config = __assign({
|
|
74
54
|
expire: 0
|
|
75
|
-
}, config);
|
|
76
|
-
|
|
55
|
+
}, config);
|
|
56
|
+
// 防止重复创建或自定义loading icon,重新创建
|
|
77
57
|
if (!loadingElement) {
|
|
78
58
|
createLoading(config.customIcon, config.className);
|
|
79
59
|
} else if (config.customIcon || config.customIcon !== prevCustomIcon) {
|
|
@@ -83,76 +63,61 @@ function () {
|
|
|
83
63
|
loadingElement = null;
|
|
84
64
|
} catch (e) {}
|
|
85
65
|
}
|
|
86
|
-
|
|
87
66
|
createLoading(config.customIcon, config.className);
|
|
88
67
|
} else {
|
|
89
68
|
loadingElement.style.display = 'block';
|
|
90
69
|
}
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
prevCustomIcon = config.customIcon;
|
|
71
|
+
// 如果配置中有expire且大于0
|
|
93
72
|
// 将会在到达时间后自动关闭,不用手动再关闭(不需要再close())
|
|
94
|
-
|
|
95
73
|
if (config.expire > 0) {
|
|
96
74
|
loadingTimer = setTimeout(function () {
|
|
97
75
|
Loading.close();
|
|
98
76
|
}, config.expire);
|
|
99
77
|
}
|
|
100
|
-
|
|
101
78
|
var id = new Date().getTime();
|
|
102
79
|
openIds.push(id);
|
|
103
80
|
return id;
|
|
104
81
|
};
|
|
105
|
-
|
|
106
82
|
Loading.close = function (closeId) {
|
|
107
83
|
if (!_utils.canUseDOM) {
|
|
108
84
|
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
85
|
+
}
|
|
86
|
+
// 防止重复关闭
|
|
112
87
|
if (loadingTimer) {
|
|
113
88
|
clearTimeout(loadingTimer);
|
|
114
89
|
}
|
|
115
|
-
|
|
116
90
|
if (closeTimer) {
|
|
117
91
|
clearTimeout(closeTimer);
|
|
118
92
|
}
|
|
119
|
-
|
|
120
93
|
if (!closeId) {
|
|
121
94
|
openIds = [];
|
|
122
95
|
closeIds = [];
|
|
123
|
-
|
|
124
96
|
if (loadingElement) {
|
|
125
97
|
loadingElement.style.display = 'none';
|
|
126
98
|
}
|
|
127
|
-
|
|
128
99
|
return;
|
|
129
100
|
}
|
|
130
|
-
|
|
131
|
-
|
|
101
|
+
closeIds.push(closeId);
|
|
102
|
+
// 代码执行时,由于一些接口loading很短暂,而另一个接口还没有开始调用,
|
|
132
103
|
// 只有closeId是不能真正解决一些特殊loading抖动情况,
|
|
133
104
|
// 根据js的任务队列,我们加入setTimeout,只有主线程结束后才执行销毁
|
|
134
|
-
|
|
135
105
|
closeTimer = setTimeout(function () {
|
|
136
106
|
closeIds.forEach(function (id) {
|
|
137
107
|
var index = openIds.indexOf(id);
|
|
138
|
-
|
|
139
108
|
if (index >= 0) {
|
|
140
109
|
openIds.splice(index, 1);
|
|
141
110
|
}
|
|
142
111
|
});
|
|
143
|
-
|
|
144
112
|
if (!openIds.length) {
|
|
145
113
|
closeIds = [];
|
|
146
|
-
|
|
147
114
|
if (loadingElement) {
|
|
148
115
|
loadingElement.style.display = 'none';
|
|
149
116
|
}
|
|
150
117
|
}
|
|
151
118
|
});
|
|
152
119
|
};
|
|
153
|
-
|
|
154
120
|
return Loading;
|
|
155
121
|
}();
|
|
156
|
-
|
|
157
122
|
var _default = Loading;
|
|
158
123
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-loading-wrap{position:fixed;top:0;left:0;z-index:9999;background-color:rgba(255,255,255,.7);height:100%;width:100%}.ab-loading-wrap .ab-loading-content{position:absolute;left:50%;top:50%;display:block;width:.31rem;height:.31rem;transform:
|
|
1
|
+
.ab-svg-loading{display:inline-block}.ab-svg-loading-icon{display:block;width:.31rem;height:.31rem;animation:1s linear infinite reverse loading}@keyframes loading{0%{transform:rotate(0)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.ab-loading-wrap{position:fixed;top:0;left:0;z-index:9999;background-color:rgba(255,255,255,.7);height:100%;width:100%}.ab-loading-wrap .ab-loading-content{position:absolute;left:50%;top:50%;display:block;width:.31rem;height:.31rem;transform:translate(-50%,-50%)}
|
package/lib/loading-bar/index.js
CHANGED
|
@@ -1,18 +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.default = LoadingBar;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _portal = _interopRequireDefault(require("../portal"));
|
|
13
|
-
|
|
14
10
|
var cls = 'ab-loading-bar';
|
|
15
|
-
|
|
16
11
|
function LoadingBar() {
|
|
17
12
|
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
18
13
|
className: cls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-loading-bar{position:fixed;top:0;left:0;margin-bottom:-3px;height:3px;width:100%;z-index:999}@keyframes movingBar{0%{left:50%;right:50%}99.9%{left:0;right:0}100%{left:50%;right:50%}}@keyframes changeBar{0
|
|
1
|
+
.ab-loading-bar{position:fixed;top:0;left:0;margin-bottom:-3px;height:3px;width:100%;z-index:999}@keyframes movingBar{0%{left:50%;right:50%}99.9%{left:0;right:0}100%{left:50%;right:50%}}@keyframes changeBar{0%,33.3%{background-color:#0aa770}33.33%{background-color:red}66.6%,66.66%{background-color:#f987d6}99.9%{background-color:#00bcd4}}.ab-loading-bar-bar{position:absolute;height:0;width:100%;text-indent:-9999px;background-color:#0aa770;animation:2.25s infinite changeBar}.ab-loading-bar-bar::before{content:"";height:3px;position:absolute;left:50%;right:50%;background-color:inherit;animation:.75s infinite movingBar}
|
|
@@ -1,27 +1,20 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _loadingIcon = _interopRequireDefault(require("../loading-icon"));
|
|
15
|
-
|
|
16
11
|
var cls = 'ab-loading-container';
|
|
17
|
-
|
|
18
12
|
function LoadingContainer(props) {
|
|
19
13
|
var _a;
|
|
20
|
-
|
|
21
14
|
var _b = props.loading,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
loading = _b === void 0 ? false : _b,
|
|
16
|
+
className = props.className,
|
|
17
|
+
children = props.children;
|
|
25
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
19
|
className: (0, _classnames.default)(className, cls, (_a = {}, _a["".concat(cls, "-active")] = loading, _a))
|
|
27
20
|
}, children, loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -30,6 +23,5 @@ function LoadingContainer(props) {
|
|
|
30
23
|
className: "".concat(cls, "-icon")
|
|
31
24
|
})));
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
var _default = LoadingContainer;
|
|
35
27
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-loading-container{position:relative}.ab-loading-container-active{user-select:none;pointer-events:none}.ab-loading-container-icon-box{position:absolute;background-color:rgba(255,255,255,.7);top:0;left:0;z-index:4;display:block;width:100%;height:100%}.ab-loading-container-icon{position:absolute;top:50%;left:50%;transform:
|
|
1
|
+
.ab-svg-loading{display:inline-block}.ab-svg-loading-icon{display:block;width:.31rem;height:.31rem;animation:1s linear infinite reverse loading}@keyframes loading{0%{transform:rotate(0)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.ab-loading-container{position:relative}.ab-loading-container-active{user-select:none;pointer-events:none}.ab-loading-container-icon-box{position:absolute;background-color:rgba(255,255,255,.7);top:0;left:0;z-index:4;display:block;width:100%;height:100%}.ab-loading-container-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
|
|
@@ -1,18 +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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var cls = 'ab-svg-loading';
|
|
15
|
-
|
|
16
11
|
var LoadingIcon = function LoadingIcon(props) {
|
|
17
12
|
var className = props.className;
|
|
18
13
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -65,7 +60,5 @@ var LoadingIcon = function LoadingIcon(props) {
|
|
|
65
60
|
fill: "#fff"
|
|
66
61
|
})));
|
|
67
62
|
};
|
|
68
|
-
|
|
69
63
|
var _default = /*#__PURE__*/_react.default.memo(LoadingIcon);
|
|
70
|
-
|
|
71
64
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-svg-loading{display:inline-block}.ab-svg-loading-icon{display:block;width:.31rem;height:.31rem;animation:
|
|
1
|
+
.ab-svg-loading{display:inline-block}.ab-svg-loading-icon{display:block;width:.31rem;height:.31rem;animation:1s linear infinite reverse loading}@keyframes loading{0%{transform:rotate(0)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}
|
package/lib/mask/index.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _reactTransitionGroup = require("react-transition-group");
|
|
15
|
-
|
|
16
11
|
var _utils = require("@autobest-ui/utils");
|
|
17
|
-
|
|
18
12
|
var prefixCls = 'ab-mask';
|
|
19
|
-
|
|
20
13
|
function Mask(_a, ref) {
|
|
21
14
|
var className = _a.className,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
_b = _a.timeout,
|
|
16
|
+
timeout = _b === void 0 ? 300 : _b,
|
|
17
|
+
_c = _a.onClose,
|
|
18
|
+
onClose = _c === void 0 ? function () {} : _c,
|
|
19
|
+
visible = _a.visible;
|
|
20
|
+
// mousedown和touchstart会一起触发,这里判断后,只执行一次
|
|
28
21
|
var onChangeVisible = _react.default.useCallback(function (event) {
|
|
29
22
|
var touch = (0, _utils.isTouchScreen)();
|
|
30
|
-
|
|
31
23
|
if (event.type === 'touchstart' && touch || event.type === 'mousedown' && !touch) {
|
|
32
24
|
onClose(event);
|
|
33
25
|
}
|
|
34
26
|
}, [onClose]);
|
|
35
|
-
|
|
36
27
|
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
37
28
|
in: visible,
|
|
38
29
|
timeout: timeout,
|
|
@@ -45,7 +36,5 @@ function Mask(_a, ref) {
|
|
|
45
36
|
ref: ref
|
|
46
37
|
}));
|
|
47
38
|
}
|
|
48
|
-
|
|
49
39
|
var _default = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(Mask));
|
|
50
|
-
|
|
51
40
|
exports.default = _default;
|
package/lib/mask/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-mask{position:fixed;top:0;left:0;z-index:101;width:100%;height:100%;background-color:rgba(0,0,0,.45);transition:opacity .4s cubic-bezier(.7,.3,.1,1)}.ab-mask-fade-appear,.ab-mask-fade-enter{opacity:0}.ab-mask-fade-appear-active,.ab-mask-fade-enter-active,.ab-mask-fade-enter-done
|
|
1
|
+
.ab-mask{position:fixed;top:0;left:0;z-index:101;width:100%;height:100%;background-color:rgba(0,0,0,.45);transition:opacity .4s cubic-bezier(.7,.3,.1,1)}.ab-mask-fade-appear,.ab-mask-fade-enter{opacity:0}.ab-mask-fade-appear-active,.ab-mask-fade-enter-active,.ab-mask-fade-enter-done,.ab-mask-fade-exit{opacity:1}.ab-mask-fade-exit-active{opacity:0}.ab-mask-fade-exit-done{display:none}
|
package/lib/message/index.d.ts
CHANGED
|
@@ -5,20 +5,31 @@ export interface MessageProps {
|
|
|
5
5
|
*/
|
|
6
6
|
content: React.ReactNode;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 支持多种样式
|
|
9
9
|
*/
|
|
10
|
-
className?: string;
|
|
11
10
|
contentClassName?: string;
|
|
12
11
|
/**
|
|
13
12
|
* 提示文字显示的时间,达到时间后自动关闭
|
|
14
13
|
*/
|
|
15
14
|
expires?: number;
|
|
15
|
+
/**
|
|
16
|
+
* 销毁后的回调
|
|
17
|
+
*/
|
|
18
|
+
onDestroy?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface MessageConfig {
|
|
21
|
+
className?: string;
|
|
22
|
+
expires?: number;
|
|
16
23
|
/**
|
|
17
24
|
* 最多同时显示的提示文字条数
|
|
18
25
|
*/
|
|
19
26
|
maxCount?: number;
|
|
20
|
-
width?: string;
|
|
21
|
-
height?: string;
|
|
22
|
-
onDestroy?: (id: number) => void;
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
declare function Message(props: MessageProps): {
|
|
29
|
+
onCloseAll: () => void;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
};
|
|
32
|
+
declare namespace Message {
|
|
33
|
+
var setConfig: (config: MessageConfig) => void;
|
|
34
|
+
}
|
|
35
|
+
export default Message;
|