@object-ui/plugin-grid 0.5.0 → 2.0.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @object-ui/plugin-grid@0.5.0 build /home/runner/work/objectui/objectui/packages/plugin-grid
2
+ > @object-ui/plugin-grid@2.0.0 build /home/runner/work/objectui/objectui/packages/plugin-grid
3
3
  > vite build
4
4
 
5
5
  vite v7.3.1 building client environment for production...
@@ -8,14 +8,23 @@ transforming...
8
8
  rendering chunks...
9
9
  
10
10
  [vite:dts] Start generate declaration files...
11
+ src/__tests__/VirtualGrid.test.tsx:23:11 - error TS7034: Variable 'items' implicitly has type 'any[]' in some locations where its type cannot be determined.
12
+
13
+ 23 const items = [];
14
+    ~~~~~
15
+ src/__tests__/VirtualGrid.test.tsx:28:30 - error TS7005: Variable 'items' implicitly has an 'any[]' type.
16
+
17
+ 28 getVirtualItems: () => items,
18
+    ~~~~~
19
+
11
20
  computing gzip size...
12
- dist/index.js 41.83 kB │ gzip: 11.61 kB
13
- [vite:dts] Declaration files built in 14001ms.
21
+ dist/index.js 46.25 kB │ gzip: 12.47 kB
22
+ [vite:dts] Declaration files built in 19381ms.
14
23
  
15
24
  No name was provided for external module "@object-ui/core" in "output.globals" – guessing "core".
16
25
  No name was provided for external module "@object-ui/react" in "output.globals" – guessing "react".
17
26
  No name was provided for external module "@object-ui/fields" in "output.globals" – guessing "fields".
18
27
  No name was provided for external module "@object-ui/components" in "output.globals" – guessing "components".
19
28
  No name was provided for external module "lucide-react" in "output.globals" – guessing "lucideReact".
20
- dist/index.umd.cjs 29.43 kB │ gzip: 10.19 kB
21
- ✓ built in 14.99s
29
+ dist/index.umd.cjs 32.06 kB │ gzip: 10.88 kB
30
+ ✓ built in 20.59s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @object-ui/plugin-grid
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - b859617: Release v1.0.0 — unify all package versions to 1.0.0
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [b859617]
12
+ - @object-ui/types@2.0.0
13
+ - @object-ui/core@2.0.0
14
+ - @object-ui/react@2.0.0
15
+ - @object-ui/components@2.0.0
16
+ - @object-ui/fields@2.0.0
17
+
3
18
  ## 0.3.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -244,6 +244,103 @@ const schema = {
244
244
  };
245
245
  ```
246
246
 
247
+ ### Inline Editing
248
+
249
+ Enable inline cell editing for quick updates:
250
+
251
+ ```typescript
252
+ const schema = {
253
+ type: 'object-grid',
254
+ objectName: 'users',
255
+ columns: [
256
+ { header: 'ID', accessorKey: 'id', editable: false }, // Read-only column
257
+ { header: 'Name', accessorKey: 'name' }, // Editable
258
+ { header: 'Email', accessorKey: 'email' }, // Editable
259
+ { header: 'Status', accessorKey: 'status' } // Editable
260
+ ],
261
+ editable: true, // Enable editing globally
262
+ onCellChange: (rowIndex, columnKey, newValue, row) => {
263
+ console.log(`Cell at row ${rowIndex}, column ${columnKey} changed to:`, newValue);
264
+ console.log('Full row data:', row);
265
+ // Update your data source here
266
+ // Example: await dataSource.update(row.id, { [columnKey]: newValue });
267
+ }
268
+ };
269
+ ```
270
+
271
+ **Inline Editing Features:**
272
+ - **Double-click to edit**: Double-click any editable cell to enter edit mode
273
+ - **Keyboard shortcuts**:
274
+ - Press `Enter` on a focused cell to start editing
275
+ - Press `Enter` while editing to save changes
276
+ - Press `Escape` to cancel editing
277
+ - **Column-level control**: Set `editable: false` on specific columns to prevent editing
278
+ - **Visual feedback**: Editable cells show hover state to indicate they can be edited
279
+ - **Automatic focus**: Input field is automatically focused and selected when entering edit mode
280
+
281
+ **Use Cases:**
282
+ - Quick data corrections
283
+ - Batch data entry
284
+ - Spreadsheet-like editing experience
285
+ - Real-time updates with backend synchronization
286
+
287
+ ### Batch Editing & Multi-Row Save
288
+
289
+ Edit multiple cells across multiple rows and save them individually or all at once:
290
+
291
+ ```typescript
292
+ const schema = {
293
+ type: 'object-grid',
294
+ objectName: 'products',
295
+ columns: [
296
+ { header: 'SKU', accessorKey: 'sku', editable: false },
297
+ { header: 'Name', accessorKey: 'name' },
298
+ { header: 'Price', accessorKey: 'price' },
299
+ { header: 'Stock', accessorKey: 'stock' }
300
+ ],
301
+ editable: true,
302
+ rowActions: true, // Show row-level save/cancel buttons
303
+ onRowSave: async (rowIndex, changes, row) => {
304
+ // Save a single row
305
+ console.log('Saving row:', rowIndex, changes);
306
+ await dataSource.update(row.id, changes);
307
+ },
308
+ onBatchSave: async (allChanges) => {
309
+ // Save all modified rows at once
310
+ console.log('Batch saving:', allChanges);
311
+ await Promise.all(
312
+ allChanges.map(({ row, changes }) =>
313
+ dataSource.update(row.id, changes)
314
+ )
315
+ );
316
+ }
317
+ };
318
+ ```
319
+
320
+ **Batch Editing Features:**
321
+ - **Pending changes tracking**: Edit multiple cells across multiple rows before saving
322
+ - **Visual indicators**:
323
+ - Modified rows are highlighted with amber background
324
+ - Modified cells are shown in bold with amber text
325
+ - Toolbar shows count of modified rows
326
+ - **Row-level actions**: Save or cancel changes for individual rows
327
+ - **Batch operations**:
328
+ - "Save All" button to save all modified rows at once
329
+ - "Cancel All" button to discard all pending changes
330
+ - **Flexible callbacks**:
331
+ - `onRowSave`: Called when saving a single row
332
+ - `onBatchSave`: Called when saving multiple rows at once
333
+ - `onCellChange`: Still called for immediate cell updates (legacy support)
334
+
335
+ **Example Workflow:**
336
+ 1. User edits multiple cells across different rows
337
+ 2. Modified rows are visually highlighted
338
+ 3. Toolbar shows "X rows modified" with Save All/Cancel All buttons
339
+ 4. User can:
340
+ - Save individual rows using row-level save button
341
+ - Save all changes at once using "Save All" button
342
+ - Cancel individual row changes or all changes
343
+
247
344
  ## TypeScript Support
248
345
 
249
346
  ```typescript