@geode/opengeodeweb-front 10.13.2-rc.1 → 10.13.2-rc.3
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.
|
@@ -5,7 +5,7 @@ const { button_label, button_color, color } = defineProps({
|
|
|
5
5
|
button_label: {
|
|
6
6
|
type: String,
|
|
7
7
|
required: false,
|
|
8
|
-
default: "
|
|
8
|
+
default: "Load the app",
|
|
9
9
|
},
|
|
10
10
|
button_color: {
|
|
11
11
|
type: String,
|
|
@@ -60,7 +60,7 @@ function submit() {
|
|
|
60
60
|
</VRow>
|
|
61
61
|
<VRow>
|
|
62
62
|
<VCol>
|
|
63
|
-
<VCheckbox label="
|
|
63
|
+
<VCheckbox label="Load the app" v-model="load" />
|
|
64
64
|
</VCol>
|
|
65
65
|
</VRow>
|
|
66
66
|
</VContainer>
|
|
@@ -68,8 +68,27 @@ function submit() {
|
|
|
68
68
|
</VCol>
|
|
69
69
|
</VRow>
|
|
70
70
|
<VRow align="center" justify="center">
|
|
71
|
-
<VCol cols="
|
|
72
|
-
<VBtn :text="button_label" :color="color || button_color" @click="submit" />
|
|
71
|
+
<VCol cols="auto" class="d-flex justify-center align-center">
|
|
72
|
+
<VBtn class="load-btn" :text="button_label" :color="color || button_color" @click="submit" />
|
|
73
73
|
</VCol>
|
|
74
74
|
</VRow>
|
|
75
75
|
</template>
|
|
76
|
+
|
|
77
|
+
<style scoped>
|
|
78
|
+
.load-btn {
|
|
79
|
+
padding: 0 40px !important;
|
|
80
|
+
height: 50px !important;
|
|
81
|
+
border-radius: 8px;
|
|
82
|
+
text-transform: none !important;
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
letter-spacing: 0.5px;
|
|
85
|
+
transition:
|
|
86
|
+
transform 0.2s ease,
|
|
87
|
+
box-shadow 0.2s ease !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.load-btn:hover {
|
|
91
|
+
transform: translateY(-2px);
|
|
92
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -11,10 +11,17 @@ const GAP_WIDTH = 10;
|
|
|
11
11
|
const PERCENT_100 = 100;
|
|
12
12
|
|
|
13
13
|
const TOTAL_PERCENT = 100;
|
|
14
|
+
const MAX_PANEL_WIDTH_RATIO = 0.8;
|
|
15
|
+
|
|
16
|
+
const { containerWidth } = defineProps({
|
|
17
|
+
containerWidth: { type: Number, required: true },
|
|
18
|
+
});
|
|
14
19
|
|
|
15
20
|
const treeviewStore = useTreeviewStore();
|
|
16
21
|
const emit = defineEmits(["show-menu"]);
|
|
17
22
|
|
|
23
|
+
const maxWidth = computed(() => containerWidth * MAX_PANEL_WIDTH_RATIO);
|
|
24
|
+
|
|
18
25
|
const mainView = computed(() => treeviewStore.opened_views[0]);
|
|
19
26
|
const additionalViews = computed(() => treeviewStore.opened_views.slice(1));
|
|
20
27
|
|
|
@@ -41,6 +48,28 @@ watch(
|
|
|
41
48
|
{ immediate: true },
|
|
42
49
|
);
|
|
43
50
|
|
|
51
|
+
watch(maxWidth, (newMax) => {
|
|
52
|
+
const hasAdditional = additionalViews.value.length > 0;
|
|
53
|
+
const gap = hasAdditional ? GAP_WIDTH : 0;
|
|
54
|
+
const total =
|
|
55
|
+
treeviewStore.panelWidth + (hasAdditional ? treeviewStore.additionalPanelWidth : 0) + gap;
|
|
56
|
+
|
|
57
|
+
if (total > newMax) {
|
|
58
|
+
if (hasAdditional) {
|
|
59
|
+
const newAdditionalWidth = newMax - treeviewStore.panelWidth - gap;
|
|
60
|
+
if (newAdditionalWidth < WIDTH_MIN) {
|
|
61
|
+
treeviewStore.setAdditionalPanelWidth(WIDTH_MIN);
|
|
62
|
+
const newMainWidth = newMax - WIDTH_MIN - gap;
|
|
63
|
+
treeviewStore.setPanelWidth(Math.max(WIDTH_MIN, newMainWidth));
|
|
64
|
+
} else {
|
|
65
|
+
treeviewStore.setAdditionalPanelWidth(newAdditionalWidth);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
treeviewStore.setPanelWidth(Math.max(WIDTH_MIN, newMax));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
44
73
|
function onDragStart(index) {
|
|
45
74
|
draggedIndex.value = index;
|
|
46
75
|
}
|
|
@@ -61,8 +90,15 @@ function onResizeStart(event) {
|
|
|
61
90
|
const startX = event.clientX;
|
|
62
91
|
function resize(move_event) {
|
|
63
92
|
const deltaX = move_event.clientX - startX;
|
|
64
|
-
|
|
65
|
-
|
|
93
|
+
let newWidth = Math.max(WIDTH_MIN, startWidth + deltaX);
|
|
94
|
+
const hasAdditional = additionalViews.value.length > 0;
|
|
95
|
+
const gap = hasAdditional ? GAP_WIDTH : 0;
|
|
96
|
+
const currentTotalWidth =
|
|
97
|
+
newWidth + (hasAdditional ? treeviewStore.additionalPanelWidth : 0) + gap;
|
|
98
|
+
if (currentTotalWidth > maxWidth.value) {
|
|
99
|
+
newWidth = maxWidth.value - (hasAdditional ? treeviewStore.additionalPanelWidth : 0) - gap;
|
|
100
|
+
}
|
|
101
|
+
treeviewStore.setPanelWidth(Math.max(WIDTH_MIN, newWidth));
|
|
66
102
|
document.body.style.userSelect = "none";
|
|
67
103
|
}
|
|
68
104
|
function stopResize() {
|
|
@@ -79,8 +115,12 @@ function onAdditionalResizeStart(event) {
|
|
|
79
115
|
const startX = event.clientX;
|
|
80
116
|
function resize(move_event) {
|
|
81
117
|
const deltaX = move_event.clientX - startX;
|
|
82
|
-
|
|
83
|
-
treeviewStore.
|
|
118
|
+
let newWidth = Math.max(WIDTH_MIN, startWidth + deltaX);
|
|
119
|
+
const currentTotalWidth = treeviewStore.panelWidth + newWidth + GAP_WIDTH;
|
|
120
|
+
if (currentTotalWidth > maxWidth.value) {
|
|
121
|
+
newWidth = maxWidth.value - treeviewStore.panelWidth - GAP_WIDTH;
|
|
122
|
+
}
|
|
123
|
+
treeviewStore.setAdditionalPanelWidth(Math.max(WIDTH_MIN, newWidth));
|
|
84
124
|
document.body.style.userSelect = "none";
|
|
85
125
|
}
|
|
86
126
|
function stopResize() {
|
|
@@ -44,7 +44,10 @@ defineExpose({ get_viewer_id });
|
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<template>
|
|
47
|
-
<ViewerObjectTreeLayout
|
|
47
|
+
<ViewerObjectTreeLayout
|
|
48
|
+
:container-width="containerWidth"
|
|
49
|
+
@show-menu="(args) => emit('show-menu', args)"
|
|
50
|
+
/>
|
|
48
51
|
<ViewerContextMenu
|
|
49
52
|
v-if="displayMenu"
|
|
50
53
|
:id="menuStore.current_id"
|
package/package.json
CHANGED