@seamapi/react 1.6.0 → 1.8.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 +18 -5
- package/dist/elements.js +25043 -0
- package/dist/elements.js.map +1 -0
- package/hooks.d.ts +1 -0
- package/hooks.js +2 -0
- package/hooks.js.map +1 -0
- package/index.css +6 -0
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/{sort-by.d.ts → dates.d.ts} +1 -1
- package/lib/{sort-by.js → dates.js} +2 -2
- package/lib/dates.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/{SeamProvider.d.ts → seam/SeamProvider.d.ts} +9 -6
- package/lib/{SeamProvider.js → seam/SeamProvider.js} +29 -30
- package/lib/seam/SeamProvider.js.map +1 -0
- package/lib/seam/access-codes/use-access-codes.js +2 -2
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.d.ts +2 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.js +9 -8
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.js +7 -7
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +7 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +77 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.js +3 -3
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +7 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +80 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceModel.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.d.ts +3 -2
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.js +4 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.d.ts +1 -1
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.js +9 -9
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -0
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +9 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js +66 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +20 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.js +8 -5
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +9 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +39 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +9 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.js +33 -28
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.d.ts +2 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js +12 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +19 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +17 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +7 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +18 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -0
- package/lib/seam/components/index.js.map +1 -0
- package/lib/seam/device-models/use-device-models.d.ts +5 -0
- package/lib/seam/device-models/use-device-models.js +17 -0
- package/lib/seam/device-models/use-device-models.js.map +1 -0
- package/lib/seam/devices/use-devices.js +3 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/devices/use-toggle-lock.js +1 -1
- package/lib/seam/devices/use-toggle-lock.js.map +1 -1
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/use-seam-client.js +1 -1
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-font.d.ts +1 -1
- package/lib/seam/use-seam-font.js +1 -1
- package/lib/seam/use-seam-font.js.map +1 -1
- package/lib/seam/use-seam-styles.js.map +1 -1
- package/lib/{capitalize.js → strings.js} +1 -1
- package/lib/strings.js.map +1 -0
- package/lib/ui/Menu/Menu.d.ts +1 -1
- package/lib/ui/Menu/Menu.js.map +1 -1
- package/lib/ui/Menu/MenuItem.d.ts +1 -1
- package/lib/ui/Menu/MoreActionsMenu.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +2 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +2 -1
- package/lib/ui/TextField/SearchTextField.js.map +1 -1
- package/lib/{copy-to-clipboard.js → ui/clipboard.js} +1 -1
- package/lib/ui/clipboard.js.map +1 -0
- package/lib/ui/use-interval.js.map +1 -0
- package/lib/{use-is-date-in-past.js → ui/use-is-date-in-past.js} +1 -1
- package/lib/ui/use-is-date-in-past.js.map +1 -0
- package/lib/ui/use-toggle.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +3 -1
- package/lib/version.js.map +1 -1
- package/package.json +21 -8
- package/src/elements.ts +27 -0
- package/src/hooks.ts +1 -0
- package/src/lib/{sort-by.ts → dates.ts} +1 -1
- package/src/lib/element.tsx +86 -0
- package/src/lib/index.ts +2 -2
- package/src/lib/{SeamProvider.tsx → seam/SeamProvider.tsx} +53 -46
- package/src/lib/seam/access-codes/use-access-codes.ts +2 -2
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.tsx +9 -6
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.tsx +2 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeTable/AccessCodeTable.tsx +30 -11
- package/src/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.tsx +2 -3
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.tsx +22 -12
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.tsx +1 -1
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceRow.tsx +1 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.element.ts +11 -0
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceTable.tsx +15 -12
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.tsx +26 -13
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +120 -0
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +43 -39
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.tsx +22 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +11 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +35 -0
- package/src/lib/seam/components/elements.ts +5 -0
- package/src/lib/seam/device-models/use-device-models.ts +34 -0
- package/src/lib/seam/devices/use-devices.ts +3 -3
- package/src/lib/seam/devices/use-toggle-lock.ts +1 -2
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/use-seam-client.ts +1 -1
- package/src/lib/seam/use-seam-font.ts +5 -1
- package/src/lib/seam/use-seam-styles.ts +1 -1
- package/src/lib/ui/Menu/Menu.tsx +4 -4
- package/src/lib/ui/Menu/MenuItem.tsx +1 -1
- package/src/lib/ui/Menu/MoreActionsMenu.tsx +1 -1
- package/src/lib/ui/Table/TableFilterBar/TableFilterBar.tsx +2 -2
- package/src/lib/ui/Table/TableFilterBar/TableFilterItem.tsx +1 -1
- package/src/lib/ui/TextField/SearchTextField.tsx +3 -3
- package/src/lib/ui/clipboard.ts +3 -0
- package/src/lib/{use-interval.ts → ui/use-interval.ts} +1 -1
- package/src/lib/{use-is-date-in-past.ts → ui/use-is-date-in-past.ts} +1 -1
- package/src/lib/version.ts +3 -1
- package/src/styles/_access-code-table.scss +7 -0
- package/lib/SeamProvider.js.map +0 -1
- package/lib/capitalize.js.map +0 -1
- package/lib/copy-to-clipboard.js.map +0 -1
- package/lib/sort-by.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js.map +0 -1
- package/lib/ui/AccessCodeTable/AccessCodeTable.d.ts +0 -6
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +0 -69
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +0 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceDetails.d.ts +0 -6
- package/lib/ui/DeviceDetails/DeviceDetails.js +0 -80
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceModel.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceHealthBar.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceRow.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceTable.d.ts +0 -8
- package/lib/ui/DeviceTable/DeviceTable.js +0 -65
- package/lib/ui/DeviceTable/DeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -4
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +0 -46
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -11
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js +0 -12
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -3
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +0 -8
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/types.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/types.js +0 -2
- package/lib/ui/SupportedDeviceTable/types.js.map +0 -1
- package/lib/ui/index.js.map +0 -1
- package/lib/use-interval.js.map +0 -1
- package/lib/use-is-date-in-past.js.map +0 -1
- package/lib/use-toggle.js.map +0 -1
- package/src/lib/copy-to-clipboard.ts +0 -3
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -135
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.tsx +0 -14
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -35
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -16
- package/src/lib/ui/SupportedDeviceTable/types.ts +0 -16
- /package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.js +0 -0
- /package/lib/{ui → seam/components}/index.d.ts +0 -0
- /package/lib/{ui → seam/components}/index.js +0 -0
- /package/lib/{capitalize.d.ts → strings.d.ts} +0 -0
- /package/lib/{copy-to-clipboard.d.ts → ui/clipboard.d.ts} +0 -0
- /package/lib/{use-interval.d.ts → ui/use-interval.d.ts} +0 -0
- /package/lib/{use-interval.js → ui/use-interval.js} +0 -0
- /package/lib/{use-is-date-in-past.d.ts → ui/use-is-date-in-past.d.ts} +0 -0
- /package/lib/{use-toggle.d.ts → ui/use-toggle.d.ts} +0 -0
- /package/lib/{use-toggle.js → ui/use-toggle.js} +0 -0
- /package/src/lib/{ui → seam/components}/DeviceDetails/DeviceModel.tsx +0 -0
- /package/src/lib/{ui → seam/components}/index.ts +0 -0
- /package/src/lib/{capitalize.ts → strings.ts} +0 -0
- /package/src/lib/{use-toggle.ts → ui/use-toggle.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
-
import { useDevice } from '
|
|
4
|
-
import { DotDivider } from '
|
|
5
|
-
import { useIsDateInPast } from '
|
|
3
|
+
import { useDevice } from '../../../../lib/seam/devices/use-device.js';
|
|
4
|
+
import { DotDivider } from '../../../../lib/ui/layout/DotDivider.js';
|
|
5
|
+
import { useIsDateInPast } from '../../../../lib/ui/use-is-date-in-past.js';
|
|
6
6
|
export function CodeDetails(props) {
|
|
7
7
|
const { accessCode } = props;
|
|
8
8
|
const { device } = useDevice({ device_id: accessCode.device_id });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeDetails.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/AccessCodeTable/CodeDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,MAAM,UAAU,WAAW,CAAC,KAAiC;IAC3D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,CAAA;IAEjE,OAAO,CACL,eAAK,SAAS,EAAC,mBAAmB,aAChC,eAAM,SAAS,EAAC,sCAAsC,YACnD,MAAM,EAAE,UAAU,CAAC,IAAI,GACnB,EACP,KAAC,UAAU,KAAG,EACd,KAAC,QAAQ,IAAC,UAAU,EAAE,UAAU,GAAI,EACpC,KAAC,UAAU,KAAG,EACb,CAAC,CAAC,IAAI,QAAI,UAAU,CAAC,IAAI,IACtB,CACP,CAAA;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAiC;IACjD,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IAE5B,MAAM,UAAU,GACd,eAAe,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QACzE,KAAK,CAAA;IAEP,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;QACjC,OAAO,CACL,2BACG,CAAC,CAAC,IAAI,QAAI,CAAC,CAAC,KAAK,IACb,CACR,CAAA;KACF;IAED,IAAI,UAAU,EAAE;QACd,OAAO,CACL,2BACG,CAAC,CAAC,IAAI,QAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,IACzC,CACR,CAAA;KACF;IAED,OAAO,CACL,2BACG,CAAC,CAAC,MAAM,QAAI,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,IACxC,CACR,CAAA;AACH,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC;QAC3C,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;KACf,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,GAAG;IACR,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACf,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { useAccessCodes } from '../../../../lib/seam/access-codes/use-access-codes.js';
|
|
5
|
+
import { AccessCodeTable } from '../../../../lib/seam/components/AccessCodeTable/AccessCodeTable.js';
|
|
6
|
+
import { DeviceModel } from '../../../../lib/seam/components/DeviceDetails/DeviceModel.js';
|
|
7
|
+
import { isLockDevice } from '../../../../lib/seam/devices/types.js';
|
|
8
|
+
import { useDevice } from '../../../../lib/seam/devices/use-device.js';
|
|
9
|
+
import { useToggleLock } from '../../../../lib/seam/devices/use-toggle-lock.js';
|
|
10
|
+
import { Alerts } from '../../../../lib/ui/Alert/Alerts.js';
|
|
11
|
+
import { Button } from '../../../../lib/ui/Button.js';
|
|
12
|
+
import { BatteryStatus } from '../../../../lib/ui/device/BatteryStatus.js';
|
|
13
|
+
import { DeviceImage } from '../../../../lib/ui/device/DeviceImage.js';
|
|
14
|
+
import { OnlineStatus } from '../../../../lib/ui/device/OnlineStatus.js';
|
|
15
|
+
import { ContentHeader } from '../../../../lib/ui/layout/ContentHeader.js';
|
|
16
|
+
import { useToggle } from '../../../../lib/ui/use-toggle.js';
|
|
17
|
+
export function DeviceDetails({ deviceId, onBack, className, }) {
|
|
18
|
+
const { device } = useDevice({
|
|
19
|
+
device_id: deviceId,
|
|
20
|
+
});
|
|
21
|
+
if (device == null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (!isLockDevice(device)) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return (_jsx(LockDeviceDetails, { className: className, device: device, onBack: onBack }));
|
|
28
|
+
}
|
|
29
|
+
function LockDeviceDetails(props) {
|
|
30
|
+
const { device, onBack, className } = props;
|
|
31
|
+
const [accessCodesOpen, toggleAccessCodesOpen] = useToggle();
|
|
32
|
+
const toggleLock = useToggleLock(device);
|
|
33
|
+
const { accessCodes } = useAccessCodes({
|
|
34
|
+
device_id: device.device_id,
|
|
35
|
+
});
|
|
36
|
+
const lockStatus = device.properties.locked ? t.locked : t.unlocked;
|
|
37
|
+
const toggleLockLabel = device.properties.locked ? t.unlock : t.lock;
|
|
38
|
+
const accessCodeCount = accessCodes?.length;
|
|
39
|
+
const accessCodeLength = device.properties?.schlage_metadata?.access_code_length;
|
|
40
|
+
if (accessCodes == null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (accessCodesOpen) {
|
|
44
|
+
return (_jsx(AccessCodeTable, { className: className, deviceId: device.device_id, onBack: toggleAccessCodesOpen }));
|
|
45
|
+
}
|
|
46
|
+
const alerts = [
|
|
47
|
+
...device.errors.map((error) => ({
|
|
48
|
+
variant: 'error',
|
|
49
|
+
message: error.message,
|
|
50
|
+
})),
|
|
51
|
+
...device.warnings.map((warning) => ({
|
|
52
|
+
variant: 'warning',
|
|
53
|
+
message: warning.message,
|
|
54
|
+
})),
|
|
55
|
+
];
|
|
56
|
+
return (_jsxs("div", { className: classNames('seam-device-details', className), children: [_jsx(ContentHeader, { title: 'Device', onBack: onBack }), _jsxs("div", { className: 'seam-body', children: [_jsxs("div", { className: 'seam-summary', children: [_jsxs("div", { className: 'seam-content', children: [_jsx("div", { className: 'seam-image', children: _jsx(DeviceImage, { device: device }) }), _jsxs("div", { className: 'seam-info', children: [_jsx("span", { className: 'seam-label', children: t.device }), _jsx("h4", { className: 'seam-device-name', children: device.properties.name }), _jsxs("div", { className: 'seam-properties', children: [_jsxs("span", { className: 'seam-label', children: [t.status, ":"] }), ' ', _jsx(OnlineStatus, { device: device }), _jsxs("span", { className: 'seam-label', children: [t.power, ":"] }), ' ', _jsx(BatteryStatus, { device: device }), _jsx(DeviceModel, { device: device })] })] })] }), _jsx(Alerts, { alerts: alerts, className: 'seam-alerts-space-top' })] }), _jsx("div", { className: 'seam-box', children: _jsxs("div", { className: 'seam-content seam-access-codes', onClick: toggleAccessCodesOpen, children: [_jsxs("span", { className: 'seam-value', children: [accessCodeCount, " ", t.accessCodes] }), _jsx(ChevronRightIcon, {})] }) }), _jsxs("div", { className: 'seam-box', children: [_jsxs("div", { className: 'seam-content seam-lock-status', children: [_jsxs("div", { children: [_jsx("span", { className: 'seam-label', children: t.lockStatus }), _jsx("span", { className: 'seam-value', children: lockStatus })] }), _jsx("div", { className: 'seam-right', children: _jsx(Button, { size: 'small', onClick: () => {
|
|
57
|
+
toggleLock.mutate();
|
|
58
|
+
}, children: toggleLockLabel }) })] }), _jsx(AccessCodeLength, { accessCodeLength: accessCodeLength })] })] })] }));
|
|
59
|
+
}
|
|
60
|
+
function AccessCodeLength(props) {
|
|
61
|
+
const { accessCodeLength } = props;
|
|
62
|
+
if (accessCodeLength == null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (_jsxs("div", { className: 'seam-content seam-access-code-length', children: [_jsx("span", { className: 'seam-label', children: t.codeLength }), _jsxs("span", { className: 'seam-value', children: [accessCodeLength, " ", t.digits] })] }));
|
|
66
|
+
}
|
|
67
|
+
const t = {
|
|
68
|
+
device: 'Device',
|
|
69
|
+
unlock: 'Unlock',
|
|
70
|
+
lock: 'Lock',
|
|
71
|
+
locked: 'Locked',
|
|
72
|
+
unlocked: 'Unlocked',
|
|
73
|
+
accessCodes: 'access codes',
|
|
74
|
+
codeLength: 'Code length',
|
|
75
|
+
digits: 'digits',
|
|
76
|
+
lockStatus: 'Lock status',
|
|
77
|
+
status: 'Status',
|
|
78
|
+
power: 'Power',
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=DeviceDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceDetails.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/DeviceDetails/DeviceDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAA;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C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,GAAG,KAAK,CAAA;IAClC,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,eAAK,SAAS,EAAC,sCAAsC,aACnD,eAAM,SAAS,EAAC,YAAY,YAAE,CAAC,CAAC,UAAU,GAAQ,EAClD,gBAAM,SAAS,EAAC,YAAY,aACzB,gBAAgB,OAAG,CAAC,CAAC,MAAM,IACvB,IACH,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceModel.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/DeviceDetails/DeviceModel.tsx"],"names":[],"mappings":";AAMA,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAoB;IACtD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IACpC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,8BACE,gBAAM,SAAS,EAAC,YAAY,aAAE,CAAC,CAAC,KAAK,SAAS,EAAC,GAAG,EAClD,cAAK,SAAS,EAAC,mBAAmB,YAAE,KAAK,GAAO,IAC/C,CACJ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,UAAU,GACC,EAAsB,EAAE;IACnC,OAAO,CACL,UAAU,EAAE,eAAe,EAAE,KAAK;QAClC,UAAU,EAAE,gBAAgB,EAAE,KAAK;QACnC,CAAC,CAAC,aAAa,CAChB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,cAAc;CAC9B,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { UseDevicesData } from '../../../../lib/seam/devices/use-devices.js';
|
|
2
3
|
export type DeviceFilter = 'device_issues';
|
|
3
4
|
interface DeviceHealthBarProps {
|
|
4
5
|
devices: Array<UseDevicesData[number]>;
|
|
5
6
|
filter: DeviceFilter | null;
|
|
6
7
|
onFilterSelect: (filter: DeviceFilter | null) => void;
|
|
7
8
|
}
|
|
8
|
-
export declare function DeviceHealthBar({ devices, filter, onFilterSelect, }: DeviceHealthBarProps):
|
|
9
|
+
export declare function DeviceHealthBar({ devices, filter, onFilterSelect, }: DeviceHealthBarProps): JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CheckIcon } from '
|
|
3
|
-
import { ExclamationCircleOutlineIcon } from '
|
|
4
|
-
import { TableFilterBar } from '
|
|
5
|
-
import { TableFilterItem } from '
|
|
2
|
+
import { CheckIcon } from '../../../../lib/icons/Check.js';
|
|
3
|
+
import { ExclamationCircleOutlineIcon } from '../../../../lib/icons/ExclamationCircleOutline.js';
|
|
4
|
+
import { TableFilterBar } from '../../../../lib/ui/Table/TableFilterBar/TableFilterBar.js';
|
|
5
|
+
import { TableFilterItem } from '../../../../lib/ui/Table/TableFilterBar/TableFilterItem.js';
|
|
6
6
|
export function DeviceHealthBar({ devices, filter, onFilterSelect, }) {
|
|
7
7
|
const erroredDevices = devices.filter((device) => device.errors.length > 0);
|
|
8
8
|
const issueCount = erroredDevices.length;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceHealthBar.js","sourceRoot":"","s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AAE;YAClB,cAAc,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC,YAED,MAAC,eAAe,IACd,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,EAChC,QAAQ,EAAE,MAAM,KAAK,eAAe,aAEpC,KAAC,4BAA4B,KAAG,EAC/B,KAAK,IACU,GACH,CAClB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,SAAS,EAAE,YAAY;IACvB,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAE,eAAe;CAC9B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { UseDevicesData, UseDevicesParams } from '
|
|
2
|
+
import type { UseDevicesData, UseDevicesParams } from '../../../../lib/seam/devices/use-devices.js';
|
|
3
3
|
export type DeviceTableProps = Props & UseDevicesParams;
|
|
4
4
|
interface Props {
|
|
5
5
|
onBack?: () => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { TableCell } from '
|
|
9
|
-
import { TableRow } from '
|
|
10
|
-
import { Title } from '
|
|
2
|
+
import { getDeviceModel } from '../../../../lib/seam/components/DeviceDetails/DeviceModel.js';
|
|
3
|
+
import { isLockDevice } from '../../../../lib/seam/devices/types.js';
|
|
4
|
+
import { BatteryStatus } from '../../../../lib/ui/device/BatteryStatus.js';
|
|
5
|
+
import { DeviceImage } from '../../../../lib/ui/device/DeviceImage.js';
|
|
6
|
+
import { LockStatus } from '../../../../lib/ui/device/LockStatus.js';
|
|
7
|
+
import { OnlineStatus } from '../../../../lib/ui/device/OnlineStatus.js';
|
|
8
|
+
import { TableCell } from '../../../../lib/ui/Table/TableCell.js';
|
|
9
|
+
import { TableRow } from '../../../../lib/ui/Table/TableRow.js';
|
|
10
|
+
import { Title } from '../../../../lib/ui/typography/Title.js';
|
|
11
11
|
export function DeviceRow({ device, onClick, }) {
|
|
12
12
|
if (!isLockDevice(device)) {
|
|
13
13
|
return null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/DeviceTable/DeviceRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAKxD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAalD,MAAM,UAAU,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACQ;IACf,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QACzB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAA;IAE3D,OAAO,CACL,MAAC,QAAQ,IAAwB,OAAO,EAAE,OAAO,aAC/C,KAAC,SAAS,IAAC,SAAS,EAAC,iBAAiB,YACpC,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,GAAI,GACrB,EACZ,MAAC,SAAS,IAAC,SAAS,EAAC,gBAAgB,aACnC,KAAC,KAAK,IAAC,SAAS,EAAC,qBAAqB,YAAE,MAAM,CAAC,UAAU,CAAC,IAAI,GAAS,EACvE,eAAK,SAAS,EAAC,aAAa,aAC1B,eAAM,SAAS,EAAC,mBAAmB,YAAE,WAAW,GAAQ,EACxD,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,GAAI,EAChC,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,GAAI,EACjC,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,GAAI,IAC1B,IACF,IACI,KAdC,MAAM,CAAC,SAAS,CAepB,CACZ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,cAAc;IAC3B,gBAAgB,EAAE,8BAA8B;CACjD,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type UseDevicesParams } from '../../../../lib/seam/devices/use-devices.js';
|
|
3
|
+
export type DeviceTableProps = Props & UseDevicesParams;
|
|
4
|
+
interface Props {
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function DeviceTable({ onBack, className, }: DeviceTableProps): JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { DeviceDetails } from '../../../../lib/seam/components/DeviceDetails/DeviceDetails.js';
|
|
5
|
+
import { DeviceHealthBar, } from '../../../../lib/seam/components/DeviceTable/DeviceHealthBar.js';
|
|
6
|
+
import { DeviceRow } from '../../../../lib/seam/components/DeviceTable/DeviceRow.js';
|
|
7
|
+
import { useDevices, } from '../../../../lib/seam/devices/use-devices.js';
|
|
8
|
+
import { ContentHeader } from '../../../../lib/ui/layout/ContentHeader.js';
|
|
9
|
+
import { EmptyPlaceholder } from '../../../../lib/ui/Table/EmptyPlaceholder.js';
|
|
10
|
+
import { TableBody } from '../../../../lib/ui/Table/TableBody.js';
|
|
11
|
+
import { TableHeader } from '../../../../lib/ui/Table/TableHeader.js';
|
|
12
|
+
import { TableTitle } from '../../../../lib/ui/Table/TableTitle.js';
|
|
13
|
+
import { SearchTextField } from '../../../../lib/ui/TextField/SearchTextField.js';
|
|
14
|
+
import { Caption } from '../../../../lib/ui/typography/Caption.js';
|
|
15
|
+
export function DeviceTable({ onBack, className, }) {
|
|
16
|
+
const { devices, isLoading, isError, error } = useDevices();
|
|
17
|
+
const [selectedDeviceId, selectDevice] = useState(null);
|
|
18
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
19
|
+
if (selectedDeviceId != null) {
|
|
20
|
+
return (_jsx(DeviceDetails, { className: className, deviceId: selectedDeviceId, onBack: () => {
|
|
21
|
+
selectDevice(null);
|
|
22
|
+
} }));
|
|
23
|
+
}
|
|
24
|
+
if (isLoading) {
|
|
25
|
+
return _jsx("p", { className: className, children: "..." });
|
|
26
|
+
}
|
|
27
|
+
if (isError) {
|
|
28
|
+
return _jsx("p", { className: className, children: error?.message });
|
|
29
|
+
}
|
|
30
|
+
if (devices == null) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const deviceCount = devices.length;
|
|
34
|
+
const filteredDevices = devices.filter((device) => {
|
|
35
|
+
if (searchTerm === '') {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return new RegExp(searchTerm, 'i').test(device.properties.name);
|
|
39
|
+
});
|
|
40
|
+
return (_jsxs("div", { className: classNames('seam-device-table', className), children: [_jsx(ContentHeader, { onBack: onBack }), _jsxs(TableHeader, { children: [_jsxs(TableTitle, { children: [t.devices, " ", _jsxs(Caption, { children: ["(", deviceCount, ")"] })] }), _jsx(SearchTextField, { value: searchTerm, onChange: setSearchTerm, disabled: deviceCount === 0 })] }), _jsx(TableBody, { children: _jsx(Body, { devices: filteredDevices, selectDevice: selectDevice }) })] }));
|
|
41
|
+
}
|
|
42
|
+
function Body(props) {
|
|
43
|
+
const { devices, selectDevice } = props;
|
|
44
|
+
const [filter, setFilter] = useState(null);
|
|
45
|
+
if (devices.length === 0) {
|
|
46
|
+
return _jsx(EmptyPlaceholder, { children: t.noDevicesMessage });
|
|
47
|
+
}
|
|
48
|
+
const filteredDevices = devices.filter((device) => {
|
|
49
|
+
if (filter === null) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (filter === 'device_issues') {
|
|
53
|
+
return device.errors.length > 0;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
});
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsx(DeviceHealthBar, { devices: devices, filter: filter, onFilterSelect: setFilter }), filteredDevices.map((device) => (_jsx(DeviceRow, { device: device, onClick: () => {
|
|
58
|
+
selectDevice(device.device_id);
|
|
59
|
+
} }, device.device_id)))] }));
|
|
60
|
+
}
|
|
61
|
+
const t = {
|
|
62
|
+
devices: 'Devices',
|
|
63
|
+
unknownLock: 'Unknown Lock',
|
|
64
|
+
noDevicesMessage: 'Sorry, no devices were found',
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=DeviceTable.js.map
|
|
@@ -0,0 +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,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAA;AAClF,OAAO,EAEL,eAAe,GAChB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAA;AACxE,OAAO,EACL,UAAU,GAGX,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAA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EAAE,MAAM,EACd,cAAc,EAAE,SAAS,GACzB,EACD,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC/B,KAAC,SAAS,IACR,MAAM,EAAE,MAAM,EAEd,OAAO,EAAE,GAAG,EAAE;oBACZ,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBAChC,CAAC,IAHI,MAAM,CAAC,SAAS,CAIrB,CACH,CAAC,IACD,CACJ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,cAAc;IAC3B,gBAAgB,EAAE,8BAA8B;CACjD,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type FilterCategoryMenuProps = FilterCategoryMenuPropsWithAllOption | FilterCategoryMenuPropsWithoutAllOption;
|
|
3
|
+
interface FilterCategoryMenuPropsWithAllOption extends FilterCategoryMenuBaseProps {
|
|
4
|
+
hideAllOption?: false;
|
|
5
|
+
allLabel: string;
|
|
6
|
+
onAllOptionSelect: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface FilterCategoryMenuPropsWithoutAllOption extends FilterCategoryMenuBaseProps {
|
|
9
|
+
hideAllOption: true;
|
|
10
|
+
allLabel: never;
|
|
11
|
+
onAllOptionSelect?: never;
|
|
12
|
+
}
|
|
13
|
+
interface FilterCategoryMenuBaseProps {
|
|
14
|
+
label: string;
|
|
15
|
+
options: string[];
|
|
16
|
+
onSelect: (option: string) => void;
|
|
17
|
+
buttonLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function FilterCategoryMenu({ label, allLabel, options, hideAllOption, onSelect, onAllOptionSelect, buttonLabel, }: FilterCategoryMenuProps): JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronDownIcon } from '
|
|
3
|
-
import { Menu } from '
|
|
4
|
-
import { MenuItem } from '
|
|
5
|
-
export function FilterCategoryMenu({ label =
|
|
2
|
+
import { ChevronDownIcon } from '../../../../lib/icons/ChevronDown.js';
|
|
3
|
+
import { Menu } from '../../../../lib/ui/Menu/Menu.js';
|
|
4
|
+
import { MenuItem } from '../../../../lib/ui/Menu/MenuItem.js';
|
|
5
|
+
export function FilterCategoryMenu({ label = t.filter, allLabel, options, hideAllOption = false, onSelect, onAllOptionSelect, buttonLabel, }) {
|
|
6
6
|
const usableOptions = hideAllOption ? options : ['All', ...options];
|
|
7
7
|
return (_jsxs("div", { className: 'seam-supported-device-table-filter-menu-wrap', children: [_jsx("p", { children: label }), _jsx(Menu, { renderButton: ({ onOpen }) => (_jsxs("button", { onClick: onOpen, children: [_jsx("span", { children: buttonLabel }), _jsx(ChevronDownIcon, {})] })), children: usableOptions.map((option, index) => (_jsx(MenuItem, { onClick: () => {
|
|
8
|
-
if (option ===
|
|
8
|
+
if (option === allLabel) {
|
|
9
9
|
onAllOptionSelect?.();
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
@@ -13,4 +13,7 @@ export function FilterCategoryMenu({ label = 'Filter', options, hideAllOption =
|
|
|
13
13
|
}
|
|
14
14
|
}, children: _jsx("span", { children: option }) }, `${index}:${option}`))) })] }));
|
|
15
15
|
}
|
|
16
|
+
const t = {
|
|
17
|
+
filter: 'Filter',
|
|
18
|
+
};
|
|
16
19
|
//# sourceMappingURL=FilterCategoryMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterCategoryMenu.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA2BlD,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,GAAG,CAAC,CAAC,MAAM,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,KAAK,EACrB,QAAQ,EACR,iBAAiB,EACjB,WAAW,GACa;IACxB,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAA;IAEnE,OAAO,CACL,eAAK,SAAS,EAAC,8CAA8C,aAC3D,sBAAI,KAAK,GAAK,EACd,KAAC,IAAI,IACH,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC5B,kBAAQ,OAAO,EAAE,MAAM,aACrB,yBAAO,WAAW,GAAQ,EAC1B,KAAC,eAAe,KAAG,IACZ,CACV,YAEA,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,QAAQ,IAEP,OAAO,EAAE,GAAG,EAAE;wBACZ,IAAI,MAAM,KAAK,QAAQ,EAAE;4BACvB,iBAAiB,EAAE,EAAE,CAAA;yBACtB;6BAAM;4BACL,QAAQ,CAAC,MAAM,CAAC,CAAA;yBACjB;oBACH,CAAC,YAED,yBAAO,MAAM,GAAQ,IAThB,GAAG,KAAK,IAAI,MAAM,EAAE,CAUhB,CACZ,CAAC,GACG,IACH,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,MAAM,EAAE,QAAQ;CACjB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
8
|
+
export declare function SupportedDeviceContent({ resetFilterValue, filterValue, filters, }: SupportedDeviceContentProps): JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { SupportedDeviceHeader } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js';
|
|
3
|
+
import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.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, }) {
|
|
7
|
+
const { deviceModels, isLoading, isError, refetch } = useFilteredDeviceModels(filterValue, filters);
|
|
8
|
+
if (isLoading) {
|
|
9
|
+
return (_jsx("div", { className: 'seam-supported-device-table-content-state-block', children: _jsx("p", { children: t.loading }) }));
|
|
10
|
+
}
|
|
11
|
+
if (isError) {
|
|
12
|
+
return (_jsxs("div", { className: 'seam-supported-device-table-content-state-block', children: [_jsx("p", { children: t.error }), _jsx(Button, { variant: 'solid', size: 'small', onClick: () => {
|
|
13
|
+
void refetch();
|
|
14
|
+
}, children: t.retry })] }));
|
|
15
|
+
}
|
|
16
|
+
if (deviceModels == null) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs("table", { className: 'seam-supported-device-table-content', children: [_jsx(SupportedDeviceHeader, {}), _jsxs("tbody", { children: [deviceModels.map((deviceModel, index) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, [
|
|
20
|
+
deviceModel.main_category,
|
|
21
|
+
deviceModel.brand,
|
|
22
|
+
deviceModel.model_name,
|
|
23
|
+
deviceModel.manufacturer_model_id,
|
|
24
|
+
index,
|
|
25
|
+
].join(':')))), deviceModels.length === 0 && (_jsx(EmptyResult, { filterValue: filterValue, resetFilterValue: resetFilterValue }))] })] }));
|
|
26
|
+
}
|
|
27
|
+
function EmptyResult({ filterValue, resetFilterValue, }) {
|
|
28
|
+
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 })] }));
|
|
29
|
+
return (_jsx("tr", { className: 'seam-supported-device-table-content-message-row', children: _jsx("td", { colSpan: 6, children: _jsx("div", { className: 'seam-supported-device-table-content-message', children: filterValue.length === 0 ? _jsx("p", { children: t.noneFound }) : noMatchingRows }) }) }));
|
|
30
|
+
}
|
|
31
|
+
const t = {
|
|
32
|
+
loading: 'Loading device models...',
|
|
33
|
+
retry: 'Retry',
|
|
34
|
+
error: 'There was an error fetching device models.',
|
|
35
|
+
noneFound: 'No device models found.',
|
|
36
|
+
noMatch: 'No device models matched your search.',
|
|
37
|
+
clear: 'Clear search terms',
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=SupportedDeviceContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedDeviceContent.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAA;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AACnG,OAAO,EAEL,uBAAuB,GACxB,MAAM,wEAAwE,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAQzC,MAAM,UAAU,sBAAsB,CAAC,EACrC,gBAAgB,EAChB,WAAW,EACX,OAAO,GACqB;IAC5B,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAC3E,WAAW,EACX,OAAO,CACR,CAAA;IAED,IAAI,SAAS,EAAE;QAC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AAC,KAAK,GACD,IACR,CACJ,CAAA;IAED,OAAO,CACL,aAAI,SAAS,EAAC,iDAAiD,YAC7D,aAAI,OAAO,EAAE,CAAC,YACZ,cAAK,SAAS,EAAC,6CAA6C,YACzD,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,sBAAI,CAAC,CAAC,SAAS,GAAK,CAAC,CAAC,CAAC,cAAc,GAC7D,GACH,GACF,CACN,CAAA;AACH,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { DeviceModelFilters } from '../../../../lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js';
|
|
3
|
+
export interface SupportedDeviceFilterAreaProps {
|
|
4
|
+
filterValue: string;
|
|
5
|
+
setFilterValue: (filter: string) => void;
|
|
6
|
+
filters: DeviceModelFilters;
|
|
7
|
+
setFilters: Dispatch<SetStateAction<DeviceModelFilters>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, }: SupportedDeviceFilterAreaProps): JSX.Element;
|
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
filterProperty !== false);
|
|
13
|
-
});
|
|
14
|
-
const appliedFiltersCount = appliedFilters.length;
|
|
15
|
-
const getAvailablePropertiesFromDeviceModels = (property) => {
|
|
16
|
-
const properties = new Set();
|
|
17
|
-
deviceModels.forEach((deviceModel) => {
|
|
18
|
-
properties.add(capitalize(deviceModel[property]));
|
|
19
|
-
});
|
|
20
|
-
return Array.from(properties);
|
|
21
|
-
};
|
|
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
|
+
import { Button } from '../../../../lib/ui/Button.js';
|
|
6
|
+
import { Menu } from '../../../../lib/ui/Menu/Menu.js';
|
|
7
|
+
import { SearchTextField } from '../../../../lib/ui/TextField/SearchTextField.js';
|
|
8
|
+
export function SupportedDeviceFilterArea({ filterValue, setFilterValue, filters, setFilters, }) {
|
|
9
|
+
const appliedFiltersCount = Object.values(filters).filter((v) => v != null && v !== false).length;
|
|
10
|
+
const filterProperty = 'brand';
|
|
11
|
+
const availableProperties = useAvailableProperties(filterProperty);
|
|
22
12
|
const resetFilter = (filterType) => {
|
|
23
13
|
setFilters((filters) => ({
|
|
24
14
|
...filters,
|
|
25
15
|
[filterType]: null,
|
|
26
16
|
}));
|
|
27
17
|
};
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
? `Filters (${appliedFiltersCount})`
|
|
31
|
-
: 'Filter';
|
|
18
|
+
const filterButtonLabel = appliedFiltersCount > 0 ? `${t.filters} (${appliedFiltersCount})` : t.filter;
|
|
19
|
+
const allLabel = t.all;
|
|
32
20
|
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) => {
|
|
33
21
|
event.stopPropagation();
|
|
34
|
-
}, children: [_jsx("div", { className: 'seam-filter-menu-row', children: _jsx(FilterCategoryMenu, { label:
|
|
22
|
+
}, children: [_jsx("div", { className: 'seam-filter-menu-row', children: _jsx(FilterCategoryMenu, { label: t.brand, allLabel: allLabel, options: availableProperties, onSelect: (brand) => {
|
|
35
23
|
setFilters((filters) => ({
|
|
36
24
|
...filters,
|
|
37
25
|
brand,
|
|
38
26
|
}));
|
|
39
|
-
}, buttonLabel: filters.brand ??
|
|
40
|
-
resetFilter(
|
|
41
|
-
} }) }), _jsx("div", { className: 'seam-filter-menu-row', children: _jsxs("label", { htmlFor: 'supportedOnly', className: 'seam-filter-checkbox-label', children: [_jsx("p", { children:
|
|
27
|
+
}, buttonLabel: filters.brand ?? allLabel, onAllOptionSelect: () => {
|
|
28
|
+
resetFilter(filterProperty);
|
|
29
|
+
} }) }), _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) => {
|
|
42
30
|
setFilters((filters) => ({
|
|
43
31
|
...filters,
|
|
44
32
|
supportedOnly: event.target.checked,
|
|
@@ -47,4 +35,21 @@ export function SupportedDeviceFilterArea({ deviceModels, filterValue, setFilter
|
|
|
47
35
|
setFilterValue(value);
|
|
48
36
|
}, className: 'seam-supported-device-table-filter-area-search-bar' }) })] })] }));
|
|
49
37
|
}
|
|
38
|
+
const useAvailableProperties = (property) => {
|
|
39
|
+
const { deviceModels } = useDeviceModels();
|
|
40
|
+
if (deviceModels == null)
|
|
41
|
+
return [];
|
|
42
|
+
const properties = new Set();
|
|
43
|
+
for (const deviceModel of deviceModels) {
|
|
44
|
+
properties.add(capitalize(deviceModel[property]));
|
|
45
|
+
}
|
|
46
|
+
return Array.from(properties);
|
|
47
|
+
};
|
|
48
|
+
const t = {
|
|
49
|
+
all: 'All',
|
|
50
|
+
brand: 'Brand',
|
|
51
|
+
supported: 'Supported',
|
|
52
|
+
filter: 'Filter',
|
|
53
|
+
filters: 'Filters',
|
|
54
|
+
};
|
|
50
55
|
//# sourceMappingURL=SupportedDeviceFilterArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedDeviceFilterArea.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAEnG,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AASrE,MAAM,UAAU,yBAAyB,CAAC,EACxC,WAAW,EACX,cAAc,EACd,OAAO,EACP,UAAU,GACqB;IAC/B,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CACvD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,CAChC,CAAC,MAAM,CAAA;IAER,MAAM,cAAc,GAAG,OAAO,CAAA;IAC9B,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAA;IAElE,MAAM,WAAW,GAAG,CAAC,UAAoC,EAAQ,EAAE;QACjE,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACvB,GAAG,OAAO;YACV,CAAC,UAAU,CAAC,EAAE,IAAI;SACnB,CAAC,CAAC,CAAA;IACL,CAAC,CAAA;IAED,MAAM,iBAAiB,GACrB,mBAAmB,GAAG,CAAC,C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jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { children: t.category }), _jsx("th", { children: t.modelName }), _jsx("th", { children: t.manufacturerModelId }), _jsx("th", { children: t.connectionType }), _jsx("th", { children: t.status })] }) }));
|
|
4
|
+
}
|
|
5
|
+
const t = {
|
|
6
|
+
category: 'Category',
|
|
7
|
+
modelName: 'Model Name',
|
|
8
|
+
manufacturerModelId: 'Manufacturer Model ID',
|
|
9
|
+
connectionType: 'Connection Type',
|
|
10
|
+
status: 'Status',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=SupportedDeviceHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedDeviceHeader.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,qBAAqB;IACnC,OAAO,CACL,0BACE,yBACE,cAAM,EACN,uBAAK,CAAC,CAAC,QAAQ,GAAM,EACrB,uBAAK,CAAC,CAAC,SAAS,GAAM,EACtB,uBAAK,CAAC,CAAC,mBAAmB,GAAM,EAChC,uBAAK,CAAC,CAAC,cAAc,GAAM,EAC3B,uBAAK,CAAC,CAAC,MAAM,GAAM,IAChB,GACC,CACT,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,YAAY;IACvB,mBAAmB,EAAE,uBAAuB;IAC5C,cAAc,EAAE,iBAAiB;IACjC,MAAM,EAAE,QAAQ;CACjB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { capitalize } from '../../../../lib/strings.js';
|
|
4
|
+
export function SupportedDeviceRow({ deviceModel, }) {
|
|
5
|
+
const statusColor = supportLevelColors[deviceModel.support_level] ?? 'gray';
|
|
6
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("img", { width: 40, src: deviceModel.icon_url }) }), _jsx("td", { children: deviceModel.main_category }), _jsx("td", { children: deviceModel.model_name }), _jsx("td", { children: deviceModel.manufacturer_model_id }), _jsx("td", { children: connectionTypeNames[deviceModel.connection_type] }), _jsx("td", { children: _jsx("div", { className: classNames('seam-status-pill', `status-${statusColor}`), children: _jsx("span", { children: capitalize(deviceModel.support_level) }) }) })] }));
|
|
7
|
+
}
|
|
8
|
+
const supportLevelColors = {
|
|
9
|
+
live: 'green',
|
|
10
|
+
beta: 'blue',
|
|
11
|
+
unsupported: 'orange',
|
|
12
|
+
};
|
|
13
|
+
const connectionTypeNames = {
|
|
14
|
+
wifi: 'Wifi',
|
|
15
|
+
zwave: 'Z-Wave',
|
|
16
|
+
zigbee: 'Zigbee',
|
|
17
|
+
unknown: 'Unknown',
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=SupportedDeviceRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedDeviceRow.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAM3C,MAAM,UAAU,kBAAkB,CAAC,EACjC,WAAW,GACa;IACxB,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,MAAM,CAAA;IAC3E,OAAO,CACL,yBACE,uBACE,cAAK,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,QAAQ,GAAI,GAC1C,EACL,uBAAK,WAAW,CAAC,aAAa,GAAM,EACpC,uBAAK,WAAW,CAAC,UAAU,GAAM,EACjC,uBAAK,WAAW,CAAC,qBAAqB,GAAM,EAC5C,uBAAK,mBAAmB,CAAC,WAAW,CAAC,eAAe,CAAC,GAAM,EAC3D,uBACE,cACE,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,UAAU,WAAW,EAAE,CAAC,YAElE,yBAAO,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,GAAQ,GAChD,GACH,IACF,CACN,CAAA;AACH,CAAC;AAED,MAAM,kBAAkB,GAGpB;IACF,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,QAAQ;CACtB,CAAA;AAED,MAAM,mBAAmB,GAAmD;IAC1E,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { SupportedDeviceContent } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js';
|
|
5
|
+
import { SupportedDeviceFilterArea } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js';
|
|
6
|
+
export function SupportedDeviceTable({ cannotFilter = false, className, }) {
|
|
7
|
+
const [filterValue, setFilterValue] = useState('');
|
|
8
|
+
const [filters, setFilters] = useState({
|
|
9
|
+
supportedOnly: false,
|
|
10
|
+
category: null,
|
|
11
|
+
brand: null,
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs("div", { className: classNames('seam-supported-device-table-content-wrap', className), children: [!cannotFilter && (_jsx(SupportedDeviceFilterArea, { filterValue: filterValue, setFilterValue: setFilterValue, filters: filters, setFilters: setFilters })), _jsx(SupportedDeviceContent, { resetFilterValue: () => {
|
|
14
|
+
setFilterValue('');
|
|
15
|
+
}, filterValue: filterValue, filters: filters })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SupportedDeviceTable.js.map
|
|
@@ -0,0 +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,sBAAsB,EAAE,MAAM,oEAAoE,CAAA;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAA;AAQjH,MAAM,UAAU,oBAAoB,CAAC,EACnC,YAAY,GAAG,KAAK,EACpB,SAAS,GACiB;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAqB;QACzD,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;KACZ,CAAC,CAAA;IAEF,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CACnB,0CAA0C,EAC1C,SAAS,CACV,aAEA,CAAC,YAAY,IAAI,CAChB,KAAC,yBAAyB,IACxB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACtB,CACH,EACD,KAAC,sBAAsB,IACrB,gBAAgB,EAAE,GAAG,EAAE;oBACrB,cAAc,CAAC,EAAE,CAAC,CAAA;gBACpB,CAAC,EACD,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,GAChB,IACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useDeviceModels } from '../../../../lib/seam/device-models/use-device-models.js';
|
|
2
|
+
export interface DeviceModelFilters {
|
|
3
|
+
supportedOnly: boolean;
|
|
4
|
+
category: string | null;
|
|
5
|
+
brand: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const useFilteredDeviceModels: (filterValue: string, filters: DeviceModelFilters) => ReturnType<typeof useDeviceModels>;
|