@scbt-ecom/ui 0.51.1 → 0.51.3

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.
@@ -17855,11 +17855,17 @@ class rB {
17855
17855
  debug: () => this.options.debug
17856
17856
  }
17857
17857
  ), this.calculateRange = xo(
17858
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
17859
- (n, r, i) => this.range = n.length > 0 && r > 0 ? iB({
17858
+ () => [
17859
+ this.getMeasurements(),
17860
+ this.getSize(),
17861
+ this.getScrollOffset(),
17862
+ this.options.lanes
17863
+ ],
17864
+ (n, r, i, o) => this.range = n.length > 0 && r > 0 ? iB({
17860
17865
  measurements: n,
17861
17866
  outerSize: r,
17862
- scrollOffset: i
17867
+ scrollOffset: i,
17868
+ lanes: o
17863
17869
  }) : null,
17864
17870
  {
17865
17871
  key: process.env.NODE_ENV !== "production" && "calculateRange",
@@ -17940,11 +17946,11 @@ class rB {
17940
17946
  n
17941
17947
  )]
17942
17948
  );
17943
- }, this.getOffsetForAlignment = (n, r) => {
17944
- const i = this.getSize(), o = this.getScrollOffset();
17945
- r === "auto" && n >= o + i && (r = "end"), r === "end" && (n -= i);
17946
- const s = this.options.horizontal ? "scrollWidth" : "scrollHeight", l = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[s] : this.scrollElement[s] : 0) - i;
17947
- return Math.max(Math.min(l, n), 0);
17949
+ }, this.getOffsetForAlignment = (n, r, i = 0) => {
17950
+ const o = this.getSize(), s = this.getScrollOffset();
17951
+ r === "auto" && (r = n >= s + o ? "end" : "start"), r === "center" ? n += (i - o) / 2 : r === "end" && (n -= o);
17952
+ const a = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[a] : this.scrollElement[a] : 0) - o;
17953
+ return Math.max(Math.min(c, n), 0);
17948
17954
  }, this.getOffsetForIndex = (n, r = "auto") => {
17949
17955
  n = Math.max(0, Math.min(n, this.options.count - 1));
17950
17956
  const i = this.measurementsCache[n];
@@ -17958,27 +17964,11 @@ class rB {
17958
17964
  r = "start";
17959
17965
  else
17960
17966
  return [s, r];
17961
- const a = i.start - this.options.scrollPaddingStart + (i.size - o) / 2;
17962
- switch (r) {
17963
- case "center":
17964
- return [this.getOffsetForAlignment(a, r), r];
17965
- case "end":
17966
- return [
17967
- this.getOffsetForAlignment(
17968
- i.end + this.options.scrollPaddingEnd,
17969
- r
17970
- ),
17971
- r
17972
- ];
17973
- default:
17974
- return [
17975
- this.getOffsetForAlignment(
17976
- i.start - this.options.scrollPaddingStart,
17977
- r
17978
- ),
17979
- r
17980
- ];
17981
- }
17967
+ const a = r === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
17968
+ return [
17969
+ this.getOffsetForAlignment(a, r, i.size),
17970
+ r
17971
+ ];
17982
17972
  }, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
17983
17973
  this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
17984
17974
  }, this.scrollToOffset = (n, { align: r = "start", behavior: i } = {}) => {
@@ -18048,13 +18038,19 @@ const W1 = (t, e, n, r) => {
18048
18038
  function iB({
18049
18039
  measurements: t,
18050
18040
  outerSize: e,
18051
- scrollOffset: n
18041
+ scrollOffset: n,
18042
+ lanes: r
18052
18043
  }) {
18053
- const r = t.length - 1, o = W1(0, r, (a) => t[a].start, n);
18054
- let s = o;
18055
- for (; s < r && t[s].end < n + e; )
18056
- s++;
18057
- return { startIndex: o, endIndex: s };
18044
+ const i = t.length - 1;
18045
+ let s = W1(
18046
+ 0,
18047
+ i,
18048
+ (l) => t[l].start,
18049
+ n
18050
+ ), a = s;
18051
+ for (; a < i && t[a].end < n + e; )
18052
+ a++;
18053
+ return r > 1 && (s = Math.max(0, s - s % r), a = Math.min(i, a + (r - 1 - a % r))), { startIndex: s, endIndex: a };
18058
18054
  }
18059
18055
  const xy = typeof document < "u" ? R.useLayoutEffect : R.useEffect;
18060
18056
  function oB(t) {
@@ -42014,4 +42010,4 @@ export {
42014
42010
  nV as t,
42015
42011
  Qh as u
42016
42012
  };
42017
- //# sourceMappingURL=index-MnignE4U.js.map
42013
+ //# sourceMappingURL=index-vcD48ARm.js.map