@draftbit/core 46.4.4-8a6164.2 → 46.4.4-926784.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.
Files changed (38) hide show
  1. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -6
  2. package/lib/commonjs/components/Text.js +6 -2
  3. package/lib/commonjs/components/TextField.js +5 -1
  4. package/lib/commonjs/index.js +84 -0
  5. package/lib/commonjs/mappings/HtmlElements.js +125 -0
  6. package/lib/commonjs/mappings/TextField.js +1 -1
  7. package/lib/commonjs/mappings/TextInput.js +1 -1
  8. package/lib/module/components/CircularProgress.js +15 -7
  9. package/lib/module/components/DatePicker/DatePicker.js +1 -5
  10. package/lib/module/components/Justification.js +0 -1
  11. package/lib/module/components/Portal/PortalHost.js +26 -15
  12. package/lib/module/components/Text.js +38 -8
  13. package/lib/module/components/TextField.js +67 -31
  14. package/lib/module/index.js +1 -0
  15. package/lib/module/mappings/HtmlElements.js +116 -0
  16. package/lib/module/mappings/TextField.js +1 -1
  17. package/lib/module/mappings/TextInput.js +1 -1
  18. package/lib/typescript/src/components/Text.d.ts +2 -1
  19. package/lib/typescript/src/components/TextField.d.ts +2 -1
  20. package/lib/typescript/src/index.d.ts +1 -0
  21. package/lib/typescript/src/mappings/HtmlElements.d.ts +49 -0
  22. package/lib/typescript/src/mappings/TextField.d.ts +2 -2
  23. package/lib/typescript/src/mappings/TextInput.d.ts +1 -1
  24. package/package.json +4 -3
  25. package/src/components/DatePicker/DatePicker.js +0 -3
  26. package/src/components/DatePicker/DatePicker.tsx +0 -4
  27. package/src/components/Text.js +8 -2
  28. package/src/components/Text.tsx +6 -1
  29. package/src/components/TextField.js +6 -1
  30. package/src/components/TextField.tsx +7 -1
  31. package/src/index.js +1 -0
  32. package/src/index.tsx +2 -0
  33. package/src/mappings/HtmlElements.js +141 -0
  34. package/src/mappings/HtmlElements.ts +151 -0
  35. package/src/mappings/TextField.js +1 -1
  36. package/src/mappings/TextField.ts +1 -1
  37. package/src/mappings/TextInput.js +1 -1
  38. package/src/mappings/TextInput.ts +1 -1
@@ -1,7 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
5
1
  import * as React from "react";
6
2
  import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
7
3
  import { withTheme } from "../theming";
