@douyinfe/semi-foundation 2.0.9-alpha.2 → 2.1.0-alpha.2

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.
Files changed (79) hide show
  1. package/calendar/foundation.ts +1 -1
  2. package/cascader/foundation.ts +1 -1
  3. package/collapse/foundation.ts +1 -1
  4. package/lib/es/anchor/foundation.js +12 -20
  5. package/lib/es/backtop/foundation.js +3 -5
  6. package/lib/es/base/foundation.js +2 -7
  7. package/lib/es/calendar/eventUtil.js +3 -9
  8. package/lib/es/cascader/foundation.d.ts +1 -1
  9. package/lib/es/cascader/foundation.js +4 -8
  10. package/lib/es/collapse/foundation.d.ts +1 -1
  11. package/lib/es/datePicker/_utils/formatter.js +5 -7
  12. package/lib/es/datePicker/_utils/getDayOfWeek.js +3 -4
  13. package/lib/es/datePicker/_utils/getMonthTable.js +2 -6
  14. package/lib/es/datePicker/_utils/isBetween.js +4 -5
  15. package/lib/es/datePicker/_utils/isWithinInterval.js +4 -5
  16. package/lib/es/datePicker/foundation.js +16 -46
  17. package/lib/es/datePicker/monthsGridFoundation.js +7 -15
  18. package/lib/es/form/foundation.js +8 -14
  19. package/lib/es/form/utils.js +2 -4
  20. package/lib/es/input/util/calculateNodeHeight.js +1 -4
  21. package/lib/es/inputNumber/foundation.js +5 -18
  22. package/lib/es/navigation/NavItem.js +1 -3
  23. package/lib/es/navigation/foundation.js +6 -25
  24. package/lib/es/navigation/subNavFoundation.js +2 -12
  25. package/lib/es/overflowList/foundation.js +3 -6
  26. package/lib/es/pagination/foundation.js +1 -5
  27. package/lib/es/popconfirm/popconfirmFoundation.d.ts +2 -0
  28. package/lib/es/popconfirm/popconfirmFoundation.js +4 -0
  29. package/lib/es/scrollList/itemFoundation.js +2 -4
  30. package/lib/es/scrollList/scrollTo.js +3 -4
  31. package/lib/es/select/foundation.js +11 -7
  32. package/lib/es/sideSheet/sideSheetFoundation.js +8 -11
  33. package/lib/es/slider/foundation.js +4 -11
  34. package/lib/es/table/bodyFoundation.js +1 -5
  35. package/lib/es/table/foundation.js +13 -29
  36. package/lib/es/table/utils.js +24 -64
  37. package/lib/es/tabs/foundation.d.ts +3 -0
  38. package/lib/es/tabs/foundation.js +4 -8
  39. package/lib/es/tabs/tabs.css +13 -1
  40. package/lib/es/tabs/tabs.scss +96 -76
  41. package/lib/es/tagInput/foundation.d.ts +1 -0
  42. package/lib/es/tagInput/foundation.js +2 -0
  43. package/lib/es/timePicker/ComboxFoundation.js +1 -2
  44. package/lib/es/timePicker/foundation.js +11 -20
  45. package/lib/es/timePicker/utils/index.js +5 -16
  46. package/lib/es/timePicker/utils/localeDate.js +2 -8
  47. package/lib/es/timeline/timeline.css +1 -0
  48. package/lib/es/timeline/timeline.scss +1 -0
  49. package/lib/es/timeline/variables.scss +1 -0
  50. package/lib/es/tooltip/foundation.js +19 -26
  51. package/lib/es/tree/foundation.d.ts +1 -1
  52. package/lib/es/tree/foundation.js +2 -4
  53. package/lib/es/tree/treeUtil.d.ts +1 -1
  54. package/lib/es/tree/treeUtil.js +19 -29
  55. package/lib/es/treeSelect/foundation.d.ts +10 -11
  56. package/lib/es/treeSelect/foundation.js +1 -2
  57. package/lib/es/upload/constants.d.ts +1 -1
  58. package/lib/es/upload/foundation.js +27 -32
  59. package/lib/es/utils/Event.js +4 -11
  60. package/lib/es/utils/Logger.js +5 -27
  61. package/lib/es/utils/array.js +1 -3
  62. package/lib/es/utils/classnames.js +2 -12
  63. package/lib/es/utils/dom.js +2 -10
  64. package/lib/es/utils/getHighlight.js +19 -24
  65. package/lib/es/utils/log.js +1 -5
  66. package/lib/es/utils/object.js +2 -5
  67. package/lib/es/utils/touchPolyfill.js +1 -3
  68. package/package.json +3 -3
  69. package/popconfirm/popconfirmFoundation.ts +5 -0
  70. package/select/foundation.ts +6 -5
  71. package/tabs/foundation.ts +7 -8
  72. package/tabs/tabs.scss +96 -76
  73. package/tagInput/foundation.ts +2 -0
  74. package/timeline/timeline.scss +1 -0
  75. package/timeline/variables.scss +1 -0
  76. package/tooltip/foundation.ts +4 -2
  77. package/tree/foundation.ts +1 -1
  78. package/tree/treeUtil.ts +1 -1
  79. package/treeSelect/foundation.ts +10 -9
