react-base-data-table 0.5.3 → 0.5.8
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/README.md +105 -254
- package/dist/index.cjs.js +22 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7469 -7179
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/types/App.d.ts +0 -3
- package/dist/types/DUMMY_ITEMS.d.ts +0 -6
- package/dist/types/components/BaseButton.d.ts +0 -19
- package/dist/types/components/BaseCheckbox.d.ts +0 -11
- package/dist/types/components/BaseIcon.d.ts +0 -11
- package/dist/types/components/BaseTable/BaseTable.d.ts +0 -50
- package/dist/types/components/BaseTable/BaseTableFooter.d.ts +0 -10
- package/dist/types/components/BaseTable/BaseTableGroupRow.d.ts +0 -15
- package/dist/types/components/BaseTable/BaseTableHeader.d.ts +0 -13
- package/dist/types/components/BaseTable/BaseTableHeaders.d.ts +0 -15
- package/dist/types/components/BaseTable/BaseTableRow.d.ts +0 -12
- package/dist/types/components/BaseTable/BaseTableWithContext.d.ts +0 -3
- package/dist/types/components/BaseTable/CommentPopup.d.ts +0 -15
- package/dist/types/components/BaseTable/CustomRenderItem.d.ts +0 -12
- package/dist/types/components/BaseTable/contextMenu/ContextMenu.d.ts +0 -13
- package/dist/types/components/BaseTable/contextMenu/actions/cellActions.d.ts +0 -6
- package/dist/types/components/BaseTable/contextMenu/actions/headerActions.d.ts +0 -5
- package/dist/types/components/BaseTable/contextMenu/actions/index.d.ts +0 -2
- package/dist/types/components/BaseTable/contexts/useTableInteractionContext.d.ts +0 -11
- package/dist/types/components/BaseTable/dialogs/DialogWrapper.d.ts +0 -6
- package/dist/types/components/BaseTable/dialogs/columnsDialog/ChartDialog.d.ts +0 -7
- package/dist/types/components/BaseTable/dialogs/columnsDialog/ColumnsDialog.d.ts +0 -2
- package/dist/types/components/BaseTable/dialogs/columnsDialog/DragPreview.d.ts +0 -5
- package/dist/types/components/BaseTable/dialogs/columnsDialog/HeaderItem.d.ts +0 -20
- package/dist/types/components/BaseTable/hooks/useCellPopup.d.ts +0 -16
- package/dist/types/components/BaseTable/hooks/useRowDragDrop.d.ts +0 -16
- package/dist/types/components/BaseTable/hooks/useTableGrouping.d.ts +0 -14
- package/dist/types/components/BaseTable/hooks/useTableInteractions.d.ts +0 -59
- package/dist/types/components/BaseTable/hooks/useVirtualRows.d.ts +0 -11
- package/dist/types/components/BaseTable/models/ActiveTableFilter.d.ts +0 -6
- package/dist/types/components/BaseTable/models/AdvancedTableSettings.d.ts +0 -27
- package/dist/types/components/BaseTable/models/BaseTableHeaders.d.ts +0 -38
- package/dist/types/components/BaseTable/models/CellCordinate.d.ts +0 -8
- package/dist/types/components/BaseTable/models/CommentData.d.ts +0 -10
- package/dist/types/components/BaseTable/models/ContextMenu.d.ts +0 -10
- package/dist/types/components/BaseTable/models/ContextMenuAction.d.ts +0 -12
- package/dist/types/components/BaseTable/models/DialogItem.d.ts +0 -15
- package/dist/types/components/BaseTable/models/GroupInfo.d.ts +0 -7
- package/dist/types/components/BaseTable/models/HighlightCondition.d.ts +0 -7
- package/dist/types/components/BaseTable/models/ItemWithGroupInfo.d.ts +0 -7
- package/dist/types/components/BaseTable/models/LinkedGroup.d.ts +0 -4
- package/dist/types/components/BaseTable/models/TableConfiguration.d.ts +0 -4
- package/dist/types/components/BaseTable/models/TableItem.d.ts +0 -4
- package/dist/types/components/BaseTable/tableCell/BaseTableCell.d.ts +0 -21
- package/dist/types/components/BaseTable/tableCell/IndexCell.d.ts +0 -8
- package/dist/types/components/BaseTable/tableCell/baseTableCellFunctions.d.ts +0 -16
- package/dist/types/components/BaseTable/tableCell/cellImplementation/ListCell.d.ts +0 -13
- package/dist/types/components/BaseTable/tableCell/cellImplementation/NumberCell.d.ts +0 -11
- package/dist/types/components/BaseTable/tableCell/cellImplementation/OptionList.d.ts +0 -11
- package/dist/types/components/BaseTable/tableCell/cellImplementation/formatNumberFunctions.d.ts +0 -1
- package/dist/types/components/BaseTable/tableFilter/FilterDropdown.d.ts +0 -13
- package/dist/types/components/BaseTable/tableFilter/TableFilter.d.ts +0 -17
- package/dist/types/components/BaseTable/tableFilter/filterImplementations/NumberFilter/NumberConditionItem.d.ts +0 -10
- package/dist/types/components/BaseTable/tableFilter/filterImplementations/NumberFilter/NumberFilter.d.ts +0 -16
- package/dist/types/components/BaseTable/tableFilter/filterImplementations/TextFilter.d.ts +0 -9
- package/dist/types/components/BaseTable/tableFunctions/CellSelection.d.ts +0 -10
- package/dist/types/components/BaseTable/tableFunctions/FilteringAndSorting.d.ts +0 -7
- package/dist/types/components/BaseTable/tableFunctions/highlightCondition.d.ts +0 -5
- package/dist/types/components/ColorPicker.d.ts +0 -7
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/enum/DateUnits.d.ts +0 -8
- package/dist/types/enum/FilterTypes.d.ts +0 -4
- package/dist/types/hooks/useClickOutside.d.ts +0 -2
- package/dist/types/index.d.ts +0 -7
- package/dist/types/main.d.ts +0 -1
- package/dist/types/stores/clipboardStore.d.ts +0 -24
- package/dist/types/stores/commentPopupStore.d.ts +0 -13
- package/dist/types/stores/contextMenuStore.d.ts +0 -13
- package/dist/types/stores/dialogsStore.d.ts +0 -21
- package/dist/types/stores/tableDataStore.d.ts +0 -99
- package/dist/types/stores/tableDragStore.d.ts +0 -17
- package/dist/types/stores/tableRefStore.d.ts +0 -17
- package/dist/types/stores/tableSelectionStore.d.ts +0 -23
- package/dist/types/utils/array.d.ts +0 -6
- package/dist/types/utils/cellCoordinates.d.ts +0 -3
- package/dist/types/utils/cellIdCreation.d.ts +0 -3
- package/dist/types/utils/cellOverlapping.d.ts +0 -6
- package/dist/types/utils/enum.d.ts +0 -3
- package/dist/types/utils/sorting.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @redevilkz/react-base-table
|
|
2
2
|
|
|
3
|
-
A simple, customizable, and extensible React table component with support for sorting, filtering, grouping, row highlighting, custom rendering, drag-and-drop, and context menus.
|
|
3
|
+
A simple, customizable, and extensible React table component with support for sorting, filtering, grouping, row highlighting, custom rendering, drag-and-drop, collaboration, and context menus.
|
|
4
|
+
|
|
5
|
+
> 📖 **A detailed documentation website is coming soon!**
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -13,48 +15,38 @@ A simple, customizable, and extensible React table component with support for so
|
|
|
13
15
|
- **Custom Rendering**: Render custom content in headers and cells.
|
|
14
16
|
- **Drag & Drop**: Reorder rows with drag-and-drop (optional).
|
|
15
17
|
- **Context Menu**: Right-click on cells to open a customizable context menu.
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
+
- **Collaboration**: Real-time multi-user cell selection display.
|
|
19
|
+
- **Comments**: Add comments to cells.
|
|
20
|
+
- **Inline Editing**: Edit cell values directly in the table.
|
|
18
21
|
- **Theming**: Easily style with Tailwind and DaisyUI classes.
|
|
19
22
|
|
|
20
23
|
---
|
|
21
24
|
|
|
22
25
|
## Installation
|
|
23
26
|
|
|
24
|
-
Install the package via npm or yarn:
|
|
25
|
-
|
|
26
27
|
```bash
|
|
27
28
|
npm install react-base-data-table
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
or
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
yarn add react-base-data-table
|
|
34
|
-
```
|
|
35
|
-
|
|
36
31
|
---
|
|
37
32
|
|
|
38
33
|
## Usage
|
|
39
34
|
|
|
40
|
-
Import the `BaseTable` component and its CSS:
|
|
41
|
-
|
|
42
35
|
```javascript
|
|
43
36
|
import { BaseTable } from "react-base-data-table";
|
|
44
|
-
import "react-base-data-table/style.css";
|
|
45
37
|
```
|
|
46
38
|
|
|
47
39
|
### Basic Example
|
|
48
40
|
|
|
49
41
|
```jsx
|
|
50
42
|
const headers = [
|
|
51
|
-
{ id: "name", text: "Name",
|
|
52
|
-
{ id: "age", text: "Age",
|
|
43
|
+
{ id: "name", text: "Name", sortable: true },
|
|
44
|
+
{ id: "age", text: "Age", sortable: true },
|
|
53
45
|
];
|
|
54
46
|
|
|
55
47
|
const items = [
|
|
56
|
-
{ name: "John Doe", age:
|
|
57
|
-
{ name: "Jane Smith", age:
|
|
48
|
+
{ name: "John Doe", age: 30 },
|
|
49
|
+
{ name: "Jane Smith", age: 25 },
|
|
58
50
|
];
|
|
59
51
|
|
|
60
52
|
<BaseTable headers={headers} items={items} />;
|
|
@@ -66,247 +58,106 @@ const items = [
|
|
|
66
58
|
|
|
67
59
|
### `BaseTableProps`
|
|
68
60
|
|
|
69
|
-
| Prop
|
|
70
|
-
|
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
61
|
+
| Prop | Type | Description |
|
|
62
|
+
| ---------------------------- | -------------------------------------------------- | --------------------------------------------------------- |
|
|
63
|
+
| `headers` | `BaseTableHeader[]` | Column definitions for the table (required). |
|
|
64
|
+
| `items` | `TableItem[]` | Data items to display (required). |
|
|
65
|
+
| `height` | `string` | Table height. |
|
|
66
|
+
| `advancedSettings` | `AdvancedTableSettings` | Additional table configuration options. |
|
|
67
|
+
| `highlightCondition` | `HighlightCondition[]` | Conditions for highlighting rows/cells. |
|
|
68
|
+
| `comments` | `CommentData[]` | Comments data for cells. |
|
|
69
|
+
| `activeFilters` | `ActiveTableFilter[]` | Active column filters. |
|
|
70
|
+
| `groupBy` | `string` | Column ID to group rows by. |
|
|
71
|
+
| `linkedGroups` | `LinkedGroup[]` | Configuration for linked group behavior. |
|
|
72
|
+
| `collaboration` | `CollaborationConfig` | Real-time collaboration settings. |
|
|
73
|
+
| `onUserSelectionChange` | `(data: UserSelectionData) => void` | Callback when user selection changes (for collaboration). |
|
|
74
|
+
| `onSetHighlightCondition` | `(condition, item) => void` | Callback to set highlight condition. |
|
|
75
|
+
| `onRemoveHighlightCondition` | `(condition, cssProperty, item) => void` | Callback to remove highlight condition. |
|
|
76
|
+
| `onSaveComment` | `(comment, item) => void` | Callback when a comment is saved. |
|
|
77
|
+
| `onDeleteComment` | `(comment, item) => void` | Callback when a comment is deleted. |
|
|
78
|
+
| `onChange` | `(itemUpdated, originalIndex, fromArray?) => void` | Callback when a cell value changes. |
|
|
79
|
+
| `onBulkChange` | `(items, headerId?) => void` | Callback for bulk cell changes. |
|
|
80
|
+
| `onBulkFieldChange` | `(items, headerId) => void` | Callback for bulk field changes on a column. |
|
|
81
|
+
| `groupByCustomRender` | `(groupBy, value, ...) => ReactNode` | Custom render function for group rows. |
|
|
82
|
+
| `onResetSort` | `() => void` | Callback to reset sorting. |
|
|
83
|
+
| `onRowDoubleClick` | `(item) => void` | Callback when a row is double-clicked. |
|
|
84
|
+
| `onSortByColumn` | `(columnId) => void` | Callback when sorting by a column. |
|
|
85
|
+
| `onAddListOption` | `(newOption, header) => void` | Callback when adding a new list option. |
|
|
86
|
+
| `onRowsReordered` | `(fromIndex, toIndex) => void` | Callback when rows are reordered via drag & drop. |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `AdvancedTableSettings`
|
|
91
|
+
|
|
92
|
+
| Property | Type | Description |
|
|
93
|
+
| ----------------------- | -------------------------------- | ------------------------------------------- |
|
|
94
|
+
| `marginTop` | `string` | Top margin for the table. |
|
|
95
|
+
| `noBorder` | `boolean` | Removes the table border. |
|
|
96
|
+
| `pinColumns` | `boolean` | Pins columns for horizontal scrolling. |
|
|
97
|
+
| `alignCenterInLine` | `boolean` | Centers content within rows. |
|
|
98
|
+
| `currentSortId` | `string` | ID of the currently sorted column. |
|
|
99
|
+
| `contextMenu` | `{ showOnHeader?, showOnCell? }` | Context menu visibility options. |
|
|
100
|
+
| `contrastRow` | `boolean` | Alternates row background colors. |
|
|
101
|
+
| `indexUseOriginalOrder` | `boolean` | Uses original item order for index column. |
|
|
102
|
+
| `enableRowDragDrop` | `boolean` | Enables row drag & drop reordering. |
|
|
103
|
+
| `currentUsername` | `string` | Current user's username. |
|
|
104
|
+
| `showIndex` | `boolean` | Shows an index column. |
|
|
105
|
+
| `selectNewOptionOnAdd` | `boolean` | Auto-selects new option when added to list. |
|
|
106
|
+
| `canAddListOptions` | `boolean` | Allows adding new options to list columns. |
|
|
107
|
+
| `showFooter` | `boolean` | Shows table footer. |
|
|
108
|
+
| `rowIdProperty` | `string` | Property to use as unique row identifier. |
|
|
109
|
+
| `tableId` | `string` | Unique table identifier. |
|
|
110
|
+
| `focusedRowIndex` | `number` | Index of the focused row. |
|
|
111
|
+
| `showFlashOnCellUpdate` | `boolean` | Shows flash animation on cell updates. |
|
|
112
|
+
| `disabledRows` | `{ property, values }` | Disables rows matching property values. |
|
|
90
113
|
|
|
91
114
|
---
|
|
92
115
|
|
|
93
|
-
## Header Definition
|
|
94
|
-
|
|
95
116
|
### `BaseTableHeader`
|
|
96
117
|
|
|
97
|
-
| Property
|
|
98
|
-
|
|
|
99
|
-
| `id`
|
|
100
|
-
| `text`
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<BaseTable
|
|
141
|
-
headers={headers}
|
|
142
|
-
items={items}
|
|
143
|
-
highlightCondition={highlightCondition}
|
|
144
|
-
/>;
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
### 2. **Custom Cell Rendering**
|
|
150
|
-
|
|
151
|
-
Customize cell content using `customRender`:
|
|
152
|
-
|
|
153
|
-
```jsx
|
|
154
|
-
const headers = [
|
|
155
|
-
{
|
|
156
|
-
id: "name",
|
|
157
|
-
text: "Name",
|
|
158
|
-
customRender: (item) => <strong>{item.name}</strong>,
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
### 3. **Sorting**
|
|
166
|
-
|
|
167
|
-
Handle sorting logic with the `onSortByColumn` callback:
|
|
168
|
-
|
|
169
|
-
```jsx
|
|
170
|
-
const handleSort = (columnId) => {
|
|
171
|
-
console.log(`Sorting by column: ${columnId}`);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
<BaseTable headers={headers} items={items} onSortByColumn={handleSort} />;
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 4. **Grouping Rows**
|
|
180
|
-
|
|
181
|
-
Group rows by a column and allow collapsing:
|
|
182
|
-
|
|
183
|
-
```jsx
|
|
184
|
-
<BaseTable
|
|
185
|
-
headers={headers}
|
|
186
|
-
items={items}
|
|
187
|
-
groupBy="department" // group by the 'department' column
|
|
188
|
-
/>
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### 5. **Drag & Drop Rows**
|
|
194
|
-
|
|
195
|
-
Enable drag-and-drop row reordering:
|
|
196
|
-
|
|
197
|
-
```jsx
|
|
198
|
-
<BaseTable headers={headers} items={items} enableRowDragDrop={true} />
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
### 6. **Context Menu**
|
|
204
|
-
|
|
205
|
-
Show a custom context menu on right-click:
|
|
206
|
-
|
|
207
|
-
```jsx
|
|
208
|
-
<BaseTable
|
|
209
|
-
headers={headers}
|
|
210
|
-
items={items}
|
|
211
|
-
contextMenuActions={[
|
|
212
|
-
{ label: "Edit", onClick: (item) => editItem(item) },
|
|
213
|
-
{ label: "Delete", onClick: (item) => deleteItem(item) },
|
|
214
|
-
]}
|
|
215
|
-
/>
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
### 7. **Inline Editing**
|
|
221
|
-
|
|
222
|
-
Allow editing cell values directly in the table by setting `editOptions` in headers.
|
|
223
|
-
|
|
224
|
-
```jsx
|
|
225
|
-
const headers = [
|
|
226
|
-
{
|
|
227
|
-
id: "age",
|
|
228
|
-
text: "Age",
|
|
229
|
-
editOptions: {
|
|
230
|
-
editable: true,
|
|
231
|
-
required: true,
|
|
232
|
-
type: "number",
|
|
233
|
-
defaultValue: 0,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
];
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### 8. **Custom Header Rendering**
|
|
242
|
-
|
|
243
|
-
Render custom header content:
|
|
244
|
-
|
|
245
|
-
```jsx
|
|
246
|
-
const headers = [
|
|
247
|
-
{
|
|
248
|
-
id: "actions",
|
|
249
|
-
text: "",
|
|
250
|
-
customHeader: () => <span>Actions</span>,
|
|
251
|
-
},
|
|
252
|
-
];
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## Styling & Theming
|
|
258
|
-
|
|
259
|
-
- Uses Tailwind CSS and DaisyUI for styling.
|
|
260
|
-
- You can override styles using Tailwind utility classes or DaisyUI themes.
|
|
261
|
-
- Arbitrary values (e.g. `bg-[#f44333]`) are supported if included as static strings or added to the safelist in `tailwind.config.js`.
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## How to test the package in dev
|
|
266
|
-
|
|
267
|
-
To create the package locally.
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
npm link
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
In your test project.
|
|
274
|
-
|
|
275
|
-
```bash
|
|
276
|
-
npm link react-base-data-table
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
#OLD
|
|
280
|
-
|
|
281
|
-
Yalc emulates npm publish. It is preferred over npm link for fewer issues.
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
npm i yalc -g
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
In your package:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
yalc publish
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
In the project that wants to consume the package:
|
|
294
|
-
|
|
295
|
-
```bash
|
|
296
|
-
yalc add @redevilkz/react-base-table
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
After a rebuild in your package:
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
yalc push
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
When you change something in your library:
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
npm run buildForNPM && yalc push --sig
|
|
309
|
-
```
|
|
118
|
+
| Property | Type | Description |
|
|
119
|
+
| --------------- | ---------------------------------------------------------- | -------------------------------------------- |
|
|
120
|
+
| `id` | `string` | Unique column identifier (required). |
|
|
121
|
+
| `text` | `string` | Column header display text (required). |
|
|
122
|
+
| `hasFilter` | `boolean` | Enables filtering for the column. |
|
|
123
|
+
| `width` | `number` | Column width in pixels. |
|
|
124
|
+
| `children` | `BaseTableHeader[]` | Nested columns for grouped headers. |
|
|
125
|
+
| `editOptions` | `EditOptions` | Inline editing configuration. |
|
|
126
|
+
| `fromArray` | `string` | Property name for array-based rows. |
|
|
127
|
+
| `arrayRowsOnly` | `boolean` | Shows cell only in array rows, not main row. |
|
|
128
|
+
| `sortable` | `boolean` | Enables sorting for the column. |
|
|
129
|
+
| `align` | `'left' \| 'center' \| 'right'` | Cell content alignment. |
|
|
130
|
+
| `customSort` | `(a, b, ascending) => number` | Custom sorting function. |
|
|
131
|
+
| `customHeader` | `(header) => ReactNode` | Custom header render function. |
|
|
132
|
+
| `customRender` | `(item, header, fromArrayData?, isDisabled?) => ReactNode` | Custom cell render function. |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### `EditOptions`
|
|
137
|
+
|
|
138
|
+
| Property | Type | Description |
|
|
139
|
+
| ------------------------ | ----------------------------------- | ------------------------------------------ |
|
|
140
|
+
| `editable` | `boolean` | Enables inline editing. |
|
|
141
|
+
| `isDisabled` | `(item, fromArrayData?) => boolean` | Function to determine if cell is disabled. |
|
|
142
|
+
| `notApplicable` | `(item, fromArrayData?) => boolean` | Function to mark cell as N/A. |
|
|
143
|
+
| `greyedOutIfNotEditable` | `boolean` | Greys out non-editable cells. |
|
|
144
|
+
| `required` | `boolean` | Marks field as required. |
|
|
145
|
+
| `type` | `'string' \| 'list' \| 'number'` | Cell data type. |
|
|
146
|
+
| `options` | `string[]` | Options for list type columns. |
|
|
147
|
+
| `defaultValue` | `string \| number` | Default value for new items. |
|
|
148
|
+
| `canAddNewOption` | `boolean` | Allows adding new options to list. |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### `CollaborationConfig`
|
|
153
|
+
|
|
154
|
+
| Property | Type | Description |
|
|
155
|
+
| --------------- | --------------------- | ----------------------------------------------------- |
|
|
156
|
+
| `collaborators` | `UserSelectionData[]` | List of collaborators and their selections. |
|
|
157
|
+
| `currentUserId` | `string` | Current user's ID (to filter from display). |
|
|
158
|
+
| `debounceMs` | `number` | Debounce time for selection updates (default: 150ms). |
|
|
159
|
+
| `color` | `string` | Current user's selection color. |
|
|
160
|
+
| `version` | `number` | Collaboration data version. |
|
|
310
161
|
|
|
311
162
|
---
|
|
312
163
|
|