@vmscloud/moz-ui-gantt-vue 0.0.0-stage → 0.2.0
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.cjs +60 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +60 -0
- package/dist/style.css +1136 -0
- package/package.json +57 -4
- package/README.md +0 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const mozUiGanttCore = require("@vmscloud/moz-ui-gantt-core");
|
|
5
|
+
const MozGantt = vue.defineComponent({
|
|
6
|
+
name: "MozGantt",
|
|
7
|
+
props: { options: { type: Object, required: true } },
|
|
8
|
+
emits: {
|
|
9
|
+
initialized: (_value) => true,
|
|
10
|
+
search: (_value) => true,
|
|
11
|
+
zoom: (_value) => true,
|
|
12
|
+
taskClick: (_value) => true,
|
|
13
|
+
taskActivate: (_value) => true,
|
|
14
|
+
taskDoubleClick: (_value) => true,
|
|
15
|
+
milestoneClick: (_value) => true,
|
|
16
|
+
milestoneDoubleClick: (_value) => true,
|
|
17
|
+
rowClick: (_value) => true,
|
|
18
|
+
rowDoubleClick: (_value) => true,
|
|
19
|
+
contextMenu: (_value) => true,
|
|
20
|
+
taskContextMenu: (_value) => true,
|
|
21
|
+
milestoneContextMenu: (_value) => true,
|
|
22
|
+
rowContextMenu: (_value) => true,
|
|
23
|
+
menuAction: (_value) => true,
|
|
24
|
+
selectionChange: (_value) => true,
|
|
25
|
+
dataError: (_value) => true
|
|
26
|
+
},
|
|
27
|
+
setup(props, { emit, expose }) {
|
|
28
|
+
const host = vue.shallowRef();
|
|
29
|
+
let core = null;
|
|
30
|
+
vue.onMounted(() => {
|
|
31
|
+
if (!host.value) return;
|
|
32
|
+
core = new mozUiGanttCore.MozGantt(host.value, props.options);
|
|
33
|
+
core.on("search", (state) => emit("search", state));
|
|
34
|
+
core.on("zoom", (state) => emit("zoom", state));
|
|
35
|
+
core.on("taskClick", (state) => emit("taskClick", state));
|
|
36
|
+
core.on("taskActivate", (state) => emit("taskActivate", state));
|
|
37
|
+
core.on("taskDoubleClick", (state) => emit("taskDoubleClick", state));
|
|
38
|
+
core.on("milestoneClick", (state) => emit("milestoneClick", state));
|
|
39
|
+
core.on("milestoneDoubleClick", (state) => emit("milestoneDoubleClick", state));
|
|
40
|
+
core.on("rowClick", (state) => emit("rowClick", state));
|
|
41
|
+
core.on("rowDoubleClick", (state) => emit("rowDoubleClick", state));
|
|
42
|
+
core.on("contextMenu", (state) => emit("contextMenu", state));
|
|
43
|
+
core.on("taskContextMenu", (state) => emit("taskContextMenu", state));
|
|
44
|
+
core.on("milestoneContextMenu", (state) => emit("milestoneContextMenu", state));
|
|
45
|
+
core.on("rowContextMenu", (state) => emit("rowContextMenu", state));
|
|
46
|
+
core.on("menuAction", (state) => emit("menuAction", state));
|
|
47
|
+
core.on("selectionChange", (state) => emit("selectionChange", state));
|
|
48
|
+
core.on("dataError", (state) => emit("dataError", state));
|
|
49
|
+
emit("initialized", core);
|
|
50
|
+
});
|
|
51
|
+
vue.watch(() => props.options, (options) => core == null ? void 0 : core.update(options));
|
|
52
|
+
vue.onBeforeUnmount(() => {
|
|
53
|
+
core == null ? void 0 : core.destroy();
|
|
54
|
+
core = null;
|
|
55
|
+
});
|
|
56
|
+
expose({ getGantt: () => core });
|
|
57
|
+
return () => vue.h("div", { ref: host, style: { height: "100%", minHeight: "180px" } });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
exports.MozGantt = MozGantt;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MozGantt as GanttCore, GanttOptions, GanttEvents } from '@vmscloud/moz-ui-gantt-core';
|
|
3
|
+
export type * from '@vmscloud/moz-ui-gantt-core';
|
|
4
|
+
export interface MozGanttExposed {
|
|
5
|
+
getGantt(): GanttCore | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const MozGantt: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
options: {
|
|
9
|
+
type: PropType<GanttOptions>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
initialized: (_value: GanttCore) => true;
|
|
16
|
+
search: (_value: GanttEvents["search"]) => true;
|
|
17
|
+
zoom: (_value: GanttEvents["zoom"]) => true;
|
|
18
|
+
taskClick: (_value: GanttEvents["taskClick"]) => true;
|
|
19
|
+
taskActivate: (_value: GanttEvents["taskActivate"]) => true;
|
|
20
|
+
taskDoubleClick: (_value: GanttEvents["taskDoubleClick"]) => true;
|
|
21
|
+
milestoneClick: (_value: GanttEvents["milestoneClick"]) => true;
|
|
22
|
+
milestoneDoubleClick: (_value: GanttEvents["milestoneDoubleClick"]) => true;
|
|
23
|
+
rowClick: (_value: GanttEvents["rowClick"]) => true;
|
|
24
|
+
rowDoubleClick: (_value: GanttEvents["rowDoubleClick"]) => true;
|
|
25
|
+
contextMenu: (_value: GanttEvents["contextMenu"]) => true;
|
|
26
|
+
taskContextMenu: (_value: GanttEvents["taskContextMenu"]) => true;
|
|
27
|
+
milestoneContextMenu: (_value: GanttEvents["milestoneContextMenu"]) => true;
|
|
28
|
+
rowContextMenu: (_value: GanttEvents["rowContextMenu"]) => true;
|
|
29
|
+
menuAction: (_value: GanttEvents["menuAction"]) => true;
|
|
30
|
+
selectionChange: (_value: GanttEvents["selectionChange"]) => true;
|
|
31
|
+
dataError: (_value: GanttEvents["dataError"]) => true;
|
|
32
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
33
|
+
options: {
|
|
34
|
+
type: PropType<GanttOptions>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
}>> & Readonly<{
|
|
38
|
+
onSearch?: ((_value: import('@vmscloud/moz-ui-gantt-core').SearchState | null) => any) | undefined;
|
|
39
|
+
onZoom?: ((_value: {
|
|
40
|
+
pxPerTick: number;
|
|
41
|
+
}) => any) | undefined;
|
|
42
|
+
onTaskClick?: ((_value: {
|
|
43
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
44
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
45
|
+
event: MouseEvent;
|
|
46
|
+
}) => any) | undefined;
|
|
47
|
+
onTaskActivate?: ((_value: {
|
|
48
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
49
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
50
|
+
source: "pointer" | "keyboard";
|
|
51
|
+
event: MouseEvent | KeyboardEvent;
|
|
52
|
+
}) => any) | undefined;
|
|
53
|
+
onTaskDoubleClick?: ((_value: {
|
|
54
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
55
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
56
|
+
event: MouseEvent;
|
|
57
|
+
}) => any) | undefined;
|
|
58
|
+
onMilestoneClick?: ((_value: {
|
|
59
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
60
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
61
|
+
event: MouseEvent | KeyboardEvent;
|
|
62
|
+
}) => any) | undefined;
|
|
63
|
+
onMilestoneDoubleClick?: ((_value: {
|
|
64
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
65
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
66
|
+
event: MouseEvent;
|
|
67
|
+
}) => any) | undefined;
|
|
68
|
+
onRowClick?: ((_value: {
|
|
69
|
+
field: string;
|
|
70
|
+
rowPath: readonly unknown[];
|
|
71
|
+
ids: readonly import('@vmscloud/moz-ui-gantt-core').GanttRowId[];
|
|
72
|
+
event: MouseEvent | KeyboardEvent;
|
|
73
|
+
}) => any) | undefined;
|
|
74
|
+
onRowDoubleClick?: ((_value: {
|
|
75
|
+
field: string;
|
|
76
|
+
rowPath: readonly unknown[];
|
|
77
|
+
ids: readonly import('@vmscloud/moz-ui-gantt-core').GanttRowId[];
|
|
78
|
+
event: MouseEvent | KeyboardEvent;
|
|
79
|
+
}) => any) | undefined;
|
|
80
|
+
onContextMenu?: ((_value: {
|
|
81
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
82
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
83
|
+
event: MouseEvent | KeyboardEvent;
|
|
84
|
+
}) => any) | undefined;
|
|
85
|
+
onTaskContextMenu?: ((_value: {
|
|
86
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
87
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
88
|
+
event: MouseEvent | KeyboardEvent;
|
|
89
|
+
}) => any) | undefined;
|
|
90
|
+
onMilestoneContextMenu?: ((_value: {
|
|
91
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
92
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
93
|
+
event: MouseEvent | KeyboardEvent;
|
|
94
|
+
}) => any) | undefined;
|
|
95
|
+
onRowContextMenu?: ((_value: {
|
|
96
|
+
field: string;
|
|
97
|
+
rowPath: readonly unknown[];
|
|
98
|
+
ids: readonly import('@vmscloud/moz-ui-gantt-core').GanttRowId[];
|
|
99
|
+
event: MouseEvent | KeyboardEvent;
|
|
100
|
+
}) => any) | undefined;
|
|
101
|
+
onMenuAction?: ((_value: {
|
|
102
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId;
|
|
103
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow;
|
|
104
|
+
action: string;
|
|
105
|
+
event: MouseEvent | KeyboardEvent;
|
|
106
|
+
}) => any) | undefined;
|
|
107
|
+
onSelectionChange?: ((_value: {
|
|
108
|
+
id: import('@vmscloud/moz-ui-gantt-core').GanttRowId | null;
|
|
109
|
+
row: import('@vmscloud/moz-ui-gantt-core').GanttRow | null;
|
|
110
|
+
}) => any) | undefined;
|
|
111
|
+
onDataError?: ((_value: {
|
|
112
|
+
error: unknown;
|
|
113
|
+
}) => any) | undefined;
|
|
114
|
+
onInitialized?: ((_value: GanttCore) => any) | undefined;
|
|
115
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, shallowRef, onMounted, watch, onBeforeUnmount, h } from "vue";
|
|
2
|
+
import { MozGantt as MozGantt$1 } from "@vmscloud/moz-ui-gantt-core";
|
|
3
|
+
const MozGantt = defineComponent({
|
|
4
|
+
name: "MozGantt",
|
|
5
|
+
props: { options: { type: Object, required: true } },
|
|
6
|
+
emits: {
|
|
7
|
+
initialized: (_value) => true,
|
|
8
|
+
search: (_value) => true,
|
|
9
|
+
zoom: (_value) => true,
|
|
10
|
+
taskClick: (_value) => true,
|
|
11
|
+
taskActivate: (_value) => true,
|
|
12
|
+
taskDoubleClick: (_value) => true,
|
|
13
|
+
milestoneClick: (_value) => true,
|
|
14
|
+
milestoneDoubleClick: (_value) => true,
|
|
15
|
+
rowClick: (_value) => true,
|
|
16
|
+
rowDoubleClick: (_value) => true,
|
|
17
|
+
contextMenu: (_value) => true,
|
|
18
|
+
taskContextMenu: (_value) => true,
|
|
19
|
+
milestoneContextMenu: (_value) => true,
|
|
20
|
+
rowContextMenu: (_value) => true,
|
|
21
|
+
menuAction: (_value) => true,
|
|
22
|
+
selectionChange: (_value) => true,
|
|
23
|
+
dataError: (_value) => true
|
|
24
|
+
},
|
|
25
|
+
setup(props, { emit, expose }) {
|
|
26
|
+
const host = shallowRef();
|
|
27
|
+
let core = null;
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
if (!host.value) return;
|
|
30
|
+
core = new MozGantt$1(host.value, props.options);
|
|
31
|
+
core.on("search", (state) => emit("search", state));
|
|
32
|
+
core.on("zoom", (state) => emit("zoom", state));
|
|
33
|
+
core.on("taskClick", (state) => emit("taskClick", state));
|
|
34
|
+
core.on("taskActivate", (state) => emit("taskActivate", state));
|
|
35
|
+
core.on("taskDoubleClick", (state) => emit("taskDoubleClick", state));
|
|
36
|
+
core.on("milestoneClick", (state) => emit("milestoneClick", state));
|
|
37
|
+
core.on("milestoneDoubleClick", (state) => emit("milestoneDoubleClick", state));
|
|
38
|
+
core.on("rowClick", (state) => emit("rowClick", state));
|
|
39
|
+
core.on("rowDoubleClick", (state) => emit("rowDoubleClick", state));
|
|
40
|
+
core.on("contextMenu", (state) => emit("contextMenu", state));
|
|
41
|
+
core.on("taskContextMenu", (state) => emit("taskContextMenu", state));
|
|
42
|
+
core.on("milestoneContextMenu", (state) => emit("milestoneContextMenu", state));
|
|
43
|
+
core.on("rowContextMenu", (state) => emit("rowContextMenu", state));
|
|
44
|
+
core.on("menuAction", (state) => emit("menuAction", state));
|
|
45
|
+
core.on("selectionChange", (state) => emit("selectionChange", state));
|
|
46
|
+
core.on("dataError", (state) => emit("dataError", state));
|
|
47
|
+
emit("initialized", core);
|
|
48
|
+
});
|
|
49
|
+
watch(() => props.options, (options) => core == null ? void 0 : core.update(options));
|
|
50
|
+
onBeforeUnmount(() => {
|
|
51
|
+
core == null ? void 0 : core.destroy();
|
|
52
|
+
core = null;
|
|
53
|
+
});
|
|
54
|
+
expose({ getGantt: () => core });
|
|
55
|
+
return () => h("div", { ref: host, style: { height: "100%", minHeight: "180px" } });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
MozGantt
|
|
60
|
+
};
|