@abi-software/map-side-bar 2.10.0-beta.0 → 2.10.0-beta.2

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.
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="filters">
3
3
  <MapSvgSpriteColor />
4
- <div v-if="showFilters">
4
+ <div v-if="showFilters && options.length > 0">
5
5
  <div class="cascader-tag" v-if="presentTags.length > 0">
6
6
  <el-tag
7
7
  class="ml-2"
@@ -9,7 +9,7 @@
9
9
  closable
10
10
  @close="cascadeTagClose(presentTags[0])"
11
11
  >
12
- <span class="tag-text">{{ presentTags[0] }}</span>
12
+ <span class="tag-text" :class="modifyCascaderTagStyle(presentTags[0])">{{ presentTags[0] }}</span>
13
13
  </el-tag>
14
14
  <el-popover
15
15
  v-if="presentTags.length > 1"
@@ -24,6 +24,7 @@
24
24
  v-for="(tag, i) in presentTags.slice(1)"
25
25
  :key="i"
26
26
  class="ml-2"
27
+ :class="modifyCascaderTagStyle(tag)"
27
28
  type="info"
28
29
  closable
29
30
  @close="cascadeTagClose(tag)"
@@ -56,23 +57,45 @@
56
57
  :collapse-tags="true"
57
58
  collapse-tags-tooltip
58
59
  :options="options"
59
- :props="props"
60
+ :props="cascaderProps"
60
61
  @change="cascadeEvent($event)"
61
62
  @expand-change="cascadeExpandChange"
62
63
  :show-all-levels="true"
63
64
  popper-class="sidebar-cascader-popper"
64
65
  >
65
66
  <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 }}
67
+ <div v-if="isFlatmapConnectionsFilterNode(node)">
68
+ <div class="sidebar-cascader-search el-input">
69
+ <div class="el-input__wrapper">
70
+ <input
71
+ class="el-input__inner"
72
+ :ref="'searchInput_' + node.pathValues[0]"
73
+ :value="searchInputs[node.pathValues[0]]"
74
+ @input="searchInputChange($event, node)"
75
+ @focus="searchInputFocusToggle($event, true)"
76
+ @blur="searchInputFocusToggle($event, false)"
77
+ style="width: 100%"
78
+ autocomplete="off"
79
+ placeholder="Search"
80
+ />
73
81
  </div>
74
- </el-col>
75
- </el-row>
82
+ </div>
83
+ </div>
84
+ <div v-else>
85
+ <el-row>
86
+ <el-col :span="4" v-if="hasLineStyles(data)">
87
+ <div class="path-visual" :style="getLineStyles(data)"></div>
88
+ </el-col>
89
+ <el-col :span="20">
90
+ <span v-if="isFlatmapConnectionsNode(node)" class="sr-only">
91
+ {{ getNodeKey(node.value) }}
92
+ </span>
93
+ <div :style="getBackgroundStyles(data)">
94
+ {{ data.label }}
95
+ </div>
96
+ </el-col>
97
+ </el-row>
98
+ </div>
76
99
  </template>
77
100
  </el-cascader>
78
101
  <div v-if="showFiltersText" class="filter-default-value">Filters</div>
@@ -190,7 +213,7 @@ export default {
190
213
  filters: [],
191
214
  facets: ['Species', 'Gender', 'Organ', 'Datasets'],
192
215
  numberDatasetsShown: ['10', '20', '50'],
193
- props: { multiple: true },
216
+ cascaderProps: { multiple: true },
194
217
  options: [
195
218
  {
196
219
  value: 'Species',
@@ -199,6 +222,7 @@ export default {
199
222
  },
200
223
  ],
201
224
  presentTags:[],
225
+ searchInputs: {},
202
226
  }
203
227
  },
