@eodash/eodash 5.0.0-rc.1 → 5.0.0-rc.1.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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/core/client/composables/EodashMap.js +19 -5
  3. package/core/client/composables/EodashProcess.js +51 -5
  4. package/core/client/eodash.js +8 -7
  5. package/core/client/eodashSTAC/EodashCollection.js +16 -0
  6. package/core/client/eodashSTAC/createLayers.js +61 -4
  7. package/core/client/eodashSTAC/helpers.js +39 -4
  8. package/core/client/types.ts +7 -0
  9. package/core/client/utils/states.js +3 -0
  10. package/dist/client/{DashboardLayout-FS5inBIm.js → DashboardLayout-SZfMDUoR.js} +2 -2
  11. package/dist/client/{DynamicWebComponent-CBSgT677.js → DynamicWebComponent-I9gzMY0L.js} +1 -1
  12. package/dist/client/EodashDatePicker-B9_u6TTm.js +405 -0
  13. package/dist/client/{EodashItemFilter-CFNKjm_Z.js → EodashItemFilter-G7YsYO3B.js} +1 -1
  14. package/dist/client/{EodashLayerControl-CzffoPUs.js → EodashLayerControl-CJ94ul63.js} +10 -2
  15. package/dist/client/{EodashLayoutSwitcher-DM0zDhvI.js → EodashLayoutSwitcher-DRKm8A8U.js} +2 -2
  16. package/dist/client/{EodashMap-BdFZ657e.js → EodashMap-Dp44Ajbi.js} +60 -10
  17. package/dist/client/{EodashMapBtns-rC_IPD-Z.js → EodashMapBtns-BlPFwhPc.js} +4 -4
  18. package/dist/client/{EodashProcess-SLsTISKV.js → EodashProcess-BLmIgUGT.js} +158 -25
  19. package/dist/client/{EodashStacInfo-DFD0gtWm.js → EodashStacInfo-BIRcfcMo.js} +1 -1
  20. package/dist/client/{EodashTools-ImohD2ys.js → EodashTools-PNfJ-Cw3.js} +4 -4
  21. package/dist/client/{ExportState-LNZAovzM.js → ExportState-5JyTshJH.js} +4 -4
  22. package/dist/client/{Footer-c19dV1ZR.js → Footer-CM9hgdQP.js} +1 -1
  23. package/dist/client/{Header-CcvXFqqt.js → Header-BTq4DW1x.js} +3 -3
  24. package/dist/client/{MobileLayout-OM6Wc-vj.js → MobileLayout-Atfoxf8d.js} +5 -5
  25. package/dist/client/{PopUp-B0_c0207.js → PopUp-Bmfn3N_4.js} +3 -3
  26. package/dist/client/{VImg-BpDhCbL0.js → VImg-CUF4S39i.js} +2 -2
  27. package/dist/client/{VMain-DC05bDwX.js → VMain-CQpXnzDR.js} +1 -1
  28. package/dist/client/{VOverlay-C7EUyVe_.js → VOverlay-DUnITwM1.js} +3 -3
  29. package/dist/client/{VTooltip-C78suika.js → VTooltip-BYTlbKer.js} +3 -3
  30. package/dist/client/{WidgetsContainer-sD1vDnhF.js → WidgetsContainer-BPbgxdb0.js} +1 -1
  31. package/dist/client/{asWebComponent-D8bMMCEr.js → asWebComponent-DW1XzZkL.js} +138 -27
  32. package/dist/client/eo-dash.css +1 -1
  33. package/dist/client/eo-dash.js +1 -1
  34. package/dist/client/{forwardRefs-yw6tFXER.js → forwardRefs-gx1Fzngc.js} +1 -1
  35. package/dist/client/{index-CpK_Yaom.js → index-DvFppNyk.js} +1 -1
  36. package/dist/client/{transition-B2YwqAYJ.js → transition-j2eWJYMg.js} +1 -1
  37. package/dist/types/core/client/App.vue.d.ts +7 -0
  38. package/dist/types/core/client/asWebComponent.d.ts +9 -0
  39. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -0
  40. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +20 -0
  41. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
  42. package/dist/types/core/client/components/Footer.vue.d.ts +106 -0
  43. package/dist/types/core/client/components/Header.vue.d.ts +2 -0
  44. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +7 -0
  45. package/dist/types/core/client/components/Loading.vue.d.ts +2 -0
  46. package/dist/types/core/client/components/MobileLayout.vue.d.ts +312 -0
  47. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -0
  48. package/dist/types/core/client/composables/DefineTemplate.d.ts +15 -0
  49. package/dist/types/core/client/composables/DefineWidgets.d.ts +14 -0
  50. package/dist/types/core/client/composables/EodashMap.d.ts +6 -0
  51. package/dist/types/core/client/composables/EodashProcess.d.ts +162 -0
  52. package/dist/types/core/client/composables/index.d.ts +9 -0
  53. package/dist/types/core/client/eodash.d.ts +8 -0
  54. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +113 -0
  55. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +45 -0
  56. package/dist/types/core/client/eodashSTAC/helpers.d.ts +135 -0
  57. package/dist/types/core/client/eodashSTAC/triggers.d.ts +1 -0
  58. package/dist/types/core/client/main.d.ts +2 -0
  59. package/dist/types/core/client/plugins/axios.d.ts +2 -0
  60. package/dist/types/core/client/plugins/index.d.ts +3 -0
  61. package/dist/types/core/client/plugins/vuetify.d.ts +82 -0
  62. package/dist/types/core/client/render.d.ts +1 -0
  63. package/dist/types/core/client/store/actions.d.ts +12 -0
  64. package/dist/types/core/client/store/index.d.ts +11 -0
  65. package/dist/types/core/client/store/stac.d.ts +25 -0
  66. package/dist/types/core/client/store/states.d.ts +22 -0
  67. package/dist/types/core/client/types.d.ts +279 -0
  68. package/dist/types/core/client/utils/index.d.ts +2 -0
  69. package/dist/types/core/client/utils/keys.d.ts +8 -0
  70. package/dist/types/core/client/utils/states.d.ts +20 -0
  71. package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
  72. package/dist/types/widgets/EodashDatePicker.vue.d.ts +15 -0
  73. package/dist/types/widgets/EodashItemFilter.vue.d.ts +44 -0
  74. package/dist/types/widgets/EodashLayerControl.vue.d.ts +13 -0
  75. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +11 -0
  76. package/dist/types/widgets/EodashMap.vue.d.ts +14 -0
  77. package/dist/types/widgets/EodashMapBtns.vue.d.ts +13 -0
  78. package/dist/types/widgets/EodashProcess.vue.d.ts +4 -0
  79. package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
  80. package/dist/types/widgets/EodashTools.vue.d.ts +19 -0
  81. package/dist/types/widgets/ExportState.vue.d.ts +7 -0
  82. package/dist/types/widgets/PopUp.vue.d.ts +27 -0
  83. package/dist/types/widgets/WidgetsContainer.vue.d.ts +10 -0
  84. package/package.json +11 -11
  85. package/widgets/EodashDatePicker.vue +89 -6
  86. package/widgets/EodashLayerControl.vue +13 -1
  87. package/widgets/EodashMap.vue +51 -5
  88. package/widgets/EodashProcess.vue +57 -11
  89. package/dist/client/EodashDatePicker-BGSS2ZYK.js +0 -306
