@revolist/revogrid 3.7.4 → 3.7.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.
@@ -388,11 +388,12 @@ class SelectionStoreConnector {
388
388
  this.setEdit('');
389
389
  }
390
390
  beforeNextFocusCell(focus) {
391
+ var _a;
391
392
  if (!this.focusedStore) {
392
393
  return;
393
394
  }
394
395
  const nextStore = this.checkNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
395
- nextStore.store.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
396
+ (_a = nextStore.store) === null || _a === void 0 ? void 0 : _a.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
396
397
  }
397
398
  checkNextStore(focus, currentStorePointer, lastCell) {
398
399
  // item in new store
@@ -614,10 +615,12 @@ class ColumnService {
614
615
  const copyColLength = d.oldProps.length;
615
616
  const copyFrom = this.copyRangeArray(d.oldRange, d.oldProps, this.dataStore);
616
617
  const copyRowLength = copyFrom.length;
618
+ const mapping = {};
617
619
  // rows
618
620
  for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
619
621
  // copy original data link
620
622
  const copyRow = copyFrom[i % copyRowLength];
623
+ const oldRowIndex = d.oldRange.y + (i % copyRowLength);
621
624
  // columns
622
625
  for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
623
626
  // check if old range area
@@ -625,6 +628,8 @@ class ColumnService {
625
628
  continue;
626
629
  }
627
630
  const p = this.columns[colIndex].prop;
631
+ const copyColIndex = d.oldRange.x + (j % copyColLength);
632
+ const copyColumnProp = this.columns[copyColIndex].prop;
628
633
  const currentCol = j % copyColLength;
629
634
  /** if can write */
630
635
  if (!this.isReadOnly(rowIndex, colIndex)) {
@@ -633,10 +638,22 @@ class ColumnService {
633
638
  changed[rowIndex] = {};
634
639
  }
635
640
  changed[rowIndex][p] = copyRow[currentCol];
641
+ /** Generate mapping object */
642
+ if (!mapping[rowIndex]) {
643
+ mapping[rowIndex] = {};
644
+ }
645
+ mapping[rowIndex][p] = {
646
+ colIndex: copyColIndex,
647
+ colProp: copyColumnProp,
648
+ rowIndex: oldRowIndex,
649
+ };
636
650
  }
637
651
  }
638
652
  }
639
- return changed;
653
+ return {
654
+ changed,
655
+ mapping,
656
+ };
640
657
  }
