@operato/scene-gantt 8.0.0-beta.1 → 8.0.0-beta.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.
Files changed (50) hide show
  1. package/package.json +2 -2
  2. package/CHANGELOG.md +0 -172
  3. package/db.sqlite +0 -0
  4. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +0 -90
  5. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +0 -105
  6. package/logs/application-2024-06-10-00.log +0 -6
  7. package/logs/application-2024-06-10-12.log +0 -6
  8. package/logs/application-2024-06-10-13.log +0 -18
  9. package/logs/application-2024-06-10-22.log +0 -10
  10. package/logs/application-2024-06-11-00.log +0 -6
  11. package/logs/application-2024-06-11-01.log +0 -7
  12. package/logs/application-2024-06-11-02.log +0 -12
  13. package/logs/application-2024-06-11-03.log +0 -12
  14. package/logs/application-2024-06-11-04.log +0 -12
  15. package/logs/application-2024-06-11-14.log +0 -6
  16. package/logs/application-2024-06-11-15.log +0 -6
  17. package/logs/application-2024-06-11-16.log +0 -6
  18. package/logs/application-2024-06-11-17.log +0 -24
  19. package/logs/application-2024-06-11-19.log +0 -36
  20. package/logs/application-2024-06-11-20.log +0 -24
  21. package/logs/application-2024-06-11-21.log +0 -6
  22. package/logs/connections-2024-06-04-11.log +0 -50
  23. package/logs/connections-2024-06-04-12.log +0 -0
  24. package/logs/connections-2024-06-04-13.log +0 -50
  25. package/logs/connections-2024-06-10-00.log +0 -50
  26. package/logs/connections-2024-06-10-12.log +0 -50
  27. package/logs/connections-2024-06-10-13.log +0 -150
  28. package/logs/connections-2024-06-10-22.log +0 -50
  29. package/logs/connections-2024-06-11-00.log +0 -50
  30. package/logs/connections-2024-06-11-01.log +0 -50
  31. package/logs/connections-2024-06-11-02.log +0 -100
  32. package/logs/connections-2024-06-11-03.log +0 -100
  33. package/logs/connections-2024-06-11-04.log +0 -100
  34. package/logs/connections-2024-06-11-14.log +0 -50
  35. package/logs/connections-2024-06-11-15.log +0 -50
  36. package/logs/connections-2024-06-11-16.log +0 -50
  37. package/logs/connections-2024-06-11-17.log +0 -200
  38. package/logs/connections-2024-06-11-19.log +0 -300
  39. package/logs/connections-2024-06-11-20.log +0 -200
  40. package/logs/connections-2024-06-11-21.log +0 -50
  41. package/schema.graphql +0 -3988
  42. package/src/data.ts +0 -1898
  43. package/src/editors/index.ts +0 -8
  44. package/src/gantt.ts +0 -265
  45. package/src/groups/index.ts +0 -0
  46. package/src/index.ts +0 -1
  47. package/src/templates/gantt.ts +0 -16
  48. package/src/templates/index.ts +0 -3
  49. package/tsconfig.json +0 -23
  50. package/tsconfig.tsbuildinfo +0 -1
