@seamapi/react 1.65.0 → 2.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.
- package/README.md +1 -1
- package/dist/elements.js +6760 -6689
- package/dist/elements.js.map +1 -1
- package/dist/index.css +15 -15
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +1 -5
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +2 -2
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +2 -2
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +1 -5
- package/lib/seam/components/DeviceTable/DeviceTable.js +2 -2
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +3 -3
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +11 -17
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +1 -7
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +3 -3
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +12 -31
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.d.ts +2 -2
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.js +2 -4
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +8 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +35 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +2 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +10 -6
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +3 -7
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +4 -5
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +5 -5
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +16 -17
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +8 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +37 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +2 -8
- package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +2 -2
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +2 -8
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +23 -29
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -9
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +22 -41
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.tsx +8 -12
- package/src/lib/seam/components/SupportedDeviceTable/{SupportedDeviceBrandSection.tsx → SupportedDeviceManufacturerSection.tsx} +19 -26
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +20 -11
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +2 -3
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +10 -17
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +31 -20
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +54 -0
- package/src/lib/version.ts +1 -1
- package/src/styles/_supported-device-table.scss +4 -4
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.d.ts +0 -8
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.js +0 -42
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-provider.d.ts +0 -2
- package/lib/seam/components/SupportedDeviceTable/use-device-provider.js +0 -13
- package/lib/seam/components/SupportedDeviceTable/use-device-provider.js.map +0 -1
- package/lib/seam/device-models/use-device-models.d.ts +0 -5
- package/lib/seam/device-models/use-device-models.js +0 -19
- package/lib/seam/device-models/use-device-models.js.map +0 -1
- package/lib/strings.d.ts +0 -1
- package/lib/strings.js +0 -4
- package/lib/strings.js.map +0 -1
- package/src/lib/seam/components/SupportedDeviceTable/use-device-provider.ts +0 -16
- package/src/lib/seam/device-models/use-device-models.ts +0 -39
- package/src/lib/strings.ts +0 -3
|
@@ -25,7 +25,7 @@ export const defaultDeviceFilter = (device, searchInputValue) => {
|
|
|
25
25
|
return device.properties.name.toLowerCase().includes(value);
|
|
26
26
|
};
|
|
27
27
|
export const NestedDeviceTable = withRequiredCommonProps(DeviceTable);
|
|
28
|
-
export function DeviceTable({ deviceIds, connectedAccountIds, disableSearch = false, onDeviceClick = () => { }, preventDefaultOnDeviceClick = false, deviceFilter = defaultDeviceFilter, deviceComparator = compareByCreatedAtDesc, heading = t.devices,
|
|
28
|
+
export function DeviceTable({ deviceIds, connectedAccountIds, disableSearch = false, onDeviceClick = () => { }, preventDefaultOnDeviceClick = false, deviceFilter = defaultDeviceFilter, deviceComparator = compareByCreatedAtDesc, heading = t.devices, errorFilter = () => true, warningFilter = () => true, disableLockUnlock = false, disableCreateAccessCode = false, disableEditAccessCode = false, disableDeleteAccessCode = false, disableResourceIds = false, onBack, className, } = {}) {
|
|
29
29
|
useComponentTelemetry('DeviceTable');
|
|
30
30
|
const { devices, isInitialLoading, isError, refetch } = useDevices({
|
|
31
31
|
device_ids: deviceIds,
|
|
@@ -48,7 +48,7 @@ export function DeviceTable({ deviceIds, connectedAccountIds, disableSearch = fa
|
|
|
48
48
|
setSelectedDeviceId(null);
|
|
49
49
|
}, className: className }));
|
|
50
50
|
}
|
|
51
|
-
return (_jsxs("div", { className: classNames('seam-device-table', className), children: [_jsx(ContentHeader, { onBack: onBack }), _jsxs(TableHeader, { children: [
|
|
51
|
+
return (_jsxs("div", { className: classNames('seam-device-table', className), children: [_jsx(ContentHeader, { onBack: onBack }), _jsxs(TableHeader, { children: [heading != null ? (_jsxs(TableTitle, { children: [heading, " ", _jsxs(Caption, { children: ["(", filteredDevices.length, ")"] })] })) : (_jsx("div", { className: 'seam-fragment' })), _jsx("div", { className: 'seam-table-header-loading-wrap', children: _jsx(LoadingToast, { isLoading: isInitialLoading, label: t.loading, top: -20 }) }), !disableSearch && (_jsx(SearchTextField, { value: searchInputValue, onChange: setSearchInputValue, disabled: (devices?.length ?? 0) === 0 }))] }), _jsx(TableBody, { children: _jsx(Content, { devices: filteredDevices, onDeviceClick: handleDeviceClick, errorFilter: errorFilter }) }), _jsx(Snackbar, { variant: 'error', visible: isError, message: t.fallbackErrorMessage, action: {
|
|
52
52
|
label: t.tryAgain,
|
|
53
53
|
onClick: () => {
|
|
54
54
|
void refetch();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceTable.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/DeviceTable/DeviceTable.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAqB,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAEL,uBAAuB,GACxB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AACxF,OAAO,EAGL,eAAe,GAChB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAA;AACxE,OAAO,EACL,UAAU,GAEX,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"DeviceTable.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/DeviceTable/DeviceTable.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MA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MAAM,KAAK,eAAe,EAAE;YAC9B,OAAO,CACL,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,IAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CACvE,CAAA;SACF;QAED,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;IAEF,OAAO,CACL,8BACE,KAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,SAAS,EACzB,WAAW,EAAE,WAAW,GACxB,EACD,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC/B,KAAC,SAAS,IACR,MAAM,EAAE,MAAM,EAEd,OAAO,EAAE,GAAG,EAAE;oBACZ,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACjC,CAAC,IAHI,MAAM,CAAC,SAAS,CAIrB,CACH,CAAC,IACD,CACJ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,8BAA8B;IAChD,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,WAAW;IACrB,oBAAoB,EAAE,6BAA6B;CACpD,CAAA"}
|
|
@@ -4,8 +4,8 @@ interface SupportedDeviceContentProps {
|
|
|
4
4
|
filterValue: string;
|
|
5
5
|
resetFilterValue: () => void;
|
|
6
6
|
filters: DeviceModelFilters;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
manufacturers: string[] | null;
|
|
8
|
+
excludedManufacturers: string[];
|
|
9
9
|
}
|
|
10
|
-
export declare function SupportedDeviceContent({ resetFilterValue, filterValue, filters,
|
|
10
|
+
export declare function SupportedDeviceContent({ resetFilterValue, filterValue, filters, manufacturers, excludedManufacturers, }: SupportedDeviceContentProps): JSX.Element | null;
|
|
11
11
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { SupportedDeviceBrandSection } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.js';
|
|
3
2
|
import { SupportedDeviceFilterResultRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.js';
|
|
3
|
+
import { SupportedDeviceManufacturerSection } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js';
|
|
4
4
|
import { useFilteredDeviceModels, } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
|
|
5
5
|
import { Button } from '../../../../lib/ui/Button.js';
|
|
6
|
-
export function SupportedDeviceContent({ resetFilterValue, filterValue, filters,
|
|
6
|
+
export function SupportedDeviceContent({ resetFilterValue, filterValue, filters, manufacturers, excludedManufacturers, }) {
|
|
7
7
|
const { deviceModels, isLoading, isError, refetch } = useFilteredDeviceModels({
|
|
8
8
|
filterValue,
|
|
9
9
|
filters,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
manufacturers,
|
|
11
|
+
excludedManufacturers,
|
|
12
12
|
});
|
|
13
13
|
if (isLoading) {
|
|
14
14
|
return (_jsx("div", { className: 'seam-supported-device-table-content-state-block', children: _jsx("p", { children: t.loading }) }));
|
|
@@ -25,28 +25,22 @@ export function SupportedDeviceContent({ resetFilterValue, filterValue, filters,
|
|
|
25
25
|
if (isEmpty) {
|
|
26
26
|
return (_jsx("div", { className: 'seam-supported-device-table-content', children: _jsx(EmptyResult, { filterValue: filterValue, resetFilterValue: resetFilterValue }) }));
|
|
27
27
|
}
|
|
28
|
-
const hasFilters = filterValue.trim() !== '' || filters.
|
|
28
|
+
const hasFilters = filterValue.trim() !== '' || filters.manufacturer !== null;
|
|
29
29
|
if (hasFilters) {
|
|
30
|
-
return (_jsx("div", { className: 'seam-supported-device-table-content', children: deviceModels.map((deviceModel
|
|
31
|
-
deviceModel.main_category,
|
|
32
|
-
deviceModel.brand,
|
|
33
|
-
deviceModel.model_name,
|
|
34
|
-
deviceModel.manufacturer_model_id,
|
|
35
|
-
index,
|
|
36
|
-
].join(':')))) }));
|
|
30
|
+
return (_jsx("div", { className: 'seam-supported-device-table-content', children: deviceModels.map((deviceModel) => (_jsx(SupportedDeviceFilterResultRow, { deviceModel: deviceModel }, deviceModel.device_model_id))) }));
|
|
37
31
|
}
|
|
38
|
-
return (_jsx(_Fragment, { children: Object.entries(
|
|
32
|
+
return (_jsx(_Fragment, { children: Object.entries(groupDeviceModelsByManufacturer(deviceModels)).map(([manufacturerId, models]) => (_jsx(SupportedDeviceManufacturerSection, { manufacturerId: manufacturerId, deviceModels: models }, manufacturerId))) }));
|
|
39
33
|
}
|
|
40
34
|
function EmptyResult({ filterValue, resetFilterValue, }) {
|
|
41
35
|
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 })] }));
|
|
42
36
|
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 }) }) }));
|
|
43
37
|
}
|
|
44
|
-
function
|
|
38
|
+
function groupDeviceModelsByManufacturer(deviceModels) {
|
|
45
39
|
const result = {};
|
|
46
40
|
for (const model of deviceModels) {
|
|
47
|
-
const {
|
|
48
|
-
const list = result[
|
|
49
|
-
result[
|
|
41
|
+
const { manufacturer } = model;
|
|
42
|
+
const list = result[manufacturer.manufacturer_id] ?? [];
|
|
43
|
+
result[manufacturer.manufacturer_id] = [...list, model];
|
|
50
44
|
}
|
|
51
45
|
return result;
|
|
52
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceContent.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SupportedDeviceContent.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4EAA4E,CAAA;AAC3H,OAAO,EAAE,kCAAkC,EAAE,MAAM,gFAAgF,CAAA;AAEnI,OAAO,EAEL,uBAAuB,GACxB,MAAM,wEAAwE,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAUzC,MAAM,UAAU,sBAAsB,CAAC,EACrC,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,aAAa,EACb,qBAAqB,GACO;IAC5B,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAC3E;QACE,WAAW;QACX,OAAO;QACP,aAAa;QACb,qBAAqB;KACtB,CACF,CAAA;IAED,IAAI,SAAS,EAAE;QACb,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,YAC9D,sBAAI,CAAC,CAAC,OAAO,GAAK,GACd,CACP,CAAA;KACF;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CACL,eAAK,SAAS,EAAC,iDAAiD,aAC9D,sBAAI,CAAC,CAAC,KAAK,GAAK,EAChB,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;wBACZ,KAAK,OAAO,EAAE,CAAA;oBAChB,CAAC,YAEA,CAAC,CAAC,KAAK,GACD,IACL,CACP,CAAA;KACF;IAED,IAAI,YAAY,IAAI,IAAI,EAAE;QACxB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,KAAK,CAAC,CAAA;IACzC,IAAI,OAAO,EAAE;QACX,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YAClD,KAAC,WAA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CACtC,YAAiC;IAEjC,MAAM,MAAM,GAAoC,EAAE,CAAA;IAElD,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;QAChC,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;KACxD;IACD,OAAO,MAAM,CAAA;AACf,CAAC;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,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
import type { UseDeviceModelsData } from '../../../../lib/seam/
|
|
2
|
+
import type { UseDeviceModelsData } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-models.js';
|
|
3
3
|
interface SupportedDeviceContentRowsProps {
|
|
4
4
|
deviceModels: UseDeviceModelsData;
|
|
5
5
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
|
|
3
3
|
export function SupportedDeviceContentRows({ deviceModels, }) {
|
|
4
|
-
return (_jsx("div", { className: 'seam-supported-device-table-content', children: deviceModels.map((deviceModel
|
|
5
|
-
deviceModel.main_category,
|
|
6
|
-
deviceModel.brand,
|
|
7
|
-
deviceModel.model_name,
|
|
8
|
-
deviceModel.manufacturer_model_id,
|
|
9
|
-
index,
|
|
10
|
-
].join(':')))) }));
|
|
4
|
+
return (_jsx("div", { className: 'seam-supported-device-table-content', children: deviceModels.map((deviceModel) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, deviceModel.device_model_id))) }));
|
|
11
5
|
}
|
|
12
6
|
//# sourceMappingURL=SupportedDeviceContentRows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceContentRows.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAOnG,MAAM,UAAU,0BAA0B,CAAC,EACzC,YAAY,GACoB;IAChC,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YACjD,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"SupportedDeviceContentRows.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAOnG,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"}
|
|
@@ -5,8 +5,8 @@ interface SupportedDeviceFilterAreaProps {
|
|
|
5
5
|
setFilterValue: (filter: string) => void;
|
|
6
6
|
filters: DeviceModelFilters;
|
|
7
7
|
setFilters: Dispatch<SetStateAction<DeviceModelFilters>>;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
manufacturers: string[] | null;
|
|
9
|
+
excludedManufacturers: string[];
|
|
10
10
|
}
|
|
11
|
-
export declare function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters,
|
|
11
|
+
export declare function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, manufacturers, excludedManufacturers, }: SupportedDeviceFilterAreaProps): JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FilterCategoryMenu } from '../../../../lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js';
|
|
3
|
-
import { useDeviceModels } from '../../../../lib/seam/device-models/use-device-models.js';
|
|
4
|
-
import { capitalize } from '../../../../lib/strings.js';
|
|
5
3
|
import { Button } from '../../../../lib/ui/Button.js';
|
|
6
4
|
import { Menu } from '../../../../lib/ui/Menu/Menu.js';
|
|
7
5
|
import { SearchTextField } from '../../../../lib/ui/TextField/SearchTextField.js';
|
|
8
|
-
|
|
6
|
+
import { useFilteredManufacturers } from './use-filtered-manufacturers.js';
|
|
7
|
+
export function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, manufacturers, excludedManufacturers, }) {
|
|
9
8
|
const appliedFiltersCount = getAppliedFilterCount(filters);
|
|
10
|
-
const
|
|
9
|
+
const { manufacturers: availableManufacturers } = useFilteredManufacturers({
|
|
10
|
+
manufacturers,
|
|
11
|
+
excludedManufacturers,
|
|
12
|
+
});
|
|
11
13
|
const resetFilter = (filterType) => {
|
|
12
14
|
setFilters((filters) => ({
|
|
13
15
|
...filters,
|
|
@@ -18,13 +20,13 @@ export function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters
|
|
|
18
20
|
const allLabel = t.all;
|
|
19
21
|
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) => {
|
|
20
22
|
event.stopPropagation();
|
|
21
|
-
}, children: [_jsx("div", { className: 'seam-filter-menu-row', children: _jsx(FilterCategoryMenu, { label: t.
|
|
23
|
+
}, children: [_jsx("div", { className: 'seam-filter-menu-row', children: _jsx(FilterCategoryMenu, { label: t.manufacturer, allLabel: allLabel, options: availableManufacturers?.map((manufacturer) => manufacturer.display_name) ?? [], onSelect: (manufacturer) => {
|
|
22
24
|
setFilters((filters) => ({
|
|
23
25
|
...filters,
|
|
24
|
-
|
|
26
|
+
manufacturer,
|
|
25
27
|
}));
|
|
26
|
-
}, buttonLabel: filters.
|
|
27
|
-
resetFilter('
|
|
28
|
+
}, buttonLabel: filters.manufacturer ?? allLabel, onAllOptionSelect: () => {
|
|
29
|
+
resetFilter('manufacturer');
|
|
28
30
|
} }) }), _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) => {
|
|
29
31
|
setFilters((filters) => ({
|
|
30
32
|
...filters,
|
|
@@ -36,36 +38,15 @@ export function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters
|
|
|
36
38
|
}
|
|
37
39
|
const getAppliedFilterCount = (filters) => {
|
|
38
40
|
let count = 0;
|
|
39
|
-
if (filters.
|
|
41
|
+
if (filters.manufacturer !== null)
|
|
40
42
|
count++;
|
|
41
43
|
if (!filters.supportedOnly)
|
|
42
44
|
count++;
|
|
43
45
|
return count;
|
|
44
46
|
};
|
|
45
|
-
const useAvailableBrands = (brands, excludedBrands) => {
|
|
46
|
-
const { deviceModels } = useDeviceModels();
|
|
47
|
-
if (deviceModels == null)
|
|
48
|
-
return [];
|
|
49
|
-
const availableBrands = deviceModels
|
|
50
|
-
.map(({ brand }) => brand.trim())
|
|
51
|
-
.filter((brand) => {
|
|
52
|
-
// UPSTREAM: API can return an empty value for brand.
|
|
53
|
-
return brand !== '';
|
|
54
|
-
})
|
|
55
|
-
.filter((brand) => {
|
|
56
|
-
if (brands === null)
|
|
57
|
-
return true;
|
|
58
|
-
return brands.includes(brand);
|
|
59
|
-
})
|
|
60
|
-
.filter((brand) => {
|
|
61
|
-
return !excludedBrands.includes(brand);
|
|
62
|
-
})
|
|
63
|
-
.map((brand) => capitalize(brand));
|
|
64
|
-
return Array.from(new Set(availableBrands));
|
|
65
|
-
};
|
|
66
47
|
const t = {
|
|
67
48
|
all: 'All',
|
|
68
|
-
|
|
49
|
+
manufacturer: 'Manufacturer',
|
|
69
50
|
supported: 'Supported',
|
|
70
51
|
filter: 'Filter',
|
|
71
52
|
filters: 'Filters',
|
|
@@ -1 +1 @@
|
|
|
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;AAEnG,OAAO,EAAE,
|
|
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;AAEnG,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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AAA;AACd,CAAC,CAAA;AAED,MAAM,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,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
import type {
|
|
2
|
+
import type { DeviceModelV1 } from '@seamapi/types/devicedb';
|
|
3
3
|
interface SupportedDeviceFilterResultRowProps {
|
|
4
|
-
deviceModel:
|
|
4
|
+
deviceModel: DeviceModelV1;
|
|
5
5
|
}
|
|
6
6
|
export declare function SupportedDeviceFilterResultRow({ deviceModel, }: SupportedDeviceFilterResultRowProps): JSX.Element;
|
|
7
7
|
export declare function ModelColumn({ deviceModel, }: SupportedDeviceFilterResultRowProps): JSX.Element;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useDeviceProvider } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-provider.js';
|
|
2
|
+
import { ImageColumn, StatusColumn, } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
|
|
4
3
|
import { DotDivider } from '../../../../lib/ui/layout/DotDivider.js';
|
|
5
4
|
export function SupportedDeviceFilterResultRow({ deviceModel, }) {
|
|
6
5
|
return (_jsxs("div", { className: 'seam-row filter-result-row', children: [_jsx(ImageColumn, { deviceModel: deviceModel }), _jsx(ModelColumn, { deviceModel: deviceModel }), _jsx(StatusColumn, { deviceModel: deviceModel })] }));
|
|
7
6
|
}
|
|
8
7
|
export function ModelColumn({ deviceModel, }) {
|
|
9
|
-
|
|
10
|
-
return (_jsxs("div", { className: 'seam-col seam-model-col', children: [_jsxs("div", { className: 'seam-model-name', children: [_jsx("img", { src: deviceProvider.image_url, alt: deviceModel.brand, className: 'seam-brand-image' }), ' ', _jsx("div", { className: 'seam-truncated-text', children: deviceModel.model_name })] }), _jsx("div", { className: 'seam-model-id', children: _jsxs("div", { className: 'seam-truncated-text', children: [deviceModel.manufacturer_model_id, _jsx(DotDivider, {}), connectionTypeNames[deviceModel.connection_type]] }) })] }));
|
|
8
|
+
return (_jsxs("div", { className: 'seam-col seam-model-col', children: [_jsxs("div", { className: 'seam-model-name', children: [_jsx("img", { src: deviceModel.manufacturer.logo?.url, alt: deviceModel.manufacturer.display_name, className: 'seam-manufacturer-image' }), ' ', _jsx("div", { className: 'seam-truncated-text', children: deviceModel.display_name })] }), _jsx("div", { className: 'seam-model-id', children: _jsxs("div", { className: 'seam-truncated-text', children: [deviceModel.device_model_id, _jsx(DotDivider, {}), deviceModel.main_connection_type] }) })] }));
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=SupportedDeviceFilterResultRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceFilterResultRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"SupportedDeviceFilterResultRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,WAAW,EACX,YAAY,GACb,MAAM,gEAAgE,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAMxD,MAAM,UAAU,8BAA8B,CAAC,EAC7C,WAAW,GACyB;IACpC,OAAO,CACL,eAAK,SAAS,EAAC,4BAA4B,aACzC,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,GACyB;IACpC,OAAO,CACL,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAK,SAAS,EAAC,iBAAiB,aAC9B,cACE,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EACvC,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC,YAAY,EAC1C,SAAS,EAAC,yBAAyB,GACnC,EAAC,GAAG,EACN,cAAK,SAAS,EAAC,qBAAqB,YAAE,WAAW,CAAC,YAAY,GAAO,IACjE,EACN,cAAK,SAAS,EAAC,eAAe,YAC5B,eAAK,SAAS,EAAC,qBAAqB,aACjC,WAAW,CAAC,eAAe,EAC5B,KAAC,UAAU,KAAG,EACb,WAAW,CAAC,oBAAoB,IAC7B,GACF,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import type { DeviceModelV1 } from '@seamapi/types/devicedb';
|
|
3
|
+
interface SupportedDeviceManufacturerSectionProps {
|
|
4
|
+
manufacturerId: string;
|
|
5
|
+
deviceModels: DeviceModelV1[];
|
|
6
|
+
}
|
|
7
|
+
export declare function SupportedDeviceManufacturerSection({ manufacturerId, deviceModels, }: SupportedDeviceManufacturerSectionProps): JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { HiddenDevicesOverlay } from '../../../../lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js';
|
|
5
|
+
import { ShowAllDevicesButton } from '../../../../lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js';
|
|
6
|
+
import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
|
|
7
|
+
import { useManufacturer } from '../../../../lib/seam/components/SupportedDeviceTable/use-manufacturer.js';
|
|
8
|
+
import { useToggle } from '../../../../lib/ui/use-toggle.js';
|
|
9
|
+
/**
|
|
10
|
+
* How many device models required before collapsing the list,
|
|
11
|
+
* and requiring the user to click to view all.
|
|
12
|
+
*/
|
|
13
|
+
const maxDevicesBeforeCollapsing = 3;
|
|
14
|
+
export function SupportedDeviceManufacturerSection({ manufacturerId, deviceModels, }) {
|
|
15
|
+
const { manufacturer } = useManufacturer({ manufacturer_id: manufacturerId });
|
|
16
|
+
const [expanded, toggleExpand] = useToggle();
|
|
17
|
+
const canExpand = deviceModels.length > maxDevicesBeforeCollapsing;
|
|
18
|
+
const visibleDevices = !canExpand || expanded
|
|
19
|
+
? deviceModels
|
|
20
|
+
: deviceModels.filter((_deviceModel, index) => index < maxDevicesBeforeCollapsing);
|
|
21
|
+
const handleHeaderClick = () => {
|
|
22
|
+
if (!canExpand) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
toggleExpand();
|
|
26
|
+
};
|
|
27
|
+
return (_jsxs("div", { className: classNames('seam-manufacturer-section', {
|
|
28
|
+
'can-expand': canExpand,
|
|
29
|
+
expanded,
|
|
30
|
+
}), 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' })] }), _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 })] }));
|
|
31
|
+
}
|
|
32
|
+
const t = {
|
|
33
|
+
devices: 'Devices',
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=SupportedDeviceManufacturerSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedDeviceManufacturerSection.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD;;;GAGG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAOpC,MAAM,UAAU,kCAAkC,CAAC,EACjD,cAAc,EACd,YAAY,GAC4B;IACxC,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,CAAC,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC,CAAA;IAE7E,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,SAAS,EAAE,CAAA;IAE5C,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,GAAG,0BAA0B,CAAA;IAElE,MAAM,cAAc,GAClB,CAAC,SAAS,IAAI,QAAQ;QACpB,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,YAAY,CAAC,MAAM,CACjB,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,0BAA0B,CAC5D,CAAA;IAEP,MAAM,iBAAiB,GAAG,GAAS,EAAE;QACnC,IAAI,CAAC,SAAS,EAAE;YACd,OAAM;SACP;QAED,YAAY,EAAE,CAAA;IAChB,CAAC,CAAA;IAED,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE;YACjD,YAAY,EAAE,SAAS;YACvB,QAAQ;SACT,CAAC,aAEF,eAAK,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,iBAAiB,aACrD,cACE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,EAC5B,GAAG,EAAE,YAAY,EAAE,YAAY,EAC/B,SAAS,EAAC,yBAAyB,GACnC,EACF,cAAI,SAAS,EAAC,wBAAwB,aACnC,YAAY,EAAE,YAAY,OAAG,CAAC,CAAC,OAAO,IACpC,EACJ,SAAS,IAAI,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,GAAG,IAClD,EACN,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,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;CACnB,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import type { DeviceModelV1 } from '@seamapi/types/devicedb';
|
|
2
3
|
import type { DeviceModel } from 'seamapi';
|
|
3
4
|
interface SupportedDeviceRowProps {
|
|
4
|
-
deviceModel:
|
|
5
|
+
deviceModel: DeviceModelV1;
|
|
5
6
|
}
|
|
6
7
|
export declare function SupportedDeviceRow({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
|
|
7
8
|
export declare function ImageColumn({ deviceModel, }: SupportedDeviceRowProps): JSX.Element;
|
|
@@ -5,24 +5,28 @@ export function SupportedDeviceRow({ deviceModel, }) {
|
|
|
5
5
|
return (_jsxs("div", { className: 'seam-row', children: [_jsx(ImageColumn, { deviceModel: deviceModel }), _jsx(ModelColumn, { deviceModel: deviceModel }), _jsx(StatusColumn, { deviceModel: deviceModel })] }));
|
|
6
6
|
}
|
|
7
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.
|
|
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
9
|
}
|
|
10
10
|
export function ModelColumn({ deviceModel, }) {
|
|
11
|
-
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.
|
|
11
|
+
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: [deviceModel.device_model_id, _jsx(DotDivider, {}), deviceModel.main_connection_type] }) })] }));
|
|
12
12
|
}
|
|
13
13
|
export function StatusColumn({ deviceModel, }) {
|
|
14
|
-
const statusColor = supportLevelColors[deviceModel.
|
|
15
|
-
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.
|
|
14
|
+
const statusColor = supportLevelColors[deviceModel.manufacturer.integration] ?? 'unknown';
|
|
15
|
+
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] }) }) }));
|
|
16
16
|
}
|
|
17
17
|
const supportLevelColors = {
|
|
18
|
-
|
|
18
|
+
stable: 'green',
|
|
19
19
|
beta: 'blue',
|
|
20
|
+
planned: 'unknown',
|
|
20
21
|
unsupported: 'unknown',
|
|
22
|
+
inquire: 'unknown',
|
|
21
23
|
};
|
|
22
24
|
const status = {
|
|
23
|
-
|
|
25
|
+
stable: 'LIVE',
|
|
24
26
|
beta: 'BETA',
|
|
25
27
|
unsupported: 'Inquire',
|
|
28
|
+
planned: 'Inquire',
|
|
29
|
+
inquire: 'Inquire',
|
|
26
30
|
};
|
|
27
31
|
export const connectionTypeNames = {
|
|
28
32
|
wifi: 'Wifi',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,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,E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C,MAAM,mBAAmB,GAG5B;IACF,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAA"}
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
import { type CommonProps } from '../../../../lib/seam/components/common-props.js';
|
|
3
3
|
export interface SupportedDeviceTableProps extends CommonProps {
|
|
4
4
|
disableFilter?: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
cannotFilter?: boolean;
|
|
9
|
-
brands?: string[] | null;
|
|
10
|
-
excludedBrands?: string[];
|
|
5
|
+
manufacturers?: string[] | null;
|
|
6
|
+
excludedManufacturers?: string[];
|
|
11
7
|
}
|
|
12
8
|
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;
|
|
13
|
-
export declare function SupportedDeviceTable({ disableFilter,
|
|
9
|
+
export declare function SupportedDeviceTable({ disableFilter, manufacturers, excludedManufacturers, className, }?: SupportedDeviceTableProps): JSX.Element;
|
|
@@ -6,16 +6,15 @@ import { withRequiredCommonProps, } from '../../../../lib/seam/components/common
|
|
|
6
6
|
import { SupportedDeviceContent } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js';
|
|
7
7
|
import { SupportedDeviceFilterArea } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js';
|
|
8
8
|
export const NestedSupportedDeviceTable = withRequiredCommonProps(SupportedDeviceTable);
|
|
9
|
-
export function SupportedDeviceTable({ disableFilter = false,
|
|
9
|
+
export function SupportedDeviceTable({ disableFilter = false, manufacturers = null, excludedManufacturers = [], className, } = {}) {
|
|
10
10
|
useComponentTelemetry('SupportedDeviceTable');
|
|
11
11
|
const [filterValue, setFilterValue] = useState('');
|
|
12
12
|
const [filters, setFilters] = useState({
|
|
13
13
|
supportedOnly: true,
|
|
14
|
-
|
|
14
|
+
manufacturer: null,
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
return (_jsxs("div", { className: classNames('seam-supported-device-table-content-wrap', className), children: [!hideFilter && (_jsx(SupportedDeviceFilterArea, { filterValue: filterValue, setFilterValue: setFilterValue, filters: filters, setFilters: setFilters, brands: brands, excludedBrands: excludedBrands })), _jsx(SupportedDeviceContent, { resetFilterValue: () => {
|
|
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: () => {
|
|
18
17
|
setFilterValue('');
|
|
19
|
-
}, filterValue: filterValue, filters: filters,
|
|
18
|
+
}, filterValue: filterValue, filters: filters, manufacturers: manufacturers, excludedManufacturers: excludedManufacturers })] }));
|
|
20
19
|
}
|
|
21
20
|
//# sourceMappingURL=SupportedDeviceTable.js.map
|
|
@@ -1 +1 @@
|
|
|
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,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAEL,uBAAuB,GACxB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAA;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAA;
|
|
1
|
+
{"version":3,"file":"SupportedDeviceTable.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable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a,EAC5B,qBAAqB,EAAE,qBAAqB,GAC5C,IACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useDeviceModels } from '../../../../lib/seam/
|
|
1
|
+
import { useDeviceModels } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-models.js';
|
|
2
2
|
export interface DeviceModelFilters {
|
|
3
3
|
supportedOnly: boolean;
|
|
4
|
-
|
|
4
|
+
manufacturer: string | null;
|
|
5
5
|
}
|
|
6
|
-
export declare const useFilteredDeviceModels: ({ filterValue, filters,
|
|
6
|
+
export declare const useFilteredDeviceModels: ({ filterValue, filters, ...manufacturersParams }: {
|
|
7
7
|
filterValue: string;
|
|
8
8
|
filters: DeviceModelFilters;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
manufacturers: string[] | null;
|
|
10
|
+
excludedManufacturers: string[];
|
|
11
11
|
}) => ReturnType<typeof useDeviceModels>;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { useDeviceModels, } from '../../../../lib/seam/
|
|
2
|
-
|
|
1
|
+
import { useDeviceModels, } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-models.js';
|
|
2
|
+
import { useFilteredManufacturers } from './use-filtered-manufacturers.js';
|
|
3
|
+
export const useFilteredDeviceModels = ({ filterValue, filters, ...manufacturersParams }) => {
|
|
4
|
+
const { manufacturers } = useFilteredManufacturers(manufacturersParams);
|
|
3
5
|
const params = {};
|
|
4
6
|
if (filterValue.trim() !== '') {
|
|
5
7
|
params.text_search = filterValue.trim();
|
|
6
8
|
}
|
|
7
9
|
if (filters.supportedOnly) {
|
|
8
|
-
params.
|
|
10
|
+
params.integration_status = 'stable';
|
|
9
11
|
}
|
|
10
|
-
if (filters.
|
|
11
|
-
|
|
12
|
+
if (filters.manufacturer !== null) {
|
|
13
|
+
const manufacturer = manufacturers?.find((manufacturer) => manufacturer.display_name === filters.manufacturer);
|
|
14
|
+
if (manufacturer != null) {
|
|
15
|
+
params.manufacturer_id = manufacturer.manufacturer_id;
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
if (filters.manufacturer == null && manufacturers != null) {
|
|
19
|
+
params.manufacturer_ids = manufacturers.map((m) => m.manufacturer_id);
|
|
20
|
+
}
|
|
21
|
+
const { deviceModels, ...query } = useDeviceModels(params);
|
|
16
22
|
return {
|
|
17
23
|
...query,
|
|
18
|
-
deviceModels:
|
|
19
|
-
|
|
20
|
-
if (brands === null)
|
|
21
|
-
return true;
|
|
22
|
-
return brands.includes(brand);
|
|
23
|
-
})
|
|
24
|
-
.filter(({ brand }) => {
|
|
25
|
-
return !excludedBrands.includes(brand);
|
|
26
|
-
}),
|
|
24
|
+
deviceModels: deviceModels?.filter((deviceModel) => manufacturers?.some((manufacturer) => deviceModel.manufacturer.manufacturer_id ===
|
|
25
|
+
manufacturer.manufacturer_id)),
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
28
|
//# sourceMappingURL=use-filtered-device-models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-filtered-device-models.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAEhB,MAAM,
|
|
1
|
+
{"version":3,"file":"use-filtered-device-models.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAEhB,MAAM,+DAA+D,CAAA;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAO1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,WAAW,EACX,OAAO,EACP,GAAG,mBAAmB,EAMvB,EAAsC,EAAE;IACvC,MAAM,EAAE,aAAa,EAAE,GAAG,wBAAwB,CAAC,mBAAmB,CAAC,CAAA;IAEvE,MAAM,MAAM,GAA0B,EAAE,CAAA;IAExC,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC7B,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAA;KACxC;IAED,IAAI,OAAO,CAAC,aAAa,EAAE;QACzB,MAAM,CAAC,kBAAkB,GAAG,QAAQ,CAAA;KACrC;IAED,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE;QACjC,MAAM,YAAY,GAAG,aAAa,EAAE,IAAI,CACtC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,KAAK,OAAO,CAAC,YAAY,CACrE,CAAA;QAED,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,eAAe,GAAG,YAAY,CAAC,eAAe,CAAA;SACtD;KACF;IAED,IAAI,OAAO,CAAC,YAAY,IAAI,IAAI,IAAI,aAAa,IAAI,IAAI,EAAE;QACzD,MAAM,CAAC,gBAAgB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;KACtE;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IAE1D,OAAO;QACL,GAAG,KAAK;QACR,YAAY,EAAE,YAAY,EAAE,MAAM,CAChC,CAAC,WAAW,EAAE,EAAE,CACd,aAAa,EAAE,IAAI,CACjB,CAAC,YAAY,EAAE,EAAE,CACf,WAAW,CAAC,YAAY,CAAC,eAAe;YACxC,YAAY,CAAC,eAAe,CAC/B,CACJ;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useManufacturers } from '../../../../lib/seam/components/SupportedDeviceTable/use-manufacturers.js';
|
|
2
|
+
interface Params {
|
|
3
|
+
manufacturers: string[] | null;
|
|
4
|
+
excludedManufacturers: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const useFilteredManufacturers: (params: Params) => ReturnType<typeof useManufacturers>;
|
|
7
|
+
export declare const createLiqeQuery: ({ manufacturers, excludedManufacturers, }: Params) => string | undefined;
|
|
8
|
+
export {};
|