@abi-software/map-side-bar 2.5.3-beta.0 → 2.5.3-beta.10
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 +8099 -8028
- package/dist/map-side-bar.umd.cjs +75 -75
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ConnectivityInfo.vue +16 -15
- package/src/components/SearchFilters.vue +13 -2
- package/src/components/SearchHistory.vue +277 -61
- package/src/components/SidebarContent.vue +36 -14
- package/src/components.d.ts +0 -2
|
@@ -173,7 +173,7 @@ export default {
|
|
|
173
173
|
this.results = []
|
|
174
174
|
this.loadingCards = false
|
|
175
175
|
},
|
|
176
|
-
openSearch: function (filter, search = '') {
|
|
176
|
+
openSearch: function (filter, search = '', option = { withSearch: true }) {
|
|
177
177
|
this.searchInput = search
|
|
178
178
|
this.resetPageNavigation()
|
|
179
179
|
//Proceed normally if cascader is ready
|
|
@@ -192,14 +192,16 @@ export default {
|
|
|
192
192
|
this.$refs.filtersRef.checkShowAllBoxes()
|
|
193
193
|
this.resetSearch()
|
|
194
194
|
} else if (this.filter) {
|
|
195
|
-
|
|
195
|
+
if (option.withSearch) {
|
|
196
|
+
this.searchAlgolia(this.filter, search)
|
|
197
|
+
}
|
|
196
198
|
this.$refs.filtersRef.setCascader(this.filter)
|
|
197
199
|
}
|
|
198
200
|
} else {
|
|
199
201
|
//cascader is not ready, perform search if no filter is set,
|
|
200
202
|
//otherwise waith for cascader to be ready
|
|
201
203
|
this.filter = filter
|
|
202
|
-
if (!filter || filter.length == 0) {
|
|
204
|
+
if ((!filter || filter.length == 0) && option.withSearch) {
|
|
203
205
|
this.searchAlgolia(this.filter, search)
|
|
204
206
|
}
|
|
205
207
|
}
|
|
@@ -224,13 +226,12 @@ export default {
|
|
|
224
226
|
this.openSearch(this.filter, this.searchInput)
|
|
225
227
|
},
|
|
226
228
|
clearSearchClicked: function () {
|
|
227
|
-
this.searchInput = ''
|
|
228
|
-
this.
|
|
229
|
-
this.searchAlgolia(this.filters, this.searchInput)
|
|
230
|
-
this.$refs.searchHistory.selectValue = 'Search history'
|
|
229
|
+
this.searchInput = '';
|
|
230
|
+
this.searchAndFilterUpdate();
|
|
231
231
|
},
|
|
232
232
|
searchEvent: function (event = false) {
|
|
233
233
|
if (event.keyCode === 13 || event instanceof MouseEvent) {
|
|
234
|
+
this.searchInput = this.searchInput.trim();
|
|
234
235
|
this.searchAndFilterUpdate();
|
|
235
236
|
}
|
|
236
237
|
},
|
|
@@ -242,9 +243,23 @@ export default {
|
|
|
242
243
|
type: 'filter-update',
|
|
243
244
|
})
|
|
244
245
|
},
|
|
246
|
+
/**
|
|
247
|
+
* Transform filters for third level items to perform search
|
|
248
|
+
* because cascader keeps adding it back.
|
|
249
|
+
*/
|
|
250
|
+
transformFiltersBeforeSearch: function (filters) {
|
|
251
|
+
return filters.map((filter) => {
|
|
252
|
+
if (filter.facet2) {
|
|
253
|
+
filter.facet = filter.facet2;
|
|
254
|
+
delete filter.facet2;
|
|
255
|
+
}
|
|
256
|
+
return filter;
|
|
257
|
+
});
|
|
258
|
+
},
|
|
245
259
|
searchAndFilterUpdate: function () {
|
|
246
260
|
this.resetPageNavigation();
|
|
247
|
-
this.
|
|
261
|
+
const transformedFilters = this.transformFiltersBeforeSearch(this.filters);
|
|
262
|
+
this.searchAlgolia(transformedFilters, this.searchInput);
|
|
248
263
|
this.$refs.searchHistory.selectValue = 'Search history';
|
|
249
264
|
// save history only if there has value
|
|
250
265
|
if (this.filters.length || this.searchInput?.trim()) {
|
|
@@ -445,7 +460,9 @@ export default {
|
|
|
445
460
|
searchHistorySearch: function (item) {
|
|
446
461
|
this.searchInput = item.search
|
|
447
462
|
this.filters = item.filters
|
|
448
|
-
this.
|
|
463
|
+
this.searchAndFilterUpdate();
|
|
464
|
+
// withSearch: false to prevent algoliaSearch in openSearch
|
|
465
|
+
this.openSearch([...item.filters], item.search, { withSearch: false });
|
|
449
466
|
},
|
|
450
467
|
},
|
|
451
468
|
mounted: function () {
|
|
@@ -493,6 +510,9 @@ export default {
|
|
|
493
510
|
height: 100%;
|
|
494
511
|
flex-flow: column;
|
|
495
512
|
display: flex;
|
|
513
|
+
border: 0;
|
|
514
|
+
border-top-right-radius: 0;
|
|
515
|
+
border-bottom-right-radius: 0;
|
|
496
516
|
}
|
|
497
517
|
|
|
498
518
|
.step-item {
|
|
@@ -505,15 +525,16 @@ export default {
|
|
|
505
525
|
width: 298px !important;
|
|
506
526
|
height: 40px;
|
|
507
527
|
padding-right: 14px;
|
|
508
|
-
|
|
528
|
+
|
|
529
|
+
:deep(.el-input__inner) {
|
|
530
|
+
font-family: inherit;
|
|
531
|
+
}
|
|
509
532
|
}
|
|
510
533
|
|
|
511
534
|
.header {
|
|
512
|
-
border: solid 1px #292b66;
|
|
513
|
-
background-color: #292b66;
|
|
514
|
-
text-align: left;
|
|
515
|
-
|
|
516
535
|
.el-button {
|
|
536
|
+
font-family: inherit;
|
|
537
|
+
|
|
517
538
|
&:hover,
|
|
518
539
|
&:focus {
|
|
519
540
|
background: $app-primary-color;
|
|
@@ -566,6 +587,7 @@ export default {
|
|
|
566
587
|
background-color: #ffffff;
|
|
567
588
|
overflow-y: scroll;
|
|
568
589
|
scrollbar-width: thin;
|
|
590
|
+
border-radius: var(--el-border-radius-base);
|
|
569
591
|
}
|
|
570
592
|
|
|
571
593
|
.content :deep(.el-loading-spinner .path) {
|
package/src/components.d.ts
CHANGED
|
@@ -25,8 +25,6 @@ declare module 'vue' {
|
|
|
25
25
|
ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
|
|
26
26
|
ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
|
|
27
27
|
ElIconLocation: typeof import('@element-plus/icons-vue')['Location']
|
|
28
|
-
ElIconStar: typeof import('@element-plus/icons-vue')['Star']
|
|
29
|
-
ElIconStarFilled: typeof import('@element-plus/icons-vue')['StarFilled']
|
|
30
28
|
ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
|
|
31
29
|
ElIconWarnTriangleFilled: typeof import('@element-plus/icons-vue')['WarnTriangleFilled']
|
|
32
30
|
ElInput: typeof import('element-plus/es')['ElInput']
|