@ledvance/base 1.2.83 → 1.2.84

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.
Files changed (165) hide show
  1. package/.babelrc +31 -31
  2. package/.eslintignore +5 -5
  3. package/.eslintrc.js +27 -27
  4. package/.prettierrc.js +1 -1
  5. package/.versionrc +5 -5
  6. package/localazy.json +848 -848
  7. package/localazy.keys.json +4 -4
  8. package/package.json +74 -74
  9. package/rn-cli.config.js +8 -8
  10. package/src/api/native.d.ts +71 -71
  11. package/src/api/native.ts +423 -423
  12. package/src/api/nativeEventEmitter.d.ts +3 -3
  13. package/src/api/nativeEventEmitter.ts +125 -125
  14. package/src/components/AdvanceCard.d.ts +25 -25
  15. package/src/components/AdvanceCard.tsx +117 -117
  16. package/src/components/AdvanceList.d.ts +9 -9
  17. package/src/components/AdvanceList.tsx +69 -69
  18. package/src/components/ApplyForDeviceItem.d.ts +6 -6
  19. package/src/components/ApplyForDeviceItem.tsx +83 -83
  20. package/src/components/ApplyForDeviceList.d.ts +7 -7
  21. package/src/components/ApplyForDeviceList.tsx +61 -61
  22. package/src/components/ApplyForText.d.ts +6 -6
  23. package/src/components/ApplyForText.tsx +52 -52
  24. package/src/components/Card.d.ts +10 -10
  25. package/src/components/Card.tsx +40 -40
  26. package/src/components/Cell.d.ts +21 -21
  27. package/src/components/Cell.tsx +69 -69
  28. package/src/components/CircularProgress.d.ts +8 -8
  29. package/src/components/CircularProgress.tsx +42 -42
  30. package/src/components/ColorAdjustView.d.ts +12 -12
  31. package/src/components/ColorAdjustView.tsx +64 -64
  32. package/src/components/ColorExtractor.d.ts +73 -73
  33. package/src/components/ColorExtractor.tsx +374 -374
  34. package/src/components/ColorTempAdjustView.d.ts +13 -13
  35. package/src/components/ColorTempAdjustView.tsx +57 -57
  36. package/src/components/ColorsLine.d.ts +7 -7
  37. package/src/components/ColorsLine.tsx +47 -47
  38. package/src/components/CustomListDialog.d.ts +15 -15
  39. package/src/components/CustomListDialog.tsx +66 -66
  40. package/src/components/DeleteButton.d.ts +10 -10
  41. package/src/components/DeleteButton.tsx +40 -40
  42. package/src/components/Dialog.d.ts +10 -10
  43. package/src/components/Dialog.tsx +38 -38
  44. package/src/components/DrawToolView.d.ts +46 -46
  45. package/src/components/DrawToolView.tsx +262 -262
  46. package/src/components/FanAdjustView.d.ts +23 -23
  47. package/src/components/FanAdjustView.tsx +141 -141
  48. package/src/components/InfoText.d.ts +11 -11
  49. package/src/components/InfoText.tsx +45 -45
  50. package/src/components/LampAdjustView.d.ts +10 -10
  51. package/src/components/LampAdjustView.tsx +75 -75
  52. package/src/components/LampAdjustView2.d.ts +24 -24
  53. package/src/components/LampAdjustView2.tsx +104 -104
  54. package/src/components/LinearGradientLine.d.ts +9 -9
  55. package/src/components/LinearGradientLine.tsx +63 -63
  56. package/src/components/LoadingView.tsx +39 -39
  57. package/src/components/MoodColorsLine.d.ts +9 -9
  58. package/src/components/MoodColorsLine.tsx +38 -38
  59. package/src/components/Page.d.ts +21 -21
  60. package/src/components/Page.tsx +104 -104
  61. package/src/components/Popup.d.ts +7 -7
  62. package/src/components/Popup.tsx +71 -71
  63. package/src/components/Segmented.d.ts +14 -14
  64. package/src/components/Segmented.tsx +76 -76
  65. package/src/components/ShowSelect.d.ts +1 -1
  66. package/src/components/ShowSelect.tsx +158 -158
  67. package/src/components/SocketItem.d.ts +13 -13
  68. package/src/components/SocketItem.tsx +87 -87
  69. package/src/components/Spacer.d.ts +7 -7
  70. package/src/components/Spacer.tsx +13 -13
  71. package/src/components/Stepper.d.ts +19 -19
  72. package/src/components/Stepper.tsx +130 -130
  73. package/src/components/StripAdjustView.d.ts +16 -16
  74. package/src/components/StripAdjustView.tsx +129 -129
  75. package/src/components/StripLightView.d.ts +14 -14
  76. package/src/components/StripLightView.tsx +24 -24
  77. package/src/components/Summary.tsx +116 -116
  78. package/src/components/Tag.d.ts +8 -8
  79. package/src/components/Tag.tsx +56 -56
  80. package/src/components/TextButton.d.ts +9 -9
  81. package/src/components/TextButton.tsx +31 -31
  82. package/src/components/TextField.d.ts +9 -9
  83. package/src/components/TextField.tsx +92 -92
  84. package/src/components/TextFieldStyleButton.d.ts +8 -8
  85. package/src/components/TextFieldStyleButton.tsx +85 -85
  86. package/src/components/UATabTitle.d.ts +6 -6
  87. package/src/components/UATabTitle.tsx +31 -31
  88. package/src/components/UATabs.d.ts +12 -12
  89. package/src/components/UATabs.tsx +77 -77
  90. package/src/components/connect.d.ts +10 -10
  91. package/src/components/connect.tsx +20 -20
  92. package/src/components/ldvColorBrightness.d.ts +1 -1
  93. package/src/components/ldvColorBrightness.tsx +18 -18
  94. package/src/components/ldvColorSlider.d.ts +14 -14
  95. package/src/components/ldvColorSlider.tsx +131 -131
  96. package/src/components/ldvItemView.d.ts +12 -12
  97. package/src/components/ldvItemView.tsx +43 -43
  98. package/src/components/ldvPickerView.d.ts +13 -13
  99. package/src/components/ldvPickerView.tsx +97 -97
  100. package/src/components/ldvPresetView.d.ts +2 -2
  101. package/src/components/ldvPresetView.tsx +86 -86
  102. package/src/components/ldvSaturation.d.ts +2 -2
  103. package/src/components/ldvSaturation.tsx +22 -22
  104. package/src/components/ldvSlider.d.ts +15 -15
  105. package/src/components/ldvSlider.tsx +103 -103
  106. package/src/components/ldvSwitch.d.ts +10 -10
  107. package/src/components/ldvSwitch.tsx +52 -52
  108. package/src/components/ldvTemperatureSlider.d.ts +13 -13
  109. package/src/components/ldvTemperatureSlider.tsx +139 -139
  110. package/src/components/ldvTopBar.d.ts +10 -10
  111. package/src/components/ldvTopBar.tsx +76 -76
  112. package/src/components/ldvTopName.d.ts +9 -9
  113. package/src/components/ldvTopName.tsx +63 -63
  114. package/src/components/segmentControl.d.ts +1 -1
  115. package/src/components/segmentControl.tsx +65 -65
  116. package/src/components/weekSelect.d.ts +7 -7
  117. package/src/components/weekSelect.tsx +98 -98
  118. package/src/composeLayout.d.ts +30 -30
  119. package/src/composeLayout.tsx +261 -261
  120. package/src/config/dark-theme.ts +61 -61
  121. package/src/config/light-theme.ts +61 -61
  122. package/src/hooks/Hooks.d.ts +2 -2
  123. package/src/hooks/Hooks.ts +8 -8
  124. package/src/i18n/index.d.ts +16 -16
  125. package/src/i18n/index.ts +37 -37
  126. package/src/i18n/strings.d.ts +15953 -15953
  127. package/src/i18n/strings.ts +23723 -23723
  128. package/src/main.tsx +9 -9
  129. package/src/models/GlobalParams.d.ts +14 -14
  130. package/src/models/GlobalParams.ts +14 -14
  131. package/src/models/TuyaApi.d.ts +29 -29
  132. package/src/models/TuyaApi.ts +92 -92
  133. package/src/models/combine.d.ts +26 -26
  134. package/src/models/combine.ts +17 -17
  135. package/src/models/configureStore.d.ts +9 -9
  136. package/src/models/configureStore.ts +33 -33
  137. package/src/models/index.d.ts +31 -31
  138. package/src/models/index.ts +22 -22
  139. package/src/models/modules/NativePropsSlice.d.ts +61 -61
  140. package/src/models/modules/NativePropsSlice.tsx +467 -467
  141. package/src/models/modules/Result.d.ts +14 -14
  142. package/src/models/modules/Result.ts +15 -15
  143. package/src/models/modules/common.d.ts +44 -44
  144. package/src/models/modules/common.ts +161 -161
  145. package/src/res/index.d.ts +70 -70
  146. package/src/res/index.ts +73 -73
  147. package/src/utils/ColorParser.d.ts +66 -66
  148. package/src/utils/ColorParser.ts +189 -189
  149. package/src/utils/ColorUtils.d.ts +71 -71
  150. package/src/utils/ColorUtils.tsx +448 -448
  151. package/src/utils/Support.d.ts +13 -13
  152. package/src/utils/Support.ts +108 -108
  153. package/src/utils/TypeUtils.d.ts +3 -3
  154. package/src/utils/cctUtils.d.ts +1 -1
  155. package/src/utils/cctUtils.ts +110 -110
  156. package/src/utils/common.d.ts +35 -35
  157. package/src/utils/common.ts +379 -379
  158. package/src/utils/index.d.ts +26 -26
  159. package/src/utils/index.ts +191 -191
  160. package/src/utils/interface.d.ts +6 -6
  161. package/src/utils/interface.ts +50 -50
  162. package/src/utils/loopsCompare.d.ts +1 -1
  163. package/src/utils/loopsCompare.ts +62 -62
  164. package/tsconfig.json +50 -50
  165. package/update-localazy.py +52 -52
