@geode/opengeodeweb-front 10.14.0-rc.3 → 10.14.0-rc.4
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/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +1 -0
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +3 -2
- package/app/stores/data.js +3 -5
- package/internal/stores/data_style/model/index.js +1 -0
- package/internal/stores/data_style/model/selection.js +17 -36
- package/package.json +2 -2
|
@@ -23,8 +23,8 @@ const opened = computed({
|
|
|
23
23
|
set: (val) => treeviewStore.setOpened(viewId, val),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const items = dataStore.refFormatedMeshComponents(
|
|
27
|
-
const mesh_components_selection = dataStyleStore.visibleMeshComponents(
|
|
26
|
+
const items = dataStore.refFormatedMeshComponents(viewId);
|
|
27
|
+
const mesh_components_selection = dataStyleStore.visibleMeshComponents(viewId);
|
|
28
28
|
|
|
29
29
|
const {
|
|
30
30
|
search,
|
|
@@ -88,6 +88,7 @@ function showContextMenu(event, item) {
|
|
|
88
88
|
item-value="id"
|
|
89
89
|
select-strategy="independent"
|
|
90
90
|
selectable
|
|
91
|
+
items-registration="props"
|
|
91
92
|
@update:selected="onSelectionChange"
|
|
92
93
|
>
|
|
93
94
|
<template #title="{ item }">
|
package/app/stores/data.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
9
9
|
|
|
10
10
|
const viewer_generic_schemas = viewer_schemas.opengeodeweb_viewer.generic;
|
|
11
11
|
|
|
12
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
12
13
|
export const useDataStore = defineStore("data", () => {
|
|
13
14
|
const viewerStore = useViewerStore();
|
|
14
15
|
|
|
@@ -67,12 +68,9 @@ export const useDataStore = defineStore("data", () => {
|
|
|
67
68
|
}));
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
function refFormatedMeshComponents(
|
|
71
|
+
function refFormatedMeshComponents(modelId) {
|
|
71
72
|
return useObservable(
|
|
72
|
-
liveQuery(() =>
|
|
73
|
-
const unwrapped_id = unref(id);
|
|
74
|
-
return formatedMeshComponents(unwrapped_id);
|
|
75
|
-
}),
|
|
73
|
+
liveQuery(() => formatedMeshComponents(modelId)),
|
|
76
74
|
{ initialValue: undefined },
|
|
77
75
|
);
|
|
78
76
|
}
|
|
@@ -10,6 +10,7 @@ import { useModelSelection } from "./selection";
|
|
|
10
10
|
import { useModelSurfacesStyle } from "./surfaces";
|
|
11
11
|
import { useModelVisibilityStyle } from "./visibility";
|
|
12
12
|
|
|
13
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
13
14
|
function useModelStyle() {
|
|
14
15
|
const dataStore = useDataStore();
|
|
15
16
|
const dataStyleState = useDataStyleState();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MESH_TYPES } from "@ogw_front/utils/default_styles";
|
|
2
2
|
import { database } from "@ogw_internal/database/database";
|
|
3
3
|
import { liveQuery } from "dexie";
|
|
4
|
+
import { useObservable } from "@vueuse/rxjs";
|
|
4
5
|
|
|
5
6
|
function buildSelection(modelId, components, stylesMap, typeStylesMap, dataStyleState) {
|
|
6
7
|
const componentsByType = Object.fromEntries(
|
|
@@ -40,44 +41,24 @@ function buildSelection(modelId, components, stylesMap, typeStylesMap, dataStyle
|
|
|
40
41
|
return selection;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
function useModelSelection(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
function useModelSelection(modelId, dataStyleState) {
|
|
45
|
+
return useObservable(
|
|
46
|
+
liveQuery(async () => {
|
|
47
|
+
const [allComponents, componentStyles, typeStyles] = await Promise.all([
|
|
48
|
+
database.model_components.where("id").equals(modelId).toArray(),
|
|
49
|
+
database.model_component_datastyle.where("id_model").equals(modelId).toArray(),
|
|
50
|
+
database.model_component_type_datastyle.where("id_model").equals(modelId).toArray(),
|
|
51
|
+
]);
|
|
52
|
+
if (allComponents.length === 0) {
|
|
53
|
+
return [];
|
|
51
54
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (allComponents.length === 0) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const stylesMap = Object.fromEntries(
|
|
64
|
-
componentStyles.map((style) => [style.id_component, style]),
|
|
65
|
-
);
|
|
66
|
-
const typeStylesMap = Object.fromEntries(typeStyles.map((style) => [style.type, style]));
|
|
67
|
-
|
|
68
|
-
return buildSelection(modelId, allComponents, stylesMap, typeStylesMap, dataStyleState);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const subscription = observable.subscribe({
|
|
72
|
-
next: (val) => {
|
|
73
|
-
selection.value = val;
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
onCleanup(() => subscription.unsubscribe());
|
|
77
|
-
},
|
|
78
|
-
{ immediate: true },
|
|
55
|
+
const stylesMap = Object.fromEntries(
|
|
56
|
+
componentStyles.map((style) => [style.id_component, style]),
|
|
57
|
+
);
|
|
58
|
+
const typeStylesMap = Object.fromEntries(typeStyles.map((style) => [style.type, style]));
|
|
59
|
+
return buildSelection(modelId, allComponents, stylesMap, typeStylesMap, dataStyleState);
|
|
60
|
+
}),
|
|
79
61
|
);
|
|
80
|
-
return selection;
|
|
81
62
|
}
|
|
82
63
|
|
|
83
64
|
export { buildSelection, useModelSelection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.14.0-rc.
|
|
3
|
+
"version": "10.14.0-rc.4",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"sass": "1.87.0",
|
|
64
64
|
"semver": "7.7.1",
|
|
65
65
|
"uuid": "11.1.0",
|
|
66
|
-
"vuetify": "3.
|
|
66
|
+
"vuetify": "3.12.5",
|
|
67
67
|
"vuetify-nuxt-module": "0.18.7",
|
|
68
68
|
"ws": "8.18.3",
|
|
69
69
|
"wslink": "1.12.4"
|