@eodash/eodash 5.3.3 → 5.5.0

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 (115) hide show
  1. package/core/client/asWebComponent.js +1 -1
  2. package/core/client/composables/DefineEodash.js +3 -1
  3. package/core/client/composables/DefineWidgets.js +12 -2
  4. package/core/client/eodashSTAC/EodashCollection.js +20 -37
  5. package/core/client/eodashSTAC/createLayers.js +306 -136
  6. package/core/client/eodashSTAC/helpers.js +60 -40
  7. package/core/client/eodashSTAC/parquet.js +2 -0
  8. package/core/client/eodashSTAC/triggers.js +5 -5
  9. package/core/client/store/actions.js +17 -17
  10. package/core/client/store/states.js +26 -4
  11. package/core/client/types.ts +12 -1
  12. package/core/client/utils/index.js +18 -1
  13. package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CkSgvaFF.js} +2 -2
  14. package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
  15. package/dist/client/EodashChart-5v7adDpG.js +144 -0
  16. package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-RoQJe6ss.js} +4 -4
  17. package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CCoVC5BE.js} +2 -2
  18. package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-weVj7aQA.js} +2 -2
  19. package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
  20. package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
  21. package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BbMnjf-n.js} +11 -15
  22. package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-BZXnqfax.js} +2 -2
  23. package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-DUJlkkgx.js} +4 -4
  24. package/dist/client/{ExportState-ruNyRS2E.js → ExportState-CT3FQOHW.js} +46 -21
  25. package/dist/client/{Footer-IQNyfd78.js → Footer-D_iqP-1K.js} +1 -1
  26. package/dist/client/{Header-BBdi_-Lp.js → Header-Dzhnvsy-.js} +127 -17
  27. package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
  28. package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DPPv_GSA.js} +8 -59
  29. package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-BIN_Mb27.js} +9 -13
  30. package/dist/client/{VImg-hwmwzSwG.js → VImg-DhbuvNrA.js} +2 -2
  31. package/dist/client/{VMain-vk4-rkw-.js → VMain-CVabY_NY.js} +1 -1
  32. package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-Cc6au3Sn.js} +3 -4
  33. package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-ChqTJS4h.js} +1 -1
  34. package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
  35. package/dist/client/{async-D1MvO_Z_.js → async-D6Lvv-fT.js} +15 -5
  36. package/dist/client/eo-dash.js +1 -1
  37. package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs--IccUBdR.js} +196 -37
  38. package/dist/client/{handling-CbgeKrqT.js → handling-DSA67d6E.js} +160 -37
  39. package/dist/client/{helpers-CtUlAW0N.js → helpers-BBSdbOmv.js} +239 -126
  40. package/dist/client/{index-DBo0F4Fv.js → index-6LlXNkke.js} +5 -3
  41. package/dist/client/{index-BJvLt3Xf.js → index-BS-8Y5FE.js} +34 -77
  42. package/dist/client/{index-BkW06-Lg.js → index-CQihL_c6.js} +55 -15
  43. package/dist/client/{index-BxDh5v-H.js → index-qsZhYR_6.js} +15 -16
  44. package/dist/client/templates.js +52 -2
  45. package/dist/client/{transition-BdzATvPB.js → transition-DFr4cXu8.js} +1 -1
  46. package/dist/node/cli.js +1 -1
  47. package/dist/types/core/client/App.vue.d.ts +16 -6
  48. package/dist/types/core/client/asWebComponent.d.ts +2 -2
  49. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -1
  50. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +36 -16
  51. package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -1
  52. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +9 -1
  53. package/dist/types/core/client/components/Footer.vue.d.ts +2 -1
  54. package/dist/types/core/client/components/Header.vue.d.ts +2 -1
  55. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +12 -6
  56. package/dist/types/core/client/components/Loading.vue.d.ts +2 -1
  57. package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -1
  58. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  59. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
  60. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
  61. package/dist/types/core/client/eodashSTAC/helpers.d.ts +11 -4
  62. package/dist/types/core/client/store/actions.d.ts +1 -2
  63. package/dist/types/core/client/store/states.d.ts +22 -4
  64. package/dist/types/core/client/types.d.ts +7 -2
  65. package/dist/types/core/client/utils/index.d.ts +1 -0
  66. package/dist/types/core/client/views/Dashboard.vue.d.ts +20 -8
  67. package/dist/types/templates/compare.d.ts +20 -0
  68. package/dist/types/templates/expert.d.ts +30 -1
  69. package/dist/types/widgets/EodashChart.vue.d.ts +28 -0
  70. package/dist/types/widgets/EodashDatePicker.vue.d.ts +38 -9
  71. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +88 -13
  72. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +1 -1
  73. package/dist/types/widgets/EodashItemFilter.vue.d.ts +169 -26
  74. package/dist/types/widgets/EodashLayerControl.vue.d.ts +38 -10
  75. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +22 -7
  76. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +94 -19
  77. package/dist/types/widgets/EodashMap/index.vue.d.ts +647 -92
  78. package/dist/types/widgets/EodashMap/methods/btns.d.ts +14 -0
  79. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +24 -7
  80. package/dist/types/widgets/EodashProcess/index.vue.d.ts +26 -7
  81. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +1 -2
  82. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +18 -11
  83. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
  84. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
  85. package/dist/types/widgets/EodashStacInfo.vue.d.ts +67 -18
  86. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +14 -6
  87. package/dist/types/widgets/EodashTools.vue.d.ts +437 -47
  88. package/dist/types/widgets/ExportState.vue.d.ts +26 -8
  89. package/dist/types/widgets/PopUp.vue.d.ts +61 -11
  90. package/dist/types/widgets/WidgetsContainer.vue.d.ts +22 -6
  91. package/package.json +33 -34
  92. package/templates/baseConfig.js +2 -1
  93. package/templates/compare.js +28 -1
  94. package/templates/expert.js +23 -1
  95. package/widgets/EodashChart.vue +139 -0
  96. package/widgets/EodashItemCatalog/index.vue +2 -2
  97. package/widgets/EodashItemCatalog/methods/map.js +9 -10
  98. package/widgets/EodashMap/EodashMapBtns.vue +73 -93
  99. package/widgets/EodashMap/index.vue +14 -2
  100. package/widgets/EodashMap/methods/btns.js +155 -0
  101. package/widgets/EodashMap/methods/create-layers-config.js +26 -3
  102. package/widgets/EodashMap/methods/index.js +2 -1
  103. package/widgets/EodashProcess/ProcessList.vue +2 -3
  104. package/widgets/EodashProcess/index.vue +19 -70
  105. package/widgets/EodashProcess/methods/async.js +1 -1
  106. package/widgets/EodashProcess/methods/composables.js +13 -6
  107. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +20 -7
  108. package/widgets/EodashProcess/methods/handling.js +100 -22
  109. package/widgets/EodashProcess/methods/outputs.js +44 -4
  110. package/widgets/EodashProcess/methods/utils.js +11 -1
  111. package/widgets/EodashStacInfo.vue +10 -23
  112. package/widgets/ExportState.vue +9 -15
  113. package/dist/client/EodashMapBtns-nFY6MIAX.js +0 -301
  114. package/dist/client/MobileLayout-BfBeF-JF.js +0 -118
  115. package/dist/client/asWebComponent-DdguWGDI.js +0 -8967
