@updog/data-editor-wc 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.
- package/index.js +51 -51
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -38494,36 +38494,36 @@ async function XM(e, t, n) {
|
|
|
38494
38494
|
//#endregion
|
|
38495
38495
|
//#region src/components/DataEditor/DataSourcesSection/DataSource.tsx
|
|
38496
38496
|
var ZM = ({ source: e }) => {
|
|
38497
|
-
let { store: t, scrollToGridTop: n } = kd(), { t:
|
|
38498
|
-
n(), t.toggleSourceVisibility(
|
|
38499
|
-
},
|
|
38500
|
-
|
|
38497
|
+
let { store: t, scrollToGridTop: n, readonly: r } = kd(), { t: i } = k(), { id: a, name: o, isLoading: s, rowCount: c, isVisible: l, isDeletable: u } = e, { value: d, setTrue: f, setFalse: p } = el(!1), m = i("dataEditor.dataSources.show"), h = i("dataEditor.dataSources.hide"), g = i("dataEditor.dataSources.remove"), _ = () => {
|
|
38498
|
+
n(), t.toggleSourceVisibility(a);
|
|
38499
|
+
}, v = () => {
|
|
38500
|
+
p(), n(), t.removeSource(a);
|
|
38501
38501
|
};
|
|
38502
38502
|
return /* @__PURE__ */ (0, E.jsxs)("div", {
|
|
38503
38503
|
className: "updog__data-source",
|
|
38504
38504
|
children: [
|
|
38505
38505
|
/* @__PURE__ */ (0, E.jsx)(qs, {
|
|
38506
|
-
className: j(!
|
|
38507
|
-
children:
|
|
38506
|
+
className: j(!l && "updog__data-source__content--hidden"),
|
|
38507
|
+
children: o
|
|
38508
38508
|
}),
|
|
38509
38509
|
/* @__PURE__ */ (0, E.jsxs)("div", {
|
|
38510
38510
|
className: "updog__data-source__actions updog__data-source__actions--default",
|
|
38511
38511
|
children: [
|
|
38512
|
-
|
|
38512
|
+
s && /* @__PURE__ */ (0, E.jsx)(Xe, { size: "xs" }),
|
|
38513
38513
|
/* @__PURE__ */ (0, E.jsx)($s, {
|
|
38514
|
-
text: _l(
|
|
38514
|
+
text: _l(c),
|
|
38515
38515
|
color: "neutral",
|
|
38516
|
-
className: j(!
|
|
38516
|
+
className: j(!l && "updog__data-source__tag--hidden")
|
|
38517
38517
|
}),
|
|
38518
|
-
!
|
|
38519
|
-
content:
|
|
38518
|
+
!l && /* @__PURE__ */ (0, E.jsx)(Ps, {
|
|
38519
|
+
content: m,
|
|
38520
38520
|
placement: "bottom-end",
|
|
38521
38521
|
children: /* @__PURE__ */ (0, E.jsx)(nt, {
|
|
38522
38522
|
variant: "ghost",
|
|
38523
38523
|
color: "neutral",
|
|
38524
|
-
"aria-label":
|
|
38524
|
+
"aria-label": m,
|
|
38525
38525
|
size: "sm",
|
|
38526
|
-
onClick:
|
|
38526
|
+
onClick: _,
|
|
38527
38527
|
children: /* @__PURE__ */ (0, E.jsx)(he, {})
|
|
38528
38528
|
})
|
|
38529
38529
|
})
|
|
@@ -38531,57 +38531,57 @@ var ZM = ({ source: e }) => {
|
|
|
38531
38531
|
}),
|
|
38532
38532
|
/* @__PURE__ */ (0, E.jsxs)("div", {
|
|
38533
38533
|
className: "updog__data-source__actions updog__data-source__actions--hover",
|
|
38534
|
-
children: [
|
|
38535
|
-
content:
|
|
38534
|
+
children: [u && !r && /* @__PURE__ */ (0, E.jsx)(Ps, {
|
|
38535
|
+
content: g,
|
|
38536
38536
|
placement: "bottom-end",
|
|
38537
38537
|
children: /* @__PURE__ */ (0, E.jsx)(nt, {
|
|
38538
38538
|
variant: "ghost",
|
|
38539
38539
|
color: "danger",
|
|
38540
|
-
"aria-label":
|
|
38540
|
+
"aria-label": g,
|
|
38541
38541
|
size: "sm",
|
|
38542
|
-
onClick:
|
|
38542
|
+
onClick: f,
|
|
38543
38543
|
children: /* @__PURE__ */ (0, E.jsx)(Re, {})
|
|
38544
38544
|
})
|
|
38545
38545
|
}), /* @__PURE__ */ (0, E.jsx)(Ps, {
|
|
38546
|
-
content:
|
|
38546
|
+
content: l ? h : m,
|
|
38547
38547
|
placement: "bottom-end",
|
|
38548
38548
|
children: /* @__PURE__ */ (0, E.jsx)(nt, {
|
|
38549
38549
|
variant: "ghost",
|
|
38550
38550
|
color: "neutral",
|
|
38551
|
-
"aria-label":
|
|
38551
|
+
"aria-label": l ? h : m,
|
|
38552
38552
|
size: "sm",
|
|
38553
|
-
onClick:
|
|
38554
|
-
children:
|
|
38553
|
+
onClick: _,
|
|
38554
|
+
children: l ? /* @__PURE__ */ (0, E.jsx)(ge, {}) : /* @__PURE__ */ (0, E.jsx)(he, {})
|
|
38555
38555
|
})
|
|
38556
38556
|
})]
|
|
38557
38557
|
}),
|
|
38558
38558
|
/* @__PURE__ */ (0, E.jsx)(ps, {
|
|
38559
|
-
open:
|
|
38560
|
-
onOpenChange:
|
|
38561
|
-
submitAction:
|
|
38562
|
-
title:
|
|
38563
|
-
description:
|
|
38564
|
-
submitText:
|
|
38559
|
+
open: d,
|
|
38560
|
+
onOpenChange: p,
|
|
38561
|
+
submitAction: v,
|
|
38562
|
+
title: i("dataEditor.dataSources.confirmRemove.title"),
|
|
38563
|
+
description: i("dataEditor.dataSources.confirmRemove.text"),
|
|
38564
|
+
submitText: i("dataEditor.dataSources.confirmRemove.action")
|
|
38565
38565
|
})
|
|
38566
38566
|
]
|
|
38567
38567
|
});
|
|
38568
38568
|
}, QM = () => {
|
|
38569
|
-
let { store: e, columns: t, navigateToCell: n, navigateToCellRef: r, setShowUploader: i, enableAddRow: a, importFormats: o } = kd(), { t:
|
|
38569
|
+
let { store: e, columns: t, navigateToCell: n, navigateToCellRef: r, setShowUploader: i, enableAddRow: a, importFormats: o, readonly: s } = kd(), { t: c } = k(), { sources: l, phase: u } = nl(e), d = u !== "idle", f = (0, _.useMemo)(() => {
|
|
38570
38570
|
let e = [];
|
|
38571
38571
|
return o.length > 0 && e.push({
|
|
38572
38572
|
id: "import_data",
|
|
38573
|
-
text:
|
|
38573
|
+
text: c("dataEditor.dataSources.importData"),
|
|
38574
38574
|
icon: /* @__PURE__ */ (0, E.jsx)(Ve, { size: "1rem" })
|
|
38575
38575
|
}), a && e.push({
|
|
38576
38576
|
id: "add_row",
|
|
38577
|
-
text:
|
|
38577
|
+
text: c("dataEditor.dataSources.addRow"),
|
|
38578
38578
|
icon: /* @__PURE__ */ (0, E.jsx)(Oe, { size: "1rem" })
|
|
38579
38579
|
}), e;
|
|
38580
38580
|
}, [
|
|
38581
|
-
|
|
38581
|
+
c,
|
|
38582
38582
|
a,
|
|
38583
38583
|
o
|
|
38584
|
-
]),
|
|
38584
|
+
]), p = (0, _.useCallback)(async (a) => {
|
|
38585
38585
|
if (a === "import_data") {
|
|
38586
38586
|
i(!0);
|
|
38587
38587
|
return;
|
|
@@ -38596,7 +38596,7 @@ var ZM = ({ source: e }) => {
|
|
|
38596
38596
|
} catch {}
|
|
38597
38597
|
return;
|
|
38598
38598
|
}
|
|
38599
|
-
n(await XM(e, t,
|
|
38599
|
+
n(await XM(e, t, c("dataEditor.dataSources.manuallyAdded")), t[0].id);
|
|
38600
38600
|
}
|
|
38601
38601
|
}, [
|
|
38602
38602
|
i,
|
|
@@ -38604,29 +38604,29 @@ var ZM = ({ source: e }) => {
|
|
|
38604
38604
|
t,
|
|
38605
38605
|
n,
|
|
38606
38606
|
r,
|
|
38607
|
-
|
|
38608
|
-
]),
|
|
38609
|
-
options:
|
|
38610
|
-
onSelect:
|
|
38607
|
+
c
|
|
38608
|
+
]), m = c("dataEditor.dataSources.addDataSource"), h = !s && (a || o.length > 0) ? /* @__PURE__ */ (0, E.jsx)(rc, {
|
|
38609
|
+
options: f,
|
|
38610
|
+
onSelect: p,
|
|
38611
38611
|
placement: "bottom-end",
|
|
38612
38612
|
children: /* @__PURE__ */ (0, E.jsx)(Ps, {
|
|
38613
|
-
content:
|
|
38613
|
+
content: m,
|
|
38614
38614
|
placement: "bottom-end",
|
|
38615
38615
|
children: /* @__PURE__ */ (0, E.jsx)(nt, {
|
|
38616
|
-
"aria-label":
|
|
38616
|
+
"aria-label": m,
|
|
38617
38617
|
size: "sm",
|
|
38618
|
-
disabled:
|
|
38618
|
+
disabled: d,
|
|
38619
38619
|
children: /* @__PURE__ */ (0, E.jsx)(Oe, {})
|
|
38620
38620
|
})
|
|
38621
38621
|
})
|
|
38622
38622
|
}) : void 0;
|
|
38623
38623
|
return /* @__PURE__ */ (0, E.jsx)(YM, {
|
|
38624
38624
|
icon: /* @__PURE__ */ (0, E.jsx)(ye, { size: "1rem" }),
|
|
38625
|
-
title:
|
|
38626
|
-
accessory:
|
|
38627
|
-
children:
|
|
38625
|
+
title: c("dataEditor.dataSources.title"),
|
|
38626
|
+
accessory: h,
|
|
38627
|
+
children: l.length > 0 && /* @__PURE__ */ (0, E.jsx)("div", {
|
|
38628
38628
|
className: "updog__data-sources-section__list",
|
|
38629
|
-
children:
|
|
38629
|
+
children: l.map((e) => /* @__PURE__ */ (0, E.jsx)(ZM, { source: e }, e.id))
|
|
38630
38630
|
})
|
|
38631
38631
|
});
|
|
38632
38632
|
}, $M = ({ columns: e, resetKey: t }) => {
|
|
@@ -39743,30 +39743,30 @@ var jN = ({ text: e, onSelect: t }) => /* @__PURE__ */ (0, E.jsx)(tt, {
|
|
|
39743
39743
|
/* @__PURE__ */ (0, E.jsx)(LN, {})
|
|
39744
39744
|
]
|
|
39745
39745
|
}) }), BN = () => {
|
|
39746
|
-
let {
|
|
39746
|
+
let { store: e, chat: t } = kd(), { filteredCount: n, isLoading: r } = nl(e), { t: i } = k();
|
|
39747
39747
|
return /* @__PURE__ */ (0, E.jsxs)(Md, { children: [
|
|
39748
39748
|
/* @__PURE__ */ (0, E.jsx)(Ad, { children: /* @__PURE__ */ (0, E.jsx)("div", {
|
|
39749
39749
|
className: "updog__data-editor-aside",
|
|
39750
39750
|
children: /* @__PURE__ */ (0, E.jsxs)("div", {
|
|
39751
39751
|
className: "updog__data-editor-aside__content updog__scrollbar",
|
|
39752
39752
|
children: [
|
|
39753
|
-
|
|
39754
|
-
|
|
39753
|
+
/* @__PURE__ */ (0, E.jsx)(QM, {}),
|
|
39754
|
+
/* @__PURE__ */ (0, E.jsx)(Zs, {}),
|
|
39755
39755
|
/* @__PURE__ */ (0, E.jsx)(hN, {})
|
|
39756
39756
|
]
|
|
39757
39757
|
})
|
|
39758
39758
|
}) }),
|
|
39759
39759
|
/* @__PURE__ */ (0, E.jsxs)(jd, { children: [
|
|
39760
39760
|
/* @__PURE__ */ (0, E.jsx)(JM, {}),
|
|
39761
|
-
!
|
|
39761
|
+
!r && n === 0 && /* @__PURE__ */ (0, E.jsx)(Qs, {
|
|
39762
39762
|
className: "updog-grid__empty-state",
|
|
39763
|
-
title:
|
|
39764
|
-
text:
|
|
39763
|
+
title: i("dataEditor.grid.emptyTitle"),
|
|
39764
|
+
text: i("dataEditor.grid.emptyText")
|
|
39765
39765
|
}),
|
|
39766
39766
|
/* @__PURE__ */ (0, E.jsx)(Nd, {}),
|
|
39767
39767
|
/* @__PURE__ */ (0, E.jsx)(wv, {})
|
|
39768
39768
|
] }),
|
|
39769
|
-
|
|
39769
|
+
t && /* @__PURE__ */ (0, E.jsx)(zN, {})
|
|
39770
39770
|
] });
|
|
39771
39771
|
}, VN = () => {
|
|
39772
39772
|
let { t: e } = k();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updog/data-editor-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Web Component wrapper for @updog/data-editor. Framework-agnostic, zero dependencies.",
|
|
5
5
|
"author": "Mikhail Kutateladze <admin@updog.tech>",
|
|
6
6
|
"homepage": "https://updog.tech",
|