@xpyjs/gantt-vue 0.0.1-beta.4 → 0.0.1-rc.2
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/index.js +50 -28
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/types/components/GanttVue.vue.d.ts +16 -0
- package/types/components/props.d.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { XGantt as
|
|
3
|
-
import { colorjs as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as f, ref as p, watch as k, onMounted as v, onUnmounted as b, createElementBlock as x, openBlock as _, nextTick as g } from "vue";
|
|
2
|
+
import { XGantt as h } from "@xpyjs/gantt-core";
|
|
3
|
+
import { colorjs as B, dayjs as V, generateId as C } from "@xpyjs/gantt-core";
|
|
4
|
+
const w = /* @__PURE__ */ f({
|
|
5
5
|
__name: "GanttVue",
|
|
6
6
|
props: {
|
|
7
7
|
options: { default: () => ({}) }
|
|
8
8
|
},
|
|
9
|
-
emits: ["loaded", "error", "update:link", "create:link", "select:link", "contextmenu:link", "select", "click:row", "dblclick:row", "contextmenu:row", "click:slider", "dblclick:slider", "contextmenu:slider", "move", "hover:slider", "leave:slider", "click:baseline", "contextmenu:baseline", "hover:baseline", "leave:baseline"],
|
|
10
|
-
setup(n, { expose:
|
|
11
|
-
const l = n,
|
|
9
|
+
emits: ["loaded", "error", "update:link", "create:link", "select:link", "contextmenu:link", "select", "click:row", "dblclick:row", "contextmenu:row", "click:slider", "dblclick:slider", "contextmenu:slider", "move", "enter:slider", "hover:slider", "leave:slider", "click:baseline", "contextmenu:baseline", "enter:baseline", "hover:baseline", "leave:baseline"],
|
|
10
|
+
setup(n, { expose: i, emit: r }) {
|
|
11
|
+
const l = n, a = r, c = p();
|
|
12
12
|
let e = null;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
},
|
|
13
|
+
const d = async () => {
|
|
14
|
+
c.value && (await g(), e = new h(c.value, l.options), u());
|
|
15
|
+
}, u = () => {
|
|
16
16
|
if (!e) return;
|
|
17
17
|
[
|
|
18
18
|
"loaded",
|
|
@@ -29,28 +29,30 @@ const g = /* @__PURE__ */ p({
|
|
|
29
29
|
"dblclick:slider",
|
|
30
30
|
"contextmenu:slider",
|
|
31
31
|
"move",
|
|
32
|
+
"enter:slider",
|
|
32
33
|
"hover:slider",
|
|
33
34
|
"leave:slider",
|
|
34
35
|
"click:baseline",
|
|
35
36
|
"contextmenu:baseline",
|
|
37
|
+
"enter:baseline",
|
|
36
38
|
"hover:baseline",
|
|
37
39
|
"leave:baseline"
|
|
38
|
-
].forEach((
|
|
40
|
+
].forEach((o) => {
|
|
39
41
|
e.on(
|
|
40
|
-
|
|
42
|
+
o,
|
|
41
43
|
(...m) => {
|
|
42
|
-
|
|
44
|
+
a(o, ...m);
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
});
|
|
46
48
|
};
|
|
47
|
-
return
|
|
49
|
+
return k(
|
|
48
50
|
() => l,
|
|
49
51
|
(t) => {
|
|
50
52
|
e && e.update(t.options);
|
|
51
53
|
},
|
|
52
54
|
{ deep: !0 }
|
|
53
|
-
),
|
|
55
|
+
), i({
|
|
54
56
|
/**
|
|
55
57
|
* 获取甘特图实例
|
|
56
58
|
*/
|
|
@@ -67,30 +69,50 @@ const g = /* @__PURE__ */ p({
|
|
|
67
69
|
getDataChain: (t) => {
|
|
68
70
|
if (e)
|
|
69
71
|
return e.getDataChain(t);
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* 滚动到指定任务位置
|
|
75
|
+
*/
|
|
76
|
+
scrollTo: (t, o) => {
|
|
77
|
+
e && e.scrollTo(t, o);
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* 获取某一条数据
|
|
81
|
+
*/
|
|
82
|
+
getDataById: (t) => {
|
|
83
|
+
if (e)
|
|
84
|
+
return e.getDataById(t);
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* 获取当前数据集合的数量
|
|
88
|
+
*/
|
|
89
|
+
getDataSize: () => {
|
|
90
|
+
if (e)
|
|
91
|
+
return e.getDataSize();
|
|
70
92
|
}
|
|
71
93
|
}), v(() => {
|
|
72
|
-
|
|
73
|
-
}),
|
|
94
|
+
d();
|
|
95
|
+
}), b(() => {
|
|
74
96
|
e && (e.destroy(), e = null);
|
|
75
|
-
}), (t,
|
|
97
|
+
}), (t, o) => (_(), x("div", {
|
|
76
98
|
ref_key: "containerRef",
|
|
77
|
-
ref:
|
|
99
|
+
ref: c,
|
|
78
100
|
class: "x-gantt-container"
|
|
79
101
|
}, null, 512));
|
|
80
102
|
}
|
|
81
|
-
}),
|
|
82
|
-
const
|
|
83
|
-
for (const [l,
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
},
|
|
103
|
+
}), y = (n, i) => {
|
|
104
|
+
const r = n.__vccOpts || n;
|
|
105
|
+
for (const [l, a] of i)
|
|
106
|
+
r[l] = a;
|
|
107
|
+
return r;
|
|
108
|
+
}, D = /* @__PURE__ */ y(w, [["__scopeId", "data-v-7fb9b32a"]]), s = D;
|
|
87
109
|
s.install = (n) => {
|
|
88
110
|
n.component("XGanttVue", s);
|
|
89
111
|
};
|
|
90
112
|
export {
|
|
91
113
|
s as XGanttVue,
|
|
92
|
-
|
|
93
|
-
|
|
114
|
+
B as colorjs,
|
|
115
|
+
V as dayjs,
|
|
94
116
|
s as default,
|
|
95
|
-
|
|
117
|
+
C as generateId
|
|
96
118
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@xpyjs/gantt-core")):typeof define=="function"&&define.amd?define(["exports","vue","@xpyjs/gantt-core"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.XGanttVue={},t.Vue,t.XGanttCore))})(this,function(t,n,
|
|
1
|
+
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@xpyjs/gantt-core")):typeof define=="function"&&define.amd?define(["exports","vue","@xpyjs/gantt-core"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.XGanttVue={},t.Vue,t.XGanttCore))})(this,function(t,n,l){"use strict";const c=((i,u)=>{const a=i.__vccOpts||i;for(const[s,d]of u)a[s]=d;return a})(n.defineComponent({__name:"GanttVue",props:{options:{default:()=>({})}},emits:["loaded","error","update:link","create:link","select:link","contextmenu:link","select","click:row","dblclick:row","contextmenu:row","click:slider","dblclick:slider","contextmenu:slider","move","enter:slider","hover:slider","leave:slider","click:baseline","contextmenu:baseline","enter:baseline","hover:baseline","leave:baseline"],setup(i,{expose:u,emit:a}){const s=i,d=a,f=n.ref();let e=null;const p=async()=>{f.value&&(await n.nextTick(),e=new l.XGantt(f.value,s.options),m())},m=()=>{if(!e)return;["loaded","error","update:link","create:link","select:link","contextmenu:link","select","click:row","dblclick:row","contextmenu:row","click:slider","dblclick:slider","contextmenu:slider","move","enter:slider","hover:slider","leave:slider","click:baseline","contextmenu:baseline","enter:baseline","hover:baseline","leave:baseline"].forEach(o=>{e.on(o,(...b)=>{d(o,...b)})})};return n.watch(()=>s,r=>{e&&e.update(r.options)},{deep:!0}),u({getInstance:()=>e,jumpTo:r=>{e&&e.jumpTo(r)},getDataChain:r=>{if(e)return e.getDataChain(r)},scrollTo:(r,o)=>{e&&e.scrollTo(r,o)},getDataById:r=>{if(e)return e.getDataById(r)},getDataSize:()=>{if(e)return e.getDataSize()}}),n.onMounted(()=>{p()}),n.onUnmounted(()=>{e&&(e.destroy(),e=null)}),(r,o)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:f,class:"x-gantt-container"},null,512))}}),[["__scopeId","data-v-7fb9b32a"]]);c.install=i=>{i.component("XGanttVue",c)},Object.defineProperty(t,"colorjs",{enumerable:!0,get:()=>l.colorjs}),Object.defineProperty(t,"dayjs",{enumerable:!0,get:()=>l.dayjs}),Object.defineProperty(t,"generateId",{enumerable:!0,get:()=>l.generateId}),t.XGanttVue=c,t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +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{position:relative;height:100%;overflow:hidden}.x-gantt-container[data-v-
|
|
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{position:relative;height:100%;overflow:hidden}.x-gantt-container[data-v-7fb9b32a]{position:relative;width:100%;height:100%}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpyjs/gantt-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.1-
|
|
4
|
+
"version": "0.0.1-rc.2",
|
|
5
5
|
"description": "Vue wrapper for x-gantt",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.umd.cjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"vue": "^3.0.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@xpyjs/gantt-core": "0.0.1-
|
|
26
|
+
"@xpyjs/gantt-core": "0.0.1-rc.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vitejs/plugin-vue": "^5.0.0",
|
|
@@ -17,6 +17,18 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
17
17
|
* 获取指定任务的所有相关联的完整路径,包含所有连接线与任务节点
|
|
18
18
|
*/
|
|
19
19
|
getDataChain: (taskId: string) => DataChain | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* 滚动到指定任务位置
|
|
22
|
+
*/
|
|
23
|
+
scrollTo: (id?: string, highlight?: boolean) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 获取某一条数据
|
|
26
|
+
*/
|
|
27
|
+
getDataById: (id: string) => any;
|
|
28
|
+
/**
|
|
29
|
+
* 获取当前数据集合的数量
|
|
30
|
+
*/
|
|
31
|
+
getDataSize: () => number | undefined;
|
|
20
32
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
21
33
|
loaded: () => void;
|
|
22
34
|
error: (error: ErrorType) => void;
|
|
@@ -35,10 +47,12 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
35
47
|
row: any;
|
|
36
48
|
old: any;
|
|
37
49
|
}[]) => void;
|
|
50
|
+
"enter:slider": (e: MouseEvent, data: any) => void;
|
|
38
51
|
"hover:slider": (e: MouseEvent, data: any) => void;
|
|
39
52
|
"leave:slider": (e: MouseEvent, data: any) => void;
|
|
40
53
|
"click:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
41
54
|
"contextmenu:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
55
|
+
"enter:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
42
56
|
"hover:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
43
57
|
"leave:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
44
58
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<XGanttVueProps>, {
|
|
@@ -61,10 +75,12 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
61
75
|
row: any;
|
|
62
76
|
old: any;
|
|
63
77
|
}[]) => any) | undefined;
|
|
78
|
+
"onEnter:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
64
79
|
"onHover:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
65
80
|
"onLeave:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
66
81
|
"onClick:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
67
82
|
"onContextmenu:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
83
|
+
"onEnter:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
68
84
|
"onHover:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
69
85
|
"onLeave:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
70
86
|
}>, {
|
|
@@ -19,10 +19,12 @@ export type XGanttVueEmits = {
|
|
|
19
19
|
row: any;
|
|
20
20
|
old: any;
|
|
21
21
|
}[]];
|
|
22
|
+
"enter:slider": [e: MouseEvent, data: any];
|
|
22
23
|
"hover:slider": [e: MouseEvent, data: any];
|
|
23
24
|
"leave:slider": [e: MouseEvent, data: any];
|
|
24
25
|
"click:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
25
26
|
"contextmenu:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
27
|
+
"enter:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
26
28
|
"hover:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
27
29
|
"leave:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
28
30
|
};
|