@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,4 +1,3 @@
|
|
|
1
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
2
1
|
import { addMonths } from 'date-fns';
|
|
3
2
|
import isValidDate from './isValidDate';
|
|
4
3
|
import { compatibleParse } from './parser';
|
|
@@ -13,8 +12,8 @@ export default function getDefaultPickerDate(options) {
|
|
|
13
12
|
format,
|
|
14
13
|
dateFnsLocale
|
|
15
14
|
} = options;
|
|
16
|
-
let nowDate =
|
|
17
|
-
let nextDate =
|
|
15
|
+
let nowDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
|
|
16
|
+
let nextDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[1] : undefined;
|
|
18
17
|
|
|
19
18
|
switch (true) {
|
|
20
19
|
case isValidDate(nowDate):
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
1
|
import { getDefaultFormatTokenByType } from './getDefaultFormatToken';
|
|
3
2
|
/**
|
|
4
3
|
* 获取 insetInput 输入框的 placeholder
|
|
@@ -17,8 +16,6 @@ import { getDefaultFormatTokenByType } from './getDefaultFormatToken';
|
|
|
17
16
|
*/
|
|
18
17
|
|
|
19
18
|
export default function getInsetInputFormatToken(options) {
|
|
20
|
-
var _context;
|
|
21
|
-
|
|
22
19
|
const {
|
|
23
20
|
format,
|
|
24
21
|
type
|
|
@@ -32,7 +29,7 @@ export default function getInsetInputFormatToken(options) {
|
|
|
32
29
|
case 'dateTime':
|
|
33
30
|
case 'dateTimeRange':
|
|
34
31
|
const dateTimeResult = dateTimeReg.exec(format);
|
|
35
|
-
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ?
|
|
32
|
+
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? "".concat(dateTimeResult[1], " ").concat(dateTimeResult[2]) : defaultToken;
|
|
36
33
|
break;
|
|
37
34
|
|
|
38
35
|
case 'date':
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
*
|
|
5
3
|
* @param {string} month
|
|
@@ -9,15 +7,13 @@ import { startOfMonth, lastDayOfMonth, getDaysInMonth, // getDay,
|
|
|
9
7
|
format } from 'date-fns';
|
|
10
8
|
|
|
11
9
|
function formatFullDate() {
|
|
12
|
-
var _context, _context2;
|
|
13
|
-
|
|
14
10
|
let year = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
15
11
|
let month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
16
12
|
let day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
17
13
|
let dateStr = '';
|
|
18
14
|
const monthFull = typeof month === 'number' && month < 10 ? "0".concat(month) : month.toString();
|
|
19
15
|
const dayNumberFull = typeof day === 'number' && day < 10 ? "0".concat(day) : day.toString();
|
|
20
|
-
dateStr =
|
|
16
|
+
dateStr = "".concat(String(year), "-").concat(monthFull, "-").concat(dayNumberFull);
|
|
21
17
|
return dateStr;
|
|
22
18
|
}
|
|
23
19
|
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
3
|
-
|
|
4
|
-
const getMonthsInYear = year => _Array$from({
|
|
1
|
+
const getMonthsInYear = year => Array.from({
|
|
5
2
|
length: 12
|
|
6
|
-
}, (v, i) =>
|
|
7
|
-
var _context;
|
|
8
|
-
|
|
9
|
-
return _concatInstanceProperty(_context = "".concat(year, "-")).call(_context, i + 1);
|
|
10
|
-
});
|
|
3
|
+
}, (v, i) => "".concat(year, "-").concat(i + 1));
|
|
11
4
|
|
|
12
5
|
export default getMonthsInYear;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
|
-
|
|
3
1
|
const getYears = () => {
|
|
4
2
|
const year = new Date().getFullYear();
|
|
5
3
|
const startYear = year - 100;
|
|
6
|
-
return
|
|
4
|
+
return Array.from({
|
|
7
5
|
length: 200
|
|
8
6
|
}, (v, i) => startYear + i);
|
|
9
7
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
1
|
import { VALIDATE_STATUS, BASE_CLASS_PREFIX } from '../base/constants';
|
|
3
2
|
import { numbers as popoverNumber, strings as POPOVER_STRINGS } from '../popover/constants';
|
|
4
3
|
const dayItemClasses = {
|
|
@@ -22,8 +21,7 @@ const dayItemClasses = {
|
|
|
22
21
|
DAY_HOVER_DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-inrange"),
|
|
23
22
|
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-around-singleselected")
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
const cssClasses = _Object$assign({
|
|
24
|
+
const cssClasses = Object.assign({
|
|
27
25
|
PREFIX: "".concat(BASE_CLASS_PREFIX, "-datepicker"),
|
|
28
26
|
NAVIGATION: "".concat(BASE_CLASS_PREFIX, "-datepicker-navigation"),
|
|
29
27
|
PANEL_YAM: "".concat(BASE_CLASS_PREFIX, "-datepicker-panel-yam"),
|
|
@@ -33,15 +31,13 @@ const cssClasses = _Object$assign({
|
|
|
33
31
|
WEEK: "".concat(BASE_CLASS_PREFIX, "-datepicker-week"),
|
|
34
32
|
DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day")
|
|
35
33
|
}, dayItemClasses);
|
|
36
|
-
|
|
37
34
|
const formatToken = {
|
|
38
35
|
FORMAT_FULL_DATE: 'yyyy-MM-dd',
|
|
39
36
|
FORMAT_TIME_PICKER: 'HH:mm:ss',
|
|
40
37
|
FORMAT_DATE_TIME: 'yyyy-MM-dd HH:mm:ss',
|
|
41
38
|
FORMAT_YEAR_MONTH: 'yyyy-MM'
|
|
42
39
|
};
|
|
43
|
-
|
|
44
|
-
const strings = _Object$assign({
|
|
40
|
+
const strings = Object.assign({
|
|
45
41
|
DEFAULT_SEPARATOR_MULTIPLE: ',',
|
|
46
42
|
DEFAULT_SEPARATOR_RANGE: ' ~ ',
|
|
47
43
|
SIZE_SET: ['small', 'default', 'large'],
|
|
@@ -54,7 +50,6 @@ const strings = _Object$assign({
|
|
|
54
50
|
POSITION_SET: POPOVER_STRINGS.POSITION_SET,
|
|
55
51
|
POSITION_INLINE_INPUT: 'leftTopOver'
|
|
56
52
|
}, formatToken);
|
|
57
|
-
|
|
58
53
|
const numbers = {
|
|
59
54
|
WEEK_START_ON: 0,
|
|
60
55
|
WEEK_HEIGHT: 36,
|
|
@@ -3,21 +3,6 @@ import _isEqual from "lodash/isEqual";
|
|
|
3
3
|
import _isString from "lodash/isString";
|
|
4
4
|
import _isObject from "lodash/isObject";
|
|
5
5
|
import _get from "lodash/get";
|
|
6
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
7
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
8
|
-
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
9
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
10
|
-
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
11
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
12
|
-
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
|
13
|
-
import _everyInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/every";
|
|
14
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
15
|
-
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
|
16
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
17
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
18
|
-
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
19
|
-
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
20
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
21
6
|
|
|
22
7
|
/* eslint-disable no-nested-ternary */
|
|
23
8
|
|
|
@@ -41,7 +26,7 @@ import getInsetInputValueFromInsetInputStr from './_utils/getInsetInputValueFrom
|
|
|
41
26
|
|
|
42
27
|
export default class DatePickerFoundation extends BaseFoundation {
|
|
43
28
|
constructor(adapter) {
|
|
44
|
-
super(
|
|
29
|
+
super(Object.assign({}, adapter));
|
|
45
30
|
/**
|
|
46
31
|
* clear range input focus when open is controlled
|
|
47
32
|
* fixed github 1375
|
|
@@ -62,7 +47,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
62
47
|
};
|
|
63
48
|
|
|
64
49
|
this.getMergedMotion = motion => {
|
|
65
|
-
const mergedMotion = typeof motion === 'undefined' || motion ?
|
|
50
|
+
const mergedMotion = typeof motion === 'undefined' || motion ? Object.assign(Object.assign({}, motion), {
|
|
66
51
|
didEnter: () => {
|
|
67
52
|
this._adapter.setMotionEnd(true);
|
|
68
53
|
},
|
|
@@ -82,8 +67,8 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
82
67
|
this._isRangeValueComplete = value => {
|
|
83
68
|
let result = false;
|
|
84
69
|
|
|
85
|
-
if (
|
|
86
|
-
result = !
|
|
70
|
+
if (Array.isArray(value)) {
|
|
71
|
+
result = !value.some(date => isNullOrUndefined(date));
|
|
87
72
|
}
|
|
88
73
|
|
|
89
74
|
return result;
|
|
@@ -109,13 +94,11 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
109
94
|
}
|
|
110
95
|
|
|
111
96
|
isValidTimeZone(timeZone) {
|
|
112
|
-
var _context;
|
|
113
|
-
|
|
114
97
|
const propTimeZone = this.getProp('timeZone');
|
|
115
98
|
|
|
116
99
|
const _timeZone = isNullOrUndefined(timeZone) ? propTimeZone : timeZone;
|
|
117
100
|
|
|
118
|
-
return
|
|
101
|
+
return ['string', 'number'].includes(typeof _timeZone) && _timeZone !== '';
|
|
119
102
|
}
|
|
120
103
|
|
|
121
104
|
initFromProps(_ref) {
|
|
@@ -125,7 +108,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
125
108
|
prevTimeZone
|
|
126
109
|
} = _ref;
|
|
127
110
|
|
|
128
|
-
const _value = (
|
|
111
|
+
const _value = (Array.isArray(value) ? [...value] : (value || value === 0) && [value]) || [];
|
|
129
112
|
|
|
130
113
|
const result = this.parseWithTimezone(_value, timeZone, prevTimeZone);
|
|
131
114
|
|
|
@@ -162,7 +145,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
162
145
|
parseWithTimezone(value, timeZone, prevTimeZone) {
|
|
163
146
|
const result = [];
|
|
164
147
|
|
|
165
|
-
if (
|
|
148
|
+
if (Array.isArray(value) && value.length) {
|
|
166
149
|
for (const v of value) {
|
|
167
150
|
let parsedV = (v || v === 0) && this._parseValue(v);
|
|
168
151
|
|
|
@@ -308,7 +291,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
308
291
|
cachedSelectedValue
|
|
309
292
|
} = this._adapter.getStates();
|
|
310
293
|
|
|
311
|
-
const newCachedSelectedValue =
|
|
294
|
+
const newCachedSelectedValue = Array.isArray(willUpdateDates) ? willUpdateDates : value;
|
|
312
295
|
|
|
313
296
|
if (!_isEqual(newCachedSelectedValue, cachedSelectedValue)) {
|
|
314
297
|
this._adapter.updateCachedSelectedValue(newCachedSelectedValue);
|
|
@@ -503,8 +486,6 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
503
486
|
|
|
504
487
|
|
|
505
488
|
handleInputFocus(e, range) {
|
|
506
|
-
var _context2;
|
|
507
|
-
|
|
508
489
|
const rangeInputFocus = this._adapter.getState('rangeInputFocus');
|
|
509
490
|
|
|
510
491
|
range && this._adapter.setRangeInputFocus(range);
|
|
@@ -513,7 +494,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
513
494
|
* not rangeType: notify when focus
|
|
514
495
|
*/
|
|
515
496
|
|
|
516
|
-
if (!range || !
|
|
497
|
+
if (!range || !['rangeStart', 'rangeEnd'].includes(rangeInputFocus)) {
|
|
517
498
|
this._adapter.notifyFocus(e, range);
|
|
518
499
|
}
|
|
519
500
|
}
|
|
@@ -623,16 +604,15 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
623
604
|
case 'dateTimeRange':
|
|
624
605
|
const separator = rangeSeparator;
|
|
625
606
|
const values = input.split(separator);
|
|
626
|
-
parsedResult = values &&
|
|
607
|
+
parsedResult = values && values.reduce((arr, cur) => {
|
|
627
608
|
const parsedVal = cur && compatibleParse(cur, formatToken, nowDate, dateFnsLocale);
|
|
628
609
|
parsedVal && arr.push(parsedVal);
|
|
629
610
|
return arr;
|
|
630
611
|
}, []);
|
|
631
|
-
formatedInput = parsedResult &&
|
|
612
|
+
formatedInput = parsedResult && parsedResult.map(v => v && isValid(v) && this.localeFormat(v, formatToken)).join(separator);
|
|
632
613
|
|
|
633
614
|
if (parsedResult && formatedInput === input) {
|
|
634
|
-
|
|
635
|
-
|
|
615
|
+
parsedResult.sort((d1, d2) => d1.getTime() - d2.getTime());
|
|
636
616
|
result = parsedResult;
|
|
637
617
|
}
|
|
638
618
|
|
|
@@ -705,7 +685,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
705
685
|
case 'dateTimeRange':
|
|
706
686
|
const separator = rangeSeparator;
|
|
707
687
|
const values = input.split(separator);
|
|
708
|
-
parsedResult = values &&
|
|
688
|
+
parsedResult = values && values.reduce((arr, cur) => {
|
|
709
689
|
let parsedVal = null;
|
|
710
690
|
|
|
711
691
|
const _parsedResult = compatibleParse(cur, formatToken, nowDate, dateFnsLocale);
|
|
@@ -722,8 +702,8 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
722
702
|
return arr;
|
|
723
703
|
}, []);
|
|
724
704
|
|
|
725
|
-
if (
|
|
726
|
-
|
|
705
|
+
if (Array.isArray(parsedResult) && parsedResult.every(item => isValid(item))) {
|
|
706
|
+
parsedResult.sort((d1, d2) => d1.getTime() - d2.getTime());
|
|
727
707
|
}
|
|
728
708
|
|
|
729
709
|
result = parsedResult;
|
|
@@ -758,11 +738,11 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
758
738
|
|
|
759
739
|
for (const curInput of inputArr) {
|
|
760
740
|
let tmpParsed = curInput && this.parseInputLoose(curInput);
|
|
761
|
-
tmpParsed =
|
|
741
|
+
tmpParsed = Array.isArray(tmpParsed) ? tmpParsed : tmpParsed && [tmpParsed];
|
|
762
742
|
|
|
763
743
|
if (tmpParsed && tmpParsed.length) {
|
|
764
744
|
if (needDedupe) {
|
|
765
|
-
!
|
|
745
|
+
!result.filter(r => Boolean(tmpParsed.find(tp => isSameSecond(r, tp)))) && result.push(...tmpParsed);
|
|
766
746
|
} else {
|
|
767
747
|
result.push(...tmpParsed);
|
|
768
748
|
}
|
|
@@ -798,12 +778,12 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
798
778
|
|
|
799
779
|
for (const curInput of inputArr) {
|
|
800
780
|
let tmpParsed = curInput && this.parseInput(curInput);
|
|
801
|
-
tmpParsed =
|
|
781
|
+
tmpParsed = Array.isArray(tmpParsed) ? tmpParsed : tmpParsed && [tmpParsed];
|
|
802
782
|
|
|
803
783
|
if (tmpParsed && tmpParsed.length) {
|
|
804
784
|
if (needDedupe) {
|
|
805
785
|
// 20190519 TODO: needs to determine the case where multiple is true and range
|
|
806
|
-
!
|
|
786
|
+
!result.filter(r => Boolean(tmpParsed.find(tp => isSameSecond(r, tp)))) && result.push(...tmpParsed);
|
|
807
787
|
} else {
|
|
808
788
|
result.push(...tmpParsed);
|
|
809
789
|
}
|
|
@@ -832,7 +812,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
832
812
|
let str = '';
|
|
833
813
|
const rangeSeparator = this.getProp('rangeSeparator');
|
|
834
814
|
|
|
835
|
-
if (
|
|
815
|
+
if (Array.isArray(dates) && dates.length) {
|
|
836
816
|
const type = this.getProp('type');
|
|
837
817
|
const formatToken = customFormat || this.getProp('format') || getDefaultFormatTokenByType(type);
|
|
838
818
|
|
|
@@ -849,18 +829,12 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
849
829
|
const endIsTruthy = !isNullOrUndefined(dates[1]);
|
|
850
830
|
|
|
851
831
|
if (startIsTruthy && endIsTruthy) {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
str = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = "".concat(this.localeFormat(dates[0], formatToken))).call(_context4, rangeSeparator)).call(_context3, this.localeFormat(dates[1], formatToken));
|
|
832
|
+
str = "".concat(this.localeFormat(dates[0], formatToken)).concat(rangeSeparator).concat(this.localeFormat(dates[1], formatToken));
|
|
855
833
|
} else {
|
|
856
834
|
if (startIsTruthy) {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
str = _concatInstanceProperty(_context5 = "".concat(this.localeFormat(dates[0], formatToken))).call(_context5, rangeSeparator);
|
|
835
|
+
str = "".concat(this.localeFormat(dates[0], formatToken)).concat(rangeSeparator);
|
|
860
836
|
} else if (endIsTruthy) {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
str = _concatInstanceProperty(_context6 = "".concat(rangeSeparator)).call(_context6, this.localeFormat(dates[1], formatToken));
|
|
837
|
+
str = "".concat(rangeSeparator).concat(this.localeFormat(dates[1], formatToken));
|
|
864
838
|
}
|
|
865
839
|
}
|
|
866
840
|
|
|
@@ -887,21 +861,20 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
887
861
|
let customFormat = arguments.length > 2 ? arguments[2] : undefined;
|
|
888
862
|
const strs = [];
|
|
889
863
|
|
|
890
|
-
if (
|
|
864
|
+
if (Array.isArray(dates) && dates.length) {
|
|
891
865
|
const type = this.getProp('type');
|
|
892
866
|
|
|
893
867
|
switch (type) {
|
|
894
868
|
case 'date':
|
|
895
869
|
case 'dateTime':
|
|
896
870
|
case 'month':
|
|
897
|
-
|
|
898
|
-
|
|
871
|
+
dates.forEach(date => strs.push(this.formatDates([date], customFormat)));
|
|
899
872
|
break;
|
|
900
873
|
|
|
901
874
|
case 'dateRange':
|
|
902
875
|
case 'dateTimeRange':
|
|
903
876
|
for (let i = 0; i < dates.length; i += 2) {
|
|
904
|
-
strs.push(this.formatDates(
|
|
877
|
+
strs.push(this.formatDates(dates.slice(i, i + 2), customFormat));
|
|
905
878
|
}
|
|
906
879
|
|
|
907
880
|
break;
|
|
@@ -927,7 +900,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
927
900
|
let _value;
|
|
928
901
|
|
|
929
902
|
if (forceUpdateValue || value) {
|
|
930
|
-
if (!
|
|
903
|
+
if (!Array.isArray(value)) {
|
|
931
904
|
_value = value ? [value] : [];
|
|
932
905
|
} else {
|
|
933
906
|
_value = value;
|
|
@@ -976,7 +949,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
976
949
|
|
|
977
950
|
const needCheckFocusRecord = _get(options, 'needCheckFocusRecord', true);
|
|
978
951
|
|
|
979
|
-
const dates =
|
|
952
|
+
const dates = Array.isArray(value) ? [...value] : value ? [value] : [];
|
|
980
953
|
|
|
981
954
|
const changedDates = this._getChangedDates(dates);
|
|
982
955
|
|
|
@@ -1168,11 +1141,11 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1168
1141
|
|
|
1169
1142
|
|
|
1170
1143
|
disposeCallbackArgs(value) {
|
|
1171
|
-
let _value =
|
|
1144
|
+
let _value = Array.isArray(value) ? value : value && [value] || [];
|
|
1172
1145
|
|
|
1173
1146
|
if (this.isValidTimeZone()) {
|
|
1174
1147
|
const timeZone = this.getProp('timeZone');
|
|
1175
|
-
_value =
|
|
1148
|
+
_value = _value.map(date => zonedTimeToUtc(date, timeZone));
|
|
1176
1149
|
}
|
|
1177
1150
|
|
|
1178
1151
|
const type = this.getProp('type');
|
|
@@ -1187,7 +1160,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1187
1160
|
notifyValue = _value[0] && this.localeFormat(_value[0], formatToken);
|
|
1188
1161
|
[notifyDate] = _value;
|
|
1189
1162
|
} else {
|
|
1190
|
-
notifyValue =
|
|
1163
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
1191
1164
|
notifyDate = [..._value];
|
|
1192
1165
|
}
|
|
1193
1166
|
|
|
@@ -1195,7 +1168,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1195
1168
|
|
|
1196
1169
|
case 'dateRange':
|
|
1197
1170
|
case 'dateTimeRange':
|
|
1198
|
-
notifyValue =
|
|
1171
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
1199
1172
|
notifyDate = [..._value];
|
|
1200
1173
|
break;
|
|
1201
1174
|
|
|
@@ -1264,9 +1237,8 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1264
1237
|
break;
|
|
1265
1238
|
|
|
1266
1239
|
default:
|
|
1267
|
-
const stateValueSet = new
|
|
1268
|
-
|
|
1269
|
-
_forEachInstanceProperty(stateValue).call(stateValue, value => stateValueSet.add(isDate(value) && value.valueOf()));
|
|
1240
|
+
const stateValueSet = new Set();
|
|
1241
|
+
stateValue.forEach(value => stateValueSet.add(isDate(value) && value.valueOf()));
|
|
1270
1242
|
|
|
1271
1243
|
for (const date of dates) {
|
|
1272
1244
|
if (!stateValueSet.has(isDate(date) && date.valueOf())) {
|
|
@@ -1291,7 +1263,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1291
1263
|
rangeEnd: ''
|
|
1292
1264
|
}; // DisabledDate needs to pass the second parameter
|
|
1293
1265
|
|
|
1294
|
-
if (this._isRangeType() &&
|
|
1266
|
+
if (this._isRangeType() && Array.isArray(stateValue)) {
|
|
1295
1267
|
if (isValid(stateValue[0])) {
|
|
1296
1268
|
const rangeStart = format(stateValue[0], 'yyyy-MM-dd');
|
|
1297
1269
|
disabledOptions.rangeStart = rangeStart;
|
|
@@ -1345,11 +1317,8 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1345
1317
|
const {
|
|
1346
1318
|
notifyDate
|
|
1347
1319
|
} = this.disposeCallbackArgs(date);
|
|
1348
|
-
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1351
|
-
const notifyDateIsArray = _Array$isArray(notifyDate);
|
|
1352
|
-
|
|
1320
|
+
const dateIsArray = Array.isArray(date);
|
|
1321
|
+
const notifyDateIsArray = Array.isArray(notifyDate);
|
|
1353
1322
|
let disposeDate;
|
|
1354
1323
|
|
|
1355
1324
|
if (dateIsArray === notifyDateIsArray) {
|
|
@@ -1436,7 +1405,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1436
1405
|
|
|
1437
1406
|
if (this._isRangeType() && !rangeInputFocus) {
|
|
1438
1407
|
if (this._adapter.isEventTarget(e)) {
|
|
1439
|
-
|
|
1408
|
+
setTimeout(() => {
|
|
1440
1409
|
// using setTimeout get correct state value 'rangeInputFocus'
|
|
1441
1410
|
this.handleInputFocus(e, 'rangeStart');
|
|
1442
1411
|
}, 0);
|
|
@@ -1461,7 +1430,7 @@ export default class DatePickerFoundation extends BaseFoundation {
|
|
|
1461
1430
|
*/
|
|
1462
1431
|
|
|
1463
1432
|
|
|
1464
|
-
|
|
1433
|
+
setTimeout(() => {
|
|
1465
1434
|
this._adapter.setTriggerDisabled(true);
|
|
1466
1435
|
}, 0);
|
|
1467
1436
|
} else {
|
|
@@ -2,9 +2,6 @@ import _get from "lodash/get";
|
|
|
2
2
|
import _set from "lodash/set";
|
|
3
3
|
import _isObject from "lodash/isObject";
|
|
4
4
|
import _cloneDeep from "lodash/cloneDeep";
|
|
5
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
6
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
7
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
5
|
import { format as formatFn } from 'date-fns';
|
|
9
6
|
import BaseFoundation from '../base/foundation';
|
|
10
7
|
import { formatDateValues } from './_utils/formatter';
|
|
@@ -19,7 +16,7 @@ const KEY_CODE_ENTER = 'Enter';
|
|
|
19
16
|
const KEY_CODE_TAB = 'Tab';
|
|
20
17
|
export default class InputFoundation extends BaseFoundation {
|
|
21
18
|
constructor(adapter) {
|
|
22
|
-
super(
|
|
19
|
+
super(Object.assign({}, adapter));
|
|
23
20
|
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24
21
|
|
|
25
22
|
|
|
@@ -177,7 +174,7 @@ export default class InputFoundation extends BaseFoundation {
|
|
|
177
174
|
dateFnsLocale
|
|
178
175
|
});
|
|
179
176
|
|
|
180
|
-
if (
|
|
177
|
+
if (type.includes('Time')) {
|
|
181
178
|
let timeStr = '';
|
|
182
179
|
|
|
183
180
|
const dateFormatToken = _get(format.split(' '), '0', strings.FORMAT_FULL_DATE);
|
|
@@ -301,18 +298,14 @@ export default class InputFoundation extends BaseFoundation {
|
|
|
301
298
|
}
|
|
302
299
|
|
|
303
300
|
concatInsetDateAndTime(_ref2) {
|
|
304
|
-
var _context;
|
|
305
|
-
|
|
306
301
|
let {
|
|
307
302
|
date,
|
|
308
303
|
time
|
|
309
304
|
} = _ref2;
|
|
310
|
-
return
|
|
305
|
+
return "".concat(date, " ").concat(time);
|
|
311
306
|
}
|
|
312
307
|
|
|
313
308
|
concatInsetDateRange(_ref3) {
|
|
314
|
-
var _context2, _context3;
|
|
315
|
-
|
|
316
309
|
let {
|
|
317
310
|
rangeStart,
|
|
318
311
|
rangeEnd
|
|
@@ -322,7 +315,7 @@ export default class InputFoundation extends BaseFoundation {
|
|
|
322
315
|
rangeSeparator
|
|
323
316
|
} = this._adapter.getProps();
|
|
324
317
|
|
|
325
|
-
return
|
|
318
|
+
return "".concat(rangeStart).concat(rangeSeparator).concat(rangeEnd);
|
|
326
319
|
}
|
|
327
320
|
|
|
328
321
|
concatInsetInputValue(_ref4) {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
3
1
|
import BaseFoundation from '../base/foundation'; // import { cssClasses, strings } from './constants';
|
|
4
2
|
|
|
5
3
|
import getMonthTable from './_utils/getMonthTable';
|
|
@@ -8,7 +6,7 @@ import { format } from 'date-fns';
|
|
|
8
6
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
9
7
|
export default class CalendarMonthFoundation extends BaseFoundation {
|
|
10
8
|
constructor(adapter) {
|
|
11
|
-
super(
|
|
9
|
+
super(Object.assign({}, adapter));
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
init() {
|
|
@@ -43,7 +41,7 @@ export default class CalendarMonthFoundation extends BaseFoundation {
|
|
|
43
41
|
|
|
44
42
|
if (isNullOrUndefined(weeksRowNum)) {
|
|
45
43
|
this._adapter.setWeeksRowNum(weeks.length);
|
|
46
|
-
} else if (
|
|
44
|
+
} else if (Array.isArray(weeks) && weeks.length !== weeksRowNum) {
|
|
47
45
|
this._adapter.setWeeksRowNum(weeks.length, () => {
|
|
48
46
|
this._adapter.notifyWeeksRowNumChange(weeks.length);
|
|
49
47
|
});
|