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

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 (49) hide show
  1. package/CHANGELOG.md +122 -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/themes/calendar-theme.css +3 -1
  25. package/.editorconfig +0 -29
  26. package/.storybook/main.js +0 -3
  27. package/.storybook/preview.js +0 -52
  28. package/.storybook/server.mjs +0 -8
  29. package/assets/images/icon-editor-gradient-direction.png +0 -0
  30. package/assets/images/icon-properties-label.png +0 -0
  31. package/assets/images/icon-properties-line-type.png +0 -0
  32. package/assets/images/icon-properties-table.png +0 -0
  33. package/src/draw-time-scale-header.ts +0 -142
  34. package/src/gantt-chart-controller.ts +0 -336
  35. package/src/index.ts +0 -0
  36. package/src/locales.ts +0 -78
  37. package/src/ox-gantt-chart.ts +0 -518
  38. package/src/ox-gantt-resize-splitter.ts +0 -131
  39. package/src/ox-gantt.ts +0 -532
  40. package/src/ox-resource-chart.ts +0 -145
  41. package/src/ox-task-tooltip.ts +0 -120
  42. package/src/resource-chart-controller.ts +0 -284
  43. package/src/types.ts +0 -32
  44. package/src/utils.ts +0 -13
  45. package/stories/ox-gantt-chart.stories.ts +0 -125
  46. package/stories/ox-gantt.stories.ts +0 -417
  47. package/tsconfig.json +0 -25
  48. package/web-dev-server.config.mjs +0 -27
  49. package/web-test-runner.config.mjs +0 -41
