@eodash/eodash 5.0.0-rc.1.5 → 5.0.0-rc.2
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/composables/EodashMap.js +47 -28
- package/core/client/composables/EodashProcess.js +51 -5
- package/core/client/composables/index.js +8 -1
- package/core/client/eodash.js +21 -7
- package/core/client/eodashSTAC/EodashCollection.js +24 -4
- package/core/client/eodashSTAC/createLayers.js +62 -6
- package/core/client/eodashSTAC/helpers.js +48 -5
- package/core/client/eodashSTAC/triggers.js +52 -1
- package/core/client/store/stac.js +7 -2
- package/core/client/types.ts +10 -1
- package/core/client/utils/index.js +12 -0
- package/core/client/utils/states.js +18 -1
- package/core/client/views/Dashboard.vue +3 -1
- package/dist/client/{DashboardLayout-B-4X57-t.js → DashboardLayout-VrJIbhe8.js} +2 -2
- package/dist/client/{DynamicWebComponent-Dj3QYwag.js → DynamicWebComponent-BCwpocDX.js} +1 -1
- package/dist/client/EodashDatePicker-Bp5ec3BC.js +430 -0
- package/dist/client/{EodashItemFilter-DBQwJQPh.js → EodashItemFilter-Cx0t-qeW.js} +1 -1
- package/dist/client/{EodashLayerControl-C5fOCvoI.js → EodashLayerControl-DERx00In.js} +10 -2
- package/dist/client/{EodashLayoutSwitcher-BMO9k_20.js → EodashLayoutSwitcher-DTS7otlk.js} +2 -2
- package/dist/client/{EodashMap-D2bnMLAC.js → EodashMap-C-I6puhb.js} +101 -73
- package/dist/client/{EodashMapBtns-l9B977id.js → EodashMapBtns-CWgtJiG4.js} +4 -4
- package/dist/client/{EodashProcess-BtIlJvF1.js → EodashProcess-DWrTIyHT.js} +188 -33
- package/dist/client/{EodashStacInfo-CPVvp_Hm.js → EodashStacInfo-Dvsk97Mz.js} +1 -1
- package/dist/client/{EodashTools-DY2dlNXW.js → EodashTools-CdnjgTTl.js} +4 -4
- package/dist/client/{ExportState-BvD5A0XG.js → ExportState-S4lcehm3.js} +4 -4
- package/dist/client/{Footer-w95gBnSH.js → Footer-DlIEbXp-.js} +1 -1
- package/dist/client/{Header-BpiorKy9.js → Header-CTiEXLi0.js} +3 -3
- package/dist/client/{MobileLayout-CmVlZe7S.js → MobileLayout-DRgyQYFz.js} +17 -7
- package/dist/client/{PopUp-CREaSybs.js → PopUp-CzqV8BFZ.js} +3 -3
- package/dist/client/{VImg-DF9esgdd.js → VImg-Bn8bCvVM.js} +2 -2
- package/dist/client/{VMain-BWLMf-rn.js → VMain-2GOqWb6m.js} +1 -1
- package/dist/client/{VOverlay-DmNfblmy.js → VOverlay-BetC0LGI.js} +3 -3
- package/dist/client/{VTooltip-C3PeE7iO.js → VTooltip-BWg0dxx5.js} +3 -3
- package/dist/client/{WidgetsContainer-6FHEEXns.js → WidgetsContainer-Cv466WUW.js} +1 -1
- package/dist/client/{asWebComponent-BnFMd0T6.js → asWebComponent-CLUhauLl.js} +422 -164
- package/dist/client/eo-dash.css +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-BF3Me2RX.js → forwardRefs-CxSsJulB.js} +1 -1
- package/dist/client/{index-CRd5-RSy.js → index-BMj56LY3.js} +1 -1
- package/dist/client/{transition-Cpn_g5jE.js → transition-DidoPMgC.js} +1 -1
- package/dist/node/cli.js +2 -2
- package/dist/types/core/client/composables/EodashMap.d.ts +2 -1
- package/dist/types/core/client/composables/EodashProcess.d.ts +17 -11
- package/dist/types/core/client/composables/index.d.ts +1 -1
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +11 -4
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +6 -6
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +77 -20
- package/dist/types/core/client/eodashSTAC/triggers.d.ts +6 -0
- package/dist/types/core/client/types.d.ts +13 -1
- package/dist/types/core/client/utils/index.d.ts +1 -0
- package/dist/types/core/client/utils/states.d.ts +9 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +459 -2
- package/dist/types/widgets/EodashMap.vue.d.ts +2 -0
- package/dist/types/widgets/EodashProcess.vue.d.ts +1 -0
- package/dist/types/widgets/PopUp.vue.d.ts +1 -2
- package/package.json +24 -24
- package/widgets/EodashDatePicker.vue +139 -22
- package/widgets/EodashLayerControl.vue +13 -1
- package/widgets/EodashMap.vue +63 -5
- package/widgets/EodashProcess.vue +82 -22
- package/dist/client/EodashDatePicker-DGRJrJ0s.js +0 -306
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { changeMapProjection, registerProjection } from "@/store/actions";
|
|
5
5
|
import log from "loglevel";
|
|
6
6
|
import { getProjectionCode } from "./helpers";
|
|
7
|
-
import { availableMapProjection } from "@/store/states";
|
|
7
|
+
import { availableMapProjection, mapEl } from "@/store/states";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* checks if there's a projection on the Collection and
|
|
@@ -41,3 +41,54 @@ export const setMapProjFromCol = async (STAcCollection) => {
|
|
|
41
41
|
await changeMapProjection((availableMapProjection.value = ""));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {string} collectionId
|
|
47
|
+
* @param {import("@/types").EodashStyleJson["variables"]} variables
|
|
48
|
+
*/
|
|
49
|
+
export function getStyleVariablesState(collectionId, variables) {
|
|
50
|
+
const mapElement = /** @type {import("@eox/map").EOxMap} */ (mapEl.value);
|
|
51
|
+
if (!mapElement || !mapElement.layers.length || !variables) {
|
|
52
|
+
return variables;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const analysisGroup = mapElement.layers.find(
|
|
56
|
+
(layer) => layer.properties?.id === "AnalysisGroup",
|
|
57
|
+
);
|
|
58
|
+
if (!analysisGroup) {
|
|
59
|
+
return variables;
|
|
60
|
+
}
|
|
61
|
+
const matchingLayer = analysisGroup.layers?.find((layer) => {
|
|
62
|
+
const [collection, ..._other] = layer.properties?.id.split(";:;") ?? [
|
|
63
|
+
"",
|
|
64
|
+
"",
|
|
65
|
+
"",
|
|
66
|
+
];
|
|
67
|
+
return (
|
|
68
|
+
collection === collectionId &&
|
|
69
|
+
["Vector", "WebGLTile"].includes(layer?.type ?? "")
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (!matchingLayer) {
|
|
74
|
+
return variables;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const olLayer = mapElement.getLayerById(matchingLayer.properties?.id ?? "");
|
|
78
|
+
const oldVariablesState = /** @type {import("ol/layer").WebGLTile} */ (
|
|
79
|
+
olLayer
|
|
80
|
+
//@ts-expect-error todo
|
|
81
|
+
).getStyle()?.variables;
|
|
82
|
+
if (!oldVariablesState) {
|
|
83
|
+
return variables;
|
|
84
|
+
}
|
|
85
|
+
const styleVariablesKeys = Object.keys(variables);
|
|
86
|
+
const matchingKeys =
|
|
87
|
+
Object.keys(oldVariablesState).every((key) =>
|
|
88
|
+
styleVariablesKeys.includes(key),
|
|
89
|
+
) &&
|
|
90
|
+
styleVariablesKeys.every((key) =>
|
|
91
|
+
Object.keys(oldVariablesState).includes(key),
|
|
92
|
+
);
|
|
93
|
+
return matchingKeys ? oldVariablesState : variables;
|
|
94
|
+
}
|
|
@@ -5,7 +5,11 @@ import { useAbsoluteUrl, useCompareAbsoluteUrl } from "@/composables/index";
|
|
|
5
5
|
import { eodashKey } from "@/utils/keys";
|
|
6
6
|
import { indicator } from "@/store/states";
|
|
7
7
|
import { extractCollectionUrls } from "@/eodashSTAC/helpers";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
eodashCollections,
|
|
10
|
+
eodashCompareCollections,
|
|
11
|
+
collectionsPalette,
|
|
12
|
+
} from "@/utils/states";
|
|
9
13
|
import { EodashCollection } from "@/eodashSTAC/EodashCollection";
|
|
10
14
|
import log from "loglevel";
|
|
11
15
|
|
|
@@ -92,9 +96,10 @@ export const useSTAcStore = defineStore("stac", () => {
|
|
|
92
96
|
);
|
|
93
97
|
|
|
94
98
|
await Promise.all(
|
|
95
|
-
collectionUrls.map((cu) => {
|
|
99
|
+
collectionUrls.map((cu, idx) => {
|
|
96
100
|
const ec = new EodashCollection(cu);
|
|
97
101
|
ec.fetchCollection();
|
|
102
|
+
ec.color = collectionsPalette[idx % collectionsPalette.length];
|
|
98
103
|
return ec;
|
|
99
104
|
}),
|
|
100
105
|
).then((collections) => {
|
package/core/client/types.ts
CHANGED
|
@@ -229,7 +229,9 @@ export type Eodash<T extends ExecutionTime = "compiletime"> = {
|
|
|
229
229
|
* Dashboard theme as a custom [vuetifyJs
|
|
230
230
|
* theme](https://vuetifyjs.com/en/features/theme/).
|
|
231
231
|
*/
|
|
232
|
-
theme?: import("vuetify/lib/index.mjs").ThemeDefinition
|
|
232
|
+
theme?: import("vuetify/lib/index.mjs").ThemeDefinition & {
|
|
233
|
+
collectionsPalette?: string[];
|
|
234
|
+
};
|
|
233
235
|
/** Text applied to the footer. */
|
|
234
236
|
footerText?: string;
|
|
235
237
|
};
|
|
@@ -316,3 +318,10 @@ export declare const store: typeof import("@/store").default;
|
|
|
316
318
|
/////
|
|
317
319
|
|
|
318
320
|
export * from "./main.js";
|
|
321
|
+
|
|
322
|
+
export type EodashStyleJson = import("ol/style/webgl.js").WebGLStyle & {
|
|
323
|
+
variables?: Record<string, any>;
|
|
324
|
+
legend?: Record<string, any>;
|
|
325
|
+
jsonform?: Record<string, any>;
|
|
326
|
+
tooltip?: { id: string; title?: string; appendix?: string }[];
|
|
327
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import log from "loglevel";
|
|
2
|
+
import { collectionsPalette } from "./states";
|
|
1
3
|
/**
|
|
2
4
|
* Loads font in the app using `webfontloader`
|
|
3
5
|
*
|
|
@@ -49,3 +51,13 @@ export const copyToClipBoard = async (text, showIcon) => {
|
|
|
49
51
|
showIcon.value = false;
|
|
50
52
|
}, 2000);
|
|
51
53
|
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Sets the color palette for STAC indicators
|
|
57
|
+
* @param {string[]} colors
|
|
58
|
+
**/
|
|
59
|
+
export const setCollectionsPalette = (colors) => {
|
|
60
|
+
log.debug("Setting collections color palette", colors);
|
|
61
|
+
collectionsPalette.splice(0, collectionsPalette.length);
|
|
62
|
+
collectionsPalette.push(...colors);
|
|
63
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, shallowReactive } from "vue";
|
|
1
|
+
import { reactive, ref, shallowReactive } from "vue";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Array of eodash STAC Collections extracted from the current selected indicator.
|
|
@@ -20,3 +20,20 @@ export const eodashCompareCollections = shallowReactive([]);
|
|
|
20
20
|
|
|
21
21
|
/** whether the map postion was set in URL params on first load */
|
|
22
22
|
export const posIsSetFromUrl = ref(false);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Current value of the layer control JSON form for the latest layer the user interacted with.
|
|
26
|
+
* @type {import("vue").Ref<Record<string, any> | undefined>}
|
|
27
|
+
*/
|
|
28
|
+
export const layerControlFormValue = ref({});
|
|
29
|
+
/**
|
|
30
|
+
* STAC indicators color palette, defaults to Bank-Wong palette
|
|
31
|
+
* @type {string[]} */
|
|
32
|
+
export const collectionsPalette = reactive([
|
|
33
|
+
"#009E73",
|
|
34
|
+
"#0072B2",
|
|
35
|
+
"#E69F00",
|
|
36
|
+
"#CC79A7",
|
|
37
|
+
"#56B4E9",
|
|
38
|
+
"#D55E00",
|
|
39
|
+
]);
|
|
@@ -35,7 +35,9 @@ const eodash = await useEodashRuntime(props.config);
|
|
|
35
35
|
|
|
36
36
|
useURLSearchParametersSync();
|
|
37
37
|
|
|
38
|
-
const theme = useUpdateTheme("dashboardTheme",
|
|
38
|
+
const theme = useUpdateTheme("dashboardTheme", {
|
|
39
|
+
...(eodash.brand?.theme ?? {}),
|
|
40
|
+
});
|
|
39
41
|
theme.global.name.value = "dashboardTheme";
|
|
40
42
|
|
|
41
43
|
await loadFont(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openBlock, createBlock, withCtx, createElementVNode, unref, normalizeStyle, createElementBlock, Suspense, resolveDynamicComponent, mergeProps, createCommentVNode, Fragment, renderList, Transition } from 'vue';
|
|
2
2
|
import '@eox/layout';
|
|
3
|
-
import { _ as _export_sfc, F as useDefineTemplate } from './asWebComponent-
|
|
4
|
-
import { V as VMain } from './VMain-
|
|
3
|
+
import { _ as _export_sfc, F as useDefineTemplate } from './asWebComponent-CLUhauLl.js';
|
|
4
|
+
import { V as VMain } from './VMain-2GOqWb6m.js';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = ["gap"];
|
|
7
7
|
const _hoisted_2 = ["id", "h", "w", "x", "y"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withAsyncContext, ref, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
|
|
2
|
-
import { $ as useSTAcStore } from './asWebComponent-
|
|
2
|
+
import { $ as useSTAcStore } from './asWebComponent-CLUhauLl.js';
|
|
3
3
|
|
|
4
4
|
const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
|
|
5
5
|
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { resolveComponent, render, h, mergeProps, useCssVars, useTemplateRef, customRef, ref, computed, reactive, toRef, watch, onMounted, openBlock, createElementBlock, createVNode, unref, createSlots, withCtx, createElementVNode, withDirectives, createBlock, createCommentVNode, toHandlers } from 'vue';
|
|
2
|
+
import { DatePicker } from 'v-calendar';
|
|
3
|
+
import { E as isObject, Y as consoleError, t as useDisplay, Z as datetime, $ as useSTAcStore, a0 as eodashCollections, a1 as collectionsPalette, a2 as makePanelTransparent, V as VBtn, y as VIcon } from './asWebComponent-CLUhauLl.js';
|
|
4
|
+
import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
|
|
5
|
+
import log from 'loglevel';
|
|
6
|
+
import { V as VTooltip } from './VTooltip-BWg0dxx5.js';
|
|
7
|
+
|
|
8
|
+
// Utilities
|
|
9
|
+
function useDirectiveComponent(component, props) {
|
|
10
|
+
const concreteComponent = typeof component === 'string' ? resolveComponent(component) : component;
|
|
11
|
+
const hook = mountComponent(concreteComponent, props);
|
|
12
|
+
return {
|
|
13
|
+
mounted: hook,
|
|
14
|
+
updated: hook,
|
|
15
|
+
unmounted(el) {
|
|
16
|
+
render(null, el);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function mountComponent(component, props) {
|
|
21
|
+
return function (el, binding, vnode) {
|
|
22
|
+
const _props = typeof props === 'function' ? props(binding) : props;
|
|
23
|
+
const text = binding.value?.text ?? binding.value ?? _props?.text;
|
|
24
|
+
const value = isObject(binding.value) ? binding.value : {};
|
|
25
|
+
|
|
26
|
+
// Get the children from the props or directive value, or the element's children
|
|
27
|
+
const children = () => text ?? el.textContent;
|
|
28
|
+
|
|
29
|
+
// If vnode.ctx is the same as the instance, then we're bound to a plain element
|
|
30
|
+
// and need to find the nearest parent component instance to inherit provides from
|
|
31
|
+
const provides = (vnode.ctx === binding.instance.$ ? findComponentParent(vnode, binding.instance.$)?.provides : vnode.ctx?.provides) ?? binding.instance.$.provides;
|
|
32
|
+
const node = h(component, mergeProps(_props, value), children);
|
|
33
|
+
node.appContext = Object.assign(Object.create(null), binding.instance.$.appContext, {
|
|
34
|
+
provides
|
|
35
|
+
});
|
|
36
|
+
render(node, el);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function findComponentParent(vnode, root) {
|
|
40
|
+
// Walk the tree from root until we find the child vnode
|
|
41
|
+
const stack = new Set();
|
|
42
|
+
const walk = children => {
|
|
43
|
+
for (const child of children) {
|
|
44
|
+
if (!child) continue;
|
|
45
|
+
if (child === vnode || child.el && vnode.el && child.el === vnode.el) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
stack.add(child);
|
|
49
|
+
let result;
|
|
50
|
+
if (child.suspense) {
|
|
51
|
+
result = walk([child.ssContent]);
|
|
52
|
+
} else if (Array.isArray(child.children)) {
|
|
53
|
+
result = walk(child.children);
|
|
54
|
+
} else if (child.component?.vnode) {
|
|
55
|
+
result = walk([child.component?.subTree]);
|
|
56
|
+
}
|
|
57
|
+
if (result) {
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
stack.delete(child);
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
};
|
|
64
|
+
if (!walk([root.subTree])) {
|
|
65
|
+
consoleError('Could not find original vnode, component will not inherit provides');
|
|
66
|
+
return root;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Return the first component parent
|
|
70
|
+
const result = Array.from(stack).reverse();
|
|
71
|
+
for (const child of result) {
|
|
72
|
+
if (child.component) {
|
|
73
|
+
return child.component;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return root;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Components
|
|
80
|
+
const Tooltip = useDirectiveComponent(VTooltip, binding => {
|
|
81
|
+
return {
|
|
82
|
+
activator: 'parent',
|
|
83
|
+
location: binding.arg?.replace('-', ' '),
|
|
84
|
+
text: typeof binding.value === 'boolean' ? undefined : binding.value
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const _hoisted_1 = {
|
|
89
|
+
ref: "rootRef",
|
|
90
|
+
class: "datePicker"
|
|
91
|
+
};
|
|
92
|
+
const _hoisted_2 = {
|
|
93
|
+
class: "bg-surface d-flex flex-row align-center justify-center pb-1",
|
|
94
|
+
style: {"overflow":"hidden","width":"100%"}
|
|
95
|
+
};
|
|
96
|
+
const _hoisted_3 = {
|
|
97
|
+
class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
|
|
98
|
+
style: {"margin":"2px","min-width":"0"}
|
|
99
|
+
};
|
|
100
|
+
const _hoisted_4 = ["value"];
|
|
101
|
+
const _hoisted_5 = {
|
|
102
|
+
class: "d-flex flex-row align-center justify-center pb-1",
|
|
103
|
+
style: {"overflow":"hidden","width":"100%"}
|
|
104
|
+
};
|
|
105
|
+
const _hoisted_6 = {
|
|
106
|
+
class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
|
|
107
|
+
style: {"margin":"2px","min-width":"0"}
|
|
108
|
+
};
|
|
109
|
+
const _hoisted_7 = ["value"];
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
const _sfc_main = {
|
|
113
|
+
__name: 'EodashDatePicker',
|
|
114
|
+
props: {
|
|
115
|
+
hintText: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: null,
|
|
118
|
+
},
|
|
119
|
+
hideArrows: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
123
|
+
hideInputField: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false,
|
|
126
|
+
},
|
|
127
|
+
toggleCalendar: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
setup(__props) {
|
|
133
|
+
|
|
134
|
+
useCssVars(_ctx => ({
|
|
135
|
+
"45a34dce": (transform.value)
|
|
136
|
+
}));
|
|
137
|
+
|
|
138
|
+
const { lgAndDown } = useDisplay();
|
|
139
|
+
|
|
140
|
+
const rootEl = useTemplateRef("rootRef");
|
|
141
|
+
|
|
142
|
+
const datePickerEl = useTemplateRef("datePicker");
|
|
143
|
+
|
|
144
|
+
// holds the number value of the datetime
|
|
145
|
+
const currentDate = customRef((track, trigger) => ({
|
|
146
|
+
get() {
|
|
147
|
+
track();
|
|
148
|
+
return new Date(datetime.value).getTime();
|
|
149
|
+
},
|
|
150
|
+
/** @param {number} num */
|
|
151
|
+
set(num) {
|
|
152
|
+
trigger();
|
|
153
|
+
log.debug("Datepicker setting currentDate", datetime.value);
|
|
154
|
+
const date = new Date(num);
|
|
155
|
+
datetime.value = date.toISOString();
|
|
156
|
+
//@ts-expect-error supports move method https://vcalendar.io/datepicker/basics.html#basics
|
|
157
|
+
datePickerEl.value?.move({
|
|
158
|
+
month: date.getMonth() + 1,
|
|
159
|
+
year: date.getFullYear(),
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
const masks = ref({
|
|
165
|
+
input: "YYYY-MM-DD",
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
/** @param {Date} date */
|
|
169
|
+
const formatDate = (date) => {
|
|
170
|
+
const years = date.getFullYear();
|
|
171
|
+
const month = date.getMonth() + 1;
|
|
172
|
+
const day = date.getDate();
|
|
173
|
+
return `${years}-${month < 10 ? "0" + month : month}-${
|
|
174
|
+
day < 10 ? "0" + day : day
|
|
175
|
+
}`;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @param e {Event}
|
|
180
|
+
*/
|
|
181
|
+
const onInputChange = (e) => {
|
|
182
|
+
currentDate.value = new Date(
|
|
183
|
+
/** @type {HTMLInputElement} */ (e.target)?.value,
|
|
184
|
+
).getTime();
|
|
185
|
+
};
|
|
186
|
+
const maskedCurrentDate = computed(() =>
|
|
187
|
+
formatDate(new Date(currentDate.value)),
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Attributes displayed on datepicker
|
|
194
|
+
*
|
|
195
|
+
* @type {import("vue").Reactive<
|
|
196
|
+
* (
|
|
197
|
+
* | Partial<import("v-calendar/dist/types/src/utils/attribute").AttributeConfig>
|
|
198
|
+
* | undefined
|
|
199
|
+
* )[]
|
|
200
|
+
* >}
|
|
201
|
+
*/
|
|
202
|
+
const attributes = reactive([]);
|
|
203
|
+
|
|
204
|
+
const selectedStac = toRef(useSTAcStore(), "selectedStac");
|
|
205
|
+
|
|
206
|
+
watch(
|
|
207
|
+
selectedStac,
|
|
208
|
+
async (updatedStac, previousStac) => {
|
|
209
|
+
if (updatedStac && previousStac?.id !== updatedStac.id) {
|
|
210
|
+
log.debug("Datepicker selected STAC change triggered");
|
|
211
|
+
// remove old values
|
|
212
|
+
attributes.splice(0, attributes.length);
|
|
213
|
+
|
|
214
|
+
for (let idx = 0; idx < eodashCollections.length; idx++) {
|
|
215
|
+
log.debug("Retrieving dates", eodashCollections[idx]);
|
|
216
|
+
await eodashCollections[idx].fetchCollection();
|
|
217
|
+
|
|
218
|
+
const dates = [
|
|
219
|
+
...new Set(
|
|
220
|
+
eodashCollections[idx].getItems()?.reduce((valid, it) => {
|
|
221
|
+
const parsed = Date.parse(/** @type {string} */ (it.datetime));
|
|
222
|
+
if (parsed) {
|
|
223
|
+
valid.push(new Date(parsed));
|
|
224
|
+
}
|
|
225
|
+
return valid;
|
|
226
|
+
}, /** @type {Date[]} */ ([])),
|
|
227
|
+
),
|
|
228
|
+
];
|
|
229
|
+
attributes.push({
|
|
230
|
+
key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
|
|
231
|
+
dot: {
|
|
232
|
+
style: {
|
|
233
|
+
backgroundColor:
|
|
234
|
+
collectionsPalette[idx % collectionsPalette.length],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
dates,
|
|
238
|
+
content: {
|
|
239
|
+
style: {
|
|
240
|
+
color: "#000000",
|
|
241
|
+
"font-weight": "bold",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{ immediate: true },
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @param {boolean} reverse
|
|
253
|
+
*/
|
|
254
|
+
function jumpDate(reverse) {
|
|
255
|
+
if (attributes.length) {
|
|
256
|
+
let latestDateMS = reverse ? Infinity : -Infinity;
|
|
257
|
+
attributes.forEach((coll) => {
|
|
258
|
+
if (coll?.dates) {
|
|
259
|
+
coll.dates.forEach((d) => {
|
|
260
|
+
// TODO: we need to handle time ranges and other options here
|
|
261
|
+
if (d instanceof Date) {
|
|
262
|
+
const mathFun = reverse ? "min" : "max";
|
|
263
|
+
latestDateMS = Math[mathFun](latestDateMS, d.getTime());
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
currentDate.value =
|
|
269
|
+
latestDateMS === -Infinity
|
|
270
|
+
? Date.now()
|
|
271
|
+
: latestDateMS === Infinity
|
|
272
|
+
? 0
|
|
273
|
+
: latestDateMS;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// fixes calendar dispalcement on lib mode
|
|
278
|
+
const transform = ref("");
|
|
279
|
+
onMounted(() => {
|
|
280
|
+
transform.value = document.querySelector("eo-dash")
|
|
281
|
+
? "translate3d(50px,-80px,0)"
|
|
282
|
+
: "translate3d(0px,-80px,0)";
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
makePanelTransparent(rootEl);
|
|
286
|
+
|
|
287
|
+
return (_ctx, _cache) => {
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
293
|
+
createVNode(unref(DatePicker), {
|
|
294
|
+
ref: "datePicker",
|
|
295
|
+
modelValue: currentDate.value,
|
|
296
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((currentDate).value = $event)),
|
|
297
|
+
modelModifiers: { number: true },
|
|
298
|
+
attributes: attributes,
|
|
299
|
+
masks: masks.value,
|
|
300
|
+
expanded: "",
|
|
301
|
+
class: "bg-surface overflow-auto",
|
|
302
|
+
style: {"background-color":"transparent","max-width":"100%"}
|
|
303
|
+
}, createSlots({ _: 2 /* DYNAMIC */ }, [
|
|
304
|
+
(__props.toggleCalendar)
|
|
305
|
+
? {
|
|
306
|
+
name: "default",
|
|
307
|
+
fn: withCtx(({ inputValue, inputEvents }) => [
|
|
308
|
+
createElementVNode("div", _hoisted_2, [
|
|
309
|
+
(!__props.hideArrows)
|
|
310
|
+
? withDirectives((openBlock(), createBlock(VBtn, {
|
|
311
|
+
key: 0,
|
|
312
|
+
density: "compact",
|
|
313
|
+
size: unref(lgAndDown) ? 'x-small' : 'large',
|
|
314
|
+
variant: "text",
|
|
315
|
+
onClick: _cache[0] || (_cache[0] = $event => (jumpDate(true))),
|
|
316
|
+
class: "py-2",
|
|
317
|
+
style: {"flex-shrink":"1"}
|
|
318
|
+
}, {
|
|
319
|
+
default: withCtx(() => [
|
|
320
|
+
createVNode(VIcon, {
|
|
321
|
+
icon: [unref(mdiRayEndArrow)]
|
|
322
|
+
}, null, 8 /* PROPS */, ["icon"])
|
|
323
|
+
]),
|
|
324
|
+
_: 1 /* STABLE */
|
|
325
|
+
}, 8 /* PROPS */, ["size"])), [
|
|
326
|
+
[Tooltip, 'Set date to oldest available dataset', "bottom"]
|
|
327
|
+
])
|
|
328
|
+
: createCommentVNode("v-if", true),
|
|
329
|
+
createElementVNode("div", _hoisted_3, [
|
|
330
|
+
(!__props.hideInputField)
|
|
331
|
+
? (openBlock(), createElementBlock("input", mergeProps({
|
|
332
|
+
key: 0,
|
|
333
|
+
value: inputValue
|
|
334
|
+
}, toHandlers(inputEvents, true), {
|
|
335
|
+
class: "flex-grow px-1 py-1 dark:bg-gray-700",
|
|
336
|
+
style: {"margin":"1px","width":"100%","white-space":"nowrap","overflow":"hidden","text-overflow":"ellipsis"}
|
|
337
|
+
}), null, 16 /* FULL_PROPS */, _hoisted_4))
|
|
338
|
+
: createCommentVNode("v-if", true)
|
|
339
|
+
]),
|
|
340
|
+
(!__props.hideArrows)
|
|
341
|
+
? withDirectives((openBlock(), createBlock(VBtn, {
|
|
342
|
+
key: 1,
|
|
343
|
+
density: "compact",
|
|
344
|
+
size: unref(lgAndDown) ? 'x-small' : 'large',
|
|
345
|
+
variant: "text",
|
|
346
|
+
onClick: _cache[1] || (_cache[1] = $event => (jumpDate(false))),
|
|
347
|
+
class: "py-2",
|
|
348
|
+
style: {"flex-shrink":"1"}
|
|
349
|
+
}, {
|
|
350
|
+
default: withCtx(() => [
|
|
351
|
+
createVNode(VIcon, {
|
|
352
|
+
icon: [unref(mdiRayStartArrow)]
|
|
353
|
+
}, null, 8 /* PROPS */, ["icon"])
|
|
354
|
+
]),
|
|
355
|
+
_: 1 /* STABLE */
|
|
356
|
+
}, 8 /* PROPS */, ["size"])), [
|
|
357
|
+
[Tooltip, 'Set date to latest available dataset', "bottom"]
|
|
358
|
+
])
|
|
359
|
+
: createCommentVNode("v-if", true)
|
|
360
|
+
])
|
|
361
|
+
]),
|
|
362
|
+
key: "0"
|
|
363
|
+
}
|
|
364
|
+
: {
|
|
365
|
+
name: "footer",
|
|
366
|
+
fn: withCtx(() => [
|
|
367
|
+
createElementVNode("div", _hoisted_5, [
|
|
368
|
+
(!__props.hideArrows)
|
|
369
|
+
? withDirectives((openBlock(), createBlock(VBtn, {
|
|
370
|
+
key: 0,
|
|
371
|
+
density: "compact",
|
|
372
|
+
size: unref(lgAndDown) ? 'x-small' : 'large',
|
|
373
|
+
variant: "text",
|
|
374
|
+
onClick: _cache[2] || (_cache[2] = $event => (jumpDate(true))),
|
|
375
|
+
class: "py-2",
|
|
376
|
+
style: {"flex-shrink":"1"}
|
|
377
|
+
}, {
|
|
378
|
+
default: withCtx(() => [
|
|
379
|
+
createVNode(VIcon, {
|
|
380
|
+
icon: [unref(mdiRayEndArrow)]
|
|
381
|
+
}, null, 8 /* PROPS */, ["icon"])
|
|
382
|
+
]),
|
|
383
|
+
_: 1 /* STABLE */
|
|
384
|
+
}, 8 /* PROPS */, ["size"])), [
|
|
385
|
+
[Tooltip, 'Set date to oldest available dataset', "bottom"]
|
|
386
|
+
])
|
|
387
|
+
: createCommentVNode("v-if", true),
|
|
388
|
+
createElementVNode("div", _hoisted_6, [
|
|
389
|
+
(!__props.hideInputField)
|
|
390
|
+
? (openBlock(), createElementBlock("input", {
|
|
391
|
+
key: 0,
|
|
392
|
+
value: maskedCurrentDate.value,
|
|
393
|
+
onChange: onInputChange,
|
|
394
|
+
class: "flex-grow px-1 py-1 dark:bg-gray-700",
|
|
395
|
+
style: {"margin":"1px","width":"100%","white-space":"nowrap","overflow":"hidden","text-overflow":"ellipsis"}
|
|
396
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_7))
|
|
397
|
+
: createCommentVNode("v-if", true)
|
|
398
|
+
]),
|
|
399
|
+
(!__props.hideArrows)
|
|
400
|
+
? withDirectives((openBlock(), createBlock(VBtn, {
|
|
401
|
+
key: 1,
|
|
402
|
+
density: "compact",
|
|
403
|
+
size: unref(lgAndDown) ? 'x-small' : 'large',
|
|
404
|
+
variant: "text",
|
|
405
|
+
onClick: _cache[3] || (_cache[3] = $event => (jumpDate(false))),
|
|
406
|
+
class: "py-2",
|
|
407
|
+
style: {"flex-shrink":"1"}
|
|
408
|
+
}, {
|
|
409
|
+
default: withCtx(() => [
|
|
410
|
+
createVNode(VIcon, {
|
|
411
|
+
icon: [unref(mdiRayStartArrow)]
|
|
412
|
+
}, null, 8 /* PROPS */, ["icon"])
|
|
413
|
+
]),
|
|
414
|
+
_: 1 /* STABLE */
|
|
415
|
+
}, 8 /* PROPS */, ["size"])), [
|
|
416
|
+
[Tooltip, 'Set date to latest available dataset', "bottom"]
|
|
417
|
+
])
|
|
418
|
+
: createCommentVNode("v-if", true)
|
|
419
|
+
])
|
|
420
|
+
]),
|
|
421
|
+
key: "1"
|
|
422
|
+
}
|
|
423
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "attributes", "masks"])
|
|
424
|
+
], 512 /* NEED_PATCH */))
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export { _sfc_main as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, ref, openBlock, createElementBlock, mergeProps, unref, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
-
import { t as useDisplay, $ as useSTAcStore } from './asWebComponent-
|
|
2
|
+
import { t as useDisplay, $ as useSTAcStore } from './asWebComponent-CLUhauLl.js';
|
|
3
3
|
import '@eox/itemfilter';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = [".items"];
|
|
@@ -3,7 +3,7 @@ import '@eox/layercontrol';
|
|
|
3
3
|
import '@eox/jsonform';
|
|
4
4
|
import '@eox/timecontrol';
|
|
5
5
|
import 'color-legend-element';
|
|
6
|
-
import { $ as useSTAcStore,
|
|
6
|
+
import { $ as useSTAcStore, a3 as mapCompareEl, a4 as mapEl, a5 as eodashCompareCollections, a0 as eodashCollections, a6 as layerControlFormValue, a7 as getColFromLayer } from './asWebComponent-CLUhauLl.js';
|
|
7
7
|
import { storeToRefs } from 'pinia';
|
|
8
8
|
|
|
9
9
|
const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
|
|
@@ -97,6 +97,13 @@ const debouncedHandleDateTime = (evt) => {
|
|
|
97
97
|
}, 500);
|
|
98
98
|
};
|
|
99
99
|
// ------
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @param {Event & {detail:{layer:import("ol/layer").Layer;jsonformValue:Record<string,any>}}} evt
|
|
103
|
+
*/
|
|
104
|
+
const onLayerConfigChange = (evt) => {
|
|
105
|
+
layerControlFormValue.value = evt.detail.jsonformValue;
|
|
106
|
+
};
|
|
100
107
|
|
|
101
108
|
return (_ctx, _cache) => {
|
|
102
109
|
return (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
@@ -108,7 +115,8 @@ return (_ctx, _cache) => {
|
|
|
108
115
|
toolsAsList: "true",
|
|
109
116
|
style: {"--eox-background-color":"transparent"},
|
|
110
117
|
ref_key: "eoxLayercontrol",
|
|
111
|
-
ref: eoxLayercontrol
|
|
118
|
+
ref: eoxLayercontrol,
|
|
119
|
+
"on:layerConfig:change": onLayerConfigChange
|
|
112
120
|
}), null, 16 /* FULL_PROPS */, _hoisted_2))
|
|
113
121
|
: createCommentVNode("v-if", true)
|
|
114
122
|
]))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, openBlock, createElementBlock, createVNode, withCtx, mergeProps } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { a2 as makePanelTransparent, y as VIcon, al as activeTemplate } from './asWebComponent-CLUhauLl.js';
|
|
3
3
|
import { mdiViewDashboard } from '@mdi/js';
|
|
4
|
-
import { V as VTooltip } from './VTooltip-
|
|
4
|
+
import { V as VTooltip } from './VTooltip-BWg0dxx5.js';
|
|
5
5
|
|
|
6
6
|
const _sfc_main = {
|
|
7
7
|
__name: 'EodashLayoutSwitcher',
|