jupyterlab_tabular_data_viewer_extension 1.2.17 → 1.2.19
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/lib/index.js +3 -1
- package/lib/widget.js +5 -7
- package/package.json +1 -1
- package/src/index.ts +3 -1
- package/src/widget.ts +5 -7
package/lib/index.js
CHANGED
|
@@ -73,7 +73,9 @@ const plugin = {
|
|
|
73
73
|
},
|
|
74
74
|
execute: async () => {
|
|
75
75
|
if (lastContextMenuRow) {
|
|
76
|
-
|
|
76
|
+
// Filter out internal metadata fields before copying
|
|
77
|
+
const { __row_index__, ...rowData } = lastContextMenuRow;
|
|
78
|
+
const jsonString = JSON.stringify(rowData, null, 2);
|
|
77
79
|
await navigator.clipboard.writeText(jsonString);
|
|
78
80
|
// console.log('Row copied to clipboard as JSON');
|
|
79
81
|
// Clean up highlight after copy
|
package/lib/widget.js
CHANGED
|
@@ -261,9 +261,7 @@ export class TabularDataViewer extends Widget {
|
|
|
261
261
|
if (reset) {
|
|
262
262
|
this._totalRows = response.totalRows;
|
|
263
263
|
}
|
|
264
|
-
|
|
265
|
-
const startingRowNumber = this._data.length - response.data.length + 1;
|
|
266
|
-
this._renderData(response.data, startingRowNumber);
|
|
264
|
+
this._renderData(response.data);
|
|
267
265
|
this._updateStatusBar();
|
|
268
266
|
}
|
|
269
267
|
catch (error) {
|
|
@@ -377,14 +375,14 @@ export class TabularDataViewer extends Widget {
|
|
|
377
375
|
/**
|
|
378
376
|
* Render data rows
|
|
379
377
|
*/
|
|
380
|
-
_renderData(rows
|
|
381
|
-
rows.forEach((row
|
|
378
|
+
_renderData(rows) {
|
|
379
|
+
rows.forEach((row) => {
|
|
382
380
|
const tr = document.createElement('tr');
|
|
383
381
|
tr.className = 'jp-TabularDataViewer-row';
|
|
384
|
-
// Add row number cell
|
|
382
|
+
// Add row number cell using original row index from backend
|
|
385
383
|
const rowNumCell = document.createElement('td');
|
|
386
384
|
rowNumCell.className = 'jp-TabularDataViewer-cell jp-TabularDataViewer-rowNumberCell';
|
|
387
|
-
rowNumCell.textContent = String(
|
|
385
|
+
rowNumCell.textContent = String(row['__row_index__'] || '');
|
|
388
386
|
tr.appendChild(rowNumCell);
|
|
389
387
|
this._columns.forEach(col => {
|
|
390
388
|
const td = document.createElement('td');
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -120,7 +120,9 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
120
120
|
},
|
|
121
121
|
execute: async () => {
|
|
122
122
|
if (lastContextMenuRow) {
|
|
123
|
-
|
|
123
|
+
// Filter out internal metadata fields before copying
|
|
124
|
+
const { __row_index__, ...rowData } = lastContextMenuRow;
|
|
125
|
+
const jsonString = JSON.stringify(rowData, null, 2);
|
|
124
126
|
await navigator.clipboard.writeText(jsonString);
|
|
125
127
|
// console.log('Row copied to clipboard as JSON');
|
|
126
128
|
|
package/src/widget.ts
CHANGED
|
@@ -292,9 +292,7 @@ export class TabularDataViewer extends Widget {
|
|
|
292
292
|
this._totalRows = response.totalRows;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
|
|
296
|
-
const startingRowNumber = this._data.length - response.data.length + 1;
|
|
297
|
-
this._renderData(response.data, startingRowNumber);
|
|
295
|
+
this._renderData(response.data);
|
|
298
296
|
this._updateStatusBar();
|
|
299
297
|
} catch (error) {
|
|
300
298
|
this._showError(`Failed to load data: ${error}`);
|
|
@@ -426,15 +424,15 @@ export class TabularDataViewer extends Widget {
|
|
|
426
424
|
/**
|
|
427
425
|
* Render data rows
|
|
428
426
|
*/
|
|
429
|
-
private _renderData(rows: any[]
|
|
430
|
-
rows.forEach((row
|
|
427
|
+
private _renderData(rows: any[]): void {
|
|
428
|
+
rows.forEach((row) => {
|
|
431
429
|
const tr = document.createElement('tr');
|
|
432
430
|
tr.className = 'jp-TabularDataViewer-row';
|
|
433
431
|
|
|
434
|
-
// Add row number cell
|
|
432
|
+
// Add row number cell using original row index from backend
|
|
435
433
|
const rowNumCell = document.createElement('td');
|
|
436
434
|
rowNumCell.className = 'jp-TabularDataViewer-cell jp-TabularDataViewer-rowNumberCell';
|
|
437
|
-
rowNumCell.textContent = String(
|
|
435
|
+
rowNumCell.textContent = String(row['__row_index__'] || '');
|
|
438
436
|
tr.appendChild(rowNumCell);
|
|
439
437
|
|
|
440
438
|
this._columns.forEach(col => {
|