react-picky-date-time 1.7.1 → 1.8.0
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/README.md +6 -5
- package/lib/components/Calendar/index.js +38 -17
- package/lib/components/Clock/index.js +15 -15
- package/lib/components/constValue.js +3 -3
- package/lib/components/index.js +11 -6
- package/lib/components/locale.js +1 -1
- package/lib/react-picky-date-time.js +2 -2
- package/lib/react-picky-date-time.js.map +1 -1
- package/lib/react-picky-date-time.min.js +2 -2
- package/lib/react-picky-date-time.min.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# react-picky-date-time
|
|
2
|
-
[](https://badge.fury.io/js/react-picky-date-time)  [](https://raw.githubusercontent.com/
|
|
2
|
+
[](https://badge.fury.io/js/react-picky-date-time)  [](https://raw.githubusercontent.com/edwardfxiao/react-picky-date-time/master/LICENSE)[](https://github.com/996icu/996.ICU/blob/master/LICENSE)[](https://996.icu)
|
|
3
3
|
|
|
4
4
|
A react component for date time picker.
|
|
5
5
|
|
|
6
|
-
<img src="https://raw.githubusercontent.com/
|
|
6
|
+
<img src="https://raw.githubusercontent.com/edwardfxiao/react-picky-date-time/master/react-picky-date-time.gif" />
|
|
7
7
|
|
|
8
8
|
NO Jquery, NO Moment.js
|
|
9
9
|
|
|
10
|
-
### :tada: For range surpport, please take a look at <a href="https://github.com/
|
|
10
|
+
### :tada: For range surpport, please take a look at <a href="https://github.com/edwardfxiao/react-minimal-datetime-range">react-minimal-datetime-range</a>
|
|
11
11
|
|
|
12
12
|
# Demo & Examples
|
|
13
|
-
Please check the <a href="https://
|
|
13
|
+
Please check the <a href="https://edwardfxiao.github.io/react-picky-date-time/">online demo example</a>
|
|
14
14
|
|
|
15
|
-
Attention: <a href="https://github.com/
|
|
15
|
+
Attention: <a href="https://github.com/edwardfxiao/react-picky-date-time/blob/gh-pages/example/index.js">you can find demo source here :)</a>
|
|
16
16
|
|
|
17
17
|
# Codesandbox Examples
|
|
18
18
|
* <a href="https://codesandbox.io/s/y29w6p6krj">Online demo example playground</a>
|
|
@@ -75,6 +75,7 @@ class YourOwnComponent extends Component {
|
|
|
75
75
|
onResetDefaultTime={res => this.onResetDefaultTime(res)}
|
|
76
76
|
onClearTime={res => this.onClearTime(res)}
|
|
77
77
|
// markedDates={['10/19/2021']} // OPTIONAL. format: "MM/DD/YYYY"
|
|
78
|
+
// supportDateRange={['12/03/2021', '12/05/2021']} // OPTIONAL. min date and max date. format: "MM/DD/YYYY"
|
|
78
79
|
/>
|
|
79
80
|
);
|
|
80
81
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -17,15 +19,13 @@ var _locale = require("../locale.js");
|
|
|
17
19
|
|
|
18
20
|
var _constValue = require("../constValue");
|
|
19
21
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
23
|
|
|
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; }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
29
29
|
|
|
30
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
31
|
|
|
@@ -41,13 +41,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
41
41
|
|
|
42
42
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
43
|
|
|
44
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (
|
|
44
|
+
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); }; }
|
|
45
45
|
|
|
46
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
46
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
47
47
|
|
|
48
48
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
49
|
|
|
50
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
50
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
51
|
|
|
52
52
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
53
53
|
|
|
@@ -206,7 +206,7 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
206
206
|
var pickedYearMonth = this.state.pickedYearMonth;
|
|
207
207
|
var _pickedYearMonth = pickedYearMonth,
|
|
208
208
|
month = _pickedYearMonth.month;
|
|
209
|
-
pickedYearMonth = _objectSpread({}, pickedYearMonth, {
|
|
209
|
+
pickedYearMonth = _objectSpread(_objectSpread({}, pickedYearMonth), {}, {
|
|
210
210
|
year: year,
|
|
211
211
|
string: "".concat(year, "-").concat(month)
|
|
212
212
|
});
|
|
@@ -244,7 +244,7 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
244
244
|
|
|
245
245
|
month = (0, _constValue.formatDateString)(month);
|
|
246
246
|
year = String(year);
|
|
247
|
-
pickedYearMonth = _objectSpread({}, pickedYearMonth, {
|
|
247
|
+
pickedYearMonth = _objectSpread(_objectSpread({}, pickedYearMonth), {}, {
|
|
248
248
|
year: year,
|
|
249
249
|
month: month,
|
|
250
250
|
string: "".concat(year, "-").concat(month)
|
|
@@ -264,7 +264,7 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
264
264
|
var _this$state = this.state,
|
|
265
265
|
pickedDateInfo = _this$state.pickedDateInfo,
|
|
266
266
|
pickedYearMonth = _this$state.pickedYearMonth;
|
|
267
|
-
pickedDateInfo = _objectSpread({}, pickedDateInfo, {
|
|
267
|
+
pickedDateInfo = _objectSpread(_objectSpread({}, pickedDateInfo), {}, {
|
|
268
268
|
year: pickedYearMonth.year,
|
|
269
269
|
month: (0, _constValue.formatDateString)(pickedYearMonth.month),
|
|
270
270
|
date: (0, _constValue.formatDateString)(pickedDate)
|
|
@@ -338,12 +338,12 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
338
338
|
|
|
339
339
|
month = (0, _constValue.formatDateString)(month);
|
|
340
340
|
date = (0, _constValue.formatDateString)(date);
|
|
341
|
-
pickedDateInfo = _objectSpread({}, pickedDateInfo, {
|
|
341
|
+
pickedDateInfo = _objectSpread(_objectSpread({}, pickedDateInfo), {}, {
|
|
342
342
|
year: year,
|
|
343
343
|
month: month,
|
|
344
344
|
date: date
|
|
345
345
|
});
|
|
346
|
-
pickedYearMonth = _objectSpread({}, pickedYearMonth, {
|
|
346
|
+
pickedYearMonth = _objectSpread(_objectSpread({}, pickedYearMonth), {}, {
|
|
347
347
|
year: year,
|
|
348
348
|
month: month,
|
|
349
349
|
string: "".concat(year, "-").concat(month)
|
|
@@ -371,7 +371,8 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
371
371
|
var _this$props = this.props,
|
|
372
372
|
size = _this$props.size,
|
|
373
373
|
locale = _this$props.locale,
|
|
374
|
-
markedDates = _this$props.markedDates
|
|
374
|
+
markedDates = _this$props.markedDates,
|
|
375
|
+
supportDateRange = _this$props.supportDateRange;
|
|
375
376
|
var markedDatesHash = {};
|
|
376
377
|
|
|
377
378
|
if (markedDates && (0, _utils.isValidDates)(markedDates)) {
|
|
@@ -380,6 +381,8 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
380
381
|
});
|
|
381
382
|
}
|
|
382
383
|
|
|
384
|
+
var minSupportDate = supportDateRange.length > 0 && isValidDate(supportDateRange[0]) ? supportDateRange[0] : '';
|
|
385
|
+
var maxSupportDate = supportDateRange.length > 1 && isValidDate(supportDateRange[1]) ? supportDateRange[1] : '';
|
|
383
386
|
var _this$state4 = this.state,
|
|
384
387
|
isDefaultDateValid = _this$state4.isDefaultDateValid,
|
|
385
388
|
dates = _this$state4.dates,
|
|
@@ -422,7 +425,9 @@ var Calendar = /*#__PURE__*/function (_Component) {
|
|
|
422
425
|
pickedDateInfo: pickedDateInfo,
|
|
423
426
|
onClick: this.pickDate,
|
|
424
427
|
key: pickedYearMonth.string,
|
|
425
|
-
markedDatesHash: markedDatesHash
|
|
428
|
+
markedDatesHash: markedDatesHash,
|
|
429
|
+
minSupportDate: minSupportDate,
|
|
430
|
+
maxSupportDate: maxSupportDate
|
|
426
431
|
});
|
|
427
432
|
|
|
428
433
|
if (row == 6) {
|
|
@@ -747,7 +752,9 @@ var CalendarBody = /*#__PURE__*/function (_Component2) {
|
|
|
747
752
|
pickedDateInfo = _this$props2.pickedDateInfo,
|
|
748
753
|
pickedYearMonth = _this$props2.pickedYearMonth,
|
|
749
754
|
onClick = _this$props2.onClick,
|
|
750
|
-
markedDatesHash = _this$props2.markedDatesHash
|
|
755
|
+
markedDatesHash = _this$props2.markedDatesHash,
|
|
756
|
+
minSupportDate = _this$props2.minSupportDate,
|
|
757
|
+
maxSupportDate = _this$props2.maxSupportDate;
|
|
751
758
|
var year = currentYearMonthDate.year,
|
|
752
759
|
month = currentYearMonthDate.month,
|
|
753
760
|
date = currentYearMonthDate.date;
|
|
@@ -760,9 +767,23 @@ var CalendarBody = /*#__PURE__*/function (_Component2) {
|
|
|
760
767
|
|
|
761
768
|
if (data[key].length) {
|
|
762
769
|
colHtml = data[key].map(function (item, key) {
|
|
770
|
+
var itemDate = "".concat(item.month, "/").concat(item.name, "/").concat(item.year);
|
|
763
771
|
var isPicked = pickedDate == item.name && pickedDateMonth == item.month && pickedDateYear == item.year;
|
|
764
772
|
var isDisabled = pickedMonth != item.month;
|
|
765
|
-
|
|
773
|
+
|
|
774
|
+
if (minSupportDate) {
|
|
775
|
+
if (new Date(itemDate) < new Date(minSupportDate)) {
|
|
776
|
+
isDisabled = true;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (maxSupportDate) {
|
|
781
|
+
if (new Date(itemDate) > new Date(maxSupportDate)) {
|
|
782
|
+
isDisabled = true;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
var datePickerItemClass = (0, _utils.cx)('picky-date-time-calendar__table-cel', 'picky-date-time-calendar__date-item', size, isDisabled && 'disabled', date == item.name && month == item.month && year == item.year && 'today', markedDatesHash[itemDate] && 'marked', isPicked && 'active');
|
|
766
787
|
return /*#__PURE__*/_react["default"].createElement(CalendarItem, {
|
|
767
788
|
key: key,
|
|
768
789
|
item: item,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -21,9 +23,7 @@ var _constValue = require("../constValue");
|
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
27
|
|
|
28
28
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
29
|
|
|
@@ -39,13 +39,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
39
39
|
|
|
40
40
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
41
|
|
|
42
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (
|
|
42
|
+
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); }; }
|
|
43
43
|
|
|
44
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
45
|
|
|
46
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
47
|
|
|
48
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
49
|
|
|
50
50
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
51
|
|
|
@@ -365,7 +365,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
365
365
|
value: function updateClockHandObj(o, value, degree, startAngle, angle) {
|
|
366
366
|
var isMouseOver = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
367
367
|
var isDragging = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
368
|
-
o = _objectSpread({}, o, {
|
|
368
|
+
o = _objectSpread(_objectSpread({}, o), {}, {
|
|
369
369
|
value: value,
|
|
370
370
|
degree: degree,
|
|
371
371
|
startAngle: startAngle,
|
|
@@ -650,7 +650,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
650
650
|
newDegree = Number(newValue) * _constValue.HOUR_DEGREE_NUMBER;
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
elObj = _objectSpread({}, elObj, {
|
|
653
|
+
elObj = _objectSpread(_objectSpread({}, elObj), {}, {
|
|
654
654
|
value: newValue,
|
|
655
655
|
degree: newDegree,
|
|
656
656
|
startAngle: newDegree,
|
|
@@ -682,7 +682,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
682
682
|
key: "onMouseOver",
|
|
683
683
|
value: function onMouseOver(refName) {
|
|
684
684
|
var elObj = this.state[refName];
|
|
685
|
-
elObj = _objectSpread({}, elObj, {
|
|
685
|
+
elObj = _objectSpread(_objectSpread({}, elObj), {}, {
|
|
686
686
|
isMouseOver: true
|
|
687
687
|
});
|
|
688
688
|
this.setState(_defineProperty({}, refName, elObj));
|
|
@@ -691,7 +691,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
691
691
|
key: "onMouseOut",
|
|
692
692
|
value: function onMouseOut(refName) {
|
|
693
693
|
var elObj = this.state[refName];
|
|
694
|
-
elObj = _objectSpread({}, elObj, {
|
|
694
|
+
elObj = _objectSpread(_objectSpread({}, elObj), {}, {
|
|
695
695
|
isMouseOver: false
|
|
696
696
|
});
|
|
697
697
|
this.setState(_defineProperty({}, refName, elObj));
|
|
@@ -703,7 +703,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
703
703
|
var x = e.clientX - this.originX;
|
|
704
704
|
var y = e.clientY - this.originY;
|
|
705
705
|
var startAngle = _constValue.R2D * Math.atan2(y, x);
|
|
706
|
-
elObj = _objectSpread({}, elObj, {
|
|
706
|
+
elObj = _objectSpread(_objectSpread({}, elObj), {}, {
|
|
707
707
|
isDragging: true,
|
|
708
708
|
startAngle: startAngle
|
|
709
709
|
});
|
|
@@ -765,7 +765,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
765
765
|
// });
|
|
766
766
|
|
|
767
767
|
|
|
768
|
-
elObj = _objectSpread({}, elObj, {
|
|
768
|
+
elObj = _objectSpread(_objectSpread({}, elObj), {}, {
|
|
769
769
|
value: value,
|
|
770
770
|
degree: degree
|
|
771
771
|
});
|
|
@@ -788,7 +788,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
788
788
|
// angle: { $set: clockHandSecondDegree },
|
|
789
789
|
// });
|
|
790
790
|
|
|
791
|
-
clockHandSecond = _objectSpread({}, clockHandSecond, {
|
|
791
|
+
clockHandSecond = _objectSpread(_objectSpread({}, clockHandSecond), {}, {
|
|
792
792
|
isDragging: false,
|
|
793
793
|
angle: clockHandSecondDegree
|
|
794
794
|
}); // clockHandMinute = update(clockHandMinute, {
|
|
@@ -796,7 +796,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
796
796
|
// angle: { $set: clockHandMinuteDegree },
|
|
797
797
|
// });
|
|
798
798
|
|
|
799
|
-
clockHandMinute = _objectSpread({}, clockHandMinute, {
|
|
799
|
+
clockHandMinute = _objectSpread(_objectSpread({}, clockHandMinute), {}, {
|
|
800
800
|
isDragging: false,
|
|
801
801
|
angle: clockHandMinuteDegree
|
|
802
802
|
}); // clockHandHour = update(clockHandHour, {
|
|
@@ -804,7 +804,7 @@ var Clock = /*#__PURE__*/function (_React$Component) {
|
|
|
804
804
|
// angle: { $set: clockHandHourDegree },
|
|
805
805
|
// });
|
|
806
806
|
|
|
807
|
-
clockHandHour = _objectSpread({}, clockHandHour, {
|
|
807
|
+
clockHandHour = _objectSpread(_objectSpread({}, clockHandHour), {}, {
|
|
808
808
|
isDragging: false,
|
|
809
809
|
angle: clockHandHourDegree
|
|
810
810
|
});
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getYearSet = exports.getDaysListByMonth = exports.getDaysArray = exports.formatDateString = exports.WEEK_NUMBER = exports.TIME_TYPE = exports.TIME_SELECTION_SECOND_CHAR_POS_LIST = exports.TIME_SELECTION_SECOND_CHAR_POS_BACKSPACE_LIST = exports.TIME_SELECTION_FIRST_CHAR_POS_LIST = exports.TIME_SELECTION_FIRST_CHAR_POS_BACKSPACE_LIST = exports.TIME_JUMP_CHAR_POS_LIST = exports.TIME_CURSOR_POSITION_OBJECT = exports.SIZE_RANGE = exports.SELECTOR_YEAR_SET_NUMBER = exports.SECOND_DEGREE_NUMBER = exports.R2D = exports.QUARTER = exports.PREV_TRANSITION = exports.POINTER_ROTATE = exports.NEXT_TRANSITION = exports.MINUTE_DEGREE_NUMBER = exports.KEY_CODE = exports.HOUR_DEGREE_NUMBER = exports.DEFAULT_SIZE = void 0;
|
|
7
7
|
|
|
8
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
9
|
|
|
10
10
|
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."); }
|
|
11
11
|
|
|
12
|
-
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(
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
14
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
15
|
|
|
16
16
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
17
|
|
package/lib/components/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -21,8 +23,6 @@ var _locale = require("./locale.js");
|
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
25
|
-
|
|
26
26
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
27
|
|
|
28
28
|
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); } }
|
|
@@ -33,13 +33,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
33
33
|
|
|
34
34
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
35
|
|
|
36
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (
|
|
36
|
+
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); }; }
|
|
37
37
|
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
39
|
|
|
40
40
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
41
|
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
43
|
|
|
44
44
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
45
|
|
|
@@ -169,7 +169,8 @@ var Index = /*#__PURE__*/function (_React$Component) {
|
|
|
169
169
|
show = _this$props.show,
|
|
170
170
|
locale = _this$props.locale,
|
|
171
171
|
mode = _this$props.mode,
|
|
172
|
-
markedDates = _this$props.markedDates
|
|
172
|
+
markedDates = _this$props.markedDates,
|
|
173
|
+
supportDateRange = _this$props.supportDateRange;
|
|
173
174
|
var componentClass = (0, _utils.cx)('picky-date-time', show && 'visible');
|
|
174
175
|
var calendarHtml;
|
|
175
176
|
var breakerHtml;
|
|
@@ -193,6 +194,7 @@ var Index = /*#__PURE__*/function (_React$Component) {
|
|
|
193
194
|
size: size,
|
|
194
195
|
defaultDate: defaultDate,
|
|
195
196
|
markedDates: markedDates,
|
|
197
|
+
supportDateRange: supportDateRange,
|
|
196
198
|
locale: locale,
|
|
197
199
|
onYearPicked: this.onYearPicked,
|
|
198
200
|
onMonthPicked: this.onMonthPicked,
|
|
@@ -210,6 +212,7 @@ var Index = /*#__PURE__*/function (_React$Component) {
|
|
|
210
212
|
defaultDate: defaultDate,
|
|
211
213
|
locale: locale,
|
|
212
214
|
markedDates: markedDates,
|
|
215
|
+
supportDateRange: supportDateRange,
|
|
213
216
|
onYearPicked: this.onYearPicked,
|
|
214
217
|
onMonthPicked: this.onMonthPicked,
|
|
215
218
|
onDatePicked: this.onDatePicked,
|
|
@@ -275,6 +278,7 @@ Index.propTypes = {
|
|
|
275
278
|
size: _propTypes["default"].string,
|
|
276
279
|
locale: _propTypes["default"].string,
|
|
277
280
|
markedDates: _propTypes["default"].array,
|
|
281
|
+
supportDateRange: _propTypes["default"].array,
|
|
278
282
|
defaultDate: _propTypes["default"].string,
|
|
279
283
|
defaultTime: _propTypes["default"].string,
|
|
280
284
|
show: _propTypes["default"].bool,
|
|
@@ -296,6 +300,7 @@ Index.defaultProps = {
|
|
|
296
300
|
locale: _locale.DEFAULT_LACALE,
|
|
297
301
|
size: _constValue.DEFAULT_SIZE,
|
|
298
302
|
markedDates: [],
|
|
303
|
+
supportDateRange: [],
|
|
299
304
|
show: false,
|
|
300
305
|
mode: 0,
|
|
301
306
|
// GENERAL
|
package/lib/components/locale.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.LOCALE = exports.DEFAULT_LACALE = void 0;
|
|
7
7
|
|
|
8
8
|
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); }
|
|
9
9
|
|