@taocompany/magic-grid 0.10.3 → 0.10.5

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.es.js CHANGED
@@ -2647,6 +2647,7 @@ function oo(e) {
2647
2647
  refreshCellStyles: (t) => e.refreshCellStyles(t),
2648
2648
  startEditingCell: (t) => e.startEditingCell(t),
2649
2649
  stopEditing: (t) => e.stopEditing(t),
2650
+ commit: (t) => e.commit(t),
2650
2651
  isEditing: () => e.isEditing(),
2651
2652
  isCommitting: () => e.isCommitting(),
2652
2653
  awaitCommitIdle: () => e.awaitCommitIdle(),
@@ -2952,9 +2953,9 @@ var rs = class {
2952
2953
  } else e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && this.onEditingInput?.();
2953
2954
  };
2954
2955
  handleEditorFocusOut = (e) => {
2955
- let t = e;
2956
+ let t = e, n = this.editing;
2956
2957
  requestAnimationFrame(() => {
2957
- this.isEditing() && this.phase !== "committing" && (this.isFocusWithinEditorSurface(t) || (this.clearPendingBlurCommit(), this.scheduleBlurCommitAfterClick()));
2958
+ this.isEditing() && this.editing === n && this.phase !== "committing" && (this.isFocusWithinEditorSurface(t) || (this.clearPendingBlurCommit(), this.scheduleBlurCommitAfterClick()));
2958
2959
  });
2959
2960
  };
2960
2961
  constructor(e) {
@@ -3320,9 +3321,9 @@ var Cs = class {
3320
3321
  e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.stopRowEditing(!1));
3321
3322
  };
3322
3323
  handleEditorBlur = (e) => {
3323
- let t = e;
3324
+ let t = e, n = this.editing;
3324
3325
  requestAnimationFrame(() => {
3325
- this.isEditing() && this.phase !== "committing" && (this.isFocusWithinRowEditors(t.relatedTarget) || (this.clearPendingBlurCommit(), this.scheduleBlurCommitAfterClick()));
3326
+ this.isEditing() && this.editing === n && this.phase !== "committing" && (this.isFocusWithinRowEditors(t.relatedTarget) || (this.clearPendingBlurCommit(), this.scheduleBlurCommitAfterClick()));
3326
3327
  });
3327
3328
  };
