@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
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
|
|
3
2
|
var __assign = this && this.__assign || function () {
|
|
4
3
|
__assign = Object.assign || function (t) {
|
|
5
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
5
|
s = arguments[i];
|
|
7
|
-
|
|
8
6
|
for (var p in s) {
|
|
9
7
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
return t;
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
return __assign.apply(this, arguments);
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
import React from 'react';
|
|
20
15
|
import { isEmptyArray } from '@autobest-ui/utils';
|
|
21
|
-
|
|
22
16
|
var getIndentCol = function getIndentCol(prefixCls, number) {
|
|
23
17
|
if (number === 0) {
|
|
24
18
|
return null;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
20
|
return new Array(number).fill(false).map(function (_item, index) {
|
|
28
21
|
return /*#__PURE__*/React.createElement("td", {
|
|
29
22
|
key: index,
|
|
@@ -31,17 +24,16 @@ var getIndentCol = function getIndentCol(prefixCls, number) {
|
|
|
31
24
|
});
|
|
32
25
|
});
|
|
33
26
|
};
|
|
34
|
-
|
|
35
27
|
function BodyRow(_a) {
|
|
36
28
|
var className = _a.className,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
cls = _a.prefixCls,
|
|
30
|
+
rowData = _a.rowData,
|
|
31
|
+
index = _a.index,
|
|
32
|
+
columns = _a.columns,
|
|
33
|
+
indent = _a.indent,
|
|
34
|
+
CheckCell = _a.CheckCell,
|
|
35
|
+
isExpand = _a.isExpand,
|
|
36
|
+
onRowClick = _a.onRowClick;
|
|
45
37
|
var indentCell = React.useMemo(function () {
|
|
46
38
|
return getIndentCol(cls, indent);
|
|
47
39
|
}, [cls, indent]);
|
|
@@ -51,30 +43,25 @@ function BodyRow(_a) {
|
|
|
51
43
|
var renderInfo = renderer ? renderer(rowData, index, colIndex) : rowData[col.dataIndex];
|
|
52
44
|
var cellProps = {};
|
|
53
45
|
var content;
|
|
54
|
-
|
|
55
46
|
if (renderInfo && _typeof(renderInfo) === 'object' && !Array.isArray(renderInfo) && ! /*#__PURE__*/React.isValidElement(renderInfo)) {
|
|
56
47
|
var children = renderInfo.children,
|
|
57
|
-
|
|
48
|
+
props = renderInfo.props;
|
|
58
49
|
content = children;
|
|
59
50
|
cellProps = props;
|
|
60
51
|
} else {
|
|
61
52
|
content = renderInfo;
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
var colSpan = cellProps.colSpan,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
rowSpan = cellProps.rowSpan,
|
|
56
|
+
tdClassName = cellProps.className;
|
|
68
57
|
var cellInfo = __assign(__assign({}, col), {
|
|
69
58
|
content: content,
|
|
70
59
|
colSpan: colSpan === undefined ? 1 : colSpan,
|
|
71
60
|
rowSpan: rowSpan === undefined ? 1 : rowSpan
|
|
72
61
|
});
|
|
73
|
-
|
|
74
62
|
if (cellInfo.colSpan === 0 || cellInfo.rowSpan === 0 || isExpand && !cellInfo.content) {
|
|
75
63
|
return;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
65
|
contentCells.push( /*#__PURE__*/React.createElement("td", {
|
|
79
66
|
className: tdClassName,
|
|
80
67
|
key: cellInfo.key,
|
|
@@ -82,23 +69,19 @@ function BodyRow(_a) {
|
|
|
82
69
|
rowSpan: cellInfo.rowSpan
|
|
83
70
|
}, cellInfo.content));
|
|
84
71
|
});
|
|
85
|
-
|
|
86
72
|
var onTrClick = function onTrClick() {
|
|
87
73
|
if (onRowClick) {
|
|
88
74
|
onRowClick(rowData, index);
|
|
89
75
|
}
|
|
90
76
|
};
|
|
91
|
-
|
|
92
77
|
if (!isEmptyArray(contentCells)) {
|
|
93
78
|
return /*#__PURE__*/React.createElement("tr", {
|
|
94
79
|
className: className,
|
|
95
80
|
onClick: onTrClick
|
|
96
81
|
}, indentCell, CheckCell, contentCells);
|
|
97
82
|
}
|
|
98
|
-
|
|
99
83
|
return null;
|
|
100
84
|
}
|
|
101
|
-
|
|
102
85
|
BodyRow.defaultProps = {
|
|
103
86
|
isExpand: false
|
|
104
87
|
};
|
|
@@ -1,37 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Checkbox from '../../checkbox';
|
|
3
|
-
|
|
4
3
|
function BodyCheckIcon(_a) {
|
|
5
4
|
var cls = _a.prefixCls,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
rowData = _a.rowData,
|
|
6
|
+
rowKey = _a.rowKey,
|
|
7
|
+
rowIndex = _a.rowIndex,
|
|
8
|
+
selectedRowKeys = _a.selectedRowKeys,
|
|
9
|
+
_b = _a.rowSelection,
|
|
10
|
+
checkIcon = _b.checkIcon,
|
|
11
|
+
getDisabled = _b.getDisabled,
|
|
12
|
+
onSelect = _b.onSelect;
|
|
14
13
|
var checked = selectedRowKeys.includes(rowKey);
|
|
15
|
-
|
|
16
14
|
if (checkIcon) {
|
|
17
15
|
return /*#__PURE__*/React.createElement("td", null, checkIcon(checked, rowData, rowIndex));
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
var disabled = getDisabled(rowData);
|
|
21
|
-
|
|
22
18
|
var onCheckBoxChange = function onCheckBoxChange(currentChecked) {
|
|
23
19
|
onSelect(currentChecked, rowData, rowIndex);
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
var onClickCell = function onClickCell(ev) {
|
|
27
22
|
if (!ev) {
|
|
28
23
|
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
}
|
|
25
|
+
// 阻止触发onRowClick
|
|
32
26
|
ev.stopPropagation();
|
|
33
27
|
};
|
|
34
|
-
|
|
35
28
|
return /*#__PURE__*/React.createElement("td", {
|
|
36
29
|
className: "".concat(cls, "-checkbox"),
|
|
37
30
|
onClick: onClickCell
|
|
@@ -41,5 +34,4 @@ function BodyCheckIcon(_a) {
|
|
|
41
34
|
onChange: onCheckBoxChange
|
|
42
35
|
}));
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
export default /*#__PURE__*/React.memo(BodyCheckIcon);
|
package/esm/table/body/index.js
CHANGED
|
@@ -2,21 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import { isBlank } from '@autobest-ui/utils';
|
|
3
3
|
import BodyRow from './BodyRow';
|
|
4
4
|
import CheckIcon from './CheckIcon';
|
|
5
|
-
|
|
6
5
|
var noop = function noop() {
|
|
7
6
|
return null;
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
function Body(_a) {
|
|
11
9
|
var prefixCls = _a.prefixCls,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
columns = _a.columns,
|
|
11
|
+
dataSource = _a.dataSource,
|
|
12
|
+
getRowKey = _a.getRowKey,
|
|
13
|
+
rowSelection = _a.rowSelection,
|
|
14
|
+
selectedRowKeys = _a.selectedRowKeys,
|
|
15
|
+
expandable = _a.expandable,
|
|
16
|
+
onRowClick = _a.onRowClick,
|
|
17
|
+
getRowClassName = _a.getRowClassName;
|
|
20
18
|
var rows = [];
|
|
21
19
|
var expandedRowRenderer = expandable ? expandable.expandedRowRender : noop;
|
|
22
20
|
dataSource.forEach(function (row, rowIndex) {
|
|
@@ -40,7 +38,6 @@ function Body(_a) {
|
|
|
40
38
|
onRowClick: onRowClick,
|
|
41
39
|
className: getRowClassName(row, rowIndex)
|
|
42
40
|
}));
|
|
43
|
-
|
|
44
41
|
if (expandable) {
|
|
45
42
|
var expandedRowKey = "".concat(rowKey, " expanded");
|
|
46
43
|
var expandedColumns = [{
|
|
@@ -64,5 +61,4 @@ function Body(_a) {
|
|
|
64
61
|
});
|
|
65
62
|
return /*#__PURE__*/React.createElement(React.Fragment, null, rows);
|
|
66
63
|
}
|
|
67
|
-
|
|
68
64
|
export default Body;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Checkbox from '../../checkbox';
|
|
3
|
-
|
|
4
3
|
function HeaderCheckIcon(_a) {
|
|
5
4
|
var cls = _a.prefixCls,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
rowSelection = _a.rowSelection;
|
|
8
6
|
if (!rowSelection) {
|
|
9
7
|
return null;
|
|
10
8
|
}
|
|
11
|
-
|
|
12
9
|
if (!rowSelection.selectAllVisible) {
|
|
13
10
|
// 有勾选功能,但是没有全选功能,需有占位元素
|
|
14
11
|
return /*#__PURE__*/React.createElement("th", null, " ");
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
var checkIcon = rowSelection.checkIcon,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
selectAllChecked = rowSelection.selectAllChecked,
|
|
15
|
+
onSelectAll = rowSelection.onSelectAll;
|
|
21
16
|
if (checkIcon) {
|
|
22
17
|
return /*#__PURE__*/React.createElement("th", null, checkIcon(selectAllChecked, null, -1));
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
var onCheckBoxChange = function onCheckBoxChange() {
|
|
26
20
|
onSelectAll(!selectAllChecked);
|
|
27
21
|
};
|
|
28
|
-
|
|
29
22
|
return /*#__PURE__*/React.createElement("th", {
|
|
30
23
|
className: "".concat(cls, "-checkbox")
|
|
31
24
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -33,5 +26,4 @@ function HeaderCheckIcon(_a) {
|
|
|
33
26
|
onChange: onCheckBoxChange
|
|
34
27
|
}));
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
export default /*#__PURE__*/React.memo(HeaderCheckIcon);
|
|
@@ -9,62 +9,46 @@ var __extends = this && this.__extends || function () {
|
|
|
9
9
|
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
13
12
|
return _extendStatics(d, b);
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
return function (d, b) {
|
|
17
15
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18
|
-
|
|
19
16
|
_extendStatics(d, b);
|
|
20
|
-
|
|
21
17
|
function __() {
|
|
22
18
|
this.constructor = d;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
26
21
|
};
|
|
27
22
|
}();
|
|
28
|
-
|
|
29
23
|
import React from 'react';
|
|
30
24
|
import classNames from 'classnames';
|
|
31
25
|
var rotate180Style = {
|
|
32
26
|
transform: 'rotate(180deg)'
|
|
33
27
|
};
|
|
34
|
-
|
|
35
|
-
var HeaderCell =
|
|
36
|
-
/** @class */
|
|
37
|
-
function (_super) {
|
|
28
|
+
var HeaderCell = /** @class */function (_super) {
|
|
38
29
|
__extends(HeaderCell, _super);
|
|
39
|
-
|
|
40
30
|
function HeaderCell() {
|
|
41
31
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
42
|
-
|
|
43
32
|
_this.onClick = function () {
|
|
44
33
|
var _a = _this.props,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
onSort = _a.onSort,
|
|
35
|
+
sortName = _a.sortName;
|
|
48
36
|
if (sortName && onSort) {
|
|
49
37
|
onSort(sortName);
|
|
50
38
|
}
|
|
51
39
|
};
|
|
52
|
-
|
|
53
40
|
_this.renderArrow = function () {
|
|
54
41
|
var _a = _this.props,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
prefixCls = _a.prefixCls,
|
|
43
|
+
isSort = _a.isSort,
|
|
44
|
+
isSortedDescending = _a.isSortedDescending,
|
|
45
|
+
sortIcon = _a.sortIcon;
|
|
60
46
|
if (!isSort) {
|
|
61
47
|
return null;
|
|
62
48
|
}
|
|
63
|
-
|
|
64
49
|
if (sortIcon) {
|
|
65
50
|
return sortIcon(isSortedDescending);
|
|
66
51
|
}
|
|
67
|
-
|
|
68
52
|
return /*#__PURE__*/React.createElement("span", {
|
|
69
53
|
className: "".concat(prefixCls, "-arrow")
|
|
70
54
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
@@ -79,19 +63,16 @@ function (_super) {
|
|
|
79
63
|
d: "M525.339326 186.172452L801.789086 462.622212c12.496698 12.496698 32.758136 12.496698 45.254834 0 12.497405-12.497405 12.496698-32.758136 0-45.254834l-331.014362-331.014362c-12.496698-12.496698-32.757429-12.497405-45.254834 0l-341.795619 339.143969c-12.496698 12.496698-12.496698 32.758136 0 45.254834 12.496698 12.496698 32.758136 12.496698 45.254834 0l287.10586-284.454209L461.372325 925.726242c0 17.673427 14.32669 32.000117 32.000118 32.000117 17.67272-0.000707 31.99941-14.327398 32.000117-32.000117l-0.032527-739.553083z"
|
|
80
64
|
})));
|
|
81
65
|
};
|
|
82
|
-
|
|
83
66
|
return _this;
|
|
84
67
|
}
|
|
85
|
-
|
|
86
68
|
HeaderCell.prototype.render = function () {
|
|
87
69
|
var _a;
|
|
88
|
-
|
|
89
70
|
var _b = this.props,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
prefixCls = _b.prefixCls,
|
|
72
|
+
className = _b.className,
|
|
73
|
+
title = _b.title,
|
|
74
|
+
sortName = _b.sortName,
|
|
75
|
+
colSpan = _b.colSpan;
|
|
95
76
|
return /*#__PURE__*/React.createElement("th", {
|
|
96
77
|
className: classNames(className, (_a = {}, _a["".concat(prefixCls, "-point")] = sortName, _a)),
|
|
97
78
|
colSpan: colSpan,
|
|
@@ -100,8 +81,6 @@ function (_super) {
|
|
|
100
81
|
className: "".concat(prefixCls, "-title")
|
|
101
82
|
}, title, this.renderArrow()));
|
|
102
83
|
};
|
|
103
|
-
|
|
104
84
|
return HeaderCell;
|
|
105
85
|
}(React.PureComponent);
|
|
106
|
-
|
|
107
86
|
export default HeaderCell;
|
|
@@ -2,58 +2,48 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
5
|
for (var p in s) {
|
|
7
6
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return t;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return __assign.apply(this, arguments);
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
import React from 'react';
|
|
18
14
|
import HeaderCell from './HeaderCell';
|
|
19
15
|
import HeaderCheckIcon from './CheckIcon';
|
|
20
|
-
|
|
21
16
|
function parseHeaderRows(columns) {
|
|
22
17
|
var rows = [];
|
|
23
18
|
columns.forEach(function (col) {
|
|
24
19
|
if ('colSpan' in col && col.colSpan === 0) {
|
|
25
20
|
return;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
rows.push(__assign(__assign({}, col), {
|
|
29
23
|
colSpan: col.colSpan ? col.colSpan : 1
|
|
30
24
|
}));
|
|
31
25
|
});
|
|
32
26
|
return rows;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
function HeaderRow(_a) {
|
|
36
29
|
var cls = _a.prefixCls,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
columns = _a.columns,
|
|
31
|
+
rowSelection = _a.rowSelection,
|
|
32
|
+
sortName = _a.sortName,
|
|
33
|
+
isSortedDescending = _a.isSortedDescending,
|
|
34
|
+
onSortChange = _a.onSortChange,
|
|
35
|
+
sortIcon = _a.sortIcon;
|
|
43
36
|
/**
|
|
44
37
|
* 点击某一列的表头,触发排序
|
|
45
38
|
* @param name
|
|
46
39
|
*/
|
|
47
|
-
|
|
48
40
|
var onSort = function onSort(name) {
|
|
49
41
|
if (!onSortChange) {
|
|
50
42
|
return;
|
|
51
43
|
}
|
|
52
|
-
|
|
53
44
|
var isSortedDesc = sortName === name ? !isSortedDescending : true;
|
|
54
45
|
onSortChange(isSortedDesc, name);
|
|
55
46
|
};
|
|
56
|
-
|
|
57
47
|
var rows = React.useMemo(function () {
|
|
58
48
|
return parseHeaderRows(columns);
|
|
59
49
|
}, [columns]);
|
|
@@ -72,5 +62,4 @@ function HeaderRow(_a) {
|
|
|
72
62
|
}));
|
|
73
63
|
}));
|
|
74
64
|
}
|
|
75
|
-
|
|
76
65
|
export default HeaderRow;
|