mn-angular-lib 2.0.57 → 2.0.59

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": "mn-angular-lib",
3
- "version": "2.0.57",
3
+ "version": "2.0.59",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -582,6 +582,11 @@ export type MnCheckboxProps = {
582
582
  name?: string;
583
583
  /** Label text displayed next to the checkbox */
584
584
  label?: string;
585
+ /**
586
+ * Accessible name when there is no visible label (e.g. a table selection cell).
587
+ * Prefer this over a visible `label` when the control must stay compact (cVNWtAqj).
588
+ */
589
+ ariaLabel?: string;
585
590
  /** Size variant of the checkbox (default: 'md') */
586
591
  size?: MnCheckboxVariants['size'];
587
592
  /** Color variant of the checkbox (default: 'primary') */
@@ -378,6 +378,36 @@ export declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnD
378
378
  isCurrentStepValid: boolean;
379
379
  isCompleting: boolean;
380
380
  wizardErrors: Record<string, string>;
381
+ /**
382
+ * Browser-history entries this wizard has below and including the current one,
383
+ * so Back steps the wizard instead of leaving the host page (em8TA5ZU).
384
+ * Always the current entry's position + 1; cleaned up on destroy / dismiss.
385
+ */
386
+ private historyDepth;
387
+ /** Set while our own history.back() is in flight, so its popstate is consumed. */
388
+ private ignorePopstate;
389
+ /** Settles a pending {@link unwindWizardHistory} once its popstate arrives. */
390
+ private resolveUnwind?;
391
+ /** How long Complete waits for the unwind's popstate before running anyway. */
392
+ private static readonly UNWIND_FALLBACK_MS;
393
+ /** history.state key holding the step id of a wizard entry. */
394
+ private static readonly HISTORY_STATE_KEY;
395
+ /**
396
+ * history.state key holding a wizard entry's position (0 = first). It tells
397
+ * Back from Forward: popstate has no direction, and in a free-flow wizard the
398
+ * trail of visited steps is not the visible step order.
399
+ */
400
+ private static readonly HISTORY_POS_KEY;
401
+ /**
402
+ * history.state key holding the id of the wizard that pushed the entry. An
403
+ * entry another wizard left behind (one that closed without unwinding) is
404
+ * then never mistaken for one of ours.
405
+ */
406
+ private static readonly HISTORY_ID_KEY;
407
+ /** Source of {@link historyId}; one per wizard opened in this page. */
408
+ private static nextHistoryId;
409
+ /** This wizard's id in its history entries. */
410
+ private readonly historyId;
381
411
  /**
382
412
  * Min-height (px) for the step container, sized to the tallest step so the
383
413
  * modal does not jump when navigating between steps. Monotonic — only grows.
@@ -405,6 +435,37 @@ export declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnD
405
435
  private statusSubscription?;
406
436
  private formBodiesSubscription?;
407
437
  ngOnInit(): void;
438
+ /** Builds the history.state for a wizard entry at `pos` showing the current step. */
439
+ private wizardHistoryState;
440
+ /** Whether the current history entry is one this wizard pushed. */
441
+ private isOwnHistoryEntry;
442
+ /** Push a history entry for the current step so browser Back stays inside the wizard. */
443
+ private pushWizardHistory;
444
+ /**
445
+ * Re-points the current wizard entry at the step on screen. The UI Back button
446
+ * goes to the previous *visible* step, which after a free-flow jump is not the
447
+ * step the entry underneath was pushed for.
448
+ */
449
+ private syncWizardHistoryEntry;
450
+ /**
451
+ * Browser Back / Forward (em8TA5ZU): show the step the entry was pushed for.
452
+ * The entry's position, compared to {@link historyDepth}, says which way the
453
+ * browser moved; leaving the first entry closes the wizard.
454
+ */
455
+ onBrowserBack(): void;
456
+ /**
457
+ * Apply a browser Forward. History has already advanced, so a step that may
458
+ * not be left (invalid form, guard, validator) sends the browser back again.
459
+ * @param stepId The step the restored entry was pushed for.
460
+ * @param fromDepth {@link historyDepth} before the Forward, restored on refusal.
461
+ */
462
+ private applyHistoryForward;
463
+ /**
464
+ * Apply a browser Back without touching history (history already moved).
465
+ * @param stepId The step the restored entry was pushed for.
466
+ */
467
+ private applyHistoryBack;
468
+ private dismissFromBrowserBack;
408
469
  ngAfterViewInit(): void;
409
470
  isTextBody(step: WizardStepConfig): boolean;
410
471
  /**
@@ -416,6 +477,22 @@ export declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnD
416
477
  private buildStepBodyConfig;
417
478
  goToStep(step: WizardStepConfig): Promise<void>;
418
479
  ngOnDestroy(): void;
480
+ /**
481
+ * Removes every entry this wizard pushed and waits until the browser is back
482
+ * on the host entry. Complete runs it *before* the completion handler, so a
483
+ * handler that navigates pushes its page right after the host entry instead
484
+ * of on top of the wizard's entries, which would leave dead Back presses.
485
+ * Resolves on the resulting popstate, or after a short fallback when none
486
+ * arrives (no history API, or a test stub).
487
+ */
488
+ private unwindWizardHistory;
489
+ /**
490
+ * Gives browser Back an entry to step on again after Complete unwound history
491
+ * but the wizard stays open (the handler returned `false` or threw).
492
+ */
493
+ private restoreWizardHistoryEntry;
494
+ /** Remove history entries we pushed when the wizard closes via Complete / X / Cancel. */
495
+ private dropWizardHistory;
419
496
  /**
420
497
  * Measures every step's natural height and records the tallest as
421
498
  * {@link measuredMinHeight}. Monotonic: the value only ever grows, so a
@@ -450,11 +527,29 @@ export declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnD
450
527
  get currentProgressIndex(): number;
451
528
  get isFreeFlow(): boolean;
452
529
  canNavigateToStep(step: WizardStepConfig): boolean;
530
+ /**
531
+ * Whether the current step may be left going forward: its form is valid
532
+ * (touching every field when not), its exit guard allows it and its
533
+ * validators pass. Shared by Next and browser Forward.
534
+ */
535
+ private canLeaveCurrentStep;
536
+ /**
537
+ * Whether `step`'s enter guard lets the user in.
538
+ * @param step The step about to become current.
539
+ */
540
+ private canEnterStep;
453
541
  next(): Promise<void>;
454
542
  /** Find the MnFormBodyComponent for the current step */
455
543
  private getCurrentFormBody;
456
544
  private trackCurrentStepValidity;
457
545
  back(): Promise<void>;
546
+ /**
547
+ * Keeps history in step with the UI Back button. Pops one entry (ignoring the
548
+ * resulting popstate, which then re-points the exposed entry at this step),
549
+ * but never the first one: after a free-flow jump the wizard can still go back
550
+ * while only one entry is ours, so that entry is re-pointed instead.
551
+ */
552
+ private popWizardHistoryEntry;
458
553
  /**
459
554
  * Activates a step and mirrors its title into {@link currentStepTitle} so the
460
555
  * shell can reflect the step name in the modal title on small screens.