@eodash/eodash 5.0.0-alpha.2.17 → 5.0.0-alpha.2.19

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 (40) hide show
  1. package/core/client/App.vue +2 -0
  2. package/core/client/composables/EodashMap.js +139 -100
  3. package/core/client/eodash.js +32 -12
  4. package/core/client/plugins/index.js +2 -1
  5. package/core/client/store/Actions.js +6 -0
  6. package/core/client/utils/createLayers.js +32 -11
  7. package/core/client/utils/eodashSTAC.js +22 -5
  8. package/core/client/utils/helpers.js +19 -14
  9. package/core/client/vite-env.d.ts +1 -0
  10. package/dist/client/{DashboardLayout-BR1lU9ER.js → DashboardLayout-CU4js3lr.js} +2 -2
  11. package/dist/client/{DynamicWebComponent-7z8VFsrZ.js → DynamicWebComponent-BsYZdIEB.js} +2 -2
  12. package/dist/client/EodashDatePicker-DZoH_gRX.js +276 -0
  13. package/dist/client/{EodashItemFilter-lNjVkidr.js → EodashItemFilter-CHBfsFSm.js} +1362 -1347
  14. package/dist/client/{EodashLayerControl-B0N8_XmX.js → EodashLayerControl-CuY-cAx8.js} +4773 -4593
  15. package/dist/client/{EodashMap-DFT2R2Rk.js → EodashMap-Ch43fWNv.js} +21032 -20669
  16. package/dist/client/{EodashMapBtns-CoGjVl8Y.js → EodashMapBtns-CFA2uti4.js} +2 -2
  17. package/dist/client/{ExportState-Dwv37MRw.js → ExportState-C6raDjTt.js} +68 -69
  18. package/dist/client/{Footer-DuScuHSx.js → Footer-D8T5ROhF.js} +1 -1
  19. package/dist/client/{Header-C4Y0u0E5.js → Header-B8B4Z5R9.js} +4 -4
  20. package/dist/client/{IframeWrapper-D1TfK4xH.js → IframeWrapper-BK2JxzSJ.js} +1 -1
  21. package/dist/client/{MobileLayout-C-b8DIFO.js → MobileLayout-aZaYvF8V.js} +51 -51
  22. package/dist/client/{PopUp-DBMZX3l3.js → PopUp-DdHXoNOP.js} +42 -42
  23. package/dist/client/{VImg-bAMQHnMM.js → VImg-yb8O1cb8.js} +2 -2
  24. package/dist/client/{VMain-Df5VMG9r.js → VMain-Dknnyxts.js} +2 -2
  25. package/dist/client/{VOverlay-D5GzAYRY.js → VOverlay-BCOn3hd6.js} +64 -64
  26. package/dist/client/{WidgetsContainer-yZDmY6_u.js → WidgetsContainer-BixUyr1e.js} +3 -3
  27. package/dist/client/{asWebComponent-DhR2_xlP.js → asWebComponent-CHqY8A1z.js} +7231 -7087
  28. package/dist/client/eo-dash.js +1 -1
  29. package/dist/client/{forwardRefs-C0MQxvur.js → forwardRefs-dcYA2XVU.js} +1 -1
  30. package/dist/client/{index-qNWeBhRh.js → index-BVuSHaVu.js} +23 -23
  31. package/dist/client/{lerc-B4lXefGh-CsL-d8wY.js → lerc-BPVtQnt3-08GHszVp.js} +1 -1
  32. package/dist/client/{ssrBoot-Xmkz8T49.js → ssrBoot-DU2S_nLc.js} +1 -1
  33. package/dist/client/style.css +1 -1
  34. package/dist/client/{transition-DRzZPWIN.js → transition-C_fi1aa6.js} +1 -1
  35. package/dist/client/{webfontloader-CqD-lAx-.js → webfontloader-Ofarvipf.js} +1 -1
  36. package/package.json +6 -7
  37. package/widgets/EodashDatePicker.vue +24 -12
  38. package/widgets/EodashLayerControl.vue +23 -4
  39. package/widgets/EodashMap.vue +43 -25
  40. package/dist/client/EodashDatePicker-o7ZOYIHL.js +0 -259