204
228
  setup() {
@@ -230,10 +254,12 @@ export default {
230
254
  // Populate the cascader with new options
231
255
  this.populateCascader().then(() => {
232
256
  this.cascaderIsReady = true
233
- this.checkShowAllBoxes()
234
- // this.setCascader(this.entry.filterFacets)
235
- this.cssMods()
236
- this.$emit('cascaderReady')
257
+ if (this.options.length) {
258
+ this.checkShowAllBoxes()
259
+ // this.setCascader(this.entry.filterFacets)
260
+ this.cssMods()
261
+ this.$emit('cascaderReady')
262
+ }
237
263
  })
238
264
  }
239
265
  },
@@ -254,6 +280,23 @@ export default {
254
280
  )
255
281
  return value
256
282
  },
283
+ getNodeKey: function (nodeValue) {
284
+ return nodeValue ? nodeValue.split('>')[1] : '';
285
+ },
286
+ isFlatmapConnectionsNode: function (node) {
287
+ return (
288
+ node.pathValues[0].includes('flatmap.connectivity.source') &&
289
+ node.isLeaf
290
+ )
291
+ },
292
+ isFlatmapConnectionsFilterNode: function (node) {
293
+ return (
294
+ node.pathValues[0].includes('flatmap.connectivity.source') &&
295
+ node.pathLabels.includes('Filters') &&
296
+ node.isDisabled &&
297
+ node.isLeaf
298
+ )
299
+ },
257
300
  processOptions: function () {
258
301
  // create top level of options in cascader
259
302
  this.options.forEach((facet, i) => {
@@ -273,6 +316,14 @@ export default {
273
316
  })
274
317
  }
275
318
 
319
+ if (facet.key.includes('flatmap.connectivity.source')) {
320
+ this.options[i].children.unshift({
321
+ value: this.createCascaderItemValue('ConnectivityFilters'),
322
+ label: 'Filters',
323
+ disabled: true,
324
+ });
325
+ }
326
+
276
327
  // populate second level of options
277
328
  this.options[i].children.forEach((facetItem, j) => {
278
329
  // Format labels except funding program
@@ -281,8 +332,17 @@ export default {
281
332
  facetItem.label
282
333
  )
283
334
  }
284
- this.options[i].children[j].value =
285
- this.createCascaderItemValue(facet.label, facetItem.label)
335
+
336
+ // Use key as value for connectivity source filters
337
+ if (facetItem.key && facet.key.includes('flatmap.connectivity.source.')) {
338
+ const childKey = facetItem.key;
339
+ const parentKey = facet.key;
340
+ const key = childKey.replace(`${parentKey}.`, '');
341
+ this.options[i].children[j].value = this.createCascaderItemValue(facet.label, key);
342
+ } else {
343
+ this.options[i].children[j].value = this.createCascaderItemValue(facet.label, facetItem.label)
344
+ }
345
+
286
346
  if (
287
347
  this.options[i].children[j].children &&
288
348
  this.options[i].children[j].children.length > 0
@@ -325,10 +385,26 @@ export default {
325
385
  })
326
386
  })
327
387
  },
388
+ isConnectivityTag: function (tag) {
389
+ const regex = /^[A-Za-z]:/; // starts with O: D: V:
390
+ return regex.test(tag);
391
+ },
392
+ getConnectivityTag: function (tag) {
393
+ const index = tag.indexOf(":");
394
+ const result = index !== -1 ? tag.substring(index + 1) : tag;
395
+ return result;
396
+ },
397
+ modifyCascaderTagStyle: function (tag) {
398
+ if (this.isConnectivityTag(tag)) {
399
+ return 'connectivity-tag';
400
+ }
401
+ return '';
402
+ },
328
403
  /**
329
404
  * Create manual events when cascader tag is closed
330
405
  */
