@abi-software/map-side-bar 2.9.2-beta.1 → 2.9.2-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.
- package/dist/map-side-bar.js +2098 -2085
- package/dist/map-side-bar.umd.cjs +54 -54
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/SearchFilters.vue +57 -5
package/package.json
CHANGED
|
@@ -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)"
|
|
@@ -382,10 +383,26 @@ export default {
|
|
|
382
383
|
})
|
|
383
384
|
})
|
|
384
385
|
},
|
|
386
|
+
isConnectivityTag: function (tag) {
|
|
387
|
+
const regex = /^[A-Za-z]:/; // starts with O: D: V:
|
|
388
|
+
return regex.test(tag);
|
|
389
|
+
},
|
|
390
|
+
getConnectivityTag: function (tag) {
|
|
391
|
+
const index = tag.indexOf(":");
|
|
392
|
+
const result = index !== -1 ? tag.substring(index + 1) : tag;
|
|
393
|
+
return result;
|
|
394
|
+
},
|
|
395
|
+
modifyCascaderTagStyle: function (tag) {
|
|
396
|
+
if (this.isConnectivityTag(tag)) {
|
|
397
|
+
return 'connectivity-tag';
|
|
398
|
+
}
|
|
399
|
+
return '';
|
|
400
|
+
},
|
|
385
401
|
/**
|
|
386
402
|
* Create manual events when cascader tag is closed
|
|
387
403
|
*/
|
|
388
|
-
cascadeTagClose: function (
|
|
404
|
+
cascadeTagClose: function (_tag) {
|
|
405
|
+
const tag = this.isConnectivityTag(_tag) ? this.getConnectivityTag(_tag) : _tag;
|
|
389
406
|
let manualEvent = []
|
|
390
407
|
|
|
391
408
|
Object.entries(this.cascaderTags).map((entry) => {
|
|
@@ -444,27 +461,37 @@ export default {
|
|
|
444
461
|
}
|
|
445
462
|
|
|
446
463
|
this.cascaderTags = {}
|
|
464
|
+
this.cascaderTagsClone = {}
|
|
447
465
|
this.presentTags = []
|
|
448
466
|
event.map((item) => {
|
|
449
467
|
const { facet, facet2, term, tagLabel, facetPropPath } = item
|
|
450
468
|
let facetLabel = facet;
|
|
469
|
+
let termId = '';
|
|
451
470
|
|
|
452
471
|
// Connectivity filter has different value and label,
|
|
453
472
|
// value is used for filter logic
|
|
454
473
|
// label is used for user interface (and this cascader tag is just user interface)
|
|
455
474
|
if (facetPropPath && facetPropPath.includes('flatmap.connectivity.source.') && tagLabel) {
|
|
456
475
|
facetLabel = tagLabel;
|
|
476
|
+
termId = term.charAt(0);
|
|
457
477
|
}
|
|
458
478
|
|
|
459
479
|
if (this.correctnessCheck.term.has(term) && this.correctnessCheck.facet.has(facetLabel)) {
|
|
460
480
|
if (facet2) {
|
|
461
481
|
if (this.correctnessCheck.facet2.has(facet2)) {
|
|
462
482
|
if (term in this.cascaderTags) {
|
|
463
|
-
if (facet in this.cascaderTags[term])
|
|
464
|
-
|
|
483
|
+
if (facet in this.cascaderTags[term]) {
|
|
484
|
+
this.cascaderTags[term][facet].push(facet2)
|
|
485
|
+
this.cascaderTagsClone[term][facet].push(facet2)
|
|
486
|
+
} else {
|
|
487
|
+
this.cascaderTags[term][facet] = [facet2]
|
|
488
|
+
this.cascaderTagsClone[term][facet] = [facet2]
|
|
489
|
+
}
|
|
465
490
|
} else {
|
|
466
491
|
this.cascaderTags[term] = {}
|
|
467
492
|
this.cascaderTags[term][facet] = [facet2]
|
|
493
|
+
this.cascaderTagsClone[term] = {}
|
|
494
|
+
this.cascaderTagsClone[term][facet] = [facet2]
|
|
468
495
|
}
|
|
469
496
|
}
|
|
470
497
|
} else {
|
|
@@ -473,18 +500,31 @@ export default {
|
|
|
473
500
|
// in this case 'push' action will not available.
|
|
474
501
|
if (term in this.cascaderTags && term !== 'Anatomical structure') {
|
|
475
502
|
this.cascaderTags[term].push(facetLabel)
|
|
503
|
+
// connectivity exploration mode tags
|
|
504
|
+
if (termId) {
|
|
505
|
+
this.cascaderTagsClone[term].push(termId + ':' + facetLabel);
|
|
506
|
+
} else {
|
|
507
|
+
this.cascaderTagsClone[term].push(facetLabel);
|
|
508
|
+
}
|
|
476
509
|
} else {
|
|
477
510
|
if (facet.toLowerCase() !== "show all") {
|
|
478
511
|
this.cascaderTags[term] = [facetLabel]
|
|
512
|
+
// connectivity exploration mode tags
|
|
513
|
+
if (termId) {
|
|
514
|
+
this.cascaderTagsClone[term] = [termId + ':' + facetLabel];
|
|
515
|
+
} else {
|
|
516
|
+
this.cascaderTagsClone[term] = [facetLabel]
|
|
517
|
+
}
|
|
479
518
|
} else {
|
|
480
519
|
this.cascaderTags[term] = []
|
|
520
|
+
this.cascaderTagsClone[term] = []
|
|
481
521
|
}
|
|
482
522
|
}
|
|
483
523
|
}
|
|
484
524
|
}
|
|
485
525
|
})
|
|
486
526
|
|
|
487
|
-
Object.values(this.
|
|
527
|
+
Object.values(this.cascaderTagsClone).map((value) => {
|
|
488
528
|
const extend = Array.isArray(value) ? value : Object.values(value).flat(1)
|
|
489
529
|
this.presentTags = [...this.presentTags, ...extend]
|
|
490
530
|
})
|
|
@@ -1114,6 +1154,18 @@ export default {
|
|
|
1114
1154
|
text-overflow: ellipsis;
|
|
1115
1155
|
}
|
|
1116
1156
|
|
|
1157
|
+
.connectivity-tag::first-letter,
|
|
1158
|
+
:deep(.connectivity-tag .el-tag__content::first-letter) {
|
|
1159
|
+
display: inline-block;
|
|
1160
|
+
padding: 0 2px;
|
|
1161
|
+
margin-right: 2px;
|
|
1162
|
+
color: white;
|
|
1163
|
+
background-color: $app-primary-color;
|
|
1164
|
+
font-style: italic;
|
|
1165
|
+
font-size: 90%;
|
|
1166
|
+
border-radius: 2px;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1117
1169
|
.el-tags-container {
|
|
1118
1170
|
display: flex;
|
|
1119
1171
|
flex-wrap: wrap;
|