@visactor/vtable-calendar 1.26.3-alpha.0 → 1.26.3

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.
@@ -39296,13 +39296,20 @@
39296
39296
  return parse$2(font);
39297
39297
  }
39298
39298
 
39299
- function getQuadProps(paddingOrigin) {
39299
+ function normalizeQuadArray(values) {
39300
+ return 0 === values.length ? [0, 0, 0, 0] : 1 === values.length ? [values[0], values[0], values[0], values[0]] : 2 === values.length ? [values[0], values[1], values[0], values[1]] : 3 === values.length ? [values[0], values[1], values[2], values[1]] : [values[0], values[1], values[2], values[3]];
39301
+ }
39302
+ function parseStringQuad(padding) {
39303
+ const tokens = padding.trim().split(/\s+/),
39304
+ values = tokens.map(token => Number.parseFloat(token)).filter(value => Number.isFinite(value));
39305
+ return values.length === tokens.length && values.length > 0 ? normalizeQuadArray(values) : [padding, padding, padding, padding];
39306
+ }
39307
+ function normalizePaddingObject(paddingOrigin) {
39300
39308
  var _a, _b, _c, _d;
39301
- if (isNumber$2(paddingOrigin) || isString$2(paddingOrigin) || isArray$5(paddingOrigin)) {
39302
- let padding = parsePadding(paddingOrigin);
39303
- return "number" == typeof padding || "string" == typeof padding ? padding = [padding, padding, padding, padding] : Array.isArray(padding) && (padding = padding.slice(0)), padding;
39304
- }
39305
- return paddingOrigin && (isFinite(paddingOrigin.bottom) || isFinite(paddingOrigin.left) || isFinite(paddingOrigin.right) || isFinite(paddingOrigin.top)) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
39309
+ return Number.isFinite(paddingOrigin.bottom) || Number.isFinite(paddingOrigin.left) || Number.isFinite(paddingOrigin.right) || Number.isFinite(paddingOrigin.top) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
39310
+ }
39311
+ function getQuadProps(paddingOrigin) {
39312
+ return Array.isArray(paddingOrigin) ? normalizeQuadArray(paddingOrigin.slice(0, 4)) : "number" == typeof paddingOrigin && Number.isFinite(paddingOrigin) ? [paddingOrigin, paddingOrigin, paddingOrigin, paddingOrigin] : "string" == typeof paddingOrigin ? parseStringQuad(paddingOrigin) : paddingOrigin && "object" == typeof paddingOrigin ? normalizePaddingObject(paddingOrigin) : [0, 0, 0, 0];
39306
39313
  }
39307
39314
 
39308
39315
  const TYPE_PAREN = 0,
@@ -40329,7 +40336,7 @@
40329
40336
  col: null !== (_b = null == range ? void 0 : range.start.col) && void 0 !== _b ? _b : col,
40330
40337
  row: null !== (_c = null == range ? void 0 : range.start.row) && void 0 !== _c ? _c : row,
40331
40338
  dataValue: table.getCellOriginValue(col, row),
40332
- value: table.getCellValue(col, row) || "",
40339
+ value: table.getCellValue(col, row),
40333
40340
  rect: {
40334
40341
  left: 0,
40335
40342
  top: 0,
@@ -40351,7 +40358,7 @@
40351
40358
  col: col,
40352
40359
  row: row,
40353
40360
  dataValue: table.getCellOriginValue(col, row),
40354
- value: table.getCellValue(col, row) || "",
40361
+ value: table.getCellValue(col, row),
40355
40362
  rect: {
40356
40363
  left: 0,
40357
40364
  top: 0,
@@ -42340,7 +42347,7 @@
42340
42347
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
42341
42348
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
42342
42349
  dataValue: table.getCellOriginValue(col, row),
42343
- value: table.getCellValue(col, row) || "",
42350
+ value: table.getCellValue(col, row),
42344
42351
  rect: getCellRect$1(col, row, table),
42345
42352
  table: table,
42346
42353
  originCol: col,
@@ -46521,7 +46528,7 @@
46521
46528
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
46522
46529
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
46523
46530
  dataValue: table.getCellOriginValue(col, row),
46524
- value: table.getCellValue(col, row) || "",
46531
+ value: table.getCellValue(col, row),
46525
46532
  rect: getCellRect(col, row, table),
46526
46533
  table: table,
46527
46534
  originCol: col,
@@ -48768,7 +48775,8 @@
48768
48775
  for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {
48769
48776
  insertBefore(rightFrozenGroup, scene.getColGroup(col), rightFrozenGroup.firstChild);
48770
48777
  insertBefore(rightTopCornerGroup, scene.getColGroup(col, !0), rightTopCornerGroup.firstChild);
48771
- insertBefore(rightBottomCornerGroup, scene.getColGroupInBottom(col), rightBottomCornerGroup.firstChild);
48778
+ const bottomColGroup = scene.getColGroupInBottom(col);
48779
+ bottomColGroup && insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
48772
48780
  }
48773
48781
  let x = 0;
48774
48782
  rightFrozenGroup.forEachChildren(columnGroup => {
@@ -48785,7 +48793,10 @@
48785
48793
  const headerColGroup = scene.getColGroupInRightTopCorner(col);
48786
48794
  headerColGroup.setAttribute("x", colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col)), colHeaderGroup.appendChild(headerColGroup);
48787
48795
  const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
48788
- bottomColGroup.setAttribute("x", bottomFrozenGroup.lastChild.attribute.x + table.getColWidth(bottomFrozenGroup.lastChild.col)), bottomFrozenGroup.appendChild(bottomColGroup);
48796
+ if (bottomColGroup) {
48797
+ const lastBottomColGroup = bottomFrozenGroup.lastChild;
48798
+ bottomColGroup.setAttribute("x", lastBottomColGroup ? lastBottomColGroup.attribute.x + table.getColWidth(lastBottomColGroup.col) : 0), bottomFrozenGroup.appendChild(bottomColGroup);
48799
+ }
48789
48800
  }
48790
48801
  let x = 0;
48791
48802
  rightFrozenGroup.forEachChildren(columnGroup => {
@@ -53274,70 +53285,73 @@
53274
53285
  });
53275
53286
  }), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
53276
53287
  var _a, _b, _c, _d, _e, _f, _g, _h;
53277
- if (0 === e.button) {
53278
- if ("grabing" === stateManager.interactionState) {
53279
- if (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()) endResizeCol(table);else if (stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
53280
- const endMoveColSuccess = table.stateManager.endMoveCol();
53281
- fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
53282
- } else if (stateManager.isSelecting()) {
53283
- table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
53284
- const eventArgsSet = getEventArgsSet(e);
53285
- if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
53286
- const cellsEvent = {
53287
- event: e.nativeEvent,
53288
- cells: [],
53289
- col: eventArgsSet.eventArgs.target.col,
53290
- row: eventArgsSet.eventArgs.target.row,
53291
- scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
53292
- target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
53293
- mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
53294
- };
53295
- cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
53296
- }
53297
- }
53298
- } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
53299
- if (!table.eventManager.isDraging) {
53288
+ if (0 !== e.button) return;
53289
+ const endedResizeCol = stateManager.isResizeCol(),
53290
+ endedResizeRow = stateManager.isResizeRow(),
53291
+ endedMoveCol = stateManager.isMoveCol(),
53292
+ shouldSkipClickCell = endedResizeCol || endedResizeRow;
53293
+ if ("grabing" === stateManager.interactionState) {
53294
+ if (stateManager.updateInteractionState(InteractionState.default), endedResizeCol) endResizeCol(table);else if (endedResizeRow) endResizeRow(table);else if (endedMoveCol) {
53295
+ const endMoveColSuccess = table.stateManager.endMoveCol();
53296
+ fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
53297
+ } else if (stateManager.isSelecting()) {
53298
+ table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
53300
53299
  const eventArgsSet = getEventArgsSet(e);
53301
- if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
53302
- const {
53303
- col: col,
53304
- row: row
53305
- } = eventArgsSet.eventArgs,
53306
- cellInfo = table.getCellInfo(col, row);
53307
- let icon, position;
53308
- if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
53309
- const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
53310
- iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
53311
- }
53312
- const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
53300
+ if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
53301
+ const cellsEvent = {
53313
53302
  event: e.nativeEvent,
53314
- federatedEvent: e,
53315
53303
  cells: [],
53316
- targetIcon: icon ? {
53317
- name: icon.name,
53318
- position: position,
53319
- funcType: icon.attribute.funcType
53320
- } : void 0,
53321
- target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
53322
- mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
53323
- });
53324
- table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
53304
+ col: eventArgsSet.eventArgs.target.col,
53305
+ row: eventArgsSet.eventArgs.target.row,
53306
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
53307
+ target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
53308
+ mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
53309
+ };
53310
+ cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
53325
53311
  }
