react-virtuoso
Advanced tools
Comparing version 0.12.3 to 0.12.4
@@ -1,211 +0,3 @@ | ||
import React from "react"; | ||
import { ReactElement, CSSProperties, FC, PureComponent } from "react"; | ||
declare type TSubscriber<T> = (val: T) => void; | ||
declare type TSubscription = () => void; | ||
declare type TSubscribe<T> = (subscriber: TSubscriber<T>) => TSubscription; | ||
declare type TOperator<T, K> = (val: T, done: (result: K) => void) => void; | ||
interface TObservable<T> { | ||
subscribe: TSubscribe<T>; | ||
pipe(...operators: []): TObservable<T>; | ||
pipe<R1>(...operators: [TOperator<T, R1>]): TObservable<R1>; | ||
pipe<R1, R2>(...operators: [TOperator<T, R1>, TOperator<R1, R2>]): TObservable<R2>; | ||
pipe<R1, R2, R3>(...operators: [TOperator<T, R1>, TOperator<R1, R2>, TOperator<R2, R3>]): TObservable<R3>; | ||
} | ||
declare function combineLatest<S1, S2>(s1: TObservable<S1>, s2: TObservable<S2>): TObservable<[S1, S2]>; | ||
declare function combineLatest<S1, S2, S3>(s1: TObservable<S1>, s2: TObservable<S2>, s3: TObservable<S3>): TObservable<[S1, S2, S3]>; | ||
declare function combineLatest<S1, S2, S3, S4>(s1: TObservable<S1>, s2: TObservable<S2>, s3: TObservable<S3>, s4: TObservable<S4>): TObservable<[S1, S2, S3, S4]>; | ||
declare function combineLatest<S1, S2, S3, S4, S5, S6, S7>(s1: TObservable<S1>, s2: TObservable<S2>, s3: TObservable<S3>, s4: TObservable<S4>, s5: TObservable<S5>, s6: TObservable<S6>, s7: TObservable<S7>): TObservable<[S1, S2, S3, S4, S5, S6, S7]>; | ||
declare function combineLatest<S1, S2, S3, S4, S5, S6, S7, S8>(s1: TObservable<S1>, s2: TObservable<S2>, s3: TObservable<S3>, s4: TObservable<S4>, s5: TObservable<S5>, s6: TObservable<S6>, s7: TObservable<S7>, s8: TObservable<S8>): TObservable<[S1, S2, S3, S4, S5, S6, S7, S8]>; | ||
declare function withLatestFrom<T, R1>(s1: TObservable<R1>): (val: T, done: TSubscriber<[T, R1]>) => void; | ||
declare function withLatestFrom<T, R1, R2>(s1: TObservable<R1>, s2: TObservable<R2>): (val: T, done: TSubscriber<[T, R1, R2]>) => void; | ||
declare function withLatestFrom<T, R1, R2, R3>(s1: TObservable<R1>, s2: TObservable<R2>, s3: TObservable<R3>): (val: T, done: TSubscriber<[T, R1, R2, R3]>) => void; | ||
declare function withLatestFrom<T, R1, R2, R3, R4>(s1: TObservable<R1>, s2: TObservable<R2>, s3: TObservable<R3>, s4: TObservable<R4>): (val: T, done: TSubscriber<[T, R1, R2, R3, R4]>) => void; | ||
declare function withLatestFrom<T, R1, R2, R3, R4, R5>(s1: TObservable<R1>, s2: TObservable<R2>, s3: TObservable<R3>, s4: TObservable<R4>, s5: TObservable<R5>): (val: T, done: TSubscriber<[T, R1, R2, R3, R4, R5]>) => void; | ||
interface TScrollLocationWithAlign { | ||
index: number; | ||
align: 'start' | 'center' | 'end'; | ||
} | ||
declare type TScrollLocation = number | TScrollLocationWithAlign; | ||
interface Item { | ||
index: number; | ||
offset: number; | ||
size: number; | ||
} | ||
interface RecordItem extends Item { | ||
type: 'item'; | ||
transposedIndex: number; | ||
groupIndex: number; | ||
} | ||
interface GroupItem extends Item { | ||
type: 'group'; | ||
groupIndex: number; | ||
} | ||
declare type ListItem = RecordItem | GroupItem; | ||
declare type CallbackRefParam = HTMLElement | null; | ||
declare type CallbackRef = (ref: CallbackRefParam) => void; | ||
interface ItemHeight { | ||
start: number; | ||
end: number; | ||
size: number; | ||
} | ||
interface TVirtuosoConstructorParams { | ||
overscan?: number; | ||
totalCount?: number; | ||
topItems?: number; | ||
itemHeight?: number; | ||
} | ||
declare const VirtuosoStore: ({ overscan, totalCount, itemHeight }: TVirtuosoConstructorParams) => { | ||
groupCounts: (value: number[]) => void; | ||
itemHeights: (value: ItemHeight[]) => void; | ||
footerHeight: (value: number) => void; | ||
listHeight: (value: number) => void; | ||
viewportHeight: (value: number) => void; | ||
scrollTop: (value: number) => void; | ||
topItemCount: (value: number) => void; | ||
totalCount: (value: number) => void; | ||
scrollToIndex: (value: TScrollLocation) => void; | ||
initialItemCount: (value: number) => void; | ||
list: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
itemsRendered: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
topList: (callback: ((val: ListItem[]) => void) | undefined) => void; | ||
listOffset: (callback: ((val: number) => void) | undefined) => void; | ||
totalHeight: (callback: ((val: number) => void) | undefined) => void; | ||
endReached: (callback: ((val: number) => void) | undefined) => void; | ||
totalListHeightChanged: (callback: ((val: number) => void) | undefined) => void; | ||
isScrolling: (callback: ((val: boolean) => void) | undefined) => void; | ||
stickyItems: (callback: ((val: number[]) => void) | undefined) => void; | ||
groupIndices: (callback: ((val: number[]) => void) | undefined) => void; | ||
stickyItemsOffset: (callback: ((val: number) => void) | undefined) => void; | ||
scrollTo: (callback: ((val: number) => void) | undefined) => void; | ||
}; | ||
interface TRenderProps { | ||
key: number; | ||
'data-index': number; | ||
'data-known-size': number; | ||
style?: CSSProperties; | ||
} | ||
declare type TRender = (item: ListItem, props: TRenderProps) => ReactElement; | ||
declare type TScrollContainer = FC<{ | ||
style: CSSProperties; | ||
className?: string; | ||
reportScrollTop: (scrollTop: number) => void; | ||
scrollTo: (callback: (scrollTop: number) => void) => void; | ||
}>; | ||
declare const DefaultFooterContainer: React.FC<{ | ||
footerRef: CallbackRef; | ||
}>; | ||
declare const DefaultListContainer: React.FC<{ | ||
listRef: CallbackRef; | ||
style: CSSProperties; | ||
}>; | ||
declare type TListContainer = typeof DefaultListContainer; | ||
declare type TFooterContainer = typeof DefaultFooterContainer; | ||
declare type VirtuosoState = ReturnType<typeof VirtuosoStore>; | ||
declare type TItemContainer = React.FC<TRenderProps>; | ||
interface VirtuosoProps { | ||
totalCount: number; | ||
overscan?: number; | ||
topItems?: number; | ||
footer?: () => ReactElement; | ||
item: (index: number) => ReactElement; | ||
computeItemKey?: (index: number) => number; | ||
itemHeight?: number; | ||
endReached?: (index: number) => void; | ||
scrollingStateChange?: (isScrolling: boolean) => void; | ||
itemsRendered?: TSubscriber<ListItem[]>; | ||
totalListHeightChanged?: TSubscriber<number>; | ||
style?: CSSProperties; | ||
className?: string; | ||
initialItemCount?: number; | ||
ScrollContainer?: TScrollContainer; | ||
FooterContainer?: TFooterContainer; | ||
ListContainer?: TListContainer; | ||
ItemContainer?: TItemContainer; | ||
} | ||
interface TVirtuosoPresentationProps { | ||
contextValue: VirtuosoState; | ||
item: TRender; | ||
footer?: () => ReactElement; | ||
style?: CSSProperties; | ||
className?: string; | ||
itemHeight?: number; | ||
ScrollContainer?: TScrollContainer; | ||
FooterContainer?: TFooterContainer; | ||
ListContainer?: TListContainer; | ||
} | ||
declare const VirtuosoPresentation: FC<TVirtuosoPresentationProps>; | ||
declare class Virtuoso extends PureComponent<VirtuosoProps, VirtuosoState> { | ||
constructor(props: VirtuosoProps); | ||
static getDerivedStateFromProps(props: VirtuosoProps, state: VirtuosoState): null; | ||
private itemRender; | ||
scrollToIndex(location: TScrollLocation): void; | ||
componentWillUnmount(): void; | ||
render(): JSX.Element; | ||
} | ||
declare type GroupedVirtuosoProps = Pick<VirtuosoProps, Exclude<keyof VirtuosoProps, 'totalCount' | 'topItems' | 'item'>> & { | ||
groupCounts: number[]; | ||
group: (groupIndex: number) => ReactElement; | ||
item: (index: number, groupIndex: number) => ReactElement; | ||
groupIndices?: (indices: number[]) => void; | ||
GroupContainer?: TItemContainer; | ||
}; | ||
declare class GroupedVirtuoso extends PureComponent<GroupedVirtuosoProps, VirtuosoState> { | ||
constructor(props: GroupedVirtuosoProps); | ||
static getDerivedStateFromProps(props: GroupedVirtuosoProps, state: VirtuosoState): null; | ||
protected itemRender: TRender; | ||
scrollToIndex(location: TScrollLocation): void; | ||
componentWillUnmount(): void; | ||
render(): JSX.Element; | ||
} | ||
declare const VirtuosoGridEngine: () => { | ||
gridDimensions: (value: [number, number, number | undefined, number | undefined]) => void; | ||
totalCount: (value: number) => void; | ||
scrollTop: (value: number) => void; | ||
overscan: (value: number) => void; | ||
scrollToIndex: (value: TScrollLocation) => void; | ||
itemRange: (callback: ((val: [number, number]) => void) | undefined) => void; | ||
totalHeight: (callback: ((val: number) => void) | undefined) => void; | ||
listOffset: (callback: ((val: number) => void) | undefined) => void; | ||
scrollTo: (callback: ((val: number) => void) | undefined) => void; | ||
isScrolling: (callback: ((val: boolean) => void) | undefined) => void; | ||
endReached: (callback: ((val: number) => void) | undefined) => void; | ||
}; | ||
declare type TContainer = React.ComponentType<{ | ||
className: string; | ||
style?: CSSProperties; | ||
key?: number; | ||
}> | keyof JSX.IntrinsicElements; | ||
interface VirtuosoGridProps { | ||
totalCount: number; | ||
overscan?: number; | ||
item: (index: number) => ReactElement; | ||
style?: CSSProperties; | ||
className?: string; | ||
ScrollContainer?: TScrollContainer; | ||
ListContainer?: TContainer; | ||
ItemContainer?: TContainer; | ||
listClassName?: string; | ||
itemClassName?: string; | ||
scrollingStateChange?: (isScrolling: boolean) => void; | ||
endReached?: (index: number) => void; | ||
} | ||
declare type VirtuosoGridState = ReturnType<typeof VirtuosoGridEngine>; | ||
declare class VirtuosoGrid extends React.PureComponent<VirtuosoGridProps, VirtuosoGridState> { | ||
state: { | ||
gridDimensions: (value: [number, number, number | undefined, number | undefined]) => void; | ||
totalCount: (value: number) => void; | ||
scrollTop: (value: number) => void; | ||
overscan: (value: number) => void; | ||
scrollToIndex: (value: TScrollLocation) => void; | ||
itemRange: (callback: ((val: [number, number]) => void) | undefined) => void; | ||
totalHeight: (callback: ((val: number) => void) | undefined) => void; | ||
listOffset: (callback: ((val: number) => void) | undefined) => void; | ||
scrollTo: (callback: ((val: number) => void) | undefined) => void; | ||
isScrolling: (callback: ((val: boolean) => void) | undefined) => void; | ||
endReached: (callback: ((val: number) => void) | undefined) => void; | ||
}; | ||
static getDerivedStateFromProps(props: VirtuosoGridProps, engine: VirtuosoGridState): null; | ||
scrollToIndex(location: TScrollLocation): void; | ||
render(): JSX.Element; | ||
} | ||
export { VirtuosoStore, TScrollContainer, TListContainer, VirtuosoState, TItemContainer, VirtuosoProps, VirtuosoPresentation, Virtuoso, GroupedVirtuoso, VirtuosoGridProps, VirtuosoGrid }; | ||
export * from './Virtuoso'; | ||
export * from './GroupedVirtuoso'; | ||
export * from './VirtuosoGrid'; |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=e(require("resize-observer-polyfill"));function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t,n){return(u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function f(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e,t){return t(e)}:1===t.length?t[0]:function(e,n){var r=function(e){return n(e)};t.slice().reverse().forEach((function(e){var t=r;r=function(n){return e(n,t)}})),r(e)}}function c(e){return function(){var t=f.apply(void 0,arguments);return function(e,t){var n=function(n){return e((function(e){return t(e,n)}))};return{subscribe:n,pipe:c(n)}}(e,t)}}function h(e,t){void 0===t&&(t=!0);var n=[],r=e,i=function(e){return n.push(e),void 0!==r&&e(r),function(){n=n.filter((function(t){return t!==e}))}};return{next:function(e){t&&e===r||(r=e,n.forEach((function(t){return t(e)})))},subscribe:i,pipe:c(i),subscribers:n}}function d(){var e=[],t=function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}};return{next:function(t){e.forEach((function(e){return e(t)}))},subscribe:t,pipe:c(t)}}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length),o=[],s=function(e){r.every((function(e){return e}))&&e.forEach((function(e){return e(i)}))};t.forEach((function(e,t){e.subscribe((function(e){r[t]=!0,i[t]=e,s(o)}))}));var a=function(e){return o.push(e),s([e]),function(){o=o.filter((function(t){return t!==e}))}};return{subscribe:a,pipe:c(a)}}function p(e){return function(t,n){n(e(t))}}function g(e){return function(t,n){return n(e)}}function m(e){return function(t,n){e>0?e--:n(t)}}function y(e){return function(t,n){e(t)&&n(t)}}function x(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length);return t.forEach((function(e,t){e.subscribe((function(e){i[t]=e,r[t]=!0}))})),function(e,t){r.every((function(e){return e}))&&t([e].concat(i))}}var b=function(e){var t,n,r=h(!1);return e.pipe(m(1),g(!0)).subscribe(r.next),e.pipe(m(1),g(!1),(function(e,r){t=e,n&&clearTimeout(n),n=setTimeout((function(){r(t)}),200)})).subscribe(r.next),r},k=new(function(){function e(){this.level=0}var t=e.prototype;return t.rebalance=function(){return this},t.adjust=function(){return this},t.remove=function(){return this},t.find=function(){},t.findWith=function(){},t.findMax=function(){return-Infinity},t.findMaxValue=function(){},t.insert=function(e,t){return new w({key:e,value:t,level:1})},t.walkWithin=function(){return[]},t.walk=function(){return[]},t.ranges=function(){return[]},t.rangesWithin=function(){return[]},t.empty=function(){return!0},t.isSingle=function(){return!0},t.isInvariant=function(){return!0},t.keys=function(){return[]},e}());Object.freeze(k);var C=function(e){function t(t){return e.call(this,"Unreachable case: "+t)||this}return o(t,e),t}(l(Error)),w=function(){function e(e){var t=e.value,n=e.level,r=e.left,i=void 0===r?k:r,o=e.right,s=void 0===o?k:o;this.key=e.key,this.value=t,this.level=n,this.left=i,this.right=s}var t=e.prototype;return t.remove=function(e){var t=this.left,n=this.right;if(e===this.key){if(t.empty())return n;if(n.empty())return t;var r=t.last();return this.clone({key:r[0],value:r[1],left:t.deleteLast()}).adjust()}return e<this.key?this.clone({left:t.remove(e)}).adjust():this.clone({right:n.remove(e)}).adjust()},t.empty=function(){return!1},t.find=function(e){return e===this.key?this.value:e<this.key?this.left.find(e):this.right.find(e)},t.findWith=function(e){var t=e(this.value);switch(t){case-1:return this.left.findWith(e);case 0:return[this.key,this.value];case 1:return this.right.findWith(e);default:throw new C(t)}},t.findMax=function(e){if(this.key===e)return e;if(this.key<e){var t=this.right.findMax(e);return-Infinity===t?this.key:t}return this.left.findMax(e)},t.findMaxValue=function(e){if(this.key===e)return this.value;if(this.key<e){var t=this.right.findMaxValue(e);return void 0===t?this.value:t}return this.left.findMaxValue(e)},t.insert=function(e,t){return e===this.key?this.clone({key:e,value:t}):e<this.key?this.clone({left:this.left.insert(e,t)}).rebalance():this.clone({right:this.right.insert(e,t)}).rebalance()},t.walkWithin=function(e,t){var n=this.key,r=this.value,i=[];return n>e&&(i=i.concat(this.left.walkWithin(e,t))),n>=e&&n<=t&&i.push({key:n,value:r}),n<=t&&(i=i.concat(this.right.walkWithin(e,t))),i},t.walk=function(){return[].concat(this.left.walk(),[{key:this.key,value:this.value}],this.right.walk())},t.last=function(){return this.right.empty()?[this.key,this.value]:this.right.last()},t.deleteLast=function(){return this.right.empty()?this.left:this.clone({right:this.right.deleteLast()}).adjust()},t.clone=function(t){return new e({key:void 0!==t.key?t.key:this.key,value:void 0!==t.value?t.value:this.value,level:void 0!==t.level?t.level:this.level,left:void 0!==t.left?t.left:this.left,right:void 0!==t.right?t.right:this.right})},t.isSingle=function(){return this.level>this.right.level},t.rebalance=function(){return this.skew().split()},t.adjust=function(){var e=this.left,t=this.right,n=this.level;if(t.level>=n-1&&e.level>=n-1)return this;if(n>t.level+1){if(e.isSingle())return this.clone({level:n-1}).skew();if(e.empty()||e.right.empty())throw new Error("Unexpected empty nodes");return e.right.clone({left:e.clone({right:e.right.left}),right:this.clone({left:e.right.right,level:n-1}),level:n})}if(this.isSingle())return this.clone({level:n-1}).split();if(t.empty()||t.left.empty())throw new Error("Unexpected empty nodes");var r=t.left,i=r.isSingle()?t.level-1:t.level;return r.clone({left:this.clone({right:r.left,level:n-1}),right:t.clone({left:r.right,level:i}).split(),level:r.level+1})},t.isInvariant=function(){var e=this.left,t=this.right,n=this.level;return n===e.level+1&&(n===t.level||n===t.level+1)&&!(!t.empty()&&n<=t.right.level)&&e.isInvariant()&&t.isInvariant()},t.keys=function(){return[].concat(this.left.keys(),[this.key],this.right.keys())},t.ranges=function(){return this.toRanges(this.walk())},t.rangesWithin=function(e,t){return this.toRanges(this.walkWithin(e,t))},t.toRanges=function(e){if(0===e.length)return[];for(var t=e[0],n=t.key,r=t.value,i=[],o=1;o<=e.length;o++){var s=e[o];i.push({start:n,end:s?s.key-1:Infinity,value:r}),s&&(n=s.key,r=s.value)}return i},t.split=function(){var e=this.right,t=this.level;return e.empty()||e.right.empty()||e.level!==t||e.right.level!==t?this:e.clone({left:this.clone({right:e.left}),level:t+1})},t.skew=function(){var e=this.left;return e.empty()||e.level!==this.level?this:e.clone({right:this.clone({left:e.right})})},e}(),I=function(){function e(e){this.root=e}e.empty=function(){return new e(k)};var t=e.prototype;return t.find=function(e){return this.root.find(e)},t.findMax=function(e){return this.root.findMax(e)},t.findMaxValue=function(e){if(this.empty())throw new Error("Searching for max value in an empty tree");return this.root.findMaxValue(e)},t.findWith=function(e){return this.root.findWith(e)},t.insert=function(t,n){return new e(this.root.insert(t,n))},t.remove=function(t){return new e(this.root.remove(t))},t.empty=function(){return this.root.empty()},t.keys=function(){return this.root.keys()},t.walk=function(){return this.root.walk()},t.walkWithin=function(e,t){var n=this.root.findMax(e);return this.root.walkWithin(n,t)},t.ranges=function(){return this.root.ranges()},t.rangesWithin=function(e,t){var n=this.root.findMax(e);return this.root.rangesWithin(n,t)},t.isInvariant=function(){return this.root.isInvariant()},e}(),E=function(){function e(e){this.nanIndices=[],this.rangeTree=e;var t=I.empty(),n=0,r=!1,i=e.ranges(),o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{if((s=i.next()).done)break;a=s.value}var u=a.start,l=a.end,f=a.value;isNaN(f)?(this.nanIndices.push(u),r||(t=t.insert(n,{startIndex:u,endIndex:Infinity,size:f})),r=!0):r||(t=t.insert(n,{startIndex:u,endIndex:l,size:f}),n+=(l-u+1)*f)}this.offsetTree=t}e.create=function(){return new e(I.empty())};var t=e.prototype;return t.empty=function(){return this.rangeTree.empty()},t.insert=function(t,n,r){var i=this.rangeTree;if(i.empty())return new e(i.insert(0,r));if(this.nanIndices.length&&this.nanIndices.indexOf(n)>-1){if(i.find(this.nanIndices[0]-1)===r)return new e(I.empty().insert(0,r));var o=this.nanIndices,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}i=i.insert(u,r)}return new e(i)}var l=i.rangesWithin(t-1,n+1);if(l.some((function(e){return e.start===t&&(e.end===n||Infinity===e.end)&&e.value===r})))return this;var f=!1,c=!1,h=l,d=Array.isArray(h),v=0;for(h=d?h:h[Symbol.iterator]();;){var p;if(d){if(v>=h.length)break;p=h[v++]}else{if((v=h.next()).done)break;p=v.value}var g=p.start,m=p.end,y=p.value;f?(n>=g||r===y)&&(i=i.remove(g)):(c=y!==r,f=!0),m>n&&n>=g&&(y===r||isNaN(y)||(i=i.insert(n+1,y)))}return c&&(i=i.insert(t,r)),i===this.rangeTree?this:new e(i)},t.insertSpots=function(t,n){if(this.empty()){var r=this.rangeTree,i=t,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{if((s=i.next()).done)break;a=s.value}var u=a;r=r.insert(u,n).insert(u+1,NaN)}return new e(r)}throw new Error("attempting to overwrite non-empty tree")},t.offsetOf=function(e){if(this.offsetTree.empty())return 0;var t=this.offsetTree.findWith((function(t){return t.startIndex>e?-1:t.endIndex<e?1:0}));if(t){var n=t[1];return t[0]+(e-n.startIndex)*n.size}throw new Error("Requested offset outside of the known ones, index: "+e)},t.itemAt=function(e){return{index:e,size:this.rangeTree.findMaxValue(e),offset:NaN}},t.indexRange=function(e,t){if(this.rangeTree.empty())return[{index:0,size:0,offset:NaN}];var n=[],r=this.rangeTree.rangesWithin(e,t),i=Array.isArray(r),o=0;for(r=i?r:r[Symbol.iterator]();;){var s;if(i){if(o>=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}for(var a=s,u=Math.max(e,a.start),l=Math.min(t,void 0===a.end?Infinity:a.end),f=u;f<=l;f++)n.push({index:f,size:a.value,offset:NaN})}return n},t.range=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=Infinity),this.offsetTree.empty())return[{index:0,size:0,offset:0}];var i=[],o=this.offsetTree.rangesWithin(e,t),s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u.start,f=u.value,c=f.startIndex,h=f.endIndex,d=f.size,v=l,p=c;if(l<e&&(v+=((p+=Math.floor((e-l)/d))-c)*d),p<n&&(v+=(n-p)*d,p=n),isNaN(d))return i.push({index:p,size:0,offset:v}),i;h=Math.min(h,r);for(var g=p;g<=h&&!(v>t);g++)i.push({index:g,size:d,offset:v}),v+=d}return i},t.total=function(e){var t=0,n=this.rangeTree.rangesWithin(0,e),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var s=o.start,a=o.end,u=o.value;t+=((a=Math.min(a,e))-s+1)*(isNaN(u)?0:u)}return t},t.getOffsets=function(e){var t=this,n=I.empty();return e.forEach((function(e){var r=t.offsetOf(e);n=n.insert(r,e)})),new S(n)},e}(),S=function(){function e(e){this.tree=e}var t=e.prototype;return t.findMaxValue=function(e){return this.tree.findMaxValue(e)},t.empty=function(){return this.tree.empty()},e}(),T=function(){function e(){}return e.prototype.transpose=function(e){return e.map((function(e){return{groupIndex:0,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index,type:"item"}}))},e}(),R=function(){function e(e){this.count=e.reduce((function(e,t){return e+t+1}),0);var t=I.empty(),n=0,r=0,i=e,o=Array.isArray(i),s=0;for(i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{if((s=i.next()).done)break;a=s.value}var u=a;t=t.insert(r,[n,r]),n++,r+=u+1}this.tree=t}var t=e.prototype;return t.totalCount=function(){return this.count},t.transpose=function(e){var t=this;return e.map((function(e){var n=t.tree.find(e.index);if(n)return{groupIndex:n[0],index:e.index,offset:e.offset,size:e.size,type:"group"};var r=t.tree.findMaxValue(e.index)[0];return{groupIndex:r,index:e.index,offset:e.offset,size:e.size,transposedIndex:e.index-r-1,type:"item"}}))},t.groupIndices=function(){return this.tree.keys()},e}();function M(e){var t;return function(n){t&&t(),n&&(t=e.subscribe(n))}}function N(e){return e.next}var O=function(e,n,i){var o=t.useRef(null),s=t.useRef(0),a=t.useRef(0),u=new r((function(t){var n=t[0].contentRect.height;s.current!==n&&(s.current=n,i&&(a.current=window.requestAnimationFrame((function(){return i(t[0].target)}))),e(n))}));return t.useEffect((function(){return function(){return window.cancelAnimationFrame(a.current)}}),[]),function(e){e?(u.observe(e),n&&n(e),o.current=e):(u.unobserve(o.current),o.current=null)}};function z(e,n){var r=t.useState(function(e,t){return function(){var n=t;return e((function(e){n=e})),n}}(e,n)),i=r[0],o=r[1];return t.useLayoutEffect((function(){return e(o),function(){return e(void 0)}}),[e]),i}var A=function(e){return e.length>0?e[0].offset:0},H=function(e){return e[0].total(e[1]-1)},L=function(e){var t=e.overscan,n=void 0===t?0:t,r=e.totalCount,i=void 0===r?0:r,o=e.itemHeight,s=h(0),a=h(0),u=h(0),l=h(0),f=h(),c=h(i),g=h(),m=h(),k=E.create(),C=!1,w=h([]),I=h(),S=d();o&&(k=k.insert(0,0,o));var O=h(k);o||f.pipe(x(O,w)).subscribe((function(e){var t=e[0],n=e[1],r=e[2],i=n;C&&(i=E.create(),C=!1);var o=t,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var l=u.start,f=u.end,c=u.size;i=i.empty()&&l===f&&r.indexOf(l)>-1?i.insertSpots(r,c):i.insert(l,f,c)}i!==n&&O.next(i)}));var z=new T;g.subscribe((function(e){z=new R(e),c.next(z.totalCount()),w.next(z.groupIndices())}));var L=v(O,c).pipe(p(H)),W=v(L,l).pipe(p((function(e){return e[0]+e[1]}))),j=v(O,w).pipe(p((function(e){return e[0].getOffsets(e[1])}))),V=h([]);v(O,m,c,s).pipe(y((function(e){return e[1]>0&&e[3]>0})),p((function(e){var t=e[0],n=Math.max(0,Math.min(e[1]-1,e[2]));return z.transpose(t.indexRange(0,n))}))).subscribe(V.next),v(O,j,u).pipe(y((function(e){return!e[1].empty()&&!e[0].empty()})),x(V),p((function(e){var t=e[0],n=t[0],r=e[1],i=t[1].findMaxValue(Math.max(t[2],0));if(1===r.length&&r[0].index===i)return r;var o=n.itemAt(i);return z.transpose([o])}))).subscribe(V.next);var F,P,_=V.pipe(p((function(e){return e.reduce((function(e,t){return e+t.size}),0)}))),D=V.pipe(p((function(e){return e.length&&e[e.length-1].index+1}))),U=v(s,u,_,a,l,D,c,O).pipe((F=function(e){return function(t,n){var r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],l=n[6],f=n[7],c=t.length;if(0===l)return[];var h=A(t),d=h-i+s-a-o,v=Math.max(l-1,0);if(d<r||c>0&&(t[0].index<u||t[c-1].index>v)){var p=Math.max(i+o,o);return z.transpose(f.range(p,i+r+2*e-1,u,v))}if(h>i+o){var g=Math.max(i+o-2*e,o);return z.transpose(f.range(g,i+r-1,u,v))}return t}}(n),P=[],function(e,t){t(P=F(P,e))})),q=d(),G=0;U.pipe(p((function(e){return e.length?e[e.length-1].index:0}))).pipe(x(c)).subscribe((function(e){var t=e[0],n=e[1];0!==n&&t===n-1&&G!==t&&(G=t,q.next(t))}));var K=v(U,u,_).pipe(p((function(e){return A(e[0])}))),Y=S.pipe(x(O,_,w,s,c),p((function(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];"number"==typeof t&&(t={index:t,align:"start"});var s=t.index,a=t.align,u=void 0===a?"start":a;s=Math.max(0,s,Math.min(e[5]-1,s));var l=n.offsetOf(s);return"end"===u?l=l-o+n.itemAt(s).size:"center"===u?l=Math.round(l-o/2+n.itemAt(s).size/2):-1===i.indexOf(s)&&(l-=r),l}))),B=I.subscribe((function(e){f.next([{start:0,end:0,size:30}]),s.next(30*e),C=!0,B()})),J=w.pipe(),Q=K.pipe(p((function(e){return-e}))),X=b(u);return{groupCounts:N(g),itemHeights:N(f),footerHeight:N(l),listHeight:N(a),viewportHeight:N(s),scrollTop:N(u),topItemCount:N(m),totalCount:N(c),scrollToIndex:N(S),initialItemCount:N(I),list:M(U),itemsRendered:M(U),topList:M(V),listOffset:M(K),totalHeight:M(W),endReached:M(q),totalListHeightChanged:M(W),isScrolling:M(X),stickyItems:M(w),groupIndices:M(J),stickyItemsOffset:M(Q),scrollTo:M(Y)}},W=t.createContext(void 0),j=function(e){var r=e.render,i=e.stickyClassName,o=t.useContext(W),s=o.topList,a=z(o.list,[]),u=z(s,[]),l=[],f=0,c=[],h=u.reduce((function(e,t){return e+t.size}),0);return u.forEach((function(e,t){var n=e.index;c.push(n),l.push(r(e,{key:n,"data-index":n,"data-known-size":e.size,className:i,style:{top:f+"px",marginTop:0===t?-h+"px":void 0}})),f+=e.size})),a.forEach((function(e){c.indexOf(e.index)>-1||l.push(r(e,{key:e.index,"data-index":e.index,"data-known-size":e.size}))})),n.createElement(n.Fragment,null," ",l," ")},V={height:"40rem",overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative",outline:"none"},F=function(e){var r=e.className,i=e.style,o=e.reportScrollTop,s=e.scrollTo,a=e.children,u=t.useRef(null),l=t.useCallback((function(e){o(e.target.scrollTop)}),[o]),f=t.useCallback((function(e){e?(e.addEventListener("scroll",l,{passive:!0}),u.current=e):u.current.removeEventListener("scroll",l)}),[l]);return s((function(e){u.current.scrollTo({top:e})})),n.createElement("div",{ref:f,style:i,tabIndex:0,className:r},a)},P=function(e){var t=e.children,r=e.className,o=e.ScrollContainer,s=e.scrollTop,a=e.scrollTo;return n.createElement(void 0===o?F:o,{style:i({},V,e.style),reportScrollTop:s,scrollTo:a,className:r},t)},_=function(e){var n=e.stickyClassName,r=t.useRef(null);return t.useLayoutEffect((function(){var e=document.createElement("style");return document.head.appendChild(e),e.sheet.insertRule("."+n+" {\n position: sticky;\n position: -webkit-sticky;\n z-index: 2;\n } ",0),r.current=e,function(){document.head.removeChild(r.current),r.current=null}}),[n]),null},D=function(){return String.fromCharCode(Math.round(25*Math.random()+97))},U=function(){return new Array(12).fill(0).map(D).join("")},q={top:0,position:"absolute",height:"100%",width:"100%",overflow:"absolute"},G=function(e){return n.createElement("div",{style:{height:e.height+"px",position:"absolute",top:0}}," ")},K=function(e){return n.createElement("footer",{ref:e.footerRef},e.children)},Y=function(e){return n.createElement("div",{ref:e.listRef,style:e.style},e.children)},B=function(e){var r=e.footer,i=e.FooterContainer,o=void 0===i?K:i,s=O(t.useContext(W).footerHeight);return n.createElement(o,{footerRef:s},r())},J=function(e){var r=e.fixedItemHeight,i=e.children,o=e.ListContainer,s=t.useContext(W),a=s.listHeight,u=s.itemHeights,l={marginTop:z(s.listOffset,0)+"px"},f=O(a,(function(){}),(function(e){if(!r){var t=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.item(n);if(i&&void 0!==i.dataset.index){var o=parseInt(i.dataset.index),s=parseInt(i.dataset.knownSize),a=i.offsetHeight;if(a!==s){var u=t[t.length-1];0===t.length||u.size!==a||u.end!==o-1?t.push({start:o,end:o,size:a}):t[t.length-1].end++}}}return t}(e.children);t.length>0&&u(t)}}));return n.createElement(o,{listRef:f,style:l},i)},Q=function(e){var r=e.style,i=e.footer,o=e.item,s=e.fixedItemHeight,a=e.ScrollContainer,u=e.ListContainer,l=e.FooterContainer,f=e.className,c=t.useContext(W),h=c.scrollTo,d=c.scrollTop,v=c.viewportHeight,p=z(c.totalHeight,0),g=t.useMemo(U,[]),m=O(v);return n.createElement(P,{style:r,ScrollContainer:a,className:f,scrollTo:h,scrollTop:d},n.createElement("div",{ref:m,style:q},n.createElement(J,{fixedItemHeight:s,ListContainer:u},n.createElement(j,{render:o,stickyClassName:g}),i&&n.createElement(B,{footer:i,FooterContainer:l}))),n.createElement(G,{height:p}),n.createElement(_,Object.assign({},{stickyClassName:g})))},X=function(e){return n.createElement(W.Provider,{value:e.contextValue},n.createElement(Q,{style:e.style||{},className:e.className,item:e.item,footer:e.footer,fixedItemHeight:void 0!==e.itemHeight,ScrollContainer:e.ScrollContainer,FooterContainer:e.FooterContainer,ListContainer:e.ListContainer||Y}))},Z=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var o=t.key,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(t,["key"]),a=r.props,u=a.computeItemKey,l=a.item,f=a.ItemContainer,c=void 0===f?"div":f;return u&&(o=u(e.index)),n.createElement(c,i({},s,{key:o}),l(e.index))},r.state=L(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),t.topItemCount(e.topItems||0),t.totalCount(e.totalCount),e.initialItemCount&&t.initialItemCount(e.initialItemCount),t.itemsRendered(e.itemsRendered),t.totalListHeightChanged(e.totalListHeightChanged),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.componentWillUnmount=function(){this.state.itemsRendered(void 0),this.state.totalListHeightChanged(void 0)},r.render=function(){return n.createElement(X,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),$=function(e){function t(t){var r;return(r=e.call(this,t)||this).itemRender=function(e,t){var i=r.props.ItemContainer,o=r.props.GroupContainer||i;if("group"===e.type){var s=r.props.group(e.groupIndex);return o?n.createElement(o,Object.assign({key:t.key},t),s):n.createElement("div",Object.assign({},t),s)}var a=r.props.item(e.transposedIndex,e.groupIndex);return i?n.createElement(i,Object.assign({key:t.key},t),a):n.createElement("div",Object.assign({},t),a)},r.state=L(t),r}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.endReached(e.endReached),t.isScrolling(e.scrollingStateChange),t.groupCounts(e.groupCounts),t.groupIndices(e.groupIndices),t.itemsRendered(e.itemsRendered),t.totalListHeightChanged(e.totalListHeightChanged),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.componentWillUnmount=function(){this.state.itemsRendered(void 0),this.state.totalListHeightChanged(void 0)},r.render=function(){return n.createElement(X,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},t}(t.PureComponent),ee=Math.ceil,te=Math.floor,ne=Math.min,re=Math.max,ie=function(e){return ee(e)-e<.03?ee(e):te(e)},oe=function(){var e=h([0,0,void 0,void 0]),t=h(0),n=h(0),r=h(0),i=h([0,0]),o=h(0),s=h(0),a=d();v(e,n,r,t).pipe(x(i)).subscribe((function(e){var t=e[0],n=t[0],r=n[0],a=n[1],u=n[2],l=n[3],f=t[1],c=t[2],h=t[3],d=e[1];if(void 0!==u&&void 0!==l){if(0===h)return i.next([0,-1]),void s.next(0);var v=d[0],p=d[1],g=ie(r/u),m=function(e,t){return void 0===t&&(t=te),t(e/g)},y=function(e){var t=e?[0,c]:[c,0],n=t[1],r=g*te((f-t[0])/l),o=g*ee((f+a+n)/l)-1;o=ne(h-1,o),r=ne(o,re(0,r)),i.next([r,o]),s.next(m(r)*l)},x=l*m(v),b=l*m(p)+l;h<p-1?y(!0):x>f?y(!1):b<f+a&&y(!0),o.next(l*m(h,ee))}}));var u=a.pipe(x(e,t),p((function(e){var t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3];if(void 0===o||void 0===s)return 0;"number"==typeof t&&(t={index:t,align:"start"});var a=t.index,u=t.align,l=void 0===u?"start":u;a=Math.max(0,a,Math.min(e[2]-1,a));var f=ie(r/o),c=te(a/f)*s;return"end"===l?c=c-i+s:"center"===l&&(c=Math.round(c-i/2+s/2)),c}))),l=b(n),f=d(),c=0;return i.pipe(x(t)).subscribe((function(e){var t=e[0][1],n=e[1];0!==n&&t===n-1&&c!==t&&(c=t,f.next(t))})),{gridDimensions:N(e),totalCount:N(t),scrollTop:N(n),overscan:N(r),scrollToIndex:N(a),itemRange:M(i),totalHeight:M(o),listOffset:M(s),scrollTo:M(u),isScrolling:M(l),endReached:M(f)}},se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).state=oe(),t}o(t,e),t.getDerivedStateFromProps=function(e,t){return t.overscan(e.overscan||0),t.totalCount(e.totalCount),t.isScrolling(e.scrollingStateChange),t.endReached(e.endReached),null};var r=t.prototype;return r.scrollToIndex=function(e){this.state.scrollToIndex(e)},r.render=function(){return n.createElement(ae,Object.assign({},this.props,{engine:this.state}))},t}(n.PureComponent),ae=function(e){var i,o,s,a,u=e.ScrollContainer,l=e.ItemContainer,f=void 0===l?"div":l,c=e.ListContainer,h=void 0===c?"div":c,d=e.className,v=e.item,p=e.itemClassName,g=void 0===p?"virtuoso-grid-item":p,m=e.listClassName,y=void 0===m?"virtuoso-grid-list":m,x=e.engine,b=e.style,k=void 0===b?{height:"40rem"}:b,C=x.itemRange,w=x.listOffset,I=x.gridDimensions,E=x.scrollTo,S=x.scrollTop,T=z(x.totalHeight,0),R={marginTop:z(w,0)+"px"},M=z(C,[0,0]),N=(i=function(e){var t=e.element.firstChild.firstChild;I([e.width,e.height,t.offsetWidth,t.offsetHeight])},o=t.useRef(null),s=t.useRef([0,0]),a=new r((function(e){var t=e[0].contentRect,n=t.width,r=t.height;s.current[0]===n&&s.current[1]===r||(s.current=[n,r],i({element:e[0].target,width:n,height:r}))})),function(e){e?(a.observe(e),o.current=e):(a.unobserve(o.current),o.current=null)});return n.createElement(P,{style:k,ScrollContainer:u,className:d,scrollTo:E,scrollTop:S},n.createElement("div",{ref:N,style:q},n.createElement(h,{style:R,className:y},function(e,t,r,i){for(var o=e[1],s=[],a=e[0];a<=o;a++)s.push(n.createElement(i,{key:a,className:r},t(a)));return s}(M,v,g,f))),n.createElement(G,{height:T}))};exports.GroupedVirtuoso=$,exports.Virtuoso=Z,exports.VirtuosoGrid=se,exports.VirtuosoPresentation=X; | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react"),r=t(n),i=t(require("resize-observer-polyfill")),o=n.createContext(void 0);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t,e){return e(t)}:1===t.length?t[0]:function(e,n){var r=function(t){return n(t)};t.slice().reverse().forEach((function(t){var e=r;r=function(n){return t(n,e)}})),r(e)}}function u(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=s.apply(void 0,e);return a(t,r)}}function a(t,e){var n=function(n){return t((function(t){return e(t,n)}))};return{subscribe:n,pipe:u(n)}}function l(t,e){void 0===e&&(e=!0);var n=[],r=t,i=function(t){return n.push(t),void 0!==r&&t(r),function(){n=n.filter((function(e){return e!==t}))}};return{next:function(t){e&&t===r||(r=t,n.forEach((function(e){return e(t)})))},subscribe:i,pipe:u(i),subscribers:n}}function f(){var t=[],e=function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}};return{next:function(e){t.forEach((function(t){return t(e)}))},subscribe:e,pipe:u(e)}}function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Array(t.length).fill(!1),r=Array(t.length),i=[],o=function(t){n.every((function(t){return t}))&&t.forEach((function(t){return t(r)}))};t.forEach((function(t,e){t.subscribe((function(t){n[e]=!0,r[e]=t,o(i)}))}));var s=function(t){return i.push(t),o([t]),function(){i=i.filter((function(e){return e!==t}))}};return{subscribe:s,pipe:u(s)}}function h(t){return function(e,n){n(t(e))}}function p(t){return function(e,n){return n(t)}}function d(t){return function(e,n){t>0?t--:n(e)}}function v(t){return function(e,n){t(e)&&n(e)}}function g(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Array(t.length).fill(!1),i=Array(t.length);return t.forEach((function(t,e){t.subscribe((function(t){i[e]=t,r[e]=!0}))})),function(t,n){r.every((function(t){return t}))&&n(e.__spreadArrays([t],i))}}var y=new(function(){function t(){this.level=0}return t.prototype.rebalance=function(){return this},t.prototype.adjust=function(){return this},t.prototype.remove=function(){return this},t.prototype.find=function(){},t.prototype.findWith=function(){},t.prototype.findMax=function(){return-Infinity},t.prototype.findMaxValue=function(){},t.prototype.insert=function(t,e){return new x({key:t,value:e,level:1})},t.prototype.walkWithin=function(){return[]},t.prototype.walk=function(){return[]},t.prototype.ranges=function(){return[]},t.prototype.rangesWithin=function(){return[]},t.prototype.empty=function(){return!0},t.prototype.isSingle=function(){return!0},t.prototype.isInvariant=function(){return!0},t.prototype.keys=function(){return[]},t}());Object.freeze(y);var m=function(t){function n(e){return t.call(this,"Unreachable case: "+e)||this}return e.__extends(n,t),n}(Error),x=function(){function t(t){var e=t.value,n=t.level,r=t.left,i=void 0===r?y:r,o=t.right,s=void 0===o?y:o;this.key=t.key,this.value=e,this.level=n,this.left=i,this.right=s}return t.prototype.remove=function(t){var e=this.left,n=this.right;if(t===this.key){if(e.empty())return n;if(n.empty())return e;var r=e.last();return this.clone({key:r[0],value:r[1],left:e.deleteLast()}).adjust()}return t<this.key?this.clone({left:e.remove(t)}).adjust():this.clone({right:n.remove(t)}).adjust()},t.prototype.empty=function(){return!1},t.prototype.find=function(t){return t===this.key?this.value:t<this.key?this.left.find(t):this.right.find(t)},t.prototype.findWith=function(t){var e=t(this.value);switch(e){case-1:return this.left.findWith(t);case 0:return[this.key,this.value];case 1:return this.right.findWith(t);default:throw new m(e)}},t.prototype.findMax=function(t){if(this.key===t)return t;if(this.key<t){var e=this.right.findMax(t);return-Infinity===e?this.key:e}return this.left.findMax(t)},t.prototype.findMaxValue=function(t){if(this.key===t)return this.value;if(this.key<t){var e=this.right.findMaxValue(t);return void 0===e?this.value:e}return this.left.findMaxValue(t)},t.prototype.insert=function(t,e){return t===this.key?this.clone({key:t,value:e}):t<this.key?this.clone({left:this.left.insert(t,e)}).rebalance():this.clone({right:this.right.insert(t,e)}).rebalance()},t.prototype.walkWithin=function(t,e){var n=this.key,r=this.value,i=[];return n>t&&(i=i.concat(this.left.walkWithin(t,e))),n>=t&&n<=e&&i.push({key:n,value:r}),n<=e&&(i=i.concat(this.right.walkWithin(t,e))),i},t.prototype.walk=function(){return e.__spreadArrays(this.left.walk(),[{key:this.key,value:this.value}],this.right.walk())},t.prototype.last=function(){return this.right.empty()?[this.key,this.value]:this.right.last()},t.prototype.deleteLast=function(){return this.right.empty()?this.left:this.clone({right:this.right.deleteLast()}).adjust()},t.prototype.clone=function(e){return new t({key:void 0!==e.key?e.key:this.key,value:void 0!==e.value?e.value:this.value,level:void 0!==e.level?e.level:this.level,left:void 0!==e.left?e.left:this.left,right:void 0!==e.right?e.right:this.right})},t.prototype.isSingle=function(){return this.level>this.right.level},t.prototype.rebalance=function(){return this.skew().split()},t.prototype.adjust=function(){var t=this.left,e=this.right,n=this.level;if(e.level>=n-1&&t.level>=n-1)return this;if(n>e.level+1){if(t.isSingle())return this.clone({level:n-1}).skew();if(t.empty()||t.right.empty())throw new Error("Unexpected empty nodes");return t.right.clone({left:t.clone({right:t.right.left}),right:this.clone({left:t.right.right,level:n-1}),level:n})}if(this.isSingle())return this.clone({level:n-1}).split();if(e.empty()||e.left.empty())throw new Error("Unexpected empty nodes");var r=e.left,i=r.isSingle()?e.level-1:e.level;return r.clone({left:this.clone({right:r.left,level:n-1}),right:e.clone({left:r.right,level:i}).split(),level:r.level+1})},t.prototype.isInvariant=function(){var t=this.left,e=this.right,n=this.level;return n===t.level+1&&(n===e.level||n===e.level+1)&&!(!e.empty()&&n<=e.right.level)&&t.isInvariant()&&e.isInvariant()},t.prototype.keys=function(){return e.__spreadArrays(this.left.keys(),[this.key],this.right.keys())},t.prototype.ranges=function(){return this.toRanges(this.walk())},t.prototype.rangesWithin=function(t,e){return this.toRanges(this.walkWithin(t,e))},t.prototype.toRanges=function(t){if(0===t.length)return[];for(var e=t[0],n=e.key,r=e.value,i=[],o=1;o<=t.length;o++){var s=t[o];i.push({start:n,end:s?s.key-1:Infinity,value:r}),s&&(n=s.key,r=s.value)}return i},t.prototype.split=function(){var t=this.right,e=this.level;return t.empty()||t.right.empty()||t.level!==e||t.right.level!==e?this:t.clone({left:this.clone({right:t.left}),level:e+1})},t.prototype.skew=function(){var t=this.left;return t.empty()||t.level!==this.level?this:t.clone({right:this.clone({left:t.right})})},t}(),C=function(){function t(t){this.root=t}return t.empty=function(){return new t(y)},t.prototype.find=function(t){return this.root.find(t)},t.prototype.findMax=function(t){return this.root.findMax(t)},t.prototype.findMaxValue=function(t){if(this.empty())throw new Error("Searching for max value in an empty tree");return this.root.findMaxValue(t)},t.prototype.findWith=function(t){return this.root.findWith(t)},t.prototype.insert=function(e,n){return new t(this.root.insert(e,n))},t.prototype.remove=function(e){return new t(this.root.remove(e))},t.prototype.empty=function(){return this.root.empty()},t.prototype.keys=function(){return this.root.keys()},t.prototype.walk=function(){return this.root.walk()},t.prototype.walkWithin=function(t,e){var n=this.root.findMax(t);return this.root.walkWithin(n,e)},t.prototype.ranges=function(){return this.root.ranges()},t.prototype.rangesWithin=function(t,e){var n=this.root.findMax(t);return this.root.rangesWithin(n,e)},t.prototype.isInvariant=function(){return this.root.isInvariant()},t}(),k=function(){function t(t){this.nanIndices=[],this.rangeTree=t;for(var e=C.empty(),n=0,r=!1,i=0,o=t.ranges();i<o.length;i++){var s=o[i],u=s.start,a=s.end,l=s.value;isNaN(l)?(this.nanIndices.push(u),r||(e=e.insert(n,{startIndex:u,endIndex:Infinity,size:l})),r=!0):r||(e=e.insert(n,{startIndex:u,endIndex:a,size:l}),n+=(a-u+1)*l)}this.offsetTree=e}return t.create=function(){return new t(C.empty())},t.prototype.empty=function(){return this.rangeTree.empty()},t.prototype.insert=function(e,n,r){var i=this.rangeTree;if(i.empty())return new t(i.insert(0,r));if(this.nanIndices.length&&this.nanIndices.indexOf(n)>-1){if(i.find(this.nanIndices[0]-1)===r)return new t(C.empty().insert(0,r));for(var o=0,s=this.nanIndices;o<s.length;o++)i=i.insert(s[o],r);return new t(i)}var u=i.rangesWithin(e-1,n+1);if(u.some((function(t){return t.start===e&&(t.end===n||Infinity===t.end)&&t.value===r})))return this;for(var a=!1,l=!1,f=0,c=u;f<c.length;f++){var h=c[f],p=h.start,d=h.end,v=h.value;a?(n>=p||r===v)&&(i=i.remove(p)):(l=v!==r,a=!0),d>n&&n>=p&&(v===r||isNaN(v)||(i=i.insert(n+1,v)))}return l&&(i=i.insert(e,r)),i===this.rangeTree?this:new t(i)},t.prototype.insertSpots=function(e,n){if(this.empty()){for(var r=this.rangeTree,i=0,o=e;i<o.length;i++){var s=o[i];r=r.insert(s,n).insert(s+1,NaN)}return new t(r)}throw new Error("attempting to overwrite non-empty tree")},t.prototype.offsetOf=function(t){if(this.offsetTree.empty())return 0;var e=this.offsetTree.findWith((function(e){return e.startIndex>t?-1:e.endIndex<t?1:0}));if(e){var n=e[1];return e[0]+(t-n.startIndex)*n.size}throw new Error("Requested offset outside of the known ones, index: "+t)},t.prototype.itemAt=function(t){return{index:t,size:this.rangeTree.findMaxValue(t),offset:NaN}},t.prototype.indexRange=function(t,e){if(this.rangeTree.empty())return[{index:0,size:0,offset:NaN}];for(var n=[],r=0,i=this.rangeTree.rangesWithin(t,e);r<i.length;r++)for(var o=i[r],s=Math.max(t,o.start),u=Math.min(e,void 0===o.end?Infinity:o.end),a=s;a<=u;a++)n.push({index:a,size:o.value,offset:NaN});return n},t.prototype.range=function(t,e,n,r){if(void 0===n&&(n=0),void 0===r&&(r=Infinity),this.offsetTree.empty())return[{index:0,size:0,offset:0}];for(var i=[],o=0,s=this.offsetTree.rangesWithin(t,e);o<s.length;o++){var u=s[o],a=u.start,l=u.value,f=l.startIndex,c=l.endIndex,h=l.size,p=a,d=f;if(a<t&&(p+=((d+=Math.floor((t-a)/h))-f)*h),d<n&&(p+=(n-d)*h,d=n),isNaN(h))return i.push({index:d,size:0,offset:p}),i;c=Math.min(c,r);for(var v=d;v<=c&&!(p>e);v++)i.push({index:v,size:h,offset:p}),p+=h}return i},t.prototype.total=function(t){for(var e=0,n=0,r=this.rangeTree.rangesWithin(0,t);n<r.length;n++){var i=r[n],o=i.start,s=i.end,u=i.value;e+=((s=Math.min(s,t))-o+1)*(isNaN(u)?0:u)}return e},t.prototype.getOffsets=function(t){var e=this,n=C.empty();return t.forEach((function(t){var r=e.offsetOf(t);n=n.insert(r,t)})),new I(n)},t}(),I=function(){function t(t){this.tree=t}return t.prototype.findMaxValue=function(t){return this.tree.findMaxValue(t)},t.prototype.empty=function(){return this.tree.empty()},t}(),w=function(){function t(){}return t.prototype.transpose=function(t){return t.map((function(t){return{groupIndex:0,index:t.index,offset:t.offset,size:t.size,transposedIndex:t.index,type:"item"}}))},t}(),b=function(){function t(t){this.count=t.reduce((function(t,e){return t+e+1}),0);for(var e=C.empty(),n=0,r=0,i=0,o=t;i<o.length;i++){var s=o[i];e=e.insert(r,[n,r]),n++,r+=s+1}this.tree=e}return t.prototype.totalCount=function(){return this.count},t.prototype.transpose=function(t){var e=this;return t.map((function(t){var n=e.tree.find(t.index);if(n)return{groupIndex:n[0],index:t.index,offset:t.offset,size:t.size,type:"group"};var r=e.tree.findMaxValue(t.index)[0];return{groupIndex:r,index:t.index,offset:t.offset,size:t.size,transposedIndex:t.index-r-1,type:"item"}}))},t.prototype.groupIndices=function(){return this.tree.keys()},t}();function E(t){var e;return function(n){e&&e(),n&&(e=t.subscribe(n))}}function T(t){return t.next}var M=function(t){var e,n,r=l(!1);return t.pipe(d(1),p(!0)).subscribe(r.next),t.pipe(d(1),p(!1),(function(t,r){e=t,n&&clearTimeout(n),n=setTimeout((function(){r(e)}),200)})).subscribe(r.next),r},R=function(t){return t.length>0?t[0].offset:0},N=function(t){return t[0].total(t[1]-1)},_=function(t){var e=t.overscan,n=void 0===e?0:e,r=t.totalCount,i=void 0===r?0:r,o=t.itemHeight,s=l(0),u=l(0),a=l(0),p=l(0),d=l(),y=l(i),m=l(),x=l(),C=k.create(),I=!1,_=l([]),S=l(),z=f();o&&(C=C.insert(0,0,o));var H=l(C);o||d.pipe(g(H,_)).subscribe((function(t){var e=t[0],n=t[1],r=t[2],i=n;I&&(i=k.create(),I=!1);for(var o=0,s=e;o<s.length;o++){var u=s[o],a=u.start,l=u.end,f=u.size;i=i.empty()&&a===l&&r.indexOf(a)>-1?i.insertSpots(r,f):i.insert(a,l,f)}i!==n&&H.next(i)}));var L=new w;m.subscribe((function(t){L=new b(t),y.next(L.totalCount()),_.next(L.groupIndices())}));var W=c(H,y).pipe(h(N)),V=c(W,p).pipe(h((function(t){return t[0]+t[1]}))),O=c(H,_).pipe(h((function(t){return t[0].getOffsets(t[1])}))),F=l([]);c(H,x,y,s).pipe(v((function(t){return t[1]>0&&t[3]>0})),h((function(t){var e=t[0],n=Math.max(0,Math.min(t[1]-1,t[2]));return L.transpose(e.indexRange(0,n))}))).subscribe(F.next),c(H,O,a).pipe(v((function(t){return!t[1].empty()&&!t[0].empty()})),g(F),h((function(t){var e=t[0],n=e[0],r=t[1],i=e[1].findMaxValue(Math.max(e[2],0));if(1===r.length&&r[0].index===i)return r;var o=n.itemAt(i);return L.transpose([o])}))).subscribe(F.next);var A,j,P=F.pipe(h((function(t){return t.reduce((function(t,e){return t+e.size}),0)}))),q=F.pipe(h((function(t){return t.length&&t[t.length-1].index+1}))),D=c(s,a,P,u,p,q,y,H).pipe((A=function(t){return function(e,n){var r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],a=n[5],l=n[6],f=n[7],c=e.length;if(0===l)return[];var h=R(e),p=h-i+s-u-o,d=Math.max(l-1,0);if(p<r||c>0&&(e[0].index<a||e[c-1].index>d)){var v=Math.max(i+o,o);return L.transpose(f.range(v,i+r+2*t-1,a,d))}return h>i?(v=Math.max(i+o-2*t,o),L.transpose(f.range(v,i+r-1,a,d))):e}}(n),j=[],function(t,e){e(j=A(j,t))})),U=f(),G=0;D.pipe(h((function(t){return t.length?t[t.length-1].index:0}))).pipe(g(y)).subscribe((function(t){var e=t[0],n=t[1];0!==n&&e===n-1&&G!==e&&(G=e,U.next(e))}));var K=c(D,a,P).pipe(h((function(t){return R(t[0])}))),Y=z.pipe(g(H,P,_,s,y),h((function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4];"number"==typeof e&&(e={index:e,align:"start"});var s=e.index,u=e.align,a=void 0===u?"start":u;s=Math.max(0,s,Math.min(t[5]-1,s));var l=n.offsetOf(s);return"end"===a?l=l-o+n.itemAt(s).size:"center"===a?l=Math.round(l-o/2+n.itemAt(s).size/2):-1===i.indexOf(s)&&(l-=r),l}))),B=S.subscribe((function(t){d.next([{start:0,end:0,size:30}]),s.next(30*t),I=!0,B()})),J=_.pipe(),Q=K.pipe(h((function(t){return-t}))),X=M(a);return{groupCounts:T(m),itemHeights:T(d),footerHeight:T(p),listHeight:T(u),viewportHeight:T(s),scrollTop:T(a),topItemCount:T(x),totalCount:T(y),scrollToIndex:T(z),initialItemCount:T(S),list:E(D),itemsRendered:E(D),topList:E(F),listOffset:E(K),totalHeight:E(V),endReached:E(U),totalListHeightChanged:E(V),isScrolling:E(X),stickyItems:E(_),groupIndices:E(J),stickyItemsOffset:E(Q),scrollTo:E(Y)}},S=function(t,e,r){var o=n.useRef(null),s=n.useRef(0),u=new i((function(e){var n=e[0].contentRect.height;r&&(s.current=window.requestAnimationFrame((function(){return r(e[0].target)}))),t(n)}));return n.useEffect((function(){return function(){return window.cancelAnimationFrame(s.current)}}),[]),function(t){t?(u.observe(t),e&&e(t),o.current=t):(u.unobserve(o.current),o.current=null)}};function z(t,e){var r=n.useState(function(t,e){return function(){var n=e;return t((function(t){n=t})),n}}(t,e)),i=r[0],o=r[1];return n.useLayoutEffect((function(){return t(o),function(){return t(void 0)}}),[t]),i}var H={height:"40rem",overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative",outline:"none"},L=function(t){var e=t.className,i=t.style,o=t.reportScrollTop,s=t.scrollTo,u=t.children,a=n.useRef(null),l=n.useCallback((function(t){o(t.target.scrollTop)}),[o]),f=n.useCallback((function(t){t?(t.addEventListener("scroll",l,{passive:!0}),a.current=t):a.current.removeEventListener("scroll",l)}),[l]);return s((function(t){a.current.scrollTo({top:t})})),r.createElement("div",{ref:f,style:i,tabIndex:0,className:e},u)},W=function(t){var n=t.children,i=t.style,o=t.className,s=t.ScrollContainer,u=t.scrollTop,a=t.scrollTo;return r.createElement(void 0===s?L:s,{style:e.__assign(e.__assign({},H),i),reportScrollTop:u,scrollTo:a,className:o},n)},V=function(t){var e=t.render,i=t.stickyClassName,s=n.useContext(o),u=s.topList,a=z(s.list,[]),l=z(u,[]),f=[],c=0,h=[],p=l.reduce((function(t,e){return t+e.size}),0);return l.forEach((function(t,n){var r=t.index;h.push(r),f.push(e(t,{key:r,"data-index":r,"data-known-size":t.size,className:i,style:{top:c+"px",marginTop:0===n?-p+"px":void 0}})),c+=t.size})),a.forEach((function(t){h.indexOf(t.index)>-1||f.push(e(t,{key:t.index,"data-index":t.index,"data-known-size":t.size}))})),r.createElement(r.Fragment,null," ",f," ")},O=function(t){var e=t.stickyClassName,r=n.useRef(null);return n.useLayoutEffect((function(){var t=document.createElement("style");return document.head.appendChild(t),t.sheet.insertRule("."+e+" {\n position: sticky;\n position: -webkit-sticky;\n z-index: 2;\n } ",0),r.current=t,function(){document.head.removeChild(r.current),r.current=null}}),[e]),null},F=function(){return String.fromCharCode(Math.round(25*Math.random()+97))},A=function(){return new Array(12).fill(0).map(F).join("")},j={top:0,position:"absolute",height:"100%",width:"100%",overflow:"absolute"},P=function(t){return r.createElement("div",{style:{height:t.height+"px",position:"absolute",top:0}}," ")},q=function(t){return r.createElement("footer",{ref:t.footerRef},t.children)},D=function(t){return r.createElement("div",{ref:t.listRef,style:t.style},t.children)},U=function(t){var e=t.footer,i=t.FooterContainer,s=void 0===i?q:i,u=S(n.useContext(o).footerHeight);return r.createElement(s,{footerRef:u},e())},G=function(t){var e=t.fixedItemHeight,i=t.children,s=t.ListContainer,u=n.useContext(o),a=u.listHeight,l=u.itemHeights,f={marginTop:z(u.listOffset,0)+"px"},c=S(a,(function(){}),(function(t){if(!e){var n=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t.item(n);if(i&&void 0!==i.dataset.index){var o=parseInt(i.dataset.index),s=parseInt(i.dataset.knownSize),u=i.offsetHeight;if(u!==s){var a=e[e.length-1];0===e.length||a.size!==u||a.end!==o-1?e.push({start:o,end:o,size:u}):e[e.length-1].end++}}}return e}(t.children);n.length>0&&l(n)}}));return r.createElement(s,{listRef:c,style:f},i)},K=function(t){var i=t.style,s=t.footer,u=t.item,a=t.fixedItemHeight,l=t.ScrollContainer,f=t.ListContainer,c=t.FooterContainer,h=t.className,p=n.useContext(o),d=p.scrollTo,v=p.scrollTop,g=p.viewportHeight,y=z(p.totalHeight,0),m=n.useMemo(A,[]),x=S(g);return r.createElement(W,{style:i,ScrollContainer:l,className:h,scrollTo:d,scrollTop:v},r.createElement("div",{ref:x,style:j},r.createElement(G,{fixedItemHeight:a,ListContainer:f},r.createElement(V,{render:u,stickyClassName:m}),s&&r.createElement(U,{footer:s,FooterContainer:c}))),r.createElement(P,{height:y}),r.createElement(O,e.__assign({},{stickyClassName:m})))},Y=function(t){return r.createElement(o.Provider,{value:t.contextValue},r.createElement(K,{style:t.style||{},className:t.className,item:t.item,footer:t.footer,fixedItemHeight:void 0!==t.itemHeight,ScrollContainer:t.ScrollContainer,FooterContainer:t.FooterContainer,ListContainer:t.ListContainer||D}))},B=function(t){function n(n){var i=t.call(this,n)||this;return i.itemRender=function(t,n){var o=n.key,s=e.__rest(n,["key"]),u=i.props,a=u.computeItemKey,l=u.item,f=u.ItemContainer,c=void 0===f?"div":f;return a&&(o=a(t.index)),r.createElement(c,e.__assign(e.__assign({},s),{key:o}),l(t.index))},i.state=_(n),i}return e.__extends(n,t),n.getDerivedStateFromProps=function(t,e){return e.isScrolling(t.scrollingStateChange),e.endReached(t.endReached),e.topItemCount(t.topItems||0),e.totalCount(t.totalCount),t.initialItemCount&&e.initialItemCount(t.initialItemCount),e.itemsRendered(t.itemsRendered),e.totalListHeightChanged(t.totalListHeightChanged),null},n.prototype.scrollToIndex=function(t){this.state.scrollToIndex(t)},n.prototype.componentWillUnmount=function(){this.state.itemsRendered(void 0),this.state.totalListHeightChanged(void 0)},n.prototype.render=function(){return r.createElement(Y,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},n}(n.PureComponent),J=function(t){function n(n){var i=t.call(this,n)||this;return i.itemRender=function(t,n){var o=i.props.ItemContainer,s=i.props.GroupContainer||o;if("group"===t.type){var u=i.props.group(t.groupIndex);return s?r.createElement(s,e.__assign({key:n.key},n),u):r.createElement("div",e.__assign({},n),u)}return u=i.props.item(t.transposedIndex,t.groupIndex),o?r.createElement(o,e.__assign({key:n.key},n),u):r.createElement("div",e.__assign({},n),u)},i.state=_(n),i}return e.__extends(n,t),n.getDerivedStateFromProps=function(t,e){return e.endReached(t.endReached),e.isScrolling(t.scrollingStateChange),e.groupCounts(t.groupCounts),e.groupIndices(t.groupIndices),e.itemsRendered(t.itemsRendered),e.totalListHeightChanged(t.totalListHeightChanged),null},n.prototype.scrollToIndex=function(t){this.state.scrollToIndex(t)},n.prototype.componentWillUnmount=function(){this.state.itemsRendered(void 0),this.state.totalListHeightChanged(void 0)},n.prototype.render=function(){return r.createElement(Y,{contextValue:this.state,style:this.props.style,className:this.props.className,item:this.itemRender,footer:this.props.footer,itemHeight:this.props.itemHeight,ScrollContainer:this.props.ScrollContainer,FooterContainer:this.props.FooterContainer,ListContainer:this.props.ListContainer})},n}(n.PureComponent),Q=Math.ceil,X=Math.floor,Z=Math.min,$=Math.max,tt=function(t){return Q(t)-t<.03?Q(t):X(t)},et=function(){var t=l([0,0,void 0,void 0]),e=l(0),n=l(0),r=l(0),i=l([0,0]),o=l(0),s=l(0),u=f();c(t,n,r,e).pipe(g(i)).subscribe((function(t){var e=t[0],n=e[0],r=n[0],u=n[1],a=n[2],l=n[3],f=e[1],c=e[2],h=e[3],p=t[1];if(void 0!==a&&void 0!==l){if(0===h)return i.next([0,-1]),void s.next(0);var d=p[0],v=p[1],g=tt(r/a),y=function(t,e){return void 0===e&&(e=X),e(t/g)},m=function(t){var e=t?[0,c]:[c,0],n=e[1],r=g*X((f-e[0])/l),o=g*Q((f+u+n)/l)-1;o=Z(h-1,o),r=Z(o,$(0,r)),i.next([r,o]),s.next(y(r)*l)},x=l*y(d),C=l*y(v)+l;h<v-1?m(!0):x>f?m(!1):C<f+u&&m(!0),o.next(l*y(h,Q))}}));var a=u.pipe(g(t,e),h((function(t){var e=t[0],n=t[1],r=n[0],i=n[1],o=n[2],s=n[3];if(void 0===o||void 0===s)return 0;"number"==typeof e&&(e={index:e,align:"start"});var u=e.index,a=e.align,l=void 0===a?"start":a;u=Math.max(0,u,Math.min(t[2]-1,u));var f=tt(r/o),c=X(u/f)*s;return"end"===l?c=c-i+s:"center"===l&&(c=Math.round(c-i/2+s/2)),c}))),p=M(n),d=f(),v=0;return i.pipe(g(e)).subscribe((function(t){var e=t[0][1],n=t[1];0!==n&&e===n-1&&v!==e&&(v=e,d.next(e))})),{gridDimensions:T(t),totalCount:T(e),scrollTop:T(n),overscan:T(r),scrollToIndex:T(u),itemRange:E(i),totalHeight:E(o),listOffset:E(s),scrollTo:E(a),isScrolling:E(p),endReached:E(d)}},nt=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=et(),e}return e.__extends(n,t),n.getDerivedStateFromProps=function(t,e){return e.overscan(t.overscan||0),e.totalCount(t.totalCount),e.isScrolling(t.scrollingStateChange),e.endReached(t.endReached),null},n.prototype.scrollToIndex=function(t){this.state.scrollToIndex(t)},n.prototype.render=function(){return r.createElement(rt,e.__assign({},this.props,{engine:this.state}))},n}(r.PureComponent),rt=function(t){var e,o,s,u,a=t.ScrollContainer,l=t.ItemContainer,f=void 0===l?"div":l,c=t.ListContainer,h=void 0===c?"div":c,p=t.className,d=t.item,v=t.itemClassName,g=void 0===v?"virtuoso-grid-item":v,y=t.listClassName,m=void 0===y?"virtuoso-grid-list":y,x=t.engine,C=t.style,k=void 0===C?{height:"40rem"}:C,I=x.itemRange,w=x.listOffset,b=x.gridDimensions,E=x.scrollTo,T=x.scrollTop,M=z(x.totalHeight,0),R={marginTop:z(w,0)+"px"},N=z(I,[0,0]),_=(e=function(t){var e=t.element.firstChild.firstChild;b([t.width,t.height,e.offsetWidth,e.offsetHeight])},o=n.useRef(null),s=n.useRef([0,0]),u=new i((function(t){var n=t[0].contentRect,r=n.width,i=n.height;s.current[0]===r&&s.current[1]===i||(s.current=[r,i],e({element:t[0].target,width:r,height:i}))})),function(t){t?(u.observe(t),o.current=t):(u.unobserve(o.current),o.current=null)});return r.createElement(W,{style:k,ScrollContainer:a,className:p,scrollTo:E,scrollTop:T},r.createElement("div",{ref:_,style:j},r.createElement(h,{style:R,className:m},function(t,e,n,i){for(var o=t[1],s=[],u=t[0];u<=o;u++)s.push(r.createElement(i,{key:u,className:n},e(u)));return s}(N,d,g,f))),r.createElement(P,{height:M}))};exports.GroupedVirtuoso=J,exports.Virtuoso=B,exports.VirtuosoGrid=nt,exports.VirtuosoPresentation=Y; | ||
//# sourceMappingURL=react-virtuoso.cjs.production.min.js.map |
{ | ||
"name": "react-virtuoso", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"homepage": "https://virtuoso.dev", | ||
@@ -28,13 +28,13 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "^24.0.20", | ||
"@types/jest": "^24.0.25", | ||
"@types/lodash": "^4.14.144", | ||
"@types/react": "^16.9.11", | ||
"@types/react-dom": "^16.9.3", | ||
"husky": "^3.0.9", | ||
"@types/react": "^16.9.17", | ||
"@types/react-dom": "^16.9.4", | ||
"husky": "^4.0.6", | ||
"parcel": "^1.12.3", | ||
"react": "^16.11.0", | ||
"react-dom": "^16.11.0", | ||
"tsdx": "^0.10.5", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"tsdx": "^0.12.1", | ||
"tslib": "^1.10.0", | ||
"typescript": "^3.6.4" | ||
"typescript": "^3.7.4" | ||
}, | ||
@@ -41,0 +41,0 @@ "dependencies": { |
@@ -51,3 +51,3 @@ <img src="https://user-images.githubusercontent.com/13347/57673110-85aab180-7623-11e9-97b4-27bbdcf8cf40.png" width="292"> | ||
- Instead of `totalCount`, the component accepts `groupedCounts: number[]`, which specifies the amount of items in each group. | ||
- Instead of `totalCount`, the component accepts `groupCounts: number[]`, which specifies the amount of items in each group. | ||
For example, passing `[20, 30]` will render two groups with 20 and 30 items each; | ||
@@ -54,0 +54,0 @@ - In addition the `item` render prop, the component requires an additional `group` render prop, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
524416
29
0
4378