@eodash/eodash 5.0.0-alpha.2.9 → 5.0.0-rc

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 (113) hide show
  1. package/README.md +1 -1
  2. package/core/client/App.vue +13 -1
  3. package/core/client/asWebComponent.js +13 -4
  4. package/core/client/components/DashboardLayout.vue +36 -14
  5. package/core/client/components/Loading.vue +6 -9
  6. package/core/client/components/MobileLayout.vue +16 -14
  7. package/core/client/composables/DefineEodash.js +14 -4
  8. package/core/client/composables/DefineTemplate.js +67 -0
  9. package/core/client/composables/DefineWidgets.js +3 -2
  10. package/core/client/composables/EodashMap.js +360 -0
  11. package/core/client/composables/EodashProcess.js +574 -0
  12. package/core/client/composables/index.js +136 -28
  13. package/core/client/eodash.js +395 -80
  14. package/core/client/eodashSTAC/EodashCollection.js +432 -0
  15. package/core/client/eodashSTAC/createLayers.js +315 -0
  16. package/core/client/eodashSTAC/helpers.js +375 -0
  17. package/core/client/eodashSTAC/triggers.js +43 -0
  18. package/core/client/plugins/axios.js +8 -0
  19. package/core/client/plugins/index.js +2 -1
  20. package/core/client/plugins/vuetify.js +2 -1
  21. package/core/client/store/actions.js +79 -0
  22. package/core/client/store/index.js +4 -18
  23. package/core/client/store/stac.js +99 -9
  24. package/core/client/store/states.js +37 -0
  25. package/core/client/{types.d.ts → types.ts} +66 -20
  26. package/core/client/utils/keys.js +2 -0
  27. package/core/client/utils/states.js +22 -0
  28. package/core/client/views/Dashboard.vue +22 -49
  29. package/core/client/vite-env.d.ts +2 -10
  30. package/dist/client/DashboardLayout-232tRmjz.js +84 -0
  31. package/dist/client/DynamicWebComponent-Cl4LqHU6.js +88 -0
  32. package/dist/client/EodashDatePicker-Pok6bZwU.js +306 -0
  33. package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
  34. package/dist/client/EodashLayerControl-De7IlCm_.js +120 -0
  35. package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
  36. package/dist/client/EodashMap-CMvbfI6-.js +549 -0
  37. package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
  38. package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
  39. package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
  40. package/dist/client/EodashTools-PD3XPYuR.js +103 -0
  41. package/dist/client/ExportState-DOrT7M15.js +644 -0
  42. package/dist/client/Footer-CCigxYBo.js +141 -0
  43. package/dist/client/Header-C2cdx4gb.js +437 -0
  44. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  45. package/dist/client/MobileLayout-BdiFjHg7.js +1207 -0
  46. package/dist/client/PopUp--_xn1Cms.js +410 -0
  47. package/dist/client/VImg-9xu2l99m.js +384 -0
  48. package/dist/client/VMain-BUs3kDTd.js +43 -0
  49. package/dist/client/VOverlay-D89omJis.js +1453 -0
  50. package/dist/client/VTooltip-CDu3bErh.js +86 -0
  51. package/dist/client/WidgetsContainer-aFG9yFT6.js +83 -0
  52. package/dist/client/asWebComponent-BRGyP_j5.js +11943 -0
  53. package/dist/client/{style.css → eo-dash.css} +2 -2
  54. package/dist/client/eo-dash.js +2 -6
  55. package/dist/client/forwardRefs-CYrR6bMw.js +245 -0
  56. package/dist/client/index-BZwk0V42.js +199 -0
  57. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  58. package/dist/client/transition-DG9nRSW4.js +37 -0
  59. package/dist/node/cli.js +4 -4
  60. package/dist/node/types.d.ts +2 -0
  61. package/package.json +73 -38
  62. package/widgets/EodashDatePicker.vue +176 -134
  63. package/widgets/EodashItemFilter.vue +79 -38
  64. package/widgets/EodashLayerControl.vue +111 -0
  65. package/widgets/EodashLayoutSwitcher.vue +36 -0
  66. package/widgets/EodashMap.vue +108 -133
  67. package/widgets/EodashMapBtns.vue +62 -8
  68. package/widgets/EodashProcess.vue +143 -0
  69. package/widgets/EodashStacInfo.vue +82 -0
  70. package/widgets/EodashTools.vue +83 -0
  71. package/widgets/ExportState.vue +17 -13
  72. package/widgets/PopUp.vue +24 -2
  73. package/core/client/SuspensedDashboard.ce.vue +0 -105
  74. package/core/client/asWebComponent.d.ts +0 -23
  75. package/core/client/store/Actions.js +0 -14
  76. package/core/client/store/States.js +0 -16
  77. package/core/client/utils/eodashSTAC.js +0 -249
  78. package/core/client/utils/helpers.js +0 -38
  79. package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
  80. package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
  81. package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
  82. package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
  83. package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
  84. package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
  85. package/dist/client/ExportState-CCzOhppU.js +0 -558
  86. package/dist/client/Footer-BPAND0yG.js +0 -115
  87. package/dist/client/Header-DLhebNvG.js +0 -350
  88. package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
  89. package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
  90. package/dist/client/PopUp-1d2bBFjw.js +0 -300
  91. package/dist/client/VImg-DxHcztfM.js +0 -291
  92. package/dist/client/VMain-BLX5vRRn.js +0 -39
  93. package/dist/client/VOverlay-CvrYEmLu.js +0 -967
  94. package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
  95. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  96. package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
  97. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  98. package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
  99. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  100. package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
  101. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  102. package/dist/client/forwardRefs-BJJiadQP.js +0 -185
  103. package/dist/client/index-Q-bHLjxx.js +0 -153
  104. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  105. package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
  106. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  107. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  108. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  109. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  110. package/dist/client/ssrBoot-yo11mybw.js +0 -17
  111. package/dist/client/transition-CSJhuYGK.js +0 -34
  112. package/dist/client/webfontloader-qotgY98I.js +0 -435
  113. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
