@appbaseio/reactivesearch-vue 1.35.2 → 1.35.3

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.
@@ -18720,7 +18720,8 @@
18720
18720
  selectedTags: [],
18721
18721
  isOpen: false,
18722
18722
  normalizedSuggestions: [],
18723
- isPending: false
18723
+ isPending: false,
18724
+ isSuggestionSelected: false
18724
18725
  };
18725
18726
  this.internalComponent = props.componentId + "__internal";
18726
18727
  return this.__state;
@@ -19105,6 +19106,7 @@
19105
19106
  _this.getRecentSearches();
19106
19107
  }
19107
19108
  if (isTagsMode) {
19109
+ var isTagAdded = false;
19108
19110
  if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
19109
19111
  // check if value already present in selectedTags
19110
19112
  if (typeof value === 'string' && _this.selectedTags.includes(value)) {
@@ -19113,14 +19115,36 @@
19113
19115
  }
19114
19116
  _this.selectedTags = [].concat(_this.selectedTags);
19115
19117
  if (typeof value === 'string' && !!value) {
19116
- _this.selectedTags.push(value);
19118
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
19119
+ _this.selectedTags.push(value);
19120
+ isTagAdded = true;
19121
+ } else if (!props.strictSelection) {
19122
+ _this.selectedTags.push(value);
19123
+ isTagAdded = true;
19124
+ }
19117
19125
  } else if (Array.isArray(value) && !isEqual$4(_this.selectedTags, value)) {
19118
- _this.selectedTags = value;
19126
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
19127
+ _this.selectedTags = value;
19128
+ isTagAdded = true;
19129
+ } else if (!props.strictSelection) {
19130
+ _this.selectedTags.push(value);
19131
+ isTagAdded = true;
19132
+ }
19119
19133
  }
19120
19134
  } else if (value) {
19121
- _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
19135
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
19136
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
19137
+ isTagAdded = true;
19138
+ } else if (!props.strictSelection) {
19139
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
19140
+ isTagAdded = true;
19141
+ }
19142
+ }
19143
+ if (props.strictSelection && !isTagAdded) {
19144
+ _this.currentValue = value;
19145
+ } else {
19146
+ _this.currentValue = '';
19122
19147
  }
19123
- _this.currentValue = '';
19124
19148
  } else {
19125
19149
  _this.currentValue = value;
19126
19150
  }
@@ -19140,7 +19164,7 @@
19140
19164
  if (props.strictSelection && props.autosuggest) {
19141
19165
  if (cause === lib_7.SUGGESTION_SELECT || props.value !== undefined) {
19142
19166
  _this.updateQueryHandler(props.componentId, queryHandlerValue, props);
19143
- } else if (_this.currentValue !== '') {
19167
+ } else if (_this.currentValue !== '' && !props.strictSelection) {
19144
19168
  _this.setValue('', true);
19145
19169
  }
19146
19170
  } else {
@@ -19269,17 +19293,17 @@
19269
19293
  var targetValue = event.target.value;
19270
19294
  var _this$$props2 = this.$props,
19271
19295
  value = _this$$props2.value,
19272
- strictSelection = _this$$props2.strictSelection,
19273
- size = _this$$props2.size,
19274
- autosuggest = _this$$props2.autosuggest;
19296
+ size = _this$$props2.size;
19275
19297
  if (value !== undefined) {
19276
19298
  this.isPending = true;
19277
19299
  }
19278
19300
  // if a suggestion was selected, delegate the handling to suggestion handler
19279
19301
  if (event.key === 'Enter' && (highlightedIndex === null || highlightedIndex < 0 || highlightedIndex === [].concat([].concat(this.suggestionsList).slice(0, size || 10), this.defaultSearchSuggestions, this.topSuggestions).length)) {
19280
19302
  this.isPending = false;
19281
- this.setValue(this.$options.isTagsMode && autosuggest && strictSelection ? '' : targetValue, true, this.$props, undefined, false);
19282
- this.onValueSelectedHandler(targetValue, lib_7.ENTER_PRESS);
19303
+ if (!this.isSuggestionSelected) {
19304
+ this.setValue(targetValue, true, this.$props, undefined, false);
19305
+ this.onValueSelectedHandler(targetValue, lib_7.ENTER_PRESS);
19306
+ }
19283
19307
  }
19284
19308
  // Need to review
19285
19309
  this.$emit('keyDown', event, this.triggerQuery);
@@ -19315,11 +19339,16 @@
19315
19339
  }
19316
19340
  },
19317
19341
  onSuggestionSelected: function onSuggestionSelected(suggestion) {
19342
+ var _this3 = this;
19318
19343
  var value = this.$props.value;
19319
19344
  // Record analytics for selected suggestions
19320
19345
  this.triggerClickAnalytics(suggestion._click_id);
19321
19346
  if (value === undefined) {
19322
19347
  this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT);
19348
+ this.isSuggestionSelected = true;
19349
+ setTimeout(function () {
19350
+ _this3.isSuggestionSelected = false;
19351
+ }, 50);
19323
19352
  } else if (this.$options.isTagsMode) {
19324
19353
  var emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
19325
19354
  if (this.selectedTags.includes(suggestion.value)) {
@@ -19425,7 +19454,7 @@
19425
19454
  return null;
19426
19455
  },
19427
19456
  renderTag: function renderTag(item) {
19428
- var _this3 = this;
19457
+ var _this4 = this;
19429
19458
  var h = this.$createElement;
19430
19459
  var innerClass = this.$props.innerClass;
19431
19460
  return h(TagItem, {
@@ -19438,7 +19467,7 @@
19438
19467
  "class": "close-icon",
19439
19468
  "on": {
19440
19469
  "click": function click() {
19441
- return _this3.clearTag(item);
19470
+ return _this4.clearTag(item);
19442
19471
  }
19443
19472
  }
19444
19473
  }, [h(CancelSvg)])]);
