@revolist/revogrid 4.2.0-next.14 → 4.2.0-next.15

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.
@@ -234,26 +234,29 @@ var sortedIndex_1 = sortedIndex;
234
234
 
235
235
  /**
236
236
  * Pre-calculation
237
- * Dimension sizes for each cell
237
+ * Dimension custom sizes for each cell
238
+ * Keeps only changed sizes, skips origin size
238
239
  */
239
240
  function calculateDimensionData(originItemSize, newSizes = {}) {
240
241
  const positionIndexes = [];
241
242
  const positionIndexToItem = {};
242
243
  const indexToItem = {};
243
- // combine all sizes
244
+ // combine all new sizes
244
245
  const sizes = Object.assign({}, newSizes);
245
246
  // prepare order sorted new sizes and calculate changed real size
246
247
  let newIndexes = [];
247
- each(newSizes, (_, index) => {
248
- newIndexes[sortedIndex_1(newIndexes, parseInt(index, 10))] = parseInt(index, 10);
248
+ each(newSizes, (_, i) => {
249
+ const index = parseInt(i, 10);
250
+ newIndexes[sortedIndex_1(newIndexes, index)] = index;
249
251
  });
250
- // fill new coordinates
252
+ // fill new coordinates based on what is changed
251
253
  reduce_1(newIndexes, (previous, itemIndex, i) => {
252
254
  const newItem = {
253
255
  itemIndex,
254
256
  start: 0,
255
257
  end: 0,
256
258
  };
259
+ // if previous item was changed too
257
260
  if (previous) {
258
261
  const itemsBetween = (itemIndex - previous.itemIndex - 1) * originItemSize;
259
262
  newItem.start = itemsBetween + previous.end;
@@ -624,6 +624,10 @@ function initialBase() {
624
624
  return {
625
625
  indexes: [],
626
626
  count: 0,
627
+ // plugin support
628
+ trimmed: {},
629
+ // size operations, this provider stores only changed sizes, not all of them
630
+ // same as indexes but for sizes and positions
627
631
  // item index to size
628
632
  sizes: {},
629
633
  // order in indexes[] to coordinate
@@ -631,7 +635,6 @@ function initialBase() {
631
635
  // initial element to coordinate ^
632
636
  indexToItem: {},
633
637
  positionIndexes: [],
634
- trimmed: {}
635
638
  };
636
639
  }
637
640
  function initialState() {
@@ -665,6 +668,11 @@ class DimensionStore {
665
668
  drop() {
666
669
  setStore(this.store, initialBase());
667
670
  }
671
+ /**
672
+ * Set custom dimension sizes and overwrite old
673
+ * Generates new indexes based on sizes
674
+ * @param sizes - sizes to set
675
+ */
668
676
  setDimensionSize(sizes) {
669
677
  const dimensionData = calculateDimensionData(this.store.get('originItemSize'), sizes);
670
678
  setStore(this.store, dimensionData);
@@ -672,6 +680,10 @@ class DimensionStore {
672
680
  }
673
681
  }
674
682
 
683
+ /**
684
+ * Dimension provider
685
+ * Stores dimension information and custom sizes
686
+ */
675
687
  class DimensionProvider {
676
688
  constructor(viewports, config) {
677
689
  this.viewports = viewports;
@@ -682,24 +694,46 @@ class DimensionProvider {
682
694
  return sources;
683
695
  }, {});
684
696
  }
697
+ /**
698
+ * Clear old sizes
699
+ * @param type - dimension type
700
+ * @param count - count of items
701
+ */
685
702
  clearSize(t, count) {
686
703
  this.stores[t].drop();
687
704
  // after we done with drop trigger viewport recalculaction
688
705
  this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
689
706
  this.setItemCount(count, t);
690
707
  }
691
- setDimensionSize(type, sizes) {
692
- this.stores[type].setDimensionSize(sizes);
693
- this.viewports.stores[type].setViewPortDimension(sizes);
708
+ /**
709
+ * Apply new custom sizes to dimension and view port
710
+ * @param type - dimension type
711
+ * @param sizes - new custom sizes
712
+ * @param keepOld - keep old sizes merge new with old
713
+ */
714
+ setCustomSizes(type, sizes, keepOld = false) {
715
+ let newSizes = sizes;
716
+ if (keepOld) {
717
+ const oldSizes = this.stores[type].store.get('sizes');
718
+ newSizes = Object.assign(Object.assign({}, oldSizes), sizes);
719
+ }
720
+ this.stores[type].setDimensionSize(newSizes);
721
+ this.viewports.stores[type].setViewPortDimension(newSizes);
694
722
  }
695
723
  setItemCount(realCount, type) {
696
724
  this.viewports.stores[type].setViewport({ realCount });
697
725
  this.stores[type].setStore({ count: realCount });
698
726
  }
727
+ /**
728
+ * Apply trimmed items
729
+ * @param trimmed - trimmed items
730
+ * @param type
731
+ */
699
732
  setTrimmed(trimmed, type) {
700
733
  const allTrimmed = gatherTrimmedItems(trimmed);
701
- this.stores[type].setStore({ trimmed: allTrimmed });
702
- this.viewports.stores[type].setViewPortDimension(this.stores[type].store.get('sizes'));
734
+ const dimStoreType = this.stores[type];
735
+ dimStoreType.setStore({ trimmed: allTrimmed });
736
+ this.viewports.stores[type].setViewPortDimension(dimStoreType.store.get('sizes'));
703
737
  }
704
738
  /**
705
739
  * Sets dimension data and view port coordinate
@@ -713,10 +747,17 @@ class DimensionProvider {
713
747
  }
714
748
  this.updateViewport(type);
715
749
  }
750
+ /**
751
+ * Virtualization will get disabled
752
+ * @param type - dimension type
753
+ */
716
754
  setNoVirtual(type) {
717
755
  const dimension = this.stores[type].getCurrentState();
718
756
  this.viewports.stores[type].setViewport({ virtualSize: dimension.realSize });
719
757
  }
758
+ /**
759
+ * Drop all dimension data
760
+ */
720
761
  drop() {
721
762
  for (let type of columnTypes) {
722
763
  this.stores[type].drop();
@@ -736,7 +777,7 @@ class DimensionProvider {
736
777
  }
737
778
  setNewColumns(type, newLength, sizes, noVirtual = false) {
738
779
  this.setItemCount(newLength, type);
739
- this.setDimensionSize(type, sizes);
780
+ this.setCustomSizes(type, sizes);
740
781
  if (noVirtual) {
741
782
  this.setNoVirtual(type);
742
783
  }
@@ -830,9 +871,9 @@ class AutoSizeColumn extends BasePlugin {
830
871
  const type = ColumnDataProvider.getColumnType(detail.column);
831
872
  const size = this.getColumnSize(detail.index, type);
832
873
  if (size) {
833
- this.providers.dimensionProvider.setDimensionSize(type, {
874
+ this.providers.dimensionProvider.setCustomSizes(type, {
834
875
  [detail.index]: size,
835
- });
876
+ }, true);
836
877
  }
837
878
  };
838
879
  this.addEventListener('beforecolumnsset', beforecolumnsset);
@@ -876,7 +917,7 @@ class AutoSizeColumn extends BasePlugin {
876
917
  // calculate size
877
918
  rgCol.size = sizes[rgCol.index] = source.reduce((prev, rgRow) => Math.max(prev, this.getLength(rgRow[rgCol.prop])), this.getLength(rgCol.name || ''));
878
919
  });
879
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
920
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
880
921
  });
881
922
  }
882
923
  getLength(len) {
@@ -920,7 +961,7 @@ class AutoSizeColumn extends BasePlugin {
920
961
  rgCol.size = sizes[rgCol.index] = size;
921
962
  }
922
963
  });
923
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
964
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
924
965
  });
925
966
  }
926
967
  afterEditAll(e) {
@@ -941,7 +982,7 @@ class AutoSizeColumn extends BasePlugin {
941
982
  }
942
983
  }
943
984
  });
944
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
985
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
945
986
  });
946
987
  }