@@ -1,125 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
- import { CommonHeaderStyles } from '@operato/styles'
3
- import '../src/ox-gantt-chart.js'
4
-
5
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
-
7
- export default {
8
- title: 'ox-gantt-chart',
9
- component: 'ox-gantt-chart',
10
- argTypes: {
11
- axisScale: { control: 'select', options: ['year-quarter', 'year-month', 'quarter-week', 'week-day'] },
12
- fromDate: { control: 'string' },
13
- toDate: { control: 'string' },
14
- extendGridLines: { control: 'boolean' }
15
- }
16
- }
17
-
18
- interface Story<T> {
19
- (args: T): TemplateResult
20
- args?: Partial<T>
21
- argTypes?: Record<string, unknown>
22
- }
23
-
24
- interface ArgTypes {
25
- axisScale: 'year-quarter' | 'year-month' | 'quarter-week' | 'week-day'
26
- fromDate: string
27
- toDate: string
28
- extendGridLines: boolean
29
- }
30
-
31
- const Template: Story<ArgTypes> = ({
32
- axisScale = 'week-day',
33
- fromDate = '',
34
- toDate = '',
35
- extendGridLines
36
- }: ArgTypes) => html`
37
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
38
-
39
- <link href="/themes/light.css" rel="stylesheet" />
40
- <link href="/themes/dark.css" rel="stylesheet" />
41
- <link href="/themes/spacing.css" rel="stylesheet" />
42
- <link href="/themes/md-typescale-styles.css" rel="stylesheet" />
43
-
44
- <link
45
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
46
- rel="stylesheet"
47
- />
48
- <link
49
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
50
- rel="stylesheet"
51
- />
52
- <link
53
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
54
- rel="stylesheet"
55
- />
56
-
57
- <style>
58
- ${MDTypeScaleStyles.cssText}
59
- </style>
60
-
61
- <style>
62
- ${CommonHeaderStyles.cssText}
63
- </style>
64
-
65
- <style>
66
- body {
67
- width: 100%;
68
- height: 800px;
69
- text-align: center;
70
-
71
- background-color: var(--md-sys-color-background);
72
- color: var(--md-sys-color-on-background);
73
- }
74
-
75
- ox-gantt {
76
- width: 90%;
77
- height: 500px;
78
- box-sizing: border-box;
79
-
80
- background-color: var(--md-sys-color-primary-container);
81
- color: var(--md-sys-color-on-primary-container);
82
- }
83
- </style>
84
-
85
- <style>
86
- ox-gantt-chart {
87
- height: 500px;
88
- border: 1px solid black;
89
- }
90
- </style>
91
-
92
- <ox-gantt-chart
93
- .axisScale=${axisScale}
94
- .fromDate=${fromDate}
95
- .toDate=${toDate}
96
- ?extend-grid-lines=${extendGridLines}
97
- ></ox-gantt-chart>
98
- `
99
-
100
- export const YearMonth = Template.bind({})
101
- YearMonth.args = {
102
- axisScale: 'year-quarter',
103
- fromDate: '2020-01-01',
104
- toDate: '2025-12-31'
105
- }
106
-
107
- YearMonth.args = {
108
- axisScale: 'year-month',
109
- fromDate: '2022-01-01',
110
- toDate: '2024-12-31'
111
- }
112
-
113
- export const MonthWeek = Template.bind({})
114
- MonthWeek.args = {
115
- axisScale: 'quarter-week',
116
- fromDate: '2022-01-01',
117
- toDate: '2023-03-31'
118
- }
119
-
120
- export const WeekDay = Template.bind({})
121
- WeekDay.args = {
122
- axisScale: 'week-day',
123
- fromDate: '2022-01-01',
124
- toDate: '2022-11-15'
125
- }
@@ -1,417 +0,0 @@
1
- import '../src/ox-gantt.js'
2
-
3
- import { html, TemplateResult } from 'lit'
4
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
5
- import { CommonHeaderStyles } from '@operato/styles'
6
-
7
- import { Task, TimeScale } from '../src/types.js'
8
-
9
- export default {
10
- title: 'ox-gantt',
11
- component: 'ox-gantt',
12
- argTypes: {
13
- fromDate: { control: 'date' },
14
- toDate: { control: 'date' },
15
- timeScale: { control: 'select', options: ['year-quarter', 'year-month', 'quarter-week', 'week-day'] },
16
- extendGridLines: { control: 'boolean' },
17
- tasks: { control: 'object' }
18
- }
19
- }
20
-
21
- interface Story<T> {
22
- (args: T): TemplateResult
23
- args?: Partial<T>
24
- argTypes?: Record<string, unknown>
25
- }
26
-
27
- interface ArgTypes {
28
- tasks: Task[]
29
- fromDate: number | string
30
- toDate: number | string
31
- extendGridLines: boolean
32
- timeScale: TimeScale
33
- }
34
-
35
- const Template: Story<ArgTypes> = ({
36
- tasks,
37
- fromDate,
38
- toDate,
39
- extendGridLines,
40
- timeScale = 'week-day'
41
- }: ArgTypes) => html`
42
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
43
-
44
- <link href="/themes/light.css" rel="stylesheet" />
45
- <link href="/themes/dark.css" rel="stylesheet" />
46
- <link href="/themes/spacing.css" rel="stylesheet" />
47
- <link href="/themes/md-typescale-styles.css" rel="stylesheet" />
48
-
49
- <link
50
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
51
- rel="stylesheet"
52
- />
53
- <link
54
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
55
- rel="stylesheet"
56
- />
57
- <link
58
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
59
- rel="stylesheet"
60
- />
61
-
62
- <style>
63
- ${MDTypeScaleStyles.cssText}
64
- </style>
65
-
66
- <style>
67
- ${CommonHeaderStyles.cssText}
68
- </style>
69
-
70
- <style>
71
- body {
72
- width: 100%;
73
- height: 800px;
74
- text-align: center;
75
-
76
- background-color: var(--md-sys-color-background);
77
- color: var(--md-sys-color-on-background);
78
- }
79
-
80
- ox-gantt {
81
- width: 95%;
82
- height: 650px;
83
- box-sizing: border-box;
84
-
85
- background-color: var(--md-sys-color-primary-container);
86
- color: var(--md-sys-color-on-primary-container);
87
- }
88
- </style>
89
-
90
- <ox-gantt
91
- from-date=${new Date(fromDate).toISOString().split('T')[0]}
92
- to-date=${new Date(toDate).toISOString().split('T')[0]}
93
- .timeScale=${timeScale}
94
- .tasks=${tasks}
95
- @date-range-selected=${(e: CustomEvent) => {
96
- console.log('date-range-selected', e.detail)
97
- }}
98
- @task-clicked=${(e: CustomEvent) => {
99
- console.log('task-clicked', e.detail)
100
- }}
101
- ?extend-grid-lines=${extendGridLines}
102
- >
103
- </ox-gantt>
104
- `
105
-
106
- export const Regular = Template.bind({})
107
- Regular.args = {
108
- fromDate: '2022-12-27',
109
- toDate: '2024-12-31',
110
- tasks: [
111
- {
112
- id: '1',
113
- title: 'Design',
114
- type: 'task',
115
- startDate: '2023-01-01',
116
- endDate: '2023-01-05',
117
- progress: 60,
118
- dependsOn: '',
119
- duration: 5,
120
- tags: ['active'],
121
- resources: [{ type: '철근/형틀공', allocated: 6 }],
122
- children: []
123
- },
124
- {
125
- id: '2',
126
- title: 'Development',
127
- type: 'milestone',
128
- startDate: '2023-01-06',
129
- endDate: '2023-01-06',
130
- progress: 30,
131
- dependsOn: '1',
132
- duration: 1,
133
- tags: ['milestone'],
134
- resources: [{ type: '철근/형틀공', allocated: 6 }],
135
- children: []
136
- },
137
- {
138
- id: '3',
139
- title: 'Coding',
140
- type: 'phase',
141
- startDate: '2023-01-07',
142
- endDate: '2023-01-15',
143
- progress: 10,
144
- dependsOn: '2',
145
- duration: 9,
146
- tags: ['critical'],
147
- children: [
148
- {
149
- id: '3-1',
150
- title: 'Coding-A',
151
- type: 'task',
152
- startDate: '2023-01-07',
153
- endDate: '2023-01-10',
154
- progress: 60,
155
- dependsOn: '',
156
- duration: 4,
157
- tags: ['done'],
158
- children: [
159
- {
160
- id: '3-1-1',
161
- title: 'Coding-A',
162
- type: 'task',
163
- startDate: '2023-01-07',
164
- endDate: '2023-01-10',
165
- progress: 60,
166
- dependsOn: '',
167
- duration: 4,
168
- tags: ['active'],
169
- resources: [{ type: '창호공', allocated: 5 }],
170
- children: []
171
- },
172
- {
173
- id: '3-1-2',
174
- title: 'Coding-B',
175
- type: 'task',
176
- startDate: '2023-01-11',
177
- endDate: '2023-01-15',
178
- dependsOn: '3-1-1',
179
- duration: 5,
180
- tags: ['active'],
181
- resources: [{ type: '창호공', allocated: 3 }],
182
- children: []
183
- }
184
- ]
185
- },
186
- {
187
- id: '3-2',
188
- title: 'Coding-B',
189
- type: 'task',
190
- startDate: '2023-01-11',
191
- endDate: '2023-01-15',
192
- dependsOn: '3-1',
193
- duration: 5,
194
- tags: ['active'],
195
- resources: [{ type: '창호공', allocated: 6 }],
196
- children: []
197
- }
198
- ]
199
- },
200
- {
201
- id: '4',
202
- title: 'Test',
203
- type: 'milestone',
204
- startDate: '2023-01-07',
205
- endDate: '2023-01-10',
206
- progress: 100,
207
- dependsOn: '1',
208
- duration: 1,
209
- tags: ['done'],
210
- resources: [{ type: '방수공', allocated: 5 }],
211
- children: []
212
- },
213
- {
214
- id: '5',
215
- title: 'Deploy',
216
- type: 'milestone',
217
- startDate: '2023-01-15',
218
- endDate: '2023-01-21',
219
- dependsOn: '4',
220
- duration: 1,
221
- tags: ['milestone'],
222
- resources: [{ type: '목공', allocated: 3 }],
223
- children: []
224
- },
225
- {
226
- id: '6',
227
- title: 'Publishing',
228
- type: 'milestone',
229
- startDate: '2023-01-11',
230
- endDate: '2023-01-15',
231
- dependsOn: '5',
232
- duration: 1,
233
- tags: ['milestone'],
234
- resources: [{ type: '금속공', allocated: 1 }],
235
- children: []
236
- },
237
- {
238
- id: '7',
239
- title: 'Provisioning',
240
- type: 'milestone',
241
- startDate: '2023-01-12',
242
- endDate: '2023-01-15',
243
- dependsOn: '6',
244
- duration: 1,
245
- tags: ['milestone'],
246
- resources: [{ type: '타일공', allocated: 6 }],
247
- children: []
248
- },
249
- {
250
- id: '8',
251
- title: 'Alpha Test',
252
- type: 'milestone',
253
- startDate: '2023-01-15',
254
- endDate: '2023-01-17',
255
- dependsOn: '7',
256
- duration: 1,
257
- tags: ['critical'],
258
- resources: [{ type: '창호공', allocated: 7 }],
259
- children: []
260
- },
261
- {
262
- id: '9',
263
- title: 'Beta Task',
264
- type: 'milestone',
265
- startDate: '2023-01-15',
266
- endDate: '2023-01-18',
267
- dependsOn: '8',
268
- duration: 1,
269
- tags: ['active'],
270
- resources: [{ type: '도배공', allocated: 8 }],
271
- children: []
272
- },
273
- {
274
- id: '10',
275
- title: 'Gamma Test',
276
- type: 'milestone',
277
- // section: testSection,
278
- startDate: '2023-01-18',
279
- endDate: '2023-01-19',
280
- dependsOn: '9',
281
- duration: 1,
282
- tags: ['critical'],
283
- resources: [{ type: '조적공', allocated: 6 }],
284
- children: []
285
- },
286
- {
287
- id: '11',
288
- title: 'Zeta Test',
289
- type: 'milestone',
290
- startDate: '2023-01-18',
291
- endDate: '2023-01-22',
292
- dependsOn: '9',
293
- duration: 1,
294
- tags: ['milestone'],
295
- resources: [{ type: '철근/형틀공', allocated: 6 }],
296
- children: []
297
- },
298
- {
299
- id: '12',
300
- title: 'Release',
301
- type: 'milestone',
302
- startDate: '2023-01-18',
303
- endDate: '2023-01-23',
304
- dependsOn: '9',
305
- duration: 1,
306
- resources: [{ type: '방수공', allocated: 6 }],
307
- tags: ['milestone'],
308
- children: [
309
- {
310
- id: '12-1',
311
- title: 'Coding-A',
312
- type: 'task',
313
- startDate: '2023-01-07',
314
- endDate: '2023-01-10',
315
- progress: 60,
316
- dependsOn: '',
317
- duration: 4,
318
- tags: ['done'],
319
- resources: [{ type: '방수공', allocated: 6 }],
320
- children: []
321
- },
322
- {
323
- id: '12-2',
324
- title: 'Coding-B',
325
- type: 'task',
326
- startDate: '2023-01-11',
327
- endDate: '2023-01-15',
328
- dependsOn: '12-1',
329
- duration: 5,
330
- tags: ['active'],
331
- resources: [{ type: '조적공', allocated: 6 }],
332
- children: []
333
- }
334
- ]
335
- },
336
- {
337
- id: '13',
338
- title: 'Release',
339
- type: 'milestone',
340
- startDate: '2023-01-22',
341
- endDate: '2023-01-27',
342
- dependsOn: '12',
343
- duration: 1,
344
- tags: ['done'],
345
- children: []
346
- },
347
- {
348
- id: '14',
349
- title: 'Release',
350
- type: 'milestone',
351
- startDate: '2023-01-27',
352
- endDate: '2023-01-30',
353
- dependsOn: '13',
354
- duration: 1,
355
- tags: ['milestone'],
356
- resources: [{ type: '금속공', allocated: 1 }],
357
- children: []
358
- },
359
- {
360
- id: '15',
361
- title: 'Release',
362
- type: 'milestone',
363
- startDate: '2023-01-30',
364
- endDate: '2023-01-31',
365
- dependsOn: '14',
366
- duration: 1,
367
- tags: ['milestone'],
368
- children: []
369
- },
370
- {
371
- id: '16',
372
- title: 'Release',
373
- type: 'milestone',
374
- startDate: '2023-01-31',
375
- endDate: '2023-02-05',
376
- dependsOn: '15',
377
- duration: 1,
378
- resources: [{ type: '창호공', allocated: 1 }],
379
- tags: ['active'],
380
- children: []
381
- },
382
- {
383
- id: '17',
384
- title: 'Release',
385
- type: 'milestone',
386
- startDate: '2023-02-06',
387
- endDate: '2023-02-07',
388
- dependsOn: '16',
389
- duration: 1,
390
- tags: ['milestone'],
391
- children: []
392
- },
393
- {
394
- id: '18',
395
- title: 'Release',
396
- type: 'milestone',
397
- startDate: '2023-02-08',
398
- endDate: '2023-02-09',
399
- dependsOn: '17',
400
- duration: 1,
401
- tags: ['critical'],
402
- children: []
403
- },
404
- {
405
- id: '19',
406
- title: 'Release',
407
- type: 'milestone',
408
- startDate: '2023-02-10',
409
- endDate: '2023-02-25',
410
- dependsOn: '18',
411
- duration: 1,
412
- tags: ['milestone'],
413
- resources: [{ type: '창호공', allocated: 7 }],
414
- children: []
415
- }
416
- ]
417
- }
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "resolveJsonModule": true,
7
- "noEmitOnError": true,
8
- "lib": ["es2017", "dom"],
9
- "strict": true,
10
- "esModuleInterop": false,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "useDefineForClassFields": false,
14
- "importHelpers": true,
15
- "outDir": "dist",
16
- "sourceMap": true,
17
- "inlineSources": true,
18
- "rootDir": "./",
19
- "declaration": true,
20
- "incremental": true,
21
- "skipLibCheck": true,
22
- "types": ["node", "mocha"]
23
- },
24
- "include": ["**/*.ts"]
25
- }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });
@@ -1,41 +0,0 @@
1
- // import { playwrightLauncher } from '@web/test-runner-playwright';
2
-
3
- const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
-
5
- export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/test/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- /** Filter out lit dev mode logs */
15
- filterBrowserLogs(log) {
16
- for (const arg of log.args) {
17
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
- return false;
19
- }
20
- }
21
- return true;
22
- },
23
-
24
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
- // esbuildTarget: 'auto',
26
-
27
- /** Amount of browsers to run concurrently */
28
- // concurrentBrowsers: 2,
29
-
30
- /** Amount of test files per browser to test concurrently */
31
- // concurrency: 1,
32
-
33
- /** Browsers to run tests on */
34
- // browsers: [
35
- // playwrightLauncher({ product: 'chromium' }),
36
- // playwrightLauncher({ product: 'firefox' }),
37
- // playwrightLauncher({ product: 'webkit' }),
38
- // ],
39
-
40
- // See documentation for all available options
41
- });