@sledge-app/react-instant-search 1.0.71 → 1.0.73
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/SearchResultWidget/Atoms.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 +19 -5
- package/dist/sledge-react-instant-search.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports, $ as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, a as $cb5cc270b50c6fcd$export$41fb9f06171c75f4, b as $cb5cc270b50c6fcd$export$602eac185826482c, c as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, d as $cb5cc270b50c6fcd$export$f39c2d165cd861fe, e as $cb5cc270b50c6fcd$export$21b07c8f274aebd5, f as $67824d98245208a0$export$be92b6f5f03c0fe9, g as $67824d98245208a0$export$adb584737d712b70, h as $e698a72e93240346$export$be92b6f5f03c0fe9, i as $e698a72e93240346$export$adb584737d712b70, k as $faa2e61a3361514f$export$be92b6f5f03c0fe9, l as $faa2e61a3361514f$export$13921ac0cc260818, m as $faa2e61a3361514f$export$9a58ef0d7ad3278c, n as $faa2e61a3361514f$export$6521433ed15a34db, o as $f99a8c78507165f7$export$be92b6f5f03c0fe9, p as $f99a8c78507165f7$export$6d08773d2e66f8f2, q as $f99a8c78507165f7$export$adb584737d712b70, r as $cc7e05a45900e73f$export$6d08773d2e66f8f2, s as $cc7e05a45900e73f$export$d6e5bf9c43ea9319, t as $cc7e05a45900e73f$export$c3468e2714d175fa, u as $cc7e05a45900e73f$export$be92b6f5f03c0fe9, v as $cc7e05a45900e73f$export$41fb9f06171c75f4, w as $cc7e05a45900e73f$export$4c8d1a57a761ef94, x as $cc7e05a45900e73f$export$f04a61298a47a40f, y as $cc7e05a45900e73f$export$602eac185826482c, z as $cc7e05a45900e73f$export$7c6e2c02157bb7d2, A as $cc7e05a45900e73f$export$2f60d3ec9ad468f2, B as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7, C as $cc7e05a45900e73f$export$bf1aedc3039c8d63, D as motion, E as client, F as $a093c7e1ec25a057$export$2881499e37b75b9a, G as $a093c7e1ec25a057$export$be92b6f5f03c0fe9, H as $a093c7e1ec25a057$export$41fb9f06171c75f4, I as $a093c7e1ec25a057$export$602eac185826482c, J as $a093c7e1ec25a057$export$7c6e2c02157bb7d2, K as $a093c7e1ec25a057$export$21b07c8f274aebd5, L as $57acba87d6e25586$export$be92b6f5f03c0fe9, M as $57acba87d6e25586$export$d5c6c08dc2d3ca7, N as $57acba87d6e25586$export$9a4e88b92edfce6b, O as $57acba87d6e25586$export$6521433ed15a34db, P as MasonryResponsive, Q as Masonry, R as useEmblaCarousel, W as WindowScroller, S as List, T as $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, U as $5d3850c4d0b4e6c7$export$602eac185826482c, V as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, X as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 } from "./vendor-4bab83cd.js";
|
|
2
|
-
import React__default, { createElement } from "react";
|
|
2
|
+
import React__default, { createElement, useState } from "react";
|
|
3
3
|
import { SledgeContext } from "@sledge-app/core";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const ProductFilterWidget = (props) => {
|
|
@@ -3727,12 +3727,24 @@ const FlyoutSidebar = ({ title, content, open, setOpen }) => {
|
|
|
3727
3727
|
}
|
|
3728
3728
|
);
|
|
3729
3729
|
};
|
|
3730
|
-
const
|
|
3730
|
+
const getElement = ({ selector, setUsedScrollElement }) => {
|
|
3731
|
+
const element = document.querySelector(selector);
|
|
3732
|
+
if (!element)
|
|
3733
|
+
setTimeout(() => {
|
|
3734
|
+
getElement({ selector, setUsedScrollElement });
|
|
3735
|
+
}, 1e3);
|
|
3736
|
+
else
|
|
3737
|
+
setUsedScrollElement(element);
|
|
3738
|
+
};
|
|
3739
|
+
const VirtualizedList = ({ selector, scrollElement, rowCount, rowHeight, rowRenderer: rowRenderer2, minHeight = 72 }) => {
|
|
3740
|
+
const [usedScrollElement, setUsedScrollElement] = useState(scrollElement);
|
|
3741
|
+
if (!usedScrollElement && selector)
|
|
3742
|
+
getElement({ selector, setUsedScrollElement });
|
|
3731
3743
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3732
3744
|
WindowScroller,
|
|
3733
3745
|
{
|
|
3734
|
-
...
|
|
3735
|
-
scrollElement
|
|
3746
|
+
...usedScrollElement && {
|
|
3747
|
+
scrollElement: usedScrollElement
|
|
3736
3748
|
},
|
|
3737
3749
|
children: ({ width, height, isScrolling, onChildScroll, scrollTop }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3738
3750
|
List,
|
|
@@ -4611,7 +4623,8 @@ const FacetComponent = (props) => {
|
|
|
4611
4623
|
] });
|
|
4612
4624
|
});
|
|
4613
4625
|
};
|
|
4614
|
-
|
|
4626
|
+
const scrollElementSelector = `#filter-component-${stringToSlug(value)} .sledge-instant-search__result-filter-item-list`;
|
|
4627
|
+
let scrollElement = document.querySelector(scrollElementSelector);
|
|
4615
4628
|
if (isDisplaySlider) {
|
|
4616
4629
|
items = (defaultFacetStats == null ? void 0 : defaultFacetStats[value]) && Object.keys(defaultFacetStats[value]).length ? defaultFacetStats[value] : {};
|
|
4617
4630
|
let defaultValueMin = valueFilterPriceChange[0] || (items == null ? void 0 : items.min);
|
|
@@ -4642,6 +4655,7 @@ const FacetComponent = (props) => {
|
|
|
4642
4655
|
blockComponent = display.toLowerCase() === "checkbox" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4643
4656
|
VirtualizedList,
|
|
4644
4657
|
{
|
|
4658
|
+
selector: scrollElementSelector,
|
|
4645
4659
|
...scrollElement && {
|
|
4646
4660
|
scrollElement
|
|
4647
4661
|
},
|