641
658
  getTransformedDataToApply(start, data) {
642
659
  const changed = {};
@@ -396,8 +396,11 @@ class AutoFillService {
396
396
  oldRange,
397
397
  newProps: slice_1(columns, newRange.x, newRange.x1 + 1).map(v => v.prop),
398
398
  oldProps: slice_1(columns, oldRange.x, oldRange.x1 + 1).map(v => v.prop),
399
+ mapping: {},
399
400
  };
400
- rangeData.newData = this.sv.columnService.getRangeData(rangeData);
401
+ const changesOnRange = this.sv.columnService.getRangeData(rangeData);
402
+ rangeData.newData = changesOnRange.changed;
403
+ rangeData.mapping = changesOnRange.mapping;
401
404
  const selectionEndEvent = this.sv.internalSelectionChanged(rangeData);
402
405
  if (selectionEndEvent.defaultPrevented) {
403
406
  this.sv.setTempRange(null);
@@ -7042,11 +7042,12 @@ class SelectionStoreConnector {
7042
7042
  this.setEdit('');
7043
7043
  }
7044
7044
  beforeNextFocusCell(focus) {
7045
+ var _a;
7045
7046
  if (!this.focusedStore) {
7046
7047
  return;
7047
7048
  }
7048
7049
  const nextStore = this.checkNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
7049
- nextStore.store.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
7050
+ (_a = nextStore.store) === null || _a === void 0 ? void 0 : _a.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
7050
7051
  }
7051
7052
  checkNextStore(focus, currentStorePointer, lastCell) {
7052
7053
  // item in new store
@@ -25670,10 +25671,12 @@ class ColumnService {
25670
25671
  const copyColLength = d.oldProps.length;
25671
25672
  const copyFrom = this.copyRangeArray(d.oldRange, d.oldProps, this.dataStore);
25672
25673
  const copyRowLength = copyFrom.length;
25674
+ const mapping = {};
25673
25675
  // rows
25674
25676
  for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
25675
25677
  // copy original data link
25676
25678
  const copyRow = copyFrom[i % copyRowLength];
25679
+ const oldRowIndex = d.oldRange.y + (i % copyRowLength);
25677
25680
  // columns
25678
25681
  for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
25679
25682
  // check if old range area
@@ -25681,6 +25684,8 @@ class ColumnService {
25681
25684
  continue;
25682
25685
  }
25683
25686
  const p = this.columns[colIndex].prop;
25687
+ const copyColIndex = d.oldRange.x + (j % copyColLength);
25688
+ const copyColumnProp = this.columns[copyColIndex].prop;
25684
25689
  const currentCol = j % copyColLength;
25685
25690
  /** if can write */
25686
25691
  if (!this.isReadOnly(rowIndex, colIndex)) {
@@ -25689,10 +25694,22 @@ class ColumnService {
25689
25694
  changed[rowIndex] = {};
25690
25695
  }
25691
25696
  changed[rowIndex][p] = copyRow[currentCol];
25697
+ /** Generate mapping object */
25698
+ if (!mapping[rowIndex]) {
25699
+ mapping[rowIndex] = {};
25700
+ }
25701
+ mapping[rowIndex][p] = {
25702
+ colIndex: copyColIndex,
25703
+ colProp: copyColumnProp,
25704
+ rowIndex: oldRowIndex,
25705
+ };
25692
25706
  }
25693
25707
  }
25694
25708
  }
25695
- return changed;
25709
+ return {
25710
+ changed,
25711
+ mapping,
25712
+ };
25696
25713
  }
25697
25714
  getTransformedDataToApply(start, data) {
25698
25715
  const changed = {};
@@ -27472,8 +27489,11 @@ class AutoFillService {
27472
27489
  oldRange,
27473
27490
  newProps: slice_1(columns, newRange.x, newRange.x1 + 1).map(v => v.prop),
27474
27491
  oldProps: slice_1(columns, oldRange.x, oldRange.x1 + 1).map(v => v.prop),
27492
+ mapping: {},
27475
27493
  };
27476
- rangeData.newData = this.sv.columnService.getRangeData(rangeData);
27494
+ const changesOnRange = this.sv.columnService.getRangeData(rangeData);
27495
+ rangeData.newData = changesOnRange.changed;
27496
+ rangeData.mapping = changesOnRange.mapping;
27477
27497
  const selectionEndEvent = this.sv.internalSelectionChanged(rangeData);
27478
27498
  if (selectionEndEvent.defaultPrevented) {
27479
27499
  this.sv.setTempRange(null);
@@ -132,10 +132,12 @@ export default class ColumnService {
132
132
  const copyColLength = d.oldProps.length;
133
133
  const copyFrom = this.copyRangeArray(d.oldRange, d.oldProps, this.dataStore);
134
134
  const copyRowLength = copyFrom.length;
135
+ const mapping = {};
135
136
  // rows
136
137
  for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
137
138
  // copy original data link
138
139
  const copyRow = copyFrom[i % copyRowLength];
140
+ const oldRowIndex = d.oldRange.y + (i % copyRowLength);
139
141
  // columns
140
142
  for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
141
143
  // check if old range area
@@ -143,6 +145,8 @@ export default class ColumnService {
143
145
  continue;
144
146
  }
145
147
  const p = this.columns[colIndex].prop;
148
+ const copyColIndex = d.oldRange.x + (j % copyColLength);
149
+ const copyColumnProp = this.columns[copyColIndex].prop;
146
150
  const currentCol = j % copyColLength;
147
151
  /** if can write */
148
152
  if (!this.isReadOnly(rowIndex, colIndex)) {
@@ -151,10 +155,22 @@ export default class ColumnService {
151
155
  changed[rowIndex] = {};
152
156
  }
153
157
  changed[rowIndex][p] = copyRow[currentCol];
158
+ /** Generate mapping object */
159
+ if (!mapping[rowIndex]) {
160
+ mapping[rowIndex] = {};
161
+ }
162
+ mapping[rowIndex][p] = {
163
+ colIndex: copyColIndex,
164
+ colProp: copyColumnProp,
165
+ rowIndex: oldRowIndex,
166
+ };
154
167
  }
155
168
  }
156
169
  }
157
- return changed;
170
+ return {
171
+ changed,
172
+ mapping,
173
+ };
158
174
  }
159
175
  getTransformedDataToApply(start, data) {
160
176
  const changed = {};
@@ -156,8 +156,11 @@ export class AutoFillService {
156
156
  oldRange,
157
157
  newProps: slice(columns, newRange.x, newRange.x1 + 1).map(v => v.prop),
158
158
  oldProps: slice(columns, oldRange.x, oldRange.x1 + 1).map(v => v.prop),
159
+ mapping: {},
159
160
  };
160
- rangeData.newData = this.sv.columnService.getRangeData(rangeData);
161
+ const changesOnRange = this.sv.columnService.getRangeData(rangeData);
162
+ rangeData.newData = changesOnRange.changed;
163
+ rangeData.mapping = changesOnRange.mapping;
161
164
  const selectionEndEvent = this.sv.internalSelectionChanged(rangeData);
162
165
  if (selectionEndEvent.defaultPrevented) {
163
166
  this.sv.setTempRange(null);
@@ -699,7 +699,7 @@ export class OverlaySelection {
699
699
  },
700
700
  "complexType": {
701
701
  "original": "Selection.ChangedRange",
702
- "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; }",
702
+ "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; mapping: OldNewRangeMapping; }",
703
703
  "references": {
704
704
  "Selection": {
705
705
  "location": "import",
@@ -1190,7 +1190,7 @@ export class RevoGridComponent {
1190
1190
  },
1191
1191
  "complexType": {
1192
1192
  "original": "Selection.ChangedRange",
1193
- "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; }",
1193
+ "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; mapping: OldNewRangeMapping; }",
1194
1194
  "references": {
1195
1195
  "Selection": {
1196
1196
  "location": "import",
@@ -1210,7 +1210,7 @@ export class RevoGridComponent {
1210
1210
  },
1211
1211
  "complexType": {
1212
1212
  "original": "Selection.ChangedRange",
1213
- "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; }",
1213
+ "resolved": "{ type: DimensionRows; newRange: RangeArea; oldRange: RangeArea; newProps: ColumnProp[]; oldProps: ColumnProp[]; newData: { [key: number]: DataType; }; mapping: OldNewRangeMapping; }",
1214
1214
  "references": {
1215
1215
  "Selection": {
1216
1216
  "location": "import",
@@ -133,11 +133,12 @@ export default class SelectionStoreConnector {
133
133
  this.setEdit('');
134
134
  }
135
135
  beforeNextFocusCell(focus) {
136
+ var _a;
136
137
  if (!this.focusedStore) {
137
138
  return;
138
139
  }
139
140
  const nextStore = this.checkNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
140
- nextStore.store.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
141
+ (_a = nextStore.store) === null || _a === void 0 ? void 0 : _a.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
141
142
  }
142
143
  checkNextStore(focus, currentStorePointer, lastCell) {
143
144
  // item in new store
@@ -7038,11 +7038,12 @@ class SelectionStoreConnector {
7038
7038
  this.setEdit('');
7039
7039
  }
7040
7040
  beforeNextFocusCell(focus) {
7041
+ var _a;
7041
7042
  if (!this.focusedStore) {
7042
7043
  return;
7043
7044
  }
7044
7045
  const nextStore = this.checkNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
7045
- nextStore.store.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
7046
+ (_a = nextStore.store) === null || _a === void 0 ? void 0 : _a.nextFocus(Object.assign(Object.assign({}, focus), nextStore.item));
7046
7047
  }
7047
7048
  checkNextStore(focus, currentStorePointer, lastCell) {
7048
7049
  // item in new store
@@ -25666,10 +25667,12 @@ class ColumnService {
25666
25667
  const copyColLength = d.oldProps.length;
25667
25668
  const copyFrom = this.copyRangeArray(d.oldRange, d.oldProps, this.dataStore);
25668
25669
  const copyRowLength = copyFrom.length;
25670
+ const mapping = {};
25669
25671
  // rows
25670
25672
  for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
25671
25673
  // copy original data link
25672
25674
  const copyRow = copyFrom[i % copyRowLength];
25675
+ const oldRowIndex = d.oldRange.y + (i % copyRowLength);
25673
25676
  // columns
25674
25677
  for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
25675
25678
  // check if old range area
@@ -25677,6 +25680,8 @@ class ColumnService {
25677
25680
  continue;
25678
25681
  }
25679
25682
  const p = this.columns[colIndex].prop;
25683
+ const copyColIndex = d.oldRange.x + (j % copyColLength);
25684
+ const copyColumnProp = this.columns[copyColIndex].prop;
25680
25685
  const currentCol = j % copyColLength;
25681
25686
  /** if can write */
25682
25687
  if (!this.isReadOnly(rowIndex, colIndex)) {
@@ -25685,10 +25690,22 @@ class ColumnService {
25685
25690
  changed[rowIndex] = {};
25686
25691
  }
25687
25692
  changed[rowIndex][p] = copyRow[currentCol];
25693
+ /** Generate mapping object */
25694
+ if (!mapping[rowIndex]) {
25695
+ mapping[rowIndex] = {};
25696
+ }
25697
+ mapping[rowIndex][p] = {
25698
+ colIndex: copyColIndex,
25699
+ colProp: copyColumnProp,
25700
+ rowIndex: oldRowIndex,
25701
+ };
25688
25702
  }
25689
25703
  }
25690
25704
  }
25691
- return changed;
25705
+ return {
25706
+ changed,
25707
+ mapping,
25708
+ };
25692
25709
  }
25693
25710
  getTransformedDataToApply(start, data) {
25694
25711
  const changed = {};
@@ -27468,8 +27485,11 @@ class AutoFillService {
27468
27485
  oldRange,
27469
27486
  newProps: slice_1(columns, newRange.x, newRange.x1 + 1).map(v => v.prop),
27470
27487
  oldProps: slice_1(columns, oldRange.x, oldRange.x1 + 1).map(v => v.prop),
27488
+ mapping: {},
27471
27489
  };
27472
- rangeData.newData = this.sv.columnService.getRangeData(rangeData);
27490
+ const changesOnRange = this.sv.columnService.getRangeData(rangeData);
27491
+ rangeData.newData = changesOnRange.changed;
27492
+ rangeData.mapping = changesOnRange.mapping;
27473
27493
  const selectionEndEvent = this.sv.internalSelectionChanged(rangeData);
27474
27494
  if (selectionEndEvent.defaultPrevented) {
27475
27495
  this.sv.setTempRange(null);