@veltra/desktop 1.1.29 → 1.1.31
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/dist/components/action/action-group.vue.d.ts +1 -1
- package/dist/components/cascade/cascade.vue.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +3 -3
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/tabs/tabs-horizontal.js.map +1 -1
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +1 -0
- package/dist/components/tabs/tabs-vertical.js.map +1 -1
- package/dist/components/tabs/tabs-vertical.vue.d.ts +6 -7
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/context-menu/context-menu.vue +19 -17
- package/src/components/tabs/tabs-horizontal.vue +1 -1
- package/src/components/tabs/tabs-vertical.vue +2 -0
|
@@ -9,8 +9,8 @@ declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _Actio
|
|
|
9
9
|
type: import("@veltra/utils").ColorType;
|
|
10
10
|
text: boolean;
|
|
11
11
|
size: "small" | "default" | "large";
|
|
12
|
-
max: number;
|
|
13
12
|
circle: boolean;
|
|
13
|
+
max: number;
|
|
14
14
|
loading: boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
|
|
|
18
18
|
filterable: boolean;
|
|
19
19
|
disabled: boolean;
|
|
20
20
|
readonly: boolean;
|
|
21
|
-
visibilityLimit: number;
|
|
22
21
|
separator: string;
|
|
22
|
+
visibilityLimit: number;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextMenuDIKey } from "./di.js";
|
|
2
2
|
import _sfc_main$1 from "./context-menu-item.js";
|
|
3
|
-
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderList, shallowRef, unref, withCtx, withDirectives } from "vue";
|
|
3
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderList, shallowRef, unref, withCtx, withDirectives } from "vue";
|
|
4
4
|
import { useFallbackProps } from "@veltra/compositions";
|
|
5
5
|
import { bem, withUnit, zIndex } from "@veltra/utils";
|
|
6
6
|
import { vClickOutside } from "@veltra/directives";
|
|
@@ -65,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
}
|
|
66
66
|
provide(ContextMenuDIKey, { cls });
|
|
67
67
|
return (_ctx, _cache) => {
|
|
68
|
-
return openBlock(), createBlock(Transition, {
|
|
68
|
+
return openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(Transition, {
|
|
69
69
|
name: "zoom-in",
|
|
70
70
|
appear: "",
|
|
71
71
|
onAfterLeave: _cache[0] || (_cache[0] = ($event) => emit("destroy"))
|
|
@@ -85,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
85
85
|
}, null, 8, ["menu", "disabled"]);
|
|
86
86
|
}), 256))], 6)), [[unref(vClickOutside), handleClickOutside]]) : createCommentVNode("v-if", true)]),
|
|
87
87
|
_: 1
|
|
88
|
-
});
|
|
88
|
+
})]);
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../src/components/context-menu/context-menu.vue"],"sourcesContent":["<template>\n <transition name=\"zoom-in\" appear @after-leave=\"emit('destroy')\">\n
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../src/components/context-menu/context-menu.vue"],"sourcesContent":["<template>\n <Teleport to=\"body\">\n <transition name=\"zoom-in\" appear @after-leave=\"emit('destroy')\">\n <ul\n :class=\"[cls.b, cls.m(size)]\"\n :style=\"style\"\n ref=\"contextMenuRef\"\n v-if=\"visible\"\n v-click-outside=\"handleClickOutside\"\n >\n <UContextMenuItem\n v-for=\"menu of menus\"\n :menu=\"menu\"\n :disabled=\"getMenuDisabled(menu)\"\n @click-start=\"handleClickStart\"\n @click-end=\"handleClickEnd\"\n />\n </ul>\n </transition>\n </Teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { vClickOutside } from '@veltra/directives'\nimport { bem, withUnit, zIndex } from '@veltra/utils'\nimport { computed, provide, shallowRef, type CSSProperties } from 'vue'\n\nimport type {\n ContextMenuEmits,\n ContextMenuItem,\n ContextMenuProps,\n ComponentSize\n} from '../../types'\nimport UContextMenuItem from './context-menu-item.vue'\nimport { ContextMenuDIKey } from './di'\n\ndefineOptions({ name: 'ContextMenu' })\n\nconst props = withDefaults(defineProps<ContextMenuProps>(), { width: 150 })\n\nconst emit = defineEmits<ContextMenuEmits>()\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst cls = bem('context-menu')\n\nconst contextMenuRef = shallowRef<HTMLElement>()\n\nconst visible = shallowRef(true)\n\nconst computePosition = () => {\n const position: {\n top?: number\n left?: number\n right?: number\n bottom?: number\n transformOrigin?: string\n } = {}\n\n const { mousePosition } = props\n const { x, y } = mousePosition\n if (x > window.innerWidth / 2) {\n position.right = window.innerWidth - x - 1\n } else {\n position.left = x + 1\n }\n if (y > window.innerHeight / 2) {\n position.bottom = window.innerHeight - y - 1\n } else {\n position.top = y + 1\n }\n\n const positionY = position.top ? 'top' : 'bottom'\n const positionX = position.left ? 'left' : 'right'\n position.transformOrigin = `${positionY} ${positionX}`\n\n return Object.fromEntries(\n Object.entries(position).map(([k, v]) => [k, withUnit(v as number | string | undefined, 'px')])\n ) as CSSProperties\n}\n\nconst style = computed<CSSProperties>(() => {\n return { width: withUnit(props.width, 'px'), ...computePosition(), zIndex: zIndex() }\n})\n\nconst menus = computed(() => {\n const { menus } = props\n if (typeof menus === 'function') {\n return menus()\n }\n return menus\n})\n\nconst getMenuDisabled = (menu: ContextMenuItem) => {\n return typeof menu.disabled === 'function' ? menu.disabled() : menu.disabled\n}\n\nfunction close() {\n visible.value = false\n}\n\nlet loading = false\nfunction handleClickStart() {\n loading = true\n}\n\nfunction handleClickEnd() {\n loading = false\n close()\n}\n\nfunction handleClickOutside() {\n if (loading) return\n close()\n}\n\nprovide(ContextMenuDIKey, { cls })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAuCA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAA2B,CAAC;EAE/E,MAAM,MAAM,IAAI,cAAc;EAE9B,MAAM,iBAAiB,WAAwB;EAE/C,MAAM,UAAU,WAAW,IAAI;EAE/B,MAAM,wBAAwB;GAC5B,MAAM,WAMF,CAAC;GAEL,MAAM,EAAE,kBAAkB;GAC1B,MAAM,EAAE,GAAG,MAAM;GACjB,IAAI,IAAI,OAAO,aAAa,GAC1B,SAAS,QAAQ,OAAO,aAAa,IAAI;QAEzC,SAAS,OAAO,IAAI;GAEtB,IAAI,IAAI,OAAO,cAAc,GAC3B,SAAS,SAAS,OAAO,cAAc,IAAI;QAE3C,SAAS,MAAM,IAAI;GAKrB,SAAS,kBAAkB,GAFT,SAAS,MAAM,QAAQ,SAED,GADtB,SAAS,OAAO,SAAS;GAG3C,OAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,SAAS,GAAkC,IAAI,CAAC,CAAC,CAChG;EACF;EAEA,MAAM,QAAQ,eAA8B;GAC1C,OA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ined;
|
|
14
14
|
}>, {
|
|
15
|
-
direction: TipDirection;
|
|
16
15
|
trigger: "hover" | "click";
|
|
16
|
+
direction: TipDirection;
|
|
17
17
|
icon: import("vue").Component;
|
|
18
18
|
iconColor: string;
|
|
19
19
|
confirmText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-horizontal.js","names":[],"sources":["../../../src/components/tabs/tabs-horizontal.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n cls.b,\n cls.m('horizontal'),\n cls.m(position),\n cls.m(size),\n bem.is('block', block),\n bem.is('rounded', rounded)\n ]\"\n >\n <button\n v-show=\"showNav\"\n type=\"button\"\n :class=\"[cls.e('nav'), cls.em('nav', 'prev')]\"\n :disabled=\"!canPrev\"\n @click=\"scrollByStep(-1)\"\n >\n <u-icon> <ArrowLeft /> </u-icon>\n </button>\n\n <div ref=\"viewportRef\" :class=\"cls.e('viewport')\">\n <div ref=\"listRef\" :class=\"cls.e('list')\">\n <button\n type=\"button\"\n role=\"tab\"\n v-for=\"(item, index) in items\"\n :key=\"item.key\"\n :class=\"[\n cls.e('item'),\n bem.is('active', model === item.key),\n bem.is('disabled', item.disabled === true)\n ]\"\n @click.stop=\"handleClick(item, index)\"\n >\n <slot v-bind=\"{ item, index }\">\n <span :class=\"cls.e('item-label')\">{{ item.name ?? item.key }}</span>\n </slot>\n\n <span\n v-if=\"isItemClosable(item)\"\n role=\"button\"\n tabindex=\"0\"\n :class=\"cls.e('close')\"\n :aria-label=\"`close ${item.name ?? item.key}`\"\n @click.stop=\"handleClose(item, index)\"\n >\n <u-icon>\n <Close />\n </u-icon>\n </span>\n </button>\n </div>\n </div>\n\n <button\n v-show=\"showNav\"\n type=\"button\"\n :class=\"[cls.e('nav'), cls.em('nav', 'next')]\"\n :disabled=\"!canNext\"\n @click=\"scrollByStep(1)\"\n >\n <u-icon> <ArrowRight /> </u-icon>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { ArrowLeft, ArrowRight, Close } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, shallowRef } from 'vue'\n\nimport type { ComponentSize, TabItem, TabsHorizontalEmits, TabsHorizontalProps } from '../../types'\nimport { UIcon } from '../icon'\nimport { useTabsBar } from './use-tabs-bar'\n\ndefineOptions({ name: 'TabsHorizontal' })\n\nconst props = withDefaults(defineProps<TabsHorizontalProps>(), {\n position: 'top',\n closable: false,\n block: false,\n rounded: false\n})\n\nconst emit = defineEmits<TabsHorizontalEmits>()\n\ndefineSlots<{ default: (props: { item: TabItem }) => any }>()\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst cls = bem('tabs-bar')\n\nconst model = defineModel<string>()\n\nconst viewportRef = shallowRef<HTMLElement>()\nconst listRef = shallowRef<HTMLElement>()\n\nconst itemsRef = computed(() => props.items)\n\nconst { showNav, canPrev, canNext, scrollByStep } = useTabsBar({\n viewportRef,\n listRef,\n items: itemsRef,\n model\n})\n\nconst isItemClosable = (item: TabItem) => {\n if (item.disabled) return false\n return item.closable ?? props.closable\n}\n\nconst handleClick = (item: TabItem, index: number) => {\n if (item.disabled) return\n model.value = item.key\n emit('click', item, index)\n}\n\nconst handleClose = (item: TabItem, index: number) => {\n if (item.disabled) return\n emit('close', item, index)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EA,MAAM,QAAQ;EAOd,MAAM,OAAO;EAIb,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAA2B,CAAC;EAE/E,MAAM,MAAM,IAAI,UAAU;EAE1B,MAAM,QAAQ,SAAmB,SAAA,YAAC;EAElC,MAAM,cAAc,WAAwB;EAC5C,MAAM,UAAU,WAAwB;EAIxC,MAAM,EAAE,SAAS,SAAS,SAAS,iBAAiB,WAAW;GAC7D;GACA;GACA,OALe,eAAe,MAAM,KAK7B;GACP;EACF,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3,"file":"tabs-horizontal.js","names":[],"sources":["../../../src/components/tabs/tabs-horizontal.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n cls.b,\n cls.m('horizontal'),\n cls.m(position),\n cls.m(size),\n bem.is('block', block),\n bem.is('rounded', rounded)\n ]\"\n >\n <button\n v-show=\"showNav\"\n type=\"button\"\n :class=\"[cls.e('nav'), cls.em('nav', 'prev')]\"\n :disabled=\"!canPrev\"\n @click=\"scrollByStep(-1)\"\n >\n <u-icon> <ArrowLeft /> </u-icon>\n </button>\n\n <div ref=\"viewportRef\" :class=\"cls.e('viewport')\">\n <div ref=\"listRef\" :class=\"cls.e('list')\">\n <button\n type=\"button\"\n role=\"tab\"\n v-for=\"(item, index) in items\"\n :key=\"item.key\"\n :class=\"[\n cls.e('item'),\n bem.is('active', model === item.key),\n bem.is('disabled', item.disabled === true)\n ]\"\n @click.stop=\"handleClick(item, index)\"\n >\n <slot v-bind=\"{ item, index }\">\n <span :class=\"cls.e('item-label')\">{{ item.name ?? item.key }}</span>\n </slot>\n\n <span\n v-if=\"isItemClosable(item)\"\n role=\"button\"\n tabindex=\"0\"\n :class=\"cls.e('close')\"\n :aria-label=\"`close ${item.name ?? item.key}`\"\n @click.stop=\"handleClose(item, index)\"\n >\n <u-icon>\n <Close />\n </u-icon>\n </span>\n </button>\n </div>\n </div>\n\n <button\n v-show=\"showNav\"\n type=\"button\"\n :class=\"[cls.e('nav'), cls.em('nav', 'next')]\"\n :disabled=\"!canNext\"\n @click=\"scrollByStep(1)\"\n >\n <u-icon> <ArrowRight /> </u-icon>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { ArrowLeft, ArrowRight, Close } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, shallowRef } from 'vue'\n\nimport type { ComponentSize, TabItem, TabsHorizontalEmits, TabsHorizontalProps } from '../../types'\nimport { UIcon } from '../icon'\nimport { useTabsBar } from './use-tabs-bar'\n\ndefineOptions({ name: 'TabsHorizontal' })\n\nconst props = withDefaults(defineProps<TabsHorizontalProps>(), {\n position: 'top',\n closable: false,\n block: false,\n rounded: false\n})\n\nconst emit = defineEmits<TabsHorizontalEmits>()\n\ndefineSlots<{ default: (props: { item: TabItem; index: number }) => any }>()\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst cls = bem('tabs-bar')\n\nconst model = defineModel<string>()\n\nconst viewportRef = shallowRef<HTMLElement>()\nconst listRef = shallowRef<HTMLElement>()\n\nconst itemsRef = computed(() => props.items)\n\nconst { showNav, canPrev, canNext, scrollByStep } = useTabsBar({\n viewportRef,\n listRef,\n items: itemsRef,\n model\n})\n\nconst isItemClosable = (item: TabItem) => {\n if (item.disabled) return false\n return item.closable ?? props.closable\n}\n\nconst handleClick = (item: TabItem, index: number) => {\n if (item.disabled) return\n model.value = item.key\n emit('click', item, index)\n}\n\nconst handleClose = (item: TabItem, index: number) => {\n if (item.disabled) return\n emit('close', item, index)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EA,MAAM,QAAQ;EAOd,MAAM,OAAO;EAIb,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAA2B,CAAC;EAE/E,MAAM,MAAM,IAAI,UAAU;EAE1B,MAAM,QAAQ,SAAmB,SAAA,YAAC;EAElC,MAAM,cAAc,WAAwB;EAC5C,MAAM,UAAU,WAAwB;EAIxC,MAAM,EAAE,SAAS,SAAS,SAAS,iBAAiB,WAAW;GAC7D;GACA;GACA,OALe,eAAe,MAAM,KAK7B;GACP;EACF,CAAC;EAED,MAAM,kBAAkB,SAAkB;GACxC,IAAI,KAAK,UAAU,OAAO;GAC1B,OAAO,KAAK,YAAY,MAAM;EAChC;EAEA,MAAM,eAAe,MAAe,UAAkB;GACpD,IAAI,KAAK,UAAU;GACnB,MAAM,QAAQ,KAAK;GACnB,KAAK,SAAS,MA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AAa,KAAK,aAAQ,IAAA;;MAKlI,SAAK,eAAA,WAAO,YAAY,MAAM,KAAK,GAAA,CAAA,MAAA,CAAA;SAEpC,WAEO,KAAA,QAAA,WAFP,WAEO,EAAA,SAAA,KAAA,GAAA;MAFS;MAAM;KAAK,CAAA,SAEpB,CADL,mBAAqE,QAAA,EAA9D,OAAK,eAAE,MAAA,GAAA,EAAI,EAAC,YAAA,CAAA,EAAA,GAAA,gBAAmB,KAAK,QAAQ,KAAK,GAAG,GAAA,CAAA,CAAA,CAAA,GAIrD,eAAe,IAAI,KAAA,UAAA,GAD3B,mBAWO,QAAA;;MATL,MAAK;MACL,UAAS;MACR,OAAK,eAAE,MAAA,GAAA,EAAI,EAAC,OAAA,CAAA;MACZ,cAAU,SAAW,KAAK,QAAQ,KAAK;MACvC,SAAK,eAAA,WAAO,YAAY,MAAM,KAAK,GAAA,CAAA,MAAA,CAAA;SAEpC,YAES,MAAA,WAAA,GAAA,MAAA;6BADE,CAAT,YAAS,MAAA,KAAA,CAAA,CAAA,CAAA;;;;mBAOnB,mBAQS,UAAA;KANP,MAAK;KACJ,OAAK,eAAA,CAAG,MAAA,GAAA,EAAI,EAAC,KAAA,GAAS,MAAA,GAAA,EAAI,GAAE,OAAA,MAAA,CAAA,CAAA;KAC5B,UAAQ,CAAG,MAAA,OAAA;KACX,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,YAAA,EAAY,CAAA;QAEpB,YAAiC,MAAA,WAAA,GAAA,MAAA;4BAAV,CAAd,YAAc,MAAA,UAAA,CAAA,CAAA,CAAA;;mCANf,MAAA,OAAA,CAAO,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-vertical.js","names":[],"sources":["../../../src/components/tabs/tabs-vertical.vue"],"sourcesContent":["<template>\n <div\n :class=\"[cls.b, cls.m('vertical'), cls.m(position), cls.m(size), bem.is('rounded', rounded)]\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n v-for=\"(item, index) in items\"\n :key=\"item.key\"\n :class=\"[\n cls.e('item'),\n bem.is('active', model === item.key),\n bem.is('disabled', item.disabled === true)\n ]\"\n @click.stop=\"handleClick(item, index)\"\n >\n <slot v-bind=\"{ item, index }\">\n <span :class=\"cls.e('item-label')\">{{ item.name ?? item.key }}</span>\n </slot>\n <span\n v-if=\"isItemClosable(item)\"\n role=\"button\"\n tabindex=\"0\"\n :class=\"cls.e('close')\"\n :aria-label=\"`close ${item.name ?? item.key}`\"\n @click.stop=\"handleClose(item, index)\"\n >\n <u-icon>\n <Close />\n </u-icon>\n </span>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\n\nimport type { ComponentSize, TabItem, TabsVerticalEmits, TabsVerticalProps } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'TabsVertical' })\n\nconst props = withDefaults(defineProps<TabsVerticalProps>(), {\n position: 'left',\n closable: false,\n rounded: false\n})\n\nconst emit = defineEmits<TabsVerticalEmits>()\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst cls = bem('tabs-bar')\n\nconst model = defineModel<string>()\n\nconst isItemClosable = (item: TabItem) => {\n if (item.disabled) return false\n return item.closable ?? props.closable\n}\n\nconst handleClick = (item: TabItem, index: number) => {\n if (item.disabled) return\n model.value = item.key\n emit('click', item, index)\n}\n\nconst handleClose = (item: TabItem, index: number) => {\n if (item.disabled) return\n emit('close', item, index)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAMd,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"tabs-vertical.js","names":[],"sources":["../../../src/components/tabs/tabs-vertical.vue"],"sourcesContent":["<template>\n <div\n :class=\"[cls.b, cls.m('vertical'), cls.m(position), cls.m(size), bem.is('rounded', rounded)]\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n v-for=\"(item, index) in items\"\n :key=\"item.key\"\n :class=\"[\n cls.e('item'),\n bem.is('active', model === item.key),\n bem.is('disabled', item.disabled === true)\n ]\"\n @click.stop=\"handleClick(item, index)\"\n >\n <slot v-bind=\"{ item, index }\">\n <span :class=\"cls.e('item-label')\">{{ item.name ?? item.key }}</span>\n </slot>\n <span\n v-if=\"isItemClosable(item)\"\n role=\"button\"\n tabindex=\"0\"\n :class=\"cls.e('close')\"\n :aria-label=\"`close ${item.name ?? item.key}`\"\n @click.stop=\"handleClose(item, index)\"\n >\n <u-icon>\n <Close />\n </u-icon>\n </span>\n </button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\n\nimport type { ComponentSize, TabItem, TabsVerticalEmits, TabsVerticalProps } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'TabsVertical' })\n\nconst props = withDefaults(defineProps<TabsVerticalProps>(), {\n position: 'left',\n closable: false,\n rounded: false\n})\n\nconst emit = defineEmits<TabsVerticalEmits>()\n\ndefineSlots<{ default: (props: { item: TabItem; index: number }) => any }>()\n\nconst { size } = useFallbackProps([props], { size: 'default' as ComponentSize })\n\nconst cls = bem('tabs-bar')\n\nconst model = defineModel<string>()\n\nconst isItemClosable = (item: TabItem) => {\n if (item.disabled) return false\n return item.closable ?? props.closable\n}\n\nconst handleClick = (item: TabItem, index: number) => {\n if (item.disabled) return\n model.value = item.key\n emit('click', item, index)\n}\n\nconst handleClose = (item: TabItem, index: number) => {\n if (item.disabled) return\n emit('close', item, index)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAMd,MAAM,OAAO;EAIb,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAA2B,CAAC;EAE/E,MAAM,MAAM,I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CAAA,CAAA,GAGrD,eAAe,IAAI,KAAA,UAAA,GAD3B,mBAWO,QAAA;;KATL,MAAK;KACL,UAAS;KACR,OAAK,eAAE,MAAA,GAAA,EAAI,EAAC,OAAA,CAAA;KACZ,cAAU,SAAW,KAAK,QAAQ,KAAK;KACvC,SAAK,eAAA,WAAO,YAAY,MAAM,KAAK,GAAA,CAAA,MAAA,CAAA;QAEpC,YAES,MAAA,WAAA,GAAA,MAAA;4BADE,CAAT,YAAS,MAAA,KAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { TabItem, TabsVerticalProps } from "../../types/tabs.js";
|
|
2
2
|
//#region src/components/tabs/tabs-vertical.vue.d.ts
|
|
3
3
|
type __VLS_Props = TabsVerticalProps;
|
|
4
|
+
type __VLS_Slots = {
|
|
5
|
+
default: (props: {
|
|
6
|
+
item: TabItem;
|
|
7
|
+
index: number;
|
|
8
|
+
}) => any;
|
|
9
|
+
};
|
|
4
10
|
type __VLS_ModelProps = {
|
|
5
11
|
modelValue?: string;
|
|
6
12
|
};
|
|
7
13
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
-
declare var __VLS_1: {
|
|
9
|
-
item: TabItem;
|
|
10
|
-
index: number;
|
|
11
|
-
};
|
|
12
|
-
type __VLS_Slots = {} & {
|
|
13
|
-
default?: (props: typeof __VLS_1) => any;
|
|
14
|
-
};
|
|
15
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
15
|
"update:modelValue": (value: string | undefined) => any;
|
|
17
16
|
} & {
|
|
@@ -9,10 +9,10 @@ declare const __VLS_base: import("vue").DefineComponent<TipProps, {}, {}, {}, {}
|
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<TipProps> & Readonly<{
|
|
10
10
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
direction: TipDirection;
|
|
13
12
|
trigger: "hover" | "click";
|
|
14
13
|
contentTag: string;
|
|
15
14
|
visible: boolean;
|
|
15
|
+
direction: TipDirection;
|
|
16
16
|
content: string;
|
|
17
17
|
alignment: TipAlign;
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/desktop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src"
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"@cat-kit/core": ">=1.1.6",
|
|
69
69
|
"@cat-kit/excel": ">=1.0.0",
|
|
70
70
|
"@cat-kit/fe": "^1.1.6",
|
|
71
|
-
"@veltra/compositions": "1.1.
|
|
72
|
-
"@veltra/directives": "1.1.
|
|
73
|
-
"@veltra/icons": "1.1.
|
|
74
|
-
"@veltra/styles": "1.1.
|
|
75
|
-
"@veltra/utils": "1.1.
|
|
71
|
+
"@veltra/compositions": "1.1.31",
|
|
72
|
+
"@veltra/directives": "1.1.31",
|
|
73
|
+
"@veltra/icons": "1.1.31",
|
|
74
|
+
"@veltra/styles": "1.1.31",
|
|
75
|
+
"@veltra/utils": "1.1.31",
|
|
76
76
|
"vue": ">=3.5.0"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<Teleport to="body">
|
|
3
|
+
<transition name="zoom-in" appear @after-leave="emit('destroy')">
|
|
4
|
+
<ul
|
|
5
|
+
:class="[cls.b, cls.m(size)]"
|
|
6
|
+
:style="style"
|
|
7
|
+
ref="contextMenuRef"
|
|
8
|
+
v-if="visible"
|
|
9
|
+
v-click-outside="handleClickOutside"
|
|
10
|
+
>
|
|
11
|
+
<UContextMenuItem
|
|
12
|
+
v-for="menu of menus"
|
|
13
|
+
:menu="menu"
|
|
14
|
+
:disabled="getMenuDisabled(menu)"
|
|
15
|
+
@click-start="handleClickStart"
|
|
16
|
+
@click-end="handleClickEnd"
|
|
17
|
+
/>
|
|
18
|
+
</ul>
|
|
19
|
+
</transition>
|
|
20
|
+
</Teleport>
|
|
19
21
|
</template>
|
|
20
22
|
|
|
21
23
|
<script lang="ts" setup>
|
|
@@ -86,7 +86,7 @@ const props = withDefaults(defineProps<TabsHorizontalProps>(), {
|
|
|
86
86
|
|
|
87
87
|
const emit = defineEmits<TabsHorizontalEmits>()
|
|
88
88
|
|
|
89
|
-
defineSlots<{ default: (props: { item: TabItem }) => any }>()
|
|
89
|
+
defineSlots<{ default: (props: { item: TabItem; index: number }) => any }>()
|
|
90
90
|
|
|
91
91
|
const { size } = useFallbackProps([props], { size: 'default' as ComponentSize })
|
|
92
92
|
|
|
@@ -51,6 +51,8 @@ const props = withDefaults(defineProps<TabsVerticalProps>(), {
|
|
|
51
51
|
|
|
52
52
|
const emit = defineEmits<TabsVerticalEmits>()
|
|
53
53
|
|
|
54
|
+
defineSlots<{ default: (props: { item: TabItem; index: number }) => any }>()
|
|
55
|
+
|
|
54
56
|
const { size } = useFallbackProps([props], { size: 'default' as ComponentSize })
|
|
55
57
|
|
|
56
58
|
const cls = bem('tabs-bar')
|