@douyinfe/semi-foundation 2.70.1 → 2.70.2-alpha.1

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.
@@ -8,7 +8,7 @@ export interface LottieAdapter<P = Record<string, any>, S = Record<string, any>>
8
8
  export interface LottieBaseProps {
9
9
  width?: string;
10
10
  height?: string;
11
- params: ArgsType<typeof lottie.loadAnimation>[0];
11
+ params: Partial<ArgsType<typeof lottie.loadAnimation>[0]>;
12
12
  getAnimationInstance?: (instance: AnimationItem | null) => void;
13
13
  getLottie?: (lottiePKG: typeof lottie) => void;
14
14
  }
@@ -45,6 +45,10 @@ class Tooltip extends _foundation.default {
45
45
  this.onResize = () => {
46
46
  // this.log('resize');
47
47
  // rePosition when window resize
48
+ const visible = this.getState('visible');
49
+ if (!visible) {
50
+ return;
51
+ }
48
52
  this.calcPosition();
49
53
  };
50
54
  this.delayShow = () => {
@@ -8,7 +8,7 @@ export interface LottieAdapter<P = Record<string, any>, S = Record<string, any>>
8
8
  export interface LottieBaseProps {
9
9
  width?: string;
10
10
  height?: string;
11
- params: ArgsType<typeof lottie.loadAnimation>[0];
11
+ params: Partial<ArgsType<typeof lottie.loadAnimation>[0]>;
12
12
  getAnimationInstance?: (instance: AnimationItem | null) => void;
13
13
  getLottie?: (lottiePKG: typeof lottie) => void;
14
14
  }
@@ -38,6 +38,10 @@ export default class Tooltip extends BaseFoundation {
38
38
  this.onResize = () => {
39
39
  // this.log('resize');
40
40
  // rePosition when window resize
41
+ const visible = this.getState('visible');
42
+ if (!visible) {
43
+ return;
44
+ }
41
45
  this.calcPosition();
42
46
  };
43
47
  this.delayShow = () => {
@@ -10,7 +10,7 @@ export interface LottieAdapter<P = Record<string, any>, S = Record<string, any>>
10
10
  export interface LottieBaseProps {
11
11
  width?: string;
12
12
  height?: string;
13
- params: ArgsType<typeof lottie.loadAnimation>[0];
13
+ params: Partial<ArgsType<typeof lottie.loadAnimation>[0]>;
14
14
  getAnimationInstance?: (instance: AnimationItem|null) => void;
15
15
  getLottie?: (lottiePKG: typeof lottie) => void
16
16
 
@@ -57,4 +57,4 @@ class LottieFoundation <P = Record<string, any>, S = Record<string, any>> extend
57
57
 
58
58
  }
59
59
 
60
- export default LottieFoundation;
60
+ export default LottieFoundation;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.70.1",
3
+ "version": "2.70.2-alpha.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.70.1",
10
+ "@douyinfe/semi-animation": "2.70.2-alpha.1",
11
11
  "@mdx-js/mdx": "^3.0.1",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
@@ -28,7 +28,7 @@
28
28
  "*.scss",
29
29
  "*.css"
30
30
  ],
31
- "gitHead": "782c2fb120e3a72460408ba5e81271fdd8ce8238",
31
+ "gitHead": "a28b95d60b9f99f8af61e9a7ae4b74c3602079ea",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
@@ -191,7 +191,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
191
191
  }
192
192
  }
193
193
 
194
- updateStateIfCursorOnTrigger = (trigger: HTMLElement)=>{
194
+ updateStateIfCursorOnTrigger = (trigger: HTMLElement) => {
195
195
  if (trigger?.matches?.(":hover")) {
196
196
  const eventNames = this._adapter.getEventName();
197
197
  const triggerEventSet = this.getState("triggerEventSet");
@@ -284,6 +284,10 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
284
284
  onResize = () => {
285
285
  // this.log('resize');
286
286
  // rePosition when window resize
287
+ const visible = this.getState('visible');
288
+ if (!visible) {
289
+ return;
290
+ }
287
291
  this.calcPosition();
288
292
  };
289
293