@xpyjs/gantt-vue 0.0.1-alpha.3 → 0.0.1-alpha.5
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 +32 -25
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/types/components/GanttVue.vue.d.ts +14 -0
- package/types/components/props.d.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { XGantt as
|
|
1
|
+
import { defineComponent as p, ref as k, watch as f, onMounted as v, onUnmounted as x, createElementBlock as _, openBlock as b, nextTick as w } from "vue";
|
|
2
|
+
import { XGantt as h } from "@xpyjs/gantt-core";
|
|
3
3
|
import { colorjs as T, dayjs as X, generateId as B } from "@xpyjs/gantt-core";
|
|
4
|
-
const
|
|
4
|
+
const g = /* @__PURE__ */ p({
|
|
5
5
|
__name: "GanttVue",
|
|
6
6
|
props: {
|
|
7
7
|
options: { default: () => ({}) }
|
|
8
8
|
},
|
|
9
|
-
emits: ["loaded", "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:
|
|
11
|
-
const
|
|
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(t, { expose: c, emit: o }) {
|
|
11
|
+
const l = t, r = o, i = k();
|
|
12
12
|
let e = null;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
},
|
|
13
|
+
const d = async () => {
|
|
14
|
+
i.value && (await w(), e = new h(i.value, l.options), u());
|
|
15
|
+
}, u = () => {
|
|
16
16
|
if (!e) return;
|
|
17
17
|
[
|
|
18
18
|
"loaded",
|
|
@@ -20,6 +20,7 @@ const y = /* @__PURE__ */ m({
|
|
|
20
20
|
"update:link",
|
|
21
21
|
"create:link",
|
|
22
22
|
"select:link",
|
|
23
|
+
"contextmenu:link",
|
|
23
24
|
"select",
|
|
24
25
|
"click:row",
|
|
25
26
|
"dblclick:row",
|
|
@@ -27,23 +28,29 @@ const y = /* @__PURE__ */ m({
|
|
|
27
28
|
"click:slider",
|
|
28
29
|
"dblclick:slider",
|
|
29
30
|
"contextmenu:slider",
|
|
30
|
-
"move"
|
|
31
|
-
|
|
31
|
+
"move",
|
|
32
|
+
"hover:slider",
|
|
33
|
+
"leave:slider",
|
|
34
|
+
"click:baseline",
|
|
35
|
+
"contextmenu:baseline",
|
|
36
|
+
"hover:baseline",
|
|
37
|
+
"leave:baseline"
|
|
38
|
+
].forEach((s) => {
|
|
32
39
|
e.on(
|
|
33
|
-
|
|
34
|
-
(...
|
|
35
|
-
|
|
40
|
+
s,
|
|
41
|
+
(...m) => {
|
|
42
|
+
r(s, ...m);
|
|
36
43
|
}
|
|
37
44
|
);
|
|
38
45
|
});
|
|
39
46
|
};
|
|
40
|
-
return
|
|
41
|
-
() =>
|
|
47
|
+
return f(
|
|
48
|
+
() => l,
|
|
42
49
|
(n) => {
|
|
43
50
|
e && e.update(n.options);
|
|
44
51
|
},
|
|
45
52
|
{ deep: !0 }
|
|
46
|
-
),
|
|
53
|
+
), c({
|
|
47
54
|
/**
|
|
48
55
|
* 获取甘特图实例
|
|
49
56
|
*/
|
|
@@ -54,22 +61,22 @@ const y = /* @__PURE__ */ m({
|
|
|
54
61
|
jumpTo: (n) => {
|
|
55
62
|
e && e.jumpTo(n);
|
|
56
63
|
}
|
|
57
|
-
}),
|
|
58
|
-
|
|
64
|
+
}), v(() => {
|
|
65
|
+
d();
|
|
59
66
|
}), x(() => {
|
|
60
67
|
e && (e.destroy(), e = null);
|
|
61
|
-
}), (n,
|
|
68
|
+
}), (n, s) => (b(), _("div", {
|
|
62
69
|
ref_key: "containerRef",
|
|
63
|
-
ref:
|
|
70
|
+
ref: i,
|
|
64
71
|
class: "x-gantt-container"
|
|
65
72
|
}, null, 512));
|
|
66
73
|
}
|
|
67
|
-
}),
|
|
74
|
+
}), G = (t, c) => {
|
|
68
75
|
const o = t.__vccOpts || t;
|
|
69
|
-
for (const [
|
|
70
|
-
o[
|
|
76
|
+
for (const [l, r] of c)
|
|
77
|
+
o[l] = r;
|
|
71
78
|
return o;
|
|
72
|
-
},
|
|
79
|
+
}, y = /* @__PURE__ */ G(g, [["__scopeId", "data-v-668d94f2"]]), a = y;
|
|
73
80
|
a.install = (t) => {
|
|
74
81
|
t.component("XGanttVue", a);
|
|
75
82
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +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,
|
|
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,c){"use strict";const r=((o,a)=>{const l=o.__vccOpts||o;for(const[s,u]of a)l[s]=u;return l})(t.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","hover:slider","leave:slider","click:baseline","contextmenu:baseline","hover:baseline","leave:baseline"],setup(o,{expose:a,emit:l}){const s=o,u=l,d=t.ref();let n=null;const p=async()=>{d.value&&(await t.nextTick(),n=new c.XGantt(d.value,s.options),m())},m=()=>{if(!n)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","hover:slider","leave:slider","click:baseline","contextmenu:baseline","hover:baseline","leave:baseline"].forEach(f=>{n.on(f,(...k)=>{u(f,...k)})})};return t.watch(()=>s,i=>{n&&n.update(i.options)},{deep:!0}),a({getInstance:()=>n,jumpTo:i=>{n&&n.jumpTo(i)}}),t.onMounted(()=>{p()}),t.onUnmounted(()=>{n&&(n.destroy(),n=null)}),(i,f)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerRef",ref:d,class:"x-gantt-container"},null,512))}}),[["__scopeId","data-v-668d94f2"]]);r.install=o=>{o.component("XGanttVue",r)},Object.defineProperty(e,"colorjs",{enumerable:!0,get:()=>c.colorjs}),Object.defineProperty(e,"dayjs",{enumerable:!0,get:()=>c.dayjs}),Object.defineProperty(e,"generateId",{enumerable:!0,get:()=>c.generateId}),e.XGanttVue=r,e.default=r,Object.defineProperties(e,{__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-668d94f2]{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-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.5",
|
|
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-alpha.
|
|
26
|
+
"@xpyjs/gantt-core": "0.0.1-alpha.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vitejs/plugin-vue": "^5.0.0",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"dev": "vite build --watch",
|
|
58
58
|
"build": "tsc && vite build",
|
|
59
59
|
"preview": "vite preview",
|
|
60
|
+
"test:coverage": "vitest run --coverage",
|
|
60
61
|
"release": "pnpm publish --access public"
|
|
61
62
|
}
|
|
62
63
|
}
|
|
@@ -19,6 +19,7 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
19
19
|
"update:link": (link: ILink) => void;
|
|
20
20
|
"create:link": (link: ILink) => void;
|
|
21
21
|
"select:link": (add: ILink | null, cancel: ILink | null, all: ILink[]) => void;
|
|
22
|
+
"contextmenu:link": (e: MouseEvent, link: ILink) => void;
|
|
22
23
|
select: (data: any[], checked: boolean, all: any[]) => void;
|
|
23
24
|
"click:row": (e: MouseEvent, data: any) => void;
|
|
24
25
|
"dblclick:row": (e: MouseEvent, data: any) => void;
|
|
@@ -30,6 +31,12 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
30
31
|
row: any;
|
|
31
32
|
old: any;
|
|
32
33
|
}[]) => void;
|
|
34
|
+
"hover:slider": (e: MouseEvent, data: any) => void;
|
|
35
|
+
"leave:slider": (e: MouseEvent, data: any) => void;
|
|
36
|
+
"click:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
37
|
+
"contextmenu:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
38
|
+
"hover:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
39
|
+
"leave:baseline": (e: MouseEvent, data: any, baseline: any) => void;
|
|
33
40
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<XGanttVueProps>, {
|
|
34
41
|
options: () => {};
|
|
35
42
|
}>>> & Readonly<{
|
|
@@ -38,6 +45,7 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
38
45
|
"onUpdate:link"?: ((link: ILink) => any) | undefined;
|
|
39
46
|
"onCreate:link"?: ((link: ILink) => any) | undefined;
|
|
40
47
|
"onSelect:link"?: ((add: ILink | null, cancel: ILink | null, all: ILink[]) => any) | undefined;
|
|
48
|
+
"onContextmenu:link"?: ((e: MouseEvent, link: ILink) => any) | undefined;
|
|
41
49
|
onSelect?: ((data: any[], checked: boolean, all: any[]) => any) | undefined;
|
|
42
50
|
"onClick:row"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
43
51
|
"onDblclick:row"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
@@ -49,6 +57,12 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
49
57
|
row: any;
|
|
50
58
|
old: any;
|
|
51
59
|
}[]) => any) | undefined;
|
|
60
|
+
"onHover:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
61
|
+
"onLeave:slider"?: ((e: MouseEvent, data: any) => any) | undefined;
|
|
62
|
+
"onClick:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
63
|
+
"onContextmenu:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
64
|
+
"onHover:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
65
|
+
"onLeave:baseline"?: ((e: MouseEvent, data: any, baseline: any) => any) | undefined;
|
|
52
66
|
}>, {
|
|
53
67
|
options: IOptions;
|
|
54
68
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -7,6 +7,7 @@ export type XGanttVueEmits = {
|
|
|
7
7
|
"update:link": [link: ILink];
|
|
8
8
|
"create:link": [link: ILink];
|
|
9
9
|
"select:link": [add: ILink | null, cancel: ILink | null, all: ILink[]];
|
|
10
|
+
"contextmenu:link": [e: MouseEvent, link: ILink];
|
|
10
11
|
select: [data: any[], checked: boolean, all: any[]];
|
|
11
12
|
"click:row": [e: MouseEvent, data: any];
|
|
12
13
|
"dblclick:row": [e: MouseEvent, data: any];
|
|
@@ -18,6 +19,12 @@ export type XGanttVueEmits = {
|
|
|
18
19
|
row: any;
|
|
19
20
|
old: any;
|
|
20
21
|
}[]];
|
|
22
|
+
"hover:slider": [e: MouseEvent, data: any];
|
|
23
|
+
"leave:slider": [e: MouseEvent, data: any];
|
|
24
|
+
"click:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
25
|
+
"contextmenu:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
26
|
+
"hover:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
27
|
+
"leave:baseline": [e: MouseEvent, data: any, baseline: any];
|
|
21
28
|
};
|
|
22
29
|
export interface XGanttVueProps {
|
|
23
30
|
/**
|