@abi-software/mapintegratedvuer 1.6.1 → 1.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -50,13 +50,13 @@
50
50
  "*.js"
51
51
  ],
52
52
  "dependencies": {
53
- "@abi-software/flatmapvuer": "^1.6.0",
54
- "@abi-software/map-side-bar": "^2.5.1",
55
- "@abi-software/map-utilities": "^1.2.0",
53
+ "@abi-software/flatmapvuer": "^1.6.1",
54
+ "@abi-software/map-side-bar": "^2.5.2",
55
+ "@abi-software/map-utilities": "^1.2.1",
56
56
  "@abi-software/plotvuer": "^1.0.3",
57
57
  "@abi-software/scaffoldvuer": "^1.6.2",
58
58
  "@abi-software/simulationvuer": "^1.0.1",
59
- "@abi-software/sparc-annotation": "0.3.1",
59
+ "@abi-software/sparc-annotation": "0.3.2",
60
60
  "@abi-software/svg-sprite": "^1.0.1",
61
61
  "@element-plus/icons-vue": "^2.3.1",
62
62
  "@vitejs/plugin-vue": "^4.6.2",
@@ -86,7 +86,7 @@
86
86
  "eslint": "^8.56.0",
87
87
  "eslint-plugin-cypress": "^2.15.1",
88
88
  "eslint-plugin-vue": "^9.19.2",
89
- "happy-dom": "^13.3.8",
89
+ "happy-dom": "^15.11.6",
90
90
  "jsdom": "^16.2.2",
91
91
  "jsdom-global": "^3.0.2",
92
92
  "mocha": "^10.4.0",
@@ -337,6 +337,21 @@ export default {
337
337
  position: relative;
338
338
  top: auto;
339
339
  font-size: 12px;
340
+ align-items: center;
341
+
342
+ :deep(.el-tooltip__trigger) {
343
+ height: 100%;
344
+ display: flex;
345
+ align-items: center;
346
+ }
347
+
348
+ .hide {
349
+ margin-top: 0;
350
+ display: flex;
351
+ flex-direction: row;
352
+ align-items: center;
353
+ gap: 4px;
354
+ }
340
355
  }
341
356
 
342
357
  .info-icon {
@@ -306,6 +306,10 @@ export default {
306
306
  view,
307
307
  entries: this.entriesStore.entries,
308
308
  });
309
+
310
+ if (this.$refs.viewPopover) {
311
+ this.$refs.viewPopover.hide();
312
+ }
309
313
  }
310
314
  },
