@skyux/router 5.5.0-beta.0 → 5.6.1
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 +51 -51
- package/esm2015/lib/modules/href/href.directive.js +1 -1
- package/esm2015/lib/modules/href/href.directive.js.map +1 -1
- package/esm2015/lib/modules/link/link-external.directive.js +1 -1
- package/esm2015/lib/modules/link/link-external.directive.js.map +1 -1
- package/esm2015/lib/modules/link/link.directive.js +1 -1
- package/esm2015/lib/modules/link/link.directive.js.map +1 -1
- package/esm2015/lib/modules/link/link.module.js +1 -1
- package/esm2015/lib/modules/link/link.module.js.map +1 -1
- package/fesm2015/skyux-router.js +37 -37
- package/fesm2015/skyux-router.js.map +1 -1
- package/lib/modules/link/link-external.directive.d.ts +1 -1
- package/lib/modules/link/link.directive.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/router', ['exports', '@angular/core', '@angular/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.router = {}), global.ng.core, global.ng.
|
|
5
|
-
})(this, (function (exports, i0, i1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@skyux/core'), require('@skyux/config'), require('@angular/common/http')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@skyux/router', ['exports', '@angular/core', '@angular/common', '@angular/router', '@skyux/core', '@skyux/config', '@angular/common/http'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.router = {}), global.ng.core, global.ng.common, global.ng.router, global.i3, global.i4, global.ng.common.http));
|
|
5
|
+
})(this, (function (exports, i0, i2, i1, i3, i4, http) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
26
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
28
|
-
var
|
|
27
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
28
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
29
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
30
30
|
|
|
31
31
|
/*! *****************************************************************************
|
|
32
32
|
Copyright (c) Microsoft Corporation.
|
|
@@ -346,51 +346,6 @@
|
|
|
346
346
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
var SkyAppLinkDirective = /** @class */ (function (_super) {
|
|
350
|
-
__extends(SkyAppLinkDirective, _super);
|
|
351
|
-
function SkyAppLinkDirective(router, route, locationStrategy, skyAppConfig, paramsProvider) {
|
|
352
|
-
var _this = _super.call(this, router, route, locationStrategy) || this;
|
|
353
|
-
_this.skyAppConfig = skyAppConfig;
|
|
354
|
-
_this.paramsProvider = paramsProvider;
|
|
355
|
-
return _this;
|
|
356
|
-
}
|
|
357
|
-
Object.defineProperty(SkyAppLinkDirective.prototype, "skyAppLink", {
|
|
358
|
-
set: function (commands) {
|
|
359
|
-
this.routerLink = commands;
|
|
360
|
-
},
|
|
361
|
-
enumerable: false,
|
|
362
|
-
configurable: true
|
|
363
|
-
});
|
|
364
|
-
SkyAppLinkDirective.prototype.ngOnChanges = function (changes) {
|
|
365
|
-
var _a;
|
|
366
|
-
this.queryParams = this.mergeQueryParams((_a = changes.queryParams) === null || _a === void 0 ? void 0 : _a.currentValue);
|
|
367
|
-
_super.prototype.ngOnChanges.call(this, changes);
|
|
368
|
-
};
|
|
369
|
-
SkyAppLinkDirective.prototype.mergeQueryParams = function (queryParams) {
|
|
370
|
-
var skyuxParams = this.skyAppConfig
|
|
371
|
-
? this.skyAppConfig.runtime.params.getAll(true)
|
|
372
|
-
: this.paramsProvider.params.getAll(true);
|
|
373
|
-
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
374
|
-
};
|
|
375
|
-
return SkyAppLinkDirective;
|
|
376
|
-
}(i1.RouterLinkWithHref));
|
|
377
|
-
SkyAppLinkDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppLinkDirective, deps: [{ token: i1__namespace.Router }, { token: i1__namespace.ActivatedRoute }, { token: i2__namespace.LocationStrategy }, { token: i4__namespace.SkyAppConfig, optional: true }, { token: i4__namespace.SkyAppRuntimeConfigParamsProvider, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
378
|
-
SkyAppLinkDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
|
|
379
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppLinkDirective, decorators: [{
|
|
380
|
-
type: i0.Directive,
|
|
381
|
-
args: [{
|
|
382
|
-
selector: '[skyAppLink]',
|
|
383
|
-
}]
|
|
384
|
-
}], ctorParameters: function () {
|
|
385
|
-
return [{ type: i1__namespace.Router }, { type: i1__namespace.ActivatedRoute }, { type: i2__namespace.LocationStrategy }, { type: i4__namespace.SkyAppConfig, decorators: [{
|
|
386
|
-
type: i0.Optional
|
|
387
|
-
}] }, { type: i4__namespace.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
388
|
-
type: i0.Optional
|
|
389
|
-
}] }];
|
|
390
|
-
}, propDecorators: { skyAppLink: [{
|
|
391
|
-
type: i0.Input
|
|
392
|
-
}] } });
|
|
393
|
-
|
|
394
349
|
/**
|
|
395
350
|
* @deprecated Use `skyHref` directive instead.
|
|
396
351
|
*/
|
|
@@ -449,6 +404,51 @@
|
|
|
449
404
|
type: i0.Input
|
|
450
405
|
}] } });
|
|
451
406
|
|
|
407
|
+
var SkyAppLinkDirective = /** @class */ (function (_super) {
|
|
408
|
+
__extends(SkyAppLinkDirective, _super);
|
|
409
|
+
function SkyAppLinkDirective(router, route, locationStrategy, skyAppConfig, paramsProvider) {
|
|
410
|
+
var _this = _super.call(this, router, route, locationStrategy) || this;
|
|
411
|
+
_this.skyAppConfig = skyAppConfig;
|
|
412
|
+
_this.paramsProvider = paramsProvider;
|
|
413
|
+
return _this;
|
|
414
|
+
}
|
|
415
|
+
Object.defineProperty(SkyAppLinkDirective.prototype, "skyAppLink", {
|
|
416
|
+
set: function (commands) {
|
|
417
|
+
this.routerLink = commands;
|
|
418
|
+
},
|
|
419
|
+
enumerable: false,
|
|
420
|
+
configurable: true
|
|
421
|
+
});
|
|
422
|
+
SkyAppLinkDirective.prototype.ngOnChanges = function (changes) {
|
|
423
|
+
var _a;
|
|
424
|
+
this.queryParams = this.mergeQueryParams((_a = changes.queryParams) === null || _a === void 0 ? void 0 : _a.currentValue);
|
|
425
|
+
_super.prototype.ngOnChanges.call(this, changes);
|
|
426
|
+
};
|
|
427
|
+
SkyAppLinkDirective.prototype.mergeQueryParams = function (queryParams) {
|
|
428
|
+
var skyuxParams = this.skyAppConfig
|
|
429
|
+
? this.skyAppConfig.runtime.params.getAll(true)
|
|
430
|
+
: this.paramsProvider.params.getAll(true);
|
|
431
|
+
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
432
|
+
};
|
|
433
|
+
return SkyAppLinkDirective;
|
|
434
|
+
}(i1.RouterLinkWithHref));
|
|
435
|
+
SkyAppLinkDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppLinkDirective, deps: [{ token: i1__namespace.Router }, { token: i1__namespace.ActivatedRoute }, { token: i2__namespace.LocationStrategy }, { token: i4__namespace.SkyAppConfig, optional: true }, { token: i4__namespace.SkyAppRuntimeConfigParamsProvider, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
436
|
+
SkyAppLinkDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
|
|
437
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppLinkDirective, decorators: [{
|
|
438
|
+
type: i0.Directive,
|
|
439
|
+
args: [{
|
|
440
|
+
selector: '[skyAppLink]',
|
|
441
|
+
}]
|
|
442
|
+
}], ctorParameters: function () {
|
|
443
|
+
return [{ type: i1__namespace.Router }, { type: i1__namespace.ActivatedRoute }, { type: i2__namespace.LocationStrategy }, { type: i4__namespace.SkyAppConfig, decorators: [{
|
|
444
|
+
type: i0.Optional
|
|
445
|
+
}] }, { type: i4__namespace.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
446
|
+
type: i0.Optional
|
|
447
|
+
}] }];
|
|
448
|
+
}, propDecorators: { skyAppLink: [{
|
|
449
|
+
type: i0.Input
|
|
450
|
+
}] } });
|
|
451
|
+
|
|
452
452
|
/* istanbul ignore next */
|
|
453
453
|
var SkyAppLinkModule = /** @class */ (function () {
|
|
454
454
|
function SkyAppLinkModule() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"href.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/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BAqCI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CA9BA,OAAO;sBADjB,KAAK;gBAYK,WAAW;sBADrB,KAAK;gBA+BC,OAAO;sBAPb,YAAY;uBAAC,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;qBACjB","sourcesContent":["import { HttpParams } from '@angular/common/http';\nimport {\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';\n\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 ) {}\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 });\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 let 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"]}
|
|
1
|
+
{"version":3,"file":"href.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/href/href.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAW,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAGhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;;;;;AAQjE,MAAM,OAAO,gBAAgB;IAgC3B,YACU,MAAc,EACd,QAAmB,EACnB,OAAmB,EACP,YAA2B,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SACd;QAED,MAAM,OAAO,GAAG,CACd,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;YAChC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACvC,CAAC,EACD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAC9C,CACF,CAAC,WAAW,EAAE,CAAC;QAEhB,IACE,IAAI,KAAK,OAAO;YAChB,uFAAuF;YACvF,sEAAsE;YACtE,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;IACf,CAAC;;8GApMU,gBAAgB;kGAAhB,gBAAgB;4FAAhB,gBAAgB;kBAH5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;iBACtB;;0BAqCI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CA9BA,OAAO;sBADjB,KAAK;gBAYK,WAAW;sBADrB,KAAK;gBA+BC,OAAO;sBAPb,YAAY;uBAAC,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;qBACjB","sourcesContent":["import { HttpParams } from '@angular/common/http';\nimport {\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 ) {}\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 });\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"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Directive, Input, Optional, } from '@angular/core';
|
|
2
1
|
import { PathLocationStrategy, PlatformLocation } from '@angular/common';
|
|
2
|
+
import { Directive, Input, Optional, } from '@angular/core';
|
|
3
3
|
import { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';
|
|
4
4
|
import { SkyAppConfig, SkyAppConfigHost, SkyAppRuntimeConfigParamsProvider, } from '@skyux/config';
|
|
5
5
|
import { SkyAppWindowRef } from '@skyux/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-external.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link-external.directive.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"link-external.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link-external.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,SAAS,EACT,KAAK,EAEL,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iCAAiC,GAClC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;;;;;;AAI9C;;GAEG;AAIH,MAAM,OAAO,2BACX,S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QAExC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;;yHAlDU,2BAA2B;6GAA3B,2BAA2B;4FAA3B,2BAA2B;kBAHvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;iBACjC;;0BAeI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CAXP,kBAAkB;sBADrB,KAAK","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"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Directive, Input, Optional, } from '@angular/core';
|
|
2
1
|
import { LocationStrategy } from '@angular/common';
|
|
2
|
+
import { Directive, Input, Optional, } from '@angular/core';
|
|
3
3
|
import { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';
|
|
4
4
|
import { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,QAAQ,GAET,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"link.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,SAAS,EACT,KAAK,EAEL,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;;;;;AAOhF,MAAM,OAAO,mBACX,SAAQ,kBAAkB;IAQ1B,YACE,MAAc,EACd,KAAqB,EACrB,gBAAkC,EACd,YAA2B,EAC3B,cAAkD;QAEtE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QAHnB,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAoC;IAGxE,CAAC;IAbD,IACI,UAAU,CAAC,QAAwB;QACrC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAYM,WAAW,CAAC,OAAsB;;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAA,OAAO,CAAC,WAAW,0CAAE,YAAY,CAAC,CAAC;QAC5E,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEO,gBAAgB,CACtB,WAAkC;QAElC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY;YACnC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;;iHAhCU,mBAAmB;qGAAnB,mBAAmB;4FAAnB,mBAAmB;kBAH/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;;0BAcI,QAAQ;;0BACR,QAAQ;4CATP,UAAU;sBADb,KAAK","sourcesContent":["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"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import { SkyAppLinkDirective } from './link.directive';
|
|
3
2
|
import { SkyAppLinkExternalDirective } from './link-external.directive';
|
|
3
|
+
import { SkyAppLinkDirective } from './link.directive';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/* istanbul ignore next */
|
|
6
6
|
export class SkyAppLinkModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"link.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/router/src/lib/modules/link/link.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;;AAMvD,0BAA0B;AAC1B,MAAM,OAAO,gBAAgB;;8GAAhB,gBAAgB;+GAAhB,gBAAgB,iBAJZ,mBAAmB,EAAE,2BAA2B,aACrD,mBAAmB,EAAE,2BAA2B;+GAG/C,gBAAgB;4FAAhB,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;oBAChE,OAAO,EAAE,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;iBAC5D","sourcesContent":["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"]}
|
package/fesm2015/skyux-router.js
CHANGED
|
@@ -8,42 +8,6 @@ import * as i4 from '@skyux/config';
|
|
|
8
8
|
import * as i3 from '@skyux/core';
|
|
9
9
|
import { HttpParams } from '@angular/common/http';
|
|
10
10
|
|
|
11
|
-
class SkyAppLinkDirective extends RouterLinkWithHref {
|
|
12
|
-
constructor(router, route, locationStrategy, skyAppConfig, paramsProvider) {
|
|
13
|
-
super(router, route, locationStrategy);
|
|
14
|
-
this.skyAppConfig = skyAppConfig;
|
|
15
|
-
this.paramsProvider = paramsProvider;
|
|
16
|
-
}
|
|
17
|
-
set skyAppLink(commands) {
|
|
18
|
-
this.routerLink = commands;
|
|
19
|
-
}
|
|
20
|
-
ngOnChanges(changes) {
|
|
21
|
-
var _a;
|
|
22
|
-
this.queryParams = this.mergeQueryParams((_a = changes.queryParams) === null || _a === void 0 ? void 0 : _a.currentValue);
|
|
23
|
-
super.ngOnChanges(changes);
|
|
24
|
-
}
|
|
25
|
-
mergeQueryParams(queryParams) {
|
|
26
|
-
const skyuxParams = this.skyAppConfig
|
|
27
|
-
? this.skyAppConfig.runtime.params.getAll(true)
|
|
28
|
-
: this.paramsProvider.params.getAll(true);
|
|
29
|
-
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
SkyAppLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppLinkDirective, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.LocationStrategy }, { token: i4.SkyAppConfig, optional: true }, { token: i4.SkyAppRuntimeConfigParamsProvider, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
33
|
-
SkyAppLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppLinkDirective, decorators: [{
|
|
35
|
-
type: Directive,
|
|
36
|
-
args: [{
|
|
37
|
-
selector: '[skyAppLink]',
|
|
38
|
-
}]
|
|
39
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.LocationStrategy }, { type: i4.SkyAppConfig, decorators: [{
|
|
40
|
-
type: Optional
|
|
41
|
-
}] }, { type: i4.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
42
|
-
type: Optional
|
|
43
|
-
}] }]; }, propDecorators: { skyAppLink: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}] } });
|
|
46
|
-
|
|
47
11
|
/**
|
|
48
12
|
* @deprecated Use `skyHref` directive instead.
|
|
49
13
|
*/
|
|
@@ -93,6 +57,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
93
57
|
type: Input
|
|
94
58
|
}] } });
|
|
95
59
|
|
|
60
|
+
class SkyAppLinkDirective extends RouterLinkWithHref {
|
|
61
|
+
constructor(router, route, locationStrategy, skyAppConfig, paramsProvider) {
|
|
62
|
+
super(router, route, locationStrategy);
|
|
63
|
+
this.skyAppConfig = skyAppConfig;
|
|
64
|
+
this.paramsProvider = paramsProvider;
|
|
65
|
+
}
|
|
66
|
+
set skyAppLink(commands) {
|
|
67
|
+
this.routerLink = commands;
|
|
68
|
+
}
|
|
69
|
+
ngOnChanges(changes) {
|
|
70
|
+
var _a;
|
|
71
|
+
this.queryParams = this.mergeQueryParams((_a = changes.queryParams) === null || _a === void 0 ? void 0 : _a.currentValue);
|
|
72
|
+
super.ngOnChanges(changes);
|
|
73
|
+
}
|
|
74
|
+
mergeQueryParams(queryParams) {
|
|
75
|
+
const skyuxParams = this.skyAppConfig
|
|
76
|
+
? this.skyAppConfig.runtime.params.getAll(true)
|
|
77
|
+
: this.paramsProvider.params.getAll(true);
|
|
78
|
+
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
SkyAppLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppLinkDirective, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.LocationStrategy }, { token: i4.SkyAppConfig, optional: true }, { token: i4.SkyAppRuntimeConfigParamsProvider, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
82
|
+
SkyAppLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppLinkDirective, decorators: [{
|
|
84
|
+
type: Directive,
|
|
85
|
+
args: [{
|
|
86
|
+
selector: '[skyAppLink]',
|
|
87
|
+
}]
|
|
88
|
+
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.LocationStrategy }, { type: i4.SkyAppConfig, decorators: [{
|
|
89
|
+
type: Optional
|
|
90
|
+
}] }, { type: i4.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
91
|
+
type: Optional
|
|
92
|
+
}] }]; }, propDecorators: { skyAppLink: [{
|
|
93
|
+
type: Input
|
|
94
|
+
}] } });
|
|
95
|
+
|
|
96
96
|
/* istanbul ignore next */
|
|
97
97
|
class SkyAppLinkModule {
|
|
98
98
|
}
|
|
@@ -214,7 +214,7 @@ class SkyHrefDirective {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
getChanges() {
|
|
217
|
-
|
|
217
|
+
const queryParams = {};
|
|
218
218
|
if (!this._route || !this._route.userHasAccess) {
|
|
219
219
|
return {
|
|
220
220
|
href: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-router.js","sources":["../../../../../libs/components/router/src/lib/modules/link/link.directive.ts","../../../../../libs/components/router/src/lib/modules/link/link-external.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 {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\n\nimport { LocationStrategy } from '@angular/common';\n\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\n\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 {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n} from '@angular/core';\n\nimport { PathLocationStrategy, PlatformLocation } from '@angular/common';\n\nimport { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';\n\nimport {\n SkyAppConfig,\n SkyAppConfigHost,\n SkyAppRuntimeConfigParamsProvider,\n} from '@skyux/config';\n\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 { NgModule } from '@angular/core';\n\nimport { SkyAppLinkDirective } from './link.directive';\n\nimport { SkyAppLinkExternalDirective } from './link-external.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 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';\n\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 ) {}\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 });\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 let 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":";;;;;;;;;;MAmBa,mBACX,SAAQ,kBAAkB;IAQ1B,YACE,MAAc,EACd,KAAqB,EACrB,gBAAkC,EACd,YAA2B,EAC3B,cAAkD;QAEtE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QAHnB,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAoC;KAGvE;IAbD,IACI,UAAU,CAAC,QAAwB;QACrC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;KAC5B;IAYM,WAAW,CAAC,OAAsB;;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAA,OAAO,CAAC,WAAW,0CAAE,YAAY,CAAC,CAAC;QAC5E,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC5B;IAEO,gBAAgB,CACtB,WAAkC;QAElC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY;cACjC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;cAC7C,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;KACtE;;iHAhCU,mBAAmB;qGAAnB,mBAAmB;4FAAnB,mBAAmB;kBAH/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;;0BAcI,QAAQ;;0BACR,QAAQ;4CATP,UAAU;sB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,OAAO,KAAK,CAAC;KACd;;8GApMU,gBAAgB;kGAAhB,gBAAgB;4FAAhB,gBAAgB;kBAH5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;iBACtB;;0BAqCI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CA9BA,OAAO;sBADjB,KAAK;gBAYK,WAAW;sBADrB,KAAK;gBA+BC,OAAO;sBAPb,YAAY;uBAAC,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;qBACjB;;;MC5DU,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/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 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 ) {}\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 });\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,WAAW,GAAG,IAAI,CAAC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SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,OAAO,KAAK,CAAC;KACd;;8GApMU,gBAAgB;kGAAhB,gBAAgB;4FAAhB,gBAAgB;kBAH5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;iBACtB;;0BAqCI,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;4CA9BA,OAAO;sBADjB,KAAK;gBAYK,WAAW;sBADrB,KAAK;gBA+BC,OAAO;sBAPb,YAAY;uBAAC,OAAO,EAAE;wBACrB,eAAe;wBACf,gBAAgB;wBAChB,iBAAiB;wBACjB,eAAe;wBACf,gBAAgB;qBACjB;;;MC3DU,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,5 +1,5 @@
|
|
|
1
|
-
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
1
|
import { PlatformLocation } from '@angular/common';
|
|
2
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
3
3
|
import { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';
|
|
4
4
|
import { SkyAppConfig, SkyAppConfigHost, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';
|
|
5
5
|
import { SkyAppWindowRef } from '@skyux/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
1
|
import { LocationStrategy } from '@angular/common';
|
|
2
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
3
3
|
import { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';
|
|
4
4
|
import { SkyAppConfig, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';
|
|
5
5
|
import * as i0 from "@angular/core";
|
package/package.json
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/router",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^12.2.16",
|
|
6
|
-
"@angular/core": "^12.2.16",
|
|
7
|
-
"@angular/router": "^12.2.16",
|
|
8
|
-
"@skyux/config": "5.5.0-beta.0",
|
|
9
|
-
"@skyux/core": "5.5.0-beta.0"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"tslib": "^2.3.1"
|
|
13
|
-
},
|
|
3
|
+
"version": "5.6.1",
|
|
14
4
|
"author": "Blackbaud, Inc.",
|
|
15
5
|
"keywords": [
|
|
16
6
|
"blackbaud",
|
|
@@ -25,6 +15,16 @@
|
|
|
25
15
|
"url": "https://github.com/blackbaud/skyux/issues"
|
|
26
16
|
},
|
|
27
17
|
"homepage": "https://github.com/blackbaud/skyux#readme",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^12.2.16",
|
|
20
|
+
"@angular/core": "^12.2.16",
|
|
21
|
+
"@angular/router": "^12.2.16",
|
|
22
|
+
"@skyux/config": "5.6.1",
|
|
23
|
+
"@skyux/core": "5.6.1"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"tslib": "^2.3.1"
|
|
27
|
+
},
|
|
28
28
|
"main": "bundles/skyux-router.umd.js",
|
|
29
29
|
"module": "fesm2015/skyux-router.js",
|
|
30
30
|
"es2015": "fesm2015/skyux-router.js",
|