@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
@@ -92,8 +92,8 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
92
92
  }
93
93
 
94
94
  _bindEvent() {
95
- const types = this.getProp('trigger'); // get trigger type
96
- const { triggerEventSet, portalEventSet } = this._generateEvent(types);
95
+ const trigger = this.getProp('trigger'); // get trigger type
96
+ const { triggerEventSet, portalEventSet } = this._generateEvent(trigger);
97
97
  this._bindTriggerEvent(triggerEventSet);
98
98
  this._bindPortalEvent(portalEventSet);
99
99
  this._bindResizeEvent();
@@ -268,6 +268,8 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
268
268
  this._adapter.insertPortal(content, position);
269
269
 
270
270
  if (trigger === 'custom') {
271
+ // eslint-disable-next-line
272
+ this._adapter.registerClickOutsideHandler(() => {});
271
273
  this._togglePortalVisible(true);
272
274
  }
273
275
 
@@ -212,7 +212,7 @@ export interface BasicTreeProps {
212
212
  onDragOver?: (dragProps: BasicDragProps) => void;
213
213
  onDragStart?: (dragProps: BasicDragProps) => void;
214
214
  onDrop?: (onDragProps: BasicOnDragProps) => void;
215
- onExpand?: (expandedKeys: string[], expanedOtherProps: BasicExpandedOtherProps) => void;
215
+ onExpand?: (expandedKeys: string[], expandedOtherProps: BasicExpandedOtherProps) => void;
216
216
  onLoad?: (loadedKeys?: Set<string>, treeNode?: BasicTreeNodeData) => void;
217
217
  onContextMenu?: (e: any, node: BasicTreeNodeData) => void;
218
218
  onSearch?: (sunInput: string) => void;
package/tree/treeUtil.ts CHANGED
@@ -441,7 +441,7 @@ export function normalizeKeyList(keyList: any, keyEntities: KeyEntities, leafOnl
441
441
  res.push(key);
442
442
  });
443
443
  } else {
444
- res = keyList.filter((key: string) => keyEntities[key] && !isValid(keyEntities[key].children));
444
+ res = Array.from(keyList).filter((key: string) => keyEntities[key] && !isValid(keyEntities[key].children)) as string[];
445
445
  }
446
446
  return res;
447
447
  }
@@ -29,14 +29,15 @@ export type ValidateStatus = 'error' | 'warning' | 'default';
29
29
 
30
30
  export type Size = 'small' | 'large' | 'default';
31
31
 
32
- export interface BasicRenderSelectedItem {
33
- (treeNode: BasicTreeNodeData): any;
34
- (treeNode: BasicTreeNodeData, otherProps: { index: number | string; onClose: (tagContent: any, e: any) => void }):
35
- {
36
- isRenderInTag: boolean;
37
- content: any;
38
- };
39
- }
32
+ export type BasicRenderSelectedItemInMultiple = (
33
+ treeNode: BasicTreeNodeData,
34
+ otherProps: { index: number | string; onClose: (tagContent: any, e: any) => void }
35
+ )=> {
36
+ isRenderInTag: boolean;
37
+ content: any;
38
+ };
39
+ export type BasicRenderSelectedItemInSingle = (treeNode: BasicTreeNodeData) => any;
40
+ export type BasicRenderSelectedItem = BasicRenderSelectedItemInSingle | BasicRenderSelectedItemInMultiple;
40
41
 
41
42
  export interface BasicTriggerRenderProps {
42
43
  [x: string]: any;
@@ -178,7 +179,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
178
179
  setOptionWrapperWidth: (width: null | number) => void;
179
180
  notifyChange: BasicOnChangeWithBasic;
180
181
  notifyChangeWithObject: BasicOnChangeWithObject;
181
- notifyExpand: (expandedKeys: Set<string>, expanedOtherProps: BasicExpandedOtherProps) => void;
182
+ notifyExpand: (expandedKeys: Set<string>, expandedOtherProps: BasicExpandedOtherProps) => void;
182
183
  notifyFocus: (e: any) => void;
183
184
  notifyBlur: (e: any) => void;
184
185
  toggleHovering: (bool: boolean) => void;