@skyux/router 15.0.0-alpha.5 → 15.0.0-alpha.6

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.
@@ -89,6 +89,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
89
89
  type: Input
90
90
  }] } });
91
91
 
92
+ /**
93
+ * Provides the `skyAppLink` and `skyAppLinkExternal` directives.
94
+ */
92
95
  /* istanbul ignore next */
93
96
  class SkyAppLinkModule {
94
97
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: SkyAppLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -104,9 +107,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
104
107
  }] });
105
108
 
106
109
  /**
107
- * Return the link as-is.
110
+ * The resolver used by the `skyHref` directive. This default implementation returns the link
111
+ * as-is and grants access to every user. Provide your own implementation to control how links
112
+ * are resolved.
108
113
  */
109
114
  class SkyHrefResolverService {
115
+ /**
116
+ * Resolves a link's final URL and whether the current user may access it.
117
+ */
110
118
  resolveHref(args) {
111
119
  return Promise.resolve({
112
120
  url: args.url,
@@ -337,6 +345,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
337
345
  ]]
338
346
  }] } });
339
347
 
348
+ /**
349
+ * Provides the `skyHref` directive.
350
+ */
340
351
  class SkyHrefModule {
341
352
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: SkyHrefModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
342
353
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.2", ngImport: i0, type: SkyHrefModule, declarations: [SkyHrefDirective], exports: [SkyHrefDirective] }); }
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-router.mjs","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 ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLink } 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 standalone: false,\n})\nexport class SkyAppLinkExternalDirective\n extends RouterLink\n implements OnChanges\n{\n @Input()\n public set skyAppLinkExternal(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n readonly #window = inject(SkyAppWindowRef);\n readonly #skyAppConfig: SkyAppConfig | null;\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n\n constructor() {\n const skyAppConfig = inject(SkyAppConfig, { optional: true });\n const hostConfig = inject(SkyAppConfigHost, { optional: true });\n\n super(\n inject(Router),\n inject(ActivatedRoute),\n undefined,\n inject(Renderer2),\n inject(ElementRef),\n new PathLocationStrategy(\n inject(PlatformLocation),\n hostConfig ? hostConfig.host.url : skyAppConfig?.skyux.host?.url,\n ),\n );\n this.#skyAppConfig = skyAppConfig;\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 override ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.#mergeQueryParams(\n changes['queryParams']?.currentValue,\n );\n super.ngOnChanges(changes);\n }\n\n #mergeQueryParams(queryParams: SkyAppLinkQueryParams): 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 ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLink]',\n standalone: false,\n})\nexport class SkyAppLinkDirective extends RouterLink implements OnChanges {\n @Input()\n public set skyAppLink(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n readonly #skyAppConfig = inject(SkyAppConfig, { optional: true });\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n\n constructor() {\n super(\n inject(Router),\n inject(ActivatedRoute),\n undefined,\n inject(Renderer2),\n inject(ElementRef),\n inject(LocationStrategy),\n );\n }\n\n public override ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.#mergeQueryParams(\n changes['queryParams']?.currentValue,\n );\n super.ngOnChanges(changes);\n }\n\n #mergeQueryParams(queryParams: SkyAppLinkQueryParams): 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 {\n ApplicationRef,\n ChangeDetectorRef,\n DestroyRef,\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n Renderer2,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Router, UrlTree } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { Subscription, catchError, finalize, from, of } from 'rxjs';\n\nimport { SkyHrefResolverService } from './href-resolver.service';\nimport { SkyHref } from './types/href';\nimport { SkyHrefChange } from './types/href-change';\nimport { SkyHrefQueryParams } from './types/href-query-params';\n\ninterface HrefChanges {\n href: string;\n hidden: boolean;\n}\n\n@Directive({\n selector: '[skyHref]',\n standalone: false,\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[] | undefined) {\n if (typeof skyHref === 'string') {\n this.#_skyHref = skyHref;\n } else {\n this.#_skyHref = skyHref ? skyHref.join('/') : '';\n }\n\n this.#checkRouteAccess();\n }\n\n public get skyHref(): string {\n return this.#_skyHref;\n }\n\n /**\n * A collection of query URL parameters.\n */\n @Input()\n public set queryParams(value: SkyHrefQueryParams | undefined) {\n if (value !== this.#_queryParams) {\n this.#_queryParams = value;\n this.#applyChanges(this.#getChanges());\n }\n }\n\n public get queryParams(): SkyHrefQueryParams | undefined {\n return this.#_queryParams;\n }\n\n /**\n * Set the behavior for when the link is not available to either hide the link or display unlinked text.\n *\n * @param value\n */\n @Input()\n public set skyHrefElse(value: 'hide' | 'unlink' | undefined) {\n this.#_skyHrefElse = value;\n this.#applyChanges(this.#getChanges());\n }\n\n public get skyHrefElse(): 'hide' | 'unlink' | undefined {\n return this.#_skyHrefElse;\n }\n\n /**\n * Emits whether the link is available (true) or not (false).\n */\n @Output()\n public skyHrefChange = new EventEmitter<SkyHrefChange>();\n\n #route: SkyHref | false = false;\n\n #href = '';\n\n #_queryParams: SkyHrefQueryParams | undefined;\n #_skyHref = '';\n #_skyHrefElse: 'hide' | 'unlink' | undefined = 'hide';\n\n readonly #router = inject(Router);\n readonly #renderer = inject(Renderer2);\n readonly #element = inject(ElementRef);\n readonly #skyAppConfig = inject(SkyAppConfig, { optional: true });\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n readonly #hrefResolver = inject(SkyHrefResolverService, { optional: true });\n readonly #applicationRef = inject(ApplicationRef);\n readonly #changeDetectorRef = inject(ChangeDetectorRef);\n readonly #destroyRef = inject(DestroyRef);\n #checkingSubscription: Subscription | undefined;\n\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 void this.#router.navigateByUrl(urlTree);\n return false;\n }\n return true;\n }\n\n #applyChanges(change: HrefChanges): void {\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 this.skyHrefChange.emit({ userHasAccess: !change.hidden });\n }\n\n #checkRouteAccess(): void {\n this.#route = {\n url: this.skyHref,\n userHasAccess: false,\n };\n if (this.#hrefResolver && this.skyHref) {\n this.#applyChanges(this.#getChanges());\n this.#checkingSubscription?.unsubscribe();\n try {\n this.#checkingSubscription = from(\n this.#hrefResolver.resolveHref({ url: this.skyHref }),\n )\n .pipe(\n catchError(() =>\n of({\n url: this.skyHref,\n userHasAccess: false,\n } as SkyHref),\n ),\n takeUntilDestroyed(this.#destroyRef),\n finalize(() => {\n this.#applyChanges(this.#getChanges());\n }),\n )\n .subscribe((route) => {\n this.#route = { ...route };\n this.#changeDetectorRef.markForCheck();\n this.#applicationRef.tick();\n });\n } catch {\n // Unable to resolve.\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 #getChanges(): HrefChanges {\n if (!this.#route || !this.#route.userHasAccess) {\n return {\n href: '',\n hidden: this.skyHrefElse === 'hide',\n };\n } else {\n const params =\n // The SkyAppRuntimeParamsProvider is provided in root, so it will never be undefined.\n // TODO: rework the injectors so that #paramsProvider is not possibly undefined.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.#skyAppConfig?.runtime.params ?? this.#paramsProvider!.params;\n\n this.#href = params.getLinkUrl(this.#route.url, {\n queryParams: this.queryParams ?? {},\n });\n\n return {\n href: this.#href,\n hidden: false,\n };\n }\n }\n\n /* istanbul ignore next */\n #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 { NgModule } from '@angular/core';\n\nimport { SkyHrefDirective } from './href.directive';\n\n@NgModule({\n declarations: [SkyHrefDirective],\n exports: [SkyHrefDirective],\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":";;;;;;;;;AAoBA;;AAEG;AAKG,MAAO,2BACX,SAAQ,UAAU,CAAA;IAGlB,IACW,kBAAkB,CAAC,QAAwB,EAAA;AACpD,QAAA,IAAI,CAAC,UAAU,GAAG,QAAQ;IAC5B;AAES,IAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AACjC,IAAA,aAAa;AACb,IAAA,eAAe,GAAG,MAAM,CAAC,iCAAiC,EAAE;AACnE,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;AAEF,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7D,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAE/D,KAAK,CACH,MAAM,CAAC,MAAM,CAAC,EACd,MAAM,CAAC,cAAc,CAAC,EACtB,SAAS,EACT,MAAM,CAAC,SAAS,CAAC,EACjB,MAAM,CAAC,UAAU,CAAC,EAClB,IAAI,oBAAoB,CACtB,MAAM,CAAC,gBAAgB,CAAC,EACxB,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,CACjE,CACF;AACD,QAAA,IAAI,CAAC,aAAa,GAAG,YAAY;QAEjC,IACE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI;YACrC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,EAC5C;AACA,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAA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BAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA;;;ACGD;;AAEG;MAEmB,0BAA0B,CAAA;8GAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1B,0BAA0B,EAAA,CAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAD/C;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"skyux-router.mjs","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 ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLink } 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 standalone: false,\n})\nexport class SkyAppLinkExternalDirective\n extends RouterLink\n implements OnChanges\n{\n @Input()\n public set skyAppLinkExternal(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n readonly #window = inject(SkyAppWindowRef);\n readonly #skyAppConfig: SkyAppConfig | null;\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n\n constructor() {\n const skyAppConfig = inject(SkyAppConfig, { optional: true });\n const hostConfig = inject(SkyAppConfigHost, { optional: true });\n\n super(\n inject(Router),\n inject(ActivatedRoute),\n undefined,\n inject(Renderer2),\n inject(ElementRef),\n new PathLocationStrategy(\n inject(PlatformLocation),\n hostConfig ? hostConfig.host.url : skyAppConfig?.skyux.host?.url,\n ),\n );\n this.#skyAppConfig = skyAppConfig;\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 override ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.#mergeQueryParams(\n changes['queryParams']?.currentValue,\n );\n super.ngOnChanges(changes);\n }\n\n #mergeQueryParams(queryParams: SkyAppLinkQueryParams): 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 ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLink]',\n standalone: false,\n})\nexport class SkyAppLinkDirective extends RouterLink implements OnChanges {\n @Input()\n public set skyAppLink(commands: any[] | string) {\n this.routerLink = commands;\n }\n\n readonly #skyAppConfig = inject(SkyAppConfig, { optional: true });\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n\n constructor() {\n super(\n inject(Router),\n inject(ActivatedRoute),\n undefined,\n inject(Renderer2),\n inject(ElementRef),\n inject(LocationStrategy),\n );\n }\n\n public override ngOnChanges(changes: SimpleChanges): void {\n this.queryParams = this.#mergeQueryParams(\n changes['queryParams']?.currentValue,\n );\n super.ngOnChanges(changes);\n }\n\n #mergeQueryParams(queryParams: SkyAppLinkQueryParams): 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/**\n * Provides the `skyAppLink` and `skyAppLinkExternal` directives.\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 * The resolver used by the `skyHref` directive. This default implementation returns the link\n * as-is and grants access to every user. Provide your own implementation to control how links\n * are resolved.\n */\n@Injectable()\nexport class SkyHrefResolverService implements SkyHrefResolver {\n /**\n * Resolves a link's final URL and whether the current user may access it.\n */\n public resolveHref(args: SkyHrefResolverArgs): Promise<SkyHref> {\n return Promise.resolve<SkyHref>({\n url: args.url,\n userHasAccess: true,\n });\n }\n}\n","import {\n ApplicationRef,\n ChangeDetectorRef,\n DestroyRef,\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n Output,\n Renderer2,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Router, UrlTree } from '@angular/router';\nimport { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';\n\nimport { Subscription, catchError, finalize, from, of } from 'rxjs';\n\nimport { SkyHrefResolverService } from './href-resolver.service';\nimport { SkyHref } from './types/href';\nimport { SkyHrefChange } from './types/href-change';\nimport { SkyHrefQueryParams } from './types/href-query-params';\n\ninterface HrefChanges {\n href: string;\n hidden: boolean;\n}\n\n@Directive({\n selector: '[skyHref]',\n standalone: false,\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[] | undefined) {\n if (typeof skyHref === 'string') {\n this.#_skyHref = skyHref;\n } else {\n this.#_skyHref = skyHref ? skyHref.join('/') : '';\n }\n\n this.#checkRouteAccess();\n }\n\n public get skyHref(): string {\n return this.#_skyHref;\n }\n\n /**\n * A collection of query URL parameters.\n */\n @Input()\n public set queryParams(value: SkyHrefQueryParams | undefined) {\n if (value !== this.#_queryParams) {\n this.#_queryParams = value;\n this.#applyChanges(this.#getChanges());\n }\n }\n\n public get queryParams(): SkyHrefQueryParams | undefined {\n return this.#_queryParams;\n }\n\n /**\n * Set the behavior for when the link is not available to either hide the link or display unlinked text.\n *\n * @param value\n */\n @Input()\n public set skyHrefElse(value: 'hide' | 'unlink' | undefined) {\n this.#_skyHrefElse = value;\n this.#applyChanges(this.#getChanges());\n }\n\n public get skyHrefElse(): 'hide' | 'unlink' | undefined {\n return this.#_skyHrefElse;\n }\n\n /**\n * Emits whether the link is available (true) or not (false).\n */\n @Output()\n public skyHrefChange = new EventEmitter<SkyHrefChange>();\n\n #route: SkyHref | false = false;\n\n #href = '';\n\n #_queryParams: SkyHrefQueryParams | undefined;\n #_skyHref = '';\n #_skyHrefElse: 'hide' | 'unlink' | undefined = 'hide';\n\n readonly #router = inject(Router);\n readonly #renderer = inject(Renderer2);\n readonly #element = inject(ElementRef);\n readonly #skyAppConfig = inject(SkyAppConfig, { optional: true });\n readonly #paramsProvider = inject(SkyAppRuntimeConfigParamsProvider, {\n optional: true,\n });\n readonly #hrefResolver = inject(SkyHrefResolverService, { optional: true });\n readonly #applicationRef = inject(ApplicationRef);\n readonly #changeDetectorRef = inject(ChangeDetectorRef);\n readonly #destroyRef = inject(DestroyRef);\n #checkingSubscription: Subscription | undefined;\n\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 void this.#router.navigateByUrl(urlTree);\n return false;\n }\n return true;\n }\n\n #applyChanges(change: HrefChanges): void {\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 this.skyHrefChange.emit({ userHasAccess: !change.hidden });\n }\n\n #checkRouteAccess(): void {\n this.#route = {\n url: this.skyHref,\n userHasAccess: false,\n };\n if (this.#hrefResolver && this.skyHref) {\n this.#applyChanges(this.#getChanges());\n this.#checkingSubscription?.unsubscribe();\n try {\n this.#checkingSubscription = from(\n this.#hrefResolver.resolveHref({ url: this.skyHref }),\n )\n .pipe(\n catchError(() =>\n of({\n url: this.skyHref,\n userHasAccess: false,\n } as SkyHref),\n ),\n takeUntilDestroyed(this.#destroyRef),\n finalize(() => {\n this.#applyChanges(this.#getChanges());\n }),\n )\n .subscribe((route) => {\n this.#route = { ...route };\n this.#changeDetectorRef.markForCheck();\n this.#applicationRef.tick();\n });\n } catch {\n // Unable to resolve.\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 #getChanges(): HrefChanges {\n if (!this.#route || !this.#route.userHasAccess) {\n return {\n href: '',\n hidden: this.skyHrefElse === 'hide',\n };\n } else {\n const params =\n // The SkyAppRuntimeParamsProvider is provided in root, so it will never be undefined.\n // TODO: rework the injectors so that #paramsProvider is not possibly undefined.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.#skyAppConfig?.runtime.params ?? this.#paramsProvider!.params;\n\n this.#href = params.getLinkUrl(this.#route.url, {\n queryParams: this.queryParams ?? {},\n });\n\n return {\n href: this.#href,\n hidden: false,\n };\n }\n }\n\n /* istanbul ignore next */\n #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 { NgModule } from '@angular/core';\n\nimport { SkyHrefDirective } from './href.directive';\n\n/**\n * Provides the `skyHref` directive.\n */\n@NgModule({\n declarations: [SkyHrefDirective],\n exports: [SkyHrefDirective],\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":";;;;;;;;;AAoBA;;AAEG;AAKG,MAAO,2BACX,SAAQ,UAAU,CAAA;IAGlB,IACW,kBAAkB,CAAC,QAAwB,EAAA;AACpD,QAAA,IAAI,CAAC,UAAU,GAAG,QAAQ;IAC5B;AAES,IAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AACjC,IAAA,aAAa;AACb,IAAA,eAAe,GAAG,MAAM,CAAC,iCAAiC,EAAE;AACnE,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;AAEF,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7D,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,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,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,KAAK;AAClB,iBAAA;;sBAQE;;sBAkBA;;sBAiBA;;sBAaA;;sBAwBA,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;AACjB,qBAAA;;;AClHH;;AAEG;MAKU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAb,aAAa,EAAA,YAAA,EAAA,CAHT,gBAAgB,CAAA,EAAA,OAAA,EAAA,CACrB,gBAAgB,CAAA,EAAA,CAAA,CAAA;+GAEf,aAAa,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA;;;ACAD;;AAEG;MAEmB,0BAA0B,CAAA;8GAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1B,0BAA0B,EAAA,CAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAD/C;;;ACbD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/router",
3
- "version": "15.0.0-alpha.5",
3
+ "version": "15.0.0-alpha.6",
4
4
  "author": "Blackbaud, Inc.",
5
5
  "keywords": [
6
6
  "blackbaud",
@@ -20,8 +20,8 @@
20
20
  "@angular/common": "^22.1.2",
21
21
  "@angular/core": "^22.1.2",
22
22
  "@angular/router": "^22.1.2",
23
- "@skyux/config": "15.0.0-alpha.5",
24
- "@skyux/core": "15.0.0-alpha.5"
23
+ "@skyux/config": "15.0.0-alpha.6",
24
+ "@skyux/core": "15.0.0-alpha.6"
25
25
  },
26
26
  "dependencies": {
27
27
  "tslib": "^2.8.1"
@@ -3,6 +3,9 @@ import { OnChanges, SimpleChanges, EventEmitter } from '@angular/core';
3
3
  import { RouterLink, ActivatedRouteSnapshot } from '@angular/router';
4
4
  import { Observable } from 'rxjs';
5
5
 
6
+ /**
7
+ * A collection of query URL parameters.
8
+ */
6
9
  type SkyAppLinkQueryParams = Record<string, any>;
7
10
 
8
11
  declare class SkyAppLinkDirective extends RouterLink implements OnChanges {
@@ -26,40 +29,80 @@ declare class SkyAppLinkExternalDirective extends RouterLink implements OnChange
26
29
  static ɵdir: i0.ɵɵDirectiveDeclaration<SkyAppLinkExternalDirective, "[skyAppLinkExternal]", never, { "skyAppLinkExternal": { "alias": "skyAppLinkExternal"; "required": false; }; }, {}, never, never, false, never>;
27
30
  }
28
31
 
32
+ /**
33
+ * Provides the `skyAppLink` and `skyAppLinkExternal` directives.
34
+ */
29
35
  declare class SkyAppLinkModule {
30
36
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyAppLinkModule, never>;
31
37
  static ɵmod: i0.ɵɵNgModuleDeclaration<SkyAppLinkModule, [typeof SkyAppLinkDirective, typeof SkyAppLinkExternalDirective], never, [typeof SkyAppLinkDirective, typeof SkyAppLinkExternalDirective]>;
32
38
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyAppLinkModule>;
33
39
  }
34
40
 
41
+ /**
42
+ * A resolved link for the `skyHref` directive.
43
+ */
35
44
  interface SkyHref {
45
+ /**
46
+ * The name of the app that owns the route.
47
+ */
36
48
  app?: string;
49
+ /**
50
+ * The app-relative path of the route. The path may contain `:`-prefixed parameter
51
+ * placeholders, which a resolver substitutes with values from the requested link.
52
+ */
37
53
  route?: string;
54
+ /**
55
+ * The link's resolved URL.
56
+ */
38
57
  url: string;
58
+ /**
59
+ * Whether the current user may access the link.
60
+ */
39
61
  userHasAccess?: boolean;
40
62
  aliases?: string[];
41
63
  }
42
64
 
43
- interface SkyHrefResolver {
44
- resolveHref(param: {
45
- url: string;
46
- }): Promise<SkyHref>;
47
- }
48
-
65
+ /**
66
+ * Parameters for resolving a link.
67
+ */
49
68
  interface SkyHrefResolverArgs {
69
+ /**
70
+ * The link to resolve.
71
+ */
50
72
  url: string;
51
73
  }
52
74
 
53
75
  /**
54
- * Return the link as-is.
76
+ * A contract for resolving the links used by the `skyHref` directive.
77
+ */
78
+ interface SkyHrefResolver {
79
+ /**
80
+ * Resolves a link's final URL and whether the current user may access it.
81
+ */
82
+ resolveHref(args: SkyHrefResolverArgs): Promise<SkyHref>;
83
+ }
84
+
85
+ /**
86
+ * The resolver used by the `skyHref` directive. This default implementation returns the link
87
+ * as-is and grants access to every user. Provide your own implementation to control how links
88
+ * are resolved.
55
89
  */
56
90
  declare class SkyHrefResolverService implements SkyHrefResolver {
91
+ /**
92
+ * Resolves a link's final URL and whether the current user may access it.
93
+ */
57
94
  resolveHref(args: SkyHrefResolverArgs): Promise<SkyHref>;
58
95
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyHrefResolverService, never>;
59
96
  static ɵprov: i0.ɵɵInjectableDeclaration<SkyHrefResolverService>;
60
97
  }
61
98
 
99
+ /**
100
+ * The change event emitted when a link's availability changes.
101
+ */
62
102
  interface SkyHrefChange {
103
+ /**
104
+ * Whether the current user may access the link.
105
+ */
63
106
  userHasAccess: boolean;
64
107
  }
65
108
 
@@ -99,6 +142,9 @@ declare class SkyHrefDirective {
99
142
  static ɵdir: i0.ɵɵDirectiveDeclaration<SkyHrefDirective, "[skyHref]", never, { "skyHref": { "alias": "skyHref"; "required": false; }; "queryParams": { "alias": "queryParams"; "required": false; }; "skyHrefElse": { "alias": "skyHrefElse"; "required": false; }; }, { "skyHrefChange": "skyHrefChange"; }, never, never, false, never>;
100
143
  }
101
144
 
145
+ /**
146
+ * Provides the `skyHref` directive.
147
+ */
102
148
  declare class SkyHrefModule {
103
149
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyHrefModule, never>;
104
150
  static ɵmod: i0.ɵɵNgModuleDeclaration<SkyHrefModule, [typeof SkyHrefDirective], never, [typeof SkyHrefDirective]>;