@eodash/eodash 5.0.0 → 5.2.0
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 -0
- package/core/client/App.vue +8 -2
- package/core/client/asWebComponent.js +5 -5
- package/core/client/components/DashboardLayout.vue +43 -26
- package/core/client/components/EodashOverlay.vue +5 -6
- package/core/client/components/ErrorAlert.vue +2 -2
- package/core/client/components/Footer.vue +4 -4
- package/core/client/components/Header.vue +3 -3
- package/core/client/components/MobileLayout.vue +47 -27
- package/core/client/composables/DefineEodash.js +38 -43
- package/core/client/composables/DefineTemplate.js +4 -2
- package/core/client/composables/DefineWidgets.js +14 -8
- package/core/client/composables/index.js +273 -23
- package/core/client/eodashSTAC/EodashCollection.js +84 -62
- package/core/client/eodashSTAC/createLayers.js +30 -0
- package/core/client/eodashSTAC/helpers.js +159 -28
- package/core/client/eodashSTAC/parquet.js +145 -0
- package/core/client/eodashSTAC/triggers.js +6 -3
- package/core/client/plugins/index.js +4 -3
- package/core/client/plugins/vuetify.js +3 -0
- package/core/client/store/actions.js +21 -4
- package/core/client/store/stac.js +93 -56
- package/core/client/store/states.js +15 -5
- package/core/client/types.ts +59 -43
- package/core/client/utils/index.js +79 -0
- package/core/client/utils/keys.js +2 -2
- package/core/client/utils/states.js +30 -5
- package/core/client/views/Dashboard.vue +36 -32
- package/core/client/vite-env.d.ts +7 -0
- package/dist/client/{DashboardLayout-CkWvOMOW.js → DashboardLayout-Dq9Kfe6O.js} +24 -13
- package/dist/client/{DynamicWebComponent-DYBbpvUK.js → DynamicWebComponent-DCBMXskE.js} +1 -1
- package/dist/client/{EodashDatePicker-CALmW3SI.js → EodashDatePicker-DtngxU6s.js} +59 -32
- package/dist/client/{EodashItemFilter-DlQiE713.js → EodashItemFilter-ClQebJQt.js} +20 -10
- package/dist/client/{EodashLayerControl-DEzEbft7.js → EodashLayerControl-BLBds28C.js} +29 -16
- package/dist/client/EodashLayoutSwitcher-DQ8SfVDd.js +61 -0
- package/dist/client/EodashMapBtns-B89_YBDw.js +326 -0
- package/dist/client/{EodashStacInfo-DPPxDkF6.js → EodashStacInfo-Dt1nF06x.js} +3 -18
- package/dist/client/{EodashTools-CUaL9s4H.js → EodashTools-DV5ykmWc.js} +13 -13
- package/dist/client/{ExportState-DjyIZVhl.js → ExportState-B6zZQUmE.js} +57 -52
- package/dist/client/{Footer-DyL0JoWt.js → Footer-DNhXs8k6.js} +15 -13
- package/dist/client/{Header-B5Dgty9l.js → Header-BjhN5JY4.js} +32 -28
- package/dist/client/MobileLayout-JelB6w1G.js +118 -0
- package/dist/client/{PopUp-BfB8s_ki.js → PopUp-CgpvNr3o.js} +18 -10
- package/dist/client/ProcessList-vecpxThi.js +198 -0
- package/dist/client/{VImg-FD1WVphJ.js → VImg-CETuikH2.js} +221 -26
- package/dist/client/{VMain-DJKG4SvM.js → VMain-Ci9DyaGU.js} +7 -7
- package/dist/client/{VTooltip-CfeefrXI.js → VTooltip-J4ac48X7.js} +12 -10
- package/dist/client/{WidgetsContainer-C2TaTdb6.js → WidgetsContainer-CCML4TyV.js} +1 -1
- package/dist/client/asWebComponent-ZyEzWOOf.js +19092 -0
- package/dist/client/async-B7jIrM53.js +804 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{VOverlay-BzOdRu9h.js → forwardRefs-BQclvjMq.js} +332 -28
- package/dist/client/handling-BS24aG1q.js +1227 -0
- package/dist/client/helpers-wXK7Ywio.js +4556 -0
- package/dist/client/index-4UCzZi8B.js +376 -0
- package/dist/client/{index-4CT7Tz83.js → index-9KR-G20t.js} +2 -2
- package/dist/client/{index-CIHH_3dW.js → index-B2XpdgR6.js} +227 -86
- package/dist/client/material-symbols-outlined.woff2 +0 -0
- package/dist/client/material-symbols-rounded.woff2 +0 -0
- package/dist/client/material-symbols-sharp.woff2 +0 -0
- package/dist/client/material-symbols-subset.woff2 +0 -0
- package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
- package/dist/client/templates.js +840 -0
- package/dist/client/transition-yBii4fu6.js +40 -0
- package/dist/node/cli.js +16 -6
- package/dist/node/types.d.ts +1 -1
- package/dist/types/core/client/App.vue.d.ts +2 -2
- package/dist/types/core/client/asWebComponent.d.ts +1 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
- package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
- package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
- package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
- package/dist/types/core/client/composables/index.d.ts +24 -2
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +25 -5
- package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
- package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
- package/dist/types/core/client/store/actions.d.ts +3 -2
- package/dist/types/core/client/store/stac.d.ts +16 -13
- package/dist/types/core/client/store/states.d.ts +14 -4
- package/dist/types/core/client/types.d.ts +46 -31
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +4 -4
- package/dist/types/core/client/utils/states.d.ts +59 -47
- package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
- package/dist/types/templates/baseConfig.d.ts +4 -0
- package/dist/types/templates/compare.d.ts +185 -0
- package/dist/types/templates/expert.d.ts +147 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/light.d.ts +154 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
- package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +12 -8
- package/dist/types/widgets/EodashMap/index.vue.d.ts +9 -4
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
- package/dist/types/widgets/EodashProcess/methods/async.d.ts +19 -18
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
- package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
- package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
- package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
- package/dist/types/widgets/ExportState.vue.d.ts +1 -1
- package/dist/types/widgets/PopUp.vue.d.ts +11 -16
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
- package/package.json +55 -45
- package/templates/baseConfig.js +68 -0
- package/templates/compare.js +142 -0
- package/templates/expert.js +124 -0
- package/templates/index.js +8 -0
- package/templates/light.js +139 -0
- package/widgets/EodashDatePicker.vue +80 -31
- package/widgets/EodashItemFilter.vue +26 -11
- package/widgets/EodashLayerControl.vue +20 -11
- package/widgets/EodashLayoutSwitcher.vue +6 -3
- package/widgets/EodashMap/EodashMapBtns.vue +269 -0
- package/widgets/EodashMap/index.vue +255 -45
- package/widgets/EodashMap/methods/create-layers-config.js +4 -3
- package/widgets/EodashMap/methods/index.js +33 -23
- package/widgets/EodashProcess/ProcessList.vue +47 -11
- package/widgets/EodashProcess/index.vue +55 -20
- package/widgets/EodashProcess/methods/async.js +99 -60
- package/widgets/EodashProcess/methods/composables.js +21 -14
- package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +132 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
- package/widgets/EodashProcess/methods/handling.js +127 -80
- package/widgets/EodashProcess/methods/outputs.js +376 -125
- package/widgets/EodashProcess/methods/utils.js +442 -10
- package/widgets/EodashProcess/states.js +13 -0
- package/widgets/EodashProcess/types.ts +46 -0
- package/widgets/EodashStacInfo.vue +2 -17
- package/widgets/EodashTools.vue +13 -13
- package/widgets/WidgetsContainer.vue +1 -1
- package/core/client/eodash.js +0 -454
- package/dist/client/EodashLayoutSwitcher-CDeCV8F-.js +0 -52
- package/dist/client/EodashMapBtns-CktQCfa-.js +0 -131
- package/dist/client/MobileLayout-CRsg_5Q4.js +0 -1217
- package/dist/client/ProcessList-DTefwQZx.js +0 -484
- package/dist/client/asWebComponent-CLhcT715.js +0 -12479
- package/dist/client/eo-dash.css +0 -5
- package/dist/client/forwardRefs-Bon_Kku1.js +0 -245
- package/dist/client/index-Bm9cbtx5.js +0 -201
- package/dist/client/index-DiGDvTQU.js +0 -780
- package/dist/client/transition-C5I57hn6.js +0 -37
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/widgets/EodashMapBtns.vue +0 -113
package/dist/client/eo-dash.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aF as EodashConstructor, aE as register, aG as store } from './asWebComponent-ZyEzWOOf.js';
|
|
2
2
|
import 'vue';
|
|
@@ -1,7 +1,144 @@
|
|
|
1
|
-
import { computed, watch, onScopeDispose, nextTick, ref, watchEffect, effectScope, inject, mergeProps, shallowRef, onMounted, reactive, provide, toRaw, readonly, warn,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { computed, watch, onScopeDispose, nextTick, ref, watchEffect, effectScope, inject, mergeProps, shallowRef, onMounted, toRef, reactive, provide, toValue, toRaw, readonly, warn, onBeforeUnmount, createElementVNode, Fragment, createVNode, Teleport, withDirectives, vShow, Transition } from 'vue';
|
|
2
|
+
import { ao as isOn, ap as eventName, p as propsFactory, aq as destructComputed, ar as parseAnchor, as as flipSide, at as flipAlign, au as flipCorner, av as CircularBuffer, aw as deepEqual, W as consoleError, ax as getAxis, o as convertToUnit, v as clamp, al as IN_BROWSER, y as useToggleScope, ay as defer, ak as getCurrentInstance, az as templateRef, aA as matchesSelector, D as useDisplay, q as makeThemeProps, d as makeDimensionProps, e as makeComponentProps, g as genericComponent, x as useProxiedModel, k as provideTheme, l as useRtl, f as useBackgroundColor, b as useDimension, aB as useRouter, aC as useBackButton, c as useRender } from './asWebComponent-ZyEzWOOf.js';
|
|
3
|
+
import { m as makeTransitionProps, M as MaybeTransition } from './transition-yBii4fu6.js';
|
|
4
|
+
|
|
5
|
+
class Box {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
x,
|
|
9
|
+
y,
|
|
10
|
+
width,
|
|
11
|
+
height
|
|
12
|
+
} = _ref;
|
|
13
|
+
this.x = x;
|
|
14
|
+
this.y = y;
|
|
15
|
+
this.width = width;
|
|
16
|
+
this.height = height;
|
|
17
|
+
}
|
|
18
|
+
get top() {
|
|
19
|
+
return this.y;
|
|
20
|
+
}
|
|
21
|
+
get bottom() {
|
|
22
|
+
return this.y + this.height;
|
|
23
|
+
}
|
|
24
|
+
get left() {
|
|
25
|
+
return this.x;
|
|
26
|
+
}
|
|
27
|
+
get right() {
|
|
28
|
+
return this.x + this.width;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getOverflow(a, b) {
|
|
32
|
+
return {
|
|
33
|
+
x: {
|
|
34
|
+
before: Math.max(0, b.left - a.left),
|
|
35
|
+
after: Math.max(0, a.right - b.right)
|
|
36
|
+
},
|
|
37
|
+
y: {
|
|
38
|
+
before: Math.max(0, b.top - a.top),
|
|
39
|
+
after: Math.max(0, a.bottom - b.bottom)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function getTargetBox(target) {
|
|
44
|
+
if (Array.isArray(target)) {
|
|
45
|
+
return new Box({
|
|
46
|
+
x: target[0],
|
|
47
|
+
y: target[1],
|
|
48
|
+
width: 0,
|
|
49
|
+
height: 0
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
return target.getBoundingClientRect();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function getElementBox(el) {
|
|
56
|
+
if (el === document.documentElement) {
|
|
57
|
+
if (!visualViewport) {
|
|
58
|
+
return new Box({
|
|
59
|
+
x: 0,
|
|
60
|
+
y: 0,
|
|
61
|
+
width: document.documentElement.clientWidth,
|
|
62
|
+
height: document.documentElement.clientHeight
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
return new Box({
|
|
66
|
+
x: visualViewport.scale > 1 ? 0 : visualViewport.offsetLeft,
|
|
67
|
+
y: visualViewport.scale > 1 ? 0 : visualViewport.offsetTop,
|
|
68
|
+
width: visualViewport.width * visualViewport.scale,
|
|
69
|
+
height: visualViewport.height * visualViewport.scale
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
const rect = el.getBoundingClientRect();
|
|
74
|
+
return new Box({
|
|
75
|
+
x: rect.x,
|
|
76
|
+
y: rect.y,
|
|
77
|
+
width: el.clientWidth,
|
|
78
|
+
height: el.clientHeight
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Utilities
|
|
84
|
+
/** @see https://stackoverflow.com/a/57876601/2074736 */
|
|
85
|
+
function nullifyTransforms(el) {
|
|
86
|
+
const rect = el.getBoundingClientRect();
|
|
87
|
+
const style = getComputedStyle(el);
|
|
88
|
+
const tx = style.transform;
|
|
89
|
+
if (tx) {
|
|
90
|
+
let ta, sx, sy, dx, dy;
|
|
91
|
+
if (tx.startsWith('matrix3d(')) {
|
|
92
|
+
ta = tx.slice(9, -1).split(/, /);
|
|
93
|
+
sx = Number(ta[0]);
|
|
94
|
+
sy = Number(ta[5]);
|
|
95
|
+
dx = Number(ta[12]);
|
|
96
|
+
dy = Number(ta[13]);
|
|
97
|
+
} else if (tx.startsWith('matrix(')) {
|
|
98
|
+
ta = tx.slice(7, -1).split(/, /);
|
|
99
|
+
sx = Number(ta[0]);
|
|
100
|
+
sy = Number(ta[3]);
|
|
101
|
+
dx = Number(ta[4]);
|
|
102
|
+
dy = Number(ta[5]);
|
|
103
|
+
} else {
|
|
104
|
+
return new Box(rect);
|
|
105
|
+
}
|
|
106
|
+
const to = style.transformOrigin;
|
|
107
|
+
const x = rect.x - dx - (1 - sx) * parseFloat(to);
|
|
108
|
+
const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));
|
|
109
|
+
const w = sx ? rect.width / sx : el.offsetWidth + 1;
|
|
110
|
+
const h = sy ? rect.height / sy : el.offsetHeight + 1;
|
|
111
|
+
return new Box({
|
|
112
|
+
x,
|
|
113
|
+
y,
|
|
114
|
+
width: w,
|
|
115
|
+
height: h
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
return new Box(rect);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function animate(el, keyframes, options) {
|
|
122
|
+
if (typeof el.animate === 'undefined') return {
|
|
123
|
+
finished: Promise.resolve()
|
|
124
|
+
};
|
|
125
|
+
let animation;
|
|
126
|
+
try {
|
|
127
|
+
animation = el.animate(keyframes, options);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
return {
|
|
130
|
+
finished: Promise.resolve()
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (typeof animation.finished === 'undefined') {
|
|
134
|
+
animation.finished = new Promise(resolve => {
|
|
135
|
+
animation.onfinish = () => {
|
|
136
|
+
resolve(animation);
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return animation;
|
|
141
|
+
}
|
|
5
142
|
|
|
6
143
|
// Utilities
|
|
7
144
|
const handlers = new WeakMap();
|
|
@@ -75,6 +212,10 @@ function attachedRoot(node) {
|
|
|
75
212
|
return root;
|
|
76
213
|
}
|
|
77
214
|
|
|
215
|
+
const standardEasing = 'cubic-bezier(0.4, 0, 0.2, 1)';
|
|
216
|
+
const deceleratedEasing = 'cubic-bezier(0.0, 0, 0.2, 1)'; // Entering
|
|
217
|
+
const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving
|
|
218
|
+
|
|
78
219
|
function getScrollParent(el) {
|
|
79
220
|
let includeHidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
80
221
|
while (el) {
|
|
@@ -283,11 +424,19 @@ function useLocationStrategies(props, data) {
|
|
|
283
424
|
watch(() => props.locationStrategy, reset);
|
|
284
425
|
onScopeDispose(() => {
|
|
285
426
|
window.removeEventListener('resize', onResize);
|
|
427
|
+
visualViewport?.removeEventListener('resize', onVisualResize);
|
|
428
|
+
visualViewport?.removeEventListener('scroll', onVisualScroll);
|
|
286
429
|
updateLocation.value = undefined;
|
|
287
430
|
});
|
|
288
431
|
window.addEventListener('resize', onResize, {
|
|
289
432
|
passive: true
|
|
290
433
|
});
|
|
434
|
+
visualViewport?.addEventListener('resize', onVisualResize, {
|
|
435
|
+
passive: true
|
|
436
|
+
});
|
|
437
|
+
visualViewport?.addEventListener('scroll', onVisualScroll, {
|
|
438
|
+
passive: true
|
|
439
|
+
});
|
|
291
440
|
if (typeof props.locationStrategy === 'function') {
|
|
292
441
|
updateLocation.value = props.locationStrategy(data, props, contentStyles)?.updateLocation;
|
|
293
442
|
} else {
|
|
@@ -298,6 +447,12 @@ function useLocationStrategies(props, data) {
|
|
|
298
447
|
function onResize(e) {
|
|
299
448
|
updateLocation.value?.(e);
|
|
300
449
|
}
|
|
450
|
+
function onVisualResize(e) {
|
|
451
|
+
updateLocation.value?.(e);
|
|
452
|
+
}
|
|
453
|
+
function onVisualScroll(e) {
|
|
454
|
+
updateLocation.value?.(e);
|
|
455
|
+
}
|
|
301
456
|
return {
|
|
302
457
|
contentStyles,
|
|
303
458
|
updateLocation
|
|
@@ -387,8 +542,27 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
387
542
|
return typeof props.offset === 'number' ? [props.offset, 0] : [0, 0];
|
|
388
543
|
});
|
|
389
544
|
let observe = false;
|
|
545
|
+
let lastFrame = -1;
|
|
546
|
+
const flipped = new CircularBuffer(4);
|
|
390
547
|
const observer = new ResizeObserver(() => {
|
|
391
|
-
if (observe)
|
|
548
|
+
if (!observe) return;
|
|
549
|
+
|
|
550
|
+
// Detect consecutive frames
|
|
551
|
+
requestAnimationFrame(newTime => {
|
|
552
|
+
if (newTime !== lastFrame) flipped.clear();
|
|
553
|
+
requestAnimationFrame(newNewTime => {
|
|
554
|
+
lastFrame = newNewTime;
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
if (flipped.isFull) {
|
|
558
|
+
const values = flipped.values();
|
|
559
|
+
if (deepEqual(values.at(-1), values.at(-3)) && !deepEqual(values.at(-1), values.at(-2))) {
|
|
560
|
+
// Flipping is causing a container resize loop
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const result = updateLocation();
|
|
565
|
+
if (result) flipped.push(result.flipped);
|
|
392
566
|
});
|
|
393
567
|
watch([data.target, data.contentEl], (_ref, _ref2) => {
|
|
394
568
|
let [newTarget, newContentEl] = _ref;
|
|
@@ -403,13 +577,22 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
403
577
|
onScopeDispose(() => {
|
|
404
578
|
observer.disconnect();
|
|
405
579
|
});
|
|
580
|
+
let targetBox = new Box({
|
|
581
|
+
x: 0,
|
|
582
|
+
y: 0,
|
|
583
|
+
width: 0,
|
|
584
|
+
height: 0
|
|
585
|
+
});
|
|
406
586
|
|
|
407
587
|
// eslint-disable-next-line max-statements
|
|
408
588
|
function updateLocation() {
|
|
409
589
|
observe = false;
|
|
410
590
|
requestAnimationFrame(() => observe = true);
|
|
411
591
|
if (!data.target.value || !data.contentEl.value) return;
|
|
412
|
-
|
|
592
|
+
if (Array.isArray(data.target.value) || data.target.value.offsetParent || data.target.value.getClientRects().length) {
|
|
593
|
+
targetBox = getTargetBox(data.target.value);
|
|
594
|
+
} // Otherwise target element is hidden, use last known value
|
|
595
|
+
|
|
413
596
|
const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
|
|
414
597
|
const scrollParents = getScrollParents(data.contentEl.value);
|
|
415
598
|
const viewportMargin = 12;
|
|
@@ -421,13 +604,7 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
421
604
|
}
|
|
422
605
|
}
|
|
423
606
|
const viewport = scrollParents.reduce((box, el) => {
|
|
424
|
-
const
|
|
425
|
-
const scrollBox = new Box({
|
|
426
|
-
x: el === document.documentElement ? 0 : rect.x,
|
|
427
|
-
y: el === document.documentElement ? 0 : rect.y,
|
|
428
|
-
width: el.clientWidth,
|
|
429
|
-
height: el.clientHeight
|
|
430
|
-
});
|
|
607
|
+
const scrollBox = getElementBox(el);
|
|
431
608
|
if (box) {
|
|
432
609
|
return new Box({
|
|
433
610
|
x: Math.max(box.left, scrollBox.left),
|
|
@@ -594,7 +771,8 @@ function connectedLocationStrategy(data, props, contentStyles) {
|
|
|
594
771
|
});
|
|
595
772
|
return {
|
|
596
773
|
available,
|
|
597
|
-
contentBox
|
|
774
|
+
contentBox,
|
|
775
|
+
flipped
|
|
598
776
|
};
|
|
599
777
|
}
|
|
600
778
|
watch(() => [preferredAnchor.value, preferredOrigin.value, props.offset, props.minWidth, props.minHeight, props.maxWidth, props.maxHeight], () => updateLocation());
|
|
@@ -1101,6 +1279,35 @@ function useHydration() {
|
|
|
1101
1279
|
}
|
|
1102
1280
|
}
|
|
1103
1281
|
|
|
1282
|
+
// Utilities
|
|
1283
|
+
const makeLazyProps = propsFactory({
|
|
1284
|
+
eager: Boolean
|
|
1285
|
+
}, 'lazy');
|
|
1286
|
+
function useLazy(props, active) {
|
|
1287
|
+
const isBooted = shallowRef(false);
|
|
1288
|
+
const hasContent = toRef(() => isBooted.value || props.eager || active.value);
|
|
1289
|
+
watch(active, () => isBooted.value = true);
|
|
1290
|
+
function onAfterLeave() {
|
|
1291
|
+
if (!props.eager) isBooted.value = false;
|
|
1292
|
+
}
|
|
1293
|
+
return {
|
|
1294
|
+
isBooted,
|
|
1295
|
+
hasContent,
|
|
1296
|
+
onAfterLeave
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// Utilities
|
|
1301
|
+
function useScopeId() {
|
|
1302
|
+
const vm = getCurrentInstance('useScopeId');
|
|
1303
|
+
const scopeId = vm.vnode.scopeId;
|
|
1304
|
+
return {
|
|
1305
|
+
scopeId: scopeId ? {
|
|
1306
|
+
[scopeId]: ''
|
|
1307
|
+
} : undefined
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1104
1311
|
// Composables
|
|
1105
1312
|
const StackSymbol = Symbol.for('vuetify:stack');
|
|
1106
1313
|
const globalStack = reactive([]);
|
|
@@ -1112,10 +1319,10 @@ function useStack(isActive, zIndex, disableGlobalStack) {
|
|
|
1112
1319
|
activeChildren: new Set()
|
|
1113
1320
|
});
|
|
1114
1321
|
provide(StackSymbol, stack);
|
|
1115
|
-
const _zIndex = shallowRef(Number(zIndex
|
|
1322
|
+
const _zIndex = shallowRef(Number(toValue(zIndex)));
|
|
1116
1323
|
useToggleScope(isActive, () => {
|
|
1117
1324
|
const lastZIndex = globalStack.at(-1)?.[1];
|
|
1118
|
-
_zIndex.value = lastZIndex ? lastZIndex + 10 : Number(zIndex
|
|
1325
|
+
_zIndex.value = lastZIndex ? lastZIndex + 10 : Number(toValue(zIndex));
|
|
1119
1326
|
if (createStackEntry) {
|
|
1120
1327
|
globalStack.push([vm.uid, _zIndex.value]);
|
|
1121
1328
|
}
|
|
@@ -1135,11 +1342,11 @@ function useStack(isActive, zIndex, disableGlobalStack) {
|
|
|
1135
1342
|
setTimeout(() => globalTop.value = _isTop);
|
|
1136
1343
|
});
|
|
1137
1344
|
}
|
|
1138
|
-
const localTop =
|
|
1345
|
+
const localTop = toRef(() => !stack.activeChildren.size);
|
|
1139
1346
|
return {
|
|
1140
1347
|
globalTop: readonly(globalTop),
|
|
1141
1348
|
localTop,
|
|
1142
|
-
stackStyles:
|
|
1349
|
+
stackStyles: toRef(() => ({
|
|
1143
1350
|
zIndex: _zIndex.value
|
|
1144
1351
|
}))
|
|
1145
1352
|
};
|
|
@@ -1178,7 +1385,7 @@ function Scrim(props) {
|
|
|
1178
1385
|
"name": "fade-transition",
|
|
1179
1386
|
"appear": true
|
|
1180
1387
|
}, {
|
|
1181
|
-
default: () => [props.modelValue &&
|
|
1388
|
+
default: () => [props.modelValue && createElementVNode("div", mergeProps({
|
|
1182
1389
|
"class": ['v-overlay__scrim', props.color.backgroundColorClasses.value],
|
|
1183
1390
|
"style": props.color.backgroundColorStyles.value
|
|
1184
1391
|
}, rest), null)]
|
|
@@ -1219,7 +1426,7 @@ const makeVOverlayProps = propsFactory({
|
|
|
1219
1426
|
const VOverlay = genericComponent()({
|
|
1220
1427
|
name: 'VOverlay',
|
|
1221
1428
|
directives: {
|
|
1222
|
-
ClickOutside
|
|
1429
|
+
vClickOutside: ClickOutside
|
|
1223
1430
|
},
|
|
1224
1431
|
inheritAttrs: false,
|
|
1225
1432
|
props: {
|
|
@@ -1261,14 +1468,14 @@ const VOverlay = genericComponent()({
|
|
|
1261
1468
|
hasContent,
|
|
1262
1469
|
onAfterLeave: _onAfterLeave
|
|
1263
1470
|
} = useLazy(props, isActive);
|
|
1264
|
-
const scrimColor = useBackgroundColor(
|
|
1471
|
+
const scrimColor = useBackgroundColor(() => {
|
|
1265
1472
|
return typeof props.scrim === 'string' ? props.scrim : null;
|
|
1266
|
-
})
|
|
1473
|
+
});
|
|
1267
1474
|
const {
|
|
1268
1475
|
globalTop,
|
|
1269
1476
|
localTop,
|
|
1270
1477
|
stackStyles
|
|
1271
|
-
} = useStack(isActive,
|
|
1478
|
+
} = useStack(isActive, () => props.zIndex, props._disableGlobalStack);
|
|
1272
1479
|
const {
|
|
1273
1480
|
activatorEl,
|
|
1274
1481
|
activatorRef,
|
|
@@ -1399,7 +1606,7 @@ const VOverlay = genericComponent()({
|
|
|
1399
1606
|
_onAfterLeave();
|
|
1400
1607
|
emit('afterLeave');
|
|
1401
1608
|
}
|
|
1402
|
-
useRender(() =>
|
|
1609
|
+
useRender(() => createElementVNode(Fragment, null, [slots.activator?.({
|
|
1403
1610
|
isActive: isActive.value,
|
|
1404
1611
|
targetRef,
|
|
1405
1612
|
props: mergeProps({
|
|
@@ -1409,7 +1616,7 @@ const VOverlay = genericComponent()({
|
|
|
1409
1616
|
"disabled": !teleportTarget.value,
|
|
1410
1617
|
"to": teleportTarget.value
|
|
1411
1618
|
}, {
|
|
1412
|
-
default: () => [
|
|
1619
|
+
default: () => [createElementVNode("div", mergeProps({
|
|
1413
1620
|
"class": ['v-overlay', {
|
|
1414
1621
|
'v-overlay--absolute': props.absolute || props.contained,
|
|
1415
1622
|
'v-overlay--active': isActive.value,
|
|
@@ -1433,13 +1640,13 @@ const VOverlay = genericComponent()({
|
|
|
1433
1640
|
"onAfterEnter": onAfterEnter,
|
|
1434
1641
|
"onAfterLeave": onAfterLeave
|
|
1435
1642
|
}, {
|
|
1436
|
-
default: () => [withDirectives(
|
|
1643
|
+
default: () => [withDirectives(createElementVNode("div", mergeProps({
|
|
1437
1644
|
"ref": contentEl,
|
|
1438
1645
|
"class": ['v-overlay__content', props.contentClass],
|
|
1439
1646
|
"style": [dimensionStyles.value, contentStyles.value]
|
|
1440
1647
|
}, contentEvents.value, props.contentProps), [slots.default?.({
|
|
1441
1648
|
isActive
|
|
1442
|
-
})]), [[vShow, isActive.value], [
|
|
1649
|
+
})]), [[vShow, isActive.value], [ClickOutside, {
|
|
1443
1650
|
handler: onClickOutside,
|
|
1444
1651
|
closeConditional,
|
|
1445
1652
|
include: () => [activatorEl.value]
|
|
@@ -1459,4 +1666,101 @@ const VOverlay = genericComponent()({
|
|
|
1459
1666
|
}
|
|
1460
1667
|
});
|
|
1461
1668
|
|
|
1462
|
-
|
|
1669
|
+
// Types
|
|
1670
|
+
|
|
1671
|
+
const Refs = Symbol('Forwarded refs');
|
|
1672
|
+
|
|
1673
|
+
/** Omit properties starting with P */
|
|
1674
|
+
|
|
1675
|
+
/** Omit keyof $props from T */
|
|
1676
|
+
|
|
1677
|
+
function getDescriptor(obj, key) {
|
|
1678
|
+
let currentObj = obj;
|
|
1679
|
+
while (currentObj) {
|
|
1680
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
|
|
1681
|
+
if (descriptor) return descriptor;
|
|
1682
|
+
currentObj = Object.getPrototypeOf(currentObj);
|
|
1683
|
+
}
|
|
1684
|
+
return undefined;
|
|
1685
|
+
}
|
|
1686
|
+
function forwardRefs(target) {
|
|
1687
|
+
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1688
|
+
refs[_key - 1] = arguments[_key];
|
|
1689
|
+
}
|
|
1690
|
+
target[Refs] = refs;
|
|
1691
|
+
return new Proxy(target, {
|
|
1692
|
+
get(target, key) {
|
|
1693
|
+
if (Reflect.has(target, key)) {
|
|
1694
|
+
return Reflect.get(target, key);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
// Skip internal properties
|
|
1698
|
+
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
|
|
1699
|
+
for (const ref of refs) {
|
|
1700
|
+
if (ref.value && Reflect.has(ref.value, key)) {
|
|
1701
|
+
const val = Reflect.get(ref.value, key);
|
|
1702
|
+
return typeof val === 'function' ? val.bind(ref.value) : val;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
has(target, key) {
|
|
1707
|
+
if (Reflect.has(target, key)) {
|
|
1708
|
+
return true;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
// Skip internal properties
|
|
1712
|
+
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
|
|
1713
|
+
for (const ref of refs) {
|
|
1714
|
+
if (ref.value && Reflect.has(ref.value, key)) {
|
|
1715
|
+
return true;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return false;
|
|
1719
|
+
},
|
|
1720
|
+
set(target, key, value) {
|
|
1721
|
+
if (Reflect.has(target, key)) {
|
|
1722
|
+
return Reflect.set(target, key, value);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
// Skip internal properties
|
|
1726
|
+
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
|
|
1727
|
+
for (const ref of refs) {
|
|
1728
|
+
if (ref.value && Reflect.has(ref.value, key)) {
|
|
1729
|
+
return Reflect.set(ref.value, key, value);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
return false;
|
|
1733
|
+
},
|
|
1734
|
+
getOwnPropertyDescriptor(target, key) {
|
|
1735
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
|
|
1736
|
+
if (descriptor) return descriptor;
|
|
1737
|
+
|
|
1738
|
+
// Skip internal properties
|
|
1739
|
+
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
|
|
1740
|
+
|
|
1741
|
+
// Check each ref's own properties
|
|
1742
|
+
for (const ref of refs) {
|
|
1743
|
+
if (!ref.value) continue;
|
|
1744
|
+
const descriptor = getDescriptor(ref.value, key) ?? ('_' in ref.value ? getDescriptor(ref.value._?.setupState, key) : undefined);
|
|
1745
|
+
if (descriptor) return descriptor;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
// Recursive search up each ref's prototype
|
|
1749
|
+
for (const ref of refs) {
|
|
1750
|
+
const childRefs = ref.value && ref.value[Refs];
|
|
1751
|
+
if (!childRefs) continue;
|
|
1752
|
+
const queue = childRefs.slice();
|
|
1753
|
+
while (queue.length) {
|
|
1754
|
+
const ref = queue.shift();
|
|
1755
|
+
const descriptor = getDescriptor(ref.value, key);
|
|
1756
|
+
if (descriptor) return descriptor;
|
|
1757
|
+
const childRefs = ref.value && ref.value[Refs];
|
|
1758
|
+
if (childRefs) queue.push(...childRefs);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
return undefined;
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
export { VOverlay as V, animate as a, acceleratedEasing as b, deceleratedEasing as d, forwardRefs as f, getTargetBox as g, makeVOverlayProps as m, nullifyTransforms as n, standardEasing as s, useScopeId as u };
|