@@ -0,0 +1,405 @@
1
+ import { resolveComponent, render, h, mergeProps, useCssVars, customRef, ref, 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 makePanelTransparent, V as VBtn, y as VIcon } from './asWebComponent-DW1XzZkL.js';
4
+ import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
5
+ import log from 'loglevel';
6
+ import { V as VTooltip } from './VTooltip-BYTlbKer.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
+ class: "bg-surface d-flex flex-row align-center justify-center pb-1",
90
+ style: {"overflow":"hidden","width":"100%"}
91
+ };
92
+ const _hoisted_2 = {
93
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
94
+ style: {"margin":"2px","min-width":"0"}
95
+ };
96
+ const _hoisted_3 = ["value"];
97
+ const _hoisted_4 = {
98
+ class: "d-flex flex-row align-center justify-center pb-1",
99
+ style: {"overflow":"hidden","width":"100%"}
100
+ };
101
+ const _hoisted_5 = {
102
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
103
+ style: {"margin":"2px","min-width":"0"}
104
+ };
105
+ const _hoisted_6 = ["value"];
106
+
107
+
108
+ const _sfc_main = {
109
+ __name: 'EodashDatePicker',
110
+ props: {
111
+ hintText: {
112
+ type: String,
113
+ default: null,
114
+ },
115
+ hideArrows: {
116
+ type: Boolean,
117
+ default: false,
118
+ },
119
+ hideInputField: {
120
+ type: Boolean,
121
+ default: false,
122
+ },
123
+ toggleCalendar: {
124
+ type: Boolean,
125
+ default: false,
126
+ },
127
+ },
128
+ setup(__props) {
129
+
130
+ useCssVars(_ctx => ({
131
+ "ad11927a": (transform.value)
132
+ }));
133
+
134
+ const { lgAndDown } = useDisplay();
135
+
136
+ // holds the number value of the datetime
137
+ const currentDate = customRef((track, trigger) => ({
138
+ get() {
139
+ track();
140
+ return new Date(datetime.value).getTime();
141
+ },
142
+ /** @param {number} num */
143
+ set(num) {
144
+ trigger();
145
+ log.debug("Datepicker setting currentDate", datetime.value);
146
+ datetime.value = new Date(num).toISOString();
147
+ },
148
+ }));
149
+
150
+ const masks = ref({
151
+ input: "YYYY-MM-DD",
152
+ });
153
+
154
+
155
+
156
+ /**
157
+ * Attributes displayed on datepicker
158
+ *
159
+ * @type {import("vue").Reactive<
160
+ * (
161
+ * | Partial<import("v-calendar/dist/types/src/utils/attribute").AttributeConfig>
162
+ * | undefined
163
+ * )[]
164
+ * >}
165
+ */
166
+ const attributes = reactive([]);
167
+
168
+ /** @type {import("vue").Ref<HTMLDivElement|null>} */
169
+ const rootRef = ref(null);
170
+
171
+ const selectedStac = toRef(useSTAcStore(), "selectedStac");
172
+
173
+ watch(
174
+ selectedStac,
175
+ async (updatedStac, previousStac) => {
176
+ if (updatedStac && previousStac?.id !== updatedStac.id) {
177
+ log.debug("Datepicker selected STAC change triggered");
178
+ const wongPalette = [
179
+ "#009E73",
180
+ "#0072B2",
181
+ "#E69F00",
182
+ "#CC79A7",
183
+ "#56B4E9",
184
+ "#D55E00",
185
+ ];
186
+ // remove old values
187
+ attributes.splice(0, attributes.length);
188
+
189
+ for (let idx = 0; idx < eodashCollections.length; idx++) {
190
+ log.debug("Retrieving dates", eodashCollections[idx]);
191
+ await eodashCollections[idx].fetchCollection();
192
+ const dates = [
193
+ ...new Set(
194
+ eodashCollections[idx].getItems()?.reduce((valid, it) => {
195
+ const parsed = Date.parse(/** @type {string} */ (it.datetime));
196
+ if (parsed) {
197
+ valid.push(new Date(parsed));
198
+ }
199
+ return valid;
200
+ }, /** @type {Date[]} */ ([])),
201
+ ),
202
+ ];
203
+ attributes.push({
204
+ key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
205
+ dot: {
206
+ style: {
207
+ backgroundColor: wongPalette[idx % wongPalette.length],
208
+ },
209
+ },
210
+ dates,
211
+ content: {
212
+ style: {
213
+ color: "#000000",
214
+ "font-weight": "bold",
215
+ },
216
+ },
217
+ });
218
+ }
219
+ }
220
+ },
221
+ { immediate: true },
222
+ );
223
+
224
+ /**
225
+ * @param {boolean} reverse
226
+ */
227
+ function jumpDate(reverse) {
228
+ if (attributes.length) {
229
+ let latestDateMS = reverse ? Infinity : -Infinity;
230
+ attributes.forEach((coll) => {
231
+ if (coll?.dates) {
232
+ coll.dates.forEach((d) => {
233
+ // TODO: we need to handle time ranges and other options here
234
+ if (d instanceof Date) {
235
+ const mathFun = reverse ? "min" : "max";
236
+ latestDateMS = Math[mathFun](latestDateMS, d.getTime());
237
+ }
238
+ });
239
+ }
240
+ });
241
+ currentDate.value =
242
+ latestDateMS === -Infinity
243
+ ? Date.now()
244
+ : latestDateMS === Infinity
245
+ ? 0
246
+ : latestDateMS;
247
+ }
248
+ }
249
+
250
+ // fixes calendar dispalcement on lib mode
251
+ const transform = ref("");
252
+ onMounted(() => {
253
+ transform.value = document.querySelector("eo-dash")
254
+ ? "translate3d(50px,-80px,0)"
255
+ : "translate3d(0px,-80px,0)";
256
+ });
257
+
258
+ makePanelTransparent(rootRef);
259
+
260
+ return (_ctx, _cache) => {
261
+
262
+
263
+
264
+
265
+ return (openBlock(), createElementBlock("div", {
266
+ ref_key: "rootRef",
267
+ ref: rootRef,
268
+ class: "datePicker"
269
+ }, [
270
+ createVNode(unref(DatePicker), {
271
+ modelValue: currentDate.value,
272
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((currentDate).value = $event)),
273
+ modelModifiers: { number: true },
274
+ attributes: attributes,
275
+ masks: masks.value,
276
+ expanded: "",
277
+ class: "bg-surface overflow-auto",
278
+ style: {"background-color":"transparent","max-width":"100%"}
279
+ }, createSlots({ _: 2 /* DYNAMIC */ }, [
280
+ (__props.toggleCalendar)
281
+ ? {
282
+ name: "default",
283
+ fn: withCtx(({ inputValue, inputEvents }) => [
284
+ createElementVNode("div", _hoisted_1, [
285
+ (!__props.hideArrows)
286
+ ? withDirectives((openBlock(), createBlock(VBtn, {
287
+ key: 0,
288
+ density: "compact",
289
+ size: unref(lgAndDown) ? 'x-small' : 'large',
290
+ variant: "text",
291
+ onClick: _cache[0] || (_cache[0] = $event => (jumpDate(true))),
292
+ class: "py-2",
293
+ style: {"flex-shrink":"1"}
294
+ }, {
295
+ default: withCtx(() => [
296
+ createVNode(VIcon, {
297
+ icon: [unref(mdiRayEndArrow)]
298
+ }, null, 8 /* PROPS */, ["icon"])
299
+ ]),
300
+ _: 1 /* STABLE */
301
+ }, 8 /* PROPS */, ["size"])), [
302
+ [Tooltip, 'Set date to oldest available dataset', "bottom"]
303
+ ])
304
+ : createCommentVNode("v-if", true),
305
+ createElementVNode("div", _hoisted_2, [
306
+ (!__props.hideInputField)
307
+ ? (openBlock(), createElementBlock("input", mergeProps({
308
+ key: 0,
309
+ value: inputValue
310
+ }, toHandlers(inputEvents, true), {
311
+ class: "flex-grow px-1 py-1 dark:bg-gray-700",
312
+ style: {"margin":"1px","width":"100%","white-space":"nowrap","overflow":"hidden","text-overflow":"ellipsis"}
313
+ }), null, 16 /* FULL_PROPS */, _hoisted_3))
314
+ : createCommentVNode("v-if", true)
315
+ ]),
316
+ (!__props.hideArrows)
317
+ ? withDirectives((openBlock(), createBlock(VBtn, {
318
+ key: 1,
319
+ density: "compact",
320
+ size: unref(lgAndDown) ? 'x-small' : 'large',
321
+ variant: "text",
322
+ onClick: _cache[1] || (_cache[1] = $event => (jumpDate(false))),
323
+ class: "py-2",
324
+ style: {"flex-shrink":"1"}
325
+ }, {
326
+ default: withCtx(() => [
327
+ createVNode(VIcon, {
328
+ icon: [unref(mdiRayStartArrow)]
329
+ }, null, 8 /* PROPS */, ["icon"])
330
+ ]),
331
+ _: 1 /* STABLE */
332
+ }, 8 /* PROPS */, ["size"])), [
333
+ [Tooltip, 'Set date to latest available dataset', "bottom"]
334
+ ])
335
+ : createCommentVNode("v-if", true)
336
+ ])
337
+ ]),
338
+ key: "0"
339
+ }
340
+ : {
341
+ name: "footer",
342
+ fn: withCtx(() => [
343
+ createElementVNode("div", _hoisted_4, [
344
+ (!__props.hideArrows)
345
+ ? withDirectives((openBlock(), createBlock(VBtn, {
346
+ key: 0,
347
+ density: "compact",
348
+ size: unref(lgAndDown) ? 'x-small' : 'large',
349
+ variant: "text",
350
+ onClick: _cache[2] || (_cache[2] = $event => (jumpDate(true))),
351
+ class: "py-2",
352
+ style: {"flex-shrink":"1"}
353
+ }, {
354
+ default: withCtx(() => [
355
+ createVNode(VIcon, {
356
+ icon: [unref(mdiRayEndArrow)]
357
+ }, null, 8 /* PROPS */, ["icon"])
358
+ ]),
359
+ _: 1 /* STABLE */
360
+ }, 8 /* PROPS */, ["size"])), [
361
+ [Tooltip, 'Set date to oldest available dataset', "bottom"]
362
+ ])
363
+ : createCommentVNode("v-if", true),
364
+ createElementVNode("div", _hoisted_5, [
365
+ (!__props.hideInputField)
366
+ ? (openBlock(), createElementBlock("input", {
367
+ key: 0,
368
+ value: new Date(currentDate.value).toLocaleDateString(),
369
+ class: "flex-grow px-1 py-1 dark:bg-gray-700",
370
+ style: {"margin":"1px","width":"100%","white-space":"nowrap","overflow":"hidden","text-overflow":"ellipsis"}
371
+ }, null, 8 /* PROPS */, _hoisted_6))
372
+ : createCommentVNode("v-if", true)
373
+ ]),
374
+ (!__props.hideArrows)
375
+ ? withDirectives((openBlock(), createBlock(VBtn, {
376
+ key: 1,
377
+ density: "compact",
378
+ size: unref(lgAndDown) ? 'x-small' : 'large',
379
+ variant: "text",
380
+ onClick: _cache[3] || (_cache[3] = $event => (jumpDate(false))),
381
+ class: "py-2",
382
+ style: {"flex-shrink":"1"}
383
+ }, {
384
+ default: withCtx(() => [
385
+ createVNode(VIcon, {
386
+ icon: [unref(mdiRayStartArrow)]
387
+ }, null, 8 /* PROPS */, ["icon"])
388
+ ]),
389
+ _: 1 /* STABLE */
390
+ }, 8 /* PROPS */, ["size"])), [
391
+ [Tooltip, 'Set date to latest available dataset', "bottom"]
392
+ ])
393
+ : createCommentVNode("v-if", true)
394
+ ])
395
+ ]),
396
+ key: "1"
397
+ }
398
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "attributes", "masks"])
399
+ ], 512 /* NEED_PATCH */))
400
+ }
401
+ }
402
+
403
+ };
404
+
405
+ 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-D8bMMCEr.js';
2
+ import { t as useDisplay, $ as useSTAcStore } from './asWebComponent-DW1XzZkL.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, a2 as mapCompareEl, a3 as mapEl, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as getColFromLayer } from './asWebComponent-D8bMMCEr.js';
6
+ import { $ as useSTAcStore, a2 as mapCompareEl, a3 as mapEl, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as layerControlFormValue, a6 as getColFromLayer } from './asWebComponent-DW1XzZkL.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 { a1 as makePanelTransparent, y as VIcon, ak as activeTemplate } from './asWebComponent-D8bMMCEr.js';
2
+ import { a1 as makePanelTransparent, y as VIcon, al as activeTemplate } from './asWebComponent-DW1XzZkL.js';
3
3
  import { mdiViewDashboard } from '@mdi/js';
