@operato/gantt 2.0.0-beta.17 → 2.0.0-beta.19

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.
@@ -4,17 +4,18 @@ import '../src/ox-gantt.js'
4
4
  import { html, TemplateResult } from 'lit'
5
5
  import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
6
 
7
- import { Task, Section } from '../src/types.js'
7
+ import { Task, Section, TimeScale } from '../src/types.js'
8
8
 
9
9
  export default {
10
10
  title: 'ox-gantt',
11
11
  component: 'ox-gantt',
12
12
  argTypes: {
13
- tasks: { control: 'object' },
14
13
  fromDate: { control: 'date' },
15
14
  toDate: { control: 'date' },
15
+ timeScale: { control: 'select', options: ['year-quarter', 'year-month', 'quarter-week', 'week-day'] },
16
16
  extendGridLines: { control: 'boolean' },
17
- theme: { control: 'select', options: ['light', 'dark'] }
17
+ theme: { control: 'select', options: ['light', 'dark'] },
18
+ tasks: { control: 'object' }
18
19
  }
19
20
  }
20
21
 
@@ -29,10 +30,18 @@ interface ArgTypes {
29
30
  fromDate: number | string
30
31
  toDate: number | string
31
32
  extendGridLines: boolean
33
+ timeScale: TimeScale
32
34
  theme: 'light' | 'dark'
33
35
  }
34
36
 
35
- const Template: Story<ArgTypes> = ({ theme = 'light', tasks, fromDate, toDate, extendGridLines }: ArgTypes) => html`
37
+ const Template: Story<ArgTypes> = ({
38
+ theme = 'light',
39
+ tasks,
40
+ fromDate,
41
+ toDate,
42
+ extendGridLines,
43
+ timeScale = 'week-day'
44
+ }: ArgTypes) => html`
36
45
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
37
46
 
38
47
  <link href="/themes/light.css" rel="stylesheet" />
