@skyux/router 8.7.0 → 9.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/modules/href/href-resolver.service.mjs +4 -4
- package/esm2022/lib/modules/href/href.directive.mjs +206 -0
- package/{esm2020 → esm2022}/lib/modules/href/href.module.mjs +5 -5
- package/esm2022/lib/modules/link/link-external.directive.mjs +59 -0
- package/esm2022/lib/modules/link/link.directive.mjs +43 -0
- package/{esm2020 → esm2022}/lib/modules/link/link.module.mjs +5 -5
- package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed.service.mjs +4 -4
- package/esm2022/testing/href/href-harness.mjs +40 -0
- package/{esm2020 → esm2022}/testing/href/href-resolver-mock.service.mjs +4 -4
- package/esm2022/testing/href/href-testing.module.mjs +51 -0
- package/{fesm2020 → fesm2022}/skyux-router-testing.mjs +18 -18
- package/{fesm2020 → fesm2022}/skyux-router-testing.mjs.map +1 -1
- package/fesm2022/skyux-router.mjs +360 -0
- package/{fesm2020 → fesm2022}/skyux-router.mjs.map +1 -1
- package/lib/modules/href/href.directive.d.ts +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 +14 -22
- package/esm2020/lib/modules/href/href.directive.mjs +0 -201
- package/esm2020/lib/modules/link/link-external.directive.mjs +0 -62
- package/esm2020/lib/modules/link/link.directive.mjs +0 -46
- package/esm2020/testing/href/href-harness.mjs +0 -40
- package/esm2020/testing/href/href-testing.module.mjs +0 -51
- package/fesm2015/skyux-router-testing.mjs +0 -130
- package/fesm2015/skyux-router-testing.mjs.map +0 -1
- package/fesm2015/skyux-router.mjs +0 -372
- package/fesm2015/skyux-router.mjs.map +0 -1
- package/fesm2020/skyux-router.mjs +0 -359
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/href/href-resolver.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/href/types/href-change.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/href/types/href-resolver.args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/href/types/href.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/link/link-query-params.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-link-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-link-result.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-link.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-route-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-get-links-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-link-list.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-link.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-router.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/href/href-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/skyux-router-testing.mjs +0 -0
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Optional, Input, NgModule, Injectable, EventEmitter, Output, HostListener } from '@angular/core';
|
|
3
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
4
|
-
import * as i2 from '@angular/common';
|
|
5
|
-
import { PathLocationStrategy, CommonModule } from '@angular/common';
|
|
6
|
-
import * as i1 from '@angular/router';
|
|
7
|
-
import { RouterLink } from '@angular/router';
|
|
8
|
-
import * as i3 from '@skyux/core';
|
|
9
|
-
import * as i4 from '@skyux/config';
|
|
10
|
-
|
|
11
|
-
var _SkyAppLinkExternalDirective_instances, _SkyAppLinkExternalDirective_window, _SkyAppLinkExternalDirective_skyAppConfig, _SkyAppLinkExternalDirective_paramsProvider, _SkyAppLinkExternalDirective_mergeQueryParams;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use `skyHref` directive instead.
|
|
14
|
-
*/
|
|
15
|
-
class SkyAppLinkExternalDirective extends RouterLink {
|
|
16
|
-
set skyAppLinkExternal(commands) {
|
|
17
|
-
this.routerLink = commands;
|
|
18
|
-
}
|
|
19
|
-
constructor(router, route, renderer, elementRef, platformLocation, window, skyAppConfig, paramsProvider, hostConfig) {
|
|
20
|
-
super(router, route, undefined, renderer, elementRef, new PathLocationStrategy(platformLocation, hostConfig ? hostConfig.host.url : skyAppConfig?.skyux.host?.url));
|
|
21
|
-
_SkyAppLinkExternalDirective_instances.add(this);
|
|
22
|
-
_SkyAppLinkExternalDirective_window.set(this, void 0);
|
|
23
|
-
_SkyAppLinkExternalDirective_skyAppConfig.set(this, void 0);
|
|
24
|
-
_SkyAppLinkExternalDirective_paramsProvider.set(this, void 0);
|
|
25
|
-
__classPrivateFieldSet(this, _SkyAppLinkExternalDirective_window, window, "f");
|
|
26
|
-
__classPrivateFieldSet(this, _SkyAppLinkExternalDirective_skyAppConfig, skyAppConfig, "f");
|
|
27
|
-
__classPrivateFieldSet(this, _SkyAppLinkExternalDirective_paramsProvider, paramsProvider, "f");
|
|
28
|
-
if (__classPrivateFieldGet(this, _SkyAppLinkExternalDirective_window, "f").nativeWindow.window.name &&
|
|
29
|
-
__classPrivateFieldGet(this, _SkyAppLinkExternalDirective_window, "f").nativeWindow.window.name !== '') {
|
|
30
|
-
this.target = __classPrivateFieldGet(this, _SkyAppLinkExternalDirective_window, "f").nativeWindow.window.name;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.target = '_top';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
ngOnChanges(changes) {
|
|
37
|
-
this.queryParams = __classPrivateFieldGet(this, _SkyAppLinkExternalDirective_instances, "m", _SkyAppLinkExternalDirective_mergeQueryParams).call(this, changes['queryParams']?.currentValue);
|
|
38
|
-
super.ngOnChanges(changes);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
_SkyAppLinkExternalDirective_window = new WeakMap(), _SkyAppLinkExternalDirective_skyAppConfig = new WeakMap(), _SkyAppLinkExternalDirective_paramsProvider = new WeakMap(), _SkyAppLinkExternalDirective_instances = new WeakSet(), _SkyAppLinkExternalDirective_mergeQueryParams = function _SkyAppLinkExternalDirective_mergeQueryParams(queryParams) {
|
|
42
|
-
const skyuxParams = __classPrivateFieldGet(this, _SkyAppLinkExternalDirective_skyAppConfig, "f")
|
|
43
|
-
? __classPrivateFieldGet(this, _SkyAppLinkExternalDirective_skyAppConfig, "f").runtime.params.getAll()
|
|
44
|
-
: __classPrivateFieldGet(this, _SkyAppLinkExternalDirective_paramsProvider, "f")?.params.getAll();
|
|
45
|
-
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
46
|
-
};
|
|
47
|
-
SkyAppLinkExternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkExternalDirective, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { 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 });
|
|
48
|
-
SkyAppLinkExternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SkyAppLinkExternalDirective, selector: "[skyAppLinkExternal]", inputs: { skyAppLinkExternal: "skyAppLinkExternal" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkExternalDirective, decorators: [{
|
|
50
|
-
type: Directive,
|
|
51
|
-
args: [{
|
|
52
|
-
selector: '[skyAppLinkExternal]',
|
|
53
|
-
}]
|
|
54
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.PlatformLocation }, { type: i3.SkyAppWindowRef }, { type: i4.SkyAppConfig, decorators: [{
|
|
55
|
-
type: Optional
|
|
56
|
-
}] }, { type: i4.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
57
|
-
type: Optional
|
|
58
|
-
}] }, { type: i4.SkyAppConfigHost, decorators: [{
|
|
59
|
-
type: Optional
|
|
60
|
-
}] }]; }, propDecorators: { skyAppLinkExternal: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}] } });
|
|
63
|
-
|
|
64
|
-
var _SkyAppLinkDirective_instances, _SkyAppLinkDirective_skyAppConfig, _SkyAppLinkDirective_paramsProvider, _SkyAppLinkDirective_mergeQueryParams;
|
|
65
|
-
class SkyAppLinkDirective extends RouterLink {
|
|
66
|
-
set skyAppLink(commands) {
|
|
67
|
-
this.routerLink = commands;
|
|
68
|
-
}
|
|
69
|
-
constructor(router, route, locationStrategy, renderer, elementRef, skyAppConfig, paramsProvider) {
|
|
70
|
-
super(router, route, undefined, renderer, elementRef, locationStrategy);
|
|
71
|
-
_SkyAppLinkDirective_instances.add(this);
|
|
72
|
-
_SkyAppLinkDirective_skyAppConfig.set(this, void 0);
|
|
73
|
-
_SkyAppLinkDirective_paramsProvider.set(this, void 0);
|
|
74
|
-
__classPrivateFieldSet(this, _SkyAppLinkDirective_skyAppConfig, skyAppConfig, "f");
|
|
75
|
-
__classPrivateFieldSet(this, _SkyAppLinkDirective_paramsProvider, paramsProvider, "f");
|
|
76
|
-
}
|
|
77
|
-
ngOnChanges(changes) {
|
|
78
|
-
this.queryParams = __classPrivateFieldGet(this, _SkyAppLinkDirective_instances, "m", _SkyAppLinkDirective_mergeQueryParams).call(this, changes['queryParams']?.currentValue);
|
|
79
|
-
super.ngOnChanges(changes);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
_SkyAppLinkDirective_skyAppConfig = new WeakMap(), _SkyAppLinkDirective_paramsProvider = new WeakMap(), _SkyAppLinkDirective_instances = new WeakSet(), _SkyAppLinkDirective_mergeQueryParams = function _SkyAppLinkDirective_mergeQueryParams(queryParams) {
|
|
83
|
-
const skyuxParams = __classPrivateFieldGet(this, _SkyAppLinkDirective_skyAppConfig, "f")
|
|
84
|
-
? __classPrivateFieldGet(this, _SkyAppLinkDirective_skyAppConfig, "f").runtime.params.getAll(true)
|
|
85
|
-
: __classPrivateFieldGet(this, _SkyAppLinkDirective_paramsProvider, "f")?.params.getAll(true);
|
|
86
|
-
return Object.assign({}, this.queryParams, queryParams, skyuxParams);
|
|
87
|
-
};
|
|
88
|
-
SkyAppLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkDirective, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.LocationStrategy }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i4.SkyAppConfig, optional: true }, { token: i4.SkyAppRuntimeConfigParamsProvider, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
89
|
-
SkyAppLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SkyAppLinkDirective, selector: "[skyAppLink]", inputs: { skyAppLink: "skyAppLink" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkDirective, decorators: [{
|
|
91
|
-
type: Directive,
|
|
92
|
-
args: [{
|
|
93
|
-
selector: '[skyAppLink]',
|
|
94
|
-
}]
|
|
95
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.LocationStrategy }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i4.SkyAppConfig, decorators: [{
|
|
96
|
-
type: Optional
|
|
97
|
-
}] }, { type: i4.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
98
|
-
type: Optional
|
|
99
|
-
}] }]; }, propDecorators: { skyAppLink: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}] } });
|
|
102
|
-
|
|
103
|
-
/* istanbul ignore next */
|
|
104
|
-
class SkyAppLinkModule {
|
|
105
|
-
}
|
|
106
|
-
SkyAppLinkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
107
|
-
SkyAppLinkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkModule, declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective], exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective] });
|
|
108
|
-
SkyAppLinkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkModule });
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyAppLinkModule, decorators: [{
|
|
110
|
-
type: NgModule,
|
|
111
|
-
args: [{
|
|
112
|
-
declarations: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
113
|
-
exports: [SkyAppLinkDirective, SkyAppLinkExternalDirective],
|
|
114
|
-
}]
|
|
115
|
-
}] });
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Return the link as-is.
|
|
119
|
-
*/
|
|
120
|
-
class SkyHrefResolverService {
|
|
121
|
-
resolveHref(args) {
|
|
122
|
-
return Promise.resolve({
|
|
123
|
-
url: args.url,
|
|
124
|
-
userHasAccess: true,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
SkyHrefResolverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
129
|
-
SkyHrefResolverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefResolverService });
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefResolverService, decorators: [{
|
|
131
|
-
type: Injectable
|
|
132
|
-
}] });
|
|
133
|
-
|
|
134
|
-
var _SkyHrefDirective_instances, _SkyHrefDirective_route, _SkyHrefDirective_href, _SkyHrefDirective__skyHref, _SkyHrefDirective__skyHrefElse, _SkyHrefDirective_router, _SkyHrefDirective_renderer, _SkyHrefDirective_element, _SkyHrefDirective_skyAppConfig, _SkyHrefDirective_paramsProvider, _SkyHrefDirective_hrefResolver, _SkyHrefDirective_applicationRef, _SkyHrefDirective_changeDetectorRef, _SkyHrefDirective_applyChanges, _SkyHrefDirective_checkRouteAccess, _SkyHrefDirective_getChanges, _SkyHrefDirective_getUrlTree;
|
|
135
|
-
class SkyHrefDirective {
|
|
136
|
-
/**
|
|
137
|
-
* Provide a link as a string or as an array of strings to be joined by a slash to form a complete
|
|
138
|
-
* URL.
|
|
139
|
-
*
|
|
140
|
-
* @param skyHref
|
|
141
|
-
*/
|
|
142
|
-
set skyHref(skyHref) {
|
|
143
|
-
if (typeof skyHref === 'string') {
|
|
144
|
-
__classPrivateFieldSet(this, _SkyHrefDirective__skyHref, skyHref, "f");
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
__classPrivateFieldSet(this, _SkyHrefDirective__skyHref, skyHref ? skyHref.join('/') : '', "f");
|
|
148
|
-
}
|
|
149
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_checkRouteAccess).call(this);
|
|
150
|
-
}
|
|
151
|
-
get skyHref() {
|
|
152
|
-
return __classPrivateFieldGet(this, _SkyHrefDirective__skyHref, "f");
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Set the behavior for when the link is not available to either hide the link or display unlinked text.
|
|
156
|
-
*
|
|
157
|
-
* @param value
|
|
158
|
-
*/
|
|
159
|
-
set skyHrefElse(value) {
|
|
160
|
-
__classPrivateFieldSet(this, _SkyHrefDirective__skyHrefElse, value, "f");
|
|
161
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_applyChanges).call(this, __classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_getChanges).call(this));
|
|
162
|
-
}
|
|
163
|
-
get skyHrefElse() {
|
|
164
|
-
return __classPrivateFieldGet(this, _SkyHrefDirective__skyHrefElse, "f");
|
|
165
|
-
}
|
|
166
|
-
constructor(router, renderer, element, skyAppConfig, paramsProvider, hrefResolver, applicationRef, changeDetectorRef) {
|
|
167
|
-
_SkyHrefDirective_instances.add(this);
|
|
168
|
-
/**
|
|
169
|
-
* Emits whether the link is available (true) or not (false).
|
|
170
|
-
*/
|
|
171
|
-
this.skyHrefChange = new EventEmitter();
|
|
172
|
-
_SkyHrefDirective_route.set(this, false);
|
|
173
|
-
_SkyHrefDirective_href.set(this, '');
|
|
174
|
-
_SkyHrefDirective__skyHref.set(this, '');
|
|
175
|
-
_SkyHrefDirective__skyHrefElse.set(this, 'hide');
|
|
176
|
-
_SkyHrefDirective_router.set(this, void 0);
|
|
177
|
-
_SkyHrefDirective_renderer.set(this, void 0);
|
|
178
|
-
_SkyHrefDirective_element.set(this, void 0);
|
|
179
|
-
_SkyHrefDirective_skyAppConfig.set(this, void 0);
|
|
180
|
-
_SkyHrefDirective_paramsProvider.set(this, void 0);
|
|
181
|
-
_SkyHrefDirective_hrefResolver.set(this, void 0);
|
|
182
|
-
_SkyHrefDirective_applicationRef.set(this, void 0);
|
|
183
|
-
_SkyHrefDirective_changeDetectorRef.set(this, void 0);
|
|
184
|
-
/* istanbul ignore next */
|
|
185
|
-
_SkyHrefDirective_getUrlTree.set(this, () => {
|
|
186
|
-
const href = __classPrivateFieldGet(this, _SkyHrefDirective_href, "f").toLowerCase();
|
|
187
|
-
if (!href ||
|
|
188
|
-
!__classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f")?.skyux.host?.url ||
|
|
189
|
-
!__classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f")?.runtime?.app?.base) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
const baseUrl = (__classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f").skyux.host.url +
|
|
193
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f").runtime.app.base.substr(0, __classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f").runtime.app.base.length - 1)).toLowerCase();
|
|
194
|
-
if (href === baseUrl ||
|
|
195
|
-
// Make sure the base URL is not simply a partial match of the base URL plus additional
|
|
196
|
-
// characters after the base URL that are not "terminating" characters
|
|
197
|
-
href.indexOf(baseUrl + '/') === 0 ||
|
|
198
|
-
href.indexOf(baseUrl + '?') === 0) {
|
|
199
|
-
const routePath = __classPrivateFieldGet(this, _SkyHrefDirective_href, "f").substring(baseUrl.length);
|
|
200
|
-
return __classPrivateFieldGet(this, _SkyHrefDirective_router, "f").parseUrl(routePath);
|
|
201
|
-
}
|
|
202
|
-
return false;
|
|
203
|
-
});
|
|
204
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_router, router, "f");
|
|
205
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_renderer, renderer, "f");
|
|
206
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_element, element, "f");
|
|
207
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_skyAppConfig, skyAppConfig, "f");
|
|
208
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_paramsProvider, paramsProvider, "f");
|
|
209
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_hrefResolver, hrefResolver, "f");
|
|
210
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_applicationRef, applicationRef, "f");
|
|
211
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_changeDetectorRef, changeDetectorRef, "f");
|
|
212
|
-
}
|
|
213
|
-
onClick(button, ctrlKey, shiftKey, altKey, metaKey) {
|
|
214
|
-
if (!__classPrivateFieldGet(this, _SkyHrefDirective_route, "f") || !__classPrivateFieldGet(this, _SkyHrefDirective_route, "f").userHasAccess) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {
|
|
218
|
-
return true;
|
|
219
|
-
}
|
|
220
|
-
const target = __classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement.getAttribute('target');
|
|
221
|
-
if (typeof target === 'string' && target !== '_self') {
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
const urlTree = __classPrivateFieldGet(this, _SkyHrefDirective_getUrlTree, "f").call(this);
|
|
225
|
-
if (urlTree) {
|
|
226
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_router, "f").navigateByUrl(urlTree);
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
_SkyHrefDirective_route = new WeakMap(), _SkyHrefDirective_href = new WeakMap(), _SkyHrefDirective__skyHref = new WeakMap(), _SkyHrefDirective__skyHrefElse = new WeakMap(), _SkyHrefDirective_router = new WeakMap(), _SkyHrefDirective_renderer = new WeakMap(), _SkyHrefDirective_element = new WeakMap(), _SkyHrefDirective_skyAppConfig = new WeakMap(), _SkyHrefDirective_paramsProvider = new WeakMap(), _SkyHrefDirective_hrefResolver = new WeakMap(), _SkyHrefDirective_applicationRef = new WeakMap(), _SkyHrefDirective_changeDetectorRef = new WeakMap(), _SkyHrefDirective_getUrlTree = new WeakMap(), _SkyHrefDirective_instances = new WeakSet(), _SkyHrefDirective_applyChanges = function _SkyHrefDirective_applyChanges(change) {
|
|
233
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_renderer, "f").addClass(__classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement, 'sky-href');
|
|
234
|
-
if (change.hidden) {
|
|
235
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_renderer, "f").setAttribute(__classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement, 'hidden', 'hidden');
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_renderer, "f").removeAttribute(__classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement, 'hidden');
|
|
239
|
-
}
|
|
240
|
-
if (change.href) {
|
|
241
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_renderer, "f").setAttribute(__classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement, 'href', change.href);
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_renderer, "f").removeAttribute(__classPrivateFieldGet(this, _SkyHrefDirective_element, "f").nativeElement, 'href');
|
|
245
|
-
}
|
|
246
|
-
this.skyHrefChange.emit({ userHasAccess: !change.hidden });
|
|
247
|
-
}, _SkyHrefDirective_checkRouteAccess = function _SkyHrefDirective_checkRouteAccess() {
|
|
248
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_route, {
|
|
249
|
-
url: this.skyHref,
|
|
250
|
-
userHasAccess: false,
|
|
251
|
-
}, "f");
|
|
252
|
-
/* istanbul ignore else */
|
|
253
|
-
if (__classPrivateFieldGet(this, _SkyHrefDirective_hrefResolver, "f") && this.skyHref) {
|
|
254
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_applyChanges).call(this, __classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_getChanges).call(this));
|
|
255
|
-
try {
|
|
256
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_hrefResolver, "f").resolveHref({ url: this.skyHref }).then((route) => {
|
|
257
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_route, { ...route }, "f");
|
|
258
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_applyChanges).call(this, __classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_getChanges).call(this));
|
|
259
|
-
/* istanbul ignore else */
|
|
260
|
-
if (__classPrivateFieldGet(this, _SkyHrefDirective_changeDetectorRef, "f") && __classPrivateFieldGet(this, _SkyHrefDirective_applicationRef, "f")) {
|
|
261
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_changeDetectorRef, "f").markForCheck();
|
|
262
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_applicationRef, "f").tick();
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
catch (error) {
|
|
267
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_applyChanges).call(this, __classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_getChanges).call(this));
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
// no resolver or skyHref is falsy
|
|
272
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_route, "f").userHasAccess = !!this.skyHref;
|
|
273
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_applyChanges).call(this, __classPrivateFieldGet(this, _SkyHrefDirective_instances, "m", _SkyHrefDirective_getChanges).call(this));
|
|
274
|
-
}
|
|
275
|
-
}, _SkyHrefDirective_getChanges = function _SkyHrefDirective_getChanges() {
|
|
276
|
-
if (!__classPrivateFieldGet(this, _SkyHrefDirective_route, "f") || !__classPrivateFieldGet(this, _SkyHrefDirective_route, "f").userHasAccess) {
|
|
277
|
-
return {
|
|
278
|
-
href: '',
|
|
279
|
-
hidden: this.skyHrefElse === 'hide',
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
const params =
|
|
284
|
-
// The SkyAppRuntimeParamsProvider is provided in root, so it will never be undefined.
|
|
285
|
-
// TODO: rework the injectors so that #paramsProvider is not possibly undefined.
|
|
286
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
287
|
-
__classPrivateFieldGet(this, _SkyHrefDirective_skyAppConfig, "f")?.runtime.params ?? __classPrivateFieldGet(this, _SkyHrefDirective_paramsProvider, "f").params;
|
|
288
|
-
__classPrivateFieldSet(this, _SkyHrefDirective_href, params.getLinkUrl(__classPrivateFieldGet(this, _SkyHrefDirective_route, "f").url), "f");
|
|
289
|
-
return {
|
|
290
|
-
href: __classPrivateFieldGet(this, _SkyHrefDirective_href, "f"),
|
|
291
|
-
hidden: false,
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
SkyHrefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", 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 }, { token: i0.ApplicationRef, optional: true }, { token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
296
|
-
SkyHrefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: SkyHrefDirective, selector: "[skyHref]", inputs: { skyHref: "skyHref", skyHrefElse: "skyHrefElse" }, outputs: { skyHrefChange: "skyHrefChange" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" } }, ngImport: i0 });
|
|
297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefDirective, decorators: [{
|
|
298
|
-
type: Directive,
|
|
299
|
-
args: [{
|
|
300
|
-
selector: '[skyHref]',
|
|
301
|
-
}]
|
|
302
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i4.SkyAppConfig, decorators: [{
|
|
303
|
-
type: Optional
|
|
304
|
-
}] }, { type: i4.SkyAppRuntimeConfigParamsProvider, decorators: [{
|
|
305
|
-
type: Optional
|
|
306
|
-
}] }, { type: SkyHrefResolverService, decorators: [{
|
|
307
|
-
type: Optional
|
|
308
|
-
}] }, { type: i0.ApplicationRef, decorators: [{
|
|
309
|
-
type: Optional
|
|
310
|
-
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
311
|
-
type: Optional
|
|
312
|
-
}] }]; }, propDecorators: { skyHref: [{
|
|
313
|
-
type: Input
|
|
314
|
-
}], skyHrefElse: [{
|
|
315
|
-
type: Input
|
|
316
|
-
}], skyHrefChange: [{
|
|
317
|
-
type: Output
|
|
318
|
-
}], onClick: [{
|
|
319
|
-
type: HostListener,
|
|
320
|
-
args: ['click', [
|
|
321
|
-
'$event.button',
|
|
322
|
-
'$event.ctrlKey',
|
|
323
|
-
'$event.shiftKey',
|
|
324
|
-
'$event.altKey',
|
|
325
|
-
'$event.metaKey',
|
|
326
|
-
]]
|
|
327
|
-
}] } });
|
|
328
|
-
|
|
329
|
-
class SkyHrefModule {
|
|
330
|
-
}
|
|
331
|
-
SkyHrefModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
332
|
-
SkyHrefModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefModule, declarations: [SkyHrefDirective], imports: [CommonModule], exports: [SkyHrefDirective] });
|
|
333
|
-
SkyHrefModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefModule, imports: [CommonModule] });
|
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyHrefModule, decorators: [{
|
|
335
|
-
type: NgModule,
|
|
336
|
-
args: [{
|
|
337
|
-
declarations: [SkyHrefDirective],
|
|
338
|
-
exports: [SkyHrefDirective],
|
|
339
|
-
imports: [CommonModule],
|
|
340
|
-
}]
|
|
341
|
-
}] });
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* A service for creating and retrieving recently accessed links.
|
|
345
|
-
*/
|
|
346
|
-
class SkyRecentlyAccessedService {
|
|
347
|
-
}
|
|
348
|
-
SkyRecentlyAccessedService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyRecentlyAccessedService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
349
|
-
SkyRecentlyAccessedService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyRecentlyAccessedService });
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyRecentlyAccessedService, decorators: [{
|
|
351
|
-
type: Injectable
|
|
352
|
-
}] });
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Generated bundle index. Do not edit.
|
|
356
|
-
*/
|
|
357
|
-
|
|
358
|
-
export { SkyAppLinkModule, SkyHrefModule, SkyHrefResolverService, SkyRecentlyAccessedService, SkyHrefDirective as λ1, SkyAppLinkExternalDirective as λ2, SkyAppLinkDirective as λ3 };
|
|
359
|
-
//# sourceMappingURL=skyux-router.mjs.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-link-args.mjs
RENAMED
|
File without changes
|
/package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-link-result.mjs
RENAMED
|
File without changes
|
|
File without changes
|
/package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-add-route-args.mjs
RENAMED
|
File without changes
|
/package/{esm2020 → esm2022}/lib/modules/recently-accessed/recently-accessed-get-links-args.mjs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|