@visactor/vtable-gantt 1.5.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.
- package/README.md +151 -0
- package/cjs/Gantt.d.ts +111 -0
- package/cjs/Gantt.js +244 -0
- package/cjs/Gantt.js.map +1 -0
- package/cjs/data/DataSource.d.ts +9 -0
- package/cjs/data/DataSource.js +30 -0
- package/cjs/data/DataSource.js.map +1 -0
- package/cjs/env.d.ts +19 -0
- package/cjs/env.js +48 -0
- package/cjs/env.js.map +1 -0
- package/cjs/event/EventHandler.d.ts +47 -0
- package/cjs/event/EventHandler.js +128 -0
- package/cjs/event/EventHandler.js.map +1 -0
- package/cjs/event/EventTarget.d.ts +12 -0
- package/cjs/event/EventTarget.js +67 -0
- package/cjs/event/EventTarget.js.map +1 -0
- package/cjs/event/event-manager.d.ts +15 -0
- package/cjs/event/event-manager.js +76 -0
- package/cjs/event/event-manager.js.map +1 -0
- package/cjs/event/scroll.d.ts +22 -0
- package/cjs/event/scroll.js +136 -0
- package/cjs/event/scroll.js.map +1 -0
- package/cjs/gantt-helper.d.ts +28 -0
- package/cjs/gantt-helper.js +225 -0
- package/cjs/gantt-helper.js.map +1 -0
- package/cjs/index.d.ts +7 -0
- package/cjs/index.js +48 -0
- package/cjs/index.js.map +1 -0
- package/cjs/register.d.ts +1 -0
- package/cjs/register.js +1 -0
- package/cjs/register.js.map +1 -0
- package/cjs/scenegraph/frame-border.d.ts +9 -0
- package/cjs/scenegraph/frame-border.js +42 -0
- package/cjs/scenegraph/frame-border.js.map +1 -0
- package/cjs/scenegraph/ganttNode.d.ts +7 -0
- package/cjs/scenegraph/ganttNode.js +16 -0
- package/cjs/scenegraph/ganttNode.js.map +1 -0
- package/cjs/scenegraph/grid.d.ts +30 -0
- package/cjs/scenegraph/grid.js +130 -0
- package/cjs/scenegraph/grid.js.map +1 -0
- package/cjs/scenegraph/mark-line.d.ts +15 -0
- package/cjs/scenegraph/mark-line.js +66 -0
- package/cjs/scenegraph/mark-line.js.map +1 -0
- package/cjs/scenegraph/scenegraph.d.ts +41 -0
- package/cjs/scenegraph/scenegraph.js +109 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -0
- package/cjs/scenegraph/scroll-bar.d.ts +19 -0
- package/cjs/scenegraph/scroll-bar.js +150 -0
- package/cjs/scenegraph/scroll-bar.js.map +1 -0
- package/cjs/scenegraph/task-bar.d.ts +24 -0
- package/cjs/scenegraph/task-bar.js +188 -0
- package/cjs/scenegraph/task-bar.js.map +1 -0
- package/cjs/scenegraph/timeline-header.d.ts +10 -0
- package/cjs/scenegraph/timeline-header.js +134 -0
- package/cjs/scenegraph/timeline-header.js.map +1 -0
- package/cjs/state/gantt-table-sync.d.ts +7 -0
- package/cjs/state/gantt-table-sync.js +60 -0
- package/cjs/state/gantt-table-sync.js.map +1 -0
- package/cjs/state/state-manager.d.ts +58 -0
- package/cjs/state/state-manager.js +223 -0
- package/cjs/state/state-manager.js.map +1 -0
- package/cjs/themes.d.ts +1 -0
- package/cjs/themes.js +1 -0
- package/cjs/themes.js.map +1 -0
- package/cjs/tools/debounce.d.ts +1 -0
- package/cjs/tools/debounce.js +51 -0
- package/cjs/tools/debounce.js.map +1 -0
- package/cjs/tools/index.d.ts +2 -0
- package/cjs/tools/index.js +20 -0
- package/cjs/tools/index.js.map +1 -0
- package/cjs/tools/isx.d.ts +16 -0
- package/cjs/tools/isx.js +117 -0
- package/cjs/tools/isx.js.map +1 -0
- package/cjs/tools/pixel-ratio.d.ts +2 -0
- package/cjs/tools/pixel-ratio.js +16 -0
- package/cjs/tools/pixel-ratio.js.map +1 -0
- package/cjs/tools/util.d.ts +7 -0
- package/cjs/tools/util.js +87 -0
- package/cjs/tools/util.js.map +1 -0
- package/cjs/ts-types/EVENT_TYPE.d.ts +5 -0
- package/cjs/ts-types/EVENT_TYPE.js +9 -0
- package/cjs/ts-types/EVENT_TYPE.js.map +1 -0
- package/cjs/ts-types/common.d.ts +13 -0
- package/cjs/ts-types/common.js +14 -0
- package/cjs/ts-types/common.js.map +1 -0
- package/cjs/ts-types/events.d.ts +14 -0
- package/cjs/ts-types/events.js +6 -0
- package/cjs/ts-types/events.js.map +1 -0
- package/cjs/ts-types/gantt-engine.d.ts +163 -0
- package/cjs/ts-types/gantt-engine.js +6 -0
- package/cjs/ts-types/gantt-engine.js.map +1 -0
- package/cjs/ts-types/index.d.ts +4 -0
- package/cjs/ts-types/index.js +22 -0
- package/cjs/ts-types/index.js.map +1 -0
- package/dist/vtable-gantt.js +53942 -0
- package/dist/vtable-gantt.min.js +1 -0
- package/es/Gantt.d.ts +111 -0
- package/es/Gantt.js +246 -0
- package/es/Gantt.js.map +1 -0
- package/es/data/DataSource.d.ts +9 -0
- package/es/data/DataSource.js +22 -0
- package/es/data/DataSource.js.map +1 -0
- package/es/env.d.ts +19 -0
- package/es/env.js +42 -0
- package/es/env.js.map +1 -0
- package/es/event/EventHandler.d.ts +47 -0
- package/es/event/EventHandler.js +119 -0
- package/es/event/EventHandler.js.map +1 -0
- package/es/event/EventTarget.d.ts +12 -0
- package/es/event/EventTarget.js +58 -0
- package/es/event/EventTarget.js.map +1 -0
- package/es/event/event-manager.d.ts +15 -0
- package/es/event/event-manager.js +78 -0
- package/es/event/event-manager.js.map +1 -0
- package/es/event/scroll.d.ts +22 -0
- package/es/event/scroll.js +126 -0
- package/es/event/scroll.js.map +1 -0
- package/es/gantt-helper.d.ts +28 -0
- package/es/gantt-helper.js +220 -0
- package/es/gantt-helper.js.map +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +10 -0
- package/es/index.js.map +1 -0
- package/es/register.d.ts +1 -0
- package/es/register.js +1 -0
- package/es/register.js.map +1 -0
- package/es/scenegraph/frame-border.d.ts +9 -0
- package/es/scenegraph/frame-border.js +34 -0
- package/es/scenegraph/frame-border.js.map +1 -0
- package/es/scenegraph/ganttNode.d.ts +7 -0
- package/es/scenegraph/ganttNode.js +8 -0
- package/es/scenegraph/ganttNode.js.map +1 -0
- package/es/scenegraph/grid.d.ts +30 -0
- package/es/scenegraph/grid.js +122 -0
- package/es/scenegraph/grid.js.map +1 -0
- package/es/scenegraph/mark-line.d.ts +15 -0
- package/es/scenegraph/mark-line.js +58 -0
- package/es/scenegraph/mark-line.js.map +1 -0
- package/es/scenegraph/scenegraph.d.ts +41 -0
- package/es/scenegraph/scenegraph.js +116 -0
- package/es/scenegraph/scenegraph.js.map +1 -0
- package/es/scenegraph/scroll-bar.d.ts +19 -0
- package/es/scenegraph/scroll-bar.js +144 -0
- package/es/scenegraph/scroll-bar.js.map +1 -0
- package/es/scenegraph/task-bar.d.ts +24 -0
- package/es/scenegraph/task-bar.js +188 -0
- package/es/scenegraph/task-bar.js.map +1 -0
- package/es/scenegraph/timeline-header.d.ts +10 -0
- package/es/scenegraph/timeline-header.js +130 -0
- package/es/scenegraph/timeline-header.js.map +1 -0
- package/es/state/gantt-table-sync.d.ts +7 -0
- package/es/state/gantt-table-sync.js +51 -0
- package/es/state/gantt-table-sync.js.map +1 -0
- package/es/state/state-manager.d.ts +58 -0
- package/es/state/state-manager.js +219 -0
- package/es/state/state-manager.js.map +1 -0
- package/es/themes.d.ts +1 -0
- package/es/themes.js +1 -0
- package/es/themes.js.map +1 -0
- package/es/tools/debounce.d.ts +1 -0
- package/es/tools/debounce.js +43 -0
- package/es/tools/debounce.js.map +1 -0
- package/es/tools/index.d.ts +2 -0
- package/es/tools/index.js +4 -0
- package/es/tools/index.js.map +1 -0
- package/es/tools/isx.d.ts +16 -0
- package/es/tools/isx.js +80 -0
- package/es/tools/isx.js.map +1 -0
- package/es/tools/pixel-ratio.d.ts +2 -0
- package/es/tools/pixel-ratio.js +12 -0
- package/es/tools/pixel-ratio.js.map +1 -0
- package/es/tools/util.d.ts +7 -0
- package/es/tools/util.js +78 -0
- package/es/tools/util.js.map +1 -0
- package/es/ts-types/EVENT_TYPE.d.ts +5 -0
- package/es/ts-types/EVENT_TYPE.js +5 -0
- package/es/ts-types/EVENT_TYPE.js.map +1 -0
- package/es/ts-types/common.d.ts +13 -0
- package/es/ts-types/common.js +13 -0
- package/es/ts-types/common.js.map +1 -0
- package/es/ts-types/events.d.ts +14 -0
- package/es/ts-types/events.js +2 -0
- package/es/ts-types/events.js.map +1 -0
- package/es/ts-types/gantt-engine.d.ts +163 -0
- package/es/ts-types/gantt-engine.js +2 -0
- package/es/ts-types/gantt-engine.js.map +1 -0
- package/es/ts-types/index.d.ts +4 -0
- package/es/ts-types/index.js +8 -0
- package/es/ts-types/index.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/util.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,QAAQ,CAAC,IAAc,EAAE,KAAa;IACpD,IAAI,KAAK,GAAQ,IAAI,CAAC;IACtB,OAAO,UAAqB,GAAG,IAAW;QAExC,IAAI,CAAC,KAAK,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvB,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBACtB,KAAK,GAAG,IAAI,CAAC;YACf,CAAC,EAAE,KAAK,CAAC,CAAC;SACX;IAKH,CAAC,CAAC;AACJ,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,IAAc,EAAE,KAAa;IACrD,IAAI,KAAK,GAAQ,IAAI,CAAC;IACtB,OAAO,UAAqB,GAAG,IAAW;QAExC,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACvB,KAAK,GAAG,IAAI,CAAC;YACf,CAAC,EAAE,KAAK,CAAC,CAAC;SACX;IACH,CAAC,CAAC;AACJ,CAAC;AA0CD,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,MAAc;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;IA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AAG,CAAC,CAAC,CAAC,EAAY,GAAG,CAAC,CAAC,CAAC,EAAa,GAAG,CAAC,CAAC,CAAC,CAAU,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,WAAiB;IAE7C,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnG,OAAO,UAAU,CAAC;AACpB,CAAC","file":"util.js","sourcesContent":["import { isValid } from '@visactor/vutils';\n\n/**\n * throttle 保障了首次立即执行 后续触发的回调执行间隔delay时间 区别于throttle2 最后执行时机会提前\n * @param { Function } func 执行函数\n * @param { Interger } time 多长时间内不能第二次执行\n * @returns function 返回经过节流处理的函数\n */\nexport function throttle(func: Function, delay: number) {\n let timer: any = null;\n return function (this: any, ...args: any[]) {\n // let args=arguments 也可以写成这种或...args也是代表我们传过来的实参\n if (!timer) {\n func.apply(this, args); //先执行函数,保证第一次立即执行\n timer = setTimeout(() => {\n timer = null;\n }, delay);\n }\n // console.log('throttle');\n // 当我们第一次触发事件,定时器不存在时就执行函数,当我们再次点击时,因为定时器存在,\n // 所以无法再进入函数调用(无论事件如何执行),那么只能等定时器事件结束,\n // 我们让timer=null,回到第一次的状态,就又重新开始新的一轮\n };\n}\n/**\n * throttle节流 间隔delay时间后执行 保障了最后执行时机是在delay之后\n * @param { Function } func 执行函数\n * @param { Interger } time 多长时间内不能第二次执行\n * @returns function 返回经过节流处理的函数\n */\nexport function throttle2(func: Function, delay: number) {\n let timer: any = null;\n return function (this: any, ...args: any[]) {\n // let args=arguments 也可以写成这种或...args也是代表我们传过来的实参\n if (!timer) {\n timer = setTimeout(() => {\n func.apply(this, args);\n timer = null;\n }, delay);\n }\n };\n}\n// export function parseDateFormat(dateString: string) {\n// const formats = [\n// 'yyyy-mm-dd',\n// 'dd-mm-yyyy',\n// 'mm/dd/yyyy',\n// 'yyyy/mm/dd',\n// 'dd/mm/yyyy',\n// 'yyyy.mm.dd',\n// 'dd.mm.yyyy',\n// 'mm.dd.yyyy'\n// ];\n// const separatorsInDate = dateString.match(/[^\\w]/g);\n// for (let i = 0; i < formats.length; i++) {\n// const format = formats[i];\n// const separators = format.match(/[^\\w]/g);\n// let isValidFormat = true;\n// for (let j = 0; j < separators.length; j++) {\n// const part = separators[j];\n// if (part !== separatorsInDate[j]) {\n// isValidFormat = false;\n// break;\n// }\n// }\n// if (isValidFormat) {\n// return format;\n// }\n// }\n\n// return null;\n// }\n\n// export function parseDate(dateString, format) {\n// // 根据解析出的格式将 dateString 解析为日期对象\n// // 这里只是一个示例,假设解析格式为 \"yyyy-mm-dd\"\n// const parts = dateString.split('-');\n// const year = parseInt(parts[0], 10);\n// const month = parseInt(parts[1], 10) - 1;\n// const day = parseInt(parts[2], 10);\n// return new Date(year, month, day);\n// }\n\nexport function formatDate(date: Date, format: string) {\n const year = date.getFullYear().toString();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n\n format = format.replace('yyyy', year);\n format = format.replace('mm', month);\n format = format.replace('dd', day);\n\n return format;\n}\n\n// 修正后的 validateDate 函数\nfunction validateDate(dateParts: string[], format: string) {\n // 根据格式确定年、月、日的索引\n const yearIndex = format.indexOf('yyyy');\n const monthIndex = format.indexOf('mm');\n const dayIndex = format.indexOf('dd');\n const dateYearIndex = yearIndex < monthIndex ? (yearIndex < dayIndex ? 0 : 1) : monthIndex < dayIndex ? 1 : 2;\n const dateMonthIndex = monthIndex < yearIndex ? (monthIndex < dayIndex ? 0 : 1) : monthIndex < dayIndex ? 1 : 2;\n const dateDayIndex = dayIndex < yearIndex ? (dayIndex < monthIndex ? 0 : 1) : dayIndex < monthIndex ? 1 : 2;\n // 解析年、月、日\n const year = parseInt(dateParts[dateYearIndex], 10);\n const month = parseInt(dateParts[dateMonthIndex], 10) - 1; // 月份从0开始\n const day = parseInt(dateParts[dateDayIndex], 10);\n\n // 检查年份是否有效\n if (isNaN(year) || year < 1) {\n return false;\n }\n\n // 检查月份是否有效\n if (isNaN(month) || month < 0 || month > 11) {\n return false;\n }\n\n // 检查日期是否有效\n // 每个月的天数不同,需要考虑闰年\n const daysInMonth = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (isNaN(day) || day < 1 || day > daysInMonth[month]) {\n return false;\n }\n\n return true;\n}\n\n// 辅助函数,用于判断是否为闰年\nfunction isLeapYear(year: number) {\n // 能被4整除且不能被100整除,或者能被400整除的年份是闰年\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n// 修正后的 parseDateFormat 函数\nexport function parseDateFormat(dateString: string) {\n const formats = [\n 'yyyy-mm-dd',\n 'dd-mm-yyyy',\n 'mm/dd/yyyy',\n 'yyyy/mm/dd',\n 'dd/mm/yyyy',\n 'yyyy.mm.dd',\n 'dd.mm.yyyy',\n 'mm.dd.yyyy'\n ];\n dateString = dateString.replace(/\\s+/g, ''); // 移除空格\n for (let i = 0; i < formats.length; i++) {\n const format = formats[i];\n const dateParts = dateString.split(getSeparator(format));\n const isValid = validateDate(dateParts, format);\n if (dateParts.length === 3 && isValid) {\n return format;\n }\n }\n return null;\n}\n\n// 根据日期格式获取分隔符正则表达式\nfunction getSeparator(format: string) {\n // 找到日期格式中的分隔符\n const separators = format.match(/[^\\w]/g);\n if (separators) {\n // 转义分隔符,以确保正则表达式正确处理特殊字符\n const escapedSeparators = separators.map(s => '\\\\' + s).join('|');\n return new RegExp(escapedSeparators, 'g');\n }\n return /[^\\w]/;\n}\n\nexport function parseStringTemplate(template: string, data: any) {\n const result = template.replace(/\\{([^}]+)\\}/g, (match, key) => {\n const keys = key.split('.');\n let value = data;\n\n for (const k of keys) {\n if (value.hasOwnProperty(k)) {\n value = value[k];\n } else {\n value = match; // 如果找不到对应的字段值,保持原样\n break;\n }\n }\n\n return value;\n });\n return result;\n}\n\nexport function toBoxArray<T>(obj: T | T[]): [T, T, T, T] {\n if (!Array.isArray(obj)) {\n return [obj /*top*/, obj /*right*/, obj /*bottom*/, obj /*left*/];\n }\n if (obj.length === 3) {\n return [obj[0] /*top*/, obj[1] /*right*/, obj[2] /*bottom*/, obj[1] /*left*/];\n }\n if (obj.length === 2) {\n return [obj[0] /*top*/, obj[1] /*right*/, obj[0] /*bottom*/, obj[1] /*left*/];\n }\n if (obj.length === 1) {\n return [obj[0] /*top*/, obj[0] /*right*/, obj[0] /*bottom*/, obj[0] /*left*/];\n }\n // return obj as [T, T, T, T];//原先这种返回方式,会造成修改引用问题\n return [obj[0] /*top*/, obj[1] /*right*/, obj[2] /*bottom*/, obj[3] /*left*/];\n}\n\nexport function getWeekNumber(currentDate: Date) {\n // Calculate the week number within the year\n const startOfYear = new Date(currentDate.getFullYear(), 0, 1);\n const weekNumber = Math.ceil(((currentDate.getTime() - startOfYear.getTime()) / 86400000 + 1) / 7);\n return weekNumber;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/EVENT_TYPE.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,MAAM,EAAE,QAAQ;IAChB,iBAAiB,EAAE,mBAAmB;CACxB,CAAC","file":"EVENT_TYPE.js","sourcesContent":["export interface EVENT_TYPES {\n /**\n * 滚动表格事件\n */\n SCROLL: 'scroll';\n CHANGE_DATE_RANGE: 'change_date_range';\n}\n/**\n * Table event types\n */\nexport const GANTT_EVENT_TYPE: EVENT_TYPES = {\n SCROLL: 'scroll',\n CHANGE_DATE_RANGE: 'change_date_range'\n} as EVENT_TYPES;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum InteractionState {
|
|
2
|
+
'default' = "default",
|
|
3
|
+
'grabing' = "grabing",
|
|
4
|
+
'scrolling' = "scrolling"
|
|
5
|
+
}
|
|
6
|
+
export declare enum HighlightScope {
|
|
7
|
+
'single' = "single",
|
|
8
|
+
'column' = "column",
|
|
9
|
+
'row' = "row",
|
|
10
|
+
'cross' = "cross",
|
|
11
|
+
'none' = "none"
|
|
12
|
+
}
|
|
13
|
+
export type SortOrder = 'asc' | 'desc' | 'normal' | 'ASC' | 'DESC' | 'NORMAL';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var InteractionState;
|
|
2
|
+
|
|
3
|
+
!function(InteractionState) {
|
|
4
|
+
InteractionState.default = "default", InteractionState.grabing = "grabing", InteractionState.scrolling = "scrolling";
|
|
5
|
+
}(InteractionState || (InteractionState = {}));
|
|
6
|
+
|
|
7
|
+
export var HighlightScope;
|
|
8
|
+
|
|
9
|
+
!function(HighlightScope) {
|
|
10
|
+
HighlightScope.single = "single", HighlightScope.column = "column", HighlightScope.row = "row",
|
|
11
|
+
HighlightScope.cross = "cross", HighlightScope.none = "none";
|
|
12
|
+
}(HighlightScope || (HighlightScope = {}));
|
|
13
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/common.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,2CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AASD,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,+BAAe,CAAA;AACjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","file":"common.js","sourcesContent":["/**\n * 当前表格的交互状态:\n * Default 默认展示\n * grabing 拖拽中\n * -Resize column 改变列宽\n * -column move 调整列顺序\n * -drag select 拖拽多选\n * Scrolling 滚动中\n */\nexport enum InteractionState {\n 'default' = 'default',\n 'grabing' = 'grabing',\n 'scrolling' = 'scrolling'\n}\n/**\n * 单元格的高亮效果设置\n * single 单个单元格高亮\n * column 整列高亮\n * row 整行高量\n * cross 十字花 行列均高亮\n * none 无高亮\n */\nexport enum HighlightScope {\n 'single' = 'single',\n 'column' = 'column',\n 'row' = 'row',\n 'cross' = 'cross',\n 'none' = 'none'\n}\n\nexport type SortOrder = 'asc' | 'desc' | 'normal' | 'ASC' | 'DESC' | 'NORMAL';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TableEventListener<TYPE extends keyof TableEventHandlersEventArgumentMap> = (args: TableEventHandlersEventArgumentMap[TYPE]) => TableEventHandlersReturnMap[TYPE];
|
|
2
|
+
export type EventListenerId = number;
|
|
3
|
+
export interface TableEventHandlersEventArgumentMap {
|
|
4
|
+
scroll: {
|
|
5
|
+
scrollLeft: number;
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
scrollDirection: 'horizontal' | 'vertical';
|
|
8
|
+
scrollRatioX?: number;
|
|
9
|
+
scrollRatioY?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface TableEventHandlersReturnMap {
|
|
13
|
+
scroll: void;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/events.ts"],"names":[],"mappings":"","file":"events.js","sourcesContent":["export type TableEventListener<TYPE extends keyof TableEventHandlersEventArgumentMap> = (\n args: TableEventHandlersEventArgumentMap[TYPE]\n) => TableEventHandlersReturnMap[TYPE]; //AnyFunction;\nexport type EventListenerId = number;\n\nexport interface TableEventHandlersEventArgumentMap {\n scroll: {\n scrollLeft: number;\n scrollTop: number;\n // scrollWidth: number;\n // scrollHeight: number;\n // viewWidth: number;\n // viewHeight: number;\n scrollDirection: 'horizontal' | 'vertical';\n scrollRatioX?: number;\n scrollRatioY?: number;\n };\n}\n\nexport interface TableEventHandlersReturnMap {\n scroll: void;\n}\n"]}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { ColumnsDefine, TYPES, VRender } from '@visactor/vtable';
|
|
2
|
+
import type { Gantt } from '../Gantt';
|
|
3
|
+
export type LayoutObjectId = number | string;
|
|
4
|
+
export interface ITimelineDateInfo {
|
|
5
|
+
days: number;
|
|
6
|
+
endDate: Date;
|
|
7
|
+
startDate: Date;
|
|
8
|
+
title: string;
|
|
9
|
+
dateIndex: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ITimelineHeaderStyle {
|
|
12
|
+
padding?: number | number[];
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
fontWeight?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
strokeColor?: string;
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
textAlign?: 'center' | 'end' | 'left' | 'right' | 'start';
|
|
19
|
+
textOverflow?: string;
|
|
20
|
+
textBaseline?: 'alphabetic' | 'bottom' | 'middle' | 'top';
|
|
21
|
+
}
|
|
22
|
+
export interface IGridStyle {
|
|
23
|
+
backgroundColor?: string;
|
|
24
|
+
verticalLine?: ILineStyle;
|
|
25
|
+
horizontalLine?: ILineStyle;
|
|
26
|
+
}
|
|
27
|
+
export interface GanttConstructorOptions {
|
|
28
|
+
container?: HTMLElement;
|
|
29
|
+
records?: any[];
|
|
30
|
+
timelineHeader: {
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
colWidth?: number;
|
|
33
|
+
verticalLine?: ILineStyle;
|
|
34
|
+
horizontalLine?: ILineStyle;
|
|
35
|
+
scales: ITimelineScale[];
|
|
36
|
+
};
|
|
37
|
+
startDateField: string;
|
|
38
|
+
endDateField: string;
|
|
39
|
+
progressField: string;
|
|
40
|
+
minDate?: string;
|
|
41
|
+
maxDate?: string;
|
|
42
|
+
headerRowHeight?: number | number[];
|
|
43
|
+
rowHeight?: number;
|
|
44
|
+
rowSeriesNumber?: IRowSeriesNumber;
|
|
45
|
+
overscrollBehavior?: 'auto' | 'none';
|
|
46
|
+
markLine?: boolean | IMarkLine | IMarkLine[];
|
|
47
|
+
taskBar?: {
|
|
48
|
+
labelText?: ITaskBarLabelText;
|
|
49
|
+
labelTextStyle?: ITaskBarLabelTextStyle;
|
|
50
|
+
barStyle?: ITaskBarStyle;
|
|
51
|
+
customLayout?: ITaskBarCustomLayout;
|
|
52
|
+
resizable?: boolean;
|
|
53
|
+
moveable?: boolean;
|
|
54
|
+
hoverColor?: string | null;
|
|
55
|
+
};
|
|
56
|
+
taskListTable?: {
|
|
57
|
+
columns?: ColumnsDefine;
|
|
58
|
+
width?: 'auto' | number;
|
|
59
|
+
colWidth?: number;
|
|
60
|
+
headerStyle?: ITableStyle;
|
|
61
|
+
bodyStyle?: ITableStyle;
|
|
62
|
+
minWidth?: number;
|
|
63
|
+
maxWidth?: number;
|
|
64
|
+
rightFrozenColCount?: number;
|
|
65
|
+
};
|
|
66
|
+
gridStyle?: IGridStyle;
|
|
67
|
+
scrollStyle?: IScrollStyle;
|
|
68
|
+
frameStyle: {
|
|
69
|
+
outerFrameStyle: IFrameStyle;
|
|
70
|
+
verticalSplitLine?: ILineStyle;
|
|
71
|
+
horizontalSplitLine?: ILineStyle;
|
|
72
|
+
};
|
|
73
|
+
pixelRatio?: number;
|
|
74
|
+
resizeLineStyle?: IResizeLineStyle;
|
|
75
|
+
}
|
|
76
|
+
export type ITaskBarLabelText = string;
|
|
77
|
+
export interface ITimelineScale {
|
|
78
|
+
unit: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
79
|
+
step: number;
|
|
80
|
+
startOfWeek?: 'sunday' | 'monday';
|
|
81
|
+
customLayout?: IDateCustomLayout;
|
|
82
|
+
style?: ITimelineHeaderStyle;
|
|
83
|
+
format?: (date: DateFormatArgumentType) => string;
|
|
84
|
+
}
|
|
85
|
+
export interface ITaskBarLabelTextStyle {
|
|
86
|
+
fontFamily?: string;
|
|
87
|
+
fontSize?: number;
|
|
88
|
+
color?: string;
|
|
89
|
+
textAlign?: 'center' | 'end' | 'left' | 'right' | 'start';
|
|
90
|
+
textOverflow?: string;
|
|
91
|
+
textBaseline?: 'alphabetic' | 'bottom' | 'middle' | 'top';
|
|
92
|
+
padding?: number | number[];
|
|
93
|
+
}
|
|
94
|
+
export interface ITaskBarStyle {
|
|
95
|
+
barColor?: string;
|
|
96
|
+
completedBarColor?: string;
|
|
97
|
+
width?: number;
|
|
98
|
+
cornerRadius?: number;
|
|
99
|
+
borderWidth?: number;
|
|
100
|
+
borderColor?: string;
|
|
101
|
+
}
|
|
102
|
+
export type ILineStyle = {
|
|
103
|
+
lineColor?: string;
|
|
104
|
+
lineWidth?: number;
|
|
105
|
+
lineDash?: number[];
|
|
106
|
+
};
|
|
107
|
+
export interface IMarkLine {
|
|
108
|
+
date?: string;
|
|
109
|
+
style?: ILineStyle;
|
|
110
|
+
}
|
|
111
|
+
export type ITableColumnsDefine = ColumnsDefine;
|
|
112
|
+
export type IFrameStyle = {
|
|
113
|
+
borderColor?: string;
|
|
114
|
+
borderLineWidth?: number;
|
|
115
|
+
borderLineDash?: number[];
|
|
116
|
+
cornerRadius?: number;
|
|
117
|
+
};
|
|
118
|
+
export type IResizeLineStyle = {
|
|
119
|
+
lineColor: string;
|
|
120
|
+
lineWidth: number;
|
|
121
|
+
};
|
|
122
|
+
export type ITableStyle = TYPES.ThemeStyle;
|
|
123
|
+
export type IRowSeriesNumber = TYPES.IRowSeriesNumber;
|
|
124
|
+
export type IScrollStyle = TYPES.ScrollStyle;
|
|
125
|
+
export type DateFormatArgumentType = {
|
|
126
|
+
dateIndex: number;
|
|
127
|
+
startDate: Date;
|
|
128
|
+
endDate: Date;
|
|
129
|
+
};
|
|
130
|
+
export type TaskBarCustomLayoutArgumentType = {
|
|
131
|
+
width: number;
|
|
132
|
+
height: number;
|
|
133
|
+
index: number;
|
|
134
|
+
startDate: Date;
|
|
135
|
+
endDate: Date;
|
|
136
|
+
taskDays: number;
|
|
137
|
+
progress: number;
|
|
138
|
+
taskRecord: any;
|
|
139
|
+
ganttInstance: Gantt;
|
|
140
|
+
};
|
|
141
|
+
export type ITaskBarCustomLayout = ITaskBarCustomLayoutObj | ((args: TaskBarCustomLayoutArgumentType) => ITaskBarCustomLayoutObj);
|
|
142
|
+
export type ITaskBarCustomLayoutObj = {
|
|
143
|
+
rootContainer: VRender.Group;
|
|
144
|
+
renderDefaultBar?: boolean;
|
|
145
|
+
renderDefaultResizeIcon?: boolean;
|
|
146
|
+
renderDefaultText?: boolean;
|
|
147
|
+
};
|
|
148
|
+
export type DateCustomLayoutArgumentType = {
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
index: number;
|
|
152
|
+
dateIndex: number;
|
|
153
|
+
title: string;
|
|
154
|
+
startDate: Date;
|
|
155
|
+
endDate: Date;
|
|
156
|
+
days: number;
|
|
157
|
+
ganttInstance: Gantt;
|
|
158
|
+
};
|
|
159
|
+
export type IDateCustomLayout = IDateCustomLayoutObj | ((args: DateCustomLayoutArgumentType) => IDateCustomLayoutObj);
|
|
160
|
+
export type IDateCustomLayoutObj = {
|
|
161
|
+
rootContainer: VRender.Group;
|
|
162
|
+
renderDefaultText?: boolean;
|
|
163
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/gantt-engine.ts"],"names":[],"mappings":"","file":"gantt-engine.js","sourcesContent":["import type { ColumnsDefine, TYPES, VRender } from '@visactor/vtable';\nimport type { Gantt } from '../Gantt';\nexport type LayoutObjectId = number | string;\n\nexport interface ITimelineDateInfo {\n days: number;\n endDate: Date;\n startDate: Date;\n title: string;\n dateIndex: number;\n}\n\nexport interface ITimelineHeaderStyle {\n padding?: number | number[];\n // borderColor?: string;\n // borderWidth?: number;\n fontSize?: number;\n fontWeight?: string;\n color?: string;\n strokeColor?: string;\n backgroundColor?: string;\n textAlign?: 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\n textOverflow?: string;\n textBaseline?: 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n}\nexport interface IGridStyle {\n backgroundColor?: string;\n verticalLine?: ILineStyle;\n horizontalLine?: ILineStyle;\n}\n//#region gantt\nexport interface GanttConstructorOptions {\n container?: HTMLElement;\n /**\n * 数据集合\n */\n records?: any[];\n /** 时间刻度 */\n timelineHeader: {\n backgroundColor?: string;\n colWidth?: number;\n /** 垂直间隔线样式 */\n verticalLine?: ILineStyle;\n /** 水平间隔线样式 */\n horizontalLine?: ILineStyle;\n scales: ITimelineScale[];\n };\n\n /** 时间刻度对应的字段名 */\n startDateField: string;\n /** 时间刻度对应的字段名 */\n endDateField: string;\n /** 进度对应的字段名 */\n progressField: string;\n /** 指定整个甘特图的最小日期 */\n minDate?: string;\n /** 指定整个甘特图的最大日期 不设置的话用默认规则*/\n maxDate?: string;\n\n /** 顶部表头部分默认行高。如果配置成数组,请务必配置成和timelineHeader.scales数组长度一样长的数组 */\n headerRowHeight?: number | number[];\n\n /** 数据默认行高 */\n rowHeight?: number;\n\n /** 行号配置 */\n rowSeriesNumber?: IRowSeriesNumber;\n\n /**\n * 'auto':和浏览器滚动行为一致 表格滚动到顶部/底部时 触发浏览器默认行为;\n * 设置为 'none' 时, 表格滚动到顶部/底部时, 不再触发父容器滚动\n * */\n overscrollBehavior?: 'auto' | 'none';\n\n /** 标记线配置 如果配置为true 会自动给今天做标记 */\n markLine?: boolean | IMarkLine | IMarkLine[];\n\n /** 设置任务条样式 可以设置多组 依次循环使用 */\n taskBar?: {\n labelText?: ITaskBarLabelText;\n labelTextStyle?: ITaskBarLabelTextStyle;\n barStyle?: ITaskBarStyle;\n customLayout?: ITaskBarCustomLayout;\n resizable?: boolean;\n moveable?: boolean;\n hoverColor?: string | null;\n };\n\n taskListTable?: {\n /** 定义列 */\n columns?: ColumnsDefine; // (string | IDimension)[];\n /** 左侧任务列表信息占用的宽度。如果设置为'auto'表示将所有列完全展示 */\n width?: 'auto' | number;\n colWidth?: number;\n headerStyle?: ITableStyle;\n bodyStyle?: ITableStyle;\n /** 左侧任务列表 最小宽度 */\n minWidth?: number;\n /** 左侧任务列表 最大宽度 */\n maxWidth?: number;\n rightFrozenColCount?: number;\n };\n gridStyle?: IGridStyle;\n // timelineHeaderStyle?: ITimelineHeaderStyle;\n scrollStyle?: IScrollStyle;\n\n frameStyle: {\n outerFrameStyle: IFrameStyle;\n verticalSplitLine?: ILineStyle;\n horizontalSplitLine?: ILineStyle;\n };\n pixelRatio?: number;\n\n //列调整宽度的直线\n resizeLineStyle?: IResizeLineStyle;\n}\n/**\n * IBarLabelText\n * 可以配置固定文本 或者 ${fieldName} 或者自定义函数\n */\nexport type ITaskBarLabelText = string; //| string[] | ((args: any) => string | string[]);\nexport interface ITimelineScale {\n unit: 'day' | 'week' | 'month' | 'quarter' | 'year';\n step: number;\n startOfWeek?: 'sunday' | 'monday';\n customLayout?: IDateCustomLayout;\n style?: ITimelineHeaderStyle;\n format?: (date: DateFormatArgumentType) => string;\n}\nexport interface ITaskBarLabelTextStyle {\n fontFamily?: string;\n fontSize?: number;\n color?: string;\n textAlign?: 'center' | 'end' | 'left' | 'right' | 'start'; // 设置单元格内文字的水平对齐方式\n textOverflow?: string;\n textBaseline?: 'alphabetic' | 'bottom' | 'middle' | 'top'; // 设置单元格内文字的垂直对齐方式\n padding?: number | number[];\n}\nexport interface ITaskBarStyle {\n /** 任务条的颜色 */\n barColor?: string;\n /** 已完成部分任务条的颜色 */\n completedBarColor?: string;\n /** 任务条的宽度 */\n width?: number;\n /** 任务条的圆角 */\n cornerRadius?: number;\n /** 任务条的边框 */\n borderWidth?: number;\n /** 边框颜色 */\n borderColor?: string;\n}\nexport type ILineStyle = {\n lineColor?: string;\n lineWidth?: number;\n lineDash?: number[];\n};\nexport interface IMarkLine {\n date?: string;\n style?: ILineStyle;\n}\nexport type ITableColumnsDefine = ColumnsDefine;\nexport type IFrameStyle = {\n borderColor?: string;\n borderLineWidth?: number;\n borderLineDash?: number[];\n cornerRadius?: number;\n};\nexport type IResizeLineStyle = {\n lineColor: string; //线的颜色\n lineWidth: number; //线的宽度\n};\nexport type ITableStyle = TYPES.ThemeStyle;\nexport type IRowSeriesNumber = TYPES.IRowSeriesNumber;\nexport type IScrollStyle = TYPES.ScrollStyle;\nexport type DateFormatArgumentType = { dateIndex: number; startDate: Date; endDate: Date };\nexport type TaskBarCustomLayoutArgumentType = {\n width: number;\n height: number;\n index: number;\n startDate: Date;\n endDate: Date;\n taskDays: number;\n progress: number;\n taskRecord: any;\n ganttInstance: Gantt;\n};\nexport type ITaskBarCustomLayout =\n | ITaskBarCustomLayoutObj\n | ((args: TaskBarCustomLayoutArgumentType) => ITaskBarCustomLayoutObj); //CustomLayout\nexport type ITaskBarCustomLayoutObj = {\n rootContainer: VRender.Group;\n renderDefaultBar?: boolean; // 默认false\n renderDefaultResizeIcon?: boolean; // 默认false\n renderDefaultText?: boolean; // 默认false\n};\n\nexport type DateCustomLayoutArgumentType = {\n width: number;\n height: number;\n index: number;\n dateIndex: number;\n title: string;\n startDate: Date;\n endDate: Date;\n days: number;\n ganttInstance: Gantt;\n};\nexport type IDateCustomLayout = IDateCustomLayoutObj | ((args: DateCustomLayoutArgumentType) => IDateCustomLayoutObj); //CustomLayout\nexport type IDateCustomLayoutObj = {\n rootContainer: VRender.Group;\n renderDefaultText?: boolean; // 默认false\n};\n\n//#endregion\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ts-types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './common';\nexport * from './gantt-engine';\nexport * from './EVENT_TYPE';\nexport * from './events';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visactor/vtable-gantt",
|
|
3
|
+
"version": "1.5.4",
|
|
4
|
+
"description": "canvas table width high performance",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vtable-gantt",
|
|
7
|
+
"grid",
|
|
8
|
+
"table",
|
|
9
|
+
"pivottable",
|
|
10
|
+
"visualization",
|
|
11
|
+
"VTable",
|
|
12
|
+
"gantt",
|
|
13
|
+
"VisActor",
|
|
14
|
+
"spreadsheet",
|
|
15
|
+
"canvas",
|
|
16
|
+
"datagrid",
|
|
17
|
+
"datatable"
|
|
18
|
+
],
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "VisActor",
|
|
21
|
+
"url": "https://VisActor.io/"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"sideEffects": true,
|
|
25
|
+
"main": "cjs/index.js",
|
|
26
|
+
"module": "es/index.js",
|
|
27
|
+
"types": "es/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"cjs",
|
|
30
|
+
"es",
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"require": "./cjs/index.js",
|
|
36
|
+
"import": "./es/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"demo": "vite serve examples",
|
|
41
|
+
"compile": "tsc --noEmit",
|
|
42
|
+
"eslint": "eslint --debug --fix src/",
|
|
43
|
+
"build": "bundle --clean",
|
|
44
|
+
"dev": "bundle --clean -f es -w",
|
|
45
|
+
"start": "vite ./vite",
|
|
46
|
+
"test": "jest --silent",
|
|
47
|
+
"test-cov": "jest --coverage",
|
|
48
|
+
"ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts",
|
|
49
|
+
"build:es": "bundle --clean -f es --ignorePostTasks"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@visactor/vtable": "workspace:*",
|
|
53
|
+
"@visactor/vutils": "~0.18.9",
|
|
54
|
+
"@visactor/vscale": "~0.18.1",
|
|
55
|
+
"@visactor/vdataset": "~0.18.1",
|
|
56
|
+
"cssfontparser": "^1.2.1"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"luxon": "*",
|
|
60
|
+
"@internal/bundler": "workspace:*",
|
|
61
|
+
"@internal/eslint-config": "workspace:*",
|
|
62
|
+
"@internal/ts-config": "workspace:*",
|
|
63
|
+
"@rushstack/eslint-patch": "~1.1.4",
|
|
64
|
+
"react": "^18.0.0",
|
|
65
|
+
"react-dom": "^18.0.0",
|
|
66
|
+
"@types/react": "^18.0.0",
|
|
67
|
+
"@types/react-dom": "^18.0.0",
|
|
68
|
+
"@vitejs/plugin-react": "3.1.0",
|
|
69
|
+
"eslint": "~8.18.0",
|
|
70
|
+
"vite": "3.2.6",
|
|
71
|
+
"typescript": "4.9.5",
|
|
72
|
+
"@babel/core": "7.20.12",
|
|
73
|
+
"@babel/preset-env": "7.20.2",
|
|
74
|
+
"@types/chai": "4.2.22",
|
|
75
|
+
"@types/jest": "^26.0.0",
|
|
76
|
+
"@types/mocha": "9.0.0",
|
|
77
|
+
"@types/node": "*",
|
|
78
|
+
"@types/offscreencanvas": "2019.6.4",
|
|
79
|
+
"chai": "4.3.4",
|
|
80
|
+
"jest": "^26.0.0",
|
|
81
|
+
"jest-electron": "^0.1.12",
|
|
82
|
+
"jest-transform-stub": "^2.0.0",
|
|
83
|
+
"magic-string": "^0.25.7",
|
|
84
|
+
"mocha": "9.1.3",
|
|
85
|
+
"postcss": "8.4.21",
|
|
86
|
+
"rimraf": "3.0.2",
|
|
87
|
+
"sass": "1.43.5",
|
|
88
|
+
"ts-jest": "^26.0.0",
|
|
89
|
+
"ts-loader": "9.2.6",
|
|
90
|
+
"ts-node": "10.9.0",
|
|
91
|
+
"tslib": "2.3.1",
|
|
92
|
+
"ttypescript": "1.5.13",
|
|
93
|
+
"typescript-transform-paths": "3.3.1",
|
|
94
|
+
"json-formatter-js": "^2.3.4",
|
|
95
|
+
"inversify": "6.0.1",
|
|
96
|
+
"vite-plugin-markdown": "^2.1.0",
|
|
97
|
+
"markdown-it": "^13.0.0",
|
|
98
|
+
"node-fetch": "2.6.7",
|
|
99
|
+
"form-data": "~4.0.0",
|
|
100
|
+
"axios": "^1.4.0",
|
|
101
|
+
"d3-dsv": "^3.0.1",
|
|
102
|
+
"d3-array": "3.2.3",
|
|
103
|
+
"d3-geo": "^3.0.1",
|
|
104
|
+
"d3-hexbin": "^0.2.2",
|
|
105
|
+
"d3-hierarchy": "^3.1.1",
|
|
106
|
+
"@resvg/resvg-js": "^2.5.0",
|
|
107
|
+
"pikaday": "1.8.2"
|
|
108
|
+
},
|
|
109
|
+
"unpkg": "latest",
|
|
110
|
+
"unpkgFiles": [
|
|
111
|
+
"dist/vtable-gantt.js"
|
|
112
|
+
],
|
|
113
|
+
"publishConfig": {
|
|
114
|
+
"access": "public"
|
|
115
|
+
},
|
|
116
|
+
"homepage": "https://visactor.io/vtable",
|
|
117
|
+
"repository": {
|
|
118
|
+
"type": "git",
|
|
119
|
+
"url": "https://github.com/VisActor/VTable.git",
|
|
120
|
+
"directory": "packages/vtable-gantt"
|
|
121
|
+
}
|
|
122
|
+
}
|