53326
53312
  }
53327
- if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
53328
- const eventArgsSet = getEventArgsSet(e);
53329
- eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
53330
- col: eventArgsSet.eventArgs.col,
53331
- row: eventArgsSet.eventArgs.row,
53313
+ } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
53314
+ if (!table.eventManager.isDraging && !shouldSkipClickCell) {
53315
+ const eventArgsSet = getEventArgsSet(e);
53316
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
53317
+ const {
53318
+ col: col,
53319
+ row: row
53320
+ } = eventArgsSet.eventArgs,
53321
+ cellInfo = table.getCellInfo(col, row);
53322
+ let icon, position;
53323
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
53324
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
53325
+ iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
53326
+ }
53327
+ const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
53332
53328
  event: e.nativeEvent,
53333
- target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
53334
- mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
53329
+ federatedEvent: e,
53330
+ cells: [],
53331
+ targetIcon: icon ? {
53332
+ name: icon.name,
53333
+ position: position,
53334
+ funcType: icon.attribute.funcType
53335
+ } : void 0,
53336
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
53337
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
53335
53338
  });
53339
+ table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
53336
53340
  }
53337
- setTimeout(() => {
53338
- eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
53339
- }, 0);
53340
53341
  }
53342
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
53343
+ const eventArgsSet = getEventArgsSet(e);
53344
+ eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
53345
+ col: eventArgsSet.eventArgs.col,
53346
+ row: eventArgsSet.eventArgs.row,
53347
+ event: e.nativeEvent,
53348
+ target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
53349
+ mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
53350
+ });
53351
+ }
53352
+ setTimeout(() => {
53353
+ eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
53354
+ }, 0);
53341
53355
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
53342
53356
  var _a, _b, _c, _d, _e, _f, _g, _h;
