instantsearch.js 4.35.0 → 4.37.2
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/CHANGELOG.md +39 -0
- package/cjs/components/Answers/Answers.js +1 -1
- package/cjs/components/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/components/ClearRefinements/ClearRefinements.js +1 -1
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +3 -3
- package/cjs/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/cjs/components/Hits/Hits.js +1 -7
- package/cjs/components/InfiniteHits/InfiniteHits.js +1 -1
- package/cjs/components/MenuSelect/MenuSelect.js +3 -3
- package/cjs/components/Pagination/Pagination.js +89 -160
- package/cjs/components/Panel/Panel.js +1 -1
- package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/cjs/components/RangeInput/RangeInput.js +1 -1
- package/cjs/components/RefinementList/RefinementList.js +6 -6
- package/cjs/components/RefinementList/RefinementListItem.js +1 -1
- package/cjs/components/RelevantSort/RelevantSort.js +1 -1
- package/cjs/components/SearchBox/SearchBox.js +9 -10
- package/cjs/components/Slider/Slider.js +5 -5
- package/cjs/components/Stats/Stats.js +1 -1
- package/cjs/components/Template/Template.js +3 -3
- package/cjs/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/cjs/components/VoiceSearch/VoiceSearch.js +1 -1
- package/cjs/connectors/answers/connectAnswers.js +10 -10
- package/cjs/connectors/autocomplete/connectAutocomplete.js +9 -9
- package/cjs/connectors/breadcrumb/connectBreadcrumb.js +9 -7
- package/cjs/connectors/clear-refinements/connectClearRefinements.js +9 -9
- package/cjs/connectors/configure/connectConfigure.js +8 -8
- package/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js +5 -5
- package/cjs/connectors/current-refinements/connectCurrentRefinements.js +6 -6
- package/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js +35 -10
- package/cjs/connectors/geo-search/connectGeoSearch.js +11 -11
- package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +6 -6
- package/cjs/connectors/hits/connectHits.js +11 -11
- package/cjs/connectors/hits/connectHitsWithInsights.js +3 -3
- package/cjs/connectors/hits-per-page/connectHitsPerPage.js +6 -6
- package/cjs/connectors/index.js +31 -31
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +12 -12
- package/cjs/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +3 -3
- package/cjs/connectors/menu/connectMenu.js +5 -5
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +7 -7
- package/cjs/connectors/pagination/Paginator.js +3 -3
- package/cjs/connectors/pagination/connectPagination.js +5 -5
- package/cjs/connectors/powered-by/connectPoweredBy.js +5 -5
- package/cjs/connectors/query-rules/connectQueryRules.js +7 -7
- package/cjs/connectors/range/connectRange.js +27 -27
- package/cjs/connectors/rating-menu/connectRatingMenu.js +6 -6
- package/cjs/connectors/refinement-list/connectRefinementList.js +8 -8
- package/cjs/connectors/relevant-sort/connectRelevantSort.js +3 -3
- package/cjs/connectors/search-box/connectSearchBox.js +19 -29
- package/cjs/connectors/sort-by/connectSortBy.js +6 -6
- package/cjs/connectors/stats/connectStats.js +4 -4
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +11 -11
- package/cjs/connectors/voice-search/connectVoiceSearch.js +6 -6
- package/cjs/helpers/get-insights-anonymous-user-token.js +2 -2
- package/cjs/helpers/highlight.js +4 -4
- package/cjs/helpers/index.js +6 -6
- package/cjs/helpers/insights.js +4 -4
- package/cjs/helpers/reverseHighlight.js +5 -5
- package/cjs/helpers/reverseSnippet.js +5 -5
- package/cjs/helpers/snippet.js +4 -4
- package/cjs/index.js +9 -9
- package/cjs/lib/InstantSearch.js +32 -27
- package/cjs/lib/createHelpers.js +6 -6
- package/cjs/lib/infiniteHitsCache/index.js +1 -1
- package/cjs/lib/infiniteHitsCache/sessionStorage.js +4 -4
- package/cjs/lib/insights/client.js +5 -5
- package/cjs/lib/insights/index.js +2 -2
- package/cjs/lib/insights/listener.js +3 -3
- package/cjs/lib/routers/history.js +6 -6
- package/cjs/lib/routers/index.js +1 -1
- package/cjs/lib/stateMappings/index.js +2 -2
- package/cjs/lib/utils/checkIndexUiState.js +3 -3
- package/cjs/lib/utils/checkRendering.js +1 -1
- package/cjs/lib/utils/concatHighlightedParts.js +1 -1
- package/cjs/lib/utils/createSendEventForFacet.js +1 -1
- package/cjs/lib/utils/createSendEventForHits.js +1 -1
- package/cjs/lib/utils/detect-insights-client.js +1 -1
- package/cjs/lib/utils/escape-highlight.js +2 -2
- package/cjs/lib/utils/getContainerNode.js +1 -1
- package/cjs/lib/utils/getHighlightFromSiblings.js +1 -1
- package/cjs/lib/utils/getHighlightedParts.js +1 -1
- package/cjs/lib/utils/getRefinements.js +2 -2
- package/cjs/lib/utils/index.js +48 -48
- package/cjs/lib/utils/logger.js +1 -1
- package/cjs/lib/utils/mergeSearchParameters.js +2 -2
- package/cjs/lib/utils/prepareTemplateProps.js +1 -1
- package/cjs/lib/utils/reverseHighlightedParts.js +1 -1
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createInsightsMiddleware.js +11 -11
- package/cjs/middlewares/createMetadataMiddleware.js +2 -2
- package/cjs/middlewares/createRouterMiddleware.js +4 -4
- package/cjs/middlewares/index.js +3 -3
- package/cjs/types/index.js +14 -14
- package/cjs/widgets/analytics/analytics.js +3 -3
- package/cjs/widgets/answers/answers.js +8 -8
- package/cjs/widgets/breadcrumb/breadcrumb.js +8 -8
- package/cjs/widgets/clear-refinements/clear-refinements.js +8 -8
- package/cjs/widgets/configure/configure.js +3 -3
- package/cjs/widgets/configure-related-items/configure-related-items.js +3 -3
- package/cjs/widgets/current-refinements/current-refinements.js +6 -6
- package/cjs/widgets/dynamic-widgets/dynamic-widgets.js +14 -11
- package/cjs/widgets/geo-search/GeoSearchRenderer.js +3 -3
- package/cjs/widgets/geo-search/geo-search.js +9 -9
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +8 -8
- package/cjs/widgets/hits/hits.js +11 -11
- package/cjs/widgets/hits-per-page/hits-per-page.js +7 -7
- package/cjs/widgets/index/index.js +6 -6
- package/cjs/widgets/index.js +36 -36
- package/cjs/widgets/infinite-hits/infinite-hits.js +11 -11
- package/cjs/widgets/menu/menu.js +8 -8
- package/cjs/widgets/menu-select/menu-select.js +8 -8
- package/cjs/widgets/numeric-menu/numeric-menu.js +8 -8
- package/cjs/widgets/pagination/pagination.js +7 -7
- package/cjs/widgets/panel/panel.js +7 -7
- package/cjs/widgets/powered-by/powered-by.js +6 -6
- package/cjs/widgets/query-rule-context/query-rule-context.js +4 -4
- package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +6 -6
- package/cjs/widgets/range-input/range-input.js +7 -7
- package/cjs/widgets/range-slider/range-slider.js +6 -6
- package/cjs/widgets/rating-menu/rating-menu.js +8 -8
- package/cjs/widgets/refinement-list/refinement-list.js +10 -10
- package/cjs/widgets/relevant-sort/relevant-sort.js +7 -7
- package/cjs/widgets/search-box/search-box.js +7 -7
- package/cjs/widgets/sort-by/sort-by.js +6 -6
- package/cjs/widgets/stats/defaultTemplates.js +1 -1
- package/cjs/widgets/stats/stats.js +7 -7
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +8 -8
- package/cjs/widgets/voice-search/voice-search.js +7 -7
- package/dist/instantsearch.development.d.ts +50 -7
- package/dist/instantsearch.development.js +341 -412
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.development.min.d.ts +50 -7
- package/dist/instantsearch.production.d.ts +50 -7
- package/dist/instantsearch.production.min.d.ts +50 -7
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.js +1 -1
- package/es/components/Breadcrumb/Breadcrumb.js +1 -1
- package/es/components/ClearRefinements/ClearRefinements.js +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +1 -1
- package/es/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/es/components/Hits/Hits.d.ts +1 -9
- package/es/components/Hits/Hits.js +1 -7
- package/es/components/InfiniteHits/InfiniteHits.js +1 -1
- package/es/components/MenuSelect/MenuSelect.js +2 -2
- package/es/components/Pagination/Pagination.d.ts +5 -19
- package/es/components/Pagination/Pagination.js +89 -158
- package/es/components/Panel/Panel.js +1 -1
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/es/components/RangeInput/RangeInput.js +1 -1
- package/es/components/RefinementList/RefinementList.js +4 -4
- package/es/components/RefinementList/RefinementListItem.js +1 -1
- package/es/components/RelevantSort/RelevantSort.js +1 -1
- package/es/components/SearchBox/SearchBox.js +5 -6
- package/es/components/Slider/Slider.js +3 -3
- package/es/components/Stats/Stats.js +1 -1
- package/es/components/Template/Template.js +1 -1
- package/es/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/es/components/VoiceSearch/VoiceSearch.js +1 -1
- package/es/connectors/answers/connectAnswers.js +1 -1
- package/es/connectors/autocomplete/connectAutocomplete.js +1 -1
- package/es/connectors/breadcrumb/connectBreadcrumb.js +5 -3
- package/es/connectors/clear-refinements/connectClearRefinements.js +1 -1
- package/es/connectors/configure/connectConfigure.js +1 -1
- package/es/connectors/configure-related-items/connectConfigureRelatedItems.js +2 -2
- package/es/connectors/current-refinements/connectCurrentRefinements.js +1 -1
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +14 -0
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.js +31 -6
- package/es/connectors/geo-search/connectGeoSearch.js +1 -1
- package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +1 -1
- package/es/connectors/hits/connectHits.js +1 -1
- package/es/connectors/hits/connectHitsWithInsights.js +2 -2
- package/es/connectors/hits-per-page/connectHitsPerPage.js +1 -1
- package/es/connectors/index.js +30 -30
- package/es/connectors/infinite-hits/connectInfiniteHits.js +1 -1
- package/es/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +2 -2
- package/es/connectors/menu/connectMenu.js +1 -1
- package/es/connectors/numeric-menu/connectNumericMenu.js +1 -1
- package/es/connectors/pagination/Paginator.js +1 -1
- package/es/connectors/pagination/connectPagination.js +2 -2
- package/es/connectors/powered-by/connectPoweredBy.js +1 -1
- package/es/connectors/query-rules/connectQueryRules.js +1 -1
- package/es/connectors/range/connectRange.js +1 -1
- package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
- package/es/connectors/refinement-list/connectRefinementList.js +1 -1
- package/es/connectors/relevant-sort/connectRelevantSort.js +1 -1
- package/es/connectors/search-box/connectSearchBox.js +16 -26
- package/es/connectors/sort-by/connectSortBy.js +1 -1
- package/es/connectors/stats/connectStats.js +1 -1
- package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +36 -7
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
- package/es/connectors/voice-search/connectVoiceSearch.js +2 -2
- package/es/helpers/get-insights-anonymous-user-token.js +1 -1
- package/es/helpers/highlight.js +2 -2
- package/es/helpers/index.js +10 -10
- package/es/helpers/insights.js +1 -1
- package/es/helpers/reverseHighlight.js +2 -2
- package/es/helpers/reverseSnippet.js +2 -2
- package/es/helpers/snippet.js +2 -2
- package/es/index.js +6 -6
- package/es/lib/InstantSearch.js +15 -10
- package/es/lib/createHelpers.js +1 -1
- package/es/lib/infiniteHitsCache/index.js +1 -1
- package/es/lib/infiniteHitsCache/sessionStorage.js +1 -1
- package/es/lib/insights/client.js +1 -1
- package/es/lib/insights/index.js +2 -2
- package/es/lib/insights/listener.js +2 -2
- package/es/lib/routers/history.js +1 -1
- package/es/lib/routers/index.js +1 -1
- package/es/lib/stateMappings/index.js +2 -2
- package/es/lib/utils/checkIndexUiState.js +3 -3
- package/es/lib/utils/checkRendering.js +1 -1
- package/es/lib/utils/concatHighlightedParts.js +1 -1
- package/es/lib/utils/createSendEventForFacet.js +1 -1
- package/es/lib/utils/createSendEventForHits.js +1 -1
- package/es/lib/utils/detect-insights-client.js +1 -1
- package/es/lib/utils/escape-highlight.js +2 -2
- package/es/lib/utils/getContainerNode.js +1 -1
- package/es/lib/utils/getHighlightFromSiblings.js +1 -1
- package/es/lib/utils/getHighlightedParts.js +1 -1
- package/es/lib/utils/getRefinements.js +2 -2
- package/es/lib/utils/index.js +48 -48
- package/es/lib/utils/logger.js +1 -1
- package/es/lib/utils/mergeSearchParameters.js +2 -2
- package/es/lib/utils/prepareTemplateProps.js +1 -1
- package/es/lib/utils/reverseHighlightedParts.js +1 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.js +3 -3
- package/es/middlewares/createMetadataMiddleware.js +1 -1
- package/es/middlewares/createRouterMiddleware.js +3 -3
- package/es/middlewares/index.js +3 -3
- package/es/package.json +1 -0
- package/es/types/index.js +14 -14
- package/es/widgets/analytics/analytics.js +1 -1
- package/es/widgets/answers/answers.js +5 -5
- package/es/widgets/breadcrumb/breadcrumb.js +5 -5
- package/es/widgets/clear-refinements/clear-refinements.js +5 -5
- package/es/widgets/configure/configure.js +2 -2
- package/es/widgets/configure-related-items/configure-related-items.js +2 -2
- package/es/widgets/current-refinements/current-refinements.js +4 -4
- package/es/widgets/dynamic-widgets/dynamic-widgets.js +11 -8
- package/es/widgets/geo-search/GeoSearchRenderer.js +2 -2
- package/es/widgets/geo-search/geo-search.js +6 -6
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +5 -5
- package/es/widgets/hits/hits.js +6 -6
- package/es/widgets/hits-per-page/hits-per-page.js +4 -4
- package/es/widgets/index/index.js +1 -1
- package/es/widgets/index.js +34 -34
- package/es/widgets/infinite-hits/infinite-hits.js +6 -6
- package/es/widgets/menu/menu.js +5 -5
- package/es/widgets/menu-select/menu-select.js +5 -5
- package/es/widgets/numeric-menu/numeric-menu.js +5 -5
- package/es/widgets/pagination/pagination.js +4 -4
- package/es/widgets/panel/panel.js +3 -3
- package/es/widgets/powered-by/powered-by.js +4 -4
- package/es/widgets/query-rule-context/query-rule-context.js +2 -2
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -4
- package/es/widgets/range-input/range-input.js +4 -4
- package/es/widgets/range-slider/range-slider.js +4 -4
- package/es/widgets/rating-menu/rating-menu.js +5 -5
- package/es/widgets/refinement-list/refinement-list.js +6 -6
- package/es/widgets/relevant-sort/relevant-sort.js +5 -5
- package/es/widgets/search-box/search-box.js +5 -5
- package/es/widgets/sort-by/sort-by.js +4 -4
- package/es/widgets/stats/defaultTemplates.js +1 -1
- package/es/widgets/stats/stats.js +4 -4
- package/es/widgets/toggle-refinement/toggle-refinement.js +5 -5
- package/es/widgets/voice-search/voice-search.js +5 -5
- package/package.json +6 -5
- package/cjs/components/Pagination/PaginationLink.js +0 -47
- package/es/components/Pagination/PaginationLink.d.ts +0 -17
- package/es/components/Pagination/PaginationLink.js +0 -39
|
@@ -9,7 +9,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
9
9
|
/** @jsx h */
|
|
10
10
|
import { h } from 'preact';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import Template from
|
|
12
|
+
import Template from "../Template/Template.js";
|
|
13
13
|
|
|
14
14
|
var Answers = function Answers(_ref) {
|
|
15
15
|
var hits = _ref.hits,
|
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
5
5
|
/** @jsx h */
|
|
6
6
|
import { h } from 'preact';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import Template from
|
|
8
|
+
import Template from "../Template/Template.js";
|
|
9
9
|
|
|
10
10
|
var Breadcrumb = function Breadcrumb(_ref) {
|
|
11
11
|
var items = _ref.items,
|
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
5
5
|
/** @jsx h */
|
|
6
6
|
import { h } from 'preact';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import Template from
|
|
8
|
+
import Template from "../Template/Template.js";
|
|
9
9
|
|
|
10
10
|
var ClearRefinements = function ClearRefinements(_ref) {
|
|
11
11
|
var hasRefinements = _ref.hasRefinements,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx h */
|
|
2
2
|
import { h } from 'preact';
|
|
3
|
-
import { isSpecialClick, capitalize } from
|
|
3
|
+
import { isSpecialClick, capitalize } from "../../lib/utils/index.js";
|
|
4
4
|
|
|
5
5
|
var createItemKey = function createItemKey(_ref) {
|
|
6
6
|
var attribute = _ref.attribute,
|
|
@@ -5,9 +5,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
5
5
|
/** @jsx h */
|
|
6
6
|
import { h, Fragment } from 'preact';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import Template from
|
|
9
|
-
import GeoSearchButton from
|
|
10
|
-
import GeoSearchToggle from
|
|
8
|
+
import Template from "../Template/Template.js";
|
|
9
|
+
import GeoSearchButton from "./GeoSearchButton.js";
|
|
10
|
+
import GeoSearchToggle from "./GeoSearchToggle.js";
|
|
11
11
|
|
|
12
12
|
var GeoSearchControls = function GeoSearchControls(_ref) {
|
|
13
13
|
var cssClasses = _ref.cssClasses,
|
|
@@ -15,13 +15,5 @@ export declare type HitsProps = {
|
|
|
15
15
|
cssClasses: HitsComponentCSSClasses;
|
|
16
16
|
templateProps: PreparedTemplateProps<HitsComponentTemplates>;
|
|
17
17
|
};
|
|
18
|
-
declare const Hits: {
|
|
19
|
-
({ results, hits, bindEvent, cssClasses, templateProps, }: HitsProps): h.JSX.Element;
|
|
20
|
-
defaultProps: {
|
|
21
|
-
results: {
|
|
22
|
-
hits: never[];
|
|
23
|
-
};
|
|
24
|
-
hits: never[];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
18
|
+
declare const Hits: ({ results, hits, bindEvent, cssClasses, templateProps, }: HitsProps) => h.JSX.Element;
|
|
27
19
|
export default Hits;
|
|
@@ -9,7 +9,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
9
9
|
/** @jsx h */
|
|
10
10
|
import { h } from 'preact';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import Template from
|
|
12
|
+
import Template from "../Template/Template.js";
|
|
13
13
|
|
|
14
14
|
var Hits = function Hits(_ref) {
|
|
15
15
|
var results = _ref.results,
|
|
@@ -48,10 +48,4 @@ var Hits = function Hits(_ref) {
|
|
|
48
48
|
})));
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
Hits.defaultProps = {
|
|
52
|
-
results: {
|
|
53
|
-
hits: []
|
|
54
|
-
},
|
|
55
|
-
hits: []
|
|
56
|
-
};
|
|
57
51
|
export default Hits;
|
|
@@ -9,7 +9,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
9
9
|
/** @jsx h */
|
|
10
10
|
import { h } from 'preact';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import Template from
|
|
12
|
+
import Template from "../Template/Template.js";
|
|
13
13
|
|
|
14
14
|
var InfiniteHits = function InfiniteHits(_ref) {
|
|
15
15
|
var results = _ref.results,
|
|
@@ -5,8 +5,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
5
5
|
/** @jsx h */
|
|
6
6
|
import { h } from 'preact';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import { find } from
|
|
9
|
-
import Template from
|
|
8
|
+
import { find } from "../../lib/utils/index.js";
|
|
9
|
+
import Template from "../Template/Template.js";
|
|
10
10
|
|
|
11
11
|
function MenuSelect(_ref) {
|
|
12
12
|
var cssClasses = _ref.cssClasses,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx h */
|
|
2
|
-
import {
|
|
2
|
+
import { h } from 'preact';
|
|
3
3
|
import type { PaginationCSSClasses, PaginationTemplates } from '../../widgets/pagination/pagination';
|
|
4
4
|
import type { ComponentCSSClasses } from '../../types';
|
|
5
5
|
export declare type PaginationComponentCSSClasses = ComponentCSSClasses<PaginationCSSClasses>;
|
|
@@ -7,10 +7,10 @@ export declare type PaginationComponentTemplates = Required<PaginationTemplates>
|
|
|
7
7
|
export declare type PaginationProps = {
|
|
8
8
|
createURL(value: number): string;
|
|
9
9
|
cssClasses: PaginationComponentCSSClasses;
|
|
10
|
-
currentPage: number;
|
|
11
10
|
templates: PaginationComponentTemplates;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
currentPage: number;
|
|
12
|
+
nbPages: number;
|
|
13
|
+
pages: number[];
|
|
14
14
|
isFirstPage: boolean;
|
|
15
15
|
isLastPage: boolean;
|
|
16
16
|
setCurrentPage(value: number): void;
|
|
@@ -19,19 +19,5 @@ export declare type PaginationProps = {
|
|
|
19
19
|
showPrevious?: boolean;
|
|
20
20
|
showNext?: boolean;
|
|
21
21
|
};
|
|
22
|
-
declare
|
|
23
|
-
static defaultProps: {
|
|
24
|
-
currentPage: number;
|
|
25
|
-
nbPages: number;
|
|
26
|
-
pages: never[];
|
|
27
|
-
};
|
|
28
|
-
private pageLink;
|
|
29
|
-
handleClick: (pageNumber: number, event: MouseEvent) => void;
|
|
30
|
-
private previousPageLink;
|
|
31
|
-
private nextPageLink;
|
|
32
|
-
private firstPageLink;
|
|
33
|
-
private lastPageLink;
|
|
34
|
-
private pages;
|
|
35
|
-
render(): h.JSX.Element;
|
|
36
|
-
}
|
|
22
|
+
declare function Pagination(props: PaginationProps): h.JSX.Element;
|
|
37
23
|
export default Pagination;
|
|
@@ -1,55 +1,13 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
-
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
-
|
|
23
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
2
|
|
|
25
3
|
/** @jsx h */
|
|
26
|
-
import {
|
|
4
|
+
import { h } from 'preact';
|
|
27
5
|
import cx from 'classnames';
|
|
28
|
-
import
|
|
29
|
-
import { isSpecialClick } from '../../lib/utils';
|
|
30
|
-
var defaultProps = {
|
|
31
|
-
currentPage: 0,
|
|
32
|
-
nbPages: 0,
|
|
33
|
-
pages: []
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var Pagination = /*#__PURE__*/function (_Component) {
|
|
37
|
-
_inherits(Pagination, _Component);
|
|
38
|
-
|
|
39
|
-
var _super = _createSuper(Pagination);
|
|
40
|
-
|
|
41
|
-
function Pagination() {
|
|
42
|
-
var _this;
|
|
43
|
-
|
|
44
|
-
_classCallCheck(this, Pagination);
|
|
6
|
+
import { isSpecialClick } from "../../lib/utils/index.js";
|
|
45
7
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
|
-
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (pageNumber, event) {
|
|
8
|
+
function Pagination(props) {
|
|
9
|
+
function createClickHandler(pageNumber) {
|
|
10
|
+
return function (event) {
|
|
53
11
|
if (isSpecialClick(event)) {
|
|
54
12
|
// do not alter the default browser behavior
|
|
55
13
|
// if one special key is down
|
|
@@ -57,120 +15,93 @@ var Pagination = /*#__PURE__*/function (_Component) {
|
|
|
57
15
|
}
|
|
58
16
|
|
|
59
17
|
event.preventDefault();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
_defineProperty(_assertThisInitialized(_this), "previousPageLink", function () {
|
|
65
|
-
return _this.pageLink({
|
|
66
|
-
ariaLabel: 'Previous',
|
|
67
|
-
additionalClassName: _this.props.cssClasses.previousPageItem,
|
|
68
|
-
isDisabled: _this.props.isFirstPage,
|
|
69
|
-
label: _this.props.templates.previous,
|
|
70
|
-
pageNumber: _this.props.currentPage - 1,
|
|
71
|
-
createURL: _this.props.createURL
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
_defineProperty(_assertThisInitialized(_this), "nextPageLink", function () {
|
|
76
|
-
return _this.pageLink({
|
|
77
|
-
ariaLabel: 'Next',
|
|
78
|
-
additionalClassName: _this.props.cssClasses.nextPageItem,
|
|
79
|
-
isDisabled: _this.props.isLastPage,
|
|
80
|
-
label: _this.props.templates.next,
|
|
81
|
-
pageNumber: _this.props.currentPage + 1,
|
|
82
|
-
createURL: _this.props.createURL
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
_defineProperty(_assertThisInitialized(_this), "firstPageLink", function () {
|
|
87
|
-
return _this.pageLink({
|
|
88
|
-
ariaLabel: 'First',
|
|
89
|
-
additionalClassName: _this.props.cssClasses.firstPageItem,
|
|
90
|
-
isDisabled: _this.props.isFirstPage,
|
|
91
|
-
label: _this.props.templates.first,
|
|
92
|
-
pageNumber: 0,
|
|
93
|
-
createURL: _this.props.createURL
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "lastPageLink", function () {
|
|
98
|
-
return _this.pageLink({
|
|
99
|
-
ariaLabel: 'Last',
|
|
100
|
-
additionalClassName: _this.props.cssClasses.lastPageItem,
|
|
101
|
-
isDisabled: _this.props.isLastPage,
|
|
102
|
-
label: _this.props.templates.last,
|
|
103
|
-
pageNumber: _this.props.nbPages - 1,
|
|
104
|
-
createURL: _this.props.createURL
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
_defineProperty(_assertThisInitialized(_this), "pages", function () {
|
|
109
|
-
return _this.props.pages.map(function (pageNumber) {
|
|
110
|
-
return _this.pageLink({
|
|
111
|
-
ariaLabel: "".concat(pageNumber + 1),
|
|
112
|
-
additionalClassName: _this.props.cssClasses.pageItem,
|
|
113
|
-
isSelected: pageNumber === _this.props.currentPage,
|
|
114
|
-
label: "".concat(pageNumber + 1),
|
|
115
|
-
pageNumber: pageNumber,
|
|
116
|
-
createURL: _this.props.createURL
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
return _this;
|
|
18
|
+
props.setCurrentPage(pageNumber);
|
|
19
|
+
};
|
|
122
20
|
}
|
|
123
21
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
22
|
+
return h("div", {
|
|
23
|
+
className: cx(props.cssClasses.root, _defineProperty({}, props.cssClasses.noRefinementRoot, props.nbPages <= 1))
|
|
24
|
+
}, h("ul", {
|
|
25
|
+
className: props.cssClasses.list
|
|
26
|
+
}, props.showFirst && h(PaginationLink, {
|
|
27
|
+
ariaLabel: "First",
|
|
28
|
+
className: props.cssClasses.firstPageItem,
|
|
29
|
+
isDisabled: props.isFirstPage,
|
|
30
|
+
label: props.templates.first,
|
|
31
|
+
pageNumber: 0,
|
|
32
|
+
createURL: props.createURL,
|
|
33
|
+
cssClasses: props.cssClasses,
|
|
34
|
+
createClickHandler: createClickHandler
|
|
35
|
+
}), props.showPrevious && h(PaginationLink, {
|
|
36
|
+
ariaLabel: "Previous",
|
|
37
|
+
className: props.cssClasses.previousPageItem,
|
|
38
|
+
isDisabled: props.isFirstPage,
|
|
39
|
+
label: props.templates.previous,
|
|
40
|
+
pageNumber: props.currentPage - 1,
|
|
41
|
+
createURL: props.createURL,
|
|
42
|
+
cssClasses: props.cssClasses,
|
|
43
|
+
createClickHandler: createClickHandler
|
|
44
|
+
}), props.pages.map(function (pageNumber) {
|
|
45
|
+
return h(PaginationLink, {
|
|
46
|
+
key: pageNumber,
|
|
47
|
+
ariaLabel: "".concat(pageNumber + 1),
|
|
48
|
+
className: props.cssClasses.pageItem,
|
|
49
|
+
isSelected: pageNumber === props.currentPage,
|
|
50
|
+
label: "".concat(pageNumber + 1),
|
|
51
|
+
pageNumber: pageNumber,
|
|
52
|
+
createURL: props.createURL,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
createClickHandler: createClickHandler
|
|
55
|
+
});
|
|
56
|
+
}), props.showNext && h(PaginationLink, {
|
|
57
|
+
ariaLabel: "Next",
|
|
58
|
+
className: props.cssClasses.nextPageItem,
|
|
59
|
+
isDisabled: props.isLastPage,
|
|
60
|
+
label: props.templates.next,
|
|
61
|
+
pageNumber: props.currentPage + 1,
|
|
62
|
+
createURL: props.createURL,
|
|
63
|
+
cssClasses: props.cssClasses,
|
|
64
|
+
createClickHandler: createClickHandler
|
|
65
|
+
}), props.showLast && h(PaginationLink, {
|
|
66
|
+
ariaLabel: "Last",
|
|
67
|
+
className: props.cssClasses.lastPageItem,
|
|
68
|
+
isDisabled: props.isLastPage,
|
|
69
|
+
label: props.templates.last,
|
|
70
|
+
pageNumber: props.nbPages - 1,
|
|
71
|
+
createURL: props.createURL,
|
|
72
|
+
cssClasses: props.cssClasses,
|
|
73
|
+
createClickHandler: createClickHandler
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function PaginationLink(_ref) {
|
|
78
|
+
var label = _ref.label,
|
|
79
|
+
ariaLabel = _ref.ariaLabel,
|
|
80
|
+
pageNumber = _ref.pageNumber,
|
|
81
|
+
className = _ref.className,
|
|
82
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
83
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
84
|
+
_ref$isSelected = _ref.isSelected,
|
|
85
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
86
|
+
cssClasses = _ref.cssClasses,
|
|
87
|
+
createURL = _ref.createURL,
|
|
88
|
+
createClickHandler = _ref.createClickHandler;
|
|
89
|
+
return h("li", {
|
|
90
|
+
className: cx(cssClasses.item, className, isDisabled && cssClasses.disabledItem, isSelected && cssClasses.selectedItem)
|
|
91
|
+
}, isDisabled ? h("span", {
|
|
92
|
+
className: cssClasses.link,
|
|
93
|
+
dangerouslySetInnerHTML: {
|
|
94
|
+
__html: label
|
|
159
95
|
}
|
|
160
|
-
}, {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}, this.props.showFirst && this.firstPageLink(), this.props.showPrevious && this.previousPageLink(), this.pages(), this.props.showNext && this.nextPageLink(), this.props.showLast && this.lastPageLink()));
|
|
96
|
+
}) : h("a", {
|
|
97
|
+
className: cssClasses.link,
|
|
98
|
+
"aria-label": ariaLabel,
|
|
99
|
+
href: createURL(pageNumber),
|
|
100
|
+
onClick: createClickHandler(pageNumber),
|
|
101
|
+
dangerouslySetInnerHTML: {
|
|
102
|
+
__html: label
|
|
168
103
|
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return Pagination;
|
|
172
|
-
}(Component);
|
|
173
|
-
|
|
174
|
-
_defineProperty(Pagination, "defaultProps", defaultProps);
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
175
106
|
|
|
176
107
|
export default Pagination;
|
|
@@ -16,7 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
import { h } from 'preact';
|
|
17
17
|
import { useState, useEffect, useRef } from 'preact/hooks';
|
|
18
18
|
import cx from 'classnames';
|
|
19
|
-
import Template from
|
|
19
|
+
import Template from "../Template/Template.js";
|
|
20
20
|
|
|
21
21
|
function Panel(props) {
|
|
22
22
|
var _cx;
|
|
@@ -27,7 +27,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
27
27
|
/** @jsx h */
|
|
28
28
|
import { h, Component } from 'preact';
|
|
29
29
|
import cx from 'classnames';
|
|
30
|
-
import Template from
|
|
30
|
+
import Template from "../Template/Template.js";
|
|
31
31
|
|
|
32
32
|
var RangeInput = /*#__PURE__*/function (_Component) {
|
|
33
33
|
_inherits(RangeInput, _Component);
|
|
@@ -35,10 +35,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
35
35
|
/** @jsx h */
|
|
36
36
|
import { h, createRef, Component } from 'preact';
|
|
37
37
|
import cx from 'classnames';
|
|
38
|
-
import { isSpecialClick, isEqual } from
|
|
39
|
-
import Template from
|
|
40
|
-
import RefinementListItem from
|
|
41
|
-
import SearchBox from
|
|
38
|
+
import { isSpecialClick, isEqual } from "../../lib/utils/index.js";
|
|
39
|
+
import Template from "../Template/Template.js";
|
|
40
|
+
import RefinementListItem from "./RefinementListItem.js";
|
|
41
|
+
import SearchBox from "../SearchBox/SearchBox.js";
|
|
42
42
|
var defaultProps = {
|
|
43
43
|
cssClasses: {},
|
|
44
44
|
depth: 0
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
/** @jsx h */
|
|
4
4
|
import { h } from 'preact';
|
|
5
|
-
import Template from
|
|
5
|
+
import Template from "../Template/Template.js";
|
|
6
6
|
|
|
7
7
|
function RefinementListItem(_ref) {
|
|
8
8
|
var className = _ref.className,
|
|
@@ -24,8 +24,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
24
24
|
|
|
25
25
|
/** @jsx h */
|
|
26
26
|
import { h, createRef, Component } from 'preact';
|
|
27
|
-
import { noop } from
|
|
28
|
-
import Template from
|
|
27
|
+
import { noop } from "../../lib/utils/index.js";
|
|
28
|
+
import Template from "../Template/Template.js";
|
|
29
29
|
var defaultProps = {
|
|
30
30
|
query: '',
|
|
31
31
|
showSubmit: true,
|
|
@@ -184,8 +184,7 @@ var SearchBox = /*#__PURE__*/function (_Component) {
|
|
|
184
184
|
role: "search",
|
|
185
185
|
className: cssClasses.form,
|
|
186
186
|
noValidate: true,
|
|
187
|
-
onSubmit: this.onSubmit
|
|
188
|
-
,
|
|
187
|
+
onSubmit: this.onSubmit,
|
|
189
188
|
onReset: this.onReset
|
|
190
189
|
}, h("input", {
|
|
191
190
|
ref: this.input,
|
|
@@ -196,9 +195,9 @@ var SearchBox = /*#__PURE__*/function (_Component) {
|
|
|
196
195
|
placeholder: placeholder,
|
|
197
196
|
autoFocus: autofocus,
|
|
198
197
|
autoComplete: "off",
|
|
199
|
-
autoCorrect: "off"
|
|
198
|
+
autoCorrect: "off",
|
|
199
|
+
autoCapitalize: "off" // @ts-expect-error `spellCheck` attribute is missing in preact JSX types
|
|
200
200
|
,
|
|
201
|
-
autoCapitalize: "off",
|
|
202
201
|
spellCheck: "false",
|
|
203
202
|
maxLength: 512,
|
|
204
203
|
onInput: this.onInput,
|
|
@@ -38,10 +38,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
38
38
|
|
|
39
39
|
/** @jsx h */
|
|
40
40
|
import { h, Component } from 'preact';
|
|
41
|
-
import Rheostat from
|
|
41
|
+
import Rheostat from "./Rheostat.js";
|
|
42
42
|
import cx from 'classnames';
|
|
43
|
-
import { range } from
|
|
44
|
-
import Pit from
|
|
43
|
+
import { range } from "../../lib/utils/index.js";
|
|
44
|
+
import Pit from "./Pit.js";
|
|
45
45
|
|
|
46
46
|
var Slider = /*#__PURE__*/function (_Component) {
|
|
47
47
|
_inherits(Slider, _Component);
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
/** @jsx h */
|
|
14
14
|
import { h } from 'preact';
|
|
15
15
|
import cx from 'classnames';
|
|
16
|
-
import Template from
|
|
16
|
+
import Template from "../Template/Template.js";
|
|
17
17
|
|
|
18
18
|
var Stats = function Stats(_ref) {
|
|
19
19
|
var nbHits = _ref.nbHits,
|
|
@@ -26,7 +26,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
26
26
|
|
|
27
27
|
/** @jsx h */
|
|
28
28
|
import { h, Component } from 'preact';
|
|
29
|
-
import { renderTemplate, isEqual } from
|
|
29
|
+
import { renderTemplate, isEqual } from "../../lib/utils/index.js";
|
|
30
30
|
var defaultProps = {
|
|
31
31
|
data: {},
|
|
32
32
|
rootTagName: 'div',
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
/** @jsx h */
|
|
4
4
|
import { h } from 'preact';
|
|
5
|
-
import Template from
|
|
5
|
+
import Template from "../Template/Template.js";
|
|
6
6
|
|
|
7
7
|
var ToggleRefinement = function ToggleRefinement(_ref) {
|
|
8
8
|
var currentRefinement = _ref.currentRefinement,
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
import { checkRendering, createDocumentationMessageGenerator, createConcurrentSafePromise, addQueryID, debounce, addAbsolutePosition, noop, escapeHits } from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, createConcurrentSafePromise, addQueryID, debounce, addAbsolutePosition, noop, escapeHits } from "../../lib/utils/index.js";
|
|
8
8
|
|
|
9
9
|
function hasFindAnswersMethod(answersIndex) {
|
|
10
10
|
return typeof answersIndex.findAnswers === 'function';
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, createSendEventForHits, noop, warning } from
|
|
7
|
+
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, createSendEventForHits, noop, warning } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'autocomplete',
|
|
10
10
|
connector: true
|
|
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, warning, createDocumentationMessageGenerator, isEqual, noop } from
|
|
19
|
+
import { checkRendering, warning, createDocumentationMessageGenerator, isEqual, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'breadcrumb',
|
|
22
22
|
connector: true
|
|
@@ -49,7 +49,9 @@ var connectBreadcrumb = function connectBreadcrumb(renderFn) {
|
|
|
49
49
|
if (!facetValue) {
|
|
50
50
|
var breadcrumb = state.getHierarchicalFacetBreadcrumb(hierarchicalFacetName);
|
|
51
51
|
|
|
52
|
-
if (breadcrumb.length
|
|
52
|
+
if (breadcrumb.length === 0) {
|
|
53
|
+
return state;
|
|
54
|
+
} else {
|
|
53
55
|
return state.resetPage().toggleFacetRefinement(hierarchicalFacetName, breadcrumb[0]);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -84,7 +86,7 @@ var connectBreadcrumb = function connectBreadcrumb(renderFn) {
|
|
|
84
86
|
state = _ref2.state;
|
|
85
87
|
|
|
86
88
|
function getItems() {
|
|
87
|
-
if (!results) {
|
|
89
|
+
if (!results || state.hierarchicalFacets.length === 0) {
|
|
88
90
|
return [];
|
|
89
91
|
}
|
|
90
92
|
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
|
|
17
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, clearRefinements, getRefinements, createDocumentationMessageGenerator, noop, uniq, mergeSearchParameters } from
|
|
19
|
+
import { checkRendering, clearRefinements, getRefinements, createDocumentationMessageGenerator, noop, uniq, mergeSearchParameters } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'clear-refinements',
|
|
22
22
|
connector: true
|
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
7
|
import algoliasearchHelper from 'algoliasearch-helper';
|
|
8
|
-
import { createDocumentationMessageGenerator, isPlainObject, mergeSearchParameters, noop } from
|
|
8
|
+
import { createDocumentationMessageGenerator, isPlainObject, mergeSearchParameters, noop } from "../../lib/utils/index.js";
|
|
9
9
|
/**
|
|
10
10
|
* Refine the given search parameters.
|
|
11
11
|
*/
|