@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
package/es/carousel/index.js
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
29
|
-
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
require("./style/index");
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
37
|
-
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
-
|
|
42
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
-
|
|
46
|
-
// const url = 'http://i1.mifile.cn/f/i/hiui/docs/'
|
|
47
|
-
var Carousel = /*#__PURE__*/function (_Component) {
|
|
48
|
-
(0, _inherits2["default"])(Carousel, _Component);
|
|
49
|
-
|
|
50
|
-
var _super = _createSuper(Carousel);
|
|
51
|
-
|
|
52
|
-
function Carousel(props) {
|
|
53
|
-
var _this;
|
|
54
|
-
|
|
55
|
-
(0, _classCallCheck2["default"])(this, Carousel);
|
|
56
|
-
_this = _super.call(this, props);
|
|
57
|
-
_this.rootRef = /*#__PURE__*/_react["default"].createRef();
|
|
58
|
-
var defaultActive = props.defaultActive;
|
|
59
|
-
_this.state = {
|
|
60
|
-
rootWidth: 0,
|
|
61
|
-
showArrow: false,
|
|
62
|
-
active: defaultActive >= props.children.length || defaultActive < 0 ? 0 : defaultActive
|
|
63
|
-
};
|
|
64
|
-
_this.timer = null;
|
|
65
|
-
return _this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
(0, _createClass2["default"])(Carousel, [{
|
|
69
|
-
key: "componentDidMount",
|
|
70
|
-
value: function componentDidMount() {
|
|
71
|
-
var _this2 = this;
|
|
72
|
-
|
|
73
|
-
this.setState({
|
|
74
|
-
rootWidth: this.rootRef.current.clientWidth
|
|
75
|
-
}, function () {
|
|
76
|
-
if (_this2.props.duration) {
|
|
77
|
-
_this2.autoPage();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}, {
|
|
82
|
-
key: "componentWillUnmount",
|
|
83
|
-
value: function componentWillUnmount() {
|
|
84
|
-
this.timer && window.clearInterval(this.timer);
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
key: "autoPage",
|
|
88
|
-
value: function autoPage() {
|
|
89
|
-
var _this3 = this;
|
|
90
|
-
|
|
91
|
-
this.timer = window.setInterval(function () {
|
|
92
|
-
_this3.preNextEvent(1);
|
|
93
|
-
}, this.props.duration);
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "pageEvent",
|
|
97
|
-
value: function pageEvent(active) {
|
|
98
|
-
this.setState({
|
|
99
|
-
active: active
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
key: "preNextEvent",
|
|
104
|
-
value: function preNextEvent(val) {
|
|
105
|
-
var active = this.state.active + val;
|
|
106
|
-
|
|
107
|
-
if (active >= this.props.children.length) {
|
|
108
|
-
active = 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (active < 0) {
|
|
112
|
-
active = this.props.children.length + active;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.setState({
|
|
116
|
-
active: active
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
key: "mouseEvent",
|
|
121
|
-
value: function mouseEvent(type) {
|
|
122
|
-
var showArrow = true;
|
|
123
|
-
|
|
124
|
-
if (type === 'over') {
|
|
125
|
-
this.timer && window.clearInterval(this.timer);
|
|
126
|
-
} else {
|
|
127
|
-
showArrow = false;
|
|
128
|
-
this.props.duration && this.autoPage();
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
this.setState({
|
|
132
|
-
showArrow: showArrow
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "render",
|
|
137
|
-
value: function render() {
|
|
138
|
-
var _this4 = this;
|
|
139
|
-
|
|
140
|
-
var _this$state = this.state,
|
|
141
|
-
rootWidth = _this$state.rootWidth,
|
|
142
|
-
active = _this$state.active,
|
|
143
|
-
showArrow = _this$state.showArrow;
|
|
144
|
-
var _this$props = this.props,
|
|
145
|
-
showDots = _this$props.showDots,
|
|
146
|
-
showArrows = _this$props.showArrows,
|
|
147
|
-
showPages = _this$props.showPages;
|
|
148
|
-
|
|
149
|
-
var children = _react["default"].Children.toArray(this.props.children);
|
|
150
|
-
|
|
151
|
-
var len = children.length || 0;
|
|
152
|
-
var arrowCls = (0, _classnames["default"])('hi-carousel__arrows', showArrow && 'hi-carousel__arrows--show');
|
|
153
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
|
-
className: "hi-carousel",
|
|
155
|
-
ref: this.rootRef,
|
|
156
|
-
onMouseOver: this.mouseEvent.bind(this, 'over'),
|
|
157
|
-
onMouseOut: this.mouseEvent.bind(this, 'out')
|
|
158
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
159
|
-
className: "hi-carousel__container",
|
|
160
|
-
style: {
|
|
161
|
-
width: rootWidth * children.length
|
|
162
|
-
}
|
|
163
|
-
}, children.map(function (child, index) {
|
|
164
|
-
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
165
|
-
key: index,
|
|
166
|
-
style: _objectSpread({
|
|
167
|
-
position: 'relative',
|
|
168
|
-
zIndex: active === index ? 2 : 1,
|
|
169
|
-
opacity: active === index ? 1 : 0,
|
|
170
|
-
transition: 'opacity 300ms ease 0s',
|
|
171
|
-
left: -(rootWidth * index),
|
|
172
|
-
width: rootWidth,
|
|
173
|
-
display: 'inline-block',
|
|
174
|
-
fontSize: 24
|
|
175
|
-
}, child.props.style)
|
|
176
|
-
});
|
|
177
|
-
})), showArrows && /*#__PURE__*/_react["default"].createElement("ul", {
|
|
178
|
-
className: arrowCls
|
|
179
|
-
}, /*#__PURE__*/_react["default"].createElement("li", {
|
|
180
|
-
className: "hi-carousel__arrow",
|
|
181
|
-
onClick: this.preNextEvent.bind(this, -1)
|
|
182
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
183
|
-
name: "left"
|
|
184
|
-
})), /*#__PURE__*/_react["default"].createElement("li", {
|
|
185
|
-
className: "hi-carousel__arrow",
|
|
186
|
-
onClick: this.preNextEvent.bind(this, 1)
|
|
187
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
188
|
-
name: "right"
|
|
189
|
-
}))), showDots && /*#__PURE__*/_react["default"].createElement("ul", {
|
|
190
|
-
className: "hi-carousel__dots"
|
|
191
|
-
}, children.map(function (_, index) {
|
|
192
|
-
var cls = (0, _classnames["default"])('hi-carousel__dot', active === index && 'hi-carousel__dot--active');
|
|
193
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
194
|
-
className: cls,
|
|
195
|
-
key: index,
|
|
196
|
-
onClick: _this4.pageEvent.bind(_this4, index)
|
|
197
|
-
});
|
|
198
|
-
})), showPages && /*#__PURE__*/_react["default"].createElement("div", {
|
|
199
|
-
className: "hi-carousel__pages"
|
|
200
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, active, " / ", len)));
|
|
201
|
-
}
|
|
202
|
-
}]);
|
|
203
|
-
return Carousel;
|
|
204
|
-
}(_react.Component);
|
|
205
|
-
|
|
206
|
-
Carousel.propTypes = {
|
|
207
|
-
duration: _propTypes["default"].number,
|
|
208
|
-
onClick: _propTypes["default"].func,
|
|
209
|
-
beforeChange: _propTypes["default"].func,
|
|
210
|
-
afterChange: _propTypes["default"].func,
|
|
211
|
-
showDots: _propTypes["default"].bool,
|
|
212
|
-
showArrows: _propTypes["default"].bool,
|
|
213
|
-
defaultActive: _propTypes["default"].number,
|
|
214
|
-
showPages: _propTypes["default"].bool
|
|
215
|
-
};
|
|
216
|
-
Carousel.defaultProps = {
|
|
217
|
-
duration: 0,
|
|
218
|
-
onClick: function onClick() {},
|
|
219
|
-
beforeChange: function beforeChange() {},
|
|
220
|
-
afterChange: function afterChange() {},
|
|
221
|
-
showDots: true,
|
|
222
|
-
showArrows: true,
|
|
223
|
-
defaultActive: 0,
|
|
224
|
-
showPages: false
|
|
225
|
-
};
|
|
226
|
-
var _default = Carousel;
|
|
227
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.hi-carousel{width:100%;color:#fff;overflow:hidden;position:relative}.hi-carousel__container{height:100%;-webkit-transition:all 500ms;transition:all 500ms}.hi-carousel__dots{position:absolute;bottom:24px;margin:0;padding:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);max-width:50%;display:-webkit-box;display:-ms-flexbox;display:flex;z-index:2}.hi-carousel__dot{width:24px;height:4px;background:rgba(255,255,255,0.4);border-radius:2px;display:inline-block;margin-left:4px;cursor:pointer;-webkit-transition:all 1s;transition:all 1s}.hi-carousel__dot--active:not(.hi-carousel__dot--sign){background:#fff;width:48px}.hi-carousel__dot--sign{width:24px}.hi-carousel__arrows{position:absolute;width:100%;list-style:none;margin:0;padding:0;top:50%;-webkit-transform:translateY(-28px);transform:translateY(-28px);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;visibility:hidden;height:0;z-index:2}.hi-carousel__arrows--show{visibility:visible}.hi-carousel__arrow{width:56px;height:56px;background:rgba(0,0,0,0.25);border-radius:50%;text-align:center;line-height:56px;color:#fff;font-size:32px;margin-left:24px;cursor:pointer}.hi-carousel__arrow:hover{background:rgba(0,0,0,0.45)}.hi-carousel__arrow:last-child{margin-right:24px}.hi-carousel__pages{width:46px;height:22px;border-radius:16px;position:absolute;bottom:24px;right:24px;background:rgba(0,0,0,0.5);line-height:22px;font-size:14px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0.5;z-index:2}
|
package/es/cascader/Menu.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
-
|
|
32
|
-
var _loading = _interopRequireDefault(require("../loading"));
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
37
|
-
|
|
38
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
|
-
var Menu = /*#__PURE__*/function (_Component) {
|
|
43
|
-
(0, _inherits2["default"])(Menu, _Component);
|
|
44
|
-
|
|
45
|
-
var _super = _createSuper(Menu);
|
|
46
|
-
|
|
47
|
-
function Menu() {
|
|
48
|
-
var _this;
|
|
49
|
-
|
|
50
|
-
(0, _classCallCheck2["default"])(this, Menu);
|
|
51
|
-
|
|
52
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
53
|
-
args[_key] = arguments[_key];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
57
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderMenus", function () {
|
|
58
|
-
var _this$props = _this.props,
|
|
59
|
-
value = _this$props.value,
|
|
60
|
-
options = _this$props.options,
|
|
61
|
-
onSelect = _this$props.onSelect,
|
|
62
|
-
isFiltered = _this$props.isFiltered,
|
|
63
|
-
filterOptionWidth = _this$props.filterOptionWidth,
|
|
64
|
-
theme = _this$props.theme,
|
|
65
|
-
trigger = _this$props.trigger,
|
|
66
|
-
onHoverSelect = _this$props.onHoverSelect,
|
|
67
|
-
onHoverClick = _this$props.onHoverClick;
|
|
68
|
-
|
|
69
|
-
var root = _this.root();
|
|
70
|
-
|
|
71
|
-
var menus = [];
|
|
72
|
-
var valueKey = root.valueKey();
|
|
73
|
-
var labelKey = root.labelKey();
|
|
74
|
-
var childrenKey = root.childrenKey();
|
|
75
|
-
var currentOptions = options.slice();
|
|
76
|
-
var deep = 0;
|
|
77
|
-
|
|
78
|
-
var _loop = function _loop() {
|
|
79
|
-
var currentValue = value[deep];
|
|
80
|
-
|
|
81
|
-
var _currentOptions = currentOptions.slice();
|
|
82
|
-
|
|
83
|
-
currentOptions = false;
|
|
84
|
-
menus.push( /*#__PURE__*/_react["default"].createElement("ul", {
|
|
85
|
-
className: "hi-cascader-menu theme__".concat(theme),
|
|
86
|
-
key: deep,
|
|
87
|
-
style: {
|
|
88
|
-
width: isFiltered ? filterOptionWidth : 'auto'
|
|
89
|
-
}
|
|
90
|
-
}, _currentOptions.length === 0 && /*#__PURE__*/_react["default"].createElement(_loading["default"], {
|
|
91
|
-
size: "small"
|
|
92
|
-
}), _currentOptions.map(function (option, index) {
|
|
93
|
-
var optionValue = option[valueKey];
|
|
94
|
-
var hasChildren = Array.isArray(option[childrenKey]);
|
|
95
|
-
var isExpanded = hasChildren && optionValue === currentValue; // const expandIcon = isExpanded ? 'icon-right' : 'icon-right'
|
|
96
|
-
|
|
97
|
-
var expandIcon = 'icon-right';
|
|
98
|
-
var optionValues = option.jointOption ? optionValue : _this.getOptionValues(value, optionValue, deep); // jointOption为true代表搜索拼接出来的option,直接取value即可
|
|
99
|
-
|
|
100
|
-
if (isExpanded) {
|
|
101
|
-
currentOptions = option[childrenKey];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
105
|
-
className: (0, _classnames["default"])('hi-cascader-menu__item', {
|
|
106
|
-
'hi-cascader-menu__item-expanded': hasChildren,
|
|
107
|
-
'hi-cascader-menu__item-disabled': !!option.disabled,
|
|
108
|
-
'hi-cascader-menu__item-active': currentValue === optionValue
|
|
109
|
-
}),
|
|
110
|
-
onMouseEnter: function onMouseEnter(e) {
|
|
111
|
-
if (trigger === 'hover') {
|
|
112
|
-
e.stopPropagation();
|
|
113
|
-
!option.disabled && onHoverSelect(optionValues, hasChildren);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
onClick: function onClick(e) {
|
|
117
|
-
e.stopPropagation();
|
|
118
|
-
|
|
119
|
-
if (trigger === 'click') {
|
|
120
|
-
!option.disabled && onSelect(optionValues, hasChildren);
|
|
121
|
-
} else {
|
|
122
|
-
!option.disabled && onHoverClick(optionValues, hasChildren);
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
key: optionValue + option[labelKey]
|
|
126
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
127
|
-
className: "hi-cascader-menu__item--label"
|
|
128
|
-
}, option[labelKey]), hasChildren && /*#__PURE__*/_react["default"].createElement("i", {
|
|
129
|
-
className: (0, _classnames["default"])('hi-cascader-menu__item--icon', 'hi-icon', expandIcon)
|
|
130
|
-
}));
|
|
131
|
-
})));
|
|
132
|
-
deep++;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
while (currentOptions) {
|
|
136
|
-
_loop();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return menus;
|
|
140
|
-
});
|
|
141
|
-
return _this;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
(0, _createClass2["default"])(Menu, [{
|
|
145
|
-
key: "root",
|
|
146
|
-
value: function root() {
|
|
147
|
-
return this.props.root();
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "getOptionValues",
|
|
151
|
-
value: function getOptionValues(values, optionValue, index) {
|
|
152
|
-
if (index === 0) {
|
|
153
|
-
return [optionValue];
|
|
154
|
-
} else {
|
|
155
|
-
return values.slice(0, index).concat([optionValue]);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "render",
|
|
160
|
-
value: function render() {
|
|
161
|
-
var menus = this.renderMenus();
|
|
162
|
-
return menus;
|
|
163
|
-
}
|
|
164
|
-
}]);
|
|
165
|
-
return Menu;
|
|
166
|
-
}(_react.Component);
|
|
167
|
-
|
|
168
|
-
(0, _defineProperty2["default"])(Menu, "propTypes", {
|
|
169
|
-
value: _propTypes["default"].array,
|
|
170
|
-
options: _propTypes["default"].array,
|
|
171
|
-
onSelect: _propTypes["default"].func
|
|
172
|
-
});
|
|
173
|
-
var _default = Menu;
|
|
174
|
-
exports["default"] = _default;
|