saasufy-components 3.37.0 → 3.38.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/README.md +1 -0
- package/app-router.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -217,6 +217,7 @@ So for example, if your `index.html` file is served up from the URL `http://mywe
|
|
|
217
217
|
- `default-page`: The path/route of the default page to send the user to in case no routes are matched. Commonly used to point to a `/page-not-found` page. For the home page, it's typically recommended to create a page template with `route-path=""` instead.
|
|
218
218
|
- `debounce-delay`: The number of milliseconds to wait before changing the route. This can help to avoid multiple renders if the route changes rapidly (e.g. when doing hard redirects). Defaults to 100ms.
|
|
219
219
|
- `target-page`: A convenience attribute which can be used to programmatically change the `location.hash` in the address bar.
|
|
220
|
+
- `force-render-paths`: An optional list of comma-separated paths to force a page render/re-render, regardless of whether or not the page has changed.
|
|
220
221
|
|
|
221
222
|
**Attributes of slotted page templates**
|
|
222
223
|
|
package/app-router.js
CHANGED
|
@@ -58,6 +58,7 @@ export class AppRouter extends SocketConsumer {
|
|
|
58
58
|
return [
|
|
59
59
|
'target-page',
|
|
60
60
|
'default-page',
|
|
61
|
+
'force-render-paths',
|
|
61
62
|
'debounce-delay',
|
|
62
63
|
'max-redirects'
|
|
63
64
|
];
|
|
@@ -141,9 +142,16 @@ export class AppRouter extends SocketConsumer {
|
|
|
141
142
|
let routerViewport = this.shadowRoot.querySelector('slot[name="viewport"]').assignedNodes()[0];
|
|
142
143
|
if (!routerViewport) return;
|
|
143
144
|
|
|
145
|
+
let forceRenderPathsString = this.getAttribute('force-render-paths');
|
|
146
|
+
let forceRenderPaths = forceRenderPathsString == null ?
|
|
147
|
+
[] : forceRenderPathsString.split(',').map(path => path.trim());
|
|
148
|
+
|
|
144
149
|
let routeArgs;
|
|
145
150
|
let pagePath = location.hash.replace(this.hashStartRegex, '');
|
|
146
151
|
let { pageTemplate, route, regExp, params } = this.getMatchingPage(pagePath, 'path', true);
|
|
152
|
+
if (forceRenderPaths.includes(pagePath)) {
|
|
153
|
+
this.lastPageState = null;
|
|
154
|
+
}
|
|
147
155
|
|
|
148
156
|
if (!pageTemplate) {
|
|
149
157
|
let defaultPage = this.getAttribute('default-page');
|