@eodash/eodash 5.0.0-alpha.2.4 → 5.0.0-alpha.2.5

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 (51) hide show
  1. package/README.md +12 -2
  2. package/core/client/SuspensedDashboard.ce.vue +1 -5
  3. package/core/client/components/DashboardLayout.vue +37 -14
  4. package/core/client/components/ErrorAlert.vue +6 -1
  5. package/core/client/components/Footer.vue +6 -1
  6. package/core/client/components/Header.vue +6 -1
  7. package/core/client/components/IframeWrapper.vue +1 -1
  8. package/core/client/components/MobileLayout.vue +41 -10
  9. package/core/client/composables/DefineEodash.js +2 -1
  10. package/core/client/composables/DefineWidgets.js +14 -8
  11. package/core/client/composables/index.js +18 -119
  12. package/core/client/eodash.js +38 -36
  13. package/core/client/plugins/index.js +3 -0
  14. package/core/client/types.d.ts +40 -83
  15. package/core/client/utils/eodashSTAC.js +29 -25
  16. package/core/client/utils/index.js +15 -11
  17. package/core/client/views/Dashboard.vue +22 -11
  18. package/dist/client/DashboardLayout-BYROtP-7.js +156 -0
  19. package/dist/client/{DynamicWebComponent-C4Hotc4H.js → DynamicWebComponent-BQhxFPM0.js} +6 -6
  20. package/dist/client/EodashDatePicker-CFltnt5d.js +1194 -0
  21. package/dist/client/EodashItemFilter-DIBDAHcc.js +65 -0
  22. package/dist/client/{EodashMap-CGrQjZ1P.js → EodashMap-C6jJ2Lb_.js} +14323 -15656
  23. package/dist/client/Footer-BVIZms1S.js +115 -0
  24. package/dist/client/Header-TsTL1d2R.js +633 -0
  25. package/dist/client/{IframeWrapper-Cg3GMmfW.js → IframeWrapper-XKChM78a.js} +4 -4
  26. package/dist/client/MobileLayout-BlGcMQra.js +957 -0
  27. package/dist/client/{VMain-BHYlmRic.js → VMain-C9XV5Lyg.js} +8 -8
  28. package/dist/client/{WidgetsContainer-dje9QSk0.js → WidgetsContainer-BQXHnZpa.js} +3 -3
  29. package/dist/client/asWebComponent-CbdGxelK.js +20188 -0
  30. package/dist/client/{decoder-HRvnjnEI-BQ2rajuJ.js → decoder-HRvnjnEI-CHAYOWhz.js} +1 -1
  31. package/dist/client/eo-dash.js +1 -1
  32. package/dist/client/forwardRefs-CyCJOFsz.js +192 -0
  33. package/dist/client/http-ZWiLaAeR.js +1337 -0
  34. package/dist/client/{index-CaDDfJYE.js → index-CabQjjQg.js} +43 -74
  35. package/dist/client/{lerc-_E46UbWQ-Beu35ovS.js → lerc-_E46UbWQ-TxBH4OeK.js} +1 -1
  36. package/dist/client/{ssrBoot-Dd7m-btU.js → ssrBoot-DWJ-z4I-.js} +3 -3
  37. package/dist/client/style.css +2 -2
  38. package/dist/client/transition-BlLt41wg.js +34 -0
  39. package/dist/node/cli.js +3 -3
  40. package/package.json +3 -4
  41. package/widgets/EodashDatePicker.vue +89 -36
  42. package/widgets/EodashItemFilter.vue +29 -13
  43. package/dist/client/DashboardLayout-ZaSRMD1M.js +0 -149
  44. package/dist/client/EodashDatePicker-C4kKjxKy.js +0 -1653
  45. package/dist/client/EodashItemFilter-cBHC0YEM.js +0 -51
  46. package/dist/client/Footer-pS636dEP.js +0 -118
  47. package/dist/client/Header-DQuaLdjl.js +0 -605
  48. package/dist/client/MobileLayout-BLXFBWI_.js +0 -987
  49. package/dist/client/asWebComponent-Bvb3xkxI.js +0 -13311
  50. package/dist/client/forwardRefs-Bxeu9Obx.js +0 -142
  51. package/dist/client/index-DlNICb3T.js +0 -34
