@visactor/vtable-gantt 1.18.2-alpha.2 → 1.18.2
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/cjs/data/DataSource.js +2 -0
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/gantt-helper.js +56 -56
- package/cjs/gantt-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-gantt.js +83 -60
- package/dist/vtable-gantt.min.js +2 -2
- package/es/data/DataSource.js +2 -0
- package/es/data/DataSource.js.map +1 -1
- package/es/gantt-helper.js +54 -54
- package/es/gantt-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/cjs/data/DataSource.js
CHANGED
|
@@ -31,6 +31,8 @@ class DataSource {
|
|
|
31
31
|
const {unit: minTimeUnit, startOfWeek: startOfWeek, step: step} = this._gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
32
32
|
needMinDate && (this._gantt.parsedOptions.minDate = (0, util_1.getStartDateByTimeUnit)(new Date(minDate), minTimeUnit, startOfWeek),
|
|
33
33
|
this._gantt.parsedOptions._minDateTime = this._gantt.parsedOptions.minDate.getTime()),
|
|
34
|
+
needMinDate && !needMaxDate && (this._gantt.parsedOptions.maxDate = (0, util_1.getEndDateByTimeUnit)(this._gantt.parsedOptions.minDate, new Date(this._gantt.options.maxDate), minTimeUnit, step),
|
|
35
|
+
this._gantt.parsedOptions._maxDateTime = this._gantt.parsedOptions.maxDate.getTime()),
|
|
34
36
|
needMaxDate && (this._gantt.parsedOptions.maxDate = (0, util_1.getEndDateByTimeUnit)(this._gantt.parsedOptions.minDate, new Date(maxDate), minTimeUnit, step),
|
|
35
37
|
this._gantt.parsedOptions._maxDateTime = this._gantt.parsedOptions.maxDate.getTime());
|
|
36
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
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CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;aACvF;SACF;IACH,CAAC;IACD,UAAU,CAAC,OAAc;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF;AApHD,gCAoHC","file":"DataSource.js","sourcesContent":["import type { Gantt } from '../Gantt';\nimport {\n createDateAtLastHour,\n createDateAtLastMinute,\n createDateAtMidnight,\n getEndDateByTimeUnit,\n getStartDateByTimeUnit\n} from '../tools/util';\nimport { TasksShowMode } from '../ts-types';\nimport { isValid } from '@visactor/vutils';\nexport class DataSource {\n records: any[];\n _gantt: Gantt;\n constructor(_gantt: Gantt) {\n this._gantt = _gantt;\n this.records = _gantt.records;\n this.processRecords();\n }\n processRecords() {\n const needMinDate = !this._gantt.options.minDate;\n const needMaxDate = !this._gantt.options.maxDate;\n\n let minDate = Number.MAX_SAFE_INTEGER;\n let maxDate = Number.MIN_SAFE_INTEGER;\n if (\n (needMinDate ||\n needMaxDate ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) &&\n this.records.length\n ) {\n for (let i = 0; i < this.records.length; i++) {\n const record = this.records[i];\n if (needMinDate && record[this._gantt.parsedOptions.startDateField]) {\n const recordMinDate = createDateAtMidnight(record[this._gantt.parsedOptions.startDateField]);\n minDate = Math.min(minDate, recordMinDate.getTime());\n }\n if (needMaxDate && record[this._gantt.parsedOptions.endDateField]) {\n const recordMaxDate = createDateAtMidnight(record[this._gantt.parsedOptions.endDateField]);\n maxDate = Math.max(maxDate, recordMaxDate.getTime());\n }\n\n if (\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n // 将子任务按开始时间升序排列\n record.children &&\n record.children.sort((a: any, b: any) => {\n return (\n createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() -\n createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime()\n );\n });\n }\n }\n\n const { unit: minTimeUnit, startOfWeek, step } = this._gantt.parsedOptions.reverseSortedTimelineScales[0];\n if (needMinDate) {\n this._gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(minDate), minTimeUnit, startOfWeek);\n this._gantt.parsedOptions._minDateTime = this._gantt.parsedOptions.minDate.getTime();\n }\n if (needMaxDate) {\n this._gantt.parsedOptions.maxDate = getEndDateByTimeUnit(\n this._gantt.parsedOptions.minDate,\n new Date(maxDate),\n minTimeUnit,\n step\n );\n this._gantt.parsedOptions._maxDateTime = this._gantt.parsedOptions.maxDate.getTime();\n }\n }\n }\n adjustOrder(\n source_index: number,\n source_sub_task_index: number,\n target_index: number,\n target_sub_task_index: number\n ) {\n if (\n (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) &&\n source_index === target_index\n ) {\n return;\n }\n if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n if (\n isValid(source_sub_task_index) &&\n isValid(target_sub_task_index) &&\n isValid(source_index) &&\n isValid(target_index)\n ) {\n const sub_task_record = this.records[source_index].children[source_sub_task_index];\n this.records[source_index].children.splice(source_sub_task_index, 1);\n if (!this.records[target_index].children) {\n this.records[target_index].children = [];\n }\n this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);\n }\n this.records[target_index]?.children?.sort((a: any, b: any) => {\n return (\n createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() -\n createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime()\n );\n });\n } else {\n if (\n isValid(source_sub_task_index) &&\n isValid(target_sub_task_index) &&\n isValid(source_index) &&\n isValid(target_index)\n ) {\n const sub_task_record = this.records[source_index].children[source_sub_task_index];\n this.records[source_index].children.splice(source_sub_task_index, 1);\n if (!this.records[target_index].children) {\n this.records[target_index].children = [];\n }\n this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);\n }\n }\n }\n setRecords(records: any[]) {\n this.records = records;\n this.processRecords();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/data/DataSource.ts"],"names":[],"mappings":";;;AACA,wCAMuB;AACvB,0CAA4C;AAC5C,6CAA2C;AAC3C,MAAa,UAAU;IAGrB,YAAY,MAAa;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IACD,cAAc;QACZ,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QACjD,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QAEjD,IAAI,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACtC,IAAI,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACtC,IACE,CAAC,WAAW;YACV,WAAW;YACX,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,KAAK,wBAAa,CAAC,gBAAgB;YAC1E,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,KAAK,wBAAa,CAAC,iBAAiB,CAAC;YAC9E,IAAI,CAAC,OAAO,CAAC,MAAM,EACnB;YACA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,MAA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5E,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,IACE,IAAA,gBAAO,EAAC,qBAAqB,CAAC;gBAC9B,IAAA,gBAAO,EAAC,qBAAqB,CAAC;gBAC9B,IAAA,gBAAO,EAAC,YAAY,CAAC;gBACrB,IAAA,gBAAO,EAAC,YAAY,CAAC,EACrB;gBACA,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;gBACnF,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;gBACrE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;oBACxC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC;iBAC1C;gBACD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;aACvF;SACF;IACH,CAAC;IACD,UAAU,CAAC,OAAc;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF;AAhID,gCAgIC","file":"DataSource.js","sourcesContent":["import type { Gantt } from '../Gantt';\nimport {\n createDateAtLastHour,\n createDateAtLastMinute,\n createDateAtMidnight,\n getEndDateByTimeUnit,\n getStartDateByTimeUnit\n} from '../tools/util';\nimport { TasksShowMode } from '../ts-types';\nimport { isValid } from '@visactor/vutils';\nexport class DataSource {\n records: any[];\n _gantt: Gantt;\n constructor(_gantt: Gantt) {\n this._gantt = _gantt;\n this.records = _gantt.records;\n this.processRecords();\n }\n processRecords() {\n const needMinDate = !this._gantt.options.minDate;\n const needMaxDate = !this._gantt.options.maxDate;\n\n let minDate = Number.MAX_SAFE_INTEGER;\n let maxDate = Number.MIN_SAFE_INTEGER;\n if (\n (needMinDate ||\n needMaxDate ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) &&\n this.records.length\n ) {\n for (let i = 0; i < this.records.length; i++) {\n const record = this.records[i];\n if (needMinDate && record[this._gantt.parsedOptions.startDateField]) {\n const recordMinDate = createDateAtMidnight(record[this._gantt.parsedOptions.startDateField]);\n minDate = Math.min(minDate, recordMinDate.getTime());\n }\n if (needMaxDate && record[this._gantt.parsedOptions.endDateField]) {\n const recordMaxDate = createDateAtMidnight(record[this._gantt.parsedOptions.endDateField]);\n maxDate = Math.max(maxDate, recordMaxDate.getTime());\n }\n\n if (\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact\n ) {\n // 将子任务按开始时间升序排列\n record.children &&\n record.children.sort((a: any, b: any) => {\n return (\n createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() -\n createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime()\n );\n });\n }\n }\n\n const { unit: minTimeUnit, startOfWeek, step } = this._gantt.parsedOptions.reverseSortedTimelineScales[0];\n if (needMinDate) {\n this._gantt.parsedOptions.minDate = getStartDateByTimeUnit(new Date(minDate), minTimeUnit, startOfWeek);\n this._gantt.parsedOptions._minDateTime = this._gantt.parsedOptions.minDate.getTime();\n }\n\n // 提供了最大值,没有提供最小值,因为最大值依赖最小值,所以应该重新计算\n if (needMinDate && !needMaxDate) {\n this._gantt.parsedOptions.maxDate = getEndDateByTimeUnit(\n this._gantt.parsedOptions.minDate,\n new Date(this._gantt.options.maxDate),\n minTimeUnit,\n step\n );\n this._gantt.parsedOptions._maxDateTime = this._gantt.parsedOptions.maxDate.getTime();\n }\n\n if (needMaxDate) {\n this._gantt.parsedOptions.maxDate = getEndDateByTimeUnit(\n this._gantt.parsedOptions.minDate,\n new Date(maxDate),\n minTimeUnit,\n step\n );\n this._gantt.parsedOptions._maxDateTime = this._gantt.parsedOptions.maxDate.getTime();\n }\n }\n }\n adjustOrder(\n source_index: number,\n source_sub_task_index: number,\n target_index: number,\n target_sub_task_index: number\n ) {\n if (\n (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Arrange ||\n this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Compact) &&\n source_index === target_index\n ) {\n return;\n }\n if (this._gantt.parsedOptions.tasksShowMode === TasksShowMode.Sub_Tasks_Inline) {\n if (\n isValid(source_sub_task_index) &&\n isValid(target_sub_task_index) &&\n isValid(source_index) &&\n isValid(target_index)\n ) {\n const sub_task_record = this.records[source_index].children[source_sub_task_index];\n this.records[source_index].children.splice(source_sub_task_index, 1);\n if (!this.records[target_index].children) {\n this.records[target_index].children = [];\n }\n this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);\n }\n this.records[target_index]?.children?.sort((a: any, b: any) => {\n return (\n createDateAtMidnight(a[this._gantt.parsedOptions.startDateField]).getTime() -\n createDateAtMidnight(b[this._gantt.parsedOptions.startDateField]).getTime()\n );\n });\n } else {\n if (\n isValid(source_sub_task_index) &&\n isValid(target_sub_task_index) &&\n isValid(source_index) &&\n isValid(target_index)\n ) {\n const sub_task_record = this.records[source_index].children[source_sub_task_index];\n this.records[source_index].children.splice(source_sub_task_index, 1);\n if (!this.records[target_index].children) {\n this.records[target_index].children = [];\n }\n this.records[target_index].children.splice(target_sub_task_index, 0, sub_task_record);\n }\n }\n }\n setRecords(records: any[]) {\n this.records = records;\n this.processRecords();\n }\n}\n"]}
|
package/cjs/gantt-helper.js
CHANGED
|
@@ -72,7 +72,7 @@ function getVerticalScrollBarSize(scrollStyle) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function initOptions(gantt) {
|
|
75
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72;
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74;
|
|
76
76
|
const options = gantt.options;
|
|
77
77
|
gantt.parsedOptions.tasksShowMode = null !== (_a = null == options ? void 0 : options.tasksShowMode) && void 0 !== _a ? _a : ts_types_1.TasksShowMode.Tasks_Separate,
|
|
78
78
|
gantt.parsedOptions.pixelRatio = null !== (_b = null == options ? void 0 : options.pixelRatio) && void 0 !== _b ? _b : 1,
|
|
@@ -84,12 +84,12 @@ function initOptions(gantt) {
|
|
|
84
84
|
const {unit: minTimeUnit, startOfWeek: startOfWeek, step: step} = gantt.parsedOptions.reverseSortedTimelineScales[0];
|
|
85
85
|
gantt.parsedOptions.minDate = (null == options ? void 0 : options.minDate) ? (0,
|
|
86
86
|
util_1.getStartDateByTimeUnit)(new Date(options.minDate), minTimeUnit, startOfWeek) : void 0,
|
|
87
|
-
gantt.parsedOptions.maxDate = (null == options ? void 0 : options.maxDate) ? (0,
|
|
88
|
-
util_1.getEndDateByTimeUnit)(gantt.parsedOptions.minDate, new Date(options.maxDate), minTimeUnit, step) : void 0,
|
|
89
|
-
gantt.parsedOptions._minDateTime = null === (
|
|
90
|
-
gantt.parsedOptions._maxDateTime = null === (
|
|
91
|
-
gantt.parsedOptions.overscrollBehavior = null !== (
|
|
92
|
-
gantt.parsedOptions.underlayBackgroundColor = null !== (
|
|
87
|
+
gantt.parsedOptions.maxDate = (null == options ? void 0 : options.maxDate) && (null === (_m = gantt.parsedOptions) || void 0 === _m ? void 0 : _m.minDate) ? (0,
|
|
88
|
+
util_1.getEndDateByTimeUnit)(null === (_o = gantt.parsedOptions) || void 0 === _o ? void 0 : _o.minDate, new Date(options.maxDate), minTimeUnit, step) : void 0,
|
|
89
|
+
gantt.parsedOptions._minDateTime = null === (_p = gantt.parsedOptions.minDate) || void 0 === _p ? void 0 : _p.getTime(),
|
|
90
|
+
gantt.parsedOptions._maxDateTime = null === (_q = gantt.parsedOptions.maxDate) || void 0 === _q ? void 0 : _q.getTime(),
|
|
91
|
+
gantt.parsedOptions.overscrollBehavior = null !== (_r = null == options ? void 0 : options.overscrollBehavior) && void 0 !== _r ? _r : "auto",
|
|
92
|
+
gantt.parsedOptions.underlayBackgroundColor = null !== (_s = null == options ? void 0 : options.underlayBackgroundColor) && void 0 !== _s ? _s : "#FFF",
|
|
93
93
|
gantt.parsedOptions.scrollStyle = Object.assign({}, {
|
|
94
94
|
scrollRailColor: "rgba(100, 100, 100, 0.2)",
|
|
95
95
|
scrollSliderColor: "rgba(100, 100, 100, 0.5)",
|
|
@@ -98,11 +98,11 @@ function initOptions(gantt) {
|
|
|
98
98
|
visible: "always",
|
|
99
99
|
hoverOn: !0,
|
|
100
100
|
barToSide: !1
|
|
101
|
-
}, null == options ? void 0 : options.scrollStyle), gantt.parsedOptions.timelineHeaderHorizontalLineStyle = null === (
|
|
102
|
-
gantt.parsedOptions.timelineHeaderVerticalLineStyle = null === (
|
|
103
|
-
gantt.parsedOptions.timelineHeaderBackgroundColor = null === (
|
|
101
|
+
}, null == options ? void 0 : options.scrollStyle), gantt.parsedOptions.timelineHeaderHorizontalLineStyle = null === (_t = null == options ? void 0 : options.timelineHeader) || void 0 === _t ? void 0 : _t.horizontalLine,
|
|
102
|
+
gantt.parsedOptions.timelineHeaderVerticalLineStyle = null === (_u = null == options ? void 0 : options.timelineHeader) || void 0 === _u ? void 0 : _u.verticalLine,
|
|
103
|
+
gantt.parsedOptions.timelineHeaderBackgroundColor = null === (_v = null == options ? void 0 : options.timelineHeader) || void 0 === _v ? void 0 : _v.backgroundColor,
|
|
104
104
|
gantt.parsedOptions.timeLineHeaderRowHeights = [], gantt.parsedOptions.timelineHeaderStyles = [];
|
|
105
|
-
for (let i = 0; null !== (
|
|
105
|
+
for (let i = 0; null !== (_w = i < gantt.parsedOptions.sortedTimelineScales.length) && void 0 !== _w && _w; i++) {
|
|
106
106
|
const style = gantt.parsedOptions.sortedTimelineScales[i].style;
|
|
107
107
|
gantt.parsedOptions.timelineHeaderStyles.push(Object.assign({
|
|
108
108
|
fontSize: 20,
|
|
@@ -111,23 +111,23 @@ function initOptions(gantt) {
|
|
|
111
111
|
textBaseline: "middle",
|
|
112
112
|
color: "#000",
|
|
113
113
|
backgroundColor: "#fff"
|
|
114
|
-
}, style)), gantt.parsedOptions.timeLineHeaderRowHeights.push(null !== (
|
|
114
|
+
}, style)), gantt.parsedOptions.timeLineHeaderRowHeights.push(null !== (_y = null !== (_x = gantt.parsedOptions.sortedTimelineScales[i].rowHeight) && void 0 !== _x ? _x : null == options ? void 0 : options.headerRowHeight) && void 0 !== _y ? _y : 40);
|
|
115
115
|
}
|
|
116
116
|
gantt.parsedOptions.grid = Object.assign({}, null == options ? void 0 : options.grid),
|
|
117
|
-
setWidthToDefaultTaskBarStyle(3 * gantt.parsedOptions.rowHeight / 4), gantt.parsedOptions.taskBarStyle = (null === (
|
|
117
|
+
setWidthToDefaultTaskBarStyle(3 * gantt.parsedOptions.rowHeight / 4), gantt.parsedOptions.taskBarStyle = (null === (_z = null == options ? void 0 : options.taskBar) || void 0 === _z ? void 0 : _z.barStyle) && "function" == typeof (null === (_0 = null == options ? void 0 : options.taskBar) || void 0 === _0 ? void 0 : _0.barStyle) ? options.taskBar.barStyle : Object.assign({}, exports.defaultTaskBarStyle, null === (_1 = null == options ? void 0 : options.taskBar) || void 0 === _1 ? void 0 : _1.barStyle),
|
|
118
118
|
gantt.parsedOptions.taskBarMilestoneStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {} : {
|
|
119
119
|
width: gantt.parsedOptions.taskBarStyle.width,
|
|
120
120
|
borderColor: gantt.parsedOptions.taskBarStyle.borderColor,
|
|
121
|
-
borderLineWidth: null !== (
|
|
121
|
+
borderLineWidth: null !== (_2 = gantt.parsedOptions.taskBarStyle.borderLineWidth) && void 0 !== _2 ? _2 : 1,
|
|
122
122
|
fillColor: gantt.parsedOptions.taskBarStyle.barColor,
|
|
123
123
|
cornerRadius: 0
|
|
124
|
-
}, null === (
|
|
124
|
+
}, null === (_3 = null == options ? void 0 : options.taskBar) || void 0 === _3 ? void 0 : _3.milestoneStyle),
|
|
125
125
|
gantt.parsedOptions.taskBarMilestoneHypotenuse = gantt.parsedOptions.taskBarMilestoneStyle.width * Math.sqrt(2),
|
|
126
126
|
gantt.parsedOptions.dateFormat = null == options ? void 0 : options.dateFormat,
|
|
127
127
|
gantt.parsedOptions.taskBarHoverStyle = Object.assign({
|
|
128
128
|
barOverlayColor: "rgba(99, 144, 0, 0.4)"
|
|
129
|
-
}, null === (
|
|
130
|
-
gantt.parsedOptions.taskBarSelectable = null === (
|
|
129
|
+
}, null === (_4 = null == options ? void 0 : options.taskBar) || void 0 === _4 ? void 0 : _4.hoverBarStyle),
|
|
130
|
+
gantt.parsedOptions.taskBarSelectable = null === (_6 = null === (_5 = null == options ? void 0 : options.taskBar) || void 0 === _5 ? void 0 : _5.selectable) || void 0 === _6 || _6,
|
|
131
131
|
gantt.parsedOptions.taskBarSelectedStyle = Object.assign("function" == typeof gantt.parsedOptions.taskBarStyle ? {
|
|
132
132
|
shadowBlur: 6,
|
|
133
133
|
shadowOffsetX: 0,
|
|
@@ -140,81 +140,81 @@ function initOptions(gantt) {
|
|
|
140
140
|
shadowColor: gantt.parsedOptions.taskBarStyle.barColor,
|
|
141
141
|
borderColor: gantt.parsedOptions.taskBarStyle.barColor,
|
|
142
142
|
borderLineWidth: 1
|
|
143
|
-
}, null === (
|
|
144
|
-
gantt.parsedOptions.taskBarLabelText = null !== (
|
|
145
|
-
gantt.parsedOptions.taskBarMoveable = null === (
|
|
146
|
-
gantt.parsedOptions.moveTaskBarToExtendDateRange = null === (
|
|
147
|
-
gantt.parsedOptions.taskBarResizable = null === (
|
|
148
|
-
gantt.parsedOptions.taskBarDragOrder = null === (
|
|
143
|
+
}, null === (_7 = null == options ? void 0 : options.taskBar) || void 0 === _7 ? void 0 : _7.selectedBarStyle),
|
|
144
|
+
gantt.parsedOptions.taskBarLabelText = null !== (_9 = null === (_8 = null == options ? void 0 : options.taskBar) || void 0 === _8 ? void 0 : _8.labelText) && void 0 !== _9 ? _9 : "",
|
|
145
|
+
gantt.parsedOptions.taskBarMoveable = null === (_11 = null === (_10 = null == options ? void 0 : options.taskBar) || void 0 === _10 ? void 0 : _10.moveable) || void 0 === _11 || _11,
|
|
146
|
+
gantt.parsedOptions.moveTaskBarToExtendDateRange = null === (_13 = null === (_12 = null == options ? void 0 : options.taskBar) || void 0 === _12 ? void 0 : _12.moveToExtendDateRange) || void 0 === _13 || _13,
|
|
147
|
+
gantt.parsedOptions.taskBarResizable = null === (_15 = null === (_14 = null == options ? void 0 : options.taskBar) || void 0 === _14 ? void 0 : _14.resizable) || void 0 === _15 || _15,
|
|
148
|
+
gantt.parsedOptions.taskBarDragOrder = null === (_17 = null === (_16 = null == options ? void 0 : options.taskBar) || void 0 === _16 ? void 0 : _16.dragOrder) || void 0 === _17 || _17,
|
|
149
149
|
gantt.parsedOptions.taskBarLabelStyle = {
|
|
150
|
-
fontFamily: null !== (
|
|
151
|
-
fontSize: null !== (
|
|
152
|
-
color: null !== (
|
|
153
|
-
textAlign: null !== (
|
|
154
|
-
textBaseline: null !== (
|
|
155
|
-
padding: null !== (
|
|
156
|
-
textOverflow: null === (
|
|
157
|
-
}, gantt.parsedOptions.taskBarCustomLayout = null === (
|
|
158
|
-
gantt.parsedOptions.taskBarCreatable = null !== (
|
|
150
|
+
fontFamily: null !== (_20 = null === (_19 = null === (_18 = null == options ? void 0 : options.taskBar) || void 0 === _18 ? void 0 : _18.labelTextStyle) || void 0 === _19 ? void 0 : _19.fontFamily) && void 0 !== _20 ? _20 : "Arial",
|
|
151
|
+
fontSize: null !== (_23 = null === (_22 = null === (_21 = null == options ? void 0 : options.taskBar) || void 0 === _21 ? void 0 : _21.labelTextStyle) || void 0 === _22 ? void 0 : _22.fontSize) && void 0 !== _23 ? _23 : 20,
|
|
152
|
+
color: null !== (_26 = null === (_25 = null === (_24 = null == options ? void 0 : options.taskBar) || void 0 === _24 ? void 0 : _24.labelTextStyle) || void 0 === _25 ? void 0 : _25.color) && void 0 !== _26 ? _26 : "#F01",
|
|
153
|
+
textAlign: null !== (_29 = null === (_28 = null === (_27 = null == options ? void 0 : options.taskBar) || void 0 === _27 ? void 0 : _27.labelTextStyle) || void 0 === _28 ? void 0 : _28.textAlign) && void 0 !== _29 ? _29 : "left",
|
|
154
|
+
textBaseline: null !== (_32 = null === (_31 = null === (_30 = null == options ? void 0 : options.taskBar) || void 0 === _30 ? void 0 : _30.labelTextStyle) || void 0 === _31 ? void 0 : _31.textBaseline) && void 0 !== _32 ? _32 : "middle",
|
|
155
|
+
padding: null !== (_35 = null === (_34 = null === (_33 = null == options ? void 0 : options.taskBar) || void 0 === _33 ? void 0 : _33.labelTextStyle) || void 0 === _34 ? void 0 : _34.padding) && void 0 !== _35 ? _35 : [ 0, 0, 0, 10 ],
|
|
156
|
+
textOverflow: null === (_37 = null === (_36 = null == options ? void 0 : options.taskBar) || void 0 === _36 ? void 0 : _36.labelTextStyle) || void 0 === _37 ? void 0 : _37.textOverflow
|
|
157
|
+
}, gantt.parsedOptions.taskBarCustomLayout = null === (_38 = null == options ? void 0 : options.taskBar) || void 0 === _38 ? void 0 : _38.customLayout,
|
|
158
|
+
gantt.parsedOptions.taskBarCreatable = null !== (_40 = null === (_39 = null == options ? void 0 : options.taskBar) || void 0 === _39 ? void 0 : _39.scheduleCreatable) && void 0 !== _40 ? _40 : !(gantt.parsedOptions.tasksShowMode !== ts_types_1.TasksShowMode.Sub_Tasks_Separate && gantt.parsedOptions.tasksShowMode !== ts_types_1.TasksShowMode.Tasks_Separate),
|
|
159
159
|
gantt.parsedOptions.taskBarCreationButtonStyle = Object.assign({
|
|
160
160
|
lineColor: "rgb(99, 144, 0)",
|
|
161
161
|
lineWidth: 1,
|
|
162
162
|
lineDash: [ 5, 5 ],
|
|
163
163
|
cornerRadius: 4,
|
|
164
164
|
backgroundColor: "#FFF"
|
|
165
|
-
}, null === (
|
|
166
|
-
gantt.parsedOptions.taskBarCreationCustomLayout = null === (
|
|
167
|
-
gantt.parsedOptions.taskBarCreationMaxWidth = null === (
|
|
168
|
-
gantt.parsedOptions.taskBarCreationMinWidth = null === (
|
|
165
|
+
}, null === (_42 = null === (_41 = null == options ? void 0 : options.taskBar) || void 0 === _41 ? void 0 : _41.scheduleCreation) || void 0 === _42 ? void 0 : _42.buttonStyle),
|
|
166
|
+
gantt.parsedOptions.taskBarCreationCustomLayout = null === (_44 = null === (_43 = null == options ? void 0 : options.taskBar) || void 0 === _43 ? void 0 : _43.scheduleCreation) || void 0 === _44 ? void 0 : _44.customLayout,
|
|
167
|
+
gantt.parsedOptions.taskBarCreationMaxWidth = null === (_46 = null === (_45 = null == options ? void 0 : options.taskBar) || void 0 === _45 ? void 0 : _45.scheduleCreation) || void 0 === _46 ? void 0 : _46.maxWidth,
|
|
168
|
+
gantt.parsedOptions.taskBarCreationMinWidth = null === (_48 = null === (_47 = null == options ? void 0 : options.taskBar) || void 0 === _47 ? void 0 : _47.scheduleCreation) || void 0 === _48 ? void 0 : _48.minWidth,
|
|
169
169
|
gantt.parsedOptions.outerFrameStyle = Object.assign({
|
|
170
170
|
borderColor: "#e1e4e8",
|
|
171
171
|
borderLineWidth: 1,
|
|
172
172
|
cornerRadius: 4
|
|
173
|
-
}, null === (
|
|
173
|
+
}, null === (_49 = options.frame) || void 0 === _49 ? void 0 : _49.outerFrameStyle),
|
|
174
174
|
gantt.parsedOptions.markLine = generateMarkLine(null == options ? void 0 : options.markLine),
|
|
175
|
-
null !== (
|
|
176
|
-
(null === (
|
|
177
|
-
util_1.getStartDateByTimeUnit)(new Date(null === (
|
|
178
|
-
gantt.parsedOptions.verticalSplitLineHighlight = null === (
|
|
175
|
+
null !== (_51 = null === (_50 = gantt.parsedOptions.markLine) || void 0 === _50 ? void 0 : _50.length) && void 0 !== _51 && _51 && ((null === (_52 = gantt.parsedOptions.markLine) || void 0 === _52 ? void 0 : _52.every((item => void 0 === item.scrollToMarkLine))) && (gantt.parsedOptions.markLine[0].scrollToMarkLine = !0),
|
|
176
|
+
(null === (_53 = gantt.parsedOptions.markLine) || void 0 === _53 ? void 0 : _53.find((item => item.scrollToMarkLine))) && (gantt.parsedOptions.scrollToMarkLineDate = (0,
|
|
177
|
+
util_1.getStartDateByTimeUnit)(new Date(null === (_54 = gantt.parsedOptions.markLine) || void 0 === _54 ? void 0 : _54.find((item => item.scrollToMarkLine)).date), minTimeUnit, startOfWeek))),
|
|
178
|
+
gantt.parsedOptions.verticalSplitLineHighlight = null === (_55 = options.frame) || void 0 === _55 ? void 0 : _55.verticalSplitLineHighlight,
|
|
179
179
|
gantt.parsedOptions.verticalSplitLine = Object.assign({
|
|
180
|
-
lineColor: null === (
|
|
181
|
-
lineWidth: null === (
|
|
182
|
-
}, null === (
|
|
183
|
-
gantt.parsedOptions.horizontalSplitLine = null === (
|
|
184
|
-
gantt.parsedOptions.verticalSplitLineMoveable = null === (
|
|
185
|
-
gantt.parsedOptions.taskKeyField = null !== (
|
|
186
|
-
gantt.parsedOptions.dependencyLinks = null !== (
|
|
187
|
-
gantt.parsedOptions.dependencyLinkCreatable = null !== (
|
|
188
|
-
gantt.parsedOptions.dependencyLinkSelectable = null === (
|
|
189
|
-
gantt.parsedOptions.dependencyLinkDeletable = null !== (
|
|
180
|
+
lineColor: null === (_56 = gantt.parsedOptions.outerFrameStyle) || void 0 === _56 ? void 0 : _56.borderColor,
|
|
181
|
+
lineWidth: null === (_57 = gantt.parsedOptions.outerFrameStyle) || void 0 === _57 ? void 0 : _57.borderLineWidth
|
|
182
|
+
}, null === (_58 = options.frame) || void 0 === _58 ? void 0 : _58.verticalSplitLine),
|
|
183
|
+
gantt.parsedOptions.horizontalSplitLine = null === (_59 = options.frame) || void 0 === _59 ? void 0 : _59.horizontalSplitLine,
|
|
184
|
+
gantt.parsedOptions.verticalSplitLineMoveable = null === (_60 = options.frame) || void 0 === _60 ? void 0 : _60.verticalSplitLineMoveable,
|
|
185
|
+
gantt.parsedOptions.taskKeyField = null !== (_61 = options.taskKeyField) && void 0 !== _61 ? _61 : "id",
|
|
186
|
+
gantt.parsedOptions.dependencyLinks = null !== (_63 = null === (_62 = options.dependency) || void 0 === _62 ? void 0 : _62.links) && void 0 !== _63 ? _63 : [],
|
|
187
|
+
gantt.parsedOptions.dependencyLinkCreatable = null !== (_65 = null === (_64 = options.dependency) || void 0 === _64 ? void 0 : _64.linkCreatable) && void 0 !== _65 && _65,
|
|
188
|
+
gantt.parsedOptions.dependencyLinkSelectable = null === (_67 = null === (_66 = options.dependency) || void 0 === _66 ? void 0 : _66.linkSelectable) || void 0 === _67 || _67,
|
|
189
|
+
gantt.parsedOptions.dependencyLinkDeletable = null !== (_69 = null === (_68 = options.dependency) || void 0 === _68 ? void 0 : _68.linkDeletable) && void 0 !== _69 && _69,
|
|
190
190
|
gantt.parsedOptions.dependencyLinkLineStyle = Object.assign({
|
|
191
191
|
lineColor: "red",
|
|
192
192
|
lineWidth: 1
|
|
193
|
-
}, null === (
|
|
193
|
+
}, null === (_70 = options.dependency) || void 0 === _70 ? void 0 : _70.linkLineStyle),
|
|
194
194
|
gantt.parsedOptions.dependencyLinkSelectedLineStyle = Object.assign({
|
|
195
195
|
shadowBlur: 4,
|
|
196
196
|
shadowOffset: 0,
|
|
197
197
|
shadowColor: gantt.parsedOptions.dependencyLinkLineStyle.lineColor,
|
|
198
198
|
lineColor: gantt.parsedOptions.dependencyLinkLineStyle.lineColor,
|
|
199
199
|
lineWidth: gantt.parsedOptions.dependencyLinkLineStyle.lineWidth
|
|
200
|
-
}, null === (
|
|
200
|
+
}, null === (_71 = null == options ? void 0 : options.dependency) || void 0 === _71 ? void 0 : _71.linkSelectedLineStyle),
|
|
201
201
|
gantt.parsedOptions.dependencyLinkLineCreatePointStyle = Object.assign({
|
|
202
202
|
strokeColor: "red",
|
|
203
203
|
fillColor: "white",
|
|
204
204
|
radius: 5,
|
|
205
205
|
strokeWidth: 1
|
|
206
|
-
}, null === (
|
|
206
|
+
}, null === (_72 = null == options ? void 0 : options.dependency) || void 0 === _72 ? void 0 : _72.linkCreatePointStyle),
|
|
207
207
|
gantt.parsedOptions.dependencyLinkLineCreatingPointStyle = Object.assign({
|
|
208
208
|
strokeColor: "red",
|
|
209
209
|
fillColor: "red",
|
|
210
210
|
radius: 5,
|
|
211
211
|
strokeWidth: 1
|
|
212
|
-
}, null === (
|
|
212
|
+
}, null === (_73 = null == options ? void 0 : options.dependency) || void 0 === _73 ? void 0 : _73.linkCreatingPointStyle),
|
|
213
213
|
gantt.parsedOptions.dependencyLinkLineCreatingStyle = Object.assign({
|
|
214
214
|
lineColor: "red",
|
|
215
215
|
lineWidth: 1,
|
|
216
216
|
lineDash: [ 5, 5 ]
|
|
217
|
-
}, null === (
|
|
217
|
+
}, null === (_74 = null == options ? void 0 : options.dependency) || void 0 === _74 ? void 0 : _74.linkCreatingLineStyle),
|
|
218
218
|
gantt.parsedOptions.eventOptions = null == options ? void 0 : options.eventOptions,
|
|
219
219
|
gantt.parsedOptions.keyboardOptions = null == options ? void 0 : options.keyboardOptions,
|
|
220
220
|
gantt.parsedOptions.markLineCreateOptions = null == options ? void 0 : options.markLineCreateOptions;
|