@@ -88,6 +97,7 @@ const Template: Story<ArgTypes> = ({ theme = 'light', tasks, fromDate, toDate, e
88
97
  <ox-gantt
89
98
  from-date=${new Date(fromDate).toISOString().split('T')[0]}
90
99
  to-date=${new Date(toDate).toISOString().split('T')[0]}
100
+ .timeScale=${timeScale}
91
101
  .tasks=${tasks}
92
102
  @date-range-selected=${(e: CustomEvent) => {
93
103
  console.log('date-range-selected', e.detail)
@@ -121,9 +131,9 @@ Regular.args = {
121
131
  id: '1',
122
132
  title: 'Design',
123
133
  type: 'task',
124
- section: developmentSection,
125
- startDate: new Date('2023-01-01'),
126
- endDate: new Date('2023-01-05'),
134
+ // section: developmentSection,
135
+ startDate: '2023-01-01',
136
+ endDate: '2023-01-05',
127
137
  progress: 60,
128
138
  dependsOn: '',
129
139
  length: '5d',
@@ -134,9 +144,9 @@ Regular.args = {
134
144
  id: '2',
135
145
  title: 'Development',
136
146
  type: 'milestone',
137
- section: developmentSection,
138
- startDate: new Date('2023-01-06'),
139
- endDate: new Date('2023-01-06'),
147
+ // section: developmentSection,
148
+ startDate: '2023-01-06',
149
+ endDate: '2023-01-06',
140
150
  progress: 30,
141
151
  dependsOn: '1',
142
152
  length: '1d',
@@ -147,9 +157,9 @@ Regular.args = {
147
157
  id: '3',
148
158
  title: 'Coding',
149
159
  type: 'phase',
150
- section: developmentSection,
151
- startDate: new Date('2023-01-07'),
152
- endDate: new Date('2023-01-15'),
160
+ // section: developmentSection,
161
+ startDate: '2023-01-07',
162
+ endDate: '2023-01-15',
153
163
  progress: 10,
154
164
  dependsOn: '2',
155
165
  length: '9d',
@@ -159,9 +169,9 @@ Regular.args = {
159
169
  id: '3-1',
160
170
  title: 'Coding-A',
161
171
  type: 'task',
162
- section: developmentSection,
163
- startDate: new Date('2023-01-07'),
164
- endDate: new Date('2023-01-10'),
172
+ // section: developmentSection,
173
+ startDate: '2023-01-07',
174
+ endDate: '2023-01-10',
165
175
  progress: 60,
166
176
  dependsOn: '',
167
177
  length: '4d',
@@ -172,9 +182,9 @@ Regular.args = {
172
182
  id: '3-2',
173
183
  title: 'Coding-B',
174
184
  type: 'task',
175
- section: developmentSection,
176
- startDate: new Date('2023-01-11'),
177
- endDate: new Date('2023-01-15'),
185
+ // section: developmentSection,
186
+ startDate: '2023-01-11',
187
+ endDate: '2023-01-15',
178
188
  dependsOn: '3-1',
179
189
  length: '5d',
180
190
  tags: ['active'],
@@ -186,9 +196,9 @@ Regular.args = {
186
196
  id: '4',
187
197
  title: 'Test',
188
198
  type: 'milestone',
189
- section: developmentSection,
190
- startDate: new Date('2023-01-07'),
191
- endDate: new Date('2023-01-10'),
199
+ // section: developmentSection,
200
+ startDate: '2023-01-07',
201
+ endDate: '2023-01-10',
192
202
  progress: 100,
193
203
  dependsOn: '1',
194
204
  length: '1d',
@@ -199,9 +209,9 @@ Regular.args = {
199
209
  id: '5',
200
210
  title: 'Deploy',
201
211
  type: 'milestone',
202
- section: developmentSection,
203
- startDate: new Date('2023-01-15'),
204
- endDate: new Date('2023-01-21'),
212
+ // section: developmentSection,
213
+ startDate: '2023-01-15',
214
+ endDate: '2023-01-21',
205
215
  dependsOn: '4',
206
216
  length: '1d',
207
217
  tags: ['milestone'],
@@ -211,9 +221,9 @@ Regular.args = {
211
221
  id: '6',
212
222
  title: 'Publishing',
213
223
  type: 'milestone',
214
- section: developmentSection,
215
- startDate: new Date('2023-01-11'),
216
- endDate: new Date('2023-01-15'),
224
+ // section: developmentSection,
225
+ startDate: '2023-01-11',
226
+ endDate: '2023-01-15',
217
227
  dependsOn: '5',
218
228
  length: '1d',
219
229
  tags: ['milestone'],
@@ -223,9 +233,9 @@ Regular.args = {
223
233
  id: '7',
224
234
  title: 'Provisioning',
225
235
  type: 'milestone',
226
- section: developmentSection,
227
- startDate: new Date('2023-01-12'),
228
- endDate: new Date('2023-01-15'),
236
+ // section: developmentSection,
237
+ startDate: '2023-01-12',
238
+ endDate: '2023-01-15',
229
239
  dependsOn: '6',
230
240
  length: '1d',
231
241
  tags: ['milestone'],
@@ -235,9 +245,9 @@ Regular.args = {
235
245
  id: '8',
236
246
  title: 'Alpha Test',
237
247
  type: 'milestone',
238
- section: testSection,
239
- startDate: new Date('2023-01-15'),
240
- endDate: new Date('2023-01-17'),
248
+ // section: testSection,
249
+ startDate: '2023-01-15',
250
+ endDate: '2023-01-17',
241
251
  dependsOn: '7',
242
252
  length: '1d',
243
253
  tags: ['critical'],
@@ -247,9 +257,9 @@ Regular.args = {
247
257
  id: '9',
248
258
  title: 'Beta Task',
249
259
  type: 'milestone',
250
- section: testSection,
251
- startDate: new Date('2023-01-15'),
252
- endDate: new Date('2023-01-18'),
260
+ // section: testSection,
261
+ startDate: '2023-01-15',
262
+ endDate: '2023-01-18',
253
263
  dependsOn: '8',
254
264
  length: '1d',
255
265
  tags: ['active'],
@@ -259,9 +269,9 @@ Regular.args = {
259
269
  id: '10',
260
270
  title: 'Gamma Test',
261
271
  type: 'milestone',
262
- section: testSection,
263
- startDate: new Date('2023-01-18'),
264
- endDate: new Date('2023-01-19'),
272
+ // section: testSection,
273
+ startDate: '2023-01-18',
274
+ endDate: '2023-01-19',
265
275
  dependsOn: '9',
266
276
  length: '1d',
267
277
  tags: ['critical'],
@@ -271,9 +281,9 @@ Regular.args = {
271
281
  id: '11',
272
282
  title: 'Zeta Test',
273
283
  type: 'milestone',
274
- section: testSection,
275
- startDate: new Date('2023-01-18'),
276
- endDate: new Date('2023-01-22'),
284
+ // section: testSection,
285
+ startDate: '2023-01-18',
286
+ endDate: '2023-01-22',
277
287
  dependsOn: '9',
278
288
  length: '1d',
279
289
  tags: ['milestone'],
@@ -283,9 +293,9 @@ Regular.args = {
283
293
  id: '12',
284
294
  title: 'Release',
285
295
  type: 'milestone',
286
- section: releaseSection,
287
- startDate: new Date('2023-01-18'),
288
- endDate: new Date('2023-01-23'),
296
+ // section: releaseSection,
297
+ startDate: '2023-01-18',
298
+ endDate: '2023-01-23',
289
299
  dependsOn: '9',
290
300
  length: '1d',
291
301
  tags: ['milestone'],
@@ -295,9 +305,9 @@ Regular.args = {
295
305
  id: '13',
296
306
  title: 'Release',
297
307
  type: 'milestone',
298
- section: releaseSection,
299
- startDate: new Date('2023-01-22'),
300
- endDate: new Date('2023-01-27'),
308
+ // section: releaseSection,
309
+ startDate: '2023-01-22',
310
+ endDate: '2023-01-27',
301
311
  dependsOn: '12',
302
312
  length: '1d',
303
313
  tags: ['done'],
@@ -307,9 +317,9 @@ Regular.args = {
307
317
  id: '14',
308
318
  title: 'Release',
309
319
  type: 'milestone',
310
- section: releaseSection,
311
- startDate: new Date('2023-01-27'),
312
- endDate: new Date('2023-01-30'),
320
+ // section: releaseSection,
321
+ startDate: '2023-01-27',
322
+ endDate: '2023-01-30',
313
323
  dependsOn: '13',
314
324
  length: '1d',
315
325
  tags: ['milestone'],
@@ -319,9 +329,9 @@ Regular.args = {
319
329
  id: '15',
320
330
  title: 'Release',
321
331
  type: 'milestone',
322
- section: releaseSection,
323
- startDate: new Date('2023-01-30'),
324
- endDate: new Date('2023-01-31'),
332
+ // section: releaseSection,
333
+ startDate: '2023-01-30',
334
+ endDate: '2023-01-31',
325
335
  dependsOn: '14',
326
336
  length: '1d',
327
337
  tags: ['milestone'],
@@ -331,9 +341,9 @@ Regular.args = {
331
341
  id: '16',
332
342
  title: 'Release',
333
343
  type: 'milestone',
334
- section: releaseSection,
335
- startDate: new Date('2023-01-31'),
336
- endDate: new Date('2023-02-05'),
344
+ // section: releaseSection,
345
+ startDate: '2023-01-31',
346
+ endDate: '2023-02-05',
337
347
  dependsOn: '15',
338
348
  length: '1d',
339
349
  tags: ['active'],
@@ -343,9 +353,9 @@ Regular.args = {
343
353
  id: '17',
344
354
  title: 'Release',
345
355
  type: 'milestone',
346
- section: releaseSection,
347
- startDate: new Date('2023-02-06'),
348
- endDate: new Date('2023-02-07'),
356
+ // section: releaseSection,
357
+ startDate: '2023-02-06',
358
+ endDate: '2023-02-07',
349
359
  dependsOn: '16',
350
360
  length: '1d',
351
361
  tags: ['milestone'],
@@ -355,9 +365,9 @@ Regular.args = {
355
365
  id: '18',
356
366
  title: 'Release',
357
367
  type: 'milestone',
358
- section: releaseSection,
359
- startDate: new Date('2023-02-08'),
360
- endDate: new Date('2023-02-09'),
368
+ // section: releaseSection,
369
+ startDate: '2023-02-08',
370
+ endDate: '2023-02-09',
361
371
  dependsOn: '17',
362
372
  length: '1d',
363
373
  tags: ['critical'],
@@ -367,9 +377,9 @@ Regular.args = {
367
377
  id: '19',
368
378
  title: 'Release',
369
379
  type: 'milestone',
370
- section: releaseSection,
371
- startDate: new Date('2023-02-10'),
372
- endDate: new Date('2023-02-25'),
380
+ // section: releaseSection,
381
+ startDate: '2023-02-10',
382
+ endDate: '2023-02-25',
373
383
  dependsOn: '18',
374
384
  length: '1d',
375
385
  tags: ['milestone'],