@draftbit/core 46.4.4-885019.2 → 46.4.4-8e5cf2.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.
- package/lib/commonjs/components/Accordion/AccordionItem.js +5 -25
- package/lib/commonjs/components/Banner.js +4 -24
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/Picker/PickerComponent.android.js +5 -24
- package/lib/commonjs/components/Text.js +6 -2
- package/lib/commonjs/components/TextField.js +5 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/StarRating.js +2 -6
- package/lib/commonjs/mappings/Table.js +0 -1
- package/lib/commonjs/mappings/TextField.js +1 -1
- package/lib/commonjs/mappings/TextInput.js +1 -1
- package/lib/module/components/Text.js +6 -2
- package/lib/module/components/TextField.js +5 -1
- package/lib/module/mappings/Table.js +0 -1
- package/lib/module/mappings/TextField.js +1 -1
- package/lib/module/mappings/TextInput.js +1 -1
- package/lib/typescript/src/components/Text.d.ts +2 -1
- package/lib/typescript/src/components/TextField.d.ts +2 -1
- package/lib/typescript/src/mappings/Table.d.ts +0 -5
- package/lib/typescript/src/mappings/TextField.d.ts +2 -2
- package/lib/typescript/src/mappings/TextInput.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/Text.js +8 -2
- package/src/components/Text.tsx +6 -1
- package/src/components/TextField.js +6 -1
- package/src/components/TextField.tsx +7 -1
- package/src/mappings/Table.js +0 -1
- package/src/mappings/Table.ts +0 -1
- package/src/mappings/TextField.js +1 -1
- package/src/mappings/TextField.ts +1 -1
- package/src/mappings/TextInput.js +1 -1
- package/src/mappings/TextInput.ts +1 -1
|
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
24
26
|
const AccordionItem = _ref => {
|
|
25
27
|
let {
|
|
26
28
|
Icon,
|
|
@@ -35,10 +37,9 @@ const AccordionItem = _ref => {
|
|
|
35
37
|
textStyles,
|
|
36
38
|
viewStyles
|
|
37
39
|
} = (0, _utilities.extractStyles)(style);
|
|
38
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
-
style: [styles.container, viewStyles]
|
|
40
|
-
|
|
41
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
41
|
+
style: [styles.container, viewStyles]
|
|
42
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
43
|
style: styles.row
|
|
43
44
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
44
45
|
name: icon,
|
|
@@ -73,25 +74,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
73
74
|
|
|
74
75
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
75
76
|
|
|
76
|
-
exports.default = _default;StyleSheet.create({
|
|
77
|
-
container: {
|
|
78
|
-
padding: 8
|
|
79
|
-
},
|
|
80
|
-
row: {
|
|
81
|
-
flexDirection: "row",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
paddingLeft: 8
|
|
84
|
-
},
|
|
85
|
-
item: {
|
|
86
|
-
marginVertical: 6,
|
|
87
|
-
paddingLeft: 8
|
|
88
|
-
},
|
|
89
|
-
content: {
|
|
90
|
-
flex: 1,
|
|
91
|
-
justifyContent: "center"
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
96
|
-
|
|
97
77
|
exports.default = _default;
|
|
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
+
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); }
|
|
25
|
+
|
|
24
26
|
const ELEVATION = 1;
|
|
25
27
|
const DEFAULT_MAX_WIDTH = 960;
|
|
26
28
|
|
|
@@ -92,9 +94,9 @@ const Banner = _ref => {
|
|
|
92
94
|
|
|
93
95
|
const translateY = _reactNative.Animated.multiply(_reactNative.Animated.add(position, -1), layout.height);
|
|
94
96
|
|
|
95
|
-
return /*#__PURE__*/React.createElement(_Surface.default, {
|
|
97
|
+
return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, rest, {
|
|
96
98
|
style: [styles.container, (0, _shadow.default)(ELEVATION), style]
|
|
97
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
99
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
98
100
|
style: [styles.wrapper, contentStyle]
|
|
99
101
|
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
100
102
|
style: {
|
|
@@ -176,26 +178,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
176
178
|
|
|
177
179
|
var _default = (0, _theming.withTheme)(Banner);
|
|
178
180
|
|
|
179
|
-
exports.default = _default;ow",
|
|
180
|
-
justifyContent: "flex-start",
|
|
181
|
-
marginHorizontal: 8,
|
|
182
|
-
marginTop: 16,
|
|
183
|
-
marginBottom: 0
|
|
184
|
-
},
|
|
185
|
-
icon: {
|
|
186
|
-
margin: 8
|
|
187
|
-
},
|
|
188
|
-
message: {
|
|
189
|
-
flex: 1,
|
|
190
|
-
margin: 8
|
|
191
|
-
},
|
|
192
|
-
actions: {
|
|
193
|
-
flexDirection: "row",
|
|
194
|
-
justifyContent: "flex-end",
|
|
195
|
-
margin: 8
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
var _default = (0, _theming.withTheme)(Banner);
|
|
200
|
-
|
|
201
181
|
exports.default = _default;
|
|
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
|
+
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); }
|
|
29
|
+
|
|
28
30
|
const Button = _ref => {
|
|
29
31
|
let {
|
|
30
32
|
Icon,
|
|
@@ -126,7 +128,7 @@ const Button = _ref => {
|
|
|
126
128
|
alignSelf: "stretch",
|
|
127
129
|
...margins
|
|
128
130
|
}
|
|
129
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
131
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, _extends({}, rest, {
|
|
130
132
|
onPress: onPress,
|
|
131
133
|
accessibilityState: {
|
|
132
134
|
disabled
|
|
@@ -134,7 +136,7 @@ const Button = _ref => {
|
|
|
134
136
|
accessibilityRole: "button",
|
|
135
137
|
disabled: disabled || loading,
|
|
136
138
|
style: [styles.button, buttonStyle, innerStyles]
|
|
137
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
139
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
138
140
|
style: styles.content
|
|
139
141
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
140
142
|
style: iconStyle
|
|
@@ -169,24 +171,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
169
171
|
|
|
170
172
|
var _default = (0, _theming.withTheme)(Button);
|
|
171
173
|
|
|
172
|
-
exports.default = _default;));
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const styles = _reactNative.StyleSheet.create({
|
|
176
|
-
button: {
|
|
177
|
-
minWidth: 64,
|
|
178
|
-
borderStyle: "solid"
|
|
179
|
-
},
|
|
180
|
-
content: {
|
|
181
|
-
flexDirection: "row",
|
|
182
|
-
alignItems: "center",
|
|
183
|
-
justifyContent: "center"
|
|
184
|
-
},
|
|
185
|
-
icon: {
|
|
186
|
-
width: _Config.default.buttonIconSize
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var _default = (0, _theming.withTheme)(Button);
|
|
191
|
-
|
|
192
174
|
exports.default = _default;
|
|
@@ -27,7 +27,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
30
32
|
const Picker = _ref => {
|
|
33
|
+
var _options$find$label, _options$find;
|
|
34
|
+
|
|
31
35
|
let {
|
|
32
36
|
style,
|
|
33
37
|
options,
|
|
@@ -37,9 +41,6 @@ const Picker = _ref => {
|
|
|
37
41
|
onValueChange: onValueChangeOverride = () => {},
|
|
38
42
|
...props
|
|
39
43
|
} = _ref;
|
|
40
|
-
|
|
41
|
-
var _a, _b;
|
|
42
|
-
|
|
43
44
|
const {
|
|
44
45
|
viewStyles: {
|
|
45
46
|
borderRadius,
|
|
@@ -86,7 +87,7 @@ const Picker = _ref => {
|
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
89
|
-
const selectedLabel = selectedValue && ((
|
|
90
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
90
91
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
91
92
|
disabled: disabled,
|
|
92
93
|
onPress: toggleFocus,
|
|
@@ -110,26 +111,6 @@ const Picker = _ref => {
|
|
|
110
111
|
key: o.value
|
|
111
112
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
112
113
|
pointerEvents: "none"
|
|
113
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, { ...props,
|
|
114
|
-
value: selectedLabel,
|
|
115
|
-
placeholder: placeholder,
|
|
116
|
-
// @ts-ignore
|
|
117
|
-
ref: textField,
|
|
118
|
-
disabled: disabled,
|
|
119
|
-
// @ts-expect-error
|
|
120
|
-
style: stylesWithoutMargin
|
|
121
|
-
}))));
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const styles = _reactNative.StyleSheet.create({
|
|
125
|
-
container: {
|
|
126
|
-
alignSelf: "stretch"
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
131
|
-
|
|
132
|
-
exports.default = _default; pointerEvents: "none"
|
|
133
114
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
134
115
|
value: selectedLabel,
|
|
135
116
|
placeholder: placeholder // @ts-ignore
|
|
@@ -24,10 +24,14 @@ class Text extends React.Component {
|
|
|
24
24
|
super(...arguments);
|
|
25
25
|
|
|
26
26
|
_defineProperty(this, "_root", void 0);
|
|
27
|
+
|
|
28
|
+
_defineProperty(this, "state", {
|
|
29
|
+
nativeProps: {}
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
setNativeProps(args) {
|
|
30
|
-
|
|
34
|
+
this.state.nativeProps = args || {};
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
render() {
|
|
@@ -36,7 +40,7 @@ class Text extends React.Component {
|
|
|
36
40
|
...rest
|
|
37
41
|
} = this.props;
|
|
38
42
|
const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
|
|
39
|
-
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, {
|
|
43
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, this.state.nativeProps, {
|
|
40
44
|
ref: c => {
|
|
41
45
|
this._root = c;
|
|
42
46
|
},
|
|
@@ -32,6 +32,7 @@ class TextField extends React.Component {
|
|
|
32
32
|
super(...arguments);
|
|
33
33
|
|
|
34
34
|
_defineProperty(this, "state", {
|
|
35
|
+
nativeProps: {},
|
|
35
36
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
36
37
|
focused: false,
|
|
37
38
|
placeholder: this.props.error ? this.props.placeholder : "",
|
|
@@ -162,7 +163,9 @@ class TextField extends React.Component {
|
|
|
162
163
|
* @internal
|
|
163
164
|
*/
|
|
164
165
|
setNativeProps(args) {
|
|
165
|
-
|
|
166
|
+
this.setState(state => ({ ...state,
|
|
167
|
+
nativeState: args || {}
|
|
168
|
+
}));
|
|
166
169
|
}
|
|
167
170
|
|
|
168
171
|
isFocused() {
|
|
@@ -444,6 +447,7 @@ class TextField extends React.Component {
|
|
|
444
447
|
underlineColorAndroid: "transparent",
|
|
445
448
|
style: inputStyles,
|
|
446
449
|
...rest,
|
|
450
|
+
...this.state.nativeProps,
|
|
447
451
|
value: this.state.value
|
|
448
452
|
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
449
453
|
name: rightIconName,
|
|
@@ -16,4 +16,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
16
16
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
19
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
@@ -25,7 +25,9 @@ const SEED_DATA = {
|
|
|
25
25
|
}),
|
|
26
26
|
fieldName: (0, _types.createFieldNameProp)({
|
|
27
27
|
defaultValue: "ratingValue",
|
|
28
|
+
// this is the name of the variable declared on the screen in Draftbit
|
|
28
29
|
handlerPropName: "onPress",
|
|
30
|
+
// the change handler prop in this component
|
|
29
31
|
valuePropName: "rating" // the value prop in this component
|
|
30
32
|
|
|
31
33
|
}),
|
|
@@ -50,10 +52,4 @@ const SEED_DATA = {
|
|
|
50
52
|
})
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
|
-
exports.SEED_DATA = SEED_DATA;pes.createColorProp)({
|
|
54
|
-
label: "Inactive Color",
|
|
55
|
-
defaultValue: "divider"
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
55
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -71,7 +71,6 @@ const SEED_DATA = [{
|
|
|
71
71
|
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Borders, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
72
72
|
layout: {
|
|
73
73
|
fontSize: 14,
|
|
74
|
-
fontWeight: "500",
|
|
75
74
|
paddingTop: 16,
|
|
76
75
|
paddingBottom: 16,
|
|
77
76
|
paddingLeft: 8,
|
|
@@ -24,7 +24,7 @@ const SEED_DATA_PROPS = {
|
|
|
24
24
|
description: "Can automatically capitalize sentences, words, and characters (Default: none).",
|
|
25
25
|
editable: true,
|
|
26
26
|
required: false,
|
|
27
|
-
defaultValue:
|
|
27
|
+
defaultValue: "none",
|
|
28
28
|
options: ["none", "sentences", "words", "characters"],
|
|
29
29
|
formType: _types.FORM_TYPES.flatArray,
|
|
30
30
|
propType: _types.PROP_TYPES.STRING
|
|
@@ -103,7 +103,7 @@ const SEED_DATA = [{
|
|
|
103
103
|
description: "Can automatically capitalize sentences, words, and characters (Default: none).",
|
|
104
104
|
editable: true,
|
|
105
105
|
required: false,
|
|
106
|
-
defaultValue:
|
|
106
|
+
defaultValue: "none",
|
|
107
107
|
options: ["none", "sentences", "words", "characters"],
|
|
108
108
|
formType: _types.FORM_TYPES.flatArray,
|
|
109
109
|
propType: _types.PROP_TYPES.STRING
|
|
@@ -11,10 +11,14 @@ class Text extends React.Component {
|
|
|
11
11
|
super(...arguments);
|
|
12
12
|
|
|
13
13
|
_defineProperty(this, "_root", void 0);
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "state", {
|
|
16
|
+
nativeProps: {}
|
|
17
|
+
});
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
setNativeProps(args) {
|
|
17
|
-
|
|
21
|
+
this.state.nativeProps = args || {};
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
render() {
|
|
@@ -23,7 +27,7 @@ class Text extends React.Component {
|
|
|
23
27
|
...rest
|
|
24
28
|
} = this.props;
|
|
25
29
|
const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
|
|
26
|
-
return /*#__PURE__*/React.createElement(NativeText, _extends({}, rest, {
|
|
30
|
+
return /*#__PURE__*/React.createElement(NativeText, _extends({}, rest, this.state.nativeProps, {
|
|
27
31
|
ref: c => {
|
|
28
32
|
this._root = c;
|
|
29
33
|
},
|
|
@@ -16,6 +16,7 @@ class TextField extends React.Component {
|
|
|
16
16
|
super(...arguments);
|
|
17
17
|
|
|
18
18
|
_defineProperty(this, "state", {
|
|
19
|
+
nativeProps: {},
|
|
19
20
|
labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
20
21
|
focused: false,
|
|
21
22
|
placeholder: this.props.error ? this.props.placeholder : "",
|
|
@@ -146,7 +147,9 @@ class TextField extends React.Component {
|
|
|
146
147
|
* @internal
|
|
147
148
|
*/
|
|
148
149
|
setNativeProps(args) {
|
|
149
|
-
|
|
150
|
+
this.setState(state => ({ ...state,
|
|
151
|
+
nativeState: args || {}
|
|
152
|
+
}));
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
isFocused() {
|
|
@@ -426,6 +429,7 @@ class TextField extends React.Component {
|
|
|
426
429
|
underlineColorAndroid: "transparent",
|
|
427
430
|
style: inputStyles,
|
|
428
431
|
...rest,
|
|
432
|
+
...this.state.nativeProps,
|
|
429
433
|
value: this.state.value
|
|
430
434
|
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
431
435
|
name: rightIconName,
|
|
@@ -63,7 +63,6 @@ export const SEED_DATA = [{
|
|
|
63
63
|
stylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Borders, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
64
64
|
layout: {
|
|
65
65
|
fontSize: 14,
|
|
66
|
-
fontWeight: "500",
|
|
67
66
|
paddingTop: 16,
|
|
68
67
|
paddingBottom: 16,
|
|
69
68
|
paddingLeft: 8,
|
|
@@ -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:
|
|
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:
|
|
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
|
-
|
|
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
|
|
61
|
+
setNativeProps(args: Props): void;
|
|
61
62
|
isFocused(): boolean | undefined;
|
|
62
63
|
clear(): void | undefined;
|
|
63
64
|
focus(): void | undefined;
|
|
@@ -13,7 +13,6 @@ export declare const SEED_DATA: ({
|
|
|
13
13
|
paddingBottom?: undefined;
|
|
14
14
|
backgroundColor?: undefined;
|
|
15
15
|
fontSize?: undefined;
|
|
16
|
-
fontWeight?: undefined;
|
|
17
16
|
};
|
|
18
17
|
props: {
|
|
19
18
|
numeric?: undefined;
|
|
@@ -36,7 +35,6 @@ export declare const SEED_DATA: ({
|
|
|
36
35
|
paddingBottom?: undefined;
|
|
37
36
|
backgroundColor?: undefined;
|
|
38
37
|
fontSize?: undefined;
|
|
39
|
-
fontWeight?: undefined;
|
|
40
38
|
};
|
|
41
39
|
props: {
|
|
42
40
|
numeric?: undefined;
|
|
@@ -58,7 +56,6 @@ export declare const SEED_DATA: ({
|
|
|
58
56
|
borderStyle?: undefined;
|
|
59
57
|
backgroundColor?: undefined;
|
|
60
58
|
fontSize?: undefined;
|
|
61
|
-
fontWeight?: undefined;
|
|
62
59
|
};
|
|
63
60
|
stylesPanelSections: string[];
|
|
64
61
|
props: {
|
|
@@ -91,7 +88,6 @@ export declare const SEED_DATA: ({
|
|
|
91
88
|
paddingTop?: undefined;
|
|
92
89
|
paddingBottom?: undefined;
|
|
93
90
|
fontSize?: undefined;
|
|
94
|
-
fontWeight?: undefined;
|
|
95
91
|
};
|
|
96
92
|
props: {
|
|
97
93
|
numeric?: undefined;
|
|
@@ -106,7 +102,6 @@ export declare const SEED_DATA: ({
|
|
|
106
102
|
stylesPanelSections: string[];
|
|
107
103
|
layout: {
|
|
108
104
|
fontSize: number;
|
|
109
|
-
fontWeight: string;
|
|
110
105
|
paddingTop: number;
|
|
111
106
|
paddingBottom: number;
|
|
112
107
|
paddingLeft: number;
|
|
@@ -64,7 +64,7 @@ export declare const SEED_DATA: ({
|
|
|
64
64
|
description: string;
|
|
65
65
|
editable: boolean;
|
|
66
66
|
required: boolean;
|
|
67
|
-
defaultValue:
|
|
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:
|
|
374
|
+
defaultValue: string;
|
|
375
375
|
options: string[];
|
|
376
376
|
formType: string;
|
|
377
377
|
propType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.4.4-
|
|
3
|
+
"version": "46.4.4-8e5cf2.2+8e5cf29",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
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-
|
|
44
|
+
"@draftbit/types": "^46.4.4-8e5cf2.2+8e5cf29",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
]
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "8e5cf29f14b735059ccd00fe971e5f2c389e1500"
|
|
85
85
|
}
|
package/src/components/Text.js
CHANGED
|
@@ -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
|
-
|
|
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
|
{
|
package/src/components/Text.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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/mappings/Table.js
CHANGED
package/src/mappings/Table.ts
CHANGED
|
@@ -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:
|
|
19
|
+
defaultValue: "none",
|
|
20
20
|
options: ["none", "sentences", "words", "characters"],
|
|
21
21
|
formType: FORM_TYPES.flatArray,
|
|
22
22
|
propType: PROP_TYPES.STRING,
|
|
@@ -30,7 +30,7 @@ const SEED_DATA_PROPS = {
|
|
|
30
30
|
"Can automatically capitalize sentences, words, and characters (Default: none).",
|
|
31
31
|
editable: true,
|
|
32
32
|
required: false,
|
|
33
|
-
defaultValue:
|
|
33
|
+
defaultValue: "none",
|
|
34
34
|
options: ["none", "sentences", "words", "characters"],
|
|
35
35
|
formType: FORM_TYPES.flatArray,
|
|
36
36
|
propType: PROP_TYPES.STRING,
|
|
@@ -104,7 +104,7 @@ export const SEED_DATA = [
|
|
|
104
104
|
description: "Can automatically capitalize sentences, words, and characters (Default: none).",
|
|
105
105
|
editable: true,
|
|
106
106
|
required: false,
|
|
107
|
-
defaultValue:
|
|
107
|
+
defaultValue: "none",
|
|
108
108
|
options: ["none", "sentences", "words", "characters"],
|
|
109
109
|
formType: FORM_TYPES.flatArray,
|
|
110
110
|
propType: PROP_TYPES.STRING,
|
|
@@ -121,7 +121,7 @@ export const SEED_DATA = [
|
|
|
121
121
|
"Can automatically capitalize sentences, words, and characters (Default: none).",
|
|
122
122
|
editable: true,
|
|
123
123
|
required: false,
|
|
124
|
-
defaultValue:
|
|
124
|
+
defaultValue: "none",
|
|
125
125
|
options: ["none", "sentences", "words", "characters"],
|
|
126
126
|
formType: FORM_TYPES.flatArray,
|
|
127
127
|
propType: PROP_TYPES.STRING,
|