@dhtmlx/trial-vue-gantt 1.1.2 → 9.1.4

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.
Files changed (46) hide show
  1. package/README.md +126 -262
  2. package/dist/dhtmlxgantt.vue.es.d.ts +352 -0
  3. package/dist/dhtmlxgantt.vue.es.js +18052 -0
  4. package/dist/vue-gantt.css +1 -0
  5. package/license.txt +43 -0
  6. package/package.json +55 -62
  7. package/whatsnew.md +1157 -0
  8. package/public/dist/gantt.js +0 -1
  9. package/src/components/Gantt.vue +0 -238
  10. package/src/components/TimeScale.vue +0 -57
  11. package/src/components/chart/Bars.vue +0 -470
  12. package/src/components/chart/CellGrid.vue +0 -22
  13. package/src/components/chart/Chart.vue +0 -236
  14. package/src/components/chart/Links.vue +0 -35
  15. package/src/components/chart/NewLink.vue +0 -39
  16. package/src/components/grid/Body.vue +0 -256
  17. package/src/components/grid/Grid.vue +0 -98
  18. package/src/components/grid/Header.vue +0 -104
  19. package/src/components/grid/actions/reorder.js +0 -193
  20. package/src/components/sidebar/Links.vue +0 -147
  21. package/src/components/sidebar/Sidebar.vue +0 -219
  22. package/src/locales/cn.js +0 -21
  23. package/src/locales/en.js +0 -21
  24. package/src/locales/ru.js +0 -21
  25. package/src/main.js +0 -46
  26. package/src/state/local.js +0 -48
  27. package/src/wx/Button.vue +0 -54
  28. package/src/wx/CNLocale.js +0 -15
  29. package/src/wx/Calendar.vue +0 -194
  30. package/src/wx/Counter.vue +0 -154
  31. package/src/wx/Datepicker.vue +0 -153
  32. package/src/wx/DefaultTheme.vue +0 -104
  33. package/src/wx/ENLocale.js +0 -15
  34. package/src/wx/IconButton.vue +0 -39
  35. package/src/wx/MaterialTheme.vue +0 -107
  36. package/src/wx/RULocale.js +0 -15
  37. package/src/wx/Select.vue +0 -75
  38. package/src/wx/Slider.vue +0 -150
  39. package/src/wx/Text.vue +0 -73
  40. package/src/wx/Textarea.vue +0 -63
  41. package/src/wx/Tooltip.vue +0 -110
  42. package/src/wx/index.js +0 -35
  43. package/src/wx/locale.js +0 -1
  44. package/src/wx/locales/cn.js +0 -39
  45. package/src/wx/locales/en.js +0 -39
  46. package/src/wx/locales/ru.js +0 -39
