instantsearch.js 4.57.0 → 4.59.0

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.
Files changed (40) hide show
  1. package/README.md +1 -2
  2. package/cjs/components/Pagination/Pagination.js +4 -4
  3. package/cjs/components/RefinementList/RefinementList.js +2 -1
  4. package/cjs/components/SearchBox/SearchBox.js +5 -2
  5. package/cjs/components/Selector/Selector.js +4 -2
  6. package/cjs/components/Slider/Slider.js +3 -1
  7. package/cjs/lib/InstantSearch.js +44 -7
  8. package/cjs/lib/utils/createSendEventForFacet.js +12 -5
  9. package/cjs/lib/utils/createSendEventForHits.js +12 -6
  10. package/cjs/lib/version.js +1 -1
  11. package/cjs/middlewares/createInsightsMiddleware.js +16 -5
  12. package/cjs/widgets/index/index.js +16 -7
  13. package/cjs/widgets/sort-by/sort-by.js +2 -1
  14. package/dist/instantsearch.development.d.ts +17 -3
  15. package/dist/instantsearch.development.js +125 -56
  16. package/dist/instantsearch.development.js.map +1 -1
  17. package/dist/instantsearch.production.d.ts +17 -3
  18. package/dist/instantsearch.production.min.d.ts +17 -3
  19. package/dist/instantsearch.production.min.js +2 -2
  20. package/dist/instantsearch.production.min.js.map +1 -1
  21. package/es/components/InternalHighlight/InternalHighlight.d.ts +1 -1
  22. package/es/components/Pagination/Pagination.js +4 -4
  23. package/es/components/RefinementList/RefinementList.js +2 -1
  24. package/es/components/SearchBox/SearchBox.d.ts +3 -0
  25. package/es/components/SearchBox/SearchBox.js +5 -2
  26. package/es/components/Selector/Selector.d.ts +2 -1
  27. package/es/components/Selector/Selector.js +4 -2
  28. package/es/components/Slider/Slider.js +3 -1
  29. package/es/lib/InstantSearch.d.ts +15 -0
  30. package/es/lib/InstantSearch.js +42 -6
  31. package/es/lib/utils/createSendEventForFacet.d.ts +1 -1
  32. package/es/lib/utils/createSendEventForFacet.js +12 -5
  33. package/es/lib/utils/createSendEventForHits.d.ts +2 -2
  34. package/es/lib/utils/createSendEventForHits.js +12 -6
  35. package/es/lib/version.d.ts +1 -1
  36. package/es/lib/version.js +1 -1
  37. package/es/middlewares/createInsightsMiddleware.js +16 -5
  38. package/es/widgets/index/index.js +16 -7
  39. package/es/widgets/sort-by/sort-by.js +2 -1
  40. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.57.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! InstantSearch.js 4.59.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -752,7 +752,9 @@
752
752
  }
753
753
  var facetValue = args[1],
754
754
  _args$ = args[2],
755
- eventName = _args$ === void 0 ? 'Filter Applied' : _args$;
755
+ eventName = _args$ === void 0 ? 'Filter Applied' : _args$,
756
+ _args$2 = args[3],
757
+ additionalData = _args$2 === void 0 ? {} : _args$2;
756
758
  var _args$0$split = args[0].split(':'),
757
759
  _args$0$split2 = _slicedToArray(_args$0$split, 2),
758
760
  eventType = _args$0$split2[0],
@@ -760,7 +762,7 @@
760
762
  var attribute = typeof attr === 'string' ? attr : attr(facetValue);
