@douyinfe/semi-foundation 2.9.1 → 2.10.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.
Files changed (146) hide show
  1. package/carousel/carousel.scss +425 -0
  2. package/carousel/constants.ts +32 -0
  3. package/carousel/foundation.ts +164 -0
  4. package/carousel/rtl.scss +47 -0
  5. package/carousel/variables.scss +46 -0
  6. package/cascader/foundation.ts +6 -6
  7. package/checkbox/checkboxGroupFoundation.ts +2 -2
  8. package/datePicker/_utils/getDefaultPickerDate.ts +3 -3
  9. package/datePicker/_utils/parser.ts +1 -1
  10. package/datePicker/foundation.ts +4 -4
  11. package/datePicker/monthsGridFoundation.ts +11 -11
  12. package/datePicker/yearAndMonthFoundation.ts +1 -1
  13. package/form/foundation.ts +9 -5
  14. package/form/interface.ts +1 -0
  15. package/input/textareaFoundation.ts +5 -5
  16. package/inputNumber/foundation.ts +25 -9
  17. package/lib/cjs/carousel/carousel.css +341 -0
  18. package/lib/cjs/carousel/carousel.scss +425 -0
  19. package/lib/cjs/carousel/constants.d.ts +27 -0
  20. package/lib/cjs/carousel/constants.js +41 -0
  21. package/lib/cjs/carousel/foundation.d.ts +29 -0
  22. package/lib/cjs/carousel/foundation.js +216 -0
  23. package/lib/cjs/carousel/rtl.scss +47 -0
  24. package/lib/cjs/carousel/variables.scss +46 -0
  25. package/lib/cjs/cascader/foundation.d.ts +2 -2
  26. package/lib/cjs/cascader/foundation.js +6 -6
  27. package/lib/cjs/checkbox/checkboxGroupFoundation.d.ts +1 -1
  28. package/lib/cjs/checkbox/checkboxGroupFoundation.js +2 -2
  29. package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +2 -2
  30. package/lib/cjs/datePicker/_utils/parser.d.ts +1 -1
  31. package/lib/cjs/datePicker/_utils/parser.js +2 -2
  32. package/lib/cjs/datePicker/foundation.js +3 -3
  33. package/lib/cjs/datePicker/monthsGridFoundation.js +9 -9
  34. package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +1 -1
  35. package/lib/cjs/datePicker/yearAndMonthFoundation.js +2 -2
  36. package/lib/cjs/form/foundation.d.ts +1 -0
  37. package/lib/cjs/form/foundation.js +9 -5
  38. package/lib/cjs/form/interface.d.ts +1 -0
  39. package/lib/cjs/input/textareaFoundation.d.ts +5 -5
  40. package/lib/cjs/inputNumber/foundation.d.ts +8 -0
  41. package/lib/cjs/inputNumber/foundation.js +20 -8
  42. package/lib/cjs/navigation/foundation.d.ts +3 -3
  43. package/lib/cjs/navigation/foundation.js +13 -13
  44. package/lib/cjs/switch/constants.d.ts +1 -0
  45. package/lib/cjs/switch/constants.js +1 -0
  46. package/lib/cjs/switch/foundation.d.ts +3 -0
  47. package/lib/cjs/switch/foundation.js +18 -0
  48. package/lib/cjs/switch/switch.css +3 -0
  49. package/lib/cjs/switch/switch.scss +4 -0
  50. package/lib/cjs/switch/variables.scss +2 -0
  51. package/lib/cjs/tabs/foundation.js +2 -2
  52. package/lib/cjs/timePicker/ComboxFoundation.js +1 -1
  53. package/lib/cjs/timePicker/constants.d.ts +1 -1
  54. package/lib/cjs/timePicker/constants.js +1 -1
  55. package/lib/cjs/timePicker/foundation.js +1 -1
  56. package/lib/cjs/transfer/foundation.js +3 -3
  57. package/lib/cjs/transfer/{transferUtlls.d.ts → transferUtils.d.ts} +0 -0
  58. package/lib/cjs/transfer/{transferUtlls.js → transferUtils.js} +0 -0
  59. package/lib/cjs/tree/foundation.d.ts +2 -2
  60. package/lib/cjs/tree/foundation.js +4 -4
  61. package/lib/cjs/tree/treeUtil.js +11 -11
  62. package/lib/cjs/treeSelect/constants.d.ts +1 -1
  63. package/lib/cjs/treeSelect/constants.js +1 -1
  64. package/lib/cjs/treeSelect/foundation.d.ts +2 -2
  65. package/lib/cjs/treeSelect/foundation.js +4 -4
  66. package/lib/cjs/upload/foundation.js +8 -8
  67. package/lib/cjs/upload/utils.js +1 -1
  68. package/lib/cjs/utils/isNullOrUndefined.d.ts +1 -1
  69. package/lib/cjs/utils/isNullOrUndefined.js +1 -1
  70. package/lib/cjs/utils/object.d.ts +6 -6
  71. package/lib/cjs/utils/object.js +2 -2
  72. package/lib/es/carousel/carousel.css +341 -0
  73. package/lib/es/carousel/carousel.scss +425 -0
  74. package/lib/es/carousel/constants.d.ts +27 -0
  75. package/lib/es/carousel/constants.js +28 -0
  76. package/lib/es/carousel/foundation.d.ts +29 -0
  77. package/lib/es/carousel/foundation.js +198 -0
  78. package/lib/es/carousel/rtl.scss +47 -0
  79. package/lib/es/carousel/variables.scss +46 -0
  80. package/lib/es/cascader/foundation.d.ts +2 -2
  81. package/lib/es/cascader/foundation.js +6 -6
  82. package/lib/es/checkbox/checkboxGroupFoundation.d.ts +1 -1
  83. package/lib/es/checkbox/checkboxGroupFoundation.js +2 -2
  84. package/lib/es/datePicker/_utils/getDefaultPickerDate.js +3 -3
  85. package/lib/es/datePicker/_utils/parser.d.ts +1 -1
  86. package/lib/es/datePicker/_utils/parser.js +1 -1
  87. package/lib/es/datePicker/foundation.js +4 -4
  88. package/lib/es/datePicker/monthsGridFoundation.js +10 -10
  89. package/lib/es/datePicker/yearAndMonthFoundation.d.ts +1 -1
  90. package/lib/es/datePicker/yearAndMonthFoundation.js +1 -1
  91. package/lib/es/form/foundation.d.ts +1 -0
  92. package/lib/es/form/foundation.js +9 -5
  93. package/lib/es/form/interface.d.ts +1 -0
  94. package/lib/es/input/textareaFoundation.d.ts +5 -5
  95. package/lib/es/inputNumber/foundation.d.ts +8 -0
  96. package/lib/es/inputNumber/foundation.js +18 -8
  97. package/lib/es/navigation/foundation.d.ts +3 -3
  98. package/lib/es/navigation/foundation.js +13 -13
  99. package/lib/es/switch/constants.d.ts +1 -0
  100. package/lib/es/switch/constants.js +1 -0
  101. package/lib/es/switch/foundation.d.ts +3 -0
  102. package/lib/es/switch/foundation.js +18 -0
  103. package/lib/es/switch/switch.css +3 -0
  104. package/lib/es/switch/switch.scss +4 -0
  105. package/lib/es/switch/variables.scss +2 -0
  106. package/lib/es/tabs/foundation.js +2 -2
  107. package/lib/es/timePicker/ComboxFoundation.js +1 -1
  108. package/lib/es/timePicker/constants.d.ts +1 -1
  109. package/lib/es/timePicker/constants.js +1 -1
  110. package/lib/es/timePicker/foundation.js +1 -1
  111. package/lib/es/transfer/foundation.js +1 -1
  112. package/lib/es/transfer/{transferUtlls.d.ts → transferUtils.d.ts} +0 -0
  113. package/lib/es/transfer/{transferUtlls.js → transferUtils.js} +0 -0
  114. package/lib/es/tree/foundation.d.ts +2 -2
  115. package/lib/es/tree/foundation.js +4 -4
  116. package/lib/es/tree/treeUtil.js +11 -11
  117. package/lib/es/treeSelect/constants.d.ts +1 -1
  118. package/lib/es/treeSelect/constants.js +1 -1
  119. package/lib/es/treeSelect/foundation.d.ts +2 -2
  120. package/lib/es/treeSelect/foundation.js +4 -4
  121. package/lib/es/upload/foundation.js +8 -8
  122. package/lib/es/upload/utils.js +1 -1
  123. package/lib/es/utils/isNullOrUndefined.d.ts +1 -1
  124. package/lib/es/utils/isNullOrUndefined.js +1 -1
  125. package/lib/es/utils/object.d.ts +6 -6
  126. package/lib/es/utils/object.js +2 -2
  127. package/navigation/foundation.ts +12 -12
  128. package/package.json +3 -3
  129. package/switch/constants.ts +1 -0
  130. package/switch/foundation.ts +16 -0
  131. package/switch/switch.scss +4 -0
  132. package/switch/variables.scss +2 -0
  133. package/tabs/foundation.ts +2 -2
  134. package/timePicker/ComboxFoundation.ts +1 -1
  135. package/timePicker/constants.ts +1 -1
  136. package/timePicker/foundation.ts +1 -1
  137. package/transfer/foundation.ts +1 -1
  138. package/transfer/{transferUtlls.ts → transferUtils.ts} +0 -0
  139. package/tree/foundation.ts +4 -4
  140. package/tree/treeUtil.ts +11 -11
  141. package/treeSelect/constants.ts +1 -1
  142. package/treeSelect/foundation.ts +4 -4
  143. package/upload/foundation.ts +8 -8
  144. package/upload/utils.ts +1 -1
  145. package/utils/isNullOrUndefined.ts +1 -1
  146. package/utils/object.ts +10 -10
