@bildvitta/quasar-app-extension-asteroid 3.20.0-beta.2 → 3.20.0-beta.20
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/package.json +4 -3
- package/src/boot/overlay-navigation.js +31 -3
- package/src/index.js +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bildvitta/quasar-app-extension-asteroid",
|
|
3
3
|
"description": "Asteroid",
|
|
4
|
-
"version": "3.20.0-beta.
|
|
4
|
+
"version": "3.20.0-beta.20",
|
|
5
5
|
"author": "Bild & Vitta <systemteam@bild.com.br>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"quasar": "^2.18.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@bildvitta/quasar-
|
|
37
|
+
"@bildvitta/quasar-app-extension-asteroid": "file:",
|
|
38
|
+
"@bildvitta/quasar-ui-asteroid": "3.20.0-beta.20",
|
|
38
39
|
"@bildvitta/store-adapter": "^1.0.0",
|
|
39
40
|
"execa": "^7.1.1",
|
|
40
41
|
"fontfaceobserver": "^2.3.0",
|
|
@@ -42,6 +43,6 @@
|
|
|
42
43
|
"laravel-echo": "^1.15.3",
|
|
43
44
|
"ora": "^8.2.0",
|
|
44
45
|
"pusher-js": "^8.4.0-rc2",
|
|
45
|
-
"unplugin-vue-components": "
|
|
46
|
+
"unplugin-vue-components": "28.5.0"
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import useOverlayNavigation from '
|
|
1
|
+
import { useOverlayNavigation } from 'asteroid'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @param {import('vue-router').Router} router
|
|
@@ -53,14 +53,27 @@ async function onBeforeEach (to, from, next, router) {
|
|
|
53
53
|
const backgroundResult = await getBackgroundComponent()
|
|
54
54
|
|
|
55
55
|
if (backgroundResult) {
|
|
56
|
-
const {
|
|
56
|
+
const { resolvedRoute } = backgroundResult
|
|
57
57
|
|
|
58
58
|
const { name, params = {}, fullPath, path, query = {} } = resolvedRoute || {}
|
|
59
59
|
|
|
60
60
|
to.meta.backgroundRoute = { name, params, fullPath, path, query }
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Resolve todos os componentes lazy da rota de background e armazena a rota
|
|
64
|
+
* resolvida em `to.meta.overlayBackgroundResolvedRoute`.
|
|
65
|
+
*
|
|
66
|
+
* O QasLayout usa essa rota via `<router-view :route="..." />` para renderizar
|
|
67
|
+
* o background com sua hierarquia completa (parent layout + children),
|
|
68
|
+
* enquanto o overlay continua usando a rota atual normalmente.
|
|
69
|
+
*/
|
|
70
|
+
await resolveRouteComponents(resolvedRoute)
|
|
71
|
+
|
|
72
|
+
to.meta.overlayBackgroundResolvedRoute = resolvedRoute
|
|
73
|
+
|
|
74
|
+
// Apenas adicionar o overlay, sem alterar o default
|
|
62
75
|
to.matched[matchedIndex].components = {
|
|
63
|
-
|
|
76
|
+
...to.matched[matchedIndex].components,
|
|
64
77
|
overlay: overlayComponent
|
|
65
78
|
}
|
|
66
79
|
}
|
|
@@ -73,6 +86,21 @@ async function onBeforeEach (to, from, next, router) {
|
|
|
73
86
|
next()
|
|
74
87
|
|
|
75
88
|
// functions
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Resolve todos os componentes lazy (ex: () => import(...)) de uma rota.
|
|
92
|
+
* Necessário porque router.resolve() não resolve lazy components automaticamente.
|
|
93
|
+
*
|
|
94
|
+
* @param {import('vue-router').RouteLocationNormalized} route
|
|
95
|
+
*/
|
|
96
|
+
async function resolveRouteComponents (route) {
|
|
97
|
+
for (const matched of route.matched) {
|
|
98
|
+
for (const [viewName, comp] of Object.entries(matched.components || {})) {
|
|
99
|
+
matched.components[viewName] = await getResolvedComponent(comp)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
76
104
|
function getComponentByRoute (route) {
|
|
77
105
|
const lastIndex = route.matched.length - 1
|
|
78
106
|
const matched = route.matched[lastIndex]
|
package/src/index.js
CHANGED