vueless 0.0.52 → 0.0.53
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/directive.tooltip/index.js +25 -0
- package/package.json +2 -2
- package/ui.image-icon/index.vue +4 -15
- package/web-types.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import tippy from "tippy.js";
|
|
2
|
+
|
|
3
|
+
import vuelessConfig from "../../vueless.config";
|
|
4
|
+
|
|
5
|
+
import "tippy.js/dist/tippy.css";
|
|
6
|
+
import "tippy.js/themes/light.css";
|
|
7
|
+
import "tippy.js/animations/shift-away.css";
|
|
8
|
+
|
|
9
|
+
tippy.setDefaultProps(vuelessConfig.directive.tooltip);
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
mounted(el, bindings) {
|
|
13
|
+
tippy(el, bindings.value);
|
|
14
|
+
},
|
|
15
|
+
updated(el, bindings) {
|
|
16
|
+
if (!el._tippy) return;
|
|
17
|
+
|
|
18
|
+
el._tippy.setProps(bindings);
|
|
19
|
+
},
|
|
20
|
+
unmounted(el) {
|
|
21
|
+
if (!el._tippy) return;
|
|
22
|
+
|
|
23
|
+
el._tippy.destroy();
|
|
24
|
+
},
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless Component Framework.",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lodash-es": "^4.17.21",
|
|
34
34
|
"tailwind-merge": "^2.3.0",
|
|
35
35
|
"tailwindcss": "^3.4.3",
|
|
36
|
-
"
|
|
36
|
+
"tippy.js": "^6.3.7",
|
|
37
37
|
"vuedraggable": "^4.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
package/ui.image-icon/index.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-
|
|
2
|
+
<span
|
|
3
|
+
v-tooltip="tooltipConfig"
|
|
4
4
|
:data-cy="dataCy"
|
|
5
5
|
v-bind="wrapperAttrs"
|
|
6
6
|
@focus="onFocus"
|
|
@@ -10,31 +10,20 @@
|
|
|
10
10
|
<div v-bind="containerAttrs">
|
|
11
11
|
<component :is="dynamicComponent" v-bind="iconAttrs" />
|
|
12
12
|
</div>
|
|
13
|
-
</
|
|
13
|
+
</span>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
17
|
import { computed, defineAsyncComponent } from "vue";
|
|
18
|
-
import { directive as tippyDirective, setDefaultProps as tippySetConfig } from "vue-tippy";
|
|
19
|
-
import "tippy.js/dist/tippy.css";
|
|
20
|
-
import "tippy.js/themes/light.css";
|
|
21
|
-
import "tippy.js/animations/shift-away.css";
|
|
22
18
|
import UIService from "../service.ui";
|
|
23
19
|
|
|
24
20
|
import { UIcon } from "./constants";
|
|
25
21
|
import defaultConfig from "./configs/default.config";
|
|
26
22
|
import { useAttrs } from "./composables/attrs.composable";
|
|
27
23
|
|
|
28
|
-
tippySetConfig({
|
|
29
|
-
arrow: true,
|
|
30
|
-
theme: "light",
|
|
31
|
-
animation: "shift-away",
|
|
32
|
-
});
|
|
33
|
-
|
|
34
24
|
/* Should be a string for correct web-types gen */
|
|
35
25
|
defineOptions({
|
|
36
26
|
name: "UIcon",
|
|
37
|
-
directives: { tippy: tippyDirective },
|
|
38
27
|
inheritAttrs: false,
|
|
39
28
|
});
|
|
40
29
|
|
|
@@ -215,7 +204,7 @@ const dynamicComponent = computed(() => {
|
|
|
215
204
|
return defineAsyncComponent(libraries[library]);
|
|
216
205
|
});
|
|
217
206
|
|
|
218
|
-
const
|
|
207
|
+
const tooltipConfig = computed(() => {
|
|
219
208
|
return { onShow: () => !!props.tooltip, ...props.tooltipSettings, content: props.tooltip };
|
|
220
209
|
});
|
|
221
210
|
|