@eodash/eodash 5.0.0-rc.1 → 5.0.0-rc.1.6
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 +1 -1
- package/core/client/composables/EodashMap.js +19 -5
- package/core/client/composables/EodashProcess.js +51 -5
- package/core/client/eodash.js +8 -7
- package/core/client/eodashSTAC/EodashCollection.js +16 -0
- package/core/client/eodashSTAC/createLayers.js +61 -4
- package/core/client/eodashSTAC/helpers.js +39 -4
- package/core/client/types.ts +7 -0
- package/core/client/utils/states.js +3 -0
- package/dist/client/{DashboardLayout-FS5inBIm.js → DashboardLayout-SZfMDUoR.js} +2 -2
- package/dist/client/{DynamicWebComponent-CBSgT677.js → DynamicWebComponent-I9gzMY0L.js} +1 -1
- package/dist/client/EodashDatePicker-B9_u6TTm.js +405 -0
- package/dist/client/{EodashItemFilter-CFNKjm_Z.js → EodashItemFilter-G7YsYO3B.js} +1 -1
- package/dist/client/{EodashLayerControl-CzffoPUs.js → EodashLayerControl-CJ94ul63.js} +10 -2
- package/dist/client/{EodashLayoutSwitcher-DM0zDhvI.js → EodashLayoutSwitcher-DRKm8A8U.js} +2 -2
- package/dist/client/{EodashMap-BdFZ657e.js → EodashMap-Dp44Ajbi.js} +60 -10
- package/dist/client/{EodashMapBtns-rC_IPD-Z.js → EodashMapBtns-BlPFwhPc.js} +4 -4
- package/dist/client/{EodashProcess-SLsTISKV.js → EodashProcess-BLmIgUGT.js} +158 -25
- package/dist/client/{EodashStacInfo-DFD0gtWm.js → EodashStacInfo-BIRcfcMo.js} +1 -1
- package/dist/client/{EodashTools-ImohD2ys.js → EodashTools-PNfJ-Cw3.js} +4 -4
- package/dist/client/{ExportState-LNZAovzM.js → ExportState-5JyTshJH.js} +4 -4
- package/dist/client/{Footer-c19dV1ZR.js → Footer-CM9hgdQP.js} +1 -1
- package/dist/client/{Header-CcvXFqqt.js → Header-BTq4DW1x.js} +3 -3
- package/dist/client/{MobileLayout-OM6Wc-vj.js → MobileLayout-Atfoxf8d.js} +5 -5
- package/dist/client/{PopUp-B0_c0207.js → PopUp-Bmfn3N_4.js} +3 -3
- package/dist/client/{VImg-BpDhCbL0.js → VImg-CUF4S39i.js} +2 -2
- package/dist/client/{VMain-DC05bDwX.js → VMain-CQpXnzDR.js} +1 -1
- package/dist/client/{VOverlay-C7EUyVe_.js → VOverlay-DUnITwM1.js} +3 -3
- package/dist/client/{VTooltip-C78suika.js → VTooltip-BYTlbKer.js} +3 -3
- package/dist/client/{WidgetsContainer-sD1vDnhF.js → WidgetsContainer-BPbgxdb0.js} +1 -1
- package/dist/client/{asWebComponent-D8bMMCEr.js → asWebComponent-DW1XzZkL.js} +138 -27
- package/dist/client/eo-dash.css +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-yw6tFXER.js → forwardRefs-gx1Fzngc.js} +1 -1
- package/dist/client/{index-CpK_Yaom.js → index-DvFppNyk.js} +1 -1
- package/dist/client/{transition-B2YwqAYJ.js → transition-j2eWJYMg.js} +1 -1
- package/dist/types/core/client/App.vue.d.ts +7 -0
- package/dist/types/core/client/asWebComponent.d.ts +9 -0
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -0
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +20 -0
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
- package/dist/types/core/client/components/Footer.vue.d.ts +106 -0
- package/dist/types/core/client/components/Header.vue.d.ts +2 -0
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +7 -0
- package/dist/types/core/client/components/Loading.vue.d.ts +2 -0
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +312 -0
- package/dist/types/core/client/composables/DefineEodash.d.ts +2 -0
- package/dist/types/core/client/composables/DefineTemplate.d.ts +15 -0
- package/dist/types/core/client/composables/DefineWidgets.d.ts +14 -0
- package/dist/types/core/client/composables/EodashMap.d.ts +6 -0
- package/dist/types/core/client/composables/EodashProcess.d.ts +162 -0
- package/dist/types/core/client/composables/index.d.ts +9 -0
- package/dist/types/core/client/eodash.d.ts +8 -0
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +113 -0
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +45 -0
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +135 -0
- package/dist/types/core/client/eodashSTAC/triggers.d.ts +1 -0
- package/dist/types/core/client/main.d.ts +2 -0
- package/dist/types/core/client/plugins/axios.d.ts +2 -0
- package/dist/types/core/client/plugins/index.d.ts +3 -0
- package/dist/types/core/client/plugins/vuetify.d.ts +82 -0
- package/dist/types/core/client/render.d.ts +1 -0
- package/dist/types/core/client/store/actions.d.ts +12 -0
- package/dist/types/core/client/store/index.d.ts +11 -0
- package/dist/types/core/client/store/stac.d.ts +25 -0
- package/dist/types/core/client/store/states.d.ts +22 -0
- package/dist/types/core/client/types.d.ts +279 -0
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +8 -0
- package/dist/types/core/client/utils/states.d.ts +20 -0
- package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +15 -0
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +44 -0
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +13 -0
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +11 -0
- package/dist/types/widgets/EodashMap.vue.d.ts +14 -0
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +13 -0
- package/dist/types/widgets/EodashProcess.vue.d.ts +4 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
- package/dist/types/widgets/EodashTools.vue.d.ts +19 -0
- package/dist/types/widgets/ExportState.vue.d.ts +7 -0
- package/dist/types/widgets/PopUp.vue.d.ts +27 -0
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +10 -0
- package/package.json +11 -11
- package/widgets/EodashDatePicker.vue +89 -6
- package/widgets/EodashLayerControl.vue +13 -1
- package/widgets/EodashMap.vue +51 -5
- package/widgets/EodashProcess.vue +57 -11
- package/dist/client/EodashDatePicker-BGSS2ZYK.js +0 -306
|
@@ -1,306 +0,0 @@
|
|
|
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-D8bMMCEr.js';
|
|
4
|
-
import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
|
|
5
|
-
import log from 'loglevel';
|
|
6
|
-
import { V as VTooltip } from './VTooltip-C78suika.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 };
|