@updog/data-editor 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/index.js +51 -51
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -21571,36 +21571,36 @@ async function jS(e, t, n) {
21571
21571
  //#endregion
21572
21572
  //#region src/components/DataEditor/DataSourcesSection/DataSource.tsx
21573
21573
  var MS = ({ source: e }) => {
21574
- let { store: t, scrollToGridTop: n } = X(), { t: r } = q(), { id: i, name: a, isLoading: o, rowCount: s, isVisible: c, isDeletable: l } = e, { value: u, setTrue: d, setFalse: f } = Ao(!1), p = r("dataEditor.dataSources.show"), m = r("dataEditor.dataSources.hide"), h = r("dataEditor.dataSources.remove"), g = () => {
21575
- n(), t.toggleSourceVisibility(i);
21576
- }, _ = () => {
21577
- f(), n(), t.removeSource(i);
21574
+ let { store: t, scrollToGridTop: n, readonly: r } = X(), { t: i } = q(), { id: a, name: o, isLoading: s, rowCount: c, isVisible: l, isDeletable: u } = e, { value: d, setTrue: f, setFalse: p } = Ao(!1), m = i("dataEditor.dataSources.show"), h = i("dataEditor.dataSources.hide"), g = i("dataEditor.dataSources.remove"), _ = () => {
21575
+ n(), t.toggleSourceVisibility(a);
21576
+ }, v = () => {
21577
+ p(), n(), t.removeSource(a);
21578
21578
  };
21579
21579
  return /* @__PURE__ */ w("div", {
21580
21580
  className: "updog__data-source",
21581
21581
  children: [
21582
21582
  /* @__PURE__ */ C(Sa, {
21583
- className: E(!c && "updog__data-source__content--hidden"),
21584
- children: a
21583
+ className: E(!l && "updog__data-source__content--hidden"),
21584
+ children: o
21585
21585
  }),
21586
21586
  /* @__PURE__ */ w("div", {
21587
21587
  className: "updog__data-source__actions updog__data-source__actions--default",
21588
21588
  children: [
21589
- o && /* @__PURE__ */ C(ai, { size: "xs" }),
21589
+ s && /* @__PURE__ */ C(ai, { size: "xs" }),
21590
21590
  /* @__PURE__ */ C(Oa, {
21591
- text: qo(s),
21591
+ text: qo(c),
21592
21592
  color: "neutral",
21593
- className: E(!c && "updog__data-source__tag--hidden")
21593
+ className: E(!l && "updog__data-source__tag--hidden")
21594
21594
  }),
21595
- !c && /* @__PURE__ */ C(la, {
21596
- content: p,
21595
+ !l && /* @__PURE__ */ C(la, {
21596
+ content: m,
21597
21597
  placement: "bottom-end",
21598
21598
  children: /* @__PURE__ */ C(ui, {
21599
21599
  variant: "ghost",
21600
21600
  color: "neutral",
21601
- "aria-label": p,
21601
+ "aria-label": m,
21602
21602
  size: "sm",
21603
- onClick: g,
21603
+ onClick: _,
21604
21604
  children: /* @__PURE__ */ C(ce, {})
21605
21605
  })
21606
21606
  })
@@ -21608,57 +21608,57 @@ var MS = ({ source: e }) => {
21608
21608
  }),
21609
21609
  /* @__PURE__ */ w("div", {
21610
21610
  className: "updog__data-source__actions updog__data-source__actions--hover",
21611
- children: [l && /* @__PURE__ */ C(la, {
21612
- content: h,
21611
+ children: [u && !r && /* @__PURE__ */ C(la, {
21612
+ content: g,
21613
21613
  placement: "bottom-end",
21614
21614
  children: /* @__PURE__ */ C(ui, {
21615
21615
  variant: "ghost",
21616
21616
  color: "danger",
21617
- "aria-label": h,
21617
+ "aria-label": g,
21618
21618
  size: "sm",
21619
- onClick: d,
21619
+ onClick: f,
21620
21620
  children: /* @__PURE__ */ C(Me, {})
21621
21621
  })
21622
21622
  }), /* @__PURE__ */ C(la, {
21623
- content: c ? m : p,
21623
+ content: l ? h : m,
21624
21624
  placement: "bottom-end",
21625
21625
  children: /* @__PURE__ */ C(ui, {
21626
21626
  variant: "ghost",
21627
21627
  color: "neutral",
21628
- "aria-label": c ? m : p,
21628
+ "aria-label": l ? h : m,
21629
21629
  size: "sm",
21630
- onClick: g,
21631
- children: C(c ? se : ce, {})
21630
+ onClick: _,
21631
+ children: C(l ? se : ce, {})
21632
21632
  })
21633
21633
  })]
21634
21634
  }),
21635
21635
  /* @__PURE__ */ C(Hi, {
21636
- open: u,
21637
- onOpenChange: f,
21638
- submitAction: _,
21639
- title: r("dataEditor.dataSources.confirmRemove.title"),
21640
- description: r("dataEditor.dataSources.confirmRemove.text"),
21641
- submitText: r("dataEditor.dataSources.confirmRemove.action")
21636
+ open: d,
21637
+ onOpenChange: p,
21638
+ submitAction: v,
21639
+ title: i("dataEditor.dataSources.confirmRemove.title"),
21640
+ description: i("dataEditor.dataSources.confirmRemove.text"),
21641
+ submitText: i("dataEditor.dataSources.confirmRemove.action")
21642
21642
  })
21643
21643
  ]
21644
21644
  });
21645
21645
  }, NS = () => {
21646
- let { store: e, columns: t, navigateToCell: n, navigateToCellRef: r, setShowUploader: i, enableAddRow: a, importFormats: o } = X(), { t: s } = q(), { sources: c, phase: l } = Mo(e), u = l !== "idle", d = v(() => {
21646
+ let { store: e, columns: t, navigateToCell: n, navigateToCellRef: r, setShowUploader: i, enableAddRow: a, importFormats: o, readonly: s } = X(), { t: c } = q(), { sources: l, phase: u } = Mo(e), d = u !== "idle", p = v(() => {
21647
21647
  let e = [];
21648
21648
  return o.length > 0 && e.push({
21649
21649
  id: "import_data",
21650
- text: s("dataEditor.dataSources.importData"),
21650
+ text: c("dataEditor.dataSources.importData"),
21651
21651
  icon: /* @__PURE__ */ C(Ie, { size: "1rem" })
21652
21652
  }), a && e.push({
21653
21653
  id: "add_row",
21654
- text: s("dataEditor.dataSources.addRow"),
21654
+ text: c("dataEditor.dataSources.addRow"),
21655
21655
  icon: /* @__PURE__ */ C(Se, { size: "1rem" })
21656
21656
  }), e;
21657
21657
  }, [
21658
- s,
21658
+ c,
21659
21659
  a,
21660
21660
  o
21661
- ]), p = f(async (a) => {
21661
+ ]), m = f(async (a) => {
21662
21662
  if (a === "import_data") {
21663
21663
  i(!0);
21664
21664
  return;
@@ -21673,7 +21673,7 @@ var MS = ({ source: e }) => {
21673
21673
  } catch {}
21674
21674
  return;
21675
21675
  }
21676
- n(await jS(e, t, s("dataEditor.dataSources.manuallyAdded")), t[0].id);
21676
+ n(await jS(e, t, c("dataEditor.dataSources.manuallyAdded")), t[0].id);
21677
21677
  }
21678
21678
  }, [
21679
21679
  i,
@@ -21681,29 +21681,29 @@ var MS = ({ source: e }) => {
21681
21681
  t,
21682
21682
  n,
21683
21683
  r,
21684
- s
21685
- ]), m = s("dataEditor.dataSources.addDataSource"), h = a || o.length > 0 ? /* @__PURE__ */ C(Ma, {
21686
- options: d,
21687
- onSelect: p,
21684
+ c
21685
+ ]), h = c("dataEditor.dataSources.addDataSource"), g = !s && (a || o.length > 0) ? /* @__PURE__ */ C(Ma, {
21686
+ options: p,
21687
+ onSelect: m,
21688
21688
  placement: "bottom-end",
21689
21689
  children: /* @__PURE__ */ C(la, {
21690
- content: m,
21690
+ content: h,
21691
21691
  placement: "bottom-end",
21692
21692
  children: /* @__PURE__ */ C(ui, {
21693
- "aria-label": m,
21693
+ "aria-label": h,
21694
21694
  size: "sm",
21695
- disabled: u,
21695
+ disabled: d,
21696
21696
  children: /* @__PURE__ */ C(Se, {})
21697
21697
  })
21698
21698
  })
21699
21699
  }) : void 0;
21700
21700
  return /* @__PURE__ */ C(AS, {
21701
21701
  icon: /* @__PURE__ */ C(pe, { size: "1rem" }),
21702
- title: s("dataEditor.dataSources.title"),
21703
- accessory: h,
21704
- children: c.length > 0 && /* @__PURE__ */ C("div", {
21702
+ title: c("dataEditor.dataSources.title"),
21703
+ accessory: g,
21704
+ children: l.length > 0 && /* @__PURE__ */ C("div", {
21705
21705
  className: "updog__data-sources-section__list",
21706
- children: c.map((e) => /* @__PURE__ */ C(MS, { source: e }, e.id))
21706
+ children: l.map((e) => /* @__PURE__ */ C(MS, { source: e }, e.id))
21707
21707
  })
21708
21708
  });
21709
21709
  }, PS = ({ columns: e, resetKey: t }) => {
@@ -22820,30 +22820,30 @@ var fC = ({ text: e, onSelect: t }) => /* @__PURE__ */ C(Y, {
22820
22820
  /* @__PURE__ */ C(vC, {})
22821
22821
  ]
22822
22822
  }) }), xC = () => {
22823
- let { readonly: e, store: t, chat: n } = X(), { filteredCount: r, isLoading: i } = Mo(t), { t: a } = q();
22823
+ let { store: e, chat: t } = X(), { filteredCount: n, isLoading: r } = Mo(e), { t: i } = q();
22824
22824
  return /* @__PURE__ */ w(el, { children: [
22825
22825
  /* @__PURE__ */ C(Qc, { children: /* @__PURE__ */ C("div", {
22826
22826
  className: "updog__data-editor-aside",
22827
22827
  children: /* @__PURE__ */ w("div", {
22828
22828
  className: "updog__data-editor-aside__content updog__scrollbar",
22829
22829
  children: [
22830
- !e && /* @__PURE__ */ C(NS, {}),
22831
- !e && /* @__PURE__ */ C(Ea, {}),
22830
+ /* @__PURE__ */ C(NS, {}),
22831
+ /* @__PURE__ */ C(Ea, {}),
22832
22832
  /* @__PURE__ */ C(XS, {})
22833
22833
  ]
22834
22834
  })
22835
22835
  }) }),
22836
22836
  /* @__PURE__ */ w($c, { children: [
22837
22837
  /* @__PURE__ */ C(kS, {}),
22838
- !i && r === 0 && /* @__PURE__ */ C(Da, {
22838
+ !r && n === 0 && /* @__PURE__ */ C(Da, {
22839
22839
  className: "updog-grid__empty-state",
22840
- title: a("dataEditor.grid.emptyTitle"),
22841
- text: a("dataEditor.grid.emptyText")
22840
+ title: i("dataEditor.grid.emptyTitle"),
22841
+ text: i("dataEditor.grid.emptyText")
22842
22842
  }),
22843
22843
  /* @__PURE__ */ C(tl, {}),
22844
22844
  /* @__PURE__ */ C(kh, {})
22845
22845
  ] }),
22846
- n && /* @__PURE__ */ C(bC, {})
22846
+ t && /* @__PURE__ */ C(bC, {})
22847
22847
  ] });
22848
22848
  }, SC = () => {
22849
22849
  let { t: e } = q();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@updog/data-editor",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Enterprise-grade spreadsheet editor SDK for React. Edit large datasets with validation, undo/redo, CSV/XLSX import, and multi-source merging.",
5
5
  "author": "Mikhail Kutateladze <admin@updog.tech>",
6
6
  "homepage": "https://updog.tech",