@operato/gantt 2.0.0-beta.14 → 2.0.0-beta.15

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 (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/src/gantt-chart-controller.d.ts +32 -0
  3. package/dist/src/gantt-chart-controller.js +393 -0
  4. package/dist/src/gantt-chart-controller.js.map +1 -0
  5. package/dist/src/locales.d.ts +52 -0
  6. package/dist/src/locales.js +79 -0
  7. package/dist/src/locales.js.map +1 -0
  8. package/dist/src/ox-gantt-chart.d.ts +10 -17
  9. package/dist/src/ox-gantt-chart.js +134 -440
  10. package/dist/src/ox-gantt-chart.js.map +1 -1
  11. package/dist/src/ox-gantt-resize-splitter.d.ts +2 -3
  12. package/dist/src/ox-gantt-resize-splitter.js +15 -22
  13. package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
  14. package/dist/src/ox-gantt.d.ts +13 -1
  15. package/dist/src/ox-gantt.js +144 -27
  16. package/dist/src/ox-gantt.js.map +1 -1
  17. package/dist/src/ox-task-tooltip.d.ts +12 -0
  18. package/dist/src/ox-task-tooltip.js +132 -0
  19. package/dist/src/ox-task-tooltip.js.map +1 -0
  20. package/dist/src/types.d.ts +10 -3
  21. package/dist/src/types.js.map +1 -1
  22. package/dist/stories/ox-gantt.stories.js +91 -85
  23. package/dist/stories/ox-gantt.stories.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +3 -2
  26. package/src/gantt-chart-controller.ts +470 -0
  27. package/src/locales.ts +78 -0
  28. package/src/ox-gantt-chart.ts +141 -487
  29. package/src/ox-gantt-resize-splitter.ts +18 -25
  30. package/src/ox-gantt.ts +151 -29
  31. package/src/ox-task-tooltip.ts +120 -0
  32. package/src/types.ts +11 -3
  33. package/stories/ox-gantt.stories.ts +93 -85
  34. package/translations/en.json +11 -1
  35. package/translations/ja.json +11 -1
  36. package/translations/ko.json +11 -1
  37. package/translations/ms.json +11 -1
  38. package/translations/zh.json +11 -1
  39. package/dist/src/locale.d.ts +0 -1
  40. package/dist/src/locale.js +0 -49
  41. package/dist/src/locale.js.map +0 -1
  42. package/src/locale.ts +0 -51
@@ -1 +1 @@
1
- {"version":3,"file":"ox-gantt.js","sourceRoot":"","sources":["../../src/ox-gantt.ts"],"names":[],"mappings":";AAAA,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,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,qBAAqB,CAAA;AAC5B,OAAO,+BAA+B,CAAA;AAK/B,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QAuEsB,UAAK,GAAW,EAAE,CAAA;QAE7C,aAAQ,GAAW,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,4BAA4B;QAEpH,WAAM,GAAW,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,sBAAsB;QACjD,oBAAe,GAAY,KAAK,CAAA;QAQrF,gBAAW,GAAW,CAAC,CAAA;IAkFjC,CAAC;aArKQ,WAAM,GAAG;QACd,iBAAiB;QACjB,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA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iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;IACjE,CAAC;IAED,WAAW,CAAC,CAAc;QACxB,IAAI,CAAC,WAAW,GAAK,CAAC,CAAC,MAAsB,EAAE,sBAAsC,EAAE,WAAW,CAAA;IACpG,CAAC;IAED,UAAU,CAAC,CAAc;QACvB,IAAI,KAAK,GAAG,CAAC,CAAC,MAAM,CAAA;QACpB,IAAI,CAAC,GAAI,CAAC,CAAC,MAAsB,EAAE,sBAAqC,CAAA;QACxE,IAAI,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,IAAI,CAAA;QACnD,CAAC;IACH,CAAC;;AA9F0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sCAAmB;AAE7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;yCACoC;AAEvF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;uCACsC;AAC1B;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;gDAAiC;AAExE;IAApB,KAAK,CAAC,YAAY,CAAC;0CAA2B;AACrB;IAAzB,KAAK,CAAC,iBAAiB,CAAC;8CAA+B;AAC7B;IAA1B,KAAK,CAAC,kBAAkB,CAAC;+CAAgC;AAC1C;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA6B;AACnB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;2CAA0B;AAlFvC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAsKnB","sourcesContent":["import { LitElement, html, css, PropertyValues, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport './ox-gantt-chart.js'\nimport './ox-gantt-resize-splitter.js'\nimport { OxGanttChart } from './ox-gantt-chart.js'\nimport { Task } from './types.js'\n\n@customElement('ox-gantt')\nexport class OxGantt extends LitElement {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n :host {\n display: block;\n font-family: Arial, sans-serif;\n text-wrap: nowrap;\n }\n\n .container {\n display: flex;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n\n .task-container {\n padding: 0;\n overflow: auto;\n overflow-y: overlay;\n box-sizing: border-box;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n }\n\n .chart-container {\n flex: 1;\n padding: 0;\n box-sizing: border-box;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n }\n\n ox-gantt-resize-splitter {\n width: 4px;\n }\n\n table {\n width: 100%;\n border-collapse: collapse;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n margin: -1px;\n margin-right: 0;\n }\n\n thead th {\n position: sticky;\n top: -1px;\n z-index: 1;\n background-color: var(--ox-gantt-header-background-color, var(--md-sys-color-secondary-container));\n }\n\n th,\n td {\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n padding: 4px;\n text-align: left;\n }\n\n th {\n height: 40px;\n box-sizing: border-box;\n }\n\n td {\n height: 30px;\n box-sizing: border-box;\n }\n `\n ]\n\n @property({ type: Array }) tasks: Task[] = []\n @property({ type: String, attribute: 'from-date' })\n fromDate: string = new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */\n @property({ type: String, attribute: 'to-date' })\n toDate: string = new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */\n @property({ type: Boolean, attribute: 'extend-grid-lines' }) extendGridLines: boolean = false\n\n @query('.container') container!: HTMLDivElement\n @query('.task-container') taskContainer!: HTMLDivElement\n @query('.chart-container') chartContainer!: HTMLDivElement\n @query('table') taskTable!: HTMLTableElement\n @query('ox-gantt-chart') ganttChart!: OxGanttChart\n\n private _startWidth: number = 0\n\n render() {\n return html`\n <div class=\"container md-typescale-body-medium\">\n <div class=\"task-container\" @scroll=${this.syncScroll}>${this.renderTaskTable()}</div>\n <ox-gantt-resize-splitter\n vertical\n @splitter-dragstart=${(e: CustomEvent) => this.resizeStart(e)}\n @splitter-drag=${(e: CustomEvent) => this.resizeDrag(e)}\n ></ox-gantt-resize-splitter>\n <ox-gantt-chart\n class=\"chart-container\"\n @scroll=${this.syncScroll}\n .fromDate=${this.fromDate}\n .toDate=${this.toDate}\n .tasks=${this.tasks}\n axis-scale=\"week-day\"\n ?extend-grid-lines=${this.extendGridLines}\n ></ox-gantt-chart>\n </div>\n `\n }\n\n renderTaskTable() {\n return html`\n <table>\n <thead>\n <tr>\n <th>ID</th>\n <th>Section</th>\n <th>Title</th>\n <th>Type</th>\n <th>Start Time</th>\n <th>End Time</th>\n <th>Tags</th>\n <th>Progress</th>\n <th>Prev. Task</th>\n </tr>\n </thead>\n <tbody>\n ${this.tasks.map(\n task => html`\n <tr>\n <td>${task.id}</td>\n <td>${task.section?.name || ''}</td>\n <td>${task.title}</td>\n <td>${task.type}</td>\n <td>${task.startTime.toISOString().split('T')[0]}</td>\n <td>${task.endTime.toISOString().split('T')[0]}</td>\n <td>${task.tags?.join(', ') || ''}</td>\n <td>${task.progress || ''}</td>\n <td>${task.after || ''}</td>\n </tr>\n `\n )}\n </tbody>\n </table>\n `\n }\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.taskContainer.style.width = '254px'\n }\n\n updated(changes: PropertyValues<this>) {}\n\n syncScroll() {\n this.ganttChart.setVerticalOffset(this.taskContainer.scrollTop)\n }\n\n resizeStart(e: CustomEvent) {\n this._startWidth = ((e.target as HTMLElement)?.previousElementSibling as HTMLElement)?.offsetWidth\n }\n\n resizeDrag(e: CustomEvent) {\n var delta = e.detail\n var x = (e.target as HTMLElement)?.previousElementSibling as HTMLElement\n if (x) {\n x.style.width = `${this._startWidth + delta.x}px`\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-gantt.js","sourceRoot":"","sources":["../../src/ox-gantt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAoC,MAAM,KAAK,CAAA;AAC7E,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,qBAAqB,CAAA;AAC5B,OAAO,+BAA+B,CAAA;AAK/B,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QA8EsB,UAAK,GAAW,EAAE,CAAA;QAE7C,aAAQ,GAAW,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,4BAA4B;QAEpH,WAAM,GAAW,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,sBAAsB;QACjD,oBAAe,GAAY,KAAK,CAAA;QAIrF,iBAAY,GAAmB;YACrC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,E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ACb,OAAO,CA+RnB","sourcesContent":["import { LitElement, html, css, PropertyValues, PropertyValueMap } from 'lit'\nimport i18next from 'i18next'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport './ox-gantt-chart.js'\nimport './ox-gantt-resize-splitter.js'\nimport { OxGanttChart } from './ox-gantt-chart.js'\nimport { ColumnConfig, Task } from './types.js'\n\n@customElement('ox-gantt')\nexport class OxGantt extends LitElement {\n static styles = [\n MDTypeScaleStyles,\n ScrollbarStyles,\n css`\n :host {\n display: block;\n font-family: Arial, sans-serif;\n text-wrap: nowrap;\n position: relative;\n }\n\n .container {\n display: flex;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n\n .task-container {\n padding: 0;\n overflow: auto;\n overflow-y: overlay;\n box-sizing: border-box;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n }\n\n .chart-container {\n flex: 1;\n padding: 0;\n box-sizing: border-box;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n }\n\n ox-gantt-resize-splitter {\n width: 4px;\n cursor: ew-resize;\n }\n\n table {\n width: 100%;\n border-collapse: collapse;\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n margin: -1px;\n margin-right: 0;\n }\n\n thead th {\n position: sticky;\n top: -1px;\n z-index: 1;\n background-color: var(--ox-gantt-header-background-color, var(--md-sys-color-secondary-container));\n text-transform: capitalize;\n }\n\n th,\n td {\n border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-on-surface));\n padding: 4px;\n text-align: left;\n }\n\n th {\n height: 40px;\n box-sizing: border-box;\n }\n\n td {\n height: 30px;\n box-sizing: border-box;\n }\n\n tr.selected {\n background-color: var(--ox-gantt-selected-background-color, var(--md-sys-color-surface-variant));\n }\n `\n ]\n\n @property({ type: Array }) tasks: Task[] = []\n @property({ type: String, attribute: 'from-date' })\n fromDate: string = new Date(new Date().getFullYear(), 0, 1).toISOString().split('T')[0] /* beginning of this year */\n @property({ type: String, attribute: 'to-date' })\n toDate: string = new Date(new Date().getFullYear(), 11, 31).toISOString().split('T')[0] /* end of this year */\n @property({ type: Boolean, attribute: 'extend-grid-lines' }) extendGridLines: boolean = false\n\n @state() selectedTaskId?: string\n @state()\n private columnConfig: ColumnConfig[] = [\n { id: 'id', label: i18next.t('label.gantt-task-id') || 'ID', visible: true, width: '50px', order: 1 },\n {\n id: 'section',\n label: i18next.t('label.gantt-task-section') || 'section',\n visible: true,\n width: '100px',\n order: 2\n },\n { id: 'title', label: i18next.t('label.gantt-task-title') || 'title', visible: true, width: '150px', order: 3 },\n { id: 'type', label: i18next.t('label.gantt-task-type') || 'type', visible: true, width: '100px', order: 4 },\n {\n id: 'startDate',\n label: i18next.t('label.gantt-task-start-date') || 'start date',\n visible: true,\n width: '100px',\n order: 5\n },\n {\n id: 'endDate',\n label: i18next.t('label.gantt-task-end-date') || 'end date',\n visible: true,\n width: '100px',\n order: 6\n },\n { id: 'tags', label: i18next.t('label.gantt-task-tags') || 'tags', visible: true, width: '100px', order: 7 },\n {\n id: 'progress',\n label: i18next.t('label.gantt-task-progress') || 'progress',\n visible: true,\n width: '100px',\n order: 8\n },\n {\n id: 'dependsOn',\n label: i18next.t('label.gantt-task-previous') || 'previous',\n visible: true,\n width: '100px',\n order: 9\n }\n ]\n\n @query('.container') container!: HTMLDivElement\n @query('.task-container') taskContainer!: HTMLDivElement\n @query('.chart-container') chartContainer!: HTMLDivElement\n @query('table') taskTable!: HTMLTableElement\n @query('ox-gantt-chart') ganttChart!: OxGanttChart\n\n private _startWidth: number = 0\n private _isDragging: boolean = false\n\n render() {\n return html`\n <div class=\"container md-typescale-body-medium\">\n <div class=\"task-container\" @scroll=${this.syncScroll}>${this.renderTaskTable()}</div>\n <ox-gantt-resize-splitter\n vertical\n @splitter-dragstart=${(e: CustomEvent) => this.resizeStart(e)}\n @splitter-drag=${(e: CustomEvent) => this.resizeDrag(e)}\n @splitter-dragend=${(e: CustomEvent) => this.resizeEnd(e)}\n ></ox-gantt-resize-splitter>\n <ox-gantt-chart\n class=\"chart-container\"\n @scroll=${this.syncScroll}\n .fromDate=${this.fromDate}\n .toDate=${this.toDate}\n .tasks=${this.tasks}\n .selectedTaskId=${this.selectedTaskId}\n axis-scale=\"week-day\"\n ?extend-grid-lines=${this.extendGridLines}\n @task-clicked=${this.handleTaskClicked}\n ></ox-gantt-chart>\n </div>\n `\n }\n\n renderTaskTable() {\n const mergedTasks = this.mergeTasksBySection(this.tasks)\n\n // Sort columns by the configured order\n const sortedColumns = [...this.columnConfig].sort((a, b) => a.order - b.order)\n\n return html`\n <table>\n <thead>\n <tr>\n ${sortedColumns.map(col => (col.visible ? html`<th style=\"width: ${col.width}\">${col.label}</th>` : null))}\n </tr>\n </thead>\n <tbody>\n ${mergedTasks.map(\n ({ task, showSection, rowSpan }) => html`\n <tr class=\"${this.selectedTaskId === task.id ? 'selected' : ''}\" @click=${() => this.selectTask(task.id)}>\n ${sortedColumns.map(col => {\n if (col.id === 'section') {\n return col.visible && showSection\n ? html`<td rowspan=\"${rowSpan}\" style=\"width: ${col.width}\">${task.section?.name || ''}</td>`\n : null\n }\n return col.visible\n ? html`<td style=\"width: ${col.width}\">${this.getTaskFieldValue(task, col.id)}</td>`\n : null\n })}\n </tr>\n `\n )}\n </tbody>\n </table>\n `\n }\n\n getTaskFieldValue(task: Task, field: string) {\n switch (field) {\n case 'id':\n return task.id\n case 'section':\n return task.section?.name || ''\n case 'title':\n return task.title\n case 'type':\n return task.type\n case 'startDate':\n return task.startDate.toISOString().split('T')[0]\n case 'endDate':\n return task.endDate.toISOString().split('T')[0]\n case 'tags':\n return task.tags?.join(', ') || ''\n case 'progress':\n return task.progress || ''\n case 'dependsOn':\n return task.dependsOn || ''\n default:\n return ''\n }\n }\n\n mergeTasksBySection(tasks: Task[]): Array<{ task: Task; showSection: boolean; rowSpan: number }> {\n const mergedTasks = [] as Array<{ task: Task; showSection: boolean; rowSpan: number }>\n let currentSection = ''\n let rowSpan = 0\n\n tasks.forEach((task, index) => {\n if (task.section?.name !== currentSection) {\n currentSection = task.section?.name || ''\n rowSpan = 1\n mergedTasks.push({ task, showSection: true, rowSpan: 1 })\n } else {\n mergedTasks[mergedTasks.length - rowSpan].rowSpan = ++rowSpan\n mergedTasks.push({ task, showSection: false, rowSpan: 0 })\n }\n\n if (index === tasks.length - 1 && rowSpan > 0) {\n mergedTasks[mergedTasks.length - rowSpan].rowSpan = rowSpan\n }\n })\n\n return mergedTasks\n }\n\n selectTask(taskId: string) {\n this.selectedTaskId = taskId\n }\n\n handleTaskClicked(event: CustomEvent) {\n this.selectedTaskId = event.detail.taskId\n }\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.taskContainer.style.width = '254px'\n }\n\n updated(changes: PropertyValues<this>) {}\n\n syncScroll(e: Event) {\n const target = e.target as HTMLElement\n if (target === this.taskContainer) {\n this.ganttChart.setVerticalOffset(this.taskContainer.scrollTop)\n } else if (target === this.ganttChart) {\n this.taskContainer.scrollTop = this.ganttChart.getVerticalOffset()\n }\n }\n\n resizeStart(e: CustomEvent) {\n this._startWidth = ((e.target as HTMLElement)?.previousElementSibling as HTMLElement)?.offsetWidth\n this._isDragging = true\n }\n\n resizeDrag(e: CustomEvent) {\n if (!this._isDragging) return\n const delta = e.detail\n const taskContainer = this.taskContainer\n\n if (taskContainer) {\n taskContainer.style.width = `${this._startWidth + delta.x}px`\n }\n }\n\n resizeEnd(e: CustomEvent) {\n this._isDragging = false\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class OxTaskTooltip extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ title: string;
5
+ startDate: string;
6
+ endDate: string;
7
+ progress: number;
8
+ type: string;
9
+ show(x: number, y: number): void;
10
+ hide(): void;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ }
@@ -0,0 +1,132 @@
1
+ import { __decorate } from "tslib";
2
+ import { LitElement, html, css } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ let OxTaskTooltip = class OxTaskTooltip extends LitElement {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.title = '';
8
+ this.startDate = '';
9
+ this.endDate = '';
10
+ this.progress = 0;
11
+ this.type = '';
12
+ }
13
+ static { this.styles = css `
14
+ :host {
15
+ position: fixed; /* position: absolute로 변경 */
16
+ background-color: var(--ox-gantt-tooltip-background-color, var(--md-sys-color-surface, #f9f9f9));
17
+ border: 1px solid var(--ox-gantt-tooltip-border-color, var(--md-sys-color-outline, #ccc));
18
+ padding: var(--spacing-medium, 10px);
19
+ border-radius: var(--spacing-medium, 8px);
20
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
21
+ visibility: hidden;
22
+ z-index: 10;
23
+ max-width: 300px;
24
+ font-family: Roboto;
25
+ font-size: 14px;
26
+ line-height: 1.6;
27
+ color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
28
+ transition:
29
+ visibility 0.1s,
30
+ opacity 0.1s;
31
+ opacity: 0; /* 초기에는 보이지 않음 */
32
+ }
33
+ :host([visible]) {
34
+ visibility: visible;
35
+ opacity: 1; /* 보일 때는 불투명 */
36
+ }
37
+ .title {
38
+ font-weight: bold;
39
+ font-size: 16px;
40
+ margin-bottom: 8px;
41
+ color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4)); /* 파란색 텍스트 */
42
+ }
43
+ .detail {
44
+ display: grid;
45
+ grid-template-columns: auto auto 1fr;
46
+ gap: 4px;
47
+ align-items: center;
48
+ }
49
+ .label {
50
+ font-weight: bold;
51
+ color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface-variant, #333));
52
+ text-align: right; /* 라벨을 우측 정렬 */
53
+ }
54
+ .colon {
55
+ text-align: center;
56
+ color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
57
+ }
58
+ .value {
59
+ text-align: left; /* 값을 좌측 정렬 */
60
+ color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
61
+ }
62
+ `; }
63
+ show(x, y) {
64
+ const tooltipWidth = this.offsetWidth;
65
+ const tooltipHeight = this.offsetHeight;
66
+ const offsetX = 10;
67
+ const offsetY = 10;
68
+ // 기본 위치 계산
69
+ let left = x + offsetX;
70
+ let top = y + offsetY;
71
+ // 화면 경계 확인 및 조정
72
+ const screenWidth = window.innerWidth;
73
+ const screenHeight = window.innerHeight;
74
+ if (left + tooltipWidth > screenWidth) {
75
+ left = x - tooltipWidth - offsetX;
76
+ }
77
+ if (top + tooltipHeight > screenHeight) {
78
+ top = y - tooltipHeight - offsetY;
79
+ }
80
+ // offsetParent 요소를 기준으로 위치 설정
81
+ if (this.offsetParent) {
82
+ const parentRect = this.offsetParent.getBoundingClientRect();
83
+ this.style.left = `${left - parentRect.left}px`;
84
+ this.style.top = `${top - parentRect.top}px`;
85
+ }
86
+ else {
87
+ this.style.left = `${left}px`;
88
+ this.style.top = `${top}px`;
89
+ const myRect = this.getBoundingClientRect();
90
+ /* 실제 바운드와 설정한 left/top 이 일치하지 않는다면, 부모 어딘가에서 transform 되었다고 판단하고, 보정해줌 */
91
+ if (myRect.left !== left || myRect.top !== top) {
92
+ this.style.left = `${left + (left - myRect.left)}px`;
93
+ this.style.top = `${top + (top - myRect.top)}px`;
94
+ }
95
+ }
96
+ this.setAttribute('visible', '');
97
+ }
98
+ hide() {
99
+ this.removeAttribute('visible');
100
+ }
101
+ render() {
102
+ return html `
103
+ <div class="title">${this.title}</div>
104
+ <div class="detail">
105
+ <span class="label">Type</span><span class="colon">:</span><span class="value">${this.type}</span>
106
+ <span class="label">Start Date</span><span class="colon">:</span><span class="value">${this.startDate}</span>
107
+ <span class="label">End Date</span><span class="colon">:</span><span class="value">${this.endDate}</span>
108
+ <span class="label">Progress</span><span class="colon">:</span><span class="value">${this.progress}%</span>
109
+ </div>
110
+ `;
111
+ }
112
+ };
113
+ __decorate([
114
+ property({ type: String })
115
+ ], OxTaskTooltip.prototype, "title", void 0);
116
+ __decorate([
117
+ property({ type: String })
118
+ ], OxTaskTooltip.prototype, "startDate", void 0);
119
+ __decorate([
120
+ property({ type: String })
121
+ ], OxTaskTooltip.prototype, "endDate", void 0);
122
+ __decorate([
123
+ property({ type: Number })
124
+ ], OxTaskTooltip.prototype, "progress", void 0);
125
+ __decorate([
126
+ property({ type: String })
127
+ ], OxTaskTooltip.prototype, "type", void 0);
128
+ OxTaskTooltip = __decorate([
129
+ customElement('ox-task-tooltip')
130
+ ], OxTaskTooltip);
131
+ export { OxTaskTooltip };
132
+ //# sourceMappingURL=ox-task-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-task-tooltip.js","sourceRoot":"","sources":["../../src/ox-task-tooltip.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAGpD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAoDuB,UAAK,GAAG,EAAE,CAAA;QACV,cAAS,GAAG,EAAE,CAAA;QACd,YAAO,GAAG,EAAE,CAAA;QACZ,aAAQ,GAAG,CAAC,CAAA;QACZ,SAAI,GAAG,EAAE,CAAA;IA2DvC,CAAC;aAlHQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDlB,AAjDY,CAiDZ;IAQD,IAAI,CAAC,CAAS,EAAE,CAAS;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAA;QACrC,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,CAAA;QACvC,MAAM,OAAO,GAAG,EAAE,CAAA;QAClB,MAAM,OAAO,GAAG,EAAE,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AAK,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAA;YAClD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAClC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;2BACY,IAAI,CAAC,KAAK;;yFAEoD,IAAI,CAAC,IAAI;+FACH,IAAI,CAAC,SAAS;6FAChB,IAAI,CAAC,OAAO;6FACZ,IAAI,CAAC,QAAQ;;KAErG,CAAA;IACH,CAAC;;AA9D2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAU;AAxD1B,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAmHzB","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-task-tooltip')\nexport class OxTaskTooltip extends LitElement {\n static styles = css`\n :host {\n position: fixed; /* position: absolute로 변경 */\n background-color: var(--ox-gantt-tooltip-background-color, var(--md-sys-color-surface, #f9f9f9));\n border: 1px solid var(--ox-gantt-tooltip-border-color, var(--md-sys-color-outline, #ccc));\n padding: var(--spacing-medium, 10px);\n border-radius: var(--spacing-medium, 8px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n visibility: hidden;\n z-index: 10;\n max-width: 300px;\n font-family: Roboto;\n font-size: 14px;\n line-height: 1.6;\n color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));\n transition:\n visibility 0.1s,\n opacity 0.1s;\n opacity: 0; /* 초기에는 보이지 않음 */\n }\n :host([visible]) {\n visibility: visible;\n opacity: 1; /* 보일 때는 불투명 */\n }\n .title {\n font-weight: bold;\n font-size: 16px;\n margin-bottom: 8px;\n color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4)); /* 파란색 텍스트 */\n }\n .detail {\n display: grid;\n grid-template-columns: auto auto 1fr;\n gap: 4px;\n align-items: center;\n }\n .label {\n font-weight: bold;\n color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface-variant, #333));\n text-align: right; /* 라벨을 우측 정렬 */\n }\n .colon {\n text-align: center;\n color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));\n }\n .value {\n text-align: left; /* 값을 좌측 정렬 */\n color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));\n }\n `\n\n @property({ type: String }) title = ''\n @property({ type: String }) startDate = ''\n @property({ type: String }) endDate = ''\n @property({ type: Number }) progress = 0\n @property({ type: String }) type = ''\n\n show(x: number, y: number) {\n const tooltipWidth = this.offsetWidth\n const tooltipHeight = this.offsetHeight\n const offsetX = 10\n const offsetY = 10\n\n // 기본 위치 계산\n let left = x + offsetX\n let top = y + offsetY\n\n // 화면 경계 확인 및 조정\n const screenWidth = window.innerWidth\n const screenHeight = window.innerHeight\n\n if (left + tooltipWidth > screenWidth) {\n left = x - tooltipWidth - offsetX\n }\n if (top + tooltipHeight > screenHeight) {\n top = y - tooltipHeight - offsetY\n }\n\n // offsetParent 요소를 기준으로 위치 설정\n if (this.offsetParent) {\n const parentRect = this.offsetParent!.getBoundingClientRect()\n this.style.left = `${left - parentRect.left}px`\n this.style.top = `${top - parentRect.top}px`\n } else {\n this.style.left = `${left}px`\n this.style.top = `${top}px`\n\n const myRect = this.getBoundingClientRect()\n\n /* 실제 바운드와 설정한 left/top 이 일치하지 않는다면, 부모 어딘가에서 transform 되었다고 판단하고, 보정해줌 */\n if (myRect.left !== left || myRect.top !== top) {\n this.style.left = `${left + (left - myRect.left)}px`\n this.style.top = `${top + (top - myRect.top)}px`\n }\n }\n\n this.setAttribute('visible', '')\n }\n\n hide() {\n this.removeAttribute('visible')\n }\n\n render() {\n return html`\n <div class=\"title\">${this.title}</div>\n <div class=\"detail\">\n <span class=\"label\">Type</span><span class=\"colon\">:</span><span class=\"value\">${this.type}</span>\n <span class=\"label\">Start Date</span><span class=\"colon\">:</span><span class=\"value\">${this.startDate}</span>\n <span class=\"label\">End Date</span><span class=\"colon\">:</span><span class=\"value\">${this.endDate}</span>\n <span class=\"label\">Progress</span><span class=\"colon\">:</span><span class=\"value\">${this.progress}%</span>\n </div>\n `\n }\n}\n"]}
@@ -5,10 +5,10 @@ export interface Task {
5
5
  title: string;
6
6
  type: TaskType;
7
7
  section?: Section;
8
- startTime: Date;
9
- endTime: Date;
8
+ startDate: Date;
9
+ endDate: Date;
10
10
  progress?: number;
11
- after?: string;
11
+ dependsOn?: string;
12
12
  length: string;
13
13
  tags?: TaskTag[];
14
14
  children?: Task[];
@@ -16,4 +16,11 @@ export interface Task {
16
16
  export interface Section {
17
17
  name: string;
18
18
  }
19
+ export interface ColumnConfig {
20
+ id: string;
21
+ label: string;
22
+ visible: boolean;
23
+ width: string;
24
+ order: number;
25
+ }
19
26
  export type LEVEL = 'year-quarter' | 'year-month' | 'quarter-week' | 'week-day';
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export type TaskTag = 'done' | 'active' | 'critical' | 'milestone'\nexport type TaskType = 'task' | 'milestone' | 'phase'\n\nexport interface Task {\n id: string\n title: string\n type: TaskType\n section?: Section\n startTime: Date\n endTime: Date\n progress?: number\n after?: string // 이전 태스크의 ID\n length: string // 예: '3d' (3 days)\n tags?: TaskTag[]\n children?: Task[]\n}\n\nexport interface Section {\n name: string\n}\n\nexport type LEVEL = 'year-quarter' | 'year-month' | 'quarter-week' | 'week-day'\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export type TaskTag = 'done' | 'active' | 'critical' | 'milestone'\nexport type TaskType = 'task' | 'milestone' | 'phase'\n\nexport interface Task {\n id: string\n title: string\n type: TaskType\n section?: Section\n startDate: Date\n endDate: Date\n progress?: number\n dependsOn?: string // 이전 태스크의 ID\n length: string // 예: '3d' (3 days)\n tags?: TaskTag[]\n children?: Task[]\n}\n\nexport interface Section {\n name: string\n}\n\nexport interface ColumnConfig {\n id: string\n label: string\n visible: boolean\n width: string\n order: number\n}\n\nexport type LEVEL = 'year-quarter' | 'year-month' | 'quarter-week' | 'week-day'\n"]}
@@ -80,9 +80,15 @@ const Template = ({ theme = 'light', tasks, fromDate, toDate, extendGridLines })
80
80
  >
81
81
  </ox-gantt>
82
82
  `;
83
- const exampleSection = {
83
+ const developmentSection = {
84
84
  name: 'Development'
85
85
  };
86
+ const testSection = {
87
+ name: 'Test'
88
+ };
89
+ const releaseSection = {
90
+ name: 'Release'
91
+ };
86
92
  export const Regular = Template.bind({});
87
93
  Regular.args = {
88
94
  fromDate: '2022-12-27',
@@ -92,11 +98,11 @@ Regular.args = {
92
98
  id: '1',
93
99
  title: 'Design',
94
100
  type: 'task',
95
- section: exampleSection,
96
- startTime: new Date('2023-01-01'),
97
- endTime: new Date('2023-01-05'),
101
+ section: developmentSection,
102
+ startDate: new Date('2023-01-01'),
103
+ endDate: new Date('2023-01-05'),
98
104
  progress: 60,
99
- after: '',
105
+ dependsOn: '',
100
106
  length: '5d',
101
107
  tags: ['active'],
102
108
  children: []
@@ -105,11 +111,11 @@ Regular.args = {
105
111
  id: '2',
106
112
  title: 'Development',
107
113
  type: 'milestone',
108
- section: exampleSection,
109
- startTime: new Date('2023-01-06'),
110
- endTime: new Date('2023-01-06'),
114
+ section: developmentSection,
115
+ startDate: new Date('2023-01-06'),
116
+ endDate: new Date('2023-01-06'),
111
117
  progress: 30,
112
- after: '1',
118
+ dependsOn: '1',
113
119
  length: '1d',
114
120
  tags: ['milestone'],
115
121
  children: []
@@ -118,11 +124,11 @@ Regular.args = {
118
124
  id: '3',
119
125
  title: 'Coding',
120
126
  type: 'phase',
121
- section: exampleSection,
122
- startTime: new Date('2023-01-07'),
123
- endTime: new Date('2023-01-15'),
127
+ section: developmentSection,
128
+ startDate: new Date('2023-01-07'),
129
+ endDate: new Date('2023-01-15'),
124
130
  progress: 10,
125
- after: '2',
131
+ dependsOn: '2',
126
132
  length: '9d',
127
133
  tags: ['critical'],
128
134
  children: [
@@ -130,11 +136,11 @@ Regular.args = {
130
136
  id: '3-1',
131
137
  title: 'Coding-A',
132
138
  type: 'task',
133
- section: exampleSection,
134
- startTime: new Date('2023-01-07'),
135
- endTime: new Date('2023-01-10'),
139
+ section: developmentSection,
140
+ startDate: new Date('2023-01-07'),
141
+ endDate: new Date('2023-01-10'),
136
142
  progress: 60,
137
- after: '',
143
+ dependsOn: '',
138
144
  length: '4d',
139
145
  tags: ['done'],
140
146
  children: []
@@ -143,10 +149,10 @@ Regular.args = {
143
149
  id: '3-2',
144
150
  title: 'Coding-B',
145
151
  type: 'task',
146
- section: exampleSection,
147
- startTime: new Date('2023-01-11'),
148
- endTime: new Date('2023-01-15'),
149
- after: '3-1',
152
+ section: developmentSection,
153
+ startDate: new Date('2023-01-11'),
154
+ endDate: new Date('2023-01-15'),
155
+ dependsOn: '3-1',
150
156
  length: '5d',
151
157
  tags: ['active'],
152
158
  children: []
@@ -157,11 +163,11 @@ Regular.args = {
157
163
  id: '4',
158
164
  title: 'Test',
159
165
  type: 'milestone',
160
- section: exampleSection,
161
- startTime: new Date('2023-01-07'),
162
- endTime: new Date('2023-01-10'),
166
+ section: developmentSection,
167
+ startDate: new Date('2023-01-07'),
168
+ endDate: new Date('2023-01-10'),
163
169
  progress: 100,
164
- after: '1',
170
+ dependsOn: '1',
165
171
  length: '1d',
166
172
  tags: ['done'],
167
173
  children: []
@@ -170,10 +176,10 @@ Regular.args = {
170
176
  id: '5',
171
177
  title: 'Deploy',
172
178
  type: 'milestone',
173
- section: exampleSection,
174
- startTime: new Date('2023-01-15'),
175
- endTime: new Date('2023-01-21'),
176
- after: '4',
179
+ section: developmentSection,
180
+ startDate: new Date('2023-01-15'),
181
+ endDate: new Date('2023-01-21'),
182
+ dependsOn: '4',
177
183
  length: '1d',
178
184
  tags: ['milestone'],
179
185
  children: []
@@ -182,10 +188,10 @@ Regular.args = {
182
188
  id: '6',
183
189
  title: 'Publishing',
184
190
  type: 'milestone',
185
- section: exampleSection,
186
- startTime: new Date('2023-01-11'),
187
- endTime: new Date('2023-01-15'),
188
- after: '5',
191
+ section: developmentSection,
192
+ startDate: new Date('2023-01-11'),
193
+ endDate: new Date('2023-01-15'),
194
+ dependsOn: '5',
189
195
  length: '1d',
190
196
  tags: ['milestone'],
191
197
  children: []
@@ -194,10 +200,10 @@ Regular.args = {
194
200
  id: '7',
195
201
  title: 'Provisioning',
196
202
  type: 'milestone',
197
- section: exampleSection,
198
- startTime: new Date('2023-01-12'),
199
- endTime: new Date('2023-01-15'),
200
- after: '6',
203
+ section: developmentSection,
204
+ startDate: new Date('2023-01-12'),
205
+ endDate: new Date('2023-01-15'),
206
+ dependsOn: '6',
201
207
  length: '1d',
202
208
  tags: ['milestone'],
203
209
  children: []
@@ -206,10 +212,10 @@ Regular.args = {
206
212
  id: '8',
207
213
  title: 'Alpha Test',
208
214
  type: 'milestone',
209
- section: exampleSection,
210
- startTime: new Date('2023-01-15'),
211
- endTime: new Date('2023-01-17'),
212
- after: '7',
215
+ section: testSection,
216
+ startDate: new Date('2023-01-15'),
217
+ endDate: new Date('2023-01-17'),
218
+ dependsOn: '7',
213
219
  length: '1d',
214
220
  tags: ['critical'],
215
221
  children: []
@@ -218,10 +224,10 @@ Regular.args = {
218
224
  id: '9',
219
225
  title: 'Beta Task',
220
226
  type: 'milestone',
221
- section: exampleSection,
222
- startTime: new Date('2023-01-15'),
223
- endTime: new Date('2023-01-18'),
224
- after: '8',
227
+ section: testSection,
228
+ startDate: new Date('2023-01-15'),
229
+ endDate: new Date('2023-01-18'),
230
+ dependsOn: '8',
225
231
  length: '1d',
226
232
  tags: ['active'],
227
233
  children: []
@@ -230,10 +236,10 @@ Regular.args = {
230
236
  id: '10',
231
237
  title: 'Gamma Test',
232
238
  type: 'milestone',
233
- section: exampleSection,
234
- startTime: new Date('2023-01-18'),
235
- endTime: new Date('2023-01-19'),
236
- after: '9',
239
+ section: testSection,
240
+ startDate: new Date('2023-01-18'),
241
+ endDate: new Date('2023-01-19'),
242
+ dependsOn: '9',
237
243
  length: '1d',
238
244
  tags: ['critical'],
239
245
  children: []
@@ -242,10 +248,10 @@ Regular.args = {
242
248
  id: '11',
243
249
  title: 'Zeta Test',
244
250
  type: 'milestone',
245
- section: exampleSection,
246
- startTime: new Date('2023-01-18'),
247
- endTime: new Date('2023-01-22'),
248
- after: '9',
251
+ section: testSection,
252
+ startDate: new Date('2023-01-18'),
253
+ endDate: new Date('2023-01-22'),
254
+ dependsOn: '9',
249
255
  length: '1d',
250
256
  tags: ['milestone'],
251
257
  children: []
@@ -254,10 +260,10 @@ Regular.args = {
254
260
  id: '12',
255
261
  title: 'Release',
256
262
  type: 'milestone',
257
- section: exampleSection,
258
- startTime: new Date('2023-01-18'),
259
- endTime: new Date('2023-01-23'),
260
- after: '9',
263
+ section: releaseSection,
264
+ startDate: new Date('2023-01-18'),
265
+ endDate: new Date('2023-01-23'),
266
+ dependsOn: '9',
261
267
  length: '1d',
262
268
  tags: ['milestone'],
263
269
  children: []
@@ -266,10 +272,10 @@ Regular.args = {
266
272
  id: '13',
267
273
  title: 'Release',
268
274
  type: 'milestone',
269
- section: exampleSection,
270
- startTime: new Date('2023-01-22'),
271
- endTime: new Date('2023-01-27'),
272
- after: '12',
275
+ section: releaseSection,
276
+ startDate: new Date('2023-01-22'),
277
+ endDate: new Date('2023-01-27'),
278
+ dependsOn: '12',
273
279
  length: '1d',
274
280
  tags: ['done'],
275
281
  children: []
@@ -278,10 +284,10 @@ Regular.args = {
278
284
  id: '14',
279
285
  title: 'Release',
280
286
  type: 'milestone',
281
- section: exampleSection,
282
- startTime: new Date('2023-01-27'),
283
- endTime: new Date('2023-01-30'),
284
- after: '13',
287
+ section: releaseSection,
288
+ startDate: new Date('2023-01-27'),
289
+ endDate: new Date('2023-01-30'),
290
+ dependsOn: '13',
285
291
  length: '1d',
286
292
  tags: ['milestone'],
287
293
  children: []
@@ -290,10 +296,10 @@ Regular.args = {
290
296
  id: '15',
291
297
  title: 'Release',
292
298
  type: 'milestone',
293
- section: exampleSection,
294
- startTime: new Date('2023-01-30'),
295
- endTime: new Date('2023-01-31'),
296
- after: '14',
299
+ section: releaseSection,
300
+ startDate: new Date('2023-01-30'),
301
+ endDate: new Date('2023-01-31'),
302
+ dependsOn: '14',
297
303
  length: '1d',
298
304
  tags: ['milestone'],
299
305
  children: []
@@ -302,10 +308,10 @@ Regular.args = {
302
308
  id: '16',
303
309
  title: 'Release',
304
310
  type: 'milestone',
305
- section: exampleSection,
306
- startTime: new Date('2023-01-31'),
307
- endTime: new Date('2023-02-05'),
308
- after: '15',
311
+ section: releaseSection,
312
+ startDate: new Date('2023-01-31'),
313
+ endDate: new Date('2023-02-05'),
314
+ dependsOn: '15',
309
315
  length: '1d',
310
316
  tags: ['active'],
311
317
  children: []
@@ -314,10 +320,10 @@ Regular.args = {
314
320
  id: '17',
315
321
  title: 'Release',
316
322
  type: 'milestone',
317
- section: exampleSection,
318
- startTime: new Date('2023-02-06'),
319
- endTime: new Date('2023-02-07'),
320
- after: '16',
323
+ section: releaseSection,
324
+ startDate: new Date('2023-02-06'),
325
+ endDate: new Date('2023-02-07'),
326
+ dependsOn: '16',
321
327
  length: '1d',
322
328
  tags: ['milestone'],
323
329
  children: []
@@ -326,10 +332,10 @@ Regular.args = {
326
332
  id: '18',
327
333
  title: 'Release',
328
334
  type: 'milestone',
329
- section: exampleSection,
330
- startTime: new Date('2023-02-08'),
331
- endTime: new Date('2023-02-09'),
332
- after: '17',
335
+ section: releaseSection,
336
+ startDate: new Date('2023-02-08'),
337
+ endDate: new Date('2023-02-09'),
338
+ dependsOn: '17',
333
339
  length: '1d',
334
340
  tags: ['critical'],
335
341
  children: []
@@ -338,10 +344,10 @@ Regular.args = {
338
344
  id: '19',
339
345
  title: 'Release',
340
346
  type: 'milestone',
341
- section: exampleSection,
342
- startTime: new Date('2023-02-10'),
343
- endTime: new Date('2023-02-25'),
344
- after: '18',
347
+ section: releaseSection,
348
+ startDate: new Date('2023-02-10'),
349
+ endDate: new Date('2023-02-25'),
350
+ dependsOn: '18',
345
351
  length: '1d',
346
352
  tags: ['milestone'],
347
353
  children: []