947
988
  getColumnSize(index, type) {
@@ -2541,7 +2582,7 @@ class ViewportService {
2541
2582
  }
2542
2583
  onColumnResize(type, { detail }, store) {
2543
2584
  var _a;
2544
- (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setDimensionSize(type, detail);
2585
+ (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, detail, true);
2545
2586
  const changedItems = lodash.reduce(detail || {}, (r, size, i) => {
2546
2587
  const index = parseInt(i, 10);
2547
2588
  const item = getSourceItem(store, index);
@@ -2856,7 +2897,7 @@ class StretchColumn extends BasePlugin {
2856
2897
  }
2857
2898
  const type = 'rgCol';
2858
2899
  const sizes = this.providers.dimensionProvider.stores[type].store.get('sizes');
2859
- this.providers.dimensionProvider.setDimensionSize(type, Object.assign(Object.assign({}, sizes), { [this.stretchedColumn.index]: this.stretchedColumn.size }));
2900
+ this.providers.dimensionProvider.setCustomSizes(type, Object.assign(Object.assign({}, sizes), { [this.stretchedColumn.index]: this.stretchedColumn.size }), true);
2860
2901
  }
2861
2902
  /**
2862
2903
  * Apply stretch changes
@@ -3409,6 +3450,9 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3409
3450
  this.clickTrackForFocusClear = e.screenX + e.screenY;
3410
3451
  }
3411
3452
  mouseupHandle(e) {
3453
+ if (e.defaultPrevented) {
3454
+ return;
3455
+ }
3412
3456
  const target = e.target;
3413
3457
  const pos = e.screenX + e.screenY;
3414
3458
  // detect if mousemove then do nothing
@@ -3418,7 +3462,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3418
3462
  // check if action finished inside of the document
3419
3463
  // clear data which is outside of grid
3420
3464
  // if event prevented or it is current table don't clear focus
3421
- if (e.defaultPrevented || (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`))) {
3465
+ if (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`)) {
3422
3466
  return;
3423
3467
  }
3424
3468
  this.clearFocus();
@@ -3431,7 +3475,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3431
3475
  /** DRAG AND DROP */
3432
3476
  onRowDragStarted(e) {
3433
3477
  var _a;
3434
- e.cancelBubble = true;
3478
+ // e.cancelBubble = true;
3435
3479
  const dragStart = this.rowdragstart.emit(e.detail);
3436
3480
  if (dragStart.defaultPrevented) {
3437
3481
  e.preventDefault();
@@ -3449,11 +3493,11 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3449
3493
  }
3450
3494
  onRowMouseMove(e) {
3451
3495
  var _a;
3452
- e.cancelBubble = true;
3496
+ // e.cancelBubble = true;
3453
3497
  (_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
3454
3498
  }
3455
3499
  async onBeforeEdit(e) {
3456
- e.cancelBubble = true;
3500
+ // e.cancelBubble = true;
3457
3501
  const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
3458
3502
  await timeout();
3459
3503
  // apply data
@@ -3463,7 +3507,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3463
3507
  }
3464
3508
  }
3465
3509
  onBeforeRangeEdit(e) {
3466
- e.cancelBubble = true;
3510
+ // e.cancelBubble = true;
3467
3511
  const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
3468
3512
  if (defaultPrevented) {
3469
3513
  e.preventDefault();
@@ -3472,7 +3516,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3472
3516
  this.afteredit.emit(detail);
3473
3517
  }
3474
3518
  onRangeChanged(e) {
3475
- e.cancelBubble = true;
3519
+ // e.cancelBubble = true;
3476
3520
  const beforeange = this.beforeange.emit(e.detail);
3477
3521
  if (beforeange.defaultPrevented) {
3478
3522
  e.preventDefault();
@@ -3569,7 +3613,7 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3569
3613
  if (!newVal.length) {
3570
3614
  return;
3571
3615
  }
3572
- each(newRows, (r, k) => this.dimensionProvider.setDimensionSize(k, r.sizes || {}));
3616
+ each(newRows, (r, k) => this.dimensionProvider.setCustomSizes(k, r.sizes || {}));
3573
3617
  }
3574
3618
  trimmedRowsChanged(newVal = {}) {
3575
3619
  this.addTrimmed(newVal);
@@ -261,7 +261,9 @@ class ViewportStore {
261
261
  }
262
262
  /**
263
263
  * Update viewport sizes for existing items
264
- */
264
+ * This method is generating new item positions based on custom sizes and original sizes
265
+ * @param sizes - custom sizes for each item
266
+ */
265
267
  setViewPortDimension(sizes) {
266
268
  const items = this.store.get('items');
267
269
  const count = items.length;
@@ -21454,26 +21454,29 @@ var sortedIndex_1 = sortedIndex;
21454
21454
 
21455
21455
  /**
21456
21456
  * Pre-calculation
21457
- * Dimension sizes for each cell
21457
+ * Dimension custom sizes for each cell
21458
+ * Keeps only changed sizes, skips origin size
21458
21459
  */
21459
21460
  function calculateDimensionData(originItemSize, newSizes = {}) {
21460
21461
  const positionIndexes = [];
21461
21462
  const positionIndexToItem = {};
21462
21463
  const indexToItem = {};
21463
- // combine all sizes
21464
+ // combine all new sizes
21464
21465
  const sizes = Object.assign({}, newSizes);
21465
21466
  // prepare order sorted new sizes and calculate changed real size
21466
21467
  let newIndexes = [];
21467
- each(newSizes, (_, index) => {
21468
- newIndexes[sortedIndex_1(newIndexes, parseInt(index, 10))] = parseInt(index, 10);
21468
+ each(newSizes, (_, i) => {
21469
+ const index = parseInt(i, 10);
21470
+ newIndexes[sortedIndex_1(newIndexes, index)] = index;
21469
21471
  });
21470
- // fill new coordinates
21472
+ // fill new coordinates based on what is changed
21471
21473
  reduce_1(newIndexes, (previous, itemIndex, i) => {
21472
21474
  const newItem = {
21473
21475
  itemIndex,
21474
21476
  start: 0,
21475
21477
  end: 0,
21476
21478
  };
21479
+ // if previous item was changed too
21477
21480
  if (previous) {
21478
21481
  const itemsBetween = (itemIndex - previous.itemIndex - 1) * originItemSize;
21479
21482
  newItem.start = itemsBetween + previous.end;
@@ -21599,6 +21602,10 @@ function initialBase() {
21599
21602
  return {
21600
21603
  indexes: [],
21601
21604
  count: 0,
21605
+ // plugin support
21606
+ trimmed: {},
21607
+ // size operations, this provider stores only changed sizes, not all of them
21608
+ // same as indexes but for sizes and positions
21602
21609
  // item index to size
21603
21610
  sizes: {},
21604
21611
  // order in indexes[] to coordinate
@@ -21606,7 +21613,6 @@ function initialBase() {
21606
21613
  // initial element to coordinate ^
21607
21614
  indexToItem: {},
21608
21615
  positionIndexes: [],
21609
- trimmed: {}
21610
21616
  };
21611
21617
  }
21612
21618
  function initialState$1() {
@@ -21640,6 +21646,11 @@ class DimensionStore {
21640
21646
  drop() {
21641
21647
  setStore(this.store, initialBase());
21642
21648
  }
21649
+ /**
21650
+ * Set custom dimension sizes and overwrite old
21651
+ * Generates new indexes based on sizes
21652
+ * @param sizes - sizes to set
21653
+ */
21643
21654
  setDimensionSize(sizes) {
21644
21655
  const dimensionData = calculateDimensionData(this.store.get('originItemSize'), sizes);
21645
21656
  setStore(this.store, dimensionData);
@@ -21669,6 +21680,10 @@ const EDIT_INPUT_WR = 'edit-input-wrapper';
21669
21680
  const DRAGG_TEXT = 'Draggable item';
21670
21681
  const GRID_INTERNALS = '__rvgr';
21671
21682
 
21683
+ /**
21684
+ * Dimension provider
21685
+ * Stores dimension information and custom sizes
21686
+ */
21672
21687
  class DimensionProvider {
21673
21688
  constructor(viewports, config) {
21674
21689
  this.viewports = viewports;
@@ -21679,24 +21694,46 @@ class DimensionProvider {
21679
21694
  return sources;
21680
21695
  }, {});
21681
21696
  }
21697
+ /**
21698
+ * Clear old sizes
21699
+ * @param type - dimension type
21700
+ * @param count - count of items
21701
+ */
21682
21702
  clearSize(t, count) {
21683
21703
  this.stores[t].drop();
21684
21704
  // after we done with drop trigger viewport recalculaction
21685
21705
  this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
21686
21706
  this.setItemCount(count, t);
21687
21707
  }
21688
- setDimensionSize(type, sizes) {
21689
- this.stores[type].setDimensionSize(sizes);
21690
- this.viewports.stores[type].setViewPortDimension(sizes);
21708
+ /**
21709
+ * Apply new custom sizes to dimension and view port
21710
+ * @param type - dimension type
21711
+ * @param sizes - new custom sizes
21712
+ * @param keepOld - keep old sizes merge new with old
21713
+ */
21714
+ setCustomSizes(type, sizes, keepOld = false) {
21715
+ let newSizes = sizes;
21716
+ if (keepOld) {
21717
+ const oldSizes = this.stores[type].store.get('sizes');
21718
+ newSizes = Object.assign(Object.assign({}, oldSizes), sizes);
21719
+ }
21720
+ this.stores[type].setDimensionSize(newSizes);
21721
+ this.viewports.stores[type].setViewPortDimension(newSizes);
21691
21722
  }
21692
21723
  setItemCount(realCount, type) {
21693
21724
  this.viewports.stores[type].setViewport({ realCount });
21694
21725
  this.stores[type].setStore({ count: realCount });
21695
21726
  }
21727
+ /**
21728
+ * Apply trimmed items
21729
+ * @param trimmed - trimmed items
21730
+ * @param type
21731
+ */
21696
21732
  setTrimmed(trimmed, type) {
21697
21733
  const allTrimmed = gatherTrimmedItems(trimmed);
21698
- this.stores[type].setStore({ trimmed: allTrimmed });
21699
- this.viewports.stores[type].setViewPortDimension(this.stores[type].store.get('sizes'));
21734
+ const dimStoreType = this.stores[type];
21735
+ dimStoreType.setStore({ trimmed: allTrimmed });
21736
+ this.viewports.stores[type].setViewPortDimension(dimStoreType.store.get('sizes'));
21700
21737
  }
21701
21738
  /**
21702
21739
  * Sets dimension data and view port coordinate
@@ -21710,10 +21747,17 @@ class DimensionProvider {
21710
21747
  }
21711
21748
  this.updateViewport(type);
21712
21749
  }
21750
+ /**
21751
+ * Virtualization will get disabled
21752
+ * @param type - dimension type
21753
+ */
21713
21754
  setNoVirtual(type) {
21714
21755
  const dimension = this.stores[type].getCurrentState();
21715
21756
  this.viewports.stores[type].setViewport({ virtualSize: dimension.realSize });
21716
21757
  }
21758
+ /**
21759
+ * Drop all dimension data
21760
+ */
21717
21761
  drop() {
21718
21762
  for (let type of columnTypes) {
21719
21763
  this.stores[type].drop();
@@ -21733,7 +21777,7 @@ class DimensionProvider {
21733
21777
  }
21734
21778
  setNewColumns(type, newLength, sizes, noVirtual = false) {
21735
21779
  this.setItemCount(newLength, type);
21736
- this.setDimensionSize(type, sizes);
21780
+ this.setCustomSizes(type, sizes);
21737
21781
  if (noVirtual) {
21738
21782
  this.setNoVirtual(type);
21739
21783
  }
@@ -22022,7 +22066,9 @@ class ViewportStore {
22022
22066
  }
22023
22067
  /**
22024
22068
  * Update viewport sizes for existing items
22025
- */
22069
+ * This method is generating new item positions based on custom sizes and original sizes
22070
+ * @param sizes - custom sizes for each item
22071
+ */
22026
22072
  setViewPortDimension(sizes) {
22027
22073
  const items = this.store.get('items');
22028
22074
  const count = items.length;
@@ -22203,9 +22249,9 @@ class AutoSizeColumn extends BasePlugin {
22203
22249
  const type = ColumnDataProvider.getColumnType(detail.column);
22204
22250
  const size = this.getColumnSize(detail.index, type);
22205
22251
  if (size) {
22206
- this.providers.dimensionProvider.setDimensionSize(type, {
22252
+ this.providers.dimensionProvider.setCustomSizes(type, {
22207
22253
  [detail.index]: size,
22208
- });
22254
+ }, true);
22209
22255
  }
22210
22256
  };
22211
22257
  this.addEventListener('beforecolumnsset', beforecolumnsset);
@@ -22249,7 +22295,7 @@ class AutoSizeColumn extends BasePlugin {
22249
22295
  // calculate size
22250
22296
  rgCol.size = sizes[rgCol.index] = source.reduce((prev, rgRow) => Math.max(prev, this.getLength(rgRow[rgCol.prop])), this.getLength(rgCol.name || ''));
22251
22297
  });
22252
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
22298
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
22253
22299
  });
22254
22300
  }
22255
22301
  getLength(len) {
@@ -22293,7 +22339,7 @@ class AutoSizeColumn extends BasePlugin {
22293
22339
  rgCol.size = sizes[rgCol.index] = size;
22294
22340
  }
22295
22341
  });
22296
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
22342
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
22297
22343
  });
22298
22344
  }
22299
22345
  afterEditAll(e) {
@@ -22314,7 +22360,7 @@ class AutoSizeColumn extends BasePlugin {
22314
22360
  }
22315
22361
  }
22316
22362
  });
22317
- this.providers.dimensionProvider.setDimensionSize(type, sizes);
22363
+ this.providers.dimensionProvider.setCustomSizes(type, sizes, true);
22318
22364
  });
22319
22365
  }
22320
22366
  getColumnSize(index, type) {
@@ -24483,7 +24529,7 @@ class ViewportService {
24483
24529
  }
24484
24530
  onColumnResize(type, { detail }, store) {
24485
24531
  var _a;
24486
- (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setDimensionSize(type, detail);
24532
+ (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, detail, true);
24487
24533
  const changedItems = lodash.reduce(detail || {}, (r, size, i) => {
24488
24534
  const index = parseInt(i, 10);
24489
24535
  const item = getSourceItem(store, index);
@@ -24803,7 +24849,7 @@ class StretchColumn extends BasePlugin {
24803
24849
  }
24804
24850
  const type = 'rgCol';
24805
24851
  const sizes = this.providers.dimensionProvider.stores[type].store.get('sizes');
24806
- this.providers.dimensionProvider.setDimensionSize(type, Object.assign(Object.assign({}, sizes), { [this.stretchedColumn.index]: this.stretchedColumn.size }));
24852
+ this.providers.dimensionProvider.setCustomSizes(type, Object.assign(Object.assign({}, sizes), { [this.stretchedColumn.index]: this.stretchedColumn.size }), true);
24807
24853
  }
24808
24854
  /**
24809
24855
  * Apply stretch changes
@@ -25368,6 +25414,9 @@ const RevoGridComponent = class {
25368
25414
  this.clickTrackForFocusClear = e.screenX + e.screenY;
25369
25415
  }
25370
25416
  mouseupHandle(e) {
25417
+ if (e.defaultPrevented) {
25418
+ return;
25419
+ }
25371
25420
  const target = e.target;
25372
25421
  const pos = e.screenX + e.screenY;
25373
25422
  // detect if mousemove then do nothing
@@ -25377,7 +25426,7 @@ const RevoGridComponent = class {
25377
25426
  // check if action finished inside of the document
25378
25427
  // clear data which is outside of grid
25379
25428
  // if event prevented or it is current table don't clear focus
25380
- if (e.defaultPrevented || (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`))) {
25429
+ if (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`)) {
25381
25430
  return;
25382
25431
  }
25383
25432
  this.clearFocus();
@@ -25390,7 +25439,7 @@ const RevoGridComponent = class {
25390
25439
  /** DRAG AND DROP */
25391
25440
  onRowDragStarted(e) {
25392
25441
  var _a;
25393
- e.cancelBubble = true;
25442
+ // e.cancelBubble = true;
25394
25443
  const dragStart = this.rowdragstart.emit(e.detail);
25395
25444
  if (dragStart.defaultPrevented) {
25396
25445
  e.preventDefault();
@@ -25408,11 +25457,11 @@ const RevoGridComponent = class {
25408
25457
  }
25409
25458
  onRowMouseMove(e) {
25410
25459
  var _a;
25411
- e.cancelBubble = true;
25460
+ // e.cancelBubble = true;
25412
25461
  (_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
25413
25462
  }
25414
25463
  async onBeforeEdit(e) {
25415
- e.cancelBubble = true;
25464
+ // e.cancelBubble = true;
25416
25465
  const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
25417
25466
  await timeout();
25418
25467
  // apply data
@@ -25422,7 +25471,7 @@ const RevoGridComponent = class {
25422
25471
  }
25423
25472
  }
25424
25473
  onBeforeRangeEdit(e) {
25425
- e.cancelBubble = true;
25474
+ // e.cancelBubble = true;
25426
25475
  const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
25427
25476
  if (defaultPrevented) {
25428
25477
  e.preventDefault();
@@ -25431,7 +25480,7 @@ const RevoGridComponent = class {
25431
25480
  this.afteredit.emit(detail);
25432
25481
  }
25433
25482
  onRangeChanged(e) {
25434
- e.cancelBubble = true;
25483
+ // e.cancelBubble = true;
25435
25484
  const beforeange = this.beforeange.emit(e.detail);
25436
25485
  if (beforeange.defaultPrevented) {
25437
25486
  e.preventDefault();
@@ -25528,7 +25577,7 @@ const RevoGridComponent = class {
25528
25577
  if (!newVal.length) {
25529
25578
  return;
25530
25579
  }
25531
- each(newRows, (r, k) => this.dimensionProvider.setDimensionSize(k, r.sizes || {}));
25580
+ each(newRows, (r, k) => this.dimensionProvider.setCustomSizes(k, r.sizes || {}));
25532
25581
  }
25533
25582
  trimmedRowsChanged(newVal = {}) {
25534
25583
  this.addTrimmed(newVal);
@@ -250,6 +250,9 @@ export class RevoGridComponent {
250
250
  this.clickTrackForFocusClear = e.screenX + e.screenY;
251
251
  }
252
252
  mouseupHandle(e) {
253
+ if (e.defaultPrevented) {
254
+ return;
255
+ }
253
256
  const target = e.target;
254
257
  const pos = e.screenX + e.screenY;
255
258
  // detect if mousemove then do nothing
@@ -259,7 +262,7 @@ export class RevoGridComponent {
259
262
  // check if action finished inside of the document
260
263
  // clear data which is outside of grid
261
264
  // if event prevented or it is current table don't clear focus
262
- if (e.defaultPrevented || (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`))) {
265
+ if (target === null || target === void 0 ? void 0 : target.closest(`[${UUID}="${this.uuid}"]`)) {
263
266
  return;
264
267
  }
265
268
  this.clearFocus();
@@ -272,7 +275,7 @@ export class RevoGridComponent {
272
275
  /** DRAG AND DROP */
273
276
  onRowDragStarted(e) {
274
277
  var _a;
275
- e.cancelBubble = true;
278
+ // e.cancelBubble = true;
276
279
  const dragStart = this.rowdragstart.emit(e.detail);
277
280
  if (dragStart.defaultPrevented) {
278
281
  e.preventDefault();
@@ -290,11 +293,11 @@ export class RevoGridComponent {
290
293
  }
291
294
  onRowMouseMove(e) {
292
295
  var _a;
293
- e.cancelBubble = true;
296
+ // e.cancelBubble = true;
294
297
  (_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
295
298
  }
296
299
  async onBeforeEdit(e) {
297
- e.cancelBubble = true;
300
+ // e.cancelBubble = true;
298
301
  const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
299
302
  await timeout();
300
303
  // apply data
@@ -304,7 +307,7 @@ export class RevoGridComponent {
304
307
  }
305
308
  }
306
309
  onBeforeRangeEdit(e) {
307
- e.cancelBubble = true;
310
+ // e.cancelBubble = true;
308
311
  const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
309
312
  if (defaultPrevented) {
310
313
  e.preventDefault();
@@ -313,7 +316,7 @@ export class RevoGridComponent {
313
316
  this.afteredit.emit(detail);
314
317
  }
315
318
  onRangeChanged(e) {
316
- e.cancelBubble = true;
319
+ // e.cancelBubble = true;
317
320
  const beforeange = this.beforeange.emit(e.detail);
318
321
  if (beforeange.defaultPrevented) {
319
322
  e.preventDefault();
@@ -410,7 +413,7 @@ export class RevoGridComponent {
410
413
  if (!newVal.length) {
411
414
  return;
412
415
  }
413
- each(newRows, (r, k) => this.dimensionProvider.setDimensionSize(k, r.sizes || {}));
416
+ each(newRows, (r, k) => this.dimensionProvider.setCustomSizes(k, r.sizes || {}));
414
417
  }
415
418
  trimmedRowsChanged(newVal = {}) {
416
419
  this.addTrimmed(newVal);
@@ -17,7 +17,7 @@ export default class ViewportService {
17
17
  }
18
18
  onColumnResize(type, { detail }, store) {
19
19
  var _a;
20
- (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setDimensionSize(type, detail);
20
+ (_a = this.sv.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, detail, true);
21
21
  const changedItems = reduce(detail || {}, (r, size, i) => {
22
22
  const index = parseInt(i, 10);
23
23
  const item = getSourceItem(store, index);