@ledvance/base 1.2.0 → 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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.2.0",
7
+ "version": "1.2.2",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
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
 
@@ -2,5 +2,5 @@ import { DeviceInfo } from '../api/native';
2
2
  export interface ApplyForDeviceItemProps {
3
3
  deviceInfo: DeviceInfo;
4
4
  }
5
- declare const ApplyForCeilingFanDeviceItem: (props: ApplyForDeviceItemProps) => JSX.Element;
6
- export default ApplyForCeilingFanDeviceItem;
5
+ declare const ApplyForDeviceItem: (props: ApplyForDeviceItemProps) => JSX.Element;
6
+ export default ApplyForDeviceItem;
@@ -10,7 +10,7 @@ export interface ApplyForDeviceItemProps {
10
10
  deviceInfo: DeviceInfo
11
11
  }
12
12
 
13
- const ApplyForCeilingFanDeviceItem = (props: ApplyForDeviceItemProps) => {
13
+ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
14
14
  return (
15
15
  <View style={styles.root}>
16
16
  <View style={styles.deviceInfo}>
@@ -69,4 +69,4 @@ const styles = StyleSheet.create({
69
69
  },
70
70
  })
71
71
 
72
- export default ApplyForCeilingFanDeviceItem
72
+ export default ApplyForDeviceItem
@@ -162,7 +162,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
162
162
  onLayout={onLayout} />
163
163
  </View>
164
164
  <LdvSwitch
165
- title={I18n.getLang('add_new_dynamic_mood_lights_field_headline2_text')}
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
- // Number(newValue) > state.max || Number(newValue) < state.min ||
49
+ (!props.isBeyond && (Number(newValue) > state.max || Number(newValue) < state.min)) ||
49
50
  (idx !== -1 && newValue.length > idx + 2)){
50
51
  return
51
52
  }
@@ -17,7 +17,7 @@ export default function UATabTitle(props: UATabTitleProps) {
17
17
  <Text style={styles.tabsTitle}>{props.text}</Text>
18
18
  <Spacer height={cx(0)} width={cx(4)}/>
19
19
  <TouchableOpacity onPress={props.onIconClick}>
20
- <Image style={{ width: cx(16), height: cx(16), tintColor: '#f60' }} source={{ uri: res.ic_info }}/>
20
+ <Image style={{ width: cx(16), height: cx(16), tintColor: '#f60' }} source={res.ic_info}/>
21
21
  </TouchableOpacity>
22
22
  </View>
23
23
  )