@openmfp/ngx 0.12.6 → 0.12.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmfp/ngx",
3
- "version": "0.12.6",
3
+ "version": "0.12.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/openmfp/webcomponents.git"
@@ -441,6 +441,17 @@ declare class Dashboard implements OnInit, OnDestroy {
441
441
  editMode: _angular_core.WritableSignal<boolean>;
442
442
  compactToolbar: _angular_core.WritableSignal<boolean>;
443
443
  toolbarMenuOpen: _angular_core.WritableSignal<boolean>;
444
+ /** True once the user has dragged/resized any grid item while in edit mode. */
445
+ private gridDirty;
446
+ /** JSON snapshots of sections/cards taken on entering edit mode, used to detect changes. */
447
+ private sectionsSnapshotJson;
448
+ private cardsSnapshotJson;
449
+ /**
450
+ * True when the user is in edit mode AND has made any change (sections/cards
451
+ * mutated, or grid items moved/resized). Resets when entering edit mode and
452
+ * after save/cancel.
453
+ */
454
+ hasUnsavedChanges: _angular_core.Signal<boolean>;
444
455
  private sectionsSnapshot;
445
456
  private cardsSnapshot;
446
457
  private gridStackItems;
@@ -453,6 +464,12 @@ declare class Dashboard implements OnInit, OnDestroy {
453
464
  protected safeDescription: _angular_core.Signal<SafeHtml | null>;
454
465
  protected gridOptions: _angular_core.Signal<GridStackOptions>;
455
466
  cardDialogOpen: _angular_core.WritableSignal<boolean>;
467
+ discardDialogOpen: _angular_core.WritableSignal<boolean>;
468
+ unsavedNavDialogOpen: _angular_core.WritableSignal<boolean>;
469
+ /** Callback that resumes the intercepted navigation once the user resolves the dialog. */
470
+ private pendingNavigation;
471
+ /** beforeunload handler kept on instance so add/removeEventListener pair up. */
472
+ private readonly beforeUnloadHandler;
456
473
  customActions: _angular_core.Signal<ButtonSettings[]>;
457
474
  addedCardsIds: _angular_core.Signal<Set<string>>;
458
475
  editViewButton: _angular_core.Signal<{
@@ -488,6 +505,48 @@ declare class Dashboard implements OnInit, OnDestroy {
488
505
  enterEditMode(): void;
489
506
  saveEdit(): void;
490
507
  cancelEdit(): void;
508
+ /**
509
+ * Confirms abandoning unsaved edit-mode changes: closes the discard popup
510
+ * and reverts sections/cards to the snapshot taken on entering edit mode.
511
+ */
512
+ confirmDiscard(): void;
513
+ /**
514
+ * Cancels the discard popup and keeps the user in edit mode with their
515
+ * pending changes intact.
516
+ */
517
+ cancelDiscard(): void;
518
+ /**
519
+ * Public framework-agnostic navigation guard. Consumer apps (Angular Router
520
+ * CanDeactivate guard, Luigi navigation listener, plain `<a>` click handler,
521
+ * window history listener — anything) call this before performing their
522
+ * navigation:
523
+ *
524
+ * if (dashboard.requestNavigation(() => router.navigateByUrl(target))) {
525
+ * // already navigated synchronously — clean state
526
+ * } else {
527
+ * // dashboard popped the unsaved-changes dialog; the navigation will
528
+ * // resume from the user's choice (Save → proceed, Discard → proceed,
529
+ * // Cancel → drop the request entirely).
530
+ * }
531
+ *
532
+ * Returns `true` when navigation may proceed immediately (no unsaved
533
+ * changes — `proceed` was invoked synchronously). Returns `false` when the
534
+ * dialog has been opened and the caller must NOT navigate; the dashboard
535
+ * will run the callback later if the user picks Save or Discard.
536
+ *
537
+ * If a previous navigation is already pending, that one is dropped in
538
+ * favour of the new request — Cancel always means "stay here", so losing
539
+ * the older queued navigation is the correct outcome.
540
+ */
541
+ requestNavigation(proceed: () => void): boolean;
542
+ /** Save → persist changes, close the dialog, then resume navigation. */
543
+ onUnsavedNavSave(): void;
544
+ /** Discard → revert to snapshot, close the dialog, then resume navigation. */
545
+ onUnsavedNavDiscard(): void;
546
+ /** Cancel → drop the queued navigation and stay in edit mode. */
547
+ onUnsavedNavCancel(): void;
548
+ private runPendingNavigation;
549
+ private discardEdit;
491
550
  removeSection(id: string): void;
492
551
  removeCard(id: string): void;
493
552
  openCardPanel(): void;
@@ -503,6 +562,7 @@ declare class Dashboard implements OnInit, OnDestroy {
503
562
  }
504
563
 
505
564
  declare class EditCardsDialog {
565
+ private readonly host;
506
566
  availableCards: _angular_core.InputSignal<CardConfig[]>;
507
567
  addedCardsIds: _angular_core.InputSignal<Set<string>>;
508
568
  open: _angular_core.InputSignal<boolean>;
@@ -514,11 +574,51 @@ declare class EditCardsDialog {
514
574
  selectedIds: _angular_core.WritableSignal<Set<string>>;
515
575
  constructor();
516
576
  toggle(id: string): void;
577
+ /**
578
+ * Tab moves focus across the switches directly, skipping the wrapping
579
+ * ui5-li-custom rows. Past the last switch Tab goes to the first footer
580
+ * button; before the first switch Shift+Tab goes to the last footer button.
581
+ * The dialog's native focus trap takes care of cycling from the buttons
582
+ * back into the list.
583
+ */
584
+ onSwitchKeydown(event: KeyboardEvent, _id: string): void;
517
585
  confirmSave(): void;
518
586
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditCardsDialog, never>;
519
587
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditCardsDialog, "mfp-edit-cards-dialog", never, { "availableCards": { "alias": "availableCards"; "required": false; "isSignal": true; }; "addedCardsIds": { "alias": "addedCardsIds"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "confirm": "confirm"; "cancelled": "cancelled"; }, never, never, true, never>;
520
588
  }
521
589
 
590
+ /**
591
+ * Confirmation popup shown when the user tries to abandon edit mode while
592
+ * there are unsaved dashboard changes. Emits `confirm` when the user accepts
593
+ * the discard, `cancelled` when they back out.
594
+ */
595
+ declare class DiscardChangesDialog {
596
+ open: _angular_core.InputSignal<boolean>;
597
+ readonly confirm: _angular_core.OutputEmitterRef<void>;
598
+ readonly cancelled: _angular_core.OutputEmitterRef<void>;
599
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DiscardChangesDialog, never>;
600
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DiscardChangesDialog, "mfp-discard-changes-dialog", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "confirm": "confirm"; "cancelled": "cancelled"; }, never, never, true, never>;
601
+ }
602
+
603
+ /**
604
+ * Confirmation popup shown when the user attempts to navigate away from the
605
+ * dashboard while there are unsaved edit-mode changes. The host (the
606
+ * dashboard, an Angular CanDeactivate guard, a Luigi navigation listener,
607
+ * etc.) is responsible for routing its intercepted navigation through this
608
+ * dialog and acting on the emitted decision:
609
+ * - `save` → persist changes, then proceed with navigation
610
+ * - `discard` → revert changes, then proceed with navigation
611
+ * - `cancelled` → abort navigation, stay on the page
612
+ */
613
+ declare class UnsavedChangesDialog {
614
+ open: _angular_core.InputSignal<boolean>;
615
+ readonly save: _angular_core.OutputEmitterRef<void>;
616
+ readonly discard: _angular_core.OutputEmitterRef<void>;
617
+ readonly cancelled: _angular_core.OutputEmitterRef<void>;
618
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UnsavedChangesDialog, never>;
619
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UnsavedChangesDialog, "mfp-unsaved-changes-dialog", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "save": "save"; "discard": "discard"; "cancelled": "cancelled"; }, never, never, true, never>;
620
+ }
621
+
522
622
  declare class DashboardCard {
523
623
  card: _angular_core.InputSignal<CardConfig>;
524
624
  editMode: _angular_core.InputSignal<boolean>;
@@ -1183,5 +1283,5 @@ declare class WhatsNew {
1183
1283
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<WhatsNew, "mfp-whats-new", never, {}, {}, never, never, true, never>;
1184
1284
  }
1185
1285
 
1186
- export { BooleanValue, CARD_TYPES, Dashboard, DashboardCard, DashboardSection, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, EditCardsDialog, Favorites, LinkValue, ResourceField, SecretValue, ServiceStatusCard, TagListValue, VisitedServiceCard, WhatsNew };
1286
+ export { BooleanValue, CARD_TYPES, Dashboard, DashboardCard, DashboardSection, DeclarativeForm, DeclarativeTable, DeclarativeTableCard, DiscardChangesDialog, EditCardsDialog, Favorites, LinkValue, ResourceField, SecretValue, ServiceStatusCard, TagListValue, UnsavedChangesDialog, VisitedServiceCard, WhatsNew };
1187
1287
  export type { ButtonSettings, CardConfig, CardsType, CssRule, CssRuleCondition, DashboardButtonsSettings, DashboardConfig, DeleteResourceConfirmationConfig, FieldDefinition, FormFieldChangeEvent, FormFieldDefinition, FormFieldErrors, GenericResource, IconDesignType, ModalSettings, PropertyField, ResourceFieldButtonClickEvent, ResourceFormConfig, SectionConfig, ServiceStatusItem, ServiceStatusValue, TableCardButtonSettings, TableCardConfig, TableCardFormState, TableConfig, TableFieldDefinition, TransformType, UiSettings };