secullum-react-native-ui 4.10.0 → 4.11.0

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.
@@ -5,6 +5,8 @@ export interface DetailsHeaderProperties {
5
5
  textStyle?: StyleProp<TextStyle>;
6
6
  onLeftPress?: () => void;
7
7
  onRightPress?: () => void;
8
+ leftNativeID?: string;
9
+ rightNativeID?: string;
8
10
  }
9
11
  export declare class DetailsHeader extends React.Component<DetailsHeaderProperties> {
10
12
  getStyles: () => {
@@ -34,6 +36,6 @@ export declare class DetailsHeader extends React.Component<DetailsHeaderProperti
34
36
  width: number;
35
37
  };
36
38
  };
37
- renderButton: (type: 'left' | 'right', onPress: (() => void) | undefined) => JSX.Element;
39
+ renderButton: (type: 'left' | 'right', onPress: (() => void) | undefined, nativeID?: string) => JSX.Element;
38
40
  render(): JSX.Element;
39
41
  }
@@ -7,6 +7,7 @@ const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
7
7
  const Card_1 = require("./Card");
8
8
  const theme_1 = require("../modules/theme");
9
9
  const layout_1 = require("../modules/layout");
10
+ const test_1 = require("../modules/test");
10
11
  class DetailsHeader extends React.Component {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -41,24 +42,24 @@ class DetailsHeader extends React.Component {
41
42
  });
42
43
  return styles;
43
44
  };
44
- this.renderButton = (type, onPress) => {
45
+ this.renderButton = (type, onPress, nativeID) => {
45
46
  const styles = this.getStyles();
46
47
  const theme = (0, theme_1.getTheme)();
47
48
  if (onPress) {
48
- return (React.createElement(react_native_1.TouchableOpacity, { style: styles.button, onPress: onPress },
49
- React.createElement(FontAwesome_1.default, { name: type === 'left' ? 'angle-left' : 'angle-right', color: theme.textColor3, size: 14 })));
49
+ return (React.createElement(react_native_1.TouchableOpacity, { testID: (0, test_1.getTestID)(nativeID), style: styles.button, onPress: onPress },
50
+ React.createElement(FontAwesome_1.default, { nativeID: nativeID, name: type === 'left' ? 'angle-left' : 'angle-right', color: theme.textColor3, size: 14 })));
50
51
  }
51
52
  return React.createElement(react_native_1.View, { style: styles.buttonPlaceholder });
52
53
  };
53
54
  }
54
55
  render() {
55
- const { text, textStyle, onLeftPress, onRightPress } = this.props;
56
+ const { text, textStyle, onLeftPress, onRightPress, leftNativeID, rightNativeID } = this.props;
56
57
  const styles = this.getStyles();
57
58
  return (React.createElement(Card_1.Card, null,
58
59
  React.createElement(Card_1.Card.Section, { style: styles.container },
59
- this.renderButton('left', onLeftPress),
60
+ this.renderButton('left', onLeftPress, leftNativeID),
60
61
  React.createElement(react_native_1.Text, { style: [styles.text, textStyle] }, text),
61
- this.renderButton('right', onRightPress))));
62
+ this.renderButton('right', onRightPress, rightNativeID))));
62
63
  }
63
64
  }
64
65
  exports.DetailsHeader = DetailsHeader;
@@ -4,6 +4,7 @@ export interface LinkProperties {
4
4
  text: string;
5
5
  style?: StyleProp<TextStyle>;
6
6
  onPress: () => void;
7
+ nativeID?: string;
7
8
  }
8
9
  export declare class Link extends React.Component<LinkProperties> {
9
10
  getStyles: () => {
@@ -4,6 +4,7 @@ exports.Link = void 0;
4
4
  const React = require("react");
5
5
  const theme_1 = require("../modules/theme");
6
6
  const react_native_1 = require("react-native");
7
+ const test_1 = require("../modules/test");
7
8
  class Link extends React.Component {
8
9
  constructor() {
9
10
  super(...arguments);
@@ -20,10 +21,10 @@ class Link extends React.Component {
20
21
  };
21
22
  }
22
23
  render() {
23
- const { text, style, onPress } = this.props;
24
+ const { text, style, onPress, nativeID } = this.props;
24
25
  const styles = this.getStyles();
25
- return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.7, onPress: onPress },
26
- React.createElement(react_native_1.Text, { style: [styles.link, style] }, text)));
26
+ return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.7, onPress: onPress, testID: (0, test_1.getTestID)(nativeID) },
27
+ React.createElement(react_native_1.Text, { nativeID: nativeID, style: [styles.link, style] }, text)));
27
28
  }
28
29
  }
29
30
  exports.Link = Link;
@@ -7,6 +7,7 @@ export interface RadioGroupProperties {
7
7
  value: string;
8
8
  onChange: (value: string) => void;
9
9
  disabled?: Array<string>;
10
+ nativeID?: string;
10
11
  }
11
12
  export declare class RadioGroup extends React.Component<RadioGroupProperties> {
12
13
  getStyles: () => {
@@ -5,6 +5,7 @@ const React = require("react");
5
5
  const react_native_1 = require("react-native");
6
6
  const theme_1 = require("../modules/theme");
7
7
  const layout_1 = require("../modules/layout");
8
+ const test_1 = require("../modules/test");
8
9
  class RadioGroup extends React.Component {
9
10
  constructor() {
10
11
  super(...arguments);
@@ -45,7 +46,7 @@ class RadioGroup extends React.Component {
45
46
  };
46
47
  }
47
48
  render() {
48
- const { items, value, onChange, disabled } = this.props;
49
+ const { items, value, onChange, disabled, nativeID } = this.props;
49
50
  const styles = this.getStyles();
50
51
  return (React.createElement(react_native_1.View, { style: styles.container }, items.map((item, index) => (React.createElement(react_native_1.TouchableWithoutFeedback, { key: index, disabled: disabled && disabled.includes(item.value), onPress: () => onChange(item.value) },
51
52
  React.createElement(react_native_1.View, { style: [
@@ -55,7 +56,7 @@ class RadioGroup extends React.Component {
55
56
  disabled && disabled.includes(item.value)
56
57
  ? styles.readonly
57
58
  : null
58
- ] },
59
+ ], testID: (0, test_1.getTestID)(nativeID + '-' + item.value), nativeID: nativeID + '-' + item.value },
59
60
  React.createElement(react_native_1.Text, { style: [
60
61
  styles.itemText,
61
62
  item.value === value ? styles.selectedItemText : null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secullum-react-native-ui",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [