@hi-ui/hiui 3.9.5 → 3.9.7

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.
@@ -182,6 +182,7 @@ var BasePicker = function BasePicker(_ref) {
182
182
  }
183
183
 
184
184
  changeOutDate(oData);
185
+ callback(oData);
185
186
  }
186
187
  };
187
188
 
@@ -77,60 +77,34 @@ var Time = function Time(_ref) {
77
77
  if (PropsType === 'timerange' || PropsType === 'time' || PropsType === 'default' || showTime) {
78
78
  if (timeRangePanelType === 'right') {
79
79
  var _deconstructDate = (0, _utils.deconstructDate)(startDate),
80
+ year = _deconstructDate.year,
81
+ month = _deconstructDate.month,
82
+ sDate = _deconstructDate.date,
80
83
  hour = _deconstructDate.hour,
81
84
  minute = _deconstructDate.minute,
82
85
  second = _deconstructDate.second;
83
86
 
84
87
  var _ref2 = date ? (0, _utils.deconstructDate)(date) : (0, _utils.deconstructDate)(new Date()),
88
+ endYear = _ref2.year,
89
+ endMonth = _ref2.month,
90
+ endDate = _ref2.date,
85
91
  endHour = _ref2.hour,
86
- endMinute = _ref2.minute;
87
-
88
- var dateDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'days');
89
- var hourDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'hour');
90
- var minuteDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'minutes'); // 不在同一天
91
-
92
- if (dateDiff !== 0) {
93
- isDisabled = dateDiff < 0;
94
- } // 在同一天,则比较小时
95
- else {
96
- if (type === 'hour') {
97
- isDisabled = hour > i;
98
- } else {
99
- // 不在同一小时
100
- if (hourDiff !== 0) {
101
- isDisabled = hourDiff < 0;
102
- } // 在同一小时,则比较分钟
103
- else {
104
- if (type === 'minute') {
105
- if (endHour === hour) {
106
- isDisabled = minute > i;
107
- }
108
-
109
- if (endHour < hour) {
110
- isDisabled = true;
111
- }
112
- } else {
113
- // 不在同一分
114
- if (minuteDiff !== 0) {
115
- isDisabled = minuteDiff < 0;
116
- } // 在同一分钟,则比较秒
117
- else {
118
- if (endHour === hour) {
119
- isDisabled = endMinute === minute && second > i;
120
-
121
- if (endMinute < minute) {
122
- isDisabled = true;
123
- }
124
- }
125
-
126
- if (endHour < hour) {
127
- isDisabled = true;
128
- }
129
- }
130
- }
131
- }
132
- }
133
- }
92
+ endMinute = _ref2.minute,
93
+ endSecond = _ref2.second;
94
+
95
+ var start = new Date("".concat(year, "-").concat((0, _utils.convertMonth)(month), "-").concat(sDate, " ").concat(hour, ":").concat(minute, ":").concat(second));
96
+
97
+ if (type === 'hour') {
98
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(i, ":").concat(endMinute, ":").concat(endSecond));
99
+ }
100
+
101
+ if (type === 'minute') {
102
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(endHour, ":").concat(i, ":").concat(endSecond));
103
+ }
104
+
105
+ if (type === 'second') {
106
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(endHour, ":").concat(endMinute, ":").concat(i));
107
+ }
134
108
  }
135
109
 
136
110
  return isDisabled;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.normalizeWeekOffset = exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
8
+ exports.convertMonth = exports.normalizeWeekOffset = exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -354,4 +354,16 @@ var normalizeWeekOffset = function normalizeWeekOffset(date, weekOffset) {
354
354
  return clone;
355
355
  };
356
356
 
357
- exports.normalizeWeekOffset = normalizeWeekOffset;
357
+ exports.normalizeWeekOffset = normalizeWeekOffset;
358
+
359
+ var convertMonth = function convertMonth(month) {
360
+ if (typeof Number(month) !== 'number') {
361
+ return '01';
362
+ }
363
+
364
+ var _month = month + 1;
365
+
366
+ return _month < 10 ? '0' + _month : _month;
367
+ };
368
+
369
+ exports.convertMonth = convertMonth;
@@ -9,8 +9,12 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
15
 
16
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
+
14
18
  var _react = _interopRequireWildcard(require("react"));
15
19
 
16
20
  var _input = _interopRequireDefault(require("../input"));
@@ -38,7 +42,8 @@ var Search = function Search(_ref) {
38
42
  localeDatas = _ref.localeDatas,
39
43
  overlayClassName = _ref.overlayClassName,
40
44
  append = _ref.append,
41
- theme = _ref.theme;
45
+ theme = _ref.theme,
46
+ rest = (0, _objectWithoutProperties2["default"])(_ref, ["onChange", "onSearch", "style", "placeholder", "prepend", "disabled", "data", "value", "loading", "localeDatas", "overlayClassName", "append", "theme"]);
42
47
 
43
48
  var _useState = (0, _react.useState)(false),
44
49
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -192,7 +197,7 @@ var Search = function Search(_ref) {
192
197
  style: style
193
198
  }, /*#__PURE__*/_react["default"].createElement("div", {
194
199
  className: "".concat(prefixCls, "_input")
195
- }, /*#__PURE__*/_react["default"].createElement(_input["default"], {
200
+ }, /*#__PURE__*/_react["default"].createElement(_input["default"], (0, _extends2["default"])({}, rest, {
196
201
  ref: searchInputContainer,
197
202
  type: "text",
198
203
  value: inputVal,
@@ -213,7 +218,7 @@ var Search = function Search(_ref) {
213
218
  setFocusIndex(null);
214
219
  setSubFocusIndex(null);
215
220
  }
216
- }), append ? /*#__PURE__*/_react["default"].createElement("span", {
221
+ })), append ? /*#__PURE__*/_react["default"].createElement("span", {
217
222
  className: disabled ? 'disabled' : '',
218
223
  onClick: function onClick(e) {
219
224
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/hiui",
3
- "version": "3.9.5",
3
+ "version": "3.9.7",
4
4
  "description": "HIUI for React",
5
5
  "scripts": {
6
6
  "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",