@revolist/revogrid 3.3.1 → 3.3.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.
@@ -2576,7 +2576,7 @@ class ViewportService {
2576
2576
  * First we render vertical parts - pinned start, data, pinned end
2577
2577
  * Per each column we render data collections: headers, pinned top, center data, pinned bottom
2578
2578
  */
2579
- const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onScroll }) => {
2579
+ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onCancelEdit, onScroll }) => {
2580
2580
  const viewPortHtml = [];
2581
2581
  /** render viewports columns */
2582
2582
  for (let view of columns) {
@@ -2586,7 +2586,7 @@ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns,
2586
2586
  ];
2587
2587
  view.dataPorts.forEach((data, j) => {
2588
2588
  const key = view.prop.key + (j + 1);
2589
- const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onSetEdit: ({ detail }) => onEdit(detail) }),
2589
+ const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onCancelEdit: () => onCancelEdit(), onSetEdit: ({ detail }) => onEdit(detail) }),
2590
2590
  h("revogr-data", Object.assign({}, data, { [UUID]: data.uuid }, { key: key, readonly: readonly, range: range, rowClass: rowClass, rowSelectionStore: data.rowSelectionStore, slot: DATA_SLOT })),
2591
2591
  h("revogr-temp-range", { selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }),
2592
2592
  h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol })));
@@ -3519,10 +3519,12 @@ const RevoGridComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
3519
3519
  const anyView = this.viewport.columns[0];
3520
3520
  views.push(h("revogr-row-headers", { height: contentHeight, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.onScroll(e, 'headerRow'), onElementToScroll: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
3521
3521
  }
3522
- views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onEdit: detail => {
3522
+ views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onCancelEdit: () => {
3523
+ this.selectionStoreConnector.setEdit(false);
3524
+ }, onEdit: detail => {
3523
3525
  const event = this.beforeeditstart.emit(detail);
3524
3526
  if (!event.defaultPrevented) {
3525
- this.selectionStoreConnector.setEdit(detail.isCancel ? false : detail.val);
3527
+ this.selectionStoreConnector.setEdit(detail.val);
3526
3528
  }
3527
3529
  }, registerElement: (e, k) => this.scrollingService.registerElement(e, k), onScroll: details => this.scrollingService.onScroll(details) }));
3528
3530
  return (h(Host, Object.assign({}, { [`${UUID}`]: this.uuid }), h(RevoViewPort, { viewports: this.viewportProvider.stores, dimensions: this.dimensionProvider.stores, orderRef: e => (this.orderService = e), registerElement: (e, k) => this.scrollingService.registerElement(e, k), nakedClick: () => this.viewport.clearEdit(), onScroll: details => this.scrollingService.onScroll(details) }, views), this.extraElements));
@@ -332,7 +332,11 @@ const Edit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
332
332
  this.closeEdit = createEvent(this, "closeEdit", 3);
333
333
  this.currentEditor = null;
334
334
  }