@@ -19460,7 +19489,7 @@
19460
19489
  }
19461
19490
  },
19462
19491
  renderTags: function renderTags() {
19463
- var _this4 = this;
19492
+ var _this5 = this;
19464
19493
  var h = this.$createElement;
19465
19494
  if (!Array.isArray(this.selectedTags)) {
19466
19495
  return null;
@@ -19473,7 +19502,7 @@
19473
19502
  handleClear: this.clearTag,
19474
19503
  handleClearAll: this.clearAllTags
19475
19504
  }) : h(TagsContainer, [tagsList.map(function (item) {
19476
- return _this4.renderTag(item);
19505
+ return _this5.renderTag(item);
19477
19506
  }), shouldRenderClearAllTag && h(TagItem, {
19478
19507
  "class": getClassName$3(this.$props.innerClass, 'selected-tag') || ''
19479
19508
  }, [h("span", ["Clear All"]), h("span", {
@@ -19552,7 +19581,7 @@
19552
19581
  (_this$$refs = this.$refs) == null || (_this$$refs = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs.focus(); // eslint-disable-line
19553
19582
  },
19554
19583
  listenForFocusShortcuts: function listenForFocusShortcuts() {
19555
- var _this5 = this;
19584
+ var _this6 = this;
19556
19585
  var _this$$props$focusSho = this.$props.focusShortcuts,
19557
19586
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
19558
19587
  if (isEmpty(focusShortcuts)) {
@@ -19567,7 +19596,7 @@
19567
19596
  function (event, handler) {
19568
19597
  // Prevent the default refresh event under WINDOWS system
19569
19598
  event.preventDefault();
19570
- _this5.focusSearchBox(event);
19599
+ _this6.focusSearchBox(event);
19571
19600
  });
19572
19601
 
19573
19602
  // if one of modifier keys are used, they are handled below
@@ -19577,7 +19606,7 @@
19577
19606
  for (var index = 0; index < modifierKeys.length; index += 1) {
19578
19607
  var element = modifierKeys[index];
19579
19608
  if (hotkeys[element]) {
19580
- _this5.focusSearchBox(event);
19609
+ _this6.focusSearchBox(event);
19581
19610
  break;
19582
19611
  }
19583
19612
  }
@@ -19585,7 +19614,7 @@
19585
19614
  }
19586
19615
  },
19587
19616
  render: function render() {
19588
- var _this6 = this;
19617
+ var _this7 = this;
19589
19618
  var h = arguments[0];
19590
19619
  var _this$$props6 = this.$props,
19591
19620
  theme = _this$$props6.theme,
@@ -19620,14 +19649,14 @@
19620
19649
  highlightedIndex = _ref4.highlightedIndex,
19621
19650
  setHighlightedIndex = _ref4.setHighlightedIndex;
19622
19651
  var renderSuggestionsContainer = function renderSuggestionsContainer() {
19623
- return h("div", [_this6.hasCustomRenderer && _this6.getComponent({
19652
+ return h("div", [_this7.hasCustomRenderer && _this7.getComponent({
19624
19653
  isOpen: isOpen,
19625
19654
  getItemProps: getItemProps,
19626
19655
  getItemEvents: getItemEvents,
19627
19656
  highlightedIndex: highlightedIndex
19628
- }), _this6.renderErrorComponent(), !_this6.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
19629
- "class": suggestions$1(_this6.themePreset, theme) + " " + getClassName$3(_this6.$props.innerClass, 'list')
19630
- }, [_this6.suggestionsList.slice(0, size || 10).map(function (item, index) {
19657
+ }), _this7.renderErrorComponent(), !_this7.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
19658
+ "class": suggestions$1(_this7.themePreset, theme) + " " + getClassName$3(_this7.$props.innerClass, 'list')
19659
+ }, [_this7.suggestionsList.slice(0, size || 10).map(function (item, index) {
19631
19660
  return h("li", {
19632
19661
  "domProps": _extends({}, getItemProps({
19633
19662
  item: item
@@ -19637,15 +19666,15 @@
19637
19666
  })),
19638
19667
  "key": index + 1 + "-" + item.value,
19639
19668
  "style": {
19640
- backgroundColor: _this6.getBackgroundColor(highlightedIndex, index)
19669
+ backgroundColor: _this7.getBackgroundColor(highlightedIndex, index)
19641
19670
  }
19642
19671
  }, [h(SuggestionItem, {
19643
19672
  "attrs": {
19644
- "currentValue": _this6.currentValue,
19673
+ "currentValue": _this7.currentValue,
19645
19674
  "suggestion": item
19646
19675
  }
19647
19676
  })]);
19648
- }), _this6.defaultSearchSuggestions.map(function (sugg, index) {
19677
+ }), _this7.defaultSearchSuggestions.map(function (sugg, index) {
19649
19678
  return h("li", {
19650
19679
  "domProps": _extends({}, getItemProps({
19651
19680
  item: sugg
@@ -19653,9 +19682,9 @@
19653
19682
  "on": _extends({}, getItemEvents({
19654
19683
  item: sugg
19655
19684
  })),
19656
- "key": _this6.suggestionsList.length + index + 1 + "-" + sugg.value,
19685
+ "key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
19657
19686
  "style": {
19658
- backgroundColor: _this6.getBackgroundColor(highlightedIndex, _this6.suggestionsList.length + index),
19687
+ backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
19659
19688
  justifyContent: 'flex-start'
19660
19689
  }
19661
19690
  }, [h("div", {
@@ -19664,28 +19693,28 @@
19664
19693
  }
19665
19694
  }, [sugg.source && sugg.source._recent_search && h(CustomSvg, {
19666
19695
  "attrs": {
19667
- "className": getClassName$3(_this6.$props.innerClass, 'recent-search-icon') || null,
19696
+ "className": getClassName$3(_this7.$props.innerClass, 'recent-search-icon') || null,
19668
19697
  "icon": recentSearchesIcon,
19669
19698
  "type": "recent-search-icon"
19670
19699
  }
19671
19700
  }), sugg.source && sugg.source._popular_suggestion && h(CustomSvg, {
19672
19701
  "attrs": {
19673
- "className": getClassName$3(_this6.$props.innerClass, 'popular-search-icon') || null,
19702
+ "className": getClassName$3(_this7.$props.innerClass, 'popular-search-icon') || null,
19674
19703
  "icon": popularSearchesIcon,
19675
19704
  "type": "popular-search-icon"
19676
19705
  }
19677
19706
  })]), h(SuggestionItem, {
19678
19707
  "attrs": {
19679
- "currentValue": _this6.currentValue,
19708
+ "currentValue": _this7.currentValue,
19680
19709
  "suggestion": sugg
19681
19710
  }
19682
19711
  })]);
19683
- }), hasQuerySuggestionsRenderer(_this6) ? _this6.getComponent({
19712
+ }), hasQuerySuggestionsRenderer(_this7) ? _this7.getComponent({
19684
19713
  isOpen: isOpen,
19685
19714
  getItemProps: getItemProps,
19686
19715
  getItemEvents: getItemEvents,
19687
19716
  highlightedIndex: highlightedIndex
19688
- }, true) : _this6.topSuggestions.map(function (sugg, index) {
19717
+ }, true) : _this7.topSuggestions.map(function (sugg, index) {
19689
19718
  return h("li", {
19690
19719
  "domProps": _extends({}, getItemProps({
19691
19720
  item: sugg
@@ -19693,9 +19722,9 @@
19693
19722
  "on": _extends({}, getItemEvents({
19694
19723
  item: sugg
19695
19724
  })),
19696
- "key": _this6.suggestionsList.length + index + 1 + "-" + sugg.value,
19725
+ "key": _this7.suggestionsList.length + index + 1 + "-" + sugg.value,
19697
19726
  "style": {
19698
- backgroundColor: _this6.getBackgroundColor(highlightedIndex, _this6.suggestionsList.length + index),
19727
+ backgroundColor: _this7.getBackgroundColor(highlightedIndex, _this7.suggestionsList.length + index),
19699
19728
  justifyContent: 'flex-start'
19700
19729
  }
19701
19730
  }, [h("div", {
@@ -19704,58 +19733,58 @@
19704
19733
  }
19705
19734
  }, [h(CustomSvg, {
19706
19735
  "attrs": {
19707
- "className": getClassName$3(_this6.$props.innerClass, 'popular-search-icon') || null,
19736
+ "className": getClassName$3(_this7.$props.innerClass, 'popular-search-icon') || null,
19708
19737
  "icon": popularSearchesIcon,
19709
19738
  "type": "popular-search-icon"
19710
19739
  }
19711
19740
  })]), h(SuggestionItem, {
19712
19741
  "attrs": {
19713
- "currentValue": _this6.currentValue,
19742
+ "currentValue": _this7.currentValue,
19714
19743
  "suggestion": sugg
19715
19744
  }
19716
19745
  })]);
19717
- })]) : _this6.renderNoSuggestions(_this6.suggestionsList)]);
19746
+ })]) : _this7.renderNoSuggestions(_this7.suggestionsList)]);
19718
19747
  };
19719
19748
  return h("div", {
19720
19749
  "class": suggestionsContainer
19721
- }, [h(InputGroup, [_this6.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
19750
+ }, [h(InputGroup, [_this7.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
19722
19751
  "attrs": {
19723
- "id": _this6.$props.componentId + "-input",
19724
- "showIcon": _this6.$props.showIcon,
19725
- "showClear": _this6.$props.showClear,
19726
- "iconPosition": _this6.$props.iconPosition,
19727
- "placeholder": _this6.$props.placeholder,
19728
- "autoFocus": _this6.$props.autoFocus,
19729
- "themePreset": _this6.themePreset,
19752
+ "id": _this7.$props.componentId + "-input",
19753
+ "showIcon": _this7.$props.showIcon,
19754
+ "showClear": _this7.$props.showClear,
19755
+ "iconPosition": _this7.$props.iconPosition,
19756
+ "placeholder": _this7.$props.placeholder,
19757
+ "autoFocus": _this7.$props.autoFocus,
19758
+ "themePreset": _this7.themePreset,
19730
19759
  "autocomplete": "off"
19731
19760
  },
19732
- "ref": _this6.$props.innerRef,
19733
- "class": getClassName$3(_this6.$props.innerClass, 'input'),
19761
+ "ref": _this7.$props.innerRef,
19762
+ "class": getClassName$3(_this7.$props.innerClass, 'input'),
19734
19763
  "on": _extends({}, getInputEvents({
19735
- onInput: _this6.onInputChange,
19764
+ onInput: _this7.onInputChange,
19736
19765
  onBlur: function onBlur(e) {
19737
- _this6.$emit('blur', e, _this6.triggerQuery);
19766
+ _this7.$emit('blur', e, _this7.triggerQuery);
19738
19767
  },
19739
- onFocus: _this6.handleFocus,
19768
+ onFocus: _this7.handleFocus,
19740
19769
  onKeyPress: function onKeyPress(e) {
19741
- _this6.$emit('keyPress', e, _this6.triggerQuery);
19742
- _this6.$emit('key-press', e, _this6.triggerQuery);
19770
+ _this7.$emit('keyPress', e, _this7.triggerQuery);
19771
+ _this7.$emit('key-press', e, _this7.triggerQuery);
19743
19772
  },
19744
19773
  onKeyDown: function onKeyDown(e) {
19745
- return _this6.handleKeyDown(e, highlightedIndex);
19774
+ return _this7.handleKeyDown(e, highlightedIndex);
19746
19775
  },
19747
19776
  onKeyUp: function onKeyUp(e) {
19748
- _this6.$emit('keyUp', e, _this6.triggerQuery);
19749
- _this6.$emit('key-up', e, _this6.triggerQuery);
19777
+ _this7.$emit('keyUp', e, _this7.triggerQuery);
19778
+ _this7.$emit('key-up', e, _this7.triggerQuery);
19750
19779
  },
19751
19780
  onClick: function onClick() {
19752
19781
  setHighlightedIndex(null);
19753
19782
  }
19754
19783
  })),
19755
19784
  "domProps": _extends({}, getInputProps({
19756
- value: _this6.$data.currentValue === null || typeof _this6.$data.currentValue !== 'string' ? '' : _this6.$data.currentValue
19785
+ value: _this7.$data.currentValue === null || typeof _this7.$data.currentValue !== 'string' ? '' : _this7.$data.currentValue
19757
19786
  }))
19758
- }), _this6.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this6.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this6.renderTags()]);
19787
+ }), _this7.renderIcons(), !expandSuggestionsContainer && renderSuggestionsContainer()]), ' ', _this7.renderInputAddonAfter()]), expandSuggestionsContainer && renderSuggestionsContainer(), _this7.renderTags()]);
19759
19788
  }
