@draftbit/core 46.4.4-11985a.2 → 46.4.4-131f72.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/Checkbox/CheckboxRow.js +24 -6
- package/lib/commonjs/components/Container.js +5 -17
- package/lib/commonjs/components/Surface.js +2 -1
- package/lib/commonjs/components/Text.js +6 -2
- package/lib/commonjs/components/TextField.js +5 -1
- package/lib/commonjs/index.js +0 -38
- package/lib/commonjs/utilities.js +2 -2
- package/lib/module/components/Accordion/AccordionItem.js +5 -26
- package/lib/module/components/DatePicker/DatePicker.js +8 -7
- package/lib/module/components/Image.js +3 -18
- package/lib/module/components/Picker/PickerComponent.web.js +5 -23
- package/lib/module/components/ScreenContainer.js +5 -22
- package/lib/module/components/Surface.js +1 -1
- package/lib/module/components/Text.js +6 -2
- package/lib/module/components/TextField.js +5 -1
- package/lib/module/constants.js +0 -1
- package/lib/module/index.js +0 -1
- package/lib/module/utilities.js +3 -3
- package/lib/typescript/src/components/Text.d.ts +2 -1
- package/lib/typescript/src/components/TextField.d.ts +2 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/utilities.d.ts +3 -3
- package/package.json +3 -3
- package/src/components/Surface.js +1 -0
- package/src/components/Surface.tsx +1 -0
- 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/index.js +0 -1
- package/src/index.tsx +0 -9
- package/src/utilities.js +2 -5
- package/src/utilities.ts +2 -13
- package/lib/commonjs/components/Table/Table.js +0 -35
- package/lib/commonjs/components/Table/TableCell.js +0 -50
- package/lib/commonjs/components/Table/TableHeader.js +0 -41
- package/lib/commonjs/components/Table/TablePaginator.js +0 -17
- package/lib/commonjs/components/Table/TableRow.js +0 -47
- package/lib/commonjs/components/Table/TableTitle.js +0 -60
- package/lib/commonjs/components/Table/index.js +0 -55
- package/lib/commonjs/mappings/Table.js +0 -102
- package/lib/module/components/Table/Table.js +0 -23
- package/lib/module/components/Table/TableCell.js +0 -37
- package/lib/module/components/Table/TableHeader.js +0 -27
- package/lib/module/components/Table/TablePaginator.js +0 -6
- package/lib/module/components/Table/TableRow.js +0 -33
- package/lib/module/components/Table/TableTitle.js +0 -47
- package/lib/module/components/Table/index.js +0 -6
- package/lib/module/mappings/Table.js +0 -93
- package/lib/typescript/src/components/Table/Table.d.ts +0 -8
- package/lib/typescript/src/components/Table/TableCell.d.ts +0 -10
- package/lib/typescript/src/components/Table/TableHeader.d.ts +0 -12
- package/lib/typescript/src/components/Table/TablePaginator.d.ts +0 -3
- package/lib/typescript/src/components/Table/TableRow.d.ts +0 -12
- package/lib/typescript/src/components/Table/TableTitle.d.ts +0 -12
- package/lib/typescript/src/components/Table/index.d.ts +0 -6
- package/lib/typescript/src/mappings/Table.d.ts +0 -148
- package/src/components/Table/Table.js +0 -10
- package/src/components/Table/Table.tsx +0 -22
- package/src/components/Table/TableCell.js +0 -21
- package/src/components/Table/TableCell.tsx +0 -44
- package/src/components/Table/TableHeader.js +0 -11
- package/src/components/Table/TableHeader.tsx +0 -28
- package/src/components/Table/TablePaginator.js +0 -5
- package/src/components/Table/TablePaginator.tsx +0 -10
- package/src/components/Table/TableRow.js +0 -16
- package/src/components/Table/TableRow.tsx +0 -31
- package/src/components/Table/TableTitle.js +0 -28
- package/src/components/Table/TableTitle.tsx +0 -58
- package/src/components/Table/index.js +0 -6
- package/src/components/Table/index.tsx +0 -6
- package/src/mappings/Table.js +0 -136
- package/src/mappings/Table.ts +0 -144
|
@@ -27,9 +27,7 @@ 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
|
-
|
|
31
|
-
|
|
32
|
-
let Direction;
|
|
30
|
+
var Direction;
|
|
33
31
|
exports.Direction = Direction;
|
|
34
32
|
|
|
35
33
|
(function (Direction) {
|
|
@@ -102,13 +100,14 @@ const CheckboxRow = _ref => {
|
|
|
102
100
|
textStyles,
|
|
103
101
|
viewStyles
|
|
104
102
|
} = (0, _utilities.extractStyles)(style);
|
|
105
|
-
return /*#__PURE__*/React.createElement(_Touchable.default,
|
|
103
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
106
104
|
onPress: handlePress,
|
|
107
105
|
style: [viewStyles, styles.mainParent, {
|
|
108
106
|
flexDirection: direction
|
|
109
107
|
}],
|
|
110
|
-
disabled: disabled
|
|
111
|
-
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
...rest
|
|
110
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
112
111
|
style: [styles.label, {
|
|
113
112
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
114
113
|
}, labelContainerStyle]
|
|
@@ -146,5 +145,24 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
146
145
|
}
|
|
147
146
|
});
|
|
148
147
|
|
|
148
|
+
var _default = CheckboxRow;
|
|
149
|
+
exports.default = _default;ms: "center",
|
|
150
|
+
justifyContent: "space-around",
|
|
151
|
+
paddingStart: 20,
|
|
152
|
+
minHeight: 50,
|
|
153
|
+
paddingEnd: 20,
|
|
154
|
+
display: "flex",
|
|
155
|
+
..._reactNative.Platform.select({
|
|
156
|
+
web: {
|
|
157
|
+
cursor: "pointer",
|
|
158
|
+
userSelect: "none"
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
},
|
|
162
|
+
label: {
|
|
163
|
+
flex: 3
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
149
167
|
var _default = CheckboxRow;
|
|
150
168
|
exports.default = _default;
|
|
@@ -19,6 +19,8 @@ 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
|
+
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); }
|
|
23
|
+
|
|
22
24
|
const Container = _ref => {
|
|
23
25
|
let {
|
|
24
26
|
useThemeGutterPadding,
|
|
@@ -80,10 +82,9 @@ const Container = _ref => {
|
|
|
80
82
|
};
|
|
81
83
|
const Wrap = elevation ? _Elevation.default : _reactNative.View;
|
|
82
84
|
if (elevation) containerStyle.elevation = elevation;
|
|
83
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
|
84
|
-
style: [containerStyle, style]
|
|
85
|
-
|
|
86
|
-
}, backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
85
|
+
return /*#__PURE__*/React.createElement(Wrap, _extends({
|
|
86
|
+
style: [containerStyle, style]
|
|
87
|
+
}, rest), backgroundImage ? /*#__PURE__*/React.createElement(_reactNative.ImageBackground, {
|
|
87
88
|
source: typeof backgroundImage === "string" ? {
|
|
88
89
|
uri: backgroundImage
|
|
89
90
|
} : backgroundImage,
|
|
@@ -100,17 +101,4 @@ const Container = _ref => {
|
|
|
100
101
|
|
|
101
102
|
var _default = (0, _theming.withTheme)(Container);
|
|
102
103
|
|
|
103
|
-
exports.default = _default;izeMode: backgroundImageResizeMode,
|
|
104
|
-
style: {
|
|
105
|
-
flex: 1
|
|
106
|
-
}
|
|
107
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
108
|
-
style: innerStyle
|
|
109
|
-
}, children)) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
110
|
-
style: innerStyle
|
|
111
|
-
}, children));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var _default = (0, _theming.withTheme)(Container);
|
|
115
|
-
|
|
116
104
|
exports.default = _default;
|
|
@@ -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,
|
package/lib/commonjs/index.js
CHANGED
|
@@ -369,42 +369,6 @@ Object.defineProperty(exports, "SwitchRow", {
|
|
|
369
369
|
return _Switch.SwitchRow;
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
-
Object.defineProperty(exports, "Table", {
|
|
373
|
-
enumerable: true,
|
|
374
|
-
get: function () {
|
|
375
|
-
return _Table.Table;
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
Object.defineProperty(exports, "TableCell", {
|
|
379
|
-
enumerable: true,
|
|
380
|
-
get: function () {
|
|
381
|
-
return _Table.TableCell;
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
Object.defineProperty(exports, "TableHeader", {
|
|
385
|
-
enumerable: true,
|
|
386
|
-
get: function () {
|
|
387
|
-
return _Table.TableHeader;
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
Object.defineProperty(exports, "TablePaginator", {
|
|
391
|
-
enumerable: true,
|
|
392
|
-
get: function () {
|
|
393
|
-
return _Table.TablePaginator;
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
Object.defineProperty(exports, "TableRow", {
|
|
397
|
-
enumerable: true,
|
|
398
|
-
get: function () {
|
|
399
|
-
return _Table.TableRow;
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
Object.defineProperty(exports, "TableTitle", {
|
|
403
|
-
enumerable: true,
|
|
404
|
-
get: function () {
|
|
405
|
-
return _Table.TableTitle;
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
372
|
Object.defineProperty(exports, "TextField", {
|
|
409
373
|
enumerable: true,
|
|
410
374
|
get: function () {
|
|
@@ -512,8 +476,6 @@ var _Layout = require("./components/Layout");
|
|
|
512
476
|
|
|
513
477
|
var _index = require("./components/RadioButton/index");
|
|
514
478
|
|
|
515
|
-
var _Table = require("./components/Table");
|
|
516
|
-
|
|
517
479
|
var _CardBlock = _interopRequireDefault(require("./components/CardBlock"));
|
|
518
480
|
|
|
519
481
|
var _CardContainer = _interopRequireDefault(require("./components/CardContainer"));
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
3
5
|
import Text from "../Text";
|
|
@@ -18,10 +20,9 @@ const AccordionItem = _ref => {
|
|
|
18
20
|
textStyles,
|
|
19
21
|
viewStyles
|
|
20
22
|
} = extractStyles(style);
|
|
21
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
22
|
-
style: [styles.container, viewStyles]
|
|
23
|
-
|
|
24
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
24
|
+
style: [styles.container, viewStyles]
|
|
25
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
25
26
|
style: styles.row
|
|
26
27
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
27
28
|
name: icon,
|
|
@@ -35,28 +36,6 @@ const AccordionItem = _ref => {
|
|
|
35
36
|
}, label))));
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
const styles = StyleSheet.create({
|
|
39
|
-
container: {
|
|
40
|
-
padding: 8
|
|
41
|
-
},
|
|
42
|
-
row: {
|
|
43
|
-
flexDirection: "row",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
paddingLeft: 8
|
|
46
|
-
},
|
|
47
|
-
item: {
|
|
48
|
-
marginVertical: 6,
|
|
49
|
-
paddingLeft: 8
|
|
50
|
-
},
|
|
51
|
-
content: {
|
|
52
|
-
flex: 1,
|
|
53
|
-
justifyContent: "center"
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
export default withTheme(AccordionItem);xtStyles
|
|
57
|
-
}, label))));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
39
|
const styles = StyleSheet.create({
|
|
61
40
|
container: {
|
|
62
41
|
padding: 8
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
|
|
3
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -260,9 +262,9 @@ const DatePicker = _ref => {
|
|
|
260
262
|
pointerEvents: "none"
|
|
261
263
|
}, /*#__PURE__*/React.createElement(View, {
|
|
262
264
|
style: [styles.container, style]
|
|
263
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
265
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
264
266
|
style: leftIconStyle
|
|
265
|
-
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
267
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
266
268
|
style: [containerStyle, style ? {
|
|
267
269
|
height: style.height
|
|
268
270
|
} : {}]
|
|
@@ -310,11 +312,11 @@ const DatePicker = _ref => {
|
|
|
310
312
|
opacity: hasActiveOutline ? labeled : 1
|
|
311
313
|
}],
|
|
312
314
|
numberOfLines: 1
|
|
313
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
315
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
314
316
|
style: { ...leftIconStyle,
|
|
315
317
|
marginLeft: type === "solid" ? 16 : 0
|
|
316
318
|
}
|
|
317
|
-
}) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
319
|
+
})) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
|
|
318
320
|
value: formatDate(),
|
|
319
321
|
placeholder: label ? placeholder1 : placeholder,
|
|
320
322
|
editable: !disabled,
|
|
@@ -323,9 +325,8 @@ const DatePicker = _ref => {
|
|
|
323
325
|
onFocus: _handleFocus,
|
|
324
326
|
onBlur: _handleBlur,
|
|
325
327
|
underlineColorAndroid: "transparent",
|
|
326
|
-
style: inputStyles
|
|
327
|
-
|
|
328
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
328
|
+
style: inputStyles
|
|
329
|
+
}, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
329
330
|
name: rightIconName,
|
|
330
331
|
size: ICON_SIZE,
|
|
331
332
|
color: colors.light,
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
4
|
import React from "react";
|
|
3
5
|
import { Image as NativeImage, StyleSheet } from "react-native";
|
|
@@ -62,24 +64,7 @@ const Image = _ref2 => {
|
|
|
62
64
|
height,
|
|
63
65
|
aspectRatio
|
|
64
66
|
}]
|
|
65
|
-
}, /*#__PURE__*/React.createElement(NativeImage, {
|
|
66
|
-
source: imageSource,
|
|
67
|
-
resizeMode: resizeMode,
|
|
68
|
-
style: [style, {
|
|
69
|
-
height: "100%",
|
|
70
|
-
width: "100%"
|
|
71
|
-
}]
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return /*#__PURE__*/React.createElement(NativeImage, { ...props,
|
|
76
|
-
source: source,
|
|
77
|
-
resizeMode: resizeMode,
|
|
78
|
-
style: style
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default Image;ent(NativeImage, _extends({}, props, {
|
|
67
|
+
}, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
|
|
83
68
|
source: imageSource,
|
|
84
69
|
resizeMode: resizeMode,
|
|
85
70
|
style: [style, {
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
@@ -8,6 +10,8 @@ import TextField from "../TextField";
|
|
|
8
10
|
import Touchable from "../Touchable";
|
|
9
11
|
|
|
10
12
|
const Picker = _ref => {
|
|
13
|
+
var _options$find$label, _options$find;
|
|
14
|
+
|
|
11
15
|
let {
|
|
12
16
|
style,
|
|
13
17
|
options,
|
|
@@ -17,9 +21,6 @@ const Picker = _ref => {
|
|
|
17
21
|
onValueChange: onValueChangeOverride = () => {},
|
|
18
22
|
...props
|
|
19
23
|
} = _ref;
|
|
20
|
-
|
|
21
|
-
var _a, _b;
|
|
22
|
-
|
|
23
24
|
const {
|
|
24
25
|
viewStyles: {
|
|
25
26
|
borderRadius,
|
|
@@ -66,7 +67,7 @@ const Picker = _ref => {
|
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
69
|
-
const selectedLabel = selectedValue && ((
|
|
70
|
+
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);
|
|
70
71
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
71
72
|
disabled: disabled,
|
|
72
73
|
onPress: toggleFocus,
|
|
@@ -89,25 +90,6 @@ const Picker = _ref => {
|
|
|
89
90
|
label: o.label,
|
|
90
91
|
value: o.value,
|
|
91
92
|
key: o.value
|
|
92
|
-
}))), /*#__PURE__*/React.createElement(View, {
|
|
93
|
-
pointerEvents: "none"
|
|
94
|
-
}, /*#__PURE__*/React.createElement(TextField, { ...props,
|
|
95
|
-
value: selectedLabel,
|
|
96
|
-
placeholder: placeholder,
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
ref: textField,
|
|
99
|
-
disabled: disabled,
|
|
100
|
-
// @ts-expect-error
|
|
101
|
-
style: stylesWithoutMargin
|
|
102
|
-
}))));
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const styles = StyleSheet.create({
|
|
106
|
-
container: {
|
|
107
|
-
alignSelf: "stretch"
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
export default withTheme(Picker); key: o.value
|
|
111
93
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
112
94
|
pointerEvents: "none"
|
|
113
95
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { StyleSheet, ScrollView, View } from "react-native";
|
|
3
5
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
@@ -25,13 +27,12 @@ function ScreenContainer(_ref) {
|
|
|
25
27
|
edges.push("bottom");
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
return /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
30
|
+
return /*#__PURE__*/React.createElement(SafeAreaView, _extends({
|
|
29
31
|
edges: edges,
|
|
30
32
|
style: [styles.container, {
|
|
31
33
|
backgroundColor
|
|
32
|
-
}]
|
|
33
|
-
|
|
34
|
-
}, scrollable ? /*#__PURE__*/React.createElement(ScrollView, {
|
|
34
|
+
}]
|
|
35
|
+
}, rest), scrollable ? /*#__PURE__*/React.createElement(ScrollView, {
|
|
35
36
|
contentContainerStyle: [styles.scrollViewContainer, {
|
|
36
37
|
backgroundColor
|
|
37
38
|
}, style]
|
|
@@ -42,24 +43,6 @@ function ScreenContainer(_ref) {
|
|
|
42
43
|
}, children));
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const styles = StyleSheet.create({
|
|
46
|
-
container: {
|
|
47
|
-
flex: 1
|
|
48
|
-
},
|
|
49
|
-
scrollViewContainer: {
|
|
50
|
-
flexGrow: 1,
|
|
51
|
-
flex: undefined
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
export default withTheme(ScreenContainer);olor
|
|
55
|
-
}, style]
|
|
56
|
-
}, children) : /*#__PURE__*/React.createElement(View, {
|
|
57
|
-
style: [styles.container, {
|
|
58
|
-
backgroundColor
|
|
59
|
-
}, style]
|
|
60
|
-
}, children));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
46
|
const styles = StyleSheet.create({
|
|
64
47
|
container: {
|
|
65
48
|
flex: 1
|
|
@@ -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,
|
package/lib/module/constants.js
CHANGED
package/lib/module/index.js
CHANGED
|
@@ -31,7 +31,6 @@ 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 { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle } from "./components/Table";
|
|
35
34
|
/* Deprecated: Fix or Delete! */
|
|
36
35
|
|
|
37
36
|
export { default as CardBlock } from "./components/CardBlock";
|
package/lib/module/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import { isString, isNumber, pick, pickBy, identity
|
|
2
|
+
import { isString, isNumber, pick, pickBy, identity } from "lodash";
|
|
3
3
|
export function extractStyles(style) {
|
|
4
4
|
const {
|
|
5
5
|
color,
|
|
@@ -29,8 +29,8 @@ export function extractStyles(style) {
|
|
|
29
29
|
textDecorationStyle
|
|
30
30
|
};
|
|
31
31
|
return {
|
|
32
|
-
viewStyles
|
|
33
|
-
textStyles
|
|
32
|
+
viewStyles,
|
|
33
|
+
textStyles
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
export const borderStyleNames = ["borderRadius", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth"];
|
|
@@ -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;
|
|
@@ -31,7 +31,6 @@ 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 { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle, } from "./components/Table";
|
|
35
34
|
export { default as CardBlock } from "./components/CardBlock";
|
|
36
35
|
export { default as CardContainer } from "./components/CardContainer";
|
|
37
36
|
export { default as CardContainerRating } from "./components/CardContainerRating";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
|
-
import { StyleProp } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle } from "react-native";
|
|
3
3
|
export declare function extractStyles(style: StyleProp<any>): {
|
|
4
|
-
viewStyles:
|
|
5
|
-
textStyles:
|
|
4
|
+
viewStyles: any;
|
|
5
|
+
textStyles: TextStyle;
|
|
6
6
|
};
|
|
7
7
|
export declare const borderStyleNames: string[];
|
|
8
8
|
export declare const marginStyleNames: 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-131f72.2+131f72d",
|
|
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-131f72.2+131f72d",
|
|
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": "131f72d4135d0fa98ccab5578bc8204fa1295afe"
|
|
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
|
{
|