@infinite-table/infinite-react 0.0.6 → 0.0.7

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/index.css CHANGED
@@ -619,6 +619,3 @@
619
619
  background: var(--infinite-load-mask-text-background);
620
620
  border-radius: var(--infinite-load-mask-border-radius);
621
621
  }
622
-
623
-
624
- /*# sourceMappingURL=tmp.css.map */
package/index.d.ts CHANGED
@@ -602,7 +602,7 @@ declare module "utils/groupAndPivot/index" {
602
602
  export type GroupBy<DataType, KeyType> = {
603
603
  field: keyof DataType;
604
604
  toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
605
- column?: InfiniteTableGroupColumnBase<DataType>;
605
+ column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
606
606
  };
607
607
  export type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
608
608
  column?: InfiniteTablePivotColumn<DataType> | (({ column, }: {
@@ -1202,10 +1202,10 @@ declare module "components/InfiniteTable/state/getInitialState" {
1202
1202
  groupColumn: 1 | ((value: Partial<InfiniteTablePropGroupColumn<T>> | undefined) => Partial<InfiniteTablePropGroupColumn<T>> | undefined);
1203
1203
  loadingText: 1 | ((value: import("react").ReactNode) => import("react").ReactNode);
1204
1204
  onReady: 1 | ((value: ((api: import("components/InfiniteTable/types").InfiniteTableImperativeApi<T>) => void) | undefined) => ((api: import("components/InfiniteTable/types").InfiniteTableImperativeApi<T>) => void) | undefined);
1205
- onSelfFocus: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined);
1206
- onSelfBlur: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined);
1207
- onFocusWithin: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined);
1208
- onBlurWithin: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement>) => void) | undefined);
1205
+ onSelfFocus: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined);
1206
+ onSelfBlur: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined);
1207
+ onFocusWithin: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined);
1208
+ onBlurWithin: 1 | ((value: ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined) => ((event: import("react").FocusEvent<HTMLDivElement, Element>) => void) | undefined);
1209
1209
  onScrollToTop: 1 | ((value: (() => void) | undefined) => (() => void) | undefined);
1210
1210
  onScrollToBottom: 1 | ((value: (() => void) | undefined) => (() => void) | undefined);
1211
1211
  scrollToBottomOffset: 1 | ((value: number | undefined) => number | undefined);
