@ledvance/base 1.2.1 → 1.2.2
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/package.json
CHANGED
package/src/api/native.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface LDVDevicePanelManager {
|
|
|
9
9
|
deleteDevice: (deviceId: string, isReset: boolean, callback: (result: any) => void) => void
|
|
10
10
|
rename: (deviceId: string, name: string, callback: (result: any) => void) => void
|
|
11
11
|
toDeviceSettingsPage: (deviceId: string, isGroup: boolean) => void
|
|
12
|
-
toRoutinesPage: (params: {backTitle:string}) => void
|
|
12
|
+
toRoutinesPage: (params: {backTitle:string, deviceId:string}) => void
|
|
13
13
|
putJson: (deviceId: string, featureType: string, json: string, callback: (res: NativeResult<any>) => void) => void
|
|
14
14
|
getJson: (deviceId: string, featureType: string, callback: (res: NativeResult<string>) => void) => void
|
|
15
15
|
getInitiativeQueryDpsInfoWithDpsArray: (dpIds: string, deviceId: string, callback: (res: NativeResult<string>) => void) => void
|
|
@@ -198,7 +198,7 @@ function toDeviceSettingsPage(tuyaDeviceId: string, isGroup: boolean = false) {
|
|
|
198
198
|
devicePanel.toDeviceSettingsPage(tuyaDeviceId, isGroup)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
function toRoutinesPage(params: {backTitle:string}) {
|
|
201
|
+
function toRoutinesPage(params: {backTitle:string, deviceId:string}) {
|
|
202
202
|
devicePanel.toRoutinesPage(params)
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -270,7 +270,7 @@ export class NativeApi {
|
|
|
270
270
|
toDeviceSettingsPage(deviceId, isGroup)
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
static toRoutinesPage(params: {backTitle:string}): void{
|
|
273
|
+
static toRoutinesPage(params: {backTitle:string, deviceId:string}): void{
|
|
274
274
|
toRoutinesPage(params)
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -162,7 +162,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
|
|
|
162
162
|
onLayout={onLayout} />
|
|
163
163
|
</View>
|
|
164
164
|
<LdvSwitch
|
|
165
|
-
title={I18n.getLang('
|
|
165
|
+
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
166
166
|
color={getBlockColor()}
|
|
167
167
|
colorAlpha={1}
|
|
168
168
|
enable={false}
|
|
@@ -204,6 +204,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
|
|
|
204
204
|
<Stepper
|
|
205
205
|
min={5}
|
|
206
206
|
max={48}
|
|
207
|
+
isBeyond={true}
|
|
207
208
|
stepValue={1}
|
|
208
209
|
editable={true}
|
|
209
210
|
value={state.ledNum}
|
|
@@ -17,6 +17,7 @@ export interface StepperProps {
|
|
|
17
17
|
editable?: boolean
|
|
18
18
|
selectionColor?: string
|
|
19
19
|
isRealTime?: boolean
|
|
20
|
+
isBeyond?: boolean // 允许超出边界值
|
|
20
21
|
onValueChange?: ((value: number) => void)
|
|
21
22
|
disabled?: boolean
|
|
22
23
|
style?: StyleProp<ViewStyle>
|
|
@@ -45,7 +46,7 @@ const Stepper = (props: StepperProps) => {
|
|
|
45
46
|
if(newValue[0] === '.' ||
|
|
46
47
|
(newValue.length === 2 && newValue[0] === '0' && newValue[1] !== '.') ||
|
|
47
48
|
newValue.split('').filter(item => item === '.').length > 1 ||
|
|
48
|
-
|
|
49
|
+
(!props.isBeyond && (Number(newValue) > state.max || Number(newValue) < state.min)) ||
|
|
49
50
|
(idx !== -1 && newValue.length > idx + 2)){
|
|
50
51
|
return
|
|
51
52
|
}
|