@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/date-picker/Time.js
CHANGED
|
@@ -1,439 +1,325 @@
|
|
|
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 _util = require("./util");
|
|
11
|
-
|
|
12
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _dateUtil = require("./dateUtil");
|
|
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; }
|
|
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"); } }
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
27
13
|
|
|
28
|
-
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
29
15
|
|
|
30
|
-
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
31
17
|
|
|
32
|
-
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
33
19
|
|
|
34
|
-
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
35
21
|
|
|
36
|
-
|
|
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; }
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
var _util = require("./util");
|
|
43
25
|
|
|
44
|
-
|
|
26
|
+
var _TimeList = _interopRequireDefault(require("./TimeList"));
|
|
45
27
|
|
|
46
|
-
var
|
|
47
|
-
_inherits(TimePanel, _Component);
|
|
28
|
+
var _dateUtil = require("./dateUtil");
|
|
48
29
|
|
|
49
|
-
|
|
30
|
+
var Time =
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
function (_Component) {
|
|
33
|
+
(0, _inherits2["default"])(Time, _Component);
|
|
50
34
|
|
|
51
|
-
function
|
|
35
|
+
function Time(props) {
|
|
52
36
|
var _this;
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_this = _super.call(this, props);
|
|
38
|
+
(0, _classCallCheck2["default"])(this, Time);
|
|
39
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Time).call(this, props));
|
|
57
40
|
_this.state = {
|
|
58
|
-
date:
|
|
41
|
+
date: (0, _dateUtil.getValidDate)(props.date),
|
|
42
|
+
endDate: '',
|
|
59
43
|
prefix: {
|
|
60
44
|
hours: 0,
|
|
61
45
|
minutes: 0,
|
|
62
46
|
seconds: 0
|
|
63
|
-
}
|
|
64
|
-
hoursArrow: false,
|
|
65
|
-
minutesArrow: false,
|
|
66
|
-
secondsArrow: false
|
|
47
|
+
}
|
|
67
48
|
};
|
|
68
|
-
_this.hoursList = null;
|
|
69
|
-
_this.minutesList = null;
|
|
70
|
-
_this.secondsList = null;
|
|
71
|
-
_this.liPrefix = props.onlyTime ? [1, 2, 3] : [1, 2, 3, 4];
|
|
72
|
-
_this.liSuffix = props.onlyTime ? [1, 2, 3] : [1, 2, 3, 4];
|
|
73
|
-
_this.hoursScrollEvent = _this.scrollEvent.bind(_assertThisInitialized(_this), 'hours');
|
|
74
|
-
_this.minutesScrollEvent = _this.scrollEvent.bind(_assertThisInitialized(_this), 'minutes');
|
|
75
|
-
_this.secondsScrollEvent = _this.scrollEvent.bind(_assertThisInitialized(_this), 'seconds');
|
|
76
|
-
_this.pageUpRef = /*#__PURE__*/_react["default"].createRef();
|
|
77
|
-
_this.pageDownRef = /*#__PURE__*/_react["default"].createRef();
|
|
78
|
-
_this.topValue_1 = 0;
|
|
79
|
-
_this.topValue_2 = 0;
|
|
80
|
-
_this.timer = null;
|
|
81
49
|
return _this;
|
|
82
50
|
}
|
|
83
51
|
|
|
84
|
-
|
|
85
|
-
key: "
|
|
86
|
-
value: function
|
|
87
|
-
var arr = [];
|
|
88
|
-
|
|
89
|
-
for (var i = 0; i < num; i++) {
|
|
90
|
-
arr.push(i < 10 ? '0' + i : i.toString());
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return arr;
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "componentDidMount",
|
|
97
|
-
value: function componentDidMount() {
|
|
98
|
-
this.completeScrollTop();
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "addListener",
|
|
102
|
-
value: function addListener() {
|
|
103
|
-
this.hoursList && this.hoursList.addEventListener('scroll', this.hoursScrollEvent);
|
|
104
|
-
this.minutesList && this.minutesList.addEventListener('scroll', this.minutesScrollEvent);
|
|
105
|
-
this.secondsList && this.secondsList.addEventListener('scroll', this.secondsScrollEvent);
|
|
106
|
-
}
|
|
107
|
-
}, {
|
|
108
|
-
key: "isScrollStop",
|
|
109
|
-
value: function isScrollStop(val, el) {
|
|
110
|
-
this.topValue_2 = el.scrollTop;
|
|
111
|
-
|
|
112
|
-
if (this.topValue_1 === this.topValue_2) {
|
|
113
|
-
el.scrollTop = val * 32;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}, {
|
|
117
|
-
key: "scrollEvent",
|
|
118
|
-
value: function scrollEvent(type, e) {
|
|
119
|
-
clearTimeout(this.timer);
|
|
120
|
-
var st = e.target.scrollTop;
|
|
121
|
-
this.topValue_1 = st;
|
|
122
|
-
var val = Math.round(st / 32);
|
|
123
|
-
|
|
124
|
-
if (type === 'hours' && val > 23 || (type === 'minutes' || type === 'seconds') && val > 59) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
this.timer = setTimeout(this.isScrollStop.bind(this, val, e.target), 200);
|
|
129
|
-
var date = this.state.date;
|
|
130
|
-
|
|
131
|
-
if (type === 'hours') {
|
|
132
|
-
date.setHours(val);
|
|
133
|
-
} else if (type === 'minutes') {
|
|
134
|
-
date.setMinutes(val);
|
|
135
|
-
} else {
|
|
136
|
-
date.setSeconds(val);
|
|
137
|
-
}
|
|
138
|
-
|
|
52
|
+
(0, _createClass2["default"])(Time, [{
|
|
53
|
+
key: "callback",
|
|
54
|
+
value: function callback(date) {
|
|
139
55
|
this.setState({
|
|
140
56
|
date: date
|
|
141
57
|
});
|
|
142
58
|
this.props.onPick(date, true);
|
|
143
59
|
}
|
|
144
|
-
}, {
|
|
145
|
-
key: "componentWillUnmount",
|
|
146
|
-
value: function componentWillUnmount() {
|
|
147
|
-
this.hoursList.removeEventListener('scroll', this.hoursScrollEvent);
|
|
148
|
-
this.minutesList.removeEventListener('scroll', this.minutesScrollEvent);
|
|
149
|
-
this.secondsList.removeEventListener('scroll', this.secondsScrollEvent);
|
|
150
|
-
}
|
|
151
60
|
}, {
|
|
152
61
|
key: "componentWillReceiveProps",
|
|
153
62
|
value: function componentWillReceiveProps(props) {
|
|
154
63
|
if (!(0, _dateUtil.isSameDay)(props.date, this.state.date)) {
|
|
155
64
|
this.setState({
|
|
156
|
-
date: props.date
|
|
65
|
+
date: (0, _dateUtil.getValidDate)(props.date)
|
|
157
66
|
});
|
|
158
67
|
}
|
|
159
68
|
}
|
|
160
69
|
}, {
|
|
161
|
-
key: "
|
|
162
|
-
value: function
|
|
163
|
-
var
|
|
70
|
+
key: "whenDisableChange",
|
|
71
|
+
value: function whenDisableChange(list, val, arrowVal) {
|
|
72
|
+
var _value = val + arrowVal;
|
|
164
73
|
|
|
165
|
-
|
|
74
|
+
while (list.includes(_value)) {
|
|
75
|
+
_value += arrowVal;
|
|
76
|
+
}
|
|
166
77
|
|
|
167
|
-
|
|
168
|
-
hours = _deconstructDate.hours,
|
|
169
|
-
minutes = _deconstructDate.minutes,
|
|
170
|
-
seconds = _deconstructDate.seconds;
|
|
171
|
-
|
|
172
|
-
var dVal = 32;
|
|
173
|
-
setTimeout(function () {
|
|
174
|
-
_this2.hoursList.scrollTop = hours * dVal;
|
|
175
|
-
_this2.minutesList.scrollTop = minutes * dVal;
|
|
176
|
-
_this2.secondsList.scrollTop = seconds * dVal;
|
|
177
|
-
}, 0);
|
|
178
|
-
setTimeout(function () {
|
|
179
|
-
_this2.addListener();
|
|
180
|
-
}, 200);
|
|
78
|
+
return _value;
|
|
181
79
|
}
|
|
182
80
|
}, {
|
|
183
|
-
key: "
|
|
184
|
-
value: function
|
|
185
|
-
var _this3 = this;
|
|
186
|
-
|
|
187
|
-
var li = e.target;
|
|
188
|
-
if (!li.innerText) return;
|
|
81
|
+
key: "selectedEvent",
|
|
82
|
+
value: function selectedEvent(type, value, arrow) {
|
|
189
83
|
var date = this.state.date;
|
|
190
|
-
|
|
191
|
-
var c = parseInt(li.innerText);
|
|
84
|
+
var cDate = new Date(date.getTime());
|
|
192
85
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} else {
|
|
198
|
-
date.setSeconds(c);
|
|
86
|
+
var disabledList = this._getDsiabledList()[type];
|
|
87
|
+
|
|
88
|
+
if (disabledList.includes(value) && arrow) {
|
|
89
|
+
value = this.whenDisableChange(disabledList, value, arrow);
|
|
199
90
|
}
|
|
200
91
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
})
|
|
206
|
-
|
|
92
|
+
if (type === 'hours') {
|
|
93
|
+
cDate.setHours(value);
|
|
94
|
+
} else if (type === 'minutes') {
|
|
95
|
+
cDate.setMinutes(value);
|
|
96
|
+
} else if (type === 'seconds') {
|
|
97
|
+
cDate.setSeconds(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (cDate.getTime() !== date.getTime()) {
|
|
101
|
+
this.callback(cDate);
|
|
102
|
+
}
|
|
207
103
|
}
|
|
208
104
|
}, {
|
|
209
|
-
key: "
|
|
210
|
-
value: function
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
105
|
+
key: "isShowHMS",
|
|
106
|
+
value: function isShowHMS() {
|
|
107
|
+
var format = this.props.format;
|
|
108
|
+
return {
|
|
109
|
+
hours: format.indexOf('H') > -1 || format.indexOf('h') > -1,
|
|
110
|
+
minutes: format.indexOf('m') > -1,
|
|
111
|
+
seconds: format.indexOf('s') > -1
|
|
112
|
+
};
|
|
113
|
+
} // 设置Date的选中状态
|
|
114
|
+
|
|
115
|
+
}, {
|
|
116
|
+
key: "setDisableTime",
|
|
117
|
+
value: function setDisableTime(type, i, disabledTime) {
|
|
118
|
+
var _this$props = this.props,
|
|
119
|
+
timeRangePanelType = _this$props.timeRangePanelType,
|
|
120
|
+
startDate = _this$props.startDate,
|
|
121
|
+
date = _this$props.date;
|
|
122
|
+
var isDisabled = disabledTime.includes(i);
|
|
123
|
+
|
|
124
|
+
if (this.props.isCheckTime) {
|
|
125
|
+
if (timeRangePanelType === 'right') {
|
|
126
|
+
var _deconstructDate = (0, _util.deconstructDate)(startDate),
|
|
127
|
+
hours = _deconstructDate.hours,
|
|
128
|
+
minutes = _deconstructDate.minutes,
|
|
129
|
+
seconds = _deconstructDate.seconds;
|
|
130
|
+
|
|
131
|
+
var _ref = date ? (0, _util.deconstructDate)(date) : (0, _util.deconstructDate)(new Date()),
|
|
132
|
+
endHours = _ref.hours,
|
|
133
|
+
endMinutes = _ref.minutes;
|
|
134
|
+
|
|
135
|
+
isDisabled = type === 'hours' && hours > i;
|
|
136
|
+
|
|
137
|
+
if (type === 'minutes') {
|
|
138
|
+
if (endHours === hours) {
|
|
139
|
+
isDisabled = minutes > i;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (endHours < hours) {
|
|
143
|
+
isDisabled = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (type === 'seconds') {
|
|
148
|
+
if (endHours === hours) {
|
|
149
|
+
isDisabled = endMinutes === minutes && seconds > i;
|
|
150
|
+
|
|
151
|
+
if (endMinutes < minutes) {
|
|
152
|
+
isDisabled = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (endHours < hours) {
|
|
157
|
+
isDisabled = true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return isDisabled;
|
|
216
164
|
}
|
|
217
165
|
}, {
|
|
218
|
-
key: "
|
|
219
|
-
value: function
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
166
|
+
key: "getStep",
|
|
167
|
+
value: function getStep(type) {
|
|
168
|
+
var _this$props2 = this.props,
|
|
169
|
+
hourStep = _this$props2.hourStep,
|
|
170
|
+
minuteStep = _this$props2.minuteStep,
|
|
171
|
+
secondStep = _this$props2.secondStep;
|
|
172
|
+
var step = 1;
|
|
173
|
+
var directionStep = 1;
|
|
174
|
+
|
|
175
|
+
switch (type) {
|
|
176
|
+
case 'hours':
|
|
177
|
+
step = hourStep || directionStep;
|
|
178
|
+
break;
|
|
179
|
+
|
|
180
|
+
case 'minutes':
|
|
181
|
+
step = minuteStep || directionStep;
|
|
182
|
+
break;
|
|
183
|
+
|
|
184
|
+
case 'seconds':
|
|
185
|
+
step = secondStep || directionStep;
|
|
186
|
+
break;
|
|
187
|
+
|
|
188
|
+
default:
|
|
189
|
+
step = 1;
|
|
190
|
+
break;
|
|
228
191
|
}
|
|
192
|
+
|
|
193
|
+
return step;
|
|
229
194
|
}
|
|
230
195
|
}, {
|
|
231
|
-
key: "
|
|
232
|
-
value: function
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var
|
|
196
|
+
key: "generateDatas",
|
|
197
|
+
value: function generateDatas(type) {
|
|
198
|
+
var count;
|
|
199
|
+
var datas = [];
|
|
200
|
+
var currentDate = (0, _util.deconstructDate)(this.state.date);
|
|
201
|
+
var step = this.getStep(type);
|
|
237
202
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
203
|
+
var disabledList = this._getDsiabledList();
|
|
204
|
+
|
|
205
|
+
var disabledTime = disabledList[type];
|
|
242
206
|
|
|
243
|
-
if (type === '
|
|
244
|
-
|
|
245
|
-
|
|
207
|
+
if (type === 'hours') {
|
|
208
|
+
count = 24;
|
|
209
|
+
} else if (type === 'minutes') {
|
|
210
|
+
count = 60;
|
|
211
|
+
} else {
|
|
212
|
+
count = 60;
|
|
246
213
|
}
|
|
247
214
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
215
|
+
for (var i = 0; i < count; i += 1) {
|
|
216
|
+
if (i % step === 0 || i === 0) {
|
|
217
|
+
datas.push({
|
|
218
|
+
value: i,
|
|
219
|
+
text: i < 10 ? '0' + i : i.toString(),
|
|
220
|
+
disabled: this.setDisableTime(type, i, disabledTime),
|
|
221
|
+
current: i === currentDate[type]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
251
224
|
}
|
|
252
225
|
|
|
253
|
-
|
|
254
|
-
this.setState({
|
|
255
|
-
date: date
|
|
256
|
-
});
|
|
226
|
+
return datas;
|
|
257
227
|
}
|
|
258
228
|
}, {
|
|
259
|
-
key: "
|
|
260
|
-
value: function
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var
|
|
266
|
-
|
|
229
|
+
key: "_getDsiabledList",
|
|
230
|
+
value: function _getDsiabledList() {
|
|
231
|
+
var _this$props3 = this.props,
|
|
232
|
+
disabledHours = _this$props3.disabledHours,
|
|
233
|
+
disabledMinutes = _this$props3.disabledMinutes,
|
|
234
|
+
disabledSeconds = _this$props3.disabledSeconds;
|
|
235
|
+
var currentDate = (0, _util.deconstructDate)(this.state.date);
|
|
236
|
+
return {
|
|
237
|
+
hours: Object.prototype.toString.call(disabledHours) === '[object Array]' ? disabledHours : disabledHours() || [],
|
|
238
|
+
minutes: Object.prototype.toString.call(disabledMinutes) === '[object Array]' ? disabledMinutes : disabledMinutes(currentDate['hours']) || [],
|
|
239
|
+
seconds: Object.prototype.toString.call(disabledSeconds) === '[object Array]' ? disabledSeconds : disabledSeconds(currentDate['hours'], currentDate['minutes']) || []
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}, {
|
|
243
|
+
key: "renderTimeList",
|
|
244
|
+
value: function renderTimeList(type) {
|
|
245
|
+
var _this$props4 = this.props,
|
|
246
|
+
hourStep = _this$props4.hourStep,
|
|
247
|
+
minuteStep = _this$props4.minuteStep,
|
|
248
|
+
secondStep = _this$props4.secondStep;
|
|
249
|
+
var dDate = (0, _util.deconstructDate)(this.state.date);
|
|
267
250
|
|
|
268
|
-
|
|
269
|
-
cHours = cHours === 23 ? 23 : cHours + 1;
|
|
270
|
-
this.hoursList.scrollTop = cHours * 32;
|
|
271
|
-
}
|
|
251
|
+
var disabledList = this._getDsiabledList();
|
|
272
252
|
|
|
273
|
-
|
|
274
|
-
cMinutes = cMinutes === 59 ? 59 : cMinutes + 1;
|
|
275
|
-
this.minutesList.scrollTop = cMinutes * 32;
|
|
276
|
-
}
|
|
253
|
+
var isShow = this.isShowHMS()[type];
|
|
277
254
|
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
-
this.secondsList.scrollTop = cSeconds * 32;
|
|
255
|
+
if (!isShow) {
|
|
256
|
+
return null;
|
|
281
257
|
}
|
|
282
258
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
259
|
+
return _react["default"].createElement(_TimeList["default"], {
|
|
260
|
+
type: type,
|
|
261
|
+
value: dDate[type],
|
|
262
|
+
onlyTime: this.props.onlyTime,
|
|
263
|
+
datas: this.generateDatas(type),
|
|
264
|
+
disabledList: disabledList[type],
|
|
265
|
+
timeRangePanelType: this.props.timeRangePanelType,
|
|
266
|
+
hourStep: hourStep,
|
|
267
|
+
minuteStep: minuteStep,
|
|
268
|
+
secondStep: secondStep,
|
|
269
|
+
onSelect: this.selectedEvent.bind(this)
|
|
288
270
|
});
|
|
289
271
|
}
|
|
290
|
-
}, {
|
|
291
|
-
key: "renderArrow",
|
|
292
|
-
value: function renderArrow(type) {
|
|
293
|
-
var _this5 = this;
|
|
294
|
-
|
|
295
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
296
|
-
className: "hi-timepicker__page-turn",
|
|
297
|
-
onClick: function onClick() {
|
|
298
|
-
return _this5.scrollPageUp(type);
|
|
299
|
-
}
|
|
300
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
301
|
-
name: "up"
|
|
302
|
-
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
303
|
-
className: "hi-timepicker__page-turn",
|
|
304
|
-
onClick: function onClick() {
|
|
305
|
-
return _this5.scrollPageDown(type);
|
|
306
|
-
}
|
|
307
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
308
|
-
name: "down"
|
|
309
|
-
})));
|
|
310
|
-
}
|
|
311
272
|
}, {
|
|
312
273
|
key: "render",
|
|
313
274
|
value: function render() {
|
|
314
|
-
var _this6 = this;
|
|
315
|
-
|
|
316
275
|
var localeDatas = this.props.localeDatas;
|
|
317
276
|
var _localeDatas$datePick = localeDatas.datePicker,
|
|
318
277
|
lHours = _localeDatas$datePick.hours,
|
|
319
278
|
lMinutes = _localeDatas$datePick.minutes,
|
|
320
279
|
lSeconds = _localeDatas$datePick.seconds;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
hours = _deconstructDate2.hours,
|
|
329
|
-
minutes = _deconstructDate2.minutes,
|
|
330
|
-
seconds = _deconstructDate2.seconds;
|
|
331
|
-
|
|
332
|
-
this.liPrefix = this.liPrefix.map(function (item, index) {
|
|
333
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
334
|
-
className: "hi-timepicker__item hi-timepikcer__item--empty",
|
|
335
|
-
key: 'pre' + index
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
this.liSuffix = this.liSuffix.map(function (item, index) {
|
|
339
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
340
|
-
className: "hi-timepicker__item hi-timepikcer__item--empty",
|
|
341
|
-
key: 'suf' + index
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
280
|
+
|
|
281
|
+
var _this$isShowHMS = this.isShowHMS(),
|
|
282
|
+
showHour = _this$isShowHMS.hours,
|
|
283
|
+
showMinute = _this$isShowHMS.minutes,
|
|
284
|
+
showSecond = _this$isShowHMS.seconds;
|
|
285
|
+
|
|
286
|
+
return _react["default"].createElement("div", {
|
|
345
287
|
className: "hi-timepicker__body"
|
|
346
|
-
},
|
|
288
|
+
}, _react["default"].createElement("div", {
|
|
347
289
|
className: "hi-timepicker__timeheader"
|
|
348
|
-
},
|
|
290
|
+
}, showHour && _react["default"].createElement("span", {
|
|
349
291
|
className: "hi-timepicker__mark"
|
|
350
|
-
}, lHours),
|
|
292
|
+
}, lHours), showMinute && _react["default"].createElement("span", {
|
|
351
293
|
className: "hi-timepicker__mark"
|
|
352
|
-
}, lMinutes),
|
|
294
|
+
}, lMinutes), showSecond && _react["default"].createElement("span", {
|
|
353
295
|
className: "hi-timepicker__mark"
|
|
354
|
-
}, lSeconds)),
|
|
296
|
+
}, lSeconds)), _react["default"].createElement("div", {
|
|
355
297
|
className: "hi-timepicker__timebody"
|
|
356
|
-
},
|
|
357
|
-
className: "hi-timepicker__list-container",
|
|
358
|
-
onMouseEnter: function onMouseEnter() {
|
|
359
|
-
return _this6.setState({
|
|
360
|
-
hoursArrow: true
|
|
361
|
-
});
|
|
362
|
-
},
|
|
363
|
-
onMouseLeave: function onMouseLeave() {
|
|
364
|
-
return _this6.setState({
|
|
365
|
-
hoursArrow: false
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
369
|
-
ref: function ref(el) {
|
|
370
|
-
_this6.hoursList = el;
|
|
371
|
-
},
|
|
372
|
-
className: "hi-timepicker__list",
|
|
373
|
-
onClick: this.clickEvent.bind(this, 'hours')
|
|
374
|
-
}, this.liPrefix, this.range(24).map(function (m, n) {
|
|
375
|
-
var _class = (0, _classnames["default"])('hi-timepicker__item', n === hours && 'hi-timepicker__item--current');
|
|
376
|
-
|
|
377
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
378
|
-
key: n,
|
|
379
|
-
className: _class
|
|
380
|
-
}, m);
|
|
381
|
-
}), this.liSuffix), hoursArrow && this.renderArrow('hours')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
382
|
-
className: "hi-timepicker__list-container",
|
|
383
|
-
onMouseEnter: function onMouseEnter() {
|
|
384
|
-
return _this6.setState({
|
|
385
|
-
minutesArrow: true
|
|
386
|
-
});
|
|
387
|
-
},
|
|
388
|
-
onMouseLeave: function onMouseLeave() {
|
|
389
|
-
return _this6.setState({
|
|
390
|
-
minutesArrow: false
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
394
|
-
className: "hi-timepicker__list",
|
|
395
|
-
ref: function ref(el) {
|
|
396
|
-
_this6.minutesList = el;
|
|
397
|
-
},
|
|
398
|
-
onClick: this.clickEvent.bind(this, 'minutes')
|
|
399
|
-
}, this.liPrefix, this.range(60).map(function (m, n) {
|
|
400
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
401
|
-
key: n,
|
|
402
|
-
className: n === minutes ? 'hi-timepicker__item hi-timepicker__item--current' : 'hi-timepicker__item'
|
|
403
|
-
}, m);
|
|
404
|
-
}), this.liSuffix), minutesArrow && this.renderArrow('minutes')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
405
|
-
className: "hi-timepicker__list-container",
|
|
406
|
-
onMouseEnter: function onMouseEnter() {
|
|
407
|
-
return _this6.setState({
|
|
408
|
-
secondsArrow: true
|
|
409
|
-
});
|
|
410
|
-
},
|
|
411
|
-
onMouseLeave: function onMouseLeave() {
|
|
412
|
-
return _this6.setState({
|
|
413
|
-
secondsArrow: false
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
417
|
-
ref: function ref(el) {
|
|
418
|
-
_this6.secondsList = el;
|
|
419
|
-
},
|
|
420
|
-
className: "hi-timepicker__list",
|
|
421
|
-
onClick: this.clickEvent.bind(this, 'seconds')
|
|
422
|
-
}, this.liPrefix, this.range(60).map(function (m, n) {
|
|
423
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
424
|
-
key: n,
|
|
425
|
-
className: n === seconds ? 'hi-timepicker__item hi-timepicker__item--current' : 'hi-timepicker__item'
|
|
426
|
-
}, m);
|
|
427
|
-
}), this.liSuffix), secondsArrow && this.renderArrow('seconds')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
298
|
+
}, this.renderTimeList('hours'), this.renderTimeList('minutes'), this.renderTimeList('seconds'), _react["default"].createElement("div", {
|
|
428
299
|
className: "hi-timepicker__current-line",
|
|
429
300
|
style: {
|
|
430
|
-
top:
|
|
301
|
+
top: 108
|
|
431
302
|
}
|
|
432
303
|
})));
|
|
433
304
|
}
|
|
434
305
|
}]);
|
|
435
|
-
|
|
436
|
-
return TimePanel;
|
|
306
|
+
return Time;
|
|
437
307
|
}(_react.Component);
|
|
438
308
|
|
|
439
|
-
|
|
309
|
+
Time.defaultProps = {
|
|
310
|
+
hourStep: 1,
|
|
311
|
+
minuteStep: 1,
|
|
312
|
+
secondStep: 1,
|
|
313
|
+
format: 'HH:mm:ss',
|
|
314
|
+
disabledHours: function disabledHours() {
|
|
315
|
+
return [];
|
|
316
|
+
},
|
|
317
|
+
disabledMinutes: function disabledMinutes() {
|
|
318
|
+
return [];
|
|
319
|
+
},
|
|
320
|
+
disabledSeconds: function disabledSeconds() {
|
|
321
|
+
return [];
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var _default = Time;
|
|
325
|
+
exports["default"] = _default;
|