3328
3329
  constructor(e) {
@@ -15912,7 +15913,12 @@ function Zx(e, t) {
15912
15913
  $x(e, t);
15913
15914
  }
15914
15915
  function Qx(e, t) {
15915
- if (e.deps.rowEditingService.isCommitting()) return;
15916
+ if (e.deps.rowEditingService.isCommitting()) {
15917
+ e.deps.rowEditingService.awaitCommitIdle().then(() => {
15918
+ e.deps.rowEditingService.isCommitting() || Qx(e, t);
15919
+ });
15920
+ return;
15921
+ }
15916
15922
  if (e.deps.editingService.isEditing()) {
15917
15923
  e.deps.editingService.stopEditing(!0).then(() => {
15918
15924
  e.deps.editingService.isEditing() || Qx(e, t);
@@ -15998,6 +16004,12 @@ function Qx(e, t) {
15998
16004
  }
15999
16005
  function $x(e, t) {
16000
16006
  if (e.deps.rowEditingService.isCommitting()) return;
16007
+ if (e.deps.editingService.isCommitting()) {
16008
+ e.deps.editingService.awaitCommitIdle().then(() => {
16009
+ e.deps.editingService.isCommitting() || $x(e, t);
16010
+ });
16011
+ return;
16012
+ }
16001
16013
  if (e.deps.rowEditingService.isEditing()) {
16002
16014
  e.deps.rowEditingService.stopRowEditing(!0).then((n) => {
16003
16015
  n?.committed && !e.deps.rowEditingService.isEditing() && $x(e, t);
@@ -16094,6 +16106,10 @@ var eS = class {
16094
16106
  stopEditing(e = !1) {
16095
16107
  return this.deps.rowEditingService.isEditing() ? this.deps.rowEditingService.stopRowEditing(!e).then((e) => e ? { committed: e.committed } : null) : this.deps.editingService.isEditing() ? this.deps.editingService.stopEditing(!e).then((e) => e ? { committed: e.committed } : null) : Promise.resolve(null);
16096
16108
  }
16109
+ async commit(e = !1) {
16110
+ let t = await this.stopEditing(e);
16111
+ return t === null ? !this.isEditing() : e ? !0 : t.committed === !0;
16112
+ }
16097
16113
  isCommitting() {
16098
16114
  return this.deps.editingService.isCommitting() || this.deps.rowEditingService.isCommitting();
16099
16115
  }
@@ -20338,12 +20354,15 @@ var ST = class {
20338
20354
  }
20339
20355
  }, CT = class {
20340
20356
  ctx;
20357
+ pendingSingleClickGesture = null;
20358
+ clearPendingSingleClickGesture = null;
20359
+ consumedPointerUpCellAction = null;
20341
20360
  constructor(e) {
20342
20361
  this.ctx = e;
20343
20362
  }
20344
20363
  handleCellMouseDown = async (e) => {
20345
20364
  if (e.button !== 0) return;
20346
- if (e.target instanceof Element && e.target.closest(".mg-range-handle")) {
20365
+ if (this.clearPendingSingleClickGesture?.(), this.clearPendingSingleClickGesture = null, this.pendingSingleClickGesture = null, this.consumedPointerUpCellAction = null, e.target instanceof Element && e.target.closest(".mg-range-handle")) {
20347
20366
  if (e.preventDefault(), e.stopPropagation(), this.ctx.deps.isCommitting() && await this.ctx.deps.awaitCommitIdle(), this.ctx.deps.isEditing() && (await this.ctx.deps.commitEditing(), this.ctx.deps.isEditing())) return;
20348
20367
  this.ctx.rangeHandleSession.begin(e.clientX, e.clientY);
20349
20368
  return;
@@ -20366,7 +20385,7 @@ var ST = class {
20366
20385
  colId: t.colId,
20367
20386
  rowIndex: t.rowIndex,
20368
20387
  colIndex: this.ctx.host.getColIndex(t.colId)
20369
- }), this.ctx.deps.viewportEl.focus();
20388
+ }), this.ctx.deps.viewportEl.focus({ preventScroll: !0 });
20370
20389
  return;
20371
20390
  }
20372
20391
  if (e.target instanceof Element && e.target.closest(".mg-column-settings-menu")) {
@@ -20379,7 +20398,7 @@ var ST = class {
20379
20398
  colId: t.colId,
20380
20399
  rowIndex: t.rowIndex,
20381
20400
  colIndex: this.ctx.host.getColIndex(t.colId)
20382
- }), this.ctx.deps.viewportEl.focus();
20401
+ }), this.ctx.deps.viewportEl.focus({ preventScroll: !0 });
20383
20402
  return;
20384
20403
  }
20385
20404
  if (t && this.ctx.rowResizeSession.canStart(t.colId, e.target, this.ctx.indexSelectionDragSession.isActive() || this.ctx.rowDragSession.isActive())) {
@@ -20416,60 +20435,43 @@ var ST = class {
20416
20435
  });
20417
20436
  return;
20418
20437
  }
20419
- if (t && this.ctx.deps.isCellSelectionEnabled?.() && !As(this.ctx.deps.editBehavior) && !await this.commitEditingForCellRangeInteraction(t, e)) return;
20420
- if (t && this.ctx.cellRangeDragSession.canStart(t, e, "replace")) {
20421
- e.preventDefault(), this.ctx.host.clearIndexFocusIfNeeded(t.colId), this.emitCellClicked(t), this.ctx.cellRangeDragSession.begin({
20422
- anchorRowId: t.rowId,
20423
- anchorColId: t.colId,
20424
- anchorRowIndex: t.rowIndex,
20425
- clientX: e.clientX,
20426
- clientY: e.clientY,
20427
- mode: "replace"
20428
- });
20429
- return;
20430
- }
20431
- if (t && this.ctx.cellRangeDragSession.canStart(t, e, "append")) {
20432
- e.preventDefault(), this.ctx.host.clearIndexFocusIfNeeded(t.colId), this.emitCellClicked(t), this.ctx.cellRangeDragSession.begin({
20433
- anchorRowId: t.rowId,
20434
- anchorColId: t.colId,
20435
- anchorRowIndex: t.rowIndex,
20436
- clientX: e.clientX,
20437
- clientY: e.clientY,
20438
- mode: "append"
20439
- });
20440
- return;
20441
- }
20438
+ let r = !1;
20439
+ if (t && this.ctx.deps.isCellSelectionEnabled?.() && !As(this.ctx.deps.editBehavior) && this.ctx.deps.isEditing() && (!this.isSameEditingTarget(t) && this.shouldSchedulePointerUpWhileEditingSwitch(t, e) && (this.scheduleSingleClickEditingAfterPointerDown(t), r = !0), !await this.commitEditingForCellRangeInteraction(t, e)) || t && this.tryBeginCellRangeDragFromMouseDown(t, e, "replace", r) || t && this.tryBeginCellRangeDragFromMouseDown(t, e, "append", r)) return;
20442
20440
  if (t && this.ctx.cellRangeInteraction.tryHandleModifierMouseDown(t, e)) {
20443
20441
  this.emitCellClicked(t), this.ctx.host.clearIndexFocusIfNeeded(t.colId), this.ctx.host.setFocusedCell({
20444
20442
  rowId: t.rowId,
20445
20443
  colId: t.colId,
20446
20444
  rowIndex: t.rowIndex,
20447
20445
  colIndex: this.ctx.host.getColIndex(t.colId)
20448
- }), this.ctx.deps.viewportEl.focus();
20446
+ }), this.ctx.deps.viewportEl.focus({ preventScroll: !0 });
20449
20447
  return;
20450
20448
  }
20451
- if (this.ctx.deps.isCommitting() && (e.preventDefault(), await this.ctx.deps.awaitCommitIdle()), this.ctx.deps.isEditing() && mo(e.target)) return;
20452
- let r = Gb(this.ctx.deps.rowModel, e.target);
20453
- if (this.ctx.deps.isEditing() && (r && this.isSameEditingTarget(r) || (await this.ctx.deps.commitEditing(), this.ctx.deps.isEditing()))) return;
20454
- if (!r) {
20449
+ this.ctx.deps.isCommitting() && (e.preventDefault(), await this.ctx.deps.awaitCommitIdle());
20450
+ let i = Gb(this.ctx.deps.rowModel, e.target);
20451
+ if (this.ctx.deps.isEditing()) {
20452
+ let t = i, n = this.resolveCellTargetUnderPointer(e);
20453
+ if (t && !this.isSameEditingTarget(t) ? i = t : n && (i = n), i && this.isSameEditingTarget(i) && mo(e.target) || mo(e.target) && !i) return;
20454
+ }
20455
+ if (this.ctx.deps.isEditing() && (i && this.isSameEditingTarget(i) || (i && (this.scheduleSingleClickEditingAfterPointerDown(i), r = !0), await this.ctx.deps.commitEditing(), this.ctx.deps.isEditing()))) return;
20456
+ if (!i) {
20455
20457
  this.ctx.host.clearIndexFocusState(), this.ctx.cellRangeInteraction.tryClearOnBlankViewportClick();
20456
20458
  return;
20457
20459
  }
20458
- let { rowId: i, colId: a, rowIndex: o } = r;
20459
- (this.ctx.host.isExpandColumnEntry(a) || this.ctx.host.isGroupColumnEntry(a) || this.ctx.host.isTreeColumnEntry(a) || this.ctx.host.isSelectionColumnEntry(a) || e.shiftKey || e.ctrlKey || e.metaKey) && e.preventDefault(), this.emitCellClicked(r), this.ctx.host.isIndexColumnEntry(a) ? this.ctx.host.applyIndexFocus(i, o, a, {
20460
+ let { rowId: a, colId: o, rowIndex: s } = i;
20461
+ (this.ctx.host.isExpandColumnEntry(o) || this.ctx.host.isGroupColumnEntry(o) || this.ctx.host.isTreeColumnEntry(o) || this.ctx.host.isSelectionColumnEntry(o) || e.shiftKey || e.ctrlKey || e.metaKey) && e.preventDefault(), this.emitCellClicked(i), this.ctx.host.isIndexColumnEntry(o) ? this.ctx.host.applyIndexFocus(a, s, o, {
20460
20462
  ctrlKey: e.ctrlKey || e.metaKey,
20461
20463
  shiftKey: e.shiftKey,
20462
20464
  toggleOnReselect: !0
20463
- }) : (this.ctx.host.clearIndexFocusIfNeeded(a), this.ctx.host.isExpandColumnEntry(a) ? this.ctx.host.applyRowExpansionToggle(i, o, a) : this.ctx.host.isSelectionColumnEntry(a) && this.ctx.host.applyRowSelection(i, o, a, {
20465
+ }) : (this.ctx.host.clearIndexFocusIfNeeded(o), this.ctx.host.isExpandColumnEntry(o) ? this.ctx.host.applyRowExpansionToggle(a, s, o) : this.ctx.host.isSelectionColumnEntry(o) && this.ctx.host.applyRowSelection(a, s, o, {
20464
20466
  ctrlKey: e.ctrlKey || e.metaKey,
20465
20467
  shiftKey: e.shiftKey,
20466
20468
  toggleOnReselect: !0
20467
20469
  })), this.ctx.host.setFocusedCell({
20468
- rowId: i,
20469
- colId: a,
20470
- rowIndex: o,
20471
- colIndex: this.ctx.host.getColIndex(a)
20472
- }), this.ctx.deps.viewportEl.focus();
20470
+ rowId: a,
20471
+ colId: o,
20472
+ rowIndex: s,
20473
+ colIndex: this.ctx.host.getColIndex(o)
20474
+ }), this.ctx.deps.viewportEl.focus({ preventScroll: !0 }), !r && this.isOverlaySingleClickEditableColumn(i) && this.scheduleSingleClickEditingAfterPointerDown(i);
20473
20475
  };
20474
20476
  handleCellClick = async (e) => {
20475
20477
  if (e.button !== 0 || (this.ctx.deps.isCommitting() && (e.preventDefault(), await this.ctx.deps.awaitCommitIdle()), e.ctrlKey || e.metaKey || e.shiftKey)) return;
@@ -20478,26 +20480,13 @@ var ST = class {
20478
20480
  return;
20479
20481
  }
20480
20482
  let t = Gb(this.ctx.deps.rowModel, e.target);
20481
- if (!t) return;
20482
- if (this.emitRowPointerEvent("rowClicked", t), this.ctx.cellRangeInteraction.tryClearOnPlainClick(t), this.ctx.deps.isEditing()) {
20483
- if (As(this.ctx.deps.editBehavior) && this.ctx.deps.getEditingRowId() === t.rowId && t.colId !== this.ctx.deps.getEditingCell()?.colId && this.ctx.deps.focusRowEditingColumn?.(t.colId)) return;
20484
- if (this.isSameEditingTarget(t)) return this.ctx.cellCommentSession?.handleCellClick(e, t), void 0;
20485
- if (await this.ctx.deps.commitEditing(), this.ctx.deps.isEditing()) return;
20486
- }
20487
- if (this.ctx.focusController.focusCellTarget(t), this.ctx.cellCommentSession?.handleCellClick(e, t)) return;
20488
- if (As(this.ctx.deps.editBehavior)) {
20489
- let e = this.ctx.deps.columnModel.getColumnById(t.colId);
20490
- if (!e || Os(e, this.ctx.deps.editType) !== "singleClick") return;
20491
- this.ctx.cellCommentSession?.closeAll(), this.ctx.deps.tryStartRowEditing(t);
20492
- return;
20493
- }
20494
- let n = this.ctx.deps.columnModel.getColumnById(t.colId);
20495
- if (n) {
20496
- if (r(n)) {
20497
- (n.cellEditor === "checkbox" || n.cellEditor === "switch") && !this.ctx.focusController.isInlineToggleClickTarget(e.target) && this.ctx.focusController.toggleInlineToggleAtCell(t.rowId, t.colId, t.rowIndex);
20498
- return;
20483
+ if (t) {
20484
+ if (this.emitRowPointerEvent("rowClicked", t), this.ctx.cellRangeInteraction.tryClearOnPlainClick(t), this.ctx.deps.isEditing()) {
20485
+ if (As(this.ctx.deps.editBehavior) && this.ctx.deps.getEditingRowId() === t.rowId && t.colId !== this.ctx.deps.getEditingCell()?.colId && this.ctx.deps.focusRowEditingColumn?.(t.colId)) return;
20486
+ if (this.isSameEditingTarget(t)) return this.ctx.cellCommentSession?.handleCellClick(e, t), void 0;
20487
+ if (await this.ctx.deps.commitEditing(), this.ctx.deps.isEditing()) return;
20499
20488
  }
20500
- Os(n, this.ctx.deps.editType) === "singleClick" && (this.ctx.cellCommentSession?.closeAll(), this.ctx.deps.tryStartCellEditing(t));
20489
+ this.ctx.focusController.focusCellTarget(t), !this.ctx.cellCommentSession?.handleCellClick(e, t) && (this.consumePointerUpCellActionIfMatched(t) || this.maybeStartSingleClickEditing(e, t));
20501
20490
  }
20502
20491
  };
20503
20492
  handleCellDoubleClick = async (e) => {
@@ -20519,8 +20508,110 @@ var ST = class {
20519
20508
  unbind(e) {
20520
20509
  e.removeEventListener("mousedown", this.handleCellMouseDown, !0), e.removeEventListener("click", this.handleCellClick), e.removeEventListener("dblclick", this.handleCellDoubleClick);
20521
20510
  }
20511
+ tryBeginCellRangeDragFromMouseDown(e, t, n, r) {
20512
+ return r || this.shouldSkipCellRangeDragForInlineToggleWhileEditing(e, t) || !this.ctx.cellRangeDragSession.canStart(e, t, n) ? !1 : (t.preventDefault(), this.ctx.host.clearIndexFocusIfNeeded(e.colId), this.emitCellClicked(e), this.ctx.cellRangeDragSession.begin({
20513
+ anchorRowId: e.rowId,
20514
+ anchorColId: e.colId,
20515
+ anchorRowIndex: e.rowIndex,
20516
+ clientX: t.clientX,
20517
+ clientY: t.clientY,
20518
+ mode: n
20519
+ }), !0);
20520
+ }
20522
20521
  async commitEditingForCellRangeInteraction(e, t) {
20523
- return !this.ctx.deps.isEditing() || this.isSameEditingTarget(e) || t.target instanceof Element && mo(t.target) ? !0 : (this.ctx.deps.isCommitting() && await this.ctx.deps.awaitCommitIdle(), await this.ctx.deps.commitEditing(), !this.ctx.deps.isEditing());
20522
+ if (!this.ctx.deps.isEditing() || this.isSameEditingTarget(e)) return !0;
20523
+ let n = Gb(this.ctx.deps.rowModel, t.target);
20524
+ return n && this.isSameEditingTarget(n) && t.target instanceof Element && mo(t.target) ? !0 : (this.ctx.deps.isCommitting() && await this.ctx.deps.awaitCommitIdle(), await this.ctx.deps.commitEditing(), !this.ctx.deps.isEditing());
20525
+ }
20526
+ resolveCellTargetUnderPointer(e) {
20527
+ if (typeof document.elementsFromPoint != "function") return null;
20528
+ for (let t of document.elementsFromPoint(e.clientX, e.clientY)) {
20529
+ let e = Gb(this.ctx.deps.rowModel, t);
20530
+ if (e && !(this.ctx.deps.isEditing() && this.isSameEditingTarget(e))) return e;
20531
+ }
20532
+ return null;
20533
+ }
20534
+ resolveCellTargetByIds(e, t) {
20535
+ let n = this.ctx.deps.mountEl.querySelector(`.mg-row[data-row-id="${this.escapeCssAttr(String(e))}"]`);
20536
+ if (!n) return null;
20537
+ let r = n.querySelector(`.mg-cell[data-col-id="${this.escapeCssAttr(t)}"]`);
20538
+ return r ? Gb(this.ctx.deps.rowModel, r) : null;
20539
+ }
20540
+ escapeCssAttr(e) {
20541
+ return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
20542
+ }
20543
+ async completeSingleClickEditingGesture(e, t, n) {
20544
+ if (e.button !== 0) return;
20545
+ this.ctx.deps.isCommitting() && await this.ctx.deps.awaitCommitIdle();
20546
+ let i = this.resolveAnchoredCellTargetAtPointer(e, t, n) ?? this.resolveCellTargetByIds(t, n);
20547
+ if (!i) return;
20548
+ this.ctx.deps.isEditing() && !this.isSameEditingTarget(i) && await this.ctx.deps.commitEditing();
20549
+ let a = this.ctx.deps.columnModel.getColumnById(i.colId);
20550
+ if (a && r(a) && Ko(a.cellEditor) && Y(a, i.rowNode)) {
20551
+ this.ctx.focusController.focusCellTarget(i), this.ctx.focusController.isInlineToggleClickTarget(e.target) || this.ctx.focusController.toggleInlineToggleAtCell(i.rowId, i.colId, i.rowIndex), this.markPointerUpCellActionConsumed(i);
20552
+ return;
20553
+ }
20554
+ this.ctx.focusController.focusCellTarget(i), this.maybeStartSingleClickEditing(e, i), this.markPointerUpCellActionConsumed(i);
20555
+ }
20556
+ resolveAnchoredCellTargetAtPointer(e, t, n) {
20557
+ let r = String(t);
20558
+ if (typeof document.elementsFromPoint == "function") for (let t of document.elementsFromPoint(e.clientX, e.clientY)) {
20559
+ let e = Gb(this.ctx.deps.rowModel, t);
20560
+ if (e && String(e.rowId) === r && e.colId === n) return e;
20561
+ }
20562
+ let i = Gb(this.ctx.deps.rowModel, e.target);
20563
+ return i && String(i.rowId) === r && i.colId === n ? i : null;
20564
+ }
20565
+ scheduleSingleClickEditingAfterPointerDown(e) {
20566
+ this.clearPendingSingleClickGesture?.();
20567
+ let t = Symbol("single-click-edit");
20568
+ this.pendingSingleClickGesture = t;
20569
+ let n = e.rowId, r = e.colId, i = (e) => {
20570
+ this.pendingSingleClickGesture === t && e.button === 0 && (this.pendingSingleClickGesture = null, this.clearPendingSingleClickGesture = null, document.removeEventListener("mouseup", i, !0), document.removeEventListener("pointerup", i, !0), this.completeSingleClickEditingGesture(e, n, r));
20571
+ };
20572
+ document.addEventListener("mouseup", i, { capture: !0 }), document.addEventListener("pointerup", i, { capture: !0 }), this.clearPendingSingleClickGesture = () => {
20573
+ document.removeEventListener("mouseup", i, !0), document.removeEventListener("pointerup", i, !0);
20574
+ };
20575
+ }
20576
+ shouldSchedulePointerUpWhileEditingSwitch(e, t) {
20577
+ return this.isOverlaySingleClickEditableColumn(e) || this.shouldSkipCellRangeDragForInlineToggleWhileEditing(e, t);
20578
+ }
20579
+ isOverlaySingleClickEditableColumn(e) {
20580
+ if (As(this.ctx.deps.editBehavior)) return !1;
20581
+ let t = this.ctx.deps.columnModel.getColumnById(e.colId);
20582
+ return !t || r(t) || Os(t, this.ctx.deps.editType) !== "singleClick" ? !1 : Y(t, e.rowNode);
20583
+ }
20584
+ shouldSkipCellRangeDragForInlineToggleWhileEditing(e, t) {
20585
+ if (!this.ctx.deps.isEditing() || t.shiftKey || t.ctrlKey || t.metaKey || this.ctx.focusController.isInlineToggleClickTarget(t.target)) return !1;
20586
+ let n = this.ctx.deps.columnModel.getColumnById(e.colId);
20587
+ return !n || !r(n) || !Ko(n.cellEditor) ? !1 : Y(n, e.rowNode);
20588
+ }
20589
+ markPointerUpCellActionConsumed(e) {
20590
+ this.consumedPointerUpCellAction = {
20591
+ rowId: String(e.rowId),
20592
+ colId: e.colId
20593
+ };
20594
+ }
20595
+ consumePointerUpCellActionIfMatched(e) {
20596
+ let t = this.consumedPointerUpCellAction;
20597
+ return !t || String(e.rowId) !== t.rowId || e.colId !== t.colId ? !1 : (this.consumedPointerUpCellAction = null, !0);
20598
+ }
20599
+ maybeStartSingleClickEditing(e, t) {
20600
+ if (e.ctrlKey || e.metaKey || e.shiftKey || this.ctx.deps.isEditing() && (As(this.ctx.deps.editBehavior) && this.ctx.deps.getEditingRowId() === t.rowId && t.colId !== this.ctx.deps.getEditingCell()?.colId && this.ctx.deps.focusRowEditingColumn?.(t.colId) || this.isSameEditingTarget(t))) return;
20601
+ if (As(this.ctx.deps.editBehavior)) {
20602
+ let e = this.ctx.deps.columnModel.getColumnById(t.colId);
20603
+ if (!e || Os(e, this.ctx.deps.editType) !== "singleClick") return;
20604
+ this.ctx.cellCommentSession?.closeAll(), this.ctx.deps.tryStartRowEditing(t);
20605
+ return;
20606
+ }
20607
+ let n = this.ctx.deps.columnModel.getColumnById(t.colId);
20608
+ if (n) {
20609
+ if (r(n)) {
20610
+ (n.cellEditor === "checkbox" || n.cellEditor === "switch") && !this.ctx.focusController.isInlineToggleClickTarget(e.target) && this.ctx.focusController.toggleInlineToggleAtCell(t.rowId, t.colId, t.rowIndex);
20611
+ return;
20612
+ }
20613
+ Os(n, this.ctx.deps.editType) === "singleClick" && (this.ctx.cellCommentSession?.closeAll(), this.ctx.deps.tryStartCellEditing(t));
20614
+ }
20524
20615
  }
20525
20616
  isSameEditingTarget(e) {
20526
20617
  if (!this.ctx.deps.isEditing()) return !1;
@@ -25618,6 +25709,10 @@ var lO = class {
25618
25709
  stopEditing(e = !1) {
25619
25710
  return this.cellEditing.stopEditing(e).then(() => void 0);
25620
25711
  }
25712
+ async commit(e = !1) {
25713
+ let t = await this.cellEditing.commit(e);
25714
+ return e || await this.awaitCommitIdle(), e ? t : t && !this.cellEditing.isEditing();
25715
+ }
25621
25716
  isCommitting() {
25622
25717
  return this.cellEditing.isCommitting() || this.inlineCellEditorService.isCommitting();
25623
25718
  }