761
763
  if (args.length === 1 && _typeof(args[0]) === 'object') {
762
764
  instantSearchInstance.sendEventToInsights(args[0]);
763
- } else if (eventType === 'click' && (args.length === 2 || args.length === 3)) {
765
+ } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {
764
766
  if (!isFacetRefined(helper, attribute, facetValue)) {
765
767
  // send event only when the facet is being checked "ON"
766
768
  instantSearchInstance.sendEventToInsights({
@@ -768,16 +770,16 @@
768
770
  widgetType: widgetType,
769
771
  eventType: eventType,
770
772
  eventModifier: eventModifier,
771
- payload: {
773
+ payload: _objectSpread2({
772
774
  eventName: eventName,
773
775
  index: helper.getIndex(),
774
776
  filters: ["".concat(attribute, ":").concat(facetValue)]
775
- },
777
+ }, additionalData),
776
778
  attribute: attribute
777
779
  });
778
780
  }
779
781
  } else {
780
- throw new Error("You need to pass two arguments like:\n sendEvent('click', facetValue);\n\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\n");
782
+ throw new Error("You need to pass between two and four arguments like:\n sendEvent('click', facetValue, eventName?, additionalData?);\n\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\n");
781
783
  }
782
784
  };
783
785
  return sendEventForFacet;
@@ -814,6 +816,7 @@
814
816
  eventModifier = _args$0$split2[1];
815
817
  var hits = args[1];
816
818
  var eventName = args[2];
819
+ var additionalData = args[3] || {};
817
820
  if (!hits) {
818
821
  {
819
822
  throw new Error("You need to pass hit or hits as the second argument like:\n ".concat(methodName, "(eventType, hit);\n "));
@@ -849,11 +852,11 @@
849
852
  insightsMethod: 'viewedObjectIDs',
850
853
  widgetType: widgetType,
851
854
  eventType: eventType,
852
- payload: {
855
+ payload: _objectSpread2({
853
856
  eventName: eventName || 'Hits Viewed',
854
857
  index: index,
855
858
  objectIDs: objectIDsByChunk[i]
856
- },
859
+ }, additionalData),
857
860
  hits: batch,
858
861
  eventModifier: eventModifier
859
862
  };
@@ -864,13 +867,13 @@
864
867
  insightsMethod: 'clickedObjectIDsAfterSearch',
865
868
  widgetType: widgetType,
866
869
  eventType: eventType,
867
- payload: {
870
+ payload: _objectSpread2({
868
871
  eventName: eventName || 'Hit Clicked',
869
872
  index: index,
870
873
  queryID: queryID,
871
874
  objectIDs: objectIDsByChunk[i],
872
875
  positions: positionsByChunk[i]
873
- },
876
+ }, additionalData),
874
877
  hits: batch,
875
878
  eventModifier: eventModifier
876
879
  };
@@ -881,12 +884,12 @@
881
884
  insightsMethod: 'convertedObjectIDsAfterSearch',
882
885
  widgetType: widgetType,
883
886
  eventType: eventType,
884
- payload: {
887
+ payload: _objectSpread2({
885
888
  eventName: eventName || 'Hit Converted',
886
889
  index: index,
887
890
  queryID: queryID,
888
891
  objectIDs: objectIDsByChunk[i]
889
- },
892
+ }, additionalData),
890
893
  hits: batch,
891
894
  eventModifier: eventModifier
892
895
  };
@@ -9911,7 +9914,7 @@
9911
9914
 
9912
9915
  var SearchResults_1 = SearchResults;
9913
9916
 
9914
- var version = '3.14.2';
9917
+ var version = '3.15.0';
9915
9918
 
9916
9919
  var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
9917
9920
 
@@ -12554,7 +12557,9 @@
12554
12557
  insightsInitParams = props.insightsInitParams,
12555
12558
  onEvent = props.onEvent,
12556
12559
  _props$$$internal = props.$$internal,
12557
- $$internal = _props$$$internal === void 0 ? false : _props$$$internal;
12560
+ $$internal = _props$$$internal === void 0 ? false : _props$$$internal,
12561
+ _props$$$automatic = props.$$automatic,
12562
+ $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;
12558
12563
  var potentialInsightsClient = _insightsClient;
