halox-hover-tooltip-ts 0.0.2 → 0.0.4

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.
@@ -1 +1 @@
1
- .hover-tooltip[data-v-e3a96650]{position:fixed;z-index:9999;pointer-events:none;background:#000000d9;color:#fff;padding:6px 12px;border-radius:4px;font-size:14px;white-space:pre-line;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.hover-tooltip--sm[data-v-e3a96650]{font-size:12px;padding:3px 8px}.hover-tooltip--lg[data-v-e3a96650]{font-size:16px;padding:10px 20px}
1
+ .hover-tooltip{position:fixed;z-index:9999;pointer-events:none;background:#000000d9;color:#fff;padding:6px 12px;border-radius:4px;font-size:14px;white-space:pre-line;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.hover-tooltip--sm{font-size:12px;padding:3px 8px}.hover-tooltip--lg{font-size:16px;padding:10px 20px}
@@ -1,54 +1,48 @@
1
- import { reactive as l, defineComponent as c, computed as m, createElementBlock as u, createCommentVNode as v, openBlock as f, normalizeStyle as p, normalizeClass as d, createElementVNode as h } from "vue";
2
- const _ = ["innerHTML"], t = l({
1
+ import { reactive as l, defineComponent as r, computed as m, createElementBlock as c, createCommentVNode as u, openBlock as v, normalizeStyle as f, normalizeClass as d, createElementVNode as h } from "vue";
2
+ const p = ["innerHTML"], e = l({
3
3
  show: !1,
4
4
  text: "",
5
5
  size: "md",
6
6
  x: 0,
7
7
  y: 0,
8
8
  customClass: ""
9
- }), C = {
10
- mounted(e, o) {
11
- e._show = (s) => {
12
- t.text = typeof o.value == "string" ? o.value : o.value.text, t.size = o.value?.size || "md", typeof o.value == "object" && o.value.class ? t.customClass = o.value.class : o.arg ? t.customClass = o.arg : t.customClass = "", t.show = !0, t.x = s.clientX, t.y = s.clientY;
13
- }, e._move = (s) => {
14
- t.x = s.clientX, t.y = s.clientY;
15
- }, e._hide = () => {
16
- t.show = !1;
17
- }, e.addEventListener("mouseenter", e._show), e.addEventListener("mousemove", e._move), e.addEventListener("mouseleave", e._hide);
9
+ }), w = {
10
+ mounted(t, o) {
11
+ t._show = (s) => {
12
+ e.text = typeof o.value == "string" ? o.value : o.value.text, e.size = o.value?.size || "md", typeof o.value == "object" && o.value.class ? e.customClass = o.value.class : o.arg ? e.customClass = o.arg : e.customClass = "", e.show = !0, e.x = s.clientX, e.y = s.clientY;
13
+ }, t._move = (s) => {
14
+ e.x = s.clientX, e.y = s.clientY;
15
+ }, t._hide = () => {
16
+ e.show = !1;
17
+ }, t.addEventListener("mouseenter", t._show), t.addEventListener("mousemove", t._move), t.addEventListener("mouseleave", t._hide);
18
18
  },
19
- unmounted(e) {
20
- e.removeEventListener("mouseenter", e._show), e.removeEventListener("mousemove", e._move), e.removeEventListener("mouseleave", e._hide);
19
+ unmounted(t) {
20
+ t.removeEventListener("mouseenter", t._show), t.removeEventListener("mousemove", t._move), t.removeEventListener("mouseleave", t._hide);
21
21
  }
22
- }, x = /* @__PURE__ */ c({
22
+ }, y = /* @__PURE__ */ r({
23
23
  __name: "index",
24
- setup(e) {
24
+ setup(t) {
25
25
  const o = m(() => {
26
- let n = t.x + 15, a = t.y + 15;
27
- return n + 200 > window.innerWidth && (n = t.x - 200 - 15), a + 40 > window.innerHeight && (a = t.y - 40 - 15), n = Math.max(0, n), a = Math.max(0, a), {
26
+ let n = e.x + 15, a = e.y + 15;
27
+ return n + 200 > window.innerWidth && (n = e.x - 200 - 15), a + 40 > window.innerHeight && (a = e.y - 40 - 15), n = Math.max(0, n), a = Math.max(0, a), {
28
28
  left: `${n}px`,
29
29
  top: `${a}px`,
30
- "pointer-events": "none",
31
- "user-select": "none"
30
+ pointerEvents: "none",
31
+ userSelect: "none"
32
32
  };
33
33
  });
34
- return (s, r) => t.show ? (f(), u("div", {
34
+ return (s, i) => e.show ? (v(), c("div", {
35
35
  key: 0,
36
- class: d([t.customClass || "hover-tooltip", t.customClass ? "" : `hover-tooltip--${t.size}`]),
37
- style: p(o.value)
36
+ class: d([e.customClass || "hover-tooltip", e.customClass ? "" : `hover-tooltip--${e.size}`]),
37
+ style: f(o.value)
38
38
  }, [
39
39
  h("div", {
40
- innerHTML: t.text
41
- }, null, 8, _)
42
- ], 6)) : v("", !0);
40
+ innerHTML: e.text
41
+ }, null, 8, p)
42
+ ], 6)) : u("", !0);
43
43
  }
44
44
  });
45
- const y = (e, o) => {
46
- const s = e.__vccOpts || e;
47
- for (const [r, i] of o)
48
- s[r] = i;
49
- return s;
50
- }, E = /* @__PURE__ */ y(x, [["__scopeId", "data-v-e3a96650"]]);
51
45
  export {
52
- E as default,
53
- C as vTooltip
46
+ y as default,
47
+ w as vTooltip
54
48
  };
@@ -1 +1 @@
1
- (function(i,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(i=typeof globalThis<"u"?globalThis:i||self,o(i["halox-hover-tooltip-ts"]={},i.Vue))})(this,(function(i,o){"use strict";const u=["innerHTML"],e=o.reactive({show:!1,text:"",size:"md",x:0,y:0,customClass:""}),f={mounted(t,s){t._show=n=>{e.text=typeof s.value=="string"?s.value:s.value.text,e.size=s.value?.size||"md",typeof s.value=="object"&&s.value.class?e.customClass=s.value.class:s.arg?e.customClass=s.arg:e.customClass="",e.show=!0,e.x=n.clientX,e.y=n.clientY},t._move=n=>{e.x=n.clientX,e.y=n.clientY},t._hide=()=>{e.show=!1},t.addEventListener("mouseenter",t._show),t.addEventListener("mousemove",t._move),t.addEventListener("mouseleave",t._hide)},unmounted(t){t.removeEventListener("mouseenter",t._show),t.removeEventListener("mousemove",t._move),t.removeEventListener("mouseleave",t._hide)}},m=o.defineComponent({__name:"index",setup(t){const s=o.computed(()=>{let l=e.x+15,r=e.y+15;return l+200>window.innerWidth&&(l=e.x-200-15),r+40>window.innerHeight&&(r=e.y-40-15),l=Math.max(0,l),r=Math.max(0,r),{left:`${l}px`,top:`${r}px`,"pointer-events":"none","user-select":"none"}});return(n,a)=>e.show?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass([e.customClass||"hover-tooltip",e.customClass?"":`hover-tooltip--${e.size}`]),style:o.normalizeStyle(s.value)},[o.createElementVNode("div",{innerHTML:e.text},null,8,u)],6)):o.createCommentVNode("",!0)}}),p=void 0,d=((t,s)=>{const n=t.__vccOpts||t;for(const[a,c]of s)n[a]=c;return n})(m,[["__scopeId","data-v-e3a96650"]]);i.default=d,i.vTooltip=f,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n["halox-hover-tooltip-ts"]={},n.Vue))})(this,(function(n,o){"use strict";const r=["innerHTML"],e=o.reactive({show:!1,text:"",size:"md",x:0,y:0,customClass:""}),u={mounted(t,s){t._show=i=>{e.text=typeof s.value=="string"?s.value:s.value.text,e.size=s.value?.size||"md",typeof s.value=="object"&&s.value.class?e.customClass=s.value.class:s.arg?e.customClass=s.arg:e.customClass="",e.show=!0,e.x=i.clientX,e.y=i.clientY},t._move=i=>{e.x=i.clientX,e.y=i.clientY},t._hide=()=>{e.show=!1},t.addEventListener("mouseenter",t._show),t.addEventListener("mousemove",t._move),t.addEventListener("mouseleave",t._hide)},unmounted(t){t.removeEventListener("mouseenter",t._show),t.removeEventListener("mousemove",t._move),t.removeEventListener("mouseleave",t._hide)}},c=o.defineComponent({__name:"index",setup(t){const s=o.computed(()=>{let l=e.x+15,a=e.y+15;return l+200>window.innerWidth&&(l=e.x-200-15),a+40>window.innerHeight&&(a=e.y-40-15),l=Math.max(0,l),a=Math.max(0,a),{left:`${l}px`,top:`${a}px`,pointerEvents:"none",userSelect:"none"}});return(i,m)=>e.show?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass([e.customClass||"hover-tooltip",e.customClass?"":`hover-tooltip--${e.size}`]),style:o.normalizeStyle(s.value)},[o.createElementVNode("div",{innerHTML:e.text},null,8,r)],6)):o.createCommentVNode("",!0)}}),f=void 0;n.default=c,n.vTooltip=u,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halox-hover-tooltip-ts",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "dist/halox-hover-tooltip-ts.umd.js",
5
5
  "module": "dist/halox-hover-tooltip-ts.es.js",
6
6
  "types": "dist/types/index.d.ts",
package/readme.md CHANGED
@@ -34,7 +34,8 @@ Vue3+Typescript에서 지원하는 호버툴팁 라이브러리입니다.
34
34
 
35
35
  ```js
36
36
  <script lang="ts" setup>
37
- import Tooltip, { vTooltip } from 'halox-hover-tooltip';
37
+ import 'halox-hover-tooltip-ts/dist/halox-hover-tooltip-ts.css';
38
+ import Tooltip, { vTooltip } from 'halox-hover-tooltip-ts';
38
39
  </script>
39
40
  ```
40
41