@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
|
@@ -1,152 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
6
|
exports["default"] = void 0;
|
|
11
7
|
|
|
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
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
9
|
|
|
28
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
29
|
-
|
|
30
10
|
var _util = require("./util");
|
|
31
11
|
|
|
32
12
|
var _context = _interopRequireDefault(require("../context"));
|
|
33
13
|
|
|
34
|
-
var
|
|
14
|
+
var _dateUtil = require("./dateUtil");
|
|
35
15
|
|
|
36
16
|
var _constants = require("./constants");
|
|
37
17
|
|
|
38
|
-
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
19
|
|
|
40
|
-
function _getRequireWildcardCache(
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
41
21
|
|
|
42
|
-
function _interopRequireWildcard(obj
|
|
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; }
|
|
43
23
|
|
|
44
|
-
function
|
|
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); }
|
|
45
25
|
|
|
46
|
-
function
|
|
26
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
47
27
|
|
|
48
|
-
function
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
49
29
|
|
|
50
|
-
function
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
51
31
|
|
|
52
|
-
|
|
53
|
-
(0, _inherits2["default"])(Calender, _Component);
|
|
32
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
54
33
|
|
|
55
|
-
|
|
34
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
var _this;
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
_this = _super.call(this, props);
|
|
62
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showHolidayTimeId", null);
|
|
63
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "showHolidayDetail", function (fullTimeInfo) {
|
|
64
|
-
clearTimeout(_this.showHolidayTimeId);
|
|
65
|
-
|
|
66
|
-
_this.setState({
|
|
67
|
-
show: true,
|
|
68
|
-
holidayFullName: fullTimeInfo.FullText || fullTimeInfo.text
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
_this.showHolidayTimeId = setTimeout(function () {
|
|
72
|
-
_this.setState({
|
|
73
|
-
show: false
|
|
74
|
-
});
|
|
75
|
-
}, 2000);
|
|
76
|
-
});
|
|
77
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "altCalendarText", function (datainfo, lunarcellinfo) {
|
|
78
|
-
var altCalendarPresetData = _this.props.altCalendarPresetData;
|
|
79
|
-
|
|
80
|
-
if (altCalendarPresetData && altCalendarPresetData[datainfo]) {
|
|
81
|
-
return altCalendarPresetData[datainfo].text || altCalendarPresetData[datainfo];
|
|
82
|
-
}
|
|
38
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
83
39
|
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "altCalendar", function (td) {
|
|
87
|
-
var _this$props = _this.props,
|
|
88
|
-
layerType = _this$props.type,
|
|
89
|
-
date = _this$props.date,
|
|
90
|
-
altCalendarPresetData = _this$props.altCalendarPresetData,
|
|
91
|
-
dateMarkPresetData = _this$props.dateMarkPresetData,
|
|
92
|
-
altCalendarPreset = _this$props.altCalendarPreset;
|
|
93
|
-
var nDate = (0, _dateUtil.getYear)(new Date());
|
|
94
|
-
var propDate = (0, _dateUtil.getYear)(date);
|
|
95
|
-
var isAddToday = nDate === propDate;
|
|
96
|
-
var _class = [];
|
|
40
|
+
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); } }
|
|
97
41
|
|
|
98
|
-
|
|
99
|
-
case 'normal':
|
|
100
|
-
_class.push('normal');
|
|
42
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
101
43
|
|
|
102
|
-
|
|
44
|
+
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); }
|
|
103
45
|
|
|
104
|
-
|
|
105
|
-
layerType !== 'week' && _class.push('today');
|
|
106
|
-
layerType === 'month' && !isAddToday && _class.pop();
|
|
107
|
-
break;
|
|
46
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
108
47
|
|
|
109
|
-
|
|
110
|
-
_class.push('current');
|
|
48
|
+
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); }; }
|
|
111
49
|
|
|
112
|
-
|
|
50
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
113
51
|
|
|
114
|
-
|
|
115
|
-
_class.push(td.type);
|
|
52
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
116
53
|
|
|
117
|
-
|
|
118
|
-
}
|
|
54
|
+
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; } }
|
|
119
55
|
|
|
120
|
-
|
|
121
|
-
var fullTimeInfo = _this.getFullTime(td.value, _class);
|
|
56
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
122
57
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
className: "hi-datepicker__text--showLunar"
|
|
135
|
-
}, fullTimeInfo.text)) : null);
|
|
136
|
-
} else {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
58
|
+
var Calender = /*#__PURE__*/function (_Component) {
|
|
59
|
+
_inherits(Calender, _Component);
|
|
60
|
+
|
|
61
|
+
var _super = _createSuper(Calender);
|
|
62
|
+
|
|
63
|
+
function Calender(props) {
|
|
64
|
+
var _this;
|
|
65
|
+
|
|
66
|
+
_classCallCheck(this, Calender);
|
|
67
|
+
|
|
68
|
+
_this = _super.call(this, props);
|
|
140
69
|
_this.state = {
|
|
141
|
-
rows: [[], [], [], [], [], []]
|
|
142
|
-
show: false
|
|
70
|
+
rows: [[], [], [], [], [], []]
|
|
143
71
|
};
|
|
144
72
|
_this.weekNum = 0;
|
|
145
|
-
_this.months = props.localeDatas.datePicker.month;
|
|
146
73
|
return _this;
|
|
147
74
|
}
|
|
148
75
|
|
|
149
|
-
(
|
|
76
|
+
_createClass(Calender, [{
|
|
150
77
|
key: "_getTime",
|
|
151
78
|
value: function _getTime(week, y, m) {
|
|
152
79
|
var r = new Date(y, m - 1, 1);
|
|
@@ -158,15 +85,13 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
158
85
|
}, {
|
|
159
86
|
key: "getRows",
|
|
160
87
|
value: function getRows() {
|
|
161
|
-
var _this$
|
|
162
|
-
type = _this$
|
|
163
|
-
range = _this$
|
|
164
|
-
|
|
165
|
-
minDate = _this$
|
|
166
|
-
maxDate = _this$
|
|
167
|
-
weekOffset = _this$
|
|
168
|
-
disabledDate = _this$props2.disabledDate;
|
|
169
|
-
var _date = date;
|
|
88
|
+
var _this$props = this.props,
|
|
89
|
+
type = _this$props.type,
|
|
90
|
+
range = _this$props.range,
|
|
91
|
+
_date = _this$props.date,
|
|
92
|
+
minDate = _this$props.minDate,
|
|
93
|
+
maxDate = _this$props.maxDate,
|
|
94
|
+
weekOffset = _this$props.weekOffset;
|
|
170
95
|
|
|
171
96
|
var _deconstructDate = (0, _util.deconstructDate)(_date, weekOffset),
|
|
172
97
|
year = _deconstructDate.year,
|
|
@@ -185,11 +110,9 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
185
110
|
|
|
186
111
|
var firstDayWeek = (0, _dateUtil.getDay)((0, _dateUtil.startOfMonth)(_date)) - weekOffset;
|
|
187
112
|
|
|
188
|
-
if (firstDayWeek
|
|
113
|
+
if (firstDayWeek <= 0) {
|
|
189
114
|
// 如果为0 代表该月第一天是周日,在日历上需要第二行开始显示
|
|
190
115
|
firstDayWeek = 7;
|
|
191
|
-
} else if (firstDayWeek < 0) {
|
|
192
|
-
firstDayWeek = 6;
|
|
193
116
|
}
|
|
194
117
|
|
|
195
118
|
var startTimeByCurrentPanel = this._getTime(firstDayWeek, year, month); // 当前日期面板中第一个日期的具体毫秒数(指向上一个月)
|
|
@@ -235,9 +158,12 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
235
158
|
col.value = count - dayCount;
|
|
236
159
|
col.type = 'next';
|
|
237
160
|
}
|
|
238
|
-
}
|
|
161
|
+
} // if (range && (isSameDay(range.startDate, currentTime) || isSameDay(range.endDate, currentTime))) {
|
|
162
|
+
// col.type = 'current'
|
|
163
|
+
// }
|
|
239
164
|
|
|
240
|
-
|
|
165
|
+
|
|
166
|
+
if ((0, _dateUtil.isToday)(currentTime)) {
|
|
241
167
|
col.type = 'today';
|
|
242
168
|
}
|
|
243
169
|
|
|
@@ -246,30 +172,16 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
246
172
|
}
|
|
247
173
|
|
|
248
174
|
if (type === 'daterange' || type === 'weekrange') {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (sv) {
|
|
253
|
-
col.rangeStart = startDate && (0, _dateUtil.isSameDay)(currentTime, startDate);
|
|
254
|
-
}
|
|
175
|
+
col.rangeStart = startDate && (0, _dateUtil.isSameDay)(currentTime, startDate);
|
|
176
|
+
col.rangeEnd = endDate && (0, _dateUtil.isSameDay)(currentTime, endDate);
|
|
255
177
|
|
|
256
|
-
|
|
257
|
-
col.rangeEnd = endDate && (0, _dateUtil.isSameDay)(currentTime, endDate);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (sv && ev) {
|
|
261
|
-
var _ds = [startDate, endDate].sort(_dateUtil.compareAsc);
|
|
262
|
-
|
|
263
|
-
col.range = endDate && (0, _dateUtil.isWithinInterval)((0, _dateUtil.toDate)(currentTime), {
|
|
264
|
-
start: _ds[0],
|
|
265
|
-
end: _ds[1]
|
|
266
|
-
});
|
|
267
|
-
}
|
|
178
|
+
var _ds = [startDate, endDate].sort(_dateUtil.compareAsc);
|
|
268
179
|
|
|
180
|
+
col.range = endDate && _dateUtil.isWithinRange.apply(void 0, [currentTime].concat(_toConsumableArray(_ds)));
|
|
269
181
|
row.weekNum = (0, _util.getYearWeek)(new Date(currentTime), weekOffset).weekNum;
|
|
270
182
|
}
|
|
271
183
|
|
|
272
|
-
col.disabled = minDate && (0, _dateUtil.compareAsc)(currentTime,
|
|
184
|
+
col.disabled = minDate && (0, _dateUtil.compareAsc)(currentTime, minDate) === -1 || maxDate && (0, _dateUtil.compareAsc)(currentTime, maxDate) === 1;
|
|
273
185
|
}
|
|
274
186
|
|
|
275
187
|
if (type === 'week') {
|
|
@@ -324,17 +236,15 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
324
236
|
}, {
|
|
325
237
|
key: "handlerClick",
|
|
326
238
|
value: function handlerClick(e) {
|
|
327
|
-
var _this$
|
|
328
|
-
onPick = _this$
|
|
329
|
-
date = _this$
|
|
330
|
-
type = _this$
|
|
331
|
-
range = _this$
|
|
332
|
-
onSelect = _this$props3.onSelect;
|
|
239
|
+
var _this$props2 = this.props,
|
|
240
|
+
onPick = _this$props2.onPick,
|
|
241
|
+
date = _this$props2.date,
|
|
242
|
+
type = _this$props2.type,
|
|
243
|
+
range = _this$props2.range;
|
|
333
244
|
|
|
334
245
|
var _deconstructDate2 = (0, _util.deconstructDate)(date),
|
|
335
246
|
year = _deconstructDate2.year,
|
|
336
247
|
month = _deconstructDate2.month,
|
|
337
|
-
day = _deconstructDate2.day,
|
|
338
248
|
hours = _deconstructDate2.hours,
|
|
339
249
|
minutes = _deconstructDate2.minutes,
|
|
340
250
|
seconds = _deconstructDate2.seconds;
|
|
@@ -346,16 +256,8 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
346
256
|
var value = td.getAttribute('value');
|
|
347
257
|
if (td.nodeName !== 'SPAN' && td.nodeName !== 'TD' && td.nodeName !== 'DIV' || td.disabled) return false;
|
|
348
258
|
if (cls.indexOf('disabled') !== -1) return false;
|
|
349
|
-
var
|
|
350
|
-
var newDate = new Date(year, month - 1
|
|
351
|
-
|
|
352
|
-
if (type === 'year' || type === 'yearrange') {
|
|
353
|
-
year = parseInt(value);
|
|
354
|
-
newDate.setFullYear(year);
|
|
355
|
-
} else if (type === 'month' || type === 'monthrange') {
|
|
356
|
-
month = parseInt(value);
|
|
357
|
-
newDate.setMonth(month - 1);
|
|
358
|
-
}
|
|
259
|
+
var day = parseInt(value);
|
|
260
|
+
var newDate = new Date(year, month - 1);
|
|
359
261
|
|
|
360
262
|
if (cls.indexOf('prev') !== -1) {
|
|
361
263
|
newDate = (0, _dateUtil.addMonths)(newDate, -1);
|
|
@@ -365,28 +267,33 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
365
267
|
newDate = (0, _dateUtil.addMonths)(newDate, 1);
|
|
366
268
|
}
|
|
367
269
|
|
|
368
|
-
|
|
369
|
-
|
|
270
|
+
newDate.setDate(day);
|
|
271
|
+
newDate.setHours(hours, minutes, seconds);
|
|
272
|
+
|
|
273
|
+
if (type === 'year') {
|
|
274
|
+
year = parseInt(value);
|
|
275
|
+
newDate.setFullYear(year);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (type === 'month') {
|
|
279
|
+
month = parseInt(value);
|
|
280
|
+
newDate.setMonth(month - 1);
|
|
370
281
|
}
|
|
371
282
|
|
|
372
|
-
if (type === 'daterange' || type === 'weekrange'
|
|
283
|
+
if (type === 'daterange' || type === 'weekrange') {
|
|
373
284
|
if (range.selecting) {
|
|
374
285
|
if (range.startDate > newDate) {
|
|
375
286
|
range.selecting = false;
|
|
376
|
-
onSelect(newDate, true);
|
|
377
287
|
onPick(newDate, range.startDate);
|
|
378
288
|
} else {
|
|
379
289
|
range.selecting = false;
|
|
380
|
-
onSelect(newDate, true);
|
|
381
290
|
onPick(range.startDate, newDate);
|
|
382
291
|
}
|
|
383
292
|
} else {
|
|
384
293
|
range.selecting = true;
|
|
385
|
-
onSelect(newDate, false);
|
|
386
294
|
onPick(newDate, null);
|
|
387
295
|
}
|
|
388
296
|
} else {
|
|
389
|
-
onSelect(newDate, true);
|
|
390
297
|
onPick(newDate);
|
|
391
298
|
}
|
|
392
299
|
}
|
|
@@ -394,11 +301,11 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
394
301
|
key: "handlerMouseMove",
|
|
395
302
|
value: function handlerMouseMove(e) {
|
|
396
303
|
var td = e.target;
|
|
397
|
-
var _this$
|
|
398
|
-
mouseMove = _this$
|
|
399
|
-
date = _this$
|
|
400
|
-
type = _this$
|
|
401
|
-
range = _this$
|
|
304
|
+
var _this$props3 = this.props,
|
|
305
|
+
mouseMove = _this$props3.mouseMove,
|
|
306
|
+
date = _this$props3.date,
|
|
307
|
+
type = _this$props3.type,
|
|
308
|
+
range = _this$props3.range;
|
|
402
309
|
|
|
403
310
|
var _deconstructDate3 = (0, _util.deconstructDate)(date),
|
|
404
311
|
year = _deconstructDate3.year,
|
|
@@ -406,7 +313,7 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
406
313
|
|
|
407
314
|
if (td.nodeName !== 'SPAN' || td.disabled || type.indexOf('range') === -1 || !range.selecting) return false;
|
|
408
315
|
td = td.parentNode.parentNode;
|
|
409
|
-
var day = parseInt(td.
|
|
316
|
+
var day = parseInt(td.innerText);
|
|
410
317
|
var cls = td.className;
|
|
411
318
|
var newDate = new Date(year, month - 1, day);
|
|
412
319
|
|
|
@@ -418,148 +325,19 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
418
325
|
newDate = (0, _dateUtil.addMonths)(newDate, 1);
|
|
419
326
|
}
|
|
420
327
|
|
|
421
|
-
if (type === 'yearrange') {
|
|
422
|
-
newDate = new Date(day + '');
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (type === 'monthrange') {
|
|
426
|
-
newDate = new Date(year, this.months.indexOf(td.textContent));
|
|
427
|
-
}
|
|
428
|
-
|
|
429
328
|
mouseMove(newDate);
|
|
430
329
|
}
|
|
431
|
-
}, {
|
|
432
|
-
key: "getMarkNode",
|
|
433
|
-
value: function getMarkNode(node) {
|
|
434
|
-
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
435
|
-
className: "hi-datepicker__text\u2014\u2014holiday"
|
|
436
|
-
}, node);
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* 获取完整时间
|
|
440
|
-
* @param {*} value 日
|
|
441
|
-
* @param {*} cls className
|
|
442
|
-
*/
|
|
443
|
-
|
|
444
|
-
}, {
|
|
445
|
-
key: "getFullTime",
|
|
446
|
-
value: function getFullTime(value, cls) {
|
|
447
|
-
var _this$props5 = this.props,
|
|
448
|
-
date = _this$props5.date,
|
|
449
|
-
type = _this$props5.type,
|
|
450
|
-
altCalendarPreset = _this$props5.altCalendarPreset,
|
|
451
|
-
altCalendar = _this$props5.altCalendar,
|
|
452
|
-
dateMarkRender = _this$props5.dateMarkRender,
|
|
453
|
-
altCalendarPresetData = _this$props5.altCalendarPresetData,
|
|
454
|
-
dateMarkPresetData = _this$props5.dateMarkPresetData;
|
|
455
|
-
|
|
456
|
-
var _deconstructDate4 = (0, _util.deconstructDate)(date),
|
|
457
|
-
year = _deconstructDate4.year,
|
|
458
|
-
month = _deconstructDate4.month,
|
|
459
|
-
day = _deconstructDate4.day,
|
|
460
|
-
hours = _deconstructDate4.hours,
|
|
461
|
-
minutes = _deconstructDate4.minutes,
|
|
462
|
-
seconds = _deconstructDate4.seconds;
|
|
463
|
-
|
|
464
|
-
if (cls.indexOf('disabled') !== -1) return false;
|
|
465
|
-
var clickVal = parseInt(value);
|
|
466
|
-
var newDate = new Date(year, month - 1, day, hours, minutes, seconds);
|
|
467
|
-
|
|
468
|
-
if (type === 'year') {
|
|
469
|
-
year = parseInt(value);
|
|
470
|
-
newDate.setFullYear(year);
|
|
471
|
-
} else if (type === 'month') {
|
|
472
|
-
month = parseInt(value);
|
|
473
|
-
newDate.setMonth(month - 1);
|
|
474
|
-
} else {
|
|
475
|
-
newDate.setDate(clickVal);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (cls.indexOf('prev') !== -1) {
|
|
479
|
-
newDate = (0, _dateUtil.addMonths)(newDate, -1);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
if (cls.indexOf('next') !== -1) {
|
|
483
|
-
newDate = (0, _dateUtil.addMonths)(newDate, 1);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
var _year = (0, _dateUtil.getYear)(newDate);
|
|
487
|
-
|
|
488
|
-
var _month = (0, _dateUtil.getMonth)(newDate) + 1;
|
|
489
|
-
|
|
490
|
-
var _value = type === 'year' ? 1 : value;
|
|
491
|
-
|
|
492
|
-
var datainfo = _year + '/' + _month + '/' + _value;
|
|
493
|
-
|
|
494
|
-
var LunarInfo = _toLunar["default"].toLunar(_year, _month, _value);
|
|
495
|
-
|
|
496
|
-
var lunarcellinfo = {
|
|
497
|
-
text: altCalendarPreset === 'zh-CN' ? LunarInfo[6] : null,
|
|
498
|
-
// 默认预置信息
|
|
499
|
-
highlight: false
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
if (altCalendar || dateMarkRender) {
|
|
503
|
-
lunarcellinfo = {
|
|
504
|
-
text: this.altCalendarText(datainfo, lunarcellinfo),
|
|
505
|
-
highlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].highlight,
|
|
506
|
-
nodeMark: this.markRender(datainfo)
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
if (dateMarkPresetData && dateMarkPresetData[datainfo] || altCalendarPresetData && altCalendarPresetData[datainfo]) {
|
|
511
|
-
lunarcellinfo = {
|
|
512
|
-
text: this.altCalendarText(datainfo, lunarcellinfo),
|
|
513
|
-
highlight: altCalendarPresetData && altCalendarPresetData[datainfo] && altCalendarPresetData[datainfo].highlight,
|
|
514
|
-
nodeMark: this.markRender(datainfo)
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
return _objectSpread(_objectSpread({}, altCalendarPresetData[datainfo]), lunarcellinfo);
|
|
519
|
-
}
|
|
520
|
-
}, {
|
|
521
|
-
key: "markRender",
|
|
522
|
-
value: function markRender(datainfo) {
|
|
523
|
-
// 存在传入自定就优先使用自定义
|
|
524
|
-
var _this$props6 = this.props,
|
|
525
|
-
dateMarkRender = _this$props6.dateMarkRender,
|
|
526
|
-
dateMarkPresetData = _this$props6.dateMarkPresetData;
|
|
527
|
-
var markRenderNode = dateMarkRender ? dateMarkRender(new Date(datainfo).getTime(), new Date().getTime()) : false;
|
|
528
|
-
|
|
529
|
-
if (markRenderNode) {
|
|
530
|
-
return this.getMarkNode(markRenderNode);
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
if (dateMarkPresetData) {
|
|
534
|
-
return dateMarkPresetData[datainfo];
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return null;
|
|
538
|
-
}
|
|
539
330
|
}, {
|
|
540
331
|
key: "getTDClass",
|
|
541
|
-
value: function getTDClass(td
|
|
542
|
-
var _this$props7 = this.props,
|
|
543
|
-
layerType = _this$props7.type,
|
|
544
|
-
date = _this$props7.date;
|
|
332
|
+
value: function getTDClass(td) {
|
|
545
333
|
var _class = ['hi-datepicker__cell'];
|
|
546
334
|
|
|
547
|
-
if ((0, _util.showLargeCalendar)(this.props)) {
|
|
548
|
-
_class.push('hi-datepicker__cell--large');
|
|
549
|
-
|
|
550
|
-
_index === 6 && _class.push('hi-datepicker__cell--large--laster');
|
|
551
|
-
}
|
|
552
|
-
|
|
553
335
|
if (td.disabled) {
|
|
554
336
|
_class.push('disabled');
|
|
555
337
|
|
|
556
338
|
return _class.join(' ');
|
|
557
339
|
}
|
|
558
340
|
|
|
559
|
-
var nDate = (0, _dateUtil.getYear)(new Date());
|
|
560
|
-
var propDate = (0, _dateUtil.getYear)(date);
|
|
561
|
-
var isAddToday = nDate === propDate;
|
|
562
|
-
|
|
563
341
|
switch (td.type) {
|
|
564
342
|
case 'normal':
|
|
565
343
|
_class.push('normal');
|
|
@@ -567,8 +345,7 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
567
345
|
break;
|
|
568
346
|
|
|
569
347
|
case 'today':
|
|
570
|
-
|
|
571
|
-
layerType === 'month' && !isAddToday && _class.pop();
|
|
348
|
+
this.props.type !== 'week' && _class.push('today');
|
|
572
349
|
break;
|
|
573
350
|
|
|
574
351
|
case 'current':
|
|
@@ -593,9 +370,9 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
593
370
|
}, {
|
|
594
371
|
key: "getWeeks",
|
|
595
372
|
value: function getWeeks() {
|
|
596
|
-
var _this$
|
|
597
|
-
weekOffset = _this$
|
|
598
|
-
localeDatas = _this$
|
|
373
|
+
var _this$props4 = this.props,
|
|
374
|
+
weekOffset = _this$props4.weekOffset,
|
|
375
|
+
localeDatas = _this$props4.localeDatas;
|
|
599
376
|
var week = localeDatas.datePicker.week;
|
|
600
377
|
return week.slice(weekOffset).concat(week.slice(0, weekOffset));
|
|
601
378
|
}
|
|
@@ -613,22 +390,11 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
613
390
|
value: function render() {
|
|
614
391
|
var _this2 = this;
|
|
615
392
|
|
|
616
|
-
var _this$
|
|
617
|
-
type = _this$
|
|
618
|
-
data = _this$
|
|
619
|
-
var _this$state = this.state,
|
|
620
|
-
show = _this$state.show,
|
|
621
|
-
holidayFullName = _this$state.holidayFullName;
|
|
393
|
+
var _this$props5 = this.props,
|
|
394
|
+
type = _this$props5.type,
|
|
395
|
+
data = _this$props5.data;
|
|
622
396
|
var rows = data || this.getRows();
|
|
623
|
-
return /*#__PURE__*/_react["default"].createElement("
|
|
624
|
-
"in": show,
|
|
625
|
-
timeout: 300,
|
|
626
|
-
classNames: "hi-datepicker__indiaHoli"
|
|
627
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
628
|
-
className: "hi-datepicker__indiaHoli"
|
|
629
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
630
|
-
className: "hi-datepicker__indiaHoli-text"
|
|
631
|
-
}, holidayFullName))), /*#__PURE__*/_react["default"].createElement("table", {
|
|
397
|
+
return /*#__PURE__*/_react["default"].createElement("table", {
|
|
632
398
|
className: "hi-datepicker__calender",
|
|
633
399
|
onClick: this.handlerClick.bind(this),
|
|
634
400
|
onMouseMove: this.handlerMouseMove.bind(this)
|
|
@@ -645,21 +411,19 @@ var Calender = /*#__PURE__*/function (_Component) {
|
|
|
645
411
|
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
646
412
|
key: _index,
|
|
647
413
|
value: cell.value,
|
|
648
|
-
className: _this2.getTDClass(cell
|
|
649
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
650
|
-
className: "hi-datepicker__content__wrap",
|
|
651
|
-
value: cell.value
|
|
414
|
+
className: _this2.getTDClass(cell)
|
|
652
415
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
653
416
|
className: "hi-datepicker__content",
|
|
654
417
|
value: cell.value
|
|
655
418
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
656
419
|
value: cell.value,
|
|
657
420
|
className: "hi-datepicker__text"
|
|
658
|
-
}, cell.text || cell.value))
|
|
421
|
+
}, cell.text || cell.value)));
|
|
659
422
|
}));
|
|
660
|
-
})))
|
|
423
|
+
})));
|
|
661
424
|
}
|
|
662
425
|
}]);
|
|
426
|
+
|
|
663
427
|
return Calender;
|
|
664
428
|
}(_react.Component);
|
|
665
429
|
|