@mmstack/router-core 20.0.1 → 20.0.3
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/fesm2022/mmstack-router-core.mjs +46 -46
- package/fesm2022/mmstack-router-core.mjs.map +1 -1
- package/index.d.ts +405 -6
- package/package.json +5 -5
- package/lib/breadcrumb/breadcrumb.config.d.ts +0 -73
- package/lib/breadcrumb/breadcrumb.resolver.d.ts +0 -58
- package/lib/breadcrumb/breadcrumb.store.d.ts +0 -44
- package/lib/breadcrumb/breadcrumb.type.d.ts +0 -57
- package/lib/breadcrumb/public_api.d.ts +0 -4
- package/lib/link.directive.d.ts +0 -52
- package/lib/preloading/index.d.ts +0 -2
- package/lib/preloading/preload.service.d.ts +0 -8
- package/lib/preloading/preload.strategy.d.ts +0 -11
- package/lib/preloading/public_api.d.ts +0 -1
- package/lib/query-param.d.ts +0 -78
- package/lib/title/public_api.d.ts +0 -2
- package/lib/title/title.config.d.ts +0 -31
- package/lib/title/title.store.d.ts +0 -23
- package/lib/url.d.ts +0 -32
- package/lib/util/create-route-predicate.d.ts +0 -1
- package/lib/util/find-path.d.ts +0 -2
- package/lib/util/index.d.ts +0 -4
- package/lib/util/leaf.store.d.ts +0 -21
- package/lib/util/snapshot-path.d.ts +0 -2
|
@@ -139,15 +139,15 @@ function leafRoutes() {
|
|
|
139
139
|
const leafRoutes = computed(() => {
|
|
140
140
|
currentUrl();
|
|
141
141
|
return getLeafRoutes(router.routerState.snapshot);
|
|
142
|
-
});
|
|
142
|
+
}, ...(ngDevMode ? [{ debugName: "leafRoutes" }] : []));
|
|
143
143
|
return leafRoutes;
|
|
144
144
|
}
|
|
145
145
|
class RouteLeafStore {
|
|
146
146
|
leaves = leafRoutes();
|
|
147
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
148
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: RouteLeafStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
148
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: RouteLeafStore, providedIn: 'root' });
|
|
149
149
|
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: RouteLeafStore, decorators: [{
|
|
151
151
|
type: Injectable,
|
|
152
152
|
args: [{
|
|
153
153
|
providedIn: 'root',
|
|
@@ -212,7 +212,7 @@ function generateLabel(leaf) {
|
|
|
212
212
|
return parsePathSegment$1(leaf.segment.path);
|
|
213
213
|
}
|
|
214
214
|
function autoGenerateBreadcrumb(id, leaf, autoGenerateFn) {
|
|
215
|
-
const label = computed(() => autoGenerateFn()(leaf()));
|
|
215
|
+
const label = computed(() => autoGenerateFn()(leaf()), ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
216
216
|
return createInternalBreadcrumb({
|
|
217
217
|
id,
|
|
218
218
|
label,
|
|
@@ -260,7 +260,7 @@ class BreadcrumbStore {
|
|
|
260
260
|
autoGenerateLabelFn = injectGenerateLabelFn();
|
|
261
261
|
leafRoutes = injectLeafRoutes();
|
|
262
262
|
all = mapArray(this.leafRoutes, (leaf) => {
|
|
263
|
-
const stableId = computed(() => leaf().path);
|
|
263
|
+
const stableId = computed(() => leaf().path, ...(ngDevMode ? [{ debugName: "stableId" }] : []));
|
|
264
264
|
return exposeActiveSignal(computed(() => {
|
|
265
265
|
const id = stableId();
|
|
266
266
|
const found = this.map().get(id);
|
|
@@ -278,15 +278,15 @@ class BreadcrumbStore {
|
|
|
278
278
|
}, {
|
|
279
279
|
equal: (a, b) => a.link === b.link,
|
|
280
280
|
});
|
|
281
|
-
crumbs = computed(() => this.all().filter((c) => c.active()));
|
|
282
|
-
unwrapped = computed(() => this.crumbs().map((c) => c()));
|
|
281
|
+
crumbs = computed(() => this.all().filter((c) => c.active()), ...(ngDevMode ? [{ debugName: "crumbs" }] : []));
|
|
282
|
+
unwrapped = computed(() => this.crumbs().map((c) => c()), ...(ngDevMode ? [{ debugName: "unwrapped" }] : []));
|
|
283
283
|
register(breadcrumb) {
|
|
284
284
|
this.map.inline((m) => m.set(breadcrumb.id, breadcrumb));
|
|
285
285
|
}
|
|
286
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
287
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
286
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
287
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbStore, providedIn: 'root' });
|
|
288
288
|
}
|
|
289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: BreadcrumbStore, decorators: [{
|
|
290
290
|
type: Injectable,
|
|
291
291
|
args: [{
|
|
292
292
|
providedIn: 'root',
|
|
@@ -554,7 +554,7 @@ function createBreadcrumb(factory) {
|
|
|
554
554
|
const fp = resolver(route);
|
|
555
555
|
const tree = createUrlTreeFromSnapshot(route, [], route.queryParams, route.fragment);
|
|
556
556
|
const provided = factory();
|
|
557
|
-
const link = computed(() => router.serializeUrl(tree));
|
|
557
|
+
const link = computed(() => router.serializeUrl(tree), ...(ngDevMode ? [{ debugName: "link" }] : []));
|
|
558
558
|
const { label, ariaLabel = label } = provided;
|
|
559
559
|
const bc = {
|
|
560
560
|
id: fp,
|
|
@@ -577,10 +577,10 @@ class PreloadService {
|
|
|
577
577
|
startPreload(routePath) {
|
|
578
578
|
this.preloadOnDemand$.next(routePath);
|
|
579
579
|
}
|
|
580
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
581
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
580
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
581
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadService, providedIn: 'root' });
|
|
582
582
|
}
|
|
583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadService, decorators: [{
|
|
584
584
|
type: Injectable,
|
|
585
585
|
args: [{ providedIn: 'root' }]
|
|
586
586
|
}] });
|
|
@@ -620,10 +620,10 @@ class PreloadStrategy {
|
|
|
620
620
|
const predicate = createRoutePredicate(fp);
|
|
621
621
|
return this.svc.preloadRequested$.pipe(filter$1((path) => path === fp || predicate(path)), take(1), switchMap(() => load()), finalize(() => this.loading.delete(fp)));
|
|
622
622
|
}
|
|
623
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
624
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
624
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadStrategy, providedIn: 'root' });
|
|
625
625
|
}
|
|
626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: PreloadStrategy, decorators: [{
|
|
627
627
|
type: Injectable,
|
|
628
628
|
args: [{
|
|
629
629
|
providedIn: 'root',
|
|
@@ -688,28 +688,28 @@ class LinkDirective {
|
|
|
688
688
|
}) ?? inject(RouterLinkWithHref, { self: true, optional: true });
|
|
689
689
|
svc = inject(PreloadService);
|
|
690
690
|
router = inject(Router);
|
|
691
|
-
target = input();
|
|
692
|
-
queryParams = input();
|
|
693
|
-
fragment = input();
|
|
694
|
-
queryParamsHandling = input();
|
|
695
|
-
state = input();
|
|
696
|
-
info = input();
|
|
697
|
-
relativeTo = input();
|
|
698
|
-
skipLocationChange = input(false, { transform: booleanAttribute });
|
|
699
|
-
replaceUrl = input(false, { transform: booleanAttribute });
|
|
700
|
-
mmLink = input(null);
|
|
701
|
-
preloadOn = input(injectConfig().preloadOn);
|
|
702
|
-
useMouseDown = input(injectConfig().useMouseDown, {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
beforeNavigate = input();
|
|
691
|
+
target = input(...(ngDevMode ? [undefined, { debugName: "target" }] : []));
|
|
692
|
+
queryParams = input(...(ngDevMode ? [undefined, { debugName: "queryParams" }] : []));
|
|
693
|
+
fragment = input(...(ngDevMode ? [undefined, { debugName: "fragment" }] : []));
|
|
694
|
+
queryParamsHandling = input(...(ngDevMode ? [undefined, { debugName: "queryParamsHandling" }] : []));
|
|
695
|
+
state = input(...(ngDevMode ? [undefined, { debugName: "state" }] : []));
|
|
696
|
+
info = input(...(ngDevMode ? [undefined, { debugName: "info" }] : []));
|
|
697
|
+
relativeTo = input(...(ngDevMode ? [undefined, { debugName: "relativeTo" }] : []));
|
|
698
|
+
skipLocationChange = input(false, ...(ngDevMode ? [{ debugName: "skipLocationChange", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
699
|
+
replaceUrl = input(false, ...(ngDevMode ? [{ debugName: "replaceUrl", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
700
|
+
mmLink = input(null, ...(ngDevMode ? [{ debugName: "mmLink" }] : []));
|
|
701
|
+
preloadOn = input(injectConfig().preloadOn, ...(ngDevMode ? [{ debugName: "preloadOn" }] : []));
|
|
702
|
+
useMouseDown = input(injectConfig().useMouseDown, ...(ngDevMode ? [{ debugName: "useMouseDown", transform: booleanAttribute }] : [{
|
|
703
|
+
transform: booleanAttribute,
|
|
704
|
+
}]));
|
|
705
|
+
beforeNavigate = input(...(ngDevMode ? [undefined, { debugName: "beforeNavigate" }] : []));
|
|
706
706
|
preloading = output();
|
|
707
707
|
urlTree = computed(() => {
|
|
708
708
|
return inputToUrlTree(this.router, this.mmLink(), this.relativeTo(), this.queryParams(), this.fragment(), this.queryParamsHandling(), this.routerLink?.urlTree);
|
|
709
|
-
});
|
|
709
|
+
}, ...(ngDevMode ? [{ debugName: "urlTree" }] : []));
|
|
710
710
|
fullPath = computed(() => {
|
|
711
711
|
return treeToSerializedUrl(this.router, this.urlTree());
|
|
712
|
-
});
|
|
712
|
+
}, ...(ngDevMode ? [{ debugName: "fullPath" }] : []));
|
|
713
713
|
onHover() {
|
|
714
714
|
if (untracked(this.preloadOn) !== 'hover')
|
|
715
715
|
return;
|
|
@@ -745,10 +745,10 @@ class LinkDirective {
|
|
|
745
745
|
untracked(this.beforeNavigate)?.();
|
|
746
746
|
return this.routerLink?.onClick(button, ctrlKey, shiftKey, altKey, metaKey);
|
|
747
747
|
}
|
|
748
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
749
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0
|
|
748
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: LinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
749
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.0", type: LinkDirective, isStandalone: true, selector: "[mmLink]", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, fragment: { classPropertyName: "fragment", publicName: "fragment", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, info: { classPropertyName: "info", publicName: "info", isSignal: true, isRequired: false, transformFunction: null }, relativeTo: { classPropertyName: "relativeTo", publicName: "relativeTo", isSignal: true, isRequired: false, transformFunction: null }, skipLocationChange: { classPropertyName: "skipLocationChange", publicName: "skipLocationChange", isSignal: true, isRequired: false, transformFunction: null }, replaceUrl: { classPropertyName: "replaceUrl", publicName: "replaceUrl", isSignal: true, isRequired: false, transformFunction: null }, mmLink: { classPropertyName: "mmLink", publicName: "mmLink", isSignal: true, isRequired: false, transformFunction: null }, preloadOn: { classPropertyName: "preloadOn", publicName: "preloadOn", isSignal: true, isRequired: false, transformFunction: null }, useMouseDown: { classPropertyName: "useMouseDown", publicName: "useMouseDown", isSignal: true, isRequired: false, transformFunction: null }, beforeNavigate: { classPropertyName: "beforeNavigate", publicName: "beforeNavigate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { preloading: "preloading" }, host: { listeners: { "mouseenter": "onHover()", "mousedown": "onMouseDown($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)", "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" } }, exportAs: ["mmLink"], hostDirectives: [{ directive: i1.RouterLink, inputs: ["routerLink", "mmLink", "target", "target", "queryParams", "queryParams", "fragment", "fragment", "queryParamsHandling", "queryParamsHandling", "state", "state", "relativeTo", "relativeTo", "skipLocationChange", "skipLocationChange", "replaceUrl", "replaceUrl"] }], ngImport: i0 });
|
|
750
750
|
}
|
|
751
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: LinkDirective, decorators: [{
|
|
752
752
|
type: Directive,
|
|
753
753
|
args: [{
|
|
754
754
|
selector: '[mmLink]',
|
|
@@ -883,7 +883,7 @@ function queryParam(key) {
|
|
|
883
883
|
const queryParams = toSignal(route.queryParams, {
|
|
884
884
|
initialValue: route.snapshot.queryParams,
|
|
885
885
|
});
|
|
886
|
-
const queryParam = computed(() => queryParamMap().get(keySignal()));
|
|
886
|
+
const queryParam = computed(() => queryParamMap().get(keySignal()), ...(ngDevMode ? [{ debugName: "queryParam" }] : []));
|
|
887
887
|
const set = (newValue) => {
|
|
888
888
|
const next = {
|
|
889
889
|
...untracked(queryParams),
|
|
@@ -930,14 +930,14 @@ class TitleStore {
|
|
|
930
930
|
map = mutable(new Map());
|
|
931
931
|
leafRoutes = injectLeafRoutes();
|
|
932
932
|
constructor() {
|
|
933
|
-
const reverseLeaves = computed(() => this.leafRoutes().toReversed());
|
|
933
|
+
const reverseLeaves = computed(() => this.leafRoutes().toReversed(), ...(ngDevMode ? [{ debugName: "reverseLeaves" }] : []));
|
|
934
934
|
const currentResolvedTitles = computed(() => {
|
|
935
935
|
const map = this.map();
|
|
936
936
|
return reverseLeaves()
|
|
937
937
|
.map((leaf) => map.get(leaf.path)?.() ?? leaf.route.title)
|
|
938
938
|
.filter((v) => !!v);
|
|
939
|
-
});
|
|
940
|
-
const currentTitle = computed(() => currentResolvedTitles().at(0) ?? '');
|
|
939
|
+
}, ...(ngDevMode ? [{ debugName: "currentResolvedTitles" }] : []));
|
|
940
|
+
const currentTitle = computed(() => currentResolvedTitles().at(0) ?? '', ...(ngDevMode ? [{ debugName: "currentTitle" }] : []));
|
|
941
941
|
const heldTitle = injectTitleConfig().keepLastKnown
|
|
942
942
|
? linkedSignal({
|
|
943
943
|
source: () => currentTitle(),
|
|
@@ -955,10 +955,10 @@ class TitleStore {
|
|
|
955
955
|
register(id, titleFn) {
|
|
956
956
|
this.map.inline((m) => m.set(id, titleFn));
|
|
957
957
|
}
|
|
958
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
959
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
958
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: TitleStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
959
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: TitleStore, providedIn: 'root' });
|
|
960
960
|
}
|
|
961
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: TitleStore, decorators: [{
|
|
962
962
|
type: Injectable,
|
|
963
963
|
args: [{
|
|
964
964
|
providedIn: 'root',
|
|
@@ -984,7 +984,7 @@ function createTitle(fn, awaitValue = false) {
|
|
|
984
984
|
const titleSignal = typeof resolved === 'string'
|
|
985
985
|
? computed(() => resolved)
|
|
986
986
|
: computed(resolved);
|
|
987
|
-
const parsedTitleSignal = computed(() => parser(titleSignal()));
|
|
987
|
+
const parsedTitleSignal = computed(() => parser(titleSignal()), ...(ngDevMode ? [{ debugName: "parsedTitleSignal" }] : []));
|
|
988
988
|
store.register(fp, parsedTitleSignal);
|
|
989
989
|
if (awaitValue)
|
|
990
990
|
await until(parsedTitleSignal, (v) => !!v);
|