12559
12564
  if (!_insightsClient && _insightsClient !== null) {
12560
12565
  safelyRunOnBrowser(function (_ref) {
@@ -12645,6 +12650,7 @@
12645
12650
  return {
12646
12651
  $$type: 'ais.insights',
12647
12652
  $$internal: $$internal,
12653
+ $$automatic: $$automatic,
12648
12654
  onStateChange: function onStateChange() {},
12649
12655
  subscribe: function subscribe() {
12650
12656
  if (!insightsClient.shouldAddScript) return;
@@ -12665,14 +12671,19 @@
12665
12671
  },
12666
12672
  started: function started() {
12667
12673
  insightsClient('addAlgoliaAgent', 'insights-middleware');
12668
- helper = instantSearchInstance.helper;
12674
+ helper = instantSearchInstance.mainHelper;
12669
12675
  initialParameters = {
12670
12676
  userToken: helper.state.userToken,
12671
12677
  clickAnalytics: helper.state.clickAnalytics
12672
12678
  };
12673
- helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {
12674
- clickAnalytics: true
12675
- }));
12679
+
12680
+ // We don't want to force clickAnalytics when the insights is enabled from the search response.
12681
+ // This means we don't enable insights for indices that don't opt in
12682
+ if (!$$automatic) {
12683
+ helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {
12684
+ clickAnalytics: true
12685
+ }));
12686
+ }
12676
12687
  if (!$$internal) {
12677
12688
  instantSearchInstance.scheduleSearch();
12678
12689
  }
@@ -12739,6 +12750,9 @@
12739
12750
  } else if (event.insightsMethod) {
12740
12751
  // Source is used to differentiate events sent by instantsearch from those sent manually.
12741
12752
  event.payload.algoliaSource = ['instantsearch'];
12753
+ if ($$automatic) {
12754
+ event.payload.algoliaSource.push('instantsearch-automatic');
12755
+ }
12742
12756
  if (event.eventModifier === 'internal') {
12743
12757
  event.payload.algoliaSource.push('instantsearch-internal');
12744
12758
  }
@@ -14272,7 +14286,7 @@
14272
14286
  return widgets.indexOf(widget) === -1;
14273
14287
  });
