halox-hover-tooltip-ts 0.0.1-beta.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.
@@ -0,0 +1,4 @@
1
+ import { Directive } from 'vue';
2
+ export declare const vTooltip: Directive;
3
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
4
+ export default _default;
@@ -0,0 +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}
File without changes
@@ -0,0 +1,54 @@
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({
3
+ show: !1,
4
+ text: "",
5
+ size: "md",
6
+ x: 0,
7
+ y: 0,
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);
18
+ },
19
+ unmounted(e) {
20
+ e.removeEventListener("mouseenter", e._show), e.removeEventListener("mousemove", e._move), e.removeEventListener("mouseleave", e._hide);
21
+ }
22
+ }, x = /* @__PURE__ */ c({
23
+ __name: "index",
24
+ setup(e) {
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), {
28
+ left: `${n}px`,
29
+ top: `${a}px`,
30
+ "pointer-events": "none",
31
+ "user-select": "none"
32
+ };
33
+ });
34
+ return (s, r) => t.show ? (f(), u("div", {
35
+ key: 0,
36
+ class: d([t.customClass || "hover-tooltip", t.customClass ? "" : `hover-tooltip--${t.size}`]),
37
+ style: p(o.value)
38
+ }, [
39
+ h("div", {
40
+ innerHTML: t.text
41
+ }, null, 8, _)
42
+ ], 6)) : v("", !0);
43
+ }
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
+ export {
52
+ E as default,
53
+ C as vTooltip
54
+ };
File without changes
@@ -0,0 +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"}})}));
@@ -0,0 +1,3 @@
1
+ import { default as hoverTooltip, vTooltip } from './components/index.vue';
2
+ export default hoverTooltip;
3
+ export { vTooltip };
@@ -0,0 +1,6 @@
1
+ export * from '../index'
2
+ export {}
3
+ import HaloxHoverTooltipTs from '../index'
4
+ export default HaloxHoverTooltipTs
5
+ export * from '../index'
6
+ export {}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "halox-hover-tooltip-ts",
3
+ "version": "0.0.1-beta.1",
4
+ "main": "dist/halox-hover-tooltip-ts.umd.js",
5
+ "module": "dist/halox-hover-tooltip-ts.es.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/shenyunv2021/halox-hover-tooltip-ts.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/shenyunv2021/halox-hover-tooltip-ts-issues/issues"
13
+ },
14
+ "homepage": "https://github.com/shenyunv2021/halox-hover-tooltip-ts-issues#readme",
15
+ "contributors": [
16
+ "simcheolun <shenyunv2021@gamil.com>"
17
+ ],
18
+ "license": "MIT",
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "build": "vite build",
22
+ "build:watch": "if exist dist rd /s /q dist && vite build --watch",
23
+ "lint": "eslint . --ext .ts,.vue",
24
+ "test": "echo \"No test yet\""
25
+ },
26
+ "keywords": [
27
+ "vue3",
28
+ "typescript",
29
+ "tooltip",
30
+ "halox",
31
+ "JAYUWARE"
32
+ ],
33
+ "author": "HaloX Dev Team",
34
+ "description": "",
35
+ "dependencies": {
36
+ "vue": "^3.5.25"
37
+ },
38
+ "devDependencies": {
39
+ "@vitejs/plugin-vue": "^6.0.2",
40
+ "rollup": "^4.53.3",
41
+ "rollup-plugin-postcss": "^4.0.2",
42
+ "rollup-plugin-typescript2": "^0.36.0",
43
+ "rollup-plugin-vue": "^6.0.0",
44
+ "sass-embedded": "^1.93.3",
45
+ "typescript": "^5.9.3",
46
+ "vite": "^7.2.4",
47
+ "vite-plugin-dts": "^4.5.4",
48
+ "vue-tsc": "^3.1.5"
49
+ }
50
+ }
package/readme.md ADDED
@@ -0,0 +1,66 @@
1
+ # Vue3 Typescript HOVER-TOOLTIP UI Guide
2
+
3
+ ## 설치
4
+
5
+ ```sh
6
+ npm install halox-hover-tooltip-ts
7
+ ```
8
+ ---
9
+ ![view](https://raw.githubusercontent.com/shenyunv2021/halox-hover-tooltip-ts-issues/main/view.png)
10
+ ---
11
+
12
+ ## Description
13
+
14
+ Vue3+Typescript에서 지원하는 호버툴팁 라이브러리입니다.
15
+
16
+ 항상 최신 버전을 유지해주세요.
17
+
18
+ 필요한 개선 요청은 깃헙 이슈로 남겨주세요.
19
+
20
+ ## Features
21
+
22
+ - 커스텀 툴팁 내용
23
+ - 커스텀 양식
24
+ - 위치 자동 조절
25
+ ---
26
+
27
+ ## Changelog
28
+
29
+ - node v24.12.0
30
+ - vue 3.5.25
31
+
32
+
33
+ ## Usage Example
34
+
35
+ ```js
36
+ <script lang="ts" setup>
37
+ import Tooltip, { vTooltip } from 'halox-hover-tooltip';
38
+ </script>
39
+ ```
40
+
41
+ ```css
42
+ /* 사용자의 다른 스타일들을 여기에 작성 */
43
+ :global(.custom) {
44
+ position: fixed;
45
+ z-index: 9999;
46
+ pointer-events: none;
47
+ background: rgba(255, 0, 0, 0.85);
48
+ color: #fff;
49
+ padding: 6px 12px;
50
+ border-radius: 4px;
51
+ font-size: 14px;
52
+ white-space: pre-line;
53
+ backdrop-filter: blur(4px);
54
+ }
55
+ ```
56
+ ---
57
+
58
+ ## Main Components
59
+
60
+ ``` vue
61
+ <div v-tooltip="{ text: '토끼가 세상에 태어난 날입니다.', class: 'custom' }">
62
+ 오늘은?
63
+ </div>
64
+ ```
65
+ ---
66
+
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "declaration": true,
7
+ "declarationDir": "dist/types",
8
+ "emitDeclarationOnly": false,
9
+ "strict": true,
10
+ "jsx": "preserve",
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "resolveJsonModule": true,
14
+ "lib": ["ESNext", "DOM"]
15
+ },
16
+ "include": ["src"],
17
+ "exclude": ["node_modules", "dist", "example"]
18
+ }
19
+
package/vite.config.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { defineConfig } from 'vite';
2
+ import vue from '@vitejs/plugin-vue';
3
+ import dts from 'vite-plugin-dts';
4
+ import postcss from 'rollup-plugin-postcss';
5
+ import path from 'path';
6
+
7
+ export default defineConfig({
8
+ plugins: [
9
+ vue(),
10
+ dts({ insertTypesEntry: true }),
11
+ ],
12
+ build: {
13
+ lib: {
14
+ entry: path.resolve(__dirname, 'src/index.ts'),
15
+ name: 'halox-hover-tooltip-ts',
16
+ fileName: (format) => `halox-hover-tooltip-ts.${format}.js`,
17
+ },
18
+ rollupOptions: {
19
+ external: ['vue'],
20
+ output: {
21
+ globals: { vue: 'Vue' },
22
+ },
23
+ plugins: [
24
+ postcss({
25
+ extract: true, // CSS를 별도 파일로 추출
26
+ }),
27
+ ],
28
+ },
29
+ css: {
30
+ preprocessorOptions: { scss: {} },
31
+ },
32
+ },
33
+ });