@seamapi/react 1.12.0 → 1.14.0
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/dist/elements.js +34 -23
- package/dist/elements.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -1
- package/lib/seam/components/DeviceTable/DeviceTable.js +13 -7
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.element.ts +3 -0
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +21 -7
- package/src/lib/version.ts +1 -1
package/dist/elements.js
CHANGED
|
@@ -8077,7 +8077,7 @@ const mm = "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;60
|
|
|
8077
8077
|
const n = globalThis.document.createElement("link");
|
|
8078
8078
|
n.rel = "stylesheet", n.type = "text/css", n.href = mm, globalThis.document.head.appendChild(n);
|
|
8079
8079
|
}, [t]);
|
|
8080
|
-
}, NE = "1.
|
|
8080
|
+
}, NE = "1.14.0", HE = "https://react.seam.co", DE = ({
|
|
8081
8081
|
disabled: t = !1,
|
|
8082
8082
|
unminified: e = !1
|
|
8083
8083
|
}) => {
|
|
@@ -24640,56 +24640,64 @@ function wT(t) {
|
|
|
24640
24640
|
}
|
|
24641
24641
|
function ET({
|
|
24642
24642
|
deviceIds: t,
|
|
24643
|
-
|
|
24644
|
-
|
|
24643
|
+
onDeviceClick: e = () => {
|
|
24644
|
+
},
|
|
24645
|
+
preventDefaultOnDeviceClick: n = !1,
|
|
24646
|
+
onBack: r,
|
|
24647
|
+
className: i
|
|
24645
24648
|
} = {}) {
|
|
24646
|
-
const { devices:
|
|
24649
|
+
const { devices: o, isLoading: s, isError: l, error: c } = wT({
|
|
24647
24650
|
device_ids: t
|
|
24648
|
-
}), [
|
|
24649
|
-
|
|
24651
|
+
}), [a, u] = k.useState(null), [p, d] = k.useState(""), f = k.useCallback(
|
|
24652
|
+
(b) => {
|
|
24653
|
+
e(b), !n && u(b);
|
|
24654
|
+
},
|
|
24655
|
+
[e, n, u]
|
|
24656
|
+
);
|
|
24657
|
+
if (a != null)
|
|
24650
24658
|
return /* @__PURE__ */ v.jsx(
|
|
24651
24659
|
Wf,
|
|
24652
24660
|
{
|
|
24653
|
-
className:
|
|
24654
|
-
deviceId:
|
|
24661
|
+
className: i,
|
|
24662
|
+
deviceId: a,
|
|
24655
24663
|
onBack: () => {
|
|
24656
|
-
|
|
24664
|
+
u(null);
|
|
24657
24665
|
}
|
|
24658
24666
|
}
|
|
24659
24667
|
);
|
|
24660
|
-
if (
|
|
24661
|
-
return /* @__PURE__ */ v.jsx("p", { className:
|
|
24662
|
-
if (
|
|
24663
|
-
return /* @__PURE__ */ v.jsx("p", { className:
|
|
24664
|
-
if (
|
|
24668
|
+
if (s)
|
|
24669
|
+
return /* @__PURE__ */ v.jsx("p", { className: i, children: "..." });
|
|
24670
|
+
if (l)
|
|
24671
|
+
return /* @__PURE__ */ v.jsx("p", { className: i, children: c == null ? void 0 : c.message });
|
|
24672
|
+
if (o == null)
|
|
24665
24673
|
return null;
|
|
24666
|
-
const
|
|
24667
|
-
return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-device-table",
|
|
24668
|
-
/* @__PURE__ */ v.jsx(nd, { onBack:
|
|
24674
|
+
const h = o.length, g = o.filter((b) => p === "" ? !0 : new RegExp(p, "i").test(b.properties.name));
|
|
24675
|
+
return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-device-table", i), children: [
|
|
24676
|
+
/* @__PURE__ */ v.jsx(nd, { onBack: r }),
|
|
24669
24677
|
/* @__PURE__ */ v.jsxs(M1, { children: [
|
|
24670
24678
|
/* @__PURE__ */ v.jsxs(j1, { children: [
|
|
24671
24679
|
H1.devices,
|
|
24672
24680
|
" ",
|
|
24673
24681
|
/* @__PURE__ */ v.jsxs(z1, { children: [
|
|
24674
24682
|
"(",
|
|
24675
|
-
|
|
24683
|
+
h,
|
|
24676
24684
|
")"
|
|
24677
24685
|
] })
|
|
24678
24686
|
] }),
|
|
24679
24687
|
/* @__PURE__ */ v.jsx(
|
|
24680
24688
|
Qf,
|
|
24681
24689
|
{
|
|
24682
|
-
value:
|
|
24683
|
-
onChange:
|
|
24684
|
-
disabled:
|
|
24690
|
+
value: p,
|
|
24691
|
+
onChange: d,
|
|
24692
|
+
disabled: h === 0
|
|
24685
24693
|
}
|
|
24686
24694
|
)
|
|
24687
24695
|
] }),
|
|
24688
|
-
/* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(OT, { devices:
|
|
24696
|
+
/* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(OT, { devices: g, onDeviceClick: f }) })
|
|
24689
24697
|
] });
|
|
24690
24698
|
}
|
|
24691
24699
|
function OT(t) {
|
|
24692
|
-
const { devices: e,
|
|
24700
|
+
const { devices: e, onDeviceClick: n } = t, [r, i] = k.useState(null);
|
|
24693
24701
|
if (e.length === 0)
|
|
24694
24702
|
return /* @__PURE__ */ v.jsx(C1, { children: H1.noDevicesMessage });
|
|
24695
24703
|
const o = e.filter((s) => r === null ? !0 : r === "device_issues" ? s.errors.length > 0 : !0);
|
|
@@ -24719,6 +24727,9 @@ const H1 = {
|
|
|
24719
24727
|
unknownLock: "Unknown Lock",
|
|
24720
24728
|
noDevicesMessage: "Sorry, no devices were found"
|
|
24721
24729
|
}, IT = "seam-device-table", CT = {
|
|
24730
|
+
deviceIds: "json",
|
|
24731
|
+
onDeviceClick: "function",
|
|
24732
|
+
preventDefaultOnDeviceClick: "boolean",
|
|
24722
24733
|
onBack: "function",
|
|
24723
24734
|
className: "string"
|
|
24724
24735
|
}, xT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|