@operato/gantt 8.0.0-alpha.6 → 8.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/dist/src/gantt-chart-controller.d.ts +5 -6
  3. package/dist/src/gantt-chart-controller.js +92 -37
  4. package/dist/src/gantt-chart-controller.js.map +1 -1
  5. package/dist/src/ox-gantt-chart.d.ts +378 -3
  6. package/dist/src/ox-gantt-chart.js +86 -180
  7. package/dist/src/ox-gantt-chart.js.map +1 -1
  8. package/dist/src/ox-gantt-resize-splitter.d.ts +6 -2
  9. package/dist/src/ox-gantt-resize-splitter.js +70 -39
  10. package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
  11. package/dist/src/ox-gantt.js +11 -11
  12. package/dist/src/ox-gantt.js.map +1 -1
  13. package/dist/src/ox-resource-chart.js +2 -0
  14. package/dist/src/ox-resource-chart.js.map +1 -1
  15. package/dist/src/ox-task-tooltip.d.ts +3 -1
  16. package/dist/src/ox-task-tooltip.js +36 -11
  17. package/dist/src/ox-task-tooltip.js.map +1 -1
  18. package/dist/src/types.d.ts +1 -0
  19. package/dist/src/types.js.map +1 -1
  20. package/dist/stories/ox-gantt.stories.js +37 -1
  21. package/dist/stories/ox-gantt.stories.js.map +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +13 -13
  24. package/src/gantt-chart-controller.ts +100 -34
  25. package/src/ox-gantt-chart.ts +92 -192
  26. package/src/ox-gantt-resize-splitter.ts +72 -44
  27. package/src/ox-gantt.ts +12 -9
  28. package/src/ox-resource-chart.ts +2 -0
  29. package/src/ox-task-tooltip.ts +31 -9
  30. package/src/types.ts +1 -0
  31. package/stories/ox-gantt.stories.ts +37 -1
  32. package/themes/calendar-theme.css +3 -1
  33. package/assets/images/icon-editor-gradient-direction.png +0 -0
  34. package/assets/images/icon-properties-label.png +0 -0
  35. package/assets/images/icon-properties-line-type.png +0 -0
  36. package/assets/images/icon-properties-table.png +0 -0
@@ -1,11 +1,11 @@
1
1
  import { LitElement, html, css } from 'lit'
2
- import { customElement, property } from 'lit/decorators.js'
2
+ import { customElement, property, query } from 'lit/decorators.js'
3
3
 
4
4
  @customElement('ox-task-tooltip')