@@ -1,147 +0,0 @@
1
- <template>
2
- <template v-for="(links, index) in linksData" :key="index">
3
- <div v-if="links.data.length" class="links">
4
- <p class="label">{{ links.title }}</p>
5
-
6
- <table class="table" @click="click">
7
- <tr v-for="obj in links.data" :key="obj" class="row">
8
- <td class="cell">
9
- <div class="task-name">
10
- {{ obj.task.text || obj.task.textRight || obj.task.textLeft }}
11
- </div>
12
- </td>
13
-
14
- <td class="cell">
15
- <div class="wrapper">
16
- <select
17
- class="select"
18
- :value="obj.link.type"
19
- :data-id="obj.link.id"
20
- @change="select"
21
- >
22
- <option v-for="item in list" :key="item.id" :value="item.id">
23
- {{ item.text }}
24
- </option>
25
- </select>
26
- <div class="icon-more" />
27
- </div>
28
- </td>
29
-
30
- <td>
31
- <div
32
- class="icon-delete"
33
- data-action="delete-link"
34
- :data-id="obj.link.id"
35
- />
36
- </td>
37
- </tr>
38
- </table>
39
- </div>
40
- </template>
41
- </template>
42
-
43
- <script>
44
- export default {
45
- props: ["linksData"],
46
-
47
- emits: ["action"],
48
-
49
- data: () => ({
50
- list: [
51
- { id: 0, text: "End-to-start" },
52
- { id: 1, text: "Start-to-start" },
53
- { id: 2, text: "End-to-end" },
54
- { id: 3, text: "Start-to-end" },
55
- ],
56
- }),
57
-
58
- methods: {
59
- click(e) {
60
- const { action, id } = e.target.dataset;
61
- if (action) {
62
- this.$emit("action", { action, id });
63
- }
64
- },
65
-
66
- select(e) {
67
- const id = e.target.dataset.id;
68
- const value = e.target.value * 1;
69
- this.$emit("action", {
70
- action: "update-link",
71
- id,
72
- obj: { type: value },
73
- });
74
- },
75
- },
76
- };
77
- </script>
78
-
79
- <style scoped>
80
- .links {
81
- margin-bottom: 10px;
82
- }
83
-
84
- .label {
85
- margin-bottom: 10px;
86
- font: var(--wx-label-font);
87
- color: var(--wx-label-font-color);
88
- }
89
-
90
- .cell {
91
- text-align: center;
92
- }
93
-
94
- .task-name {
95
- font: var(--wx-input-font);
96
- color: var(--wx-input-font-color);
97
- width: 90px;
98
- text-align: left;
99
- overflow: hidden;
100
- white-space: nowrap;
101
- }
102
-
103
- .wrapper {
104
- width: 225px;
105
- position: relative;
106
- display: flex;
107
- }
108
-
109
- .select {
110
- width: 100%;
111
- padding: var(--wx-input-padding);
112
- border: var(--wx-input-border);
113
- border-radius: var(--wx-input-border-radius);
114
- font: var(--wx-input-font);
115
- color: var(--wx-input-font-color);
116
- outline: none;
117
- appearance: none;
118
- }
119
-
120
- .select:focus {
121
- border: 1px solid var(--wx-input-focus-color);
122
- }
123
-
124
- .icon-more {
125
- position: absolute;
126
- top: 50%;
127
- right: 11px;
128
- width: 20px;
129
- height: 20px;
130
- transform: translateY(-50%);
131
- background: var(--wx-show-more-icon) center center no-repeat;
132
- pointer-events: none;
133
- }
134
-
135
- .icon-delete {
136
- width: 20px;
137
- height: 20px;
138
- margin-left: 12px;
139
- background: var(--wx-remove-link-icon) center center no-repeat;
140
- opacity: 0.2;
141
- cursor: pointer;
142
- }
143
-
144
- .icon-delete:hover {
145
- opacity: 1;
146
- }
147
- </style>
@@ -1,219 +0,0 @@
1
- <template>
2
- <div :class="['sidebar', { compact: compactMode }]">
3
- <div class="header">
4
- <div class="icon-close" @click="hide"></div>
5
- <div class="buttons">
6
- <Button @click="hide"> {{ t("gantt", "Save") }} </Button>
7
- <Button appearance="danger" @click="remove">
8
- {{ t("gantt", "Delete") }}
9
- </Button>
10
- </div>
11
- </div>
12
- <div class="body">
13
- <component
14
- v-if="template"
15
- :is="templates.sidebarForm"
16
- :task="task"
17
- :linksData="linksData"
18
- @action="action"
19
- ></component>
20
-
21
- <template v-else>
22
- <Text
23
- :label="t('gantt', 'Name')"
24
- :value="task.text"
25
- :autofocus="true"
26
- @change="v => update('text', v)"
27
- />
28
-
29
- <Textarea
30
- :label="t('gantt', 'Type')"
31
- :value="task.details"
32
- @change="v => update('details', v)"
33
- />
34
-
35
- <Select
36
- v-if="taskTypes.length > 1"
37
- :label="t('gantt', 'Type')"
38
- :value="task.type"
39
- :options="taskTypes"
40
- @change="v => update('type', v)"
41
- />
42
-
43
- <Datepicker
44
- :label="t('gantt', 'Start Date')"
45
- :value="task.start_date"
46
- :readonly="true"
47
- @change="v => update('start_date', v)"
48
- />
49
-
50
- <template v-if="!milestone">
51
- <Datepicker
52
- :label="t('gantt', 'End Date')"
53
- :value="task.end_date"
54
- :readonly="true"
55
- @change="v => update('end_date', v)"
56
- />
57
-
58
- <Counter
59
- :label="t('gantt', 'Duration')"
60
- :value="task.duration"
61
- @change="v => update('duration', v)"
62
- />
63
-
64
- <Slider
65
- :label="`${t('gantt', 'Progress')}: ${task.progress}%`"
66
- :value="task.progress"
67
- @change="v => update('progress', v)"
68
- />
69
- </template>
70
-
71
- <Links :linksData="linksData" @action="action" />
72
- </template>
73
- </div>
74
- </div>
75
- </template>
76
-
77
- <script>
78
- import { getDiffer, getAdder } from "@dhtmlx/trial-lib-gantt";
79
- import Button from "../../wx/Button.vue";
80
- import Text from "../../wx/Text.vue";
81
- import Select from "../../wx/Select.vue";
82
- import Textarea from "../../wx/Textarea.vue";
83
- import Slider from "../../wx/Slider.vue";
84
- import Datepicker from "../../wx/Datepicker.vue";
85
- import Counter from "../../wx/Counter.vue";
86
- import Links from "./Links.vue";
87
-
88
- import { LocaleContext } from "@/wx/locale";
89
- import { inject } from "vue";
90
-
91
- const addDay = getAdder("day");
92
- const diffDay = getDiffer("day");
93
-
94
- export default {
95
- components: {
96
- Button,
97
- Text,
98
- Textarea,
99
- Select,
100
- Slider,
101
- Datepicker,
102
- Counter,
103
- Links,
104
- },
105
-
106
- props: [
107
- "compactMode",
108
- "taskTypes",
109
- "templates",
110
- "task",
111
- "links",
112
- "tasksMap",
113
- ],
114
-
115
- setup() {
116
- return { t: inject(LocaleContext).__ };
117
- },
118
-
119
- methods: {
120
- hide() {
121
- this.$emit("action", { action: "hide-details" });
122
- },
123
-
124
- remove() {
125
- this.$emit("action", { action: "delete-task", id: this.task.id });
126
- this.$emit("action", { action: "hide-details" });
127
- },
128
-
129
- action(e) {
130
- this.$emit("action", e);
131
- },
132
-
133
- update(name, value) {
134
- const { task } = this;
135
- task[name] = value;
136
-
137
- switch (name) {
138
- case "start_date":
139
- case "end_date":
140
- task.duration = diffDay(task.end_date, task.start_date);
141
- break;
142
-
143
- case "duration":
144
- task.duration = value * 1;
145
- task.end_date = addDay(task.start_date, task.duration);
146
- break;
147
- }
148
-
149
- this.$emit("action", { action: "update-task", id: task.id, obj: task });
150
- },
151
- },
152
-
153
- computed: {
154
- linksData() {
155
- const inLinks = this.links
156
- .filter(a => a.target == this.task.id)
157
- .map(link => ({ link, task: this.tasksMap[link.source] }));
158
-
159
- const outLinks = this.links
160
- .filter(a => a.source == this.task.id)
161
- .map(link => ({ link, task: this.tasksMap[link.target] }));
162
-
163
- return [
164
- { title: this.t("gantt", "Predecessors"), data: inLinks },
165
- { title: this.t("gantt", "Successors"), data: outLinks },
166
- ];
167
- },
168
-
169
- milestone() {
170
- return this.task.type === "milestone";
171
- },
172
-
173
- template() {
174
- return this.templates && this.templates.sidebarForm;
175
- },
176
- },
177
- };
178
- </script>
179
-
180
- <style scoped>
181
- .sidebar {
182
- flex: 0 0 400px;
183
- display: flex;
184
- flex-direction: column;
185
- box-sizing: border-box;
186
- height: 100%;
187
- background: #fff;
188
- box-shadow: 0px 1px 30px rgba(0, 0, 0, 0.25);
189
- overflow: hidden;
190
- }
191
-
192
- .sidebar.compact {
193
- position: absolute;
194
- width: 100%;
195
- z-index: 5;
196
- }
197
-
198
- .header {
199
- box-sizing: border-box;
200
- display: flex;
201
- justify-content: space-between;
202
- align-items: center;
203
- padding: 11px 20px;
204
- border-bottom: 1px solid var(--wx-border-color);
205
- }
206
-
207
- .body {
208
- flex: 1 1 auto;
209
- padding: 20px;
210
- overflow: auto;
211
- }
212
-
213
- .icon-close {
214
- width: 24px;
215
- height: 27px;
216
- background: var(--wx-close-sb-icon) center center no-repeat;
217
- cursor: pointer;
218
- }
219
- </style>
package/src/locales/cn.js DELETED
@@ -1,21 +0,0 @@
1
- export default {
2
- gantt: {
3
- // Header
4
- "Task name": "任务名称",
5
- "Start time": "开始时间",
6
- Duration: "期间",
7
-
8
- // Sidebar
9
- Save: "保存",
10
- Delete: "删除",
11
- Name: "名称",
12
- Description: "描述",
13
- Type: "类型",
14
- "Start Date": "开始日期",
15
- "End Date": "结束日期",
16
- // Duration: "期间",
17
- Progress: "进步",
18
- Predecessors: "前辈",
19
- Successors: "后继者",
20
- },
21
- };
package/src/locales/en.js DELETED
@@ -1,21 +0,0 @@
1
- export default {
2
- gantt: {
3
- // Header
4
- "Task name": "Task name",
5
- "Start time": "Start time",
6
- Duration: "Duration",
7
-
8
- // Sidebar
9
- Save: "Save",
10
- Delete: "Delete",
11
- Name: "Name",
12
- Description: "Description",
13
- Type: "Type",
14
- "Start date": "Start date",
15
- "End date": "End date",
16
- // Duration: "Duration",
17
- Progress: "Progress",
18
- Predecessors: "Predecessors",
19
- Successors: "Successors",
20
- },
21
- };
package/src/locales/ru.js DELETED
@@ -1,21 +0,0 @@
1
- export default {
2
- gantt: {
3
- // Header
4
- "Task name": "Название",
5
- "Start time": "Начало",
6
- Duration: "Длительность",
7
-
8
- // Sidebar
9
- Save: "Сохранить",
10
- Delete: "Удалить",
11
- Name: "Задача",
12
- Description: "Описание",
13
- Type: "Тип",
14
- "Start Date": "Дата выполнения",
15
- "End Date": "Дата окончания",
16
- // Duration: "Длительность",
17
- Progress: "Прогресс",
18
- Predecessors: "Предшественники",
19
- Successors: "Преемники",
20
- },
21
- };
package/src/main.js DELETED
@@ -1,46 +0,0 @@
1
- import Gantt from "./components/Gantt.vue";
2
- export default Gantt;
3
-
4
- import Button from "@/wx/Button.vue";
5
- import Calendar from "@/wx/Calendar.vue";
6
- import Counter from "@/wx/Counter.vue";
7
- import Datepicker from "@/wx/Datepicker.vue";
8
- import Select from "@/wx/Select.vue";
9
- import Slider from "@/wx/Slider.vue";
10
- import Text from "@/wx/Text.vue";
11
- import Textarea from "@/wx/Textarea.vue";
12
- import Tooltip from "@/wx/Tooltip.vue";
13
-
14
- import MaterialTheme from "@/wx/MaterialTheme.vue";
15
- import DefaultTheme from "@/wx/DefaultTheme.vue";
16
-
17
- import RULocale from "@/wx/RULocale";
18
- import ENLocale from "@/wx/ENLocale";
19
- import CNLocale from "@/wx/CNLocale";
20
-
21
- import ru from "./locales/ru";
22
- import en from "./locales/en";
23
- import cn from "./locales/cn";
24
-
25
- const wx = {
26
- Button,
27
- Calendar,
28
- Counter,
29
- Datepicker,
30
- Select,
31
- Slider,
32
- Text,
33
- Textarea,
34
- Tooltip,
35
-
36
- MaterialTheme,
37
- DefaultTheme,
38
-
39
- RULocale,
40
- ENLocale,
41
- CNLocale,
42
- };
43
-
44
- const locales = { ru, en, cn };
45
-
46
- export { Gantt, wx, MaterialTheme, DefaultTheme, locales };
@@ -1,48 +0,0 @@
1
- import { nextTick } from "vue";
2
- import { LocalData, LocalState } from "@dhtmlx/trial-lib-gantt";
3
-
4
- export class VueLocalData extends LocalData {
5
- constructor(vm) {
6
- super(vm.$emit.bind(vm));
7
- this._vm = vm;
8
- }
9
- updateStore(obj) {
10
- super.updateStore(obj);
11
- for (var key in obj) {
12
- const fullKey = key + "State";
13
- if (typeof this._vm[fullKey] !== "undefined")
14
- this._vm[fullKey] = this.state[key];
15
- }
16
- }
17
- }
18
-
19
- export class VueLocalState extends LocalState {
20
- constructor(vm) {
21
- const wrapper = (v, n) => {
22
- let h = [];
23
- return {
24
- set: nv => {
25
- if (v !== nv) {
26
- v = vm[n] = nv;
27
- h.forEach(x => x(nv));
28
- }
29
- },
30
- subscribe: x => {
31
- h.push(x);
32
- x(v);
33
- },
34
- };
35
- };
36
- super(wrapper);
37
- }
38
- getValues() {
39
- const data = super.getState();
40
- const out = {};
41
- for (var key in data) data[key].subscribe(v => (out[key] = v));
42
-
43
- return out;
44
- }
45
- actions(store, dispatch) {
46
- return super.actions(store, dispatch, nextTick);
47
- }
48
- }
package/src/wx/Button.vue DELETED
@@ -1,54 +0,0 @@
1
- <template>
2
- <button :class="['btn', appearance]" @click="$emit('click')">
3
- <slot />
4
- </button>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- props: {
10
- appearance: { type: String, default: "primary" },
11
- },
12
- emits: ["click"],
13
- };
14
- </script>
15
-
16
- <style scoped>
17
- .btn {
18
- min-width: 82px;
19
- padding: 8px 16px;
20
- border: none;
21
- border-radius: var(--wx-button-radius);
22
- font: var(--wx-button-font);
23
- text-transform: uppercase;
24
- cursor: pointer;
25
- }
26
-
27
- .btn:active {
28
- outline: none;
29
- opacity: 0.7;
30
- }
31
-
32
- .btn:focus {
33
- outline: none;
34
- }
35
-
36
- .primary {
37
- margin-right: 20px;
38
- color: var(--wx-button-primary-font-color);
39
- background-color: var(--wx-button-primary-color);
40
- }
41
-
42
- .primary:hover {
43
- background-color: var(--wx-button-primary-color-hover);
44
- }
45
-
46
- .danger {
47
- color: var(--wx-button-danger-font-color);
48
- background-color: var(--wx-button-danger-color);
49
- }
50
-
51
- .danger:hover {
52
- background-color: var(--wx-button-danger-color-hover);
53
- }
54
- </style>
@@ -1,15 +0,0 @@
1
- import { provide, readonly } from "vue";
2
- import { LocaleContext } from "./locale";
3
- import locale from "./locales/cn";
4
-
5
- export default {
6
- setup(props) {
7
- if (props.words)
8
- provide(LocaleContext, readonly(locale().extend(props.words)));
9
- else provide(LocaleContext, readonly(locale()));
10
- },
11
- props: ["words"],
12
- render() {
13
- return this.$slots.default();
14
- },
15
- };