@cj-tech-master/excelts 5.0.5 → 5.0.6

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.
@@ -282,6 +282,20 @@ class Worksheet {
282
282
  }
283
283
  // account for defined names
284
284
  this.workbook.definedNames.spliceColumns(this.name, start, count, inserts.length);
285
+ // account for images
286
+ if (nExpand !== 0) {
287
+ for (const image of this._media) {
288
+ if (image.type === "image" && image.range) {
289
+ const { tl, br } = image.range;
290
+ if (tl && tl.nativeCol >= start - 1) {
291
+ tl.nativeCol = Math.max(0, tl.nativeCol + nExpand);
292
+ }
293
+ if (br && br.nativeCol >= start - 1) {
294
+ br.nativeCol = Math.max(0, br.nativeCol + nExpand);
295
+ }
296
+ }
297
+ }
298
+ }
285
299
  }
286
300
  /**
287
301
  * Get the last column in a worksheet
@@ -535,6 +549,20 @@ class Worksheet {
535
549
  }
536
550
  // account for defined names
537
551
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
552
+ // account for images
553
+ if (nExpand !== 0) {
554
+ for (const image of this._media) {
555
+ if (image.type === "image" && image.range) {
556
+ const { tl, br } = image.range;
557
+ if (tl && tl.nativeRow >= start - 1) {
558
+ tl.nativeRow = Math.max(0, tl.nativeRow + nExpand);
559
+ }
560
+ if (br && br.nativeRow >= start - 1) {
561
+ br.nativeRow = Math.max(0, br.nativeRow + nExpand);
562
+ }
563
+ }
564
+ }
565
+ }
538
566
  }
539
567
  eachRow(optOrCallback, maybeCallback) {
540
568
  let options;
@@ -285,6 +285,20 @@ class Worksheet {
285
285
  }
286
286
  // account for defined names
287
287
  this.workbook.definedNames.spliceColumns(this.name, start, count, inserts.length);
288
+ // account for images
289
+ if (nExpand !== 0) {
290
+ for (const image of this._media) {
291
+ if (image.type === "image" && image.range) {
292
+ const { tl, br } = image.range;
293
+ if (tl && tl.nativeCol >= start - 1) {
294
+ tl.nativeCol = Math.max(0, tl.nativeCol + nExpand);
295
+ }
296
+ if (br && br.nativeCol >= start - 1) {
297
+ br.nativeCol = Math.max(0, br.nativeCol + nExpand);
298
+ }
299
+ }
300
+ }
301
+ }
288
302
  }
289
303
  /**
290
304
  * Get the last column in a worksheet
@@ -538,6 +552,20 @@ class Worksheet {
538
552
  }
539
553
  // account for defined names
540
554
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
555
+ // account for images
556
+ if (nExpand !== 0) {
557
+ for (const image of this._media) {
558
+ if (image.type === "image" && image.range) {
559
+ const { tl, br } = image.range;
560
+ if (tl && tl.nativeRow >= start - 1) {
561
+ tl.nativeRow = Math.max(0, tl.nativeRow + nExpand);
562
+ }
563
+ if (br && br.nativeRow >= start - 1) {
564
+ br.nativeRow = Math.max(0, br.nativeRow + nExpand);
565
+ }
566
+ }
567
+ }
568
+ }
541
569
  }
542
570
  eachRow(optOrCallback, maybeCallback) {
543
571
  let options;
@@ -282,6 +282,20 @@ class Worksheet {
282
282
  }
283
283
  // account for defined names
284
284
  this.workbook.definedNames.spliceColumns(this.name, start, count, inserts.length);
285
+ // account for images
286
+ if (nExpand !== 0) {
287
+ for (const image of this._media) {
288
+ if (image.type === "image" && image.range) {
289
+ const { tl, br } = image.range;
290
+ if (tl && tl.nativeCol >= start - 1) {
291
+ tl.nativeCol = Math.max(0, tl.nativeCol + nExpand);
292
+ }
293
+ if (br && br.nativeCol >= start - 1) {
294
+ br.nativeCol = Math.max(0, br.nativeCol + nExpand);
295
+ }
296
+ }
297
+ }
298
+ }
285
299
  }
286
300
  /**
287
301
  * Get the last column in a worksheet
@@ -535,6 +549,20 @@ class Worksheet {
535
549
  }
536
550
  // account for defined names
537
551
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
552
+ // account for images
553
+ if (nExpand !== 0) {
554
+ for (const image of this._media) {
555
+ if (image.type === "image" && image.range) {
556
+ const { tl, br } = image.range;
557
+ if (tl && tl.nativeRow >= start - 1) {
558
+ tl.nativeRow = Math.max(0, tl.nativeRow + nExpand);
559
+ }
560
+ if (br && br.nativeRow >= start - 1) {
561
+ br.nativeRow = Math.max(0, br.nativeRow + nExpand);
562
+ }
563
+ }
564
+ }
565
+ }
538
566
  }
539
567
  eachRow(optOrCallback, maybeCallback) {
540
568
  let options;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v5.0.5
2
+ * @cj-tech-master/excelts v5.0.6
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2026 cjnoname
5
5
  * Released under the MIT License
@@ -5758,6 +5758,13 @@ var ExcelTS = (function(exports) {
5758
5758
  else if (nExpand > 0) for (let i = nEnd; i >= nKeep; i--) this.getColumn(i + nExpand).defn = this.getColumn(i).defn;
5759
5759
  for (let i = start; i < start + inserts.length; i++) this.getColumn(i).defn = void 0;
5760
5760
  this.workbook.definedNames.spliceColumns(this.name, start, count, inserts.length);
5761
+ if (nExpand !== 0) {
5762
+ for (const image of this._media) if (image.type === "image" && image.range) {
5763
+ const { tl, br } = image.range;
5764
+ if (tl && tl.nativeCol >= start - 1) tl.nativeCol = Math.max(0, tl.nativeCol + nExpand);
5765
+ if (br && br.nativeCol >= start - 1) br.nativeCol = Math.max(0, br.nativeCol + nExpand);
5766
+ }
5767
+ }
5761
5768
  }
5762
5769
  /**
5763
5770
  * Get the last column in a worksheet
@@ -5959,6 +5966,13 @@ var ExcelTS = (function(exports) {
5959
5966
  rDst.values = inserts[i];
5960
5967
  }
5961
5968
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
5969
+ if (nExpand !== 0) {
5970
+ for (const image of this._media) if (image.type === "image" && image.range) {
5971
+ const { tl, br } = image.range;
5972
+ if (tl && tl.nativeRow >= start - 1) tl.nativeRow = Math.max(0, tl.nativeRow + nExpand);
5973
+ if (br && br.nativeRow >= start - 1) br.nativeRow = Math.max(0, br.nativeRow + nExpand);
5974
+ }
5975
+ }
5962
5976
  }
5963
5977
  eachRow(optOrCallback, maybeCallback) {
5964
5978
  let options;