@douyinfe/semi-foundation 2.19.0-alpha.8 → 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/popconfirm.css +1 -7
- package/lib/cjs/popconfirm/popconfirm.scss +1 -11
- 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/sideSheet.css +1 -0
- package/lib/cjs/sideSheet/sideSheet.scss +1 -0
- 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 +32 -33
- 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/mixin.scss +2 -2
- package/lib/cjs/table/rtl.scss +8 -8
- package/lib/cjs/table/table.scss +16 -16
- 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/table/variables.scss +0 -3
- 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/tree.css +3 -0
- package/lib/cjs/tree/tree.scss +4 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- 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.d.ts +1 -1
- 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/popconfirm/popconfirm.css +1 -7
- package/lib/es/popconfirm/popconfirm.scss +1 -11
- 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/sideSheet.css +1 -0
- package/lib/es/sideSheet/sideSheet.scss +1 -0
- package/lib/es/sideSheet/sideSheetFoundation.js +3 -7
- package/lib/es/slider/foundation.js +29 -25
- 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/mixin.scss +2 -2
- package/lib/es/table/rtl.scss +8 -8
- package/lib/es/table/table.scss +16 -16
- package/lib/es/table/utils.js +33 -51
- package/lib/es/table/variables.scss +0 -3
- 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/tree.css +3 -0
- package/lib/es/tree/tree.scss +4 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/tree/treeUtil.js +57 -109
- package/lib/es/treeSelect/foundation.js +45 -73
- package/lib/es/upload/constants.d.ts +1 -1
- 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/popconfirm/popconfirm.scss +1 -11
- package/select/foundation.ts +2 -2
- package/sideSheet/sideSheet.scss +1 -0
- package/slider/foundation.ts +15 -8
- package/table/mixin.scss +2 -2
- package/table/rtl.scss +8 -8
- package/table/table.scss +16 -16
- package/table/variables.scss +0 -3
- package/tree/tree.scss +4 -0
|
@@ -1,7 +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
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
4
|
-
|
|
5
1
|
/* eslint-disable no-param-reassign */
|
|
6
2
|
|
|
7
3
|
/* eslint-disable max-len */
|
|
@@ -15,7 +11,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
15
11
|
constructor(adapter) {
|
|
16
12
|
var _this;
|
|
17
13
|
|
|
18
|
-
super(
|
|
14
|
+
super(Object.assign(Object.assign({}, SliderFoundation.defaultAdapter), adapter));
|
|
19
15
|
_this = this;
|
|
20
16
|
|
|
21
17
|
/**
|
|
@@ -109,7 +105,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
109
105
|
|
|
110
106
|
|
|
111
107
|
this.valueFormatIsCorrect = value => {
|
|
112
|
-
if (
|
|
108
|
+
if (Array.isArray(value)) {
|
|
113
109
|
return typeof value[0] === 'number' && typeof value[0] === 'number';
|
|
114
110
|
} else {
|
|
115
111
|
return typeof value === 'number';
|
|
@@ -364,19 +360,29 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
364
360
|
|
|
365
361
|
|
|
366
362
|
this.outPutValue = inputValue => {
|
|
367
|
-
const
|
|
363
|
+
const checkHowManyDecimals = num => {
|
|
364
|
+
var _a, _b;
|
|
368
365
|
|
|
369
|
-
|
|
366
|
+
const reg = /^\d+(\.\d+)?$/;
|
|
370
367
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
368
|
+
if (reg.test(String(num))) {
|
|
369
|
+
return (_b = (_a = num.toString().split('.')[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return 0;
|
|
373
|
+
};
|
|
378
374
|
|
|
379
|
-
|
|
375
|
+
const step = this._adapter.getProp('step');
|
|
376
|
+
|
|
377
|
+
const transWay = (() => {
|
|
378
|
+
const decimals = checkHowManyDecimals(step);
|
|
379
|
+
const multipler = Math.pow(10, decimals);
|
|
380
|
+
return value => {
|
|
381
|
+
return Math.round(value * multipler) / multipler;
|
|
382
|
+
};
|
|
383
|
+
})();
|
|
384
|
+
|
|
385
|
+
if (Array.isArray(inputValue)) {
|
|
380
386
|
return [transWay(inputValue[0]), transWay(inputValue[1])];
|
|
381
387
|
} else {
|
|
382
388
|
return transWay(inputValue);
|
|
@@ -415,11 +421,11 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
415
421
|
const disableState = {};
|
|
416
422
|
|
|
417
423
|
if (this.valueFormatIsCorrect(nextValue)) {
|
|
418
|
-
if (
|
|
424
|
+
if (Array.isArray(prevValue) && Array.isArray(nextValue)) {
|
|
419
425
|
nextValue = [nextValue[0] < min ? min : nextValue[0], nextValue[1] > max ? max : nextValue[1] // Math.round(nextValue[1])
|
|
420
426
|
]; // this._adapter.notifyChange(this.outPutValue(nextValue));
|
|
421
427
|
|
|
422
|
-
resultState =
|
|
428
|
+
resultState = Object.assign(disableState, {
|
|
423
429
|
currentValue: nextValue
|
|
424
430
|
});
|
|
425
431
|
}
|
|
@@ -432,7 +438,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
432
438
|
} // this._adapter.notifyChange(this.outPutValue(nextValue));
|
|
433
439
|
|
|
434
440
|
|
|
435
|
-
resultState =
|
|
441
|
+
resultState = Object.assign(disableState, {
|
|
436
442
|
currentValue: nextValue
|
|
437
443
|
});
|
|
438
444
|
}
|
|
@@ -701,8 +707,6 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
701
707
|
};
|
|
702
708
|
|
|
703
709
|
this.handleKeyDown = (event, handler) => {
|
|
704
|
-
var _context;
|
|
705
|
-
|
|
706
710
|
const {
|
|
707
711
|
min,
|
|
708
712
|
max,
|
|
@@ -745,10 +749,10 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
745
749
|
break;
|
|
746
750
|
}
|
|
747
751
|
|
|
748
|
-
if (
|
|
752
|
+
if (["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "PageUp", "PageDown", "Home", "End"].includes(event.key)) {
|
|
749
753
|
let update = true;
|
|
750
754
|
|
|
751
|
-
if (
|
|
755
|
+
if (Array.isArray(currentValue)) {
|
|
752
756
|
update = !(currentValue[0] === outputValue[0] && currentValue[1] === outputValue[1]);
|
|
753
757
|
} else {
|
|
754
758
|
update = currentValue !== outputValue;
|
|
@@ -863,7 +867,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
863
867
|
const currentPos = this.transValueToPos(currentValue);
|
|
864
868
|
let isMin = true;
|
|
865
869
|
|
|
866
|
-
if (
|
|
870
|
+
if (Array.isArray(currentPos)) {
|
|
867
871
|
// Slide on both sides
|
|
868
872
|
if (pagePos > currentPos[1] || Math.abs(pagePos - currentPos[0]) > Math.abs(pagePos - currentPos[1])) {
|
|
869
873
|
isMin = false;
|
|
@@ -900,7 +904,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
900
904
|
} = this.getStates();
|
|
901
905
|
let checked;
|
|
902
906
|
|
|
903
|
-
if (
|
|
907
|
+
if (Array.isArray(currentValue)) {
|
|
904
908
|
checked = [];
|
|
905
909
|
checked[0] = this._checkValidity(currentValue[0], min, max);
|
|
906
910
|
checked[1] = this._checkValidity(currentValue[1], min, max);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
3
1
|
import BaseFoundation from '../base/foundation';
|
|
4
2
|
|
|
5
3
|
class SpinFoundation extends BaseFoundation {
|
|
6
4
|
constructor(adapter) {
|
|
7
|
-
super(
|
|
5
|
+
super(Object.assign(Object.assign({}, SpinFoundation.spinDefaultAdapter), adapter));
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
static get spinDefaultAdapter() {
|
|
@@ -26,7 +24,7 @@ class SpinFoundation extends BaseFoundation {
|
|
|
26
24
|
|
|
27
25
|
if (delay) {
|
|
28
26
|
const self = this;
|
|
29
|
-
this._timer =
|
|
27
|
+
this._timer = setTimeout(() => {
|
|
30
28
|
self._adapter.setState({
|
|
31
29
|
loading: propsSpinning,
|
|
32
30
|
delay: 0
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
1
|
import BaseFoundation from '../base/foundation';
|
|
3
2
|
import warning from '../utils/warning';
|
|
4
3
|
export default class SwitchFoundation extends BaseFoundation {
|
|
5
4
|
constructor(adapter) {
|
|
6
|
-
super(
|
|
5
|
+
super(Object.assign({}, adapter));
|
|
7
6
|
|
|
8
7
|
this.handleFocusVisible = event => {
|
|
9
8
|
const {
|
|
@@ -3,11 +3,6 @@ import _findLastIndex from "lodash/findLastIndex";
|
|
|
3
3
|
import _isMap from "lodash/isMap";
|
|
4
4
|
import _includes from "lodash/includes";
|
|
5
5
|
import _get from "lodash/get";
|
|
6
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
8
|
-
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
9
|
-
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
10
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
11
6
|
import BaseFoundation from '../base/foundation';
|
|
12
7
|
import { strings } from './constants';
|
|
13
8
|
import { getRecordKey, genExpandedRowKey, getRecordChildren, expandBtnShouldInRow } from './utils';
|
|
@@ -35,7 +30,7 @@ export default class TableBodyFoundation extends BaseFoundation {
|
|
|
35
30
|
if (!_isObject(newExpandRelatedProps) && !newExpandRelatedProps) {
|
|
36
31
|
const expandRelatedProps = strings.EXPAND_RELATED_PROPS; // eslint-disable-next-line no-param-reassign
|
|
37
32
|
|
|
38
|
-
newExpandRelatedProps =
|
|
33
|
+
newExpandRelatedProps = expandRelatedProps.map(key => _get(props, key, undefined));
|
|
39
34
|
}
|
|
40
35
|
|
|
41
36
|
this._adapter.setCachedExpandRelatedProps(newExpandRelatedProps);
|
|
@@ -56,8 +51,8 @@ export default class TableBodyFoundation extends BaseFoundation {
|
|
|
56
51
|
} = this.getProps();
|
|
57
52
|
|
|
58
53
|
if (level === 0 && _isMap(groups)) {
|
|
59
|
-
|
|
60
|
-
const firstIndex =
|
|
54
|
+
groups.forEach((set, key) => {
|
|
55
|
+
const firstIndex = dataSource.findIndex(record => set.has(getRecordKey(record, rowKey)));
|
|
61
56
|
|
|
62
57
|
if (firstIndex > -1) {
|
|
63
58
|
const lastIndex = _findLastIndex(dataSource, record => set.has(getRecordKey(record, rowKey)));
|
|
@@ -74,12 +69,12 @@ export default class TableBodyFoundation extends BaseFoundation {
|
|
|
74
69
|
});
|
|
75
70
|
|
|
76
71
|
if (expanded) {
|
|
77
|
-
flattenData.push(...this.flattenData(
|
|
72
|
+
flattenData.push(...this.flattenData(dataSource.slice(firstIndex, lastIndex + 1), level + 1, [...parentKeys], [...childrenKeys]));
|
|
78
73
|
}
|
|
79
74
|
}
|
|
80
75
|
});
|
|
81
76
|
} else {
|
|
82
|
-
|
|
77
|
+
dataSource.forEach((record, index) => {
|
|
83
78
|
const recordKey = getRecordKey(record, rowKey);
|
|
84
79
|
const children = getRecordChildren(record, childrenRecordName);
|
|
85
80
|
|
|
@@ -98,7 +93,7 @@ export default class TableBodyFoundation extends BaseFoundation {
|
|
|
98
93
|
const extras = [];
|
|
99
94
|
|
|
100
95
|
if (_includes(expandedRowKeys, recordKey)) {
|
|
101
|
-
if (
|
|
96
|
+
if (Array.isArray(children) && children.length) {
|
|
102
97
|
extras.push(...this.flattenData(children, level + 1, [...item.parentKeys], [...item.childrenKeys]));
|
|
103
98
|
} else if (expandedRowRender) {
|
|
104
99
|
extras.push({
|