@sledge-app/react-instant-search 0.0.61 → 0.0.63
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/dist/components/ProductFilterWidget/ProductFilterWidgetInitSelector.d.ts.map +1 -1
- package/dist/components/SearchIconWidget/SearchIconWidgetInitSelector.d.ts.map +1 -1
- package/dist/components/SearchResultWidget/SearchResultWidget.d.ts.map +1 -1
- package/dist/components/SearchWidget/SearchWidgetInitSelector.d.ts.map +1 -1
- package/dist/sledge-react-instant-search.cjs +1 -1
- package/dist/sledge-react-instant-search.cjs.map +1 -1
- package/dist/sledge-react-instant-search.js +27 -32
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,15 +16,6 @@ const LOCAL_STORAGE_KEY = {
|
|
|
16
16
|
INSTANT_SEARCH_SETTING: "sledge-instant-search-setting"
|
|
17
17
|
};
|
|
18
18
|
const SEARCH_RESULT_URL = "/pages/search-result";
|
|
19
|
-
const SEPARATE_COMPONENT_DISPLAY_NAME = {
|
|
20
|
-
PRODUCT: {
|
|
21
|
-
CARDS: "ProductCards"
|
|
22
|
-
},
|
|
23
|
-
SUGGESTION_KEYWORD_LISTS: "SuggestionKeywordLists",
|
|
24
|
-
OTHER_INDEX_LISTS: "OtherIndexLists",
|
|
25
|
-
SEARCH_VIEW_MORE_RESULT: "SearchViewMoreResult",
|
|
26
|
-
WISHLIST_WIDGET_ALERT: "WishlistWidgetAlert"
|
|
27
|
-
};
|
|
28
19
|
const ELEMENT_ID = {
|
|
29
20
|
PRODUCT_REVIEW: {
|
|
30
21
|
ELEMENT_WIDGET: "product-review-widget"
|
|
@@ -2224,19 +2215,19 @@ const SearchIconWidget = (props) => {
|
|
|
2224
2215
|
let searchViewMoreResultComponent = null;
|
|
2225
2216
|
React__default.Children.map(children, (child) => {
|
|
2226
2217
|
if (React__default.isValidElement(child) && isFunction(child.type)) {
|
|
2227
|
-
const {
|
|
2228
|
-
switch (
|
|
2229
|
-
case
|
|
2230
|
-
productCardsComponent =
|
|
2218
|
+
const { productCard, suggestionKeywordList, otherIndexList, searchViewMoreResult } = (child == null ? void 0 : child.props) || {};
|
|
2219
|
+
switch (true) {
|
|
2220
|
+
case isFunction(productCard):
|
|
2221
|
+
productCardsComponent = productCard;
|
|
2231
2222
|
break;
|
|
2232
|
-
case
|
|
2233
|
-
suggestionKeywordListsComponent =
|
|
2223
|
+
case isFunction(suggestionKeywordList):
|
|
2224
|
+
suggestionKeywordListsComponent = suggestionKeywordList;
|
|
2234
2225
|
break;
|
|
2235
|
-
case
|
|
2236
|
-
otherIndexListsComponent =
|
|
2226
|
+
case isFunction(otherIndexList):
|
|
2227
|
+
otherIndexListsComponent = otherIndexList;
|
|
2237
2228
|
break;
|
|
2238
|
-
case
|
|
2239
|
-
searchViewMoreResultComponent =
|
|
2229
|
+
case isFunction(searchViewMoreResult):
|
|
2230
|
+
searchViewMoreResultComponent = searchViewMoreResult;
|
|
2240
2231
|
break;
|
|
2241
2232
|
}
|
|
2242
2233
|
}
|
|
@@ -2679,9 +2670,13 @@ const SearchResultWidget = (props) => {
|
|
|
2679
2670
|
const { collectionId } = data || {};
|
|
2680
2671
|
let productCardsComponent = null;
|
|
2681
2672
|
React__default.Children.map(children, (child) => {
|
|
2682
|
-
if (React__default.isValidElement(child) && isFunction(child.type)
|
|
2683
|
-
const {
|
|
2684
|
-
|
|
2673
|
+
if (React__default.isValidElement(child) && isFunction(child.type)) {
|
|
2674
|
+
const { productCard } = (child == null ? void 0 : child.props) || {};
|
|
2675
|
+
switch (true) {
|
|
2676
|
+
case isFunction(productCard):
|
|
2677
|
+
productCardsComponent = productCard;
|
|
2678
|
+
break;
|
|
2679
|
+
}
|
|
2685
2680
|
}
|
|
2686
2681
|
});
|
|
2687
2682
|
const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
|
|
@@ -3955,19 +3950,19 @@ const SearchWidget = (props) => {
|
|
|
3955
3950
|
let searchViewMoreResultComponent = null;
|
|
3956
3951
|
React__default.Children.map(children, (child) => {
|
|
3957
3952
|
if (React__default.isValidElement(child) && isFunction(child.type)) {
|
|
3958
|
-
const {
|
|
3959
|
-
switch (
|
|
3960
|
-
case
|
|
3961
|
-
productCardsComponent =
|
|
3953
|
+
const { productCard, suggestionKeywordList, otherIndexList, searchViewMoreResult } = (child == null ? void 0 : child.props) || {};
|
|
3954
|
+
switch (true) {
|
|
3955
|
+
case isFunction(productCard):
|
|
3956
|
+
productCardsComponent = productCard;
|
|
3962
3957
|
break;
|
|
3963
|
-
case
|
|
3964
|
-
suggestionKeywordListsComponent =
|
|
3958
|
+
case isFunction(suggestionKeywordList):
|
|
3959
|
+
suggestionKeywordListsComponent = suggestionKeywordList;
|
|
3965
3960
|
break;
|
|
3966
|
-
case
|
|
3967
|
-
otherIndexListsComponent =
|
|
3961
|
+
case isFunction(otherIndexList):
|
|
3962
|
+
otherIndexListsComponent = otherIndexList;
|
|
3968
3963
|
break;
|
|
3969
|
-
case
|
|
3970
|
-
searchViewMoreResultComponent =
|
|
3964
|
+
case isFunction(searchViewMoreResult):
|
|
3965
|
+
searchViewMoreResultComponent = searchViewMoreResult;
|
|
3971
3966
|
break;
|
|
3972
3967
|
}
|
|
3973
3968
|
}
|