{"version":3,"file":"OrderableRow.js","names":["OrderableRow","cellMap","columns","dragAttributes","dragListeners","rowId","rest","_jsx","map","col","colIndex","accessor","cell","renderedCells","className"],"sources":["../../../src/elements/Table/OrderableRow.tsx"],"sourcesContent":["import type { DraggableSyntheticListeners } from '@dnd-kit/core'\nimport type { Column } from 'payload'\nimport type { HTMLAttributes, Ref } from 'react'\n\nexport type Props = {\n readonly cellMap: Record\n readonly columns: Column[]\n readonly dragAttributes?: HTMLAttributes\n readonly dragListeners?: DraggableSyntheticListeners\n readonly ref?: Ref\n readonly rowId: number | string\n} & HTMLAttributes\n\nexport const OrderableRow = ({\n cellMap,\n columns,\n dragAttributes = {},\n dragListeners = {},\n rowId,\n ...rest\n}: Props) => (\n \n {columns.map((col, colIndex) => {\n const { accessor } = col\n\n // Use the cellMap to find which index in the renderedCells to use\n const cell = col.renderedCells[cellMap[rowId]]\n\n // For drag handles, wrap in div with drag attributes\n if (accessor === '_dragHandle') {\n return (\n \n
\n {cell}\n
\n \n )\n }\n\n return (\n \n {cell}\n \n )\n })}\n \n)\n"],"mappings":";AAaA,OAAO,MAAMA,YAAA,GAAeA,CAAC;EAC3BC,OAAO;EACPC,OAAO;EACPC,cAAA,GAAiB,CAAC,CAAC;EACnBC,aAAA,GAAgB,CAAC,CAAC;EAClBC,KAAK;EACL,GAAGC;AAAA,CACG,kBACNC,IAAA,CAAC;EAAI,GAAGD,IAAI;YACTJ,OAAA,CAAQM,GAAG,CAAC,CAACC,GAAA,EAAKC,QAAA;IACjB,MAAM;MAAEC;IAAQ,CAAE,GAAGF,GAAA;IAErB;IACA,MAAMG,IAAA,GAAOH,GAAA,CAAII,aAAa,CAACZ,OAAO,CAACI,KAAA,CAAM,CAAC;IAE9C;IACA,IAAIM,QAAA,KAAa,eAAe;MAC9B,oBACEJ,IAAA,CAAC;QAAGO,SAAA,EAAW,QAAQH,QAAA,EAAU;kBAC/B,aAAAJ,IAAA,CAAC;UAAK,GAAGJ,cAAc;UAAG,GAAGC,aAAa;oBACvCQ;;SAFmCF,QAAA;IAM5C;IAEA,oBACEH,IAAA,CAAC;MAAGO,SAAA,EAAW,QAAQH,QAAA,EAAU;gBAC9BC;OADqCF,QAAA;EAI5C","ignoreList":[]}