@hi-ui/hiui 2.15.11 → 2.15.12
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/es/_util/SwitchVersion.js +40 -0
- package/es/_util/depreactedPropsCompat.js +58 -0
- package/es/_util/index.js +31 -0
- package/es/_util/warning.js +2 -2
- package/es/alert/Alert.js +126 -0
- package/es/alert/__tests__/index.test.js +84 -0
- package/es/alert/index.js +6 -147
- package/es/alert/style/index.css +1 -1
- package/es/badge/Badge.js +82 -0
- package/es/badge/__tests__/index.test.js +82 -0
- package/es/badge/index.js +9 -87
- package/es/badge/style/index.css +1 -1
- package/es/badge/style/index.js +0 -0
- package/es/breadcrumb/__tests__/index.test.js +61 -0
- package/es/breadcrumb/index.js +85 -0
- package/es/breadcrumb/style/index.css +1 -0
- package/es/button/Button.js +62 -60
- package/es/button/ButtonGroup.js +24 -40
- package/es/button/IconLoading.js +6 -6
- package/es/button/__tests__/index.test.js +221 -0
- package/es/button/index.js +3 -2
- package/es/button/style/index.css +1 -1
- package/es/card/__tests__/index.test.js +179 -0
- package/es/card/index.js +61 -57
- package/es/card/style/index.css +1 -1
- package/es/carousel/__tests__/index.test.js +104 -0
- package/es/carousel/index.js +219 -0
- package/es/carousel/style/index.css +1 -0
- package/es/carousel/style/index.js +3 -0
- package/es/cascader/Cascader.js +190 -133
- package/es/cascader/Menu.js +168 -0
- package/es/cascader/__tests__/index.test.js +392 -0
- package/es/cascader/index.js +5 -2
- package/es/cascader/style/cascader.css +1 -1
- package/es/cascader/style/menu.css +1 -1
- package/es/checkbox/Checkbox.js +136 -0
- package/es/checkbox/Group.js +194 -0
- package/es/checkbox/__tests__/index.test.js +226 -0
- package/es/checkbox/checkbox-legacy/Base.js +212 -0
- package/es/checkbox/checkbox-legacy/CheckBox.js +157 -0
- package/es/checkbox/checkbox-legacy/index.js +15 -0
- package/es/checkbox/checkbox-legacy/style/index.css +1 -0
- package/es/checkbox/checkbox-legacy/style/index.js +3 -0
- package/es/checkbox/index.js +13 -4
- package/es/checkbox/style/index.css +1 -1
- package/es/collapse/__tests__/index.test.js +111 -0
- package/es/collapse/index.js +88 -110
- package/es/collapse/style/index.css +1 -1
- package/es/confirm/index.js +39 -60
- package/es/context/index.js +45 -51
- package/es/counter/Counter.js +339 -0
- package/es/counter/__tests__/index.test.js +134 -0
- package/es/counter/counter-legacy/index.js +267 -0
- package/es/counter/index.js +6 -270
- package/es/counter/style/index.css +1 -1
- package/es/date-picker/BasePicker.js +380 -302
- package/es/date-picker/Calender.js +326 -98
- package/es/date-picker/DatePanel.js +194 -213
- package/es/date-picker/DatePicker.js +143 -47
- package/es/date-picker/DateRangePanel.js +272 -208
- package/es/date-picker/Modal.js +18 -32
- package/es/date-picker/Time.js +231 -345
- package/es/date-picker/TimeList.js +246 -0
- package/es/date-picker/TimePanel.js +28 -41
- package/es/date-picker/TimePeriodPanel.js +27 -46
- package/es/date-picker/TimePicker.js +44 -46
- package/es/date-picker/TimeRangePanel.js +33 -51
- package/es/date-picker/Type.js +5 -1
- package/es/date-picker/WeekRangePanel.js +254 -175
- package/es/date-picker/YMRangePanel.js +364 -0
- package/es/date-picker/__tests__/index.test.js +956 -0
- package/es/date-picker/constants.js +14 -28
- package/es/date-picker/dateUtil.js +221 -52
- package/es/date-picker/datepicker-legacy/BasePicker.js +511 -0
- package/es/date-picker/datepicker-legacy/Calender.js +422 -0
- package/es/date-picker/datepicker-legacy/DatePanel.js +455 -0
- package/es/date-picker/datepicker-legacy/DatePicker.js +103 -0
- package/es/date-picker/datepicker-legacy/DateRangePanel.js +488 -0
- package/es/date-picker/datepicker-legacy/Modal.js +67 -0
- package/es/date-picker/datepicker-legacy/Time.js +405 -0
- package/es/date-picker/datepicker-legacy/TimePanel.js +85 -0
- package/es/date-picker/datepicker-legacy/TimePeriodPanel.js +118 -0
- package/es/date-picker/datepicker-legacy/TimePicker.js +78 -0
- package/es/date-picker/datepicker-legacy/TimeRangePanel.js +90 -0
- package/es/date-picker/datepicker-legacy/Type.js +31 -0
- package/es/date-picker/datepicker-legacy/WeekRangePanel.js +337 -0
- package/es/date-picker/datepicker-legacy/constants.js +79 -0
- package/es/date-picker/datepicker-legacy/dateUtil.js +258 -0
- package/es/date-picker/datepicker-legacy/index.js +15 -0
- package/es/date-picker/datepicker-legacy/local.js +11 -0
- package/es/date-picker/datepicker-legacy/style/index.css +1 -0
- package/es/date-picker/datepicker-legacy/style/index.js +3 -0
- package/es/date-picker/datepicker-legacy/style/timepicker.css +1 -0
- package/es/date-picker/datepicker-legacy/util.js +60 -0
- package/es/date-picker/index.js +5 -2
- package/es/date-picker/style/index.css +1 -1
- package/es/date-picker/toLunar.js +172 -0
- package/es/date-picker/util.js +101 -8
- package/es/dropdown/Dropdown.js +191 -203
- package/es/dropdown/DropdownButton.js +102 -0
- package/es/dropdown/DropdownMenu.js +107 -0
- package/es/dropdown/DropdownMenuItem.js +172 -0
- package/es/dropdown/__tests__/index.test.js +313 -0
- package/es/dropdown/index.js +69 -4
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.js +0 -2
- package/es/dropdown/{__test__ → tests}/index.test.js +7 -7
- package/es/dropdown/utils.js +35 -0
- package/es/ficon/index.js +16 -30
- package/es/form/Form.js +176 -0
- package/es/form/{item.js → Item.js} +52 -60
- package/es/form/__tests__/index.test.js +571 -0
- package/es/form/index.js +6 -171
- package/es/form/style/index.css +1 -1
- package/es/grid/__tests__/index.test.js +100 -0
- package/es/grid/index.js +36 -56
- package/es/icon/index.js +23 -38
- package/es/index.js +61 -9
- package/es/input/Input.js +400 -0
- package/es/input/__tests__/index.test.js +376 -0
- package/es/input/index.js +26 -347
- package/es/input/input-legacy/index.js +341 -0
- package/es/input/input-legacy/util.js +176 -0
- package/es/input/style/index.css +1 -1
- package/es/input/util.js +26 -18
- package/es/lib/withDragDropContext.js +2 -2
- package/es/loading/Loading.js +173 -0
- package/es/loading/__tests__/index.test.js +110 -0
- package/es/loading/index.js +5 -129
- package/es/loading/style/index.css +0 -0
- package/es/loading/style/index.js +0 -0
- package/es/locales/en-US.js +45 -9
- package/es/locales/index.js +16 -2
- package/es/locales/zh-CN.js +46 -10
- package/es/locales/zh-Hant-HK.js +123 -0
- package/es/locales/zh-Hant-TW.js +125 -0
- package/es/menu/Item.js +34 -51
- package/es/menu/Menu.js +414 -0
- package/es/menu/SubMenu.js +63 -90
- package/es/menu/Title.js +37 -51
- package/es/menu/__tests__/index.test.js +274 -0
- package/es/menu/index.js +12 -419
- package/es/menu/style/index.css +1 -1
- package/es/message/__tests__/index.test.js +71 -0
- package/es/message/index.js +58 -0
- package/es/message/style/index.css +1 -0
- package/es/message/style/index.js +5 -0
- package/es/modal/__tests__/index.test.js +178 -0
- package/es/modal/index.js +85 -77
- package/es/modal/style/index.css +1 -1
- package/es/nav-menu/NavMenu.js +44 -61
- package/es/nav-menu/__test__/index.test.js +8 -8
- package/es/nav-menu/__tests__/index.test.js +23 -0
- package/es/nav-menu/index.js +2 -2
- package/es/notice/Notice.js +136 -0
- package/es/notice/NoticeContainer.js +107 -0
- package/es/notice/__tests__/index.test.js +174 -0
- package/es/notice/index.js +66 -0
- package/es/notice/style/index.css +1 -0
- package/es/notice/style/index.js +5 -0
- package/es/notification/HandleNotification/index.js +216 -0
- package/es/notification/HandleNotification/style/index.css +1 -0
- package/es/notification/HandleNotification/style/index.js +5 -0
- package/es/notification/__tests__/index.test.js +114 -0
- package/es/notification/index.js +68 -231
- package/es/notification/style/index.css +1 -1
- package/es/notification/style/index.js +0 -0
- package/es/pagination/Pager.js +7 -9
- package/es/pagination/Pagination.js +134 -133
- package/es/pagination/__tests__/index.test.js +244 -0
- package/es/pagination/index.js +9 -8
- package/es/pagination/style/index.css +1 -1
- package/es/panel/index.js +28 -46
- package/es/popover/__test__/index.test.js +10 -10
- package/es/popover/__tests__/index.test.js +152 -0
- package/es/popover/index.js +77 -83
- package/es/popper/index.js +68 -64
- package/es/popper/style/index.css +1 -1
- package/es/preview/index.js +529 -0
- package/es/preview/style/index.css +1 -0
- package/es/preview/style/index.js +3 -0
- package/es/progress/BarProgress.js +107 -43
- package/es/progress/CircleProgress.js +13 -14
- package/es/progress/DashboardProgress.js +11 -13
- package/es/progress/Progress.js +102 -0
- package/es/progress/__tests__/index.test.js +131 -0
- package/es/progress/index.js +8 -100
- package/es/progress/style/index.css +1 -1
- package/es/radio/Group.js +199 -0
- package/es/radio/Radio.js +147 -0
- package/es/radio/__tests__/index.test.js +127 -0
- package/es/radio/index.js +10 -216
- package/es/radio/{__test__ → radio-legacy/__test__}/index.test.js +13 -13
- package/es/radio/radio-legacy/index.js +214 -0
- package/es/radio/radio-legacy/style/index.css +1 -0
- package/es/radio/radio-legacy/style/index.js +3 -0
- package/es/radio/style/index.css +1 -1
- package/es/rate/Icons.js +70 -70
- package/es/rate/Rate.js +75 -108
- package/es/rate/__tests__/index.test.js +124 -0
- package/es/rate/index.js +5 -2
- package/es/rate/style/index.css +1 -1
- package/es/select/Select.js +330 -265
- package/es/select/SelectDropdown.js +223 -79
- package/es/select/SelectInput.js +120 -91
- package/es/select/__tests__/index.test.js +505 -0
- package/es/select/index.js +6 -4
- package/es/select/select-legacy/Option.js +78 -0
- package/es/select/select-legacy/Select.js +702 -0
- package/es/select/select-legacy/SelectDropdown.js +157 -0
- package/es/select/select-legacy/SelectInput.js +308 -0
- package/es/select/select-legacy/common.js +19 -0
- package/es/select/select-legacy/index.js +16 -0
- package/es/select/style/select-dropdown.css +1 -1
- package/es/select/style/select-input.css +1 -1
- package/es/stepper/Stepper.js +147 -0
- package/es/stepper/__tests__/index.test.js +161 -0
- package/es/stepper/index.js +21 -127
- package/es/stepper/style/index.css +1 -1
- package/es/style/icon/diyIcon.css +1 -1
- package/es/style/icon/index.css +1 -1
- package/es/switch/__tests__/index.test.js +68 -0
- package/es/switch/index.js +26 -46
- package/es/switch/style/index.css +1 -1
- package/es/table/Body.js +294 -0
- package/es/table/ClickOuterside.js +95 -0
- package/es/table/Footer.js +171 -0
- package/es/table/Header.js +320 -0
- package/es/table/TableContent.js +101 -0
- package/es/table/__tests__/index.test.js +129 -0
- package/es/table/checkbox/index.js +36 -47
- package/es/table/checkbox/style/index.css +1 -0
- package/es/table/checkbox/style/index.js +3 -0
- package/es/table/index.js +269 -314
- package/es/table/menu/index.js +34 -44
- package/es/table/prefix.js +2 -2
- package/es/table/style/Table.css +1 -1
- package/es/table/style/index.css +1 -1
- package/es/tabs/ItemDropdown.js +45 -65
- package/es/tabs/TabPane.js +26 -44
- package/es/tabs/Tabs.js +110 -111
- package/es/tabs/__tests__/index.test.js +329 -0
- package/es/tabs/index.js +9 -3
- package/es/tabs/style/index.css +1 -1
- package/es/tabs/tabs-legacy/ItemDropdown.js +162 -0
- package/es/tabs/tabs-legacy/TabPane.js +70 -0
- package/es/tabs/tabs-legacy/Tabs.js +291 -0
- package/es/tabs/tabs-legacy/index.js +18 -0
- package/es/tabs/tabs-legacy/style/index.css +1 -0
- package/es/tabs/tabs-legacy/style/index.js +3 -0
- package/es/tag/__tests__/index.test.js +46 -0
- package/es/tag/index.js +86 -0
- package/es/tag/style/index.css +1 -0
- package/es/tag/style/index.js +3 -0
- package/es/timeline/__tests__/index.test.js +198 -0
- package/es/timeline/index.js +206 -136
- package/es/timeline/style/index.css +1 -1
- package/es/tooltip/__tests__/index.test.js +166 -0
- package/es/tooltip/index.js +93 -52
- package/es/tooltip/style/index.css +1 -1
- package/es/transfer/Item.js +73 -71
- package/es/transfer/Transfer.js +558 -0
- package/es/transfer/__tests__/index.test.js +210 -0
- package/es/transfer/index.js +4 -443
- package/es/transfer/style/index.css +1 -1
- package/es/tree/IconLoading.js +38 -0
- package/es/tree/Tree.js +94 -111
- package/es/tree/TreeDivider.js +6 -6
- package/es/tree/TreeItem.js +217 -123
- package/es/tree/TreeNode.js +472 -333
- package/es/tree/__tests__/index.test.js +599 -0
- package/es/tree/index.js +9 -2
- package/es/tree/style/index.css +1 -1
- package/es/tree/tree-legacy/Tree.js +330 -0
- package/es/tree/tree-legacy/TreeDivider.js +25 -0
- package/es/tree/tree-legacy/TreeItem.js +326 -0
- package/es/tree/tree-legacy/TreeNode.js +711 -0
- package/es/tree/tree-legacy/index.js +13 -0
- package/es/tree/tree-legacy/style/index.css +1 -0
- package/es/tree/tree-legacy/style/index.js +3 -0
- package/es/tree/tree-legacy/util.js +434 -0
- package/es/tree/util.js +8 -256
- package/es/upload/Upload.js +292 -200
- package/es/upload/UploadAvatar.js +61 -79
- package/es/upload/UploadClick.js +62 -60
- package/es/upload/UploadDrag.js +63 -66
- package/es/upload/UploadPhoto.js +86 -75
- package/es/upload/UploadPictureCard.js +53 -60
- package/es/upload/__tests__/index.test.js +760 -0
- package/es/upload/index.js +8 -71
- package/es/upload/main.js +83 -0
- package/es/upload/style/index.css +1 -1
- package/es/upload/tool.js +0 -1
- package/es/upload/{Preview.js → upload-legacy/Preview.js} +48 -62
- package/es/upload/upload-legacy/Upload.js +431 -0
- package/es/upload/upload-legacy/UploadAvatar.js +318 -0
- package/es/upload/upload-legacy/UploadClick.js +121 -0
- package/es/upload/upload-legacy/UploadDrag.js +176 -0
- package/es/upload/upload-legacy/UploadPhoto.js +179 -0
- package/es/upload/upload-legacy/UploadPictureCard.js +122 -0
- package/es/upload/upload-legacy/index.js +67 -0
- package/es/upload/upload-legacy/style/index.css +1 -0
- package/es/upload/upload-legacy/style/index.js +5 -0
- package/es/upload/upload-legacy/tool.js +84 -0
- package/es/watermark/index.js +97 -0
- package/es/watermark/watermark.js +263 -0
- package/package.json +1 -1
- package/es/alert/__test__/index.test.js +0 -67
- package/es/button/__test__/index.test.js +0 -29
- package/es/cascader/__test__/index.test.js +0 -283
- package/es/cascader/menu.js +0 -155
- package/es/checkbox/Base.js +0 -205
- package/es/checkbox/CheckBox.js +0 -185
- package/es/collapse/__test__/index.test.js +0 -58
- package/es/counter/__test__/index.test.js +0 -52
- package/es/menu/ItemGroup.js +0 -81
- package/es/modal/__test__/index.test.js +0 -123
- package/es/notification/__test__/index.test.js +0 -56
- package/es/pagination/__test__/index.test.js +0 -140
- package/es/rate/__test__/index.test.js +0 -54
- package/es/select/Option.js +0 -93
- package/es/select/__test__/index.test.js +0 -429
- package/es/style/color/colors.css +0 -0
- package/es/style/index.css +0 -0
- package/es/style/mixins/colors.css +0 -0
- package/es/style/mixins/index.css +0 -0
- package/es/style/theme/dark.css +0 -0
- package/es/style/theme/default.css +0 -0
- package/es/switch/__test__/index.test.js +0 -39
- package/es/table/__test__/index.test.js +0 -73
- package/es/table/body.js +0 -318
- package/es/table/clickOuterside.js +0 -115
- package/es/table/footer.js +0 -196
- package/es/table/header.js +0 -337
- package/es/table/pover.js +0 -154
- package/es/table/tableContent.js +0 -120
- package/es/timeline/__test__/index.test.js +0 -49
- package/es/timeline/foldingItem.js +0 -82
- package/es/tooltip/__test__/index.test.js +0 -67
- package/es/transfer/__test__/index.test.js +0 -11
- /package/es/{style → breadcrumb/style}/index.js +0 -0
- /package/es/checkbox/{common.js → checkbox-legacy/common.js} +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.css +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.js +0 -0
package/es/table/index.js
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
|
-
exports["default"] = void 0;
|
|
10
|
+
exports.Table = exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
18
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
19
|
+
|
|
20
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
+
|
|
22
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
+
|
|
24
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
+
|
|
28
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
29
|
+
|
|
30
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
|
+
|
|
32
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
33
|
|
|
8
34
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
35
|
|
|
10
36
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
37
|
|
|
12
|
-
var
|
|
38
|
+
var _ClickOuterside = _interopRequireDefault(require("./ClickOuterside"));
|
|
13
39
|
|
|
14
|
-
var
|
|
40
|
+
var _TableContent = _interopRequireDefault(require("./TableContent"));
|
|
15
41
|
|
|
16
42
|
var _prefix = _interopRequireDefault(require("./prefix"));
|
|
17
43
|
|
|
@@ -29,87 +55,30 @@ require("../pagination/style");
|
|
|
29
55
|
|
|
30
56
|
require("../icon/style");
|
|
31
57
|
|
|
58
|
+
var _context = _interopRequireDefault(require("../context"));
|
|
59
|
+
|
|
32
60
|
var _tool = require("./tool");
|
|
33
61
|
|
|
34
62
|
var _axios = _interopRequireDefault(require("axios"));
|
|
35
63
|
|
|
36
64
|
var _qs = _interopRequireDefault(require("qs"));
|
|
37
65
|
|
|
38
|
-
var _context = _interopRequireDefault(require("../context"));
|
|
39
|
-
|
|
40
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
-
|
|
42
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
43
|
-
|
|
44
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
45
|
-
|
|
46
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
47
|
-
|
|
48
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
50
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
51
|
-
|
|
52
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
53
|
-
|
|
54
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
-
|
|
56
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
57
|
-
|
|
58
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
59
|
-
|
|
60
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
61
|
-
|
|
62
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
63
|
-
|
|
64
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
65
|
-
|
|
66
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
67
|
-
|
|
68
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
69
|
-
|
|
70
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
71
|
-
|
|
72
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
73
|
-
|
|
74
66
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
75
67
|
|
|
76
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) {
|
|
77
|
-
|
|
78
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
79
|
-
|
|
80
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
81
|
-
|
|
82
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
83
|
-
|
|
84
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
85
|
-
|
|
86
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
87
|
-
|
|
88
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
89
|
-
|
|
90
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
91
|
-
|
|
92
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
93
|
-
|
|
94
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
68
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
95
69
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
var Table = /*#__PURE__*/function (_Component) {
|
|
101
|
-
_inherits(Table, _Component);
|
|
102
|
-
|
|
103
|
-
var _super = _createSuper(Table);
|
|
70
|
+
var Table =
|
|
71
|
+
/*#__PURE__*/
|
|
72
|
+
function (_Component) {
|
|
73
|
+
(0, _inherits2["default"])(Table, _Component);
|
|
104
74
|
|
|
105
75
|
function Table(props) {
|
|
106
76
|
var _this;
|
|
107
77
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
_this = _super.call(this, props); // 只有dataSource,columns重造
|
|
78
|
+
(0, _classCallCheck2["default"])(this, Table);
|
|
79
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Table).call(this, props)); // 只有dataSource,columns重造
|
|
111
80
|
|
|
112
|
-
|
|
81
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "cbs", {
|
|
113
82
|
highlighCol: function highlighCol(key) {
|
|
114
83
|
var highlightCols = _this.state.highlightCols;
|
|
115
84
|
var col = highlightCols.indexOf(key);
|
|
@@ -234,30 +203,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
234
203
|
|
|
235
204
|
_this.setState(_objectSpread({
|
|
236
205
|
dataSource: dataSource
|
|
237
|
-
}, columnsDetail));
|
|
238
|
-
// index = parseInt(index)
|
|
239
|
-
// open = open === 'true'
|
|
240
|
-
//
|
|
241
|
-
// let {data} = this.props
|
|
242
|
-
// if (!open) {
|
|
243
|
-
// data.splice(index + 1, 0, {expand: true, parent: index, ...{width: '50px'}, ...item})
|
|
244
|
-
// } else {
|
|
245
|
-
// data.splice(index + 1, 1)
|
|
246
|
-
// }
|
|
247
|
-
// e.target.dataset.open = !open
|
|
248
|
-
// this.setState({dataSource: data})
|
|
249
|
-
|
|
206
|
+
}, columnsDetail));
|
|
250
207
|
}
|
|
251
208
|
});
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_defineProperty(_assertThisInitialized(_this), "fetch", function (extra) {
|
|
209
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showColumsPanel", function (e) {});
|
|
210
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "fetch", function (extra) {
|
|
256
211
|
extra = extra || {};
|
|
257
212
|
var origin = _this.props.origin;
|
|
258
213
|
var data = origin.data,
|
|
259
214
|
url = origin.url,
|
|
260
215
|
headers = origin.headers,
|
|
216
|
+
_origin$withCredentia = origin.withCredentials,
|
|
217
|
+
withCredentials = _origin$withCredentia === void 0 ? false : _origin$withCredentia,
|
|
261
218
|
_origin$type = origin.type,
|
|
262
219
|
type = _origin$type === void 0 ? 'GET' : _origin$type,
|
|
263
220
|
_origin$success = origin.success,
|
|
@@ -269,17 +226,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
269
226
|
_origin$currentPageNa = origin.currentPageName,
|
|
270
227
|
currentPageName = _origin$currentPageNa === void 0 ? Table.config.currentPageName : _origin$currentPageNa;
|
|
271
228
|
|
|
272
|
-
|
|
273
|
-
|
|
229
|
+
_loading["default"].open(_this.dom.current, {
|
|
230
|
+
key: 'loading'
|
|
274
231
|
});
|
|
275
232
|
|
|
276
233
|
var current = _this.state.serverPagination.current;
|
|
277
234
|
|
|
278
|
-
var requestParams = _objectSpread(
|
|
235
|
+
var requestParams = _objectSpread((0, _defineProperty2["default"])({}, currentPageName, current), data, {}, extra);
|
|
279
236
|
|
|
280
237
|
var options = {
|
|
281
238
|
url: url,
|
|
282
|
-
method: ['GET', 'get'].includes(type) ? 'GET' : 'POST'
|
|
239
|
+
method: ['GET', 'get'].includes(type) ? 'GET' : 'POST',
|
|
240
|
+
withCredentials: withCredentials
|
|
283
241
|
};
|
|
284
242
|
|
|
285
243
|
if (options.method === 'GET') {
|
|
@@ -304,17 +262,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
304
262
|
|
|
305
263
|
var columnsDetail = _this.setColumnsDetail(null, null, columns);
|
|
306
264
|
|
|
307
|
-
_this.setState(_objectSpread(
|
|
265
|
+
_this.setState(_objectSpread({
|
|
308
266
|
dataSource: data
|
|
309
|
-
}, columnsDetail
|
|
267
|
+
}, columnsDetail, {
|
|
310
268
|
serverPagination: page
|
|
311
269
|
}));
|
|
312
270
|
|
|
313
271
|
_this.runMemory();
|
|
314
272
|
|
|
315
|
-
|
|
273
|
+
_loading["default"].close('loading');
|
|
316
274
|
})["catch"](function (e) {
|
|
317
|
-
|
|
275
|
+
_loading["default"].close('loading');
|
|
276
|
+
|
|
318
277
|
error(e);
|
|
319
278
|
});
|
|
320
279
|
});
|
|
@@ -324,11 +283,11 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
324
283
|
_scroll = props.scroll;
|
|
325
284
|
|
|
326
285
|
_data = (0, _tool.setKey)(_data, 'id');
|
|
327
|
-
_this.dom =
|
|
328
|
-
_this.fixLeft =
|
|
329
|
-
_this.fixRight =
|
|
330
|
-
_this.fixRight =
|
|
331
|
-
_this.setting =
|
|
286
|
+
_this.dom = _react["default"].createRef();
|
|
287
|
+
_this.fixLeft = _react["default"].createRef();
|
|
288
|
+
_this.fixRight = _react["default"].createRef();
|
|
289
|
+
_this.fixRight = _react["default"].createRef();
|
|
290
|
+
_this.setting = _react["default"].createRef();
|
|
332
291
|
_this.state = {
|
|
333
292
|
dataSource: _data,
|
|
334
293
|
highlightCols: [],
|
|
@@ -345,7 +304,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
345
304
|
return _this;
|
|
346
305
|
}
|
|
347
306
|
|
|
348
|
-
|
|
307
|
+
(0, _createClass2["default"])(Table, [{
|
|
349
308
|
key: "runMemory",
|
|
350
309
|
value: function runMemory() {
|
|
351
310
|
var name = this.props.name;
|
|
@@ -444,12 +403,11 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
444
403
|
headerColumns = _this$state4.headerColumns,
|
|
445
404
|
leftFiexColumns = _this$state4.leftFiexColumns,
|
|
446
405
|
rightFixColumns = _this$state4.rightFixColumns,
|
|
447
|
-
highlightRows = _this$state4.highlightRows;
|
|
448
|
-
|
|
406
|
+
highlightRows = _this$state4.highlightRows;
|
|
449
407
|
var _this$props2 = this.props,
|
|
450
408
|
_this$props2$style = _this$props2.style,
|
|
451
409
|
style = _this$props2$style === void 0 ? {} : _this$props2$style,
|
|
452
|
-
props =
|
|
410
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props2, ["style"]);
|
|
453
411
|
|
|
454
412
|
var handleScroll = function handleScroll(e) {
|
|
455
413
|
var onLeft = e.target.scrollLeft === 0;
|
|
@@ -477,16 +435,16 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
477
435
|
if (leftFiexColumns.length === 0 && rightFixColumns.length === 0) {
|
|
478
436
|
scrollTable = this.getBaseContent();
|
|
479
437
|
} else {
|
|
480
|
-
scrollTable = [
|
|
438
|
+
scrollTable = [_react["default"].createElement("div", {
|
|
481
439
|
className: (0, _prefix["default"])('table-scroll'),
|
|
482
440
|
onScroll: handleScroll,
|
|
483
441
|
key: "content"
|
|
484
|
-
},
|
|
442
|
+
}, _react["default"].createElement("div", {
|
|
485
443
|
className: (0, _prefix["default"])('table-body'),
|
|
486
444
|
style: {
|
|
487
445
|
overflowX: 'auto'
|
|
488
446
|
}
|
|
489
|
-
},
|
|
447
|
+
}, _react["default"].createElement(_TableContent["default"], (0, _extends2["default"])({
|
|
490
448
|
style: _objectSpread({}, style)
|
|
491
449
|
}, Object.assign({}, _objectSpread({}, props), {
|
|
492
450
|
columns: columns
|
|
@@ -505,18 +463,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
505
463
|
})))), dataSource.length === 0 ? this.getEmptyContent() : null)];
|
|
506
464
|
|
|
507
465
|
if (leftFiexColumns.length > 0) {
|
|
508
|
-
scrollTable.push(
|
|
466
|
+
scrollTable.push(_react["default"].createElement("div", {
|
|
509
467
|
className: (0, _prefix["default"])('table-fixed-left'),
|
|
510
468
|
ref: this.fixLeft,
|
|
511
469
|
style: {
|
|
512
470
|
display: 'none'
|
|
513
471
|
},
|
|
514
472
|
key: "left"
|
|
515
|
-
},
|
|
473
|
+
}, _react["default"].createElement("div", {
|
|
516
474
|
className: (0, _prefix["default"])('table-outer')
|
|
517
|
-
},
|
|
475
|
+
}, _react["default"].createElement("div", {
|
|
518
476
|
className: (0, _prefix["default"])('table-inner')
|
|
519
|
-
},
|
|
477
|
+
}, _react["default"].createElement(_TableContent["default"], (0, _extends2["default"])({
|
|
520
478
|
style: _objectSpread({
|
|
521
479
|
width: 'auto'
|
|
522
480
|
}, style),
|
|
@@ -538,15 +496,15 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
538
496
|
}
|
|
539
497
|
|
|
540
498
|
if (rightFixColumns.length > 0) {
|
|
541
|
-
scrollTable.push(
|
|
499
|
+
scrollTable.push(_react["default"].createElement("div", {
|
|
542
500
|
className: (0, _prefix["default"])('table-fixed-right'),
|
|
543
501
|
ref: this.fixRight,
|
|
544
502
|
key: "right"
|
|
545
|
-
},
|
|
503
|
+
}, _react["default"].createElement("div", {
|
|
546
504
|
className: (0, _prefix["default"])('table-outer')
|
|
547
|
-
},
|
|
505
|
+
}, _react["default"].createElement("div", {
|
|
548
506
|
className: (0, _prefix["default"])('table-inner')
|
|
549
|
-
},
|
|
507
|
+
}, _react["default"].createElement(_TableContent["default"], (0, _extends2["default"])({
|
|
550
508
|
style: _objectSpread({
|
|
551
509
|
width: 'auto'
|
|
552
510
|
}, style),
|
|
@@ -568,7 +526,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
568
526
|
}
|
|
569
527
|
}
|
|
570
528
|
|
|
571
|
-
return
|
|
529
|
+
return _react["default"].createElement("div", {
|
|
572
530
|
className: (0, _prefix["default"])('table-content')
|
|
573
531
|
}, scrollTable);
|
|
574
532
|
}
|
|
@@ -582,19 +540,17 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
582
540
|
headerColumns = _this$state5.headerColumns,
|
|
583
541
|
highlightRows = _this$state5.highlightRows;
|
|
584
542
|
var scroll = this.state.scroll;
|
|
585
|
-
|
|
586
543
|
var _this$props3 = this.props,
|
|
587
544
|
_this$props3$style = _this$props3.style,
|
|
588
545
|
style = _this$props3$style === void 0 ? {} : _this$props3$style,
|
|
589
|
-
props =
|
|
590
|
-
|
|
591
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
546
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props3, ["style"]);
|
|
547
|
+
return _react["default"].createElement("div", {
|
|
592
548
|
className: (0, _prefix["default"])('table-content')
|
|
593
|
-
},
|
|
549
|
+
}, _react["default"].createElement("div", {
|
|
594
550
|
className: (0, _prefix["default"])('table-scroll')
|
|
595
|
-
},
|
|
551
|
+
}, _react["default"].createElement("div", {
|
|
596
552
|
className: (0, _prefix["default"])('table-head')
|
|
597
|
-
},
|
|
553
|
+
}, _react["default"].createElement(_TableContent["default"], Object.assign({}, _objectSpread({}, props), {
|
|
598
554
|
style: _objectSpread({}, style)
|
|
599
555
|
}, {
|
|
600
556
|
columns: columns
|
|
@@ -608,13 +564,13 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
608
564
|
cbs: this.cbs,
|
|
609
565
|
fetch: this.fetch,
|
|
610
566
|
t: this
|
|
611
|
-
}))),
|
|
567
|
+
}))), _react["default"].createElement("div", {
|
|
612
568
|
className: (0, _prefix["default"])('table-body'),
|
|
613
569
|
style: {
|
|
614
570
|
maxHeight: scroll.y + 'px',
|
|
615
571
|
overflow: 'auto'
|
|
616
572
|
}
|
|
617
|
-
},
|
|
573
|
+
}, _react["default"].createElement(_TableContent["default"], Object.assign({}, _objectSpread({}, props), {
|
|
618
574
|
style: _objectSpread({}, style)
|
|
619
575
|
}, {
|
|
620
576
|
columns: columns
|
|
@@ -641,20 +597,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
641
597
|
columns = _this$state6.columns,
|
|
642
598
|
headerColumns = _this$state6.headerColumns,
|
|
643
599
|
highlightRows = _this$state6.highlightRows;
|
|
644
|
-
|
|
645
600
|
var _this$props4 = this.props,
|
|
646
601
|
_this$props4$style = _this$props4.style,
|
|
647
602
|
style = _this$props4$style === void 0 ? {} : _this$props4$style,
|
|
648
|
-
props =
|
|
649
|
-
|
|
650
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
603
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props4, ["style"]);
|
|
604
|
+
return _react["default"].createElement("div", {
|
|
651
605
|
className: (0, _prefix["default"])('table-content')
|
|
652
|
-
},
|
|
606
|
+
}, _react["default"].createElement("div", {
|
|
653
607
|
className: (0, _prefix["default"])('table-body'),
|
|
654
608
|
style: {
|
|
655
609
|
overflowX: 'auto'
|
|
656
610
|
}
|
|
657
|
-
},
|
|
611
|
+
}, _react["default"].createElement(_TableContent["default"], Object.assign({}, {
|
|
658
612
|
style: _objectSpread({}, style)
|
|
659
613
|
}, _objectSpread({}, props), {
|
|
660
614
|
columns: columns
|
|
@@ -674,9 +628,18 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
674
628
|
}, {
|
|
675
629
|
key: "getEmptyContent",
|
|
676
630
|
value: function getEmptyContent() {
|
|
677
|
-
var
|
|
678
|
-
|
|
679
|
-
|
|
631
|
+
var _this$props5 = this.props,
|
|
632
|
+
emptyText = _this$props5.emptyText,
|
|
633
|
+
localeDatas = _this$props5.localeDatas;
|
|
634
|
+
var text = emptyText;
|
|
635
|
+
|
|
636
|
+
if (emptyText) {
|
|
637
|
+
text = typeof emptyText === 'string' ? emptyText : emptyText();
|
|
638
|
+
} else {
|
|
639
|
+
text = localeDatas.table.emptyText;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return _react["default"].createElement("div", {
|
|
680
643
|
className: "hi-table-placeholder"
|
|
681
644
|
}, text);
|
|
682
645
|
}
|
|
@@ -685,14 +648,13 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
685
648
|
value: function componentDidUpdate() {
|
|
686
649
|
var _this3 = this;
|
|
687
650
|
|
|
688
|
-
var _this$
|
|
689
|
-
fixTop = _this$
|
|
690
|
-
height = _this$
|
|
651
|
+
var _this$props6 = this.props,
|
|
652
|
+
fixTop = _this$props6.fixTop,
|
|
653
|
+
height = _this$props6.height,
|
|
654
|
+
rowSelection = _this$props6.rowSelection;
|
|
691
655
|
var leftFixTable = this.dom.current.querySelectorAll('.hi-table-fixed-left table tr');
|
|
692
656
|
var rightFixTable = this.dom.current.querySelectorAll('.hi-table-fixed-right table tr');
|
|
693
|
-
var scrollTable = this.dom.current.querySelectorAll('.hi-table-scroll table tr');
|
|
694
|
-
//
|
|
695
|
-
// }
|
|
657
|
+
var scrollTable = this.dom.current.querySelectorAll('.hi-table-scroll table tr');
|
|
696
658
|
|
|
697
659
|
if (scrollTable) {
|
|
698
660
|
scrollTable.forEach(function (tr, index) {
|
|
@@ -706,7 +668,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
706
668
|
});
|
|
707
669
|
}
|
|
708
670
|
|
|
709
|
-
if (!fixTop && height) {
|
|
671
|
+
if (!fixTop && !rowSelection && height) {
|
|
710
672
|
var hiTableBody = this.dom.current.querySelectorAll('.hi-table-body');
|
|
711
673
|
hiTableBody && hiTableBody.length > 0 && hiTableBody.forEach(function (item) {
|
|
712
674
|
item.style.maxHeight = height;
|
|
@@ -738,21 +700,22 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
738
700
|
|
|
739
701
|
// 多选配置
|
|
740
702
|
// noinspection JSAnnotator
|
|
741
|
-
var _this$
|
|
742
|
-
pagination = _this$
|
|
743
|
-
name = _this$
|
|
744
|
-
_this$
|
|
745
|
-
size = _this$
|
|
746
|
-
_this$
|
|
747
|
-
bordered = _this$
|
|
748
|
-
_this$
|
|
749
|
-
striped = _this$
|
|
750
|
-
scrollX = _this$
|
|
751
|
-
_this$
|
|
752
|
-
header = _this$
|
|
753
|
-
_this$
|
|
754
|
-
footer = _this$
|
|
755
|
-
|
|
703
|
+
var _this$props7 = this.props,
|
|
704
|
+
pagination = _this$props7.pagination,
|
|
705
|
+
name = _this$props7.name,
|
|
706
|
+
_this$props7$size = _this$props7.size,
|
|
707
|
+
size = _this$props7$size === void 0 ? 'normal' : _this$props7$size,
|
|
708
|
+
_this$props7$bordered = _this$props7.bordered,
|
|
709
|
+
bordered = _this$props7$bordered === void 0 ? false : _this$props7$bordered,
|
|
710
|
+
_this$props7$striped = _this$props7.striped,
|
|
711
|
+
striped = _this$props7$striped === void 0 ? false : _this$props7$striped,
|
|
712
|
+
scrollX = _this$props7.scrollX,
|
|
713
|
+
_this$props7$header = _this$props7.header,
|
|
714
|
+
header = _this$props7$header === void 0 ? null : _this$props7$header,
|
|
715
|
+
_this$props7$footer = _this$props7.footer,
|
|
716
|
+
footer = _this$props7$footer === void 0 ? null : _this$props7$footer,
|
|
717
|
+
theme = _this$props7.theme,
|
|
718
|
+
localeDatas = _this$props7.localeDatas; // noinspection JSAnnotator
|
|
756
719
|
|
|
757
720
|
var _this$state7 = this.state,
|
|
758
721
|
scroll = _this$state7.scroll,
|
|
@@ -816,31 +779,23 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
816
779
|
}
|
|
817
780
|
|
|
818
781
|
var serverPaginationConfig = serverPagination;
|
|
819
|
-
|
|
820
|
-
if (serverPagination && serverPagination.current) {
|
|
821
|
-
serverPaginationConfig = _objectSpread(_objectSpread({}, serverPagination), {}, {
|
|
822
|
-
defaultCurrent: serverPagination.current
|
|
823
|
-
});
|
|
824
|
-
delete serverPaginationConfig.current;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
782
|
+
return _react["default"].createElement("div", {
|
|
828
783
|
className: (0, _prefix["default"])((_prifix = {
|
|
829
784
|
table: true
|
|
830
|
-
},
|
|
785
|
+
}, (0, _defineProperty2["default"])(_prifix, "theme__".concat(theme), true), (0, _defineProperty2["default"])(_prifix, size, size), (0, _defineProperty2["default"])(_prifix, "bordered", bordered), (0, _defineProperty2["default"])(_prifix, "striped", striped), _prifix)),
|
|
831
786
|
ref: this.dom
|
|
832
|
-
}, header &&
|
|
787
|
+
}, header && _react["default"].createElement("div", {
|
|
833
788
|
className: (0, _prefix["default"])({
|
|
834
789
|
'table-pre-header': true
|
|
835
790
|
})
|
|
836
|
-
}, header()),
|
|
791
|
+
}, header()), _react["default"].createElement("div", {
|
|
837
792
|
className: (0, _prefix["default"])({
|
|
838
793
|
'table-container': true
|
|
839
794
|
})
|
|
840
|
-
},
|
|
795
|
+
}, _react["default"].createElement("div", null, content), name && _react["default"].createElement("div", {
|
|
841
796
|
className: (0, _prefix["default"])('table-setting'),
|
|
842
797
|
ref: this.setting
|
|
843
|
-
},
|
|
798
|
+
}, _react["default"].createElement("div", {
|
|
844
799
|
onClick: function onClick(e) {
|
|
845
800
|
var columnMenu = _this4.state.columnMenu;
|
|
846
801
|
|
|
@@ -848,24 +803,23 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
848
803
|
columnMenu: !columnMenu
|
|
849
804
|
});
|
|
850
805
|
}
|
|
851
|
-
},
|
|
806
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
852
807
|
name: "menu",
|
|
853
808
|
style: {
|
|
854
|
-
color: '#4284F5',
|
|
855
809
|
fontSize: '24px'
|
|
856
810
|
}
|
|
857
|
-
})), columnMenu &&
|
|
811
|
+
})), columnMenu && _react["default"].createElement(_ClickOuterside["default"], {
|
|
858
812
|
onClickOutside: function onClickOutside(e) {
|
|
859
813
|
return _this4.setState({
|
|
860
814
|
columnMenu: false
|
|
861
815
|
});
|
|
862
816
|
}
|
|
863
|
-
},
|
|
817
|
+
}, _react["default"].createElement("div", {
|
|
864
818
|
className: (0, _prefix["default"])('table-setting-menu column-menu')
|
|
865
819
|
}, columns.map(function (item) {
|
|
866
|
-
return
|
|
820
|
+
return _react["default"].createElement("div", {
|
|
867
821
|
key: item.key
|
|
868
|
-
},
|
|
822
|
+
}, _react["default"].createElement("div", null, function () {
|
|
869
823
|
if (item.type === 'select') {
|
|
870
824
|
return localeDatas.table.checkAll;
|
|
871
825
|
}
|
|
@@ -879,37 +833,37 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
879
833
|
}
|
|
880
834
|
|
|
881
835
|
return item.title;
|
|
882
|
-
}()),
|
|
836
|
+
}()), _react["default"].createElement("div", null, _react["default"].createElement(_checkbox["default"], {
|
|
883
837
|
checked: !item.hide,
|
|
884
838
|
onChange: function onChange(e) {
|
|
885
839
|
_this4.cbs.hideCol(item.key);
|
|
886
840
|
}
|
|
887
841
|
})));
|
|
888
|
-
}))))), footer &&
|
|
842
|
+
}))))), footer && _react["default"].createElement("div", {
|
|
889
843
|
className: (0, _prefix["default"])({
|
|
890
844
|
'table-pre-footer': true
|
|
891
845
|
})
|
|
892
|
-
}, footer()), (pagination || columns) &&
|
|
846
|
+
}, footer()), (pagination || columns) && _react["default"].createElement("br", null), pagination && _react["default"].createElement("div", {
|
|
893
847
|
style: {
|
|
894
848
|
display: 'flex',
|
|
895
849
|
justifyContent: pagePosition
|
|
896
850
|
}
|
|
897
|
-
},
|
|
851
|
+
}, _react["default"].createElement("div", {
|
|
898
852
|
className: (0, _prefix["default"])('table-page')
|
|
899
|
-
},
|
|
853
|
+
}, _react["default"].createElement(_pagination["default"], pagination))), serverPaginationConfig && _react["default"].createElement("div", {
|
|
900
854
|
style: {
|
|
901
855
|
display: 'flex',
|
|
902
856
|
justifyContent: serverPagePosition
|
|
903
857
|
},
|
|
904
858
|
a: "1"
|
|
905
|
-
},
|
|
859
|
+
}, _react["default"].createElement("div", {
|
|
906
860
|
className: (0, _prefix["default"])('table-page')
|
|
907
|
-
},
|
|
861
|
+
}, _react["default"].createElement(_pagination["default"], (0, _extends2["default"])({}, serverPaginationConfig, {
|
|
908
862
|
onChange: function onChange(current) {
|
|
909
863
|
serverPaginationConfig.onChange && serverPaginationConfig.onChange(current);
|
|
910
864
|
|
|
911
865
|
_this4.setState({
|
|
912
|
-
serverPagination: _objectSpread(
|
|
866
|
+
serverPagination: _objectSpread({}, serverPagination, {
|
|
913
867
|
current: current
|
|
914
868
|
})
|
|
915
869
|
}, _this4.fetch);
|
|
@@ -921,10 +875,10 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
921
875
|
value: function xscroll() {
|
|
922
876
|
var _this5 = this;
|
|
923
877
|
|
|
924
|
-
var _this$
|
|
925
|
-
_this$
|
|
926
|
-
fixTop = _this$
|
|
927
|
-
name = _this$
|
|
878
|
+
var _this$props8 = this.props,
|
|
879
|
+
_this$props8$fixTop = _this$props8.fixTop,
|
|
880
|
+
fixTop = _this$props8$fixTop === void 0 ? false : _this$props8$fixTop,
|
|
881
|
+
name = _this$props8.name;
|
|
928
882
|
|
|
929
883
|
if (typeof fixTop === 'boolean') {
|
|
930
884
|
fixTop = 0;
|
|
@@ -934,13 +888,12 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
934
888
|
|
|
935
889
|
var dom = this.dom.current;
|
|
936
890
|
var thead = dom ? dom.querySelectorAll('thead') : null;
|
|
937
|
-
var offsetTop = (0, _tool.offset)(dom).top; //
|
|
891
|
+
var offsetTop = (0, _tool.offset)(dom).top; // 表格距离顶部的位置 < 表格+ 自己的高度
|
|
938
892
|
|
|
939
893
|
if (thead) {
|
|
940
|
-
if ((0, _tool.scrollTop)() + fixTop > offsetTop &&
|
|
894
|
+
if ((0, _tool.scrollTop)() + fixTop > offsetTop && fixTop < parseInt((0, _tool.getStyle)(dom, 'height'), 10) - parseInt((0, _tool.getStyle)(thead[0], 'height'), 10)) {
|
|
941
895
|
thead.forEach(function (th) {
|
|
942
|
-
th.style.display = 'table-header-group';
|
|
943
|
-
|
|
896
|
+
th.style.display = 'table-header-group';
|
|
944
897
|
var h = (0, _tool.getPosition)(dom).y * -1 + fixTop;
|
|
945
898
|
th.style.transform = "translate(0,".concat(h, "px)");
|
|
946
899
|
|
|
@@ -987,7 +940,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
987
940
|
return !fixed || fixed !== 'left' && fixed !== 'right';
|
|
988
941
|
}); // 讲表格重新排序,并且去掉slelect ,因为是null
|
|
989
942
|
|
|
990
|
-
columns = [].concat(
|
|
943
|
+
columns = [].concat((0, _toConsumableArray2["default"])(leftFiexColumns), (0, _toConsumableArray2["default"])(commanColumns), (0, _toConsumableArray2["default"])(rightFixColumns)).filter(function (item) {
|
|
991
944
|
return item !== select;
|
|
992
945
|
}).filter(function (col) {
|
|
993
946
|
return !!col;
|
|
@@ -1002,7 +955,9 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1002
955
|
}
|
|
1003
956
|
}, {
|
|
1004
957
|
key: "getHeaderGroup",
|
|
1005
|
-
value: function getHeaderGroup(columns) {
|
|
958
|
+
value: function getHeaderGroup(columns, rowSelection) {
|
|
959
|
+
var _this6 = this;
|
|
960
|
+
|
|
1006
961
|
columns = columns.map(function (item) {
|
|
1007
962
|
item.title = item.title || item.dataIndex;
|
|
1008
963
|
item.key = item.key || item.dataIndex || item.title || item.id;
|
|
@@ -1013,23 +968,109 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1013
968
|
|
|
1014
969
|
return item;
|
|
1015
970
|
});
|
|
971
|
+
|
|
972
|
+
if (rowSelection) {
|
|
973
|
+
var _rowSelection$selecte = rowSelection.selectedRowKeys,
|
|
974
|
+
selectedRowKeys = _rowSelection$selecte === void 0 ? [] : _rowSelection$selecte,
|
|
975
|
+
_rowSelection$dataNam = rowSelection.dataName,
|
|
976
|
+
dataName = _rowSelection$dataNam === void 0 ? 'key' : _rowSelection$dataNam;
|
|
977
|
+
columns.unshift({
|
|
978
|
+
width: '50px',
|
|
979
|
+
type: 'select',
|
|
980
|
+
key: 'hi-table-select-' + this.props.name,
|
|
981
|
+
title: function title() {
|
|
982
|
+
var _rowSelection$getChec = rowSelection.getCheckboxProps,
|
|
983
|
+
getCheckboxProps = _rowSelection$getChec === void 0 ? function (record) {
|
|
984
|
+
return {
|
|
985
|
+
disabled: false
|
|
986
|
+
};
|
|
987
|
+
} : _rowSelection$getChec,
|
|
988
|
+
_onChange = rowSelection.onChange;
|
|
989
|
+
return _react["default"].createElement(_checkbox["default"], {
|
|
990
|
+
type: "checkbox",
|
|
991
|
+
checked: selectedRowKeys.length === _this6.state.dataSource.filter(function (record) {
|
|
992
|
+
return !getCheckboxProps(record).disabled;
|
|
993
|
+
}).length && _this6.state.dataSource.filter(function (record) {
|
|
994
|
+
return !getCheckboxProps(record).disabled;
|
|
995
|
+
}).length > 0,
|
|
996
|
+
onChange: function onChange(e, checked) {
|
|
997
|
+
var data = _this6.state.dataSource.filter(function (record) {
|
|
998
|
+
return !getCheckboxProps(record).disabled;
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
var _selectedRowKeys = (0, _toConsumableArray2["default"])(selectedRowKeys);
|
|
1002
|
+
|
|
1003
|
+
if (checked) {
|
|
1004
|
+
_selectedRowKeys.splice(0, selectedRowKeys.length);
|
|
1005
|
+
|
|
1006
|
+
for (var i = 0; i < data.length; i++) {
|
|
1007
|
+
_selectedRowKeys.push(data[i][dataName]);
|
|
1008
|
+
}
|
|
1009
|
+
} else {
|
|
1010
|
+
_selectedRowKeys.splice(0, _selectedRowKeys.length);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
_onChange(_selectedRowKeys, data.filter(function (record) {
|
|
1014
|
+
return _selectedRowKeys.includes(record[dataName]);
|
|
1015
|
+
}));
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
},
|
|
1019
|
+
render: function render(text, record, index) {
|
|
1020
|
+
var _rowSelection$getChec2 = rowSelection.getCheckboxProps,
|
|
1021
|
+
getCheckboxProps = _rowSelection$getChec2 === void 0 ? function (record) {
|
|
1022
|
+
return {
|
|
1023
|
+
disabled: false
|
|
1024
|
+
};
|
|
1025
|
+
} : _rowSelection$getChec2,
|
|
1026
|
+
_onChange2 = rowSelection.onChange; // todo dataName 是干嘛的不明白
|
|
1027
|
+
|
|
1028
|
+
return _react["default"].createElement(_checkbox["default"], {
|
|
1029
|
+
type: "checkbox",
|
|
1030
|
+
checked: selectedRowKeys.includes(record[dataName]),
|
|
1031
|
+
disabled: getCheckboxProps(record).disabled,
|
|
1032
|
+
onChange: function onChange(e, checked) {
|
|
1033
|
+
var data = _this6.state.dataSource.filter(function (record) {
|
|
1034
|
+
return !getCheckboxProps(record).disabled;
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
var _selectedRowKeys = (0, _toConsumableArray2["default"])(selectedRowKeys);
|
|
1038
|
+
|
|
1039
|
+
if (checked) {
|
|
1040
|
+
_selectedRowKeys.push(record[dataName]);
|
|
1041
|
+
} else {
|
|
1042
|
+
_selectedRowKeys = _selectedRowKeys.filter(function (key) {
|
|
1043
|
+
return record[dataName] !== key;
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
_onChange2(_selectedRowKeys, data.filter(function (record) {
|
|
1048
|
+
return _selectedRowKeys.includes(record[dataName]);
|
|
1049
|
+
}));
|
|
1050
|
+
},
|
|
1051
|
+
key: record[dataName]
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1016
1057
|
var bodyColumns = [];
|
|
1017
1058
|
var headerColumns = [];
|
|
1018
1059
|
|
|
1019
1060
|
var deepMap = function deepMap(columns, parent) {
|
|
1020
|
-
for (var
|
|
1021
|
-
columns[
|
|
1022
|
-
columns[
|
|
1023
|
-
var children = columns[
|
|
1061
|
+
for (var i = 0; i < columns.length; i++) {
|
|
1062
|
+
columns[i].key = columns[i].key || columns[i].title;
|
|
1063
|
+
columns[i].depth = parent.depth + 1;
|
|
1064
|
+
var children = columns[i].children;
|
|
1024
1065
|
|
|
1025
1066
|
if (children && children.length > 0) {
|
|
1026
|
-
columns[
|
|
1027
|
-
deepMap(children, columns[
|
|
1067
|
+
columns[i].isLast = false;
|
|
1068
|
+
deepMap(children, columns[i]);
|
|
1028
1069
|
} else {
|
|
1029
|
-
columns[
|
|
1070
|
+
columns[i].isLast = true;
|
|
1030
1071
|
}
|
|
1031
1072
|
|
|
1032
|
-
bodyColumns.push(columns[
|
|
1073
|
+
bodyColumns.push(columns[i]);
|
|
1033
1074
|
}
|
|
1034
1075
|
};
|
|
1035
1076
|
|
|
@@ -1063,10 +1104,9 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1063
1104
|
bodyColumns[key].headColSpan = getNum(bodyColumns[key]);
|
|
1064
1105
|
}
|
|
1065
1106
|
|
|
1066
|
-
var maxArray =
|
|
1107
|
+
var maxArray = (0, _toConsumableArray2["default"])(bodyColumns).sort(function (pre, next) {
|
|
1067
1108
|
return next.depth - pre.depth;
|
|
1068
1109
|
});
|
|
1069
|
-
|
|
1070
1110
|
var max = maxArray.length > 0 ? maxArray[0].depth : 0; // 设置header-rowSpan
|
|
1071
1111
|
|
|
1072
1112
|
var bd = bodyColumns.map(function (item) {
|
|
@@ -1098,104 +1138,17 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1098
1138
|
}, {
|
|
1099
1139
|
key: "setColumnsDetail",
|
|
1100
1140
|
value: function setColumnsDetail(bool, prop, c) {
|
|
1101
|
-
var _this6 = this;
|
|
1102
|
-
|
|
1103
1141
|
var props = prop || this.props;
|
|
1104
1142
|
var leftFiexColumns = [];
|
|
1105
1143
|
var rightFixColumns = [];
|
|
1106
1144
|
|
|
1107
|
-
var _this$getHeaderGroup = this.getHeaderGroup(c || props.columns),
|
|
1108
|
-
_this$getHeaderGroup2 =
|
|
1145
|
+
var _this$getHeaderGroup = this.getHeaderGroup(c || props.columns, props.rowSelection),
|
|
1146
|
+
_this$getHeaderGroup2 = (0, _slicedToArray2["default"])(_this$getHeaderGroup, 2),
|
|
1109
1147
|
headerColumns = _this$getHeaderGroup2[0],
|
|
1110
1148
|
columns = _this$getHeaderGroup2[1];
|
|
1111
1149
|
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1114
|
-
name = props.name,
|
|
1115
|
-
scrollX = props.scrollX;
|
|
1116
|
-
|
|
1117
|
-
if (rowSelection) {
|
|
1118
|
-
var _rowSelection$selecte = rowSelection.selectedRowKeys,
|
|
1119
|
-
selectedRowKeys = _rowSelection$selecte === void 0 ? [] : _rowSelection$selecte,
|
|
1120
|
-
_rowSelection$dataNam = rowSelection.dataName,
|
|
1121
|
-
dataName = _rowSelection$dataNam === void 0 ? 'key' : _rowSelection$dataNam;
|
|
1122
|
-
columns.unshift({
|
|
1123
|
-
width: '50px',
|
|
1124
|
-
type: 'select',
|
|
1125
|
-
key: 'hi-table-select-' + name,
|
|
1126
|
-
title: function title() {
|
|
1127
|
-
var _rowSelection$getChec = rowSelection.getCheckboxProps,
|
|
1128
|
-
getCheckboxProps = _rowSelection$getChec === void 0 ? function (record) {
|
|
1129
|
-
return {
|
|
1130
|
-
disabled: false
|
|
1131
|
-
};
|
|
1132
|
-
} : _rowSelection$getChec,
|
|
1133
|
-
_onChange = rowSelection.onChange;
|
|
1134
|
-
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
1135
|
-
type: "checkbox",
|
|
1136
|
-
checked: selectedRowKeys.length === _this6.state.dataSource.filter(function (record) {
|
|
1137
|
-
return !getCheckboxProps(record).disabled;
|
|
1138
|
-
}).length && _this6.state.dataSource.filter(function (record) {
|
|
1139
|
-
return !getCheckboxProps(record).disabled;
|
|
1140
|
-
}).length > 0,
|
|
1141
|
-
onChange: function onChange(e, checked) {
|
|
1142
|
-
var data = _this6.state.dataSource.filter(function (record) {
|
|
1143
|
-
return !getCheckboxProps(record).disabled;
|
|
1144
|
-
});
|
|
1145
|
-
|
|
1146
|
-
if (checked) {
|
|
1147
|
-
selectedRowKeys.splice(0, selectedRowKeys.length);
|
|
1148
|
-
|
|
1149
|
-
for (var i = 0; i < data.length; i++) {
|
|
1150
|
-
selectedRowKeys.push(data[i][dataName]);
|
|
1151
|
-
}
|
|
1152
|
-
} else {
|
|
1153
|
-
selectedRowKeys.splice(0, selectedRowKeys.length);
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
_onChange(selectedRowKeys, data.filter(function (record) {
|
|
1157
|
-
return selectedRowKeys.includes(record[dataName]);
|
|
1158
|
-
}));
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
},
|
|
1162
|
-
render: function render(text, record, index) {
|
|
1163
|
-
var _rowSelection$getChec2 = rowSelection.getCheckboxProps,
|
|
1164
|
-
getCheckboxProps = _rowSelection$getChec2 === void 0 ? function (record) {
|
|
1165
|
-
return {
|
|
1166
|
-
disabled: false
|
|
1167
|
-
};
|
|
1168
|
-
} : _rowSelection$getChec2,
|
|
1169
|
-
_onChange2 = rowSelection.onChange; // todo dataName 是干嘛的不明白
|
|
1170
|
-
|
|
1171
|
-
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
|
1172
|
-
type: "checkbox",
|
|
1173
|
-
che: selectedRowKeys.includes(record[dataName]),
|
|
1174
|
-
checked: selectedRowKeys.includes(record[dataName]),
|
|
1175
|
-
disabled: getCheckboxProps(record).disabled,
|
|
1176
|
-
onChange: function onChange(e, checked) {
|
|
1177
|
-
var data = _this6.state.dataSource.filter(function (record) {
|
|
1178
|
-
return !getCheckboxProps(record).disabled;
|
|
1179
|
-
});
|
|
1180
|
-
|
|
1181
|
-
if (checked) {
|
|
1182
|
-
selectedRowKeys.push(record[dataName]);
|
|
1183
|
-
} else {
|
|
1184
|
-
selectedRowKeys = selectedRowKeys.filter(function (key) {
|
|
1185
|
-
return record[dataName] !== key;
|
|
1186
|
-
});
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
_onChange2(selectedRowKeys, data.filter(function (record) {
|
|
1190
|
-
return selectedRowKeys.includes(record[dataName]);
|
|
1191
|
-
}));
|
|
1192
|
-
},
|
|
1193
|
-
key: record[dataName]
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
} // TODO 这里的逻辑要优化
|
|
1198
|
-
|
|
1150
|
+
var scroll = props.scroll,
|
|
1151
|
+
scrollX = props.scrollX; // TODO 这里的逻辑要优化
|
|
1199
1152
|
|
|
1200
1153
|
if (scroll.x || scrollX || bool) {
|
|
1201
1154
|
var obj = this.getColumns(columns);
|
|
@@ -1226,6 +1179,8 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1226
1179
|
type = _ref7$origin$type === void 0 ? 'GET' : _ref7$origin$type,
|
|
1227
1180
|
_ref7$origin$mode = _ref7$origin.mode,
|
|
1228
1181
|
mode = _ref7$origin$mode === void 0 ? 'json' : _ref7$origin$mode,
|
|
1182
|
+
_ref7$origin$withCred = _ref7$origin.withCredentials,
|
|
1183
|
+
withCredentials = _ref7$origin$withCred === void 0 ? false : _ref7$origin$withCred,
|
|
1229
1184
|
_ref7$origin$success = _ref7$origin.success,
|
|
1230
1185
|
success = _ref7$origin$success === void 0 ? function (res) {} : _ref7$origin$success,
|
|
1231
1186
|
_ref7$origin$error = _ref7$origin.error,
|
|
@@ -1233,8 +1188,8 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1233
1188
|
_ref7$origin$currentP = _ref7$origin.currentPageName,
|
|
1234
1189
|
currentPageName = _ref7$origin$currentP === void 0 ? Table.config.currentPageName : _ref7$origin$currentP;
|
|
1235
1190
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1191
|
+
_loading["default"].open(this.dom.current, {
|
|
1192
|
+
key: 'loading'
|
|
1238
1193
|
});
|
|
1239
1194
|
|
|
1240
1195
|
this.setState({
|
|
@@ -1249,7 +1204,8 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1249
1204
|
|
|
1250
1205
|
var options = {
|
|
1251
1206
|
method: ['GET', 'get'].includes(type) ? 'GET' : 'POST',
|
|
1252
|
-
url: url
|
|
1207
|
+
url: url,
|
|
1208
|
+
withCredentials: withCredentials
|
|
1253
1209
|
};
|
|
1254
1210
|
|
|
1255
1211
|
if (options.method === 'GET') {
|
|
@@ -1284,10 +1240,11 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1284
1240
|
|
|
1285
1241
|
_this7.runMemory();
|
|
1286
1242
|
|
|
1287
|
-
|
|
1243
|
+
_loading["default"].close('loading');
|
|
1288
1244
|
});
|
|
1289
1245
|
})["catch"](function (e) {
|
|
1290
|
-
|
|
1246
|
+
_loading["default"].close('loading');
|
|
1247
|
+
|
|
1291
1248
|
error(e);
|
|
1292
1249
|
});
|
|
1293
1250
|
}
|
|
@@ -1296,11 +1253,11 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1296
1253
|
value: function componentDidMount() {
|
|
1297
1254
|
var _this8 = this;
|
|
1298
1255
|
|
|
1299
|
-
var _this$
|
|
1300
|
-
fixTop = _this$
|
|
1301
|
-
scroll = _this$
|
|
1302
|
-
name = _this$
|
|
1303
|
-
origin = _this$
|
|
1256
|
+
var _this$props9 = this.props,
|
|
1257
|
+
fixTop = _this$props9.fixTop,
|
|
1258
|
+
scroll = _this$props9.scroll,
|
|
1259
|
+
name = _this$props9.name,
|
|
1260
|
+
origin = _this$props9.origin;
|
|
1304
1261
|
var dom = this.dom.current;
|
|
1305
1262
|
|
|
1306
1263
|
if (fixTop) {
|
|
@@ -1308,7 +1265,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1308
1265
|
document.addEventListener('scroll', function () {
|
|
1309
1266
|
_this8.xscroll();
|
|
1310
1267
|
});
|
|
1311
|
-
}
|
|
1268
|
+
} // 如果有列冻结的配置
|
|
1312
1269
|
|
|
1313
1270
|
|
|
1314
1271
|
if (scroll.x) {
|
|
@@ -1357,7 +1314,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1357
1314
|
columns = _ref8.columns,
|
|
1358
1315
|
width = _ref8.width,
|
|
1359
1316
|
scroll = _ref8.scroll,
|
|
1360
|
-
props =
|
|
1317
|
+
props = (0, _objectWithoutProperties2["default"])(_ref8, ["data", "columns", "width", "scroll"]);
|
|
1361
1318
|
|
|
1362
1319
|
// 服务端表格
|
|
1363
1320
|
if (props.origin) {
|
|
@@ -1410,10 +1367,10 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1410
1367
|
width: width,
|
|
1411
1368
|
scroll: scroll
|
|
1412
1369
|
}, props));
|
|
1413
|
-
this.setState(_objectSpread(
|
|
1370
|
+
this.setState(_objectSpread({
|
|
1414
1371
|
dataSource: data,
|
|
1415
1372
|
scroll: scroll
|
|
1416
|
-
}, columnsDetail
|
|
1373
|
+
}, columnsDetail, {}, props));
|
|
1417
1374
|
setTimeout(function () {
|
|
1418
1375
|
_this9.runMemory();
|
|
1419
1376
|
}, 0);
|
|
@@ -1451,11 +1408,11 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
1451
1408
|
return true;
|
|
1452
1409
|
}
|
|
1453
1410
|
}]);
|
|
1454
|
-
|
|
1455
1411
|
return Table;
|
|
1456
1412
|
}(_react.Component);
|
|
1457
1413
|
|
|
1458
|
-
|
|
1414
|
+
exports.Table = Table;
|
|
1415
|
+
(0, _defineProperty2["default"])(Table, "propTypes", {
|
|
1459
1416
|
data: _propTypes["default"].array,
|
|
1460
1417
|
useFixedHeader: _propTypes["default"].bool,
|
|
1461
1418
|
columns: _propTypes["default"].array,
|
|
@@ -1476,8 +1433,7 @@ _defineProperty(Table, "propTypes", {
|
|
|
1476
1433
|
emptyText: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].func]),
|
|
1477
1434
|
scroll: _propTypes["default"].object
|
|
1478
1435
|
});
|
|
1479
|
-
|
|
1480
|
-
_defineProperty(Table, "defaultProps", {
|
|
1436
|
+
(0, _defineProperty2["default"])(Table, "defaultProps", {
|
|
1481
1437
|
data: [],
|
|
1482
1438
|
columns: [],
|
|
1483
1439
|
useFixedHeader: false,
|
|
@@ -1501,7 +1457,6 @@ _defineProperty(Table, "defaultProps", {
|
|
|
1501
1457
|
return 'No Data';
|
|
1502
1458
|
}
|
|
1503
1459
|
});
|
|
1504
|
-
|
|
1505
1460
|
Table.config = {
|
|
1506
1461
|
currentPageName: 'current',
|
|
1507
1462
|
pageSizeName: 'pageSize',
|