@@ -14,8 +10,8 @@ const ICON_SIZE = 24;
14
10
  class TextField extends React.Component {
15
11
  constructor() {
16
12
  super(...arguments);
17
-
18
- _defineProperty(this, "state", {
13
+ this.state = {
14
+ nativeProps: {},
19
15
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
20
16
  focused: false,
21
17
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -23,36 +19,35 @@ class TextField extends React.Component {
23
19
  measured: false,
24
20
  width: 0
25
21
  }
26
- });
27
-
28
- _defineProperty(this, "_timer", setTimeout(() => {}, 0));
22
+ };
23
+ this._timer = setTimeout(() => {}, 0);
29
24
 
30
- _defineProperty(this, "_showPlaceholder", () => {
25
+ this._showPlaceholder = () => {
31
26
  clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
32
27
  // If we show it immediately, they'll overlap and look ugly
33
28
 
34
29
  this._timer = setTimeout(() => this.setState({
35
30
  placeholder: this.props.placeholder
36
31
  }), 50);
37
- });
32
+ };
38
33
 
39
- _defineProperty(this, "_hidePlaceholder", () => this.setState({
34
+ this._hidePlaceholder = () => this.setState({
40
35
  placeholder: ""
41
- }));
36
+ });
42
37
 
43
- _defineProperty(this, "_restoreLabel", () => Animated.timing(this.state.labeled, {
38
+ this._restoreLabel = () => Animated.timing(this.state.labeled, {
44
39
  toValue: 1,
45
40
  duration: FOCUS_ANIMATION_DURATION,
46
41
  useNativeDriver: true
47
- }).start());
42
+ }).start();
48
43
 
49
- _defineProperty(this, "_minmizeLabel", () => Animated.timing(this.state.labeled, {
44
+ this._minmizeLabel = () => Animated.timing(this.state.labeled, {
50
45
  toValue: 0,
51
46
  duration: BLUR_ANIMATION_DURATION,
52
47
  useNativeDriver: true
53
- }).start());
48
+ }).start();
54
49
 
55
- _defineProperty(this, "_handleFocus", () => {
50
+ this._handleFocus = () => {
56
51
  if (this.props.disabled) {
57
52
  return;
58
53
  }
@@ -60,9 +55,9 @@ class TextField extends React.Component {
60
55
  this.setState({
61
56
  focused: true
62
57
  });
63
- });
58
+ };
64
59
 
65
- _defineProperty(this, "_handleBlur", () => {
60
+ this._handleBlur = () => {
66
61
  if (this.props.disabled) {
67
62
  return;
68
63
  }
@@ -70,9 +65,9 @@ class TextField extends React.Component {
70
65
  this.setState({
71
66
  focused: false
72
67
  });
73
- });
68
+ };
74
69
 
75
- _defineProperty(this, "_handleChangeText", value => {
70
+ this._handleChangeText = value => {
76
71
  if (this.props.disabled) {
77
72
  return;
78
73
  }
@@ -88,9 +83,9 @@ class TextField extends React.Component {
88
83
  });
89
84
  this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
90
85
  }
91
- });
86
+ };
92
87
 
93
- _defineProperty(this, "_root", undefined);
88
+ this._root = undefined;
94
89
  }
95
90
 
96
91
  static getDerivedStateFromProps(nextProps, prevState) {
@@ -141,12 +136,15 @@ class TextField extends React.Component {
141
136
  focused: !prevState.focused
142
137
  }));
143
138
  }
144
-
145
139
  /**
146
140
  * @internal
147
141
  */
142
+
143
+
148
144
  setNativeProps(args) {
149
- return this._root && this._root.setNativeProps(args);
145
+ this.setState(state => ({ ...state,
146
+ nativeState: args || {}
147
+ }));
150
148
  }
151
149
 
152
150
  isFocused() {
@@ -187,7 +185,8 @@ class TextField extends React.Component {
187
185
  roundness,
188
186
  disabledOpacity
189
187
  },
190
- render = props => /*#__PURE__*/React.createElement(NativeTextInput, props),
188
+ render = props => /*#__PURE__*/React.createElement(NativeTextInput, { ...props
189
+ }),
191
190
  ...rest
192
191
  } = this.props;
193
192
  const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
@@ -339,9 +338,9 @@ class TextField extends React.Component {
339
338
  } = StyleSheet.flatten(style || {});
340
339
  return /*#__PURE__*/React.createElement(View, {
341
340
  style: [styles.container, styleProp]
342
- }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
341
+ }, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
343
342
  style: leftIconStyle
344
- })) : null, /*#__PURE__*/React.createElement(View, {
343
+ }) : null, /*#__PURE__*/React.createElement(View, {
345
344
  style: applyStyles([containerStyle], {
346
345
  height: style === null || style === void 0 ? void 0 : style.height,
347
346
  backgroundColor: bgColor,
@@ -408,9 +407,9 @@ class TextField extends React.Component {
408
407
  style: {
409
408
  justifyContent: type === "solid" ? "center" : undefined
410
409
  }
411
- }, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
410
+ }, /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
412
411
  style: leftIconStyle
413
- }))) : null, render({
412
+ })) : null, render({
414
413
  ref: c => {
415
414
  this._root = c;
416
415
  },
@@ -426,6 +425,7 @@ class TextField extends React.Component {
426
425
  underlineColorAndroid: "transparent",
427
426
  style: inputStyles,
428
427
  ...rest,
428
+ ...this.state.nativeProps,
429
429
  value: this.state.value
430
430
  })), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
431
431
  name: rightIconName,
@@ -447,6 +447,42 @@ class TextField extends React.Component {
447
447
 
448
448
  }
449
449
 
