@ledvance/base 1.3.76 → 1.3.77-1

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 (34) hide show
  1. package/package.json +1 -1
  2. package/src/components/AdvanceCard.tsx +2 -0
  3. package/src/components/Card.tsx +1 -1
  4. package/src/components/Cell.tsx +2 -0
  5. package/src/components/DeleteButton.tsx +3 -0
  6. package/src/components/HybridSwitchView.tsx +3 -0
  7. package/src/components/OptionGroup.tsx +6 -1
  8. package/src/components/Segmented.tsx +3 -0
  9. package/src/components/SocketItem.tsx +9 -1
  10. package/src/components/Stepper.tsx +6 -0
  11. package/src/components/StripAdjustView.tsx +2 -0
  12. package/src/components/Tag.tsx +9 -5
  13. package/src/components/TextButton.tsx +3 -1
  14. package/src/components/TextField.tsx +3 -2
  15. package/src/components/TextFieldStyleButton.tsx +2 -2
  16. package/src/components/UATabs.tsx +3 -0
  17. package/src/components/ldvColorBrightness.tsx +4 -1
  18. package/src/components/ldvColorSlider.tsx +2 -1
  19. package/src/components/ldvPickerView.tsx +4 -0
  20. package/src/components/ldvPresetView.tsx +3 -1
  21. package/src/components/ldvSaturation.tsx +3 -1
  22. package/src/components/ldvSlider.tsx +8 -3
  23. package/src/components/ldvSwitch.tsx +2 -2
  24. package/src/components/ldvTemperatureSlider.tsx +4 -2
  25. package/src/components/ldvTopBar.tsx +3 -1
  26. package/src/components/ldvTopName.tsx +1 -0
  27. package/src/components/rect-color-and-bright-picker/ColourPicker.tsx +2 -0
  28. package/src/components/rect-color-and-bright-picker/RectPicker.tsx +7 -0
  29. package/src/components/rect-color-and-bright-picker/Slider.tsx +3 -1
  30. package/src/components/rect-color-and-bright-picker/WhitePicker.tsx +2 -0
  31. package/src/components/segmentControl.tsx +11 -4
  32. package/src/components/weekSelect.tsx +3 -0
  33. package/src/components/ShowSelect.d.ts +0 -1
  34. package/src/components/ShowSelect.tsx +0 -159
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.76",
7
+ "version": "1.3.77-1",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -53,6 +53,8 @@ const AdvanceCard = (props: AdvanceCardProps) => {
53
53
  onPress={props.onPress}>
54
54
  {!!statusColor && <View style={styles.dotBg}>
55
55
  <View
56
+ accessibilityLabel={"StatusDot"}
57
+ accessibilityHint={statusColor}
56
58
  style={[
57
59
  styles.dot,
58
60
  {backgroundColor: props.data.statusColor},
@@ -32,7 +32,7 @@ const Card = (props: CardProps) => {
32
32
  },
33
33
  borderRadius: cx(10),
34
34
  }, props.style]}>
35
- <TouchableOpacity disabled={!(!!props.onPress)} onPress={props.onPress} onLongPress={props.onLongPress}>
35
+ <TouchableOpacity accessible={false} disabled={!(!!props.onPress)} onPress={props.onPress} onLongPress={props.onLongPress}>
36
36
  <View style={props.containerStyle}>{props.children}</View>
37
37
  </TouchableOpacity>
38
38
  </View>
@@ -17,6 +17,8 @@ interface CellProps {
17
17
  export default withTheme(function Cell(props: CellProps) {
18
18
  return (
19
19
  <TouchableOpacity
20
+ accessibilityLabel={"Cell"}
21
+ accessibilityHint={props.value}
20
22
  style={[{
21
23
  height: cx(50),
22
24
  paddingHorizontal: cx(24),
@@ -19,6 +19,9 @@ const DeleteButton = (props: DeleteButtonProps) => {
19
19
  const { text, onPress, style, textStyle, disabled } = props
20
20
  return (
21
21
  <TouchableOpacity
22
+ accessibilityLabel={"DeleteButton"}
23
+ accessibilityHint={text}
24
+ accessibilityState={{disabled}}
22
25
  disabled={disabled}
23
26
  onPress={onPress}
24
27
  style={[{
@@ -91,6 +91,9 @@ const HybridSwitchView = (props: HybridSwitchViewProps) => {
91
91
  <View style={styles.container}>
92
92
  {props.switchChannels.map((channel, index) => (
93
93
  <TouchableOpacity
94
+ accessibilityLabel={"HybridSwitch"}
95
+ accessibilityHint={`${index}`}
96
+ accessibilityState={{checked: channel}}
94
97
  key={index}
95
98
  activeOpacity={Platform.OS === 'ios' ? 0.5 : 0.9}
96
99
  onPress={() => {
@@ -71,7 +71,12 @@ const OptionGroup = (props: OptionGroupProps) => {
71
71
 
72
72
  const OptionItem = (props: OptionItemProps) => {
73
73
  return (
74
- <TouchableOpacity onPress={() => props.onPress && props.onPress(props.value)}>
74
+ <TouchableOpacity
75
+ accessibilityLabel={"OptionItem"}
76
+ accessibilityHint={props.value}
77
+ accessibilityState={{checked: props.enable}}
78
+ onPress={() => props.onPress && props.onPress(props.value)}
79
+ >
75
80
  <View style={styles.itemRoot}>
76
81
  <View style={styles.itemTextGroup}>
77
82
  <Text style={styles.itemTitle}>{props.title}</Text>
@@ -57,6 +57,9 @@ const Segmented = (props: SegmentedProps) => {
57
57
  <View style={[styles.wrap_container, props.style]}>
58
58
  {props.options && props.options.map((item, idx) => (
59
59
  <TouchableOpacity
60
+ accessibilityLabel={"Segmented"}
61
+ accessibilityHint={item.value}
62
+ accessibilityState={{checked: item.value === props.value}}
60
63
  style={[
61
64
  styles.segmented_item,
62
65
  idx === 0 && styles.segmented_item_first,
@@ -13,6 +13,7 @@ interface SocketItemProps extends PropsWithChildren<ViewProps>{
13
13
  theme?: ThemeType
14
14
  title: string
15
15
  name: string
16
+ placeholder?: string
16
17
  icon?: any
17
18
  disabledEdit?: boolean
18
19
  onNameChange: (value: string) => void
@@ -65,12 +66,19 @@ function SocketItem(props: SocketItemProps) {
65
66
  onValueChange={props.onSwitchChange} />
66
67
  </View>
67
68
  <TouchableOpacity
69
+ accessibilityLabel={"Description"}
70
+ accessibilityHint={props.name}
68
71
  style={styles.nameLine}
69
72
  onPress={() => {
70
73
  if(props.disabledEdit) return
71
74
  Dialog.prompt({
72
75
  title: I18n.getLang('routines_add_edit_name'),
73
76
  value: props.name,
77
+ accessibilityLabel: "DialogInput",
78
+ accessibilityHint: props.name,
79
+ confirmAccessibilityLabel: "DialogConfirm",
80
+ cancelAccessibilityLabel: "DialogCancel",
81
+ placeholder: props.placeholder,
74
82
  cancelText: I18n.getLang('auto_scan_system_cancel'),
75
83
  confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
76
84
  inputWrapperStyle: {backgroundColor: props.theme?.textInput.background, borderRadius: cx(10)},
@@ -83,7 +91,7 @@ function SocketItem(props: SocketItemProps) {
83
91
  },
84
92
  })
85
93
  }}>
86
- <Text style={styles.name}>{props.name}</Text>
94
+ <Text style={styles.name}>{props.name || props.placeholder}</Text>
87
95
  </TouchableOpacity>
88
96
  <Spacer height={cx(16)} />
89
97
  {props.children}
@@ -111,12 +111,16 @@ const Stepper = (props: StepperProps) => {
111
111
  return (
112
112
  <View style={[styles.stepperContainer, props.style]}>
113
113
  <TouchableOpacity
114
+ accessibilityLabel={"StepperMinusButton"}
115
+ accessibilityHint={`${state.value}`}
114
116
  style={[styles.stepperButton, props.buttonStyle]}
115
117
  onPress={() => handlePress(false)}
116
118
  >
117
119
  <Image style={styles.stepperIcon} source={{uri: res.ic_minus}} />
118
120
  </TouchableOpacity>
119
121
  <TextInput
122
+ accessibilityLabel={"StepperInput"}
123
+ accessibilityHint={`${state.value}`}
120
124
  style={[styles.stepperInput, props.inputStyle]}
121
125
  value={state.value.toString()}
122
126
  keyboardType="numeric"
@@ -127,6 +131,8 @@ const Stepper = (props: StepperProps) => {
127
131
  editable={props.editable || props.disabled}
128
132
  />
129
133
  <TouchableOpacity
134
+ accessibilityLabel={"StepperPlusButton"}
135
+ accessibilityHint={`${state.value}`}
130
136
  style={[styles.stepperButton, props.buttonStyle]}
131
137
  onPress={() => handlePress(true)}
132
138
  >
@@ -6,6 +6,7 @@ import Spacer from "./Spacer";
6
6
  import { TabBar, Utils } from "tuya-panel-kit";
7
7
  import { ColorDisk } from "@tuya/tuya-panel-lamp-sdk";
8
8
  import res from "../res";
9
+ import ThemeType from "../config/themeType";
9
10
  const { convertX: cx } = Utils.RatioUtils
10
11
  const { withTheme } = Utils.ThemeUtils
11
12
 
@@ -14,6 +15,7 @@ type TabsNode = {
14
15
  title: string
15
16
  }
16
17
  interface StripAdjustViewProps extends ColorAdjustViewProps, ColorTempAdjustViewProps {
18
+ theme?: ThemeType
17
19
  lampTabs: TabsNode[]
18
20
  activeKey: number | string
19
21
  onActiveKeyChange: (key: number | string) => void
@@ -50,12 +50,16 @@ const Tag = (props: TagProps) => {
50
50
  props.onCheckedChange(!props.checked)
51
51
  }}>
52
52
  <View style={[styles.root, props.checked ? styles.checked : styles.uncheck, props.style]}>
53
- <Text style={[styles.text, {marginEnd: cx(props.checked ? 4 : 12)}]}>{props.text}</Text>
53
+ <Text
54
+ accessibilityLabel={"Tag"}
55
+ accessibilityHint={props.text}
56
+ accessibilityState={{checked: props.checked}}
57
+ style={[styles.text, {marginEnd: cx(props.checked ? 4 : 12)}]}
58
+ >
59
+ {props.text}
60
+ </Text>
54
61
  {
55
- props.checked &&
56
- <Image
57
- source={{uri: res.ic_arrows_nav_clear}}
58
- style={styles.icon}/>
62
+ props.checked ? <Image source={{uri: res.ic_arrows_nav_clear}} style={styles.icon}/> : <></>
59
63
  }
60
64
  </View>
61
65
  </TouchableOpacity>
@@ -14,6 +14,8 @@ interface TextButtonProps {
14
14
  export default function TextButton(props: TextButtonProps) {
15
15
  return (
16
16
  <TouchableOpacity
17
+ accessibilityLabel={"TextButton"}
18
+ accessibilityHint={props.text}
17
19
  style={[{
18
20
  justifyContent: 'center',
19
21
  alignItems: 'center',
@@ -29,4 +31,4 @@ export default function TextButton(props: TextButtonProps) {
29
31
  }, props.textStyle]}>{props.text}</Text>
30
32
  </TouchableOpacity>
31
33
  )
32
- }
34
+ }
@@ -70,14 +70,15 @@ const TextField = (props: TextFieldProps) => {
70
70
  <View style={props.style}>
71
71
  <Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
72
72
  <View style={styles.textInputGroup}>
73
- <TextInput{...props} style={styles.textInput} />
73
+ <TextInput {...props} accessibilityLabel={"TextInput"} accessibilityHint={props.value} style={styles.textInput} />
74
74
  {!!props.value && editable &&
75
75
  <TouchableOpacity
76
+ accessibilityLabel={"TextInputClearButton"}
76
77
  style={styles.iconTouchable}
77
78
  onPress={() => {
78
79
  props.onChangeText && props.onChangeText('')
79
80
  }}>
80
- <Image source={{ uri: res.ic_cancel }} style={styles.icon} />
81
+ <Image source={{uri: res.ic_cancel}} style={styles.icon}/>
81
82
  </TouchableOpacity>
82
83
  }
83
84
  <View style={styles.line} />
@@ -67,11 +67,11 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
67
67
  <View style={props.style}>
68
68
  <View style={styles.tipParent}>
69
69
  <Text style={styles.topTip}>{props.placeholder}</Text>
70
- {props.showTipIcon && <TouchableOpacity onPress={props.onTipIconPress}>
70
+ {props.showTipIcon && <TouchableOpacity accessibilityLabel={"TipIcon"} onPress={props.onTipIconPress}>
71
71
  <Image source={{uri: res.ic_info}} style={styles.tipIcon}/>
72
72
  </TouchableOpacity>}
73
73
  </View>
74
- <TouchableOpacity onPress={props.onPress}>
74
+ <TouchableOpacity accessibilityLabel={"TextFieldStyleButton"} accessibilityHint={props.text} onPress={props.onPress}>
75
75
  <View style={styles.textGroup}>
76
76
  <View style={styles.textParent}>
77
77
  <Text style={styles.text}>{props.text}</Text>
@@ -54,6 +54,9 @@ const UATabs = (props: UATabsProps) => {
54
54
  const active = props.active === item.value
55
55
 
56
56
  return <TouchableOpacity
57
+ accessibilityLabel={"UATabs"}
58
+ accessibilityHint={item.value}
59
+ accessibilityState={{checked: active}}
57
60
  key={index}
58
61
  style={{ flex: 1 }}
59
62
  onPress={() => {
@@ -7,6 +7,9 @@ export default function LdvColorBrightness(props) {
7
7
  const renderBrightness = () => {
8
8
  return (
9
9
  <LdvSlider
10
+ accessibilityLabel={"Brightness"}
11
+ accessibilityHint={`${value}`}
12
+ max={100}
10
13
  min={minBrightness}
11
14
  style={props.style}
12
15
  title={I18n.getLang('light_sources_tile_dim_lighting_brightness')}
@@ -16,4 +19,4 @@ export default function LdvColorBrightness(props) {
16
19
  )
17
20
  }
18
21
  return renderBrightness()
19
- }
22
+ }
@@ -96,10 +96,11 @@ const LdvColorSlider = (props: LdvColorSliderProps) => {
96
96
 
97
97
  return (
98
98
  <View style={[styles.container, props.style]}>
99
- <Text style={styles.title}>
99
+ <Text accessibilityLabel={"Color"} accessibilityHint={`${value}`} style={styles.title}>
100
100
  {title}
101
101
  </Text>
102
102
  <Slider.Horizontal
103
+ accessibilityLabel={"ColorSliderHorizontal"}
103
104
  style={{...styles.shadeSlider, width}}
104
105
  styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
105
106
  maximumValue={max}
@@ -55,6 +55,8 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
55
55
  <View key={props.theme?.type} style={[styles.pickerContainer, props.style]}>
56
56
  <View style={styles.picContainer}>
57
57
  <Picker
58
+ accessibilityLabel={"HourPicker"}
59
+ accessibilityHint={hour}
58
60
  itemTextColor='#aeadb5'
59
61
  style={[styles.picker, styles.pickerLeft]}
60
62
  loop={true}
@@ -76,6 +78,8 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
76
78
  </View>
77
79
  <View style={styles.picContainer}>
78
80
  <Picker
81
+ accessibilityLabel={"MinutePicker"}
82
+ accessibilityHint={minute}
79
83
  itemTextColor='#aeadb5'
80
84
  style={[styles.picker, styles.pickerLeft]}
81
85
  loop={true}
@@ -59,6 +59,8 @@ const LdvPresetView = (props) => {
59
59
  <View style={styles.container}>
60
60
  {dataSource.map((item, index) =>
61
61
  <TouchableOpacity
62
+ accessibilityLabel={"PresetNode"}
63
+ accessibilityHint={`${item.color}`}
62
64
  key={index}
63
65
  style={[styles.item, {backgroundColor: item.color}]}
64
66
  onPress={() => {
@@ -84,4 +86,4 @@ const styles = StyleSheet.create({
84
86
  },
85
87
  })
86
88
 
87
- export default LdvPresetView
89
+ export default LdvPresetView
@@ -8,6 +8,8 @@ const LdvSaturation = (props) => {
8
8
  const renderBrightness = () => {
9
9
  return (
10
10
  <LdvSlider
11
+ accessibilityLabel={"Saturation"}
12
+ accessibilityHint={`${value}`}
11
13
  style={props.style}
12
14
  title={I18n.getLang('light_sources_tile_rgb_lighting_saturation')}
13
15
  value={value}
@@ -20,4 +22,4 @@ const LdvSaturation = (props) => {
20
22
  return renderBrightness()
21
23
  }
22
24
 
23
- export default LdvSaturation
25
+ export default LdvSaturation
@@ -1,13 +1,13 @@
1
1
  import {useReactive} from 'ahooks'
2
2
  import React, {useEffect} from 'react'
3
- import {StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native'
3
+ import {AccessibilityProps, StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native'
4
4
  import {Slider, Utils} from 'tuya-panel-kit'
5
5
  import ThemeType from '../config/themeType'
6
6
 
7
7
  const cx = Utils.RatioUtils.convertX
8
8
  const { withTheme } = Utils.ThemeUtils
9
9
 
10
- interface LdvSliderProps {
10
+ interface LdvSliderProps extends AccessibilityProps{
11
11
  theme?: ThemeType
12
12
  title: string,
13
13
  value: number,
@@ -77,7 +77,11 @@ const LdvSlider = (props: LdvSliderProps) => {
77
77
 
78
78
  return (
79
79
  <View style={[styles.container, props.style]}>
80
- <View style={styles.titleBg}>
80
+ <View
81
+ accessibilityLabel={props.accessibilityLabel}
82
+ accessibilityHint={props.accessibilityHint}
83
+ style={styles.titleBg}
84
+ >
81
85
  <Text style={[styles.title, titleStyle]}>
82
86
  {props.title}
83
87
  </Text>
@@ -86,6 +90,7 @@ const LdvSlider = (props: LdvSliderProps) => {
86
90
  </Text>
87
91
  </View>
88
92
  <Slider.Horizontal
93
+ accessibilityLabel={"SliderHorizontal"}
89
94
  style={[styles.slider, sliderStyle]}
90
95
  styles={{thumb: styles.thumb}}
91
96
  maximumValue={mMax}
@@ -23,7 +23,7 @@ interface Prop {
23
23
  const LdvSwitch = (props: Prop) => {
24
24
  const {title, color, colorAlpha = 0, enable, description, titleStyle, setEnable, leftValue, rightValue, showSwitch = true} = props
25
25
  return (
26
- <View style={styles.titleBGView}>
26
+ <View accessibilityLabel={"LdvSwitch"} accessibilityHint={`${color}`} accessibilityState={{checked: enable}} style={styles.titleBGView}>
27
27
  <View style={{flexDirection: 'column', flex: 1}}>
28
28
  <View style={{flexDirection: 'row', alignItems: 'center'}}>
29
29
  <Text style={[styles.title, {color: props.theme?.global.fontColor}, titleStyle]}>{title}</Text>
@@ -33,7 +33,7 @@ const LdvSwitch = (props: Prop) => {
33
33
  </View>
34
34
  {showSwitch && <>
35
35
  {leftValue && <Text style={{color: props.theme?.global.fontColor, marginRight: cx(5)}}>{leftValue}</Text>}
36
- <SwitchButton value={enable} onValueChange={setEnable}/>
36
+ <SwitchButton accessibilityLabel={"SwitchButton"} value={enable} onValueChange={setEnable}/>
37
37
  {rightValue && <Text style={{color: props.theme?.global.fontColor, marginLeft: cx(5)}}>{rightValue}</Text>}
38
38
  </>
39
39
  }
@@ -24,6 +24,7 @@ interface LdvTemperatureSliderProps {
24
24
  style?: StyleProp<ViewStyle> | undefined
25
25
  titleStyle?: StyleProp<TextProps> | undefined
26
26
  subTitleStr?: string | undefined
27
+ accessibilityLabel?: string | undefined
27
28
  }
28
29
 
29
30
  const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
@@ -43,11 +44,12 @@ const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
43
44
  return (
44
45
  <View style={[styles.container, props.style]}>
45
46
  <View style={styles.titleBg}>
46
- <Text style={[styles.title, titleStyle]}>
47
+ <Text accessibilityLabel={"Temperature"} accessibilityHint={`${value}`} style={[styles.title, titleStyle]}>
47
48
  {title}
48
49
  </Text>
49
50
  </View>
50
51
  <Slider.Horizontal
52
+ accessibilityLabel={"TemperatureSliderHorizontal"}
51
53
  style={{...styles.shadeSlider, width}}
52
54
  styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
53
55
  maximumValue={max}
@@ -137,4 +139,4 @@ const styles = StyleSheet.create({
137
139
  },
138
140
  })
139
141
 
140
- export default LdvTemperatureSlider
142
+ export default LdvTemperatureSlider
@@ -29,7 +29,7 @@ const LDVTopBar = (props: TopBarProps) => {
29
29
  marginTop: Platform.OS === 'ios' ? Utils.RatioUtils.statusBarHeight : 0,
30
30
  justifyContent: 'space-between',
31
31
  }}>
32
- <TouchableOpacity onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
32
+ <TouchableOpacity accessibilityLabel={"GoBack"} onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
33
33
  <View
34
34
  style={{
35
35
  flexDirection: 'row',
@@ -52,6 +52,8 @@ const LDVTopBar = (props: TopBarProps) => {
52
52
  </TouchableOpacity>
53
53
  {!!props.rightButtonIcon &&
54
54
  <TouchableOpacity
55
+ accessibilityLabel={"RightButton"}
56
+ accessibilityState={{disabled: props.rightButtonDisabled}}
55
57
  style={{
56
58
  width: cx(44),
57
59
  height: cx(44),
@@ -54,6 +54,7 @@ const LdvTopName = (props: LdvTopNameProps) => {
54
54
  /> || null}
55
55
  </View>}
56
56
  {props.rightIcon && <TouchableOpacity
57
+ accessibilityLabel={"RightIcon"}
57
58
  onPress={props.rightIconClick}>
58
59
  <Image
59
60
  style={{ width: cx(24), height: cx(24), tintColor: props.theme?.global.brand }}
@@ -233,6 +233,8 @@ export default class ColourPicker extends Component<ColourProps, IState> {
233
233
  return (
234
234
  <View style={[{ flex: 1 }, style]}>
235
235
  <RectPicker
236
+ accessibilityLabel={"RectColorPicker"}
237
+ accessibilityHint={`${hue}, ${ Math.round(saturation / 10)}`}
236
238
  coorToValue={this.coorToValue}
237
239
  valueToColor={this.valueToColor}
238
240
  valueToCoor={this.valueToCoor}
@@ -82,6 +82,8 @@ interface IProps extends DefaultProps {
82
82
  valueToCoor: (value: any, originCoor?: Point, validBound?: ValidBound) => Point;
83
83
  valueToColor: (value: any) => string;
84
84
  initData: (validBound?: ValidBound) => void;
85
+ accessibilityLabel?: string;
86
+ accessibilityHint?: string;
85
87
  }
86
88
 
87
89
  interface IState {
@@ -377,10 +379,15 @@ export default class RectPicker extends Component<IProps, IState> {
377
379
  disabled,
378
380
  thumbSize,
379
381
  thumbImg,
382
+ accessibilityLabel,
383
+ accessibilityHint
380
384
  } = this.props;
381
385
  const { showPicker, pickerHeight, pickerWidth, thumbPosition } = this;
382
386
  return (
383
387
  <View
388
+ accessibilityLabel={accessibilityLabel}
389
+ accessibilityHint={accessibilityHint}
390
+ accessibilityRole={'adjustable'}
384
391
  style={[{ flex: 1 }, style]}
385
392
  {...this._panResponder.panHandlers}
386
393
  pointerEvents="box-only"
@@ -504,7 +504,9 @@ export default class Slider extends React.Component<IProps, IState> {
504
504
  return (
505
505
  <View
506
506
  style={containerStyle}
507
- accessibilityLabel="ReactColorPicker_Slider"
507
+ accessibilityLabel="ReactColorPickerSlider"
508
+ accessibilityHint={`${this.brightWidth}`}
509
+ accessibilityRole={'adjustable'}
508
510
  onLayout={this.handleLayout}
509
511
  pointerEvents="box-only"
510
512
  {...this._panResponder.panHandlers}
@@ -325,6 +325,8 @@ export default class WhitePicker extends Component<WhiteProps, IWhite> {
325
325
  ref={(ref: RectPicker) => {
326
326
  this.pickerRef = ref;
327
327
  }}
328
+ accessibilityLabel={"ReactWhitePicker"}
329
+ accessibilityHint={`${ Math.round(temperature / 10)}`}
328
330
  coorToValue={this.coorToValue}
329
331
  valueToColor={this.valueToColor}
330
332
  valueToCoor={this.valueToCoor}
@@ -17,8 +17,11 @@ const SegmentControl = (props) => {
17
17
  borderRadius: convertX(8.9),
18
18
  flexDirection: 'row',
19
19
  }, style]}>
20
- <TouchableOpacity style={
21
- [{
20
+ <TouchableOpacity
21
+ accessibilityLabel={"SegmentControl"}
22
+ accessibilityHint={title1}
23
+ accessibilityState={{checked: isFirst}}
24
+ style={[{
22
25
  flex: 1,
23
26
  justifyContent: 'center',
24
27
  alignItems: 'center',
@@ -26,8 +29,9 @@ const SegmentControl = (props) => {
26
29
  borderRadius: convertX(6.9),
27
30
  }, isFirst ?
28
31
  {backgroundColor: props.theme?.segment.active, margin: convertX(2), borderRadius: 6.9} :
29
- {backgroundColor: props.theme?.segment.background}, tabStyle]
30
- } onPress={() => setIsFirst(true)}>
32
+ {backgroundColor: props.theme?.segment.background}, tabStyle]}
33
+ onPress={() => setIsFirst(true)}
34
+ >
31
35
  <Text
32
36
  style={{
33
37
  color: props.theme?.segment.fontColor,
@@ -39,6 +43,9 @@ const SegmentControl = (props) => {
39
43
  </Text>
40
44
  </TouchableOpacity>
41
45
  <TouchableOpacity
46
+ accessibilityLabel={"SegmentControl"}
47
+ accessibilityHint={title2}
48
+ accessibilityState={{checked: !isFirst}}
42
49
  style={
43
50
  [{
44
51
  flex: 1,
@@ -64,6 +64,9 @@ const WeekSelect = (props) => {
64
64
  {dataSource.map(period => {
65
65
  return (
66
66
  <TouchableOpacity
67
+ accessibilityLabel={"WeekSelect"}
68
+ accessibilityHint={`${period.index}`}
69
+ accessibilityState={{checked: period.enabled}}
67
70
  key={period.index}
68
71
  onPress={() => {
69
72
  onSelect(period.index)
@@ -1 +0,0 @@
1
- export declare const ShowSelectView: (title: any, data: any, defaultValue: any, callback: any) => void;
@@ -1,159 +0,0 @@
1
- import React from 'react'
2
- import { View, Text, TouchableOpacity, Image } from 'react-native'
3
- import { Utils, Popup } from 'tuya-panel-kit'
4
- import res from '@res'
5
- import Strings from '@i18n'
6
-
7
- const { convertX, height } = Utils.RatioUtils
8
-
9
- export const ShowSelectView = (title, data, defaultValue, callback) => {
10
-
11
- const renderSelectView = () => {
12
- return (
13
- <View
14
- style={{
15
- height: height - convertX(120),
16
- backgroundColor: 'rgb(242, 242, 247)',
17
- flexDirection: 'column',
18
- }}
19
- >
20
- <View style={{ marginHorizontal: convertX(16), marginVertical: convertX(40),shadow: {
21
- shadowColor: '#000000',
22
- shadowOpacity: 0.2,
23
- shadowRadius: 8,
24
- elevation:8,
25
- shadowOffset: {
26
- width: 0,
27
- height: 4,
28
- },
29
- backgroundColor: '#fff',
30
- borderRadius: 8,
31
- }, }}>
32
- {
33
- data.map((item, index) => {
34
- if (index === 0) {
35
- return (
36
- <View key={item?.id}>
37
- {renderItemView(item, () => {
38
- Popup.close()
39
- callback(item)
40
- })}
41
- </View>
42
- )
43
- } else {
44
- return (
45
- <View key={item?.id}>
46
- {renderLineView()}
47
- {renderItemView(item, () => {
48
- Popup.close()
49
- callback(item)
50
- })}
51
- </View>
52
- )
53
- }
54
- })
55
- }
56
- </View>
57
- </View>
58
- )
59
- }
60
-
61
- const renderItemView = ({ title }, onPress) => {
62
- return (<TouchableOpacity
63
- style={{
64
- alignItems: 'center',
65
- justifyContent: 'space-between',
66
- // flex: 1,
67
- flexDirection: 'row',
68
- height: convertX(44),
69
- paddingHorizontal: convertX(12)
70
- }}
71
- onPress={() => { if (defaultValue !== title) onPress() }}
72
- >
73
- <View>
74
- <Text
75
- style={{
76
- fontSize: convertX(17),
77
- color: '#000',
78
- }}
79
- >
80
- {title}
81
- </Text>
82
- </View>
83
- {defaultValue === title &&
84
- <Image
85
- style={{ width: convertX(16), height: convertX(16) }}
86
- source={{ uri: res.app_music_check}}
87
- resizeMode="contain"
88
- />}
89
- </TouchableOpacity>)
90
- }
91
-
92
- const renderLineView = () => {
93
- return (<View
94
- style={{
95
- height: convertX(1),
96
- backgroundColor: 'rgba(60, 60, 67, 0.36)',
97
- marginLeft: convertX(12)
98
- }}
99
- ></View>)
100
- }
101
-
102
- const titleNode = () => {
103
- return (
104
- <View style={{ flexDirection: 'row', position: 'relative', height: convertX(81) }}>
105
- <TouchableOpacity
106
- style={{
107
- position: 'absolute',
108
- left: convertX(16),
109
- bottom: convertX(12),
110
- zIndex: 1
111
- }}
112
- onPress={() => Popup.close()}
113
- >
114
- <Text
115
- style={{
116
- fontSize: convertX(17),
117
- color: '#FF6600',
118
- }}
119
- >
120
- {Strings.getLang('auto_scan_system_cancel')}
121
- </Text>
122
- </TouchableOpacity>
123
- <View style={{ flexDirection: 'column-reverse', flex: 1, alignItems: 'center' }}>
124
- <Text style={{
125
- fontSize: convertX(17),
126
- fontWeight: 'bold',
127
- color: '#000000',
128
- paddingBottom: convertX(12)
129
- }}>{title}</Text>
130
- </View>
131
- </View>
132
- )
133
- }
134
-
135
- Popup.custom({
136
- content: renderSelectView(),
137
- title: titleNode(),
138
- titleTextStyle: {
139
- color: '#f60',
140
- fontWeight: 'bold',
141
- fontFamily: 'helvetica_neue_lt_std_bd',
142
- height: convertX(91),
143
- },
144
- footer: null,
145
- footerWrapperStyle: {
146
- display: 'none'
147
- },
148
- cancelText: '',
149
- confirmText: '',
150
- onMaskPress: ({ close }) => {
151
- close()
152
- },
153
- onConfirm: () => {
154
- Popup.close()
155
- },
156
- })
157
-
158
-
159
- }