@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.
Files changed (57) hide show
  1. package/dist/cjs/VirtualList.js +2 -2
  2. package/dist/cjs/VirtualList.js.map +2 -2
  3. package/dist/cjs/{DSVirtualListDefinitions.js → constants/index.js} +12 -4
  4. package/dist/cjs/constants/index.js.map +7 -0
  5. package/dist/cjs/hooks/useValidateProps.js +2 -2
  6. package/dist/cjs/hooks/useValidateProps.js.map +2 -2
  7. package/dist/cjs/hooks/useVirtualList.js +12 -1
  8. package/dist/cjs/hooks/useVirtualList.js.map +2 -2
  9. package/dist/cjs/index.js +4 -3
  10. package/dist/cjs/index.js.map +2 -2
  11. package/dist/cjs/parts/List.js +4 -2
  12. package/dist/cjs/parts/List.js.map +2 -2
  13. package/dist/cjs/parts/styled.js +4 -4
  14. package/dist/cjs/parts/styled.js.map +2 -2
  15. package/dist/cjs/react-desc-prop-types.js +9 -3
  16. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  17. package/dist/cjs/{VirtualListDataTestID.js → typescript-testing/slot-props.js} +11 -13
  18. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  19. package/dist/cjs/typescript-testing/typescript-virtual-list-valid.js +114 -0
  20. package/dist/cjs/typescript-testing/typescript-virtual-list-valid.js.map +7 -0
  21. package/dist/esm/VirtualList.js +1 -1
  22. package/dist/esm/VirtualList.js.map +1 -1
  23. package/dist/esm/constants/index.js +20 -0
  24. package/dist/esm/constants/index.js.map +7 -0
  25. package/dist/esm/hooks/useValidateProps.js +1 -1
  26. package/dist/esm/hooks/useValidateProps.js.map +1 -1
  27. package/dist/esm/hooks/useVirtualList.js +12 -1
  28. package/dist/esm/hooks/useVirtualList.js.map +2 -2
  29. package/dist/esm/index.js +2 -1
  30. package/dist/esm/index.js.map +2 -2
  31. package/dist/esm/parts/List.js +5 -3
  32. package/dist/esm/parts/List.js.map +2 -2
  33. package/dist/esm/parts/styled.js +1 -1
  34. package/dist/esm/parts/styled.js.map +1 -1
  35. package/dist/esm/react-desc-prop-types.js +9 -3
  36. package/dist/esm/react-desc-prop-types.js.map +2 -2
  37. package/dist/esm/typescript-testing/slot-props.js +13 -0
  38. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  39. package/dist/esm/typescript-testing/typescript-virtual-list-valid.js +84 -0
  40. package/dist/esm/typescript-testing/typescript-virtual-list-valid.js.map +7 -0
  41. package/dist/types/constants/index.d.ts +11 -0
  42. package/dist/types/index.d.ts +1 -1
  43. package/dist/types/react-desc-prop-types.d.ts +13 -4
  44. package/package.json +10 -9
  45. package/dist/cjs/DSVirtualListDefinitions.js.map +0 -7
  46. package/dist/cjs/VirtualListDataTestID.js.map +0 -7
  47. package/dist/cjs/props.js +0 -58
  48. package/dist/cjs/props.js.map +0 -7
  49. package/dist/esm/DSVirtualListDefinitions.js +0 -12
  50. package/dist/esm/DSVirtualListDefinitions.js.map +0 -7
  51. package/dist/esm/VirtualListDataTestID.js +0 -8
  52. package/dist/esm/VirtualListDataTestID.js.map +0 -7
  53. package/dist/esm/props.js +0 -28
  54. package/dist/esm/props.js.map +0 -7
  55. package/dist/types/DSVirtualListDefinitions.d.ts +0 -6
  56. package/dist/types/VirtualListDataTestID.d.ts +0 -3
  57. package/dist/types/props.d.ts +0 -12
@@ -22,7 +22,18 @@ const useVirtualListV3 = (propsFromUser) => {
22
22
  estimateSize
23
23
  });
24
24
  const totalSize = useVirtualHelpers.getTotalSize();
