@operato/scene-gantt 7.0.3 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.1.0](https://github.com/things-scene/operato-scene/compare/v7.0.12...v7.1.0) (2024-07-28)
7
+
8
+
9
+ ### :rocket: New Features
10
+
11
+ * scichart-multiple-timeseries ([d8c6f99](https://github.com/things-scene/operato-scene/commit/d8c6f997bb7118f0400c0f114a42fa1040ebe0d5))
12
+
13
+
14
+ ### :bug: Bug Fix
15
+
16
+ * remove unused file ([49d624f](https://github.com/things-scene/operato-scene/commit/49d624fd59f9a0c051daed67f03ecfe07598852e))
17
+
18
+
19
+
6
20
  ## [7.0.3](https://github.com/things-scene/operato-scene/compare/v7.0.2...v7.0.3) (2024-07-05)
7
21
 
8
22
 
package/dist/gantt.d.ts CHANGED
@@ -1,48 +1,7 @@
1
1
  import '@operato/gantt/ox-gantt.js';
2
- import { HTMLOverlayContainer, Properties } from '@hatiolab/things-scene';
2
+ import { ComponentNature, HTMLOverlayContainer, Properties } from '@hatiolab/things-scene';
3
3
  export default class GanttScene extends HTMLOverlayContainer {
4
- static get nature(): {
5
- mutable: boolean;
6
- resizable: boolean;
7
- rotatable: boolean;
8
- properties: ({
9
- type: string;
10
- label: string;
11
- name: string;
12
- defaultValue: () => string;
13
- property?: undefined;
14
- } | {
15
- type: string;
16
- label: string;
17
- name: string;
18
- defaultValue: boolean;
19
- property?: undefined;
20
- } | {
21
- type: string;
22
- label: string;
23
- name: string;
24
- property: {
25
- options: {
26
- display: string;
27
- value: string;
28
- }[];
29
- };
30
- defaultValue: string;
31
- } | {
32
- type: string;
33
- label: string;
34
- name: string;
35
- defaultValue: () => {
36
- name: string;
37
- label: string;
38
- visible: boolean;
39
- width: string;
40
- order: number;
41
- }[];
42
- property?: undefined;
43
- })[];
44
- 'value-property': string;
45
- };
4
+ static get nature(): ComponentNature;
46
5
  private _tasks;
47
6
  private listenTo?;
48
7
  private listener?;
package/dist/gantt.js CHANGED
@@ -1,4 +1,3 @@
1
- import { i18next } from '@operato/i18n';
2
1
  /*
3
2
  * Copyright © HatioLab Inc. All rights reserved.
4
3
  */
@@ -10,20 +9,21 @@ const NATURE = {
10
9
  {
11
10
  type: 'date',
12
11
  label: 'gantt-from-date',
13
- name: 'fromDate',
14
- defaultValue: () => new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */
12
+ name: 'fromDate'
13
+ // defaultValue: () =>
14
+ // new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */
15
15
  },
16
16
  {
17
17
  type: 'date',
18
18
  label: 'gantt-to-date',
19
- name: 'toDate',
20
- defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */
19
+ name: 'toDate'
20
+ // defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */
21
21
  },
22
22
  {
23
23
  type: 'boolean',
24
24
  label: 'gantt-gridline',
25
- name: 'gridline',
26
- defaultValue: true
25
+ name: 'gridline'
26
+ // defaultValue: true
27
27
  },
28
28
  {
29
29
  type: 'select',
@@ -48,60 +48,60 @@ const NATURE = {
48
48
  value: 'year-quarter'
49
49
  }
50
50
  ]
51
- },
52
- defaultValue: 'week-day'
51
+ }
52
+ // defaultValue: 'week-day'
53
53
  },
54
54
  {
55
55
  type: 'column-config',
56
56
  label: 'gantt-column-config',
57
- name: 'columnConfig',
58
- defaultValue: () => [
59
- { name: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50', order: 1 },
60
- {
61
- name: 'section',
62
- label: i18next.t('label.gantt-task-section') || 'section',
63
- visible: true,
64
- width: '100',
65
- order: 2
66
- },
67
- {
68
- name: 'title',
69
- label: i18next.t('label.gantt-task-title') || 'title',
70
- visible: true,
71
- width: '150',
72
- order: 3
73
- },
74
- { name: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100', order: 4 },
75
- {
76
- name: 'startDate',
77
- label: i18next.t('label.gantt-task-start-date') || 'start date',
78
- visible: true,
79
- width: '100',
80
- order: 5
81
- },
82
- {
83
- name: 'endDate',
84
- label: i18next.t('label.gantt-task-end-date') || 'end date',
85
- visible: true,
86
- width: '100',
87
- order: 6
88
- },
89
- { name: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100', order: 7 },
90
- {
91
- name: 'progress',
92
- label: i18next.t('label.gantt-task-progress') || 'progress',
93
- visible: true,
94
- width: '100',
95
- order: 8
96
- },
97
- {
98
- name: 'dependsOn',
99
- label: i18next.t('label.gantt-task-previous') || 'previous',
100
- visible: true,
101
- width: '100',
102
- order: 9
103
- }
104
- ]
57
+ name: 'columnConfig'
58
+ // defaultValue: () => [
59
+ // { name: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50', order: 1 },
60
+ // {
61
+ // name: 'section',
62
+ // label: i18next.t('label.gantt-task-section') || 'section',
63
+ // visible: true,
64
+ // width: '100',
65
+ // order: 2
66
+ // },
67
+ // {
68
+ // name: 'title',
69
+ // label: i18next.t('label.gantt-task-title') || 'title',
70
+ // visible: true,
71
+ // width: '150',
72
+ // order: 3
73
+ // },
74
+ // { name: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100', order: 4 },
75
+ // {
76
+ // name: 'startDate',
77
+ // label: i18next.t('label.gantt-task-start-date') || 'start date',
78
+ // visible: true,
79
+ // width: '100',
80
+ // order: 5
81
+ // },
82
+ // {
83
+ // name: 'endDate',
84
+ // label: i18next.t('label.gantt-task-end-date') || 'end date',
85
+ // visible: true,
86
+ // width: '100',
87
+ // order: 6
88
+ // },
89
+ // { name: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100', order: 7 },
90
+ // {
91
+ // name: 'progress',
92
+ // label: i18next.t('label.gantt-task-progress') || 'progress',
93
+ // visible: true,
94
+ // width: '100',
95
+ // order: 8
96
+ // },
97
+ // {
98
+ // name: 'dependsOn',
99
+ // label: i18next.t('label.gantt-task-previous') || 'previous',
100
+ // visible: true,
101
+ // width: '100',
102
+ // order: 9
103
+ // }
104
+ // ]
105
105
  }
106
106
  ],
107
107
  'value-property': 'tasks'
package/dist/gantt.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gantt.js","sourceRoot":"","sources":["../src/gantt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;GAEG;AAEH,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B;SACpG;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB;SAClH;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,IAAI;SACnB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,WAAW;YACjB,QAAQ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K,EAAE,CAAC;YACxB,CAAC;YAAC,IAAI,CAAC,KAAiB,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACnE,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA","sourcesContent":["import { i18next } from '@operato/i18n'\n\n/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'date',\n label: 'gantt-from-date',\n name: 'fromDate',\n defaultValue: () =>\n new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */\n },\n {\n type: 'date',\n label: 'gantt-to-date',\n name: 'toDate',\n defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */\n },\n {\n type: 'boolean',\n label: 'gantt-gridline',\n name: 'gridline',\n defaultValue: true\n },\n {\n type: 'select',\n label: 'gantt-time-scale',\n name: 'timeScale',\n property: {\n options: [\n {\n display: 'week-day',\n value: 'week-day'\n },\n {\n display: 'month-week',\n value: 'month-week'\n },\n {\n display: 'quarter-week',\n value: 'quarter-week'\n },\n {\n display: 'year-quarter',\n value: 'year-quarter'\n }\n ]\n },\n defaultValue: 'week-day'\n },\n {\n type: 'column-config',\n label: 'gantt-column-config',\n name: 'columnConfig',\n defaultValue: () => [\n { name: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50', order: 1 },\n {\n name: 'section',\n label: i18next.t('label.gantt-task-section') || 'section',\n visible: true,\n width: '100',\n order: 2\n },\n {\n name: 'title',\n label: i18next.t('label.gantt-task-title') || 'title',\n visible: true,\n width: '150',\n order: 3\n },\n { name: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100', order: 4 },\n {\n name: 'startDate',\n label: i18next.t('label.gantt-task-start-date') || 'start date',\n visible: true,\n width: '100',\n order: 5\n },\n {\n name: 'endDate',\n label: i18next.t('label.gantt-task-end-date') || 'end date',\n visible: true,\n width: '100',\n order: 6\n },\n { name: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100', order: 7 },\n {\n name: 'progress',\n label: i18next.t('label.gantt-task-progress') || 'progress',\n visible: true,\n width: '100',\n order: 8\n },\n {\n name: 'dependsOn',\n label: i18next.t('label.gantt-task-previous') || 'previous',\n visible: true,\n width: '100',\n order: 9\n }\n ]\n }\n ],\n 'value-property': 'tasks'\n}\n\nimport '@operato/gantt/ox-gantt.js'\n\nimport { OxGantt } from '@operato/gantt/dist/src/ox-gantt.js'\nimport { Task } from '@operato/gantt/dist/src/types.js'\n\nimport { Component, HTMLOverlayContainer, Properties, error } from '@hatiolab/things-scene'\n\nfunction getGlobalScale(component: GanttScene) {\n var scale = { x: 1, y: 1 }\n var parent: Component = component\n\n while (parent) {\n let { x, y } = parent.get('scale') || { x: 1, y: 1 }\n scale.x *= x || 1\n scale.y *= y || 1\n\n parent = parent.parent\n }\n return scale\n}\n\nexport default class GanttScene extends HTMLOverlayContainer {\n static get nature() {\n return NATURE\n }\n\n private _tasks: Task[] = []\n\n private listenTo?: Component\n private listener? = function (this: GanttScene, after: any) {\n after.scale && this.rescale()\n }.bind(this)\n\n private gantt!: OxGantt\n\n createElement() {\n super.createElement()\n\n this.gantt = document.createElement('ox-gantt') as OxGantt\n this.gantt.style.width = 'inherit'\n this.gantt.style.height = 'inherit'\n\n this.element.appendChild(this.gantt)\n\n this.rescale()\n\n const { fromDate, toDate, gridline, columnConfig, timeScale = 'week-day' } = this.state\n\n this.gantt.fromDate = fromDate\n this.gantt.toDate = toDate\n this.gantt.extendGridLines = gridline\n this.gantt.columnConfig = columnConfig\n this.gantt.timeScale = timeScale\n }\n\n dispose() {\n super.dispose()\n }\n\n /*\n * 컴포넌트의 생성 또는 속성 변화 시에 호출되며,\n * 그에 따른 html element의 반영이 필요한 부분을 구현한다.\n *\n * ThingsComponent state => HTML element properties\n */\n\n setElementProperties(div: HTMLDivElement) {\n this.rescale()\n }\n\n /*\n * 컴포넌트가 ready 상태가 되거나, 컴포넌트의 속성이 변화될 시 setElementProperties 뒤에 호출된다.\n * 변화에 따른 기본적인 html 속성이 super.reposition()에서 진행되고, 그 밖의 작업이 필요할 때, 오버라이드 한다.\n */\n reposition() {\n super.reposition()\n }\n\n get tagName() {\n return 'div'\n }\n\n get tasks() {\n return this.get('tasks')\n }\n\n set tasks(tasks) {\n this.set('tasks', tasks)\n ;(this.gantt as OxGantt).tasks = tasks\n }\n\n ready() {\n super.ready()\n\n if (this.rootModel) {\n this.listenTo = this.rootModel\n this.rootModel.on('change', this.listener!)\n }\n }\n\n removed() {\n if (this.listenTo) {\n this.listenTo.off('change', this.listener!)\n\n delete this.listenTo\n delete this.listener\n }\n }\n\n /*\n * gantt은 scale된 상태에서 마우스/터치 포지션을 정확히 매핑하지 못하므로, 타임 범위를 정상적으로 지정하지 못한다.\n * 따라서, gantt의 경우에는 부모의 스케일의 역으로 transform해서, scale을 1로 맞추어야 한다.\n */\n rescale() {\n if (!this.gantt) {\n return\n }\n\n var scale = getGlobalScale(this)\n\n var sx = 1 / scale.x\n var sy = 1 / scale.y\n\n var transform = `scale(${sx}, ${sy})`\n\n ;['-webkit-', '-moz-', '-ms-', '-o-', ''].forEach(prefix => {\n this.gantt!.style[(prefix + 'transform') as any] = transform\n this.gantt!.style[(prefix + 'transform-origin') as any] = '0px 0px'\n })\n\n var { width, height } = this.state\n this.gantt!.style.width = width * scale.x + 'px'\n this.gantt!.style.height = height * scale.y + 'px'\n\n this.gantt.requestUpdate()\n }\n\n onchange(props: Properties) {\n ;['fromDate', 'toDate', 'timeScale', 'columnConfig'].forEach(prop => {\n if (prop in props) {\n ;(this.gantt as any)[prop] = this.state[prop]\n }\n })\n\n if ('gridline' in props) {\n ;(this.gantt as OxGantt).extendGridLines = this.state['gridline']\n }\n\n this.rescale()\n }\n}\n\nComponent.register('gantt', GanttScene)\n"]}
1
+ {"version":3,"file":"gantt.js","sourceRoot":"","sources":["../src/gantt.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,UAAU;YAChB,sBAAsB;YACtB,sGAAsG;SACvG;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,QAAQ;YACd,oHAAoH;SACrH;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,UAAU;YAChB,qBAAqB;SACtB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,UAAU;wBACnB,KAAK,EAAE,UAAU;qBAClB;oBACD;wBACE,OAAO,EAAE,YAAY;wBACrB,KAAK,EAAE,YAAY;qBACpB;oBACD;wBACE,OAAO,EAAE,cAAc;wBACvB,KAAK,EAAE,cAAc;qBACtB;oBACD;wBACE,OAAO,EAAE,cAAc;wBACvB,KAAK,EAAE,cAAc;qBACtB;iBACF;aACF;YACD,2BAA2B;SAC5B;QACD;YACE,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,qBAAqB;YAC5B,IAAI,EAAE,cAAc;YACpB,0BAA0B;YAC1B,6GAA6G;YAC7G,QAAQ;YACR,yBAAyB;YACzB,mEAAmE;YACnE,uBAAuB;YACvB,sBAAsB;YACtB,iBAAiB;YACjB,SAAS;YACT,QAAQ;YACR,uBAAuB;YACvB,+DAA+D;YAC/D,uBAAuB;YACvB,sBAAsB;YACtB,iBAAiB;YACjB,SAAS;YACT,oHAAoH;YACpH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AAA;YAC5D,IAAI,CAAC,KAAM,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,kBAAkB,CAAQ,CAAC,GAAG,SAAS,CAAA;QACrE,CAAC,CAAC,CAAA;QAEF,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAClC,IAAI,CAAC,KAAM,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAA;QAChD,IAAI,CAAC,KAAM,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAA;QAElD,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAA;IAC5B,CAAC;IAED,QAAQ,CAAC,KAAiB;QACxB,CAAC;QAAA,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAClE,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,KAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;YACxB,CAAC;YAAC,IAAI,CAAC,KAAiB,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACnE,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA","sourcesContent":["import { i18next } from '@operato/i18n'\n\n/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'date',\n label: 'gantt-from-date',\n name: 'fromDate'\n // defaultValue: () =>\n // new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */\n },\n {\n type: 'date',\n label: 'gantt-to-date',\n name: 'toDate'\n // defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */\n },\n {\n type: 'boolean',\n label: 'gantt-gridline',\n name: 'gridline'\n // defaultValue: true\n },\n {\n type: 'select',\n label: 'gantt-time-scale',\n name: 'timeScale',\n property: {\n options: [\n {\n display: 'week-day',\n value: 'week-day'\n },\n {\n display: 'month-week',\n value: 'month-week'\n },\n {\n display: 'quarter-week',\n value: 'quarter-week'\n },\n {\n display: 'year-quarter',\n value: 'year-quarter'\n }\n ]\n }\n // defaultValue: 'week-day'\n },\n {\n type: 'column-config',\n label: 'gantt-column-config',\n name: 'columnConfig'\n // defaultValue: () => [\n // { name: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50', order: 1 },\n // {\n // name: 'section',\n // label: i18next.t('label.gantt-task-section') || 'section',\n // visible: true,\n // width: '100',\n // order: 2\n // },\n // {\n // name: 'title',\n // label: i18next.t('label.gantt-task-title') || 'title',\n // visible: true,\n // width: '150',\n // order: 3\n // },\n // { name: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100', order: 4 },\n // {\n // name: 'startDate',\n // label: i18next.t('label.gantt-task-start-date') || 'start date',\n // visible: true,\n // width: '100',\n // order: 5\n // },\n // {\n // name: 'endDate',\n // label: i18next.t('label.gantt-task-end-date') || 'end date',\n // visible: true,\n // width: '100',\n // order: 6\n // },\n // { name: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100', order: 7 },\n // {\n // name: 'progress',\n // label: i18next.t('label.gantt-task-progress') || 'progress',\n // visible: true,\n // width: '100',\n // order: 8\n // },\n // {\n // name: 'dependsOn',\n // label: i18next.t('label.gantt-task-previous') || 'previous',\n // visible: true,\n // width: '100',\n // order: 9\n // }\n // ]\n }\n ],\n 'value-property': 'tasks'\n}\n\nimport '@operato/gantt/ox-gantt.js'\n\nimport { OxGantt } from '@operato/gantt/dist/src/ox-gantt.js'\nimport { Task } from '@operato/gantt/dist/src/types.js'\n\nimport { Component, ComponentNature, HTMLOverlayContainer, Properties, error } from '@hatiolab/things-scene'\n\nfunction getGlobalScale(component: GanttScene) {\n var scale = { x: 1, y: 1 }\n var parent: Component = component\n\n while (parent) {\n let { x, y } = parent.get('scale') || { x: 1, y: 1 }\n scale.x *= x || 1\n scale.y *= y || 1\n\n parent = parent.parent\n }\n return scale\n}\n\nexport default class GanttScene extends HTMLOverlayContainer {\n static get nature() {\n return NATURE\n }\n\n private _tasks: Task[] = []\n\n private listenTo?: Component\n private listener? = function (this: GanttScene, after: any) {\n after.scale && this.rescale()\n }.bind(this)\n\n private gantt!: OxGantt\n\n createElement() {\n super.createElement()\n\n this.gantt = document.createElement('ox-gantt') as OxGantt\n this.gantt.style.width = 'inherit'\n this.gantt.style.height = 'inherit'\n\n this.element.appendChild(this.gantt)\n\n this.rescale()\n\n const { fromDate, toDate, gridline, columnConfig, timeScale = 'week-day' } = this.state\n\n this.gantt.fromDate = fromDate\n this.gantt.toDate = toDate\n this.gantt.extendGridLines = gridline\n this.gantt.columnConfig = columnConfig\n this.gantt.timeScale = timeScale\n }\n\n dispose() {\n super.dispose()\n }\n\n /*\n * 컴포넌트의 생성 또는 속성 변화 시에 호출되며,\n * 그에 따른 html element의 반영이 필요한 부분을 구현한다.\n *\n * ThingsComponent state => HTML element properties\n */\n\n setElementProperties(div: HTMLDivElement) {\n this.rescale()\n }\n\n /*\n * 컴포넌트가 ready 상태가 되거나, 컴포넌트의 속성이 변화될 시 setElementProperties 뒤에 호출된다.\n * 변화에 따른 기본적인 html 속성이 super.reposition()에서 진행되고, 그 밖의 작업이 필요할 때, 오버라이드 한다.\n */\n reposition() {\n super.reposition()\n }\n\n get tagName() {\n return 'div'\n }\n\n get tasks() {\n return this.get('tasks')\n }\n\n set tasks(tasks) {\n this.set('tasks', tasks)\n ;(this.gantt as OxGantt).tasks = tasks\n }\n\n ready() {\n super.ready()\n\n if (this.rootModel) {\n this.listenTo = this.rootModel\n this.rootModel.on('change', this.listener!)\n }\n }\n\n removed() {\n if (this.listenTo) {\n this.listenTo.off('change', this.listener!)\n\n delete this.listenTo\n delete this.listener\n }\n }\n\n /*\n * gantt은 scale된 상태에서 마우스/터치 포지션을 정확히 매핑하지 못하므로, 타임 범위를 정상적으로 지정하지 못한다.\n * 따라서, gantt의 경우에는 부모의 스케일의 역으로 transform해서, scale을 1로 맞추어야 한다.\n */\n rescale() {\n if (!this.gantt) {\n return\n }\n\n var scale = getGlobalScale(this)\n\n var sx = 1 / scale.x\n var sy = 1 / scale.y\n\n var transform = `scale(${sx}, ${sy})`\n\n ;['-webkit-', '-moz-', '-ms-', '-o-', ''].forEach(prefix => {\n this.gantt!.style[(prefix + 'transform') as any] = transform\n this.gantt!.style[(prefix + 'transform-origin') as any] = '0px 0px'\n })\n\n var { width, height } = this.state\n this.gantt!.style.width = width * scale.x + 'px'\n this.gantt!.style.height = height * scale.y + 'px'\n\n this.gantt.requestUpdate()\n }\n\n onchange(props: Properties) {\n ;['fromDate', 'toDate', 'timeScale', 'columnConfig'].forEach(prop => {\n if (prop in props) {\n ;(this.gantt as any)[prop] = this.state[prop]\n }\n })\n\n if ('gridline' in props) {\n ;(this.gantt as OxGantt).extendGridLines = this.state['gridline']\n }\n\n this.rescale()\n }\n}\n\nComponent.register('gantt', GanttScene)\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operato/scene-gantt",
3
3
  "description": "Operato Scene Component for Gantt Chart",
4
- "version": "7.0.3",
4
+ "version": "7.1.0",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -58,5 +58,5 @@
58
58
  "prettier --write"
59
59
  ]
60
60
  },
61
- "gitHead": "99c81462bb3a6702c44c958aa15cc96b290d1567"
61
+ "gitHead": "24c96f3d3e1fe38c2f6a3adc869e52a1a80f139d"
62
62
  }
package/src/gantt.ts CHANGED
@@ -4,7 +4,7 @@ import { i18next } from '@operato/i18n'
4
4
  * Copyright © HatioLab Inc. All rights reserved.
5
5
  */
6
6
 
7
- const NATURE = {
7
+ const NATURE: ComponentNature = {
8
8
  mutable: false,
9
9
  resizable: true,
10
10
  rotatable: true,
@@ -12,21 +12,21 @@ const NATURE = {
12
12
  {
13
13
  type: 'date',
14
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 */
15
+ name: 'fromDate'
16
+ // defaultValue: () =>
17
+ // new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */
18
18
  },
19
19
  {
20
20
  type: 'date',
21
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 */
22
+ name: 'toDate'
23
+ // defaultValue: () => new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */
24
24
  },
25
25
  {
26
26
  type: 'boolean',
27
27
  label: 'gantt-gridline',
28
- name: 'gridline',
29
- defaultValue: true
28
+ name: 'gridline'
29
+ // defaultValue: true
30
30
  },
31
31
  {
32
32
  type: 'select',
@@ -51,60 +51,60 @@ const NATURE = {
51
51
  value: 'year-quarter'
52
52
  }
53
53
  ]
54
- },
55
- defaultValue: 'week-day'
54
+ }
55
+ // defaultValue: 'week-day'
56
56
  },
57
57
  {
58
58
  type: 'column-config',
59
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
- ]
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
108
  }
109
109
  ],
110
110
  'value-property': 'tasks'
@@ -115,7 +115,7 @@ import '@operato/gantt/ox-gantt.js'
115
115
  import { OxGantt } from '@operato/gantt/dist/src/ox-gantt.js'
116
116
  import { Task } from '@operato/gantt/dist/src/types.js'
117
117
 
118
- import { Component, HTMLOverlayContainer, Properties, error } from '@hatiolab/things-scene'
118
+ import { Component, ComponentNature, HTMLOverlayContainer, Properties, error } from '@hatiolab/things-scene'
119
119
 
120
120
  function getGlobalScale(component: GanttScene) {
121
121
  var scale = { x: 1, y: 1 }