311
315
  mounted: function () {
@@ -433,6 +437,7 @@ export default {
433
437
  padding: 4px 8px 12px 8px;
434
438
  min-width:unset!important;
435
439
  width:unset!important;
440
+ background-color: #f3ecf6;
436
441
  cursor:default;
437
442
  .el-popper__arrow {
438
443
  &:before {
@@ -309,7 +309,7 @@ export default {
309
309
  onConnectivityComponentClick: function (data) {
310
310
  EventBus.emit('connectivity-component-click', {
311
311
  connectivityInfo: this.connectivityInfo,
312
- data
312
+ data: data,
313
313
  });
314
314
  },
315
315
  hoverChanged: function (data) {
@@ -15,8 +15,12 @@
15
15
  @help-mode-last-item="onHelpModeLastItem"
16
16
  @shown-tooltip="onTooltipShown"
17
17
  @shown-map-tooltip="onMapTooltipShown"
18
+ @annotation-open="onAnnotationOpen"
19
+ @annotation-close="onAnnotationClose"
20
+ :annotationSidebar="annotationSidebar"
18
21
  @connectivity-info-open="onConnectivityInfoOpen"
19
22
  @connectivity-info-close="onConnectivityInfoClose"
23
+ @connectivity-graph-error="onConnectivityGraphError"
20
24
  :connectivityInfoSidebar="connectivityInfoSidebar"
21
25
  :pathControls="true"
22
26
  ref="flatmap"
@@ -131,7 +135,8 @@ export default {
131
135
  searchSuggestions: function (term, suggestions) {
132
136
  if (term && this.$refs.flatmap.mapImp) {
133
137
  const results = this.$refs.flatmap.mapImp.search(term);
134
- results.__featureIds.forEach(id => {
138
+ const featureIds = results.__featureIds || results.featureIds;
139
+ featureIds.forEach(id => {
135
140
  const annotation = this.$refs.flatmap.mapImp.annotation(id);
136
141
  if (annotation && annotation.label)
137
142
  suggestions.push(annotation.label);
@@ -166,6 +171,12 @@ export default {
166
171
  },
167
172
  },
168
173
  mounted: function() {
174
+ EventBus.on('annotation-close', (payload) => {
175
+ const currentFlatmap = this.$refs.flatmap;
176
+ if (payload?.tabClose && currentFlatmap) {
177
+ this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
178
+ }
179
+ });
169
180
  EventBus.on("markerUpdate", () => {
170
181
  this.flatmapMarkerUpdate(undefined);
171
182
  });
@@ -19,6 +19,7 @@
19
19
  :annotationSidebar="annotationSidebar"
20
20
  @connectivity-info-open="onConnectivityInfoOpen"
21
21
  @connectivity-info-close="onConnectivityInfoClose"
22
+ @connectivity-graph-error="onConnectivityGraphError"
22
23
  :connectivityInfoSidebar="connectivityInfoSidebar"
23
24
  ref="multiflatmap"
24
25
  :displayMinimap="true"
@@ -417,136 +418,10 @@ export default {
417
418
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
418
419
  flatmap.changeViewingMode(modeName);
419
420
  },
420
- removeConnectivityTooltips: function () {
421
- const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
422
- if (flatmap?.$el) {
423
- // close all tooltips on the current flatmap element
424
- const tooltips = flatmap.$el.querySelectorAll('.flatmap-tooltip-popup');
425
- tooltips.forEach(tooltip => tooltip.remove());
426
- }
427
- },
428
- createTooltipForConnectivity: function (filteredConnectivityData, mapImp) {
429
- // combine all labels to show together
430
- // content type must be DOM object to use HTML
431
- const labelsContainer = document.createElement('div');
432
- labelsContainer.classList.add('flatmap-feature-label');
433
-
434
- filteredConnectivityData.forEach((connectivity, i) => {
435
- const { label } = connectivity;
436
- labelsContainer.append(capitalise(label));
437
-
438
- if ((i + 1) < filteredConnectivityData.length) {
439
- const hr = document.createElement('hr');
440
- labelsContainer.appendChild(hr);
441
- }
442
- });
443
-
444
- mapImp.showPopup(
445
- filteredConnectivityData[0].featureId,
446
- labelsContainer,
447
- {
448
- className: 'custom-popup flatmap-tooltip-popup',
449
- positionAtLastClick: false,
450
- preserveSelection: true,
451
- }
452
- );
453
- },
454
- emitConnectivityGraphError: function (errorData) {
455
- if (errorData.length) {
456
- const errorDataToEmit = [...new Set(errorData)];
457
- let errorMessage = '';
458
-
459
- errorDataToEmit.forEach((connectivity, i) => {
460
- const { label } = connectivity;
461
- errorMessage += (i === 0) ? capitalise(label) : label;
462
-
463
- if (errorDataToEmit.length > 1) {
464
- if ((i + 2) === errorDataToEmit.length) {
465
- errorMessage += ' and ';
466
- } else if ((i + 1) < errorDataToEmit.length) {
467
- errorMessage += ', ';
468
- }
469
- }
470
- });
471
- errorMessage += ' cannot be found on the map!';
472
- EventBus.emit('connectivity-graph-error', {
473
- data: errorMessage
474
- });
475
- }
476
- },
477
421
  showConnectivityTooltips: function (payload) {
478
- const { connectivityInfo, data } = payload;
479
- const featuresToHighlight = [];
480
- const connectivityData = [];
481
- const filteredConnectivityData = [];
482
- const errorData = [];
483
-
484
- if (!data.length) {
485
- this.removeConnectivityTooltips();
486
- } else {
487
- if (typeof data[0] === 'object') {
488
- // Connectivity list hover emits array of objects
489
- data.forEach((item) => {
490
- connectivityData.push({
491
- id: item.id,
492
- label: item.name,
493
- });
494
- })
495
- } else {
496
- // Connectivity graph node click emits an array of data,
497
- // a combination of ids and labels.
498
- // The first half is ids and the second half is labels.
499
- for (let i = 0; i < data.length / 2; i++) {
500
- connectivityData.push({
501
- id: data[i],
502
- label: data[i + data.length / 2]
503
- });
504
- }
505
- }
506
- }
507
-
508
- // to keep the highlighted path on map
509
- if (connectivityInfo && connectivityInfo.featureId) {
510
- featuresToHighlight.push(...connectivityInfo.featureId);
511
- }
512
-
513
- // search the features on the map first
514
422
  if (this.flatmapReady) {
515
423
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
516
- if (flatmap.mapImp) {
517
- connectivityData.forEach((connectivity, i) => {
518
- const {id, label} = connectivity;
519
- const response = flatmap.mapImp.search(id);
520
-
521
- if (response?.results.length) {
522
- const featureId = response?.results[0].featureId;
523
-
524
- filteredConnectivityData.push({
525
- featureId,
526
- id,
527
- label,
528
- });
529
- featuresToHighlight.push(id);
530
- } else {
531
- errorData.push(connectivity);
532
- }
533
- });
534
-
535
- if (filteredConnectivityData.length) {
536
- // show tooltip of the first item
537
- // with all labels
538
- this.createTooltipForConnectivity(filteredConnectivityData, flatmap.mapImp);
539
- } else {
540
- errorData.push(...connectivityData);
541
- this.removeConnectivityTooltips();
542
- }
543
-
544
- // Emit error message for connectivity graph
545
- this.emitConnectivityGraphError(errorData);
546
-
547
- // highlight all available features
548
- flatmap.mapImp.zoomToFeatures(featuresToHighlight, { noZoomIn: true });
549
- }
424
+ flatmap.showConnectivityTooltips(payload);
550
425
  }
551
426
  },
552
427
  },
@@ -502,6 +502,9 @@ export default {
502
502
  onConnectivityInfoClose: function () {
503
503
  EventBus.emit('connectivity-info-close');
504
504
  },
505
+ onConnectivityGraphError: function (errorInfo) {
506
+ EventBus.emit('connectivity-graph-error', errorInfo);
507
+ },
505
508
  },
506
509
  data: function () {
507
510
  return {