@seamapi/react 1.14.0 → 1.15.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 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.14.0", HE = "https://react.seam.co", DE = ({
8080
+ }, NE = "1.15.0", HE = "https://react.seam.co", DE = ({
8081
8081
  disabled: t = !1,
8082
8082
  unminified: e = !1
8083
8083
  }) => {
@@ -23628,60 +23628,76 @@ function P1({
23628
23628
  }
23629
23629
  function R1({
23630
23630
  deviceId: t,
23631
- onBack: e,
23632
- className: n
23631
+ onAccessCodeClick: e = () => {
23632
+ },
23633
+ preventDefaultOnAccessCodeClick: n = !1,
23634
+ onBack: r,
23635
+ className: i
23633
23636
  }) {
23634
- const { accessCodes: r } = S1({
23637
+ const { accessCodes: o } = S1({
23635
23638
  device_id: t
23636
- }), [i, o] = k.useState(
23637
- null
23638
- ), [s, l] = k.useState("");
23639
- if (i != null)
23639
+ }), [s, l] = k.useState(null), [c, a] = k.useState(""), u = k.useCallback(
23640
+ (f) => {
23641
+ e(f), !n && l(f);
23642
+ },
23643
+ [
23644
+ e,
23645
+ n,
23646
+ l
23647
+ ]
23648
+ );
23649
+ if (s != null)
23640
23650
  return /* @__PURE__ */ v.jsx(
23641
23651
  N1,
23642
23652
  {
23643
- className: n,
23644
- accessCodeId: i.access_code_id,
23653
+ className: i,
23654
+ accessCodeId: s,
23645
23655
  onBack: () => {
23646
- o(null);
23656
+ l(null);
23647
23657
  }
23648
23658
  }
23649
23659
  );
23650
- if (r == null)
23660
+ if (o == null)
23651
23661
  return null;
23652
- const c = r.filter((u) => s === "" ? !0 : new RegExp(s, "i").test(u.name ?? "")), a = r.length;
23653
- return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-access-code-table", n), children: [
23654
- /* @__PURE__ */ v.jsx(nd, { onBack: e }),
23662
+ const p = o.filter((f) => c === "" ? !0 : new RegExp(c, "i").test(f.name ?? "")), d = o.length;
23663
+ return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-access-code-table", i), children: [
23664
+ /* @__PURE__ */ v.jsx(nd, { onBack: r }),
23655
23665
  /* @__PURE__ */ v.jsxs(M1, { children: [
23656
23666
  /* @__PURE__ */ v.jsxs(j1, { children: [
23657
23667
  fa.accessCodes,
23658
23668
  " ",
23659
23669
  /* @__PURE__ */ v.jsxs(z1, { children: [
23660
23670
  "(",
23661
- a,
23671
+ d,
23662
23672
  ")"
23663
23673
  ] })
23664
23674
  ] }),
23665
23675
  /* @__PURE__ */ v.jsx(
23666
23676
  Qf,
23667
23677
  {
23668
- value: s,
23669
- onChange: l,
23670
- disabled: a === 0
23678
+ value: c,
23679
+ onChange: a,
23680
+ disabled: d === 0
23671
23681
  }
23672
23682
  )
23673
23683
  ] }),
23674
- /* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(zM, { accessCodes: c, selectAccessCode: o }) })
23684
+ /* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(
23685
+ zM,
23686
+ {
23687
+ accessCodes: p,
23688
+ onAccessCodeClick: u
23689
+ }
23690
+ ) })
23675
23691
  ] });
23676
23692
  }
23677
23693
  function zM(t) {
23678
- const { accessCodes: e, selectAccessCode: n } = t;
23694
+ const { accessCodes: e, onAccessCodeClick: n } = t;
23679
23695
  return e.length === 0 ? /* @__PURE__ */ v.jsx(C1, { children: fa.noAccessCodesMessage }) : /* @__PURE__ */ v.jsx(v.Fragment, { children: e.map((r) => /* @__PURE__ */ v.jsx(
23680
23696
  PM,
23681
23697
  {
23682
23698
  accessCode: r,
23683
23699
  onClick: () => {
23684
- n(r);
23700
+ n(r.access_code_id);
23685
23701
  }
23686
23702
  },
23687
23703
  r.access_code_id
@@ -24317,6 +24333,8 @@ const On = {
24317
24333
  props: JM
24318
24334
  }, Symbol.toStringTag, { value: "Module" })), eT = "seam-access-code-table", tT = {
24319
24335
  deviceId: "string",
24336
+ onAccessCodeClick: "function",
24337
+ preventDefaultOnAccessCodeClick: "boolean",
24320
24338
  onBack: "function",
24321
24339
  className: "string"
24322
24340
  }, nT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({