@skyux/router 5.8.4 → 5.9.0
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/bundles/skyux-router.umd.js +15 -0
- package/esm2015/index.js +7 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link-args.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link-args.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link-result.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link-result.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-link.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-route-args.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-add-route-args.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-get-links-args.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-get-links-args.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-link-list.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-link-list.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-link.js +2 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed-link.js.map +1 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed.service.js +13 -0
- package/esm2015/lib/modules/recently-accessed/recently-accessed.service.js.map +1 -0
- package/fesm2015/skyux-router.js +12 -1
- package/fesm2015/skyux-router.js.map +1 -1
- package/index.d.ts +7 -0
- package/lib/modules/recently-accessed/recently-accessed-add-link-args.d.ts +10 -0
- package/lib/modules/recently-accessed/recently-accessed-add-link-result.d.ts +9 -0
- package/lib/modules/recently-accessed/recently-accessed-add-link.d.ts +19 -0
- package/lib/modules/recently-accessed/recently-accessed-add-route-args.d.ts +10 -0
- package/lib/modules/recently-accessed/recently-accessed-get-links-args.d.ts +18 -0
- package/lib/modules/recently-accessed/recently-accessed-link-list.d.ts +10 -0
- package/lib/modules/recently-accessed/recently-accessed-link.d.ts +17 -0
- package/lib/modules/recently-accessed/recently-accessed.service.d.ts +29 -0
- package/package.json +3 -3
|
@@ -703,6 +703,20 @@
|
|
|
703
703
|
}]
|
|
704
704
|
}] });
|
|
705
705
|
|
|
706
|
+
/**
|
|
707
|
+
* A service for creating and retrieving recently accessed links.
|
|
708
|
+
*/
|
|
709
|
+
var SkyRecentlyAccessedService = /** @class */ (function () {
|
|
710
|
+
function SkyRecentlyAccessedService() {
|
|
711
|
+
}
|
|
712
|
+
return SkyRecentlyAccessedService;
|
|
713
|
+
}());
|
|
714
|
+
SkyRecentlyAccessedService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRecentlyAccessedService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
715
|
+
SkyRecentlyAccessedService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRecentlyAccessedService });
|
|
716
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyRecentlyAccessedService, decorators: [{
|
|
717
|
+
type: i0.Injectable
|
|
718
|
+
}] });
|
|
719
|
+
|
|
706
720
|
/**
|
|
707
721
|
* Generated bundle index. Do not edit.
|
|
708
722
|
*/
|
|
@@ -710,6 +724,7 @@
|
|
|
710
724
|
exports.SkyAppLinkModule = SkyAppLinkModule;
|
|
711
725
|
exports.SkyHrefModule = SkyHrefModule;
|
|
712
726
|
exports.SkyHrefResolverService = SkyHrefResolverService;
|
|
727
|
+
exports.SkyRecentlyAccessedService = SkyRecentlyAccessedService;
|
|
713
728
|
exports["λ1"] = SkyHrefDirective;
|
|
714
729
|
exports["λ2"] = SkyAppLinkExternalDirective;
|
|
715
730
|
exports["λ3"] = SkyAppLinkDirective;
|
package/esm2015/index.js
CHANGED
|
@@ -5,6 +5,13 @@ export * from './lib/modules/href/href-resolver';
|
|
|
5
5
|
export * from './lib/modules/href/href-resolver.service';
|
|
6
6
|
export * from './lib/modules/href/types/href';
|
|
7
7
|
export * from './lib/modules/href/types/href-resolver.args';
|
|
8
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-link-args';
|
|
9
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-route-args';
|
|
10
|
+
export * from './lib/modules/recently-accessed/recently-accessed-get-links-args';
|
|
11
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-link-result';
|
|
12
|
+
export * from './lib/modules/recently-accessed/recently-accessed-link';
|
|
13
|
+
export * from './lib/modules/recently-accessed/recently-accessed-link-list';
|
|
14
|
+
export * from './lib/modules/recently-accessed/recently-accessed.service';
|
|
8
15
|
// Components and directives must be exported to support Angular's "partial" Ivy compiler.
|
|
9
16
|
// Obscure names are used to indicate types are not part of public API.
|
|
10
17
|
export { SkyHrefDirective as λ1 } from './lib/modules/href/href.directive';
|
package/esm2015/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/router/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAE5D,0FAA0F;AAC1F,uEAAuE;AACvE,OAAO,EAAE,gBAAgB,IAAI,EAAE,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,IAAI,EAAE,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["export * from './lib/modules/link/link-query-params';\nexport * from './lib/modules/link/link.module';\nexport * from './lib/modules/href/href.module';\nexport * from './lib/modules/href/href-resolver';\nexport * from './lib/modules/href/href-resolver.service';\nexport * from './lib/modules/href/types/href';\nexport * from './lib/modules/href/types/href-resolver.args';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of public API.\nexport { SkyHrefDirective as λ1 } from './lib/modules/href/href.directive';\nexport { SkyAppLinkExternalDirective as λ2 } from './lib/modules/link/link-external.directive';\nexport { SkyAppLinkDirective as λ3 } from './lib/modules/link/link.directive';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/router/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAE5D,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC;AACjF,cAAc,kEAAkE,CAAC;AACjF,cAAc,mEAAmE,CAAC;AAClF,cAAc,wDAAwD,CAAC;AACvE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2DAA2D,CAAC;AAE1E,0FAA0F;AAC1F,uEAAuE;AACvE,OAAO,EAAE,gBAAgB,IAAI,EAAE,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,IAAI,EAAE,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["export * from './lib/modules/link/link-query-params';\nexport * from './lib/modules/link/link.module';\nexport * from './lib/modules/href/href.module';\nexport * from './lib/modules/href/href-resolver';\nexport * from './lib/modules/href/href-resolver.service';\nexport * from './lib/modules/href/types/href';\nexport * from './lib/modules/href/types/href-resolver.args';\n\nexport * from './lib/modules/recently-accessed/recently-accessed-add-link-args';\nexport * from './lib/modules/recently-accessed/recently-accessed-add-route-args';\nexport * from './lib/modules/recently-accessed/recently-accessed-get-links-args';\nexport * from './lib/modules/recently-accessed/recently-accessed-add-link-result';\nexport * from './lib/modules/recently-accessed/recently-accessed-link';\nexport * from './lib/modules/recently-accessed/recently-accessed-link-list';\nexport * from './lib/modules/recently-accessed/recently-accessed.service';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of public API.\nexport { SkyHrefDirective as λ1 } from './lib/modules/href/href.directive';\nexport { SkyAppLinkExternalDirective as λ2 } from './lib/modules/link/link-external.directive';\nexport { SkyAppLinkDirective as λ3 } from './lib/modules/link/link.directive';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-add-link-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-add-link-args.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyRecentlyAccessedAddLink } from './recently-accessed-add-link';\n\n/**\n * Parameters for adding a recently accessed link.\n */\nexport interface SkyRecentlyAccessedAddLinkArgs {\n /**\n * Metadata about the link to add.\n */\n link: SkyRecentlyAccessedAddLink;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-add-link-result.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-add-link-result.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The result when adding a recently accessed link.\n */\nexport interface SkyRecentlyAccessedAddLinkResult {\n /**\n * The unique identifier for the newly added link.\n */\n id: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-add-link.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-add-link.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A link to add to the recently accessed links.\n */\nexport interface SkyRecentlyAccessedAddLink {\n /**\n * The link's app.\n */\n app: string;\n /**\n * The link's route.\n */\n route: string;\n /**\n * The link's parameters.\n */\n params?: { [key: string]: string };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-add-route-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-add-route-args.ts"],"names":[],"mappings":"","sourcesContent":["import { ActivatedRouteSnapshot } from '@angular/router';\n\n/**\n * Parameters for adding a recently accessed link via an Angular route.\n */\nexport interface SkyRecentlyAccessedAddRouteArgs {\n /**\n * The route to the link.\n */\n route: ActivatedRouteSnapshot;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-get-links-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-get-links-args.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Parameters for retrieving a list of recently accessed links.\n */\nexport interface SkyRecentlyAccessedGetLinksArgs {\n /**\n * The links to retrieve.\n */\n requestedRoutes: {\n /**\n * The link's app.\n */\n app: string;\n\n /**\n * The link's route.\n */\n route: string;\n }[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-link-list.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-link-list.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyRecentlyAccessedLink } from './recently-accessed-link';\n\n/**\n * A resolved list of recently accessed links.\n */\nexport interface SkyRecentlyAccessedLinkList {\n /**\n * An array of recently accessed links.\n */\n links: SkyRecentlyAccessedLink[];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed-link.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed-link.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Resolved metsdata about a recently accessed link.\n */\nexport interface SkyRecentlyAccessedLink {\n /**\n * The label to display for the link.\n */\n label: string;\n /**\n * The date the link was last accessed.\n */\n lastAccessed: Date;\n /**\n * The link's fully-qualified URL.\n */\n url: string;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A service for creating and retrieving recently accessed links.
|
|
5
|
+
*/
|
|
6
|
+
export class SkyRecentlyAccessedService {
|
|
7
|
+
}
|
|
8
|
+
SkyRecentlyAccessedService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9
|
+
SkyRecentlyAccessedService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService, decorators: [{
|
|
11
|
+
type: Injectable
|
|
12
|
+
}] });
|
|
13
|
+
//# sourceMappingURL=recently-accessed.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recently-accessed.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAU3C;;GAEG;AAEH,MAAM,OAAgB,0BAA0B;;wHAA1B,0BAA0B;4HAA1B,0BAA0B;4FAA1B,0BAA0B;kBAD/C,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\n\nimport { SkyRecentlyAccessedAddLinkArgs } from './recently-accessed-add-link-args';\nimport { SkyRecentlyAccessedAddLinkResult } from './recently-accessed-add-link-result';\nimport { SkyRecentlyAccessedAddRouteArgs } from './recently-accessed-add-route-args';\nimport { SkyRecentlyAccessedGetLinksArgs } from './recently-accessed-get-links-args';\nimport { SkyRecentlyAccessedLinkList } from './recently-accessed-link-list';\n\n/**\n * A service for creating and retrieving recently accessed links.\n */\n@Injectable()\nexport abstract class SkyRecentlyAccessedService {\n /**\n * Adds a recently accessed link based on an Angular route.\n * @param args The route to add.\n */\n public abstract addRoute(\n args: SkyRecentlyAccessedAddRouteArgs\n ): Observable<SkyRecentlyAccessedAddLinkResult>;\n\n /**\n * Adds a recently accessed link based on metadata about the link.\n * @param args The link to add.\n */\n public abstract addLink(\n args: SkyRecentlyAccessedAddLinkArgs\n ): Observable<SkyRecentlyAccessedAddLinkResult>;\n\n /**\n * Gets a list of recently accessed links.\n * @param args The links to retrieve.\n */\n public abstract getLinks(\n args: SkyRecentlyAccessedGetLinksArgs\n ): Observable<SkyRecentlyAccessedLinkList>;\n}\n"]}
|
package/fesm2015/skyux-router.js
CHANGED
|
@@ -326,9 +326,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
326
326
|
}]
|
|
327
327
|
}] });
|
|
328
328
|
|
|
329
|
+
/**
|
|
330
|
+
* A service for creating and retrieving recently accessed links.
|
|
331
|
+
*/
|
|
332
|
+
class SkyRecentlyAccessedService {
|
|
333
|
+
}
|
|
334
|
+
SkyRecentlyAccessedService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
335
|
+
SkyRecentlyAccessedService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService });
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRecentlyAccessedService, decorators: [{
|
|
337
|
+
type: Injectable
|
|
338
|
+
}] });
|
|
339
|
+
|
|
329
340
|
/**
|
|
330
341
|
* Generated bundle index. Do not edit.
|
|
331
342
|
*/
|
|
332
343
|
|
|
333
|
-
export { SkyAppLinkModule, SkyHrefModule, SkyHrefResolverService, SkyHrefDirective as λ1, SkyAppLinkExternalDirective as λ2, SkyAppLinkDirective as λ3 };
|
|
344
|
+
export { SkyAppLinkModule, SkyHrefModule, SkyHrefResolverService, SkyRecentlyAccessedService, SkyHrefDirective as λ1, SkyAppLinkExternalDirective as λ2, SkyAppLinkDirective as λ3 };
|
|
334
345
|
//# sourceMappingURL=skyux-router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-router.js","sources":["../../../../../libs/components/router/src/lib/modules/link/link-external.directive.ts","../../../../../libs/components/router/src/lib/modules/link/link.directive.ts","../../../../../libs/components/router/src/lib/modules/link/link.module.ts","../../../../../libs/components/router/src/lib/modules/href/href-resolver.service.ts","../../../../../libs/components/router/src/lib/modules/href/href.directive.ts","../../../../../libs/components/router/src/lib/modules/href/href.module.ts","../../../../../libs/components/router/src/skyux-router.ts"],"sourcesContent":["import { PathLocationStrategy, PlatformLocation } from '@angular/common';\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\nimport {\n SkyAppConfig,\n SkyAppConfigHost,\n SkyAppRuntimeConfigParamsProvider,\n} from '@skyux/config';\nimport { SkyAppWindowRef } from '@skyux/core';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n/**\n * @deprecated Use `skyHref` directive instead.\n */\n@Directive({\n selector: '[skyAppLinkExternal]',\n})\nexport class SkyAppLinkExternalDirective\n extends RouterLinkWithHref\n implements OnChanges\n{\n @Input()\n set skyAppLinkExternal(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n constructor(\n router: Router,\n route: ActivatedRoute,\n platformLocation: PlatformLocation,\n private window: SkyAppWindowRef,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider,\n @Optional() hostConfig?: SkyAppConfigHost\n ) {\n super(\n router,\n route,\n new PathLocationStrategy(\n platformLocation,\n hostConfig ? hostConfig.host.url : skyAppConfig.skyux.host.url\n )\n );\n\n if (\n this.window.nativeWindow.window.name &&\n this.window.nativeWindow.window.name !== ''\n ) {\n this.target = this.window.nativeWindow.window.name;\n } else {\n this.target = '_top';\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.mergeQueryParams(changes.queryParams?.currentValue);\n super.ngOnChanges(changes);\n }\n\n private mergeQueryParams(\n queryParams: SkyAppLinkQueryParams\n ): SkyAppLinkQueryParams {\n const skyuxParams = this.skyAppConfig\n ? this.skyAppConfig.runtime.params.getAll()\n : this.paramsProvider.params.getAll();\n\n return Object.assign({}, this.queryParams, queryParams, skyuxParams);\n }\n}\n","import { LocationStrategy } from '@angular/common';\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLink]',\n})\nexport class SkyAppLinkDirective\n extends RouterLinkWithHref\n implements OnChanges\n{\n @Input()\n set skyAppLink(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n constructor(\n router: Router,\n route: ActivatedRoute,\n locationStrategy: LocationStrategy,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider\n ) {\n super(router, route, locationStrategy);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.mergeQueryParams(changes.queryParams?.currentValue);\n super.ngOnChanges(changes);\n }\n\n private mergeQueryParams(\n queryParams: SkyAppLinkQueryParams\n ): SkyAppLinkQueryParams {\n const skyuxParams = this.skyAppConfig\n ? this.skyAppConfig.runtime.params.getAll(true)\n : this.paramsProvider.params.getAll(true);\n\n return Object.assign({}, this.queryParams, queryParams, skyuxParams);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { SkyAppLinkExternalDirective } from './link-external.directive';\nimport { SkyAppLinkDirective } from './link.directive';\n\n@NgModule({\n declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective],\n exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective],\n})\n/* istanbul ignore next */\nexport class SkyAppLinkModule {}\n","import { Injectable } from '@angular/core';\n\nimport { SkyHrefResolver } from './href-resolver';\nimport { SkyHref } from './types/href';\nimport { SkyHrefResolverArgs } from './types/href-resolver.args';\n\n/**\n * Return the link as-is.\n */\n@Injectable()\nexport class SkyHrefResolverService implements SkyHrefResolver {\n public resolveHref(args: SkyHrefResolverArgs): Promise<SkyHref> {\n return Promise.resolve<SkyHref>({\n url: args.url,\n userHasAccess: true,\n });\n }\n}\n","import { HttpParams } from '@angular/common/http';\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n Optional,\n Renderer2,\n} from '@angular/core';\nimport { Router, UrlTree } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyHrefQueryParams } from './href-query-params';\nimport { SkyHrefResolverService } from './href-resolver.service';\nimport { SkyHref } from './types/href';\n\ntype HrefChanges = { href: string; hidden: boolean };\n\n@Directive({\n selector: '[skyHref]',\n})\nexport class SkyHrefDirective {\n /**\n * Provide a link as a string or as an array of strings to be joined by a slash to form a complete\n * URL.\n *\n * @param skyHref\n */\n @Input()\n public set skyHref(skyHref: string | string[]) {\n if (typeof skyHref === 'string') {\n this._skyHref = skyHref;\n } else {\n this._skyHref = skyHref.join('/');\n }\n\n this.checkRouteAccess();\n }\n\n @Input()\n public set skyHrefElse(value: 'hide' | 'unlink') {\n this._skyHrefElse = value;\n this.applyChanges(this.getChanges());\n }\n\n private _route: SkyHref | false = false;\n\n private _href: string;\n\n private _skyHref = '';\n\n private _skyHrefElse: 'hide' | 'unlink' = 'hide';\n\n constructor(\n private router: Router,\n private renderer: Renderer2,\n private element: ElementRef,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider,\n @Optional() private hrefResolver?: SkyHrefResolverService,\n @Optional() private applicationRef?: ApplicationRef,\n @Optional() private changeDetectorRef?: ChangeDetectorRef\n ) {}\n\n /* istanbul ignore next */\n @HostListener('click', [\n '$event.button',\n '$event.ctrlKey',\n '$event.shiftKey',\n '$event.altKey',\n '$event.metaKey',\n ])\n public onClick(\n button: number,\n ctrlKey: boolean,\n shiftKey: boolean,\n altKey: boolean,\n metaKey: boolean\n ): boolean {\n if (!this._route || !this._route.userHasAccess) {\n return false;\n }\n\n if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {\n return true;\n }\n\n const target = this.element.nativeElement.getAttribute('target');\n if (typeof target === 'string' && target !== '_self') {\n return true;\n }\n\n const urlTree = this.getUrlTree();\n if (urlTree) {\n this.router.navigateByUrl(urlTree);\n return false;\n }\n return true;\n }\n\n private applyChanges(change: HrefChanges) {\n this.renderer.addClass(this.element.nativeElement, 'sky-href');\n if (change.hidden) {\n this.renderer.setAttribute(\n this.element.nativeElement,\n 'hidden',\n 'hidden'\n );\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'hidden');\n }\n if (change.href) {\n this.renderer.setAttribute(\n this.element.nativeElement,\n 'href',\n change.href\n );\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'href');\n }\n }\n\n private checkRouteAccess() {\n this._route = {\n url: this._skyHref,\n userHasAccess: false,\n };\n /* istanbul ignore else */\n if (this.hrefResolver && this._skyHref) {\n this.applyChanges(this.getChanges());\n try {\n this.hrefResolver.resolveHref({ url: this._skyHref }).then((route) => {\n this._route = { ...route };\n this.applyChanges(this.getChanges());\n /* istanbul ignore else */\n if (this.changeDetectorRef && this.applicationRef) {\n this.changeDetectorRef.markForCheck();\n this.applicationRef.tick();\n }\n });\n } catch (error) {\n this.applyChanges(this.getChanges());\n }\n } else {\n // no resolver or skyHref is falsy\n this._route.userHasAccess = !!this._skyHref;\n this.applyChanges(this.getChanges());\n }\n }\n\n private getChanges(): HrefChanges {\n const queryParams: SkyHrefQueryParams = {};\n\n if (!this._route || !this._route.userHasAccess) {\n return {\n href: '',\n hidden: this._skyHrefElse === 'hide',\n };\n } else {\n const [beforeFragment, fragment] = this._route.url.split('#', 2);\n const [baseUrl, search] = beforeFragment.split('?', 2);\n\n if (search) {\n const searchParams = new HttpParams({ fromString: search });\n searchParams.keys().forEach((key) => {\n queryParams[key] = searchParams.get(key);\n });\n }\n\n const queryParamsMerged = new HttpParams({\n fromObject: Object.assign({}, this.getSkyuxParams(), queryParams),\n });\n\n this._href =\n baseUrl +\n (queryParamsMerged.keys().length > 0\n ? '?' + queryParamsMerged.toString()\n : '') +\n (fragment ? `#${fragment}` : '');\n return {\n href: this._href,\n hidden: false,\n };\n }\n }\n\n private getSkyuxParams(): SkyHrefQueryParams {\n return typeof this.skyAppConfig?.runtime.params?.getAll === 'function'\n ? this.skyAppConfig.runtime.params.getAll(true)\n : this.paramsProvider.params.getAll(true);\n }\n\n /* istanbul ignore next */\n private getUrlTree(): UrlTree | false {\n const href = this._href.toLowerCase();\n\n if (\n !href ||\n !this.skyAppConfig?.skyux.host?.url ||\n !this.skyAppConfig?.runtime?.app?.base\n ) {\n return false;\n }\n\n const baseUrl = (\n this.skyAppConfig.skyux.host.url +\n this.skyAppConfig.runtime.app.base.substr(\n 0,\n this.skyAppConfig.runtime.app.base.length - 1\n )\n ).toLowerCase();\n\n if (\n href === baseUrl ||\n // Make sure the base URL is not simply a partial match of the base URL plus additional\n // characters after the base URL that are not \"terminating\" characters\n href.indexOf(baseUrl + '/') === 0 ||\n href.indexOf(baseUrl + '?') === 0\n ) {\n const routePath = this._href.substring(baseUrl.length);\n return this.router.parseUrl(routePath);\n }\n\n return false;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { SkyHrefDirective } from './href.directive';\n\n@NgModule({\n declarations: [SkyHrefDirective],\n exports: [SkyHrefDirective],\n imports: [CommonModule],\n})\nexport class SkyHrefModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAkBA;;;MAMa,2BACX,SAAQ,kBAAkB;IAQ1B,YACE,MAAc,EACd,KAAqB,EACrB,gBAAkC,EAC1B,MAAuB,EACX,YAA2B,EAC3B,cAAkD,EAC1D,UAA6B;QAEzC,KAAK,CACH,MAAM,EACN,KAAK,EACL,IAAI,oBAAoB,CACtB,gBAAgB,EAChB,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAC/D,CACF,CAAC;QAZM,WAAM,GAAN,MAAM,CAAiB;QACX,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAoC;QAYtE,IACE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI;YACpC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,EAC3C;YACA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;SACpD;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;KACF;IA/BD,IACI,kBAAkB,CAAC,QAAwB;QAC7C,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;KAC5B;IA8BM,WAAW,CAAC,OAAsB;;QACvC,IAAI,CAAC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O,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAC9C,EACD,WAAW,EAAE,CAAC;QAEhB,IACE,IAAI,KAAK,OAAO;;;YAGhB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,EACjC;YACA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,OAAO,KAAK,CAAC;KACd;;8GA3MU,gBAAgB;kGAAhB,gBAAgB;4FAAhB,gBAAgB;kBAH5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;iBACtB;;0BAqCI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CAhCA,OAAO;sBADjB,KAAK;gBAYK,WAAW;sBADrB,KAAK;gBAiCC,OAAO;sBAPb,YAAY;uBAAC,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;qBACjB;;;MC/DU,aAAa;;2GAAb,aAAa;4GAAb,aAAa,iBAJT,gBAAgB,aAErB,YAAY,aADZ,gBAAgB;4GAGf,aAAa,YAFf,CAAC,YAAY,CAAC;4FAEZ,aAAa;kBALzB,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,YAAY,CAAC;iBACxB;;;ACTD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"skyux-router.js","sources":["../../../../../libs/components/router/src/lib/modules/link/link-external.directive.ts","../../../../../libs/components/router/src/lib/modules/link/link.directive.ts","../../../../../libs/components/router/src/lib/modules/link/link.module.ts","../../../../../libs/components/router/src/lib/modules/href/href-resolver.service.ts","../../../../../libs/components/router/src/lib/modules/href/href.directive.ts","../../../../../libs/components/router/src/lib/modules/href/href.module.ts","../../../../../libs/components/router/src/lib/modules/recently-accessed/recently-accessed.service.ts","../../../../../libs/components/router/src/skyux-router.ts"],"sourcesContent":["import { PathLocationStrategy, PlatformLocation } from '@angular/common';\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\nimport {\n SkyAppConfig,\n SkyAppConfigHost,\n SkyAppRuntimeConfigParamsProvider,\n} from '@skyux/config';\nimport { SkyAppWindowRef } from '@skyux/core';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n/**\n * @deprecated Use `skyHref` directive instead.\n */\n@Directive({\n selector: '[skyAppLinkExternal]',\n})\nexport class SkyAppLinkExternalDirective\n extends RouterLinkWithHref\n implements OnChanges\n{\n @Input()\n set skyAppLinkExternal(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n constructor(\n router: Router,\n route: ActivatedRoute,\n platformLocation: PlatformLocation,\n private window: SkyAppWindowRef,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider,\n @Optional() hostConfig?: SkyAppConfigHost\n ) {\n super(\n router,\n route,\n new PathLocationStrategy(\n platformLocation,\n hostConfig ? hostConfig.host.url : skyAppConfig.skyux.host.url\n )\n );\n\n if (\n this.window.nativeWindow.window.name &&\n this.window.nativeWindow.window.name !== ''\n ) {\n this.target = this.window.nativeWindow.window.name;\n } else {\n this.target = '_top';\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.mergeQueryParams(changes.queryParams?.currentValue);\n super.ngOnChanges(changes);\n }\n\n private mergeQueryParams(\n queryParams: SkyAppLinkQueryParams\n ): SkyAppLinkQueryParams {\n const skyuxParams = this.skyAppConfig\n ? this.skyAppConfig.runtime.params.getAll()\n : this.paramsProvider.params.getAll();\n\n return Object.assign({}, this.queryParams, queryParams, skyuxParams);\n }\n}\n","import { LocationStrategy } from '@angular/common';\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLink]',\n})\nexport class SkyAppLinkDirective\n extends RouterLinkWithHref\n implements OnChanges\n{\n @Input()\n set skyAppLink(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n constructor(\n router: Router,\n route: ActivatedRoute,\n locationStrategy: LocationStrategy,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider\n ) {\n super(router, route, locationStrategy);\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.mergeQueryParams(changes.queryParams?.currentValue);\n super.ngOnChanges(changes);\n }\n\n private mergeQueryParams(\n queryParams: SkyAppLinkQueryParams\n ): SkyAppLinkQueryParams {\n const skyuxParams = this.skyAppConfig\n ? this.skyAppConfig.runtime.params.getAll(true)\n : this.paramsProvider.params.getAll(true);\n\n return Object.assign({}, this.queryParams, queryParams, skyuxParams);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { SkyAppLinkExternalDirective } from './link-external.directive';\nimport { SkyAppLinkDirective } from './link.directive';\n\n@NgModule({\n declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective],\n exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective],\n})\n/* istanbul ignore next */\nexport class SkyAppLinkModule {}\n","import { Injectable } from '@angular/core';\n\nimport { SkyHrefResolver } from './href-resolver';\nimport { SkyHref } from './types/href';\nimport { SkyHrefResolverArgs } from './types/href-resolver.args';\n\n/**\n * Return the link as-is.\n */\n@Injectable()\nexport class SkyHrefResolverService implements SkyHrefResolver {\n public resolveHref(args: SkyHrefResolverArgs): Promise<SkyHref> {\n return Promise.resolve<SkyHref>({\n url: args.url,\n userHasAccess: true,\n });\n }\n}\n","import { HttpParams } from '@angular/common/http';\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n Optional,\n Renderer2,\n} from '@angular/core';\nimport { Router, UrlTree } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyHrefQueryParams } from './href-query-params';\nimport { SkyHrefResolverService } from './href-resolver.service';\nimport { SkyHref } from './types/href';\n\ntype HrefChanges = { href: string; hidden: boolean };\n\n@Directive({\n selector: '[skyHref]',\n})\nexport class SkyHrefDirective {\n /**\n * Provide a link as a string or as an array of strings to be joined by a slash to form a complete\n * URL.\n *\n * @param skyHref\n */\n @Input()\n public set skyHref(skyHref: string | string[]) {\n if (typeof skyHref === 'string') {\n this._skyHref = skyHref;\n } else {\n this._skyHref = skyHref.join('/');\n }\n\n this.checkRouteAccess();\n }\n\n @Input()\n public set skyHrefElse(value: 'hide' | 'unlink') {\n this._skyHrefElse = value;\n this.applyChanges(this.getChanges());\n }\n\n private _route: SkyHref | false = false;\n\n private _href: string;\n\n private _skyHref = '';\n\n private _skyHrefElse: 'hide' | 'unlink' = 'hide';\n\n constructor(\n private router: Router,\n private renderer: Renderer2,\n private element: ElementRef,\n @Optional() private skyAppConfig?: SkyAppConfig,\n @Optional() private paramsProvider?: SkyAppRuntimeConfigParamsProvider,\n @Optional() private hrefResolver?: SkyHrefResolverService,\n @Optional() private applicationRef?: ApplicationRef,\n @Optional() private changeDetectorRef?: ChangeDetectorRef\n ) {}\n\n /* istanbul ignore next */\n @HostListener('click', [\n '$event.button',\n '$event.ctrlKey',\n '$event.shiftKey',\n '$event.altKey',\n '$event.metaKey',\n ])\n public onClick(\n button: number,\n ctrlKey: boolean,\n shiftKey: boolean,\n altKey: boolean,\n metaKey: boolean\n ): boolean {\n if (!this._route || !this._route.userHasAccess) {\n return false;\n }\n\n if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {\n return true;\n }\n\n const target = this.element.nativeElement.getAttribute('target');\n if (typeof target === 'string' && target !== '_self') {\n return true;\n }\n\n const urlTree = this.getUrlTree();\n if (urlTree) {\n this.router.navigateByUrl(urlTree);\n return false;\n }\n return true;\n }\n\n private applyChanges(change: HrefChanges) {\n this.renderer.addClass(this.element.nativeElement, 'sky-href');\n if (change.hidden) {\n this.renderer.setAttribute(\n this.element.nativeElement,\n 'hidden',\n 'hidden'\n );\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'hidden');\n }\n if (change.href) {\n this.renderer.setAttribute(\n this.element.nativeElement,\n 'href',\n change.href\n );\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'href');\n }\n }\n\n private checkRouteAccess() {\n this._route = {\n url: this._skyHref,\n userHasAccess: false,\n };\n /* istanbul ignore else */\n if (this.hrefResolver && this._skyHref) {\n this.applyChanges(this.getChanges());\n try {\n this.hrefResolver.resolveHref({ url: this._skyHref }).then((route) => {\n this._route = { ...route };\n this.applyChanges(this.getChanges());\n /* istanbul ignore else */\n if (this.changeDetectorRef && this.applicationRef) {\n this.changeDetectorRef.markForCheck();\n this.applicationRef.tick();\n }\n });\n } catch (error) {\n this.applyChanges(this.getChanges());\n }\n } else {\n // no resolver or skyHref is falsy\n this._route.userHasAccess = !!this._skyHref;\n this.applyChanges(this.getChanges());\n }\n }\n\n private getChanges(): HrefChanges {\n const queryParams: SkyHrefQueryParams = {};\n\n if (!this._route || !this._route.userHasAccess) {\n return {\n href: '',\n hidden: this._skyHrefElse === 'hide',\n };\n } else {\n const [beforeFragment, fragment] = this._route.url.split('#', 2);\n const [baseUrl, search] = beforeFragment.split('?', 2);\n\n if (search) {\n const searchParams = new HttpParams({ fromString: search });\n searchParams.keys().forEach((key) => {\n queryParams[key] = searchParams.get(key);\n });\n }\n\n const queryParamsMerged = new HttpParams({\n fromObject: Object.assign({}, this.getSkyuxParams(), queryParams),\n });\n\n this._href =\n baseUrl +\n (queryParamsMerged.keys().length > 0\n ? '?' + queryParamsMerged.toString()\n : '') +\n (fragment ? `#${fragment}` : '');\n return {\n href: this._href,\n hidden: false,\n };\n }\n }\n\n private getSkyuxParams(): SkyHrefQueryParams {\n return typeof this.skyAppConfig?.runtime.params?.getAll === 'function'\n ? this.skyAppConfig.runtime.params.getAll(true)\n : this.paramsProvider.params.getAll(true);\n }\n\n /* istanbul ignore next */\n private getUrlTree(): UrlTree | false {\n const href = this._href.toLowerCase();\n\n if (\n !href ||\n !this.skyAppConfig?.skyux.host?.url ||\n !this.skyAppConfig?.runtime?.app?.base\n ) {\n return false;\n }\n\n const baseUrl = (\n this.skyAppConfig.skyux.host.url +\n this.skyAppConfig.runtime.app.base.substr(\n 0,\n this.skyAppConfig.runtime.app.base.length - 1\n )\n ).toLowerCase();\n\n if (\n href === baseUrl ||\n // Make sure the base URL is not simply a partial match of the base URL plus additional\n // characters after the base URL that are not \"terminating\" characters\n href.indexOf(baseUrl + '/') === 0 ||\n href.indexOf(baseUrl + '?') === 0\n ) {\n const routePath = this._href.substring(baseUrl.length);\n return this.router.parseUrl(routePath);\n }\n\n return false;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { SkyHrefDirective } from './href.directive';\n\n@NgModule({\n declarations: [SkyHrefDirective],\n exports: [SkyHrefDirective],\n imports: [CommonModule],\n})\nexport class SkyHrefModule {}\n","import { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\n\nimport { SkyRecentlyAccessedAddLinkArgs } from './recently-accessed-add-link-args';\nimport { SkyRecentlyAccessedAddLinkResult } from './recently-accessed-add-link-result';\nimport { SkyRecentlyAccessedAddRouteArgs } from './recently-accessed-add-route-args';\nimport { SkyRecentlyAccessedGetLinksArgs } from './recently-accessed-get-links-args';\nimport { SkyRecentlyAccessedLinkList } from './recently-accessed-link-list';\n\n/**\n * A service for creating and retrieving recently accessed links.\n */\n@Injectable()\nexport abstract class SkyRecentlyAccessedService {\n /**\n * Adds a recently accessed link based on an Angular route.\n * @param args The route to add.\n */\n public abstract addRoute(\n args: SkyRecentlyAccessedAddRouteArgs\n ): Observable<SkyRecentlyAccessedAddLinkResult>;\n\n /**\n * Adds a recently accessed link based on metadata about the link.\n * @param args The link to add.\n */\n public abstract addLink(\n args: SkyRecentlyAccessedAddLinkArgs\n ): Observable<SkyRecentlyAccessedAddLinkResult>;\n\n /**\n * Gets a list of recently accessed links.\n * @param args The links to retrieve.\n */\n public abstract getLinks(\n args: SkyRecentlyAccessedGetLinksArgs\n ): Observable<SkyRecentlyAccessedLinkList>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAkBA;;;MAMa,2BACX,SAAQ,kBAAkB;IAQ1B,YACE,MAAc,EACd,KAAqB,EACrB,gBAAkC,EAC1B,MAAuB,EACX,YAA2B,EAC3B,cAAkD,EAC1D,UAA6B;QAEzC,KAAK,CACH,MAAM,EACN,KAAK,EACL,IAAI,oBAAoB,CACtB,gBAAgB,EAChB,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAC/D,CACF,CAAC;QAZM,WAAM,GAAN,MAAM,CAAiB;QACX,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAoC;QAYtE,IACE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI;YACpC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,EAC3C;YACA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;SACpD;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,MAAM,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;;ACCD;;;MAIsB,0BAA0B;;wHAA1B,0BAA0B;4HAA1B,0BAA0B;4FAA1B,0BAA0B;kBAD/C,UAAU;;;ACbX;;;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export * from './lib/modules/href/href-resolver';
|
|
|
5
5
|
export * from './lib/modules/href/href-resolver.service';
|
|
6
6
|
export * from './lib/modules/href/types/href';
|
|
7
7
|
export * from './lib/modules/href/types/href-resolver.args';
|
|
8
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-link-args';
|
|
9
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-route-args';
|
|
10
|
+
export * from './lib/modules/recently-accessed/recently-accessed-get-links-args';
|
|
11
|
+
export * from './lib/modules/recently-accessed/recently-accessed-add-link-result';
|
|
12
|
+
export * from './lib/modules/recently-accessed/recently-accessed-link';
|
|
13
|
+
export * from './lib/modules/recently-accessed/recently-accessed-link-list';
|
|
14
|
+
export * from './lib/modules/recently-accessed/recently-accessed.service';
|
|
8
15
|
export { SkyHrefDirective as λ1 } from './lib/modules/href/href.directive';
|
|
9
16
|
export { SkyAppLinkExternalDirective as λ2 } from './lib/modules/link/link-external.directive';
|
|
10
17
|
export { SkyAppLinkDirective as λ3 } from './lib/modules/link/link.directive';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SkyRecentlyAccessedAddLink } from './recently-accessed-add-link';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for adding a recently accessed link.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkyRecentlyAccessedAddLinkArgs {
|
|
6
|
+
/**
|
|
7
|
+
* Metadata about the link to add.
|
|
8
|
+
*/
|
|
9
|
+
link: SkyRecentlyAccessedAddLink;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A link to add to the recently accessed links.
|
|
3
|
+
*/
|
|
4
|
+
export interface SkyRecentlyAccessedAddLink {
|
|
5
|
+
/**
|
|
6
|
+
* The link's app.
|
|
7
|
+
*/
|
|
8
|
+
app: string;
|
|
9
|
+
/**
|
|
10
|
+
* The link's route.
|
|
11
|
+
*/
|
|
12
|
+
route: string;
|
|
13
|
+
/**
|
|
14
|
+
* The link's parameters.
|
|
15
|
+
*/
|
|
16
|
+
params?: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot } from '@angular/router';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for adding a recently accessed link via an Angular route.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkyRecentlyAccessedAddRouteArgs {
|
|
6
|
+
/**
|
|
7
|
+
* The route to the link.
|
|
8
|
+
*/
|
|
9
|
+
route: ActivatedRouteSnapshot;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for retrieving a list of recently accessed links.
|
|
3
|
+
*/
|
|
4
|
+
export interface SkyRecentlyAccessedGetLinksArgs {
|
|
5
|
+
/**
|
|
6
|
+
* The links to retrieve.
|
|
7
|
+
*/
|
|
8
|
+
requestedRoutes: {
|
|
9
|
+
/**
|
|
10
|
+
* The link's app.
|
|
11
|
+
*/
|
|
12
|
+
app: string;
|
|
13
|
+
/**
|
|
14
|
+
* The link's route.
|
|
15
|
+
*/
|
|
16
|
+
route: string;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SkyRecentlyAccessedLink } from './recently-accessed-link';
|
|
2
|
+
/**
|
|
3
|
+
* A resolved list of recently accessed links.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkyRecentlyAccessedLinkList {
|
|
6
|
+
/**
|
|
7
|
+
* An array of recently accessed links.
|
|
8
|
+
*/
|
|
9
|
+
links: SkyRecentlyAccessedLink[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolved metsdata about a recently accessed link.
|
|
3
|
+
*/
|
|
4
|
+
export interface SkyRecentlyAccessedLink {
|
|
5
|
+
/**
|
|
6
|
+
* The label to display for the link.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The date the link was last accessed.
|
|
11
|
+
*/
|
|
12
|
+
lastAccessed: Date;
|
|
13
|
+
/**
|
|
14
|
+
* The link's fully-qualified URL.
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { SkyRecentlyAccessedAddLinkArgs } from './recently-accessed-add-link-args';
|
|
3
|
+
import { SkyRecentlyAccessedAddLinkResult } from './recently-accessed-add-link-result';
|
|
4
|
+
import { SkyRecentlyAccessedAddRouteArgs } from './recently-accessed-add-route-args';
|
|
5
|
+
import { SkyRecentlyAccessedGetLinksArgs } from './recently-accessed-get-links-args';
|
|
6
|
+
import { SkyRecentlyAccessedLinkList } from './recently-accessed-link-list';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* A service for creating and retrieving recently accessed links.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class SkyRecentlyAccessedService {
|
|
12
|
+
/**
|
|
13
|
+
* Adds a recently accessed link based on an Angular route.
|
|
14
|
+
* @param args The route to add.
|
|
15
|
+
*/
|
|
16
|
+
abstract addRoute(args: SkyRecentlyAccessedAddRouteArgs): Observable<SkyRecentlyAccessedAddLinkResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a recently accessed link based on metadata about the link.
|
|
19
|
+
* @param args The link to add.
|
|
20
|
+
*/
|
|
21
|
+
abstract addLink(args: SkyRecentlyAccessedAddLinkArgs): Observable<SkyRecentlyAccessedAddLinkResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets a list of recently accessed links.
|
|
24
|
+
* @param args The links to retrieve.
|
|
25
|
+
*/
|
|
26
|
+
abstract getLinks(args: SkyRecentlyAccessedGetLinksArgs): Observable<SkyRecentlyAccessedLinkList>;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SkyRecentlyAccessedService, never>;
|
|
28
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SkyRecentlyAccessedService>;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/router",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.0",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blackbaud",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@angular/common": "^12.2.16",
|
|
20
20
|
"@angular/core": "^12.2.16",
|
|
21
21
|
"@angular/router": "^12.2.16",
|
|
22
|
-
"@skyux/config": "5.
|
|
23
|
-
"@skyux/core": "5.
|
|
22
|
+
"@skyux/config": "5.9.0",
|
|
23
|
+
"@skyux/core": "5.9.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"tslib": "^2.3.1"
|