@@ -3,6 +3,7 @@ import BaseFoundation, { DefaultAdapter } from '../base/foundation';
3
3
  export interface SwitchAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
4
4
  setNativeControlChecked: (nativeControlChecked: boolean | undefined) => void;
5
5
  setNativeControlDisabled: (nativeControlDisabled: boolean | undefined) => void;
6
+ setFocusVisible: (focusVisible: boolean) => void;
6
7
  notifyChange: (checked: boolean, e: any) => void;
7
8
  }
8
9
 
@@ -37,6 +38,21 @@ export default class SwitchFoundation<P = Record<string, any>, S = Record<string
37
38
  }
38
39
  }
39
40
 
41
+ handleFocusVisible = (event: any) => {
42
+ const { target } = event;
43
+ try {
44
+ if (target.matches(':focus-visible')) {
45
+ this._adapter.setFocusVisible(true);
46
+ }
47
+ } catch (error){
48
+ console.warn('The current browser does not support the focus-visible');
49
+ }
50
+ }
51
+
52
+ handleBlur = () => {
53
+ this._adapter.setFocusVisible(false);
54
+ }
55
+
40
56
  // eslint-disable-next-line @typescript-eslint/no-empty-function
41
57
  destroy(): void {}
42
58
  }
@@ -28,6 +28,10 @@ $module: #{$prefix}-switch;
28
28
  }
