@eodash/eodash 5.0.0-alpha.2.1 → 5.0.0-alpha.2.11
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.
- package/README.md +36 -3
- package/core/client/App.vue +26 -0
- package/core/client/SuspensedDashboard.ce.vue +105 -0
- package/core/client/asWebComponent.d.ts +23 -0
- package/core/client/asWebComponent.js +12 -0
- package/core/client/components/DashboardLayout.vue +77 -0
- package/core/client/components/DynamicWebComponent.vue +68 -0
- package/core/client/components/ErrorAlert.vue +36 -0
- package/core/{components → client/components}/Footer.vue +34 -15
- package/core/client/components/Header.vue +19 -0
- package/core/client/components/IframeWrapper.vue +11 -0
- package/core/client/components/Loading.vue +37 -0
- package/core/client/components/MobileLayout.vue +109 -0
- package/core/client/composables/DefineEodash.js +67 -0
- package/core/client/composables/DefineWidgets.js +161 -0
- package/core/client/composables/index.js +155 -0
- package/core/client/eodash.js +129 -0
- package/core/client/main.js +2 -0
- package/core/client/plugins/index.js +20 -0
- package/core/client/plugins/vuetify.js +35 -0
- package/core/client/render.js +12 -0
- package/core/client/store/Actions.js +38 -0
- package/core/client/store/States.js +24 -0
- package/core/client/store/index.js +20 -0
- package/core/client/store/stac.js +81 -0
- package/core/client/types.d.ts +287 -0
- package/core/client/utils/createLayers.js +131 -0
- package/core/client/utils/eodashSTAC.js +259 -0
- package/core/client/utils/helpers.js +152 -0
- package/core/client/utils/index.js +51 -0
- package/core/{utils → client/utils}/keys.js +2 -2
- package/core/client/views/Dashboard.vue +116 -0
- package/core/client/vite-env.d.ts +39 -0
- package/dist/client/DashboardLayout-D5c2wAGC.js +156 -0
- package/dist/{DynamicWebComponent-BrHVTesn.js → client/DynamicWebComponent-CBuMCUIj.js} +11 -11
- package/dist/client/EodashDatePicker-D0qdMMTE.js +252 -0
- package/dist/client/EodashItemFilter-CTRnGRRS.js +10067 -0
- package/dist/client/EodashLayerControl-Bpm0BwcW.js +31499 -0
- package/dist/client/EodashMap-DaMtQefq.js +114367 -0
- package/dist/client/EodashMapBtns-B5z8h8mr.js +50 -0
- package/dist/client/ExportState-Bp3n6gba.js +558 -0
- package/dist/client/Footer-BROOTKhV.js +115 -0
- package/dist/client/Header-C_fKVTsg.js +350 -0
- package/dist/{IframeWrapper-Dd9zrX9s.js → client/IframeWrapper-32Q3DBYr.js} +4 -4
- package/dist/client/MobileLayout-TVGrYpNT.js +945 -0
- package/dist/client/PopUp-BJzmeeKG.js +300 -0
- package/dist/client/VImg-BT4Vb0UT.js +291 -0
- package/dist/client/VMain-BDVUXNEk.js +39 -0
- package/dist/client/VOverlay-Ck_4Lxcb.js +972 -0
- package/dist/{WidgetsContainer-DxfCu0I3.js → client/WidgetsContainer-DjjX_n1U.js} +25 -18
- package/dist/client/asWebComponent-wn9bbgx9.js +20404 -0
- package/dist/{basedecoder-Qm25PwVp-CHo5Pomv.js → client/basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
- package/dist/{decoder-kAoyGIq9-BBR5CgzS.js → client/decoder-Cth6J7EK-CLlwAswr.js} +1 -1
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
- package/dist/client/eo-dash.js +6 -0
- package/dist/client/eox-stacinfo-l7ALSV90.js +13969 -0
- package/dist/client/forwardRefs--PLRH8zp.js +185 -0
- package/dist/client/helpers-CoqJPYdE.js +1391 -0
- package/dist/{index-DTkOfh2g.js → client/index-Dt0NRXIq.js} +21 -20
- package/dist/{jpeg-DNfUpLwy-Fjan-04T.js → client/jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
- package/dist/{lerc-C9VL9kri-cIdbW0sg.js → client/lerc-BgbQqdFI-CCpDWUne.js} +37 -39
- package/dist/{lzw-BOMhmEDy-Dboc93VO.js → client/lzw-LAGDNbSC-DkP96qO9.js} +1 -1
- package/dist/{packbits-DaUD6MLm-Bu1PoTGa.js → client/packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
- package/dist/{pako.esm-C3kYPGGQ-BMki8cQY.js → client/pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
- package/dist/{raw-CcGKjn8q-DFOt-i8n.js → client/raw-CMGvRjfu-BRi6E4i1.js} +1 -1
- package/dist/{ssrBoot-D-b4-M19.js → client/ssrBoot-DjZDIkG_.js} +1 -1
- package/dist/client/style.css +5 -0
- package/dist/client/transition-C8OQt_kp.js +34 -0
- package/dist/{webfontloader-CyOFAuFB.js → client/webfontloader-qotgY98I.js} +56 -92
- package/dist/{webimage-D2c098k3-DLj1LQxB.js → client/webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
- package/dist/node/cli.js +20 -0
- package/dist/node/main.js +2 -0
- package/dist/node/types.d.ts +47 -0
- package/package.json +57 -51
- package/widgets/EodashDatePicker.vue +146 -40
- package/widgets/EodashItemFilter.vue +81 -41
- package/widgets/EodashLayerControl.vue +16 -0
- package/widgets/EodashMap.vue +186 -42
- package/widgets/EodashMapBtns.vue +50 -0
- package/widgets/ExportState.vue +112 -0
- package/widgets/PopUp.vue +40 -0
- package/widgets/WidgetsContainer.vue +47 -27
- package/bin/app.js +0 -22
- package/bin/cli.js +0 -62
- package/bin/main.js +0 -9
- package/bin/serverConfig.js +0 -165
- package/bin/types.d.ts +0 -52
- package/bin/utils.js +0 -103
- package/core/App.vue +0 -19
- package/core/SuspensedDashboard.ce.vue +0 -65
- package/core/asWebComponent.d.ts +0 -18
- package/core/asWebComponent.js +0 -12
- package/core/components/DashboardLayout.vue +0 -44
- package/core/components/DynamicWebComponent.vue +0 -68
- package/core/components/Header.vue +0 -14
- package/core/components/IframeWrapper.vue +0 -11
- package/core/components/Loading.vue +0 -27
- package/core/components/MobileLayout.vue +0 -49
- package/core/composables/DefineEodash.js +0 -57
- package/core/composables/DefineWidgets.js +0 -129
- package/core/composables/index.js +0 -219
- package/core/eodash.js +0 -100
- package/core/main.js +0 -2
- package/core/plugins/index.js +0 -18
- package/core/plugins/vuetify.js +0 -30
- package/core/render.js +0 -13
- package/core/store/Actions.js +0 -0
- package/core/store/States.js +0 -21
- package/core/store/index.js +0 -17
- package/core/store/stac.js +0 -63
- package/core/types.d.ts +0 -356
- package/core/utils/eodashSTAC.js +0 -164
- package/core/utils/helpers.js +0 -40
- package/core/utils/index.js +0 -28
- package/core/views/Dashboard.vue +0 -59
- package/core/vite-env.d.ts +0 -31
- package/dist/DashboardLayout-Dp8AnYD9.js +0 -141
- package/dist/EodashDatePicker-D_udZ26j.js +0 -1645
- package/dist/EodashItemFilter-BLAGx2UD.js +0 -51
- package/dist/EodashMap-Bxl_aqY2.js +0 -53405
- package/dist/Footer-AohCH8U7.js +0 -118
- package/dist/Header-DC50S6GR.js +0 -609
- package/dist/MobileLayout-CgToA7Gp.js +0 -523
- package/dist/VBtn-Bz7ruRUg.js +0 -1106
- package/dist/VMain-BHfWJU2j.js +0 -35
- package/dist/asWebComponent-C8rb3b1D.js +0 -11323
- package/dist/color-DpYEub1f.js +0 -115
- package/dist/deflate-Be2Arps5-hDqMz3RA.js +0 -10
- package/dist/dimensions-CJaGeSrj.js +0 -53
- package/dist/eo-dash.js +0 -6
- package/dist/eox-itemfilter-DcQkRD2l.js +0 -7537
- package/dist/eox-map-BJ9SIixs.js +0 -36205
- package/dist/eox-stacinfo-B-YrT7Ug.js +0 -13698
- package/dist/forwardRefs-Bxeu9Obx.js +0 -142
- package/dist/index-Sa2Vg_gx.js +0 -65
- package/dist/style.css +0 -5
- /package/dist/{.gitkeep → client/.gitkeep} +0 -0
- /package/dist/{_commonjsHelpers-DaMA6jEr.js → client/_commonjsHelpers-DaMA6jEr.js} +0 -0
package/README.md
CHANGED
|
@@ -1,26 +1,59 @@
|
|
|
1
|
+
# @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
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Checkout the [documentation](https://eodash.github.io/eodash/get-started.html) for a detailed guide.
|
|
8
|
+
|
|
1
9
|
## Get Started
|
|
10
|
+
|
|
2
11
|
Install all the required dependecies after cloning or downloading the repository using Node v18 or higher:
|
|
12
|
+
|
|
3
13
|
```bash
|
|
4
14
|
npm run install
|
|
5
15
|
```
|
|
6
|
-
|
|
16
|
+
|
|
17
|
+
Run the dev server:
|
|
18
|
+
|
|
7
19
|
```bash
|
|
8
20
|
npm run dev
|
|
9
21
|
```
|
|
10
|
-
|
|
22
|
+
|
|
23
|
+
To compile and minify a demo instance:
|
|
24
|
+
|
|
11
25
|
```bash
|
|
12
26
|
npm run build
|
|
13
27
|
```
|
|
28
|
+
|
|
14
29
|
To preview the compiled production files :
|
|
30
|
+
|
|
15
31
|
```bash
|
|
16
32
|
npm run preview
|
|
17
33
|
```
|
|
18
34
|
|
|
35
|
+
To compile and minify a demo instance as a web component library:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run build -- --lib
|
|
39
|
+
```
|
|
40
|
+
|
|
19
41
|
## Folder Structure
|
|
42
|
+
|
|
20
43
|
.
|
|
21
|
-
├── core #
|
|
44
|
+
├── core # CLI & Client source code
|
|
22
45
|
├── docs # Documentation files
|
|
46
|
+
├── tests # CLI & Client component tests folder
|
|
23
47
|
├── widgets # Vue componenets as internal widgets.
|
|
24
48
|
├── public # Statically served directory
|
|
25
49
|
└── README.md
|
|
26
50
|
|
|
51
|
+
## Writing commits
|
|
52
|
+
|
|
53
|
+
To ensure clear communication with the package consumers and enable machine-readable commits, we adhere to [The Conventional Commits](https://www.conventionalcommits.org/) specification that allows the generation of [semVer](https://semver.org) releases and associated change logs using [googleapis/release-please](https://github.com/googleapis/release-please).
|
|
54
|
+
|
|
55
|
+
The most important prefixes you should have in mind are:
|
|
56
|
+
|
|
57
|
+
- fix: which represents bug fixes, and correlates to a SemVer patch.
|
|
58
|
+
- feat: which represents a new feature, and correlates to a SemVer minor.
|
|
59
|
+
- feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app>
|
|
3
|
+
<Suspense>
|
|
4
|
+
<Dashboard />
|
|
5
|
+
|
|
6
|
+
<template #fallback>
|
|
7
|
+
<ErrorAlert v-model="error" />
|
|
8
|
+
</template>
|
|
9
|
+
</Suspense>
|
|
10
|
+
</v-app>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import Dashboard from "@/views/Dashboard.vue";
|
|
15
|
+
import ErrorAlert from "./components/ErrorAlert.vue";
|
|
16
|
+
import { onErrorCaptured, ref } from "vue";
|
|
17
|
+
|
|
18
|
+
const error = ref("");
|
|
19
|
+
onErrorCaptured((e, inst, info) => {
|
|
20
|
+
error.value = `
|
|
21
|
+
${e}.
|
|
22
|
+
component: ${inst?.$.type.name}.
|
|
23
|
+
info: ${info}.
|
|
24
|
+
`;
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app ref="vAppRef">
|
|
3
|
+
<Suspense>
|
|
4
|
+
<Dashboard :on-template-mount="setStylesFromHead" :config="config" />
|
|
5
|
+
|
|
6
|
+
<template #fallback>
|
|
7
|
+
<ErrorAlert @vue:mounted="setStylesFromHead()" v-model="error" />
|
|
8
|
+
</template>
|
|
9
|
+
</Suspense>
|
|
10
|
+
</v-app>
|
|
11
|
+
</template>
|
|
12
|
+
<script setup>
|
|
13
|
+
import Dashboard from "@/views/Dashboard.vue";
|
|
14
|
+
import { createApp, getCurrentInstance, onErrorCaptured, ref } from "vue";
|
|
15
|
+
import { registerPlugins } from "@/plugins";
|
|
16
|
+
import { eodashKey } from "@/utils/keys";
|
|
17
|
+
import ErrorAlert from "@/components/ErrorAlert.vue";
|
|
18
|
+
|
|
19
|
+
defineProps({
|
|
20
|
+
config: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** @type {import("vue").Ref<import("vuetify/components").VApp | null>} */
|
|
26
|
+
const vAppRef = ref(null);
|
|
27
|
+
const app = createApp({});
|
|
28
|
+
registerPlugins(app);
|
|
29
|
+
|
|
30
|
+
const inst = getCurrentInstance();
|
|
31
|
+
|
|
32
|
+
Object.assign(inst?.appContext ?? {}, app._context);
|
|
33
|
+
|
|
34
|
+
//@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
|
|
35
|
+
Object.assign(inst?.provides ?? {}, app._context.provides);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {import("vue").Ref<
|
|
39
|
+
* HTMLElement | import("vue").ComponentPublicInstance
|
|
40
|
+
* >[]} [hiddenElements]
|
|
41
|
+
*/
|
|
42
|
+
function setStylesFromHead(hiddenElements) {
|
|
43
|
+
const eodashShadowRoot = vAppRef.value?.$el.getRootNode();
|
|
44
|
+
const styleSheet = new CSSStyleSheet();
|
|
45
|
+
const head = document.querySelector("head");
|
|
46
|
+
let stylesStr = "";
|
|
47
|
+
|
|
48
|
+
Array.from(head?.children ?? []).forEach((child) => {
|
|
49
|
+
if (child.getAttribute("type") === "text/css") {
|
|
50
|
+
stylesStr += `\n ${child.innerHTML}`;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (
|
|
55
|
+
child.tagName == "LINK" &&
|
|
56
|
+
child.getAttribute("rel")?.includes("stylesheet")
|
|
57
|
+
) {
|
|
58
|
+
eodashShadowRoot?.appendChild(child.cloneNode(true));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
stylesStr += `\n
|
|
63
|
+
${
|
|
64
|
+
//@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
|
|
65
|
+
/** @type {import("@/types").Eodash} */ (inst?.provides[eodashKey])
|
|
66
|
+
?.brand.noLayout
|
|
67
|
+
? `div.v-application__wrap {
|
|
68
|
+
min-height: fit-content;
|
|
69
|
+
}`
|
|
70
|
+
: ""
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
styleSheet.replaceSync(stylesStr.replaceAll(":root", ":host"));
|
|
74
|
+
eodashShadowRoot?.adoptedStyleSheets.push(styleSheet);
|
|
75
|
+
|
|
76
|
+
if (
|
|
77
|
+
hiddenElements &&
|
|
78
|
+
!(
|
|
79
|
+
//@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
|
|
80
|
+
/** @type {import("@/types").Eodash} */ (inst.provides[eodashKey])?.brand
|
|
81
|
+
.noLayout
|
|
82
|
+
)
|
|
83
|
+
) {
|
|
84
|
+
hiddenElements.forEach((element) => {
|
|
85
|
+
if (element.value) {
|
|
86
|
+
if (element.value instanceof HTMLElement) {
|
|
87
|
+
element.value.style.opacity = "1";
|
|
88
|
+
} else {
|
|
89
|
+
/** @type {HTMLElement} */
|
|
90
|
+
(element.value.$el).style.opacity = "1";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const error = ref("");
|
|
98
|
+
onErrorCaptured((e, comp, info) => {
|
|
99
|
+
error.value = `
|
|
100
|
+
${e}.
|
|
101
|
+
component: ${comp?.$.type.name}.
|
|
102
|
+
info: ${info}.
|
|
103
|
+
`;
|
|
104
|
+
});
|
|
105
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @group WebComponent */
|
|
2
|
+
type EodashConstructor = import("vue").VueElementConstructor<
|
|
3
|
+
import("vue").ExtractPropTypes<{ config: string }>
|
|
4
|
+
>;
|
|
5
|
+
/**
|
|
6
|
+
* Eodash Web Component constructor
|
|
7
|
+
*
|
|
8
|
+
* @group WebComponent
|
|
9
|
+
*/
|
|
10
|
+
export declare const Eodash: EodashConstructor;
|
|
11
|
+
/**
|
|
12
|
+
* Registers `eo-dash` as Custom Element in the window
|
|
13
|
+
*
|
|
14
|
+
* @group WebComponent
|
|
15
|
+
*/
|
|
16
|
+
export declare function register(): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Eodash store @see EodashStore
|
|
20
|
+
*
|
|
21
|
+
* @group WebComponent
|
|
22
|
+
*/
|
|
23
|
+
export declare const store: import("./types").EodashStore;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import SuspensedDashboard from "./SuspensedDashboard.ce.vue";
|
|
2
|
+
import { defineCustomElement } from "vue";
|
|
3
|
+
/** @type {import("./asWebComponent").EodashConstructor} */
|
|
4
|
+
export const Eodash = defineCustomElement(SuspensedDashboard);
|
|
5
|
+
|
|
6
|
+
export function register() {
|
|
7
|
+
customElements.define("eo-dash", Eodash);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { default as store } from "@/store";
|
|
11
|
+
|
|
12
|
+
register();
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-main>
|
|
3
|
+
<eox-layout :gap="eodash.template.gap ?? 2">
|
|
4
|
+
<eox-layout-item
|
|
5
|
+
v-if="bgWidget.component"
|
|
6
|
+
class="bg-panel"
|
|
7
|
+
x="0"
|
|
8
|
+
y="0"
|
|
9
|
+
h="12"
|
|
10
|
+
w="12"
|
|
11
|
+
>
|
|
12
|
+
<Suspense suspensible>
|
|
13
|
+
<component
|
|
14
|
+
id="bg-widget"
|
|
15
|
+
:is="bgWidget.component"
|
|
16
|
+
v-bind="bgWidget.props"
|
|
17
|
+
/>
|
|
18
|
+
</Suspense>
|
|
19
|
+
</eox-layout-item>
|
|
20
|
+
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
21
|
+
<Transition name="fade">
|
|
22
|
+
<eox-layout-item
|
|
23
|
+
v-if="importedWidget.value.component"
|
|
24
|
+
:key="importedWidget.value.id"
|
|
25
|
+
class="panel bg-surface"
|
|
26
|
+
:h="importedWidget.value.layout.h"
|
|
27
|
+
:w="importedWidget.value.layout.w"
|
|
28
|
+
:x="importedWidget.value.layout.x"
|
|
29
|
+
:y="importedWidget.value.layout.y"
|
|
30
|
+
>
|
|
31
|
+
<Suspense suspensible>
|
|
32
|
+
<component
|
|
33
|
+
:key="importedWidget.value.id"
|
|
34
|
+
:is="importedWidget.value.component"
|
|
35
|
+
v-bind="importedWidget.value.props"
|
|
36
|
+
/>
|
|
37
|
+
</Suspense>
|
|
38
|
+
</eox-layout-item>
|
|
39
|
+
</Transition>
|
|
40
|
+
</template>
|
|
41
|
+
</eox-layout>
|
|
42
|
+
</v-main>
|
|
43
|
+
</template>
|
|
44
|
+
<script setup>
|
|
45
|
+
import { eodashKey } from "@/utils/keys";
|
|
46
|
+
import { inject } from "vue";
|
|
47
|
+
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
48
|
+
import "@eox/layout";
|
|
49
|
+
|
|
50
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
51
|
+
|
|
52
|
+
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
53
|
+
|
|
54
|
+
const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
55
|
+
</script>
|
|
56
|
+
<style scoped>
|
|
57
|
+
.panel {
|
|
58
|
+
position: relative;
|
|
59
|
+
overflow: visible;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
border-radius: 0px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bg-panel {
|
|
65
|
+
z-index: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.fade-enter-active,
|
|
69
|
+
.fade-leave-active {
|
|
70
|
+
transition: opacity 0.25s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.fade-enter-from,
|
|
74
|
+
.fade-leave-to {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="d-flex flex-column fill-height overflow-auto">
|
|
3
|
+
<component :is="tagName" v-bind="properties" ref="elementRef" />
|
|
4
|
+
</span>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script async setup>
|
|
8
|
+
import { useSTAcStore } from "@/store/stac";
|
|
9
|
+
import { onUnmounted as whenUnMounted, onMounted as whenMounted } from "vue";
|
|
10
|
+
import { ref } from "vue";
|
|
11
|
+
|
|
12
|
+
const props = /** @type {import("@/types").WebComponentProps} */ (
|
|
13
|
+
defineProps({
|
|
14
|
+
link: {
|
|
15
|
+
type: [String, Function],
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
constructorProp: String,
|
|
19
|
+
tagName: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
properties: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => {
|
|
26
|
+
return {};
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
onMounted: Function,
|
|
30
|
+
onUnmounted: Function,
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const getWebComponent = async () =>
|
|
35
|
+
typeof props.link === "string"
|
|
36
|
+
? await import(/* @vite-ignore */ props.link)
|
|
37
|
+
: await props.link();
|
|
38
|
+
|
|
39
|
+
const imported = !customElements.get(props.tagName)
|
|
40
|
+
? await getWebComponent().catch((e) => {
|
|
41
|
+
console.error(e);
|
|
42
|
+
})
|
|
43
|
+
: null;
|
|
44
|
+
|
|
45
|
+
const defined = customElements.get(props.tagName);
|
|
46
|
+
|
|
47
|
+
// if the imported link doesn't define the custom tag provided
|
|
48
|
+
if (!defined && props.constructorProp) {
|
|
49
|
+
const Constructor = imported[props.constructorProp];
|
|
50
|
+
customElements.define(props.tagName, Constructor);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const store = useSTAcStore();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @typedef {HTMLElement & Record<string | number | symbol, unknown>} CustomElement
|
|
57
|
+
* @type {import("vue").Ref<CustomElement | null>}
|
|
58
|
+
*/
|
|
59
|
+
const elementRef = ref(null);
|
|
60
|
+
|
|
61
|
+
whenMounted(() => {
|
|
62
|
+
props.onMounted?.(elementRef.value, store);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
whenUnMounted(() => {
|
|
66
|
+
props.onUnmounted?.(elementRef.value, store);
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-alert
|
|
3
|
+
v-if="error"
|
|
4
|
+
translate="yes"
|
|
5
|
+
location="start bottom"
|
|
6
|
+
type="error"
|
|
7
|
+
position="fixed"
|
|
8
|
+
@click:close="error = ''"
|
|
9
|
+
variant="elevated"
|
|
10
|
+
:icon="[mdiAlertCircle]"
|
|
11
|
+
class="alert"
|
|
12
|
+
closable
|
|
13
|
+
:close-icon="[mdiClose]"
|
|
14
|
+
>
|
|
15
|
+
{{ errorMessage }}
|
|
16
|
+
<details is="animated-details">
|
|
17
|
+
<summary>Error</summary>
|
|
18
|
+
{{ error }}
|
|
19
|
+
</details>
|
|
20
|
+
</v-alert>
|
|
21
|
+
</template>
|
|
22
|
+
<script setup>
|
|
23
|
+
import { eodashKey } from "@/utils/keys";
|
|
24
|
+
import { mdiClose, mdiAlertCircle } from "@mdi/js";
|
|
25
|
+
import { inject } from "vue";
|
|
26
|
+
|
|
27
|
+
const error = defineModel({ type: String, required: true });
|
|
28
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
29
|
+
const errorMessage =
|
|
30
|
+
eodash.brand.errorMessage ?? "something went wrong, please try again later";
|
|
31
|
+
</script>
|
|
32
|
+
<style scoped>
|
|
33
|
+
.alert {
|
|
34
|
+
z-index: 10000;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -1,31 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-footer
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<v-footer
|
|
3
|
+
ref="footer"
|
|
4
|
+
:height="mdAndDown ? '48px' : 'auto'"
|
|
5
|
+
color="secondary"
|
|
6
|
+
app
|
|
7
|
+
class="d-flex justify-space-between"
|
|
8
|
+
>
|
|
9
|
+
<p class="pt-0 footer-text">
|
|
5
10
|
{{ eodash.brand.footerText ?? "" }}
|
|
6
11
|
</p>
|
|
7
12
|
<div>
|
|
8
|
-
<a
|
|
13
|
+
<a
|
|
14
|
+
href="https://github.com/eodash/eodash"
|
|
15
|
+
class="text-white"
|
|
16
|
+
target="_blank"
|
|
17
|
+
>eodash</a
|
|
18
|
+
>
|
|
19
|
+
by
|
|
9
20
|
<a href="https://eox.at" target="_blank" class="text-white">
|
|
10
|
-
<img :src=
|
|
21
|
+
<img :src="`data:image/svg+xml;base64,${base64Logo}`" height="11px" />
|
|
11
22
|
</a>
|
|
12
23
|
</div>
|
|
13
24
|
</v-footer>
|
|
14
25
|
</template>
|
|
15
26
|
<script setup>
|
|
16
|
-
import { eodashKey } from
|
|
17
|
-
import { ref } from
|
|
18
|
-
import { inject } from
|
|
19
|
-
import { useDisplay } from
|
|
27
|
+
import { eodashKey } from "@/utils/keys";
|
|
28
|
+
import { ref } from "vue";
|
|
29
|
+
import { inject } from "vue";
|
|
30
|
+
import { useDisplay } from "vuetify/lib/framework.mjs";
|
|
20
31
|
|
|
21
32
|
/**
|
|
22
33
|
* Footer template ref
|
|
23
|
-
*
|
|
34
|
+
*
|
|
35
|
+
* @type {import("vue").Ref<
|
|
36
|
+
* import("vuetify/lib/components/index.mjs").VFooter | null
|
|
37
|
+
* >}
|
|
24
38
|
*/
|
|
25
|
-
const footer = ref(null)
|
|
26
|
-
const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey))
|
|
39
|
+
const footer = ref(null);
|
|
40
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
27
41
|
|
|
28
|
-
const { mdAndDown } = useDisplay()
|
|
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
|
-
const base64Logo = window.btoa(eoxLogo)
|
|
42
|
+
const { mdAndDown } = useDisplay();
|
|
43
|
+
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>`;
|
|
44
|
+
const base64Logo = window.btoa(eoxLogo);
|
|
31
45
|
</script>
|
|
46
|
+
<style scoped>
|
|
47
|
+
.footer-text {
|
|
48
|
+
font-size: 0.8rem;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app-bar color="primary">
|
|
3
|
+
<v-app-bar-title>{{ title }}</v-app-bar-title>
|
|
4
|
+
<v-img class="mx-12 logo" :src="eodash.brand?.logo" />
|
|
5
|
+
</v-app-bar>
|
|
6
|
+
</template>
|
|
7
|
+
<script setup>
|
|
8
|
+
import { eodashKey } from "@/utils/keys";
|
|
9
|
+
import { inject } from "vue";
|
|
10
|
+
|
|
11
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
12
|
+
|
|
13
|
+
const title = eodash.brand?.name;
|
|
14
|
+
</script>
|
|
15
|
+
<style scoped>
|
|
16
|
+
.logo {
|
|
17
|
+
max-width: 140px;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-row class="d-flex justify-center align-center">
|
|
3
|
+
<v-col class="flex-column justify-center align-center">
|
|
4
|
+
<ErrorAlert v-model="error" />
|
|
5
|
+
<Suspense>
|
|
6
|
+
<component
|
|
7
|
+
v-if="loading.component"
|
|
8
|
+
:is="loading.component"
|
|
9
|
+
v-bind="loading.props"
|
|
10
|
+
></component>
|
|
11
|
+
<div v-else class="text-center">Loading...</div>
|
|
12
|
+
<template #fallback>
|
|
13
|
+
<div class="text-center">Loading...</div>
|
|
14
|
+
</template>
|
|
15
|
+
</Suspense>
|
|
16
|
+
</v-col>
|
|
17
|
+
</v-row>
|
|
18
|
+
</template>
|
|
19
|
+
<script setup>
|
|
20
|
+
import { inject, onErrorCaptured, ref } from "vue";
|
|
21
|
+
import { eodashKey } from "@/utils/keys";
|
|
22
|
+
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
23
|
+
import ErrorAlert from "./ErrorAlert.vue";
|
|
24
|
+
|
|
25
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
26
|
+
|
|
27
|
+
const [loading] = useDefineWidgets([eodash.template.loading]);
|
|
28
|
+
|
|
29
|
+
const error = ref("");
|
|
30
|
+
onErrorCaptured((e, inst, info) => {
|
|
31
|
+
error.value = `
|
|
32
|
+
${e}.
|
|
33
|
+
component: ${inst?.$.type.name}.
|
|
34
|
+
info: ${info}.
|
|
35
|
+
`;
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-main class="overflow-hidden main">
|
|
3
|
+
<Suspense suspensible>
|
|
4
|
+
<component
|
|
5
|
+
id="bg-widget"
|
|
6
|
+
v-if="bgWidget.component"
|
|
7
|
+
:is="bgWidget.component"
|
|
8
|
+
v-bind="bgWidget.props"
|
|
9
|
+
></component>
|
|
10
|
+
</Suspense>
|
|
11
|
+
|
|
12
|
+
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
13
|
+
<div
|
|
14
|
+
v-if="importedWidget.value.component"
|
|
15
|
+
v-show="activeIdx === idx"
|
|
16
|
+
id="overlay"
|
|
17
|
+
class="pa-2 panel bg-surface"
|
|
18
|
+
>
|
|
19
|
+
<v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
|
|
20
|
+
>✕</v-btn
|
|
21
|
+
>
|
|
22
|
+
<Suspense suspensible>
|
|
23
|
+
<div class="component-container" v-show="activeIdx === idx">
|
|
24
|
+
<component
|
|
25
|
+
:key="importedWidget.value.id"
|
|
26
|
+
:is="importedWidget.value.component"
|
|
27
|
+
v-bind="importedWidget.value.props"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</Suspense>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<v-tabs
|
|
35
|
+
ref="tabs"
|
|
36
|
+
align-tabs="center"
|
|
37
|
+
bg-color="surface"
|
|
38
|
+
class="tabs"
|
|
39
|
+
show-arrows
|
|
40
|
+
v-model="activeIdx"
|
|
41
|
+
>
|
|
42
|
+
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
43
|
+
<v-tab v-if="importedWidget.value.component" :value="idx">
|
|
44
|
+
{{ importedWidget.value.title }}
|
|
45
|
+
</v-tab>
|
|
46
|
+
</template>
|
|
47
|
+
</v-tabs>
|
|
48
|
+
</v-main>
|
|
49
|
+
</template>
|
|
50
|
+
<script setup>
|
|
51
|
+
import { eodashKey } from "@/utils/keys";
|
|
52
|
+
import { inject, ref, onMounted } from "vue";
|
|
53
|
+
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
54
|
+
import { useLayout } from "vuetify";
|
|
55
|
+
|
|
56
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
57
|
+
|
|
58
|
+
//import widgets
|
|
59
|
+
const widgetsConfig = eodash.template.widgets;
|
|
60
|
+
const importedWidgets = useDefineWidgets(widgetsConfig);
|
|
61
|
+
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
62
|
+
|
|
63
|
+
const { mainRect } = useLayout();
|
|
64
|
+
|
|
65
|
+
const activeIdx = ref(-1);
|
|
66
|
+
|
|
67
|
+
/** @type {import("vue").Ref<import("vuetify/components").VTabs | null>} */
|
|
68
|
+
const tabs = ref(null);
|
|
69
|
+
const tabsHeightFromBtm = ref("");
|
|
70
|
+
const mainRectTopPx = ref("");
|
|
71
|
+
const mainRectBtmPx = ref("");
|
|
72
|
+
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
mainRectTopPx.value = mainRect.value.top + "px";
|
|
75
|
+
mainRectBtmPx.value = (mainRect.value.bottom || 48) + "px";
|
|
76
|
+
tabsHeightFromBtm.value =
|
|
77
|
+
mainRect.value.bottom + (tabs.value?.$el?.clientHeight ?? 0) + "px";
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
<style scoped>
|
|
81
|
+
.main {
|
|
82
|
+
height: 91dvh;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.panel {
|
|
86
|
+
top: v-bind("mainRectTopPx");
|
|
87
|
+
bottom: v-bind("tabsHeightFromBtm");
|
|
88
|
+
position: absolute;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
width: 100%;
|
|
91
|
+
left: 0;
|
|
92
|
+
z-index: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.component-container {
|
|
96
|
+
height: 90%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.close-btn {
|
|
100
|
+
height: 5%;
|
|
101
|
+
position: relative;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.tabs {
|
|
105
|
+
bottom: v-bind("mainRectBtmPx");
|
|
106
|
+
position: relative;
|
|
107
|
+
z-index: 10;
|
|
108
|
+
}
|
|
109
|
+
</style>
|