@eodash/eodash 5.0.0-alpha.2.4 → 5.0.0-alpha.2.6
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 +31 -7
- package/core/client/App.vue +6 -7
- package/core/client/SuspensedDashboard.ce.vue +59 -45
- package/core/client/asWebComponent.d.ts +10 -5
- package/core/client/asWebComponent.js +6 -6
- package/core/client/components/DashboardLayout.vue +63 -21
- package/core/client/components/DynamicWebComponent.vue +44 -44
- package/core/client/components/ErrorAlert.vue +24 -7
- package/core/client/components/Footer.vue +34 -15
- package/core/client/components/Header.vue +10 -5
- package/core/client/components/IframeWrapper.vue +4 -4
- package/core/client/components/Loading.vue +17 -18
- package/core/client/components/MobileLayout.vue +82 -29
- package/core/client/composables/DefineEodash.js +38 -28
- package/core/client/composables/DefineWidgets.js +105 -79
- package/core/client/composables/index.js +43 -141
- package/core/client/eodash.js +46 -39
- package/core/client/main.js +2 -2
- package/core/client/plugins/index.js +11 -9
- package/core/client/plugins/vuetify.js +9 -10
- package/core/client/render.js +4 -5
- package/core/client/store/States.js +8 -13
- package/core/client/store/index.js +14 -11
- package/core/client/store/stac.js +51 -37
- package/core/client/types.d.ts +173 -248
- package/core/client/utils/eodashSTAC.js +151 -66
- package/core/client/utils/helpers.js +18 -20
- package/core/client/utils/index.js +25 -14
- package/core/client/utils/keys.js +2 -2
- package/core/client/views/Dashboard.vue +70 -42
- package/core/client/vite-env.d.ts +19 -17
- package/dist/client/DashboardLayout-BuDcv6LM.js +156 -0
- package/dist/client/{DynamicWebComponent-C4Hotc4H.js → DynamicWebComponent-BEP4rVce.js} +7 -7
- package/dist/client/EodashDatePicker-oFb1zt5E.js +1211 -0
- package/dist/client/EodashItemFilter-BElmgrST.js +63 -0
- package/dist/client/{EodashMap-CGrQjZ1P.js → EodashMap-DXyOgcEd.js} +11333 -14025
- package/dist/client/Footer-CoPx6UXQ.js +115 -0
- package/dist/client/Header-C-zX31Ys.js +635 -0
- package/dist/client/{IframeWrapper-Cg3GMmfW.js → IframeWrapper-2w2ye0zM.js} +4 -4
- package/dist/client/MobileLayout-C9OVcP12.js +945 -0
- package/dist/client/{VMain-BHYlmRic.js → VMain-Dm43jd43.js} +8 -8
- package/dist/client/{WidgetsContainer-dje9QSk0.js → WidgetsContainer-BS87sLqk.js} +12 -5
- package/dist/client/asWebComponent-CpQUVi2N.js +20135 -0
- package/dist/client/{basedecoder-Qm25PwVp-CHo5Pomv.js → basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
- package/dist/client/{decoder-HRvnjnEI-BQ2rajuJ.js → decoder-CP4lv0Kb-BHrv68IA.js} +1 -1
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
- package/dist/client/eo-dash.js +3 -3
- package/dist/client/eodashSTAC-Q7kbX1Gy.js +2788 -0
- package/dist/client/{eox-itemfilter-DcQkRD2l.js → eox-itemfilter-TaBxgqq_.js} +1002 -974
- package/dist/client/{eox-map-C3DL31fp.js → eox-map-L7abwKTR.js} +5677 -5695
- package/dist/client/forwardRefs-BVFQ82G4.js +183 -0
- package/dist/client/{index-CaDDfJYE.js → index-dOzyv_xR.js} +43 -74
- package/dist/client/{jpeg-DNfUpLwy-Fjan-04T.js → jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
- package/dist/client/{lerc-_E46UbWQ-Beu35ovS.js → lerc-DzVumYtB-rm1Xco54.js} +5 -7
- package/dist/client/{lzw-BOMhmEDy-Dboc93VO.js → lzw-LAGDNbSC-DkP96qO9.js} +1 -1
- package/dist/client/{packbits-DaUD6MLm-Bu1PoTGa.js → packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
- package/dist/client/{pako.esm-C3kYPGGQ-BMki8cQY.js → pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
- package/dist/client/{raw-CcGKjn8q-DFOt-i8n.js → raw-CMGvRjfu-BRi6E4i1.js} +1 -1
- package/dist/client/{ssrBoot-Dd7m-btU.js → ssrBoot-L9KejErM.js} +3 -3
- package/dist/client/style.css +2 -2
- package/dist/client/transition-DCePIwYR.js +34 -0
- package/dist/client/{webfontloader-CyOFAuFB.js → webfontloader-qotgY98I.js} +56 -92
- package/dist/client/{webimage-D2c098k3-DLj1LQxB.js → webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
- package/dist/node/cli.js +3 -3
- package/dist/node/types.d.ts +32 -38
- package/package.json +13 -14
- package/widgets/EodashDatePicker.vue +145 -41
- package/widgets/EodashItemFilter.vue +41 -22
- package/widgets/EodashMap.vue +87 -20
- package/widgets/WidgetsContainer.vue +45 -27
- package/dist/client/DashboardLayout-ZaSRMD1M.js +0 -149
- package/dist/client/EodashDatePicker-C4kKjxKy.js +0 -1653
- package/dist/client/EodashItemFilter-cBHC0YEM.js +0 -51
- package/dist/client/Footer-pS636dEP.js +0 -118
- package/dist/client/Header-DQuaLdjl.js +0 -605
- package/dist/client/MobileLayout-BLXFBWI_.js +0 -987
- package/dist/client/asWebComponent-Bvb3xkxI.js +0 -13311
- package/dist/client/deflate-Be2Arps5-hDqMz3RA.js +0 -10
- package/dist/client/forwardRefs-Bxeu9Obx.js +0 -142
- package/dist/client/index-DlNICb3T.js +0 -34
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// functions of this folder can only be consumed inside setup stores,
|
|
2
2
|
// setup functions or vue composition api components
|
|
3
3
|
|
|
4
|
-
import { reactive } from "vue";
|
|
5
4
|
import { currentUrl, indicator, mapPosition } from "@/store/States";
|
|
6
5
|
import eodash from "@/eodash";
|
|
7
6
|
import { useTheme } from "vuetify/lib/framework.mjs";
|
|
8
7
|
import { onMounted, watch } from "vue";
|
|
9
|
-
import {
|
|
8
|
+
import { useSTAcStore } from "@/store/stac";
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Creates an absolute URL from a relative link and assignes it to `currentUrl`
|
|
13
|
-
*
|
|
14
|
-
* @param {string} [
|
|
15
|
-
* @
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [rel=''] Default is `''`
|
|
14
|
+
* @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
|
|
15
|
+
* root stac catalog. Default is `eodash.stacEndpoint`
|
|
16
|
+
* @returns {import("vue").Ref<string>} - Returns `currentUrl`
|
|
16
17
|
* @see {@link '@/store/States.js'}
|
|
17
18
|
*/
|
|
18
19
|
export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
@@ -36,126 +37,18 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
export const useSlidePanels = (elements, configs) => {
|
|
44
|
-
/**
|
|
45
|
-
* Sliding direction
|
|
46
|
-
*/
|
|
47
|
-
const slideDirs = configs.map((m) =>
|
|
48
|
-
m.layout.x == 0
|
|
49
|
-
? "left"
|
|
50
|
-
: m.layout.x == 12 - m.layout.w
|
|
51
|
-
? "right"
|
|
52
|
-
: m.layout.y < 6
|
|
53
|
-
? "up"
|
|
54
|
-
: "down"
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Array of sliding button's style and icons
|
|
59
|
-
*/
|
|
60
|
-
const slideBtns = slideDirs.map((dir, _idx) => {
|
|
61
|
-
const btn = reactive({
|
|
62
|
-
style: {},
|
|
63
|
-
icon: { in: "", out: "" },
|
|
64
|
-
active: false,
|
|
65
|
-
enabled: true,
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// temp removal of `slidable` from the widgets API
|
|
69
|
-
// if (configs[idx].slidable === false) {
|
|
70
|
-
// btn.enabled = false;
|
|
71
|
-
// return btn;
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
switch (dir) {
|
|
75
|
-
case "left":
|
|
76
|
-
btn.style = { top: "50%", right: "-11%" };
|
|
77
|
-
btn.icon.in = mdiChevronDoubleRight
|
|
78
|
-
btn.icon.out = mdiChevronDoubleLeft
|
|
79
|
-
|
|
80
|
-
break;
|
|
81
|
-
case "right":
|
|
82
|
-
btn.style = { top: "50%", left: "-11%" };
|
|
83
|
-
btn.icon.in = mdiChevronDoubleLeft
|
|
84
|
-
btn.icon.out = mdiChevronDoubleRight
|
|
85
|
-
|
|
86
|
-
break;
|
|
87
|
-
case "up":
|
|
88
|
-
btn.style = { right: "50%", bottom: "-17%" };
|
|
89
|
-
btn.icon.in = mdiChevronDoubleDown
|
|
90
|
-
btn.icon.out = mdiChevronDoubleUp
|
|
91
|
-
|
|
92
|
-
break;
|
|
93
|
-
case "down":
|
|
94
|
-
btn.style = { right: "50%", top: "-17%" };
|
|
95
|
-
btn.icon.in = mdiChevronDoubleUp
|
|
96
|
-
btn.icon.out = mdiChevronDoubleDown
|
|
97
|
-
break;
|
|
98
|
-
|
|
99
|
-
default:
|
|
100
|
-
console.error("sliding error");
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
return btn;
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Transforms the element's position based on the direction
|
|
108
|
-
* @param {number} idx - index of the pressed element
|
|
109
|
-
*/
|
|
110
|
-
const slideInOut = (idx) => {
|
|
111
|
-
const parentStyle = /** @type {CSSStyleDeclaration} */ (
|
|
112
|
-
elements.value?.[idx].style
|
|
113
|
-
);
|
|
114
|
-
if (parentStyle?.transform.length) {
|
|
115
|
-
slideBtns[idx].active = false;
|
|
116
|
-
parentStyle.transform = "";
|
|
117
|
-
} else {
|
|
118
|
-
slideBtns[idx].active = true;
|
|
119
|
-
parentStyle.transition = "transform 0.3s ease-in-out";
|
|
120
|
-
switch (slideDirs[idx]) {
|
|
121
|
-
case "left":
|
|
122
|
-
parentStyle.transform = "translateX(-100%)";
|
|
123
|
-
break;
|
|
124
|
-
case "right":
|
|
125
|
-
parentStyle.transform = "translateX(100%)";
|
|
126
|
-
break;
|
|
127
|
-
case "up":
|
|
128
|
-
parentStyle.transform = `translateY(-${(configs[idx].layout.y / configs[idx].layout.h) * 100 + 100
|
|
129
|
-
}%)`;
|
|
130
|
-
break;
|
|
131
|
-
case "down":
|
|
132
|
-
parentStyle.transform = `translateY(${(Math.max(0, 12 - configs[idx].layout.y - configs[idx].layout.h) /
|
|
133
|
-
configs[idx].layout.h) *
|
|
134
|
-
100 +
|
|
135
|
-
100
|
|
136
|
-
}%)`;
|
|
137
|
-
break;
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
console.error("sliding error");
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
return { slideBtns, slideInOut };
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Updates an existing Vuetify theme.
|
|
150
|
-
* updates only the values provided in the `ThemeDefinition`
|
|
40
|
+
* Updates an existing Vuetify theme. updates only the values provided in the
|
|
41
|
+
* `ThemeDefinition`
|
|
42
|
+
*
|
|
151
43
|
* @param {string} themeName - Name of the theme to be updated
|
|
152
|
-
* @param {import(
|
|
153
|
-
*
|
|
44
|
+
* @param {import("vuetify").ThemeDefinition} [themeDefinition={}] - New
|
|
45
|
+
* defintion to be updated to. Default is `{}`
|
|
46
|
+
* @returns {import("vuetify").ThemeInstance}
|
|
154
47
|
*/
|
|
155
48
|
export const useUpdateTheme = (themeName, themeDefinition = {}) => {
|
|
156
49
|
const theme = useTheme();
|
|
157
50
|
|
|
158
|
-
/** @type {
|
|
51
|
+
/** @type {(keyof import("vuetify").ThemeDefinition)[]} */ (
|
|
159
52
|
Object.keys(themeDefinition)
|
|
160
53
|
).forEach((key) => {
|
|
161
54
|
if (key === "dark") {
|
|
@@ -163,7 +56,7 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
|
|
|
163
56
|
themeDefinition[key]
|
|
164
57
|
);
|
|
165
58
|
} else {
|
|
166
|
-
//@ts-expect-error
|
|
59
|
+
//@ts-expect-error to do
|
|
167
60
|
theme.themes.value[themeName][key] = {
|
|
168
61
|
...theme.themes.value[themeName][key],
|
|
169
62
|
...themeDefinition[key],
|
|
@@ -173,50 +66,59 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
|
|
|
173
66
|
return theme;
|
|
174
67
|
};
|
|
175
68
|
|
|
176
|
-
/**
|
|
177
|
-
* Composable that syncs store and URLSearchParameters
|
|
178
|
-
*/
|
|
69
|
+
/** Composable that syncs store and URLSearchParameters */
|
|
179
70
|
|
|
180
71
|
export const useURLSearchParametersSync = () => {
|
|
181
|
-
onMounted(() => {
|
|
72
|
+
onMounted(async () => {
|
|
182
73
|
// Analyze currently set url params when first loaded and set them in the store
|
|
183
|
-
if (
|
|
74
|
+
if ("URLSearchParams" in window) {
|
|
184
75
|
const searchParams = new URLSearchParams(window.location.search);
|
|
185
|
-
|
|
186
|
-
|
|
76
|
+
/** @type {number | undefined} */
|
|
77
|
+
let x,
|
|
78
|
+
/** @type {number | undefined} */
|
|
79
|
+
y,
|
|
80
|
+
/** @type {number | undefined} */
|
|
81
|
+
z;
|
|
82
|
+
searchParams.forEach(async (value, key) => {
|
|
187
83
|
if (key === "indicator") {
|
|
188
|
-
|
|
84
|
+
const { loadSelectedSTAC, stac } = useSTAcStore();
|
|
85
|
+
const match = stac?.find((link) => link.id == value);
|
|
86
|
+
if (match) {
|
|
87
|
+
await loadSelectedSTAC(match.href);
|
|
88
|
+
}
|
|
189
89
|
}
|
|
190
90
|
if (key === "x") {
|
|
191
|
-
x = value;
|
|
91
|
+
x = Number(value);
|
|
192
92
|
}
|
|
193
93
|
if (key === "y") {
|
|
194
|
-
y = value;
|
|
94
|
+
y = Number(value);
|
|
195
95
|
}
|
|
196
96
|
if (key === "z") {
|
|
197
|
-
z = value;
|
|
97
|
+
z = Number(value);
|
|
198
98
|
}
|
|
199
|
-
})
|
|
200
|
-
if (x
|
|
99
|
+
});
|
|
100
|
+
if (x && y && z) {
|
|
201
101
|
mapPosition.value = [x, y, z];
|
|
202
102
|
}
|
|
203
103
|
}
|
|
204
104
|
watch(
|
|
205
105
|
[indicator, mapPosition],
|
|
206
106
|
([updatedIndicator, updatedMapPosition]) => {
|
|
207
|
-
if (
|
|
107
|
+
if ("URLSearchParams" in window) {
|
|
208
108
|
const searchParams = new URLSearchParams(window.location.search);
|
|
209
109
|
if (updatedIndicator !== "") {
|
|
210
110
|
searchParams.set("indicator", updatedIndicator);
|
|
211
111
|
}
|
|
212
112
|
if (updatedMapPosition && updatedMapPosition.length === 3) {
|
|
213
|
-
searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ??
|
|
214
|
-
searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ??
|
|
215
|
-
searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ??
|
|
113
|
+
searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ?? "");
|
|
114
|
+
searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ?? "");
|
|
115
|
+
searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ?? "");
|
|
216
116
|
}
|
|
217
|
-
const newRelativePathQuery =
|
|
218
|
-
|
|
117
|
+
const newRelativePathQuery =
|
|
118
|
+
window.location.pathname + "?" + searchParams.toString();
|
|
119
|
+
history.pushState(null, "", newRelativePathQuery);
|
|
219
120
|
}
|
|
220
|
-
}
|
|
121
|
+
},
|
|
122
|
+
);
|
|
221
123
|
});
|
|
222
124
|
};
|
package/core/client/eodash.js
CHANGED
|
@@ -2,19 +2,17 @@ import { reactive } from "vue";
|
|
|
2
2
|
import { currentUrl } from "./store/States";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Reactive Edoash Instance Object. provided globally in the app,
|
|
6
|
-
*
|
|
5
|
+
* Reactive Edoash Instance Object. provided globally in the app, and used as an
|
|
6
|
+
* intermediate object to make user defined instances config reactive.
|
|
7
|
+
*
|
|
7
8
|
* @type {import("./types").Eodash}
|
|
8
9
|
*/
|
|
9
10
|
export const eodash = reactive({
|
|
10
11
|
id: "demo",
|
|
11
|
-
stacEndpoint: "https://
|
|
12
|
+
stacEndpoint: "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
|
|
12
13
|
brand: {
|
|
13
14
|
noLayout: true,
|
|
14
15
|
name: "Demo",
|
|
15
|
-
font: {
|
|
16
|
-
family: "Roboto",
|
|
17
|
-
},
|
|
18
16
|
theme: {
|
|
19
17
|
colors: {
|
|
20
18
|
primary: "#fff",
|
|
@@ -36,9 +34,9 @@ export const eodash = reactive({
|
|
|
36
34
|
class: "align-self-center justify-self-center",
|
|
37
35
|
size: "120",
|
|
38
36
|
speed: "2.5",
|
|
39
|
-
color: "#004170"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
37
|
+
color: "#004170",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
42
40
|
},
|
|
43
41
|
background: {
|
|
44
42
|
id: Symbol(),
|
|
@@ -51,45 +49,54 @@ export const eodash = reactive({
|
|
|
51
49
|
{
|
|
52
50
|
id: Symbol(),
|
|
53
51
|
type: "internal",
|
|
54
|
-
title: "
|
|
55
|
-
layout: { x: 0, y: 0, w:
|
|
52
|
+
title: "Indicators",
|
|
53
|
+
layout: { x: 0, y: 0, w: 2, h: 12 },
|
|
56
54
|
widget: {
|
|
57
55
|
name: "EodashItemFilter",
|
|
58
56
|
},
|
|
59
57
|
},
|
|
60
58
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
defineWidget: (selectedSTAC) => {
|
|
60
|
+
return selectedSTAC
|
|
61
|
+
? {
|
|
62
|
+
id: "Information",
|
|
63
|
+
title: "Information",
|
|
64
|
+
layout: { x: 9, y: 0, w: 3, h: 12 },
|
|
65
|
+
type: "web-component",
|
|
66
|
+
widget: {
|
|
67
|
+
link: async () => await import("@eox/stacinfo"),
|
|
68
|
+
properties: {
|
|
69
|
+
for: currentUrl,
|
|
70
|
+
allowHtml: "true",
|
|
71
|
+
styleOverride:
|
|
72
|
+
"#properties li > .value {font-weight: normal !important;}",
|
|
73
|
+
header: "[]",
|
|
74
|
+
|
|
75
|
+
subheader: "[]",
|
|
76
|
+
properties: '["description"]',
|
|
77
|
+
featured: "[]",
|
|
78
|
+
footer: "[]",
|
|
79
|
+
},
|
|
80
|
+
tagName: "eox-stacinfo",
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
: null;
|
|
70
84
|
},
|
|
71
85
|
},
|
|
72
86
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
subheader: "[]",
|
|
86
|
-
properties: '["description"]',
|
|
87
|
-
featured: "[]",
|
|
88
|
-
footer: "[]",
|
|
89
|
-
},
|
|
90
|
-
tagName: "eox-stacinfo",
|
|
87
|
+
defineWidget: (selectedSTAC) => {
|
|
88
|
+
return selectedSTAC
|
|
89
|
+
? {
|
|
90
|
+
id: "Datepicker",
|
|
91
|
+
type: "internal",
|
|
92
|
+
layout: { x: 5, y: 10, w: 1, h: 1 },
|
|
93
|
+
title: "Datepicker",
|
|
94
|
+
widget: {
|
|
95
|
+
name: "EodashDatePicker",
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
: null;
|
|
91
99
|
},
|
|
92
|
-
type: "web-component",
|
|
93
100
|
},
|
|
94
101
|
],
|
|
95
102
|
},
|
package/core/client/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createEodash } from
|
|
2
|
-
export { default as store } from "@/store"
|
|
1
|
+
export { createEodash } from "@/composables/DefineEodash";
|
|
2
|
+
export { default as store } from "@/store";
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import vuetify from
|
|
2
|
-
import { createPinia } from
|
|
3
|
-
import eodash from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import vuetify from "./vuetify";
|
|
2
|
+
import { createPinia } from "pinia";
|
|
3
|
+
import eodash from "@/eodash";
|
|
4
|
+
import VCalendar from "v-calendar";
|
|
5
|
+
import { eodashKey } from "@/utils/keys";
|
|
6
|
+
import store from "../store";
|
|
6
7
|
|
|
7
8
|
export const pinia = createPinia();
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* @param {import('vue').App} app
|
|
11
|
-
*/
|
|
10
|
+
/** @param {import("vue").App} app */
|
|
12
11
|
export function registerPlugins(app) {
|
|
13
12
|
window.eodashStore = store;
|
|
14
13
|
|
|
15
|
-
app
|
|
14
|
+
app
|
|
15
|
+
.use(vuetify)
|
|
16
16
|
.use(pinia)
|
|
17
|
+
// Use plugin with optional defaults
|
|
18
|
+
.use(VCalendar, {})
|
|
17
19
|
.provide(eodashKey, eodash);
|
|
18
20
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Plugins/vuetify.ts
|
|
3
3
|
*
|
|
4
4
|
* Framework documentation: https://vuetifyjs.com`
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
// Styles
|
|
8
|
-
import
|
|
8
|
+
import "vuetify/styles";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import { mdiChevronLeft, mdiChevronRight, mdiMenuDown } from "@mdi/js"
|
|
10
|
+
import { createVuetify } from "vuetify";
|
|
11
|
+
import { mdiChevronLeft, mdiChevronRight, mdiMenuDown } from "@mdi/js";
|
|
13
12
|
|
|
14
13
|
const vuetify = createVuetify({
|
|
15
14
|
icons: {
|
|
@@ -17,7 +16,7 @@ const vuetify = createVuetify({
|
|
|
17
16
|
// mapping v-date-picker and v-tabs default icons to `@mdi/js`
|
|
18
17
|
next: [mdiChevronRight],
|
|
19
18
|
prev: [mdiChevronLeft],
|
|
20
|
-
subgroup: [mdiMenuDown]
|
|
19
|
+
subgroup: [mdiMenuDown],
|
|
21
20
|
},
|
|
22
21
|
},
|
|
23
22
|
theme: {
|
|
@@ -25,12 +24,12 @@ const vuetify = createVuetify({
|
|
|
25
24
|
dashboardTheme: {},
|
|
26
25
|
light: {
|
|
27
26
|
colors: {
|
|
28
|
-
primary:
|
|
29
|
-
secondary:
|
|
27
|
+
primary: "#1867C0",
|
|
28
|
+
secondary: "#5CBBF6",
|
|
30
29
|
},
|
|
31
30
|
},
|
|
32
31
|
},
|
|
33
32
|
},
|
|
34
|
-
})
|
|
33
|
+
});
|
|
35
34
|
|
|
36
|
-
export default vuetify
|
|
35
|
+
export default vuetify;
|
package/core/client/render.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { registerPlugins } from
|
|
1
|
+
import { registerPlugins } from "@/plugins";
|
|
2
2
|
// Components
|
|
3
|
-
import App from
|
|
3
|
+
import App from "./App.vue";
|
|
4
4
|
|
|
5
5
|
// Composables
|
|
6
|
-
import { createApp } from
|
|
7
|
-
|
|
6
|
+
import { createApp } from "vue";
|
|
8
7
|
|
|
9
8
|
const app = createApp(App);
|
|
10
9
|
|
|
11
10
|
registerPlugins(app);
|
|
12
11
|
|
|
13
|
-
app.mount(
|
|
12
|
+
app.mount("#app");
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export const currentUrl = ref('');
|
|
7
|
-
/**
|
|
8
|
-
* currently selected datetime
|
|
9
|
-
*/
|
|
3
|
+
/** Currently selected STAC endpoint */
|
|
4
|
+
export const currentUrl = ref("");
|
|
5
|
+
/** Currently selected datetime */
|
|
10
6
|
export const datetime = ref(new Date().toISOString());
|
|
11
7
|
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export const indicator = ref("")
|
|
8
|
+
/** Currently selected indicator */
|
|
9
|
+
export const indicator = ref("");
|
|
16
10
|
|
|
17
11
|
/**
|
|
18
12
|
* Current map position
|
|
19
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* @type {import("vue").Ref<(number | undefined)[]>}
|
|
20
15
|
*/
|
|
21
|
-
export const mapPosition = ref([])
|
|
16
|
+
export const mapPosition = ref([]);
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
//export all actions, states, and pinia stores
|
|
2
2
|
|
|
3
|
-
const storesImport = import.meta.glob(
|
|
3
|
+
const storesImport = import.meta.glob("../store/**.js", { eager: true });
|
|
4
4
|
|
|
5
|
-
const store = /** @type {import("@/types").EodashStore} */(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const store = /** @type {import("@/types").EodashStore} */ (
|
|
6
|
+
(() => {
|
|
7
|
+
const stores = {};
|
|
8
|
+
for (const [filePath, importedstore] of Object.entries(storesImport)) {
|
|
9
|
+
const storeType =
|
|
10
|
+
filePath.split("/").at(-1)?.slice(0, -3).toLowerCase() ?? "";
|
|
11
|
+
if (!["keys"].includes(storeType)) {
|
|
12
|
+
//@ts-expect-error `importedstore` cant be typed individually
|
|
13
|
+
stores[storeType] = importedstore;
|
|
14
|
+
}
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
return stores;
|
|
17
|
+
})()
|
|
18
|
+
);
|
|
16
19
|
|
|
17
20
|
export default store;
|
|
@@ -1,66 +1,80 @@
|
|
|
1
|
-
import { defineStore } from
|
|
2
|
-
import { inject, ref } from
|
|
3
|
-
import axios from
|
|
4
|
-
import { useAbsoluteUrl } from
|
|
5
|
-
import { eodashKey } from
|
|
6
|
-
import { indicator } from
|
|
1
|
+
import { defineStore } from "pinia";
|
|
2
|
+
import { inject, ref } from "vue";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { useAbsoluteUrl } from "@/composables/index";
|
|
5
|
+
import { eodashKey } from "@/utils/keys";
|
|
6
|
+
import { indicator } from "@/store/States";
|
|
7
7
|
|
|
8
|
-
export const useSTAcStore = defineStore(
|
|
8
|
+
export const useSTAcStore = defineStore("stac", () => {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Links of the root STAC catalog
|
|
11
|
+
*
|
|
12
|
+
* @type {import("vue").Ref<import("stac-ts").StacLink[] | null>}
|
|
12
13
|
*/
|
|
13
14
|
const stac = ref(null);
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Selected STAC object.
|
|
18
|
+
*
|
|
19
|
+
* @type {import("vue").Ref<
|
|
20
|
+
* | import("stac-ts").StacCatalog
|
|
21
|
+
* | import("stac-ts").StacCollection
|
|
22
|
+
* | import("stac-ts").StacItem
|
|
23
|
+
* | null
|
|
24
|
+
* >}
|
|
20
25
|
*/
|
|
21
26
|
const selectedStac = ref(null);
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey));
|
|
28
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
31
|
+
* Fetches root stac catalog and assign it to `stac`
|
|
32
|
+
*
|
|
28
33
|
* @async
|
|
29
|
-
* @param {import("@/types").StacEndpoint} [url
|
|
34
|
+
* @param {import("@/types").StacEndpoint} [url=eodash.stacEndpoint] Default
|
|
35
|
+
* is `eodash.stacEndpoint`
|
|
30
36
|
* @returns {Promise<void>}
|
|
31
37
|
* @see {@link stac}
|
|
32
38
|
*/
|
|
33
39
|
async function loadSTAC(url = eodash.stacEndpoint) {
|
|
34
|
-
await axios
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
await axios
|
|
41
|
+
.get(url)
|
|
42
|
+
.then((resp) => {
|
|
43
|
+
const links = /** @type {import("stac-ts").StacCatalog} */ (
|
|
44
|
+
resp.data
|
|
45
|
+
).links.map((link) => {
|
|
46
|
+
if (!link.title) {
|
|
47
|
+
link.title = `${link.rel} ${link.href}`;
|
|
48
|
+
}
|
|
49
|
+
return link;
|
|
50
|
+
});
|
|
51
|
+
stac.value = links;
|
|
40
52
|
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
53
|
+
.catch((err) => {
|
|
54
|
+
throw new Error("error loading assigned STAC endpoint", err);
|
|
55
|
+
});
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
/**
|
|
48
|
-
*
|
|
59
|
+
* Fetches selected stac object and assign it to `selectedStac`
|
|
60
|
+
*
|
|
49
61
|
* @async
|
|
50
|
-
* @param {string} relativePath -
|
|
62
|
+
* @param {string} relativePath - Stac link href
|
|
51
63
|
* @returns {Promise<void>}
|
|
52
64
|
* @see {@link selectedStac}
|
|
53
65
|
*/
|
|
54
|
-
async function loadSelectedSTAC(relativePath =
|
|
55
|
-
|
|
66
|
+
async function loadSelectedSTAC(relativePath = "") {
|
|
56
67
|
const absoluteUrl = useAbsoluteUrl(relativePath);
|
|
57
68
|
|
|
58
|
-
await axios
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
await axios
|
|
70
|
+
.get(absoluteUrl.value)
|
|
71
|
+
.then((resp) => {
|
|
72
|
+
selectedStac.value = resp.data;
|
|
73
|
+
indicator.value = selectedStac.value?.id ?? "";
|
|
74
|
+
})
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
throw new Error("error loading the selected STAC", err);
|
|
77
|
+
});
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
return { stac, loadSTAC, loadSelectedSTAC, selectedStac };
|