19760
19789
  }
19761
19790
  }) : h("div", {
@@ -19771,22 +19800,22 @@
19771
19800
  },
19772
19801
  "on": _extends({}, {
19773
19802
  blur: function blur(e) {
19774
- _this6.$emit('blur', e, _this6.triggerQuery);
19803
+ _this7.$emit('blur', e, _this7.triggerQuery);
19775
19804
  },
19776
19805
  keypress: function keypress(e) {
19777
- _this6.$emit('keyPress', e, _this6.triggerQuery);
19778
- _this6.$emit('key-press', e, _this6.triggerQuery);
19806
+ _this7.$emit('keyPress', e, _this7.triggerQuery);
19807
+ _this7.$emit('key-press', e, _this7.triggerQuery);
19779
19808
  },
19780
19809
  input: this.onInputChange,
19781
19810
  focus: function focus(e) {
19782
- _this6.$emit('focus', e, _this6.triggerQuery);
19811
+ _this7.$emit('focus', e, _this7.triggerQuery);
19783
19812
  },
19784
19813
  keydown: function keydown(e) {
19785
- _this6.handleKeyDown(e, null);
19814
+ _this7.handleKeyDown(e, null);
19786
19815
  },
19787
19816
  keyup: function keyup(e) {
19788
- _this6.$emit('keyUp', e, _this6.triggerQuery);
19789
- _this6.$emit('key-up', e, _this6.triggerQuery);
19817
+ _this7.$emit('keyUp', e, _this7.triggerQuery);
19818
+ _this7.$emit('key-up', e, _this7.triggerQuery);
19790
19819
  }
19791
19820
  }),
19792
19821
  "domProps": _extends({}, {
@@ -20031,7 +20060,8 @@
20031
20060
  currentValue: '',
20032
20061
  selectedTags: [],
20033
20062
  isOpen: false,
20034
- normalizedSuggestions: []
20063
+ normalizedSuggestions: [],
20064
+ isSuggestionSelected: false
20035
20065
  };
20036
20066
  this.internalComponent = props.componentId + "__internal";
20037
20067
  return this.__state;
@@ -20231,7 +20261,9 @@
20231
20261
  if (this.$options.isTagsMode) {
20232
20262
  cause = lib_7.SUGGESTION_SELECT;
20233
20263
  }
20234
- this.setValue(newVal || '', true, this.$props, cause);
20264
+ if (!this.isSuggestionSelected) {
20265
+ this.setValue(newVal || '', true, this.$props, cause);
20266
+ }
20235
20267
  }
20236
20268
  },
