@geode/opengeodeweb-front 10.6.2 → 10.6.3-rc.1
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/.eslintrc.cjs +1 -1
- package/.oxlintrc.json +3 -22
- package/app/assets/geode_objects.js +26 -26
- package/app/components/Carousel.vue +62 -66
- package/app/components/CrsSelector.vue +48 -52
- package/app/components/DeleteDialog.vue +21 -37
- package/app/components/DragAndDrop.vue +35 -41
- package/app/components/ExtensionSelector.vue +50 -63
- package/app/components/FeedBack/ErrorBanner.vue +7 -10
- package/app/components/FeedBack/Snackers.vue +12 -14
- package/app/components/FetchingData.vue +1 -6
- package/app/components/FileSelector.vue +41 -47
- package/app/components/FileUploader.vue +62 -79
- package/app/components/GlassCard.vue +19 -19
- package/app/components/HybridRenderingView.vue +37 -38
- package/app/components/InfraConnected.vue +3 -3
- package/app/components/Inspector/InspectionButton.vue +27 -31
- package/app/components/Inspector/ResultPanel.vue +13 -24
- package/app/components/Launcher.vue +13 -13
- package/app/components/Loading.vue +63 -69
- package/app/components/MissingFilesSelector.vue +53 -73
- package/app/components/ObjectSelector.vue +81 -99
- package/app/components/PackagesVersions.vue +27 -30
- package/app/components/Recaptcha.vue +60 -71
- package/app/components/RemoteRenderingView.vue +102 -108
- package/app/components/Screenshot.vue +36 -42
- package/app/components/SearchBar.vue +5 -5
- package/app/components/Step.vue +37 -44
- package/app/components/Stepper.vue +29 -35
- package/app/components/VeaseViewToolbar.vue +69 -78
- package/app/components/ViewToolbar.vue +41 -45
- package/app/components/Viewer/BreadCrumb.vue +18 -30
- package/app/components/Viewer/ContextMenu.vue +176 -179
- package/app/components/Viewer/ContextMenuItem.vue +105 -117
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +6 -9
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +82 -93
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +84 -99
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +83 -98
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +62 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -108
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +82 -105
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +19 -23
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +26 -30
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +6 -9
- package/app/components/Viewer/Options/AttributeColorBar.vue +8 -8
- package/app/components/Viewer/Options/AttributeSelector.vue +73 -78
- package/app/components/Viewer/Options/ColorMapList.vue +115 -140
- package/app/components/Viewer/Options/ColorMapPicker.vue +128 -142
- package/app/components/Viewer/Options/ColorPicker.vue +9 -9
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -91
- package/app/components/Viewer/Options/TextureItem.vue +54 -58
- package/app/components/Viewer/Options/TexturesSelector.vue +22 -26
- package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +61 -68
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +83 -103
- package/app/components/Viewer/Solid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Solid/PointsOptions.vue +6 -9
- package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +82 -105
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +5 -5
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +5 -5
- package/app/components/Viewer/Tree/ObjectTree.vue +80 -89
- package/app/components/Viewer/TreeComponent.vue +43 -49
- package/app/components/Viewer/TreeObject.vue +48 -50
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +5 -5
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +5 -5
- package/app/components/Wrapper.vue +8 -8
- package/app/components/ZScaling.vue +18 -27
- package/app/composables/project_manager.js +57 -67
- package/app/composables/run_function_when_microservices_connected.js +8 -8
- package/app/plugins/auto_store_register.js +11 -13
- package/app/stores/app.js +118 -138
- package/app/stores/data.js +52 -68
- package/app/stores/data_style.js +36 -36
- package/app/stores/feedback.js +17 -20
- package/app/stores/geode.js +54 -55
- package/app/stores/hybrid_viewer.js +164 -177
- package/app/stores/infra.js +45 -55
- package/app/stores/lambda.js +26 -26
- package/app/stores/menu.js +78 -85
- package/app/stores/treeview.js +57 -65
- package/app/stores/viewer.js +92 -104
- package/app/utils/colormap.js +3 -3
- package/app/utils/config.js +16 -22
- package/app/utils/default_styles.js +50 -62
- package/app/utils/extension.js +44 -44
- package/app/utils/file_import_workflow.js +50 -64
- package/app/utils/local/app_mode.js +2 -2
- package/app/utils/local/cleanup.js +66 -72
- package/app/utils/local/microservices.js +61 -71
- package/app/utils/local/path.js +16 -19
- package/app/utils/local/scripts.js +22 -22
- package/app/utils/recaptcha.js +6 -6
- package/app/utils/server.js +21 -24
- package/app/utils/status.js +2 -2
- package/app/utils/treeview.js +4 -4
- package/app/utils/validate_schema.js +7 -7
- package/commitlint.config.js +2 -2
- package/eslint.config.js +4 -4
- package/internal/database/database.js +38 -46
- package/internal/database/extended_database.js +9 -10
- package/internal/database/tables/data.js +2 -3
- package/internal/database/tables/model_components.js +1 -1
- package/internal/database/tables/model_components_relation.js +1 -1
- package/internal/stores/data_style/mesh/cells/cell.js +47 -63
- package/internal/stores/data_style/mesh/cells/color.js +11 -16
- package/internal/stores/data_style/mesh/cells/common.js +6 -6
- package/internal/stores/data_style/mesh/cells/index.js +37 -47
- package/internal/stores/data_style/mesh/cells/textures.js +11 -12
- package/internal/stores/data_style/mesh/cells/vertex.js +47 -58
- package/internal/stores/data_style/mesh/cells/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/color.js +11 -16
- package/internal/stores/data_style/mesh/edges/common.js +6 -6
- package/internal/stores/data_style/mesh/edges/edge.js +47 -63
- package/internal/stores/data_style/mesh/edges/index.js +38 -52
- package/internal/stores/data_style/mesh/edges/vertex.js +47 -58
- package/internal/stores/data_style/mesh/edges/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/width.js +11 -16
- package/internal/stores/data_style/mesh/index.js +34 -34
- package/internal/stores/data_style/mesh/points/color.js +11 -16
- package/internal/stores/data_style/mesh/points/common.js +6 -6
- package/internal/stores/data_style/mesh/points/index.js +35 -49
- package/internal/stores/data_style/mesh/points/size.js +11 -16
- package/internal/stores/data_style/mesh/points/vertex.js +47 -58
- package/internal/stores/data_style/mesh/points/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polygons/color.js +11 -16
- package/internal/stores/data_style/mesh/polygons/common.js +6 -6
- package/internal/stores/data_style/mesh/polygons/index.js +36 -45
- package/internal/stores/data_style/mesh/polygons/polygon.js +45 -56
- package/internal/stores/data_style/mesh/polygons/textures.js +11 -16
- package/internal/stores/data_style/mesh/polygons/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polygons/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/color.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/common.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/index.js +29 -42
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +43 -47
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +11 -17
- package/internal/stores/data_style/model/blocks/color.js +21 -24
- package/internal/stores/data_style/model/blocks/common.js +6 -6
- package/internal/stores/data_style/model/blocks/index.js +13 -17
- package/internal/stores/data_style/model/blocks/visibility.js +21 -24
- package/internal/stores/data_style/model/corners/color.js +21 -24
- package/internal/stores/data_style/model/corners/common.js +6 -6
- package/internal/stores/data_style/model/corners/index.js +14 -18
- package/internal/stores/data_style/model/corners/visibility.js +21 -25
- package/internal/stores/data_style/model/edges/common.js +4 -4
- package/internal/stores/data_style/model/edges/index.js +7 -7
- package/internal/stores/data_style/model/edges/visibility.js +11 -15
- package/internal/stores/data_style/model/index.js +84 -100
- package/internal/stores/data_style/model/lines/color.js +21 -24
- package/internal/stores/data_style/model/lines/common.js +6 -6
- package/internal/stores/data_style/model/lines/index.js +13 -17
- package/internal/stores/data_style/model/lines/visibility.js +21 -24
- package/internal/stores/data_style/model/points/common.js +4 -4
- package/internal/stores/data_style/model/points/index.js +9 -9
- package/internal/stores/data_style/model/points/size.js +11 -11
- package/internal/stores/data_style/model/points/visibility.js +11 -15
- package/internal/stores/data_style/model/surfaces/color.js +21 -24
- package/internal/stores/data_style/model/surfaces/common.js +6 -6
- package/internal/stores/data_style/model/surfaces/index.js +14 -22
- package/internal/stores/data_style/model/surfaces/visibility.js +18 -22
- package/internal/stores/data_style/state.js +11 -11
- package/internal/utils/api_fetch.js +24 -34
- package/internal/utils/upload_file.js +19 -24
- package/internal/utils/viewer_call.js +23 -36
- package/nuxt.config.js +7 -11
- package/package.json +3 -3
- package/scripts/generate_geode_objects.js +14 -16
- package/server/api/app/kill.post.js +4 -4
- package/server/api/app/project_folder_path.post.js +11 -11
- package/server/api/app/run_back.post.js +12 -12
- package/server/api/app/run_viewer.post.js +12 -12
- package/server/api/extensions/run.post.js +34 -41
- package/server/api/extensions/upload.put.js +48 -62
- package/tests/integration/setup.js +43 -53
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +90 -116
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +81 -107
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +38 -41
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +85 -101
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +89 -113
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +81 -105
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +56 -73
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +59 -76
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +39 -42
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -34
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +60 -73
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +52 -55
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +59 -80
- package/tests/integration/stores/viewer.nuxt.test.js +35 -38
- package/tests/setup_indexeddb.js +2 -2
- package/tests/unit/components/CrsSelector.nuxt.test.js +28 -28
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +33 -35
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -23
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +18 -18
- package/tests/unit/components/FileSelector.nuxt.test.js +57 -59
- package/tests/unit/components/FileUploader.nuxt.test.js +35 -39
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +28 -28
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +22 -27
- package/tests/unit/components/Launcher.nuxt.test.js +20 -22
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +37 -37
- package/tests/unit/components/ObjectSelector.nuxt.test.js +62 -62
- package/tests/unit/components/PackagesVersions.nuxt.test.js +16 -16
- package/tests/unit/components/Step.nuxt.test.js +18 -19
- package/tests/unit/components/Stepper.nuxt.test.js +18 -18
- package/tests/unit/composables/api_fetch.nuxt.test.js +34 -36
- package/tests/unit/composables/project_manager.nuxt.test.js +93 -112
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -36
- package/tests/unit/composables/upload_file.nuxt.test.js +27 -29
- package/tests/unit/plugins/project_load.nuxt.test.js +31 -33
- package/tests/unit/stores/app.nuxt.test.js +90 -92
- package/tests/unit/stores/feedback.nuxt.test.js +47 -57
- package/tests/unit/stores/geode.nuxt.test.js +111 -115
- package/tests/unit/stores/infra.nuxt.test.js +148 -148
- package/tests/unit/stores/lambda.nuxt.test.js +72 -74
- package/tests/unit/stores/treeview.nuxt.test.js +19 -21
- package/tests/unit/stores/viewer.nuxt.test.js +109 -122
- package/tests/unit/utils/recaptcha.nuxt.test.js +25 -29
- package/tests/unit/utils/validate_schema.nuxt.test.js +17 -17
- package/tests/utils.js +11 -11
- package/tests/vitest.config.js +9 -9
- package/vuetify_config.js +2 -2
|
@@ -1,159 +1,156 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (!isDragging.value) {
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
handleDrag(event)
|
|
55
|
-
},
|
|
56
|
-
{ passive: true },
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
useEventListener(globalThis, "mouseup", (event) => {
|
|
2
|
+
import { useEventListener } from "@vueuse/core";
|
|
3
|
+
import { useMenuStore } from "@ogw_front/stores/menu";
|
|
4
|
+
|
|
5
|
+
const RADIUS = 80;
|
|
6
|
+
const MARGIN_OFFSET = 40;
|
|
7
|
+
const Z_INDEX_MENU = 1000;
|
|
8
|
+
const Z_INDEX_ACTIVE_ITEM = 10;
|
|
9
|
+
const Z_INDEX_BASE_ITEM = 1;
|
|
10
|
+
const FULL_ANGLE = 360;
|
|
11
|
+
const ANGLE_45 = 45;
|
|
12
|
+
const ANGLE_135 = 135;
|
|
13
|
+
const ANGLE_225 = 225;
|
|
14
|
+
const ANGLE_315 = 315;
|
|
15
|
+
const CLOSE_DELAY = 100;
|
|
16
|
+
|
|
17
|
+
const menuStore = useMenuStore();
|
|
18
|
+
|
|
19
|
+
const { id, x, y, containerWidth, containerHeight } = defineProps({
|
|
20
|
+
id: { type: String, required: true },
|
|
21
|
+
x: { type: Number, required: true },
|
|
22
|
+
y: { type: Number, required: true },
|
|
23
|
+
containerWidth: { type: Number, required: true },
|
|
24
|
+
containerHeight: { type: Number, required: true },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const meta_data = computed(() => menuStore.current_meta_data || {});
|
|
28
|
+
|
|
29
|
+
const show_menu = ref(true);
|
|
30
|
+
const isDragging = ref(false);
|
|
31
|
+
const dragStartX = ref(0);
|
|
32
|
+
const dragStartY = ref(0);
|
|
33
|
+
const menuX = ref(x);
|
|
34
|
+
const menuY = ref(y);
|
|
35
|
+
|
|
36
|
+
watch(
|
|
37
|
+
() => [x, y],
|
|
38
|
+
([newX, newY]) => {
|
|
39
|
+
const { x: clampedX, y: clampedY } = clampPosition(newX, newY);
|
|
40
|
+
menuX.value = clampedX;
|
|
41
|
+
menuY.value = clampedY;
|
|
42
|
+
menuStore.setMenuPosition(clampedX, clampedY);
|
|
43
|
+
},
|
|
44
|
+
{ immediate: true },
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
useEventListener(
|
|
48
|
+
globalThis,
|
|
49
|
+
"mousemove",
|
|
50
|
+
(event) => {
|
|
60
51
|
if (!isDragging.value) {
|
|
61
|
-
return
|
|
52
|
+
return;
|
|
62
53
|
}
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
{ immediate: true },
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
const menuItemCount = computed(() => menu_items.value.length)
|
|
76
|
-
|
|
77
|
-
function startDrag(event) {
|
|
78
|
-
isDragging.value = true
|
|
79
|
-
dragStartX.value = event.clientX - menuX.value
|
|
80
|
-
dragStartY.value = event.clientY - menuY.value
|
|
81
|
-
event.preventDefault()
|
|
54
|
+
handleDrag(event);
|
|
55
|
+
},
|
|
56
|
+
{ passive: true },
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
useEventListener(globalThis, "mouseup", (event) => {
|
|
60
|
+
if (!isDragging.value) {
|
|
61
|
+
return;
|
|
82
62
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
stopDrag(event);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const menu_items = shallowRef([]);
|
|
67
|
+
watch(
|
|
68
|
+
() => [meta_data.value.viewer_type, meta_data.value.geode_object_type],
|
|
69
|
+
([viewer_type, geode_object_type]) => {
|
|
70
|
+
menu_items.value = menuStore.getMenuItems(viewer_type, geode_object_type);
|
|
71
|
+
},
|
|
72
|
+
{ immediate: true },
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const menuItemCount = computed(() => menu_items.value.length);
|
|
76
|
+
|
|
77
|
+
function startDrag(event) {
|
|
78
|
+
isDragging.value = true;
|
|
79
|
+
dragStartX.value = event.clientX - menuX.value;
|
|
80
|
+
dragStartY.value = event.clientY - menuY.value;
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function clampPosition(posX, posY) {
|
|
85
|
+
const margin = RADIUS + MARGIN_OFFSET;
|
|
86
|
+
return {
|
|
87
|
+
x: Math.min(Math.max(posX, margin), containerWidth - margin),
|
|
88
|
+
y: Math.min(Math.max(posY, margin), containerHeight - margin),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function handleDrag(event) {
|
|
93
|
+
const { x: clampedX, y: clampedY } = clampPosition(
|
|
94
|
+
event.clientX - dragStartX.value,
|
|
95
|
+
event.clientY - dragStartY.value,
|
|
96
|
+
);
|
|
97
|
+
menuX.value = clampedX;
|
|
98
|
+
menuY.value = clampedY;
|
|
99
|
+
menuStore.setMenuPosition(clampedX, clampedY);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function stopDrag(event) {
|
|
103
|
+
isDragging.value = false;
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
menuStore.setMenuPosition(menuX.value, menuY.value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getMenuStyle() {
|
|
109
|
+
return {
|
|
110
|
+
position: "fixed",
|
|
111
|
+
left: `${menuStore.containerLeft + menuX.value - RADIUS}px`,
|
|
112
|
+
top: `${menuStore.containerTop + menuY.value - RADIUS}px`,
|
|
113
|
+
zIndex: Z_INDEX_MENU,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getTooltipLocation(index) {
|
|
118
|
+
const angle = (index / menuItemCount.value) * FULL_ANGLE;
|
|
119
|
+
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
120
|
+
return "right";
|
|
90
121
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const { x: clampedX, y: clampedY } = clampPosition(
|
|
94
|
-
event.clientX - dragStartX.value,
|
|
95
|
-
event.clientY - dragStartY.value,
|
|
96
|
-
)
|
|
97
|
-
menuX.value = clampedX
|
|
98
|
-
menuY.value = clampedY
|
|
99
|
-
menuStore.setMenuPosition(clampedX, clampedY)
|
|
122
|
+
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
123
|
+
return "top";
|
|
100
124
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
isDragging.value = false
|
|
104
|
-
event.stopPropagation()
|
|
105
|
-
menuStore.setMenuPosition(menuX.value, menuY.value)
|
|
125
|
+
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
126
|
+
return "left";
|
|
106
127
|
}
|
|
128
|
+
return "bottom";
|
|
129
|
+
}
|
|
107
130
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
top: `${menuStore.containerTop + menuY.value - RADIUS}px`,
|
|
113
|
-
zIndex: Z_INDEX_MENU,
|
|
114
|
-
}
|
|
131
|
+
function getTooltipOrigin(index) {
|
|
132
|
+
const angle = (index / menuItemCount.value) * FULL_ANGLE;
|
|
133
|
+
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
134
|
+
return "left";
|
|
115
135
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const angle = (index / menuItemCount.value) * FULL_ANGLE
|
|
119
|
-
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
120
|
-
return "right"
|
|
121
|
-
}
|
|
122
|
-
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
123
|
-
return "top"
|
|
124
|
-
}
|
|
125
|
-
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
126
|
-
return "left"
|
|
127
|
-
}
|
|
128
|
-
return "bottom"
|
|
136
|
+
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
137
|
+
return "bottom";
|
|
129
138
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const angle = (index / menuItemCount.value) * FULL_ANGLE
|
|
133
|
-
if (angle < ANGLE_45 || angle >= ANGLE_315) {
|
|
134
|
-
return "left"
|
|
135
|
-
}
|
|
136
|
-
if (angle >= ANGLE_45 && angle < ANGLE_135) {
|
|
137
|
-
return "bottom"
|
|
138
|
-
}
|
|
139
|
-
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
140
|
-
return "right"
|
|
141
|
-
}
|
|
142
|
-
return "top"
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function getItemStyle(index) {
|
|
146
|
-
const angle = (index / menuItemCount.value) * 2 * Math.PI
|
|
147
|
-
return {
|
|
148
|
-
transform: `translate(${Math.cos(angle) * RADIUS}px, ${Math.sin(angle) * RADIUS}px)`,
|
|
149
|
-
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
150
|
-
position: "absolute",
|
|
151
|
-
zIndex:
|
|
152
|
-
menuStore.active_item_index === index
|
|
153
|
-
? Z_INDEX_ACTIVE_ITEM
|
|
154
|
-
: Z_INDEX_BASE_ITEM,
|
|
155
|
-
}
|
|
139
|
+
if (angle >= ANGLE_135 && angle < ANGLE_225) {
|
|
140
|
+
return "right";
|
|
156
141
|
}
|
|
142
|
+
return "top";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function getItemStyle(index) {
|
|
146
|
+
const angle = (index / menuItemCount.value) * 2 * Math.PI;
|
|
147
|
+
return {
|
|
148
|
+
transform: `translate(${Math.cos(angle) * RADIUS}px, ${Math.sin(angle) * RADIUS}px)`,
|
|
149
|
+
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
150
|
+
position: "absolute",
|
|
151
|
+
zIndex: menuStore.active_item_index === index ? Z_INDEX_ACTIVE_ITEM : Z_INDEX_BASE_ITEM,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
157
154
|
</script>
|
|
158
155
|
|
|
159
156
|
<template>
|
|
@@ -191,38 +188,38 @@
|
|
|
191
188
|
</template>
|
|
192
189
|
|
|
193
190
|
<style scoped>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
191
|
+
:deep(.circular-menu-container) {
|
|
192
|
+
overflow: visible !important;
|
|
193
|
+
box-shadow: none !important;
|
|
194
|
+
border: none !important;
|
|
195
|
+
background: transparent !important;
|
|
196
|
+
contain: none !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.circular-menu-drag-handle {
|
|
200
|
+
width: 100%;
|
|
201
|
+
height: 100%;
|
|
202
|
+
border-radius: 50%;
|
|
203
|
+
cursor: grab;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.circular-menu-drag-handle:active {
|
|
207
|
+
cursor: grabbing;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.circular-menu-items {
|
|
211
|
+
position: relative;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
border-radius: 50%;
|
|
216
|
+
background-color: transparent;
|
|
217
|
+
border: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.menu-item-wrapper {
|
|
221
|
+
position: absolute;
|
|
222
|
+
transform-origin: center;
|
|
223
|
+
will-change: transform, opacity;
|
|
224
|
+
}
|
|
228
225
|
</style>
|
|
@@ -1,80 +1,68 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!is_active.value || !optionsHeight.value) {
|
|
32
|
-
return {}
|
|
33
|
-
}
|
|
34
|
-
const angle = (index / itemProps.totalItems) * 2 * Math.PI
|
|
35
|
-
const radius = RADIUS
|
|
36
|
-
const absoluteButtonY = menuStore.menuY + Math.sin(angle) * radius
|
|
37
|
-
const height = optionsHeight.value
|
|
38
|
-
const margin = MARGIN
|
|
39
|
-
let offsetY = 0
|
|
40
|
-
|
|
41
|
-
if (absoluteButtonY - height / 2 < margin) {
|
|
42
|
-
offsetY = margin - (absoluteButtonY - height / 2)
|
|
43
|
-
} else if (
|
|
44
|
-
absoluteButtonY + height / 2 >
|
|
45
|
-
menuStore.containerHeight - margin
|
|
46
|
-
) {
|
|
47
|
-
offsetY =
|
|
48
|
-
menuStore.containerHeight - margin - (absoluteButtonY + height / 2)
|
|
49
|
-
}
|
|
50
|
-
return { top: `calc(50% + ${offsetY}px)` }
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const optionsClass = computed(() => {
|
|
54
|
-
const loc = itemProps.tooltip_location
|
|
55
|
-
const margin = MARGIN
|
|
56
|
-
const radius = RADIUS
|
|
57
|
-
if (loc === "right") {
|
|
58
|
-
return menuStore.menuX + radius + margin + CARD_WIDTH >
|
|
59
|
-
menuStore.containerWidth
|
|
60
|
-
? "options-left"
|
|
61
|
-
: "options-right"
|
|
62
|
-
}
|
|
63
|
-
return menuStore.menuX - radius - margin - CARD_WIDTH < 0
|
|
64
|
-
? "options-right"
|
|
65
|
-
: "options-left"
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
function toggleOptions() {
|
|
69
|
-
menuStore.toggleItemOptions(index)
|
|
2
|
+
import GlassCard from "@ogw_front/components/GlassCard";
|
|
3
|
+
import { useMenuStore } from "@ogw_front/stores/menu";
|
|
4
|
+
import { useTheme } from "vuetify";
|
|
5
|
+
|
|
6
|
+
const CARD_WIDTH = 320;
|
|
7
|
+
const CARD_HEIGHT = 500;
|
|
8
|
+
const MARGIN = 60;
|
|
9
|
+
const RADIUS = 80;
|
|
10
|
+
const OFFSET = 40;
|
|
11
|
+
|
|
12
|
+
const menuStore = useMenuStore();
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const primaryColor = computed(() => theme.current.value.colors.primary);
|
|
15
|
+
const { index, itemProps, tooltip, btn_image } = defineProps({
|
|
16
|
+
index: { type: Number, required: true },
|
|
17
|
+
itemProps: { type: Object, required: true },
|
|
18
|
+
tooltip: { type: String, required: true },
|
|
19
|
+
btn_image: { type: String, required: true },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const is_active = computed(() => menuStore.active_item_index === index);
|
|
23
|
+
const optionsRef = ref(undefined);
|
|
24
|
+
const { height: optionsHeight } = useElementSize(optionsRef);
|
|
25
|
+
|
|
26
|
+
const maxCardHeight = computed(() => Math.min(CARD_HEIGHT, menuStore.containerHeight - OFFSET));
|
|
27
|
+
|
|
28
|
+
const optionsStyle = computed(() => {
|
|
29
|
+
if (!is_active.value || !optionsHeight.value) {
|
|
30
|
+
return {};
|
|
70
31
|
}
|
|
32
|
+
const angle = (index / itemProps.totalItems) * 2 * Math.PI;
|
|
33
|
+
const radius = RADIUS;
|
|
34
|
+
const absoluteButtonY = menuStore.menuY + Math.sin(angle) * radius;
|
|
35
|
+
const height = optionsHeight.value;
|
|
36
|
+
const margin = MARGIN;
|
|
37
|
+
let offsetY = 0;
|
|
38
|
+
|
|
39
|
+
if (absoluteButtonY - height / 2 < margin) {
|
|
40
|
+
offsetY = margin - (absoluteButtonY - height / 2);
|
|
41
|
+
} else if (absoluteButtonY + height / 2 > menuStore.containerHeight - margin) {
|
|
42
|
+
offsetY = menuStore.containerHeight - margin - (absoluteButtonY + height / 2);
|
|
43
|
+
}
|
|
44
|
+
return { top: `calc(50% + ${offsetY}px)` };
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const optionsClass = computed(() => {
|
|
48
|
+
const loc = itemProps.tooltip_location;
|
|
49
|
+
const margin = MARGIN;
|
|
50
|
+
const radius = RADIUS;
|
|
51
|
+
if (loc === "right") {
|
|
52
|
+
return menuStore.menuX + radius + margin + CARD_WIDTH > menuStore.containerWidth
|
|
53
|
+
? "options-left"
|
|
54
|
+
: "options-right";
|
|
55
|
+
}
|
|
56
|
+
return menuStore.menuX - radius - margin - CARD_WIDTH < 0 ? "options-right" : "options-left";
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
function toggleOptions() {
|
|
60
|
+
menuStore.toggleItemOptions(index);
|
|
61
|
+
}
|
|
71
62
|
</script>
|
|
72
63
|
<template>
|
|
73
64
|
<v-sheet class="menu-item-container transition-swing" color="transparent">
|
|
74
|
-
<v-tooltip
|
|
75
|
-
:location="itemProps.tooltip_location"
|
|
76
|
-
:origin="itemProps.tooltip_origin"
|
|
77
|
-
>
|
|
65
|
+
<v-tooltip :location="itemProps.tooltip_location" :origin="itemProps.tooltip_origin">
|
|
78
66
|
<template v-slot:activator="{ props: tooltipProps }">
|
|
79
67
|
<v-btn
|
|
80
68
|
icon
|
|
@@ -118,49 +106,49 @@
|
|
|
118
106
|
</template>
|
|
119
107
|
|
|
120
108
|
<style scoped>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
109
|
+
.menu-item-container {
|
|
110
|
+
position: absolute;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
transition:
|
|
117
|
+
transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
|
|
118
|
+
opacity 0.3s ease;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.menu-btn {
|
|
122
|
+
transition: all 0.2s ease;
|
|
123
|
+
border-color: rgba(0, 0, 0, 0.1) !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menu-btn:hover {
|
|
127
|
+
transform: scale(1.1);
|
|
128
|
+
background-color: #e3f2fd !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.menu-btn.v-btn--active {
|
|
132
|
+
background-color: v-bind(primaryColor) !important;
|
|
133
|
+
color: white !important;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.menu-btn.v-btn--active ::v-deep(.v-img__img) {
|
|
137
|
+
filter: invert(100%);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.menu-options {
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 50%;
|
|
143
|
+
transform: translateY(-50%);
|
|
144
|
+
z-index: 1001;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.options-right {
|
|
148
|
+
left: 60px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.options-left {
|
|
152
|
+
right: 60px;
|
|
153
|
+
}
|
|
166
154
|
</style>
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import EdgedCurvePoints from "@ogw_front/assets/viewer_svgs/edged_curve_points.svg";
|
|
3
|
+
import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const { itemProps } = defineProps({
|
|
6
|
+
itemProps: { type: Object, required: true },
|
|
7
|
+
});
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<ViewerGenericMeshPointsOptions
|
|
12
|
-
:itemProps="itemProps"
|
|
13
|
-
:btn_image="EdgedCurvePoints"
|
|
14
|
-
/>
|
|
11
|
+
<ViewerGenericMeshPointsOptions :itemProps="itemProps" :btn_image="EdgedCurvePoints" />
|
|
15
12
|
</template>
|