@@ -1,13 +1,13 @@
1
- export interface ColorTempAdjustViewProps {
2
- colorTemp: number;
3
- brightness: number;
4
- minBrightness?: number;
5
- isSupportTemperature: boolean;
6
- isSupportBrightness: boolean;
7
- onCCTChange?: (cct: number) => void;
8
- onCCTChangeComplete: (cct: number) => void;
9
- onBrightnessChange?: (brightness: number) => void;
10
- onBrightnessChangeComplete: (brightness: number) => void;
11
- }
12
- declare const ColorTempAdjustView: (props: ColorTempAdjustViewProps) => JSX.Element;
13
- export default ColorTempAdjustView;
1
+ export interface ColorTempAdjustViewProps {
2
+ colorTemp: number;
3
+ brightness: number;
4
+ minBrightness?: number;
5
+ isSupportTemperature: boolean;
6
+ isSupportBrightness: boolean;
7
+ onCCTChange?: (cct: number) => void;
8
+ onCCTChangeComplete: (cct: number) => void;
9
+ onBrightnessChange?: (brightness: number) => void;
10
+ onBrightnessChangeComplete: (brightness: number) => void;
11
+ }
12
+ declare const ColorTempAdjustView: (props: ColorTempAdjustViewProps) => JSX.Element;
13
+ export default ColorTempAdjustView;
@@ -1,58 +1,58 @@
1
- import {View} from 'react-native'
2
- import React from 'react'
3
- import LdvColorSlider from './ldvColorSlider'
4
- import Spacer from './Spacer'
5
- import LdvPresetView from './ldvPresetView'
6
- import LdvSlider from './ldvSlider'
7
- import {Utils} from 'tuya-panel-kit'
8
- import I18n from '../i18n/index'
9
- import {cctToColor} from '../utils/cctUtils'
10
-
11
- const {convertX: cx} = Utils.RatioUtils
12
-
13
- export interface ColorTempAdjustViewProps {
14
- colorTemp: number
15
- brightness: number
16
- minBrightness?: number
17
- isSupportTemperature: boolean
18
- isSupportBrightness: boolean
19
- onCCTChange?: (cct: number) => void
20
- onCCTChangeComplete: (cct: number) => void
21
- onBrightnessChange?: (brightness: number) => void
22
- onBrightnessChangeComplete: (brightness: number) => void
23
- }
24
-
25
- const ColorTempAdjustView = (props: ColorTempAdjustViewProps) => {
26
- return (
27
- <View>
28
- {props.isSupportTemperature &&
29
- <>
30
- <LdvColorSlider
31
- type={'temperature'}
32
- title={I18n.getLang('light_sources_tile_main_lighting_shade')}
33
- thumbColor={cctToColor(props.colorTemp)}
34
- value={props.colorTemp}
35
- onValueChange={props.onCCTChange}
36
- onSlidingComplete={props.onCCTChangeComplete}/>
37
- <Spacer height={cx(10)}/>
38
- <LdvPresetView
39
- type={'temperature'}
40
- style={{height: cx(60)}}
41
- onPress={item => {
42
- props.onCCTChangeComplete(item.value)
43
- }}/>
44
- <Spacer height={cx(10)}/>
45
- </>
46
- }
47
- {props.isSupportBrightness &&
48
- <LdvSlider
49
- title={I18n.getLang('light_sources_tile_rgb_lighting_brightness')}
50
- min={props.minBrightness}
51
- value={props.brightness}
52
- onValueChange={props.onBrightnessChange}
53
- onSlidingComplete={props.onBrightnessChangeComplete}/>}
54
- </View>
55
- )
56
- }
57
-
1
+ import {View} from 'react-native'
2
+ import React from 'react'
3
+ import LdvColorSlider from './ldvColorSlider'
4
+ import Spacer from './Spacer'
5
+ import LdvPresetView from './ldvPresetView'
6
+ import LdvSlider from './ldvSlider'
7
+ import {Utils} from 'tuya-panel-kit'
8
+ import I18n from '../i18n/index'
9
+ import {cctToColor} from '../utils/cctUtils'
10
+
11
+ const {convertX: cx} = Utils.RatioUtils
12
+
13
+ export interface ColorTempAdjustViewProps {
14
+ colorTemp: number
15
+ brightness: number
16
+ minBrightness?: number
17
+ isSupportTemperature: boolean
18
+ isSupportBrightness: boolean
19
+ onCCTChange?: (cct: number) => void
20
+ onCCTChangeComplete: (cct: number) => void
21
+ onBrightnessChange?: (brightness: number) => void
22
+ onBrightnessChangeComplete: (brightness: number) => void
23
+ }
24
+
25
+ const ColorTempAdjustView = (props: ColorTempAdjustViewProps) => {
26
+ return (
27
+ <View>
28
+ {props.isSupportTemperature &&
29
+ <>
30
+ <LdvColorSlider
31
+ type={'temperature'}
32
+ title={I18n.getLang('light_sources_tile_main_lighting_shade')}
33
+ thumbColor={cctToColor(props.colorTemp)}
34
+ value={props.colorTemp}
35
+ onValueChange={props.onCCTChange}
36
+ onSlidingComplete={props.onCCTChangeComplete}/>
37
+ <Spacer height={cx(10)}/>
38
+ <LdvPresetView
39
+ type={'temperature'}
40
+ style={{height: cx(60)}}
41
+ onPress={item => {
42
+ props.onCCTChangeComplete(item.value)
43
+ }}/>
44
+ <Spacer height={cx(10)}/>
45
+ </>
46
+ }
47
+ {props.isSupportBrightness &&
48
+ <LdvSlider
49
+ title={I18n.getLang('light_sources_tile_rgb_lighting_brightness')}
50
+ min={props.minBrightness}
51
+ value={props.brightness}
52
+ onValueChange={props.onBrightnessChange}
53
+ onSlidingComplete={props.onBrightnessChangeComplete}/>}
54
+ </View>
55
+ )
56
+ }
57
+
58
58
  export default ColorTempAdjustView
