@forgeroute/ui 0.5.17 → 0.5.18

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.
@@ -956,6 +956,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
956
956
  this.exclusive = signal(false, ...ngDevMode ? [{ debugName: "exclusive" }] : /* istanbul ignore next */ []);
957
957
  this.pluginPrimary = signal(null, ...ngDevMode ? [{ debugName: "pluginPrimary" }] : /* istanbul ignore next */ []);
958
958
  this.cancelHook = null;
959
+ this.closeGuard = null;
959
960
  this.liveMethodValue = "";
960
961
  this.completed = false;
961
962
  this.verificationReported = false;
@@ -1177,12 +1178,22 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
1177
1178
  this.finishTerminal();
1178
1179
  }
1179
1180
  onClose() {
1181
+ if (this.closeGuard) {
1182
+ let allowed = true;
1183
+ try {
1184
+ allowed = this.closeGuard();
1185
+ } catch {
1186
+ allowed = true;
1187
+ }
1188
+ if (!allowed) return;
1189
+ }
1180
1190
  this.cleanup();
1181
1191
  this.closed.emit();
1182
1192
  }
1183
1193
  runCancelHook() {
1184
1194
  const hook = this.cancelHook;
1185
1195
  this.cancelHook = null;
1196
+ this.closeGuard = null;
1186
1197
  if (hook) try {
1187
1198
  hook();
1188
1199
  } catch {}
@@ -1402,6 +1413,9 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
1402
1413
  onCancel: (fn) => {
1403
1414
  this.cancelHook = fn;
1404
1415
  },
1416
+ setCloseGuard: (fn) => {
1417
+ this.closeGuard = fn;
1418
+ },
1405
1419
  report: (code, extra) => {
1406
1420
  if (this.destroyed) return;
1407
1421
  this.verificationReported = code === "verification";
@@ -1422,6 +1436,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
1422
1436
  if (this.completed || this.destroyed) return;
1423
1437
  this.completed = true;
1424
1438
  this.cancelHook = null;
1439
+ this.closeGuard = null;
1425
1440
  this.pluginBusy.set(false);
1426
1441
  const result = {
1427
1442
  type: partial?.type ?? "manual",