@eodash/eodash 5.0.0-alpha.2.9 → 5.0.0-rc
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 -1
- package/core/client/App.vue +13 -1
- package/core/client/asWebComponent.js +13 -4
- package/core/client/components/DashboardLayout.vue +36 -14
- package/core/client/components/Loading.vue +6 -9
- package/core/client/components/MobileLayout.vue +16 -14
- package/core/client/composables/DefineEodash.js +14 -4
- package/core/client/composables/DefineTemplate.js +67 -0
- package/core/client/composables/DefineWidgets.js +3 -2
- package/core/client/composables/EodashMap.js +360 -0
- package/core/client/composables/EodashProcess.js +574 -0
- package/core/client/composables/index.js +136 -28
- package/core/client/eodash.js +395 -80
- package/core/client/eodashSTAC/EodashCollection.js +432 -0
- package/core/client/eodashSTAC/createLayers.js +315 -0
- package/core/client/eodashSTAC/helpers.js +375 -0
- package/core/client/eodashSTAC/triggers.js +43 -0
- package/core/client/plugins/axios.js +8 -0
- package/core/client/plugins/index.js +2 -1
- package/core/client/plugins/vuetify.js +2 -1
- package/core/client/store/actions.js +79 -0
- package/core/client/store/index.js +4 -18
- package/core/client/store/stac.js +99 -9
- package/core/client/store/states.js +37 -0
- package/core/client/{types.d.ts → types.ts} +66 -20
- package/core/client/utils/keys.js +2 -0
- package/core/client/utils/states.js +22 -0
- package/core/client/views/Dashboard.vue +22 -49
- package/core/client/vite-env.d.ts +2 -10
- package/dist/client/DashboardLayout-232tRmjz.js +84 -0
- package/dist/client/DynamicWebComponent-Cl4LqHU6.js +88 -0
- package/dist/client/EodashDatePicker-Pok6bZwU.js +306 -0
- package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
- package/dist/client/EodashLayerControl-De7IlCm_.js +120 -0
- package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
- package/dist/client/EodashMap-CMvbfI6-.js +549 -0
- package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
- package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
- package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
- package/dist/client/EodashTools-PD3XPYuR.js +103 -0
- package/dist/client/ExportState-DOrT7M15.js +644 -0
- package/dist/client/Footer-CCigxYBo.js +141 -0
- package/dist/client/Header-C2cdx4gb.js +437 -0
- package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
- package/dist/client/MobileLayout-BdiFjHg7.js +1207 -0
- package/dist/client/PopUp--_xn1Cms.js +410 -0
- package/dist/client/VImg-9xu2l99m.js +384 -0
- package/dist/client/VMain-BUs3kDTd.js +43 -0
- package/dist/client/VOverlay-D89omJis.js +1453 -0
- package/dist/client/VTooltip-CDu3bErh.js +86 -0
- package/dist/client/WidgetsContainer-aFG9yFT6.js +83 -0
- package/dist/client/asWebComponent-BRGyP_j5.js +11943 -0
- package/dist/client/{style.css → eo-dash.css} +2 -2
- package/dist/client/eo-dash.js +2 -6
- package/dist/client/forwardRefs-CYrR6bMw.js +245 -0
- package/dist/client/index-BZwk0V42.js +199 -0
- package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
- package/dist/client/transition-DG9nRSW4.js +37 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/types.d.ts +2 -0
- package/package.json +73 -38
- package/widgets/EodashDatePicker.vue +176 -134
- package/widgets/EodashItemFilter.vue +79 -38
- package/widgets/EodashLayerControl.vue +111 -0
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +108 -133
- package/widgets/EodashMapBtns.vue +62 -8
- package/widgets/EodashProcess.vue +143 -0
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +17 -13
- package/widgets/PopUp.vue +24 -2
- package/core/client/SuspensedDashboard.ce.vue +0 -105
- package/core/client/asWebComponent.d.ts +0 -23
- package/core/client/store/Actions.js +0 -14
- package/core/client/store/States.js +0 -16
- package/core/client/utils/eodashSTAC.js +0 -249
- package/core/client/utils/helpers.js +0 -38
- package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
- package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
- package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
- package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
- package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
- package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
- package/dist/client/ExportState-CCzOhppU.js +0 -558
- package/dist/client/Footer-BPAND0yG.js +0 -115
- package/dist/client/Header-DLhebNvG.js +0 -350
- package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
- package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
- package/dist/client/PopUp-1d2bBFjw.js +0 -300
- package/dist/client/VImg-DxHcztfM.js +0 -291
- package/dist/client/VMain-BLX5vRRn.js +0 -39
- package/dist/client/VOverlay-CvrYEmLu.js +0 -967
- package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
- package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
- package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
- package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
- package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
- package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
- package/dist/client/forwardRefs-BJJiadQP.js +0 -185
- package/dist/client/index-Q-bHLjxx.js +0 -153
- package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
- package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
- package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
- package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
- package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
- package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
- package/dist/client/ssrBoot-yo11mybw.js +0 -17
- package/dist/client/transition-CSJhuYGK.js +0 -34
- package/dist/client/webfontloader-qotgY98I.js +0 -435
- package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A package for creating earth observation dashboards. To learn more about eodash
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
Checkout the [documentation](https://eodash.github.io/eodash/
|
|
7
|
+
Checkout the [documentation](https://eodash.github.io/eodash/) for a detailed guide.
|
|
8
8
|
|
|
9
9
|
## Get Started
|
|
10
10
|
|
package/core/client/App.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-app>
|
|
3
3
|
<Suspense>
|
|
4
|
-
<Dashboard />
|
|
4
|
+
<Dashboard :is-web-component="isWebComponent" :config="config" />
|
|
5
5
|
|
|
6
6
|
<template #fallback>
|
|
7
7
|
<ErrorAlert v-model="error" />
|
|
@@ -15,7 +15,19 @@ import Dashboard from "@/views/Dashboard.vue";
|
|
|
15
15
|
import ErrorAlert from "./components/ErrorAlert.vue";
|
|
16
16
|
import { onErrorCaptured, ref } from "vue";
|
|
17
17
|
|
|
18
|
+
defineProps({
|
|
19
|
+
config: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
default: undefined,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// window.setEodashLoglevel("DEBUG")
|
|
27
|
+
|
|
18
28
|
const error = ref("");
|
|
29
|
+
const isWebComponent = !!document.querySelector("eo-dash");
|
|
30
|
+
|
|
19
31
|
onErrorCaptured((e, inst, info) => {
|
|
20
32
|
error.value = `
|
|
21
33
|
${e}.
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import App from "./App.vue";
|
|
2
2
|
import { defineCustomElement } from "vue";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { registerPlugins } from "./plugins";
|
|
4
|
+
/**
|
|
5
|
+
* @type {import("vue").VueElementConstructor<
|
|
6
|
+
* import("vue").ExtractPropTypes<{ config: string }>>}
|
|
7
|
+
* */
|
|
8
|
+
export const EodashConstructor = defineCustomElement(App, {
|
|
9
|
+
shadowRoot: false,
|
|
10
|
+
configureApp(app) {
|
|
11
|
+
registerPlugins(app);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
5
14
|
|
|
6
15
|
export function register() {
|
|
7
|
-
customElements.define("eo-dash",
|
|
16
|
+
customElements.define("eo-dash", EodashConstructor);
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
export { default as store } from "@/store";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-main>
|
|
3
|
-
<eox-layout :gap="
|
|
3
|
+
<eox-layout :gap="gap" :style="`padding: ${gap}px`">
|
|
4
4
|
<eox-layout-item
|
|
5
|
-
v-if="bgWidget
|
|
6
|
-
class="bg-panel"
|
|
5
|
+
v-if="bgWidget?.component"
|
|
6
|
+
class="bg-panel bg-surface"
|
|
7
|
+
:style="`margin: -${gap + 1}px;`"
|
|
7
8
|
x="0"
|
|
8
9
|
y="0"
|
|
9
10
|
h="12"
|
|
@@ -12,14 +13,15 @@
|
|
|
12
13
|
<Suspense suspensible>
|
|
13
14
|
<component
|
|
14
15
|
id="bg-widget"
|
|
15
|
-
:is="bgWidget
|
|
16
|
-
v-bind="bgWidget
|
|
16
|
+
:is="bgWidget?.component"
|
|
17
|
+
v-bind="bgWidget?.props"
|
|
17
18
|
/>
|
|
18
19
|
</Suspense>
|
|
19
20
|
</eox-layout-item>
|
|
20
21
|
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
21
22
|
<Transition name="fade">
|
|
22
23
|
<eox-layout-item
|
|
24
|
+
:id="importedWidget.value.id.toString()"
|
|
23
25
|
v-if="importedWidget.value.component"
|
|
24
26
|
:key="importedWidget.value.id"
|
|
25
27
|
class="panel bg-surface"
|
|
@@ -42,27 +44,21 @@
|
|
|
42
44
|
</v-main>
|
|
43
45
|
</template>
|
|
44
46
|
<script setup>
|
|
45
|
-
import { eodashKey } from "@/utils/keys";
|
|
46
|
-
import { inject } from "vue";
|
|
47
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
48
47
|
import "@eox/layout";
|
|
48
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
53
|
-
|
|
54
|
-
const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
50
|
+
const { bgWidget, importedWidgets, gap } = useDefineTemplate();
|
|
55
51
|
</script>
|
|
56
52
|
<style scoped>
|
|
57
53
|
.panel {
|
|
58
54
|
position: relative;
|
|
59
55
|
overflow: visible;
|
|
60
56
|
z-index: 1;
|
|
61
|
-
border-radius: 0px;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
.bg-panel {
|
|
65
60
|
z-index: 0;
|
|
61
|
+
border-radius: 0px !important;
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
.fade-enter-active,
|
|
@@ -74,4 +70,30 @@ const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
|
74
70
|
.fade-leave-to {
|
|
75
71
|
opacity: 0;
|
|
76
72
|
}
|
|
73
|
+
:deep(.bg-surface) {
|
|
74
|
+
backdrop-filter: blur(9.5px) !important;
|
|
75
|
+
background-color: rgba(
|
|
76
|
+
var(--v-theme-surface),
|
|
77
|
+
var(--v-surface-opacity, 0.8)
|
|
78
|
+
) !important;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
border-style: solid;
|
|
81
|
+
border-width: 1px;
|
|
82
|
+
border-color: rgb(var(--v-theme-surface));
|
|
83
|
+
scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
|
|
84
|
+
scrollbar-width: thin;
|
|
85
|
+
}
|
|
86
|
+
:deep(.bg-primary) {
|
|
87
|
+
backdrop-filter: blur(9.5px) !important;
|
|
88
|
+
background-color: rgba(
|
|
89
|
+
var(--v-theme-primary),
|
|
90
|
+
var(--v-primary-opacity, 0.8)
|
|
91
|
+
) !important;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
border-style: solid;
|
|
94
|
+
border-width: 1px;
|
|
95
|
+
border-color: rgb(var(--v-theme-primary));
|
|
96
|
+
scrollbar-color: rgba(var(--v-theme-on-primary), 0.2) transparent;
|
|
97
|
+
scrollbar-width: thin;
|
|
98
|
+
}
|
|
77
99
|
</style>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<ErrorAlert v-model="error" />
|
|
5
5
|
<Suspense>
|
|
6
6
|
<component
|
|
7
|
-
v-if="loading
|
|
8
|
-
:is="loading
|
|
9
|
-
v-bind="loading
|
|
7
|
+
v-if="loading?.component"
|
|
8
|
+
:is="loading?.component"
|
|
9
|
+
v-bind="loading?.props"
|
|
10
10
|
></component>
|
|
11
11
|
<div v-else class="text-center">Loading...</div>
|
|
12
12
|
<template #fallback>
|
|
@@ -17,14 +17,11 @@
|
|
|
17
17
|
</v-row>
|
|
18
18
|
</template>
|
|
19
19
|
<script setup>
|
|
20
|
-
import {
|
|
21
|
-
import { eodashKey } from "@/utils/keys";
|
|
22
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
20
|
+
import { onErrorCaptured, ref } from "vue";
|
|
23
21
|
import ErrorAlert from "./ErrorAlert.vue";
|
|
22
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const [loading] = useDefineWidgets([eodash.template.loading]);
|
|
24
|
+
const { loading } = useDefineTemplate();
|
|
28
25
|
|
|
29
26
|
const error = ref("");
|
|
30
27
|
onErrorCaptured((e, inst, info) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Suspense suspensible>
|
|
4
4
|
<component
|
|
5
5
|
id="bg-widget"
|
|
6
|
-
v-if="bgWidget
|
|
6
|
+
v-if="bgWidget?.component"
|
|
7
7
|
:is="bgWidget.component"
|
|
8
8
|
v-bind="bgWidget.props"
|
|
9
9
|
></component>
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
id="overlay"
|
|
17
17
|
class="pa-2 panel bg-surface"
|
|
18
18
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<div class="d-flex py-2 justify-end align-end">
|
|
20
|
+
<v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
|
|
21
|
+
>✕</v-btn
|
|
22
|
+
>
|
|
23
|
+
</div>
|
|
22
24
|
<Suspense suspensible>
|
|
23
25
|
<div class="component-container" v-show="activeIdx === idx">
|
|
24
26
|
<component
|
|
@@ -48,18 +50,11 @@
|
|
|
48
50
|
</v-main>
|
|
49
51
|
</template>
|
|
50
52
|
<script setup>
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
53
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
54
|
+
import { ref, onMounted } from "vue";
|
|
54
55
|
import { useLayout } from "vuetify";
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
//import widgets
|
|
59
|
-
const widgetsConfig = eodash.template.widgets;
|
|
60
|
-
const importedWidgets = useDefineWidgets(widgetsConfig);
|
|
61
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
62
|
-
|
|
57
|
+
const { bgWidget, importedWidgets } = useDefineTemplate();
|
|
63
58
|
const { mainRect } = useLayout();
|
|
64
59
|
|
|
65
60
|
const activeIdx = ref(-1);
|
|
@@ -106,4 +101,11 @@ onMounted(() => {
|
|
|
106
101
|
position: relative;
|
|
107
102
|
z-index: 10;
|
|
108
103
|
}
|
|
104
|
+
:deep(.bg-surface) {
|
|
105
|
+
backdrop-filter: blur(9.5px) !important;
|
|
106
|
+
background-color: rgba(
|
|
107
|
+
var(--v-theme-surface),
|
|
108
|
+
var(--v-surface-opacity, 0.8)
|
|
109
|
+
) !important;
|
|
110
|
+
}
|
|
109
111
|
</style>
|
|
@@ -3,8 +3,7 @@ import { eodashKey } from "@/utils/keys";
|
|
|
3
3
|
import { inject } from "vue";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* it to `eodash`
|
|
6
|
+
* Handles importing user defined instance of Eodash
|
|
8
7
|
*
|
|
9
8
|
* @async
|
|
10
9
|
* @param {string | undefined} runtimeConfig
|
|
@@ -15,6 +14,17 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
15
14
|
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
16
15
|
/** @param {import("@/types").Eodash} config */
|
|
17
16
|
const assignInstance = (config) => {
|
|
17
|
+
if ("template" in config) {
|
|
18
|
+
//@ts-expect-error to do
|
|
19
|
+
delete eodash.templates;
|
|
20
|
+
//@ts-expect-error to do
|
|
21
|
+
eodash.template = config.template;
|
|
22
|
+
} else if ("templates" in config) {
|
|
23
|
+
//@ts-expect-error to do
|
|
24
|
+
delete eodash.template;
|
|
25
|
+
//@ts-expect-error to do
|
|
26
|
+
eodash.templates = config.templates;
|
|
27
|
+
}
|
|
18
28
|
/** @type {(keyof import("@/types").Eodash)[]} */ (
|
|
19
29
|
Object.keys(eodash)
|
|
20
30
|
).forEach((key) => {
|
|
@@ -54,8 +64,8 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
54
64
|
|
|
55
65
|
/**
|
|
56
66
|
* @param {((
|
|
57
|
-
* store: import("@/
|
|
58
|
-
* ) => Promise<import("@/types").Eodash>)
|
|
67
|
+
* store: typeof import("@/store").default,
|
|
68
|
+
* ) => (Promise<import("@/types").Eodash> | import("@/types").Eodash))
|
|
59
69
|
* | import("@/types").Eodash} config
|
|
60
70
|
*/
|
|
61
71
|
export const createEodash = async (config) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { eodashKey } from "@/utils/keys";
|
|
2
|
+
import { inject, ref, shallowReactive, shallowRef, toRefs, watch } from "vue";
|
|
3
|
+
import { useDefineWidgets } from "./DefineWidgets";
|
|
4
|
+
import { activeTemplate } from "@/store/states";
|
|
5
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
6
|
+
import log from "loglevel";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{
|
|
10
|
+
* bgWidget:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
11
|
+
* loading: ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
12
|
+
* importedWidgets:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>
|
|
13
|
+
* gap: import("vue").Ref<number>
|
|
14
|
+
* }} DefinedTemplate
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
const useTemplate = () => {
|
|
18
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
19
|
+
|
|
20
|
+
/** @type {DefinedTemplate} */
|
|
21
|
+
const definedTemplate = shallowReactive({
|
|
22
|
+
bgWidget: shallowRef(null),
|
|
23
|
+
importedWidgets: [],
|
|
24
|
+
loading: shallowRef(null),
|
|
25
|
+
gap: ref(16),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if ("template" in eodash) {
|
|
29
|
+
[definedTemplate.bgWidget] = useDefineWidgets([eodash.template.background]);
|
|
30
|
+
[definedTemplate.loading] = useDefineWidgets([eodash.template.loading]);
|
|
31
|
+
definedTemplate.importedWidgets = useDefineWidgets(eodash.template.widgets);
|
|
32
|
+
definedTemplate.gap.value = eodash.template.gap ?? 16;
|
|
33
|
+
} else {
|
|
34
|
+
watch(
|
|
35
|
+
activeTemplate,
|
|
36
|
+
(template) => {
|
|
37
|
+
log.debug("Active template watcher triggered, changing to:", template);
|
|
38
|
+
if (!template) {
|
|
39
|
+
template = Object.keys(eodash.templates)[0];
|
|
40
|
+
activeTemplate.value = template ?? "";
|
|
41
|
+
log.debug("No template found, setting to first template", template);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!template || !eodash.templates[template]) {
|
|
45
|
+
console.error(`[eodash] template not found`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const templateConfig = eodash.templates[template];
|
|
50
|
+
[definedTemplate.bgWidget] = useDefineWidgets([
|
|
51
|
+
templateConfig.background,
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
[definedTemplate.loading] = useDefineWidgets([templateConfig.loading]);
|
|
55
|
+
|
|
56
|
+
definedTemplate.importedWidgets = useDefineWidgets(
|
|
57
|
+
templateConfig.widgets,
|
|
58
|
+
);
|
|
59
|
+
definedTemplate.gap.value = templateConfig.gap ?? 16;
|
|
60
|
+
},
|
|
61
|
+
{ immediate: true },
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return toRefs(definedTemplate);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const useDefineTemplate = createSharedComposable(useTemplate);
|
|
@@ -13,7 +13,9 @@ import { storeToRefs } from "pinia";
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/** @typedef {import("vue").ShallowRef<DefinedWidget>} ReactiveDefinedWidget */
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Widgets import map that is created from eodash internals and user defined widgets
|
|
18
|
+
*/
|
|
17
19
|
const internalWidgets = (() => {
|
|
18
20
|
/** @type {Record<string, () => Promise<import("vue").Component>>} */
|
|
19
21
|
const importMap = {
|
|
@@ -44,7 +46,6 @@ const internalWidgets = (() => {
|
|
|
44
46
|
* | undefined
|
|
45
47
|
* )[]
|
|
46
48
|
* | undefined} widgetConfigs
|
|
47
|
-
* @returns {ReactiveDefinedWidget[]}
|
|
48
49
|
*/
|
|
49
50
|
export const useDefineWidgets = (widgetConfigs) => {
|
|
50
51
|
/** @type {ReactiveDefinedWidget[]} */
|