@leankylin-sheet/core 2.0.0 → 2.0.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/dist/index.esm.js CHANGED
@@ -62365,7 +62365,7 @@ var Canvas = /*#__PURE__*/function () {
62365
62365
  _startY2 = this.sheetCtx.visibledatarow[_r2 - 1] - scrollHeight - 1;
62366
62366
  }
62367
62367
  _endY2 = this.sheetCtx.visibledatarow[_r2 + mainCell.mc.rs - 1] - scrollHeight;
62368
- _endX2 = this.sheetCtx.visibledatacolumn[_c2 + mainCell.mc.cs - 1] - scrollWidth;
62368
+ _endX2 = Math.min(this.sheetCtx.visibledatacolumn[_c2 + mainCell.mc.cs - 1] - scrollWidth, drawWidth);
62369
62369
  if (_.isNil(_value3) || _value3.toString().length === 0) {
62370
62370
  this.nullCellRender(_r2, _c2, _startY2, _startX2, _endY2, _endX2, renderCtx, afCompute, cfCompute, offsetLeft, offsetTop, dynamicArrayCompute, cellOverflowMap, colStart, colEnd, scrollHeight, scrollWidth, bodrder05, true);
62371
62371
  } else {
@@ -63191,27 +63191,6 @@ var Canvas = /*#__PURE__*/function () {
63191
63191
  value: function drawFreezeLine(_ref2) {
63192
63192
  var horizontalTop = _ref2.horizontalTop,
63193
63193
  verticalLeft = _ref2.verticalLeft;
63194
- var renderCtx = this.canvasElement.getContext("2d");
63195
- if (!renderCtx) return;
63196
- renderCtx.save();
63197
- renderCtx.scale(this.sheetCtx.devicePixelRatio, this.sheetCtx.devicePixelRatio);
63198
- renderCtx.strokeStyle = "#ccc";
63199
- renderCtx.lineWidth = 2;
63200
- if (horizontalTop) {
63201
- renderCtx.beginPath();
63202
- renderCtx.moveTo(0, horizontalTop);
63203
- renderCtx.lineTo(this.canvasElement.width, horizontalTop);
63204
- renderCtx.stroke();
63205
- renderCtx.closePath();
63206
- }
63207
- if (verticalLeft) {
63208
- renderCtx.beginPath();
63209
- renderCtx.moveTo(verticalLeft, 0);
63210
- renderCtx.lineTo(verticalLeft, this.canvasElement.height);
63211
- renderCtx.stroke();
63212
- renderCtx.closePath();
63213
- }
63214
- renderCtx.restore();
63215
63194
  }
63216
63195
  }]);
63217
63196
  }();
@@ -66360,18 +66339,11 @@ function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
66360
66339
  var scrollLeft = scrollbarX.scrollLeft;
66361
66340
  var scrollTop = scrollbarY.scrollTop;
66362
66341
  if (e.deltaY !== 0) {
66363
- if (e.deltaY > 0) {
66364
- scrollTop += 20 * ctx.zoomRatio;
66365
- } else {
66366
- scrollTop -= 20 * ctx.zoomRatio;
66367
- }
66342
+ scrollTop += e.deltaY * ctx.zoomRatio;
66368
66343
  scrollbarY.scrollTop = scrollTop;
66369
- } else if (e.deltaX !== 0) {
66370
- if (e.deltaX > 0) {
66371
- scrollLeft += 20 * ctx.zoomRatio;
66372
- } else {
66373
- scrollLeft -= 20 * ctx.zoomRatio;
66374
- }
66344
+ }
66345
+ if (e.deltaX !== 0) {
66346
+ scrollLeft += e.deltaX * ctx.zoomRatio;
66375
66347
  scrollbarX.scrollLeft = scrollLeft;
66376
66348
  }
66377
66349
  e.preventDefault();
package/dist/index.js CHANGED
@@ -62375,7 +62375,7 @@ var Canvas = /*#__PURE__*/function () {
62375
62375
  _startY2 = this.sheetCtx.visibledatarow[_r2 - 1] - scrollHeight - 1;
62376
62376
  }