@@ -1584,6 +1584,7 @@ declare module "components/VirtualBrain/index" {
1584
1584
  export type MainAxisSize = number | ((itemIndex: number) => number);
1585
1585
  type OnRenderCountChangeFn = (renderCount: number) => void;
1586
1586
  type OnSizeChangeFn = (size: number) => void;
1587
+ type OnDestroyFn = () => void;
1587
1588
  export type GetItemPositionFn = (itemIndex: number) => number;
1588
1589
  export type RenderRange = {
1589
1590
  renderStartIndex: number;
@@ -1598,11 +1599,13 @@ declare module "components/VirtualBrain/index" {
1598
1599
  private itemSizeCache;
1599
1600
  private itemOffsetCache;
1600
1601
  private options;
1602
+ private destroyed;
1601
1603
  private totalSize;
1602
1604
  private onScrollFns;
1603
1605
  private onTotalSizeChangeFns;
1604
1606
  private onRenderCountChangeFns;
1605
1607
  private onRenderRangeChangeFns;
1608
+ private onDestroyFns;
1606
1609
  name: string | undefined;
1607
1610
  private renderCount;
1608
1611
  private renderRange;
@@ -1618,6 +1621,7 @@ declare module "components/VirtualBrain/index" {
1618
1621
  getRenderCount: () => number;
1619
1622
  setScrollPosition: (scrollPosition: ScrollPosition) => void;
1620
1623
  private notifyScrollChange;
1624
+ private notifyDestroy;
1621
1625
  private notifyTotalSizeChange;
1622
1626
  private notifyRenderCountChange;
1623
1627
  private notifyRenderRangeChange;
@@ -1629,6 +1633,7 @@ declare module "components/VirtualBrain/index" {
1629
1633
  onTotalSizeChange: (fn: OnSizeChangeFn) => () => void;
1630
1634
  onRenderCountChange: (fn: OnRenderCountChangeFn) => () => void;
1631
1635
  onRenderRangeChange: (fn: OnRenderRangeChangeFn) => () => void;
1636
+ onDestroy: (fn: OnDestroyFn) => () => void;
1632
1637
  update: (newCount: VirtualBrainOptions['count'], newItemSize: VirtualBrainOptions['itemSize'], newItemSpan?: VirtualBrainOptions['itemSpan']) => void;
1633
1638
  private reset;
1634
1639
  private computeItemSpanUpTo;
@@ -1976,6 +1981,17 @@ declare module "components/InfiniteTable/components/InfiniteTableHeader/Infinite
1976
1981
  scrollable?: boolean;
1977
1982
  };
1978
1983
  }
1984
+ declare module "components/RawList/AvoidReactDiff" {
1985
+ import * as React from 'react';
1986
+ import { Renderable } from "components/types/Renderable";
1987
+ import { SubscriptionCallback } from "components/types/SubscriptionCallback";
1988
+ export type AvoidReactDiffProps = {
1989
+ name?: string;
1990
+ updater: SubscriptionCallback<Renderable>;
1991
+ };
1992
+ function AvoidReactDiffFn(props: AvoidReactDiffProps): JSX.Element;
1993
+ export const AvoidReactDiff: React.MemoExoticComponent<typeof AvoidReactDiffFn>;
1994
+ }
1979
1995
  declare module "components/RawList/types" {
1980
1996
  import type { RefCallback } from 'react';
1981
1997
  import type { Renderable } from "components/types/Renderable";
@@ -2010,6 +2026,7 @@ declare module "components/RawList/MappedItems" {
2010
2026
  private renderedElements;
2011
2027
  constructor(axis: string);
2012
2028
  init(): void;
2029
+ reset(): void;
2013
2030
  destroy(): void;
2014
2031
  getUnrenderedItems: (startIndex: number, endIndex: number) => number[];
2015
2032
  getElementsOutsideItemRange: (startIndex: number, endIndex: number) => number[];
@@ -2026,17 +2043,6 @@ declare module "components/RawList/MappedItems" {
2026
2043
  discardElementsStartingWith: (elementIndex: number, callback?: ((index: number) => void) | undefined) => boolean;
2027
2044
  }
2028
2045
  }
2029
- declare module "components/RawList/AvoidReactDiff" {
2030
- import * as React from 'react';
2031
- import { Renderable } from "components/types/Renderable";
2032
- import { SubscriptionCallback } from "components/types/SubscriptionCallback";
2033
- export type AvoidReactDiffProps = {
2034
- name?: string;
2035
- updater: SubscriptionCallback<Renderable>;
2036
- };
2037
- function AvoidReactDiffFn(props: AvoidReactDiffProps): JSX.Element;
2038
- export const AvoidReactDiff: React.MemoExoticComponent<typeof AvoidReactDiffFn>;
2039
- }
2040
2046
  declare module "components/RawList/ReactVirtualRenderer" {
2041
2047
  import type { Renderable } from "components/types/Renderable";
2042
2048
  import type { RenderItem } from "components/RawList/types";
@@ -2066,8 +2072,22 @@ declare module "components/RawList/ReactVirtualRenderer" {
2066
2072
  private renderItemAtElement;
2067
2073
  private updateElementPosition;
2068
2074
  destroy: () => void;
2075
+ reset(): void;
2069
2076
  }
2070
2077
  }
2078
+ declare module "components/RawList/useVirtualRenderer" {
2079
+ import { Renderable } from "components/types/Renderable";
2080
+ import { SubscriptionCallback } from "components/types/SubscriptionCallback";
2081
+ import { VirtualBrain } from "components/VirtualBrain/index";
2082
+ import { ReactVirtualRenderer } from "components/RawList/ReactVirtualRenderer";
2083
+ export function useVirtualRenderer({ brain, }: {
2084
+ brain: VirtualBrain;
2085
+ debugChannel?: string;
2086
+ }): {
2087
+ onRenderUpdater: SubscriptionCallback<Renderable>;
2088
+ renderer: ReactVirtualRenderer;
2089
+ };
2090
+ }
2071
2091
  declare module "components/RawList/index" {
2072
2092
  import * as React from 'react';
2073
2093
  import { RawListProps } from "components/RawList/types";
package/index.esm.js CHANGED
@@ -211,6 +211,8 @@ var require_common = __commonJS({
211
211
  function createDebug(namespace) {
212
212
  let prevTime;
213
213
  let enableOverride = null;
214
+ let namespacesCache;
215
+ let enabledCache;
214
216
  function debug6(...args) {
215
217
  if (!debug6.enabled) {
216
218
  return;
@@ -253,7 +255,16 @@ var require_common = __commonJS({
253
255
  Object.defineProperty(debug6, "enabled", {
254
256
  enumerable: true,
255
257
  configurable: false,
256
- get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
258
+ get: () => {
259
+ if (enableOverride !== null) {
260
+ return enableOverride;
261
+ }
262
+ if (namespacesCache !== createDebug.namespaces) {
263
+ namespacesCache = createDebug.namespaces;
264
+ enabledCache = createDebug.enabled(namespace);
265
+ }
266
+ return enabledCache;
267
+ },
257
268
  set: (v) => {
258
269
  enableOverride = v;
259
270
  }
@@ -270,6 +281,7 @@ var require_common = __commonJS({
270
281
  }
271
282
  function enable(namespaces) {
272
283
  createDebug.save(namespaces);
284
+ createDebug.namespaces = namespaces;
273
285
  createDebug.names = [];
274
286
  createDebug.skips = [];
275
287
  let i;
@@ -497,6 +509,99 @@ var require_browser = __commonJS({
497
509
  }
498
510
  });
499
511
 
512
+ // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js
513
+ var require_vanilla_extract_recipes_createRuntimeFn_cjs_dev = __commonJS({
514
+ "node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js"(exports) {
515
+ "use strict";
516
+ Object.defineProperty(exports, "__esModule", { value: true });
517
+ function _defineProperty(obj, key, value) {
518
+ if (key in obj) {
519
+ Object.defineProperty(obj, key, {
520
+ value,
521
+ enumerable: true,
522
+ configurable: true,
523
+ writable: true
524
+ });
525
+ } else {
526
+ obj[key] = value;
527
+ }
528
+ return obj;
529
+ }
530
+ function ownKeys(object, enumerableOnly) {
531
+ var keys = Object.keys(object);
532
+ if (Object.getOwnPropertySymbols) {
533
+ var symbols = Object.getOwnPropertySymbols(object);
534
+ if (enumerableOnly) {
535
+ symbols = symbols.filter(function(sym) {
536
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
537
+ });
538
+ }
539
+ keys.push.apply(keys, symbols);
540
+ }
541
+ return keys;
542
+ }
543
+ function _objectSpread2(target) {
544
+ for (var i = 1; i < arguments.length; i++) {
545
+ var source = arguments[i] != null ? arguments[i] : {};
546
+ if (i % 2) {
547
+ ownKeys(Object(source), true).forEach(function(key) {
548
+ _defineProperty(target, key, source[key]);
549
+ });
550
+ } else if (Object.getOwnPropertyDescriptors) {
551
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
552
+ } else {
553
+ ownKeys(Object(source)).forEach(function(key) {
554
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
555
+ });
556
+ }
557
+ }
558
+ return target;
559
+ }
560
+ var shouldApplyCompound = (compoundCheck, selections) => {
561
+ for (var key of Object.keys(compoundCheck)) {
562
+ if (compoundCheck[key] !== selections[key]) {
563
+ return false;
564
+ }
565
+ }
566
+ return true;
567
+ };
568
+ var createRuntimeFn = (config) => (options) => {
569
+ var className = config.defaultClassName;
570
+ var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
571
+ for (var variantName in selections) {
572
+ var _selections$variantNa;
573
+ var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
574
+ if (variantSelection != null) {
575
+ var selection = variantSelection;
576
+ if (typeof selection === "boolean") {
577
+ selection = selection === true ? "true" : "false";
578
+ }
579
+ className += " " + config.variantClassNames[variantName][selection];
580
+ }
581
+ }
582
+ for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
583
+ if (shouldApplyCompound(compoundCheck, selections)) {
584
+ className += " " + compoundClassName;
585
+ }
586
+ }
587
+ return className;
588
+ };
589
+ exports.createRuntimeFn = createRuntimeFn;
590
+ }
591
+ });
592
+
593
+ // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js
594
+ var require_vanilla_extract_recipes_createRuntimeFn_cjs = __commonJS({
595
+ "node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js"(exports, module) {
596
+ "use strict";
597
+ if (false) {
598
+ module.exports = null;
599
+ } else {
600
+ module.exports = require_vanilla_extract_recipes_createRuntimeFn_cjs_dev();
601
+ }
602
+ }
603
+ });
604
+
500
605
  // node_modules/binary-search/index.js
501
606
  var require_binary_search = __commonJS({
502
607
  "node_modules/binary-search/index.js"(exports, module) {
@@ -558,7 +663,7 @@ var require_decamelize = __commonJS({
558
663
  if (preserveConsecutiveUppercase) {
559
664
  return handlePreserveConsecutiveUppercase(decamelized, separator);
560
665
  }
561
- return decamelized.replace(/(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement).toLowerCase();
666
+ return decamelized.replace(/(\p{Uppercase_Letter})(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement).toLowerCase();
562
667
  };
563
668
  }
564
669
  });
@@ -1967,43 +2072,10 @@ function ExpanderIcon(props) {
1967
2072
  }));
1968
2073
  }
1969
2074
 
1970
- // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
1971
- var shouldApplyCompound = (compoundCheck, selections) => {
1972
- for (const key of Object.keys(compoundCheck)) {
1973
- if (compoundCheck[key] !== selections[key]) {
1974
- return false;
1975
- }
1976
- }
1977
- return true;
1978
- };
1979
- var createRuntimeFn = (config) => (options) => {
1980
- let className = config.defaultClassName;
1981
- const selections = {
1982
- ...config.defaultVariants,
1983
- ...options
1984
- };
1985
- for (const variantName in selections) {
1986
- var _selections$variantNa;
1987
- const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
1988
- if (variantSelection != null) {
1989
- let selection = variantSelection;
1990
- if (typeof selection === "boolean") {
1991
- selection = selection === true ? "true" : "false";
1992
- }
1993
- className += " " + config.variantClassNames[variantName][selection];
1994
- }
1995
- }
1996
- for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
1997
- if (shouldApplyCompound(compoundCheck, selections)) {
1998
- className += " " + compoundClassName;
1999
- }
2000
- }
2001
- return className;
2002
- };
2003
-
2004
2075
  // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
2076
+ var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
2005
2077
  var GroupRowExpanderCls = "_7pupv0b";
2006
- var RowClsRecipe = createRuntimeFn({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
2078
+ var RowClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
2007
2079
  var RowHoverCls = "_7pupv01";
2008
2080
 
2009
2081
  // src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
@@ -3500,7 +3572,7 @@ function getColumnsWhenGrouping(params) {
3500
3572
  columns.forEach((col, colId) => {
3501
3573
  computedColumns.set(colId, col);
3502
3574
  });
3503
- return computedColumns;
3575
+ return computedColumns.size ? computedColumns : void 0;
3504
3576
  }
3505
3577
 
3506
3578
  // src/components/InfiniteTable/hooks/useComputed.ts
@@ -3706,10 +3778,11 @@ function VerticalScrollbarPlaceholderFn(props) {
3706
3778
  var VerticalScrollbarPlaceholder = memo2(VerticalScrollbarPlaceholderFn);
3707
3779
 
3708
3780
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
3781
+ var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3709
3782
  var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
3710
3783
  var HeaderCellProxy = "_12zfob10";
3711
- var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "_12zfob1c", variantClassNames: { dragging: { true: "_12zfob1d", false: "_12zfob1e" }, first: { true: "_12zfob1f", false: "_12zfob1g" }, last: { true: "_12zfob1h", false: "_12zfob1i" }, groupByField: { true: "_12zfob1j", false: "_12zfob1k" }, firstInCategory: { true: "_12zfob1l", false: "_12zfob1m" }, lastInCategory: { true: "_12zfob1n", false: "_12zfob1o" }, pinned: { start: "_12zfob1p", end: "_12zfob1q", false: "_12zfob1r" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1s"], [{ pinned: "end", firstInCategory: true }, "_12zfob1t"], [{ pinned: false, lastInCategory: true }, "_12zfob1u"]] });
3712
- var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "_12zfob12 _16lm1iw10", variantClassNames: { pinned: { start: "_12zfob13", end: "_12zfob14", false: "_12zfob15" }, virtualized: { true: "_12zfob16", false: "_12zfob17" }, overflow: { true: "_12zfob18", false: "_12zfob19" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1a"], [{ overflow: true, pinned: "end" }, "_12zfob1b"]] });
3784
+ var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1c", variantClassNames: { dragging: { true: "_12zfob1d", false: "_12zfob1e" }, first: { true: "_12zfob1f", false: "_12zfob1g" }, last: { true: "_12zfob1h", false: "_12zfob1i" }, groupByField: { true: "_12zfob1j", false: "_12zfob1k" }, firstInCategory: { true: "_12zfob1l", false: "_12zfob1m" }, lastInCategory: { true: "_12zfob1n", false: "_12zfob1o" }, pinned: { start: "_12zfob1p", end: "_12zfob1q", false: "_12zfob1r" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1s"], [{ pinned: "end", firstInCategory: true }, "_12zfob1t"], [{ pinned: false, lastInCategory: true }, "_12zfob1u"]] });
3785
+ var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob12 _16lm1iw10", variantClassNames: { pinned: { start: "_12zfob13", end: "_12zfob14", false: "_12zfob15" }, virtualized: { true: "_12zfob16", false: "_12zfob17" }, overflow: { true: "_12zfob18", false: "_12zfob19" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1a"], [{ overflow: true, pinned: "end" }, "_12zfob1b"]] });
3713
3786
  var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
3714
3787
  var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
3715
3788
  var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
@@ -3745,9 +3818,10 @@ var useInfiniteTableState = () => {
3745
3818
  };
3746
3819
 
3747
3820
  // src/components/InfiniteTable/components/cell.css.ts
3821
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3748
3822
  var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
3749
3823
  var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
3750
- var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_16lm1iw2 _16lm1iwo _16lm1iw7 _16lm1iwr", variantClassNames: { dragging: { false: "_1eexc2a7" }, first: { true: "_1eexc2a8", false: "_1eexc2a9" }, last: { true: "_1eexc2aa", false: "_1eexc2ab" }, groupByField: { true: "_1eexc2ac", false: "_1eexc2ad" }, firstInCategory: { true: "_1eexc2ae", false: "_1eexc2af" }, lastInCategory: { true: "_1eexc2ag", false: "_1eexc2ah" }, pinned: { start: "_1eexc2ai", end: "_1eexc2aj", false: "_1eexc2ak" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2al"], [{ pinned: "end", firstInCategory: true }, "_1eexc2am"]] });
3824
+ var ColumnCellRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_16lm1iw2 _16lm1iwo _16lm1iw7 _16lm1iwr", variantClassNames: { dragging: { false: "_1eexc2a7" }, first: { true: "_1eexc2a8", false: "_1eexc2a9" }, last: { true: "_1eexc2aa", false: "_1eexc2ab" }, groupByField: { true: "_1eexc2ac", false: "_1eexc2ad" }, firstInCategory: { true: "_1eexc2ae", false: "_1eexc2af" }, lastInCategory: { true: "_1eexc2ag", false: "_1eexc2ah" }, pinned: { start: "_1eexc2ai", end: "_1eexc2aj", false: "_1eexc2ak" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2al"], [{ pinned: "end", firstInCategory: true }, "_1eexc2am"]] });
3751
3825
  var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
3752
3826
 
3753
3827
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
@@ -4170,7 +4244,29 @@ import {
4170
4244
  createElement as createElement14,
4171
4245
  memo as memo5
4172
4246
  } from "react";
4173
- import { useMemo as useMemo7, useEffect as useEffect11 } from "react";
4247
+ import { useEffect as useEffect11 } from "react";
4248
+
4249
+ // src/components/RawList/AvoidReactDiff.tsx
4250
+ import {
4251
+ Fragment as Fragment3,
4252
+ createElement as createElement12,
4253
+ memo as memo4
4254
+ } from "react";
4255
+ import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
4256
+ function AvoidReactDiffFn(props) {
4257
+ const [children, setChildren] = useState7(props.updater.get());
4258
+ useLayoutEffect4(() => {
4259
+ const remove = props.updater.onChange((children2) => {
4260
+ setChildren(children2);
4261
+ });
4262
+ return remove;
4263
+ }, [props.updater]);
4264
+ return /* @__PURE__ */ createElement12(Fragment3, null, children);
4265
+ }
4266
+ var AvoidReactDiff = memo4(AvoidReactDiffFn);
4267
+
4268
+ // src/components/RawList/useVirtualRenderer.ts
4269
+ import { useMemo as useMemo7 } from "react";
4174
4270
 
4175
4271
  // src/components/RawList/ReactVirtualRenderer.tsx
4176
4272
  import {
@@ -4270,6 +4366,9 @@ var MappedItems = class extends Logger {
4270
4366
  this.itemIndexToElementIndex = {};
4271
4367
  this.renderedElements = {};
4272
4368
  }
4369
+ reset() {
4370
+ this.init();
4371
+ }
4273
4372
  destroy() {
4274
4373
  this.init();
4275
4374
  }
@@ -4289,25 +4388,6 @@ var MappedItems = class extends Logger {
4289
4388
  }
4290
4389
  };
4291
4390
 
4292
- // src/components/RawList/AvoidReactDiff.tsx
4293
- import {
4294
- Fragment as Fragment3,
4295
- createElement as createElement12,
4296
- memo as memo4
4297
- } from "react";
4298
- import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
4299
- function AvoidReactDiffFn(props) {
4300
- const [children, setChildren] = useState7(props.updater.get());
4301
- useLayoutEffect4(() => {
4302
- const remove = props.updater.onChange((children2) => {
4303
- setChildren(children2);
4304
- });
4305
- return remove;
4306
- }, [props.updater]);
4307
- return /* @__PURE__ */ createElement12(Fragment3, null, children);
4308
- }
4309
- var AvoidReactDiff = memo4(AvoidReactDiffFn);
4310
-
4311
4391
  // src/components/RawList/ReactVirtualRenderer.tsx
4312
4392
  var ITEM_POSITION_WITH_TRANSFORM = true;
4313
4393
  var ReactVirtualRenderer = class extends Logger {
@@ -4414,17 +4494,12 @@ var ReactVirtualRenderer = class extends Logger {
4414
4494
  }
4415
4495
  };
4416
4496
  this.destroy = () => {
4417
- if (true) {
4418
- return;
4419
- }
4420
4497
  this.destroyed = true;
4421
- this.mappedItems.destroy();
4422
- this.itemDOMElements = [];
4423
- this.itemDOMRefs = [];
4424
- this.updaters = [];
4498
+ this.reset();
4425
4499
  this.onRender = null;
4426
4500
  this.renderItem = null;
4427
4501
  this.brain = null;
4502
+ this.mappedItems = null;
4428
4503
  };
4429
4504
  if (onRender) {
4430
4505
  this.onRender = onRender;
@@ -4482,18 +4557,43 @@ var ReactVirtualRenderer = class extends Logger {
4482
4557
  itemUpdater(renderedNode);
4483
4558
  this.updateElementPosition(elementIndex);
4484
4559
  }
4560
+ reset() {
4561
+ this.itemDOMElements = {};
4562
+ this.itemDOMRefs = {};
4563
+ this.updaters = {};
4564
+ this.items = [];
4565
+ this.mappedItems.reset();
4566
+ }
4485
4567
  };
4486
4568
 
4569
+ // src/components/RawList/useVirtualRenderer.ts
4570
+ function createRenderer(brain) {
4571
+ const renderer = new ReactVirtualRenderer(brain, {});
4572
+ const onRenderUpdater = buildSubscriptionCallback();
4573
+ brain.onDestroy(() => {
4574
+ renderer.destroy();
4575
+ onRenderUpdater.destroy();
4576
+ });
4577
+ return {
4578
+ renderer,
4579
+ onRenderUpdater
4580
+ };
4581
+ }
4582
+ function useVirtualRenderer({
4583
+ brain
4584
+ }) {
4585
+ return useMemo7(() => {
4586
+ return createRenderer(brain);
4587
+ }, [brain]);
4588
+ }
4589
+
4487
4590
  // src/components/RawList/index.tsx
4488
4591
  function RawListFn(props) {
4489
4592
  const { renderItem, brain, debugChannel } = props;
4490
- const { onRenderUpdater, renderer } = useMemo7(() => {
4491
- const onRenderUpdater2 = buildSubscriptionCallback();
4492
- const renderer2 = new ReactVirtualRenderer(brain, {
4493
- channel: debugChannel
4494
- });
4495
- return { onRenderUpdater: onRenderUpdater2, renderer: renderer2 };
4496
- }, []);
4593
+ const { onRenderUpdater, renderer } = useVirtualRenderer({
4594
+ brain,
4595
+ debugChannel
4596
+ });
4497
4597
  const getRenderItem = useLatest(renderItem);
4498
4598
  useEffect11(() => {
4499
4599
  const renderRange = brain.getRenderRange();
@@ -4502,7 +4602,7 @@ function RawListFn(props) {
4502
4602
  force: true,
4503
4603
  onRender: onRenderUpdater
4504
4604
  });
4505
- }, [renderItem, onRenderUpdater]);
4605
+ }, [brain, renderItem, onRenderUpdater]);
4506
4606
  useEffect11(() => {
4507
4607
  const remove = brain.onRenderRangeChange((renderRange) => {
4508
4608
  renderer.renderRange(renderRange, {
@@ -4513,12 +4613,6 @@ function RawListFn(props) {
4513
4613
  });
4514
4614
  return remove;
4515
4615
  }, [brain, onRenderUpdater]);
4516
- useEffect11(() => {
4517
- return () => {
4518
- renderer.destroy();
4519
- onRenderUpdater.destroy();
4520
- };
4521
- }, [renderer, onRenderUpdater]);
4522
4616
  return /* @__PURE__ */ createElement14(AvoidReactDiff, {
4523
4617
  updater: onRenderUpdater
4524
4618
  });
@@ -5138,7 +5232,7 @@ var VirtualList = (props) => {
5138
5232
  brain: virtualBrain,
5139
5233
  renderItem,
5140
5234
  repaintId,
5141
- debugChannel: "VirtualList"
5235
+ debugChannel: "VirtualList-" + mainAxis
5142
5236
  })), children, /* @__PURE__ */ createElement22(SpacePlaceholder, {
5143
5237
  count,
5144
5238
  width,
@@ -5584,13 +5678,14 @@ function useUnpinnedRendering(params) {
5584
5678
  import { useCallback as useCallback13, useEffect as useEffect16, useRef as useRef13 } from "react";
5585
5679
 
5586
5680
  // src/components/InfiniteTable/InfiniteCls.css.ts
5681
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5587
5682
  var FooterCls = "_16lm1iw1";
5588
5683
  var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
5589
- var InfiniteClsRecipe = createRuntimeFn({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [] });
5684
+ var InfiniteClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [] });
5590
5685
  var InfiniteClsScrolling = "_1yeub2v1";
5591
5686
  var InfiniteClsShiftingColumns = "_16lm1iwm";
5592
5687
  var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
5593
- var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
5688
+ var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
5594
5689
 
5595
5690
  // src/components/InfiniteTable/hooks/useOnContainerScroll.ts
5596
5691
  var DELAY = 200;
@@ -5976,11 +6071,13 @@ var VirtualBrain = class extends Logger {
5976
6071
  super(`VirtualBrain:${options.mainAxis}`);
5977
6072
  this.scrollPosition = initialScrollPosition2;
5978
6073
  this.scrollPositionOnMainAxis = 0;
6074
+ this.destroyed = false;
5979
6075
  this.totalSize = 0;
5980
6076
  this.onScrollFns = [];
5981
6077
  this.onTotalSizeChangeFns = [];
5982
6078
  this.onRenderCountChangeFns = [];
5983
6079
  this.onRenderRangeChangeFns = [];
6080
+ this.onDestroyFns = [];
5984
6081
  this.renderCount = 0;
5985
6082
  this.renderRange = {
5986
6083
  renderStartIndex: -1,
@@ -6077,6 +6174,12 @@ var VirtualBrain = class extends Logger {
6077
6174
  this.onRenderRangeChangeFns = this.onRenderRangeChangeFns.filter((f) => f !== fn);
6078
6175
  };
6079
6176
  };
6177
+ this.onDestroy = (fn) => {
6178
+ this.onDestroyFns.push(fn);
6179
+ return () => {
6180
+ this.onDestroyFns = this.onDestroyFns.filter((f) => f !== fn);
6181
+ };
6182
+ };
6080
6183
  this.update = (newCount, newItemSize, newItemSpan) => {
6081
6184
  const { itemSize, count, itemSpan } = this.options;
6082
6185
  const countChange = count !== newCount;
@@ -6273,7 +6376,13 @@ var VirtualBrain = class extends Logger {
6273
6376
  return result;
6274
6377
  };
6275
6378
  this.destroy = () => {
6379
+ if (this.destroyed) {
6380
+ return;
6381
+ }
6382
+ this.notifyDestroy();
6276
6383
  this.reset();
6384
+ this.destroyed = true;
6385
+ this.onDestroyFns = [];
6277
6386
  this.onScrollFns = [];
6278
6387
  this.onTotalSizeChangeFns = [];
6279
6388
  this.onRenderCountChangeFns = [];
@@ -6309,6 +6418,12 @@ var VirtualBrain = class extends Logger {
6309
6418
  fns[i](scrollPosition);
6310
6419
  }
6311
6420
  }
6421
+ notifyDestroy() {
6422
+ const fns = this.onDestroyFns;
6423
+ for (let i = 0, len = fns.length; i < len; i++) {
6424
+ fns[i]();
6425
+ }
6426
+ }
6312
6427
  notifyTotalSizeChange() {
6313
6428
  const totalSize = this.getTotalSize();
6314
6429
  const fns = this.onTotalSizeChangeFns;
@@ -6419,9 +6534,14 @@ function useYourBrain(param) {
6419
6534
  });
6420
6535
  return brain;
6421
6536
  });
6537
+ useEffect19(() => {
6538
+ return () => {
6539
+ horizontalVirtualBrain.destroy();
6540
+ verticalVirtualBrain.destroy();
6541
+ };
6542
+ }, []);
6422
6543
  horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
6423
6544
  verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
6424
- globalThis.verticalVirtualBrain = verticalVirtualBrain;
6425
6545
  useEffect19(() => {
6426
6546
  verticalVirtualBrain.setAvailableSize({
6427
6547
  height: bodySize.height,
@@ -6857,7 +6977,7 @@ var useLicense = (licenseKey) => {
6857
6977
  const valid = useMemo11(() => {
6858
6978
  let valid2 = isValidLicense(licenseKey, {
6859
6979
  publishedAt: 1624970570587,
6860
- version: "0.0.6"
6980
+ version: "0.0.7"
6861
6981
  });
6862
6982
  if (!licenseKey && !valid2 && isInsideSandbox) {
6863
6983
  return true;