@@ -49,8 +49,14 @@ export function extractLayerConfig(style) {
49
49
  let layerConfig = undefined;
50
50
  if (style?.jsonform) {
51
51
  layerConfig = { schema: style.jsonform, type: "style" };
52
+ style = { ...style };
52
53
  delete style.jsonform;
53
54
  }
55
+ log.debug(
56
+ "extracted layerConfig",
57
+ JSON.parse(JSON.stringify({ layerConfig, style })),
58
+ );
59
+
54
60
  return { layerConfig, style };
55
61
  }
56
62
 
@@ -59,7 +65,7 @@ export function extractLayerConfig(style) {
59
65
  * updates {@link availableMapProjection}
60
66
  * @param {import('stac-ts').StacCollection} [STAcCollection]
61
67
  */
62
- export const setMapProjFromCol = (STAcCollection) => {
68
+ export const setMapProjFromCol = async (STAcCollection) => {
63
69
  // if a projection exists on the collection level
64
70
  log.debug("Checking for available map projection in indicator");
65
71
  const projection =
@@ -71,25 +77,22 @@ export const setMapProjFromCol = (STAcCollection) => {
71
77
  );
72
78
  if (projection) {
73
79
  log.debug("Projection found", projection);
74
- registerProjection(projection);
80
+ await registerProjection(projection);
75
81
  const projectionCode = getProjectionCode(projection);
76
- if (
77
- availableMapProjection.value &&
78
- availableMapProjection.value !== projectionCode
79
- ) {
82
+ if (availableMapProjection.value !== projectionCode) {
80
83
  log.debug(
81
84
  "Changing map projection",
82
85
  availableMapProjection.value,
83
86
  projectionCode,
84
87
  );
85
- changeMapProjection(projection);
88
+ await changeMapProjection(projection);
86
89
  }
87
90
  // set it for `EodashMapBtns`
88
91
  availableMapProjection.value = /** @type {string} */ (projectionCode);
89
92
  } else {
90
93
  // reset to default projection
91
- log.debug("Resetting projection to default");
92
- changeMapProjection((availableMapProjection.value = "EPSG:3857"));
94
+ log.debug("Resetting projection to default EPSG:3857");
95
+ await changeMapProjection((availableMapProjection.value = ""));
93
96
  }
94
97
  };
95
98
 
@@ -138,9 +141,9 @@ export const extractRoles = (properties, linkOrAsset) => {
138
141
  properties.group = role;
139
142
  //remove all the properties and replace the random ID with baselayer
140
143
  // provided ID
141
- const [_colId, _itemId, _isAsset, _random, proj] =
142
- properties.id.split(";:;");
143
- properties.id = ["", "", "", "", linkOrAsset.id, proj].join(";:;");
144
+ // const [_colId, _itemId, _isAsset, _random, proj] =
145
+ // properties.id.split(";:;");
146
+ // properties.id = ["", "", "", "", linkOrAsset.id, proj].join(";:;");
144
147
  }
145
148
 
146
149
  return properties;
@@ -163,7 +166,9 @@ export const fetchStyle = async (item, itemUrl) => {
163
166
 
164
167
  /** @type {import("ol/layer/WebGLTile").Style & {jsonform?:Record<string,any>}} */
165
168
  const styleJson = await axios.get(url).then((resp) => resp.data);
166
- return styleJson;
169
+
170
+ log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
171
+ return { ...styleJson };
167
172
  }
168
173
  };
169
174
 
@@ -232,7 +237,7 @@ export const extractLayerDatetime = (links, currentStep) => {
232
237
  return {
233
238
  controlValues,
234
239
  currentStep,
235
- slider: false,
240
+ slider: true,
236
241
  disablePlay: true,
237
242
  };
238
243
  };
@@ -7,6 +7,7 @@ declare module "*.vue" {
7
7
  }
8
8
  declare interface Window {
9
9
  eodashStore: import("@/types").EodashStore;
10
+ setEodashLoglevel: typeof import("loglevel").setLevel;
10
11
  }
11
12
  declare module "@eox/stacinfo" {
12
13
  export const EOxStacInfo: CustomElementConstructor;
@@ -1,5 +1,5 @@
1
- import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-DhR2_xlP.js";
2
- import { V as k } from "./VMain-Df5VMG9r.js";
1
+ import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-CHqY8A1z.js";
2
+ import { V as k } from "./VMain-Dknnyxts.js";
3
3
  class A extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["gap"];
@@ -1,4 +1,4 @@
1
- import { bL as i, aD as m, r as p, Z as d, aQ as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-DhR2_xlP.js";
1
+ import { bM as i, aC as m, r as p, Z as d, aR as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-CHqY8A1z.js";
2
2
  const h = { class: "d-flex flex-column fill-height overflow-auto" }, N = {
3
3
  __name: "DynamicWebComponent",
4
4
  props: {
@@ -38,7 +38,7 @@ const h = { class: "d-flex flex-column fill-height overflow-auto" }, N = {
38
38
  e.onMounted?.(r.value, s);
39
39
  }), f(() => {
40
40
  e.onUnmounted?.(r.value, s);
41
- }), (n, x) => (c(), g("span", h, [
41
+ }), (n, w) => (c(), g("span", h, [
42
42
  (c(), y(
43
43
  k(o.tagName),
44
44
  _(o.properties, {
@@ -0,0 +1,276 @@
1
+ import { p as O, o as R, g as _, y as $, aw as F, c as f, r as I, d as x, a as j, b as p, ax as H, ay as B, T as Y, az as L, aA as U, aB as z, aC as G, w as N, a6 as J, aD as K, a1 as m, a3 as b, aE as W, F as q, aF as Q, $ as k, a9 as y, aG as X, aH as Z, t as V, a0 as T, M as P, aI as tt, V as A, aJ as et, aK as C, aL as S, aM as h } from "./asWebComponent-CHqY8A1z.js";
2
+ import { m as at, V as E } from "./VOverlay-BCOn3hd6.js";
3
+ import { b as nt, f as ot } from "./forwardRefs-dcYA2XVU.js";
4
+ const st = O({
5
+ id: String,
6
+ text: String,
7
+ ...R(at({
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"), rt = _()({
22
+ name: "VTooltip",
23
+ props: st(),
24
+ emits: {
25
+ "update:modelValue": (t) => !0
26
+ },
27
+ setup(t, r) {
28
+ let {
29
+ slots: i
30
+ } = r;
31
+ const e = $(t, "modelValue"), {
32
+ scopeId: c
33
+ } = nt(), l = F(), n = f(() => t.id || `v-tooltip-${l}`), a = I(), o = f(() => t.location.split(" ").length > 1 ? t.location : t.location + " center"), s = f(() => t.origin === "auto" || t.origin === "overlap" || t.origin.split(" ").length > 1 || t.location.split(" ").length > 1 ? t.origin : t.origin + " center"), u = f(() => t.transition ? t.transition : e.value ? "scale-transition" : "fade-transition"), g = f(() => x({
34
+ "aria-describedby": n.value
35
+ }, t.activatorProps));
36
+ return j(() => {
37
+ const w = E.filterProps(t);
38
+ return p(E, x({
39
+ ref: a,
40
+ class: ["v-tooltip", t.class],
41
+ style: t.style,
42
+ id: n.value
43
+ }, w, {
44
+ modelValue: e.value,
45
+ "onUpdate:modelValue": (d) => e.value = d,
46
+ transition: u.value,
47
+ absolute: !0,
48
+ location: o.value,
49
+ origin: s.value,
50
+ persistent: !0,
51
+ role: "tooltip",
52
+ activatorProps: g.value,
53
+ _disableGlobalStack: !0
54
+ }, c), {
55
+ activator: i.activator,
56
+ default: function() {
57
+ for (var d = arguments.length, D = new Array(d), v = 0; v < d; v++)
58
+ D[v] = arguments[v];
59
+ return i.default?.(...D) ?? t.text;
60
+ }
61
+ });
62
+ }), ot({}, a);
63
+ }
64
+ });
65
+ function it(t, r) {
66
+ const i = typeof t == "string" ? H(t) : t, e = lt(i, r);
67
+ return {
68
+ mounted: e,
69
+ updated: e,
70
+ unmounted(c) {
71
+ B(null, c);
72
+ }
73
+ };
74
+ }
75
+ function lt(t, r) {
76
+ return function(i, e, c) {
77
+ const l = typeof r == "function" ? r(e) : r, n = e.value?.text ?? e.value ?? l?.text, a = Y(e.value) ? e.value : {}, o = () => n ?? i.textContent, s = (c.ctx === e.instance.$ ? ct(c, e.instance.$)?.provides : c.ctx?.provides) ?? e.instance.$.provides, u = L(t, x(l, a), o);
78
+ u.appContext = Object.assign(/* @__PURE__ */ Object.create(null), e.instance.$.appContext, {
79
+ provides: s
80
+ }), B(u, i);
81
+ };
82
+ }
83
+ function ct(t, r) {
84
+ const i = /* @__PURE__ */ new Set(), e = (l) => {
85
+ for (const n of l) {
86
+ if (!n) continue;
87
+ if (n === t)
88
+ return !0;
89
+ i.add(n);
90
+ let a;
91
+ if (n.suspense ? a = e([n.ssContent]) : Array.isArray(n.children) ? a = e(n.children) : n.component?.vnode && (a = e([n.component?.subTree])), a)
92
+ return a;
93
+ i.delete(n);
94
+ }
95
+ return !1;
96
+ };
97
+ if (!e([r.subTree]))
98
+ throw new Error("Could not find original vnode");
99
+ const c = Array.from(i).reverse();
100
+ for (const l of c)
101
+ if (l.component)
102
+ return l.component;
103
+ return r;
104
+ }
105
+ const M = it(rt, (t) => ({
106
+ activator: "parent",
107
+ location: t.arg?.replace("-", " "),
108
+ text: typeof t.value == "boolean" ? void 0 : t.value
109
+ })), ut = {
110
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
111
+ style: { margin: "2px" }
112
+ }, dt = ["value"], ft = {
113
+ class: "w-full px-4 pb-3",
114
+ style: { "font-size": "12px" }
115
+ }, mt = ["innerHTML"], yt = {
116
+ __name: "EodashDatePicker",
117
+ props: {
118
+ hintText: {
119
+ type: String,
120
+ default: null
121
+ }
122
+ },
123
+ setup(t) {
124
+ const r = Q((n, a) => ({
125
+ get() {
126
+ return n(), new Date(C.value).getTime();
127
+ },
128
+ /** @param {number} num */
129
+ set(o) {
130
+ a(), S.debug("Datepicker setting currentDate", C.value), C.value = new Date(o).toISOString();
131
+ }
132
+ })), i = I({
133
+ input: "YYYY-MM-DD"
134
+ }), e = U([]), { selectedStac: c } = z(G());
135
+ N(
136
+ c,
137
+ async (n, a) => {
138
+ if (n && a?.id !== n.id) {
139
+ S.debug("Datepicker selected STAC change triggered");
140
+ const o = [
141
+ "#009E73",
142
+ "#0072B2",
143
+ "#E69F00",
144
+ "#CC79A7",
145
+ "#56B4E9",
146
+ "#D55E00"
147
+ ];
148
+ e.splice(0, e.length);
149
+ for (let s = 0; s < h.length; s++) {
150
+ S.debug("Retrieving dates", h[s]), await h[s].fetchCollection();
151
+ const u = [
152
+ ...new Set(
153
+ h[s].getItems()?.reduce(
154
+ (g, w) => {
155
+ const d = Date.parse(
156
+ /** @type {string} */
157
+ w.datetime
158
+ );
159
+ return d && g.push(new Date(d)), g;
160
+ },
161
+ /** @type {Date[]} */
162
+ []
163
+ )
164
+ )
165
+ ];
166
+ e.push({
167
+ key: "id-" + s.toString() + Math.random().toString(16).slice(2),
168
+ bar: {
169
+ style: {
170
+ backgroundColor: o[s % o.length]
171
+ }
172
+ },
173
+ dates: u,
174
+ content: {
175
+ style: {
176
+ color: "#000000",
177
+ "font-weight": "bold"
178
+ }
179
+ }
180
+ });
181
+ }
182
+ }
183
+ },
184
+ { immediate: !0 }
185
+ );
186
+ function l(n) {
187
+ if (e.length) {
188
+ let a = n ? 1 / 0 : -1 / 0;
189
+ e.forEach((o) => {
190
+ o?.dates && o.dates.forEach((s) => {
191
+ s instanceof Date && (a = Math[n ? "min" : "max"](a, s.getTime()));
192
+ });
193
+ }), r.value = a === -1 / 0 ? Date.now() : a === 1 / 0 ? 0 : a;
194
+ }
195
+ }
196
+ return (n, a) => (k(), J(
197
+ q,
198
+ null,
199
+ [
200
+ p(b(Z), {
201
+ modelValue: r.value,
202
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => r.value = o),
203
+ modelModifiers: { number: !0 },
204
+ masks: i.value,
205
+ attributes: e
206
+ }, K({
207
+ default: m(({ inputValue: o, inputEvents: s }) => [
208
+ y("div", ut, [
209
+ y("input", x({ value: o }, X(s, !0), {
210
+ style: { margin: "1px" },
211
+ class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
212
+ }), null, 16, dt)
213
+ ])
214
+ ]),
215
+ _: 2
216
+ /* DYNAMIC */
217
+ }, [
218
+ t.hintText ? {
219
+ name: "footer",
220
+ fn: m(() => [
221
+ y("div", ft, [
222
+ y("span", { innerHTML: t.hintText }, null, 8, mt)
223
+ ])
224
+ ]),
225
+ key: "0"
226
+ } : void 0
227
+ ]), 1032, ["modelValue", "masks", "attributes"]),
228
+ p(W, {
229
+ align: "center",
230
+ justify: "center",
231
+ style: { "margin-top": "6px" }
232
+ }, {
233
+ default: m(() => [
234
+ V((k(), T(A, {
235
+ style: { padding: "0px", "margin-right": "4px" },
236
+ density: "compact",
237
+ onClick: a[1] || (a[1] = (o) => l(!0))
238
+ }, {
239
+ default: m(() => [
240
+ p(P, {
241
+ icon: [b(tt)]
242
+ }, null, 8, ["icon"])
243
+ ]),
244
+ _: 1
245
+ /* STABLE */
246
+ })), [
247
+ [M, "Set date to oldest available dataset", "bottom"]
248
+ ]),
249
+ V((k(), T(A, {
250
+ style: { padding: "0px", "margin-left": "4px" },
251
+ density: "compact",
252
+ onClick: a[2] || (a[2] = (o) => l(!1))
253
+ }, {
254
+ default: m(() => [
255
+ p(P, {
256
+ icon: [b(et)]
257
+ }, null, 8, ["icon"])
258
+ ]),
259
+ _: 1
260
+ /* STABLE */
261
+ })), [
262
+ [M, "Set date to latest available dataset", "bottom"]
263
+ ])
264
+ ]),
265
+ _: 1
266
+ /* STABLE */
267
+ })
268
+ ],
269
+ 64
270
+ /* STABLE_FRAGMENT */
271
+ ));
272
+ }
273
+ };
274
+ export {
275
+ yt as default
276
+ };