@xpyjs/gantt-vue 0.0.1-alpha.1
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/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/index.js +81 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +62 -0
- package/types/components/GanttVue.vue.d.ts +70 -0
- package/types/components/props.d.ts +30 -0
- package/types/components.d.ts +7 -0
- package/types/env.d.ts +7 -0
- package/types/index.d.ts +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jeremy Jone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# XGantt Vue 组件
|
|
2
|
+
|
|
3
|
+
基于 XGantt 核心的 Vue 3 组件封装。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @xpyjs/gantt-vue
|
|
9
|
+
# 或
|
|
10
|
+
pnpm add @xpyjs/gantt-vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
|
|
15
|
+
### 全局注册
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { createApp } from 'vue'
|
|
19
|
+
import XGanttVue from '@xpyjs/gantt-vue'
|
|
20
|
+
import '@xpyjs/gantt-vue/style.css'
|
|
21
|
+
|
|
22
|
+
const app = createApp(App)
|
|
23
|
+
app.use(XGanttVue)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 局部注册
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<template>
|
|
30
|
+
<XGanttChart
|
|
31
|
+
:data="ganttData"
|
|
32
|
+
:width="1200"
|
|
33
|
+
:height="600"
|
|
34
|
+
:table="tableConfig"
|
|
35
|
+
primary-color="#1890ff"
|
|
36
|
+
@move="onTaskMove"
|
|
37
|
+
@select="onTaskSelect"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { XGanttChart } from '@xpyjs/gantt-vue'
|
|
43
|
+
import '@xpyjs/gantt-vue/style.css'
|
|
44
|
+
|
|
45
|
+
const ganttData = ref([
|
|
46
|
+
{
|
|
47
|
+
id: '1',
|
|
48
|
+
name: '任务1',
|
|
49
|
+
startTime: '2024-01-01',
|
|
50
|
+
endTime: '2024-01-15',
|
|
51
|
+
progress: 80
|
|
52
|
+
}
|
|
53
|
+
])
|
|
54
|
+
|
|
55
|
+
const tableConfig = {
|
|
56
|
+
columns: [
|
|
57
|
+
{ field: 'name', label: '任务名称', width: 200 },
|
|
58
|
+
{ field: 'progress', label: '进度', width: 80 }
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const onTaskMove = (moved) => {
|
|
63
|
+
console.log('任务移动:', moved)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const onTaskSelect = (selected, checked, all) => {
|
|
67
|
+
console.log('任务选择:', { selected, checked, all })
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 属性 (Props)
|
|
73
|
+
|
|
74
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
75
|
+
|--------|------|--------|------|
|
|
76
|
+
| data | Array | [] | 甘特图数据 |
|
|
77
|
+
| width | Number | undefined | 甘特图宽度 |
|
|
78
|
+
| height | Number | undefined | 甘特图高度 |
|
|
79
|
+
| primaryColor | String | "#eca710" | 主色调 |
|
|
80
|
+
| dateFormat | String | "YYYY-MM-DD" | 日期格式 |
|
|
81
|
+
| unit | String | "day" | 时间刻度 |
|
|
82
|
+
| locale | String | "en" | 显示语言 |
|
|
83
|
+
| fields | Object | {...} | 字段映射配置 |
|
|
84
|
+
| table | Object | {...} | 表格配置 |
|
|
85
|
+
| chart | Object | {...} | 图表配置 |
|
|
86
|
+
|
|
87
|
+
## 事件 (Events)
|
|
88
|
+
|
|
89
|
+
| 事件名 | 参数 | 说明 |
|
|
90
|
+
|--------|------|------|
|
|
91
|
+
| move | moved | 任务拖拽移动完成 |
|
|
92
|
+
| select | selected, checked, all | 任务选择 |
|
|
93
|
+
| click:row | event, row | 行点击 |
|
|
94
|
+
| dblclick:row | event, row | 行双击 |
|
|
95
|
+
| error | error | 错误事件 |
|
|
96
|
+
|
|
97
|
+
## 方法 (Methods)
|
|
98
|
+
|
|
99
|
+
| 方法名 | 参数 | 返回值 | 说明 |
|
|
100
|
+
|--------|------|--------|------|
|
|
101
|
+
| jumpTo | date? | boolean | 跳转到指定日期 |
|
|
102
|
+
| getOptions | - | object | 获取甘特图选项 |
|
|
103
|
+
| render | - | void | 重新渲染 |
|
|
104
|
+
| getInstance | - | XGantt | 获取甘特图实例 |
|
|
105
|
+
|
|
106
|
+
## 开发
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# 安装依赖
|
|
110
|
+
pnpm install
|
|
111
|
+
|
|
112
|
+
# 开发
|
|
113
|
+
pnpm dev
|
|
114
|
+
|
|
115
|
+
# 构建
|
|
116
|
+
pnpm build
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 许可证
|
|
120
|
+
|
|
121
|
+
MIT
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as m, ref as f, watch as k, onMounted as _, onUnmounted as x, createElementBlock as v, openBlock as w, nextTick as g } from "vue";
|
|
2
|
+
import { XGantt as G } from "@xpyjs/gantt-core";
|
|
3
|
+
import { colorjs as T, dayjs as X, generateId as B } from "@xpyjs/gantt-core";
|
|
4
|
+
const b = /* @__PURE__ */ m({
|
|
5
|
+
__name: "GanttVue",
|
|
6
|
+
props: {
|
|
7
|
+
options: { default: () => ({}) }
|
|
8
|
+
},
|
|
9
|
+
emits: ["error", "update:link", "create:link", "select:link", "select", "click:row", "dblclick:row", "contextmenu:row", "click:slider", "dblclick:slider", "contextmenu:slider", "move"],
|
|
10
|
+
setup(t, { expose: r, emit: o }) {
|
|
11
|
+
const c = t, s = o, i = f();
|
|
12
|
+
let e = null;
|
|
13
|
+
const u = async () => {
|
|
14
|
+
i.value && (await g(), e = new G(i.value, c.options), p());
|
|
15
|
+
}, p = () => {
|
|
16
|
+
if (!e) return;
|
|
17
|
+
[
|
|
18
|
+
"error",
|
|
19
|
+
"update:link",
|
|
20
|
+
"create:link",
|
|
21
|
+
"select:link",
|
|
22
|
+
"select",
|
|
23
|
+
"click:row",
|
|
24
|
+
"dblclick:row",
|
|
25
|
+
"contextmenu:row",
|
|
26
|
+
"click:slider",
|
|
27
|
+
"dblclick:slider",
|
|
28
|
+
"contextmenu:slider",
|
|
29
|
+
"move"
|
|
30
|
+
].forEach((l) => {
|
|
31
|
+
e.on(
|
|
32
|
+
l,
|
|
33
|
+
(...d) => {
|
|
34
|
+
s(l, ...d);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return k(
|
|
40
|
+
() => c,
|
|
41
|
+
(n) => {
|
|
42
|
+
e && e.updateOptions(n.options);
|
|
43
|
+
},
|
|
44
|
+
{ deep: !0 }
|
|
45
|
+
), r({
|
|
46
|
+
/**
|
|
47
|
+
* 获取甘特图实例
|
|
48
|
+
*/
|
|
49
|
+
getInstance: () => e,
|
|
50
|
+
/**
|
|
51
|
+
* 跳转日期
|
|
52
|
+
*/
|
|
53
|
+
jumpTo: (n) => {
|
|
54
|
+
e && e.jumpTo(n);
|
|
55
|
+
}
|
|
56
|
+
}), _(() => {
|
|
57
|
+
u();
|
|
58
|
+
}), x(() => {
|
|
59
|
+
e && (e.destroy(), e = null);
|
|
60
|
+
}), (n, l) => (w(), v("div", {
|
|
61
|
+
ref_key: "containerRef",
|
|
62
|
+
ref: i,
|
|
63
|
+
class: "x-gantt-container"
|
|
64
|
+
}, null, 512));
|
|
65
|
+
}
|
|
66
|
+
}), y = (t, r) => {
|
|
67
|
+
const o = t.__vccOpts || t;
|
|
68
|
+
for (const [c, s] of r)
|
|
69
|
+
o[c] = s;
|
|
70
|
+
return o;
|
|
71
|
+
}, j = /* @__PURE__ */ y(b, [["__scopeId", "data-v-fefb876a"]]), a = j;
|
|
72
|
+
a.install = (t) => {
|
|
73
|
+
t.component("XGanttVue", a);
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
a as XGanttVue,
|
|
77
|
+
T as colorjs,
|
|
78
|
+
X as dayjs,
|
|
79
|
+
a as default,
|
|
80
|
+
B as generateId
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@xpyjs/gantt-core")):typeof define=="function"&&define.amd?define(["exports","vue","@xpyjs/gantt-core"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.XGanttVue={},e.Vue,e.XGanttCore))})(this,function(e,t,r){"use strict";const i=((o,a)=>{const s=o.__vccOpts||o;for(const[l,u]of a)s[l]=u;return s})(t.defineComponent({__name:"GanttVue",props:{options:{default:()=>({})}},emits:["error","update:link","create:link","select:link","select","click:row","dblclick:row","contextmenu:row","click:slider","dblclick:slider","contextmenu:slider","move"],setup(o,{expose:a,emit:s}){const l=o,u=s,d=t.ref();let n=null;const p=async()=>{d.value&&(await t.nextTick(),n=new r.XGantt(d.value,l.options),m())},m=()=>{if(!n)return;["error","update:link","create:link","select:link","select","click:row","dblclick:row","contextmenu:row","click:slider","dblclick:slider","contextmenu:slider","move"].forEach(f=>{n.on(f,(...k)=>{u(f,...k)})})};return t.watch(()=>l,c=>{n&&n.updateOptions(c.options)},{deep:!0}),a({getInstance:()=>n,jumpTo:c=>{n&&n.jumpTo(c)}}),t.onMounted(()=>{p()}),t.onUnmounted(()=>{n&&(n.destroy(),n=null)}),(c,f)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerRef",ref:d,class:"x-gantt-container"},null,512))}}),[["__scopeId","data-v-fefb876a"]]);i.install=o=>{o.component("XGanttVue",i)},Object.defineProperty(e,"colorjs",{enumerable:!0,get:()=>r.colorjs}),Object.defineProperty(e,"dayjs",{enumerable:!0,get:()=>r.dayjs}),Object.defineProperty(e,"generateId",{enumerable:!0,get:()=>r.generateId}),e.XGanttVue=i,e.default=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.x-gantt{--x-gantt-border-color: #e5e5e5}.x-gantt-table-container{flex-shrink:0;box-sizing:border-box;height:100%;overflow:hidden;display:flex;flex-direction:column;width:100%}.x-gantt-table-header{flex-shrink:0;box-sizing:border-box;border-bottom:1px solid var(--x-gantt-border-color)!important;display:flex;flex-direction:row;overflow:hidden;position:relative;flex-wrap:nowrap}.x-gantt-table-header .x-gantt-table-header-cell{position:relative;box-sizing:border-box;overflow:hidden;font-weight:var(--x-gantt-header-font-weight);flex-shrink:0;padding:0 8px}.x-gantt-table-header .x-gantt-table-header-cell.border{border-right:1px solid var(--x-gantt-border-color)!important}.x-gantt-table-header .x-gantt-table-header-cell .x-gantt-column-resize-handle{transition:background-color .2s ease}.x-gantt-table-header .x-gantt-table-header-cell .x-gantt-column-resize-handle:hover{background-color:#0000001a!important}.x-gantt-table-header>div:last-child.x-gantt-table-header-group.border>.x-gantt-table-header-cell.border{border-right:none}.x-gantt-table-header>div:last-child .x-gantt-table-header-group.border>.x-gantt-table-header-cell.border{border-right:none}.x-gantt-table-header>div:last-child.x-gantt-table-header-cell.border{border-right:none}.x-gantt-table-header-group{display:flex;flex-direction:column;box-sizing:border-box}.x-gantt-table-header-group>.x-gantt-table-header-cell{border-bottom:1px solid var(--x-gantt-border-color)!important}.x-gantt-table-header-group>.x-gantt-table-header-cell>.x-gantt-table-header-title{text-align:center}.x-gantt-table-header-children{display:flex;flex-direction:row}.x-gantt-table-body{flex:1;overflow:hidden;box-sizing:border-box;position:relative;width:100%;height:100%}.x-gantt-table-row{box-sizing:border-box}.x-gantt-table-row.hover>.x-gantt-table-cell{background-color:var(--x-gantt-row-hover-color, rgba(0, 0, 0, .05))!important}.x-gantt-table-row.selected>.x-gantt-table-cell{background-color:var(--x-gantt-row-selected-color, rgba(0, 0, 0, .1))!important}.x-gantt-table-cell{box-sizing:border-box;display:inline-block;border-bottom:1px solid var(--x-gantt-border-color)!important;padding:var(--x-gantt-cell-padding, 4px 8px)}.x-gantt-table-cell .x-gantt-table-cell__content{box-sizing:border-box}.x-gantt-table-cell.border{border-right:1px solid var(--x-gantt-border-color)!important}.x-gantt-content-wrapper{width:100%;height:100%;scrollbar-width:none}.x-gantt-content-wrapper::-webkit-scrollbar{display:none}.gantt-scrollbar{position:absolute;z-index:10;opacity:0;transition:opacity .2s ease-in-out;pointer-events:none}.gantt-scrollbar.visible{opacity:1;pointer-events:auto}.gantt-scrollbar-thumb{position:absolute;cursor:pointer;transition:background-color .2s ease-in-out,height .1s ease-out,width .1s ease-out,transform .05s linear}.gantt-scrollbar-vertical{top:0;right:0;bottom:0}.gantt-scrollbar-vertical .gantt-scrollbar-thumb-vertical{top:0;left:0;right:0}.gantt-scrollbar-horizontal{left:0;bottom:0;right:0}.gantt-scrollbar-horizontal .gantt-scrollbar-thumb-horizontal{left:0;top:0;bottom:0}.x-gantt-checkbox{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--x-gantt-border-color);border-radius:3px;cursor:pointer;transition:all .15s ease-in-out;box-sizing:border-box;-webkit-user-select:none;user-select:none;position:relative;overflow:hidden}.x-gantt-checkbox:focus{outline:none}.x-gantt-checkbox:focus-visible{outline:none}.x-gantt-checkbox__icon svg{transition:all .15s ease-in-out}.x-gantt-checkbox:hover{border-color:var(--x-gantt-primary-color)}.x-gantt{width:100%;height:100%;display:flex;box-sizing:border-box;flex-wrap:nowrap;padding:0;margin:0;overflow:hidden;position:relative}.x-gantt.border{border:1px solid var(--x-gantt-border-color)}.x-gantt-container[data-v-fefb876a]{position:relative;width:100%;height:100%}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xpyjs/gantt-vue",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.1-alpha.1",
|
|
5
|
+
"description": "Vue wrapper for x-gantt",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.umd.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./types/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.umd.cjs",
|
|
14
|
+
"types": "./types/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/style.css"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"types"
|
|
21
|
+
],
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"vue": "^3.0.0"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@xpyjs/gantt-core": "0.0.1-alpha.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
30
|
+
"vue": "^3.4.0"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"gantt",
|
|
34
|
+
"chart",
|
|
35
|
+
"schedule",
|
|
36
|
+
"project management",
|
|
37
|
+
"vue",
|
|
38
|
+
"vue3",
|
|
39
|
+
"typescript"
|
|
40
|
+
],
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/xpyjs/gantt.git",
|
|
44
|
+
"directory": "packages/vue"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/xpyjs/gantt#readme",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/xpyjs/gantt/issues"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"author": "JeremyJone",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "vite build --watch",
|
|
58
|
+
"build": "tsc && vite build",
|
|
59
|
+
"preview": "vite preview",
|
|
60
|
+
"release": "pnpm publish --access public --no-git-checks"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { XGantt, ErrorType, ILink, IOptions } from '@xpyjs/gantt-core';
|
|
2
|
+
import { XGanttVueProps } from './props';
|
|
3
|
+
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
|
|
4
|
+
|
|
5
|
+
declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<XGanttVueProps>, {
|
|
6
|
+
options: () => {};
|
|
7
|
+
}>>, {
|
|
8
|
+
/**
|
|
9
|
+
* 获取甘特图实例
|
|
10
|
+
*/
|
|
11
|
+
getInstance: () => XGantt | null;
|
|
12
|
+
/**
|
|
13
|
+
* 跳转日期
|
|
14
|
+
*/
|
|
15
|
+
jumpTo: (date?: any) => void;
|
|
16
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
+
error: (error: ErrorType) => void;
|
|
18
|
+
"update:link": (link: ILink) => void;
|
|
19
|
+
"create:link": (link: ILink) => void;
|
|
20
|
+
"select:link": (add: ILink | null, cancel: ILink | null, all: ILink[]) => void;
|
|
21
|
+
select: (data: any[], checked: boolean, all: any[]) => void;
|
|
22
|
+
"click:row": (e: MouseEvent, data: any) => void;
|
|
23
|
+
"dblclick:row": (e: MouseEvent, data: any) => void;
|
|
24
|
+
"contextmenu:row": (e: MouseEvent, data: any) => void;
|
|
25
|
+
"click:slider": (e: MouseEvent, data: any) => void;
|
|
26
|
+
"dblclick:slider": (e: MouseEvent, data: any) => void;
|
|
27
|
+
"contextmenu:slider": (e: MouseEvent, data: any) => void;
|
|
28
|
+
move: (data: {
|
|
29
|
+
row: any;
|
|
30
|
+
old: any;
|
|
31
|
+
}[]) => void;
|
|
32
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<XGanttVueProps>, {
|
|
33
|
+
options: () => {};
|
|
34
|
+
}>>> & Readonly<{
|
|
35
|
+
onError?: ((error: ErrorType) => any) | undefined;
|
|
36
|
+
"onUpdate:link"?: ((link: ILink) => any) | undefined;
|
|
37
|
+
"onCreate:link"?: ((link: ILink) => any) | undefined;
|
|
38
|
+
"onSelect:link"?: ((add: ILink | null, cancel: ILink | null, all: ILink[]) => any) | undefined;
|
|
39
|
+
onSelect?: ((data: any[], checked: boolean, all: any[]) => any) | undefined;
|
|
40
|
+
"onClick:row"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
41
|
+
"onDblclick:row"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
42
|
+
"onContextmenu:row"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
43
|
+
"onClick:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
44
|
+
"onDblclick:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
45
|
+
"onContextmenu:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
46
|
+
onMove?: ((data: {
|
|
47
|
+
row: any;
|
|
48
|
+
old: any;
|
|
49
|
+
}[]) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
options: IOptions;
|
|
52
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
55
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
56
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
57
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
58
|
+
} : {
|
|
59
|
+
type: PropType<T[K]>;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type __VLS_WithDefaults<P, D> = {
|
|
64
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
65
|
+
default: D[K];
|
|
66
|
+
}> : P[K];
|
|
67
|
+
};
|
|
68
|
+
type __VLS_Prettify<T> = {
|
|
69
|
+
[K in keyof T]: T[K];
|
|
70
|
+
} & {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SlotsType } from 'vue';
|
|
2
|
+
import { IOptions, ILink, ErrorType } from '@xpyjs/gantt-core';
|
|
3
|
+
|
|
4
|
+
export type XGanttVueEmits = {
|
|
5
|
+
error: [error: ErrorType];
|
|
6
|
+
"update:link": [link: ILink];
|
|
7
|
+
"create:link": [link: ILink];
|
|
8
|
+
"select:link": [add: ILink | null, cancel: ILink | null, all: ILink[]];
|
|
9
|
+
select: [data: any[], checked: boolean, all: any[]];
|
|
10
|
+
"click:row": [e: MouseEvent, data: any];
|
|
11
|
+
"dblclick:row": [e: MouseEvent, data: any];
|
|
12
|
+
"contextmenu:row": [e: MouseEvent, data: any];
|
|
13
|
+
"click:slider": [e: MouseEvent, data: any];
|
|
14
|
+
"dblclick:slider": [e: MouseEvent, data: any];
|
|
15
|
+
"contextmenu:slider": [e: MouseEvent, data: any];
|
|
16
|
+
move: [data: {
|
|
17
|
+
row: any;
|
|
18
|
+
old: any;
|
|
19
|
+
}[]];
|
|
20
|
+
};
|
|
21
|
+
export interface XGanttVueProps {
|
|
22
|
+
/**
|
|
23
|
+
* XGantt 图表的配置选项
|
|
24
|
+
*
|
|
25
|
+
* @description
|
|
26
|
+
* 该选项包含所有 XGantt 图表的配置参数
|
|
27
|
+
*/
|
|
28
|
+
options: IOptions;
|
|
29
|
+
}
|
|
30
|
+
export type XGanttVueSlots = SlotsType<{}>;
|
package/types/env.d.ts
ADDED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as GanttVue } from './components/GanttVue.vue';
|
|
2
|
+
import { XGanttVueSlots, XGanttVueProps, XGanttVueEmits } from './components/props';
|
|
3
|
+
import { App } from 'vue';
|
|
4
|
+
|
|
5
|
+
export type XGanttInstance = InstanceType<typeof GanttVue>;
|
|
6
|
+
export type { XGanttVueProps, XGanttVueEmits, XGanttVueSlots };
|
|
7
|
+
declare const XGanttVue: typeof GanttVue & {
|
|
8
|
+
install: (app: App) => void;
|
|
9
|
+
};
|
|
10
|
+
export { XGanttVue };
|
|
11
|
+
export default XGanttVue;
|
|
12
|
+
export type { IOptions, IOptionConfig, EmitData, EventMap, ILink, ErrorType, Dayjs, Colorjs } from '@xpyjs/gantt-core';
|
|
13
|
+
export { generateId, dayjs, colorjs } from '@xpyjs/gantt-core';
|