tttb 0.1.29
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 +54 -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/Collapse/index.js +6 -0
- package/dist/components/Collapse/index.vue.js +7 -0
- package/dist/components/Collapse/index.vue2.js +42 -0
- package/dist/components/Collapse/types.js +7 -0
- package/dist/components/CollapseItem/index.js +6 -0
- package/dist/components/CollapseItem/index.vue.js +7 -0
- package/dist/components/CollapseItem/index.vue2.js +80 -0
- package/dist/components/Dialog/DialogItem.vue.js +7 -0
- package/dist/components/Dialog/DialogItem.vue2.js +69 -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 +91 -0
- package/dist/components/Icon/index.js +6 -0
- package/dist/components/Icon/index.vue.js +45 -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 +149 -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 +105 -0
- package/dist/components/Tooltip/types.js +38 -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 +44 -0
- package/dist/directives/vBackTop.js +111 -0
- package/dist/directives/vDelayIn.js +41 -0
- package/dist/directives/vHoldPointer.js +112 -0
- package/dist/directives/vLazy.js +61 -0
- package/dist/directives/vLoading.js +49 -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 +592 -0
- package/dist/icons/regular.js +278 -0
- package/dist/icons/solid.js +2005 -0
- package/dist/index.js +135 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +401 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.11_vue@3.5.34_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
- package/dist/node_modules/.pnpm/@fortawesome_fontawesome-svg-core@7.2.0/node_modules/@fortawesome/fontawesome-svg-core/index.js +3102 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-brands-svg-icons@7.2.0/node_modules/@fortawesome/free-brands-svg-icons/index.js +3380 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-regular-svg-icons@7.2.0/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.js +9694 -0
- package/dist/node_modules/.pnpm/@fortawesome_vue-fontawesom_b85c0ed4b0a431cb59a463de76a3e522/node_modules/@fortawesome/vue-fontawesome/index.es.js +528 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/CSSPlugin.js +424 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/gsap-core.js +1652 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/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/Collapse/index.d.ts +28 -0
- package/dist/types/components/Collapse/types.d.ts +16 -0
- package/dist/types/components/CollapseItem/index.d.ts +27 -0
- package/dist/types/components/CollapseItem/types.d.ts +6 -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 +58 -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 +13 -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 +15 -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 +262 -0
- package/dist/types/components/Popconfirm/types.d.ts +27 -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 +35 -0
- package/dist/types/components/Table/types.d.ts +4 -0
- package/dist/types/components/Timer/index.d.ts +6 -0
- package/dist/types/components/Tooltip/TooltipContent.d.ts +17 -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 +18 -0
- package/dist/types/components/Tooltip/types.d.ts +54 -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 +21 -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 +7 -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 +34 -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 +589 -0
- package/dist/types/icons/regular.d.ts +275 -0
- package/dist/types/icons/solid.d.ts +2002 -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 +16 -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 +12 -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 +20 -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 +9 -0
- package/dist/types/views/TestButton.d.ts +2 -0
- package/dist/types/views/TestCheckbox.d.ts +2 -0
- package/dist/types/views/TestCollapse.d.ts +2 -0
- package/dist/types/views/TestDialog.d.ts +2 -0
- package/dist/types/views/TestHome.d.ts +2 -0
- package/dist/types/views/TestIcon.d.ts +2 -0
- package/dist/types/views/TestMessage.d.ts +2 -0
- package/dist/types/views/TestModal.d.ts +2 -0
- package/dist/types/views/TestNav.d.ts +2 -0
- package/dist/types/views/TestPager.d.ts +2 -0
- package/dist/types/views/TestPopconfirm.d.ts +4 -0
- package/dist/types/views/TestProgress.d.ts +2 -0
- package/dist/types/views/TestSwitch.d.ts +2 -0
- package/dist/types/views/TestTable.d.ts +2 -0
- package/dist/types/views/TestTimer.d.ts +19 -0
- package/dist/types/views/TestTooltip.d.ts +2 -0
- package/dist/types/views/TestVLoading.d.ts +2 -0
- package/dist/types/views/TestWarn.d.ts +2 -0
- package/dist/types/views/TestWatermark.d.ts +2 -0
- package/dist/utils/chance.js +7 -0
- package/dist/utils/copyToClipboard.js +19 -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 +47 -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 +7 -0
- package/dist/utils/localStorage.js +50 -0
- package/dist/utils/msg.js +24 -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 +50 -0
- package/package.json +102 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as l, openBlock as n, createElementBlock as o, normalizeStyle as i, createElementVNode as r, createCommentVNode as s, mergeDefaults as a } from "vue";
|
|
2
|
+
import { defaultProps as c } from "./types.js";
|
|
3
|
+
const m = ["innerHTML"], f = /* @__PURE__ */ l({
|
|
4
|
+
name: "Loading",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ a({
|
|
7
|
+
size: {},
|
|
8
|
+
text: {}
|
|
9
|
+
}, c),
|
|
10
|
+
setup(e) {
|
|
11
|
+
return (d, t) => (n(), o("div", {
|
|
12
|
+
class: "loading-container",
|
|
13
|
+
style: i({ "--size": e.size + "px" })
|
|
14
|
+
}, [
|
|
15
|
+
t[0] || (t[0] = r("svg", {
|
|
16
|
+
viewBox: "0 0 50 50",
|
|
17
|
+
class: "loading-svg"
|
|
18
|
+
}, [
|
|
19
|
+
r("circle", {
|
|
20
|
+
class: "path",
|
|
21
|
+
cx: "25",
|
|
22
|
+
cy: "25",
|
|
23
|
+
r: "20",
|
|
24
|
+
fill: "none",
|
|
25
|
+
stroke: "currentColor"
|
|
26
|
+
})
|
|
27
|
+
], -1)),
|
|
28
|
+
e.text ? (n(), o("p", {
|
|
29
|
+
key: 0,
|
|
30
|
+
innerHTML: e.text
|
|
31
|
+
}, null, 8, m)) : s("", !0)
|
|
32
|
+
], 4));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
f as default
|
|
37
|
+
};
|
|
@@ -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/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/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,149 @@
|
|
|
1
|
+
import { defineComponent as A, useModel as C, ref as E, computed as N, watch as M, openBlock as s, createElementBlock as m, createElementVNode as c, createVNode as P, unref as k, Fragment as x, renderList as V, normalizeClass as I, toDisplayString as f, createCommentVNode as S, withDirectives as q, vModelSelect as K, withKeys as L, vModelText as U, mergeModels as j, mergeDefaults as F } from "vue";
|
|
2
|
+
import { useRouter as J, useRoute as T } from "vue-router";
|
|
3
|
+
import B from "../Icon/index.js";
|
|
4
|
+
import { faAngleLeft as G, faAngleRight as H } from "../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
5
|
+
import "../../utils/dialog.js";
|
|
6
|
+
import "../../utils/localStorage.js";
|
|
7
|
+
import { msg as O } from "../../utils/msg.js";
|
|
8
|
+
import "../../utils/sessionStorage.js";
|
|
9
|
+
import { defaultProps as Q } from "./types.js";
|
|
10
|
+
const W = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "pagination-container"
|
|
13
|
+
}, X = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "controls"
|
|
16
|
+
}, Y = ["disabled"], Z = ["onClick"], _ = ["disabled"], ee = { class: "meta" }, te = ["value"], ae = ["max"], pe = /* @__PURE__ */ A({
|
|
17
|
+
name: "Pagination",
|
|
18
|
+
__name: "index",
|
|
19
|
+
props: /* @__PURE__ */ j(/* @__PURE__ */ F({
|
|
20
|
+
total: {},
|
|
21
|
+
pageSizes: {},
|
|
22
|
+
maxButtonCount: {}
|
|
23
|
+
}, Q), {
|
|
24
|
+
modelValue: { default: 1 },
|
|
25
|
+
modelModifiers: {},
|
|
26
|
+
pageSize: { default: 10 },
|
|
27
|
+
pageSizeModifiers: {}
|
|
28
|
+
}),
|
|
29
|
+
emits: ["update:modelValue", "update:pageSize"],
|
|
30
|
+
setup(i) {
|
|
31
|
+
const p = i, l = C(i, "modelValue"), u = C(i, "pageSize"), $ = J(), b = T(), d = E(""), o = N(() => !p.total || !u.value || u.value <= 0 ? 0 : Math.max(0, Math.ceil(p.total / u.value)));
|
|
32
|
+
M(u, () => {
|
|
33
|
+
l.value > o.value && r(o.value);
|
|
34
|
+
});
|
|
35
|
+
function r(t) {
|
|
36
|
+
const e = Math.min(Math.max(1, Math.floor(t || 1)), Math.max(1, o.value || 1));
|
|
37
|
+
e !== l.value && (l.value = e);
|
|
38
|
+
}
|
|
39
|
+
function z() {
|
|
40
|
+
let t = Number(d.value);
|
|
41
|
+
if (!t || isNaN(t) || t < 1 || t > o.value) {
|
|
42
|
+
d.value = "", O.warning("请输入有效页码");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
r(t), d.value = "";
|
|
46
|
+
}
|
|
47
|
+
function w(t) {
|
|
48
|
+
if (t)
|
|
49
|
+
if (t.ellipsis) {
|
|
50
|
+
const e = Math.max(3, Math.min(o.value, Math.max(5, p.maxButtonCount) - 2));
|
|
51
|
+
t.key === "left" ? r(l.value - e) : r(l.value + e);
|
|
52
|
+
} else t.page && r(t.page);
|
|
53
|
+
}
|
|
54
|
+
const D = N(() => {
|
|
55
|
+
const t = [], e = o.value, a = Math.max(5, p.maxButtonCount), v = l.value;
|
|
56
|
+
if (e <= a) {
|
|
57
|
+
for (let n = 1; n <= e; n++) t.push({ key: `p${n}`, page: n, label: n });
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
const g = Math.floor((a - 1) / 2);
|
|
61
|
+
let h = Math.max(2, v - g), y = Math.min(e - 1, v + g);
|
|
62
|
+
v - 1 <= g && (h = 2, y = a - 1), e - v <= g && (h = e - (a - 2), y = e - 1), t.push({ key: "p1", page: 1, label: 1 }), h > 2 && t.push({ key: "left", ellipsis: !0, label: "..." });
|
|
63
|
+
for (let n = h; n <= y; n++)
|
|
64
|
+
t.push({ key: `p${n}`, page: n, label: n });
|
|
65
|
+
return y < e - 1 && t.push({ key: "right", ellipsis: !0, label: "..." }), t.push({ key: `p${e}`, page: e, label: e }), t;
|
|
66
|
+
}), R = M(
|
|
67
|
+
() => p.total,
|
|
68
|
+
(t) => {
|
|
69
|
+
if (!t) return;
|
|
70
|
+
const e = Number(b.query.page), a = Number(b.query.pageSize);
|
|
71
|
+
a && !isNaN(a) && p.pageSizes.includes(a) && (u.value = a), e && !isNaN(e) && e <= o.value && (r(e), R());
|
|
72
|
+
},
|
|
73
|
+
{ immediate: !0 }
|
|
74
|
+
);
|
|
75
|
+
return M([l, u], () => {
|
|
76
|
+
$.replace({
|
|
77
|
+
query: {
|
|
78
|
+
...b.query,
|
|
79
|
+
page: String(l.value),
|
|
80
|
+
pageSize: String(u.value)
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}), (t, e) => i.total ? (s(), m("div", W, [
|
|
84
|
+
i.total > u.value ? (s(), m("ul", X, [
|
|
85
|
+
c("button", {
|
|
86
|
+
disabled: l.value === 1,
|
|
87
|
+
onClick: e[0] || (e[0] = (a) => r(l.value - 1)),
|
|
88
|
+
class: "item"
|
|
89
|
+
}, [
|
|
90
|
+
P(k(B), { icon: k(G) }, null, 8, ["icon"])
|
|
91
|
+
], 8, Y),
|
|
92
|
+
(s(!0), m(x, null, V(D.value, (a) => (s(), m("li", {
|
|
93
|
+
key: a.key,
|
|
94
|
+
class: I([{ active: a.page === l.value }, "item"]),
|
|
95
|
+
onClick: (v) => w(a)
|
|
96
|
+
}, f(a.label), 11, Z))), 128)),
|
|
97
|
+
c("button", {
|
|
98
|
+
disabled: l.value === o.value || !o.value,
|
|
99
|
+
onClick: e[1] || (e[1] = (a) => r(l.value + 1)),
|
|
100
|
+
class: "item"
|
|
101
|
+
}, [
|
|
102
|
+
P(k(B), { icon: k(H) }, null, 8, ["icon"])
|
|
103
|
+
], 8, _)
|
|
104
|
+
])) : S("", !0),
|
|
105
|
+
c("div", ee, [
|
|
106
|
+
c("p", null, "共" + f(i.total) + "条,第" + f(l.value) + " / " + f(o.value || 1) + "页", 1),
|
|
107
|
+
q(c("select", {
|
|
108
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a)
|
|
109
|
+
}, [
|
|
110
|
+
(s(!0), m(x, null, V(i.pageSizes, (a) => (s(), m("option", {
|
|
111
|
+
key: a,
|
|
112
|
+
value: a
|
|
113
|
+
}, f(a) + " / 页 ", 9, te))), 128))
|
|
114
|
+
], 512), [
|
|
115
|
+
[
|
|
116
|
+
K,
|
|
117
|
+
u.value,
|
|
118
|
+
void 0,
|
|
119
|
+
{ number: !0 }
|
|
120
|
+
]
|
|
121
|
+
]),
|
|
122
|
+
i.total > u.value ? (s(), m(x, { key: 0 }, [
|
|
123
|
+
q(c("input", {
|
|
124
|
+
type: "number",
|
|
125
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => d.value = a),
|
|
126
|
+
min: "1",
|
|
127
|
+
max: o.value || 1,
|
|
128
|
+
onKeyup: L(z, ["enter"]),
|
|
129
|
+
placeholder: "页码"
|
|
130
|
+
}, null, 40, ae), [
|
|
131
|
+
[
|
|
132
|
+
U,
|
|
133
|
+
d.value,
|
|
134
|
+
void 0,
|
|
135
|
+
{ number: !0 }
|
|
136
|
+
]
|
|
137
|
+
]),
|
|
138
|
+
c("button", {
|
|
139
|
+
onClick: z,
|
|
140
|
+
class: "item"
|
|
141
|
+
}, " 跳转 ")
|
|
142
|
+
], 64)) : S("", !0)
|
|
143
|
+
])
|
|
144
|
+
])) : S("", !0);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
export {
|
|
148
|
+
pe as default
|
|
149
|
+
};
|
|
@@ -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/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/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
|
+
};
|