@@ -1,7 +1,7 @@
1
- import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
- interface ColorsLineProps extends ViewProps {
3
- colors: string[];
4
- nodeStyle?: StyleProp<ViewStyle>;
5
- }
6
- declare const ColorsLine: (props: ColorsLineProps) => JSX.Element;
7
- export default ColorsLine;
1
+ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
+ interface ColorsLineProps extends ViewProps {
3
+ colors: string[];
4
+ nodeStyle?: StyleProp<ViewStyle>;
5
+ }
6
+ declare const ColorsLine: (props: ColorsLineProps) => JSX.Element;
7
+ export default ColorsLine;
@@ -1,48 +1,48 @@
1
- import {StyleProp, StyleSheet, View, ViewProps, ViewStyle} from 'react-native'
2
- import React from 'react'
3
- import {Utils} from 'tuya-panel-kit'
4
-
5
- const cx = Utils.RatioUtils.convertX
6
-
7
- interface ColorsLineProps extends ViewProps {
8
- colors: string[]
9
- nodeStyle?: StyleProp<ViewStyle>
10
- }
11
-
12
- const ColorsLine = (props: ColorsLineProps) => {
13
- return (
14
- <View style={[styles.root, props.style]}>
15
- {
16
- props.colors.map((color, index) => {
17
- return (
18
- <View
19
- key={`${index}`}
20
- style={[
21
- styles.colorNode,
22
- {
23
- backgroundColor: color,
24
- marginStart: index === 0 ? 0 : cx(5),
25
- },
26
- props.nodeStyle,
27
- ]}/>
28
- )
29
- })
30
- }
31
- </View>
32
- )
33
- }
34
-
35
- const styles = StyleSheet.create({
36
- root: {
37
- flexDirection: 'row',
38
- width: cx(295),
39
- height: cx(24),
40
- },
41
- colorNode: {
42
- flex: 1,
43
- height: cx(24),
44
- borderRadius: cx(8),
45
- },
46
- })
47
-
1
+ import {StyleProp, StyleSheet, View, ViewProps, ViewStyle} from 'react-native'
2
+ import React from 'react'
3
+ import {Utils} from 'tuya-panel-kit'
4
+
5
+ const cx = Utils.RatioUtils.convertX
6
+
7
+ interface ColorsLineProps extends ViewProps {
8
+ colors: string[]
9
+ nodeStyle?: StyleProp<ViewStyle>
10
+ }
11
+
12
+ const ColorsLine = (props: ColorsLineProps) => {
13
+ return (
14
+ <View style={[styles.root, props.style]}>
15
+ {
16
+ props.colors.map((color, index) => {
17
+ return (
18
+ <View
19
+ key={`${index}`}
20
+ style={[
21
+ styles.colorNode,
22
+ {
23
+ backgroundColor: color,
24
+ marginStart: index === 0 ? 0 : cx(5),
25
+ },
26
+ props.nodeStyle,
27
+ ]}/>
28
+ )
29
+ })
30
+ }
31
+ </View>
32
+ )
33
+ }
34
+
35
+ const styles = StyleSheet.create({
36
+ root: {
37
+ flexDirection: 'row',
38
+ width: cx(295),
39
+ height: cx(24),
40
+ },
41
+ colorNode: {
42
+ flex: 1,
43
+ height: cx(24),
44
+ borderRadius: cx(8),
45
+ },
46
+ })
47
+
48
48
  export default ColorsLine
