@seamapi/react 4.14.0 → 5.0.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.
Files changed (86) hide show
  1. package/README.md +2 -3
  2. package/dist/elements.js +9525 -10202
  3. package/dist/elements.js.map +1 -1
  4. package/dist/index.css +0 -345
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.min.css +1 -1
  7. package/dist/index.min.css.map +1 -1
  8. package/lib/seam/components/index.d.ts +0 -2
  9. package/lib/seam/components/index.js +0 -2
  10. package/lib/seam/components/index.js.map +1 -1
  11. package/lib/version.d.ts +1 -1
  12. package/lib/version.js +1 -1
  13. package/lib/version.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/lib/seam/components/elements.ts +0 -2
  16. package/src/lib/seam/components/index.ts +0 -2
  17. package/src/lib/version.ts +1 -1
  18. package/src/styles/_main.scss +0 -4
  19. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -20
  20. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js +0 -22
  21. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
  22. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +0 -6
  23. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js +0 -8
  24. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js.map +0 -1
  25. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +0 -9
  26. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js +0 -14
  27. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js.map +0 -1
  28. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -13
  29. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +0 -58
  30. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
  31. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +0 -7
  32. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +0 -6
  33. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +0 -1
  34. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -12
  35. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +0 -58
  36. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
  37. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +0 -8
  38. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +0 -39
  39. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +0 -1
  40. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -10
  41. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +0 -35
  42. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
  43. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -11
  44. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +0 -20
  45. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
  46. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +0 -6
  47. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +0 -21
  48. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +0 -1
  49. package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +0 -7
  50. package/lib/seam/components/SupportedDeviceTable/use-device-model.js +0 -21
  51. package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +0 -1
  52. package/lib/seam/components/SupportedDeviceTable/use-device-models.d.ts +0 -7
  53. package/lib/seam/components/SupportedDeviceTable/use-device-models.js +0 -30
  54. package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +0 -1
  55. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +0 -15
  56. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +0 -45
  57. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +0 -1
  58. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +0 -10
  59. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +0 -42
  60. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +0 -1
  61. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +0 -7
  62. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +0 -17
  63. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +0 -1
  64. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.d.ts +0 -7
  65. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +0 -26
  66. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +0 -1
  67. package/src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx +0 -78
  68. package/src/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.tsx +0 -13
  69. package/src/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.tsx +0 -32
  70. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -161
  71. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +0 -22
  72. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +0 -145
  73. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx +0 -109
  74. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -93
  75. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +0 -15
  76. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -70
  77. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.element.ts +0 -9
  78. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +0 -64
  79. package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +0 -44
  80. package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +0 -57
  81. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +0 -88
  82. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +0 -69
  83. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +0 -40
  84. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +0 -53
  85. package/src/styles/_supported-device-table-manufacturer-keys.scss +0 -20
  86. package/src/styles/_supported-device-table.scss +0 -412
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { type DeviceModelFilters } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
3
- interface SupportedDeviceContentProps {
4
- filterValue: string;
5
- resetFilterValue: () => void;
6
- filters: DeviceModelFilters;
7
- manufacturers: string[] | null;
8
- excludedManufacturers: string[];
9
- includeIf: string[] | null;
10
- excludeIf: string[];
11
- }
12
- export declare function SupportedDeviceContent({ resetFilterValue, filterValue, filters, manufacturers, excludedManufacturers, includeIf, excludeIf, }: SupportedDeviceContentProps): JSX.Element | null;
13
- export {};
@@ -1,58 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { SupportedDeviceManufacturerSection } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js';
4
- import { useFilteredDeviceModels, } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
5
- import { Button } from '../../../../lib/ui/Button.js';
6
- export function SupportedDeviceContent({ resetFilterValue, filterValue, filters, manufacturers, excludedManufacturers, includeIf, excludeIf, }) {
7
- const { deviceModels, isPending, isError, refetch } = useFilteredDeviceModels({
8
- filterValue,
9
- filters,
10
- manufacturers,
11
- excludedManufacturers,
12
- includeIf,
13
- excludeIf,
14
- });
15
- const groupedDeviceModels = useMemo(() => groupDeviceModelsByManufacturer(deviceModels ?? []), [deviceModels]);
16
- if (isPending) {
17
- return (_jsx("div", { className: 'seam-supported-device-table-content-state-block', children: _jsx("p", { children: t.loading }) }));
18
- }
19
- if (isError) {
20
- return (_jsxs("div", { className: 'seam-supported-device-table-content-state-block', children: [_jsx("p", { children: t.error }), _jsx(Button, { variant: 'solid', size: 'small', onClick: () => {
21
- void refetch();
22
- }, children: t.retry })] }));
23
- }
24
- if (deviceModels == null) {
25
- return null;
26
- }
27
- const isEmpty = deviceModels.length === 0;
28
- if (isEmpty) {
29
- return (_jsx("div", { className: 'seam-supported-device-table-content', children: _jsx(EmptyResult, { filterValue: filterValue, resetFilterValue: resetFilterValue }) }));
30
- }
31
- return (_jsx(_Fragment, { children: Object.entries(groupedDeviceModels)
32
- .sort((e1, e2) => e1[1][0]?.manufacturer.display_name.localeCompare(e2[1][0]?.manufacturer.display_name ?? '') ?? 0)
33
- .map(([manufacturerId, models]) => {
34
- return (_jsx(SupportedDeviceManufacturerSection, { manufacturerId: manufacturerId, deviceModels: models }, manufacturerId));
35
- }) }));
36
- }
37
- function EmptyResult({ filterValue, resetFilterValue, }) {
38
- const noMatchingRows = (_jsxs(_Fragment, { children: [_jsx("p", { children: t.noMatch }), _jsx(Button, { variant: 'outline', size: 'small', onClick: resetFilterValue, className: 'seam-supported-device-table-content-message-clear-search', children: t.clear })] }));
39
- return (_jsx("div", { className: 'seam-supported-device-table-content-message-row', children: _jsx("div", { children: _jsx("div", { className: 'seam-supported-device-table-content-message', children: filterValue.length === 0 ? _jsx("p", { children: t.noneFound }) : noMatchingRows }) }) }));
40
- }
41
- const groupDeviceModelsByManufacturer = (deviceModels) => {
42
- const result = {};
43
- for (const model of deviceModels) {
44
- const { manufacturer } = model;
45
- const list = result[manufacturer.manufacturer_id] ?? [];
46
- result[manufacturer.manufacturer_id] = [...list, model];
47
- }
48
- return result;
49
- };
50
- const t = {
51
- loading: 'Loading device models...',
52
- retry: 'Retry',
53
- error: 'There was an error fetching device models.',
54
- noneFound: 'No device models found.',
55
- noMatch: 'No device models matched your search.',
56
- clear: 'Clear search terms',
57
- };
58
- //# sourceMappingURL=SupportedDeviceContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceContent.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,gFAAgF,CAAA;AACnI,OAAO,EAEL,uBAAuB,GACxB,MAAM,wEAAwE,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAYzC,MAAM,UAAU,sBAAsB,CAAC,EACrC,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,SAAS,GACmB;IAC5B,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAC3E;QACE,WAAW;QACX,OAAO;QACP,aAAa;QACb,qBAAqB;QACrB,SAAS;QACT,SAAS;KACV,CACF,CAAA;IAED,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,+BAA+B,CAAC,YAAY,IAAI,EAAE,CAAC,EACzD,CAAC,YAAY,CAAC,CACf,CAAA;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,YAC9D,sBAAI,CAAC,CAAC,OAAO,GAAK,GACd,CACP,CAAA;IACH,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,eAAK,SAAS,EAAC,iDAAiD,aAC9D,sBAAI,CAAC,CAAC,KAAK,GAAK,E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E,gBAAgB,EACzB,SAAS,EAAC,0DAA0D,YAEnE,CAAC,CAAC,KAAK,GACD,IACR,CACJ,CAAA;IAED,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,YAC9D,wBACE,cAAK,SAAS,EAAC,6CAA6C,YACzD,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,sBAAI,CAAC,CAAC,SAAS,GAAK,CAAC,CAAC,CAAC,cAAc,GAC7D,GACF,GACF,CACP,CAAA;AACH,CAAC;AAED,MAAM,+BAA+B,GAAG,CACtC,YAA2B,EACI,EAAE;IACjC,MAAM,MAAM,GAAkC,EAAE,CAAA;IAEhD,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;QACjC,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAA;QAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,EAAE,CAAA;QACvD,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,4CAA4C;IACnD,SAAS,EAAE,yBAAyB;IACpC,OAAO,EAAE,uCAAuC;IAChD,KAAK,EAAE,oBAAoB;CAC5B,CAAA"}
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DeviceModel } from '@seamapi/types/devicedb';
3
- interface SupportedDeviceContentRowsProps {
4
- deviceModels: DeviceModel[];
5
- }
6
- export declare function SupportedDeviceContentRows({ deviceModels, }: SupportedDeviceContentRowsProps): JSX.Element | null;
7
- export {};
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
3
- export function SupportedDeviceContentRows({ deviceModels, }) {
4
- return (_jsx("div", { className: 'seam-supported-device-table-content', children: deviceModels.map((deviceModel) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, deviceModel.device_model_id))) }));
5
- }
6
- //# sourceMappingURL=SupportedDeviceContentRows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceContentRows.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAMnG,MAAM,UAAU,0BAA0B,CAAC,EACzC,YAAY,GACoB;IAChC,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YACjD,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACjC,KAAC,kBAAkB,IAEjB,WAAW,EAAE,WAAW,IADnB,WAAW,CAAC,eAAe,CAEhC,CACH,CAAC,GACE,CACP,CAAA;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { Dispatch, SetStateAction } from 'react';
2
- import { type DeviceModelFilters } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
3
- interface SupportedDeviceFilterAreaProps {
4
- filterValue: string;
5
- setFilterValue: (filter: string) => void;
6
- filters: DeviceModelFilters;
7
- setFilters: Dispatch<SetStateAction<DeviceModelFilters>>;
8
- manufacturers: string[] | null;
9
- excludedManufacturers: string[];
10
- }
11
- export declare function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, manufacturers, excludedManufacturers, }: SupportedDeviceFilterAreaProps): JSX.Element;
12
- export {};
@@ -1,58 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FilterCategoryMenu } from '../../../../lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js';
3
- import { supportedIntegrationSupportLevels, } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
4
- import { Button } from '../../../../lib/ui/Button.js';
5
- import { Menu } from '../../../../lib/ui/Menu/Menu.js';
6
- import { SearchTextField } from '../../../../lib/ui/TextField/SearchTextField.js';
7
- import { useFilteredManufacturers } from './use-filtered-manufacturers.js';
8
- export function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, manufacturers, excludedManufacturers, }) {
9
- const appliedFiltersCount = getAppliedFilterCount(filters);
10
- const { manufacturers: manufacturersData } = useFilteredManufacturers({
11
- integrationSupportLevels: filters.supportedOnly
12
- ? supportedIntegrationSupportLevels
13
- : null,
14
- manufacturers,
15
- excludedManufacturers,
16
- });
17
- const resetFilter = (filterType) => {
18
- setFilters((filters) => ({
19
- ...filters,
20
- [filterType]: null,
21
- }));
22
- };
23
- const filterButtonLabel = appliedFiltersCount > 0 ? `${t.filters} (${appliedFiltersCount})` : t.filter;
24
- const allLabel = t.all;
25
- return (_jsxs("div", { className: 'seam-supported-device-table-filter-area', children: [_jsx("div", { className: 'seam-deliberate-block' }), _jsxs("div", { className: 'seam-filters-wrap', children: [_jsx(Menu, { renderButton: ({ onOpen }) => (_jsx(Button, { variant: 'outline', className: 'seam-filters-button', onClick: onOpen, children: filterButtonLabel })), children: _jsxs("div", { className: 'seam-supported-device-table-filter-menu', onClick: (event) => {
26
- event.stopPropagation();
27
- }, children: [_jsx("div", { className: 'seam-filter-menu-row', children: _jsx(FilterCategoryMenu, { label: t.manufacturer, allLabel: allLabel, options: manufacturersData?.map((manufacturer) => manufacturer.display_name) ?? [], onSelect: (manufacturer) => {
28
- setFilters((filters) => ({
29
- ...filters,
30
- manufacturer,
31
- }));
32
- }, buttonLabel: filters.manufacturer ?? allLabel, onAllOptionSelect: () => {
33
- resetFilter('manufacturer');
34
- } }) }), _jsx("div", { className: 'seam-filter-menu-row', children: _jsxs("label", { htmlFor: 'supportedOnly', className: 'seam-filter-checkbox-label', children: [_jsx("p", { children: t.supported }), _jsx("input", { id: 'supportedOnly', name: 'supportedOnly', type: 'checkbox', className: 'seam-filter-checkbox', checked: filters.supportedOnly, onChange: (event) => {
35
- setFilters((filters) => ({
36
- ...filters,
37
- supportedOnly: event.target.checked,
38
- }));
39
- } })] }) })] }) }), _jsx("div", { className: 'seam-supported-device-table-filter-area-search-bar-wrap', children: _jsx(SearchTextField, { value: filterValue, onChange: (value) => {
40
- setFilterValue(value);
41
- }, className: 'seam-supported-device-table-filter-area-search-bar' }) })] })] }));
42
- }
43
- const getAppliedFilterCount = (filters) => {
44
- let count = 0;
45
- if (filters.manufacturer !== null)
46
- count++;
47
- if (!filters.supportedOnly)
48
- count++;
49
- return count;
50
- };
51
- const t = {
52
- all: 'All',
53
- manufacturer: 'Manufacturer',
54
- supported: 'Supported',
55
- filter: 'Filter',
56
- filters: 'Filters',
57
- };
58
- //# sourceMappingURL=SupportedDeviceFilterArea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceFilterArea.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AACnG,OAAO,EAEL,iCAAiC,GAClC,MAAM,wEAAwE,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAW1E,MAAM,UAAU,yBAAyB,CAAC,EACxC,WAAW,EACX,cAAc,EACd,OAAO,EACP,UAAU,EACV,aAAa,EACb,qBAAqB,GACU;IAC/B,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAE1D,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,GAAG,wBAAwB,CAAC;QACpE,wBAAwB,EAAE,OAAO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AAM,CAAC,GAAG;IACR,GAAG,EAAE,KAAK;IACV,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAA"}
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DeviceModel } from '@seamapi/types/devicedb';
3
- interface SupportedDeviceManufacturerSectionProps {
4
- manufacturerId: string;
5
- deviceModels: DeviceModel[];
6
- }
7
- export declare function SupportedDeviceManufacturerSection({ manufacturerId, deviceModels, }: SupportedDeviceManufacturerSectionProps): JSX.Element | null;
8
- export {};
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { ChevronRightIcon } from '../../../../lib/icons/ChevronRight.js';
4
- import { InfoBlueIcon } from '../../../../lib/icons/InfoBlue.js';
5
- import { HiddenDevicesOverlay } from '../../../../lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js';
6
- import { ShowAllDevicesButton } from '../../../../lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js';
7
- import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
8
- import { useManufacturer } from '../../../../lib/seam/components/SupportedDeviceTable/use-manufacturer.js';
9
- import { useToggle } from '../../../../lib/ui/use-toggle.js';
10
- /**
11
- * How many device models required before collapsing the list,
12
- * and requiring the user to click to view all.
13
- */
14
- const maxDevicesBeforeCollapsing = 3;
15
- export function SupportedDeviceManufacturerSection({ manufacturerId, deviceModels, }) {
16
- const { manufacturer } = useManufacturer({ manufacturer_id: manufacturerId });
17
- const [expanded, toggleExpand] = useToggle();
18
- const canExpand = deviceModels.length > maxDevicesBeforeCollapsing;
19
- const visibleDevices = !canExpand || expanded
20
- ? deviceModels
21
- : deviceModels.filter((_deviceModel, index) => index < maxDevicesBeforeCollapsing);
22
- const handleHeaderClick = () => {
23
- if (!canExpand) {
24
- return;
25
- }
26
- toggleExpand();
27
- };
28
- return (_jsxs("div", { className: classNames('seam-manufacturer-section', {
29
- 'can-expand': canExpand,
30
- expanded,
31
- }), children: [_jsxs("div", { className: 'seam-header', onClick: handleHeaderClick, children: [_jsx("img", { src: manufacturer?.logo?.url, alt: manufacturer?.display_name, className: 'seam-manufacturer-image' }), _jsxs("h5", { className: 'seam-manufacturer-name', children: [manufacturer?.display_name, " ", t.devices] }), canExpand && _jsx(ChevronRightIcon, { className: 'chevron' })] }), manufacturer?.annotations.map((annotation, idx) => (_jsx(ManufacturerAnnotationBox, { annotation: annotation }, [annotation.annotation_code, idx].join('_')))), _jsx("div", { className: 'seam-supported-device-table-content', children: visibleDevices.map((deviceModel) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, deviceModel.device_model_id))) }), _jsx(ShowAllDevicesButton, { visible: canExpand, onClick: toggleExpand, expanded: expanded, totalDeviceCount: deviceModels.length }), _jsx(HiddenDevicesOverlay, { visible: canExpand && !expanded })] }));
32
- }
33
- function ManufacturerAnnotationBox({ annotation, }) {
34
- return (_jsxs("div", { className: 'seam-manufacturer-annotation-box', children: [_jsx(InfoBlueIcon, {}), _jsx("p", { className: 'seam-annotation', children: annotation.message })] }));
35
- }
36
- const t = {
37
- devices: 'Devices',
38
- };
39
- //# sourceMappingURL=SupportedDeviceManufacturerSection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceManufacturerSection.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx"],"names":[],"mappings":";AAIA,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,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,EAAC,SAAS,GAAG,IAClD,EACL,YAAY,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC,CAClD,KAAC,yBAAyB,IAExB,UAAU,EAAE,UAAU,IADjB,CAAC,UAAU,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAEhD,CACH,CAAC,EACF,cAAK,SAAS,EAAC,qCAAqC,YACjD,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACnC,KAAC,kBAAkB,IAEjB,WAAW,EAAE,WAAW,IADnB,WAAW,CAAC,eAAe,CAEhC,CACH,CAAC,GACE,EACN,KAAC,oBAAoB,IACnB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,YAAY,CAAC,MAAM,GACrC,EACF,KAAC,oBAAoB,IAAC,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,GAAI,IACrD,CACP,CAAA;AACH,CAAC;AAED,SAAS,yBAAyB,CAAC,EACjC,UAAU,GAGX;IACC,OAAO,CACL,eAAK,SAAS,EAAC,kCAAkC,aAC/C,KAAC,YAAY,KAAG,EAChB,YAAG,SAAS,EAAC,iBAAiB,YAAE,UAAU,CAAC,OAAO,GAAK,IACnD,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;CACnB,CAAA"}
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DeviceModel } from '@seamapi/types/devicedb';
3
- interface SupportedDeviceRowProps {
4
- deviceModel: DeviceModel;
5
- }
6
- export declare function SupportedDeviceRow({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
7
- export declare function ImageColumn({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
8
- export declare function ModelColumn({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
9
- export declare function StatusColumn({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
10
- export {};
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { DotDivider } from '../../../../lib/ui/layout/DotDivider.js';
4
- export function SupportedDeviceRow({ deviceModel, }) {
5
- return (_jsxs("div", { className: 'seam-row', children: [_jsx(ImageColumn, { deviceModel: deviceModel }), _jsx(ModelColumn, { deviceModel: deviceModel }), _jsx(StatusColumn, { deviceModel: deviceModel })] }));
6
- }
7
- export function ImageColumn({ deviceModel, }) {
8
- return (_jsx("div", { className: 'seam-col seam-device-image-col', children: _jsx("div", { className: 'seam-image-box', children: _jsx("img", { width: 40, src: deviceModel.aesthetic_variants[0]?.images[0]?.url }) }) }));
9
- }
10
- export function ModelColumn({ deviceModel, }) {
11
- const sku = deviceModel.aesthetic_variants[0]?.manufacturer_sku;
12
- const connection = deviceModel.main_connection_type === 'unknown'
13
- ? null
14
- : deviceModel.main_connection_type;
15
- return (_jsxs("div", { className: 'seam-col seam-model-col', children: [_jsx("div", { className: 'seam-model-name', children: _jsx("div", { className: 'seam-truncated-text', children: deviceModel.display_name }) }), _jsx("div", { className: 'seam-model-id', children: _jsxs("div", { className: 'seam-truncated-text', children: [sku, sku != null && connection != null && _jsx(DotDivider, {}), connection] }) })] }));
16
- }
17
- export function StatusColumn({ deviceModel, }) {
18
- const statusColor = supportLevelColors[deviceModel.manufacturer.integration] ?? 'unknown';
19
- return (_jsx("div", { className: 'seam-col seam-status-col', children: _jsx("div", { className: classNames('seam-status-pill', `status-${statusColor}`), children: _jsx("span", { children: status[deviceModel.manufacturer.integration] }) }) }));
20
- }
21
- const supportLevelColors = {
22
- stable: 'green',
23
- beta: 'blue',
24
- planned: 'unknown',
25
- unsupported: 'unknown',
26
- inquire: 'unknown',
27
- };
28
- const status = {
29
- stable: 'LIVE',
30
- beta: 'BETA',
31
- unsupported: 'Inquire',
32
- planned: 'Inquire',
33
- inquire: 'Inquire',
34
- };
35
- //# sourceMappingURL=SupportedDeviceRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAMxD,MAAM,UAAU,kBAAkB,CAAC,EACjC,WAAW,GACa;IACxB,OAAO,CACL,eAAK,SAAS,EAAC,UAAU,aACvB,KAAC,WAAW,IAAC,WAAW,EAAE,WAAW,GAAI,EACzC,KAAC,WAAW,IAAC,WAAW,EAAE,WAAW,GAAI,EACzC,KAAC,YAAY,IAAC,WAAW,EAAE,WAAW,GAAI,IACtC,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,WAAW,GACa;IACxB,OAAO,CACL,cAAK,SAAS,EAAC,gCAAgC,YAC7C,cAAK,SAAS,EAAC,gBAAgB,YAC7B,cACE,KAAK,EAAE,EAAE,EACT,GAAG,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GACtD,GACE,GACF,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,WAAW,GACa;IACxB,MAAM,GAAG,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAA;IAC/D,MAAM,UAAU,GACd,WAAW,CAAC,oBAAoB,KAAK,SAAS;QAC5C,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAA;IACtC,OAAO,CACL,eAAK,SAAS,EAAC,yBAAyB,aACtC,cAAK,SAAS,EAAC,iBAAiB,YAC9B,cAAK,SAAS,EAAC,qBAAqB,YAAE,WAAW,CAAC,YAAY,GAAO,GACjE,EACN,cAAK,SAAS,EAAC,eAAe,YAC5B,eAAK,SAAS,EAAC,qBAAqB,aACjC,GAAG,EACH,GAAG,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,IAAI,KAAC,UAAU,KAAG,EACnD,UAAU,IACP,GACF,IACF,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,WAAW,GACa;IACxB,MAAM,WAAW,GACf,kBAAkB,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,SAAS,CAAA;IAEvE,OAAO,CACL,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,UAAU,WAAW,EAAE,CAAC,YACrE,yBAAO,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,GAAQ,GACvD,GACF,CACP,CAAA;AACH,CAAC;AAED,MAAM,kBAAkB,GAGpB;IACF,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,MAAM,GAA+D;IACzE,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACnB,CAAA"}
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { type CommonProps } from '../../../../lib/seam/components/common-props.js';
3
- export interface SupportedDeviceTableProps extends CommonProps {
4
- disableFilter?: boolean;
5
- manufacturers?: string[] | null;
6
- excludedManufacturers?: string[];
7
- includeIf?: string[] | null;
8
- excludeIf?: string[];
9
- }
10
- export declare const NestedSupportedDeviceTable: (props: Partial<import("../../../../lib/seam/components/common-props.js").RequiredCommonProps> & JSX.IntrinsicAttributes & import("../../../../lib/seam/components/common-props.js").RequiredCommonProps) => JSX.Element | null;
11
- export declare function SupportedDeviceTable({ disableFilter, manufacturers, excludedManufacturers, includeIf, excludeIf, className, }?: SupportedDeviceTableProps): JSX.Element;
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { useState } from 'react';
4
- import { withRequiredCommonProps, } from '../../../../lib/seam/components/common-props.js';
5
- import { SupportedDeviceContent } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js';
6
- import { SupportedDeviceFilterArea } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js';
7
- import { useComponentTelemetry } from '../../../../lib/telemetry/index.js';
8
- export const NestedSupportedDeviceTable = withRequiredCommonProps(SupportedDeviceTable);
9
- export function SupportedDeviceTable({ disableFilter = false, manufacturers = null, excludedManufacturers = [], includeIf = null, excludeIf = [], className, } = {}) {
10
- useComponentTelemetry('SupportedDeviceTable');
11
- const [filterValue, setFilterValue] = useState('');
12
- const [filters, setFilters] = useState({
13
- supportedOnly: true,
14
- manufacturer: null,
15
- });
16
- return (_jsxs("div", { className: classNames('seam-supported-device-table-content-wrap', className), children: [!disableFilter && (_jsx(SupportedDeviceFilterArea, { filterValue: filterValue, setFilterValue: setFilterValue, filters: filters, setFilters: setFilters, manufacturers: manufacturers, excludedManufacturers: excludedManufacturers })), _jsx(SupportedDeviceContent, { resetFilterValue: () => {
17
- setFilterValue('');
18
- }, filterValue: filterValue, filters: filters, manufacturers: manufacturers, excludedManufacturers: excludedManufacturers, includeIf: includeIf, excludeIf: excludeIf })] }));
19
- }
20
- //# sourceMappingURL=SupportedDeviceTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceTable.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAEL,uBAAuB,GACxB,MAAM,q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AAA;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { type CommonProps } from '../../../../lib/seam/components/common-props.js';
3
- export interface SupportedDeviceTableManufacturerKeysProps extends CommonProps {
4
- }
5
- export declare const NestedSupportedDeviceTableManufacturerKeys: (props: Partial<import("../../../../lib/seam/components/common-props.js").RequiredCommonProps> & JSX.IntrinsicAttributes & import("../../../../lib/seam/components/common-props.js").RequiredCommonProps) => JSX.Element | null;
6
- export declare function SupportedDeviceTableManufacturerKeys({ className, }?: SupportedDeviceTableManufacturerKeysProps): JSX.Element;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { CopyIcon } from '../../../../lib/icons/Copy.js';
4
- import { withRequiredCommonProps, } from '../../../../lib/seam/components/common-props.js';
5
- import { useComponentTelemetry } from '../../../../lib/telemetry/index.js';
6
- import { copyToClipboard } from '../../../../lib/ui/clipboard.js';
7
- import { MenuItem } from '../../../../lib/ui/Menu/MenuItem.js';
8
- import { useManufacturers } from './use-manufacturers.js';
9
- export const NestedSupportedDeviceTableManufacturerKeys = withRequiredCommonProps(SupportedDeviceTableManufacturerKeys);
10
- export function SupportedDeviceTableManufacturerKeys({ className, } = {}) {
11
- useComponentTelemetry('SupportedDeviceTableManufacturerKeys');
12
- const { manufacturers } = useManufacturers();
13
- return (_jsx("div", { className: classNames('supported-device-table-manufacturer-keys', className), children: manufacturers?.map((manufacturer) => (_jsx(ManufacturerKey, { manufacturer: manufacturer }, manufacturer.manufacturer_id))) }));
14
- }
15
- function ManufacturerKey({ manufacturer, }) {
16
- const key = manufacturer.display_name;
17
- return (_jsxs("div", { className: 'seam-manufacturer-key', children: [_jsx("div", { className: 'seam-manufacturer-key-value', children: key }), _jsx(MenuItem, { className: 'seam-copy-button', onClick: () => {
18
- void copyToClipboard(key);
19
- }, children: _jsx(CopyIcon, {}) })] }));
20
- }
21
- //# sourceMappingURL=SupportedDeviceTableManufacturerKeys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceTableManufacturerKeys.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAEL,uBAAuB,GACxB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAKzD,MAAM,CAAC,MAAM,0CAA0C,GACrD,uBAAuB,CAAC,oCAAoC,CAAC,CAAA;AAE/D,MAAM,UAAU,oCAAoC,CAAC,EACnD,SAAS,MACoC,EAAE;IAC/C,qBAAqB,CAAC,sCAAsC,CAAC,CAAA;IAE7D,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAE5C,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CACnB,0CAA0C,EAC1C,SAAS,CACV,YAEA,aAAa,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CACpC,KAAC,eAAe,IAEd,YAAY,EAAE,YAAY,IADrB,YAAY,CAAC,eAAe,CAEjC,CACH,CAAC,GACE,CACP,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,YAAY,GAGb;IACC,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAA;IACrC,OAAO,CACL,eAAK,SAAS,EAAC,uBAAuB,aACpC,cAAK,SAAS,EAAC,6BAA6B,YAAE,GAAG,GAAO,EACxD,KAAC,QAAQ,IACP,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,eAAe,CAAC,GAAG,CAAC,CAAA;gBAC3B,CAAC,YAED,KAAC,QAAQ,KAAG,GACH,IACP,CACP,CAAA;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { DeviceModel, RouteRequestParams } from '@seamapi/types/devicedb';
2
- import type { UseSeamQueryResultLegacy } from '../../../../lib/seam/use-seam-query-result.js';
3
- export type UseDeviceModelParams = DeviceModelsGetParams;
4
- export type UseDeviceModelData = DeviceModel | null;
5
- export declare function useDeviceModel(params: UseDeviceModelParams): UseSeamQueryResultLegacy<'deviceModel', UseDeviceModelData>;
6
- type DeviceModelsGetParams = RouteRequestParams<'/v1/device_models/get'>;
7
- export {};
@@ -1,21 +0,0 @@
1
- import { useSeamClient } from '@seamapi/react-query';
2
- import { useQuery } from '@tanstack/react-query';
3
- export function useDeviceModel(params) {
4
- const { client: seam } = useSeamClient();
5
- const { data, ...rest } = useQuery({
6
- enabled: seam != null,
7
- queryKey: ['internal', 'device_models', 'get', params],
8
- queryFn: async () => {
9
- if (seam == null)
10
- return null;
11
- const { data: { device_model: deviceModel }, } = await seam.client.get('/internal/devicedb/v1/device_models/get', { params });
12
- // UPSTREAM: Response type does not match DeviceModel.
13
- return deviceModel;
14
- },
15
- });
16
- return {
17
- ...rest,
18
- deviceModel: data,
19
- };
20
- }
21
- //# sourceMappingURL=use-device-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-device-model.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-device-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAMpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQhD,MAAM,UAAU,cAAc,CAC5B,MAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAA;IACxC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAuC;QACvE,OAAO,EAAE,IAAI,IAAI,IAAI;QACrB,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC;QACtD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,IAAI,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAA;YAC7B,MAAM,EACJ,IAAI,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,GACpC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACvB,yCAAyC,EACzC,EAAE,MAAM,EAAE,CACX,CAAA;YACD,sDAAsD;YACtD,OAAO,WAA0B,CAAA;QACnC,CAAC;KACF,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,IAAI;QACP,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { DeviceModel, RouteRequestParams } from '@seamapi/types/devicedb';
2
- import type { UseSeamQueryResultLegacy } from '../../../../lib/seam/use-seam-query-result.js';
3
- export type UseDeviceModelsParams = DeviceModelsListParams;
4
- export type UseDeviceModelsData = DeviceModel[];
5
- export declare function useDeviceModels(params?: UseDeviceModelsParams): UseSeamQueryResultLegacy<'deviceModels', UseDeviceModelsData>;
6
- type DeviceModelsListParams = RouteRequestParams<'/v1/device_models/list'>;
7
- export {};
@@ -1,30 +0,0 @@
1
- import { useSeamClient } from '@seamapi/react-query';
2
- import { useQuery, useQueryClient } from '@tanstack/react-query';
3
- export function useDeviceModels(params) {
4
- const { client: seam } = useSeamClient();
5
- const queryClient = useQueryClient();
6
- const { data, ...rest } = useQuery({
7
- enabled: seam != null,
8
- queryKey: ['internal', 'device_models', 'list', params],
9
- queryFn: async () => {
10
- if (seam == null)
11
- return [];
12
- const { data: { device_models: deviceModels }, } = await seam.client.get('/internal/devicedb/v1/device_models/list', { params });
13
- for (const deviceModel of deviceModels) {
14
- queryClient.setQueryData([
15
- 'internal',
16
- 'device_models',
17
- 'get',
18
- { device_model_id: deviceModel.device_model_id },
19
- ], deviceModel);
20
- }
21
- // UPSTREAM: Response type does not match DeviceModel[].
22
- return deviceModels;
23
- },
24
- });
25
- return {
26
- ...rest,
27
- deviceModels: data,
28
- };
29
- }
30
- //# sourceMappingURL=use-device-models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-device-models.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-device-models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAMpD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAQhE,MAAM,UAAU,eAAe,CAC7B,MAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAA;IACxC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAwC;QACxE,OAAO,EAAE,IAAI,IAAI,IAAI;QACrB,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC;QACvD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,IAAI,IAAI,IAAI;gBAAE,OAAO,EAAE,CAAA;YAC3B,MAAM,EACJ,IAAI,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,GACtC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACvB,0CAA0C,EAC1C,EAAE,MAAM,EAAE,CACX,CAAA;YACD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,WAAW,CAAC,YAAY,CACtB;oBACE,UAAU;oBACV,eAAe;oBACf,KAAK;oBACL,EAAE,eAAe,EAAE,WAAW,CAAC,eAAe,EAAE;iBACjD,EACD,WAAW,CACZ,CAAA;YACH,CAAC;YACD,wDAAwD;YACxD,OAAO,YAA6B,CAAA;QACtC,CAAC;KACF,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,IAAI;QACP,YAAY,EAAE,IAAI;KACnB,CAAA;AACH,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { ManufacturerIntegrationSupportLevel } from '@seamapi/types/devicedb';
2
- import { useDeviceModels } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-models.js';
3
- export interface DeviceModelFilters {
4
- supportedOnly: boolean;
5
- manufacturer: string | null;
6
- }
7
- export declare const supportedIntegrationSupportLevels: ManufacturerIntegrationSupportLevel[];
8
- export declare const useFilteredDeviceModels: ({ filterValue, filters, includeIf, excludeIf, ...manufacturersParams }: {
9
- filterValue: string;
10
- filters: DeviceModelFilters;
11
- manufacturers: string[] | null;
12
- excludedManufacturers: string[];
13
- includeIf: string[] | null;
14
- excludeIf: string[];
15
- }) => ReturnType<typeof useDeviceModels>;
@@ -1,45 +0,0 @@
1
- import { useDeviceModels, } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-models.js';
2
- import { useFilteredManufacturers } from './use-filtered-manufacturers.js';
3
- export const supportedIntegrationSupportLevels = ['stable', 'beta'];
4
- export const useFilteredDeviceModels = ({ filterValue, filters, includeIf, excludeIf, ...manufacturersParams }) => {
5
- const { manufacturers } = useFilteredManufacturers({
6
- ...manufacturersParams,
7
- integrationSupportLevels: filters.supportedOnly
8
- ? supportedIntegrationSupportLevels
9
- : null,
10
- });
11
- const params = {};
12
- if (excludeIf.length > 0) {
13
- params.exclude_if = excludeIf;
14
- }
15
- // UPSTREAM: API does not parse zero-length arrays correctly.
16
- if (includeIf != null && includeIf.length > 0) {
17
- params.include_if = includeIf;
18
- }
19
- if (filterValue.trim() !== '') {
20
- params.text_search = filterValue.trim();
21
- }
22
- if (filters.supportedOnly) {
23
- params.integration_support_levels = supportedIntegrationSupportLevels;
24
- }
25
- if (filters.manufacturer !== null) {
26
- const manufacturer = manufacturers?.find((manufacturer) => manufacturer.display_name === filters.manufacturer);
27
- if (manufacturer != null) {
28
- params.manufacturer_id = manufacturer.manufacturer_id;
29
- }
30
- }
31
- if (filters.manufacturer == null && manufacturers != null) {
32
- params.manufacturer_ids = manufacturers.map((m) => m.manufacturer_id);
33
- }
34
- const { deviceModels, ...rest } = useDeviceModels(params);
35
- return {
36
- ...rest,
37
- deviceModels:
38
- // UPSTREAM: API does not parse zero-length arrays correctly.
39
- includeIf?.length === 0
40
- ? []
41
- : deviceModels?.filter((deviceModel) => manufacturers?.some((manufacturer) => deviceModel.manufacturer.manufacturer_id ===
42
- manufacturer.manufacturer_id)),
43
- };
44
- };
45
- //# sourceMappingURL=use-filtered-device-models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-filtered-device-models.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,GAEhB,MAAM,+DAA+D,CAAA;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAO1E,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;AAEpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,EACT,GAAG,mBAAmB,EAQvB,EAAsC,EAAE;IACvC,MAAM,EAAE,aAAa,EAAE,GAAG,wBAAwB,CAAC;QACjD,GAAG,mBAAmB;QACtB,wBAAwB,EAAE,OAAO,CAAC,aAAa;YAC7C,CAAC,CAAC,iCAAiC;YACnC,CAAC,CAAC,IAAI;KACT,CAAC,CAAA;IAEF,MAAM,MAAM,GAA0B,EAAE,CAAA;IAExC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,UAAU,GAAG,SAAS,CAAA;IAC/B,CAAC;IAED,6DAA6D;IAC7D,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,E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@@ -1,10 +0,0 @@
1
- import type { ManufacturerIntegrationSupportLevel } from '@seamapi/types/devicedb';
2
- import { useManufacturers } from '../../../../lib/seam/components/SupportedDeviceTable/use-manufacturers.js';
3
- interface Params {
4
- manufacturers: string[] | null;
5
- excludedManufacturers: string[];
6
- integrationSupportLevels: ManufacturerIntegrationSupportLevel[] | null;
7
- }
8
- export declare const useFilteredManufacturers: ({ integrationSupportLevels, ...params }: Params) => ReturnType<typeof useManufacturers>;
9
- export declare const createLiqeQuery: ({ manufacturers, excludedManufacturers, }: Pick<Params, 'manufacturers' | 'excludedManufacturers'>) => string | undefined;
10
- export {};
@@ -1,42 +0,0 @@
1
- import { useManufacturers } from '../../../../lib/seam/components/SupportedDeviceTable/use-manufacturers.js';
2
- export const useFilteredManufacturers = ({ integrationSupportLevels, ...params }) => {
3
- const { manufacturers, ...rest } = useManufacturers({
4
- integration_support_levels: integrationSupportLevels ?? undefined,
5
- liqe_query: createLiqeQuery(params),
6
- });
7
- return {
8
- ...rest,
9
- manufacturers: manufacturers?.filter((manufacturer) => manufacturer.device_model_count > 0),
10
- };
11
- };
12
- export const createLiqeQuery = ({ manufacturers, excludedManufacturers, }) => {
13
- if ((manufacturers?.some(isInvalidInput) ?? false) ||
14
- excludedManufacturers.some(isInvalidInput)) {
15
- return undefined;
16
- }
17
- const excludedManufacturersClause = `NOT (${excludedManufacturers
18
- .map(manufacturerToMatcher)
19
- .join(' OR ')})`;
20
- if (manufacturers == null) {
21
- if (excludedManufacturers.length === 0)
22
- return undefined;
23
- return excludedManufacturersClause;
24
- }
25
- if (manufacturers.length === 0) {
26
- return 'manufacturer_id:none';
27
- }
28
- const includedManufacturersClause = `(${manufacturers
29
- .map(manufacturerToMatcher)
30
- .join(' OR ')})`;
31
- if (excludedManufacturers.length === 0)
32
- return includedManufacturersClause;
33
- return `${includedManufacturersClause} AND ${excludedManufacturersClause}`;
34
- };
35
- const manufacturerToMatcher = (value) => {
36
- const [manufacturer, uuid] = value.split('=');
37
- if (uuid != null)
38
- return `manufacturer_id:"${uuid}"`;
39
- return `display_name:"${manufacturer}"`;
40
- };
41
- const isInvalidInput = (value) => value.includes('"');
42
- //# sourceMappingURL=use-filtered-manufacturers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-filtered-manufacturers.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+DAA+D,CAAA;AAQhG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,wBAAwB,EACxB,GAAG,MAAM,EACF,EAAuC,EAAE;IAChD,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,gBAAgB,CAAC;QAClD,0BAA0B,EAAE,wBAAwB,IAAI,SAAS;QACjE,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC;KACpC,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,IAAI;QACP,aAAa,EAAE,aAAa,EAAE,MAAM,CAClC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,kBAAkB,GAAG,CAAC,CACtD;KACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,aAAa,EACb,qBAAqB,GACmC,EAE5C,EAAE;IACd,IACE,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;QAC9C,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC,EAC1C,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,2BAA2B,GAAG,QAAQ,qBAAqB;SAC9D,GAAG,CAAC,qBAAqB,CAAC;SAC1B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAA;IAElB,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAA;QACxD,OAAO,2BAA2B,CAAA;IACpC,CAAC;IAED,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,sBAAsB,CAAA;IAC/B,CAAC;IAED,MAAM,2BAA2B,GAAG,IAAI,aAAa;SAClD,GAAG,CAAC,qBAAqB,CAAC;SAC1B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAA;IAElB,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,2BAA2B,CAAA;IAE1E,OAAO,GAAG,2BAA2B,QAAQ,2BAA2B,EAAE,CAAA;AAC5E,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAU,EAAE;IACtD,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC7C,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,oBAAoB,IAAI,GAAG,CAAA;IACpD,OAAO,iBAAiB,YAAY,GAAG,CAAA;AACzC,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- import type { Manufacturer, RouteRequestParams } from '@seamapi/types/devicedb';
2
- import type { UseSeamQueryResultLegacy } from '../../../../lib/seam/use-seam-query-result.js';
3
- export type UseManufacturerParams = ManufacturersGetParams;
4
- export type UseManufacturerData = Manufacturer | null;
5
- export declare function useManufacturer(params: UseManufacturerParams): UseSeamQueryResultLegacy<'manufacturer', UseManufacturerData>;
6
- type ManufacturersGetParams = RouteRequestParams<'/v1/manufacturers/get'>;
7
- export {};