@eodash/eodash 5.0.0-processing → 5.0.0-rc.1
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/core/client/asWebComponent.js +2 -3
- package/core/client/components/DashboardLayout.vue +35 -17
- package/core/client/components/Loading.vue +6 -9
- package/core/client/components/MobileLayout.vue +16 -14
- package/core/client/composables/DefineEodash.js +13 -3
- package/core/client/composables/DefineTemplate.js +67 -0
- package/core/client/composables/DefineWidgets.js +3 -2
- package/core/client/composables/EodashMap.js +23 -12
- package/core/client/composables/EodashProcess.js +10 -11
- package/core/client/composables/index.js +35 -10
- package/core/client/eodash.js +381 -139
- package/core/client/{utils/eodashSTAC.js → eodashSTAC/EodashCollection.js} +75 -42
- package/core/client/{utils → eodashSTAC}/createLayers.js +10 -8
- package/core/client/{utils → eodashSTAC}/helpers.js +45 -68
- package/core/client/eodashSTAC/triggers.js +43 -0
- package/core/client/plugins/vuetify.js +2 -1
- package/core/client/store/{Actions.js → actions.js} +16 -2
- package/core/client/store/index.js +4 -18
- package/core/client/store/stac.js +4 -4
- package/core/client/store/{States.js → states.js} +2 -0
- package/{dist/types/core/client/types.d.ts → core/client/types.ts} +47 -8
- package/core/client/utils/states.js +8 -3
- package/core/client/views/Dashboard.vue +6 -4
- package/core/client/vite-env.d.ts +1 -1
- package/dist/client/{DashboardLayout-CVMJ4l8M.js → DashboardLayout-FS5inBIm.js} +12 -15
- package/dist/client/{DynamicWebComponent-Cv8n457T.js → DynamicWebComponent-CBSgT677.js} +1 -1
- package/dist/client/{EodashDatePicker-VVkiPmpc.js → EodashDatePicker-BGSS2ZYK.js} +75 -163
- package/dist/client/EodashItemFilter-CFNKjm_Z.js +151 -0
- package/dist/client/{EodashLayerControl-53WghA8G.js → EodashLayerControl-CzffoPUs.js} +17 -7
- package/dist/client/EodashLayoutSwitcher-DM0zDhvI.js +52 -0
- package/dist/client/{EodashMap-CQnOePpy.js → EodashMap-BdFZ657e.js} +101 -38
- package/dist/client/EodashMapBtns-rC_IPD-Z.js +107 -0
- package/dist/client/EodashProcess-SLsTISKV.js +714 -0
- package/dist/client/EodashStacInfo-DFD0gtWm.js +85 -0
- package/dist/client/EodashTools-ImohD2ys.js +103 -0
- package/dist/client/{ExportState-BT8MLAW7.js → ExportState-LNZAovzM.js} +13 -13
- package/dist/client/{Footer-C6GUG84G.js → Footer-c19dV1ZR.js} +1 -1
- package/dist/client/{Header-D2dtCWp8.js → Header-CcvXFqqt.js} +3 -3
- package/dist/client/{MobileLayout-BAo8Wr8T.js → MobileLayout-OM6Wc-vj.js} +28 -31
- package/dist/client/{PopUp-Bm01q7Ko.js → PopUp-B0_c0207.js} +29 -8
- package/dist/client/{VImg-B8AbetCE.js → VImg-BpDhCbL0.js} +2 -2
- package/dist/client/{VMain-DnGlQUyr.js → VMain-DC05bDwX.js} +1 -1
- package/dist/client/{VOverlay-B8Qj7LRG.js → VOverlay-C7EUyVe_.js} +3 -3
- package/dist/client/VTooltip-C78suika.js +86 -0
- package/dist/client/{WidgetsContainer-CwXRRLS1.js → WidgetsContainer-sD1vDnhF.js} +1 -1
- package/dist/client/{asWebComponent-DUUoR7MZ.js → asWebComponent-D8bMMCEr.js} +1374 -1052
- package/dist/client/{style.css → eo-dash.css} +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CZJhEAKW.js → forwardRefs-yw6tFXER.js} +1 -1
- package/dist/client/{index-DlIO7sJ3.js → index-CpK_Yaom.js} +1 -1
- package/dist/client/{transition-BiR8wMn1.js → transition-B2YwqAYJ.js} +1 -1
- package/dist/node/cli.js +2 -2
- package/package.json +48 -37
- package/widgets/EodashDatePicker.vue +68 -54
- package/widgets/EodashItemFilter.vue +60 -105
- package/widgets/EodashLayerControl.vue +17 -4
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +26 -27
- package/widgets/EodashMapBtns.vue +41 -4
- package/widgets/EodashProcess.vue +4 -12
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +12 -12
- package/widgets/PopUp.vue +24 -2
- package/core/client/asWebComponent.d.ts +0 -23
- package/core/client/types.d.ts +0 -279
- package/dist/client/EodashItemFilter-CugWNQ86.js +0 -194
- package/dist/client/EodashMapBtns-uaRwFtfB.js +0 -66
- package/dist/client/EodashProcess-cF0unIy8.js +0 -1477
- package/dist/types/core/client/App.vue.d.ts +0 -7
- package/dist/types/core/client/asWebComponent.d.ts +0 -9
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +0 -2
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +0 -18
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +0 -2
- package/dist/types/core/client/components/Footer.vue.d.ts +0 -2
- package/dist/types/core/client/components/Header.vue.d.ts +0 -2
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +0 -7
- package/dist/types/core/client/components/Loading.vue.d.ts +0 -2
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +0 -2
- package/dist/types/core/client/composables/DefineEodash.d.ts +0 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +0 -15
- package/dist/types/core/client/composables/DefineWidgets.d.ts +0 -14
- package/dist/types/core/client/composables/EodashMap.d.ts +0 -5
- package/dist/types/core/client/composables/index.d.ts +0 -30
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/dist/types/core/client/main.d.ts +0 -2
- package/dist/types/core/client/plugins/axios.d.ts +0 -2
- package/dist/types/core/client/plugins/index.d.ts +0 -3
- package/dist/types/core/client/plugins/vuetify.d.ts +0 -82
- package/dist/types/core/client/render.d.ts +0 -1
- package/dist/types/core/client/store/Actions.d.ts +0 -12
- package/dist/types/core/client/store/States.d.ts +0 -22
- package/dist/types/core/client/store/index.d.ts +0 -2
- package/dist/types/core/client/store/stac.d.ts +0 -25
- package/dist/types/core/client/utils/createLayers.d.ts +0 -45
- package/dist/types/core/client/utils/eodashSTAC.d.ts +0 -82
- package/dist/types/core/client/utils/helpers.d.ts +0 -84
- package/dist/types/core/client/utils/index.d.ts +0 -2
- package/dist/types/core/client/utils/keys.d.ts +0 -6
- package/dist/types/core/client/utils/states.d.ts +0 -14
- package/dist/types/core/client/views/Dashboard.vue.d.ts +0 -9
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +0 -7
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +0 -42
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +0 -11
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +0 -9
- package/dist/types/widgets/EodashMap.vue.d.ts +0 -7
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +0 -11
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +0 -21
- package/dist/types/widgets/EodashTools.vue.d.ts +0 -15
- package/dist/types/widgets/ExportState.vue.d.ts +0 -7
- package/dist/types/widgets/PopUp.vue.d.ts +0 -22
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +0 -7
package/core/client/types.d.ts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/** @group Eodash */
|
|
2
|
-
export interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
|
|
3
|
-
/**
|
|
4
|
-
* Imports web component file, either using a URL or an import function.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* importing `eox-itemfilter` web component, after installing `@eox/itemfilter` it can be
|
|
8
|
-
* referenced:
|
|
9
|
-
* ```js
|
|
10
|
-
* link: async() => import("@eox/itemfilter")
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* ::: warning
|
|
14
|
-
* import maps are not available in runtime config
|
|
15
|
-
* :::
|
|
16
|
-
*/
|
|
17
|
-
link: T extends "runtime" ? string : string | (() => Promise<unknown>);
|
|
18
|
-
/**
|
|
19
|
-
* Exported Constructor, needs to be provided if the web component is not
|
|
20
|
-
* registered in by the [link](#link) provided
|
|
21
|
-
*/
|
|
22
|
-
constructorProp?: string;
|
|
23
|
-
tagName: `${string}-${string}`;
|
|
24
|
-
/** Object defining all the properties and attributes of the web component */
|
|
25
|
-
properties?: Record<string, unknown>;
|
|
26
|
-
/**
|
|
27
|
-
* Triggered when the web component is mounted in the DOM.
|
|
28
|
-
*
|
|
29
|
-
* @param el - Web component
|
|
30
|
-
* @param store - Return value of the core STAC pinia store in
|
|
31
|
-
* `/core/client/store/stac.ts`
|
|
32
|
-
*/
|
|
33
|
-
onMounted?: (
|
|
34
|
-
el: Element | null,
|
|
35
|
-
store: ReturnType<typeof import("./store/stac.js").useSTAcStore>,
|
|
36
|
-
) => Promise<void> | void;
|
|
37
|
-
/**
|
|
38
|
-
* Triggered when the web component is unmounted from the DOM.
|
|
39
|
-
*
|
|
40
|
-
* @param el - Web component
|
|
41
|
-
* @param store - Return value of the core STAC pinia store in
|
|
42
|
-
* `/core/client/store/stac.ts`
|
|
43
|
-
*/
|
|
44
|
-
onUnmounted?: (
|
|
45
|
-
el: Element | null,
|
|
46
|
-
store: ReturnType<typeof import("./store/stac.js").useSTAcStore>,
|
|
47
|
-
) => Promise<void> | void;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** @ignore */
|
|
51
|
-
export interface WidgetsContainerProps {
|
|
52
|
-
widgets: Omit<Widget, "layout">[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// eodash types:
|
|
56
|
-
/** Properties of EOxLayoutItem used for setting the position and size of panels */
|
|
57
|
-
export interface Layout {
|
|
58
|
-
/** Horizontal start position. Integer between 1 and 12 */
|
|
59
|
-
x: number;
|
|
60
|
-
/** Vertical start position. Integer between 1 and 12 */
|
|
61
|
-
y: number;
|
|
62
|
-
/** Width. Integer between 1 and 12 */
|
|
63
|
-
w: number;
|
|
64
|
-
/** Height. Integer between 1 and 12 */
|
|
65
|
-
h: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Widget type: `web-component` API
|
|
69
|
-
*
|
|
70
|
-
* @group Eodash
|
|
71
|
-
*/
|
|
72
|
-
export interface WebComponentWidget<T extends ExecutionTime = "compiletime"> {
|
|
73
|
-
id: number | string | symbol;
|
|
74
|
-
title: string;
|
|
75
|
-
/** Widget position and size. */
|
|
76
|
-
layout: Layout;
|
|
77
|
-
widget: WebComponentProps<T>;
|
|
78
|
-
type: "web-component";
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Widget type: `internal` API. Internal widgets are Vue components provided by
|
|
83
|
-
* eodash.
|
|
84
|
-
*
|
|
85
|
-
* @group Eodash
|
|
86
|
-
*/
|
|
87
|
-
export interface InternalComponentWidget {
|
|
88
|
-
id: number | string | symbol;
|
|
89
|
-
title: string;
|
|
90
|
-
/** Widget position and size. */
|
|
91
|
-
layout: Layout;
|
|
92
|
-
widget: {
|
|
93
|
-
/**
|
|
94
|
-
* Internal Vue Components inside the
|
|
95
|
-
* [widgets](https://github.com/eodash/eodash/tree/main/widgets) folder.
|
|
96
|
-
* Referenced using their name without the .vue extention
|
|
97
|
-
*/
|
|
98
|
-
name: string;
|
|
99
|
-
/** Specified Vue component props */
|
|
100
|
-
properties?: Record<string, unknown>;
|
|
101
|
-
};
|
|
102
|
-
type: "internal";
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** Widget type: `iframe` API Renders an external HTML file as a widget. */
|
|
106
|
-
/** @group Eodash */
|
|
107
|
-
export interface IFrameWidget {
|
|
108
|
-
id: number | string | symbol;
|
|
109
|
-
title: string;
|
|
110
|
-
/** Widget position and size. */
|
|
111
|
-
layout: Layout;
|
|
112
|
-
widget: {
|
|
113
|
-
/** The URL of the page to embed */
|
|
114
|
-
src: string;
|
|
115
|
-
};
|
|
116
|
-
type: "iframe";
|
|
117
|
-
}
|
|
118
|
-
/** @group Eodash */
|
|
119
|
-
export interface FunctionalWidget<T extends ExecutionTime = "compiletime"> {
|
|
120
|
-
/**
|
|
121
|
-
* Provides a functional definition of widgets, gets triggered whenever a STAC
|
|
122
|
-
* object is selected, and only renders the returned configuration if the `id`
|
|
123
|
-
* doesn't match the currently rendered `id`
|
|
124
|
-
*
|
|
125
|
-
* @param selectedSTAC - Currently selected STAC object
|
|
126
|
-
*/
|
|
127
|
-
defineWidget: (
|
|
128
|
-
selectedSTAC:
|
|
129
|
-
| import("stac-ts").StacCatalog
|
|
130
|
-
| import("stac-ts").StacCollection
|
|
131
|
-
| import("stac-ts").StacItem
|
|
132
|
-
| null,
|
|
133
|
-
) => StaticWidget<T> | undefined | null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* There are 3 types of Widgets:
|
|
137
|
-
*
|
|
138
|
-
* @group Eodash
|
|
139
|
-
*/
|
|
140
|
-
export type StaticWidget<T extends ExecutionTime = "compiletime"> =
|
|
141
|
-
| WebComponentWidget<T>
|
|
142
|
-
| InternalComponentWidget
|
|
143
|
-
| IFrameWidget;
|
|
144
|
-
/**
|
|
145
|
-
* Widgets can be defined in 2 forms:
|
|
146
|
-
*
|
|
147
|
-
* 1. {@link StaticWidget} : This is defined as an object once, and is considered
|
|
148
|
-
* the default form.
|
|
149
|
-
* 2. {@link FunctionalWidget} : a special form which contains the
|
|
150
|
-
* {@link FunctionalWidget.defineWidget `defineWidget`} function that runs
|
|
151
|
-
* when {@link EodashStore.stac `loadSelectedSTAC`} function is triggered, and
|
|
152
|
-
* returns a value of a Static Widget or null or undefined.
|
|
153
|
-
*
|
|
154
|
-
* @group Eodash
|
|
155
|
-
*/
|
|
156
|
-
export type Widget<T extends ExecutionTime = "compiletime"> =
|
|
157
|
-
| StaticWidget<T>
|
|
158
|
-
| FunctionalWidget<T>;
|
|
159
|
-
|
|
160
|
-
/** @group Eodash */
|
|
161
|
-
export type BackgroundWidget<T extends ExecutionTime = "compiletime"> =
|
|
162
|
-
| Omit<WebComponentWidget<T>, "layout" | "title" | "slidable">
|
|
163
|
-
| Omit<InternalComponentWidget, "layout" | "title" | "slidable">
|
|
164
|
-
| Omit<IFrameWidget, "layout" | "title" | "slidable">
|
|
165
|
-
| Omit<FunctionalWidget<T>, "layout" | "slidable">;
|
|
166
|
-
/**
|
|
167
|
-
* Dashboard rendered widgets specification. 3 types of widgets are supported:
|
|
168
|
-
* `"iframe"`, `"internal"`, and `"web-component"`. A specific object should be
|
|
169
|
-
* provided based on the type of the widget.
|
|
170
|
-
*
|
|
171
|
-
* @group Eodash
|
|
172
|
-
*/
|
|
173
|
-
export interface Template<T extends ExecutionTime = "compiletime"> {
|
|
174
|
-
/** Gap between widgets */
|
|
175
|
-
gap?: number;
|
|
176
|
-
/** Loading widget */
|
|
177
|
-
loading?: BackgroundWidget<T>;
|
|
178
|
-
/**
|
|
179
|
-
* Widget rendered as the dashboard background. Has the same specifications of
|
|
180
|
-
* {@link Widget} without the `title` and `layout` properties
|
|
181
|
-
*/
|
|
182
|
-
background?: BackgroundWidget<T>;
|
|
183
|
-
/** Array of widgets that will be rendered as dashboard panels. */
|
|
184
|
-
widgets: Widget<T>[];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** @ignore */
|
|
188
|
-
export type StacEndpoint = `${"https://" | "http://"}${string}/catalog.json`;
|
|
189
|
-
|
|
190
|
-
/** @group Eodash */
|
|
191
|
-
type ExecutionTime = "runtime" | "compiletime";
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Eodash instance API
|
|
195
|
-
*
|
|
196
|
-
* @group Eodash
|
|
197
|
-
*/
|
|
198
|
-
export interface Eodash<T extends ExecutionTime = "compiletime"> {
|
|
199
|
-
/** Instance ID. */
|
|
200
|
-
id?: string;
|
|
201
|
-
/** Root STAC catalog endpoint */
|
|
202
|
-
stacEndpoint: StacEndpoint;
|
|
203
|
-
/** Brand specifications. */
|
|
204
|
-
brand: {
|
|
205
|
-
/** Removes the dashboard layout */
|
|
206
|
-
noLayout?: boolean;
|
|
207
|
-
/** Custom error message to alert the users if something crashes */
|
|
208
|
-
errorMessage?: string;
|
|
209
|
-
/** Fetches the specified font family from the specified `link` property. */
|
|
210
|
-
font?: {
|
|
211
|
-
/**
|
|
212
|
-
* Link to stylesheet that defines font-face. Could be either a relative
|
|
213
|
-
* or absolute URL.
|
|
214
|
-
*/
|
|
215
|
-
link: string;
|
|
216
|
-
/** Font family name. */
|
|
217
|
-
family: string;
|
|
218
|
-
};
|
|
219
|
-
/** Title that will be shown in the app header */
|
|
220
|
-
name: string;
|
|
221
|
-
/** Brand logo */
|
|
222
|
-
logo?: string;
|
|
223
|
-
/**
|
|
224
|
-
* Dashboard theme as a custom [vuetifyJs
|
|
225
|
-
* theme](https://vuetifyjs.com/en/features/theme/).
|
|
226
|
-
*/
|
|
227
|
-
theme?: import("vuetify/lib/index.mjs").ThemeDefinition;
|
|
228
|
-
/** Text applied to the footer. */
|
|
229
|
-
footerText?: string;
|
|
230
|
-
};
|
|
231
|
-
/** Template configuration */
|
|
232
|
-
template: Template<T>;
|
|
233
|
-
}
|
|
234
|
-
/////////
|
|
235
|
-
|
|
236
|
-
/// eodash store types
|
|
237
|
-
/** @group EodashStore */
|
|
238
|
-
export interface EodashStore {
|
|
239
|
-
/** Stateful Reactive variables */
|
|
240
|
-
states: {
|
|
241
|
-
/** Currently selected STAC endpoint */
|
|
242
|
-
currentUrl: import("vue").Ref<string>;
|
|
243
|
-
/** Currently selected datetime */
|
|
244
|
-
datetime: import("vue").Ref<string>;
|
|
245
|
-
/** Currently selected indicator */
|
|
246
|
-
indicator: import("vue").Ref<string>;
|
|
247
|
-
|
|
248
|
-
registeredProjections: `EPSG${number}`[];
|
|
249
|
-
|
|
250
|
-
/** available projection to be rendered by the Map */
|
|
251
|
-
availableMapProjection: import("vue").Ref<string>;
|
|
252
|
-
};
|
|
253
|
-
actions: {
|
|
254
|
-
/**
|
|
255
|
-
* returns the layers of the `eox-map`
|
|
256
|
-
* @param [el] - `eox-map` element selector
|
|
257
|
-
*/
|
|
258
|
-
getLayers: (el?: string) => object[];
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Register EPSG projection in `eox-map` and adds it to `availableMapProjection`
|
|
262
|
-
* */
|
|
263
|
-
registerProjection: (
|
|
264
|
-
code?: number | string | { name: string; def: string },
|
|
265
|
-
) => Promise<void>;
|
|
266
|
-
|
|
267
|
-
/** Change `eox-map` projection from an `EPSG` code */
|
|
268
|
-
changeMapProjection: (
|
|
269
|
-
code?: number | string | { name: string; def: string },
|
|
270
|
-
) => Promise<void>;
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
/** Pinia store definition used to navigate the root STAC catalog. */
|
|
274
|
-
stac: {
|
|
275
|
-
useSTAcStore: typeof import("./store/stac.js").useSTAcStore;
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
///////
|
|
279
|
-
export { createEodash, store } from "./main.js";
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { ref, onMounted, openBlock, createElementBlock, mergeProps, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
-
import { a0 as useSTAcStore } from './asWebComponent-DUUoR7MZ.js';
|
|
3
|
-
import '@eox/itemfilter';
|
|
4
|
-
|
|
5
|
-
const _hoisted_1 = {
|
|
6
|
-
slot: "filterstitle",
|
|
7
|
-
style: {"margin":"14px 8px"}
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_2 = {
|
|
10
|
-
slot: "resultstitle",
|
|
11
|
-
style: {"margin":"14px 8px"}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const defaultStyle =
|
|
15
|
-
"float:right; height:15px; padding:4px; margin-top:-4px; background-color:white;";
|
|
16
|
-
const highlightStyle =
|
|
17
|
-
"float:right; height:15px; padding:4px; margin-top:-4px; background-color:#9bcaeb;";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const _sfc_main = {
|
|
21
|
-
__name: 'EodashItemFilter',
|
|
22
|
-
props: {
|
|
23
|
-
enableCompare: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false,
|
|
26
|
-
},
|
|
27
|
-
filtersTitle: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "Indicators",
|
|
30
|
-
},
|
|
31
|
-
resultsTitle: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "",
|
|
34
|
-
},
|
|
35
|
-
titleProperty: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "title",
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
aggregateResults: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: "themes",
|
|
43
|
-
},
|
|
44
|
-
enableHighlighting: { type: Boolean, default: true },
|
|
45
|
-
expandMultipleFilters: { type: Boolean, default: true },
|
|
46
|
-
expandMultipleResults: { type: Boolean, default: true },
|
|
47
|
-
filterProperties: {
|
|
48
|
-
/** @type {import("vue").PropType<{
|
|
49
|
-
* keys:string[];
|
|
50
|
-
* title:string;
|
|
51
|
-
* type:string;
|
|
52
|
-
* expanded?:boolean
|
|
53
|
-
* }[]> }*/
|
|
54
|
-
type: Array,
|
|
55
|
-
default: () => [
|
|
56
|
-
{
|
|
57
|
-
keys: ["title", "themes", "description"],
|
|
58
|
-
title: "Search",
|
|
59
|
-
type: "text",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
key: "themes",
|
|
63
|
-
title: "Theme Filter",
|
|
64
|
-
type: "multiselect",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
setup(__props) {
|
|
70
|
-
|
|
71
|
-
const props = __props;
|
|
72
|
-
/** @param {any} evt*/
|
|
73
|
-
const onSelect = async (evt) => {
|
|
74
|
-
// reset the style of all compare buttons
|
|
75
|
-
eoxItemFilter.value?.shadowRoot
|
|
76
|
-
?.querySelectorAll(".compareMapButton")
|
|
77
|
-
.forEach((res) => res.setAttribute("style", defaultStyle));
|
|
78
|
-
const item = /** @type {import('stac-ts').StacLink} */ evt.detail;
|
|
79
|
-
if (item) {
|
|
80
|
-
// Reset compare stac to empty
|
|
81
|
-
store.resetSelectedCompareSTAC();
|
|
82
|
-
await store.loadSelectedSTAC(item.href);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const config = {
|
|
86
|
-
titleProperty: props.titleProperty,
|
|
87
|
-
filterProperties: props.filterProperties,
|
|
88
|
-
aggregateResults: props.aggregateResults,
|
|
89
|
-
enableHighlighting: props.enableHighlighting,
|
|
90
|
-
expandMultipleFilters: props.expandMultipleFilters,
|
|
91
|
-
expandMultipleResults: props.expandMultipleResults,
|
|
92
|
-
};
|
|
93
|
-
/** @type {import("vue").Ref<HTMLElement & Record<string,any> | null>} */
|
|
94
|
-
const eoxItemFilter = ref(null);
|
|
95
|
-
|
|
96
|
-
const store = useSTAcStore();
|
|
97
|
-
|
|
98
|
-
const injectCompareButtons = () => {
|
|
99
|
-
setTimeout(() => {
|
|
100
|
-
/** @type {any} */
|
|
101
|
-
(eoxItemFilter.value)?.shadowRoot
|
|
102
|
-
.querySelectorAll("details>summary")
|
|
103
|
-
.forEach((/** @type {HTMLElement} */ el) =>
|
|
104
|
-
el.setAttribute("style", "width: 100%"),
|
|
105
|
-
);
|
|
106
|
-
/** @type {any} */
|
|
107
|
-
(eoxItemFilter.value)?.shadowRoot
|
|
108
|
-
.querySelectorAll("details>div li")
|
|
109
|
-
.forEach((/** @type {HTMLElement} */ res) => {
|
|
110
|
-
let compareButton = document.createElement("button");
|
|
111
|
-
compareButton.className = "compareMapButton";
|
|
112
|
-
compareButton.dataset.id = res.children[0].id;
|
|
113
|
-
|
|
114
|
-
compareButton.onclick = async (
|
|
115
|
-
/** {Event & { currentTarget: HTMLElement }} */ evt,
|
|
116
|
-
) => {
|
|
117
|
-
// reset the style of all compare buttons
|
|
118
|
-
eoxItemFilter.value?.shadowRoot
|
|
119
|
-
?.querySelectorAll(".compareMapButton")
|
|
120
|
-
.forEach((res) => {
|
|
121
|
-
res.setAttribute("style", defaultStyle);
|
|
122
|
-
});
|
|
123
|
-
const currentTarget = /** @type {HTMLElement}*/ (evt.currentTarget);
|
|
124
|
-
currentTarget?.setAttribute("style", highlightStyle);
|
|
125
|
-
const selected = eoxItemFilter.value?.items.find(
|
|
126
|
-
(/** @type {HTMLElement} */ it) =>
|
|
127
|
-
it.id === currentTarget?.dataset.id,
|
|
128
|
-
);
|
|
129
|
-
if (selected) {
|
|
130
|
-
await store.loadSelectedCompareSTAC(selected.href);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
compareButton.setAttribute("style", defaultStyle);
|
|
134
|
-
const svgIcon = document.createElementNS(
|
|
135
|
-
"http://www.w3.org/2000/svg",
|
|
136
|
-
"svg",
|
|
137
|
-
);
|
|
138
|
-
const iconPath = document.createElementNS(
|
|
139
|
-
"http://www.w3.org/2000/svg",
|
|
140
|
-
"path",
|
|
141
|
-
);
|
|
142
|
-
svgIcon.setAttribute("width", "15");
|
|
143
|
-
svgIcon.setAttribute("height", "15");
|
|
144
|
-
svgIcon.setAttribute("viewBox", "0 0 24 24");
|
|
145
|
-
iconPath.setAttribute(
|
|
146
|
-
"d",
|
|
147
|
-
"M19,3H14V5H19V18L14,12V21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10,18H5L10,12M10,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H10V23H12V1H10V3Z",
|
|
148
|
-
);
|
|
149
|
-
svgIcon.appendChild(iconPath);
|
|
150
|
-
compareButton.appendChild(svgIcon);
|
|
151
|
-
res.append(compareButton);
|
|
152
|
-
});
|
|
153
|
-
}, 100);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
onMounted(() => {
|
|
157
|
-
const style = document.createElement("style");
|
|
158
|
-
style.innerHTML = `
|
|
159
|
-
section {
|
|
160
|
-
margin: 0 !important;
|
|
161
|
-
}
|
|
162
|
-
section button#filter-reset {
|
|
163
|
-
padding: 0 8px;
|
|
164
|
-
top: 8px;
|
|
165
|
-
right: 8px;
|
|
166
|
-
}
|
|
167
|
-
`;
|
|
168
|
-
eoxItemFilter.value?.shadowRoot?.appendChild(style);
|
|
169
|
-
|
|
170
|
-
// Only list child elements in list
|
|
171
|
-
const items = store.stac?.filter((item) => item.rel === "child");
|
|
172
|
-
/** @type {any} */
|
|
173
|
-
(eoxItemFilter.value).items = items;
|
|
174
|
-
if (props.enableCompare) {
|
|
175
|
-
injectCompareButtons();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
return (_ctx, _cache) => {
|
|
180
|
-
return (openBlock(), createElementBlock("eox-itemfilter", mergeProps({ class: "fill-height" }, config, {
|
|
181
|
-
ref_key: "eoxItemFilter",
|
|
182
|
-
ref: eoxItemFilter,
|
|
183
|
-
style: {"overflow":"auto"},
|
|
184
|
-
onSelect: onSelect
|
|
185
|
-
}), [
|
|
186
|
-
createElementVNode("h4", _hoisted_1, toDisplayString(__props.filtersTitle), 1 /* TEXT */),
|
|
187
|
-
createElementVNode("h4", _hoisted_2, toDisplayString(__props.resultsTitle), 1 /* TEXT */)
|
|
188
|
-
], 16 /* FULL_PROPS */))
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export { _sfc_main as default };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ref, openBlock, createElementBlock, createBlock, unref, createCommentVNode } from 'vue';
|
|
2
|
-
import { _ as _export_sfc, ab as makePanelTransparent, V as VBtn, ac as availableMapProjection, ad as changeMapProjection } from './asWebComponent-DUUoR7MZ.js';
|
|
3
|
-
import { mdiMapPlus, mdiEarthBox } from '@mdi/js';
|
|
4
|
-
import ExportState from './ExportState-BT8MLAW7.js';
|
|
5
|
-
|
|
6
|
-
const _sfc_main = {
|
|
7
|
-
__name: 'EodashMapBtns',
|
|
8
|
-
props: {
|
|
9
|
-
exportMap: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: true,
|
|
12
|
-
},
|
|
13
|
-
changeProjection: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: true,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
setup(__props) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const showMapState = ref(false);
|
|
23
|
-
|
|
24
|
-
/** @type {import("vue").Ref<HTMLDivElement|null>} */
|
|
25
|
-
const rootRef = ref(null);
|
|
26
|
-
makePanelTransparent(rootRef);
|
|
27
|
-
|
|
28
|
-
return (_ctx, _cache) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return (openBlock(), createElementBlock("div", {
|
|
32
|
-
ref_key: "rootRef",
|
|
33
|
-
ref: rootRef,
|
|
34
|
-
class: "d-flex flex-column align-end justify-end my-3 pa-2"
|
|
35
|
-
}, [
|
|
36
|
-
(__props.exportMap)
|
|
37
|
-
? (openBlock(), createBlock(VBtn, {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "map-btn",
|
|
40
|
-
icon: [unref(mdiMapPlus)],
|
|
41
|
-
onClick: _cache[0] || (_cache[0] = $event => (showMapState.value = !showMapState.value))
|
|
42
|
-
}, null, 8 /* PROPS */, ["icon"]))
|
|
43
|
-
: createCommentVNode("v-if", true),
|
|
44
|
-
(__props.exportMap)
|
|
45
|
-
? (openBlock(), createBlock(ExportState, {
|
|
46
|
-
key: 1,
|
|
47
|
-
modelValue: showMapState.value,
|
|
48
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((showMapState).value = $event))
|
|
49
|
-
}, null, 8 /* PROPS */, ["modelValue"]))
|
|
50
|
-
: createCommentVNode("v-if", true),
|
|
51
|
-
(__props.changeProjection && !!unref(availableMapProjection))
|
|
52
|
-
? (openBlock(), createBlock(VBtn, {
|
|
53
|
-
key: 2,
|
|
54
|
-
class: "map-btn",
|
|
55
|
-
icon: [unref(mdiEarthBox)],
|
|
56
|
-
onClick: _cache[2] || (_cache[2] = $event => (unref(changeMapProjection)(unref(availableMapProjection))))
|
|
57
|
-
}, null, 8 /* PROPS */, ["icon"]))
|
|
58
|
-
: createCommentVNode("v-if", true)
|
|
59
|
-
], 512 /* NEED_PATCH */))
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
const EodashMapBtns = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-d7a01370"]]);
|
|
65
|
-
|
|
66
|
-
export { EodashMapBtns as default };
|