@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.default = isValidDate;
|
|
10
7
|
|
|
11
8
|
function isValidDate(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 = isWithinInterval;
|
|
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 isWithinInterval(day, _ref) {
|
|
18
15
|
let {
|
|
19
16
|
start,
|
|
@@ -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.compatibleParse = compatibleParse;
|
|
10
7
|
exports.isValueParseValid = isValueParseValid;
|
|
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.strings = exports.numbers = exports.cssClasses = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
8
|
var _constants = require("../base/constants");
|
|
16
9
|
|
|
17
10
|
var _constants2 = require("../popover/constants");
|
|
@@ -37,7 +30,7 @@ const dayItemClasses = {
|
|
|
37
30
|
DAY_HOVER_DAY_IN_RANGE: "".concat(_constants.BASE_CLASS_PREFIX, "-datepicker-day-hoverday-inrange"),
|
|
38
31
|
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: "".concat(_constants.BASE_CLASS_PREFIX, "-datepicker-day-hoverday-around-singleselected")
|
|
39
32
|
};
|
|
40
|
-
const cssClasses =
|
|
33
|
+
const cssClasses = Object.assign({
|
|
41
34
|
PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-datepicker"),
|
|
42
35
|
NAVIGATION: "".concat(_constants.BASE_CLASS_PREFIX, "-datepicker-navigation"),
|
|
43
36
|
PANEL_YAM: "".concat(_constants.BASE_CLASS_PREFIX, "-datepicker-panel-yam"),
|
|
@@ -54,7 +47,7 @@ const formatToken = {
|
|
|
54
47
|
FORMAT_DATE_TIME: 'yyyy-MM-dd HH:mm:ss',
|
|
55
48
|
FORMAT_YEAR_MONTH: 'yyyy-MM'
|
|
56
49
|
};
|
|
57
|
-
const strings =
|
|
50
|
+
const strings = Object.assign({
|
|
58
51
|
DEFAULT_SEPARATOR_MULTIPLE: ',',
|
|
59
52
|
DEFAULT_SEPARATOR_RANGE: ' ~ ',
|
|
60
53
|
SIZE_SET: ['small', 'default', 'large'],
|
|
@@ -1,45 +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 = 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 _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
18
|
-
|
|
19
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
20
|
-
|
|
21
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
22
|
-
|
|
23
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
24
|
-
|
|
25
|
-
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
26
|
-
|
|
27
|
-
var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
|
|
28
|
-
|
|
29
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
30
|
-
|
|
31
|
-
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
32
|
-
|
|
33
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
34
|
-
|
|
35
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
36
|
-
|
|
37
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
38
|
-
|
|
39
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
40
|
-
|
|
41
|
-
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
|
42
|
-
|
|
43
8
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
44
9
|
|
|
45
10
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
@@ -72,6 +37,8 @@ var _getInsetInputFormatToken = _interopRequireDefault(require("./_utils/getInse
|
|
|
72
37
|
|
|
73
38
|
var _getInsetInputValueFromInsetInputStr = _interopRequireDefault(require("./_utils/getInsetInputValueFromInsetInputStr"));
|
|
74
39
|
|
|
40
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
+
|
|
75
42
|
/* eslint-disable no-nested-ternary */
|
|
76
43
|
|
|
77
44
|
/* eslint-disable max-len, max-depth, */
|
|
@@ -83,7 +50,7 @@ var _getInsetInputValueFromInsetInputStr = _interopRequireDefault(require("./_ut
|
|
|
83
50
|
*/
|
|
84
51
|
class DatePickerFoundation extends _foundation.default {
|
|
85
52
|
constructor(adapter) {
|
|
86
|
-
super(
|
|
53
|
+
super(Object.assign({}, adapter));
|
|
87
54
|
/**
|
|
88
55
|
* clear range input focus when open is controlled
|
|
89
56
|
* fixed github 1375
|
|
@@ -104,7 +71,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
104
71
|
};
|
|
105
72
|
|
|
106
73
|
this.getMergedMotion = motion => {
|
|
107
|
-
const mergedMotion = typeof motion === 'undefined' || motion ?
|
|
74
|
+
const mergedMotion = typeof motion === 'undefined' || motion ? Object.assign(Object.assign({}, motion), {
|
|
108
75
|
didEnter: () => {
|
|
109
76
|
this._adapter.setMotionEnd(true);
|
|
110
77
|
},
|
|
@@ -124,8 +91,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
124
91
|
this._isRangeValueComplete = value => {
|
|
125
92
|
let result = false;
|
|
126
93
|
|
|
127
|
-
if (
|
|
128
|
-
result = !
|
|
94
|
+
if (Array.isArray(value)) {
|
|
95
|
+
result = !value.some(date => (0, _isNullOrUndefined.default)(date));
|
|
129
96
|
}
|
|
130
97
|
|
|
131
98
|
return result;
|
|
@@ -151,13 +118,11 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
151
118
|
}
|
|
152
119
|
|
|
153
120
|
isValidTimeZone(timeZone) {
|
|
154
|
-
var _context;
|
|
155
|
-
|
|
156
121
|
const propTimeZone = this.getProp('timeZone');
|
|
157
122
|
|
|
158
123
|
const _timeZone = (0, _isNullOrUndefined.default)(timeZone) ? propTimeZone : timeZone;
|
|
159
124
|
|
|
160
|
-
return
|
|
125
|
+
return ['string', 'number'].includes(typeof _timeZone) && _timeZone !== '';
|
|
161
126
|
}
|
|
162
127
|
|
|
163
128
|
initFromProps(_ref) {
|
|
@@ -167,7 +132,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
167
132
|
prevTimeZone
|
|
168
133
|
} = _ref;
|
|
169
134
|
|
|
170
|
-
const _value = (
|
|
135
|
+
const _value = (Array.isArray(value) ? [...value] : (value || value === 0) && [value]) || [];
|
|
171
136
|
|
|
172
137
|
const result = this.parseWithTimezone(_value, timeZone, prevTimeZone);
|
|
173
138
|
|
|
@@ -204,7 +169,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
204
169
|
parseWithTimezone(value, timeZone, prevTimeZone) {
|
|
205
170
|
const result = [];
|
|
206
171
|
|
|
207
|
-
if (
|
|
172
|
+
if (Array.isArray(value) && value.length) {
|
|
208
173
|
for (const v of value) {
|
|
209
174
|
let parsedV = (v || v === 0) && this._parseValue(v);
|
|
210
175
|
|
|
@@ -350,7 +315,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
350
315
|
cachedSelectedValue
|
|
351
316
|
} = this._adapter.getStates();
|
|
352
317
|
|
|
353
|
-
const newCachedSelectedValue =
|
|
318
|
+
const newCachedSelectedValue = Array.isArray(willUpdateDates) ? willUpdateDates : value;
|
|
354
319
|
|
|
355
320
|
if (!(0, _isEqual2.default)(newCachedSelectedValue, cachedSelectedValue)) {
|
|
356
321
|
this._adapter.updateCachedSelectedValue(newCachedSelectedValue);
|
|
@@ -545,8 +510,6 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
545
510
|
|
|
546
511
|
|
|
547
512
|
handleInputFocus(e, range) {
|
|
548
|
-
var _context2;
|
|
549
|
-
|
|
550
513
|
const rangeInputFocus = this._adapter.getState('rangeInputFocus');
|
|
551
514
|
|
|
552
515
|
range && this._adapter.setRangeInputFocus(range);
|
|
@@ -555,7 +518,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
555
518
|
* not rangeType: notify when focus
|
|
556
519
|
*/
|
|
557
520
|
|
|
558
|
-
if (!range || !
|
|
521
|
+
if (!range || !['rangeStart', 'rangeEnd'].includes(rangeInputFocus)) {
|
|
559
522
|
this._adapter.notifyFocus(e, range);
|
|
560
523
|
}
|
|
561
524
|
}
|
|
@@ -665,15 +628,15 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
665
628
|
case 'dateTimeRange':
|
|
666
629
|
const separator = rangeSeparator;
|
|
667
630
|
const values = input.split(separator);
|
|
668
|
-
parsedResult = values &&
|
|
631
|
+
parsedResult = values && values.reduce((arr, cur) => {
|
|
669
632
|
const parsedVal = cur && (0, _parser.compatibleParse)(cur, formatToken, nowDate, dateFnsLocale);
|
|
670
633
|
parsedVal && arr.push(parsedVal);
|
|
671
634
|
return arr;
|
|
672
635
|
}, []);
|
|
673
|
-
formatedInput = parsedResult &&
|
|
636
|
+
formatedInput = parsedResult && parsedResult.map(v => v && (0, _dateFns.isValid)(v) && this.localeFormat(v, formatToken)).join(separator);
|
|
674
637
|
|
|
675
638
|
if (parsedResult && formatedInput === input) {
|
|
676
|
-
|
|
639
|
+
parsedResult.sort((d1, d2) => d1.getTime() - d2.getTime());
|
|
677
640
|
result = parsedResult;
|
|
678
641
|
}
|
|
679
642
|
|
|
@@ -746,7 +709,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
746
709
|
case 'dateTimeRange':
|
|
747
710
|
const separator = rangeSeparator;
|
|
748
711
|
const values = input.split(separator);
|
|
749
|
-
parsedResult = values &&
|
|
712
|
+
parsedResult = values && values.reduce((arr, cur) => {
|
|
750
713
|
let parsedVal = null;
|
|
751
714
|
|
|
752
715
|
const _parsedResult = (0, _parser.compatibleParse)(cur, formatToken, nowDate, dateFnsLocale);
|
|
@@ -763,8 +726,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
763
726
|
return arr;
|
|
764
727
|
}, []);
|
|
765
728
|
|
|
766
|
-
if (
|
|
767
|
-
|
|
729
|
+
if (Array.isArray(parsedResult) && parsedResult.every(item => (0, _dateFns.isValid)(item))) {
|
|
730
|
+
parsedResult.sort((d1, d2) => d1.getTime() - d2.getTime());
|
|
768
731
|
}
|
|
769
732
|
|
|
770
733
|
result = parsedResult;
|
|
@@ -799,11 +762,11 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
799
762
|
|
|
800
763
|
for (const curInput of inputArr) {
|
|
801
764
|
let tmpParsed = curInput && this.parseInputLoose(curInput);
|
|
802
|
-
tmpParsed =
|
|
765
|
+
tmpParsed = Array.isArray(tmpParsed) ? tmpParsed : tmpParsed && [tmpParsed];
|
|
803
766
|
|
|
804
767
|
if (tmpParsed && tmpParsed.length) {
|
|
805
768
|
if (needDedupe) {
|
|
806
|
-
!
|
|
769
|
+
!result.filter(r => Boolean(tmpParsed.find(tp => (0, _dateFns.isSameSecond)(r, tp)))) && result.push(...tmpParsed);
|
|
807
770
|
} else {
|
|
808
771
|
result.push(...tmpParsed);
|
|
809
772
|
}
|
|
@@ -839,12 +802,12 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
839
802
|
|
|
840
803
|
for (const curInput of inputArr) {
|
|
841
804
|
let tmpParsed = curInput && this.parseInput(curInput);
|
|
842
|
-
tmpParsed =
|
|
805
|
+
tmpParsed = Array.isArray(tmpParsed) ? tmpParsed : tmpParsed && [tmpParsed];
|
|
843
806
|
|
|
844
807
|
if (tmpParsed && tmpParsed.length) {
|
|
845
808
|
if (needDedupe) {
|
|
846
809
|
// 20190519 TODO: needs to determine the case where multiple is true and range
|
|
847
|
-
!
|
|
810
|
+
!result.filter(r => Boolean(tmpParsed.find(tp => (0, _dateFns.isSameSecond)(r, tp)))) && result.push(...tmpParsed);
|
|
848
811
|
} else {
|
|
849
812
|
result.push(...tmpParsed);
|
|
850
813
|
}
|
|
@@ -873,7 +836,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
873
836
|
let str = '';
|
|
874
837
|
const rangeSeparator = this.getProp('rangeSeparator');
|
|
875
838
|
|
|
876
|
-
if (
|
|
839
|
+
if (Array.isArray(dates) && dates.length) {
|
|
877
840
|
const type = this.getProp('type');
|
|
878
841
|
const formatToken = customFormat || this.getProp('format') || (0, _getDefaultFormatToken.getDefaultFormatTokenByType)(type);
|
|
879
842
|
|
|
@@ -890,18 +853,12 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
890
853
|
const endIsTruthy = !(0, _isNullOrUndefined.default)(dates[1]);
|
|
891
854
|
|
|
892
855
|
if (startIsTruthy && endIsTruthy) {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
str = (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.localeFormat(dates[0], formatToken))).call(_context4, rangeSeparator)).call(_context3, this.localeFormat(dates[1], formatToken));
|
|
856
|
+
str = "".concat(this.localeFormat(dates[0], formatToken)).concat(rangeSeparator).concat(this.localeFormat(dates[1], formatToken));
|
|
896
857
|
} else {
|
|
897
858
|
if (startIsTruthy) {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
str = (0, _concat.default)(_context5 = "".concat(this.localeFormat(dates[0], formatToken))).call(_context5, rangeSeparator);
|
|
859
|
+
str = "".concat(this.localeFormat(dates[0], formatToken)).concat(rangeSeparator);
|
|
901
860
|
} else if (endIsTruthy) {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
str = (0, _concat.default)(_context6 = "".concat(rangeSeparator)).call(_context6, this.localeFormat(dates[1], formatToken));
|
|
861
|
+
str = "".concat(rangeSeparator).concat(this.localeFormat(dates[1], formatToken));
|
|
905
862
|
}
|
|
906
863
|
}
|
|
907
864
|
|
|
@@ -928,20 +885,20 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
928
885
|
let customFormat = arguments.length > 2 ? arguments[2] : undefined;
|
|
929
886
|
const strs = [];
|
|
930
887
|
|
|
931
|
-
if (
|
|
888
|
+
if (Array.isArray(dates) && dates.length) {
|
|
932
889
|
const type = this.getProp('type');
|
|
933
890
|
|
|
934
891
|
switch (type) {
|
|
935
892
|
case 'date':
|
|
936
893
|
case 'dateTime':
|
|
937
894
|
case 'month':
|
|
938
|
-
|
|
895
|
+
dates.forEach(date => strs.push(this.formatDates([date], customFormat)));
|
|
939
896
|
break;
|
|
940
897
|
|
|
941
898
|
case 'dateRange':
|
|
942
899
|
case 'dateTimeRange':
|
|
943
900
|
for (let i = 0; i < dates.length; i += 2) {
|
|
944
|
-
strs.push(this.formatDates(
|
|
901
|
+
strs.push(this.formatDates(dates.slice(i, i + 2), customFormat));
|
|
945
902
|
}
|
|
946
903
|
|
|
947
904
|
break;
|
|
@@ -967,7 +924,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
967
924
|
let _value;
|
|
968
925
|
|
|
969
926
|
if (forceUpdateValue || value) {
|
|
970
|
-
if (!
|
|
927
|
+
if (!Array.isArray(value)) {
|
|
971
928
|
_value = value ? [value] : [];
|
|
972
929
|
} else {
|
|
973
930
|
_value = value;
|
|
@@ -1013,7 +970,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1013
970
|
*/
|
|
1014
971
|
|
|
1015
972
|
const needCheckFocusRecord = (0, _get2.default)(options, 'needCheckFocusRecord', true);
|
|
1016
|
-
const dates =
|
|
973
|
+
const dates = Array.isArray(value) ? [...value] : value ? [value] : [];
|
|
1017
974
|
|
|
1018
975
|
const changedDates = this._getChangedDates(dates);
|
|
1019
976
|
|
|
@@ -1205,11 +1162,11 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1205
1162
|
|
|
1206
1163
|
|
|
1207
1164
|
disposeCallbackArgs(value) {
|
|
1208
|
-
let _value =
|
|
1165
|
+
let _value = Array.isArray(value) ? value : value && [value] || [];
|
|
1209
1166
|
|
|
1210
1167
|
if (this.isValidTimeZone()) {
|
|
1211
1168
|
const timeZone = this.getProp('timeZone');
|
|
1212
|
-
_value =
|
|
1169
|
+
_value = _value.map(date => (0, _dateFnsExtra.zonedTimeToUtc)(date, timeZone));
|
|
1213
1170
|
}
|
|
1214
1171
|
|
|
1215
1172
|
const type = this.getProp('type');
|
|
@@ -1224,7 +1181,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1224
1181
|
notifyValue = _value[0] && this.localeFormat(_value[0], formatToken);
|
|
1225
1182
|
[notifyDate] = _value;
|
|
1226
1183
|
} else {
|
|
1227
|
-
notifyValue =
|
|
1184
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
1228
1185
|
notifyDate = [..._value];
|
|
1229
1186
|
}
|
|
1230
1187
|
|
|
@@ -1232,7 +1189,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1232
1189
|
|
|
1233
1190
|
case 'dateRange':
|
|
1234
1191
|
case 'dateTimeRange':
|
|
1235
|
-
notifyValue =
|
|
1192
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
1236
1193
|
notifyDate = [..._value];
|
|
1237
1194
|
break;
|
|
1238
1195
|
|
|
@@ -1301,8 +1258,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1301
1258
|
break;
|
|
1302
1259
|
|
|
1303
1260
|
default:
|
|
1304
|
-
const stateValueSet = new
|
|
1305
|
-
|
|
1261
|
+
const stateValueSet = new Set();
|
|
1262
|
+
stateValue.forEach(value => stateValueSet.add((0, _dateFns.isDate)(value) && value.valueOf()));
|
|
1306
1263
|
|
|
1307
1264
|
for (const date of dates) {
|
|
1308
1265
|
if (!stateValueSet.has((0, _dateFns.isDate)(date) && date.valueOf())) {
|
|
@@ -1327,7 +1284,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1327
1284
|
rangeEnd: ''
|
|
1328
1285
|
}; // DisabledDate needs to pass the second parameter
|
|
1329
1286
|
|
|
1330
|
-
if (this._isRangeType() &&
|
|
1287
|
+
if (this._isRangeType() && Array.isArray(stateValue)) {
|
|
1331
1288
|
if ((0, _dateFns.isValid)(stateValue[0])) {
|
|
1332
1289
|
const rangeStart = (0, _dateFns.format)(stateValue[0], 'yyyy-MM-dd');
|
|
1333
1290
|
disabledOptions.rangeStart = rangeStart;
|
|
@@ -1381,8 +1338,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1381
1338
|
const {
|
|
1382
1339
|
notifyDate
|
|
1383
1340
|
} = this.disposeCallbackArgs(date);
|
|
1384
|
-
const dateIsArray =
|
|
1385
|
-
const notifyDateIsArray =
|
|
1341
|
+
const dateIsArray = Array.isArray(date);
|
|
1342
|
+
const notifyDateIsArray = Array.isArray(notifyDate);
|
|
1386
1343
|
let disposeDate;
|
|
1387
1344
|
|
|
1388
1345
|
if (dateIsArray === notifyDateIsArray) {
|
|
@@ -1469,7 +1426,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1469
1426
|
|
|
1470
1427
|
if (this._isRangeType() && !rangeInputFocus) {
|
|
1471
1428
|
if (this._adapter.isEventTarget(e)) {
|
|
1472
|
-
(
|
|
1429
|
+
setTimeout(() => {
|
|
1473
1430
|
// using setTimeout get correct state value 'rangeInputFocus'
|
|
1474
1431
|
this.handleInputFocus(e, 'rangeStart');
|
|
1475
1432
|
}, 0);
|
|
@@ -1494,7 +1451,7 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
1494
1451
|
*/
|
|
1495
1452
|
|
|
1496
1453
|
|
|
1497
|
-
(
|
|
1454
|
+
setTimeout(() => {
|
|
1498
1455
|
this._adapter.setTriggerDisabled(true);
|
|
1499
1456
|
}, 0);
|
|
1500
1457
|
} else {
|
|
@@ -1,21 +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 = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
|
-
|
|
17
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
18
|
-
|
|
19
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
20
9
|
|
|
21
10
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
@@ -44,12 +33,14 @@ var _parser = require("./_utils/parser");
|
|
|
44
33
|
|
|
45
34
|
var _utils = require("./_utils");
|
|
46
35
|
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
|
|
47
38
|
const KEY_CODE_ENTER = 'Enter';
|
|
48
39
|
const KEY_CODE_TAB = 'Tab';
|
|
49
40
|
|
|
50
41
|
class InputFoundation extends _foundation.default {
|
|
51
42
|
constructor(adapter) {
|
|
52
|
-
super(
|
|
43
|
+
super(Object.assign({}, adapter));
|
|
53
44
|
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
54
45
|
|
|
55
46
|
|
|
@@ -204,7 +195,7 @@ class InputFoundation extends _foundation.default {
|
|
|
204
195
|
dateFnsLocale
|
|
205
196
|
});
|
|
206
197
|
|
|
207
|
-
if (
|
|
198
|
+
if (type.includes('Time')) {
|
|
208
199
|
let timeStr = '';
|
|
209
200
|
const dateFormatToken = (0, _get2.default)(format.split(' '), '0', _constants.strings.FORMAT_FULL_DATE);
|
|
210
201
|
const timeFormatToken = (0, _get2.default)(format.split(' '), '1', _constants.strings.FORMAT_TIME_PICKER);
|
|
@@ -326,18 +317,14 @@ class InputFoundation extends _foundation.default {
|
|
|
326
317
|
}
|
|
327
318
|
|
|
328
319
|
concatInsetDateAndTime(_ref2) {
|
|
329
|
-
var _context;
|
|
330
|
-
|
|
331
320
|
let {
|
|
332
321
|
date,
|
|
333
322
|
time
|
|
334
323
|
} = _ref2;
|
|
335
|
-
return
|
|
324
|
+
return "".concat(date, " ").concat(time);
|
|
336
325
|
}
|
|
337
326
|
|
|
338
327
|
concatInsetDateRange(_ref3) {
|
|
339
|
-
var _context2, _context3;
|
|
340
|
-
|
|
341
328
|
let {
|
|
342
329
|
rangeStart,
|
|
343
330
|
rangeEnd
|
|
@@ -347,7 +334,7 @@ class InputFoundation extends _foundation.default {
|
|
|
347
334
|
rangeSeparator
|
|
348
335
|
} = this._adapter.getProps();
|
|
349
336
|
|
|
350
|
-
return
|
|
337
|
+
return "".concat(rangeStart).concat(rangeSeparator).concat(rangeEnd);
|
|
351
338
|
}
|
|
352
339
|
|
|
353
340
|
concatInsetInputValue(_ref4) {
|
|
@@ -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.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
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
18
9
|
|
|
19
10
|
var _getMonthTable = _interopRequireDefault(require("./_utils/getMonthTable"));
|
|
@@ -24,10 +15,12 @@ var _dateFns = require("date-fns");
|
|
|
24
15
|
|
|
25
16
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
26
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
27
20
|
// import { cssClasses, strings } from './constants';
|
|
28
21
|
class CalendarMonthFoundation extends _foundation.default {
|
|
29
22
|
constructor(adapter) {
|
|
30
|
-
super(
|
|
23
|
+
super(Object.assign({}, adapter));
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
init() {
|
|
@@ -62,7 +55,7 @@ class CalendarMonthFoundation extends _foundation.default {
|
|
|
62
55
|
|
|
63
56
|
if ((0, _isNullOrUndefined.default)(weeksRowNum)) {
|
|
64
57
|
this._adapter.setWeeksRowNum(weeks.length);
|
|
65
|
-
} else if (
|
|
58
|
+
} else if (Array.isArray(weeks) && weeks.length !== weeksRowNum) {
|
|
66
59
|
this._adapter.setWeeksRowNum(weeks.length, () => {
|
|
67
60
|
this._adapter.notifyWeeksRowNumChange(weeks.length);
|
|
68
61
|
});
|