package/README.md CHANGED
@@ -1,13 +1,19 @@
1
+ # @eodash/eodash [![Version](https://badgen.net/npm/v/@eodash/eodash)](https://www.npmjs.com/package/@eodash/eodash)
2
+
3
+ A package for creating earth observation dashboards. To learn more about eodash ecosystem visit [eodash.org](https://eodash.org)
4
+ ## Usage
5
+ Checkout the [documentation](https://eodash.github.io/eodash/get-started.html) for a detailed guide.
6
+
1
7
  ## Get Started
2
8
  Install all the required dependecies after cloning or downloading the repository using Node v18 or higher:
3
9
  ```bash
4
10
  npm run install
5
11
  ```
6
- Run the dev server and the app will open your default browser window to the landing page:
12
+ Run the dev server:
7
13
  ```bash
8
14
  npm run dev
9
15
  ```
10
- To compile and minify for production:
16
+ To compile and minify a demo instance:
11
17
  ```bash
12
18
  npm run build
13
19
  ```
@@ -15,6 +21,10 @@ To preview the compiled production files :
15
21
  ```bash
16
22
  npm run preview
17
23
  ```
24
+ To compile and minify a demo instance as a web component library:
25
+ ```bash
26
+ npm run build -- --lib
27
+ ```
18
28
 
19
29
  ## Folder Structure
20
30
  .
@@ -51,11 +51,7 @@ function setStylesFromHead(hiddenElements) {
51
51
  }
52
52
  });
53
53
 
