@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
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
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 _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
+
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
+
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
+
|
|
26
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
27
|
+
|
|
28
|
+
var TimeList =
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
function (_Component) {
|
|
31
|
+
(0, _inherits2["default"])(TimeList, _Component);
|
|
32
|
+
|
|
33
|
+
function TimeList(props) {
|
|
34
|
+
var _this;
|
|
35
|
+
|
|
36
|
+
(0, _classCallCheck2["default"])(this, TimeList);
|
|
37
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TimeList).call(this, props));
|
|
38
|
+
var prefixCount = [1, 2, 3];
|
|
39
|
+
var suffixCount = [1, 2, 3];
|
|
40
|
+
_this.liPrefix = prefixCount.map(function (item, index) {
|
|
41
|
+
return _react["default"].createElement("li", {
|
|
42
|
+
className: "hi-timepicker__item hi-timepikcer__item--empty",
|
|
43
|
+
key: 'pre' + index
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
_this.liSuffix = suffixCount.map(function (item, index) {
|
|
47
|
+
return _react["default"].createElement("li", {
|
|
48
|
+
className: "hi-timepicker__item hi-timepikcer__item--empty",
|
|
49
|
+
key: 'suf' + index
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
_this.listRef = _react["default"].createRef(); // this.scrollEvent = this.scrollEvent.bind(this)
|
|
53
|
+
|
|
54
|
+
_this.state = {
|
|
55
|
+
showArrow: false
|
|
56
|
+
};
|
|
57
|
+
_this.timer = null;
|
|
58
|
+
_this.topValue_1 = 0;
|
|
59
|
+
_this.topValue_2 = 0;
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
(0, _createClass2["default"])(TimeList, [{
|
|
64
|
+
key: "scrollTo",
|
|
65
|
+
value: function scrollTo() {
|
|
66
|
+
var arrow = this.getStep();
|
|
67
|
+
var value = this.props.value;
|
|
68
|
+
var dVal = 32 / arrow;
|
|
69
|
+
this.listRef.current && (this.listRef.current.scrollTop = value * dVal);
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "componentDidUpdate",
|
|
73
|
+
value: function componentDidUpdate() {
|
|
74
|
+
this.scrollTo();
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "componentDidMount",
|
|
78
|
+
value: function componentDidMount() {
|
|
79
|
+
var _this2 = this;
|
|
80
|
+
|
|
81
|
+
// this.listRef.current.addEventListener('scroll', this.scrollEvent)
|
|
82
|
+
setTimeout(function () {
|
|
83
|
+
_this2.scrollTo();
|
|
84
|
+
}, 0);
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "componentWillUnmount",
|
|
88
|
+
value: function componentWillUnmount() {
|
|
89
|
+
window.clearTimeout(this.timer); // this.listRef.current.removeEventListener('scroll', this.scrollEvent)
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "getStep",
|
|
93
|
+
value: function getStep(direction) {
|
|
94
|
+
var _this$props = this.props,
|
|
95
|
+
hourStep = _this$props.hourStep,
|
|
96
|
+
minuteStep = _this$props.minuteStep,
|
|
97
|
+
secondStep = _this$props.secondStep,
|
|
98
|
+
type = _this$props.type;
|
|
99
|
+
var directionStep = direction && direction === 'up' ? -1 : 1;
|
|
100
|
+
var step = directionStep;
|
|
101
|
+
|
|
102
|
+
switch (type) {
|
|
103
|
+
case 'hours':
|
|
104
|
+
step = hourStep;
|
|
105
|
+
break;
|
|
106
|
+
|
|
107
|
+
case 'minutes':
|
|
108
|
+
step = minuteStep;
|
|
109
|
+
break;
|
|
110
|
+
|
|
111
|
+
case 'seconds':
|
|
112
|
+
step = secondStep;
|
|
113
|
+
break;
|
|
114
|
+
|
|
115
|
+
default:
|
|
116
|
+
step = directionStep;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (Number.isNaN(step) || step === -1) {
|
|
121
|
+
step = 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return step * directionStep;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "renderArrow",
|
|
128
|
+
value: function renderArrow(type) {
|
|
129
|
+
var _this3 = this;
|
|
130
|
+
|
|
131
|
+
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("span", {
|
|
132
|
+
className: "hi-timepicker__page-turn",
|
|
133
|
+
onClick: function onClick() {
|
|
134
|
+
return _this3.arrowEvent('up');
|
|
135
|
+
}
|
|
136
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
137
|
+
name: "up"
|
|
138
|
+
})), _react["default"].createElement("span", {
|
|
139
|
+
className: "hi-timepicker__page-turn",
|
|
140
|
+
onClick: function onClick() {
|
|
141
|
+
return _this3.arrowEvent('down');
|
|
142
|
+
}
|
|
143
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
144
|
+
name: "down"
|
|
145
|
+
})));
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "getdisabledType",
|
|
149
|
+
value: function getdisabledType(val) {
|
|
150
|
+
var datas = this.props.datas;
|
|
151
|
+
var isDisabled = false;
|
|
152
|
+
datas.forEach(function (data) {
|
|
153
|
+
if (data.value === val) {
|
|
154
|
+
isDisabled = data.disabled;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return isDisabled;
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "arrowEvent",
|
|
161
|
+
value: function arrowEvent(direction) {
|
|
162
|
+
var arrow = this.getStep(direction);
|
|
163
|
+
var st = this.listRef.current.scrollTop;
|
|
164
|
+
var val = Math.round(st * Math.abs(arrow) / 32);
|
|
165
|
+
this.props.onSelect(this.props.type, val + arrow, arrow);
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "isScrollStop",
|
|
169
|
+
value: function isScrollStop(val, el) {
|
|
170
|
+
var disabledList = this.props.disabledList;
|
|
171
|
+
this.topValue_2 = el.scrollTop;
|
|
172
|
+
|
|
173
|
+
if (this.topValue_1 === this.topValue_2) {
|
|
174
|
+
el.scrollTop = val * 32;
|
|
175
|
+
|
|
176
|
+
if (!disabledList.includes(val)) {
|
|
177
|
+
var arrow = this.getStep();
|
|
178
|
+
!this.getdisabledType(val) && this.props.onSelect(this.props.type, val * arrow);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "scrollEvent",
|
|
184
|
+
value: function scrollEvent(e) {
|
|
185
|
+
var type = this.props.type;
|
|
186
|
+
clearTimeout(this.timer);
|
|
187
|
+
var st = e.target.scrollTop;
|
|
188
|
+
this.topValue_1 = st;
|
|
189
|
+
var val = Math.round(st / 32);
|
|
190
|
+
|
|
191
|
+
if (type === 'hours' && val > 23 || (type === 'minutes' || type === 'seconds') && val > 59) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this.timer = setTimeout(this.isScrollStop.bind(this, val, e.target), 200);
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "clickEvent",
|
|
199
|
+
value: function clickEvent(type, e) {
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
var li = e.target;
|
|
202
|
+
if (li.nodeName !== 'LI') return false;
|
|
203
|
+
if (!li.textContent) return;
|
|
204
|
+
!this.getdisabledType(parseInt(li.textContent)) && this.props.onSelect(type, parseInt(li.textContent), e);
|
|
205
|
+
}
|
|
206
|
+
}, {
|
|
207
|
+
key: "render",
|
|
208
|
+
value: function render() {
|
|
209
|
+
var _this4 = this;
|
|
210
|
+
|
|
211
|
+
var showArrow = this.state.showArrow;
|
|
212
|
+
var _this$props2 = this.props,
|
|
213
|
+
type = _this$props2.type,
|
|
214
|
+
datas = _this$props2.datas;
|
|
215
|
+
return _react["default"].createElement("div", {
|
|
216
|
+
className: "hi-timepicker__list-container",
|
|
217
|
+
onMouseEnter: function onMouseEnter() {
|
|
218
|
+
return _this4.setState({
|
|
219
|
+
showArrow: true
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
onMouseLeave: function onMouseLeave() {
|
|
223
|
+
return _this4.setState({
|
|
224
|
+
showArrow: false
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}, _react["default"].createElement("ul", {
|
|
228
|
+
ref: this.listRef,
|
|
229
|
+
className: "hi-timepicker__list",
|
|
230
|
+
onClick: this.clickEvent.bind(this, type),
|
|
231
|
+
onScroll: this.scrollEvent.bind(this)
|
|
232
|
+
}, this.liPrefix, datas.map(function (data, index) {
|
|
233
|
+
var _class = (0, _classnames["default"])('hi-timepicker__item', data.current && 'hi-timepicker__item--current', data.disabled && 'hi-timepicker__item--disabled');
|
|
234
|
+
|
|
235
|
+
return _react["default"].createElement("li", {
|
|
236
|
+
key: index,
|
|
237
|
+
className: _class,
|
|
238
|
+
value: parseInt(data.text)
|
|
239
|
+
}, data.text);
|
|
240
|
+
}), this.liSuffix), showArrow && this.renderArrow(type));
|
|
241
|
+
}
|
|
242
|
+
}]);
|
|
243
|
+
return TimeList;
|
|
244
|
+
}(_react.Component);
|
|
245
|
+
|
|
246
|
+
exports["default"] = TimeList;
|
|
@@ -1,55 +1,42 @@
|
|
|
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 _Time = _interopRequireDefault(require("./Time"));
|
|
11
|
-
|
|
12
|
-
var _context = _interopRequireDefault(require("../context"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
33
|
-
|
|
34
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
35
|
-
|
|
36
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
-
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
39
25
|
|
|
40
|
-
|
|
26
|
+
var _Time = _interopRequireDefault(require("./Time"));
|
|
41
27
|
|
|
42
|
-
var
|
|
43
|
-
_inherits(TimePanel, _Component);
|
|
28
|
+
var _dateUtil = require("./dateUtil");
|
|
44
29
|
|
|
45
|
-
|
|
30
|
+
var TimePanel =
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
function (_Component) {
|
|
33
|
+
(0, _inherits2["default"])(TimePanel, _Component);
|
|
46
34
|
|
|
47
35
|
function TimePanel(props) {
|
|
48
36
|
var _this;
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_this = _super.call(this, props);
|
|
38
|
+
(0, _classCallCheck2["default"])(this, TimePanel);
|
|
39
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TimePanel).call(this, props));
|
|
53
40
|
_this.state = {
|
|
54
41
|
style: props.style
|
|
55
42
|
};
|
|
@@ -63,7 +50,7 @@ var TimePanel = /*#__PURE__*/function (_Component) {
|
|
|
63
50
|
return _this;
|
|
64
51
|
}
|
|
65
52
|
|
|
66
|
-
|
|
53
|
+
(0, _createClass2["default"])(TimePanel, [{
|
|
67
54
|
key: "onTimePick",
|
|
68
55
|
value: function onTimePick(date, bol) {
|
|
69
56
|
var showTime = this.props.showTime;
|
|
@@ -80,22 +67,22 @@ var TimePanel = /*#__PURE__*/function (_Component) {
|
|
|
80
67
|
var _this$props = this.props,
|
|
81
68
|
localeDatas = _this$props.localeDatas,
|
|
82
69
|
date = _this$props.date,
|
|
83
|
-
type = _this$props.type
|
|
84
|
-
|
|
70
|
+
type = _this$props.type,
|
|
71
|
+
format = _this$props.format;
|
|
72
|
+
return _react["default"].createElement("div", {
|
|
85
73
|
className: "hi-timepicker",
|
|
86
74
|
style: this.state.style
|
|
87
|
-
},
|
|
75
|
+
}, _react["default"].createElement(_Time["default"], (0, _extends2["default"])({}, this.props, {
|
|
76
|
+
format: format || 'HH:mm:ss',
|
|
88
77
|
localeDatas: localeDatas,
|
|
89
|
-
date: date,
|
|
78
|
+
date: (0, _dateUtil.isValid)(date) ? date : date.startDate,
|
|
90
79
|
onPick: this.onTimePick.bind(this),
|
|
91
80
|
onlyTime: type === 'time'
|
|
92
|
-
}));
|
|
81
|
+
})));
|
|
93
82
|
}
|
|
94
83
|
}]);
|
|
95
|
-
|
|
96
84
|
return TimePanel;
|
|
97
85
|
}(_react.Component);
|
|
98
86
|
|
|
99
|
-
var _default =
|
|
100
|
-
|
|
87
|
+
var _default = TimePanel;
|
|
101
88
|
exports["default"] = _default;
|
|
@@ -1,62 +1,45 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
var _context = _interopRequireDefault(require("../context"));
|
|
13
|
-
|
|
14
|
-
var _dateUtil = require("./dateUtil");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
-
|
|
36
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
38
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
43
25
|
|
|
44
|
-
var
|
|
45
|
-
_inherits(TimePeriodPanel, _Component);
|
|
26
|
+
var _dateUtil = require("./dateUtil");
|
|
46
27
|
|
|
47
|
-
|
|
28
|
+
var TimePeriodPanel =
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
function (_Component) {
|
|
31
|
+
(0, _inherits2["default"])(TimePeriodPanel, _Component);
|
|
48
32
|
|
|
49
33
|
function TimePeriodPanel(props) {
|
|
50
34
|
var _this;
|
|
51
35
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_this =
|
|
55
|
-
_this.listEl = /*#__PURE__*/_react["default"].createRef();
|
|
36
|
+
(0, _classCallCheck2["default"])(this, TimePeriodPanel);
|
|
37
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TimePeriodPanel).call(this, props));
|
|
38
|
+
_this.listEl = _react["default"].createRef();
|
|
56
39
|
return _this;
|
|
57
40
|
}
|
|
58
41
|
|
|
59
|
-
|
|
42
|
+
(0, _createClass2["default"])(TimePeriodPanel, [{
|
|
60
43
|
key: "calcInterval",
|
|
61
44
|
value: function calcInterval() {
|
|
62
45
|
var timeInterval = this.props.timeInterval;
|
|
@@ -92,7 +75,7 @@ var TimePeriodPanel = /*#__PURE__*/function (_Component) {
|
|
|
92
75
|
var _this2 = this;
|
|
93
76
|
|
|
94
77
|
setTimeout(function () {
|
|
95
|
-
_this2.listEl.current.scrollTop = _this2.getActiveIndex() * 37;
|
|
78
|
+
_this2.listEl.current && (_this2.listEl.current.scrollTop = _this2.getActiveIndex() * 37);
|
|
96
79
|
}, 0);
|
|
97
80
|
}
|
|
98
81
|
}, {
|
|
@@ -103,18 +86,18 @@ var TimePeriodPanel = /*#__PURE__*/function (_Component) {
|
|
|
103
86
|
onTimePeriodPick = _this$props2.onTimePeriodPick,
|
|
104
87
|
localeDatas = _this$props2.localeDatas;
|
|
105
88
|
var activeIndex = this.getActiveIndex();
|
|
106
|
-
return
|
|
89
|
+
return _react["default"].createElement("div", {
|
|
107
90
|
className: "hi-datepicker__time-period"
|
|
108
|
-
},
|
|
91
|
+
}, _react["default"].createElement("div", {
|
|
109
92
|
className: "hi-datepicker__period-header"
|
|
110
|
-
}, localeDatas.datePicker.timePeriod),
|
|
93
|
+
}, localeDatas.datePicker.timePeriod), _react["default"].createElement("div", {
|
|
111
94
|
className: "hi-datepicker__period-body"
|
|
112
|
-
},
|
|
95
|
+
}, _react["default"].createElement("ul", {
|
|
113
96
|
className: "hi-datepicker__period-list",
|
|
114
97
|
ref: this.listEl
|
|
115
98
|
}, list.map(function (item, index) {
|
|
116
99
|
var cls = (0, _classnames["default"])('hi-datepicker__period-item', activeIndex === index && 'hi-datepicker__period-item--active');
|
|
117
|
-
return
|
|
100
|
+
return _react["default"].createElement("li", {
|
|
118
101
|
className: cls,
|
|
119
102
|
key: index,
|
|
120
103
|
onClick: function onClick(e) {
|
|
@@ -125,10 +108,8 @@ var TimePeriodPanel = /*#__PURE__*/function (_Component) {
|
|
|
125
108
|
}))));
|
|
126
109
|
}
|
|
127
110
|
}]);
|
|
128
|
-
|
|
129
111
|
return TimePeriodPanel;
|
|
130
112
|
}(_react.Component);
|
|
131
113
|
|
|
132
|
-
var _default =
|
|
133
|
-
|
|
114
|
+
var _default = TimePeriodPanel;
|
|
134
115
|
exports["default"] = _default;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
exports["default"] = void 0;
|
|
8
|
+
exports.TimePicker = exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
7
21
|
|
|
8
22
|
var _react = _interopRequireDefault(require("react"));
|
|
9
23
|
|
|
@@ -19,76 +33,60 @@ var _context = _interopRequireDefault(require("../context"));
|
|
|
19
33
|
|
|
20
34
|
var _TimeRangePanel = _interopRequireDefault(require("./TimeRangePanel"));
|
|
21
35
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
-
|
|
30
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
-
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
33
|
-
|
|
34
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
-
|
|
36
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
|
-
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
41
|
-
|
|
42
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
-
|
|
46
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
|
-
var TimePicker = /*#__PURE__*/function (_BasePicker) {
|
|
49
|
-
_inherits(TimePicker, _BasePicker);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(TimePicker);
|
|
36
|
+
var TimePicker =
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
function (_BasePicker) {
|
|
39
|
+
(0, _inherits2["default"])(TimePicker, _BasePicker);
|
|
52
40
|
|
|
53
41
|
function TimePicker() {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return _super.apply(this, arguments);
|
|
42
|
+
(0, _classCallCheck2["default"])(this, TimePicker);
|
|
43
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TimePicker).apply(this, arguments));
|
|
57
44
|
}
|
|
58
45
|
|
|
59
|
-
|
|
46
|
+
(0, _createClass2["default"])(TimePicker, [{
|
|
60
47
|
key: "initPanel",
|
|
61
48
|
value: function initPanel(state, props) {
|
|
62
|
-
return props.type === 'time' ?
|
|
49
|
+
return props.type === 'time' ? _react["default"].createElement(_TimePanel["default"], (0, _extends2["default"])({}, props, {
|
|
63
50
|
onPick: this.onPick.bind(this),
|
|
64
51
|
style: state.style,
|
|
65
|
-
date: state.date
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})) : /*#__PURE__*/_react["default"].createElement(_TimeRangePanel["default"], _extends({}, props, {
|
|
52
|
+
date: state.date
|
|
53
|
+
})) : _react["default"].createElement(_TimeRangePanel["default"], (0, _extends2["default"])({}, props, {
|
|
54
|
+
isCheckTime: true,
|
|
69
55
|
onPick: this.onPick.bind(this),
|
|
70
56
|
style: state.style,
|
|
71
|
-
date: state.date
|
|
72
|
-
timeConfirm: this.timeConfirm.bind(this),
|
|
73
|
-
timeCancel: this.timeCancel.bind(this)
|
|
57
|
+
date: state.date
|
|
74
58
|
}));
|
|
75
59
|
}
|
|
76
60
|
}]);
|
|
77
|
-
|
|
78
61
|
return TimePicker;
|
|
79
62
|
}(_BasePicker2["default"]);
|
|
80
63
|
|
|
64
|
+
exports.TimePicker = TimePicker;
|
|
81
65
|
TimePicker.propTypes = {
|
|
82
66
|
type: _propTypes["default"].oneOf(Object.values(_Type["default"])),
|
|
83
67
|
date: _propTypes["default"].instanceOf(Date),
|
|
84
68
|
size: _propTypes["default"].string,
|
|
85
69
|
onChange: _propTypes["default"].func,
|
|
86
|
-
format: _propTypes["default"].string
|
|
70
|
+
format: _propTypes["default"].string,
|
|
71
|
+
hourStep: _propTypes["default"].number,
|
|
72
|
+
minuteStep: _propTypes["default"].number,
|
|
73
|
+
secondStep: _propTypes["default"].number,
|
|
74
|
+
clearable: _propTypes["default"].bool
|
|
87
75
|
};
|
|
88
76
|
TimePicker.defaultProps = {
|
|
89
77
|
type: 'time',
|
|
90
78
|
format: 'HH:mm:ss',
|
|
91
|
-
disabled: false
|
|
79
|
+
disabled: false,
|
|
80
|
+
clearable: true,
|
|
81
|
+
disabledHours: function disabledHours() {
|
|
82
|
+
return [];
|
|
83
|
+
},
|
|
84
|
+
disabledMinutes: function disabledMinutes() {
|
|
85
|
+
return [];
|
|
86
|
+
},
|
|
87
|
+
disabledSeconds: function disabledSeconds() {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
92
90
|
};
|
|
93
91
|
|
|
94
92
|
var _default = (0, _context["default"])(TimePicker);
|