62377
62377
  _endY2 = this.sheetCtx.visibledatarow[_r2 + mainCell.mc.rs - 1] - scrollHeight;
62378
- _endX2 = this.sheetCtx.visibledatacolumn[_c2 + mainCell.mc.cs - 1] - scrollWidth;
62378
+ _endX2 = Math.min(this.sheetCtx.visibledatacolumn[_c2 + mainCell.mc.cs - 1] - scrollWidth, drawWidth);
62379
62379
  if (___default['default'].isNil(_value3) || _value3.toString().length === 0) {
62380
62380
  this.nullCellRender(_r2, _c2, _startY2, _startX2, _endY2, _endX2, renderCtx, afCompute, cfCompute, offsetLeft, offsetTop, dynamicArrayCompute, cellOverflowMap, colStart, colEnd, scrollHeight, scrollWidth, bodrder05, true);
62381
62381
  } else {
@@ -63201,27 +63201,6 @@ var Canvas = /*#__PURE__*/function () {
63201
63201
  value: function drawFreezeLine(_ref2) {
63202
63202
  var horizontalTop = _ref2.horizontalTop,
63203
63203
  verticalLeft = _ref2.verticalLeft;
63204
- var renderCtx = this.canvasElement.getContext("2d");
63205
- if (!renderCtx) return;
63206
- renderCtx.save();
63207
- renderCtx.scale(this.sheetCtx.devicePixelRatio, this.sheetCtx.devicePixelRatio);
63208
- renderCtx.strokeStyle = "#ccc";
63209
- renderCtx.lineWidth = 2;
63210
- if (horizontalTop) {
63211
- renderCtx.beginPath();
63212
- renderCtx.moveTo(0, horizontalTop);
63213
- renderCtx.lineTo(this.canvasElement.width, horizontalTop);
63214
- renderCtx.stroke();
63215
- renderCtx.closePath();
63216
- }
63217
- if (verticalLeft) {
63218
- renderCtx.beginPath();
63219
- renderCtx.moveTo(verticalLeft, 0);
63220
- renderCtx.lineTo(verticalLeft, this.canvasElement.height);
63221
- renderCtx.stroke();
63222
- renderCtx.closePath();
63223
- }
63224
- renderCtx.restore();
63225
63204
  }
63226
63205
  }]);
63227
63206
  }();
@@ -66370,18 +66349,11 @@ function handleGlobalWheel(ctx, e, cache, scrollbarX, scrollbarY) {
66370
66349
  var scrollLeft = scrollbarX.scrollLeft;
66371
66350
  var scrollTop = scrollbarY.scrollTop;
66372
66351
  if (e.deltaY !== 0) {
66373
- if (e.deltaY > 0) {
66374
- scrollTop += 20 * ctx.zoomRatio;
66375
- } else {
66376
- scrollTop -= 20 * ctx.zoomRatio;
66377
- }
66352
+ scrollTop += e.deltaY * ctx.zoomRatio;
66378
66353
  scrollbarY.scrollTop = scrollTop;
66379
- } else if (e.deltaX !== 0) {
66380
- if (e.deltaX > 0) {
66381
- scrollLeft += 20 * ctx.zoomRatio;
66382
- } else {
66383
- scrollLeft -= 20 * ctx.zoomRatio;
66384
- }
66354
+ }
66355
+ if (e.deltaX !== 0) {
66356
+ scrollLeft += e.deltaX * ctx.zoomRatio;
66385
66357
  scrollbarX.scrollLeft = scrollLeft;
66386
66358
  }
66387
66359
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "repository": "http://114.55.85.79:19999/leankylin-front/leankylin-sheet",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@leankylin-sheet/formula-parser": "^2.0.0",
13
+ "@leankylin-sheet/formula-parser": "^2.0.2",
14
14
  "dayjs": "^1.11.0",
15
15
  "immer": "^9.0.12",
16
16
  "lodash": "^4.17.21",