@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
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { shallowRef, computed, watch } from 'vue';
|
|
2
|
-
import { p as propsFactory, aM as getCurrentInstance } from './asWebComponent-CLhcT715.js';
|
|
3
|
-
|
|
4
|
-
class Box {
|
|
5
|
-
constructor(_ref) {
|
|
6
|
-
let {
|
|
7
|
-
x,
|
|
8
|
-
y,
|
|
9
|
-
width,
|
|
10
|
-
height
|
|
11
|
-
} = _ref;
|
|
12
|
-
this.x = x;
|
|
13
|
-
this.y = y;
|
|
14
|
-
this.width = width;
|
|
15
|
-
this.height = height;
|
|
16
|
-
}
|
|
17
|
-
get top() {
|
|
18
|
-
return this.y;
|
|
19
|
-
}
|
|
20
|
-
get bottom() {
|
|
21
|
-
return this.y + this.height;
|
|
22
|
-
}
|
|
23
|
-
get left() {
|
|
24
|
-
return this.x;
|
|
25
|
-
}
|
|
26
|
-
get right() {
|
|
27
|
-
return this.x + this.width;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function getOverflow(a, b) {
|
|
31
|
-
return {
|
|
32
|
-
x: {
|
|
33
|
-
before: Math.max(0, b.left - a.left),
|
|
34
|
-
after: Math.max(0, a.right - b.right)
|
|
35
|
-
},
|
|
36
|
-
y: {
|
|
37
|
-
before: Math.max(0, b.top - a.top),
|
|
38
|
-
after: Math.max(0, a.bottom - b.bottom)
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function getTargetBox(target) {
|
|
43
|
-
if (Array.isArray(target)) {
|
|
44
|
-
return new Box({
|
|
45
|
-
x: target[0],
|
|
46
|
-
y: target[1],
|
|
47
|
-
width: 0,
|
|
48
|
-
height: 0
|
|
49
|
-
});
|
|
50
|
-
} else {
|
|
51
|
-
return target.getBoundingClientRect();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Utilities
|
|
56
|
-
/** @see https://stackoverflow.com/a/57876601/2074736 */
|
|
57
|
-
function nullifyTransforms(el) {
|
|
58
|
-
const rect = el.getBoundingClientRect();
|
|
59
|
-
const style = getComputedStyle(el);
|
|
60
|
-
const tx = style.transform;
|
|
61
|
-
if (tx) {
|
|
62
|
-
let ta, sx, sy, dx, dy;
|
|
63
|
-
if (tx.startsWith('matrix3d(')) {
|
|
64
|
-
ta = tx.slice(9, -1).split(/, /);
|
|
65
|
-
sx = Number(ta[0]);
|
|
66
|
-
sy = Number(ta[5]);
|
|
67
|
-
dx = Number(ta[12]);
|
|
68
|
-
dy = Number(ta[13]);
|
|
69
|
-
} else if (tx.startsWith('matrix(')) {
|
|
70
|
-
ta = tx.slice(7, -1).split(/, /);
|
|
71
|
-
sx = Number(ta[0]);
|
|
72
|
-
sy = Number(ta[3]);
|
|
73
|
-
dx = Number(ta[4]);
|
|
74
|
-
dy = Number(ta[5]);
|
|
75
|
-
} else {
|
|
76
|
-
return new Box(rect);
|
|
77
|
-
}
|
|
78
|
-
const to = style.transformOrigin;
|
|
79
|
-
const x = rect.x - dx - (1 - sx) * parseFloat(to);
|
|
80
|
-
const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(' ') + 1));
|
|
81
|
-
const w = sx ? rect.width / sx : el.offsetWidth + 1;
|
|
82
|
-
const h = sy ? rect.height / sy : el.offsetHeight + 1;
|
|
83
|
-
return new Box({
|
|
84
|
-
x,
|
|
85
|
-
y,
|
|
86
|
-
width: w,
|
|
87
|
-
height: h
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
return new Box(rect);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function animate(el, keyframes, options) {
|
|
94
|
-
if (typeof el.animate === 'undefined') return {
|
|
95
|
-
finished: Promise.resolve()
|
|
96
|
-
};
|
|
97
|
-
let animation;
|
|
98
|
-
try {
|
|
99
|
-
animation = el.animate(keyframes, options);
|
|
100
|
-
} catch (err) {
|
|
101
|
-
return {
|
|
102
|
-
finished: Promise.resolve()
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
if (typeof animation.finished === 'undefined') {
|
|
106
|
-
animation.finished = new Promise(resolve => {
|
|
107
|
-
animation.onfinish = () => {
|
|
108
|
-
resolve(animation);
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return animation;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const standardEasing = 'cubic-bezier(0.4, 0, 0.2, 1)';
|
|
116
|
-
const deceleratedEasing = 'cubic-bezier(0.0, 0, 0.2, 1)'; // Entering
|
|
117
|
-
const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving
|
|
118
|
-
|
|
119
|
-
// Utilities
|
|
120
|
-
const makeLazyProps = propsFactory({
|
|
121
|
-
eager: Boolean
|
|
122
|
-
}, 'lazy');
|
|
123
|
-
function useLazy(props, active) {
|
|
124
|
-
const isBooted = shallowRef(false);
|
|
125
|
-
const hasContent = computed(() => isBooted.value || props.eager || active.value);
|
|
126
|
-
watch(active, () => isBooted.value = true);
|
|
127
|
-
function onAfterLeave() {
|
|
128
|
-
if (!props.eager) isBooted.value = false;
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
isBooted,
|
|
132
|
-
hasContent,
|
|
133
|
-
onAfterLeave
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Utilities
|
|
138
|
-
function useScopeId() {
|
|
139
|
-
const vm = getCurrentInstance('useScopeId');
|
|
140
|
-
const scopeId = vm.vnode.scopeId;
|
|
141
|
-
return {
|
|
142
|
-
scopeId: scopeId ? {
|
|
143
|
-
[scopeId]: ''
|
|
144
|
-
} : undefined
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Types
|
|
149
|
-
|
|
150
|
-
const Refs = Symbol('Forwarded refs');
|
|
151
|
-
|
|
152
|
-
/** Omit properties starting with P */
|
|
153
|
-
|
|
154
|
-
/** Omit keyof $props from T */
|
|
155
|
-
|
|
156
|
-
function getDescriptor(obj, key) {
|
|
157
|
-
let currentObj = obj;
|
|
158
|
-
while (currentObj) {
|
|
159
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(currentObj, key);
|
|
160
|
-
if (descriptor) return descriptor;
|
|
161
|
-
currentObj = Object.getPrototypeOf(currentObj);
|
|
162
|
-
}
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
function forwardRefs(target) {
|
|
166
|
-
for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
167
|
-
refs[_key - 1] = arguments[_key];
|
|
168
|
-
}
|
|
169
|
-
target[Refs] = refs;
|
|
170
|
-
return new Proxy(target, {
|
|
171
|
-
get(target, key) {
|
|
172
|
-
if (Reflect.has(target, key)) {
|
|
173
|
-
return Reflect.get(target, key);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Skip internal properties
|
|
177
|
-
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
|
|
178
|
-
for (const ref of refs) {
|
|
179
|
-
if (ref.value && Reflect.has(ref.value, key)) {
|
|
180
|
-
const val = Reflect.get(ref.value, key);
|
|
181
|
-
return typeof val === 'function' ? val.bind(ref.value) : val;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
has(target, key) {
|
|
186
|
-
if (Reflect.has(target, key)) {
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Skip internal properties
|
|
191
|
-
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
|
|
192
|
-
for (const ref of refs) {
|
|
193
|
-
if (ref.value && Reflect.has(ref.value, key)) {
|
|
194
|
-
return true;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return false;
|
|
198
|
-
},
|
|
199
|
-
set(target, key, value) {
|
|
200
|
-
if (Reflect.has(target, key)) {
|
|
201
|
-
return Reflect.set(target, key, value);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Skip internal properties
|
|
205
|
-
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return false;
|
|
206
|
-
for (const ref of refs) {
|
|
207
|
-
if (ref.value && Reflect.has(ref.value, key)) {
|
|
208
|
-
return Reflect.set(ref.value, key, value);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return false;
|
|
212
|
-
},
|
|
213
|
-
getOwnPropertyDescriptor(target, key) {
|
|
214
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
|
|
215
|
-
if (descriptor) return descriptor;
|
|
216
|
-
|
|
217
|
-
// Skip internal properties
|
|
218
|
-
if (typeof key === 'symbol' || key.startsWith('$') || key.startsWith('__')) return;
|
|
219
|
-
|
|
220
|
-
// Check each ref's own properties
|
|
221
|
-
for (const ref of refs) {
|
|
222
|
-
if (!ref.value) continue;
|
|
223
|
-
const descriptor = getDescriptor(ref.value, key) ?? ('_' in ref.value ? getDescriptor(ref.value._?.setupState, key) : undefined);
|
|
224
|
-
if (descriptor) return descriptor;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Recursive search up each ref's prototype
|
|
228
|
-
for (const ref of refs) {
|
|
229
|
-
const childRefs = ref.value && ref.value[Refs];
|
|
230
|
-
if (!childRefs) continue;
|
|
231
|
-
const queue = childRefs.slice();
|
|
232
|
-
while (queue.length) {
|
|
233
|
-
const ref = queue.shift();
|
|
234
|
-
const descriptor = getDescriptor(ref.value, key);
|
|
235
|
-
if (descriptor) return descriptor;
|
|
236
|
-
const childRefs = ref.value && ref.value[Refs];
|
|
237
|
-
if (childRefs) queue.push(...childRefs);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return undefined;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export { Box as B, animate as a, useScopeId as b, acceleratedEasing as c, deceleratedEasing as d, getOverflow as e, forwardRefs as f, getTargetBox as g, makeLazyProps as m, nullifyTransforms as n, standardEasing as s, useLazy as u };
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { TransitionGroup, Transition, h, camelize } from 'vue';
|
|
2
|
-
import { g as genericComponent, p as propsFactory } from './asWebComponent-CLhcT715.js';
|
|
3
|
-
|
|
4
|
-
// Utilities
|
|
5
|
-
const makeTransitionProps = propsFactory({
|
|
6
|
-
disabled: Boolean,
|
|
7
|
-
group: Boolean,
|
|
8
|
-
hideOnLeave: Boolean,
|
|
9
|
-
leaveAbsolute: Boolean,
|
|
10
|
-
mode: String,
|
|
11
|
-
origin: String
|
|
12
|
-
}, 'transition');
|
|
13
|
-
function createCssTransition(name, origin, mode) {
|
|
14
|
-
return genericComponent()({
|
|
15
|
-
name,
|
|
16
|
-
props: makeTransitionProps({
|
|
17
|
-
mode,
|
|
18
|
-
origin
|
|
19
|
-
}),
|
|
20
|
-
setup(props, _ref) {
|
|
21
|
-
let {
|
|
22
|
-
slots
|
|
23
|
-
} = _ref;
|
|
24
|
-
const functions = {
|
|
25
|
-
onBeforeEnter(el) {
|
|
26
|
-
if (props.origin) {
|
|
27
|
-
el.style.transformOrigin = props.origin;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
onLeave(el) {
|
|
31
|
-
if (props.leaveAbsolute) {
|
|
32
|
-
const {
|
|
33
|
-
offsetTop,
|
|
34
|
-
offsetLeft,
|
|
35
|
-
offsetWidth,
|
|
36
|
-
offsetHeight
|
|
37
|
-
} = el;
|
|
38
|
-
el._transitionInitialStyles = {
|
|
39
|
-
position: el.style.position,
|
|
40
|
-
top: el.style.top,
|
|
41
|
-
left: el.style.left,
|
|
42
|
-
width: el.style.width,
|
|
43
|
-
height: el.style.height
|
|
44
|
-
};
|
|
45
|
-
el.style.position = 'absolute';
|
|
46
|
-
el.style.top = `${offsetTop}px`;
|
|
47
|
-
el.style.left = `${offsetLeft}px`;
|
|
48
|
-
el.style.width = `${offsetWidth}px`;
|
|
49
|
-
el.style.height = `${offsetHeight}px`;
|
|
50
|
-
}
|
|
51
|
-
if (props.hideOnLeave) {
|
|
52
|
-
el.style.setProperty('display', 'none', 'important');
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
onAfterLeave(el) {
|
|
56
|
-
if (props.leaveAbsolute && el?._transitionInitialStyles) {
|
|
57
|
-
const {
|
|
58
|
-
position,
|
|
59
|
-
top,
|
|
60
|
-
left,
|
|
61
|
-
width,
|
|
62
|
-
height
|
|
63
|
-
} = el._transitionInitialStyles;
|
|
64
|
-
delete el._transitionInitialStyles;
|
|
65
|
-
el.style.position = position || '';
|
|
66
|
-
el.style.top = top || '';
|
|
67
|
-
el.style.left = left || '';
|
|
68
|
-
el.style.width = width || '';
|
|
69
|
-
el.style.height = height || '';
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
return () => {
|
|
74
|
-
const tag = props.group ? TransitionGroup : Transition;
|
|
75
|
-
return h(tag, {
|
|
76
|
-
name: props.disabled ? '' : name,
|
|
77
|
-
css: !props.disabled,
|
|
78
|
-
...(props.group ? undefined : {
|
|
79
|
-
mode: props.mode
|
|
80
|
-
}),
|
|
81
|
-
...(props.disabled ? {} : functions)
|
|
82
|
-
}, slots.default);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function createJavascriptTransition(name, functions) {
|
|
88
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'in-out';
|
|
89
|
-
return genericComponent()({
|
|
90
|
-
name,
|
|
91
|
-
props: {
|
|
92
|
-
mode: {
|
|
93
|
-
type: String,
|
|
94
|
-
default: mode
|
|
95
|
-
},
|
|
96
|
-
disabled: Boolean,
|
|
97
|
-
group: Boolean
|
|
98
|
-
},
|
|
99
|
-
setup(props, _ref2) {
|
|
100
|
-
let {
|
|
101
|
-
slots
|
|
102
|
-
} = _ref2;
|
|
103
|
-
const tag = props.group ? TransitionGroup : Transition;
|
|
104
|
-
return () => {
|
|
105
|
-
return h(tag, {
|
|
106
|
-
name: props.disabled ? '' : name,
|
|
107
|
-
css: !props.disabled,
|
|
108
|
-
// mode: props.mode, // TODO: vuejs/vue-next#3104
|
|
109
|
-
...(props.disabled ? {} : functions)
|
|
110
|
-
}, slots.default);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Utilities
|
|
117
|
-
function ExpandTransitionGenerator () {
|
|
118
|
-
let expandedParentClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
119
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
120
|
-
const sizeProperty = x ? 'width' : 'height';
|
|
121
|
-
const offsetProperty = camelize(`offset-${sizeProperty}`);
|
|
122
|
-
return {
|
|
123
|
-
onBeforeEnter(el) {
|
|
124
|
-
el._parent = el.parentNode;
|
|
125
|
-
el._initialStyle = {
|
|
126
|
-
transition: el.style.transition,
|
|
127
|
-
overflow: el.style.overflow,
|
|
128
|
-
[sizeProperty]: el.style[sizeProperty]
|
|
129
|
-
};
|
|
130
|
-
},
|
|
131
|
-
onEnter(el) {
|
|
132
|
-
const initialStyle = el._initialStyle;
|
|
133
|
-
if (!initialStyle) return;
|
|
134
|
-
el.style.setProperty('transition', 'none', 'important');
|
|
135
|
-
// Hide overflow to account for collapsed margins in the calculated height
|
|
136
|
-
el.style.overflow = 'hidden';
|
|
137
|
-
const offset = `${el[offsetProperty]}px`;
|
|
138
|
-
el.style[sizeProperty] = '0';
|
|
139
|
-
void el.offsetHeight; // force reflow
|
|
140
|
-
|
|
141
|
-
el.style.transition = initialStyle.transition;
|
|
142
|
-
if (expandedParentClass && el._parent) {
|
|
143
|
-
el._parent.classList.add(expandedParentClass);
|
|
144
|
-
}
|
|
145
|
-
requestAnimationFrame(() => {
|
|
146
|
-
el.style[sizeProperty] = offset;
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
onAfterEnter: resetStyles,
|
|
150
|
-
onEnterCancelled: resetStyles,
|
|
151
|
-
onLeave(el) {
|
|
152
|
-
el._initialStyle = {
|
|
153
|
-
transition: '',
|
|
154
|
-
overflow: el.style.overflow,
|
|
155
|
-
[sizeProperty]: el.style[sizeProperty]
|
|
156
|
-
};
|
|
157
|
-
el.style.overflow = 'hidden';
|
|
158
|
-
el.style[sizeProperty] = `${el[offsetProperty]}px`;
|
|
159
|
-
void el.offsetHeight; // force reflow
|
|
160
|
-
|
|
161
|
-
requestAnimationFrame(() => el.style[sizeProperty] = '0');
|
|
162
|
-
},
|
|
163
|
-
onAfterLeave,
|
|
164
|
-
onLeaveCancelled: onAfterLeave
|
|
165
|
-
};
|
|
166
|
-
function onAfterLeave(el) {
|
|
167
|
-
if (expandedParentClass && el._parent) {
|
|
168
|
-
el._parent.classList.remove(expandedParentClass);
|
|
169
|
-
}
|
|
170
|
-
resetStyles(el);
|
|
171
|
-
}
|
|
172
|
-
function resetStyles(el) {
|
|
173
|
-
if (!el._initialStyle) return;
|
|
174
|
-
const size = el._initialStyle[sizeProperty];
|
|
175
|
-
el.style.overflow = el._initialStyle.overflow;
|
|
176
|
-
if (size != null) el.style[sizeProperty] = size;
|
|
177
|
-
delete el._initialStyle;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
createCssTransition('fab-transition', 'center center', 'out-in');
|
|
182
|
-
|
|
183
|
-
// Generic transitions
|
|
184
|
-
createCssTransition('dialog-bottom-transition');
|
|
185
|
-
createCssTransition('dialog-top-transition');
|
|
186
|
-
const VFadeTransition = createCssTransition('fade-transition');
|
|
187
|
-
createCssTransition('scale-transition');
|
|
188
|
-
createCssTransition('scroll-x-transition');
|
|
189
|
-
createCssTransition('scroll-x-reverse-transition');
|
|
190
|
-
createCssTransition('scroll-y-transition');
|
|
191
|
-
createCssTransition('scroll-y-reverse-transition');
|
|
192
|
-
createCssTransition('slide-x-transition');
|
|
193
|
-
createCssTransition('slide-x-reverse-transition');
|
|
194
|
-
createCssTransition('slide-y-transition');
|
|
195
|
-
createCssTransition('slide-y-reverse-transition');
|
|
196
|
-
|
|
197
|
-
// Javascript transitions
|
|
198
|
-
const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator());
|
|
199
|
-
createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true));
|
|
200
|
-
|
|
201
|
-
export { VFadeTransition as V, VExpandTransition as a };
|