@updog/data-editor 0.1.60 → 0.1.61
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/index.d.ts +1 -0
- package/index.js +56 -53
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2942,6 +2942,7 @@ type DataStoreSnapshot = {
|
|
|
2942
2942
|
/** Details about the in-progress operation. Null when phase is "idle". */
|
|
2943
2943
|
processing: ProcessingInfo | null;
|
|
2944
2944
|
sources: DataSourceState[];
|
|
2945
|
+
hasBaselineData: boolean;
|
|
2945
2946
|
canUndo: boolean;
|
|
2946
2947
|
canRedo: boolean;
|
|
2947
2948
|
/** Increments on undo/redo to force canvas grid re-render */
|
package/index.js
CHANGED
|
@@ -6470,6 +6470,7 @@ var Gc = class {
|
|
|
6470
6470
|
phase: "idle",
|
|
6471
6471
|
processing: null,
|
|
6472
6472
|
sources: [],
|
|
6473
|
+
hasBaselineData: !1,
|
|
6473
6474
|
canUndo: !1,
|
|
6474
6475
|
canRedo: !1,
|
|
6475
6476
|
version: 0,
|
|
@@ -6530,9 +6531,9 @@ var Gc = class {
|
|
|
6530
6531
|
return;
|
|
6531
6532
|
}
|
|
6532
6533
|
this._countsDirty && (this.recomputeVisibleCounts(e), this._filteredCountsDirty = !0), this._filteredCountsDirty && this.recomputeFilteredCounts(e);
|
|
6533
|
-
let t = e.getFilteredRowIds()?.length ?? e.getRowCount(), n = e.getPendingValidationCount(), r = e.getShowOnlyDeletedRows(), i = e.getServerDeletedCount ? e.getServerDeletedCount() : e.getDeletedCount();
|
|
6534
|
+
let t = e.getFilteredRowIds()?.length ?? e.getRowCount(), n = e.getPendingValidationCount(), r = e.getShowOnlyDeletedRows(), i = e.getServerDeletedCount ? e.getServerDeletedCount() : e.getDeletedCount(), a = r ? i : e.getRowCount(), o = e.getSources(), s = o.some((e) => e.isInitialData && e.rowCount > 0);
|
|
6534
6535
|
this.snapshot = {
|
|
6535
|
-
rowCount:
|
|
6536
|
+
rowCount: a,
|
|
6536
6537
|
filteredCount: t,
|
|
6537
6538
|
newRowCount: this._visibleNewCount,
|
|
6538
6539
|
editedRowCount: this._visibleEditedCount,
|
|
@@ -6553,7 +6554,8 @@ var Gc = class {
|
|
|
6553
6554
|
isFiltering: e.isFiltering(),
|
|
6554
6555
|
phase: this._phase,
|
|
6555
6556
|
processing: this._processingInfo,
|
|
6556
|
-
sources:
|
|
6557
|
+
sources: o,
|
|
6558
|
+
hasBaselineData: s,
|
|
6557
6559
|
canUndo: e.canUndo(),
|
|
6558
6560
|
canRedo: e.canRedo(),
|
|
6559
6561
|
version: e.getVersion(),
|
|
@@ -11902,18 +11904,18 @@ var fd = [3, 2], pd = .8, md = .5, hd = 1500;
|
|
|
11902
11904
|
//#endregion
|
|
11903
11905
|
//#region src/components/DataEditor/DataEditorGrid/engine/paint/FrameState.ts
|
|
11904
11906
|
function gd(e) {
|
|
11905
|
-
let { controller: t, layout: n, viewport: r, store: i, columns: a } = e, o = t.selection, s = t.clipboard.getClipboardOperation(), c = t.clipboard.getClipboardBounds(), l = i.getSnapshot().filteredCount,
|
|
11906
|
-
start:
|
|
11907
|
-
end:
|
|
11908
|
-
},
|
|
11909
|
-
start:
|
|
11910
|
-
end:
|
|
11911
|
-
},
|
|
11912
|
-
if (
|
|
11907
|
+
let { controller: t, layout: n, viewport: r, store: i, columns: a } = e, o = t.selection, s = t.clipboard.getClipboardOperation(), c = t.clipboard.getClipboardBounds(), l = i.getSnapshot(), u = l.filteredCount, d = r.getVisibleRowRange(u), f = {
|
|
11908
|
+
start: d.start,
|
|
11909
|
+
end: d.end
|
|
11910
|
+
}, p = r.getVisibleColRange(n, a.length), m = {
|
|
11911
|
+
start: p.start,
|
|
11912
|
+
end: p.end
|
|
11913
|
+
}, h = n.pinnedCount, g = null;
|
|
11914
|
+
if (h > 0) {
|
|
11913
11915
|
let e = n.getPinnedWidth(), t = n.contentToCanvasX(76, e);
|
|
11914
|
-
|
|
11916
|
+
g = {
|
|
11915
11917
|
colStart: 0,
|
|
11916
|
-
colEnd:
|
|
11918
|
+
colEnd: h,
|
|
11917
11919
|
scrollLeft: 0,
|
|
11918
11920
|
clip: {
|
|
11919
11921
|
x: t,
|
|
@@ -11939,10 +11941,10 @@ function gd(e) {
|
|
|
11939
11941
|
findReplace: e.findReplace,
|
|
11940
11942
|
time: e.time,
|
|
11941
11943
|
resizeGuideX: e.resizeGuideX,
|
|
11942
|
-
totalRows:
|
|
11944
|
+
totalRows: u,
|
|
11943
11945
|
totalWidth: n.getTotalWidth(),
|
|
11944
|
-
rowRange:
|
|
11945
|
-
colRange:
|
|
11946
|
+
rowRange: f,
|
|
11947
|
+
colRange: m,
|
|
11946
11948
|
selection: o.getSnapshot(),
|
|
11947
11949
|
rowSelected: (e) => o.isRowSelected(e),
|
|
11948
11950
|
rowHighlighted: (e) => o.isRowHighlighted(e),
|
|
@@ -11958,17 +11960,18 @@ function gd(e) {
|
|
|
11958
11960
|
searchLength: e.findReplace?.getSearchLength() ?? 0,
|
|
11959
11961
|
panes: {
|
|
11960
11962
|
scrollable: {
|
|
11961
|
-
colStart:
|
|
11962
|
-
colEnd:
|
|
11963
|
+
colStart: m.start,
|
|
11964
|
+
colEnd: m.end,
|
|
11963
11965
|
scrollLeft: r.scrollLeft,
|
|
11964
11966
|
clip: null,
|
|
11965
11967
|
shimmerWidth: r.viewportWidth,
|
|
11966
11968
|
shimmerOffsetX: 0
|
|
11967
11969
|
},
|
|
11968
|
-
pinned:
|
|
11970
|
+
pinned: g
|
|
11969
11971
|
},
|
|
11970
11972
|
hasSkeletons: !1,
|
|
11971
|
-
hasPendingCells: !1
|
|
11973
|
+
hasPendingCells: !1,
|
|
11974
|
+
hasBaselineData: l.hasBaselineData
|
|
11972
11975
|
};
|
|
11973
11976
|
}
|
|
11974
11977
|
function _d(e, t, n) {
|
|
@@ -12185,26 +12188,26 @@ var Od = class {
|
|
|
12185
12188
|
}
|
|
12186
12189
|
}, kd = class {
|
|
12187
12190
|
paint(e) {
|
|
12188
|
-
let { ctx: t, theme: n, layout: r, viewport: i, textCache: a, store: o, rowRange: s } = e, { scrollTop:
|
|
12189
|
-
t.fillStyle = n.markerBgIdle, Vu(t,
|
|
12191
|
+
let { ctx: t, theme: n, layout: r, viewport: i, textCache: a, store: o, rowRange: s, hasBaselineData: c } = e, { scrollTop: l, viewportHeight: u } = i, d = r.rtl, f = r.getMarkerCanvasX(), p = o.getFilters().showOnlyDeletedRows;
|
|
12192
|
+
t.fillStyle = n.markerBgIdle, Vu(t, f, 36, 76, u - 36);
|
|
12190
12193
|
for (let i = s.start; i < s.end; i++) {
|
|
12191
|
-
let s = r.getRowY(i,
|
|
12192
|
-
if (e.rowSelected(i) ? (t.fillStyle = n.markerBgSelected, Vu(t,
|
|
12193
|
-
let e =
|
|
12194
|
-
if (o.hasRowErrors(
|
|
12195
|
-
else if (!
|
|
12194
|
+
let s = r.getRowY(i, l), u = o.getRowId(i);
|
|
12195
|
+
if (e.rowSelected(i) ? (t.fillStyle = n.markerBgSelected, Vu(t, f, s, 76, 34)) : e.rowHighlighted(i) && (t.fillStyle = n.markerBgActive, Vu(t, f, s, 76, 34)), u !== void 0) {
|
|
12196
|
+
let e = d ? f : 73;
|
|
12197
|
+
if (o.hasRowErrors(u)) t.fillStyle = n.statusBarBgError, Vu(t, e, s, 3, 34);
|
|
12198
|
+
else if (!p && o.hasRowMisplaced(u)) {
|
|
12196
12199
|
let r = Uu(e + 3 / 2, 0, 3).x;
|
|
12197
12200
|
t.strokeStyle = n.cellBorderMisplaced, t.lineWidth = 3, t.setLineDash(fd), t.beginPath(), t.moveTo(r, s), t.lineTo(r, s + 34), t.stroke(), t.setLineDash([]);
|
|
12198
|
-
} else o.isEdited(
|
|
12201
|
+
} else o.isEdited(u) ? (t.fillStyle = n.statusBarBgEdited, Vu(t, e, s, 3, 34)) : c && o.isNew(u) ? (t.fillStyle = n.statusBarBgNew, Vu(t, e, s, 3, 34)) : o.hasEmptyCells(u) && (t.fillStyle = n.statusBarBgEmpty, Vu(t, e, s, 3, 34));
|
|
12199
12202
|
}
|
|
12200
|
-
t.font = n.font, t.fillStyle = n.markerContentIdle, Ku(t, String(i + 1),
|
|
12203
|
+
t.font = n.font, t.fillStyle = n.markerContentIdle, Ku(t, String(i + 1), f + 76 / 2, s + 34 / 2 + 2, 58, a, "center");
|
|
12201
12204
|
}
|
|
12202
12205
|
t.strokeStyle = n.cellBorderIdle, t.lineWidth = 1, t.beginPath();
|
|
12203
|
-
let
|
|
12204
|
-
t.moveTo(
|
|
12206
|
+
let m = d ? Uu(f, 0, 1).x : Uu(76, 0, 1).x;
|
|
12207
|
+
t.moveTo(m, 36), t.lineTo(m, u);
|
|
12205
12208
|
for (let e = s.start; e <= s.end; e++) {
|
|
12206
|
-
let n = Uu(0, r.getRowY(e,
|
|
12207
|
-
t.moveTo(
|
|
12209
|
+
let n = Uu(0, r.getRowY(e, l), 1).y;
|
|
12210
|
+
t.moveTo(f, n), t.lineTo(f + 76, n);
|
|
12208
12211
|
}
|
|
12209
12212
|
t.stroke();
|
|
12210
12213
|
}
|
|
@@ -20628,21 +20631,21 @@ var $_ = {
|
|
|
20628
20631
|
})
|
|
20629
20632
|
});
|
|
20630
20633
|
}, pv = () => {
|
|
20631
|
-
let { store: e, scrollToGridTop: t, filtersResetKey: n, enableDeleteRow: r } = X(), { t: i } = K(), { filteredNewRowCount: a, filteredEditedRowCount: o, filteredEmptyRowCount: s, misplacedRowCount: c, deletedRowCount: l } = Vo(e), [
|
|
20634
|
+
let { store: e, scrollToGridTop: t, filtersResetKey: n, enableDeleteRow: r } = X(), { t: i } = K(), { filteredNewRowCount: a, filteredEditedRowCount: o, filteredEmptyRowCount: s, misplacedRowCount: c, deletedRowCount: l, hasBaselineData: u } = Vo(e), [d, p] = b(() => e.getFilters().showOnlyEditedRows), [h, g] = b(() => e.getFilters().showOnlyNewRows), [_, v] = b(() => e.getFilters().showOnlyEmptyCells), [y, x] = b(() => e.getFilters().showOnlyMisplacedRows), [S, T] = b(() => e.getFilters().showOnlyDeletedRows);
|
|
20632
20635
|
m(() => {
|
|
20633
20636
|
let t = e.getFilters();
|
|
20634
|
-
|
|
20637
|
+
p(t.showOnlyEditedRows), g(t.showOnlyNewRows), v(t.showOnlyEmptyCells), x(t.showOnlyMisplacedRows), T(t.showOnlyDeletedRows);
|
|
20635
20638
|
}, [n, e]);
|
|
20636
|
-
let
|
|
20637
|
-
|
|
20638
|
-
}, [t, e]), E = f((n) => {
|
|
20639
|
-
h(n), t(), e.setFilters({ showOnlyNewRows: n });
|
|
20639
|
+
let E = f((n) => {
|
|
20640
|
+
p(n), t(), e.setFilters({ showOnlyEditedRows: n });
|
|
20640
20641
|
}, [t, e]), D = f((n) => {
|
|
20641
|
-
|
|
20642
|
+
g(n), t(), e.setFilters({ showOnlyNewRows: n });
|
|
20642
20643
|
}, [t, e]), O = f((n) => {
|
|
20643
|
-
|
|
20644
|
+
v(n), t(), e.setFilters({ showOnlyEmptyCells: n });
|
|
20644
20645
|
}, [t, e]), k = f((n) => {
|
|
20645
|
-
|
|
20646
|
+
x(n), t(), e.setFilters({ showOnlyMisplacedRows: n });
|
|
20647
|
+
}, [t, e]), A = f((n) => {
|
|
20648
|
+
T(n), t(), e.setFilters({ showOnlyDeletedRows: n });
|
|
20646
20649
|
}, [t, e]);
|
|
20647
20650
|
return /* @__PURE__ */ w("div", {
|
|
20648
20651
|
className: "updog__rows-section",
|
|
@@ -20654,8 +20657,8 @@ var $_ = {
|
|
|
20654
20657
|
children: [
|
|
20655
20658
|
/* @__PURE__ */ C(fv, { filtersResetKey: n }),
|
|
20656
20659
|
/* @__PURE__ */ C(Ni, {
|
|
20657
|
-
checked:
|
|
20658
|
-
onChange:
|
|
20660
|
+
checked: d,
|
|
20661
|
+
onChange: E,
|
|
20659
20662
|
checkboxPosition: "start",
|
|
20660
20663
|
children: /* @__PURE__ */ w("div", {
|
|
20661
20664
|
className: "updog__rows-section__checkbox-label",
|
|
@@ -20669,9 +20672,9 @@ var $_ = {
|
|
|
20669
20672
|
})]
|
|
20670
20673
|
})
|
|
20671
20674
|
}),
|
|
20672
|
-
/* @__PURE__ */ C(Ni, {
|
|
20673
|
-
checked:
|
|
20674
|
-
onChange:
|
|
20675
|
+
u && /* @__PURE__ */ C(Ni, {
|
|
20676
|
+
checked: h,
|
|
20677
|
+
onChange: D,
|
|
20675
20678
|
checkboxPosition: "start",
|
|
20676
20679
|
children: /* @__PURE__ */ w("div", {
|
|
20677
20680
|
className: "updog__rows-section__checkbox-label",
|
|
@@ -20686,8 +20689,8 @@ var $_ = {
|
|
|
20686
20689
|
})
|
|
20687
20690
|
}),
|
|
20688
20691
|
/* @__PURE__ */ C(Ni, {
|
|
20689
|
-
checked:
|
|
20690
|
-
onChange:
|
|
20692
|
+
checked: _,
|
|
20693
|
+
onChange: O,
|
|
20691
20694
|
checkboxPosition: "start",
|
|
20692
20695
|
children: /* @__PURE__ */ w("div", {
|
|
20693
20696
|
className: "updog__rows-section__checkbox-label",
|
|
@@ -20702,8 +20705,8 @@ var $_ = {
|
|
|
20702
20705
|
})
|
|
20703
20706
|
}),
|
|
20704
20707
|
/* @__PURE__ */ C(Ni, {
|
|
20705
|
-
checked:
|
|
20706
|
-
onChange:
|
|
20708
|
+
checked: y,
|
|
20709
|
+
onChange: k,
|
|
20707
20710
|
checkboxPosition: "start",
|
|
20708
20711
|
children: /* @__PURE__ */ w("div", {
|
|
20709
20712
|
className: "updog__rows-section__checkbox-label",
|
|
@@ -20718,8 +20721,8 @@ var $_ = {
|
|
|
20718
20721
|
})
|
|
20719
20722
|
}),
|
|
20720
20723
|
r !== !1 && /* @__PURE__ */ C(Ni, {
|
|
20721
|
-
checked:
|
|
20722
|
-
onChange:
|
|
20724
|
+
checked: S,
|
|
20725
|
+
onChange: A,
|
|
20723
20726
|
checkboxPosition: "start",
|
|
20724
20727
|
children: /* @__PURE__ */ w("div", {
|
|
20725
20728
|
className: "updog__rows-section__checkbox-label",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updog/data-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"description": "Client-side CSV importer and spreadsheet editor for React. Import CSV, Excel, JSON, TSV, and XML, match columns, validate, and edit 1M+ rows entirely in the browser.",
|
|
5
5
|
"author": "Mikhail Kutateladze <admin@updog.tech>",
|
|
6
6
|
"homepage": "https://updog.tech",
|