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
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ts-test
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
8
|
+
|
|
9
|
+
## Recommended Browser Setup
|
|
10
|
+
|
|
11
|
+
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
|
12
|
+
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
|
13
|
+
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
|
14
|
+
- Firefox:
|
|
15
|
+
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
|
16
|
+
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
|
|
17
|
+
|
|
18
|
+
## Type Support for `.vue` Imports in TS
|
|
19
|
+
|
|
20
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
|
21
|
+
|
|
22
|
+
## Customize configuration
|
|
23
|
+
|
|
24
|
+
See [Vite Configuration Reference](https://vite.dev/config/).
|
|
25
|
+
|
|
26
|
+
## Project Setup
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Compile and Hot-Reload for Development
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm run dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Type-Check, Compile and Minify for Production
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm run build
|
|
42
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as m, ref as r, watchEffect as d, withDirectives as f, openBlock as l, createElementBlock as p, normalizeClass as v, createBlock as c, unref as a, createCommentVNode as s, renderSlot as k, mergeDefaults as y } from "vue";
|
|
2
|
+
import C from "../../directives/vRipple.js";
|
|
3
|
+
import { defaultProps as b } from "./types.js";
|
|
4
|
+
import B from "../Loading/index.js";
|
|
5
|
+
import g from "../Icon/index.js";
|
|
6
|
+
import "../../utils/dialog.js";
|
|
7
|
+
import { isPromise as h } from "../../utils/isPromise.js";
|
|
8
|
+
import "../../utils/localStorage.js";
|
|
9
|
+
import "../../utils/msg.js";
|
|
10
|
+
import "../../utils/sessionStorage.js";
|
|
11
|
+
const w = ["disabled"], V = /* @__PURE__ */ m({
|
|
12
|
+
name: "Button",
|
|
13
|
+
__name: "index",
|
|
14
|
+
props: /* @__PURE__ */ y({
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
loading: { type: Boolean },
|
|
17
|
+
icon: {},
|
|
18
|
+
type: {},
|
|
19
|
+
onClick: { type: Function }
|
|
20
|
+
}, b),
|
|
21
|
+
setup(o) {
|
|
22
|
+
const t = o, e = r(!1), i = r(!1), u = async () => {
|
|
23
|
+
if (e.value || i.value || !t.onClick) return;
|
|
24
|
+
const n = t.onClick();
|
|
25
|
+
if (h(n)) {
|
|
26
|
+
e.value = !0;
|
|
27
|
+
try {
|
|
28
|
+
await n;
|
|
29
|
+
} finally {
|
|
30
|
+
e.value = !1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return d(() => {
|
|
35
|
+
i.value = t.disabled, e.value = t.loading;
|
|
36
|
+
}), (n, D) => f((l(), p("button", {
|
|
37
|
+
class: v(["button-container", o.type]),
|
|
38
|
+
disabled: i.value || e.value,
|
|
39
|
+
onClick: u
|
|
40
|
+
}, [
|
|
41
|
+
e.value ? (l(), c(a(B), {
|
|
42
|
+
key: 0,
|
|
43
|
+
size: 22
|
|
44
|
+
})) : s("", !0),
|
|
45
|
+
o.icon ? (l(), c(a(g), {
|
|
46
|
+
key: 1,
|
|
47
|
+
icon: o.icon
|
|
48
|
+
}, null, 8, ["icon"])) : s("", !0),
|
|
49
|
+
k(n.$slots, "default", {}, void 0, !0)
|
|
50
|
+
], 10, w)), [
|
|
51
|
+
[a(C)]
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
V as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as s, useModel as d, openBlock as m, createElementBlock as r, normalizeClass as i, withDirectives as u, createElementVNode as t, vModelCheckbox as c, normalizeStyle as p, renderSlot as f, mergeModels as k, mergeDefaults as x } from "vue";
|
|
2
|
+
import { defaultProps as v } from "./types.js";
|
|
3
|
+
const h = /* @__PURE__ */ s({
|
|
4
|
+
name: "Checkbox",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ k(/* @__PURE__ */ x({
|
|
7
|
+
type: {},
|
|
8
|
+
size: {}
|
|
9
|
+
}, v), {
|
|
10
|
+
modelValue: { type: Boolean, default: !1 },
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(e) {
|
|
15
|
+
const l = d(e, "modelValue");
|
|
16
|
+
return (a, o) => (m(), r("label", {
|
|
17
|
+
class: i(["checkbox-container", e.type])
|
|
18
|
+
}, [
|
|
19
|
+
u(t("input", {
|
|
20
|
+
type: "checkbox",
|
|
21
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => l.value = n)
|
|
22
|
+
}, null, 512), [
|
|
23
|
+
[c, l.value]
|
|
24
|
+
]),
|
|
25
|
+
t("div", {
|
|
26
|
+
class: "checkmark",
|
|
27
|
+
style: p({ "--size": `${e.size}px` })
|
|
28
|
+
}, null, 4),
|
|
29
|
+
f(a.$slots, "default", {}, void 0, !0)
|
|
30
|
+
], 2));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
h as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as E, ref as g, computed as x, openBlock as e, createElementBlock as m, normalizeStyle as D, createBlock as a, unref as l, createCommentVNode as c, withModifiers as R, Fragment as p, createElementVNode as B, withDirectives as y, createTextVNode as v, toDisplayString as k, normalizeClass as N } from "vue";
|
|
2
|
+
import { RenderContent as s } from "../helpers.js";
|
|
3
|
+
import S from "./DialogPrompt.vue.js";
|
|
4
|
+
import b from "../../directives/vRipple.js";
|
|
5
|
+
const T = { class: "btns" }, V = ["disabled"], F = /* @__PURE__ */ E({
|
|
6
|
+
__name: "DialogItem",
|
|
7
|
+
props: {
|
|
8
|
+
item: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["confirm", "cancel"],
|
|
11
|
+
setup(t, { emit: C }) {
|
|
12
|
+
const f = g(null), n = t, u = C, A = x(() => n.item.type !== "prompt" ? !1 : Array.isArray(n.item.content) ? n.item.content.some((o) => o.msg) || !!n.item.totalErr : !1), d = () => {
|
|
13
|
+
if (n.item.type !== "prompt") {
|
|
14
|
+
u("confirm", !0);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (f.value?.validateAll()) {
|
|
18
|
+
const i = n.item.content.map((r) => r.value);
|
|
19
|
+
u("confirm", i);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return (o, i) => (e(), m("div", {
|
|
23
|
+
class: "area",
|
|
24
|
+
style: D({ color: t.item.textColor })
|
|
25
|
+
}, [
|
|
26
|
+
t.item.title ? (e(), a(l(s), {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "title",
|
|
29
|
+
content: t.item.title
|
|
30
|
+
}, null, 8, ["content"])) : c("", !0),
|
|
31
|
+
t.item.type === "prompt" && Array.isArray(t.item.content) ? (e(), a(S, {
|
|
32
|
+
key: 1,
|
|
33
|
+
class: "content",
|
|
34
|
+
ref_key: "promptRef",
|
|
35
|
+
ref: f,
|
|
36
|
+
content: t.item.content,
|
|
37
|
+
validateAll: t.item.validateAll,
|
|
38
|
+
totalErr: t.item.totalErr,
|
|
39
|
+
"onUpdate:totalErr": i[0] || (i[0] = (r) => t.item.totalErr = r),
|
|
40
|
+
onSubmit: R(d, ["prevent"])
|
|
41
|
+
}, null, 8, ["content", "validateAll", "totalErr"])) : (e(), m(p, { key: 2 }, [
|
|
42
|
+
t.item.content ? (e(), a(l(s), {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "content",
|
|
45
|
+
content: t.item.content
|
|
46
|
+
}, null, 8, ["content"])) : c("", !0)
|
|
47
|
+
], 64)),
|
|
48
|
+
t.item.tip ? (e(), a(l(s), {
|
|
49
|
+
key: 3,
|
|
50
|
+
class: "tip",
|
|
51
|
+
content: t.item.tip
|
|
52
|
+
}, null, 8, ["content"])) : c("", !0),
|
|
53
|
+
B("div", T, [
|
|
54
|
+
t.item.type !== "alert" ? y((e(), m("button", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "btn cancel",
|
|
57
|
+
onClick: i[1] || (i[1] = (r) => o.$emit("cancel"))
|
|
58
|
+
}, [
|
|
59
|
+
v(k(t.item.cancelText), 1)
|
|
60
|
+
])), [
|
|
61
|
+
[l(b)]
|
|
62
|
+
]) : c("", !0),
|
|
63
|
+
y((e(), m("button", {
|
|
64
|
+
class: N(["btn confirm", { danger: t.item.danger }]),
|
|
65
|
+
disabled: A.value,
|
|
66
|
+
onClick: d
|
|
67
|
+
}, [
|
|
68
|
+
v(k(t.item.confirmText), 1)
|
|
69
|
+
], 10, V)), [
|
|
70
|
+
[l(b)]
|
|
71
|
+
])
|
|
72
|
+
])
|
|
73
|
+
], 4));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
F as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as E, useModel as x, openBlock as u, createElementBlock as i, Fragment as y, renderList as C, normalizeClass as k, createElementVNode as a, withDirectives as d, vModelDynamic as A, createVNode as v, unref as r, vShow as f, toDisplayString as p, createTextVNode as V, mergeModels as b } from "vue";
|
|
2
|
+
import m from "../Icon/index.js";
|
|
3
|
+
import { faClose as D, faCircleExclamation as I } from "../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
4
|
+
const M = { class: "input-inner" }, N = ["type", "onUpdate:modelValue", "name", "placeholder", "onInput"], S = { class: "label" }, w = { class: "msg" }, B = { class: "total-err" }, z = /* @__PURE__ */ E({
|
|
5
|
+
__name: "DialogPrompt",
|
|
6
|
+
props: /* @__PURE__ */ b({
|
|
7
|
+
content: {},
|
|
8
|
+
validateAll: { type: Function }
|
|
9
|
+
}, {
|
|
10
|
+
totalErr: {},
|
|
11
|
+
totalErrModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:totalErr"],
|
|
14
|
+
setup(s, { expose: h }) {
|
|
15
|
+
const o = s, n = x(s, "totalErr"), _ = (t) => {
|
|
16
|
+
t.validate && (t.msg = t.validate(t.value)), n.value = "";
|
|
17
|
+
};
|
|
18
|
+
return h({ validateAll: () => {
|
|
19
|
+
if (o.content.forEach((l) => {
|
|
20
|
+
l.validate && (l.msg = l.validate(l.value));
|
|
21
|
+
}), o.content.some((l) => l.msg)) return !1;
|
|
22
|
+
if (o.validateAll) {
|
|
23
|
+
const l = o.validateAll(...o.content);
|
|
24
|
+
return n.value = l, !l;
|
|
25
|
+
}
|
|
26
|
+
return !0;
|
|
27
|
+
} }), (t, l) => (u(), i("form", null, [
|
|
28
|
+
(u(!0), i(y, null, C(s.content, (e, g) => (u(), i("label", {
|
|
29
|
+
key: g,
|
|
30
|
+
class: k(["input-item", { error: e.msg }])
|
|
31
|
+
}, [
|
|
32
|
+
a("div", M, [
|
|
33
|
+
d(a("input", {
|
|
34
|
+
type: e.type || "text",
|
|
35
|
+
"onUpdate:modelValue": (c) => e.value = c,
|
|
36
|
+
name: e.label,
|
|
37
|
+
placeholder: e.placeholder,
|
|
38
|
+
onInput: (c) => _(e)
|
|
39
|
+
}, null, 40, N), [
|
|
40
|
+
[A, e.value]
|
|
41
|
+
]),
|
|
42
|
+
d(v(r(m), {
|
|
43
|
+
icon: r(D),
|
|
44
|
+
onClick: (c) => e.value = ""
|
|
45
|
+
}, null, 8, ["icon", "onClick"]), [
|
|
46
|
+
[f, String(e.value) !== ""]
|
|
47
|
+
])
|
|
48
|
+
]),
|
|
49
|
+
a("span", S, p(e.label), 1),
|
|
50
|
+
a("span", w, p(e.msg), 1)
|
|
51
|
+
], 2))), 128)),
|
|
52
|
+
d(a("p", B, [
|
|
53
|
+
v(r(m), { icon: r(I) }, null, 8, ["icon"]),
|
|
54
|
+
V(" " + p(n.value), 1)
|
|
55
|
+
], 512), [
|
|
56
|
+
[f, n.value]
|
|
57
|
+
])
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
z as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as x, ref as w, computed as A, openBlock as n, createBlock as d, Transition as k, withCtx as i, withDirectives as D, createVNode as f, unref as b, mergeProps as E, withModifiers as O, TransitionGroup as B, createElementBlock as I, Fragment as P, renderList as L, vShow as M } from "vue";
|
|
2
|
+
import N from "../Modal/index.js";
|
|
3
|
+
import S from "./DialogItem.vue.js";
|
|
4
|
+
import "../../utils/dialog.js";
|
|
5
|
+
import { getId as F } from "../../utils/getId.js";
|
|
6
|
+
import "../../utils/localStorage.js";
|
|
7
|
+
import "../../utils/msg.js";
|
|
8
|
+
import "../../utils/sessionStorage.js";
|
|
9
|
+
const s = 300, J = /* @__PURE__ */ x({
|
|
10
|
+
name: "Dialog",
|
|
11
|
+
__name: "index",
|
|
12
|
+
emits: ["destroy"],
|
|
13
|
+
setup(G, { expose: p, emit: v }) {
|
|
14
|
+
const c = v, a = w([]), o = A(() => a.value.at(-1));
|
|
15
|
+
let l;
|
|
16
|
+
const h = (e) => (clearTimeout(l), new Promise((r) => {
|
|
17
|
+
const t = C(e, r);
|
|
18
|
+
t.type === "prompt" && Array.isArray(t.content) && T(t), a.value.push(t);
|
|
19
|
+
})), y = (e) => {
|
|
20
|
+
o.value?.resolve && o.value.resolve(e), m();
|
|
21
|
+
}, u = () => {
|
|
22
|
+
o.value?.resolve && o.value.resolve(!1), m();
|
|
23
|
+
}, _ = () => {
|
|
24
|
+
o.value && !o.value.modal && u();
|
|
25
|
+
}, m = () => {
|
|
26
|
+
a.value.pop(), a.value.length === 0 && (l = setTimeout(() => c("destroy"), s));
|
|
27
|
+
}, g = () => {
|
|
28
|
+
a.value.forEach((e) => {
|
|
29
|
+
e.resolve && e.resolve(!1);
|
|
30
|
+
}), a.value = [], l = setTimeout(() => c("destroy"), s);
|
|
31
|
+
}, C = (e, r) => ({
|
|
32
|
+
title: "",
|
|
33
|
+
content: "",
|
|
34
|
+
textColor: "",
|
|
35
|
+
tip: "",
|
|
36
|
+
type: void 0,
|
|
37
|
+
// 默认 undefined,由业务逻辑决定
|
|
38
|
+
confirmText: e.type === "alert" ? "我知道了" : "确定",
|
|
39
|
+
cancelText: "取消",
|
|
40
|
+
modal: !1,
|
|
41
|
+
id: F(),
|
|
42
|
+
// 假设 getId 返回 string
|
|
43
|
+
...e,
|
|
44
|
+
resolve: r
|
|
45
|
+
}), T = (e) => {
|
|
46
|
+
Array.isArray(e.content) && (e.content.forEach((r) => {
|
|
47
|
+
r.value ??= "", r.validate ??= (t) => t === "" ? `请输入${r.label}` : "";
|
|
48
|
+
}), e.totalErr ??= "", e.validateAll ??= () => "");
|
|
49
|
+
};
|
|
50
|
+
return p({ open: h, destroyAll: g }), (e, r) => (n(), d(k, { name: "modal" }, {
|
|
51
|
+
default: i(() => [
|
|
52
|
+
D(f(b(N), E({
|
|
53
|
+
class: "dialog-container",
|
|
54
|
+
duration: s,
|
|
55
|
+
onClick: O(_, ["self"])
|
|
56
|
+
}, o.value?.modal ? { blur: 2 } : { bg: "rgba(0, 0, 0, 0.3)" }), {
|
|
57
|
+
default: i(() => [
|
|
58
|
+
f(B, { name: "area" }, {
|
|
59
|
+
default: i(() => [
|
|
60
|
+
(n(!0), I(P, null, L(a.value, (t) => (n(), d(S, {
|
|
61
|
+
key: t.id,
|
|
62
|
+
item: t,
|
|
63
|
+
onConfirm: y,
|
|
64
|
+
onCancel: u
|
|
65
|
+
}, null, 8, ["item"]))), 128))
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
})
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 16), [
|
|
72
|
+
[M, o.value]
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
J as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as o, openBlock as t, createElementBlock as n, createVNode as a, unref as p, normalizeProps as l, guardReactiveProps as r } from "vue";
|
|
2
|
+
import { FontAwesomeIcon as s } from "../../node_modules/@fortawesome/vue-fontawesome/index.es.js";
|
|
3
|
+
const i = { class: "icon-container" }, d = /* @__PURE__ */ o({
|
|
4
|
+
name: "Icon",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
border: { type: Boolean },
|
|
8
|
+
fixedWidth: { type: Boolean },
|
|
9
|
+
flip: { type: [String, Boolean] },
|
|
10
|
+
icon: {},
|
|
11
|
+
mask: {},
|
|
12
|
+
maskId: {},
|
|
13
|
+
listItem: { type: Boolean },
|
|
14
|
+
pull: {},
|
|
15
|
+
pulse: { type: Boolean },
|
|
16
|
+
rotation: {},
|
|
17
|
+
rotateBy: { type: Boolean },
|
|
18
|
+
swapOpacity: { type: Boolean },
|
|
19
|
+
size: {},
|
|
20
|
+
spin: { type: Boolean },
|
|
21
|
+
transform: {},
|
|
22
|
+
symbol: { type: [Boolean, String] },
|
|
23
|
+
title: {},
|
|
24
|
+
titleId: {},
|
|
25
|
+
inverse: { type: Boolean },
|
|
26
|
+
bounce: { type: Boolean },
|
|
27
|
+
shake: { type: Boolean },
|
|
28
|
+
beat: { type: Boolean },
|
|
29
|
+
fade: { type: Boolean },
|
|
30
|
+
beatFade: { type: Boolean },
|
|
31
|
+
spinPulse: { type: Boolean },
|
|
32
|
+
spinReverse: { type: Boolean },
|
|
33
|
+
widthAuto: { type: Boolean }
|
|
34
|
+
},
|
|
35
|
+
setup(y) {
|
|
36
|
+
return (e, B) => (t(), n("i", i, [
|
|
37
|
+
a(p(s), l(r(e.$props)), null, 16)
|
|
38
|
+
]));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
d as default
|
|
43
|
+
};
|
|
@@ -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
|
+
};
|