@appbaseio/reactivesearch-vue 3.0.0-rc.13 → 3.0.0-rc.14

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.
@@ -6026,7 +6026,7 @@
6026
6026
  },
6027
6027
  $ = {
6028
6028
  YY: String(this.$y).slice(-2),
6029
- YYYY: this.$y,
6029
+ YYYY: O.s(this.$y, 4, "0"),
6030
6030
  M: a + 1,
6031
6031
  MM: O.s(a + 1, 2, "0"),
6032
6032
  MMM: h(n.monthsShort, a, f, 3),
@@ -9073,7 +9073,7 @@
9073
9073
  var transformOn = function transformOn(obj) {
9074
9074
  var result = {};
9075
9075
  Object.keys(obj).forEach(function (evt) {
9076
- result["on" + evt[0].toUpperCase() + evt.substr(1)] = obj[evt];
9076
+ result["on" + evt[0].toUpperCase() + evt.slice(1)] = obj[evt];
9077
9077
  });
9078
9078
  return result;
9079
9079
  };
@@ -9671,7 +9671,7 @@
9671
9671
  }).join(" or ")) : i = "Array" === (o = d(r)) ? m(t) : "Object" === o ? y(t) : "String" === o || "Number" === o || "Boolean" === o || "Function" === o ? function (e) {
9672
9672
  if (null == e) return "";
9673
9673
  var t = e.constructor.toString().match(v);
9674
- return t ? t[1] : "";
9674
+ return t ? t[1].replace(/^Async/, "") : "";
9675
9675
  }(t) === o : t instanceof r.type;
9676
9676
  }
9677
9677
  if (!i) {
@@ -9741,10 +9741,10 @@
9741
9741
  }
9742
9742
  return Object.assign(o, s);
9743
9743
  }
9744
- function E(e) {
9744
+ function A(e) {
9745
9745
  return e.replace(/^(?!\s*$)/gm, " ");
9746
9746
  }
9747
- var A = function A() {
9747
+ var E = function E() {
9748
9748
  return x("any", {});
9749
9749
  },
9750
9750
  N = function N() {
@@ -9870,7 +9870,7 @@
9870
9870
  var r = P(e, t, !0);
9871
9871
  return "string" == typeof r && n.push(r), !0 === r;
9872
9872
  });
9873
- return r || h("oneOfType - provided value does not match any of the " + n.length + " passed-in validators:\n" + E(n.join("\n"))), r;
9873
+ return r || h("oneOfType - provided value does not match any of the " + n.length + " passed-in validators:\n" + A(n.join("\n"))), r;
9874
9874
  }
9875
9875
  } : {
9876
9876
  type: u
@@ -9884,7 +9884,7 @@
9884
9884
  r = t.every(function (t) {
9885
9885
  return !0 === (n = P(e, t, !0));
9886
9886
  });
9887
- return r || h("arrayOf - value validation error:\n" + E(n)), r;
9887
+ return r || h("arrayOf - value validation error:\n" + A(n)), r;
9888
9888
  }
9889
9889
  });
9890
9890
  }
@@ -9901,7 +9901,7 @@
9901
9901
  r = Object.keys(t).every(function (r) {
9902
9902
  return !0 === (n = P(e, t[r], !0));
9903
9903
  });
9904
- return r || h("objectOf - value validation error:\n" + E(n)), r;
9904
+ return r || h("objectOf - value validation error:\n" + A(n)), r;
9905
9905
  }
9906
9906
  });
9907
9907
  }
@@ -9928,7 +9928,7 @@
9928
9928
  return o.every(function (n) {
9929
9929
  if (-1 === t.indexOf(n)) return !0 === i._vueTypes_isLoose || (h('shape - shape definition does not include a "' + n + '" property. Allowed keys: "' + t.join('", "') + '".'), !1);
9930
9930
  var o = P(e[n], r[n], !0);
9931
- return "string" == typeof o && h('shape - "' + n + '" property validation error:\n ' + E(o)), !0 === o;
9931
+ return "string" == typeof o && h('shape - "' + n + '" property validation error:\n ' + A(o)), !0 === o;
9932
9932
  });
