tttb 0.1.24
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.md +42 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/Button/index.js +6 -0
- package/dist/components/Button/index.vue.js +7 -0
- package/dist/components/Button/index.vue2.js +57 -0
- package/dist/components/Button/types.js +8 -0
- package/dist/components/Checkbox/index.js +6 -0
- package/dist/components/Checkbox/index.vue.js +7 -0
- package/dist/components/Checkbox/index.vue2.js +35 -0
- package/dist/components/Checkbox/types.js +7 -0
- package/dist/components/Dialog/DialogItem.vue.js +7 -0
- package/dist/components/Dialog/DialogItem.vue2.js +78 -0
- package/dist/components/Dialog/DialogPrompt.vue.js +7 -0
- package/dist/components/Dialog/DialogPrompt.vue2.js +63 -0
- package/dist/components/Dialog/index.js +6 -0
- package/dist/components/Dialog/index.vue.js +7 -0
- package/dist/components/Dialog/index.vue2.js +81 -0
- package/dist/components/Icon/index.js +6 -0
- package/dist/components/Icon/index.vue.js +43 -0
- package/dist/components/Icon/index.vue2.js +4 -0
- package/dist/components/Loading/index.js +6 -0
- package/dist/components/Loading/index.vue.js +7 -0
- package/dist/components/Loading/index.vue2.js +37 -0
- package/dist/components/Loading/types.js +7 -0
- package/dist/components/Message/index.js +6 -0
- package/dist/components/Message/index.vue.js +7 -0
- package/dist/components/Message/index.vue2.js +91 -0
- package/dist/components/Modal/index.js +6 -0
- package/dist/components/Modal/index.vue.js +7 -0
- package/dist/components/Modal/index.vue2.js +39 -0
- package/dist/components/Modal/types.js +7 -0
- package/dist/components/Nav/index.js +6 -0
- package/dist/components/Nav/index.vue.js +7 -0
- package/dist/components/Nav/index.vue2.js +95 -0
- package/dist/components/Pagination/index.js +6 -0
- package/dist/components/Pagination/index.vue.js +7 -0
- package/dist/components/Pagination/index.vue2.js +162 -0
- package/dist/components/Pagination/types.js +8 -0
- package/dist/components/Popconfirm/index.js +7 -0
- package/dist/components/Popconfirm/index.vue.js +92 -0
- package/dist/components/Popconfirm/index.vue3.js +5 -0
- package/dist/components/Popconfirm/types.js +14 -0
- package/dist/components/Popover/index.js +7 -0
- package/dist/components/Popover/index.vue.js +32 -0
- package/dist/components/Popover/index.vue3.js +5 -0
- package/dist/components/Progress/index.js +6 -0
- package/dist/components/Progress/index.vue.js +7 -0
- package/dist/components/Progress/index.vue2.js +38 -0
- package/dist/components/Progress/types.js +7 -0
- package/dist/components/RouterNav/index.js +6 -0
- package/dist/components/RouterNav/index.vue.js +33 -0
- package/dist/components/RouterNav/index.vue2.js +4 -0
- package/dist/components/Switch/index.js +6 -0
- package/dist/components/Switch/index.vue.js +7 -0
- package/dist/components/Switch/index.vue2.js +76 -0
- package/dist/components/Switch/types.js +6 -0
- package/dist/components/Table/index.js +6 -0
- package/dist/components/Table/index.vue.js +7 -0
- package/dist/components/Table/index.vue2.js +57 -0
- package/dist/components/Timer/index.js +6 -0
- package/dist/components/Timer/index.vue.js +31 -0
- package/dist/components/Timer/index.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipContent.vue.js +33 -0
- package/dist/components/Tooltip/TooltipContent.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipItem.vue.js +58 -0
- package/dist/components/Tooltip/TooltipItem.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipLayer.vue.js +49 -0
- package/dist/components/Tooltip/TooltipLayer.vue2.js +4 -0
- package/dist/components/Tooltip/index.js +6 -0
- package/dist/components/Tooltip/index.vue.js +74 -0
- package/dist/components/Tooltip/index.vue2.js +4 -0
- package/dist/components/Tooltip/manager.js +107 -0
- package/dist/components/Tooltip/types.js +21 -0
- package/dist/components/Tooltip/useTooltip.js +43 -0
- package/dist/components/Warn/index.js +6 -0
- package/dist/components/Warn/index.vue.js +7 -0
- package/dist/components/Warn/index.vue2.js +21 -0
- package/dist/components/Warn/types.js +6 -0
- package/dist/components/Watermark/index.js +6 -0
- package/dist/components/Watermark/index.vue.js +7 -0
- package/dist/components/Watermark/index.vue2.js +54 -0
- package/dist/components/Watermark/types.js +10 -0
- package/dist/components/Watermark/useWatermarkBg.js +11 -0
- package/dist/components/helpers.js +25 -0
- package/dist/components.js +40 -0
- package/dist/directives/vBackTop.js +110 -0
- package/dist/directives/vDelayIn.js +41 -0
- package/dist/directives/vHoldPointer.js +112 -0
- package/dist/directives/vLazy.js +65 -0
- package/dist/directives/vLoading.js +50 -0
- package/dist/directives/vRipple.js +81 -0
- package/dist/directives/vSlideIn.js +39 -0
- package/dist/directives/vTextJump.js +50 -0
- package/dist/directives/vTooltip.js +55 -0
- package/dist/directives.js +20 -0
- package/dist/hooks/useAudio.js +112 -0
- package/dist/hooks/useElementScroll.js +30 -0
- package/dist/hooks/useGSAP.js +40 -0
- package/dist/hooks/useRefreshRate.js +26 -0
- package/dist/hooks/useWindowBackTop.js +86 -0
- package/dist/hooks.js +13 -0
- package/dist/icons/brands.js +554 -0
- package/dist/icons/regular.js +278 -0
- package/dist/icons/solid.js +1989 -0
- package/dist/index.js +130 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +400 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/dist/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +3074 -0
- package/dist/node_modules/@fortawesome/free-brands-svg-icons/index.js +3156 -0
- package/dist/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +9602 -0
- package/dist/node_modules/@fortawesome/vue-fontawesome/index.es.js +487 -0
- package/dist/node_modules/gsap/CSSPlugin.js +424 -0
- package/dist/node_modules/gsap/gsap-core.js +1645 -0
- package/dist/node_modules/gsap/index.js +13 -0
- package/dist/tttb.css +1 -0
- package/dist/types/bundle.d.ts +10 -0
- package/dist/types/components/Button/index.d.ts +22 -0
- package/dist/types/components/Button/types.d.ts +12 -0
- package/dist/types/components/Checkbox/index.d.ts +29 -0
- package/dist/types/components/Checkbox/types.d.ts +8 -0
- package/dist/types/components/Dialog/DialogItem.d.ts +38 -0
- package/dist/types/components/Dialog/DialogPrompt.d.ts +16 -0
- package/dist/types/components/Dialog/index.d.ts +10 -0
- package/dist/types/components/Dialog/types.d.ts +35 -0
- package/dist/types/components/Icon/index.d.ts +3 -0
- package/dist/types/components/Icon/types.d.ts +2 -0
- package/dist/types/components/Loading/index.d.ts +6 -0
- package/dist/types/components/Loading/types.d.ts +8 -0
- package/dist/types/components/Message/index.d.ts +9 -0
- package/dist/types/components/Message/types.d.ts +12 -0
- package/dist/types/components/Modal/index.d.ts +21 -0
- package/dist/types/components/Modal/types.d.ts +11 -0
- package/dist/types/components/Nav/index.d.ts +7 -0
- package/dist/types/components/Nav/types.d.ts +14 -0
- package/dist/types/components/Pagination/index.d.ts +18 -0
- package/dist/types/components/Pagination/types.d.ts +16 -0
- package/dist/types/components/Popconfirm/index.d.ts +266 -0
- package/dist/types/components/Popconfirm/types.d.ts +26 -0
- package/dist/types/components/Popover/index.d.ts +150 -0
- package/dist/types/components/Progress/index.d.ts +21 -0
- package/dist/types/components/Progress/types.d.ts +9 -0
- package/dist/types/components/RouterNav/index.d.ts +2 -0
- package/dist/types/components/Switch/index.d.ts +13 -0
- package/dist/types/components/Switch/types.d.ts +6 -0
- package/dist/types/components/Table/index.d.ts +31 -0
- package/dist/types/components/Table/types.d.ts +3 -0
- package/dist/types/components/Timer/index.d.ts +6 -0
- package/dist/types/components/Tooltip/TooltipContent.d.ts +16 -0
- package/dist/types/components/Tooltip/TooltipItem.d.ts +45 -0
- package/dist/types/components/Tooltip/TooltipLayer.d.ts +2 -0
- package/dist/types/components/Tooltip/index.d.ts +42 -0
- package/dist/types/components/Tooltip/manager.d.ts +3384 -0
- package/dist/types/components/Tooltip/types.d.ts +52 -0
- package/dist/types/components/Tooltip/useTooltip.d.ts +8 -0
- package/dist/types/components/Warn/index.d.ts +20 -0
- package/dist/types/components/Warn/types.d.ts +6 -0
- package/dist/types/components/Watermark/index.d.ts +28 -0
- package/dist/types/components/Watermark/types.d.ts +14 -0
- package/dist/types/components/Watermark/useWatermarkBg.d.ts +6 -0
- package/dist/types/components/helpers.d.ts +14 -0
- package/dist/types/components/index.d.ts +19 -0
- package/dist/types/directives/helper.d.ts +4 -0
- package/dist/types/directives/index.d.ts +9 -0
- package/dist/types/directives/vBackTop.d.ts +3 -0
- package/dist/types/directives/vDelayIn.d.ts +3 -0
- package/dist/types/directives/vHoldPointer.d.ts +3 -0
- package/dist/types/directives/vLazy.d.ts +3 -0
- package/dist/types/directives/vLoading.d.ts +3 -0
- package/dist/types/directives/vRipple.d.ts +3 -0
- package/dist/types/directives/vSlideIn.d.ts +3 -0
- package/dist/types/directives/vTextJump.d.ts +3 -0
- package/dist/types/directives/vTooltip.d.ts +8 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/useAudio.d.ts +38 -0
- package/dist/types/hooks/useElementScroll.d.ts +32 -0
- package/dist/types/hooks/useGSAP.d.ts +32 -0
- package/dist/types/hooks/useRefreshRate.d.ts +5 -0
- package/dist/types/hooks/useWindowBackTop.d.ts +14 -0
- package/dist/types/icons/brands.d.ts +551 -0
- package/dist/types/icons/regular.d.ts +275 -0
- package/dist/types/icons/solid.d.ts +1986 -0
- package/dist/types/router/index.d.ts +2 -0
- package/dist/types/utils/chance.d.ts +7 -0
- package/dist/types/utils/copyToClipboard.d.ts +6 -0
- package/dist/types/utils/debounce.d.ts +15 -0
- package/dist/types/utils/deepClone.d.ts +6 -0
- package/dist/types/utils/deepEqual.d.ts +5 -0
- package/dist/types/utils/dialog.d.ts +8 -0
- package/dist/types/utils/getId.d.ts +6 -0
- package/dist/types/utils/getRandomColor.d.ts +4 -0
- package/dist/types/utils/getRandomInt.d.ts +6 -0
- package/dist/types/utils/getRandomStr.d.ts +6 -0
- package/dist/types/utils/index.d.ts +23 -0
- package/dist/types/utils/injectStyles.d.ts +9 -0
- package/dist/types/utils/isElementOverflow.d.ts +20 -0
- package/dist/types/utils/isEmpty.d.ts +6 -0
- package/dist/types/utils/isMobile.d.ts +6 -0
- package/dist/types/utils/isObject.d.ts +4 -0
- package/dist/types/utils/isPromise.d.ts +6 -0
- package/dist/types/utils/localStorage.d.ts +24 -0
- package/dist/types/utils/msg.d.ts +8 -0
- package/dist/types/utils/omit.d.ts +6 -0
- package/dist/types/utils/pick.d.ts +6 -0
- package/dist/types/utils/sessionStorage.d.ts +24 -0
- package/dist/types/utils/shuffleArray.d.ts +6 -0
- package/dist/types/utils/throttle.d.ts +7 -0
- package/dist/utils/chance.js +7 -0
- package/dist/utils/copyToClipboard.js +21 -0
- package/dist/utils/debounce.js +14 -0
- package/dist/utils/deepClone.js +17 -0
- package/dist/utils/deepEqual.js +40 -0
- package/dist/utils/dialog.js +43 -0
- package/dist/utils/getId.js +10 -0
- package/dist/utils/getRandomColor.js +4 -0
- package/dist/utils/getRandomInt.js +4 -0
- package/dist/utils/getRandomStr.js +5 -0
- package/dist/utils/injectStyles.js +24 -0
- package/dist/utils/isElementOverflow.js +22 -0
- package/dist/utils/isEmpty.js +4 -0
- package/dist/utils/isMobile.js +7 -0
- package/dist/utils/isObject.js +4 -0
- package/dist/utils/isPromise.js +4 -0
- package/dist/utils/localStorage.js +47 -0
- package/dist/utils/msg.js +21 -0
- package/dist/utils/omit.js +9 -0
- package/dist/utils/pick.js +9 -0
- package/dist/utils/sessionStorage.js +47 -0
- package/dist/utils/shuffleArray.js +10 -0
- package/dist/utils/throttle.js +11 -0
- package/dist/utils.js +49 -0
- package/package.json +95 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as l, computed as i, openBlock as n, createElementBlock as o, normalizeClass as p, createElementVNode as r, normalizeStyle as d, toDisplayString as a, renderSlot as m, createCommentVNode as u, mergeDefaults as f } from "vue";
|
|
2
|
+
import { defaultProps as x } from "./types.js";
|
|
3
|
+
const y = { class: "wrapper" }, h = { class: "percent" }, v = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "text"
|
|
6
|
+
}, C = /* @__PURE__ */ l({
|
|
7
|
+
name: "Progress",
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: /* @__PURE__ */ f({
|
|
10
|
+
percent: {},
|
|
11
|
+
text: {},
|
|
12
|
+
type: {}
|
|
13
|
+
}, x),
|
|
14
|
+
setup(t) {
|
|
15
|
+
const c = t, s = i(() => {
|
|
16
|
+
const e = c.percent;
|
|
17
|
+
return e <= 0 ? 0 : e >= 100 ? 100 : e.toFixed(2);
|
|
18
|
+
});
|
|
19
|
+
return (e, _) => (n(), o("div", {
|
|
20
|
+
class: p(["progress-container", t.type])
|
|
21
|
+
}, [
|
|
22
|
+
r("div", y, [
|
|
23
|
+
r("div", {
|
|
24
|
+
class: "bar",
|
|
25
|
+
style: d({ width: s.value + "%" })
|
|
26
|
+
}, [
|
|
27
|
+
r("span", h, a(s.value) + "%", 1)
|
|
28
|
+
], 4)
|
|
29
|
+
]),
|
|
30
|
+
m(e.$slots, "default", {}, () => [
|
|
31
|
+
t.text ? (n(), o("span", v, a(t.text), 1)) : u("", !0)
|
|
32
|
+
], !0)
|
|
33
|
+
], 2));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
C as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as f, computed as m, openBlock as d, createBlock as h, unref as v } from "vue";
|
|
2
|
+
import _ from "../Nav/index.js";
|
|
3
|
+
import { useRouter as R } from "vue-router";
|
|
4
|
+
const k = /* @__PURE__ */ f({
|
|
5
|
+
name: "RouterNav",
|
|
6
|
+
__name: "index",
|
|
7
|
+
setup(N) {
|
|
8
|
+
const o = R(), i = m(() => o.currentRoute.value.name), a = (e) => {
|
|
9
|
+
const t = [];
|
|
10
|
+
for (const n of e) {
|
|
11
|
+
if (!n.components && !n.component || n.meta?.notNav) continue;
|
|
12
|
+
const { meta: r, children: u, name: c } = n, s = {
|
|
13
|
+
name: r?.title,
|
|
14
|
+
icon: r?.icon,
|
|
15
|
+
active: c === i.value,
|
|
16
|
+
routeName: c
|
|
17
|
+
};
|
|
18
|
+
u?.length && (s.children = a(u)), t.push(s);
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}, l = m(() => a(o.getRoutes())), p = (e, t) => {
|
|
22
|
+
e.active && t(!1, !0), o.push({ name: e.routeName });
|
|
23
|
+
};
|
|
24
|
+
return (e, t) => (d(), h(v(_), {
|
|
25
|
+
class: "router-nav-container",
|
|
26
|
+
data: l.value,
|
|
27
|
+
onChange: p
|
|
28
|
+
}, null, 8, ["data"]));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
k as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as a, useModel as i, openBlock as t, createElementBlock as o, normalizeClass as c, withDirectives as d, createElementVNode as e, vModelCheckbox as m, mergeModels as w, mergeDefaults as p } from "vue";
|
|
2
|
+
import { defaultProps as u } from "./types.js";
|
|
3
|
+
const x = { class: "slider" }, g = { class: "circle" }, h = {
|
|
4
|
+
class: "cross",
|
|
5
|
+
"xml:space": "preserve",
|
|
6
|
+
style: { "enable-background": "new 0 0 512 512" },
|
|
7
|
+
viewBox: "0 0 365.696 365.696",
|
|
8
|
+
y: "0",
|
|
9
|
+
x: "0",
|
|
10
|
+
height: "6",
|
|
11
|
+
width: "6",
|
|
12
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
13
|
+
version: "1.1",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
15
|
+
}, v = {
|
|
16
|
+
class: "checkmark",
|
|
17
|
+
"xml:space": "preserve",
|
|
18
|
+
style: { "enable-background": "new 0 0 512 512" },
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
y: "0",
|
|
21
|
+
x: "0",
|
|
22
|
+
height: "10",
|
|
23
|
+
width: "10",
|
|
24
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
25
|
+
version: "1.1",
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
27
|
+
}, b = /* @__PURE__ */ a({
|
|
28
|
+
name: "Switch",
|
|
29
|
+
__name: "index",
|
|
30
|
+
props: /* @__PURE__ */ w(/* @__PURE__ */ p({
|
|
31
|
+
type: {}
|
|
32
|
+
}, u), {
|
|
33
|
+
modelValue: { type: Boolean, required: !0 },
|
|
34
|
+
modelModifiers: {}
|
|
35
|
+
}),
|
|
36
|
+
emits: ["update:modelValue"],
|
|
37
|
+
setup(s) {
|
|
38
|
+
const n = i(s, "modelValue");
|
|
39
|
+
return (k, l) => (t(), o("label", {
|
|
40
|
+
class: c(["switch-container", s.type])
|
|
41
|
+
}, [
|
|
42
|
+
d(e("input", {
|
|
43
|
+
type: "checkbox",
|
|
44
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => n.value = r)
|
|
45
|
+
}, null, 512), [
|
|
46
|
+
[m, n.value]
|
|
47
|
+
]),
|
|
48
|
+
e("div", x, [
|
|
49
|
+
e("div", g, [
|
|
50
|
+
(t(), o("svg", h, [...l[1] || (l[1] = [
|
|
51
|
+
e("g", null, [
|
|
52
|
+
e("path", {
|
|
53
|
+
"data-original": "#000000",
|
|
54
|
+
fill: "currentColor",
|
|
55
|
+
d: "M243.188 182.86 356.32 69.726c12.5-12.5 12.5-32.766 0-45.247L341.238 9.398c-12.504-12.503-32.77-12.503-45.25 0L182.86 122.528 69.727 9.374c-12.5-12.5-32.766-12.5-45.247 0L9.375 24.457c-12.5 12.504-12.5 32.77 0 45.25l113.152 113.152L9.398 295.99c-12.503 12.503-12.503 32.769 0 45.25L24.48 356.32c12.5 12.5 32.766 12.5 45.247 0l113.132-113.132L295.99 356.32c12.503 12.5 32.769 12.5 45.25 0l15.081-15.082c12.5-12.504 12.5-32.77 0-45.25zm0 0"
|
|
56
|
+
})
|
|
57
|
+
], -1)
|
|
58
|
+
])])),
|
|
59
|
+
(t(), o("svg", v, [...l[2] || (l[2] = [
|
|
60
|
+
e("g", null, [
|
|
61
|
+
e("path", {
|
|
62
|
+
class: "",
|
|
63
|
+
"data-original": "#000000",
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
d: "M9.707 19.121a.997.997 0 0 1-1.414 0l-5.646-5.647a1.5 1.5 0 0 1 0-2.121l.707-.707a1.5 1.5 0 0 1 2.121 0L9 14.171l9.525-9.525a1.5 1.5 0 0 1 2.121 0l.707.707a1.5 1.5 0 0 1 0 2.121z"
|
|
66
|
+
})
|
|
67
|
+
], -1)
|
|
68
|
+
])]))
|
|
69
|
+
])
|
|
70
|
+
])
|
|
71
|
+
], 2));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
b as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as b, computed as v, openBlock as e, createElementBlock as r, createElementVNode as a, Fragment as d, renderList as c, toDisplayString as i, unref as m, renderSlot as f, createCommentVNode as E, createBlock as _ } from "vue";
|
|
2
|
+
import "../../utils/dialog.js";
|
|
3
|
+
import { isEmpty as y } from "../../utils/isEmpty.js";
|
|
4
|
+
import "../../utils/localStorage.js";
|
|
5
|
+
import "../../utils/msg.js";
|
|
6
|
+
import "../../utils/sessionStorage.js";
|
|
7
|
+
import S from "../Warn/index.js";
|
|
8
|
+
const g = { class: "table-container" }, k = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "table-inner"
|
|
11
|
+
}, w = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "cell"
|
|
14
|
+
}, A = /* @__PURE__ */ b({
|
|
15
|
+
name: "Table",
|
|
16
|
+
__name: "index",
|
|
17
|
+
props: {
|
|
18
|
+
data: {}
|
|
19
|
+
},
|
|
20
|
+
setup(p) {
|
|
21
|
+
const h = p, s = v(() => {
|
|
22
|
+
const o = /* @__PURE__ */ new Set();
|
|
23
|
+
return h.data.forEach((l) => {
|
|
24
|
+
Object.keys(l).forEach((t) => o.add(t));
|
|
25
|
+
}), Array.from(o);
|
|
26
|
+
});
|
|
27
|
+
return (o, l) => (e(), r("div", g, [
|
|
28
|
+
s.value.length ? (e(), r("table", k, [
|
|
29
|
+
a("thead", null, [
|
|
30
|
+
a("tr", null, [
|
|
31
|
+
(e(!0), r(d, null, c(s.value, (t) => (e(), r("th", { key: t }, i(t), 1))), 128))
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
a("tbody", null, [
|
|
35
|
+
(e(!0), r(d, null, c(p.data, (t, u) => (e(), r("tr", { key: u }, [
|
|
36
|
+
(e(!0), r(d, null, c(s.value, (n) => (e(), r("td", { key: n }, [
|
|
37
|
+
m(y)(t[n]) ? f(o.$slots, "empty", {
|
|
38
|
+
key: 1,
|
|
39
|
+
row: { ...t, index: u, key: n, data: t[n] }
|
|
40
|
+
}, () => [
|
|
41
|
+
l[0] || (l[0] = a("div", { class: "cell empty" }, "Empty", -1))
|
|
42
|
+
], !0) : f(o.$slots, "default", {
|
|
43
|
+
key: 0,
|
|
44
|
+
row: { ...t, index: u, key: n, data: t[n] }
|
|
45
|
+
}, () => [
|
|
46
|
+
m(y)(t[n]) ? E("", !0) : (e(), r("div", w, i(t[n]), 1))
|
|
47
|
+
], !0)
|
|
48
|
+
]))), 128))
|
|
49
|
+
]))), 128))
|
|
50
|
+
])
|
|
51
|
+
])) : (e(), _(m(S), { key: 1 }))
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
A as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent as m, ref as p, computed as u, onUnmounted as f, openBlock as v, createElementBlock as _, toDisplayString as d } from "vue";
|
|
2
|
+
const h = { class: "timer-container" }, k = /* @__PURE__ */ m({
|
|
3
|
+
name: "Timer",
|
|
4
|
+
__name: "index",
|
|
5
|
+
setup(x, { expose: s }) {
|
|
6
|
+
const o = p(0);
|
|
7
|
+
let e;
|
|
8
|
+
const c = u(() => i(o.value));
|
|
9
|
+
f(() => {
|
|
10
|
+
clearInterval(e);
|
|
11
|
+
});
|
|
12
|
+
const i = (t) => {
|
|
13
|
+
const r = Math.floor(t / 3600), n = Math.floor(t % 3600 / 60), a = t % 60;
|
|
14
|
+
return (r ? [r, n, a] : [n, a]).map((l) => l.toString().padStart(2, "0")).join(":");
|
|
15
|
+
};
|
|
16
|
+
return s({
|
|
17
|
+
start: (t) => {
|
|
18
|
+
t !== void 0 && (o.value = t), !e && (e = setInterval(() => {
|
|
19
|
+
o.value++;
|
|
20
|
+
}, 1e3));
|
|
21
|
+
},
|
|
22
|
+
stop: () => {
|
|
23
|
+
clearInterval(e), e = void 0;
|
|
24
|
+
},
|
|
25
|
+
getTime: () => o.value
|
|
26
|
+
}), (t, r) => (v(), _("span", h, d(c.value), 1));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
k as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as o, ref as l, openBlock as r, createElementBlock as s, normalizeStyle as a, normalizeClass as i, createVNode as c, unref as m, withDirectives as f, createElementVNode as u, vShow as d } from "vue";
|
|
2
|
+
import { RenderContent as w } from "../helpers.js";
|
|
3
|
+
const B = /* @__PURE__ */ o({
|
|
4
|
+
__name: "TooltipContent",
|
|
5
|
+
props: {
|
|
6
|
+
content: {},
|
|
7
|
+
customClass: {},
|
|
8
|
+
light: { type: Boolean },
|
|
9
|
+
side: {},
|
|
10
|
+
style: {},
|
|
11
|
+
showArrow: { type: Boolean },
|
|
12
|
+
singleton: { type: Boolean }
|
|
13
|
+
},
|
|
14
|
+
setup(e, { expose: n }) {
|
|
15
|
+
const t = l(null);
|
|
16
|
+
return n({ arrowRef: t }), (h, y) => (r(), s("div", {
|
|
17
|
+
class: i(["tooltip-container", [e.customClass, { light: e.light, singleton: e.singleton }, e.side]]),
|
|
18
|
+
style: a(e.style)
|
|
19
|
+
}, [
|
|
20
|
+
c(m(w), { content: e.content }, null, 8, ["content"]),
|
|
21
|
+
f(u("div", {
|
|
22
|
+
ref_key: "arrowRef",
|
|
23
|
+
ref: t,
|
|
24
|
+
class: "arrow"
|
|
25
|
+
}, null, 512), [
|
|
26
|
+
[d, e.showArrow]
|
|
27
|
+
])
|
|
28
|
+
], 6));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
B as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as h, ref as y, computed as r, toRef as s, watch as $, openBlock as m, createBlock as a, Transition as R, withCtx as A, normalizeStyle as C, unref as u, createCommentVNode as k } from "vue";
|
|
2
|
+
import { useTooltip as B } from "./useTooltip.js";
|
|
3
|
+
import { tooltipActions as l } from "./manager.js";
|
|
4
|
+
import T from "./TooltipContent.vue.js";
|
|
5
|
+
const L = /* @__PURE__ */ h({
|
|
6
|
+
__name: "TooltipItem",
|
|
7
|
+
props: {
|
|
8
|
+
item: {},
|
|
9
|
+
singleton: { type: Boolean },
|
|
10
|
+
id: {}
|
|
11
|
+
},
|
|
12
|
+
emits: ["mouseenter", "mouseleave"],
|
|
13
|
+
setup(t, { emit: V }) {
|
|
14
|
+
const e = t, n = y(null), f = r(() => n.value?.$el), c = r(() => n.value?.arrowRef), d = () => {
|
|
15
|
+
l.hide(e.singleton, e.id || null, 0);
|
|
16
|
+
}, { style: p, side: g } = B(
|
|
17
|
+
s(e.item, "props"),
|
|
18
|
+
s(e.item, "triggerEl"),
|
|
19
|
+
f,
|
|
20
|
+
c,
|
|
21
|
+
s(e.item, "zIndex"),
|
|
22
|
+
{ onHide: d }
|
|
23
|
+
);
|
|
24
|
+
$(n, (i) => {
|
|
25
|
+
const o = i?.$el;
|
|
26
|
+
o && l.updateFloatingEl(e.singleton, e.id || null, o);
|
|
27
|
+
});
|
|
28
|
+
const w = () => {
|
|
29
|
+
!e.singleton && e.id && l.remove(e.id);
|
|
30
|
+
};
|
|
31
|
+
return (i, o) => (m(), a(R, {
|
|
32
|
+
name: t.item.props.transition,
|
|
33
|
+
onAfterLeave: w,
|
|
34
|
+
appear: ""
|
|
35
|
+
}, {
|
|
36
|
+
default: A(() => [
|
|
37
|
+
t.item.isVisible ? (m(), a(T, {
|
|
38
|
+
key: 0,
|
|
39
|
+
ref_key: "contentRef",
|
|
40
|
+
ref: n,
|
|
41
|
+
content: t.item.content,
|
|
42
|
+
side: u(g),
|
|
43
|
+
style: C(u(p)),
|
|
44
|
+
light: t.item.props.light,
|
|
45
|
+
showArrow: t.item.props.showArrow,
|
|
46
|
+
customClass: t.item.props.class,
|
|
47
|
+
singleton: t.singleton,
|
|
48
|
+
onMouseenter: o[0] || (o[0] = (v) => i.$emit("mouseenter")),
|
|
49
|
+
onMouseleave: o[1] || (o[1] = (v) => i.$emit("mouseleave"))
|
|
50
|
+
}, null, 8, ["content", "side", "style", "light", "showArrow", "customClass", "singleton"])) : k("", !0)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["name"]));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
L as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent as _, openBlock as l, createElementBlock as i, Fragment as c, renderList as h, unref as g, withDirectives as E, createBlock as M, vShow as k, createVNode as w } from "vue";
|
|
2
|
+
import { state as o, tooltipActions as s } from "./manager.js";
|
|
3
|
+
import p from "./TooltipItem.vue.js";
|
|
4
|
+
const D = /* @__PURE__ */ _({
|
|
5
|
+
__name: "TooltipLayer",
|
|
6
|
+
setup(y) {
|
|
7
|
+
const a = (e) => {
|
|
8
|
+
const t = o.items.get(e);
|
|
9
|
+
t && s.show(!1, e, {
|
|
10
|
+
triggerEl: t.triggerEl,
|
|
11
|
+
content: t.content,
|
|
12
|
+
props: t.props
|
|
13
|
+
});
|
|
14
|
+
}, u = (e) => {
|
|
15
|
+
const t = o.items.get(e);
|
|
16
|
+
t?.props.trigger === "hover" && s.hide(!1, e, t.props.closeDelay);
|
|
17
|
+
}, m = () => {
|
|
18
|
+
s.show(!0, null, {
|
|
19
|
+
triggerEl: o.singleton.triggerEl,
|
|
20
|
+
content: o.singleton.content,
|
|
21
|
+
props: o.singleton.props
|
|
22
|
+
});
|
|
23
|
+
}, f = () => {
|
|
24
|
+
const e = o.singleton.props;
|
|
25
|
+
e.trigger === "hover" && s.hide(!0, null, e.closeDelay);
|
|
26
|
+
};
|
|
27
|
+
return (e, t) => (l(), i(c, null, [
|
|
28
|
+
(l(!0), i(c, null, h(g(o).items, ([n, r]) => E((l(), M(p, {
|
|
29
|
+
key: n,
|
|
30
|
+
id: n,
|
|
31
|
+
item: r,
|
|
32
|
+
singleton: !1,
|
|
33
|
+
onMouseenter: (v) => a(n),
|
|
34
|
+
onMouseleave: (v) => u(n)
|
|
35
|
+
}, null, 8, ["id", "item", "onMouseenter", "onMouseleave"])), [
|
|
36
|
+
[k, r.isVisible && r.triggerEl && r.triggerEl.isConnected]
|
|
37
|
+
])), 128)),
|
|
38
|
+
w(p, {
|
|
39
|
+
item: g(o).singleton,
|
|
40
|
+
singleton: !0,
|
|
41
|
+
onMouseenter: m,
|
|
42
|
+
onMouseleave: f
|
|
43
|
+
}, null, 8, ["item"])
|
|
44
|
+
], 64));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
D as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent as w, useSlots as A, ref as R, computed as s, onUnmounted as B, openBlock as _, createBlock as b, unref as k, mergeProps as V, toHandlers as x, createCommentVNode as D, mergeDefaults as S } from "vue";
|
|
2
|
+
import { RenderContent as C } from "../helpers.js";
|
|
3
|
+
import { state as g, tooltipActions as c } from "./manager.js";
|
|
4
|
+
import { defaultProps as E } from "./types.js";
|
|
5
|
+
import "../../utils/dialog.js";
|
|
6
|
+
import { isElementOverflow as N } from "../../utils/isElementOverflow.js";
|
|
7
|
+
import "../../utils/localStorage.js";
|
|
8
|
+
import "../../utils/msg.js";
|
|
9
|
+
import "../../utils/sessionStorage.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
const G = /* @__PURE__ */ w({
|
|
12
|
+
name: "Tooltip",
|
|
13
|
+
__name: "index",
|
|
14
|
+
props: /* @__PURE__ */ S({
|
|
15
|
+
content: {},
|
|
16
|
+
placement: {},
|
|
17
|
+
trigger: {},
|
|
18
|
+
manual: { type: Boolean },
|
|
19
|
+
offset: {},
|
|
20
|
+
transition: {},
|
|
21
|
+
showArrow: { type: Boolean },
|
|
22
|
+
singleton: { type: Boolean },
|
|
23
|
+
openDelay: {},
|
|
24
|
+
closeDelay: {},
|
|
25
|
+
light: { type: Boolean },
|
|
26
|
+
class: {},
|
|
27
|
+
style: {},
|
|
28
|
+
virtualRef: {},
|
|
29
|
+
overflow: { type: [Boolean, Object] }
|
|
30
|
+
}, E),
|
|
31
|
+
setup(d, { expose: v }) {
|
|
32
|
+
const e = d, a = A(), n = R(null), r = /* @__PURE__ */ Symbol("tooltip"), f = s(() => e.virtualRef ? e.virtualRef : n.value?.$el || n.value), l = () => {
|
|
33
|
+
if (e.overflow !== !1) {
|
|
34
|
+
const o = f.value, t = e.overflow === !0 ? {} : e.overflow;
|
|
35
|
+
if (!N(o, t))
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
c.show(e.singleton, r, {
|
|
39
|
+
triggerEl: f.value,
|
|
40
|
+
content: a.content?.() || e.content,
|
|
41
|
+
props: e
|
|
42
|
+
});
|
|
43
|
+
}, i = () => {
|
|
44
|
+
c.hide(e.singleton, r, e.closeDelay);
|
|
45
|
+
}, y = s(() => e.manual ? {} : e.trigger === "hover" ? { mouseenter: l, mouseleave: i } : {
|
|
46
|
+
click: () => {
|
|
47
|
+
(e.singleton ? g.singleton.isVisible : g.items.get(r)?.isVisible) ? i() : l();
|
|
48
|
+
}
|
|
49
|
+
}), u = (o) => {
|
|
50
|
+
for (const t of o) {
|
|
51
|
+
if (typeof t.type != "symbol") return t;
|
|
52
|
+
if (t.type === /* @__PURE__ */ Symbol.for("v-fgt") || t.children && Array.isArray(t.children)) {
|
|
53
|
+
const h = Array.isArray(t.children) ? t.children : [], p = u(h);
|
|
54
|
+
if (p) return p;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}, m = s(() => {
|
|
59
|
+
const o = a.default?.() || [];
|
|
60
|
+
return u(o);
|
|
61
|
+
});
|
|
62
|
+
return B(() => {
|
|
63
|
+
e.singleton || c.hide(!1, r, 0);
|
|
64
|
+
}), v({ show: l, hide: i }), (o, t) => m.value && !e.virtualRef ? (_(), b(k(C), V({
|
|
65
|
+
key: 0,
|
|
66
|
+
content: m.value,
|
|
67
|
+
ref_key: "triggerRef",
|
|
68
|
+
ref: n
|
|
69
|
+
}, x(y.value)), null, 16, ["content"])) : D("", !0);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
G as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { reactive as E, createVNode as k, render as C } from "vue";
|
|
2
|
+
import x from "./TooltipLayer.vue.js";
|
|
3
|
+
import { defaultProps as v, BASIC_Z_INDEX as g } from "./types.js";
|
|
4
|
+
let d = g, f = null;
|
|
5
|
+
const r = E({
|
|
6
|
+
items: /* @__PURE__ */ new Map(),
|
|
7
|
+
singleton: I()
|
|
8
|
+
});
|
|
9
|
+
function I() {
|
|
10
|
+
return {
|
|
11
|
+
isVisible: !1,
|
|
12
|
+
triggerEl: null,
|
|
13
|
+
floatingEl: null,
|
|
14
|
+
content: "",
|
|
15
|
+
zIndex: g,
|
|
16
|
+
props: { ...v },
|
|
17
|
+
scheduler: A(),
|
|
18
|
+
parentId: null
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function A() {
|
|
22
|
+
let e = null;
|
|
23
|
+
return {
|
|
24
|
+
run(i, s) {
|
|
25
|
+
e && clearTimeout(e), e = setTimeout(i, s);
|
|
26
|
+
},
|
|
27
|
+
cancel() {
|
|
28
|
+
e && (clearTimeout(e), e = null);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const a = (e, i) => e ? r.singleton : r.items.get(i), p = (e, i) => i ? !!(e.triggerEl?.contains(i) || e.floatingEl?.contains(i)) : !1, h = () => {
|
|
33
|
+
r.singleton.isVisible || [...r.items.values()].some((i) => i.isVisible) || (d = g);
|
|
34
|
+
for (const [i, s] of r.items)
|
|
35
|
+
(!s.isVisible || !s.triggerEl || !s.triggerEl.isConnected) && (s.scheduler.cancel(), r.items.delete(i));
|
|
36
|
+
}, b = (e) => {
|
|
37
|
+
const i = e.target, s = r.singleton;
|
|
38
|
+
s.isVisible && s.props.trigger === "click" && !p(s, i) && V.hide(!0, null, 0);
|
|
39
|
+
for (const [t, n] of r.items)
|
|
40
|
+
n.isVisible && n.props.trigger === "click" && !p(n, i) && V.hide(!1, t, 0);
|
|
41
|
+
}, L = () => {
|
|
42
|
+
if (f) return;
|
|
43
|
+
const e = document.createElement("div");
|
|
44
|
+
e.id = "floating-container", f = k(x), C(f, e), document.body.appendChild(e);
|
|
45
|
+
};
|
|
46
|
+
let c = !1;
|
|
47
|
+
const m = () => {
|
|
48
|
+
const e = r.singleton.isVisible || [...r.items.values()].some((i) => i.isVisible);
|
|
49
|
+
e && !c ? (document.addEventListener("click", b, !0), c = !0) : !e && c && (document.removeEventListener("click", b, !0), c = !1);
|
|
50
|
+
}, V = {
|
|
51
|
+
updateFloatingEl(e, i, s) {
|
|
52
|
+
const t = a(e, i);
|
|
53
|
+
t && s && (t.floatingEl = s);
|
|
54
|
+
},
|
|
55
|
+
show(e, i, s) {
|
|
56
|
+
if (!s.content) return;
|
|
57
|
+
L();
|
|
58
|
+
let t = a(e, i);
|
|
59
|
+
if (!e && !t && i && (t = E(I()), r.items.set(i, t)), !t) return;
|
|
60
|
+
const n = () => {
|
|
61
|
+
if (t) {
|
|
62
|
+
if (!e) {
|
|
63
|
+
for (const [o, u] of r.items)
|
|
64
|
+
if (o !== i && u.isVisible && u.floatingEl?.contains(s.triggerEl)) {
|
|
65
|
+
t.parentId = o, u.scheduler.cancel();
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
d++, Object.assign(t, {
|
|
70
|
+
triggerEl: s.triggerEl,
|
|
71
|
+
content: s.content,
|
|
72
|
+
props: { ...v, ...s.props },
|
|
73
|
+
zIndex: d,
|
|
74
|
+
isVisible: !0
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}, l = s.props.openDelay;
|
|
78
|
+
!t.isVisible && l > 0 ? t.scheduler.run(n, l) : (t.scheduler.cancel(), n()), m();
|
|
79
|
+
},
|
|
80
|
+
hide(e, i, s) {
|
|
81
|
+
const t = a(e, i);
|
|
82
|
+
t && t.scheduler.run(() => {
|
|
83
|
+
if (!((t.triggerEl?.matches(":hover") || t.floatingEl?.matches(":hover")) && t.props.trigger === "hover") && !(!e && [...r.items.values()].some(
|
|
84
|
+
(o) => o.parentId === i && o.isVisible
|
|
85
|
+
))) {
|
|
86
|
+
if (t.isVisible = !1, e) {
|
|
87
|
+
h(), m();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (t.parentId) {
|
|
91
|
+
const l = r.items.get(t.parentId);
|
|
92
|
+
l?.isVisible && l.props.trigger === "hover" && this.hide(!1, t.parentId, s);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}, s);
|
|
96
|
+
},
|
|
97
|
+
// 非单例模式下,由内部组件动画结束后调用
|
|
98
|
+
remove(e) {
|
|
99
|
+
if (!e) return;
|
|
100
|
+
const i = r.items.get(e);
|
|
101
|
+
i && (i.scheduler.cancel(), !i.isVisible && (r.items.delete(e), h(), m()));
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
r as state,
|
|
106
|
+
V as tooltipActions
|
|
107
|
+
};
|