@eodash/eodash 5.0.0 → 5.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/README.md +1 -0
- package/core/client/App.vue +8 -2
- package/core/client/asWebComponent.js +5 -5
- package/core/client/components/DashboardLayout.vue +43 -26
- package/core/client/components/EodashOverlay.vue +5 -6
- package/core/client/components/ErrorAlert.vue +2 -2
- package/core/client/components/Footer.vue +4 -4
- package/core/client/components/Header.vue +3 -3
- package/core/client/components/MobileLayout.vue +47 -27
- package/core/client/composables/DefineEodash.js +38 -43
- package/core/client/composables/DefineTemplate.js +4 -2
- package/core/client/composables/DefineWidgets.js +14 -8
- package/core/client/composables/index.js +273 -23
- package/core/client/eodashSTAC/EodashCollection.js +84 -62
- package/core/client/eodashSTAC/createLayers.js +30 -0
- package/core/client/eodashSTAC/helpers.js +159 -28
- package/core/client/eodashSTAC/parquet.js +145 -0
- package/core/client/eodashSTAC/triggers.js +6 -3
- package/core/client/plugins/index.js +4 -3
- package/core/client/plugins/vuetify.js +3 -0
- package/core/client/store/actions.js +21 -4
- package/core/client/store/stac.js +93 -56
- package/core/client/store/states.js +15 -5
- package/core/client/types.ts +59 -43
- package/core/client/utils/index.js +79 -0
- package/core/client/utils/keys.js +2 -2
- package/core/client/utils/states.js +30 -5
- package/core/client/views/Dashboard.vue +36 -32
- package/core/client/vite-env.d.ts +7 -0
- package/dist/client/{DashboardLayout-CkWvOMOW.js → DashboardLayout-Dq9Kfe6O.js} +24 -13
- package/dist/client/{DynamicWebComponent-DYBbpvUK.js → DynamicWebComponent-DCBMXskE.js} +1 -1
- package/dist/client/{EodashDatePicker-CALmW3SI.js → EodashDatePicker-DtngxU6s.js} +59 -32
- package/dist/client/{EodashItemFilter-DlQiE713.js → EodashItemFilter-ClQebJQt.js} +20 -10
- package/dist/client/{EodashLayerControl-DEzEbft7.js → EodashLayerControl-BLBds28C.js} +29 -16
- package/dist/client/EodashLayoutSwitcher-DQ8SfVDd.js +61 -0
- package/dist/client/EodashMapBtns-B89_YBDw.js +326 -0
- package/dist/client/{EodashStacInfo-DPPxDkF6.js → EodashStacInfo-Dt1nF06x.js} +3 -18
- package/dist/client/{EodashTools-CUaL9s4H.js → EodashTools-DV5ykmWc.js} +13 -13
- package/dist/client/{ExportState-DjyIZVhl.js → ExportState-B6zZQUmE.js} +57 -52
- package/dist/client/{Footer-DyL0JoWt.js → Footer-DNhXs8k6.js} +15 -13
- package/dist/client/{Header-B5Dgty9l.js → Header-BjhN5JY4.js} +32 -28
- package/dist/client/MobileLayout-JelB6w1G.js +118 -0
- package/dist/client/{PopUp-BfB8s_ki.js → PopUp-CgpvNr3o.js} +18 -10
- package/dist/client/ProcessList-vecpxThi.js +198 -0
- package/dist/client/{VImg-FD1WVphJ.js → VImg-CETuikH2.js} +221 -26
- package/dist/client/{VMain-DJKG4SvM.js → VMain-Ci9DyaGU.js} +7 -7
- package/dist/client/{VTooltip-CfeefrXI.js → VTooltip-J4ac48X7.js} +12 -10
- package/dist/client/{WidgetsContainer-C2TaTdb6.js → WidgetsContainer-CCML4TyV.js} +1 -1
- package/dist/client/asWebComponent-ZyEzWOOf.js +19092 -0
- package/dist/client/async-B7jIrM53.js +804 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{VOverlay-BzOdRu9h.js → forwardRefs-BQclvjMq.js} +332 -28
- package/dist/client/handling-BS24aG1q.js +1227 -0
- package/dist/client/helpers-wXK7Ywio.js +4556 -0
- package/dist/client/index-4UCzZi8B.js +376 -0
- package/dist/client/{index-4CT7Tz83.js → index-9KR-G20t.js} +2 -2
- package/dist/client/{index-CIHH_3dW.js → index-B2XpdgR6.js} +227 -86
- package/dist/client/material-symbols-outlined.woff2 +0 -0
- package/dist/client/material-symbols-rounded.woff2 +0 -0
- package/dist/client/material-symbols-sharp.woff2 +0 -0
- package/dist/client/material-symbols-subset.woff2 +0 -0
- package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
- package/dist/client/templates.js +840 -0
- package/dist/client/transition-yBii4fu6.js +40 -0
- package/dist/node/cli.js +16 -6
- package/dist/node/types.d.ts +1 -1
- package/dist/types/core/client/App.vue.d.ts +2 -2
- package/dist/types/core/client/asWebComponent.d.ts +1 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
- package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
- package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
- package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
- package/dist/types/core/client/composables/index.d.ts +24 -2
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +25 -5
- package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
- package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
- package/dist/types/core/client/store/actions.d.ts +3 -2
- package/dist/types/core/client/store/stac.d.ts +16 -13
- package/dist/types/core/client/store/states.d.ts +14 -4
- package/dist/types/core/client/types.d.ts +46 -31
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +4 -4
- package/dist/types/core/client/utils/states.d.ts +59 -47
- package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
- package/dist/types/templates/baseConfig.d.ts +4 -0
- package/dist/types/templates/compare.d.ts +185 -0
- package/dist/types/templates/expert.d.ts +147 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/light.d.ts +154 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
- package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +12 -8
- package/dist/types/widgets/EodashMap/index.vue.d.ts +9 -4
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
- package/dist/types/widgets/EodashProcess/methods/async.d.ts +19 -18
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
- package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
- package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
- package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
- package/dist/types/widgets/ExportState.vue.d.ts +1 -1
- package/dist/types/widgets/PopUp.vue.d.ts +11 -16
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
- package/package.json +55 -45
- package/templates/baseConfig.js +68 -0
- package/templates/compare.js +142 -0
- package/templates/expert.js +124 -0
- package/templates/index.js +8 -0
- package/templates/light.js +139 -0
- package/widgets/EodashDatePicker.vue +80 -31
- package/widgets/EodashItemFilter.vue +26 -11
- package/widgets/EodashLayerControl.vue +20 -11
- package/widgets/EodashLayoutSwitcher.vue +6 -3
- package/widgets/EodashMap/EodashMapBtns.vue +269 -0
- package/widgets/EodashMap/index.vue +255 -45
- package/widgets/EodashMap/methods/create-layers-config.js +4 -3
- package/widgets/EodashMap/methods/index.js +33 -23
- package/widgets/EodashProcess/ProcessList.vue +47 -11
- package/widgets/EodashProcess/index.vue +55 -20
- package/widgets/EodashProcess/methods/async.js +99 -60
- package/widgets/EodashProcess/methods/composables.js +21 -14
- package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +132 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
- package/widgets/EodashProcess/methods/handling.js +127 -80
- package/widgets/EodashProcess/methods/outputs.js +376 -125
- package/widgets/EodashProcess/methods/utils.js +442 -10
- package/widgets/EodashProcess/states.js +13 -0
- package/widgets/EodashProcess/types.ts +46 -0
- package/widgets/EodashStacInfo.vue +2 -17
- package/widgets/EodashTools.vue +13 -13
- package/widgets/WidgetsContainer.vue +1 -1
- package/core/client/eodash.js +0 -454
- package/dist/client/EodashLayoutSwitcher-CDeCV8F-.js +0 -52
- package/dist/client/EodashMapBtns-CktQCfa-.js +0 -131
- package/dist/client/MobileLayout-CRsg_5Q4.js +0 -1217
- package/dist/client/ProcessList-DTefwQZx.js +0 -484
- package/dist/client/asWebComponent-CLhcT715.js +0 -12479
- package/dist/client/eo-dash.css +0 -5
- package/dist/client/forwardRefs-Bon_Kku1.js +0 -245
- package/dist/client/index-Bm9cbtx5.js +0 -201
- package/dist/client/index-DiGDvTQU.js +0 -780
- package/dist/client/transition-C5I57hn6.js +0 -37
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/widgets/EodashMapBtns.vue +0 -113
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ npm run build -- --lib
|
|
|
43
43
|
.
|
|
44
44
|
├── core # CLI & Client source code
|
|
45
45
|
├── docs # Documentation files
|
|
46
|
+
├── templates # Base configurations and eodash templates
|
|
46
47
|
├── tests # CLI & Client component tests folder
|
|
47
48
|
├── widgets # Vue components as internal widgets.
|
|
48
49
|
├── public # Statically served directory
|
package/core/client/App.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-app>
|
|
2
|
+
<v-app class="fill-height">
|
|
3
3
|
<Suspense>
|
|
4
4
|
<Dashboard :is-web-component="isWebComponent" :config="config" />
|
|
5
5
|
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
<script setup>
|
|
14
14
|
import Dashboard from "@/views/Dashboard.vue";
|
|
15
15
|
import ErrorAlert from "./components/ErrorAlert.vue";
|
|
16
|
+
import { provideEodashInstance, useAdoptStyles } from "@/composables";
|
|
16
17
|
import { onErrorCaptured, ref } from "vue";
|
|
17
18
|
|
|
18
19
|
defineProps({
|
|
19
20
|
config: {
|
|
20
|
-
type: String,
|
|
21
|
+
type: [String, Function],
|
|
21
22
|
required: false,
|
|
22
23
|
default: undefined,
|
|
23
24
|
},
|
|
@@ -35,4 +36,9 @@ onErrorCaptured((e, inst, info) => {
|
|
|
35
36
|
info: ${info}.
|
|
36
37
|
`;
|
|
37
38
|
});
|
|
39
|
+
provideEodashInstance();
|
|
40
|
+
if (isWebComponent) {
|
|
41
|
+
// Adopt styles into the shadowRoot when running as web component
|
|
42
|
+
useAdoptStyles();
|
|
43
|
+
}
|
|
38
44
|
</script>
|
|
@@ -5,17 +5,17 @@ import { registerPlugins } from "./plugins";
|
|
|
5
5
|
* @type {import("vue").VueElementConstructor<
|
|
6
6
|
* import("vue").ExtractPropTypes<{ config: string }>>}
|
|
7
7
|
* */
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const EodashConstructor = defineCustomElement(App, {
|
|
9
|
+
//styles will be imported here using vite-plugin-vue-custom-element-style-injector
|
|
10
|
+
shadowRoot: !import.meta.env.DEV,
|
|
10
11
|
configureApp(app) {
|
|
11
12
|
registerPlugins(app);
|
|
12
13
|
},
|
|
13
14
|
});
|
|
14
|
-
|
|
15
|
-
export function register() {
|
|
15
|
+
function register() {
|
|
16
16
|
customElements.define("eo-dash", EodashConstructor);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { default as store } from "@/store";
|
|
20
|
-
|
|
20
|
+
export { register, EodashConstructor };
|
|
21
21
|
register();
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-main>
|
|
3
|
-
<eox-layout
|
|
2
|
+
<v-main class="pa-0">
|
|
3
|
+
<eox-layout
|
|
4
|
+
:mediaBreakpoints="[0, 960, 1920]"
|
|
5
|
+
:gap="gap"
|
|
6
|
+
class="layout-container"
|
|
7
|
+
:style="layoutStyle"
|
|
8
|
+
>
|
|
4
9
|
<eox-layout-item
|
|
5
10
|
v-if="bgWidget?.component"
|
|
6
11
|
:key="bgWidget.id"
|
|
7
|
-
class="bg-panel
|
|
12
|
+
class="bg-panel"
|
|
8
13
|
:style="`margin: -${gap + 1}px;`"
|
|
9
14
|
x="0"
|
|
10
15
|
y="0"
|
|
@@ -25,18 +30,20 @@
|
|
|
25
30
|
:id="importedWidget.value.id.toString()"
|
|
26
31
|
v-if="importedWidget.value.component"
|
|
27
32
|
:key="importedWidget.value.id"
|
|
28
|
-
class="panel
|
|
33
|
+
class="panel"
|
|
29
34
|
:h="importedWidget.value.layout.h"
|
|
30
35
|
:w="importedWidget.value.layout.w"
|
|
31
36
|
:x="importedWidget.value.layout.x"
|
|
32
37
|
:y="importedWidget.value.layout.y"
|
|
33
38
|
>
|
|
34
39
|
<Suspense>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
<div class="bg-surface pointer">
|
|
41
|
+
<component
|
|
42
|
+
:key="importedWidget.value.id"
|
|
43
|
+
:is="importedWidget.value.component"
|
|
44
|
+
v-bind="importedWidget.value.props"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
40
47
|
</Suspense>
|
|
41
48
|
</eox-layout-item>
|
|
42
49
|
</Transition>
|
|
@@ -49,12 +56,22 @@ import "@eox/layout";
|
|
|
49
56
|
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
50
57
|
|
|
51
58
|
const { bgWidget, importedWidgets, gap } = useDefineTemplate();
|
|
59
|
+
|
|
60
|
+
const layoutStyle = {
|
|
61
|
+
padding: gap.value + "px",
|
|
62
|
+
overflow: "hidden !important",
|
|
63
|
+
};
|
|
52
64
|
</script>
|
|
53
65
|
<style scoped>
|
|
54
66
|
.panel {
|
|
55
67
|
position: relative;
|
|
56
|
-
overflow:
|
|
68
|
+
overflow: auto;
|
|
57
69
|
z-index: 1;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.pointer {
|
|
74
|
+
pointer-events: all;
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
.bg-panel {
|
|
@@ -71,30 +88,30 @@ const { bgWidget, importedWidgets, gap } = useDefineTemplate();
|
|
|
71
88
|
.fade-leave-to {
|
|
72
89
|
opacity: 0;
|
|
73
90
|
}
|
|
74
|
-
|
|
75
|
-
|
|
91
|
+
.bg-surface,
|
|
92
|
+
.bg-primary {
|
|
93
|
+
backdrop-filter: blur(10px) !important;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
border: none;
|
|
96
|
+
box-shadow:
|
|
97
|
+
0px 0px 1px rgba(24, 39, 75, 0.22),
|
|
98
|
+
0px 6px 12px -6px rgba(24, 39, 75, 0.12),
|
|
99
|
+
0px 8px 24px -4px rgba(24, 39, 75, 0.08);
|
|
100
|
+
max-height: 100%;
|
|
101
|
+
overflow: auto;
|
|
102
|
+
scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
|
|
103
|
+
scrollbar-width: thin;
|
|
104
|
+
}
|
|
105
|
+
.bg-surface {
|
|
76
106
|
background-color: rgba(
|
|
77
107
|
var(--v-theme-surface),
|
|
78
108
|
var(--v-surface-opacity, 0.8)
|
|
79
109
|
) !important;
|
|
80
|
-
border-radius: 4px;
|
|
81
|
-
border-style: solid;
|
|
82
|
-
border-width: 1px;
|
|
83
|
-
border-color: rgb(var(--v-theme-surface));
|
|
84
|
-
scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
|
|
85
|
-
scrollbar-width: thin;
|
|
86
110
|
}
|
|
87
|
-
|
|
88
|
-
backdrop-filter: blur(9.5px) !important;
|
|
111
|
+
.bg-primary {
|
|
89
112
|
background-color: rgba(
|
|
90
113
|
var(--v-theme-primary),
|
|
91
114
|
var(--v-primary-opacity, 0.8)
|
|
92
115
|
) !important;
|
|
93
|
-
border-radius: 4px;
|
|
94
|
-
border-style: solid;
|
|
95
|
-
border-width: 1px;
|
|
96
|
-
border-color: rgb(var(--v-theme-primary));
|
|
97
|
-
scrollbar-color: rgba(var(--v-theme-on-primary), 0.2) transparent;
|
|
98
|
-
scrollbar-width: thin;
|
|
99
116
|
}
|
|
100
117
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="eodash-overlay"
|
|
2
|
+
<div class="eodash-overlay">
|
|
3
3
|
<p>
|
|
4
4
|
<a href="https://github.com/eodash/eodash" target="_blank"
|
|
5
5
|
>eodash v{{ version }}</a
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
<script setup>
|
|
15
|
-
import { useTheme } from "vuetify
|
|
15
|
+
import { useTheme } from "vuetify";
|
|
16
16
|
import pkgJson from "../../../package.json";
|
|
17
17
|
const { computedThemes } = useTheme();
|
|
18
18
|
|
|
@@ -41,10 +41,9 @@ const base64Logo = btoa(eoxLogo);
|
|
|
41
41
|
z-index: 9999;
|
|
42
42
|
pointer-events: none;
|
|
43
43
|
p {
|
|
44
|
-
position:
|
|
45
|
-
bottom:
|
|
46
|
-
left:
|
|
47
|
-
transform: translate(-50%, -50%);
|
|
44
|
+
position: fixed;
|
|
45
|
+
bottom: 6px;
|
|
46
|
+
left: 24px;
|
|
48
47
|
color: rgba(var(--v-theme-on-secondary), 1);
|
|
49
48
|
}
|
|
50
49
|
a {
|
|
@@ -25,9 +25,9 @@ import { mdiClose, mdiAlertCircle } from "@mdi/js";
|
|
|
25
25
|
import { inject } from "vue";
|
|
26
26
|
|
|
27
27
|
const error = defineModel({ type: String, required: true });
|
|
28
|
-
const eodash =
|
|
28
|
+
const eodash = inject(eodashKey);
|
|
29
29
|
const errorMessage =
|
|
30
|
-
eodash
|
|
30
|
+
eodash?.brand?.errorMessage ?? "something went wrong, please try again later";
|
|
31
31
|
</script>
|
|
32
32
|
<style scoped>
|
|
33
33
|
.alert {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
class="d-flex justify-end"
|
|
8
8
|
>
|
|
9
9
|
<p class="pt-0 footer-text">
|
|
10
|
-
{{ eodash
|
|
10
|
+
{{ eodash?.brand.footerText ?? "" }}
|
|
11
11
|
</p>
|
|
12
12
|
</v-footer>
|
|
13
13
|
</template>
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
import { eodashKey } from "@/utils/keys";
|
|
16
16
|
import { ref } from "vue";
|
|
17
17
|
import { inject } from "vue";
|
|
18
|
-
import { useDisplay } from "vuetify
|
|
18
|
+
import { useDisplay } from "vuetify";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Footer template ref
|
|
22
22
|
*
|
|
23
23
|
* @type {import("vue").Ref<
|
|
24
|
-
* import("vuetify/
|
|
24
|
+
* import("vuetify/components").VFooter | null
|
|
25
25
|
* >}
|
|
26
26
|
*/
|
|
27
27
|
const footer = ref(null);
|
|
28
|
-
const eodash =
|
|
28
|
+
const eodash = inject(eodashKey);
|
|
29
29
|
|
|
30
30
|
const { mdAndDown } = useDisplay();
|
|
31
31
|
</script>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-app-bar color="primary">
|
|
3
3
|
<v-app-bar-title class="header">{{ title }}</v-app-bar-title>
|
|
4
|
-
<v-img class="mx-12 logo" :src="eodash
|
|
4
|
+
<v-img class="mx-12 logo" :src="eodash?.brand?.logo" />
|
|
5
5
|
</v-app-bar>
|
|
6
6
|
</template>
|
|
7
7
|
<script setup>
|
|
8
8
|
import { eodashKey } from "@/utils/keys";
|
|
9
9
|
import { inject } from "vue";
|
|
10
10
|
|
|
11
|
-
const eodash =
|
|
11
|
+
const eodash = inject(eodashKey);
|
|
12
12
|
|
|
13
|
-
const title = eodash
|
|
13
|
+
const title = eodash?.brand?.name;
|
|
14
14
|
</script>
|
|
15
15
|
<style scoped>
|
|
16
16
|
.logo {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-main class="overflow-hidden
|
|
2
|
+
<v-main class="overflow-hidden pa-0">
|
|
3
3
|
<Suspense suspensible>
|
|
4
4
|
<component
|
|
5
5
|
id="bg-widget"
|
|
@@ -18,12 +18,23 @@
|
|
|
18
18
|
class="pa-2 panel bg-surface"
|
|
19
19
|
>
|
|
20
20
|
<div class="d-flex py-2 justify-end align-end">
|
|
21
|
-
<
|
|
22
|
-
|
|
21
|
+
<button
|
|
22
|
+
class="circle small transparent close-btn"
|
|
23
|
+
@click="activeIdx = -1"
|
|
23
24
|
>
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
26
|
+
<title>close</title>
|
|
27
|
+
<path
|
|
28
|
+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
|
29
|
+
/>
|
|
30
|
+
</svg>
|
|
31
|
+
</button>
|
|
24
32
|
</div>
|
|
25
33
|
<Suspense suspensible>
|
|
26
|
-
<div
|
|
34
|
+
<div
|
|
35
|
+
class="d-flex flex-column justify-center component-container"
|
|
36
|
+
v-show="activeIdx === idx"
|
|
37
|
+
>
|
|
27
38
|
<component
|
|
28
39
|
:key="importedWidget.value.id"
|
|
29
40
|
:is="importedWidget.value.component"
|
|
@@ -34,20 +45,17 @@
|
|
|
34
45
|
</div>
|
|
35
46
|
</template>
|
|
36
47
|
|
|
37
|
-
<
|
|
38
|
-
ref="tabs"
|
|
39
|
-
align-tabs="center"
|
|
40
|
-
bg-color="surface"
|
|
41
|
-
class="tabs"
|
|
42
|
-
show-arrows
|
|
43
|
-
v-model="activeIdx"
|
|
44
|
-
>
|
|
48
|
+
<nav class="tabbed tabs">
|
|
45
49
|
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
<a
|
|
51
|
+
v-if="importedWidget.value.component"
|
|
52
|
+
:class="{ active: activeIdx === idx }"
|
|
53
|
+
@click="activeIdx = activeIdx === idx ? -1 : idx"
|
|
54
|
+
>
|
|
55
|
+
<span>{{ importedWidget.value.title }}</span>
|
|
56
|
+
</a>
|
|
49
57
|
</template>
|
|
50
|
-
</
|
|
58
|
+
</nav>
|
|
51
59
|
</v-main>
|
|
52
60
|
</template>
|
|
53
61
|
<script setup>
|
|
@@ -60,8 +68,6 @@ const { mainRect } = useLayout();
|
|
|
60
68
|
|
|
61
69
|
const activeIdx = ref(-1);
|
|
62
70
|
|
|
63
|
-
/** @type {import("vue").Ref<import("vuetify/components").VTabs | null>} */
|
|
64
|
-
const tabs = ref(null);
|
|
65
71
|
const tabsHeightFromBtm = ref("");
|
|
66
72
|
const mainRectTopPx = ref("");
|
|
67
73
|
const mainRectBtmPx = ref("");
|
|
@@ -69,23 +75,30 @@ const mainRectBtmPx = ref("");
|
|
|
69
75
|
onMounted(() => {
|
|
70
76
|
mainRectTopPx.value = mainRect.value.top + "px";
|
|
71
77
|
mainRectBtmPx.value = (mainRect.value.bottom || 48) + "px";
|
|
72
|
-
tabsHeightFromBtm.value =
|
|
73
|
-
mainRect.value.bottom + (tabs.value?.$el?.clientHeight ?? 0) + "px";
|
|
78
|
+
tabsHeightFromBtm.value = mainRect.value.bottom + 48 + 32 + "px"; // 48px nav height + 32px bottom offset
|
|
74
79
|
});
|
|
75
80
|
</script>
|
|
76
81
|
<style scoped>
|
|
77
|
-
.
|
|
78
|
-
|
|
82
|
+
@import url("@eox/ui/style.css");
|
|
83
|
+
|
|
84
|
+
#bg-widget {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
bottom: 0;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
.panel {
|
|
82
|
-
top: v-bind("mainRectTopPx");
|
|
83
95
|
bottom: v-bind("tabsHeightFromBtm");
|
|
96
|
+
top: v-bind("mainRectTopPx");
|
|
84
97
|
position: absolute;
|
|
85
98
|
overflow: hidden;
|
|
86
99
|
width: 100%;
|
|
87
100
|
left: 0;
|
|
88
|
-
z-index:
|
|
101
|
+
z-index: 3;
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
.component-container {
|
|
@@ -98,12 +111,19 @@ onMounted(() => {
|
|
|
98
111
|
}
|
|
99
112
|
|
|
100
113
|
.tabs {
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
position: fixed;
|
|
115
|
+
bottom: 32px;
|
|
116
|
+
left: 12px;
|
|
117
|
+
right: 12px;
|
|
118
|
+
width: calc(100% - 24px);
|
|
119
|
+
height: 48px;
|
|
103
120
|
z-index: 10;
|
|
121
|
+
background: white;
|
|
122
|
+
border-radius: 24px;
|
|
123
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
104
124
|
}
|
|
105
125
|
:deep(.bg-surface) {
|
|
106
|
-
backdrop-filter: blur(
|
|
126
|
+
backdrop-filter: blur(10px) !important;
|
|
107
127
|
background-color: rgba(
|
|
108
128
|
var(--v-theme-surface),
|
|
109
129
|
var(--v-surface-opacity, 0.8)
|
|
@@ -1,72 +1,67 @@
|
|
|
1
1
|
import store from "@/store";
|
|
2
2
|
import { eodashKey } from "@/utils/keys";
|
|
3
|
-
import { inject } from "vue";
|
|
3
|
+
import { inject, reactive } from "vue";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Handles importing user defined instance of Eodash
|
|
7
7
|
*
|
|
8
8
|
* @async
|
|
9
|
-
* @param {string | undefined} runtimeConfig
|
|
10
|
-
* @returns {Promise<import("@/types").Eodash>}
|
|
9
|
+
* @param {string | undefined| (()=> Promise<import("@/types").Eodash>) | Function} runtimeConfig
|
|
10
|
+
* @returns {Promise<import("@/types").Eodash | null | undefined>}
|
|
11
11
|
* @see {@linkplain '@/eodash.js'}
|
|
12
12
|
*/
|
|
13
13
|
export const useEodashRuntime = async (runtimeConfig) => {
|
|
14
|
+
let eodashConfig;
|
|
14
15
|
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
15
|
-
/** @param {import("@/types").Eodash} config */
|
|
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
|
-
}
|
|
28
|
-
/** @type {(keyof import("@/types").Eodash)[]} */ (
|
|
29
|
-
Object.keys(eodash)
|
|
30
|
-
).forEach((key) => {
|
|
31
|
-
//@ts-expect-error to do
|
|
32
|
-
eodash[key] = config[key];
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
16
|
|
|
36
17
|
if (runtimeConfig) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
await
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
)
|
|
44
|
-
|
|
18
|
+
eodashConfig =
|
|
19
|
+
typeof runtimeConfig === "function"
|
|
20
|
+
? await runtimeConfig()
|
|
21
|
+
: await import(
|
|
22
|
+
/* @vite-ignore */ new URL(runtimeConfig, import.meta.url).href
|
|
23
|
+
).then(async (m) => await m["default"]);
|
|
24
|
+
if (!eodashConfig) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
"No dashboard configuration defined in the runtime config:" +
|
|
27
|
+
runtimeConfig,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
Object.assign(eodash, eodashConfig);
|
|
31
|
+
return reactive(eodashConfig);
|
|
45
32
|
}
|
|
46
33
|
|
|
34
|
+
async function importUserConfig() {
|
|
35
|
+
/* global __userConfigExist__:readonly */
|
|
36
|
+
// injected by vite
|
|
37
|
+
if (__userConfigExist__) {
|
|
38
|
+
return import("user:config").then(async (m) => await m["default"]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
47
41
|
try {
|
|
48
42
|
const configJs = "/config.js";
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
43
|
+
eodashConfig = await import(
|
|
44
|
+
/* @vite-ignore */ new URL(configJs, import.meta.url).href
|
|
45
|
+
).then(async (m) => await m["default"]);
|
|
46
|
+
if (!eodashConfig) {
|
|
47
|
+
eodashConfig = await importUserConfig();
|
|
48
|
+
}
|
|
53
49
|
} catch {
|
|
54
50
|
try {
|
|
55
|
-
|
|
56
|
-
await import("user:config").then(async (m) => await m["default"]),
|
|
57
|
-
);
|
|
51
|
+
eodashConfig = await importUserConfig();
|
|
58
52
|
} catch {
|
|
59
53
|
console.error("no dashboard configuration defined");
|
|
54
|
+
eodashConfig = null;
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
|
-
|
|
57
|
+
Object.assign(eodash, eodashConfig);
|
|
58
|
+
return reactive(eodash);
|
|
63
59
|
};
|
|
64
60
|
|
|
65
61
|
/**
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* | import("@/types").Eodash} config
|
|
62
|
+
* @template {import("@/types").Eodash} T
|
|
63
|
+
* @param {T | ((store: typeof import("@/store").default) => Promise<T>)} config
|
|
64
|
+
* @returns {Promise<T>}
|
|
70
65
|
*/
|
|
71
66
|
export const createEodash = async (config) => {
|
|
72
67
|
if (config instanceof Function) {
|
|
@@ -15,7 +15,7 @@ import log from "loglevel";
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
const useTemplate = () => {
|
|
18
|
-
const eodash =
|
|
18
|
+
const eodash = inject(eodashKey);
|
|
19
19
|
|
|
20
20
|
/** @type {DefinedTemplate} */
|
|
21
21
|
const definedTemplate = shallowReactive({
|
|
@@ -24,7 +24,9 @@ const useTemplate = () => {
|
|
|
24
24
|
loading: shallowRef(null),
|
|
25
25
|
gap: ref(16),
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
if (!eodash) {
|
|
28
|
+
return definedTemplate;
|
|
29
|
+
}
|
|
28
30
|
if ("template" in eodash) {
|
|
29
31
|
[definedTemplate.bgWidget] = useDefineWidgets([eodash.template.background]);
|
|
30
32
|
[definedTemplate.loading] = useDefineWidgets([eodash.template.loading]);
|
|
@@ -8,7 +8,7 @@ import { storeToRefs } from "pinia";
|
|
|
8
8
|
* props: Record<string, unknown>;
|
|
9
9
|
* title: string;
|
|
10
10
|
* id: string | number | symbol;
|
|
11
|
-
* layout: { x: number; y: number; h: number; w: number };
|
|
11
|
+
* layout: { x: number | string; y: number | string; h: number | string; w: number | string };
|
|
12
12
|
* }} DefinedWidget
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -69,19 +69,19 @@ export const useDefineWidgets = (widgetConfigs) => {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
if ("defineWidget" in (config ?? {})) {
|
|
72
|
-
const { selectedStac } = storeToRefs(useSTAcStore());
|
|
72
|
+
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
73
73
|
watch(
|
|
74
|
-
selectedStac,
|
|
75
|
-
(updatedStac) => {
|
|
74
|
+
[selectedStac, selectedCompareStac],
|
|
75
|
+
([updatedStac, updatedCompareStac]) => {
|
|
76
76
|
let definedConfig =
|
|
77
77
|
/** @type {import("@/types").FunctionalWidget} */ (
|
|
78
78
|
config
|
|
79
|
-
)?.defineWidget(updatedStac);
|
|
79
|
+
)?.defineWidget(updatedStac, updatedCompareStac);
|
|
80
80
|
if (definedConfig) {
|
|
81
81
|
definedConfig = reactive(definedConfig);
|
|
82
82
|
}
|
|
83
83
|
definedWidget.value =
|
|
84
|
-
definedWidget.value.id === definedConfig
|
|
84
|
+
definedConfig && definedWidget.value.id === definedConfig.id
|
|
85
85
|
? definedWidget.value
|
|
86
86
|
: getWidgetDefinition(definedConfig);
|
|
87
87
|
},
|
|
@@ -103,7 +103,9 @@ export const useDefineWidgets = (widgetConfigs) => {
|
|
|
103
103
|
* @param {import("@/types").StaticWidget
|
|
104
104
|
* | Omit<import("@/types").StaticWidget, "layout">
|
|
105
105
|
* | undefined
|
|
106
|
-
* | null
|
|
106
|
+
* | null
|
|
107
|
+
* | false
|
|
108
|
+
* } [config]
|
|
107
109
|
* @returns {DefinedWidget}
|
|
108
110
|
*/
|
|
109
111
|
const getWidgetDefinition = (config) => {
|
|
@@ -115,7 +117,11 @@ const getWidgetDefinition = (config) => {
|
|
|
115
117
|
id: Symbol(),
|
|
116
118
|
layout: reactive({ x: 0, y: 0, h: 0, w: 0 }),
|
|
117
119
|
};
|
|
118
|
-
|
|
120
|
+
if (!config) {
|
|
121
|
+
return importedWidget;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
switch (config.type) {
|
|
119
125
|
case "internal":
|
|
120
126
|
importedWidget.component = defineAsyncComponent({
|
|
121
127
|
loader: () => {
|