20237
20269
  focusShortcuts: function focusShortcuts() {
@@ -20360,10 +20392,11 @@
20360
20392
  categoryValue = undefined;
20361
20393
  }
20362
20394
  var performUpdate = function performUpdate() {
20395
+ var isTagAdded = false;
20363
20396
  if (_this.$options.isTagsMode && isEqual$5(value, _this.selectedTags)) {
20364
20397
  return;
20365
20398
  }
20366
- if (_this.$options.isTagsMode && cause === lib_7.SUGGESTION_SELECT) {
20399
+ if (_this.$options.isTagsMode) {
20367
20400
  if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
20368
20401
  // check if value already present in selectedTags
20369
20402
  if (typeof value === 'string' && _this.selectedTags.includes(value)) {
@@ -20372,14 +20405,36 @@
20372
20405
  }
20373
20406
  _this.selectedTags = [].concat(_this.selectedTags);
20374
20407
  if (typeof value === 'string' && !!value) {
20375
- _this.selectedTags.push(value);
20408
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
20409
+ _this.selectedTags.push(value);
20410
+ isTagAdded = true;
20411
+ } else if (!props.strictSelection) {
20412
+ _this.selectedTags.push(value);
20413
+ isTagAdded = true;
20414
+ }
20376
20415
  } else if (Array.isArray(value) && !isEqual$5(_this.selectedTags, value)) {
20377
- _this.selectedTags = value;
20416
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
20417
+ _this.selectedTags = value;
20418
+ isTagAdded = true;
20419
+ } else if (!props.strictSelection) {
20420
+ _this.selectedTags.push(value);
20421
+ isTagAdded = true;
20422
+ }
20378
20423
  }
20379
20424
  } else if (value) {
20380
- _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
20425
+ if (props.strictSelection && cause === lib_7.SUGGESTION_SELECT) {
20426
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
20427
+ isTagAdded = true;
20428
+ } else if (!props.strictSelection) {
20429
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
20430
+ isTagAdded = true;
20431
+ }
20432
+ }
20433
+ if (props.strictSelection && !isTagAdded) {
20434
+ _this.currentValue = value;
20435
+ } else {
20436
+ _this.currentValue = '';
20381
20437
  }
