@viewfly/router 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/index.esm.js +72 -9
- package/bundles/index.js +72 -9
- package/package.json +3 -3
package/bundles/index.esm.js
CHANGED
|
@@ -37,7 +37,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
37
37
|
|
|
38
38
|
class Navigator {
|
|
39
39
|
constructor(baseUrl) {
|
|
40
|
-
this
|
|
40
|
+
Object.defineProperty(this, "baseUrl", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: baseUrl
|
|
45
|
+
});
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
function formatUrl(pathname, urlFormatParams) {
|
|
@@ -66,8 +71,24 @@ let BrowserNavigator = class BrowserNavigator extends Navigator {
|
|
|
66
71
|
}
|
|
67
72
|
constructor(baseUrl) {
|
|
68
73
|
super(baseUrl);
|
|
69
|
-
this
|
|
70
|
-
|
|
74
|
+
Object.defineProperty(this, "onUrlChanged", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: void 0
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(this, "urlChangeEvent", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
value: new Subject()
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(this, "subscription", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: new Subscription()
|
|
91
|
+
});
|
|
71
92
|
this.onUrlChanged = this.urlChangeEvent.asObservable();
|
|
72
93
|
this.subscription.add(fromEvent(window, 'popstate').subscribe(() => {
|
|
73
94
|
this.urlChangeEvent.next();
|
|
@@ -157,10 +178,36 @@ class Router {
|
|
|
157
178
|
return '';
|
|
158
179
|
}
|
|
159
180
|
constructor(navigator, parent, path) {
|
|
160
|
-
this
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
181
|
+
Object.defineProperty(this, "navigator", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
configurable: true,
|
|
184
|
+
writable: true,
|
|
185
|
+
value: navigator
|
|
186
|
+
});
|
|
187
|
+
Object.defineProperty(this, "parent", {
|
|
188
|
+
enumerable: true,
|
|
189
|
+
configurable: true,
|
|
190
|
+
writable: true,
|
|
191
|
+
value: parent
|
|
192
|
+
});
|
|
193
|
+
Object.defineProperty(this, "path", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
configurable: true,
|
|
196
|
+
writable: true,
|
|
197
|
+
value: path
|
|
198
|
+
});
|
|
199
|
+
Object.defineProperty(this, "onRefresh", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
configurable: true,
|
|
202
|
+
writable: true,
|
|
203
|
+
value: void 0
|
|
204
|
+
});
|
|
205
|
+
Object.defineProperty(this, "refreshEvent", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
configurable: true,
|
|
208
|
+
writable: true,
|
|
209
|
+
value: new Subject()
|
|
210
|
+
});
|
|
164
211
|
this.onRefresh = this.refreshEvent.asObservable();
|
|
165
212
|
}
|
|
166
213
|
navigateTo(path, params, fragment) {
|
|
@@ -326,8 +373,24 @@ const RouterOutlet = withAnnotation({
|
|
|
326
373
|
|
|
327
374
|
class RouterModule {
|
|
328
375
|
constructor(baseUrl = '') {
|
|
329
|
-
this
|
|
330
|
-
|
|
376
|
+
Object.defineProperty(this, "baseUrl", {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
configurable: true,
|
|
379
|
+
writable: true,
|
|
380
|
+
value: baseUrl
|
|
381
|
+
});
|
|
382
|
+
Object.defineProperty(this, "subscription", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
configurable: true,
|
|
385
|
+
writable: true,
|
|
386
|
+
value: new Subscription()
|
|
387
|
+
});
|
|
388
|
+
Object.defineProperty(this, "navigator", {
|
|
389
|
+
enumerable: true,
|
|
390
|
+
configurable: true,
|
|
391
|
+
writable: true,
|
|
392
|
+
value: void 0
|
|
393
|
+
});
|
|
331
394
|
this.navigator = new BrowserNavigator(this.baseUrl);
|
|
332
395
|
}
|
|
333
396
|
setup(app) {
|
package/bundles/index.js
CHANGED
|
@@ -39,7 +39,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
39
39
|
|
|
40
40
|
class Navigator {
|
|
41
41
|
constructor(baseUrl) {
|
|
42
|
-
this
|
|
42
|
+
Object.defineProperty(this, "baseUrl", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: baseUrl
|
|
47
|
+
});
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
function formatUrl(pathname, urlFormatParams) {
|
|
@@ -68,8 +73,24 @@ exports.BrowserNavigator = class BrowserNavigator extends Navigator {
|
|
|
68
73
|
}
|
|
69
74
|
constructor(baseUrl) {
|
|
70
75
|
super(baseUrl);
|
|
71
|
-
this
|
|
72
|
-
|
|
76
|
+
Object.defineProperty(this, "onUrlChanged", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true,
|
|
79
|
+
writable: true,
|
|
80
|
+
value: void 0
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(this, "urlChangeEvent", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
configurable: true,
|
|
85
|
+
writable: true,
|
|
86
|
+
value: new stream.Subject()
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(this, "subscription", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
configurable: true,
|
|
91
|
+
writable: true,
|
|
92
|
+
value: new stream.Subscription()
|
|
93
|
+
});
|
|
73
94
|
this.onUrlChanged = this.urlChangeEvent.asObservable();
|
|
74
95
|
this.subscription.add(stream.fromEvent(window, 'popstate').subscribe(() => {
|
|
75
96
|
this.urlChangeEvent.next();
|
|
@@ -159,10 +180,36 @@ class Router {
|
|
|
159
180
|
return '';
|
|
160
181
|
}
|
|
161
182
|
constructor(navigator, parent, path) {
|
|
162
|
-
this
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
183
|
+
Object.defineProperty(this, "navigator", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
configurable: true,
|
|
186
|
+
writable: true,
|
|
187
|
+
value: navigator
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(this, "parent", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
configurable: true,
|
|
192
|
+
writable: true,
|
|
193
|
+
value: parent
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(this, "path", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
configurable: true,
|
|
198
|
+
writable: true,
|
|
199
|
+
value: path
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(this, "onRefresh", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
configurable: true,
|
|
204
|
+
writable: true,
|
|
205
|
+
value: void 0
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(this, "refreshEvent", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
configurable: true,
|
|
210
|
+
writable: true,
|
|
211
|
+
value: new stream.Subject()
|
|
212
|
+
});
|
|
166
213
|
this.onRefresh = this.refreshEvent.asObservable();
|
|
167
214
|
}
|
|
168
215
|
navigateTo(path, params, fragment) {
|
|
@@ -328,8 +375,24 @@ const RouterOutlet = core.withAnnotation({
|
|
|
328
375
|
|
|
329
376
|
class RouterModule {
|
|
330
377
|
constructor(baseUrl = '') {
|
|
331
|
-
this
|
|
332
|
-
|
|
378
|
+
Object.defineProperty(this, "baseUrl", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
configurable: true,
|
|
381
|
+
writable: true,
|
|
382
|
+
value: baseUrl
|
|
383
|
+
});
|
|
384
|
+
Object.defineProperty(this, "subscription", {
|
|
385
|
+
enumerable: true,
|
|
386
|
+
configurable: true,
|
|
387
|
+
writable: true,
|
|
388
|
+
value: new stream.Subscription()
|
|
389
|
+
});
|
|
390
|
+
Object.defineProperty(this, "navigator", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
configurable: true,
|
|
393
|
+
writable: true,
|
|
394
|
+
value: void 0
|
|
395
|
+
});
|
|
333
396
|
this.navigator = new exports.BrowserNavigator(this.baseUrl);
|
|
334
397
|
}
|
|
335
398
|
setup(app) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"keywords": [],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@tanbo/stream": "^1.2.4",
|
|
18
|
-
"@viewfly/core": "^1.
|
|
18
|
+
"@viewfly/core": "^1.2.0",
|
|
19
19
|
"url": "^0.11.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/viewfly/viewfly.git/issues"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8d13d8667f8875f24bc5218e9e4136d9efd9565a"
|
|
41
41
|
}
|