@draftbit/core 46.9.1-bdfd4c.2 → 46.9.1-c1e2bf.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/Picker/PickerComponent.android.js +3 -20
- package/lib/commonjs/mappings/BottomSheet.js +2 -2
- package/lib/module/components/Text.js +4 -50
- package/lib/module/mappings/BottomSheet.js +3 -3
- package/package.json +5 -5
- package/src/mappings/BottomSheet.js +3 -3
- package/src/mappings/BottomSheet.ts +3 -3
|
@@ -15,7 +15,9 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
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; }
|
|
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); }
|
|
18
19
|
const Picker = _ref => {
|
|
20
|
+
var _options$find$label, _options$find;
|
|
19
21
|
let {
|
|
20
22
|
style,
|
|
21
23
|
options,
|
|
@@ -25,7 +27,6 @@ const Picker = _ref => {
|
|
|
25
27
|
onValueChange: onValueChangeOverride = () => {},
|
|
26
28
|
...props
|
|
27
29
|
} = _ref;
|
|
28
|
-
var _a, _b;
|
|
29
30
|
const {
|
|
30
31
|
viewStyles: {
|
|
31
32
|
borderRadius,
|
|
@@ -70,7 +71,7 @@ const Picker = _ref => {
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
73
|
-
const selectedLabel = selectedValue && ((
|
|
74
|
+
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);
|
|
74
75
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
75
76
|
disabled: disabled,
|
|
76
77
|
onPress: toggleFocus,
|
|
@@ -94,24 +95,6 @@ const Picker = _ref => {
|
|
|
94
95
|
key: o.value
|
|
95
96
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
96
97
|
pointerEvents: "none"
|
|
97
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
98
|
-
...props,
|
|
99
|
-
value: selectedLabel,
|
|
100
|
-
placeholder: placeholder,
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
ref: textField,
|
|
103
|
-
disabled: disabled,
|
|
104
|
-
// @ts-expect-error
|
|
105
|
-
style: stylesWithoutMargin
|
|
106
|
-
}))));
|
|
107
|
-
};
|
|
108
|
-
const styles = _reactNative.StyleSheet.create({
|
|
109
|
-
container: {
|
|
110
|
-
alignSelf: "stretch"
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
114
|
-
exports.default = _default;pointerEvents: "none"
|
|
115
98
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
116
99
|
value: selectedLabel,
|
|
117
100
|
placeholder: placeholder
|
|
@@ -21,7 +21,7 @@ const SEED_DATA = {
|
|
|
21
21
|
label: "On settle",
|
|
22
22
|
description: "Action to execute when sheet settles on a snap point"
|
|
23
23
|
}),
|
|
24
|
-
snapPoints: (0, _types.
|
|
24
|
+
snapPoints: (0, _types.createArrayProp)({
|
|
25
25
|
label: "Snap points",
|
|
26
26
|
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
27
27
|
defaultValue: ["10%", "50%", "80%"]
|
|
@@ -34,7 +34,7 @@ const SEED_DATA = {
|
|
|
34
34
|
}),
|
|
35
35
|
showHandle: (0, _types.createStaticBoolProp)({
|
|
36
36
|
label: "Show handle",
|
|
37
|
-
description: "Whether to show the sheet handle or not",
|
|
37
|
+
description: "Whether to show the top sheet handle or not",
|
|
38
38
|
defaultValue: true
|
|
39
39
|
}),
|
|
40
40
|
handleColor: (0, _types.createColorProp)({
|
|
@@ -1,56 +1,10 @@
|
|
|
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
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
5
|
import * as React from "react";
|
|
2
6
|
import { Text as NativeText, I18nManager } from "react-native";
|
|
3
7
|
import { withTheme } from "../theming";
|
|
4
|
-
class Text extends React.Component {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.state = {
|
|
8
|
-
nativeProps: {}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
setNativeProps(args) {
|
|
12
|
-
this.state.nativeProps = args || {};
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
const {
|
|
16
|
-
style,
|
|
17
|
-
...rest
|
|
18
|
-
} = this.props;
|
|
19
|
-
const writingDirection = I18nManager.isRTL ? "rtl" : "ltr";
|
|
20
|
-
return /*#__PURE__*/React.createElement(NativeText, {
|
|
21
|
-
...rest,
|
|
22
|
-
...this.state.nativeProps,
|
|
23
|
-
ref: c => {
|
|
24
|
-
this._root = c;
|
|
25
|
-
},
|
|
26
|
-
style: [{
|
|
27
|
-
textAlign: "left",
|
|
28
|
-
writingDirection
|
|
29
|
-
}, style]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export const BaseLink = _ref => {
|
|
34
|
-
let {
|
|
35
|
-
style,
|
|
36
|
-
theme,
|
|
37
|
-
title,
|
|
38
|
-
...props
|
|
39
|
-
} = _ref;
|
|
40
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
41
|
-
hitSlop: 8,
|
|
42
|
-
style: [{
|
|
43
|
-
color: theme.colors.primary
|
|
44
|
-
}, style],
|
|
45
|
-
theme: theme,
|
|
46
|
-
...props
|
|
47
|
-
}, title);
|
|
48
|
-
};
|
|
49
|
-
const Link = withTheme(BaseLink);
|
|
50
|
-
export { Link };
|
|
51
|
-
export default withTheme(Text); as React from "react";
|
|
52
|
-
import { Text as NativeText, I18nManager } from "react-native";
|
|
53
|
-
import { withTheme } from "../theming";
|
|
54
8
|
class Text extends React.Component {
|
|
55
9
|
constructor() {
|
|
56
10
|
super(...arguments);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp,
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Bottom Sheet",
|
|
4
4
|
tag: "BottomSheet",
|
|
@@ -15,7 +15,7 @@ export const SEED_DATA = {
|
|
|
15
15
|
label: "On settle",
|
|
16
16
|
description: "Action to execute when sheet settles on a snap point"
|
|
17
17
|
}),
|
|
18
|
-
snapPoints:
|
|
18
|
+
snapPoints: createArrayProp({
|
|
19
19
|
label: "Snap points",
|
|
20
20
|
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
21
21
|
defaultValue: ["10%", "50%", "80%"]
|
|
@@ -28,7 +28,7 @@ export const SEED_DATA = {
|
|
|
28
28
|
}),
|
|
29
29
|
showHandle: createStaticBoolProp({
|
|
30
30
|
label: "Show handle",
|
|
31
|
-
description: "Whether to show the sheet handle or not",
|
|
31
|
+
description: "Whether to show the top sheet handle or not",
|
|
32
32
|
defaultValue: true
|
|
33
33
|
}),
|
|
34
34
|
handleColor: createColorProp({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.9.1-
|
|
3
|
+
"version": "46.9.1-c1e2bf.2+c1e2bf4",
|
|
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.9.1-
|
|
44
|
+
"@draftbit/types": "^46.9.1-c1e2bf.2+c1e2bf4",
|
|
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",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"lodash.omit": "^4.5.0",
|
|
55
55
|
"lodash.tonumber": "^4.0.3",
|
|
56
56
|
"react-native-deck-swiper": "^2.0.12",
|
|
57
|
-
"react-native-gesture-handler": "
|
|
57
|
+
"react-native-gesture-handler": "~2.5.0",
|
|
58
58
|
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
59
59
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
60
60
|
"react-native-pager-view": "5.4.24",
|
|
61
|
-
"react-native-reanimated": "
|
|
61
|
+
"react-native-reanimated": "~2.9.1",
|
|
62
62
|
"react-native-shadow-2": "^7.0.6",
|
|
63
63
|
"react-native-svg": "12.3.0",
|
|
64
64
|
"react-native-tab-view": "^3.4.0",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
]
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "c1e2bf40e776e51766fe51fe6790bf7c86334a8b"
|
|
102
102
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp,
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Bottom Sheet",
|
|
4
4
|
tag: "BottomSheet",
|
|
@@ -12,7 +12,7 @@ export const SEED_DATA = {
|
|
|
12
12
|
label: "On settle",
|
|
13
13
|
description: "Action to execute when sheet settles on a snap point",
|
|
14
14
|
}),
|
|
15
|
-
snapPoints:
|
|
15
|
+
snapPoints: createArrayProp({
|
|
16
16
|
label: "Snap points",
|
|
17
17
|
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
18
18
|
defaultValue: ["10%", "50%", "80%"],
|
|
@@ -25,7 +25,7 @@ export const SEED_DATA = {
|
|
|
25
25
|
}),
|
|
26
26
|
showHandle: createStaticBoolProp({
|
|
27
27
|
label: "Show handle",
|
|
28
|
-
description: "Whether to show the sheet handle or not",
|
|
28
|
+
description: "Whether to show the top sheet handle or not",
|
|
29
29
|
defaultValue: true,
|
|
30
30
|
}),
|
|
31
31
|
handleColor: createColorProp({
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
Triggers,
|
|
6
6
|
createActionProp,
|
|
7
7
|
createColorProp,
|
|
8
|
-
createStaticArrayProp,
|
|
9
8
|
createStaticNumberProp,
|
|
9
|
+
createArrayProp,
|
|
10
10
|
} from "@draftbit/types";
|
|
11
11
|
|
|
12
12
|
export const SEED_DATA = {
|
|
@@ -23,7 +23,7 @@ export const SEED_DATA = {
|
|
|
23
23
|
label: "On settle",
|
|
24
24
|
description: "Action to execute when sheet settles on a snap point",
|
|
25
25
|
}),
|
|
26
|
-
snapPoints:
|
|
26
|
+
snapPoints: createArrayProp({
|
|
27
27
|
label: "Snap points",
|
|
28
28
|
description:
|
|
29
29
|
"An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
@@ -37,7 +37,7 @@ export const SEED_DATA = {
|
|
|
37
37
|
}),
|
|
38
38
|
showHandle: createStaticBoolProp({
|
|
39
39
|
label: "Show handle",
|
|
40
|
-
description: "Whether to show the sheet handle or not",
|
|
40
|
+
description: "Whether to show the top sheet handle or not",
|
|
41
41
|
defaultValue: true,
|
|
42
42
|
}),
|
|
43
43
|
handleColor: createColorProp({
|