331
- cascadeTagClose: function (tag) {
406
+ cascadeTagClose: function (_tag) {
407
+ const tag = this.isConnectivityTag(_tag) ? this.getConnectivityTag(_tag) : _tag;
332
408
  let manualEvent = []
333
409
 
334
410
  Object.entries(this.cascaderTags).map((entry) => {
@@ -377,7 +453,7 @@ export default {
377
453
  this.correctnessCheck.term.add(option.label)
378
454
  option.children.map((child) => {
379
455
  this.correctnessCheck.facet.add(child.label)
380
- if (option.label === 'Anatomical structure' && child.label !== 'Show all') {
456
+ if (['Anatomical structure', 'Nerves'].includes(option.label) && child.label !== 'Show all') {
381
457
  child.children.map((child2) => {
382
458
  this.correctnessCheck.facet2.add(child2.label)
383
459
  })
@@ -387,35 +463,70 @@ export default {
387
463
  }
388
464
 
389
465
  this.cascaderTags = {}
466
+ this.cascaderTagsClone = {}
390
467
  this.presentTags = []
391
468
  event.map((item) => {
392
- const { facet, facet2, term } = item
393
- if (this.correctnessCheck.term.has(term) && this.correctnessCheck.facet.has(facet)) {
469
+ const { facet, facet2, term, tagLabel, facetPropPath } = item
470
+ let facetLabel = facet;
471
+ let termId = '';
472
+
473
+ // Connectivity filter has different value and label,
474
+ // value is used for filter logic
475
+ // label is used for user interface (and this cascader tag is just user interface)
476
+ if (facetPropPath && facetPropPath.includes('flatmap.connectivity.source.') && tagLabel) {
477
+ facetLabel = tagLabel;
478
+ termId = term.charAt(0);
479
+ }
480
+
481
+ if (this.correctnessCheck.term.has(term) && this.correctnessCheck.facet.has(facetLabel)) {
394
482
  if (facet2) {
395
483
  if (this.correctnessCheck.facet2.has(facet2)) {
396
484
  if (term in this.cascaderTags) {
397
- if (facet in this.cascaderTags[term]) this.cascaderTags[term][facet].push(facet2)
398
- else this.cascaderTags[term][facet] = [facet2]
485
+ if (facet in this.cascaderTags[term]) {
486
+ this.cascaderTags[term][facet].push(facet2)
487
+ this.cascaderTagsClone[term][facet].push(facet2)
488
+ } else {
489
+ this.cascaderTags[term][facet] = [facet2]
490
+ this.cascaderTagsClone[term][facet] = [facet2]
491
+ }
399
492
  } else {
400
493
  this.cascaderTags[term] = {}
401
494
  this.cascaderTags[term][facet] = [facet2]
495
+ this.cascaderTagsClone[term] = {}
496
+ this.cascaderTagsClone[term][facet] = [facet2]
402
497
  }
403
498
  }
404
499
  } else {
405
500
  // If 'cascaderTags' has key 'Anatomical structure',
406
501
  // it's value type will be Object (because it has nested facets),
407
502
  // in this case 'push' action will not available.
408
- if (term in this.cascaderTags && term !== 'Anatomical structure')
409
- this.cascaderTags[term].push(facet)
410
- else {
411
- if (facet.toLowerCase() !== "show all") this.cascaderTags[term] = [facet]
412
- else this.cascaderTags[term] = []
503
+ if (term in this.cascaderTags && term !== 'Anatomical structure') {
504
+ this.cascaderTags[term].push(facetLabel)
505
+ // connectivity exploration mode tags
506
+ if (termId) {
507
+ this.cascaderTagsClone[term].push(termId + ':' + facetLabel);
508
+ } else {
509
+ this.cascaderTagsClone[term].push(facetLabel);
510
+ }
511
+ } else {
512
+ if (facet.toLowerCase() !== "show all") {
513
+ this.cascaderTags[term] = [facetLabel]
514
+ // connectivity exploration mode tags
515
+ if (termId) {
516
+ this.cascaderTagsClone[term] = [termId + ':' + facetLabel];
517
+ } else {
518
+ this.cascaderTagsClone[term] = [facetLabel]
519
+ }
520
+ } else {
521
+ this.cascaderTags[term] = []
522
+ this.cascaderTagsClone[term] = []
523
+ }
413
524
  }
414
525
  }
415
526
  }
416
527
  })
417
528
 
418
- Object.values(this.cascaderTags).map((value) => {
529
+ Object.values(this.cascaderTagsClone).map((value) => {
419
530
  const extend = Array.isArray(value) ? value : Object.values(value).flat(1)
420
531
  this.presentTags = [...this.presentTags, ...extend]
421
532
  })
@@ -471,6 +582,13 @@ export default {
471
582
  event = this.showAllEventModifier(event)
472
583
 
473
584
  event = this.showAllEventModifierForAutoCheckAll(event)
585
+
586
+ const cascaderRef = this.$refs.cascader;
587
+ const checkedNodes = cascaderRef?.getCheckedNodes(true);
588
+ const filteredCheckedNodes = checkedNodes.filter((checkedNode) =>
589
+ checkedNode.checked && checkedNode.label !== 'Show all'
590
+ );
591
+
474
592
  /**
475
593
  * Move the new added event to the beginning
476
594
  * Otherwise, cascader will show different expand item
@@ -492,12 +610,19 @@ export default {
492
610
  this.findHierarachyStringAndBooleanString(fs)
493
611
  let { facet, facet2, term } =
494
612
  this.getFacetsFromHierarchyString(hString)
613
+
614
+ const foundNode = filteredCheckedNodes.find((checkedNode) =>
615
+ fs.join() === checkedNode.pathValues.join()
616
+ );
617
+ const tagLabel = foundNode ? foundNode.label : undefined;
618
+
495
619
  return {
496
620
  facetPropPath: fs[0],
497
621
  facet: facet,
498
622
  facet2: facet2,
499
623
  term: term,
500
624
  AND: bString, // for setting the boolean
625
+ tagLabel: tagLabel // for connectivity filter's cascader tag
501
626
  }
502
627
  })
503
628
 
@@ -518,12 +643,19 @@ export default {
518
643
  facet = facet2
519
644
  facetSubPropPath = 'anatomy.organ.name'
520
645
  }
646
+
647
+ const foundNode = filteredCheckedNodes.find((checkedNode) =>
648
+ fs.join() === checkedNode.pathValues.join()
649
+ );
650
+ const tagLabel = foundNode ? foundNode.label : undefined;
651
+
521
652
  return {
522
653
  facetPropPath: propPath,
523
654
  facet: facet,
524
655
  term: term,
525
656
  AND: bString, // for setting the boolean
526
657
  facetSubPropPath: facetSubPropPath, // will be used for filters if we are at the third level of the cascader
658
+ tagLabel: tagLabel // for connectivity filter's cascader tag
527
659
  }
528
660
  })
529
661
 
@@ -647,8 +779,82 @@ export default {
647
779
  cascadeExpandChange: function (event) {
648
780
  //work around as the expand item may change on modifying the cascade props
649
781
  this.__expandItem__ = event
782
+ if (this.__expandItem__) {
783
+ this.updateListFilters(this.__expandItem__[0])
784
+ }
785
+ this.updateListStyleOrder()
650
786
  this.cssMods()
651
787
  },
788
+ updateListStyleOrder: function () {
789
+ this.$nextTick(() => {
790
+ const cascaderRef = this.$refs.cascader;
791
+ const contentRef = cascaderRef?.contentRef;
792
+
793
+ if (contentRef) {
794
+ const menuList = contentRef.querySelectorAll('.el-cascader-menu__list');
795
+ if (menuList) {
796
+ menuList.forEach((ul) => {
797
+ const searchInput = ul.querySelector('.sidebar-cascader-search');
798
+
799
+ // order the list using CSS
800
+ // active items on top - defined in CSS under .cascader-menu-with-search
801
+ if (searchInput) {
802
+ ul.classList.add('cascader-menu-with-search');
803
+ } else {
804
+ ul.classList.remove('cascader-menu-with-search');
805
+ }
806
+ })
807
+ }
808
+ }
809
+ });
810
+ },
811
+ searchInputChange: function (event, node) {
812
+ event.preventDefault();
813
+ const { target } = event;
814
+ if (target) {
815
+ const value = target.value;
816
+ const expandItem = node.pathValues[0];
817
+
818
+ this.searchInputs[expandItem] = value;
819
+ this.updateListFilters(expandItem);
820
+ }
821
+ },
822
+ searchInputFocusToggle: function (event, option) {
823
+ const { target } = event;
824
+ if (!target) return;
825
+
826
+ const inputWrapper = target.closest('.el-input__wrapper');
827
+ if (option === true) {
828
+ inputWrapper.classList.add('is-focus');
829
+ } else {
830
+ inputWrapper.classList.remove('is-focus');
831
+ }
832
+ },
833
+ updateListFilters: function (expandItem) {
834
+ const searchValue = this.searchInputs[expandItem] || '';
835
+
836
+ this.$nextTick(() => {
837
+ const searchInputEl = this.$refs['searchInput_' + expandItem];
838
+ if (!searchInputEl) return;
839
+
840
+ const ul = searchInputEl.closest('.el-cascader-menu__list');
841
+ ul.querySelectorAll('.el-cascader-node').forEach((li, index) => {
842
+ // skip index:0 (search box), and index:1 (Show all)
843
+ if (index > 1) {
844
+ const content = li.querySelector('.el-cascader-node__label').textContent;
845
+ if (content.toLowerCase().includes(searchValue.toLowerCase())) {
846
+ li.classList.remove('hide');
847
+ } else {
848
+ li.classList.add('hide');
849
+ }
850
+ }
851
+ });
852
+
853
+ if (searchValue) {
854
+ searchInputEl.focus();
855
+ }
856
+ });
857
+ },
652
858
  numberShownChanged: function (event) {
653
859
  this.$emit('numberPerPage', parseInt(event))
654
860
  },
@@ -810,7 +1016,13 @@ export default {
810
1016
  for (const firstLayer of this.options) {
811
1017
  if (firstLayer.value === filter.facetPropPath) {
812
1018
  for (const secondLayer of firstLayer.children) {
813
- if (secondLayer.label?.toLowerCase() === lowercase) {
1019
+ // connectivity filters
1020
+ if (filter.facetPropPath.includes('flatmap.connectivity.source.') && secondLayer.key) {
1021
+ const value = secondLayer.key.replace(`${filter.facetPropPath}.`, '');
1022
+ if (value.toLowerCase() === lowercase) {
1023
+ return filter
1024
+ }
1025
+ } else if (secondLayer.label?.toLowerCase() === lowercase) {
814
1026
  // if we find a match on the second level, the filter will already be correct
815
1027
  // Make sure the case matches the one from Algolia
816
1028
  filter.facet = secondLayer.label
@@ -836,33 +1048,52 @@ export default {
836
1048
  return false
837
1049
  },
838
1050
  getHierarchicalValidatedFilters: function (filters) {
1051
+ const result = []
1052
+ const terms = []
1053
+ const notFound = []
1054
+
839
1055
  if (filters) {
840
- if (this.cascaderIsReady) {
841
- const result = []
842
- const terms = []
843
- filters.forEach((filter) => {
844
- const validatedFilter =
845
- this.validateAndConvertFilterToHierarchical(filter)
846
- if (validatedFilter) {
847
- result.push(validatedFilter)
848
- terms.push(validatedFilter.term)
849
- }
850
- })
851
- // make sure unused filter terms' show all checkbox is always checked
852
- this.options.forEach((option)=>{
853
- if (!terms.includes(option.label)) {
854
- result.push({
855
- facet: "Show all",
856
- facetPropPath: option.key,
857
- label: "Show all",
858
- term: option.label
859
- })
1056
+ if (!this.cascaderIsReady) {
1057
+ return {
1058
+ result: filters,
1059
+ notFound: notFound,
1060
+ }
1061
+ }
1062
+
1063
+ filters.forEach((filter) => {
1064
+ const validatedFilter =
1065
+ this.validateAndConvertFilterToHierarchical(filter)
1066
+ if (validatedFilter) {
1067
+ result.push(validatedFilter)
1068
+ terms.push(validatedFilter.term)
1069
+ } else {
1070
+ const validOption = this.options.find((option) => {
1071
+ return option.key === filter.facetPropPath;
1072
+ });
1073
+ if (validOption) {
1074
+ // not found items
1075
+ notFound.push(filter)
860
1076
  }
861
- })
862
- return result
863
- } else return filters
1077
+ }
1078
+ })
1079
+
1080
+ // make sure unused filter terms' show all checkbox is always checked
1081
+ this.options.forEach((option)=>{
1082
+ if (!terms.includes(option.label)) {
1083
+ result.push({
1084
+ facet: "Show all",
1085
+ facetPropPath: option.key,
1086
+ label: "Show all",
1087
+ term: option.label
1088
+ })
1089
+ }
1090
+ })
1091
+ }
1092
+
1093
+ return {
1094
+ result: result,
1095
+ notFound: notFound,
864
1096
  }
865
- return []
866
1097
  },
867
1098
  hasLineStyles: function(item) {
868
1099
  return 'colour' in item && item.colourStyle === 'line'
@@ -886,12 +1117,16 @@ export default {
886
1117
  },
887
1118
  },
888
1119
  mounted: function () {
889
- this.algoliaClient = markRaw(new AlgoliaClient(
890
- this.envVars.ALGOLIA_ID,
891
- this.envVars.ALGOLIA_KEY,
892
- this.envVars.PENNSIEVE_API_LOCATION
893
- ))
894
- this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX)
1120
+ // in populateCascader function,
1121
+ // algoliaClient run only when there are no this.entry.options
1122
+ if (!this.entry.options) {
1123
+ this.algoliaClient = markRaw(new AlgoliaClient(
1124
+ this.envVars.ALGOLIA_ID,
1125
+ this.envVars.ALGOLIA_KEY,
1126
+ this.envVars.PENNSIEVE_API_LOCATION
1127
+ ))
1128
+ this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX)
1129
+ }
895
1130
  this.populateCascader().then(() => {
896
1131
  this.cascaderIsReady = true
897
1132
  this.checkShowAllBoxes()
@@ -924,6 +1159,19 @@ export default {
924
1159
  white-space: nowrap;
925
1160
  overflow: hidden;
926
1161
  text-overflow: ellipsis;
1162
+ line-height: 1.2;
1163
+ }
1164
+
1165
+ .connectivity-tag::first-letter,
1166
+ :deep(.connectivity-tag .el-tag__content::first-letter) {
1167
+ display: inline-block;
1168
+ padding: 0 2px;
1169
+ margin-right: 2px;
1170
+ color: white;
1171
+ background-color: $app-primary-color;
1172
+ font-style: italic;
1173
+ font-size: 90%;
1174
+ border-radius: 2px;
927
1175
  }
928
1176
 
929
1177
  .el-tags-container {
@@ -932,6 +1180,12 @@ export default {
932
1180
  gap: 4px;
933
1181
  }
934
1182
 
1183
+ :deep(.connectivity-tag .el-tag__content) {
1184
+ max-width: 100%;
1185
+ overflow: hidden;
1186
+ text-overflow: ellipsis;
1187
+ }
1188
+
935
1189
  .el-tag {
936
1190
  .cascader-tag &,
937
1191
  .el-tags-container & {
@@ -940,6 +1194,9 @@ export default {
940
1194
  color: #303133 !important;
941
1195
  background-color: #fff;
942
1196
  border-color: #dcdfe6 !important;
1197
+ width: auto;
1198
+ max-width: 100%;
1199
+ justify-content: flex-start;
943
1200
  }
944
1201
  }
945
1202
 
@@ -1093,6 +1350,56 @@ export default {
1093
1350
  border-color: $app-primary-color;
1094
1351
  }
1095
1352
 
1353
+ .sidebar-cascader-popper .el-cascader-menu:last-child .el-cascader-node {
1354
+ &.is-disabled {
1355
+ border-bottom: 1px solid #e4e7ed;
1356
+ padding-bottom: 0.5rem;
1357
+ position: sticky;
1358
+ top: 0.5rem;
1359
+ background-color: white;
1360
+ z-index: 20;
1361
+ box-shadow: 0px -6px 0px 6px white;
1362
+ cursor: default;
1363
+
1364
+ .el-checkbox.is-disabled {
1365
+ display: none;
1366
+ }
1367
+
1368
+ .el-cascader-node__label {
1369
+ padding-left: 0;
1370
+ padding-right: 0;
1371
+ }
1372
+
1373
+ // hide show all for connection filters
1374
+ + .el-cascader-node {
1375
+ display: none;
1376
+ }
1377
+ }
1378
+
1379
+ &.hide {
1380
+ display: none;
1381
+ }
1382
+ }
1383
+
1384
+ .sidebar-cascader-popper .sidebar-cascader-search.el-input {
1385
+ --el-input-focus-border-color: #{$app-primary-color};
1386
+ }
1387
+
1388
+ .sidebar-cascader-popper .el-cascader-menu__list.cascader-menu-with-search {
1389
+ display: flex;
1390
+ flex-direction: column;
1391
+
1392
+ .el-cascader-node:nth-child(1),
1393
+ .el-cascader-node:nth-child(2),
1394
+ .el-cascader-node.is-active {
1395
+ order: 1;
1396
+ }
1397
+
1398
+ .el-cascader-node {
1399
+ order: 2;
1400
+ }
1401
+ }
1402
+
1096
1403
  .filter-help-popover,
1097
1404
  .cascade-tags-popover {
1098
1405
  font-family: 'Asap', sans-serif;
@@ -1120,4 +1427,14 @@ export default {
1120
1427
  margin-right: 5px;
1121
1428
  display: inline-block;
1122
1429
  }
1430
+
1431
+ .sr-only {
1432
+ clip: rect(0 0 0 0);
1433
+ clip-path: inset(50%);
1434
+ height: 1px;
1435
+ overflow: hidden;
1436
+ position: absolute;
1437
+ white-space: nowrap;
1438
+ width: 1px;
1439
+ }
1123
1440
  </style>
@@ -237,7 +237,7 @@ export default {
237
237
 
238
238
  if (!isExistingItem) {
239
239
  const {label, longLabel} = this.searchHistoryItemLabel(search, filters);
240
- if (label || longLabel) {
240
+ if (label || longLabel) {
241
241
  const newItem = {
242
242
  filters: filters,
243
243
  search: search,
@@ -247,14 +247,14 @@ export default {
247
247
  id: generateUUID(),
248
248
  updated: (new Date()).getTime(),
249
249
  };
250
-
250
+
251
251
  this.searchHistory.push(newItem);
252
-
252
+
253
253
  this.searchHistory = this.searchHistory.sort(this.sortSearchHistory);
254
-
254
+
255
255
  // trim search history to 12 items
256
256
  this.trimSearchHistory();
257
-
257
+
258
258
  // Save new data
259
259
  localStorage.setItem(this.localStorageKey, JSON.stringify(this.searchHistory));
260
260
  }
@@ -355,7 +355,7 @@ export default {
355
355
 
356
356
  if (filters) {
357
357
  filterItems = filters.filter((filterItem) => filterItem.facet !== 'Show all');
358
- filterLabels = filterItems.map((item) => item.facet);
358
+ filterLabels = filterItems.map((item) => item.tagLabel || item.facet);
359
359
  }
360
360
 
361
361
  if (label && filterItems.length) {
@@ -365,7 +365,7 @@ export default {
365
365
  }
366
366
 
367
367
  if (!label && filterItems.length) {
368
- label = filterItems[0].facet;
368
+ label = filterItems[0].tagLabel || filterItems[0].facet;
369
369
 
370
370
  if (filterItems.length > 1) {
371
371
  longLabel += `${filterLabels.join(', ')}`;