@@ -1,15 +1,15 @@
1
- import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
- interface ListData {
3
- text: string;
4
- value?: any;
5
- isMax?: boolean;
6
- }
7
- interface CustomListDialogProps extends ViewProps {
8
- itemStyle?: StyleProp<ViewStyle>;
9
- show: boolean;
10
- onDismiss: () => void;
11
- data: ListData[];
12
- onItemPress: (item: any | undefined, index: number) => void;
13
- }
14
- declare const CustomListDialog: (props: CustomListDialogProps) => JSX.Element;
15
- export default CustomListDialog;
1
+ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
+ interface ListData {
3
+ text: string;
4
+ value?: any;
5
+ isMax?: boolean;
6
+ }
7
+ interface CustomListDialogProps extends ViewProps {
8
+ itemStyle?: StyleProp<ViewStyle>;
9
+ show: boolean;
10
+ onDismiss: () => void;
11
+ data: ListData[];
12
+ onItemPress: (item: any | undefined, index: number) => void;
13
+ }
14
+ declare const CustomListDialog: (props: CustomListDialogProps) => JSX.Element;
15
+ export default CustomListDialog;
@@ -1,66 +1,66 @@
1
- import Card from './Card'
2
- import { FlatList, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native'
3
- import TextButton from './TextButton'
4
- import Dialog from './Dialog'
5
- import React from 'react'
6
- import { Utils } from 'tuya-panel-kit'
7
-
8
- const cx = Utils.RatioUtils.convertX
9
- const { withTheme } = Utils.ThemeUtils
10
-
11
- interface ListData {
12
- text: string
13
- value?: any
14
- isMax?: boolean
15
- }
16
-
17
- interface CustomListDialogProps extends ViewProps {
18
- theme?: any
19
- itemStyle?: StyleProp<ViewStyle>
20
- show: boolean
21
- onDismiss: () => void
22
- data: ListData[]
23
- onItemPress: (item: any | undefined, index: number) => void
24
- }
25
-
26
- const CustomListDialog = (props: CustomListDialogProps) => {
27
- const styles = StyleSheet.create({
28
- popoverItemText: {
29
- color: props.theme.global.fontColor,
30
- fontSize: cx(16),
31
- },
32
- disableItemText: {
33
- color: props.theme.global.disabledFontColor,
34
- fontSize: cx(16),
35
- },
36
- line: {
37
- height: .5,
38
- backgroundColor: 'rgba(60,60,67,.36)',
39
- },
40
-
41
- })
42
- return <Dialog
43
- show={props.show}
44
- hideMask={true}
45
- onRequestClose={props.onDismiss}>
46
- <Card style={props.style} shadowHeight={cx(7)}>
47
- <FlatList
48
- data={props.data}
49
- renderItem={({ item, index }) => {
50
- return (
51
- <TextButton
52
- text={item.text}
53
- style={props.itemStyle}
54
- textStyle={item.isMax ? styles.disableItemText : styles.popoverItemText}
55
- onPress={() => {
56
- props.onItemPress(item.value, index)
57
- }} />
58
- )
59
- }}
60
- keyExtractor={(_, index) => `${index}`}
61
- ItemSeparatorComponent={() => (<View style={styles.line} />)} />
62
- </Card>
63
- </Dialog>
64
- }
65
-
66
- export default withTheme(CustomListDialog)
1
+ import Card from './Card'
2
+ import { FlatList, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native'
3
+ import TextButton from './TextButton'
4
+ import Dialog from './Dialog'
5
+ import React from 'react'
6
+ import { Utils } from 'tuya-panel-kit'
7
+
8
+ const cx = Utils.RatioUtils.convertX
9
+ const { withTheme } = Utils.ThemeUtils
10
+
11
+ interface ListData {
12
+ text: string
13
+ value?: any
14
+ isMax?: boolean
15
+ }
16
+
17
+ interface CustomListDialogProps extends ViewProps {
18
+ theme?: any
19
+ itemStyle?: StyleProp<ViewStyle>
20
+ show: boolean
21
+ onDismiss: () => void
22
+ data: ListData[]
23
+ onItemPress: (item: any | undefined, index: number) => void
24
+ }
25
+
26
+ const CustomListDialog = (props: CustomListDialogProps) => {
27
+ const styles = StyleSheet.create({
28
+ popoverItemText: {
29
+ color: props.theme.global.fontColor,
30
+ fontSize: cx(16),
31
+ },
32
+ disableItemText: {
33
+ color: props.theme.global.disabledFontColor,
34
+ fontSize: cx(16),
35
+ },
36
+ line: {
37
+ height: .5,
38
+ backgroundColor: 'rgba(60,60,67,.36)',
39
+ },
40
+
41
+ })
42
+ return <Dialog
43
+ show={props.show}
44
+ hideMask={true}
45
+ onRequestClose={props.onDismiss}>
46
+ <Card style={props.style} shadowHeight={cx(7)}>
47
+ <FlatList
48
+ data={props.data}
49
+ renderItem={({ item, index }) => {
50
+ return (
51
+ <TextButton
52
+ text={item.text}
53
+ style={props.itemStyle}
54
+ textStyle={item.isMax ? styles.disableItemText : styles.popoverItemText}
55
+ onPress={() => {
56
+ props.onItemPress(item.value, index)
57
+ }} />
58
+ )
59
+ }}
60
+ keyExtractor={(_, index) => `${index}`}
61
+ ItemSeparatorComponent={() => (<View style={styles.line} />)} />
62
+ </Card>
63
+ </Dialog>
64
+ }
65
+
66
+ export default withTheme(CustomListDialog)
@@ -1,10 +1,10 @@
1
- import { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
- interface DeleteButtonProps {
3
- text: string;
4
- onPress: () => void;
5
- style?: StyleProp<ViewStyle>;
6
- textStyle?: StyleProp<TextStyle>;
7
- disabled?: boolean;
8
- }
9
- declare const DeleteButton: (props: DeleteButtonProps) => JSX.Element;
10
- export default DeleteButton;
1
+ import { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
+ interface DeleteButtonProps {
3
+ text: string;
4
+ onPress: () => void;
5
+ style?: StyleProp<ViewStyle>;
6
+ textStyle?: StyleProp<TextStyle>;
7
+ disabled?: boolean;
8
+ }
9
+ declare const DeleteButton: (props: DeleteButtonProps) => JSX.Element;
10
+ export default DeleteButton;
@@ -1,40 +1,40 @@
1
- import React from 'react'
2
- import { StyleProp, Text, TextStyle, TouchableOpacity, ViewStyle } from 'react-native'
3
- import { Utils } from 'tuya-panel-kit'
4
-
5
- const cx = Utils.RatioUtils.convertX
6
- const { withTheme } = Utils.ThemeUtils
7
-
8
- interface DeleteButtonProps {
9
- theme?: any
10
- text: string,
11
- onPress: () => void,
12
- style?: StyleProp<ViewStyle>,
13
- textStyle?: StyleProp<TextStyle>
14
- disabled?: boolean
15
- }
16
-
17
- const DeleteButton = (props: DeleteButtonProps) => {
18
- const { text, onPress, style, textStyle, disabled } = props
19
- return (
20
- <TouchableOpacity
21
- disabled={disabled}
22
- onPress={onPress}
23
- style={[{
24
- width: '100%',
25
- height: cx(50),
26
- backgroundColor: props.theme.button.disabled,
27
- alignItems: 'center',
28
- justifyContent: 'center',
29
- borderRadius: cx(8),
30
- }, style]}>
31
- <Text style={[{
32
- color: props.theme.button.fontColor,
33
- fontSize: cx(16),
34
- fontFamily: 'helvetica_neue_lt_std_bd',
35
- }, textStyle]}>{text}</Text>
36
- </TouchableOpacity>
37
- )
38
- }
39
-
40
- export default withTheme(DeleteButton)
1
+ import React from 'react'
2
+ import { StyleProp, Text, TextStyle, TouchableOpacity, ViewStyle } from 'react-native'
3
+ import { Utils } from 'tuya-panel-kit'
4
+
5
+ const cx = Utils.RatioUtils.convertX
6
+ const { withTheme } = Utils.ThemeUtils
7
+
8
+ interface DeleteButtonProps {
9
+ theme?: any
10
+ text: string,
11
+ onPress: () => void,
12
+ style?: StyleProp<ViewStyle>,
13
+ textStyle?: StyleProp<TextStyle>
14
+ disabled?: boolean
15
+ }
16
+
17
+ const DeleteButton = (props: DeleteButtonProps) => {
18
+ const { text, onPress, style, textStyle, disabled } = props
19
+ return (
20
+ <TouchableOpacity
21
+ disabled={disabled}
22
+ onPress={onPress}
23
+ style={[{
24
+ width: '100%',
25
+ height: cx(50),
26
+ backgroundColor: props.theme.button.disabled,
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ borderRadius: cx(8),
30
+ }, style]}>
31
+ <Text style={[{
32
+ color: props.theme.button.fontColor,
33
+ fontSize: cx(16),
34
+ fontFamily: 'helvetica_neue_lt_std_bd',
35
+ }, textStyle]}>{text}</Text>
36
+ </TouchableOpacity>
37
+ )
38
+ }
39
+
40
+ export default withTheme(DeleteButton)
@@ -1,10 +1,10 @@
1
- import { PropsWithChildren } from 'react';
2
- import { ViewProps } from 'react-native';
3
- interface DialogProps extends PropsWithChildren<ViewProps> {
4
- show: boolean;
5
- hideMask: boolean;
6
- animationType?: 'none' | 'slide' | 'fade';
7
- onRequestClose: () => void;
8
- }
9
- declare const Dialog: (props: DialogProps) => JSX.Element;
10
- export default Dialog;
1
+ import { PropsWithChildren } from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ interface DialogProps extends PropsWithChildren<ViewProps> {
4
+ show: boolean;
5
+ hideMask: boolean;
6
+ animationType?: 'none' | 'slide' | 'fade';
7
+ onRequestClose: () => void;
8
+ }
9
+ declare const Dialog: (props: DialogProps) => JSX.Element;
10
+ export default Dialog;
@@ -1,39 +1,39 @@
1
- import React, {PropsWithChildren} from 'react'
2
- import {Modal, StyleSheet, TouchableOpacity, ViewProps} from 'react-native'
3
-
4
- interface DialogProps extends PropsWithChildren<ViewProps> {
5
- show: boolean
6
- hideMask: boolean
7
- animationType?: 'none' | 'slide' | 'fade'
8
- onRequestClose: () => void
9
- }
10
-
11
- const Dialog = (props: DialogProps) => {
12
- return (
13
- <Modal
14
- transparent={true}
15
- visible={props.show}
16
- animationType={props.animationType || 'fade'}
17
- onRequestClose={props.onRequestClose}>
18
- <TouchableOpacity
19
- style={[
20
- styles.mask,
21
- {
22
- backgroundColor: props.hideMask ? 'rgba(0, 0, 0, 0)' : 'rgba(0, 0, 0, 0.7)',
23
- },
24
- ]}
25
- activeOpacity={1}
26
- onPress={props.onRequestClose}>
27
- {props.children}
28
- </TouchableOpacity>
29
- </Modal>
30
- )
31
- }
32
-
33
- const styles = StyleSheet.create({
34
- mask: {
35
- flex: 1,
36
- },
37
- })
38
-
1
+ import React, {PropsWithChildren} from 'react'
2
+ import {Modal, StyleSheet, TouchableOpacity, ViewProps} from 'react-native'
3
+
4
+ interface DialogProps extends PropsWithChildren<ViewProps> {
5
+ show: boolean
6
+ hideMask: boolean
7
+ animationType?: 'none' | 'slide' | 'fade'
8
+ onRequestClose: () => void
9
+ }
10
+
11
+ const Dialog = (props: DialogProps) => {
12
+ return (
13
+ <Modal
14
+ transparent={true}
15
+ visible={props.show}
16
+ animationType={props.animationType || 'fade'}
17
+ onRequestClose={props.onRequestClose}>
18
+ <TouchableOpacity
19
+ style={[
20
+ styles.mask,
21
+ {
22
+ backgroundColor: props.hideMask ? 'rgba(0, 0, 0, 0)' : 'rgba(0, 0, 0, 0.7)',
23
+ },
24
+ ]}
25
+ activeOpacity={1}
26
+ onPress={props.onRequestClose}>
27
+ {props.children}
28
+ </TouchableOpacity>
29
+ </Modal>
30
+ )
31
+ }
32
+
33
+ const styles = StyleSheet.create({
34
+ mask: {
35
+ flex: 1,
36
+ },
37
+ })
38
+
39
39
  export default Dialog