@visactor/vtable-gantt 1.5.4 → 1.6.0-alpha.4

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 (59) hide show
  1. package/cjs/Gantt.d.ts +16 -7
  2. package/cjs/Gantt.js +52 -32
  3. package/cjs/Gantt.js.map +1 -1
  4. package/cjs/event/event-manager.js +6 -2
  5. package/cjs/event/event-manager.js.map +1 -1
  6. package/cjs/gantt-helper.js +28 -20
  7. package/cjs/gantt-helper.js.map +1 -1
  8. package/cjs/index.d.ts +1 -1
  9. package/cjs/index.js +1 -1
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/scenegraph/frame-border.js +2 -2
  12. package/cjs/scenegraph/frame-border.js.map +1 -1
  13. package/cjs/scenegraph/grid.js +6 -6
  14. package/cjs/scenegraph/grid.js.map +1 -1
  15. package/cjs/scenegraph/mark-line.js +2 -1
  16. package/cjs/scenegraph/scenegraph.d.ts +1 -0
  17. package/cjs/scenegraph/scenegraph.js +4 -1
  18. package/cjs/scenegraph/scenegraph.js.map +1 -1
  19. package/cjs/scenegraph/scroll-bar.js +1 -2
  20. package/cjs/scenegraph/task-bar.d.ts +1 -0
  21. package/cjs/scenegraph/task-bar.js +11 -8
  22. package/cjs/scenegraph/task-bar.js.map +1 -1
  23. package/cjs/state/gantt-table-sync.js +1 -8
  24. package/cjs/state/gantt-table-sync.js.map +1 -1
  25. package/cjs/state/state-manager.js +5 -6
  26. package/cjs/state/state-manager.js.map +1 -1
  27. package/cjs/ts-types/gantt-engine.d.ts +9 -7
  28. package/cjs/ts-types/gantt-engine.js.map +1 -1
  29. package/dist/vtable-gantt.js +286 -156
  30. package/dist/vtable-gantt.min.js +1 -1
  31. package/es/Gantt.d.ts +16 -7
  32. package/es/Gantt.js +50 -31
  33. package/es/Gantt.js.map +1 -1
  34. package/es/event/event-manager.js +6 -2
  35. package/es/event/event-manager.js.map +1 -1
  36. package/es/gantt-helper.js +28 -20
  37. package/es/gantt-helper.js.map +1 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/index.js.map +1 -1
  41. package/es/scenegraph/frame-border.js +2 -2
  42. package/es/scenegraph/frame-border.js.map +1 -1
  43. package/es/scenegraph/grid.js +6 -6
  44. package/es/scenegraph/grid.js.map +1 -1
  45. package/es/scenegraph/mark-line.js +2 -1
  46. package/es/scenegraph/scenegraph.d.ts +1 -0
  47. package/es/scenegraph/scenegraph.js +5 -0
  48. package/es/scenegraph/scenegraph.js.map +1 -1
  49. package/es/scenegraph/scroll-bar.js +1 -2
  50. package/es/scenegraph/task-bar.d.ts +1 -0
  51. package/es/scenegraph/task-bar.js +4 -2
  52. package/es/scenegraph/task-bar.js.map +1 -1
  53. package/es/state/gantt-table-sync.js +1 -8
  54. package/es/state/gantt-table-sync.js.map +1 -1
  55. package/es/state/state-manager.js +6 -5
  56. package/es/state/state-manager.js.map +1 -1
  57. package/es/ts-types/gantt-engine.d.ts +9 -7
  58. package/es/ts-types/gantt-engine.js.map +1 -1
  59. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/gantt-helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AACrF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,KAAY;IACrD,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;IACrC,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,GAAG,KAAK,CAAC;IACvE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,S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AE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;KAC7F;IAED,OAAO;QACL,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;KACT,CAAC;AACJ,CAAC","file":"gantt-helper.js","sourcesContent":["import { text } from 'stream/consumers';\nimport type { Gantt } from './Gantt';\nimport type { IMarkLine, IScrollStyle, ITimelineDateInfo, ITimelineScale } from './ts-types';\nimport { getWeekNumber } from './tools/util';\n\nconst isNode = typeof window === 'undefined' || typeof window.window === 'undefined';\nexport const DayTimes = 1000 * 60 * 60 * 24;\n/** 通过事件坐标y计算鼠标当前所在所几条任务条上 */\nexport function getTaskIndexByY(y: number, gantt: Gantt) {\n const gridY = y - gantt.headerHeight;\n const taskBarHeight = gantt.stateManager.scroll.verticalBarPos + gridY;\n const taskBarIndex = Math.floor(taskBarHeight / gantt.parsedOptions.rowHeight);\n return taskBarIndex;\n}\n\nexport function generateMarkLine(markLine?: boolean | IMarkLine | IMarkLine[]) {\n if (!markLine) {\n return [];\n }\n if (markLine === true) {\n return [\n {\n date: new Date().toLocaleDateString(),\n style: {\n lineColor: 'red',\n lineWidth: 1\n }\n }\n ];\n } else if (Array.isArray(markLine)) {\n return markLine.map(item => {\n return {\n date: item.date,\n style: {\n lineColor: item.style?.lineColor || 'red',\n lineWidth: item.style?.lineWidth || 1,\n lineDash: item.style?.lineDash\n }\n };\n });\n }\n return [\n {\n date: (markLine as IMarkLine).date,\n style: {\n lineColor: (markLine as IMarkLine).style?.lineColor || 'red',\n lineWidth: (markLine as IMarkLine).style?.lineWidth || 1,\n lineDash: (markLine as IMarkLine).style?.lineDash\n }\n }\n ];\n}\n\nexport function getHorizontalScrollBarSize(scrollStyle?: IScrollStyle): number {\n if (\n scrollStyle?.hoverOn ||\n (scrollStyle?.horizontalVisible && scrollStyle?.horizontalVisible === 'none') ||\n (!scrollStyle?.horizontalVisible && scrollStyle?.visible === 'none')\n ) {\n return 0;\n }\n return scrollStyle?.width ?? 7;\n}\n\nexport function getVerticalScrollBarSize(scrollStyle?: IScrollStyle): number {\n if (\n scrollStyle?.hoverOn ||\n (scrollStyle?.verticalVisible && scrollStyle?.verticalVisible === 'none') ||\n (!scrollStyle?.verticalVisible && scrollStyle?.visible === 'none')\n ) {\n return 0;\n }\n return scrollStyle?.width ?? 7;\n}\n\nexport { isNode };\n\nexport function initOptions(gantt: Gantt) {\n const options = gantt.options;\n gantt.parsedOptions.pixelRatio = options?.pixelRatio ?? 1;\n gantt.parsedOptions.headerRowHeight = options?.headerRowHeight ?? 40;\n gantt.parsedOptions.rowHeight = options?.rowHeight ?? 40;\n gantt.parsedOptions.timelineColWidth = options?.timelineHeader?.colWidth ?? 60;\n gantt.parsedOptions.startDateField = options?.startDateField ?? 'startDate';\n gantt.parsedOptions.endDateField = options?.endDateField ?? 'endDate';\n gantt.parsedOptions.progressField = options?.progressField ?? 'progress';\n gantt.parsedOptions.minDate = options?.minDate ? new Date(options?.minDate) : undefined;\n gantt.parsedOptions.maxDate = options?.maxDate ? new Date(options?.maxDate) : undefined;\n gantt.parsedOptions._minDateTime = gantt.parsedOptions.minDate?.getTime();\n gantt.parsedOptions._maxDateTime = gantt.parsedOptions.maxDate?.getTime();\n gantt.parsedOptions.overscrollBehavior = options?.overscrollBehavior ?? 'auto';\n gantt.parsedOptions.scrollStyle = Object.assign(\n {},\n {\n scrollRailColor: 'rgba(100, 100, 100, 0.2)',\n scrollSliderColor: 'rgba(100, 100, 100, 0.5)',\n scrollSliderCornerRadius: 4,\n width: 10,\n visible: 'always',\n hoverOn: true,\n barToSide: false\n },\n options?.scrollStyle\n );\n gantt.parsedOptions.timelineHeaderHorizontalLineStyle = options?.timelineHeader?.horizontalLine;\n gantt.parsedOptions.timelineHeaderVerticalLineStyle = options?.timelineHeader?.verticalLine;\n gantt.parsedOptions.timelineHeaderBackgroundColor = options?.timelineHeader?.backgroundColor;\n gantt.parsedOptions.timelineHeaderStyles = [];\n for (let i = 0; i < options?.timelineHeader?.scales?.length ?? 0; i++) {\n const style = options?.timelineHeader?.scales[i].style;\n gantt.parsedOptions.timelineHeaderStyles.push(\n Object.assign(\n {\n fontSize: 20,\n fontWeight: 'bold',\n textAlign: 'center',\n textBaseline: 'middle',\n color: '#000',\n backgroundColor: '#fff'\n },\n style\n )\n );\n }\n gantt.parsedOptions.gridStyle = Object.assign(\n {},\n // {\n // backgroundColor: '#fff',\n // vertical: {\n // lineColor: 'red',\n // lineWidth: 1\n // },\n // horizontal: {\n // lineColor: 'blue',\n // lineWidth: 1\n // }\n // },\n options?.gridStyle\n );\n gantt.parsedOptions.taskBarStyle = Object.assign(\n {},\n {\n barColor: 'blue',\n /** 已完成部分任务条的颜色 */\n completedBarColor: 'gray',\n /** 任务条的宽度 */\n width: gantt.parsedOptions.rowHeight,\n /** 任务条的圆角 */\n cornerRadius: 3,\n /** 任务条的边框 */\n borderWidth: 1,\n /** 边框颜色 */\n borderColor: 'red',\n fontFamily: 'Arial',\n fontSize: 14\n },\n options?.taskBar?.barStyle\n );\n gantt.parsedOptions.taskBarLabelText = options?.taskBar?.labelText ?? '';\n gantt.parsedOptions.taskBarMoveable = options?.taskBar?.moveable ?? true;\n gantt.parsedOptions.taskBarResizable = options?.taskBar?.resizable ?? true;\n gantt.parsedOptions.taskBarHoverColor =\n options?.taskBar?.hoverColor === null ? 'rgba(0,0,0,0)' : options?.taskBar?.hoverColor ?? 'rgba(0,0,0,0.1)';\n gantt.parsedOptions.taskBarLabelStyle = {\n fontFamily: options?.taskBar?.labelTextStyle.fontFamily ?? 'Arial',\n fontSize: options?.taskBar?.labelTextStyle.fontSize ?? gantt.parsedOptions.rowHeight,\n color: options?.taskBar?.labelTextStyle.color ?? '#F01',\n textAlign: options?.taskBar?.labelTextStyle.textAlign ?? 'left',\n textBaseline: options?.taskBar?.labelTextStyle.textBaseline ?? 'middle',\n padding: options?.taskBar?.labelTextStyle.padding ?? 0,\n textOverflow: options?.taskBar?.labelTextStyle.textOverflow\n };\n gantt.parsedOptions.taskBarCustomLayout = options?.taskBar?.customLayout;\n\n gantt.parsedOptions.frameStyle = Object.assign(\n {},\n {\n borderColor: 'gray',\n borderLineWidth: [1, 1, 1, 1],\n cornerRadius: 4\n },\n options.frameStyle?.outerFrameStyle\n );\n gantt.parsedOptions.markLine = generateMarkLine(options?.markLine);\n gantt.parsedOptions.resizeLineStyle = {\n lineColor: options.resizeLineStyle?.lineColor ?? 'yellow',\n lineWidth: options.resizeLineStyle?.lineWidth ?? 2\n };\n}\n\nexport function generateTimeLineDate(currentDate: Date, endDate: Date, scale: ITimelineScale) {\n const { unit, step, format } = scale;\n const timelineDates: ITimelineDateInfo[] = [];\n while (currentDate <= endDate) {\n if (unit === 'day') {\n const dateEnd = new Date(currentDate.getTime() + step * 24 * 60 * 60 * 1000);\n const startDate = new Date(currentDate);\n const formattedDate = format?.({ dateIndex: currentDate.getDate(), startDate, endDate: dateEnd });\n const columnTitle = formattedDate || currentDate.getDate().toString();\n const dayCellConfig = {\n days: step,\n startDate,\n endDate: dateEnd,\n title: columnTitle,\n dateIndex: currentDate.getDate()\n };\n timelineDates.push(dayCellConfig);\n currentDate.setDate(currentDate.getDate() + step);\n } else if (unit === 'month') {\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth() + 1;\n const end = new Date(year, month + step - 1, 0);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: month, startDate: start, endDate: end });\n const columnTitle = formattedDate || month.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: month\n };\n\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year, currentDate.getMonth() + step, 1);\n } else if (unit === 'quarter') {\n const year = currentDate.getFullYear();\n const quarter = Math.floor(currentDate.getMonth() / 3 + 1);\n const end = new Date(year, (quarter + step - 1) * 3, 0);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: quarter, startDate: start, endDate: end });\n const columnTitle = formattedDate || quarter.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: quarter\n };\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year, (quarter + step - 1) * 3, 1);\n } else if (unit === 'year') {\n const year = currentDate.getFullYear();\n const end = new Date(year, 11, 31);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: year, startDate: start, endDate: end });\n const columnTitle = formattedDate || year.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: year\n };\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year + step, 0, 1);\n } else if (unit === 'week') {\n const startOfWeekSetting = scale.startOfWeek ?? 'monday';\n let dayOfWeek = currentDate.getDay(); // index从0开始\n if (startOfWeekSetting === 'monday') {\n dayOfWeek = dayOfWeek === 0 ? 6 : dayOfWeek - 1; // Calculate the difference between the current day and the start of the week\n }\n const startOfWeek = new Date(currentDate);\n const endOfWeek = new Date(startOfWeek.getTime() + (6 - dayOfWeek) * 24 * 60 * 60 * 1000); // Calculate the end of the week\n\n if (endOfWeek > endDate) {\n endOfWeek.setDate(endDate.getDate());\n }\n\n // Calculate the week number within the year\n // const startOfYear = new Date(currentDate.getFullYear(), 0, 1);\n // const weekNumber = Math.ceil(((startOfWeek.getTime() - startOfYear.getTime()) / 86400000 + 1) / 7);\n const weekNumber = getWeekNumber(startOfWeek);\n\n const columnTitle =\n format?.({ dateIndex: weekNumber, startDate: startOfWeek, endDate: endOfWeek }) || weekNumber.toString();\n\n const dayCellConfig = {\n days: Math.ceil((endOfWeek.getTime() - startOfWeek.getTime()) / (24 * 60 * 60 * 1000)) + 1,\n startDate: startOfWeek,\n endDate: endOfWeek,\n title: columnTitle,\n dateIndex: weekNumber\n };\n\n timelineDates.push(dayCellConfig);\n\n // Move currentDate to the next week\n currentDate.setDate(currentDate.getDate() + (7 - dayOfWeek));\n }\n }\n return timelineDates;\n}\n\n/**\n * @description: 获取对应样式和容器尺寸下的文字位置\n * @return {*}\n */\nexport function getTextPos(\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n width: number,\n height: number\n) {\n let textX = padding[3] ?? 10;\n if (textAlign === 'right' || textAlign === 'end') {\n textX = width - 0 - (padding[1] ?? 10);\n } else if (textAlign === 'center') {\n textX = 0 + (width - 0 + (padding[3] ?? 10) - (padding[1] ?? 10)) / 2;\n }\n let textY = 0 + (padding[0] ?? 10);\n if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {\n textY = height - 0 - (padding[2] ?? 10);\n } else if (textBaseline === 'middle') {\n textY = 0 + (height - 0 - (padding[0] ?? 10) - (padding[2] ?? 10)) / 2 + (padding[0] ?? 10);\n }\n\n return {\n x: textX,\n y: textY\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/gantt-helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AACrF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,KAAY;IACrD,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;IACrC,MAAM,aAAa,GAAG,KAAK,C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AAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;KACvE;IACD,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;IACnC,IAAI,YAAY,KAAK,QAAQ,IAAI,YAAY,KAAK,YAAY,IAAI,YAAY,KAAK,aAAa,EAAE;QAChG,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;KACzC;SAAM,IAAI,YAAY,KAAK,QAAQ,EAAE;QACpC,KAAK,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;KAC7F;IAED,OAAO;QACL,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;KACT,CAAC;AACJ,CAAC","file":"gantt-helper.js","sourcesContent":["import { text } from 'stream/consumers';\nimport type { Gantt } from './Gantt';\nimport type { IMarkLine, IScrollStyle, ITimelineDateInfo, ITimelineScale } from './ts-types';\nimport { getWeekNumber } from './tools/util';\n\nconst isNode = typeof window === 'undefined' || typeof window.window === 'undefined';\nexport const DayTimes = 1000 * 60 * 60 * 24;\n/** 通过事件坐标y计算鼠标当前所在所几条任务条上 */\nexport function getTaskIndexByY(y: number, gantt: Gantt) {\n const gridY = y - gantt.headerHeight;\n const taskBarHeight = gantt.stateManager.scroll.verticalBarPos + gridY;\n const taskBarIndex = Math.floor(taskBarHeight / gantt.parsedOptions.rowHeight);\n return taskBarIndex;\n}\n\nexport function generateMarkLine(markLine?: boolean | IMarkLine | IMarkLine[]) {\n if (!markLine) {\n return [];\n }\n if (markLine === true) {\n return [\n {\n date: new Date().toLocaleDateString(),\n style: {\n lineColor: 'red',\n lineWidth: 1\n }\n }\n ];\n } else if (Array.isArray(markLine)) {\n return markLine.map(item => {\n return {\n date: item.date,\n style: {\n lineColor: item.style?.lineColor || 'red',\n lineWidth: item.style?.lineWidth || 1,\n lineDash: item.style?.lineDash\n }\n };\n });\n }\n return [\n {\n date: (markLine as IMarkLine).date,\n style: {\n lineColor: (markLine as IMarkLine).style?.lineColor || 'red',\n lineWidth: (markLine as IMarkLine).style?.lineWidth || 1,\n lineDash: (markLine as IMarkLine).style?.lineDash\n }\n }\n ];\n}\n\nexport function getHorizontalScrollBarSize(scrollStyle?: IScrollStyle): number {\n if (\n scrollStyle?.hoverOn ||\n (scrollStyle?.horizontalVisible && scrollStyle?.horizontalVisible === 'none') ||\n (!scrollStyle?.horizontalVisible && scrollStyle?.visible === 'none')\n ) {\n return 0;\n }\n return scrollStyle?.width ?? 7;\n}\n\nexport function getVerticalScrollBarSize(scrollStyle?: IScrollStyle): number {\n if (\n scrollStyle?.hoverOn ||\n (scrollStyle?.verticalVisible && scrollStyle?.verticalVisible === 'none') ||\n (!scrollStyle?.verticalVisible && scrollStyle?.visible === 'none')\n ) {\n return 0;\n }\n return scrollStyle?.width ?? 7;\n}\n\nexport { isNode };\n\nexport function initOptions(gantt: Gantt) {\n const options = gantt.options;\n gantt.parsedOptions.pixelRatio = options?.pixelRatio ?? 1;\n gantt.parsedOptions.headerRowHeight = options?.headerRowHeight ?? 40;\n gantt.parsedOptions.rowHeight = options?.rowHeight ?? 40;\n gantt.parsedOptions.timelineColWidth = options?.timelineHeader?.colWidth ?? 60;\n gantt.parsedOptions.startDateField = options?.startDateField ?? 'startDate';\n gantt.parsedOptions.endDateField = options?.endDateField ?? 'endDate';\n gantt.parsedOptions.progressField = options?.progressField ?? 'progress';\n gantt.parsedOptions.minDate = options?.minDate ? new Date(options?.minDate) : undefined;\n gantt.parsedOptions.maxDate = options?.maxDate ? new Date(options?.maxDate) : undefined;\n gantt.parsedOptions._minDateTime = gantt.parsedOptions.minDate?.getTime();\n gantt.parsedOptions._maxDateTime = gantt.parsedOptions.maxDate?.getTime();\n gantt.parsedOptions.overscrollBehavior = options?.overscrollBehavior ?? 'auto';\n gantt.parsedOptions.scrollStyle = Object.assign(\n {},\n {\n scrollRailColor: 'rgba(100, 100, 100, 0.2)',\n scrollSliderColor: 'rgba(100, 100, 100, 0.5)',\n scrollSliderCornerRadius: 4,\n width: 10,\n visible: 'always',\n hoverOn: true,\n barToSide: false\n },\n options?.scrollStyle\n );\n gantt.parsedOptions.timelineHeaderHorizontalLineStyle = options?.timelineHeader?.horizontalLine;\n gantt.parsedOptions.timelineHeaderVerticalLineStyle = options?.timelineHeader?.verticalLine;\n gantt.parsedOptions.timelineHeaderBackgroundColor = options?.timelineHeader?.backgroundColor;\n gantt.parsedOptions.timelineHeaderStyles = [];\n for (let i = 0; i < options?.timelineHeader?.scales?.length ?? 0; i++) {\n const style = options?.timelineHeader?.scales[i].style;\n gantt.parsedOptions.timelineHeaderStyles.push(\n Object.assign(\n {\n fontSize: 20,\n fontWeight: 'bold',\n textAlign: 'center',\n textBaseline: 'middle',\n color: '#000',\n backgroundColor: '#fff'\n },\n style\n )\n );\n }\n gantt.parsedOptions.gridStyle = Object.assign(\n {},\n // {\n // backgroundColor: '#fff',\n // vertical: {\n // lineColor: 'red',\n // lineWidth: 1\n // },\n // horizontal: {\n // lineColor: 'blue',\n // lineWidth: 1\n // }\n // },\n options?.gridStyle\n );\n gantt.parsedOptions.taskBarStyle = Object.assign(\n {},\n {\n barColor: 'blue',\n /** 已完成部分任务条的颜色 */\n completedBarColor: 'gray',\n /** 任务条的宽度 */\n width: gantt.parsedOptions.rowHeight,\n /** 任务条的圆角 */\n cornerRadius: 3,\n /** 任务条的边框 */\n borderWidth: 1,\n /** 边框颜色 */\n borderColor: 'red',\n fontFamily: 'Arial',\n fontSize: 14\n },\n options?.taskBar?.barStyle\n );\n\n gantt.parsedOptions.taskBarHoverStyle = Object.assign(\n {\n barOverLayColor: 'rgba(99, 144, 0, 0.4)'\n },\n options?.taskBar?.hoverBarStyle\n );\n\n gantt.parsedOptions.taskBarSelectionStyle = Object.assign(\n {\n barOverLayColor: 'rgba(99, 144, 0, 0.4)'\n },\n options?.taskBar?.selectionBarStyle\n );\n gantt.parsedOptions.taskBarLabelText = options?.taskBar?.labelText ?? '';\n gantt.parsedOptions.taskBarMoveable = options?.taskBar?.moveable ?? true;\n gantt.parsedOptions.taskBarResizable = options?.taskBar?.resizable ?? true;\n // gantt.parsedOptions.taskBarHoverColor =\n // options?.taskBar?.hoverColor === null ? 'rgba(0,0,0,0)' : options?.taskBar?.hoverColor ?? 'rgba(0,0,0,0.1)';\n gantt.parsedOptions.taskBarLabelStyle = {\n fontFamily: options?.taskBar?.labelTextStyle.fontFamily ?? 'Arial',\n fontSize: options?.taskBar?.labelTextStyle.fontSize ?? gantt.parsedOptions.rowHeight,\n color: options?.taskBar?.labelTextStyle.color ?? '#F01',\n textAlign: options?.taskBar?.labelTextStyle.textAlign ?? 'left',\n textBaseline: options?.taskBar?.labelTextStyle.textBaseline ?? 'middle',\n padding: options?.taskBar?.labelTextStyle.padding ?? [0, 0, 0, 10],\n textOverflow: options?.taskBar?.labelTextStyle.textOverflow\n };\n gantt.parsedOptions.taskBarCustomLayout = options?.taskBar?.customLayout;\n\n gantt.parsedOptions.outerFrameStyle = Object.assign(\n {\n borderColor: 'gray',\n borderLineWidth: 1,\n cornerRadius: 4\n },\n options.frame?.outerFrameStyle\n );\n gantt.parsedOptions.markLine = generateMarkLine(options?.markLine);\n gantt.parsedOptions.verticalSplitLineHighlight = options.frame?.verticalSplitLineHighlight;\n\n gantt.parsedOptions.verticalSplitLine = Object.assign(\n {\n lineColor: gantt.parsedOptions.outerFrameStyle.borderColor,\n lineWidth: gantt.parsedOptions.outerFrameStyle.borderLineWidth\n },\n options.frame?.verticalSplitLine\n );\n gantt.parsedOptions.horizontalSplitLine = options.frame?.horizontalSplitLine;\n gantt.parsedOptions.verticalSplitLineMoveable = options.frame.verticalSplitLineMoveable;\n}\n\nexport function generateTimeLineDate(currentDate: Date, endDate: Date, scale: ITimelineScale) {\n const { unit, step, format } = scale;\n const timelineDates: ITimelineDateInfo[] = [];\n while (currentDate <= endDate) {\n if (unit === 'day') {\n const dateEnd = new Date(currentDate.getTime() + step * 24 * 60 * 60 * 1000);\n const startDate = new Date(currentDate);\n const formattedDate = format?.({ dateIndex: currentDate.getDate(), startDate, endDate: dateEnd });\n const columnTitle = formattedDate || currentDate.getDate().toString();\n const dayCellConfig = {\n days: step,\n startDate,\n endDate: dateEnd,\n title: columnTitle,\n dateIndex: currentDate.getDate()\n };\n timelineDates.push(dayCellConfig);\n currentDate.setDate(currentDate.getDate() + step);\n } else if (unit === 'month') {\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth() + 1;\n const end = new Date(year, month + step - 1, 0);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: month, startDate: start, endDate: end });\n const columnTitle = formattedDate || month.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: month\n };\n\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year, currentDate.getMonth() + step, 1);\n } else if (unit === 'quarter') {\n const year = currentDate.getFullYear();\n const quarter = Math.floor(currentDate.getMonth() / 3 + 1);\n const end = new Date(year, (quarter + step - 1) * 3, 0);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: quarter, startDate: start, endDate: end });\n const columnTitle = formattedDate || quarter.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: quarter\n };\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year, (quarter + step - 1) * 3, 1);\n } else if (unit === 'year') {\n const year = currentDate.getFullYear();\n const end = new Date(year, 11, 31);\n if (end.getTime() > endDate.getTime()) {\n end.setDate(endDate.getDate());\n }\n const start = currentDate;\n const formattedDate = format?.({ dateIndex: year, startDate: start, endDate: end });\n const columnTitle = formattedDate || year.toString();\n const dayCellConfig = {\n days: Math.ceil(Math.abs(end.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)) + 1,\n startDate: start,\n endDate: end,\n title: columnTitle,\n dateIndex: year\n };\n timelineDates.push(dayCellConfig);\n currentDate = new Date(year + step, 0, 1);\n } else if (unit === 'week') {\n const startOfWeekSetting = scale.startOfWeek ?? 'monday';\n let dayOfWeek = currentDate.getDay(); // index从0开始\n if (startOfWeekSetting === 'monday') {\n dayOfWeek = dayOfWeek === 0 ? 6 : dayOfWeek - 1; // Calculate the difference between the current day and the start of the week\n }\n const startOfWeek = new Date(currentDate);\n const endOfWeek = new Date(startOfWeek.getTime() + (6 - dayOfWeek) * 24 * 60 * 60 * 1000); // Calculate the end of the week\n\n if (endOfWeek > endDate) {\n endOfWeek.setDate(endDate.getDate());\n }\n\n // Calculate the week number within the year\n // const startOfYear = new Date(currentDate.getFullYear(), 0, 1);\n // const weekNumber = Math.ceil(((startOfWeek.getTime() - startOfYear.getTime()) / 86400000 + 1) / 7);\n const weekNumber = getWeekNumber(startOfWeek);\n\n const columnTitle =\n format?.({ dateIndex: weekNumber, startDate: startOfWeek, endDate: endOfWeek }) || weekNumber.toString();\n\n const dayCellConfig = {\n days: Math.ceil((endOfWeek.getTime() - startOfWeek.getTime()) / (24 * 60 * 60 * 1000)) + 1,\n startDate: startOfWeek,\n endDate: endOfWeek,\n title: columnTitle,\n dateIndex: weekNumber\n };\n\n timelineDates.push(dayCellConfig);\n\n // Move currentDate to the next week\n currentDate.setDate(currentDate.getDate() + (7 - dayOfWeek));\n }\n }\n return timelineDates;\n}\n\n/**\n * @description: 获取对应样式和容器尺寸下的文字位置\n * @return {*}\n */\nexport function getTextPos(\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n width: number,\n height: number\n) {\n let textX = padding[3] ?? 10;\n if (textAlign === 'right' || textAlign === 'end') {\n textX = width - 0 - (padding[1] ?? 10);\n } else if (textAlign === 'center') {\n textX = 0 + (width - 0 + (padding[3] ?? 10) - (padding[1] ?? 10)) / 2;\n }\n let textY = 0 + (padding[0] ?? 10);\n if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {\n textY = height - 0 - (padding[2] ?? 10);\n } else if (textBaseline === 'middle') {\n textY = 0 + (height - 0 - (padding[0] ?? 10) - (padding[2] ?? 10)) / 2 + (padding[0] ?? 10);\n }\n\n return {\n x: textX,\n y: textY\n };\n}\n"]}
package/es/index.d.ts CHANGED
@@ -3,5 +3,5 @@ import * as TYPES from './ts-types';
3
3
  import type { ColumnDefine, ColumnsDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType } from '@visactor/vtable';
4
4
  import { Gantt } from './Gantt';
5
5
  import * as tools from './tools';
6
- export declare const version = "1.5.4";
6
+ export declare const version = "1.6.0-alpha.4";
7
7
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools };
package/es/index.js CHANGED
@@ -4,7 +4,7 @@ import { Gantt } from "./Gantt";
4
4
 
5
5
  import * as tools from "./tools";
6
6
 
7
- export const version = "1.5.4";
7
+ export const version = "1.6.0-alpha.4";
8
8
 
9
9
  export { TYPES, Gantt, tools };
10
10
  //# sourceMappingURL=index.js.map
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAcpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAI/B,OAAO,EACL,KAAK,EAEL,KAAK,EAYL,KAAK,EACN,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nexport const version = \"1.5.4\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAcpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAIvC,OAAO,EACL,KAAK,EAEL,KAAK,EAYL,KAAK,EACN,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nexport const version = \"1.6.0-alpha.4\";\n/**\n * @namespace VTable\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools\n};\n"]}
@@ -5,7 +5,7 @@ export class FrameBorder {
5
5
  this._scene = scene, this.createFrameBorder();
6
6
  }
