@bonlineza/luxity-lib 2.38.0 → 2.38.1
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/CurrencySelect.js +27 -27
- package/GraphQLDropdownSelector.js +8 -8
- package/LuxityDesktopHeader.js +117 -79
- package/LuxityFooter.js +28 -27
- package/LuxityGraphQLDropdownSelector.js +8 -8
- package/LuxityMobileHeader.js +133 -95
- package/LuxitySideNav.js +27 -27
- package/MaterialSelector.js +8 -8
- package/ModelSelector.js +8 -8
- package/Tooltip.js +27 -27
- package/build/bundle.css +1 -1
- package/build/bundle.js +159 -108
- package/package.json +1 -1
package/build/bundle.js
CHANGED
|
@@ -1565,10 +1565,10 @@
|
|
|
1565
1565
|
var relativeInlineStyle = styled.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1566
1566
|
var topMiddleBodyStyle = styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
1567
1567
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
1568
|
-
return styled.css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props
|
|
1568
|
+
return styled.css(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n /*Bottom Arrow*/\n top: 100%; /* At the bottom of the tooltip */\n left: calc(50% - ", ");\n border-width: ", ";\n border-style: solid;\n border-color: ", " transparent transparent transparent;\n"])), props.$apexWidth, props.$apexWidth, props.theme.colors.base);
|
|
1569
1569
|
};
|
|
1570
1570
|
var getBottomMiddleBodyStyle = function getBottomMiddleBodyStyle(props) {
|
|
1571
|
-
return styled.css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props
|
|
1571
|
+
return styled.css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n left: calc(50% - ", " / 2);\n"])), props.$bodyWidth);
|
|
1572
1572
|
};
|
|
1573
1573
|
var getBottomMiddleArrowAfterStyle = function getBottomMiddleArrowAfterStyle(props) {
|
|
1574
1574
|
return styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /*Top Arrow*/\n bottom: 100%; /* At the top of the tooltip */\n top: initial;\n left: 50%;\n border-style: solid;\n border-color: transparent transparent ", " transparent;\n"])), props.theme.colors.base);
|
|
@@ -1578,10 +1578,10 @@
|
|
|
1578
1578
|
|
|
1579
1579
|
var getBodyStyle = function getBodyStyle() {
|
|
1580
1580
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1581
|
-
var _props
|
|
1582
|
-
toolTipPosition = _props
|
|
1581
|
+
var _props$$toolTipPositi = props.$toolTipPosition,
|
|
1582
|
+
$toolTipPosition = _props$$toolTipPositi === void 0 ? '' : _props$$toolTipPositi;
|
|
1583
1583
|
|
|
1584
|
-
switch (toolTipPosition) {
|
|
1584
|
+
switch ($toolTipPosition) {
|
|
1585
1585
|
case 'top':
|
|
1586
1586
|
return topMiddleBodyStyle;
|
|
1587
1587
|
|
|
@@ -1595,9 +1595,9 @@
|
|
|
1595
1595
|
|
|
1596
1596
|
var getAfterStyling = function getAfterStyling() {
|
|
1597
1597
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1598
|
-
var toolTipPosition = props
|
|
1598
|
+
var $toolTipPosition = props.$toolTipPosition;
|
|
1599
1599
|
|
|
1600
|
-
switch (toolTipPosition) {
|
|
1600
|
+
switch ($toolTipPosition) {
|
|
1601
1601
|
case 'top':
|
|
1602
1602
|
return getTopMiddleArrowAfterStyle(props);
|
|
1603
1603
|
|
|
@@ -1610,7 +1610,7 @@
|
|
|
1610
1610
|
};
|
|
1611
1611
|
|
|
1612
1612
|
var Body$1 = styled__default.span(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
1613
|
-
return props
|
|
1613
|
+
return props.$bodyWidth;
|
|
1614
1614
|
}, function (props) {
|
|
1615
1615
|
return props.theme.colors.base || 'black';
|
|
1616
1616
|
}, function (props) {
|
|
@@ -1622,33 +1622,33 @@
|
|
|
1622
1622
|
var _templateObject$k;
|
|
1623
1623
|
var Container = styled__default.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteral(["\n ", ";\n cursor: pointer;\n &:hover ", " {\n opacity: 1;\n visibility: visible;\n }\n"])), relativeInlineStyle, Body$1);
|
|
1624
1624
|
|
|
1625
|
+
/* eslint-disable react/require-default-props */
|
|
1626
|
+
|
|
1625
1627
|
var Tooltip = function Tooltip(_ref) {
|
|
1626
|
-
var children = _ref.children,
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1628
|
+
var _ref$children = _ref.children,
|
|
1629
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
1630
|
+
_ref$toolTipText = _ref.toolTipText,
|
|
1631
|
+
toolTipText = _ref$toolTipText === void 0 ? '' : _ref$toolTipText,
|
|
1632
|
+
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
1633
|
+
toolTipPosition = _ref$toolTipPosition === void 0 ? 'top' : _ref$toolTipPosition,
|
|
1634
|
+
_ref$bodyWidth = _ref.bodyWidth,
|
|
1635
|
+
bodyWidth = _ref$bodyWidth === void 0 ? '8em' : _ref$bodyWidth,
|
|
1636
|
+
_ref$apexWidth = _ref.apexWidth,
|
|
1637
|
+
apexWidth = _ref$apexWidth === void 0 ? '5px' : _ref$apexWidth,
|
|
1638
|
+
_ref$containerClassNa = _ref.containerClassName,
|
|
1639
|
+
containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
|
|
1640
|
+
_ref$bodyClassName = _ref.bodyClassName,
|
|
1641
|
+
bodyClassName = _ref$bodyClassName === void 0 ? '' : _ref$bodyClassName;
|
|
1633
1642
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
1634
1643
|
className: containerClassName
|
|
1635
1644
|
}, children, /*#__PURE__*/React__default.createElement(Body$1, {
|
|
1636
|
-
toolTipPosition: toolTipPosition,
|
|
1637
|
-
bodyWidth: bodyWidth,
|
|
1638
|
-
apexWidth: apexWidth,
|
|
1645
|
+
$toolTipPosition: toolTipPosition,
|
|
1646
|
+
$bodyWidth: bodyWidth,
|
|
1647
|
+
$apexWidth: apexWidth,
|
|
1639
1648
|
className: bodyClassName
|
|
1640
1649
|
}, toolTipText));
|
|
1641
1650
|
};
|
|
1642
1651
|
|
|
1643
|
-
Tooltip.defaultProps = {
|
|
1644
|
-
children: null,
|
|
1645
|
-
toolTipText: '',
|
|
1646
|
-
toolTipPosition: 'top',
|
|
1647
|
-
bodyWidth: '8em',
|
|
1648
|
-
apexWidth: '5px',
|
|
1649
|
-
containerClassName: '',
|
|
1650
|
-
bodyClassName: ''
|
|
1651
|
-
};
|
|
1652
1652
|
var Tooltip$1 = themed(Tooltip);
|
|
1653
1653
|
|
|
1654
1654
|
var _templateObject$l, _templateObject2$2;
|
|
@@ -15500,6 +15500,7 @@
|
|
|
15500
15500
|
track: link === null || link === void 0 ? void 0 : link.track,
|
|
15501
15501
|
target: link.target
|
|
15502
15502
|
}, link.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
15503
|
+
key: link.label,
|
|
15503
15504
|
className: "footer__text"
|
|
15504
15505
|
}, link.label);
|
|
15505
15506
|
})));
|
|
@@ -15803,7 +15804,7 @@
|
|
|
15803
15804
|
};
|
|
15804
15805
|
|
|
15805
15806
|
var SearchResults = function SearchResults(_ref) {
|
|
15806
|
-
var _searchResults$brands, _searchResults$produc,
|
|
15807
|
+
var _searchResults$brands, _searchResults$produc, _initialSearchData$tr, _initialSearchData$la, _limitBrands, _limitBrands2, _initialSearchData$la2, _searchResults$produc2;
|
|
15807
15808
|
|
|
15808
15809
|
var searchValue = _ref.searchValue,
|
|
15809
15810
|
searchResults = _ref.searchResults,
|
|
@@ -15817,7 +15818,10 @@
|
|
|
15817
15818
|
currency = _ref.currency,
|
|
15818
15819
|
currencySymbol = _ref.currencySymbol,
|
|
15819
15820
|
onProductSearchResultClick = _ref.onProductSearchResultClick,
|
|
15820
|
-
onBrandSearchResultClick = _ref.onBrandSearchResultClick
|
|
15821
|
+
onBrandSearchResultClick = _ref.onBrandSearchResultClick,
|
|
15822
|
+
onCreateInterests = _ref.onCreateInterests,
|
|
15823
|
+
noResultsImage = _ref.noResultsImage,
|
|
15824
|
+
showNoResults = _ref.showNoResults;
|
|
15821
15825
|
|
|
15822
15826
|
var _useState = React.useState(false),
|
|
15823
15827
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -15835,15 +15839,16 @@
|
|
|
15835
15839
|
window.removeEventListener('resize', checkIfMobile);
|
|
15836
15840
|
};
|
|
15837
15841
|
}, []);
|
|
15838
|
-
var
|
|
15839
|
-
var hasResults = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$
|
|
15842
|
+
var hasSearchBeenPerformed = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().length) >= 3;
|
|
15843
|
+
var hasResults = (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$brands = searchResults.brands) === null || _searchResults$brands === void 0 ? void 0 : _searchResults$brands.length) > 0 || (searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc = searchResults.products) === null || _searchResults$produc === void 0 ? void 0 : _searchResults$produc.length) > 0;
|
|
15840
15844
|
var hasInitialData = (initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$tr = initialSearchData.trending_brands) === null || _initialSearchData$tr === void 0 ? void 0 : _initialSearchData$tr.length) > 0 || (initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la = initialSearchData.latest_products) === null || _initialSearchData$la === void 0 ? void 0 : _initialSearchData$la.length) > 0;
|
|
15845
|
+
var shouldShowInitialData = isSearchFocused && (!hasSearchBeenPerformed || !hasResults && !showNoResults);
|
|
15841
15846
|
|
|
15842
|
-
if (!
|
|
15847
|
+
if (!isSearchFocused) {
|
|
15843
15848
|
return null;
|
|
15844
15849
|
}
|
|
15845
15850
|
|
|
15846
|
-
if (!
|
|
15851
|
+
if (!hasResults && !hasInitialData && !showNoResults) {
|
|
15847
15852
|
return null;
|
|
15848
15853
|
}
|
|
15849
15854
|
|
|
@@ -15924,7 +15929,36 @@
|
|
|
15924
15929
|
}
|
|
15925
15930
|
|
|
15926
15931
|
return brands;
|
|
15927
|
-
};
|
|
15932
|
+
}; // Show no results state
|
|
15933
|
+
|
|
15934
|
+
|
|
15935
|
+
if (showNoResults) {
|
|
15936
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
15937
|
+
className: "search-results",
|
|
15938
|
+
ref: searchResultsRef
|
|
15939
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
15940
|
+
className: "search-results__no-results"
|
|
15941
|
+
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
15942
|
+
className: "search-results__header"
|
|
15943
|
+
}, "TOP MATCHES"), /*#__PURE__*/React__default.createElement("div", {
|
|
15944
|
+
className: "search-results__no-results-content"
|
|
15945
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
15946
|
+
className: "search-results__no-results-image"
|
|
15947
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
15948
|
+
src: noResultsImage,
|
|
15949
|
+
alt: "No results"
|
|
15950
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
15951
|
+
className: "search-results__no-results-text"
|
|
15952
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
15953
|
+
className: "search-results__no-results-title"
|
|
15954
|
+
}, "There are currently no products in stock that match your selection"), /*#__PURE__*/React__default.createElement("p", {
|
|
15955
|
+
className: "search-results__no-results-description"
|
|
15956
|
+
}, "Create an interest now and receive instant notifications as your interests list."))), /*#__PURE__*/React__default.createElement("button", {
|
|
15957
|
+
type: "button",
|
|
15958
|
+
className: "search-results__create-interest-button",
|
|
15959
|
+
onClick: onCreateInterests
|
|
15960
|
+
}, "Create Interests")));
|
|
15961
|
+
}
|
|
15928
15962
|
|
|
15929
15963
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
15930
15964
|
className: "search-results",
|
|
@@ -15981,7 +16015,7 @@
|
|
|
15981
16015
|
}
|
|
15982
16016
|
}, "View all items")), /*#__PURE__*/React__default.createElement("div", {
|
|
15983
16017
|
className: "search-results__product-list"
|
|
15984
|
-
}, shouldShowInitialData ? initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la2 = initialSearchData.latest_products) === null || _initialSearchData$la2 === void 0 ? void 0 : _initialSearchData$la2.map(renderProductCard) : searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$
|
|
16018
|
+
}, shouldShowInitialData ? initialSearchData === null || initialSearchData === void 0 ? void 0 : (_initialSearchData$la2 = initialSearchData.latest_products) === null || _initialSearchData$la2 === void 0 ? void 0 : _initialSearchData$la2.map(renderProductCard) : searchResults === null || searchResults === void 0 ? void 0 : (_searchResults$produc2 = searchResults.products) === null || _searchResults$produc2 === void 0 ? void 0 : _searchResults$produc2.map(renderProductCard)), /*#__PURE__*/React__default.createElement("button", {
|
|
15985
16019
|
type: "button",
|
|
15986
16020
|
className: "search-results__view-all-button",
|
|
15987
16021
|
onClick: function onClick() {
|
|
@@ -16024,7 +16058,8 @@
|
|
|
16024
16058
|
var endpoint = _ref.endpoint,
|
|
16025
16059
|
onSearchLoading = _ref.onSearchLoading,
|
|
16026
16060
|
currency = _ref.currency,
|
|
16027
|
-
onSearchPreview = _ref.onSearchPreview
|
|
16061
|
+
onSearchPreview = _ref.onSearchPreview,
|
|
16062
|
+
onNoResults = _ref.onNoResults;
|
|
16028
16063
|
var currentSearchRequestToken = React.useRef(null);
|
|
16029
16064
|
var debounce = React.useCallback(function (func, wait) {
|
|
16030
16065
|
var timeout;
|
|
@@ -16061,7 +16096,12 @@
|
|
|
16061
16096
|
setSearchResults({
|
|
16062
16097
|
brands: [],
|
|
16063
16098
|
products: []
|
|
16064
|
-
});
|
|
16099
|
+
}); // Reset no results state when clearing search
|
|
16100
|
+
|
|
16101
|
+
if (typeof onNoResults === 'function') {
|
|
16102
|
+
onNoResults(false);
|
|
16103
|
+
}
|
|
16104
|
+
|
|
16065
16105
|
return;
|
|
16066
16106
|
} // Cancel any ongoing search request to prevent race conditions
|
|
16067
16107
|
|
|
@@ -16072,7 +16112,12 @@
|
|
|
16072
16112
|
|
|
16073
16113
|
|
|
16074
16114
|
var newSearchToken = axios.CancelToken.source();
|
|
16075
|
-
currentSearchRequestToken.current = newSearchToken; //
|
|
16115
|
+
currentSearchRequestToken.current = newSearchToken; // Reset no results state when starting new search (user is typing)
|
|
16116
|
+
|
|
16117
|
+
if (typeof onNoResults === 'function') {
|
|
16118
|
+
onNoResults(false);
|
|
16119
|
+
} // Set loading to true when starting the search request
|
|
16120
|
+
|
|
16076
16121
|
|
|
16077
16122
|
if (typeof onSearchLoading === 'function') {
|
|
16078
16123
|
onSearchLoading(true);
|
|
@@ -16132,7 +16177,13 @@
|
|
|
16132
16177
|
products: products,
|
|
16133
16178
|
total: totalResults
|
|
16134
16179
|
};
|
|
16135
|
-
setSearchResults(searchResults);
|
|
16180
|
+
setSearchResults(searchResults); // Check if we have no results (empty aggregations)
|
|
16181
|
+
|
|
16182
|
+
var hasNoResults = brandsData.length === 0 && productsData.length === 0;
|
|
16183
|
+
|
|
16184
|
+
if (typeof onNoResults === 'function') {
|
|
16185
|
+
onNoResults(hasNoResults);
|
|
16186
|
+
}
|
|
16136
16187
|
|
|
16137
16188
|
if (typeof onSearchPreview === 'function') {
|
|
16138
16189
|
var hasResults = brands.length > 0 || products.length > 0;
|
|
@@ -16142,11 +16193,7 @@
|
|
|
16142
16193
|
});
|
|
16143
16194
|
}
|
|
16144
16195
|
|
|
16145
|
-
currentSearchRequestToken.current = null;
|
|
16146
|
-
|
|
16147
|
-
if (typeof onSearchLoading === 'function') {
|
|
16148
|
-
onSearchLoading(false);
|
|
16149
|
-
}
|
|
16196
|
+
currentSearchRequestToken.current = null;
|
|
16150
16197
|
}
|
|
16151
16198
|
}).catch(function (error) {
|
|
16152
16199
|
if (!axios.isCancel(error)) {
|
|
@@ -16154,14 +16201,10 @@
|
|
|
16154
16201
|
brands: [],
|
|
16155
16202
|
products: []
|
|
16156
16203
|
});
|
|
16157
|
-
currentSearchRequestToken.current = null;
|
|
16158
|
-
|
|
16159
|
-
if (typeof onSearchLoading === 'function') {
|
|
16160
|
-
onSearchLoading(false);
|
|
16161
|
-
}
|
|
16204
|
+
currentSearchRequestToken.current = null;
|
|
16162
16205
|
}
|
|
16163
16206
|
});
|
|
16164
|
-
}, [endpoint, currency, onSearchPreview, onSearchLoading]);
|
|
16207
|
+
}, [endpoint, currency, onSearchPreview, onSearchLoading, onNoResults]);
|
|
16165
16208
|
var debouncedSearch = React.useMemo(function () {
|
|
16166
16209
|
return debounce(function (searchQuery, setSearchResults) {
|
|
16167
16210
|
return performSearch(searchQuery, setSearchResults);
|
|
@@ -16266,22 +16309,6 @@
|
|
|
16266
16309
|
}
|
|
16267
16310
|
}, [searchValue, immediateSearch, setIsSearchFocused, setSearchValue]);
|
|
16268
16311
|
};
|
|
16269
|
-
var useSearchUrlQuery = function useSearchUrlQuery(setSearchValue, debouncedSearch) {
|
|
16270
|
-
var hasProcessedUrlQuery = React.useRef(false);
|
|
16271
|
-
React.useEffect(function () {
|
|
16272
|
-
if (hasProcessedUrlQuery.current) return;
|
|
16273
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
16274
|
-
var queryParam = urlParams.get('q');
|
|
16275
|
-
var isSearchPage = window.location.pathname.includes('/search');
|
|
16276
|
-
|
|
16277
|
-
if (queryParam && queryParam.trim() !== '' && isSearchPage) {
|
|
16278
|
-
hasProcessedUrlQuery.current = true;
|
|
16279
|
-
setSearchValue(queryParam);
|
|
16280
|
-
debouncedSearch(queryParam);
|
|
16281
|
-
}
|
|
16282
|
-
}, [setSearchValue, debouncedSearch]);
|
|
16283
|
-
return hasProcessedUrlQuery;
|
|
16284
|
-
};
|
|
16285
16312
|
|
|
16286
16313
|
var removeCategoryByName = function removeCategoryByName(categories, name) {
|
|
16287
16314
|
var _categories$filter;
|
|
@@ -16331,17 +16358,9 @@
|
|
|
16331
16358
|
isExclusive = _ref.isExclusive,
|
|
16332
16359
|
shop = _ref.shop,
|
|
16333
16360
|
app = _ref.app,
|
|
16334
|
-
categoryConfig = _ref.categoryConfig
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
endpoint: endpoint,
|
|
16338
|
-
onSearchLoading: onSearchLoading,
|
|
16339
|
-
currency: currency,
|
|
16340
|
-
onSearchPreview: onSearchPreview
|
|
16341
|
-
}),
|
|
16342
|
-
fetchInitialSearchData = _useSearch.fetchInitialSearchData,
|
|
16343
|
-
createDebouncedSearch = _useSearch.createDebouncedSearch,
|
|
16344
|
-
createImmediateSearch = _useSearch.createImmediateSearch;
|
|
16361
|
+
categoryConfig = _ref.categoryConfig,
|
|
16362
|
+
onCreateInterests = _ref.onCreateInterests,
|
|
16363
|
+
noResultsImage = _ref.noResultsImage;
|
|
16345
16364
|
|
|
16346
16365
|
var _useState = React.useState(''),
|
|
16347
16366
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -16392,14 +16411,30 @@
|
|
|
16392
16411
|
cachedResults = _useState16[0],
|
|
16393
16412
|
setCachedResults = _useState16[1];
|
|
16394
16413
|
|
|
16414
|
+
var _useState17 = React.useState(false),
|
|
16415
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
16416
|
+
showNoResults = _useState18[0],
|
|
16417
|
+
setShowNoResults = _useState18[1];
|
|
16418
|
+
|
|
16395
16419
|
var searchResultsRef = React.useRef(null);
|
|
16420
|
+
|
|
16421
|
+
var _useSearch = useSearch({
|
|
16422
|
+
endpoint: endpoint,
|
|
16423
|
+
onSearchLoading: onSearchLoading,
|
|
16424
|
+
currency: currency,
|
|
16425
|
+
onSearchPreview: onSearchPreview,
|
|
16426
|
+
onNoResults: setShowNoResults
|
|
16427
|
+
}),
|
|
16428
|
+
fetchInitialSearchData = _useSearch.fetchInitialSearchData,
|
|
16429
|
+
createDebouncedSearch = _useSearch.createDebouncedSearch,
|
|
16430
|
+
createImmediateSearch = _useSearch.createImmediateSearch;
|
|
16431
|
+
|
|
16396
16432
|
var debouncedSearch = createDebouncedSearch(function (results) {
|
|
16397
16433
|
setSearchResults(results);
|
|
16398
16434
|
setCachedResults(results);
|
|
16399
16435
|
});
|
|
16400
16436
|
var immediateSearch = createImmediateSearch(setSearchValue, setSearchResults, onSearchSubmit);
|
|
16401
16437
|
var handleChange = useSearchInputChange(setSearchValue, setIsSearchFocused, debouncedSearch, setSearchResults, setCachedResults);
|
|
16402
|
-
useSearchUrlQuery(setSearchValue, debouncedSearch);
|
|
16403
16438
|
useSearchClickOutside(searchResultsRef, searchResults, setCachedResults, setIsSearchFocused, setSearchResults);
|
|
16404
16439
|
|
|
16405
16440
|
var handleSearchClick = function handleSearchClick() {
|
|
@@ -16526,6 +16561,7 @@
|
|
|
16526
16561
|
products: []
|
|
16527
16562
|
});
|
|
16528
16563
|
setIsSearchFocused(false);
|
|
16564
|
+
setShowNoResults(false);
|
|
16529
16565
|
},
|
|
16530
16566
|
searchResultsRef: searchResultsRef,
|
|
16531
16567
|
onSearchSubmit: onSearchSubmit,
|
|
@@ -16536,7 +16572,10 @@
|
|
|
16536
16572
|
currency: currency,
|
|
16537
16573
|
currencySymbol: currencySymbol,
|
|
16538
16574
|
onProductSearchResultClick: onProductSearchResultClick,
|
|
16539
|
-
onBrandSearchResultClick: onBrandSearchResultClick
|
|
16575
|
+
onBrandSearchResultClick: onBrandSearchResultClick,
|
|
16576
|
+
onCreateInterests: onCreateInterests,
|
|
16577
|
+
noResultsImage: noResultsImage,
|
|
16578
|
+
showNoResults: showNoResults
|
|
16540
16579
|
}), /*#__PURE__*/React__default.createElement("nav", {
|
|
16541
16580
|
className: "navbar__nav-links navbar__nav-links--wrap"
|
|
16542
16581
|
}, renderDropdownLinks(), !!stores.length && /*#__PURE__*/React__default.createElement("li", {
|
|
@@ -17254,61 +17293,69 @@
|
|
|
17254
17293
|
shop = _ref.shop,
|
|
17255
17294
|
app = _ref.app,
|
|
17256
17295
|
categoryConfig = _ref.categoryConfig,
|
|
17257
|
-
name = _ref.name
|
|
17296
|
+
name = _ref.name,
|
|
17297
|
+
onCreateInterests = _ref.onCreateInterests,
|
|
17298
|
+
noResultsImage = _ref.noResultsImage;
|
|
17299
|
+
|
|
17300
|
+
var _useState = React.useState(false),
|
|
17301
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17302
|
+
showNoResults = _useState2[0],
|
|
17303
|
+
setShowNoResults = _useState2[1];
|
|
17258
17304
|
|
|
17259
17305
|
var _useSearch = useSearch({
|
|
17260
17306
|
endpoint: endpoint,
|
|
17261
17307
|
onSearchLoading: onSearchLoading,
|
|
17262
17308
|
currency: currency,
|
|
17263
|
-
onSearchPreview: onSearchPreview
|
|
17309
|
+
onSearchPreview: onSearchPreview,
|
|
17310
|
+
onNoResults: setShowNoResults
|
|
17264
17311
|
}),
|
|
17265
17312
|
fetchInitialSearchData = _useSearch.fetchInitialSearchData,
|
|
17266
17313
|
createDebouncedSearch = _useSearch.createDebouncedSearch,
|
|
17267
17314
|
createImmediateSearch = _useSearch.createImmediateSearch;
|
|
17268
17315
|
|
|
17269
|
-
var
|
|
17270
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17271
|
-
searchValue = _useState2[0],
|
|
17272
|
-
setSearchValue = _useState2[1];
|
|
17273
|
-
|
|
17274
|
-
var _useState3 = React.useState(false),
|
|
17316
|
+
var _useState3 = React.useState(''),
|
|
17275
17317
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
17276
|
-
|
|
17277
|
-
|
|
17318
|
+
searchValue = _useState4[0],
|
|
17319
|
+
setSearchValue = _useState4[1];
|
|
17278
17320
|
|
|
17279
17321
|
var _useState5 = React.useState(false),
|
|
17280
17322
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
17281
|
-
|
|
17282
|
-
|
|
17323
|
+
showSearchBar = _useState6[0],
|
|
17324
|
+
setShowSearchbar = _useState6[1];
|
|
17283
17325
|
|
|
17284
|
-
var _useState7 = React.useState(
|
|
17285
|
-
brands: [],
|
|
17286
|
-
products: []
|
|
17287
|
-
}),
|
|
17326
|
+
var _useState7 = React.useState(false),
|
|
17288
17327
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
17289
|
-
|
|
17290
|
-
|
|
17328
|
+
showSideNav = _useState8[0],
|
|
17329
|
+
setShowSideNav = _useState8[1];
|
|
17291
17330
|
|
|
17292
17331
|
var _useState9 = React.useState({
|
|
17293
17332
|
brands: [],
|
|
17294
17333
|
products: []
|
|
17295
17334
|
}),
|
|
17296
17335
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
17297
|
-
|
|
17298
|
-
|
|
17336
|
+
searchResults = _useState10[0],
|
|
17337
|
+
setSearchResults = _useState10[1];
|
|
17299
17338
|
|
|
17300
|
-
var _useState11 = React.useState(
|
|
17339
|
+
var _useState11 = React.useState({
|
|
17340
|
+
brands: [],
|
|
17341
|
+
products: []
|
|
17342
|
+
}),
|
|
17301
17343
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
17302
|
-
|
|
17303
|
-
|
|
17344
|
+
cachedResults = _useState12[0],
|
|
17345
|
+
setCachedResults = _useState12[1];
|
|
17304
17346
|
|
|
17305
|
-
var _useState13 = React.useState(
|
|
17347
|
+
var _useState13 = React.useState(false),
|
|
17348
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
17349
|
+
isSearchFocused = _useState14[0],
|
|
17350
|
+
setIsSearchFocused = _useState14[1];
|
|
17351
|
+
|
|
17352
|
+
var _useState15 = React.useState({
|
|
17306
17353
|
trending_brands: [],
|
|
17307
17354
|
latest_products: []
|
|
17308
17355
|
}),
|
|
17309
|
-
|
|
17310
|
-
initialSearchView =
|
|
17311
|
-
setInitialSearchView =
|
|
17356
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
17357
|
+
initialSearchView = _useState16[0],
|
|
17358
|
+
setInitialSearchView = _useState16[1];
|
|
17312
17359
|
|
|
17313
17360
|
var searchResultsRef = React.useRef(null);
|
|
17314
17361
|
var searchInputRef = React.useRef(null);
|
|
@@ -17318,7 +17365,6 @@
|
|
|
17318
17365
|
});
|
|
17319
17366
|
var immediateSearch = createImmediateSearch(setSearchValue, setSearchResults, onSearchSubmit);
|
|
17320
17367
|
var handleChange = useSearchInputChange(setSearchValue, setIsSearchFocused, debouncedSearch, setSearchResults, setCachedResults);
|
|
17321
|
-
useSearchUrlQuery(setSearchValue, debouncedSearch);
|
|
17322
17368
|
var handleKeyDown = useSearchInputKeyDown(searchValue, immediateSearch, setIsSearchFocused, setSearchValue);
|
|
17323
17369
|
React.useMemo(function () {
|
|
17324
17370
|
if (!initialSearchData) {
|
|
@@ -17351,6 +17397,7 @@
|
|
|
17351
17397
|
brands: [],
|
|
17352
17398
|
products: []
|
|
17353
17399
|
});
|
|
17400
|
+
setShowNoResults(false);
|
|
17354
17401
|
}
|
|
17355
17402
|
};
|
|
17356
17403
|
|
|
@@ -17535,6 +17582,7 @@
|
|
|
17535
17582
|
products: []
|
|
17536
17583
|
});
|
|
17537
17584
|
setIsSearchFocused(false);
|
|
17585
|
+
setShowNoResults(false);
|
|
17538
17586
|
},
|
|
17539
17587
|
onSearchSubmit: onSearchSubmit,
|
|
17540
17588
|
setSearchValue: setSearchValue,
|
|
@@ -17545,7 +17593,10 @@
|
|
|
17545
17593
|
currency: currency,
|
|
17546
17594
|
currencySymbol: currencySymbol,
|
|
17547
17595
|
onProductSearchResultClick: onProductSearchResultClick,
|
|
17548
|
-
onBrandSearchResultClick: onBrandSearchResultClick
|
|
17596
|
+
onBrandSearchResultClick: onBrandSearchResultClick,
|
|
17597
|
+
onCreateInterests: onCreateInterests,
|
|
17598
|
+
noResultsImage: noResultsImage,
|
|
17599
|
+
showNoResults: showNoResults
|
|
17549
17600
|
}))), shop && /*#__PURE__*/React__default.createElement(LuxitySideNav, {
|
|
17550
17601
|
accordionIcon: accordionIcon,
|
|
17551
17602
|
logoSrc: logoSrc,
|