29
29
  }
30
30
 
31
+ &-focus {
32
+ outline: $width-switch-outline solid $color-switch_primary-outline-focus;
33
+ }
34
+
31
35
  &-checked {
32
36
  background-color: $color-switch_checked-bg-default;
33
37
 
@@ -37,6 +37,7 @@ $color-switch_unchecked-text-default: var(--semi-color-text-2); // 关闭态开
37
37
  $color-switch_loading_spin-default: var(--semi-color-white); // 加载态开关loading图标颜色
38
38
  $color-switch_spin_checked-bg-default: var(--semi-color-success-hover); // 已开启开关加载态loading背景颜色
39
39
  $color-switch_spin_unchecked-bg-default: var(--semi-color-fill-1); // 已关闭开关加载态loading背景颜色
40
+ $color-switch_primary-outline-focus: var(--semi-color-primary-light-active); // 开关轮廓 - 聚焦
40
41
 
41
42
  // Width/Height
42
43
  $width-switch: 40px; // 开关宽度
@@ -57,6 +58,7 @@ $width-switch_checked_unchecked_text: 26px; // 开关按钮文字宽度
57
58
  $width-switch_spin-small: 10px; // 小尺寸开关加载 spin 宽度
58
59
  $width-switch_spin-default: 18px; // 默认尺寸开关加载 spin 宽度
59
60
  $width-switch_spin-large: 28px; // 大尺寸开关加载 spin 宽度
61
+ $width-switch-outline: 2px; // 开关轮廓宽度
60
62
 
61
63
 
62
64
  // Spacing
@@ -30,8 +30,8 @@ class TabsFoundation<P = Record<string, any>, S = Record<string, any>> extends B
30
30
  }