@@ -1,8 +0,0 @@
1
- import '@operato/property-editor/ox-property-editor-table-column-config.js'
2
-
3
- export default [
4
- {
5
- type: 'column-config',
6
- element: 'ox-property-editor-table-column-config'
7
- }
8
- ]
package/src/gantt.ts DELETED
@@ -1,265 +0,0 @@
1
- import { i18next } from '@operato/i18n'
2
-
3
- /*
4
- * Copyright © HatioLab Inc. All rights reserved.
5
- */
6
-
7
- const NATURE: ComponentNature = {
8
- mutable: false,
9
- resizable: true,
10
- rotatable: true,
11
- properties: [
12
- {
13
- type: 'date',
14
- label: 'gantt-from-date',
15
- name: 'fromDate'
16
- // defaultValue: () =>
17
- // new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */
18
- },
19
- {
20
- type: 'date',
21
- label: 'gantt-to-date',
22
- name: 'toDate'
23
- // defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */
24
- },
25
- {
26
- type: 'boolean',
27
- label: 'gantt-gridline',
28
- name: 'gridline'
29
- // defaultValue: true
30
- },
31
- {
32
- type: 'select',
33
- label: 'gantt-time-scale',
34
- name: 'timeScale',
35
- property: {
36
- options: [
37
- {
38
- display: 'week-day',
39
- value: 'week-day'
40
- },
41
- {
42
- display: 'month-week',
43
- value: 'month-week'
44
- },
45
- {
46
- display: 'quarter-week',
47
- value: 'quarter-week'
48
- },
49
- {
50
- display: 'year-quarter',
51
- value: 'year-quarter'
52
- }
53
- ]
54
- }
55
- // defaultValue: 'week-day'
56
- },
57
- {
58
- type: 'column-config',
59
- label: 'gantt-column-config',
60
- name: 'columnConfig'
61
- // defaultValue: () => [
62
- // { name: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50', order: 1 },
63
- // {
64
- // name: 'section',
65
- // label: i18next.t('label.gantt-task-section') || 'section',
66
- // visible: true,
67
- // width: '100',
68
- // order: 2
69
- // },
70
- // {
71
- // name: 'title',
72
- // label: i18next.t('label.gantt-task-title') || 'title',
73
- // visible: true,
74
- // width: '150',
75
- // order: 3
76
- // },
77
- // { name: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100', order: 4 },
78
- // {
79
- // name: 'startDate',
80
- // label: i18next.t('label.gantt-task-start-date') || 'start date',
81
- // visible: true,
82
- // width: '100',
83
- // order: 5
84
- // },
85
- // {
86
- // name: 'endDate',
87
- // label: i18next.t('label.gantt-task-end-date') || 'end date',
88
- // visible: true,
89
- // width: '100',
90
- // order: 6
91
- // },
92
- // { name: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100', order: 7 },
93
- // {
94
- // name: 'progress',
95
- // label: i18next.t('label.gantt-task-progress') || 'progress',
96
- // visible: true,
97
- // width: '100',
98
- // order: 8
99
- // },
100
- // {
101
- // name: 'dependsOn',
102
- // label: i18next.t('label.gantt-task-previous') || 'previous',
103
- // visible: true,
104
- // width: '100',
105
- // order: 9
106
- // }
107
- // ]
108
- }
109
- ],
110
- 'value-property': 'tasks'
111
- }
112
-
113
- import '@operato/gantt/ox-gantt.js'
114
-
115
- import { OxGantt } from '@operato/gantt/dist/src/ox-gantt.js'
116
- import { Task } from '@operato/gantt/dist/src/types.js'
117
-
118
- import { Component, ComponentNature, HTMLOverlayContainer, Properties, error } from '@hatiolab/things-scene'
119
-
120
- function getGlobalScale(component: GanttScene) {
121
- var scale = { x: 1, y: 1 }
122
- var parent: Component = component
123
-
124
- while (parent) {
125
- let { x, y } = parent.get('scale') || { x: 1, y: 1 }
126
- scale.x *= x || 1
127
- scale.y *= y || 1
128
-
129
- parent = parent.parent
130
- }
131
- return scale
132
- }
133
-
134
- export default class GanttScene extends HTMLOverlayContainer {
135
- static get nature() {
136
- return NATURE
137
- }
138
-
139
- private _tasks: Task[] = []
140
-
141
- private listenTo?: Component
142
- private listener? = function (this: GanttScene, after: any) {
143
- after.scale && this.rescale()
144
- }.bind(this)
145
-
146
- private gantt!: OxGantt
147
-
148
- createElement() {
149
- super.createElement()
150
-
151
- this.gantt = document.createElement('ox-gantt') as OxGantt
152
- this.gantt.style.width = 'inherit'
153
- this.gantt.style.height = 'inherit'
154
-
155
- this.element.appendChild(this.gantt)
156
-
157
- this.rescale()
158
-
159
- const { fromDate, toDate, gridline, columnConfig, timeScale = 'week-day' } = this.state
160
-
161
- this.gantt.fromDate = fromDate
162
- this.gantt.toDate = toDate
163
- this.gantt.extendGridLines = gridline
164
- this.gantt.columnConfigProvider = () => columnConfig
165
- this.gantt.timeScale = timeScale
166
- }
167
-
168
- dispose() {
169
- super.dispose()
170
- }
171
-
172
- /*
173
- * 컴포넌트의 생성 또는 속성 변화 시에 호출되며,
174
- * 그에 따른 html element의 반영이 필요한 부분을 구현한다.
175
- *
176
- * ThingsComponent state => HTML element properties
177
- */
178
-
179
- setElementProperties(div: HTMLDivElement) {
180
- this.rescale()
181
- }
182
-
183
- /*
184
- * 컴포넌트가 ready 상태가 되거나, 컴포넌트의 속성이 변화될 시 setElementProperties 뒤에 호출된다.
185
- * 변화에 따른 기본적인 html 속성이 super.reposition()에서 진행되고, 그 밖의 작업이 필요할 때, 오버라이드 한다.
186
- */
187
- reposition() {
188
- super.reposition()
189
- }
190
-
191
- get tagName() {
192
- return 'div'
193
- }
194
-
195
- get tasks() {
196
- return this.get('tasks')
197
- }
198
-
199
- set tasks(tasks) {
200
- this.set('tasks', tasks)
201
- ;(this.gantt as OxGantt).tasks = tasks
202
- }
203
-
204
- ready() {
205
- super.ready()
206
-
207
- if (this.rootModel) {
208
- this.listenTo = this.rootModel
209
- this.rootModel.on('change', this.listener!)
210
- }
211
- }
212
-
213
- removed() {
214
- if (this.listenTo) {
215
- this.listenTo.off('change', this.listener!)
216
-
217
- delete this.listenTo
218
- delete this.listener
219
- }
220
- }
221
-
222
- /*
223
- * gantt은 scale된 상태에서 마우스/터치 포지션을 정확히 매핑하지 못하므로, 타임 범위를 정상적으로 지정하지 못한다.
224
- * 따라서, gantt의 경우에는 부모의 스케일의 역으로 transform해서, scale을 1로 맞추어야 한다.
225
- */
226
- rescale() {
227
- if (!this.gantt) {
228
- return
229
- }
230
-
231
- var scale = getGlobalScale(this)
232
-
233
- var sx = 1 / scale.x
234
- var sy = 1 / scale.y
235
-
236
- var transform = `scale(${sx}, ${sy})`
237
-
238
- ;['-webkit-', '-moz-', '-ms-', '-o-', ''].forEach(prefix => {
239
- this.gantt!.style[(prefix + 'transform') as any] = transform
240
- this.gantt!.style[(prefix + 'transform-origin') as any] = '0px 0px'
241
- })
242
-
243
- var { width, height } = this.state
244
- this.gantt!.style.width = width * scale.x + 'px'
245
- this.gantt!.style.height = height * scale.y + 'px'
246
-
247
- this.gantt.requestUpdate()
248
- }
249
-
250
- onchange(props: Properties) {
251
- ;['fromDate', 'toDate', 'timeScale', 'columnConfig'].forEach(prop => {
252
- if (prop in props) {
253
- ;(this.gantt as any)[prop] = this.state[prop]
254
- }
255
- })
256
-
257
- if ('gridline' in props) {
258
- ;(this.gantt as OxGantt).extendGridLines = this.state['gridline']
259
- }
260
-
261
- this.rescale()
262
- }
263
- }
264
-
265
- Component.register('gantt', GanttScene)
File without changes
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export { default as GanttScene } from './gantt'
@@ -1,16 +0,0 @@
1
- const icon = new URL('../../icons/gantt.png', import.meta.url).href
2
-
3
- export default {
4
- type: 'gantt',
5
- description: 'gantt',
6
- group: 'etc',
7
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
8
- icon,
9
- model: {
10
- type: 'gantt',
11
- left: 150,
12
- top: 150,
13
- width: 300,
14
- height: 200
15
- }
16
- }
@@ -1,3 +0,0 @@
1
- import Gantt from './gantt'
2
-
3
- export default [Gantt]
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2019", "dom"],
8
- "strict": true,
9
- "esModuleInterop": false,
10
- "allowJs": true,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "importHelpers": true,
14
- "outDir": "dist",
15
- "sourceMap": true,
16
- "skipLibCheck": true,
17
- "inlineSources": true,
18
- "rootDir": "src",
19
- "declaration": true,
20
- "incremental": true
21
- },
22
- "include": ["**/*.ts", "*.d.ts"]
23
- }