@ledvance/base 1.2.12 → 1.2.14
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 +1 -1
- package/src/components/ApplyForDeviceList.d.ts +2 -2
- package/src/components/ApplyForDeviceList.tsx +20 -5
- package/src/components/ldvPresetView.tsx +1 -1
- package/src/hooks/Hooks.d.ts +2 -0
- package/src/hooks/Hooks.ts +9 -0
- package/src/i18n/strings.d.ts +28 -549
- package/src/i18n/strings.ts +56 -577
- package/src/models/modules/NativePropsSlice.d.ts +4 -2
- package/src/models/modules/NativePropsSlice.tsx +20 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeviceInfo } from '../api/native';
|
|
2
2
|
export interface ApplyForDeviceListProps {
|
|
3
3
|
devices: DeviceInfo[];
|
|
4
|
-
expand
|
|
5
|
-
onExpandChange
|
|
4
|
+
expand?: boolean;
|
|
5
|
+
onExpandChange?: (expand: boolean) => void;
|
|
6
6
|
}
|
|
7
7
|
export default function ApplyForDeviceList(props: ApplyForDeviceListProps): JSX.Element;
|
|
@@ -5,22 +5,37 @@ import { FlatList, StyleSheet, View } from 'react-native'
|
|
|
5
5
|
import Spacer from './Spacer'
|
|
6
6
|
import ApplyForDeviceItem from './ApplyForDeviceItem'
|
|
7
7
|
import { Utils } from 'tuya-panel-kit'
|
|
8
|
+
import { useReactive, useUpdateEffect } from 'ahooks'
|
|
8
9
|
|
|
9
10
|
const cx = Utils.RatioUtils.convertX
|
|
10
11
|
|
|
11
12
|
export interface ApplyForDeviceListProps {
|
|
12
13
|
devices: DeviceInfo[]
|
|
13
|
-
expand
|
|
14
|
-
onExpandChange
|
|
14
|
+
expand?: boolean
|
|
15
|
+
onExpandChange?: (expand: boolean) => void
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default function ApplyForDeviceList(props: ApplyForDeviceListProps) {
|
|
19
|
+
const state = useReactive({
|
|
20
|
+
expand: props.expand || false
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
useUpdateEffect(() =>{
|
|
24
|
+
state.expand = props.expand || false
|
|
25
|
+
}, [props.expand])
|
|
26
|
+
|
|
18
27
|
return <View>
|
|
19
28
|
<ApplyForText
|
|
20
|
-
expand={
|
|
21
|
-
onExpandChange={
|
|
29
|
+
expand={state.expand}
|
|
30
|
+
onExpandChange={(expand) =>{
|
|
31
|
+
if(props.onExpandChange){
|
|
32
|
+
props.onExpandChange(expand)
|
|
33
|
+
}else{
|
|
34
|
+
state.expand = expand
|
|
35
|
+
}
|
|
36
|
+
}}/>
|
|
22
37
|
<Spacer height={cx(2)}/>
|
|
23
|
-
{
|
|
38
|
+
{state.expand &&
|
|
24
39
|
<FlatList
|
|
25
40
|
style={styles.deviceList}
|
|
26
41
|
data={props.devices}
|