@eodash/eodash 5.0.0-alpha.2.5 → 5.0.0-alpha.2.7
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 +19 -5
- package/core/client/App.vue +6 -7
- package/core/client/SuspensedDashboard.ce.vue +58 -40
- package/core/client/asWebComponent.d.ts +10 -5
- package/core/client/asWebComponent.js +6 -6
- package/core/client/components/DashboardLayout.vue +35 -16
- package/core/client/components/DynamicWebComponent.vue +44 -44
- package/core/client/components/ErrorAlert.vue +19 -7
- package/core/client/components/Footer.vue +28 -14
- package/core/client/components/Header.vue +4 -4
- package/core/client/components/IframeWrapper.vue +3 -3
- package/core/client/components/Loading.vue +17 -18
- package/core/client/components/MobileLayout.vue +48 -26
- package/core/client/composables/DefineEodash.js +38 -29
- package/core/client/composables/DefineWidgets.js +101 -81
- package/core/client/composables/index.js +43 -29
- package/core/client/eodash.js +59 -41
- package/core/client/main.js +2 -2
- package/core/client/plugins/index.js +9 -10
- package/core/client/plugins/vuetify.js +9 -10
- package/core/client/render.js +4 -5
- package/core/client/store/Actions.js +8 -0
- package/core/client/store/States.js +8 -13
- package/core/client/store/index.js +14 -11
- package/core/client/store/stac.js +51 -37
- package/core/client/types.d.ts +173 -200
- package/core/client/utils/eodashSTAC.js +130 -49
- package/core/client/utils/helpers.js +18 -20
- package/core/client/utils/index.js +29 -10
- package/core/client/utils/keys.js +2 -2
- package/core/client/views/Dashboard.vue +53 -36
- package/core/client/vite-env.d.ts +19 -17
- package/dist/client/{DashboardLayout-BYROtP-7.js → DashboardLayout-Cbci3g7o.js} +9 -9
- package/dist/client/{DynamicWebComponent-BQhxFPM0.js → DynamicWebComponent-DzmQ3Fr3.js} +3 -3
- package/dist/client/EodashDatePicker-SP5bYISd.js +252 -0
- package/dist/client/{EodashItemFilter-DIBDAHcc.js → EodashItemFilter-B9Tf2TBw.js} +4 -6
- package/dist/client/{EodashMap-C6jJ2Lb_.js → EodashMap-D_znzmX7.js} +13131 -14490
- package/dist/client/EodashMapBtns-BOKugQ88.js +37 -0
- package/dist/client/ExportState-D7m9s4T8.js +558 -0
- package/dist/client/{Footer-BVIZms1S.js → Footer-C2uV1-zu.js} +12 -12
- package/dist/client/Header-C2ROtxo_.js +350 -0
- package/dist/client/{IframeWrapper-XKChM78a.js → IframeWrapper-Wwou4pwf.js} +1 -1
- package/dist/client/{MobileLayout-BlGcMQra.js → MobileLayout-DR27Ctiz.js} +45 -57
- package/dist/client/PopUp-bPGAY43o.js +300 -0
- package/dist/client/VImg-swqiqth2.js +291 -0
- package/dist/client/{VMain-C9XV5Lyg.js → VMain-Bu1bPjvK.js} +2 -2
- package/dist/client/VOverlay-D_MKJ4vQ.js +967 -0
- package/dist/client/{WidgetsContainer-BQXHnZpa.js → WidgetsContainer-CpxYT8YI.js} +10 -3
- package/dist/client/{asWebComponent-CbdGxelK.js → asWebComponent-DeaU3QoK.js} +6332 -6159
- package/dist/client/{basedecoder-Qm25PwVp-CHo5Pomv.js → basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
- package/dist/client/{decoder-HRvnjnEI-CHAYOWhz.js → decoder-CP4lv0Kb-nokx54iM.js} +1 -1
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
- package/dist/client/eo-dash.js +2 -2
- package/dist/client/eodashSTAC-CFQuZ_cI.js +2788 -0
- package/dist/client/{eox-itemfilter-DcQkRD2l.js → eox-itemfilter-TaBxgqq_.js} +1002 -974
- package/dist/client/{eox-map-C3DL31fp.js → eox-map-L7abwKTR.js} +5677 -5695
- package/dist/client/{forwardRefs-CyCJOFsz.js → forwardRefs-D0a135Tc.js} +43 -50
- package/dist/client/{index-CabQjjQg.js → index-CoqcWt6E.js} +4 -4
- package/dist/client/{jpeg-DNfUpLwy-Fjan-04T.js → jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
- package/dist/client/{lerc-_E46UbWQ-TxBH4OeK.js → lerc-DzVumYtB-B3rx9xzz.js} +5 -7
- package/dist/client/{lzw-BOMhmEDy-Dboc93VO.js → lzw-LAGDNbSC-DkP96qO9.js} +1 -1
- package/dist/client/{packbits-DaUD6MLm-Bu1PoTGa.js → packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
- package/dist/client/{pako.esm-C3kYPGGQ-BMki8cQY.js → pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
- package/dist/client/{raw-CcGKjn8q-DFOt-i8n.js → raw-CMGvRjfu-BRi6E4i1.js} +1 -1
- package/dist/client/{ssrBoot-DWJ-z4I-.js → ssrBoot-C-inWOiD.js} +1 -1
- package/dist/client/style.css +2 -2
- package/dist/client/{transition-BlLt41wg.js → transition-C8le0YwQ.js} +3 -3
- package/dist/client/{webfontloader-CyOFAuFB.js → webfontloader-qotgY98I.js} +56 -92
- package/dist/client/{webimage-D2c098k3-DLj1LQxB.js → webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
- package/dist/node/cli.js +1 -1
- package/dist/node/types.d.ts +32 -38
- package/package.json +12 -12
- package/widgets/EodashDatePicker.vue +94 -43
- package/widgets/EodashItemFilter.vue +13 -10
- package/widgets/EodashMap.vue +87 -20
- package/widgets/EodashMapBtns.vue +34 -0
- package/widgets/ExportState.vue +112 -0
- package/widgets/PopUp.vue +40 -0
- package/widgets/WidgetsContainer.vue +45 -27
- package/dist/client/EodashDatePicker-CFltnt5d.js +0 -1194
- package/dist/client/Header-TsTL1d2R.js +0 -633
- package/dist/client/deflate-Be2Arps5-hDqMz3RA.js +0 -10
- package/dist/client/http-ZWiLaAeR.js +0 -1337
|
@@ -1,26 +1,58 @@
|
|
|
1
|
-
import { Collection, Item } from
|
|
2
|
-
import { toAbsolute } from
|
|
3
|
-
import { generateFeatures } from
|
|
4
|
-
import axios from
|
|
1
|
+
import { Collection, Item } from "stac-js";
|
|
2
|
+
import { toAbsolute } from "stac-js/src/http.js";
|
|
3
|
+
import { generateFeatures } from "./helpers";
|
|
4
|
+
import axios from "axios";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Function to extract collection urls from an indicator
|
|
8
|
+
* @param {import("stac-ts").StacCatalog
|
|
9
|
+
* | import("stac-ts").StacCollection
|
|
10
|
+
* | import("stac-ts").StacItem
|
|
11
|
+
* | null
|
|
12
|
+
* } stacObject
|
|
13
|
+
* @param {string} basepath
|
|
14
|
+
* @returns {string[]}
|
|
15
|
+
*/
|
|
16
|
+
export function extractCollectionUrls(stacObject, basepath) {
|
|
17
|
+
const collectionUrls = [];
|
|
18
|
+
// Support for two structure types, flat and indicator, simplified here:
|
|
19
|
+
// Flat assumes Catalog-Collection-Item
|
|
20
|
+
// Indicator assumes Catalog-Collection-Collection-Item
|
|
21
|
+
// TODO: this is not the most stable test approach,
|
|
22
|
+
// we should discuss potential other approaches
|
|
23
|
+
//
|
|
24
|
+
if (stacObject?.links && stacObject?.links[1].rel === "item") {
|
|
25
|
+
collectionUrls.push(basepath);
|
|
26
|
+
} else if (stacObject?.links[1].rel === "child") {
|
|
27
|
+
// TODO: Iterate through all children to create collections
|
|
28
|
+
stacObject.links.forEach((link) => {
|
|
29
|
+
if (link.rel === "child") {
|
|
30
|
+
collectionUrls.push(toAbsolute(link.href, basepath));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return collectionUrls;
|
|
35
|
+
}
|
|
6
36
|
export class EodashCollection {
|
|
7
37
|
/** @type {string} */
|
|
8
|
-
#collectionUrl =
|
|
38
|
+
#collectionUrl = "";
|
|
9
39
|
/** @type {import("stac-ts").StacCollection | undefined} */
|
|
10
40
|
#collectionStac;
|
|
11
|
-
/** @type {import("stac-ts").StacLink | undefined } */
|
|
12
|
-
selectedItem;
|
|
13
|
-
|
|
14
41
|
/**
|
|
15
|
-
* @
|
|
42
|
+
* @type {import("stac-ts").StacLink
|
|
43
|
+
* | import("stac-ts").StacItem
|
|
44
|
+
* | undefined}
|
|
16
45
|
*/
|
|
46
|
+
selectedItem;
|
|
47
|
+
|
|
48
|
+
/** @param {string} collectionUrl */
|
|
17
49
|
constructor(collectionUrl) {
|
|
18
50
|
this.#collectionUrl = collectionUrl;
|
|
19
51
|
}
|
|
20
52
|
/**
|
|
21
|
-
* @param {*} item
|
|
22
|
-
* @returns
|
|
23
53
|
* @async
|
|
54
|
+
* @param {any} item
|
|
55
|
+
* @returns
|
|
24
56
|
*/
|
|
25
57
|
createLayersJson = async (item = null) => {
|
|
26
58
|
/** @type {import("stac-ts").StacLink | undefined} */
|
|
@@ -30,20 +62,20 @@ export class EodashCollection {
|
|
|
30
62
|
// TODO get auxiliary layers from collection
|
|
31
63
|
/** @type {object[]} */
|
|
32
64
|
let layersJson = [
|
|
33
|
-
{
|
|
34
|
-
type:
|
|
65
|
+
/*{
|
|
66
|
+
type: "Tile",
|
|
35
67
|
properties: {
|
|
36
|
-
id:
|
|
68
|
+
id: "OSM",
|
|
37
69
|
},
|
|
38
70
|
source: {
|
|
39
|
-
type:
|
|
71
|
+
type: "OSM",
|
|
40
72
|
},
|
|
41
|
-
}
|
|
73
|
+
},*/
|
|
42
74
|
];
|
|
43
75
|
// Load collectionstac if not yet initialized
|
|
44
76
|
if (!this.#collectionStac) {
|
|
45
77
|
const response = await axios.get(this.#collectionUrl);
|
|
46
|
-
stac = await response.data
|
|
78
|
+
stac = await response.data;
|
|
47
79
|
this.#collectionStac = new Collection(stac);
|
|
48
80
|
}
|
|
49
81
|
|
|
@@ -57,7 +89,6 @@ export class EodashCollection {
|
|
|
57
89
|
},
|
|
58
90
|
source: {
|
|
59
91
|
type: "Vector",
|
|
60
|
-
// @ts-ignore
|
|
61
92
|
url: "data:," + encodeURIComponent(JSON.stringify(allFeatures)),
|
|
62
93
|
format: "GeoJSON",
|
|
63
94
|
},
|
|
@@ -67,15 +98,21 @@ export class EodashCollection {
|
|
|
67
98
|
"circle-stroke-color": "#004170",
|
|
68
99
|
"fill-color": "#00417077",
|
|
69
100
|
"stroke-color": "#004170",
|
|
70
|
-
}
|
|
101
|
+
},
|
|
71
102
|
});
|
|
72
103
|
return layersJson;
|
|
73
104
|
} else {
|
|
74
105
|
if (item instanceof Date) {
|
|
75
106
|
// if collectionStac not yet initialized we do it here
|
|
76
107
|
stacItem = this.getItems()?.sort((a, b) => {
|
|
77
|
-
const distanceA = Math.abs(
|
|
78
|
-
|
|
108
|
+
const distanceA = Math.abs(
|
|
109
|
+
new Date(/** @type {number} */ (a.datetime)).getTime() -
|
|
110
|
+
item.getTime(),
|
|
111
|
+
);
|
|
112
|
+
const distanceB = Math.abs(
|
|
113
|
+
new Date(/** @type {number} */ (b.datetime)).getTime() -
|
|
114
|
+
item.getTime(),
|
|
115
|
+
);
|
|
79
116
|
return distanceA - distanceB;
|
|
80
117
|
})[0];
|
|
81
118
|
this.selectedItem = stacItem;
|
|
@@ -85,7 +122,7 @@ export class EodashCollection {
|
|
|
85
122
|
const response = await fetch(
|
|
86
123
|
stacItem
|
|
87
124
|
? toAbsolute(stacItem.href, this.#collectionUrl)
|
|
88
|
-
: this.#collectionUrl
|
|
125
|
+
: this.#collectionUrl,
|
|
89
126
|
);
|
|
90
127
|
stac = await response.json();
|
|
91
128
|
|
|
@@ -98,71 +135,115 @@ export class EodashCollection {
|
|
|
98
135
|
layersJson = await this.createLayersJson(this.selectedItem);
|
|
99
136
|
} else {
|
|
100
137
|
if (import.meta.env.DEV) {
|
|
101
|
-
console.warn(
|
|
138
|
+
console.warn(
|
|
139
|
+
"[eodash] the selected collection does not include any items",
|
|
140
|
+
);
|
|
102
141
|
}
|
|
103
142
|
}
|
|
104
|
-
return
|
|
143
|
+
return [];
|
|
105
144
|
} else {
|
|
106
145
|
// specific item was requested
|
|
107
146
|
const item = new Item(stac);
|
|
108
147
|
this.selectedItem = item;
|
|
109
|
-
layersJson.unshift(this.
|
|
148
|
+
layersJson.unshift(...this.buildJsonArray(item));
|
|
110
149
|
return layersJson;
|
|
111
150
|
}
|
|
112
151
|
}
|
|
113
|
-
}
|
|
152
|
+
};
|
|
114
153
|
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
154
|
+
/** @param {import("stac-ts").StacItem} item */
|
|
155
|
+
buildJsonArray(item) {
|
|
156
|
+
const jsonArray = [];
|
|
157
|
+
// TODO: this currently assumes only one layer will be extracted
|
|
158
|
+
// from an item, although it think this is currently true
|
|
159
|
+
// potentially this could return multiple layers
|
|
160
|
+
// TODO: implement other types, such as COG
|
|
161
|
+
|
|
162
|
+
// I propose following approach, we "manually" create configurations
|
|
163
|
+
// for the rendering options we know and expect.
|
|
164
|
+
// If we don't find any we fallback to using the STAC ol item that
|
|
165
|
+
// will try to extract anything it supports but for which we have
|
|
166
|
+
// less control.
|
|
167
|
+
const wms = item.links.find((l) => l.rel === "wms");
|
|
168
|
+
// const projDef = false; // TODO: add capability to find projection in item
|
|
169
|
+
if (wms) {
|
|
170
|
+
let json = {
|
|
171
|
+
type: "Tile",
|
|
172
|
+
properties: {
|
|
173
|
+
id: item.id,
|
|
174
|
+
},
|
|
175
|
+
source: {
|
|
176
|
+
// if no projection information is provided we should
|
|
177
|
+
// assume one, else for WMS requests it will try to get
|
|
178
|
+
// the map projection that might not be supported
|
|
179
|
+
// projection: projDef ? projDef : "EPSG:4326",
|
|
180
|
+
type: "TileWMS",
|
|
181
|
+
url: wms.href,
|
|
182
|
+
params: {
|
|
183
|
+
LAYERS: wms["wms:layers"],
|
|
184
|
+
TILED: true,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
if ("wms:dimensions" in wms) {
|
|
189
|
+
// @ts-expect-error: waiting for eox-map to provide type definition
|
|
190
|
+
json.source.params.time = wms["wms:dimensions"];
|
|
191
|
+
}
|
|
192
|
+
jsonArray.push(json);
|
|
193
|
+
} else if (item.links.find((l) => l.rel === "wmts" || l.rel === "xyz")) {
|
|
194
|
+
jsonArray.push({
|
|
195
|
+
type: "STAC",
|
|
125
196
|
displayWebMapLink: true,
|
|
126
197
|
displayFootprint: false,
|
|
127
198
|
data: item,
|
|
128
199
|
properties: {
|
|
129
200
|
id: item.id,
|
|
130
201
|
},
|
|
131
|
-
};
|
|
202
|
+
});
|
|
132
203
|
} else {
|
|
133
204
|
// fall back to rendering the feature
|
|
134
|
-
|
|
135
|
-
type:
|
|
205
|
+
jsonArray.push({
|
|
206
|
+
type: "Vector",
|
|
136
207
|
source: {
|
|
137
|
-
type:
|
|
138
|
-
url:
|
|
139
|
-
format:
|
|
208
|
+
type: "Vector",
|
|
209
|
+
url: "data:," + encodeURIComponent(JSON.stringify(item.geometry)),
|
|
210
|
+
format: "GeoJSON",
|
|
140
211
|
},
|
|
141
212
|
properties: {
|
|
142
213
|
id: item.id,
|
|
143
214
|
},
|
|
144
|
-
};
|
|
215
|
+
});
|
|
145
216
|
}
|
|
146
217
|
|
|
147
|
-
return
|
|
218
|
+
return jsonArray;
|
|
148
219
|
}
|
|
149
220
|
|
|
150
221
|
getItems() {
|
|
151
222
|
return (
|
|
152
223
|
this.#collectionStac?.links
|
|
153
|
-
.filter((i) => i.rel ===
|
|
224
|
+
.filter((i) => i.rel === "item")
|
|
154
225
|
// sort by `datetime`, where oldest is first in array
|
|
155
|
-
.sort((a, b) =>
|
|
226
|
+
.sort((a, b) =>
|
|
227
|
+
/** @type {number} */ (a.datetime) <
|
|
228
|
+
/** @type {number} */ (b.datetime)
|
|
229
|
+
? -1
|
|
230
|
+
: 1,
|
|
231
|
+
)
|
|
156
232
|
);
|
|
157
233
|
}
|
|
158
234
|
|
|
159
235
|
getDates() {
|
|
160
236
|
return (
|
|
161
237
|
this.#collectionStac?.links
|
|
162
|
-
.filter((i) => i.rel ===
|
|
238
|
+
.filter((i) => i.rel === "item")
|
|
163
239
|
// sort by `datetime`, where oldest is first in array
|
|
164
|
-
.sort((a, b) =>
|
|
165
|
-
|
|
240
|
+
.sort((a, b) =>
|
|
241
|
+
/** @type {number} */ (a.datetime) <
|
|
242
|
+
/** @type {number} */ (b.datetime)
|
|
243
|
+
? -1
|
|
244
|
+
: 1,
|
|
245
|
+
)
|
|
246
|
+
.map((i) => new Date(/** @type {number} */ (i.datetime)))
|
|
166
247
|
);
|
|
167
248
|
}
|
|
168
249
|
}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @param {import("stac-ts").StacLink[]} links
|
|
4
|
-
*/
|
|
1
|
+
/** @param {import("stac-ts").StacLink[]} links */
|
|
5
2
|
export function generateFeatures(links) {
|
|
6
3
|
/**
|
|
7
4
|
* @type {{
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* type: string;
|
|
6
|
+
* geometry: {
|
|
7
|
+
* type: string;
|
|
8
|
+
* coordinates: [number, number];
|
|
9
|
+
* };
|
|
13
10
|
* }[]}
|
|
14
11
|
*/
|
|
15
12
|
const features = [];
|
|
16
|
-
links.forEach(element => {
|
|
13
|
+
links.forEach((element) => {
|
|
17
14
|
if (element.rel === "item" && "latlng" in element) {
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const [lat, lon] = /** @type {string} */ (element.latlng)
|
|
16
|
+
.split(",")
|
|
17
|
+
.map((it) => Number(it));
|
|
20
18
|
features.push({
|
|
21
|
-
type:
|
|
19
|
+
type: "Feature",
|
|
22
20
|
geometry: {
|
|
23
|
-
type:
|
|
21
|
+
type: "Point",
|
|
24
22
|
coordinates: [lon, lat],
|
|
25
23
|
},
|
|
26
|
-
})
|
|
24
|
+
});
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
const geojsonObject = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
type: "FeatureCollection",
|
|
29
|
+
crs: {
|
|
30
|
+
type: "name",
|
|
31
|
+
properties: {
|
|
32
|
+
name: "EPSG:4326",
|
|
35
33
|
},
|
|
36
34
|
},
|
|
37
35
|
features,
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Loads font in the app using `webfontloader`
|
|
3
|
+
*
|
|
3
4
|
* @param {string} [family]
|
|
4
5
|
* @param {string} [link]
|
|
5
6
|
* @param {boolean} [isWebComponent]
|
|
6
|
-
* @returns {Promise<string>} -
|
|
7
|
+
* @returns {Promise<string>} - Font family name
|
|
7
8
|
* @see {@link "https://github.com/typekit/webfontloader"}
|
|
8
9
|
*/
|
|
9
|
-
export const loadFont = async (
|
|
10
|
+
export const loadFont = async (
|
|
11
|
+
family = "",
|
|
12
|
+
link = "",
|
|
13
|
+
isWebComponent = false,
|
|
14
|
+
) => {
|
|
10
15
|
if (family && link) {
|
|
11
|
-
const WebFontLoader = (await import(
|
|
16
|
+
const WebFontLoader = (await import("webfontloader")).default;
|
|
12
17
|
WebFontLoader.load({
|
|
13
18
|
classes: false,
|
|
14
19
|
custom: {
|
|
@@ -18,15 +23,29 @@ export const loadFont = async (family = '', link = '', isWebComponent = false) =
|
|
|
18
23
|
urls: [link],
|
|
19
24
|
},
|
|
20
25
|
fontactive(familyName, _fvd) {
|
|
21
|
-
const stylesheet = new CSSStyleSheet()
|
|
22
|
-
const styles = isWebComponent
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
const stylesheet = new CSSStyleSheet();
|
|
27
|
+
const styles = isWebComponent
|
|
28
|
+
? `eo-dash {font-family: ${familyName};}`
|
|
29
|
+
: `* {font-family: ${familyName};}`;
|
|
30
|
+
stylesheet.replaceSync(styles);
|
|
31
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
25
32
|
},
|
|
26
33
|
fontinactive(familyName, _fvd) {
|
|
27
|
-
throw new Error(`error loading font: ${familyName}`)
|
|
28
|
-
}
|
|
34
|
+
throw new Error(`error loading font: ${familyName}`);
|
|
35
|
+
},
|
|
29
36
|
});
|
|
30
37
|
}
|
|
31
38
|
return family;
|
|
32
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {string} text
|
|
43
|
+
* @param {import("vue").Ref<boolean>} showIcon
|
|
44
|
+
**/
|
|
45
|
+
export const copyToClipBoard = async (text, showIcon) => {
|
|
46
|
+
await navigator.clipboard.writeText(text);
|
|
47
|
+
showIcon.value = true;
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
showIcon.value = false;
|
|
50
|
+
}, 2000);
|
|
51
|
+
};
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<HeaderComponent ref="headerRef" v-if="!eodash.brand.noLayout" />
|
|
3
3
|
<ErrorAlert v-model="error" />
|
|
4
4
|
<Suspense>
|
|
5
|
-
<TemplateComponent
|
|
5
|
+
<TemplateComponent
|
|
6
|
+
@vue:mounted="onTemplateMount?.(hiddenElements)"
|
|
7
|
+
class="template"
|
|
8
|
+
/>
|
|
6
9
|
<template #fallback>
|
|
7
10
|
<div class="loading-container">
|
|
8
11
|
<Loading />
|
|
@@ -15,71 +18,85 @@
|
|
|
15
18
|
<script setup>
|
|
16
19
|
import { useEodashRuntime } from "@/composables/DefineEodash";
|
|
17
20
|
import { useURLSearchParametersSync, useUpdateTheme } from "@/composables";
|
|
18
|
-
import { useSTAcStore } from
|
|
21
|
+
import { useSTAcStore } from "@/store/stac";
|
|
19
22
|
import { defineAsyncComponent, onErrorCaptured, onMounted, ref } from "vue";
|
|
20
23
|
import { useDisplay, useLayout } from "vuetify/lib/framework.mjs";
|
|
21
|
-
import { loadFont } from
|
|
24
|
+
import { loadFont } from "@/utils";
|
|
22
25
|
import Loading from "@/components/Loading.vue";
|
|
23
26
|
import ErrorAlert from "@/components/ErrorAlert.vue";
|
|
24
27
|
|
|
25
28
|
const props = defineProps({
|
|
26
29
|
config: {
|
|
27
|
-
type: String
|
|
30
|
+
type: String,
|
|
28
31
|
},
|
|
29
32
|
onTemplateMount: {
|
|
30
|
-
type: Function
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
const eodash = await useEodashRuntime(props.config)
|
|
33
|
+
type: Function,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const eodash = await useEodashRuntime(props.config);
|
|
34
37
|
|
|
35
38
|
useURLSearchParametersSync();
|
|
36
39
|
|
|
37
|
-
const theme = useUpdateTheme(
|
|
38
|
-
theme.global.name.value =
|
|
40
|
+
const theme = useUpdateTheme("dashboardTheme", eodash.brand?.theme);
|
|
41
|
+
theme.global.name.value = "dashboardTheme";
|
|
39
42
|
|
|
40
|
-
await loadFont(
|
|
43
|
+
await loadFont(
|
|
44
|
+
eodash.brand?.font?.family,
|
|
45
|
+
eodash.brand?.font?.link,
|
|
46
|
+
!!props.onTemplateMount,
|
|
47
|
+
);
|
|
41
48
|
|
|
42
|
-
const { loadSTAC } = useSTAcStore()
|
|
43
|
-
await loadSTAC()
|
|
49
|
+
const { loadSTAC } = useSTAcStore();
|
|
50
|
+
await loadSTAC();
|
|
44
51
|
|
|
45
|
-
const { smAndDown } = useDisplay()
|
|
46
|
-
const TemplateComponent = smAndDown.value
|
|
47
|
-
defineAsyncComponent(() => import(`@/components/MobileLayout.vue`))
|
|
48
|
-
defineAsyncComponent(() => import(`@/components/DashboardLayout.vue`))
|
|
52
|
+
const { smAndDown } = useDisplay();
|
|
53
|
+
const TemplateComponent = smAndDown.value
|
|
54
|
+
? defineAsyncComponent(() => import(`@/components/MobileLayout.vue`))
|
|
55
|
+
: defineAsyncComponent(() => import(`@/components/DashboardLayout.vue`));
|
|
49
56
|
|
|
50
|
-
const HeaderComponent = defineAsyncComponent(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
57
|
+
const HeaderComponent = defineAsyncComponent(
|
|
58
|
+
() => import(`@/components/Header.vue`),
|
|
59
|
+
);
|
|
60
|
+
const FooterComponent = defineAsyncComponent(
|
|
61
|
+
() => import(`@/components/Footer.vue`),
|
|
62
|
+
);
|
|
63
|
+
const { mainRect } = useLayout();
|
|
64
|
+
const templateHeight = eodash.brand.noLayout
|
|
65
|
+
? props.onTemplateMount
|
|
66
|
+
? "100%"
|
|
67
|
+
: "90dvh"
|
|
68
|
+
: `calc(100dvh - ${mainRect.value["top"] + mainRect.value["bottom"]}px)`;
|
|
55
69
|
|
|
56
70
|
const headerRef = ref(null);
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @type {import("vue").Ref<InstanceType<
|
|
73
|
+
* typeof import("@/components/Footer.vue").default
|
|
74
|
+
* > | null>}
|
|
75
|
+
*/
|
|
60
76
|
const footerRef = ref(null);
|
|
61
77
|
|
|
62
|
-
const hiddenElements = [headerRef, footerRef]
|
|
78
|
+
const hiddenElements = [headerRef, footerRef];
|
|
63
79
|
|
|
64
80
|
onMounted(() => {
|
|
65
81
|
if (props.onTemplateMount && !eodash.brand.noLayout) {
|
|
66
|
-
hiddenElements.forEach(element => {
|
|
82
|
+
hiddenElements.forEach((element) => {
|
|
67
83
|
/** @type {HTMLElement} */
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
(
|
|
85
|
+
/** @type {import("vue").ComponentPublicInstance} */
|
|
86
|
+
(element.value).$el
|
|
87
|
+
).style.opacity = "0";
|
|
88
|
+
});
|
|
71
89
|
}
|
|
72
|
-
})
|
|
90
|
+
});
|
|
73
91
|
|
|
74
|
-
const error = ref(
|
|
92
|
+
const error = ref("");
|
|
75
93
|
onErrorCaptured((e, comp, info) => {
|
|
76
94
|
error.value = `
|
|
77
95
|
${e}.
|
|
78
96
|
component: ${comp?.$.type.name}.
|
|
79
97
|
info: ${info}.
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
|
|
98
|
+
`;
|
|
99
|
+
});
|
|
83
100
|
</script>
|
|
84
101
|
<style>
|
|
85
102
|
html {
|
|
@@ -87,7 +104,7 @@ html {
|
|
|
87
104
|
}
|
|
88
105
|
|
|
89
106
|
.template {
|
|
90
|
-
height: v-bind("templateHeight")
|
|
107
|
+
height: v-bind("templateHeight");
|
|
91
108
|
}
|
|
92
109
|
|
|
93
110
|
.loading-container {
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
|
-
declare module
|
|
4
|
-
import type { DefineComponent } from
|
|
5
|
-
const component: DefineComponent<
|
|
6
|
-
export default component
|
|
3
|
+
declare module "*.vue" {
|
|
4
|
+
import type { DefineComponent } from "vue";
|
|
5
|
+
const component: DefineComponent<object, object, unknown>;
|
|
6
|
+
export default component;
|
|
7
7
|
}
|
|
8
8
|
declare interface Window {
|
|
9
|
-
eodashStore: import("@/types").EodashStore
|
|
9
|
+
eodashStore: import("@/types").EodashStore;
|
|
10
10
|
}
|
|
11
|
-
declare module
|
|
12
|
-
export const EOxStacInfo: CustomElementConstructor
|
|
11
|
+
declare module "@eox/stacinfo" {
|
|
12
|
+
export const EOxStacInfo: CustomElementConstructor;
|
|
13
13
|
}
|
|
14
|
-
declare module
|
|
15
|
-
export const EOxMap: CustomElementConstructor
|
|
14
|
+
declare module "@eox/map" {
|
|
15
|
+
export const EOxMap: CustomElementConstructor;
|
|
16
16
|
}
|
|
17
|
-
declare module
|
|
18
|
-
export const EOxItemFilter: CustomElementConstructor
|
|
17
|
+
declare module "@eox/itemfilter" {
|
|
18
|
+
export const EOxItemFilter: CustomElementConstructor;
|
|
19
19
|
}
|
|
20
|
-
declare module
|
|
20
|
+
declare module "user:config" {
|
|
21
21
|
const eodash: import("@/types").Eodash | Promise<import("@/types").Eodash>;
|
|
22
|
-
export default eodash
|
|
22
|
+
export default eodash;
|
|
23
23
|
}
|
|
24
24
|
declare module "stac-js" {
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
export const Collection: {
|
|
26
|
+
new (data?: object): import("stac-ts").StacCollection;
|
|
27
|
+
};
|
|
28
|
+
export const Item: { new (data?: object): import("stac-ts").StacItem };
|
|
27
29
|
}
|
|
28
30
|
declare module "stac-js/src/http.js" {
|
|
29
|
-
const toAbsolute:
|
|
30
|
-
export { toAbsolute }
|
|
31
|
+
const toAbsolute: (...args: string[]) => string;
|
|
32
|
+
export { toAbsolute };
|
|
31
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { V as k } from "./VMain-
|
|
1
|
+
import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-DeaU3QoK.js";
|
|
2
|
+
import { V as k } from "./VMain-Bu1bPjvK.js";
|
|
3
3
|
class A extends HTMLElement {
|
|
4
4
|
static get observedAttributes() {
|
|
5
5
|
return ["gap"];
|
|
@@ -78,10 +78,10 @@ const L = ["gap"], $ = {
|
|
|
78
78
|
gap: n(a).template.gap ?? 2
|
|
79
79
|
}, [
|
|
80
80
|
n(s).component ? (t(), u("eox-layout-item", $, [
|
|
81
|
-
(t(), r(
|
|
81
|
+
(t(), r(c, { suspensible: "" }, {
|
|
82
82
|
default: l(() => [
|
|
83
83
|
(t(), r(
|
|
84
|
-
|
|
84
|
+
p(n(s).component),
|
|
85
85
|
h({ id: "bg-widget" }, n(s).props),
|
|
86
86
|
null,
|
|
87
87
|
16
|
|
@@ -95,10 +95,10 @@ const L = ["gap"], $ = {
|
|
|
95
95
|
(t(!0), u(
|
|
96
96
|
f,
|
|
97
97
|
null,
|
|
98
|
-
v(n(o), (e,
|
|
98
|
+
v(n(o), (e, b) => (t(), r(
|
|
99
99
|
w,
|
|
100
100
|
{
|
|
101
|
-
key:
|
|
101
|
+
key: b,
|
|
102
102
|
name: "fade"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -112,12 +112,12 @@ const L = ["gap"], $ = {
|
|
|
112
112
|
y: e.value.layout.y
|
|
113
113
|
}, [
|
|
114
114
|
(t(), r(
|
|
115
|
-
|
|
115
|
+
c,
|
|
116
116
|
{ suspensible: "" },
|
|
117
117
|
{
|
|
118
118
|
default: l(() => [
|
|
119
119
|
(t(), r(
|
|
120
|
-
|
|
120
|
+
p(e.value.component),
|
|
121
121
|
h({
|
|
122
122
|
key: e.value.id,
|
|
123
123
|
ref_for: !0
|
|
@@ -150,7 +150,7 @@ const L = ["gap"], $ = {
|
|
|
150
150
|
/* STABLE */
|
|
151
151
|
}));
|
|
152
152
|
}
|
|
153
|
-
}, V = /* @__PURE__ */
|
|
153
|
+
}, V = /* @__PURE__ */ y(M, [["__scopeId", "data-v-34c69bd3"]]);
|
|
154
154
|
export {
|
|
155
155
|
V as default
|
|
156
156
|
};
|