20382
- _this.currentValue = '';
20383
20438
  } else {
20384
20439
  _this.currentValue = decodeHtml(value);
20385
20440
  }
@@ -20392,16 +20447,22 @@
20392
20447
  if (toggleIsOpen) {
20393
20448
  _this.isOpen = false;
20394
20449
  }
20395
- if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
20450
+ if (typeof _this.currentValue === 'string') {
20451
+ if (_this.$options.isTagsMode && props.strictSelection && isTagAdded) {
20452
+ _this.triggerDefaultQuery(_this.currentValue);
20453
+ } else if (!_this.$options.isTagsMode) {
20454
+ _this.triggerDefaultQuery(_this.currentValue);
20455
+ }
20456
+ }
20396
20457
  } // in case of strict selection only SUGGESTION_SELECT should be able
20397
20458
  // to set the query otherwise the value should reset
20398
- if (props.strictSelection) {
20459
+ if (_this.$options.isTagsMode && props.strictSelection && isTagAdded) {
20399
20460
  if (cause === lib_7.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
20400
20461
  _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
20401
- } else {
20462
+ } else if (!props.strictSelection) {
20402
20463
  _this.setValue('', true);
20403
20464
  }
20404
- } else if (props.value === undefined || cause === lib_7.SUGGESTION_SELECT || cause === lib_7.CLEAR_VALUE) {
20465
+ } else if (!_this.$options.isTagsMode && (props.value === undefined || cause === lib_7.SUGGESTION_SELECT || cause === lib_7.CLEAR_VALUE)) {
20405
20466
  _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
20406
20467
  }
20407
20468
  } else {
@@ -20520,6 +20581,7 @@
20520
20581
  this.onValueSelectedHandler('', lib_7.CLEAR_VALUE);
20521
20582
  },
