@elliemae/ds-virtual-list 3.35.0 → 3.36.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/VirtualList.js +0 -1
- package/dist/cjs/VirtualList.js.map +2 -2
- package/dist/cjs/hooks/useVirtualList.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parts/List.js.map +1 -1
- package/dist/cjs/parts/styled.js.map +1 -1
- package/dist/esm/VirtualList.js +0 -1
- package/dist/esm/VirtualList.js.map +2 -2
- package/dist/esm/hooks/useVirtualList.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parts/List.js.map +1 -1
- package/dist/esm/parts/styled.js.map +1 -1
- package/dist/types/VirtualList.d.ts +0 -2
- package/package.json +7 -7
package/dist/cjs/VirtualList.js
CHANGED
|
@@ -39,7 +39,6 @@ var import_List = require("./parts/List.js");
|
|
|
39
39
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
40
|
var import_DSVirtualListDefinitions = require("./DSVirtualListDefinitions.js");
|
|
41
41
|
const DSVirtualList = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_List.List, { ...props });
|
|
42
|
-
DSVirtualList.propTypes = import_react_desc_prop_types.DSVirtualListPropTypes;
|
|
43
42
|
DSVirtualList.displayName = import_DSVirtualListDefinitions.DSVirtualListName;
|
|
44
43
|
const DSVirtualListWithSchema = (0, import_ds_props_helpers.describe)(DSVirtualList).description("DSVirtualList");
|
|
45
44
|
DSVirtualListWithSchema.propTypes = import_react_desc_prop_types.DSVirtualListPropTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/VirtualList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './DSVirtualListDefinitions.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADOgC;AANvD,8BAAyB;AACzB,kBAAqB;AACrB,mCAA4D;AAC5D,sCAAkC;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,4CAAC,oBAAM,GAAG,OAAO;AAExE,cAAc,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './DSVirtualListDefinitions.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.displayName = DSVirtualListName;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADOgC;AANvD,8BAAyB;AACzB,kBAAqB;AACrB,mCAA4D;AAC5D,sCAAkC;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,4CAAC,oBAAM,GAAG,OAAO;AAExE,cAAc,cAAc;AAC5B,MAAM,8BAA0B,kCAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useVirtualList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { uid } from 'uid';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSVirtualListT, DSVirtualListPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nconst estimateSize = () => 50;\n// we \"own\" the interfaces/type instead of importing from react-virtual\n// to abstract our implementation from their\ninterface VirtualItem {\n key: string | number;\n index: number;\n start: number;\n end: number;\n size: number;\n}\ntype MeasureElement = ((element: HTMLElement) => number) | ((node: Element | null) => void);\n\nexport type VirtualListCTX = {\n parentRef: React.MutableRefObject<HTMLDivElement | null>;\n getVirtualItems: () => VirtualItem[];\n filteredChildren: React.ReactNode[];\n totalSize: number;\n instanceUid: string;\n measureElement: MeasureElement;\n propsWithDefault: DSVirtualListT.InternalProps;\n};\nexport const useVirtualListV3 = (propsFromUser: DSVirtualListT.Props): VirtualListCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSVirtualListT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSVirtualListPropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { children, actionRef } = propsWithDefault;\n const parentRef = React.useRef<HTMLDivElement>(null);\n const filteredChildren = React.useMemo(\n () => React.Children.toArray(children).filter((child) => child !== undefined && child !== null),\n [children],\n ) as React.ReactNode[];\n const useVirtualHelpers = useVirtualizer({\n count: filteredChildren.length,\n getScrollElement: () => parentRef.current,\n overscan: 15,\n estimateSize,\n });\n const totalSize = useVirtualHelpers.getTotalSize();\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n }\n }, [actionRef, useVirtualHelpers]);\n\n const instanceUid = React.useMemo(() => `ds-virtual-list-${uid(6)}`, []);\n return React.useMemo(\n () => ({\n parentRef,\n getVirtualItems: useVirtualHelpers.getVirtualItems,\n filteredChildren,\n totalSize,\n instanceUid,\n measureElement: useVirtualHelpers.measureElement,\n propsWithDefault,\n }),\n [\n useVirtualHelpers.getVirtualItems,\n useVirtualHelpers.measureElement,\n filteredChildren,\n totalSize,\n instanceUid,\n propsWithDefault,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,iBAAoB;AACpB,2BAA+B;AAC/B,8BAA6C;AAC7C,mCAA0E;AAC1E,8BAAiC;AAEjC,MAAM,eAAe,MAAM;AAqBpB,MAAM,mBAAmB,CAAC,kBAAwD;AAIvF,QAAM,uBAAmB,sDAA2D,eAAe,yCAAY;AAC/G,gDAAiB,kBAAkB,mDAAsB;AAIzD,QAAM,EAAE,UAAU,UAAU,IAAI;AAChC,QAAM,YAAY,aAAAA,QAAM,OAAuB,IAAI;AACnD,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,MAAM,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,IAAI;AAAA,IAC9F,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,wBAAoB,qCAAe;AAAA,IACvC,OAAO,iBAAiB;AAAA,IACxB,kBAAkB,MAAM,UAAU;AAAA,IAClC,UAAU;AAAA,IACV;AAAA,EACF,CAAC;AACD,QAAM,YAAY,kBAAkB,aAAa;AACjD,eAAAA,QAAM,UAAU,MAAM;AACpB,QAAI,aAAa,UAAU,SAAS;AAClC,gBAAU,QAAQ,WAAW,kBAAkB;AAA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BAAgB,kBAAkB;AAAA,MAClC;AAAA,IACF;AAAA,IACA;AAAA,MACE,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,7 +35,6 @@ __export(src_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
37
|
var React = __toESM(require("react"));
|
|
38
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
38
|
var import_VirtualList = require("./VirtualList.js");
|
|
40
39
|
var import_DSVirtualListDefinitions = require("./DSVirtualListDefinitions.js");
|
|
41
40
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\n\nexport { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots } from './DSVirtualListDefinitions.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,yBAAuD;AACvD,sCAAsD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/List.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\nimport { StyledWrapper, StyledListWrapper, StyledItemWrapper } from './styled.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement, propsWithDefault } =\n useVirtualListV3(props);\n const virtualItems = getVirtualItems();\n const measureRef: React.LegacyRef<HTMLDivElement> = React.useCallback(\n (node: HTMLDivElement) => measureElement(node),\n [measureElement],\n );\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <StyledWrapper\n key={instanceUid}\n innerRef={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n {...ownerPropsConfig}\n >\n <StyledListWrapper height={totalSize} {...ownerPropsConfig}>\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <StyledItemWrapper\n innerRef={measureRef}\n data-index={index}\n start={start}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n {...ownerPropsConfig}\n >\n {filteredChildren[index]}\n </StyledItemWrapper>\n );\n })}\n </StyledListWrapper>\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BX;AA9BZ,mBAAkB;AAClB,0BAA8B;AAC9B,mCAAiC;AACjC,4BAAiC;AAEjC,oBAAoE;AAE7D,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,gBAAgB,iBAAiB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,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,eACE;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,cAAY;AAAA,YACZ;AAAA,YACA,MAAK;AAAA,YAEJ,GAAG;AAAA,YAEH,2BAAiB,KAAK;AAAA;AAAA,UAHlB,GAAG,WAAW,SAAS,GAAG;AAAA,QAIjC;AAAA,MAEJ,CAAC,GACH;AAAA;AAAA,IAtBK;AAAA,EAuBP;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSVirtualListName, DSVirtualListSlots } from '../DSVirtualListDefinitions.js';\n\nexport const StyledWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ROOT })`\n width: 100%;\n height: 100%;\n padding-bottom: 0;\n overflow: auto;\n`;\n\nexport const StyledListWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.LIST_WRAPPER })<{\n height: number;\n}>`\n width: 100%;\n height: ${({ height }) => `${height}px`};\n position: relative;\n`;\n\nexport const StyledItemWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ITEM_WRAPPER })<{\n start: number;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n transform: ${({ start }) => `translateY(${start}px)`};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,sCAAsD;AAE/C,MAAM,oBAAgB,yBAAO,OAAO,EAAE,MAAM,mDAAmB,MAAM,mDAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,mDAAmB,MAAM,mDAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG;AAAA;AAAA;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,sCAAsD;AAE/C,MAAM,oBAAgB,yBAAO,OAAO,EAAE,MAAM,mDAAmB,MAAM,mDAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,mDAAmB,MAAM,mDAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG,MAAM,IAAI;AAAA;AAAA;AAIlC,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,mDAAmB,MAAM,mDAAmB,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlG,CAAC,EAAE,MAAM,MAAM,cAAc,KAAK,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/VirtualList.js
CHANGED
|
@@ -5,7 +5,6 @@ import { List } from "./parts/List.js";
|
|
|
5
5
|
import { DSVirtualListPropTypes } from "./react-desc-prop-types.js";
|
|
6
6
|
import { DSVirtualListName } from "./DSVirtualListDefinitions.js";
|
|
7
7
|
const DSVirtualList = (props) => /* @__PURE__ */ jsx(List, { ...props });
|
|
8
|
-
DSVirtualList.propTypes = DSVirtualListPropTypes;
|
|
9
8
|
DSVirtualList.displayName = DSVirtualListName;
|
|
10
9
|
const DSVirtualListWithSchema = describe(DSVirtualList).description("DSVirtualList");
|
|
11
10
|
DSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/VirtualList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './DSVirtualListDefinitions.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACOgC;AANvD,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,8BAAmD;AAC5D,SAAS,yBAAyB;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,oBAAC,QAAM,GAAG,OAAO;AAExE,cAAc,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './DSVirtualListDefinitions.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.displayName = DSVirtualListName;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOgC;AANvD,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,8BAAmD;AAC5D,SAAS,yBAAyB;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,oBAAC,QAAM,GAAG,OAAO;AAExE,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useVirtualList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { uid } from 'uid';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSVirtualListT, DSVirtualListPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nconst estimateSize = () => 50;\n// we \"own\" the interfaces/type instead of importing from react-virtual\n// to abstract our implementation from their\ninterface VirtualItem {\n key: string | number;\n index: number;\n start: number;\n end: number;\n size: number;\n}\ntype MeasureElement = ((element: HTMLElement) => number) | ((node: Element | null) => void);\n\nexport type VirtualListCTX = {\n parentRef: React.MutableRefObject<HTMLDivElement | null>;\n getVirtualItems: () => VirtualItem[];\n filteredChildren: React.ReactNode[];\n totalSize: number;\n instanceUid: string;\n measureElement: MeasureElement;\n propsWithDefault: DSVirtualListT.InternalProps;\n};\nexport const useVirtualListV3 = (propsFromUser: DSVirtualListT.Props): VirtualListCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSVirtualListT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSVirtualListPropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { children, actionRef } = propsWithDefault;\n const parentRef = React.useRef<HTMLDivElement>(null);\n const filteredChildren = React.useMemo(\n () => React.Children.toArray(children).filter((child) => child !== undefined && child !== null),\n [children],\n ) as React.ReactNode[];\n const useVirtualHelpers = useVirtualizer({\n count: filteredChildren.length,\n getScrollElement: () => parentRef.current,\n overscan: 15,\n estimateSize,\n });\n const totalSize = useVirtualHelpers.getTotalSize();\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n }\n }, [actionRef, useVirtualHelpers]);\n\n const instanceUid = React.useMemo(() => `ds-virtual-list-${uid(6)}`, []);\n return React.useMemo(\n () => ({\n parentRef,\n getVirtualItems: useVirtualHelpers.getVirtualItems,\n filteredChildren,\n totalSize,\n instanceUid,\n measureElement: useVirtualHelpers.measureElement,\n propsWithDefault,\n }),\n [\n useVirtualHelpers.getVirtualItems,\n useVirtualHelpers.measureElement,\n filteredChildren,\n totalSize,\n instanceUid,\n propsWithDefault,\n ],\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,WAAW;AACpB,SAAS,sBAAsB;AAC/B,SAAS,oCAAoC;AAC7C,SAA8B,wBAAwB,oBAAoB;AAC1E,SAAS,wBAAwB;AAEjC,MAAM,eAAe,MAAM;AAqBpB,MAAM,mBAAmB,CAAC,kBAAwD;AAIvF,QAAM,mBAAmB,6BAA2D,eAAe,YAAY;AAC/G,mBAAiB,kBAAkB,sBAAsB;AAIzD,QAAM,EAAE,UAAU,UAAU,IAAI;AAChC,QAAM,YAAYA,OAAM,OAAuB,IAAI;AACnD,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,MAAMA,OAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,IAAI;AAAA,IAC9F,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,oBAAoB,eAAe;AAAA,IACvC,OAAO,iBAAiB;AAAA,IACxB,kBAAkB,MAAM,UAAU;AAAA,IAClC,UAAU;AAAA,IACV;AAAA,EACF,CAAC;AACD,QAAM,YAAY,kBAAkB,aAAa;AACjD,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,aAAa,UAAU,SAAS;AAClC,g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;AAAA,IACF;AAAA,IACA;AAAA,MACE,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\n\nexport { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots } from './DSVirtualListDefinitions.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB,0BAA0B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/List.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\nimport { StyledWrapper, StyledListWrapper, StyledItemWrapper } from './styled.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement, propsWithDefault } =\n useVirtualListV3(props);\n const virtualItems = getVirtualItems();\n const measureRef: React.LegacyRef<HTMLDivElement> = React.useCallback(\n (node: HTMLDivElement) => measureElement(node),\n [measureElement],\n );\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <StyledWrapper\n key={instanceUid}\n innerRef={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n {...ownerPropsConfig}\n >\n <StyledListWrapper height={totalSize} {...ownerPropsConfig}>\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <StyledItemWrapper\n innerRef={measureRef}\n data-index={index}\n start={start}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n {...ownerPropsConfig}\n >\n {filteredChildren[index]}\n </StyledItemWrapper>\n );\n })}\n </StyledListWrapper>\n </StyledWrapper>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC8BX;AA9BZ,OAAOA,YAAW;AAClB,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAEjC,SAAS,eAAe,mBAAmB,yBAAyB;AAE7D,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,gBAAgB,iBAAiB,IAC7G,iBAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8CA,OAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,UAAU;AAAA,MACV,eAAa,iBAAiB;AAAA,MAC9B,MAAK;AAAA,MACJ,GAAG;AAAA,MAEJ,8BAAC,qBAAkB,QAAQ,WAAY,GAAG,kBACvC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,eACE;AAAA,UAAC;AAAA;AAAA,YAC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4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DSVirtualListName, DSVirtualListSlots } from '../DSVirtualListDefinitions.js';\n\nexport const StyledWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ROOT })`\n width: 100%;\n height: 100%;\n padding-bottom: 0;\n overflow: auto;\n`;\n\nexport const StyledListWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.LIST_WRAPPER })<{\n height: number;\n}>`\n width: 100%;\n height: ${({ height }) => `${height}px`};\n position: relative;\n`;\n\nexport const StyledItemWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ITEM_WRAPPER })<{\n start: number;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n transform: ${({ start }) => `translateY(${start}px)`};\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,mBAAmB,0BAA0B;AAE/C,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG;AAAA;AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,mBAAmB,0BAA0B;AAE/C,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG,MAAM,IAAI;AAAA;AAAA;AAIlC,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlG,CAAC,EAAE,MAAM,MAAM,cAAc,KAAK,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type DSVirtualListT } from './react-desc-prop-types.js';
|
|
3
2
|
declare const DSVirtualList: {
|
|
4
3
|
(props: DSVirtualListT.Props): import("react/jsx-runtime.js").JSX.Element;
|
|
5
|
-
propTypes: React.WeakValidationMap<unknown>;
|
|
6
4
|
displayName: string;
|
|
7
5
|
};
|
|
8
6
|
declare const DSVirtualListWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSVirtualListT.Props>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-virtual-list",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.36.0-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Virtual List",
|
|
6
6
|
"files": [
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
"@tanstack/react-virtual": "3.0.0-beta.54",
|
|
64
64
|
"@xstyled/system": "3.7.0",
|
|
65
65
|
"uid": "^2.0.1",
|
|
66
|
-
"@elliemae/ds-props-helpers": "3.
|
|
67
|
-
"@elliemae/ds-
|
|
68
|
-
"@elliemae/ds-
|
|
69
|
-
"@elliemae/ds-
|
|
66
|
+
"@elliemae/ds-props-helpers": "3.36.0-next.1",
|
|
67
|
+
"@elliemae/ds-system": "3.36.0-next.1",
|
|
68
|
+
"@elliemae/ds-typescript-helpers": "3.36.0-next.1",
|
|
69
|
+
"@elliemae/ds-utilities": "3.36.0-next.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
73
73
|
"styled-components": "~5.3.9",
|
|
74
|
-
"@elliemae/ds-
|
|
75
|
-
"@elliemae/ds-
|
|
74
|
+
"@elliemae/ds-monorepo-devops": "3.36.0-next.1",
|
|
75
|
+
"@elliemae/ds-test-utils": "3.36.0-next.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"lodash": "^4.17.21",
|