@@ -6,16 +6,8 @@ declare module "*.vue" {
6
6
  export default component;
7
7
  }
8
8
  declare interface Window {
9
- eodashStore: import("@/types").EodashStore;
10
- }
11
- declare module "@eox/stacinfo" {
12
- export const EOxStacInfo: CustomElementConstructor;
13
- }
14
- declare module "@eox/map" {
15
- export const EOxMap: CustomElementConstructor;
16
- }
17
- declare module "@eox/itemfilter" {
18
- export const EOxItemFilter: CustomElementConstructor;
9
+ eodashStore: typeof import("@/store").default;
10
+ setEodashLoglevel: typeof import("loglevel").setLevel;
19
11
  }
20
12
  declare module "user:config" {
21
13
  const eodash: import("@/types").Eodash | Promise<import("@/types").Eodash>;
@@ -0,0 +1,84 @@
1
+ import { openBlock, createBlock, withCtx, createElementVNode, unref, normalizeStyle, createElementBlock, Suspense, resolveDynamicComponent, mergeProps, createCommentVNode, Fragment, renderList, Transition } from 'vue';
2
+ import '@eox/layout';
3
+ import { _ as _export_sfc, F as useDefineTemplate } from './asWebComponent-BRGyP_j5.js';
4
+ import { V as VMain } from './VMain-BUs3kDTd.js';
5
+
6
+ const _hoisted_1 = ["gap"];
7
+ const _hoisted_2 = ["id", "h", "w", "x", "y"];
8
+
9
+
10
+ const _sfc_main = {
11
+ __name: 'DashboardLayout',
12
+ setup(__props) {
13
+
14
+ const { bgWidget, importedWidgets, gap } = useDefineTemplate();
15
+
16
+ return (_ctx, _cache) => {
17
+
18
+
19
+ return (openBlock(), createBlock(VMain, null, {
20
+ default: withCtx(() => [
21
+ createElementVNode("eox-layout", {
22
+ gap: unref(gap),
23
+ style: normalizeStyle(`padding: ${unref(gap)}px`)
24
+ }, [
25
+ (unref(bgWidget)?.component)
26
+ ? (openBlock(), createElementBlock("eox-layout-item", {
27
+ key: 0,
28
+ class: "bg-panel bg-surface",
29
+ style: normalizeStyle(`margin: -${unref(gap) + 1}px;`),
30
+ x: "0",
31
+ y: "0",
32
+ h: "12",
33
+ w: "12"
34
+ }, [
35
+ (openBlock(), createBlock(Suspense, { suspensible: "" }, {
36
+ default: withCtx(() => [
37
+ (openBlock(), createBlock(resolveDynamicComponent(unref(bgWidget)?.component), mergeProps({ id: "bg-widget" }, unref(bgWidget)?.props), null, 16 /* FULL_PROPS */))
38
+ ]),
39
+ _: 1 /* STABLE */
40
+ }))
41
+ ], 4 /* STYLE */))
42
+ : createCommentVNode("v-if", true),
43
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(importedWidgets), (importedWidget, idx) => {
44
+ return (openBlock(), createBlock(Transition, {
45
+ key: idx,
46
+ name: "fade"
47
+ }, {
48
+ default: withCtx(() => [
49
+ (importedWidget.value.component)
50
+ ? (openBlock(), createElementBlock("eox-layout-item", {
51
+ id: importedWidget.value.id.toString(),
52
+ key: importedWidget.value.id,
53
+ class: "panel bg-surface",
54
+ h: importedWidget.value.layout.h,
55
+ w: importedWidget.value.layout.w,
56
+ x: importedWidget.value.layout.x,
57
+ y: importedWidget.value.layout.y
58
+ }, [
59
+ (openBlock(), createBlock(Suspense, { suspensible: "" }, {
60
+ default: withCtx(() => [
61
+ (openBlock(), createBlock(resolveDynamicComponent(importedWidget.value.component), mergeProps({
62
+ key: importedWidget.value.id,
63
+ ref_for: true
64
+ }, importedWidget.value.props), null, 16 /* FULL_PROPS */))
65
+ ]),
66
+ _: 2 /* DYNAMIC */
67
+ }, 1024 /* DYNAMIC_SLOTS */))
68
+ ], 8 /* PROPS */, _hoisted_2))
69
+ : createCommentVNode("v-if", true)
70
+ ]),
71
+ _: 2 /* DYNAMIC */
72
+ }, 1024 /* DYNAMIC_SLOTS */))
73
+ }), 128 /* KEYED_FRAGMENT */))
74
+ ], 12 /* STYLE, PROPS */, _hoisted_1)
75
+ ]),
76
+ _: 1 /* STABLE */
77
+ }))
78
+ }
79
+ }
80
+
81
+ };
82
+ const DashboardLayout = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-ebeeb1d1"]]);
83
+
84
+ export { DashboardLayout as default };
@@ -0,0 +1,88 @@
1
+ import { withAsyncContext, ref, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
+ import { $ as useSTAcStore } from './asWebComponent-BRGyP_j5.js';
3
+
4
+ const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
5
+
6
+
7
+ const _sfc_main = {
8
+ __name: 'DynamicWebComponent',
9
+ props: {
10
+ link: {
11
+ type: [String, Function],
12
+ required: true,
13
+ },
14
+ constructorProp: String,
15
+ tagName: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ properties: {
20
+ type: Object,
21
+ default: () => {
22
+ return {};
23
+ },
24
+ },
25
+ onMounted: Function,
26
+ onUnmounted: Function,
27
+ },
28
+ async setup(__props) {
29
+
30
+ let __temp, __restore;
31
+
32
+ const props = /** @type {import("@/types").WebComponentProps} */ (
33
+ __props
34
+ );
35
+
36
+ const getWebComponent = async () =>
37
+ typeof props.link === "string"
38
+ ? await import(/* @vite-ignore */ props.link)
39
+ : await props.link();
40
+
41
+ const imported = !customElements.get(props.tagName)
42
+ ? (
43
+ ([__temp,__restore] = withAsyncContext(() => getWebComponent().catch((e) => {
44
+ console.error(e);
45
+ }))),
46
+ __temp = await __temp,
47
+ __restore(),
48
+ __temp
49
+ )
50
+ : null;
51
+
52
+ const defined = customElements.get(props.tagName);
53
+
54
+ // if the imported link doesn't define the custom tag provided
55
+ if (!defined && props.constructorProp) {
56
+ const Constructor = imported[props.constructorProp];
57
+ customElements.define(props.tagName, Constructor);
58
+ }
59
+
60
+ const store = useSTAcStore();
61
+
62
+ /**
63
+ * @typedef {HTMLElement & Record<string | number | symbol, unknown>} CustomElement
64
+ * @type {import("vue").Ref<CustomElement | null>}
65
+ */
66
+ const elementRef = ref(null);
67
+
68
+ onMounted(() => {
69
+ props.onMounted?.(elementRef.value, store);
70
+ });
71
+
72
+ onUnmounted(() => {
73
+ props.onUnmounted?.(elementRef.value, store);
74
+ });
75
+
76
+ return (_ctx, _cache) => {
77
+ return (openBlock(), createElementBlock("span", _hoisted_1, [
78
+ (openBlock(), createBlock(resolveDynamicComponent(__props.tagName), mergeProps(__props.properties, {
79
+ ref_key: "elementRef",
80
+ ref: elementRef
81
+ }), null, 16 /* FULL_PROPS */))
82
+ ]))
83
+ }
84
+ }
85
+
86
+ };
87
+
88
+ export { _sfc_main as default };
@@ -0,0 +1,306 @@
1
+ import { resolveComponent, render, h, mergeProps, customRef, ref, reactive, toRef, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, withDirectives, createBlock, createCommentVNode } from 'vue';
2
+ import { DatePicker } from 'v-calendar';
3
+ import { E as isObject, Y as consoleError, Z as datetime, $ as useSTAcStore, a0 as eodashCollections, a1 as makePanelTransparent, V as VBtn, y as VIcon } from './asWebComponent-BRGyP_j5.js';
4
+ import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
5
+ import log from 'loglevel';
6
+ import { V as VTooltip } from './VTooltip-CDu3bErh.js';
7
+
8
+ // Utilities
9
+ function useDirectiveComponent(component, props) {
10
+ const concreteComponent = typeof component === 'string' ? resolveComponent(component) : component;
11
+ const hook = mountComponent(concreteComponent, props);
12
+ return {
13
+ mounted: hook,
14
+ updated: hook,
15
+ unmounted(el) {
16
+ render(null, el);
17
+ }
18
+ };
19
+ }
20
+ function mountComponent(component, props) {
21
+ return function (el, binding, vnode) {
22
+ const _props = typeof props === 'function' ? props(binding) : props;
23
+ const text = binding.value?.text ?? binding.value ?? _props?.text;
24
+ const value = isObject(binding.value) ? binding.value : {};
25
+
26
+ // Get the children from the props or directive value, or the element's children
27
+ const children = () => text ?? el.textContent;
28
+
29
+ // If vnode.ctx is the same as the instance, then we're bound to a plain element
30
+ // and need to find the nearest parent component instance to inherit provides from
31
+ const provides = (vnode.ctx === binding.instance.$ ? findComponentParent(vnode, binding.instance.$)?.provides : vnode.ctx?.provides) ?? binding.instance.$.provides;
32
+ const node = h(component, mergeProps(_props, value), children);
33
+ node.appContext = Object.assign(Object.create(null), binding.instance.$.appContext, {
34
+ provides
35
+ });
36
+ render(node, el);
37
+ };
38
+ }
39
+ function findComponentParent(vnode, root) {
40
+ // Walk the tree from root until we find the child vnode
41
+ const stack = new Set();
42
+ const walk = children => {
43
+ for (const child of children) {
44
+ if (!child) continue;
45
+ if (child === vnode || child.el && vnode.el && child.el === vnode.el) {
46
+ return true;
47
+ }
48
+ stack.add(child);
49
+ let result;
50
+ if (child.suspense) {
51
+ result = walk([child.ssContent]);
52
+ } else if (Array.isArray(child.children)) {
53
+ result = walk(child.children);
54
+ } else if (child.component?.vnode) {
55
+ result = walk([child.component?.subTree]);
56
+ }
57
+ if (result) {
58
+ return result;
59
+ }
60
+ stack.delete(child);
61
+ }
62
+ return false;
63
+ };
64
+ if (!walk([root.subTree])) {
65
+ consoleError('Could not find original vnode, component will not inherit provides');
66
+ return root;
67
+ }
68
+
69
+ // Return the first component parent
70
+ const result = Array.from(stack).reverse();
71
+ for (const child of result) {
72
+ if (child.component) {
73
+ return child.component;
74
+ }
75
+ }
76
+ return root;
77
+ }
78
+
79
+ // Components
80
+ const Tooltip = useDirectiveComponent(VTooltip, binding => {
81
+ return {
82
+ activator: 'parent',
83
+ location: binding.arg?.replace('-', ' '),
84
+ text: typeof binding.value === 'boolean' ? undefined : binding.value
85
+ };
86
+ });
87
+
88
+ const _hoisted_1 = { class: "d-flex flex-row align-center justify-center pb-1" };
89
+ const _hoisted_2 = {
90
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
91
+ style: {"margin":"2px"}
92
+ };
93
+ const _hoisted_3 = ["value"];
94
+
95
+ // holds the number value of the datetime
96
+
97
+ const _sfc_main = {
98
+ __name: 'EodashDatePicker',
99
+ props: {
100
+ hintText: {
101
+ type: String,
102
+ default: null,
103
+ },
104
+ hideArrows: {
105
+ type: Boolean,
106
+ default: false,
107
+ },
108
+ hideInputField: {
109
+ type: Boolean,
110
+ default: false,
111
+ },
112
+ },
113
+ setup(__props) {
114
+
115
+ const currentDate = customRef((track, trigger) => ({
116
+ get() {
117
+ track();
118
+ return new Date(datetime.value).getTime();
119
+ },
120
+ /** @param {number} num */
121
+ set(num) {
122
+ trigger();
123
+ log.debug("Datepicker setting currentDate", datetime.value);
124
+ datetime.value = new Date(num).toISOString();
125
+ },
126
+ }));
127
+
128
+ const masks = ref({
129
+ input: "YYYY-MM-DD",
130
+ });
131
+
132
+
133
+
134
+ /**
135
+ * Attributes displayed on datepicker
136
+ *
137
+ * @type {import("vue").Reactive<
138
+ * (
139
+ * | Partial<import("v-calendar/dist/types/src/utils/attribute").AttributeConfig>
140
+ * | undefined
141
+ * )[]
142
+ * >}
143
+ */
144
+ const attributes = reactive([]);
145
+
146
+ /** @type {import("vue").Ref<HTMLDivElement|null>} */
147
+ const rootRef = ref(null);
148
+
149
+ const selectedStac = toRef(useSTAcStore(), "selectedStac");
150
+
151
+ watch(
152
+ selectedStac,
153
+ async (updatedStac, previousStac) => {
154
+ if (updatedStac && previousStac?.id !== updatedStac.id) {
155
+ log.debug("Datepicker selected STAC change triggered");
156
+ const wongPalette = [
157
+ "#009E73",
158
+ "#0072B2",
159
+ "#E69F00",
160
+ "#CC79A7",
161
+ "#56B4E9",
162
+ "#D55E00",
163
+ ];
164
+ // remove old values
165
+ attributes.splice(0, attributes.length);
166
+
167
+ for (let idx = 0; idx < eodashCollections.length; idx++) {
168
+ log.debug("Retrieving dates", eodashCollections[idx]);
169
+ await eodashCollections[idx].fetchCollection();
170
+ const dates = [
171
+ ...new Set(
172
+ eodashCollections[idx].getItems()?.reduce((valid, it) => {
173
+ const parsed = Date.parse(/** @type {string} */ (it.datetime));
174
+ if (parsed) {
175
+ valid.push(new Date(parsed));
176
+ }
177
+ return valid;
178
+ }, /** @type {Date[]} */ ([])),
179
+ ),
180
+ ];
181
+ attributes.push({
182
+ key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
183
+ bar: {
184
+ style: {
185
+ backgroundColor: wongPalette[idx % wongPalette.length],
186
+ },
187
+ },
188
+ dates,
189
+ content: {
190
+ style: {
191
+ color: "#000000",
192
+ "font-weight": "bold",
193
+ },
194
+ },
195
+ });
196
+ }
197
+ }
198
+ },
199
+ { immediate: true },
200
+ );
201
+
202
+ /**
203
+ * @param {boolean} reverse
204
+ */
205
+ function jumpDate(reverse) {
206
+ if (attributes.length) {
207
+ let latestDateMS = reverse ? Infinity : -Infinity;
208
+ attributes.forEach((coll) => {
209
+ if (coll?.dates) {
210
+ coll.dates.forEach((d) => {
211
+ // TODO: we need to handle time ranges and other options here
212
+ if (d instanceof Date) {
213
+ const mathFun = reverse ? "min" : "max";
214
+ latestDateMS = Math[mathFun](latestDateMS, d.getTime());
215
+ }
216
+ });
217
+ }
218
+ });
219
+ currentDate.value =
220
+ latestDateMS === -Infinity
221
+ ? Date.now()
222
+ : latestDateMS === Infinity
223
+ ? 0
224
+ : latestDateMS;
225
+ }
226
+ }
227
+
228
+ makePanelTransparent(rootRef);
229
+
230
+ return (_ctx, _cache) => {
231
+
232
+
233
+
234
+
235
+ return (openBlock(), createElementBlock("div", {
236
+ ref_key: "rootRef",
237
+ ref: rootRef,
238
+ class: "datePicker"
239
+ }, [
240
+ createVNode(unref(DatePicker), {
241
+ modelValue: currentDate.value,
242
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((currentDate).value = $event)),
243
+ modelModifiers: { number: true },
244
+ attributes: attributes,
245
+ masks: masks.value,
246
+ expanded: "",
247
+ class: "bg-surface overflow-auto",
248
+ style: {"background-color":"transparent","max-width":"100%"}
249
+ }, {
250
+ footer: withCtx(() => [
251
+ createElementVNode("div", _hoisted_1, [
252
+ (!__props.hideArrows)
253
+ ? withDirectives((openBlock(), createBlock(VBtn, {
254
+ key: 0,
255
+ density: "compact",
256
+ variant: "text",
257
+ onClick: _cache[0] || (_cache[0] = $event => (jumpDate(true)))
258
+ }, {
259
+ default: withCtx(() => [
260
+ createVNode(VIcon, {
261
+ icon: [unref(mdiRayEndArrow)]
262
+ }, null, 8 /* PROPS */, ["icon"])
263
+ ]),
264
+ _: 1 /* STABLE */
265
+ })), [
266
+ [Tooltip, 'Set date to oldest available dataset', "bottom"]
267
+ ])
268
+ : createCommentVNode("v-if", true),
269
+ createElementVNode("div", _hoisted_2, [
270
+ (!__props.hideInputField)
271
+ ? (openBlock(), createElementBlock("input", {
272
+ key: 0,
273
+ value: new Date(currentDate.value).toLocaleDateString(),
274
+ style: {"margin":"1px"},
275
+ class: "flex-grow px-1 py-1 dark:bg-gray-700"
276
+ }, null, 8 /* PROPS */, _hoisted_3))
277
+ : createCommentVNode("v-if", true)
278
+ ]),
279
+ (!__props.hideArrows)
280
+ ? withDirectives((openBlock(), createBlock(VBtn, {
281
+ key: 1,
282
+ density: "compact",
283
+ variant: "text",
284
+ onClick: _cache[1] || (_cache[1] = $event => (jumpDate(false)))
285
+ }, {
286
+ default: withCtx(() => [
287
+ createVNode(VIcon, {
288
+ icon: [unref(mdiRayStartArrow)]
289
+ }, null, 8 /* PROPS */, ["icon"])
290
+ ]),
291
+ _: 1 /* STABLE */
292
+ })), [
293
+ [Tooltip, 'Set date to latest available dataset', "bottom"]
294
+ ])
295
+ : createCommentVNode("v-if", true)
296
+ ])
297
+ ]),
298
+ _: 1 /* STABLE */
299
+ }, 8 /* PROPS */, ["modelValue", "attributes", "masks"])
300
+ ], 512 /* NEED_PATCH */))
301
+ }
302
+ }
303
+
304
+ };
305
+
306
+ export { _sfc_main as default };
@@ -0,0 +1,151 @@
1
+ import { computed, ref, openBlock, createElementBlock, mergeProps, unref, createElementVNode, toDisplayString } from 'vue';
2
+ import { t as useDisplay, $ as useSTAcStore } from './asWebComponent-BRGyP_j5.js';
3
+ import '@eox/itemfilter';
4
+
5
+ const _hoisted_1 = [".items"];
6
+ const _hoisted_2 = {
7
+ slot: "filterstitle",
8
+ style: {"margin":"14px 8px"}
9
+ };
10
+ const _hoisted_3 = {
11
+ slot: "resultstitle",
12
+ style: {"margin":"14px 8px"}
13
+ };
14
+
15
+
16
+ const _sfc_main = {
17
+ __name: 'EodashItemFilter',
18
+ props: {
19
+ enableCompare: {
20
+ type: Boolean,
21
+ default: false,
22
+ },
23
+ filtersTitle: {
24
+ type: String,
25
+ default: "Indicators",
26
+ },
27
+ resultsTitle: {
28
+ type: String,
29
+ default: "Results",
30
+ },
31
+ titleProperty: {
32
+ type: String,
33
+ default: "title",
34
+ },
35
+ aggregateResults: {
36
+ type: String,
37
+ default: undefined,
38
+ },
39
+ imageProperty: {
40
+ type: String,
41
+ default: "",
42
+ },
43
+ subTitleProperty: {
44
+ type: String,
45
+ default: "",
46
+ },
47
+ resultType: {
48
+ type: String,
49
+ default: "",
50
+ },
51
+ cssVars: {
52
+ type: [String, Object],
53
+ default: "",
54
+ },
55
+ enableHighlighting: { type: Boolean, default: true },
56
+ expandMultipleFilters: { type: Boolean, default: true },
57
+ expandMultipleResults: { type: Boolean, default: true },
58
+ filterProperties: {
59
+ /** @type {import("vue").PropType<{
60
+ * keys:string[];
61
+ * title:string;
62
+ * type:string;
63
+ * expanded?:boolean
64
+ * }[]> }*/
65
+ type: Array,
66
+ default: () => [
67
+ {
68
+ keys: ["title", "themes", "description"],
69
+ title: "Search",
70
+ type: "text",
71
+ },
72
+ {
73
+ key: "themes",
74
+ title: "Theme Filter",
75
+ type: "multiselect",
76
+ },
77
+ ],
78
+ },
79
+ },
80
+ emits: ["select"],
81
+ setup(__props, { emit: __emit }) {
82
+
83
+ const emit = __emit;
84
+
85
+ const props = __props;
86
+ /**
87
+ * @param {import("stac-ts").StacLink} item
88
+ */
89
+ const selectIndicator = async (item) => {
90
+ if (item) {
91
+ // Reset compare stac to empty
92
+ store.resetSelectedCompareSTAC();
93
+ await store.loadSelectedSTAC(item.href);
94
+ emit("select", item);
95
+ } else {
96
+ store.selectedStac = null;
97
+ }
98
+ };
99
+ /**
100
+ * @param {import("stac-ts").StacLink} item
101
+ */
102
+ const selectCompareIndicator = (item) => {
103
+ if (item) {
104
+ store.loadSelectedCompareSTAC(item.href);
105
+ emit("select", item);
106
+ }
107
+ };
108
+ /** @param {any} evt*/
109
+ const onSelect = async (evt) => {
110
+ const item = /** @type {import('stac-ts').StacLink} */ evt.detail;
111
+ if (props.enableCompare) {
112
+ selectCompareIndicator(item);
113
+ } else {
114
+ selectIndicator(item);
115
+ }
116
+ };
117
+ const { smAndDown } = useDisplay();
118
+ const config = computed(() => ({
119
+ titleProperty: props.titleProperty,
120
+ enableHighlighting: props.enableHighlighting,
121
+ expandMultipleFilters: props.expandMultipleFilters,
122
+ expandMultipleResults: props.expandMultipleResults,
123
+ subTitleProperty: props.subTitleProperty,
124
+ resultType: props.resultType,
125
+ imageProperty: props.imageProperty,
126
+ aggregateResults: props.aggregateResults,
127
+ style: props.cssVars,
128
+ filterProperties: smAndDown.value ? "" : props.filterProperties,
129
+ }));
130
+ /** @type {import("vue").Ref<HTMLElement & Record<string,any> | null>} */
131
+ const eoxItemFilter = ref(null);
132
+
133
+ const store = useSTAcStore();
134
+
135
+ return (_ctx, _cache) => {
136
+ return (openBlock(), createElementBlock("eox-itemfilter", mergeProps({ class: "fill-height" }, config.value, {
137
+ ref_key: "eoxItemFilter",
138
+ ref: eoxItemFilter,
139
+ style: {"overflow":"auto","--background-color":"none"},
140
+ onSelect: onSelect,
141
+ ".items": unref(store).stac?.filter((item) => item.rel === "child")
142
+ }), [
143
+ createElementVNode("h4", _hoisted_2, toDisplayString(__props.filtersTitle), 1 /* TEXT */),
144
+ createElementVNode("h4", _hoisted_3, toDisplayString(__props.resultsTitle), 1 /* TEXT */)
145
+ ], 48 /* FULL_PROPS, NEED_HYDRATION */, _hoisted_1))
146
+ }
147
+ }
148
+
149
+ };
150
+
151
+ export { _sfc_main as default };