@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/header.js
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
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 _prefix = _interopRequireDefault(require("./prefix"));
|
|
11
|
-
|
|
12
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
13
|
-
|
|
14
|
-
var _menu = _interopRequireDefault(require("./menu"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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); }
|
|
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 Sorter = /*#__PURE__*/function (_Component) {
|
|
49
|
-
_inherits(Sorter, _Component);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(Sorter);
|
|
52
|
-
|
|
53
|
-
function Sorter() {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
_classCallCheck(this, Sorter);
|
|
57
|
-
|
|
58
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
-
args[_key] = arguments[_key];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
|
-
|
|
64
|
-
_defineProperty(_assertThisInitialized(_this), "reversed", false);
|
|
65
|
-
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "sortAsec", function () {
|
|
67
|
-
var _this$props = _this.props,
|
|
68
|
-
index = _this$props.index,
|
|
69
|
-
columns = _this$props.columns,
|
|
70
|
-
kname = _this$props.kname,
|
|
71
|
-
name = _this$props.name;
|
|
72
|
-
var sorter = columns[index].sorter;
|
|
73
|
-
var _this$props2 = _this.props,
|
|
74
|
-
resetData = _this$props2.cbs.resetData,
|
|
75
|
-
dataSource = _this$props2.dataSource;
|
|
76
|
-
dataSource.sort(sorter);
|
|
77
|
-
resetData(dataSource);
|
|
78
|
-
_this.reversed = false;
|
|
79
|
-
window.localStorage.setItem(name + '-sorter', [kname, 0]);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "sortDsec", function () {
|
|
83
|
-
var _this$props3 = _this.props,
|
|
84
|
-
index = _this$props3.index,
|
|
85
|
-
columns = _this$props3.columns,
|
|
86
|
-
name = _this$props3.name,
|
|
87
|
-
kname = _this$props3.kname;
|
|
88
|
-
var sorter = columns[index].sorter;
|
|
89
|
-
var _this$props4 = _this.props,
|
|
90
|
-
resetData = _this$props4.cbs.resetData,
|
|
91
|
-
dataSource = _this$props4.dataSource;
|
|
92
|
-
dataSource.sort(sorter);
|
|
93
|
-
dataSource.reverse();
|
|
94
|
-
resetData(dataSource);
|
|
95
|
-
_this.reversed = true;
|
|
96
|
-
window.localStorage.setItem(name + '-sorter', [kname, 1]);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
return _this;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
_createClass(Sorter, [{
|
|
103
|
-
key: "render",
|
|
104
|
-
value: function render() {
|
|
105
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
|
-
style: {
|
|
107
|
-
display: 'block',
|
|
108
|
-
height: '12px',
|
|
109
|
-
lineHeight: '12px'
|
|
110
|
-
}
|
|
111
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
112
|
-
name: 'up',
|
|
113
|
-
onClick: this.sortAsec,
|
|
114
|
-
style: {
|
|
115
|
-
fontSize: '12px'
|
|
116
|
-
}
|
|
117
|
-
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
118
|
-
style: {
|
|
119
|
-
display: 'block',
|
|
120
|
-
height: '12px',
|
|
121
|
-
lineHeight: '12px'
|
|
122
|
-
}
|
|
123
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
124
|
-
name: 'down',
|
|
125
|
-
onClick: this.sortDsec,
|
|
126
|
-
style: {
|
|
127
|
-
fontSize: '12px'
|
|
128
|
-
}
|
|
129
|
-
})));
|
|
130
|
-
}
|
|
131
|
-
}]);
|
|
132
|
-
|
|
133
|
-
return Sorter;
|
|
134
|
-
}(_react.Component);
|
|
135
|
-
|
|
136
|
-
var ServerSorter = /*#__PURE__*/function (_Component2) {
|
|
137
|
-
_inherits(ServerSorter, _Component2);
|
|
138
|
-
|
|
139
|
-
var _super2 = _createSuper(ServerSorter);
|
|
140
|
-
|
|
141
|
-
function ServerSorter() {
|
|
142
|
-
_classCallCheck(this, ServerSorter);
|
|
143
|
-
|
|
144
|
-
return _super2.apply(this, arguments);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
_createClass(ServerSorter, [{
|
|
148
|
-
key: "render",
|
|
149
|
-
value: function render() {
|
|
150
|
-
var _this2 = this;
|
|
151
|
-
|
|
152
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
153
|
-
style: {
|
|
154
|
-
display: 'block',
|
|
155
|
-
height: '12px',
|
|
156
|
-
lineHeight: '12px'
|
|
157
|
-
}
|
|
158
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
159
|
-
name: 'up',
|
|
160
|
-
onClick: function onClick(e) {
|
|
161
|
-
var _this2$props = _this2.props,
|
|
162
|
-
serverSort = _this2$props.item.serverSort,
|
|
163
|
-
fetch = _this2$props.fetch;
|
|
164
|
-
fetch(serverSort[0]);
|
|
165
|
-
},
|
|
166
|
-
style: {
|
|
167
|
-
fontSize: '12px'
|
|
168
|
-
}
|
|
169
|
-
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
170
|
-
style: {
|
|
171
|
-
display: 'block',
|
|
172
|
-
height: '12px',
|
|
173
|
-
lineHeight: '12px'
|
|
174
|
-
}
|
|
175
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
176
|
-
name: 'down',
|
|
177
|
-
onClick: function onClick(e) {
|
|
178
|
-
var _this2$props2 = _this2.props,
|
|
179
|
-
serverSort = _this2$props2.item.serverSort,
|
|
180
|
-
fetch = _this2$props2.fetch;
|
|
181
|
-
fetch(serverSort[1]);
|
|
182
|
-
},
|
|
183
|
-
style: {
|
|
184
|
-
fontSize: '12px'
|
|
185
|
-
}
|
|
186
|
-
})));
|
|
187
|
-
}
|
|
188
|
-
}]);
|
|
189
|
-
|
|
190
|
-
return ServerSorter;
|
|
191
|
-
}(_react.Component);
|
|
192
|
-
|
|
193
|
-
var HeaderCell = function HeaderCell(props) {
|
|
194
|
-
var item = props.item,
|
|
195
|
-
index = props.index,
|
|
196
|
-
contextMenu = props.contextMenu;
|
|
197
|
-
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
198
|
-
colSpan: item.colSpan || 1,
|
|
199
|
-
key: 'head-' + item.key || item.dataIndex || item.title,
|
|
200
|
-
onContextMenu: function onContextMenu(e) {
|
|
201
|
-
return contextMenu(e, item.key);
|
|
202
|
-
}
|
|
203
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
204
|
-
style: {
|
|
205
|
-
display: 'flex',
|
|
206
|
-
alignItems: 'center'
|
|
207
|
-
}
|
|
208
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, typeof item.title === 'function' ? item.title() : item.title), "\xA0", item.sorter && /*#__PURE__*/_react["default"].createElement(Sorter, _extends({}, props, {
|
|
209
|
-
key: item.key,
|
|
210
|
-
index: index,
|
|
211
|
-
kname: item.key
|
|
212
|
-
})), item.serverSort && /*#__PURE__*/_react["default"].createElement(ServerSorter, _extends({}, props, {
|
|
213
|
-
key: item.key,
|
|
214
|
-
index: index,
|
|
215
|
-
kname: item.key
|
|
216
|
-
}))));
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
var GroupCell = function GroupCell(props) {
|
|
220
|
-
var item = props.item,
|
|
221
|
-
index = props.index,
|
|
222
|
-
contextMenu = props.contextMenu;
|
|
223
|
-
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
224
|
-
colSpan: item.headColSpan,
|
|
225
|
-
rowSpan: item.headRowSpan,
|
|
226
|
-
key: 'head-' + item.key || item.dataIndex || item.title,
|
|
227
|
-
onContextMenu: function onContextMenu(e) {
|
|
228
|
-
return contextMenu(e, item.key);
|
|
229
|
-
}
|
|
230
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
231
|
-
style: {
|
|
232
|
-
display: 'flex',
|
|
233
|
-
alignItems: 'center'
|
|
234
|
-
}
|
|
235
|
-
}, "\xA0", /*#__PURE__*/_react["default"].createElement("div", null, item.title), item.sorter && /*#__PURE__*/_react["default"].createElement(Sorter, _extends({}, props, {
|
|
236
|
-
col: item,
|
|
237
|
-
index: index,
|
|
238
|
-
kname: item.key
|
|
239
|
-
})), item.serverSort && 'sirt'));
|
|
240
|
-
}; // 普通的表头
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
var Header = /*#__PURE__*/function (_Component3) {
|
|
244
|
-
_inherits(Header, _Component3);
|
|
245
|
-
|
|
246
|
-
var _super3 = _createSuper(Header);
|
|
247
|
-
|
|
248
|
-
function Header() {
|
|
249
|
-
var _this3;
|
|
250
|
-
|
|
251
|
-
_classCallCheck(this, Header);
|
|
252
|
-
|
|
253
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
254
|
-
args[_key2] = arguments[_key2];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
_this3 = _super3.call.apply(_super3, [this].concat(args));
|
|
258
|
-
|
|
259
|
-
_defineProperty(_assertThisInitialized(_this3), "contextMenu", function (e, key) {
|
|
260
|
-
e.preventDefault();
|
|
261
|
-
var _this3$props = _this3.props,
|
|
262
|
-
cbs = _this3$props.cbs,
|
|
263
|
-
scrollWidth = _this3$props.scrollWidth,
|
|
264
|
-
_this3$props$scrollX = _this3$props.scrollX,
|
|
265
|
-
scrollX = _this3$props$scrollX === void 0 ? false : _this3$props$scrollX,
|
|
266
|
-
_this3$props$scroll = _this3$props.scroll,
|
|
267
|
-
scroll = _this3$props$scroll === void 0 ? false : _this3$props$scroll,
|
|
268
|
-
size = _this3$props.size,
|
|
269
|
-
origin = _this3$props.origin;
|
|
270
|
-
var sc = scrollWidth || scrollX || scroll && scroll.x;
|
|
271
|
-
|
|
272
|
-
if (origin && origin.url) {
|
|
273
|
-
sc = false;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
_menu["default"].show(e, cbs, key, !!sc, size);
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
return _this3;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
_createClass(Header, [{
|
|
283
|
-
key: "render",
|
|
284
|
-
value: function render() {
|
|
285
|
-
var _this4 = this;
|
|
286
|
-
|
|
287
|
-
var _this$props5 = this.props,
|
|
288
|
-
columns = _this$props5.columns,
|
|
289
|
-
headerColumns = _this$props5.headerColumns; // 表头可以传组件,如果是文本就渲染文本
|
|
290
|
-
|
|
291
|
-
var nodes = []; // 固定表头分组,这里好难。。
|
|
292
|
-
|
|
293
|
-
if (headerColumns && headerColumns.length > 1) {
|
|
294
|
-
nodes = headerColumns.map(function (columns, k) {
|
|
295
|
-
var tr = [];
|
|
296
|
-
columns = columns.filter(function (item) {
|
|
297
|
-
return !item.hide;
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
for (var i = 0; i < columns.length; i++) {
|
|
301
|
-
tr.push( /*#__PURE__*/_react["default"].createElement(GroupCell, _extends({}, _this4.props, {
|
|
302
|
-
item: columns[i],
|
|
303
|
-
index: i,
|
|
304
|
-
contextMenu: _this4.contextMenu,
|
|
305
|
-
key: columns[i].key
|
|
306
|
-
})));
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return /*#__PURE__*/_react["default"].createElement("tr", {
|
|
310
|
-
key: k
|
|
311
|
-
}, tr);
|
|
312
|
-
});
|
|
313
|
-
} else {
|
|
314
|
-
for (var i = 0; i < columns.length;) {
|
|
315
|
-
var colSpan = columns[i].colSpan || 1;
|
|
316
|
-
nodes.push( /*#__PURE__*/_react["default"].createElement(HeaderCell, _extends({}, this.props, {
|
|
317
|
-
item: columns[i],
|
|
318
|
-
index: i,
|
|
319
|
-
contextMenu: this.contextMenu,
|
|
320
|
-
key: columns[i].key
|
|
321
|
-
})));
|
|
322
|
-
i = i + colSpan;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
nodes = /*#__PURE__*/_react["default"].createElement("tr", null, nodes);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return /*#__PURE__*/_react["default"].createElement("thead", {
|
|
329
|
-
className: (0, _prefix["default"])('table-thead')
|
|
330
|
-
}, nodes);
|
|
331
|
-
}
|
|
332
|
-
}]);
|
|
333
|
-
|
|
334
|
-
return Header;
|
|
335
|
-
}(_react.Component);
|
|
336
|
-
|
|
337
|
-
exports["default"] = Header;
|
package/es/table/pover.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
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 _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
|
-
|
|
12
|
-
require("./pover.css");
|
|
13
|
-
|
|
14
|
-
var _tool = require("./tool");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
|
-
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
|
-
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
29
|
-
|
|
30
|
-
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
|
-
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
|
-
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
|
-
|
|
36
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
38
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
|
-
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; } }
|
|
41
|
-
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
var Pover = /*#__PURE__*/function (_Component) {
|
|
47
|
-
_inherits(Pover, _Component);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(Pover);
|
|
50
|
-
|
|
51
|
-
function Pover() {
|
|
52
|
-
var _this;
|
|
53
|
-
|
|
54
|
-
_classCallCheck(this, Pover);
|
|
55
|
-
|
|
56
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
-
args[_key] = arguments[_key];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
61
|
-
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
63
|
-
value: ''
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
_createClass(Pover, [{
|
|
70
|
-
key: "render",
|
|
71
|
-
value: function render() {
|
|
72
|
-
var _this2 = this;
|
|
73
|
-
|
|
74
|
-
var _this$props = this.props,
|
|
75
|
-
slot = _this$props.slot,
|
|
76
|
-
remove = _this$props.remove,
|
|
77
|
-
onOk = _this$props.onOk,
|
|
78
|
-
action = _this$props.action;
|
|
79
|
-
var value = this.state.value;
|
|
80
|
-
var form = null;
|
|
81
|
-
|
|
82
|
-
switch (action) {
|
|
83
|
-
case 'input':
|
|
84
|
-
form = /*#__PURE__*/_react["default"].createElement("input", {
|
|
85
|
-
value: value,
|
|
86
|
-
onChange: function onChange(e) {
|
|
87
|
-
return _this2.setState({
|
|
88
|
-
value: e.target.value
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
case 'select':
|
|
95
|
-
form = /*#__PURE__*/_react["default"].createElement("select", null, /*#__PURE__*/_react["default"].createElement("option", {
|
|
96
|
-
value: '小孩'
|
|
97
|
-
}, "\u5C0F\u5B69"), /*#__PURE__*/_react["default"].createElement("option", {
|
|
98
|
-
value: '青年'
|
|
99
|
-
}, "\u9752\u5E74"), /*#__PURE__*/_react["default"].createElement("option", {
|
|
100
|
-
value: '老年'
|
|
101
|
-
}, "\u8001\u5E74"));
|
|
102
|
-
break;
|
|
103
|
-
|
|
104
|
-
default:
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
109
|
-
className: 'title'
|
|
110
|
-
}, slot), /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
|
-
className: 'form'
|
|
112
|
-
}, form), /*#__PURE__*/_react["default"].createElement("div", {
|
|
113
|
-
className: 'pover-action'
|
|
114
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
115
|
-
onClick: remove
|
|
116
|
-
}, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
117
|
-
onClick: function onClick() {
|
|
118
|
-
onOk(value);
|
|
119
|
-
remove();
|
|
120
|
-
}
|
|
121
|
-
}, "\u786E\u5B9A")));
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
|
|
125
|
-
return Pover;
|
|
126
|
-
}(_react.Component);
|
|
127
|
-
|
|
128
|
-
var _default = function _default(_ref) {
|
|
129
|
-
var target = _ref.target,
|
|
130
|
-
title = _ref.title,
|
|
131
|
-
onOk = _ref.onOk,
|
|
132
|
-
_ref$action = _ref.action,
|
|
133
|
-
action = _ref$action === void 0 ? false : _ref$action;
|
|
134
|
-
target.parentNode.style.position = 'relative';
|
|
135
|
-
var div = document.createElement('div');
|
|
136
|
-
div.className = 'pover';
|
|
137
|
-
div.style.position = 'absolute';
|
|
138
|
-
(0, _tool.insertAfter)(div, target);
|
|
139
|
-
|
|
140
|
-
var remove = function remove() {
|
|
141
|
-
_reactDom["default"].unmountComponentAtNode(div);
|
|
142
|
-
|
|
143
|
-
target.parentNode.removeChild(div);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(Pover, {
|
|
147
|
-
slot: title,
|
|
148
|
-
remove: remove,
|
|
149
|
-
onOk: onOk,
|
|
150
|
-
action: action
|
|
151
|
-
}), div);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
exports["default"] = _default;
|
package/es/table/tableContent.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
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 _body = _interopRequireDefault(require("./body"));
|
|
11
|
-
|
|
12
|
-
var _header = _interopRequireDefault(require("./header"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
|
-
|
|
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
|
-
|
|
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 _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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
-
|
|
30
|
-
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); } }
|
|
31
|
-
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
33
|
-
|
|
34
|
-
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); }
|
|
35
|
-
|
|
36
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
|
-
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); }; }
|
|
39
|
-
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
41
|
-
|
|
42
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
|
-
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; } }
|
|
45
|
-
|
|
46
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
|
-
var TableContent = /*#__PURE__*/function (_Component) {
|
|
49
|
-
_inherits(TableContent, _Component);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(TableContent);
|
|
52
|
-
|
|
53
|
-
function TableContent(props) {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
_classCallCheck(this, TableContent);
|
|
57
|
-
|
|
58
|
-
_this = _super.call(this, props);
|
|
59
|
-
_this.dom = /*#__PURE__*/_react["default"].createRef();
|
|
60
|
-
return _this;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
_createClass(TableContent, [{
|
|
64
|
-
key: "render",
|
|
65
|
-
value: function render() {
|
|
66
|
-
var _this$props = this.props,
|
|
67
|
-
columns = _this$props.columns,
|
|
68
|
-
className = _this$props.className,
|
|
69
|
-
style = _this$props.style,
|
|
70
|
-
_this$props$head = _this$props.head,
|
|
71
|
-
head = _this$props$head === void 0 ? true : _this$props$head,
|
|
72
|
-
_this$props$body = _this$props.body,
|
|
73
|
-
body = _this$props$body === void 0 ? true : _this$props$body,
|
|
74
|
-
parent = _this$props.parent,
|
|
75
|
-
rest = _objectWithoutProperties(_this$props, ["columns", "className", "style", "head", "body", "parent"]);
|
|
76
|
-
|
|
77
|
-
rest.columns = columns;
|
|
78
|
-
var showColumns = rest.columns.filter(function (item) {
|
|
79
|
-
return !item.hide;
|
|
80
|
-
});
|
|
81
|
-
var showHeaderColumns = rest.headerColumns.filter(function (item) {
|
|
82
|
-
return !item.hide;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
if (rest.headerColumns.length > 1 && parent.setting && parent.setting.current) {
|
|
86
|
-
parent.setting.current.style.display = 'none';
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
90
|
-
className: className,
|
|
91
|
-
style: style,
|
|
92
|
-
ref: this.dom
|
|
93
|
-
}, /*#__PURE__*/_react["default"].createElement("colgroup", null, showColumns.map(function (item, index) {
|
|
94
|
-
var sty = {};
|
|
95
|
-
|
|
96
|
-
if (item.width) {
|
|
97
|
-
sty.minWidth = parseInt(item.width) + 'px';
|
|
98
|
-
sty.width = parseInt(item.width) + 'px';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return /*#__PURE__*/_react["default"].createElement("col", {
|
|
102
|
-
style: sty,
|
|
103
|
-
key: 'col-' + index
|
|
104
|
-
});
|
|
105
|
-
})), head ? /*#__PURE__*/_react["default"].createElement(_header["default"], _extends({}, rest, {
|
|
106
|
-
columns: showColumns,
|
|
107
|
-
showHeaderColumns: showHeaderColumns,
|
|
108
|
-
parent: parent
|
|
109
|
-
})) : null, body ? /*#__PURE__*/_react["default"].createElement(_body["default"], _extends({}, rest, {
|
|
110
|
-
columns: showColumns,
|
|
111
|
-
showHeaderColumns: showHeaderColumns,
|
|
112
|
-
parent: parent
|
|
113
|
-
})) : null);
|
|
114
|
-
}
|
|
115
|
-
}]);
|
|
116
|
-
|
|
117
|
-
return TableContent;
|
|
118
|
-
}(_react.Component);
|
|
119
|
-
|
|
120
|
-
exports["default"] = TableContent;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
|
-
var _enzyme = require("enzyme");
|
|
6
|
-
|
|
7
|
-
var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require("../"));
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
|
-
var datas = [{
|
|
14
|
-
groupTitle: '2月',
|
|
15
|
-
children: [{
|
|
16
|
-
title: 'Title - 1',
|
|
17
|
-
description: 'Here are some descriptions',
|
|
18
|
-
timestamp: '10:00',
|
|
19
|
-
extraTime: '02-23'
|
|
20
|
-
}, {
|
|
21
|
-
dot: 'circle',
|
|
22
|
-
title: 'Title 2',
|
|
23
|
-
description: 'Here are some descriptions',
|
|
24
|
-
timestamp: '10:00',
|
|
25
|
-
extraTime: '02-27'
|
|
26
|
-
}]
|
|
27
|
-
}, {
|
|
28
|
-
groupTitle: '3月',
|
|
29
|
-
children: [{
|
|
30
|
-
dot: 'circle',
|
|
31
|
-
title: 'Title 3',
|
|
32
|
-
description: 'Here are some descriptions',
|
|
33
|
-
timestamp: '12:00',
|
|
34
|
-
extraTime: '03-02'
|
|
35
|
-
}, {
|
|
36
|
-
dot: 'circle',
|
|
37
|
-
title: 'Title 4',
|
|
38
|
-
description: 'Here are some descriptions',
|
|
39
|
-
timestamp: '11:00',
|
|
40
|
-
extraTime: '03-10'
|
|
41
|
-
}]
|
|
42
|
-
}];
|
|
43
|
-
describe('Timeline', function () {
|
|
44
|
-
it('renders correctly', function () {
|
|
45
|
-
var wrapper = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_["default"], null)));
|
|
46
|
-
|
|
47
|
-
expect(wrapper).toMatchSnapshot();
|
|
48
|
-
});
|
|
49
|
-
});
|