leafer-x-tooltip-canvas 1.0.0 → 1.0.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.
- package/README.en.md +39 -11
- package/README.md +48 -18
- package/dev/bundle.js +2469 -1195
- package/dist/index.cjs +3303 -1257
- package/dist/index.esm.js +3292 -1246
- package/dist/index.esm.min.js +1 -1
- package/dist/index.js +3291 -1243
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +61 -50
- package/src/TooltipPlugin.ts +11 -14
- package/src/defaultConfig.ts +2 -0
- package/src/interface/config.ts +2 -0
- package/types/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,52 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
2
|
+
"name": "leafer-x-tooltip-canvas",
|
|
3
|
+
"description": "A tooltip plugin for Leafer-ui.",
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"author": "214L",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.esm.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./dist/index.esm.js",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"types": "types/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"src",
|
|
16
|
+
"types",
|
|
17
|
+
"dev",
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/214L/leafer-x-tooltip-canvas"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/214L/leafer-x-tooltip-canvas",
|
|
25
|
+
"bugs": "https://github.com/214L/leafer-x-tooltip-canvas/issues",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"start": "cross-env NODE_ENV=development rollup -c -w",
|
|
28
|
+
"build": "cross-env PLATFORM=all rollup -c",
|
|
29
|
+
"test": "vitest"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^25.0.4",
|
|
33
|
+
"@rollup/plugin-html": "^1.0.2",
|
|
34
|
+
"@rollup/plugin-multi-entry": "^6.0.0",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
36
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
37
|
+
"@rollup/plugin-typescript": "^11.1.3",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
39
|
+
"@typescript-eslint/parser": "^5.54.1",
|
|
40
|
+
"rollup": "^3.29.2",
|
|
41
|
+
"rollup-plugin-dts": "^6.0.2",
|
|
42
|
+
"rollup-plugin-livereload": "^2.0.5",
|
|
43
|
+
"rollup-plugin-serve": "^2.0.2",
|
|
44
|
+
"rollup-plugin-string": "^3.0.0",
|
|
45
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
46
|
+
"tslib": "^2.6.2",
|
|
47
|
+
"typescript": "^5.2.2",
|
|
48
|
+
"vite": "^4.4.9",
|
|
49
|
+
"vitest": "^0.34.4",
|
|
50
|
+
"jsdom": "^22.0.0",
|
|
51
|
+
"cross-env": "^7.0.3",
|
|
52
|
+
"eslint": "^8.49.0",
|
|
53
|
+
"leafer-ui": "^1.0.4"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@leafer-ui/core": "^1.0.4",
|
|
57
|
+
"leafer-ui": "^1.0.4",
|
|
58
|
+
"@leafer-in/flow": "^1.0.4"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org"
|
|
62
|
+
}
|
|
52
63
|
}
|
package/src/TooltipPlugin.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { App, PointerEvent } from '@leafer-ui/core'
|
|
2
|
-
import type {
|
|
3
|
-
IEventListenerId,
|
|
4
|
-
ILeaf,
|
|
5
|
-
ILeafer,
|
|
6
|
-
} from '@leafer-ui/interface'
|
|
2
|
+
import type { IEventListenerId, ILeaf, ILeafer } from '@leafer-ui/interface'
|
|
7
3
|
import { IUserConfig } from './interface'
|
|
8
4
|
import { Tooltip } from './Tooltip'
|
|
9
5
|
import { getTooltipId } from './utils'
|
|
@@ -54,13 +50,13 @@ export class TooltipPlugin {
|
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
private handleConfig(){
|
|
58
|
-
if(this.config.theme==='dark'){
|
|
59
|
-
this.config.style.backgroundColor =
|
|
60
|
-
this.config.style.color =
|
|
61
|
-
}
|
|
53
|
+
private handleConfig() {
|
|
54
|
+
if (this.config.theme === 'dark') {
|
|
55
|
+
this.config.style.backgroundColor = 'black'
|
|
56
|
+
this.config.style.color = 'white'
|
|
62
57
|
}
|
|
63
|
-
|
|
58
|
+
}
|
|
59
|
+
|
|
64
60
|
/**
|
|
65
61
|
* @description 初始化事件处理
|
|
66
62
|
* @private
|
|
@@ -95,12 +91,13 @@ export class TooltipPlugin {
|
|
|
95
91
|
}
|
|
96
92
|
this.handleTooltip(event, target)
|
|
97
93
|
}
|
|
98
|
-
|
|
99
94
|
private filterTarget(list: ILeaf[]): ILeaf | null {
|
|
100
|
-
const
|
|
95
|
+
const { ignoreType, excludesType, throughExcludes } = this.config
|
|
96
|
+
const arr = throughExcludes ? ignoreType.concat(excludesType) : ignoreType
|
|
97
|
+
|
|
101
98
|
const pureResult = list.filter((item) => {
|
|
102
99
|
if (
|
|
103
|
-
|
|
100
|
+
arr.includes(item?.tag) ||
|
|
104
101
|
item?.parent?.tag === 'Tooltip' ||
|
|
105
102
|
item?.className === 'leafer-x-tooltip'
|
|
106
103
|
) {
|
package/src/defaultConfig.ts
CHANGED
package/src/interface/config.ts
CHANGED
package/types/index.d.ts
CHANGED