@eodash/eodash 5.0.0-alpha.2.8 → 5.0.0-processing

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 (138) hide show
  1. package/README.md +1 -1
  2. package/core/client/App.vue +13 -1
  3. package/core/client/asWebComponent.js +13 -3
  4. package/core/client/components/DashboardLayout.vue +6 -2
  5. package/core/client/composables/DefineEodash.js +1 -1
  6. package/core/client/composables/EodashMap.js +349 -0
  7. package/core/client/composables/EodashProcess.js +575 -0
  8. package/core/client/composables/index.js +107 -24
  9. package/core/client/eodash.js +83 -10
  10. package/core/client/plugins/axios.js +8 -0
  11. package/core/client/plugins/index.js +2 -1
  12. package/core/client/store/Actions.js +63 -12
  13. package/core/client/store/States.js +19 -0
  14. package/core/client/store/stac.js +98 -8
  15. package/core/client/types.d.ts +25 -18
  16. package/core/client/utils/createLayers.js +313 -0
  17. package/core/client/utils/eodashSTAC.js +320 -170
  18. package/core/client/utils/helpers.js +369 -9
  19. package/core/client/utils/keys.js +2 -0
  20. package/core/client/utils/states.js +17 -0
  21. package/core/client/views/Dashboard.vue +17 -46
  22. package/core/client/vite-env.d.ts +1 -9
  23. package/dist/client/DashboardLayout-CVMJ4l8M.js +87 -0
  24. package/dist/client/DynamicWebComponent-Cv8n457T.js +88 -0
  25. package/dist/client/EodashDatePicker-VVkiPmpc.js +394 -0
  26. package/dist/client/EodashItemFilter-CugWNQ86.js +194 -0
  27. package/dist/client/EodashLayerControl-53WghA8G.js +110 -0
  28. package/dist/client/EodashMap-CQnOePpy.js +486 -0
  29. package/dist/client/EodashMapBtns-uaRwFtfB.js +66 -0
  30. package/dist/client/EodashProcess-cF0unIy8.js +1477 -0
  31. package/dist/client/ExportState-BT8MLAW7.js +644 -0
  32. package/dist/client/Footer-C6GUG84G.js +141 -0
  33. package/dist/client/Header-D2dtCWp8.js +437 -0
  34. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  35. package/dist/client/MobileLayout-BAo8Wr8T.js +1210 -0
  36. package/dist/client/PopUp-Bm01q7Ko.js +389 -0
  37. package/dist/client/VImg-B8AbetCE.js +384 -0
  38. package/dist/client/VMain-DnGlQUyr.js +43 -0
  39. package/dist/client/VOverlay-B8Qj7LRG.js +1453 -0
  40. package/dist/client/WidgetsContainer-CwXRRLS1.js +83 -0
  41. package/dist/client/asWebComponent-DUUoR7MZ.js +11621 -0
  42. package/dist/client/eo-dash.js +2 -6
  43. package/dist/client/forwardRefs-CZJhEAKW.js +245 -0
  44. package/dist/client/index-DlIO7sJ3.js +199 -0
  45. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  46. package/dist/client/style.css +2 -2
  47. package/dist/client/transition-BiR8wMn1.js +37 -0
  48. package/dist/node/cli.js +4 -4
  49. package/dist/node/types.d.ts +2 -0
  50. package/dist/types/core/client/App.vue.d.ts +7 -0
  51. package/dist/types/core/client/asWebComponent.d.ts +9 -0
  52. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -0
  53. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +18 -0
  54. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
  55. package/dist/types/core/client/components/Footer.vue.d.ts +2 -0
  56. package/dist/types/core/client/components/Header.vue.d.ts +2 -0
  57. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +7 -0
  58. package/dist/types/core/client/components/Loading.vue.d.ts +2 -0
  59. package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -0
  60. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -0
  61. package/dist/types/core/client/composables/DefineTemplate.d.ts +15 -0
  62. package/dist/types/core/client/composables/DefineWidgets.d.ts +14 -0
  63. package/dist/types/core/client/composables/EodashMap.d.ts +5 -0
  64. package/dist/types/core/client/composables/index.d.ts +30 -0
  65. package/dist/types/core/client/eodash.d.ts +8 -0
  66. package/dist/types/core/client/main.d.ts +2 -0
  67. package/dist/types/core/client/plugins/axios.d.ts +2 -0
  68. package/dist/types/core/client/plugins/index.d.ts +3 -0
  69. package/dist/types/core/client/plugins/vuetify.d.ts +82 -0
  70. package/dist/types/core/client/render.d.ts +1 -0
  71. package/dist/types/core/client/store/Actions.d.ts +12 -0
  72. package/dist/types/core/client/store/States.d.ts +22 -0
  73. package/dist/types/core/client/store/index.d.ts +2 -0
  74. package/dist/types/core/client/store/stac.d.ts +25 -0
  75. package/dist/types/core/client/types.d.ts +279 -0
  76. package/dist/types/core/client/utils/createLayers.d.ts +45 -0
  77. package/dist/types/core/client/utils/eodashSTAC.d.ts +82 -0
  78. package/dist/types/core/client/utils/helpers.d.ts +84 -0
  79. package/dist/types/core/client/utils/index.d.ts +2 -0
  80. package/dist/types/core/client/utils/keys.d.ts +6 -0
  81. package/dist/types/core/client/utils/states.d.ts +14 -0
  82. package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
  83. package/dist/types/widgets/EodashDatePicker.vue.d.ts +7 -0
  84. package/dist/types/widgets/EodashItemFilter.vue.d.ts +42 -0
  85. package/dist/types/widgets/EodashLayerControl.vue.d.ts +11 -0
  86. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +9 -0
  87. package/dist/types/widgets/EodashMap.vue.d.ts +7 -0
  88. package/dist/types/widgets/EodashMapBtns.vue.d.ts +11 -0
  89. package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
  90. package/dist/types/widgets/EodashTools.vue.d.ts +15 -0
  91. package/dist/types/widgets/ExportState.vue.d.ts +7 -0
  92. package/dist/types/widgets/PopUp.vue.d.ts +22 -0
  93. package/dist/types/widgets/WidgetsContainer.vue.d.ts +7 -0
  94. package/package.json +58 -37
  95. package/widgets/EodashDatePicker.vue +128 -100
  96. package/widgets/EodashItemFilter.vue +149 -47
  97. package/widgets/EodashLayerControl.vue +98 -0
  98. package/widgets/EodashMap.vue +98 -122
  99. package/widgets/EodashMapBtns.vue +24 -7
  100. package/widgets/EodashProcess.vue +151 -0
  101. package/widgets/ExportState.vue +15 -11
  102. package/core/client/SuspensedDashboard.ce.vue +0 -105
  103. package/dist/client/DashboardLayout-CKOExc7r.js +0 -156
  104. package/dist/client/DynamicWebComponent-m1Zbbw6n.js +0 -57
  105. package/dist/client/EodashDatePicker-CGdJRGZJ.js +0 -252
  106. package/dist/client/EodashItemFilter-BjM_LHaE.js +0 -63
  107. package/dist/client/EodashMap-61UMC8sv.js +0 -86917
  108. package/dist/client/EodashMapBtns-DVITfAFx.js +0 -36
  109. package/dist/client/ExportState-DhpK09GR.js +0 -558
  110. package/dist/client/Footer-CIwjaddz.js +0 -115
  111. package/dist/client/Header-BcM-pZFi.js +0 -350
  112. package/dist/client/IframeWrapper-CAe6HPqe.js +0 -19
  113. package/dist/client/MobileLayout-DcZOQX8r.js +0 -945
  114. package/dist/client/PopUp-DCaITceG.js +0 -300
  115. package/dist/client/VImg-C-I_7puM.js +0 -291
  116. package/dist/client/VMain-Cd3P0YTG.js +0 -39
  117. package/dist/client/VOverlay-AcvFgk39.js +0 -967
  118. package/dist/client/WidgetsContainer-B0-q0EMO.js +0 -129
  119. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  120. package/dist/client/asWebComponent-zuKR9I1w.js +0 -20361
  121. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  122. package/dist/client/decoder-CP4lv0Kb-DdKalImK.js +0 -10
  123. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  124. package/dist/client/eodashSTAC-DGB50vNk.js +0 -2788
  125. package/dist/client/eox-itemfilter-TaBxgqq_.js +0 -7565
  126. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  127. package/dist/client/forwardRefs-BnxE4iKQ.js +0 -185
  128. package/dist/client/index-hSIi5Ygk.js +0 -153
  129. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  130. package/dist/client/lerc-DzVumYtB-cTUap6k_.js +0 -1027
  131. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  132. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  133. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  134. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  135. package/dist/client/ssrBoot-D3KF5Thc.js +0 -17
  136. package/dist/client/transition-D3a4tiJv.js +0 -34
  137. package/dist/client/webfontloader-qotgY98I.js +0 -435
  138. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