25
- if (actionRef && actionRef.current) actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;
25
+ if (actionRef && actionRef.current) {
26
+ actionRef.current.scrollTo = useVirtualHelpers.scrollToIndex;
27
+ actionRef.current.measure = useVirtualHelpers.measure;
28
+ actionRef.current.getVisibleItems = () => {
29
+ const range = useVirtualHelpers.calculateRange();
30
+ if (!range) return [];
31
+ const indices = [];
32
+ for (let index = range.startIndex; index <= range.endIndex; index += 1) indices.push(index);
33
+ return indices;
34
+ };
35
+ actionRef.current.getMountedItems = () => useVirtualHelpers.getVirtualItems().map((item) => item.index);
36
+ }
26
37
  const instanceUid = React2.useMemo(() => `ds-virtual-list-${uid(6)}`, []);
27
38
  return React2.useMemo(
28
39
  () => ({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useVirtualList.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,sBAAwC;AACjD,OAAOA,YAAW;AAClB,SAAS,WAAW;AACpB,SAAS,wBAAwB,oBAAyC;AAC1E,SAAS,wBAAwB;AAEjC,MAAM,eAAe,MAAM;AAWpB,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,MAAI,aAAa,UAAU,QAAS,WAAU,QAAQ,WAAW,kBAAkB;AAEnF,QAAM,cAAcA,OAAM,QAAQ,MAAM,mBAAmB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACvE,SAAOA,OAAM;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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,sBAAwC;AACjD,OAAOA,YAAW;AAClB,SAAS,WAAW;AACpB,SAAS,wBAAwB,oBAAyC;AAC1E,SAAS,wBAAwB;AAEjC,MAAM,eAAe,MAAM;AAWpB,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,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,cAAcA,OAAM,QAAQ,MAAM,mBAAmB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACvE,SAAOA,OAAM;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/esm/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { DSVirtualList, DSVirtualListWithSchema } from "./VirtualList.js";
3
- import { DSVirtualListName, DSVirtualListSlots } from "./DSVirtualListDefinitions.js";
3
+ import { DSVirtualListName, DSVirtualListSlots, DSVirtualListDataTestIds } from "./constants/index.js";
4
4
  export {
5
5
  DSVirtualList,
6
+ DSVirtualListDataTestIds,
6
7
  DSVirtualListName,
7
8
  DSVirtualListSlots,
8
9
  DSVirtualListWithSchema
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots } from './DSVirtualListDefinitions.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB,0BAA0B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { type DSVirtualListT } from './react-desc-prop-types.js';\nexport { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';\nexport { DSVirtualListName, DSVirtualListSlots, DSVirtualListDataTestIds } from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB,oBAAoB,gCAAgC;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
- import { useOwnerProps } from "@elliemae/ds-props-helpers";
5
- import { LIST_DATA_TESTID } from "../VirtualListDataTestID.js";
4
+ import { useOwnerProps, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
5
+ import { DSVirtualListDataTestIds } from "../constants/index.js";
6
6
  import { useVirtualListV3 } from "../hooks/useVirtualList.js";
7
7
  import { StyledWrapper, StyledListWrapper, StyledItemWrapper } from "./styled.js";
8
8
  const List = (props) => {
@@ -13,13 +13,15 @@ const List = (props) => {
13
13
  [measureElement]
14
14
  );
15
15
  const ownerPropsConfig = useOwnerProps(propsWithDefault);
16
+ const globalAttributes = useGetGlobalAttributes(propsWithDefault);
16
17
  return /* @__PURE__ */ jsx(
17
18
  StyledWrapper,
18
19
  {
19
20
  innerRef: parentRef,
20
- "data-testid": LIST_DATA_TESTID.CONTAINER,
21
+ "data-testid": DSVirtualListDataTestIds.ROOT,
21
22
  role: "list",
22
23
  ...ownerPropsConfig,
24
+ ...globalAttributes,
23
25
  children: /* @__PURE__ */ jsx(StyledListWrapper, { height: totalSize, ...ownerPropsConfig, children: virtualItems.map((virtualItem) => {
24
26
  const { index, start, key } = virtualItem;
25
27
  return /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/List.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { LIST_DATA_TESTID } from '../VirtualListDataTestID.js';\nimport { useVirtualListV3 } from '../hooks/useVirtualList.js';\nimport type { DSVirtualListT } from '../react-desc-prop-types.js';\nimport { StyledWrapper, StyledListWrapper, StyledItemWrapper } from './styled.js';\n\nexport const List = (props: DSVirtualListT.Props) => {\n const { parentRef, getVirtualItems, filteredChildren, totalSize, instanceUid, measureElement, propsWithDefault } =\n useVirtualListV3(props);\n const virtualItems = getVirtualItems();\n const measureRef: React.LegacyRef<HTMLDivElement> = React.useCallback(\n (node: HTMLDivElement) => measureElement(node),\n [measureElement],\n );\n\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\n return (\n <StyledWrapper\n key={instanceUid}\n innerRef={parentRef}\n data-testid={LIST_DATA_TESTID.CONTAINER}\n role=\"list\"\n {...ownerPropsConfig}\n >\n <StyledListWrapper height={totalSize} {...ownerPropsConfig}>\n {virtualItems.map((virtualItem) => {\n const { index, start, key } = virtualItem;\n return (\n <StyledItemWrapper\n innerRef={measureRef}\n data-index={index}\n start={start}\n role=\"listitem\"\n key={`${instanceUid}-item-${key}`}\n {...ownerPropsConfig}\n >\n {filteredChildren[index]}\n </StyledItemWrapper>\n );\n })}\n </StyledListWrapper>\n </StyledWrapper>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC8BX;AA9BZ,OAAOA,YAAW;AAClB,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAEjC,SAAS,eAAe,mBAAmB,yBAAyB;AAE7D,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,gBAAgB,iBAAiB,IAC7G,iBAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8CA,OAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,UAAU;AAAA,MACV,eAAa,iBAAiB;AAAA,MAC9B,MAAK;AAAA,MACJ,GAAG;AAAA,MAEJ,8BAAC,qBAAkB,QAAQ,WAAY,GAAG,kBACvC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,eACE;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,cAAY;AAAA,YACZ;AAAA,YACA,MAAK;AAAA,YAEJ,GAAG;AAAA,YAEH,2BAAiB,KAAK;AAAA;AAAA,UAHlB,GAAG,WAAW,SAAS,GAAG;AAAA,QAIjC;AAAA,MAEJ,CAAC,GACH;AAAA;AAAA,IAtBK;AAAA,EAuBP;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgCX;AAhCZ,OAAOA,YAAW;AAClB,SAAS,eAAe,8BAA8B;AACtD,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AAEjC,SAAS,eAAe,mBAAmB,yBAAyB;AAE7D,MAAM,OAAO,CAAC,UAAgC;AACnD,QAAM,EAAE,WAAW,iBAAiB,kBAAkB,WAAW,aAAa,gBAAgB,iBAAiB,IAC7G,iBAAiB,KAAK;AACxB,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAA8CA,OAAM;AAAA,IACxD,CAAC,SAAyB,eAAe,IAAI;AAAA,IAC7C,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,mBAAmB,cAAc,gBAAgB;AACvD,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,UAAU;AAAA,MACV,eAAa,yBAAyB;AAAA,MACtC,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,8BAAC,qBAAkB,QAAQ,WAAY,GAAG,kBACvC,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,OAAO,IAAI,IAAI;AAC9B,eACE;AAAA,UAAC;AAAA;AAAA,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
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { styled } from "@elliemae/ds-system";
3
- import { DSVirtualListName, DSVirtualListSlots } from "../DSVirtualListDefinitions.js";
3
+ import { DSVirtualListName, DSVirtualListSlots } from "../constants/index.js";
4
4
  const StyledWrapper = styled("div", { name: DSVirtualListName, slot: DSVirtualListSlots.ROOT })`
5
5
  width: 100%;
6
6
  height: 100%;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DSVirtualListName, DSVirtualListSlots } from '../DSVirtualListDefinitions.js';\n\nexport const StyledWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ROOT })`\n width: 100%;\n height: 100%;\n padding-bottom: 0;\n overflow: auto;\n`;\n\nexport const StyledListWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.LIST_WRAPPER })<{\n height: number;\n}>`\n width: 100%;\n height: ${({ height }) => `${height}px`};\n position: relative;\n`;\n\nexport const StyledItemWrapper = styled('div', { name: DSVirtualListName, slot: DSVirtualListSlots.ITEM_WRAPPER })<{\n start: number;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n transform: ${({ start }) => `translateY(${start}px)`};\n`;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,mBAAmB,0BAA0B;AAE/C,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9F,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA,YAIrG,CAAC,EAAE,OAAO,MAAM,GAAG,MAAM,IAAI;AAAA;AAAA;AAIlC,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlG,CAAC,EAAE,MAAM,MAAM,cAAc,KAAK,KAAK;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,21 @@
1
1
  import * as React from "react";
2
- import { PropTypes, getPropsPerSlotPropTypes } from "@elliemae/ds-props-helpers";
3
- import { DSVirtualListName, DSVirtualListSlots } from "./DSVirtualListDefinitions.js";
2
+ import { PropTypes, getPropsPerSlotPropTypes, globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSVirtualListName, DSVirtualListSlots } from "./constants/index.js";
4
4
  const defaultProps = {};
5
5
  const DSVirtualListPropTypes = {
6
6
  ...getPropsPerSlotPropTypes(DSVirtualListName, DSVirtualListSlots),
7
+ ...globalAttributesPropTypes,
7
8
  children: PropTypes.arrayOf(PropTypes.node).description("Children list").isRequired,
8
9
  actionRef: PropTypes.shape({
9
10
  current: PropTypes.oneOfType([
10
11
  PropTypes.oneOf([null]),
11
12
  PropTypes.shape({
12
- scrollTo: PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`)
13
+ scrollTo: PropTypes.func.description("Scroll to a index inside the list").signature(`((index: number, { align: 'start' | 'center' | 'end' | 'auto' }) => void)`),
14
+ measure: PropTypes.func.description(
15
+ "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"
16
+ ).signature(`(() => void)`),
17
+ getVisibleItems: PropTypes.func.description("Returns the indices of the items currently visible in the viewport (no overscan buffer)").signature(`(() => number[])`),
18
+ getMountedItems: PropTypes.func.description("Returns the indices of all items currently mounted in the DOM, including the overscan buffer").signature(`(() => number[])`)
13
19
  })
14
20
  ])
15
21
  }).description(`mutable reference where methods will be stored`)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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", "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 './DSVirtualListDefinitions.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 };\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 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 ...getPropsPerSlotPropTypes(DSVirtualListName, DSVirtualListSlots),\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,WAAW,gCAAgC;AACpD,SAAS,mBAAmB,0BAA0B;AA6B/C,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,GAAG,yBAAyB,mBAAmB,kBAAkB;AAAA,EACjE,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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,0BAA0B,iCAAiC;AAC/E,SAAS,mBAAmB,0BAA0B;AAiD/C,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,GAAG,yBAAyB,mBAAmB,kBAAkB;AAAA,EACjE,GAAG;AAAA,EACH,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,QACxF,SAAS,UAAU,KAChB;AAAA,UACC;AAAA,QACF,EACC,UAAU,cAAc;AAAA,QAC3B,iBAAiB,UAAU,KACxB,YAAY,yFAAyF,EACrG,UAAU,kBAAkB;AAAA,QAC/B,iBAAiB,UAAU,KACxB,YAAY,8FAA8F,EAC1G,UAAU,kBAAkB;AAAA,MACjC,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,EAAE,YAAY,gDAAgD;AACjE;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ const SlotPropsAsObject = {
3
+ dsVirtuallistRoot: { "aria-label": "just a typescript test" },
4
+ dsVirtuallistListWrapper: { "aria-label": "just a typescript test" },
5
+ dsVirtuallistItemWrapper: { "aria-label": "just a typescript test" }
6
+ };
7
+ const SlotPropsAsFunctions = {
8
+ dsVirtuallistRoot: () => ({ "aria-label": "just a typescript test" }),
9
+ dsVirtuallistListWrapper: () => ({ "aria-label": "just a typescript test" }),
10
+ dsVirtuallistItemWrapper: () => ({ "aria-label": "just a typescript test" })
11
+ };
12
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
13
+ //# 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,YAAY,WAAW;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,84 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSVirtualList } from "../VirtualList.js";
4
+ const testRequiredProps = {
5
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0")]
6
+ };
7
+ const testOptionalProps = {};
8
+ const testPartialDefaults = {};
9
+ const testProps = {
10
+ ...testRequiredProps,
11
+ ...testOptionalProps,
12
+ ...testPartialDefaults
13
+ };
14
+ const testPropsAsSyntax = {
15
+ ...testRequiredProps,
16
+ ...testOptionalProps,
17
+ ...testPartialDefaults
18
+ };
19
+ const testCompleteDefaults = {};
20
+ const testInternalProps = {
21
+ ...testRequiredProps,
22
+ ...testOptionalProps,
23
+ ...testCompleteDefaults
24
+ };
25
+ const testInternalPropsAsSyntax = {
26
+ ...testRequiredProps,
27
+ ...testOptionalProps,
28
+ ...testCompleteDefaults
29
+ };
30
+ const actionRef = { current: {} };
31
+ const testExplicitDefinition = {
32
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0"), /* @__PURE__ */ jsx("div", { children: "item 1" }, "1")],
33
+ actionRef
34
+ };
35
+ const testInferredTypeCompatibility = {
36
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0"), /* @__PURE__ */ jsx("div", { children: "item 1" }, "1")],
37
+ actionRef
38
+ };
39
+ const testDefinitionAsConst = {
40
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0"), /* @__PURE__ */ jsx("div", { children: "item 1" }, "1")]
41
+ };
42
+ const testSlotPropsAsObject = {
43
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0")],
44
+ dsVirtuallistRoot: { "aria-label": "items list" },
45
+ dsVirtuallistListWrapper: { "aria-label": "items list wrapper" },
46
+ dsVirtuallistItemWrapper: { "aria-label": "item wrapper" }
47
+ };
48
+ const testGlobalAttributes = {
49
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0")],
50
+ className: "custom-class",
51
+ id: "custom-id",
52
+ "aria-label": "custom list"
53
+ };
54
+ const testSlotPropsAsFunctions = {
55
+ children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0")],
56
+ dsVirtuallistRoot: () => ({ "aria-label": "items list" }),
57
+ dsVirtuallistListWrapper: () => ({ "aria-label": "items list wrapper" }),
58
+ dsVirtuallistItemWrapper: () => ({ "aria-label": "item wrapper" })
59
+ };
60
+ const handleMeasure = () => actionRef.current.measure?.();
61
+ const handleGetVisibleItems = () => actionRef.current.getVisibleItems?.() ?? [];
62
+ const handleGetMountedItems = () => actionRef.current.getMountedItems?.() ?? [];
63
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
64
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testExplicitDefinition }),
65
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testInferredTypeCompatibility }),
66
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testDefinitionAsConst }),
67
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testSlotPropsAsObject }),
68
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testSlotPropsAsFunctions }),
69
+ /* @__PURE__ */ jsx(DSVirtualList, { ...testGlobalAttributes }),
70
+ /* @__PURE__ */ jsx(DSVirtualList, { className: "custom-class", id: "custom-id", "aria-label": "custom list", "data-testid": "custom-testid", children: [/* @__PURE__ */ jsx("div", { children: "item 0" }, "0")] }),
71
+ /* @__PURE__ */ jsxs(DSVirtualList, { children: [
72
+ /* @__PURE__ */ jsx("div", { children: "item 0" }),
73
+ /* @__PURE__ */ jsx("div", { children: "item 1" })
74
+ ] }),
75
+ /* @__PURE__ */ jsxs(DSVirtualList, { actionRef, dsVirtuallistRoot: { tabIndex: 0 }, children: [
76
+ /* @__PURE__ */ jsx("div", { children: "item 0" }),
77
+ /* @__PURE__ */ jsx("div", { children: "item 1" })
78
+ ] })
79
+ ] });
80
+ var typescript_virtual_list_valid_default = ExampleUsageComponent;
81
+ export {
82
+ typescript_virtual_list_valid_default as default
83
+ };
84
+ //# sourceMappingURL=typescript-virtual-list-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-virtual-list-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiBV,SAgFX,UAhFW,KAiGT,YAjGS;AAdb,SAAS,qBAAqB;AAa9B,MAAM,oBAAiD;AAAA,EACrD,UAAU,CAAC,oBAAC,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,oBAAC,SAAY,sBAAJ,GAAU,GAAQ,oBAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EAC/D;AACF;AAEA,MAAM,gCAAgC;AAAA,EACpC,UAAU,CAAC,oBAAC,SAAY,sBAAJ,GAAU,GAAQ,oBAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EAC/D;AACF;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU,CAAC,oBAAC,SAAY,sBAAJ,GAAU,GAAQ,oBAAC,SAAY,sBAAJ,GAAU,CAAM;AACjE;AAEA,MAAM,wBAA8C;AAAA,EAClD,UAAU,CAAC,oBAAC,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,oBAAC,SAAY,sBAAJ,GAAU,CAAM;AAAA,EACpC,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,cAAc;AAChB;AAEA,MAAM,2BAAiD;AAAA,EACrD,UAAU,CAAC,oBAAC,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,iCAEE;AAAA,sBAAC,iBAAe,GAAG,wBAAwB;AAAA,EAC3C,oBAAC,iBAAe,GAAG,+BAA+B;AAAA,EAClD,oBAAC,iBAAe,GAAG,uBAAuB;AAAA,EAC1C,oBAAC,iBAAe,GAAG,uBAAuB;AAAA,EAC1C,oBAAC,iBAAe,GAAG,0BAA0B;AAAA,EAC7C,oBAAC,iBAAe,GAAG,sBAAsB;AAAA,EAIzC,oBAAC,iBAAc,WAAU,gBAAe,IAAG,aAAY,cAAW,eAAc,eAAY,iBACzF,WAAC,oBAAC,SAAY,sBAAJ,GAAU,CAAM,GAC7B;AAAA,EAIA,qBAAC,iBACC;AAAA,wBAAC,SAAI,oBAAM;AAAA,IACX,oBAAC,SAAI,oBAAM;AAAA,KACb;AAAA,EAGA,qBAAC,iBAAc,WAAsB,mBAAmB,EAAE,UAAU,EAAE,GACpE;AAAA,wBAAC,SAAI,oBAAM;AAAA,IACX,oBAAC,SAAI,oBAAM;AAAA,KACb;AAAA,GACF;AAGF,IAAO,wCAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ export declare const DSVirtualListName = "DSVirtuallist";
2
+ export declare const DSVirtualListSlots: {
3
+ readonly ROOT: "root";
4
+ readonly LIST_WRAPPER: "list-wrapper";
5
+ readonly ITEM_WRAPPER: "item-wrapper";
6
+ };
7
+ export declare const DSVirtualListDataTestIds: {
8
+ ROOT: string;
9
+ LIST_WRAPPER: "ds-virtuallist-list-wrapper";
10
+ ITEM_WRAPPER: "ds-virtuallist-item-wrapper";
11
+ };
@@ -1,3 +1,3 @@
1
1
  export { type DSVirtualListT } from './react-desc-prop-types.js';
2
2
  export { DSVirtualList, DSVirtualListWithSchema } from './VirtualList.js';
3
- export { DSVirtualListName, DSVirtualListSlots } from './DSVirtualListDefinitions.js';
3
+ export { DSVirtualListName, DSVirtualListSlots, DSVirtualListDataTestIds } from './constants/index.js';
@@ -1,6 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
3
- import { DSVirtualListName, DSVirtualListSlots } from './DSVirtualListDefinitions.js';
3
+ import type { GlobalAttributesT } from '@elliemae/ds-props-helpers';
4
+ import { DSVirtualListName, DSVirtualListSlots } from './constants/index.js';
4
5
  export declare namespace DSVirtualListT {
5
6
  type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';
6
7
  type ScrollToOptions = {
@@ -8,6 +9,14 @@ export declare namespace DSVirtualListT {
8
9
  };
9
10
  type ActionRef = {
10
11
  scrollTo?: (index: number, options?: ScrollToOptions | undefined) => void;
12
+ measure?: () => void;
13
+ getVisibleItems?: () => number[];
14
+ getMountedItems?: () => number[];
15
+ };
16
+ type SlotFunctionArguments = {
17
+ dsVirtuallistRoot: () => object;
18
+ dsVirtuallistListWrapper: () => object;
19
+ dsVirtuallistItemWrapper: () => object;
11
20
  };
12
21
  interface RequiredProps {
13
22
  children: React.ReactNode;
@@ -15,11 +24,11 @@ export declare namespace DSVirtualListT {
15
24
  interface DefaultProps {
16
25
  }
17
26
  interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSVirtualListName, typeof DSVirtualListSlots> {
18
- actionRef: React.MutableRefObject<ActionRef>;
27
+ actionRef?: React.MutableRefObject<ActionRef>;
19
28
  }
20
- interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
29
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof RequiredProps>, RequiredProps {
21
30
  }
22
- interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
31
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof RequiredProps>, RequiredProps {
23
32
  }
24
33
  }
25
34
  export declare const defaultProps: DSVirtualListT.DefaultProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-virtual-list",
3
- "version": "3.80.0-next.2",
3
+ "version": "3.80.0-next.20",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Virtual List",
6
6
  "files": [
@@ -36,17 +36,18 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
+ "@elliemae/ds-props-helpers": "3.80.0-next.20",
40
+ "@elliemae/ds-system": "3.80.0-next.20",
41
+ "@elliemae/ds-typescript-helpers": "3.80.0-next.20",
39
42
  "@tanstack/react-virtual": "3.13.18",
40
- "uid": "^2.0.2",
41
- "@elliemae/ds-props-helpers": "3.80.0-next.2",
42
- "@elliemae/ds-system": "3.80.0-next.2",
43
- "@elliemae/ds-typescript-helpers": "3.80.0-next.2"
43
+ "uid": "^2.0.2"
44
44
  },
45
45
  "devDependencies": {
46
+ "@elliemae/ds-monorepo-devops": "3.80.0-next.20",
47
+ "@elliemae/ds-test-utils": "3.80.0-next.20",
48
+ "@playwright/experimental-ct-react": "1.61.1",
46
49
  "jest": "^30.0.0",
47
- "styled-components": "~5.3.11",
48
- "@elliemae/ds-monorepo-devops": "3.80.0-next.2",
49
- "@elliemae/ds-test-utils": "3.80.0-next.2"
50
+ "styled-components": "~5.3.11"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "lodash-es": "^4.18.1",
@@ -59,7 +60,7 @@
59
60
  "typeSafety": true
60
61
  },
61
62
  "scripts": {
62
- "test": "ds-monorepo-devops test --passWithNoTests --coverage=\"false\"",
63
+ "test": "playwright test -c ./playwright.config.mjs && ds-monorepo-devops test --passWithNoTests --coverage=\"false\"",
63
64
  "lint": "node ../../../scripts/lint.mjs --fix",
64
65
  "lint:strict": "node ../../../scripts/lint-strict.mjs",
65
66
  "dts": "node ../../../scripts/dts.mjs",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSVirtualListDefinitions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export const DSVirtualListName = 'DSVirtuallist';\n\nexport const DSVirtualListSlots = {\n ROOT: 'root',\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,cAAc;AAAA,EACd,cAAc;AAChB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
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
- }
package/dist/cjs/props.js DELETED
@@ -1,58 +0,0 @@
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_es = require("lodash-es");
37
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
- const actionRef = {
39
- scrollTo: import_ds_props_helpers.PropTypes.func.description("Scroll to a index inside the list")
40
- };
41
- const DSVirtualListSchema = {
42
- children: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.node).description("Children list").defaultValue([]),
43
- actionRef: import_ds_props_helpers.PropTypes.shape({
44
- current: import_ds_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_es.noop
55
- }
56
- }
57
- };
58
- //# sourceMappingURL=props.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { noop } from 'lodash-es';\nimport { PropTypes } from '@elliemae/ds-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,uBAAqB;AACrB,8BAA0B;AAE1B,MAAM,YAAY;AAAA,EAChB,UAAU,kCAAU,KAAK,YAAY,mCAAmC;AAC1E;AACO,MAAM,sBAAsB;AAAA,EACjC,UAAU,kCAAU,QAAQ,kCAAU,IAAI,EAAE,YAAY,eAAe,EAAE,aAAa,CAAC,CAAC;AAAA,EACxF,WAAW,kCAAU,MAAM;AAAA,IACzB,SAAS,kCAAU,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
- }
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- const DSVirtualListName = "DSVirtuallist";
3
- const DSVirtualListSlots = {
4
- ROOT: "root",
5
- LIST_WRAPPER: "list-wrapper",
6
- ITEM_WRAPPER: "item-wrapper"
7
- };
8
- export {
9
- DSVirtualListName,
10
- DSVirtualListSlots
11
- };
12
- //# sourceMappingURL=DSVirtualListDefinitions.js.map
@@ -1,7 +0,0 @@
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\nexport const DSVirtualListSlots = {\n ROOT: 'root',\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,cAAc;AAAA,EACd,cAAc;AAChB;",
6
- "names": []
7
- }
@@ -1,8 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }
package/dist/esm/props.js DELETED
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import { noop } from "lodash-es";
3
- import { PropTypes } from "@elliemae/ds-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
@@ -1,7 +0,0 @@
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-es';\nimport { PropTypes } from '@elliemae/ds-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
- }
@@ -1,6 +0,0 @@
1
- export declare const DSVirtualListName = "DSVirtuallist";
2
- export declare const DSVirtualListSlots: {
3
- ROOT: string;
4
- LIST_WRAPPER: string;
5
- ITEM_WRAPPER: string;
6
- };