@@ -83,7 +83,7 @@ export type MonthData = Record<number, DateObj[]>;
83
83
  // cacheEventKeys: (cachedKeys: Array<string>) => void;
84
84
  // }
85
85
 
86
- export type ParsedEventsType = ParsedEvents | ParsedEventsWithArray | MonthlyEvent
86
+ export type ParsedEventsType = ParsedEvents | ParsedEventsWithArray | MonthlyEvent;
87
87
 
88
88
  export interface CalendarAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
89
89
  updateCurrPos?: (currPos: number) => void;
@@ -77,7 +77,7 @@ export interface BasicTriggerRenderProps {
77
77
  /** The hierarchical position of the selected node in treeData,
78
78
  * as in the following example, when Zhejiang-Hangzhou-Xiaoshan
79
79
  * District is selected, the value here is 0-0-1 */
80
- value?: string;
80
+ value?: string | Set<string>;
81
81
  /* The input value of the current input box */
82
82
  inputValue: string;
83
83
  /* Cascader's placeholder */
@@ -23,7 +23,7 @@ export interface CollapseState{
23
23
  }
24
24
 
25
25
  export interface CollapseAdapter extends DefaultAdapter<CollapseProps, CollapseState>{
26
- handleChange: (...args: ArgsType<CollapseProps['onChange']>) => ReturnType<CollapseProps['onChange']>;
26
+ handleChange: (activeKey: CollapseProps['activeKey'], e: any) => void;
27
27
  // getStates: () => CollapseState;
28
28
  // getProps: () => CollapseProps;
29
29
  addActiveKey: (newSet: CollapseState['activeSet']) => void;
@@ -7,12 +7,8 @@ import { cssClasses } from './constants';
7
7
  const prefixCls = cssClasses.PREFIX;
8
8
  export default class AnchorFoundation extends BaseFoundation {
9
9
  constructor(adapter) {
10
- var _this;
10
+ super(_Object$assign(_Object$assign({}, AnchorFoundation.defaultAdapter), adapter)); // eslint-disable-next-line @typescript-eslint/no-empty-function
11
11
 
12
- super(_Object$assign(_Object$assign({}, AnchorFoundation.defaultAdapter), adapter));
13
- _this = this;
14
-
15
- // eslint-disable-next-line @typescript-eslint/no-empty-function
16
12
  this.init = () => {}; // eslint-disable-next-line @typescript-eslint/no-empty-function
17
13
 
18
14
 
@@ -26,18 +22,16 @@ export default class AnchorFoundation extends BaseFoundation {
26
22
  this._adapter.removeLink(link);
27
23
  };
28
24
 
29
- this.setActiveLink = function (link, prevLink) {
30
- let shouldNotify = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
31
-
32
- const activeLink = _this._adapter.getState('activeLink');
25
+ this.setActiveLink = (link, prevLink, shouldNotify = true) => {
26
+ const activeLink = this._adapter.getState('activeLink');
33
27
 
34
- const onChange = _this._adapter.getProp('onChange');
28
+ const onChange = this._adapter.getProp('onChange');
35
29
 
36
30
  if (activeLink !== link) {
37
- _this._adapter.setActiveLink(link, _this._setActiveSlide);
31
+ this._adapter.setActiveLink(link, this._setActiveSlide);
38
32
 
39
33
  if (onChange && shouldNotify) {
40
- _this._adapter.notifyChange(link, prevLink);
34
+ this._adapter.notifyChange(link, prevLink);
41
35
  }
42
36
  }
43
37
  }; // Adjust rail height according to text link content height
@@ -118,22 +112,20 @@ export default class AnchorFoundation extends BaseFoundation {
118
112
  this.setActiveLink(activeLink, prevActiveLink);
119
113
  };
120
114
 
121
- this.handleClick = function (e, link) {
122
- let shouldNotify = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
123
-
124
- const destNode = _this._adapter.getContentNode(link);
115
+ this.handleClick = (e, link, shouldNotify = true) => {
116
+ const destNode = this._adapter.getContentNode(link);
125
117
 
126
- const prevLink = _this._adapter.getState('activeLink');
118
+ const prevLink = this._adapter.getState('activeLink');
127
119
 
128
- _this.setActiveLink(link, prevLink, shouldNotify);
120
+ this.setActiveLink(link, prevLink, shouldNotify);
129
121
 
130
122
  if (destNode) {
131
123
  try {
132
- _this._adapter.setClickLinkWithCallBack(true, link, _this._scrollIntoView);
124
+ this._adapter.setClickLinkWithCallBack(true, link, this._scrollIntoView);
133
125
  } catch (error) {}
134
126
  }
135
127
 
136
- shouldNotify && _this._adapter.notifyClick(e, link);
128
+ shouldNotify && this._adapter.notifyClick(e, link);
137
129
  };
138
130
 
139
131
  this.handleClickLink = () => {
@@ -20,11 +20,9 @@ export default class BackTopFoundation extends BaseFoundation {
20
20
  duration,
21
21
  easing: 'easeInOutCubic'
22
22
  });
23
- this.animation.on('frame', _ref => {
24
- let {
25
- scrollTop
26
- } = _ref;
27
-
23
+ this.animation.on('frame', ({
24
+ scrollTop
25
+ }) => {
28
26
  this._adapter.targetScrollToTop(targetNode, scrollTop);
29
27
  });
30
28
  this.animation.start();
@@ -98,8 +98,7 @@ class BaseFoundation {
98
98
  } // Determine whether a controlled component
99
99
 
100
100
 
101
- _isControlledComponent() {
102
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'value';
101
+ _isControlledComponent(key = 'value') {
103
102
  const props = this.getProps();
104
103
  const isControlComponent = (key in props);
105
104
  return isControlComponent;
@@ -117,11 +116,7 @@ class BaseFoundation {
117
116
  destroy() {// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
118
117
  }
119
118
 
120
- log(text) {
121
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
122
- rest[_key - 1] = arguments[_key];
123
- }
124
-
119
+ log(text, ...rest) {
125
120
  log(text, ...rest);
126
121
  }
127
122
 
@@ -8,9 +8,7 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
8
8
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
9
9
  import { format, isSameMonth, isWeekend, differenceInCalendarDays, isBefore, addDays, startOfWeek, endOfWeek, getSeconds, differenceInHours, getMinutes, getHours, addHours, isSameDay, endOfDay, startOfDay, toDate } from 'date-fns';
10
10
 
11
- const copyEvent = function (event, date, start, end) {
12
- let allDay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
13
-
11
+ const copyEvent = (event, date, start, end, allDay = false) => {
14
12
  const copied = _Object$assign({}, event);
15
13
 
16
14
  copied.date = date;
@@ -116,9 +114,7 @@ export const calcRangeData = (value, start, rangeLen, mode, locale) => {
116
114
  * create weekly object array
117
115
  */
118
116
 
119
- export const calcWeekData = function (value) {
120
- let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'week';
121
- let locale = arguments.length > 2 ? arguments[2] : undefined;
117
+ export const calcWeekData = (value, mode = 'week', locale) => {
122
118
  const start = startOfWeek(value);
123
119
  return calcRangeData(value, start, 7, mode, locale);
124
120
  };
@@ -130,9 +126,7 @@ export const calcWeekData = function (value) {
130
126
  * parsed a spanned all-day event into multiple dates
131
127
  */
132
128
 
133
- export const parseAllDayEvent = function (event) {
134
- let allDay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
135
- let currDate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
129
+ export const parseAllDayEvent = (event, allDay = true, currDate = undefined) => {
136
130
  const res = [];
137
131
  const {
138
132
  start,
@@ -40,7 +40,7 @@ export interface BasicTriggerRenderProps {
40
40
  /** The hierarchical position of the selected node in treeData,
41
41
  * as in the following example, when Zhejiang-Hangzhou-Xiaoshan
42
42
  * District is selected, the value here is 0-0-1 */
43
- value?: string;
43
+ value?: string | Set<string>;
44
44
  inputValue: string;
45
45
  placeholder?: string;
46
46
  /** The function used to update the value of the input box. You
@@ -18,10 +18,7 @@ import { convertDataToEntities, findKeysForValues, normalizedArr, isValid } from
18
18
 
19
19
  export default class CascaderFoundation extends BaseFoundation {
20
20
  constructor(adapter) {
21
- var _this;
22
-
23
21
  super(_Object$assign({}, adapter));
24
- _this = this;
25
22
 
26
23
  this.getMergedMotion = () => {
27
24
  const {
@@ -33,14 +30,14 @@ export default class CascaderFoundation extends BaseFoundation {
33
30
 
34
31
  if (isSearching) {
35
32
  const mergedMotion = typeof motion === 'undefined' || motion ? _Object$assign(_Object$assign({}, motion), {
36
- didLeave: function () {
33
+ didLeave: (...args) => {
37
34
  const didLeave = get(motion, 'didLeave');
38
35
 
39
36
  if (typeof didLeave === 'function') {
40
- didLeave(...arguments);
37
+ didLeave(...args);
41
38
  }
42
39
 
43
- _this._adapter.updateStates({
40
+ this._adapter.updateStates({
44
41
  isSearching: false
45
42
  });
46
43
  }
@@ -212,8 +209,7 @@ export default class CascaderFoundation extends BaseFoundation {
212
209
  return cacheValue;
213
210
  }
214
211
 
215
- collectOptions() {
216
- let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
212
+ collectOptions(init = false) {
217
213
  const {
218
214
  treeData,
219
215
  value,
@@ -18,7 +18,7 @@ export interface CollapseState {
18
18
  activeSet: Set<string>;
19
19
  }
20
20
  export interface CollapseAdapter extends DefaultAdapter<CollapseProps, CollapseState> {
21
- handleChange: (...args: ArgsType<CollapseProps['onChange']>) => ReturnType<CollapseProps['onChange']>;
21
+ handleChange: (activeKey: CollapseProps['activeKey'], e: any) => void;
22
22
  addActiveKey: (newSet: CollapseState['activeSet']) => void;
23
23
  }
24
24
  export default class CollapseFoundation extends BaseFoundation<CollapseAdapter> {
@@ -16,13 +16,11 @@ import { strings } from '../constants';
16
16
  * @returns {string}
17
17
  */
18
18
 
19
- export function formatDateValues(values, formatToken) {
20
- let {
21
- groupInnerSeparator = strings.DEFAULT_SEPARATOR_RANGE,
22
- groupSize = 1,
23
- groupSeparator = strings.DEFAULT_SEPARATOR_MULTIPLE
24
- } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25
- let locale = arguments.length > 3 ? arguments[3] : undefined;
19
+ export function formatDateValues(values, formatToken, {
20
+ groupInnerSeparator = strings.DEFAULT_SEPARATOR_RANGE,
21
+ groupSize = 1,
22
+ groupSeparator = strings.DEFAULT_SEPARATOR_MULTIPLE
23
+ } = {}, locale) {
26
24
  let text = '';
27
25
  (groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1); // console.log(values, formatToken, groupInnerSeparator, groupSize, groupSeparator);
28
26
 
@@ -4,10 +4,9 @@
4
4
  * the index of the first day of the week (0-Sunday,1-Monday, etc)
5
5
  *
6
6
  */
7
- const getDayofWeek = _ref => {
8
- let {
9
- weekStartsOn = 0
10
- } = _ref;
7
+ const getDayofWeek = ({
8
+ weekStartsOn = 0
9
+ }) => {
11
10
  const weekDay = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
12
11
 
13
12
  for (let index = 0; index < weekStartsOn; index++) {
@@ -8,12 +8,9 @@ import { startOfMonth, lastDayOfMonth, getDaysInMonth, // getDay,
8
8
  // parseISO,
9
9
  format } from 'date-fns';
10
10
 
11
- function formatFullDate() {
11
+ function formatFullDate(year = '', month = '', day = '') {
12
12
  var _context, _context2;
13
13
 
14
- let year = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
15
- let month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
16
- let day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
17
14
  let dateStr = '';
18
15
  const monthFull = typeof month === 'number' && month < 10 ? "0".concat(month) : month.toString();
19
16
  const dayNumberFull = typeof day === 'number' && day < 10 ? "0".concat(day) : day.toString();
@@ -21,8 +18,7 @@ function formatFullDate() {
21
18
  return dateStr;
22
19
  }
23
20
 
24
- function getWeeks(date) {
25
- let weekStartsOn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
21
+ function getWeeks(date, weekStartsOn = 0) {
26
22
  const weekDayNotInMonth = {
27
23
  dayNumber: '',
28
24
  dateNumberFull: '',
@@ -8,11 +8,10 @@ import isString from '../../utils/isString';
8
8
  * @returns {Boolean}
9
9
  */
10
10
 
11
- export default function isBetween(day, _ref) {
12
- let {
13
- start,
14
- end
15
- } = _ref;
11
+ export default function isBetween(day, {
12
+ start,
13
+ end
14
+ }) {
16
15
  const d = isString(day) ? parseISO(day) : day;
17
16
  const s = isString(start) ? parseISO(start) : start;
18
17
  const e = isString(end) ? parseISO(end) : end;
@@ -1,10 +1,9 @@
1
1
  import { isWithinInterval as dateFnsIsWithinInterval, parseISO } from 'date-fns';
2
2
  import isString from '../../utils/isString';
3
- export default function isWithinInterval(day, _ref) {
4
- let {
5
- start,
6
- end
7
- } = _ref;
3
+ export default function isWithinInterval(day, {
4
+ start,
5
+ end
6
+ }) {
8
7
  const d = isString(day) ? parseISO(day) : day;
9
8
  const s = isString(start) ? parseISO(start) : start;
10
9
  const e = isString(end) ? parseISO(end) : end;
@@ -95,13 +95,11 @@ export default class DatePickerFoundation extends BaseFoundation {
95
95
  return _includesInstanceProperty(_context = ['string', 'number']).call(_context, typeof _timeZone) && _timeZone !== '';
96
96
  }
97
97
 
98
- initFromProps(_ref) {
99
- let {
100
- value,
101
- timeZone,
102
- prevTimeZone
103
- } = _ref;
104
-
98
+ initFromProps({
99
+ value,
100
+ timeZone,
101
+ prevTimeZone
102
+ }) {
105
103
  const _value = (_Array$isArray(value) ? [...value] : (value || value === 0) && [value]) || [];
106
104
 
107
105
  const result = this.parseWithTimezone(_value, timeZone, prevTimeZone);
@@ -251,10 +249,7 @@ export default class DatePickerFoundation extends BaseFoundation {
251
249
  */
252
250
 
253
251
 
254
- closePanel(e) {
255
- let inputValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
256
- let dates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
257
-
252
+ closePanel(e, inputValue = null, dates = []) {
258
253
  if (!this._isControlledComponent('open')) {
259
254
  this._adapter.togglePanel(false);
260
255
 
@@ -315,9 +310,7 @@ export default class DatePickerFoundation extends BaseFoundation {
315
310
  */
316
311
 
317
312
 
318
- handleInputBlur() {
319
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
320
- let e = arguments.length > 1 ? arguments[1] : undefined;
313
+ handleInputBlur(input = '', e) {
321
314
  const parsedResult = input ? this._isMultiple() ? this.parseMultipleInput(input, ',', true) : this.parseInput(input) : [];
322
315
  const stateValue = this.getState('value'); // console.log(input, parsedResult);
323
316
 
@@ -398,8 +391,7 @@ export default class DatePickerFoundation extends BaseFoundation {
398
391
  handleRangeInputBlur(value, e) {} // Parses input only after user returns
399
392
 
400
393
 
401
- handleInputComplete() {
402
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
394
+ handleInputComplete(input = '') {
403
395
  // console.log(input);
404
396
  let parsedResult = input ? this._isMultiple() ? this.parseMultipleInput(input, ',', true) : this.parseInput(input) : [];
405
397
  parsedResult = parsedResult && parsedResult.length ? parsedResult : this.getState('value'); // Use the current date as the value when the current input is empty and the last input is also empty
@@ -435,8 +427,7 @@ export default class DatePickerFoundation extends BaseFoundation {
435
427
  */
436
428
 
437
429
 
438
- parseInput() {
439
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
430
+ parseInput(input = '') {
440
431
  let result = []; // console.log(input);
441
432
 
442
433
  const {
@@ -500,10 +491,7 @@ export default class DatePickerFoundation extends BaseFoundation {
500
491
  */
501
492
 
502
493
 
503
- parseMultipleInput() {
504
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
505
- let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : strings.DEFAULT_SEPARATOR_MULTIPLE;
506
- let needDedupe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
494
+ parseMultipleInput(input = '', separator = strings.DEFAULT_SEPARATOR_MULTIPLE, needDedupe = false) {
507
495
  const max = this.getProp('max');
508
496
  const inputArr = input.split(separator);
509
497
  const result = [];
@@ -538,8 +526,7 @@ export default class DatePickerFoundation extends BaseFoundation {
538
526
  */
539
527
 
540
528
 
541
- formatDates() {
542
- let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
529
+ formatDates(dates = []) {
543
530
  let str = '';
544
531
  const rangeSeparator = this.getProp('rangeSeparator');
545
532
 
@@ -592,9 +579,7 @@ export default class DatePickerFoundation extends BaseFoundation {
592
579
  */
593
580
 
594
581
 
595
- formatMultipleDates() {
596
- let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
597
- let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : strings.DEFAULT_SEPARATOR_MULTIPLE;
582
+ formatMultipleDates(dates = [], separator = strings.DEFAULT_SEPARATOR_MULTIPLE) {
598
583
  const strs = [];
599
584
 
600
585
  if (_Array$isArray(dates) && dates.length) {
@@ -737,8 +722,7 @@ export default class DatePickerFoundation extends BaseFoundation {
737
722
  */
738
723
 
739
724
 
740
- handleYMSelectedChange() {
741
- let item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
725
+ handleYMSelectedChange(item = {}) {
742
726
  // console.log(item);
743
727
  const {
744
728
  currentMonth,
@@ -1024,7 +1008,7 @@ export default class DatePickerFoundation extends BaseFoundation {
1024
1008
  */
1025
1009
 
1026
1010
 
1027
- disposeDateFn(fn, date) {
1011
+ disposeDateFn(fn, date, ...rest) {
1028
1012
  const {
1029
1013
  notifyDate
1030
1014
  } = this.disposeCallbackArgs(date);
@@ -1041,10 +1025,6 @@ export default class DatePickerFoundation extends BaseFoundation {
1041
1025
  disposeDate = dateIsArray ? [notifyDate] : notifyDate[0];
1042
1026
  }
1043
1027
 
1044
- for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1045
- rest[_key - 2] = arguments[_key];
1046
- }
1047
-
1048
1028
  return fn(disposeDate, ...rest);
1049
1029
  }
1050
1030
  /**
@@ -1055,15 +1035,10 @@ export default class DatePickerFoundation extends BaseFoundation {
1055
1035
  */
1056
1036
 
1057
1037
 
1058
- disabledDisposeDate(date) {
1038
+ disabledDisposeDate(date, ...rest) {
1059
1039
  const {
1060
1040
  disabledDate
1061
1041
  } = this.getProps();
1062
-
1063
- for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1064
- rest[_key2 - 1] = arguments[_key2];
1065
- }
1066
-
1067
1042
  return this.disposeDateFn(disabledDate, date, ...rest);
1068
1043
  }
1069
1044
  /**
@@ -1074,15 +1049,10 @@ export default class DatePickerFoundation extends BaseFoundation {
1074
1049
  */
1075
1050
 
1076
1051
 
1077
- disabledDisposeTime(date) {
1052
+ disabledDisposeTime(date, ...rest) {
1078
1053
  const {
1079
1054
  disabledTime
1080
1055
  } = this.getProps();
1081
-
1082
- for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1083
- rest[_key3 - 1] = arguments[_key3];
1084
- }
1085
-
1086
1056
  return this.disposeDateFn(disabledTime, date, ...rest);
1087
1057
  }
1088
1058
  /**
@@ -56,8 +56,7 @@ export default class MonthsGridFoundation extends BaseFoundation {
56
56
  }
57
57
  }
58
58
 
59
- updateSelectedFromProps(values) {
60
- let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
59
+ updateSelectedFromProps(values, refreshPicker = true) {
61
60
  const type = this.getProp('type');
62
61
  const {
63
62
  selected,
@@ -141,8 +140,7 @@ export default class MonthsGridFoundation extends BaseFoundation {
141
140
  }
142
141
  }
143
142
 
144
- _initDatePickerFromValue(values) {
145
- let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
143
+ _initDatePickerFromValue(values, refreshPicker = true) {
146
144
  const monthLeft = this.getState('monthLeft');
147
145
 
148
146
  const newMonthLeft = _Object$assign({}, monthLeft);
@@ -168,8 +166,7 @@ export default class MonthsGridFoundation extends BaseFoundation {
168
166
  this._adapter.updateDaySelected(newSelected);
169
167
  }
170
168
 
171
- _initDateRangePickerFromValue(values) {
172
- let withTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
169
+ _initDateRangePickerFromValue(values, withTime = false) {
173
170
  // init month panel
174
171
  const monthLeft = this.getState('monthLeft');
175
172
  const monthRight = this.getState('monthRight');
@@ -375,10 +372,7 @@ export default class MonthsGridFoundation extends BaseFoundation {
375
372
  };
376
373
  }
377
374
 
378
- handleYearOrMonthChange(type) {
379
- let panelType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : strings.PANEL_TYPE_LEFT;
380
- let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
381
- let notSeparateInRange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
375
+ handleYearOrMonthChange(type, panelType = strings.PANEL_TYPE_LEFT, step = 1, notSeparateInRange = false) {
382
376
  const {
383
377
  autoSwitchDate,
384
378
  type: datePanelType
@@ -701,11 +695,9 @@ export default class MonthsGridFoundation extends BaseFoundation {
701
695
  */
702
696
 
703
697
 
704
- handleDayHover() {
705
- let day = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
706
- fullDate: ''
707
- };
708
- let panelType = arguments.length > 1 ? arguments[1] : undefined;
698
+ handleDayHover(day = {
699
+ fullDate: ''
700
+ }, panelType) {
709
701
  const {
710
702
  fullDate
711
703
  } = day;
@@ -423,13 +423,11 @@ export default class FormFoundation extends BaseFoundation {
423
423
  return result;
424
424
  }
425
425
 
426
- setValues(values, _ref) {
426
+ setValues(values, {
427
+ isOverride = false
428
+ }) {
427
429
  var _context24;
428
430
 
429
- let {
430
- isOverride = false
431
- } = _ref;
432
-
433
431
  const _values = this._adapter.cloneDeep(values);
434
432
 
435
433
  _forEachInstanceProperty(_context24 = this.fields).call(_context24, field => {
@@ -702,9 +700,7 @@ export default class FormFoundation extends BaseFoundation {
702
700
  });
703
701
  }
704
702
 
705
- getFormState() {
706
- let needClone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
707
-
703
+ getFormState(needClone = false) {
708
704
  // NOTES:这里如果直接返回this.data,forceUpdae触发Formrerender时,通过context传下去的formState会被认为是同一个对象【应该是浅对比的原因】
709
705
  // 使用了useFormState相关的component都不会触发重新渲染。所以使用...复制一次
710
706
 
@@ -798,12 +794,10 @@ export default class FormFoundation extends BaseFoundation {
798
794
  }
799
795
  }
800
796
 
801
- scrollToField(field) {
802
- let scrollOpts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
803
- behavior: 'smooth',
804
- block: 'start'
805
- };
806
-
797
+ scrollToField(field, scrollOpts = {
798
+ behavior: 'smooth',
799
+ block: 'start'
800
+ }) {
807
801
  if (this.getFieldExist(field)) {
808
802
  const fieldDOM = this._adapter.getFieldDOM(field);
809
803
 
@@ -28,15 +28,13 @@ export function getDisplayName(WrappedComponent) {
28
28
  const originName = WrappedComponent.displayName || WrappedComponent.name;
29
29
  return originName ? "SemiField".concat(originName) : 'SemiField';
30
30
  }
31
- export function generateValidatesFromRules(field) {
32
- let rules = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
31
+ export function generateValidatesFromRules(field, rules = []) {
33
32
  const descriptor = {};
34
33
  descriptor[field] = rules;
35
34
  const validator = new AsyncValidator(descriptor);
36
35
  return validator;
37
36
  }
38
- export function isRequired() {
39
- let rules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
37
+ export function isRequired(rules = []) {
40
38
  let required = false;
41
39
 
42
40
  if (typeof rules === 'object' && 'required' in rules) {
@@ -34,12 +34,9 @@ const getContentHeight = (node, sizingData) => {
34
34
  return height - sizingData.paddingSize;
35
35
  };
36
36
 
37
- export default function calculateNodeHeight(sizingData, value) {
37
+ export default function calculateNodeHeight(sizingData, value, minRows = 1, maxRows = Infinity) {
38
38
  var _context2;
39
39
 
40
- let minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
41
- let maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Infinity;
42
-
43
40
  if (!hiddenTextarea) {
44
41
  hiddenTextarea = document.createElement('textarea');
45
42
  hiddenTextarea.setAttribute('tab-index', '-1');