@@ -0,0 +1,88 @@
1
+ import { withAsyncContext, ref, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
+ import { a0 as useSTAcStore } from './asWebComponent-DUUoR7MZ.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,394 @@
1
+ import { computed, ref, mergeProps, createVNode, resolveComponent, render, h, useCssVars, customRef, reactive, watch, onMounted, openBlock, createElementBlock, Fragment, unref, createSlots, withCtx, createElementVNode, toHandlers, withDirectives, createBlock } from 'vue';
2
+ import { DatePicker } from 'v-calendar';
3
+ import { storeToRefs } from 'pinia';
4
+ import { p as propsFactory, o as omit, g as genericComponent, j as useProxiedModel, Y as getUid, a as useRender, E as isObject, Z as consoleError, $ as datetime, a0 as useSTAcStore, a1 as eodashCollections, a2 as VRow, V as VBtn, y as VIcon } from './asWebComponent-DUUoR7MZ.js';
5
+ import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
6
+ import log from 'loglevel';
7
+ import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-B8Qj7LRG.js';
8
+ import { b as useScopeId, f as forwardRefs } from './forwardRefs-CZJhEAKW.js';
9
+
10
+ const makeVTooltipProps = propsFactory({
11
+ id: String,
12
+ text: String,
13
+ ...omit(makeVOverlayProps({
14
+ closeOnBack: false,
15
+ location: 'end',
16
+ locationStrategy: 'connected',
17
+ eager: true,
18
+ minWidth: 0,
19
+ offset: 10,
20
+ openOnClick: false,
21
+ openOnHover: true,
22
+ origin: 'auto',
23
+ scrim: false,
24
+ scrollStrategy: 'reposition',
25
+ transition: false
26
+ }), ['absolute', 'persistent'])
27
+ }, 'VTooltip');
28
+ const VTooltip = genericComponent()({
29
+ name: 'VTooltip',
30
+ props: makeVTooltipProps(),
31
+ emits: {
32
+ 'update:modelValue': value => true
33
+ },
34
+ setup(props, _ref) {
35
+ let {
36
+ slots
37
+ } = _ref;
38
+ const isActive = useProxiedModel(props, 'modelValue');
39
+ const {
40
+ scopeId
41
+ } = useScopeId();
42
+ const uid = getUid();
43
+ const id = computed(() => props.id || `v-tooltip-${uid}`);
44
+ const overlay = ref();
45
+ const location = computed(() => {
46
+ return props.location.split(' ').length > 1 ? props.location : props.location + ' center';
47
+ });
48
+ const origin = computed(() => {
49
+ return props.origin === 'auto' || props.origin === 'overlap' || props.origin.split(' ').length > 1 || props.location.split(' ').length > 1 ? props.origin : props.origin + ' center';
50
+ });
51
+ const transition = computed(() => {
52
+ if (props.transition) return props.transition;
53
+ return isActive.value ? 'scale-transition' : 'fade-transition';
54
+ });
55
+ const activatorProps = computed(() => mergeProps({
56
+ 'aria-describedby': id.value
57
+ }, props.activatorProps));
58
+ useRender(() => {
59
+ const overlayProps = VOverlay.filterProps(props);
60
+ return createVNode(VOverlay, mergeProps({
61
+ "ref": overlay,
62
+ "class": ['v-tooltip', props.class],
63
+ "style": props.style,
64
+ "id": id.value
65
+ }, overlayProps, {
66
+ "modelValue": isActive.value,
67
+ "onUpdate:modelValue": $event => isActive.value = $event,
68
+ "transition": transition.value,
69
+ "absolute": true,
70
+ "location": location.value,
71
+ "origin": origin.value,
72
+ "persistent": true,
73
+ "role": "tooltip",
74
+ "activatorProps": activatorProps.value,
75
+ "_disableGlobalStack": true
76
+ }, scopeId), {
77
+ activator: slots.activator,
78
+ default: function () {
79
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
+ args[_key] = arguments[_key];
81
+ }
82
+ return slots.default?.(...args) ?? props.text;
83
+ }
84
+ });
85
+ });
86
+ return forwardRefs({}, overlay);
87
+ }
88
+ });
89
+
90
+ // Utilities
91
+ function useDirectiveComponent(component, props) {
92
+ const concreteComponent = typeof component === 'string' ? resolveComponent(component) : component;
93
+ const hook = mountComponent(concreteComponent, props);
94
+ return {
95
+ mounted: hook,
96
+ updated: hook,
97
+ unmounted(el) {
98
+ render(null, el);
99
+ }
100
+ };
101
+ }
102
+ function mountComponent(component, props) {
103
+ return function (el, binding, vnode) {
104
+ const _props = typeof props === 'function' ? props(binding) : props;
105
+ const text = binding.value?.text ?? binding.value ?? _props?.text;
106
+ const value = isObject(binding.value) ? binding.value : {};
107
+
108
+ // Get the children from the props or directive value, or the element's children
109
+ const children = () => text ?? el.textContent;
110
+
111
+ // If vnode.ctx is the same as the instance, then we're bound to a plain element
112
+ // and need to find the nearest parent component instance to inherit provides from
113
+ const provides = (vnode.ctx === binding.instance.$ ? findComponentParent(vnode, binding.instance.$)?.provides : vnode.ctx?.provides) ?? binding.instance.$.provides;
114
+ const node = h(component, mergeProps(_props, value), children);
115
+ node.appContext = Object.assign(Object.create(null), binding.instance.$.appContext, {
116
+ provides
117
+ });
118
+ render(node, el);
119
+ };
120
+ }
121
+ function findComponentParent(vnode, root) {
122
+ // Walk the tree from root until we find the child vnode
123
+ const stack = new Set();
124
+ const walk = children => {
125
+ for (const child of children) {
126
+ if (!child) continue;
127
+ if (child === vnode || child.el && vnode.el && child.el === vnode.el) {
128
+ return true;
129
+ }
130
+ stack.add(child);
131
+ let result;
132
+ if (child.suspense) {
133
+ result = walk([child.ssContent]);
134
+ } else if (Array.isArray(child.children)) {
135
+ result = walk(child.children);
136
+ } else if (child.component?.vnode) {
137
+ result = walk([child.component?.subTree]);
138
+ }
139
+ if (result) {
140
+ return result;
141
+ }
142
+ stack.delete(child);
143
+ }
144
+ return false;
145
+ };
146
+ if (!walk([root.subTree])) {
147
+ consoleError('Could not find original vnode, component will not inherit provides');
148
+ return root;
149
+ }
150
+
151
+ // Return the first component parent
152
+ const result = Array.from(stack).reverse();
153
+ for (const child of result) {
154
+ if (child.component) {
155
+ return child.component;
156
+ }
157
+ }
158
+ return root;
159
+ }
160
+
161
+ // Components
162
+ const Tooltip = useDirectiveComponent(VTooltip, binding => {
163
+ return {
164
+ activator: 'parent',
165
+ location: binding.arg?.replace('-', ' '),
166
+ text: typeof binding.value === 'boolean' ? undefined : binding.value
167
+ };
168
+ });
169
+
170
+ const _hoisted_1 = {
171
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
172
+ style: {"margin":"2px"}
173
+ };
174
+ const _hoisted_2 = ["value"];
175
+ const _hoisted_3 = {
176
+ class: "w-full px-4 pb-3",
177
+ style: {"font-size":"12px"}
178
+ };
179
+ const _hoisted_4 = ["innerHTML"];
180
+
181
+ // holds the number value of the datetime
182
+
183
+ const _sfc_main = {
184
+ __name: 'EodashDatePicker',
185
+ props: {
186
+ hintText: {
187
+ type: String,
188
+ default: null,
189
+ },
190
+ },
191
+ setup(__props) {
192
+
193
+ useCssVars(_ctx => ({
194
+ "cd569fa8": (transform.value)
195
+ }));
196
+
197
+ const currentDate = customRef((track, trigger) => ({
198
+ get() {
199
+ track();
200
+ return new Date(datetime.value).getTime();
201
+ },
202
+ /** @param {number} num */
203
+ set(num) {
204
+ trigger();
205
+ log.debug("Datepicker setting currentDate", datetime.value);
206
+ datetime.value = new Date(num).toISOString();
207
+ },
208
+ }));
209
+
210
+ const masks = ref({
211
+ input: "YYYY-MM-DD",
212
+ });
213
+
214
+
215
+
216
+ /**
217
+ * Attributes displayed on datepicker
218
+ *
219
+ * @type {import("vue").Reactive<
220
+ * (
221
+ * | Partial<import("v-calendar/dist/types/src/utils/attribute").AttributeConfig>
222
+ * | undefined
223
+ * )[]
224
+ * >}
225
+ */
226
+ const attributes = reactive([]);
227
+
228
+ const { selectedStac } = storeToRefs(useSTAcStore());
229
+
230
+ watch(
231
+ selectedStac,
232
+ async (updatedStac, previousStac) => {
233
+ if (updatedStac && previousStac?.id !== updatedStac.id) {
234
+ log.debug("Datepicker selected STAC change triggered");
235
+ const wongPalette = [
236
+ "#009E73",
237
+ "#0072B2",
238
+ "#E69F00",
239
+ "#CC79A7",
240
+ "#56B4E9",
241
+ "#D55E00",
242
+ ];
243
+ // remove old values
244
+ attributes.splice(0, attributes.length);
245
+
246
+ for (let idx = 0; idx < eodashCollections.length; idx++) {
247
+ log.debug("Retrieving dates", eodashCollections[idx]);
248
+ await eodashCollections[idx].fetchCollection();
249
+ const dates = [
250
+ ...new Set(
251
+ eodashCollections[idx].getItems()?.reduce((valid, it) => {
252
+ const parsed = Date.parse(/** @type {string} */ (it.datetime));
253
+ if (parsed) {
254
+ valid.push(new Date(parsed));
255
+ }
256
+ return valid;
257
+ }, /** @type {Date[]} */ ([])),
258
+ ),
259
+ ];
260
+ attributes.push({
261
+ key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
262
+ bar: {
263
+ style: {
264
+ backgroundColor: wongPalette[idx % wongPalette.length],
265
+ },
266
+ },
267
+ dates,
268
+ content: {
269
+ style: {
270
+ color: "#000000",
271
+ "font-weight": "bold",
272
+ },
273
+ },
274
+ });
275
+ }
276
+ }
277
+ },
278
+ { immediate: true },
279
+ );
280
+
281
+ /**
282
+ * @param {boolean} reverse
283
+ */
284
+ function jumpDate(reverse) {
285
+ if (attributes.length) {
286
+ let latestDateMS = reverse ? Infinity : -Infinity;
287
+ attributes.forEach((coll) => {
288
+ if (coll?.dates) {
289
+ coll.dates.forEach((d) => {
290
+ // TODO: we need to handle time ranges and other options here
291
+ if (d instanceof Date) {
292
+ const mathFun = reverse ? "min" : "max";
293
+ latestDateMS = Math[mathFun](latestDateMS, d.getTime());
294
+ }
295
+ });
296
+ }
297
+ });
298
+ currentDate.value =
299
+ latestDateMS === -Infinity
300
+ ? Date.now()
301
+ : latestDateMS === Infinity
302
+ ? 0
303
+ : latestDateMS;
304
+ }
305
+ }
306
+
307
+ // fixes calendar dispalcement on lib mode
308
+ const transform = ref("");
309
+ onMounted(() => {
310
+ transform.value = document.querySelector("eo-dash")
311
+ ? "translate3d(50px,-80px,0)"
312
+ : "translate3d(0px,-80px,0)";
313
+ });
314
+
315
+ return (_ctx, _cache) => {
316
+
317
+
318
+
319
+
320
+
321
+ return (openBlock(), createElementBlock(Fragment, null, [
322
+ createVNode(unref(DatePicker), {
323
+ modelValue: currentDate.value,
324
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((currentDate).value = $event)),
325
+ modelModifiers: { number: true },
326
+ masks: masks.value,
327
+ attributes: attributes
328
+ }, createSlots({
329
+ default: withCtx(({ inputValue, inputEvents }) => [
330
+ createElementVNode("div", _hoisted_1, [
331
+ createElementVNode("input", mergeProps({ value: inputValue }, toHandlers(inputEvents, true), {
332
+ style: {"margin":"1px"},
333
+ class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
334
+ }), null, 16 /* FULL_PROPS */, _hoisted_2)
335
+ ])
336
+ ]),
337
+ _: 2 /* DYNAMIC */
338
+ }, [
339
+ (__props.hintText)
340
+ ? {
341
+ name: "footer",
342
+ fn: withCtx(() => [
343
+ createElementVNode("div", _hoisted_3, [
344
+ createElementVNode("span", { innerHTML: __props.hintText }, null, 8 /* PROPS */, _hoisted_4)
345
+ ])
346
+ ]),
347
+ key: "0"
348
+ }
349
+ : undefined
350
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "masks", "attributes"]),
351
+ createVNode(VRow, {
352
+ align: "center",
353
+ justify: "center",
354
+ style: {"margin-top":"6px"}
355
+ }, {
356
+ default: withCtx(() => [
357
+ withDirectives((openBlock(), createBlock(VBtn, {
358
+ style: {"padding":"0px","margin-right":"4px"},
359
+ density: "compact",
360
+ onClick: _cache[1] || (_cache[1] = $event => (jumpDate(true)))
361
+ }, {
362
+ default: withCtx(() => [
363
+ createVNode(VIcon, {
364
+ icon: [unref(mdiRayEndArrow)]
365
+ }, null, 8 /* PROPS */, ["icon"])
366
+ ]),
367
+ _: 1 /* STABLE */
368
+ })), [
369
+ [Tooltip, 'Set date to oldest available dataset', "bottom"]
370
+ ]),
371
+ withDirectives((openBlock(), createBlock(VBtn, {
372
+ style: {"padding":"0px","margin-left":"4px"},
373
+ density: "compact",
374
+ onClick: _cache[2] || (_cache[2] = $event => (jumpDate(false)))
375
+ }, {
376
+ default: withCtx(() => [
377
+ createVNode(VIcon, {
378
+ icon: [unref(mdiRayStartArrow)]
379
+ }, null, 8 /* PROPS */, ["icon"])
380
+ ]),
381
+ _: 1 /* STABLE */
382
+ })), [
383
+ [Tooltip, 'Set date to latest available dataset', "bottom"]
384
+ ])
385
+ ]),
386
+ _: 1 /* STABLE */
387
+ })
388
+ ], 64 /* STABLE_FRAGMENT */))
389
+ }
390
+ }
391
+
392
+ };
393
+
394
+ export { _sfc_main as default };
@@ -0,0 +1,194 @@
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 };