mn-angular-lib 1.0.155 → 1.0.157

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,9 +1,10 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "1.0.155",
3
+ "version": "1.0.157",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3",
7
+ "@angular/router": "^21.1.3",
7
8
  "@lucide/angular": "^1.18.0",
8
9
  "quill": "^2.0.3"
9
10
  },
@@ -6709,6 +6709,16 @@ type FormFieldView<TModel> = FormFieldConfig<TModel> & {
6709
6709
  };
6710
6710
  declare class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {
6711
6711
  private fb;
6712
+ /**
6713
+ * Change detector used to announce state this component mutates outside an Angular
6714
+ * event handler — after an `await`, or from an RxJS subscription. Consuming apps run
6715
+ * zoneless, where such a write notifies nothing: the view is never marked dirty, so it
6716
+ * keeps rendering the stale value and `checkNoChanges` then reports it as NG0100
6717
+ * (e.g. the submit button staying disabled on "Submitting..." after a failed submit).
6718
+ * Every async mutation of {@link isSubmitting}, {@link fieldLoading}, {@link fieldOptions}
6719
+ * and {@link formErrors} must be followed by `markForCheck()`.
6720
+ */
6721
+ private readonly cdr;
6712
6722
  config: FormModalConfig<TModel, TResult>;
6713
6723
  modalRef: MnModalRef<TResult>;
6714
6724
  hideFooter: boolean;
@@ -7473,6 +7483,7 @@ declare class CalendarViewComponent implements OnInit, OnDestroy {
7473
7483
  private readonly mnConfigRef;
7474
7484
  private readonly destroyRef;
7475
7485
  private readonly lang;
7486
+ private readonly cdr;
7476
7487
  constructor();
7477
7488
  onResize(): void;
7478
7489
  ngOnInit(): void;
@@ -7678,6 +7689,7 @@ declare class CalendarDayComponent implements OnInit, OnDestroy {
7678
7689
  */
7679
7690
  declare class CalendarMonthComponent implements OnInit, OnDestroy {
7680
7691
  private readonly lang;
7692
+ private readonly cdr;
7681
7693
  /**
7682
7694
  * Accessible name for this control. Resolved through the conventional
7683
7695
  * `mnCalendar.monthView` key so an app can translate it, falling back to English when the
@@ -7772,6 +7784,7 @@ declare class CalendarEventDefaultComponent implements CalendarEventData, OnInit
7772
7784
  */
7773
7785
  declare class UpcomingEventsComponent implements OnInit, OnChanges, OnDestroy {
7774
7786
  private readonly lang;
7787
+ private readonly cdr;
7775
7788
  /**
7776
7789
  * Accessible name for this control. Resolved through the conventional
7777
7790
  * `mnCalendar.upcomingEvents` key so an app can translate it, falling back to English when the
@@ -7963,6 +7976,17 @@ declare class CalendarUtility {
7963
7976
  type MnTabItem = {
7964
7977
  /** Translation key or label text for the tab. */
7965
7978
  label: string;
7979
+ /**
7980
+ * Stable value this tab is written as in the URL while the tab bar mirrors
7981
+ * its selection there (see {@link MnTabDataSource.urlParam}).
7982
+ *
7983
+ * Defaults to a slug of the last segment of {@link label}
7984
+ * (`matches.hub.tab.entrants` → `entrants`, `members.tabMembers` →
7985
+ * `tab-members`). Set it when that slug is not the URL you want to hand out,
7986
+ * or when the label key may be renamed — a shared link is only as stable as
7987
+ * the value in it.
7988
+ */
7989
+ id?: string;
7966
7990
  /** Callback invoked when this tab becomes active. */
7967
7991
  onClick?: () => void;
7968
7992
  /** Callback invoked when this tab is deactivated. */
@@ -7990,13 +8014,59 @@ type MnTabDataSource = {
7990
8014
  * (e.g. tabs that depend on data being fetched) to predict the final count.
7991
8015
  */
7992
8016
  skeletonCount?: number;
8017
+ /**
8018
+ * Query parameter the active tab is mirrored in, so a reload or a shared
8019
+ * link lands on the tab the user was looking at. Defaults to `'tab'`; pass
8020
+ * `false` to keep this tab bar out of the URL.
8021
+ *
8022
+ * Each tab bar that can be on screen at the same time as another needs its
8023
+ * own parameter name — two bars sharing one name fight over it. Turn it off
8024
+ * for a tab bar whose selection is not worth sharing, such as one inside a
8025
+ * modal, which would otherwise write to the URL of the page behind it.
8026
+ *
8027
+ * Only user selections are written, so a page nobody has clicked a tab on
8028
+ * keeps a clean URL and falls back to {@link defaultActive}. Restoring a tab
8029
+ * from the URL runs that tab's {@link MnTabItem.onClick} and emits
8030
+ * `activeChange`, so a consumer tracking the active tab itself hears about
8031
+ * the restored one.
8032
+ */
8033
+ urlParam?: string | false;
7993
8034
  };
7994
8035
 
7995
8036
  /**
7996
8037
  * Tab component that renders a horizontal tab bar.
7997
8038
  * Supports translation keys for labels via MnTranslatePipe.
8039
+ *
8040
+ * The active tab is mirrored in the URL query string by default, so a reload,
8041
+ * a back button or a shared link lands on the same tab; see
8042
+ * {@link MnTabDataSource.urlParam} to rename that parameter or switch it off.
7998
8043
  */
7999
8044
  declare class MnTabComponent implements DoCheck, AfterViewInit, OnDestroy {
8045
+ /**
8046
+ * Router the active tab is written to. Optional: a tab bar used outside a
8047
+ * routed application still works, it just has no URL to mirror into.
8048
+ */
8049
+ private readonly router;
8050
+ /** Route the tab value is read back from; absent for the same reason as {@link router}. */
8051
+ private readonly route;
8052
+ /** Watches the URL so a deep link, a back button or an in-app link moves the tab bar. */
8053
+ private readonly queryParamsSub?;
8054
+ /**
8055
+ * URL keys of the current items, memoised on the items array so a slug is
8056
+ * computed once per tab set rather than on every change-detection pass.
8057
+ */
8058
+ private urlKeyCache?;
8059
+ /** URL key of {@link currentActive}, so a rebuilt tab set can be recognised as the same tab. */
8060
+ private currentKey?;
8061
+ /**
8062
+ * Key of a selection whose URL write has not landed yet. Navigation is
8063
+ * asynchronous, so a consumer that rebuilds its tabs in response to the click
8064
+ * can be resolved against a URL that still names the previous tab; until the
8065
+ * write completes, this is the truth about what the user picked.
8066
+ */
8067
+ private pendingKey?;
8068
+ /** Set on destroy so a deferred restore can't announce a tab nobody is showing. */
8069
+ private destroyed;
8000
8070
  /** The horizontally-scrolling wrapper the edge fade is painted onto. */
8001
8071
  private scrollContainer?;
8002
8072
  /** The tab row; queried for the active tab so the indicator can measure it. */
@@ -8054,6 +8124,7 @@ declare class MnTabComponent implements DoCheck, AfterViewInit, OnDestroy {
8054
8124
  * otherwise the number of known items, falling back to a default when none.
8055
8125
  */
8056
8126
  get skeletonTabs(): number[];
8127
+ constructor();
8057
8128
  /**
8058
8129
  * Re-resolves the active tab on every change-detection pass.
8059
8130
  *
@@ -8080,10 +8151,19 @@ declare class MnTabComponent implements DoCheck, AfterViewInit, OnDestroy {
8080
8151
  */
8081
8152
  updateEdgeFades(): void;
8082
8153
  /**
8083
- * Sets the given tab item as active, invoking deactivate/activate callbacks.
8154
+ * Sets the given tab item as active, invoking deactivate/activate callbacks,
8155
+ * and records the selection in the URL so it survives a reload or a share.
8084
8156
  * @param item - The tab item to activate.
8085
8157
  */
8086
8158
  setActive(item: MnTabItem): void;
8159
+ /**
8160
+ * Moves the selection to `item` and tells the consumer about it: the
8161
+ * deactivate/activate/emit sequence a click produces, shared by the click
8162
+ * path and the URL-driven ones (deep link, back button), which owe the
8163
+ * consumer the same notifications.
8164
+ * @param item - The tab item to activate.
8165
+ */
8166
+ private activate;
8087
8167
  /**
8088
8168
  * Marks a click-driven slide as in progress and schedules the guard to lift
8089
8169
  * once the transition has finished. A timeout (not `transitionend`) so the
@@ -8111,10 +8191,54 @@ declare class MnTabComponent implements DoCheck, AfterViewInit, OnDestroy {
8111
8191
  getBadge(item: MnTabItem): number | undefined;
8112
8192
  /**
8113
8193
  * Ensures {@link currentActive} references a tab that still exists in the data
8114
- * source, falling back to the configured default tab when the current
8115
- * selection is missing or stale (e.g. after the items array is replaced).
8194
+ * source, preferring the tab named in the URL and falling back to the
8195
+ * configured default tab when the current selection is missing or stale
8196
+ * (e.g. after the items array is replaced).
8116
8197
  */
8117
8198
  private syncActiveTab;
8199
+ /**
8200
+ * Records `item` as the selection, remembering its URL key so the same tab is
8201
+ * recognised after the consumer rebuilds the items array.
8202
+ * @param item - The newly selected tab.
8203
+ */
8204
+ private select;
8205
+ /**
8206
+ * Runs the restored tab's callbacks a change-detection pass later, unless the
8207
+ * selection moved on in the meantime (a click, or another tab set arriving).
8208
+ * @param item - The tab restored from the URL.
8209
+ */
8210
+ private announceRestored;
8211
+ /**
8212
+ * Activates the tab a URL value names, when it is not the tab already on
8213
+ * screen. Values naming no known tab are ignored: another tab bar on the page
8214
+ * may own that parameter, and a stale link should leave the default standing.
8215
+ * @param key - The value read from the query parameter, if any.
8216
+ */
8217
+ private activateUrlKey;
8218
+ /**
8219
+ * The query parameter this tab bar mirrors into, or undefined when there is
8220
+ * nothing to mirror into (no router) or the consumer switched it off.
8221
+ */
8222
+ private urlParam;
8223
+ /**
8224
+ * The tab the current URL asks for, if it names one of `items`.
8225
+ * @param items - The tab set to resolve the URL value against.
8226
+ */
8227
+ private itemFromUrl;
8228
+ /**
8229
+ * Records the active tab in the query string, replacing the current history
8230
+ * entry: switching tabs is not a navigation to walk back through, and back
8231
+ * should leave the page rather than retrace its tabs.
8232
+ * @param item - The tab that just became active.
8233
+ */
8234
+ private writeUrl;
8235
+ /**
8236
+ * The URL key of every tab, in item order: the item's `id`, else a slug of
8237
+ * its label. Repeats are numbered so each tab still round-trips through the
8238
+ * URL; give such tabs an explicit `id` to choose the value yourself.
8239
+ * @param items - The tab set to key.
8240
+ */
8241
+ private urlKeys;
8118
8242
  static ɵfac: i0.ɵɵFactoryDeclaration<MnTabComponent, never>;
8119
8243
  static ɵcmp: i0.ɵɵComponentDeclaration<MnTabComponent, "mn-tab", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "scrollable": { "alias": "scrollable"; "required": false; }; "justified": { "alias": "justified"; "required": false; }; }, { "activeChange": "activeChange"; }, never, never, true, never>;
8120
8244
  }