@draftbit/core 46.2.4-0e692a.5 → 46.2.4-1a04f8.6
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/Button.js +32 -11
- package/lib/commonjs/components/CircleImage.js +16 -2
- package/lib/commonjs/components/DeprecatedCardWrapper.js +17 -2
- package/lib/commonjs/components/Portal/PortalHost.js +27 -15
- package/lib/commonjs/components/{Svg.js → SVG.js} +2 -2
- package/lib/commonjs/components/TextField.js +63 -30
- package/lib/commonjs/components/Touchable.js +16 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +7 -7
- package/lib/commonjs/mappings/{Svg.js → SVG.js} +1 -1
- package/lib/module/components/{Svg.js → SVG.js} +2 -2
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/{Svg.js → SVG.js} +2 -2
- package/lib/typescript/src/components/SVG.d.ts +8 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/mappings/{Svg.d.ts → SVG.d.ts} +0 -0
- package/package.json +4 -4
- package/src/components/{Svg.js → SVG.js} +2 -2
- package/src/components/{Svg.tsx → SVG.tsx} +5 -5
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/{Svg.js → SVG.js} +2 -2
- package/src/mappings/{Svg.ts → SVG.ts} +2 -2
- package/lib/typescript/src/components/Svg.d.ts +0 -7
|
@@ -15,8 +15,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
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); }
|
|
19
|
-
|
|
20
18
|
const CONSTANTS = {
|
|
21
19
|
baseHeight: 42,
|
|
22
20
|
borderRadius: 4,
|
|
@@ -73,7 +71,7 @@ function Base(_ref) {
|
|
|
73
71
|
buttonStyles.justifyContent = "flex-end";
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
74
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
77
75
|
onPress: onPress,
|
|
78
76
|
disabled: disabled || loading,
|
|
79
77
|
style: _ref2 => {
|
|
@@ -83,8 +81,9 @@ function Base(_ref) {
|
|
|
83
81
|
return [styles.base, {
|
|
84
82
|
opacity: pressed || disabled ? 0.75 : 1
|
|
85
83
|
}, buttonStyles];
|
|
86
|
-
}
|
|
87
|
-
|
|
84
|
+
},
|
|
85
|
+
...props
|
|
86
|
+
}, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
88
87
|
size: "small",
|
|
89
88
|
color: color,
|
|
90
89
|
style: styles.loading
|
|
@@ -104,13 +103,14 @@ const Solid = _ref3 => {
|
|
|
104
103
|
theme,
|
|
105
104
|
...props
|
|
106
105
|
} = _ref3;
|
|
107
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
106
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
108
107
|
style: [{
|
|
109
108
|
color: "#FFF",
|
|
110
109
|
borderRadius: theme.roundness,
|
|
111
110
|
backgroundColor: theme.colors.primary
|
|
112
|
-
}, style]
|
|
113
|
-
|
|
111
|
+
}, style],
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
const ButtonSolid = (0, _theming.withTheme)(Solid);
|
|
@@ -122,13 +122,14 @@ const Outline = _ref4 => {
|
|
|
122
122
|
theme,
|
|
123
123
|
...props
|
|
124
124
|
} = _ref4;
|
|
125
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
125
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
126
126
|
style: [styles.outline, {
|
|
127
127
|
borderRadius: theme.roundness,
|
|
128
128
|
borderColor: theme.colors.primary,
|
|
129
129
|
color: theme.colors.primary
|
|
130
|
-
}, style]
|
|
131
|
-
|
|
130
|
+
}, style],
|
|
131
|
+
...props
|
|
132
|
+
});
|
|
132
133
|
};
|
|
133
134
|
|
|
134
135
|
const ButtonOutline = (0, _theming.withTheme)(Outline);
|
|
@@ -176,4 +177,24 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
176
177
|
}
|
|
177
178
|
})
|
|
178
179
|
}
|
|
180
|
+
});nsparent",
|
|
181
|
+
padding: 0,
|
|
182
|
+
minHeight: undefined
|
|
183
|
+
},
|
|
184
|
+
loading: {
|
|
185
|
+
marginRight: 6
|
|
186
|
+
},
|
|
187
|
+
icon: { ..._reactNative.Platform.select({
|
|
188
|
+
web: {
|
|
189
|
+
marginTop: 1,
|
|
190
|
+
marginRight: 4,
|
|
191
|
+
alignSelf: "center"
|
|
192
|
+
},
|
|
193
|
+
default: {
|
|
194
|
+
marginBottom: 2,
|
|
195
|
+
marginRight: 4,
|
|
196
|
+
alignSelf: "center"
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
}
|
|
179
200
|
});
|
|
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
20
|
const CircleImage = _ref => {
|
|
23
21
|
let {
|
|
24
22
|
source = _Config.default.placeholderImageURL,
|
|
@@ -27,6 +25,22 @@ const CircleImage = _ref => {
|
|
|
27
25
|
...props
|
|
28
26
|
} = _ref;
|
|
29
27
|
const borderRadius = size / 2;
|
|
28
|
+
return /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
29
|
+
style: [{
|
|
30
|
+
width: size,
|
|
31
|
+
height: size,
|
|
32
|
+
borderRadius
|
|
33
|
+
}, style],
|
|
34
|
+
source: typeof source === "string" ? {
|
|
35
|
+
uri: source
|
|
36
|
+
} : source,
|
|
37
|
+
resizeMode: "cover",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = CircleImage;
|
|
43
|
+
exports.default = _default;size / 2;
|
|
30
44
|
return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
|
|
31
45
|
style: [{
|
|
32
46
|
width: size,
|
|
@@ -13,8 +13,6 @@ var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
16
|
const getWidth = numColumns => {
|
|
19
17
|
switch (numColumns) {
|
|
20
18
|
case 1:
|
|
@@ -37,6 +35,23 @@ const Card = _ref => {
|
|
|
37
35
|
...rest
|
|
38
36
|
} = _ref;
|
|
39
37
|
const width = getWidth(numColumns);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
|
|
39
|
+
disabled: !onPress,
|
|
40
|
+
onPress: onPress,
|
|
41
|
+
style: [style, {
|
|
42
|
+
width
|
|
43
|
+
}],
|
|
44
|
+
...rest
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _default = (0, _theming.withTheme)(Card);
|
|
49
|
+
|
|
50
|
+
exports.default = _default;,
|
|
51
|
+
style,
|
|
52
|
+
...rest
|
|
53
|
+
} = _ref;
|
|
54
|
+
const width = getWidth(numColumns);
|
|
40
55
|
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
41
56
|
disabled: !onPress,
|
|
42
57
|
onPress: onPress,
|
|
@@ -17,8 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
20
|
const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
23
21
|
/**
|
|
24
22
|
* Portal host renders all of its children `Portal` elements.
|
|
@@ -51,11 +49,11 @@ class PortalHost extends React.Component {
|
|
|
51
49
|
constructor() {
|
|
52
50
|
super(...arguments);
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
this.setManager = manager => {
|
|
55
53
|
this.manager = manager;
|
|
56
|
-
}
|
|
54
|
+
};
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
this.mount = children => {
|
|
59
57
|
const key = this.nextKey++;
|
|
60
58
|
|
|
61
59
|
if (this.manager) {
|
|
@@ -69,9 +67,9 @@ class PortalHost extends React.Component {
|
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
return key;
|
|
72
|
-
}
|
|
70
|
+
};
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
this.update = (key, children) => {
|
|
75
73
|
if (this.manager) {
|
|
76
74
|
this.manager.update(key, children);
|
|
77
75
|
} else {
|
|
@@ -89,9 +87,9 @@ class PortalHost extends React.Component {
|
|
|
89
87
|
this.queue.push(op);
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
|
-
}
|
|
90
|
+
};
|
|
93
91
|
|
|
94
|
-
|
|
92
|
+
this.unmount = key => {
|
|
95
93
|
if (this.manager) {
|
|
96
94
|
this.manager.unmount(key);
|
|
97
95
|
} else {
|
|
@@ -100,13 +98,10 @@ class PortalHost extends React.Component {
|
|
|
100
98
|
key
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
_defineProperty(this, "nextKey", 0);
|
|
106
|
-
|
|
107
|
-
_defineProperty(this, "queue", []);
|
|
101
|
+
};
|
|
108
102
|
|
|
109
|
-
|
|
103
|
+
this.nextKey = 0;
|
|
104
|
+
this.queue = [];
|
|
110
105
|
}
|
|
111
106
|
|
|
112
107
|
componentDidMount() {
|
|
@@ -152,6 +147,23 @@ class PortalHost extends React.Component {
|
|
|
152
147
|
|
|
153
148
|
}
|
|
154
149
|
|
|
150
|
+
exports.default = PortalHost;
|
|
151
|
+
PortalHost.displayName = "Portal.Host";
|
|
152
|
+
|
|
153
|
+
const styles = _reactNative.StyleSheet.create({
|
|
154
|
+
container: {
|
|
155
|
+
flex: 1
|
|
156
|
+
}
|
|
157
|
+
}); style: styles.container,
|
|
158
|
+
collapsable: false,
|
|
159
|
+
pointerEvents: "box-none"
|
|
160
|
+
}, this.props.children), /*#__PURE__*/React.createElement(_PortalManager.default, {
|
|
161
|
+
ref: this.setManager
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
155
167
|
exports.default = PortalHost;
|
|
156
168
|
|
|
157
169
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const SVG = _ref => {
|
|
23
23
|
let {
|
|
24
24
|
source = _Config.default.placeholderSvgURL,
|
|
25
25
|
style
|
|
@@ -44,5 +44,5 @@ const Svg = _ref => {
|
|
|
44
44
|
}));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
var _default =
|
|
47
|
+
var _default = SVG;
|
|
48
48
|
exports.default = _default;
|
|
@@ -17,10 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
20
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
25
21
|
|
|
26
22
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
@@ -30,8 +26,7 @@ const ICON_SIZE = 24;
|
|
|
30
26
|
class TextField extends React.Component {
|
|
31
27
|
constructor() {
|
|
32
28
|
super(...arguments);
|
|
33
|
-
|
|
34
|
-
_defineProperty(this, "state", {
|
|
29
|
+
this.state = {
|
|
35
30
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
36
31
|
focused: false,
|
|
37
32
|
placeholder: this.props.error ? this.props.placeholder : "",
|
|
@@ -39,36 +34,35 @@ class TextField extends React.Component {
|
|
|
39
34
|
measured: false,
|
|
40
35
|
width: 0
|
|
41
36
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
_defineProperty(this, "_timer", setTimeout(() => {}, 0));
|
|
37
|
+
};
|
|
38
|
+
this._timer = setTimeout(() => {}, 0);
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
this._showPlaceholder = () => {
|
|
47
41
|
clearTimeout(this._timer); // Set the placeholder in a delay to offset the label animation
|
|
48
42
|
// If we show it immediately, they'll overlap and look ugly
|
|
49
43
|
|
|
50
44
|
this._timer = setTimeout(() => this.setState({
|
|
51
45
|
placeholder: this.props.placeholder
|
|
52
46
|
}), 50);
|
|
53
|
-
}
|
|
47
|
+
};
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
this._hidePlaceholder = () => this.setState({
|
|
56
50
|
placeholder: ""
|
|
57
|
-
})
|
|
51
|
+
});
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
60
54
|
toValue: 1,
|
|
61
55
|
duration: FOCUS_ANIMATION_DURATION,
|
|
62
56
|
useNativeDriver: true
|
|
63
|
-
}).start()
|
|
57
|
+
}).start();
|
|
64
58
|
|
|
65
|
-
|
|
59
|
+
this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
66
60
|
toValue: 0,
|
|
67
61
|
duration: BLUR_ANIMATION_DURATION,
|
|
68
62
|
useNativeDriver: true
|
|
69
|
-
}).start()
|
|
63
|
+
}).start();
|
|
70
64
|
|
|
71
|
-
|
|
65
|
+
this._handleFocus = () => {
|
|
72
66
|
if (this.props.disabled) {
|
|
73
67
|
return;
|
|
74
68
|
}
|
|
@@ -76,9 +70,9 @@ class TextField extends React.Component {
|
|
|
76
70
|
this.setState({
|
|
77
71
|
focused: true
|
|
78
72
|
});
|
|
79
|
-
}
|
|
73
|
+
};
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
this._handleBlur = () => {
|
|
82
76
|
if (this.props.disabled) {
|
|
83
77
|
return;
|
|
84
78
|
}
|
|
@@ -86,9 +80,9 @@ class TextField extends React.Component {
|
|
|
86
80
|
this.setState({
|
|
87
81
|
focused: false
|
|
88
82
|
});
|
|
89
|
-
}
|
|
83
|
+
};
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
this._handleChangeText = value => {
|
|
92
86
|
if (this.props.disabled) {
|
|
93
87
|
return;
|
|
94
88
|
}
|
|
@@ -104,9 +98,9 @@ class TextField extends React.Component {
|
|
|
104
98
|
});
|
|
105
99
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
106
100
|
}
|
|
107
|
-
}
|
|
101
|
+
};
|
|
108
102
|
|
|
109
|
-
|
|
103
|
+
this._root = undefined;
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
@@ -157,10 +151,11 @@ class TextField extends React.Component {
|
|
|
157
151
|
focused: !prevState.focused
|
|
158
152
|
}));
|
|
159
153
|
}
|
|
160
|
-
|
|
161
154
|
/**
|
|
162
155
|
* @internal
|
|
163
156
|
*/
|
|
157
|
+
|
|
158
|
+
|
|
164
159
|
setNativeProps(args) {
|
|
165
160
|
return this._root && this._root.setNativeProps(args);
|
|
166
161
|
}
|
|
@@ -203,7 +198,8 @@ class TextField extends React.Component {
|
|
|
203
198
|
roundness,
|
|
204
199
|
disabledOpacity
|
|
205
200
|
},
|
|
206
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props
|
|
201
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, { ...props
|
|
202
|
+
}),
|
|
207
203
|
...rest
|
|
208
204
|
} = this.props;
|
|
209
205
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -357,9 +353,9 @@ class TextField extends React.Component {
|
|
|
357
353
|
|
|
358
354
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
359
355
|
style: [styles.container, styleProp]
|
|
360
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
356
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
|
|
361
357
|
style: leftIconStyle
|
|
362
|
-
})
|
|
358
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
363
359
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
364
360
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
365
361
|
backgroundColor: bgColor,
|
|
@@ -426,9 +422,9 @@ class TextField extends React.Component {
|
|
|
426
422
|
style: {
|
|
427
423
|
justifyContent: type === "solid" ? "center" : undefined
|
|
428
424
|
}
|
|
429
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
425
|
+
}, /*#__PURE__*/React.createElement(Icon, { ...leftIconProps,
|
|
430
426
|
style: leftIconStyle
|
|
431
|
-
}))
|
|
427
|
+
})) : null, render({
|
|
432
428
|
ref: c => {
|
|
433
429
|
this._root = c;
|
|
434
430
|
},
|
|
@@ -469,6 +465,43 @@ var _default = (0, _theming.withTheme)(TextField);
|
|
|
469
465
|
|
|
470
466
|
exports.default = _default;
|
|
471
467
|
|
|
468
|
+
const styles = _reactNative.StyleSheet.create({
|
|
469
|
+
container: {
|
|
470
|
+
alignSelf: "stretch"
|
|
471
|
+
},
|
|
472
|
+
placeholder: {
|
|
473
|
+
position: "absolute",
|
|
474
|
+
left: 0
|
|
475
|
+
},
|
|
476
|
+
underline: {
|
|
477
|
+
position: "absolute",
|
|
478
|
+
left: 0,
|
|
479
|
+
right: 0,
|
|
480
|
+
bottom: 0,
|
|
481
|
+
height: 2
|
|
482
|
+
},
|
|
483
|
+
input: {
|
|
484
|
+
flexGrow: 1,
|
|
485
|
+
justifyContent: "center",
|
|
486
|
+
textAlignVertical: "center",
|
|
487
|
+
margin: 0,
|
|
488
|
+
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
489
|
+
}
|
|
490
|
+
});? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
491
|
+
style: [{
|
|
492
|
+
color: error ? colors.error : colors.light,
|
|
493
|
+
marginTop: 8,
|
|
494
|
+
marginLeft: assistiveTextLeftMargin
|
|
495
|
+
}]
|
|
496
|
+
}, assistiveText) : null);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
var _default = (0, _theming.withTheme)(TextField);
|
|
502
|
+
|
|
503
|
+
exports.default = _default;
|
|
504
|
+
|
|
472
505
|
const styles = _reactNative.StyleSheet.create({
|
|
473
506
|
container: {
|
|
474
507
|
alignSelf: "stretch"
|
|
@@ -11,8 +11,6 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
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); }
|
|
15
|
-
|
|
16
14
|
function Touchable(_ref) {
|
|
17
15
|
let {
|
|
18
16
|
children,
|
|
@@ -21,6 +19,22 @@ function Touchable(_ref) {
|
|
|
21
19
|
style,
|
|
22
20
|
...props
|
|
23
21
|
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
23
|
+
onPress: onPress,
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
hitSlop: 8,
|
|
26
|
+
style: _ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
pressed
|
|
29
|
+
} = _ref2;
|
|
30
|
+
return [{
|
|
31
|
+
opacity: pressed || disabled ? 0.75 : 1
|
|
32
|
+
}, style];
|
|
33
|
+
},
|
|
34
|
+
...props
|
|
35
|
+
}, children);
|
|
36
|
+
}rops
|
|
37
|
+
} = _ref;
|
|
24
38
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
25
39
|
onPress: onPress,
|
|
26
40
|
disabled: disabled,
|
|
@@ -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;AR_HEIGHT;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -291,6 +291,12 @@ Object.defineProperty(exports, "RowHeadlineImageIcon", {
|
|
|
291
291
|
return _RowHeadlineImageIcon.default;
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
|
+
Object.defineProperty(exports, "SVG", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function () {
|
|
297
|
+
return _SVG.default;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
294
300
|
Object.defineProperty(exports, "ScreenContainer", {
|
|
295
301
|
enumerable: true,
|
|
296
302
|
get: function () {
|
|
@@ -339,12 +345,6 @@ Object.defineProperty(exports, "Surface", {
|
|
|
339
345
|
return _Surface.default;
|
|
340
346
|
}
|
|
341
347
|
});
|
|
342
|
-
Object.defineProperty(exports, "Svg", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _Svg.default;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
348
|
Object.defineProperty(exports, "Swiper", {
|
|
349
349
|
enumerable: true,
|
|
350
350
|
get: function () {
|
|
@@ -448,7 +448,7 @@ var _IconButton = _interopRequireDefault(require("./components/IconButton"));
|
|
|
448
448
|
|
|
449
449
|
var _Image = _interopRequireDefault(require("./components/Image"));
|
|
450
450
|
|
|
451
|
-
var
|
|
451
|
+
var _SVG = _interopRequireDefault(require("./components/SVG"));
|
|
452
452
|
|
|
453
453
|
var _NumberInput = _interopRequireDefault(require("./components/NumberInput"));
|
|
454
454
|
|
|
@@ -18,7 +18,7 @@ const SEED_DATA = {
|
|
|
18
18
|
},
|
|
19
19
|
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
|
|
20
20
|
props: {
|
|
21
|
-
source: (0, _types.
|
|
21
|
+
source: (0, _types.createSVGProp)()
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -3,7 +3,7 @@ import { View, Platform, Image } from "react-native";
|
|
|
3
3
|
import { SvgUri } from "react-native-svg";
|
|
4
4
|
import Config from "./Config";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SVG = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
source = Config.placeholderSvgURL,
|
|
9
9
|
style
|
|
@@ -28,4 +28,4 @@ const Svg = _ref => {
|
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export default
|
|
31
|
+
export default SVG;
|
package/lib/module/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
-
export { default as
|
|
20
|
+
export { default as SVG } from "./components/SVG";
|
|
21
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
22
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
23
23
|
export { default as StarRating } from "./components/StarRating";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createSVGProp, StylesPanelSections } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "SVG",
|
|
4
4
|
tag: "SVG",
|
|
@@ -10,6 +10,6 @@ export const SEED_DATA = {
|
|
|
10
10
|
},
|
|
11
11
|
stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
|
|
12
12
|
props: {
|
|
13
|
-
source:
|
|
13
|
+
source: createSVGProp()
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, ImageStyle } from "react-native";
|
|
3
|
+
declare type SVGComponentProps = {
|
|
4
|
+
source: string;
|
|
5
|
+
style?: StyleProp<ImageStyle>;
|
|
6
|
+
};
|
|
7
|
+
declare const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>>;
|
|
8
|
+
export default SVG;
|
|
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
-
export { default as
|
|
20
|
+
export { default as SVG } from "./components/SVG";
|
|
21
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
22
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
23
23
|
export { default as StarRating } from "./components/StarRating";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-1a04f8.6+1a04f8a2",
|
|
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.2.4
|
|
44
|
+
"@draftbit/types": "^46.2.4",
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
-
"react-native-svg": "
|
|
56
|
+
"react-native-svg": "12.3.0",
|
|
57
57
|
"react-native-typography": "^1.4.1",
|
|
58
58
|
"react-native-web-swiper": "^2.2.3"
|
|
59
59
|
},
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
]
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "1a04f8a2303a4a172ea71e68277fa5a38d8dd7f1"
|
|
84
84
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { View, Platform, Image } from "react-native";
|
|
3
3
|
import { SvgUri } from "react-native-svg";
|
|
4
4
|
import Config from "./Config";
|
|
5
|
-
const
|
|
5
|
+
const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
7
|
Platform.OS === "ios" && (React.createElement(View, { style: style },
|
|
8
8
|
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
@@ -10,4 +10,4 @@ const Svg = ({ source = Config.placeholderSvgURL, style, }) => {
|
|
|
10
10
|
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
11
11
|
Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
|
|
12
12
|
};
|
|
13
|
-
export default
|
|
13
|
+
export default SVG;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { View, Platform, Image } from "react-native";
|
|
2
|
+
import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
|
|
3
3
|
import { SvgUri } from "react-native-svg";
|
|
4
4
|
|
|
5
5
|
import Config from "./Config";
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
type SVGComponentProps = {
|
|
8
8
|
source: string;
|
|
9
|
-
style?:
|
|
9
|
+
style?: StyleProp<ImageStyle>;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const SVG: React.FC<React.PropsWithChildren<SVGComponentProps>> = ({
|
|
13
13
|
source = Config.placeholderSvgURL,
|
|
14
14
|
style,
|
|
15
15
|
}) => {
|
|
@@ -32,4 +32,4 @@ const Svg: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
|
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export default
|
|
35
|
+
export default SVG;
|
package/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
17
17
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
18
18
|
export { default as IconButton } from "./components/IconButton";
|
|
19
19
|
export { default as Image } from "./components/Image";
|
|
20
|
-
export { default as
|
|
20
|
+
export { default as SVG } from "./components/SVG";
|
|
21
21
|
export { default as NumberInput } from "./components/NumberInput";
|
|
22
22
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
23
23
|
export { default as StarRating } from "./components/StarRating";
|
package/src/index.tsx
CHANGED
|
@@ -18,7 +18,7 @@ export { default as FAB } from "./components/FAB";
|
|
|
18
18
|
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
19
19
|
export { default as IconButton } from "./components/IconButton";
|
|
20
20
|
export { default as Image } from "./components/Image";
|
|
21
|
-
export { default as
|
|
21
|
+
export { default as SVG } from "./components/SVG";
|
|
22
22
|
export { default as NumberInput } from "./components/NumberInput";
|
|
23
23
|
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
24
24
|
export { default as StarRating } from "./components/StarRating";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES,
|
|
1
|
+
import { COMPONENT_TYPES, createSVGProp, StylesPanelSections, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "SVG",
|
|
4
4
|
tag: "SVG",
|
|
@@ -15,6 +15,6 @@ export const SEED_DATA = {
|
|
|
15
15
|
StylesPanelSections.Effects,
|
|
16
16
|
],
|
|
17
17
|
props: {
|
|
18
|
-
source:
|
|
18
|
+
source: createSVGProp(),
|
|
19
19
|
},
|
|
20
20
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPONENT_TYPES,
|
|
3
|
-
|
|
3
|
+
createSVGProp,
|
|
4
4
|
StylesPanelSections,
|
|
5
5
|
} from "@draftbit/types";
|
|
6
6
|
|
|
@@ -20,6 +20,6 @@ export const SEED_DATA = {
|
|
|
20
20
|
StylesPanelSections.Effects,
|
|
21
21
|
],
|
|
22
22
|
props: {
|
|
23
|
-
source:
|
|
23
|
+
source: createSVGProp(),
|
|
24
24
|
},
|
|
25
25
|
};
|