@draftbit/core 47.0.1-d41acb.2 → 47.0.1-d5418f.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/CircularProgress.js +26 -8
- 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/module/components/RadioButton/RadioButtonRow.js +24 -5
- 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/components/Pressable.d.ts +1 -7
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +1 -7
- package/lib/typescript/src/components/Touchable.d.ts.map +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/components/Pressable.tsx +0 -6
- package/src/components/Touchable.tsx +0 -6
- 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
|
@@ -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;
|
|
@@ -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",
|
|
@@ -1,4 +1,3 @@
|
|
|
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
|
import * as React from "react";
|
|
3
2
|
import { StyleSheet, View, Platform } from "react-native";
|
|
4
3
|
import RadioButton from "./RadioButton";
|
|
@@ -7,7 +6,7 @@ import { useRadioButtonGroupContext } from "./context";
|
|
|
7
6
|
import { Direction as GroupDirection } from "./context";
|
|
8
7
|
import Touchable from "../Touchable";
|
|
9
8
|
import { extractStyles, getValueForRadioButton } from "../../utilities";
|
|
10
|
-
export
|
|
9
|
+
export var Direction;
|
|
11
10
|
(function (Direction) {
|
|
12
11
|
Direction["Row"] = "row";
|
|
13
12
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -63,13 +62,14 @@ const RadioButtonRow = _ref => {
|
|
|
63
62
|
textStyles,
|
|
64
63
|
viewStyles
|
|
65
64
|
} = extractStyles(style);
|
|
66
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
65
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
onPress: handlePress,
|
|
68
67
|
style: [styles.mainParent, {
|
|
69
68
|
flexDirection: direction
|
|
70
69
|
}, viewStyles],
|
|
71
|
-
disabled: disabled
|
|
72
|
-
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
...rest
|
|
72
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
73
73
|
style: [styles.label, {
|
|
74
74
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
75
75
|
}, labelContainerStyle]
|
|
@@ -106,4 +106,23 @@ const styles = StyleSheet.create({
|
|
|
106
106
|
flex: 3
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
export default RadioButtonRow;.create({
|
|
110
|
+
mainParent: {
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "space-around",
|
|
113
|
+
paddingStart: 20,
|
|
114
|
+
minHeight: 50,
|
|
115
|
+
paddingEnd: 20,
|
|
116
|
+
display: "flex",
|
|
117
|
+
...Platform.select({
|
|
118
|
+
web: {
|
|
119
|
+
cursor: "pointer",
|
|
120
|
+
userSelect: "none"
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
label: {
|
|
125
|
+
flex: 3
|
|
126
|
+
}
|
|
127
|
+
});
|
|
109
128
|
export default RadioButtonRow;
|
|
@@ -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,13 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { PressableProps, ViewStyle } from "react-native";
|
|
3
3
|
declare type Props = {
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
children: React.ReactNode;
|
|
6
4
|
style?: ViewStyle;
|
|
7
|
-
onPress?: () => void;
|
|
8
|
-
onLongPress?: () => void;
|
|
9
|
-
delayLongPress?: number;
|
|
10
|
-
hitSlop?: number;
|
|
11
5
|
activeOpacity?: number;
|
|
12
6
|
disabledOpacity?: number;
|
|
13
7
|
} & PressableProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { PressableProps, ViewStyle } from "react-native";
|
|
3
3
|
declare type Props = {
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
children: React.ReactNode;
|
|
6
4
|
style?: ViewStyle;
|
|
7
|
-
onPress?: () => void;
|
|
8
|
-
onLongPress?: () => void;
|
|
9
|
-
delayLongPress?: number;
|
|
10
|
-
hitSlop?: number;
|
|
11
5
|
activeOpacity?: number;
|
|
12
6
|
disabledOpacity?: number;
|
|
13
7
|
} & PressableProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Touchable.d.ts","sourceRoot":"","sources":["../../../../src/components/Touchable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,eAoBP"}
|
|
@@ -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-d5418f.2+d5418f3",
|
|
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-d5418f.2+d5418f3",
|
|
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": "d5418f383a8811ca2dc7b9c66df5d823f66e5f28"
|
|
95
95
|
}
|
|
@@ -6,13 +6,7 @@ import {
|
|
|
6
6
|
} from "react-native";
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
children: React.ReactNode;
|
|
11
9
|
style?: ViewStyle;
|
|
12
|
-
onPress?: () => void;
|
|
13
|
-
onLongPress?: () => void;
|
|
14
|
-
delayLongPress?: number;
|
|
15
|
-
hitSlop?: number;
|
|
16
10
|
activeOpacity?: number;
|
|
17
11
|
disabledOpacity?: number;
|
|
18
12
|
} & PressableProps;
|
|
@@ -2,13 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Pressable, PressableProps, ViewStyle } from "react-native";
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
children: React.ReactNode;
|
|
7
5
|
style?: ViewStyle;
|
|
8
|
-
onPress?: () => void;
|
|
9
|
-
onLongPress?: () => void;
|
|
10
|
-
delayLongPress?: number;
|
|
11
|
-
hitSlop?: number;
|
|
12
6
|
activeOpacity?: number;
|
|
13
7
|
disabledOpacity?: number;
|
|
14
8
|
} & PressableProps;
|
|
@@ -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
|
};
|