4
- import { V as VTooltip } from './VTooltip-C78suika.js';
4
+ import { V as VTooltip } from './VTooltip-BYTlbKer.js';
5
5
 
6
6
  const _sfc_main = {
7
7
  __name: 'EodashLayoutSwitcher',
@@ -1,10 +1,11 @@
1
- import { onMounted, onUnmounted, watch, nextTick, toRaw, ref, computed, openBlock, createElementBlock, createElementVNode, unref } from 'vue';
1
+ import { onMounted, onUnmounted, watch, nextTick, ref, toRaw, computed, openBlock, createElementBlock, createElementVNode, unref, withDirectives, vShow } from 'vue';
2
2
  import '@eox/map';
3
3
  import '@eox/map/src/plugins/advancedLayersAndSources';
4
- import { a6 as registerProjection, a7 as getProjectionCode, a8 as availableMapProjection, a9 as changeMapProjection, aa as eoxLayersKey, $ as useSTAcStore, ab as posIsSetFromUrl, ac as EodashCollection, ad as mapPosition, a3 as mapEl, a2 as mapCompareEl, Z as datetime, a4 as eodashCompareCollections, a0 as eodashCollections } from './asWebComponent-D8bMMCEr.js';
4
+ import { a7 as registerProjection, a8 as getProjectionCode, a9 as availableMapProjection, aa as changeMapProjection, ab as eoxLayersKey, $ as useSTAcStore, ac as posIsSetFromUrl, ad as useOnLayersUpdate, ae as EodashCollection, af as mapPosition, a3 as mapEl, a2 as mapCompareEl, Z as datetime, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as layerControlFormValue } from './asWebComponent-DW1XzZkL.js';
5
5
  import { storeToRefs } from 'pinia';
6
6
  import log from 'loglevel';
7
7
  import { useEventBus } from '@vueuse/core';
8
+ import mustache from 'mustache';
8
9
 
9
10
  /*
10
11
  * eodashSTAC helpers that utilizes the app states or actions
@@ -48,7 +49,7 @@ const setMapProjFromCol = async (STAcCollection) => {
48
49
 
49
50
  /**
50
51
  * Holder for previous compare map view as it is overwritten by sync
51
- * @type { {map:import("ol").View } | null} mapElement
52
+ * @type { import("ol").View | null} mapElement
52
53
  */
53
54
  let viewHolder = null;
54
55
 
@@ -242,12 +243,12 @@ const createLayersConfig = async (
242
243
  /**
243
244
  * Initializes the map and updates it based on changes in the selected indicator and datetime,
244
245
  *
245
- * @param {import("vue").Ref<HTMLElement & Record<string,any> | null>} mapElement
246
+ * @param {import("vue").Ref<import("@eox/map").EOxMap| null>} mapElement
246
247
  * @param {import("vue").Ref<import("stac-ts").StacCollection | null>} selectedIndicator
247
248
  * @param {EodashCollection[]} eodashCols
248
249
  * @param {import("vue").Ref<string>} datetime
249
250
  * @param {import("vue").Ref<Record<string,any>[]>} mapLayers
250
- * @param {import("vue").Ref<HTMLElement & Record<string,any> | null>} partnerMap
251
+ * @param {import("vue").Ref<import("@eox/map").EOxMap| null>} partnerMap
251
252
  */
252
253
  const useInitMap = (
253
254
  mapElement,
@@ -299,7 +300,7 @@ const useInitMap = (
299
300
  // Compare map being initialized
300
301
  if (selectedCompareStac.value !== null) {
301
302
  // save view of compare map
302
- viewHolder = mapElement?.value?.map.getView();
303
+ viewHolder = mapElement?.value?.map.getView() ?? null;
303
304
  /** @type {any} */
304
305
  (mapElement.value).sync = partnerMap.value;
305
306
  }
@@ -380,7 +381,6 @@ const useInitMap = (
380
381
  "Assigned layers",
381
382
  JSON.parse(JSON.stringify(layersCollection)),
382
383
  );
383
-
384
384
  mapLayers.value = layersCollection;
385
385
  // Emit event to update layers
386
386
  await nextTick(() => {
@@ -397,6 +397,20 @@ const useInitMap = (
397
397
  stopIndicatorWatcher();
398
398
  });
399
399
  };
400
+ /**
401
+ *
402
+ * @param {EodashCollection[]} eodashCols
403
+ * @param {import("vue").Ref<import("@/types").EodashStyleJson["tooltip"]>} tooltipProperties
404
+ */
405
+ const useUpdateTooltipProperties = (eodashCols, tooltipProperties) => {
406
+ useOnLayersUpdate(async () => {
407
+ tooltipProperties.value = [];
408
+ for (const ec of eodashCols) {
409
+ tooltipProperties.value.push(...(await ec.getToolTipProperties()));
410
+ }
411
+ log.debug("Updated tooltip properties", tooltipProperties.value);
412
+ });
413
+ };
400
414
 
401
415
  /**
402
416
  * @module ol/easing
@@ -417,6 +431,7 @@ const _hoisted_1 = [".enabled"];
417
431
  const _hoisted_2 = [".center", ".zoom", ".layers"];
418
432
  const _hoisted_3 = [".layers"];
419
433
 
434
+
420
435
  const _sfc_main = {
421
436
  __name: 'EodashMap',
422
437
  props: {
@@ -438,6 +453,8 @@ const _sfc_main = {
438
453
  setup(__props) {
439
454
 
440
455
  const props = __props;
456
+ /** @type {import("vue").Ref<import("@/types").EodashStyleJson["tooltip"]>} */
457
+ const tooltipProperties = ref([]);
441
458
 
442
459
  const initialCenter = toRaw([
443
460
  mapPosition.value?.[0] ?? props.center?.[0],
@@ -473,9 +490,9 @@ const animationOptions = {
473
490
  easing: inAndOut,
474
491
  };
475
492
 
476
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
493
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
477
494
  const eoxMap = ref(null);
478
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
495
+ /** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
479
496
  const compareMap = ref(null);
480
497
  const { selectedCompareStac } = storeToRefs(useSTAcStore());
481
498
  const showCompare = computed(() =>
@@ -515,6 +532,35 @@ onMounted(() => {
515
532
  compareMap,
516
533
  );
517
534
  });
535
+ useUpdateTooltipProperties(eodashCollections, tooltipProperties);
536
+ /**
537
+ * @param {{key:string; value:string}} param
538
+ * @returns {{key:string; value?:string} | undefined}
539
+ */
540
+ const tooltipPropertyTransform = (param) => {
541
+ /** @type {typeof tooltipProperties.value} */
542
+ const updatedProperties = JSON.parse(
543
+ mustache.render(JSON.stringify(tooltipProperties.value), {
544
+ ...(layerControlFormValue.value ?? {}),
545
+ }),
546
+ );
547
+
548
+ const tooltipProp = updatedProperties?.find((prop) => prop.id === param.key);
549
+ if (!tooltipProp) {
550
+ return undefined;
551
+ }
552
+ if (typeof param.value === "object") {
553
+ param.value = JSON.stringify(param.value);
554
+ }
555
+ if (!isNaN(Number(param.value))) {
556
+ param.value = Number(param.value).toFixed(4).toString();
557
+ }
558
+
559
+ return {
560
+ key: tooltipProp.title || tooltipProp.id,
561
+ value: param.value + " " + (tooltipProp.appendix || ""),
562
+ };
563
+ };
518
564
 
519
565
  return (_ctx, _cache) => {
520
566
  return (openBlock(), createElementBlock("eox-map-compare", {
@@ -531,7 +577,11 @@ return (_ctx, _cache) => {
531
577
  ".center": unref(initialCenter),
532
578
  ".zoom": unref(initialZoom),
533
579
  ".layers": eoxMapLayers.value
534
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2),
580
+ }, [
581
+ withDirectives(createElementVNode("eox-map-tooltip", { ".propertyTransform": tooltipPropertyTransform }, null, 544 /* NEED_HYDRATION, NEED_PATCH */), [
582
+ [vShow, tooltipProperties.value?.length]
583
+ ])
584
+ ], 40 /* PROPS, NEED_HYDRATION */, _hoisted_2),
535
585
  createElementVNode("eox-map", {
536
586
  class: "fill-height fill-width overflow-none",
537
587
  id: "compare",
@@ -1,9 +1,9 @@
1
1
  import { computed, ref, openBlock, createElementBlock, createBlock, unref, createCommentVNode, createVNode, withCtx } from 'vue';
2
- import { _ as _export_sfc, t as useDisplay, a1 as makePanelTransparent, V as VBtn, a8 as availableMapProjection, a9 as changeMapProjection, ae as setActiveTemplate } from './asWebComponent-D8bMMCEr.js';
2
+ import { _ as _export_sfc, t as useDisplay, a1 as makePanelTransparent, V as VBtn, a9 as availableMapProjection, aa as changeMapProjection, ag as setActiveTemplate } from './asWebComponent-DW1XzZkL.js';
3
3
  import { mdiMapPlus, mdiEarthBox, mdiCompare } from '@mdi/js';
4
- import ExportState from './ExportState-LNZAovzM.js';
5
- import _sfc_main$1 from './PopUp-B0_c0207.js';
6
- import _sfc_main$2 from './EodashItemFilter-CFNKjm_Z.js';
4
+ import ExportState from './ExportState-5JyTshJH.js';
5
+ import _sfc_main$1 from './PopUp-Bmfn3N_4.js';
6
+ import _sfc_main$2 from './EodashItemFilter-G7YsYO3B.js';
7
7
 
8
8
  const _sfc_main = {
9
9
  __name: 'EodashMapBtns',