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,91 @@
|
|
|
1
|
+
import { defineComponent as M, ref as k, nextTick as h, openBlock as m, createElementBlock as u, Fragment as L, renderList as b, normalizeClass as w, createVNode as B, unref as I } from "vue";
|
|
2
|
+
import { useGSAP as P } from "../../hooks/useGSAP.js";
|
|
3
|
+
import "../../utils/dialog.js";
|
|
4
|
+
import { getId as R } from "../../utils/getId.js";
|
|
5
|
+
import "../../utils/localStorage.js";
|
|
6
|
+
import "../../utils/msg.js";
|
|
7
|
+
import "../../utils/sessionStorage.js";
|
|
8
|
+
import { RenderContent as Y } from "../helpers.js";
|
|
9
|
+
const F = { class: "message-container" }, N = 3e3, z = 3, O = /* @__PURE__ */ M({
|
|
10
|
+
name: "Message",
|
|
11
|
+
__name: "index",
|
|
12
|
+
emits: ["destroy"],
|
|
13
|
+
setup(A, { expose: _, emit: x }) {
|
|
14
|
+
const T = x, { g: c, safe: l } = P(), r = k([]), a = /* @__PURE__ */ new Map();
|
|
15
|
+
let d;
|
|
16
|
+
const C = (o, t) => {
|
|
17
|
+
o && o instanceof HTMLElement ? a.set(t, o) : a.delete(t);
|
|
18
|
+
}, f = () => {
|
|
19
|
+
const o = /* @__PURE__ */ new Map(), t = [];
|
|
20
|
+
return a.forEach((e, n) => {
|
|
21
|
+
if (e && e.isConnected) {
|
|
22
|
+
const s = e.style.transform;
|
|
23
|
+
e.style.transform = "none", t.push({ el: e, id: n, transform: s });
|
|
24
|
+
}
|
|
25
|
+
}), t.forEach((e) => {
|
|
26
|
+
o.set(e.id, e.el.getBoundingClientRect());
|
|
27
|
+
}), t.forEach((e) => {
|
|
28
|
+
e.el.style.transform = e.transform;
|
|
29
|
+
}), o;
|
|
30
|
+
}, p = l((o) => {
|
|
31
|
+
f().forEach((e, n) => {
|
|
32
|
+
const s = o.get(n);
|
|
33
|
+
if (!s) return;
|
|
34
|
+
const i = s.left - e.left, v = s.top - e.top, y = a.get(n);
|
|
35
|
+
(i || v) && y && c.fromTo(
|
|
36
|
+
y,
|
|
37
|
+
{ x: i, y: v },
|
|
38
|
+
{
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0,
|
|
41
|
+
duration: 0.3,
|
|
42
|
+
ease: "expo.out",
|
|
43
|
+
overwrite: "auto"
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
}), g = l((o) => {
|
|
48
|
+
const t = o ? r.value.find((n) => n.id === o) : r.value.find((n) => !n.leaving);
|
|
49
|
+
if (!t || t.leaving) return;
|
|
50
|
+
t.leaving = !0;
|
|
51
|
+
const e = a.get(t.id);
|
|
52
|
+
e && (clearTimeout(t.timer), c.to(e, {
|
|
53
|
+
opacity: 0,
|
|
54
|
+
scaleY: 0.5,
|
|
55
|
+
duration: 0.5,
|
|
56
|
+
onComplete: () => {
|
|
57
|
+
const n = f();
|
|
58
|
+
r.value = r.value.filter((s) => s.id !== t.id), h().then(() => {
|
|
59
|
+
p(n), r.value.length || (d = setTimeout(() => T("destroy"), 500));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
}), E = l((o, t) => {
|
|
64
|
+
const e = a.get(o);
|
|
65
|
+
e && c.fromTo(
|
|
66
|
+
e,
|
|
67
|
+
{ opacity: 0, scaleY: 0.5 },
|
|
68
|
+
{ opacity: 1, scaleY: 1, duration: 0.5, ease: "back.out(1.7)" }
|
|
69
|
+
), p(t);
|
|
70
|
+
});
|
|
71
|
+
return _({ add: async (o, t = "info") => {
|
|
72
|
+
clearTimeout(d), r.value.filter((i) => !i.leaving).length >= z && g();
|
|
73
|
+
const e = f(), n = R(), s = setTimeout(() => g(n), N);
|
|
74
|
+
r.value.push({ id: n, content: o, type: t, timer: s, leaving: !1 }), await h(), E(n, e);
|
|
75
|
+
} }), (o, t) => (m(), u("div", F, [
|
|
76
|
+
(m(!0), u(L, null, b(r.value, (e) => (m(), u("div", {
|
|
77
|
+
key: e.id,
|
|
78
|
+
ref_for: !0,
|
|
79
|
+
ref: (n) => C(n, e.id),
|
|
80
|
+
class: w(["item", e.type])
|
|
81
|
+
}, [
|
|
82
|
+
B(I(Y), {
|
|
83
|
+
content: e.content
|
|
84
|
+
}, null, 8, ["content"])
|
|
85
|
+
], 2))), 128))
|
|
86
|
+
]));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
O as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as a, openBlock as n, createBlock as l, Transition as o, withCtx as r, withDirectives as i, createElementVNode as d, normalizeStyle as u, renderSlot as m, vShow as s, mergeDefaults as c } from "vue";
|
|
2
|
+
import { defaultProps as b } from "./types.js";
|
|
3
|
+
const g = /* @__PURE__ */ a({
|
|
4
|
+
name: "Modal",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ c({
|
|
7
|
+
visible: { type: Boolean },
|
|
8
|
+
bg: {},
|
|
9
|
+
blur: {},
|
|
10
|
+
zIndex: {},
|
|
11
|
+
duration: {}
|
|
12
|
+
}, b),
|
|
13
|
+
setup(e) {
|
|
14
|
+
return (t, f) => (n(), l(o, {
|
|
15
|
+
name: "modal",
|
|
16
|
+
appear: ""
|
|
17
|
+
}, {
|
|
18
|
+
default: r(() => [
|
|
19
|
+
i(d("div", {
|
|
20
|
+
class: "modal-container",
|
|
21
|
+
style: u({
|
|
22
|
+
"--bg": e.bg,
|
|
23
|
+
"--blur": e.blur ? `${e.blur}px` : "",
|
|
24
|
+
"--z-index": e.zIndex,
|
|
25
|
+
"--duration": `${e.duration}ms`
|
|
26
|
+
})
|
|
27
|
+
}, [
|
|
28
|
+
m(t.$slots, "default", {}, void 0, !0)
|
|
29
|
+
], 4), [
|
|
30
|
+
[s, e.visible]
|
|
31
|
+
])
|
|
32
|
+
]),
|
|
33
|
+
_: 3
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
g as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { defineComponent as b, inject as u, provide as m, reactive as B, resolveComponent as H, openBlock as o, createElementBlock as i, normalizeStyle as L, unref as c, Fragment as S, renderList as V, withDirectives as _, normalizeClass as k, createBlock as p, createCommentVNode as f, createElementVNode as z, toDisplayString as j, Transition as x, mergeProps as A, toHandlers as F, withCtx as I, createVNode as O, vShow as P } from "vue";
|
|
2
|
+
import R from "../../directives/vRipple.js";
|
|
3
|
+
import C from "../Icon/index.js";
|
|
4
|
+
import { faChevronDown as T } from "../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
5
|
+
const $ = ["onClick", "disabled"], q = { class: "text" }, Q = /* @__PURE__ */ b({
|
|
6
|
+
name: "Nav",
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
data: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["change"],
|
|
12
|
+
setup(v, { emit: w }) {
|
|
13
|
+
const h = v, g = w, y = u("layer", 0), E = u("allData", h.data);
|
|
14
|
+
m("layer", y + 1), y === 0 && m("allData", h.data);
|
|
15
|
+
const r = B(h.data.map(() => !0)), D = (e, s) => {
|
|
16
|
+
g("change", e, (d = !0, t = !0) => {
|
|
17
|
+
if (d) {
|
|
18
|
+
const a = (n) => {
|
|
19
|
+
n.forEach((l) => {
|
|
20
|
+
l.active = l === e, l.children?.length && a(l.children);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
a(E);
|
|
24
|
+
}
|
|
25
|
+
t && e.children?.length && (r.forEach((a, n) => {
|
|
26
|
+
n !== s && (r[n] = !1);
|
|
27
|
+
}), r[s] = !r[s]);
|
|
28
|
+
});
|
|
29
|
+
}, N = {
|
|
30
|
+
beforeEnter(e) {
|
|
31
|
+
e.style.height = "0", e.style.opacity = "0", e.style.overflow = "hidden";
|
|
32
|
+
},
|
|
33
|
+
enter(e) {
|
|
34
|
+
e.style.height = e.scrollHeight + "px", e.style.opacity = "1";
|
|
35
|
+
},
|
|
36
|
+
afterEnter(e) {
|
|
37
|
+
e.style.height = "", e.style.overflow = "", e.style.opacity = "";
|
|
38
|
+
},
|
|
39
|
+
beforeLeave(e) {
|
|
40
|
+
e.style.height = e.scrollHeight + "px", e.style.opacity = "0", e.style.overflow = "hidden";
|
|
41
|
+
},
|
|
42
|
+
leave(e) {
|
|
43
|
+
e.style.height = "0", e.style.opacity = "0";
|
|
44
|
+
},
|
|
45
|
+
afterLeave(e) {
|
|
46
|
+
e.style.height = "", e.style.overflow = "", e.style.opacity = "";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return (e, s) => {
|
|
50
|
+
const d = H("Nav");
|
|
51
|
+
return o(), i("ul", {
|
|
52
|
+
class: "nav-container",
|
|
53
|
+
style: L({ "--layer": c(y) })
|
|
54
|
+
}, [
|
|
55
|
+
(o(!0), i(S, null, V(v.data, (t, a) => (o(), i("li", {
|
|
56
|
+
class: "nav-item",
|
|
57
|
+
key: a
|
|
58
|
+
}, [
|
|
59
|
+
_((o(), i("div", {
|
|
60
|
+
class: k(["link", { active: t.active }]),
|
|
61
|
+
onClick: (n) => D(t, a),
|
|
62
|
+
disabled: t.disabled
|
|
63
|
+
}, [
|
|
64
|
+
t.icon ? (o(), p(c(C), {
|
|
65
|
+
key: 0,
|
|
66
|
+
icon: t.icon
|
|
67
|
+
}, null, 8, ["icon"])) : f("", !0),
|
|
68
|
+
z("span", q, j(t.name), 1),
|
|
69
|
+
t.children?.length ? (o(), p(c(C), {
|
|
70
|
+
key: 1,
|
|
71
|
+
icon: c(T),
|
|
72
|
+
class: k(["arrow-icon", r[a] ? "" : "right"])
|
|
73
|
+
}, null, 8, ["icon", "class"])) : f("", !0)
|
|
74
|
+
], 10, $)), [
|
|
75
|
+
[c(R)]
|
|
76
|
+
]),
|
|
77
|
+
t.children?.length ? (o(), p(x, A({ key: 0 }, F(N)), {
|
|
78
|
+
default: I(() => [
|
|
79
|
+
_(O(d, {
|
|
80
|
+
data: t.children,
|
|
81
|
+
onChange: (n, l) => g("change", n, l)
|
|
82
|
+
}, null, 8, ["data", "onChange"]), [
|
|
83
|
+
[P, r[a]]
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1040)) : f("", !0)
|
|
88
|
+
]))), 128))
|
|
89
|
+
], 4);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
export {
|
|
94
|
+
Q as default
|
|
95
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { defineComponent as I, useModel as P, ref as K, computed as V, watch as S, openBlock as i, createElementBlock as r, withDirectives as d, createVNode as q, unref as p, Fragment as N, renderList as B, normalizeClass as L, createTextVNode as $, toDisplayString as g, createCommentVNode as z, createElementVNode as b, vModelSelect as T, withKeys as U, vModelText as j, mergeModels as F, mergeDefaults as J } from "vue";
|
|
2
|
+
import { useRouter as G, useRoute as H } from "vue-router";
|
|
3
|
+
import M from "../../directives/vRipple.js";
|
|
4
|
+
import w from "../Icon/index.js";
|
|
5
|
+
import { faAngleLeft as O, faAngleRight as Q } from "../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
6
|
+
import "../../utils/dialog.js";
|
|
7
|
+
import "../../utils/localStorage.js";
|
|
8
|
+
import { msg as W } from "../../utils/msg.js";
|
|
9
|
+
import "../../utils/sessionStorage.js";
|
|
10
|
+
import { defaultProps as X } from "./types.js";
|
|
11
|
+
const Y = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "pagination-container"
|
|
14
|
+
}, Z = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "controls"
|
|
17
|
+
}, _ = ["disabled"], ee = ["onClick"], te = ["disabled"], ae = { class: "meta" }, le = ["value"], oe = ["max"], fe = /* @__PURE__ */ I({
|
|
18
|
+
name: "Pagination",
|
|
19
|
+
__name: "index",
|
|
20
|
+
props: /* @__PURE__ */ F(/* @__PURE__ */ J({
|
|
21
|
+
total: {},
|
|
22
|
+
pageSizes: {},
|
|
23
|
+
maxButtonCount: {}
|
|
24
|
+
}, X), {
|
|
25
|
+
modelValue: { default: 1 },
|
|
26
|
+
modelModifiers: {},
|
|
27
|
+
pageSize: { default: 10 },
|
|
28
|
+
pageSizeModifiers: {}
|
|
29
|
+
}),
|
|
30
|
+
emits: ["update:modelValue", "update:pageSize"],
|
|
31
|
+
setup(s) {
|
|
32
|
+
const c = s, l = P(s, "modelValue"), o = P(s, "pageSize"), R = G(), x = H(), v = K(""), u = V(() => !c.total || !o.value || o.value <= 0 ? 0 : Math.max(0, Math.ceil(c.total / o.value)));
|
|
33
|
+
S(o, () => {
|
|
34
|
+
l.value > u.value && m(u.value);
|
|
35
|
+
});
|
|
36
|
+
function m(t) {
|
|
37
|
+
const e = Math.min(Math.max(1, Math.floor(t || 1)), Math.max(1, u.value || 1));
|
|
38
|
+
e !== l.value && (l.value = e);
|
|
39
|
+
}
|
|
40
|
+
function C() {
|
|
41
|
+
let t = Number(v.value);
|
|
42
|
+
if (!t || isNaN(t) || t < 1 || t > u.value) {
|
|
43
|
+
v.value = "", W.warning("请输入有效页码");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
m(t), v.value = "";
|
|
47
|
+
}
|
|
48
|
+
function D(t) {
|
|
49
|
+
if (t)
|
|
50
|
+
if (t.ellipsis) {
|
|
51
|
+
const e = Math.max(3, Math.min(u.value, Math.max(5, c.maxButtonCount) - 2));
|
|
52
|
+
t.key === "left" ? m(l.value - e) : m(l.value + e);
|
|
53
|
+
} else t.page && m(t.page);
|
|
54
|
+
}
|
|
55
|
+
const A = V(() => {
|
|
56
|
+
const t = [], e = u.value, a = Math.max(5, c.maxButtonCount), f = l.value;
|
|
57
|
+
if (e <= a) {
|
|
58
|
+
for (let n = 1; n <= e; n++) t.push({ key: `p${n}`, page: n, label: n });
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
const h = Math.floor((a - 1) / 2);
|
|
62
|
+
let y = Math.max(2, f - h), k = Math.min(e - 1, f + h);
|
|
63
|
+
f - 1 <= h && (y = 2, k = a - 1), e - f <= h && (y = e - (a - 2), k = e - 1), t.push({ key: "p1", page: 1, label: 1 }), y > 2 && t.push({ key: "left", ellipsis: !0, label: "..." });
|
|
64
|
+
for (let n = y; n <= k; n++)
|
|
65
|
+
t.push({ key: `p${n}`, page: n, label: n });
|
|
66
|
+
return k < e - 1 && t.push({ key: "right", ellipsis: !0, label: "..." }), t.push({ key: `p${e}`, page: e, label: e }), t;
|
|
67
|
+
}), E = S(
|
|
68
|
+
() => c.total,
|
|
69
|
+
(t) => {
|
|
70
|
+
if (!t) return;
|
|
71
|
+
const e = Number(x.query.page), a = Number(x.query.pageSize);
|
|
72
|
+
a && !isNaN(a) && c.pageSizes.includes(a) && (o.value = a), e && !isNaN(e) && e <= u.value && (m(e), E());
|
|
73
|
+
},
|
|
74
|
+
{ immediate: !0 }
|
|
75
|
+
);
|
|
76
|
+
return S([l, o], () => {
|
|
77
|
+
R.replace({
|
|
78
|
+
query: {
|
|
79
|
+
...x.query,
|
|
80
|
+
page: String(l.value),
|
|
81
|
+
pageSize: String(o.value)
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}), (t, e) => s.total ? (i(), r("div", Y, [
|
|
85
|
+
s.total > o.value ? (i(), r("ul", Z, [
|
|
86
|
+
d((i(), r("button", {
|
|
87
|
+
disabled: l.value === 1,
|
|
88
|
+
onClick: e[0] || (e[0] = (a) => m(l.value - 1)),
|
|
89
|
+
class: "item"
|
|
90
|
+
}, [
|
|
91
|
+
q(p(w), { icon: p(O) }, null, 8, ["icon"])
|
|
92
|
+
], 8, _)), [
|
|
93
|
+
[p(M)]
|
|
94
|
+
]),
|
|
95
|
+
(i(!0), r(N, null, B(A.value, (a) => d((i(), r("li", {
|
|
96
|
+
key: a.key,
|
|
97
|
+
class: L([{ active: a.page === l.value }, "item"]),
|
|
98
|
+
onClick: (f) => D(a)
|
|
99
|
+
}, [
|
|
100
|
+
$(g(a.label), 1)
|
|
101
|
+
], 10, ee)), [
|
|
102
|
+
[p(M)]
|
|
103
|
+
])), 128)),
|
|
104
|
+
d((i(), r("button", {
|
|
105
|
+
disabled: l.value === u.value || !u.value,
|
|
106
|
+
onClick: e[1] || (e[1] = (a) => m(l.value + 1)),
|
|
107
|
+
class: "item"
|
|
108
|
+
}, [
|
|
109
|
+
q(p(w), { icon: p(Q) }, null, 8, ["icon"])
|
|
110
|
+
], 8, te)), [
|
|
111
|
+
[p(M)]
|
|
112
|
+
])
|
|
113
|
+
])) : z("", !0),
|
|
114
|
+
b("div", ae, [
|
|
115
|
+
b("p", null, "共" + g(s.total) + "条,第" + g(l.value) + " / " + g(u.value || 1) + "页", 1),
|
|
116
|
+
d(b("select", {
|
|
117
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => o.value = a)
|
|
118
|
+
}, [
|
|
119
|
+
(i(!0), r(N, null, B(s.pageSizes, (a) => (i(), r("option", {
|
|
120
|
+
key: a,
|
|
121
|
+
value: a
|
|
122
|
+
}, g(a) + " / 页", 9, le))), 128))
|
|
123
|
+
], 512), [
|
|
124
|
+
[
|
|
125
|
+
T,
|
|
126
|
+
o.value,
|
|
127
|
+
void 0,
|
|
128
|
+
{ number: !0 }
|
|
129
|
+
]
|
|
130
|
+
]),
|
|
131
|
+
s.total > o.value ? (i(), r(N, { key: 0 }, [
|
|
132
|
+
d(b("input", {
|
|
133
|
+
type: "number",
|
|
134
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => v.value = a),
|
|
135
|
+
min: "1",
|
|
136
|
+
max: u.value || 1,
|
|
137
|
+
onKeyup: U(C, ["enter"]),
|
|
138
|
+
placeholder: "页码"
|
|
139
|
+
}, null, 40, oe), [
|
|
140
|
+
[
|
|
141
|
+
j,
|
|
142
|
+
v.value,
|
|
143
|
+
void 0,
|
|
144
|
+
{ number: !0 }
|
|
145
|
+
]
|
|
146
|
+
]),
|
|
147
|
+
d((i(), r("button", {
|
|
148
|
+
onClick: C,
|
|
149
|
+
class: "item"
|
|
150
|
+
}, [...e[4] || (e[4] = [
|
|
151
|
+
$("跳转", -1)
|
|
152
|
+
])])), [
|
|
153
|
+
[p(M)]
|
|
154
|
+
])
|
|
155
|
+
], 64)) : z("", !0)
|
|
156
|
+
])
|
|
157
|
+
])) : z("", !0);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
fe as default
|
|
162
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent as T, ref as k, openBlock as r, createBlock as p, unref as o, mergeProps as C, createSlots as g, withCtx as n, renderSlot as a, createElementVNode as c, createCommentVNode as u, createTextVNode as l, toDisplayString as s, createElementBlock as P, normalizeProps as x, guardReactiveProps as B, createVNode as h, mergeDefaults as $ } from "vue";
|
|
2
|
+
import { defaultProps as N } from "./types.js";
|
|
3
|
+
import V from "../Icon/index.js";
|
|
4
|
+
import w from "../Popover/index.js";
|
|
5
|
+
import y from "../Button/index.js";
|
|
6
|
+
const I = { class: "popconfirm-content" }, R = { class: "top" }, S = { class: "text" }, b = ["innerHTML"], D = { class: "bottom" }, j = /* @__PURE__ */ T({
|
|
7
|
+
name: "Popconfirm",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: /* @__PURE__ */ $({
|
|
11
|
+
content: {},
|
|
12
|
+
tip: {},
|
|
13
|
+
icon: {},
|
|
14
|
+
showIcon: { type: Boolean },
|
|
15
|
+
confirmType: {},
|
|
16
|
+
cancelType: {},
|
|
17
|
+
confirmText: {},
|
|
18
|
+
cancelText: {}
|
|
19
|
+
}, N),
|
|
20
|
+
emits: ["confirm", "cancel"],
|
|
21
|
+
setup(e, { emit: v }) {
|
|
22
|
+
const m = v, i = k(null), f = () => {
|
|
23
|
+
m("confirm"), i.value?.hide();
|
|
24
|
+
}, d = () => {
|
|
25
|
+
m("cancel"), i.value?.hide();
|
|
26
|
+
};
|
|
27
|
+
return (t, E) => (r(), p(o(w), C({
|
|
28
|
+
trigger: "click",
|
|
29
|
+
transition: "fade",
|
|
30
|
+
placement: "bottom"
|
|
31
|
+
}, t.$attrs, {
|
|
32
|
+
class: "popconfirm-container",
|
|
33
|
+
ref_key: "popoverRef",
|
|
34
|
+
ref: i
|
|
35
|
+
}), g({
|
|
36
|
+
default: n(() => [
|
|
37
|
+
a(t.$slots, "default")
|
|
38
|
+
]),
|
|
39
|
+
_: 2
|
|
40
|
+
}, [
|
|
41
|
+
t.$slots.content || e.content ? {
|
|
42
|
+
name: "content",
|
|
43
|
+
fn: n(() => [
|
|
44
|
+
c("div", I, [
|
|
45
|
+
c("div", R, [
|
|
46
|
+
e.showIcon ? (r(), p(o(V), {
|
|
47
|
+
key: 0,
|
|
48
|
+
icon: e.icon
|
|
49
|
+
}, null, 8, ["icon"])) : u("", !0),
|
|
50
|
+
c("div", S, [
|
|
51
|
+
a(t.$slots, "content", {}, () => [
|
|
52
|
+
l(s(e.content), 1)
|
|
53
|
+
]),
|
|
54
|
+
e.tip ? (r(), P("p", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "tip",
|
|
57
|
+
innerHTML: e.tip
|
|
58
|
+
}, null, 8, b)) : u("", !0)
|
|
59
|
+
])
|
|
60
|
+
]),
|
|
61
|
+
c("div", D, [
|
|
62
|
+
a(t.$slots, "actions", x(B({ cancel: d, confirm: f })), () => [
|
|
63
|
+
h(o(y), {
|
|
64
|
+
type: e.cancelType,
|
|
65
|
+
onClick: d
|
|
66
|
+
}, {
|
|
67
|
+
default: n(() => [
|
|
68
|
+
l(s(e.cancelText), 1)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["type"]),
|
|
72
|
+
h(o(y), {
|
|
73
|
+
type: e.confirmType,
|
|
74
|
+
onClick: f
|
|
75
|
+
}, {
|
|
76
|
+
default: n(() => [
|
|
77
|
+
l(s(e.confirmText), 1)
|
|
78
|
+
]),
|
|
79
|
+
_: 1
|
|
80
|
+
}, 8, ["type"])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
key: "0"
|
|
86
|
+
} : void 0
|
|
87
|
+
]), 1040));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
j as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { faQuestionCircle as e } from "../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
2
|
+
const t = {
|
|
3
|
+
content: "",
|
|
4
|
+
tip: "",
|
|
5
|
+
icon: e,
|
|
6
|
+
showIcon: !0,
|
|
7
|
+
confirmType: "primary",
|
|
8
|
+
cancelType: "default",
|
|
9
|
+
confirmText: "确定",
|
|
10
|
+
cancelText: "取消"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
t as defaultProps
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as a, useSlots as l, ref as p, openBlock as f, createBlock as c, unref as t, mergeProps as u, createSlots as d, renderList as m, withCtx as _, renderSlot as h, normalizeProps as v, guardReactiveProps as P } from "vue";
|
|
2
|
+
import k from "../Tooltip/index.js";
|
|
3
|
+
const B = /* @__PURE__ */ a({
|
|
4
|
+
name: "Popover",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
setup(w, { expose: n }) {
|
|
8
|
+
const s = l(), e = p(null);
|
|
9
|
+
return n({
|
|
10
|
+
show: () => {
|
|
11
|
+
e.value?.show();
|
|
12
|
+
},
|
|
13
|
+
hide: () => {
|
|
14
|
+
e.value?.hide();
|
|
15
|
+
}
|
|
16
|
+
}), (o, x) => (f(), c(t(k), u({ transition: "slide" }, o.$attrs, {
|
|
17
|
+
class: "popover-container",
|
|
18
|
+
ref_key: "tooltipRef",
|
|
19
|
+
ref: e
|
|
20
|
+
}), d({ _: 2 }, [
|
|
21
|
+
m(t(s), (R, r) => ({
|
|
22
|
+
name: r,
|
|
23
|
+
fn: _((i) => [
|
|
24
|
+
h(o.$slots, r, v(P(i || {})))
|
|
25
|
+
])
|
|
26
|
+
}))
|
|
27
|
+
]), 1040));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
B as default
|
|
32
|
+
};
|