54
- stylesStr += `\n * {
55
- font-family:${
56
- //@ts-expect-error
57
- /** @type {import("@/types").Eodash} */ (inst.provides[eodashKey])?.brand.font?.family ?? 'Roboto'}
58
- }
54
+ stylesStr += `\n
59
55
  ${//@ts-expect-error
60
56
  /** @type {import("@/types").Eodash} */ (inst.provides[eodashKey]).brand.noLayout ?
61
57
  `div.v-application__wrap {
@@ -1,21 +1,22 @@
1
1
  <template>
2
2
  <v-main>
3
3
  <eox-layout :gap="eodash.template.gap ?? 2">
4
- <eox-layout-item v-if="bgWidget.component" style="z-index: 0;" x="0" y="0" h="12" w="12">
4
+ <eox-layout-item v-if="bgWidget.component" class="bg-panel" x="0" y="0" h="12" w="12">
5
5
  <Suspense suspensible>
6
6
  <component id="bg-widget" :is="bgWidget.component" v-bind="bgWidget.props" />
7
7
  </Suspense>
8
8
  </eox-layout-item>
9
- <template v-for="(config, idx) in widgetsConfig" :key="idx">
10
- <eox-layout-item v-if="importedWidgets[idx].value.component"
11
- style="position: relative; overflow: visible; z-index: 1; border-radius: 0px; background: rgb(var(--v-theme-surface))"
12
- :x="config.layout.x" :y="config.layout.y" :h="config.layout.h" :w="config.layout.w">
13
-
14
- <Suspense suspensible>
15
- <component :key="importedWidgets[idx].value.id" :is="importedWidgets[idx].value.component"
16
- v-bind="importedWidgets[idx].value.props" />
17
- </Suspense>
18
- </eox-layout-item>
9
+ <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
10
+ <Transition name="fade">
11
+ <eox-layout-item v-if="importedWidget.value.component" :key="importedWidget.value.id" class="panel"
12
+ :h="importedWidget.value.layout.h" :w="importedWidget.value.layout.w" :x="importedWidget.value.layout.x"
13
+ :y="importedWidget.value.layout.y">
14
+ <Suspense suspensible>
15
+ <component :key="importedWidget.value.id" :is="importedWidget.value.component"
16
+ v-bind="importedWidget.value.props" />
17
+ </Suspense>
18
+ </eox-layout-item>
19
+ </Transition>
19
20
  </template>
20
21
  </eox-layout>
21
22
  </v-main>
@@ -30,7 +31,29 @@ const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey))
30
31
 
31
32
  const [bgWidget] = useDefineWidgets([eodash.template?.background])
32
33
 
33
- const widgetsConfig = eodash.template?.widgets
34
-
35
- const importedWidgets = useDefineWidgets(widgetsConfig)
34
+ const importedWidgets = useDefineWidgets(eodash.template?.widgets)
36
35
  </script>
36
+ <style scoped>
37
+ .panel {
38
+ position: relative;
39
+ overflow: visible;
40
+ z-index: 1;
41
+ border-radius: 0px;
42
+ background: rgb(var(--v-theme-surface))
43
+ }
44
+
45
+ .bg-panel {
46
+ z-index: 0;
47
+
48
+ }
49
+
50
+ .fade-enter-active,
51
+ .fade-leave-active {
52
+ transition: opacity 0.25s ease;
53
+ }
54
+
55
+ .fade-enter-from,
56
+ .fade-leave-to {
57
+ opacity: 0;
58
+ }
59
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-alert v-if="error" translate="yes" location="start bottom" type="error" position="fixed" @click:close="error = ''"
3
- variant="elevated" :icon="[mdiAlertCircle]" style="z-index: 10000;" closable :close-icon="[mdiClose]">
3
+ variant="elevated" :icon="[mdiAlertCircle]" class="alert" closable :close-icon="[mdiClose]">
4
4
  {{ errorMessage }}
5
5
  <details is="animated-details">
6
6
  <summary> Error </summary>
@@ -17,3 +17,8 @@ const error = defineModel({ type: String, required: true })
17
17
  const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey))
18
18
  const errorMessage = eodash.brand.errorMessage ?? 'something went wrong, please try again later'
19
19
  </script>
20
+ <style scoped>
21
+ .alert {
22
+ z-index: 10000;
23
+ }
24
+ </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-footer ref="footer" :height="mdAndDown ? '48px' : 'auto'" color="secondary" app
3
3
  class="d-flex justify-space-between">
4
- <p class="pt-0" style="font-size: 0.8rem;">
4
+ <p class="pt-0 footer-text">
5
5
  {{ eodash.brand.footerText ?? "" }}
6
6
  </p>
7
7
  <div>
@@ -29,3 +29,8 @@ const { mdAndDown } = useDisplay()
29
29
  const eoxLogo = `<svg width="100%" height="100%" viewBox="0 0 355 85" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="ink_ext_XXXXXX"><path id="path5076" d="M152.986,40.52l-0.75,-0.019l-0.737,-0.056l-0.725,-0.093l-0.713,-0.127l-0.7,-0.162l-0.7,-0.196l-0.675,-0.228l-0.65,-0.261l-0.65,-0.292l-0.625,-0.319l-0.612,-0.352l-0.588,-0.377l-0.562,-0.407l-0.55,-0.431l-0.538,-0.457l-0.5,-0.481l-0.487,-0.505l-0.45,-0.528l-0.438,-0.55l-0.4,-0.57l-0.375,-0.59l-0.35,-0.609l-0.325,-0.627l-0.287,-0.645l-0.263,-0.66l-0.225,-0.676l-0.2,-0.69l-0.162,-0.704l-0.125,-0.717l-0.1,-0.728l-0.05,-0.739l-0.025,-0.748c0,-8.023 6.512,-14.532 14.537,-14.532c8.038,0 14.538,6.509 14.538,14.532c0,8.036 -6.5,14.544 -14.538,14.544Z" style="fill:none;"/><path id="path5078" d="M165.748,-0.002c-42.009,0 -76.06,18.985 -76.06,42.402c0,13.268 10.921,25.102 28.021,32.875c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.186 16.83,-40.82 45.148,-49.615c-14.687,6.665 -24.923,21.427 -24.923,38.599c0,23.218 18.648,42.046 41.773,42.383c-0.037,0.005 -0.087,0.015 -0.137,0.02c0.263,0 0.512,0.009 0.762,0.009c42.013,0 76.076,-18.984 76.076,-42.412c0,-13.261 -10.937,-25.097 -28.037,-32.871l0.75,0.522l0.736,0.531l0.713,0.543l0.7,0.555l0.687,0.566l0.664,0.578l0.649,0.588l0.625,0.6l0.613,0.609l0.588,0.621l0.574,0.631l0.562,0.643l0.538,0.652l0.513,0.662l0.5,0.672l0.475,0.684l0.449,0.693l0.438,0.703l0.425,0.713l0.387,0.723l0.375,0.73l0.352,0.74l0.336,0.75l0.3,0.76l0.287,0.77l0.264,0.777l0.25,0.787l0.211,0.795l0.188,0.805l0.175,0.812l0.151,0.82l0.125,0.831c2.675,20.19 -16.838,40.825 -45.151,49.619c14.688,-6.665 24.926,-21.426 24.926,-38.614c0,-23.202 -18.65,-42.026 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.526,-0.01 -0.789,-0.01Zm-13.248,11.314c7.817,0 14.25,6.433 14.25,14.25c0,0.001 0,0.001 0,0.001c0,7.817 -6.433,14.249 -14.25,14.249c-7.817,0 -14.25,-6.432 -14.25,-14.249c0,-0.001 0,-0.001 0,-0.001c0,-7.817 6.433,-14.25 14.25,-14.25Z" style="fill:#fff;fill-rule:nonzero;"/><path id="path5080" d="M213.786,9.529l0.75,0.521l0.738,0.532l0.712,0.544l0.7,0.555l0.688,0.566l0.662,0.577l0.65,0.588l0.625,0.6l0.613,0.61l0.587,0.62l0.575,0.631l0.563,0.643l0.537,0.652l0.513,0.663l0.5,0.672l0.475,0.684l0.45,0.692l0.437,0.703l0.425,0.712l0.388,0.723l0.375,0.731l0.35,0.741l0.337,0.75l0.3,0.76l0.288,0.769l0.262,0.777l0.25,0.786l0.213,0.797l0.187,0.804l0.175,0.812l0.15,0.821l0.125,0.83c2.675,20.19 -16.837,40.825 -45.15,49.619c14.688,-6.665 24.925,-21.426 24.925,-38.614c0,-23.202 -18.65,-42.025 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.525,-0.01 -0.787,-0.01c-42.01,0 -76.062,18.985 -76.062,42.402c0,13.268 10.922,25.103 28.022,32.876c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.187 16.831,-40.82 45.149,-49.615c-14.688,6.665 -24.925,21.426 -24.925,38.598c0,23.218 18.65,42.046 41.775,42.383c-0.038,0.005 -0.088,0.015 -0.138,0.02c0.263,0 0.513,0.01 0.763,0.01c42.012,-0.001 76.075,-18.985 76.075,-42.413c0,-13.261 -10.938,-25.097 -28.038,-32.871Z" style="fill:none;"/><path id="path5082" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0" style="fill:#fff;fill-rule:nonzero;"/><path id="path5084" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0Z" style="fill:none;"/><path id="path5086" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453" style="fill:#fff;fill-rule:nonzero;"/><path id="path5088" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453Z" style="fill:none;"/></g></svg>`
30
30
  const base64Logo = window.btoa(eoxLogo)
31
31
  </script>
32
+ <style scoped>
33
+ .footer-text {
34
+ font-size: 0.8rem;
35
+ }
36
+ </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-app-bar color="primary">
3
3
  <v-app-bar-title>{{ title }}</v-app-bar-title>
4
- <v-img class="mx-12" style="max-width: 140px;" :src="eodash.brand?.logo" />
4
+ <v-img class="mx-12 logo" :src="eodash.brand?.logo" />
5
5
  </v-app-bar>
6
6
  </template>
7
7
  <script setup>
@@ -12,3 +12,8 @@ const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey))
12
12
 
