@elliemae/ds-virtual-list 3.80.0-next.2 → 3.80.0-next.20
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 +2 -2
- package/dist/cjs/VirtualList.js.map +2 -2
- package/dist/cjs/{DSVirtualListDefinitions.js → constants/index.js} +12 -4
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/hooks/useValidateProps.js +2 -2
- package/dist/cjs/hooks/useValidateProps.js.map +2 -2
- package/dist/cjs/hooks/useVirtualList.js +12 -1
- package/dist/cjs/hooks/useVirtualList.js.map +2 -2
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/List.js +4 -2
- package/dist/cjs/parts/List.js.map +2 -2
- package/dist/cjs/parts/styled.js +4 -4
- package/dist/cjs/parts/styled.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +9 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/{VirtualListDataTestID.js → typescript-testing/slot-props.js} +11 -13
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-virtual-list-valid.js +114 -0
- package/dist/cjs/typescript-testing/typescript-virtual-list-valid.js.map +7 -0
- package/dist/esm/VirtualList.js +1 -1
- package/dist/esm/VirtualList.js.map +1 -1
- package/dist/esm/constants/index.js +20 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/hooks/useValidateProps.js +1 -1
- package/dist/esm/hooks/useValidateProps.js.map +1 -1
- package/dist/esm/hooks/useVirtualList.js +12 -1
- package/dist/esm/hooks/useVirtualList.js.map +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/List.js +5 -3
- package/dist/esm/parts/List.js.map +2 -2
- package/dist/esm/parts/styled.js +1 -1
- package/dist/esm/parts/styled.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +9 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +13 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-virtual-list-valid.js +84 -0
- package/dist/esm/typescript-testing/typescript-virtual-list-valid.js.map +7 -0
- package/dist/types/constants/index.d.ts +11 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +13 -4
- package/package.json +10 -9
- package/dist/cjs/DSVirtualListDefinitions.js.map +0 -7
- package/dist/cjs/VirtualListDataTestID.js.map +0 -7
- package/dist/cjs/props.js +0 -58
- package/dist/cjs/props.js.map +0 -7
- package/dist/esm/DSVirtualListDefinitions.js +0 -12
- package/dist/esm/DSVirtualListDefinitions.js.map +0 -7
- package/dist/esm/VirtualListDataTestID.js +0 -8
- package/dist/esm/VirtualListDataTestID.js.map +0 -7
- package/dist/esm/props.js +0 -28
- package/dist/esm/props.js.map +0 -7
- package/dist/types/DSVirtualListDefinitions.d.ts +0 -6
- package/dist/types/VirtualListDataTestID.d.ts +0 -3
- package/dist/types/props.d.ts +0 -12
package/dist/cjs/VirtualList.js
CHANGED
|
@@ -37,9 +37,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_List = require("./parts/List.js");
|
|
39
39
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
-
var
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
41
|
const DSVirtualList = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_List.List, { ...props });
|
|
42
|
-
DSVirtualList.displayName =
|
|
42
|
+
DSVirtualList.displayName = import_constants.DSVirtualListName;
|
|
43
43
|
const DSVirtualListWithSchema = (0, import_ds_props_helpers.describe)(DSVirtualList).description("DSVirtualList");
|
|
44
44
|
DSVirtualListWithSchema.propTypes = import_react_desc_prop_types.DSVirtualListPropTypes;
|
|
45
45
|
//# 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 { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADOgC;AANvD,8BAAyB;AACzB,kBAAqB;AACrB,mCAA4D;AAC5D,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './constants/index.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.displayName = DSVirtualListName;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADOgC;AANvD,8BAAyB;AACzB,kBAAqB;AACrB,mCAA4D;AAC5D,uBAAkC;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,4CAAC,oBAAM,GAAG,OAAO;AAExE,cAAc,cAAc;AAC5B,MAAM,8BAA0B,kCAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,17 +26,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DSVirtualListDataTestIds: () => DSVirtualListDataTestIds,
|
|
31
32
|
DSVirtualListName: () => DSVirtualListName,
|
|
32
33
|
DSVirtualListSlots: () => DSVirtualListSlots
|
|
33
34
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
35
36
|
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
38
|
const DSVirtualListName = "DSVirtuallist";
|
|
37
39
|
const DSVirtualListSlots = {
|
|
38
40
|
ROOT: "root",
|
|
41
|
+
// legacy — data-testid preserved below, do not let slot auto-generation replace it
|
|
39
42
|
LIST_WRAPPER: "list-wrapper",
|
|
40
43
|
ITEM_WRAPPER: "item-wrapper"
|
|
41
44
|
};
|
|
42
|
-
|
|
45
|
+
const DSVirtualListDataTestIds = {
|
|
46
|
+
...(0, import_ds_system.slotObjectToDataTestIds)(DSVirtualListName, DSVirtualListSlots),
|
|
47
|
+
ROOT: "virtual-list-container"
|
|
48
|
+
// legacy value — e2e/ds-virtuallist/DSVirtualListCO.js depends on it, breaking change if removed
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSVirtualListName = 'DSVirtuallist';\n\nexport const DSVirtualListSlots = {\n ROOT: 'root', // legacy \u2014 data-testid preserved below, do not let slot auto-generation replace it\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n} as const;\n\nexport const DSVirtualListDataTestIds = {\n ...slotObjectToDataTestIds(DSVirtualListName, DSVirtualListSlots),\n ROOT: 'virtual-list-container', // legacy value \u2014 e2e/ds-virtuallist/DSVirtualListCO.js depends on it, breaking change if removed\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA;AAAA,EACN,cAAc;AAAA,EACd,cAAc;AAChB;AAEO,MAAM,2BAA2B;AAAA,EACtC,OAAG,0CAAwB,mBAAmB,kBAAkB;AAAA,EAChE,MAAM;AAAA;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -33,8 +33,8 @@ __export(useValidateProps_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
-
var
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
37
|
const useValidateProps = (props, propTypes) => {
|
|
38
|
-
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes,
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSVirtualListName);
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../constants/index.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,8BAA+C;AAG/C,uBAAkC;AAE3B,MAAM,mBAAmB,CAAC,OAAqC,cAAgD;AAEpH,8DAA+B,OAAO,WAAW,kCAAiB;AACpE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -55,7 +55,18 @@ const useVirtualListV3 = (propsFromUser) => {
|
|
|
55
55
|
estimateSize
|
|
56
56
|
});
|
|
57
57
|
const totalSize = useVirtualHelpers.getTotalSize();
|
|
58
|
-
if (actionRef && actionRef.current)
|
|
58
|
+
if (actionRef && actionRef.current) {
|
|
59
|
+
actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;
|
|
60
|
+
actionRef.current.measure = useVirtualHelpers.measure;
|
|
61
|
+
actionRef.current.getVisibleItems = () => {
|
|
62
|
+
const range = useVirtualHelpers.calculateRange();
|
|
63
|
+
if (!range) return [];
|
|
64
|
+
const indices = [];
|
|
65
|
+
for (let index = range.startIndex; index <= range.endIndex; index += 1) indices.push(index);
|
|
66
|
+
return indices;
|
|
67
|
+
};
|
|
68
|
+
actionRef.current.getMountedItems = () => useVirtualHelpers.getVirtualItems().map((item) => item.index);
|
|
69
|
+
}
|
|
59
70
|
const instanceUid = import_react.default.useMemo(() => `ds-virtual-list-${(0, import_uid.uid)(6)}`, []);
|
|
60
71
|
return import_react.default.useMemo(
|
|
61
72
|
() => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useVirtualList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useVirtualizer, type Virtualizer } from '@tanstack/react-virtual';\nimport React from 'react';\nimport { uid } from 'uid';\nimport { DSVirtualListPropTypes, defaultProps, type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nconst estimateSize = () => 50;\n\nexport type VirtualListCTX = {\n instanceUid: string;\n filteredChildren: React.ReactNode[];\n propsWithDefault: DSVirtualListT.InternalProps;\n parentRef: React.MutableRefObject<HTMLDivElement | null>;\n getVirtualItems: Virtualizer<HTMLDivElement, HTMLElement>['getVirtualItems'];\n totalSize: ReturnType<Virtualizer<HTMLDivElement, HTMLElement>['getTotalSize']>;\n measureElement: Virtualizer<HTMLDivElement, HTMLElement>['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 if (actionRef && actionRef.current) actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n\n const instanceUid = React.useMemo(() => `ds-virtual-list-${uid(6)}`, []);\n return React.useMemo(\n () => ({\n instanceUid,\n filteredChildren,\n propsWithDefault,\n parentRef,\n getVirtualItems: useVirtualHelpers.getVirtualItems,\n totalSize,\n measureElement: useVirtualHelpers.measureElement,\n }),\n [\n useVirtualHelpers.getVirtualItems,\n useVirtualHelpers.measureElement,\n filteredChildren,\n totalSize,\n instanceUid,\n propsWithDefault,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAC7C,2BAAiD;AACjD,mBAAkB;AAClB,iBAAoB;AACpB,mCAA0E;AAC1E,8BAAiC;AAEjC,MAAM,eAAe,MAAM;AAWpB,MAAM,mBAAmB,CAAC,kBAAwD;AAIvF,QAAM,uBAAmB,sDAA2D,eAAe,yCAAY;AAC/G,gDAAiB,kBAAkB,mDAAsB;AAIzD,QAAM,EAAE,UAAU,UAAU,IAAI;AAChC,QAAM,YAAY,aAAAA,QAAM,OAAuB,IAAI;AACnD,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,MAAM,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,IAAI;AAAA,IAC9F,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,wBAAoB,qCAAe;AAAA,IACvC,OAAO,iBAAiB;AAAA,IACxB,kBAAkB,MAAM,UAAU;AAAA,IAClC,UAAU;AAAA,IACV;AAAA,EACF,CAAC;AACD,QAAM,YAAY,kBAAkB,aAAa;AACjD,MAAI,aAAa,UAAU,
|
|
4
|
+
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { useVirtualizer, type Virtualizer } from '@tanstack/react-virtual';\nimport React from 'react';\nimport { uid } from 'uid';\nimport { DSVirtualListPropTypes, defaultProps, type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nconst estimateSize = () => 50;\n\nexport type VirtualListCTX = {\n instanceUid: string;\n filteredChildren: React.ReactNode[];\n propsWithDefault: DSVirtualListT.InternalProps;\n parentRef: React.MutableRefObject<HTMLDivElement | null>;\n getVirtualItems: Virtualizer<HTMLDivElement, HTMLElement>['getVirtualItems'];\n totalSize: ReturnType<Virtualizer<HTMLDivElement, HTMLElement>['getTotalSize']>;\n measureElement: Virtualizer<HTMLDivElement, HTMLElement>['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 if (actionRef && actionRef.current) {\n actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;\n actionRef.current.measure = useVirtualHelpers.measure;\n // `getVirtualItems()` includes the overscan buffer on each side \u2014 not what \"visible\" means.\n // `calculateRange()` is the virtualizer's own pre-overscan viewport calculation (pure scroll\n // geometry, no DOM scraping) and is what \"currently visible\" should actually be backed by.\n actionRef.current.getVisibleItems = () => {\n const range = useVirtualHelpers.calculateRange();\n if (!range) return [];\n const indices: number[] = [];\n for (let index = range.startIndex; index <= range.endIndex; index += 1) indices.push(index);\n return indices;\n };\n // The overscanned set (viewport + the 15-item buffer on each side) \u2014 everything currently\n // mounted in the DOM, as opposed to `getVisibleItems()`'s true-viewport-only set above.\n actionRef.current.getMountedItems = () => useVirtualHelpers.getVirtualItems().map((item) => item.index);\n }\n\n const instanceUid = React.useMemo(() => `ds-virtual-list-${uid(6)}`, []);\n return React.useMemo(\n () => ({\n instanceUid,\n filteredChildren,\n propsWithDefault,\n parentRef,\n getVirtualItems: useVirtualHelpers.getVirtualItems,\n totalSize,\n measureElement: useVirtualHelpers.measureElement,\n }),\n [\n useVirtualHelpers.getVirtualItems,\n useVirtualHelpers.measureElement,\n filteredChildren,\n totalSize,\n instanceUid,\n propsWithDefault,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAC7C,2BAAiD;AACjD,mBAAkB;AAClB,iBAAoB;AACpB,mCAA0E;AAC1E,8BAAiC;AAEjC,MAAM,eAAe,MAAM;AAWpB,MAAM,mBAAmB,CAAC,kBAAwD;AAIvF,QAAM,uBAAmB,sDAA2D,eAAe,yCAAY;AAC/G,gDAAiB,kBAAkB,mDAAsB;AAIzD,QAAM,EAAE,UAAU,UAAU,IAAI;AAChC,QAAM,YAAY,aAAAA,QAAM,OAAuB,IAAI;AACnD,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,MAAM,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,IAAI;AAAA,IAC9F,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,wBAAoB,qCAAe;AAAA,IACvC,OAAO,iBAAiB;AAAA,IACxB,kBAAkB,MAAM,UAAU;AAAA,IAClC,UAAU;AAAA,IACV;AAAA,EACF,CAAC;AACD,QAAM,YAAY,kBAAkB,aAAa;AACjD,MAAI,aAAa,UAAU,SAAS;AAClC,cAAU,QAAQ,WAAW,kBAAkB;AAC/C,cAAU,QAAQ,UAAU,kBAAkB;AAI9C,cAAU,QAAQ,kBAAkB,MAAM;AACxC,YAAM,QAAQ,kBAAkB,eAAe;AAC/C,UAAI,CAAC,MAAO,QAAO,CAAC;AACpB,YAAM,UAAoB,CAAC;AAC3B,eAAS,QAAQ,MAAM,YAAY,SAAS,MAAM,UAAU,SAAS,EAAG,SAAQ,KAAK,KAAK;AAC1F,aAAO;AAAA,IACT;AAGA,cAAU,QAAQ,kBAAkB,MAAM,kBAAkB,gBAAgB,EAAE,IAAI,CAAC,SAAS,KAAK,KAAK;AAAA,EACxG;AAEA,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,uBAAmB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACvE,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB,kBAAkB;AAAA,MACnC;AAAA,MACA,gBAAgB,kBAAkB;AAAA,IACpC;AAAA,IACA;AAAA,MACE,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,12 +29,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var index_exports = {};
|
|
30
30
|
__export(index_exports, {
|
|
31
31
|
DSVirtualList: () => import_VirtualList.DSVirtualList,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
DSVirtualListDataTestIds: () => import_constants.DSVirtualListDataTestIds,
|
|
33
|
+
DSVirtualListName: () => import_constants.DSVirtualListName,
|
|
34
|
+
DSVirtualListSlots: () => import_constants.DSVirtualListSlots,
|
|
34
35
|
DSVirtualListWithSchema: () => import_VirtualList.DSVirtualListWithSchema
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(index_exports);
|
|
37
38
|
var React = __toESM(require("react"));
|
|
38
39
|
var import_VirtualList = require("./VirtualList.js");
|
|
39
|
-
var
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
40
41
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,yBAAuD;AACvD,
|
|
4
|
+
"sourcesContent": ["export { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots, DSVirtualListDataTestIds } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,yBAAuD;AACvD,uBAAgF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/parts/List.js
CHANGED
|
@@ -35,7 +35,7 @@ var React = __toESM(require("react"));
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
-
var
|
|
38
|
+
var import_constants = require("../constants/index.js");
|
|
39
39
|
var import_useVirtualList = require("../hooks/useVirtualList.js");
|
|
40
40
|
var import_styled = require("./styled.js");
|
|
41
41
|
const List = (props) => {
|
|
@@ -46,13 +46,15 @@ const List = (props) => {
|
|
|
46
46
|
[measureElement]
|
|
47
47
|
);
|
|
48
48
|
const ownerPropsConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
49
|
+
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
|
|
49
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
51
|
import_styled.StyledWrapper,
|
|
51
52
|
{
|
|
52
53
|
innerRef: parentRef,
|
|
53
|
-
"data-testid":
|
|
54
|
+
"data-testid": import_constants.DSVirtualListDataTestIds.ROOT,
|
|
54
55
|
role: "list",
|
|
55
56
|
...ownerPropsConfig,
|
|
57
|
+
...globalAttributes,
|
|
56
58
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledListWrapper, { height: totalSize, ...ownerPropsConfig, children: virtualItems.map((virtualItem) => {
|
|
57
59
|
const { index, start, key } = virtualItem;
|
|
58
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/List.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useOwnerProps, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { DSVirtualListDataTestIds } from '../constants/index.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\nimport { StyledWrapper, StyledListWrapper, StyledItemWrapper } from './styled.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement, propsWithDefault } =\n useVirtualListV3(props);\n const virtualItems = getVirtualItems();\n const measureRef: React.LegacyRef<HTMLDivElement> = React.useCallback(\n (node: HTMLDivElement) => measureElement(node),\n [measureElement],\n );\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n return (\n <StyledWrapper\n key={instanceUid}\n innerRef={parentRef}\n data-testid={DSVirtualListDataTestIds.ROOT}\n role=\"list\"\n {...ownerPropsConfig}\n {...globalAttributes}\n >\n <StyledListWrapper height={totalSize} {...ownerPropsConfig}>\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <StyledItemWrapper\n innerRef={measureRef}\n data-index={index}\n start={start}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n {...ownerPropsConfig}\n >\n {filteredChildren[index]}\n </StyledItemWrapper>\n );\n })}\n </StyledListWrapper>\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCX;AAhCZ,mBAAkB;AAClB,8BAAsD;AACtD,uBAAyC;AACzC,4BAAiC;AAEjC,oBAAoE;AAE7D,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,gBAAgB,iBAAiB,QAC7G,wCAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8C,aAAAA,QAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,uBAAmB,uCAAc,gBAAgB;AACvD,QAAM,uBAAmB,gDAAuB,gBAAgB;AAEhE,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,UAAU;AAAA,MACV,eAAa,0CAAyB;AAAA,MACtC,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,sDAAC,mCAAkB,QAAQ,WAAY,GAAG,kBACvC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,eACE;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,cAAY;AAAA,YACZ;AAAA,YACA,MAAK;AAAA,YAEJ,GAAG;AAAA,YAEH,2BAAiB,KAAK;AAAA;AAAA,UAHlB,GAAG,WAAW,SAAS,GAAG;AAAA,QAIjC;AAAA,MAEJ,CAAC,GACH;AAAA;AAAA,IAvBK;AAAA,EAwBP;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/cjs/parts/styled.js
CHANGED
|
@@ -35,19 +35,19 @@ __export(styled_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(styled_exports);
|
|
36
36
|
var React = __toESM(require("react"));
|
|
37
37
|
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
-
var
|
|
39
|
-
const StyledWrapper = (0, import_ds_system.styled)("div", { name:
|
|
38
|
+
var import_constants = require("../constants/index.js");
|
|
39
|
+
const StyledWrapper = (0, import_ds_system.styled)("div", { name: import_constants.DSVirtualListName, slot: import_constants.DSVirtualListSlots.ROOT })`
|
|
40
40
|
width: 100%;
|
|
41
41
|
height: 100%;
|
|
42
42
|
padding-bottom: 0;
|
|
43
43
|
overflow: auto;
|
|
44
44
|
`;
|
|
45
|
-
const StyledListWrapper = (0, import_ds_system.styled)("div", { name:
|
|
45
|
+
const StyledListWrapper = (0, import_ds_system.styled)("div", { name: import_constants.DSVirtualListName, slot: import_constants.DSVirtualListSlots.LIST_WRAPPER })`
|
|
46
46
|
width: 100%;
|
|
47
47
|
height: ${({ height }) => `${height}px`};
|
|
48
48
|
position: relative;
|
|
49
49
|
`;
|
|
50
|
-
const StyledItemWrapper = (0, import_ds_system.styled)("div", { name:
|
|
50
|
+
const StyledItemWrapper = (0, import_ds_system.styled)("div", { name: import_constants.DSVirtualListName, slot: import_constants.DSVirtualListSlots.ITEM_WRAPPER })`
|
|
51
51
|
position: absolute;
|
|
52
52
|
top: 0;
|
|
53
53
|
left: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSVirtualListName, DSVirtualListSlots } from '../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSVirtualListName, DSVirtualListSlots } from '../constants/index.js';\n\nexport const StyledWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ROOT })`\n width: 100%;\n height: 100%;\n padding-bottom: 0;\n overflow: auto;\n`;\n\nexport const StyledListWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.LIST_WRAPPER })<{\n height: number;\n}>`\n width: 100%;\n height: ${({ height }) => `${height}px`};\n position: relative;\n`;\n\nexport const StyledItemWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ITEM_WRAPPER })<{\n start: number;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n transform: ${({ start }) => `translateY(${start}px)`};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,uBAAsD;AAE/C,MAAM,oBAAgB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG,MAAM,IAAI;AAAA;AAAA;AAIlC,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlG,CAAC,EAAE,MAAM,MAAM,cAAc,KAAK,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,16 +34,22 @@ __export(react_desc_prop_types_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
-
var
|
|
37
|
+
var import_constants = require("./constants/index.js");
|
|
38
38
|
const defaultProps = {};
|
|
39
39
|
const DSVirtualListPropTypes = {
|
|
40
|
-
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(
|
|
40
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSVirtualListName, import_constants.DSVirtualListSlots),
|
|
41
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
41
42
|
children: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.node).description("Children list").isRequired,
|
|
42
43
|
actionRef: import_ds_props_helpers.PropTypes.shape({
|
|
43
44
|
current: import_ds_props_helpers.PropTypes.oneOfType([
|
|
44
45
|
import_ds_props_helpers.PropTypes.oneOf([null]),
|
|
45
46
|
import_ds_props_helpers.PropTypes.shape({
|
|
46
|
-
scrollTo: import_ds_props_helpers.PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`)
|
|
47
|
+
scrollTo: import_ds_props_helpers.PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`),
|
|
48
|
+
measure: import_ds_props_helpers.PropTypes.func.description(
|
|
49
|
+
"Clears the cached size of every item, falling back to the estimated size until each item is measured again (on its next real layout change or remount) \u2014 does not force an immediate DOM remeasurement"
|
|
50
|
+
).signature(`(() => void)`),
|
|
51
|
+
getVisibleItems: import_ds_props_helpers.PropTypes.func.description("Returns the indices of the items currently visible in the viewport (no overscan buffer)").signature(`(() => number[])`),
|
|
52
|
+
getMountedItems: import_ds_props_helpers.PropTypes.func.description("Returns the indices of all items currently mounted in the DOM, including the overscan buffer").signature(`(() => number[])`)
|
|
47
53
|
})
|
|
48
54
|
])
|
|
49
55
|
}).description(`mutable reference where methods will be stored`)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSVirtualListName, DSVirtualListSlots } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSVirtualListName, DSVirtualListSlots } from './constants/index.js';\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 measure?: () => void;\n getVisibleItems?: () => number[];\n getMountedItems?: () => number[];\n };\n\n export type SlotFunctionArguments = {\n dsVirtuallistRoot: () => object;\n dsVirtuallistListWrapper: () => object;\n dsVirtuallistItemWrapper: () => object;\n };\n\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSVirtualListName,\n typeof DSVirtualListSlots\n > {\n actionRef?: React.MutableRefObject<ActionRef>;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof RequiredProps>,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof RequiredProps>,\n RequiredProps {}\n}\n\nexport const defaultProps: DSVirtualListT.DefaultProps = {};\n\nexport const DSVirtualListPropTypes = {\n ...getPropsPerSlotPropTypes(DSVirtualListName, DSVirtualListSlots),\n ...globalAttributesPropTypes,\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 measure: PropTypes.func\n .description(\n 'Clears the cached size of every item, falling back to the estimated size until each item is measured again (on its next real layout change or remount) \u2014 does not force an immediate DOM remeasurement',\n )\n .signature(`(() => void)`),\n getVisibleItems: PropTypes.func\n .description('Returns the indices of the items currently visible in the viewport (no overscan buffer)')\n .signature(`(() => number[])`),\n getMountedItems: PropTypes.func\n .description('Returns the indices of all items currently mounted in the DOM, including the overscan buffer')\n .signature(`(() => number[])`),\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;ADGvB,8BAA+E;AAC/E,uBAAsD;AAiD/C,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,OAAG,kDAAyB,oCAAmB,mCAAkB;AAAA,EACjE,GAAG;AAAA,EACH,UAAU,kCAAU,QAAQ,kCAAU,IAAI,EAAE,YAAY,eAAe,EAAE;AAAA,EACzE,WAAW,kCAAU,MAAM;AAAA,IACzB,SAAS,kCAAU,UAAU;AAAA,MAC3B,kCAAU,MAAM,CAAC,IAAI,CAAC;AAAA,MACtB,kCAAU,MAAM;AAAA,QACd,UAAU,kCAAU,KACjB,YAAY,mCAAmC,EAC/C,UAAU,2EAA2E;AAAA,QACxF,SAAS,kCAAU,KAChB;AAAA,UACC;AAAA,QACF,EACC,UAAU,cAAc;AAAA,QAC3B,iBAAiB,kCAAU,KACxB,YAAY,yFAAyF,EACrG,UAAU,kBAAkB;AAAA,QAC/B,iBAAiB,kCAAU,KACxB,YAAY,8FAA8F,EAC1G,UAAU,kBAAkB;AAAA,MACjC,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,EAAE,YAAY,gDAAgD;AACjE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,10 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
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
8
|
var __copyProps = (to, from, except, desc) => {
|
|
13
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,14 +21,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
22
|
mod
|
|
27
23
|
));
|
|
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
24
|
var React = __toESM(require("react"));
|
|
35
|
-
const
|
|
36
|
-
|
|
25
|
+
const SlotPropsAsObject = {
|
|
26
|
+
dsVirtuallistRoot: { "aria-label": "just a typescript test" },
|
|
27
|
+
dsVirtuallistListWrapper: { "aria-label": "just a typescript test" },
|
|
28
|
+
dsVirtuallistItemWrapper: { "aria-label": "just a typescript test" }
|
|
29
|
+
};
|
|
30
|
+
const SlotPropsAsFunctions = {
|
|
31
|
+
dsVirtuallistRoot: () => ({ "aria-label": "just a typescript test" }),
|
|
32
|
+
dsVirtuallistListWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
33
|
+
dsVirtuallistItemWrapper: () => ({ "aria-label": "just a typescript test" })
|
|
37
34
|
};
|
|
38
|
-
|
|
35
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
36
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSVirtualListName, DSVirtualListSlots } from '../constants/index.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObject: Partial<DSVirtualListT.Props> = {\n dsVirtuallistRoot: { 'aria-label': 'just a typescript test' },\n dsVirtuallistListWrapper: { 'aria-label': 'just a typescript test' },\n dsVirtuallistItemWrapper: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSVirtualListT.SlotFunctionArguments = {\n dsVirtuallistRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsVirtuallistListWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsVirtuallistItemWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSVirtualListName, typeof DSVirtualListSlots>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACMvB,MAAM,oBAAmD;AAAA,EACvD,mBAAmB,EAAE,cAAc,yBAAyB;AAAA,EAC5D,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,EAAE,cAAc,yBAAyB;AACrE;AAEA,MAAM,uBAA6D;AAAA,EACjE,mBAAmB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAC5E;AAGA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
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 typescript_virtual_list_valid_exports = {};
|
|
30
|
+
__export(typescript_virtual_list_valid_exports, {
|
|
31
|
+
default: () => typescript_virtual_list_valid_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(typescript_virtual_list_valid_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_VirtualList = require("../VirtualList.js");
|
|
37
|
+
const testRequiredProps = {
|
|
38
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0")]
|
|
39
|
+
};
|
|
40
|
+
const testOptionalProps = {};
|
|
41
|
+
const testPartialDefaults = {};
|
|
42
|
+
const testProps = {
|
|
43
|
+
...testRequiredProps,
|
|
44
|
+
...testOptionalProps,
|
|
45
|
+
...testPartialDefaults
|
|
46
|
+
};
|
|
47
|
+
const testPropsAsSyntax = {
|
|
48
|
+
...testRequiredProps,
|
|
49
|
+
...testOptionalProps,
|
|
50
|
+
...testPartialDefaults
|
|
51
|
+
};
|
|
52
|
+
const testCompleteDefaults = {};
|
|
53
|
+
const testInternalProps = {
|
|
54
|
+
...testRequiredProps,
|
|
55
|
+
...testOptionalProps,
|
|
56
|
+
...testCompleteDefaults
|
|
57
|
+
};
|
|
58
|
+
const testInternalPropsAsSyntax = {
|
|
59
|
+
...testRequiredProps,
|
|
60
|
+
...testOptionalProps,
|
|
61
|
+
...testCompleteDefaults
|
|
62
|
+
};
|
|
63
|
+
const actionRef = { current: {} };
|
|
64
|
+
const testExplicitDefinition = {
|
|
65
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 1" }, "1")],
|
|
66
|
+
actionRef
|
|
67
|
+
};
|
|
68
|
+
const testInferredTypeCompatibility = {
|
|
69
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 1" }, "1")],
|
|
70
|
+
actionRef
|
|
71
|
+
};
|
|
72
|
+
const testDefinitionAsConst = {
|
|
73
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 1" }, "1")]
|
|
74
|
+
};
|
|
75
|
+
const testSlotPropsAsObject = {
|
|
76
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0")],
|
|
77
|
+
dsVirtuallistRoot: { "aria-label": "items list" },
|
|
78
|
+
dsVirtuallistListWrapper: { "aria-label": "items list wrapper" },
|
|
79
|
+
dsVirtuallistItemWrapper: { "aria-label": "item wrapper" }
|
|
80
|
+
};
|
|
81
|
+
const testGlobalAttributes = {
|
|
82
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0")],
|
|
83
|
+
className: "custom-class",
|
|
84
|
+
id: "custom-id",
|
|
85
|
+
"aria-label": "custom list"
|
|
86
|
+
};
|
|
87
|
+
const testSlotPropsAsFunctions = {
|
|
88
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0")],
|
|
89
|
+
dsVirtuallistRoot: () => ({ "aria-label": "items list" }),
|
|
90
|
+
dsVirtuallistListWrapper: () => ({ "aria-label": "items list wrapper" }),
|
|
91
|
+
dsVirtuallistItemWrapper: () => ({ "aria-label": "item wrapper" })
|
|
92
|
+
};
|
|
93
|
+
const handleMeasure = () => actionRef.current.measure?.();
|
|
94
|
+
const handleGetVisibleItems = () => actionRef.current.getVisibleItems?.() ?? [];
|
|
95
|
+
const handleGetMountedItems = () => actionRef.current.getMountedItems?.() ?? [];
|
|
96
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testExplicitDefinition }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testInferredTypeCompatibility }),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testDefinitionAsConst }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testSlotPropsAsObject }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testSlotPropsAsFunctions }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { ...testGlobalAttributes }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualList.DSVirtualList, { className: "custom-class", id: "custom-id", "aria-label": "custom list", "data-testid": "custom-testid", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }, "0")] }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_VirtualList.DSVirtualList, { children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 1" })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_VirtualList.DSVirtualList, { actionRef, dsVirtuallistRoot: { tabIndex: 0 }, children: [
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 0" }),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "item 1" })
|
|
111
|
+
] })
|
|
112
|
+
] });
|
|
113
|
+
var typescript_virtual_list_valid_default = ExampleUsageComponent;
|
|
114
|
+
//# sourceMappingURL=typescript-virtual-list-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/typescript-testing/typescript-virtual-list-valid.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n/* eslint-disable local-rules/custom-rule */\nimport React from 'react';\nimport { DSVirtualList } from '../VirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\n\ntype ComponentPropsForApp = DSVirtualListT.Props;\ntype ComponentPropsInternals = DSVirtualListT.InternalProps;\ntype ComponentPropsDefaultProps = DSVirtualListT.DefaultProps;\ntype ComponentPropsOptionalProps = DSVirtualListT.OptionalProps;\ntype ComponentPropsRequiredProps = DSVirtualListT.RequiredProps;\n\n// NOTE: `children` is typed as `React.ReactNode` (accepts a single element or an array), but\n// `DSVirtualListPropTypes.children` is `PropTypes.arrayOf(PropTypes.node).isRequired` \u2014 stricter\n// than the TS type. A single non-array child compiles here but throws at runtime. Every example\n// below passes an array to match the real, enforced contract \u2014 not just what the type permits.\nconst testRequiredProps: ComponentPropsRequiredProps = {\n children: [<div key=\"0\">item 0</div>],\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// Example usages start here\nconst actionRef: React.MutableRefObject<DSVirtualListT.ActionRef> = { current: {} };\n\nconst testExplicitDefinition: ComponentPropsForApp = {\n children: [<div key=\"0\">item 0</div>, <div key=\"1\">item 1</div>],\n actionRef,\n};\n\nconst testInferredTypeCompatibility = {\n children: [<div key=\"0\">item 0</div>, <div key=\"1\">item 1</div>],\n actionRef,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n children: [<div key=\"0\">item 0</div>, <div key=\"1\">item 1</div>],\n} as const;\n\nconst testSlotPropsAsObject: ComponentPropsForApp = {\n children: [<div key=\"0\">item 0</div>],\n dsVirtuallistRoot: { 'aria-label': 'items list' },\n dsVirtuallistListWrapper: { 'aria-label': 'items list wrapper' },\n dsVirtuallistItemWrapper: { 'aria-label': 'item wrapper' },\n};\n\n// Global HTML/ARIA attributes (className, id, aria-*, data-*) work at runtime via\n// useGetGlobalAttributes in List.tsx \u2014 Props/InternalProps extend Omit<GlobalAttributesT<HTMLElement>, ...>\n// specifically so this compiles. Regression here means the type/runtime contract has drifted apart again.\nconst testGlobalAttributes: ComponentPropsForApp = {\n children: [<div key=\"0\">item 0</div>],\n className: 'custom-class',\n id: 'custom-id',\n 'aria-label': 'custom list',\n};\n\nconst testSlotPropsAsFunctions: ComponentPropsForApp = {\n children: [<div key=\"0\">item 0</div>],\n dsVirtuallistRoot: () => ({ 'aria-label': 'items list' }),\n dsVirtuallistListWrapper: () => ({ 'aria-label': 'items list wrapper' }),\n dsVirtuallistItemWrapper: () => ({ 'aria-label': 'item wrapper' }),\n};\n\n// actionRef method usages \u2014 measure() and getVisibleItems() (PUI-17898)\nconst handleMeasure = () => actionRef.current.measure?.();\nconst handleGetVisibleItems: () => number[] = () => actionRef.current.getVisibleItems?.() ?? [];\nconst handleGetMountedItems: () => number[] = () => actionRef.current.getMountedItems?.() ?? [];\n\nconst ExampleUsageComponent = () => (\n <>\n {/* Works with explicitly casted props */}\n <DSVirtualList {...testExplicitDefinition} />\n <DSVirtualList {...testInferredTypeCompatibility} />\n <DSVirtualList {...testDefinitionAsConst} />\n <DSVirtualList {...testSlotPropsAsObject} />\n <DSVirtualList {...testSlotPropsAsFunctions} />\n <DSVirtualList {...testGlobalAttributes} />\n\n {/* Inline props test \u2014 global HTML/ARIA attributes. Array child to match the real, enforced\n runtime contract \u2014 a single child here would compile but throw (see NOTE above). */}\n <DSVirtualList className=\"custom-class\" id=\"custom-id\" aria-label=\"custom list\" data-testid=\"custom-testid\">\n {[<div key=\"0\">item 0</div>]}\n </DSVirtualList>\n\n {/* Inline props test \u2014 required prop only. Two children so JSX itself produces an array;\n a single child here would compile (React.ReactNode) but throw at runtime (see NOTE above). */}\n <DSVirtualList>\n <div>item 0</div>\n <div>item 1</div>\n </DSVirtualList>\n\n {/* Inline props test \u2014 actionRef and slot props */}\n <DSVirtualList actionRef={actionRef} dsVirtuallistRoot={{ tabIndex: 0 }}>\n <div>item 0</div>\n <div>item 1</div>\n </DSVirtualList>\n </>\n);\n\nexport default ExampleUsageComponent;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBV;AAdb,yBAA8B;AAa9B,MAAM,oBAAiD;AAAA,EACrD,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AACtC;AAEA,MAAM,oBAAiD,CAAC;AAExD,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D,CAAC;AAEpE,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,YAA8D,EAAE,SAAS,CAAC,EAAE;AAElF,MAAM,yBAA+C;AAAA,EACnD,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,GAAQ,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EAC/D;AACF;AAEA,MAAM,gCAAgC;AAAA,EACpC,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,GAAQ,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EAC/D;AACF;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,GAAQ,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AACjE;AAEA,MAAM,wBAA8C;AAAA,EAClD,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EACpC,mBAAmB,EAAE,cAAc,aAAa;AAAA,EAChD,0BAA0B,EAAE,cAAc,qBAAqB;AAAA,EAC/D,0BAA0B,EAAE,cAAc,eAAe;AAC3D;AAKA,MAAM,uBAA6C;AAAA,EACjD,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EACpC,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,cAAc;AAChB;AAEA,MAAM,2BAAiD;AAAA,EACrD,UAAU,CAAC,4CAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EACpC,mBAAmB,OAAO,EAAE,cAAc,aAAa;AAAA,EACvD,0BAA0B,OAAO,EAAE,cAAc,qBAAqB;AAAA,EACtE,0BAA0B,OAAO,EAAE,cAAc,eAAe;AAClE;AAGA,MAAM,gBAAgB,MAAM,UAAU,QAAQ,UAAU;AACxD,MAAM,wBAAwC,MAAM,UAAU,QAAQ,kBAAkB,KAAK,CAAC;AAC9F,MAAM,wBAAwC,MAAM,UAAU,QAAQ,kBAAkB,KAAK,CAAC;AAE9F,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,oCAAe,GAAG,wBAAwB;AAAA,EAC3C,4CAAC,oCAAe,GAAG,+BAA+B;AAAA,EAClD,4CAAC,oCAAe,GAAG,uBAAuB;AAAA,EAC1C,4CAAC,oCAAe,GAAG,uBAAuB;AAAA,EAC1C,4CAAC,oCAAe,GAAG,0BAA0B;AAAA,EAC7C,4CAAC,oCAAe,GAAG,sBAAsB;AAAA,EAIzC,4CAAC,oCAAc,WAAU,gBAAe,IAAG,aAAY,cAAW,eAAc,eAAY,iBACzF,WAAC,4CAAC,SAAY,sBAAJ,GAAU,CAAM,GAC7B;AAAA,EAIA,6CAAC,oCACC;AAAA,gDAAC,SAAI,oBAAM;AAAA,IACX,4CAAC,SAAI,oBAAM;AAAA,KACb;AAAA,EAGA,6CAAC,oCAAc,WAAsB,mBAAmB,EAAE,UAAU,EAAE,GACpE;AAAA,gDAAC,SAAI,oBAAM;AAAA,IACX,4CAAC,SAAI,oBAAM;AAAA,KACb;AAAA,GACF;AAGF,IAAO,wCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/VirtualList.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { List } from "./parts/List.js";
|
|
5
5
|
import { DSVirtualListPropTypes } from "./react-desc-prop-types.js";
|
|
6
|
-
import { DSVirtualListName } from "./
|
|
6
|
+
import { DSVirtualListName } from "./constants/index.js";
|
|
7
7
|
const DSVirtualList = (props) => /* @__PURE__ */ jsx(List, { ...props });
|
|
8
8
|
DSVirtualList.displayName = DSVirtualListName;
|
|
9
9
|
const DSVirtualListWithSchema = describe(DSVirtualList).description("DSVirtualList");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/VirtualList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { List } from './parts/List.js';\nimport { DSVirtualListPropTypes, type DSVirtualListT } from './react-desc-prop-types.js';\nimport { DSVirtualListName } from './constants/index.js';\n\n// we are not using a context nor zustand so all the logic is handled in List...\nconst DSVirtualList = (props: DSVirtualListT.Props) => <List {...props} />;\n\nDSVirtualList.displayName = DSVirtualListName;\nconst DSVirtualListWithSchema = describe(DSVirtualList).description('DSVirtualList');\nDSVirtualListWithSchema.propTypes = DSVirtualListPropTypes;\n\nexport { DSVirtualList, DSVirtualListWithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACOgC;AANvD,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,8BAAmD;AAC5D,SAAS,yBAAyB;AAGlC,MAAM,gBAAgB,CAAC,UAAgC,oBAAC,QAAM,GAAG,OAAO;AAExE,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa,EAAE,YAAY,eAAe;AACnF,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSVirtualListName = "DSVirtuallist";
|
|
4
|
+
const DSVirtualListSlots = {
|
|
5
|
+
ROOT: "root",
|
|
6
|
+
// legacy — data-testid preserved below, do not let slot auto-generation replace it
|
|
7
|
+
LIST_WRAPPER: "list-wrapper",
|
|
8
|
+
ITEM_WRAPPER: "item-wrapper"
|
|
9
|
+
};
|
|
10
|
+
const DSVirtualListDataTestIds = {
|
|
11
|
+
...slotObjectToDataTestIds(DSVirtualListName, DSVirtualListSlots),
|
|
12
|
+
ROOT: "virtual-list-container"
|
|
13
|
+
// legacy value — e2e/ds-virtuallist/DSVirtualListCO.js depends on it, breaking change if removed
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
DSVirtualListDataTestIds,
|
|
17
|
+
DSVirtualListName,
|
|
18
|
+
DSVirtualListSlots
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSVirtualListName = 'DSVirtuallist';\n\nexport const DSVirtualListSlots = {\n ROOT: 'root', // legacy \u2014 data-testid preserved below, do not let slot auto-generation replace it\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n} as const;\n\nexport const DSVirtualListDataTestIds = {\n ...slotObjectToDataTestIds(DSVirtualListName, DSVirtualListSlots),\n ROOT: 'virtual-list-container', // legacy value \u2014 e2e/ds-virtuallist/DSVirtualListCO.js depends on it, breaking change if removed\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA;AAAA,EACN,cAAc;AAAA,EACd,cAAc;AAChB;AAEO,MAAM,2BAA2B;AAAA,EACtC,GAAG,wBAAwB,mBAAmB,kBAAkB;AAAA,EAChE,MAAM;AAAA;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { DSVirtualListName } from "../
|
|
3
|
+
import { DSVirtualListName } from "../constants/index.js";
|
|
4
4
|
const useValidateProps = (props, propTypes) => {
|
|
5
5
|
useValidateTypescriptPropTypes(props, propTypes, DSVirtualListName);
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSVirtualListT } from '../react-desc-prop-types.js';\nimport { DSVirtualListName } from '../constants/index.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
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
6
|
"names": []
|
|
7
7
|
}
|