@operato/gantt 8.0.0-alpha.4 → 8.0.0-alpha.40
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/CHANGELOG.md +88 -0
- package/dist/src/gantt-chart-controller.d.ts +5 -6
- package/dist/src/gantt-chart-controller.js +92 -37
- package/dist/src/gantt-chart-controller.js.map +1 -1
- package/dist/src/ox-gantt-chart.d.ts +370 -2
- package/dist/src/ox-gantt-chart.js +72 -138
- package/dist/src/ox-gantt-chart.js.map +1 -1
- package/dist/src/ox-gantt-resize-splitter.d.ts +6 -2
- package/dist/src/ox-gantt-resize-splitter.js +70 -39
- package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
- package/dist/src/ox-gantt.js +10 -1
- package/dist/src/ox-gantt.js.map +1 -1
- package/dist/src/ox-resource-chart.js +2 -0
- package/dist/src/ox-resource-chart.js.map +1 -1
- package/dist/src/ox-task-tooltip.d.ts +3 -1
- package/dist/src/ox-task-tooltip.js +36 -11
- package/dist/src/ox-task-tooltip.js.map +1 -1
- package/dist/stories/ox-gantt.stories.js +17 -1
- package/dist/stories/ox-gantt.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/gantt-chart-controller.ts +100 -34
- package/src/ox-gantt-chart.ts +73 -137
- package/src/ox-gantt-resize-splitter.ts +72 -44
- package/src/ox-gantt.ts +10 -1
- package/src/ox-resource-chart.ts +2 -0
- package/src/ox-task-tooltip.ts +31 -9
- package/stories/ox-gantt.stories.ts +17 -1
- package/themes/calendar-theme.css +3 -1
- package/assets/images/icon-editor-gradient-direction.png +0 -0
- package/assets/images/icon-properties-label.png +0 -0
- package/assets/images/icon-properties-line-type.png +0 -0
- package/assets/images/icon-properties-table.png +0 -0
|
@@ -9,7 +9,20 @@ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typesca
|
|
|
9
9
|
import { ScrollbarStyles } from '@operato/styles';
|
|
10
10
|
import { GanttChartController } from './gantt-chart-controller';
|
|
11
11
|
import { levelDown, levelUp } from './utils';
|
|
12
|
-
|
|
12
|
+
import { gesture } from '@operato/utils/gesture-mixin.js';
|
|
13
|
+
let OxGanttChart = class OxGanttChart extends gesture(LitElement) {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.fromDate = new Date(new Date().getFullYear(), 0, 1)
|
|
17
|
+
.toISOString()
|
|
18
|
+
.split('T')[0];
|
|
19
|
+
this.toDate = new Date(new Date().getFullYear(), 11, 31)
|
|
20
|
+
.toISOString()
|
|
21
|
+
.split('T')[0];
|
|
22
|
+
this.axisScale = 'week-day';
|
|
23
|
+
this.tasks = [];
|
|
24
|
+
this.locale = 'en-US';
|
|
25
|
+
}
|
|
13
26
|
static { this.styles = [
|
|
14
27
|
MDTypeScaleStyles,
|
|
15
28
|
ScrollbarStyles,
|
|
@@ -18,15 +31,21 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
18
31
|
display: flex;
|
|
19
32
|
overflow: hidden;
|
|
20
33
|
position: relative;
|
|
34
|
+
user-select: none;
|
|
21
35
|
}
|
|
36
|
+
|
|
22
37
|
div[chart-container] {
|
|
23
38
|
display: block;
|
|
24
39
|
overflow-x: auto;
|
|
25
40
|
overflow-y: hidden;
|
|
41
|
+
overscroll-behavior: none;
|
|
42
|
+
touch-action: none;
|
|
26
43
|
}
|
|
44
|
+
|
|
27
45
|
svg {
|
|
28
46
|
min-width: 100%;
|
|
29
47
|
}
|
|
48
|
+
|
|
30
49
|
svg[header] {
|
|
31
50
|
display: block;
|
|
32
51
|
min-width: 100%;
|
|
@@ -39,53 +58,56 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
39
58
|
top: 0;
|
|
40
59
|
z-index: 1;
|
|
41
60
|
}
|
|
42
|
-
|
|
43
|
-
position: absolute;
|
|
44
|
-
top: 44px; /* 헤더 바로 아래 위치 */
|
|
45
|
-
right: 4px;
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
gap: 2px;
|
|
49
|
-
}
|
|
61
|
+
|
|
50
62
|
.scroll-button {
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 46px; /* 헤더 바로 아래 위치 */
|
|
65
|
+
width: 14px;
|
|
66
|
+
height: 14px;
|
|
53
67
|
background-color: var(--ox-gantt-header-color, var(--md-sys-color-on-secondary-container));
|
|
68
|
+
opacity: 0.5;
|
|
54
69
|
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
|
|
55
70
|
cursor: pointer;
|
|
56
71
|
transform: rotate(90deg);
|
|
57
72
|
}
|
|
73
|
+
|
|
58
74
|
.scroll-button.left {
|
|
75
|
+
left: 6px;
|
|
59
76
|
transform: rotate(-90deg);
|
|
60
77
|
}
|
|
78
|
+
|
|
61
79
|
.scroll-button.right {
|
|
62
80
|
transform: rotate(90deg);
|
|
81
|
+
right: 6px;
|
|
63
82
|
}
|
|
64
83
|
`
|
|
65
84
|
]; }
|
|
66
|
-
constructor() {
|
|
67
|
-
super();
|
|
68
|
-
this.fromDate = new Date(new Date().getFullYear(), 0, 1)
|
|
69
|
-
.toISOString()
|
|
70
|
-
.split('T')[0];
|
|
71
|
-
this.toDate = new Date(new Date().getFullYear(), 11, 31)
|
|
72
|
-
.toISOString()
|
|
73
|
-
.split('T')[0];
|
|
74
|
-
this.axisScale = 'week-day';
|
|
75
|
-
this.tasks = [];
|
|
76
|
-
this.locale = 'en-US';
|
|
77
|
-
this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale);
|
|
78
|
-
}
|
|
79
85
|
firstUpdated(_changedProperties) {
|
|
80
86
|
this.initHeaderGestureHandlers();
|
|
87
|
+
this.addEventListener('date-range-cleared', e => this.clearSelection());
|
|
88
|
+
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
super.connectedCallback();
|
|
91
|
+
this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale);
|
|
92
|
+
this.addEventListener('pinch', this.ganttChartController.handlePinchForBody);
|
|
93
|
+
this.addEventListener('drag', this.ganttChartController.handleDragForBody);
|
|
94
|
+
this.addEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody);
|
|
95
|
+
}
|
|
96
|
+
disconnectedCallback() {
|
|
97
|
+
super.disconnectedCallback();
|
|
98
|
+
this.removeEventListener('pinch', this.ganttChartController.handlePinchForBody);
|
|
99
|
+
this.removeEventListener('drag', this.ganttChartController.handleDragForBody);
|
|
100
|
+
this.removeEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody);
|
|
101
|
+
this.ganttChartController.dispose();
|
|
81
102
|
}
|
|
82
103
|
updated(changedProperties) {
|
|
83
104
|
if (changedProperties.has('fromDate') || changedProperties.has('toDate')) {
|
|
84
105
|
this.ganttChartController.updateRange(this.fromDate, this.toDate);
|
|
85
106
|
}
|
|
86
107
|
if (changedProperties.has('tasks')) {
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
108
|
+
const flattenTasks = this.flattenTasks(this.tasks);
|
|
109
|
+
this.ganttChartController.setTasks(flattenTasks);
|
|
110
|
+
this.svgBody.style.height = Math.max(flattenTasks.length * 30, 2000) + 'px';
|
|
89
111
|
}
|
|
90
112
|
if (changedProperties.has('locale')) {
|
|
91
113
|
this.updateLocale(this.locale);
|
|
@@ -105,22 +127,15 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
105
127
|
}
|
|
106
128
|
render() {
|
|
107
129
|
return html `
|
|
108
|
-
<div
|
|
109
|
-
chart-container
|
|
110
|
-
@wheel=${(e) => this.ganttChartController.handleWheelForBody(e, this.container)}
|
|
111
|
-
@touchstart=${(e) => this.ganttChartController.handleTouchStartForBody(e, this.container)}
|
|
112
|
-
@touchmove=${(e) => this.ganttChartController.handleTouchMoveForBody(e, this.container)}
|
|
113
|
-
>
|
|
130
|
+
<div chart-container @wheel=${(e) => this.ganttChartController.handleWheelForBody(e, this.container)}>
|
|
114
131
|
<svg
|
|
115
132
|
header
|
|
116
133
|
@date-range-selected=${(e) => this.handleDateRangeSelected(e)}
|
|
117
134
|
@wheel=${this.handleWheelForHeader.bind(this)}
|
|
118
135
|
></svg>
|
|
119
136
|
<svg body></svg>
|
|
120
|
-
<div class="scroll-
|
|
121
|
-
|
|
122
|
-
<div class="scroll-button right" @click=${this.scrollToEnd}></div>
|
|
123
|
-
</div>
|
|
137
|
+
<div class="scroll-button left" @click=${this.scrollToStart} @touchstart=${this.scrollToStart}></div>
|
|
138
|
+
<div class="scroll-button right" @click=${this.scrollToEnd} @touchstart=${this.scrollToEnd}></div>
|
|
124
139
|
<ox-task-tooltip></ox-task-tooltip>
|
|
125
140
|
</div>
|
|
126
141
|
`;
|
|
@@ -205,7 +220,7 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
205
220
|
}
|
|
206
221
|
handleDateRangeSelected(event) {
|
|
207
222
|
const detail = event.detail;
|
|
208
|
-
this.dispatchEvent(new CustomEvent('date-range-selected', { detail }));
|
|
223
|
+
this.dispatchEvent(new CustomEvent('date-range-selected', { detail, bubbles: true, composed: true }));
|
|
209
224
|
}
|
|
210
225
|
updateLocale(locale) {
|
|
211
226
|
const localeDefinition = locales[locale || 'en-US'];
|
|
@@ -216,121 +231,33 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
216
231
|
}
|
|
217
232
|
initHeaderGestureHandlers() {
|
|
218
233
|
const header = d3.select(this.svgHeader);
|
|
219
|
-
let isDragging = false;
|
|
220
234
|
let startX = null;
|
|
221
|
-
|
|
222
|
-
const handleTouchStart = (event) => {
|
|
223
|
-
event.preventDefault();
|
|
224
|
-
if (event.touches.length === 2) {
|
|
225
|
-
lastTouchDistance = getTouchDistance(event.touches);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
isDragging = true;
|
|
229
|
-
const touch = event.touches[0];
|
|
230
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
231
|
-
startX = touch.clientX - containerOffsetX;
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
const handleTouchMove = (event) => {
|
|
235
|
+
const handlePointerDown = (event) => {
|
|
235
236
|
event.preventDefault();
|
|
236
|
-
|
|
237
|
-
const currentDistance = getTouchDistance(event.touches);
|
|
238
|
-
const zoomFactor = currentDistance / lastTouchDistance;
|
|
239
|
-
this.ganttChartController.baseWidth *= zoomFactor;
|
|
240
|
-
if (this.ganttChartController.baseWidth > 60) {
|
|
241
|
-
if (this.ganttChartController.level == 'year-quarter') {
|
|
242
|
-
this.ganttChartController.baseWidth = 60;
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
this.ganttChartController.level = levelUp(this.ganttChartController.level);
|
|
246
|
-
this.ganttChartController.baseWidth = 30;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
else if (this.ganttChartController.baseWidth < 30) {
|
|
250
|
-
if (this.ganttChartController.level == 'week-day') {
|
|
251
|
-
this.ganttChartController.baseWidth = 30;
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
this.ganttChartController.level = levelDown(this.ganttChartController.level);
|
|
255
|
-
this.ganttChartController.baseWidth = 60;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
lastTouchDistance = currentDistance;
|
|
259
|
-
this.ganttChartController.updateTimeScale();
|
|
260
|
-
this.requestUpdate();
|
|
261
|
-
// Dispatch custom event to sync with ox-resource-chart
|
|
262
|
-
const customEvent = new CustomEvent('timescale-changed', {
|
|
263
|
-
detail: {
|
|
264
|
-
baseWidth: this.ganttChartController.baseWidth,
|
|
265
|
-
level: this.ganttChartController.level
|
|
266
|
-
},
|
|
267
|
-
bubbles: true,
|
|
268
|
-
composed: true
|
|
269
|
-
});
|
|
270
|
-
this.dispatchEvent(customEvent);
|
|
271
|
-
}
|
|
272
|
-
else if (isDragging && startX !== null) {
|
|
273
|
-
const touch = event.touches[0];
|
|
274
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
275
|
-
const currentX = touch.clientX - containerOffsetX;
|
|
276
|
-
this.highlightSelection(startX, currentX);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
const handleTouchEnd = (event) => {
|
|
280
|
-
event.preventDefault();
|
|
281
|
-
if (event.touches.length < 2) {
|
|
282
|
-
lastTouchDistance = null;
|
|
283
|
-
}
|
|
284
|
-
if (!isDragging || startX === null) {
|
|
285
|
-
const touch = event.changedTouches[0];
|
|
286
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
287
|
-
const clickX = touch.clientX - containerOffsetX;
|
|
288
|
-
this.finalizeSelection(clickX, clickX);
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
const touch = event.changedTouches[0];
|
|
292
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
293
|
-
const endX = touch.clientX - containerOffsetX;
|
|
294
|
-
this.finalizeSelection(startX, endX);
|
|
295
|
-
isDragging = false;
|
|
296
|
-
startX = null;
|
|
297
|
-
};
|
|
298
|
-
const getTouchDistance = (touches) => {
|
|
299
|
-
const dx = touches[0].clientX - touches[1].clientX;
|
|
300
|
-
const dy = touches[0].clientY - touches[1].clientY;
|
|
301
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
302
|
-
};
|
|
303
|
-
const handleMouseDown = (event) => {
|
|
304
|
-
isDragging = true;
|
|
237
|
+
event.stopPropagation();
|
|
305
238
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
306
239
|
startX = event.clientX - containerOffsetX;
|
|
240
|
+
window.addEventListener('pointermove', handlePointerMove);
|
|
241
|
+
window.addEventListener('pointerup', handlePointerUp);
|
|
307
242
|
};
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
|
|
243
|
+
const handlePointerMove = (event) => {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
event.stopPropagation();
|
|
311
246
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
312
247
|
const currentX = event.clientX - containerOffsetX;
|
|
313
248
|
this.highlightSelection(startX, currentX);
|
|
314
249
|
};
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
250
|
+
const handlePointerUp = (event) => {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
event.stopPropagation();
|
|
253
|
+
window.removeEventListener('pointermove', handlePointerMove);
|
|
254
|
+
window.removeEventListener('pointerup', handlePointerUp);
|
|
322
255
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
323
256
|
const endX = event.clientX - containerOffsetX;
|
|
324
257
|
this.finalizeSelection(startX, endX);
|
|
325
|
-
isDragging = false;
|
|
326
258
|
startX = null;
|
|
327
259
|
};
|
|
328
|
-
header.on('
|
|
329
|
-
header.on('mousemove', handleMouseMove);
|
|
330
|
-
header.on('mouseup', handleMouseUp);
|
|
331
|
-
header.on('touchstart', handleTouchStart);
|
|
332
|
-
header.on('touchmove', handleTouchMove);
|
|
333
|
-
header.on('touchend', handleTouchEnd);
|
|
260
|
+
header.on('pointerdown', handlePointerDown);
|
|
334
261
|
}
|
|
335
262
|
highlightSelection(startX, endX) {
|
|
336
263
|
const header = d3.select(this.svgHeader);
|
|
@@ -431,6 +358,13 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
431
358
|
});
|
|
432
359
|
header.node()?.dispatchEvent(customEvent);
|
|
433
360
|
}
|
|
361
|
+
clearSelection() {
|
|
362
|
+
const header = d3.select(this.svgHeader);
|
|
363
|
+
const body = d3.select(this.svgBody);
|
|
364
|
+
// 선택한 영역을 나타내는 모든 'selection-rect' 요소를 제거합니다.
|
|
365
|
+
header.selectAll('.selection-rect').remove();
|
|
366
|
+
body.selectAll('.selection-rect').remove();
|
|
367
|
+
}
|
|
434
368
|
};
|
|
435
369
|
__decorate([
|
|
436
370
|
property({ type: String, attribute: 'from-date' })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-gantt-chart.js","sourceRoot":"","sources":["../../src/ox-gant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,GAAG,IAAI,WAAW,CAAC,qBAAqB,EAAE;YACzD,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,KAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,GAAI,CAAC,EAAE;SAC7D,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,EAAE,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IAC3C,CAAC;;AA7bmD;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;8CAEnC;AACkC;IAAjD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;4CAEjC;AACqC;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;+CAAkC;AAC3D;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CAAmB;AACc;IAA1D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;oDAAwB;AACtD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuC;AAE5C;IAArB,KAAK,CAAC,aAAa,CAAC;+CAAuB;AACxB;IAAnB,KAAK,CAAC,WAAW,CAAC;6CAAqB;AACZ;IAA3B,KAAK,CAAC,mBAAmB,CAAC;+CAA2B;AAC5B;IAAzB,KAAK,CAAC,iBAAiB,CAAC;6CAAwB;AAtEtC,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAqfxB","sourcesContent":["import './ox-task-tooltip.js'\nimport './ox-resource-chart.js'\n\nimport { LitElement, html, css, PropertyValues, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport * as d3 from 'd3'\nimport { locales } from './locales'\n\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { GanttChartController } from './gantt-chart-controller'\nimport { Task, TimeScale } from './types.js'\nimport { levelDown, levelUp } from './utils'\nimport { OxTaskTooltip } from './ox-task-tooltip.js'\n\n@customElement('ox-gantt-chart')\nexport class OxGanttChart extends LitElement {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n overflow: hidden;\n position: relative;\n }\n div[chart-container] {\n display: block;\n overflow-x: auto;\n overflow-y: hidden;\n }\n svg {\n min-width: 100%;\n }\n svg[header] {\n display: block;\n min-width: 100%;\n box-sizing: border-box;\n height: 40px;\n color: var(--ox-gantt-header-color, var(--md-sys-color-on-secondary-container));\n background-color: var(--ox-gantt-header-background-color, var(--md-sys-color-secondary-container));\n border-bottom: 1px solid var(--ox-gantt-header-border-color, var(--md-sys-color-outline));\n position: sticky;\n top: 0;\n z-index: 1;\n }\n .scroll-buttons {\n position: absolute;\n top: 44px; /* 헤더 바로 아래 위치 */\n right: 4px;\n display: flex;\n align-items: center;\n gap: 2px;\n }\n .scroll-button {\n width: 10px;\n height: 10px;\n background-color: var(--ox-gantt-header-color, var(--md-sys-color-on-secondary-container));\n clip-path: polygon(50% 0%, 0% 100%, 100% 100%);\n cursor: pointer;\n transform: rotate(90deg);\n }\n .scroll-button.left {\n transform: rotate(-90deg);\n }\n .scroll-button.right {\n transform: rotate(90deg);\n }\n `\n ]\n\n @property({ type: String, attribute: 'from-date' }) fromDate: string = new Date(new Date().getFullYear(), 0, 1)\n .toISOString()\n .split('T')[0]\n @property({ type: String, attribute: 'to-date' }) toDate: string = new Date(new Date().getFullYear(), 11, 31)\n .toISOString()\n .split('T')[0]\n @property({ type: String, attribute: 'axis-scale' }) axisScale: TimeScale = 'week-day'\n @property({ type: Array }) tasks: Task[] = []\n @property({ type: String, attribute: 'selected-task-id' }) selectedTaskId?: string\n @property({ type: String }) locale: string = 'en-US'\n @property({ type: Object }) colorProvider!: (task: Task) => string\n\n @query('svg[header]') svgHeader!: SVGElement\n @query('svg[body]') svgBody!: SVGElement\n @query('[chart-container]') container!: HTMLDivElement\n @query('ox-task-tooltip') tooltip!: OxTaskTooltip\n\n private ganttChartController: GanttChartController\n\n constructor() {\n super()\n this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale)\n }\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.initHeaderGestureHandlers()\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('fromDate') || changedProperties.has('toDate')) {\n this.ganttChartController.updateRange(this.fromDate, this.toDate)\n }\n\n if (changedProperties.has('tasks')) {\n this.ganttChartController.setTasks(this.flattenTasks(this.tasks))\n this.svgBody.style.height = Math.max(this.tasks.length * 30, 2000) + 'px'\n }\n\n if (changedProperties.has('locale')) {\n this.updateLocale(this.locale)\n }\n\n if (changedProperties.has('selectedTaskId')) {\n this.ganttChartController.selectedTaskId = this.selectedTaskId\n }\n\n if (changedProperties.has('axisScale')) {\n this.ganttChartController.level = this.axisScale\n this.ganttChartController.updateTimeScale()\n }\n\n if (changedProperties.has('colorProvider')) {\n this.ganttChartController.setColorProvider(this.colorProvider)\n }\n\n this.ganttChartController.drawAxes(this.svgHeader)\n this.ganttChartController.drawBody(this.svgBody, this.tooltip)\n }\n\n render() {\n return html`\n <div\n chart-container\n @wheel=${(e: WheelEvent) => this.ganttChartController.handleWheelForBody(e, this.container)}\n @touchstart=${(e: TouchEvent) => this.ganttChartController.handleTouchStartForBody(e, this.container)}\n @touchmove=${(e: TouchEvent) => this.ganttChartController.handleTouchMoveForBody(e, this.container)}\n >\n <svg\n header\n @date-range-selected=${(e: CustomEvent) => this.handleDateRangeSelected(e)}\n @wheel=${this.handleWheelForHeader.bind(this)}\n ></svg>\n <svg body></svg>\n <div class=\"scroll-buttons\">\n <div class=\"scroll-button left\" @click=${this.scrollToStart}></div>\n <div class=\"scroll-button right\" @click=${this.scrollToEnd}></div>\n </div>\n <ox-task-tooltip></ox-task-tooltip>\n </div>\n `\n }\n\n scrollToStart() {\n this.container.scrollTo({ left: 0, behavior: 'auto' })\n\n this.syncScrollPosition()\n }\n\n scrollToEnd() {\n this.container.scrollTo({ left: this.container.scrollWidth, behavior: 'auto' })\n this.syncScrollPosition()\n }\n\n syncScrollPosition() {\n const scrollLeft = this.container.scrollLeft\n const customEvent = new CustomEvent('scroll', {\n detail: { scrollLeft },\n bubbles: true,\n composed: true\n })\n\n this.dispatchEvent(customEvent)\n }\n\n setVerticalOffset(offset: number) {\n this.container.scrollTop = offset\n }\n\n getVerticalOffset(): number {\n return this.container.scrollTop\n }\n\n setHorizontalOffset(offset: number) {\n this.container.scrollLeft = offset\n }\n\n getHorizontalOffset(): number {\n return this.container.scrollLeft\n }\n\n flattenTasks(tasks: Task[], level: number = 0): Task[] {\n return tasks.flatMap(task =>\n task.collapsed ? [{ ...task, level }] : [{ ...task, level }, ...this.flattenTasks(task.children || [], level + 1)]\n )\n }\n\n // 나머지 메서드는 기존 코드와 동일하게 유지\n handleWheelForHeader(event: WheelEvent) {\n event.preventDefault()\n event.stopPropagation()\n\n const deltaModeFactor =\n event.deltaMode === WheelEvent.DOM_DELTA_LINE\n ? 16\n : event.deltaMode === WheelEvent.DOM_DELTA_PAGE\n ? this.container.clientHeight\n : 1\n\n // deltaY 값이 0인 경우, deltaX 값을 사용하여 확대/축소를 처리\n const delta = event.deltaY !== 0 ? event.deltaY : event.deltaX\n const adjustedDelta = delta * deltaModeFactor\n\n // 확대/축소 처리\n const zoomFactor = adjustedDelta < 0 ? 1.1 : 0.9\n this.ganttChartController.baseWidth *= zoomFactor\n\n if (this.ganttChartController.baseWidth > 40) {\n if (this.ganttChartController.level === 'week-day') {\n this.ganttChartController.baseWidth = 40\n } else {\n this.ganttChartController.level = levelDown(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 30\n }\n } else if (this.ganttChartController.baseWidth < 30) {\n if (this.ganttChartController.level === 'year-quarter') {\n this.ganttChartController.baseWidth = 30\n }\n }\n\n if (this.ganttChartController.baseWidth < 20) {\n this.ganttChartController.level = levelUp(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 30\n }\n\n this.ganttChartController.updateTimeScale()\n this.requestUpdate()\n\n // Dispatch custom event to sync with ox-resource-chart\n const customEvent = new CustomEvent('timescale-changed', {\n detail: {\n baseWidth: this.ganttChartController.baseWidth,\n level: this.ganttChartController.level\n },\n bubbles: true,\n composed: true\n })\n this.dispatchEvent(customEvent)\n }\n\n handleDateRangeSelected(event: CustomEvent) {\n const detail = event.detail\n this.dispatchEvent(new CustomEvent('date-range-selected', { detail }))\n }\n\n updateLocale(locale: string) {\n const localeDefinition = (locales as any)[locale || 'en-US']\n if (localeDefinition) {\n d3.timeFormatDefaultLocale(localeDefinition)\n this.ganttChartController.updateTimeScale()\n }\n }\n\n initHeaderGestureHandlers() {\n const header = d3.select(this.svgHeader)\n\n let isDragging = false\n let startX: number | null = null\n let lastTouchDistance: number | null = null\n\n const handleTouchStart = (event: TouchEvent) => {\n event.preventDefault()\n\n if (event.touches.length === 2) {\n lastTouchDistance = getTouchDistance(event.touches)\n } else {\n isDragging = true\n const touch = event.touches[0]\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n startX = touch.clientX - containerOffsetX\n }\n }\n\n const handleTouchMove = (event: TouchEvent) => {\n event.preventDefault()\n\n if (event.touches.length === 2 && lastTouchDistance !== null) {\n const currentDistance = getTouchDistance(event.touches)\n const zoomFactor = currentDistance / lastTouchDistance\n this.ganttChartController.baseWidth *= zoomFactor\n\n if (this.ganttChartController.baseWidth > 60) {\n if (this.ganttChartController.level == 'year-quarter') {\n this.ganttChartController.baseWidth = 60\n } else {\n this.ganttChartController.level = levelUp(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 30\n }\n } else if (this.ganttChartController.baseWidth < 30) {\n if (this.ganttChartController.level == 'week-day') {\n this.ganttChartController.baseWidth = 30\n } else {\n this.ganttChartController.level = levelDown(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 60\n }\n }\n\n lastTouchDistance = currentDistance\n this.ganttChartController.updateTimeScale()\n this.requestUpdate()\n\n // Dispatch custom event to sync with ox-resource-chart\n const customEvent = new CustomEvent('timescale-changed', {\n detail: {\n baseWidth: this.ganttChartController.baseWidth,\n level: this.ganttChartController.level\n },\n bubbles: true,\n composed: true\n })\n this.dispatchEvent(customEvent)\n } else if (isDragging && startX !== null) {\n const touch = event.touches[0]\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const currentX = touch.clientX - containerOffsetX\n this.highlightSelection(startX, currentX)\n }\n }\n\n const handleTouchEnd = (event: TouchEvent) => {\n event.preventDefault()\n\n if (event.touches.length < 2) {\n lastTouchDistance = null\n }\n\n if (!isDragging || startX === null) {\n const touch = event.changedTouches[0]\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const clickX = touch.clientX - containerOffsetX\n this.finalizeSelection(clickX, clickX)\n return\n }\n\n const touch = event.changedTouches[0]\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const endX = touch.clientX - containerOffsetX\n this.finalizeSelection(startX, endX)\n\n isDragging = false\n startX = null\n }\n\n const getTouchDistance = (touches: TouchList): number => {\n const dx = touches[0].clientX - touches[1].clientX\n const dy = touches[0].clientY - touches[1].clientY\n return Math.sqrt(dx * dx + dy * dy)\n }\n\n const handleMouseDown = (event: MouseEvent) => {\n isDragging = true\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n startX = event.clientX - containerOffsetX\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n if (!isDragging || startX === null) return\n\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const currentX = event.clientX - containerOffsetX\n this.highlightSelection(startX, currentX)\n }\n\n const handleMouseUp = (event: MouseEvent) => {\n if (!isDragging || startX === null) {\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const clickX = event.clientX - containerOffsetX\n this.finalizeSelection(clickX, clickX)\n return\n }\n\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const endX = event.clientX - containerOffsetX\n this.finalizeSelection(startX, endX)\n\n isDragging = false\n startX = null\n }\n\n header.on('mousedown', handleMouseDown)\n header.on('mousemove', handleMouseMove)\n header.on('mouseup', handleMouseUp)\n header.on('touchstart', handleTouchStart)\n header.on('touchmove', handleTouchMove)\n header.on('touchend', handleTouchEnd)\n }\n\n highlightSelection(startX: number, endX: number) {\n const header = d3.select(this.svgHeader)\n const body = d3.select(this.svgBody)\n\n let startDate = this.ganttChartController.timeScale.invert(startX)\n let endDate = this.ganttChartController.timeScale.invert(endX)\n\n let start, end\n\n if (this.ganttChartController.level === 'week-day') {\n start = d3.timeDay.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeDay.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'quarter-week') {\n start = d3.timeWeek.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeWeek.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-month') {\n start = d3.timeMonth.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-quarter') {\n start = d3.timeMonth.every(3)!.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.every(3)!.ceil(d3.max([startDate, endDate])!), -1)\n }\n\n header.selectAll('.selection-rect').remove()\n body.selectAll('.selection-rect').remove()\n\n header\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 20)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', 20)\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n body\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 0)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', '100%')\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n }\n\n finalizeSelection(startX: number, endX: number) {\n const header = d3.select(this.svgHeader)\n const body = d3.select(this.svgBody)\n\n let startDate = this.ganttChartController.timeScale.invert(startX)\n let endDate = this.ganttChartController.timeScale.invert(endX)\n\n let start, end\n\n if (this.ganttChartController.level === 'week-day') {\n start = d3.timeDay.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeDay.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'quarter-week') {\n start = d3.timeWeek.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeWeek.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-month') {\n start = d3.timeMonth.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-quarter') {\n start = d3.timeMonth.every(3)!.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.every(3)!.ceil(d3.max([startDate, endDate])!), -1)\n }\n\n header.selectAll('.selection-rect').remove()\n body.selectAll('.selection-rect').remove()\n\n header\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 20)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', 20)\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n body\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 0)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', '100%')\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n const formatDate = d3.timeFormat('%Y-%m-%d')\n const customEvent = new CustomEvent('date-range-selected', {\n detail: { start: formatDate(start!), end: formatDate(end!) }\n })\n\n header.node()?.dispatchEvent(customEvent)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-gantt-chart.js","sourceRoot":"","sources":["../../src/ox-gantt-chart.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAoC,MAAM,KAAK,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAGlD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,OAAO,CAAC,UAAU,CAAC;IAA9C;;QA6D+C,aAAQ,GAAW,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,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C;QAC9C,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAA;QAC5C,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAA;IAC5C,CAAC;;AArXmD;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;8CAEnC;AACkC;IAAjD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;4CAEjC;AACqC;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;+CAAkC;AAC3D;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CAAmB;AACc;IAA1D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;oDAAwB;AACtD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuC;AAE5C;IAArB,KAAK,CAAC,aAAa,CAAC;+CAAuB;AACxB;IAAnB,KAAK,CAAC,WAAW,CAAC;6CAAqB;AACZ;IAA3B,KAAK,CAAC,mBAAmB,CAAC;+CAA2B;AAC5B;IAAzB,KAAK,CAAC,iBAAiB,CAAC;6CAAwB;AA5EtC,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAmbxB","sourcesContent":["import './ox-task-tooltip.js'\nimport './ox-resource-chart.js'\n\nimport { LitElement, html, css, PropertyValues, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport * as d3 from 'd3'\nimport { locales } from './locales'\n\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { GanttChartController } from './gantt-chart-controller'\nimport { Task, TimeScale } from './types.js'\nimport { levelDown, levelUp } from './utils'\nimport { OxTaskTooltip } from './ox-task-tooltip.js'\n\nimport { gesture } from '@operato/utils/gesture-mixin.js'\n\n@customElement('ox-gantt-chart')\nexport class OxGanttChart extends gesture(LitElement) {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n overflow: hidden;\n position: relative;\n user-select: none;\n }\n\n div[chart-container] {\n display: block;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior: none;\n touch-action: none;\n }\n\n svg {\n min-width: 100%;\n }\n\n svg[header] {\n display: block;\n min-width: 100%;\n box-sizing: border-box;\n height: 40px;\n color: var(--ox-gantt-header-color, var(--md-sys-color-on-secondary-container));\n background-color: var(--ox-gantt-header-background-color, var(--md-sys-color-secondary-container));\n border-bottom: 1px solid var(--ox-gantt-header-border-color, var(--md-sys-color-outline));\n position: sticky;\n top: 0;\n z-index: 1;\n }\n\n .scroll-button {\n position: absolute;\n top: 46px; /* 헤더 바로 아래 위치 */\n width: 14px;\n height: 14px;\n background-color: var(--ox-gantt-header-color, var(--md-sys-color-on-secondary-container));\n opacity: 0.5;\n clip-path: polygon(50% 0%, 0% 100%, 100% 100%);\n cursor: pointer;\n transform: rotate(90deg);\n }\n\n .scroll-button.left {\n left: 6px;\n transform: rotate(-90deg);\n }\n\n .scroll-button.right {\n transform: rotate(90deg);\n right: 6px;\n }\n `\n ]\n\n @property({ type: String, attribute: 'from-date' }) fromDate: string = new Date(new Date().getFullYear(), 0, 1)\n .toISOString()\n .split('T')[0]\n @property({ type: String, attribute: 'to-date' }) toDate: string = new Date(new Date().getFullYear(), 11, 31)\n .toISOString()\n .split('T')[0]\n @property({ type: String, attribute: 'axis-scale' }) axisScale: TimeScale = 'week-day'\n @property({ type: Array }) tasks: Task[] = []\n @property({ type: String, attribute: 'selected-task-id' }) selectedTaskId?: string\n @property({ type: String }) locale: string = 'en-US'\n @property({ type: Object }) colorProvider!: (task: Task) => string\n\n @query('svg[header]') svgHeader!: SVGElement\n @query('svg[body]') svgBody!: SVGElement\n @query('[chart-container]') container!: HTMLDivElement\n @query('ox-task-tooltip') tooltip!: OxTaskTooltip\n\n private ganttChartController!: GanttChartController\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.initHeaderGestureHandlers()\n\n this.addEventListener('date-range-cleared', e => this.clearSelection())\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale)\n\n this.addEventListener('pinch', this.ganttChartController.handlePinchForBody as EventListener)\n this.addEventListener('drag', this.ganttChartController.handleDragForBody as EventListener)\n this.addEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody as EventListener)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n this.removeEventListener('pinch', this.ganttChartController.handlePinchForBody as EventListener)\n this.removeEventListener('drag', this.ganttChartController.handleDragForBody as EventListener)\n this.removeEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody as EventListener)\n\n this.ganttChartController.dispose()\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('fromDate') || changedProperties.has('toDate')) {\n this.ganttChartController.updateRange(this.fromDate, this.toDate)\n }\n\n if (changedProperties.has('tasks')) {\n const flattenTasks = this.flattenTasks(this.tasks)\n this.ganttChartController.setTasks(flattenTasks)\n this.svgBody.style.height = Math.max(flattenTasks.length * 30, 2000) + 'px'\n }\n\n if (changedProperties.has('locale')) {\n this.updateLocale(this.locale)\n }\n\n if (changedProperties.has('selectedTaskId')) {\n this.ganttChartController.selectedTaskId = this.selectedTaskId\n }\n\n if (changedProperties.has('axisScale')) {\n this.ganttChartController.level = this.axisScale\n this.ganttChartController.updateTimeScale()\n }\n\n if (changedProperties.has('colorProvider')) {\n this.ganttChartController.setColorProvider(this.colorProvider)\n }\n\n this.ganttChartController.drawAxes(this.svgHeader)\n this.ganttChartController.drawBody(this.svgBody, this.tooltip)\n }\n\n render() {\n return html`\n <div chart-container @wheel=${(e: WheelEvent) => this.ganttChartController.handleWheelForBody(e, this.container)}>\n <svg\n header\n @date-range-selected=${(e: CustomEvent) => this.handleDateRangeSelected(e)}\n @wheel=${this.handleWheelForHeader.bind(this)}\n ></svg>\n <svg body></svg>\n <div class=\"scroll-button left\" @click=${this.scrollToStart} @touchstart=${this.scrollToStart}></div>\n <div class=\"scroll-button right\" @click=${this.scrollToEnd} @touchstart=${this.scrollToEnd}></div>\n <ox-task-tooltip></ox-task-tooltip>\n </div>\n `\n }\n\n scrollToStart() {\n this.container.scrollTo({ left: 0, behavior: 'auto' })\n\n this.syncScrollPosition()\n }\n\n scrollToEnd() {\n this.container.scrollTo({ left: this.container.scrollWidth, behavior: 'auto' })\n this.syncScrollPosition()\n }\n\n syncScrollPosition() {\n const scrollLeft = this.container.scrollLeft\n const customEvent = new CustomEvent('scroll', {\n detail: { scrollLeft },\n bubbles: true,\n composed: true\n })\n\n this.dispatchEvent(customEvent)\n }\n\n setVerticalOffset(offset: number) {\n this.container.scrollTop = offset\n }\n\n getVerticalOffset(): number {\n return this.container.scrollTop\n }\n\n setHorizontalOffset(offset: number) {\n this.container.scrollLeft = offset\n }\n\n getHorizontalOffset(): number {\n return this.container.scrollLeft\n }\n\n flattenTasks(tasks: Task[], level: number = 0): Task[] {\n return tasks.flatMap(task =>\n task.collapsed ? [{ ...task, level }] : [{ ...task, level }, ...this.flattenTasks(task.children || [], level + 1)]\n )\n }\n\n // 나머지 메서드는 기존 코드와 동일하게 유지\n handleWheelForHeader(event: WheelEvent) {\n event.preventDefault()\n event.stopPropagation()\n\n const deltaModeFactor =\n event.deltaMode === WheelEvent.DOM_DELTA_LINE\n ? 16\n : event.deltaMode === WheelEvent.DOM_DELTA_PAGE\n ? this.container.clientHeight\n : 1\n\n // deltaY 값이 0인 경우, deltaX 값을 사용하여 확대/축소를 처리\n const delta = event.deltaY !== 0 ? event.deltaY : event.deltaX\n const adjustedDelta = delta * deltaModeFactor\n\n // 확대/축소 처리\n const zoomFactor = adjustedDelta < 0 ? 1.1 : 0.9\n this.ganttChartController.baseWidth *= zoomFactor\n\n if (this.ganttChartController.baseWidth > 40) {\n if (this.ganttChartController.level === 'week-day') {\n this.ganttChartController.baseWidth = 40\n } else {\n this.ganttChartController.level = levelDown(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 30\n }\n } else if (this.ganttChartController.baseWidth < 30) {\n if (this.ganttChartController.level === 'year-quarter') {\n this.ganttChartController.baseWidth = 30\n }\n }\n\n if (this.ganttChartController.baseWidth < 20) {\n this.ganttChartController.level = levelUp(this.ganttChartController.level)\n this.ganttChartController.baseWidth = 30\n }\n\n this.ganttChartController.updateTimeScale()\n this.requestUpdate()\n\n // Dispatch custom event to sync with ox-resource-chart\n const customEvent = new CustomEvent('timescale-changed', {\n detail: {\n baseWidth: this.ganttChartController.baseWidth,\n level: this.ganttChartController.level\n },\n bubbles: true,\n composed: true\n })\n this.dispatchEvent(customEvent)\n }\n\n handleDateRangeSelected(event: CustomEvent) {\n const detail = event.detail\n this.dispatchEvent(new CustomEvent('date-range-selected', { detail, bubbles: true, composed: true }))\n }\n\n updateLocale(locale: string) {\n const localeDefinition = (locales as any)[locale || 'en-US']\n if (localeDefinition) {\n d3.timeFormatDefaultLocale(localeDefinition)\n this.ganttChartController.updateTimeScale()\n }\n }\n\n initHeaderGestureHandlers() {\n const header = d3.select(this.svgHeader)\n\n let startX: number | null = null\n\n const handlePointerDown = (event: PointerEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n startX = event.clientX - containerOffsetX\n\n window.addEventListener('pointermove', handlePointerMove)\n window.addEventListener('pointerup', handlePointerUp)\n }\n\n const handlePointerMove = (event: PointerEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const currentX = event.clientX - containerOffsetX\n\n this.highlightSelection(startX!, currentX)\n }\n\n const handlePointerUp = (event: PointerEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n window.removeEventListener('pointermove', handlePointerMove)\n window.removeEventListener('pointerup', handlePointerUp)\n\n const containerOffsetX = header.node()!.getBoundingClientRect().left\n const endX = event.clientX - containerOffsetX\n this.finalizeSelection(startX!, endX)\n\n startX = null\n }\n\n header.on('pointerdown', handlePointerDown)\n }\n\n highlightSelection(startX: number, endX: number) {\n const header = d3.select(this.svgHeader)\n const body = d3.select(this.svgBody)\n\n let startDate = this.ganttChartController.timeScale.invert(startX)\n let endDate = this.ganttChartController.timeScale.invert(endX)\n\n let start, end\n\n if (this.ganttChartController.level === 'week-day') {\n start = d3.timeDay.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeDay.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'quarter-week') {\n start = d3.timeWeek.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeWeek.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-month') {\n start = d3.timeMonth.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-quarter') {\n start = d3.timeMonth.every(3)!.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.every(3)!.ceil(d3.max([startDate, endDate])!), -1)\n }\n\n header.selectAll('.selection-rect').remove()\n body.selectAll('.selection-rect').remove()\n\n header\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 20)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', 20)\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n body\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 0)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', '100%')\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n }\n\n finalizeSelection(startX: number, endX: number) {\n const header = d3.select(this.svgHeader)\n const body = d3.select(this.svgBody)\n\n let startDate = this.ganttChartController.timeScale.invert(startX)\n let endDate = this.ganttChartController.timeScale.invert(endX)\n\n let start, end\n\n if (this.ganttChartController.level === 'week-day') {\n start = d3.timeDay.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeDay.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'quarter-week') {\n start = d3.timeWeek.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeWeek.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-month') {\n start = d3.timeMonth.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.ceil(d3.max([startDate, endDate])!), -1)\n } else if (this.ganttChartController.level === 'year-quarter') {\n start = d3.timeMonth.every(3)!.floor(d3.min([startDate, endDate])!)\n end = d3.timeDay.offset(d3.timeMonth.every(3)!.ceil(d3.max([startDate, endDate])!), -1)\n }\n\n header.selectAll('.selection-rect').remove()\n body.selectAll('.selection-rect').remove()\n\n header\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 20)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', 20)\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n body\n .append('rect')\n .attr('class', 'selection-rect')\n .attr('x', this.ganttChartController.timeScale(start!))\n .attr('y', 0)\n .attr(\n 'width',\n this.ganttChartController.timeScale(end!) -\n this.ganttChartController.timeScale(start!) +\n this.ganttChartController.baseWidth / this.ganttChartController.getScale()\n )\n .attr('height', '100%')\n .attr('fill', 'var(--ox-gantt-selection-color, var(--md-sys-color-on-primary-container))')\n .attr('opacity', '.2')\n\n const formatDate = d3.timeFormat('%Y-%m-%d')\n const customEvent = new CustomEvent('date-range-selected', {\n detail: { start: formatDate(start!), end: formatDate(end!) }\n })\n\n header.node()?.dispatchEvent(customEvent)\n }\n\n clearSelection() {\n const header = d3.select(this.svgHeader)\n const body = d3.select(this.svgBody)\n\n // 선택한 영역을 나타내는 모든 'selection-rect' 요소를 제거합니다.\n header.selectAll('.selection-rect').remove()\n body.selectAll('.selection-rect').remove()\n }\n}\n"]}
|
|
@@ -5,8 +5,12 @@ export declare class OxGanttResizeSplitter extends LitElement {
|
|
|
5
5
|
connectedCallback(): void;
|
|
6
6
|
render(): import("lit-html").TemplateResult<1>;
|
|
7
7
|
private onMouseDown;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
8
|
+
private onTouchStart;
|
|
9
|
+
private startDrag;
|
|
10
10
|
private onMouseMove;
|
|
11
|
+
private onTouchMove;
|
|
12
|
+
private moveDrag;
|
|
11
13
|
private onMouseUp;
|
|
14
|
+
private onTouchEnd;
|
|
15
|
+
private endDrag;
|
|
12
16
|
}
|
|
@@ -4,8 +4,24 @@ import { customElement } from 'lit/decorators.js';
|
|
|
4
4
|
let OxGanttResizeSplitter = class OxGanttResizeSplitter extends LitElement {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
|
-
this.
|
|
8
|
-
|
|
7
|
+
this.onMouseMove = (e) => {
|
|
8
|
+
this.moveDrag(e.clientX, e.clientY);
|
|
9
|
+
};
|
|
10
|
+
this.onTouchMove = (e) => {
|
|
11
|
+
const touch = e.touches[0];
|
|
12
|
+
this.moveDrag(touch.clientX, touch.clientY);
|
|
13
|
+
};
|
|
14
|
+
this.onMouseUp = (e) => {
|
|
15
|
+
this.endDrag(e.clientX, e.clientY);
|
|
16
|
+
window.removeEventListener('mousemove', this.onMouseMove);
|
|
17
|
+
window.removeEventListener('mouseup', this.onMouseUp);
|
|
18
|
+
};
|
|
19
|
+
this.onTouchEnd = (e) => {
|
|
20
|
+
const touch = e.changedTouches[0];
|
|
21
|
+
this.endDrag(touch.clientX, touch.clientY);
|
|
22
|
+
window.removeEventListener('touchmove', this.onTouchMove);
|
|
23
|
+
window.removeEventListener('touchend', this.onTouchEnd);
|
|
24
|
+
};
|
|
9
25
|
}
|
|
10
26
|
static { this.styles = css `
|
|
11
27
|
:host {
|
|
@@ -14,15 +30,29 @@ let OxGanttResizeSplitter = class OxGanttResizeSplitter extends LitElement {
|
|
|
14
30
|
background-color: var(--splitter-background-color);
|
|
15
31
|
width: var(--width);
|
|
16
32
|
height: var(--height);
|
|
33
|
+
z-index: 2;
|
|
17
34
|
}
|
|
18
35
|
|
|
19
36
|
:host(:hover) {
|
|
20
37
|
background-color: var(--splitter-hover-background-color);
|
|
21
38
|
}
|
|
22
39
|
|
|
40
|
+
/* 터치 영역을 넓히기 위해 실제 터치 영역을 더 크게 설정 */
|
|
23
41
|
div {
|
|
24
42
|
width: var(--width);
|
|
25
43
|
height: var(--height);
|
|
44
|
+
touch-action: none; /* 터치 이벤트 처리에 방해되지 않도록 설정 */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
div.touch-target {
|
|
48
|
+
width: var(--width);
|
|
49
|
+
height: var(--height);
|
|
50
|
+
transform: scale(1, 5);
|
|
51
|
+
transform-origin: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([vertical]) div.touch-target {
|
|
55
|
+
transform: scale(5, 1); /* 세로 스플리터는 세로 방향으로 터치 영역을 확장 */
|
|
26
56
|
}
|
|
27
57
|
`; }
|
|
28
58
|
connectedCallback() {
|
|
@@ -39,43 +69,48 @@ let OxGanttResizeSplitter = class OxGanttResizeSplitter extends LitElement {
|
|
|
39
69
|
}
|
|
40
70
|
}
|
|
41
71
|
render() {
|
|
42
|
-
return html
|
|
72
|
+
return html `
|
|
73
|
+
<div
|
|
74
|
+
class="touch-target"
|
|
75
|
+
@mousedown=${(e) => this.onMouseDown(e)}
|
|
76
|
+
@touchstart=${this.onTouchStart}
|
|
77
|
+
></div>
|
|
78
|
+
<div></div>
|
|
79
|
+
<!-- 실제 보이는 스플리터 -->
|
|
80
|
+
`;
|
|
43
81
|
}
|
|
44
82
|
onMouseDown(e) {
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
83
|
+
this.startDrag(e.clientX, e.clientY);
|
|
84
|
+
window.addEventListener('mousemove', this.onMouseMove);
|
|
85
|
+
window.addEventListener('mouseup', this.onMouseUp);
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
}
|
|
88
|
+
onTouchStart(e) {
|
|
89
|
+
// 터치가 touch-target에서 시작된 경우에만 작동
|
|
90
|
+
if (e.target.classList.contains('touch-target')) {
|
|
91
|
+
const touch = e.touches[0];
|
|
92
|
+
this.startDrag(touch.clientX, touch.clientY);
|
|
93
|
+
window.addEventListener('touchmove', this.onTouchMove);
|
|
94
|
+
window.addEventListener('touchend', this.onTouchEnd);
|
|
95
|
+
}
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
}
|
|
98
|
+
startDrag(clientX, clientY) {
|
|
99
|
+
this.dragstart = { x: clientX, y: clientY };
|
|
49
100
|
this.dispatchEvent(new CustomEvent('splitter-dragstart', {
|
|
50
101
|
bubbles: true,
|
|
51
102
|
composed: true
|
|
52
103
|
}));
|
|
53
|
-
this.parentElement.addEventListener('mousemove', this.onMouseMoveHandler);
|
|
54
|
-
this.parentElement.addEventListener('mouseup', this.onMouseUpHandler);
|
|
55
|
-
window.addEventListener('mousemove', this.onMouseMoveHandler);
|
|
56
|
-
window.addEventListener('mouseup', this.onMouseUpHandler);
|
|
57
|
-
e.stopPropagation();
|
|
58
104
|
}
|
|
59
|
-
|
|
60
|
-
if (!this.dragstart)
|
|
105
|
+
moveDrag(clientX, clientY) {
|
|
106
|
+
if (!this.dragstart)
|
|
61
107
|
return;
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
if (e.clientX < parentRect.left ||
|
|
65
|
-
e.clientX > parentRect.right ||
|
|
66
|
-
e.clientY < parentRect.top ||
|
|
67
|
-
e.clientY > parentRect.bottom) {
|
|
68
|
-
this.onMouseUp(e);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
e.preventDefault();
|
|
108
|
+
const deltaX = clientX - this.dragstart.x;
|
|
109
|
+
const deltaY = clientY - this.dragstart.y;
|
|
72
110
|
this.dispatchEvent(new CustomEvent('splitter-drag', {
|
|
73
111
|
bubbles: true,
|
|
74
112
|
composed: true,
|
|
75
|
-
detail: {
|
|
76
|
-
x: e.clientX - this.dragstart.x,
|
|
77
|
-
y: e.clientY - this.dragstart.y
|
|
78
|
-
}
|
|
113
|
+
detail: { x: deltaX, y: deltaY }
|
|
79
114
|
}));
|
|
80
115
|
if (this.hasAttribute('vertical')) {
|
|
81
116
|
document.body.style.cursor = 'col-resize';
|
|
@@ -84,24 +119,20 @@ let OxGanttResizeSplitter = class OxGanttResizeSplitter extends LitElement {
|
|
|
84
119
|
document.body.style.cursor = 'row-resize';
|
|
85
120
|
}
|
|
86
121
|
document.body.style.userSelect = 'none';
|
|
87
|
-
e.stopPropagation();
|
|
88
122
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
123
|
+
endDrag(clientX, clientY) {
|
|
124
|
+
if (!this.dragstart)
|
|
125
|
+
return;
|
|
126
|
+
const deltaX = clientX - this.dragstart.x;
|
|
127
|
+
const deltaY = clientY - this.dragstart.y;
|
|
94
128
|
this.dispatchEvent(new CustomEvent('splitter-dragend', {
|
|
95
129
|
bubbles: true,
|
|
96
130
|
composed: true,
|
|
97
|
-
detail: {
|
|
98
|
-
x: e.clientX - this.dragstart.x,
|
|
99
|
-
y: e.clientY - this.dragstart.y
|
|
100
|
-
}
|
|
131
|
+
detail: { x: deltaX, y: deltaY }
|
|
101
132
|
}));
|
|
133
|
+
this.dragstart = undefined;
|
|
102
134
|
document.body.style.cursor = '';
|
|
103
135
|
document.body.style.userSelect = '';
|
|
104
|
-
e.stopPropagation();
|
|
105
136
|
}
|
|
106
137
|
};
|
|
107
138
|
OxGanttResizeSplitter = __decorate([
|