@sledge-app/react-instant-search 0.0.62 → 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 -33
- 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,10 +2670,13 @@ const SearchResultWidget = (props) => {
|
|
|
2679
2670
|
const { collectionId } = data || {};
|
|
2680
2671
|
let productCardsComponent = null;
|
|
2681
2672
|
React__default.Children.map(children, (child) => {
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
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
|
+
}
|
|
2686
2680
|
}
|
|
2687
2681
|
});
|
|
2688
2682
|
const [isFirstLoading, setIsFirstLoading] = React__default.useState(true);
|
|
@@ -3956,19 +3950,19 @@ const SearchWidget = (props) => {
|
|
|
3956
3950
|
let searchViewMoreResultComponent = null;
|
|
3957
3951
|
React__default.Children.map(children, (child) => {
|
|
3958
3952
|
if (React__default.isValidElement(child) && isFunction(child.type)) {
|
|
3959
|
-
const {
|
|
3960
|
-
switch (
|
|
3961
|
-
case
|
|
3962
|
-
productCardsComponent =
|
|
3953
|
+
const { productCard, suggestionKeywordList, otherIndexList, searchViewMoreResult } = (child == null ? void 0 : child.props) || {};
|
|
3954
|
+
switch (true) {
|
|
3955
|
+
case isFunction(productCard):
|
|
3956
|
+
productCardsComponent = productCard;
|
|
3963
3957
|
break;
|
|
3964
|
-
case
|
|
3965
|
-
suggestionKeywordListsComponent =
|
|
3958
|
+
case isFunction(suggestionKeywordList):
|
|
3959
|
+
suggestionKeywordListsComponent = suggestionKeywordList;
|
|
3966
3960
|
break;
|
|
3967
|
-
case
|
|
3968
|
-
otherIndexListsComponent =
|
|
3961
|
+
case isFunction(otherIndexList):
|
|
3962
|
+
otherIndexListsComponent = otherIndexList;
|
|
3969
3963
|
break;
|
|
3970
|
-
case
|
|
3971
|
-
searchViewMoreResultComponent =
|
|
3964
|
+
case isFunction(searchViewMoreResult):
|
|
3965
|
+
searchViewMoreResultComponent = searchViewMoreResult;
|
|
3972
3966
|
break;
|
|
3973
3967
|
}
|
|
3974
3968
|
}
|