@katlux/toolkit 0.1.1-alpha.130 → 0.1.1-alpha.132
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/bin/add-ai-reference.mjs +51 -45
- package/dist/compiled/composables/locales.mjs +48 -24
- package/dist/module.cjs +122 -0
- package/dist/module.d.cts +6 -1
- package/dist/module.d.mts +6 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +123 -1
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +8 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue +15 -1
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +8 -0
- package/dist/runtime/components/{MultiTabs/MultiTabs.global.d.vue.ts → KMultiTabs/KMultiTabs.global.d.vue.ts} +5 -5
- package/dist/runtime/components/{MultiTabs/MultiTabs.global.vue → KMultiTabs/KMultiTabs.global.vue} +5 -5
- package/dist/runtime/components/{MultiTabs/MultiTabs.global.vue.d.ts → KMultiTabs/KMultiTabs.global.vue.d.ts} +5 -5
- package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +34 -0
- package/dist/runtime/components/{MultiTabs/MultiTabs.logic.js → KMultiTabs/KMultiTabs.logic.js} +4 -2
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/composables/locales.js +48 -24
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +0 -4
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +20 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +39 -4
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +20 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +60 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +26 -3
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +60 -0
- package/dist/runtime/presets/default/components/{MultiTabs/MultiTabs.d.vue.ts → KMultiTabs/KMultiTabs.d.vue.ts} +3 -2
- package/dist/runtime/presets/default/components/{MultiTabs/MultiTabs.vue → KMultiTabs/KMultiTabs.vue} +19 -14
- package/dist/runtime/presets/default/components/{MultiTabs/MultiTabs.vue.d.ts → KMultiTabs/KMultiTabs.vue.d.ts} +3 -2
- package/dist/skills/KATLUX_INDEX.md +1 -0
- package/dist/skills/katlux-components/SKILL.md +1 -1
- package/dist/skills/katlux-components/components/KGantt.md +59 -0
- package/dist/skills/katlux-components/components/KMultiTabs.md +20 -0
- package/dist/skills/katlux-config/SKILL.md +7 -7
- package/dist/types.d.mts +2 -6
- package/package.json +3 -3
- package/dist/runtime/components/MultiTabs/MultiTabs.logic.d.ts +0 -25
- package/dist/skills/katlux-components/components/MultiTabs.md +0 -20
|
@@ -35,6 +35,16 @@ type __VLS_Props = {
|
|
|
35
35
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
36
36
|
"update:selectedRows": (value: any[]) => any;
|
|
37
37
|
"update:selectAll": (value: boolean) => any;
|
|
38
|
+
"task-click": (payload: {
|
|
39
|
+
task: IGanttTask;
|
|
40
|
+
row: any;
|
|
41
|
+
}) => any;
|
|
42
|
+
"task-dblclick": (payload: {
|
|
43
|
+
task: IGanttTask;
|
|
44
|
+
row: any;
|
|
45
|
+
}) => any;
|
|
46
|
+
"task-contextmenu": (payload: any) => any;
|
|
47
|
+
"task-rightclick": (payload: any) => any;
|
|
38
48
|
"update:task": (payload: {
|
|
39
49
|
task: IGanttTask;
|
|
40
50
|
sourceRow: any;
|
|
@@ -43,6 +53,16 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
43
53
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
44
54
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
45
55
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
56
|
+
"onTask-click"?: ((payload: {
|
|
57
|
+
task: IGanttTask;
|
|
58
|
+
row: any;
|
|
59
|
+
}) => any) | undefined;
|
|
60
|
+
"onTask-dblclick"?: ((payload: {
|
|
61
|
+
task: IGanttTask;
|
|
62
|
+
row: any;
|
|
63
|
+
}) => any) | undefined;
|
|
64
|
+
"onTask-contextmenu"?: ((payload: any) => any) | undefined;
|
|
65
|
+
"onTask-rightclick"?: ((payload: any) => any) | undefined;
|
|
46
66
|
"onUpdate:task"?: ((payload: {
|
|
47
67
|
task: IGanttTask;
|
|
48
68
|
sourceRow: any;
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
:activeDrag="activeDragState && activeDragState.sourceRowId === row?.id ? activeDragState : null"
|
|
55
55
|
@task-dragstart="onTaskDragStart($event, row)"
|
|
56
56
|
@cell-mouseenter="onCellMouseEnter($event, row)"
|
|
57
|
+
@task-click="onTaskClick"
|
|
58
|
+
@task-dblclick="$emit('task-dblclick', $event)"
|
|
59
|
+
@task-contextmenu="$emit('task-contextmenu', $event)"
|
|
60
|
+
@task-rightclick="$emit('task-rightclick', $event)"
|
|
57
61
|
)
|
|
58
62
|
</template>
|
|
59
63
|
|
|
@@ -105,6 +109,10 @@ const emit = defineEmits<{
|
|
|
105
109
|
(e: 'update:task', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
106
110
|
(e: 'update:selectedRows', value: any[]): void
|
|
107
111
|
(e: 'update:selectAll', value: boolean): void
|
|
112
|
+
(e: 'task-click', payload: { task: IGanttTask; row: any }): void
|
|
113
|
+
(e: 'task-dblclick', payload: { task: IGanttTask; row: any }): void
|
|
114
|
+
(e: 'task-contextmenu', payload: any): void
|
|
115
|
+
(e: 'task-rightclick', payload: any): void
|
|
108
116
|
}>()
|
|
109
117
|
|
|
110
118
|
// ── Drag state (owned here so all rows can share it) ─────────────
|
|
@@ -187,11 +195,19 @@ const onWheel = (e: WheelEvent) => {
|
|
|
187
195
|
// Let normal scroll through for vertical scrolling
|
|
188
196
|
}
|
|
189
197
|
|
|
198
|
+
let wasDragging = false
|
|
199
|
+
|
|
200
|
+
const onTaskClick = (payload: { task: IGanttTask; row: any }) => {
|
|
201
|
+
if (wasDragging) return
|
|
202
|
+
emit('task-click', payload)
|
|
203
|
+
}
|
|
204
|
+
|
|
190
205
|
const onTaskDragStart = (
|
|
191
206
|
{ event, task, rowId, mode, wrapperEl }: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null },
|
|
192
207
|
row: any
|
|
193
208
|
) => {
|
|
194
|
-
|
|
209
|
+
wasDragging = false
|
|
210
|
+
if (!props.editable || event.button !== 0) { return }
|
|
195
211
|
event.preventDefault()
|
|
196
212
|
|
|
197
213
|
const wrapperRect = wrapperEl?.getBoundingClientRect()
|
|
@@ -233,8 +249,11 @@ const onMouseMove = (e: MouseEvent) => {
|
|
|
233
249
|
if (!activeDragState.value) return
|
|
234
250
|
|
|
235
251
|
const state = activeDragState.value
|
|
236
|
-
const msPerPx = (props.globalDateRange.end - props.globalDateRange.start) / state.wrapperWidth
|
|
237
252
|
const deltaX = e.clientX - state.startX
|
|
253
|
+
if (Math.abs(deltaX) > 4) {
|
|
254
|
+
wasDragging = true
|
|
255
|
+
}
|
|
256
|
+
const msPerPx = (props.globalDateRange.end - props.globalDateRange.start) / state.wrapperWidth
|
|
238
257
|
const deltaMs = deltaX * msPerPx
|
|
239
258
|
const snapMs = getSnapMs(props.snapTo || 'day')
|
|
240
259
|
|
|
@@ -261,13 +280,30 @@ const onMouseUp = () => {
|
|
|
261
280
|
window.removeEventListener('mousemove', onMouseMove)
|
|
262
281
|
window.removeEventListener('mouseup', onMouseUp)
|
|
263
282
|
|
|
264
|
-
if (
|
|
283
|
+
if (wasDragging) {
|
|
284
|
+
setTimeout(() => {
|
|
285
|
+
wasDragging = false
|
|
286
|
+
}, 150)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (!activeDragState.value) { return }
|
|
265
290
|
|
|
266
291
|
const state = activeDragState.value
|
|
267
292
|
const startField = props.resolvedMapping?.startDate ?? 'startDate'
|
|
268
293
|
const endField = props.resolvedMapping?.endDate ?? 'endDate'
|
|
269
294
|
const tasksField = props.resolvedMapping?.tasksField ?? 'tasks'
|
|
270
295
|
|
|
296
|
+
// If the task was not actually moved or resized, do not emit update:task
|
|
297
|
+
const hasMoved = wasDragging ||
|
|
298
|
+
state.currentStartMs !== state.originalStartMs ||
|
|
299
|
+
state.currentEndMs !== state.originalEndMs ||
|
|
300
|
+
(state.currentHoverRow && state.currentHoverRow !== state.sourceRow)
|
|
301
|
+
|
|
302
|
+
if (!hasMoved) {
|
|
303
|
+
activeDragState.value = null
|
|
304
|
+
return
|
|
305
|
+
}
|
|
306
|
+
|
|
271
307
|
const updatedTask = {
|
|
272
308
|
...state.task,
|
|
273
309
|
[startField]: state.currentStartMs,
|
|
@@ -319,7 +355,6 @@ const onMouseUp = () => {
|
|
|
319
355
|
}
|
|
320
356
|
|
|
321
357
|
emit('update:task', {
|
|
322
|
-
|
|
323
358
|
task: updatedTask,
|
|
324
359
|
sourceRow: state.sourceRow,
|
|
325
360
|
targetRow: targetRow !== state.sourceRow ? targetRow : undefined
|
|
@@ -35,6 +35,16 @@ type __VLS_Props = {
|
|
|
35
35
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
36
36
|
"update:selectedRows": (value: any[]) => any;
|
|
37
37
|
"update:selectAll": (value: boolean) => any;
|
|
38
|
+
"task-click": (payload: {
|
|
39
|
+
task: IGanttTask;
|
|
40
|
+
row: any;
|
|
41
|
+
}) => any;
|
|
42
|
+
"task-dblclick": (payload: {
|
|
43
|
+
task: IGanttTask;
|
|
44
|
+
row: any;
|
|
45
|
+
}) => any;
|
|
46
|
+
"task-contextmenu": (payload: any) => any;
|
|
47
|
+
"task-rightclick": (payload: any) => any;
|
|
38
48
|
"update:task": (payload: {
|
|
39
49
|
task: IGanttTask;
|
|
40
50
|
sourceRow: any;
|
|
@@ -43,6 +53,16 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
43
53
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
44
54
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
45
55
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
56
|
+
"onTask-click"?: ((payload: {
|
|
57
|
+
task: IGanttTask;
|
|
58
|
+
row: any;
|
|
59
|
+
}) => any) | undefined;
|
|
60
|
+
"onTask-dblclick"?: ((payload: {
|
|
61
|
+
task: IGanttTask;
|
|
62
|
+
row: any;
|
|
63
|
+
}) => any) | undefined;
|
|
64
|
+
"onTask-contextmenu"?: ((payload: any) => any) | undefined;
|
|
65
|
+
"onTask-rightclick"?: ((payload: any) => any) | undefined;
|
|
46
66
|
"onUpdate:task"?: ((payload: {
|
|
47
67
|
task: IGanttTask;
|
|
48
68
|
sourceRow: any;
|
|
@@ -27,6 +27,36 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
27
27
|
wrapperEl: HTMLElement | null;
|
|
28
28
|
}) => any;
|
|
29
29
|
"cell-mouseenter": (rowId: any) => any;
|
|
30
|
+
"task-click": (payload: {
|
|
31
|
+
task: IGanttTask;
|
|
32
|
+
row: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
"task-dblclick": (payload: {
|
|
35
|
+
task: IGanttTask;
|
|
36
|
+
row: any;
|
|
37
|
+
}) => any;
|
|
38
|
+
"task-contextmenu": (payload: {
|
|
39
|
+
event: MouseEvent;
|
|
40
|
+
task: IGanttTask;
|
|
41
|
+
row: any;
|
|
42
|
+
ctrlKey: boolean;
|
|
43
|
+
shiftKey: boolean;
|
|
44
|
+
altKey: boolean;
|
|
45
|
+
metaKey: boolean;
|
|
46
|
+
clientX: number;
|
|
47
|
+
clientY: number;
|
|
48
|
+
}) => any;
|
|
49
|
+
"task-rightclick": (payload: {
|
|
50
|
+
event: MouseEvent;
|
|
51
|
+
task: IGanttTask;
|
|
52
|
+
row: any;
|
|
53
|
+
ctrlKey: boolean;
|
|
54
|
+
shiftKey: boolean;
|
|
55
|
+
altKey: boolean;
|
|
56
|
+
metaKey: boolean;
|
|
57
|
+
clientX: number;
|
|
58
|
+
clientY: number;
|
|
59
|
+
}) => any;
|
|
30
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
61
|
"onTask-dragstart"?: ((payload: {
|
|
32
62
|
event: MouseEvent;
|
|
@@ -36,6 +66,36 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
36
66
|
wrapperEl: HTMLElement | null;
|
|
37
67
|
}) => any) | undefined;
|
|
38
68
|
"onCell-mouseenter"?: ((rowId: any) => any) | undefined;
|
|
69
|
+
"onTask-click"?: ((payload: {
|
|
70
|
+
task: IGanttTask;
|
|
71
|
+
row: any;
|
|
72
|
+
}) => any) | undefined;
|
|
73
|
+
"onTask-dblclick"?: ((payload: {
|
|
74
|
+
task: IGanttTask;
|
|
75
|
+
row: any;
|
|
76
|
+
}) => any) | undefined;
|
|
77
|
+
"onTask-contextmenu"?: ((payload: {
|
|
78
|
+
event: MouseEvent;
|
|
79
|
+
task: IGanttTask;
|
|
80
|
+
row: any;
|
|
81
|
+
ctrlKey: boolean;
|
|
82
|
+
shiftKey: boolean;
|
|
83
|
+
altKey: boolean;
|
|
84
|
+
metaKey: boolean;
|
|
85
|
+
clientX: number;
|
|
86
|
+
clientY: number;
|
|
87
|
+
}) => any) | undefined;
|
|
88
|
+
"onTask-rightclick"?: ((payload: {
|
|
89
|
+
event: MouseEvent;
|
|
90
|
+
task: IGanttTask;
|
|
91
|
+
row: any;
|
|
92
|
+
ctrlKey: boolean;
|
|
93
|
+
shiftKey: boolean;
|
|
94
|
+
altKey: boolean;
|
|
95
|
+
metaKey: boolean;
|
|
96
|
+
clientX: number;
|
|
97
|
+
clientY: number;
|
|
98
|
+
}) => any) | undefined;
|
|
39
99
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
100
|
declare const _default: typeof __VLS_export;
|
|
41
101
|
export default _default;
|
|
@@ -17,16 +17,19 @@
|
|
|
17
17
|
:style="getBarStyle(task)"
|
|
18
18
|
:title="task[titleField] || ''"
|
|
19
19
|
:class="[{ 'is-dragging': isDraggingThisTask(task.id) }, 'gantt-bar--' + getTaskAppearance(task)]"
|
|
20
|
-
@mousedown="editable ? $emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'move', wrapperEl: wrapperRef }) : null"
|
|
20
|
+
@mousedown.left="editable ? $emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'move', wrapperEl: wrapperRef }) : null"
|
|
21
|
+
@click.left.stop="$emit('task-click', { task, row })"
|
|
22
|
+
@dblclick.left.stop="$emit('task-dblclick', { task, row })"
|
|
23
|
+
@contextmenu.stop="onContextMenu($event, task)"
|
|
21
24
|
)
|
|
22
25
|
.gantt-resize-handle.left(
|
|
23
26
|
v-if="editable"
|
|
24
|
-
@mousedown.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-left', wrapperEl: wrapperRef })"
|
|
27
|
+
@mousedown.left.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-left', wrapperEl: wrapperRef })"
|
|
25
28
|
)
|
|
26
29
|
span.gantt-title {{ task[titleField] || '' }}
|
|
27
30
|
.gantt-resize-handle.right(
|
|
28
31
|
v-if="editable"
|
|
29
|
-
@mousedown.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-right', wrapperEl: wrapperRef })"
|
|
32
|
+
@mousedown.left.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-right', wrapperEl: wrapperRef })"
|
|
30
33
|
)
|
|
31
34
|
</template>
|
|
32
35
|
|
|
@@ -58,8 +61,28 @@ const props = defineProps<{
|
|
|
58
61
|
const emit = defineEmits<{
|
|
59
62
|
(e: 'task-dragstart', payload: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null }): void
|
|
60
63
|
(e: 'cell-mouseenter', rowId: any): void
|
|
64
|
+
(e: 'task-click', payload: { task: IGanttTask; row: any }): void
|
|
65
|
+
(e: 'task-dblclick', payload: { task: IGanttTask; row: any }): void
|
|
66
|
+
(e: 'task-contextmenu', payload: { event: MouseEvent; task: IGanttTask; row: any; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; clientX: number; clientY: number }): void
|
|
67
|
+
(e: 'task-rightclick', payload: { event: MouseEvent; task: IGanttTask; row: any; ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; clientX: number; clientY: number }): void
|
|
61
68
|
}>()
|
|
62
69
|
|
|
70
|
+
const onContextMenu = (event: MouseEvent, task: IGanttTask) => {
|
|
71
|
+
const payload = {
|
|
72
|
+
event,
|
|
73
|
+
task,
|
|
74
|
+
row: props.row,
|
|
75
|
+
ctrlKey: event.ctrlKey,
|
|
76
|
+
shiftKey: event.shiftKey,
|
|
77
|
+
altKey: event.altKey,
|
|
78
|
+
metaKey: event.metaKey,
|
|
79
|
+
clientX: event.clientX,
|
|
80
|
+
clientY: event.clientY
|
|
81
|
+
}
|
|
82
|
+
emit('task-contextmenu', payload)
|
|
83
|
+
emit('task-rightclick', payload)
|
|
84
|
+
}
|
|
85
|
+
|
|
63
86
|
const wrapperRef = ref<HTMLElement | null>(null)
|
|
64
87
|
|
|
65
88
|
const onCellMouseEnter = () => {
|
|
@@ -27,6 +27,36 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
27
27
|
wrapperEl: HTMLElement | null;
|
|
28
28
|
}) => any;
|
|
29
29
|
"cell-mouseenter": (rowId: any) => any;
|
|
30
|
+
"task-click": (payload: {
|
|
31
|
+
task: IGanttTask;
|
|
32
|
+
row: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
"task-dblclick": (payload: {
|
|
35
|
+
task: IGanttTask;
|
|
36
|
+
row: any;
|
|
37
|
+
}) => any;
|
|
38
|
+
"task-contextmenu": (payload: {
|
|
39
|
+
event: MouseEvent;
|
|
40
|
+
task: IGanttTask;
|
|
41
|
+
row: any;
|
|
42
|
+
ctrlKey: boolean;
|
|
43
|
+
shiftKey: boolean;
|
|
44
|
+
altKey: boolean;
|
|
45
|
+
metaKey: boolean;
|
|
46
|
+
clientX: number;
|
|
47
|
+
clientY: number;
|
|
48
|
+
}) => any;
|
|
49
|
+
"task-rightclick": (payload: {
|
|
50
|
+
event: MouseEvent;
|
|
51
|
+
task: IGanttTask;
|
|
52
|
+
row: any;
|
|
53
|
+
ctrlKey: boolean;
|
|
54
|
+
shiftKey: boolean;
|
|
55
|
+
altKey: boolean;
|
|
56
|
+
metaKey: boolean;
|
|
57
|
+
clientX: number;
|
|
58
|
+
clientY: number;
|
|
59
|
+
}) => any;
|
|
30
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
61
|
"onTask-dragstart"?: ((payload: {
|
|
32
62
|
event: MouseEvent;
|
|
@@ -36,6 +66,36 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
36
66
|
wrapperEl: HTMLElement | null;
|
|
37
67
|
}) => any) | undefined;
|
|
38
68
|
"onCell-mouseenter"?: ((rowId: any) => any) | undefined;
|
|
69
|
+
"onTask-click"?: ((payload: {
|
|
70
|
+
task: IGanttTask;
|
|
71
|
+
row: any;
|
|
72
|
+
}) => any) | undefined;
|
|
73
|
+
"onTask-dblclick"?: ((payload: {
|
|
74
|
+
task: IGanttTask;
|
|
75
|
+
row: any;
|
|
76
|
+
}) => any) | undefined;
|
|
77
|
+
"onTask-contextmenu"?: ((payload: {
|
|
78
|
+
event: MouseEvent;
|
|
79
|
+
task: IGanttTask;
|
|
80
|
+
row: any;
|
|
81
|
+
ctrlKey: boolean;
|
|
82
|
+
shiftKey: boolean;
|
|
83
|
+
altKey: boolean;
|
|
84
|
+
metaKey: boolean;
|
|
85
|
+
clientX: number;
|
|
86
|
+
clientY: number;
|
|
87
|
+
}) => any) | undefined;
|
|
88
|
+
"onTask-rightclick"?: ((payload: {
|
|
89
|
+
event: MouseEvent;
|
|
90
|
+
task: IGanttTask;
|
|
91
|
+
row: any;
|
|
92
|
+
ctrlKey: boolean;
|
|
93
|
+
shiftKey: boolean;
|
|
94
|
+
altKey: boolean;
|
|
95
|
+
metaKey: boolean;
|
|
96
|
+
clientX: number;
|
|
97
|
+
clientY: number;
|
|
98
|
+
}) => any) | undefined;
|
|
39
99
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
100
|
declare const _default: typeof __VLS_export;
|
|
41
101
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { KMultiTabsTab } from '#toolkit/components/KMultiTabs/KMultiTabs.logic';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
groups: any[];
|
|
3
|
-
addTab: (tab:
|
|
4
|
-
splitScreen: (initialTab?:
|
|
4
|
+
addTab: (tab: KMultiTabsTab, groupId?: string) => void;
|
|
5
|
+
splitScreen: (initialTab?: KMultiTabsTab) => string;
|
|
5
6
|
closeSplit: (groupId: string) => void;
|
|
6
7
|
};
|
|
7
8
|
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,33 +1,38 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
KGrid.multi-tabs(direction="row" align="stretch" flexChild)
|
|
2
|
+
KGrid.k-multi-tabs(direction="row" align="stretch" flexChild)
|
|
3
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")
|
|
4
|
+
KTabs.k-multi-tabs-tabs(v-if="group.tabs && group.tabs.length > 0")
|
|
5
5
|
KTabItem(v-for="tab in group.tabs" :key="tab.id" :title="tab.title" :isOpen="tab.isOpen")
|
|
6
|
-
.multi-tabs-tab-content
|
|
6
|
+
.k-multi-tabs-tab-content
|
|
7
7
|
slot(:name="tab.slotName || tab.id" :tab="tab")
|
|
8
8
|
component(v-if="tab.component" :is="tab.component" v-bind="tab.props")
|
|
9
|
-
.multi-tabs-empty(v-else)
|
|
9
|
+
.k-multi-tabs-empty(v-else)
|
|
10
10
|
slot(name="empty" :group="group")
|
|
11
|
-
span No tabs open
|
|
11
|
+
span {{ t('No tabs open') }}
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script lang="ts" setup>
|
|
15
|
+
import type { KMultiTabsTab } from '#toolkit/components/KMultiTabs/KMultiTabs.logic'
|
|
16
|
+
import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
|
|
17
|
+
|
|
15
18
|
const props = defineProps<{
|
|
16
19
|
groups: any[]
|
|
17
|
-
addTab: (tab:
|
|
18
|
-
splitScreen: (initialTab?:
|
|
20
|
+
addTab: (tab: KMultiTabsTab, groupId?: string) => void
|
|
21
|
+
splitScreen: (initialTab?: KMultiTabsTab) => string
|
|
19
22
|
closeSplit: (groupId: string) => void
|
|
20
23
|
}>()
|
|
24
|
+
|
|
25
|
+
const { t } = useKatluxI18n()
|
|
21
26
|
</script>
|
|
22
27
|
|
|
23
28
|
<style lang="scss" scoped>
|
|
24
|
-
.multi-tabs {
|
|
29
|
+
.k-multi-tabs {
|
|
25
30
|
width: 100%;
|
|
26
31
|
height: 100%;
|
|
27
32
|
overflow: hidden;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
.multi-tabs-empty {
|
|
35
|
+
.k-multi-tabs-empty {
|
|
31
36
|
display: flex;
|
|
32
37
|
align-items: center;
|
|
33
38
|
justify-content: center;
|
|
@@ -35,19 +40,19 @@ const props = defineProps<{
|
|
|
35
40
|
flex: 1 1 0%;
|
|
36
41
|
min-width: 0;
|
|
37
42
|
}
|
|
38
|
-
.multi-tabs-tabs {
|
|
39
|
-
|
|
43
|
+
.k-multi-tabs-tabs {
|
|
44
|
+
box-sizing: border-box;
|
|
40
45
|
|
|
41
46
|
flex: 1 1 0%;
|
|
42
47
|
min-width: 0;
|
|
43
48
|
display: flex;
|
|
44
49
|
flex-direction: column;
|
|
45
50
|
> * {
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
height: 100%;
|
|
52
|
+
min-width: 0;
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
.multi-tabs-tab-content {
|
|
55
|
+
.k-multi-tabs-tab-content {
|
|
51
56
|
display: flex;
|
|
52
57
|
flex-direction: column;
|
|
53
58
|
height: 100%;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { KMultiTabsTab } from '#toolkit/components/KMultiTabs/KMultiTabs.logic';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
groups: any[];
|
|
3
|
-
addTab: (tab:
|
|
4
|
-
splitScreen: (initialTab?:
|
|
4
|
+
addTab: (tab: KMultiTabsTab, groupId?: string) => void;
|
|
5
|
+
splitScreen: (initialTab?: KMultiTabsTab) => string;
|
|
5
6
|
closeSplit: (groupId: string) => void;
|
|
6
7
|
};
|
|
7
8
|
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>;
|
|
@@ -38,3 +38,4 @@ If the Katlux MCP server is unavailable in the environment, or when deep archite
|
|
|
38
38
|
2. **Icon & Token Lookup**: Use `katlux_list_icons` to verify icon names and `katlux_get_tokens` for theme variables instead of guessing or hardcoding styles.
|
|
39
39
|
3. **Self-Validation**: Run `katlux_validate_code` on newly generated Pug/Vue templates to self-correct issues before delivering code.
|
|
40
40
|
4. **Atomic Skills**: Component and Provider skills are divided into atomic, per-component and per-provider markdown files under `components/` and `providers/`. Read only the specific atomic spec required for your task to preserve tokens.
|
|
41
|
+
5. **Never Inspect node_modules**: Never search or open files in `node_modules/@katlux/*` or `node_modules/`. All component APIs, props, slots, events, providers, and types are documented in Katlux MCP tools and atomic skill files.
|
|
@@ -18,7 +18,7 @@ description: Complete Katlux UI component API index. Links to atomic component d
|
|
|
18
18
|
| `KPanel` | Bordered card/surface container | Header, body, footer, collapsibility, elevation | [KPanel.md](components/KPanel.md) |
|
|
19
19
|
| `KAccordion` | Collapsible accordion sections | Single or multi-expand modes, animated transitions | [KAccordion.md](components/KAccordion.md) |
|
|
20
20
|
| `KTabs` / `KTabItem` | WAI-ARIA tab navigation bar | Keyboard navigation, active indicator, customizable tab headers | [KTabs.md](components/KTabs.md) |
|
|
21
|
-
| `MultiTabs` | Multi-pane split screen workspace | Dynamic vertical panes, tab grouping, pane closure | [
|
|
21
|
+
| `KMultiTabs` / `MultiTabs` | Multi-pane split screen workspace | Dynamic vertical panes, tab grouping, pane closure | [KMultiTabs.md](components/KMultiTabs.md) |
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -26,3 +26,62 @@
|
|
|
26
26
|
| `itemHeight` | `number` | `40` | Fixed height in px for each resource row |
|
|
27
27
|
| `viewportHeight` | `number` | `500` | Height in px of the scrollable viewport |
|
|
28
28
|
| `buffer` | `number` | `5` | Number of off-screen buffer rows rendered above/below |
|
|
29
|
+
|
|
30
|
+
- **Events**:
|
|
31
|
+
| Event | Payload | Description |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `@task-click` | `{ task: IGanttTask, row: any }` | Triggered when a timeline task bar is clicked (suppressed during drag/resize) |
|
|
34
|
+
| `@task-dblclick` | `{ task: IGanttTask, row: any }` | Triggered when a timeline task bar is double-clicked |
|
|
35
|
+
| `@task-contextmenu` / `@task-rightclick` | `{ event: MouseEvent, task: IGanttTask, row: any, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, clientX: number, clientY: number }` | Triggered on right-click over a timeline task bar. Includes full `event` and keyboard modifier flags for custom context menus or modifier actions. |
|
|
36
|
+
| `@update:task` | `{ task: IGanttTask, sourceRow: any, targetRow?: any }` | Triggered when a task bar is dragged, resized, or moved across rows and dropped |
|
|
37
|
+
| `@update:selectedRows` | `any[]` | Triggered when row selection checkboxes change |
|
|
38
|
+
| `@update:selectAll` | `boolean` | Triggered when global select all changes |
|
|
39
|
+
|
|
40
|
+
- **Opening a Modal or Custom Context Menu on Task Click / Right-Click (Pug)**:
|
|
41
|
+
```pug
|
|
42
|
+
KGantt(
|
|
43
|
+
:dataProvider="ganttProvider"
|
|
44
|
+
:columns="columns"
|
|
45
|
+
@task-click="handleTaskClick"
|
|
46
|
+
@task-contextmenu="handleTaskRightClick"
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
//- Custom Context Menu or Modal
|
|
50
|
+
KContextMenu(v-model:isOpen="isContextMenuOpen" :x="menuPos.x" :y="menuPos.y")
|
|
51
|
+
div Menu Content
|
|
52
|
+
|
|
53
|
+
KModal(v-model="isModalOpen" :title="activeTask?.title || 'Task Details'")
|
|
54
|
+
p(v-if="activeTask") Task ID: \#{{ activeTask.id }}
|
|
55
|
+
p(v-if="activeTask") Resource: \#{{ activeRow?.name }}
|
|
56
|
+
```
|
|
57
|
+
```typescript
|
|
58
|
+
const isModalOpen = ref(false)
|
|
59
|
+
const isContextMenuOpen = ref(false)
|
|
60
|
+
const menuPos = ref({ x: 0, y: 0 })
|
|
61
|
+
const activeTask = ref(null)
|
|
62
|
+
const activeRow = ref(null)
|
|
63
|
+
|
|
64
|
+
const handleTaskClick = ({ task, row }: { task: any, row: any }) => {
|
|
65
|
+
activeTask.value = task
|
|
66
|
+
activeRow.value = row
|
|
67
|
+
isModalOpen.value = true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const handleTaskRightClick = ({ event, task, row, ctrlKey, shiftKey, clientX, clientY }: any) => {
|
|
71
|
+
event.preventDefault() // Suppress browser default context menu
|
|
72
|
+
activeTask.value = task
|
|
73
|
+
activeRow.value = row
|
|
74
|
+
|
|
75
|
+
if (ctrlKey || shiftKey) {
|
|
76
|
+
// Modifier-specific action (e.g. multi-select or quick inspect)
|
|
77
|
+
console.log('Modifier right click', { ctrlKey, shiftKey })
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Position and open custom context menu
|
|
82
|
+
menuPos.value = { x: clientX, y: clientY }
|
|
83
|
+
isContextMenuOpen.value = true
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### `KMultiTabs` / `MultiTabs`
|
|
2
|
+
- **Purpose**: Manage complex layouts involving multiple tabs and vertical split screens dynamically.
|
|
3
|
+
- **Props**:
|
|
4
|
+
| Prop | Type | Default | Description |
|
|
5
|
+
| --- | --- | --- | --- |
|
|
6
|
+
| `v-model` | `KMultiTabsGroup[]` | **Required** | The active groupings of tabs. Each group represents a vertical split pane. |
|
|
7
|
+
- **Methods (Exposed via `ref`)**:
|
|
8
|
+
| Method | Params | Description |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| `addTab(tab, groupId?)` | `(tab: KMultiTabsTab, groupId?: string)` | Opens a new tab within the specified group (or defaults to the first group). |
|
|
11
|
+
| `splitScreen(initialTab?)` | `(initialTab?: KMultiTabsTab)` | Creates a new vertical pane to the right, optionally initializing it with a tab. |
|
|
12
|
+
| `closeSplit(groupId)` | `(groupId: string)` | Closes the specified split screen pane. |
|
|
13
|
+
- **Slots**:
|
|
14
|
+
| Slot | Scope | Description |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| `#tab-[id]` | `{ tab: KMultiTabsTab }` | Render custom content for a specific tab by its ID. |
|
|
17
|
+
| `#empty` | `{ group: KMultiTabsGroup }` | Fallback content shown in a pane when it contains no tabs. |
|
|
18
|
+
- **Associated Types**:
|
|
19
|
+
- **`KMultiTabsGroup`** (alias: `MultiTabsGroup`): `{ id: string, tabs: KMultiTabsTab[] }`
|
|
20
|
+
- **`KMultiTabsTab`** (alias: `MultiTabsTab`): `{ id: string, title: string, isOpen: boolean }`
|
|
@@ -104,13 +104,13 @@ export default defineAppConfig({
|
|
|
104
104
|
|
|
105
105
|
| Package Name | Current Version | Description | Installation Command |
|
|
106
106
|
| --- | --- | --- | --- |
|
|
107
|
-
| `@katlux/toolkit` | `0.1.1-alpha.
|
|
108
|
-
| `@katlux/providers` | `0.1.1-alpha.
|
|
109
|
-
| `@katlux/preset-modern` | `0.1.1-alpha.
|
|
110
|
-
| `@katlux/preset-dark` | `0.1.1-alpha.
|
|
111
|
-
| `@katlux/block-charts` | `0.1.1-alpha.
|
|
112
|
-
| `@katlux/block-ecommerce` | `0.1.1-alpha.
|
|
113
|
-
| `@katlux/mcp` | `0.1.0-alpha.
|
|
107
|
+
| `@katlux/toolkit` | `0.1.1-alpha.131` | Core Nuxt module, UI toolkit, presets, and components | `npm install @katlux/toolkit@alpha` |
|
|
108
|
+
| `@katlux/providers` | `0.1.1-alpha.118` | Core data providers, client caching, and state structures | `npm install @katlux/providers@alpha` |
|
|
109
|
+
| `@katlux/preset-modern` | `0.1.1-alpha.106` | Modern design preset and styling variables | `npm install @katlux/preset-modern@alpha` |
|
|
110
|
+
| `@katlux/preset-dark` | `0.1.1-alpha.37` | Sleek Dark Mode design preset | `npm install @katlux/preset-dark@alpha` |
|
|
111
|
+
| `@katlux/block-charts` | `0.1.1-alpha.106` | Pre-built charting block components | `npm install @katlux/block-charts@alpha` |
|
|
112
|
+
| `@katlux/block-ecommerce` | `0.1.1-alpha.106` | Pre-built eCommerce block components | `npm install @katlux/block-ecommerce@alpha` |
|
|
113
|
+
| `@katlux/mcp` | `0.1.0-alpha.10` | Model Context Protocol server for AI assistant integration | `npm install @katlux/mcp@alpha` |
|
|
114
114
|
|
|
115
115
|
> [!NOTE]
|
|
116
116
|
> Katlux packages are currently published under the `@alpha` tag on NPM. Always append `@alpha` or the specific version tag when adding dependencies.
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module.mjs'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
1
|
export { default } from './module.mjs'
|
|
2
|
+
|
|
3
|
+
export { type ModuleOptions } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@katlux/toolkit",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.132",
|
|
4
4
|
"description": "Core UI toolkit and utilities for the Katlux ecosystem",
|
|
5
5
|
"author": "Katlux",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"katlux-add-ref": "./bin/add-ai-reference.mjs"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "nuxt-module-build build && unbuild && node -e \"const fs=require('fs'); fs.mkdirSync('dist/runtime', {recursive:true}); fs.cpSync('src/runtime/presets', 'dist/runtime/presets', {recursive:true}); const clean=(d)=>{if(!fs.existsSync(d))return;for(const f of fs.readdirSync(d,{withFileTypes:true})){const p=d+'/'+f.name;if(f.isDirectory())clean(p);else if(f.name.includes('.spec.'))fs.unlinkSync(p);}};clean('dist'); const sRoot='../../.agents/skills'; if(fs.existsSync(sRoot)){fs.mkdirSync('dist/skills', {recursive:true}); fs.cpSync(sRoot, 'dist/skills', {recursive:true, filter:(s)=>!s.includes('
|
|
18
|
+
"build": "nuxt-module-build build && unbuild && node -e \"const fs=require('fs'); fs.mkdirSync('dist/runtime', {recursive:true}); fs.cpSync('src/runtime/presets', 'dist/runtime/presets', {recursive:true}); const clean=(d)=>{if(!fs.existsSync(d))return;for(const f of fs.readdirSync(d,{withFileTypes:true})){const p=d+'/'+f.name;if(f.isDirectory())clean(p);else if(f.name.includes('.spec.'))fs.unlinkSync(p);}};clean('dist'); const sRoot='../../.agents/skills'; if(fs.existsSync(sRoot)){fs.mkdirSync('dist/skills', {recursive:true}); fs.cpSync(sRoot, 'dist/skills', {recursive:true, filter:(s)=>!s.includes('.DS_Store')});}\"",
|
|
19
19
|
"dev": "nuxt-module-build build --stub",
|
|
20
20
|
"prepare": "nuxi prepare",
|
|
21
21
|
"prepublishOnly": "npm run build"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"**/*.sass"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@katlux/providers": "^0.1.1-alpha.
|
|
57
|
+
"@katlux/providers": "^0.1.1-alpha.119",
|
|
58
58
|
"@nuxt/kit": "^3.12.0",
|
|
59
59
|
"@nuxtjs/i18n": "^10.4.0",
|
|
60
60
|
"pug": "^3.0.0",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type PropType } from 'vue';
|
|
2
|
-
export interface MultiTabsTab {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
slotName?: string;
|
|
6
|
-
component?: any;
|
|
7
|
-
props?: Record<string, any>;
|
|
8
|
-
isOpen?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface MultiTabsGroup {
|
|
11
|
-
id: string;
|
|
12
|
-
tabs: MultiTabsTab[];
|
|
13
|
-
}
|
|
14
|
-
export declare const MultiTabsDefaultProps: {
|
|
15
|
-
modelValue: {
|
|
16
|
-
type: PropType<MultiTabsGroup[]>;
|
|
17
|
-
default: undefined;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare function useMultiTabsLogic(props: any, emit: any): {
|
|
21
|
-
groups: import("vue").WritableComputedRef<MultiTabsGroup[], MultiTabsGroup[]>;
|
|
22
|
-
addTab: (tab: MultiTabsTab, groupId?: string) => void;
|
|
23
|
-
splitScreen: (initialTab?: MultiTabsTab) => string;
|
|
24
|
-
closeSplit: (groupId: string) => void;
|
|
25
|
-
};
|