@@ -42,13 +42,19 @@ export function generateFeatures(links, extraProperties = {}, rel = "item") {
42
42
  }
43
43
 
44
44
  /**
45
- * Sperates and extracts layerConfig (jsonform schema & legend) from a style json
45
+ * Spearates and extracts layerConfig (jsonform schema & legend) from a style json
46
46
  *
47
47
  * @param {string} collectionId
48
48
  * @param { import("@/types").EodashStyleJson} [style]
49
49
  * @param {Record<string,any>} [rasterJsonform]
50
+ * @param {string} [layerConfigType]
50
51
  * */
51
- export function extractLayerConfig(collectionId, style, rasterJsonform) {
52
+ export function extractLayerConfig(
53
+ collectionId,
54
+ style,
55
+ rasterJsonform,
56
+ layerConfigType,
57
+ ) {
52
58
  if (!style && !rasterJsonform) {
53
59
  return { layerConfig: undefined, style: undefined };
54
60
  }
@@ -56,6 +62,10 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
56
62
  style = { ...style };
57
63
  }
58
64
 
65
+ if (style?.variables && Object.keys(style.variables ?? {}).length) {
66
+ style.variables = getStyleVariablesState(collectionId, style.variables);
67
+ }
68
+
59
69
  if (rasterJsonform) {
60
70
  return {
61
71
  layerConfig: {
@@ -67,16 +77,12 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
67
77
  };
68
78
  }
69
79
 
70
- if (style?.variables && Object.keys(style.variables ?? {}).length) {
71
- style.variables = getStyleVariablesState(collectionId, style.variables);
72
- }
73
-
74
80
  /** @type {Record<string,unknown> | undefined} */
75
81
  let layerConfig = undefined;
76
82
 
77
83
  if (style?.jsonform) {
78
84
  // this explicitly sets legend only if jsonform is configured
79
- layerConfig = { schema: style.jsonform, type: "style" };
85
+ layerConfig = { schema: style.jsonform, type: layerConfigType || "style" };
80
86
  delete style.jsonform;
81
87
  if (style?.legend) {
82
88
  layerConfig.legend = style.legend;
@@ -90,6 +96,7 @@ export function extractLayerConfig(collectionId, style, rasterJsonform) {
90
96
 
91
97
  return { layerConfig, style };
92
98
  }
99
+
93
100
  /**
94
101
  *
95
102
  * @param {number[]} bbox
@@ -164,35 +171,41 @@ export const extractRoles = (properties, linkOrAsset) => {
164
171
 
165
172
  /**
166
173
  * Extracts a single non-link style JSON from a STAC Item optionally for a selected key mapping
167
- * @param {import("stac-ts").StacItem} item
168
- * @param {string} itemUrl
169
- * @param {string | undefined} key
174
+ * @param { import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
175
+ * @param {string | undefined} linkKey
176
+ * @param {string | undefined} assetKey
170
177
  * @returns
171
178
  **/
172
- export const fetchStyle = async (item, itemUrl, key = undefined) => {
179
+ export const fetchStyle = async (
180
+ stacObject,
181
+ linkKey = undefined,
182
+ assetKey = undefined,
183
+ ) => {
173
184
  let styleLink = null;
174
- if (key) {
175
- styleLink = item.links.find(
185
+ if (linkKey) {
186
+ styleLink = stacObject.links.find(
176
187
  (link) =>
177
188
  link.rel.includes("style") &&
178
189
  link["links:keys"] &&
179
- /** @type {Array<string>} */ (link["links:keys"]).includes(key),
190
+ /** @type {Array<string>} */ (link["links:keys"]).includes(linkKey),
191
+ );
192
+ } else if (assetKey) {
193
+ styleLink = stacObject.links.find(
194
+ (link) =>
195
+ link.rel.includes("style") &&
196
+ link["asset:keys"] &&
197
+ /** @type {Array<string>} */ (link["asset:keys"]).includes(assetKey),
180
198
  );
181
199
  } else {
182
- styleLink = item.links.find(
183
- (link) => link.rel.includes("style") && !link["links:keys"],
200
+ log.debug(
201
+ "Neither link key, nor asset key input, can not match any style to layer.",
202
+ stacObject.id,
184
203
  );
204
+ return {};
185
205
  }
186
206
  if (styleLink) {
187
- let url = "";
188
- if (styleLink.href.startsWith("http")) {
189
- url = styleLink.href;
190
- } else {
191
- url = toAbsolute(styleLink.href, itemUrl);
192
- }
193
-
194
207
  /** @type {import("@/types").EodashStyleJson} */
195
- const styleJson = await axios.get(url).then((resp) => resp.data);
208
+ const styleJson = await axios.get(styleLink.href).then((resp) => resp.data);
196
209
 
197
210
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
198
211
  return { ...styleJson };
@@ -201,18 +214,15 @@ export const fetchStyle = async (item, itemUrl, key = undefined) => {
201
214
 
202
215
  /**
203
216
  * Fetches all style JSONs from a STAC Item and returns an array with style objects
204
- * @param {import("stac-ts").StacItem} item
205
- * @param {string} itemUrl
217
+ * @param {import("stac-ts").StacItem | import("stac-ts").StacCollection} stacObject
206
218
  * @returns { Promise <Array<import("@/types").EodashStyleJson>>}
207
219
  **/
208
- export const fetchAllStyles = async (item, itemUrl) => {
209
- const styleLinks = item.links.filter((link) => link.rel.includes("style"));
220
+ export const fetchAllStyles = async (stacObject) => {
221
+ const styleLinks = stacObject.links.filter((link) =>
222
+ link.rel.includes("style"),
223
+ );
210
224
  const fetchPromises = styleLinks.map(async (link) => {
211
- let url = link.href.startsWith("http")
212
- ? link.href
213
- : toAbsolute(link.href, itemUrl);
214
-
215
- const styleJson = await axios.get(url).then((resp) => resp.data);
225
+ const styleJson = await axios.get(link.href).then((resp) => resp.data);
216
226
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
217
227
  return styleJson;
218
228
  });
@@ -422,7 +432,7 @@ export const replaceLayersInStructure = (layers, toRemove, toInsert) => {
422
432
  continue;
423
433
  }
424
434
 
425
- result.push(layer);
435
+ result.unshift(layer);
426
436
  }
427
437
 
428
438
  return result;
@@ -468,15 +478,11 @@ export const replaceLayer = (currentLayers, oldLayer, newLayers) => {
468
478
  * @param {import('ol/layer').Layer} layer
469
479
  */
470
480
  export const getColFromLayer = async (indicators, layer) => {
471
- const [collectionId, itemId, ..._other] = layer.get("id").split(";:;");
481
+ const [collectionId, ..._other] = layer.get("id").split(";:;");
472
482
 
473
483
  for (const ind of indicators) {
474
484
  if (ind.collectionStac?.id !== collectionId) continue;
475
- const items = await ind.getItems();
476
- const itemIds = items?.map((item) => item.id || item.datetime) ?? [];
477
- if (itemIds.includes(itemId)) {
478
- return ind;
479
- }
485
+ return ind;
480
486
  }
481
487
  };
482
488
 
@@ -850,3 +856,17 @@ export function extractLayerLegend(collection) {
850
856
  }
851
857
  return extraProperties;
852
858
  }
859
+
860
+ /**
861
+ * @param { import ("stac-ts").StacLink } link
862
+ * @returns {object}
863
+ */
864
+ export function extractEoxLegendLink(link) {
865
+ let extraProperties = {};
866
+ if (link["eox:colorlegend"]) {
867
+ extraProperties = {
868
+ layerLegend: link["eox:colorlegend"],
869
+ };
870
+ }
871
+ return extraProperties;
872
+ }
@@ -95,6 +95,8 @@ function moveItemProperties(item) {
95
95
  "id",
96
96
  "collection",
97
97
  "properties",
98
+ "auth:schemes",
99
+ "eodash:merge_assets",
98
100
  ];
99
101
  for (const key in item) {
100
102
  if (!stacProperties.includes(key)) {
@@ -67,18 +67,18 @@ export function getStyleVariablesState(collectionId, variables) {
67
67
  "",
68
68
  "",
69
69
  ];
70
- return (
71
- collection === collectionId &&
72
- ["Vector", "WebGLTile", "VectorTile"].includes(layer?.type ?? "")
73
- );
70
+ return collection === collectionId;
74
71
  });
75
72
 
76
73
  if (!matchingLayer) {
77
74
  return variables;
78
75
  }
76
+ // TODO instead tap into store for changed variables state per layer
77
+ // because XYZ and WMTS use tileurlfunction update, where we can not retrieve
78
+ // current values from OL layers anyhow
79
79
 
80
80
  const olLayer = mapElement.getLayerById(matchingLayer.properties?.id ?? "");
81
- const oldVariablesState =
81
+ let oldVariablesState =
82
82
  /** @type {import("ol/layer").Vector} */ (
83
83
  olLayer
84
84
  //@ts-expect-error variables doesn't exist in non-flat style
@@ -5,8 +5,9 @@ import {
5
5
  activeTemplate,
6
6
  poi,
7
7
  comparePoi,
8
- chartEl,
9
- compareChartEl,
8
+ areChartsSeparateLayout,
9
+ chartData,
10
+ compareChartData,
10
11
  } from "@/store/states";
11
12
  import { getProjectionCode } from "@/eodashSTAC/helpers";
12
13
  import log from "loglevel";
@@ -15,26 +16,13 @@ import log from "loglevel";
15
16
  * Returns the current layers of {@link mapEl}
16
17
  * @returns {import("@eox/map").EoxLayer[]}
17
18
  */
18
- export const getLayers = () => mapEl.value?.layers.toReversed() ?? [];
19
+ export const getLayers = () => mapEl.value?.layers ?? [];
19
20
 
20
21
  /**
21
22
  * Returns the current layers of {@link mapCompareEl}
22
23
  * * @returns {import("@eox/map").EoxLayer[]}
23
24
  */
24
- export const getCompareLayers = () =>
25
- mapCompareEl.value?.layers.toReversed() ?? [];
26
-
27
- /**
28
- * Returns the current chart spec from {@link chartEl}
29
- * @returns {import("vega-embed").VisualizationSpec | null}
30
- */
31
- export const getChartSpec = () => chartEl.value?.spec ?? null;
32
-
33
- /**
34
- * Returns the current chart spec from {@link compareChartEl}
35
- * @returns {import("vega-embed").VisualizationSpec | null}
36
- */
37
- export const getCompareChartSpec = () => compareChartEl.value?.spec ?? null;
25
+ export const getCompareLayers = () => mapCompareEl.value?.layers ?? [];
38
26
 
39
27
  /**
40
28
  * Register EPSG projection in `eox-map`
@@ -108,3 +96,15 @@ export const includesProcess = (collection, compare = false) => {
108
96
  collection?.links?.some((link) => link.rel === "service") || isPoiAlive
109
97
  );
110
98
  };
99
+
100
+ /**
101
+ * Check whether main or compare chart have data to show
102
+ * @param {boolean} [compare=false] - Whether to check for compare collection
103
+ * @returns
104
+ */
105
+ export const shouldShowChartWidget = (compare = false) => {
106
+ return (
107
+ areChartsSeparateLayout.value &&
108
+ (compare ? compareChartData.value : chartData.value)
109
+ );
110
+ };
@@ -46,8 +46,30 @@ export const poi = ref("");
46
46
  */
47
47
  export const comparePoi = ref("");
48
48
 
49
- /** @type {import("vue").Ref<import("@eox/chart").EOxChart | null>} */
50
- export const chartEl = shallowRef(null);
49
+ /** Whether the map is in globe mode */
50
+ export const isGlobe = ref(false);
51
51
 
52
- /** @type {import("vue").Ref<import("@eox/chart").EOxChart | null>} */
53
- export const compareChartEl = shallowRef(null);
52
+ /** Whether the charts are in fullscreen mode
53
+ * @type {import("vue").Ref<boolean>}
54
+ */
55
+ export const areChartsSeparateLayout = ref(false);
56
+
57
+ /** Holds main chart data
58
+ * @type {import("vue").Ref<Record<string,any>|null>}
59
+ */
60
+ export const chartData = ref(null);
61
+
62
+ /** Holds compare chart data
63
+ * @type {import("vue").Ref<Record<string,any>|null>}
64
+ */
65
+ export const compareChartData = ref(null);
66
+
67
+ /** Holds main chart spec
68
+ * @type {import("vue").Ref<import("vega-embed").VisualizationSpec | null>}
69
+ */
70
+ export const chartSpec = ref(null);
71
+
72
+ /** Holds compare chart spec
73
+ * @type {import("vue").Ref<import("vega-embed").VisualizationSpec | null>}
74
+ */
75
+ export const compareChartSpec = ref(null);
@@ -149,6 +149,14 @@ export interface TEodashProcess {
149
149
  >["$props"];
150
150
  }
151
151
 
152
+ /** @group Widgets */
153
+ export interface TEodashChart {
154
+ name: "EodashChart";
155
+ properties?: InstanceType<
156
+ typeof import("^/EodashChart.vue").default
157
+ >["$props"];
158
+ }
159
+
152
160
  /** @group Widgets */
153
161
  export interface TEodashMapBtns {
154
162
  name: "EodashMapBtns";
@@ -212,6 +220,7 @@ export type ComponentWidget =
212
220
  | TEodashLayerControl
213
221
  | TEodashStacInfo
214
222
  | TEodashProcess
223
+ | TEodashChart
215
224
  | TEodashMapBtns
216
225
  | TEodashTools
217
226
  | TEodashLayoutSwitcher
@@ -481,9 +490,11 @@ export type LayersEventBusKeys =
481
490
  | "layers:updated"
482
491
  | "time:updated"
483
492
  | "process:updated"
493
+ | "layertime:updated"
484
494
  | "compareLayers:updated"
485
495
  | "compareTime:updated"
486
- | "compareProcess:updated";
496
+ | "compareProcess:updated"
497
+ | "compareLayertime:updated";
487
498
 
488
499
  //// STAC API types
489
500
  /** @ignore */
@@ -220,6 +220,23 @@ export const getElement = (selector) => {
220
220
  //@ts-expect-error selectior can be a string or an Element
221
221
  return document.querySelector(selector);
222
222
  }
223
- //@ts-expect-error selectior can be a string or an Element
223
+ //@ts-expect-error selector can be a string or an Element
224
224
  return eoDash.shadowRoot?.querySelector(selector);
225
225
  };
226
+
227
+ /**
228
+ * Recursively searches parents for overlay HTML element (mobile tab root)
229
+ *
230
+ * @param { HTMLElement } el - HTML component, starting search from.
231
+ * @returns { HTMLElement | null }
232
+ */
233
+ export const getOverlayParent = (el) => {
234
+ while (el) {
235
+ if (el.id === "overlay" || el.classList.contains("panel")) {
236
+ return el;
237
+ }
238
+ //@ts-expect-error selector can be null or an Element
239
+ el = el.parentElement;
240
+ }
241
+ return null;
242
+ };
@@ -1,7 +1,7 @@
1
1
  import { createBlock, openBlock, withCtx, createElementVNode, unref, createElementBlock, createCommentVNode, normalizeStyle, Suspense, resolveDynamicComponent, mergeProps, Fragment, renderList, Transition } from 'vue';
2
2
  import '@eox/layout';
3
- import { _ as _export_sfc, u as useDefineTemplate } from './asWebComponent-DdguWGDI.js';
4
- import { V as VMain } from './VMain-vk4-rkw-.js';
3
+ import { _ as _export_sfc, u as useDefineTemplate } from './asWebComponent-DaIxULaA.js';
4
+ import { V as VMain } from './VMain-CVabY_NY.js';
5
5
 
6
6
  const _style_0 = ".panel[data-v-9c8477cc]{position:relative;overflow:auto;z-index:1;pointer-events:none}.pointer[data-v-9c8477cc]{pointer-events:all}.bg-panel[data-v-9c8477cc]{z-index:0;border-radius:0!important}.fade-enter-active[data-v-9c8477cc],.fade-leave-active[data-v-9c8477cc]{transition:opacity .25s ease}.fade-enter-from[data-v-9c8477cc],.fade-leave-to[data-v-9c8477cc]{opacity:0}.bg-surface[data-v-9c8477cc],.bg-primary[data-v-9c8477cc]{backdrop-filter:blur(10px)!important;border-radius:8px;border:none;box-shadow:0 0 1px #18274b38,0 6px 12px -6px #18274b1f,0 8px 24px -4px #18274b14;max-height:100%;overflow:auto;scrollbar-color:rgba(var(--v-theme-on-surface),.2) transparent;scrollbar-width:thin}.bg-surface[data-v-9c8477cc]{background-color:rgba(var(--v-theme-surface),var(--v-surface-opacity, .8))!important}.bg-primary[data-v-9c8477cc]{background-color:rgba(var(--v-theme-primary),var(--v-primary-opacity, .8))!important}";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { withAsyncContext, ref, onMounted, onUnmounted, createElementBlock, openBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
- import { E as useSTAcStore } from './asWebComponent-DdguWGDI.js';
2
+ import { E as useSTAcStore } from './asWebComponent-DaIxULaA.js';
3
3
 
4
4
  const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
5
5
 
@@ -0,0 +1,144 @@
1
+ import { computed, ref, useTemplateRef, onMounted, onBeforeUnmount, createElementBlock, openBlock, createElementVNode, withDirectives, createCommentVNode, unref, normalizeStyle, toRaw } from 'vue';
2
+ import '@eox/chart';
3
+ import { o as onChartClick } from './handling-DSA67d6E.js';
4
+ import { Z as compareChartData, _ as chartData, O as compareChartSpec, N as chartSpec, M as areChartsSeparateLayout } from './helpers-BBSdbOmv.js';
5
+ import { _ as _export_sfc, S as getOverlayParent } from './asWebComponent-DaIxULaA.js';
6
+ import { mdiArrowCollapse, mdiArrowExpand } from '@mdi/js';
7
+ import { T as Tooltip } from './index-6LlXNkke.js';
8
+
9
+ const _style_0 = ".chart-frame[data-v-8466cc5f]{position:relative}.chart-toggle[data-v-8466cc5f]{position:absolute;top:38px;right:12px;z-index:2;cursor:pointer}";
10
+
11
+ const _hoisted_1 = { ref: "container" };
12
+ const _hoisted_2 = { class: "chart-frame" };
13
+ const _hoisted_3 = {
14
+ viewBox: "0 0 20 20",
15
+ width: "20",
16
+ height: "20",
17
+ "aria-hidden": "true"
18
+ };
19
+ const _hoisted_4 = ["d"];
20
+ const _hoisted_5 = [".spec", ".dataValues", ".opt"];
21
+
22
+
23
+ const _sfc_main = {
24
+ __name: 'EodashChart',
25
+ props: {
26
+ enableCompare: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ vegaEmbedOptions: {
31
+ type: Object,
32
+ default() {
33
+ return { actions: true };
34
+ },
35
+ },
36
+ },
37
+ setup(__props) {
38
+
39
+
40
+
41
+ const usedChartData = computed(() => {
42
+ return __props.enableCompare ? compareChartData.value : chartData.value;
43
+ });
44
+
45
+ const usedChartSpec = computed(() => {
46
+ return __props.enableCompare ? compareChartSpec.value : chartSpec.value;
47
+ });
48
+
49
+ const chartRenderKey = ref(0);
50
+ const frameHeight = ref(225);
51
+ const containerEl = useTemplateRef("container");
52
+
53
+ /**
54
+ @type { MutationObserver | null}
55
+ */
56
+ let observer = null;
57
+
58
+ onMounted(() => {
59
+ const el = containerEl.value;
60
+ if (!el) return;
61
+
62
+ const parent = el.parentElement?.parentElement;
63
+ if (parent) {
64
+ const parentHeight = parent.getBoundingClientRect().height;
65
+ frameHeight.value = Math.max(225, Math.floor(parentHeight));
66
+ }
67
+
68
+ // for mobile view, the overlay panel containing chart is initially hidden
69
+ // we create an observer when display of overlay is not none anymore
70
+ const overlay = getOverlayParent(el);
71
+ if (!overlay) return;
72
+
73
+ observer = new MutationObserver(async () => {
74
+ const style = getComputedStyle(overlay);
75
+ const visible = style.display !== "none";
76
+ if (visible) {
77
+ // forcibly rerender chart, otherwise size of canvas is 0
78
+ chartRenderKey.value = Math.random();
79
+ }
80
+ });
81
+
82
+ observer.observe(overlay, {
83
+ attributes: true,
84
+ attributeFilter: ["style", "class"],
85
+ });
86
+ });
87
+
88
+ onBeforeUnmount(() => {
89
+ observer?.disconnect();
90
+ });
91
+
92
+ const chartStyles = computed(() => {
93
+ const styles = {
94
+ height: `${frameHeight.value}px`,
95
+ };
96
+ return styles;
97
+ });
98
+
99
+ const toggleIcon = computed(() =>
100
+ areChartsSeparateLayout.value ? mdiArrowCollapse : mdiArrowExpand,
101
+ );
102
+
103
+ function toggleLayout() {
104
+ areChartsSeparateLayout.value = !areChartsSeparateLayout.value;
105
+ }
106
+
107
+ return (_ctx, _cache) => {
108
+
109
+
110
+ return (openBlock(), createElementBlock("div", _hoisted_1, [
111
+ createElementVNode("div", _hoisted_2, [
112
+ (usedChartData.value && usedChartSpec.value)
113
+ ? withDirectives((openBlock(), createElementBlock("button", {
114
+ key: 0,
115
+ class: "chart-toggle",
116
+ onClick: toggleLayout
117
+ }, [
118
+ (openBlock(), createElementBlock("svg", _hoisted_3, [
119
+ createElementVNode("path", { d: toggleIcon.value }, null, 8 /* PROPS */, _hoisted_4)
120
+ ]))
121
+ ])), [
122
+ [Tooltip, unref(areChartsSeparateLayout) ? 'Minimize' : 'Maximize']
123
+ ])
124
+ : createCommentVNode("v-if", true),
125
+ (usedChartData.value && usedChartSpec.value)
126
+ ? (openBlock(), createElementBlock("eox-chart", {
127
+ class: "pt-0",
128
+ ".spec": toRaw(usedChartSpec.value),
129
+ key: chartRenderKey.value,
130
+ ".dataValues": toRaw(usedChartData.value),
131
+ "onClick:item": _cache[0] || (_cache[0] = (...args) => (unref(onChartClick) && unref(onChartClick)(...args))),
132
+ style: normalizeStyle(chartStyles.value),
133
+ ".opt": __props.vegaEmbedOptions
134
+ }, null, 44 /* STYLE, PROPS, NEED_HYDRATION */, _hoisted_5))
135
+ : createCommentVNode("v-if", true)
136
+ ])
137
+ ], 512 /* NEED_PATCH */))
138
+ }
139
+ }
140
+
141
+ };
142
+ const EodashChart = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]],['__scopeId',"data-v-8466cc5f"]]);
143
+
144
+ export { EodashChart as default };
@@ -1,13 +1,13 @@
1
1
  import { useCssVars, ref, useTemplateRef, customRef, computed, reactive, watch, onMounted, createElementBlock, openBlock, createVNode, unref, createSlots, withCtx, createElementVNode, withDirectives, createCommentVNode, createBlock, mergeProps, toHandlers } from 'vue';
2
2
  import { DatePicker } from 'v-calendar';
3
- import { _ as _export_sfc, D as useDisplay, E as useSTAcStore, F as useTransparentPanel, G as VBtn, H as VIcon, I as eodashCollections, J as eodashCompareCollections } from './asWebComponent-DdguWGDI.js';
4
- import { B as datetime } from './helpers-CtUlAW0N.js';
3
+ import { _ as _export_sfc, D as useDisplay, E as useSTAcStore, F as useTransparentPanel, G as VBtn, H as VIcon, I as eodashCollections, J as eodashCompareCollections } from './asWebComponent-DaIxULaA.js';
4
+ import { C as datetime } from './helpers-BBSdbOmv.js';
5
5
  import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
6
6
  import log from 'loglevel';
7
7
  import { storeToRefs } from 'pinia';
8
- import { T as Tooltip } from './index-DBo0F4Fv.js';
8
+ import { T as Tooltip } from './index-6LlXNkke.js';
9
9
 
10
- const _style_0 = ".vc-popover-content{--vc-nav-hover-bg: rgba(var(--v-theme-on-surface), .1);--vc-nav-item-active-color: rgb(var(--v-theme-on-secondary));--vc-nav-item-active-bg: rgba(var(--v-theme-secondary), .8);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .5)}.vc-container{--vc-day-content-hover-bg: rgba(var(--v-theme-on-surface), .2);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .4);--vc-header-arrow-hover-bg: rgba(var(--v-theme-secondary), .1)}.vc-attr{--vc-accent-600: rgba(var(--v-theme-secondary), .8)}.datePicker{--vc-day-content-hover-bg: red}@media (min-width: 960px){.datePicker{position:absolute;bottom:0;left:0;right:0;margin-inline:auto;width:fit-content}}.vc-day-content{color:#5e5e5e;font-weight:400}.vc-highlight-content-solid{color:#fff!important}.vc-popover-content-wrapper{transform:var(--v5270a4d4)!important}.vc-date-picker-content,.datePicker{backdrop-filter:blur(10px)!important;border-radius:8px;border:none;box-shadow:0 0 1px #18274b38,0 6px 12px -6px #18274b1f,0 8px 24px -4px #18274b14;background-color:rgba(var(--v-theme-surface),var(--v-surface-opacity, .8))!important}.vc-popover-caret.direction-top.align-left{clip-path:polygon(0% 0%,100% 0%,0% 100%,0% 100%)}.vc-bordered{border:none}";
10
+ const _style_0 = ".vc-popover-content{--vc-nav-hover-bg: rgba(var(--v-theme-on-surface), .1);--vc-nav-item-active-color: rgb(var(--v-theme-on-secondary));--vc-nav-item-active-bg: rgba(var(--v-theme-secondary), .8);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .5)}.vc-container{--vc-day-content-hover-bg: rgba(var(--v-theme-on-surface), .2);--vc-focus-ring: 0 0 0 2px rgba(var(--v-theme-secondary), .4);--vc-header-arrow-hover-bg: rgba(var(--v-theme-secondary), .1)}.vc-attr{--vc-accent-600: rgba(var(--v-theme-secondary), .8)}.datePicker{--vc-day-content-hover-bg: red}@media(min-width:960px){.datePicker{position:absolute;bottom:0;left:0;right:0;margin-inline:auto;width:fit-content}}.vc-day-content{color:#5e5e5e;font-weight:400}.vc-highlight-content-solid{color:#fff!important}.vc-popover-content-wrapper{transform:var(--v5270a4d4)!important}.vc-date-picker-content,.datePicker{backdrop-filter:blur(10px)!important;border-radius:8px;border:none;box-shadow:0 0 1px #18274b38,0 6px 12px -6px #18274b1f,0 8px 24px -4px #18274b14;background-color:rgba(var(--v-theme-surface),var(--v-surface-opacity, .8))!important}.vc-popover-caret.direction-top.align-left{clip-path:polygon(0% 0%,100% 0%,0% 100%,0% 100%)}.vc-bordered{border:none}";
11
11
 
12
12
  const _hoisted_1 = {
13
13
  ref: "rootRef",
@@ -1,7 +1,7 @@
1
1
  import { withAsyncContext, computed, ref, createElementBlock, openBlock, mergeProps, unref, createElementVNode, toDisplayString } from 'vue';
2
- import { _ as _export_sfc, E as useSTAcStore, Q as isFirstLoad } from './asWebComponent-DdguWGDI.js';
2
+ import { _ as _export_sfc, E as useSTAcStore, Q as isFirstLoad } from './asWebComponent-DaIxULaA.js';
3
3
 
4
- const _style_0 = "eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: row}@media (max-width: 768px){eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: column}}";
4
+ const _style_0 = "eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: row}@media(max-width:768px){eox-itemfilter[data-v-88d0abc7]{--form-flex-direction: column}}";
5
5
 
6
6
  const _hoisted_1 = [".items"];
7
7
  const _hoisted_2 = {
@@ -1,8 +1,8 @@
1
1
  import { withAsyncContext, computed, ref, createElementBlock, openBlock, createCommentVNode, mergeProps, unref, renderSlot, createElementVNode, toDisplayString } from 'vue';
2
2
  import 'color-legend-element';
3
3
  import '@eox/timecontrol';
4
- import { N as mapCompareEl, h as mapEl, O as getColFromLayer } from './helpers-CtUlAW0N.js';
5
- import { _ as _export_sfc, E as useSTAcStore, M as layerControlFormValueCompare, N as layerControlFormValue, J as eodashCompareCollections, I as eodashCollections } from './asWebComponent-DdguWGDI.js';
4
+ import { S as mapCompareEl, j as mapEl, T as getColFromLayer } from './helpers-BBSdbOmv.js';
5
+ import { _ as _export_sfc, E as useSTAcStore, M as layerControlFormValueCompare, N as layerControlFormValue, J as eodashCompareCollections, I as eodashCollections } from './asWebComponent-DaIxULaA.js';
6
6
  import { storeToRefs } from 'pinia';
7
7
 
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  import { ref, createElementBlock, openBlock, createBlock, unref, withCtx, createVNode, mergeProps } from 'vue';
2
- import { D as activeTemplate } from './helpers-CtUlAW0N.js';
2
+ import { E as activeTemplate } from './helpers-BBSdbOmv.js';
3
3
  import { mdiViewDashboard } from '@mdi/js';
4
- import { D as useDisplay, F as useTransparentPanel, H as VIcon } from './asWebComponent-DdguWGDI.js';
5
- import { V as VTooltip } from './VTooltip-BYUZeia1.js';
4
+ import { D as useDisplay, F as useTransparentPanel, H as VIcon } from './asWebComponent-DaIxULaA.js';
5
+ import { V as VTooltip } from './VTooltip-Cc6au3Sn.js';
6
6
 
7
7
  const _sfc_main = {
8
8
  __name: 'EodashLayoutSwitcher',