@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
@@ -3,6 +3,13 @@ import { setupCache } from 'axios-cache-interceptor';
3
3
  import log from 'loglevel';
4
4
  import { ref, shallowRef } from 'vue';
5
5
 
6
+ /**
7
+ * Create a bound version of a function with a specified `this` context
8
+ *
9
+ * @param {Function} fn - The function to bind
10
+ * @param {*} thisArg - The value to be passed as the `this` parameter
11
+ * @returns {Function} A new function that will call the original function with the specified `this` context
12
+ */
6
13
  function bind(fn, thisArg) {
7
14
  return function wrap() {
8
15
  return fn.apply(thisArg, arguments);
@@ -1255,7 +1262,7 @@ class InterceptorManager {
1255
1262
  *
1256
1263
  * @param {Number} id The ID that was returned by `use`
1257
1264
  *
1258
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1265
+ * @returns {void}
1259
1266
  */
1260
1267
  eject(id) {
1261
1268
  if (this.handlers[id]) {
@@ -2215,27 +2222,38 @@ const cookies = platform.hasStandardBrowserEnv ?
2215
2222
 
2216
2223
  // Standard browser envs support document.cookie
2217
2224
  {
2218
- write(name, value, expires, path, domain, secure) {
2219
- const cookie = [name + '=' + encodeURIComponent(value)];
2225
+ write(name, value, expires, path, domain, secure, sameSite) {
2226
+ if (typeof document === 'undefined') return;
2220
2227
 
2221
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2228
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
2222
2229
 
2223
- utils$1.isString(path) && cookie.push('path=' + path);
2224
-
2225
- utils$1.isString(domain) && cookie.push('domain=' + domain);
2226
-
2227
- secure === true && cookie.push('secure');
2230
+ if (utils$1.isNumber(expires)) {
2231
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
2232
+ }
2233
+ if (utils$1.isString(path)) {
2234
+ cookie.push(`path=${path}`);
2235
+ }
2236
+ if (utils$1.isString(domain)) {
2237
+ cookie.push(`domain=${domain}`);
2238
+ }
2239
+ if (secure === true) {
2240
+ cookie.push('secure');
2241
+ }
2242
+ if (utils$1.isString(sameSite)) {
2243
+ cookie.push(`SameSite=${sameSite}`);
2244
+ }
2228
2245
 
2229
2246
  document.cookie = cookie.join('; ');
2230
2247
  },
2231
2248
 
2232
2249
  read(name) {
2233
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2234
- return (match ? decodeURIComponent(match[3]) : null);
2250
+ if (typeof document === 'undefined') return null;
2251
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
2252
+ return match ? decodeURIComponent(match[1]) : null;
2235
2253
  },
2236
2254
 
2237
2255
  remove(name) {
2238
- this.write(name, '', Date.now() - 86400000);
2256
+ this.write(name, '', Date.now() - 86400000, '/');
2239
2257
  }
2240
2258
  }
2241
2259
 
@@ -2324,11 +2342,11 @@ function mergeConfig(config1, config2) {
2324
2342
  }
2325
2343
 
2326
2344
  // eslint-disable-next-line consistent-return
2327
- function mergeDeepProperties(a, b, prop , caseless) {
2345
+ function mergeDeepProperties(a, b, prop, caseless) {
2328
2346
  if (!utils$1.isUndefined(b)) {
2329
- return getMergedValue(a, b, prop , caseless);
2347
+ return getMergedValue(a, b, prop, caseless);
2330
2348
  } else if (!utils$1.isUndefined(a)) {
2331
- return getMergedValue(undefined, a, prop , caseless);
2349
+ return getMergedValue(undefined, a, prop, caseless);
2332
2350
  }
2333
2351
  }
2334
2352
 
@@ -2386,7 +2404,7 @@ function mergeConfig(config1, config2) {
2386
2404
  socketPath: defaultToConfig2,
2387
2405
  responseEncoding: defaultToConfig2,
2388
2406
  validateStatus: mergeDirectKeys,
2389
- headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
2407
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
2390
2408
  };
2391
2409
 
2392
2410
  utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
@@ -3024,7 +3042,7 @@ const factory = (env) => {
3024
3042
  const seedCache = new Map();
3025
3043
 
3026
3044
  const getFetch = (config) => {
3027
- let env = config ? config.env : {};
3045
+ let env = (config && config.env) || {};
3028
3046
  const {fetch, Request, Response} = env;
3029
3047
  const seeds = [
3030
3048
  Request, Response, fetch
@@ -3047,6 +3065,15 @@ const getFetch = (config) => {
3047
3065
 
3048
3066
  getFetch();
3049
3067
 
3068
+ /**
3069
+ * Known adapters mapping.
3070
+ * Provides environment-specific adapters for Axios:
3071
+ * - `http` for Node.js
3072
+ * - `xhr` for browsers
3073
+ * - `fetch` for fetch API-based requests
3074
+ *
3075
+ * @type {Object<string, Function|Object>}
3076
+ */
3050
3077
  const knownAdapters = {
3051
3078
  http: httpAdapter,
3052
3079
  xhr: xhrAdapter,
@@ -3055,71 +3082,107 @@ const knownAdapters = {
3055
3082
  }
3056
3083
  };
3057
3084
 
3085
+ // Assign adapter names for easier debugging and identification
3058
3086
  utils$1.forEach(knownAdapters, (fn, value) => {
3059
3087
  if (fn) {
3060
3088
  try {
3061
- Object.defineProperty(fn, 'name', {value});
3089
+ Object.defineProperty(fn, 'name', { value });
3062
3090
  } catch (e) {
3063
3091
  // eslint-disable-next-line no-empty
3064
3092
  }
3065
- Object.defineProperty(fn, 'adapterName', {value});
3093
+ Object.defineProperty(fn, 'adapterName', { value });
3066
3094
  }
3067
3095
  });
3068
3096
 
3097
+ /**
3098
+ * Render a rejection reason string for unknown or unsupported adapters
3099
+ *
3100
+ * @param {string} reason
3101
+ * @returns {string}
3102
+ */
3069
3103
  const renderReason = (reason) => `- ${reason}`;
3070
3104
 
3105
+ /**
3106
+ * Check if the adapter is resolved (function, null, or false)
3107
+ *
3108
+ * @param {Function|null|false} adapter
3109
+ * @returns {boolean}
3110
+ */
3071
3111
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
3072
3112
 
3073
- const adapters = {
3074
- getAdapter: (adapters, config) => {
3075
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3076
-
3077
- const {length} = adapters;
3078
- let nameOrAdapter;
3079
- let adapter;
3113
+ /**
3114
+ * Get the first suitable adapter from the provided list.
3115
+ * Tries each adapter in order until a supported one is found.
3116
+ * Throws an AxiosError if no adapter is suitable.
3117
+ *
3118
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
3119
+ * @param {Object} config - Axios request configuration
3120
+ * @throws {AxiosError} If no suitable adapter is available
3121
+ * @returns {Function} The resolved adapter function
3122
+ */
3123
+ function getAdapter(adapters, config) {
3124
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3080
3125
 
3081
- const rejectedReasons = {};
3126
+ const { length } = adapters;
3127
+ let nameOrAdapter;
3128
+ let adapter;
3082
3129
 
3083
- for (let i = 0; i < length; i++) {
3084
- nameOrAdapter = adapters[i];
3085
- let id;
3130
+ const rejectedReasons = {};
3086
3131
 
3087
- adapter = nameOrAdapter;
3132
+ for (let i = 0; i < length; i++) {
3133
+ nameOrAdapter = adapters[i];
3134
+ let id;
3088
3135
 
3089
- if (!isResolvedHandle(nameOrAdapter)) {
3090
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3136
+ adapter = nameOrAdapter;
3091
3137
 
3092
- if (adapter === undefined) {
3093
- throw new AxiosError(`Unknown adapter '${id}'`);
3094
- }
3095
- }
3138
+ if (!isResolvedHandle(nameOrAdapter)) {
3139
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3096
3140
 
3097
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
3098
- break;
3141
+ if (adapter === undefined) {
3142
+ throw new AxiosError(`Unknown adapter '${id}'`);
3099
3143
  }
3144
+ }
3100
3145
 
3101
- rejectedReasons[id || '#' + i] = adapter;
3146
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
3147
+ break;
3102
3148
  }
3103
3149
 
3104
- if (!adapter) {
3150
+ rejectedReasons[id || '#' + i] = adapter;
3151
+ }
3105
3152
 
3106
- const reasons = Object.entries(rejectedReasons)
3107
- .map(([id, state]) => `adapter ${id} ` +
3108
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
3109
- );
3153
+ if (!adapter) {
3154
+ const reasons = Object.entries(rejectedReasons)
3155
+ .map(([id, state]) => `adapter ${id} ` +
3156
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
3157
+ );
3110
3158
 
3111
- let s = length ?
3112
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3113
- 'as no adapter specified';
3159
+ let s = length ?
3160
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3161
+ 'as no adapter specified';
3114
3162
 
3115
- throw new AxiosError(
3116
- `There is no suitable adapter to dispatch the request ` + s,
3117
- 'ERR_NOT_SUPPORT'
3118
- );
3119
- }
3163
+ throw new AxiosError(
3164
+ `There is no suitable adapter to dispatch the request ` + s,
3165
+ 'ERR_NOT_SUPPORT'
3166
+ );
3167
+ }
3120
3168
 
3121
- return adapter;
3122
- },
3169
+ return adapter;
3170
+ }
3171
+
3172
+ /**
3173
+ * Exports Axios adapters and utility to resolve an adapter
3174
+ */
3175
+ const adapters = {
3176
+ /**
3177
+ * Resolve an adapter from a list of adapter names or functions.
3178
+ * @type {Function}
3179
+ */
3180
+ getAdapter,
3181
+
3182
+ /**
3183
+ * Exposes all known adapters
3184
+ * @type {Object<string, Function|Object>}
3185
+ */
3123
3186
  adapters: knownAdapters
3124
3187
  };
3125
3188
 
@@ -3196,7 +3259,7 @@ function dispatchRequest(config) {
3196
3259
  });
3197
3260
  }
3198
3261
 
3199
- const VERSION = "1.12.2";
3262
+ const VERSION = "1.13.2";
3200
3263
 
3201
3264
  const validators$1 = {};
3202
3265
 
@@ -3751,6 +3814,12 @@ const HttpStatusCode = {
3751
3814
  LoopDetected: 508,
3752
3815
  NotExtended: 510,
3753
3816
  NetworkAuthenticationRequired: 511,
3817
+ WebServerIsDown: 521,
3818
+ ConnectionTimedOut: 522,
3819
+ OriginIsUnreachable: 523,
3820
+ TimeoutOccurred: 524,
3821
+ SslHandshakeFailed: 525,
3822
+ InvalidSslCertificate: 526,
3754
3823
  };
3755
3824
 
3756
3825
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
@@ -3873,24 +3942,50 @@ const poi = ref("");
3873
3942
  */
3874
3943
  const comparePoi = ref("");
3875
3944
 
3876
- /** @type {import("vue").Ref<import("@eox/chart").EOxChart | null>} */
3877
- const chartEl = shallowRef(null);
3945
+ /** Whether the map is in globe mode */
3946
+ const isGlobe = ref(false);
3947
+
3948
+ /** Whether the charts are in fullscreen mode
3949
+ * @type {import("vue").Ref<boolean>}
3950
+ */
3951
+ const areChartsSeparateLayout = ref(false);
3878
3952
 
3879
- /** @type {import("vue").Ref<import("@eox/chart").EOxChart | null>} */
3880
- const compareChartEl = shallowRef(null);
3953
+ /** Holds main chart data
3954
+ * @type {import("vue").Ref<Record<string,any>|null>}
3955
+ */
3956
+ const chartData = ref(null);
3957
+
3958
+ /** Holds compare chart data
3959
+ * @type {import("vue").Ref<Record<string,any>|null>}
3960
+ */
3961
+ const compareChartData = ref(null);
3962
+
3963
+ /** Holds main chart spec
3964
+ * @type {import("vue").Ref<import("vega-embed").VisualizationSpec | null>}
3965
+ */
3966
+ const chartSpec = ref(null);
3967
+
3968
+ /** Holds compare chart spec
3969
+ * @type {import("vue").Ref<import("vega-embed").VisualizationSpec | null>}
3970
+ */
3971
+ const compareChartSpec = ref(null);
3881
3972
 
3882
3973
  const states = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
3883
3974
  __proto__: null,
3884
3975
  activeTemplate,
3976
+ areChartsSeparateLayout,
3885
3977
  availableMapProjection,
3886
- chartEl,
3887
- compareChartEl,
3978
+ chartData,
3979
+ chartSpec,
3980
+ compareChartData,
3981
+ compareChartSpec,
3888
3982
  compareIndicator,
3889
3983
  comparePoi,
3890
3984
  currentCompareUrl,
3891
3985
  currentUrl,
3892
3986
  datetime,
3893
3987
  indicator,
3988
+ isGlobe,
3894
3989
  mapCompareEl,
3895
3990
  mapEl,
3896
3991
  mapPosition,
@@ -3902,26 +3997,13 @@ const states = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
3902
3997
  * Returns the current layers of {@link mapEl}
3903
3998
  * @returns {import("@eox/map").EoxLayer[]}
3904
3999
  */
3905
- const getLayers = () => mapEl.value?.layers.toReversed() ?? [];
4000
+ const getLayers = () => mapEl.value?.layers ?? [];
3906
4001
 
3907
4002
  /**
3908
4003
  * Returns the current layers of {@link mapCompareEl}
3909
4004
  * * @returns {import("@eox/map").EoxLayer[]}
3910
4005
  */
3911
- const getCompareLayers = () =>
3912
- mapCompareEl.value?.layers.toReversed() ?? [];
3913
-
3914
- /**
3915
- * Returns the current chart spec from {@link chartEl}
3916
- * @returns {import("vega-embed").VisualizationSpec | null}
3917
- */
3918
- const getChartSpec = () => chartEl.value?.spec ?? null;
3919
-
3920
- /**
3921
- * Returns the current chart spec from {@link compareChartEl}
3922
- * @returns {import("vega-embed").VisualizationSpec | null}
3923
- */
3924
- const getCompareChartSpec = () => compareChartEl.value?.spec ?? null;
4006
+ const getCompareLayers = () => mapCompareEl.value?.layers ?? [];
3925
4007
 
3926
4008
  /**
3927
4009
  * Register EPSG projection in `eox-map`
@@ -3996,16 +4078,27 @@ const includesProcess = (collection, compare = false) => {
3996
4078
  );
3997
4079
  };
3998
4080
 
4081
+ /**
4082
+ * Check whether main or compare chart have data to show
4083
+ * @param {boolean} [compare=false] - Whether to check for compare collection
4084
+ * @returns
4085
+ */
4086
+ const shouldShowChartWidget = (compare = false) => {
4087
+ return (
4088
+ areChartsSeparateLayout.value &&
4089
+ (compare ? compareChartData.value : chartData.value)
4090
+ );
4091
+ };
4092
+
3999
4093
  const actions = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
4000
4094
  __proto__: null,
4001
4095
  changeMapProjection,
4002
- getChartSpec,
4003
- getCompareChartSpec,
4004
4096
  getCompareLayers,
4005
4097
  getLayers,
4006
4098
  includesProcess,
4007
4099
  registerProjection,
4008
- setActiveTemplate
4100
+ setActiveTemplate,
4101
+ shouldShowChartWidget
4009
4102
  }, Symbol.toStringTag, { value: 'Module' }));
4010
4103
 
4011
4104
  /*
@@ -4073,18 +4166,18 @@ function getStyleVariablesState(collectionId, variables) {
4073
4166
  "",
4074
4167
  "",
4075
4168
  ];
4076
- return (
4077
- collection === collectionId &&
4078
- ["Vector", "WebGLTile", "VectorTile"].includes(layer?.type ?? "")
4079
- );
4169
+ return collection === collectionId;
4080
4170
  });
4081
4171
 
4082
4172
  if (!matchingLayer) {
4083
4173
  return variables;
4084
4174
  }
4175
+ // TODO instead tap into store for changed variables state per layer
4176
+ // because XYZ and WMTS use tileurlfunction update, where we can not retrieve
4177
+ // current values from OL layers anyhow
4085
4178
 
4086
4179
  const olLayer = mapElement.getLayerById(matchingLayer.properties?.id ?? "");
4087
- const oldVariablesState =
4180
+ let oldVariablesState =
4088
4181
  /** @type {import("ol/layer").Vector} */ (
4089
4182
  olLayer
4090
4183
  //@ts-expect-error variables doesn't exist in non-flat style
@@ -4145,13 +4238,19 @@ function generateFeatures(links, extraProperties = {}, rel = "item") {
4145
4238
  }
4146
4239
 
4147
4240
  /**
4148
- * Sperates and extracts layerConfig (jsonform schema & legend) from a style json
4241
+ * Spearates and extracts layerConfig (jsonform schema & legend) from a style json
4149
4242
  *
4150
4243
  * @param {string} collectionId
4151
4244
  * @param { import("@/types").EodashStyleJson} [style]
4152
4245
  * @param {Record<string,any>} [rasterJsonform]
4246
+ * @param {string} [layerConfigType]
4153
4247
  * */
4154
- function extractLayerConfig(collectionId, style, rasterJsonform) {
4248
+ function extractLayerConfig(
4249
+ collectionId,
4250
+ style,
4251
+ rasterJsonform,
4252
+ layerConfigType,
4253
+ ) {
4155
4254
  if (!style && !rasterJsonform) {
4156
4255
  return { layerConfig: undefined, style: undefined };
4157
4256
  }
@@ -4159,6 +4258,10 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
4159
4258
  style = { ...style };
4160
4259
  }
4161
4260
 
4261
+ if (style?.variables && Object.keys(style.variables ?? {}).length) {
4262
+ style.variables = getStyleVariablesState(collectionId, style.variables);
4263
+ }
4264
+
4162
4265
  if (rasterJsonform) {
4163
4266
  return {
4164
4267
  layerConfig: {
@@ -4170,16 +4273,12 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
4170
4273
  };
4171
4274
  }
4172
4275
 
4173
- if (style?.variables && Object.keys(style.variables ?? {}).length) {
4174
- style.variables = getStyleVariablesState(collectionId, style.variables);
4175
- }
4176
-
4177
4276
  /** @type {Record<string,unknown> | undefined} */
4178
4277
  let layerConfig = undefined;
4179
4278
 
4180
4279
  if (style?.jsonform) {
4181
4280
  // this explicitly sets legend only if jsonform is configured
4182
- layerConfig = { schema: style.jsonform, type: "style" };
4281
+ layerConfig = { schema: style.jsonform, type: layerConfigType || "style" };
4183
4282
  delete style.jsonform;
4184
4283
  if (style?.legend) {
4185
4284
  layerConfig.legend = style.legend;
@@ -4193,6 +4292,7 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
4193
4292
 
4194
4293
  return { layerConfig, style };
4195
4294
  }
4295
+
4196
4296
  /**
4197
4297
  *
4198
4298
  * @param {number[]} bbox
@@ -4267,35 +4367,41 @@ const extractRoles = (properties, linkOrAsset) => {
4267
4367
 
4268
4368
  /**
4269
4369
  * Extracts a single non-link style JSON from a STAC Item optionally for a selected key mapping
4270
- * @param {import("stac-ts").StacItem} item
4271
- * @param {string} itemUrl
4272
- * @param {string | undefined} key
4370
+ * @param { import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
4371
+ * @param {string | undefined} linkKey
4372
+ * @param {string | undefined} assetKey
4273
4373
  * @returns
4274
4374
  **/
4275
- const fetchStyle = async (item, itemUrl, key = undefined) => {
4375
+ const fetchStyle = async (
4376
+ stacObject,
4377
+ linkKey = undefined,
4378
+ assetKey = undefined,
4379
+ ) => {
4276
4380
  let styleLink = null;
4277
- if (key) {
4278
- styleLink = item.links.find(
4381
+ if (linkKey) {
4382
+ styleLink = stacObject.links.find(
4279
4383
  (link) =>
4280
4384
  link.rel.includes("style") &&
4281
4385
  link["links:keys"] &&
4282
- /** @type {Array<string>} */ (link["links:keys"]).includes(key),
4386
+ /** @type {Array<string>} */ (link["links:keys"]).includes(linkKey),
4387
+ );
4388
+ } else if (assetKey) {
4389
+ styleLink = stacObject.links.find(
4390
+ (link) =>
4391
+ link.rel.includes("style") &&
4392
+ link["asset:keys"] &&
4393
+ /** @type {Array<string>} */ (link["asset:keys"]).includes(assetKey),
4283
4394
  );
4284
4395
  } else {
4285
- styleLink = item.links.find(
4286
- (link) => link.rel.includes("style") && !link["links:keys"],
4396
+ log.debug(
4397
+ "Neither link key, nor asset key input, can not match any style to layer.",
4398
+ stacObject.id,
4287
4399
  );
4400
+ return {};
4288
4401
  }
4289
4402
  if (styleLink) {
4290
- let url = "";
4291
- if (styleLink.href.startsWith("http")) {
4292
- url = styleLink.href;
4293
- } else {
4294
- url = toAbsolute(styleLink.href, itemUrl);
4295
- }
4296
-
4297
4403
  /** @type {import("@/types").EodashStyleJson} */
4298
- const styleJson = await axios.get(url).then((resp) => resp.data);
4404
+ const styleJson = await axios.get(styleLink.href).then((resp) => resp.data);
4299
4405
 
4300
4406
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
4301
4407
  return { ...styleJson };
@@ -4304,18 +4410,15 @@ const fetchStyle = async (item, itemUrl, key = undefined) => {
4304
4410
 
4305
4411
  /**
4306
4412
  * Fetches all style JSONs from a STAC Item and returns an array with style objects
4307
- * @param {import("stac-ts").StacItem} item
4308
- * @param {string} itemUrl
4413
+ * @param {import("stac-ts").StacItem | import("stac-ts").StacCollection} stacObject
4309
4414
  * @returns { Promise <Array<import("@/types").EodashStyleJson>>}
4310
4415
  **/
4311
- const fetchAllStyles = async (item, itemUrl) => {
4312
- const styleLinks = item.links.filter((link) => link.rel.includes("style"));
4416
+ const fetchAllStyles = async (stacObject) => {
4417
+ const styleLinks = stacObject.links.filter((link) =>
4418
+ link.rel.includes("style"),
4419
+ );
4313
4420
  const fetchPromises = styleLinks.map(async (link) => {
4314
- let url = link.href.startsWith("http")
4315
- ? link.href
4316
- : toAbsolute(link.href, itemUrl);
4317
-
4318
- const styleJson = await axios.get(url).then((resp) => resp.data);
4421
+ const styleJson = await axios.get(link.href).then((resp) => resp.data);
4319
4422
  log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
4320
4423
  return styleJson;
4321
4424
  });
@@ -4525,7 +4628,7 @@ const replaceLayersInStructure = (layers, toRemove, toInsert) => {
4525
4628
  continue;
4526
4629
  }
4527
4630
 
4528
- result.push(layer);
4631
+ result.unshift(layer);
4529
4632
  }
4530
4633
 
4531
4634
  return result;
@@ -4571,15 +4674,11 @@ const replaceLayer = (currentLayers, oldLayer, newLayers) => {
4571
4674
  * @param {import('ol/layer').Layer} layer
4572
4675
  */
4573
4676
  const getColFromLayer = async (indicators, layer) => {
4574
- const [collectionId, itemId] = layer.get("id").split(";:;");
4677
+ const [collectionId] = layer.get("id").split(";:;");
4575
4678
 
4576
4679
  for (const ind of indicators) {
4577
4680
  if (ind.collectionStac?.id !== collectionId) continue;
4578
- const items = await ind.getItems();
4579
- const itemIds = items?.map((item) => item.id || item.datetime) ?? [];
4580
- if (itemIds.includes(itemId)) {
4581
- return ind;
4582
- }
4681
+ return ind;
4583
4682
  }
4584
4683
  };
4585
4684
 
@@ -4926,4 +5025,18 @@ function extractLayerLegend(collection) {
4926
5025
  return extraProperties;
4927
5026
  }
4928
5027
 
4929
- export { currentUrl as A, datetime as B, poi as C, activeTemplate as D, mapPosition as E, indicator as F, currentCompareUrl as G, compareIndicator as H, comparePoi as I, states as J, actions as K, includesProcess as L, sanitizeBbox as M, mapCompareEl as N, getColFromLayer as O, setMapProjFromCol as P, availableMapProjection as Q, changeMapProjection as R, setActiveTemplate as S, compareChartEl as T, chartEl as U, replaceLayer as V, axios$1 as W, removeUnneededProperties as X, getChartSpec as Y, extractLayerConfig as a, addTooltipInteraction as b, createLayerID as c, createAssetID as d, extractRoles as e, fetchStyle as f, getProjectionCode as g, mapEl as h, isSTACItem as i, axios as j, extractLayerTimeValues as k, fetchApiItems as l, mergeGeojsons as m, getDatetimeProperty as n, fetchAllStyles as o, getLayers as p, getCompareLayers as q, registerProjection as r, findLayer as s, findLayersByLayerPrefix as t, replaceLayersInStructure as u, generateFeatures as v, extractLayerLegend as w, extractCollectionUrls as x, generateLinksFromItems as y, revokeCollectionBlobUrls as z };
5028
+ /**
5029
+ * @param { import ("stac-ts").StacLink } link
5030
+ * @returns {object}
5031
+ */
5032
+ function extractEoxLegendLink(link) {
5033
+ let extraProperties = {};
5034
+ if (link["eox:colorlegend"]) {
5035
+ extraProperties = {
5036
+ layerLegend: link["eox:colorlegend"],
5037
+ };
5038
+ }
5039
+ return extraProperties;
5040
+ }
5041
+
5042
+ export { replaceLayer as $, revokeCollectionBlobUrls as A, currentUrl as B, datetime as C, poi as D, activeTemplate as E, mapPosition as F, indicator as G, currentCompareUrl as H, compareIndicator as I, comparePoi as J, states as K, actions as L, areChartsSeparateLayout as M, chartSpec as N, compareChartSpec as O, includesProcess as P, shouldShowChartWidget as Q, sanitizeBbox as R, mapCompareEl as S, getColFromLayer as T, setMapProjFromCol as U, isGlobe as V, setActiveTemplate as W, availableMapProjection as X, changeMapProjection as Y, compareChartData as Z, chartData as _, extractEoxLegendLink as a, axios$1 as a0, removeUnneededProperties as a1, extractLayerConfig as b, createLayerID as c, axios as d, extractRoles as e, fetchStyle as f, getProjectionCode as g, addTooltipInteraction as h, createAssetID as i, mapEl as j, isSTACItem as k, extractLayerTimeValues as l, mergeGeojsons as m, fetchApiItems as n, getDatetimeProperty as o, fetchAllStyles as p, findLayer as q, registerProjection as r, findLayersByLayerPrefix as s, replaceLayersInStructure as t, generateFeatures as u, extractLayerLegend as v, getLayers as w, getCompareLayers as x, extractCollectionUrls as y, generateLinksFromItems as z };
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent, render, h, mergeProps } from 'vue';
2
- import { X as consoleError, Y as isObject } from './asWebComponent-DdguWGDI.js';
3
- import { V as VTooltip } from './VTooltip-BYUZeia1.js';
2
+ import { Y as consoleError, Z as isObject } from './asWebComponent-DaIxULaA.js';
3
+ import { V as VTooltip } from './VTooltip-Cc6au3Sn.js';
4
4
 
5
5
  // Utilities
6
6
  function useDirectiveComponent(component, props) {
@@ -75,8 +75,10 @@ function findComponentParent(vnode, root) {
75
75
 
76
76
  // Components
77
77
  const Tooltip = useDirectiveComponent(VTooltip, binding => {
78
+ const disabled = isObject(binding.value) ? !binding.value.text : ['', false, null].includes(binding.value); // undefined means true
79
+
78
80
  return {
79
- activator: 'parent',
81
+ activator: disabled ? null : 'parent',
80
82
  location: binding.arg?.replace('-', ' '),
81
83
  text: typeof binding.value === 'boolean' ? undefined : binding.value
82
84
  };