5
5
  export class OxTaskTooltip extends LitElement {
6
6
  static styles = css`
7
7
  :host {
8
- position: fixed; /* position: absolute로 변경 */
8
+ position: fixed;
9
9
  background-color: var(--ox-gantt-tooltip-background-color, var(--md-sys-color-surface-variant, #f9f9f9));
10
10
  border: 1px solid var(--ox-gantt-tooltip-border-color, var(--md-sys-color-outline, #ccc));
11
11
  padding: var(--spacing-medium, 10px);
@@ -21,17 +21,18 @@ export class OxTaskTooltip extends LitElement {
21
21
  transition:
22
22
  visibility 0.1s,
23
23
  opacity 0.1s;
24
- opacity: 0; /* 초기에는 보이지 않음 */
24
+ opacity: 0;
25
25
  }
26
26
  :host([visible]) {
27
27
  visibility: visible;
28
- opacity: 1; /* 보일 때는 불투명 */
28
+ opacity: 1;
29
29
  }
30
30
  .title {
31
31
  font-weight: bold;
32
32
  font-size: 16px;
33
33
  margin-bottom: 8px;
34
- color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4)); /* 파란색 텍스트 */
34
+ color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4));
35
+ outline: none;
35
36
  }
36
37
  .detail {
37
38
  display: grid;
@@ -42,14 +43,24 @@ export class OxTaskTooltip extends LitElement {
42
43
  .label {
43
44
  font-weight: bold;
44
45
  color: var(--ox-gantt-tooltip-color, var(--md-sys-color-secondary, #333));
45
- text-align: right; /* 라벨을 우측 정렬 */
46
+ text-align: right;
46
47
  }
47
48
  .colon {
48
49
  text-align: center;
49
50
  color: var(--ox-gantt-tooltip-color, var(--md-sys-color-secondary, #333));
50
51
  }
51
52
  .value {
52
- text-align: left; /* 값을 좌측 정렬 */
53
+ text-align: left;
54
+ color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
55
+ }
56
+ .close-button {
57
+ position: absolute;
58
+ top: 4px;
59
+ right: 8px;
60
+ background: none;
61
+ border: none;
62
+ font-size: 16px;
63
+ cursor: pointer;
53
64
  color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
54
65
  }
55
66
  `
@@ -59,6 +70,9 @@ export class OxTaskTooltip extends LitElement {
59
70
  @property({ type: String }) endDate = ''
60
71
  @property({ type: Number }) progress = 0
61
72
  @property({ type: String }) type = ''
73
+ @property({ type: Boolean, attribute: true }) visible: boolean = false
74
+
75
+ @query('.title') titleElement!: HTMLDivElement
62
76
 
63
77
  show(x: number, y: number) {
64
78
  const tooltipWidth = this.offsetWidth
@@ -100,15 +114,23 @@ export class OxTaskTooltip extends LitElement {
100
114
  }
101
115
 
102
116
  this.setAttribute('visible', '')
117
+
118
+ setTimeout(() => {
119
+ this.titleElement.addEventListener('blur', this.hide)
120
+ this.titleElement.focus({ preventScroll: true })
121
+ }, 500)
103
122
  }
104
123
 
105
- hide() {
124
+ hide = () => {
125
+ this.titleElement.removeEventListener('blur', this.hide)
106
126
  this.removeAttribute('visible')
107
127
  }
108
128
 
109
129
  render() {
110
130
  return html`
111
- <div class="title">${this.title}</div>
131
+ <div class="close-button" @click=${this.hide} @touchstart=${this.hide}>✕</div>
132
+ <div class="title" tabindex="0">${this.title}</div>
133
+
112
134
  <div class="detail">
113
135
  <span class="label">Type</span><span class="colon">:</span><span class="value">${this.type}</span>
114
136
  <span class="label">Start Date</span><span class="colon">:</span><span class="value">${this.startDate}</span>
package/src/types.ts CHANGED
@@ -11,6 +11,7 @@ export interface Task {
11
11
  dependsOn?: string
12
12
  duration: number
13
13
  tags?: TaskTag[]
14
+ style?: string
14
15
  children?: Task[]
15
16
  resources?: Resource[]
16
17
  collapsed?: boolean
@@ -68,6 +68,22 @@ const Template: Story<ArgTypes> = ({
68
68
  </style>
69
69
 
70
70
  <style>
71
+ html,
72
+ body {
73
+ margin: 0;
74
+ padding: 0;
75
+ overflow: hidden;
76
+
77
+ overscroll-behavior: none;
78
+
79
+ /* This is a font-stack that tries to use the system-default sans-serifs first */
80
+ font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
81
+ line-height: 1.5;
82
+ -webkit-font-smoothing: antialiased;
83
+
84
+ accent-color: var(--md-sys-color-primary);
85
+ }
86
+
71
87
  body {
72
88
  width: 100%;
73
89
  height: 800px;
@@ -79,7 +95,7 @@ const Template: Story<ArgTypes> = ({
79
95
 
80
96
  ox-gantt {
81
97
  width: 95%;
82
- height: 650px;
98
+ height: 800px;
83
99
  box-sizing: border-box;
84
100
 
85
101
  background-color: var(--md-sys-color-primary-container);
@@ -125,6 +141,7 @@ Regular.args = {
125
141
  id: '2',
126
142
  title: 'Development',
127
143
  type: 'milestone',
144
+ style: 'blue',
128
145
  startDate: '2023-01-06',
129
146
  endDate: '2023-01-06',
130
147
  progress: 30,
@@ -144,6 +161,7 @@ Regular.args = {
144
161
  dependsOn: '2',
145
162
  duration: 9,
146
163
  tags: ['critical'],
164
+ style: 'red',
147
165
  children: [
148
166
  {
149
167
  id: '3-1',
@@ -155,6 +173,7 @@ Regular.args = {
155
173
  dependsOn: '',
156
174
  duration: 4,
157
175
  tags: ['done'],
176
+ style: 'green',
158
177
  children: [
159
178
  {
160
179
  id: '3-1-1',
@@ -207,6 +226,7 @@ Regular.args = {
207
226
  dependsOn: '1',
208
227
  duration: 1,
209
228
  tags: ['done'],
229
+ style: 'green',
210
230
  resources: [{ type: '방수공', allocated: 5 }],
211
231
  children: []
212
232
  },
@@ -214,6 +234,7 @@ Regular.args = {
214
234
  id: '5',
215
235
  title: 'Deploy',
216
236
  type: 'milestone',
237
+ style: 'blue',
217
238
  startDate: '2023-01-15',
218
239
  endDate: '2023-01-21',
219
240
  dependsOn: '4',
@@ -226,6 +247,7 @@ Regular.args = {
226
247
  id: '6',
227
248
  title: 'Publishing',
228
249
  type: 'milestone',
250
+ style: 'blue',
229
251
  startDate: '2023-01-11',
230
252
  endDate: '2023-01-15',
231
253
  dependsOn: '5',
@@ -238,6 +260,7 @@ Regular.args = {
238
260
  id: '7',
239
261
  title: 'Provisioning',
240
262
  type: 'milestone',
263
+ style: 'blue',
241
264
  startDate: '2023-01-12',
242
265
  endDate: '2023-01-15',
243
266
  dependsOn: '6',
@@ -250,6 +273,7 @@ Regular.args = {
250
273
  id: '8',
251
274
  title: 'Alpha Test',
252
275
  type: 'milestone',
276
+ style: 'blue',
253
277
  startDate: '2023-01-15',
254
278
  endDate: '2023-01-17',
255
279
  dependsOn: '7',
@@ -262,6 +286,7 @@ Regular.args = {
262
286
  id: '9',
263
287
  title: 'Beta Task',
264
288
  type: 'milestone',
289
+ style: 'blue',
265
290
  startDate: '2023-01-15',
266
291
  endDate: '2023-01-18',
267
292
  dependsOn: '8',
@@ -280,6 +305,7 @@ Regular.args = {
280
305
  dependsOn: '9',
281
306
  duration: 1,
282
307
  tags: ['critical'],
308
+ style: 'red',
283
309
  resources: [{ type: '조적공', allocated: 6 }],
284
310
  children: []
285
311
  },
@@ -287,6 +313,7 @@ Regular.args = {
287
313
  id: '11',
288
314
  title: 'Zeta Test',
289
315
  type: 'milestone',
316
+ style: 'blue',
290
317
  startDate: '2023-01-18',
291
318
  endDate: '2023-01-22',
292
319
  dependsOn: '9',
@@ -299,6 +326,7 @@ Regular.args = {
299
326
  id: '12',
300
327
  title: 'Release',
301
328
  type: 'milestone',
329
+ style: 'blue',
302
330
  startDate: '2023-01-18',
303
331
  endDate: '2023-01-23',
304
332
  dependsOn: '9',
@@ -316,6 +344,7 @@ Regular.args = {
316
344
  dependsOn: '',
317
345
  duration: 4,
318
346
  tags: ['done'],
347
+ style: 'green',
319
348
  resources: [{ type: '방수공', allocated: 6 }],
320
349
  children: []
321
350
  },
@@ -342,12 +371,14 @@ Regular.args = {
342
371
  dependsOn: '12',
343
372
  duration: 1,
344
373
  tags: ['done'],
374
+ style: 'green',
345
375
  children: []
346
376
  },
347
377
  {
348
378
  id: '14',
349
379
  title: 'Release',
350
380
  type: 'milestone',
381
+ style: 'blue',
351
382
  startDate: '2023-01-27',
352
383
  endDate: '2023-01-30',
353
384
  dependsOn: '13',
@@ -360,6 +391,7 @@ Regular.args = {
360
391
  id: '15',
361
392
  title: 'Release',
362
393
  type: 'milestone',
394
+ style: 'blue',
363
395
  startDate: '2023-01-30',
364
396
  endDate: '2023-01-31',
365
397
  dependsOn: '14',
@@ -371,6 +403,7 @@ Regular.args = {
371
403
  id: '16',
372
404
  title: 'Release',
373
405
  type: 'milestone',
406
+ style: 'blue',
374
407
  startDate: '2023-01-31',
375
408
  endDate: '2023-02-05',
376
409
  dependsOn: '15',
@@ -383,6 +416,7 @@ Regular.args = {
383
416
  id: '17',
384
417
  title: 'Release',
385
418
  type: 'milestone',
419
+ style: 'blue',
386
420
  startDate: '2023-02-06',
387
421
  endDate: '2023-02-07',
388
422
  dependsOn: '16',
@@ -399,12 +433,14 @@ Regular.args = {
399
433
  dependsOn: '17',
400
434
  duration: 1,
401
435
  tags: ['critical'],
436
+ style: 'red',
402
437
  children: []
403
438
  },
404
439
  {
405
440
  id: '19',
406
441
  title: 'Release',
407
442
  type: 'milestone',
443
+ style: 'blue',
408
444
  startDate: '2023-02-10',
409
445
  endDate: '2023-02-25',
410
446
  dependsOn: '18',
@@ -9,7 +9,8 @@ body {
9
9
  /* monthly layout */
10
10
  --calendar-monthly-ol-margin: var(--margin-default) 0;
11
11
  --calendar-monthly-ol-top-border: 2px solid var(--md-sys-color-secondary);
12
- --calendar-current-monty-background-color: var(--md-sys-color-surface-variant);
12
+ --calendar-current-month-background-color: var(--md-sys-color-surface-variant);
13
+ --calendar-current-month-color: var(--md-sys-color-on-surface);
13
14
  --calendar-monthly-label-align: left;
14
15
  --calendar-monthly-label-padding: var(--padding-narrow) 0;
15
16
  --calendar-monthly-label-color: var(--md-sys-color-secondary);
@@ -35,6 +36,7 @@ body {
35
36
  --calendar-weekly-ol-margin: var(--margin-default) 0;
36
37
  --calendar-weekly-ol-top-border: 2px solid var(--md-sys-color-secondary);
37
38
  --calendar-current-week-background-color: var(--md-sys-color-surface-variant);
39
+ --calendar-current-week-color: var(--md-sys-color-on-surface);
38
40
  --calendar-weekly-label-align: center;
39
41
  --calendar-weekly-label-padding: var(--padding-narrow) 0;
40
42
  --calendar-weekly-label-color: var(--md-sys-color-secondary);