20522
20583
  handleKeyDown: function handleKeyDown(event, highlightedIndex) {
20584
+ var _this2 = this;
20523
20585
  if (highlightedIndex === void 0) {
20524
20586
  highlightedIndex = null;
20525
20587
  }
@@ -20528,7 +20590,11 @@
20528
20590
  if (this.$props.autosuggest === false) {
20529
20591
  this.enterButtonOnClick();
20530
20592
  } else if (highlightedIndex === null) {
20531
- this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? lib_7.SUGGESTION_SELECT : undefined // to handle tags
20593
+ this.isSuggestionSelected = true;
20594
+ setTimeout(function () {
20595
+ _this2.isSuggestionSelected = false;
20596
+ }, 50);
20597
+ this.setValue(event.target.value, true, this.$props, undefined // to handle tags
20532
20598
  );
20533
20599
 
20534
20600
  this.onValueSelectedHandler(event.target.value, lib_7.ENTER_PRESS);
@@ -20540,7 +20606,7 @@
20540
20606
  this.$emit('key-down', event, this.triggerQuery);
20541
20607
  },
20542
20608
  onInputChange: function onInputChange(e) {
20543
- var _this2 = this;
20609
+ var _this3 = this;
20544
20610
  var inputValue = e.target.value;
20545
20611
  if (!this.$data.isOpen && this.$props.autosuggest) {
20546
20612
  this.isOpen = true;
@@ -20551,7 +20617,7 @@
20551
20617
  } else {
20552
20618
  this.$emit('change', inputValue, function (_ref3) {
20553
20619
  var isOpen = _ref3.isOpen;
20554
- return _this2.triggerQuery({
20620
+ return _this3.triggerQuery({
20555
20621
  defaultQuery: true,
20556
20622
  customQuery: true,
20557
20623
  value: inputValue,
@@ -20561,7 +20627,7 @@
20561
20627
  }
20562
20628
  },
20563
20629
  onSuggestionSelected: function onSuggestionSelected(suggestion) {
20564
- var _this3 = this;
20630
+ var _this4 = this;
20565
20631
  this.isOpen = false;
20566
20632
  var value = this.$props.value;
20567
20633
  // Record analytics for selected suggestions
@@ -20582,10 +20648,10 @@
20582
20648
  this.setValue(emitValue, true, this.$props, lib_7.SUGGESTION_SELECT, false, suggestion._category);
20583
20649
  this.$emit('change', emitValue, function (_ref4) {
20584
20650
  var isOpen = _ref4.isOpen;
20585
- return _this3.triggerQuery(_extends({
20651
+ return _this4.triggerQuery(_extends({
20586
20652
  isOpen: isOpen,
20587
20653
  value: emitValue
20588
- }, !_this3.$options.isTagsMode && {
20654
+ }, !_this4.$options.isTagsMode && {
20589
20655
  categoryValue: suggestion._category
20590
20656
  }));
20591
20657
  });
@@ -20700,7 +20766,7 @@
20700
20766
  });
20701
20767
  },
20702
20768
  renderEnterButtonElement: function renderEnterButtonElement() {
20703
- var _this4 = this;
20769
+ var _this5 = this;
20704
20770
  var h = this.$createElement;
20705
20771
  var _this$$props4 = this.$props,
20706
20772
  enterButton = _this$$props4.enterButton,
@@ -20709,7 +20775,7 @@
20709
20775
  if (enterButton) {
20710
20776
  var getEnterButtonMarkup = function getEnterButtonMarkup() {
20711
20777
  if (renderEnterButton) {
20712
- return renderEnterButton(_this4.enterButtonOnClick);
20778
+ return renderEnterButton(_this5.enterButtonOnClick);
20713
20779
  }
20714
20780
  return h(Button, {
20715
20781
  "class": "enter-btn " + getClassName$4(innerClass, 'enter-button'),
@@ -20717,7 +20783,7 @@
20717
20783
  "primary": true
20718
20784
  },
20719
20785
  "on": {
20720
- "click": _this4.enterButtonOnClick
20786
+ "click": _this5.enterButtonOnClick
20721
20787
  }
20722
20788
  }, ["Search"]);
20723
20789
  };
@@ -20784,7 +20850,7 @@
20784
20850
  (_this$$refs = this.$refs) == null || (_this$$refs = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs.focus(); // eslint-disable-line
20785
20851
  },
20786
20852
  listenForFocusShortcuts: function listenForFocusShortcuts() {
20787
- var _this5 = this;
20853
+ var _this6 = this;
20788
20854
  var _this$$props$focusSho = this.$props.focusShortcuts,
20789
20855
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
20790
20856
  if (isEmpty(focusShortcuts)) {
@@ -20799,7 +20865,7 @@
20799
20865
  function (event, handler) {
20800
20866
  // Prevent the default refresh event under WINDOWS system
20801
20867
  event.preventDefault();
20802
- _this5.focusSearchBox(event);
20868
+ _this6.focusSearchBox(event);
20803
20869
  });
20804
20870
 
20805
20871
  // if one of modifier keys are used, they are handled below
@@ -20809,7 +20875,7 @@
20809
20875
  for (var index = 0; index < modifierKeys.length; index += 1) {
20810
20876
  var element = modifierKeys[index];
20811
20877
  if (hotkeys[element]) {
20812
- _this5.focusSearchBox(event);
20878
+ _this6.focusSearchBox(event);
20813
20879
  break;
20814
20880
  }
20815
20881
  }
@@ -20822,11 +20888,11 @@
20822
20888
  this.triggerDefaultQuery(value);
20823
20889
  },
20824
20890
  renderAutoFill: function renderAutoFill(suggestion) {
20825
- var _this6 = this;
20891
+ var _this7 = this;
20826
20892
  var h = this.$createElement;
20827
20893
  var handleAutoFillClick = function handleAutoFillClick(e) {
20828
20894
  e.stopPropagation();
20829
- _this6.onAutofillClick(suggestion);
20895
+ _this7.onAutofillClick(suggestion);
20830
20896
  };
20831
20897
  /* 👇 avoid showing autofill for category suggestions👇 */
20832
20898
  return suggestion._category ? null : h(AutoFillSvg, {
@@ -20836,7 +20902,7 @@
20836
20902
  });
20837
20903
  },
20838
20904
  renderTag: function renderTag(item) {
20839
- var _this7 = this;
20905
+ var _this8 = this;
20840
20906
  var h = this.$createElement;
20841
20907
  var innerClass = this.$props.innerClass;
20842
20908
  return h(TagItem, {
@@ -20849,7 +20915,7 @@
20849
20915
  "class": "close-icon",
20850
20916
  "on": {
20851
20917
  "click": function click() {
20852
- return _this7.clearTag(item);
20918
+ return _this8.clearTag(item);
20853
20919
  }
20854
20920
  }
20855
20921
  }, [h(CancelSvg)])]);
@@ -20871,7 +20937,7 @@
20871
20937
  }
20872
20938
  },
20873
20939
  renderTags: function renderTags() {
20874
- var _this8 = this;
20940
+ var _this9 = this;
20875
20941
  var h = this.$createElement;
20876
20942
  if (!Array.isArray(this.selectedTags)) {
20877
20943
  return null;
@@ -20884,7 +20950,7 @@
20884
20950
  handleClear: this.clearTag,
20885
20951
  handleClearAll: this.clearAllTags
20886
20952
  }) : h(TagsContainer, [tagsList.map(function (item) {
20887
- return _this8.renderTag(item);
20953
+ return _this9.renderTag(item);
20888
20954
  }), shouldRenderClearAllTag && h(TagItem, {
20889
20955
  "class": getClassName$4(this.$props.innerClass, 'selected-tag') || ''
20890
20956
  }, [h("span", ["Clear All"]), h("span", {
@@ -20900,7 +20966,7 @@
20900
20966
  }
20901
20967
  },
20902
20968
  render: function render() {
20903
- var _this9 = this;
20969
+ var _this10 = this;
20904
20970
  var h = arguments[0];
20905
20971
  var _this$$props6 = this.$props,
20906
20972
  theme = _this$$props6.theme,
@@ -20941,14 +21007,14 @@
20941
21007
  return null;
20942
21008
  }
20943
21009
  };
20944
- return h("div", [_this9.hasCustomRenderer && _this9.getComponent({
21010
+ return h("div", [_this10.hasCustomRenderer && _this10.getComponent({
20945
21011
  isOpen: isOpen,
20946
21012
  getItemProps: getItemProps,
20947
21013
  getItemEvents: getItemEvents,
20948
21014
  highlightedIndex: highlightedIndex
20949
- }), _this9.renderErrorComponent(), !_this9.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
20950
- "class": suggestions$1(_this9.themePreset, theme) + " " + getClassName$4(_this9.$props.innerClass, 'list')
20951
- }, [_this9.normalizedSuggestions.map(function (item, index) {
21015
+ }), _this10.renderErrorComponent(), !_this10.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
21016
+ "class": suggestions$1(_this10.themePreset, theme) + " " + getClassName$4(_this10.$props.innerClass, 'list')
21017
+ }, [_this10.normalizedSuggestions.map(function (item, index) {
20952
21018
  return renderItem ? h("li", {
20953
21019
  "domProps": _extends({}, getItemProps({
20954
21020
  item: item
@@ -20958,7 +21024,7 @@
20958
21024
  })),
20959
21025
  "key": index + 1 + "-" + item.value,
20960
21026
  "style": {
20961
- backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
21027
+ backgroundColor: _this10.getBackgroundColor(highlightedIndex, index),
20962
21028
  justifyContent: 'flex-start',
20963
21029
  alignItems: 'center'
20964
21030
  }
@@ -20971,7 +21037,7 @@
20971
21037
  })),
20972
21038
  "key": index + 1 + "-" + item.value,
20973
21039
  "style": {
20974
- backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
21040
+ backgroundColor: _this10.getBackgroundColor(highlightedIndex, index),
20975
21041
  justifyContent: 'flex-start',
20976
21042
  alignItems: 'center'
20977
21043
  }
@@ -20982,58 +21048,58 @@
20982
21048
  }
20983
21049
  }, [h(CustomSvg, {
20984
21050
  "attrs": {
20985
- "className": getClassName$4(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
21051
+ "className": getClassName$4(_this10.$props.innerClass, item._suggestion_type + "-search-icon") || null,
20986
21052
  "icon": getIcon(item._suggestion_type),
20987
21053
  "type": item._suggestion_type + "-search-icon"
20988
21054
  }
20989
21055
  })]), h(SuggestionItem, {
20990
21056
  "attrs": {
20991
- "currentValue": _this9.currentValue,
21057
+ "currentValue": _this10.currentValue,
20992
21058
  "suggestion": item
20993
21059
  }
20994
- }), _this9.renderAutoFill(item)]);
20995
- })]) : _this9.renderNoSuggestions(_this9.normalizedSuggestions)]);
21060
+ }), _this10.renderAutoFill(item)]);
21061
+ })]) : _this10.renderNoSuggestions(_this10.normalizedSuggestions)]);
20996
21062
  };
