@visactor/vtable-calendar 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.
@@ -37386,12 +37386,12 @@
37386
37386
  isWidthNumber = !Array.isArray(strokeArrayWidth),
37387
37387
  isStrokeTrue = !Array.isArray(stroke),
37388
37388
  isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
37389
- context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37389
+ context.stroke(), context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37390
37390
  const {
37391
37391
  lineDash = groupAttribute.lineDash
37392
37392
  } = group.attribute;
37393
37393
  let isDash = !1;
37394
- lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.moveTo(x, y);
37394
+ lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.beginPath(), context.moveTo(x, y);
37395
37395
  const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]),
37396
37396
  strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]),
37397
37397
  strokeBottom = (isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2]),
@@ -37412,7 +37412,7 @@
37412
37412
  isWidthNumber ? widthInfo.width : strokeArrayWidth[3], isWidthNumber ? widthInfo.width : strokeArrayWidth[3];
37413
37413
  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));
37414
37414
  } else 3 === i && context.moveTo(x, y);
37415
- isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.closePath();
37415
+ context.closePath(), isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.beginPath();
37416
37416
  }
37417
37417
 
37418
37418
  var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -39393,7 +39393,7 @@
39393
39393
  }
39394
39394
 
39395
39395
  function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
39396
- var _a, _b, _c, _d, _e, _f, _g, _h;
39396
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39397
39397
  let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
39398
39398
  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)) {
39399
39399
  const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
@@ -39419,7 +39419,8 @@
39419
39419
  y: firstCellBound.y1 - scene.tableGroup.attribute.y,
39420
39420
  width: 0,
39421
39421
  height: 0,
39422
- visible: !0
39422
+ visible: !0,
39423
+ 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)
39423
39424
  });
39424
39425
  let fillhandle;
39425
39426
  isHasFillHandleRect && (fillhandle = createRect({
@@ -39437,6 +39438,15 @@
39437
39438
  role: selectRangeType
39438
39439
  }), 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);
39439
39440
  }
39441
+ function getCornerRadius(selectRangeType, cornerRadius, start_Col, start_Row, end_Col, end_Row, table) {
39442
+ if (!cornerRadius) return;
39443
+ const cornerRadiusArray = Array.isArray(cornerRadius) ? cornerRadius : [cornerRadius, cornerRadius, cornerRadius, cornerRadius],
39444
+ tableEndCol = table.colCount - 1,
39445
+ tableEndRow = table.rowCount - 1,
39446
+ result = [0, 0, 0, 0];
39447
+ let changed = !1;
39448
+ 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;
39449
+ }
39440
39450
 
39441
39451
  function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
39442
39452
  scene.selectingRangeComponents.forEach((rangeComponent, key) => {
@@ -42313,14 +42323,7 @@
42313
42323
  if (recordIndex >= 0) {
42314
42324
  const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
42315
42325
  if (isValid$3(null === (_b = state.checkedState.get(dataIndex)) || void 0 === _b ? void 0 : _b[field])) return state.checkedState.get(dataIndex)[field];
42316
- if (state.checkedState.has(dataIndex)) state.checkedState.get(dataIndex)[field] = checked;else if (dataIndex.includes(",")) {
42317
- const parentDataIndex = dataIndex.split(",").slice(0, -1).join(",");
42318
- state.checkedState.has(parentDataIndex) && !0 === state.checkedState.get(parentDataIndex)[field] ? state.checkedState.set(dataIndex, {
42319
- [field]: !0
42320
- }) : state.checkedState.set(dataIndex, {
42321
- [field]: checked
42322
- });
42323
- } else state.checkedState.set(dataIndex, {
42326
+ state.checkedState.has(dataIndex) ? state.checkedState.get(dataIndex)[field] = checked : state.checkedState.set(dataIndex, {
42324
42327
  [field]: checked
42325
42328
  });
42326
42329
  }
@@ -44544,7 +44547,7 @@
44544
44547
 
44545
44548
  function bindGroupTitleCheckboxChange(table) {
44546
44549
  table.on("checkbox_state_change", args => {
44547
- var _a, _b;
44550
+ var _a;
44548
44551
  if (!0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
44549
44552
  const {
44550
44553
  col: col,
@@ -44555,7 +44558,7 @@
44555
44558
  indexedData = table.dataSource.currentPagerIndexedData,
44556
44559
  titleShowIndex = table.getRecordShowIndexByCell(col, row);
44557
44560
  let titleIndex = indexedData[titleShowIndex];
44558
- if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length)) {
44561
+ if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge) {
44559
44562
  if (checked) table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
44560
44563
  table.getHierarchyState(col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
44561
44564
  const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
@@ -44593,23 +44596,8 @@
44593
44596
  key = currentIndex.toString(),
44594
44597
  currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
44595
44598
  let start = !1;
44596
- const result = [],
44597
- keys = Array.from(checkedState.keys()).sort((a, b) => {
44598
- var _a, _b;
44599
- const aArr = a.split(","),
44600
- bArr = b.split(","),
44601
- maxLength = Math.max(aArr.length, bArr.length);
44602
- for (let i = 0; i < maxLength; i++) {
44603
- const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
44604
- b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
44605
- if (a !== b) return a - b;
44606
- }
44607
- return 0;
44608
- }),
44609
- stateArr = keys.map(key => checkedState.get(key));
44610
- if (stateArr.forEach((state, i) => {
44611
- const index = keys[i],
44612
- value = state;
44599
+ const result = [];
44600
+ if (checkedState.forEach((value, index) => {
44613
44601
  if (start) {
44614
44602
  index.split(",").length === currentIndexLength ? start = !1 : result.push(value._vtable_rowSeries_number);
44615
44603
  }
@@ -47440,7 +47428,7 @@
47440
47428
  constructor(container) {
47441
47429
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47442
47430
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
47443
- 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");
47431
+ 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");
47444
47432
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
47445
47433
  const {
47446
47434
  frozenColCount = 0,
@@ -52533,18 +52521,7 @@
52533
52521
  }
52534
52522
  getCheckboxState(field) {
52535
52523
  if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
52536
- let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => {
52537
- var _a, _b;
52538
- const aArr = a.split(","),
52539
- bArr = b.split(","),
52540
- maxLength = Math.max(aArr.length, bArr.length);
52541
- for (let i = 0; i < maxLength; i++) {
52542
- const a = null !== (_a = Number(aArr[i])) && void 0 !== _a ? _a : 0,
52543
- b = null !== (_b = Number(bArr[i])) && void 0 !== _b ? _b : 0;
52544
- if (a !== b) return a - b;
52545
- }
52546
- return 0;
52547
- }).map(key => this.stateManager.checkedState.get(key));
52524
+ let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => Number(a) - Number(b)).map(key => this.stateManager.checkedState.get(key));
52548
52525
  return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state[field]);
52549
52526
  }
52550
52527
  return new Array(...this.stateManager.checkedState.values());