9933
9933
  }
9934
9934
  });
@@ -9988,7 +9988,7 @@
9988
9988
  }, n(e, null, [{
9989
9989
  key: "any",
9990
9990
  get: function get() {
9991
- return A();
9991
+ return E();
9992
9992
  }
9993
9993
  }, {
9994
9994
  key: "func",
@@ -17629,7 +17629,7 @@
17629
17629
  };
17630
17630
 
17631
17631
  /**!
17632
- * hotkeys-js v3.10.2
17632
+ * hotkeys-js v3.10.3
17633
17633
  * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
17634
17634
  *
17635
17635
  * Copyright (c) 2023 kenny wong <wowohoo@qq.com>
@@ -18045,7 +18045,7 @@
18045
18045
  if (!(key in _handlers)) return;
18046
18046
  for (var _i = 0; _i < _handlers[key].length; _i++) {
18047
18047
  if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
18048
- if (_handlers[key][_i].key) {
18048
+ if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
18049
18049
  var record = _handlers[key][_i];
18050
18050
  var splitKey = record.splitKey;
18051
18051
  var keyShortcut = record.key.split(splitKey);
@@ -18054,7 +18054,7 @@
18054
18054
  for (var a = 0; a < keyShortcut.length; a++) {
18055
18055
  _downKeysCurrent.push(code(keyShortcut[a]));
18056
18056
  }
18057
- if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
18057
+ if (_downKeysCurrent.sort().join('') === _downKeys.slice().sort().join('')) {
18058
18058
  // 找到处理内容
18059
18059
  eventHandler(event, record, scope, element);
18060
18060
  }
@@ -26670,6 +26670,7 @@
26670
26670
  selectedTags: [],
26671
26671
  isOpen: false,
26672
26672
  normalizedSuggestions: [],
26673
+ parsedSuggestions: [],
26673
26674
  showAIScreen: false,
26674
26675
  showAIScreenFooter: false,
26675
26676
  showFeedbackComponent: false,
@@ -26714,34 +26715,6 @@
26714
26715
  },
26715
26716
  stats: function stats() {
26716
26717
  return getResultStats$1(this);
26717
- },
26718
- parsedSuggestions: function parsedSuggestions() {
26719
- var suggestionsArray = [];
26720
- if (Array.isArray(this.suggestions) && this.suggestions.length) {
26721
- suggestionsArray = [].concat(withClickIds(this.suggestions));
26722
- }
26723
- suggestionsArray = suggestionsArray.map(function (s) {
26724
- if (s.sectionId) {
26725
- return s;
26726
- }
26727
- return _extends({}, s, {
26728
- sectionId: s._suggestion_type
26729
- });
26730
- });
26731
- var sectionsAccumulated = [];
26732
- var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
26733
- if (sectionsAccumulated.includes(d.sectionId)) return acc;
26734
- if (d.sectionId) {
26735
- acc[currentIndex] = suggestionsArray.filter(function (g) {
26736
- return g.sectionId === d.sectionId;
26737
- });
26738
- sectionsAccumulated.push(d.sectionId);
26739
- } else {
26740
- acc[currentIndex] = d;
26741
- }
26742
- return acc;
26743
- }, {});
26744
- return Object.values(sectionisedSuggestions);
26745
26718
  }
26746
26719
  },
26747
26720
  props: {
@@ -26880,6 +26853,28 @@
26880
26853
  suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
26881
26854
  }
26882
26855
  this.normalizedSuggestions = suggestionsList;
26856
+ suggestionsList = suggestionsList.map(function (s) {
26857
+ if (s.sectionId) {
26858
+ return s;
26859
+ }
26860
+ return _extends({}, s, {
26861
+ sectionId: s._suggestion_type
26862
+ });
26863
+ });
26864
+ var sectionsAccumulated = [];
26865
+ var sectionisedSuggestions = suggestionsList.reduce(function (acc, d, currentIndex) {
26866
+ if (sectionsAccumulated.includes(d.sectionId)) return acc;
26867
+ if (d.sectionId) {
26868
+ acc[currentIndex] = suggestionsList.filter(function (g) {
26869
+ return g.sectionId === d.sectionId;
26870
+ });
26871
+ sectionsAccumulated.push(d.sectionId);
26872
+ } else {
26873
+ acc[currentIndex] = d;
26874
+ }
26875
+ return acc;
26876
+ }, {});
26877
+ this.parsedSuggestions = Object.values(sectionisedSuggestions);
26883
26878
  this.handleTextAreaHeightChange();
26884
26879
  },
26885
26880
  selectedValue: function selectedValue(newVal, oldVal) {
@@ -26896,7 +26891,11 @@
26896
26891
  if (this.$options.isTagsMode) {
26897
26892
  cause = lib_7.SUGGESTION_SELECT;
26898
26893
  }
26899
- this.setValue(newVal || '', true, this.$props, cause);
26894
+ if (this.$props.value === undefined) {
26895
+ this.setValue(newVal, newVal === '', this.$props, cause, false);
26896
+ } else {
26897
+ this.setValue(newVal || '', true, this.$props, cause);
26898
+ }
26900
26899
  }
26901
26900
  },
26902
26901
  focusShortcuts: function focusShortcuts() {
@@ -27179,7 +27178,9 @@
27179
27178
  handleVoiceResults: function handleVoiceResults(_ref) {
27180
27179
  var results = _ref.results;
27181
27180
  if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
27181
+ var _this$$refs2, _this$$refs2$this$$pr, _this$$refs2$this$$pr2;
27182
27182
  this.setValue(results[0][0].transcript.trim(), true);
27183
+ (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : (_this$$refs2$this$$pr2 = _this$$refs2$this$$pr.$el) == null ? void 0 : _this$$refs2$this$$pr2.focus(); // eslint-disable-line
27183
27184
  }
27184
27185
  },
27185
27186
  triggerQuery: function triggerQuery(_ref2) {
@@ -27219,6 +27220,8 @@
27219
27220
  clearValue: function clearValue() {
27220
27221
  this.setValue('', false, this.$props, !this.$options.isTagsMode ? lib_7.CLEAR_VALUE : undefined, false);
27221
27222
  this.onValueSelectedHandler('', !this.$options.isTagsMode ? lib_7.CLEAR_VALUE : undefined);
27223
+ this.showAIScreen = false;
27224
+ this.isOpen = false;
27222
27225
  },
27223
27226
  handleKeyDown: function handleKeyDown(event, highlightedIndex) {
27224
27227
  if (highlightedIndex === void 0) {
@@ -27254,7 +27257,7 @@
27254
27257
  }
27255
27258
  var value = this.$props.value;
27256
27259
  if (value === undefined) {
27257
- this.setValue(inputValue, false, this.$props, undefined);
27260
+ this.setValue(inputValue, inputValue === '', this.$props, undefined, false);
27258
27261
  } else {
27259
27262
  this.$emit('change', inputValue, function (_ref3) {
27260
27263
  var isOpen = _ref3.isOpen;
@@ -27269,7 +27272,7 @@
27269
27272
  },
27270
27273
  handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
27271
27274
  try {
27272
- var _this$$refs2, _this$$refs2$this$$pr;
27275
+ var _this$$refs3, _this$$refs3$this$$pr, _this$$refs3$this$$pr2;
27273
27276
  if (suggestion.action === helper_15.NAVIGATE) {
27274
27277
  var _JSON$parse = JSON.parse(suggestion.subAction),
27275
27278
  _JSON$parse$target = _JSON$parse.target,
@@ -27288,7 +27291,7 @@
27288
27291
  func(suggestion, this.$data.currentValue, this.$props.customEvents);
27289
27292
  }
27290
27293
  if (suggestion.action === helper_15.SELECT) {
27291
- this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? lib_7.SUGGESTION_SELECT : lib_7.ENTER_PRESS);
27294
+ this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? lib_7.SUGGESTION_SELECT : lib_7.ENTER_PRESS, false);
27292
27295
  this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT);
27293
27296
  }
27294
27297
  // blur is important to close the dropdown
@@ -27296,7 +27299,7 @@
27296
27299
  // else Downshift probably is focusing the dropdown
27297
27300
  // and not letting it close
27298
27301
  // eslint-disable-next-line no-unused-expressions
27299
- (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
27302
+ (_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$this$$pr = _this$$refs3[this.$props.innerRef]) == null ? void 0 : (_this$$refs3$this$$pr2 = _this$$refs3$this$$pr.$el) == null ? void 0 : _this$$refs3$this$$pr2.blur();
27300
27303
  } catch (e) {
27301
27304
  console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
27302
27305
  }
@@ -27583,14 +27586,14 @@
27583
27586
  })]);
27584
27587
  },
27585
27588
  focusSearchBox: function focusSearchBox(event) {
27586
- var _this$$refs3, _this$$refs3$this$$pr, _this$$refs3$this$$pr2;
27589
+ var _this$$refs4, _this$$refs4$this$$pr, _this$$refs4$this$$pr2;
27587
27590
  var elt = event.target || event.srcElement;
27588
27591
  var tagName = elt.tagName;
27589
27592
  if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
27590
27593
  // already in an input
27591
27594
  return;
27592
27595
  }
27593
- (_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$this$$pr = _this$$refs3[this.$props.innerRef]) == null ? void 0 : (_this$$refs3$this$$pr2 = _this$$refs3$this$$pr.$el) == null ? void 0 : _this$$refs3$this$$pr2.focus(); // eslint-disable-line
27596
+ (_this$$refs4 = this.$refs) == null ? void 0 : (_this$$refs4$this$$pr = _this$$refs4[this.$props.innerRef]) == null ? void 0 : (_this$$refs4$this$$pr2 = _this$$refs4$this$$pr.$el) == null ? void 0 : _this$$refs4$this$$pr2.focus(); // eslint-disable-line
27594
27597
  },
27595
27598
  listenForFocusShortcuts: function listenForFocusShortcuts() {
27596
27599
  var _this9 = this;
@@ -28023,7 +28026,7 @@
28023
28026
  }), babelHelperVueTransformOn(getItemEvents({
28024
28027
  item: sectionItem
28025
28028
  })), {
28026
- "key": index + sectionIndex,
28029
+ "key": sectionItem._id + "_" + index + "_" + sectionIndex,
28027
28030
  "style": {
28028
28031
  justifyContent: 'flex-start',
28029
28032
  alignItems: 'center'
@@ -31559,7 +31562,7 @@
31559
31562
  }), _this4.renderSearch(), _this4.hasCustomRenderer ? _this4.getComponent() : vue.createVNode(HierarchicalMenuComponent, {
31560
31563
  "key": "initial-node",
31561
31564
  "listArray": transformedData,
31562
- "parentPath": "",
31565
+ "parentPath": true,
31563
31566
  "isExpanded": true,
31564
31567
  "listItemProps": {
31565
31568
  mode: mode,
@@ -38839,6 +38842,9 @@
38839
38842
  */
38840
38843
  var MarkerUtils = /*#__PURE__*/function () {
38841
38844
  function MarkerUtils() {}
38845
+ MarkerUtils.isAdvancedMarkerAvailable = function isAdvancedMarkerAvailable(map) {
38846
+ return google.maps.marker && map.getMapCapabilities().isAdvancedMarkersAvailable === true;
38847
+ };
38842
38848
  MarkerUtils.isAdvancedMarker = function isAdvancedMarker(marker) {
38843
38849
  return google.maps.marker && marker instanceof google.maps.marker.AdvancedMarkerElement;
38844
38850
  };
@@ -39043,13 +39049,13 @@
39043
39049
  _this4 = _AbstractAlgorithm3.call(this, {
39044
39050
  maxZoom: maxZoom
39045
39051
  }) || this;
39052
+ _this4.state = {
39053
+ zoom: -1
39054
+ };
39046
39055
  _this4.superCluster = new Supercluster(Object.assign({
39047
39056
  maxZoom: _this4.maxZoom,
39048
39057
  radius: radius
39049
39058
  }, options));
39050
- _this4.state = {
39051
- zoom: null
39052
- };
39053
39059
  return _this4;
39054
39060
  }
39055
39061
  var _proto6 = SuperClusterAlgorithm.prototype;
@@ -39207,34 +39213,23 @@
39207
39213
  position = _ref12.position;
39208
39214
  // change color if this cluster has more markers than the mean cluster
39209
39215
  var color = count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff";
39210
- // create svg url with fill color
39211
- var svg = "<svg fill=\"" + color + "\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\">\n <circle cx=\"120\" cy=\"120\" opacity=\".6\" r=\"70\" />\n <circle cx=\"120\" cy=\"120\" opacity=\".3\" r=\"90\" />\n <circle cx=\"120\" cy=\"120\" opacity=\".2\" r=\"110\" />\n </svg>";
39216
+ // create svg literal with fill color
39217
+ var svg = "<svg fill=\"" + color + "\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 240\" width=\"50\" height=\"50\">\n<circle cx=\"120\" cy=\"120\" opacity=\".6\" r=\"70\" />\n<circle cx=\"120\" cy=\"120\" opacity=\".3\" r=\"90\" />\n<circle cx=\"120\" cy=\"120\" opacity=\".2\" r=\"110\" />\n<text x=\"50%\" y=\"50%\" style=\"fill:#fff\" text-anchor=\"middle\" font-size=\"50\" dominant-baseline=\"middle\" font-family=\"roboto,arial,sans-serif\">" + count + "</text>\n</svg>";
39212
39218
  var title = "Cluster of " + count + " markers",
39213
39219
  // adjust zIndex to be above other markers
39214
39220
  zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count;
39215
- if (google.maps.marker && map.getMapCapabilities().isAdvancedMarkersAvailable) {
39221
+ if (MarkerUtils.isAdvancedMarkerAvailable(map)) {
39216
39222
  // create cluster SVG element
39217
39223
  var div = document.createElement("div");
39218
39224
  div.innerHTML = svg;
39219
39225
  var svgEl = div.firstElementChild;
39220
- svgEl.setAttribute("width", "50");
39221
- svgEl.setAttribute("height", "50");
39222
- // create and append marker label to SVG
39223
- var label = document.createElementNS("http://www.w3.org/2000/svg", "text");
39224
- label.setAttribute("x", "50%");
39225
- label.setAttribute("y", "50%");
39226
- label.setAttribute("style", "fill: #FFF");
39227
- label.setAttribute("text-anchor", "middle");
39228
- label.setAttribute("font-size", "50");
39229
- label.setAttribute("dominant-baseline", "middle");
39230
- label.appendChild(document.createTextNode("" + count));
39231
- svgEl.appendChild(label);
39226
+ svgEl.setAttribute("transform", "translate(0 25)");
39232
39227
  var _clusterOptions = {
39233
39228
  map: map,
39234
39229
  position: position,
39235
39230
  zIndex: zIndex,
39236
39231
  title: title,
39237
- content: div.firstElementChild
39232
+ content: svgEl
39238
39233
  };
39239
39234
  return new google.maps.marker.AdvancedMarkerElement(_clusterOptions);
39240
39235
  }
@@ -39243,13 +39238,8 @@
39243
39238
  zIndex: zIndex,
39244
39239
  title: title,
39245
39240
  icon: {
39246
- url: "data:image/svg+xml;base64," + window.btoa(svg),
39247
- scaledSize: new google.maps.Size(45, 45)
39248
- },
39249
- label: {
39250
- text: String(count),
39251
- color: "rgba(255,255,255,0.9)",
39252
- fontSize: "12px"
39241
+ url: "data:image/svg+xml;base64," + btoa(svg),
39242
+ anchor: new google.maps.Point(25, 25)
39253
39243
  }
39254
39244
  };
39255
39245
  return new google.maps.Marker(clusterOptions);
@@ -43700,7 +43690,7 @@
43700
43690
  }, queryString, renderFunction);
43701
43691
  }
43702
43692
 
43703
- var version = "3.0.0-rc.13";
43693
+ var version = "3.0.0-rc.14";
43704
43694
 
43705
43695
  var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected, AIConnected];
43706
43696
  function install$1 (Vue) {