@updog/data-editor 0.1.45 → 0.1.46
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 +2 -1
- package/index.js +32 -30
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -111,6 +111,7 @@ declare var export_default = {
|
|
|
111
111
|
modal: {
|
|
112
112
|
importTitle: "Import Data",
|
|
113
113
|
editTitle: "Edit Data",
|
|
114
|
+
viewTitle: "View Data",
|
|
114
115
|
},
|
|
115
116
|
confirmClose: {
|
|
116
117
|
title: "Discard changes?",
|
|
@@ -2873,7 +2874,7 @@ type RemoteSource = {
|
|
|
2873
2874
|
* - `"editor"` — opens directly into the spreadsheet grid.
|
|
2874
2875
|
* - `"uploader"` — opens the file import wizard first, then transitions to the grid.
|
|
2875
2876
|
*/
|
|
2876
|
-
type DataEditorVariant = "editor" | "uploader";
|
|
2877
|
+
type DataEditorVariant = "editor" | "uploader" | "viewer";
|
|
2877
2878
|
/** Base configuration shared by the public `DataEditorProps` and the internal provider. */
|
|
2878
2879
|
type DataEditorBaseProps<TRow extends DataEditorRow = DataEditorRow> = {
|
|
2879
2880
|
/** Column definitions. Each entry describes one column in the grid. */
|
package/index.js
CHANGED
|
@@ -97,7 +97,8 @@ var Hr = {
|
|
|
97
97
|
dataEditor: {
|
|
98
98
|
modal: {
|
|
99
99
|
importTitle: "Import Data",
|
|
100
|
-
editTitle: "Edit Data"
|
|
100
|
+
editTitle: "Edit Data",
|
|
101
|
+
viewTitle: "View Data"
|
|
101
102
|
},
|
|
102
103
|
confirmClose: {
|
|
103
104
|
title: "Discard changes?",
|
|
@@ -10296,6 +10297,7 @@ function Bl({ columns: e, primaryKey: t, loadData: n, scaleClient: r, onComplete
|
|
|
10296
10297
|
setPendingImportFile: xe,
|
|
10297
10298
|
openUploaderWithFile: Se,
|
|
10298
10299
|
variant: a ?? "editor",
|
|
10300
|
+
isViewer: a === "viewer",
|
|
10299
10301
|
search: ie,
|
|
10300
10302
|
setSearch: ae,
|
|
10301
10303
|
matchCase: oe,
|
|
@@ -10311,7 +10313,7 @@ function Bl({ columns: e, primaryKey: t, loadData: n, scaleClient: r, onComplete
|
|
|
10311
10313
|
resetScrollRef: ee,
|
|
10312
10314
|
scrollToGridTop: te,
|
|
10313
10315
|
portalRef: _e,
|
|
10314
|
-
readonly: y ?? !1,
|
|
10316
|
+
readonly: a === "viewer" ? !0 : y ?? !1,
|
|
10315
10317
|
filtersResetKey: me,
|
|
10316
10318
|
resetFilters: he,
|
|
10317
10319
|
originalColumns: e,
|
|
@@ -11584,7 +11586,7 @@ var Hu = 9, Uu = 3, Wu = [3, 2], Gu = 1, Ku = 6, qu = .8, Ju = .5, Yu = 4, Xu =
|
|
|
11584
11586
|
paintHeaderCell(e, t, n) {
|
|
11585
11587
|
let { ctx: r, theme: i, layout: a, textCache: o, columns: s, controller: c, sortState: l } = e, u = c.selection, d = a.pinnedCount, f = a.rtl, p = a.getColumnX(t, n), m = a.getColumnWidth(t), h = a.contentToCanvasX(p, m);
|
|
11586
11588
|
u.isColumnSelected(t) ? (r.fillStyle = i.headerBgSelected, vu(r, h, 0, m, 36)) : u.isColumnHighlighted(t) && (r.fillStyle = i.headerBgActive, vu(r, h, 0, m, 36));
|
|
11587
|
-
let g = s[t], _ = t < d, v = l?.columnId === g.id, y = e.store.isColumnLocked(g.id), b = 0;
|
|
11589
|
+
let g = s[t], _ = t < d, v = l?.columnId === g.id, y = !c.readonly && e.store.isColumnLocked(g.id), b = 0;
|
|
11588
11590
|
y && b++, _ && b++, v && b++;
|
|
11589
11591
|
let x = b > 0 ? b * 14 + (b - 1) * Ku + Ku : 0, S = m - Hu * 2 - x;
|
|
11590
11592
|
r.font = i.headerFont, r.fillStyle = i.headerContentIdle;
|
|
@@ -20585,39 +20587,39 @@ var Z_ = ({ text: e, onSelect: t }) => /* @__PURE__ */ C(J, {
|
|
|
20585
20587
|
/* @__PURE__ */ C(rv, {})
|
|
20586
20588
|
]
|
|
20587
20589
|
}) }), ov = () => {
|
|
20588
|
-
let { store: e, columns: t, chat: n, enableAddRow: r, readonly: i,
|
|
20589
|
-
|
|
20590
|
+
let { store: e, columns: t, chat: n, enableAddRow: r, readonly: i, isViewer: a, navigateToCell: o, importFormats: s, openUploaderWithFile: c } = X(), { rowCount: l, filteredCount: u, isLoading: d } = Bo(e), { t: p } = K(), m = !d && u === 0, h = r && !i && l === 0, g = s !== !1 && s.length > 0, _ = f(async () => {
|
|
20591
|
+
o(await Xl(e, t, p("dataEditor.dataSources.manuallyAdded")), t[0].id);
|
|
20590
20592
|
}, [
|
|
20591
20593
|
e,
|
|
20592
20594
|
t,
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
]),
|
|
20596
|
-
if (
|
|
20597
|
-
content:
|
|
20595
|
+
o,
|
|
20596
|
+
p
|
|
20597
|
+
]), y = v(() => {
|
|
20598
|
+
if (h) return {
|
|
20599
|
+
content: p("dataEditor.dataSources.addRow"),
|
|
20598
20600
|
startIcon: /* @__PURE__ */ C(Ce, { size: "1rem" }),
|
|
20599
20601
|
variant: "filled",
|
|
20600
|
-
onClick:
|
|
20602
|
+
onClick: _
|
|
20601
20603
|
};
|
|
20602
20604
|
}, [
|
|
20603
|
-
|
|
20604
|
-
|
|
20605
|
-
|
|
20606
|
-
]),
|
|
20605
|
+
h,
|
|
20606
|
+
_,
|
|
20607
|
+
p
|
|
20608
|
+
]), b = v(() => Wl(s === !1 ? [] : s), [s]), x = f((e) => {
|
|
20607
20609
|
let t = e[0];
|
|
20608
|
-
t &&
|
|
20609
|
-
}, [
|
|
20610
|
-
accept:
|
|
20610
|
+
t && c(t);
|
|
20611
|
+
}, [c]), { getRootProps: S, isDragActive: T } = ft({
|
|
20612
|
+
accept: b,
|
|
20611
20613
|
maxFiles: 1,
|
|
20612
20614
|
noClick: !0,
|
|
20613
20615
|
noKeyboard: !0,
|
|
20614
|
-
disabled: i || !
|
|
20615
|
-
onDrop:
|
|
20616
|
+
disabled: i || !g,
|
|
20617
|
+
onDrop: x
|
|
20616
20618
|
});
|
|
20617
20619
|
return /* @__PURE__ */ C(Jl, { children: /* @__PURE__ */ w("div", {
|
|
20618
|
-
...
|
|
20620
|
+
...S({ className: "updog__data-editor-inner" }),
|
|
20619
20621
|
children: [
|
|
20620
|
-
/* @__PURE__ */ C(Gl, { children: /* @__PURE__ */ C("div", {
|
|
20622
|
+
!a && /* @__PURE__ */ C(Gl, { children: /* @__PURE__ */ C("div", {
|
|
20621
20623
|
className: "updog__data-editor-aside",
|
|
20622
20624
|
children: /* @__PURE__ */ w("div", {
|
|
20623
20625
|
className: "updog__data-editor-aside__content updog__scrollbar",
|
|
@@ -20631,18 +20633,18 @@ var Z_ = ({ text: e, onSelect: t }) => /* @__PURE__ */ C(J, {
|
|
|
20631
20633
|
/* @__PURE__ */ w(Kl, { children: [
|
|
20632
20634
|
/* @__PURE__ */ w("div", {
|
|
20633
20635
|
className: "updog__data-editor-grid-area",
|
|
20634
|
-
children: [/* @__PURE__ */ C(h_, {}),
|
|
20636
|
+
children: [/* @__PURE__ */ C(h_, {}), m && /* @__PURE__ */ C(Oa, {
|
|
20635
20637
|
className: "updog-grid__empty-state",
|
|
20636
|
-
title:
|
|
20637
|
-
text:
|
|
20638
|
-
buttonProps:
|
|
20638
|
+
title: p("dataEditor.grid.emptyTitle"),
|
|
20639
|
+
text: p("dataEditor.grid.emptyText"),
|
|
20640
|
+
buttonProps: y
|
|
20639
20641
|
})]
|
|
20640
20642
|
}),
|
|
20641
20643
|
/* @__PURE__ */ C(Yl, {}),
|
|
20642
|
-
/* @__PURE__ */ C(cu, {})
|
|
20644
|
+
!a && /* @__PURE__ */ C(cu, {})
|
|
20643
20645
|
] }),
|
|
20644
|
-
|
|
20645
|
-
n && /* @__PURE__ */ C(av, {})
|
|
20646
|
+
T && /* @__PURE__ */ C(ql, {}),
|
|
20647
|
+
n && !a && /* @__PURE__ */ C(av, {})
|
|
20646
20648
|
]
|
|
20647
20649
|
}) });
|
|
20648
20650
|
}, sv = "RENDER_ERROR", cv = (e) => {
|
|
@@ -23317,7 +23319,7 @@ function sb(e) {
|
|
|
23317
23319
|
v,
|
|
23318
23320
|
T,
|
|
23319
23321
|
e.readonly
|
|
23320
|
-
]), D = f(() => T?.(), [T]), O =
|
|
23322
|
+
]), D = f(() => T?.(), [T]), O = p ? n("dataEditor.modal.importTitle") : e.variant === "viewer" ? n("dataEditor.modal.viewTitle") : n("dataEditor.modal.editTitle");
|
|
23321
23323
|
m(() => {
|
|
23322
23324
|
t === "modal" && !o && h(e.variant === "uploader");
|
|
23323
23325
|
}, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updog/data-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
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",
|