@elliemae/ds-legacy-virtual-list 1.0.0-rc.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.
Files changed (49) hide show
  1. package/dist/cjs/DSVirtualListDefinitions.js +36 -0
  2. package/dist/cjs/DSVirtualListDefinitions.js.map +7 -0
  3. package/dist/cjs/VirtualList.js +46 -0
  4. package/dist/cjs/VirtualList.js.map +7 -0
  5. package/dist/cjs/VirtualListDataTestID.js +38 -0
  6. package/dist/cjs/VirtualListDataTestID.js.map +7 -0
  7. package/dist/cjs/hooks/useValidateProps.js +40 -0
  8. package/dist/cjs/hooks/useValidateProps.js.map +7 -0
  9. package/dist/cjs/hooks/useVirtualList.js +76 -0
  10. package/dist/cjs/hooks/useVirtualList.js.map +7 -0
  11. package/dist/cjs/index.js +38 -0
  12. package/dist/cjs/index.js.map +7 -0
  13. package/dist/cjs/package.json +7 -0
  14. package/dist/cjs/parts/List.js +92 -0
  15. package/dist/cjs/parts/List.js.map +7 -0
  16. package/dist/cjs/props.js +58 -0
  17. package/dist/cjs/props.js.map +7 -0
  18. package/dist/cjs/react-desc-prop-types.js +49 -0
  19. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  20. package/dist/esm/DSVirtualListDefinitions.js +6 -0
  21. package/dist/esm/DSVirtualListDefinitions.js.map +7 -0
  22. package/dist/esm/VirtualList.js +16 -0
  23. package/dist/esm/VirtualList.js.map +7 -0
  24. package/dist/esm/VirtualListDataTestID.js +8 -0
  25. package/dist/esm/VirtualListDataTestID.js.map +7 -0
  26. package/dist/esm/hooks/useValidateProps.js +10 -0
  27. package/dist/esm/hooks/useValidateProps.js.map +7 -0
  28. package/dist/esm/hooks/useVirtualList.js +46 -0
  29. package/dist/esm/hooks/useVirtualList.js.map +7 -0
  30. package/dist/esm/index.js +8 -0
  31. package/dist/esm/index.js.map +7 -0
  32. package/dist/esm/package.json +7 -0
  33. package/dist/esm/parts/List.js +62 -0
  34. package/dist/esm/parts/List.js.map +7 -0
  35. package/dist/esm/props.js +28 -0
  36. package/dist/esm/props.js.map +7 -0
  37. package/dist/esm/react-desc-prop-types.js +19 -0
  38. package/dist/esm/react-desc-prop-types.js.map +7 -0
  39. package/dist/types/DSVirtualListDefinitions.d.ts +1 -0
  40. package/dist/types/VirtualList.d.ts +9 -0
  41. package/dist/types/VirtualListDataTestID.d.ts +3 -0
  42. package/dist/types/hooks/useValidateProps.d.ts +3 -0
  43. package/dist/types/hooks/useVirtualList.d.ts +20 -0
  44. package/dist/types/index.d.ts +2 -0
  45. package/dist/types/parts/List.d.ts +2 -0
  46. package/dist/types/props.d.ts +12 -0
  47. package/dist/types/react-desc-prop-types.d.ts +24 -0
  48. package/dist/types/tests/basicV3.test.d.ts +1 -0
  49. package/package.json +96 -0
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSVirtualListDefinitions_exports = {};
30
+ __export(DSVirtualListDefinitions_exports, {
31
+ DSVirtualListName: () => DSVirtualListName
32
+ });
33
+ module.exports = __toCommonJS(DSVirtualListDefinitions_exports);
34
+ var React = __toESM(require("react"));
35
+ const DSVirtualListName = "DSVirtualList";
36
+ //# sourceMappingURL=DSVirtualListDefinitions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSVirtualListDefinitions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const DSVirtualListName = 'DSVirtualList';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var VirtualList_exports = {};
30
+ __export(VirtualList_exports, {
31
+ DSVirtualList: () => DSVirtualList,
32
+ DSVirtualListWithSchema: () => DSVirtualListWithSchema
33
+ });
34
+ module.exports = __toCommonJS(VirtualList_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
38
+ var import_List = require("./parts/List.js");
39
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
40
+ var import_DSVirtualListDefinitions = require("./DSVirtualListDefinitions.js");
41
+ const DSVirtualList = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_List.List, { ...props });
42
+ DSVirtualList.propTypes = import_react_desc_prop_types.DSVirtualListPropTypes;
43
+ DSVirtualList.displayName = import_DSVirtualListDefinitions.DSVirtualListName;
44
+ const DSVirtualListWithSchema = (0, import_ds_legacy_props_helpers.describe)(DSVirtualList).description("DSVirtualList");
45
+ DSVirtualListWithSchema.propTypes = import_react_desc_prop_types.DSVirtualListPropTypes;
46
+ //# sourceMappingURL=VirtualList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/VirtualList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-legacy-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.propTypes = DSVirtualListPropTypes;\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,qCAAyB;AACzB,kBAAqB;AACrB,mCAA4D;AAC5D,sCAAkC;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,4CAAC,oBAAM,GAAG,OAAO;AAExE,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,8BAA0B,yCAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var VirtualListDataTestID_exports = {};
30
+ __export(VirtualListDataTestID_exports, {
31
+ LIST_DATA_TESTID: () => LIST_DATA_TESTID
32
+ });
33
+ module.exports = __toCommonJS(VirtualListDataTestID_exports);
34
+ var React = __toESM(require("react"));
35
+ const LIST_DATA_TESTID = {
36
+ CONTAINER: "virtual-list-container"
37
+ };
38
+ //# sourceMappingURL=VirtualListDataTestID.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/VirtualListDataTestID.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const LIST_DATA_TESTID = {\n CONTAINER: 'virtual-list-container',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AACb;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
36
+ var import_DSVirtualListDefinitions = require("../DSVirtualListDefinitions.js");
37
+ const useValidateProps = (props, propTypes) => {
38
+ (0, import_ds_legacy_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_DSVirtualListDefinitions.DSVirtualListName);
39
+ };
40
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../DSVirtualListDefinitions.js';\n\nexport const useValidateProps = (props: DSVirtualListT.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSVirtualListName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAA+C;AAG/C,sCAAkC;AAE3B,MAAM,mBAAmB,CAAC,OAAqC,cAAgD;AAEpH,qEAA+B,OAAO,WAAW,iDAAiB;AACpE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useVirtualList_exports = {};
30
+ __export(useVirtualList_exports, {
31
+ useVirtualListV3: () => useVirtualListV3
32
+ });
33
+ module.exports = __toCommonJS(useVirtualList_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_uid = require("uid");
37
+ var import_react_virtual = require("@tanstack/react-virtual");
38
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
39
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
40
+ var import_useValidateProps = require("./useValidateProps.js");
41
+ const estimateSize = () => 50;
42
+ const useVirtualListV3 = (propsFromUser) => {
43
+ const propsWithDefault = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
44
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSVirtualListPropTypes);
45
+ const { children, actionRef } = propsWithDefault;
46
+ const parentRef = import_react.default.useRef(null);
47
+ const filteredChildren = import_react.default.useMemo(
48
+ () => import_react.default.Children.toArray(children).filter((child) => child !== void 0 && child !== null),
49
+ [children]
50
+ );
51
+ const useVirtualHelpers = (0, import_react_virtual.useVirtualizer)({
52
+ count: filteredChildren.length,
53
+ getScrollElement: () => parentRef.current,
54
+ overscan: 15,
55
+ estimateSize
56
+ });
57
+ const totalSize = useVirtualHelpers.getTotalSize();
58
+ import_react.default.useEffect(() => {
59
+ if (actionRef && actionRef.current) {
60
+ actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;
61
+ }
62
+ }, [actionRef, useVirtualHelpers]);
63
+ const instanceUid = import_react.default.useMemo(() => `ds-virtual-list-${(0, import_uid.uid)(6)}`, []);
64
+ return import_react.default.useMemo(
65
+ () => ({
66
+ parentRef,
67
+ getVirtualItems: useVirtualHelpers.getVirtualItems,
68
+ filteredChildren,
69
+ totalSize,
70
+ instanceUid,
71
+ measureElement: useVirtualHelpers.measureElement
72
+ }),
73
+ [useVirtualHelpers.getVirtualItems, useVirtualHelpers.measureElement, filteredChildren, totalSize, instanceUid]
74
+ );
75
+ };
76
+ //# sourceMappingURL=useVirtualList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useVirtualList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { uid } from 'uid';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-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};\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 }),\n [useVirtualHelpers.getVirtualItems, useVirtualHelpers.measureElement, filteredChildren, totalSize, instanceUid],\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,qCAA6C;AAC7C,mCAA0E;AAC1E,8BAAiC;AAEjC,MAAM,eAAe,MAAM;AAoBpB,MAAM,mBAAmB,CAAC,kBAAwD;AAIvF,QAAM,uBAAmB,6DAA2D,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;AAAA,IACjD;AAAA,EACF,GAAG,CAAC,WAAW,iBAAiB,CAAC;AAEjC,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,uBAAmB,gBAAI,CAAC,KAAK,CAAC,CAAC;AACvE,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA,iBAAiB,kBAAkB;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB,kBAAkB;AAAA,IACpC;AAAA,IACA,CAAC,kBAAkB,iBAAiB,kBAAkB,gBAAgB,kBAAkB,WAAW,WAAW;AAAA,EAChH;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ DSVirtualList: () => import_VirtualList.DSVirtualList,
32
+ DSVirtualListWithSchema: () => import_VirtualList.DSVirtualListWithSchema
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
37
+ var import_VirtualList = require("./VirtualList.js");
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
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';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mCAAoC;AACpC,yBAAuD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var List_exports = {};
30
+ __export(List_exports, {
31
+ List: () => List
32
+ });
33
+ module.exports = __toCommonJS(List_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = __toESM(require("react"));
37
+ var import_VirtualListDataTestID = require("../VirtualListDataTestID.js");
38
+ var import_useVirtualList = require("../hooks/useVirtualList.js");
39
+ const List = (props) => {
40
+ const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement } = (0, import_useVirtualList.useVirtualListV3)(props);
41
+ const virtualItems = getVirtualItems();
42
+ const measureRef = import_react.default.useCallback(
43
+ (node) => measureElement(node),
44
+ [measureElement]
45
+ );
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ "div",
48
+ {
49
+ ref: parentRef,
50
+ "data-testid": import_VirtualListDataTestID.LIST_DATA_TESTID.CONTAINER,
51
+ role: "list",
52
+ style: {
53
+ width: "100%",
54
+ height: "100%",
55
+ paddingBottom: 0,
56
+ overflow: "auto"
57
+ },
58
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
+ "div",
60
+ {
61
+ style: {
62
+ width: "100%",
63
+ height: `${totalSize}px`,
64
+ position: "relative"
65
+ },
66
+ children: virtualItems.map((virtualItem) => {
67
+ const { index, start, key } = virtualItem;
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ "div",
70
+ {
71
+ ref: measureRef,
72
+ "data-index": index,
73
+ style: {
74
+ position: "absolute",
75
+ top: 0,
76
+ left: 0,
77
+ width: "100%",
78
+ transform: `translateY(${start}px)`
79
+ },
80
+ role: "listitem",
81
+ children: filteredChildren[index]
82
+ },
83
+ `${instanceUid}-item-${key}`
84
+ );
85
+ })
86
+ }
87
+ )
88
+ },
89
+ instanceUid
90
+ );
91
+ };
92
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/List.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement } =\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 return (\n <div\n key={instanceUid}\n ref={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n style={{\n width: '100%',\n height: '100%',\n paddingBottom: 0,\n overflow: 'auto',\n }}\n >\n <div\n style={{\n width: '100%',\n height: `${totalSize}px`,\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <div\n ref={measureRef}\n data-index={index}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start}px)`,\n }}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n >\n {filteredChildren[index]}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCX;AArCZ,mBAAkB;AAClB,mCAAiC;AACjC,4BAAiC;AAG1B,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,eAAe,QAC3F,wCAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8C,aAAAA,QAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,KAAK;AAAA,MACL,eAAa,8CAAiB;AAAA,MAC9B,MAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,OAAO;AAAA,YACP,QAAQ,GAAG;AAAA,YACX,UAAU;AAAA,UACZ;AAAA,UAEC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,kBAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,KAAK;AAAA,gBACL,cAAY;AAAA,gBACZ,OAAO;AAAA,kBACL,UAAU;AAAA,kBACV,KAAK;AAAA,kBACL,MAAM;AAAA,kBACN,OAAO;AAAA,kBACP,WAAW,cAAc;AAAA,gBAC3B;AAAA,gBACA,MAAK;AAAA,gBAGJ,2BAAiB,KAAK;AAAA;AAAA,cAFlB,GAAG,oBAAoB;AAAA,YAG9B;AAAA,UAEJ,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,IAtCK;AAAA,EAuCP;AAEJ;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var props_exports = {};
30
+ __export(props_exports, {
31
+ DSVirtualListSchema: () => DSVirtualListSchema,
32
+ defaultProps: () => defaultProps
33
+ });
34
+ module.exports = __toCommonJS(props_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_lodash = require("lodash");
37
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
38
+ const actionRef = {
39
+ scrollTo: import_ds_legacy_props_helpers.PropTypes.func.description("Scroll to a index inside the list")
40
+ };
41
+ const DSVirtualListSchema = {
42
+ children: import_ds_legacy_props_helpers.PropTypes.arrayOf(import_ds_legacy_props_helpers.PropTypes.node).description("Children list").defaultValue([]),
43
+ actionRef: import_ds_legacy_props_helpers.PropTypes.shape({
44
+ current: import_ds_legacy_props_helpers.PropTypes.shape(actionRef)
45
+ }).description(`Action reference
46
+
47
+ scrollTo: Function(index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void
48
+ `)
49
+ };
50
+ const defaultProps = {
51
+ children: [],
52
+ actionRef: {
53
+ current: {
54
+ scrollTo: import_lodash.noop
55
+ }
56
+ }
57
+ };
58
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { noop } from 'lodash';\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAqB;AACrB,qCAA0B;AAE1B,MAAM,YAAY;AAAA,EAChB,UAAU,yCAAU,KAAK,YAAY,mCAAmC;AAC1E;AACO,MAAM,sBAAsB;AAAA,EACjC,UAAU,yCAAU,QAAQ,yCAAU,IAAI,EAAE,YAAY,eAAe,EAAE,aAAa,CAAC,CAAC;AAAA,EACxF,WAAW,yCAAU,MAAM;AAAA,IACzB,SAAS,yCAAU,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
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSVirtualListPropTypes: () => DSVirtualListPropTypes,
32
+ defaultProps: () => defaultProps
33
+ });
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
37
+ const defaultProps = {};
38
+ const DSVirtualListPropTypes = {
39
+ children: import_ds_legacy_props_helpers.PropTypes.arrayOf(import_ds_legacy_props_helpers.PropTypes.node).description("Children list").isRequired,
40
+ actionRef: import_ds_legacy_props_helpers.PropTypes.shape({
41
+ current: import_ds_legacy_props_helpers.PropTypes.oneOfType([
42
+ import_ds_legacy_props_helpers.PropTypes.oneOf([null]),
43
+ import_ds_legacy_props_helpers.PropTypes.shape({
44
+ scrollTo: import_ds_legacy_props_helpers.PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`)
45
+ })
46
+ ])
47
+ }).description(`mutable reference where methods will be stored`)
48
+ };
49
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\n\nexport declare namespace DSVirtualListT {\n type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';\n type ScrollToOptions = {\n align: ScrollAlignment;\n };\n\n export type ActionRef = {\n scrollTo?: (index: number, options?: ScrollToOptions | undefined) => void;\n };\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n actionRef: React.MutableRefObject<ActionRef>;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const defaultProps: DSVirtualListT.DefaultProps = {};\n\nexport const DSVirtualListPropTypes = {\n children: PropTypes.arrayOf(PropTypes.node).description('Children list').isRequired,\n actionRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n scrollTo: PropTypes.func\n .description('Scroll to a index inside the list')\n .signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`),\n }),\n ]),\n }).description(`mutable reference where methods will be stored`),\n} as React.WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,qCAA0B;AA0BnB,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,UAAU,yCAAU,QAAQ,yCAAU,IAAI,EAAE,YAAY,eAAe,EAAE;AAAA,EACzE,WAAW,yCAAU,MAAM;AAAA,IACzB,SAAS,yCAAU,UAAU;AAAA,MAC3B,yCAAU,MAAM,CAAC,IAAI,CAAC;AAAA,MACtB,yCAAU,MAAM;AAAA,QACd,UAAU,yCAAU,KACjB,YAAY,mCAAmC,EAC/C,UAAU,2EAA2E;AAAA,MAC1F,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,EAAE,YAAY,gDAAgD;AACjE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const DSVirtualListName = "DSVirtualList";
3
+ export {
4
+ DSVirtualListName
5
+ };
6
+ //# sourceMappingURL=DSVirtualListDefinitions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSVirtualListDefinitions.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSVirtualListName = 'DSVirtualList';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,oBAAoB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { describe } from "@elliemae/ds-legacy-props-helpers";
4
+ import { List } from "./parts/List.js";
5
+ import { DSVirtualListPropTypes } from "./react-desc-prop-types.js";
6
+ import { DSVirtualListName } from "./DSVirtualListDefinitions.js";
7
+ const DSVirtualList = (props) => /* @__PURE__ */ jsx(List, { ...props });
8
+ DSVirtualList.propTypes = DSVirtualListPropTypes;
9
+ DSVirtualList.displayName = DSVirtualListName;
10
+ const DSVirtualListWithSchema = describe(DSVirtualList).description("DSVirtualList");
11
+ DSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;
12
+ export {
13
+ DSVirtualList,
14
+ DSVirtualListWithSchema
15
+ };
16
+ //# sourceMappingURL=VirtualList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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-legacy-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.propTypes = DSVirtualListPropTypes;\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,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ const LIST_DATA_TESTID = {
3
+ CONTAINER: "virtual-list-container"
4
+ };
5
+ export {
6
+ LIST_DATA_TESTID
7
+ };
8
+ //# sourceMappingURL=VirtualListDataTestID.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/VirtualListDataTestID.tsx"],
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,YAAY,WAAW;ACAhB,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AACb;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-legacy-props-helpers";
3
+ import { DSVirtualListName } from "../DSVirtualListDefinitions.js";
4
+ const useValidateProps = (props, propTypes) => {
5
+ useValidateTypescriptPropTypes(props, propTypes, DSVirtualListName);
6
+ };
7
+ export {
8
+ useValidateProps
9
+ };
10
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../DSVirtualListDefinitions.js';\n\nexport const useValidateProps = (props: DSVirtualListT.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSVirtualListName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,yBAAyB;AAE3B,MAAM,mBAAmB,CAAC,OAAqC,cAAgD;AAEpH,iCAA+B,OAAO,WAAW,iBAAiB;AACpE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { uid } from "uid";
4
+ import { useVirtualizer } from "@tanstack/react-virtual";
5
+ import { useMemoMergePropsWithDefault } from "@elliemae/ds-legacy-props-helpers";
6
+ import { DSVirtualListPropTypes, defaultProps } from "../react-desc-prop-types.js";
7
+ import { useValidateProps } from "./useValidateProps.js";
8
+ const estimateSize = () => 50;
9
+ const useVirtualListV3 = (propsFromUser) => {
10
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
11
+ useValidateProps(propsWithDefault, DSVirtualListPropTypes);
12
+ const { children, actionRef } = propsWithDefault;
13
+ const parentRef = React2.useRef(null);
14
+ const filteredChildren = React2.useMemo(
15
+ () => React2.Children.toArray(children).filter((child) => child !== void 0 && child !== null),
16
+ [children]
17
+ );
18
+ const useVirtualHelpers = useVirtualizer({
19
+ count: filteredChildren.length,
20
+ getScrollElement: () => parentRef.current,
21
+ overscan: 15,
22
+ estimateSize
23
+ });
24
+ const totalSize = useVirtualHelpers.getTotalSize();
25
+ React2.useEffect(() => {
26
+ if (actionRef && actionRef.current) {
27
+ actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;
28
+ }
29
+ }, [actionRef, useVirtualHelpers]);
30
+ const instanceUid = React2.useMemo(() => `ds-virtual-list-${uid(6)}`, []);
31
+ return React2.useMemo(
32
+ () => ({
33
+ parentRef,
34
+ getVirtualItems: useVirtualHelpers.getVirtualItems,
35
+ filteredChildren,
36
+ totalSize,
37
+ instanceUid,
38
+ measureElement: useVirtualHelpers.measureElement
39
+ }),
40
+ [useVirtualHelpers.getVirtualItems, useVirtualHelpers.measureElement, filteredChildren, totalSize, instanceUid]
41
+ );
42
+ };
43
+ export {
44
+ useVirtualListV3
45
+ };
46
+ //# sourceMappingURL=useVirtualList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useVirtualList.tsx"],
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-legacy-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};\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 }),\n [useVirtualHelpers.getVirtualItems, useVirtualHelpers.measureElement, filteredChildren, totalSize, instanceUid],\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;AAoBpB,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,gBAAU,QAAQ,WAAW,kBAAkB;AAAA,IACjD;AAAA,EACF,GAAG,CAAC,WAAW,iBAAiB,CAAC;AAEjC,QAAM,cAAcA,OAAM,QAAQ,MAAM,mBAAmB,IAAI,CAAC,KAAK,CAAC,CAAC;AACvE,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA,iBAAiB,kBAAkB;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB,kBAAkB;AAAA,IACpC;AAAA,IACA,CAAC,kBAAkB,iBAAiB,kBAAkB,gBAAgB,kBAAkB,WAAW,WAAW;AAAA,EAChH;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import {} from "./react-desc-prop-types.js";
3
+ import { DSVirtualList, DSVirtualListWithSchema } from "./VirtualList.js";
4
+ export {
5
+ DSVirtualList,
6
+ DSVirtualListWithSchema
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
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';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,eAAoC;AACpC,SAAS,eAAe,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,62 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import React2 from "react";
4
+ import { LIST_DATA_TESTID } from "../VirtualListDataTestID.js";
5
+ import { useVirtualListV3 } from "../hooks/useVirtualList.js";
6
+ const List = (props) => {
7
+ const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement } = useVirtualListV3(props);
8
+ const virtualItems = getVirtualItems();
9
+ const measureRef = React2.useCallback(
10
+ (node) => measureElement(node),
11
+ [measureElement]
12
+ );
13
+ return /* @__PURE__ */ jsx(
14
+ "div",
15
+ {
16
+ ref: parentRef,
17
+ "data-testid": LIST_DATA_TESTID.CONTAINER,
18
+ role: "list",
19
+ style: {
20
+ width: "100%",
21
+ height: "100%",
22
+ paddingBottom: 0,
23
+ overflow: "auto"
24
+ },
25
+ children: /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ style: {
29
+ width: "100%",
30
+ height: `${totalSize}px`,
31
+ position: "relative"
32
+ },
33
+ children: virtualItems.map((virtualItem) => {
34
+ const { index, start, key } = virtualItem;
35
+ return /* @__PURE__ */ jsx(
36
+ "div",
37
+ {
38
+ ref: measureRef,
39
+ "data-index": index,
40
+ style: {
41
+ position: "absolute",
42
+ top: 0,
43
+ left: 0,
44
+ width: "100%",
45
+ transform: `translateY(${start}px)`
46
+ },
47
+ role: "listitem",
48
+ children: filteredChildren[index]
49
+ },
50
+ `${instanceUid}-item-${key}`
51
+ );
52
+ })
53
+ }
54
+ )
55
+ },
56
+ instanceUid
57
+ );
58
+ };
59
+ export {
60
+ List
61
+ };
62
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { LIST_DATA_TESTID } from '../VirtualListDataTestID.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement } =\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 return (\n <div\n key={instanceUid}\n ref={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n style={{\n width: '100%',\n height: '100%',\n paddingBottom: 0,\n overflow: 'auto',\n }}\n >\n <div\n style={{\n width: '100%',\n height: `${totalSize}px`,\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <div\n ref={measureRef}\n data-index={index}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start}px)`,\n }}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n >\n {filteredChildren[index]}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqCX;AArCZ,OAAOA,YAAW;AAClB,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAG1B,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,eAAe,IAC3F,iBAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8CA,OAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,KAAK;AAAA,MACL,eAAa,iBAAiB;AAAA,MAC9B,MAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,OAAO;AAAA,YACP,QAAQ,GAAG;AAAA,YACX,UAAU;AAAA,UACZ;AAAA,UAEC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,kBAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,KAAK;AAAA,gBACL,cAAY;AAAA,gBACZ,OAAO;AAAA,kBACL,UAAU;AAAA,kBACV,KAAK;AAAA,kBACL,MAAM;AAAA,kBACN,OAAO;AAAA,kBACP,WAAW,cAAc;AAAA,gBAC3B;AAAA,gBACA,MAAK;AAAA,gBAGJ,2BAAiB,KAAK;AAAA;AAAA,cAFlB,GAAG,oBAAoB;AAAA,YAG9B;AAAA,UAEJ,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,IAtCK;AAAA,EAuCP;AAEJ;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { noop } from "lodash";
3
+ import { PropTypes } from "@elliemae/ds-legacy-props-helpers";
4
+ const actionRef = {
5
+ scrollTo: PropTypes.func.description("Scroll to a index inside the list")
6
+ };
7
+ const DSVirtualListSchema = {
8
+ children: PropTypes.arrayOf(PropTypes.node).description("Children list").defaultValue([]),
9
+ actionRef: PropTypes.shape({
10
+ current: PropTypes.shape(actionRef)
11
+ }).description(`Action reference
12
+
13
+ scrollTo: Function(index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void
14
+ `)
15
+ };
16
+ const defaultProps = {
17
+ children: [],
18
+ actionRef: {
19
+ current: {
20
+ scrollTo: noop
21
+ }
22
+ }
23
+ };
24
+ export {
25
+ DSVirtualListSchema,
26
+ defaultProps
27
+ };
28
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { noop } from 'lodash';\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\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,YAAY,WAAW;ACAvB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,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
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { PropTypes } from "@elliemae/ds-legacy-props-helpers";
3
+ const defaultProps = {};
4
+ const DSVirtualListPropTypes = {
5
+ children: PropTypes.arrayOf(PropTypes.node).description("Children list").isRequired,
6
+ actionRef: PropTypes.shape({
7
+ current: PropTypes.oneOfType([
8
+ PropTypes.oneOf([null]),
9
+ PropTypes.shape({
10
+ scrollTo: PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`)
11
+ })
12
+ ])
13
+ }).description(`mutable reference where methods will be stored`)
14
+ };
15
+ export {
16
+ DSVirtualListPropTypes,
17
+ defaultProps
18
+ };
19
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\n\nexport declare namespace DSVirtualListT {\n type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';\n type ScrollToOptions = {\n align: ScrollAlignment;\n };\n\n export type ActionRef = {\n scrollTo?: (index: number, options?: ScrollToOptions | undefined) => void;\n };\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n actionRef: React.MutableRefObject<ActionRef>;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const defaultProps: DSVirtualListT.DefaultProps = {};\n\nexport const DSVirtualListPropTypes = {\n children: PropTypes.arrayOf(PropTypes.node).description('Children list').isRequired,\n actionRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null]),\n PropTypes.shape({\n scrollTo: PropTypes.func\n .description('Scroll to a index inside the list')\n .signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`),\n }),\n ]),\n }).description(`mutable reference where methods will be stored`),\n} as React.WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,iBAAiB;AA0BnB,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,UAAU,UAAU,QAAQ,UAAU,IAAI,EAAE,YAAY,eAAe,EAAE;AAAA,EACzE,WAAW,UAAU,MAAM;AAAA,IACzB,SAAS,UAAU,UAAU;AAAA,MAC3B,UAAU,MAAM,CAAC,IAAI,CAAC;AAAA,MACtB,UAAU,MAAM;AAAA,QACd,UAAU,UAAU,KACjB,YAAY,mCAAmC,EAC/C,UAAU,2EAA2E;AAAA,MAC1F,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,EAAE,YAAY,gDAAgD;AACjE;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export declare const DSVirtualListName = "DSVirtualList";
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type DSVirtualListT } from './react-desc-prop-types.js';
3
+ declare const DSVirtualList: {
4
+ (props: DSVirtualListT.Props): import("react/jsx-runtime.js").JSX.Element;
5
+ propTypes: React.WeakValidationMap<unknown>;
6
+ displayName: string;
7
+ };
8
+ declare const DSVirtualListWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSVirtualListT.Props>;
9
+ export { DSVirtualList, DSVirtualListWithSchema };
@@ -0,0 +1,3 @@
1
+ export declare const LIST_DATA_TESTID: {
2
+ CONTAINER: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import { type DSVirtualListT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSVirtualListT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { type DSVirtualListT } from '../react-desc-prop-types.js';
3
+ interface VirtualItem {
4
+ key: string | number;
5
+ index: number;
6
+ start: number;
7
+ end: number;
8
+ size: number;
9
+ }
10
+ type MeasureElement = ((element: HTMLElement) => number) | ((node: Element | null) => void);
11
+ export type VirtualListCTX = {
12
+ parentRef: React.MutableRefObject<HTMLDivElement | null>;
13
+ getVirtualItems: () => VirtualItem[];
14
+ filteredChildren: React.ReactNode[];
15
+ totalSize: number;
16
+ instanceUid: string;
17
+ measureElement: MeasureElement;
18
+ };
19
+ export declare const useVirtualListV3: (propsFromUser: DSVirtualListT.Props) => VirtualListCTX;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ export { type DSVirtualListT } from './react-desc-prop-types.js';
2
+ export { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';
@@ -0,0 +1,2 @@
1
+ import type { DSVirtualListT } from '../react-desc-prop-types.js';
2
+ export declare const List: (props: DSVirtualListT.Props) => import("react/jsx-runtime.js").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export declare const DSVirtualListSchema: {
2
+ children: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
3
+ actionRef: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
4
+ };
5
+ export declare const defaultProps: {
6
+ children: never[];
7
+ actionRef: {
8
+ current: {
9
+ scrollTo: (...args: any[]) => void;
10
+ };
11
+ };
12
+ };
@@ -0,0 +1,24 @@
1
+ import type React from 'react';
2
+ export declare namespace DSVirtualListT {
3
+ type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';
4
+ type ScrollToOptions = {
5
+ align: ScrollAlignment;
6
+ };
7
+ type ActionRef = {
8
+ scrollTo?: (index: number, options?: ScrollToOptions | undefined) => void;
9
+ };
10
+ interface RequiredProps {
11
+ children: React.ReactNode;
12
+ }
13
+ interface DefaultProps {
14
+ }
15
+ interface OptionalProps {
16
+ actionRef: React.MutableRefObject<ActionRef>;
17
+ }
18
+ interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
19
+ }
20
+ interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
21
+ }
22
+ }
23
+ export declare const defaultProps: DSVirtualListT.DefaultProps;
24
+ export declare const DSVirtualListPropTypes: React.WeakValidationMap<unknown>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@elliemae/ds-legacy-virtual-list",
3
+ "version": "1.0.0-rc.1",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Virtual List",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
16
+ },
17
+ "./VirtualListDataTestID": {
18
+ "import": "./dist/esm/VirtualListDataTestID.js",
19
+ "require": "./dist/cjs/VirtualListDataTestID.js"
20
+ },
21
+ "./VirtualList": {
22
+ "import": "./dist/esm/VirtualList.js",
23
+ "require": "./dist/cjs/VirtualList.js"
24
+ },
25
+ "./styled": {
26
+ "import": "./dist/esm/styled.js",
27
+ "require": "./dist/cjs/styled.js"
28
+ },
29
+ "./props": {
30
+ "import": "./dist/esm/props.js",
31
+ "require": "./dist/cjs/props.js"
32
+ },
33
+ "./parts/List": {
34
+ "import": "./dist/esm/parts/List.js",
35
+ "require": "./dist/cjs/parts/List.js"
36
+ },
37
+ "./hooks/useVirtualList": {
38
+ "import": "./dist/esm/hooks/useVirtualList.js",
39
+ "require": "./dist/cjs/hooks/useVirtualList.js"
40
+ }
41
+ },
42
+ "sideEffects": [
43
+ "*.css",
44
+ "*.scss"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
49
+ },
50
+ "engines": {
51
+ "pnpm": ">=6",
52
+ "node": ">=16"
53
+ },
54
+ "author": "ICE MT",
55
+ "jestSonar": {
56
+ "sonar56x": true,
57
+ "reportPath": "reports",
58
+ "reportFile": "tests.xml",
59
+ "indent": 4
60
+ },
61
+ "dependencies": {
62
+ "@tanstack/react-virtual": "3.0.0-beta.54",
63
+ "@xstyled/system": "3.7.0",
64
+ "axe-core": "^4.6.3",
65
+ "uid": "^2.0.1",
66
+ "@elliemae/ds-legacy-props-helpers": "1.0.0-rc.1",
67
+ "@elliemae/ds-legacy-system": "1.0.0-rc.1"
68
+ },
69
+ "devDependencies": {
70
+ "@elliemae/pui-cli": "~9.0.0-next.31",
71
+ "styled-components": "~5.3.9",
72
+ "@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1",
73
+ "@elliemae/ds-legacy-test-utils": "1.0.0-rc.1"
74
+ },
75
+ "peerDependencies": {
76
+ "lodash": "^4.17.21",
77
+ "react": "~17.0.2",
78
+ "react-dom": "^17.0.2",
79
+ "styled-components": "~5.3.9"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public",
83
+ "typeSafety": false
84
+ },
85
+ "scripts": {
86
+ "test": "pui-cli test --passWithNoTests",
87
+ "lint": "node ../../../scripts/lint.mjs",
88
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
89
+ "dts": "node ../../../scripts/dts.mjs",
90
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
91
+ "dev:build": "pnpm --filter {.}... build",
92
+ "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
93
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\"",
94
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch"
95
+ }
96
+ }