@geode/opengeodeweb-front 10.34.0-rc.9 → 10.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{server → .build/server}/utils/app_config.js +10 -9
- package/{server → .build/server}/utils/cleanup.js +31 -17
- package/{server → .build/server}/utils/cloud.js +1 -4
- package/{server → .build/server}/utils/microservices.js +21 -9
- package/{server → .build/server}/utils/path.js +4 -4
- package/{server → .build/server}/utils/scripts.js +9 -9
- package/.build/server/utils/server_config.js +51 -0
- package/.build/server/utils/stream.js +6 -0
- package/{server → .build/server}/utils/ws_client.js +18 -3
- package/{shared → .build/shared}/scripts.js +10 -10
- package/.build/shared/utils/call_raw.js +31 -0
- package/{shared → .build/shared}/utils/call_schema.js +2 -2
- package/.build/shared/utils/fetch_raw.js +52 -0
- package/{shared → .build/shared}/utils/fetch_schema.js +2 -2
- package/{shared → .build/shared}/utils/file.js +3 -1
- package/{shared → .build/shared}/utils/response_handlers/load.js +10 -7
- package/{shared → .build/shared}/utils/validate_schema.js +1 -1
- package/app/components/ActionButton.vue +6 -6
- package/app/components/CameraManager/List.vue +5 -5
- package/app/components/CameraManager/Saver.vue +3 -5
- package/app/components/CameraManager.vue +6 -4
- package/app/components/CameraOrientation.vue +12 -12
- package/app/components/ClippingPlaneCard.vue +4 -2
- package/app/components/ClippingPlanes.vue +8 -8
- package/app/components/CrsSelector.vue +9 -10
- package/app/components/DeleteDialog.vue +4 -2
- package/app/components/DragAndDrop.vue +10 -12
- package/app/components/DragAndDropInternal/DragAndDropInline.vue +4 -2
- package/app/components/ExtensionSelector.vue +4 -4
- package/app/components/FeedBack/ErrorBanner.vue +3 -1
- package/app/components/FeedBack/Snackers.vue +4 -3
- package/app/components/FileSelector.vue +10 -8
- package/app/components/FileUploader.vue +11 -11
- package/app/components/GlassCard.vue +1 -1
- package/app/components/HybridRenderingView.vue +7 -5
- package/app/components/HybridViewerTooltip.vue +7 -7
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading/EcoMessages.vue +9 -3
- package/app/components/Loading.vue +2 -2
- package/app/components/MissingFilesSelector.vue +12 -10
- package/app/components/ObjectSelector.vue +10 -9
- package/app/components/PackagesVersions.vue +6 -5
- package/app/components/Recaptcha.vue +3 -3
- package/app/components/RemoteRenderingView.vue +6 -7
- package/app/components/Ruler.vue +3 -3
- package/app/components/Screenshot.vue +6 -6
- package/app/components/SearchBar.vue +4 -2
- package/app/components/ShrinkFilter.vue +7 -7
- package/app/components/Step.vue +6 -5
- package/app/components/Stepper.vue +4 -3
- package/app/components/ToolPanel.vue +6 -3
- package/app/components/ViewToolbar.vue +25 -28
- package/app/components/Viewer/ContextMenu/CenterButton.vue +7 -5
- package/app/components/Viewer/ContextMenu/CircularItems.vue +3 -3
- package/app/components/Viewer/ContextMenu/ContextMenu.vue +22 -19
- package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -8
- package/app/components/Viewer/ContextMenu/InfoCard.vue +11 -12
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +13 -17
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -16
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +8 -12
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +11 -15
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +53 -23
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +1 -3
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +31 -15
- package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +2 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +69 -38
- package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +64 -46
- package/app/components/Viewer/ObjectTree/Base/Controls.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +13 -9
- package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +10 -10
- package/app/components/Viewer/ObjectTree/Box.vue +6 -4
- package/app/components/Viewer/ObjectTree/Layout.vue +23 -21
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +14 -14
- package/app/components/Viewer/ObjectTree/Views/{ModelCollections.vue → ModelTree.vue} +59 -24
- package/app/components/Viewer/Options/AttributeColorBar.vue +4 -2
- package/app/components/Viewer/Options/AttributeRangeSelector.vue +4 -2
- package/app/components/Viewer/Options/AttributeSelector.vue +7 -9
- package/app/components/Viewer/Options/ColorMapList.vue +15 -13
- package/app/components/Viewer/Options/ColorMapPicker.vue +4 -4
- package/app/components/Viewer/Options/ColorPicker.vue +223 -41
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +16 -16
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +7 -5
- package/app/components/Viewer/Options/OptionsSection.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +8 -6
- package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +8 -9
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +2 -6
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +12 -16
- package/app/components/Viewer/Surface/PolygonsOptions.vue +12 -16
- package/app/components/Viewer/Ui.vue +2 -2
- package/app/components/Wrapper.vue +1 -4
- package/app/components/ZScaling.vue +5 -3
- package/app/components/csv-preview/CsvPreviewer.vue +38 -37
- package/app/components/csv-preview/CsvSettings.vue +6 -4
- package/app/components/csv-preview/CsvTable.vue +1 -1
- package/app/composables/batch_style.ts +5 -6
- package/app/composables/clipping_planes_widget.ts +73 -181
- package/app/composables/clipping_planes_widget_entries.ts +189 -0
- package/app/composables/copy_to_clipboard.ts +7 -0
- package/app/composables/global_attribute_style.ts +163 -83
- package/app/composables/hover_highlight.ts +46 -14
- package/app/composables/model_collections.ts +26 -13
- package/app/composables/model_components.ts +26 -13
- package/app/composables/project_manager.ts +76 -19
- package/app/composables/responsive_middle_truncate.ts +13 -13
- package/app/composables/stepper_tree.ts +34 -11
- package/app/composables/tree_filter.ts +66 -44
- package/app/composables/tree_keyboard_nav.ts +25 -11
- package/app/composables/tree_scroll.ts +44 -14
- package/app/composables/use_adaptive_styles.ts +66 -23
- package/app/composables/use_overlapping_picker.ts +66 -16
- package/app/composables/use_quick_colormap.ts +16 -5
- package/app/composables/virtual_tree.ts +75 -43
- package/app/composables/vtk_implicit_plane_widget.d.ts +2 -0
- package/app/plugins/auto_store_register.ts +2 -7
- package/app/plugins/click_outside_ignore_snackbars.client.ts +39 -0
- package/app/stores/app.ts +57 -192
- package/app/stores/app_helpers/extension.ts +179 -0
- package/app/stores/back.ts +37 -21
- package/app/stores/camera_manager.ts +22 -20
- package/app/stores/cloud.ts +17 -13
- package/app/stores/data.ts +88 -47
- package/app/stores/data_helpers/collections.ts +36 -38
- package/app/stores/data_helpers/mesh.ts +45 -36
- package/app/stores/data_style.ts +50 -28
- package/app/stores/feedback.ts +6 -6
- package/app/stores/hybrid_viewer.ts +41 -52
- package/app/stores/infra.ts +39 -37
- package/app/stores/menu.ts +23 -14
- package/app/stores/treeview.ts +72 -42
- package/app/stores/viewer.ts +39 -27
- package/app/utils/attributes.ts +3 -3
- package/app/utils/clipping_planes.ts +111 -14
- package/app/utils/color_picker.ts +57 -0
- package/app/utils/colormap.ts +58 -35
- package/app/utils/default_styles/index.ts +2 -2
- package/app/utils/default_styles/meshes.ts +107 -13
- package/app/utils/default_styles/models.ts +83 -14
- package/app/utils/extension.ts +47 -20
- package/app/utils/import_workflow.ts +21 -13
- package/app/utils/name_cleaner.ts +1 -1
- package/app/utils/string.ts +1 -1
- package/app/utils/treeview.ts +2 -2
- package/internal/database/base_database.ts +7 -3
- package/internal/database/database.ts +36 -26
- package/internal/database/extended_database.ts +1 -1
- package/internal/stores/data_style/mesh/cells/cell.ts +70 -34
- package/internal/stores/data_style/mesh/cells/color.ts +12 -6
- package/internal/stores/data_style/mesh/cells/common.ts +18 -8
- package/internal/stores/data_style/mesh/cells/index.ts +122 -42
- package/internal/stores/data_style/mesh/cells/textures.ts +12 -6
- package/internal/stores/data_style/mesh/cells/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/cells/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/color.ts +12 -6
- package/internal/stores/data_style/mesh/edges/common.ts +14 -6
- package/internal/stores/data_style/mesh/edges/edge.ts +71 -39
- package/internal/stores/data_style/mesh/edges/index.ts +117 -42
- package/internal/stores/data_style/mesh/edges/vertex.ts +76 -39
- package/internal/stores/data_style/mesh/edges/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/width.ts +12 -4
- package/internal/stores/data_style/mesh/index.ts +30 -11
- package/internal/stores/data_style/mesh/points/color.ts +12 -6
- package/internal/stores/data_style/mesh/points/common.ts +21 -8
- package/internal/stores/data_style/mesh/points/index.ts +101 -50
- package/internal/stores/data_style/mesh/points/size.ts +12 -4
- package/internal/stores/data_style/mesh/points/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/points/visibility.ts +17 -7
- package/internal/stores/data_style/mesh/polygons/color.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/common.ts +23 -6
- package/internal/stores/data_style/mesh/polygons/index.ts +130 -70
- package/internal/stores/data_style/mesh/polygons/polygon.ts +77 -43
- package/internal/stores/data_style/mesh/polygons/textures.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polygons/visibility.ts +16 -6
- package/internal/stores/data_style/mesh/polyhedra/color.ts +12 -6
- package/internal/stores/data_style/mesh/polyhedra/common.ts +14 -6
- package/internal/stores/data_style/mesh/polyhedra/index.ts +115 -56
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +80 -39
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +16 -6
- package/internal/stores/data_style/model/blocks/color.ts +43 -13
- package/internal/stores/data_style/model/blocks/common.ts +21 -6
- package/internal/stores/data_style/model/blocks/index.ts +89 -59
- package/internal/stores/data_style/model/blocks/polyhedron.ts +101 -44
- package/internal/stores/data_style/model/blocks/vertex.ts +107 -42
- package/internal/stores/data_style/model/blocks/visibility.ts +17 -4
- package/internal/stores/data_style/model/color.ts +171 -83
- package/internal/stores/data_style/model/common.ts +70 -21
- package/internal/stores/data_style/model/corners/color.ts +43 -11
- package/internal/stores/data_style/model/corners/common.ts +25 -6
- package/internal/stores/data_style/model/corners/index.ts +66 -41
- package/internal/stores/data_style/model/corners/vertex.ts +105 -74
- package/internal/stores/data_style/model/corners/visibility.ts +19 -4
- package/internal/stores/data_style/model/edges/common.ts +12 -4
- package/internal/stores/data_style/model/edges/index.ts +2 -1
- package/internal/stores/data_style/model/edges/visibility.ts +24 -7
- package/internal/stores/data_style/model/index.ts +24 -11
- package/internal/stores/data_style/model/lines/color.ts +41 -11
- package/internal/stores/data_style/model/lines/common.ts +17 -6
- package/internal/stores/data_style/model/lines/edge.ts +105 -42
- package/internal/stores/data_style/model/lines/index.ts +86 -59
- package/internal/stores/data_style/model/lines/vertex.ts +105 -42
- package/internal/stores/data_style/model/lines/visibility.ts +17 -4
- package/internal/stores/data_style/model/points/common.ts +8 -4
- package/internal/stores/data_style/model/points/index.ts +10 -3
- package/internal/stores/data_style/model/points/size.ts +12 -4
- package/internal/stores/data_style/model/points/visibility.ts +16 -6
- package/internal/stores/data_style/model/selection.ts +80 -58
- package/internal/stores/data_style/model/surfaces/color.ts +41 -11
- package/internal/stores/data_style/model/surfaces/common.ts +23 -6
- package/internal/stores/data_style/model/surfaces/index.ts +89 -59
- package/internal/stores/data_style/model/surfaces/polygon.ts +107 -67
- package/internal/stores/data_style/model/surfaces/vertex.ts +111 -67
- package/internal/stores/data_style/model/surfaces/visibility.ts +18 -5
- package/internal/stores/data_style/model/visibility.ts +82 -20
- package/internal/stores/data_style/state.ts +77 -65
- package/internal/stores/hybrid_viewer/brightness.ts +49 -31
- package/internal/stores/hybrid_viewer/camera.ts +191 -177
- package/internal/stores/hybrid_viewer/camera_animation.ts +11 -10
- package/internal/stores/hybrid_viewer/core.ts +64 -0
- package/internal/stores/hybrid_viewer/filters.ts +10 -16
- package/internal/stores/hybrid_viewer/highlight.ts +91 -130
- package/internal/stores/hybrid_viewer/ruler.ts +24 -15
- package/internal/stores/hybrid_viewer/scene.ts +96 -117
- package/internal/stores/hybrid_viewer/viewport.ts +74 -65
- package/internal/stores/hybrid_viewer/vtk_types.ts +13 -29
- package/internal/utils/api_fetch.ts +54 -23
- package/internal/utils/upload_file.ts +74 -53
- package/internal/utils/viewer_call.ts +22 -13
- package/internal/utils/ws_client.ts +24 -13
- package/nuxt.config.ts +58 -1
- package/package.json +20 -8
- package/server/api/cloud/extensions/run.post.ts +6 -10
- package/server/api/local/app/project_folder_path.post.ts +4 -4
- package/server/api/local/app/run_back.post.ts +5 -7
- package/server/api/local/app/run_viewer.post.ts +5 -7
- package/server/api/local/extensions/kill.post.ts +4 -3
- package/server/api/local/extensions/run.post.ts +7 -10
- package/server/api/local/extensions/upload.put.ts +44 -54
- package/server/api/microservice/app/get_is_app_ready.get.ts +4 -5
- package/server/api/microservice/app/set_app_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_back_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_is_app_ready.post.ts +5 -6
- package/server/api/microservice/app/set_viewer_base_url.post.ts +5 -6
- package/server/api/microservice/extensions/download.post.ts +5 -4
- package/server/api/serverless/run_cloud.post.ts +53 -11
- package/server/utils/app_config.ts +29 -22
- package/server/utils/cleanup.ts +60 -30
- package/server/utils/cloud.ts +9 -8
- package/server/utils/extension.ts +23 -9
- package/server/utils/microservices.ts +33 -24
- package/server/utils/path.ts +4 -4
- package/server/utils/scripts.ts +26 -23
- package/server/utils/server.ts +2 -2
- package/server/utils/server_config.ts +41 -27
- package/server/utils/stream.ts +6 -0
- package/server/utils/ws_client.ts +42 -8
- package/shared/scripts.ts +15 -10
- package/shared/utils/call_raw.ts +23 -16
- package/shared/utils/call_schema.ts +5 -8
- package/shared/utils/fetch_raw.ts +87 -47
- package/shared/utils/fetch_schema.ts +6 -9
- package/shared/utils/file.ts +8 -2
- package/shared/utils/response_handlers/load.ts +26 -11
- package/shared/utils/types.ts +9 -9
- package/shared/utils/validate_schema.ts +1 -1
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +0 -276
- package/server/types/vendor.d.ts +0 -64
- package/server/utils/server_config.js +0 -43
- package/shared/utils/call_raw.js +0 -30
- package/shared/utils/fetch_raw.js +0 -40
- /package/{opengeodeweb_front_schemas.js → .build/opengeodeweb_front_schemas.js} +0 -0
- /package/{server → .build/server}/utils/server.js +0 -0
- /package/{shared → .build/shared}/app_mode.js +0 -0
- /package/{shared → .build/shared}/utils/parse_boolean.js +0 -0
- /package/{shared → .build/shared}/utils/types.js +0 -0
|
@@ -10,7 +10,8 @@ function getObject(objectMap, key) {
|
|
|
10
10
|
function selectGeodeObject(objectMap) {
|
|
11
11
|
const objectKeys = Object.keys(objectMap);
|
|
12
12
|
if (objectKeys.length === 0) return;
|
|
13
|
-
|
|
13
|
+
const [firstKey] = objectKeys;
|
|
14
|
+
if (objectKeys.length === 1 && firstKey !== void 0 && getObject(objectMap, firstKey).is_loadable > 0) return firstKey;
|
|
14
15
|
const highestLoadScore = Math.max(...objectKeys.map((key) => getObject(objectMap, key).is_loadable));
|
|
15
16
|
if (highestLoadScore <= 0) return;
|
|
16
17
|
const bestScoreObjects = objectKeys.filter((key) => getObject(objectMap, key).is_loadable === highestLoadScore);
|
|
@@ -22,17 +23,19 @@ function selectGeodeObject(objectMap) {
|
|
|
22
23
|
function intersectAllowedObjects(allowedObjectsList) {
|
|
23
24
|
const allKeys = [...new Set(allowedObjectsList.flatMap((object) => Object.keys(object)))];
|
|
24
25
|
const commonKeys = allKeys.filter((key) => allowedObjectsList.every((object) => key in object));
|
|
25
|
-
const
|
|
26
|
-
for (const key of commonKeys) {
|
|
26
|
+
const mergedEntries = commonKeys.map((key) => {
|
|
27
27
|
const loadScores = allowedObjectsList.map((object) => getObject(object, key).is_loadable);
|
|
28
28
|
const priorities = allowedObjectsList.map((object) => getObject(object, key).object_priority).filter((priority) => priority !== void 0);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if (priorities.length > 0) return [key, {
|
|
30
|
+
is_loadable: Math.min(...loadScores),
|
|
31
|
+
object_priority: Math.max(...priorities)
|
|
32
|
+
}];
|
|
33
|
+
return [key, { is_loadable: Math.min(...loadScores) }];
|
|
34
|
+
});
|
|
32
35
|
return {
|
|
33
36
|
commonKeys,
|
|
34
37
|
allKeys,
|
|
35
|
-
mergedAllowedObjects
|
|
38
|
+
mergedAllowedObjects: Object.fromEntries(mergedEntries)
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
function resolveAllowedObjects(filenames, allowedObjectsList) {
|
|
@@ -6,10 +6,8 @@ interface Props {
|
|
|
6
6
|
tooltip: string;
|
|
7
7
|
color?: string;
|
|
8
8
|
size?: string | number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
variant?: any;
|
|
12
|
-
density?: any;
|
|
9
|
+
variant?: unknown;
|
|
10
|
+
density?: unknown;
|
|
13
11
|
tooltipLocation?: string;
|
|
14
12
|
iconSize?: string | number;
|
|
15
13
|
}
|
|
@@ -25,9 +23,11 @@ const {
|
|
|
25
23
|
iconSize = DEFAULT_ICON_SIZE,
|
|
26
24
|
} = defineProps<Props>();
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
interface Emits {
|
|
29
27
|
click: [event: MouseEvent];
|
|
30
|
-
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<Emits>();
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<template>
|
|
@@ -8,9 +8,9 @@ const hybridViewerStore = useHybridViewerStore();
|
|
|
8
8
|
const savedPositions = cameraManagerStore.refAllCameraPositions();
|
|
9
9
|
|
|
10
10
|
const editingId = ref<number | undefined>(undefined);
|
|
11
|
-
const editingName = ref("");
|
|
11
|
+
const editingName = ref<string>("");
|
|
12
12
|
|
|
13
|
-
async function restorePosition(positionId: number) {
|
|
13
|
+
async function restorePosition(positionId: number): void {
|
|
14
14
|
const position = await cameraManagerStore.getCameraPosition(positionId);
|
|
15
15
|
if (position) {
|
|
16
16
|
if (hybridViewerStore.genericRenderWindow) {
|
|
@@ -21,16 +21,16 @@ async function restorePosition(positionId: number) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async function deletePosition(positionId: number) {
|
|
24
|
+
async function deletePosition(positionId: number): void {
|
|
25
25
|
await cameraManagerStore.deleteCameraPosition(positionId);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function startEditing(position: { id?: number; name?: string }) {
|
|
28
|
+
function startEditing(position: { id?: number; name?: string }): void {
|
|
29
29
|
editingId.value = position.id;
|
|
30
30
|
editingName.value = position.name ?? "";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
async function saveRename() {
|
|
33
|
+
async function saveRename(): void {
|
|
34
34
|
if (editingName.value && editingId.value !== undefined) {
|
|
35
35
|
await cameraManagerStore.renameCameraPosition(editingId.value, editingName.value);
|
|
36
36
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
2
|
+
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
|
|
4
3
|
import { useCameraManagerStore } from "@ogw_front/stores/camera_manager";
|
|
5
4
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
6
|
-
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
|
|
7
5
|
|
|
8
6
|
const cameraManagerStore = useCameraManagerStore();
|
|
9
7
|
const hybridViewerStore = useHybridViewerStore();
|
|
10
8
|
|
|
11
|
-
const newPositionName = ref("");
|
|
9
|
+
const newPositionName = ref<string>("");
|
|
12
10
|
|
|
13
|
-
async function saveCurrentPosition() {
|
|
11
|
+
async function saveCurrentPosition(): void {
|
|
14
12
|
if (!newPositionName.value) {
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
@@ -5,9 +5,11 @@ import ToolPanel from "@ogw_front/components/ToolPanel.vue";
|
|
|
5
5
|
|
|
6
6
|
const DEFAULT_PANEL_WIDTH = 260;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface Emits {
|
|
9
9
|
close: [];
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<Emits>();
|
|
11
13
|
|
|
12
14
|
interface Props {
|
|
13
15
|
showDialog: boolean;
|
|
@@ -21,7 +23,7 @@ const {
|
|
|
21
23
|
escapeFunction = undefined,
|
|
22
24
|
} = defineProps<Props>();
|
|
23
25
|
|
|
24
|
-
function handleClose() {
|
|
26
|
+
function handleClose(): void {
|
|
25
27
|
if (escapeFunction) {
|
|
26
28
|
escapeFunction();
|
|
27
29
|
} else {
|
|
@@ -29,7 +31,7 @@ function handleClose() {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
const show = computed({
|
|
34
|
+
const show = computed<boolean>({
|
|
33
35
|
get: () => showDialog,
|
|
34
36
|
set: (val) => {
|
|
35
37
|
if (!val) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
2
|
+
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
|
|
4
3
|
import ToolPanel from "@ogw_front/components/ToolPanel.vue";
|
|
5
4
|
import { applyCameraOptions } from "@ogw_internal/stores/hybrid_viewer/camera";
|
|
6
5
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
7
|
-
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
|
|
8
6
|
import { newInstance as vtkAnnotatedCubeActor } from "@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor";
|
|
9
7
|
import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
|
|
10
8
|
|
|
@@ -22,10 +20,13 @@ const {
|
|
|
22
20
|
escapeFunction = undefined,
|
|
23
21
|
} = defineProps<Props>();
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
const emit = defineEmits<{
|
|
23
|
+
interface Emits {
|
|
27
24
|
select: [value: string];
|
|
28
|
-
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<Emits>();
|
|
28
|
+
|
|
29
|
+
const show = defineModel<boolean>("show", { default: false });
|
|
29
30
|
|
|
30
31
|
const orientations = [
|
|
31
32
|
{
|
|
@@ -82,12 +83,11 @@ const hoveredFace = ref<string | undefined>(undefined);
|
|
|
82
83
|
const hybridViewerStore = useHybridViewerStore();
|
|
83
84
|
const cubeContainer = useTemplateRef("cubeContainer");
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
let cubeActor: any = undefined;
|
|
86
|
+
let genericRenderWindow: unknown = undefined;
|
|
87
|
+
let cubeActor: unknown = undefined;
|
|
88
88
|
let isInteracting = false;
|
|
89
89
|
|
|
90
|
-
function initVTK() {
|
|
90
|
+
function initVTK(): void {
|
|
91
91
|
if (genericRenderWindow) {
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
@@ -132,7 +132,7 @@ function initVTK() {
|
|
|
132
132
|
renderer.resetCamera();
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
function syncCubeCamera() {
|
|
135
|
+
function syncCubeCamera(): void {
|
|
136
136
|
const options = hybridViewerStore.camera_options;
|
|
137
137
|
if (!genericRenderWindow || isInteracting || !options.position) {
|
|
138
138
|
return;
|
|
@@ -165,7 +165,7 @@ watch(hoveredFace, (newFace, oldFace) => {
|
|
|
165
165
|
if (!cubeActor) {
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
function updateFace(face: string | undefined, active: boolean) {
|
|
168
|
+
function updateFace(face: string | undefined, active: boolean): void {
|
|
169
169
|
const config = orientations.find((orientation) => orientation.face === face);
|
|
170
170
|
if (config) {
|
|
171
171
|
cubeActor[`set${config.vtkKey}FaceProperty`]({
|
|
@@ -16,13 +16,13 @@ const { escapeFunction = undefined } = defineProps<Props>();
|
|
|
16
16
|
const show = defineModel<boolean>("show", { default: false });
|
|
17
17
|
const dataStore = useDataStore();
|
|
18
18
|
const hybridViewerStore = useHybridViewerStore();
|
|
19
|
-
const targetAllVisible = ref(true);
|
|
19
|
+
const targetAllVisible = ref<boolean>(true);
|
|
20
20
|
const selectedDatasetIds = ref<string[]>([]);
|
|
21
21
|
const planes = ref<{ origin?: number[]; normal: number[] }[]>([
|
|
22
22
|
{ origin: undefined, normal: [1, 0, 0] },
|
|
23
23
|
]);
|
|
24
24
|
const allItems = dataStore.refAllItems();
|
|
25
|
-
const availableDatasets = computed(() =>
|
|
25
|
+
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
|
|
26
26
|
allItems.value.map((item) => ({
|
|
27
27
|
title: item.name || item.id,
|
|
28
28
|
value: item.id,
|
|
@@ -49,7 +49,7 @@ const {
|
|
|
49
49
|
debouncedApply: (...args: unknown[]) => debouncedApply?.(...args),
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
async function applyClippingPlanes() {
|
|
52
|
+
async function applyClippingPlanes(): Promise<void> {
|
|
53
53
|
const allIds = allItems.value.map((item) => item.id);
|
|
54
54
|
if (allIds.length === 0) {
|
|
55
55
|
return;
|
|
@@ -72,7 +72,7 @@ async function applyClippingPlanes() {
|
|
|
72
72
|
|
|
73
73
|
debouncedApply = useDebounceFn(() => applyClippingPlanes(), DEBOUNCE_DELAY);
|
|
74
74
|
|
|
75
|
-
function addPlane() {
|
|
75
|
+
function addPlane(): void {
|
|
76
76
|
// Index is always in-bounds (modulo the fixed-size list); the fallbacks only
|
|
77
77
|
// Satisfy noUncheckedIndexedAccess and are never hit at runtime.
|
|
78
78
|
const normal = DEFAULT_NORMALS[planes.value.length % DEFAULT_NORMALS.length] ??
|
|
@@ -80,17 +80,17 @@ function addPlane() {
|
|
|
80
80
|
planes.value.push({ origin: getSceneCenter(), normal });
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function removePlane(index: number) {
|
|
83
|
+
function removePlane(index: number): void {
|
|
84
84
|
planes.value.splice(index, 1);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
function flipNormal(plane: { normal: number[] }) {
|
|
87
|
+
function flipNormal(plane: { normal: number[] }): void {
|
|
88
88
|
plane.normal = plane.normal.map((component) => -component);
|
|
89
89
|
syncWidgets();
|
|
90
90
|
applyClippingPlanes();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
async function resetClippingPlanes() {
|
|
93
|
+
async function resetClippingPlanes(): Promise<void> {
|
|
94
94
|
setFromWidget(true);
|
|
95
95
|
planes.value = [{ origin: undefined, normal: [1, 0, 0] }];
|
|
96
96
|
updateWidgetPlacement({ isReset: true });
|
|
@@ -98,7 +98,7 @@ async function resetClippingPlanes() {
|
|
|
98
98
|
await applyClippingPlanes();
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
async function removeClippingPlanes() {
|
|
101
|
+
async function removeClippingPlanes(): Promise<void> {
|
|
102
102
|
const allIds = allItems.value.map((item) => item.id);
|
|
103
103
|
await hybridViewerStore.setClippingPlanes(allIds, []);
|
|
104
104
|
}
|
|
@@ -4,11 +4,13 @@ import { useBackStore } from "@ogw_front/stores/back";
|
|
|
4
4
|
|
|
5
5
|
const schema = schemas.opengeodeweb_back.geographic_coordinate_systems;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface Emits {
|
|
8
8
|
update_values: [values: Record<string, unknown>];
|
|
9
9
|
increment_step: [];
|
|
10
10
|
decrement_step: [];
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits<Emits>();
|
|
12
14
|
|
|
13
15
|
interface Props {
|
|
14
16
|
geodeObjectType: string;
|
|
@@ -17,18 +19,15 @@ interface Props {
|
|
|
17
19
|
|
|
18
20
|
const { geodeObjectType, keyToUpdate } = defineProps<Props>();
|
|
19
21
|
|
|
20
|
-
const search = ref("");
|
|
21
|
-
const data_table_loading = ref(false);
|
|
22
|
+
const search = ref<string>("");
|
|
23
|
+
const data_table_loading = ref<boolean>(false);
|
|
22
24
|
const crs_list = ref<Record<string, unknown>[]>([]);
|
|
23
25
|
const selected_crs = ref<unknown[]>([]);
|
|
24
26
|
const toggle_loading = useToggle(data_table_loading);
|
|
25
27
|
const backStore = useBackStore();
|
|
26
28
|
|
|
27
|
-
function get_selected_crs(crs_code: unknown) {
|
|
28
|
-
|
|
29
|
-
// Crs_list, which would have thrown on `undefined["code"]` at runtime.
|
|
30
|
-
for (let i = 0; i < crs_list.value.length; i += 1) {
|
|
31
|
-
const crs = crs_list.value[i];
|
|
29
|
+
function get_selected_crs(crs_code: unknown): unknown {
|
|
30
|
+
for (const crs of crs_list.value) {
|
|
32
31
|
if (crs && crs["code"] === crs_code) {
|
|
33
32
|
return crs;
|
|
34
33
|
}
|
|
@@ -44,7 +43,7 @@ watch(selected_crs, (new_value) => {
|
|
|
44
43
|
emit("increment_step");
|
|
45
44
|
});
|
|
46
45
|
|
|
47
|
-
async function get_crs_table() {
|
|
46
|
+
async function get_crs_table(): void {
|
|
48
47
|
const params = { geode_object_type: geodeObjectType };
|
|
49
48
|
toggle_loading();
|
|
50
49
|
await backStore.request(
|
|
@@ -13,10 +13,12 @@ interface Props {
|
|
|
13
13
|
|
|
14
14
|
const { show = false, item = undefined, selectedCount = 0 } = defineProps<Props>();
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface Emits {
|
|
17
17
|
"update:show": [value: boolean];
|
|
18
18
|
confirm: [];
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits<Emits>();
|
|
20
22
|
</script>
|
|
21
23
|
|
|
22
24
|
<template>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
4
2
|
import { onMounted, onUnmounted, ref } from "vue";
|
|
5
3
|
import DragAndDropInline from "./DragAndDropInternal/DragAndDropInline.vue";
|
|
6
4
|
import DragAndDropOverlay from "./DragAndDropInternal/DragAndDropOverlay.vue";
|
|
@@ -48,7 +46,7 @@ const fileInput = ref<HTMLInputElement | undefined>(undefined);
|
|
|
48
46
|
|
|
49
47
|
const WILDCARD_SUFFIX_LENGTH = 2;
|
|
50
48
|
|
|
51
|
-
function isFileAccepted(file: File, acceptValue: string | string[] | undefined) {
|
|
49
|
+
function isFileAccepted(file: File, acceptValue: string | string[] | undefined): boolean {
|
|
52
50
|
const fileName = (file.name || "").toLowerCase();
|
|
53
51
|
const fileType = (file.type || "").toLowerCase();
|
|
54
52
|
const isVext = fileName.endsWith(".vext");
|
|
@@ -92,18 +90,18 @@ function isFileAccepted(file: File, acceptValue: string | string[] | undefined)
|
|
|
92
90
|
});
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
function triggerFileDialog() {
|
|
93
|
+
function triggerFileDialog(): void {
|
|
96
94
|
fileInput.value?.click();
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
function onDragEnter(event: DragEvent) {
|
|
97
|
+
function onDragEnter(event: DragEvent): void {
|
|
100
98
|
if (!isInternalDrag.value && event.dataTransfer?.types.includes("Files")) {
|
|
101
99
|
dragCounter.value += 1;
|
|
102
100
|
isDragging.value = true;
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
function onDragLeave() {
|
|
104
|
+
function onDragLeave(): void {
|
|
107
105
|
dragCounter.value -= 1;
|
|
108
106
|
if (dragCounter.value <= 0) {
|
|
109
107
|
isDragging.value = false;
|
|
@@ -111,13 +109,13 @@ function onDragLeave() {
|
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
function onDragOver(event: DragEvent) {
|
|
112
|
+
function onDragOver(event: DragEvent): void {
|
|
115
113
|
if (!isInternalDrag.value && event.dataTransfer?.types.includes("Files")) {
|
|
116
114
|
event.preventDefault();
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
|
|
120
|
-
function onDrop(event: DragEvent) {
|
|
118
|
+
function onDrop(event: DragEvent): void {
|
|
121
119
|
event.preventDefault();
|
|
122
120
|
dragCounter.value = 0;
|
|
123
121
|
isDragging.value = false;
|
|
@@ -129,7 +127,7 @@ function onDrop(event: DragEvent) {
|
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
|
|
132
|
-
function onKeyDown(event: KeyboardEvent) {
|
|
130
|
+
function onKeyDown(event: KeyboardEvent): void {
|
|
133
131
|
if (event.key === "Escape") {
|
|
134
132
|
event.preventDefault();
|
|
135
133
|
event.stopPropagation();
|
|
@@ -138,7 +136,7 @@ function onKeyDown(event: KeyboardEvent) {
|
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
138
|
|
|
141
|
-
function handleFileSelect(event: Event) {
|
|
139
|
+
function handleFileSelect(event: Event): void {
|
|
142
140
|
const target = event.target as HTMLInputElement;
|
|
143
141
|
const files = [...(target.files ?? [])];
|
|
144
142
|
if (files.length > 0) {
|
|
@@ -147,11 +145,11 @@ function handleFileSelect(event: Event) {
|
|
|
147
145
|
target.value = "";
|
|
148
146
|
}
|
|
149
147
|
|
|
150
|
-
function onInternalDragStart() {
|
|
148
|
+
function onInternalDragStart(): void {
|
|
151
149
|
isInternalDrag.value = true;
|
|
152
150
|
}
|
|
153
151
|
|
|
154
|
-
function onInternalDragEnd() {
|
|
152
|
+
function onInternalDragEnd(): void {
|
|
155
153
|
isInternalDrag.value = false;
|
|
156
154
|
}
|
|
157
155
|
|
|
@@ -20,11 +20,11 @@ const { geodeObjectType, filenames } = defineProps<Props>();
|
|
|
20
20
|
type OutputExtensions = Record<string, { is_saveable: boolean }>;
|
|
21
21
|
|
|
22
22
|
const geode_objects_and_output_extensions = ref<Record<string, OutputExtensions>>({});
|
|
23
|
-
const loading = ref(false);
|
|
23
|
+
const loading = ref<boolean>(false);
|
|
24
24
|
|
|
25
25
|
const toggle_loading = useToggle(loading);
|
|
26
26
|
|
|
27
|
-
async function get_output_file_extensions() {
|
|
27
|
+
async function get_output_file_extensions(): Promise<void> {
|
|
28
28
|
toggle_loading();
|
|
29
29
|
geode_objects_and_output_extensions.value = {};
|
|
30
30
|
const backStore = useBackStore();
|
|
@@ -51,7 +51,7 @@ async function get_output_file_extensions() {
|
|
|
51
51
|
}
|
|
52
52
|
for (const extension of Object.keys(extensions)) {
|
|
53
53
|
final_object[key][extension] = {
|
|
54
|
-
is_saveable: extensions[extension]
|
|
54
|
+
is_saveable: extensions[extension].is_saveable,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -60,7 +60,7 @@ async function get_output_file_extensions() {
|
|
|
60
60
|
toggle_loading();
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
function update_values(output_geode_object: string, output_extension: string) {
|
|
63
|
+
function update_values(output_geode_object: string, output_extension: string): void {
|
|
64
64
|
if (output_geode_object !== "" && output_extension !== "") {
|
|
65
65
|
emit("update_values", {
|
|
66
66
|
output_geode_object,
|
|
@@ -3,9 +3,11 @@ import { useFeedbackStore } from "@ogw_front/stores/feedback";
|
|
|
3
3
|
|
|
4
4
|
const feedbackStore = useFeedbackStore();
|
|
5
5
|
|
|
6
|
-
function reload() {
|
|
6
|
+
function reload(): void {
|
|
7
7
|
globalThis.location.reload();
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
defineExpose({ reload });
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<template>
|
|
@@ -5,9 +5,9 @@ const MARGIN_BETWEEN_SNACKERS = 60;
|
|
|
5
5
|
const FIRST_SNACKER_MARGIN = 8;
|
|
6
6
|
|
|
7
7
|
const feedbackStore = useFeedbackStore();
|
|
8
|
-
const show = ref(true);
|
|
8
|
+
const show = ref<boolean>(true);
|
|
9
9
|
|
|
10
|
-
function calc_margin(index: number) {
|
|
10
|
+
function calc_margin(index: number): string {
|
|
11
11
|
return `${index * MARGIN_BETWEEN_SNACKERS + FIRST_SNACKER_MARGIN}px`;
|
|
12
12
|
}
|
|
13
13
|
</script>
|
|
@@ -17,6 +17,7 @@ function calc_margin(index: number) {
|
|
|
17
17
|
v-for="(feedback, index) in feedbackStore.feedbacks"
|
|
18
18
|
:key="feedback.id"
|
|
19
19
|
v-model="show"
|
|
20
|
+
data-testid="feedbackSnackbar"
|
|
20
21
|
:style="{ 'margin-bottom': calc_margin(index) }"
|
|
21
22
|
:color="feedback.type"
|
|
22
23
|
location="bottom right"
|
|
@@ -67,7 +68,7 @@ function calc_margin(index: number) {
|
|
|
67
68
|
variant="flat"
|
|
68
69
|
size="20"
|
|
69
70
|
:color="feedback.type"
|
|
70
|
-
@click="feedbackStore.delete_feedback(feedback.id)"
|
|
71
|
+
@click.stop="feedbackStore.delete_feedback(feedback.id)"
|
|
71
72
|
>
|
|
72
73
|
<v-icon icon="mdi-close" size="20" color="white" />
|
|
73
74
|
</v-btn>
|
|
@@ -7,11 +7,13 @@ import { useBackStore } from "@ogw_front/stores/back";
|
|
|
7
7
|
|
|
8
8
|
const schema = schemas.opengeodeweb_back.allowed_files;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface Emits {
|
|
11
11
|
update_values: [values: { files: unknown[]; autoUpload: boolean }];
|
|
12
12
|
increment_step: [];
|
|
13
13
|
decrement_step: [];
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits<Emits>();
|
|
15
17
|
|
|
16
18
|
interface Props {
|
|
17
19
|
multiple: boolean;
|
|
@@ -22,10 +24,10 @@ interface Props {
|
|
|
22
24
|
|
|
23
25
|
const { multiple, files = [], autoUpload = true, showOverlay = true } = defineProps<Props>();
|
|
24
26
|
|
|
25
|
-
const internal_files = ref(files);
|
|
26
|
-
const internal_auto_upload = ref(autoUpload);
|
|
27
|
-
const accept = ref("");
|
|
28
|
-
const loading = ref(false);
|
|
27
|
+
const internal_files = ref<File[]>(files);
|
|
28
|
+
const internal_auto_upload = ref<boolean>(autoUpload);
|
|
29
|
+
const accept = ref<string>("");
|
|
30
|
+
const loading = ref<boolean>(false);
|
|
29
31
|
|
|
30
32
|
watch(
|
|
31
33
|
() => files,
|
|
@@ -43,14 +45,14 @@ watch(
|
|
|
43
45
|
|
|
44
46
|
const toggle_loading = useToggle(loading);
|
|
45
47
|
|
|
46
|
-
function files_uploaded_event(value: unknown[]) {
|
|
48
|
+
function files_uploaded_event(value: unknown[]): void {
|
|
47
49
|
if (value.length > 0) {
|
|
48
50
|
emit("update_values", { files: value, autoUpload: false });
|
|
49
51
|
emit("increment_step");
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
async function get_allowed_files() {
|
|
55
|
+
async function get_allowed_files(): Promise<void> {
|
|
54
56
|
toggle_loading();
|
|
55
57
|
const backStore = useBackStore();
|
|
56
58
|
const response = (await backStore.request({ schema })) as {
|
|
@@ -32,26 +32,26 @@ const {
|
|
|
32
32
|
} = defineProps<Props>();
|
|
33
33
|
|
|
34
34
|
const backStore = useBackStore();
|
|
35
|
-
const internal_files = ref(files);
|
|
35
|
+
const internal_files = ref<UploadFile[]>(files);
|
|
36
36
|
const dragAndDropRef = useTemplateRef("dragAndDropRef");
|
|
37
|
-
const csv_dialog = ref(false);
|
|
37
|
+
const csv_dialog = ref<boolean>(false);
|
|
38
38
|
const current_csv_file = ref<UploadFile | undefined>(undefined);
|
|
39
|
-
const current_csv_index = ref(-1);
|
|
40
|
-
const loading = ref(false);
|
|
41
|
-
const files_uploaded = ref(false);
|
|
39
|
+
const current_csv_index = ref<number>(-1);
|
|
40
|
+
const loading = ref<boolean>(false);
|
|
41
|
+
const files_uploaded = ref<boolean>(false);
|
|
42
42
|
const toggle_loading = useToggle(loading);
|
|
43
43
|
|
|
44
|
-
function isCsv(file: UploadFile) {
|
|
44
|
+
function isCsv(file: UploadFile): boolean {
|
|
45
45
|
return file.name.toLowerCase().endsWith(".csv");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function openCsvPreviewer(file: UploadFile, index: number) {
|
|
48
|
+
function openCsvPreviewer(file: UploadFile, index: number): void {
|
|
49
49
|
current_csv_file.value = file;
|
|
50
50
|
current_csv_index.value = index;
|
|
51
51
|
csv_dialog.value = true;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async function onCsvConfirm(result: unknown) {
|
|
54
|
+
async function onCsvConfirm(result: unknown): Promise<void> {
|
|
55
55
|
// Only reachable while the CsvPreviewer dialog (gated on current_csv_file) is open.
|
|
56
56
|
const currentFile = current_csv_file.value;
|
|
57
57
|
if (!currentFile) {
|
|
@@ -72,7 +72,7 @@ async function onCsvConfirm(result: unknown) {
|
|
|
72
72
|
csv_dialog.value = false;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function processSelectedFiles(selected_files: UploadFile[]) {
|
|
75
|
+
function processSelectedFiles(selected_files: UploadFile[]): void {
|
|
76
76
|
if (multiple) {
|
|
77
77
|
internal_files.value = [...internal_files.value, ...selected_files];
|
|
78
78
|
} else {
|
|
@@ -83,7 +83,7 @@ function processSelectedFiles(selected_files: UploadFile[]) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function removeFile(index: number) {
|
|
86
|
+
function removeFile(index: number): void {
|
|
87
87
|
internal_files.value.splice(index, 1);
|
|
88
88
|
if (internal_files.value.length === 0) {
|
|
89
89
|
files_uploaded.value = false;
|
|
@@ -91,7 +91,7 @@ function removeFile(index: number) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
async function upload_files() {
|
|
94
|
+
async function upload_files(): Promise<void> {
|
|
95
95
|
toggle_loading();
|
|
96
96
|
const promise_array = internal_files.value.map((file) => backStore.upload(file));
|
|
97
97
|
await Promise.all(promise_array);
|
|
@@ -19,7 +19,7 @@ const {
|
|
|
19
19
|
} = defineProps<Props>();
|
|
20
20
|
|
|
21
21
|
const attrs = useAttrs();
|
|
22
|
-
const isInteractive = computed(() => Boolean(attrs.onClick));
|
|
22
|
+
const isInteractive = computed<boolean>(() => Boolean(attrs.onClick));
|
|
23
23
|
|
|
24
24
|
onKeyStroke("Escape", () => {
|
|
25
25
|
if (escapeFunction) {
|