@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/collapse/index.js
CHANGED
|
@@ -1,88 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports["default"] = void 0;
|
|
7
11
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
require("./style/index");
|
|
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; }
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
13
|
|
|
20
|
-
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
36
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
|
-
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); } }
|
|
39
|
-
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
41
|
-
|
|
42
|
-
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); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
|
-
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); }; }
|
|
47
|
-
|
|
48
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
49
|
-
|
|
50
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
51
27
|
|
|
52
|
-
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
53
29
|
|
|
54
|
-
|
|
30
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
55
31
|
|
|
56
|
-
|
|
32
|
+
require("./style/index");
|
|
57
33
|
|
|
58
34
|
var noop = function noop() {};
|
|
59
35
|
|
|
60
|
-
var Collapse =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
36
|
+
var Collapse =
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
function (_Component) {
|
|
39
|
+
(0, _inherits2["default"])(Collapse, _Component);
|
|
64
40
|
|
|
65
41
|
function Collapse(props) {
|
|
66
42
|
var _this;
|
|
67
43
|
|
|
68
|
-
|
|
44
|
+
(0, _classCallCheck2["default"])(this, Collapse);
|
|
45
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Collapse).call(this, props));
|
|
46
|
+
var _this$props = _this.props,
|
|
47
|
+
activeId = _this$props.activeId,
|
|
48
|
+
activeKey = _this$props.activeKey;
|
|
49
|
+
|
|
50
|
+
var _activeId = activeId || activeKey;
|
|
69
51
|
|
|
70
|
-
_this = _super.call(this, props);
|
|
71
52
|
_this.state = {
|
|
72
|
-
|
|
53
|
+
activeId: Array.isArray(_activeId) ? _activeId : [_activeId]
|
|
73
54
|
};
|
|
74
55
|
return _this;
|
|
75
56
|
}
|
|
76
57
|
|
|
77
|
-
|
|
58
|
+
(0, _createClass2["default"])(Collapse, [{
|
|
78
59
|
key: "onClickPanel",
|
|
79
60
|
value: function onClickPanel(key) {
|
|
80
|
-
var activeKey = this.state.
|
|
61
|
+
var activeKey = this.state.activeId;
|
|
81
62
|
|
|
82
63
|
if (this.props.accordion) {
|
|
83
64
|
activeKey = activeKey[0] === key ? [] : [key];
|
|
84
65
|
} else {
|
|
85
|
-
activeKey =
|
|
66
|
+
activeKey = (0, _toConsumableArray2["default"])(activeKey);
|
|
86
67
|
var index = activeKey.indexOf(key);
|
|
87
68
|
var isActive = index > -1;
|
|
88
69
|
|
|
@@ -98,11 +79,9 @@ var Collapse = /*#__PURE__*/function (_Component) {
|
|
|
98
79
|
}, {
|
|
99
80
|
key: "setActiveKey",
|
|
100
81
|
value: function setActiveKey(activeKey) {
|
|
101
|
-
// if (!('activeKey' in this.props)) {
|
|
102
82
|
this.setState({
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
|
|
83
|
+
activeId: activeKey
|
|
84
|
+
});
|
|
106
85
|
this.props.onChange(this.props.accordion ? activeKey[0] : activeKey);
|
|
107
86
|
}
|
|
108
87
|
}, {
|
|
@@ -110,39 +89,36 @@ var Collapse = /*#__PURE__*/function (_Component) {
|
|
|
110
89
|
value: function renderPanels() {
|
|
111
90
|
var _this2 = this;
|
|
112
91
|
|
|
113
|
-
var activeKey = this.state.
|
|
114
|
-
var _this$
|
|
115
|
-
children = _this$
|
|
116
|
-
accordion = _this$
|
|
117
|
-
arrow = _this$
|
|
92
|
+
var activeKey = this.state.activeId;
|
|
93
|
+
var _this$props2 = this.props,
|
|
94
|
+
children = _this$props2.children,
|
|
95
|
+
accordion = _this$props2.accordion,
|
|
96
|
+
arrow = _this$props2.arrow,
|
|
97
|
+
arrowPlacement = _this$props2.arrowPlacement,
|
|
98
|
+
showArrow = _this$props2.showArrow;
|
|
118
99
|
var newChildren = [];
|
|
119
100
|
|
|
120
101
|
_react.Children.forEach(children, function (child, index) {
|
|
121
102
|
if (!child) return;
|
|
122
|
-
var key = child.key || String(index);
|
|
103
|
+
var key = child.props.id || child.key || String(index);
|
|
123
104
|
var _child$props = child.props,
|
|
124
105
|
header = _child$props.header,
|
|
125
|
-
disabled = _child$props.disabled
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (accordion) {
|
|
129
|
-
isActive = activeKey[0] === key;
|
|
130
|
-
} else {
|
|
131
|
-
isActive = activeKey.indexOf(key) > -1;
|
|
132
|
-
}
|
|
133
|
-
|
|
106
|
+
disabled = _child$props.disabled,
|
|
107
|
+
title = _child$props.title;
|
|
108
|
+
var isActive = accordion ? activeKey[0] === key : activeKey.includes(key);
|
|
134
109
|
var props = {
|
|
135
110
|
key: key,
|
|
136
|
-
header: header,
|
|
111
|
+
header: title || header,
|
|
137
112
|
disabled: disabled,
|
|
138
113
|
isActive: isActive,
|
|
139
|
-
arrow: arrow,
|
|
114
|
+
arrow: arrowPlacement !== 'left' ? arrowPlacement : arrow,
|
|
115
|
+
showArrow: showArrow,
|
|
140
116
|
children: child.props.children,
|
|
141
117
|
onClickPanel: disabled ? noop : function () {
|
|
142
118
|
return _this2.onClickPanel(key);
|
|
143
119
|
}
|
|
144
120
|
};
|
|
145
|
-
newChildren.push(
|
|
121
|
+
newChildren.push(_react["default"].cloneElement(child, props));
|
|
146
122
|
});
|
|
147
123
|
|
|
148
124
|
return newChildren;
|
|
@@ -150,98 +126,100 @@ var Collapse = /*#__PURE__*/function (_Component) {
|
|
|
150
126
|
}, {
|
|
151
127
|
key: "render",
|
|
152
128
|
value: function render() {
|
|
153
|
-
var _this$
|
|
154
|
-
prefixCls = _this$
|
|
155
|
-
type = _this$
|
|
129
|
+
var _this$props3 = this.props,
|
|
130
|
+
prefixCls = _this$props3.prefixCls,
|
|
131
|
+
type = _this$props3.type;
|
|
156
132
|
var classnames = (0, _classnames["default"])(prefixCls, type && "".concat(prefixCls, "__").concat(type));
|
|
157
|
-
return
|
|
133
|
+
return _react["default"].createElement("div", {
|
|
158
134
|
className: classnames
|
|
159
135
|
}, this.renderPanels());
|
|
160
136
|
}
|
|
161
137
|
}]);
|
|
162
|
-
|
|
163
138
|
return Collapse;
|
|
164
139
|
}(_react.Component);
|
|
165
140
|
|
|
166
|
-
|
|
141
|
+
(0, _defineProperty2["default"])(Collapse, "propTypes", {
|
|
167
142
|
accordion: _propTypes["default"].bool,
|
|
168
143
|
// 手风琴模式
|
|
169
144
|
activeKey: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array]),
|
|
145
|
+
activeId: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array]),
|
|
170
146
|
onChange: _propTypes["default"].func,
|
|
171
147
|
icon: _propTypes["default"].string,
|
|
172
148
|
type: _propTypes["default"].string,
|
|
173
|
-
//
|
|
174
|
-
arrow: _propTypes["default"].
|
|
149
|
+
// TODO:废弃
|
|
150
|
+
arrow: _propTypes["default"].oneOf(['left', 'right']),
|
|
151
|
+
// TODO:废弃,使用 arrowPlacement
|
|
152
|
+
arrowPlacement: _propTypes["default"].oneOf(['left', 'right']),
|
|
153
|
+
showArrow: _propTypes["default"].bool
|
|
175
154
|
});
|
|
176
|
-
|
|
177
|
-
_defineProperty(Collapse, "defaultProps", {
|
|
155
|
+
(0, _defineProperty2["default"])(Collapse, "defaultProps", {
|
|
178
156
|
prefixCls: 'hi-collapse',
|
|
179
157
|
accordion: false,
|
|
180
158
|
arrow: 'left',
|
|
181
|
-
|
|
159
|
+
arrowPlacement: 'left',
|
|
160
|
+
type: 'default',
|
|
161
|
+
showArrow: true
|
|
182
162
|
});
|
|
183
163
|
|
|
184
|
-
var CollapsePanel =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
164
|
+
var CollapsePanel =
|
|
165
|
+
/*#__PURE__*/
|
|
166
|
+
function (_Component2) {
|
|
167
|
+
(0, _inherits2["default"])(CollapsePanel, _Component2);
|
|
188
168
|
|
|
189
169
|
function CollapsePanel() {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return _super2.apply(this, arguments);
|
|
170
|
+
(0, _classCallCheck2["default"])(this, CollapsePanel);
|
|
171
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(CollapsePanel).apply(this, arguments));
|
|
193
172
|
}
|
|
194
173
|
|
|
195
|
-
|
|
174
|
+
(0, _createClass2["default"])(CollapsePanel, [{
|
|
196
175
|
key: "render",
|
|
197
176
|
value: function render() {
|
|
198
|
-
var _this$
|
|
199
|
-
key = _this$
|
|
200
|
-
arrow = _this$
|
|
201
|
-
header = _this$
|
|
202
|
-
disabled = _this$
|
|
203
|
-
isActive = _this$
|
|
204
|
-
children = _this$
|
|
205
|
-
onClickPanel = _this$
|
|
177
|
+
var _this$props4 = this.props,
|
|
178
|
+
key = _this$props4.key,
|
|
179
|
+
arrow = _this$props4.arrow,
|
|
180
|
+
header = _this$props4.header,
|
|
181
|
+
disabled = _this$props4.disabled,
|
|
182
|
+
isActive = _this$props4.isActive,
|
|
183
|
+
children = _this$props4.children,
|
|
184
|
+
onClickPanel = _this$props4.onClickPanel,
|
|
185
|
+
showArrow = _this$props4.showArrow;
|
|
206
186
|
var classnames = (0, _classnames["default"])('collapse-item', {
|
|
207
187
|
'collapse-item--show': isActive,
|
|
208
188
|
'collapse-item--disabled': disabled
|
|
209
189
|
});
|
|
210
|
-
var collapseIcon = (0, _classnames["default"])('collapse-item__icon', 'hi-icon', 'icon-
|
|
211
|
-
return
|
|
190
|
+
var collapseIcon = (0, _classnames["default"])('collapse-item__icon', 'hi-icon', 'icon-down');
|
|
191
|
+
return _react["default"].createElement("div", {
|
|
212
192
|
className: classnames
|
|
213
|
-
},
|
|
193
|
+
}, _react["default"].createElement("div", {
|
|
214
194
|
className: "collapse-item__head",
|
|
215
195
|
onClick: function onClick() {
|
|
216
196
|
return onClickPanel(key);
|
|
217
197
|
}
|
|
218
|
-
}, arrow === 'left' &&
|
|
198
|
+
}, showArrow && arrow === 'left' && _react["default"].createElement("i", {
|
|
219
199
|
className: collapseIcon
|
|
220
|
-
}),
|
|
200
|
+
}), _react["default"].createElement("div", {
|
|
221
201
|
className: "collapse-item__title"
|
|
222
|
-
}, header), arrow === 'right' &&
|
|
202
|
+
}, header), showArrow && arrow === 'right' && _react["default"].createElement("i", {
|
|
223
203
|
className: collapseIcon
|
|
224
|
-
})),
|
|
204
|
+
})), _react["default"].createElement("div", {
|
|
225
205
|
className: "collapse-item__content"
|
|
226
206
|
}, children));
|
|
227
207
|
}
|
|
228
208
|
}]);
|
|
229
|
-
|
|
230
209
|
return CollapsePanel;
|
|
231
210
|
}(_react.Component);
|
|
232
211
|
|
|
233
|
-
|
|
212
|
+
(0, _defineProperty2["default"])(CollapsePanel, "propTypes", {
|
|
234
213
|
header: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
235
214
|
disabled: _propTypes["default"].bool,
|
|
236
215
|
isActive: _propTypes["default"].bool,
|
|
237
216
|
arrow: _propTypes["default"].string,
|
|
217
|
+
showArrow: _propTypes["default"].bool,
|
|
238
218
|
onClickPanel: _propTypes["default"].func
|
|
239
219
|
});
|
|
240
|
-
|
|
241
|
-
_defineProperty(CollapsePanel, "defaultProps", {
|
|
220
|
+
(0, _defineProperty2["default"])(CollapsePanel, "defaultProps", {
|
|
242
221
|
disabled: false
|
|
243
222
|
});
|
|
244
|
-
|
|
245
223
|
Collapse.Panel = CollapsePanel;
|
|
246
224
|
var _default = Collapse;
|
|
247
225
|
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.hi-collapse{text-align:left;border
|
|
1
|
+
.hi-collapse{text-align:left;border-bottom:0;border-radius:3px;font-size:14px}.hi-collapse .collapse-item{border-bottom:1px solid #d8d8d8}.hi-collapse .collapse-item__head{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#fff;padding:12px 0 12px 16px;color:rgba(0,0,0,0.85);cursor:pointer}.hi-collapse .collapse-item__head .collapse-item__title{-webkit-box-flex:1;-ms-flex:auto;flex:auto;line-height:1}.hi-collapse .collapse-item__head>.collapse-item__icon{-webkit-box-flex:0;-ms-flex:none;flex:none;margin-right:10px;-webkit-transition:all 0.2s ease-out;transition:all 0.2s ease-out}.hi-collapse .collapse-item__content{display:block;width:100%;-webkit-transition:all 0.2s ease-out;transition:all 0.2s ease-out;height:0;-webkit-transform-origin:top;transform-origin:top;padding:0 16px;color:rgba(0,0,0,0.65);overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fbfbfb}.hi-collapse .collapse-item--show{border:none}.hi-collapse .collapse-item--show>.collapse-item__head>.collapse-item__icon{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.hi-collapse .collapse-item--show>.collapse-item__content{padding:16px;height:auto;width:100%}.hi-collapse .collapse-item--disabled .collapse-item__head{cursor:not-allowed;color:#ccc}.hi-collapse__simple .collapse-item .head{background-color:#fff}
|
package/es/confirm/index.js
CHANGED
|
@@ -1,70 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports["default"] = getConfirmInstance;
|
|
7
11
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
-
|
|
14
|
-
var _modal = _interopRequireDefault(require("../modal"));
|
|
15
|
-
|
|
16
|
-
require("./style/index");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
-
|
|
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; }
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
23
13
|
|
|
24
|
-
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
25
15
|
|
|
26
|
-
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
19
|
|
|
30
|
-
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
21
|
|
|
32
|
-
|
|
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); }
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
var _modal = _interopRequireDefault(require("../modal"));
|
|
43
27
|
|
|
44
|
-
|
|
28
|
+
require("./style/index");
|
|
45
29
|
|
|
46
|
-
var
|
|
47
|
-
_inherits(Confirm, _Component);
|
|
30
|
+
var _context = _interopRequireDefault(require("../context"));
|
|
48
31
|
|
|
49
|
-
|
|
32
|
+
var Confirm =
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
function (_Component) {
|
|
35
|
+
(0, _inherits2["default"])(Confirm, _Component);
|
|
50
36
|
|
|
51
37
|
function Confirm() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return _super.apply(this, arguments);
|
|
38
|
+
(0, _classCallCheck2["default"])(this, Confirm);
|
|
39
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Confirm).apply(this, arguments));
|
|
55
40
|
}
|
|
56
41
|
|
|
57
|
-
|
|
42
|
+
(0, _createClass2["default"])(Confirm, [{
|
|
58
43
|
key: "render",
|
|
59
44
|
value: function render() {
|
|
60
45
|
var _this$props = this.props,
|
|
61
|
-
|
|
46
|
+
content = _this$props.content,
|
|
62
47
|
onOk = _this$props.onOk,
|
|
63
|
-
_onCancel = _this$props.onCancel
|
|
64
|
-
|
|
48
|
+
_onCancel = _this$props.onCancel,
|
|
49
|
+
title = _this$props.title,
|
|
50
|
+
localeDatas = _this$props.localeDatas;
|
|
51
|
+
return _react["default"].createElement("div", {
|
|
65
52
|
className: "hi-confirm"
|
|
66
|
-
},
|
|
67
|
-
|
|
53
|
+
}, _react["default"].createElement(_modal["default"], {
|
|
54
|
+
localeDatas: localeDatas,
|
|
55
|
+
title: title,
|
|
68
56
|
ref: "hi-confirm",
|
|
69
57
|
show: true,
|
|
70
58
|
size: "small",
|
|
@@ -75,42 +63,33 @@ var Confirm = /*#__PURE__*/function (_Component) {
|
|
|
75
63
|
confirmType: "default",
|
|
76
64
|
cancelType: "danger",
|
|
77
65
|
onConfirm: function onConfirm() {
|
|
78
|
-
|
|
66
|
+
if (onOk) {
|
|
79
67
|
onOk();
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
confirmInstance.destroy();
|
|
82
71
|
},
|
|
83
72
|
onCancel: function onCancel() {
|
|
84
|
-
|
|
73
|
+
if (_onCancel) {
|
|
85
74
|
_onCancel();
|
|
75
|
+
}
|
|
86
76
|
|
|
87
|
-
|
|
88
|
-
}();
|
|
77
|
+
confirmInstance.destroy();
|
|
89
78
|
}
|
|
90
|
-
},
|
|
91
|
-
}
|
|
92
|
-
}, {
|
|
93
|
-
key: "componentDidMount",
|
|
94
|
-
value: function componentDidMount() {
|
|
95
|
-
_modal["default"].show.call(this, 'hi-confirm');
|
|
79
|
+
}, content));
|
|
96
80
|
}
|
|
97
81
|
}]);
|
|
98
|
-
|
|
99
82
|
return Confirm;
|
|
100
83
|
}(_react.Component);
|
|
101
84
|
|
|
102
|
-
Confirm.
|
|
103
|
-
tip: _propTypes["default"].string,
|
|
104
|
-
onOk: _propTypes["default"]["function"],
|
|
105
|
-
onCancel: _propTypes["default"]["function"]
|
|
106
|
-
};
|
|
85
|
+
Confirm.IS_HIUI_CONFIRM = true;
|
|
107
86
|
|
|
108
87
|
Confirm.newInstance = function newNotificationInstance(properties) {
|
|
109
88
|
var props = properties || {};
|
|
110
89
|
var div = document.createElement('div');
|
|
111
90
|
document.body.appendChild(div);
|
|
112
91
|
|
|
113
|
-
_reactDom["default"].render(
|
|
92
|
+
_reactDom["default"].render(_react["default"].createElement((0, _context["default"])(Confirm), props), div);
|
|
114
93
|
|
|
115
94
|
return {
|
|
116
95
|
destroy: function destroy() {
|