20997
21063
  return h("div", {
20998
21064
  "class": suggestionsContainer
20999
- }, [h(InputGroup, [_this9.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21065
+ }, [h(InputGroup, [_this10.renderInputAddonBefore(), h(InputWrapper, [h(Input, {
21000
21066
  "attrs": {
21001
- "id": _this9.$props.componentId + "-input",
21002
- "showIcon": _this9.$props.showIcon,
21003
- "showClear": _this9.$props.showClear,
21004
- "iconPosition": _this9.$props.iconPosition,
21005
- "placeholder": _this9.$props.placeholder,
21006
- "autoFocus": _this9.$props.autoFocus,
21007
- "themePreset": _this9.themePreset,
21067
+ "id": _this10.$props.componentId + "-input",
21068
+ "showIcon": _this10.$props.showIcon,
21069
+ "showClear": _this10.$props.showClear,
21070
+ "iconPosition": _this10.$props.iconPosition,
21071
+ "placeholder": _this10.$props.placeholder,
21072
+ "autoFocus": _this10.$props.autoFocus,
21073
+ "themePreset": _this10.themePreset,
21008
21074
  "autocomplete": "off"
21009
21075
  },
21010
- "ref": _this9.$props.innerRef,
21011
- "class": getClassName$4(_this9.$props.innerClass, 'input'),
21076
+ "ref": _this10.$props.innerRef,
21077
+ "class": getClassName$4(_this10.$props.innerClass, 'input'),
21012
21078
  "on": _extends({}, getInputEvents({
21013
- onInput: _this9.onInputChange,
21079
+ onInput: _this10.onInputChange,
21014
21080
  onBlur: function onBlur(e) {
21015
- _this9.$emit('blur', e, _this9.triggerQuery);
21081
+ _this10.$emit('blur', e, _this10.triggerQuery);
21016
21082
  },
21017
- onFocus: _this9.handleFocus,
21083
+ onFocus: _this10.handleFocus,
21018
21084
  onKeyPress: function onKeyPress(e) {
21019
- _this9.$emit('keyPress', e, _this9.triggerQuery);
21020
- _this9.$emit('key-press', e, _this9.triggerQuery);
21085
+ _this10.$emit('keyPress', e, _this10.triggerQuery);
21086
+ _this10.$emit('key-press', e, _this10.triggerQuery);
21021
21087
  },
21022
21088
  onKeyDown: function onKeyDown(e) {
21023
- return _this9.handleKeyDown(e, highlightedIndex);
21089
+ return _this10.handleKeyDown(e, highlightedIndex);
21024
21090
  },
21025
21091
  onKeyUp: function onKeyUp(e) {
21026
- _this9.$emit('keyUp', e, _this9.triggerQuery);
21027
- _this9.$emit('key-up', e, _this9.triggerQuery);
21092
+ _this10.$emit('keyUp', e, _this10.triggerQuery);
21093
+ _this10.$emit('key-up', e, _this10.triggerQuery);
21028
21094
  },
21029
21095
  onClick: function onClick() {
21030
21096
  setHighlightedIndex(null);
21031
21097
  }
21032
21098
  })),
21033
21099
  "domProps": _extends({}, getInputProps({
21034
- value: _this9.$data.currentValue === null ? '' : _this9.$data.currentValue
21100
+ value: _this10.$data.currentValue === null ? '' : _this10.$data.currentValue
21035
21101
  }))
21036
- }), _this9.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this9.renderInputAddonAfter(), _this9.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this9.renderTags()]);
21102
+ }), _this10.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this10.renderInputAddonAfter(), _this10.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this10.renderTags()]);
21037
21103
  }
21038
21104
  }
