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
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,54 @@
|
|
|
1
|
+
import { defineComponent as m, ref as l, watchEffect as d, openBlock as i, createElementBlock as f, normalizeClass as p, createBlock as r, unref as c, createCommentVNode as s, renderSlot as k, mergeDefaults as v } from "vue";
|
|
2
|
+
import { defaultProps as y } from "./types.js";
|
|
3
|
+
import C from "../Loading/index.js";
|
|
4
|
+
import b from "../Icon/index.js";
|
|
5
|
+
import "../../utils/dialog.js";
|
|
6
|
+
import { isPromise as B } from "../../utils/isPromise.js";
|
|
7
|
+
import "../../utils/localStorage.js";
|
|
8
|
+
import "../../utils/msg.js";
|
|
9
|
+
import "../../utils/sessionStorage.js";
|
|
10
|
+
const g = ["disabled"], N = /* @__PURE__ */ m({
|
|
11
|
+
name: "Button",
|
|
12
|
+
__name: "index",
|
|
13
|
+
props: /* @__PURE__ */ v({
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
loading: { type: Boolean },
|
|
16
|
+
icon: {},
|
|
17
|
+
type: {},
|
|
18
|
+
onClick: { type: Function }
|
|
19
|
+
}, y),
|
|
20
|
+
setup(o) {
|
|
21
|
+
const t = o, e = l(!1), a = l(!1), u = async () => {
|
|
22
|
+
if (e.value || a.value || !t.onClick) return;
|
|
23
|
+
const n = t.onClick();
|
|
24
|
+
if (B(n)) {
|
|
25
|
+
e.value = !0;
|
|
26
|
+
try {
|
|
27
|
+
await n;
|
|
28
|
+
} finally {
|
|
29
|
+
e.value = !1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return d(() => {
|
|
34
|
+
a.value = t.disabled, e.value = t.loading;
|
|
35
|
+
}), (n, h) => (i(), f("button", {
|
|
36
|
+
class: p(["button-container", o.type]),
|
|
37
|
+
disabled: a.value || e.value,
|
|
38
|
+
onClick: u
|
|
39
|
+
}, [
|
|
40
|
+
e.value ? (i(), r(c(C), {
|
|
41
|
+
key: 0,
|
|
42
|
+
size: 22
|
|
43
|
+
})) : s("", !0),
|
|
44
|
+
o.icon ? (i(), r(c(b), {
|
|
45
|
+
key: 1,
|
|
46
|
+
icon: o.icon
|
|
47
|
+
}, null, 8, ["icon"])) : s("", !0),
|
|
48
|
+
k(n.$slots, "default", {}, void 0, !0)
|
|
49
|
+
], 10, g));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
N as default
|
|
54
|
+
};
|
|
@@ -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,42 @@
|
|
|
1
|
+
import { defineComponent as u, useModel as d, computed as i, provide as f, openBlock as p, createElementBlock as m, normalizeClass as v, renderSlot as g, mergeModels as y, mergeDefaults as A } from "vue";
|
|
2
|
+
import { collapseContextKey as C, defaultProps as x } from "./types.js";
|
|
3
|
+
const _ = /* @__PURE__ */ u({
|
|
4
|
+
name: "Collapse",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ y(/* @__PURE__ */ A({
|
|
7
|
+
accordion: { type: Boolean }
|
|
8
|
+
}, x), {
|
|
9
|
+
modelValue: {},
|
|
10
|
+
modelModifiers: {}
|
|
11
|
+
}),
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(l) {
|
|
14
|
+
const c = l, a = d(l, "modelValue"), o = i(() => c.accordion), r = i(() => {
|
|
15
|
+
const e = a.value;
|
|
16
|
+
return o.value ? Array.isArray(e) ? e.slice(0, 1) : typeof e == "string" && e ? [e] : [] : Array.isArray(e) ? e : typeof e == "string" && e ? [e] : [];
|
|
17
|
+
}), t = (e) => r.value.includes(e), s = (e) => {
|
|
18
|
+
a.value = o.value ? e[0] || "" : e;
|
|
19
|
+
};
|
|
20
|
+
return f(C, {
|
|
21
|
+
accordion: o,
|
|
22
|
+
activeNames: r,
|
|
23
|
+
isActive: t,
|
|
24
|
+
toggle: (e) => {
|
|
25
|
+
if (o.value) {
|
|
26
|
+
s(t(e) ? [] : [e]);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
s(
|
|
30
|
+
t(e) ? r.value.filter((n) => n !== e) : [...r.value, e]
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}), (e, n) => (p(), m("div", {
|
|
34
|
+
class: v(["collapse-container", { accordion: o.value }])
|
|
35
|
+
}, [
|
|
36
|
+
g(e.$slots, "default", {}, void 0, !0)
|
|
37
|
+
], 2));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
_ as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as f, inject as p, computed as u, openBlock as r, createElementBlock as g, normalizeClass as C, createElementVNode as o, renderSlot as d, createBlock as w, unref as l, createCommentVNode as k, toDisplayString as x, createVNode as m, Transition as E, toHandlers as _, withCtx as H, withDirectives as S, vShow as $ } from "vue";
|
|
2
|
+
import h from "../Icon/index.js";
|
|
3
|
+
import { faChevronDown as b } from "../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
4
|
+
import { collapseContextKey as A } from "../Collapse/types.js";
|
|
5
|
+
const B = { class: "title" }, D = { class: "content" }, N = { class: "body" }, z = /* @__PURE__ */ f({
|
|
6
|
+
name: "CollapseItem",
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
name: {},
|
|
10
|
+
title: {},
|
|
11
|
+
icon: {}
|
|
12
|
+
},
|
|
13
|
+
setup(n) {
|
|
14
|
+
const i = n, c = p(A, null), s = u(() => c?.isActive(i.name) || !1), v = () => {
|
|
15
|
+
c?.toggle(i.name);
|
|
16
|
+
}, a = (e) => {
|
|
17
|
+
e.style.height = "", e.style.opacity = "", e.style.overflow = "";
|
|
18
|
+
}, y = {
|
|
19
|
+
beforeEnter(e) {
|
|
20
|
+
const t = e;
|
|
21
|
+
t.style.height = "0", t.style.opacity = "0", t.style.overflow = "hidden";
|
|
22
|
+
},
|
|
23
|
+
enter(e) {
|
|
24
|
+
const t = e;
|
|
25
|
+
t.style.height = `${t.scrollHeight}px`, t.style.opacity = "1";
|
|
26
|
+
},
|
|
27
|
+
afterEnter(e) {
|
|
28
|
+
a(e);
|
|
29
|
+
},
|
|
30
|
+
beforeLeave(e) {
|
|
31
|
+
const t = e;
|
|
32
|
+
t.style.height = `${t.scrollHeight}px`, t.style.opacity = "1", t.style.overflow = "hidden";
|
|
33
|
+
},
|
|
34
|
+
leave(e) {
|
|
35
|
+
const t = e;
|
|
36
|
+
t.offsetHeight, t.style.height = "0", t.style.opacity = "0";
|
|
37
|
+
},
|
|
38
|
+
afterLeave(e) {
|
|
39
|
+
a(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return (e, t) => (r(), g("div", {
|
|
43
|
+
class: C(["collapse-item-container", { active: s.value }])
|
|
44
|
+
}, [
|
|
45
|
+
o("div", {
|
|
46
|
+
class: "header",
|
|
47
|
+
onClick: v
|
|
48
|
+
}, [
|
|
49
|
+
o("span", B, [
|
|
50
|
+
d(e.$slots, "icon", {}, () => [
|
|
51
|
+
n.icon ? (r(), w(l(h), {
|
|
52
|
+
key: 0,
|
|
53
|
+
icon: n.icon
|
|
54
|
+
}, null, 8, ["icon"])) : k("", !0)
|
|
55
|
+
], !0),
|
|
56
|
+
o("span", null, x(n.title), 1)
|
|
57
|
+
]),
|
|
58
|
+
m(l(h), {
|
|
59
|
+
class: "arrow-icon",
|
|
60
|
+
icon: l(b)
|
|
61
|
+
}, null, 8, ["icon"])
|
|
62
|
+
]),
|
|
63
|
+
m(E, _(y), {
|
|
64
|
+
default: H(() => [
|
|
65
|
+
S(o("div", D, [
|
|
66
|
+
o("div", N, [
|
|
67
|
+
d(e.$slots, "default", { isActive: s.value }, void 0, !0)
|
|
68
|
+
])
|
|
69
|
+
], 512), [
|
|
70
|
+
[$, s.value]
|
|
71
|
+
])
|
|
72
|
+
]),
|
|
73
|
+
_: 3
|
|
74
|
+
}, 16)
|
|
75
|
+
], 2));
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
z as default
|
|
80
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as C, ref as A, computed as E, openBlock as e, createElementBlock as a, normalizeStyle as g, createBlock as r, unref as c, createCommentVNode as m, withModifiers as x, Fragment as D, createElementVNode as y, toDisplayString as k, normalizeClass as B } from "vue";
|
|
2
|
+
import { RenderContent as s } from "../helpers.js";
|
|
3
|
+
import R from "./DialogPrompt.vue.js";
|
|
4
|
+
const S = { class: "btns" }, z = ["disabled"], $ = /* @__PURE__ */ C({
|
|
5
|
+
__name: "DialogItem",
|
|
6
|
+
props: {
|
|
7
|
+
item: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["confirm", "cancel"],
|
|
10
|
+
setup(t, { emit: v }) {
|
|
11
|
+
const u = A(null), n = t, f = v, b = E(() => n.item.type !== "prompt" ? !1 : Array.isArray(n.item.content) ? n.item.content.some((l) => l.msg) || !!n.item.totalErr : !1), d = () => {
|
|
12
|
+
if (n.item.type !== "prompt") {
|
|
13
|
+
f("confirm", !0);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (u.value?.validateAll()) {
|
|
17
|
+
const i = n.item.content.map((o) => o.value);
|
|
18
|
+
f("confirm", i);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (l, i) => (e(), a("div", {
|
|
22
|
+
class: "area",
|
|
23
|
+
style: g({ color: t.item.textColor })
|
|
24
|
+
}, [
|
|
25
|
+
t.item.title ? (e(), r(c(s), {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "title",
|
|
28
|
+
content: t.item.title
|
|
29
|
+
}, null, 8, ["content"])) : m("", !0),
|
|
30
|
+
t.item.type === "prompt" && Array.isArray(t.item.content) ? (e(), r(R, {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "content",
|
|
33
|
+
ref_key: "promptRef",
|
|
34
|
+
ref: u,
|
|
35
|
+
content: t.item.content,
|
|
36
|
+
validateAll: t.item.validateAll,
|
|
37
|
+
totalErr: t.item.totalErr,
|
|
38
|
+
"onUpdate:totalErr": i[0] || (i[0] = (o) => t.item.totalErr = o),
|
|
39
|
+
onSubmit: x(d, ["prevent"])
|
|
40
|
+
}, null, 8, ["content", "validateAll", "totalErr"])) : (e(), a(D, { key: 2 }, [
|
|
41
|
+
t.item.content ? (e(), r(c(s), {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "content",
|
|
44
|
+
content: t.item.content
|
|
45
|
+
}, null, 8, ["content"])) : m("", !0)
|
|
46
|
+
], 64)),
|
|
47
|
+
t.item.tip ? (e(), r(c(s), {
|
|
48
|
+
key: 3,
|
|
49
|
+
class: "tip",
|
|
50
|
+
content: t.item.tip
|
|
51
|
+
}, null, 8, ["content"])) : m("", !0),
|
|
52
|
+
y("div", S, [
|
|
53
|
+
t.item.type !== "alert" ? (e(), a("button", {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "btn cancel",
|
|
56
|
+
onClick: i[1] || (i[1] = (o) => l.$emit("cancel"))
|
|
57
|
+
}, k(t.item.cancelText), 1)) : m("", !0),
|
|
58
|
+
y("button", {
|
|
59
|
+
class: B(["btn confirm", { danger: t.item.danger }]),
|
|
60
|
+
disabled: b.value,
|
|
61
|
+
onClick: d
|
|
62
|
+
}, k(t.item.confirmText), 11, z)
|
|
63
|
+
])
|
|
64
|
+
], 4));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
$ as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as E, useModel as x, openBlock as i, createElementBlock as u, Fragment as y, renderList as C, normalizeClass as k, createElementVNode as a, toDisplayString as d, withDirectives as v, vModelDynamic as A, createVNode as p, unref as r, vShow as f, 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/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
4
|
+
const M = { class: "label" }, N = { class: "input-inner" }, S = ["type", "onUpdate:modelValue", "name", "placeholder", "onInput"], 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) => (i(), u("form", null, [
|
|
28
|
+
(i(!0), u(y, null, C(s.content, (e, g) => (i(), u("label", {
|
|
29
|
+
key: g,
|
|
30
|
+
class: k(["input-item", { error: e.msg }])
|
|
31
|
+
}, [
|
|
32
|
+
a("div", M, d(e.label), 1),
|
|
33
|
+
a("div", N, [
|
|
34
|
+
v(a("input", {
|
|
35
|
+
type: e.type || "text",
|
|
36
|
+
"onUpdate:modelValue": (c) => e.value = c,
|
|
37
|
+
name: e.label,
|
|
38
|
+
placeholder: e.placeholder,
|
|
39
|
+
onInput: (c) => _(e)
|
|
40
|
+
}, null, 40, S), [
|
|
41
|
+
[A, e.value]
|
|
42
|
+
]),
|
|
43
|
+
v(p(r(m), {
|
|
44
|
+
icon: r(D),
|
|
45
|
+
onClick: (c) => e.value = ""
|
|
46
|
+
}, null, 8, ["icon", "onClick"]), [
|
|
47
|
+
[f, String(e.value) !== ""]
|
|
48
|
+
])
|
|
49
|
+
]),
|
|
50
|
+
a("div", w, d(e.msg), 1)
|
|
51
|
+
], 2))), 128)),
|
|
52
|
+
v(a("div", B, [
|
|
53
|
+
p(r(m), { icon: r(I) }, null, 8, ["icon"]),
|
|
54
|
+
V(" " + d(n.value), 1)
|
|
55
|
+
], 512), [
|
|
56
|
+
[f, n.value]
|
|
57
|
+
])
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
z as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as T, ref as A, computed as b, openBlock as l, createBlock as f, Transition as k, withCtx as i, withDirectives as D, createVNode as p, unref as E, mergeProps as I, withModifiers as O, TransitionGroup as B, createElementBlock as P, Fragment as L, renderList as M, vShow as N } from "vue";
|
|
2
|
+
import S from "../Modal/index.js";
|
|
3
|
+
import F from "./DialogItem.vue.js";
|
|
4
|
+
import "../../utils/dialog.js";
|
|
5
|
+
import { getId as G } from "../../utils/getId.js";
|
|
6
|
+
import "../../utils/localStorage.js";
|
|
7
|
+
import "../../utils/msg.js";
|
|
8
|
+
import "../../utils/sessionStorage.js";
|
|
9
|
+
const s = 300, K = /* @__PURE__ */ T({
|
|
10
|
+
name: "Dialog",
|
|
11
|
+
__name: "index",
|
|
12
|
+
emits: ["destroy"],
|
|
13
|
+
setup(R, { expose: v, emit: y }) {
|
|
14
|
+
const c = y, r = A([]), n = b(() => r.value.at(-1));
|
|
15
|
+
let a;
|
|
16
|
+
const h = (e) => (clearTimeout(a), new Promise((t) => {
|
|
17
|
+
const o = w(e, t);
|
|
18
|
+
o.type === "prompt" && Array.isArray(o.content) && x(o), r.value.push(o);
|
|
19
|
+
})), u = async (e, t) => {
|
|
20
|
+
if (!e.beforeClose) return !0;
|
|
21
|
+
try {
|
|
22
|
+
return await e.beforeClose(t);
|
|
23
|
+
} catch {
|
|
24
|
+
return !1;
|
|
25
|
+
}
|
|
26
|
+
}, m = (e) => {
|
|
27
|
+
const t = r.value.findIndex((o) => o.id === e.id);
|
|
28
|
+
t !== -1 && (r.value.splice(t, 1), r.value.length === 0 && (a = setTimeout(() => c("destroy"), s)));
|
|
29
|
+
}, C = async (e) => {
|
|
30
|
+
const t = n.value;
|
|
31
|
+
!t || !await u(t, e) || (t.resolve?.(e), m(t));
|
|
32
|
+
}, d = async () => {
|
|
33
|
+
const e = n.value;
|
|
34
|
+
!e || !await u(e, !1) || (e.resolve?.(!1), m(e));
|
|
35
|
+
}, _ = () => {
|
|
36
|
+
n.value && !n.value.modal && d();
|
|
37
|
+
}, g = () => {
|
|
38
|
+
r.value.forEach((e) => {
|
|
39
|
+
e.resolve && e.resolve(!1);
|
|
40
|
+
}), r.value = [], a = setTimeout(() => c("destroy"), s);
|
|
41
|
+
}, w = (e, t) => ({
|
|
42
|
+
title: "",
|
|
43
|
+
content: "",
|
|
44
|
+
textColor: "",
|
|
45
|
+
tip: "",
|
|
46
|
+
type: void 0,
|
|
47
|
+
// 默认 undefined,由业务逻辑决定
|
|
48
|
+
confirmText: e.type === "alert" ? "我知道了" : "确定",
|
|
49
|
+
cancelText: "取消",
|
|
50
|
+
modal: !1,
|
|
51
|
+
id: G(),
|
|
52
|
+
// 假设 getId 返回 string
|
|
53
|
+
...e,
|
|
54
|
+
resolve: t
|
|
55
|
+
}), x = (e) => {
|
|
56
|
+
Array.isArray(e.content) && (e.content.forEach((t) => {
|
|
57
|
+
t.value ??= "", t.validate ??= (o) => o === "" ? `请输入${t.label}` : "";
|
|
58
|
+
}), e.totalErr ??= "", e.validateAll ??= () => "");
|
|
59
|
+
};
|
|
60
|
+
return v({ open: h, destroyAll: g }), (e, t) => (l(), f(k, { name: "modal" }, {
|
|
61
|
+
default: i(() => [
|
|
62
|
+
D(p(E(S), I({
|
|
63
|
+
class: "dialog-container",
|
|
64
|
+
duration: s,
|
|
65
|
+
onClick: O(_, ["self"])
|
|
66
|
+
}, n.value?.modal ? { blur: 2 } : { bg: "rgba(0, 0, 0, 0.3)" }), {
|
|
67
|
+
default: i(() => [
|
|
68
|
+
p(B, { name: "area" }, {
|
|
69
|
+
default: i(() => [
|
|
70
|
+
(l(!0), P(L, null, M(r.value, (o) => (l(), f(F, {
|
|
71
|
+
key: o.id,
|
|
72
|
+
item: o,
|
|
73
|
+
onConfirm: C,
|
|
74
|
+
onCancel: d
|
|
75
|
+
}, null, 8, ["item"]))), 128))
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
})
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 16), [
|
|
82
|
+
[N, n.value]
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
K as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
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 i } from "../../node_modules/.pnpm/@fortawesome_vue-fontawesom_b85c0ed4b0a431cb59a463de76a3e522/node_modules/@fortawesome/vue-fontawesome/index.es.js";
|
|
3
|
+
const s = { 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
|
+
flash: { type: Boolean },
|
|
32
|
+
spinPulse: { type: Boolean },
|
|
33
|
+
spinReverse: { type: Boolean },
|
|
34
|
+
widthAuto: { type: Boolean },
|
|
35
|
+
gradientFill: {}
|
|
36
|
+
},
|
|
37
|
+
setup(y) {
|
|
38
|
+
return (e, B) => (t(), n("i", s, [
|
|
39
|
+
a(p(i), l(r(e.$props)), null, 16)
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
d as default
|
|
45
|
+
};
|