@xpyjs/gantt-vue 0.0.1-beta.0 → 0.0.1-beta.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/dist/index.js +37 -30
- 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 +5 -1
- package/types/index.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as p, ref as k, watch as f, onMounted as v, onUnmounted as x, createElementBlock as _, openBlock as b, nextTick as
|
|
2
|
-
import { XGantt as
|
|
3
|
-
import { colorjs 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 h } from "vue";
|
|
2
|
+
import { XGantt as w } from "@xpyjs/gantt-core";
|
|
3
|
+
import { colorjs as E, dayjs as T, generateId as X } from "@xpyjs/gantt-core";
|
|
4
4
|
const g = /* @__PURE__ */ p({
|
|
5
5
|
__name: "GanttVue",
|
|
6
6
|
props: {
|
|
7
7
|
options: { default: () => ({}) }
|
|
8
8
|
},
|
|
9
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(
|
|
11
|
-
const l =
|
|
10
|
+
setup(n, { expose: r, emit: o }) {
|
|
11
|
+
const l = n, c = o, i = k();
|
|
12
12
|
let e = null;
|
|
13
|
-
const
|
|
14
|
-
i.value && (await
|
|
15
|
-
},
|
|
13
|
+
const u = async () => {
|
|
14
|
+
i.value && (await h(), e = new w(i.value, l.options), d());
|
|
15
|
+
}, d = () => {
|
|
16
16
|
if (!e) return;
|
|
17
17
|
[
|
|
18
18
|
"loaded",
|
|
@@ -35,22 +35,22 @@ const g = /* @__PURE__ */ p({
|
|
|
35
35
|
"contextmenu:baseline",
|
|
36
36
|
"hover:baseline",
|
|
37
37
|
"leave:baseline"
|
|
38
|
-
].forEach((
|
|
38
|
+
].forEach((a) => {
|
|
39
39
|
e.on(
|
|
40
|
-
|
|
40
|
+
a,
|
|
41
41
|
(...m) => {
|
|
42
|
-
|
|
42
|
+
c(a, ...m);
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
return f(
|
|
48
48
|
() => l,
|
|
49
|
-
(
|
|
50
|
-
e && e.update(
|
|
49
|
+
(t) => {
|
|
50
|
+
e && e.update(t.options);
|
|
51
51
|
},
|
|
52
52
|
{ deep: !0 }
|
|
53
|
-
),
|
|
53
|
+
), r({
|
|
54
54
|
/**
|
|
55
55
|
* 获取甘特图实例
|
|
56
56
|
*/
|
|
@@ -58,32 +58,39 @@ const g = /* @__PURE__ */ p({
|
|
|
58
58
|
/**
|
|
59
59
|
* 跳转日期
|
|
60
60
|
*/
|
|
61
|
-
jumpTo: (
|
|
62
|
-
e && e.jumpTo(
|
|
61
|
+
jumpTo: (t) => {
|
|
62
|
+
e && e.jumpTo(t);
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* 获取指定任务的所有相关联的完整路径,包含所有连接线与任务节点
|
|
66
|
+
*/
|
|
67
|
+
getDataChain: (t) => {
|
|
68
|
+
if (e)
|
|
69
|
+
return e.getDataChain(t);
|
|
63
70
|
}
|
|
64
71
|
}), v(() => {
|
|
65
|
-
|
|
72
|
+
u();
|
|
66
73
|
}), x(() => {
|
|
67
74
|
e && (e.destroy(), e = null);
|
|
68
|
-
}), (
|
|
75
|
+
}), (t, a) => (b(), _("div", {
|
|
69
76
|
ref_key: "containerRef",
|
|
70
77
|
ref: i,
|
|
71
78
|
class: "x-gantt-container"
|
|
72
79
|
}, null, 512));
|
|
73
80
|
}
|
|
74
|
-
}), G = (
|
|
75
|
-
const o =
|
|
76
|
-
for (const [l,
|
|
77
|
-
o[l] =
|
|
81
|
+
}), G = (n, r) => {
|
|
82
|
+
const o = n.__vccOpts || n;
|
|
83
|
+
for (const [l, c] of r)
|
|
84
|
+
o[l] = c;
|
|
78
85
|
return o;
|
|
79
|
-
}, y = /* @__PURE__ */ G(g, [["__scopeId", "data-v-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
}, y = /* @__PURE__ */ G(g, [["__scopeId", "data-v-220f3198"]]), s = y;
|
|
87
|
+
s.install = (n) => {
|
|
88
|
+
n.component("XGanttVue", s);
|
|
82
89
|
};
|
|
83
90
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
s as XGanttVue,
|
|
92
|
+
E as colorjs,
|
|
93
|
+
T as dayjs,
|
|
94
|
+
s as default,
|
|
95
|
+
X as generateId
|
|
89
96
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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,r){"use strict";const c=((o,a)=>{const l=o.__vccOpts||o;for(const[s,u]of a)l[s]=u;return l})(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","hover:slider","leave:slider","click:baseline","contextmenu:baseline","hover:baseline","leave:baseline"],setup(o,{expose:a,emit:l}){const s=o,u=l,d=n.ref();let e=null;const p=async()=>{d.value&&(await n.nextTick(),e=new r.XGantt(d.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","hover:slider","leave:slider","click:baseline","contextmenu:baseline","hover:baseline","leave:baseline"].forEach(f=>{e.on(f,(...k)=>{u(f,...k)})})};return n.watch(()=>s,i=>{e&&e.update(i.options)},{deep:!0}),a({getInstance:()=>e,jumpTo:i=>{e&&e.jumpTo(i)},getDataChain:i=>{if(e)return e.getDataChain(i)}}),n.onMounted(()=>{p()}),n.onUnmounted(()=>{e&&(e.destroy(),e=null)}),(i,f)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:d,class:"x-gantt-container"},null,512))}}),[["__scopeId","data-v-220f3198"]]);c.install=o=>{o.component("XGanttVue",c)},Object.defineProperty(t,"colorjs",{enumerable:!0,get:()=>r.colorjs}),Object.defineProperty(t,"dayjs",{enumerable:!0,get:()=>r.dayjs}),Object.defineProperty(t,"generateId",{enumerable:!0,get:()=>r.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-220f3198]{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-beta.
|
|
4
|
+
"version": "0.0.1-beta.1",
|
|
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-beta.
|
|
26
|
+
"@xpyjs/gantt-core": "0.0.1-beta.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vitejs/plugin-vue": "^5.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XGantt, ErrorType, ILink, IOptions } from '@xpyjs/gantt-core';
|
|
1
|
+
import { XGantt, DataChain, ErrorType, ILink, IOptions } from '@xpyjs/gantt-core';
|
|
2
2
|
import { XGanttVueProps } from './props';
|
|
3
3
|
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
|
|
4
4
|
|
|
@@ -13,6 +13,10 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
|
|
|
13
13
|
* 跳转日期
|
|
14
14
|
*/
|
|
15
15
|
jumpTo: (date?: any) => void;
|
|
16
|
+
/**
|
|
17
|
+
* 获取指定任务的所有相关联的完整路径,包含所有连接线与任务节点
|
|
18
|
+
*/
|
|
19
|
+
getDataChain: (taskId: string) => DataChain | undefined;
|
|
16
20
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
21
|
loaded: () => void;
|
|
18
22
|
error: (error: ErrorType) => void;
|
package/types/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ declare const XGanttVue: typeof GanttVue & {
|
|
|
9
9
|
};
|
|
10
10
|
export { XGanttVue };
|
|
11
11
|
export default XGanttVue;
|
|
12
|
-
export type { IOptions, IOptionConfig, EmitData, EventMap, ILink, ErrorType, Dayjs, Colorjs, XGanttUnit } from '@xpyjs/gantt-core';
|
|
12
|
+
export type { IOptions, IOptionConfig, EmitData, EventMap, ILink, ErrorType, Dayjs, Colorjs, XGanttUnit, DataChain, LinkType } from '@xpyjs/gantt-core';
|
|
13
13
|
export { generateId, dayjs, colorjs } from '@xpyjs/gantt-core';
|