@douyinfe/semi-foundation 2.19.0-beta.0 → 2.19.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/anchor/anchor.scss +1 -8
- package/anchor/rtl.scss +0 -1
- package/anchor/variables.scss +1 -0
- package/calendar/eventUtil.ts +8 -7
- package/calendar/foundation.ts +14 -14
- package/datePicker/monthsGridFoundation.ts +10 -3
- package/dropdown/foundation.ts +2 -1
- package/dropdown/menuFoundation.ts +2 -1
- package/getBabelConfig.js +0 -12
- package/lib/cjs/anchor/anchor.css +1 -10
- package/lib/cjs/anchor/anchor.scss +1 -8
- package/lib/cjs/anchor/constants.js +1 -4
- package/lib/cjs/anchor/foundation.js +5 -12
- package/lib/cjs/anchor/linkFoundation.js +4 -9
- package/lib/cjs/anchor/rtl.scss +0 -1
- package/lib/cjs/anchor/variables.scss +1 -0
- package/lib/cjs/autoComplete/constants.js +1 -4
- package/lib/cjs/autoComplete/foundation.js +14 -33
- package/lib/cjs/autoComplete/optionFoundation.js +4 -9
- package/lib/cjs/avatar/constants.js +1 -4
- package/lib/cjs/avatar/foundation.js +4 -9
- package/lib/cjs/backtop/constants.js +1 -4
- package/lib/cjs/backtop/foundation.js +4 -9
- package/lib/cjs/badge/constants.js +1 -4
- package/lib/cjs/banner/constants.js +1 -4
- package/lib/cjs/banner/foundation.js +4 -9
- package/lib/cjs/base/constants.js +2 -6
- package/lib/cjs/base/env.js +1 -4
- package/lib/cjs/base/foundation.js +5 -10
- package/lib/cjs/base/index.js +3 -6
- package/lib/cjs/breadcrumb/constants.js +1 -4
- package/lib/cjs/breadcrumb/foundation.js +6 -13
- package/lib/cjs/breadcrumb/itemFoundation.js +4 -9
- package/lib/cjs/button/constants.js +1 -4
- package/lib/cjs/calendar/constants.js +1 -4
- package/lib/cjs/calendar/eventUtil.d.ts +3 -3
- package/lib/cjs/calendar/eventUtil.js +28 -53
- package/lib/cjs/calendar/foundation.js +63 -85
- package/lib/cjs/card/constants.js +1 -4
- package/lib/cjs/carousel/constants.js +1 -4
- package/lib/cjs/carousel/foundation.js +5 -12
- package/lib/cjs/cascader/constants.js +1 -4
- package/lib/cjs/cascader/foundation.js +55 -100
- package/lib/cjs/cascader/util.js +9 -30
- package/lib/cjs/checkbox/checkboxFoundation.js +6 -13
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +9 -18
- package/lib/cjs/checkbox/constants.js +1 -4
- package/lib/cjs/collapse/constants.js +1 -4
- package/lib/cjs/collapse/foundation.js +9 -20
- package/lib/cjs/collapsible/constants.js +1 -4
- package/lib/cjs/datePicker/_utils/formatter.js +3 -12
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +5 -10
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +3 -6
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +2 -11
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -4
- package/lib/cjs/datePicker/_utils/getMonthTable.js +2 -11
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +3 -16
- package/lib/cjs/datePicker/_utils/getYears.js +2 -9
- package/lib/cjs/datePicker/_utils/index.js +16 -30
- package/lib/cjs/datePicker/_utils/isAfter.js +3 -6
- package/lib/cjs/datePicker/_utils/isBefore.js +3 -6
- package/lib/cjs/datePicker/_utils/isBetween.js +3 -6
- package/lib/cjs/datePicker/_utils/isDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isSameDay.js +3 -6
- package/lib/cjs/datePicker/_utils/isTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isValidDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +3 -6
- package/lib/cjs/datePicker/_utils/parser.js +1 -4
- package/lib/cjs/datePicker/constants.js +3 -10
- package/lib/cjs/datePicker/foundation.js +42 -85
- package/lib/cjs/datePicker/inputFoundation.js +7 -20
- package/lib/cjs/datePicker/monthFoundation.js +5 -12
- package/lib/cjs/datePicker/monthsGridFoundation.js +47 -68
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +4 -9
- package/lib/cjs/descriptions/constants.js +1 -4
- package/lib/cjs/divider/constants.js +1 -4
- package/lib/cjs/dropdown/constants.js +1 -4
- package/lib/cjs/dropdown/foundation.js +7 -15
- package/lib/cjs/dropdown/menuFoundation.js +11 -31
- package/lib/cjs/empty/constants.js +1 -4
- package/lib/cjs/form/constants.js +1 -4
- package/lib/cjs/form/foundation.js +64 -104
- package/lib/cjs/form/interface.js +1 -3
- package/lib/cjs/form/utils.js +14 -29
- package/lib/cjs/grid/constants.js +1 -4
- package/lib/cjs/icons/constants.js +1 -4
- package/lib/cjs/input/constants.js +1 -4
- package/lib/cjs/input/foundation.js +7 -18
- package/lib/cjs/input/textareaFoundation.js +6 -13
- package/lib/cjs/input/util/calculateNodeHeight.js +3 -17
- package/lib/cjs/input/util/getSizingData.js +5 -10
- package/lib/cjs/inputNumber/constants.js +4 -11
- package/lib/cjs/inputNumber/foundation.js +11 -30
- package/lib/cjs/layout/constants.js +1 -4
- package/lib/cjs/list/constants.js +1 -4
- package/lib/cjs/modal/constants.js +1 -4
- package/lib/cjs/modal/modalContentFoundation.js +4 -9
- package/lib/cjs/modal/modalFoundation.js +4 -9
- package/lib/cjs/navigation/NavItem.js +6 -21
- package/lib/cjs/navigation/constants.js +1 -4
- package/lib/cjs/navigation/foundation.js +22 -37
- package/lib/cjs/navigation/itemFoundation.js +4 -9
- package/lib/cjs/navigation/subNavFoundation.js +10 -21
- package/lib/cjs/notification/constants.js +1 -4
- package/lib/cjs/notification/notificationFoundation.js +5 -12
- package/lib/cjs/notification/notificationListFoundation.js +4 -9
- package/lib/cjs/overflowList/constants.js +3 -10
- package/lib/cjs/overflowList/foundation.js +12 -29
- package/lib/cjs/pagination/constants.js +1 -4
- package/lib/cjs/pagination/foundation.js +18 -37
- package/lib/cjs/popconfirm/constants.js +1 -4
- package/lib/cjs/popconfirm/popconfirmFoundation.js +3 -6
- package/lib/cjs/popover/constants.js +2 -9
- package/lib/cjs/progress/constants.js +1 -4
- package/lib/cjs/radio/constants.js +1 -4
- package/lib/cjs/radio/radioFoundation.js +3 -6
- package/lib/cjs/radio/radioGroupFoundation.js +6 -11
- package/lib/cjs/radio/radioInnerFoundation.js +5 -10
- package/lib/cjs/rating/constants.js +1 -4
- package/lib/cjs/rating/foundation.js +7 -20
- package/lib/cjs/scrollList/constants.js +1 -4
- package/lib/cjs/scrollList/foundation.js +3 -6
- package/lib/cjs/scrollList/itemFoundation.js +8 -21
- package/lib/cjs/scrollList/scrollTo.js +1 -4
- package/lib/cjs/select/constants.js +1 -4
- package/lib/cjs/select/foundation.js +56 -98
- package/lib/cjs/select/optionFoundation.js +4 -9
- package/lib/cjs/sideSheet/constants.js +1 -4
- package/lib/cjs/sideSheet/sideSheetFoundation.js +6 -15
- package/lib/cjs/skeleton/constants.js +1 -4
- package/lib/cjs/slider/constants.js +1 -4
- package/lib/cjs/slider/foundation.js +13 -24
- package/lib/cjs/space/constants.js +1 -4
- package/lib/cjs/spin/constants.js +1 -4
- package/lib/cjs/spin/foundation.js +5 -12
- package/lib/cjs/steps/constants.js +1 -4
- package/lib/cjs/switch/constants.js +1 -4
- package/lib/cjs/switch/foundation.js +4 -9
- package/lib/cjs/table/bodyFoundation.js +9 -22
- package/lib/cjs/table/cellFoundation.js +3 -6
- package/lib/cjs/table/constants.js +1 -4
- package/lib/cjs/table/foundation.js +76 -117
- package/lib/cjs/table/tableRowFoundation.js +3 -6
- package/lib/cjs/table/tableSelectionCellFoundation.js +3 -6
- package/lib/cjs/table/utils.js +42 -71
- package/lib/cjs/tabs/constants.js +1 -4
- package/lib/cjs/tabs/foundation.js +8 -23
- package/lib/cjs/tag/constants.js +1 -4
- package/lib/cjs/tagInput/constants.js +1 -4
- package/lib/cjs/tagInput/foundation.js +12 -31
- package/lib/cjs/tagInput/utils/getSplitedArray.js +3 -6
- package/lib/cjs/timePicker/ComboxFoundation.js +10 -29
- package/lib/cjs/timePicker/constants.js +1 -4
- package/lib/cjs/timePicker/foundation.js +26 -45
- package/lib/cjs/timePicker/inputFoundation.js +4 -9
- package/lib/cjs/timePicker/utils/index.js +7 -14
- package/lib/cjs/timePicker/utils/localeDate.js +2 -9
- package/lib/cjs/timeline/constants.js +1 -4
- package/lib/cjs/toast/constants.js +1 -4
- package/lib/cjs/toast/toastFoundation.js +5 -12
- package/lib/cjs/toast/toastListFoundation.js +5 -12
- package/lib/cjs/tooltip/constants.js +1 -4
- package/lib/cjs/tooltip/foundation.js +29 -56
- package/lib/cjs/transfer/constants.js +1 -4
- package/lib/cjs/transfer/foundation.js +24 -47
- package/lib/cjs/transfer/transferUtils.js +16 -45
- package/lib/cjs/tree/constants.js +1 -4
- package/lib/cjs/tree/foundation.js +41 -76
- package/lib/cjs/tree/treeUtil.js +60 -107
- package/lib/cjs/treeSelect/constants.js +1 -4
- package/lib/cjs/treeSelect/foundation.js +49 -82
- package/lib/cjs/typography/constants.js +1 -4
- package/lib/cjs/upload/constants.js +1 -4
- package/lib/cjs/upload/foundation.js +56 -112
- package/lib/cjs/upload/utils.js +13 -32
- package/lib/cjs/utils/Event.js +9 -23
- package/lib/cjs/utils/FocusHandle.js +6 -15
- package/lib/cjs/utils/Logger.js +1 -4
- package/lib/cjs/utils/Store.js +5 -20
- package/lib/cjs/utils/a11y.js +8 -13
- package/lib/cjs/utils/array.js +6 -15
- package/lib/cjs/utils/arrayMove.js +3 -12
- package/lib/cjs/utils/classnames.js +6 -15
- package/lib/cjs/utils/date-fns-extra.js +7 -18
- package/lib/cjs/utils/dom.js +5 -12
- package/lib/cjs/utils/function.js +1 -4
- package/lib/cjs/utils/getDataAttr.js +2 -13
- package/lib/cjs/utils/getHighlight.js +7 -22
- package/lib/cjs/utils/getMotionObjFromProps.js +4 -9
- package/lib/cjs/utils/index.js +5 -15
- package/lib/cjs/utils/isBothNaN.js +1 -4
- package/lib/cjs/utils/isElement.js +1 -4
- package/lib/cjs/utils/isEnterPress.js +3 -6
- package/lib/cjs/utils/isEscPress.js +3 -6
- package/lib/cjs/utils/isNullOrUndefined.js +1 -4
- package/lib/cjs/utils/isNumber.js +1 -4
- package/lib/cjs/utils/isObject.js +1 -4
- package/lib/cjs/utils/isPromise.js +3 -6
- package/lib/cjs/utils/isString.js +1 -4
- package/lib/cjs/utils/keyCode.js +1 -4
- package/lib/cjs/utils/log.js +3 -6
- package/lib/cjs/utils/number.js +1 -4
- package/lib/cjs/utils/object.js +10 -27
- package/lib/cjs/utils/set.js +4 -9
- package/lib/cjs/utils/shallowEqualObjects.js +3 -10
- package/lib/cjs/utils/touchPolyfill.js +5 -12
- package/lib/cjs/utils/type.js +1 -3
- package/lib/cjs/utils/uuid.js +3 -14
- package/lib/cjs/utils/warning.js +1 -4
- package/lib/es/anchor/anchor.css +1 -10
- package/lib/es/anchor/anchor.scss +1 -8
- package/lib/es/anchor/foundation.js +2 -4
- package/lib/es/anchor/linkFoundation.js +1 -2
- package/lib/es/anchor/rtl.scss +0 -1
- package/lib/es/anchor/variables.scss +1 -0
- package/lib/es/autoComplete/foundation.js +11 -26
- package/lib/es/autoComplete/optionFoundation.js +1 -2
- package/lib/es/avatar/foundation.js +1 -2
- package/lib/es/backtop/foundation.js +1 -2
- package/lib/es/banner/foundation.js +1 -2
- package/lib/es/base/foundation.js +2 -3
- package/lib/es/breadcrumb/foundation.js +3 -6
- package/lib/es/breadcrumb/itemFoundation.js +1 -2
- package/lib/es/calendar/eventUtil.d.ts +3 -3
- package/lib/es/calendar/eventUtil.js +27 -56
- package/lib/es/calendar/foundation.js +60 -90
- package/lib/es/carousel/foundation.js +2 -4
- package/lib/es/cascader/foundation.js +49 -94
- package/lib/es/cascader/util.js +6 -21
- package/lib/es/checkbox/checkboxFoundation.js +3 -6
- package/lib/es/checkbox/checkboxGroupFoundation.js +6 -9
- package/lib/es/collapse/foundation.js +6 -10
- package/lib/es/datePicker/_utils/formatter.js +2 -5
- package/lib/es/datePicker/_utils/getDefaultPickerDate.js +2 -3
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -4
- package/lib/es/datePicker/_utils/getMonthTable.js +1 -5
- package/lib/es/datePicker/_utils/getMonthsInYear.js +2 -9
- package/lib/es/datePicker/_utils/getYears.js +1 -3
- package/lib/es/datePicker/constants.js +2 -7
- package/lib/es/datePicker/foundation.js +39 -70
- package/lib/es/datePicker/inputFoundation.js +4 -11
- package/lib/es/datePicker/monthFoundation.js +2 -4
- package/lib/es/datePicker/monthsGridFoundation.js +40 -55
- package/lib/es/datePicker/yearAndMonthFoundation.js +1 -2
- package/lib/es/dropdown/foundation.js +4 -7
- package/lib/es/dropdown/menuFoundation.js +8 -21
- package/lib/es/form/foundation.js +59 -91
- package/lib/es/form/utils.js +11 -19
- package/lib/es/input/foundation.js +4 -9
- package/lib/es/input/textareaFoundation.js +3 -5
- package/lib/es/input/util/calculateNodeHeight.js +2 -10
- package/lib/es/input/util/getSizingData.js +2 -5
- package/lib/es/inputNumber/constants.js +3 -8
- package/lib/es/inputNumber/foundation.js +8 -18
- package/lib/es/modal/modalContentFoundation.js +1 -2
- package/lib/es/modal/modalFoundation.js +1 -2
- package/lib/es/navigation/NavItem.js +5 -11
- package/lib/es/navigation/foundation.js +19 -25
- package/lib/es/navigation/itemFoundation.js +1 -3
- package/lib/es/navigation/subNavFoundation.js +7 -13
- package/lib/es/notification/notificationFoundation.js +2 -4
- package/lib/es/notification/notificationListFoundation.js +1 -3
- package/lib/es/overflowList/constants.js +2 -3
- package/lib/es/overflowList/foundation.js +9 -23
- package/lib/es/pagination/foundation.js +15 -28
- package/lib/es/popover/constants.js +1 -2
- package/lib/es/radio/radioGroupFoundation.js +3 -4
- package/lib/es/radio/radioInnerFoundation.js +2 -3
- package/lib/es/rating/foundation.js +4 -13
- package/lib/es/scrollList/itemFoundation.js +5 -13
- package/lib/es/select/foundation.js +50 -88
- package/lib/es/select/optionFoundation.js +1 -2
- package/lib/es/sideSheet/sideSheetFoundation.js +3 -7
- package/lib/es/slider/foundation.js +10 -16
- package/lib/es/spin/foundation.js +2 -4
- package/lib/es/switch/foundation.js +1 -2
- package/lib/es/table/bodyFoundation.js +6 -11
- package/lib/es/table/foundation.js +67 -93
- package/lib/es/table/utils.js +33 -51
- package/lib/es/tabs/foundation.js +5 -18
- package/lib/es/tagInput/foundation.js +9 -21
- package/lib/es/timePicker/ComboxFoundation.js +7 -16
- package/lib/es/timePicker/foundation.js +23 -37
- package/lib/es/timePicker/inputFoundation.js +1 -2
- package/lib/es/timePicker/utils/index.js +4 -6
- package/lib/es/timePicker/utils/localeDate.js +1 -2
- package/lib/es/toast/toastFoundation.js +2 -4
- package/lib/es/toast/toastListFoundation.js +2 -4
- package/lib/es/tooltip/foundation.js +26 -46
- package/lib/es/transfer/foundation.js +21 -43
- package/lib/es/transfer/transferUtils.js +13 -33
- package/lib/es/tree/foundation.js +38 -70
- package/lib/es/tree/treeUtil.js +57 -109
- package/lib/es/treeSelect/foundation.js +45 -73
- package/lib/es/upload/foundation.js +52 -118
- package/lib/es/upload/utils.js +12 -25
- package/lib/es/utils/Event.js +5 -12
- package/lib/es/utils/FocusHandle.js +3 -7
- package/lib/es/utils/Store.js +4 -12
- package/lib/es/utils/a11y.js +5 -6
- package/lib/es/utils/array.js +3 -5
- package/lib/es/utils/arrayMove.js +2 -6
- package/lib/es/utils/classnames.js +3 -6
- package/lib/es/utils/date-fns-extra.js +6 -14
- package/lib/es/utils/dom.js +1 -2
- package/lib/es/utils/getDataAttr.js +1 -5
- package/lib/es/utils/getHighlight.js +4 -14
- package/lib/es/utils/getMotionObjFromProps.js +1 -2
- package/lib/es/utils/object.js +7 -15
- package/lib/es/utils/set.js +1 -2
- package/lib/es/utils/shallowEqualObjects.js +2 -5
- package/lib/es/utils/touchPolyfill.js +2 -6
- package/lib/es/utils/uuid.js +2 -7
- package/package.json +2 -4
- package/select/foundation.ts +2 -2
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.numbers = exports.checkboxGroupClasses = exports.checkboxClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
16
|
-
|
|
17
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
18
|
-
|
|
19
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
|
|
20
|
-
|
|
21
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
22
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
23
12
|
class CollapseFoundation extends _foundation.default {
|
|
24
13
|
constructor(adapter) {
|
|
25
|
-
super(
|
|
14
|
+
super(Object.assign({}, adapter));
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
initActiveKey() {
|
|
@@ -34,11 +23,11 @@ class CollapseFoundation extends _foundation.default {
|
|
|
34
23
|
let activeKeyList = activeKey ? activeKey : defaultActiveKey;
|
|
35
24
|
|
|
36
25
|
if (accordion) {
|
|
37
|
-
activeKeyList =
|
|
26
|
+
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList[0] : activeKeyList;
|
|
38
27
|
}
|
|
39
28
|
|
|
40
29
|
if (activeKeyList && activeKeyList.length) {
|
|
41
|
-
activeKeyList =
|
|
30
|
+
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList : [activeKeyList];
|
|
42
31
|
return activeKeyList;
|
|
43
32
|
}
|
|
44
33
|
|
|
@@ -53,19 +42,19 @@ class CollapseFoundation extends _foundation.default {
|
|
|
53
42
|
const {
|
|
54
43
|
activeSet
|
|
55
44
|
} = this.getStates();
|
|
56
|
-
let newSet = new
|
|
45
|
+
let newSet = new Set(activeSet);
|
|
57
46
|
|
|
58
47
|
if (newSet.has(newKey)) {
|
|
59
48
|
newSet.delete(newKey);
|
|
60
49
|
} else {
|
|
61
50
|
if (accordion) {
|
|
62
|
-
newSet = new
|
|
51
|
+
newSet = new Set([newKey]);
|
|
63
52
|
} else {
|
|
64
53
|
newSet.add(newKey);
|
|
65
54
|
}
|
|
66
55
|
}
|
|
67
56
|
|
|
68
|
-
this._adapter.handleChange([...
|
|
57
|
+
this._adapter.handleChange([...newSet.values()], e);
|
|
69
58
|
|
|
70
59
|
if (typeof activeKey === 'undefined') {
|
|
71
60
|
this._adapter.addActiveKey(newSet);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.formatDateValues = formatDateValues;
|
|
12
7
|
|
|
13
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
14
|
-
|
|
15
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
16
|
-
|
|
17
8
|
var _dateFns = require("date-fns");
|
|
18
9
|
|
|
19
10
|
var _constants = require("../constants");
|
|
@@ -41,7 +32,7 @@ function formatDateValues(values, formatToken) {
|
|
|
41
32
|
let text = '';
|
|
42
33
|
(groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1); // console.log(values, formatToken, groupInnerSeparator, groupSize, groupSeparator);
|
|
43
34
|
|
|
44
|
-
if (
|
|
35
|
+
if (Array.isArray(values) && values.length) {
|
|
45
36
|
const groups = [];
|
|
46
37
|
const {
|
|
47
38
|
length
|
|
@@ -56,7 +47,7 @@ function formatDateValues(values, formatToken) {
|
|
|
56
47
|
groups[curArrIdx].push(values[i]);
|
|
57
48
|
}
|
|
58
49
|
|
|
59
|
-
text =
|
|
50
|
+
text = groups.map(arr => arr.map(v => {
|
|
60
51
|
if (v) {
|
|
61
52
|
// console.log(`formatDateValues() -> formatDateValues: ${v}`);
|
|
62
53
|
return (0, _dateFns.format)(v, formatToken, {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.default = void 0;
|
|
10
7
|
|
|
11
8
|
/**
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.default = void 0;
|
|
10
7
|
exports.getDefaultFormatTokenByType = getDefaultFormatTokenByType;
|
|
11
8
|
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = getDefaultPickerDate;
|
|
12
7
|
|
|
13
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
14
|
-
|
|
15
8
|
var _dateFns = require("date-fns");
|
|
16
9
|
|
|
17
10
|
var _isValidDate = _interopRequireDefault(require("./isValidDate"));
|
|
@@ -20,6 +13,8 @@ var _parser = require("./parser");
|
|
|
20
13
|
|
|
21
14
|
var _isTimestamp = _interopRequireDefault(require("./isTimestamp"));
|
|
22
15
|
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
23
18
|
/**
|
|
24
19
|
* get left panel picker date and right panel picker date
|
|
25
20
|
*/
|
|
@@ -29,8 +24,8 @@ function getDefaultPickerDate(options) {
|
|
|
29
24
|
format,
|
|
30
25
|
dateFnsLocale
|
|
31
26
|
} = options;
|
|
32
|
-
let nowDate =
|
|
33
|
-
let nextDate =
|
|
27
|
+
let nowDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
|
|
28
|
+
let nextDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[1] : undefined;
|
|
34
29
|
|
|
35
30
|
switch (true) {
|
|
36
31
|
case (0, _isValidDate.default)(nowDate):
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
8
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
@@ -16,6 +11,8 @@ var _constants = require("../constants");
|
|
|
16
11
|
|
|
17
12
|
var _dateFns = require("date-fns");
|
|
18
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
19
16
|
/**
|
|
20
17
|
* Calculate the date string offset from the date
|
|
21
18
|
* @param {*} fn
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = getInsetInputFormatToken;
|
|
12
7
|
|
|
13
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
14
|
-
|
|
15
8
|
var _getDefaultFormatToken = require("./getDefaultFormatToken");
|
|
16
9
|
|
|
17
10
|
/**
|
|
@@ -30,8 +23,6 @@ var _getDefaultFormatToken = require("./getDefaultFormatToken");
|
|
|
30
23
|
* 'Pp' => 'yyyy-MM-dd'
|
|
31
24
|
*/
|
|
32
25
|
function getInsetInputFormatToken(options) {
|
|
33
|
-
var _context;
|
|
34
|
-
|
|
35
26
|
const {
|
|
36
27
|
format,
|
|
37
28
|
type
|
|
@@ -45,7 +36,7 @@ function getInsetInputFormatToken(options) {
|
|
|
45
36
|
case 'dateTime':
|
|
46
37
|
case 'dateTimeRange':
|
|
47
38
|
const dateTimeResult = dateTimeReg.exec(format);
|
|
48
|
-
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ?
|
|
39
|
+
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? "".concat(dateTimeResult[1], " ").concat(dateTimeResult[2]) : defaultToken;
|
|
49
40
|
break;
|
|
50
41
|
|
|
51
42
|
case 'date':
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.default = getInsetInputValueFromInsetInputStr;
|
|
10
7
|
|
|
11
8
|
/**
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
exports.formatFullDate = formatFullDate;
|
|
13
8
|
|
|
14
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
15
|
-
|
|
16
9
|
var _dateFns = require("date-fns");
|
|
17
10
|
|
|
18
11
|
/**
|
|
@@ -20,15 +13,13 @@ var _dateFns = require("date-fns");
|
|
|
20
13
|
* @param {string} month
|
|
21
14
|
*/
|
|
22
15
|
function formatFullDate() {
|
|
23
|
-
var _context, _context2;
|
|
24
|
-
|
|
25
16
|
let year = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
26
17
|
let month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
27
18
|
let day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
28
19
|
let dateStr = '';
|
|
29
20
|
const monthFull = typeof month === 'number' && month < 10 ? "0".concat(month) : month.toString();
|
|
30
21
|
const dayNumberFull = typeof day === 'number' && day < 10 ? "0".concat(day) : day.toString();
|
|
31
|
-
dateStr =
|
|
22
|
+
dateStr = "".concat(String(year), "-").concat(monthFull, "-").concat(dayNumberFull);
|
|
32
23
|
return dateStr;
|
|
33
24
|
}
|
|
34
25
|
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
16
|
-
|
|
17
|
-
const getMonthsInYear = year => (0, _from.default)({
|
|
8
|
+
const getMonthsInYear = year => Array.from({
|
|
18
9
|
length: 12
|
|
19
|
-
}, (v, i) =>
|
|
20
|
-
var _context;
|
|
21
|
-
|
|
22
|
-
return (0, _concat.default)(_context = "".concat(year, "-")).call(_context, i + 1);
|
|
23
|
-
});
|
|
10
|
+
}, (v, i) => "".concat(year, "-").concat(i + 1));
|
|
24
11
|
|
|
25
12
|
var _default = getMonthsInYear;
|
|
26
13
|
exports.default = _default;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
14
|
-
|
|
15
8
|
const getYears = () => {
|
|
16
9
|
const year = new Date().getFullYear();
|
|
17
10
|
const startYear = year - 100;
|
|
18
|
-
return
|
|
11
|
+
return Array.from({
|
|
19
12
|
length: 200
|
|
20
13
|
}, (v, i) => startYear + i);
|
|
21
14
|
};
|
|
@@ -1,91 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
|
-
_Object$defineProperty(exports, "getDefaultFormatToken", {
|
|
6
|
+
Object.defineProperty(exports, "getDefaultFormatToken", {
|
|
12
7
|
enumerable: true,
|
|
13
8
|
get: function () {
|
|
14
9
|
return _getDefaultFormatToken.default;
|
|
15
10
|
}
|
|
16
11
|
});
|
|
17
|
-
|
|
18
|
-
_Object$defineProperty(exports, "getFullDateOffset", {
|
|
12
|
+
Object.defineProperty(exports, "getFullDateOffset", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
21
15
|
return _getFullDateOffset.default;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
|
-
|
|
25
|
-
_Object$defineProperty(exports, "getMonthsInYear", {
|
|
18
|
+
Object.defineProperty(exports, "getMonthsInYear", {
|
|
26
19
|
enumerable: true,
|
|
27
20
|
get: function () {
|
|
28
21
|
return _getMonthsInYear.default;
|
|
29
22
|
}
|
|
30
23
|
});
|
|
31
|
-
|
|
32
|
-
_Object$defineProperty(exports, "getYears", {
|
|
24
|
+
Object.defineProperty(exports, "getYears", {
|
|
33
25
|
enumerable: true,
|
|
34
26
|
get: function () {
|
|
35
27
|
return _getYears.default;
|
|
36
28
|
}
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
_Object$defineProperty(exports, "isAfter", {
|
|
30
|
+
Object.defineProperty(exports, "isAfter", {
|
|
40
31
|
enumerable: true,
|
|
41
32
|
get: function () {
|
|
42
33
|
return _isAfter.default;
|
|
43
34
|
}
|
|
44
35
|
});
|
|
45
|
-
|
|
46
|
-
_Object$defineProperty(exports, "isBefore", {
|
|
36
|
+
Object.defineProperty(exports, "isBefore", {
|
|
47
37
|
enumerable: true,
|
|
48
38
|
get: function () {
|
|
49
39
|
return _isBefore.default;
|
|
50
40
|
}
|
|
51
41
|
});
|
|
52
|
-
|
|
53
|
-
_Object$defineProperty(exports, "isBetween", {
|
|
42
|
+
Object.defineProperty(exports, "isBetween", {
|
|
54
43
|
enumerable: true,
|
|
55
44
|
get: function () {
|
|
56
45
|
return _isBetween.default;
|
|
57
46
|
}
|
|
58
47
|
});
|
|
59
|
-
|
|
60
|
-
_Object$defineProperty(exports, "isSameDay", {
|
|
48
|
+
Object.defineProperty(exports, "isSameDay", {
|
|
61
49
|
enumerable: true,
|
|
62
50
|
get: function () {
|
|
63
51
|
return _isSameDay.default;
|
|
64
52
|
}
|
|
65
53
|
});
|
|
66
|
-
|
|
67
|
-
_Object$defineProperty(exports, "isTimestamp", {
|
|
54
|
+
Object.defineProperty(exports, "isTimestamp", {
|
|
68
55
|
enumerable: true,
|
|
69
56
|
get: function () {
|
|
70
57
|
return _isTimestamp.default;
|
|
71
58
|
}
|
|
72
59
|
});
|
|
73
|
-
|
|
74
|
-
_Object$defineProperty(exports, "isUnixTimestamp", {
|
|
60
|
+
Object.defineProperty(exports, "isUnixTimestamp", {
|
|
75
61
|
enumerable: true,
|
|
76
62
|
get: function () {
|
|
77
63
|
return _isUnixTimestamp.default;
|
|
78
64
|
}
|
|
79
65
|
});
|
|
80
|
-
|
|
81
|
-
_Object$defineProperty(exports, "isValidDate", {
|
|
66
|
+
Object.defineProperty(exports, "isValidDate", {
|
|
82
67
|
enumerable: true,
|
|
83
68
|
get: function () {
|
|
84
69
|
return _isValidDate.default;
|
|
85
70
|
}
|
|
86
71
|
});
|
|
87
|
-
|
|
88
|
-
_Object$defineProperty(exports, "isWithinInterval", {
|
|
72
|
+
Object.defineProperty(exports, "isWithinInterval", {
|
|
89
73
|
enumerable: true,
|
|
90
74
|
get: function () {
|
|
91
75
|
return _isWithinInterval.default;
|
|
@@ -114,4 +98,6 @@ var _getYears = _interopRequireDefault(require("./getYears"));
|
|
|
114
98
|
|
|
115
99
|
var _getMonthsInYear = _interopRequireDefault(require("./getMonthsInYear"));
|
|
116
100
|
|
|
117
|
-
var _getFullDateOffset = _interopRequireDefault(require("./getFullDateOffset"));
|
|
101
|
+
var _getFullDateOffset = _interopRequireDefault(require("./getFullDateOffset"));
|
|
102
|
+
|
|
103
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isAfter;
|
|
12
7
|
|
|
13
8
|
var _dateFns = require("date-fns");
|
|
14
9
|
|
|
15
10
|
var _isString = _interopRequireDefault(require("../../utils/isString"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
function isAfter(date, dateToCompare) {
|
|
18
15
|
const dayOne = (0, _isString.default)(date) ? (0, _dateFns.parseISO)(date) : date;
|
|
19
16
|
const dayTwo = (0, _isString.default)(dateToCompare) ? (0, _dateFns.parseISO)(dateToCompare) : dateToCompare;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isBefore;
|
|
12
7
|
|
|
13
8
|
var _dateFns = require("date-fns");
|
|
14
9
|
|
|
15
10
|
var _isString = _interopRequireDefault(require("../../utils/isString"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
function isBefore(date, dateToCompare) {
|
|
18
15
|
const dayOne = (0, _isString.default)(date) ? (0, _dateFns.parseISO)(date) : date;
|
|
19
16
|
const dayTwo = (0, _isString.default)(dateToCompare) ? (0, _dateFns.parseISO)(dateToCompare) : dateToCompare;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isBetween;
|
|
12
7
|
|
|
13
8
|
var _dateFns = require("date-fns");
|
|
14
9
|
|
|
15
10
|
var _isString = _interopRequireDefault(require("../../utils/isString"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
/**
|
|
18
15
|
* is the date between start and end?(not including start and end)
|
|
19
16
|
* - if start > end, return false
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.default = isDate;
|
|
10
7
|
|
|
11
8
|
function isDate(date) {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isSameDay;
|
|
12
7
|
|
|
13
8
|
var _dateFns = require("date-fns");
|
|
14
9
|
|
|
15
10
|
var _isString = _interopRequireDefault(require("../../utils/isString"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
function isSameDay(date, dateToCompare) {
|
|
18
15
|
const dayOne = (0, _isString.default)(date) ? (0, _dateFns.parseISO)(date) : date;
|
|
19
16
|
const dayTwo = (0, _isString.default)(dateToCompare) ? (0, _dateFns.parseISO)(dateToCompare) : dateToCompare;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isTimestamp;
|
|
12
7
|
|
|
13
8
|
var _isValidDate = _interopRequireDefault(require("./isValidDate"));
|
|
14
9
|
|
|
15
10
|
var _isNumber = _interopRequireDefault(require("../../utils/isNumber"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
function isTimestamp(ts) {
|
|
18
15
|
return (0, _isNumber.default)(ts) && (0, _isValidDate.default)(new Date(ts));
|
|
19
16
|
}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = isUnixTimestamp;
|
|
12
7
|
|
|
13
8
|
var _isNumber = _interopRequireDefault(require("../../utils/isNumber"));
|
|
14
9
|
|
|
15
10
|
var _isValidDate = _interopRequireDefault(require("./isValidDate"));
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
function isUnixTimestamp(ts) {
|
|
18
15
|
return (0, _isNumber.default)(ts) && ts.toString().length === 10 && (0, _isValidDate.default)(new Date(ts * 1000));
|
|
19
16
|
}
|