vft 0.0.13 → 0.0.15
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/es/component.mjs +8 -6
- package/es/component.mjs.map +1 -1
- package/es/components/back-top/back-top.vue2.mjs +8 -6
- package/es/components/back-top/back-top.vue2.mjs.map +1 -1
- package/es/components/context-menu/context-menu.vue.d.ts +39 -0
- package/es/components/context-menu/context-menu.vue.mjs +5 -0
- package/es/components/context-menu/context-menu.vue.mjs.map +1 -0
- package/es/components/context-menu/context-menu.vue2.mjs +93 -0
- package/es/components/context-menu/context-menu.vue2.mjs.map +1 -0
- package/es/components/context-menu/createContextMenu.d.ts +3 -0
- package/es/components/context-menu/createContextMenu.mjs +41 -0
- package/es/components/context-menu/createContextMenu.mjs.map +1 -0
- package/es/components/context-menu/index.d.ts +3 -0
- package/es/components/context-menu/index.mjs +8 -0
- package/es/components/context-menu/index.mjs.map +1 -0
- package/es/components/context-menu/style/css.d.ts +0 -0
- package/es/components/context-menu/style/css.mjs +3 -0
- package/es/components/context-menu/style/css.mjs.map +1 -0
- package/es/components/context-menu/style/index.d.ts +0 -0
- package/es/components/context-menu/style/index.mjs +3 -0
- package/es/components/context-menu/style/index.mjs.map +1 -0
- package/es/components/context-menu/types.d.ts +23 -0
- package/es/components/context-menu/types.mjs +2 -0
- package/es/components/context-menu/types.mjs.map +1 -0
- package/es/components/context-menu/useContextMenu.d.ts +3 -0
- package/es/components/context-menu/useContextMenu.mjs +11 -0
- package/es/components/context-menu/useContextMenu.mjs.map +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +44 -32
- package/es/components/index.mjs.map +1 -1
- package/es/components/menu/menu-item.vue2.mjs +12 -10
- package/es/components/menu/menu-item.vue2.mjs.map +1 -1
- package/es/components/menu/sub-menu.vue2.mjs +5 -3
- package/es/components/menu/sub-menu.vue2.mjs.map +1 -1
- package/es/components/multiple-tabs/index.d.ts +30 -0
- package/es/components/multiple-tabs/index.mjs +16 -0
- package/es/components/multiple-tabs/index.mjs.map +1 -0
- package/es/components/multiple-tabs/multiple-tabs.vue.d.ts +29 -0
- package/es/components/multiple-tabs/multiple-tabs.vue.mjs +5 -0
- package/es/components/multiple-tabs/multiple-tabs.vue.mjs.map +1 -0
- package/es/components/multiple-tabs/multiple-tabs.vue2.mjs +152 -0
- package/es/components/multiple-tabs/multiple-tabs.vue2.mjs.map +1 -0
- package/es/components/multiple-tabs/style/css.d.ts +0 -0
- package/es/components/multiple-tabs/style/css.mjs +3 -0
- package/es/components/multiple-tabs/style/css.mjs.map +1 -0
- package/es/components/multiple-tabs/style/index.d.ts +0 -0
- package/es/components/multiple-tabs/style/index.mjs +3 -0
- package/es/components/multiple-tabs/style/index.mjs.map +1 -0
- package/es/components/multiple-tabs/tab-content.vue.d.ts +32 -0
- package/es/components/multiple-tabs/tab-content.vue.mjs +5 -0
- package/es/components/multiple-tabs/tab-content.vue.mjs.map +1 -0
- package/es/components/multiple-tabs/tab-content.vue2.mjs +49 -0
- package/es/components/multiple-tabs/tab-content.vue2.mjs.map +1 -0
- package/es/components/multiple-tabs/types.d.ts +3 -0
- package/es/components/multiple-tabs/types.mjs +2 -0
- package/es/components/multiple-tabs/types.mjs.map +1 -0
- package/es/components/multiple-tabs/use/index.d.ts +2 -0
- package/es/components/multiple-tabs/use/index.mjs +8 -0
- package/es/components/multiple-tabs/use/index.mjs.map +1 -0
- package/es/components/multiple-tabs/use/use-multiple-tabs.d.ts +9 -0
- package/es/components/multiple-tabs/use/use-multiple-tabs.mjs +54 -0
- package/es/components/multiple-tabs/use/use-multiple-tabs.mjs.map +1 -0
- package/es/components/multiple-tabs/use/use-tab-dropdown.d.ts +6 -0
- package/es/components/multiple-tabs/use/use-tab-dropdown.mjs +71 -0
- package/es/components/multiple-tabs/use/use-tab-dropdown.mjs.map +1 -0
- package/es/components/result/result.vue2.mjs +15 -13
- package/es/components/result/result.vue2.mjs.map +1 -1
- package/es/components/tabs/tab-nav.vue2.mjs +5 -3
- package/es/components/tabs/tab-nav.vue2.mjs.map +1 -1
- package/es/index.mjs +90 -78
- package/es/index.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/es/style.css +1 -1
- package/es/theme-style/src/multiple-tabs.scss.mjs +5 -0
- package/es/theme-style/src/multiple-tabs.scss.mjs.map +1 -0
- package/lib/component.js +1 -1
- package/lib/component.js.map +1 -1
- package/lib/components/back-top/back-top.vue2.js +1 -1
- package/lib/components/back-top/back-top.vue2.js.map +1 -1
- package/lib/components/context-menu/context-menu.vue.d.ts +39 -0
- package/lib/components/context-menu/context-menu.vue.js +2 -0
- package/lib/components/context-menu/context-menu.vue.js.map +1 -0
- package/lib/components/context-menu/context-menu.vue2.js +2 -0
- package/lib/components/context-menu/context-menu.vue2.js.map +1 -0
- package/lib/components/context-menu/createContextMenu.d.ts +3 -0
- package/lib/components/context-menu/createContextMenu.js +2 -0
- package/lib/components/context-menu/createContextMenu.js.map +1 -0
- package/lib/components/context-menu/index.d.ts +3 -0
- package/lib/components/context-menu/index.js +2 -0
- package/lib/components/context-menu/index.js.map +1 -0
- package/lib/components/context-menu/style/css.d.ts +0 -0
- package/lib/components/context-menu/style/css.js +2 -0
- package/lib/components/context-menu/style/css.js.map +1 -0
- package/lib/components/context-menu/style/index.d.ts +0 -0
- package/lib/components/context-menu/style/index.js +2 -0
- package/lib/components/context-menu/style/index.js.map +1 -0
- package/lib/components/context-menu/types.d.ts +23 -0
- package/lib/components/context-menu/types.js +2 -0
- package/lib/components/context-menu/types.js.map +1 -0
- package/lib/components/context-menu/useContextMenu.d.ts +3 -0
- package/lib/components/context-menu/useContextMenu.js +2 -0
- package/lib/components/context-menu/useContextMenu.js.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +1 -1
- package/lib/components/menu/menu-item.vue2.js +1 -1
- package/lib/components/menu/menu-item.vue2.js.map +1 -1
- package/lib/components/menu/sub-menu.vue2.js +1 -1
- package/lib/components/menu/sub-menu.vue2.js.map +1 -1
- package/lib/components/multiple-tabs/index.d.ts +30 -0
- package/lib/components/multiple-tabs/index.js +2 -0
- package/lib/components/multiple-tabs/index.js.map +1 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue.d.ts +29 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue.js +2 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue.js.map +1 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue2.js +2 -0
- package/lib/components/multiple-tabs/multiple-tabs.vue2.js.map +1 -0
- package/lib/components/multiple-tabs/style/css.d.ts +0 -0
- package/lib/components/multiple-tabs/style/css.js +2 -0
- package/lib/components/multiple-tabs/style/css.js.map +1 -0
- package/lib/components/multiple-tabs/style/index.d.ts +0 -0
- package/lib/components/multiple-tabs/style/index.js +2 -0
- package/lib/components/multiple-tabs/style/index.js.map +1 -0
- package/lib/components/multiple-tabs/tab-content.vue.d.ts +32 -0
- package/lib/components/multiple-tabs/tab-content.vue.js +2 -0
- package/lib/components/multiple-tabs/tab-content.vue.js.map +1 -0
- package/lib/components/multiple-tabs/tab-content.vue2.js +2 -0
- package/lib/components/multiple-tabs/tab-content.vue2.js.map +1 -0
- package/lib/components/multiple-tabs/types.d.ts +3 -0
- package/lib/components/multiple-tabs/types.js +2 -0
- package/lib/components/multiple-tabs/types.js.map +1 -0
- package/lib/components/multiple-tabs/use/index.d.ts +2 -0
- package/lib/components/multiple-tabs/use/index.js +2 -0
- package/lib/components/multiple-tabs/use/index.js.map +1 -0
- package/lib/components/multiple-tabs/use/use-multiple-tabs.d.ts +9 -0
- package/lib/components/multiple-tabs/use/use-multiple-tabs.js +2 -0
- package/lib/components/multiple-tabs/use/use-multiple-tabs.js.map +1 -0
- package/lib/components/multiple-tabs/use/use-tab-dropdown.d.ts +6 -0
- package/lib/components/multiple-tabs/use/use-tab-dropdown.js +2 -0
- package/lib/components/multiple-tabs/use/use-tab-dropdown.js.map +1 -0
- package/lib/components/result/result.vue2.js +1 -1
- package/lib/components/result/result.vue2.js.map +1 -1
- package/lib/components/tabs/tab-nav.vue2.js +1 -1
- package/lib/components/tabs/tab-nav.vue2.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/lib/theme-style/src/multiple-tabs.scss.js +2 -0
- package/lib/theme-style/src/multiple-tabs.scss.js.map +1 -0
- package/package.json +4 -2
- package/theme-style/src/context-menu.css +0 -0
- package/theme-style/src/multiple-tabs.scss +19 -0
- package/theme-style/vft-multiple-tabs.css +1 -0
package/es/component.mjs
CHANGED
|
@@ -8,14 +8,16 @@ import { VftTooltip as i } from "./components/tooltip/index.mjs";
|
|
|
8
8
|
import { VftPopover as e } from "./components/popover/index.mjs";
|
|
9
9
|
import { VftPopper as V } from "./components/popper/index.mjs";
|
|
10
10
|
import { VftTabs as n, VftTabPane as a } from "./components/tabs/index.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import { VftMultipleTabs as u } from "./components/multiple-tabs/index.mjs";
|
|
12
|
+
import { VftCollapseTransition as s } from "./components/collapse-transition/index.mjs";
|
|
13
|
+
import { VftMenu as l, VftMenuItem as M, VftMenuItemGroup as T, VftSubMenu as b } from "./components/menu/index.mjs";
|
|
14
|
+
const S = [
|
|
15
|
+
u,
|
|
15
16
|
l,
|
|
16
17
|
M,
|
|
17
18
|
T,
|
|
18
|
-
|
|
19
|
+
b,
|
|
20
|
+
s,
|
|
19
21
|
t,
|
|
20
22
|
o,
|
|
21
23
|
r,
|
|
@@ -29,6 +31,6 @@ const G = [
|
|
|
29
31
|
V
|
|
30
32
|
];
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
S as default
|
|
33
35
|
};
|
|
34
36
|
//# sourceMappingURL=component.mjs.map
|
package/es/component.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.mjs","sources":["../../../packages/vft/component.ts"],"sourcesContent":["import { VftDivider } from '@vft-ui/components/divider';\nimport { VftIcon } from '@vft-ui/components/icon';\nimport { VftAvatar } from '@vft-ui/components/avatar';\nimport { VftEmpty } from '@vft-ui/components/empty';\nimport { VftResult } from '@vft-ui/components/result';\nimport { VftException } from '@vft-ui/components/exception';\nimport { VftTooltip } from '@vft-ui/components/tooltip';\nimport { VftPopover } from '@vft-ui/components/popover';\nimport { VftPopper } from '@vft-ui/components/popper';\nimport { VftTabs, VftTabPane } from '@vft-ui/components/tabs';\nimport { VftCollapseTransition } from '@vft-ui/components/collapse-transition';\nimport {\n\tVftMenu,\n\tVftMenuItem,\n\tVftMenuItemGroup,\n\tVftSubMenu,\n} from '@vft-ui/components/menu';\n\nimport type { Plugin } from 'vue';\n\nexport default [\n\tVftMenu,\n\tVftMenuItem,\n\tVftMenuItemGroup,\n\tVftSubMenu,\n\tVftCollapseTransition,\n\tVftDivider,\n\tVftIcon,\n\tVftAvatar,\n\tVftEmpty,\n\tVftResult,\n\tVftException,\n\tVftTabs,\n\tVftTabPane,\n\tVftTooltip,\n\tVftPopover,\n\tVftPopper\n] as Plugin[];\n"],"names":["Components","VftMenu","VftMenuItem","VftMenuItemGroup","VftSubMenu","VftCollapseTransition","VftDivider","VftIcon","VftAvatar","VftEmpty","VftResult","VftException","VftTabs","VftTabPane","VftTooltip","VftPopover","VftPopper"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.mjs","sources":["../../../packages/vft/component.ts"],"sourcesContent":["import { VftDivider } from '@vft-ui/components/divider';\nimport { VftIcon } from '@vft-ui/components/icon';\nimport { VftAvatar } from '@vft-ui/components/avatar';\nimport { VftEmpty } from '@vft-ui/components/empty';\nimport { VftResult } from '@vft-ui/components/result';\nimport { VftException } from '@vft-ui/components/exception';\nimport { VftTooltip } from '@vft-ui/components/tooltip';\nimport { VftPopover } from '@vft-ui/components/popover';\nimport { VftPopper } from '@vft-ui/components/popper';\nimport { VftTabs, VftTabPane } from '@vft-ui/components/tabs';\nimport { VftMultipleTabs } from '@vft-ui/components/multiple-tabs';\nimport { VftCollapseTransition } from '@vft-ui/components/collapse-transition';\nimport {\n\tVftMenu,\n\tVftMenuItem,\n\tVftMenuItemGroup,\n\tVftSubMenu,\n} from '@vft-ui/components/menu';\n\nimport type { Plugin } from 'vue';\n\nexport default [\n\tVftMultipleTabs,\n\tVftMenu,\n\tVftMenuItem,\n\tVftMenuItemGroup,\n\tVftSubMenu,\n\tVftCollapseTransition,\n\tVftDivider,\n\tVftIcon,\n\tVftAvatar,\n\tVftEmpty,\n\tVftResult,\n\tVftException,\n\tVftTabs,\n\tVftTabPane,\n\tVftTooltip,\n\tVftPopover,\n\tVftPopper\n] as Plugin[];\n"],"names":["Components","VftMultipleTabs","VftMenu","VftMenuItem","VftMenuItemGroup","VftSubMenu","VftCollapseTransition","VftDivider","VftIcon","VftAvatar","VftEmpty","VftResult","VftException","VftTabs","VftTabPane","VftTooltip","VftPopover","VftPopper"],"mappings":";;;;;;;;;;;;;AAqBA,MAAeA,IAAA;AAAA,EACdC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AACD;"}
|
|
@@ -12,6 +12,8 @@ import "../collapse-transition/index.mjs";
|
|
|
12
12
|
import "../tooltip/index.mjs";
|
|
13
13
|
import "../popover/index.mjs";
|
|
14
14
|
import "../menu/index.mjs";
|
|
15
|
+
import "@vft/use";
|
|
16
|
+
import "../multiple-tabs/index.mjs";
|
|
15
17
|
import { useBackTop as w } from "./use-back-top.mjs";
|
|
16
18
|
import { useNamespace as I } from "../../hooks/use-namespace/index.mjs";
|
|
17
19
|
import "@popperjs/core";
|
|
@@ -24,7 +26,7 @@ const e = (
|
|
|
24
26
|
I("back-top")
|
|
25
27
|
), N = s({
|
|
26
28
|
name: e.b()
|
|
27
|
-
}),
|
|
29
|
+
}), ot = /* @__PURE__ */ s({
|
|
28
30
|
...N,
|
|
29
31
|
props: {
|
|
30
32
|
visibilityHeight: { default: 200 },
|
|
@@ -35,10 +37,10 @@ const e = (
|
|
|
35
37
|
},
|
|
36
38
|
emits: ["click"],
|
|
37
39
|
setup(r, { emit: u }) {
|
|
38
|
-
const f = g(), { handleClick:
|
|
40
|
+
const f = g(), { handleClick: m, visible: d } = w(f.props, u, e.b()), b = a(() => ({
|
|
39
41
|
right: `${r.right}px`,
|
|
40
42
|
bottom: `${r.bottom}px`
|
|
41
|
-
})),
|
|
43
|
+
})), n = a(() => S(r.icon, "icon", {
|
|
42
44
|
color: "black"
|
|
43
45
|
}));
|
|
44
46
|
return (k, p) => (i(), l(C, {
|
|
@@ -51,14 +53,14 @@ const e = (
|
|
|
51
53
|
class: x(t(e).b()),
|
|
52
54
|
onClick: p[0] || (p[0] = B(
|
|
53
55
|
//@ts-ignore
|
|
54
|
-
(...o) => t(
|
|
56
|
+
(...o) => t(m) && t(m)(...o),
|
|
55
57
|
["stop"]
|
|
56
58
|
))
|
|
57
59
|
}, [
|
|
58
60
|
T(k.$slots, "default", {}, () => {
|
|
59
61
|
var o;
|
|
60
62
|
return [
|
|
61
|
-
(o = t(
|
|
63
|
+
(o = t(n)) != null && o.icon ? (i(), l(t(_), $(z({ key: 0 }, t(n))), null, 16)) : c("", !0)
|
|
62
64
|
];
|
|
63
65
|
})
|
|
64
66
|
], 6)) : c("", !0)
|
|
@@ -68,6 +70,6 @@ const e = (
|
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
ot as default
|
|
72
74
|
};
|
|
73
75
|
//# sourceMappingURL=back-top.vue2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"back-top.vue2.mjs","sources":["../../../../../packages/components/back-top/back-top.vue"],"sourcesContent":["<script lang=\"ts\">\nconst ns = /* hoist-static*/ useNamespace('back-top')\n\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n\tname: ns.b()\n});</script>\n<script lang=\"ts\" setup>\nimport { singleAttrToObj } from '@vft/utils';\nimport { type IconProps, VftIcon } from '@vft-ui/components';\nimport { useBackTop } from './use-back-top';\nimport { useNamespace } from '@vft-ui/hooks';\nimport { computed, getCurrentInstance } from 'vue';\n\ninterface BackTopProps {\n /** 滚动高度达到此参数值才出现 */\n visibilityHeight?: number\n /** 触发滚动的对象 */\n target?: string\n /** 控制其显示位置,距离页面右边距 */\n right?: number\n /** 控制其显示位置,距离页面底部距离 */\n bottom?: number\n /** 滚动 icon dom */\n icon?: IconProps\n}\n\ndefineProps({\n \"visibilityHeight\": { default: 200 },\n \"target\": null,\n \"right\": { default: 40 },\n \"bottom\": { default: 40 },\n \"icon\": { default: 'vi-back-top' }\n})\n\nconst emit = defineEmits(['click']);\n\n\n\n;\n\nconst instance = getCurrentInstance()!;\n\nconst { handleClick, visible } = useBackTop(instance.props, emit, ns.b());\n\nconst backTopStyle = computed(() => ({\n right: `${__props.right}px`,\n bottom: `${__props.bottom}px`\n}));\n\nconst _icon = computed(() => {\n return singleAttrToObj(__props.icon, 'icon', {\n color: 'black'\n }) as IconProps;\n});\n</script>\n\n<template>\n <transition :name=\"`${ns.namespace}-fade-in`\">\n <div\n v-if=\"visible\"\n :style=\"backTopStyle\"\n :class=\"ns.b()\"\n @click.stop=\"handleClick\"\n >\n <slot>\n <vft-icon v-if=\"_icon?.icon\" v-bind=\"_icon\" />\n </slot>\n </div>\n </transition>\n</template>\n"],"names":["ns","useNamespace","__default__","DO_defineComponent","instance","getCurrentInstance","handleClick","visible","useBackTop","emit","backTopStyle","computed","__props","_icon","singleAttrToObj"],"mappings":"
|
|
1
|
+
{"version":3,"file":"back-top.vue2.mjs","sources":["../../../../../packages/components/back-top/back-top.vue"],"sourcesContent":["<script lang=\"ts\">\nconst ns = /* hoist-static*/ useNamespace('back-top')\n\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n\tname: ns.b()\n});</script>\n<script lang=\"ts\" setup>\nimport { singleAttrToObj } from '@vft/utils';\nimport { type IconProps, VftIcon } from '@vft-ui/components';\nimport { useBackTop } from './use-back-top';\nimport { useNamespace } from '@vft-ui/hooks';\nimport { computed, getCurrentInstance } from 'vue';\n\ninterface BackTopProps {\n /** 滚动高度达到此参数值才出现 */\n visibilityHeight?: number\n /** 触发滚动的对象 */\n target?: string\n /** 控制其显示位置,距离页面右边距 */\n right?: number\n /** 控制其显示位置,距离页面底部距离 */\n bottom?: number\n /** 滚动 icon dom */\n icon?: IconProps\n}\n\ndefineProps({\n \"visibilityHeight\": { default: 200 },\n \"target\": null,\n \"right\": { default: 40 },\n \"bottom\": { default: 40 },\n \"icon\": { default: 'vi-back-top' }\n})\n\nconst emit = defineEmits(['click']);\n\n\n\n;\n\nconst instance = getCurrentInstance()!;\n\nconst { handleClick, visible } = useBackTop(instance.props, emit, ns.b());\n\nconst backTopStyle = computed(() => ({\n right: `${__props.right}px`,\n bottom: `${__props.bottom}px`\n}));\n\nconst _icon = computed(() => {\n return singleAttrToObj(__props.icon, 'icon', {\n color: 'black'\n }) as IconProps;\n});\n</script>\n\n<template>\n <transition :name=\"`${ns.namespace}-fade-in`\">\n <div\n v-if=\"visible\"\n :style=\"backTopStyle\"\n :class=\"ns.b()\"\n @click.stop=\"handleClick\"\n >\n <slot>\n <vft-icon v-if=\"_icon?.icon\" v-bind=\"_icon\" />\n </slot>\n </div>\n </transition>\n</template>\n"],"names":["ns","useNamespace","__default__","DO_defineComponent","instance","getCurrentInstance","handleClick","visible","useBackTop","emit","backTopStyle","computed","__props","_icon","singleAttrToObj"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,MAAMA;AAAA;AAAA,EAAuBC,EAAa,UAAU;AAAA,GAGpDC,IAA6BC,EAAmB;AAAA,EAC/C,MAAMH,EAAG,EAAE;AACZ,CAAC;;;;;;;;;;;AAmCD,UAAMI,IAAWC,KAEX,EAAE,aAAAC,GAAa,SAAAC,EAAY,IAAAC,EAAWJ,EAAS,OAAOK,GAAMT,EAAG,EAAA,CAAG,GAElEU,IAAeC,EAAS,OAAO;AAAA,MACnC,OAAO,GAAGC,EAAQ;AAAA,MAClB,QAAQ,GAAGA,EAAQ;AAAA,IACnB,EAAA,GAEIC,IAAQF,EAAS,MACdG,EAAgBF,EAAQ,MAAM,QAAQ;AAAA,MAC3C,OAAO;AAAA,IAAA,CACR,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PropType as __PropType } from 'vue';
|
|
2
|
+
import { type CSSProperties } from 'vue';
|
|
3
|
+
import type { Axis, ContextMenuItem } from './types';
|
|
4
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
5
|
+
axis: {
|
|
6
|
+
type: __PropType<Axis | undefined>;
|
|
7
|
+
required: false;
|
|
8
|
+
};
|
|
9
|
+
styles: {
|
|
10
|
+
type: __PropType<CSSProperties | undefined>;
|
|
11
|
+
required: false;
|
|
12
|
+
};
|
|
13
|
+
width: {
|
|
14
|
+
type: __PropType<number | undefined>;
|
|
15
|
+
required: false;
|
|
16
|
+
};
|
|
17
|
+
items: {
|
|
18
|
+
type: __PropType<ContextMenuItem[] | undefined>;
|
|
19
|
+
required: false;
|
|
20
|
+
};
|
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
axis: {
|
|
23
|
+
type: __PropType<Axis | undefined>;
|
|
24
|
+
required: false;
|
|
25
|
+
};
|
|
26
|
+
styles: {
|
|
27
|
+
type: __PropType<CSSProperties | undefined>;
|
|
28
|
+
required: false;
|
|
29
|
+
};
|
|
30
|
+
width: {
|
|
31
|
+
type: __PropType<number | undefined>;
|
|
32
|
+
required: false;
|
|
33
|
+
};
|
|
34
|
+
items: {
|
|
35
|
+
type: __PropType<ContextMenuItem[] | undefined>;
|
|
36
|
+
required: false;
|
|
37
|
+
};
|
|
38
|
+
}>>, {}>;
|
|
39
|
+
export default _sfc_main;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent as w, ref as c, computed as y, openBlock as s, createBlock as a, Transition as k, withCtx as C, withDirectives as b, createElementVNode as f, normalizeStyle as g, unref as u, withModifiers as M, createElementBlock as $, Fragment as z, renderList as B, vShow as E } from "vue";
|
|
2
|
+
import { useTimeoutFn as S, useClickAway as A, useEventListener as m } from "@vft/use";
|
|
3
|
+
import "../divider/index.mjs";
|
|
4
|
+
import "../icon/index.mjs";
|
|
5
|
+
import "../avatar/index.mjs";
|
|
6
|
+
import "../empty/index.mjs";
|
|
7
|
+
import "../result/index.mjs";
|
|
8
|
+
import "../exception/index.mjs";
|
|
9
|
+
import "../tabs/index.mjs";
|
|
10
|
+
import "../popper/index.mjs";
|
|
11
|
+
import "../collapse-transition/index.mjs";
|
|
12
|
+
import "../tooltip/index.mjs";
|
|
13
|
+
import "../popover/index.mjs";
|
|
14
|
+
import { VftMenuItem as F } from "../menu/index.mjs";
|
|
15
|
+
import "@vft/utils";
|
|
16
|
+
import "../multiple-tabs/index.mjs";
|
|
17
|
+
const H = { class: "vri-sub-menu" }, Q = /* @__PURE__ */ w({
|
|
18
|
+
__name: "context-menu",
|
|
19
|
+
props: {
|
|
20
|
+
axis: null,
|
|
21
|
+
styles: null,
|
|
22
|
+
width: null,
|
|
23
|
+
items: null
|
|
24
|
+
},
|
|
25
|
+
setup(i) {
|
|
26
|
+
let d = c();
|
|
27
|
+
const p = y(() => {
|
|
28
|
+
const { x: e, y: t } = i.axis || { x: 0, y: 0 }, n = (i.items || []).length * 40, l = i.width || 0, r = document.body, v = r.clientWidth < e + l ? e - l : e, h = r.clientHeight < t + n ? t - n : t;
|
|
29
|
+
return {
|
|
30
|
+
zIndex: 3e3,
|
|
31
|
+
...i.styles,
|
|
32
|
+
position: "fixed",
|
|
33
|
+
width: `${i.width}px`,
|
|
34
|
+
left: `${v + 1}px`,
|
|
35
|
+
top: `${h + 1}px`
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
let o = c(!1);
|
|
39
|
+
S(() => {
|
|
40
|
+
o.value = !0;
|
|
41
|
+
}, 0), A(d, () => {
|
|
42
|
+
o.value = !1;
|
|
43
|
+
}, {
|
|
44
|
+
listenerOptions: {
|
|
45
|
+
capture: !0
|
|
46
|
+
}
|
|
47
|
+
}), m(window, "scroll", () => {
|
|
48
|
+
o.value = !1;
|
|
49
|
+
}, {
|
|
50
|
+
capture: !0
|
|
51
|
+
}), m(window, "drag", () => {
|
|
52
|
+
o.value = !1;
|
|
53
|
+
}, {
|
|
54
|
+
capture: !0
|
|
55
|
+
});
|
|
56
|
+
function x(e) {
|
|
57
|
+
var t;
|
|
58
|
+
e != null && e.disabled || ((t = e.handler) == null || t.call(e), o.value = !1);
|
|
59
|
+
}
|
|
60
|
+
return (e, t) => (s(), a(k, { name: "vri-zoom-in-top" }, {
|
|
61
|
+
default: C(() => [
|
|
62
|
+
b(f("div", {
|
|
63
|
+
ref_key: "contextMenuRef",
|
|
64
|
+
ref: d,
|
|
65
|
+
style: g(u(p)),
|
|
66
|
+
onClick: t[0] || (t[0] = M(() => {
|
|
67
|
+
}, ["stop"])),
|
|
68
|
+
class: "vft-menu"
|
|
69
|
+
}, [
|
|
70
|
+
f("div", H, [
|
|
71
|
+
(s(!0), $(z, null, B(i.items, (n, l) => (s(), a(u(F), {
|
|
72
|
+
onClick: (r) => x(n),
|
|
73
|
+
index: l + n.text,
|
|
74
|
+
title: n.text,
|
|
75
|
+
divider: n.divider,
|
|
76
|
+
disabled: n.disabled,
|
|
77
|
+
icon: n.iconCfg,
|
|
78
|
+
isAloneUse: "",
|
|
79
|
+
key: l
|
|
80
|
+
}, null, 8, ["onClick", "index", "title", "divider", "disabled", "icon"]))), 128))
|
|
81
|
+
])
|
|
82
|
+
], 4), [
|
|
83
|
+
[E, u(o)]
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
Q as default
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=context-menu.vue2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.vue2.mjs","sources":["../../../../../packages/components/context-menu/context-menu.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useClickAway, useEventListener, useTimeoutFn } from '@vft/use';\nimport { computed, ref, type CSSProperties } from 'vue';\nimport type { Axis, ContextMenuItem } from './types';\nimport { VftMenuItem as MenuItem } from '@vft-ui/components';\n\ninterface Props {\n axis?: Axis;\n styles?: CSSProperties;\n width?: number;\n items?: ContextMenuItem[];\n}\n\ndefineProps({\n \"axis\": null,\n \"styles\": null,\n \"width\": null,\n \"items\": null\n})\n\nlet contextMenuRef = ref();\n\nconst getStyle = computed((): CSSProperties => {\n const { x, y } = __props.axis || { x: 0, y: 0 };\n const menuHeight = (__props.items || []).length * 40;\n const menuWidth = __props.width || 0;\n const body = document.body;\n\n const left = body.clientWidth < x + menuWidth ? x - menuWidth : x;\n const top = body.clientHeight < y + menuHeight ? y - menuHeight : y;\n return {\n zIndex: 3000,\n ...__props.styles,\n position: 'fixed',\n width: `${__props.width}px`,\n left: `${left + 1}px`,\n top: `${top + 1}px`\n };\n});\n\nlet show = ref(false);\n\nuseTimeoutFn(() => {\n show.value = true;\n}, 0);\n\nuseClickAway(contextMenuRef, () => {\n show.value = false;\n}, {\n listenerOptions: {\n capture: true\n }\n});\n\nuseEventListener(window, 'scroll', () => {\n show.value = false;\n}, {\n capture: true\n});\n\nuseEventListener(window, 'drag', () => {\n show.value = false;\n}, {\n capture: true\n});\n\nfunction handleClick (item: ContextMenuItem) {\n if (!item?.disabled) {\n item.handler?.();\n show.value = false;\n }\n}\n</script>\n\n<template>\n <transition name=\"vri-zoom-in-top\">\n <div ref=\"contextMenuRef\" v-show=\"show\" :style=\"getStyle\" @click.stop class=\"vft-menu\">\n <div class=\"vri-sub-menu\">\n <menu-item v-for=\"(item, index) in items\"\n @click=\"handleClick(item)\"\n :index=\"index + item.text\"\n :title=\"item.text\"\n :divider=\"item.divider\"\n :disabled=\"item.disabled\"\n :icon=\"item.iconCfg\"\n isAloneUse\n :key=\"index\" />\n </div>\n </div>\n </transition>\n</template>\n\n"],"names":["contextMenuRef","ref","getStyle","computed","x","y","__props","menuHeight","menuWidth","body","left","top","show","useTimeoutFn","useClickAway","useEventListener","handleClick","item","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,QAAIA,IAAiBC;AAEf,UAAAC,IAAWC,EAAS,MAAqB;AACvC,YAAA,EAAE,GAAAC,GAAG,GAAAC,EAAM,IAAAC,EAAQ,QAAQ,EAAE,GAAG,GAAG,GAAG,KACtCC,KAAcD,EAAQ,SAAS,IAAI,SAAS,IAC5CE,IAAYF,EAAQ,SAAS,GAC7BG,IAAO,SAAS,MAEhBC,IAAOD,EAAK,cAAcL,IAAII,IAAYJ,IAAII,IAAYJ,GAC1DO,IAAMF,EAAK,eAAeJ,IAAIE,IAAaF,IAAIE,IAAaF;AAC3D,aAAA;AAAA,QACL,QAAQ;AAAA,QACR,GAAGC,EAAQ;AAAA,QACX,UAAU;AAAA,QACV,OAAO,GAAGA,EAAQ;AAAA,QAClB,MAAM,GAAGI,IAAO;AAAA,QAChB,KAAK,GAAGC,IAAM;AAAA,MAAA;AAAA,IAChB,CACD;AAEG,QAAAC,IAAOX,EAAI,EAAK;AAEpB,IAAAY,EAAa,MAAM;AACjB,MAAAD,EAAK,QAAQ;AAAA,OACZ,CAAC,GAEJE,EAAad,GAAgB,MAAM;AACjC,MAAAY,EAAK,QAAQ;AAAA,IAAA,GACZ;AAAA,MACD,iBAAiB;AAAA,QACf,SAAS;AAAA,MACX;AAAA,IAAA,CACD,GAEgBG,EAAA,QAAQ,UAAU,MAAM;AACvC,MAAAH,EAAK,QAAQ;AAAA,IAAA,GACZ;AAAA,MACD,SAAS;AAAA,IAAA,CACV,GAEgBG,EAAA,QAAQ,QAAQ,MAAM;AACrC,MAAAH,EAAK,QAAQ;AAAA,IAAA,GACZ;AAAA,MACD,SAAS;AAAA,IAAA,CACV;AAED,aAASI,EAAaC,GAAuB;;AACvC,MAACA,KAAA,QAAAA,EAAM,cACTC,IAAAD,EAAK,YAAL,QAAAC,EAAA,KAAAD,IACAL,EAAK,QAAQ;AAAA,IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isClient as a } from "@vft/utils";
|
|
2
|
+
import { createVNode as f, render as u } from "vue";
|
|
3
|
+
import v from "./context-menu.vue2.mjs";
|
|
4
|
+
const e = {
|
|
5
|
+
domList: [],
|
|
6
|
+
resolve: () => {
|
|
7
|
+
}
|
|
8
|
+
}, x = function(r) {
|
|
9
|
+
const { event: t } = r || {};
|
|
10
|
+
if (t && (t == null || t.preventDefault()), !!a)
|
|
11
|
+
return new Promise((l) => {
|
|
12
|
+
const n = document.body, c = document.createElement("div"), i = {
|
|
13
|
+
...r
|
|
14
|
+
};
|
|
15
|
+
r.event && (i.axis = { x: t.clientX, y: t.clientY }, delete i.event);
|
|
16
|
+
const d = f(v, i);
|
|
17
|
+
u(d, c);
|
|
18
|
+
const s = function() {
|
|
19
|
+
e.resolve("");
|
|
20
|
+
};
|
|
21
|
+
e.domList.push(c);
|
|
22
|
+
const m = function() {
|
|
23
|
+
e.domList.forEach((o) => {
|
|
24
|
+
try {
|
|
25
|
+
o && n.removeChild(o);
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
}), n.removeEventListener("click", s), n.removeEventListener("scroll", s);
|
|
29
|
+
};
|
|
30
|
+
e.resolve = function(o) {
|
|
31
|
+
m(), l(o);
|
|
32
|
+
}, m(), n.appendChild(c);
|
|
33
|
+
});
|
|
34
|
+
}, y = function() {
|
|
35
|
+
e && (e.resolve(""), e.domList = []);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
x as createContextMenu,
|
|
39
|
+
y as destroyContextMenu
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=createContextMenu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContextMenu.mjs","sources":["../../../../../packages/components/context-menu/createContextMenu.ts"],"sourcesContent":["import { isClient } from '@vft/utils';\nimport { createVNode, render } from 'vue';\nimport contextMenuVue from './context-menu.vue';\nimport type { ContextMenuProps, CreateContextOptions } from './types';\n\nconst menuManager: {\n domList: Element[];\n resolve: Fn;\n} = {\n domList: [],\n resolve: () => {}\n};\n\nexport const createContextMenu = function (options: CreateContextOptions) {\n const { event } = options || {};\n\n // event?.preventDefault() 阻止浏览器的默认右键菜单事件\n event && event?.preventDefault();\n\n if (!isClient) {\n return;\n }\n return new Promise((resolve) => {\n const body = document.body;\n\n const container = document.createElement('div');\n const propsData: Partial<ContextMenuProps> = {\n ...options\n };\n\n if (options.event) {\n propsData.axis = { x: event.clientX, y: event.clientY };\n // @ts-ignore\n delete propsData.event;\n }\n\n const vm = createVNode(contextMenuVue, propsData);\n render(vm, container);\n\n const handleClick = function () {\n menuManager.resolve('');\n };\n\n menuManager.domList.push(container);\n\n const remove = function () {\n menuManager.domList.forEach((dom: Element) => {\n try {\n dom && body.removeChild(dom);\n } catch (error) {}\n });\n body.removeEventListener('click', handleClick);\n body.removeEventListener('scroll', handleClick);\n };\n\n menuManager.resolve = function (arg) {\n remove();\n resolve(arg);\n };\n remove();\n body.appendChild(container);\n // body.addEventListener('click', handleClick);\n // body.addEventListener('scroll', handleClick);\n });\n};\n\nexport const destroyContextMenu = function () {\n if (menuManager) {\n menuManager.resolve('');\n menuManager.domList = [];\n }\n};\n"],"names":["menuManager","createContextMenu","options","event","isClient","resolve","body","container","propsData","vm","createVNode","contextMenuVue","render","handleClick","remove","dom","arg","destroyContextMenu"],"mappings":";;;AAKA,MAAMA,IAGF;AAAA,EACF,SAAS,CAAC;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAClB,GAEaC,IAAoB,SAAUC,GAA+B;AACxE,QAAM,EAAE,OAAAC,EAAA,IAAUD,KAAW;AAK7B,MAFAC,MAASA,KAAA,QAAAA,EAAO,mBAEZ,EAACC;AAGE,WAAA,IAAI,QAAQ,CAACC,MAAY;AAC9B,YAAMC,IAAO,SAAS,MAEhBC,IAAY,SAAS,cAAc,KAAK,GACxCC,IAAuC;AAAA,QAC3C,GAAGN;AAAA,MAAA;AAGL,MAAIA,EAAQ,UACVM,EAAU,OAAO,EAAE,GAAGL,EAAM,SAAS,GAAGA,EAAM,WAE9C,OAAOK,EAAU;AAGb,YAAAC,IAAKC,EAAYC,GAAgBH,CAAS;AAChD,MAAAI,EAAOH,GAAIF,CAAS;AAEpB,YAAMM,IAAc,WAAY;AAC9B,QAAAb,EAAY,QAAQ,EAAE;AAAA,MAAA;AAGZ,MAAAA,EAAA,QAAQ,KAAKO,CAAS;AAElC,YAAMO,IAAS,WAAY;AACb,QAAAd,EAAA,QAAQ,QAAQ,CAACe,MAAiB;AACxC,cAAA;AACK,YAAAA,KAAAT,EAAK,YAAYS,CAAG;AAAA;UACZ;AAAA,QAAA,CAClB,GACIT,EAAA,oBAAoB,SAASO,CAAW,GACxCP,EAAA,oBAAoB,UAAUO,CAAW;AAAA,MAAA;AAGpC,MAAAb,EAAA,UAAU,SAAUgB,GAAK;AAC5B,QAAAF,KACPT,EAAQW,CAAG;AAAA,MAAA,GAENF,KACPR,EAAK,YAAYC,CAAS;AAAA,IAAA,CAG3B;AACH,GAEaU,IAAqB,WAAY;AAC5C,EAAIjB,MACFA,EAAY,QAAQ,EAAE,GACtBA,EAAY,UAAU;AAE1B;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContextMenu as o, destroyContextMenu as n } from "./createContextMenu.mjs";
|
|
2
|
+
import { useContextMenu as x } from "./useContextMenu.mjs";
|
|
3
|
+
export {
|
|
4
|
+
o as createContextMenu,
|
|
5
|
+
n as destroyContextMenu,
|
|
6
|
+
x as useContextMenu
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CSSProperties } from 'vue';
|
|
2
|
+
import { type IconProps } from 'vft/es/components';
|
|
3
|
+
export interface Axis {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ContextMenuItem {
|
|
8
|
+
text: string;
|
|
9
|
+
iconCfg?: IconProps;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
handler?: Fn;
|
|
12
|
+
divider?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateContextOptions {
|
|
15
|
+
event: MouseEvent;
|
|
16
|
+
styles?: CSSProperties | Record<string, string>;
|
|
17
|
+
items?: ContextMenuItem[];
|
|
18
|
+
}
|
|
19
|
+
export interface ContextMenuProps {
|
|
20
|
+
axis: Axis;
|
|
21
|
+
styles: CSSProperties;
|
|
22
|
+
items: ContextMenuItem[];
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getCurrentInstance as n, onUnmounted as o } from "vue";
|
|
2
|
+
import { destroyContextMenu as t, createContextMenu as r } from "./createContextMenu.mjs";
|
|
3
|
+
function f(e = !0) {
|
|
4
|
+
return n() && e && o(() => {
|
|
5
|
+
t();
|
|
6
|
+
}), [r, t];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as useContextMenu
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useContextMenu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContextMenu.mjs","sources":["../../../../../packages/components/context-menu/useContextMenu.ts"],"sourcesContent":["import { onUnmounted, getCurrentInstance } from 'vue';\nimport { createContextMenu, destroyContextMenu } from './createContextMenu';\nimport type { ContextMenuItem } from './types';\n\nexport type { ContextMenuItem };\n\nexport function useContextMenu(authRemove = true) {\n if (getCurrentInstance() && authRemove) {\n onUnmounted(() => {\n destroyContextMenu();\n });\n }\n return [createContextMenu, destroyContextMenu];\n}\n"],"names":["useContextMenu","authRemove","getCurrentInstance","onUnmounted","destroyContextMenu","createContextMenu"],"mappings":";;AAMgB,SAAAA,EAAeC,IAAa,IAAM;AAC5C,SAAAC,OAAwBD,KAC1BE,EAAY,MAAM;AACG,IAAAC;EAAA,CACpB,GAEI,CAACC,GAAmBD,CAAkB;AAC/C;"}
|
package/es/components/index.d.ts
CHANGED
package/es/components/index.mjs
CHANGED
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
import { VftDivider as r } from "./divider/index.mjs";
|
|
2
2
|
import { VftIcon as f } from "./icon/index.mjs";
|
|
3
|
-
import { VftAvatar as
|
|
4
|
-
import { VftEmpty as
|
|
5
|
-
import { VftResult as
|
|
3
|
+
import { VftAvatar as x } from "./avatar/index.mjs";
|
|
4
|
+
import { VftEmpty as n } from "./empty/index.mjs";
|
|
5
|
+
import { VftResult as V } from "./result/index.mjs";
|
|
6
6
|
import { VftException as s } from "./exception/index.mjs";
|
|
7
|
-
import { VftTabPane as
|
|
8
|
-
import { VftPopper as
|
|
9
|
-
import { VftCollapseTransition as
|
|
10
|
-
import { VftTooltip as
|
|
11
|
-
import { VftPopover as
|
|
12
|
-
import { VftMenu as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
7
|
+
import { VftTabPane as T, VftTabs as l } from "./tabs/index.mjs";
|
|
8
|
+
import { VftPopper as M } from "./popper/index.mjs";
|
|
9
|
+
import { VftCollapseTransition as C } from "./collapse-transition/index.mjs";
|
|
10
|
+
import { VftTooltip as y } from "./tooltip/index.mjs";
|
|
11
|
+
import { VftPopover as c } from "./popover/index.mjs";
|
|
12
|
+
import { VftMenu as v, VftMenuItem as A, VftMenuItemGroup as D, VftSubMenu as I } from "./menu/index.mjs";
|
|
13
|
+
import { createContextMenu as R, destroyContextMenu as G } from "./context-menu/createContextMenu.mjs";
|
|
14
|
+
import { useContextMenu as S } from "./context-menu/useContextMenu.mjs";
|
|
15
|
+
import { VftMultipleTabs as j } from "./multiple-tabs/index.mjs";
|
|
16
|
+
import { EmptyEnum as q } from "./empty/constants.mjs";
|
|
17
|
+
import { TabsRootContextKey as B } from "./tabs/types.mjs";
|
|
18
|
+
import { default as H } from "./popper/arrow.vue2.mjs";
|
|
19
|
+
import { default as L } from "./popper/trigger.vue2.mjs";
|
|
20
|
+
import { default as O } from "./popper/content.vue2.mjs";
|
|
21
|
+
import { useTabDropdown as U } from "./multiple-tabs/use/use-tab-dropdown.mjs";
|
|
22
|
+
import { initAffixTabs as X, useTabsDrag as Y } from "./multiple-tabs/use/use-multiple-tabs.mjs";
|
|
18
23
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
q as EmptyEnum,
|
|
25
|
+
B as TabsRootContextKey,
|
|
26
|
+
x as VftAvatar,
|
|
27
|
+
C as VftCollapseTransition,
|
|
23
28
|
r as VftDivider,
|
|
24
|
-
|
|
29
|
+
n as VftEmpty,
|
|
25
30
|
s as VftException,
|
|
26
31
|
f as VftIcon,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
v as VftMenu,
|
|
33
|
+
A as VftMenuItem,
|
|
34
|
+
D as VftMenuItemGroup,
|
|
35
|
+
j as VftMultipleTabs,
|
|
36
|
+
c as VftPopover,
|
|
37
|
+
M as VftPopper,
|
|
38
|
+
H as VftPopperArrow,
|
|
39
|
+
O as VftPopperContent,
|
|
40
|
+
L as VftPopperTrigger,
|
|
41
|
+
V as VftResult,
|
|
42
|
+
I as VftSubMenu,
|
|
43
|
+
T as VftTabPane,
|
|
44
|
+
l as VftTabs,
|
|
45
|
+
y as VftTooltip,
|
|
46
|
+
R as createContextMenu,
|
|
47
|
+
G as destroyContextMenu,
|
|
48
|
+
X as initAffixTabs,
|
|
49
|
+
S as useContextMenu,
|
|
50
|
+
U as useTabDropdown,
|
|
51
|
+
Y as useTabsDrag
|
|
40
52
|
};
|
|
41
53
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -20,12 +20,14 @@ import "../collapse-transition/index.mjs";
|
|
|
20
20
|
import { VftTooltip as R } from "../tooltip/index.mjs";
|
|
21
21
|
import "../popover/index.mjs";
|
|
22
22
|
import "./index.mjs";
|
|
23
|
+
import "@vft/use";
|
|
24
|
+
import "../multiple-tabs/index.mjs";
|
|
23
25
|
const W = ["title"], b = (
|
|
24
26
|
/* hoist-static*/
|
|
25
27
|
k("menu-item")
|
|
26
28
|
), X = S({
|
|
27
29
|
name: b.b()
|
|
28
|
-
}),
|
|
30
|
+
}), Ue = /* @__PURE__ */ S({
|
|
29
31
|
...X,
|
|
30
32
|
props: {
|
|
31
33
|
index: null,
|
|
@@ -42,19 +44,19 @@ const W = ["title"], b = (
|
|
|
42
44
|
setup(e, { emit: T }) {
|
|
43
45
|
const y = M(), w = k("menu"), a = k("menu-item"), n = e.isAloneUse ? null : V("rootMenu");
|
|
44
46
|
!n && !e.isAloneUse && P(b.b(), "can not inject root menu");
|
|
45
|
-
const { parentMenu:
|
|
47
|
+
const { parentMenu: p, indexPath: g } = L(
|
|
46
48
|
y,
|
|
47
49
|
r(() => e.index)
|
|
48
|
-
), i = e.isAloneUse ? null : V(`subMenu:${
|
|
50
|
+
), i = e.isAloneUse ? null : V(`subMenu:${p.value.uid}`);
|
|
49
51
|
!i && !e.isAloneUse && P(b.b(), "can not inject sub menu");
|
|
50
|
-
const
|
|
52
|
+
const h = r(() => e.index === (n == null ? void 0 : n.activeIndex)), l = Y({
|
|
51
53
|
index: e.index,
|
|
52
|
-
indexPath:
|
|
53
|
-
active:
|
|
54
|
+
indexPath: g,
|
|
55
|
+
active: h
|
|
54
56
|
}), z = () => {
|
|
55
57
|
e.disabled || (n == null || n.handleMenuItemClick({
|
|
56
58
|
index: e.index,
|
|
57
|
-
indexPath:
|
|
59
|
+
indexPath: g.value,
|
|
58
60
|
route: e.route
|
|
59
61
|
}), T("click", l));
|
|
60
62
|
}, x = r(() => H(e.icon, "icon")), A = r(() => J(y, "title"));
|
|
@@ -70,12 +72,12 @@ const W = ["title"], b = (
|
|
|
70
72
|
marginY: "0"
|
|
71
73
|
})) : u("", !0),
|
|
72
74
|
f("li", {
|
|
73
|
-
class: $([e.className, t(a).b(), t(a).is("active", e.isAloneUse ? !1 : t(
|
|
75
|
+
class: $([e.className, t(a).b(), t(a).is("active", e.isAloneUse ? !1 : t(h)), t(a).is("disabled", e.disabled)]),
|
|
74
76
|
role: "menuitem",
|
|
75
77
|
tabindex: "-1",
|
|
76
78
|
onClick: z
|
|
77
79
|
}, [
|
|
78
|
-
((B = (U = t(
|
|
80
|
+
((B = (U = t(p)) == null ? void 0 : U.type) == null ? void 0 : B.name) === "vft-menu" && ((C = t(n)) != null && C.props.collapse) && m.$slots.title ? (o(), s(t(R), {
|
|
79
81
|
key: 0,
|
|
80
82
|
placement: "right",
|
|
81
83
|
"fallback-placements": ["left"],
|
|
@@ -110,6 +112,6 @@ const W = ["title"], b = (
|
|
|
110
112
|
}
|
|
111
113
|
});
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
Ue as default
|
|
114
116
|
};
|
|
115
117
|
//# sourceMappingURL=menu-item.vue2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.vue2.mjs","sources":["../../../../../packages/components/menu/menu-item.vue"],"sourcesContent":["<script lang=\"ts\">\nconst ns = /* hoist-static*/ useNamespace('menu-item')\n\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n name: ns.b()\n});</script>\n<script lang=\"ts\" setup>\nimport { renderTNode, singleAttrToObj, VNode } from '@vft/utils';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, reactive } from 'vue';\nimport { throwError } from '@vft-ui/utils';\nimport { useNamespace } from '@vft-ui/hooks';\nimport { type RouteLocationRaw } from 'vue-router';\nimport useMenu from './use-menu';\nimport { VftIcon as Icon, type IconProps, VftTooltip as Tooltip, VftDivider } from '@vft-ui/components';\n\nimport type { MenuItemRegistered, MenuProvider, SubMenuProvider } from './types';\n\ninterface Props {\n /** 唯一标志 */\n index?: string;\n /** Vue Router 路径对象 */\n route?: RouteLocationRaw;\n /** 是否禁用 */\n disabled?: boolean;\n icon?: IconProps;\n title?: string;\n isAloneUse?: boolean;\n divider?: boolean;\n className?: string\n reverse?: boolean\n}\n\ndefineProps({\n \"index\": null,\n \"route\": null,\n \"disabled\": { type: Boolean, },\n \"icon\": null,\n \"title\": null,\n \"isAloneUse\": { type: Boolean, },\n \"divider\": { type: Boolean, },\n \"className\": null,\n \"reverse\": { type: Boolean, }\n})\n\n\n\nconst emit = defineEmits(['click']);\n\n;\n\nconst instance = getCurrentInstance()!;\n\nconst nsMenu = useNamespace('menu');\n\nconst nsMenuItem = useNamespace('menu-item');\n\n// 获取来自 menu.vue 中注入的数据\nconst rootMenu = !__props.isAloneUse ? inject<MenuProvider>('rootMenu') : null;\nif (!rootMenu && !__props.isAloneUse) throwError(ns.b(), 'can not inject root menu');\n\n// indexPath:当前 menu-item 对应的 index 和 vft-sub-menu 的 index,parentMenu 为 vft-sub-menu 组件\nconst { parentMenu, indexPath } = useMenu(\n instance,\n computed(() => __props.index!)\n);\n\n// 注入来自 sub-menu 中的 provide 数据\nconst subMenu = !__props.isAloneUse ? inject<SubMenuProvider>(`subMenu:${parentMenu.value.uid}`) : null;\nif (!subMenu && !__props.isAloneUse) throwError(ns.b(), 'can not inject sub menu');\n\n// 当前是否为 active\nconst active = computed(() => __props.index === rootMenu?.activeIndex);\n\nconst item: MenuItemRegistered = reactive({\n index: __props.index!,\n indexPath,\n active\n});\n\n// 点击具体菜单项\nconst handleClick = () => {\n if (!__props.disabled) {\n rootMenu?.handleMenuItemClick({\n index: __props.index!,\n indexPath: indexPath.value,\n route: __props.route\n });\n emit('click', item);\n }\n};\n\nconst _icon = computed(() => {\n return singleAttrToObj(__props.icon, 'icon') as IconProps;\n});\n\nconst title = computed(() => {\n return renderTNode(instance, 'title');\n});\n\nonMounted(() => {\n if (!__props.isAloneUse) {\n // 触发 sub-menu,vue 中的 addSubMenu\n subMenu?.addSubMenu(item);\n // 触发 menu.vue 中的 addMenuItem 更新 items\n rootMenu?.addMenuItem(item);\n }\n});\n\nonBeforeUnmount(() => {\n if (!__props.isAloneUse) {\n subMenu?.removeSubMenu(item);\n rootMenu?.removeMenuItem(item);\n }\n});\n</script>\n\n<template>\n <vft-divider v-if=\"reverse && divider\" marginY=\"0\" />\n <li :class=\"[className, nsMenuItem.b(), nsMenuItem.is('active', isAloneUse ? false : active), nsMenuItem.is('disabled', disabled)]\" role=\"menuitem\" tabindex=\"-1\" @click=\"handleClick\">\n <tooltip\n v-if=\"parentMenu?.type?.name === 'vft-menu' && rootMenu?.props.collapse && $slots.title\"\n placement=\"right\" :fallback-placements=\"['left']\" persistent>\n <template #content>\n <slot name=\"title\" />\n </template>\n <div :class=\"nsMenu.be('tooltip', 'trigger')\">\n <slot />\n </div>\n </tooltip>\n <template v-else>\n <slot v-if=\"$slots?.default\"/>\n <template v-else>\n <Icon v-if=\"_icon?.icon\" v-bind=\"_icon\" />\n <span :title=\"title\"><v-node :content=\"title\" /></span>\n </template>\n </template>\n </li>\n <vft-divider v-if=\"!reverse && divider\" marginY=\"0\" />\n</template>\n"],"names":["ns","useNamespace","__default__","DO_defineComponent","instance","getCurrentInstance","nsMenu","nsMenuItem","rootMenu","__props","inject","throwError","parentMenu","indexPath","useMenu","computed","subMenu","active","item","reactive","handleClick","emit","_icon","singleAttrToObj","title","renderTNode","onMounted","onBeforeUnmount"],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu-item.vue2.mjs","sources":["../../../../../packages/components/menu/menu-item.vue"],"sourcesContent":["<script lang=\"ts\">\nconst ns = /* hoist-static*/ useNamespace('menu-item')\n\nimport { defineComponent as DO_defineComponent } from 'vue';\nexport default /*#__PURE__*/ DO_defineComponent({\n name: ns.b()\n});</script>\n<script lang=\"ts\" setup>\nimport { renderTNode, singleAttrToObj, VNode } from '@vft/utils';\nimport { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, reactive } from 'vue';\nimport { throwError } from '@vft-ui/utils';\nimport { useNamespace } from '@vft-ui/hooks';\nimport { type RouteLocationRaw } from 'vue-router';\nimport useMenu from './use-menu';\nimport { VftIcon as Icon, type IconProps, VftTooltip as Tooltip, VftDivider } from '@vft-ui/components';\n\nimport type { MenuItemRegistered, MenuProvider, SubMenuProvider } from './types';\n\ninterface Props {\n /** 唯一标志 */\n index?: string;\n /** Vue Router 路径对象 */\n route?: RouteLocationRaw;\n /** 是否禁用 */\n disabled?: boolean;\n icon?: IconProps;\n title?: string;\n isAloneUse?: boolean;\n divider?: boolean;\n className?: string\n reverse?: boolean\n}\n\ndefineProps({\n \"index\": null,\n \"route\": null,\n \"disabled\": { type: Boolean, },\n \"icon\": null,\n \"title\": null,\n \"isAloneUse\": { type: Boolean, },\n \"divider\": { type: Boolean, },\n \"className\": null,\n \"reverse\": { type: Boolean, }\n})\n\n\n\nconst emit = defineEmits(['click']);\n\n;\n\nconst instance = getCurrentInstance()!;\n\nconst nsMenu = useNamespace('menu');\n\nconst nsMenuItem = useNamespace('menu-item');\n\n// 获取来自 menu.vue 中注入的数据\nconst rootMenu = !__props.isAloneUse ? inject<MenuProvider>('rootMenu') : null;\nif (!rootMenu && !__props.isAloneUse) throwError(ns.b(), 'can not inject root menu');\n\n// indexPath:当前 menu-item 对应的 index 和 vft-sub-menu 的 index,parentMenu 为 vft-sub-menu 组件\nconst { parentMenu, indexPath } = useMenu(\n instance,\n computed(() => __props.index!)\n);\n\n// 注入来自 sub-menu 中的 provide 数据\nconst subMenu = !__props.isAloneUse ? inject<SubMenuProvider>(`subMenu:${parentMenu.value.uid}`) : null;\nif (!subMenu && !__props.isAloneUse) throwError(ns.b(), 'can not inject sub menu');\n\n// 当前是否为 active\nconst active = computed(() => __props.index === rootMenu?.activeIndex);\n\nconst item: MenuItemRegistered = reactive({\n index: __props.index!,\n indexPath,\n active\n});\n\n// 点击具体菜单项\nconst handleClick = () => {\n if (!__props.disabled) {\n rootMenu?.handleMenuItemClick({\n index: __props.index!,\n indexPath: indexPath.value,\n route: __props.route\n });\n emit('click', item);\n }\n};\n\nconst _icon = computed(() => {\n return singleAttrToObj(__props.icon, 'icon') as IconProps;\n});\n\nconst title = computed(() => {\n return renderTNode(instance, 'title');\n});\n\nonMounted(() => {\n if (!__props.isAloneUse) {\n // 触发 sub-menu,vue 中的 addSubMenu\n subMenu?.addSubMenu(item);\n // 触发 menu.vue 中的 addMenuItem 更新 items\n rootMenu?.addMenuItem(item);\n }\n});\n\nonBeforeUnmount(() => {\n if (!__props.isAloneUse) {\n subMenu?.removeSubMenu(item);\n rootMenu?.removeMenuItem(item);\n }\n});\n</script>\n\n<template>\n <vft-divider v-if=\"reverse && divider\" marginY=\"0\" />\n <li :class=\"[className, nsMenuItem.b(), nsMenuItem.is('active', isAloneUse ? false : active), nsMenuItem.is('disabled', disabled)]\" role=\"menuitem\" tabindex=\"-1\" @click=\"handleClick\">\n <tooltip\n v-if=\"parentMenu?.type?.name === 'vft-menu' && rootMenu?.props.collapse && $slots.title\"\n placement=\"right\" :fallback-placements=\"['left']\" persistent>\n <template #content>\n <slot name=\"title\" />\n </template>\n <div :class=\"nsMenu.be('tooltip', 'trigger')\">\n <slot />\n </div>\n </tooltip>\n <template v-else>\n <slot v-if=\"$slots?.default\"/>\n <template v-else>\n <Icon v-if=\"_icon?.icon\" v-bind=\"_icon\" />\n <span :title=\"title\"><v-node :content=\"title\" /></span>\n </template>\n </template>\n </li>\n <vft-divider v-if=\"!reverse && divider\" marginY=\"0\" />\n</template>\n"],"names":["ns","useNamespace","__default__","DO_defineComponent","instance","getCurrentInstance","nsMenu","nsMenuItem","rootMenu","__props","inject","throwError","parentMenu","indexPath","useMenu","computed","subMenu","active","item","reactive","handleClick","emit","_icon","singleAttrToObj","title","renderTNode","onMounted","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;qBACMA;AAAA;AAAA,EAAuBC,EAAa,WAAW;AAAA,GAGrDC,IAA6BC,EAAmB;AAAA,EAC9C,MAAMH,EAAG,EAAE;AACb,CAAC;;;;;;;;;;;;;;;AA6CD,UAAMI,IAAWC,KAEXC,IAASL,EAAa,MAAM,GAE5BM,IAAaN,EAAa,WAAW,GAGrCO,IAAYC,EAAQ,aAAgD,OAAnCC,EAAqB,UAAU;AAClE,IAAA,CAACF,KAAY,CAACC,EAAQ,cAAuBE,EAAAX,EAAG,EAAE,GAAG,0BAA0B;AAG7E,UAAA,EAAE,YAAAY,GAAY,WAAAC,EAAA,IAAcC;AAAA,MAChCV;AAAA,MACAW,EAAS,MAAMN,EAAQ,KAAM;AAAA,IAAA,GAIzBO,IAAWP,EAAQ,aAA0E,OAA7DC,EAAwB,WAAWE,EAAW,MAAM,KAAK;AAC3F,IAAA,CAACI,KAAW,CAACP,EAAQ,cAAuBE,EAAAX,EAAG,EAAE,GAAG,yBAAyB;AAGjF,UAAMiB,IAASF,EAAS,MAAMN,EAAQ,WAAUD,KAAA,gBAAAA,EAAU,YAAW,GAE/DU,IAA2BC,EAAS;AAAA,MACxC,OAAOV,EAAQ;AAAA,MACf,WAAAI;AAAA,MACA,QAAAI;AAAA,IAAA,CACD,GAGKG,IAAc,MAAM;AACpB,MAACX,EAAQ,aACXD,KAAA,QAAAA,EAAU,oBAAoB;AAAA,QAC5B,OAAOC,EAAQ;AAAA,QACf,WAAWI,EAAU;AAAA,QACrB,OAAOJ,EAAQ;AAAA,MAAA,IAEjBY,EAAK,SAASH,CAAI;AAAA,IACpB,GAGII,IAAQP,EAAS,MACdQ,EAAgBd,EAAQ,MAAM,MAAM,CAC5C,GAEKe,IAAQT,EAAS,MACdU,EAAYrB,GAAU,OAAO,CACrC;AAED,WAAAsB,EAAU,MAAM;AACV,MAACjB,EAAQ,eAEXO,KAAA,QAAAA,EAAS,WAAWE,IAEpBV,KAAA,QAAAA,EAAU,YAAYU;AAAA,IACxB,CACD,GAEDS,EAAgB,MAAM;AAChB,MAAClB,EAAQ,eACXO,KAAA,QAAAA,EAAS,cAAcE,IACvBV,KAAA,QAAAA,EAAU,eAAeU;AAAA,IAC3B,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|