53343
53357
  const eventArgsSet = getEventArgsSet(e);
@@ -57155,7 +57169,7 @@
57155
57169
  }
57156
57170
  constructor(container, options = {}) {
57157
57171
  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;
57158
- if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57172
+ if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57159
57173
  const g = window;
57160
57174
  g[this.id] = this;
57161
57175
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -59368,16 +59382,17 @@
59368
59382
  }
59369
59383
  scrollToRow(row, animationOption) {
59370
59384
  var _a;
59371
- const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
59385
+ const targetRow = Math.min(Math.max(row, 0), this.rowCount - 1),
59386
+ targetRowInt = Math.floor(targetRow);
59372
59387
  if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
59373
- row: targetRow
59374
- }), void this._scheduleScrollToRowCorrect(targetRow);
59388
+ row: targetRowInt
59389
+ }), void this._scheduleScrollToRowCorrect(targetRowInt);
59375
59390
  const duration = isBoolean$2(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
59376
59391
  this.animationManager.scrollTo({
59377
59392
  row: targetRow
59378
- }, animationOption), this._scrollToRowCorrectTimer = setTimeout(() => {
59379
- this.scrollToRow(targetRow, !1);
59380
- }, duration);
59393
+ }, animationOption), targetRowInt === targetRow && (this._scrollToRowCorrectTimer = setTimeout(() => {
59394
+ this.scrollToRow(targetRowInt, !1);
59395
+ }, duration));
59381
59396
  }
59382
59397
  scrollToCol(col, animationOption) {
59383
59398
  animationOption ? this.animationManager.scrollTo({