@seamapi/react 1.41.0 → 1.41.1

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 (26) hide show
  1. package/README.md +1 -1
  2. package/dist/elements.js +58 -60
  3. package/dist/elements.js.map +1 -1
  4. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js +1 -1
  5. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -1
  6. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
  7. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +1 -5
  8. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  9. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +1 -1
  10. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +25 -16
  11. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -1
  12. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
  13. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +2 -3
  14. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -1
  15. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +1 -2
  16. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +7 -8
  17. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -1
  18. package/lib/version.d.ts +1 -1
  19. package/lib/version.js +1 -1
  20. package/package.json +1 -1
  21. package/src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx +1 -1
  22. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -7
  23. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +29 -30
  24. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +3 -4
  25. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +10 -14
  26. package/src/lib/version.ts +1 -1
package/README.md CHANGED
@@ -78,7 +78,7 @@ export function App() {
78
78
  <seam-device-table publishable-key="your_publishable_key"></seam-device-table>
79
79
  <script
80
80
  type="module"
81
- src="https://react.seam.co/v/1.41.0/dist/elements.js"
81
+ src="https://react.seam.co/v/1.41.1/dist/elements.js"
82
82
  ></script>
83
83
  </body>
84
84
  ```
package/dist/elements.js CHANGED
@@ -8082,7 +8082,7 @@ const Dm = "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;60
8082
8082
  const n = globalThis.document.createElement("link");
8083
8083
  n.rel = "stylesheet", n.type = "text/css", n.href = Dm, globalThis.document.head.appendChild(n);
8084
8084
  }, [t]);
8085
- }, gO = "1.41.0", vO = "https://react.seam.co", bO = ({
8085
+ }, gO = "1.41.1", vO = "https://react.seam.co", bO = ({
8086
8086
  disabled: t = !1,
8087
8087
  unminified: e = !1
8088
8088
  }) => {
@@ -26058,16 +26058,16 @@ const WM = ({
26058
26058
  filters: e,
26059
26059
  brands: n
26060
26060
  }) => {
26061
- var s;
26061
+ var o;
26062
26062
  const r = {};
26063
- t.trim() !== "" && (r.text_search = t.trim()), e.supportedOnly && (r.support_level = "live"), e.category !== null && (r.main_category = e.category), e.brand !== null && (r.brand = e.brand);
26063
+ t.trim() !== "" && (r.text_search = t.trim()), e.supportedOnly && (r.support_level = "live"), e.brand !== null && (r.brand = e.brand);
26064
26064
  const i = vS(r);
26065
- if (n.length === 0)
26066
- return i;
26067
- const o = (s = i.deviceModels) == null ? void 0 : s.filter(
26068
- (l) => n.includes(l.brand)
26069
- );
26070
- return { ...i, deviceModels: o };
26065
+ return n === null ? i : {
26066
+ ...i,
26067
+ deviceModels: (o = i.deviceModels) == null ? void 0 : o.filter(
26068
+ (s) => n.includes(s.brand)
26069
+ )
26070
+ };
26071
26071
  };
26072
26072
  function ZM({
26073
26073
  resetFilterValue: t,
@@ -26101,7 +26101,7 @@ function ZM({
26101
26101
  filterValue: e,
26102
26102
  resetFilterValue: t
26103
26103
  }
26104
- ) }) : e.trim() !== "" || n.supportedOnly || n.category !== null || n.brand !== null ? /* @__PURE__ */ h.jsx("div", { className: "seam-supported-device-table-content", children: i.map((u, p) => /* @__PURE__ */ h.jsx(
26104
+ ) }) : e.trim() !== "" || n.brand !== null ? /* @__PURE__ */ h.jsx("div", { className: "seam-supported-device-table-content", children: i.map((u, p) => /* @__PURE__ */ h.jsx(
26105
26105
  GM,
26106
26106
  {
26107
26107
  deviceModel: u
@@ -26187,7 +26187,7 @@ function XM({
26187
26187
  onAllOptionSelect: o,
26188
26188
  buttonLabel: s
26189
26189
  }) {
26190
- const l = r ? n : ["All", ...n];
26190
+ const l = r ? n : [e, ...n];
26191
26191
  return /* @__PURE__ */ h.jsxs("div", { className: "seam-supported-device-table-filter-menu-wrap", children: [
26192
26192
  /* @__PURE__ */ h.jsx("p", { children: t }),
26193
26193
  /* @__PURE__ */ h.jsx(
@@ -26224,52 +26224,50 @@ function nz({
26224
26224
  setFilters: r,
26225
26225
  brands: i
26226
26226
  }) {
26227
- const o = Object.values(n).filter(
26228
- (p) => p != null && p !== !1
26229
- ).length, s = "brand", l = rz(s, { brands: i }), c = (p) => {
26230
- r((d) => ({
26231
- ...d,
26232
- [p]: null
26227
+ const o = rz(n), s = iz(i), l = (u) => {
26228
+ r((p) => ({
26229
+ ...p,
26230
+ [u]: null
26233
26231
  }));
26234
- }, a = o > 0 ? `${Xo.filters} (${o})` : Xo.filter, u = Xo.all;
26232
+ }, c = o > 0 ? `${Xo.filters} (${o})` : Xo.filter, a = Xo.all;
26235
26233
  return /* @__PURE__ */ h.jsxs("div", { className: "seam-supported-device-table-filter-area", children: [
26236
26234
  /* @__PURE__ */ h.jsx("div", { className: "seam-deliberate-block" }),
26237
26235
  /* @__PURE__ */ h.jsxs("div", { className: "seam-filters-wrap", children: [
26238
26236
  /* @__PURE__ */ h.jsx(
26239
26237
  hh,
26240
26238
  {
26241
- renderButton: ({ onOpen: p }) => /* @__PURE__ */ h.jsx(
26239
+ renderButton: ({ onOpen: u }) => /* @__PURE__ */ h.jsx(
26242
26240
  Un,
26243
26241
  {
26244
26242
  variant: "outline",
26245
26243
  className: "seam-filters-button",
26246
- onClick: p,
26247
- children: a
26244
+ onClick: u,
26245
+ children: c
26248
26246
  }
26249
26247
  ),
26250
26248
  children: /* @__PURE__ */ h.jsxs(
26251
26249
  "div",
26252
26250
  {
26253
26251
  className: "seam-supported-device-table-filter-menu",
26254
- onClick: (p) => {
26255
- p.stopPropagation();
26252
+ onClick: (u) => {
26253
+ u.stopPropagation();
26256
26254
  },
26257
26255
  children: [
26258
26256
  /* @__PURE__ */ h.jsx("div", { className: "seam-filter-menu-row", children: /* @__PURE__ */ h.jsx(
26259
26257
  XM,
26260
26258
  {
26261
26259
  label: Xo.brand,
26262
- allLabel: u,
26263
- options: l,
26264
- onSelect: (p) => {
26265
- r((d) => ({
26266
- ...d,
26267
- brand: p
26260
+ allLabel: a,
26261
+ options: s,
26262
+ onSelect: (u) => {
26263
+ r((p) => ({
26264
+ ...p,
26265
+ brand: u
26268
26266
  }));
26269
26267
  },
26270
- buttonLabel: n.brand ?? u,
26268
+ buttonLabel: n.brand ?? a,
26271
26269
  onAllOptionSelect: () => {
26272
- c(s);
26270
+ l("brand");
26273
26271
  }
26274
26272
  }
26275
26273
  ) }),
@@ -26288,10 +26286,10 @@ function nz({
26288
26286
  type: "checkbox",
26289
26287
  className: "seam-filter-checkbox",
26290
26288
  checked: n.supportedOnly,
26291
- onChange: (p) => {
26292
- r((d) => ({
26293
- ...d,
26294
- supportedOnly: p.target.checked
26289
+ onChange: (u) => {
26290
+ r((p) => ({
26291
+ ...p,
26292
+ supportedOnly: u.target.checked
26295
26293
  }));
26296
26294
  }
26297
26295
  }
@@ -26308,8 +26306,8 @@ function nz({
26308
26306
  mh,
26309
26307
  {
26310
26308
  value: t,
26311
- onChange: (p) => {
26312
- e(p);
26309
+ onChange: (u) => {
26310
+ e(u);
26313
26311
  },
26314
26312
  className: "seam-supported-device-table-filter-area-search-bar"
26315
26313
  }
@@ -26317,16 +26315,17 @@ function nz({
26317
26315
  ] })
26318
26316
  ] });
26319
26317
  }
26320
- const rz = (t, e) => {
26321
- const { deviceModels: n } = vS();
26322
- if (n == null)
26318
+ const rz = (t) => {
26319
+ let e = 0;
26320
+ return t.brand !== null && e++, t.supportedOnly || e++, e;
26321
+ }, iz = (t) => {
26322
+ const { deviceModels: e } = vS();
26323
+ if (e == null)
26323
26324
  return [];
26324
- const r = /* @__PURE__ */ new Set();
26325
- for (const i of n) {
26326
- const o = i[t];
26327
- t === "brand" && e.brands.length > 0 && !e.brands.includes(o) || r.add(tz(o));
26328
- }
26329
- return Array.from(r);
26325
+ const n = /* @__PURE__ */ new Set();
26326
+ for (const r of e)
26327
+ r.brand.trim() !== "" && n.add(r.brand);
26328
+ return Array.from(n).filter((r) => t === null ? !0 : t.includes(r)).map((r) => tz(r));
26330
26329
  }, Xo = {
26331
26330
  all: "All",
26332
26331
  brand: "Brand",
@@ -26334,15 +26333,14 @@ const rz = (t, e) => {
26334
26333
  filter: "Filter",
26335
26334
  filters: "Filters"
26336
26335
  };
26337
- function iz({
26336
+ function oz({
26338
26337
  disableFilter: t = !1,
26339
26338
  cannotFilter: e,
26340
- brands: n = [],
26339
+ brands: n = null,
26341
26340
  className: r
26342
26341
  } = {}) {
26343
26342
  const [i, o] = P.useState(""), [s, l] = P.useState({
26344
- supportedOnly: !1,
26345
- category: null,
26343
+ supportedOnly: !0,
26346
26344
  brand: null
26347
26345
  }), c = e ?? t;
26348
26346
  return /* @__PURE__ */ h.jsxs(
@@ -26378,25 +26376,25 @@ function iz({
26378
26376
  }
26379
26377
  );
26380
26378
  }
26381
- const oz = "seam-supported-device-table", az = {
26379
+ const az = "seam-supported-device-table", sz = {
26382
26380
  cannotFilter: "boolean",
26383
26381
  disableFilter: "boolean",
26384
26382
  brands: "json",
26385
26383
  className: "string"
26386
- }, sz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26384
+ }, lz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26387
26385
  __proto__: null,
26388
- Component: iz,
26389
- name: oz,
26390
- props: az
26391
- }, Symbol.toStringTag, { value: "Module" })), lz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26386
+ Component: oz,
26387
+ name: az,
26388
+ props: sz
26389
+ }, Symbol.toStringTag, { value: "Module" })), uz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26392
26390
  __proto__: null,
26393
26391
  AccessCodeDetails: dM,
26394
26392
  AccessCodeTable: fM,
26395
26393
  ConnectAccountButton: bM,
26396
26394
  DeviceDetails: AM,
26397
26395
  DeviceTable: kM,
26398
- SupportedDeviceTable: sz
26399
- }, Symbol.toStringTag, { value: "Module" })), Eg = lz, uz = [];
26396
+ SupportedDeviceTable: lz
26397
+ }, Symbol.toStringTag, { value: "Module" })), Eg = uz, dz = [];
26400
26398
  for (const t of Object.keys(Eg)) {
26401
26399
  const e = Eg[t];
26402
26400
  if (e == null)
@@ -26406,9 +26404,9 @@ for (const t of Object.keys(Eg)) {
26406
26404
  throw new Error(`Missing element name for ${t}`);
26407
26405
  if (r == null)
26408
26406
  throw new Error(`Missing element Component for ${t}`);
26409
- uz.push(n), jO({ name: n, Component: r, props: i });
26407
+ dz.push(n), jO({ name: n, Component: r, props: i });
26410
26408
  }
26411
26409
  export {
26412
- uz as default
26410
+ dz as default
26413
26411
  };
26414
26412
  //# sourceMappingURL=elements.js.map