@elliemae/ds-virtual-list 3.0.0-next.8 → 3.0.0-rc.0
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 +13 -19
- package/dist/cjs/VirtualList.js.map +2 -2
- package/dist/cjs/VirtualListDataTestID.js +9 -16
- package/dist/cjs/VirtualListDataTestID.js.map +1 -1
- package/dist/cjs/hooks/useVirtualList.js +9 -16
- package/dist/cjs/hooks/useVirtualList.js.map +1 -1
- package/dist/cjs/index.d.js +9 -16
- package/dist/cjs/index.d.js.map +1 -1
- package/dist/cjs/index.js +11 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parts/List.js +9 -16
- package/dist/cjs/parts/List.js.map +1 -1
- package/dist/cjs/props.js +9 -16
- package/dist/cjs/props.js.map +1 -1
- package/dist/cjs/styled.js +9 -16
- package/dist/cjs/styled.js.map +1 -1
- package/dist/esm/VirtualList.js +2 -1
- package/dist/esm/VirtualList.js.map +2 -2
- package/dist/esm/VirtualListDataTestID.js.map +1 -1
- package/dist/esm/hooks/useVirtualList.js.map +1 -1
- package/dist/esm/parts/List.js.map +1 -1
- package/dist/esm/props.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/VirtualList.js
CHANGED
|
@@ -18,45 +18,39 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var VirtualList_exports = {};
|
|
43
36
|
__export(VirtualList_exports, {
|
|
44
37
|
DSVirtualList: () => DSVirtualList,
|
|
45
38
|
DSVirtualListWithSchema: () => DSVirtualListWithSchema
|
|
46
39
|
});
|
|
40
|
+
module.exports = __toCommonJS(VirtualList_exports);
|
|
47
41
|
var React = __toESM(require("react"));
|
|
48
42
|
var import_react = __toESM(require("react"));
|
|
49
|
-
var
|
|
43
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
50
44
|
var import_react_desc = require("react-desc");
|
|
51
45
|
var import_List = require("./parts/List");
|
|
52
46
|
var import_props = require("./props");
|
|
53
47
|
const DSVirtualList = (props) => {
|
|
54
|
-
const propsWithDefault = (0,
|
|
55
|
-
(0,
|
|
48
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.defaultProps);
|
|
49
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_props.DSVirtualListSchema);
|
|
56
50
|
return /* @__PURE__ */ import_react.default.createElement(import_List.List, __spreadValues({}, propsWithDefault));
|
|
57
51
|
};
|
|
58
52
|
DSVirtualList.propTypes = import_props.DSVirtualListSchema;
|
|
53
|
+
DSVirtualList.displayName = "DSVirtualList";
|
|
59
54
|
const DSVirtualListWithSchema = (0, import_react_desc.describe)(DSVirtualList).description("DSVirtualList");
|
|
60
55
|
DSVirtualListWithSchema.propTypes = import_props.DSVirtualListSchema;
|
|
61
|
-
module.exports = __toCommonJS(VirtualList_exports);
|
|
62
56
|
//# sourceMappingURL=VirtualList.js.map
|
|
@@ -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 { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\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;\nDSVirtualList.displayName = 'DSVirtualList';\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListSchema;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,0BAA6E;AAC7E,wBAAyB;AACzB,kBAAqB;AACrB,mBAAkD;AAIlD,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,sDAA6B,OAAO,yBAAY;AACzE,0DAA+B,kBAAkB,gCAAmB;AAEpE,SAAO,mDAAC,qCAAS,iBAAkB;AACrC;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,gCAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,34 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var VirtualListDataTestID_exports = {};
|
|
29
22
|
__export(VirtualListDataTestID_exports, {
|
|
30
23
|
LIST_DATA_TESTID: () => LIST_DATA_TESTID
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(VirtualListDataTestID_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
const LIST_DATA_TESTID = {
|
|
34
28
|
CONTAINER: "virtual-list-container"
|
|
35
29
|
};
|
|
36
|
-
module.exports = __toCommonJS(VirtualListDataTestID_exports);
|
|
37
30
|
//# sourceMappingURL=VirtualListDataTestID.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/VirtualListDataTestID.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const LIST_DATA_TESTID = {\n CONTAINER: 'virtual-list-container',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AACb;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var useVirtualList_exports = {};
|
|
29
22
|
__export(useVirtualList_exports, {
|
|
30
23
|
useVirtualList: () => useVirtualList
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(useVirtualList_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = __toESM(require("react"));
|
|
34
28
|
var import_react_virtual = require("react-virtual");
|
|
@@ -53,5 +47,4 @@ const useVirtualList = (config) => {
|
|
|
53
47
|
totalSize: useVirtualHelpers.totalSize
|
|
54
48
|
};
|
|
55
49
|
};
|
|
56
|
-
module.exports = __toCommonJS(useVirtualList_exports);
|
|
57
50
|
//# sourceMappingURL=useVirtualList.js.map
|
|
@@ -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 { useVirtual, VirtualItem } from 'react-virtual';\nimport { DSVirtualListProps } from '../index.d';\n\nexport const useVirtualList = (\n config: DSVirtualListProps,\n): {\n parentRef: React.MutableRefObject<HTMLDivElement>;\n virtualItems: VirtualItem[];\n filteredChildren: React.ReactNode[];\n totalSize: number;\n} => {\n const { children, actionRef } = config;\n const parentRef = React.useRef<HTMLDivElement>();\n const filteredChildren = React.useMemo(\n () => React.Children.toArray(children).filter((child) => child),\n [children],\n ) as React.ReactNode[];\n const useVirtualHelpers = useVirtual({\n size: filteredChildren.length,\n parentRef,\n overscan: 15,\n });\n React.useEffect(() => {\n if (actionRef) {\n actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n }\n }, [actionRef, useVirtualHelpers]);\n\n return {\n parentRef,\n virtualItems: useVirtualHelpers.virtualItems,\n filteredChildren,\n totalSize: useVirtualHelpers.totalSize,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,2BAAwC;AAGjC,MAAM,iBAAiB,CAC5B,WAMG;AACH,QAAM,EAAE,UAAU,cAAc;AAChC,QAAM,YAAY,qBAAM,OAAuB;AAC/C,QAAM,mBAAmB,qBAAM,QAC7B,MAAM,qBAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,KAAK,GAC9D,CAAC,QAAQ,CACX;AACA,QAAM,oBAAoB,qCAAW;AAAA,IACnC,MAAM,iBAAiB;AAAA,IACvB;AAAA,IACA,UAAU;AAAA,EACZ,CAAC;AACD,uBAAM,UAAU,MAAM;AACpB,QAAI,WAAW;AACb,gBAAU,QAAQ,WAAW,kBAAkB;AAAA,IACjD;AAAA,EACF,GAAG,CAAC,WAAW,iBAAiB,CAAC;AAEjC,SAAO;AAAA,IACL;AAAA,IACA,cAAc,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW,kBAAkB;AAAA,EAC/B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.d.js
CHANGED
|
@@ -4,24 +4,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var __toESM = (
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
17
|
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
18
|
module.exports = __toCommonJS(index_d_exports);
|
|
19
|
+
var React = __toESM(require("react"));
|
|
27
20
|
//# sourceMappingURL=index.d.js.map
|
package/dist/cjs/index.d.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.d.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\n\nexport interface DSVirtualListProps {\n children: React.ReactNode[];\n actionRef: React.MutableRefObject<any>;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,25 +4,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var src_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(src_exports, require("./VirtualList"));
|
|
27
19
|
module.exports = __toCommonJS(src_exports);
|
|
20
|
+
var React = __toESM(require("react"));
|
|
21
|
+
__reExport(src_exports, require("./VirtualList"), module.exports);
|
|
28
22
|
//# 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": ["export * from './VirtualList';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,0BAAd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/parts/List.js
CHANGED
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var List_exports = {};
|
|
29
22
|
__export(List_exports, {
|
|
30
23
|
List: () => List
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(List_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = __toESM(require("react"));
|
|
34
28
|
var import_uid = require("uid");
|
|
@@ -62,5 +56,4 @@ const List = (props) => {
|
|
|
62
56
|
height: `${totalSize}px`
|
|
63
57
|
}, virtualChildren));
|
|
64
58
|
};
|
|
65
|
-
module.exports = __toCommonJS(List_exports);
|
|
66
59
|
//# sourceMappingURL=List.js.map
|
|
@@ -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 { 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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;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,KAAK;AACrF,QAAM,CAAC,2BAA2B,gCAAgC,qBAAM,SAAS,oBAAI,CAAC,CAAC;AACvF,QAAM,kBAAkB,qBAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA,IAC3B;AACA,WACE,mDAAC;AAAA,MAAkB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,MAAW,KAAK,wBAAwB,oBAAI,CAAC;AAAA,OACjG,iBAAiB,MACpB;AAAA,EAEJ,CAAC,GACH,CAAC,kBAAkB,YAAY,CACjC;AACA,uBAAM,UAAU,MAAM;AACpB,iCAA6B,oBAAI,CAAC,CAAC;AAAA,EACrC,GAAG,CAAC,gBAAgB,CAAC;AACrB,SACE,mDAAC;AAAA,IACC,KAAK,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,eAAa,8CAAiB;AAAA,IAC9B,MAAK;AAAA,KAEL,mDAAC;AAAA,IAAkB,QAAQ,GAAG;AAAA,KAAgB,eAAgB,CAChE;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/props.js
CHANGED
|
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var props_exports = {};
|
|
29
22
|
__export(props_exports, {
|
|
30
23
|
DSVirtualListSchema: () => DSVirtualListSchema,
|
|
31
24
|
defaultProps: () => defaultProps
|
|
32
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(props_exports);
|
|
33
27
|
var React = __toESM(require("react"));
|
|
34
28
|
var import_lodash = require("lodash");
|
|
35
29
|
var import_react_desc = require("react-desc");
|
|
@@ -53,5 +47,4 @@ const defaultProps = {
|
|
|
53
47
|
}
|
|
54
48
|
}
|
|
55
49
|
};
|
|
56
|
-
module.exports = __toCommonJS(props_exports);
|
|
57
50
|
//# sourceMappingURL=props.js.map
|
package/dist/cjs/props.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/props.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\n\nconst actionRef = {\n scrollTo: PropTypes.func.description('Scroll to a index inside the list'),\n};\nexport const DSVirtualListSchema = {\n children: PropTypes.arrayOf(PropTypes.node).description('Children list').defaultValue([]),\n actionRef: PropTypes.shape({\n current: PropTypes.shape(actionRef),\n }).description(`Action reference\n \nscrollTo: Function(index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void\n `),\n};\n\nexport const defaultProps = {\n children: [],\n actionRef: {\n current: {\n scrollTo: noop,\n },\n },\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAqB;AACrB,wBAA0B;AAE1B,MAAM,YAAY;AAAA,EAChB,UAAU,4BAAU,KAAK,YAAY,mCAAmC;AAC1E;AACO,MAAM,sBAAsB;AAAA,EACjC,UAAU,4BAAU,QAAQ,4BAAU,IAAI,EAAE,YAAY,eAAe,EAAE,aAAa,CAAC,CAAC;AAAA,EACxF,WAAW,4BAAU,MAAM;AAAA,IACzB,SAAS,4BAAU,MAAM,SAAS;AAAA,EACpC,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA,GAGd;AACH;AAEO,MAAM,eAAe;AAAA,EAC1B,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,IACT,SAAS;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var styled_exports = {};
|
|
29
22
|
__export(styled_exports, {
|
|
30
23
|
StyledContainerContentList: () => StyledContainerContentList,
|
|
31
24
|
StyledVirtualList: () => StyledVirtualList,
|
|
32
25
|
VirtualItemStyled: () => VirtualItemStyled
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(styled_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
var import_styled_components = __toESM(require("styled-components"));
|
|
36
30
|
const StyledContainerContentList = import_styled_components.default.div`
|
|
@@ -51,5 +45,4 @@ const VirtualItemStyled = import_styled_components.default.div`
|
|
|
51
45
|
left: 0;
|
|
52
46
|
width: 100%;
|
|
53
47
|
`;
|
|
54
|
-
module.exports = __toCommonJS(styled_exports);
|
|
55
48
|
//# sourceMappingURL=styled.js.map
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import styled from 'styled-components';\n\nexport const StyledContainerContentList = styled.div`\n width: 100%;\n height: 100%;\n padding-bottom: 0;\n overflow-y: auto;\n overflow-x: hidden;\n`;\nexport const StyledVirtualList = styled.div<{ height: string }>`\n width: 100%;\n height: ${(props) => props.height};\n position: relative;\n`;\nexport const VirtualItemStyled = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAEZ,MAAM,6BAA6B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO1C,MAAM,oBAAoB,iCAAO;AAAA;AAAA,YAE5B,CAAC,UAAU,MAAM;AAAA;AAAA;AAGtB,MAAM,oBAAoB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/VirtualList.js
CHANGED
|
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import React2 from "react";
|
|
19
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-
|
|
19
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-utilities";
|
|
20
20
|
import { describe } from "react-desc";
|
|
21
21
|
import { List } from "./parts/List";
|
|
22
22
|
import { DSVirtualListSchema, defaultProps } from "./props";
|
|
@@ -26,6 +26,7 @@ const DSVirtualList = (props) => {
|
|
|
26
26
|
return /* @__PURE__ */ React2.createElement(List, __spreadValues({}, propsWithDefault));
|
|
27
27
|
};
|
|
28
28
|
DSVirtualList.propTypes = DSVirtualListSchema;
|
|
29
|
+
DSVirtualList.displayName = "DSVirtualList";
|
|
29
30
|
const DSVirtualListWithSchema = describe(DSVirtualList).description("DSVirtualList");
|
|
30
31
|
DSVirtualListWithSchema.propTypes = DSVirtualListSchema;
|
|
31
32
|
export {
|
|
@@ -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 { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AAIA,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA6B,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\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;\nDSVirtualList.displayName = 'DSVirtualList';\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,YAAY;AACzE,iCAA+B,kBAAkB,mBAAmB;AAEpE,SAAO,qCAAC,yBAAS,iBAAkB;AACrC;AAEA,cAAc,YAAY;AAC1B,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/VirtualListDataTestID.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const LIST_DATA_TESTID = {\n CONTAINER: 'virtual-list-container',\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAO,MAAM,mBAAmB;AAAA,EAC9B,WAAW;
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AACb;",
|
|
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 { useVirtual, VirtualItem } from 'react-virtual';\nimport { DSVirtualListProps } from '../index.d';\n\nexport const useVirtualList = (\n config: DSVirtualListProps,\n): {\n parentRef: React.MutableRefObject<HTMLDivElement>;\n virtualItems: VirtualItem[];\n filteredChildren: React.ReactNode[];\n totalSize: number;\n} => {\n const { children, actionRef } = config;\n const parentRef = React.useRef<HTMLDivElement>();\n const filteredChildren = React.useMemo(\n () => React.Children.toArray(children).filter((child) => child),\n [children],\n ) as React.ReactNode[];\n const useVirtualHelpers = useVirtual({\n size: filteredChildren.length,\n parentRef,\n overscan: 15,\n });\n React.useEffect(() => {\n if (actionRef) {\n actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n }\n }, [actionRef, useVirtualHelpers]);\n\n return {\n parentRef,\n virtualItems: useVirtualHelpers.virtualItems,\n filteredChildren,\n totalSize: useVirtualHelpers.totalSize,\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAGO,MAAM,iBAAiB,CAC5B,WAMG;AACH,QAAM,EAAE,UAAU,cAAc;AAChC,QAAM,YAAY,OAAM;
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAGO,MAAM,iBAAiB,CAC5B,WAMG;AACH,QAAM,EAAE,UAAU,cAAc;AAChC,QAAM,YAAY,OAAM,OAAuB;AAC/C,QAAM,mBAAmB,OAAM,QAC7B,MAAM,OAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,KAAK,GAC9D,CAAC,QAAQ,CACX;AACA,QAAM,oBAAoB,WAAW;AAAA,IACnC,MAAM,iBAAiB;AAAA,IACvB;AAAA,IACA,UAAU;AAAA,EACZ,CAAC;AACD,SAAM,UAAU,MAAM;AACpB,QAAI,WAAW;AACb,gBAAU,QAAQ,WAAW,kBAAkB;AAAA,IACjD;AAAA,EACF,GAAG,CAAC,WAAW,iBAAiB,CAAC;AAEjC,SAAO;AAAA,IACL;AAAA,IACA,cAAc,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW,kBAAkB;AAAA,EAC/B;AACF;",
|
|
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 { 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;
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAGA;AASO,MAAM,OAAqC,CAAC,UAA8B;AAC/E,QAAM,EAAE,WAAW,cAAc,kBAAkB,cAAc,eAAe,KAAK;AACrF,QAAM,CAAC,2BAA2B,gCAAgC,OAAM,SAAS,IAAI,CAAC,CAAC;AACvF,QAAM,kBAAkB,OAAM,QAC5B,MACE,aAAa,IAAI,CAAC,gBAAgB;AAChC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,QAAQ;AAAA,MACZ,WAAW,cAAc;AAAA,IAC3B;AACA,WACE,qCAAC;AAAA,MAAkB,KAAK;AAAA,MAAY;AAAA,MAAc,MAAK;AAAA,MAAW,KAAK,wBAAwB,IAAI,CAAC;AAAA,OACjG,iBAAiB,MACpB;AAAA,EAEJ,CAAC,GACH,CAAC,kBAAkB,YAAY,CACjC;AACA,SAAM,UAAU,MAAM;AACpB,iCAA6B,IAAI,CAAC,CAAC;AAAA,EACrC,GAAG,CAAC,gBAAgB,CAAC;AACrB,SACE,qCAAC;AAAA,IACC,KAAK,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,eAAa,iBAAiB;AAAA,IAC9B,MAAK;AAAA,KAEL,qCAAC;AAAA,IAAkB,QAAQ,GAAG;AAAA,KAAgB,eAAgB,CAChE;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/props.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\n\nconst actionRef = {\n scrollTo: PropTypes.func.description('Scroll to a index inside the list'),\n};\nexport const DSVirtualListSchema = {\n children: PropTypes.arrayOf(PropTypes.node).description('Children list').defaultValue([]),\n actionRef: PropTypes.shape({\n current: PropTypes.shape(actionRef),\n }).description(`Action reference\n \nscrollTo: Function(index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void\n `),\n};\n\nexport const defaultProps = {\n children: [],\n actionRef: {\n current: {\n scrollTo: noop,\n },\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,YAAY;AAAA,EAChB,UAAU,UAAU,KAAK,YAAY;
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,YAAY;AAAA,EAChB,UAAU,UAAU,KAAK,YAAY,mCAAmC;AAC1E;AACO,MAAM,sBAAsB;AAAA,EACjC,UAAU,UAAU,QAAQ,UAAU,IAAI,EAAE,YAAY,eAAe,EAAE,aAAa,CAAC,CAAC;AAAA,EACxF,WAAW,UAAU,MAAM;AAAA,IACzB,SAAS,UAAU,MAAM,SAAS;AAAA,EACpC,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA,GAGd;AACH;AAEO,MAAM,eAAe;AAAA,EAC1B,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,IACT,SAAS;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AACF;",
|
|
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-
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Virtual List",
|
|
6
6
|
"files": [
|
|
@@ -58,8 +58,15 @@
|
|
|
58
58
|
"reportFile": "tests.xml",
|
|
59
59
|
"indent": 4
|
|
60
60
|
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
63
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
64
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
65
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
66
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"
|
|
67
|
+
},
|
|
61
68
|
"dependencies": {
|
|
62
|
-
"@elliemae/ds-
|
|
69
|
+
"@elliemae/ds-utilities": "workspace:*",
|
|
63
70
|
"prop-types": "~15.8.1",
|
|
64
71
|
"react-desc": "~4.1.3",
|
|
65
72
|
"react-virtual": "~2.3.2"
|
|
@@ -76,12 +83,5 @@
|
|
|
76
83
|
"publishConfig": {
|
|
77
84
|
"access": "public",
|
|
78
85
|
"typeSafety": false
|
|
79
|
-
},
|
|
80
|
-
"scripts": {
|
|
81
|
-
"test": "node ../../scripts/testing/test.mjs",
|
|
82
|
-
"lint": "node ../../scripts/lint.mjs",
|
|
83
|
-
"dts": "node ../../scripts/dts.mjs",
|
|
84
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
85
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"
|
|
86
86
|
}
|
|
87
|
-
}
|
|
87
|
+
}
|