@avakhula/ui 0.0.213 → 0.0.215
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/.eslintrc.cjs +4 -0
- package/dist/index.js +4079 -3976
- package/dist/index.umd.cjs +77 -67
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/src/components/Accordion/Accordion.scss +4 -1
- package/src/components/Accordion/Accordion.vue +3 -1
- package/src/components/Alert/alert.scss +1 -0
- package/src/components/Alert/constants.js +1 -0
- package/src/components/Avatar/Avatar.vue +17 -9
- package/src/components/Form/Input/Input.vue +3 -0
- package/src/components/Sorting/Sorting.stories.js +1 -1
- package/src/components/Sorting/Sorting.vue +55 -25
- package/src/components/Sorting/sorting.scss +1 -1
- package/src/components/Tooltip/Tooltip.vue +95 -11
- package/src/components/TreeSelect/Option.vue +3 -4
- package/src/components/TreeSelect/Select.vue +20 -7
- package/src/components/TreeSelect/scss/option.scss +4 -0
- package/src/directives/tooltip/TooltipController.js +113 -14
- package/src/directives/tooltip/tooltip.js +23 -8
- package/src/directives/tooltip/tooltip.stories.js +8 -2
|
@@ -3,7 +3,8 @@ import Tooltip from "./TooltipController";
|
|
|
3
3
|
const tooltip = new Tooltip();
|
|
4
4
|
const createTooltip = (el, binding) => {
|
|
5
5
|
if (!tooltip.getTooltipContainer()) {
|
|
6
|
-
|
|
6
|
+
const position = Object.keys(binding.modifiers)[0] || binding.arg;
|
|
7
|
+
tooltip.createTooltip(el, binding.value, position);
|
|
7
8
|
}
|
|
8
9
|
};
|
|
9
10
|
|
|
@@ -26,15 +27,29 @@ const destroyTooltip = (event, el) => {
|
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
|
|
30
|
+
const attachTooltipListeners = (el, binding) => {
|
|
31
|
+
el.__tooltip_create = () => createTooltip(el, binding);
|
|
32
|
+
el.__tooltip_destroy = (e) => destroyTooltip(e, el);
|
|
33
|
+
|
|
34
|
+
el.addEventListener("mouseenter", el.__tooltip_create);
|
|
35
|
+
document.addEventListener("mousemove", el.__tooltip_destroy);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const removeTooltipListeners = (el) => {
|
|
39
|
+
tooltip.destroyTooltip();
|
|
40
|
+
el.removeEventListener("mouseenter", el.__tooltip_create);
|
|
41
|
+
document.removeEventListener("mousemove", el.__tooltip_destroy);
|
|
42
|
+
};
|
|
43
|
+
|
|
29
44
|
export const TooltipDirective = {
|
|
30
45
|
mounted(el, binding) {
|
|
31
|
-
|
|
32
|
-
document.addEventListener("mousemove", (e) => destroyTooltip(e, el));
|
|
46
|
+
attachTooltipListeners(el, binding);
|
|
33
47
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
updated(el, binding) {
|
|
49
|
+
removeTooltipListeners(el);
|
|
50
|
+
attachTooltipListeners(el, binding);
|
|
51
|
+
},
|
|
52
|
+
beforeUnmount(el) {
|
|
53
|
+
removeTooltipListeners(el);
|
|
39
54
|
},
|
|
40
55
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IbButton from "../../components/Button/Button.vue";
|
|
2
|
+
|
|
2
3
|
import { TooltipDirective } from "./tooltip";
|
|
3
4
|
import readme from "./readme.mdx";
|
|
4
5
|
|
|
@@ -18,13 +19,18 @@ const Template = (args) => ({
|
|
|
18
19
|
setup() {
|
|
19
20
|
return { args };
|
|
20
21
|
},
|
|
21
|
-
template:
|
|
22
|
+
template: `
|
|
23
|
+
<div style="display:flex;flex-wrap:wrap;">
|
|
24
|
+
<ib-button v-tooltip="'Tooltip Content Content Content Content'" v-bind="args">Tooltip</ib-button>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
`,
|
|
22
28
|
});
|
|
23
29
|
|
|
24
30
|
export const Default = Template.bind({});
|
|
25
31
|
Default.decorators = [
|
|
26
32
|
() => ({
|
|
27
33
|
template:
|
|
28
|
-
'<div style="display: flex; align-items:center; justify-content: center; width:
|
|
34
|
+
'<div style="display: flex; align-items:center; justify-content: center; width: 600px; height: auto; margin: 0 auto"><story /></div>',
|
|
29
35
|
}),
|
|
30
36
|
];
|