@sledge-app/react-instant-search 1.0.13 → 1.0.15

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.
@@ -119,7 +119,8 @@ const SELECTOR = {
119
119
  const DEFAULT_SEARCH_RESULT_URL = "/apps/sledge/search";
120
120
  const DEFAULT_WISHLIST_URL = "/apps/sledge/wishlist";
121
121
  const DEFAULT_QUERY_PARAM = {
122
- KEYWORD: "q"
122
+ KEYWORD: "q",
123
+ SHARE_ID: "share"
123
124
  };
124
125
  const ELEMENT_ID = {
125
126
  PRODUCT_REVIEW: {
@@ -3065,7 +3066,9 @@ const SuggestionKeywordLists = ({
3065
3066
  keywords,
3066
3067
  isComponentJsVersion = false,
3067
3068
  showPopupComponent,
3068
- setShowPopupComponent
3069
+ setShowPopupComponent,
3070
+ urlSearchResult = "",
3071
+ query
3069
3072
  }) => {
3070
3073
  var _a;
3071
3074
  if (ListsComponent) {
@@ -3078,13 +3081,14 @@ const SuggestionKeywordLists = ({
3078
3081
  const ListsProps = { keywords, showPopupComponent, setShowPopupComponent, setRenderSearchResult };
3079
3082
  return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: isComponentJsVersion ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: ListsComponent({ ...ListsProps }) } }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ListsComponent, { ...ListsProps }) });
3080
3083
  } else {
3084
+ const queryKeyword = (query == null ? void 0 : query.keyword) ? query.keyword : DEFAULT_QUERY_PARAM.KEYWORD;
3081
3085
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3082
3086
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sledge-instant-search__icon-widget-search-form-result-title", children: "Suggestions" }),
3083
3087
  /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "sledge-instant-search__icon-widget-search-form-result-list", children: keywords == null ? void 0 : keywords.map((keyword, index) => {
3084
3088
  return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
3085
3089
  "a",
3086
3090
  {
3087
- href: `${DEFAULT_SEARCH_RESULT_URL}?q=${keyword}`,
3091
+ href: `${urlSearchResult || DEFAULT_SEARCH_RESULT_URL}?${queryKeyword}=${keyword}`,
3088
3092
  className: "sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",
3089
3093
  children: [
3090
3094
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchIcon, { width: 12, height: 12, color: "#677487" }),
@@ -3103,7 +3107,7 @@ const SearchViewMoreResult = ({
3103
3107
  isComponentJsVersion = false,
3104
3108
  showPopupComponent,
3105
3109
  setShowPopupComponent,
3106
- urlSearchResult = DEFAULT_SEARCH_RESULT_URL,
3110
+ urlSearchResult = "",
3107
3111
  query
3108
3112
  }) => {
3109
3113
  var _a;
@@ -3118,7 +3122,7 @@ const SearchViewMoreResult = ({
3118
3122
  return /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: isComponentJsVersion ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: Component({ ...ComponentProps }) } }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...ComponentProps }) });
3119
3123
  } else {
3120
3124
  const queryKeyword = (query == null ? void 0 : query.keyword) ? query.keyword : DEFAULT_QUERY_PARAM.KEYWORD;
3121
- return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: `${urlSearchResult}?${queryKeyword}=${keyword}`, className: "sledge-instant-search__icon-widget-button-more", children: "View More Result" });
3125
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: `${urlSearchResult || DEFAULT_SEARCH_RESULT_URL}?${queryKeyword}=${keyword}`, className: "sledge-instant-search__icon-widget-button-more", children: "View More Result" });
3122
3126
  }
3123
3127
  };
3124
3128
  const Global = {
@@ -3362,7 +3366,9 @@ const SearchIconWidgetPopup = () => {
3362
3366
  keywords: suggestionSettings[suggestionIndex].keywords.list,
3363
3367
  isComponentJsVersion: handleFunctions.isJsVersion,
3364
3368
  showPopupComponent: showInfo,
3365
- setShowPopupComponent: setShowInfo
3369
+ setShowPopupComponent: setShowInfo,
3370
+ urlSearchResult,
3371
+ query: handleFunctions.query
3366
3372
  }
3367
3373
  ) : null,
3368
3374
  searchResultOther && searchResultOther.map((item, index) => {
@@ -5022,7 +5028,9 @@ const SearchWidget = (props) => {
5022
5028
  {
5023
5029
  listsComponent: suggestionKeywordListsComponent,
5024
5030
  keywords: suggestionSettings[suggestionIndex].keywords.list,
5025
- isComponentJsVersion: isJsVersion
5031
+ isComponentJsVersion: isJsVersion,
5032
+ urlSearchResult,
5033
+ query
5026
5034
  }
5027
5035
  ) : null,
5028
5036
  searchResultOther.map((item, index) => {