@payloadcms/ui 3.32.0-internal.ef3356b → 3.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/elements/Autosave/index.d.ts.map +1 -1
  2. package/dist/elements/Autosave/index.js +20 -42
  3. package/dist/elements/Autosave/index.js.map +1 -1
  4. package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
  5. package/dist/elements/RelationshipTable/index.js +3 -1
  6. package/dist/elements/RelationshipTable/index.js.map +1 -1
  7. package/dist/elements/SortHeader/index.d.ts +8 -0
  8. package/dist/elements/SortHeader/index.d.ts.map +1 -0
  9. package/dist/elements/SortHeader/index.js +135 -0
  10. package/dist/elements/SortHeader/index.js.map +1 -0
  11. package/dist/elements/SortHeader/index.scss +52 -0
  12. package/dist/elements/SortRow/index.d.ts +4 -0
  13. package/dist/elements/SortRow/index.d.ts.map +1 -0
  14. package/dist/elements/SortRow/index.js +35 -0
  15. package/dist/elements/SortRow/index.js.map +1 -0
  16. package/dist/elements/SortRow/index.scss +22 -0
  17. package/dist/elements/Table/OrderableTable.d.ts +11 -0
  18. package/dist/elements/Table/OrderableTable.d.ts.map +1 -0
  19. package/dist/elements/Table/OrderableTable.js +162 -0
  20. package/dist/elements/Table/OrderableTable.js.map +1 -0
  21. package/dist/exports/client/index.js +23 -23
  22. package/dist/exports/client/index.js.map +3 -3
  23. package/dist/fields/Array/index.d.ts.map +1 -1
  24. package/dist/fields/Array/index.js +46 -50
  25. package/dist/fields/Array/index.js.map +1 -1
  26. package/dist/fields/Blocks/index.d.ts.map +1 -1
  27. package/dist/fields/Blocks/index.js +46 -50
  28. package/dist/fields/Blocks/index.js.map +1 -1
  29. package/dist/forms/Form/fieldReducer.d.ts.map +1 -1
  30. package/dist/forms/Form/fieldReducer.js +21 -8
  31. package/dist/forms/Form/fieldReducer.js.map +1 -1
  32. package/dist/forms/Form/index.d.ts.map +1 -1
  33. package/dist/forms/Form/index.js +29 -14
  34. package/dist/forms/Form/index.js.map +1 -1
  35. package/dist/forms/Form/initContextState.d.ts.map +1 -1
  36. package/dist/forms/Form/initContextState.js +1 -0
  37. package/dist/forms/Form/initContextState.js.map +1 -1
  38. package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
  39. package/dist/forms/Form/mergeServerFormState.js +15 -6
  40. package/dist/forms/Form/mergeServerFormState.js.map +1 -1
  41. package/dist/forms/Form/types.d.ts +5 -0
  42. package/dist/forms/Form/types.d.ts.map +1 -1
  43. package/dist/forms/Form/types.js.map +1 -1
  44. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
  45. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +0 -2
  46. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
  47. package/dist/hooks/useQueues.d.ts +34 -1
  48. package/dist/hooks/useQueues.d.ts.map +1 -1
  49. package/dist/hooks/useQueues.js +44 -28
  50. package/dist/hooks/useQueues.js.map +1 -1
  51. package/dist/icons/Sort/index.d.ts +9 -0
  52. package/dist/icons/Sort/index.d.ts.map +1 -0
  53. package/dist/icons/Sort/index.js +38 -0
  54. package/dist/icons/Sort/index.js.map +1 -0
  55. package/dist/icons/Sort/index.scss +14 -0
  56. package/dist/providers/ListQuery/index.d.ts.map +1 -1
  57. package/dist/providers/ListQuery/index.js +3 -1
  58. package/dist/providers/ListQuery/index.js.map +1 -1
  59. package/dist/providers/ListQuery/types.d.ts +2 -0
  60. package/dist/providers/ListQuery/types.d.ts.map +1 -1
  61. package/dist/providers/ListQuery/types.js.map +1 -1
  62. package/dist/styles.css +1 -1
  63. package/dist/utilities/buildTableState.d.ts +0 -1
  64. package/dist/utilities/buildTableState.d.ts.map +1 -1
  65. package/dist/utilities/buildTableState.js +3 -1
  66. package/dist/utilities/buildTableState.js.map +1 -1
  67. package/dist/utilities/getClientConfig.d.ts.map +1 -1
  68. package/dist/utilities/getClientConfig.js +10 -8
  69. package/dist/utilities/getClientConfig.js.map +1 -1
  70. package/dist/utilities/renderTable.d.ts +3 -1
  71. package/dist/utilities/renderTable.d.ts.map +1 -1
  72. package/dist/utilities/renderTable.js +30 -1
  73. package/dist/utilities/renderTable.js.map +1 -1
  74. package/dist/views/List/index.scss +6 -0
  75. package/package.json +5 -5
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import React from 'react';
6
+ import { DragHandleIcon } from '../../icons/DragHandle/index.js';
7
+ import './index.scss';
8
+ import { useListQuery } from '../../providers/ListQuery/index.js';
9
+ const baseClass = 'sort-row';
10
+ export const SortRow = () => {
11
+ const $ = _c(2);
12
+ const {
13
+ orderableFieldName,
14
+ query
15
+ } = useListQuery();
16
+ const isActive = query.sort === orderableFieldName || query.sort === `-${orderableFieldName}`;
17
+ const t0 = `${baseClass} ${isActive ? "active" : ""}`;
18
+ let t1;
19
+ if ($[0] !== t0) {
20
+ t1 = _jsx("div", {
21
+ className: t0,
22
+ role: "button",
23
+ tabIndex: 0,
24
+ children: _jsx(DragHandleIcon, {
25
+ className: `${baseClass}__icon`
26
+ })
27
+ });
28
+ $[0] = t0;
29
+ $[1] = t1;
30
+ } else {
31
+ t1 = $[1];
32
+ }
33
+ return t1;
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["c","_c","React","DragHandleIcon","useListQuery","baseClass","SortRow","$","orderableFieldName","query","isActive","sort","t0","t1","_jsx","className","role","tabIndex","children"],"sources":["../../../src/elements/SortRow/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport { DragHandleIcon } from '../../icons/DragHandle/index.js'\nimport './index.scss'\nimport { useListQuery } from '../../providers/ListQuery/index.js'\n\nconst baseClass = 'sort-row'\n\nexport const SortRow = () => {\n const { orderableFieldName, query } = useListQuery()\n const isActive = query.sort === orderableFieldName || query.sort === `-${orderableFieldName}`\n\n return (\n <div className={`${baseClass} ${isActive ? 'active' : ''}`} role=\"button\" tabIndex={0}>\n <DragHandleIcon className={`${baseClass}__icon`} />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAElB,SAASC,cAAc,QAAQ;AAC/B,OAAO;AACP,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,OAAA,GAAUA,CAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EACrB;IAAAO,kBAAA;IAAAC;EAAA,IAAsCL,YAAA;EACtC,MAAAM,QAAA,GAAiBD,KAAA,CAAAE,IAAA,KAAeH,kBAAA,IAAsBC,KAAA,CAAAE,IAAA,KAAe,IAAIH,kBAAA,EAAoB;EAG3E,MAAAI,EAAA,MAAAP,SAAA,IAAgBK,QAAA,GAAW,WAAW,IAAI;EAAA,IAAAG,EAAA;EAAA,IAAAN,CAAA,QAAAK,EAAA;IAA1DC,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EAAeH,EAA0C;MAAAI,IAAA,EAAO;MAAAC,QAAA;MAAAC,QAAA,EAC/DJ,IAAA,CAAAX,cAAA;QAAAY,SAAA,EAA2B,GAAAV,SAAA;MAAoB,C;;;;;;;SADjDQ,E;CAIJ","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ @import '../../scss/styles.scss';
2
+
3
+ @layer payload-default {
4
+ .sort-row {
5
+ opacity: 0.3;
6
+ cursor: not-allowed;
7
+
8
+ &.active {
9
+ cursor: grab;
10
+ opacity: 1;
11
+ }
12
+
13
+ &__icon {
14
+ height: 22px;
15
+ width: 22px;
16
+ margin-left: -2px;
17
+ margin-top: -2px;
18
+ display: block;
19
+ width: min-content;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,11 @@
1
+ import type { ClientCollectionConfig, Column } from 'payload';
2
+ import './index.scss';
3
+ import React from 'react';
4
+ export type Props = {
5
+ readonly appearance?: 'condensed' | 'default';
6
+ readonly collection: ClientCollectionConfig;
7
+ readonly columns?: Column[];
8
+ readonly data: Record<string, unknown>[];
9
+ };
10
+ export declare const OrderableTable: React.FC<Props>;
11
+ //# sourceMappingURL=OrderableTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderableTable.d.ts","sourceRoot":"","sources":["../../../src/elements/Table/OrderableTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAyB,MAAM,SAAS,CAAA;AAEpF,OAAO,cAAc,CAAA;AAErB,OAAO,KAA8B,MAAM,OAAO,CAAA;AASlD,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAA;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+K1C,CAAA"}
@@ -0,0 +1,162 @@
1
+ 'use client';
2
+
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import './index.scss';
5
+ import React, { useEffect, useState } from 'react';
6
+ import { toast } from 'sonner';
7
+ import { useListQuery } from '../../providers/ListQuery/index.js';
8
+ import { DraggableSortableItem } from '../DraggableSortable/DraggableSortableItem/index.js';
9
+ import { DraggableSortable } from '../DraggableSortable/index.js';
10
+ const baseClass = 'table';
11
+ export const OrderableTable = ({
12
+ appearance = 'default',
13
+ collection,
14
+ columns,
15
+ data: initialData
16
+ }) => {
17
+ const {
18
+ data: listQueryData,
19
+ handleSortChange,
20
+ orderableFieldName,
21
+ query
22
+ } = useListQuery();
23
+ // Use the data from ListQueryProvider if available, otherwise use the props
24
+ const serverData = listQueryData?.docs || initialData;
25
+ // Local state to track the current order of rows
26
+ const [localData, setLocalData] = useState(serverData);
27
+ // id -> index for each column
28
+ const [cellMap, setCellMap] = useState({});
29
+ // Update local data when server data changes
30
+ useEffect(() => {
31
+ setLocalData(serverData);
32
+ setCellMap(Object.fromEntries(serverData.map((item, index) => [String(item.id ?? item._id), index])));
33
+ }, [serverData]);
34
+ const activeColumns = columns?.filter(col => col?.active);
35
+ if (!activeColumns || activeColumns.filter(col_0 => !['_dragHandle', '_select'].includes(col_0.accessor)).length === 0) {
36
+ return /*#__PURE__*/_jsx("div", {
37
+ children: "No columns selected"
38
+ });
39
+ }
40
+ const handleDragEnd = async ({
41
+ moveFromIndex,
42
+ moveToIndex
43
+ }) => {
44
+ if (query.sort !== orderableFieldName && query.sort !== `-${orderableFieldName}`) {
45
+ toast.warning('To reorder the rows you must first sort them by the "Order" column');
46
+ return;
47
+ }
48
+ if (moveFromIndex === moveToIndex) {
49
+ return;
50
+ }
51
+ const movedId = localData[moveFromIndex].id ?? localData[moveFromIndex]._id;
52
+ const newBeforeRow = moveToIndex > moveFromIndex ? localData[moveToIndex] : localData[moveToIndex - 1];
53
+ const newAfterRow = moveToIndex > moveFromIndex ? localData[moveToIndex + 1] : localData[moveToIndex];
54
+ // Store the original data for rollback
55
+ const previousData = [...localData];
56
+ // Optimisitc update of local state to reorder the rows
57
+ setLocalData(currentData => {
58
+ const newData = [...currentData];
59
+ // Update the rendered cell for the moved row to show "pending"
60
+ newData[moveFromIndex][orderableFieldName] = `pending`;
61
+ // Move the item in the array
62
+ newData.splice(moveToIndex, 0, newData.splice(moveFromIndex, 1)[0]);
63
+ return newData;
64
+ });
65
+ try {
66
+ const target = newBeforeRow ? {
67
+ id: newBeforeRow.id ?? newBeforeRow._id,
68
+ key: newBeforeRow[orderableFieldName]
69
+ } : {
70
+ id: newAfterRow.id ?? newAfterRow._id,
71
+ key: newAfterRow[orderableFieldName]
72
+ };
73
+ const newKeyWillBe = newBeforeRow && query.sort === orderableFieldName || !newBeforeRow && query.sort === `-${orderableFieldName}` ? 'greater' : 'less';
74
+ const jsonBody = {
75
+ collectionSlug: collection.slug,
76
+ docsToMove: [movedId],
77
+ newKeyWillBe,
78
+ orderableFieldName,
79
+ target
80
+ };
81
+ const response = await fetch(`/api/reorder`, {
82
+ body: JSON.stringify(jsonBody),
83
+ headers: {
84
+ 'Content-Type': 'application/json'
85
+ },
86
+ method: 'POST'
87
+ });
88
+ if (response.status === 403) {
89
+ throw new Error('You do not have permission to reorder these rows');
90
+ }
91
+ if (!response.ok) {
92
+ throw new Error('Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.');
93
+ }
94
+ } catch (err) {
95
+ const error = err instanceof Error ? err.message : String(err);
96
+ // Rollback to previous state if the request fails
97
+ setLocalData(previousData);
98
+ toast.error(error);
99
+ }
100
+ };
101
+ const rowIds = localData.map(row => row.id ?? row._id);
102
+ return /*#__PURE__*/_jsx("div", {
103
+ className: [baseClass, appearance && `${baseClass}--appearance-${appearance}`].filter(Boolean).join(' '),
104
+ children: /*#__PURE__*/_jsx(DraggableSortable, {
105
+ ids: rowIds,
106
+ onDragEnd: handleDragEnd,
107
+ children: /*#__PURE__*/_jsxs("table", {
108
+ cellPadding: "0",
109
+ cellSpacing: "0",
110
+ children: [/*#__PURE__*/_jsx("thead", {
111
+ children: /*#__PURE__*/_jsx("tr", {
112
+ children: activeColumns.map((col_1, i) => /*#__PURE__*/_jsx("th", {
113
+ id: `heading-${col_1.accessor}`,
114
+ children: col_1.Heading
115
+ }, i))
116
+ })
117
+ }), /*#__PURE__*/_jsx("tbody", {
118
+ children: localData.map((row_0, rowIndex) => /*#__PURE__*/_jsx(DraggableSortableItem, {
119
+ id: rowIds[rowIndex],
120
+ children: ({
121
+ attributes,
122
+ listeners,
123
+ setNodeRef,
124
+ transform,
125
+ transition
126
+ }) => /*#__PURE__*/_jsx("tr", {
127
+ className: `row-${rowIndex + 1}`,
128
+ ref: setNodeRef,
129
+ style: {
130
+ transform,
131
+ transition
132
+ },
133
+ children: activeColumns.map((col_2, colIndex) => {
134
+ const {
135
+ accessor
136
+ } = col_2;
137
+ // Use the cellMap to find which index in the renderedCells to use
138
+ const cell = col_2.renderedCells[cellMap[row_0.id ?? row_0._id]];
139
+ // For drag handles, wrap in div with drag attributes
140
+ if (accessor === '_dragHandle') {
141
+ return /*#__PURE__*/_jsx("td", {
142
+ className: `cell-${accessor}`,
143
+ children: /*#__PURE__*/_jsx("div", {
144
+ ...attributes,
145
+ ...listeners,
146
+ children: cell
147
+ })
148
+ }, colIndex);
149
+ }
150
+ return /*#__PURE__*/_jsx("td", {
151
+ className: `cell-${accessor}`,
152
+ children: cell
153
+ }, colIndex);
154
+ })
155
+ })
156
+ }, rowIds[rowIndex]))
157
+ })]
158
+ })
159
+ })
160
+ });
161
+ };
162
+ //# sourceMappingURL=OrderableTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderableTable.js","names":["React","useEffect","useState","toast","useListQuery","DraggableSortableItem","DraggableSortable","baseClass","OrderableTable","appearance","collection","columns","data","initialData","listQueryData","handleSortChange","orderableFieldName","query","serverData","docs","localData","setLocalData","cellMap","setCellMap","Object","fromEntries","map","item","index","String","id","_id","activeColumns","filter","col","active","includes","accessor","length","_jsx","handleDragEnd","moveFromIndex","moveToIndex","sort","warning","movedId","newBeforeRow","newAfterRow","previousData","currentData","newData","splice","target","key","newKeyWillBe","jsonBody","collectionSlug","slug","docsToMove","response","fetch","body","JSON","stringify","headers","method","status","Error","ok","err","error","message","rowIds","row","className","Boolean","join","ids","onDragEnd","_jsxs","cellPadding","cellSpacing","i","Heading","rowIndex","children","attributes","listeners","setNodeRef","transform","transition","ref","style","colIndex","cell","renderedCells"],"sources":["../../../src/elements/Table/OrderableTable.tsx"],"sourcesContent":["'use client'\n\nimport type { ClientCollectionConfig, Column, OrderableEndpointBody } from 'payload'\n\nimport './index.scss'\n\nimport React, { useEffect, useState } from 'react'\nimport { toast } from 'sonner'\n\nimport { useListQuery } from '../../providers/ListQuery/index.js'\nimport { DraggableSortableItem } from '../DraggableSortable/DraggableSortableItem/index.js'\nimport { DraggableSortable } from '../DraggableSortable/index.js'\n\nconst baseClass = 'table'\n\nexport type Props = {\n readonly appearance?: 'condensed' | 'default'\n readonly collection: ClientCollectionConfig\n readonly columns?: Column[]\n readonly data: Record<string, unknown>[]\n}\n\nexport const OrderableTable: React.FC<Props> = ({\n appearance = 'default',\n collection,\n columns,\n data: initialData,\n}) => {\n const { data: listQueryData, handleSortChange, orderableFieldName, query } = useListQuery()\n // Use the data from ListQueryProvider if available, otherwise use the props\n const serverData = listQueryData?.docs || initialData\n\n // Local state to track the current order of rows\n const [localData, setLocalData] = useState(serverData)\n\n // id -> index for each column\n const [cellMap, setCellMap] = useState<Record<string, number>>({})\n\n // Update local data when server data changes\n useEffect(() => {\n setLocalData(serverData)\n setCellMap(\n Object.fromEntries(serverData.map((item, index) => [String(item.id ?? item._id), index])),\n )\n }, [serverData])\n\n const activeColumns = columns?.filter((col) => col?.active)\n\n if (\n !activeColumns ||\n activeColumns.filter((col) => !['_dragHandle', '_select'].includes(col.accessor)).length === 0\n ) {\n return <div>No columns selected</div>\n }\n\n const handleDragEnd = async ({ moveFromIndex, moveToIndex }) => {\n if (query.sort !== orderableFieldName && query.sort !== `-${orderableFieldName}`) {\n toast.warning('To reorder the rows you must first sort them by the \"Order\" column')\n return\n }\n\n if (moveFromIndex === moveToIndex) {\n return\n }\n\n const movedId = localData[moveFromIndex].id ?? localData[moveFromIndex]._id\n const newBeforeRow =\n moveToIndex > moveFromIndex ? localData[moveToIndex] : localData[moveToIndex - 1]\n const newAfterRow =\n moveToIndex > moveFromIndex ? localData[moveToIndex + 1] : localData[moveToIndex]\n\n // Store the original data for rollback\n const previousData = [...localData]\n\n // Optimisitc update of local state to reorder the rows\n setLocalData((currentData) => {\n const newData = [...currentData]\n // Update the rendered cell for the moved row to show \"pending\"\n newData[moveFromIndex][orderableFieldName] = `pending`\n // Move the item in the array\n newData.splice(moveToIndex, 0, newData.splice(moveFromIndex, 1)[0])\n return newData\n })\n\n try {\n const target: OrderableEndpointBody['target'] = newBeforeRow\n ? {\n id: newBeforeRow.id ?? newBeforeRow._id,\n key: newBeforeRow[orderableFieldName],\n }\n : {\n id: newAfterRow.id ?? newAfterRow._id,\n key: newAfterRow[orderableFieldName],\n }\n\n const newKeyWillBe =\n (newBeforeRow && query.sort === orderableFieldName) ||\n (!newBeforeRow && query.sort === `-${orderableFieldName}`)\n ? 'greater'\n : 'less'\n\n const jsonBody: OrderableEndpointBody = {\n collectionSlug: collection.slug,\n docsToMove: [movedId],\n newKeyWillBe,\n orderableFieldName,\n target,\n }\n\n const response = await fetch(`/api/reorder`, {\n body: JSON.stringify(jsonBody),\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n })\n\n if (response.status === 403) {\n throw new Error('You do not have permission to reorder these rows')\n }\n\n if (!response.ok) {\n throw new Error(\n 'Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.',\n )\n }\n } catch (err) {\n const error = err instanceof Error ? err.message : String(err)\n // Rollback to previous state if the request fails\n setLocalData(previousData)\n toast.error(error)\n }\n }\n\n const rowIds = localData.map((row) => row.id ?? row._id)\n\n return (\n <div\n className={[baseClass, appearance && `${baseClass}--appearance-${appearance}`]\n .filter(Boolean)\n .join(' ')}\n >\n <DraggableSortable ids={rowIds} onDragEnd={handleDragEnd}>\n <table cellPadding=\"0\" cellSpacing=\"0\">\n <thead>\n <tr>\n {activeColumns.map((col, i) => (\n <th id={`heading-${col.accessor}`} key={i}>\n {col.Heading}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {localData.map((row, rowIndex) => (\n <DraggableSortableItem id={rowIds[rowIndex]} key={rowIds[rowIndex]}>\n {({ attributes, listeners, setNodeRef, transform, transition }) => (\n <tr\n className={`row-${rowIndex + 1}`}\n ref={setNodeRef}\n style={{\n transform,\n transition,\n }}\n >\n {activeColumns.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[row.id ?? row._id]]\n\n // For drag handles, wrap in div with drag attributes\n if (accessor === '_dragHandle') {\n return (\n <td className={`cell-${accessor}`} key={colIndex}>\n <div {...attributes} {...listeners}>\n {cell}\n </div>\n </td>\n )\n }\n\n return (\n <td className={`cell-${accessor}`} key={colIndex}>\n {cell}\n </td>\n )\n })}\n </tr>\n )}\n </DraggableSortableItem>\n ))}\n </tbody>\n </table>\n </DraggableSortable>\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAIA,OAAO;AAEP,OAAOA,KAAA,IAASC,SAAS,EAAEC,QAAQ,QAAQ;AAC3C,SAASC,KAAK,QAAQ;AAEtB,SAASC,YAAY,QAAQ;AAC7B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,SAAA,GAAY;AASlB,OAAO,MAAMC,cAAA,GAAkCA,CAAC;EAC9CC,UAAA,GAAa,SAAS;EACtBC,UAAU;EACVC,OAAO;EACPC,IAAA,EAAMC;AAAW,CAClB;EACC,MAAM;IAAED,IAAA,EAAME,aAAa;IAAEC,gBAAgB;IAAEC,kBAAkB;IAAEC;EAAK,CAAE,GAAGb,YAAA;EAC7E;EACA,MAAMc,UAAA,GAAaJ,aAAA,EAAeK,IAAA,IAAQN,WAAA;EAE1C;EACA,MAAM,CAACO,SAAA,EAAWC,YAAA,CAAa,GAAGnB,QAAA,CAASgB,UAAA;EAE3C;EACA,MAAM,CAACI,OAAA,EAASC,UAAA,CAAW,GAAGrB,QAAA,CAAiC,CAAC;EAEhE;EACAD,SAAA,CAAU;IACRoB,YAAA,CAAaH,UAAA;IACbK,UAAA,CACEC,MAAA,CAAOC,WAAW,CAACP,UAAA,CAAWQ,GAAG,CAAC,CAACC,IAAA,EAAMC,KAAA,KAAU,CAACC,MAAA,CAAOF,IAAA,CAAKG,EAAE,IAAIH,IAAA,CAAKI,GAAG,GAAGH,KAA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