@seamapi/react 2.16.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/elements.js +3037 -3032
- package/dist/elements.js.map +1 -1
- package/dist/index.css +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +1 -1
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js +4 -2
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/ui/noise-sensor/NoiseThresholdsList.js +3 -5
- package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +7 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +12 -2
- package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +10 -14
- package/src/lib/version.ts +1 -1
- package/src/styles/_loading_toast.scss +7 -0
|
@@ -6,16 +6,14 @@ import { useNoiseThresholds } from '../../../lib/seam/noise-sensors/use-noise-th
|
|
|
6
6
|
import { DetailRow } from '../../../lib/ui/layout/DetailRow.js';
|
|
7
7
|
import { DetailSection } from '../../../lib/ui/layout/DetailSection.js';
|
|
8
8
|
import { DetailSectionGroup } from '../../../lib/ui/layout/DetailSectionGroup.js';
|
|
9
|
+
import { LoadingToast } from '../../../lib/ui/LoadingToast/LoadingToast.js';
|
|
9
10
|
export function NoiseThresholdsList({ device, }) {
|
|
10
11
|
const { noiseThresholds, isInitialLoading } = useNoiseThresholds({
|
|
11
12
|
device_id: device.device_id,
|
|
12
13
|
});
|
|
13
|
-
return (
|
|
14
|
+
return (_jsxs(DetailSectionGroup, { children: [_jsx("div", { className: 'seam-loading-toast-centered-wrap', children: _jsx(LoadingToast, { isLoading: isInitialLoading, label: t.loading, top: '56px' }) }), _jsxs("div", { className: 'seam-detail-section-wrap', children: [_jsx(DetailSection, { label: t.noiseThresholds, tooltipContent: device.device_type === 'minut_sensor' ? (_jsxs("div", { className: 'seam-detail-section-tooltip-inner-content', children: [_jsx("span", { className: 'seam-tooltip-content', children: t.minutTooltipFirst }), _jsx("span", { className: 'seam-tooltip-content', children: t.minutTooltipSecond })] })) : (t.tooltip), children: _jsx(Content, { noiseThresholds: noiseThresholds }) }), _jsxs("div", { className: 'seam-detail-section-footer', children: [_jsx("div", { className: 'seam-empty-div' }), _jsx("div", { className: 'seam-detail-section-footer-content', children: _jsx("div", { className: 'seam-detail-section-footer-content-text', children: _jsx("p", { children: getTimeZoneCaption(device, noiseThresholds) }) }) })] })] })] }));
|
|
14
15
|
}
|
|
15
|
-
function Content({
|
|
16
|
-
if (isInitialLoading) {
|
|
17
|
-
return (_jsx(DetailRow, { label: _jsx("span", { className: 'seam-detail-row-empty-label', children: t.loading }) }));
|
|
18
|
-
}
|
|
16
|
+
function Content({ noiseThresholds, }) {
|
|
19
17
|
if (noiseThresholds == null || noiseThresholds.length === 0) {
|
|
20
18
|
return (_jsx(DetailRow, { label: _jsx("span", { className: 'seam-detail-row-empty-label', children: t.none }) }));
|
|
21
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoiseThresholdsList.js","sourceRoot":"","sources":["../../../src/lib/ui/noise-sensor/NoiseThresholdsList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,C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,CAAC,CAAC,OAAO,IAClD,IApBC,cAAc,CAAC,kBAAkB,CAqB5B,CACb,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,kBAAkB,GAAG,CACzB,MAAyB,EACzB,UAAyC,EAC1B,EAAE;IACjB,IAAI,MAAM,CAAC,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAAE,CAAC;QACtC,OAAO,GAAG,CAAC,CAAC,UAAU,IAAI,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACtE,CAAC;IAED,MAAM,cAAc,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,CAAA;IAEtC,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAA;QAChE,OAAO,GAAG,CAAC,CAAC,UAAU,IAAI,cAAc,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAA;IAChE,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,CAAC,GAAG;IACR,eAAe,EAAE,kBAAkB;IACnC,OAAO,EACL,2GAA2G;IAC7G,iBAAiB,EACf,yEAAyE;IAC3E,kBAAkB,EAChB,wFAAwF;IAC1F,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,cAAc;CAC3B,CAAA"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiReactVersion = "2.
|
|
1
|
+
declare const seamapiReactVersion = "2.17.1";
|
|
2
2
|
export default seamapiReactVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import classNames from 'classnames'
|
|
1
2
|
import type { NoiseSensorDevice } from 'seamapi'
|
|
2
3
|
|
|
3
4
|
import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
|
|
@@ -5,6 +6,7 @@ import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
|
|
|
5
6
|
import { DeviceModel } from 'lib/seam/components/DeviceDetails/DeviceModel.js'
|
|
6
7
|
import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
|
|
7
8
|
import { OnlineStatus } from 'lib/ui/device/OnlineStatus.js'
|
|
9
|
+
import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
|
|
8
10
|
import { NoiseThresholdsList } from 'lib/ui/noise-sensor/NoiseThresholdsList.js'
|
|
9
11
|
|
|
10
12
|
interface NoiseSensorDeviceDetailsProps
|
|
@@ -16,9 +18,13 @@ export function NoiseSensorDeviceDetails({
|
|
|
16
18
|
device,
|
|
17
19
|
disableConnectedAccountInformation,
|
|
18
20
|
disableResourceIds,
|
|
21
|
+
onBack,
|
|
22
|
+
className,
|
|
19
23
|
}: NoiseSensorDeviceDetailsProps): JSX.Element | null {
|
|
20
24
|
return (
|
|
21
|
-
<div className='seam-device-details'>
|
|
25
|
+
<div className={classNames('seam-device-details', className)}>
|
|
26
|
+
<ContentHeader title={t.noiseSensor} onBack={onBack} />
|
|
27
|
+
|
|
22
28
|
<div className='seam-body'>
|
|
23
29
|
<div className='seam-summary'>
|
|
24
30
|
<div className='seam-content'>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type CommonDevice,
|
|
5
|
+
isLockDevice,
|
|
6
|
+
isNoiseSensorDevice,
|
|
7
|
+
isThermostatDevice,
|
|
8
|
+
} from 'seamapi'
|
|
4
9
|
|
|
5
10
|
import { compareByCreatedAtDesc } from 'lib/dates.js'
|
|
6
11
|
import {
|
|
@@ -87,7 +92,12 @@ export function DeviceTable({
|
|
|
87
92
|
const filteredDevices = useMemo(
|
|
88
93
|
() =>
|
|
89
94
|
devices
|
|
90
|
-
?.filter(
|
|
95
|
+
?.filter(
|
|
96
|
+
(device) =>
|
|
97
|
+
isLockDevice(device) ||
|
|
98
|
+
isThermostatDevice(device) ||
|
|
99
|
+
isNoiseSensorDevice(device)
|
|
100
|
+
)
|
|
91
101
|
?.filter((device) => deviceFilter(device, searchInputValue))
|
|
92
102
|
?.sort(deviceComparator) ?? [],
|
|
93
103
|
[devices, searchInputValue, deviceFilter, deviceComparator]
|
|
@@ -7,6 +7,7 @@ import { useNoiseThresholds } from 'lib/seam/noise-sensors/use-noise-thresholds.
|
|
|
7
7
|
import { DetailRow } from 'lib/ui/layout/DetailRow.js'
|
|
8
8
|
import { DetailSection } from 'lib/ui/layout/DetailSection.js'
|
|
9
9
|
import { DetailSectionGroup } from 'lib/ui/layout/DetailSectionGroup.js'
|
|
10
|
+
import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
|
|
10
11
|
|
|
11
12
|
interface NoiseThresholdsListProps {
|
|
12
13
|
device: NoiseSensorDevice
|
|
@@ -21,6 +22,14 @@ export function NoiseThresholdsList({
|
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<DetailSectionGroup>
|
|
25
|
+
<div className='seam-loading-toast-centered-wrap'>
|
|
26
|
+
<LoadingToast
|
|
27
|
+
isLoading={isInitialLoading}
|
|
28
|
+
label={t.loading}
|
|
29
|
+
top='56px'
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
24
33
|
<div className='seam-detail-section-wrap'>
|
|
25
34
|
<DetailSection
|
|
26
35
|
label={t.noiseThresholds}
|
|
@@ -39,10 +48,7 @@ export function NoiseThresholdsList({
|
|
|
39
48
|
)
|
|
40
49
|
}
|
|
41
50
|
>
|
|
42
|
-
<Content
|
|
43
|
-
isInitialLoading={isInitialLoading}
|
|
44
|
-
noiseThresholds={noiseThresholds}
|
|
45
|
-
/>
|
|
51
|
+
<Content noiseThresholds={noiseThresholds} />
|
|
46
52
|
</DetailSection>
|
|
47
53
|
|
|
48
54
|
<div className='seam-detail-section-footer'>
|
|
@@ -59,20 +65,10 @@ export function NoiseThresholdsList({
|
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
function Content({
|
|
62
|
-
isInitialLoading,
|
|
63
68
|
noiseThresholds,
|
|
64
69
|
}: {
|
|
65
|
-
isInitialLoading: boolean
|
|
66
70
|
noiseThresholds: NoiseThresholds[] | undefined
|
|
67
71
|
}): JSX.Element | JSX.Element[] {
|
|
68
|
-
if (isInitialLoading) {
|
|
69
|
-
return (
|
|
70
|
-
<DetailRow
|
|
71
|
-
label={<span className='seam-detail-row-empty-label'>{t.loading}</span>}
|
|
72
|
-
/>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
72
|
if (noiseThresholds == null || noiseThresholds.length === 0) {
|
|
77
73
|
return (
|
|
78
74
|
<DetailRow
|
package/src/lib/version.ts
CHANGED