@draftbit/core 47.0.1-c14479.2 → 47.0.1-c25493.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/AnimatedCircularProgress.js +12 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
- package/lib/commonjs/components/Pressable.js +15 -2
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/Touchable.js +15 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/FlashList.js +45 -2
- package/lib/commonjs/mappings/FlatList.js +12 -0
- package/lib/commonjs/mappings/Touchable.js +1 -1
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/commonjs/utilities.js +1 -2
- package/lib/module/mappings/FlashList.js +46 -3
- package/lib/module/mappings/FlatList.js +13 -1
- package/lib/module/mappings/Touchable.js +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/mappings/FlashList.js +77 -31
- package/src/mappings/FlashList.ts +82 -30
- package/src/mappings/FlatList.js +13 -1
- package/src/mappings/FlatList.ts +16 -0
- package/src/mappings/Touchable.js +1 -1
- package/src/mappings/Touchable.ts +1 -1
|
@@ -10,7 +10,6 @@ var _CircularProgress = _interopRequireDefault(require("./CircularProgress"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
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); }
|
|
14
13
|
const AnimatedProgress = _reactNative.Animated.createAnimatedComponent(_CircularProgress.default);
|
|
15
14
|
const AnimatedCircularProgress = _ref => {
|
|
16
15
|
let {
|
|
@@ -55,6 +54,18 @@ const AnimatedCircularProgress = _ref => {
|
|
|
55
54
|
React.useEffect(() => {
|
|
56
55
|
animate();
|
|
57
56
|
}, [fill, animate]);
|
|
57
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, {
|
|
58
|
+
...other,
|
|
59
|
+
style: other.style,
|
|
60
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
61
|
+
fill: fillAnimation,
|
|
62
|
+
tintColor: animateColor()
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var _default = AnimatedCircularProgress;
|
|
66
|
+
exports.default = _default;ect(() => {
|
|
67
|
+
animate();
|
|
68
|
+
}, [fill, animate]);
|
|
58
69
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
59
70
|
style: other.style,
|
|
60
71
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _context = require("./context");
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
|
-
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); }
|
|
13
12
|
const {
|
|
14
13
|
Provider
|
|
15
14
|
} = _context.checkboxGroupContext;
|
|
@@ -31,7 +30,23 @@ const CheckboxGroup = _ref => {
|
|
|
31
30
|
alignItems: "center"
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
33
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
34
|
+
style: [{
|
|
35
|
+
minHeight: 40
|
|
36
|
+
}, style],
|
|
37
|
+
...rest
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
39
|
+
value: {
|
|
40
|
+
values,
|
|
41
|
+
onValueChange,
|
|
42
|
+
direction
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
45
|
+
style: _containerStyle
|
|
46
|
+
}, children)));
|
|
47
|
+
};
|
|
48
|
+
var _default = CheckboxGroup;
|
|
49
|
+
exports.default = _default;s({
|
|
35
50
|
style: [{
|
|
36
51
|
minHeight: 40
|
|
37
52
|
}, style]
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkboxGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
9
|
+
var Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
|
@@ -8,27 +8,24 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _reactNativeSvg = require("react-native-svg");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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; }
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
-
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); }
|
|
14
11
|
class CircularProgress extends _react.default.Component {
|
|
15
12
|
constructor() {
|
|
16
13
|
super(...arguments);
|
|
17
|
-
|
|
14
|
+
this.polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
|
|
18
15
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
19
16
|
return {
|
|
20
17
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
21
18
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
22
19
|
};
|
|
23
|
-
}
|
|
24
|
-
|
|
20
|
+
};
|
|
21
|
+
this.circlePath = (x, y, radius, startAngle, endAngle) => {
|
|
25
22
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
26
23
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
27
24
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
28
25
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
29
26
|
return d.join(" ");
|
|
30
|
-
}
|
|
31
|
-
|
|
27
|
+
};
|
|
28
|
+
this.clampFill = fill => Math.min(100, Math.max(0, fill));
|
|
32
29
|
}
|
|
33
30
|
render() {
|
|
34
31
|
const {
|
|
@@ -109,4 +106,25 @@ class CircularProgress extends _react.default.Component {
|
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
var _default = CircularProgress;
|
|
109
|
+
exports.default = _default;padding) / 2
|
|
110
|
+
}, backgroundColor && /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Path, {
|
|
111
|
+
d: backgroundPath,
|
|
112
|
+
stroke: backgroundColor,
|
|
113
|
+
strokeWidth: backgroundWidth || width,
|
|
114
|
+
strokeLinecap: lineCap,
|
|
115
|
+
strokeDasharray: strokeDasharrayBackground,
|
|
116
|
+
fill: "transparent"
|
|
117
|
+
}), fill > 0 && /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Path, {
|
|
118
|
+
d: circlePathItem,
|
|
119
|
+
stroke: tintColor,
|
|
120
|
+
strokeWidth: width,
|
|
121
|
+
strokeLinecap: lineCap,
|
|
122
|
+
strokeDasharray: strokeDasharrayTint,
|
|
123
|
+
fill: "transparent"
|
|
124
|
+
}), cap)), children && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
125
|
+
style: localChildrenContainerStyle
|
|
126
|
+
}, children(fill)));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var _default = CircularProgress;
|
|
112
130
|
exports.default = _default;
|
|
@@ -8,7 +8,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _theming = require("../theming");
|
|
9
9
|
var _Touchable = _interopRequireDefault(require("./Touchable"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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); }
|
|
12
11
|
const getWidth = numColumns => {
|
|
13
12
|
switch (numColumns) {
|
|
14
13
|
case 1:
|
|
@@ -28,6 +27,21 @@ const Card = _ref => {
|
|
|
28
27
|
...rest
|
|
29
28
|
} = _ref;
|
|
30
29
|
const width = getWidth(numColumns);
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_Touchable.default, {
|
|
31
|
+
disabled: !onPress,
|
|
32
|
+
onPress: onPress,
|
|
33
|
+
style: [style, {
|
|
34
|
+
width
|
|
35
|
+
}],
|
|
36
|
+
...rest
|
|
37
|
+
}, children);
|
|
38
|
+
};
|
|
39
|
+
var _default = (0, _theming.withTheme)(Card);
|
|
40
|
+
exports.default = _default;s,
|
|
41
|
+
style,
|
|
42
|
+
...rest
|
|
43
|
+
} = _ref;
|
|
44
|
+
const width = getWidth(numColumns);
|
|
31
45
|
return /*#__PURE__*/_react.default.createElement(_Touchable.default, _extends({
|
|
32
46
|
disabled: !onPress,
|
|
33
47
|
onPress: onPress,
|
|
@@ -9,7 +9,8 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
10
10
|
var _AspectRatio = _interopRequireDefault(require("./AspectRatio"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
12
|
+
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
13
|
+
|
|
13
14
|
const generateDimensions = _ref => {
|
|
14
15
|
let {
|
|
15
16
|
aspectRatio,
|
|
@@ -62,13 +63,27 @@ const Image = _ref2 => {
|
|
|
62
63
|
height,
|
|
63
64
|
aspectRatio
|
|
64
65
|
}]
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image,
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
67
|
+
...props,
|
|
66
68
|
source: imageSource,
|
|
67
69
|
resizeMode: resizeMode,
|
|
68
70
|
style: [style, {
|
|
69
71
|
height: "100%",
|
|
70
72
|
width: "100%"
|
|
71
73
|
}]
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
77
|
+
...props,
|
|
78
|
+
source: source,
|
|
79
|
+
resizeMode: resizeMode,
|
|
80
|
+
style: style
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
var _default = Image;
|
|
84
|
+
exports.default = _default; "100%",
|
|
85
|
+
width: "100%"
|
|
86
|
+
}]
|
|
72
87
|
})));
|
|
73
88
|
}
|
|
74
89
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, _extends({}, props, {
|
|
@@ -15,9 +15,7 @@ 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); }
|
|
19
18
|
const Picker = _ref => {
|
|
20
|
-
var _options$find$label, _options$find;
|
|
21
19
|
let {
|
|
22
20
|
style,
|
|
23
21
|
options,
|
|
@@ -27,6 +25,7 @@ const Picker = _ref => {
|
|
|
27
25
|
onValueChange: onValueChangeOverride = () => {},
|
|
28
26
|
...props
|
|
29
27
|
} = _ref;
|
|
28
|
+
var _a, _b;
|
|
30
29
|
const {
|
|
31
30
|
viewStyles: {
|
|
32
31
|
borderRadius,
|
|
@@ -71,7 +70,7 @@ const Picker = _ref => {
|
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
74
|
-
const selectedLabel = selectedValue && ((
|
|
73
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
75
74
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
75
|
disabled: disabled,
|
|
77
76
|
onPress: toggleFocus,
|
|
@@ -96,6 +95,24 @@ const Picker = _ref => {
|
|
|
96
95
|
key: o.value
|
|
97
96
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
98
97
|
pointerEvents: "none"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
99
|
+
...props,
|
|
100
|
+
value: selectedLabel,
|
|
101
|
+
placeholder: placeholder,
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
ref: textField,
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
// @ts-expect-error
|
|
106
|
+
style: stylesWithoutMargin
|
|
107
|
+
}))));
|
|
108
|
+
};
|
|
109
|
+
const styles = _reactNative.StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
alignSelf: "stretch"
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
var _default = (0, _theming.withTheme)(Picker);
|
|
115
|
+
exports.default = _default;pointerEvents: "none"
|
|
99
116
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
100
117
|
value: selectedLabel,
|
|
101
118
|
placeholder: placeholder
|
|
@@ -7,7 +7,6 @@ exports.default = Pressable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
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); }
|
|
11
10
|
function Pressable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
@@ -20,8 +19,22 @@ function Pressable(_ref) {
|
|
|
20
19
|
style,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
24
23
|
onPress: onPress,
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} onPress: onPress,
|
|
25
38
|
disabled: disabled,
|
|
26
39
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
27
40
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -13,7 +13,6 @@ var _theming = require("../theming");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
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
16
|
function maybeParseValue(value) {
|
|
18
17
|
if (value === undefined) {
|
|
19
18
|
return undefined;
|
|
@@ -73,9 +72,10 @@ function Slider(_ref) {
|
|
|
73
72
|
setInternalValue(newValue);
|
|
74
73
|
onValueChange(newValue);
|
|
75
74
|
};
|
|
76
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
77
|
-
style: [styles.container, style]
|
|
78
|
-
|
|
75
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
76
|
+
style: [styles.container, style],
|
|
77
|
+
...rest
|
|
78
|
+
}, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
|
|
79
79
|
color: leftIconThemeColor,
|
|
80
80
|
name: leftIcon,
|
|
81
81
|
size: 24
|
|
@@ -108,4 +108,21 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
var _default = (0, _theming.withTheme)(Slider);
|
|
111
|
+
exports.default = _default;or: rightIconThemeColor,
|
|
112
|
+
name: rightIcon,
|
|
113
|
+
size: 24
|
|
114
|
+
}) : null);
|
|
115
|
+
}
|
|
116
|
+
const styles = _reactNative.StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
height: 40,
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
alignItems: "center"
|
|
121
|
+
},
|
|
122
|
+
slider: {
|
|
123
|
+
flex: 1,
|
|
124
|
+
marginHorizontal: 12
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
var _default = (0, _theming.withTheme)(Slider);
|
|
111
128
|
exports.default = _default;
|
|
@@ -13,7 +13,6 @@ var _hooks = require("../hooks");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
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
16
|
function Switch(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
value,
|
|
@@ -38,7 +37,6 @@ function Switch(_ref) {
|
|
|
38
37
|
setChecked(value);
|
|
39
38
|
}
|
|
40
39
|
}, [value, checked]);
|
|
41
|
-
|
|
42
40
|
// This special logic is to handle weird APIs like Airtable that return
|
|
43
41
|
// true or undefined for a boolean
|
|
44
42
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -47,24 +45,24 @@ function Switch(_ref) {
|
|
|
47
45
|
setChecked(Boolean(defaultValue));
|
|
48
46
|
}
|
|
49
47
|
}, [defaultValue, previousDefaultValue]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch,
|
|
48
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
51
49
|
value: checked,
|
|
52
50
|
disabled: disabled,
|
|
53
51
|
trackColor: {
|
|
54
52
|
false: inactiveTrackThemeColor,
|
|
55
53
|
true: activeTrackThemeColor
|
|
56
54
|
},
|
|
57
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
55
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
58
56
|
// @ts-ignore react-native-web only
|
|
59
|
-
,
|
|
60
57
|
activeThumbColor: activeThumbThemeColor,
|
|
61
58
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
62
59
|
style: style,
|
|
63
60
|
onValueChange: bool => {
|
|
64
61
|
setChecked(bool);
|
|
65
62
|
onValueChange && onValueChange(bool);
|
|
66
|
-
}
|
|
67
|
-
|
|
63
|
+
},
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
68
66
|
}
|
|
69
67
|
function Row(_ref2) {
|
|
70
68
|
let {
|
|
@@ -93,7 +91,7 @@ function Row(_ref2) {
|
|
|
93
91
|
setChecked(defaultValue);
|
|
94
92
|
}
|
|
95
93
|
}, [defaultValue]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(_FormRow.default,
|
|
94
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
97
95
|
disabled: disabled,
|
|
98
96
|
onPress: () => {
|
|
99
97
|
setChecked(!checked);
|
|
@@ -101,8 +99,9 @@ function Row(_ref2) {
|
|
|
101
99
|
},
|
|
102
100
|
label: label,
|
|
103
101
|
direction: direction,
|
|
104
|
-
style: style
|
|
105
|
-
|
|
102
|
+
style: style,
|
|
103
|
+
...rest
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
106
105
|
theme: theme,
|
|
107
106
|
value: checked,
|
|
108
107
|
disabled: disabled,
|
|
@@ -116,4 +115,14 @@ function Row(_ref2) {
|
|
|
116
115
|
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
117
116
|
exports.SwitchRow = SwitchRow;
|
|
118
117
|
var _default = (0, _theming.withTheme)(Switch);
|
|
118
|
+
exports.default = _default;hange: onValueChange,
|
|
119
|
+
activeTrackColor: activeTrackColor,
|
|
120
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
121
|
+
activeThumbColor: activeThumbColor,
|
|
122
|
+
inactiveThumbColor: inactiveThumbColor
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
126
|
+
exports.SwitchRow = SwitchRow;
|
|
127
|
+
var _default = (0, _theming.withTheme)(Switch);
|
|
119
128
|
exports.default = _default;
|
|
@@ -7,7 +7,6 @@ exports.default = Touchable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
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); }
|
|
11
10
|
function Touchable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
@@ -20,8 +19,22 @@ function Touchable(_ref) {
|
|
|
20
19
|
style,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
24
23
|
disabled: disabled,
|
|
24
|
+
onPress: onPress,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} disabled: disabled,
|
|
25
38
|
onPress: onPress,
|
|
26
39
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
27
40
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
|
|
@@ -5,7 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const SEED_DATA = {
|
|
8
|
+
const SEED_DATA = [{
|
|
9
|
+
name: "Masonry List",
|
|
10
|
+
tag: "MasonryFlashList",
|
|
11
|
+
description: "Masonry Flashlist by Shopify",
|
|
12
|
+
packageName: "@shopify/flash-list",
|
|
13
|
+
category: _types.COMPONENT_TYPES.data,
|
|
14
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
15
|
+
layout: {
|
|
16
|
+
flex: 1
|
|
17
|
+
},
|
|
18
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
19
|
+
props: {
|
|
20
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
21
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
22
|
+
numColumns: (0, _types.createNumColumnsType)({
|
|
23
|
+
editable: true
|
|
24
|
+
}),
|
|
25
|
+
estimatedItemSize: (0, _types.createNumberProp)({
|
|
26
|
+
group: _types.GROUPS.basic,
|
|
27
|
+
label: "Est. Item Size",
|
|
28
|
+
description: "Approximate size of the items before rendering.",
|
|
29
|
+
defaultValue: 50,
|
|
30
|
+
step: 1,
|
|
31
|
+
precision: 0
|
|
32
|
+
}),
|
|
33
|
+
optimizeItemArrangement: (0, _types.createStaticBoolProp)({
|
|
34
|
+
label: "Optimize Item Arrangement",
|
|
35
|
+
description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false."
|
|
36
|
+
}),
|
|
37
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
38
|
+
label: "End Reached Threshold",
|
|
39
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
40
|
+
defaultValue: 0.5
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
9
44
|
name: "FlashList",
|
|
10
45
|
tag: "FlashList",
|
|
11
46
|
description: "Flashlist by Shopify",
|
|
@@ -15,7 +50,10 @@ const SEED_DATA = {
|
|
|
15
50
|
layout: {
|
|
16
51
|
flex: 1
|
|
17
52
|
},
|
|
53
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
18
54
|
props: {
|
|
55
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
56
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
19
57
|
estimatedItemSize: (0, _types.createNumberProp)({
|
|
20
58
|
group: _types.GROUPS.basic,
|
|
21
59
|
label: "Est. Item Size",
|
|
@@ -34,7 +72,12 @@ const SEED_DATA = {
|
|
|
34
72
|
}),
|
|
35
73
|
numColumns: (0, _types.createNumColumnsType)({
|
|
36
74
|
editable: true
|
|
75
|
+
}),
|
|
76
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
77
|
+
label: "End Reached Threshold",
|
|
78
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
79
|
+
defaultValue: 0.5
|
|
37
80
|
})
|
|
38
81
|
}
|
|
39
|
-
};
|
|
82
|
+
}];
|
|
40
83
|
exports.SEED_DATA = SEED_DATA;
|
|
@@ -14,7 +14,10 @@ const SEED_DATA = {
|
|
|
14
14
|
layout: {
|
|
15
15
|
flex: 1
|
|
16
16
|
},
|
|
17
|
+
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
17
18
|
props: {
|
|
19
|
+
onRefresh: (0, _types.createActionProp)(),
|
|
20
|
+
onEndReached: (0, _types.createActionProp)(),
|
|
18
21
|
horizontal: (0, _types.createStaticBoolProp)({
|
|
19
22
|
label: "Horizontal",
|
|
20
23
|
description: "Render list horizontally"
|
|
@@ -25,6 +28,15 @@ const SEED_DATA = {
|
|
|
25
28
|
}),
|
|
26
29
|
numColumns: (0, _types.createNumColumnsType)({
|
|
27
30
|
editable: true
|
|
31
|
+
}),
|
|
32
|
+
initialNumToRender: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Initial Num To Render",
|
|
34
|
+
descriprion: "How many items to render in the initial batch"
|
|
35
|
+
}),
|
|
36
|
+
onEndReachedThreshold: (0, _types.createStaticNumberProp)({
|
|
37
|
+
label: "End Reached Threshold",
|
|
38
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
39
|
+
defaultValue: 0.5
|
|
28
40
|
})
|
|
29
41
|
}
|
|
30
42
|
};
|
|
@@ -48,7 +48,7 @@ const SEED_DATA = [{
|
|
|
48
48
|
name: "Touchable",
|
|
49
49
|
tag: "Touchable",
|
|
50
50
|
description: "An interactive view with no styles",
|
|
51
|
-
category: _types.COMPONENT_TYPES.
|
|
51
|
+
category: _types.COMPONENT_TYPES.button,
|
|
52
52
|
...SEED_DATA_PROPS
|
|
53
53
|
}, {
|
|
54
54
|
name: "Pressable",
|
|
@@ -15,7 +15,6 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
-
|
|
19
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
20
19
|
return elevation.interpolate({
|
|
21
20
|
inputRange,
|
|
@@ -24,7 +23,6 @@ function overlay(elevation) {
|
|
|
24
23
|
})
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
29
27
|
return calculateColor(surfaceColor, elevation);
|
|
30
28
|
}
|
|
@@ -65,4 +63,4 @@ const elevationOverlayTransparency = {
|
|
|
65
63
|
22: 15.72,
|
|
66
64
|
23: 15.84,
|
|
67
65
|
24: 16
|
|
68
|
-
};
|
|
66
|
+
};};
|
|
@@ -57,7 +57,6 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
|
|
|
57
57
|
marginStyles
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
/**
|
|
62
61
|
* Merges a style object on top of another style object. In React Native,
|
|
63
62
|
* keys with undefined values in a style object will still override styles
|
|
@@ -90,4 +89,4 @@ function getValueForRadioButton(value) {
|
|
|
90
89
|
} else {
|
|
91
90
|
throw new Error("Invalid value: ".concat(value));
|
|
92
91
|
}
|
|
93
|
-
}
|
|
92
|
+
}}
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [{
|
|
3
|
+
name: "Masonry List",
|
|
4
|
+
tag: "MasonryFlashList",
|
|
5
|
+
description: "Masonry Flashlist by Shopify",
|
|
6
|
+
packageName: "@shopify/flash-list",
|
|
7
|
+
category: COMPONENT_TYPES.data,
|
|
8
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
9
|
+
layout: {
|
|
10
|
+
flex: 1
|
|
11
|
+
},
|
|
12
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
13
|
+
props: {
|
|
14
|
+
onRefresh: createActionProp(),
|
|
15
|
+
onEndReached: createActionProp(),
|
|
16
|
+
numColumns: createNumColumnsType({
|
|
17
|
+
editable: true
|
|
18
|
+
}),
|
|
19
|
+
estimatedItemSize: createNumberProp({
|
|
20
|
+
group: GROUPS.basic,
|
|
21
|
+
label: "Est. Item Size",
|
|
22
|
+
description: "Approximate size of the items before rendering.",
|
|
23
|
+
defaultValue: 50,
|
|
24
|
+
step: 1,
|
|
25
|
+
precision: 0
|
|
26
|
+
}),
|
|
27
|
+
optimizeItemArrangement: createStaticBoolProp({
|
|
28
|
+
label: "Optimize Item Arrangement",
|
|
29
|
+
description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false."
|
|
30
|
+
}),
|
|
31
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
32
|
+
label: "End Reached Threshold",
|
|
33
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
34
|
+
defaultValue: 0.5
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
3
38
|
name: "FlashList",
|
|
4
39
|
tag: "FlashList",
|
|
5
40
|
description: "Flashlist by Shopify",
|
|
@@ -9,7 +44,10 @@ export const SEED_DATA = {
|
|
|
9
44
|
layout: {
|
|
10
45
|
flex: 1
|
|
11
46
|
},
|
|
47
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
12
48
|
props: {
|
|
49
|
+
onRefresh: createActionProp(),
|
|
50
|
+
onEndReached: createActionProp(),
|
|
13
51
|
estimatedItemSize: createNumberProp({
|
|
14
52
|
group: GROUPS.basic,
|
|
15
53
|
label: "Est. Item Size",
|
|
@@ -28,6 +66,11 @@ export const SEED_DATA = {
|
|
|
28
66
|
}),
|
|
29
67
|
numColumns: createNumColumnsType({
|
|
30
68
|
editable: true
|
|
69
|
+
}),
|
|
70
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
71
|
+
label: "End Reached Threshold",
|
|
72
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
73
|
+
defaultValue: 0.5
|
|
31
74
|
})
|
|
32
75
|
}
|
|
33
|
-
};
|
|
76
|
+
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createStaticNumberProp } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "List",
|
|
4
4
|
tag: "FlatList",
|
|
@@ -8,7 +8,10 @@ export const SEED_DATA = {
|
|
|
8
8
|
layout: {
|
|
9
9
|
flex: 1
|
|
10
10
|
},
|
|
11
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
11
12
|
props: {
|
|
13
|
+
onRefresh: createActionProp(),
|
|
14
|
+
onEndReached: createActionProp(),
|
|
12
15
|
horizontal: createStaticBoolProp({
|
|
13
16
|
label: "Horizontal",
|
|
14
17
|
description: "Render list horizontally"
|
|
@@ -19,6 +22,15 @@ export const SEED_DATA = {
|
|
|
19
22
|
}),
|
|
20
23
|
numColumns: createNumColumnsType({
|
|
21
24
|
editable: true
|
|
25
|
+
}),
|
|
26
|
+
initialNumToRender: createStaticBoolProp({
|
|
27
|
+
label: "Initial Num To Render",
|
|
28
|
+
descriprion: "How many items to render in the initial batch"
|
|
29
|
+
}),
|
|
30
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
31
|
+
label: "End Reached Threshold",
|
|
32
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
33
|
+
defaultValue: 0.5
|
|
22
34
|
})
|
|
23
35
|
}
|
|
24
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SEED_DATA: {
|
|
1
|
+
export declare const SEED_DATA: ({
|
|
2
2
|
name: string;
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
@@ -8,7 +8,105 @@ export declare const SEED_DATA: {
|
|
|
8
8
|
layout: {
|
|
9
9
|
flex: number;
|
|
10
10
|
};
|
|
11
|
+
triggers: string[];
|
|
11
12
|
props: {
|
|
13
|
+
onRefresh: {
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
editable: boolean;
|
|
17
|
+
required: boolean;
|
|
18
|
+
formType: string;
|
|
19
|
+
propType: string;
|
|
20
|
+
defaultValue: null;
|
|
21
|
+
group: string;
|
|
22
|
+
};
|
|
23
|
+
onEndReached: {
|
|
24
|
+
label: string;
|
|
25
|
+
description: string;
|
|
26
|
+
editable: boolean;
|
|
27
|
+
required: boolean;
|
|
28
|
+
formType: string;
|
|
29
|
+
propType: string;
|
|
30
|
+
defaultValue: null;
|
|
31
|
+
group: string;
|
|
32
|
+
};
|
|
33
|
+
numColumns: {
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
group: string;
|
|
37
|
+
formType: string;
|
|
38
|
+
propType: string;
|
|
39
|
+
defaultValue: number;
|
|
40
|
+
editable: boolean;
|
|
41
|
+
required: boolean;
|
|
42
|
+
};
|
|
43
|
+
estimatedItemSize: {
|
|
44
|
+
label: string;
|
|
45
|
+
description: string;
|
|
46
|
+
formType: string;
|
|
47
|
+
propType: string;
|
|
48
|
+
group: string;
|
|
49
|
+
defaultValue: null;
|
|
50
|
+
editable: boolean;
|
|
51
|
+
required: boolean;
|
|
52
|
+
step: number;
|
|
53
|
+
};
|
|
54
|
+
optimizeItemArrangement: {
|
|
55
|
+
label: string;
|
|
56
|
+
description: string;
|
|
57
|
+
formType: string;
|
|
58
|
+
propType: string;
|
|
59
|
+
defaultValue: boolean;
|
|
60
|
+
editable: boolean;
|
|
61
|
+
required: boolean;
|
|
62
|
+
group: string;
|
|
63
|
+
};
|
|
64
|
+
onEndReachedThreshold: {
|
|
65
|
+
label: string;
|
|
66
|
+
description: string;
|
|
67
|
+
formType: string;
|
|
68
|
+
propType: string;
|
|
69
|
+
group: string;
|
|
70
|
+
defaultValue: null;
|
|
71
|
+
editable: boolean;
|
|
72
|
+
required: boolean;
|
|
73
|
+
step: number;
|
|
74
|
+
};
|
|
75
|
+
horizontal?: undefined;
|
|
76
|
+
inverted?: undefined;
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
tag: string;
|
|
81
|
+
description: string;
|
|
82
|
+
packageName: string;
|
|
83
|
+
category: string;
|
|
84
|
+
stylesPanelSections: string[];
|
|
85
|
+
layout: {
|
|
86
|
+
flex: number;
|
|
87
|
+
};
|
|
88
|
+
triggers: string[];
|
|
89
|
+
props: {
|
|
90
|
+
onRefresh: {
|
|
91
|
+
label: string;
|
|
92
|
+
description: string;
|
|
93
|
+
editable: boolean;
|
|
94
|
+
required: boolean;
|
|
95
|
+
formType: string;
|
|
96
|
+
propType: string;
|
|
97
|
+
defaultValue: null;
|
|
98
|
+
group: string;
|
|
99
|
+
};
|
|
100
|
+
onEndReached: {
|
|
101
|
+
label: string;
|
|
102
|
+
description: string;
|
|
103
|
+
editable: boolean;
|
|
104
|
+
required: boolean;
|
|
105
|
+
formType: string;
|
|
106
|
+
propType: string;
|
|
107
|
+
defaultValue: null;
|
|
108
|
+
group: string;
|
|
109
|
+
};
|
|
12
110
|
estimatedItemSize: {
|
|
13
111
|
label: string;
|
|
14
112
|
description: string;
|
|
@@ -50,6 +148,18 @@ export declare const SEED_DATA: {
|
|
|
50
148
|
editable: boolean;
|
|
51
149
|
required: boolean;
|
|
52
150
|
};
|
|
151
|
+
onEndReachedThreshold: {
|
|
152
|
+
label: string;
|
|
153
|
+
description: string;
|
|
154
|
+
formType: string;
|
|
155
|
+
propType: string;
|
|
156
|
+
group: string;
|
|
157
|
+
defaultValue: null;
|
|
158
|
+
editable: boolean;
|
|
159
|
+
required: boolean;
|
|
160
|
+
step: number;
|
|
161
|
+
};
|
|
162
|
+
optimizeItemArrangement?: undefined;
|
|
53
163
|
};
|
|
54
|
-
};
|
|
164
|
+
})[];
|
|
55
165
|
//# sourceMappingURL=FlashList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlashList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlashList.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgFrB,CAAC"}
|
|
@@ -7,7 +7,28 @@ export declare const SEED_DATA: {
|
|
|
7
7
|
layout: {
|
|
8
8
|
flex: number;
|
|
9
9
|
};
|
|
10
|
+
triggers: string[];
|
|
10
11
|
props: {
|
|
12
|
+
onRefresh: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
editable: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
formType: string;
|
|
18
|
+
propType: string;
|
|
19
|
+
defaultValue: null;
|
|
20
|
+
group: string;
|
|
21
|
+
};
|
|
22
|
+
onEndReached: {
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
editable: boolean;
|
|
26
|
+
required: boolean;
|
|
27
|
+
formType: string;
|
|
28
|
+
propType: string;
|
|
29
|
+
defaultValue: null;
|
|
30
|
+
group: string;
|
|
31
|
+
};
|
|
11
32
|
horizontal: {
|
|
12
33
|
label: string;
|
|
13
34
|
description: string;
|
|
@@ -38,6 +59,27 @@ export declare const SEED_DATA: {
|
|
|
38
59
|
editable: boolean;
|
|
39
60
|
required: boolean;
|
|
40
61
|
};
|
|
62
|
+
initialNumToRender: {
|
|
63
|
+
label: string;
|
|
64
|
+
description: string;
|
|
65
|
+
formType: string;
|
|
66
|
+
propType: string;
|
|
67
|
+
defaultValue: boolean;
|
|
68
|
+
editable: boolean;
|
|
69
|
+
required: boolean;
|
|
70
|
+
group: string;
|
|
71
|
+
};
|
|
72
|
+
onEndReachedThreshold: {
|
|
73
|
+
label: string;
|
|
74
|
+
description: string;
|
|
75
|
+
formType: string;
|
|
76
|
+
propType: string;
|
|
77
|
+
group: string;
|
|
78
|
+
defaultValue: null;
|
|
79
|
+
editable: boolean;
|
|
80
|
+
required: boolean;
|
|
81
|
+
step: number;
|
|
82
|
+
};
|
|
41
83
|
};
|
|
42
84
|
};
|
|
43
85
|
//# sourceMappingURL=FlatList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "47.0.1-
|
|
3
|
+
"version": "47.0.1-c25493.2+c254933",
|
|
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": "^47.0.1-
|
|
44
|
+
"@draftbit/types": "^47.0.1-c25493.2+c254933",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "c254933fb39b42a02182270c6e2e86160a09c52f"
|
|
95
95
|
}
|
|
@@ -1,33 +1,79 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, createNumberProp, CONTAINER_COMPONENT_STYLES_SECTIONS, GROUPS, Triggers, createActionProp, createStaticNumberProp, } from "@draftbit/types";
|
|
2
|
+
export const SEED_DATA = [
|
|
3
|
+
{
|
|
4
|
+
name: "Masonry List",
|
|
5
|
+
tag: "MasonryFlashList",
|
|
6
|
+
description: "Masonry Flashlist by Shopify",
|
|
7
|
+
packageName: "@shopify/flash-list",
|
|
8
|
+
category: COMPONENT_TYPES.data,
|
|
9
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
10
|
+
layout: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
},
|
|
13
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
14
|
+
props: {
|
|
15
|
+
onRefresh: createActionProp(),
|
|
16
|
+
onEndReached: createActionProp(),
|
|
17
|
+
numColumns: createNumColumnsType({
|
|
18
|
+
editable: true,
|
|
19
|
+
}),
|
|
20
|
+
estimatedItemSize: createNumberProp({
|
|
21
|
+
group: GROUPS.basic,
|
|
22
|
+
label: "Est. Item Size",
|
|
23
|
+
description: "Approximate size of the items before rendering.",
|
|
24
|
+
defaultValue: 50,
|
|
25
|
+
step: 1,
|
|
26
|
+
precision: 0,
|
|
27
|
+
}),
|
|
28
|
+
optimizeItemArrangement: createStaticBoolProp({
|
|
29
|
+
label: "Optimize Item Arrangement",
|
|
30
|
+
description: "If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false.",
|
|
31
|
+
}),
|
|
32
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
33
|
+
label: "End Reached Threshold",
|
|
34
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
35
|
+
defaultValue: 0.5,
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
11
38
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
{
|
|
40
|
+
name: "FlashList",
|
|
41
|
+
tag: "FlashList",
|
|
42
|
+
description: "Flashlist by Shopify",
|
|
43
|
+
packageName: "@shopify/flash-list",
|
|
44
|
+
category: COMPONENT_TYPES.data,
|
|
45
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
46
|
+
layout: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
},
|
|
49
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
50
|
+
props: {
|
|
51
|
+
onRefresh: createActionProp(),
|
|
52
|
+
onEndReached: createActionProp(),
|
|
53
|
+
estimatedItemSize: createNumberProp({
|
|
54
|
+
group: GROUPS.basic,
|
|
55
|
+
label: "Est. Item Size",
|
|
56
|
+
description: "Approximate size of the items before rendering.",
|
|
57
|
+
defaultValue: 50,
|
|
58
|
+
step: 1,
|
|
59
|
+
precision: 0,
|
|
60
|
+
}),
|
|
61
|
+
horizontal: createStaticBoolProp({
|
|
62
|
+
label: "Horizontal",
|
|
63
|
+
description: "Render list horizontally",
|
|
64
|
+
}),
|
|
65
|
+
inverted: createStaticBoolProp({
|
|
66
|
+
label: "Inverted",
|
|
67
|
+
description: "If true, reverses the direction.",
|
|
68
|
+
}),
|
|
69
|
+
numColumns: createNumColumnsType({
|
|
70
|
+
editable: true,
|
|
71
|
+
}),
|
|
72
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
73
|
+
label: "End Reached Threshold",
|
|
74
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
75
|
+
defaultValue: 0.5,
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
32
78
|
},
|
|
33
|
-
|
|
79
|
+
];
|
|
@@ -5,37 +5,89 @@ import {
|
|
|
5
5
|
createNumberProp,
|
|
6
6
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
7
7
|
GROUPS,
|
|
8
|
+
Triggers,
|
|
9
|
+
createActionProp,
|
|
10
|
+
createStaticNumberProp,
|
|
8
11
|
} from "@draftbit/types";
|
|
9
12
|
|
|
10
|
-
export const SEED_DATA =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export const SEED_DATA = [
|
|
14
|
+
{
|
|
15
|
+
name: "Masonry List",
|
|
16
|
+
tag: "MasonryFlashList",
|
|
17
|
+
description: "Masonry Flashlist by Shopify",
|
|
18
|
+
packageName: "@shopify/flash-list",
|
|
19
|
+
category: COMPONENT_TYPES.data,
|
|
20
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
21
|
+
layout: {
|
|
22
|
+
flex: 1,
|
|
23
|
+
},
|
|
24
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
25
|
+
props: {
|
|
26
|
+
onRefresh: createActionProp(),
|
|
27
|
+
onEndReached: createActionProp(),
|
|
28
|
+
numColumns: createNumColumnsType({
|
|
29
|
+
editable: true,
|
|
30
|
+
}),
|
|
31
|
+
estimatedItemSize: createNumberProp({
|
|
32
|
+
group: GROUPS.basic,
|
|
33
|
+
label: "Est. Item Size",
|
|
34
|
+
description: "Approximate size of the items before rendering.",
|
|
35
|
+
defaultValue: 50,
|
|
36
|
+
step: 1,
|
|
37
|
+
precision: 0,
|
|
38
|
+
}),
|
|
39
|
+
optimizeItemArrangement: createStaticBoolProp({
|
|
40
|
+
label: "Optimize Item Arrangement",
|
|
41
|
+
description:
|
|
42
|
+
"If enabled, MasonryFlashList will try to reduce difference in column height by modifying item order. If true, specifying overrideItemLayout is required. Default value is false.",
|
|
43
|
+
}),
|
|
44
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
45
|
+
label: "End Reached Threshold",
|
|
46
|
+
description:
|
|
47
|
+
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
48
|
+
defaultValue: 0.5,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
19
51
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
{
|
|
53
|
+
name: "FlashList",
|
|
54
|
+
tag: "FlashList",
|
|
55
|
+
description: "Flashlist by Shopify",
|
|
56
|
+
packageName: "@shopify/flash-list",
|
|
57
|
+
category: COMPONENT_TYPES.data,
|
|
58
|
+
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
59
|
+
layout: {
|
|
60
|
+
flex: 1,
|
|
61
|
+
},
|
|
62
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
63
|
+
props: {
|
|
64
|
+
onRefresh: createActionProp(),
|
|
65
|
+
onEndReached: createActionProp(),
|
|
66
|
+
estimatedItemSize: createNumberProp({
|
|
67
|
+
group: GROUPS.basic,
|
|
68
|
+
label: "Est. Item Size",
|
|
69
|
+
description: "Approximate size of the items before rendering.",
|
|
70
|
+
defaultValue: 50,
|
|
71
|
+
step: 1,
|
|
72
|
+
precision: 0,
|
|
73
|
+
}),
|
|
74
|
+
horizontal: createStaticBoolProp({
|
|
75
|
+
label: "Horizontal",
|
|
76
|
+
description: "Render list horizontally",
|
|
77
|
+
}),
|
|
78
|
+
inverted: createStaticBoolProp({
|
|
79
|
+
label: "Inverted",
|
|
80
|
+
description: "If true, reverses the direction.",
|
|
81
|
+
}),
|
|
82
|
+
numColumns: createNumColumnsType({
|
|
83
|
+
editable: true,
|
|
84
|
+
}),
|
|
85
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
86
|
+
label: "End Reached Threshold",
|
|
87
|
+
description:
|
|
88
|
+
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
89
|
+
defaultValue: 0.5,
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
40
92
|
},
|
|
41
|
-
|
|
93
|
+
];
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createNumColumnsType, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createStaticNumberProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "List",
|
|
4
4
|
tag: "FlatList",
|
|
@@ -8,7 +8,10 @@ export const SEED_DATA = {
|
|
|
8
8
|
layout: {
|
|
9
9
|
flex: 1,
|
|
10
10
|
},
|
|
11
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
11
12
|
props: {
|
|
13
|
+
onRefresh: createActionProp(),
|
|
14
|
+
onEndReached: createActionProp(),
|
|
12
15
|
horizontal: createStaticBoolProp({
|
|
13
16
|
label: "Horizontal",
|
|
14
17
|
description: "Render list horizontally",
|
|
@@ -20,5 +23,14 @@ export const SEED_DATA = {
|
|
|
20
23
|
numColumns: createNumColumnsType({
|
|
21
24
|
editable: true,
|
|
22
25
|
}),
|
|
26
|
+
initialNumToRender: createStaticBoolProp({
|
|
27
|
+
label: "Initial Num To Render",
|
|
28
|
+
descriprion: "How many items to render in the initial batch",
|
|
29
|
+
}),
|
|
30
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
31
|
+
label: "End Reached Threshold",
|
|
32
|
+
description: "How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
33
|
+
defaultValue: 0.5,
|
|
34
|
+
}),
|
|
23
35
|
},
|
|
24
36
|
};
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
createNumColumnsType,
|
|
4
4
|
createStaticBoolProp,
|
|
5
5
|
CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
6
|
+
Triggers,
|
|
7
|
+
createActionProp,
|
|
8
|
+
createStaticNumberProp,
|
|
6
9
|
} from "@draftbit/types";
|
|
7
10
|
|
|
8
11
|
export const SEED_DATA = {
|
|
@@ -14,7 +17,10 @@ export const SEED_DATA = {
|
|
|
14
17
|
layout: {
|
|
15
18
|
flex: 1,
|
|
16
19
|
},
|
|
20
|
+
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
17
21
|
props: {
|
|
22
|
+
onRefresh: createActionProp(),
|
|
23
|
+
onEndReached: createActionProp(),
|
|
18
24
|
horizontal: createStaticBoolProp({
|
|
19
25
|
label: "Horizontal",
|
|
20
26
|
description: "Render list horizontally",
|
|
@@ -26,5 +32,15 @@ export const SEED_DATA = {
|
|
|
26
32
|
numColumns: createNumColumnsType({
|
|
27
33
|
editable: true,
|
|
28
34
|
}),
|
|
35
|
+
initialNumToRender: createStaticBoolProp({
|
|
36
|
+
label: "Initial Num To Render",
|
|
37
|
+
descriprion: "How many items to render in the initial batch",
|
|
38
|
+
}),
|
|
39
|
+
onEndReachedThreshold: createStaticNumberProp({
|
|
40
|
+
label: "End Reached Threshold",
|
|
41
|
+
description:
|
|
42
|
+
"How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the onEndReached callback. Thus a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.",
|
|
43
|
+
defaultValue: 0.5,
|
|
44
|
+
}),
|
|
29
45
|
},
|
|
30
46
|
};
|