31
31
 
32
32
  handleTabClick(activeKey: string, event: any): void {
33
- const isControledComponent = this._isInProps('activeKey');
34
- if (isControledComponent) {
33
+ const isControlledComponent = this._isInProps('activeKey');
34
+ if (isControlledComponent) {
35
35
  this._notifyChange(activeKey);
36
36
  } else {
37
37
  this._notifyChange(activeKey);
@@ -89,7 +89,7 @@ class ComboboxFoundation extends BaseFoundation<DefaultAdapter> {
89
89
  if (this._isInProps('format')) {
90
90
  return this.getProp('format');
91
91
  } else if (this.getProp('use12Hours')) {
92
- return strings.DEFAULT_FROMAT_A;
92
+ return strings.DEFAULT_FORMAT_A;
93
93
  } else {
94
94
  return strings.DEFAULT_FORMAT;
95
95
  }
@@ -21,7 +21,7 @@ const strings = {
21
21
  DEFAULT_MULTIPLE_SEPARATOR,
22
22
  SIZE: inputStrings.SIZE,
23
23
  DEFAULT_FORMAT: 'HH:mm:ss',
24
- DEFAULT_FROMAT_A: 'a h:mm:ss',
24
+ DEFAULT_FORMAT_A: 'a h:mm:ss',
25
25
  STATUS: VALIDATE_STATUS,
26
26
  DEFAULT_POSITION: {
27
27
  [TYPE_TIME_PICKER]: 'bottomLeft',
@@ -94,7 +94,7 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
94
94
  if (this._isInProps('format')) {
95
95
  return this.getProp('format');
96
96
  } else if (this.getProp('use12Hours')) {
97
- return strings.DEFAULT_FROMAT_A;
97
+ return strings.DEFAULT_FORMAT_A;
98
98
  } else {
99
99
  return strings.DEFAULT_FORMAT;
100
100
  }
@@ -2,7 +2,7 @@ import { omit } from 'lodash';
2
2
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
3
3
  import { BasicValue as BasicTreeValue } from '../tree/foundation';
4
4
  import { strings } from './constants';
5
- import { _generateGroupedData, _generateTreeData } from './transferUtlls';
5
+ import { _generateGroupedData, _generateTreeData } from './transferUtils';
6
6
 
7
7
  export interface BasicDataItem {
8
8
  [x: string]: any;
File without changes
@@ -544,7 +544,7 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
544
544
  /*
545
545
  * Compute the checked state of the node
546
546
  */
547
- calcChekcedStatus(targetStatus: boolean, eventKey: string) {
547
+ calcCheckedStatus(targetStatus: boolean, eventKey: string) {
548
548
  // From checked to unchecked, you can change it directly
549
549
  if (!targetStatus) {
550
550
  return targetStatus;
@@ -566,7 +566,7 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
566
566
  /*
567
567
  * In strict disable mode, calculate the nodes of checked and halfCheckedKeys and return their corresponding keys
568
568
  */
569
- calcNonDisabedCheckedKeys(eventKey: string, targetStatus: boolean) {
569
+ calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean) {
570
570
  const { keyEntities, disabledKeys } = this.getStates();
571
571
  const { checkedKeys } = this.getCopyFromState(['checkedKeys']);
572
572
  const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
@@ -592,9 +592,9 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
592
592
  const { checked, eventKey, data } = treeNode;
593
593
  if (checkRelation === 'related') {
594
594
  // Find the checked state of the current node
595
- const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
595
+ const targetStatus = disableStrictly ? this.calcCheckedStatus(!checked, eventKey) : !checked;
596
596
  const { checkedKeys, halfCheckedKeys } = disableStrictly ?
597
- this.calcNonDisabedCheckedKeys(eventKey, targetStatus) :
597
+ this.calcNonDisabledCheckedKeys(eventKey, targetStatus) :
598
598
  this.calcCheckedKeys(eventKey, targetStatus);
599
599
  this._adapter.notifySelect(eventKey, targetStatus, data);
600
600
  this.notifyChange([...checkedKeys], e);
package/tree/treeUtil.ts CHANGED
@@ -87,11 +87,11 @@ export function convertJsonToData(treeJson: TreeDataSimpleJson) {
87
87
  value: children,
88
88
  };
89
89
  if (isObject(children)) {
90
- const childres: any[] = [];
90
+ const newChildren: any[] = [];
91
91
  Object.entries(children).forEach(c => {
92
- traverseNode(c[0], c[1], currPath, childres);
92
+ traverseNode(c[0], c[1], currPath, newChildren);
93
93
  });
94
- newNode.children = childres;
94
+ newNode.children = newChildren;
95
95
  }
96
96
  res.push(newNode);
97
97
  };
@@ -327,8 +327,8 @@ export function calcCheckedKeys(values: any, keyEntities: KeyEntities) {
327
327
  visited = [...visited, ...siblingKeys];
328
328
  const allChecked = siblingKeys.every((siblingKey: string) => checkedKeys.has(siblingKey));
329
329
  if (!allChecked) {
330
- const ancesterKeys = findAncestorKeys([key], keyEntities, false);
331
- halfCheckedKeys = new Set([...halfCheckedKeys, ...ancesterKeys]);
330
+ const ancestorKeys = findAncestorKeys([key], keyEntities, false);
331
+ halfCheckedKeys = new Set([...halfCheckedKeys, ...ancestorKeys]);
332
332
  } else {
333
333
  checkedKeys.add(parent.key);
334
334
  // IMPORTANT! parent level may not exist in original level map; if add to the end directly may destroy the hierarchical order
@@ -358,8 +358,8 @@ export function calcExpandedKeys(keyList: any[] = [], keyEntities: KeyEntities,
358
358
  keyList = [keyList];
359
359
  }
360
360
  if (autoExpandParent) {
361
- const ancesterKeys = findAncestorKeys(keyList, keyEntities, true);
362
- return new Set(ancesterKeys);
361
+ const ancestorKeys = findAncestorKeys(keyList, keyEntities, true);
362
+ return new Set(ancestorKeys);
363
363
  }
364
364
  return new Set(keyList);
365
365
  }
@@ -482,8 +482,8 @@ export function calcCheckedKeysForChecked(key: string, keyEntities: KeyEntities,
482
482
  // eslint-disable-next-line @typescript-eslint/no-shadow
483
483
  const allChecked = siblingKeys.every(key => checkedKeys.has(key));
484
484
  if (!allChecked) {
485
- const ancesterKeys = findAncestorKeys([key], keyEntities, false);
486
- halfCheckedKeys = new Set([...halfCheckedKeys, ...ancesterKeys]);
485
+ const ancestorKeys = findAncestorKeys([key], keyEntities, false);
486
+ halfCheckedKeys = new Set([...halfCheckedKeys, ...ancestorKeys]);
487
487
  } else {
488
488
  const par = node.parent;
489
489
  checkedKeys.add(par.key);
@@ -525,10 +525,10 @@ export function calcCheckedKeysForUnchecked(key: string, keyEntities: KeyEntitie
525
525
  const siblingKeys = findSiblingKeys([key], keyEntities);
526
526
  // eslint-disable-next-line @typescript-eslint/no-shadow
527
527
  const anyChecked = siblingKeys.some(key => checkedKeys.has(key) || halfCheckedKeys.has(key));
528
- const ancesterKeys = findAncestorKeys([key], keyEntities, false);
528
+ const ancestorKeys = findAncestorKeys([key], keyEntities, false);
529
529
  // If there is checked or halfChecked in the sibling node, you need to change the parent node to halfChecked
530
530
  if (anyChecked) {
531
- ancesterKeys.forEach(itemKey => {
531
+ ancestorKeys.forEach(itemKey => {
532
532
  if (checkedKeys.has(itemKey)) {
533
533
  checkedKeys.delete(itemKey);
534
534
  halfCheckedKeys.add(itemKey);
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  const cssClasses = {
7
7
  PREFIX: `${BASE_CLASS_PREFIX}-tree-select`,
8
- PREFIXTREE: `${BASE_CLASS_PREFIX}-tree`,
8
+ PREFIX_TREE: `${BASE_CLASS_PREFIX}-tree`,
9
9
  PREFIX_OPTION: `${BASE_CLASS_PREFIX}-tree-select-option`
10
10
  };
11
11
 
@@ -622,11 +622,11 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
622
622
  const { checked, eventKey, data } = treeNode;
623
623
  if (checkRelation === 'related') {
624
624
  const targetStatus = disableStrictly ?
625
- this.calcChekcedStatus(!checked, eventKey) :
625
+ this.calcCheckedStatus(!checked, eventKey) :
626
626
  !checked;
627
627
 
628
628
  const { checkedKeys, halfCheckedKeys } = disableStrictly ?
629
- this.calcNonDisabedCheckedKeys(eventKey, targetStatus) :
629
+ this.calcNonDisabledCheckedKeys(eventKey, targetStatus) :
630
630
  this.calcCheckedKeys(eventKey, targetStatus);
631
631
  this._adapter.notifySelect(eventKey, targetStatus, data);
632
632
  this._notifyChange([...checkedKeys], e);
@@ -656,7 +656,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
656
656
  }
657
657
  }
658
658
 
659
- calcNonDisabedCheckedKeys(eventKey: string, targetStatus: boolean) {
659
+ calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean) {
660
660
  const { keyEntities, disabledKeys } = this.getStates();
661
661
  const { checkedKeys } = this.getCopyFromState(['checkedKeys']);
662
662
  const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
@@ -671,7 +671,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
671
671
  return calcCheckedKeys(newCheckedKeys, keyEntities);
672
672
  }
673
673
 
674
- calcChekcedStatus(targetStatus: boolean, eventKey: string) {
674
+ calcCheckedStatus(targetStatus: boolean, eventKey: string) {
675
675
  if (!targetStatus) {
676
676
  return targetStatus;
677
677
  }
@@ -124,11 +124,11 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
124
124
  checkFileSize(file: File): boolean {
125
125
  const { size } = file;
126
126
  const { maxSize, minSize } = this.getProps();
127
- let isIlligal = false;
127
+ let isIllegal = false;
128
128
  if (size > maxSize * byteKB || size < minSize * byteKB) {
129
- isIlligal = true;
129
+ isIllegal = true;
130
130
  }
131
- return isIlligal;
131
+ return isIllegal;
132
132
  }
133
133
 
134
134
  /**
@@ -425,7 +425,7 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
425
425
  const { fileList } = this.getStates();
426
426
  const buResult = this._adapter.notifyBeforeUpload({ file, fileList });
427
427
  switch (true) {
428
- // sync valiate - boolean
428
+ // sync validate - boolean
429
429
  case buResult === true: {
430
430
  this.post(file);
431
431
  break;
@@ -438,11 +438,11 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
438
438
  // async validate
439
439
  case buResult && isPromise(buResult): {
440
440
  Promise.resolve(buResult as Promise<BeforeUploadObjectResult>).then(
441
- resloveData => {
441
+ resolveData => {
442
442
  let newResult = { shouldUpload: true };
443
- const typeOfResloveData = Object.prototype.toString.call(resloveData).slice(8, -1);
444
- if (typeOfResloveData === 'Object') {
445
- newResult = { ...newResult, ...resloveData };
443
+ const typeOfResolveData = Object.prototype.toString.call(resolveData).slice(8, -1);
444
+ if (typeOfResolveData === 'Object') {
445
+ newResult = { ...newResult, ...resolveData };
446
446
  }
447
447
  this.handleBeforeUploadResultInObject(newResult, file);
448
448
  },
package/upload/utils.ts CHANGED
@@ -86,7 +86,7 @@ export async function mapFileTree(items: Array<DataTransferItem>): Promise<Array
86
86
  const result = await Promise.all(promises);
87
87
  return result;
88
88
  } catch (error) {
89
- console.warn('Catched error while loop directory.');
89
+ console.warn('Captured error while loop directory.');
90
90
  console.error(error);
91
91
  return [];
92
92
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Whether null or undenfined
2
+ * Whether null or undefined
3
3
  * @param {*} value
4
4
  * @returns {boolean}
5
5
  */
package/utils/object.ts CHANGED
@@ -16,7 +16,7 @@ type Many<T> = T | ReadonlyArray<T>;
16
16
  type PropertyName = string | number | symbol;
17
17
  type PropertyPath = Many<PropertyName>;
18
18
 
19
- type ObjctType = Record<string, any>;
19
+ type ObjectType = Record<string, any>;
20
20
 
21
21
  const pathToArrayElem = (path: any) => {
22
22
  const pathArray = lodashToPath(path);
@@ -25,7 +25,7 @@ const pathToArrayElem = (path: any) => {
25
25
  return justNumber ? false : Number.isInteger(+pathArray[pathArray.length - 1]);
26
26
  };
27
27
 
28
- function isEmptyObject(target: ObjctType) {
28
+ function isEmptyObject(target: ObjectType) {
29
29
  /**
30
30
  * var a = {};
31
31
  * var b = { c: undefined }
@@ -35,8 +35,8 @@ function isEmptyObject(target: ObjctType) {
35
35
  * }
36
36
  * the result of JSON.stringify(a/b/d) are same: '{}'
37
37
  * We can use the above features to remove keys with empty values in Form
38
- * But we cannot use JSON.stringify() directly, because if the input parameter of JSON.stringify includes fiberNode, it will cause an TypeError: 'Convering circular structure to JSON'
39
- * So we have to mock it's behavihor, also, the form value cannot have Symbol or function type, it can be ignored
38
+ * But we cannot use JSON.stringify() directly, because if the input parameter of JSON.stringify includes fiberNode, it will cause an TypeError: 'Converting circular structure to JSON'
39
+ * So we have to mock it's behavior, also, the form value cannot have Symbol or function type, it can be ignored
40
40
  */
41
41
  if (!isObject(target)) {
42
42
  return false;
@@ -52,7 +52,7 @@ function isEmptyObject(target: ObjctType) {
52
52
  }
53
53
  }
54
54
 
55
- function cleanup(obj: ObjctType, path: string[], pull = true) {
55
+ function cleanup(obj: ObjectType, path: string[], pull = true) {
56
56
  if (path.length === 0) {
57
57
  return;
58
58
  }
@@ -79,15 +79,15 @@ function cleanup(obj: ObjctType, path: string[], pull = true) {
79
79
  cleanup(obj, path.slice(0, path.length - 1), pull);
80
80
  }
81
81
 
82
- export function empty(object: ObjctType) {
82
+ export function empty(object: ObjectType) {
83
83
  return lodashValues(object).length === 0;
84
84
  }
85
85
 
86
- export function get(object: ObjctType, path: PropertyPath) {
86
+ export function get(object: ObjectType, path: PropertyPath) {
87
87
  return lodashGet(object, path);
88
88
  }
89
89
 
90
- export function remove(object: ObjctType, path: PropertyPath) {
90
+ export function remove(object: ObjectType, path: PropertyPath) {
91
91
  lodashUnset(object, path);
92
92
  // a.b => [a, b]
93
93
  // arr[11].a => [arr, 11, a]
@@ -123,7 +123,7 @@ export function set(object: any, path: PropertyPath, value: any, allowEmpty?: bo
123
123
  }
124
124
  }
125
125
 
126
- export function has(object: ObjctType, path: PropertyPath) {
126
+ export function has(object: ObjectType, path: PropertyPath) {
127
127
  return lodashHas(object, path);
128
128
  }
129
129
 
@@ -133,7 +133,7 @@ export function has(object: ObjctType, path: PropertyPath) {
133
133
  * @param {object|Function} srcObj
134
134
  * @returns {object|Function}
135
135
  */
136
- export function forwardStatics<T extends ObjctType | ((...arg: any) => any)>(obj: T, srcObj: ObjctType | ((...arg: any) => any)): T {
136
+ export function forwardStatics<T extends ObjectType | ((...arg: any) => any)>(obj: T, srcObj: ObjectType | ((...arg: any) => any)): T {
137
137
  if (
138
138
  obj &&
139
139
  (typeof obj === 'function' || typeof obj === 'object') &&