@katlux/toolkit 0.1.1-alpha.129 → 0.1.1-alpha.131
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 +85 -46
- package/dist/module.json +1 -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/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
- 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/KDropdown/KDropdown.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.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/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +20 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +26 -1
- 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 +23 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +60 -0
- package/dist/skills/KATLUX_INDEX.md +41 -0
- package/dist/skills/katlux-components/SKILL.md +106 -0
- package/dist/skills/katlux-components/components/KAccordion.md +27 -0
- package/dist/skills/katlux-components/components/KAlert.md +22 -0
- package/dist/skills/katlux-components/components/KAreaChart.md +19 -0
- package/dist/skills/katlux-components/components/KBarChart.md +20 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +19 -0
- package/dist/skills/katlux-components/components/KButton.md +12 -0
- package/dist/skills/katlux-components/components/KCalendar.md +17 -0
- package/dist/skills/katlux-components/components/KCheckbox.md +15 -0
- package/dist/skills/katlux-components/components/KCombobox.md +41 -0
- package/dist/skills/katlux-components/components/KCompositeInput.md +67 -0
- package/dist/skills/katlux-components/components/KContextMenu.md +20 -0
- package/dist/skills/katlux-components/components/KDataIterator.md +35 -0
- package/dist/skills/katlux-components/components/KDatatable.md +55 -0
- package/dist/skills/katlux-components/components/KDatePicker.md +26 -0
- package/dist/skills/katlux-components/components/KDropdown.md +18 -0
- package/dist/skills/katlux-components/components/KGantt.md +87 -0
- package/dist/skills/katlux-components/components/KGrid.md +17 -0
- package/dist/skills/katlux-components/components/KHeatMap.md +32 -0
- package/dist/skills/katlux-components/components/KHourSelect.md +11 -0
- package/dist/skills/katlux-components/components/KIcon.md +5 -0
- package/dist/skills/katlux-components/components/KLayout.md +34 -0
- package/dist/skills/katlux-components/components/KLineChart.md +18 -0
- package/dist/skills/katlux-components/components/KLoader.md +7 -0
- package/dist/skills/katlux-components/components/KMaskTextbox.md +12 -0
- package/dist/skills/katlux-components/components/KModal.md +22 -0
- package/dist/skills/katlux-components/components/KPagination.md +22 -0
- package/dist/skills/katlux-components/components/KPanel.md +18 -0
- package/dist/skills/katlux-components/components/KPieChart.md +14 -0
- package/dist/skills/katlux-components/components/KProductList.md +42 -0
- package/dist/skills/katlux-components/components/KScatterChart.md +20 -0
- package/dist/skills/katlux-components/components/KSlider.md +28 -0
- package/dist/skills/katlux-components/components/KTabs.md +31 -0
- package/dist/skills/katlux-components/components/KTextbox.md +15 -0
- package/dist/skills/katlux-components/components/KToast.md +14 -0
- package/dist/skills/katlux-components/components/KTooltip.md +13 -0
- package/dist/skills/katlux-components/components/KTree.md +45 -0
- package/dist/skills/katlux-components/components/KTreePicker.md +35 -0
- package/dist/skills/katlux-components/components/KTreeView.md +30 -0
- package/dist/skills/katlux-components/components/MultiTabs.md +20 -0
- package/dist/skills/katlux-components/components/calendar-customization.md +6 -0
- package/dist/skills/katlux-components/components/datatable-customization.md +14 -0
- package/dist/skills/katlux-components/components/directives.md +11 -0
- package/dist/skills/katlux-components/components/form-validation.md +125 -0
- package/dist/skills/katlux-components/components/tree-customization.md +9 -0
- package/dist/skills/katlux-components/components/useToast.md +27 -0
- package/dist/skills/katlux-components/components/validation-directives.md +6 -0
- package/dist/skills/katlux-config/SKILL.md +156 -0
- package/dist/skills/katlux-presets/SKILL.md +356 -0
- package/dist/skills/katlux-providers/SKILL.md +64 -0
- package/dist/skills/katlux-providers/providers/ADataProvider.md +59 -0
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +28 -0
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +20 -0
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +11 -0
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +58 -0
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +14 -0
- package/dist/skills/katlux-providers/providers/CTreeServerDataProvider.md +5 -0
- package/dist/skills/katlux-providers/providers/KatluxIndexedDB.md +10 -0
- package/dist/skills/katlux-providers/providers/RequestProvider.md +49 -0
- package/dist/skills/katlux-providers/providers/RequestQueue.md +52 -0
- package/dist/skills/katlux-providers/providers/api-protocol.md +40 -0
- package/dist/skills/katlux-providers/providers/caching.md +170 -0
- package/dist/skills/katlux-providers/providers/composables.md +107 -0
- package/dist/skills/katlux-providers/providers/encryption.md +151 -0
- package/dist/skills/katlux-providers/providers/react-integration.md +45 -0
- package/dist/skills/katlux-providers/providers/testing-isolation.md +6 -0
- package/dist/skills/katlux-providers/providers/types.md +27 -0
- package/dist/skills/katlux-providers/providers/useDataProvider.md +51 -0
- package/dist/skills/katlux-tokens/SKILL.md +133 -0
- package/package.json +3 -3
package/bin/add-ai-reference.mjs
CHANGED
|
@@ -5,29 +5,26 @@
|
|
|
5
5
|
* into the current project. Safe to re-run at any time to update to the latest.
|
|
6
6
|
*
|
|
7
7
|
* What it does:
|
|
8
|
-
* 1.
|
|
9
|
-
* 2.
|
|
8
|
+
* 1. Installs .agents/skills/KATLUX_INDEX.md (always overwritten, auto-maintained)
|
|
9
|
+
* 2. Installs .agents/skills/katlux-[skill]/SKILL.md and all atomic specs under components/ & providers/
|
|
10
10
|
* 3. Scaffolds AGENTS.md (created once, never overwritten)
|
|
11
11
|
* 4. Scaffolds .agents/rules/rules.md (created once, never overwritten)
|
|
12
|
+
* 5. Auto-configures MCP server for Antigravity, Cursor, and VS Code
|
|
12
13
|
*
|
|
13
14
|
* Usage:
|
|
14
15
|
* npx @katlux/toolkit katlux-add-ref
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs'
|
|
18
|
-
import { resolve, join } from 'path'
|
|
18
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync } from 'fs'
|
|
19
|
+
import { resolve, join, dirname } from 'path'
|
|
20
|
+
import { fileURLToPath } from 'url'
|
|
19
21
|
|
|
20
|
-
const
|
|
22
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
23
|
+
const BASE_URL = process.env.KATLUX_REF_URL || 'https://katlux.dev/ai-reference'
|
|
21
24
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
'katlux-config',
|
|
26
|
-
'katlux-components',
|
|
27
|
-
'katlux-providers',
|
|
28
|
-
'katlux-presets',
|
|
29
|
-
'katlux-tokens',
|
|
30
|
-
]
|
|
25
|
+
// Local packaged skills directory inside @katlux/toolkit
|
|
26
|
+
const packagedSkillsDir = resolve(__dirname, '../dist/skills')
|
|
27
|
+
const hasPackagedSkills = existsSync(join(packagedSkillsDir, 'KATLUX_INDEX.md'))
|
|
31
28
|
|
|
32
29
|
const RESET = '\x1b[0m'
|
|
33
30
|
const GREEN = '\x1b[32m'
|
|
@@ -47,10 +44,26 @@ async function fetchText(url) {
|
|
|
47
44
|
return response.text()
|
|
48
45
|
}
|
|
49
46
|
|
|
47
|
+
function copyDirRecursive(src, dest) {
|
|
48
|
+
if (!existsSync(dest)) mkdirSync(dest, { recursive: true })
|
|
49
|
+
const entries = readdirSync(src, { withFileTypes: true })
|
|
50
|
+
let count = 0
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
const srcPath = join(src, entry.name)
|
|
53
|
+
const destPath = join(dest, entry.name)
|
|
54
|
+
if (entry.isDirectory()) {
|
|
55
|
+
count += copyDirRecursive(srcPath, destPath)
|
|
56
|
+
} else if (entry.name.endsWith('.md')) {
|
|
57
|
+
writeFileSync(destPath, readFileSync(srcPath, 'utf-8'), 'utf-8')
|
|
58
|
+
count++
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return count
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
// ── Start ────────────────────────────────────────────────────────────────────
|
|
51
65
|
console.log()
|
|
52
|
-
log(CYAN, '[katlux-add-ref]', `
|
|
53
|
-
console.log(` ${DIM}${BASE_URL}${RESET}`)
|
|
66
|
+
log(CYAN, '[katlux-add-ref]', `Installing Katlux AI skill files...`)
|
|
54
67
|
console.log()
|
|
55
68
|
|
|
56
69
|
const projectRoot = process.cwd()
|
|
@@ -62,39 +75,63 @@ const rulesDir = resolve(agentsDir, 'rules')
|
|
|
62
75
|
if (!existsSync(skillsDir)) mkdirSync(skillsDir, { recursive: true })
|
|
63
76
|
if (!existsSync(rulesDir)) mkdirSync(rulesDir, { recursive: true })
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
let installedFilesCount = 0
|
|
79
|
+
let bundleInstalled = false
|
|
80
|
+
|
|
81
|
+
// ── 1. Fetch remote skills bundle (all skills + atomic specs in 1 fast roundtrip) ──
|
|
82
|
+
process.stdout.write(` ${DIM}Fetching skills bundle from ${BASE_URL}/bundle...${RESET}`)
|
|
68
83
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
const res = await fetch(`${BASE_URL}/bundle`)
|
|
85
|
+
if (res.ok) {
|
|
86
|
+
const bundle = await res.json()
|
|
87
|
+
if (bundle.files && typeof bundle.files === 'object') {
|
|
88
|
+
for (const [relPath, content] of Object.entries(bundle.files)) {
|
|
89
|
+
const destPath = join(skillsDir, relPath)
|
|
90
|
+
const fileDir = dirname(destPath)
|
|
91
|
+
if (!existsSync(fileDir)) mkdirSync(fileDir, { recursive: true })
|
|
92
|
+
writeFileSync(destPath, content, 'utf-8')
|
|
93
|
+
installedFilesCount++
|
|
94
|
+
}
|
|
95
|
+
process.stdout.write(` ${GREEN}✔ (${installedFilesCount} files)${RESET}\n`)
|
|
96
|
+
bundleInstalled = true
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
process.stdout.write(` ${YELLOW}HTTP ${res.status}${RESET}\n`)
|
|
100
|
+
}
|
|
101
|
+
} catch {
|
|
102
|
+
process.stdout.write(` ${YELLOW}remote unavailable${RESET}\n`)
|
|
77
103
|
}
|
|
78
104
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
105
|
+
// ── 2. Fallback: Local packaged skills (works 100% offline or when remote bundle is unreachable) ──
|
|
106
|
+
if (!bundleInstalled) {
|
|
107
|
+
if (hasPackagedSkills) {
|
|
108
|
+
log(CYAN, ' local', `Installing bundled skills from @katlux/toolkit package...`)
|
|
109
|
+
installedFilesCount = copyDirRecursive(packagedSkillsDir, skillsDir)
|
|
110
|
+
log(GREEN, ' written', `${installedFilesCount} skill files installed from local toolkit`)
|
|
111
|
+
} else {
|
|
112
|
+
// ── 3. Fallback: Legacy individual HTTP fetch ────────────────────────────
|
|
113
|
+
log(YELLOW, ' fallback', `Fetching individual skills from ${BASE_URL}...`)
|
|
114
|
+
try {
|
|
115
|
+
const indexContent = await fetchText(BASE_URL).catch(() => fetchText(`${BASE_URL}/index`))
|
|
116
|
+
writeFileSync(join(skillsDir, 'KATLUX_INDEX.md'), indexContent, 'utf-8')
|
|
117
|
+
installedFilesCount++
|
|
118
|
+
} catch (err) {
|
|
119
|
+
log(RED, '[katlux-add-ref] ✖', `Failed to fetch index: ${err.message}`)
|
|
120
|
+
process.exit(1)
|
|
121
|
+
}
|
|
82
122
|
|
|
83
|
-
|
|
84
|
-
for (const skill of SKILLS) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
log(RED, '[katlux-add-ref] ✖', `Failed to fetch ${skill}:`)
|
|
96
|
-
console.log(` ${err.message}`)
|
|
97
|
-
process.exit(1)
|
|
123
|
+
const SKILLS = ['katlux-config', 'katlux-components', 'katlux-providers', 'katlux-presets', 'katlux-tokens']
|
|
124
|
+
for (const skill of SKILLS) {
|
|
125
|
+
try {
|
|
126
|
+
const content = await fetchText(`${BASE_URL}/${skill}`)
|
|
127
|
+
const skillDir = join(skillsDir, skill)
|
|
128
|
+
if (!existsSync(skillDir)) mkdirSync(skillDir, { recursive: true })
|
|
129
|
+
writeFileSync(join(skillDir, 'SKILL.md'), content, 'utf-8')
|
|
130
|
+
installedFilesCount++
|
|
131
|
+
} catch (err) {
|
|
132
|
+
log(RED, '[katlux-add-ref] ✖', `Failed to fetch ${skill}: ${err.message}`)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
98
135
|
}
|
|
99
136
|
}
|
|
100
137
|
|
|
@@ -184,9 +221,11 @@ if (existsSync(vscodeDir)) {
|
|
|
184
221
|
|
|
185
222
|
// ── Done ─────────────────────────────────────────────────────────────────────
|
|
186
223
|
console.log()
|
|
187
|
-
log(GREEN, '[katlux-add-ref] ✔', `Done! ${
|
|
224
|
+
log(GREEN, '[katlux-add-ref] ✔', `Done! ${installedFilesCount} skill files (including atomic components & providers) + index installed and MCP server configured.`)
|
|
188
225
|
console.log()
|
|
189
226
|
console.log(` ${CYAN}Skills:${RESET} .agents/skills/katlux-*/SKILL.md`)
|
|
227
|
+
console.log(` ${CYAN}Components:${RESET} .agents/skills/katlux-components/components/*.md (46 atomic specs)`)
|
|
228
|
+
console.log(` ${CYAN}Providers:${RESET} .agents/skills/katlux-providers/providers/*.md (18 atomic specs)`)
|
|
190
229
|
console.log(` ${CYAN}Index:${RESET} .agents/skills/KATLUX_INDEX.md ${DIM}(auto-updated each run)${RESET}`)
|
|
191
230
|
console.log(` ${CYAN}MCP:${RESET} @katlux/mcp server ready on stdio`)
|
|
192
231
|
console.log()
|
package/dist/module.json
CHANGED
|
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
58
|
type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
|
+
iconOnly: boolean;
|
|
59
60
|
disabled: boolean;
|
|
60
61
|
href: string;
|
|
61
62
|
loading: boolean;
|
|
62
|
-
iconOnly: boolean;
|
|
63
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
|
65
65
|
export default _default;
|
|
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
58
|
type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
|
+
iconOnly: boolean;
|
|
59
60
|
disabled: boolean;
|
|
60
61
|
href: string;
|
|
61
62
|
loading: boolean;
|
|
62
|
-
iconOnly: boolean;
|
|
63
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
|
65
65
|
export default _default;
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
76
76
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
disabled: boolean;
|
|
79
78
|
label: string;
|
|
79
|
+
disabled: boolean;
|
|
80
80
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
81
81
|
validationText: string;
|
|
82
82
|
idKey: string;
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
76
76
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
disabled: boolean;
|
|
79
78
|
label: string;
|
|
79
|
+
disabled: boolean;
|
|
80
80
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
81
81
|
validationText: string;
|
|
82
82
|
idKey: string;
|
|
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
223
223
|
}) => any) | undefined;
|
|
224
224
|
}>, {
|
|
225
225
|
modelValue: any;
|
|
226
|
-
disabled: boolean;
|
|
227
226
|
label: string;
|
|
227
|
+
disabled: boolean;
|
|
228
228
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
229
229
|
validationText: string;
|
|
230
230
|
searchbox: boolean;
|
|
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
223
223
|
}) => any) | undefined;
|
|
224
224
|
}>, {
|
|
225
225
|
modelValue: any;
|
|
226
|
-
disabled: boolean;
|
|
227
226
|
label: string;
|
|
227
|
+
disabled: boolean;
|
|
228
228
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
229
229
|
validationText: string;
|
|
230
230
|
searchbox: boolean;
|
|
@@ -40,10 +40,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
40
40
|
"onSearch-change"?: ((value: string) => any) | undefined;
|
|
41
41
|
}>, {
|
|
42
42
|
search: string;
|
|
43
|
-
loading: boolean;
|
|
44
43
|
selectedRows: any[];
|
|
45
44
|
bulkActions: IKDatatableAction[];
|
|
46
45
|
selectAll: boolean;
|
|
46
|
+
loading: boolean;
|
|
47
47
|
currentPage: number;
|
|
48
48
|
pageSize: number;
|
|
49
49
|
virtualScroll: boolean;
|
|
@@ -40,10 +40,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
|
|
|
40
40
|
"onSearch-change"?: ((value: string) => any) | undefined;
|
|
41
41
|
}>, {
|
|
42
42
|
search: string;
|
|
43
|
-
loading: boolean;
|
|
44
43
|
selectedRows: any[];
|
|
45
44
|
bulkActions: IKDatatableAction[];
|
|
46
45
|
selectAll: boolean;
|
|
46
|
+
loading: boolean;
|
|
47
47
|
currentPage: number;
|
|
48
48
|
pageSize: number;
|
|
49
49
|
virtualScroll: boolean;
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
teleportTo: string;
|
|
67
67
|
fullWidth: boolean;
|
|
68
68
|
maxHeight: number;
|
|
69
|
-
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
70
69
|
anchorEl: HTMLElement;
|
|
70
|
+
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
declare const _default: typeof __VLS_export;
|
|
73
73
|
export default _default;
|
|
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
66
|
teleportTo: string;
|
|
67
67
|
fullWidth: boolean;
|
|
68
68
|
maxHeight: number;
|
|
69
|
-
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
70
69
|
anchorEl: HTMLElement;
|
|
70
|
+
align: import("./KDropdown.logic.js").KDropdownAlign;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
declare const _default: typeof __VLS_export;
|
|
73
73
|
export default _default;
|
|
@@ -89,6 +89,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
89
89
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
90
90
|
"update:selectedRows": (...args: any[]) => void;
|
|
91
91
|
"update:selectAll": (...args: any[]) => void;
|
|
92
|
+
"task-click": (...args: any[]) => void;
|
|
93
|
+
"task-dblclick": (...args: any[]) => void;
|
|
94
|
+
"task-contextmenu": (...args: any[]) => void;
|
|
95
|
+
"task-rightclick": (...args: any[]) => void;
|
|
92
96
|
"update:task": (...args: any[]) => void;
|
|
93
97
|
"update:startingPoint": (...args: any[]) => void;
|
|
94
98
|
"update:endingPoint": (...args: any[]) => void;
|
|
@@ -180,6 +184,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
180
184
|
}>> & Readonly<{
|
|
181
185
|
"onUpdate:selectedRows"?: ((...args: any[]) => any) | undefined;
|
|
182
186
|
"onUpdate:selectAll"?: ((...args: any[]) => any) | undefined;
|
|
187
|
+
"onTask-click"?: ((...args: any[]) => any) | undefined;
|
|
188
|
+
"onTask-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
189
|
+
"onTask-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
190
|
+
"onTask-rightclick"?: ((...args: any[]) => any) | undefined;
|
|
183
191
|
"onUpdate:task"?: ((...args: any[]) => any) | undefined;
|
|
184
192
|
"onUpdate:startingPoint"?: ((...args: any[]) => any) | undefined;
|
|
185
193
|
"onUpdate:endingPoint"?: ((...args: any[]) => any) | undefined;
|
|
@@ -15,7 +15,17 @@ const {
|
|
|
15
15
|
selectedRows,
|
|
16
16
|
selectAll
|
|
17
17
|
} = useKGanttLogic(props);
|
|
18
|
-
const emit = defineEmits([
|
|
18
|
+
const emit = defineEmits([
|
|
19
|
+
"update:startingPoint",
|
|
20
|
+
"update:endingPoint",
|
|
21
|
+
"update:task",
|
|
22
|
+
"update:selectedRows",
|
|
23
|
+
"update:selectAll",
|
|
24
|
+
"task-click",
|
|
25
|
+
"task-dblclick",
|
|
26
|
+
"task-contextmenu",
|
|
27
|
+
"task-rightclick"
|
|
28
|
+
]);
|
|
19
29
|
const moveTime = (amount) => {
|
|
20
30
|
const result = moveTimeLogic(amount, props.startingPoint, props.endingPoint);
|
|
21
31
|
if (result) {
|
|
@@ -73,5 +83,9 @@ component(
|
|
|
73
83
|
@update:task="$emit('update:task', $event)"
|
|
74
84
|
@update:selectedRows="$emit('update:selectedRows', $event)"
|
|
75
85
|
@update:selectAll="$emit('update:selectAll', $event)"
|
|
86
|
+
@task-click="$emit('task-click', $event)"
|
|
87
|
+
@task-dblclick="$emit('task-dblclick', $event)"
|
|
88
|
+
@task-contextmenu="$emit('task-contextmenu', $event)"
|
|
89
|
+
@task-rightclick="$emit('task-rightclick', $event)"
|
|
76
90
|
)
|
|
77
91
|
</template>
|
|
@@ -89,6 +89,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
89
89
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
90
90
|
"update:selectedRows": (...args: any[]) => void;
|
|
91
91
|
"update:selectAll": (...args: any[]) => void;
|
|
92
|
+
"task-click": (...args: any[]) => void;
|
|
93
|
+
"task-dblclick": (...args: any[]) => void;
|
|
94
|
+
"task-contextmenu": (...args: any[]) => void;
|
|
95
|
+
"task-rightclick": (...args: any[]) => void;
|
|
92
96
|
"update:task": (...args: any[]) => void;
|
|
93
97
|
"update:startingPoint": (...args: any[]) => void;
|
|
94
98
|
"update:endingPoint": (...args: any[]) => void;
|
|
@@ -180,6 +184,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
180
184
|
}>> & Readonly<{
|
|
181
185
|
"onUpdate:selectedRows"?: ((...args: any[]) => any) | undefined;
|
|
182
186
|
"onUpdate:selectAll"?: ((...args: any[]) => any) | undefined;
|
|
187
|
+
"onTask-click"?: ((...args: any[]) => any) | undefined;
|
|
188
|
+
"onTask-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
189
|
+
"onTask-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
190
|
+
"onTask-rightclick"?: ((...args: any[]) => any) | undefined;
|
|
183
191
|
"onUpdate:task"?: ((...args: any[]) => any) | undefined;
|
|
184
192
|
"onUpdate:startingPoint"?: ((...args: any[]) => any) | undefined;
|
|
185
193
|
"onUpdate:endingPoint"?: ((...args: any[]) => any) | undefined;
|
|
@@ -108,8 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
108
108
|
}>, {
|
|
109
109
|
modelValue: string;
|
|
110
110
|
isOpen: boolean;
|
|
111
|
-
disabled: boolean;
|
|
112
111
|
label: string;
|
|
112
|
+
disabled: boolean;
|
|
113
113
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
114
114
|
validationText: string;
|
|
115
115
|
placeholder: string;
|
|
@@ -108,8 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
108
108
|
}>, {
|
|
109
109
|
modelValue: string;
|
|
110
110
|
isOpen: boolean;
|
|
111
|
-
disabled: boolean;
|
|
112
111
|
label: string;
|
|
112
|
+
disabled: boolean;
|
|
113
113
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
114
114
|
validationText: string;
|
|
115
115
|
placeholder: string;
|
|
@@ -74,8 +74,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
"onUpdate:maxValue"?: ((value: number | undefined) => any) | undefined;
|
|
75
75
|
}>, {
|
|
76
76
|
modelValue: number[] | [number, number];
|
|
77
|
-
disabled: boolean;
|
|
78
77
|
label: string;
|
|
78
|
+
disabled: boolean;
|
|
79
79
|
step: number;
|
|
80
80
|
min: number;
|
|
81
81
|
max: number;
|
|
@@ -74,8 +74,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
"onUpdate:maxValue"?: ((value: number | undefined) => any) | undefined;
|
|
75
75
|
}>, {
|
|
76
76
|
modelValue: number[] | [number, number];
|
|
77
|
-
disabled: boolean;
|
|
78
77
|
label: string;
|
|
78
|
+
disabled: boolean;
|
|
79
79
|
step: number;
|
|
80
80
|
min: number;
|
|
81
81
|
max: number;
|
|
@@ -64,8 +64,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
64
64
|
"onUpdate:value"?: ((value: number | undefined) => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
66
|
modelValue: number;
|
|
67
|
-
disabled: boolean;
|
|
68
67
|
label: string;
|
|
68
|
+
disabled: boolean;
|
|
69
69
|
value: number;
|
|
70
70
|
step: number;
|
|
71
71
|
min: number;
|
|
@@ -64,8 +64,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
64
64
|
"onUpdate:value"?: ((value: number | undefined) => any) | undefined;
|
|
65
65
|
}>, {
|
|
66
66
|
modelValue: number;
|
|
67
|
-
disabled: boolean;
|
|
68
67
|
label: string;
|
|
68
|
+
disabled: boolean;
|
|
69
69
|
value: number;
|
|
70
70
|
step: number;
|
|
71
71
|
min: number;
|
|
@@ -232,9 +232,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
232
232
|
"onNode-toggle"?: ((nodeId: string | number) => any) | undefined;
|
|
233
233
|
}>, {
|
|
234
234
|
modelValue: any;
|
|
235
|
+
label: string;
|
|
235
236
|
disabled: boolean;
|
|
236
237
|
loading: boolean;
|
|
237
|
-
label: string;
|
|
238
238
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
239
239
|
validationText: string;
|
|
240
240
|
idKey: string;
|
|
@@ -232,9 +232,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
232
232
|
"onNode-toggle"?: ((nodeId: string | number) => any) | undefined;
|
|
233
233
|
}>, {
|
|
234
234
|
modelValue: any;
|
|
235
|
+
label: string;
|
|
235
236
|
disabled: boolean;
|
|
236
237
|
loading: boolean;
|
|
237
|
-
label: string;
|
|
238
238
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
239
239
|
validationText: string;
|
|
240
240
|
idKey: string;
|
|
@@ -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,10 +195,18 @@ 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
|
) => {
|
|
209
|
+
wasDragging = false
|
|
194
210
|
if (!props.editable) { return }
|
|
195
211
|
event.preventDefault()
|
|
196
212
|
|
|
@@ -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,6 +280,12 @@ const onMouseUp = () => {
|
|
|
261
280
|
window.removeEventListener('mousemove', onMouseMove)
|
|
262
281
|
window.removeEventListener('mouseup', onMouseUp)
|
|
263
282
|
|
|
283
|
+
if (wasDragging) {
|
|
284
|
+
setTimeout(() => {
|
|
285
|
+
wasDragging = false
|
|
286
|
+
}, 60)
|
|
287
|
+
}
|
|
288
|
+
|
|
264
289
|
if (!activeDragState.value) { console.warn('[KGantt] onMouseUp: no activeDragState'); return }
|
|
265
290
|
|
|
266
291
|
const state = activeDragState.value
|
|
@@ -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;
|