@seamapi/react 2.10.2 → 2.12.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 +2 -2
- package/dist/elements.js +6093 -6011
- package/dist/elements.js.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/SeamProvider.js +1 -1
- package/lib/seam/SeamProvider.js.map +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +14 -5
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js.map +1 -1
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +1 -1
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.js +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +6 -0
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +51 -0
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -0
- package/lib/ui/AccessCodeForm/AccessCodeForm.js +25 -24
- package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
- package/lib/ui/FormField.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +12 -11
- package/src/lib/seam/SeamProvider.tsx +2 -3
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +1 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +1 -2
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +82 -51
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +1 -2
- package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +1 -2
- package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +1 -2
- package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -2
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +1 -2
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +1 -2
- package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +1 -2
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +1 -2
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +1 -2
- package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +92 -0
- package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +74 -67
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +1 -2
- package/src/lib/ui/FormField.tsx +2 -2
- package/src/lib/version.ts +1 -1
- package/src/styles/_supported-device-table.scss +6 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import type { AccessCode, SeamError } from 'seamapi'
|
|
3
3
|
|
|
4
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
5
|
-
|
|
6
4
|
import { useCreateAccessCode } from 'lib/seam/access-codes/use-create-access-code.js'
|
|
7
5
|
import {
|
|
8
6
|
type CommonProps,
|
|
@@ -10,6 +8,7 @@ import {
|
|
|
10
8
|
} from 'lib/seam/components/common-props.js'
|
|
11
9
|
import { useDevice, type UseDeviceData } from 'lib/seam/devices/use-device.js'
|
|
12
10
|
import { getValidationError } from 'lib/seam/error-handlers.js'
|
|
11
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
13
12
|
import {
|
|
14
13
|
AccessCodeForm,
|
|
15
14
|
type AccessCodeFormSubmitData,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
2
|
-
|
|
3
1
|
import type { CommonProps } from 'lib/seam/components/common-props.js'
|
|
4
2
|
import { useCreateClimateSettingSchedule } from 'lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js'
|
|
3
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
5
4
|
import {
|
|
6
5
|
ClimateSettingScheduleForm,
|
|
7
6
|
type ClimateSettingScheduleFormSubmitData,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isLockDevice, isThermostatDevice } from 'seamapi'
|
|
2
2
|
|
|
3
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
type CommonProps,
|
|
7
5
|
withRequiredCommonProps,
|
|
@@ -9,6 +7,7 @@ import {
|
|
|
9
7
|
import { LockDeviceDetails } from 'lib/seam/components/DeviceDetails/LockDeviceDetails.js'
|
|
10
8
|
import { ThermostatDeviceDetails } from 'lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js'
|
|
11
9
|
import { useDevice } from 'lib/seam/devices/use-device.js'
|
|
10
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
12
11
|
|
|
13
12
|
export interface DeviceDetailsProps extends CommonProps {
|
|
14
13
|
deviceId: string
|
|
@@ -2,8 +2,6 @@ import classNames from 'classnames'
|
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react'
|
|
3
3
|
import { type CommonDevice, isLockDevice, isThermostatDevice } from 'seamapi'
|
|
4
4
|
|
|
5
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
6
|
-
|
|
7
5
|
import { compareByCreatedAtDesc } from 'lib/dates.js'
|
|
8
6
|
import {
|
|
9
7
|
type CommonProps,
|
|
@@ -20,6 +18,7 @@ import {
|
|
|
20
18
|
useDevices,
|
|
21
19
|
type UseDevicesData,
|
|
22
20
|
} from 'lib/seam/devices/use-devices.js'
|
|
21
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
23
22
|
import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
|
|
24
23
|
import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
|
|
25
24
|
import { Snackbar } from 'lib/ui/Snackbar/Snackbar.js'
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
useAccessCode,
|
|
5
3
|
type UseAccessCodeData,
|
|
@@ -11,6 +9,7 @@ import {
|
|
|
11
9
|
} from 'lib/seam/components/common-props.js'
|
|
12
10
|
import { useResponseErrors } from 'lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js'
|
|
13
11
|
import { useDevice } from 'lib/seam/devices/use-device.js'
|
|
12
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
14
13
|
import {
|
|
15
14
|
AccessCodeForm,
|
|
16
15
|
type AccessCodeFormSubmitData,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import { useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
5
|
-
|
|
6
4
|
import {
|
|
7
5
|
type CommonProps,
|
|
8
6
|
withRequiredCommonProps,
|
|
@@ -10,6 +8,7 @@ import {
|
|
|
10
8
|
import { SupportedDeviceContent } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js'
|
|
11
9
|
import { SupportedDeviceFilterArea } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js'
|
|
12
10
|
import type { DeviceModelFilters } from 'lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js'
|
|
11
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
13
12
|
|
|
14
13
|
export interface SupportedDeviceTableProps extends CommonProps {
|
|
15
14
|
disableFilter?: boolean
|
package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Manufacturer } from '@seamapi/types/devicedb'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
|
|
4
|
-
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
5
|
-
|
|
6
4
|
import { CopyIcon } from 'lib/icons/Copy.js'
|
|
7
5
|
import {
|
|
8
6
|
type CommonProps,
|
|
9
7
|
withRequiredCommonProps,
|
|
10
8
|
} from 'lib/seam/components/common-props.js'
|
|
9
|
+
import { useComponentTelemetry } from 'lib/telemetry/index.js'
|
|
11
10
|
import { copyToClipboard } from 'lib/ui/clipboard.js'
|
|
12
11
|
import { MenuItem } from 'lib/ui/Menu/MenuItem.js'
|
|
13
12
|
|
package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useMutation,
|
|
3
|
+
type UseMutationResult,
|
|
4
|
+
useQueryClient,
|
|
5
|
+
} from '@tanstack/react-query'
|
|
6
|
+
import type {
|
|
7
|
+
ClimateSettingSchedule,
|
|
8
|
+
ClimateSettingSchedulesListResponse,
|
|
9
|
+
ClimateSettingScheduleUpdateRequest,
|
|
10
|
+
ClimateSettingScheduleUpdateResponse,
|
|
11
|
+
SeamError,
|
|
12
|
+
} from 'seamapi'
|
|
13
|
+
|
|
14
|
+
import { NullSeamClientError, useSeamClient } from 'lib/index.js'
|
|
15
|
+
|
|
16
|
+
type UseUpdateClimateSettingScheduleData =
|
|
17
|
+
ClimateSettingScheduleUpdateResponse['climate_setting_schedule']
|
|
18
|
+
type UseUpdateClimateSettingScheduleMutationParams =
|
|
19
|
+
ClimateSettingScheduleUpdateRequest
|
|
20
|
+
|
|
21
|
+
export function useUpdateClimateSettingSchedule(): UseMutationResult<
|
|
22
|
+
UseUpdateClimateSettingScheduleData,
|
|
23
|
+
SeamError,
|
|
24
|
+
UseUpdateClimateSettingScheduleMutationParams
|
|
25
|
+
> {
|
|
26
|
+
const { client } = useSeamClient()
|
|
27
|
+
const queryClient = useQueryClient()
|
|
28
|
+
|
|
29
|
+
return useMutation<
|
|
30
|
+
UseUpdateClimateSettingScheduleData,
|
|
31
|
+
SeamError,
|
|
32
|
+
UseUpdateClimateSettingScheduleMutationParams
|
|
33
|
+
>({
|
|
34
|
+
mutationFn: async (
|
|
35
|
+
mutationPararms: UseUpdateClimateSettingScheduleMutationParams
|
|
36
|
+
) => {
|
|
37
|
+
if (client === null) throw new NullSeamClientError()
|
|
38
|
+
return await client.thermostats.climateSettingSchedules.update(
|
|
39
|
+
mutationPararms
|
|
40
|
+
)
|
|
41
|
+
},
|
|
42
|
+
onSuccess: (updated) => {
|
|
43
|
+
queryClient.setQueryData<ClimateSettingSchedule>(
|
|
44
|
+
[
|
|
45
|
+
'thermostats',
|
|
46
|
+
'climate_setting_schedules',
|
|
47
|
+
'get',
|
|
48
|
+
{
|
|
49
|
+
climate_setting_schedule_id: updated.climate_setting_schedule_id,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
(climateSettingSchedule) => {
|
|
53
|
+
if (climateSettingSchedule == null) {
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
...climateSettingSchedule,
|
|
59
|
+
...updated,
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
queryClient.setQueryData<
|
|
65
|
+
ClimateSettingSchedulesListResponse['climate_setting_schedules']
|
|
66
|
+
>(
|
|
67
|
+
[
|
|
68
|
+
'thermostats',
|
|
69
|
+
'climate_setting_schedules',
|
|
70
|
+
'list',
|
|
71
|
+
{ device_id: updated.device_id },
|
|
72
|
+
],
|
|
73
|
+
(climateSettingSchedules): ClimateSettingSchedule[] => {
|
|
74
|
+
if (climateSettingSchedules == null) {
|
|
75
|
+
return []
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return climateSettingSchedules.map((climateSettingSchedule) => {
|
|
79
|
+
if (climateSettingSchedule.device_id === updated.device_id) {
|
|
80
|
+
return {
|
|
81
|
+
...climateSettingSchedule,
|
|
82
|
+
...updated,
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return climateSettingSchedule
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
}
|
|
@@ -176,6 +176,9 @@ function Content({
|
|
|
176
176
|
? t.codeLengthRequirement(codeLengthRequirement)
|
|
177
177
|
: null
|
|
178
178
|
|
|
179
|
+
const hasCodeInputs =
|
|
180
|
+
accessCode?.type !== 'time_bound' || accessCode.is_offline_access_code
|
|
181
|
+
|
|
179
182
|
return (
|
|
180
183
|
<>
|
|
181
184
|
<ContentHeader
|
|
@@ -207,77 +210,81 @@ function Content({
|
|
|
207
210
|
}}
|
|
208
211
|
/>
|
|
209
212
|
</FormField>
|
|
210
|
-
|
|
211
|
-
<InputLabel>{t.codeInputLabel}</InputLabel>
|
|
212
|
-
<TextField
|
|
213
|
-
size='large'
|
|
214
|
-
clearable
|
|
215
|
-
hasError={hasCodeError}
|
|
216
|
-
helperText={responseErrors?.code ?? errors.code?.message}
|
|
217
|
-
inputProps={{
|
|
218
|
-
...register('code', {
|
|
219
|
-
required: t.codeRequiredError,
|
|
220
|
-
validate: (value: string) =>
|
|
221
|
-
validateCodeLength(device, value),
|
|
222
|
-
}),
|
|
223
|
-
}}
|
|
224
|
-
/>
|
|
225
|
-
<div
|
|
226
|
-
className={classNames('seam-bottom', {
|
|
227
|
-
'has-hints': codeLengthRequirementMessage != null,
|
|
228
|
-
})}
|
|
229
|
-
>
|
|
230
|
-
{codeLengthRequirementMessage != null && (
|
|
231
|
-
<ul
|
|
232
|
-
className={classNames('seam-requirements', {
|
|
233
|
-
'seam-error': hasCodeError,
|
|
234
|
-
})}
|
|
235
|
-
>
|
|
236
|
-
<li>{codeLengthRequirementMessage}</li>
|
|
237
|
-
<li>{t.codeNumbersOnlyRequirement}</li>
|
|
238
|
-
</ul>
|
|
239
|
-
)}
|
|
240
|
-
<Button
|
|
241
|
-
size='small'
|
|
242
|
-
onMouseDown={(e) => {
|
|
243
|
-
e.preventDefault() // Disable stealing input focus
|
|
244
|
-
handleGenerateCode()
|
|
245
|
-
}}
|
|
246
|
-
disabled={isGeneratingCode}
|
|
247
|
-
>
|
|
248
|
-
{t.codeGenerateButton}
|
|
249
|
-
</Button>
|
|
250
|
-
</div>
|
|
251
|
-
</FormField>
|
|
252
|
-
<FormField>
|
|
253
|
-
<InputLabel>{t.timingInputLabel}</InputLabel>
|
|
254
|
-
<RadioField
|
|
255
|
-
value={type}
|
|
256
|
-
onChange={setType}
|
|
257
|
-
name='type'
|
|
258
|
-
options={[
|
|
259
|
-
{
|
|
260
|
-
label: t.typeOngoingLabel,
|
|
261
|
-
value: 'ongoing',
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
label: t.typeTimeBoundLabel,
|
|
265
|
-
value: 'time_bound',
|
|
266
|
-
},
|
|
267
|
-
]}
|
|
268
|
-
/>
|
|
213
|
+
{hasCodeInputs && (
|
|
269
214
|
<>
|
|
270
|
-
|
|
271
|
-
<
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
215
|
+
<FormField className='seam-code-field'>
|
|
216
|
+
<InputLabel>{t.codeInputLabel}</InputLabel>
|
|
217
|
+
<TextField
|
|
218
|
+
size='large'
|
|
219
|
+
clearable
|
|
220
|
+
hasError={hasCodeError}
|
|
221
|
+
helperText={responseErrors?.code ?? errors.code?.message}
|
|
222
|
+
inputProps={{
|
|
223
|
+
...register('code', {
|
|
224
|
+
required: t.codeRequiredError,
|
|
225
|
+
validate: (value: string) =>
|
|
226
|
+
validateCodeLength(device, value),
|
|
227
|
+
}),
|
|
276
228
|
}}
|
|
277
229
|
/>
|
|
278
|
-
|
|
230
|
+
<div
|
|
231
|
+
className={classNames('seam-bottom', {
|
|
232
|
+
'has-hints': codeLengthRequirementMessage != null,
|
|
233
|
+
})}
|
|
234
|
+
>
|
|
235
|
+
{codeLengthRequirementMessage != null && (
|
|
236
|
+
<ul
|
|
237
|
+
className={classNames('seam-requirements', {
|
|
238
|
+
'seam-error': hasCodeError,
|
|
239
|
+
})}
|
|
240
|
+
>
|
|
241
|
+
<li>{codeLengthRequirementMessage}</li>
|
|
242
|
+
<li>{t.codeNumbersOnlyRequirement}</li>
|
|
243
|
+
</ul>
|
|
244
|
+
)}
|
|
245
|
+
<Button
|
|
246
|
+
size='small'
|
|
247
|
+
onMouseDown={(e) => {
|
|
248
|
+
e.preventDefault() // Disable stealing input focus
|
|
249
|
+
handleGenerateCode()
|
|
250
|
+
}}
|
|
251
|
+
disabled={isGeneratingCode}
|
|
252
|
+
>
|
|
253
|
+
{t.codeGenerateButton}
|
|
254
|
+
</Button>
|
|
255
|
+
</div>
|
|
256
|
+
</FormField>
|
|
257
|
+
<FormField>
|
|
258
|
+
<InputLabel>{t.timingInputLabel}</InputLabel>
|
|
259
|
+
<RadioField
|
|
260
|
+
value={type}
|
|
261
|
+
onChange={setType}
|
|
262
|
+
name='type'
|
|
263
|
+
options={[
|
|
264
|
+
{
|
|
265
|
+
label: t.typeOngoingLabel,
|
|
266
|
+
value: 'ongoing',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
label: t.typeTimeBoundLabel,
|
|
270
|
+
value: 'time_bound',
|
|
271
|
+
},
|
|
272
|
+
]}
|
|
273
|
+
/>
|
|
274
|
+
<>
|
|
275
|
+
{type === 'time_bound' && (
|
|
276
|
+
<AccessCodeFormTimes
|
|
277
|
+
startDate={startDate}
|
|
278
|
+
endDate={endDate}
|
|
279
|
+
onEdit={() => {
|
|
280
|
+
setDatePickerVisible(true)
|
|
281
|
+
}}
|
|
282
|
+
/>
|
|
283
|
+
)}
|
|
284
|
+
</>
|
|
285
|
+
</FormField>
|
|
279
286
|
</>
|
|
280
|
-
|
|
287
|
+
)}
|
|
281
288
|
{responseErrors?.unknown != null && (
|
|
282
289
|
<div className='seam-unknown-error'>{responseErrors?.unknown}</div>
|
|
283
290
|
)}
|
|
@@ -7,9 +7,8 @@ import {
|
|
|
7
7
|
isThermostatDevice,
|
|
8
8
|
} from 'seamapi'
|
|
9
9
|
|
|
10
|
-
import { useDevice } from 'lib/index.js'
|
|
11
|
-
|
|
12
10
|
import { getSystemTimeZone } from 'lib/dates.js'
|
|
11
|
+
import { useDevice } from 'lib/index.js'
|
|
13
12
|
import { ClimateSettingScheduleFormClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js'
|
|
14
13
|
import { ClimateSettingScheduleFormDefaultClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js'
|
|
15
14
|
import { ClimateSettingScheduleFormDeviceSelect } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.js'
|
package/src/lib/ui/FormField.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
|
-
import { cloneElement, useRef } from 'react'
|
|
2
|
+
import { type Attributes, cloneElement, useRef } from 'react'
|
|
3
3
|
|
|
4
4
|
import { DateTimePicker } from 'lib/ui/DateTimePicker/DateTimePicker.js'
|
|
5
5
|
import { InputLabel } from 'lib/ui/InputLabel.js'
|
|
@@ -27,7 +27,7 @@ export function FormField({
|
|
|
27
27
|
// Map children to automatically focus on input when clicking
|
|
28
28
|
// on an InputLabel.
|
|
29
29
|
const clonedChildren = components.map((component, index) => {
|
|
30
|
-
const baseProps = {
|
|
30
|
+
const baseProps: Attributes = {
|
|
31
31
|
...component.props,
|
|
32
32
|
key: index,
|
|
33
33
|
}
|
package/src/lib/version.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
1
2
|
@use './colors';
|
|
2
3
|
|
|
3
4
|
$row-height: 64px;
|
|
@@ -175,7 +176,11 @@ $see-all-button-height: 30px;
|
|
|
175
176
|
0 1px 1px 0 rgb(16 27 37 / 10%),
|
|
176
177
|
0 1px 8px 0 rgb(46 69 82 / 12%);
|
|
177
178
|
position: absolute;
|
|
178
|
-
bottom:
|
|
179
|
+
bottom: math.div(
|
|
180
|
+
-($row-height - $see-all-button-height - $row-padding),
|
|
181
|
+
2
|
|
182
|
+
)
|
|
183
|
+
or calc(-1 * ($row-height - $see-all-button-height - $row-padding) / 2);
|
|
179
184
|
left: 50%;
|
|
180
185
|
transform: translate(-50%, -47px);
|
|
181
186
|
z-index: 3;
|