13
13
  const title = eodash.brand?.name
14
14
  </script>
15
+ <style scoped>
16
+ .logo {
17
+ max-width: 140px;
18
+ }
19
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <iframe :src="src" style="width: 100%; height: 100%"></iframe>
2
+ <iframe :src="src" class="fill-height fill-width"></iframe>
3
3
  </template>
4
4
  <script setup>
5
5
  defineProps({
@@ -1,17 +1,14 @@
1
1
  <template>
2
- <v-main class="overflow-hidden" style="height: 91dvh;">
2
+ <v-main class="overflow-hidden main">
3
3
  <Suspense suspensible>
4
4
  <component id="bg-widget" v-if="bgWidget.component" :is="bgWidget.component" v-bind="bgWidget.props"></component>
5
5
  </Suspense>
6
6
 
7
7
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
8
- <div v-if="importedWidget.value.component" v-show="activeIdx === idx" id="overlay" class="pa-2" :style="{
9
- bottom: tabsHeightFromBtm, position: 'absolute', overflow: 'hidden',
10
- width: '100%', left: 0, top: mainRect.top + 'px', zIndex: 1, background: 'rgb(var(--v-theme-surface))'
11
- }">
12
- <v-btn icon variant="text" style="height: 5%;position: relative;" @click="activeIdx = -1">&#x2715;</v-btn>
8
+ <div v-if="importedWidget.value.component" v-show="activeIdx === idx" id="overlay" class="pa-2 panel">
9
+ <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1">&#x2715;</v-btn>
13
10
  <Suspense suspensible>
14
- <div style="height: 90% !important;" v-show="activeIdx === idx">
11
+ <div class="component-container" v-show="activeIdx === idx">
15
12
  <component :key="importedWidget.value.id" :is="importedWidget.value.component"
16
13
  v-bind="importedWidget.value.props" />
17
14
  </div>
@@ -19,9 +16,7 @@
19
16
  </div>
20
17
  </template>
21
18
 
22
- <v-tabs ref="tabs" align-tabs="center" bg-color="surface"
23
- :style="{ position: 'relative', bottom: (mainRect.bottom || 48) + 'px', zIndex: 10 }" show-arrows
24
- v-model="activeIdx">
19
+ <v-tabs ref="tabs" align-tabs="center" bg-color="surface" class="tabs" show-arrows v-model="activeIdx">
25
20
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
26
21
  <v-tab v-if="importedWidget.value.component" :value="idx">
27
22
  {{ importedWidget.value.title }}
@@ -51,7 +46,43 @@ const activeIdx = ref(-1)
51
46
  /** @type {import("vue").Ref<import("vuetify/components").VTabs|null>} */
52
47
  const tabs = ref(null)
53
48
  const tabsHeightFromBtm = ref('')
49
+ const mainRectTopPx = ref('')
50
+ const mainRectBtmPx = ref('')
51
+
54
52
  onMounted(() => {
53
+ mainRectTopPx.value = mainRect.value.top + 'px';
54
+ mainRectBtmPx.value = (mainRect.value.bottom || 48) + 'px';
55
55
  tabsHeightFromBtm.value = mainRect.value.bottom + (/** @type {HTMLElement} */(tabs.value?.$el)?.clientHeight ?? 0) + "px"
56
56
  })
57
57
  </script>
58
+ <style scoped>
59
+ .main {
60
+ height: 91dvh;
61
+ }
62
+
63
+ .panel {
64
+ top: v-bind("mainRectTopPx");
65
+ bottom: v-bind("tabsHeightFromBtm");
66
+ position: absolute;
67
+ overflow: hidden;
68
+ width: 100%;
69
+ left: 0;
70
+ z-index: 1;
71
+ background: rgb(var(--v-theme-surface));
72
+ }
73
+
74
+ .component-container {
75
+ height: 90%;
76
+ }
77
+
78
+ .close-btn {
79
+ height: 5%;
80
+ position: relative;
81
+ }
82
+
83
+ .tabs {
84
+ bottom: v-bind("mainRectBtmPx");
85
+ position: relative;
86
+ z-index: 10;
87
+ }
88
+ </style>
@@ -31,8 +31,9 @@ export const useEodashRuntime = async (runtimeConfig) => {
31
31
  }
32
32
 
33
33
  try {
34
+ const configJs = '/config.js'
34
35
  assignInstance(
35
- (await import( /* @vite-ignore */new URL('/config.js', import.meta.url).href)).default
36
+ (await import( /* @vite-ignore */new URL(configJs, import.meta.url).href)).default
36
37
  )
37
38
  } catch {
38
39
  try {
@@ -1,14 +1,14 @@
1
1
  import { defineAsyncComponent, reactive, shallowRef, watch } from 'vue'
2
2
  import { useSTAcStore } from '@/store/stac'
3
3
  import { storeToRefs } from 'pinia'
4
- import Loading from '@/components/Loading.vue';
5
4
 
6
5
  /**
7
6
  * @typedef {{
8
- * component:import('vue').Component | null;
7
+ * component: import('vue').Component | null;
9
8
  * props: Record<string, unknown>;
10
- * title :string;
11
- * id:string|number|symbol;
9
+ * title: string;
10
+ * id: string | number | symbol;
11
+ * layout: { x: number; y: number; h: number; w: number }
12
12
  * }} DefinedWidget
13
13
  */
14
14
 
@@ -55,6 +55,7 @@ export const useDefineWidgets = (widgetConfigs) => {
55
55
  props: {},
56
56
  title: '',
57
57
  id: Symbol(),
58
+ layout: { x: 0, y: 0, h: 0, w: 0 }
58
59
  })
59
60
 
60
61
  if ('defineWidget' in (config ?? {})) {
@@ -78,7 +79,7 @@ export const useDefineWidgets = (widgetConfigs) => {
78
79
 
79
80
  /**
80
81
  * Converts a static widget configuration to a defined imported widget
81
- * @param {import("@/types").StaticWidget| Omit<import("@/types").StaticWidget, "layout">| undefined | null} config
82
+ * @param {import("@/types").StaticWidget| Omit<import("@/types").StaticWidget, "layout">| undefined | null} [config]
82
83
  * @returns {DefinedWidget}
83
84
  **/
84
85
  const getWidgetDefinition = (config) => {
@@ -90,13 +91,13 @@ const getWidgetDefinition = (config) => {
90
91
  props: {},
91
92
  title: '',
92
93
  id: Symbol(),
94
+ layout: reactive({ x: 0, y: 0, h: 0, w: 0 })
93
95
  }
94
96
  switch (config?.type) {
95
97
  case 'internal':
96
98
  importedWidget.component = defineAsyncComponent({
97
99
  loader: internalWidgets[/** @type {import("@/types").InternalComponentWidget} **/(config)?.widget.name],
98
100
  suspensible: true,
99
- loadingComponent: Loading
100
101
  })
101
102
  importedWidget.props = reactive(/** @type {import("@/types").InternalComponentWidget} **/(config)?.widget.properties ?? {})
102
103
 
@@ -106,7 +107,6 @@ const getWidgetDefinition = (config) => {
106
107
  importedWidget.component = defineAsyncComponent({
107
108
  loader: () => import('@/components/DynamicWebComponent.vue'),
108
109
  suspensible: true,
109
- loadingComponent: Loading
110
110
  })
111
111
  importedWidget.props = reactive(config.widget)
112
112
 
@@ -115,7 +115,6 @@ const getWidgetDefinition = (config) => {
115
115
  importedWidget.component = defineAsyncComponent({
116
116
  loader: () => import('@/components/IframeWrapper.vue'),
117
117
  suspensible: true,
118
- loadingComponent: Loading
119
118
  })
120
119
  importedWidget.props = reactive(config.widget)
121
120
  break;
@@ -130,6 +129,13 @@ const getWidgetDefinition = (config) => {
130
129
  }
131
130
  importedWidget.title = config?.title ?? ''
132
131
  importedWidget.id = config?.id ?? importedWidget.id
132
+
133
+ if ("layout" in config) {
134
+ importedWidget.layout.x = config.layout.x
135
+ importedWidget.layout.y = config.layout.y
136
+ importedWidget.layout.h = config.layout.h
137
+ importedWidget.layout.w = config.layout.w
138
+ }
133
139
  return importedWidget
134
140
  }
135
141
 
@@ -1,12 +1,11 @@
1
1
  // functions of this folder can only be consumed inside setup stores,
2
2
  // setup functions or vue composition api components
3
3
 
4
- import { reactive } from "vue";
5
4
  import { currentUrl, indicator, mapPosition } from "@/store/States";
6
5
  import eodash from "@/eodash";
7
6
  import { useTheme } from "vuetify/lib/framework.mjs";
8
7
  import { onMounted, watch } from "vue";
9
- import { mdiChevronDoubleDown, mdiChevronDoubleLeft, mdiChevronDoubleRight, mdiChevronDoubleUp } from "@mdi/js"
8
+ import { useSTAcStore } from "@/store/stac";
10
9
 
11
10
  /**
12
11
  * Creates an absolute URL from a relative link and assignes it to `currentUrl`
@@ -35,116 +34,6 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
35
34
  return currentUrl;
36
35
  };
37
36
 
38
- /**
39
- * Adds slide in and out functionality to Elements
40
- * @param {import('vue').Ref<HTMLElement[]|null>} elements - elements to add the functionality to
41
- * @param {import("@/types").Widget[]} configs
42
- */
43
- export const useSlidePanels = (elements, configs) => {
44
- /**
45
- * Sliding direction
46
- */
47
- const slideDirs = configs.map((m) =>
48
- m.layout.x == 0
49
- ? "left"
50
- : m.layout.x == 12 - m.layout.w
51
- ? "right"
52
- : m.layout.y < 6
53
- ? "up"
54
- : "down"
55
- );
56
-
57
- /**
58
- * Array of sliding button's style and icons
59
- */
60
- const slideBtns = slideDirs.map((dir, _idx) => {
61
- const btn = reactive({
62
- style: {},
63
- icon: { in: "", out: "" },
64
- active: false,
65
- enabled: true,
66
- });
67
-
68
- // temp removal of `slidable` from the widgets API
69
- // if (configs[idx].slidable === false) {
70
- // btn.enabled = false;
71
- // return btn;
72
- // }
73
-
74
- switch (dir) {
75
- case "left":
76
- btn.style = { top: "50%", right: "-11%" };
77
- btn.icon.in = mdiChevronDoubleRight
78
- btn.icon.out = mdiChevronDoubleLeft
79
-
80
- break;
81
- case "right":
82
- btn.style = { top: "50%", left: "-11%" };
83
- btn.icon.in = mdiChevronDoubleLeft
84
- btn.icon.out = mdiChevronDoubleRight
85
-
86
- break;
87
- case "up":
88
- btn.style = { right: "50%", bottom: "-17%" };
89
- btn.icon.in = mdiChevronDoubleDown
90
- btn.icon.out = mdiChevronDoubleUp
91
-
92
- break;
93
- case "down":
94
- btn.style = { right: "50%", top: "-17%" };
95
- btn.icon.in = mdiChevronDoubleUp
96
- btn.icon.out = mdiChevronDoubleDown
97
- break;
98
-
99
- default:
100
- console.error("sliding error");
101
- break;
102
- }
103
- return btn;
104
- });
105
-
106
- /**
107
- * Transforms the element's position based on the direction
108
- * @param {number} idx - index of the pressed element
109
- */
110
- const slideInOut = (idx) => {
111
- const parentStyle = /** @type {CSSStyleDeclaration} */ (
112
- elements.value?.[idx].style
113
- );
114
- if (parentStyle?.transform.length) {
115
- slideBtns[idx].active = false;
116
- parentStyle.transform = "";
117
- } else {
118
- slideBtns[idx].active = true;
119
- parentStyle.transition = "transform 0.3s ease-in-out";
120
- switch (slideDirs[idx]) {
121
- case "left":
122
- parentStyle.transform = "translateX(-100%)";
123
- break;
124
- case "right":
125
- parentStyle.transform = "translateX(100%)";
126
- break;
127
- case "up":
128
- parentStyle.transform = `translateY(-${(configs[idx].layout.y / configs[idx].layout.h) * 100 + 100
129
- }%)`;
130
- break;
131
- case "down":
132
- parentStyle.transform = `translateY(${(Math.max(0, 12 - configs[idx].layout.y - configs[idx].layout.h) /
133
- configs[idx].layout.h) *
134
- 100 +
135
- 100
136
- }%)`;
137
- break;
138
-
139
- default:
140
- console.error("sliding error");
141
- break;
142
- }
143
- }
144
- };
145
- return { slideBtns, slideInOut };
146
- };
147
-
148
37
  /**
149
38
  * Updates an existing Vuetify theme.
150
39
  * updates only the values provided in the `ThemeDefinition`
@@ -178,25 +67,35 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
178
67
  */
179
68
 
180
69
  export const useURLSearchParametersSync = () => {
181
- onMounted(() => {
70
+ onMounted(async () => {
182
71
  // Analyze currently set url params when first loaded and set them in the store
183
72
  if ('URLSearchParams' in window) {
184
73
  const searchParams = new URLSearchParams(window.location.search);
185
- let x, y, z;
186
- searchParams.forEach((value, key) => {
74
+ /** @type {number} */
75
+ let x,
76
+ /** @type {number} */
77
+ y,
78
+ /** @type {number} */
79
+ z;
80
+ searchParams.forEach(async (value, key) => {
187
81
  if (key === "indicator") {
188
- indicator.value = value;
82
+ const { loadSelectedSTAC, stac } = useSTAcStore()
83
+ const match = stac?.find(link => link.id == value)
84
+ if (match) {
85
+ await loadSelectedSTAC(match.href)
86
+ }
189
87
  }
190
88
  if (key === "x") {
191
- x = value;
89
+ x = Number(value);
192
90
  }
193
91
  if (key === "y") {
194
- y = value;
92
+ y = Number(value);
195
93
  }
196
94
  if (key === "z") {
197
- z = value;
95
+ z = Number(value);
198
96
  }
199
97
  })
98
+ //@ts-expect-error
200
99
  if (x !== undefined && y !== undefined && z !== undefined) {
201
100
  mapPosition.value = [x, y, z];
202
101
  }
@@ -12,9 +12,6 @@ export const eodash = reactive({
12
12
  brand: {
13
13
  noLayout: true,
14
14
  name: "Demo",
15
- font: {
16
- family: "Roboto",
17
- },
18
15
  theme: {
19
16
  colors: {
20
17
  primary: "#fff",
@@ -51,46 +48,51 @@ export const eodash = reactive({
51
48
  {
52
49
  id: Symbol(),
53
50
  type: "internal",
54
- title: "itemfilter",
55
- layout: { x: 0, y: 0, w: 3, h: 12 },
51
+ title: "Indicators",
52
+ layout: { x: 0, y: 0, w: 2, h: 12 },
56
53
  widget: {
57
54
  name: "EodashItemFilter",
58
55
  },
59
56
  },
60
57
  {
61
- id: Symbol(),
62
- type: "internal",
63
- title: "datepicker",
64
- layout: { x: 5, y: 11, w: 2, h: 1 },
65
- widget: {
66
- name: "EodashDatePicker",
67
- properties: {
68
- inline: true,
69
- },
70
- },
71
- },
72
- {
73
- id: Symbol(),
74
- title: "Information",
75
- layout: { x: 9, y: 0, w: 3, h: 12 },
76
- widget: {
77
- link: async () => await import("@eox/stacinfo"),
78
- properties: {
79
- for: currentUrl,
80
- allowHtml: "true",
81
- styleOverride:
82
- "#properties li > .value {font-weight: normal !important;}",
83
- header: "[]",
58
+ defineWidget: (selectedSTAC) => {
59
+ return selectedSTAC ? {
60
+ id: "Information",
61
+ title: "Information",
62
+ layout: { x: 9, y: 0, w: 3, h: 12 },
63
+ type: "web-component",
64
+ widget: {
65
+ link: async () => await import("@eox/stacinfo"),
66
+ properties: {
67
+ for: currentUrl,
68
+ allowHtml: "true",
69
+ styleOverride:
70
+ "#properties li > .value {font-weight: normal !important;}",
71
+ header: "[]",
84
72
 
85
- subheader: "[]",
86
- properties: '["description"]',
87
- featured: "[]",
88
- footer: "[]",
89
- },
90
- tagName: "eox-stacinfo",
91
- },
92
- type: "web-component",
73
+ subheader: "[]",
74
+ properties: '["description"]',
75
+ featured: "[]",
76
+ footer: "[]",
77
+ },
78
+ tagName: "eox-stacinfo",
79
+ }
80
+ } : null
81
+ }
93
82
  },
83
+ {
84
+ defineWidget: (selectedSTAC) => {
85
+ return selectedSTAC ? {
86
+ id: "Datepicker",
87
+ type: "internal",
88
+ layout: { x: 5, y: 10, w: 1, h: 1 },
89
+ title: "Datepicker",
90
+ widget: {
91
+ name: "EodashDatePicker",
92
+ },
93
+ } : null
94
+ }
95
+ }
94
96
  ],
95
97
  },
96
98
  });
@@ -1,6 +1,7 @@
1
1
  import vuetify from './vuetify';
2
2
  import { createPinia } from 'pinia';
3
3
  import eodash from '@/eodash';
4
+ import VCalendar from 'v-calendar';
4
5
  import { eodashKey } from '@/utils/keys';
5
6
  import store from '../store';
6
7
 
@@ -14,5 +15,7 @@ export function registerPlugins(app) {
14
15
 
15
16
  app.use(vuetify)
16
17
  .use(pinia)
18
+ // Use plugin with optional defaults
19
+ .use(VCalendar, {})
17
20
  .provide(eodashKey, eodash);
18
21
  }