@eodash/eodash 5.0.0-alpha.2.9 → 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.
- package/README.md +1 -1
- package/core/client/App.vue +13 -1
- package/core/client/asWebComponent.js +13 -3
- package/core/client/components/DashboardLayout.vue +6 -2
- package/core/client/composables/DefineEodash.js +1 -1
- package/core/client/composables/EodashMap.js +349 -0
- package/core/client/composables/EodashProcess.js +575 -0
- package/core/client/composables/index.js +107 -24
- package/core/client/eodash.js +83 -10
- package/core/client/plugins/axios.js +8 -0
- package/core/client/plugins/index.js +2 -1
- package/core/client/store/Actions.js +63 -12
- package/core/client/store/States.js +19 -0
- package/core/client/store/stac.js +98 -8
- package/core/client/types.d.ts +25 -18
- package/core/client/utils/createLayers.js +313 -0
- package/core/client/utils/eodashSTAC.js +320 -170
- package/core/client/utils/helpers.js +369 -9
- package/core/client/utils/keys.js +2 -0
- package/core/client/utils/states.js +17 -0
- package/core/client/views/Dashboard.vue +17 -46
- package/core/client/vite-env.d.ts +1 -9
- package/dist/client/DashboardLayout-CVMJ4l8M.js +87 -0
- package/dist/client/DynamicWebComponent-Cv8n457T.js +88 -0
- package/dist/client/EodashDatePicker-VVkiPmpc.js +394 -0
- package/dist/client/EodashItemFilter-CugWNQ86.js +194 -0
- package/dist/client/EodashLayerControl-53WghA8G.js +110 -0
- package/dist/client/EodashMap-CQnOePpy.js +486 -0
- package/dist/client/EodashMapBtns-uaRwFtfB.js +66 -0
- package/dist/client/EodashProcess-cF0unIy8.js +1477 -0
- package/dist/client/ExportState-BT8MLAW7.js +644 -0
- package/dist/client/Footer-C6GUG84G.js +141 -0
- package/dist/client/Header-D2dtCWp8.js +437 -0
- package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
- package/dist/client/MobileLayout-BAo8Wr8T.js +1210 -0
- package/dist/client/PopUp-Bm01q7Ko.js +389 -0
- package/dist/client/VImg-B8AbetCE.js +384 -0
- package/dist/client/VMain-DnGlQUyr.js +43 -0
- package/dist/client/VOverlay-B8Qj7LRG.js +1453 -0
- package/dist/client/WidgetsContainer-CwXRRLS1.js +83 -0
- package/dist/client/asWebComponent-DUUoR7MZ.js +11621 -0
- package/dist/client/eo-dash.js +2 -6
- package/dist/client/forwardRefs-CZJhEAKW.js +245 -0
- package/dist/client/index-DlIO7sJ3.js +199 -0
- package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
- package/dist/client/style.css +2 -2
- package/dist/client/transition-BiR8wMn1.js +37 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/types.d.ts +2 -0
- 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 +18 -0
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
- package/dist/types/core/client/components/Footer.vue.d.ts +2 -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 +2 -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 +5 -0
- package/dist/types/core/client/composables/index.d.ts +30 -0
- package/dist/types/core/client/eodash.d.ts +8 -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/States.d.ts +22 -0
- package/dist/types/core/client/store/index.d.ts +2 -0
- package/dist/types/core/client/store/stac.d.ts +25 -0
- package/dist/types/core/client/types.d.ts +279 -0
- package/dist/types/core/client/utils/createLayers.d.ts +45 -0
- package/dist/types/core/client/utils/eodashSTAC.d.ts +82 -0
- package/dist/types/core/client/utils/helpers.d.ts +84 -0
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +6 -0
- package/dist/types/core/client/utils/states.d.ts +14 -0
- package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +7 -0
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +42 -0
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +11 -0
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +9 -0
- package/dist/types/widgets/EodashMap.vue.d.ts +7 -0
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +11 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
- package/dist/types/widgets/EodashTools.vue.d.ts +15 -0
- package/dist/types/widgets/ExportState.vue.d.ts +7 -0
- package/dist/types/widgets/PopUp.vue.d.ts +22 -0
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +7 -0
- package/package.json +58 -37
- package/widgets/EodashDatePicker.vue +128 -100
- package/widgets/EodashItemFilter.vue +100 -14
- package/widgets/EodashLayerControl.vue +98 -0
- package/widgets/EodashMap.vue +98 -122
- package/widgets/EodashMapBtns.vue +24 -7
- package/widgets/EodashProcess.vue +151 -0
- package/widgets/ExportState.vue +15 -11
- package/core/client/SuspensedDashboard.ce.vue +0 -105
- package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
- package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
- package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
- package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
- package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
- package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
- package/dist/client/ExportState-CCzOhppU.js +0 -558
- package/dist/client/Footer-BPAND0yG.js +0 -115
- package/dist/client/Header-DLhebNvG.js +0 -350
- package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
- package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
- package/dist/client/PopUp-1d2bBFjw.js +0 -300
- package/dist/client/VImg-DxHcztfM.js +0 -291
- package/dist/client/VMain-BLX5vRRn.js +0 -39
- package/dist/client/VOverlay-CvrYEmLu.js +0 -967
- package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
- package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
- package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
- package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
- package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
- package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
- package/dist/client/forwardRefs-BJJiadQP.js +0 -185
- package/dist/client/index-Q-bHLjxx.js +0 -153
- package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
- package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
- package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
- package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
- package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
- package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
- package/dist/client/ssrBoot-yo11mybw.js +0 -17
- package/dist/client/transition-CSJhuYGK.js +0 -34
- package/dist/client/webfontloader-qotgY98I.js +0 -435
- package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
|
@@ -0,0 +1,1210 @@
|
|
|
1
|
+
import { ref, computed, createVNode, mergeProps, Fragment, shallowRef, watch, provide, withDirectives, resolveDirective, inject, vShow, nextTick, toRef, useCssVars, onMounted, openBlock, createBlock, withCtx, Suspense, unref, resolveDynamicComponent, createCommentVNode, createElementBlock, renderList, createTextVNode, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { k as keys, p as propsFactory, o as omit, m as makeVBtnProps, g as genericComponent, u as useTextColor, a as useRender, V as VBtn, b as makeComponentProps, c as makeTagProps, d as makeThemeProps, e as provideTheme, f as useRtl, h as useLocale, i as useGroup, j as useProxiedModel, l as makeGroupItemProps, n as useGroupItem, q as convertToUnit, I as IconValue, r as makeDisplayProps, s as makeGroupProps, t as useDisplay, v as useResizeObserver, w as useGoTo, x as IN_BROWSER, y as VIcon, z as focusableChildren, A as makeDensityProps, B as useDensity, C as useBackgroundColor, D as provideDefaults, E as isObject, _ as _export_sfc, F as eodashKey, G as useDefineWidgets, H as useLayout } from './asWebComponent-DUUoR7MZ.js';
|
|
3
|
+
import { V as VMain } from './VMain-DnGlQUyr.js';
|
|
4
|
+
import { f as forwardRefs, a as animate, s as standardEasing, m as makeLazyProps, u as useLazy, b as useScopeId } from './forwardRefs-CZJhEAKW.js';
|
|
5
|
+
import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
|
|
6
|
+
import { M as MaybeTransition } from './transition-BiR8wMn1.js';
|
|
7
|
+
import { V as VFadeTransition } from './index-DlIO7sJ3.js';
|
|
8
|
+
|
|
9
|
+
// Utilities
|
|
10
|
+
const handleGesture = wrapper => {
|
|
11
|
+
const {
|
|
12
|
+
touchstartX,
|
|
13
|
+
touchendX,
|
|
14
|
+
touchstartY,
|
|
15
|
+
touchendY
|
|
16
|
+
} = wrapper;
|
|
17
|
+
const dirRatio = 0.5;
|
|
18
|
+
const minDistance = 16;
|
|
19
|
+
wrapper.offsetX = touchendX - touchstartX;
|
|
20
|
+
wrapper.offsetY = touchendY - touchstartY;
|
|
21
|
+
if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {
|
|
22
|
+
wrapper.left && touchendX < touchstartX - minDistance && wrapper.left(wrapper);
|
|
23
|
+
wrapper.right && touchendX > touchstartX + minDistance && wrapper.right(wrapper);
|
|
24
|
+
}
|
|
25
|
+
if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {
|
|
26
|
+
wrapper.up && touchendY < touchstartY - minDistance && wrapper.up(wrapper);
|
|
27
|
+
wrapper.down && touchendY > touchstartY + minDistance && wrapper.down(wrapper);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function touchstart(event, wrapper) {
|
|
31
|
+
const touch = event.changedTouches[0];
|
|
32
|
+
wrapper.touchstartX = touch.clientX;
|
|
33
|
+
wrapper.touchstartY = touch.clientY;
|
|
34
|
+
wrapper.start?.({
|
|
35
|
+
originalEvent: event,
|
|
36
|
+
...wrapper
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function touchend(event, wrapper) {
|
|
40
|
+
const touch = event.changedTouches[0];
|
|
41
|
+
wrapper.touchendX = touch.clientX;
|
|
42
|
+
wrapper.touchendY = touch.clientY;
|
|
43
|
+
wrapper.end?.({
|
|
44
|
+
originalEvent: event,
|
|
45
|
+
...wrapper
|
|
46
|
+
});
|
|
47
|
+
handleGesture(wrapper);
|
|
48
|
+
}
|
|
49
|
+
function touchmove(event, wrapper) {
|
|
50
|
+
const touch = event.changedTouches[0];
|
|
51
|
+
wrapper.touchmoveX = touch.clientX;
|
|
52
|
+
wrapper.touchmoveY = touch.clientY;
|
|
53
|
+
wrapper.move?.({
|
|
54
|
+
originalEvent: event,
|
|
55
|
+
...wrapper
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function createHandlers() {
|
|
59
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
60
|
+
const wrapper = {
|
|
61
|
+
touchstartX: 0,
|
|
62
|
+
touchstartY: 0,
|
|
63
|
+
touchendX: 0,
|
|
64
|
+
touchendY: 0,
|
|
65
|
+
touchmoveX: 0,
|
|
66
|
+
touchmoveY: 0,
|
|
67
|
+
offsetX: 0,
|
|
68
|
+
offsetY: 0,
|
|
69
|
+
left: value.left,
|
|
70
|
+
right: value.right,
|
|
71
|
+
up: value.up,
|
|
72
|
+
down: value.down,
|
|
73
|
+
start: value.start,
|
|
74
|
+
move: value.move,
|
|
75
|
+
end: value.end
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
touchstart: e => touchstart(e, wrapper),
|
|
79
|
+
touchend: e => touchend(e, wrapper),
|
|
80
|
+
touchmove: e => touchmove(e, wrapper)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function mounted(el, binding) {
|
|
84
|
+
const value = binding.value;
|
|
85
|
+
const target = value?.parent ? el.parentElement : el;
|
|
86
|
+
const options = value?.options ?? {
|
|
87
|
+
passive: true
|
|
88
|
+
};
|
|
89
|
+
const uid = binding.instance?.$.uid; // TODO: use custom uid generator
|
|
90
|
+
|
|
91
|
+
if (!target || !uid) return;
|
|
92
|
+
const handlers = createHandlers(binding.value);
|
|
93
|
+
target._touchHandlers = target._touchHandlers ?? Object.create(null);
|
|
94
|
+
target._touchHandlers[uid] = handlers;
|
|
95
|
+
keys(handlers).forEach(eventName => {
|
|
96
|
+
target.addEventListener(eventName, handlers[eventName], options);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function unmounted(el, binding) {
|
|
100
|
+
const target = binding.value?.parent ? el.parentElement : el;
|
|
101
|
+
const uid = binding.instance?.$.uid;
|
|
102
|
+
if (!target?._touchHandlers || !uid) return;
|
|
103
|
+
const handlers = target._touchHandlers[uid];
|
|
104
|
+
keys(handlers).forEach(eventName => {
|
|
105
|
+
target.removeEventListener(eventName, handlers[eventName]);
|
|
106
|
+
});
|
|
107
|
+
delete target._touchHandlers[uid];
|
|
108
|
+
}
|
|
109
|
+
const Touch = {
|
|
110
|
+
mounted,
|
|
111
|
+
unmounted
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// Types
|
|
115
|
+
|
|
116
|
+
const VTabsSymbol = Symbol.for('vuetify:v-tabs');
|
|
117
|
+
|
|
118
|
+
const makeVTabProps = propsFactory({
|
|
119
|
+
fixed: Boolean,
|
|
120
|
+
sliderColor: String,
|
|
121
|
+
hideSlider: Boolean,
|
|
122
|
+
direction: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: 'horizontal'
|
|
125
|
+
},
|
|
126
|
+
...omit(makeVBtnProps({
|
|
127
|
+
selectedClass: 'v-tab--selected',
|
|
128
|
+
variant: 'text'
|
|
129
|
+
}), ['active', 'block', 'flat', 'location', 'position', 'symbol'])
|
|
130
|
+
}, 'VTab');
|
|
131
|
+
const VTab = genericComponent()({
|
|
132
|
+
name: 'VTab',
|
|
133
|
+
props: makeVTabProps(),
|
|
134
|
+
setup(props, _ref) {
|
|
135
|
+
let {
|
|
136
|
+
slots,
|
|
137
|
+
attrs
|
|
138
|
+
} = _ref;
|
|
139
|
+
const {
|
|
140
|
+
textColorClasses: sliderColorClasses,
|
|
141
|
+
textColorStyles: sliderColorStyles
|
|
142
|
+
} = useTextColor(props, 'sliderColor');
|
|
143
|
+
const rootEl = ref();
|
|
144
|
+
const sliderEl = ref();
|
|
145
|
+
const isHorizontal = computed(() => props.direction === 'horizontal');
|
|
146
|
+
const isSelected = computed(() => rootEl.value?.group?.isSelected.value ?? false);
|
|
147
|
+
function updateSlider(_ref2) {
|
|
148
|
+
let {
|
|
149
|
+
value
|
|
150
|
+
} = _ref2;
|
|
151
|
+
if (value) {
|
|
152
|
+
const prevEl = rootEl.value?.$el.parentElement?.querySelector('.v-tab--selected .v-tab__slider');
|
|
153
|
+
const nextEl = sliderEl.value;
|
|
154
|
+
if (!prevEl || !nextEl) return;
|
|
155
|
+
const color = getComputedStyle(prevEl).color;
|
|
156
|
+
const prevBox = prevEl.getBoundingClientRect();
|
|
157
|
+
const nextBox = nextEl.getBoundingClientRect();
|
|
158
|
+
const xy = isHorizontal.value ? 'x' : 'y';
|
|
159
|
+
const XY = isHorizontal.value ? 'X' : 'Y';
|
|
160
|
+
const rightBottom = isHorizontal.value ? 'right' : 'bottom';
|
|
161
|
+
const widthHeight = isHorizontal.value ? 'width' : 'height';
|
|
162
|
+
const prevPos = prevBox[xy];
|
|
163
|
+
const nextPos = nextBox[xy];
|
|
164
|
+
const delta = prevPos > nextPos ? prevBox[rightBottom] - nextBox[rightBottom] : prevBox[xy] - nextBox[xy];
|
|
165
|
+
const origin = Math.sign(delta) > 0 ? isHorizontal.value ? 'right' : 'bottom' : Math.sign(delta) < 0 ? isHorizontal.value ? 'left' : 'top' : 'center';
|
|
166
|
+
const size = Math.abs(delta) + (Math.sign(delta) < 0 ? prevBox[widthHeight] : nextBox[widthHeight]);
|
|
167
|
+
const scale = size / Math.max(prevBox[widthHeight], nextBox[widthHeight]) || 0;
|
|
168
|
+
const initialScale = prevBox[widthHeight] / nextBox[widthHeight] || 0;
|
|
169
|
+
const sigma = 1.5;
|
|
170
|
+
animate(nextEl, {
|
|
171
|
+
backgroundColor: [color, 'currentcolor'],
|
|
172
|
+
transform: [`translate${XY}(${delta}px) scale${XY}(${initialScale})`, `translate${XY}(${delta / sigma}px) scale${XY}(${(scale - 1) / sigma + 1})`, 'none'],
|
|
173
|
+
transformOrigin: Array(3).fill(origin)
|
|
174
|
+
}, {
|
|
175
|
+
duration: 225,
|
|
176
|
+
easing: standardEasing
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
useRender(() => {
|
|
181
|
+
const btnProps = VBtn.filterProps(props);
|
|
182
|
+
return createVNode(VBtn, mergeProps({
|
|
183
|
+
"symbol": VTabsSymbol,
|
|
184
|
+
"ref": rootEl,
|
|
185
|
+
"class": ['v-tab', props.class],
|
|
186
|
+
"style": props.style,
|
|
187
|
+
"tabindex": isSelected.value ? 0 : -1,
|
|
188
|
+
"role": "tab",
|
|
189
|
+
"aria-selected": String(isSelected.value),
|
|
190
|
+
"active": false
|
|
191
|
+
}, btnProps, attrs, {
|
|
192
|
+
"block": props.fixed,
|
|
193
|
+
"maxWidth": props.fixed ? 300 : undefined,
|
|
194
|
+
"onGroup:selected": updateSlider
|
|
195
|
+
}), {
|
|
196
|
+
...slots,
|
|
197
|
+
default: () => createVNode(Fragment, null, [slots.default?.() ?? props.text, !props.hideSlider && createVNode("div", {
|
|
198
|
+
"ref": sliderEl,
|
|
199
|
+
"class": ['v-tab__slider', sliderColorClasses.value],
|
|
200
|
+
"style": sliderColorStyles.value
|
|
201
|
+
}, null)])
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
return forwardRefs({}, rootEl);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const VWindowSymbol = Symbol.for('vuetify:v-window');
|
|
209
|
+
const VWindowGroupSymbol = Symbol.for('vuetify:v-window-group');
|
|
210
|
+
const makeVWindowProps = propsFactory({
|
|
211
|
+
continuous: Boolean,
|
|
212
|
+
nextIcon: {
|
|
213
|
+
type: [Boolean, String, Function, Object],
|
|
214
|
+
default: '$next'
|
|
215
|
+
},
|
|
216
|
+
prevIcon: {
|
|
217
|
+
type: [Boolean, String, Function, Object],
|
|
218
|
+
default: '$prev'
|
|
219
|
+
},
|
|
220
|
+
reverse: Boolean,
|
|
221
|
+
showArrows: {
|
|
222
|
+
type: [Boolean, String],
|
|
223
|
+
validator: v => typeof v === 'boolean' || v === 'hover'
|
|
224
|
+
},
|
|
225
|
+
touch: {
|
|
226
|
+
type: [Object, Boolean],
|
|
227
|
+
default: undefined
|
|
228
|
+
},
|
|
229
|
+
direction: {
|
|
230
|
+
type: String,
|
|
231
|
+
default: 'horizontal'
|
|
232
|
+
},
|
|
233
|
+
modelValue: null,
|
|
234
|
+
disabled: Boolean,
|
|
235
|
+
selectedClass: {
|
|
236
|
+
type: String,
|
|
237
|
+
default: 'v-window-item--active'
|
|
238
|
+
},
|
|
239
|
+
// TODO: mandatory should probably not be exposed but do this for now
|
|
240
|
+
mandatory: {
|
|
241
|
+
type: [Boolean, String],
|
|
242
|
+
default: 'force'
|
|
243
|
+
},
|
|
244
|
+
...makeComponentProps(),
|
|
245
|
+
...makeTagProps(),
|
|
246
|
+
...makeThemeProps()
|
|
247
|
+
}, 'VWindow');
|
|
248
|
+
const VWindow = genericComponent()({
|
|
249
|
+
name: 'VWindow',
|
|
250
|
+
directives: {
|
|
251
|
+
Touch
|
|
252
|
+
},
|
|
253
|
+
props: makeVWindowProps(),
|
|
254
|
+
emits: {
|
|
255
|
+
'update:modelValue': value => true
|
|
256
|
+
},
|
|
257
|
+
setup(props, _ref) {
|
|
258
|
+
let {
|
|
259
|
+
slots
|
|
260
|
+
} = _ref;
|
|
261
|
+
const {
|
|
262
|
+
themeClasses
|
|
263
|
+
} = provideTheme(props);
|
|
264
|
+
const {
|
|
265
|
+
isRtl
|
|
266
|
+
} = useRtl();
|
|
267
|
+
const {
|
|
268
|
+
t
|
|
269
|
+
} = useLocale();
|
|
270
|
+
const group = useGroup(props, VWindowGroupSymbol);
|
|
271
|
+
const rootRef = ref();
|
|
272
|
+
const isRtlReverse = computed(() => isRtl.value ? !props.reverse : props.reverse);
|
|
273
|
+
const isReversed = shallowRef(false);
|
|
274
|
+
const transition = computed(() => {
|
|
275
|
+
const axis = props.direction === 'vertical' ? 'y' : 'x';
|
|
276
|
+
const reverse = isRtlReverse.value ? !isReversed.value : isReversed.value;
|
|
277
|
+
const direction = reverse ? '-reverse' : '';
|
|
278
|
+
return `v-window-${axis}${direction}-transition`;
|
|
279
|
+
});
|
|
280
|
+
const transitionCount = shallowRef(0);
|
|
281
|
+
const transitionHeight = ref(undefined);
|
|
282
|
+
const activeIndex = computed(() => {
|
|
283
|
+
return group.items.value.findIndex(item => group.selected.value.includes(item.id));
|
|
284
|
+
});
|
|
285
|
+
watch(activeIndex, (newVal, oldVal) => {
|
|
286
|
+
const itemsLength = group.items.value.length;
|
|
287
|
+
const lastIndex = itemsLength - 1;
|
|
288
|
+
if (itemsLength <= 2) {
|
|
289
|
+
isReversed.value = newVal < oldVal;
|
|
290
|
+
} else if (newVal === lastIndex && oldVal === 0) {
|
|
291
|
+
isReversed.value = true;
|
|
292
|
+
} else if (newVal === 0 && oldVal === lastIndex) {
|
|
293
|
+
isReversed.value = false;
|
|
294
|
+
} else {
|
|
295
|
+
isReversed.value = newVal < oldVal;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
provide(VWindowSymbol, {
|
|
299
|
+
transition,
|
|
300
|
+
isReversed,
|
|
301
|
+
transitionCount,
|
|
302
|
+
transitionHeight,
|
|
303
|
+
rootRef
|
|
304
|
+
});
|
|
305
|
+
const canMoveBack = computed(() => props.continuous || activeIndex.value !== 0);
|
|
306
|
+
const canMoveForward = computed(() => props.continuous || activeIndex.value !== group.items.value.length - 1);
|
|
307
|
+
function prev() {
|
|
308
|
+
canMoveBack.value && group.prev();
|
|
309
|
+
}
|
|
310
|
+
function next() {
|
|
311
|
+
canMoveForward.value && group.next();
|
|
312
|
+
}
|
|
313
|
+
const arrows = computed(() => {
|
|
314
|
+
const arrows = [];
|
|
315
|
+
const prevProps = {
|
|
316
|
+
icon: isRtl.value ? props.nextIcon : props.prevIcon,
|
|
317
|
+
class: `v-window__${isRtlReverse.value ? 'right' : 'left'}`,
|
|
318
|
+
onClick: group.prev,
|
|
319
|
+
'aria-label': t('$vuetify.carousel.prev')
|
|
320
|
+
};
|
|
321
|
+
arrows.push(canMoveBack.value ? slots.prev ? slots.prev({
|
|
322
|
+
props: prevProps
|
|
323
|
+
}) : createVNode(VBtn, prevProps, null) : createVNode("div", null, null));
|
|
324
|
+
const nextProps = {
|
|
325
|
+
icon: isRtl.value ? props.prevIcon : props.nextIcon,
|
|
326
|
+
class: `v-window__${isRtlReverse.value ? 'left' : 'right'}`,
|
|
327
|
+
onClick: group.next,
|
|
328
|
+
'aria-label': t('$vuetify.carousel.next')
|
|
329
|
+
};
|
|
330
|
+
arrows.push(canMoveForward.value ? slots.next ? slots.next({
|
|
331
|
+
props: nextProps
|
|
332
|
+
}) : createVNode(VBtn, nextProps, null) : createVNode("div", null, null));
|
|
333
|
+
return arrows;
|
|
334
|
+
});
|
|
335
|
+
const touchOptions = computed(() => {
|
|
336
|
+
if (props.touch === false) return props.touch;
|
|
337
|
+
const options = {
|
|
338
|
+
left: () => {
|
|
339
|
+
isRtlReverse.value ? prev() : next();
|
|
340
|
+
},
|
|
341
|
+
right: () => {
|
|
342
|
+
isRtlReverse.value ? next() : prev();
|
|
343
|
+
},
|
|
344
|
+
start: _ref2 => {
|
|
345
|
+
let {
|
|
346
|
+
originalEvent
|
|
347
|
+
} = _ref2;
|
|
348
|
+
originalEvent.stopPropagation();
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
return {
|
|
352
|
+
...options,
|
|
353
|
+
...(props.touch === true ? {} : props.touch)
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
useRender(() => withDirectives(createVNode(props.tag, {
|
|
357
|
+
"ref": rootRef,
|
|
358
|
+
"class": ['v-window', {
|
|
359
|
+
'v-window--show-arrows-on-hover': props.showArrows === 'hover'
|
|
360
|
+
}, themeClasses.value, props.class],
|
|
361
|
+
"style": props.style
|
|
362
|
+
}, {
|
|
363
|
+
default: () => [createVNode("div", {
|
|
364
|
+
"class": "v-window__container",
|
|
365
|
+
"style": {
|
|
366
|
+
height: transitionHeight.value
|
|
367
|
+
}
|
|
368
|
+
}, [slots.default?.({
|
|
369
|
+
group
|
|
370
|
+
}), props.showArrows !== false && createVNode("div", {
|
|
371
|
+
"class": "v-window__controls"
|
|
372
|
+
}, [arrows.value])]), slots.additional?.({
|
|
373
|
+
group
|
|
374
|
+
})]
|
|
375
|
+
}), [[resolveDirective("touch"), touchOptions.value]]));
|
|
376
|
+
return {
|
|
377
|
+
group
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
const makeVTabsWindowProps = propsFactory({
|
|
383
|
+
...omit(makeVWindowProps(), ['continuous', 'nextIcon', 'prevIcon', 'showArrows', 'touch', 'mandatory'])
|
|
384
|
+
}, 'VTabsWindow');
|
|
385
|
+
const VTabsWindow = genericComponent()({
|
|
386
|
+
name: 'VTabsWindow',
|
|
387
|
+
props: makeVTabsWindowProps(),
|
|
388
|
+
emits: {
|
|
389
|
+
'update:modelValue': v => true
|
|
390
|
+
},
|
|
391
|
+
setup(props, _ref) {
|
|
392
|
+
let {
|
|
393
|
+
slots
|
|
394
|
+
} = _ref;
|
|
395
|
+
const group = inject(VTabsSymbol, null);
|
|
396
|
+
const _model = useProxiedModel(props, 'modelValue');
|
|
397
|
+
const model = computed({
|
|
398
|
+
get() {
|
|
399
|
+
// Always return modelValue if defined
|
|
400
|
+
// or if not within a VTabs group
|
|
401
|
+
if (_model.value != null || !group) return _model.value;
|
|
402
|
+
|
|
403
|
+
// If inside of a VTabs, find the currently selected
|
|
404
|
+
// item by id. Item value may be assigned by its index
|
|
405
|
+
return group.items.value.find(item => group.selected.value.includes(item.id))?.value;
|
|
406
|
+
},
|
|
407
|
+
set(val) {
|
|
408
|
+
_model.value = val;
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
useRender(() => {
|
|
412
|
+
const windowProps = VWindow.filterProps(props);
|
|
413
|
+
return createVNode(VWindow, mergeProps({
|
|
414
|
+
"_as": "VTabsWindow"
|
|
415
|
+
}, windowProps, {
|
|
416
|
+
"modelValue": model.value,
|
|
417
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
418
|
+
"class": ['v-tabs-window', props.class],
|
|
419
|
+
"style": props.style,
|
|
420
|
+
"mandatory": false,
|
|
421
|
+
"touch": false
|
|
422
|
+
}), slots);
|
|
423
|
+
});
|
|
424
|
+
return {};
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
const makeVWindowItemProps = propsFactory({
|
|
429
|
+
reverseTransition: {
|
|
430
|
+
type: [Boolean, String],
|
|
431
|
+
default: undefined
|
|
432
|
+
},
|
|
433
|
+
transition: {
|
|
434
|
+
type: [Boolean, String],
|
|
435
|
+
default: undefined
|
|
436
|
+
},
|
|
437
|
+
...makeComponentProps(),
|
|
438
|
+
...makeGroupItemProps(),
|
|
439
|
+
...makeLazyProps()
|
|
440
|
+
}, 'VWindowItem');
|
|
441
|
+
const VWindowItem = genericComponent()({
|
|
442
|
+
name: 'VWindowItem',
|
|
443
|
+
directives: {
|
|
444
|
+
Touch
|
|
445
|
+
},
|
|
446
|
+
props: makeVWindowItemProps(),
|
|
447
|
+
emits: {
|
|
448
|
+
'group:selected': val => true
|
|
449
|
+
},
|
|
450
|
+
setup(props, _ref) {
|
|
451
|
+
let {
|
|
452
|
+
slots
|
|
453
|
+
} = _ref;
|
|
454
|
+
const window = inject(VWindowSymbol);
|
|
455
|
+
const groupItem = useGroupItem(props, VWindowGroupSymbol);
|
|
456
|
+
const {
|
|
457
|
+
isBooted
|
|
458
|
+
} = useSsrBoot();
|
|
459
|
+
if (!window || !groupItem) throw new Error('[Vuetify] VWindowItem must be used inside VWindow');
|
|
460
|
+
const isTransitioning = shallowRef(false);
|
|
461
|
+
const hasTransition = computed(() => isBooted.value && (window.isReversed.value ? props.reverseTransition !== false : props.transition !== false));
|
|
462
|
+
function onAfterTransition() {
|
|
463
|
+
if (!isTransitioning.value || !window) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Finalize transition state.
|
|
468
|
+
isTransitioning.value = false;
|
|
469
|
+
if (window.transitionCount.value > 0) {
|
|
470
|
+
window.transitionCount.value -= 1;
|
|
471
|
+
|
|
472
|
+
// Remove container height if we are out of transition.
|
|
473
|
+
if (window.transitionCount.value === 0) {
|
|
474
|
+
window.transitionHeight.value = undefined;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function onBeforeTransition() {
|
|
479
|
+
if (isTransitioning.value || !window) {
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// Initialize transition state here.
|
|
484
|
+
isTransitioning.value = true;
|
|
485
|
+
if (window.transitionCount.value === 0) {
|
|
486
|
+
// Set initial height for height transition.
|
|
487
|
+
window.transitionHeight.value = convertToUnit(window.rootRef.value?.clientHeight);
|
|
488
|
+
}
|
|
489
|
+
window.transitionCount.value += 1;
|
|
490
|
+
}
|
|
491
|
+
function onTransitionCancelled() {
|
|
492
|
+
onAfterTransition(); // This should have the same path as normal transition end.
|
|
493
|
+
}
|
|
494
|
+
function onEnterTransition(el) {
|
|
495
|
+
if (!isTransitioning.value) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
nextTick(() => {
|
|
499
|
+
// Do not set height if no transition or cancelled.
|
|
500
|
+
if (!hasTransition.value || !isTransitioning.value || !window) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Set transition target height.
|
|
505
|
+
window.transitionHeight.value = convertToUnit(el.clientHeight);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
const transition = computed(() => {
|
|
509
|
+
const name = window.isReversed.value ? props.reverseTransition : props.transition;
|
|
510
|
+
return !hasTransition.value ? false : {
|
|
511
|
+
name: typeof name !== 'string' ? window.transition.value : name,
|
|
512
|
+
onBeforeEnter: onBeforeTransition,
|
|
513
|
+
onAfterEnter: onAfterTransition,
|
|
514
|
+
onEnterCancelled: onTransitionCancelled,
|
|
515
|
+
onBeforeLeave: onBeforeTransition,
|
|
516
|
+
onAfterLeave: onAfterTransition,
|
|
517
|
+
onLeaveCancelled: onTransitionCancelled,
|
|
518
|
+
onEnter: onEnterTransition
|
|
519
|
+
};
|
|
520
|
+
});
|
|
521
|
+
const {
|
|
522
|
+
hasContent
|
|
523
|
+
} = useLazy(props, groupItem.isSelected);
|
|
524
|
+
useRender(() => createVNode(MaybeTransition, {
|
|
525
|
+
"transition": transition.value,
|
|
526
|
+
"disabled": !isBooted.value
|
|
527
|
+
}, {
|
|
528
|
+
default: () => [withDirectives(createVNode("div", {
|
|
529
|
+
"class": ['v-window-item', groupItem.selectedClass.value, props.class],
|
|
530
|
+
"style": props.style
|
|
531
|
+
}, [hasContent.value && slots.default?.()]), [[vShow, groupItem.isSelected.value]])]
|
|
532
|
+
}));
|
|
533
|
+
return {
|
|
534
|
+
groupItem
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
const makeVTabsWindowItemProps = propsFactory({
|
|
540
|
+
...makeVWindowItemProps()
|
|
541
|
+
}, 'VTabsWindowItem');
|
|
542
|
+
const VTabsWindowItem = genericComponent()({
|
|
543
|
+
name: 'VTabsWindowItem',
|
|
544
|
+
props: makeVTabsWindowItemProps(),
|
|
545
|
+
setup(props, _ref) {
|
|
546
|
+
let {
|
|
547
|
+
slots
|
|
548
|
+
} = _ref;
|
|
549
|
+
useRender(() => {
|
|
550
|
+
const windowItemProps = VWindowItem.filterProps(props);
|
|
551
|
+
return createVNode(VWindowItem, mergeProps({
|
|
552
|
+
"_as": "VTabsWindowItem"
|
|
553
|
+
}, windowItemProps, {
|
|
554
|
+
"class": ['v-tabs-window-item', props.class],
|
|
555
|
+
"style": props.style
|
|
556
|
+
}), slots);
|
|
557
|
+
});
|
|
558
|
+
return {};
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
function calculateUpdatedTarget(_ref) {
|
|
563
|
+
let {
|
|
564
|
+
selectedElement,
|
|
565
|
+
containerElement,
|
|
566
|
+
isRtl,
|
|
567
|
+
isHorizontal
|
|
568
|
+
} = _ref;
|
|
569
|
+
const containerSize = getOffsetSize(isHorizontal, containerElement);
|
|
570
|
+
const scrollPosition = getScrollPosition(isHorizontal, isRtl, containerElement);
|
|
571
|
+
const childrenSize = getOffsetSize(isHorizontal, selectedElement);
|
|
572
|
+
const childrenStartPosition = getOffsetPosition(isHorizontal, selectedElement);
|
|
573
|
+
const additionalOffset = childrenSize * 0.4;
|
|
574
|
+
if (scrollPosition > childrenStartPosition) {
|
|
575
|
+
return childrenStartPosition - additionalOffset;
|
|
576
|
+
} else if (scrollPosition + containerSize < childrenStartPosition + childrenSize) {
|
|
577
|
+
return childrenStartPosition - containerSize + childrenSize + additionalOffset;
|
|
578
|
+
}
|
|
579
|
+
return scrollPosition;
|
|
580
|
+
}
|
|
581
|
+
function calculateCenteredTarget(_ref2) {
|
|
582
|
+
let {
|
|
583
|
+
selectedElement,
|
|
584
|
+
containerElement,
|
|
585
|
+
isHorizontal
|
|
586
|
+
} = _ref2;
|
|
587
|
+
const containerOffsetSize = getOffsetSize(isHorizontal, containerElement);
|
|
588
|
+
const childrenOffsetPosition = getOffsetPosition(isHorizontal, selectedElement);
|
|
589
|
+
const childrenOffsetSize = getOffsetSize(isHorizontal, selectedElement);
|
|
590
|
+
return childrenOffsetPosition - containerOffsetSize / 2 + childrenOffsetSize / 2;
|
|
591
|
+
}
|
|
592
|
+
function getScrollSize(isHorizontal, element) {
|
|
593
|
+
const key = isHorizontal ? 'scrollWidth' : 'scrollHeight';
|
|
594
|
+
return element?.[key] || 0;
|
|
595
|
+
}
|
|
596
|
+
function getClientSize(isHorizontal, element) {
|
|
597
|
+
const key = isHorizontal ? 'clientWidth' : 'clientHeight';
|
|
598
|
+
return element?.[key] || 0;
|
|
599
|
+
}
|
|
600
|
+
function getScrollPosition(isHorizontal, rtl, element) {
|
|
601
|
+
if (!element) {
|
|
602
|
+
return 0;
|
|
603
|
+
}
|
|
604
|
+
const {
|
|
605
|
+
scrollLeft,
|
|
606
|
+
offsetWidth,
|
|
607
|
+
scrollWidth
|
|
608
|
+
} = element;
|
|
609
|
+
if (isHorizontal) {
|
|
610
|
+
return rtl ? scrollWidth - offsetWidth + scrollLeft : scrollLeft;
|
|
611
|
+
}
|
|
612
|
+
return element.scrollTop;
|
|
613
|
+
}
|
|
614
|
+
function getOffsetSize(isHorizontal, element) {
|
|
615
|
+
const key = isHorizontal ? 'offsetWidth' : 'offsetHeight';
|
|
616
|
+
return element?.[key] || 0;
|
|
617
|
+
}
|
|
618
|
+
function getOffsetPosition(isHorizontal, element) {
|
|
619
|
+
const key = isHorizontal ? 'offsetLeft' : 'offsetTop';
|
|
620
|
+
return element?.[key] || 0;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const VSlideGroupSymbol = Symbol.for('vuetify:v-slide-group');
|
|
624
|
+
const makeVSlideGroupProps = propsFactory({
|
|
625
|
+
centerActive: Boolean,
|
|
626
|
+
direction: {
|
|
627
|
+
type: String,
|
|
628
|
+
default: 'horizontal'
|
|
629
|
+
},
|
|
630
|
+
symbol: {
|
|
631
|
+
type: null,
|
|
632
|
+
default: VSlideGroupSymbol
|
|
633
|
+
},
|
|
634
|
+
nextIcon: {
|
|
635
|
+
type: IconValue,
|
|
636
|
+
default: '$next'
|
|
637
|
+
},
|
|
638
|
+
prevIcon: {
|
|
639
|
+
type: IconValue,
|
|
640
|
+
default: '$prev'
|
|
641
|
+
},
|
|
642
|
+
showArrows: {
|
|
643
|
+
type: [Boolean, String],
|
|
644
|
+
validator: v => typeof v === 'boolean' || ['always', 'desktop', 'mobile'].includes(v)
|
|
645
|
+
},
|
|
646
|
+
...makeComponentProps(),
|
|
647
|
+
...makeDisplayProps({
|
|
648
|
+
mobile: null
|
|
649
|
+
}),
|
|
650
|
+
...makeTagProps(),
|
|
651
|
+
...makeGroupProps({
|
|
652
|
+
selectedClass: 'v-slide-group-item--active'
|
|
653
|
+
})
|
|
654
|
+
}, 'VSlideGroup');
|
|
655
|
+
const VSlideGroup = genericComponent()({
|
|
656
|
+
name: 'VSlideGroup',
|
|
657
|
+
props: makeVSlideGroupProps(),
|
|
658
|
+
emits: {
|
|
659
|
+
'update:modelValue': value => true
|
|
660
|
+
},
|
|
661
|
+
setup(props, _ref) {
|
|
662
|
+
let {
|
|
663
|
+
slots
|
|
664
|
+
} = _ref;
|
|
665
|
+
const {
|
|
666
|
+
isRtl
|
|
667
|
+
} = useRtl();
|
|
668
|
+
const {
|
|
669
|
+
displayClasses,
|
|
670
|
+
mobile
|
|
671
|
+
} = useDisplay(props);
|
|
672
|
+
const group = useGroup(props, props.symbol);
|
|
673
|
+
const isOverflowing = shallowRef(false);
|
|
674
|
+
const scrollOffset = shallowRef(0);
|
|
675
|
+
const containerSize = shallowRef(0);
|
|
676
|
+
const contentSize = shallowRef(0);
|
|
677
|
+
const isHorizontal = computed(() => props.direction === 'horizontal');
|
|
678
|
+
const {
|
|
679
|
+
resizeRef: containerRef,
|
|
680
|
+
contentRect: containerRect
|
|
681
|
+
} = useResizeObserver();
|
|
682
|
+
const {
|
|
683
|
+
resizeRef: contentRef,
|
|
684
|
+
contentRect
|
|
685
|
+
} = useResizeObserver();
|
|
686
|
+
const goTo = useGoTo();
|
|
687
|
+
const goToOptions = computed(() => {
|
|
688
|
+
return {
|
|
689
|
+
container: containerRef.el,
|
|
690
|
+
duration: 200,
|
|
691
|
+
easing: 'easeOutQuart'
|
|
692
|
+
};
|
|
693
|
+
});
|
|
694
|
+
const firstSelectedIndex = computed(() => {
|
|
695
|
+
if (!group.selected.value.length) return -1;
|
|
696
|
+
return group.items.value.findIndex(item => item.id === group.selected.value[0]);
|
|
697
|
+
});
|
|
698
|
+
const lastSelectedIndex = computed(() => {
|
|
699
|
+
if (!group.selected.value.length) return -1;
|
|
700
|
+
return group.items.value.findIndex(item => item.id === group.selected.value[group.selected.value.length - 1]);
|
|
701
|
+
});
|
|
702
|
+
if (IN_BROWSER) {
|
|
703
|
+
let frame = -1;
|
|
704
|
+
watch(() => [group.selected.value, containerRect.value, contentRect.value, isHorizontal.value], () => {
|
|
705
|
+
cancelAnimationFrame(frame);
|
|
706
|
+
frame = requestAnimationFrame(() => {
|
|
707
|
+
if (containerRect.value && contentRect.value) {
|
|
708
|
+
const sizeProperty = isHorizontal.value ? 'width' : 'height';
|
|
709
|
+
containerSize.value = containerRect.value[sizeProperty];
|
|
710
|
+
contentSize.value = contentRect.value[sizeProperty];
|
|
711
|
+
isOverflowing.value = containerSize.value + 1 < contentSize.value;
|
|
712
|
+
}
|
|
713
|
+
if (firstSelectedIndex.value >= 0 && contentRef.el) {
|
|
714
|
+
// TODO: Is this too naive? Should we store element references in group composable?
|
|
715
|
+
const selectedElement = contentRef.el.children[lastSelectedIndex.value];
|
|
716
|
+
scrollToChildren(selectedElement, props.centerActive);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
const isFocused = shallowRef(false);
|
|
722
|
+
function scrollToChildren(children, center) {
|
|
723
|
+
let target = 0;
|
|
724
|
+
if (center) {
|
|
725
|
+
target = calculateCenteredTarget({
|
|
726
|
+
containerElement: containerRef.el,
|
|
727
|
+
isHorizontal: isHorizontal.value,
|
|
728
|
+
selectedElement: children
|
|
729
|
+
});
|
|
730
|
+
} else {
|
|
731
|
+
target = calculateUpdatedTarget({
|
|
732
|
+
containerElement: containerRef.el,
|
|
733
|
+
isHorizontal: isHorizontal.value,
|
|
734
|
+
isRtl: isRtl.value,
|
|
735
|
+
selectedElement: children
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
scrollToPosition(target);
|
|
739
|
+
}
|
|
740
|
+
function scrollToPosition(newPosition) {
|
|
741
|
+
if (!IN_BROWSER || !containerRef.el) return;
|
|
742
|
+
const offsetSize = getOffsetSize(isHorizontal.value, containerRef.el);
|
|
743
|
+
const scrollPosition = getScrollPosition(isHorizontal.value, isRtl.value, containerRef.el);
|
|
744
|
+
const scrollSize = getScrollSize(isHorizontal.value, containerRef.el);
|
|
745
|
+
if (scrollSize <= offsetSize ||
|
|
746
|
+
// Prevent scrolling by only a couple of pixels, which doesn't look smooth
|
|
747
|
+
Math.abs(newPosition - scrollPosition) < 16) return;
|
|
748
|
+
if (isHorizontal.value && isRtl.value && containerRef.el) {
|
|
749
|
+
const {
|
|
750
|
+
scrollWidth,
|
|
751
|
+
offsetWidth: containerWidth
|
|
752
|
+
} = containerRef.el;
|
|
753
|
+
newPosition = scrollWidth - containerWidth - newPosition;
|
|
754
|
+
}
|
|
755
|
+
if (isHorizontal.value) {
|
|
756
|
+
goTo.horizontal(newPosition, goToOptions.value);
|
|
757
|
+
} else {
|
|
758
|
+
goTo(newPosition, goToOptions.value);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function onScroll(e) {
|
|
762
|
+
const {
|
|
763
|
+
scrollTop,
|
|
764
|
+
scrollLeft
|
|
765
|
+
} = e.target;
|
|
766
|
+
scrollOffset.value = isHorizontal.value ? scrollLeft : scrollTop;
|
|
767
|
+
}
|
|
768
|
+
function onFocusin(e) {
|
|
769
|
+
isFocused.value = true;
|
|
770
|
+
if (!isOverflowing.value || !contentRef.el) return;
|
|
771
|
+
|
|
772
|
+
// Focused element is likely to be the root of an item, so a
|
|
773
|
+
// breadth-first search will probably find it in the first iteration
|
|
774
|
+
for (const el of e.composedPath()) {
|
|
775
|
+
for (const item of contentRef.el.children) {
|
|
776
|
+
if (item === el) {
|
|
777
|
+
scrollToChildren(item);
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function onFocusout(e) {
|
|
784
|
+
isFocused.value = false;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// Affix clicks produce onFocus that we have to ignore to avoid extra scrollToChildren
|
|
788
|
+
let ignoreFocusEvent = false;
|
|
789
|
+
function onFocus(e) {
|
|
790
|
+
if (!ignoreFocusEvent && !isFocused.value && !(e.relatedTarget && contentRef.el?.contains(e.relatedTarget))) focus();
|
|
791
|
+
ignoreFocusEvent = false;
|
|
792
|
+
}
|
|
793
|
+
function onFocusAffixes() {
|
|
794
|
+
ignoreFocusEvent = true;
|
|
795
|
+
}
|
|
796
|
+
function onKeydown(e) {
|
|
797
|
+
if (!contentRef.el) return;
|
|
798
|
+
function toFocus(location) {
|
|
799
|
+
e.preventDefault();
|
|
800
|
+
focus(location);
|
|
801
|
+
}
|
|
802
|
+
if (isHorizontal.value) {
|
|
803
|
+
if (e.key === 'ArrowRight') {
|
|
804
|
+
toFocus(isRtl.value ? 'prev' : 'next');
|
|
805
|
+
} else if (e.key === 'ArrowLeft') {
|
|
806
|
+
toFocus(isRtl.value ? 'next' : 'prev');
|
|
807
|
+
}
|
|
808
|
+
} else {
|
|
809
|
+
if (e.key === 'ArrowDown') {
|
|
810
|
+
toFocus('next');
|
|
811
|
+
} else if (e.key === 'ArrowUp') {
|
|
812
|
+
toFocus('prev');
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (e.key === 'Home') {
|
|
816
|
+
toFocus('first');
|
|
817
|
+
} else if (e.key === 'End') {
|
|
818
|
+
toFocus('last');
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
function focus(location) {
|
|
822
|
+
if (!contentRef.el) return;
|
|
823
|
+
let el;
|
|
824
|
+
if (!location) {
|
|
825
|
+
const focusable = focusableChildren(contentRef.el);
|
|
826
|
+
el = focusable[0];
|
|
827
|
+
} else if (location === 'next') {
|
|
828
|
+
el = contentRef.el.querySelector(':focus')?.nextElementSibling;
|
|
829
|
+
if (!el) return focus('first');
|
|
830
|
+
} else if (location === 'prev') {
|
|
831
|
+
el = contentRef.el.querySelector(':focus')?.previousElementSibling;
|
|
832
|
+
if (!el) return focus('last');
|
|
833
|
+
} else if (location === 'first') {
|
|
834
|
+
el = contentRef.el.firstElementChild;
|
|
835
|
+
} else if (location === 'last') {
|
|
836
|
+
el = contentRef.el.lastElementChild;
|
|
837
|
+
}
|
|
838
|
+
if (el) {
|
|
839
|
+
el.focus({
|
|
840
|
+
preventScroll: true
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function scrollTo(location) {
|
|
845
|
+
const direction = isHorizontal.value && isRtl.value ? -1 : 1;
|
|
846
|
+
const offsetStep = (location === 'prev' ? -direction : direction) * containerSize.value;
|
|
847
|
+
let newPosition = scrollOffset.value + offsetStep;
|
|
848
|
+
|
|
849
|
+
// TODO: improve it
|
|
850
|
+
if (isHorizontal.value && isRtl.value && containerRef.el) {
|
|
851
|
+
const {
|
|
852
|
+
scrollWidth,
|
|
853
|
+
offsetWidth: containerWidth
|
|
854
|
+
} = containerRef.el;
|
|
855
|
+
newPosition += scrollWidth - containerWidth;
|
|
856
|
+
}
|
|
857
|
+
scrollToPosition(newPosition);
|
|
858
|
+
}
|
|
859
|
+
const slotProps = computed(() => ({
|
|
860
|
+
next: group.next,
|
|
861
|
+
prev: group.prev,
|
|
862
|
+
select: group.select,
|
|
863
|
+
isSelected: group.isSelected
|
|
864
|
+
}));
|
|
865
|
+
const hasAffixes = computed(() => {
|
|
866
|
+
switch (props.showArrows) {
|
|
867
|
+
// Always show arrows on desktop & mobile
|
|
868
|
+
case 'always':
|
|
869
|
+
return true;
|
|
870
|
+
|
|
871
|
+
// Always show arrows on desktop
|
|
872
|
+
case 'desktop':
|
|
873
|
+
return !mobile.value;
|
|
874
|
+
|
|
875
|
+
// Show arrows on mobile when overflowing.
|
|
876
|
+
// This matches the default 2.2 behavior
|
|
877
|
+
case true:
|
|
878
|
+
return isOverflowing.value || Math.abs(scrollOffset.value) > 0;
|
|
879
|
+
|
|
880
|
+
// Always show on mobile
|
|
881
|
+
case 'mobile':
|
|
882
|
+
return mobile.value || isOverflowing.value || Math.abs(scrollOffset.value) > 0;
|
|
883
|
+
|
|
884
|
+
// https://material.io/components/tabs#scrollable-tabs
|
|
885
|
+
// Always show arrows when
|
|
886
|
+
// overflowed on desktop
|
|
887
|
+
default:
|
|
888
|
+
return !mobile.value && (isOverflowing.value || Math.abs(scrollOffset.value) > 0);
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
const hasPrev = computed(() => {
|
|
892
|
+
// 1 pixel in reserve, may be lost after rounding
|
|
893
|
+
return Math.abs(scrollOffset.value) > 1;
|
|
894
|
+
});
|
|
895
|
+
const hasNext = computed(() => {
|
|
896
|
+
if (!containerRef.value) return false;
|
|
897
|
+
const scrollSize = getScrollSize(isHorizontal.value, containerRef.el);
|
|
898
|
+
const clientSize = getClientSize(isHorizontal.value, containerRef.el);
|
|
899
|
+
const scrollSizeMax = scrollSize - clientSize;
|
|
900
|
+
|
|
901
|
+
// 1 pixel in reserve, may be lost after rounding
|
|
902
|
+
return scrollSizeMax - Math.abs(scrollOffset.value) > 1;
|
|
903
|
+
});
|
|
904
|
+
useRender(() => createVNode(props.tag, {
|
|
905
|
+
"class": ['v-slide-group', {
|
|
906
|
+
'v-slide-group--vertical': !isHorizontal.value,
|
|
907
|
+
'v-slide-group--has-affixes': hasAffixes.value,
|
|
908
|
+
'v-slide-group--is-overflowing': isOverflowing.value
|
|
909
|
+
}, displayClasses.value, props.class],
|
|
910
|
+
"style": props.style,
|
|
911
|
+
"tabindex": isFocused.value || group.selected.value.length ? -1 : 0,
|
|
912
|
+
"onFocus": onFocus
|
|
913
|
+
}, {
|
|
914
|
+
default: () => [hasAffixes.value && createVNode("div", {
|
|
915
|
+
"key": "prev",
|
|
916
|
+
"class": ['v-slide-group__prev', {
|
|
917
|
+
'v-slide-group__prev--disabled': !hasPrev.value
|
|
918
|
+
}],
|
|
919
|
+
"onMousedown": onFocusAffixes,
|
|
920
|
+
"onClick": () => hasPrev.value && scrollTo('prev')
|
|
921
|
+
}, [slots.prev?.(slotProps.value) ?? createVNode(VFadeTransition, null, {
|
|
922
|
+
default: () => [createVNode(VIcon, {
|
|
923
|
+
"icon": isRtl.value ? props.nextIcon : props.prevIcon
|
|
924
|
+
}, null)]
|
|
925
|
+
})]), createVNode("div", {
|
|
926
|
+
"key": "container",
|
|
927
|
+
"ref": containerRef,
|
|
928
|
+
"class": "v-slide-group__container",
|
|
929
|
+
"onScroll": onScroll
|
|
930
|
+
}, [createVNode("div", {
|
|
931
|
+
"ref": contentRef,
|
|
932
|
+
"class": "v-slide-group__content",
|
|
933
|
+
"onFocusin": onFocusin,
|
|
934
|
+
"onFocusout": onFocusout,
|
|
935
|
+
"onKeydown": onKeydown
|
|
936
|
+
}, [slots.default?.(slotProps.value)])]), hasAffixes.value && createVNode("div", {
|
|
937
|
+
"key": "next",
|
|
938
|
+
"class": ['v-slide-group__next', {
|
|
939
|
+
'v-slide-group__next--disabled': !hasNext.value
|
|
940
|
+
}],
|
|
941
|
+
"onMousedown": onFocusAffixes,
|
|
942
|
+
"onClick": () => hasNext.value && scrollTo('next')
|
|
943
|
+
}, [slots.next?.(slotProps.value) ?? createVNode(VFadeTransition, null, {
|
|
944
|
+
default: () => [createVNode(VIcon, {
|
|
945
|
+
"icon": isRtl.value ? props.prevIcon : props.nextIcon
|
|
946
|
+
}, null)]
|
|
947
|
+
})])]
|
|
948
|
+
}));
|
|
949
|
+
return {
|
|
950
|
+
selected: group.selected,
|
|
951
|
+
scrollTo,
|
|
952
|
+
scrollOffset,
|
|
953
|
+
focus,
|
|
954
|
+
hasPrev,
|
|
955
|
+
hasNext
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
function parseItems(items) {
|
|
961
|
+
if (!items) return [];
|
|
962
|
+
return items.map(item => {
|
|
963
|
+
if (!isObject(item)) return {
|
|
964
|
+
text: item,
|
|
965
|
+
value: item
|
|
966
|
+
};
|
|
967
|
+
return item;
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
const makeVTabsProps = propsFactory({
|
|
971
|
+
alignTabs: {
|
|
972
|
+
type: String,
|
|
973
|
+
default: 'start'
|
|
974
|
+
},
|
|
975
|
+
color: String,
|
|
976
|
+
fixedTabs: Boolean,
|
|
977
|
+
items: {
|
|
978
|
+
type: Array,
|
|
979
|
+
default: () => []
|
|
980
|
+
},
|
|
981
|
+
stacked: Boolean,
|
|
982
|
+
bgColor: String,
|
|
983
|
+
grow: Boolean,
|
|
984
|
+
height: {
|
|
985
|
+
type: [Number, String],
|
|
986
|
+
default: undefined
|
|
987
|
+
},
|
|
988
|
+
hideSlider: Boolean,
|
|
989
|
+
sliderColor: String,
|
|
990
|
+
...makeVSlideGroupProps({
|
|
991
|
+
mandatory: 'force',
|
|
992
|
+
selectedClass: 'v-tab-item--selected'
|
|
993
|
+
}),
|
|
994
|
+
...makeDensityProps(),
|
|
995
|
+
...makeTagProps()
|
|
996
|
+
}, 'VTabs');
|
|
997
|
+
const VTabs = genericComponent()({
|
|
998
|
+
name: 'VTabs',
|
|
999
|
+
props: makeVTabsProps(),
|
|
1000
|
+
emits: {
|
|
1001
|
+
'update:modelValue': v => true
|
|
1002
|
+
},
|
|
1003
|
+
setup(props, _ref) {
|
|
1004
|
+
let {
|
|
1005
|
+
attrs,
|
|
1006
|
+
slots
|
|
1007
|
+
} = _ref;
|
|
1008
|
+
const model = useProxiedModel(props, 'modelValue');
|
|
1009
|
+
const items = computed(() => parseItems(props.items));
|
|
1010
|
+
const {
|
|
1011
|
+
densityClasses
|
|
1012
|
+
} = useDensity(props);
|
|
1013
|
+
const {
|
|
1014
|
+
backgroundColorClasses,
|
|
1015
|
+
backgroundColorStyles
|
|
1016
|
+
} = useBackgroundColor(toRef(props, 'bgColor'));
|
|
1017
|
+
const {
|
|
1018
|
+
scopeId
|
|
1019
|
+
} = useScopeId();
|
|
1020
|
+
provideDefaults({
|
|
1021
|
+
VTab: {
|
|
1022
|
+
color: toRef(props, 'color'),
|
|
1023
|
+
direction: toRef(props, 'direction'),
|
|
1024
|
+
stacked: toRef(props, 'stacked'),
|
|
1025
|
+
fixed: toRef(props, 'fixedTabs'),
|
|
1026
|
+
sliderColor: toRef(props, 'sliderColor'),
|
|
1027
|
+
hideSlider: toRef(props, 'hideSlider')
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
useRender(() => {
|
|
1031
|
+
const slideGroupProps = VSlideGroup.filterProps(props);
|
|
1032
|
+
const hasWindow = !!(slots.window || props.items.length > 0);
|
|
1033
|
+
return createVNode(Fragment, null, [createVNode(VSlideGroup, mergeProps(slideGroupProps, {
|
|
1034
|
+
"modelValue": model.value,
|
|
1035
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
1036
|
+
"class": ['v-tabs', `v-tabs--${props.direction}`, `v-tabs--align-tabs-${props.alignTabs}`, {
|
|
1037
|
+
'v-tabs--fixed-tabs': props.fixedTabs,
|
|
1038
|
+
'v-tabs--grow': props.grow,
|
|
1039
|
+
'v-tabs--stacked': props.stacked
|
|
1040
|
+
}, densityClasses.value, backgroundColorClasses.value, props.class],
|
|
1041
|
+
"style": [{
|
|
1042
|
+
'--v-tabs-height': convertToUnit(props.height)
|
|
1043
|
+
}, backgroundColorStyles.value, props.style],
|
|
1044
|
+
"role": "tablist",
|
|
1045
|
+
"symbol": VTabsSymbol
|
|
1046
|
+
}, scopeId, attrs), {
|
|
1047
|
+
default: () => [slots.default?.() ?? items.value.map(item => slots.tab?.({
|
|
1048
|
+
item
|
|
1049
|
+
}) ?? createVNode(VTab, mergeProps(item, {
|
|
1050
|
+
"key": item.text,
|
|
1051
|
+
"value": item.value
|
|
1052
|
+
}), {
|
|
1053
|
+
default: slots[`tab.${item.value}`] ? () => slots[`tab.${item.value}`]?.({
|
|
1054
|
+
item
|
|
1055
|
+
}) : undefined
|
|
1056
|
+
}))]
|
|
1057
|
+
}), hasWindow && createVNode(VTabsWindow, mergeProps({
|
|
1058
|
+
"modelValue": model.value,
|
|
1059
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
1060
|
+
"key": "tabs-window"
|
|
1061
|
+
}, scopeId), {
|
|
1062
|
+
default: () => [items.value.map(item => slots.item?.({
|
|
1063
|
+
item
|
|
1064
|
+
}) ?? createVNode(VTabsWindowItem, {
|
|
1065
|
+
"value": item.value
|
|
1066
|
+
}, {
|
|
1067
|
+
default: () => slots[`item.${item.value}`]?.({
|
|
1068
|
+
item
|
|
1069
|
+
})
|
|
1070
|
+
})), slots.window?.()]
|
|
1071
|
+
})]);
|
|
1072
|
+
});
|
|
1073
|
+
return {};
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
const _hoisted_1 = {
|
|
1078
|
+
key: 0,
|
|
1079
|
+
id: "overlay",
|
|
1080
|
+
class: "pa-2 panel bg-surface"
|
|
1081
|
+
};
|
|
1082
|
+
const _hoisted_2 = { class: "component-container" };
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
const _sfc_main = {
|
|
1086
|
+
__name: 'MobileLayout',
|
|
1087
|
+
setup(__props) {
|
|
1088
|
+
|
|
1089
|
+
useCssVars(_ctx => ({
|
|
1090
|
+
"fbf7b91a": (mainRectTopPx.value),
|
|
1091
|
+
"2c845582": (tabsHeightFromBtm.value),
|
|
1092
|
+
"fdee920e": (mainRectBtmPx.value)
|
|
1093
|
+
}));
|
|
1094
|
+
|
|
1095
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
1096
|
+
|
|
1097
|
+
//import widgets
|
|
1098
|
+
const widgetsConfig = eodash.template.widgets;
|
|
1099
|
+
const importedWidgets = useDefineWidgets(widgetsConfig);
|
|
1100
|
+
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
1101
|
+
|
|
1102
|
+
const { mainRect } = useLayout();
|
|
1103
|
+
|
|
1104
|
+
const activeIdx = ref(-1);
|
|
1105
|
+
|
|
1106
|
+
/** @type {import("vue").Ref<import("vuetify/components").VTabs | null>} */
|
|
1107
|
+
const tabs = ref(null);
|
|
1108
|
+
const tabsHeightFromBtm = ref("");
|
|
1109
|
+
const mainRectTopPx = ref("");
|
|
1110
|
+
const mainRectBtmPx = ref("");
|
|
1111
|
+
|
|
1112
|
+
onMounted(() => {
|
|
1113
|
+
mainRectTopPx.value = mainRect.value.top + "px";
|
|
1114
|
+
mainRectBtmPx.value = (mainRect.value.bottom || 48) + "px";
|
|
1115
|
+
tabsHeightFromBtm.value =
|
|
1116
|
+
mainRect.value.bottom + (tabs.value?.$el?.clientHeight ?? 0) + "px";
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
return (_ctx, _cache) => {
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
return (openBlock(), createBlock(VMain, { class: "overflow-hidden main" }, {
|
|
1126
|
+
default: withCtx(() => [
|
|
1127
|
+
(openBlock(), createBlock(Suspense, { suspensible: "" }, {
|
|
1128
|
+
default: withCtx(() => [
|
|
1129
|
+
(unref(bgWidget).component)
|
|
1130
|
+
? (openBlock(), createBlock(resolveDynamicComponent(unref(bgWidget).component), mergeProps({
|
|
1131
|
+
key: 0,
|
|
1132
|
+
id: "bg-widget"
|
|
1133
|
+
}, unref(bgWidget).props), null, 16 /* FULL_PROPS */))
|
|
1134
|
+
: createCommentVNode("v-if", true)
|
|
1135
|
+
]),
|
|
1136
|
+
_: 1 /* STABLE */
|
|
1137
|
+
})),
|
|
1138
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(importedWidgets), (importedWidget, idx) => {
|
|
1139
|
+
return (openBlock(), createElementBlock(Fragment, { key: idx }, [
|
|
1140
|
+
(importedWidget.value.component)
|
|
1141
|
+
? withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1142
|
+
createVNode(VBtn, {
|
|
1143
|
+
icon: "",
|
|
1144
|
+
variant: "text",
|
|
1145
|
+
class: "close-btn",
|
|
1146
|
+
onClick: _cache[0] || (_cache[0] = $event => (activeIdx.value = -1))
|
|
1147
|
+
}, {
|
|
1148
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
1149
|
+
createTextVNode("✕")
|
|
1150
|
+
])),
|
|
1151
|
+
_: 1 /* STABLE */
|
|
1152
|
+
}),
|
|
1153
|
+
(openBlock(), createBlock(Suspense, { suspensible: "" }, {
|
|
1154
|
+
default: withCtx(() => [
|
|
1155
|
+
withDirectives(createElementVNode("div", _hoisted_2, [
|
|
1156
|
+
(openBlock(), createBlock(resolveDynamicComponent(importedWidget.value.component), mergeProps({
|
|
1157
|
+
key: importedWidget.value.id,
|
|
1158
|
+
ref_for: true
|
|
1159
|
+
}, importedWidget.value.props), null, 16 /* FULL_PROPS */))
|
|
1160
|
+
], 512 /* NEED_PATCH */), [
|
|
1161
|
+
[vShow, activeIdx.value === idx]
|
|
1162
|
+
])
|
|
1163
|
+
]),
|
|
1164
|
+
_: 2 /* DYNAMIC */
|
|
1165
|
+
}, 1024 /* DYNAMIC_SLOTS */))
|
|
1166
|
+
], 512 /* NEED_PATCH */)), [
|
|
1167
|
+
[vShow, activeIdx.value === idx]
|
|
1168
|
+
])
|
|
1169
|
+
: createCommentVNode("v-if", true)
|
|
1170
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
1171
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
1172
|
+
createVNode(VTabs, {
|
|
1173
|
+
ref_key: "tabs",
|
|
1174
|
+
ref: tabs,
|
|
1175
|
+
"align-tabs": "center",
|
|
1176
|
+
"bg-color": "surface",
|
|
1177
|
+
class: "tabs",
|
|
1178
|
+
"show-arrows": "",
|
|
1179
|
+
modelValue: activeIdx.value,
|
|
1180
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((activeIdx).value = $event))
|
|
1181
|
+
}, {
|
|
1182
|
+
default: withCtx(() => [
|
|
1183
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(importedWidgets), (importedWidget, idx) => {
|
|
1184
|
+
return (openBlock(), createElementBlock(Fragment, { key: idx }, [
|
|
1185
|
+
(importedWidget.value.component)
|
|
1186
|
+
? (openBlock(), createBlock(VTab, {
|
|
1187
|
+
key: 0,
|
|
1188
|
+
value: idx
|
|
1189
|
+
}, {
|
|
1190
|
+
default: withCtx(() => [
|
|
1191
|
+
createTextVNode(toDisplayString(importedWidget.value.title), 1 /* TEXT */)
|
|
1192
|
+
]),
|
|
1193
|
+
_: 2 /* DYNAMIC */
|
|
1194
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["value"]))
|
|
1195
|
+
: createCommentVNode("v-if", true)
|
|
1196
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
1197
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
1198
|
+
]),
|
|
1199
|
+
_: 1 /* STABLE */
|
|
1200
|
+
}, 8 /* PROPS */, ["modelValue"])
|
|
1201
|
+
]),
|
|
1202
|
+
_: 1 /* STABLE */
|
|
1203
|
+
}))
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
};
|
|
1208
|
+
const MobileLayout = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-e69b9875"]]);
|
|
1209
|
+
|
|
1210
|
+
export { MobileLayout as default };
|