@visactor/vtable-gantt 1.10.0 → 1.10.1

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.10.0";
8
+ export declare const version = "1.10.1";
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.10.0";
55
+ exports.VTable = VTable, exports.version = "1.10.1";
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,QAAQ,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.10.0\";\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,QAAQ,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.10.1\";\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"]}
@@ -29299,6 +29299,12 @@
29299
29299
  var _a;
29300
29300
  return (null == scrollStyle ? void 0 : scrollStyle.hoverOn) || (null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && "none" === (null == scrollStyle ? void 0 : scrollStyle.verticalVisible) || !(null == scrollStyle ? void 0 : scrollStyle.verticalVisible) && "none" === (null == scrollStyle ? void 0 : scrollStyle.visible) ? 0 : null !== (_a = null == scrollStyle ? void 0 : scrollStyle.width) && void 0 !== _a ? _a : 7;
29301
29301
  }
29302
+ function isValidStyle(style) {
29303
+ return !!isValid$1(style) && (!isArray$1(style) || style.some(s => isValid$1(s)));
29304
+ }
29305
+ function isZeroStyle(style) {
29306
+ return 0 === style || isArray$1(style) && style.every(s => 0 === s);
29307
+ }
29302
29308
 
29303
29309
  const judgeType$2 = value => {
29304
29310
  switch (Object.prototype.toString.call(value)) {
@@ -34011,7 +34017,7 @@
34011
34017
  function getCellBorderStrokeWidth(col, row, cellTheme, table) {
34012
34018
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
34013
34019
  let strokeArrayWidth = null !== (_b = null === (_a = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _a ? void 0 : _a.strokeArrayWidth) && void 0 !== _b ? _b : void 0;
34014
- return table.theme.cellInnerBorder || (0 === col && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_c = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _c ? void 0 : _c.lineWidth, null === (_d = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _d ? void 0 : _d.lineWidth, null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.lineWidth, null === (_f = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _f ? void 0 : _f.lineWidth], strokeArrayWidth[3] = 0), col === table.colCount - 1 && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.lineWidth, null === (_h = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _h ? void 0 : _h.lineWidth, null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.lineWidth, null === (_k = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _k ? void 0 : _k.lineWidth], strokeArrayWidth[1] = 0), 0 === row && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.lineWidth, null === (_m = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _m ? void 0 : _m.lineWidth, null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.lineWidth, null === (_p = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _p ? void 0 : _p.lineWidth], strokeArrayWidth[0] = 0), row === table.rowCount - 1 && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.lineWidth, null === (_r = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _r ? void 0 : _r.lineWidth, null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.lineWidth, null === (_t = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _t ? void 0 : _t.lineWidth], strokeArrayWidth[2] = 0)), strokeArrayWidth;
34020
+ return table.theme.cellInnerBorder || !isValidStyle(table.theme.frameStyle.borderLineWidth) || isZeroStyle(table.theme.frameStyle.borderLineWidth) || (0 === col && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_c = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _c ? void 0 : _c.lineWidth, null === (_d = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _d ? void 0 : _d.lineWidth, null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.lineWidth, null === (_f = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _f ? void 0 : _f.lineWidth], strokeArrayWidth[3] = 0), col === table.colCount - 1 && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.lineWidth, null === (_h = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _h ? void 0 : _h.lineWidth, null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.lineWidth, null === (_k = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _k ? void 0 : _k.lineWidth], strokeArrayWidth[1] = 0), 0 === row && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.lineWidth, null === (_m = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _m ? void 0 : _m.lineWidth, null === (_o = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _o ? void 0 : _o.lineWidth, null === (_p = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _p ? void 0 : _p.lineWidth], strokeArrayWidth[0] = 0), row === table.rowCount - 1 && (strokeArrayWidth = null != strokeArrayWidth ? strokeArrayWidth : [null === (_q = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _q ? void 0 : _q.lineWidth, null === (_r = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _r ? void 0 : _r.lineWidth, null === (_s = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _s ? void 0 : _s.lineWidth, null === (_t = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _t ? void 0 : _t.lineWidth], strokeArrayWidth[2] = 0)), strokeArrayWidth;
34015
34021
  }
34016
34022
 
34017
34023
  class CellContent extends Group$1 {
@@ -42831,15 +42837,16 @@
42831
42837
  }), seled;
42832
42838
  }
42833
42839
  setSortState(sortState) {
42840
+ const state = this;
42834
42841
  const sort = (sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState]) && sortState.reduce((prev, item) => {
42835
- var _a;
42842
+ var _a, _b, _c;
42836
42843
  const column = null === (_a = function (columns) {
42837
42844
  const result = [];
42838
42845
  return function flatten(cols) {
42839
42846
  let parentStartIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
42840
42847
  cols.forEach(col => {
42841
42848
  var _a;
42842
- const startIndex = null !== (_a = col.startInTotal) && void 0 !== _a ? _a : parentStartIndex;
42849
+ const startIndex = col.startInTotal ? null !== (_a = col.startInTotal + state.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _a ? _a : 0 : parentStartIndex;
42843
42850
  col.columns ? flatten(col.columns, startIndex) : result.push(Object.assign(Object.assign({}, col), {
42844
42851
  startIndex: startIndex
42845
42852
  }));
@@ -42849,12 +42856,12 @@
42849
42856
  return this.table.internalProps.transpose ? prev.push({
42850
42857
  field: item.field,
42851
42858
  order: item.order,
42852
- row: column.startInTotal,
42859
+ row: null !== (_b = column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _b ? _b : 0,
42853
42860
  col: column.level
42854
42861
  }) : prev.push({
42855
42862
  field: item.field,
42856
42863
  order: item.order,
42857
- col: column.startInTotal,
42864
+ col: null !== (_c = column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _c ? _c : 0,
42858
42865
  row: column.level
42859
42866
  }), prev;
42860
42867
  }, []);
@@ -43270,7 +43277,7 @@
43270
43277
  });
43271
43278
  }
43272
43279
  updateSortState(sortState) {
43273
- var _a, _b, _c, _d, _e, _f, _g;
43280
+ var _a, _b, _c, _d, _e, _f, _g, _h;
43274
43281
  sortState = Array.isArray(sortState) ? sortState : [sortState];
43275
43282
  for (let index = 0; index < sortState.length; index++) {
43276
43283
  if (sortState[index].field === (null === (_a = this.sort[index]) || void 0 === _a ? void 0 : _a.field) && sortState[sortState.length - 1].order === (null === (_b = this.sort[index]) || void 0 === _b ? void 0 : _b.order)) return;
@@ -43303,7 +43310,7 @@
43303
43310
  row: null,
43304
43311
  iconMark: null,
43305
43312
  order: null,
43306
- oldSortCol: column.startInTotal,
43313
+ oldSortCol: null !== (_h = column.startInTotal + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount) && void 0 !== _h ? _h : 0,
43307
43314
  oldSortRow: column.level,
43308
43315
  oldIconMark: null
43309
43316
  });
@@ -44976,7 +44983,7 @@
44976
44983
  function importStyle$1() {
44977
44984
  if ("node" === Env.mode) return;
44978
44985
  const styleElement = document.createElement("style");
44979
- styleElement.id = "vtable-menu-styleSheet", styleElement.textContent = "\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n max-height: 100%;\n overflow-y: scroll;\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n", document.head.appendChild(styleElement);
44986
+ styleElement.id = "vtable-menu-styleSheet", styleElement.textContent = "\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n max-height: 100%;\n overflow-y: auto;\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n", document.head.appendChild(styleElement);
44980
44987
  }
44981
44988
 
44982
44989
  importStyle$1();
@@ -47174,7 +47181,7 @@
47174
47181
  constructor(container) {
47175
47182
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47176
47183
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
47177
- if (super(), this.showFrozenIcon = !0, this.version = "1.10.0", 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");
47184
+ if (super(), this.showFrozenIcon = !0, this.version = "1.10.1", 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");
47178
47185
  const {
47179
47186
  frozenColCount = 0,
47180
47187
  frozenRowCount: frozenRowCount,
@@ -56987,7 +56994,7 @@
56987
56994
  themes: themes$1
56988
56995
  });
56989
56996
 
56990
- const version = "1.10.0";
56997
+ const version = "1.10.1";
56991
56998
 
56992
56999
  exports.Gantt = Gantt;
56993
57000
  exports.TYPES = index$2;