@eodash/eodash 5.0.0-alpha.2.16 → 5.0.0-alpha.2.17
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/core/client/composables/EodashMap.js +158 -107
- package/core/client/composables/index.js +13 -2
- package/core/client/eodash.js +6 -0
- package/core/client/plugins/axios.js +8 -0
- package/core/client/store/Actions.js +2 -1
- package/core/client/store/States.js +4 -0
- package/core/client/store/stac.js +11 -8
- package/core/client/utils/createLayers.js +77 -46
- package/core/client/utils/eodashSTAC.js +60 -19
- package/core/client/utils/helpers.js +94 -26
- package/dist/client/{DashboardLayout-CCtyOil0.js → DashboardLayout-BR1lU9ER.js} +2 -2
- package/dist/client/{DynamicWebComponent-But2r1Sj.js → DynamicWebComponent-7z8VFsrZ.js} +2 -2
- package/dist/client/EodashDatePicker-o7ZOYIHL.js +259 -0
- package/dist/client/EodashItemFilter-lNjVkidr.js +7651 -0
- package/dist/client/{EodashLayerControl-BhZL4pYM.js → EodashLayerControl-B0N8_XmX.js} +5162 -5035
- package/dist/client/{EodashMap-C5tOgVOv.js → EodashMap-DFT2R2Rk.js} +3575 -3545
- package/dist/client/{EodashMapBtns-CdDfVQj0.js → EodashMapBtns-CoGjVl8Y.js} +2 -2
- package/dist/client/{ExportState-CKCCN_VI.js → ExportState-Dwv37MRw.js} +133 -126
- package/dist/client/{Footer-B9yVgyzx.js → Footer-DuScuHSx.js} +63 -63
- package/dist/client/{Header-CPIlUEOq.js → Header-C4Y0u0E5.js} +70 -70
- package/dist/client/{IframeWrapper-DRw1kHJm.js → IframeWrapper-D1TfK4xH.js} +1 -1
- package/dist/client/{MobileLayout-CPxVee5U.js → MobileLayout-C-b8DIFO.js} +43 -41
- package/dist/client/{PopUp-Dca-gx9a.js → PopUp-DBMZX3l3.js} +3 -3
- package/dist/client/{VImg-PHLA1nP1.js → VImg-bAMQHnMM.js} +33 -31
- package/dist/client/VMain-Df5VMG9r.js +38 -0
- package/dist/client/VOverlay-D5GzAYRY.js +973 -0
- package/dist/client/{WidgetsContainer-jxk3kw-d.js → WidgetsContainer-yZDmY6_u.js} +1 -1
- package/dist/client/{asWebComponent-3OsFQJVx.js → asWebComponent-DhR2_xlP.js} +9844 -8985
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-BxZaq9ml.js → forwardRefs-C0MQxvur.js} +1 -1
- package/dist/client/{index-Vul961Xy.js → index-qNWeBhRh.js} +1 -1
- package/dist/client/{lerc-B4lXefGh-BESXOHWk.js → lerc-B4lXefGh-CsL-d8wY.js} +1 -1
- package/dist/client/{ssrBoot-BFMBrCqY.js → ssrBoot-Xmkz8T49.js} +1 -1
- package/dist/client/style.css +2 -2
- package/dist/client/{transition-U5aFjJtV.js → transition-DRzZPWIN.js} +1 -1
- package/dist/client/{webfontloader-D_JbBwHu.js → webfontloader-CqD-lAx-.js} +1 -1
- package/dist/node/cli.js +1 -1
- package/package.json +26 -23
- package/widgets/EodashDatePicker.vue +100 -88
- package/widgets/EodashMap.vue +20 -30
- package/widgets/ExportState.vue +4 -2
- package/dist/client/EodashDatePicker-jeYiWflv.js +0 -247
- package/dist/client/EodashItemFilter-BFlfWeE_.js +0 -10125
- package/dist/client/VMain-Ck81LJfb.js +0 -39
- package/dist/client/VOverlay-CL4hiJB8.js +0 -972
package/dist/node/cli.js
CHANGED
|
@@ -17,4 +17,4 @@ ${i.lib?`<eo-dash style="height:100dvh;"/>
|
|
|
17
17
|
<script type="module" src="${t.resolve(`/@fs/${c}`,"core/client/render.js")}"><\/script>
|
|
18
18
|
`}
|
|
19
19
|
</body>
|
|
20
|
-
</html>`,D=C(({mode:e,command:n})=>({base:i.base??"",cacheDir:z,plugins:[N({customElement:!1,template:{transformAssetUrls:A,compilerOptions:{isCustomElement:a=>!a.includes("v-")&&a.includes("-")}}}),O({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:M}],customLogger:v,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":g,"user:widgets":w},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**")]},port:i.port??3e3,open:i.open,fs:{allow:[x(process.cwd())]},host:i.host},root:c,optimizeDeps:e==="development"?{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs"],noDiscovery:!0}:{},publicDir:i.publicDir===!1?!1:R,build:{lib:i.lib&&n==="build"&&{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},outDir:f,emptyOutDir:!0,rollupOptions:i.lib&&n==="build"?{input:t.join(c,"core/client/asWebComponent.js")}:void 0,target:"esnext"}}));async function M(e){e.watcher.add([g,l,t.join(w,"**/*.vue")]);let n="";const a=v.info;return v.info=(o,r)=>{if(o.includes("core")){const d=o.split("/")[0].split(" ");d.pop();const p=d.join(" ")+" "+n.replace(s,"");return a(p,r)}return a(o,r)},e.watcher.on("change",async o=>{n=o,o===l&&e.hot.send({type:"full-reload",path:o})}),()=>{e.middlewares.use(async(o,r,d)=>{if(o.originalUrl==="/@fs/config.js"||o.originalUrl==="/config.js"){r.statusCode=200,r.setHeader("Content-Type","text/javascript"),u(l)&&await I(l).then(p=>{r.write(p)}),r.end();return}if(o.url?.endsWith(".html")){r.statusCode=200,r.setHeader("Content-Type","text/html");const p=await e.transformIndexHtml(o.url,y,o.originalUrl);r.end(p);return}d()})}}const Y=async()=>{const e=await k(await D({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},B=async()=>{const e=async()=>{const n=await D({mode:"production",command:"build"});await F(n),u(l)&&await L(l,t.join(f,"config.js"),{recursive:!0}).catch(a=>{console.error(a)})};if(i.lib)await e();else{const n=t.join(c,"/index.html");await T(n,y).then(async()=>{await e(),await $(n).catch(()=>{console.error("failed to remove index.html")})})}};async function G(){(await S({root:s,base:i.base??"",preview:{port:isNaN(i.port)?8080:i.port,open:i.open,host:i.host},build:{outDir:f}})).printUrls()}const K=process.argv?.[2];(async()=>{switch(K){case"dev":await Y();break;case"build":await B();break;case"preview":await G();break;default:console.error("command not found");break}})();
|
|
20
|
+
</html>`,D=C(({mode:e,command:n})=>({base:i.base??"",cacheDir:z,plugins:[N({customElement:!1,template:{transformAssetUrls:A,compilerOptions:{isCustomElement:a=>!a.includes("v-")&&a.includes("-")}}}),O({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:M}],customLogger:v,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":g,"user:widgets":w},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**")]},port:i.port??3e3,open:i.open,fs:{allow:[x(process.cwd())]},host:i.host},root:c,optimizeDeps:e==="development"?{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs","loglevel"],noDiscovery:!0}:{},publicDir:i.publicDir===!1?!1:R,build:{lib:i.lib&&n==="build"&&{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},outDir:f,emptyOutDir:!0,rollupOptions:i.lib&&n==="build"?{input:t.join(c,"core/client/asWebComponent.js")}:void 0,target:"esnext"}}));async function M(e){e.watcher.add([g,l,t.join(w,"**/*.vue")]);let n="";const a=v.info;return v.info=(o,r)=>{if(o.includes("core")){const d=o.split("/")[0].split(" ");d.pop();const p=d.join(" ")+" "+n.replace(s,"");return a(p,r)}return a(o,r)},e.watcher.on("change",async o=>{n=o,o===l&&e.hot.send({type:"full-reload",path:o})}),()=>{e.middlewares.use(async(o,r,d)=>{if(o.originalUrl==="/@fs/config.js"||o.originalUrl==="/config.js"){r.statusCode=200,r.setHeader("Content-Type","text/javascript"),u(l)&&await I(l).then(p=>{r.write(p)}),r.end();return}if(o.url?.endsWith(".html")){r.statusCode=200,r.setHeader("Content-Type","text/html");const p=await e.transformIndexHtml(o.url,y,o.originalUrl);r.end(p);return}d()})}}const Y=async()=>{const e=await k(await D({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},B=async()=>{const e=async()=>{const n=await D({mode:"production",command:"build"});await F(n),u(l)&&await L(l,t.join(f,"config.js"),{recursive:!0}).catch(a=>{console.error(a)})};if(i.lib)await e();else{const n=t.join(c,"/index.html");await T(n,y).then(async()=>{await e(),await $(n).catch(()=>{console.error("failed to remove index.html")})})}};async function G(){(await S({root:s,base:i.base??"",preview:{port:isNaN(i.port)?8080:i.port,open:i.open,host:i.host},build:{outDir:f}})).printUrls()}const K=process.argv?.[2];(async()=>{switch(K){case"dev":await Y();break;case"build":await B();break;case"preview":await G();break;default:console.error("command not found");break}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eodash/eodash",
|
|
3
|
-
"version": "5.0.0-alpha.2.
|
|
3
|
+
"version": "5.0.0-alpha.2.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./core/client/types.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -47,49 +47,52 @@
|
|
|
47
47
|
"docs:generate": "typedoc --options typedoc.config.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@eox/itemfilter": "^1.0
|
|
50
|
+
"@eox/itemfilter": "^1.1.0",
|
|
51
51
|
"@eox/jsonform": "^0.8.2",
|
|
52
|
-
"@eox/layercontrol": "^0.
|
|
52
|
+
"@eox/layercontrol": "^0.20.0",
|
|
53
53
|
"@eox/layout": "^0.1.0",
|
|
54
|
-
"@eox/map": "1.
|
|
54
|
+
"@eox/map": "^1.13.0",
|
|
55
55
|
"@eox/stacinfo": "^0.3.3",
|
|
56
|
-
"@eox/timecontrol": "^0.
|
|
56
|
+
"@eox/timecontrol": "^0.7.2",
|
|
57
57
|
"@mdi/js": "^7.4.47",
|
|
58
|
-
"@vitejs/plugin-vue": "^5.
|
|
58
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
59
|
+
"@vueuse/core": "^10.11.1",
|
|
59
60
|
"animated-details": "gist:2912bb049fa906671807415eb0e87188",
|
|
60
|
-
"axios": "^1.7.
|
|
61
|
+
"axios": "^1.7.4",
|
|
62
|
+
"axios-cache-interceptor": "^1.5.3",
|
|
61
63
|
"commander": "^12.1.0",
|
|
62
|
-
"core-js": "^3.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
64
|
+
"core-js": "^3.38.1",
|
|
65
|
+
"loglevel": "^1.9.1",
|
|
66
|
+
"pinia": "^2.2.2",
|
|
67
|
+
"sass": "^1.77.8",
|
|
65
68
|
"stac-js": "^0.0.9",
|
|
66
69
|
"stac-ts": "^1.0.3",
|
|
67
70
|
"v-calendar": "^3.1.2",
|
|
68
|
-
"vite": "^5.
|
|
69
|
-
"vite-plugin-vuetify": "^2.0.
|
|
71
|
+
"vite": "^5.4.2",
|
|
72
|
+
"vite-plugin-vuetify": "^2.0.4",
|
|
70
73
|
"vue": "^3.2.0",
|
|
71
|
-
"vuetify": "^3.
|
|
74
|
+
"vuetify": "^3.7.0",
|
|
72
75
|
"webfontloader": "^1.6.28"
|
|
73
76
|
},
|
|
74
77
|
"devDependencies": {
|
|
75
|
-
"@babel/types": "^7.
|
|
78
|
+
"@babel/types": "^7.25.4",
|
|
76
79
|
"@eox/eslint-config": "^2.0.0",
|
|
77
|
-
"@pinia/testing": "^0.1.
|
|
78
|
-
"@types/node": "
|
|
80
|
+
"@pinia/testing": "^0.1.5",
|
|
81
|
+
"@types/node": "^22.5.0",
|
|
79
82
|
"@types/openlayers": "^4.6.23",
|
|
80
83
|
"@types/webfontloader": "^1.6.38",
|
|
81
|
-
"cypress": "^13.13.
|
|
82
|
-
"eslint": "^9.
|
|
84
|
+
"cypress": "^13.13.3",
|
|
85
|
+
"eslint": "^9.9.0",
|
|
83
86
|
"eslint-plugin-vue": "^9.27.0",
|
|
84
|
-
"prettier": "^3.3.
|
|
87
|
+
"prettier": "^3.3.3",
|
|
85
88
|
"terminate": "^2.8.0",
|
|
86
|
-
"typedoc": "^0.26.
|
|
87
|
-
"typedoc-plugin-markdown": "^4.2.
|
|
89
|
+
"typedoc": "^0.26.6",
|
|
90
|
+
"typedoc-plugin-markdown": "^4.2.5",
|
|
88
91
|
"typedoc-plugin-vue": "^1.2.0",
|
|
89
92
|
"typedoc-vitepress-theme": "^1.0.1",
|
|
90
|
-
"typescript": "^5.5.
|
|
93
|
+
"typescript": "^5.5.4",
|
|
91
94
|
"unplugin-fonts": "^1.1.1",
|
|
92
|
-
"vitepress": "^1.3.
|
|
95
|
+
"vitepress": "^1.3.3",
|
|
93
96
|
"vitest": "^1.6.0",
|
|
94
97
|
"vue-tsc": "2.0.22"
|
|
95
98
|
},
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<VCDatePicker
|
|
2
|
+
<VCDatePicker
|
|
3
|
+
v-model.number="currentDate"
|
|
4
|
+
:masks="masks"
|
|
5
|
+
:attributes="attributes"
|
|
6
|
+
>
|
|
3
7
|
<template #default="{ inputValue, inputEvents }">
|
|
4
8
|
<div
|
|
5
9
|
class="flex rounded-lg border border-gray-300 dark:border-gray-600"
|
|
@@ -37,40 +41,27 @@
|
|
|
37
41
|
<script setup>
|
|
38
42
|
import { DatePicker as VCDatePicker } from "v-calendar";
|
|
39
43
|
import "v-calendar/style.css";
|
|
40
|
-
import {
|
|
44
|
+
import { watch, reactive, ref, customRef } from "vue";
|
|
41
45
|
import { storeToRefs } from "pinia";
|
|
42
46
|
import { useSTAcStore } from "@/store/stac";
|
|
43
47
|
import { datetime } from "@/store/States";
|
|
44
48
|
import { mdiRayStartArrow, mdiRayEndArrow } from "@mdi/js";
|
|
45
49
|
import { eodashCollections } from "@/utils/states";
|
|
50
|
+
import log from "loglevel";
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(!reverse && d.getTime() > latestDateMS) ||
|
|
61
|
-
(reverse && d.getTime() < latestDateMS)
|
|
62
|
-
) {
|
|
63
|
-
latestDateMS = d.getTime();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
if (latestDateMS !== 0) {
|
|
70
|
-
currentDate.value = new Date(latestDateMS);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
52
|
+
// holds the number value of the datetime
|
|
53
|
+
const currentDate = customRef((track, trigger) => ({
|
|
54
|
+
get() {
|
|
55
|
+
track();
|
|
56
|
+
return new Date(datetime.value).getTime();
|
|
57
|
+
},
|
|
58
|
+
/** @param {number} num */
|
|
59
|
+
set(num) {
|
|
60
|
+
trigger();
|
|
61
|
+
log.debug("Datepicker setting currentDate", datetime.value);
|
|
62
|
+
datetime.value = new Date(num).toISOString();
|
|
63
|
+
},
|
|
64
|
+
}));
|
|
74
65
|
|
|
75
66
|
const masks = ref({
|
|
76
67
|
input: "YYYY-MM-DD",
|
|
@@ -88,67 +79,88 @@ const masks = ref({
|
|
|
88
79
|
*/
|
|
89
80
|
const attributes = reactive([]);
|
|
90
81
|
|
|
91
|
-
const
|
|
92
|
-
get() {
|
|
93
|
-
return datetime.value ? new Date(datetime.value) : new Date();
|
|
94
|
-
},
|
|
95
|
-
/** @param {Date | string} updatedDate */
|
|
96
|
-
set(updatedDate) {
|
|
97
|
-
if (updatedDate instanceof Date && !isNaN(updatedDate.getTime())) {
|
|
98
|
-
datetime.value = new Date(
|
|
99
|
-
updatedDate.getTime() - updatedDate.getTimezoneOffset() * 60000,
|
|
100
|
-
).toISOString();
|
|
101
|
-
} else {
|
|
102
|
-
datetime.value = new Date().toISOString();
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
});
|
|
82
|
+
const { selectedStac } = storeToRefs(useSTAcStore());
|
|
106
83
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
84
|
+
watch(
|
|
85
|
+
selectedStac,
|
|
86
|
+
async (updatedStac, previousStac) => {
|
|
87
|
+
if (updatedStac && previousStac?.id !== updatedStac.id) {
|
|
88
|
+
log.debug("Datepicker selected STAC change triggered");
|
|
89
|
+
const wongPalette = [
|
|
90
|
+
"#009E73",
|
|
91
|
+
"#0072B2",
|
|
92
|
+
"#E69F00",
|
|
93
|
+
"#CC79A7",
|
|
94
|
+
"#56B4E9",
|
|
95
|
+
"#D55E00",
|
|
96
|
+
];
|
|
97
|
+
// remove old values
|
|
98
|
+
attributes.splice(0, attributes.length);
|
|
121
99
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
100
|
+
for (let idx = 0; idx < eodashCollections.length; idx++) {
|
|
101
|
+
log.debug("Retrieving dates", eodashCollections[idx]);
|
|
102
|
+
await eodashCollections[idx].fetchCollection();
|
|
103
|
+
const dates = [
|
|
104
|
+
...new Set(
|
|
105
|
+
eodashCollections[idx].getItems()?.reduce((valid, it) => {
|
|
106
|
+
const parsed = Date.parse(/** @type {string} */ (it.datetime));
|
|
107
|
+
if (parsed) {
|
|
108
|
+
valid.push(new Date(parsed));
|
|
109
|
+
}
|
|
110
|
+
return valid;
|
|
111
|
+
}, /** @type {Date[]} */ ([])),
|
|
112
|
+
),
|
|
113
|
+
];
|
|
114
|
+
attributes.push({
|
|
115
|
+
key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
|
|
116
|
+
bar: {
|
|
117
|
+
style: {
|
|
118
|
+
backgroundColor: wongPalette[idx % wongPalette.length],
|
|
138
119
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
// We try to set the current time selection
|
|
143
|
-
// to latest extent date
|
|
144
|
-
// @ts-expect-error it seems the temporal extent is not defined in type
|
|
145
|
-
const interval = updatedStac?.extent?.temporal?.interval;
|
|
146
|
-
if (interval && interval.length > 0 && interval[0].length > 1) {
|
|
147
|
-
currentDate.value = new Date(interval[0][1]);
|
|
148
|
-
}
|
|
120
|
+
},
|
|
121
|
+
dates,
|
|
122
|
+
});
|
|
149
123
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
124
|
+
// We try to set the current time selection
|
|
125
|
+
// to latest extent date
|
|
126
|
+
// @ts-expect-error it seems the temporal extent is not defined in type
|
|
127
|
+
const interval = updatedStac?.extent?.temporal?.interval;
|
|
128
|
+
if (interval && interval.length > 0 && interval[0].length > 1) {
|
|
129
|
+
const endInterval = new Date(interval[0][1]);
|
|
130
|
+
log.debug(
|
|
131
|
+
"Datepicker: found stac extent, setting time to latest value",
|
|
132
|
+
endInterval,
|
|
133
|
+
);
|
|
134
|
+
currentDate.value = endInterval?.getTime();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{ immediate: true },
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @param {boolean} reverse
|
|
143
|
+
*/
|
|
144
|
+
function jumpDate(reverse) {
|
|
145
|
+
if (attributes.length) {
|
|
146
|
+
let latestDateMS = reverse ? Infinity : -Infinity;
|
|
147
|
+
attributes.forEach((coll) => {
|
|
148
|
+
if (coll?.dates) {
|
|
149
|
+
coll.dates.forEach((d) => {
|
|
150
|
+
// TODO: we need to handle time ranges and other options here
|
|
151
|
+
if (d instanceof Date) {
|
|
152
|
+
const mathFun = reverse ? "min" : "max";
|
|
153
|
+
latestDateMS = Math[mathFun](latestDateMS, d.getTime());
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
currentDate.value =
|
|
159
|
+
latestDateMS === -Infinity
|
|
160
|
+
? Date.now()
|
|
161
|
+
: latestDateMS === Infinity
|
|
162
|
+
? 0
|
|
163
|
+
: latestDateMS;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
154
166
|
</script>
|
package/widgets/EodashMap.vue
CHANGED
|
@@ -22,14 +22,7 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
<script setup>
|
|
24
24
|
import { computed, onMounted, reactive, ref } from "vue";
|
|
25
|
-
import {
|
|
26
|
-
currentUrl,
|
|
27
|
-
currentCompareUrl,
|
|
28
|
-
datetime,
|
|
29
|
-
mapEl,
|
|
30
|
-
mapPosition,
|
|
31
|
-
mapCompareEl,
|
|
32
|
-
} from "@/store/States";
|
|
25
|
+
import { datetime, mapEl, mapPosition, mapCompareEl } from "@/store/States";
|
|
33
26
|
import { storeToRefs } from "pinia";
|
|
34
27
|
import { useSTAcStore } from "@/store/stac";
|
|
35
28
|
import "@eox/map";
|
|
@@ -54,7 +47,7 @@ const eoxMapConfig = reactive({
|
|
|
54
47
|
center: [15, 48],
|
|
55
48
|
/** @type {number | undefined} */
|
|
56
49
|
zoom: 4,
|
|
57
|
-
// TODO: we should probably introduce some way of defining
|
|
50
|
+
// TODO: we should probably introduce some way of defining default base layers
|
|
58
51
|
layers: [
|
|
59
52
|
{
|
|
60
53
|
type: "Tile",
|
|
@@ -84,38 +77,35 @@ if (mapPosition && mapPosition.value && mapPosition.value.length === 3) {
|
|
|
84
77
|
eoxMapConfig.center = [mapPosition.value?.[0], mapPosition.value[1]];
|
|
85
78
|
eoxMapConfig.zoom = mapPosition.value[2];
|
|
86
79
|
}
|
|
80
|
+
const { selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
87
81
|
const showCompare = computed(() =>
|
|
88
82
|
props.enableCompare && !!selectedCompareStac.value ? "" : "first",
|
|
89
83
|
);
|
|
90
84
|
|
|
91
85
|
useHandleMapMoveEnd(eoxMap, mapPosition);
|
|
92
86
|
|
|
93
|
-
const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
|
|
94
|
-
|
|
95
|
-
if (props.enableCompare) {
|
|
96
|
-
useInitMap(
|
|
97
|
-
compareMap,
|
|
98
|
-
//@ts-expect-error todo selectedStac as collection
|
|
99
|
-
selectedCompareStac,
|
|
100
|
-
eodashCompareCollections,
|
|
101
|
-
currentCompareUrl,
|
|
102
|
-
datetime,
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
useInitMap(
|
|
106
|
-
eoxMap,
|
|
107
|
-
//@ts-expect-error todo selectedStac as collection
|
|
108
|
-
selectedStac,
|
|
109
|
-
eodashCollections,
|
|
110
|
-
currentUrl,
|
|
111
|
-
datetime,
|
|
112
|
-
);
|
|
113
|
-
|
|
114
87
|
onMounted(() => {
|
|
88
|
+
const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
|
|
115
89
|
// assign map Element state to eox map
|
|
116
90
|
mapEl.value = eoxMap.value;
|
|
117
91
|
if (props.enableCompare) {
|
|
118
92
|
mapCompareEl.value = compareMap.value;
|
|
119
93
|
}
|
|
94
|
+
if (props.enableCompare) {
|
|
95
|
+
useInitMap(
|
|
96
|
+
compareMap,
|
|
97
|
+
//@ts-expect-error todo selectedStac as collection
|
|
98
|
+
selectedCompareStac,
|
|
99
|
+
eodashCompareCollections,
|
|
100
|
+
datetime,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
useInitMap(
|
|
104
|
+
eoxMap,
|
|
105
|
+
//@ts-expect-error todo selectedStac as collection
|
|
106
|
+
selectedStac,
|
|
107
|
+
eodashCollections,
|
|
108
|
+
datetime,
|
|
109
|
+
);
|
|
120
110
|
});
|
|
121
111
|
</script>
|
package/widgets/ExportState.vue
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
<v-card-text class="py-5 overflow-auto" style="height: 400px">
|
|
9
9
|
<p class="text-body-2">
|
|
10
|
-
Copy and paste this code into the map layers field of the
|
|
11
|
-
editor:
|
|
10
|
+
Copy and paste this code into the map <b>layers field</b> of the
|
|
11
|
+
storytelling editor:
|
|
12
12
|
</p>
|
|
13
13
|
<div class="pa-3 code-block">
|
|
14
14
|
{{ removeUnneededProperties(getLayers()) }}
|
|
@@ -110,5 +110,7 @@ const mapEntryCode = computed(() => {
|
|
|
110
110
|
background-color: #ddd;
|
|
111
111
|
font-family: monospace;
|
|
112
112
|
font-size: small;
|
|
113
|
+
max-height: 200px;
|
|
114
|
+
overflow-y: auto;
|
|
113
115
|
}
|
|
114
116
|
</style>
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { p as I, o as M, g as _, y as $, aw as R, c as d, r as O, d as y, a as j, b as f, ax as F, ay as A, T as H, az as N, aA as Y, Z as U, aB as z, aC as G, w as J, $ as x, a6 as L, a1 as g, a3 as w, aD as W, F as Z, a9 as V, aE as q, aF as K, t as k, a0 as C, M as b, aG as Q, V as D, aH as X, aI as p, aJ as T } from "./asWebComponent-3OsFQJVx.js";
|
|
2
|
-
import { m as tt, V as P } from "./VOverlay-CL4hiJB8.js";
|
|
3
|
-
import { b as et, f as at } from "./forwardRefs-BxZaq9ml.js";
|
|
4
|
-
const ot = I({
|
|
5
|
-
id: String,
|
|
6
|
-
text: String,
|
|
7
|
-
...M(tt({
|
|
8
|
-
closeOnBack: !1,
|
|
9
|
-
location: "end",
|
|
10
|
-
locationStrategy: "connected",
|
|
11
|
-
eager: !0,
|
|
12
|
-
minWidth: 0,
|
|
13
|
-
offset: 10,
|
|
14
|
-
openOnClick: !1,
|
|
15
|
-
openOnHover: !0,
|
|
16
|
-
origin: "auto",
|
|
17
|
-
scrim: !1,
|
|
18
|
-
scrollStrategy: "reposition",
|
|
19
|
-
transition: !1
|
|
20
|
-
}), ["absolute", "persistent"])
|
|
21
|
-
}, "VTooltip"), nt = _()({
|
|
22
|
-
name: "VTooltip",
|
|
23
|
-
props: ot(),
|
|
24
|
-
emits: {
|
|
25
|
-
"update:modelValue": (t) => !0
|
|
26
|
-
},
|
|
27
|
-
setup(t, i) {
|
|
28
|
-
let {
|
|
29
|
-
slots: l
|
|
30
|
-
} = i;
|
|
31
|
-
const a = $(t, "modelValue"), {
|
|
32
|
-
scopeId: r
|
|
33
|
-
} = et(), n = R(), e = d(() => t.id || `v-tooltip-${n}`), o = O(), s = d(() => t.location.split(" ").length > 1 ? t.location : t.location + " center"), c = d(() => t.origin === "auto" || t.origin === "overlap" || t.origin.split(" ").length > 1 || t.location.split(" ").length > 1 ? t.origin : t.origin + " center"), u = d(() => t.transition ? t.transition : a.value ? "scale-transition" : "fade-transition"), h = d(() => y({
|
|
34
|
-
"aria-describedby": e.value
|
|
35
|
-
}, t.activatorProps));
|
|
36
|
-
return j(() => {
|
|
37
|
-
const B = P.filterProps(t);
|
|
38
|
-
return f(P, y({
|
|
39
|
-
ref: o,
|
|
40
|
-
class: ["v-tooltip", t.class],
|
|
41
|
-
style: t.style,
|
|
42
|
-
id: e.value
|
|
43
|
-
}, B, {
|
|
44
|
-
modelValue: a.value,
|
|
45
|
-
"onUpdate:modelValue": (m) => a.value = m,
|
|
46
|
-
transition: u.value,
|
|
47
|
-
absolute: !0,
|
|
48
|
-
location: s.value,
|
|
49
|
-
origin: c.value,
|
|
50
|
-
persistent: !0,
|
|
51
|
-
role: "tooltip",
|
|
52
|
-
activatorProps: h.value,
|
|
53
|
-
_disableGlobalStack: !0
|
|
54
|
-
}, r), {
|
|
55
|
-
activator: l.activator,
|
|
56
|
-
default: function() {
|
|
57
|
-
for (var m = arguments.length, S = new Array(m), v = 0; v < m; v++)
|
|
58
|
-
S[v] = arguments[v];
|
|
59
|
-
return l.default?.(...S) ?? t.text;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}), at({}, o);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
function st(t, i) {
|
|
66
|
-
const l = typeof t == "string" ? F(t) : t, a = rt(l, i);
|
|
67
|
-
return {
|
|
68
|
-
mounted: a,
|
|
69
|
-
updated: a,
|
|
70
|
-
unmounted(r) {
|
|
71
|
-
A(null, r);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function rt(t, i) {
|
|
76
|
-
return function(l, a, r) {
|
|
77
|
-
const n = typeof i == "function" ? i(a) : i, e = a.value?.text ?? a.value ?? n?.text, o = H(a.value) ? a.value : {}, s = () => e ?? l.innerHTML, c = (r.ctx === a.instance.$ ? it(r, a.instance.$)?.provides : r.ctx?.provides) ?? a.instance.$.provides, u = N(t, y(n, o), s);
|
|
78
|
-
u.appContext = Object.assign(/* @__PURE__ */ Object.create(null), a.instance.$.appContext, {
|
|
79
|
-
provides: c
|
|
80
|
-
}), A(u, l);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function it(t, i) {
|
|
84
|
-
const l = /* @__PURE__ */ new Set(), a = (n) => {
|
|
85
|
-
for (const e of n) {
|
|
86
|
-
if (!e) continue;
|
|
87
|
-
if (e === t)
|
|
88
|
-
return !0;
|
|
89
|
-
l.add(e);
|
|
90
|
-
let o;
|
|
91
|
-
if (e.suspense ? o = a([e.ssContent]) : Array.isArray(e.children) ? o = a(e.children) : e.component?.vnode && (o = a([e.component?.subTree])), o)
|
|
92
|
-
return o;
|
|
93
|
-
l.delete(e);
|
|
94
|
-
}
|
|
95
|
-
return !1;
|
|
96
|
-
};
|
|
97
|
-
if (!a([i.subTree]))
|
|
98
|
-
throw new Error("Could not find original vnode");
|
|
99
|
-
const r = Array.from(l).reverse();
|
|
100
|
-
for (const n of r)
|
|
101
|
-
if (n.component)
|
|
102
|
-
return n.component;
|
|
103
|
-
return i;
|
|
104
|
-
}
|
|
105
|
-
const E = st(nt, (t) => ({
|
|
106
|
-
activator: "parent",
|
|
107
|
-
location: t.arg?.replace("-", " ") ?? "top",
|
|
108
|
-
text: typeof t.value == "boolean" ? void 0 : t.value
|
|
109
|
-
})), lt = {
|
|
110
|
-
class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
|
|
111
|
-
style: { margin: "2px" }
|
|
112
|
-
}, ct = ["value"], mt = {
|
|
113
|
-
__name: "EodashDatePicker",
|
|
114
|
-
setup(t) {
|
|
115
|
-
function i(n) {
|
|
116
|
-
if (a.length) {
|
|
117
|
-
let e = n ? 1 / 0 : -1 / 0;
|
|
118
|
-
a.forEach((o) => {
|
|
119
|
-
o?.dates && o.dates.forEach((s) => {
|
|
120
|
-
s instanceof Date && (!n && s.getTime() > e || n && s.getTime() < e) && (e = s.getTime());
|
|
121
|
-
});
|
|
122
|
-
}), e !== 0 && (r.value = new Date(e));
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const l = O({
|
|
126
|
-
input: "YYYY-MM-DD"
|
|
127
|
-
}), a = Y([]), r = d({
|
|
128
|
-
get() {
|
|
129
|
-
return p.value ? new Date(p.value) : /* @__PURE__ */ new Date();
|
|
130
|
-
},
|
|
131
|
-
/** @param {Date | string} updatedDate */
|
|
132
|
-
set(n) {
|
|
133
|
-
n instanceof Date && !isNaN(n.getTime()) ? p.value = new Date(
|
|
134
|
-
n.getTime() - n.getTimezoneOffset() * 6e4
|
|
135
|
-
).toISOString() : p.value = (/* @__PURE__ */ new Date()).toISOString();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
return U(() => {
|
|
139
|
-
const { selectedStac: n } = z(G());
|
|
140
|
-
J(
|
|
141
|
-
[n],
|
|
142
|
-
async ([e]) => {
|
|
143
|
-
if (e) {
|
|
144
|
-
const o = [
|
|
145
|
-
"#009E73",
|
|
146
|
-
"#0072B2",
|
|
147
|
-
"#E69F00",
|
|
148
|
-
"#CC79A7",
|
|
149
|
-
"#56B4E9",
|
|
150
|
-
"#D55E00"
|
|
151
|
-
];
|
|
152
|
-
a.length = 0;
|
|
153
|
-
for (let c = 0; c < T.length; c++) {
|
|
154
|
-
const u = [
|
|
155
|
-
...new Set(
|
|
156
|
-
T[c].getItems()?.map((h) => new Date(
|
|
157
|
-
/** @type {string} */
|
|
158
|
-
h.datetime
|
|
159
|
-
))
|
|
160
|
-
)
|
|
161
|
-
];
|
|
162
|
-
a.push({
|
|
163
|
-
key: "id-" + c.toString() + Math.random().toString(16).slice(2),
|
|
164
|
-
bar: {
|
|
165
|
-
style: {
|
|
166
|
-
backgroundColor: o[c % o.length]
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
dates: u
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
const s = e?.extent?.temporal?.interval;
|
|
173
|
-
s && s.length > 0 && s[0].length > 1 && (r.value = new Date(s[0][1]));
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{ immediate: !0 }
|
|
177
|
-
);
|
|
178
|
-
}), (n, e) => (x(), L(
|
|
179
|
-
Z,
|
|
180
|
-
null,
|
|
181
|
-
[
|
|
182
|
-
f(w(K), {
|
|
183
|
-
modelValue: r.value,
|
|
184
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) => r.value = o),
|
|
185
|
-
masks: l.value,
|
|
186
|
-
attributes: a
|
|
187
|
-
}, {
|
|
188
|
-
default: g(({ inputValue: o, inputEvents: s }) => [
|
|
189
|
-
V("div", lt, [
|
|
190
|
-
V("input", y({ value: o }, q(s, !0), {
|
|
191
|
-
style: { margin: "1px" },
|
|
192
|
-
class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
|
|
193
|
-
}), null, 16, ct)
|
|
194
|
-
])
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
/* STABLE */
|
|
198
|
-
}, 8, ["modelValue", "masks", "attributes"]),
|
|
199
|
-
f(W, {
|
|
200
|
-
align: "center",
|
|
201
|
-
justify: "center",
|
|
202
|
-
style: { "margin-top": "6px" }
|
|
203
|
-
}, {
|
|
204
|
-
default: g(() => [
|
|
205
|
-
k((x(), C(D, {
|
|
206
|
-
style: { padding: "0px", "margin-right": "4px" },
|
|
207
|
-
density: "compact",
|
|
208
|
-
onClick: e[1] || (e[1] = (o) => i(!0))
|
|
209
|
-
}, {
|
|
210
|
-
default: g(() => [
|
|
211
|
-
f(b, {
|
|
212
|
-
icon: [w(Q)]
|
|
213
|
-
}, null, 8, ["icon"])
|
|
214
|
-
]),
|
|
215
|
-
_: 1
|
|
216
|
-
/* STABLE */
|
|
217
|
-
})), [
|
|
218
|
-
[E, "Set date to oldest available dataset", "bottom"]
|
|
219
|
-
]),
|
|
220
|
-
k((x(), C(D, {
|
|
221
|
-
style: { padding: "0px", "margin-left": "4px" },
|
|
222
|
-
density: "compact",
|
|
223
|
-
onClick: e[2] || (e[2] = (o) => i(!1))
|
|
224
|
-
}, {
|
|
225
|
-
default: g(() => [
|
|
226
|
-
f(b, {
|
|
227
|
-
icon: [w(X)]
|
|
228
|
-
}, null, 8, ["icon"])
|
|
229
|
-
]),
|
|
230
|
-
_: 1
|
|
231
|
-
/* STABLE */
|
|
232
|
-
})), [
|
|
233
|
-
[E, "Set date to latest available dataset", "bottom"]
|
|
234
|
-
])
|
|
235
|
-
]),
|
|
236
|
-
_: 1
|
|
237
|
-
/* STABLE */
|
|
238
|
-
})
|
|
239
|
-
],
|
|
240
|
-
64
|
|
241
|
-
/* STABLE_FRAGMENT */
|
|
242
|
-
));
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
export {
|
|
246
|
-
mt as default
|
|
247
|
-
};
|