335
- /** Callback triggered on cell editor save */
335
+ /**
336
+ * Callback triggered on cell editor save
337
+ * Closes editor when called
338
+ * @param preventFocus - if true editor will not be closed and next cell will not be focused
339
+ */
336
340
  onSave(val, preventFocus) {
337
341
  if (this.editCell) {
338
342
  this.cellEdit.emit({
@@ -76,7 +76,7 @@ class KeyboardService {
76
76
  if (this.sv.selectionStoreService.edited) {
77
77
  switch (e.code) {
78
78
  case codesLetter.ESCAPE:
79
- this.sv.doEdit(undefined, true);
79
+ this.sv.cancelEdit();
80
80
  break;
81
81
  }
82
82
  return;
@@ -466,6 +466,7 @@ const OverlaySelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
466
466
  this.internalCellEdit = createEvent(this, "internalCellEdit", 7);
467
467
  this.internalFocusCell = createEvent(this, "internalFocusCell", 7);
468
468
  this.setEdit = createEvent(this, "setEdit", 3);
469
+ this.cancelEdit = createEvent(this, "cancelEdit", 7);
469
470
  this.setRange = createEvent(this, "setRange", 7);
470
471
  this.setTempRange = createEvent(this, "setTempRange", 7);
471
472
  this.focusCell = createEvent(this, "focusCell", 3);
@@ -528,7 +529,8 @@ const OverlaySelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
528
529
  this.keyboardService = new KeyboardService({
529
530
  selectionStoreService: this.selectionStoreService,
530
531
  selectionStore: s,
531
- doEdit: (v, c) => this.doEdit(v, c),
532
+ doEdit: (v) => this.doEdit(v),
533
+ cancelEdit: () => this.closeEdit(),
532
534
  clearCell: () => this.clearCell(),
533
535
  getData: () => this.getData(),
534
536
  internalPaste: () => this.internalPaste.emit()
@@ -628,17 +630,20 @@ const OverlaySelection = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
628
630
  this.autoFillService.selectionStart(e, data);
629
631
  }
630
632
  }
631
- doEdit(val = '', isCancel = false) {
633
+ doEdit(val = '') {
632
634
  var _a;
633
635
  if (this.canEdit()) {
634
636
  const editCell = this.selectionStore.get('focus');
635
637
  const data = this.columnService.getSaveData(editCell.y, editCell.x);
636
- (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { isCancel,
637
- val }));
638
+ (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
638
639
  }
639
640
  }
641
+ /**
642
+ * Close editor event triggered
643
+ * @param details - if requires focus next
644
+ */
640
645
  closeEdit(e) {
641
- this.doEdit(undefined, true);
646
+ this.cancelEdit.emit();
642
647
  if (e === null || e === void 0 ? void 0 : e.detail) {
643
648
  this.focusNext();
644
649
  }
@@ -24433,7 +24433,7 @@ class ViewportService {
24433
24433
  * First we render vertical parts - pinned start, data, pinned end
24434
24434
  * Per each column we render data collections: headers, pinned top, center data, pinned bottom
24435
24435
  */
24436
- const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onScroll }) => {
24436
+ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onCancelEdit, onScroll }) => {
24437
24437
  const viewPortHtml = [];
24438
24438
  /** render viewports columns */
24439
24439
  for (let view of columns) {
@@ -24443,7 +24443,7 @@ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns,
24443
24443
  ];
24444
24444
  view.dataPorts.forEach((data, j) => {
24445
24445
  const key = view.prop.key + (j + 1);
24446
- const dataView = (index.h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onSetEdit: ({ detail }) => onEdit(detail) }),
24446
+ const dataView = (index.h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onCancelEdit: () => onCancelEdit(), onSetEdit: ({ detail }) => onEdit(detail) }),
24447
24447
  index.h("revogr-data", Object.assign({}, data, { [UUID]: data.uuid }, { key: key, readonly: readonly, range: range, rowClass: rowClass, rowSelectionStore: data.rowSelectionStore, slot: DATA_SLOT })),
24448
24448
  index.h("revogr-temp-range", { selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }),
24449
24449
  index.h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol })));
@@ -25388,10 +25388,12 @@ const RevoGridComponent = class {
25388
25388
  const anyView = this.viewport.columns[0];
25389
25389
  views.push(index.h("revogr-row-headers", { height: contentHeight, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.onScroll(e, 'headerRow'), onElementToScroll: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
25390
25390
  }
25391
- views.push(index.h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onEdit: detail => {
25391
+ views.push(index.h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onCancelEdit: () => {
25392
+ this.selectionStoreConnector.setEdit(false);
25393
+ }, onEdit: detail => {
25392
25394
  const event = this.beforeeditstart.emit(detail);
25393
25395
  if (!event.defaultPrevented) {
25394
- this.selectionStoreConnector.setEdit(detail.isCancel ? false : detail.val);
25396
+ this.selectionStoreConnector.setEdit(detail.val);
25395
25397
  }
25396
25398
  }, registerElement: (e, k) => this.scrollingService.registerElement(e, k), onScroll: details => this.scrollingService.onScroll(details) }));
25397
25399
  return (index.h(index.Host, Object.assign({}, { [`${UUID}`]: this.uuid }), index.h(RevoViewPort, { viewports: this.viewportProvider.stores, dimensions: this.dimensionProvider.stores, orderRef: e => (this.orderService = e), registerElement: (e, k) => this.scrollingService.registerElement(e, k), nakedClick: () => this.viewport.clearEdit(), onScroll: details => this.scrollingService.onScroll(details) }, views), this.extraElements));
@@ -26087,7 +26089,11 @@ const Edit = class {
26087
26089
  this.closeEdit = index.createEvent(this, "closeEdit", 3);
26088
26090
  this.currentEditor = null;
26089
26091
  }
26090
- /** Callback triggered on cell editor save */
26092
+ /**
26093
+ * Callback triggered on cell editor save
26094
+ * Closes editor when called
26095
+ * @param preventFocus - if true editor will not be closed and next cell will not be focused
26096
+ */
26091
26097
  onSave(val, preventFocus) {
26092
26098
  if (this.editCell) {
26093
26099
  this.cellEdit.emit({
@@ -27029,7 +27035,7 @@ class KeyboardService {
27029
27035
  if (this.sv.selectionStoreService.edited) {
27030
27036
  switch (e.code) {
27031
27037
  case codesLetter.ESCAPE:
27032
- this.sv.doEdit(undefined, true);
27038
+ this.sv.cancelEdit();
27033
27039
  break;
27034
27040
  }
27035
27041
  return;
@@ -27418,6 +27424,7 @@ const OverlaySelection = class {
27418
27424
  this.internalCellEdit = index.createEvent(this, "internalCellEdit", 7);
27419
27425
  this.internalFocusCell = index.createEvent(this, "internalFocusCell", 7);
27420
27426
  this.setEdit = index.createEvent(this, "setEdit", 3);
27427
+ this.cancelEdit = index.createEvent(this, "cancelEdit", 7);
27421
27428
  this.setRange = index.createEvent(this, "setRange", 7);
27422
27429
  this.setTempRange = index.createEvent(this, "setTempRange", 7);
27423
27430
  this.focusCell = index.createEvent(this, "focusCell", 3);
@@ -27480,7 +27487,8 @@ const OverlaySelection = class {
27480
27487
  this.keyboardService = new KeyboardService({
27481
27488
  selectionStoreService: this.selectionStoreService,
27482
27489
  selectionStore: s,
27483
- doEdit: (v, c) => this.doEdit(v, c),
27490
+ doEdit: (v) => this.doEdit(v),
27491
+ cancelEdit: () => this.closeEdit(),
27484
27492
  clearCell: () => this.clearCell(),
27485
27493
  getData: () => this.getData(),
27486
27494
  internalPaste: () => this.internalPaste.emit()
@@ -27580,17 +27588,20 @@ const OverlaySelection = class {
27580
27588
  this.autoFillService.selectionStart(e, data);
27581
27589
  }
27582
27590
  }
27583
- doEdit(val = '', isCancel = false) {
27591
+ doEdit(val = '') {
27584
27592
  var _a;
27585
27593
  if (this.canEdit()) {
27586
27594
  const editCell = this.selectionStore.get('focus');
27587
27595
  const data = this.columnService.getSaveData(editCell.y, editCell.x);
27588
- (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { isCancel,
27589
- val }));
27596
+ (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
27590
27597
  }
27591
27598
  }
27599
+ /**
27600
+ * Close editor event triggered
27601
+ * @param details - if requires focus next
27602
+ */
27592
27603
  closeEdit(e) {
27593
- this.doEdit(undefined, true);
27604
+ this.cancelEdit.emit();
27594
27605
  if (e === null || e === void 0 ? void 0 : e.detail) {
27595
27606
  this.focusNext();
27596
27607
  }
@@ -29,7 +29,7 @@ export class KeyboardService {
29
29
  if (this.sv.selectionStoreService.edited) {
30
30
  switch (e.code) {
31
31
  case codesLetter.ESCAPE:
32
- this.sv.doEdit(undefined, true);
32
+ this.sv.cancelEdit();
33
33
  break;
34
34
  }
35
35
  return;
@@ -8,7 +8,11 @@ export class Edit {
8
8
  constructor() {
9
9
  this.currentEditor = null;
10
10
  }
11
- /** Callback triggered on cell editor save */
11
+ /**
12
+ * Callback triggered on cell editor save
13
+ * Closes editor when called
14
+ * @param preventFocus - if true editor will not be closed and next cell will not be focused
15
+ */
12
16
  onSave(val, preventFocus) {
13
17
  if (this.editCell) {
14
18
  this.cellEdit.emit({
@@ -150,7 +154,7 @@ export class Edit {
150
154
  "composed": true,
151
155
  "docs": {
152
156
  "tags": [],
153
- "text": "Close editor event"
157
+ "text": "Close editor event\npass true if requires focus next"
154
158
  },
155
159
  "complexType": {
156
160
  "original": "boolean | undefined",
@@ -71,7 +71,8 @@ export class OverlaySelection {
71
71
  this.keyboardService = new KeyboardService({
72
72
  selectionStoreService: this.selectionStoreService,
73
73
  selectionStore: s,
74
- doEdit: (v, c) => this.doEdit(v, c),
74
+ doEdit: (v) => this.doEdit(v),
75
+ cancelEdit: () => this.closeEdit(),
75
76
  clearCell: () => this.clearCell(),
76
77
  getData: () => this.getData(),
77
78
  internalPaste: () => this.internalPaste.emit()
@@ -173,17 +174,20 @@ export class OverlaySelection {
173
174
  this.autoFillService.selectionStart(e, data);
174
175
  }
175
176
  }
176
- doEdit(val = '', isCancel = false) {
177
+ doEdit(val = '') {
177
178
  var _a;
178
179
  if (this.canEdit()) {
179
180
  const editCell = this.selectionStore.get('focus');
180
181
  const data = this.columnService.getSaveData(editCell.y, editCell.x);
181
- (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { isCancel,
182
- val }));
182
+ (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
183
183
  }
184
184
  }
185
+ /**
186
+ * Close editor event triggered
187
+ * @param details - if requires focus next
188
+ */
185
189
  closeEdit(e) {
186
- this.doEdit(undefined, true);
190
+ this.cancelEdit.emit();
187
191
  if (e === null || e === void 0 ? void 0 : e.detail) {
188
192
  this.focusNext();
189
193
  }
@@ -563,7 +567,7 @@ export class OverlaySelection {
563
567
  },
564
568
  "complexType": {
565
569
  "original": "Edition.BeforeEdit",
566
- "resolved": "{ isCancel: boolean; } & BeforeSaveDataDetails",
570
+ "resolved": "{ prop: ColumnProp; model: DataType; val?: string; rowIndex: number; type: DimensionRows; }",
567
571
  "references": {
568
572
  "Edition": {
569
573
  "location": "import",
@@ -571,6 +575,21 @@ export class OverlaySelection {
571
575
  }
572
576
  }
573
577
  }
578
+ }, {
579
+ "method": "cancelEdit",
580
+ "name": "cancelEdit",
581
+ "bubbles": true,
582
+ "cancelable": true,
583
+ "composed": true,
584
+ "docs": {
585
+ "tags": [],
586
+ "text": "Used for editors support when close requested"
587
+ },
588
+ "complexType": {
589
+ "original": "any",
590
+ "resolved": "any",
591
+ "references": {}
592
+ }
574
593
  }, {
575
594
  "method": "setRange",
576
595
  "name": "setRange",
@@ -575,10 +575,12 @@ export class RevoGridComponent {
575
575
  const anyView = this.viewport.columns[0];
576
576
  views.push(h("revogr-row-headers", { height: contentHeight, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.onScroll(e, 'headerRow'), onElementToScroll: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
577
577
  }
578
- views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onEdit: detail => {
578
+ views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onCancelEdit: () => {
579
+ this.selectionStoreConnector.setEdit(false);
580
+ }, onEdit: detail => {
579
581
  const event = this.beforeeditstart.emit(detail);
580
582
  if (!event.defaultPrevented) {
581
- this.selectionStoreConnector.setEdit(detail.isCancel ? false : detail.val);
583
+ this.selectionStoreConnector.setEdit(detail.val);
582
584
  }
583
585
  }, registerElement: (e, k) => this.scrollingService.registerElement(e, k), onScroll: details => this.scrollingService.onScroll(details) }));
584
586
  return (h(Host, Object.assign({}, { [`${UUID}`]: this.uuid }),
@@ -9,7 +9,7 @@ import { DATA_SLOT, HEADER_SLOT } from './viewport.helpers';
9
9
  * First we render vertical parts - pinned start, data, pinned end
10
10
  * Per each column we render data collections: headers, pinned top, center data, pinned bottom
11
11
  */
12
- export const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onScroll }) => {
12
+ export const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onCancelEdit, onScroll }) => {
13
13
  const viewPortHtml = [];
14
14
  /** render viewports columns */
15
15
  for (let view of columns) {
@@ -19,7 +19,7 @@ export const ViewPortSections = ({ resize, editors, rowClass, readonly, range, c
19
19
  ];
20
20
  view.dataPorts.forEach((data, j) => {
21
21
  const key = view.prop.key + (j + 1);
22
- const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onSetEdit: ({ detail }) => onEdit(detail) }),
22
+ const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onCancelEdit: () => onCancelEdit(), onSetEdit: ({ detail }) => onEdit(detail) }),
23
23
  h("revogr-data", Object.assign({}, data, { [UUID]: data.uuid }, { key: key, readonly: readonly, range: range, rowClass: rowClass, rowSelectionStore: data.rowSelectionStore, slot: DATA_SLOT })),
24
24
  h("revogr-temp-range", { selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }),
25
25
  h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol })));
@@ -24429,7 +24429,7 @@ class ViewportService {
24429
24429
  * First we render vertical parts - pinned start, data, pinned end
24430
24430
  * Per each column we render data collections: headers, pinned top, center data, pinned bottom
24431
24431
  */
24432
- const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onScroll }) => {
24432
+ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns, useClipboard, columnFilter, registerElement, onEdit, onCancelEdit, onScroll }) => {
24433
24433
  const viewPortHtml = [];
24434
24434
  /** render viewports columns */
24435
24435
  for (let view of columns) {
@@ -24439,7 +24439,7 @@ const ViewPortSections = ({ resize, editors, rowClass, readonly, range, columns,
24439
24439
  ];
24440
24440
  view.dataPorts.forEach((data, j) => {
24441
24441
  const key = view.prop.key + (j + 1);
24442
- const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onSetEdit: ({ detail }) => onEdit(detail) }),
24442
+ const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { slot: data.slot, selectionStore: data.segmentSelectionStore, editors: editors, readonly: readonly, range: range, useClipboard: useClipboard, onCancelEdit: () => onCancelEdit(), onSetEdit: ({ detail }) => onEdit(detail) }),
24443
24443
  h("revogr-data", Object.assign({}, data, { [UUID]: data.uuid }, { key: key, readonly: readonly, range: range, rowClass: rowClass, rowSelectionStore: data.rowSelectionStore, slot: DATA_SLOT })),
24444
24444
  h("revogr-temp-range", { selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }),
24445
24445
  h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, selectionStore: data.segmentSelectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol })));
@@ -25384,10 +25384,12 @@ const RevoGridComponent = class {
25384
25384
  const anyView = this.viewport.columns[0];
25385
25385
  views.push(h("revogr-row-headers", { height: contentHeight, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, uiid: anyView.prop[UUID], rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollViewport: ({ detail: e }) => this.scrollingService.onScroll(e, 'headerRow'), onElementToScroll: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
25386
25386
  }
25387
- views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onEdit: detail => {
25387
+ views.push(h(ViewPortSections, { columnFilter: !!this.filter, resize: this.resize, readonly: this.readonly, range: this.range, rowClass: this.rowClass, editors: this.editors, useClipboard: this.useClipboard, columns: this.viewport.columns, onCancelEdit: () => {
25388
+ this.selectionStoreConnector.setEdit(false);
25389
+ }, onEdit: detail => {
25388
25390
  const event = this.beforeeditstart.emit(detail);
25389
25391
  if (!event.defaultPrevented) {
25390
- this.selectionStoreConnector.setEdit(detail.isCancel ? false : detail.val);
25392
+ this.selectionStoreConnector.setEdit(detail.val);
25391
25393
  }
25392
25394
  }, registerElement: (e, k) => this.scrollingService.registerElement(e, k), onScroll: details => this.scrollingService.onScroll(details) }));
25393
25395
  return (h(Host, Object.assign({}, { [`${UUID}`]: this.uuid }), h(RevoViewPort, { viewports: this.viewportProvider.stores, dimensions: this.dimensionProvider.stores, orderRef: e => (this.orderService = e), registerElement: (e, k) => this.scrollingService.registerElement(e, k), nakedClick: () => this.viewport.clearEdit(), onScroll: details => this.scrollingService.onScroll(details) }, views), this.extraElements));
@@ -26083,7 +26085,11 @@ const Edit = class {
26083
26085
  this.closeEdit = createEvent(this, "closeEdit", 3);
26084
26086
  this.currentEditor = null;
26085
26087
  }
26086
- /** Callback triggered on cell editor save */
26088
+ /**
26089
+ * Callback triggered on cell editor save
26090
+ * Closes editor when called
26091
+ * @param preventFocus - if true editor will not be closed and next cell will not be focused
26092
+ */
26087
26093
  onSave(val, preventFocus) {
26088
26094
  if (this.editCell) {
26089
26095
  this.cellEdit.emit({
@@ -27025,7 +27031,7 @@ class KeyboardService {
27025
27031
  if (this.sv.selectionStoreService.edited) {
27026
27032
  switch (e.code) {
27027
27033
  case codesLetter.ESCAPE:
27028
- this.sv.doEdit(undefined, true);
27034
+ this.sv.cancelEdit();
27029
27035
  break;
27030
27036
  }
27031
27037
  return;
@@ -27414,6 +27420,7 @@ const OverlaySelection = class {
27414
27420
  this.internalCellEdit = createEvent(this, "internalCellEdit", 7);
27415
27421
  this.internalFocusCell = createEvent(this, "internalFocusCell", 7);
27416
27422
  this.setEdit = createEvent(this, "setEdit", 3);
27423
+ this.cancelEdit = createEvent(this, "cancelEdit", 7);
27417
27424
  this.setRange = createEvent(this, "setRange", 7);
27418
27425
  this.setTempRange = createEvent(this, "setTempRange", 7);
27419
27426
  this.focusCell = createEvent(this, "focusCell", 3);
@@ -27476,7 +27483,8 @@ const OverlaySelection = class {
27476
27483
  this.keyboardService = new KeyboardService({
27477
27484
  selectionStoreService: this.selectionStoreService,
27478
27485
  selectionStore: s,
27479
- doEdit: (v, c) => this.doEdit(v, c),
27486
+ doEdit: (v) => this.doEdit(v),
27487
+ cancelEdit: () => this.closeEdit(),
27480
27488
  clearCell: () => this.clearCell(),
27481
27489
  getData: () => this.getData(),
27482
27490
  internalPaste: () => this.internalPaste.emit()
@@ -27576,17 +27584,20 @@ const OverlaySelection = class {
27576
27584
  this.autoFillService.selectionStart(e, data);
27577
27585
  }
27578
27586
  }
27579
- doEdit(val = '', isCancel = false) {
27587
+ doEdit(val = '') {
27580
27588
  var _a;
27581
27589
  if (this.canEdit()) {
27582
27590
  const editCell = this.selectionStore.get('focus');
27583
27591
  const data = this.columnService.getSaveData(editCell.y, editCell.x);
27584
- (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { isCancel,
27585
- val }));
27592
+ (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
27586
27593
  }
27587
27594
  }
27595
+ /**
27596
+ * Close editor event triggered
27597
+ * @param details - if requires focus next
27598
+ */
27588
27599
  closeEdit(e) {
27589
- this.doEdit(undefined, true);
27600
+ this.cancelEdit.emit();
27590
27601
  if (e === null || e === void 0 ? void 0 : e.detail) {
27591
27602
  this.focusNext();
27592
27603
  }