@commercetools-uikit/calendar-utils 16.12.1 → 17.0.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.
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _Number$isNaN = require('@babel/runtime-corejs3/core-js-stable/number/is-nan');
|
|
5
6
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
6
7
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
7
8
|
var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
|
|
8
9
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
9
10
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
10
11
|
var moment = require('moment');
|
|
11
|
-
var inRange = require('lodash/inRange');
|
|
12
12
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
13
13
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
14
14
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -45,13 +45,13 @@ var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
|
45
45
|
|
|
46
46
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
47
|
|
|
48
|
+
var _Number$isNaN__default = /*#__PURE__*/_interopDefault(_Number$isNaN);
|
|
48
49
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
49
50
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
50
51
|
var _Array$from__default = /*#__PURE__*/_interopDefault(_Array$from);
|
|
51
52
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
52
53
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
53
54
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
54
|
-
var inRange__default = /*#__PURE__*/_interopDefault(inRange);
|
|
55
55
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
56
56
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
57
57
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -81,9 +81,7 @@ const getPaddingDayCount = (day, locale) => {
|
|
|
81
81
|
const firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
82
82
|
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
83
83
|
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
84
|
-
|
|
85
|
-
// ensure number is always positive
|
|
86
|
-
return inRange__default["default"](paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
84
|
+
return _Number$isNaN__default["default"](paddingDayCount) ? 0 : paddingDayCount;
|
|
87
85
|
};
|
|
88
86
|
const getWeekdayNames = locale => {
|
|
89
87
|
const weekDays = moment__default["default"].localeData(locale).weekdaysMin();
|
|
@@ -644,7 +642,7 @@ CalendarMenu.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
644
642
|
} : {};
|
|
645
643
|
|
|
646
644
|
// NOTE: This string will be replaced on build time with the package version.
|
|
647
|
-
var version = "
|
|
645
|
+
var version = "17.0.0";
|
|
648
646
|
|
|
649
647
|
exports.CalendarBody = CalendarBody$1;
|
|
650
648
|
exports.CalendarContent = CalendarContent$1;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _Number$isNaN = require('@babel/runtime-corejs3/core-js-stable/number/is-nan');
|
|
5
6
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
6
7
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
7
8
|
var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
|
|
8
9
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
9
10
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
10
11
|
var moment = require('moment');
|
|
11
|
-
var inRange = require('lodash/inRange');
|
|
12
12
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
13
13
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
14
14
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -45,13 +45,13 @@ var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
|
45
45
|
|
|
46
46
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
47
|
|
|
48
|
+
var _Number$isNaN__default = /*#__PURE__*/_interopDefault(_Number$isNaN);
|
|
48
49
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
49
50
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
50
51
|
var _Array$from__default = /*#__PURE__*/_interopDefault(_Array$from);
|
|
51
52
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
52
53
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
53
54
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
54
|
-
var inRange__default = /*#__PURE__*/_interopDefault(inRange);
|
|
55
55
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
56
56
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
57
57
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -80,9 +80,7 @@ const getPaddingDayCount = (day, locale) => {
|
|
|
80
80
|
const firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
81
81
|
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
82
82
|
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
83
|
-
|
|
84
|
-
// ensure number is always positive
|
|
85
|
-
return inRange__default["default"](paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
83
|
+
return _Number$isNaN__default["default"](paddingDayCount) ? 0 : paddingDayCount;
|
|
86
84
|
};
|
|
87
85
|
const getWeekdayNames = locale => {
|
|
88
86
|
const weekDays = moment__default["default"].localeData(locale).weekdaysMin();
|
|
@@ -552,7 +550,7 @@ CalendarMenu.displayName = 'CalendarMenu';
|
|
|
552
550
|
CalendarMenu.propTypes = {};
|
|
553
551
|
|
|
554
552
|
// NOTE: This string will be replaced on build time with the package version.
|
|
555
|
-
var version = "
|
|
553
|
+
var version = "17.0.0";
|
|
556
554
|
|
|
557
555
|
exports.CalendarBody = CalendarBody$1;
|
|
558
556
|
exports.CalendarContent = CalendarContent$1;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import _Number$isNaN from '@babel/runtime-corejs3/core-js-stable/number/is-nan';
|
|
1
2
|
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
2
3
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
3
4
|
import _Array$from from '@babel/runtime-corejs3/core-js-stable/array/from';
|
|
4
5
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
5
6
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
6
7
|
import moment from 'moment';
|
|
7
|
-
import inRange from 'lodash/inRange';
|
|
8
8
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
9
9
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
10
10
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -50,9 +50,7 @@ const getPaddingDayCount = (day, locale) => {
|
|
|
50
50
|
const firstDayOfWeek = moment.localeData(locale).firstDayOfWeek();
|
|
51
51
|
const firstDayOfMonth = moment(day).startOf('month').day();
|
|
52
52
|
const paddingDayCount = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
53
|
-
|
|
54
|
-
// ensure number is always positive
|
|
55
|
-
return inRange(paddingDayCount, 0, 6) ? paddingDayCount : 0;
|
|
53
|
+
return _Number$isNaN(paddingDayCount) ? 0 : paddingDayCount;
|
|
56
54
|
};
|
|
57
55
|
const getWeekdayNames = locale => {
|
|
58
56
|
const weekDays = moment.localeData(locale).weekdaysMin();
|
|
@@ -613,6 +611,6 @@ CalendarMenu.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
613
611
|
} : {};
|
|
614
612
|
|
|
615
613
|
// NOTE: This string will be replaced on build time with the package version.
|
|
616
|
-
var version = "
|
|
614
|
+
var version = "17.0.0";
|
|
617
615
|
|
|
618
616
|
export { CalendarBody$1 as CalendarBody, CalendarContent$1 as CalendarContent, CalendarDay$1 as CalendarDay, CalendarHeader$1 as CalendarHeader, CalendarMenu, changeMonth, createCalendarItems, createItemRangeToString, createItemToString, formatDate, formatRange, getCalendarDayLabel, getDateInMonth, getDaysInMonth, getExampleDateStrings, getIsDateInRange, getMonthCalendarLabel, getNextDay, getPaddingDayCount, getPreviousDay, getToday, getWeekdayNames, getYearCalendarLabel, isBetween, isSameDay, parseInputToDate, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/calendar-utils",
|
|
3
3
|
"description": "Utilities to work with values for a calendar.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "17.0.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "
|
|
25
|
-
"@commercetools-uikit/design-system": "
|
|
26
|
-
"@commercetools-uikit/hooks": "
|
|
27
|
-
"@commercetools-uikit/icons": "
|
|
28
|
-
"@commercetools-uikit/input-utils": "
|
|
29
|
-
"@commercetools-uikit/secondary-icon-button": "
|
|
30
|
-
"@commercetools-uikit/spacings-inline": "
|
|
31
|
-
"@commercetools-uikit/text": "
|
|
32
|
-
"@commercetools-uikit/tooltip": "
|
|
33
|
-
"@commercetools-uikit/utils": "
|
|
24
|
+
"@commercetools-uikit/accessible-button": "17.0.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "17.0.0",
|
|
26
|
+
"@commercetools-uikit/hooks": "17.0.0",
|
|
27
|
+
"@commercetools-uikit/icons": "17.0.0",
|
|
28
|
+
"@commercetools-uikit/input-utils": "17.0.0",
|
|
29
|
+
"@commercetools-uikit/secondary-icon-button": "17.0.0",
|
|
30
|
+
"@commercetools-uikit/spacings-inline": "17.0.0",
|
|
31
|
+
"@commercetools-uikit/text": "17.0.0",
|
|
32
|
+
"@commercetools-uikit/tooltip": "17.0.0",
|
|
33
|
+
"@commercetools-uikit/utils": "17.0.0",
|
|
34
34
|
"@emotion/react": "^11.10.5",
|
|
35
35
|
"@emotion/styled": "^11.10.5",
|
|
36
36
|
"lodash": "4.17.21",
|