@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/accordion/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 _Item = _interopRequireDefault(require("./Item"));
|
|
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,68 +20,49 @@ 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
34
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
47
35
|
__assign = Object.assign || function (t) {
|
|
48
36
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
49
37
|
s = arguments[i];
|
|
50
|
-
|
|
51
38
|
for (var p in s) {
|
|
52
39
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
53
40
|
}
|
|
54
41
|
}
|
|
55
|
-
|
|
56
42
|
return t;
|
|
57
43
|
};
|
|
58
|
-
|
|
59
44
|
return __assign.apply(this, arguments);
|
|
60
45
|
};
|
|
61
|
-
|
|
62
|
-
var Accordion =
|
|
63
|
-
/** @class */
|
|
64
|
-
function (_super) {
|
|
46
|
+
var Accordion = /** @class */function (_super) {
|
|
65
47
|
__extends(Accordion, _super);
|
|
66
|
-
|
|
67
48
|
function Accordion(props) {
|
|
68
49
|
var _this = _super.call(this, props) || this;
|
|
69
|
-
|
|
70
50
|
_this.prefixCls = 'ab-accordion';
|
|
71
51
|
/** *
|
|
72
52
|
* 展开下拉链接列表
|
|
73
53
|
* @param name
|
|
74
54
|
*/
|
|
75
|
-
|
|
76
55
|
_this.onVisibleChange = function (name) {
|
|
77
56
|
var _a, _b;
|
|
78
|
-
|
|
79
57
|
var _c = _this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
interactive = _c.interactive,
|
|
59
|
+
beforeVisibleChange = _c.beforeVisibleChange,
|
|
60
|
+
onVisibleChange = _c.onVisibleChange;
|
|
84
61
|
if (beforeVisibleChange) {
|
|
85
62
|
beforeVisibleChange(name);
|
|
86
63
|
}
|
|
87
|
-
|
|
88
64
|
var visibleNames = _this.state.visibleNames;
|
|
89
65
|
var isCurVisible = visibleNames[name];
|
|
90
|
-
|
|
91
66
|
if (interactive) {
|
|
92
67
|
// 能同时展开多项,只对当前项做展开/闭合操作
|
|
93
68
|
_this.setState({
|
|
@@ -99,34 +74,28 @@ function (_super) {
|
|
|
99
74
|
visibleNames: (_b = {}, _b[name] = !isCurVisible, _b)
|
|
100
75
|
});
|
|
101
76
|
}
|
|
102
|
-
|
|
103
77
|
if (onVisibleChange) {
|
|
104
78
|
onVisibleChange(name, !isCurVisible);
|
|
105
79
|
}
|
|
106
80
|
};
|
|
107
|
-
|
|
108
81
|
var visibleNames = {};
|
|
109
82
|
var defaultVisibleNames = props.defaultVisibleNames;
|
|
110
|
-
|
|
111
83
|
if (!(0, _utils.isEmptyArray)(defaultVisibleNames)) {
|
|
112
84
|
defaultVisibleNames.forEach(function (name) {
|
|
113
85
|
visibleNames[name] = true;
|
|
114
86
|
});
|
|
115
87
|
}
|
|
116
|
-
|
|
117
88
|
_this.state = {
|
|
118
89
|
visibleNames: visibleNames
|
|
119
90
|
};
|
|
120
91
|
return _this;
|
|
121
92
|
}
|
|
122
|
-
|
|
123
93
|
Accordion.prototype.render = function () {
|
|
124
94
|
var _this = this;
|
|
125
|
-
|
|
126
95
|
var cls = this.prefixCls;
|
|
127
96
|
var _a = this.props,
|
|
128
|
-
|
|
129
|
-
|
|
97
|
+
className = _a.className,
|
|
98
|
+
children = _a.children;
|
|
130
99
|
var visibleNames = this.state.visibleNames;
|
|
131
100
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
132
101
|
className: (0, _classnames.default)(cls, className)
|
|
@@ -140,9 +109,8 @@ function (_super) {
|
|
|
140
109
|
visible: !!visibleNames[name]
|
|
141
110
|
});
|
|
142
111
|
}));
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
112
|
+
};
|
|
113
|
+
// 限制用户传入的参数,所以用BaseAccordionItemProps
|
|
146
114
|
Accordion.Item = _Item.default;
|
|
147
115
|
Accordion.defaultProps = {
|
|
148
116
|
className: '',
|
|
@@ -151,6 +119,5 @@ function (_super) {
|
|
|
151
119
|
};
|
|
152
120
|
return Accordion;
|
|
153
121
|
}(_react.default.Component);
|
|
154
|
-
|
|
155
122
|
var _default = Accordion;
|
|
156
123
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ab-collapse{transform-origin:left top;transition:opacity .2s,height .2s}.ab-collapse-hidden{height:0;overflow:hidden}.ab-collapse-fade-enter{opacity:.8;overflow:hidden}.ab-collapse-fade-enter-active{opacity:1;overflow:hidden}.ab-collapse-fade-enter-done{opacity:1;overflow:initial}.ab-collapse-fade-exit{opacity:1;overflow:hidden}.ab-collapse-fade-exit-active{opacity:.8;overflow:hidden}.ab-collapse-fade-exit-done{display:none;overflow:initial}
|
package/lib/affix/PortalAffix.js
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
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 _portal = _interopRequireDefault(require("../portal"));
|
|
17
|
-
|
|
18
12
|
function PortalAffix(_a, ref) {
|
|
19
13
|
var cls = _a.prefixCls,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
visible = _a.visible,
|
|
15
|
+
children = _a.children,
|
|
16
|
+
top = _a.top,
|
|
17
|
+
left = _a.left,
|
|
18
|
+
width = _a.width,
|
|
19
|
+
className = _a.className,
|
|
20
|
+
fadeEffect = _a.fadeEffect;
|
|
27
21
|
var style = {
|
|
28
22
|
top: top,
|
|
29
23
|
left: left,
|
|
30
24
|
width: width
|
|
31
25
|
};
|
|
32
|
-
|
|
33
26
|
if (fadeEffect) {
|
|
34
27
|
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
35
28
|
in: visible,
|
|
@@ -42,7 +35,6 @@ function PortalAffix(_a, ref) {
|
|
|
42
35
|
className: (0, _classnames.default)(className, "".concat(cls, "-custom"))
|
|
43
36
|
}, children)));
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
style.display = visible ? '' : 'none';
|
|
47
39
|
return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
48
40
|
style: style,
|
|
@@ -50,7 +42,5 @@ function PortalAffix(_a, ref) {
|
|
|
50
42
|
className: (0, _classnames.default)(className, "".concat(cls, "-custom"))
|
|
51
43
|
}, children));
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
var _default = /*#__PURE__*/_react.default.forwardRef(PortalAffix);
|
|
55
|
-
|
|
56
46
|
exports.default = _default;
|
package/lib/affix/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 _PortalAffix = _interopRequireDefault(require("./PortalAffix"));
|
|
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,91 +20,69 @@ 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
34
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
47
35
|
__assign = Object.assign || function (t) {
|
|
48
36
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
49
37
|
s = arguments[i];
|
|
50
|
-
|
|
51
38
|
for (var p in s) {
|
|
52
39
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
53
40
|
}
|
|
54
41
|
}
|
|
55
|
-
|
|
56
42
|
return t;
|
|
57
43
|
};
|
|
58
|
-
|
|
59
44
|
return __assign.apply(this, arguments);
|
|
60
45
|
};
|
|
61
|
-
|
|
62
|
-
var Affix =
|
|
63
|
-
/** @class */
|
|
64
|
-
function (_super) {
|
|
46
|
+
var Affix = /** @class */function (_super) {
|
|
65
47
|
__extends(Affix, _super);
|
|
66
|
-
|
|
67
48
|
function Affix(props) {
|
|
68
49
|
var _this = _super.call(this, props) || this;
|
|
69
|
-
|
|
70
50
|
_this.prefixCls = 'ab-affix';
|
|
71
51
|
_this.resizeHandler = null;
|
|
72
52
|
_this.wrapRef = /*#__PURE__*/_react.default.createRef();
|
|
73
53
|
_this.customRef = /*#__PURE__*/_react.default.createRef();
|
|
74
|
-
|
|
75
54
|
_this.onHandlerScroll = function (isResize) {
|
|
76
55
|
var _a = _this.props,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
offsetTop = _a.offsetTop,
|
|
57
|
+
onChange = _a.onChange,
|
|
58
|
+
onScroll = _a.onScroll,
|
|
59
|
+
renderAffix = _a.renderAffix,
|
|
60
|
+
allWidth = _a.allWidth,
|
|
61
|
+
fadeEffect = _a.fadeEffect,
|
|
62
|
+
getFixedStatus = _a.getFixedStatus,
|
|
63
|
+
ignoreHorizontalFixed = _a.ignoreHorizontalFixed;
|
|
85
64
|
var element = _this.wrapRef.current;
|
|
86
|
-
|
|
87
65
|
if (!element) {
|
|
88
66
|
return;
|
|
89
67
|
}
|
|
90
|
-
|
|
91
68
|
var _b = (0, _utils.getScrollOffset)(),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
scrollTop = _b.top,
|
|
70
|
+
scrollLeft = _b.left;
|
|
71
|
+
var parentElement = element.parentNode;
|
|
72
|
+
// 元素信息
|
|
97
73
|
var positionElement = _this.isFixed && !renderAffix ? parentElement : element;
|
|
98
74
|
var positionInfo = (0, _utils.getOffsetAndSize)(positionElement);
|
|
99
|
-
|
|
100
75
|
if (ignoreHorizontalFixed) {
|
|
101
76
|
var ignoreScrollLeft = (0, _utils.getOffset)(positionElement, true).left;
|
|
102
77
|
positionInfo.left = ignoreScrollLeft;
|
|
103
78
|
}
|
|
104
|
-
|
|
105
79
|
var currentFixed = getFixedStatus({
|
|
106
80
|
positionInfo: positionInfo,
|
|
107
81
|
scrollTop: scrollTop,
|
|
108
82
|
offsetTop: offsetTop
|
|
109
83
|
});
|
|
110
|
-
|
|
111
84
|
if (_this.isFixed && !currentFixed) {
|
|
112
85
|
_this.isFixed = false;
|
|
113
|
-
|
|
114
86
|
if (renderAffix || fadeEffect) {
|
|
115
87
|
_this.setState({
|
|
116
88
|
visible: false
|
|
@@ -123,13 +95,11 @@ function (_super) {
|
|
|
123
95
|
parentElement.style.width = '';
|
|
124
96
|
parentElement.style.height = '';
|
|
125
97
|
}
|
|
126
|
-
|
|
127
98
|
onChange(false);
|
|
128
99
|
} else if ((!_this.isFixed || isResize) && currentFixed) {
|
|
129
100
|
_this.isFixed = true;
|
|
130
101
|
var documentWidth = document.body.offsetWidth;
|
|
131
102
|
var allWidthLeft = ignoreHorizontalFixed ? "-".concat(scrollLeft, "px") : '0px';
|
|
132
|
-
|
|
133
103
|
if (renderAffix || fadeEffect) {
|
|
134
104
|
_this.setState({
|
|
135
105
|
visible: true,
|
|
@@ -145,14 +115,11 @@ function (_super) {
|
|
|
145
115
|
parentElement.style.width = "".concat(positionInfo.width, "px");
|
|
146
116
|
parentElement.style.height = "".concat(positionInfo.height, "px");
|
|
147
117
|
}
|
|
148
|
-
|
|
149
118
|
onChange(true);
|
|
150
119
|
} else if (_this.isFixed && currentFixed && ignoreHorizontalFixed) {
|
|
151
120
|
var allWidthLeft = "-".concat(scrollLeft, "px");
|
|
152
|
-
|
|
153
121
|
if (renderAffix || fadeEffect) {
|
|
154
122
|
var left = allWidth ? allWidthLeft : "".concat(positionInfo.left, "px");
|
|
155
|
-
|
|
156
123
|
if (left !== _this.state.left) {
|
|
157
124
|
_this.setState({
|
|
158
125
|
left: left
|
|
@@ -162,7 +129,6 @@ function (_super) {
|
|
|
162
129
|
element.style.left = allWidth ? allWidthLeft : "".concat(positionInfo.left, "px");
|
|
163
130
|
}
|
|
164
131
|
}
|
|
165
|
-
|
|
166
132
|
if (onScroll) {
|
|
167
133
|
onScroll(__assign(__assign({}, positionInfo), {
|
|
168
134
|
scrollTop: scrollTop,
|
|
@@ -170,7 +136,6 @@ function (_super) {
|
|
|
170
136
|
}));
|
|
171
137
|
}
|
|
172
138
|
};
|
|
173
|
-
|
|
174
139
|
_this.state = {
|
|
175
140
|
visible: false,
|
|
176
141
|
left: '',
|
|
@@ -179,47 +144,41 @@ function (_super) {
|
|
|
179
144
|
};
|
|
180
145
|
return _this;
|
|
181
146
|
}
|
|
182
|
-
|
|
183
147
|
Affix.prototype.componentDidMount = function () {
|
|
184
148
|
var _this = this;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
149
|
+
this.onHandlerScroll();
|
|
150
|
+
// 滚动监听
|
|
188
151
|
this.scrollHandler = (0, _utils.addEventListener)(window, 'scroll', (0, _utils.throttleWithRAF)(function () {
|
|
189
152
|
return _this.onHandlerScroll();
|
|
190
|
-
}));
|
|
191
|
-
|
|
153
|
+
}));
|
|
154
|
+
// resize 监听
|
|
192
155
|
if (!this.resizeHandler) {
|
|
193
156
|
this.resizeHandler = (0, _utils.addEventListener)(window, 'resize', (0, _utils.throttleWithRAF)(function () {
|
|
194
157
|
return _this.onHandlerScroll(true);
|
|
195
158
|
}));
|
|
196
159
|
}
|
|
197
160
|
};
|
|
198
|
-
|
|
199
161
|
Affix.prototype.componentWillUnmount = function () {
|
|
200
162
|
if (this.scrollHandler) {
|
|
201
163
|
this.scrollHandler.remove();
|
|
202
164
|
this.scrollHandler = null;
|
|
203
165
|
}
|
|
204
|
-
|
|
205
166
|
if (this.resizeHandler) {
|
|
206
167
|
this.resizeHandler.remove();
|
|
207
168
|
this.resizeHandler = null;
|
|
208
169
|
}
|
|
209
170
|
};
|
|
210
|
-
|
|
211
171
|
Affix.prototype.renderContent = function () {
|
|
212
172
|
var _a = this.props,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
173
|
+
fadeEffect = _a.fadeEffect,
|
|
174
|
+
renderAffix = _a.renderAffix,
|
|
175
|
+
className = _a.className,
|
|
176
|
+
children = _a.children;
|
|
217
177
|
var _b = this.state,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
178
|
+
visible = _b.visible,
|
|
179
|
+
left = _b.left,
|
|
180
|
+
top = _b.top,
|
|
181
|
+
width = _b.width;
|
|
223
182
|
if ((fadeEffect || renderAffix) && (visible || this.customRef.current)) {
|
|
224
183
|
return /*#__PURE__*/_react.default.createElement(_PortalAffix.default, {
|
|
225
184
|
top: top,
|
|
@@ -232,21 +191,18 @@ function (_super) {
|
|
|
232
191
|
ref: this.customRef
|
|
233
192
|
}, renderAffix ? renderAffix() : children);
|
|
234
193
|
}
|
|
235
|
-
|
|
236
194
|
return null;
|
|
237
195
|
};
|
|
238
|
-
|
|
239
196
|
Affix.prototype.render = function () {
|
|
240
197
|
var _a = this.props,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
198
|
+
className = _a.className,
|
|
199
|
+
children = _a.children;
|
|
200
|
+
// 这里需要两层div 包裹,最外层的是在固定时,防止页面抖动
|
|
244
201
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
245
202
|
ref: this.wrapRef,
|
|
246
203
|
className: (0, _classnames.default)(this.prefixCls, className)
|
|
247
204
|
}, children), this.renderContent());
|
|
248
205
|
};
|
|
249
|
-
|
|
250
206
|
Affix.defaultProps = {
|
|
251
207
|
offsetTop: 0,
|
|
252
208
|
allWidth: false,
|
|
@@ -254,13 +210,12 @@ function (_super) {
|
|
|
254
210
|
onChange: function onChange() {},
|
|
255
211
|
getFixedStatus: function getFixedStatus(_a) {
|
|
256
212
|
var positionInfo = _a.positionInfo,
|
|
257
|
-
|
|
258
|
-
|
|
213
|
+
scrollTop = _a.scrollTop,
|
|
214
|
+
offsetTop = _a.offsetTop;
|
|
259
215
|
return scrollTop > positionInfo.top - offsetTop;
|
|
260
216
|
}
|
|
261
217
|
};
|
|
262
218
|
return Affix;
|
|
263
219
|
}(_react.default.Component);
|
|
264
|
-
|
|
265
220
|
var _default = Affix;
|
|
266
221
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-affix,.ab-affix-custom{z-index:100}.ab-affix-custom{position:fixed;transition:transform .2s cubic-bezier(.7,.3,.1,1)}.ab-affix-fade-appear,.ab-affix-fade-enter{transform:translate(0,-100%)}.ab-affix-fade-appear-active,.ab-affix-fade-enter-active
|
|
1
|
+
.ab-affix,.ab-affix-custom{z-index:100}.ab-affix-custom{position:fixed;transition:transform .2s cubic-bezier(.7,.3,.1,1)}.ab-affix-fade-appear,.ab-affix-fade-enter{transform:translate(0,-100%)}.ab-affix-fade-appear-active,.ab-affix-fade-enter-active,.ab-affix-fade-exit{transform:translate(0,0)}.ab-affix-fade-exit-active{transform:translate(0,-100%)}.ab-affix-fade-exit-done{display:none}
|
package/lib/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
a,abbr,address,article,aside,audio,b,blockquote,body,canvas,caption,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,input,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,samp,section,small,span,strong,sub,summary,sup,table,tbody,td,textarea,tfoot,th,thead,time,tr,ul,var,video{box-sizing:border-box}html{font-size:100px;font-family:Arial,sans-serif;touch-action:manipulation
|
|
1
|
+
a,abbr,address,article,aside,audio,b,blockquote,body,canvas,caption,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,input,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,samp,section,small,span,strong,sub,summary,sup,table,tbody,td,textarea,tfoot,th,thead,time,tr,ul,var,video{box-sizing:border-box}html{font-size:100px;font-family:Arial,sans-serif;touch-action:manipulation}@media only screen and (max-width:767px){html{font-size:100px}}body{font-size:.12rem;color:#333;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{text-decoration:none}input{outline:0}li,ul{padding:0;margin:0;list-style:none}
|