@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/collapse/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 = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _reactTransitionGroup = require("react-transition-group");
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
17
12
|
var _extendStatics = function extendStatics(d, b) {
|
|
18
13
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -24,94 +19,69 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
24
19
|
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
25
20
|
}
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
return _extendStatics(d, b);
|
|
29
23
|
};
|
|
30
|
-
|
|
31
24
|
return function (d, b) {
|
|
32
25
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
-
|
|
34
26
|
_extendStatics(d, b);
|
|
35
|
-
|
|
36
27
|
function __() {
|
|
37
28
|
this.constructor = d;
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
41
31
|
};
|
|
42
32
|
}();
|
|
43
|
-
|
|
44
|
-
var Collapse =
|
|
45
|
-
/** @class */
|
|
46
|
-
function (_super) {
|
|
33
|
+
var Collapse = /** @class */function (_super) {
|
|
47
34
|
__extends(Collapse, _super);
|
|
48
|
-
|
|
49
35
|
function Collapse(props) {
|
|
50
36
|
var _this = _super.call(this, props) || this;
|
|
51
|
-
|
|
52
37
|
_this.prefixCls = 'ab-collapse';
|
|
53
|
-
|
|
54
38
|
_this.onEnter = function (el) {
|
|
55
39
|
_this.cacheHeight = "".concat(el.offsetHeight, "px");
|
|
56
40
|
el.style.height = '0px';
|
|
57
41
|
};
|
|
58
|
-
|
|
59
42
|
_this.onEntering = function (el) {
|
|
60
43
|
el.style.height = _this.cacheHeight;
|
|
61
44
|
};
|
|
62
|
-
|
|
63
45
|
_this.onEntered = function (el) {
|
|
64
46
|
el.style.height = '';
|
|
65
|
-
|
|
66
47
|
if (_this.props.onEntered) {
|
|
67
48
|
_this.props.onEntered(el, _this.props.name);
|
|
68
49
|
}
|
|
69
50
|
};
|
|
70
|
-
|
|
71
51
|
_this.onExit = function (el) {
|
|
72
52
|
el.style.height = "".concat(el.offsetHeight, "px");
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
_this.onExiting = function (el) {
|
|
76
55
|
el.style.height = '0px';
|
|
77
56
|
};
|
|
78
|
-
|
|
79
57
|
_this.onExited = function (el) {
|
|
80
58
|
el.style.height = '';
|
|
81
|
-
|
|
82
59
|
if (_this.props.onExited) {
|
|
83
60
|
_this.props.onExited(el, _this.props.name);
|
|
84
61
|
}
|
|
85
62
|
};
|
|
86
|
-
|
|
87
63
|
_this.onChange = function () {
|
|
88
64
|
var visible = !_this.state.visible;
|
|
89
|
-
|
|
90
65
|
if (!('visible' in _this.props)) {
|
|
91
66
|
var isUserClicked = _this.state.isUserClicked || visible;
|
|
92
|
-
|
|
93
67
|
_this.setState({
|
|
94
68
|
visible: visible,
|
|
95
69
|
isUserClicked: isUserClicked
|
|
96
70
|
});
|
|
97
71
|
}
|
|
98
|
-
|
|
99
72
|
var _a = _this.props,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
73
|
+
onChange = _a.onChange,
|
|
74
|
+
name = _a.name;
|
|
103
75
|
if (onChange) {
|
|
104
76
|
onChange(visible, name);
|
|
105
77
|
}
|
|
106
78
|
};
|
|
107
|
-
|
|
108
79
|
_this.state = {
|
|
109
80
|
visible: props.defaultVisible,
|
|
110
81
|
isUserClicked: false
|
|
111
82
|
};
|
|
112
83
|
return _this;
|
|
113
84
|
}
|
|
114
|
-
|
|
115
85
|
Collapse.getDerivedStateFromProps = function (nextProps, preState) {
|
|
116
86
|
if ('visible' in nextProps) {
|
|
117
87
|
var isUserClicked = preState.isUserClicked || nextProps.visible;
|
|
@@ -120,25 +90,19 @@ function (_super) {
|
|
|
120
90
|
isUserClicked: isUserClicked
|
|
121
91
|
};
|
|
122
92
|
}
|
|
123
|
-
|
|
124
93
|
return null;
|
|
125
94
|
};
|
|
126
|
-
|
|
127
95
|
Collapse.prototype.renderTitle = function () {
|
|
128
96
|
var title = this.props.title;
|
|
129
|
-
|
|
130
97
|
if (!title) {
|
|
131
98
|
return null;
|
|
132
99
|
}
|
|
133
|
-
|
|
134
100
|
var child;
|
|
135
|
-
|
|
136
101
|
if (typeof title === 'function') {
|
|
137
102
|
child = title(this.state.visible);
|
|
138
103
|
} else {
|
|
139
104
|
child = _react.default.Children.only(title);
|
|
140
105
|
}
|
|
141
|
-
|
|
142
106
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
143
107
|
onClick: child.props.onClick || this.onChange
|
|
144
108
|
});
|
|
@@ -146,19 +110,16 @@ function (_super) {
|
|
|
146
110
|
/**
|
|
147
111
|
* @returns {*}
|
|
148
112
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
113
|
Collapse.prototype.renderContent = function () {
|
|
152
114
|
var _a;
|
|
153
|
-
|
|
154
115
|
var _b = this.props,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
116
|
+
children = _b.children,
|
|
117
|
+
className = _b.className,
|
|
118
|
+
appear = _b.appear,
|
|
119
|
+
mountOnEnter = _b.mountOnEnter;
|
|
159
120
|
var _c = this.state,
|
|
160
|
-
|
|
161
|
-
|
|
121
|
+
visible = _c.visible,
|
|
122
|
+
isUserClicked = _c.isUserClicked;
|
|
162
123
|
var cls = this.prefixCls;
|
|
163
124
|
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
164
125
|
in: visible,
|
|
@@ -178,12 +139,10 @@ function (_super) {
|
|
|
178
139
|
className: "".concat(cls, "-content")
|
|
179
140
|
}, children)));
|
|
180
141
|
};
|
|
181
|
-
|
|
182
142
|
Collapse.prototype.render = function () {
|
|
183
143
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderTitle(), this.renderContent());
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
|
|
144
|
+
};
|
|
145
|
+
// 默认值
|
|
187
146
|
Collapse.defaultProps = {
|
|
188
147
|
defaultVisible: false,
|
|
189
148
|
appear: true,
|
|
@@ -191,6 +150,5 @@ function (_super) {
|
|
|
191
150
|
};
|
|
192
151
|
return Collapse;
|
|
193
152
|
}(_react.default.Component);
|
|
194
|
-
|
|
195
153
|
var _default = Collapse;
|
|
196
154
|
exports.default = _default;
|
package/lib/confirm/index.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export interface ConfirmProps extends Omit<ModalProps, 'visible'> {
|
|
|
32
32
|
* 点击取消的回调函数
|
|
33
33
|
*/
|
|
34
34
|
onCancel?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
*自定义渲染 cancel 按钮,cancelText 和 cancelClassName 不再生效
|
|
37
|
+
*/
|
|
38
|
+
renderCancel?: (onCancel: () => void) => React.ReactChild;
|
|
39
|
+
/**
|
|
40
|
+
*自定义渲染 ok 按钮,okText 和 okClassName 不再生效
|
|
41
|
+
*/
|
|
42
|
+
renderOk?: (onOk: () => void) => React.ReactChild;
|
|
35
43
|
}
|
|
36
44
|
declare const Confirm: (config: ConfirmProps) => {
|
|
37
45
|
destroy: (type?: string) => void;
|
package/lib/confirm/index.js
CHANGED
|
@@ -1,38 +1,27 @@
|
|
|
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 _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("@autobest-ui/utils");
|
|
17
|
-
|
|
18
12
|
var _modal = _interopRequireDefault(require("../modal"));
|
|
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
|
var prefixCls = 'ab-confirm';
|
|
37
26
|
var defaultConfig = {
|
|
38
27
|
hiddenCancel: false,
|
|
@@ -48,16 +37,13 @@ var defaultConfig = {
|
|
|
48
37
|
onOk: function onOk() {},
|
|
49
38
|
onCancel: function onCancel() {}
|
|
50
39
|
};
|
|
51
|
-
|
|
52
40
|
var Confirm = function Confirm(config) {
|
|
53
41
|
if (!_utils.canUseDOM) {
|
|
54
42
|
throw new Error('Confirm use client!');
|
|
55
43
|
}
|
|
56
|
-
|
|
57
44
|
var div = document.createElement('div');
|
|
58
45
|
document.body.appendChild(div);
|
|
59
46
|
var currentConfig = defaultConfig;
|
|
60
|
-
|
|
61
47
|
function updateCurrentConfig(nextConfig) {
|
|
62
48
|
var cancelClassName = (0, _classnames.default)(currentConfig.cancelClassName, nextConfig.cancelClassName);
|
|
63
49
|
var okClassName = (0, _classnames.default)(currentConfig.okClassName, nextConfig.okClassName);
|
|
@@ -67,66 +53,66 @@ var Confirm = function Confirm(config) {
|
|
|
67
53
|
onDestroy: onDestroy
|
|
68
54
|
});
|
|
69
55
|
}
|
|
70
|
-
|
|
71
56
|
updateCurrentConfig(config);
|
|
72
|
-
|
|
73
57
|
function close(type) {
|
|
74
58
|
if (type === void 0) {
|
|
75
59
|
type = 'cancel';
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
}
|
|
61
|
+
// 防止重复触发close
|
|
79
62
|
if (!currentConfig.visible) {
|
|
80
63
|
return;
|
|
81
64
|
}
|
|
82
|
-
|
|
83
65
|
currentConfig = __assign(__assign({}, currentConfig), {
|
|
84
66
|
visible: false
|
|
85
67
|
});
|
|
86
68
|
render(currentConfig);
|
|
87
|
-
|
|
88
69
|
if (type === 'ok') {
|
|
89
70
|
currentConfig.onOk();
|
|
90
71
|
} else {
|
|
91
72
|
currentConfig.onCancel();
|
|
92
73
|
}
|
|
93
74
|
}
|
|
94
|
-
|
|
95
75
|
function onDestroy() {
|
|
96
76
|
var unmountResult = _reactDom.default.unmountComponentAtNode(div);
|
|
97
|
-
|
|
98
77
|
if (unmountResult && div.parentNode) {
|
|
99
78
|
try {
|
|
100
79
|
div.parentNode.removeChild(div);
|
|
101
80
|
} catch (e) {}
|
|
102
81
|
}
|
|
103
82
|
}
|
|
104
|
-
|
|
105
83
|
function onVisible() {
|
|
106
84
|
close('cancel');
|
|
107
85
|
}
|
|
108
|
-
|
|
109
86
|
function onConfirm() {
|
|
110
87
|
close('ok');
|
|
111
88
|
}
|
|
112
|
-
|
|
113
89
|
function render(props) {
|
|
90
|
+
var className = props.className,
|
|
91
|
+
content = props.content,
|
|
92
|
+
hiddenCancel = props.hiddenCancel,
|
|
93
|
+
hiddenOk = props.hiddenOk,
|
|
94
|
+
cancelClassName = props.cancelClassName,
|
|
95
|
+
okClassName = props.okClassName,
|
|
96
|
+
okText = props.okText,
|
|
97
|
+
cancelText = props.cancelText,
|
|
98
|
+
renderOk = props.renderOk,
|
|
99
|
+
renderCancel = props.renderCancel,
|
|
100
|
+
visible = props.visible;
|
|
114
101
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(_modal.default, __assign({}, props, {
|
|
115
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-wrap"),
|
|
116
|
-
visible:
|
|
102
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-wrap"), className),
|
|
103
|
+
visible: visible,
|
|
117
104
|
onClose: onVisible
|
|
118
|
-
}),
|
|
105
|
+
}), content, hiddenCancel && hiddenOk ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
119
106
|
className: "".concat(prefixCls, "-btns")
|
|
120
|
-
},
|
|
121
|
-
className:
|
|
107
|
+
}, !hiddenCancel && (renderCancel ? renderCancel(onVisible) : /*#__PURE__*/_react.default.createElement("button", {
|
|
108
|
+
className: cancelClassName,
|
|
122
109
|
onClick: onVisible
|
|
123
|
-
},
|
|
124
|
-
className:
|
|
110
|
+
}, cancelText)), !hiddenOk && (renderOk ? renderOk(onConfirm) : /*#__PURE__*/_react.default.createElement("button", {
|
|
111
|
+
className: okClassName,
|
|
125
112
|
onClick: onConfirm
|
|
126
|
-
},
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
113
|
+
}, okText)))), div);
|
|
114
|
+
}
|
|
115
|
+
// 渲染组件
|
|
130
116
|
render(currentConfig);
|
|
131
117
|
return {
|
|
132
118
|
destroy: close,
|
|
@@ -136,6 +122,5 @@ var Confirm = function Confirm(config) {
|
|
|
136
122
|
}
|
|
137
123
|
};
|
|
138
124
|
};
|
|
139
|
-
|
|
140
125
|
var _default = Confirm;
|
|
141
126
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-confirm-btns{display:flex;justify-content:flex-end;padding-top:.42rem}.ab-confirm-cancel,.ab-confirm-ok{overflow:hidden;position:relative;font-size:.12rem;border-width:1px;border-style:solid;outline:0;cursor:pointer;font-weight:700;padding:.05rem .3rem;display:inline-block;color:#fff;margin-left:.3rem}.ab-confirm-ok{border-color:#bc0000;background:linear-gradient(180deg,#c00000 0,#c00000 0,#a00000 100%,#a00000 100%)}.ab-confirm-ok:hover{border-color:#bc0000;background:#bc0000}.ab-confirm-cancel{border-color:grey;background:linear-gradient(180deg,#909090 0,#909090 0,#707070 100%,#707070 100%)}.ab-confirm-cancel:hover{border-color:grey;background:grey}
|
|
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}.ab-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:101;overflow:auto;outline:0}.ab-modal.ab-modal-center{text-align:center}.ab-modal.ab-modal-center::before{display:inline-block;width:0;height:100%;vertical-align:middle;content:""}.ab-modal.ab-modal-center .ab-modal-content{top:0;text-align:left;display:inline-block;vertical-align:middle}.ab-modal-content{position:relative;background-color:#fff;max-width:calc(100vw - .3rem);margin-left:auto;margin-right:auto;overflow:auto;-webkit-overflow-scrolling:touch;transition:transform .3s,opacity .3s cubic-bezier(.7,.3,.1,1);z-index:101}.ab-modal-title{position:relative;width:100%}.ab-modal-title .ab-modal-times{top:50%;transform:translateY(-50%)}.ab-modal-times{position:absolute;top:.12rem;right:.12rem;font-size:.15rem;color:#b0b0b0;cursor:pointer}.ab-modal-times svg{display:block}.ab-modal-times:hover{color:#333}.ab-modal-hidden{display:none}@media only screen and (max-width:767px){.ab-modal-content{width:calc(100vw - .3rem)}}.ab-modal-fade-appear,.ab-modal-fade-enter{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-appear-active,.ab-modal-fade-enter-active,.ab-modal-fade-enter-done,.ab-modal-fade-exit{transform:translateZ(0);opacity:1}.ab-modal-fade-exit-active{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-exit-done{display:none}.ab-confirm-btns{display:flex;justify-content:flex-end;padding-top:.42rem}.ab-confirm-cancel,.ab-confirm-ok{overflow:hidden;position:relative;font-size:.12rem;border-width:1px;border-style:solid;outline:0;cursor:pointer;font-weight:700;padding:.05rem .3rem;display:inline-block;color:#fff;margin-left:.3rem}.ab-confirm-ok{border-color:#bc0000;background:linear-gradient(180deg,#c00000 0,#c00000 0,#a00000 100%,#a00000 100%)}.ab-confirm-ok:hover{border-color:#bc0000;background:#bc0000}.ab-confirm-cancel{border-color:grey;background:linear-gradient(180deg,#909090 0,#909090 0,#707070 100%,#707070 100%)}.ab-confirm-cancel:hover{border-color:grey;background:grey}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.MonthOfYear = exports.DayOfWeek = void 0;
|
|
7
7
|
var DayOfWeek;
|
|
8
8
|
exports.DayOfWeek = DayOfWeek;
|
|
9
|
-
|
|
10
9
|
(function (DayOfWeek) {
|
|
11
10
|
DayOfWeek[DayOfWeek["Sunday"] = 0] = "Sunday";
|
|
12
11
|
DayOfWeek[DayOfWeek["Monday"] = 1] = "Monday";
|
|
@@ -16,10 +15,8 @@ exports.DayOfWeek = DayOfWeek;
|
|
|
16
15
|
DayOfWeek[DayOfWeek["Friday"] = 5] = "Friday";
|
|
17
16
|
DayOfWeek[DayOfWeek["Saturday"] = 6] = "Saturday";
|
|
18
17
|
})(DayOfWeek || (exports.DayOfWeek = DayOfWeek = {}));
|
|
19
|
-
|
|
20
18
|
var MonthOfYear;
|
|
21
19
|
exports.MonthOfYear = MonthOfYear;
|
|
22
|
-
|
|
23
20
|
(function (MonthOfYear) {
|
|
24
21
|
MonthOfYear[MonthOfYear["January"] = 0] = "January";
|
|
25
22
|
MonthOfYear[MonthOfYear["February"] = 1] = "February";
|
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _utils = require("../utils");
|
|
15
|
-
|
|
16
11
|
var _DateEnum = require("../DateEnum");
|
|
17
|
-
|
|
18
12
|
var _grid = _interopRequireDefault(require("./grid"));
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
15
|
var weekList = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
|
|
25
|
-
|
|
26
16
|
var getTitle = function getTitle(date) {
|
|
27
17
|
return "".concat((0, _utils.getMonthFullName)(date.getMonth()), " ").concat(date.getFullYear());
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
var DayCalendar = function DayCalendar(props) {
|
|
31
20
|
var cls = props.prefixCls,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
today = props.today,
|
|
22
|
+
minDate = props.minDate,
|
|
23
|
+
maxDate = props.maxDate,
|
|
24
|
+
navigatedDate = props.navigatedDate,
|
|
25
|
+
selectedDate = props.selectedDate,
|
|
26
|
+
onChangeNavigatedDate = props.onChangeNavigatedDate,
|
|
27
|
+
onChangeSelectedDate = props.onChangeSelectedDate,
|
|
28
|
+
firstDayOfWeek = props.firstDayOfWeek;
|
|
40
29
|
var onPrev = (0, _react.useCallback)(function () {
|
|
41
30
|
onChangeNavigatedDate((0, _utils.getMonthAdd)(navigatedDate, -1));
|
|
42
31
|
}, [navigatedDate, onChangeNavigatedDate]);
|
|
@@ -46,79 +35,66 @@ var DayCalendar = function DayCalendar(props) {
|
|
|
46
35
|
var onSelect = (0, _react.useCallback)(function (date) {
|
|
47
36
|
onChangeSelectedDate(date);
|
|
48
37
|
}, [onChangeSelectedDate]);
|
|
49
|
-
|
|
50
38
|
var _a = (0, _react.useMemo)(function () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
39
|
+
var getItem = function getItem(date, isOut) {
|
|
40
|
+
if (isOut === void 0) {
|
|
41
|
+
isOut = false;
|
|
42
|
+
}
|
|
43
|
+
var disabled = (0, _utils.isOutOfDate)(date, minDate, maxDate);
|
|
44
|
+
return {
|
|
45
|
+
value: date,
|
|
46
|
+
name: date.getDate(),
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
selected: (0, _utils.compareDate)(date, selectedDate) === 0,
|
|
49
|
+
isToday: (0, _utils.compareDate)(date, today) === 0,
|
|
50
|
+
onClick: disabled ? null : function () {
|
|
51
|
+
return onSelect(date);
|
|
52
|
+
},
|
|
53
|
+
className: !disabled && isOut ? "".concat(cls, "-out") : null
|
|
54
|
+
};
|
|
67
55
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var dayList = [];
|
|
73
|
-
|
|
74
|
-
var _a = (0, _utils.getDateValue)(navigatedDate),
|
|
56
|
+
var currentTitle = getTitle(navigatedDate);
|
|
57
|
+
var currentHeadList = weekList.slice(firstDayOfWeek, weekList.length).concat(weekList.slice(0, firstDayOfWeek));
|
|
58
|
+
var dayList = [];
|
|
59
|
+
var _a = (0, _utils.getDateValue)(navigatedDate),
|
|
75
60
|
navigatedYear = _a.year,
|
|
76
61
|
navigatedMonth = _a.month;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
for (var i = lackDay; i > 0; i--) {
|
|
88
|
-
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthFirstDay, -i), true));
|
|
62
|
+
var thisMonthDays = (0, _utils.getDaysInMonth)(navigatedDate);
|
|
63
|
+
var thisMonthFirstDay = (0, _utils.getMonthStart)(navigatedYear, navigatedMonth);
|
|
64
|
+
var firstWeekday = (0, _utils.getStartWeekInMonth)(navigatedDate);
|
|
65
|
+
var lastWeekday = (0, _utils.getEndWeekInMonth)(navigatedDate);
|
|
66
|
+
if (firstWeekday !== firstDayOfWeek) {
|
|
67
|
+
// 补充上个月的日子
|
|
68
|
+
var lackDay = firstWeekday - firstDayOfWeek > 0 ? firstWeekday - firstDayOfWeek : firstDayOfWeek - firstWeekday;
|
|
69
|
+
for (var i = lackDay; i > 0; i--) {
|
|
70
|
+
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthFirstDay, -i), true));
|
|
71
|
+
}
|
|
89
72
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
for (var thisMonth = 0; thisMonth < thisMonthDays; thisMonth++) {
|
|
93
|
-
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthFirstDay, thisMonth)));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
var weekEndDay = (firstDayOfWeek + 6) % 7;
|
|
97
|
-
var thisMonthLastDay = (0, _utils.getMonthEnd)(navigatedYear, navigatedMonth);
|
|
98
|
-
|
|
99
|
-
if (lastWeekday !== weekEndDay) {
|
|
100
|
-
// 补充下个月的日子
|
|
101
|
-
var lackDay = weekEndDay - lastWeekday > 0 ? weekEndDay - lastWeekday : lastWeekday - weekEndDay;
|
|
102
|
-
|
|
103
|
-
for (var i = 1; i <= lackDay; i++) {
|
|
104
|
-
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthLastDay, i), true));
|
|
73
|
+
for (var thisMonth = 0; thisMonth < thisMonthDays; thisMonth++) {
|
|
74
|
+
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthFirstDay, thisMonth)));
|
|
105
75
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
76
|
+
var weekEndDay = (firstDayOfWeek + 6) % 7;
|
|
77
|
+
var thisMonthLastDay = (0, _utils.getMonthEnd)(navigatedYear, navigatedMonth);
|
|
78
|
+
if (lastWeekday !== weekEndDay) {
|
|
79
|
+
// 补充下个月的日子
|
|
80
|
+
var lackDay = weekEndDay - lastWeekday > 0 ? weekEndDay - lastWeekday : lastWeekday - weekEndDay;
|
|
81
|
+
for (var i = 1; i <= lackDay; i++) {
|
|
82
|
+
dayList.push(getItem((0, _utils.getDayAdd)(thisMonthLastDay, i), true));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
title: currentTitle,
|
|
87
|
+
startDate: dayList[0].value,
|
|
88
|
+
endDate: dayList[dayList.length - 1].value,
|
|
89
|
+
headList: currentHeadList,
|
|
90
|
+
dateList: dayList
|
|
91
|
+
};
|
|
92
|
+
}, [today, navigatedDate, minDate, maxDate, firstDayOfWeek, selectedDate, onSelect, cls]),
|
|
93
|
+
title = _a.title,
|
|
94
|
+
startDate = _a.startDate,
|
|
95
|
+
endDate = _a.endDate,
|
|
96
|
+
headList = _a.headList,
|
|
97
|
+
dateList = _a.dateList;
|
|
122
98
|
var prevEnabled = minDate ? (0, _utils.compareDate)(minDate, startDate) < 0 : true;
|
|
123
99
|
var nextEnabled = maxDate ? (0, _utils.compareDate)(endDate, maxDate) < 0 : true;
|
|
124
100
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -132,7 +108,6 @@ var DayCalendar = function DayCalendar(props) {
|
|
|
132
108
|
onNext: nextEnabled ? onNext : null
|
|
133
109
|
}));
|
|
134
110
|
};
|
|
135
|
-
|
|
136
111
|
DayCalendar.defaultProps = {
|
|
137
112
|
firstDayOfWeek: _DateEnum.DayOfWeek.Sunday
|
|
138
113
|
};
|