450
+ export default withTheme(TextField);
451
+ const styles = StyleSheet.create({
452
+ container: {
453
+ alignSelf: "stretch"
454
+ },
455
+ placeholder: {
456
+ position: "absolute",
457
+ left: 0
458
+ },
459
+ underline: {
460
+ position: "absolute",
461
+ left: 0,
462
+ right: 0,
463
+ bottom: 0,
464
+ height: 2
465
+ },
466
+ input: {
467
+ flexGrow: 1,
468
+ justifyContent: "center",
469
+ textAlignVertical: "center",
470
+ margin: 0,
471
+ textAlign: I18nManager.isRTL ? "right" : "left"
472
+ }
473
+ }); "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
474
+ }
475
+ }) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
476
+ style: [{
477
+ color: error ? colors.error : colors.light,
478
+ marginTop: 8,
479
+ marginLeft: assistiveTextLeftMargin
480
+ }]
481
+ }, assistiveText) : null);
482
+ }
483
+
484
+ }
485
+
450
486
  export default withTheme(TextField);
451
487
  const styles = StyleSheet.create({
452
488
  container: {
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
34
+ export * from "@expo/html-elements";
34
35
  /* Deprecated: Fix or Delete! */
35
36
 
36
37
  export { default as CardBlock } from "./components/CardBlock";
@@ -0,0 +1,116 @@
1
+ import { COMPONENT_TYPES, createTextProp, FORM_TYPES, GROUPS, StylesPanelSections, Triggers } from "@draftbit/types";
2
+ const SEED_DATA_TRIGGERS = [Triggers.OnValueChange];
3
+ const ELEMENT_PROPS = {
4
+ category: COMPONENT_TYPES.element,
5
+ doc_link: "https://www.npmjs.com/package/@expo/html-elements",
6
+ code_link: "https://github.com/expo/expo/tree/master/packages/html-elements",
7
+ stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.LayoutSelectedItem, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Effects],
8
+ layout: {
9
+ margin: 0
10
+ },
11
+ triggers: SEED_DATA_TRIGGERS
12
+ };
13
+ const HEADING_PROPS = { ...ELEMENT_PROPS
14
+ };
15
+ export const SEED_DATA = [{
16
+ name: "H1",
17
+ tag: "H1",
18
+ ...HEADING_PROPS
19
+ }, {
20
+ name: "H2",
21
+ tag: "H2",
22
+ ...HEADING_PROPS
23
+ }, {
24
+ name: "H3",
25
+ tag: "H3",
26
+ ...HEADING_PROPS
27
+ }, {
28
+ name: "H4",
29
+ tag: "H4",
30
+ ...HEADING_PROPS
31
+ }, {
32
+ name: "H5",
33
+ tag: "H5",
34
+ ...HEADING_PROPS
35
+ }, {
36
+ name: "H6",
37
+ tag: "H6",
38
+ ...HEADING_PROPS
39
+ }, {
40
+ name: "Anchor",
41
+ tag: "A",
42
+ ...ELEMENT_PROPS,
43
+ props: {
44
+ href: createTextProp({
45
+ label: "href",
46
+ description: "Specify the URL",
47
+ defaultValue: ""
48
+ }),
49
+ target: {
50
+ group: GROUPS.basic,
51
+ label: "target",
52
+ description: "decide where link should open",
53
+ formType: FORM_TYPES.flatArray,
54
+ defaultValue: "_blank",
55
+ options: ["_blank", "_self", "_parent", "_top"]
56
+ }
57
+ }
58
+ }, {
59
+ name: "Paragraph",
60
+ tag: "P",
61
+ ...ELEMENT_PROPS,
62
+ props: {// NOTE - Keeping the props commented until we figure out a way to use this props from draftbit side.
63
+ // strong: createBoolProp({
64
+ // label: "Strong",
65
+ // description: "Strong",
66
+ // }),
67
+ // strike: createBoolProp({
68
+ // label: "Strike",
69
+ // description: "Strike through",
70
+ // }),
71
+ // italic: createBoolProp({
72
+ // label: "Italic",
73
+ // description: "Italic Fonts",
74
+ // }),
75
+ // bold: createBoolProp({
76
+ // label: "Bold",
77
+ // description: "Bold",
78
+ // }),
79
+ }
80
+ }, {
81
+ name: "Code",
82
+ tag: "Code",
83
+ ...ELEMENT_PROPS
84
+ }, {
85
+ name: "Pre",
86
+ tag: "Pre",
87
+ ...ELEMENT_PROPS
88
+ }, {
89
+ name: "Mark",
90
+ tag: "Mark",
91
+ ...ELEMENT_PROPS
92
+ }, {
93
+ name: "BR",
94
+ tag: "BR",
95
+ ...ELEMENT_PROPS
96
+ }, {
97
+ name: "BlockQuote",
98
+ tag: "BlockQuote",
99
+ ...ELEMENT_PROPS
100
+ }, {
101
+ name: "Time",
102
+ tag: "Time",
103
+ ...ELEMENT_PROPS
104
+ }, {
105
+ name: "UL",
106
+ tag: "UL",
107
+ ...ELEMENT_PROPS
108
+ }, {
109
+ name: "LI",
110
+ tag: "LI",
111
+ ...ELEMENT_PROPS
112
+ }, {
113
+ name: "HR",
114
+ tag: "HR",
115
+ ...ELEMENT_PROPS
116
+ }];
@@ -16,7 +16,7 @@ const SEED_DATA_PROPS = {
16
16
  description: "Can automatically capitalize sentences, words, and characters (Default: none).",
17
17
  editable: true,
18
18
  required: false,
19
- defaultValue: null,
19
+ defaultValue: "none",
20
20
  options: ["none", "sentences", "words", "characters"],
21
21
  formType: FORM_TYPES.flatArray,
22
22
  propType: PROP_TYPES.STRING
@@ -94,7 +94,7 @@ export const SEED_DATA = [{
94
94
  description: "Can automatically capitalize sentences, words, and characters (Default: none).",
95
95
  editable: true,
96
96
  required: false,
97
- defaultValue: null,
97
+ defaultValue: "none",
98
98
  options: ["none", "sentences", "words", "characters"],
99
99
  formType: FORM_TYPES.flatArray,
100
100
  propType: PROP_TYPES.STRING
@@ -6,7 +6,8 @@ declare type Props = {
6
6
  } & TextProps;
7
7
  declare class Text extends React.Component<Props> {
8
8
  _root: any;
9
- setNativeProps(args: TextProps): any;
9
+ state: any;
10
+ setNativeProps(args: TextProps): void;
10
11
  render(): JSX.Element;
11
12
  }
12
13
  export declare const BaseLink: ({ style, theme, title, ...props }: any) => JSX.Element;
@@ -27,6 +27,7 @@ export declare type Props = {
27
27
  }) => React.ReactNode;
28
28
  } & TextInputProps & IconSlot;
29
29
  interface State {
30
+ nativeProps: any;
30
31
  labeled: Animated.Value;
31
32
  focused?: boolean;
32
33
  placeholder?: string | undefined;
@@ -57,7 +58,7 @@ declare class TextField extends React.Component<Props, State> {
57
58
  /**
58
59
  * @internal
59
60
  */
60
- setNativeProps(args: Props): void | undefined;
61
+ setNativeProps(args: Props): void;
61
62
  isFocused(): boolean | undefined;
62
63
  clear(): void | undefined;
63
64
  focus(): void | undefined;
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
+ export * from "@expo/html-elements";
34
35
  export { default as CardBlock } from "./components/CardBlock";
35
36
  export { default as CardContainer } from "./components/CardContainer";
36
37
  export { default as CardContainerRating } from "./components/CardContainerRating";
@@ -0,0 +1,49 @@
1
+ export declare const SEED_DATA: ({
2
+ category: string;
3
+ doc_link: string;
4
+ code_link: string;
5
+ stylesPanelSections: string[];
6
+ layout: {
7
+ margin: number;
8
+ };
9
+ triggers: string[];
10
+ name: string;
11
+ tag: string;
12
+ } | {
13
+ props: {
14
+ href: any;
15
+ target: {
16
+ group: string;
17
+ label: string;
18
+ description: string;
19
+ formType: string;
20
+ defaultValue: string;
21
+ options: string[];
22
+ };
23
+ };
24
+ category: string;
25
+ doc_link: string;
26
+ code_link: string;
27
+ stylesPanelSections: string[];
28
+ layout: {
29
+ margin: number;
30
+ };
31
+ triggers: string[];
32
+ name: string;
33
+ tag: string;
34
+ } | {
35
+ props: {
36
+ href?: undefined;
37
+ target?: undefined;
38
+ };
39
+ category: string;
40
+ doc_link: string;
41
+ code_link: string;
42
+ stylesPanelSections: string[];
43
+ layout: {
44
+ margin: number;
45
+ };
46
+ triggers: string[];
47
+ name: string;
48
+ tag: string;
49
+ })[];
@@ -64,7 +64,7 @@ export declare const SEED_DATA: ({
64
64
  description: string;
65
65
  editable: boolean;
66
66
  required: boolean;
67
- defaultValue: null;
67
+ defaultValue: string;
68
68
  options: string[];
69
69
  formType: string;
70
70
  propType: string;
@@ -371,7 +371,7 @@ export declare const SEED_DATA: ({
371
371
  description: string;
372
372
  editable: boolean;
373
373
  required: boolean;
374
- defaultValue: null;
374
+ defaultValue: string;
375
375
  options: string[];
376
376
  formType: string;
377
377
  propType: string;
@@ -229,7 +229,7 @@ export declare const SEED_DATA: {
229
229
  description: string;
230
230
  editable: boolean;
231
231
  required: boolean;
232
- defaultValue: null;
232
+ defaultValue: string;
233
233
  options: string[];
234
234
  formType: string;
235
235
  propType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.4.4-8a6164.2+8a6164b",
3
+ "version": "46.4.4-926784.2+926784b",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,8 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.4.4-8a6164.2+8a6164b",
44
+ "@draftbit/types": "^46.4.4-926784.2+926784b",
45
+ "@expo/html-elements": "^0.2.0",
45
46
  "@material-ui/core": "^4.11.0",
46
47
  "@material-ui/pickers": "^3.2.10",
47
48
  "@react-native-community/slider": "4.2.3",
@@ -81,5 +82,5 @@
81
82
  ]
82
83
  ]
83
84
  },
84
- "gitHead": "8a6164bfd3a26b44bab4df0b80268c1c95dab090"
85
+ "gitHead": "926784bdbe341dc24314d214e2ae1a8c2f233a68"
85
86
  }
@@ -6,7 +6,6 @@ import { withTheme } from "../../theming";
6
6
  import Portal from "../Portal/Portal";
7
7
  import Touchable from "../Touchable";
8
8
  import DateTimePicker from "./DatePickerComponent";
9
- import { extractStyles } from "../../utilities";
10
9
  const AnimatedText = Animated.createAnimatedComponent(Text);
11
10
  const FOCUS_ANIMATION_DURATION = 150;
12
11
  const BLUR_ANIMATION_DURATION = 180;
@@ -242,12 +241,10 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
242
241
  },
243
242
  ],
244
243
  };
245
- const { textStyles } = extractStyles(style);
246
244
  const inputStyles = [
247
245
  styles.input,
248
246
  inputStyle,
249
247
  type === "solid" ? { marginHorizontal: 12 } : {},
250
- textStyles,
251
248
  ];
252
249
  // const render = (props) => <NativeTextInput {...props} />;
253
250
  return (React.createElement(View, { style: [styles.container, style] },
@@ -23,7 +23,6 @@ import DateTimePicker from "./DatePickerComponent";
23
23
 
24
24
  import type { Theme } from "../../styles/DefaultTheme";
25
25
  import type { IconSlot } from "../../interfaces/Icon";
26
- import { extractStyles } from "../../utilities";
27
26
 
28
27
  const AnimatedText = Animated.createAnimatedComponent(Text);
29
28
 
@@ -348,13 +347,10 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({
348
347
  ],
349
348
  };
350
349
 
351
- const { textStyles } = extractStyles(style);
352
-
353
350
  const inputStyles = [
354
351
  styles.input,
355
352
  inputStyle,
356
353
  type === "solid" ? { marginHorizontal: 12 } : {},
357
- textStyles,
358
354
  ];
359
355
 
360
356
  // const render = (props) => <NativeTextInput {...props} />;
@@ -2,13 +2,19 @@ import * as React from "react";
2
2
  import { Text as NativeText, I18nManager } from "react-native";
3
3
  import { withTheme } from "../theming";
4
4
  class Text extends React.Component {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.state = {
8
+ nativeProps: {},
9
+ };
10
+ }
5
11
  setNativeProps(args) {
6
- return this._root && this._root.setNativeProps(args);
12
+ this.state.nativeProps = args || {};
7
13
  }
8
14
  render() {
9
15
  const { style, ...rest } = this.props;
10
16
  const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
11
- return (React.createElement(NativeText, { ...rest, ref: (c) => {
17
+ return (React.createElement(NativeText, { ...rest, ...this.state.nativeProps, ref: (c) => {
12
18
  this._root = c;
13
19
  }, style: [
14
20
  {
@@ -10,8 +10,12 @@ type Props = {
10
10
  class Text extends React.Component<Props> {
11
11
  _root: any;
12
12
 
13
+ state: any = {
14
+ nativeProps: {},
15
+ };
16
+
13
17
  setNativeProps(args: TextProps) {
14
- return this._root && this._root.setNativeProps(args);
18
+ this.state.nativeProps = args || {};
15
19
  }
16
20
 
17
21
  render() {
@@ -21,6 +25,7 @@ class Text extends React.Component<Props> {
21
25
  return (
22
26
  <NativeText
23
27
  {...rest}
28
+ {...this.state.nativeProps}
24
29
  ref={(c) => {
25
30
  this._root = c;
26
31
  }}
@@ -10,6 +10,7 @@ class TextField extends React.Component {
10
10
  constructor() {
11
11
  super(...arguments);
12
12
  this.state = {
13
+ nativeProps: {},
13
14
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
14
15
  focused: false,
15
16
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -121,7 +122,10 @@ class TextField extends React.Component {
121
122
  * @internal
122
123
  */
123
124
  setNativeProps(args) {
124
- return this._root && this._root.setNativeProps(args);
125
+ this.setState((state) => ({
126
+ ...state,
127
+ nativeState: args || {},
128
+ }));
125
129
  }
126
130
  isFocused() {
127
131
  return this._root && this._root.isFocused();
@@ -381,6 +385,7 @@ class TextField extends React.Component {
381
385
  underlineColorAndroid: "transparent",
382
386
  style: inputStyles,
383
387
  ...rest,
388
+ ...this.state.nativeProps,
384
389
  value: this.state.value,
385
390
  })),
386
391
  rightIconName ? (React.createElement(Icon, { name: rightIconName, size: ICON_SIZE, color: colors.light, style: {
@@ -52,6 +52,7 @@ export type Props = {
52
52
  IconSlot;
53
53
 
54
54
  interface State {
55
+ nativeProps: any;
55
56
  labeled: Animated.Value;
56
57
  focused?: boolean;
57
58
  placeholder?: string | undefined;
@@ -73,6 +74,7 @@ class TextField extends React.Component<Props, State> {
73
74
  }
74
75
 
75
76
  state: State = {
77
+ nativeProps: {},
76
78
  labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
77
79
  focused: false,
78
80
  placeholder: this.props.error ? this.props.placeholder : "",
@@ -207,7 +209,10 @@ class TextField extends React.Component<Props, State> {
207
209
  * @internal
208
210
  */
209
211
  setNativeProps(args: Props) {
210
- return this._root && this._root.setNativeProps(args);
212
+ this.setState((state) => ({
213
+ ...state,
214
+ nativeState: args || {},
215
+ }));
211
216
  }
212
217
 
213
218
  isFocused() {
@@ -566,6 +571,7 @@ class TextField extends React.Component<Props, State> {
566
571
  underlineColorAndroid: "transparent",
567
572
  style: inputStyles,
568
573
  ...rest,
574
+ ...this.state.nativeProps,
569
575
  value: this.state.value,
570
576
  })}
571
577
  </View>
package/src/index.js CHANGED
@@ -31,6 +31,7 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
+ export * from "@expo/html-elements";
34
35
  /* Deprecated: Fix or Delete! */
35
36
  export { default as CardBlock } from "./components/CardBlock";
36
37
  export { default as CardContainer } from "./components/CardContainer";
package/src/index.tsx CHANGED
@@ -51,6 +51,8 @@ export {
51
51
  RadioButtonFieldGroup,
52
52
  } from "./components/RadioButton/index";
53
53
 
54
+ export * from "@expo/html-elements";
55
+
54
56
  /* Deprecated: Fix or Delete! */
55
57
  export { default as CardBlock } from "./components/CardBlock";
56
58
  export { default as CardContainer } from "./components/CardContainer";