21039
21105
  }) : h("div", {
@@ -21049,20 +21115,20 @@
21049
21115
  },
21050
21116
  "on": _extends({}, {
21051
21117
  blur: function blur(e) {
21052
- _this9.$emit('blur', e, _this9.triggerQuery);
21118
+ _this10.$emit('blur', e, _this10.triggerQuery);
21053
21119
  },
21054
21120
  keypress: function keypress(e) {
21055
- _this9.$emit('keyPress', e, _this9.triggerQuery);
21056
- _this9.$emit('key-press', e, _this9.triggerQuery);
21121
+ _this10.$emit('keyPress', e, _this10.triggerQuery);
21122
+ _this10.$emit('key-press', e, _this10.triggerQuery);
21057
21123
  },
21058
21124
  input: this.onInputChange,
21059
21125
  focus: function focus(e) {
21060
- _this9.$emit('focus', e, _this9.triggerQuery);
21126
+ _this10.$emit('focus', e, _this10.triggerQuery);
21061
21127
  },
21062
21128
  keydown: this.handleKeyDown,
21063
21129
  keyup: function keyup(e) {
21064
- _this9.$emit('keyUp', e, _this9.triggerQuery);
21065
- _this9.$emit('key-up', e, _this9.triggerQuery);
21130
+ _this10.$emit('keyUp', e, _this10.triggerQuery);
21131
+ _this10.$emit('key-up', e, _this10.triggerQuery);
21066
21132
  }
21067
21133
  }),
21068
21134
  "domProps": _extends({}, {
@@ -34923,7 +34989,7 @@
34923
34989
  });
34924
34990
  }
34925
34991
 
34926
- var version = "1.35.2";
34992
+ var version = "1.35.3";
34927
34993
 
34928
34994
  var components$1 = [RLConnected, ResultCard, ResultList, ReactiveBase, DSConnected, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
34929
34995
  function install (Vue) {