@visactor/vtable-gantt 1.17.1-alpha.4 → 1.17.1-alpha.7

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/index.d.ts CHANGED
@@ -5,5 +5,5 @@ import { Gantt } from './Gantt';
5
5
  import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
- export declare const version = "1.17.1-alpha.4";
8
+ export declare const version = "1.17.1-alpha.7";
9
9
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable };
package/cjs/index.js CHANGED
@@ -52,5 +52,5 @@ exports.VRender = VRender;
52
52
 
53
53
  const VTable = __importStar(require("./vtable"));
54
54
 
55
- exports.VTable = VTable, exports.version = "1.17.1-alpha.4";
55
+ exports.VTable = VTable, exports.version = "1.17.1-alpha.7";
56
56
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,gBAAgB,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';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nexport const version = \"1.17.1-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 VRender,\n VTable\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAuBlC,sBAAK;AATP,mCAAgC;AAW9B,sFAXO,aAAK,OAWP;AAVP,+CAAiC;AAsB/B,sBAAK;AArBP,mDAAqC;AAsBnC,0BAAO;AArBT,iDAAmC;AAsBjC,wBAAM;AArBK,QAAA,OAAO,GAAG,gBAAgB,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';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nexport const version = \"1.17.1-alpha.7\";\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 VRender,\n VTable\n};\n"]}
@@ -33,4 +33,5 @@ class Inertia {
33
33
  }
34
34
  }
35
35
 
36
- exports.Inertia = Inertia;
36
+ exports.Inertia = Inertia;
37
+ //# sourceMappingURL=inertia.js.map
@@ -11,5 +11,4 @@ Object.defineProperty(exports, "__esModule", {
11
11
  TasksShowMode.Tasks_Separate = "tasks_separate", TasksShowMode.Sub_Tasks_Inline = "sub_tasks_inline",
12
12
  TasksShowMode.Sub_Tasks_Separate = "sub_tasks_separate", TasksShowMode.Sub_Tasks_Arrange = "sub_tasks_arrange",
13
13
  TasksShowMode.Sub_Tasks_Compact = "sub_tasks_compact";
14
- }(TasksShowMode = exports.TasksShowMode || (exports.TasksShowMode = {}));
15
- //# sourceMappingURL=gantt-engine.js.map
14
+ }(TasksShowMode = exports.TasksShowMode || (exports.TasksShowMode = {}));
@@ -41907,12 +41907,12 @@
41907
41907
  isWidthNumber = !Array.isArray(strokeArrayWidth),
41908
41908
  isStrokeTrue = !Array.isArray(stroke),
41909
41909
  isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
41910
- context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
41910
+ context.stroke(), context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
41911
41911
  const {
41912
41912
  lineDash = groupAttribute.lineDash
41913
41913
  } = group.attribute;
41914
41914
  let isDash = !1;
41915
- lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.moveTo(x, y);
41915
+ lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.beginPath(), context.moveTo(x, y);
41916
41916
  const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]),
41917
41917
  strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]),
41918
41918
  strokeBottom = (isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2]),
@@ -41933,7 +41933,7 @@
41933
41933
  isWidthNumber ? widthInfo.width : strokeArrayWidth[3], isWidthNumber ? widthInfo.width : strokeArrayWidth[3];
41934
41934
  context.moveTo(x1, y1), context.lineTo(x2, y2), (isSplitDraw || isDash) && (strokeArrayColor && strokeArrayColor[3] ? context.strokeStyle = strokeArrayColor[3] : strokeArrayColor && !strokeArrayColor[3] && (context.strokeStyle = "transparent"), isWidthNumber || (context.lineWidth = strokeArrayWidth[3]), context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, isDash && context.setLineDash(null !== (_d = lineDash[3]) && void 0 !== _d ? _d : []), context.stroke(), context.beginPath(), context.moveTo(x, y));
41935
41935
  } else 3 === i && context.moveTo(x, y);
41936
- isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.closePath();
41936
+ context.closePath(), isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.beginPath();
41937
41937
  }
41938
41938
 
41939
41939
  var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -43914,7 +43914,7 @@
43914
43914
  }
43915
43915
 
43916
43916
  function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
43917
- var _a, _b, _c, _d, _e, _f, _g, _h;
43917
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
43918
43918
  let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
43919
43919
  if ((null === (_b = scene.table.stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length) > 1) isHasFillHandleRect = !1, scene.removeFillHandleFromSelectComponents();else if (1 === (null === (_c = scene.table.stateManager.select.ranges) || void 0 === _c ? void 0 : _c.length)) {
43920
43920
  const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
@@ -43940,7 +43940,8 @@
43940
43940
  y: firstCellBound.y1 - scene.tableGroup.attribute.y,
43941
43941
  width: 0,
43942
43942
  height: 0,
43943
- visible: !0
43943
+ visible: !0,
43944
+ cornerRadius: getCornerRadius(selectRangeType, null === (_j = scene.table.theme.frameStyle) || void 0 === _j ? void 0 : _j.cornerRadius, start_Col, start_Row, end_Col, end_Row, scene.table)
43944
43945
  });
43945
43946
  let fillhandle;
43946
43947
  isHasFillHandleRect && (fillhandle = createRect({
@@ -43958,6 +43959,15 @@
43958
43959
  role: selectRangeType
43959
43960
  }), scene.tableGroup.insertAfter(rect, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup), isHasFillHandleRect && scene.tableGroup.insertAfter(fillhandle, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup);
43960
43961
  }
