@abi-software/map-side-bar 2.8.3-beta.7 → 2.9.1-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.8.3-beta.7",
3
+ "version": "2.9.1-beta.0",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@abi-software/gallery": "^1.1.2",
42
- "@abi-software/map-utilities": "^1.6.0-beta.0",
42
+ "@abi-software/map-utilities": "^1.6.1-beta.0",
43
43
  "@abi-software/svg-sprite": "^1.0.1",
44
44
  "@element-plus/icons-vue": "^2.3.1",
45
45
  "algoliasearch": "^4.10.5",
@@ -21,7 +21,7 @@
21
21
  <el-button
22
22
  link
23
23
  class="el-button-link"
24
- @click="openSearch([], '')"
24
+ @click="onResetClick"
25
25
  size="large"
26
26
  >
27
27
  Reset
@@ -224,10 +224,17 @@ export default {
224
224
  // watch for connectivityEntry changes
225
225
  // card should be expanded if there is only one entry and it is ready
226
226
  connectivityEntry: function (newVal, oldVal) {
227
- if (newVal.length === 1 && newVal[0].ready) {
228
- // if the changed property is connectivity source, do not collapse
227
+ if (
228
+ JSON.stringify(newVal) !== JSON.stringify(oldVal) &&
229
+ newVal.length === 1 && newVal[0].ready
230
+ ) {
231
+ // if the changed property is connectivity source,
232
+ // or two different maps in split view, do not collapse
229
233
  if (
230
- (newVal[0].connectivitySource !== oldVal[0].connectivitySource) &&
234
+ (
235
+ newVal[0].connectivitySource !== oldVal[0].connectivitySource ||
236
+ newVal[0].mapId !== oldVal[0].mapId
237
+ ) &&
231
238
  oldVal[0].ready
232
239
  ) {
233
240
  return;
@@ -323,6 +330,10 @@ export default {
323
330
  this.openSearch([], '');
324
331
  }
325
332
  },
333
+ onResetClick: function () {
334
+ this.openSearch([], '');
335
+ this.$emit('connectivity-explorer-reset');
336
+ },
326
337
  openSearch: function (filter, search = "") {
327
338
  this.searchInput = search;
328
339
  this.resetPageNavigation();
@@ -527,6 +538,7 @@ export default {
527
538
  width: 298px !important;
528
539
  height: 40px;
529
540
  padding-right: 14px;
541
+ font-family: inherit;
530
542
 
531
543
  :deep(.el-input__inner) {
532
544
  font-family: inherit;
@@ -277,7 +277,7 @@ export default {
277
277
  return this.entry.destinationsWithDatasets;
278
278
  },
279
279
  resources: function () {
280
- return this.entry.hyperlinks;
280
+ return this.entry.hyperlinks || [];
281
281
  },
282
282
  sckanVersion: function () {
283
283
  return this.entry.knowledgeSource;
@@ -528,17 +528,17 @@ export default {
528
528
  }
529
529
  },
530
530
  getConnectionsFromMap: async function () {
531
- if (this.entry.mapuuid) {
531
+ if (this.entry.mapuuid) {
532
532
  const url =
533
533
  this.flatmapApi +
534
534
  `flatmap/${this.entry.mapuuid}/connectivity/${this.entry.featureId[0]}`;
535
-
535
+
536
536
  try {
537
537
  const response = await fetch(url);
538
538
  if (!response.ok) {
539
539
  throw new Error(`Response status: ${response.status}`);
540
540
  }
541
-
541
+
542
542
  return await response.json();
543
543
  } catch (error) {
544
544
  throw new Error(error);
@@ -63,16 +63,32 @@
63
63
  popper-class="sidebar-cascader-popper"
64
64
  >
65
65
  <template #default="{ node, data }">
66
- <el-row>
67
- <el-col :span="4" v-if="hasLineStyles(data)">
68
- <div class="path-visual" :style="getLineStyles(data)"></div>
69
- </el-col>
70
- <el-col :span="20">
71
- <div :style="getBackgroundStyles(data)">
72
- {{ data.label }}
66
+ <div v-if="isFlatmapConnectionsFilterNode(node)">
67
+ <div class="el-input">
68
+ <div class="el-input__wrapper">
69
+ <input
70
+ class="el-input__inner"
71
+ :value="searchInputs[node.value]"
72
+ @input="searchInputChange($event, node)"
73
+ style="width: 100%"
74
+ autocomplete="off"
75
+ placeholder="Search"
76
+ />
73
77
  </div>
74
- </el-col>
75
- </el-row>
78
+ </div>
79
+ </div>
80
+ <div v-else>
81
+ <el-row>
82
+ <el-col :span="4" v-if="hasLineStyles(data)">
83
+ <div class="path-visual" :style="getLineStyles(data)"></div>
84
+ </el-col>
85
+ <el-col :span="20">
86
+ <div :style="getBackgroundStyles(data)">
87
+ {{ data.label }}
88
+ </div>
89
+ </el-col>
90
+ </el-row>
91
+ </div>
76
92
  </template>
77
93
  </el-cascader>
78
94
  <div v-if="showFiltersText" class="filter-default-value">Filters</div>
@@ -199,6 +215,7 @@ export default {
199
215
  },
200
216
  ],
201
217
  presentTags:[],
218
+ searchInputs: {},
202
219
  }
203
220
  },
204
221
  setup() {
@@ -254,6 +271,14 @@ export default {
254
271
  )
255
272
  return value
256
273
  },
274
+ isFlatmapConnectionsFilterNode: function (node) {
275
+ return (
276
+ node.pathValues[0].includes('flatmap.connectivity.source') &&
277
+ node.pathLabels.includes('Filters') &&
278
+ node.isDisabled &&
279
+ node.isLeaf
280
+ )
281
+ },
257
282
  processOptions: function () {
258
283
  // create top level of options in cascader
259
284
  this.options.forEach((facet, i) => {
@@ -273,6 +298,14 @@ export default {
273
298
  })
274
299
  }
275
300
 
301
+ if (facet.key.includes('flatmap.connectivity.source')) {
302
+ this.options[i].children.unshift({
303
+ value: this.createCascaderItemValue('ConnectivityFilters'),
304
+ label: 'Filters',
305
+ disabled: true,
306
+ });
307
+ }
308
+
276
309
  // populate second level of options
277
310
  this.options[i].children.forEach((facetItem, j) => {
278
311
  // Format labels except funding program
@@ -649,6 +682,24 @@ export default {
649
682
  this.__expandItem__ = event
650
683
  this.cssMods()
651
684
  },
685
+ searchInputChange: function (event, node) {
686
+ event.preventDefault();
687
+ const { target } = event;
688
+ if (target) {
689
+ const value = target.value;
690
+ const ul = target.closest('.el-cascader-menu__list');
691
+ ul.querySelectorAll('.el-cascader-node').forEach((li, index) => {
692
+ if (index > 0) {
693
+ const content = li.querySelector('.el-cascader-node__label').textContent;
694
+ if (content.toLowerCase().includes(value.toLowerCase())) {
695
+ li.classList.remove('hide');
696
+ } else {
697
+ li.classList.add('hide');
698
+ }
699
+ }
700
+ })
701
+ }
702
+ },
652
703
  numberShownChanged: function (event) {
653
704
  this.$emit('numberPerPage', parseInt(event))
654
705
  },
@@ -1093,6 +1144,36 @@ export default {
1093
1144
  border-color: $app-primary-color;
1094
1145
  }
1095
1146
 
1147
+ .sidebar-cascader-popper .el-cascader-menu:last-child .el-cascader-node {
1148
+ &.is-disabled {
1149
+ border-bottom: 1px solid #e4e7ed;
1150
+ padding-bottom: 0.5rem;
1151
+ position: sticky;
1152
+ top: 0.5rem;
1153
+ background-color: white;
1154
+ z-index: 20;
1155
+ box-shadow: 0px -6px 0px 6px white;
1156
+
1157
+ .el-checkbox.is-disabled {
1158
+ display: none;
1159
+ }
1160
+
1161
+ .el-cascader-node__label {
1162
+ padding-left: 0;
1163
+ padding-right: 0;
1164
+ }
1165
+
1166
+ // hide show all for connection filters
1167
+ + .el-cascader-node {
1168
+ display: none;
1169
+ }
1170
+ }
1171
+
1172
+ &.hide {
1173
+ display: none;
1174
+ }
1175
+ }
1176
+
1096
1177
  .filter-help-popover,
1097
1178
  .cascade-tags-popover {
1098
1179
  font-family: 'Asap', sans-serif;
@@ -54,6 +54,7 @@
54
54
  @filter-visibility="$emit('filter-visibility', $event)"
55
55
  @search-changed="searchChanged(tab.id, $event)"
56
56
  @hover-changed="hoverChanged(tab.id, $event)"
57
+ @connectivity-explorer-reset="onConnectivityExplorerReset"
57
58
  @show-connectivity="showConnectivity"
58
59
  @show-reference-connectivities="onShowReferenceConnectivities"
59
60
  @connectivity-hovered="onConnectivityHovered"
@@ -210,6 +211,12 @@ export default {
210
211
  this.activeAnnotationData = data;
211
212
  }
212
213
  },
214
+ /**
215
+ * This event is emitted after clicking reset button in connectivity explorer
216
+ */
217
+ onConnectivityExplorerReset: function () {
218
+ this.$emit('connectivity-explorer-reset');
219
+ },
213
220
  /**
214
221
  * This event is emitted when the show connectivity button is clicked.
215
222
  * @arg featureIds