@hi-ui/hiui 2.15.10 → 2.15.11
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/CHANGELOG.md +3 -0
- package/es/_util/warning.js +2 -2
- package/es/alert/__test__/index.test.js +67 -0
- package/es/alert/index.js +147 -6
- package/es/alert/style/index.css +1 -1
- package/es/badge/index.js +87 -9
- package/es/badge/style/index.css +1 -1
- package/es/badge/style/index.js +0 -0
- package/es/button/Button.js +51 -59
- package/es/button/ButtonGroup.js +31 -23
- package/es/button/IconLoading.js +2 -2
- package/es/button/__test__/index.test.js +29 -0
- package/es/button/index.js +2 -3
- package/es/button/style/index.css +1 -1
- package/es/card/index.js +42 -54
- package/es/card/style/index.css +1 -1
- package/es/cascader/Cascader.js +116 -181
- package/es/cascader/__test__/index.test.js +283 -0
- package/es/cascader/index.js +2 -5
- package/es/cascader/menu.js +155 -0
- package/es/cascader/style/cascader.css +1 -1
- package/es/cascader/style/menu.css +1 -1
- package/es/checkbox/{checkbox-legacy/Base.js → Base.js} +31 -46
- package/es/checkbox/CheckBox.js +185 -0
- package/es/checkbox/index.js +4 -13
- package/es/checkbox/style/index.css +1 -1
- package/es/collapse/__test__/index.test.js +58 -0
- package/es/collapse/index.js +93 -79
- package/es/collapse/style/index.css +1 -1
- package/es/confirm/index.js +50 -37
- package/es/context/index.js +37 -39
- package/es/counter/__test__/index.test.js +52 -0
- package/es/counter/index.js +270 -6
- package/es/counter/style/index.css +1 -1
- package/es/date-picker/BasePicker.js +288 -374
- package/es/date-picker/Calender.js +90 -326
- package/es/date-picker/DatePanel.js +186 -175
- package/es/date-picker/DatePicker.js +51 -151
- package/es/date-picker/DateRangePanel.js +181 -253
- package/es/date-picker/Modal.js +25 -15
- package/es/date-picker/Time.js +336 -230
- package/es/date-picker/TimePanel.js +32 -27
- package/es/date-picker/TimePeriodPanel.js +32 -21
- package/es/date-picker/TimePicker.js +40 -42
- package/es/date-picker/TimeRangePanel.js +42 -32
- package/es/date-picker/Type.js +1 -5
- package/es/date-picker/WeekRangePanel.js +150 -237
- package/es/date-picker/constants.js +28 -14
- package/es/date-picker/dateUtil.js +52 -221
- package/es/date-picker/index.js +2 -5
- package/es/date-picker/style/index.css +1 -1
- package/es/date-picker/util.js +8 -101
- package/es/dropdown/Dropdown.js +199 -193
- package/es/dropdown/{tests → __test__}/index.test.js +2 -2
- package/es/dropdown/index.js +4 -73
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.js +2 -0
- package/es/ficon/index.js +23 -13
- package/es/form/index.js +171 -6
- package/es/form/{Item.js → item.js} +53 -53
- package/es/form/style/index.css +1 -1
- package/es/grid/index.js +37 -25
- package/es/icon/index.js +32 -21
- package/es/index.js +9 -61
- package/es/input/index.js +345 -28
- package/es/input/style/index.css +1 -1
- package/es/input/util.js +18 -26
- package/es/lib/withDragDropContext.js +2 -2
- package/es/loading/index.js +129 -5
- package/es/loading/style/index.css +0 -0
- package/es/loading/style/index.js +0 -0
- package/es/locales/en-US.js +11 -45
- package/es/locales/index.js +2 -16
- package/es/locales/zh-CN.js +12 -46
- package/es/menu/Item.js +41 -32
- package/es/menu/ItemGroup.js +81 -0
- package/es/menu/SubMenu.js +74 -55
- package/es/menu/Title.js +42 -36
- package/es/menu/index.js +419 -12
- package/es/menu/style/index.css +1 -1
- package/es/modal/__test__/index.test.js +123 -0
- package/es/modal/index.js +61 -77
- package/es/modal/style/index.css +1 -1
- package/es/nav-menu/NavMenu.js +45 -31
- package/es/nav-menu/__test__/index.test.js +2 -2
- package/es/nav-menu/index.js +2 -2
- package/es/notification/__test__/index.test.js +56 -0
- package/es/notification/index.js +231 -68
- package/es/notification/style/index.css +1 -1
- package/es/notification/style/index.js +0 -0
- package/es/pagination/Pager.js +8 -6
- package/es/pagination/Pagination.js +115 -124
- package/es/pagination/__test__/index.test.js +140 -0
- package/es/pagination/index.js +8 -9
- package/es/pagination/style/index.css +1 -1
- package/es/panel/index.js +33 -23
- package/es/popover/__test__/index.test.js +2 -2
- package/es/popover/index.js +69 -71
- package/es/popper/index.js +54 -64
- package/es/popper/style/index.css +1 -1
- package/es/progress/BarProgress.js +43 -109
- package/es/progress/CircleProgress.js +10 -9
- package/es/progress/DashboardProgress.js +9 -7
- package/es/progress/index.js +100 -8
- package/es/progress/style/index.css +1 -1
- package/es/radio/{radio-legacy/__test__ → __test__}/index.test.js +10 -10
- package/es/radio/index.js +216 -10
- package/es/radio/style/index.css +1 -1
- package/es/rate/Icons.js +2 -2
- package/es/rate/Rate.js +90 -65
- package/es/rate/__test__/index.test.js +54 -0
- package/es/rate/index.js +2 -5
- package/es/rate/style/index.css +1 -1
- package/es/select/Option.js +93 -0
- package/es/select/Select.js +253 -325
- package/es/select/SelectDropdown.js +63 -215
- package/es/select/SelectInput.js +54 -88
- package/es/select/__test__/index.test.js +429 -0
- package/es/select/index.js +4 -6
- package/es/select/style/select-dropdown.css +1 -1
- package/es/select/style/select-input.css +1 -1
- package/es/stepper/index.js +127 -21
- package/es/stepper/style/index.css +1 -1
- package/es/style/color/colors.css +0 -0
- package/es/style/icon/diyIcon.css +1 -1
- package/es/style/icon/index.css +1 -1
- 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/{__tests__ → __test__}/index.test.js +2 -31
- package/es/switch/index.js +36 -24
- package/es/switch/style/index.css +1 -1
- package/es/table/__test__/index.test.js +73 -0
- package/es/table/{Body.js → body.js} +52 -36
- package/es/table/checkbox/index.js +36 -33
- package/es/table/clickOuterside.js +115 -0
- package/es/table/{Footer.js → footer.js} +41 -24
- package/es/table/{Header.js → header.js} +54 -41
- package/es/table/index.js +300 -262
- package/es/table/menu/index.js +34 -32
- package/es/table/pover.js +154 -0
- 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/table/tableContent.js +120 -0
- package/es/tabs/ItemDropdown.js +51 -39
- package/es/tabs/TabPane.js +35 -25
- package/es/tabs/Tabs.js +91 -98
- package/es/tabs/index.js +3 -9
- package/es/tabs/style/index.css +1 -1
- package/es/timeline/__test__/index.test.js +49 -0
- package/es/timeline/foldingItem.js +82 -0
- package/es/timeline/index.js +127 -203
- package/es/timeline/style/index.css +1 -1
- package/es/tooltip/__test__/index.test.js +67 -0
- package/es/tooltip/index.js +39 -86
- package/es/tooltip/style/index.css +1 -1
- package/es/transfer/Item.js +44 -53
- package/es/transfer/__test__/index.test.js +11 -0
- package/es/transfer/index.js +443 -4
- package/es/transfer/style/index.css +1 -1
- package/es/tree/Tree.js +86 -76
- package/es/tree/TreeDivider.js +3 -3
- package/es/tree/TreeItem.js +108 -204
- package/es/tree/TreeNode.js +318 -457
- package/es/tree/index.js +2 -9
- package/es/tree/style/index.css +1 -1
- package/es/tree/util.js +257 -9
- package/es/upload/{upload-legacy/Preview.js → Preview.js} +39 -33
- package/es/upload/Upload.js +193 -289
- package/es/upload/UploadAvatar.js +58 -44
- package/es/upload/UploadClick.js +45 -49
- package/es/upload/UploadDrag.js +43 -44
- package/es/upload/UploadPhoto.js +55 -70
- package/es/upload/UploadPictureCard.js +44 -39
- package/es/upload/index.js +71 -8
- package/es/upload/style/index.css +1 -1
- package/es/upload/tool.js +1 -0
- package/package.json +4 -1
- package/es/_util/SwitchVersion.js +0 -44
- package/es/_util/depreactedPropsCompat.js +0 -58
- package/es/_util/index.js +0 -32
- package/es/alert/Alert.js +0 -134
- package/es/alert/__tests__/index.test.js +0 -88
- package/es/badge/Badge.js +0 -90
- package/es/badge/__tests__/index.test.js +0 -82
- package/es/breadcrumb/__tests__/index.test.js +0 -61
- package/es/breadcrumb/index.js +0 -93
- package/es/breadcrumb/style/index.css +0 -1
- package/es/button/__tests__/index.test.js +0 -219
- package/es/card/__tests__/index.test.js +0 -169
- package/es/carousel/__tests__/index.test.js +0 -104
- package/es/carousel/index.js +0 -227
- package/es/carousel/style/index.css +0 -1
- package/es/carousel/style/index.js +0 -3
- package/es/cascader/Menu.js +0 -174
- package/es/cascader/__tests__/index.test.js +0 -389
- package/es/checkbox/Checkbox.js +0 -144
- package/es/checkbox/Group.js +0 -202
- package/es/checkbox/__tests__/index.test.js +0 -226
- package/es/checkbox/checkbox-legacy/CheckBox.js +0 -165
- package/es/checkbox/checkbox-legacy/index.js +0 -15
- package/es/checkbox/checkbox-legacy/style/index.css +0 -1
- package/es/checkbox/checkbox-legacy/style/index.js +0 -3
- package/es/collapse/__tests__/index.test.js +0 -111
- package/es/counter/Counter.js +0 -343
- package/es/counter/__tests__/index.test.js +0 -134
- package/es/counter/counter-legacy/index.js +0 -271
- package/es/date-picker/TimeList.js +0 -254
- package/es/date-picker/YMRangePanel.js +0 -372
- package/es/date-picker/__tests__/index.test.js +0 -961
- package/es/date-picker/datepicker-legacy/BasePicker.js +0 -519
- package/es/date-picker/datepicker-legacy/Calender.js +0 -430
- package/es/date-picker/datepicker-legacy/DatePanel.js +0 -463
- package/es/date-picker/datepicker-legacy/DatePicker.js +0 -107
- package/es/date-picker/datepicker-legacy/DateRangePanel.js +0 -496
- package/es/date-picker/datepicker-legacy/Modal.js +0 -71
- package/es/date-picker/datepicker-legacy/Time.js +0 -413
- package/es/date-picker/datepicker-legacy/TimePanel.js +0 -93
- package/es/date-picker/datepicker-legacy/TimePeriodPanel.js +0 -126
- package/es/date-picker/datepicker-legacy/TimePicker.js +0 -82
- package/es/date-picker/datepicker-legacy/TimeRangePanel.js +0 -98
- package/es/date-picker/datepicker-legacy/Type.js +0 -31
- package/es/date-picker/datepicker-legacy/WeekRangePanel.js +0 -345
- package/es/date-picker/datepicker-legacy/constants.js +0 -79
- package/es/date-picker/datepicker-legacy/dateUtil.js +0 -258
- package/es/date-picker/datepicker-legacy/index.js +0 -15
- package/es/date-picker/datepicker-legacy/local.js +0 -11
- package/es/date-picker/datepicker-legacy/style/index.css +0 -1
- package/es/date-picker/datepicker-legacy/style/index.js +0 -3
- package/es/date-picker/datepicker-legacy/style/timepicker.css +0 -1
- package/es/date-picker/datepicker-legacy/util.js +0 -60
- package/es/date-picker/toLunar.js +0 -172
- package/es/dropdown/DropdownButton.js +0 -106
- package/es/dropdown/DropdownMenu.js +0 -111
- package/es/dropdown/DropdownMenuItem.js +0 -178
- package/es/dropdown/__tests__/index.test.js +0 -317
- package/es/dropdown/utils.js +0 -35
- package/es/form/Form.js +0 -184
- package/es/form/__tests__/index.test.js +0 -575
- package/es/grid/__tests__/index.test.js +0 -104
- package/es/input/Input.js +0 -412
- package/es/input/__tests__/index.test.js +0 -381
- package/es/input/input-legacy/index.js +0 -353
- package/es/input/input-legacy/util.js +0 -176
- package/es/loading/Loading.js +0 -181
- package/es/loading/__tests__/index.test.js +0 -110
- package/es/locales/zh-Hant-HK.js +0 -121
- package/es/locales/zh-Hant-TW.js +0 -123
- package/es/menu/Menu.js +0 -422
- package/es/menu/__tests__/index.test.js +0 -279
- package/es/message/__tests__/index.test.js +0 -75
- package/es/message/index.js +0 -58
- package/es/message/style/index.css +0 -1
- package/es/message/style/index.js +0 -5
- package/es/modal/__tests__/index.test.js +0 -178
- package/es/nav-menu/__tests__/index.test.js +0 -27
- package/es/notice/Notice.js +0 -142
- package/es/notice/NoticeContainer.js +0 -113
- package/es/notice/__tests__/index.test.js +0 -174
- package/es/notice/index.js +0 -66
- package/es/notice/style/index.css +0 -1
- package/es/notice/style/index.js +0 -5
- package/es/notification/HandleNotification/index.js +0 -224
- package/es/notification/HandleNotification/style/index.css +0 -1
- package/es/notification/HandleNotification/style/index.js +0 -5
- package/es/notification/__tests__/index.test.js +0 -118
- package/es/pagination/__tests__/index.test.js +0 -248
- package/es/popover/__tests__/index.test.js +0 -152
- package/es/preview/index.js +0 -527
- package/es/preview/style/index.css +0 -1
- package/es/preview/style/index.js +0 -3
- package/es/progress/Progress.js +0 -110
- package/es/progress/__tests__/index.test.js +0 -131
- package/es/radio/Group.js +0 -203
- package/es/radio/Radio.js +0 -151
- package/es/radio/__tests__/index.test.js +0 -128
- package/es/radio/radio-legacy/index.js +0 -222
- package/es/radio/radio-legacy/style/index.css +0 -1
- package/es/radio/radio-legacy/style/index.js +0 -3
- package/es/rate/__tests__/index.test.js +0 -124
- package/es/select/__tests__/index.test.js +0 -505
- package/es/select/select-legacy/Option.js +0 -81
- package/es/select/select-legacy/Select.js +0 -710
- package/es/select/select-legacy/SelectDropdown.js +0 -164
- package/es/select/select-legacy/SelectInput.js +0 -312
- package/es/select/select-legacy/common.js +0 -19
- package/es/select/select-legacy/index.js +0 -16
- package/es/stepper/Stepper.js +0 -151
- package/es/stepper/__tests__/index.test.js +0 -161
- package/es/table/ClickOuterside.js +0 -103
- package/es/table/TableContent.js +0 -109
- package/es/table/__tests__/index.test.js +0 -133
- package/es/table/checkbox/style/index.css +0 -1
- package/es/table/checkbox/style/index.js +0 -3
- package/es/tabs/__tests__/index.test.js +0 -333
- package/es/tabs/tabs-legacy/ItemDropdown.js +0 -170
- package/es/tabs/tabs-legacy/TabPane.js +0 -78
- package/es/tabs/tabs-legacy/Tabs.js +0 -299
- package/es/tabs/tabs-legacy/index.js +0 -18
- package/es/tabs/tabs-legacy/style/index.css +0 -1
- package/es/tabs/tabs-legacy/style/index.js +0 -3
- package/es/tag/__tests__/index.test.js +0 -46
- package/es/tag/index.js +0 -94
- package/es/tag/style/index.css +0 -1
- package/es/tag/style/index.js +0 -3
- package/es/timeline/__tests__/index.test.js +0 -198
- package/es/tooltip/__tests__/index.test.js +0 -170
- package/es/transfer/Transfer.js +0 -566
- package/es/transfer/__tests__/index.test.js +0 -210
- package/es/tree/IconLoading.js +0 -38
- package/es/tree/__tests__/index.test.js +0 -603
- package/es/tree/tree-legacy/Tree.js +0 -337
- package/es/tree/tree-legacy/TreeDivider.js +0 -25
- package/es/tree/tree-legacy/TreeItem.js +0 -333
- package/es/tree/tree-legacy/TreeNode.js +0 -719
- package/es/tree/tree-legacy/index.js +0 -13
- package/es/tree/tree-legacy/style/index.css +0 -1
- package/es/tree/tree-legacy/style/index.js +0 -3
- package/es/tree/tree-legacy/util.js +0 -434
- package/es/upload/__tests__/index.test.js +0 -760
- package/es/upload/main.js +0 -91
- package/es/upload/upload-legacy/Upload.js +0 -435
- package/es/upload/upload-legacy/UploadAvatar.js +0 -322
- package/es/upload/upload-legacy/UploadClick.js +0 -125
- package/es/upload/upload-legacy/UploadDrag.js +0 -180
- package/es/upload/upload-legacy/UploadPhoto.js +0 -183
- package/es/upload/upload-legacy/UploadPictureCard.js +0 -126
- package/es/upload/upload-legacy/index.js +0 -75
- package/es/upload/upload-legacy/style/index.css +0 -1
- package/es/upload/upload-legacy/style/index.js +0 -5
- package/es/upload/upload-legacy/tool.js +0 -84
- package/es/watermark/index.js +0 -101
- package/es/watermark/watermark.js +0 -252
- /package/es/checkbox/{checkbox-legacy/common.js → common.js} +0 -0
- /package/es/{breadcrumb/style → style}/index.js +0 -0
- /package/es/upload/{upload-legacy/style → style}/preview.css +0 -0
- /package/es/upload/{upload-legacy/style → style}/preview.js +0 -0
|
@@ -1,62 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports["default"] = void 0;
|
|
11
7
|
|
|
12
|
-
var
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
11
|
+
|
|
12
|
+
require("../icon/style");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _prefix = _interopRequireDefault(require("./prefix"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _footer = _interopRequireDefault(require("./footer"));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
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); }
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
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; }
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
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; }
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
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); }
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
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); } }
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
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); }
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
41
|
|
|
42
|
-
function
|
|
42
|
+
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); }; }
|
|
43
43
|
|
|
44
|
-
function
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
45
45
|
|
|
46
|
-
function
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
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; } }
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
53
|
|
|
48
54
|
// 点击后会展开的那个图标
|
|
49
55
|
var Expand = /*#__PURE__*/function (_Component) {
|
|
50
|
-
(
|
|
56
|
+
_inherits(Expand, _Component);
|
|
51
57
|
|
|
52
58
|
var _super = _createSuper(Expand);
|
|
53
59
|
|
|
54
60
|
function Expand(props) {
|
|
55
61
|
var _this;
|
|
56
62
|
|
|
57
|
-
(
|
|
63
|
+
_classCallCheck(this, Expand);
|
|
64
|
+
|
|
58
65
|
_this = _super.call(this, props);
|
|
59
|
-
|
|
66
|
+
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
60
68
|
var _this$props = _this.props,
|
|
61
69
|
addExpand = _this$props.addExpand,
|
|
62
70
|
colItem = _this$props.colItem,
|
|
@@ -64,13 +72,14 @@ var Expand = /*#__PURE__*/function (_Component) {
|
|
|
64
72
|
rowItem = _this$props.rowItem;
|
|
65
73
|
addExpand(e, rowItem, index, colItem);
|
|
66
74
|
});
|
|
75
|
+
|
|
67
76
|
_this.state = {
|
|
68
77
|
open: false
|
|
69
78
|
};
|
|
70
79
|
return _this;
|
|
71
80
|
}
|
|
72
81
|
|
|
73
|
-
(
|
|
82
|
+
_createClass(Expand, [{
|
|
74
83
|
key: "render",
|
|
75
84
|
value: function render() {
|
|
76
85
|
var rowItem = this.props.rowItem;
|
|
@@ -90,6 +99,7 @@ var Expand = /*#__PURE__*/function (_Component) {
|
|
|
90
99
|
}));
|
|
91
100
|
}
|
|
92
101
|
}]);
|
|
102
|
+
|
|
93
103
|
return Expand;
|
|
94
104
|
}(_react.Component);
|
|
95
105
|
|
|
@@ -98,14 +108,15 @@ var defaultRender = function defaultRender(text, record, index) {
|
|
|
98
108
|
};
|
|
99
109
|
|
|
100
110
|
var Row = /*#__PURE__*/function (_Component2) {
|
|
101
|
-
(
|
|
111
|
+
_inherits(Row, _Component2);
|
|
102
112
|
|
|
103
113
|
var _super2 = _createSuper(Row);
|
|
104
114
|
|
|
105
115
|
function Row(props) {
|
|
106
116
|
var _this2;
|
|
107
117
|
|
|
108
|
-
(
|
|
118
|
+
_classCallCheck(this, Row);
|
|
119
|
+
|
|
109
120
|
_this2 = _super2.call(this, props);
|
|
110
121
|
_this2.state = {
|
|
111
122
|
picked: false
|
|
@@ -113,17 +124,18 @@ var Row = /*#__PURE__*/function (_Component2) {
|
|
|
113
124
|
return _this2;
|
|
114
125
|
}
|
|
115
126
|
|
|
116
|
-
(
|
|
127
|
+
_createClass(Row, [{
|
|
117
128
|
key: "render",
|
|
118
129
|
value: function render() {
|
|
119
130
|
var _this$props2 = this.props,
|
|
131
|
+
selectedRowKeys = _this$props2.selectedRowKeys,
|
|
120
132
|
expand = _this$props2.expand,
|
|
121
133
|
k = _this$props2.k,
|
|
122
134
|
parent = _this$props2.parent,
|
|
123
135
|
highlightRows = _this$props2.highlightRows;
|
|
124
136
|
var classNames = {
|
|
125
137
|
'table-row': true,
|
|
126
|
-
picked: highlightRows.includes(k),
|
|
138
|
+
picked: selectedRowKeys.includes(k) || highlightRows.includes(k),
|
|
127
139
|
expand: expand,
|
|
128
140
|
test: 't'
|
|
129
141
|
};
|
|
@@ -148,18 +160,20 @@ var Row = /*#__PURE__*/function (_Component2) {
|
|
|
148
160
|
}, this.props.children);
|
|
149
161
|
}
|
|
150
162
|
}]);
|
|
163
|
+
|
|
151
164
|
return Row;
|
|
152
165
|
}(_react.Component);
|
|
153
166
|
|
|
154
167
|
var Body = /*#__PURE__*/function (_Component3) {
|
|
155
|
-
(
|
|
168
|
+
_inherits(Body, _Component3);
|
|
156
169
|
|
|
157
170
|
var _super3 = _createSuper(Body);
|
|
158
171
|
|
|
159
172
|
function Body(props) {
|
|
160
173
|
var _this3;
|
|
161
174
|
|
|
162
|
-
(
|
|
175
|
+
_classCallCheck(this, Body);
|
|
176
|
+
|
|
163
177
|
_this3 = _super3.call(this, props);
|
|
164
178
|
_this3.state = {
|
|
165
179
|
pickedRows: []
|
|
@@ -167,7 +181,7 @@ var Body = /*#__PURE__*/function (_Component3) {
|
|
|
167
181
|
return _this3;
|
|
168
182
|
}
|
|
169
183
|
|
|
170
|
-
(
|
|
184
|
+
_createClass(Body, [{
|
|
171
185
|
key: "render",
|
|
172
186
|
value: function render() {
|
|
173
187
|
var _this$props3 = this.props,
|
|
@@ -178,7 +192,8 @@ var Body = /*#__PURE__*/function (_Component3) {
|
|
|
178
192
|
rowSelection = _this$props3$rowSelec === void 0 ? {} : _this$props3$rowSelec,
|
|
179
193
|
highlightCols = _this$props3.highlightCols,
|
|
180
194
|
advance = _this$props3.advance,
|
|
181
|
-
rest = (
|
|
195
|
+
rest = _objectWithoutProperties(_this$props3, ["columns", "dataSource", "cbs", "rowSelection", "highlightCols", "advance"]);
|
|
196
|
+
|
|
182
197
|
columns = columns.filter(function (item) {
|
|
183
198
|
return !item.hide;
|
|
184
199
|
});
|
|
@@ -264,7 +279,7 @@ var Body = /*#__PURE__*/function (_Component3) {
|
|
|
264
279
|
i++; // 动态插入的组件不累加
|
|
265
280
|
}
|
|
266
281
|
|
|
267
|
-
return /*#__PURE__*/_react["default"].createElement(Row, (
|
|
282
|
+
return /*#__PURE__*/_react["default"].createElement(Row, _extends({
|
|
268
283
|
selectedRowKeys: selectedRowKeys,
|
|
269
284
|
k: item.key || k,
|
|
270
285
|
expand: item.expand,
|
|
@@ -273,7 +288,7 @@ var Body = /*#__PURE__*/function (_Component3) {
|
|
|
273
288
|
});
|
|
274
289
|
return /*#__PURE__*/_react["default"].createElement("tbody", {
|
|
275
290
|
className: (0, _prefix["default"])('table-tbody')
|
|
276
|
-
}, advance && advance.prefix && this.getPrefixNodes(), nodes, /*#__PURE__*/_react["default"].createElement(
|
|
291
|
+
}, advance && advance.prefix && this.getPrefixNodes(), nodes, /*#__PURE__*/_react["default"].createElement(_footer["default"], _extends({
|
|
277
292
|
className: 'table-footer'
|
|
278
293
|
}, this.props)));
|
|
279
294
|
}
|
|
@@ -296,6 +311,7 @@ var Body = /*#__PURE__*/function (_Component3) {
|
|
|
296
311
|
});
|
|
297
312
|
}
|
|
298
313
|
}]);
|
|
314
|
+
|
|
299
315
|
return Body;
|
|
300
316
|
}(_react.Component);
|
|
301
317
|
|
|
@@ -1,51 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports["default"] = void 0;
|
|
11
7
|
|
|
12
|
-
var
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
9
|
|
|
14
|
-
var
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
require("../../checkbox/style");
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
17
|
|
|
22
|
-
var
|
|
18
|
+
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; }
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
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); } }
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
29
27
|
|
|
30
|
-
function
|
|
28
|
+
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); }
|
|
31
29
|
|
|
32
|
-
function
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
31
|
|
|
34
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (
|
|
32
|
+
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); }; }
|
|
35
33
|
|
|
36
|
-
function
|
|
34
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
35
|
+
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
|
|
38
|
+
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; } }
|
|
39
|
+
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
41
|
|
|
38
42
|
var Checkbox = /*#__PURE__*/function (_Component) {
|
|
39
|
-
(
|
|
43
|
+
_inherits(Checkbox, _Component);
|
|
40
44
|
|
|
41
45
|
var _super = _createSuper(Checkbox);
|
|
42
46
|
|
|
43
47
|
function Checkbox() {
|
|
44
|
-
(
|
|
48
|
+
_classCallCheck(this, Checkbox);
|
|
49
|
+
|
|
45
50
|
return _super.apply(this, arguments);
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
(
|
|
53
|
+
_createClass(Checkbox, [{
|
|
49
54
|
key: "render",
|
|
50
55
|
value: function render() {
|
|
51
56
|
var _this$props = this.props,
|
|
@@ -57,8 +62,7 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
57
62
|
_this$props$semi = _this$props.semi,
|
|
58
63
|
semi = _this$props$semi === void 0 ? false : _this$props$semi,
|
|
59
64
|
onTitleClick = _this$props.onTitleClick,
|
|
60
|
-
highlight = _this$props.highlight
|
|
61
|
-
theme = _this$props.theme;
|
|
65
|
+
highlight = _this$props.highlight;
|
|
62
66
|
|
|
63
67
|
if (semi) {
|
|
64
68
|
checked = false;
|
|
@@ -66,7 +70,7 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
66
70
|
|
|
67
71
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
72
|
style: {
|
|
69
|
-
position: 'relative'
|
|
73
|
+
'position': 'relative'
|
|
70
74
|
},
|
|
71
75
|
onClick: function onClick(e) {
|
|
72
76
|
if (disabled) {
|
|
@@ -75,17 +79,17 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
75
79
|
|
|
76
80
|
onChange(e, !checked);
|
|
77
81
|
},
|
|
78
|
-
className: (0, _classnames["default"])(
|
|
79
|
-
'hi-checkbox
|
|
80
|
-
'hi-checkbox
|
|
81
|
-
'hi-checkbox
|
|
82
|
-
'hi-checkbox
|
|
82
|
+
className: (0, _classnames["default"])({
|
|
83
|
+
'hi-checkbox': true,
|
|
84
|
+
'hi-checkbox--part': semi,
|
|
85
|
+
'hi-checkbox--checked': checked,
|
|
86
|
+
'hi-checkbox--disabled': disabled
|
|
83
87
|
})
|
|
84
88
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
85
|
-
className: "hi-
|
|
89
|
+
className: "hi-checkbox__input"
|
|
86
90
|
}), text && /*#__PURE__*/_react["default"].createElement("span", {
|
|
87
91
|
className: (0, _classnames["default"])({
|
|
88
|
-
'hi-
|
|
92
|
+
'hi-checkbox__label': true,
|
|
89
93
|
highlight: highlight
|
|
90
94
|
}),
|
|
91
95
|
onClick: function onClick(e) {
|
|
@@ -94,9 +98,8 @@ var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
94
98
|
}, text));
|
|
95
99
|
}
|
|
96
100
|
}]);
|
|
101
|
+
|
|
97
102
|
return Checkbox;
|
|
98
103
|
}(_react.Component);
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
exports["default"] = _default;
|
|
105
|
+
exports["default"] = Checkbox;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
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); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
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; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
|
+
|
|
48
|
+
var ClickOutside = /*#__PURE__*/function (_Component) {
|
|
49
|
+
_inherits(ClickOutside, _Component);
|
|
50
|
+
|
|
51
|
+
var _super = _createSuper(ClickOutside);
|
|
52
|
+
|
|
53
|
+
function ClickOutside(props) {
|
|
54
|
+
var _this;
|
|
55
|
+
|
|
56
|
+
_classCallCheck(this, ClickOutside);
|
|
57
|
+
|
|
58
|
+
_this = _super.call(this, props);
|
|
59
|
+
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "handle", function (e) {
|
|
61
|
+
var onClickOutside = _this.props.onClickOutside;
|
|
62
|
+
if (e.type === 'touchend') _this.isTouch = true;
|
|
63
|
+
if (e.type === 'click' && _this.isTouch) return;
|
|
64
|
+
var el = _this.container;
|
|
65
|
+
|
|
66
|
+
if (el && !el.contains(e.target)) {
|
|
67
|
+
onClickOutside(e);
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
_this.getContainer = _this.getContainer.bind(_assertThisInitialized(_this));
|
|
73
|
+
_this.isTouch = false;
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_createClass(ClickOutside, [{
|
|
78
|
+
key: "getContainer",
|
|
79
|
+
value: function getContainer(ref) {
|
|
80
|
+
this.container = ref;
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "render",
|
|
84
|
+
value: function render() {
|
|
85
|
+
var _this$props = this.props,
|
|
86
|
+
children = _this$props.children,
|
|
87
|
+
onClickOutside = _this$props.onClickOutside,
|
|
88
|
+
props = _objectWithoutProperties(_this$props, ["children", "onClickOutside"]);
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({}, props, {
|
|
91
|
+
ref: this.getContainer
|
|
92
|
+
}), children);
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "componentDidMount",
|
|
96
|
+
value: function componentDidMount() {
|
|
97
|
+
document.addEventListener('touchend', this.handle, true);
|
|
98
|
+
document.addEventListener('click', this.handle, true);
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "componentWillUnmount",
|
|
102
|
+
value: function componentWillUnmount() {
|
|
103
|
+
document.removeEventListener('touchend', this.handle, true);
|
|
104
|
+
document.removeEventListener('click', this.handle, true);
|
|
105
|
+
}
|
|
106
|
+
}]);
|
|
107
|
+
|
|
108
|
+
return ClickOutside;
|
|
109
|
+
}(_react.Component);
|
|
110
|
+
|
|
111
|
+
exports["default"] = ClickOutside;
|
|
112
|
+
|
|
113
|
+
_defineProperty(ClickOutside, "propTypes", {
|
|
114
|
+
onClickOutside: _propTypes["default"].func.isRequired
|
|
115
|
+
});
|
|
@@ -1,51 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports["default"] = void 0;
|
|
11
7
|
|
|
12
|
-
var
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _prefix = _interopRequireDefault(require("./prefix"));
|
|
11
|
+
|
|
12
|
+
var _decimal = require("decimal.js");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
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; }
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
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); }
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
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."); }
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
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); }
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
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; }
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
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); } }
|
|
37
|
+
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
+
|
|
44
|
+
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); }; }
|
|
45
|
+
|
|
46
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
47
|
+
|
|
48
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
|
+
|
|
50
|
+
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; } }
|
|
51
|
+
|
|
52
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
53
|
|
|
38
54
|
var Footer = /*#__PURE__*/function (_Component) {
|
|
39
|
-
(
|
|
55
|
+
_inherits(Footer, _Component);
|
|
40
56
|
|
|
41
57
|
var _super = _createSuper(Footer);
|
|
42
58
|
|
|
43
59
|
function Footer() {
|
|
44
|
-
(
|
|
60
|
+
_classCallCheck(this, Footer);
|
|
61
|
+
|
|
45
62
|
return _super.apply(this, arguments);
|
|
46
63
|
}
|
|
47
64
|
|
|
48
|
-
(
|
|
65
|
+
_createClass(Footer, [{
|
|
49
66
|
key: "getSum",
|
|
50
67
|
value: function getSum(item) {
|
|
51
68
|
var _this$props = this.props,
|
|
@@ -56,7 +73,7 @@ var Footer = /*#__PURE__*/function (_Component) {
|
|
|
56
73
|
suffix = _this$props$advance$s === void 0 ? [] : _this$props$advance$s,
|
|
57
74
|
_this$props$advance$p = _this$props$advance.prefix,
|
|
58
75
|
prefix = _this$props$advance$p === void 0 ? [] : _this$props$advance$p;
|
|
59
|
-
var res = [].concat((
|
|
76
|
+
var res = [].concat(_toConsumableArray(prefix), _toConsumableArray(dataSource), _toConsumableArray(suffix)).map(function (data) {
|
|
60
77
|
return data[item.dataIndex];
|
|
61
78
|
});
|
|
62
79
|
var total = new _decimal.Decimal(0);
|
|
@@ -108,7 +125,7 @@ var Footer = /*#__PURE__*/function (_Component) {
|
|
|
108
125
|
suffix = _this$props2$advance$ === void 0 ? [] : _this$props2$advance$,
|
|
109
126
|
_this$props2$advance$2 = _this$props2$advance.prefix,
|
|
110
127
|
prefix = _this$props2$advance$2 === void 0 ? [] : _this$props2$advance$2;
|
|
111
|
-
var data = [].concat((
|
|
128
|
+
var data = [].concat(_toConsumableArray(prefix), _toConsumableArray(dataSource), _toConsumableArray(suffix));
|
|
112
129
|
return new _decimal.Decimal(this.getSum(item)).dividedBy(data.length).toFixed(2).valueOf() * 1;
|
|
113
130
|
}
|
|
114
131
|
}, {
|
|
@@ -116,7 +133,6 @@ var Footer = /*#__PURE__*/function (_Component) {
|
|
|
116
133
|
value: function getAveNodes() {
|
|
117
134
|
var _this2 = this;
|
|
118
135
|
|
|
119
|
-
var localeDatas = this.props.localeDatas;
|
|
120
136
|
var columns = this.props.columns;
|
|
121
137
|
var tds = columns.map(function (item, index) {
|
|
122
138
|
var key = 'ave-' + index;
|
|
@@ -131,7 +147,7 @@ var Footer = /*#__PURE__*/function (_Component) {
|
|
|
131
147
|
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
132
148
|
className: (0, _prefix["default"])('table-col'),
|
|
133
149
|
key: key
|
|
134
|
-
},
|
|
150
|
+
}, "\u5747\u503C");
|
|
135
151
|
}
|
|
136
152
|
|
|
137
153
|
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
@@ -172,6 +188,7 @@ var Footer = /*#__PURE__*/function (_Component) {
|
|
|
172
188
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, advance && advance.suffix && this.getSuffixNodes(), dataSource.length > 0 && advance && advance.sum && this.getSumNodes(), dataSource.length > 0 && advance && advance.avg && this.getAveNodes());
|
|
173
189
|
}
|
|
174
190
|
}]);
|
|
191
|
+
|
|
175
192
|
return Footer;
|
|
176
193
|
}(_react.Component);
|
|
177
194
|
|