@elliemae/ds-virtual-list 3.0.0-alpha.0 → 3.0.0-alpha.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 +15 -3
- package/dist/cjs/VirtualList.js.map +1 -1
- package/dist/cjs/parts/List.js +8 -1
- package/dist/cjs/parts/List.js.map +2 -2
- package/dist/esm/VirtualList.js +17 -3
- package/dist/esm/VirtualList.js.map +1 -1
- package/dist/esm/parts/List.js +8 -1
- package/dist/esm/parts/List.js.map +2 -2
- package/package.json +3 -2
- package/dist/types/VirtualList.d.ts +0 -5
- package/dist/types/VirtualListDataTestID.d.ts +0 -3
- package/dist/types/hooks/useVirtualList.d.ts +0 -9
- package/dist/types/index.d.ts +0 -1
- package/dist/types/parts/List.d.ts +0 -10
- package/dist/types/props.d.ts +0 -20
- package/dist/types/styled.d.ts +0 -5
package/dist/cjs/VirtualList.js
CHANGED
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -39,9 +53,7 @@ var import_props = require("./props");
|
|
|
39
53
|
const DSVirtualList = (props) => {
|
|
40
54
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_props.defaultProps);
|
|
41
55
|
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_props.DSVirtualListSchema);
|
|
42
|
-
return /* @__PURE__ */ import_react.default.createElement(import_List.List, {
|
|
43
|
-
...propsWithDefault
|
|
44
|
-
});
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement(import_List.List, __spreadValues({}, propsWithDefault));
|
|
45
57
|
};
|
|
46
58
|
DSVirtualList.propTypes = import_props.DSVirtualListSchema;
|
|
47
59
|
const DSVirtualListWithSchema = (0, import_react_desc.describe)(DSVirtualList).description("DSVirtualList");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/VirtualList.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { List } from './parts/List';\nimport { DSVirtualListSchema, defaultProps } from './props';\nimport { DSVirtualListProps } from './index.d';\n\n\nconst DSVirtualList: React.ComponentType<DSVirtualListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSVirtualListSchema);\n\n return <List {...propsWithDefault} />;\n};\n\nDSVirtualList.propTypes = DSVirtualListSchema;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListSchema;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAA6E;AAC7E,wBAAyB;AACzB,kBAAqB;AACrB,mBAAkD;AAIlD,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,0DAA6B,OAAO;AAC7D,8DAA+B,kBAAkB;AAEjD,SAAO,mDAAC,kBAAD,mBAAU;AAAA;AAGnB,cAAc,YAAY;AAC1B,MAAM,0BAA0B,gCAAS,eAAe,YAAY;AACpE,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/parts/List.js
CHANGED
|
@@ -31,11 +31,13 @@ __export(List_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
33
|
var import_react = __toESM(require("react"));
|
|
34
|
+
var import_uid = require("uid");
|
|
34
35
|
var import_styled = require("../styled");
|
|
35
36
|
var import_VirtualListDataTestID = require("../VirtualListDataTestID");
|
|
36
37
|
var import_useVirtualList = require("../hooks/useVirtualList");
|
|
37
38
|
const List = (props) => {
|
|
38
39
|
const { parentRef, virtualItems, filteredChildren, totalSize } = (0, import_useVirtualList.useVirtualList)(props);
|
|
40
|
+
const [dynamicRerenderWorkaround, setDynamicRerenderWorkaround] = import_react.default.useState((0, import_uid.uid)(6));
|
|
39
41
|
const virtualChildren = import_react.default.useMemo(() => virtualItems.map((virtualItem) => {
|
|
40
42
|
const { index, measureRef, start } = virtualItem;
|
|
41
43
|
const style = {
|
|
@@ -44,10 +46,15 @@ const List = (props) => {
|
|
|
44
46
|
return /* @__PURE__ */ import_react.default.createElement(import_styled.VirtualItemStyled, {
|
|
45
47
|
ref: measureRef,
|
|
46
48
|
style,
|
|
47
|
-
role: "listitem"
|
|
49
|
+
role: "listitem",
|
|
50
|
+
key: `ds-virtual-list-item-${(0, import_uid.uid)(6)}`
|
|
48
51
|
}, filteredChildren[index]);
|
|
49
52
|
}), [filteredChildren, virtualItems]);
|
|
53
|
+
import_react.default.useEffect(() => {
|
|
54
|
+
setDynamicRerenderWorkaround((0, import_uid.uid)(6));
|
|
55
|
+
}, [filteredChildren]);
|
|
50
56
|
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledContainerContentList, {
|
|
57
|
+
key: `ds-virtual-list-${dynamicRerenderWorkaround}`,
|
|
51
58
|
ref: parentRef,
|
|
52
59
|
"data-testid": import_VirtualListDataTestID.LIST_DATA_TESTID.CONTAINER,
|
|
53
60
|
role: "list"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/List.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { VirtualItemStyled, StyledContainerContentList, StyledVirtualList } from '../styled';\n\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID';\n\nimport { DSVirtualListProps } from '../index.d';\nimport { useVirtualList } from '../hooks/useVirtualList';\n\n/**\n * List component: renders a list of items\n * Accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/List_role\n *\n * @param {DSVirtualListProps} props\n * @returns JSX\n */\nexport const List: React.FC<DSVirtualListProps> = (props: DSVirtualListProps) => {\n const { parentRef, virtualItems, filteredChildren, totalSize } = useVirtualList(props);\n const virtualChildren = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const style = {\n transform: `translateY(${start}px)`,\n };\n return (\n <VirtualItemStyled ref={measureRef} style={style} role=\"listitem\">\n {filteredChildren[index]}\n </VirtualItemStyled>\n );\n }),\n [filteredChildren, virtualItems],\n );\n return (\n <StyledContainerContentList
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAiF;AAEjF,mCAAiC;AAGjC,4BAA+B;AASxB,MAAM,OAAqC,CAAC,UAA8B;AAC/E,QAAM,EAAE,WAAW,cAAc,kBAAkB,cAAc,0CAAe;AAChF,QAAM,kBAAkB,qBAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA;AAE3B,WACE,mDAAC,iCAAD;AAAA,MAAmB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { uid } from 'uid';\nimport { VirtualItemStyled, StyledContainerContentList, StyledVirtualList } from '../styled';\n\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID';\n\nimport { DSVirtualListProps } from '../index.d';\nimport { useVirtualList } from '../hooks/useVirtualList';\n\n/**\n * List component: renders a list of items\n * Accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/List_role\n *\n * @param {DSVirtualListProps} props\n * @returns JSX\n */\nexport const List: React.FC<DSVirtualListProps> = (props: DSVirtualListProps) => {\n const { parentRef, virtualItems, filteredChildren, totalSize } = useVirtualList(props);\n const [dynamicRerenderWorkaround, setDynamicRerenderWorkaround] = React.useState(uid(6));\n const virtualChildren = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const style = {\n transform: `translateY(${start}px)`,\n };\n return (\n <VirtualItemStyled ref={measureRef} style={style} role=\"listitem\" key={`ds-virtual-list-item-${uid(6)}`}>\n {filteredChildren[index]}\n </VirtualItemStyled>\n );\n }),\n [filteredChildren, virtualItems],\n );\n React.useEffect(() => {\n setDynamicRerenderWorkaround(uid(6));\n }, [filteredChildren]);\n return (\n <StyledContainerContentList\n key={`ds-virtual-list-${dynamicRerenderWorkaround}`}\n ref={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n >\n <StyledVirtualList height={`${totalSize}px`}>{virtualChildren}</StyledVirtualList>\n </StyledContainerContentList>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,iBAAoB;AACpB,oBAAiF;AAEjF,mCAAiC;AAGjC,4BAA+B;AASxB,MAAM,OAAqC,CAAC,UAA8B;AAC/E,QAAM,EAAE,WAAW,cAAc,kBAAkB,cAAc,0CAAe;AAChF,QAAM,CAAC,2BAA2B,gCAAgC,qBAAM,SAAS,oBAAI;AACrF,QAAM,kBAAkB,qBAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA;AAE3B,WACE,mDAAC,iCAAD;AAAA,MAAmB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,MAAW,KAAK,wBAAwB,oBAAI;AAAA,OAChG,iBAAiB;AAAA,MAI1B,CAAC,kBAAkB;AAErB,uBAAM,UAAU,MAAM;AACpB,iCAA6B,oBAAI;AAAA,KAChC,CAAC;AACJ,SACE,mDAAC,0CAAD;AAAA,IACE,KAAK,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,eAAa,8CAAiB;AAAA,IAC9B,MAAK;AAAA,KAEL,mDAAC,iCAAD;AAAA,IAAmB,QAAQ,GAAG;AAAA,KAAgB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/VirtualList.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2 from "react";
|
|
3
19
|
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
@@ -7,9 +23,7 @@ import { DSVirtualListSchema, defaultProps } from "./props";
|
|
|
7
23
|
const DSVirtualList = (props) => {
|
|
8
24
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
9
25
|
useValidateTypescriptPropTypes(propsWithDefault, DSVirtualListSchema);
|
|
10
|
-
return /* @__PURE__ */ React2.createElement(List, {
|
|
11
|
-
...propsWithDefault
|
|
12
|
-
});
|
|
26
|
+
return /* @__PURE__ */ React2.createElement(List, __spreadValues({}, propsWithDefault));
|
|
13
27
|
};
|
|
14
28
|
DSVirtualList.propTypes = DSVirtualListSchema;
|
|
15
29
|
const DSVirtualListWithSchema = describe(DSVirtualList).description("DSVirtualList");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/VirtualList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { List } from './parts/List';\nimport { DSVirtualListSchema, defaultProps } from './props';\nimport { DSVirtualListProps } from './index.d';\n\n\nconst DSVirtualList: React.ComponentType<DSVirtualListProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSVirtualListSchema);\n\n return <List {...propsWithDefault} />;\n};\n\nDSVirtualList.propTypes = DSVirtualListSchema;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListSchema;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAIA,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,iCAA+B,kBAAkB;AAEjD,SAAO,qCAAC,MAAD
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AAIA,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,iCAA+B,kBAAkB;AAEjD,SAAO,qCAAC,MAAD,mBAAU;AAAA;AAGnB,cAAc,YAAY;AAC1B,MAAM,0BAA0B,SAAS,eAAe,YAAY;AACpE,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/List.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
3
4
|
import { VirtualItemStyled, StyledContainerContentList, StyledVirtualList } from "../styled";
|
|
4
5
|
import { LIST_DATA_TESTID } from "../VirtualListDataTestID";
|
|
5
6
|
import { useVirtualList } from "../hooks/useVirtualList";
|
|
6
7
|
const List = (props) => {
|
|
7
8
|
const { parentRef, virtualItems, filteredChildren, totalSize } = useVirtualList(props);
|
|
9
|
+
const [dynamicRerenderWorkaround, setDynamicRerenderWorkaround] = React2.useState(uid(6));
|
|
8
10
|
const virtualChildren = React2.useMemo(() => virtualItems.map((virtualItem) => {
|
|
9
11
|
const { index, measureRef, start } = virtualItem;
|
|
10
12
|
const style = {
|
|
@@ -13,10 +15,15 @@ const List = (props) => {
|
|
|
13
15
|
return /* @__PURE__ */ React2.createElement(VirtualItemStyled, {
|
|
14
16
|
ref: measureRef,
|
|
15
17
|
style,
|
|
16
|
-
role: "listitem"
|
|
18
|
+
role: "listitem",
|
|
19
|
+
key: `ds-virtual-list-item-${uid(6)}`
|
|
17
20
|
}, filteredChildren[index]);
|
|
18
21
|
}), [filteredChildren, virtualItems]);
|
|
22
|
+
React2.useEffect(() => {
|
|
23
|
+
setDynamicRerenderWorkaround(uid(6));
|
|
24
|
+
}, [filteredChildren]);
|
|
19
25
|
return /* @__PURE__ */ React2.createElement(StyledContainerContentList, {
|
|
26
|
+
key: `ds-virtual-list-${dynamicRerenderWorkaround}`,
|
|
20
27
|
ref: parentRef,
|
|
21
28
|
"data-testid": LIST_DATA_TESTID.CONTAINER,
|
|
22
29
|
role: "list"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/List.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { VirtualItemStyled, StyledContainerContentList, StyledVirtualList } from '../styled';\n\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID';\n\nimport { DSVirtualListProps } from '../index.d';\nimport { useVirtualList } from '../hooks/useVirtualList';\n\n/**\n * List component: renders a list of items\n * Accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/List_role\n *\n * @param {DSVirtualListProps} props\n * @returns JSX\n */\nexport const List: React.FC<DSVirtualListProps> = (props: DSVirtualListProps) => {\n const { parentRef, virtualItems, filteredChildren, totalSize } = useVirtualList(props);\n const virtualChildren = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const style = {\n transform: `translateY(${start}px)`,\n };\n return (\n <VirtualItemStyled ref={measureRef} style={style} role=\"listitem\">\n {filteredChildren[index]}\n </VirtualItemStyled>\n );\n }),\n [filteredChildren, virtualItems],\n );\n return (\n <StyledContainerContentList
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA;AAGA;AASO,MAAM,OAAqC,CAAC,UAA8B;AAC/E,QAAM,EAAE,WAAW,cAAc,kBAAkB,cAAc,eAAe;AAChF,QAAM,kBAAkB,OAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA;AAE3B,WACE,qCAAC,mBAAD;AAAA,MAAmB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { uid } from 'uid';\nimport { VirtualItemStyled, StyledContainerContentList, StyledVirtualList } from '../styled';\n\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID';\n\nimport { DSVirtualListProps } from '../index.d';\nimport { useVirtualList } from '../hooks/useVirtualList';\n\n/**\n * List component: renders a list of items\n * Accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/List_role\n *\n * @param {DSVirtualListProps} props\n * @returns JSX\n */\nexport const List: React.FC<DSVirtualListProps> = (props: DSVirtualListProps) => {\n const { parentRef, virtualItems, filteredChildren, totalSize } = useVirtualList(props);\n const [dynamicRerenderWorkaround, setDynamicRerenderWorkaround] = React.useState(uid(6));\n const virtualChildren = React.useMemo(\n () =>\n virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const style = {\n transform: `translateY(${start}px)`,\n };\n return (\n <VirtualItemStyled ref={measureRef} style={style} role=\"listitem\" key={`ds-virtual-list-item-${uid(6)}`}>\n {filteredChildren[index]}\n </VirtualItemStyled>\n );\n }),\n [filteredChildren, virtualItems],\n );\n React.useEffect(() => {\n setDynamicRerenderWorkaround(uid(6));\n }, [filteredChildren]);\n return (\n <StyledContainerContentList\n key={`ds-virtual-list-${dynamicRerenderWorkaround}`}\n ref={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n >\n <StyledVirtualList height={`${totalSize}px`}>{virtualChildren}</StyledVirtualList>\n </StyledContainerContentList>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAGA;AASO,MAAM,OAAqC,CAAC,UAA8B;AAC/E,QAAM,EAAE,WAAW,cAAc,kBAAkB,cAAc,eAAe;AAChF,QAAM,CAAC,2BAA2B,gCAAgC,OAAM,SAAS,IAAI;AACrF,QAAM,kBAAkB,OAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA;AAE3B,WACE,qCAAC,mBAAD;AAAA,MAAmB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,MAAW,KAAK,wBAAwB,IAAI;AAAA,OAChG,iBAAiB;AAAA,MAI1B,CAAC,kBAAkB;AAErB,SAAM,UAAU,MAAM;AACpB,iCAA6B,IAAI;AAAA,KAChC,CAAC;AACJ,SACE,qCAAC,4BAAD;AAAA,IACE,KAAK,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,eAAa,iBAAiB;AAAA,IAC9B,MAAK;AAAA,KAEL,qCAAC,mBAAD;AAAA,IAAmB,QAAQ,GAAG;AAAA,KAAgB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-virtual-list",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Virtual List",
|
|
6
6
|
"files": [
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"indent": 4
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@elliemae/ds-props-helpers": "3.0.0-alpha.
|
|
62
|
+
"@elliemae/ds-props-helpers": "3.0.0-alpha.1",
|
|
63
63
|
"prop-types": "~15.7.2",
|
|
64
64
|
"react-desc": "~4.1.3",
|
|
65
65
|
"react-virtual": "~2.3.2"
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"scripts": {
|
|
81
81
|
"test": "node ../../scripts/testing/test.mjs",
|
|
82
82
|
"lint": "node ../../scripts/lint.mjs",
|
|
83
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
83
84
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
84
85
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"
|
|
85
86
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { VirtualItem } from 'react-virtual';
|
|
3
|
-
import { DSVirtualListProps } from '../index.d';
|
|
4
|
-
export declare const useVirtualList: (config: DSVirtualListProps) => {
|
|
5
|
-
parentRef: React.MutableRefObject<HTMLDivElement>;
|
|
6
|
-
virtualItems: VirtualItem[];
|
|
7
|
-
filteredChildren: React.ReactNode[];
|
|
8
|
-
totalSize: number;
|
|
9
|
-
};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './VirtualList';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DSVirtualListProps } from '../index.d';
|
|
3
|
-
/**
|
|
4
|
-
* List component: renders a list of items
|
|
5
|
-
* Accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/List_role
|
|
6
|
-
*
|
|
7
|
-
* @param {DSVirtualListProps} props
|
|
8
|
-
* @returns JSX
|
|
9
|
-
*/
|
|
10
|
-
export declare const List: React.FC<DSVirtualListProps>;
|
package/dist/types/props.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
export declare const DSVirtualListSchema: {
|
|
3
|
-
children: {
|
|
4
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
5
|
-
};
|
|
6
|
-
actionRef: {
|
|
7
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
8
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
9
|
-
};
|
|
10
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const defaultProps: {
|
|
14
|
-
children: never[];
|
|
15
|
-
actionRef: {
|
|
16
|
-
current: {
|
|
17
|
-
scrollTo: (...args: any[]) => void;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
package/dist/types/styled.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const StyledContainerContentList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
-
export declare const StyledVirtualList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
-
height: string;
|
|
4
|
-
}, never>;
|
|
5
|
-
export declare const VirtualItemStyled: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|