43962
+ function getCornerRadius(selectRangeType, cornerRadius, start_Col, start_Row, end_Col, end_Row, table) {
43963
+ if (!cornerRadius) return;
43964
+ const cornerRadiusArray = Array.isArray(cornerRadius) ? cornerRadius : [cornerRadius, cornerRadius, cornerRadius, cornerRadius],
43965
+ tableEndCol = table.colCount - 1,
43966
+ tableEndRow = table.rowCount - 1,
43967
+ result = [0, 0, 0, 0];
43968
+ let changed = !1;
43969
+ return 0 === start_Col && 0 === start_Row ? (result[0] = cornerRadiusArray[0], changed = !0) : end_Col === tableEndCol && end_Row === tableEndRow ? (result[2] = cornerRadiusArray[2], changed = !0) : 0 === start_Col && end_Row === tableEndRow ? (result[3] = cornerRadiusArray[3], changed = !0) : end_Col === tableEndCol && 0 === start_Row && (result[1] = cornerRadiusArray[1], changed = !0), changed ? result : void 0;
43970
+ }
43961
43971
 
43962
43972
  function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
43963
43973
  scene.selectingRangeComponents.forEach((rangeComponent, key) => {
@@ -46834,14 +46844,7 @@
46834
46844
  if (recordIndex >= 0) {
46835
46845
  const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
46836
46846
  if (isValid$3(null === (_b = state.checkedState.get(dataIndex)) || void 0 === _b ? void 0 : _b[field])) return state.checkedState.get(dataIndex)[field];
46837
- if (state.checkedState.has(dataIndex)) state.checkedState.get(dataIndex)[field] = checked;else if (dataIndex.includes(",")) {
46838
- const parentDataIndex = dataIndex.split(",").slice(0, -1).join(",");
46839
- state.checkedState.has(parentDataIndex) && !0 === state.checkedState.get(parentDataIndex)[field] ? state.checkedState.set(dataIndex, {
46840
- [field]: !0
46841
- }) : state.checkedState.set(dataIndex, {
46842
- [field]: checked
46843
- });
46844
- } else state.checkedState.set(dataIndex, {
46847
+ state.checkedState.has(dataIndex) ? state.checkedState.get(dataIndex)[field] = checked : state.checkedState.set(dataIndex, {
46845
46848
  [field]: checked
46846
46849
  });
46847
46850
  }
@@ -49065,7 +49068,7 @@
49065
49068
 
49066
49069
  function bindGroupTitleCheckboxChange(table) {
49067
49070
  table.on("checkbox_state_change", args => {
49068
- var _a, _b;
49071
+ var _a;
49069
49072
  if (!0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
49070
49073
  const {
49071
49074
  col: col,
@@ -49076,7 +49079,7 @@
49076
49079
  indexedData = table.dataSource.currentPagerIndexedData,
49077
49080
  titleShowIndex = table.getRecordShowIndexByCell(col, row);
49078
49081
  let titleIndex = indexedData[titleShowIndex];
49079
- if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length)) {
49082
+ if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge) {
49080
49083
  if (checked) table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
49081
49084
  table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
49082
49085
  const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
@@ -49114,23 +49117,8 @@
49114
49117
  key = currentIndex.toString(),
49115
49118
  currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
49116
49119
  let start = !1;
49117
- const result = [],
49118
- keys = Array.from(checkedState.keys()).sort((a, b) => {
49119
- var _a, _b;
49120
- const aArr = a.split(","),
49121
- bArr = b.split(","),
49122
- maxLength = Math.max(aArr.length, bArr.length);
49123
- for (let i = 0; i < maxLength; i++) {
49124
- const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
49125
- b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
49126
- if (a !== b) return a - b;
49127
- }
49128
- return 0;
49129
- }),
49130
- stateArr = keys.map(key => checkedState.get(key));
49131
- if (stateArr.forEach((state, i) => {
49132
- const index = keys[i],
49133
- value = state;
49120
+ const result = [];
49121
+ if (checkedState.forEach((value, index) => {
49134
49122
  if (start) {
49135
49123
  index.split(",").length === currentIndexLength ? start = !1 : result.push(value._vtable_rowSeries_number);
49136
49124
  }
@@ -51961,7 +51949,7 @@
51961
51949
  constructor(container) {
51962
51950
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
51963
51951
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
51964
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.1-alpha.4", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
51952
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.1-alpha.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
51965
51953
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
51966
51954
  const {
51967
51955
  frozenColCount = 0,
@@ -57090,18 +57078,7 @@
57090
57078
  }
57091
57079
  getCheckboxState(field) {
57092
57080
  if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
57093
- let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => {
57094
- var _a, _b;
57095
- const aArr = a.split(","),
57096
- bArr = b.split(","),
57097
- maxLength = Math.max(aArr.length, bArr.length);
57098
- for (let i = 0; i < maxLength; i++) {
57099
- const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
57100
- b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
57101
- if (a !== b) return a - b;
57102
- }
57103
- return 0;
57104
- }).map(key => this.stateManager.checkedState.get(key));
57081
+ let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => Number(a) - Number(b)).map(key => this.stateManager.checkedState.get(key));
57105
57082
  return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state[field]);
57106
57083
  }
57107
57084
  return new Array(...this.stateManager.checkedState.values());
@@ -64871,7 +64848,7 @@
64871
64848
  themes: themes$1
64872
64849
  });
64873
64850
 
64874
- const version = "1.17.1-alpha.4";
64851
+ const version = "1.17.1-alpha.7";
64875
64852
 
64876
64853
  exports.Gantt = Gantt;
64877
64854
  exports.TYPES = index$3;