@kodaris/krubble-app-components 1.0.137 → 1.0.139
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/krubble-app.bundled.js +445 -187
- package/dist/krubble-app.bundled.js.map +1 -1
- package/dist/krubble-app.bundled.min.js +9 -4
- package/dist/krubble-app.bundled.min.js.map +1 -1
- package/dist/krubble-app.umd.js +446 -189
- package/dist/krubble-app.umd.js.map +1 -1
- package/dist/krubble-app.umd.min.js +13 -8
- package/dist/krubble-app.umd.min.js.map +1 -1
- package/dist/router.d.ts +63 -6
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +329 -76
- package/dist/router.js.map +1 -1
- package/dist/screen-nav.d.ts +2 -2
- package/dist/screen-nav.js +3 -3
- package/package.json +1 -1
package/dist/router.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* SPA router to run Lit based SPA apps.
|
|
4
|
+
*
|
|
5
|
+
* It is quite simple and models the Angular router.
|
|
6
|
+
*
|
|
7
|
+
* 1. Engineer defines:
|
|
8
|
+
* - A list of route definitions. Each definition:
|
|
9
|
+
* - Specifies a url path
|
|
10
|
+
* - A DOM element to render as the screen
|
|
11
|
+
* - An array of child route definitions
|
|
12
|
+
* - A router outlet
|
|
13
|
+
* - where on the page the router should render the screen for a particular route
|
|
14
|
+
* - Multiple nested router outlets can be placed to render child screens with parent screens
|
|
15
|
+
* 2. Router intercepts all browser navigation events (popstate)
|
|
16
|
+
* 2. Upon a navgiation
|
|
17
|
+
* - Router matches browser url to the correct route definitions
|
|
18
|
+
* - Router executes `resolve` methods on each route component to pre-load data for the screen before rendering the screen
|
|
19
|
+
* - Router creates each route component in the DOM
|
|
20
|
+
* - Router grabs the previous route components from the DOM and stores them to re-attach later should the user go back to the previous route
|
|
21
|
+
* - Router attaches each new route component in the DOM in the appropriate router outlet
|
|
22
|
+
*/
|
|
2
23
|
export interface KRRoute {
|
|
3
24
|
path: string;
|
|
4
25
|
component: string;
|
|
@@ -12,25 +33,60 @@ export interface KRRouterConfig {
|
|
|
12
33
|
export interface KRMatchedRoute {
|
|
13
34
|
route: KRRoute;
|
|
14
35
|
params: Record<string, string>;
|
|
36
|
+
url: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* What the router assigns to a route component's `routeSnapshot` property before mounting it, named
|
|
40
|
+
* after Angular's ActivatedRoute.snapshot. The router writes it once per mount and owns it — declare
|
|
41
|
+
* it `readonly` so the compiler stops the component from reassigning it:
|
|
42
|
+
*
|
|
43
|
+
* @state() readonly routeSnapshot: KRRouteSnapshot = { params: {}, data: { page: {} } };
|
|
44
|
+
*
|
|
45
|
+
* That makes both `this.routeSnapshot = ...` and `this.routeSnapshot.params = ...` compile errors, so
|
|
46
|
+
* anything that changes after mount has to live in the component's own state instead. The router
|
|
47
|
+
* assigns through a cast, which readonly doesn't block, and also freezes the object — though only
|
|
48
|
+
* shallowly, so `data` contents stay mutable.
|
|
49
|
+
*/
|
|
50
|
+
export interface KRRouteSnapshot {
|
|
51
|
+
readonly params: Readonly<Record<string, string>>;
|
|
52
|
+
readonly data: any;
|
|
53
|
+
}
|
|
54
|
+
interface KRRouteMatch {
|
|
55
|
+
routes: KRMatchedRoute[];
|
|
56
|
+
url: string;
|
|
57
|
+
}
|
|
58
|
+
interface KROutletContext {
|
|
59
|
+
outlet: KRRouterOutlet | null;
|
|
60
|
+
element: HTMLElement | null;
|
|
61
|
+
url: string;
|
|
62
|
+
}
|
|
63
|
+
interface KRCachedRoute {
|
|
64
|
+
el: HTMLElement;
|
|
65
|
+
scrolls: number[];
|
|
15
66
|
}
|
|
16
67
|
export declare class KRRouter {
|
|
17
68
|
static base: string;
|
|
18
69
|
static routes: KRRoute[];
|
|
19
|
-
static
|
|
70
|
+
static routeCache: Map<string, KRCachedRoute>;
|
|
71
|
+
static outletContexts: Map<number, KROutletContext>;
|
|
72
|
+
static navToken: number;
|
|
20
73
|
static configure(config: KRRouterConfig): void;
|
|
74
|
+
static handleNavigation(): void;
|
|
75
|
+
static registerOutlet(level: number, outlet: KRRouterOutlet): void;
|
|
76
|
+
static unregisterOutlet(level: number, outlet: KRRouterOutlet): void;
|
|
21
77
|
static navigate(path: string): void;
|
|
22
78
|
static getParams(): Record<string, string>;
|
|
23
|
-
static
|
|
24
|
-
static
|
|
25
|
-
static matchRoutes(routes: KRRoute[], segments: string[]): KRMatchedRoute[];
|
|
79
|
+
static getScrollableElements(root: Element): Element[];
|
|
80
|
+
static matchRoutes(routes?: KRRoute[], segments?: string[]): KRRouteMatch;
|
|
26
81
|
}
|
|
27
82
|
export declare class KRRouterOutlet extends LitElement {
|
|
28
83
|
static styles: import("lit").CSSResult;
|
|
29
84
|
level: number;
|
|
85
|
+
el: HTMLElement | null;
|
|
30
86
|
connectedCallback(): void;
|
|
31
87
|
disconnectedCallback(): void;
|
|
32
|
-
|
|
33
|
-
|
|
88
|
+
activate(el: HTMLElement): void;
|
|
89
|
+
deactivate(): void;
|
|
34
90
|
render(): import("lit-html").TemplateResult<1>;
|
|
35
91
|
}
|
|
36
92
|
declare global {
|
|
@@ -38,4 +94,5 @@ declare global {
|
|
|
38
94
|
'kr-router-outlet': KRRouterOutlet;
|
|
39
95
|
}
|
|
40
96
|
}
|
|
97
|
+
export {};
|
|
41
98
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;;;;;;;;;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cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;IAkC3D,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;IAO7D,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAS5B,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAY1C,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE;IA8DtD,MAAM,CAAC,WAAW,CAAC,MAAM,GAAE,OAAO,EAAoB,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY;CAmH3F;AAED,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,0BAKX;IAEF,KAAK,SAAM;IAGF,EAAE,EAAE,WAAW,GAAG,IAAI,CAAQ;IAEvC,iBAAiB;IA2BjB,oBAAoB;IAKpB,QAAQ,CAAC,EAAE,EAAE,WAAW;IAIxB,UAAU;IAKV,MAAM;CAMP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
package/dist/router.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
2
9
|
export class KRRouter {
|
|
3
10
|
static configure(config) {
|
|
4
11
|
KRRouter.base = config.base;
|
|
@@ -15,9 +22,175 @@ export class KRRouter {
|
|
|
15
22
|
if (!anchor.pathname.startsWith(KRRouter.base)) {
|
|
16
23
|
return;
|
|
17
24
|
}
|
|
25
|
+
if (anchor.target === '_blank') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
18
28
|
e.preventDefault();
|
|
19
29
|
KRRouter.navigate(anchor.pathname);
|
|
20
30
|
});
|
|
31
|
+
// Process each navigation. popstate covers every source — a link click, a KRRouter.navigate()
|
|
32
|
+
// call (which dispatches one itself), and the browser's back/forward buttons.
|
|
33
|
+
window.addEventListener('popstate', () => {
|
|
34
|
+
KRRouter.handleNavigation();
|
|
35
|
+
});
|
|
36
|
+
// The initial page load fires no popstate, so process the URL the app booted on. Deferred to a
|
|
37
|
+
// microtask rather than run synchronously: configure() is called while app.js is being evaluated
|
|
38
|
+
// as an import, which happens BEFORE the importing module's body. Navigating synchronously here
|
|
39
|
+
// would fire the first resolve() fetches before main.ts had run KRHttp.configure(), so they'd go
|
|
40
|
+
// to the dev server's own origin (localhost:4201/api/...) instead of devUrl and 404.
|
|
41
|
+
Promise.resolve().then(() => {
|
|
42
|
+
KRRouter.handleNavigation();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
static handleNavigation() {
|
|
46
|
+
const matched = KRRouter.matchRoutes();
|
|
47
|
+
// Nothing matched (a stale or mistyped link). An unrecognized URL
|
|
48
|
+
// shouldn't destroy the state of the screen the user is on.
|
|
49
|
+
if (!matched.routes.length) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// A route with children but no child segment in the URL resolves to its `default` child, so the
|
|
53
|
+
// resolved url is longer than what's in the address bar (/pages/42 resolves pages/42/details).
|
|
54
|
+
// Rewrite it so the URL reflects what's actually on screen.
|
|
55
|
+
let resolvedPath = KRRouter.base;
|
|
56
|
+
if (matched.url) {
|
|
57
|
+
resolvedPath = KRRouter.base + '/' + matched.url;
|
|
58
|
+
}
|
|
59
|
+
if (window.location.pathname !== resolvedPath) {
|
|
60
|
+
window.history.replaceState({}, '', resolvedPath);
|
|
61
|
+
}
|
|
62
|
+
// Drop cached entries for routes DEEPER than the URL we're navigating to — if the user navigates
|
|
63
|
+
// up a level we assume they're moving on to a different task. This is what keeps the cache from
|
|
64
|
+
// growing without bound.
|
|
65
|
+
for (const key of KRRouter.routeCache.keys()) {
|
|
66
|
+
if (matched.url.split('/').filter(s => s).length < key.split('/').filter(s => s).length) {
|
|
67
|
+
KRRouter.routeCache.delete(key);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const token = ++KRRouter.navToken;
|
|
71
|
+
// Resolve every route's matching component (screen).
|
|
72
|
+
Promise.all(matched.routes.map(match => {
|
|
73
|
+
// Reuse the cached element for this url if we have one
|
|
74
|
+
const cached = KRRouter.routeCache.get(match.url);
|
|
75
|
+
if (cached) {
|
|
76
|
+
return Promise.resolve(cached.el);
|
|
77
|
+
}
|
|
78
|
+
// Create and cache the screen element
|
|
79
|
+
const el = document.createElement(match.route.component);
|
|
80
|
+
KRRouter.routeCache.set(match.url, {
|
|
81
|
+
el,
|
|
82
|
+
scrolls: [],
|
|
83
|
+
});
|
|
84
|
+
// If the component class defines a static resolve(params), await it and hand the result to the
|
|
85
|
+
// element as `routeSnapshot` = { params, data } before it mounts, so it paints with data instead
|
|
86
|
+
// of flashing empty
|
|
87
|
+
const constructor = customElements.get(match.route.component);
|
|
88
|
+
if (constructor && typeof constructor.resolve === 'function') {
|
|
89
|
+
return Promise.resolve(constructor.resolve(KRRouter.getParams())).then(data => {
|
|
90
|
+
// Frozen so a component can't quietly swap params/data at runtime either — the readonly
|
|
91
|
+
// modifiers on KRRouteSnapshot only hold at compile time. Shallow: `data`'s own contents are
|
|
92
|
+
// still mutable, since components legitimately read structures out of it.
|
|
93
|
+
const routeSnapshot = Object.freeze({
|
|
94
|
+
params: match.params,
|
|
95
|
+
data,
|
|
96
|
+
});
|
|
97
|
+
el.routeSnapshot = routeSnapshot;
|
|
98
|
+
return el;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return Promise.resolve(el);
|
|
102
|
+
}))
|
|
103
|
+
.then(elements => {
|
|
104
|
+
// A newer navigation started while we were resolving — its elements are the current truth.
|
|
105
|
+
if (token !== KRRouter.navToken) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// ---- PASS 1: deactivate, deepest level first ----
|
|
109
|
+
// Remove screen elements that no longer apply to the new current routes for the current url
|
|
110
|
+
const levels = Array.from(KRRouter.outletContexts.keys()).sort((a, b) => b - a);
|
|
111
|
+
for (const level of levels) {
|
|
112
|
+
const context = KRRouter.outletContexts.get(level);
|
|
113
|
+
if (!context?.outlet?.el || context.outlet.el === elements[level]) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
// Capture the outgoing element's scroll positions into its cache entry, then unmount it.
|
|
117
|
+
const outgoing = KRRouter.routeCache.get(context.url);
|
|
118
|
+
if (outgoing) {
|
|
119
|
+
outgoing.scrolls = KRRouter.getScrollableElements(context.outlet.el).map(scrollable => scrollable.scrollTop);
|
|
120
|
+
}
|
|
121
|
+
context.outlet.deactivate();
|
|
122
|
+
context.element = null;
|
|
123
|
+
context.url = '';
|
|
124
|
+
}
|
|
125
|
+
// Put each screen element into the appropriate router outlet
|
|
126
|
+
elements.forEach((el, level) => {
|
|
127
|
+
// First navigation to reach this depth has no context yet.
|
|
128
|
+
let context = KRRouter.outletContexts.get(level);
|
|
129
|
+
if (!context) {
|
|
130
|
+
context = {
|
|
131
|
+
outlet: null,
|
|
132
|
+
element: null,
|
|
133
|
+
url: '',
|
|
134
|
+
};
|
|
135
|
+
KRRouter.outletContexts.set(level, context);
|
|
136
|
+
}
|
|
137
|
+
context.element = el;
|
|
138
|
+
context.url = matched.routes[level].url;
|
|
139
|
+
if (context.outlet && context.outlet.el !== el) {
|
|
140
|
+
context.outlet.activate(el);
|
|
141
|
+
// Put back the scroll positions captured when the user last left this element.
|
|
142
|
+
const cached = KRRouter.routeCache.get(context.url);
|
|
143
|
+
if (cached?.scrolls.length) {
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
const scrollables = KRRouter.getScrollableElements(cached.el);
|
|
146
|
+
cached.scrolls.forEach((top, index) => {
|
|
147
|
+
if (scrollables[index]) {
|
|
148
|
+
scrollables[index].scrollTop = top;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}, 0);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
// An outlet announces itself here when it connects and takes whatever element its context holds.
|
|
158
|
+
static registerOutlet(level, outlet) {
|
|
159
|
+
// No context yet when an outlet connects before a navigation
|
|
160
|
+
let context = KRRouter.outletContexts.get(level);
|
|
161
|
+
if (!context) {
|
|
162
|
+
context = {
|
|
163
|
+
outlet: null,
|
|
164
|
+
element: null,
|
|
165
|
+
url: '',
|
|
166
|
+
};
|
|
167
|
+
KRRouter.outletContexts.set(level, context);
|
|
168
|
+
}
|
|
169
|
+
context.outlet = outlet;
|
|
170
|
+
// An outlet re-attached with its element already mounted (a cached parent coming back) must not
|
|
171
|
+
// restore scroll again — that would overwrite the live position with a stale one.
|
|
172
|
+
if (context.element && outlet.el !== context.element) {
|
|
173
|
+
outlet.activate(context.element);
|
|
174
|
+
// Same scroll restore as the activation pass in handleNavigation — this is the path taken when
|
|
175
|
+
// the outlet didn't exist yet at navigation time, which for us is the common case.
|
|
176
|
+
const cached = KRRouter.routeCache.get(context.url);
|
|
177
|
+
if (cached?.scrolls.length) {
|
|
178
|
+
setTimeout(() => {
|
|
179
|
+
const scrollables = KRRouter.getScrollableElements(cached.el);
|
|
180
|
+
cached.scrolls.forEach((top, index) => {
|
|
181
|
+
if (scrollables[index]) {
|
|
182
|
+
scrollables[index].scrollTop = top;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}, 0);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
static unregisterOutlet(level, outlet) {
|
|
190
|
+
const context = KRRouter.outletContexts.get(level);
|
|
191
|
+
if (context && context.outlet === outlet) {
|
|
192
|
+
context.outlet = null;
|
|
193
|
+
}
|
|
21
194
|
}
|
|
22
195
|
static navigate(path) {
|
|
23
196
|
let fullPath = path;
|
|
@@ -28,53 +201,92 @@ export class KRRouter {
|
|
|
28
201
|
window.dispatchEvent(new PopStateEvent('popstate'));
|
|
29
202
|
}
|
|
30
203
|
static getParams() {
|
|
31
|
-
const matched = KRRouter.
|
|
204
|
+
const matched = KRRouter.matchRoutes();
|
|
32
205
|
const params = {};
|
|
33
|
-
for (const match of matched) {
|
|
206
|
+
for (const match of matched.routes) {
|
|
34
207
|
for (const key in match.params) {
|
|
35
208
|
params[key] = decodeURIComponent(match.params[key]);
|
|
36
209
|
}
|
|
37
210
|
}
|
|
38
211
|
return params;
|
|
39
212
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
213
|
+
// Every scrollable element in and under `root`, in document order — piercing shadow roots.
|
|
214
|
+
static getScrollableElements(root) {
|
|
215
|
+
const scrollables = [];
|
|
216
|
+
// Depth-first pre-order, each node's shadow root before its light children. An explicit stack
|
|
217
|
+
// rather than recursion; pushing children in reverse makes them pop in document order, which keeps
|
|
218
|
+
// the sequence identical to the recursive walk this replaces. The ORDER is load-bearing: capture
|
|
219
|
+
// and restore index into the returned list positionally, so both passes must enumerate the same
|
|
220
|
+
// nodes in the same sequence.
|
|
221
|
+
const stack = [root];
|
|
222
|
+
while (stack.length) {
|
|
223
|
+
const node = stack.pop();
|
|
224
|
+
if (!node) {
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
const style = getComputedStyle(node);
|
|
228
|
+
if (style.overflow === 'auto'
|
|
229
|
+
|| style.overflow === 'scroll'
|
|
230
|
+
|| style.overflowY === 'auto'
|
|
231
|
+
|| style.overflowY === 'scroll') {
|
|
232
|
+
scrollables.push(node);
|
|
233
|
+
}
|
|
234
|
+
// Shadow children first so they occupy the same positions the recursion gave them.
|
|
235
|
+
const children = [];
|
|
236
|
+
if (node.shadowRoot) {
|
|
237
|
+
children.push(...Array.from(node.shadowRoot.children));
|
|
238
|
+
}
|
|
239
|
+
children.push(...Array.from(node.children));
|
|
240
|
+
for (let index = children.length - 1; index >= 0; index--) {
|
|
241
|
+
stack.push(children[index]);
|
|
55
242
|
}
|
|
56
243
|
}
|
|
57
|
-
|
|
58
|
-
KRRouter.elementCache.set(level + ':' + tag, el);
|
|
59
|
-
return el;
|
|
244
|
+
return scrollables;
|
|
60
245
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
246
|
+
// Match the CURRENT browser URL against the route defs.
|
|
247
|
+
//
|
|
248
|
+
// Example, with base '/operations/app/ai-cms' and the routes configured in app.ts:
|
|
249
|
+
//
|
|
250
|
+
// URL /operations/app/ai-cms/pages/42/seo
|
|
251
|
+
// segments ['pages', '42', 'seo'] (base stripped, split on '/')
|
|
252
|
+
// returns {
|
|
253
|
+
// routes: [
|
|
254
|
+
// { route: { path: 'pages/:contentPageID', component: 'kt-page' }, params: { contentPageID: '42' }, url: 'pages/42' },
|
|
255
|
+
// { route: { path: 'seo', component: 'kt-page-seo' }, params: {}, url: 'pages/42/seo' },
|
|
256
|
+
// ],
|
|
257
|
+
// url: 'pages/42/seo',
|
|
258
|
+
// }
|
|
259
|
+
//
|
|
260
|
+
// Three other shapes worth knowing:
|
|
261
|
+
//
|
|
262
|
+
// .../pages/42 a route with children but no child segment resolves its `default` child, so this
|
|
263
|
+
// returns BOTH levels and a url of 'pages/42/details' — longer than the address
|
|
264
|
+
// bar. handleNavigation() is what syncs the URL to it; this function is pure and
|
|
265
|
+
// never touches history.
|
|
266
|
+
// .../ (no segments) matches the path:'' route, returning a single entry for kt-home.
|
|
267
|
+
// .../nope no route matches, returning no routes and an empty url.
|
|
268
|
+
static matchRoutes(routes = KRRouter.routes, segments) {
|
|
269
|
+
// An empty array is a legitimate "nothing left to match" from a recursive call and stays as-is —
|
|
270
|
+
// only a genuinely absent argument (the entry call) reaches for the browser URL.
|
|
271
|
+
if (!segments) {
|
|
272
|
+
let relative = window.location.pathname;
|
|
273
|
+
if (relative.startsWith(KRRouter.base)) {
|
|
274
|
+
relative = relative.slice(KRRouter.base.length);
|
|
275
|
+
}
|
|
276
|
+
segments = relative.split('/').filter(s => s);
|
|
66
277
|
}
|
|
67
|
-
const segments = relative.split('/').filter(s => s);
|
|
68
|
-
return KRRouter.matchRoutes(KRRouter.routes, segments);
|
|
69
|
-
}
|
|
70
|
-
static matchRoutes(routes, segments) {
|
|
71
278
|
for (const route of routes) {
|
|
72
279
|
const routeSegments = route.path.split('/').filter(s => s);
|
|
280
|
+
// index route {path: '', component: kt-home}
|
|
73
281
|
if (routeSegments.length === 0 && segments.length === 0) {
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
282
|
+
return {
|
|
283
|
+
routes: [{
|
|
284
|
+
route,
|
|
285
|
+
params: {},
|
|
286
|
+
url: ''
|
|
287
|
+
}],
|
|
288
|
+
url: ''
|
|
289
|
+
};
|
|
78
290
|
}
|
|
79
291
|
if (routeSegments.length === 0) {
|
|
80
292
|
continue;
|
|
@@ -97,56 +309,86 @@ export class KRRouter {
|
|
|
97
309
|
continue;
|
|
98
310
|
}
|
|
99
311
|
const remaining = segments.slice(routeSegments.length);
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const
|
|
312
|
+
// This level's own resolved URL: the segments it consumed, with :params swapped for their real
|
|
313
|
+
// values. Children come back from the recursion holding only THEIR portion, so we prefix each
|
|
314
|
+
// with this as the recursion unwinds — every entry ends up with the full path from the root.
|
|
315
|
+
const url = segments.slice(0, routeSegments.length).join('/');
|
|
316
|
+
const matchedRoutes = [{
|
|
105
317
|
route,
|
|
106
|
-
params
|
|
318
|
+
params,
|
|
319
|
+
url
|
|
107
320
|
}];
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
321
|
+
if (remaining.length > 0) {
|
|
322
|
+
// Segments left over and nowhere to put them — this route doesn't fully match the URL, so try
|
|
323
|
+
// the next one. Without this, a route would be accepted having consumed only part of the URL:
|
|
324
|
+
// /pages/42/seo would match {path: 'pages'} and render the Pages list. It also narrows
|
|
325
|
+
// route.children for the call below, which matters because matchRoutes' first parameter has a
|
|
326
|
+
// DEFAULT — passing undefined would silently re-match from the top-level routes rather than
|
|
327
|
+
// failing.
|
|
328
|
+
if (!route.children) {
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
const childMatch = KRRouter.matchRoutes(route.children, remaining);
|
|
332
|
+
if (childMatch.routes.length > 0) {
|
|
333
|
+
for (const child of childMatch.routes) {
|
|
334
|
+
child.url = url + '/' + child.url;
|
|
335
|
+
}
|
|
336
|
+
matchedRoutes.push(...childMatch.routes);
|
|
337
|
+
return {
|
|
338
|
+
routes: matchedRoutes,
|
|
339
|
+
url: url + '/' + childMatch.url
|
|
340
|
+
};
|
|
113
341
|
}
|
|
114
342
|
}
|
|
115
|
-
// No remaining segments + default child —
|
|
343
|
+
// No remaining segments + a default child — resolve as though that child's segment were in the
|
|
344
|
+
// URL. We do NOT rewrite the address bar here; matching stays pure. handleNavigation() syncs the
|
|
345
|
+
// URL to the resolved `url` this returns.
|
|
116
346
|
if (route.children && remaining.length === 0 && route.default) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
347
|
+
const childMatch = KRRouter.matchRoutes(route.children, [route.default]);
|
|
348
|
+
if (childMatch.routes.length > 0) {
|
|
349
|
+
for (const child of childMatch.routes) {
|
|
350
|
+
child.url = url + '/' + child.url;
|
|
351
|
+
}
|
|
352
|
+
matchedRoutes.push(...childMatch.routes);
|
|
353
|
+
return {
|
|
354
|
+
routes: matchedRoutes,
|
|
355
|
+
url: url + '/' + childMatch.url
|
|
356
|
+
};
|
|
122
357
|
}
|
|
123
358
|
}
|
|
124
|
-
return
|
|
359
|
+
return {
|
|
360
|
+
routes: matchedRoutes,
|
|
361
|
+
url
|
|
362
|
+
};
|
|
125
363
|
}
|
|
126
|
-
return
|
|
364
|
+
return {
|
|
365
|
+
routes: [],
|
|
366
|
+
url: ''
|
|
367
|
+
};
|
|
127
368
|
}
|
|
128
369
|
}
|
|
129
370
|
KRRouter.base = '';
|
|
130
371
|
KRRouter.routes = [];
|
|
131
|
-
KRRouter.
|
|
132
|
-
|
|
372
|
+
KRRouter.routeCache = new Map();
|
|
373
|
+
// One context per nesting level — Angular's ChildrenOutletContexts, keyed by level rather than by
|
|
374
|
+
// outlet name since we only have one (primary) outlet per level. Outlets are DRIVEN through these;
|
|
375
|
+
// they never ask the router for anything.
|
|
376
|
+
KRRouter.outletContexts = new Map();
|
|
377
|
+
// One token per navigation. A slower navigation that has been superseded must not activate its
|
|
378
|
+
// (stale) elements, so it checks the token before committing anything.
|
|
379
|
+
KRRouter.navToken = 0;
|
|
380
|
+
let KRRouterOutlet = class KRRouterOutlet extends LitElement {
|
|
133
381
|
constructor() {
|
|
134
382
|
super(...arguments);
|
|
135
383
|
this.level = -1;
|
|
136
|
-
this
|
|
137
|
-
|
|
138
|
-
};
|
|
384
|
+
// The element the router has told this outlet to show.
|
|
385
|
+
this.el = null;
|
|
139
386
|
}
|
|
140
387
|
connectedCallback() {
|
|
141
388
|
super.connectedCallback();
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
disconnectedCallback() {
|
|
146
|
-
super.disconnectedCallback();
|
|
147
|
-
window.removeEventListener('popstate', this.handlePopState);
|
|
148
|
-
}
|
|
149
|
-
detectLevel() {
|
|
389
|
+
// This outlet's nesting depth = how many kr-router-outlet ancestors it has, which is only
|
|
390
|
+
// knowable once attached. Walk up through shadow boundaries too (via ShadowRoot.host), since a
|
|
391
|
+
// nested outlet lives inside its parent element's shadow root and parentNode stops at the root.
|
|
150
392
|
let level = 0;
|
|
151
393
|
let node = this;
|
|
152
394
|
while (node) {
|
|
@@ -164,26 +406,37 @@ export class KRRouterOutlet extends LitElement {
|
|
|
164
406
|
node = null;
|
|
165
407
|
}
|
|
166
408
|
}
|
|
167
|
-
|
|
409
|
+
this.level = level;
|
|
410
|
+
KRRouter.registerOutlet(this.level, this);
|
|
411
|
+
}
|
|
412
|
+
disconnectedCallback() {
|
|
413
|
+
super.disconnectedCallback();
|
|
414
|
+
KRRouter.unregisterOutlet(this.level, this);
|
|
415
|
+
}
|
|
416
|
+
activate(el) {
|
|
417
|
+
this.el = el;
|
|
418
|
+
}
|
|
419
|
+
deactivate() {
|
|
420
|
+
this.el = null;
|
|
168
421
|
}
|
|
169
422
|
render() {
|
|
170
|
-
|
|
171
|
-
if (!el) {
|
|
423
|
+
if (!this.el) {
|
|
172
424
|
return html ``;
|
|
173
425
|
}
|
|
174
|
-
return html `${el}`;
|
|
426
|
+
return html `${this.el}`;
|
|
175
427
|
}
|
|
176
|
-
}
|
|
428
|
+
};
|
|
177
429
|
KRRouterOutlet.styles = css `
|
|
178
430
|
:host {
|
|
179
431
|
display: block;
|
|
180
432
|
height: 100%;
|
|
181
433
|
}
|
|
182
434
|
`;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
435
|
+
__decorate([
|
|
436
|
+
state()
|
|
437
|
+
], KRRouterOutlet.prototype, "el", void 0);
|
|
438
|
+
KRRouterOutlet = __decorate([
|
|
439
|
+
customElement('kr-router-outlet')
|
|
440
|
+
], KRRouterOutlet);
|
|
441
|
+
export { KRRouterOutlet };
|
|
189
442
|
//# sourceM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QAAQ,CAAC,EAAe;QACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,UAAU;QACR,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;IACjB,CAAC;IAGD,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACb,OAAO,IAAI,CAAA,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC1B,CAAC;;AA1DM,qBAAM,GAAG,GAAG,CAAA;;;;;GAKlB,AALY,CAKX;AAKO;IAAR,KAAK,EAAE;0CAA+B;AAX5B,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4D1B"}
|
package/dist/screen-nav.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface KRScreenNavAction {
|
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* Actions render in a footer at the bottom of the nav column. With more than
|
|
54
|
-
* `maxVisibleActions` (default
|
|
54
|
+
* `maxVisibleActions` (default 5), the overflow collapses into a "More" dropdown.
|
|
55
55
|
* Listen for `action-click` to handle a click: `e.detail.action` is the action id.
|
|
56
56
|
*
|
|
57
57
|
* @slot - The main screen content
|
|
@@ -61,7 +61,7 @@ export interface KRScreenNavAction {
|
|
|
61
61
|
* @property {KRScreenNavItem[]} items - Navigation items as JSON array
|
|
62
62
|
* @property {string} activeId - Currently active item ID
|
|
63
63
|
* @property {KRScreenNavAction[]} actions - Action buttons rendered in the nav footer
|
|
64
|
-
* @property {number} maxVisibleActions - Max inline actions before collapsing into a "More" dropdown (default
|
|
64
|
+
* @property {number} maxVisibleActions - Max inline actions before collapsing into a "More" dropdown (default 5)
|
|
65
65
|
*
|
|
66
66
|
* @fires action-click - When an action button (inline or overflow) is clicked; detail is `{ action: id }`
|
|
67
67
|
*/
|