@abi-software/map-side-bar 2.5.3-beta.4 → 2.5.3-beta.5

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.
@@ -95,7 +95,6 @@ var handleErrors = async function (response) {
95
95
  }
96
96
 
97
97
  var initial_state = {
98
- filters: [],
99
98
  searchInput: '',
100
99
  lastSearch: '',
101
100
  results: [],
@@ -173,7 +172,7 @@ export default {
173
172
  this.results = []
174
173
  this.loadingCards = false
175
174
  },
176
- openSearch: function (filter, search = '', option = { withSearch: true }) {
175
+ openSearch: function (filter, search = '') {
177
176
  this.searchInput = search
178
177
  this.resetPageNavigation()
179
178
  //Proceed normally if cascader is ready
@@ -192,16 +191,14 @@ export default {
192
191
  this.$refs.filtersRef.checkShowAllBoxes()
193
192
  this.resetSearch()
194
193
  } else if (this.filter) {
195
- if (option.withSearch) {
196
- this.searchAlgolia(this.filter, search)
197
- }
194
+ this.searchAlgolia(this.filter, search)
198
195
  this.$refs.filtersRef.setCascader(this.filter)
199
196
  }
200
197
  } else {
201
198
  //cascader is not ready, perform search if no filter is set,
202
199
  //otherwise waith for cascader to be ready
203
200
  this.filter = filter
204
- if ((!filter || filter.length == 0) && option.withSearch) {
201
+ if (!filter || filter.length == 0) {
205
202
  this.searchAlgolia(this.filter, search)
206
203
  }
207
204
  }
@@ -229,47 +226,28 @@ export default {
229
226
  this.searchInput = ''
230
227
  this.resetPageNavigation()
231
228
  this.searchAlgolia(this.filters, this.searchInput)
232
- this.$refs.searchHistory.selectValue = 'Search history'
229
+ this.$refs.searchHistory.selectValue = 'Full search history'
233
230
  },
234
231
  searchEvent: function (event = false) {
235
232
  if (event.keyCode === 13 || event instanceof MouseEvent) {
236
- this.searchAndFilterUpdate();
233
+ this.resetPageNavigation()
234
+ this.searchAlgolia(this.filters, this.searchInput)
235
+ this.$refs.searchHistory.selectValue = 'Full search history'
236
+ this.$refs.searchHistory.addSearchToHistory(
237
+ this.filters,
238
+ this.searchInput
239
+ )
237
240
  }
238
241
  },
239
242
  filterUpdate: function (filters) {
240
243
  this.filters = [...filters]
241
- this.searchAndFilterUpdate();
244
+ this.resetPageNavigation()
245
+ this.searchAlgolia(filters, this.searchInput)
242
246
  this.$emit('search-changed', {
243
247
  value: filters,
244
248
  type: 'filter-update',
245
249
  })
246
250
  },
247
- /**
248
- * Transform filters for third level items to perform search
249
- * because cascader keeps adding it back.
250
- */
251
- transformFiltersBeforeSearch: function (filters) {
252
- return filters.map((filter) => {
253
- if (filter.facet2) {
254
- filter.facet = filter.facet2;
255
- delete filter.facet2;
256
- }
257
- return filter;
258
- });
259
- },
260
- searchAndFilterUpdate: function () {
261
- this.resetPageNavigation();
262
- const transformedFilters = this.transformFiltersBeforeSearch(this.filters);
263
- this.searchAlgolia(transformedFilters, this.searchInput);
264
- this.$refs.searchHistory.selectValue = 'Search history';
265
- // save history only if there has value
266
- if (this.filters.length || this.searchInput?.trim()) {
267
- this.$refs.searchHistory.addSearchToHistory(
268
- this.filters,
269
- this.searchInput
270
- );
271
- }
272
- },
273
251
  searchAlgolia(filters, query = '') {
274
252
  // Algolia search
275
253
 
@@ -461,9 +439,7 @@ export default {
461
439
  searchHistorySearch: function (item) {
462
440
  this.searchInput = item.search
463
441
  this.filters = item.filters
464
- this.searchAndFilterUpdate();
465
- // withSearch: false to prevent algoliaSearch in openSearch
466
- this.openSearch([...item.filters], item.search, { withSearch: false });
442
+ this.openSearch(item.filters, item.search)
467
443
  },
468
444
  },
469
445
  mounted: function () {
@@ -16,14 +16,9 @@ declare module 'vue' {
16
16
  ElCascader: typeof import('element-plus/es')['ElCascader']
17
17
  ElCol: typeof import('element-plus/es')['ElCol']
18
18
  ElDrawer: typeof import('element-plus/es')['ElDrawer']
19
- ElDropdown: typeof import('element-plus/es')['ElDropdown']
20
- ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
21
- ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
22
19
  ElIcon: typeof import('element-plus/es')['ElIcon']
23
- ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
24
20
  ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
25
21
  ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
26
- ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
27
22
  ElIconLocation: typeof import('@element-plus/icons-vue')['Location']
28
23
  ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
29
24
  ElIconWarnTriangleFilled: typeof import('@element-plus/icons-vue')['WarnTriangleFilled']