@katlux/toolkit 0.1.0-beta.76 → 0.1.0-beta.78
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/module.json +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +2 -2
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +53 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +20 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +53 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +53 -2
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +167 -3
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +4 -4
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +4 -4
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +4 -4
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +4 -4
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue +20 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +25 -2
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +81 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +4 -4
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +4 -4
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
- package/dist/runtime/components/MultiTabs/MultiTabs.global.d.vue.ts +23 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.global.vue +27 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.logic.d.ts +25 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.logic.js +52 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +20 -1
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +60 -3
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +20 -1
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue +1 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +3 -1
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue +96 -2
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.d.vue.ts +14 -1
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +70 -3
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue.d.ts +14 -1
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.d.vue.ts +9 -0
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.vue +55 -0
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.vue.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
menuRect: {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
maxHeight: number;
|
|
7
|
+
};
|
|
8
|
+
clickoutside: () => void;
|
|
9
|
+
teleportTarget: string | null;
|
|
10
|
+
isInModal: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:isOpen": (...args: any[]) => void;
|
|
14
|
+
registerRef: (...args: any[]) => void;
|
|
15
|
+
registerSourceRef: (...args: any[]) => void;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
|
|
18
|
+
onRegisterRef?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
onRegisterSourceRef?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
21
|
declare const _default: typeof __VLS_export;
|
|
3
22
|
export default _default;
|
|
@@ -17,11 +17,11 @@ type __VLS_Props = {
|
|
|
17
17
|
validationText?: string;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
|
-
"update:maskedModel": (value: string) => any;
|
|
21
20
|
"update:isOpen": (value: boolean) => any;
|
|
21
|
+
"update:maskedModel": (value: string) => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
-
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
24
23
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const _default: typeof __VLS_export;
|
|
27
27
|
export default _default;
|
|
@@ -17,11 +17,11 @@ type __VLS_Props = {
|
|
|
17
17
|
validationText?: string;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
|
-
"update:maskedModel": (value: string) => any;
|
|
21
20
|
"update:isOpen": (value: boolean) => any;
|
|
21
|
+
"update:maskedModel": (value: string) => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
-
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
24
23
|
"onUpdate:isOpen"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
"onUpdate:maskedModel"?: ((value: string) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const _default: typeof __VLS_export;
|
|
27
27
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
widthPx?: string;
|
|
3
3
|
heightPx?: string;
|
|
4
|
-
iconComponent: string;
|
|
4
|
+
iconComponent: string | null;
|
|
5
5
|
rotate: number | string;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
widthPx?: string;
|
|
3
3
|
heightPx?: string;
|
|
4
|
-
iconComponent: string;
|
|
4
|
+
iconComponent: string | null;
|
|
5
5
|
rotate: number | string;
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -36,10 +36,12 @@ const props = withDefaults(defineProps<{
|
|
|
36
36
|
background-color: color-mix(in srgb, var(--current-panel-bg), transparent calc((1 - var(--panel-bg-opacity)) * 100%));
|
|
37
37
|
backdrop-filter: blur(var(--panel-blur));
|
|
38
38
|
width: 100%;
|
|
39
|
+
min-width: 0;
|
|
39
40
|
display: flex;
|
|
40
41
|
flex-direction: column;
|
|
41
42
|
overflow: hidden;
|
|
42
43
|
transition: transform var(--transition-normal), box-shadow var(--transition-normal);
|
|
44
|
+
box-sizing: border-box;
|
|
43
45
|
|
|
44
46
|
&.type-primary {
|
|
45
47
|
--current-panel-bg: var(--panel-bg-primary);
|
|
@@ -68,7 +70,7 @@ const props = withDefaults(defineProps<{
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
&:hover {
|
|
71
|
-
transform: translateY(-2px);
|
|
73
|
+
//transform: translateY(-2px);
|
|
72
74
|
box-shadow: var(--shadow-lg);
|
|
73
75
|
}
|
|
74
76
|
|
|
@@ -2,18 +2,112 @@
|
|
|
2
2
|
.KTab
|
|
3
3
|
KPanel
|
|
4
4
|
template(#header)
|
|
5
|
-
|
|
6
|
-
KButton(v-
|
|
5
|
+
.k-tabs-nav
|
|
6
|
+
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(-1)" size="small") <
|
|
7
|
+
.k-tabs-scroll-area(ref="scrollArea")
|
|
8
|
+
KGrid(direction="row" wrap="nowrap")
|
|
9
|
+
KButton.k-tab-btn(
|
|
10
|
+
v-for="(item, index) of items"
|
|
11
|
+
:key="index"
|
|
12
|
+
@click="toggleItem(index)"
|
|
13
|
+
size="small"
|
|
14
|
+
:disabled="isOpen(index)"
|
|
15
|
+
) {{item.title}}
|
|
16
|
+
KButton.k-tabs-nav-btn(v-if="hasOverflow" @click="scroll(1)" size="small") >
|
|
7
17
|
slot
|
|
8
18
|
</template>
|
|
9
19
|
|
|
10
20
|
<script lang="ts" setup>
|
|
21
|
+
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
|
22
|
+
|
|
11
23
|
const props = defineProps<{
|
|
12
24
|
items: any[]
|
|
13
25
|
toggleItem: (index: number) => void
|
|
14
26
|
isOpen: (index: number) => boolean
|
|
15
27
|
}>()
|
|
28
|
+
|
|
29
|
+
const scrollArea = ref<HTMLElement | null>(null)
|
|
30
|
+
const hasOverflow = ref(false)
|
|
31
|
+
let resizeObserver: ResizeObserver | null = null
|
|
32
|
+
|
|
33
|
+
const checkOverflow = () => {
|
|
34
|
+
if (!scrollArea.value) return
|
|
35
|
+
const el = scrollArea.value
|
|
36
|
+
// Compare the inner KGrid's natural width vs the scroll area's offset width.
|
|
37
|
+
// Using offsetWidth (not clientWidth) avoids being affected by the scroll area itself.
|
|
38
|
+
const inner = el.firstElementChild as HTMLElement | null
|
|
39
|
+
if (inner) {
|
|
40
|
+
hasOverflow.value = inner.scrollWidth > el.offsetWidth + 1
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
nextTick(() => checkOverflow())
|
|
46
|
+
resizeObserver = new ResizeObserver(() => checkOverflow())
|
|
47
|
+
if (scrollArea.value) {
|
|
48
|
+
// Only observe the scroll area container — NOT the inner KGrid.
|
|
49
|
+
// Observing the inner KGrid would cause a feedback loop when nav buttons
|
|
50
|
+
// appear/disappear, since that changes the scroll area's clientWidth,
|
|
51
|
+
// which triggers another resize event, which flips hasOverflow again.
|
|
52
|
+
resizeObserver.observe(scrollArea.value)
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
onUnmounted(() => {
|
|
57
|
+
resizeObserver?.disconnect()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
watch(() => props.items.length, async () => {
|
|
61
|
+
await nextTick()
|
|
62
|
+
checkOverflow()
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const scroll = (direction: number) => {
|
|
66
|
+
scrollArea.value?.scrollBy({ left: 200 * direction, behavior: 'smooth' })
|
|
67
|
+
}
|
|
16
68
|
</script>
|
|
17
69
|
|
|
18
70
|
<style lang="scss" scoped>
|
|
71
|
+
.KTab {
|
|
72
|
+
max-width: 100%;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:deep(.KPanel--header) {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.k-tabs-nav {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.k-tabs-scroll-area {
|
|
89
|
+
flex: 1 1 0px;
|
|
90
|
+
overflow-x: auto;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
scroll-snap-type: x mandatory;
|
|
94
|
+
scroll-behavior: smooth;
|
|
95
|
+
|
|
96
|
+
/* Hide scrollbar */
|
|
97
|
+
-ms-overflow-style: none;
|
|
98
|
+
scrollbar-width: none;
|
|
99
|
+
&::-webkit-scrollbar {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.k-tab-btn {
|
|
105
|
+
scroll-snap-align: center;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.k-tabs-nav-btn {
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
margin: 0 8px;
|
|
112
|
+
}
|
|
19
113
|
</style>
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
tooltipStyle: Record<string, string>;
|
|
4
|
+
showTooltip: () => void;
|
|
5
|
+
hideTooltip: () => void;
|
|
6
|
+
text: string;
|
|
7
|
+
position: 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
registerWrapperRef: (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRegisterWrapperRef?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
15
|
declare const _default: typeof __VLS_export;
|
|
3
16
|
export default _default;
|
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
.KTooltip
|
|
3
|
-
|
|
2
|
+
.KTooltip-wrapper(
|
|
3
|
+
ref="internalWrapperRef"
|
|
4
|
+
@mouseenter="showTooltip"
|
|
5
|
+
@mouseleave="hideTooltip"
|
|
6
|
+
)
|
|
7
|
+
slot
|
|
8
|
+
Teleport(v-if="isMounted && visible" to="body")
|
|
9
|
+
.KTooltip(
|
|
10
|
+
:style="tooltipStyle"
|
|
11
|
+
:class="[position]"
|
|
12
|
+
)
|
|
13
|
+
slot(name="content")
|
|
14
|
+
span {{ text }}
|
|
4
15
|
</template>
|
|
5
|
-
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ref, onMounted, watch } from 'vue'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
visible: boolean
|
|
22
|
+
tooltipStyle: Record<string, string>
|
|
23
|
+
showTooltip: () => void
|
|
24
|
+
hideTooltip: () => void
|
|
25
|
+
text: string
|
|
26
|
+
position: 'top' | 'bottom' | 'left' | 'right'
|
|
27
|
+
disabled: boolean
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits(['registerWrapperRef'])
|
|
31
|
+
|
|
32
|
+
const internalWrapperRef = ref<HTMLElement | null>(null)
|
|
33
|
+
const isMounted = ref(false)
|
|
34
|
+
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
isMounted.value = true
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
watch(internalWrapperRef, (newVal) => {
|
|
40
|
+
emit('registerWrapperRef', newVal)
|
|
41
|
+
}, { immediate: true })
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
.KTooltip-wrapper {
|
|
46
|
+
display: inline-block;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.KTooltip {
|
|
50
|
+
background-color: var(--neutral-800, #1f2937);
|
|
51
|
+
color: var(--font-color-light, #ffffff);
|
|
52
|
+
padding: 6px 10px;
|
|
53
|
+
border-radius: var(--border-radius-sm, 4px);
|
|
54
|
+
font-size: 11px;
|
|
55
|
+
line-height: 1.4;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
|
|
58
|
+
max-width: 250px;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
opacity: 0;
|
|
61
|
+
animation: tooltip-fade-in 0.15s ease-out forwards;
|
|
62
|
+
|
|
63
|
+
@keyframes tooltip-fade-in {
|
|
64
|
+
from {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
}
|
|
67
|
+
to {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
tooltipStyle: Record<string, string>;
|
|
4
|
+
showTooltip: () => void;
|
|
5
|
+
hideTooltip: () => void;
|
|
6
|
+
text: string;
|
|
7
|
+
position: 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
registerWrapperRef: (...args: any[]) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRegisterWrapperRef?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
15
|
declare const _default: typeof __VLS_export;
|
|
3
16
|
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
groups: any[];
|
|
3
|
+
addTab: (tab: any, groupId?: string) => void;
|
|
4
|
+
splitScreen: (initialTab?: any) => string;
|
|
5
|
+
closeSplit: (groupId: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
KGrid.multi-tabs(direction="row" align="stretch" flexChild)
|
|
3
|
+
template(v-for="(group, groupIndex) in groups" :key="group.id || groupIndex")
|
|
4
|
+
KTabs.multi-tabs-tabs(v-if="group.tabs && group.tabs.length > 0")
|
|
5
|
+
KTabItem(v-for="tab in group.tabs" :key="tab.id" :title="tab.title" :isOpen="tab.isOpen")
|
|
6
|
+
.multi-tabs-tab-content
|
|
7
|
+
slot(:name="tab.slotName || tab.id" :tab="tab")
|
|
8
|
+
component(v-if="tab.component" :is="tab.component" v-bind="tab.props")
|
|
9
|
+
.multi-tabs-empty(v-else)
|
|
10
|
+
slot(name="empty" :group="group")
|
|
11
|
+
span No tabs open
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
groups: any[]
|
|
17
|
+
addTab: (tab: any, groupId?: string) => void
|
|
18
|
+
splitScreen: (initialTab?: any) => string
|
|
19
|
+
closeSplit: (groupId: string) => void
|
|
20
|
+
}>()
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
.multi-tabs {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.multi-tabs-empty {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
height: 100%;
|
|
35
|
+
flex: 1 1 0%;
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
38
|
+
.multi-tabs-tabs {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
|
|
41
|
+
flex: 1 1 0%;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
> * {
|
|
46
|
+
height: 100%;
|
|
47
|
+
min-width: 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.multi-tabs-tab-content {
|
|
51
|
+
padding: 1rem;
|
|
52
|
+
height: 100%;
|
|
53
|
+
overflow: auto;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
groups: any[];
|
|
3
|
+
addTab: (tab: any, groupId?: string) => void;
|
|
4
|
+
splitScreen: (initialTab?: any) => string;
|
|
5
|
+
closeSplit: (groupId: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|