@caspeco/casper-ui-library 7.11.0 → 7.11.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.
@@ -10,7 +10,6 @@ const o = (e) => {
10
10
  return r.OnWarningContainer;
11
11
  case "neutral":
12
12
  return r.OnNeutralContainer;
13
- case "success":
14
13
  default:
15
14
  return r.OnSuccessContainer;
16
15
  }
@@ -24,7 +23,6 @@ const o = (e) => {
24
23
  return r.WarningContainer;
25
24
  case "neutral":
26
25
  return r.NeutralContainer;
27
- case "success":
28
26
  default:
29
27
  return r.SuccessContainer;
30
28
  }
@@ -5,13 +5,7 @@ import { Minus as m } from "./icons/minus.js";
5
5
  import { Plus as f } from "./icons/plus.js";
6
6
  function p(o, c, r) {
7
7
  if (c && !r)
8
- switch (o) {
9
- case "sm":
10
- return "9px";
11
- case "md":
12
- default:
13
- return "10px";
14
- }
8
+ return o === "sm" ? "9px" : "10px";
15
9
  switch (o) {
16
10
  case "sm":
17
11
  return "14px";
@@ -8,7 +8,6 @@ function t(e) {
8
8
  return "a";
9
9
  case "none":
10
10
  return "div";
11
- case "button":
12
11
  default:
13
12
  return "button";
14
13
  }
@@ -22,7 +22,6 @@ function I(e, r) {
22
22
  return "4px";
23
23
  case "13px":
24
24
  return "-6px";
25
- case "24px":
26
25
  default:
27
26
  return "0px";
28
27
  }
@@ -91,7 +91,7 @@ const X = ({
91
91
  borderBottom: 0,
92
92
  paddingLeft: A()
93
93
  },
94
- children: /* @__PURE__ */ k(j, { w: "100%", align: "center", children: [
94
+ children: /* @__PURE__ */ k(j, { w: "100%", h: "100%", align: "center", children: [
95
95
  d && /* @__PURE__ */ n(G, { children: ({ isOpen: e }) => /* @__PURE__ */ k(
96
96
  h,
97
97
  {
@@ -1 +1 @@
1
- {"version":3,"file":"table-row-expand-toggle-button.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row-expand-toggle-button.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,+BAA+B;IACxC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,0BAA0B,qFACS,+BAA+B,6CAoC9E,CAAC"}
1
+ {"version":3,"file":"table-row-expand-toggle-button.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-row-expand-toggle-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,+BAA+B;IACxC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,0BAA0B,qFACS,+BAA+B,6CAkC9E,CAAC"}
@@ -1,33 +1,32 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Box as c } from "@chakra-ui/react";
3
- import { memo as d } from "react";
4
- import { translations as x } from "./translations.js";
5
- import { IconButton as g } from "../icon-button/icon-button.js";
6
- import { Icons as i } from "../icon/types.js";
7
- import { ThemeSpaceVariable as f } from "../../theme/theme-types.js";
8
- const B = d(
9
- ({ row: o, localeString: l, rowIsExpanded: n, hidden: a }) => {
10
- const r = x[l], p = o.getToggleExpandedHandler(), s = (e) => {
11
- e.stopPropagation(), p();
12
- }, m = () => n ? `${r.collapseRow} ${o.index + 1}` : `${r.expandRow} ${o.index + 1}`;
13
- return /* @__PURE__ */ t(c, { as: "span", h: "100%", children: /* @__PURE__ */ t(
14
- g,
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { memo as c } from "react";
3
+ import { translations as d } from "./translations.js";
4
+ import { IconButton as x } from "../icon-button/icon-button.js";
5
+ import { Icons as r } from "../icon/types.js";
6
+ import { ThemeSpaceVariable as g } from "../../theme/theme-types.js";
7
+ const w = c(
8
+ ({ row: o, localeString: i, rowIsExpanded: a, hidden: e }) => {
9
+ const n = d[i], l = o.getToggleExpandedHandler(), p = (t) => {
10
+ t.stopPropagation(), l();
11
+ }, s = () => a ? `${n.collapseRow} ${o.index + 1}` : `${n.expandRow} ${o.index + 1}`;
12
+ return /* @__PURE__ */ m(
13
+ x,
15
14
  {
16
15
  size: "xs",
17
- mr: f.XSmall,
16
+ mr: g.XSmall,
18
17
  variant: "ghost",
19
- "aria-label": m(),
20
- icon: n ? i.TreeViewCollapse : i.TreeViewExpand,
21
- onClick: s,
22
- onKeyDown: (e) => e.stopPropagation(),
23
- visibility: a ? "hidden" : "initial",
24
- "aria-hidden": a,
25
- tabIndex: a ? -1 : 0,
18
+ "aria-label": s(),
19
+ icon: a ? r.TreeViewCollapse : r.TreeViewExpand,
20
+ onClick: p,
21
+ onKeyDown: (t) => t.stopPropagation(),
22
+ visibility: e ? "hidden" : "initial",
23
+ "aria-hidden": e,
24
+ tabIndex: e ? -1 : 0,
26
25
  borderRadius: "0"
27
26
  }
28
- ) });
27
+ );
29
28
  }
30
29
  );
31
30
  export {
32
- B as TableRowExpandToggleButton
31
+ w as TableRowExpandToggleButton
33
32
  };
@@ -1,35 +1,38 @@
1
- import * as r from "react";
2
- import { flushSync as c } from "react-dom";
3
- import { Virtualizer as f, elementScroll as i, observeElementOffset as m, observeElementRect as d } from "../../../virtual-core/dist/esm/index.js";
4
- import { defaultKeyExtractor as R, defaultRangeExtractor as g, measureElement as z } from "../../../virtual-core/dist/esm/index.js";
5
- const a = typeof document < "u" ? r.useLayoutEffect : r.useEffect;
6
- function p(e) {
7
- const n = r.useReducer(() => ({}), {})[1], o = {
8
- ...e,
9
- onChange: (l, u) => {
10
- var s;
11
- u ? c(n) : n(), (s = e.onChange) == null || s.call(e, l, u);
1
+ import * as t from "react";
2
+ import { flushSync as f } from "react-dom";
3
+ import { Virtualizer as i, elementScroll as m, observeElementOffset as d, observeElementRect as p } from "../../../virtual-core/dist/esm/index.js";
4
+ import { defaultKeyExtractor as g, defaultRangeExtractor as z, measureElement as O } from "../../../virtual-core/dist/esm/index.js";
5
+ const l = typeof document < "u" ? t.useLayoutEffect : t.useEffect;
6
+ function E({
7
+ useFlushSync: r = !0,
8
+ ...n
9
+ }) {
10
+ const o = t.useReducer(() => ({}), {})[1], u = {
11
+ ...n,
12
+ onChange: (c, s) => {
13
+ var a;
14
+ r && s ? f(o) : o(), (a = n.onChange) == null || a.call(n, c, s);
12
15
  }
13
- }, [t] = r.useState(
14
- () => new f(o)
16
+ }, [e] = t.useState(
17
+ () => new i(u)
15
18
  );
16
- return t.setOptions(o), a(() => t._didMount(), []), a(() => t._willUpdate()), t;
19
+ return e.setOptions(u), l(() => e._didMount(), []), l(() => e._willUpdate()), e;
17
20
  }
18
- function h(e) {
19
- return p({
20
- observeElementRect: d,
21
- observeElementOffset: m,
22
- scrollToFn: i,
23
- ...e
21
+ function x(r) {
22
+ return E({
23
+ observeElementRect: p,
24
+ observeElementOffset: d,
25
+ scrollToFn: m,
26
+ ...r
24
27
  });
25
28
  }
26
29
  export {
27
- f as Virtualizer,
28
- R as defaultKeyExtractor,
29
- g as defaultRangeExtractor,
30
- i as elementScroll,
31
- z as measureElement,
32
- m as observeElementOffset,
33
- d as observeElementRect,
34
- h as useVirtualizer
30
+ i as Virtualizer,
31
+ g as defaultKeyExtractor,
32
+ z as defaultRangeExtractor,
33
+ m as elementScroll,
34
+ O as measureElement,
35
+ d as observeElementOffset,
36
+ p as observeElementRect,
37
+ x as useVirtualizer
35
38
  };
@@ -2,12 +2,12 @@ import { memo as p, notUndefined as O, approxEqual as I, debounce as A } from ".
2
2
  const y = (r) => {
3
3
  const { offsetWidth: h, offsetHeight: e } = r;
4
4
  return { width: h, height: e };
5
- }, R = (r) => r, F = (r) => {
5
+ }, F = (r) => r, R = (r) => {
6
6
  const h = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
7
7
  for (let t = h; t <= e; t++)
8
8
  s.push(t);
9
9
  return s;
10
- }, W = (r, h) => {
10
+ }, D = (r, h) => {
11
11
  const e = r.scrollElement;
12
12
  if (!e)
13
13
  return;
@@ -25,9 +25,9 @@ const y = (r) => {
25
25
  const o = () => {
26
26
  const a = i[0];
27
27
  if (a?.borderBoxSize) {
28
- const d = a.borderBoxSize[0];
29
- if (d) {
30
- t({ width: d.inlineSize, height: d.blockSize });
28
+ const u = a.borderBoxSize[0];
29
+ if (u) {
30
+ t({ width: u.inlineSize, height: u.blockSize });
31
31
  return;
32
32
  }
33
33
  }
@@ -40,7 +40,7 @@ const y = (r) => {
40
40
  };
41
41
  }, M = {
42
42
  passive: !0
43
- }, w = typeof window > "u" ? !0 : "onscrollend" in window, D = (r, h) => {
43
+ }, w = typeof window > "u" ? !0 : "onscrollend" in window, k = (r, h) => {
44
44
  const e = r.scrollElement;
45
45
  if (!e)
46
46
  return;
@@ -56,13 +56,13 @@ const y = (r) => {
56
56
  },
57
57
  r.options.isScrollingResetDelay
58
58
  ), i = (c) => () => {
59
- const { horizontal: u, isRtl: l } = r.options;
60
- t = u ? e.scrollLeft * (l && -1 || 1) : e.scrollTop, n(), h(t, c);
59
+ const { horizontal: m, isRtl: l } = r.options;
60
+ t = m ? e.scrollLeft * (l && -1 || 1) : e.scrollTop, n(), h(t, c);
61
61
  }, o = i(!0), a = i(!1);
62
- a(), e.addEventListener("scroll", o, M);
63
- const d = r.options.useScrollendEvent && w;
64
- return d && e.addEventListener("scrollend", a, M), () => {
65
- e.removeEventListener("scroll", o), d && e.removeEventListener("scrollend", a);
62
+ e.addEventListener("scroll", o, M);
63
+ const u = r.options.useScrollendEvent && w;
64
+ return u && e.addEventListener("scrollend", a, M), () => {
65
+ e.removeEventListener("scroll", o), u && e.removeEventListener("scrollend", a);
66
66
  };
67
67
  }, _ = (r, h, e) => {
68
68
  if (h?.borderBoxSize) {
@@ -73,7 +73,7 @@ const y = (r) => {
73
73
  );
74
74
  }
75
75
  return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
76
- }, L = (r, {
76
+ }, T = (r, {
77
77
  adjustments: h = 0,
78
78
  behavior: e
79
79
  }, s) => {
@@ -84,9 +84,9 @@ const y = (r) => {
84
84
  behavior: e
85
85
  });
86
86
  };
87
- class T {
87
+ class L {
88
88
  constructor(h) {
89
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
89
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
90
90
  let e = null;
91
91
  const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
92
92
  t.forEach((n) => {
@@ -122,8 +122,8 @@ class T {
122
122
  scrollPaddingStart: 0,
123
123
  scrollPaddingEnd: 0,
124
124
  horizontal: !1,
125
- getItemKey: R,
126
- rangeExtractor: F,
125
+ getItemKey: F,
126
+ rangeExtractor: R,
127
127
  onChange: () => {
128
128
  },
129
129
  measureElement: _,
@@ -175,9 +175,6 @@ class T {
175
175
  }
176
176
  this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((e = this.scrollElement) == null ? void 0 : e.window) ?? null, this.elementsCache.forEach((t) => {
177
177
  this.observer.observe(t);
178
- }), this._scrollToOffset(this.getScrollOffset(), {
179
- adjustments: void 0,
180
- behavior: void 0
181
178
  }), this.unsubs.push(
182
179
  this.options.observeElementRect(this, (t) => {
183
180
  this.scrollRect = t, this.maybeNotify();
@@ -186,7 +183,10 @@ class T {
186
183
  this.options.observeElementOffset(this, (t, n) => {
187
184
  this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = n, this.maybeNotify();
188
185
  })
189
- );
186
+ ), this._scrollToOffset(this.getScrollOffset(), {
187
+ adjustments: void 0,
188
+ behavior: void 0
189
+ });
190
190
  }
191
191
  }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
192
192
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
@@ -219,11 +219,7 @@ class T {
219
219
  lanes: o
220
220
  }),
221
221
  {
222
- key: !1,
223
- skipInitialOnChange: !0,
224
- onChange: () => {
225
- this.notify(this.isScrolling);
226
- }
222
+ key: !1
227
223
  }
228
224
  ), this.getMeasurements = p(
229
225
  () => [this.getMeasurementOptions(), this.itemSizeCache],
@@ -233,38 +229,38 @@ class T {
233
229
  if (this.laneAssignments.size > e)
234
230
  for (const l of this.laneAssignments.keys())
235
231
  l >= e && this.laneAssignments.delete(l);
236
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
232
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
237
233
  this.itemSizeCache.set(l.key, l.size);
238
234
  }));
239
- const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
235
+ const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
240
236
  this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
241
- const c = this.measurementsCache.slice(0, d), u = new Array(o).fill(
237
+ const c = this.measurementsCache.slice(0, u), m = new Array(o).fill(
242
238
  void 0
243
239
  );
244
- for (let l = 0; l < d; l++) {
240
+ for (let l = 0; l < u; l++) {
245
241
  const f = c[l];
246
- f && (u[f.lane] = l);
242
+ f && (m[f.lane] = l);
247
243
  }
248
- for (let l = d; l < e; l++) {
244
+ for (let l = u; l < e; l++) {
249
245
  const f = n(l), v = this.laneAssignments.get(l);
250
- let g, b;
246
+ let d, b;
251
247
  if (v !== void 0 && this.options.lanes > 1) {
252
- g = v;
253
- const m = u[g], x = m !== void 0 ? c[m] : void 0;
248
+ d = v;
249
+ const g = m[d], x = g !== void 0 ? c[g] : void 0;
254
250
  b = x ? x.end + this.options.gap : s + t;
255
251
  } else {
256
- const m = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l);
257
- b = m ? m.end + this.options.gap : s + t, g = m ? m.lane : l % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(l, g);
252
+ const g = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l);
253
+ b = g ? g.end + this.options.gap : s + t, d = g ? g.lane : l % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(l, d);
258
254
  }
259
- const S = a.get(f), E = typeof S == "number" ? S : this.options.estimateSize(l), C = b + E;
255
+ const E = a.get(f), S = typeof E == "number" ? E : this.options.estimateSize(l), C = b + S;
260
256
  c[l] = {
261
257
  index: l,
262
258
  start: b,
263
- size: E,
259
+ size: S,
264
260
  end: C,
265
261
  key: f,
266
- lane: g
267
- }, u[g] = l;
262
+ lane: d
263
+ }, m[d] = l;
268
264
  }
269
265
  return this.measurementsCache = c, c;
270
266
  },
@@ -279,7 +275,7 @@ class T {
279
275
  this.getScrollOffset(),
280
276
  this.options.lanes
281
277
  ],
282
- (e, s, t, n) => this.range = e.length > 0 && s > 0 ? N({
278
+ (e, s, t, n) => this.range = e.length > 0 && s > 0 ? W({
283
279
  measurements: e,
284
280
  outerSize: s,
285
281
  scrollOffset: t,
@@ -364,10 +360,19 @@ class T {
364
360
  e
365
361
  )]
366
362
  );
363
+ }, this.getMaxScrollOffset = () => {
364
+ if (!this.scrollElement) return 0;
365
+ if ("scrollHeight" in this.scrollElement)
366
+ return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
367
+ {
368
+ const e = this.scrollElement.document.documentElement;
369
+ return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
370
+ }
367
371
  }, this.getOffsetForAlignment = (e, s, t = 0) => {
372
+ if (!this.scrollElement) return 0;
368
373
  const n = this.getSize(), i = this.getScrollOffset();
369
374
  s === "auto" && (s = e >= i + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
370
- const o = this.getTotalSize() + this.options.scrollMargin - n;
375
+ const o = this.getMaxScrollOffset();
371
376
  return Math.max(Math.min(o, e), 0);
372
377
  }, this.getOffsetForIndex = (e, s = "auto") => {
373
378
  e = Math.max(0, Math.min(e, this.options.count - 1));
@@ -382,6 +387,8 @@ class T {
382
387
  s = "start";
383
388
  else
384
389
  return [i, s];
390
+ if (s === "end" && e === this.options.count - 1)
391
+ return [this.getMaxScrollOffset(), s];
385
392
  const o = s === "end" ? t.end + this.options.scrollPaddingEnd : t.start - this.options.scrollPaddingStart;
386
393
  return [
387
394
  this.getOffsetForAlignment(o, s, t.size),
@@ -397,26 +404,30 @@ class T {
397
404
  }, this.scrollToIndex = (e, { align: s = "auto", behavior: t } = {}) => {
398
405
  t === "smooth" && this.isDynamicMode() && console.warn(
399
406
  "The `smooth` scroll behavior is not fully supported with dynamic size."
400
- ), e = Math.max(0, Math.min(e, this.options.count - 1));
407
+ ), e = Math.max(0, Math.min(e, this.options.count - 1)), this.currentScrollToIndex = e;
401
408
  let n = 0;
402
- const i = 10, o = (d) => {
409
+ const i = 10, o = (u) => {
403
410
  if (!this.targetWindow) return;
404
- const c = this.getOffsetForIndex(e, d);
411
+ const c = this.getOffsetForIndex(e, u);
405
412
  if (!c) {
406
413
  console.warn("Failed to get offset for index:", e);
407
414
  return;
408
415
  }
409
- const [u, l] = c;
410
- this._scrollToOffset(u, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
411
- const f = this.getScrollOffset(), v = this.getOffsetForIndex(e, l);
412
- if (!v) {
413
- console.warn("Failed to get offset for index:", e);
414
- return;
415
- }
416
- I(v[0], f) || a(l);
416
+ const [m, l] = c;
417
+ this._scrollToOffset(m, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
418
+ const f = () => {
419
+ if (this.currentScrollToIndex !== e) return;
420
+ const v = this.getScrollOffset(), d = this.getOffsetForIndex(e, l);
421
+ if (!d) {
422
+ console.warn("Failed to get offset for index:", e);
423
+ return;
424
+ }
425
+ I(d[0], v) || a(l);
426
+ };
427
+ this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(f) : f();
417
428
  });
418
- }, a = (d) => {
419
- this.targetWindow && (n++, n < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", n, i), this.targetWindow.requestAnimationFrame(() => o(d))) : console.warn(
429
+ }, a = (u) => {
430
+ this.targetWindow && this.currentScrollToIndex === e && (n++, n < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", n, i), this.targetWindow.requestAnimationFrame(() => o(u))) : console.warn(
420
431
  `Failed to scroll to index ${e} after ${i} attempts.`
421
432
  ));
422
433
  };
@@ -471,7 +482,7 @@ const z = (r, h, e, s) => {
471
482
  }
472
483
  return r > 0 ? r - 1 : 0;
473
484
  };
474
- function N({
485
+ function W({
475
486
  measurements: r,
476
487
  outerSize: h,
477
488
  scrollOffset: e,
@@ -498,25 +509,25 @@ function N({
498
509
  const c = r[o];
499
510
  a[c.lane] = c.end, o++;
500
511
  }
501
- const d = Array(s).fill(e + h);
502
- for (; i >= 0 && d.some((c) => c >= e); ) {
512
+ const u = Array(s).fill(e + h);
513
+ for (; i >= 0 && u.some((c) => c >= e); ) {
503
514
  const c = r[i];
504
- d[c.lane] = c.start, i--;
515
+ u[c.lane] = c.start, i--;
505
516
  }
506
517
  i = Math.max(0, i - i % s), o = Math.min(t, o + (s - 1 - o % s));
507
518
  }
508
519
  return { startIndex: i, endIndex: o };
509
520
  }
510
521
  export {
511
- T as Virtualizer,
522
+ L as Virtualizer,
512
523
  I as approxEqual,
513
524
  A as debounce,
514
- R as defaultKeyExtractor,
515
- F as defaultRangeExtractor,
516
- L as elementScroll,
525
+ F as defaultKeyExtractor,
526
+ R as defaultRangeExtractor,
527
+ T as elementScroll,
517
528
  _ as measureElement,
518
529
  p as memo,
519
530
  O as notUndefined,
520
- D as observeElementOffset,
521
- W as observeElementRect
531
+ k as observeElementOffset,
532
+ D as observeElementRect
522
533
  };
@@ -25,8 +25,6 @@ const s = {
25
25
  // A, B
26
26
  case "GGGGG":
27
27
  return e.era(t, { width: "narrow" });
28
- // Anno Domini, Before Christ
29
- case "GGGG":
30
28
  default:
31
29
  return e.era(t, { width: "wide" });
32
30
  }
@@ -91,8 +89,6 @@ const s = {
91
89
  width: "narrow",
92
90
  context: "formatting"
93
91
  });
94
- // 1st quarter, 2nd quarter, ...
95
- case "QQQQ":
96
92
  default:
97
93
  return e.quarter(t, {
98
94
  width: "wide",
@@ -125,8 +121,6 @@ const s = {
125
121
  width: "narrow",
126
122
  context: "standalone"
127
123
  });
128
- // 1st quarter, 2nd quarter, ...
129
- case "qqqq":
130
124
  default:
131
125
  return e.quarter(t, {
132
126
  width: "wide",
@@ -156,8 +150,6 @@ const s = {
156
150
  width: "narrow",
157
151
  context: "formatting"
158
152
  });
159
- // January, February, ..., December
160
- case "MMMM":
161
153
  default:
162
154
  return e.month(t, { width: "wide", context: "formatting" });
163
155
  }
@@ -187,8 +179,6 @@ const s = {
187
179
  width: "narrow",
188
180
  context: "standalone"
189
181
  });
190
- // January, February, ..., December
191
- case "LLLL":
192
182
  default:
193
183
  return e.month(t, { width: "wide", context: "standalone" });
194
184
  }
@@ -236,8 +226,6 @@ const s = {
236
226
  width: "short",
237
227
  context: "formatting"
238
228
  });
239
- // Tuesday
240
- case "EEEE":
241
229
  default:
242
230
  return e.day(t, {
243
231
  width: "wide",
@@ -275,8 +263,6 @@ const s = {
275
263
  width: "short",
276
264
  context: "formatting"
277
265
  });
278
- // Tuesday
279
- case "eeee":
280
266
  default:
281
267
  return e.day(a, {
282
268
  width: "wide",
@@ -314,8 +300,6 @@ const s = {
314
300
  width: "short",
315
301
  context: "standalone"
316
302
  });
317
- // Tuesday
318
- case "cccc":
319
303
  default:
320
304
  return e.day(a, {
321
305
  width: "wide",
@@ -354,8 +338,6 @@ const s = {
354
338
  width: "short",
355
339
  context: "formatting"
356
340
  });
357
- // Tuesday
358
- case "iiii":
359
341
  default:
360
342
  return e.day(t, {
361
343
  width: "wide",
@@ -383,7 +365,6 @@ const s = {
383
365
  width: "narrow",
384
366
  context: "formatting"
385
367
  });
386
- case "aaaa":
387
368
  default:
388
369
  return e.dayPeriod(a, {
389
370
  width: "wide",
@@ -412,7 +393,6 @@ const s = {
412
393
  width: "narrow",
413
394
  context: "formatting"
414
395
  });
415
- case "bbbb":
416
396
  default:
417
397
  return e.dayPeriod(a, {
418
398
  width: "wide",
@@ -437,7 +417,6 @@ const s = {
437
417
  width: "narrow",
438
418
  context: "formatting"
439
419
  });
440
- case "BBBB":
441
420
  default:
442
421
  return e.dayPeriod(a, {
443
422
  width: "wide",
@@ -494,11 +473,6 @@ const s = {
494
473
  case "XXXX":
495
474
  case "XX":
496
475
  return c(t);
497
- // Hours, minutes and optional seconds with `:` delimiter
498
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
499
- // so this token always has the same output as `XXX`
500
- case "XXXXX":
501
- case "XXX":
502
476
  // Hours and minutes with `:` delimiter
503
477
  default:
504
478
  return c(t, ":");
@@ -517,11 +491,6 @@ const s = {
517
491
  case "xxxx":
518
492
  case "xx":
519
493
  return c(t);
520
- // Hours, minutes and optional seconds with `:` delimiter
521
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
522
- // so this token always has the same output as `xxx`
523
- case "xxxxx":
524
- case "xxx":
525
494
  // Hours and minutes with `:` delimiter
526
495
  default:
527
496
  return c(t, ":");
@@ -536,8 +505,6 @@ const s = {
536
505
  case "OO":
537
506
  case "OOO":
538
507
  return "GMT" + d(t, ":");
539
- // Long
540
- case "OOOO":
541
508
  default:
542
509
  return "GMT" + c(t, ":");
543
510
  }
@@ -551,8 +518,6 @@ const s = {
551
518
  case "zz":
552
519
  case "zzz":
553
520
  return "GMT" + d(t, ":");
554
- // Long
555
- case "zzzz":
556
521
  default:
557
522
  return "GMT" + c(t, ":");
558
523
  }
@@ -25,7 +25,6 @@ const g = {
25
25
  return r;
26
26
  case "aaaaa":
27
27
  return r[0];
28
- case "aaaa":
29
28
  default:
30
29
  return r === "am" ? "a.m." : "p.m.";
31
30
  }
@@ -6,7 +6,6 @@ const s = (t, e) => {
6
6
  return e.date({ width: "medium" });
7
7
  case "PPP":
8
8
  return e.date({ width: "long" });
9
- case "PPPP":
10
9
  default:
11
10
  return e.date({ width: "full" });
12
11
  }
@@ -18,7 +17,6 @@ const s = (t, e) => {
18
17
  return e.time({ width: "medium" });
19
18
  case "ppp":
20
19
  return e.time({ width: "long" });
21
- case "pppp":
22
20
  default:
23
21
  return e.time({ width: "full" });
24
22
  }
@@ -37,7 +35,6 @@ const s = (t, e) => {
37
35
  case "PPP":
38
36
  i = e.dateTime({ width: "long" });
39
37
  break;
40
- case "PPPP":
41
38
  default:
42
39
  i = e.dateTime({ width: "full" });
43
40
  break;
@@ -1,4 +1,4 @@
1
- const o = 6048e5, c = 864e5, n = Symbol.for("constructDateFrom");
1
+ const o = 6048e5, c = 864e5, n = /* @__PURE__ */ Symbol.for("constructDateFrom");
2
2
  export {
3
3
  n as constructFromSymbol,
4
4
  c as millisecondsInDay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "7.11.0",
3
+ "version": "7.11.1",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -32,25 +32,25 @@
32
32
  "@caspeco/prettier-config": "^1.0.7",
33
33
  "@eslint/js": "^9.39.2",
34
34
  "@testing-library/jest-dom": "^6.9.1",
35
- "@testing-library/react": "^16.3.0",
35
+ "@testing-library/react": "^16.3.1",
36
36
  "@testing-library/user-event": "^14.6.1",
37
37
  "@types/jest": "^30.0.0",
38
- "@types/node": "^24.10.1",
38
+ "@types/node": "^24.10.7",
39
39
  "@types/react": "^18.3.12",
40
40
  "@types/react-dom": "^18.3.1",
41
41
  "@vitejs/plugin-react-swc": "^4.2.2",
42
42
  "eslint": "^9.39.2",
43
43
  "eslint-plugin-react-hooks": "^7.0.1",
44
- "eslint-plugin-react-refresh": "^0.4.25",
44
+ "eslint-plugin-react-refresh": "^0.4.26",
45
45
  "globals": "^16.5.0",
46
- "jsdom": "^27.3.0",
46
+ "jsdom": "^27.4.0",
47
47
  "tsc-alias": "^1.8.16",
48
48
  "typescript": "~5.9.3",
49
- "typescript-eslint": "^8.49.0",
50
- "vite": "^7.2.7",
49
+ "typescript-eslint": "^8.52.0",
50
+ "vite": "^7.3.1",
51
51
  "vite-plugin-dts": "^4.5.4",
52
- "vite-tsconfig-paths": "^5.1.4",
53
- "vitest": "^4.0.15"
52
+ "vite-tsconfig-paths": "^6.0.4",
53
+ "vitest": "^4.0.16"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@chakra-ui/react": "^2.8.2",
@@ -62,7 +62,7 @@
62
62
  "@chakra-ui/anatomy": "^2.3.4",
63
63
  "@floating-ui/dom": "^1.7.4",
64
64
  "@tanstack/react-table": "^8.21.3",
65
- "@tanstack/react-virtual": "^3.13.13",
65
+ "@tanstack/react-virtual": "^3.13.18",
66
66
  "csstype": "^3.2.3",
67
67
  "date-fns": "^4.1.0"
68
68
  }