7
7
  createFrameBorder() {
8
- const group = this._scene.tableGroup, frameStyle = this._scene._gantt.parsedOptions.frameStyle;
8
+ const group = this._scene.tableGroup, frameStyle = this._scene._gantt.parsedOptions.outerFrameStyle;
9
9
  if (!frameStyle) return;
10
10
  const {cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameStyle, groupAttributes = {}, rectAttributes = {
11
11
  pickable: !1
@@ -24,7 +24,7 @@ export class FrameBorder {
24
24
  }
25
25
  }
26
26
  resize() {
27
- const {cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = this._scene._gantt.parsedOptions.frameStyle;
27
+ const {cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = this._scene._gantt.parsedOptions.outerFrameStyle;
28
28
  this.border.setAttributes({
29
29
  width: this._scene.tableGroup.attribute.width + this.border.attribute.lineWidth,
30
30
  height: this._scene.tableGroup.attribute.height + this.border.attribute.lineWidth
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/frame-border.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO3C,MAAM,OAAO,WAAW;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AAe,GAAG,CAAC,CAAC;YACxC,cAAc,CAAC,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC;YACvC,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEhC,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,eAAe,GAAG,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC;YACzF,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,eAAe,GAAG,CAAC,GAAG,eAAe,GAAG,CAAC,CAAC;YAC3F,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YACtD,UAAU,CAAC,IAAI,GAAG,aAAa,CAAC;YAChC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAC3C,KAAa,CAAC,MAAM,GAAG,UAAU,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;SAC1B;IACH,CAAC;IACD,MAAM;QACJ,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC;QACnH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;YAGxB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;YAC/E,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;SAClF,CAAC,CAAC;IACL,CAAC;CACF","file":"frame-border.js","sourcesContent":["import { VRender } from '@visactor/vtable';\n\nimport { isArray } from '@visactor/vutils';\nimport type { IFrameStyle } from '../ts-types';\nimport type { Gantt } from '../Gantt';\nimport type { Scenegraph } from './scenegraph';\n\nexport class FrameBorder {\n _scene: Scenegraph;\n border: VRender.IRect;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.createFrameBorder();\n }\n createFrameBorder() {\n const justForXYPosition = false;\n const group = this._scene.tableGroup;\n const frameStyle = this._scene._gantt.parsedOptions.frameStyle;\n // const strokeArray = [true, true, true, false];\n if (!frameStyle) {\n return;\n }\n const { cornerRadius, borderColor, borderLineWidth, borderLineDash } = frameStyle;\n\n // const hasShadow = false;\n const groupAttributes: VRender.IGroupGraphicAttribute = {};\n const rectAttributes: VRender.IRectGraphicAttribute = {\n pickable: false\n };\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = borderColor; // getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'butt';\n }\n\n // if (Array.isArray(borderLineWidth)) {\n // (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n // (rectAttributes as any).lineWidth = 1;\n // }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = [0, 10, 10, 0];\n groupAttributes.cornerRadius = [0, 10, 10, 0];\n }\n\n // const borderTop = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[0]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderRight = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[1]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderBottom = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[2]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderLeft = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[3]\n // : (rectAttributes.lineWidth as number) ?? 0;\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = -borderLineWidth / 2; //为了可以绘制完整矩形 且左侧的边框不出现在group中\n rectAttributes.y = borderLineWidth / 2;\n rectAttributes.pickable = false;\n\n rectAttributes.width = group.attribute.width + borderLineWidth / 2 + borderLineWidth / 2;\n rectAttributes.height = group.attribute.height + borderLineWidth / 2 + borderLineWidth / 2;\n const borderRect = VRender.createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.parent.insertAfter(borderRect, group);\n (group as any).border = borderRect;\n this.border = borderRect;\n }\n }\n resize() {\n const { cornerRadius, borderColor, borderLineWidth, borderLineDash } = this._scene._gantt.parsedOptions.frameStyle;\n this.border.setAttributes({\n // x: -borderLineWidth / 2,\n // y: borderLineWidth / 2,\n width: this._scene.tableGroup.attribute.width + this.border.attribute.lineWidth,\n height: this._scene.tableGroup.attribute.height + this.border.attribute.lineWidth\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/frame-border.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO3C,MAAM,OAAO,WAAW;IAGtB,YAAY,KAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IACD,iBAAiB;QACf,MAAM,iBAAiB,GAAG,KAAK,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC;QAEpE,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;QAGlF,MAAM,eAAe,GAAmC,EAAE,CAAC;QAC3D,MAAM,cAAc,GAAkC;YACpD,QAAQ,EAAE,KAAK;SAChB,CAAC;QAGF,IAAI,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M,GAAG,UAAU,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;SAC1B;IACH,CAAC;IACD,MAAM;QACJ,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,GAClE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;YAGxB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;YAC/E,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;SAClF,CAAC,CAAC;IACL,CAAC;CACF","file":"frame-border.js","sourcesContent":["import { VRender } from '@visactor/vtable';\n\nimport { isArray } from '@visactor/vutils';\nimport type { IFrameStyle } from '../ts-types';\nimport type { Gantt } from '../Gantt';\nimport type { Scenegraph } from './scenegraph';\n\nexport class FrameBorder {\n _scene: Scenegraph;\n border: VRender.IRect;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.createFrameBorder();\n }\n createFrameBorder() {\n const justForXYPosition = false;\n const group = this._scene.tableGroup;\n const frameStyle = this._scene._gantt.parsedOptions.outerFrameStyle;\n // const strokeArray = [true, true, true, false];\n if (!frameStyle) {\n return;\n }\n const { cornerRadius, borderColor, borderLineWidth, borderLineDash } = frameStyle;\n\n // const hasShadow = false;\n const groupAttributes: VRender.IGroupGraphicAttribute = {};\n const rectAttributes: VRender.IRectGraphicAttribute = {\n pickable: false\n };\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = borderColor; // getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'butt';\n }\n\n // if (Array.isArray(borderLineWidth)) {\n // (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n // (rectAttributes as any).lineWidth = 1;\n // }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = [0, 10, 10, 0];\n groupAttributes.cornerRadius = [0, 10, 10, 0];\n }\n\n // const borderTop = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[0]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderRight = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[1]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderBottom = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[2]\n // : (rectAttributes.lineWidth as number) ?? 0;\n // const borderLeft = (rectAttributes as any).strokeArrayWidth\n // ? (rectAttributes as any).strokeArrayWidth[3]\n // : (rectAttributes.lineWidth as number) ?? 0;\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = -borderLineWidth / 2; //为了可以绘制完整矩形 且左侧的边框不出现在group中\n rectAttributes.y = borderLineWidth / 2;\n rectAttributes.pickable = false;\n\n rectAttributes.width = group.attribute.width + borderLineWidth / 2 + borderLineWidth / 2;\n rectAttributes.height = group.attribute.height + borderLineWidth / 2 + borderLineWidth / 2;\n const borderRect = VRender.createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.parent.insertAfter(borderRect, group);\n (group as any).border = borderRect;\n this.border = borderRect;\n }\n }\n resize() {\n const { cornerRadius, borderColor, borderLineWidth, borderLineDash } =\n this._scene._gantt.parsedOptions.outerFrameStyle;\n this.border.setAttributes({\n // x: -borderLineWidth / 2,\n // y: borderLineWidth / 2,\n width: this._scene.tableGroup.attribute.width + this.border.attribute.lineWidth,\n height: this._scene.tableGroup.attribute.height + this.border.attribute.lineWidth\n });\n }\n}\n"]}
@@ -2,7 +2,7 @@ import { VRender } from "@visactor/vtable";
2
2
 
3
3
  export class Grid {
4
4
  constructor(scene) {
5
- var _a, _b, _c, _d, _e;
5
+ var _a, _b, _c;
6
6
  this._scene = scene, this.vertical = !!scene._gantt.parsedOptions.gridStyle.verticalLine,
7
7
  this.horizontal = !!scene._gantt.parsedOptions.gridStyle.horizontalLine, this.gridStyle = scene._gantt.parsedOptions.gridStyle,
8
8
  this.scrollLeft = 0, this.scrollTop = 0, this.x = 0, this.y = scene._gantt.getAllHeaderRowsHeight(),
@@ -18,16 +18,16 @@ export class Grid {
18
18
  clip: !0,
19
19
  fill: null === (_a = this.gridStyle) || void 0 === _a ? void 0 : _a.backgroundColor
20
20
  }), this.group.name = "grid-container", scene.tableGroup.addChild(this.group);
21
- const line = VRender.createLine({
21
+ const horizontalSplitLineWidth = null === (_b = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _b ? void 0 : _b.lineWidth, line = VRender.createLine({
22
22
  pickable: !1,
23
- stroke: null === (_b = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _b ? void 0 : _b.lineColor,
24
- lineWidth: null === (_c = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _c ? void 0 : _c.lineWidth,
23
+ stroke: null === (_c = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _c ? void 0 : _c.lineColor,
24
+ lineWidth: horizontalSplitLineWidth,
25
25
  points: [ {
26
26
  x: 0,
27
- y: 1 & (null === (_d = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _d ? void 0 : _d.lineWidth) ? .5 : 0
27
+ y: 1 & horizontalSplitLineWidth ? .5 : 0
28
28
  }, {
29
29
  x: scene._gantt.getAllColsWidth(),
30
- y: 1 & (null === (_e = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle) || void 0 === _e ? void 0 : _e.lineWidth) ? .5 : 0
30
+ y: 1 & horizontalSplitLineWidth ? .5 : 0
31
31
  } ]
32
32
  });
33
33
  this.group.addChild(line), this.createVerticalLines(), this.createHorizontalLines();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,MAAM,OAAO,IAAI;IAsBf,YAAY,KAAiB;;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC;QACpE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,cAAc,CAAC;QACxE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC9F,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAC/E,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC;QAChE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC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AAmB,0CAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvE,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,CAAC,CAAS;;QACZ,MAAA,IAAI,CAAC,iBAAiB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,mBAAmB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,CAAC,CAAS;;QACZ,MAAA,IAAI,CAAC,iBAAiB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7C,MAAA,IAAI,CAAC,mBAAmB,0CAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,MAAM;QACJ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC1G,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACF","file":"grid.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport { TYPES } from '@visactor/vtable';\nimport type { IGridStyle } from '../ts-types';\nimport { str } from '@visactor/vtable/es/tools/helper';\nimport type { Scenegraph } from './scenegraph';\nexport class Grid {\n vertical: boolean;\n horizontal: boolean;\n // verticalLineSpace: number;\n // horizontalLineSpace: number;\n gridStyle: any;\n scrollLeft: number;\n scrollTop: number;\n x: number;\n y: number;\n width: number;\n height: number;\n timelineDates: any;\n colWidthPerDay: number;\n rowHeight: number;\n rowCount: number;\n group: VRender.Group;\n verticalLineGroup: VRender.Group;\n horizontalLineGroup: VRender.Group;\n allGridHeight: number;\n allGridWidth: number;\n _scene: Scenegraph;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.vertical = !!scene._gantt.parsedOptions.gridStyle.verticalLine;\n this.horizontal = !!scene._gantt.parsedOptions.gridStyle.horizontalLine;\n this.gridStyle = scene._gantt.parsedOptions.gridStyle;\n this.scrollLeft = 0;\n this.scrollTop = 0;\n this.x = 0;\n this.y = scene._gantt.getAllHeaderRowsHeight();\n this.width = scene.tableGroup.attribute.width;\n this.height = scene.tableGroup.attribute.height - scene.timelineHeader.group.attribute.height;\n this.timelineDates = scene._gantt.reverseSortedTimelineScales[0].timelineDates;\n this.colWidthPerDay = scene._gantt.parsedOptions.colWidthPerDay;\n this.rowHeight = scene._gantt.parsedOptions.rowHeight;\n this.rowCount = scene._gantt.itemCount;\n this.allGridWidth = scene._gantt.getAllColsWidth();\n this.allGridHeight = scene._gantt.getAllGridHeight();\n this.group = new VRender.Group({\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height,\n clip: true,\n fill: this.gridStyle?.backgroundColor\n });\n this.group.name = 'grid-container';\n scene.tableGroup.addChild(this.group);\n //补充timelineHeader中不好绘制的底部的边线\n const line = VRender.createLine({\n pickable: false,\n stroke: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineColor,\n lineWidth: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth,\n points: [\n { x: 0, y: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth & 1 ? 0.5 : 0 },\n {\n x: scene._gantt.getAllColsWidth(),\n y: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth & 1 ? 0.5 : 0\n }\n ]\n });\n this.group.addChild(line);\n this.createVerticalLines();\n\n this.createHorizontalLines();\n }\n createVerticalLines() {\n if (this.vertical) {\n this.verticalLineGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.verticalLineGroup.name = 'grid-vertical';\n this.group.appendChild(this.verticalLineGroup);\n\n const vLines = [];\n let x = 0;\n if (this.gridStyle?.verticalLine.lineWidth & 1) {\n x = 0.5;\n }\n for (let i = 0; i < this.timelineDates.length - 1; i++) {\n const dateline = this.timelineDates[i];\n x = x + Math.floor(this.colWidthPerDay * dateline.days);\n const line = VRender.createLine({\n pickable: false,\n stroke: this.gridStyle?.verticalLine.lineColor,\n lineWidth: this.gridStyle?.verticalLine.lineWidth,\n points: [\n { x, y: 0 },\n { x, y: this.allGridHeight }\n ]\n });\n vLines.push(line);\n this.verticalLineGroup.appendChild(line);\n }\n }\n }\n createHorizontalLines() {\n if (this.horizontal) {\n this.horizontalLineGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.horizontalLineGroup.name = 'grid-horizontal';\n this.group.appendChild(this.horizontalLineGroup);\n\n const hLines = [];\n let y = 0;\n if (this.gridStyle?.horizontalLine.lineWidth & 1) {\n y += 0.5;\n }\n for (let i = 0; i < this.rowCount - 1; i++) {\n y = y + Math.floor(this.rowHeight);\n const line = VRender.createLine({\n pickable: false,\n stroke: this.gridStyle?.horizontalLine.lineColor,\n lineWidth: this.gridStyle?.horizontalLine.lineWidth,\n points: [\n { x: 0, y },\n { x: this.allGridWidth, y }\n ]\n });\n hLines.push(line);\n this.horizontalLineGroup.appendChild(line);\n }\n }\n }\n /** 重新创建网格线场景树结点 */\n refresh() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttributes({\n width: this.width,\n height: this.height\n });\n this.rowCount = this._scene._gantt.itemCount;\n this.allGridWidth = this._scene._gantt.getAllColsWidth();\n this.allGridHeight = this._scene._gantt.getAllGridHeight();\n this.verticalLineGroup?.parent.removeChild(this.verticalLineGroup);\n this.horizontalLineGroup?.parent.removeChild(this.horizontalLineGroup);\n this.createVerticalLines();\n this.createHorizontalLines();\n }\n setX(x: number) {\n this.verticalLineGroup?.setAttribute('x', x);\n this.horizontalLineGroup?.setAttribute('x', x);\n }\n setY(y: number) {\n this.verticalLineGroup?.setAttribute('y', y);\n this.horizontalLineGroup?.setAttribute('y', y);\n }\n resize() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,MAAM,OAAO,IAAI;IAsBf,YAAY,KAAiB;;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC;QACpE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,cAAc,CAAC;QACxE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QAC9C,IAAI,CAAC,MAAM,G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QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;CACF","file":"grid.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport { TYPES } from '@visactor/vtable';\nimport type { IGridStyle } from '../ts-types';\nimport { str } from '@visactor/vtable/es/tools/helper';\nimport type { Scenegraph } from './scenegraph';\nexport class Grid {\n vertical: boolean;\n horizontal: boolean;\n // verticalLineSpace: number;\n // horizontalLineSpace: number;\n gridStyle: any;\n scrollLeft: number;\n scrollTop: number;\n x: number;\n y: number;\n width: number;\n height: number;\n timelineDates: any;\n colWidthPerDay: number;\n rowHeight: number;\n rowCount: number;\n group: VRender.Group;\n verticalLineGroup: VRender.Group;\n horizontalLineGroup: VRender.Group;\n allGridHeight: number;\n allGridWidth: number;\n _scene: Scenegraph;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n this.vertical = !!scene._gantt.parsedOptions.gridStyle.verticalLine;\n this.horizontal = !!scene._gantt.parsedOptions.gridStyle.horizontalLine;\n this.gridStyle = scene._gantt.parsedOptions.gridStyle;\n this.scrollLeft = 0;\n this.scrollTop = 0;\n this.x = 0;\n this.y = scene._gantt.getAllHeaderRowsHeight();\n this.width = scene.tableGroup.attribute.width;\n this.height = scene.tableGroup.attribute.height - scene.timelineHeader.group.attribute.height;\n this.timelineDates = scene._gantt.reverseSortedTimelineScales[0].timelineDates;\n this.colWidthPerDay = scene._gantt.parsedOptions.colWidthPerDay;\n this.rowHeight = scene._gantt.parsedOptions.rowHeight;\n this.rowCount = scene._gantt.itemCount;\n this.allGridWidth = scene._gantt.getAllColsWidth();\n this.allGridHeight = scene._gantt.getAllGridHeight();\n this.group = new VRender.Group({\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height,\n clip: true,\n fill: this.gridStyle?.backgroundColor\n });\n this.group.name = 'grid-container';\n scene.tableGroup.addChild(this.group);\n //补充timelineHeader中不好绘制的底部的边线\n const horizontalSplitLineWidth = scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth;\n const line = VRender.createLine({\n pickable: false,\n stroke: scene._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineColor,\n lineWidth: horizontalSplitLineWidth,\n points: [\n { x: 0, y: horizontalSplitLineWidth & 1 ? 0.5 : 0 },\n {\n x: scene._gantt.getAllColsWidth(),\n y: horizontalSplitLineWidth & 1 ? 0.5 : 0\n }\n ]\n });\n this.group.addChild(line);\n this.createVerticalLines();\n\n this.createHorizontalLines();\n }\n createVerticalLines() {\n if (this.vertical) {\n this.verticalLineGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.verticalLineGroup.name = 'grid-vertical';\n this.group.appendChild(this.verticalLineGroup);\n\n const vLines = [];\n let x = 0;\n if (this.gridStyle?.verticalLine.lineWidth & 1) {\n x = 0.5;\n }\n for (let i = 0; i < this.timelineDates.length - 1; i++) {\n const dateline = this.timelineDates[i];\n x = x + Math.floor(this.colWidthPerDay * dateline.days);\n const line = VRender.createLine({\n pickable: false,\n stroke: this.gridStyle?.verticalLine.lineColor,\n lineWidth: this.gridStyle?.verticalLine.lineWidth,\n points: [\n { x, y: 0 },\n { x, y: this.allGridHeight }\n ]\n });\n vLines.push(line);\n this.verticalLineGroup.appendChild(line);\n }\n }\n }\n createHorizontalLines() {\n if (this.horizontal) {\n this.horizontalLineGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: this.allGridWidth,\n height: this.allGridHeight\n });\n this.horizontalLineGroup.name = 'grid-horizontal';\n this.group.appendChild(this.horizontalLineGroup);\n\n const hLines = [];\n let y = 0;\n if (this.gridStyle?.horizontalLine.lineWidth & 1) {\n y += 0.5;\n }\n for (let i = 0; i < this.rowCount - 1; i++) {\n y = y + Math.floor(this.rowHeight);\n const line = VRender.createLine({\n pickable: false,\n stroke: this.gridStyle?.horizontalLine.lineColor,\n lineWidth: this.gridStyle?.horizontalLine.lineWidth,\n points: [\n { x: 0, y },\n { x: this.allGridWidth, y }\n ]\n });\n hLines.push(line);\n this.horizontalLineGroup.appendChild(line);\n }\n }\n }\n /** 重新创建网格线场景树结点 */\n refresh() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttributes({\n width: this.width,\n height: this.height\n });\n this.rowCount = this._scene._gantt.itemCount;\n this.allGridWidth = this._scene._gantt.getAllColsWidth();\n this.allGridHeight = this._scene._gantt.getAllGridHeight();\n this.verticalLineGroup?.parent.removeChild(this.verticalLineGroup);\n this.horizontalLineGroup?.parent.removeChild(this.horizontalLineGroup);\n this.createVerticalLines();\n this.createHorizontalLines();\n }\n setX(x: number) {\n this.verticalLineGroup?.setAttribute('x', x);\n this.horizontalLineGroup?.setAttribute('x', x);\n }\n setY(y: number) {\n this.verticalLineGroup?.setAttribute('y', y);\n this.horizontalLineGroup?.setAttribute('y', y);\n }\n resize() {\n this.width = this._scene.tableGroup.attribute.width;\n this.height = this._scene.tableGroup.attribute.height - this._scene.timelineHeader.group.attribute.height;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n}\n"]}
@@ -55,4 +55,5 @@ export class MarkLine {
55
55
  setX(x) {
56
56
  this.markLIneContainer.setAttribute("x", x);
57
57
  }
58
- }
58
+ }
59
+ //# sourceMappingURL=mark-line.js.map
@@ -38,4 +38,5 @@ export declare class Scenegraph {
38
38
  setPixelRatio(pixelRatio: number): void;
39
39
  resize(): void;
40
40
  release(): void;
41
+ getTaskBarNodeByY(y: number): void;
41
42
  }
@@ -16,6 +16,8 @@ import { MarkLine } from "./mark-line";
16
16
 
17
17
  import { FrameBorder } from "./frame-border";
18
18
 
19
+ import { getTaskIndexByY } from "../gantt-helper";
20
+
19
21
  export class Scenegraph {
20
22
  constructor(gantt) {
21
23
  let width, height;
@@ -112,5 +114,8 @@ export class Scenegraph {
112
114
  release() {
113
115
  this.stage.release();
114
116
  }
117
+ getTaskBarNodeByY(y) {
118
+ getTaskIndexByY(y,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,EAAE,CAAC;IAEzB,CAAC;IAOD,IAAI,CAAC,CAAS,EAAE,KAAK,GAAG,KAAK;QAE3B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED,aAAa,CAAC,UAAkB;QAI9B,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,IAAI,CAAC,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF","file":"scenegraph.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport { Grid } from './grid';\nimport type { Gantt } from '../Gantt';\nimport { Env } from '../env';\nimport { ScrollBarComponent } from './scroll-bar';\nimport { bindScrollBarListener } from '../event/scroll';\nimport { TimelineHeader } from './timeline-header';\nimport { TaskBar } from './task-bar';\nimport { MarkLine } from './mark-line';\nimport { FrameBorder } from './frame-border';\n\nexport class Scenegraph {\n dateStepWidth: number;\n rowHeight: number;\n _scales: {}[];\n timelineHeader: TimelineHeader;\n grid: Grid;\n taskBar: TaskBar;\n _gantt: Gantt;\n tableGroup: VRender.Group;\n scrollbarComponent: ScrollBarComponent;\n markLine: MarkLine;\n frameBorder: FrameBorder;\n stage: VRender.Stage;\n tableGroupWidth: number;\n tableGroupHeight: number;\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n // VRender.vglobal.setEnv('node', gantt.options.modeParams);\n // width = table.canvasWidth;\n // height = table.canvasHeight;\n } else {\n VRender.vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage = VRender.createStage({\n canvas: gantt.canvas,\n width,\n height,\n disableDirtyBounds: false,\n // background: gantt.theme.underlayBackgroundColor,\n // dpr: gantt.internalProps.pixelRatio,\n enableLayout: true,\n autoRender: false\n // afterRender: () => {\n // this._gantt.fireListeners('after_render', null);\n // }\n });\n\n this.stage.defaultLayer.setTheme({\n group: {\n boundsPadding: 0,\n strokeBoundsBuffer: 0,\n lineJoin: 'round'\n },\n text: {\n ignoreBuf: true\n }\n });\n this.initSceneGraph();\n }\n\n initSceneGraph() {\n const scene = this;\n\n scene.tableGroup = new VRender.Group({\n x: 0,\n y: scene._gantt.tableY,\n width: this.tableGroupWidth,\n height: this.tableGroupHeight,\n clip: true,\n pickable: false\n });\n scene.stage.defaultLayer.add(scene.tableGroup);\n scene.tableGroup.name = 'table';\n // 初始化顶部时间线表头部分\n scene.timelineHeader = new TimelineHeader(scene);\n\n // 初始化网格线组件\n scene.grid = new Grid(scene);\n\n // 初始化任务条线组件\n scene.taskBar = new TaskBar(scene);\n\n // 初始化标记线组件\n scene.markLine = new MarkLine(scene);\n\n // 初始化边框\n scene.frameBorder = new FrameBorder(scene);\n\n // 初始化滚动条组件\n scene.scrollbarComponent = new ScrollBarComponent(scene._gantt);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.hScrollBar);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.vScrollBar);\n }\n\n afterCreateSceneGraph() {\n this.scrollbarComponent.updateScrollBar();\n bindScrollBarListener(this._gantt.eventManager);\n }\n\n refreshTaskBars() {\n // this.timelineHeader.refresh();\n // this.grid.refresh();\n this.taskBar.refreshItems();\n // this.markLine.refresh();\n // this.frameBorder.refresh();\n // this.scrollbarComponent.refresh();\n this.updateNextFrame();\n }\n refreshTaskBarsAndGrid() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n // this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refreshItems();\n this.markLine.refresh();\n this.frameBorder.resize();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n updateTableSize() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttributes({\n x: 0,\n y: this._gantt.tableY,\n width: this._gantt.tableNoFrameWidth,\n height: this.tableGroupHeight\n } as any);\n this.grid.resize();\n this.taskBar.resize();\n this.frameBorder.resize();\n }\n\n /**\n * @description: 绘制场景树\n * @param {any} element\n * @param {CellRange} visibleCoord\n * @return {*}\n */\n renderSceneGraph() {\n this.stage.render();\n }\n\n /**\n * @description: 触发下一帧渲染\n * @return {*}\n */\n updateNextFrame() {\n this.stage.renderNextFrame();\n }\n get width(): number {\n return this.tableGroup.attribute?.width ?? 0;\n }\n\n get height(): number {\n return this.tableGroup.attribute?.height ?? 0;\n }\n\n get x(): number {\n return this.tableGroup.attribute?.x ?? 0;\n }\n\n get y(): number {\n return this.tableGroup.attribute?.y ?? 0;\n }\n\n /**\n * @description: 设置表格的x位置,滚动中使用\n * @param {number} x\n * @return {*}\n */\n setX(x: number, isEnd = false) {\n this.timelineHeader.setX(x);\n this.grid.setX(x);\n this.taskBar.setX(x);\n this.markLine.setX(x);\n this.updateNextFrame();\n // this._gantt.scenegraph.proxy.setX(-x, isEnd);\n }\n\n /**\n * @description: 更新表格的y位置,滚动中使用\n * @param {number} y\n * @return {*}\n */\n setY(y: number, isEnd = false) {\n // this._gantt.scenegraph.proxy.setY(-y, isEnd);\n this.grid.setY(y);\n this.taskBar.setY(y);\n this.updateNextFrame();\n }\n\n setPixelRatio(pixelRatio: number) {\n // this.stage.setDpr(pixelRatio);\n // 这里因为本时刻部分节点有更新bounds标记,直接render回导致开启DirtyBounds,无法完整重绘画布;\n // 所以这里先关闭DirtyBounds,等待下一帧再开启\n this.stage.disableDirtyBounds();\n this.stage.window.setDpr(pixelRatio);\n this.stage.render();\n this.stage.enableDirtyBounds();\n }\n\n resize() {\n this.updateTableSize();\n // this.updateBorderSizeAndPosition();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n release() {\n this.stage.release();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/scenegraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,OAAO,UAAU;IAerB,YAAY,KAAY;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAC/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,KAAK,CAAC;QACV,IAAI,MA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'@visactor/vtable';\nimport { Grid } from './grid';\nimport type { Gantt } from '../Gantt';\nimport { Env } from '../env';\nimport { ScrollBarComponent } from './scroll-bar';\nimport { bindScrollBarListener } from '../event/scroll';\nimport { TimelineHeader } from './timeline-header';\nimport { TaskBar } from './task-bar';\nimport { MarkLine } from './mark-line';\nimport { FrameBorder } from './frame-border';\nimport { getTaskIndexByY } from '../gantt-helper';\n\nexport class Scenegraph {\n dateStepWidth: number;\n rowHeight: number;\n _scales: {}[];\n timelineHeader: TimelineHeader;\n grid: Grid;\n taskBar: TaskBar;\n _gantt: Gantt;\n tableGroup: VRender.Group;\n scrollbarComponent: ScrollBarComponent;\n markLine: MarkLine;\n frameBorder: FrameBorder;\n stage: VRender.Stage;\n tableGroupWidth: number;\n tableGroupHeight: number;\n constructor(gantt: Gantt) {\n this._gantt = gantt;\n this.tableGroupWidth = gantt.tableNoFrameWidth;\n this.tableGroupHeight = Math.min(gantt.tableNoFrameHeight, gantt.drawHeight);\n let width;\n let height;\n if (Env.mode === 'node') {\n // VRender.vglobal.setEnv('node', gantt.options.modeParams);\n // width = table.canvasWidth;\n // height = table.canvasHeight;\n } else {\n VRender.vglobal.setEnv('browser');\n width = gantt.canvas.width;\n height = gantt.canvas.height;\n }\n this.stage = VRender.createStage({\n canvas: gantt.canvas,\n width,\n height,\n disableDirtyBounds: false,\n // background: gantt.theme.underlayBackgroundColor,\n // dpr: gantt.internalProps.pixelRatio,\n enableLayout: true,\n autoRender: false\n // afterRender: () => {\n // this._gantt.fireListeners('after_render', null);\n // }\n });\n\n this.stage.defaultLayer.setTheme({\n group: {\n boundsPadding: 0,\n strokeBoundsBuffer: 0,\n lineJoin: 'round'\n },\n text: {\n ignoreBuf: true\n }\n });\n this.initSceneGraph();\n }\n\n initSceneGraph() {\n const scene = this;\n\n scene.tableGroup = new VRender.Group({\n x: 0,\n y: scene._gantt.tableY,\n width: this.tableGroupWidth,\n height: this.tableGroupHeight,\n clip: true,\n pickable: false\n });\n scene.stage.defaultLayer.add(scene.tableGroup);\n scene.tableGroup.name = 'table';\n // 初始化顶部时间线表头部分\n scene.timelineHeader = new TimelineHeader(scene);\n\n // 初始化网格线组件\n scene.grid = new Grid(scene);\n\n // 初始化任务条线组件\n scene.taskBar = new TaskBar(scene);\n\n // 初始化标记线组件\n scene.markLine = new MarkLine(scene);\n\n // 初始化边框\n scene.frameBorder = new FrameBorder(scene);\n\n // 初始化滚动条组件\n scene.scrollbarComponent = new ScrollBarComponent(scene._gantt);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.hScrollBar);\n scene.stage.defaultLayer.addChild(scene.scrollbarComponent.vScrollBar);\n }\n\n afterCreateSceneGraph() {\n this.scrollbarComponent.updateScrollBar();\n bindScrollBarListener(this._gantt.eventManager);\n }\n\n refreshTaskBars() {\n // this.timelineHeader.refresh();\n // this.grid.refresh();\n this.taskBar.refreshItems();\n // this.markLine.refresh();\n // this.frameBorder.refresh();\n // this.scrollbarComponent.refresh();\n this.updateNextFrame();\n }\n refreshTaskBarsAndGrid() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttribute('height', this.tableGroupHeight);\n // this.timelineHeader.refresh();\n this.grid.refresh();\n this.taskBar.refreshItems();\n this.markLine.refresh();\n this.frameBorder.resize();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n\n updateTableSize() {\n this.tableGroupHeight = Math.min(this._gantt.tableNoFrameHeight, this._gantt.drawHeight);\n this.tableGroup.setAttributes({\n x: 0,\n y: this._gantt.tableY,\n width: this._gantt.tableNoFrameWidth,\n height: this.tableGroupHeight\n } as any);\n this.grid.resize();\n this.taskBar.resize();\n this.frameBorder.resize();\n }\n\n /**\n * @description: 绘制场景树\n * @param {any} element\n * @param {CellRange} visibleCoord\n * @return {*}\n */\n renderSceneGraph() {\n this.stage.render();\n }\n\n /**\n * @description: 触发下一帧渲染\n * @return {*}\n */\n updateNextFrame() {\n this.stage.renderNextFrame();\n }\n get width(): number {\n return this.tableGroup.attribute?.width ?? 0;\n }\n\n get height(): number {\n return this.tableGroup.attribute?.height ?? 0;\n }\n\n get x(): number {\n return this.tableGroup.attribute?.x ?? 0;\n }\n\n get y(): number {\n return this.tableGroup.attribute?.y ?? 0;\n }\n\n /**\n * @description: 设置表格的x位置,滚动中使用\n * @param {number} x\n * @return {*}\n */\n setX(x: number, isEnd = false) {\n this.timelineHeader.setX(x);\n this.grid.setX(x);\n this.taskBar.setX(x);\n this.markLine.setX(x);\n this.updateNextFrame();\n // this._gantt.scenegraph.proxy.setX(-x, isEnd);\n }\n\n /**\n * @description: 更新表格的y位置,滚动中使用\n * @param {number} y\n * @return {*}\n */\n setY(y: number, isEnd = false) {\n // this._gantt.scenegraph.proxy.setY(-y, isEnd);\n this.grid.setY(y);\n this.taskBar.setY(y);\n this.updateNextFrame();\n }\n\n setPixelRatio(pixelRatio: number) {\n // this.stage.setDpr(pixelRatio);\n // 这里因为本时刻部分节点有更新bounds标记,直接render回导致开启DirtyBounds,无法完整重绘画布;\n // 所以这里先关闭DirtyBounds,等待下一帧再开启\n this.stage.disableDirtyBounds();\n this.stage.window.setDpr(pixelRatio);\n this.stage.render();\n this.stage.enableDirtyBounds();\n }\n\n resize() {\n this.updateTableSize();\n // this.updateBorderSizeAndPosition();\n this.scrollbarComponent.updateScrollBar();\n this.updateNextFrame();\n }\n release() {\n this.stage.release();\n }\n getTaskBarNodeByY(y: number) {\n const taskIndex = getTaskIndexByY(y, this._gantt);\n }\n}\n"]}
@@ -140,5 +140,4 @@ export class ScrollBarComponent {
140
140
  });
141
141
  this._gantt.stateManager.setScrollLeft(oldHorizontalBarPos), this._gantt.stateManager.setScrollTop(oldVerticalBarPos);
142
142
  }
143
- }
144
- //# sourceMappingURL=scroll-bar.js.map
143
+ }
@@ -1,6 +1,7 @@
1
1
  import { VRender } from '@visactor/vtable';
2
2
  import type { Scenegraph } from './scenegraph';
3
3
  import { GanttTaskBarNode } from './ganttNode';
4
+ export declare const TASKBAR_HOVER_ICON_WIDTH = 10;
4
5
  export declare class TaskBar {
5
6
  group: VRender.Group;
6
7
  barContainer: VRender.Group;
@@ -10,6 +10,8 @@ import { GanttTaskBarNode } from "./ganttNode";
10
10
 
11
11
  const TASKBAR_HOVER_ICON = '<svg width="100" height="200" xmlns="http://www.w3.org/2000/svg">\n <line x1="30" y1="10" x2="30" y2="190" stroke="black" stroke-width="4"/>\n <line x1="70" y1="10" x2="70" y2="190" stroke="black" stroke-width="4"/>\n</svg>';
12
12
 
13
+ export const TASKBAR_HOVER_ICON_WIDTH = 10;
14
+
13
15
  export class TaskBar {
14
16
  constructor(scene) {
15
17
  this._scene = scene, this.width = scene._gantt.tableNoFrameWidth, this.height = scene._gantt.gridHeight,
@@ -101,7 +103,7 @@ export class TaskBar {
101
103
  fill: color,
102
104
  fontFamily: fontFamily,
103
105
  text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText, taskRecord),
104
- maxLineWidth: taskBarSize - 20,
106
+ maxLineWidth: taskBarSize - 10,
105
107
  textBaseline: textBaseline,
106
108
  textAlign: textAlign,
107
109
  ellipsis: "clip" === textOverflow ? "" : "ellipsis" === textOverflow ? "..." : isValid(textOverflow) ? textOverflow : void 0
@@ -129,7 +131,7 @@ export class TaskBar {
129
131
  cursor: this._scene._gantt.parsedOptions.taskBarMoveable ? "grab" : "default",
130
132
  pickable: !1,
131
133
  cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,
132
- fill: this._scene._gantt.parsedOptions.taskBarHoverColor,
134
+ fill: this._scene._gantt.parsedOptions.taskBarHoverStyle.barOverLayColor,
133
135
  visibleAll: !1
134
136
  });
135
137
  if (this.hoverBarGroup = hoverBarGroup, hoverBarGroup.name = "task-bar-hover-shadow",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/task-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,m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AC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;SACpF;IACH,CAAC;IACD,YAAY;QACV,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;CACF","file":"task-bar.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport type { Scenegraph } from './scenegraph';\n// import { Icon } from './icon';\nimport { parseStringTemplate, toBoxArray } from '../tools/util';\nimport { isValid } from '@visactor/vutils';\nimport { getTextPos } from '../gantt-helper';\nimport { GanttTaskBarNode } from './ganttNode';\n\nconst TASKBAR_HOVER_ICON = `<svg width=\"100\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"30\" y1=\"10\" x2=\"30\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n <line x1=\"70\" y1=\"10\" x2=\"70\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n</svg>`;\n\nexport class TaskBar {\n group: VRender.Group;\n barContainer: VRender.Group;\n hoverBarGroup: VRender.Group;\n hoverBarLeftIcon: VRender.Image;\n hoverBarRightIcon: VRender.Image;\n _scene: Scenegraph;\n width: number;\n height: number;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n // const height = Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight);\n this.width = scene._gantt.tableNoFrameWidth;\n this.height = scene._gantt.gridHeight;\n this.group = new VRender.Group({\n x: 0,\n y: scene._gantt.getAllHeaderRowsHeight(),\n width: this.width,\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.name = 'task-bar-container';\n scene.tableGroup.addChild(this.group);\n this.initBars();\n this.initHoverBarIcons();\n }\n\n initBars() {\n this.barContainer = new VRender.Group({\n x: 0,\n y: 0,\n width: this._scene._gantt.getAllColsWidth(),\n height: this._scene._gantt.getAllGridHeight(),\n pickable: false,\n clip: true\n });\n this.group.appendChild(this.barContainer);\n\n for (let i = 0; i < this._scene._gantt.itemCount; i++) {\n const barGroup = this.initBar(i);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n }\n initBar(index: number) {\n const taskBarCustomLayout = this._scene._gantt.parsedOptions.taskBarCustomLayout;\n const { startDate, endDate, taskDays, progress, taskRecord } = this._scene._gantt.getTaskInfoByTaskListIndex(index);\n if (taskDays <= 0) {\n return null;\n }\n const taskBarSize = this._scene._gantt.parsedOptions.colWidthPerDay * taskDays;\n const taskbarHeight = this._scene._gantt.parsedOptions.taskBarStyle.width;\n const minDate = new Date(this._scene._gantt.parsedOptions.minDate);\n const barGroup = new GanttTaskBarNode({\n x:\n this._scene._gantt.parsedOptions.colWidthPerDay *\n Math.ceil(Math.abs(startDate.getTime() - minDate.getTime()) / (1000 * 60 * 60 * 24)),\n // y: this._scene._gantt.parsedOptions.rowHeight * i,\n y:\n this._scene._gantt.parsedOptions.rowHeight * index +\n (this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: taskBarSize,\n // height: this._scene._gantt.parsedOptions.rowHeight,\n height: taskbarHeight,\n cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,\n clip: true\n });\n barGroup.name = 'task-bar';\n // this.barContainer.appendChild(barGroup);\n let rootContainer;\n let renderDefaultBar = true;\n let renderDefaultText = true;\n\n if (taskBarCustomLayout) {\n let customLayoutObj;\n if (typeof taskBarCustomLayout === 'function') {\n const arg = {\n width: taskBarSize,\n height: taskbarHeight,\n index,\n startDate,\n endDate,\n taskDays,\n progress,\n taskRecord,\n ganttInstance: this._scene._gantt\n };\n customLayoutObj = taskBarCustomLayout(arg);\n } else {\n customLayoutObj = taskBarCustomLayout;\n }\n if (customLayoutObj) {\n // if (customLayoutObj.rootContainer) {\n // customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n // }\n rootContainer = customLayoutObj.rootContainer;\n renderDefaultBar = customLayoutObj.renderDefaultBar ?? false;\n renderDefaultText = customLayoutObj.renderDefaultText ?? false;\n rootContainer.name = 'task-bar-custom-render';\n }\n }\n\n if (renderDefaultBar) {\n // 创建整个任务条rect\n const rect = VRender.createRect({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: taskBarSize,\n height: taskbarHeight,\n fill: this._scene._gantt.parsedOptions.taskBarStyle.barColor,\n pickable: false\n });\n rect.name = 'task-bar-rect';\n barGroup.appendChild(rect);\n barGroup.barRect = rect;\n // 创建已完成部分任务条rect\n const progress_rect = VRender.createRect({\n x: 0,\n y: 0, //(this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: (taskBarSize * progress) / 100,\n height: taskbarHeight,\n fill: this._scene._gantt.parsedOptions.taskBarStyle.completedBarColor,\n pickable: false\n });\n progress_rect.name = 'task-bar-progress-rect';\n barGroup.appendChild(progress_rect);\n barGroup.progressRect = progress_rect;\n }\n\n rootContainer && barGroup.appendChild(rootContainer);\n if (renderDefaultText) {\n const { textAlign, textBaseline, fontSize, fontFamily, textOverflow, color, padding } =\n this._scene._gantt.parsedOptions.taskBarLabelStyle;\n const position = getTextPos(toBoxArray(padding), textAlign, textBaseline, taskBarSize, taskbarHeight);\n //创建label 文字\n const label = VRender.createText({\n // visible: false,\n pickable: false,\n x: position.x, //extAlign === 'center' ? taskBarSize / 2 : textAlign === 'left' ? 10 : taskBarSize - 10,\n y: position.y, //fontSize / 2,\n fontSize: fontSize, // 10\n fill: color,\n fontFamily: fontFamily,\n text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText as string, taskRecord),\n maxLineWidth: taskBarSize - 20,\n textBaseline,\n textAlign,\n ellipsis:\n textOverflow === 'clip'\n ? ''\n : textOverflow === 'ellipsis'\n ? '...'\n : isValid(textOverflow)\n ? textOverflow\n : undefined\n // dx: 12 + 4,\n // dy: this._scene._gantt.barLabelStyle.fontSize / 2\n });\n barGroup.appendChild(label);\n barGroup.textLabel = label;\n }\n return barGroup;\n }\n updateTaskBarNode(index: number) {\n const taskbarGroup = this.barContainer.getChildren()?.[index] as GanttTaskBarNode;\n if (taskbarGroup) {\n this.barContainer.removeChild(taskbarGroup);\n const barGroup = this.initBar(index);\n if (barGroup) {\n this.barContainer.insertInto(barGroup, index); //TODO\n }\n }\n }\n initHoverBarIcons() {\n // const target = this._scene._gantt.stateManager.hoverTaskBar.target;\n\n // const barGroup = new VRender.Group({\n // x: target.attribute.x,\n // y: target.attribute.y,\n // width: target.attribute.width,\n // height: target.attribute.height,\n // cornerRadius: target.attribute.cornerRadius,\n // clip: true,\n // cursor: 'grab'\n // });\n const hoverBarGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: 100,\n height: 100,\n clip: true,\n cursor: this._scene._gantt.parsedOptions.taskBarMoveable ? 'grab' : 'default',\n pickable: false,\n cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,\n fill: this._scene._gantt.parsedOptions.taskBarHoverColor,\n visibleAll: false\n });\n this.hoverBarGroup = hoverBarGroup;\n hoverBarGroup.name = 'task-bar-hover-shadow';\n // this.barContainer.appendChild(hoverBarGroup);\n // 创建左侧的icon\n if (this._scene._gantt.parsedOptions.taskBarResizable) {\n const icon = new VRender.Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: 10,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n icon.name = 'task-bar-hover-shadow-left-icon';\n this.hoverBarLeftIcon = icon;\n hoverBarGroup.appendChild(icon);\n\n // 创建右侧的icon\n const rightIcon = new VRender.Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: 10,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n rightIcon.name = 'task-bar-hover-shadow-right-icon';\n this.hoverBarRightIcon = rightIcon;\n hoverBarGroup.appendChild(rightIcon);\n }\n }\n setX(x: number) {\n this.barContainer.setAttribute('x', x);\n }\n setY(y: number) {\n this.barContainer.setAttribute('y', y);\n }\n /** 重新创建任务条节点 */\n refreshItems() {\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttribute('height', this.height);\n this.barContainer.removeAllChild();\n this.group.removeChild(this.barContainer);\n this.initBars();\n }\n resize() {\n this.width = this._scene._gantt.tableNoFrameWidth;\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n\n showHoverBar(x: number, y: number, width: number, height: number, target?: VRender.Group) {\n if (target && target.name === 'task-bar') {\n // this.hoverBarGroup.releatedTaskBar = target;\n target.appendChild(this.hoverBarGroup);\n }\n this.hoverBarGroup.setAttribute('x', 0);\n this.hoverBarGroup.setAttribute('y', 0);\n this.hoverBarGroup.setAttribute('width', width);\n this.hoverBarGroup.setAttribute('height', height);\n this.hoverBarGroup.setAttribute('visibleAll', true);\n if (this.hoverBarLeftIcon) {\n this.hoverBarLeftIcon.setAttribute('x', 0);\n this.hoverBarLeftIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarLeftIcon.setAttribute('width', 10);\n this.hoverBarLeftIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('x', width - 10);\n this.hoverBarRightIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('width', 10);\n this.hoverBarRightIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n }\n }\n hideHoverBar() {\n this.hoverBarGroup.setAttribute('visibleAll', false);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/task-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,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C,CAAC,CAAC;YACjE,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;YACvE,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;SACpF;IACH,CAAC;IACD,YAAY;QACV,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;CACF","file":"task-bar.js","sourcesContent":["import { VRender } from '@visactor/vtable';\nimport type { Scenegraph } from './scenegraph';\n// import { Icon } from './icon';\nimport { parseStringTemplate, toBoxArray } from '../tools/util';\nimport { isValid } from '@visactor/vutils';\nimport { getTextPos } from '../gantt-helper';\nimport { GanttTaskBarNode } from './ganttNode';\n\nconst TASKBAR_HOVER_ICON = `<svg width=\"100\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"30\" y1=\"10\" x2=\"30\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n <line x1=\"70\" y1=\"10\" x2=\"70\" y2=\"190\" stroke=\"black\" stroke-width=\"4\"/>\n</svg>`;\nexport const TASKBAR_HOVER_ICON_WIDTH = 10;\n\nexport class TaskBar {\n group: VRender.Group;\n barContainer: VRender.Group;\n hoverBarGroup: VRender.Group;\n hoverBarLeftIcon: VRender.Image;\n hoverBarRightIcon: VRender.Image;\n _scene: Scenegraph;\n width: number;\n height: number;\n constructor(scene: Scenegraph) {\n this._scene = scene;\n // const height = Math.min(scene._gantt.tableNoFrameHeight, scene._gantt.drawHeight);\n this.width = scene._gantt.tableNoFrameWidth;\n this.height = scene._gantt.gridHeight;\n this.group = new VRender.Group({\n x: 0,\n y: scene._gantt.getAllHeaderRowsHeight(),\n width: this.width,\n height: this.height,\n pickable: false,\n clip: true\n });\n this.group.name = 'task-bar-container';\n scene.tableGroup.addChild(this.group);\n this.initBars();\n this.initHoverBarIcons();\n }\n\n initBars() {\n this.barContainer = new VRender.Group({\n x: 0,\n y: 0,\n width: this._scene._gantt.getAllColsWidth(),\n height: this._scene._gantt.getAllGridHeight(),\n pickable: false,\n clip: true\n });\n this.group.appendChild(this.barContainer);\n\n for (let i = 0; i < this._scene._gantt.itemCount; i++) {\n const barGroup = this.initBar(i);\n if (barGroup) {\n this.barContainer.appendChild(barGroup);\n }\n }\n }\n initBar(index: number) {\n const taskBarCustomLayout = this._scene._gantt.parsedOptions.taskBarCustomLayout;\n const { startDate, endDate, taskDays, progress, taskRecord } = this._scene._gantt.getTaskInfoByTaskListIndex(index);\n if (taskDays <= 0) {\n return null;\n }\n const taskBarSize = this._scene._gantt.parsedOptions.colWidthPerDay * taskDays;\n const taskbarHeight = this._scene._gantt.parsedOptions.taskBarStyle.width;\n const minDate = new Date(this._scene._gantt.parsedOptions.minDate);\n const barGroup = new GanttTaskBarNode({\n x:\n this._scene._gantt.parsedOptions.colWidthPerDay *\n Math.ceil(Math.abs(startDate.getTime() - minDate.getTime()) / (1000 * 60 * 60 * 24)),\n // y: this._scene._gantt.parsedOptions.rowHeight * i,\n y:\n this._scene._gantt.parsedOptions.rowHeight * index +\n (this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: taskBarSize,\n // height: this._scene._gantt.parsedOptions.rowHeight,\n height: taskbarHeight,\n cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,\n clip: true\n });\n barGroup.name = 'task-bar';\n // this.barContainer.appendChild(barGroup);\n let rootContainer;\n let renderDefaultBar = true;\n let renderDefaultText = true;\n\n if (taskBarCustomLayout) {\n let customLayoutObj;\n if (typeof taskBarCustomLayout === 'function') {\n const arg = {\n width: taskBarSize,\n height: taskbarHeight,\n index,\n startDate,\n endDate,\n taskDays,\n progress,\n taskRecord,\n ganttInstance: this._scene._gantt\n };\n customLayoutObj = taskBarCustomLayout(arg);\n } else {\n customLayoutObj = taskBarCustomLayout;\n }\n if (customLayoutObj) {\n // if (customLayoutObj.rootContainer) {\n // customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n // }\n rootContainer = customLayoutObj.rootContainer;\n renderDefaultBar = customLayoutObj.renderDefaultBar ?? false;\n renderDefaultText = customLayoutObj.renderDefaultText ?? false;\n rootContainer.name = 'task-bar-custom-render';\n }\n }\n\n if (renderDefaultBar) {\n // 创建整个任务条rect\n const rect = VRender.createRect({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: taskBarSize,\n height: taskbarHeight,\n fill: this._scene._gantt.parsedOptions.taskBarStyle.barColor,\n pickable: false\n });\n rect.name = 'task-bar-rect';\n barGroup.appendChild(rect);\n barGroup.barRect = rect;\n // 创建已完成部分任务条rect\n const progress_rect = VRender.createRect({\n x: 0,\n y: 0, //(this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: (taskBarSize * progress) / 100,\n height: taskbarHeight,\n fill: this._scene._gantt.parsedOptions.taskBarStyle.completedBarColor,\n pickable: false\n });\n progress_rect.name = 'task-bar-progress-rect';\n barGroup.appendChild(progress_rect);\n barGroup.progressRect = progress_rect;\n }\n\n rootContainer && barGroup.appendChild(rootContainer);\n if (renderDefaultText) {\n const { textAlign, textBaseline, fontSize, fontFamily, textOverflow, color, padding } =\n this._scene._gantt.parsedOptions.taskBarLabelStyle;\n const position = getTextPos(toBoxArray(padding), textAlign, textBaseline, taskBarSize, taskbarHeight);\n //创建label 文字\n const label = VRender.createText({\n // visible: false,\n pickable: false,\n x: position.x, //extAlign === 'center' ? taskBarSize / 2 : textAlign === 'left' ? 10 : taskBarSize - 10,\n y: position.y, //fontSize / 2,\n fontSize: fontSize, // 10\n fill: color,\n fontFamily: fontFamily,\n text: parseStringTemplate(this._scene._gantt.parsedOptions.taskBarLabelText as string, taskRecord),\n maxLineWidth: taskBarSize - TASKBAR_HOVER_ICON_WIDTH,\n textBaseline,\n textAlign,\n ellipsis:\n textOverflow === 'clip'\n ? ''\n : textOverflow === 'ellipsis'\n ? '...'\n : isValid(textOverflow)\n ? textOverflow\n : undefined\n // dx: 12 + 4,\n // dy: this._scene._gantt.barLabelStyle.fontSize / 2\n });\n barGroup.appendChild(label);\n barGroup.textLabel = label;\n }\n return barGroup;\n }\n updateTaskBarNode(index: number) {\n const taskbarGroup = this.barContainer.getChildren()?.[index] as GanttTaskBarNode;\n if (taskbarGroup) {\n this.barContainer.removeChild(taskbarGroup);\n const barGroup = this.initBar(index);\n if (barGroup) {\n this.barContainer.insertInto(barGroup, index); //TODO\n }\n }\n }\n initHoverBarIcons() {\n // const target = this._scene._gantt.stateManager.hoverTaskBar.target;\n\n // const barGroup = new VRender.Group({\n // x: target.attribute.x,\n // y: target.attribute.y,\n // width: target.attribute.width,\n // height: target.attribute.height,\n // cornerRadius: target.attribute.cornerRadius,\n // clip: true,\n // cursor: 'grab'\n // });\n const hoverBarGroup = new VRender.Group({\n x: 0,\n y: 0,\n width: 100,\n height: 100,\n clip: true,\n cursor: this._scene._gantt.parsedOptions.taskBarMoveable ? 'grab' : 'default',\n pickable: false,\n cornerRadius: this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,\n fill: this._scene._gantt.parsedOptions.taskBarHoverStyle.barOverLayColor,\n visibleAll: false\n });\n this.hoverBarGroup = hoverBarGroup;\n hoverBarGroup.name = 'task-bar-hover-shadow';\n // this.barContainer.appendChild(hoverBarGroup);\n // 创建左侧的icon\n if (this._scene._gantt.parsedOptions.taskBarResizable) {\n const icon = new VRender.Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: TASKBAR_HOVER_ICON_WIDTH,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n icon.name = 'task-bar-hover-shadow-left-icon';\n this.hoverBarLeftIcon = icon;\n hoverBarGroup.appendChild(icon);\n\n // 创建右侧的icon\n const rightIcon = new VRender.Image({\n x: 0,\n y: 0, //this._scene._gantt.parsedOptions.rowHeight - taskbarHeight) / 2,\n width: TASKBAR_HOVER_ICON_WIDTH,\n height: 20,\n image: TASKBAR_HOVER_ICON,\n pickable: true,\n cursor: 'col-resize'\n });\n rightIcon.name = 'task-bar-hover-shadow-right-icon';\n this.hoverBarRightIcon = rightIcon;\n hoverBarGroup.appendChild(rightIcon);\n }\n }\n setX(x: number) {\n this.barContainer.setAttribute('x', x);\n }\n setY(y: number) {\n this.barContainer.setAttribute('y', y);\n }\n /** 重新创建任务条节点 */\n refreshItems() {\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttribute('height', this.height);\n this.barContainer.removeAllChild();\n this.group.removeChild(this.barContainer);\n this.initBars();\n }\n resize() {\n this.width = this._scene._gantt.tableNoFrameWidth;\n this.height = this._scene._gantt.gridHeight;\n this.group.setAttribute('width', this.width);\n this.group.setAttribute('height', this.height);\n }\n\n showHoverBar(x: number, y: number, width: number, height: number, target?: VRender.Group) {\n if (target && target.name === 'task-bar') {\n // this.hoverBarGroup.releatedTaskBar = target;\n target.appendChild(this.hoverBarGroup);\n }\n this.hoverBarGroup.setAttribute('x', 0);\n this.hoverBarGroup.setAttribute('y', 0);\n this.hoverBarGroup.setAttribute('width', width);\n this.hoverBarGroup.setAttribute('height', height);\n this.hoverBarGroup.setAttribute('visibleAll', true);\n if (this.hoverBarLeftIcon) {\n this.hoverBarLeftIcon.setAttribute('x', 0);\n this.hoverBarLeftIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarLeftIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarLeftIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('x', width - TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarRightIcon.setAttribute('y', Math.ceil(height / 10));\n this.hoverBarRightIcon.setAttribute('width', TASKBAR_HOVER_ICON_WIDTH);\n this.hoverBarRightIcon.setAttribute('height', height - 2 * Math.ceil(height / 10));\n }\n }\n hideHoverBar() {\n this.hoverBarGroup.setAttribute('visibleAll', false);\n }\n}\n"]}
@@ -13,14 +13,7 @@ export function syncScrollStateFromTable(gantt) {
13
13
  })));
14
14
  }
15
15
 
16
- export function syncResizeStateFromTable(gantt) {
17
- var _a, _b;
18
- gantt.taskListTableInstance && "auto" === (null === (_a = gantt.options.taskListTable) || void 0 === _a ? void 0 : _a.width) && (null === (_b = gantt.taskListTableInstance) || void 0 === _b || _b.on("resize_column", (args => {
19
- gantt.taskTableWidth = gantt.taskListTableInstance.getAllColsWidth() + 2 * gantt.taskListTableInstance.tableX,
20
- gantt.element.style.left = gantt.taskTableWidth ? `${gantt.taskTableWidth}px` : "0px",
21
- gantt._resize();
22
- })));
23
- }
16
+ export function syncResizeStateFromTable(gantt) {}
24
17
 
25
18
  export function syncEditCellFromTable(gantt) {
26
19
  var _a;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state/gantt-table-sync.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,KAAY;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC;IACtC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,qBAAqB,CAAC,YAAY,CAAC,YAAY,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAY;;IACnD,IAAI,KAAK,CAAC,qBAAqB,EAAE;QAC/B,MAAA,KAAK,CAAC,qBAAqB,0CAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAS,EAAE,EAAE;YACtD,IAAI,IAAI,CAAC,eAAe,KAAK,UAAU,EAAE;gBACvC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,qBAAqB,CAAC,YAAY,CAAC;gBAC5D,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;gBAClC,KAAK,CAAC,YAAY,CAAC,YAAY,C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CAAC,MAAM,CAAC,gBAAgB,CAAC;QACxD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;QACrD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAY;;IAClD,MAAA,KAAK,CAAC,qBAAqB,0CAAE,EAAE,CAAC,6BAA6B,EAAE,CAAC,IAAS,EAAE,EAAE;QAC3E,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC5B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;QACxD,KAAK,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACxD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;QACrD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC","file":"gantt-table-sync.js","sourcesContent":["import type { Gantt } from '../Gantt';\n\nexport function syncScrollStateToTable(gantt: Gantt) {\n const { scroll } = gantt.stateManager;\n const { verticalBarPos } = scroll;\n gantt.taskListTableInstance.stateManager.setScrollTop(verticalBarPos, false);\n}\n\nexport function syncScrollStateFromTable(gantt: Gantt) {\n if (gantt.taskListTableInstance) {\n gantt.taskListTableInstance?.on('scroll', (args: any) => {\n if (args.scrollDirection === 'vertical') {\n const { scroll } = gantt.taskListTableInstance.stateManager;\n const { verticalBarPos } = scroll;\n gantt.stateManager.setScrollTop(verticalBarPos, false);\n }\n });\n }\n}\nexport function syncResizeStateFromTable(gantt: Gantt) {\n if (gantt.taskListTableInstance && gantt.options.taskListTable?.width === 'auto') {\n gantt.taskListTableInstance?.on('resize_column', (args: any) => {\n gantt.taskTableWidth = gantt.taskListTableInstance.getAllColsWidth() + gantt.taskListTableInstance.tableX * 2;\n gantt.element.style.left = gantt.taskTableWidth ? `${gantt.taskTableWidth}px` : '0px';\n gantt._resize();\n });\n }\n}\nexport function syncEditCellFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('change_cell_value', (args: any) => {\n const { col, row, rawValue, changedValue } = args;\n gantt.redrawRecord(row - gantt.taskListTableInstance.columnHeaderLevelCount);\n // const record = gantt.getRecordByIndex(row - gantt.listTableInstance.columnHeaderLevelCount);\n // debugger;\n });\n}\n\nexport function syncDragOrderFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('change_header_position', (args: any) => {\n gantt.scenegraph.refreshTaskBars();\n const left = gantt.stateManager.scroll.horizontalBarPos;\n const top = gantt.stateManager.scroll.verticalBarPos;\n gantt.scenegraph.setX(-left);\n gantt.scenegraph.setY(-top);\n });\n}\n\nexport function syncTreeChangeFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('tree_hierarchy_state_change', (args: any) => {\n gantt._syncPropsFromTable();\n gantt.resizeLine.style.height = gantt.drawHeight + 'px'; //'100%';\n gantt.scenegraph.refreshTaskBarsAndGrid();\n const left = gantt.stateManager.scroll.horizontalBarPos;\n const top = gantt.stateManager.scroll.verticalBarPos;\n gantt.scenegraph.setX(-left);\n gantt.scenegraph.setY(-top);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/state/gantt-table-sync.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,KAAY;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC;IACtC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,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KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;QACrD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAY;;IAClD,MAAA,KAAK,CAAC,qBAAqB,0CAAE,EAAE,CAAC,6BAA6B,EAAE,CAAC,IAAS,EAAE,EAAE;QAC3E,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC5B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;QACxD,KAAK,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACxD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;QACrD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC","file":"gantt-table-sync.js","sourcesContent":["import type { Gantt } from '../Gantt';\n\nexport function syncScrollStateToTable(gantt: Gantt) {\n const { scroll } = gantt.stateManager;\n const { verticalBarPos } = scroll;\n gantt.taskListTableInstance.stateManager.setScrollTop(verticalBarPos, false);\n}\n\nexport function syncScrollStateFromTable(gantt: Gantt) {\n if (gantt.taskListTableInstance) {\n gantt.taskListTableInstance?.on('scroll', (args: any) => {\n if (args.scrollDirection === 'vertical') {\n const { scroll } = gantt.taskListTableInstance.stateManager;\n const { verticalBarPos } = scroll;\n gantt.stateManager.setScrollTop(verticalBarPos, false);\n }\n });\n }\n}\nexport function syncResizeStateFromTable(gantt: Gantt) {\n // if (gantt.taskListTableInstance && gantt.options.taskListTable?.width === 'auto') {\n // gantt.taskListTableInstance?.on('resize_column', (args: any) => {\n // gantt.taskTableWidth = gantt.taskListTableInstance.getAllColsWidth() + gantt.taskListTableInstance.tableX * 2;\n // gantt.element.style.left = gantt.taskTableWidth ? `${gantt.taskTableWidth}px` : '0px';\n // gantt._resize();\n // });\n // }\n}\nexport function syncEditCellFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('change_cell_value', (args: any) => {\n const { col, row, rawValue, changedValue } = args;\n gantt.redrawRecord(row - gantt.taskListTableInstance.columnHeaderLevelCount);\n // const record = gantt.getRecordByIndex(row - gantt.listTableInstance.columnHeaderLevelCount);\n // debugger;\n });\n}\n\nexport function syncDragOrderFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('change_header_position', (args: any) => {\n gantt.scenegraph.refreshTaskBars();\n const left = gantt.stateManager.scroll.horizontalBarPos;\n const top = gantt.stateManager.scroll.verticalBarPos;\n gantt.scenegraph.setX(-left);\n gantt.scenegraph.setY(-top);\n });\n}\n\nexport function syncTreeChangeFromTable(gantt: Gantt) {\n gantt.taskListTableInstance?.on('tree_hierarchy_state_change', (args: any) => {\n gantt._syncPropsFromTable();\n gantt.resizeLine.style.height = gantt.drawHeight + 'px'; //'100%';\n gantt.scenegraph.refreshTaskBarsAndGrid();\n const left = gantt.stateManager.scroll.horizontalBarPos;\n const top = gantt.stateManager.scroll.verticalBarPos;\n gantt.scenegraph.setX(-left);\n gantt.scenegraph.setY(-top);\n });\n}\n"]}