@skyux/router 5.0.0-beta.2 → 5.0.2
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 +75 -64
- package/bundles/skyux-router.umd.js.map +1 -1
- package/documentation.json +49 -23
- package/esm2015/modules/href/href-resolver.js +1 -1
- package/esm2015/modules/href/href-resolver.service.js +5 -5
- package/esm2015/modules/href/href.directive.js +39 -20
- package/esm2015/modules/href/href.module.js +6 -6
- package/esm2015/modules/link/link-external.directive.js +13 -11
- package/esm2015/modules/link/link.directive.js +7 -7
- package/esm2015/modules/link/link.module.js +7 -15
- package/fesm2015/skyux-router.js +68 -55
- package/fesm2015/skyux-router.js.map +1 -1
- package/modules/href/href.directive.d.ts +7 -1
- package/modules/link/link-external.directive.d.ts +3 -0
- package/package.json +7 -7
|
@@ -5,22 +5,14 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
/* istanbul ignore next */
|
|
6
6
|
export class SkyAppLinkModule {
|
|
7
7
|
}
|
|
8
|
-
SkyAppLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
9
|
-
SkyAppLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SkyAppLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: SkyAppLinkModule });
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: SkyAppLinkModule, decorators: [{
|
|
8
|
+
SkyAppLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
SkyAppLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective], exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective] });
|
|
10
|
+
SkyAppLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, decorators: [{
|
|
14
12
|
type: NgModule,
|
|
15
13
|
args: [{
|
|
16
|
-
declarations: [
|
|
17
|
-
|
|
18
|
-
SkyAppLinkExternalDirective
|
|
19
|
-
],
|
|
20
|
-
exports: [
|
|
21
|
-
SkyAppLinkDirective,
|
|
22
|
-
SkyAppLinkExternalDirective
|
|
23
|
-
]
|
|
14
|
+
declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
15
|
+
exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
24
16
|
}]
|
|
25
17
|
}] });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGluay5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9yb3V0ZXIvc3JjL21vZHVsZXMvbGluay9saW5rLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRXpDLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXZELE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLDJCQUEyQixDQUFDOztBQU14RSwwQkFBMEI7QUFDMUIsTUFBTSxPQUFPLGdCQUFnQjs7OEdBQWhCLGdCQUFnQjsrR0FBaEIsZ0JBQWdCLGlCQUpaLG1CQUFtQixFQUFFLDJCQUEyQixhQUNyRCxtQkFBbUIsRUFBRSwyQkFBMkI7K0dBRy9DLGdCQUFnQjs0RkFBaEIsZ0JBQWdCO2tCQUw1QixRQUFRO21CQUFDO29CQUNSLFlBQVksRUFBRSxDQUFDLG1CQUFtQixFQUFFLDJCQUEyQixDQUFDO29CQUNoRSxPQUFPLEVBQUUsQ0FBQyxtQkFBbUIsRUFBRSwyQkFBMkIsQ0FBQztpQkFDNUQiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBTa3lBcHBMaW5rRGlyZWN0aXZlIH0gZnJvbSAnLi9saW5rLmRpcmVjdGl2ZSc7XG5cbmltcG9ydCB7IFNreUFwcExpbmtFeHRlcm5hbERpcmVjdGl2ZSB9IGZyb20gJy4vbGluay1leHRlcm5hbC5kaXJlY3RpdmUnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtTa3lBcHBMaW5rRGlyZWN0aXZlLCBTa3lBcHBMaW5rRXh0ZXJuYWxEaXJlY3RpdmVdLFxuICBleHBvcnRzOiBbU2t5QXBwTGlua0RpcmVjdGl2ZSwgU2t5QXBwTGlua0V4dGVybmFsRGlyZWN0aXZlXSxcbn0pXG4vKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuZXhwb3J0IGNsYXNzIFNreUFwcExpbmtNb2R1bGUge31cbiJdfQ==
|
package/fesm2015/skyux-router.js
CHANGED
|
@@ -23,18 +23,18 @@ class SkyAppLinkDirective extends RouterLinkWithHref {
|
|
|
23
23
|
super.ngOnChanges(changes);
|
|
24
24
|
}
|
|
25
25
|
mergeQueryParams(queryParams) {
|
|
26
|
-
const skyuxParams =
|
|
26
|
+
const skyuxParams = this.skyAppConfig
|
|
27
27
|
? this.skyAppConfig.runtime.params.getAll(true)
|
|
28
28
|
: this.paramsProvider.params.getAll(true);
|
|
29
29
|
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
SkyAppLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
33
|
-
SkyAppLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
32
|
+
SkyAppLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", 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.13", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkDirective, decorators: [{
|
|
35
35
|
type: Directive,
|
|
36
36
|
args: [{
|
|
37
|
-
selector: '[skyAppLink]'
|
|
37
|
+
selector: '[skyAppLink]',
|
|
38
38
|
}]
|
|
39
39
|
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.LocationStrategy }, { type: i4.SkyAppConfig, decorators: [{
|
|
40
40
|
type: Optional
|
|
@@ -44,15 +44,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
44
44
|
type: Input
|
|
45
45
|
}] } });
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use `skyHref` directive instead.
|
|
49
|
+
*/
|
|
47
50
|
class SkyAppLinkExternalDirective extends RouterLinkWithHref {
|
|
48
51
|
constructor(router, route, platformLocation, window, skyAppConfig, paramsProvider, hostConfig) {
|
|
49
|
-
super(router, route, new PathLocationStrategy(platformLocation,
|
|
50
|
-
? hostConfig.host.url
|
|
51
|
-
: skyAppConfig.skyux.host.url));
|
|
52
|
+
super(router, route, new PathLocationStrategy(platformLocation, hostConfig ? hostConfig.host.url : skyAppConfig.skyux.host.url));
|
|
52
53
|
this.window = window;
|
|
53
54
|
this.skyAppConfig = skyAppConfig;
|
|
54
55
|
this.paramsProvider = paramsProvider;
|
|
55
|
-
if (this.window.nativeWindow.window.name &&
|
|
56
|
+
if (this.window.nativeWindow.window.name &&
|
|
57
|
+
this.window.nativeWindow.window.name !== '') {
|
|
56
58
|
this.target = this.window.nativeWindow.window.name;
|
|
57
59
|
}
|
|
58
60
|
else {
|
|
@@ -68,18 +70,18 @@ class SkyAppLinkExternalDirective extends RouterLinkWithHref {
|
|
|
68
70
|
super.ngOnChanges(changes);
|
|
69
71
|
}
|
|
70
72
|
mergeQueryParams(queryParams) {
|
|
71
|
-
const skyuxParams =
|
|
73
|
+
const skyuxParams = this.skyAppConfig
|
|
72
74
|
? this.skyAppConfig.runtime.params.getAll()
|
|
73
75
|
: this.paramsProvider.params.getAll();
|
|
74
76
|
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
|
-
SkyAppLinkExternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
78
|
-
SkyAppLinkExternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
79
|
+
SkyAppLinkExternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkExternalDirective, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.PlatformLocation }, { token: i3.SkyAppWindowRef }, { token: i4.SkyAppConfig, optional: true }, { token: i4.SkyAppRuntimeConfigParamsProvider, optional: true }, { token: i4.SkyAppConfigHost, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
80
|
+
SkyAppLinkExternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: SkyAppLinkExternalDirective, selector: "[skyAppLinkExternal]", inputs: { skyAppLinkExternal: "skyAppLinkExternal" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkExternalDirective, decorators: [{
|
|
80
82
|
type: Directive,
|
|
81
83
|
args: [{
|
|
82
|
-
selector: '[skyAppLinkExternal]'
|
|
84
|
+
selector: '[skyAppLinkExternal]',
|
|
83
85
|
}]
|
|
84
86
|
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.PlatformLocation }, { type: i3.SkyAppWindowRef }, { type: i4.SkyAppConfig, decorators: [{
|
|
85
87
|
type: Optional
|
|
@@ -94,22 +96,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
94
96
|
/* istanbul ignore next */
|
|
95
97
|
class SkyAppLinkModule {
|
|
96
98
|
}
|
|
97
|
-
SkyAppLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
98
|
-
SkyAppLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
SkyAppLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: SkyAppLinkModule });
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: SkyAppLinkModule, decorators: [{
|
|
99
|
+
SkyAppLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
100
|
+
SkyAppLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective], exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective] });
|
|
101
|
+
SkyAppLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppLinkModule, decorators: [{
|
|
103
103
|
type: NgModule,
|
|
104
104
|
args: [{
|
|
105
|
-
declarations: [
|
|
106
|
-
|
|
107
|
-
SkyAppLinkExternalDirective
|
|
108
|
-
],
|
|
109
|
-
exports: [
|
|
110
|
-
SkyAppLinkDirective,
|
|
111
|
-
SkyAppLinkExternalDirective
|
|
112
|
-
]
|
|
105
|
+
declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
106
|
+
exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
113
107
|
}]
|
|
114
108
|
}] });
|
|
115
109
|
|
|
@@ -120,13 +114,13 @@ class SkyHrefResolverService {
|
|
|
120
114
|
resolveHref(args) {
|
|
121
115
|
return Promise.resolve({
|
|
122
116
|
url: args.url,
|
|
123
|
-
userHasAccess: true
|
|
117
|
+
userHasAccess: true,
|
|
124
118
|
});
|
|
125
119
|
}
|
|
126
120
|
}
|
|
127
|
-
SkyHrefResolverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
128
|
-
SkyHrefResolverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
121
|
+
SkyHrefResolverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
122
|
+
SkyHrefResolverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefResolverService });
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefResolverService, decorators: [{
|
|
130
124
|
type: Injectable
|
|
131
125
|
}] });
|
|
132
126
|
|
|
@@ -142,8 +136,19 @@ class SkyHrefDirective {
|
|
|
142
136
|
this._skyHref = '';
|
|
143
137
|
this._skyHrefElse = 'hide';
|
|
144
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Provide a link as a string or as an array of strings to be joined by a slash to form a complete
|
|
141
|
+
* URL.
|
|
142
|
+
*
|
|
143
|
+
* @param skyHref
|
|
144
|
+
*/
|
|
145
145
|
set skyHref(skyHref) {
|
|
146
|
-
|
|
146
|
+
if (typeof skyHref === 'string') {
|
|
147
|
+
this._skyHref = skyHref;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this._skyHref = skyHref.join('/');
|
|
151
|
+
}
|
|
147
152
|
this.checkRouteAccess();
|
|
148
153
|
}
|
|
149
154
|
set skyHrefElse(value) {
|
|
@@ -187,15 +192,13 @@ class SkyHrefDirective {
|
|
|
187
192
|
checkRouteAccess() {
|
|
188
193
|
this._route = {
|
|
189
194
|
url: this._skyHref,
|
|
190
|
-
userHasAccess: false
|
|
195
|
+
userHasAccess: false,
|
|
191
196
|
};
|
|
192
197
|
/* istanbul ignore else */
|
|
193
198
|
if (this.hrefResolver && this._skyHref) {
|
|
194
199
|
this.applyChanges(this.getChanges());
|
|
195
200
|
try {
|
|
196
|
-
this.hrefResolver
|
|
197
|
-
.resolveHref({ url: this._skyHref })
|
|
198
|
-
.then((route) => {
|
|
201
|
+
this.hrefResolver.resolveHref({ url: this._skyHref }).then((route) => {
|
|
199
202
|
this._route = Object.assign({}, route);
|
|
200
203
|
this.applyChanges(this.getChanges());
|
|
201
204
|
});
|
|
@@ -215,7 +218,7 @@ class SkyHrefDirective {
|
|
|
215
218
|
if (!this._route || !this._route.userHasAccess) {
|
|
216
219
|
return {
|
|
217
220
|
href: '',
|
|
218
|
-
hidden: this._skyHrefElse === 'hide'
|
|
221
|
+
hidden: this._skyHrefElse === 'hide',
|
|
219
222
|
};
|
|
220
223
|
}
|
|
221
224
|
else {
|
|
@@ -228,14 +231,17 @@ class SkyHrefDirective {
|
|
|
228
231
|
});
|
|
229
232
|
}
|
|
230
233
|
const queryParamsMerged = new HttpParams({
|
|
231
|
-
fromObject: Object.assign({}, this.getSkyuxParams(), queryParams)
|
|
234
|
+
fromObject: Object.assign({}, this.getSkyuxParams(), queryParams),
|
|
232
235
|
});
|
|
233
|
-
this._href =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
this._href =
|
|
237
|
+
baseUrl +
|
|
238
|
+
(queryParamsMerged.keys().length > 0
|
|
239
|
+
? '?' + queryParamsMerged.toString()
|
|
240
|
+
: '') +
|
|
241
|
+
(fragment ? `#${fragment}` : '');
|
|
236
242
|
return {
|
|
237
243
|
href: this._href,
|
|
238
|
-
hidden: false
|
|
244
|
+
hidden: false,
|
|
239
245
|
};
|
|
240
246
|
}
|
|
241
247
|
}
|
|
@@ -249,7 +255,9 @@ class SkyHrefDirective {
|
|
|
249
255
|
getUrlTree() {
|
|
250
256
|
var _a, _b, _c, _d, _e;
|
|
251
257
|
const href = this._href.toLowerCase();
|
|
252
|
-
if (!href ||
|
|
258
|
+
if (!href ||
|
|
259
|
+
!((_b = (_a = this.skyAppConfig) === null || _a === void 0 ? void 0 : _a.skyux.host) === null || _b === void 0 ? void 0 : _b.url) ||
|
|
260
|
+
!((_e = (_d = (_c = this.skyAppConfig) === null || _c === void 0 ? void 0 : _c.runtime) === null || _d === void 0 ? void 0 : _d.app) === null || _e === void 0 ? void 0 : _e.base)) {
|
|
253
261
|
return false;
|
|
254
262
|
}
|
|
255
263
|
const baseUrl = (this.skyAppConfig.skyux.host.url +
|
|
@@ -265,12 +273,12 @@ class SkyHrefDirective {
|
|
|
265
273
|
return false;
|
|
266
274
|
}
|
|
267
275
|
}
|
|
268
|
-
SkyHrefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
269
|
-
SkyHrefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.
|
|
270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
276
|
+
SkyHrefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefDirective, deps: [{ token: i1.Router }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i4.SkyAppConfig, optional: true }, { token: i4.SkyAppRuntimeConfigParamsProvider, optional: true }, { token: SkyHrefResolverService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
277
|
+
SkyHrefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: SkyHrefDirective, selector: "[skyHref]", inputs: { skyHref: "skyHref", skyHrefElse: "skyHrefElse" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" } }, ngImport: i0 });
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefDirective, decorators: [{
|
|
271
279
|
type: Directive,
|
|
272
280
|
args: [{
|
|
273
|
-
selector: '[skyHref]'
|
|
281
|
+
selector: '[skyHref]',
|
|
274
282
|
}]
|
|
275
283
|
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i4.SkyAppConfig, decorators: [{
|
|
276
284
|
type: Optional
|
|
@@ -284,21 +292,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
284
292
|
type: Input
|
|
285
293
|
}], onClick: [{
|
|
286
294
|
type: HostListener,
|
|
287
|
-
args: ['click',
|
|
288
|
-
|
|
295
|
+
args: ['click', [
|
|
296
|
+
'$event.button',
|
|
297
|
+
'$event.ctrlKey',
|
|
298
|
+
'$event.shiftKey',
|
|
299
|
+
'$event.altKey',
|
|
300
|
+
'$event.metaKey',
|
|
301
|
+
]]
|
|
289
302
|
}] } });
|
|
290
303
|
|
|
291
304
|
class SkyHrefModule {
|
|
292
305
|
}
|
|
293
|
-
SkyHrefModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
294
|
-
SkyHrefModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
295
|
-
SkyHrefModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
306
|
+
SkyHrefModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
307
|
+
SkyHrefModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefModule, declarations: [SkyHrefDirective], imports: [CommonModule], exports: [SkyHrefDirective] });
|
|
308
|
+
SkyHrefModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefModule, imports: [[CommonModule]] });
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyHrefModule, decorators: [{
|
|
297
310
|
type: NgModule,
|
|
298
311
|
args: [{
|
|
299
312
|
declarations: [SkyHrefDirective],
|
|
300
313
|
exports: [SkyHrefDirective],
|
|
301
|
-
imports: [CommonModule]
|
|
314
|
+
imports: [CommonModule],
|
|
302
315
|
}]
|
|
303
316
|
}] });
|
|
304
317
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-router.js","sources":["../../../projects/router/src/modules/link/link.directive.ts","../../../projects/router/src/modules/link/link-external.directive.ts","../../../projects/router/src/modules/link/link.module.ts","../../../projects/router/src/modules/href/href-resolver.service.ts","../../../projects/router/src/modules/href/href.directive.ts","../../../projects/router/src/modules/href/href.module.ts","../../../projects/router/src/skyux-router.ts"],"sourcesContent":["import {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n LocationStrategy\n} from '@angular/common';\n\nimport {\n ActivatedRoute,\n Router,\n RouterLinkWithHref\n} from '@angular/router';\n\nimport {\n SkyAppConfig,\n SkyAppRuntimeConfigParamsProvider\n} from '@skyux/config';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLink]'\n})\nexport class SkyAppLinkDirective extends RouterLinkWithHref 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(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(\n {},\n this.queryParams,\n queryParams,\n skyuxParams\n );\n }\n\n}\n","import {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n PathLocationStrategy,\n PlatformLocation\n} from '@angular/common';\n\nimport {\n ActivatedRoute,\n Router,\n RouterLinkWithHref\n} from '@angular/router';\n\nimport {\n SkyAppConfig,\n SkyAppConfigHost,\n SkyAppRuntimeConfigParamsProvider\n} from '@skyux/config';\n\nimport {\n SkyAppWindowRef\n} from '@skyux/core';\n\nimport { SkyAppLinkQueryParams } from './link-query-params';\n\n@Directive({\n selector: '[skyAppLinkExternal]'\n})\nexport class SkyAppLinkExternalDirective extends RouterLinkWithHref 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)\n ? hostConfig.host.url\n : skyAppConfig.skyux.host.url\n )\n );\n\n if (this.window.nativeWindow.window.name && this.window.nativeWindow.window.name !== '') {\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(queryParams: SkyAppLinkQueryParams): SkyAppLinkQueryParams {\n const skyuxParams = (this.skyAppConfig)\n ? this.skyAppConfig.runtime.params.getAll()\n : this.paramsProvider.params.getAll();\n\n return Object.assign(\n {},\n this.queryParams,\n queryParams,\n skyuxParams\n );\n }\n}\n","import {\n NgModule\n} from '@angular/core';\n\nimport {\n SkyAppLinkDirective\n} from './link.directive';\n\nimport {\n SkyAppLinkExternalDirective\n} from './link-external.directive';\n\n@NgModule({\n declarations: [\n SkyAppLinkDirective,\n SkyAppLinkExternalDirective\n ],\n exports: [\n SkyAppLinkDirective,\n SkyAppLinkExternalDirective\n ]\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 @Input()\n public set skyHref(skyHref: string) {\n this._skyHref = skyHref;\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\n /* istanbul ignore next */\n @HostListener(\n 'click',\n ['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey'])\n public onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, 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(this.element.nativeElement, 'hidden', 'hidden');\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'hidden');\n }\n if (change.href) {\n this.renderer.setAttribute(this.element.nativeElement, 'href', change.href);\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\n .resolveHref({url: this._skyHref})\n .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(\n {},\n this.getSkyuxParams(),\n queryParams\n )\n });\n\n this._href = baseUrl +\n (queryParamsMerged.keys().length > 0 ? '?' + queryParamsMerged.toString() : '') +\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 (!href || !this.skyAppConfig?.skyux.host?.url || !this.skyAppConfig?.runtime?.app?.base) {\n return false;\n }\n\n const baseUrl = (\n this.skyAppConfig.skyux.host.url +\n this.skyAppConfig.runtime.app.base.substr(0, this.skyAppConfig.runtime.app.base.length - 1)\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 './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MA4Ba,mBAAoB,SAAQ,kBAAkB;IAOzD,YACE,MAAc,EACd,KAA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AgB;2GAGf,aAAa,YAFf,CAAC,YAAY,CAAC;2FAEZ,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":["../../../projects/router/src/modules/link/link.directive.ts","../../../projects/router/src/modules/link/link-external.directive.ts","../../../projects/router/src/modules/link/link.module.ts","../../../projects/router/src/modules/href/href-resolver.service.ts","../../../projects/router/src/modules/href/href.directive.ts","../../../projects/router/src/modules/href/href.module.ts","../../../projects/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 './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAmBa,mBACX,SAAQ,kBAAkB;IAQ1B,YACE,MAAc,EACd,KAAqB,EACrB,gBAAkC,EACd,YAA2B,EAC3B,cAAkD;QA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;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;;;;;;"}
|
|
@@ -10,7 +10,13 @@ export declare class SkyHrefDirective {
|
|
|
10
10
|
private skyAppConfig?;
|
|
11
11
|
private paramsProvider?;
|
|
12
12
|
private hrefResolver?;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Provide a link as a string or as an array of strings to be joined by a slash to form a complete
|
|
15
|
+
* URL.
|
|
16
|
+
*
|
|
17
|
+
* @param skyHref
|
|
18
|
+
*/
|
|
19
|
+
set skyHref(skyHref: string | string[]);
|
|
14
20
|
set skyHrefElse(value: 'hide' | 'unlink');
|
|
15
21
|
private _route;
|
|
16
22
|
private _href;
|
|
@@ -4,6 +4,9 @@ import { ActivatedRoute, Router, RouterLinkWithHref } from '@angular/router';
|
|
|
4
4
|
import { SkyAppConfig, SkyAppConfigHost, SkyAppRuntimeConfigParamsProvider } from '@skyux/config';
|
|
5
5
|
import { SkyAppWindowRef } from '@skyux/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `skyHref` directive instead.
|
|
9
|
+
*/
|
|
7
10
|
export declare class SkyAppLinkExternalDirective extends RouterLinkWithHref implements OnChanges {
|
|
8
11
|
private window;
|
|
9
12
|
private skyAppConfig?;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/router",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^12.2.
|
|
6
|
-
"@angular/core": "^12.2.
|
|
7
|
-
"@angular/router": "^12.2.
|
|
8
|
-
"@skyux/config": "^5.0.
|
|
9
|
-
"@skyux/core": "^5.
|
|
5
|
+
"@angular/common": "^12.2.13",
|
|
6
|
+
"@angular/core": "^12.2.13",
|
|
7
|
+
"@angular/router": "^12.2.13",
|
|
8
|
+
"@skyux/config": "^5.0.1",
|
|
9
|
+
"@skyux/core": "^5.1.1"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"tslib": "^2.3.
|
|
12
|
+
"tslib": "^2.3.1"
|
|
13
13
|
},
|
|
14
14
|
"main": "bundles/skyux-router.umd.js",
|
|
15
15
|
"module": "fesm2015/skyux-router.js",
|