14274
14288
  if (localInstantSearchInstance && Boolean(widgets.length)) {
14275
- var _nextState = widgets.reduce(function (state, widget) {
14289
+ var cleanedState = widgets.reduce(function (state, widget) {
14276
14290
  // the `dispose` method exists at this point we already assert it
14277
14291
  var next = widget.dispose({
14278
14292
  helper: helper,
@@ -14281,14 +14295,23 @@
14281
14295
  });
14282
14296
  return next || state;
14283
14297
  }, helper.state);
14298
+ var newState = localInstantSearchInstance.future.preserveSharedStateOnUnmount ? getLocalWidgetsSearchParameters(localWidgets, {
14299
+ uiState: localUiState,
14300
+ initialSearchParameters: new algoliasearchHelper_1.SearchParameters({
14301
+ index: this.getIndexName()
14302
+ })
14303
+ }) : getLocalWidgetsSearchParameters(localWidgets, {
14304
+ uiState: getLocalWidgetsUiState(localWidgets, {
14305
+ searchParameters: cleanedState,
14306
+ helper: helper
14307
+ }),
14308
+ initialSearchParameters: cleanedState
14309
+ });
14284
14310
  localUiState = getLocalWidgetsUiState(localWidgets, {
14285
- searchParameters: _nextState,
14311
+ searchParameters: newState,
14286
14312
  helper: helper
14287
14313
  });
14288
- helper.setState(getLocalWidgetsSearchParameters(localWidgets, {
14289
- uiState: localUiState,
14290
- initialSearchParameters: _nextState
14291
- }));
14314
+ helper.setState(newState);
14292
14315
  if (localWidgets.length) {
14293
14316
  localInstantSearchInstance.scheduleSearch();
14294
14317
  }
@@ -14354,7 +14377,7 @@
14354
14377
  return mainHelper.searchForFacetValues(facetName, facetValue, maxFacetHits, state);
14355
14378
  };
14356
14379
  derivedHelper = mainHelper.derive(function () {
14357
- return mergeSearchParameters.apply(void 0, _toConsumableArray(resolveSearchParameters(_this3)));
14380
+ return mergeSearchParameters.apply(void 0, [mainHelper.state].concat(_toConsumableArray(resolveSearchParameters(_this3))));
14358
14381
  });
14359
14382
  var indexInitialResults = (_instantSearchInstanc = instantSearchInstance._initialResults) === null || _instantSearchInstanc === void 0 ? void 0 : _instantSearchInstanc[this.getIndexId()];
14360
14383
  if (indexInitialResults) {
@@ -14617,7 +14640,7 @@
14617
14640
  };
14618
14641
  }
14619
14642
 
14620
- var version$1 = '4.57.0';
14643
+ var version$1 = '4.59.0';
14621
14644
 
14622
14645
  var withUsage$r = createDocumentationMessageGenerator({
14623
14646
  name: 'instantsearch'
@@ -14632,6 +14655,10 @@
14632
14655
  /**
14633
14656
  * Global options for an InstantSearch instance.
14634
14657
  */
14658
+ var INSTANTSEARCH_FUTURE_DEFAULTS = {
14659
+ preserveSharedStateOnUnmount: false
14660
+ };
14661
+
14635
14662
  /**
14636
14663
  * The actual implementation of the InstantSearch. This is
14637
14664
  * created using the `instantsearch` factory function.
@@ -14641,6 +14668,7 @@
14641
14668
  _inherits(InstantSearch, _EventEmitter);
14642
14669
  var _super = _createSuper(InstantSearch);
14643
14670
  function InstantSearch(options) {
14671
+ var _options$future2;
14644
14672
  var _this;
14645
14673
  _classCallCheck(this, InstantSearch);
14646
14674
  _this = _super.call(this);
@@ -14650,6 +14678,7 @@
14650
14678
  _defineProperty(_assertThisInitialized(_this), "indexName", void 0);
14651
14679
  _defineProperty(_assertThisInitialized(_this), "insightsClient", void 0);
14652
14680
  _defineProperty(_assertThisInitialized(_this), "onStateChange", null);
14681
+ _defineProperty(_assertThisInitialized(_this), "future", void 0);
14653
14682
  _defineProperty(_assertThisInitialized(_this), "helper", void 0);
14654
14683
  _defineProperty(_assertThisInitialized(_this), "mainHelper", void 0);
14655
14684
  _defineProperty(_assertThisInitialized(_this), "mainIndex", void 0);
@@ -14663,6 +14692,7 @@
14663
14692
  _defineProperty(_assertThisInitialized(_this), "_createURL", void 0);
14664
14693
  _defineProperty(_assertThisInitialized(_this), "_searchFunction", void 0);
14665
14694
  _defineProperty(_assertThisInitialized(_this), "_mainHelperSearch", void 0);
14695
+ _defineProperty(_assertThisInitialized(_this), "_insights", void 0);
14666
14696
  _defineProperty(_assertThisInitialized(_this), "middleware", []);
14667
14697
  _defineProperty(_assertThisInitialized(_this), "sendEventToInsights", void 0);
14668
14698
  /**
@@ -14713,7 +14743,7 @@
14713
14743
  _options$routing = options.routing,
14714
14744
  routing = _options$routing === void 0 ? null : _options$routing,
14715
14745
  _options$insights = options.insights,
14716
- insights = _options$insights === void 0 ? false : _options$insights,
14746
+ insights = _options$insights === void 0 ? undefined : _options$insights,
14717
14747
  searchFunction = options.searchFunction,
14718
14748
  _options$stalledSearc = options.stalledSearchDelay,
14719
14749
  stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,
@@ -14722,7 +14752,9 @@
14722
14752
  _options$insightsClie = options.insightsClient,
14723
14753
  insightsClient = _options$insightsClie === void 0 ? null : _options$insightsClie,
14724
14754
  _options$onStateChang = options.onStateChange,
14725
- onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang;
14755
+ onStateChange = _options$onStateChang === void 0 ? null : _options$onStateChang,
14756
+ _options$future = options.future,
14757
+ future = _options$future === void 0 ? _objectSpread2(_objectSpread2({}, INSTANTSEARCH_FUTURE_DEFAULTS), options.future || {}) : _options$future;
14726
14758
  if (searchClient === null) {
14727
14759
  throw new Error(withUsage$r('The `searchClient` option is required.'));
14728
14760
  }
@@ -14739,7 +14771,14 @@
14739
14771
  _warning(!options.searchParameters, "The `searchParameters` option is deprecated and will not be supported in InstantSearch.js 4.x.\n\nYou can replace it with the `configure` widget:\n\n```\nsearch.addWidgets([\n configure(".concat(JSON.stringify(options.searchParameters, null, 2), ")\n]);\n```\n\nSee ").concat(createDocumentationLink({
14740
14772
  name: 'configure'
14741
14773
  }))) ;
14774
+ if ( ((_options$future2 = options.future) === null || _options$future2 === void 0 ? void 0 : _options$future2.preserveSharedStateOnUnmount) === undefined) {
14775
+ // eslint-disable-next-line no-console
14776
+ console.info("Starting from the next major version, InstantSearch will change how widgets state is preserved when they are removed. InstantSearch will keep the state of unmounted widgets to be usable by other widgets with the same attribute.\n\nWe recommend setting `future.preserveSharedStateOnUnmount` to true to adopt this change today.\nTo stay with the current behaviour and remove this warning, set the option to false.\n\nSee documentation: ".concat(createDocumentationLink({
14777
+ name: 'instantsearch'
14778
+ }), "#widget-param-future\n "));
14779
+ }
14742
14780
  _this.client = searchClient;
14781
+ _this.future = future;
14743
14782
  _this.insightsClient = insightsClient;
14744
14783
  _this.indexName = indexName;
14745
14784
  _this.helper = null;
@@ -14760,6 +14799,7 @@
14760
14799
  _this._createURL = defaultCreateURL;
14761
14800
  _this._initialUiState = initialUiState;
14762
14801
  _this._initialResults = null;
14802
+ _this._insights = insights;
14763
14803
  if (searchFunction) {
14764
14804
  _warning(false, "The `searchFunction` option is deprecated. Use `onStateChange` instead.") ;
14765
14805
  _this._searchFunction = searchFunction;
@@ -14771,8 +14811,9 @@
14771
14811
  _this.use(createRouterMiddleware(routerOptions));
14772
14812
  }
14773
14813
 
14774
- // This is the default middleware,
14775
- // any user-provided middleware will be added later and override this one.
14814
+ // This is the default Insights middleware,
14815
+ // added when `insights` is set to true by the user.
14816
+ // Any user-provided middleware will be added later and override this one.
14776
14817
  if (insights) {
14777
14818
  var insightsOptions = typeof insights === 'boolean' ? {} : insights;
14778
14819
  insightsOptions.$$internal = true;
@@ -15064,6 +15105,24 @@
15064
15105
  var instance = _ref6.instance;
15065
15106
  instance.started();
15066
15107
  });
15108
+
15109
+ // This is the automatic Insights middleware,
15110
+ // added when `insights` is unset and the initial results possess `queryID`.
15111
+ // Any user-provided middleware will be added later and override this one.
15112
+ if (typeof this._insights === 'undefined') {
15113
+ mainHelper.derivedHelpers[0].once('result', function () {
15114
+ var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {
15115
+ var results = _ref7.results;
15116
+ return results === null || results === void 0 ? void 0 : results._automaticInsights;
15117
+ });
15118
+ if (hasAutomaticInsights) {
15119
+ _this3.use(createInsightsMiddleware({
15120
+ $$internal: true,
15121
+ $$automatic: true
15122
+ }));
15123
+ }
15124
+ });
15125
+ }
15067
15126
  }
15068
15127
 
15069
15128
  /**
@@ -15093,8 +15152,8 @@
15093
15152
  (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();
15094
15153
  this.mainHelper = null;
15095
15154
  this.helper = null;
15096
- this.middleware.forEach(function (_ref7) {
15097
- var instance = _ref7.instance;
15155
+ this.middleware.forEach(function (_ref8) {
15156
+ var instance = _ref8.instance;
15098
15157
  instance.unsubscribe();
15099
15158
  });
15100
15159
  }
@@ -16110,7 +16169,6 @@
16110
16169
  var _objectWithoutProperties$1 = unwrapExports(objectWithoutProperties);
16111
16170
 
16112
16171
  var _excluded$9 = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
16113
- // This is a minimal subset of the actual types from the `JSX` namespace.
16114
16172
 
16115
16173
  function createHighlightPartComponent(_ref) {
16116
16174
  var createElement = _ref.createElement;
@@ -16134,18 +16192,20 @@
16134
16192
  createElement: createElement,
16135
16193
  Fragment: Fragment
16136
16194
  });
16137
- return function Highlight(_ref4) {
16138
- var parts = _ref4.parts,
16139
- _ref4$highlightedTagN = _ref4.highlightedTagName,
16140
- highlightedTagName = _ref4$highlightedTagN === void 0 ? 'mark' : _ref4$highlightedTagN,
16141
- _ref4$nonHighlightedT = _ref4.nonHighlightedTagName,
16142
- nonHighlightedTagName = _ref4$nonHighlightedT === void 0 ? 'span' : _ref4$nonHighlightedT,
16143
- _ref4$separator = _ref4.separator,
16144
- separator = _ref4$separator === void 0 ? ', ' : _ref4$separator,
16145
- className = _ref4.className,
16146
- _ref4$classNames = _ref4.classNames,
16147
- classNames = _ref4$classNames === void 0 ? {} : _ref4$classNames,
16148
- props = _objectWithoutProperties$1(_ref4, _excluded$9);
16195
+ return function Highlight(userProps) {
16196
+ // Not destructured in function signature, to make sure it's not exposed in
16197
+ // the type definition.
16198
+ var parts = userProps.parts,
16199
+ _userProps$highlighte = userProps.highlightedTagName,
16200
+ highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
16201
+ _userProps$nonHighlig = userProps.nonHighlightedTagName,
16202
+ nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
16203
+ _userProps$separator = userProps.separator,
16204
+ separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
16205
+ className = userProps.className,
16206
+ _userProps$classNames = userProps.classNames,
16207
+ classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
16208
+ props = _objectWithoutProperties$1(userProps, _excluded$9);
16149
16209
 
16150
16210
  return createElement("span", _extends$1({}, props, {
16151
16211
  className: cx(classNames.root, className)
@@ -17731,6 +17791,7 @@
17731
17791
  searchAsYouType: true,
17732
17792
  isSearchStalled: false,
17733
17793
  disabled: false,
17794
+ ariaLabel: 'Search',
17734
17795
  onChange: noop,
17735
17796
  onSubmit: noop,
17736
17797
  onReset: noop,
@@ -17847,7 +17908,8 @@
17847
17908
  showReset = _this$props4.showReset,
17848
17909
  showLoadingIndicator = _this$props4.showLoadingIndicator,
17849
17910
  templates = _this$props4.templates,
17850
- isSearchStalled = _this$props4.isSearchStalled;
17911
+ isSearchStalled = _this$props4.isSearchStalled,
17912
+ ariaLabel = _this$props4.ariaLabel;
17851
17913
  return h("div", {
17852
17914
  className: cssClasses.root
17853
17915
  }, h("form", {
@@ -17874,7 +17936,8 @@
17874
17936
  maxLength: 512,
17875
17937
  onInput: this.onInput,
17876
17938
  onBlur: this.onBlur,
17877
- onFocus: this.onFocus
17939
+ onFocus: this.onFocus,
17940
+ "aria-label": ariaLabel
17878
17941
  }), h(Template, {
17879
17942
  templateKey: "submit",
17880
17943
  rootTagName: "button",
@@ -18123,7 +18186,8 @@
18123
18186
  // This sets the search box to a controlled state because
18124
18187
  // we don't rely on the `refine` prop but on `onChange`.
18125
18188
  ,
18126
- searchAsYouType: false
18189
+ searchAsYouType: false,
18190
+ ariaLabel: "Search for filters"
18127
18191
  }));
18128
18192
  var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h("ul", {
18129
18193
  className: this.props.cssClasses.list
@@ -18492,13 +18556,15 @@
18492
18556
  var currentValue = _ref.currentValue,
18493
18557
  options = _ref.options,
18494
18558
  cssClasses = _ref.cssClasses,
18495
- setValue = _ref.setValue;
18559
+ setValue = _ref.setValue,
18560
+ ariaLabel = _ref.ariaLabel;
18496
18561
  return h("select", {
18497
18562
  className: cx(cssClasses.select),
18498
18563
  onChange: function onChange(event) {
18499
18564
  return setValue(event.target.value);
18500
18565
  },
18501
- value: "".concat(currentValue)
18566
+ value: "".concat(currentValue),
18567
+ "aria-label": ariaLabel
18502
18568
  }, options.map(function (option) {
18503
18569
  return h("option", {
18504
18570
  className: cx(cssClasses.option),
@@ -19158,7 +19224,7 @@
19158
19224
  }, h("ul", {
19159
19225
  className: props.cssClasses.list
19160
19226
  }, props.showFirst && h(PaginationLink, {
19161
- ariaLabel: "First",
19227
+ ariaLabel: "First Page",
19162
19228
  className: props.cssClasses.firstPageItem,
19163
19229
  isDisabled: props.isFirstPage,
19164
19230
  templates: props.templates,
@@ -19168,7 +19234,7 @@
19168
19234
  cssClasses: props.cssClasses,
19169
19235
  createClickHandler: createClickHandler
19170
19236
  }), props.showPrevious && h(PaginationLink, {
19171
- ariaLabel: "Previous",
19237
+ ariaLabel: "Previous Page",
19172
19238
  className: props.cssClasses.previousPageItem,
19173
19239
  isDisabled: props.isFirstPage,
19174
19240
  templates: props.templates,
@@ -19191,7 +19257,7 @@
19191
19257
  createClickHandler: createClickHandler
19192
19258
  });
19193
19259
  }), props.showNext && h(PaginationLink, {
19194
- ariaLabel: "Next",
19260
+ ariaLabel: "Next Page",
19195
19261
  className: props.cssClasses.nextPageItem,
19196
19262
  isDisabled: props.isLastPage,
19197
19263
  templates: props.templates,
@@ -19201,7 +19267,7 @@
19201
19267
  cssClasses: props.cssClasses,
19202
19268
  createClickHandler: createClickHandler
19203
19269
  }), props.showLast && h(PaginationLink, {
19204
- ariaLabel: "Last",
19270
+ ariaLabel: "Last Page, Page ".concat(props.nbPages),
19205
19271
  className: props.cssClasses.lastPageItem,
19206
19272
  isDisabled: props.isLastPage,
19207
19273
  templates: props.templates,
@@ -20698,8 +20764,10 @@
20698
20764
  parseFloat(props['aria-valuenow']) * 100) / 100;
20699
20765
  var value = _typeof(tooltips) === 'object' && tooltips.format ? tooltips.format(roundedValue) : roundedValue;
20700
20766
  var className = cx(props.className, props['data-handle-key'] === 0 && 'rheostat-handle-lower', props['data-handle-key'] === 1 && 'rheostat-handle-upper');
20767
+ var ariaLabel = props['data-handle-key'] === 0 ? 'Minimum Filter Handle' : 'Maximum Filter Handle';
20701
20768
  return h("div", _extends({}, props, {
20702
- className: className
20769
+ className: className,
20770
+ "aria-label": ariaLabel
20703
20771
  }), tooltips && h("div", {
20704
20772
  className: "rheostat-tooltip"
20705
20773
  }, value));
@@ -21621,7 +21689,8 @@
21621
21689
  cssClasses: cssClasses,
21622
21690
  currentValue: currentRefinement,
21623
21691
  options: options,
21624
- setValue: refine
21692
+ setValue: refine,
21693
+ ariaLabel: "Sort results by"
21625
21694
  })), containerNode);
21626
21695
  };
21627
21696
  };