@draftbit/core 46.11.5-d49547.2 → 46.11.5-f65e23.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/BottomSheet/BottomSheet.js +18 -3
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/mappings/BottomSheet.js +37 -9
- package/lib/commonjs/mappings/BottomSheet.js.map +1 -1
- package/lib/commonjs/mappings/FlatList.js +0 -3
- package/lib/commonjs/mappings/FlatList.js.map +1 -1
- package/lib/commonjs/mappings/SwipeableView.js +8 -7
- package/lib/commonjs/mappings/SwipeableView.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +18 -3
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/components/StarRating.js +4 -23
- package/lib/module/components/StarRating.js.map +1 -1
- package/lib/module/constants.js +1 -1
- package/lib/module/mappings/BottomSheet.js +38 -10
- package/lib/module/mappings/BottomSheet.js.map +1 -1
- package/lib/module/mappings/FlatList.js +0 -3
- package/lib/module/mappings/FlatList.js.map +1 -1
- package/lib/module/mappings/SwipeableView.js +6 -6
- package/lib/module/mappings/SwipeableView.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +6 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +48 -4
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +0 -3
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwipeableView.d.ts +55 -0
- package/lib/typescript/src/mappings/SwipeableView.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.js +17 -2
- package/src/components/BottomSheet/BottomSheet.tsx +32 -4
- package/src/mappings/BottomSheet.js +37 -9
- package/src/mappings/BottomSheet.ts +43 -8
- package/src/mappings/FlatList.js +0 -3
- package/src/mappings/FlatList.ts +0 -3
- package/src/mappings/SwipeableView.js +6 -6
- package/src/mappings/SwipeableView.ts +6 -6
|
@@ -13,8 +13,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
13
13
|
const BottomSheet = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
theme,
|
|
16
|
-
snapPoints
|
|
17
|
-
|
|
16
|
+
snapPoints: snapPointsProp,
|
|
17
|
+
topSnapPosition = "10%",
|
|
18
|
+
middleSnapPosition = "50%",
|
|
19
|
+
bottomSnapPosition = "80%",
|
|
20
|
+
initialSnapIndex,
|
|
21
|
+
initialSnapPosition = "bottom",
|
|
18
22
|
showHandle = true,
|
|
19
23
|
handleColor = theme.colors.divider,
|
|
20
24
|
topBorderRadius = 20,
|
|
@@ -26,13 +30,24 @@ const BottomSheet = _ref => {
|
|
|
26
30
|
...rest
|
|
27
31
|
} = _ref;
|
|
28
32
|
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
33
|
+
const snapPoints = snapPointsProp || [topSnapPosition, middleSnapPosition, bottomSnapPosition];
|
|
34
|
+
const getSnapIndexFromPosition = position => {
|
|
35
|
+
switch (position) {
|
|
36
|
+
case "top":
|
|
37
|
+
return 0;
|
|
38
|
+
case "middle":
|
|
39
|
+
return 1;
|
|
40
|
+
case "bottom":
|
|
41
|
+
return 2;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
29
44
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
45
|
style: styles.parentContainer,
|
|
31
46
|
pointerEvents: "box-none"
|
|
32
47
|
}, /*#__PURE__*/_react.default.createElement(_BottomSheetComponent.default, _extends({
|
|
33
48
|
componentType: "ScrollView",
|
|
34
49
|
snapPoints: snapPoints,
|
|
35
|
-
initialSnapIndex: initialSnapIndex,
|
|
50
|
+
initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition),
|
|
36
51
|
renderHandle: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showHandle && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
37
52
|
style: [styles.handleContainer, {
|
|
38
53
|
backgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","theme","snapPoints","initialSnapIndex","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","StyleSheet","flatten","containerStyle","create","
|
|
1
|
+
{"version":3,"names":["BottomSheet","theme","snapPoints","snapPointsProp","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","getSnapIndexFromPosition","position","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","StyleSheet","flatten","containerStyle","create","left","right","top","bottom","zIndex","overflow","paddingHorizontal","paddingVertical","flex","alignItems","width","height","borderRadius","withTheme"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/BottomSheet.tsx"],"mappings":";;;;;;AAAA;AACA;AAQA;AAEA;AAA0C;AAAA;AAoB1C,MAAMA,WAAgE,GAAG,QAiBnE;EAAA,IAjBoE;IACxEC,KAAK;IACLC,UAAU,EAAEC,cAAc;IAC1BC,eAAe,GAAG,KAAK;IACvBC,kBAAkB,GAAG,KAAK;IAC1BC,kBAAkB,GAAG,KAAK;IAC1BC,gBAAgB;IAChBC,mBAAmB,GAAG,QAAQ;IAC9BC,UAAU,GAAG,IAAI;IACjBC,WAAW,GAAGT,KAAK,CAACU,MAAM,CAACC,OAAO;IAClCC,eAAe,GAAG,EAAE;IACpBC,WAAW,GAAG,CAAC;IACfC,WAAW,GAAGd,KAAK,CAACU,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oB,EAAEf,eAAe;MACrCC,WAAW;MACXC;IACF,CAAC,CACF,CAAE;IACH,QAAQ,EAAEC;EAAS,GACfG,IAAI,GAEPD,QAAQ,CACY,CAClB;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGO,uBAAU,CAACG,MAAM,CAAC;EAC/B;EACAT,eAAe,EAAE;IACfF,QAAQ,EAAE,UAAU;IACpBY,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE,EAAE;IACVC,QAAQ,EAAE;EACZ,CAAC;EACDV,qBAAqB,EAAE;IACrBW,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDT,cAAc,EAAE;IACdU,IAAI,EAAE,CAAC;IACPH,QAAQ,EAAE;EACZ,CAAC;EACDd,eAAe,EAAE;IACfkB,UAAU,EAAE,QAAQ;IACpBF,eAAe,EAAE;EACnB,CAAC;EACDb,MAAM,EAAE;IACNgB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,eAEY,IAAAC,kBAAS,EAAChD,WAAW,CAAC;AAAA"}
|
|
@@ -17,16 +17,32 @@ const SEED_DATA = {
|
|
|
17
17
|
label: "On settle",
|
|
18
18
|
description: "Action to execute when sheet settles on a snap point"
|
|
19
19
|
}),
|
|
20
|
-
|
|
21
|
-
label: "
|
|
22
|
-
description: "
|
|
23
|
-
defaultValue:
|
|
20
|
+
topSnapPosition: (0, _types.createStaticNumberProp)({
|
|
21
|
+
label: "Top snap position",
|
|
22
|
+
description: "Top most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
23
|
+
defaultValue: "10%",
|
|
24
|
+
required: false,
|
|
25
|
+
formType: _types.FORM_TYPES.numeric
|
|
24
26
|
}),
|
|
25
|
-
|
|
26
|
-
label: "
|
|
27
|
-
description: "
|
|
28
|
-
defaultValue:
|
|
29
|
-
required: false
|
|
27
|
+
middleSnapPosition: (0, _types.createStaticNumberProp)({
|
|
28
|
+
label: "Middle snap position",
|
|
29
|
+
description: "Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
30
|
+
defaultValue: "50%",
|
|
31
|
+
required: false,
|
|
32
|
+
formType: _types.FORM_TYPES.numeric
|
|
33
|
+
}),
|
|
34
|
+
bottomSnapPosition: (0, _types.createStaticNumberProp)({
|
|
35
|
+
label: "Bottom snap position",
|
|
36
|
+
description: "Bottom most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
37
|
+
defaultValue: "80%",
|
|
38
|
+
required: false,
|
|
39
|
+
formType: _types.FORM_TYPES.numeric
|
|
40
|
+
}),
|
|
41
|
+
initialSnapPosition: (0, _types.createTextEnumProp)({
|
|
42
|
+
label: "Initial snap position",
|
|
43
|
+
description: "Initial snap position that bottom sheet will snap to",
|
|
44
|
+
options: ["top", "middle", "bottom"],
|
|
45
|
+
defaultValue: "bottom"
|
|
30
46
|
}),
|
|
31
47
|
showHandle: (0, _types.createStaticBoolProp)({
|
|
32
48
|
label: "Show handle",
|
|
@@ -64,6 +80,18 @@ const SEED_DATA = {
|
|
|
64
80
|
label: "Bounce",
|
|
65
81
|
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
66
82
|
defaultValue: true
|
|
83
|
+
}),
|
|
84
|
+
snapPoints: (0, _types.createArrayProp)({
|
|
85
|
+
label: "Custom Snap points",
|
|
86
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to. Accepts numbers and percentages (minimum 2 snap points). Overrides snap position props",
|
|
87
|
+
defaultValue: null
|
|
88
|
+
}),
|
|
89
|
+
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
90
|
+
label: "Initial snap index",
|
|
91
|
+
description: "Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
92
|
+
defaultValue: null,
|
|
93
|
+
required: false,
|
|
94
|
+
group: _types.GROUPS.advanced
|
|
67
95
|
})
|
|
68
96
|
}
|
|
69
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","bottomsheet","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","triggers","Triggers","OnSettle","props","onSettle","createActionProp","label","
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","bottomsheet","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","triggers","Triggers","OnSettle","props","onSettle","createActionProp","label","topSnapPosition","createStaticNumberProp","defaultValue","required","formType","FORM_TYPES","numeric","middleSnapPosition","bottomSnapPosition","initialSnapPosition","createTextEnumProp","options","showHandle","createStaticBoolProp","handleColor","createColorProp","topBorderRadius","borderWidth","borderColor","showsVerticalScrollIndicator","bounces","snapPoints","createArrayProp","initialSnapIndex","group","GROUPS","advanced"],"sourceRoot":"../../../src","sources":["mappings/BottomSheet.ts"],"mappings":";;;;;;AAAA;AAcO,MAAMA,SAAS,GAAG;EACvBC,IAAI,EAAE,cAAc;EACpBC,GAAG,EAAE,aAAa;EAClBC,WAAW,EACT,wFAAwF;EAC1FC,QAAQ,EAAEC,sBAAe,CAACC,WAAW;EACrCC,mBAAmB,EAAEC,0CAAmC;EACxDC,QAAQ,EAAE,CAACC,eAAQ,CAACC,QAAQ,CAAC;EAC7BC,KAAK,EAAE;IACLC,QAAQ,EAAE,IAAAC,uBAAgB,EAAC;MACzBC,KAAK,EAAE,WAAW;MAClBZ,WAAW,EAAE;IACf,CAAC,CAAC;IACFa,eAAe,EAAE,IAAAC,6BAAsB,EAAC;MACtCF,KAAK,EAAE,mBAAmB;MAC1BZ,WAAW,EACT,0GAA0G;MAC5Ge,YAAY,EAAE,KAAK;MACnBC,QAAQ,EAAE,KAAK;MACfC,QAAQ,EAAEC,iBAAU,CAACC;IACvB,CAAC,CAAC;IACFC,kBAAkB,EAA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AAK,EAAE,cAAc;MACrBZ,WAAW,EAAE,+BAA+B;MAC5Ce,YAAY,EAAE;IAChB,CAAC,CAAC;IACFiB,4BAA4B,EAAE,IAAAN,2BAAoB,EAAC;MACjDd,KAAK,EAAE,gCAAgC;MACvCZ,WAAW,EACT,0EAA0E;MAC5Ee,YAAY,EAAE;IAChB,CAAC,CAAC;IACFkB,OAAO,EAAE,IAAAP,2BAAoB,EAAC;MAC5Bd,KAAK,EAAE,QAAQ;MACfZ,WAAW,EACT,iKAAiK;MACnKe,YAAY,EAAE;IAChB,CAAC,CAAC;IACFmB,UAAU,EAAE,IAAAC,sBAAe,EAAC;MAC1BvB,KAAK,EAAE,oBAAoB;MAC3BZ,WAAW,EACT,4LAA4L;MAC9Le,YAAY,EAAE;IAChB,CAAC,CAAC;IACFqB,gBAAgB,EAAE,IAAAtB,6BAAsB,EAAC;MACvCF,KAAK,EAAE,oBAAoB;MAC3BZ,WAAW,EACT,0FAA0F;MAC5Fe,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,KAAK;MACfqB,KAAK,EAAEC,aAAM,CAACC;IAChB,CAAC;EACH;AACF,CAAC;AAAC"}
|
|
@@ -11,9 +11,6 @@ const SEED_DATA = {
|
|
|
11
11
|
description: "A basic List component",
|
|
12
12
|
category: _types.COMPONENT_TYPES.data,
|
|
13
13
|
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
-
layout: {
|
|
15
|
-
flex: 1
|
|
16
|
-
},
|
|
17
14
|
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
18
15
|
props: {
|
|
19
16
|
onRefresh: (0, _types.createActionProp)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","data","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","
|
|
1
|
+
{"version":3,"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","data","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","triggers","Triggers","OnRefresh","OnEndReached","props","onRefresh","createActionProp","onEndReached","horizontal","createStaticBoolProp","label","inverted","numColumns","createNumColumnsType","editable","initialNumToRender","createStaticNumberProp","defaultValue","onEndReachedThreshold","refreshColor","createColorProp","showsHorizontalScrollIndicator","showsVerticalScrollIndicator"],"sourceRoot":"../../../src","sources":["mappings/FlatList.ts"],"mappings":";;;;;;AAAA;AAWO,MAAMA,SAAS,GAAG;EACvBC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,UAAU;EACfC,WAAW,EAAE,wBAAwB;EACrCC,QAAQ,EAAEC,sBAAe,CAACC,IAAI;EAC9BC,mBAAmB,EAAEC,0CAAmC;EACxDC,QAAQ,EAAE,CAACC,eAAQ,CAACC,SAAS,EAAED,eAAQ,CAACE,YAAY,CAAC;EACrDC,KAAK,EAAE;IACLC,SAAS,EAAE,IAAAC,uBAAgB,GAAE;IAC7BC,YAAY,EAAE,IAAAD,uBAAgB,GAAE;IAChCE,UAAU,EAAE,IAAAC,2BAAoB,EAAC;MAC/BC,KAAK,EAAE,YAAY;MACnBhB,WAAW,EAAE;IACf,CAAC,CAAC;IACFiB,QAAQ,EAAE,IAAAF,2BAAoB,EAAC;MAC7BC,KAAK,EAAE,UAAU;MACjBhB,WAAW,EAAE;IACf,CAAC,CAAC;IACFkB,UAAU,EAAE,IAAAC,2BAAoB,EAAC;MAC/BC,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFC,kBAAkB,EAAE,IAAAC,6BAAsB,EAAC;MACzCN,KAAK,EAAE,uBAAuB;MAC9BhB,WAAW,EAAE,+CAA+C;MAC5DuB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFC,qBAAqB,EAAE,IAAAF,6BAAsB,EAAC;MAC5CN,KAAK,EAAE,uBAAuB;MAC9BhB,WAAW,EACT,8RAA8R;MAChSuB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFE,YAAY,EAAE,IAAAC,sBAAe,EAAC;MAC5BV,KAAK,EAAE,kBAAkB;MACzBhB,WAAW,EAAE;IACf,CAAC,CAAC;IACF2B,8BAA8B,EAAE,IAAAZ,2BAAoB,EAAC;MACnDC,KAAK,EAAE,kCAAkC;MACzChB,WAAW,EACT,4EAA4E;MAC9EuB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFK,4BAA4B,EAAE,IAAAb,2BAAoB,EAAC;MACjDC,KAAK,EAAE,gCAAgC;MACvChB,WAAW,EACT,0EAA0E;MAC5EuB,YAAY,EAAE;IAChB,CAAC;EACH;AACF,CAAC;AAAC"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
6
|
+
exports.SHARED_SEED_DATA_PROPS = exports.SEED_DATA = void 0;
|
|
7
7
|
var _types = require("@draftbit/types");
|
|
8
|
-
const
|
|
8
|
+
const SHARED_SEED_DATA_PROPS = {
|
|
9
9
|
title: (0, _types.createTextProp)({
|
|
10
10
|
label: "Title",
|
|
11
11
|
description: "Title of button/swipeable",
|
|
@@ -41,12 +41,13 @@ const SHARED_SWIPEABLE_CHILDREN_PROPS = {
|
|
|
41
41
|
defaultValue: "surface"
|
|
42
42
|
})
|
|
43
43
|
};
|
|
44
|
+
exports.SHARED_SEED_DATA_PROPS = SHARED_SEED_DATA_PROPS;
|
|
44
45
|
const SEED_DATA = [{
|
|
45
46
|
name: "Swipeable View",
|
|
46
47
|
tag: "SwipeableView",
|
|
47
48
|
doc_link: "https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
48
49
|
description: "A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
49
|
-
category: _types.COMPONENT_TYPES.view
|
|
50
|
+
category: _types.COMPONENT_TYPES.testing /*.view*/,
|
|
50
51
|
stylesPanelSections: [..._types.CONTAINER_COMPONENT_STYLES_SECTIONS, _types.StylesPanelSections.Typography],
|
|
51
52
|
layout: {
|
|
52
53
|
overflow: "hidden",
|
|
@@ -156,22 +157,22 @@ const SEED_DATA = [{
|
|
|
156
157
|
name: "Swipeable View Button",
|
|
157
158
|
tag: "SwipeableViewButton",
|
|
158
159
|
description: "Button to be rendered under a Swipeable View",
|
|
159
|
-
category: _types.COMPONENT_TYPES.view
|
|
160
|
+
category: _types.COMPONENT_TYPES.testing /*.view*/,
|
|
160
161
|
stylesPanelSections: [],
|
|
161
162
|
triggers: [_types.Triggers.OnPress],
|
|
162
163
|
props: {
|
|
163
|
-
...
|
|
164
|
+
...SHARED_SEED_DATA_PROPS,
|
|
164
165
|
onPress: (0, _types.createActionProp)()
|
|
165
166
|
}
|
|
166
167
|
}, {
|
|
167
168
|
name: "Swipeable View Swipe Handler",
|
|
168
169
|
tag: "SwipeableViewSwipeHandler",
|
|
169
170
|
description: "Component that renders and handles swipe of Swipeable View",
|
|
170
|
-
category: _types.COMPONENT_TYPES.view
|
|
171
|
+
category: _types.COMPONENT_TYPES.testing /*.view*/,
|
|
171
172
|
stylesPanelSections: [],
|
|
172
173
|
triggers: [_types.Triggers.OnSwipe],
|
|
173
174
|
props: {
|
|
174
|
-
...
|
|
175
|
+
...SHARED_SEED_DATA_PROPS,
|
|
175
176
|
onSwipe: (0, _types.createActionProp)({
|
|
176
177
|
label: "On swipe",
|
|
177
178
|
description: "Called when Swipeable View swiped in the direction this is configured to"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["SHARED_SEED_DATA_PROPS","title","createTextProp","label","description","defaultValue","required","group","GROUPS","basic","side","createTextEnumProp","options","icon","createIconProp","iconSize","createStaticNumberProp","backgroundColor","createColorProp","color","SEED_DATA","name","tag","doc_link","category","COMPONENT_TYPES","testing","stylesPanelSections","CONTAINER_COMPONENT_STYLES_SECTIONS","StylesPanelSections","Typography","layout","overflow","flexDirection","alignItems","padding","props","closeOnPress","createStaticBoolProp","swipeActivationPercentage","disableLeftSwipe","createBoolProp","disableRightSwipe","leftOpenValue","advanced","rightOpenValue","leftActivationValue","rightActivationValue","stopLeftSwipe","stopRightSwipe","directionalDistanceChangeThreshold","friction","tension","swipeToOpenVelocityContribution","swipeToOpenPercent","swipeToClosePercent","triggers","Triggers","OnPress","onPress","createActionProp","OnSwipe","onSwipe"],"sourceRoot":"../../../src","sources":["mappings/SwipeableView.ts"],"mappings":";;;;;;AAAA;AAgBO,MAAMA,sBAAsB,GAAG;EACpCC,KAAK,EAAE,IAAAC,qBAAc,EAAC;IACpBC,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE,2BAA2B;IACxCC,YAAY,EAAE,WAAW;IACzBC,QAAQ,EAAE,IAAI;IACdC,KAAK,EAAEC,aAAM,CAACC;EAChB,CAAC,CAAC;EACFC,IAAI,EAAE,IAAAC,yBAAkB,EAAC;IACvBR,KAAK,EAAE,MAAM;IACbC,WAAW,EAAE,sCAAsC;IACnDQ,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1BP,YAAY,EAAE,MAAM;IACpBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFO,IAAI,EAAE,IAAAC,qBAAc,EAAC;IACnBT,YAAY,EAAE,IAAI;IAClBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFS,QAAQ,EAAE,IAAAC,6BAAsB,EAAC;IAC/Bb,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,cAAc;IAC3BC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFW,eAAe,EAAE,IAAAC,sBAAe,EAAC;IAC/Bf,KAAK,EAAE,kBAAkB;IACzBC,WAAW,EAAE,sCAAsC;IACnDC,YAAY,EAAE;EAChB,CAAC,CAAC;EACFc,KAAK,EAAE,IAAAD,sBAAe,EAAC;IACrBf,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE,4CAA4C;IACzDC,YAAY,EAAE;EAChB,CAAC;AACH,CAAC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AAmB,EAAE,EAAE;EACvB6B,QAAQ,EAAE,CAACC,eAAQ,CAACI,OAAO,CAAC;EAC5BzB,KAAK,EAAE;IACL,GAAGpC,sBAAsB;IACzB8D,OAAO,EAAE,IAAAF,uBAAgB,EAAC;MACxBzD,KAAK,EAAE,UAAU;MACjBC,WAAW,EACT;IACJ,CAAC;EACH;AACF,CAAC,CACF;AAAC"}
|
|
@@ -6,8 +6,12 @@ import { withTheme } from "../../theming";
|
|
|
6
6
|
const BottomSheet = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
theme,
|
|
9
|
-
snapPoints
|
|
10
|
-
|
|
9
|
+
snapPoints: snapPointsProp,
|
|
10
|
+
topSnapPosition = "10%",
|
|
11
|
+
middleSnapPosition = "50%",
|
|
12
|
+
bottomSnapPosition = "80%",
|
|
13
|
+
initialSnapIndex,
|
|
14
|
+
initialSnapPosition = "bottom",
|
|
11
15
|
showHandle = true,
|
|
12
16
|
handleColor = theme.colors.divider,
|
|
13
17
|
topBorderRadius = 20,
|
|
@@ -19,13 +23,24 @@ const BottomSheet = _ref => {
|
|
|
19
23
|
...rest
|
|
20
24
|
} = _ref;
|
|
21
25
|
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
26
|
+
const snapPoints = snapPointsProp || [topSnapPosition, middleSnapPosition, bottomSnapPosition];
|
|
27
|
+
const getSnapIndexFromPosition = position => {
|
|
28
|
+
switch (position) {
|
|
29
|
+
case "top":
|
|
30
|
+
return 0;
|
|
31
|
+
case "middle":
|
|
32
|
+
return 1;
|
|
33
|
+
case "bottom":
|
|
34
|
+
return 2;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
22
37
|
return /*#__PURE__*/React.createElement(View, {
|
|
23
38
|
style: styles.parentContainer,
|
|
24
39
|
pointerEvents: "box-none"
|
|
25
40
|
}, /*#__PURE__*/React.createElement(BottomSheetComponent, _extends({
|
|
26
41
|
componentType: "ScrollView",
|
|
27
42
|
snapPoints: snapPoints,
|
|
28
|
-
initialSnapIndex: initialSnapIndex,
|
|
43
|
+
initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition),
|
|
29
44
|
renderHandle: () => /*#__PURE__*/React.createElement(React.Fragment, null, showHandle && /*#__PURE__*/React.createElement(View, {
|
|
30
45
|
style: [styles.handleContainer, {
|
|
31
46
|
backgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","BottomSheetComponent","withTheme","BottomSheet","theme","snapPoints","initialSnapIndex","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","flatten","containerStyle","create","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","BottomSheetComponent","withTheme","BottomSheet","theme","snapPoints","snapPointsProp","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","getSnapIndexFromPosition","position","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","flatten","containerStyle","create","left","right","top","bottom","zIndex","overflow","paddingHorizontal","paddingVertical","flex","alignItems","width","height","borderRadius"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/BottomSheet.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,UAAU,EACVC,IAAI,QAIC,cAAc;AAErB,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,SAASC,SAAS,QAAQ,eAAe;AAoBzC,MAAMC,WAAgE,GAAG,QAiBnE;EAAA,IAjBoE;IACxEC,KAAK;IACLC,UAAU,EAAEC,cAAc;IAC1BC,eAAe,GAAG,KAAK;IACvBC,kBAAkB,GAAG,KAAK;IAC1BC,kBAAkB,GA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ACzD,CAEL,CAEH;IACF,qBAAqB,EAAE,CAACc,MAAM,CAACM,qBAAqB,EAAEb,KAAK,CAAE;IAC7D,cAAc,EAAErB,UAAU,CAACmC,OAAO,CAAC,CACjCP,MAAM,CAACQ,cAAc,EACrB;MACEZ,eAAe;MACfO,mBAAmB,EAAEd,eAAe;MACpCe,oBAAoB,EAAEf,eAAe;MACrCC,WAAW;MACXC;IACF,CAAC,CACF,CAAE;IACH,QAAQ,EAAEC;EAAS,GACfG,IAAI,GAEPD,QAAQ,CACY,CAClB;AAEX,CAAC;AAED,MAAMM,MAAM,GAAG5B,UAAU,CAACqC,MAAM,CAAC;EAC/B;EACAR,eAAe,EAAE;IACfF,QAAQ,EAAE,UAAU;IACpBW,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE,EAAE;IACVC,QAAQ,EAAE;EACZ,CAAC;EACDT,qBAAqB,EAAE;IACrBU,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDT,cAAc,EAAE;IACdU,IAAI,EAAE,CAAC;IACPH,QAAQ,EAAE;EACZ,CAAC;EACDb,eAAe,EAAE;IACfiB,UAAU,EAAE,QAAQ;IACpBF,eAAe,EAAE;EACnB,CAAC;EACDZ,MAAM,EAAE;IACNe,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAe/C,SAAS,CAACC,WAAW,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet, Pressable } from "react-native";
|
|
3
4
|
import { withTheme } from "../theming";
|
|
@@ -31,10 +32,9 @@ const StarRating = _ref => {
|
|
|
31
32
|
!!onPress && onPress(r);
|
|
32
33
|
}, [onPress]);
|
|
33
34
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
34
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
35
|
-
style: [styles.container, style]
|
|
36
|
-
|
|
37
|
-
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
36
|
+
style: [styles.container, style]
|
|
37
|
+
}, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
|
|
38
38
|
key: i,
|
|
39
39
|
style: {
|
|
40
40
|
display: "flex"
|
|
@@ -75,23 +75,4 @@ const styles = StyleSheet.create({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
export default withTheme(StarRating);
|
|
78
|
-
//# sourceMappingURL=StarRating.js.map alignItems: "center"
|
|
79
|
-
},
|
|
80
|
-
touchContainer: {
|
|
81
|
-
display: "flex",
|
|
82
|
-
flexDirection: "row",
|
|
83
|
-
position: "absolute",
|
|
84
|
-
top: 0,
|
|
85
|
-
right: 0,
|
|
86
|
-
left: 0,
|
|
87
|
-
bottom: 0,
|
|
88
|
-
zIndex: 1
|
|
89
|
-
},
|
|
90
|
-
pressable: {
|
|
91
|
-
flex: 1,
|
|
92
|
-
height: "100%",
|
|
93
|
-
width: "50%"
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
export default withTheme(StarRating);
|
|
97
78
|
//# sourceMappingURL=StarRating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","Pressable","withTheme","StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","Pressable","withTheme","StarRating","Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress","rest","localRating","setLocalRating","useState","useEffect","ratingHandler","useCallback","r","ratingRounded","Math","round","styles","container","Array","map","_","i","display","touchContainer","pressable","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"sourceRoot":"../../../src","sources":["components/StarRating.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,IAAI,EACJC,UAAU,EAGVC,SAAS,QACJ,cAAc;AACrB,SAASC,SAAS,QAAQ,YAAY;AAiBtC,MAAMC,UAAoD,GAAG,QAYvD;EAAA,IAZwD;IAC5DC,IAAI;IACJC,QAAQ,GAAG,EAAE;IACbC,QAAQ,GAAG,CAAC;IACZC,MAAM,GAAG,CAAC;IACVC,YAAY;IACZC,UAAU,GAAG,KAAK;IAClBC,WAAW;IACXC,aAAa;IACbC,KAAK;IACLC,OAAO;IACP,GAAGC;EACL,CAAC;EACC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGlB,KAAK,CAACmB,QAAQ,CAClDV,MAAM,IAAIC,YAAY,IAAI,CAAC,CAC5B;EAEDV,KAAK,CAACoB,SAAS,CAAC,MAAM;IACpB,IAAIX,MAAM,IAAI,IAAI,EAAE;MAClBS,cAAc,CAACT,MAAM,CAAC;IACxB;EACF,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZT,KAAK,CAACoB,SAAS,CAAC,MAAM;IACpB,IAAIV,YAAY,IAAI,IAAI,EAAE;MACxBQ,cAAc,CAACR,YAAY,CAAC;IAC9B;EACF,CAAC,EAAE,CAACA,YAAY,CAAC,CAAC;EAElB,MAAMW,aAAa,GAAGrB,KAAK,CAACsB,WAAW,CACpCC,CAAS,IAAK;IACbL,cAAc,CAACK,CAAC,CAAC;IACjB,CAAC,CAACR,OAAO,IAAIA,OAAO,CAACQ,CAAC,CAAC;EACzB,CAAC,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AI,EAAE,CAAC;IACPC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACV,CAAC;EACDT,SAAS,EAAE;IACTU,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAe3C,SAAS,CAACC,UAAU,CAAC"}
|
package/lib/module/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, GROUPS, createTextEnumProp, FORM_TYPES } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Bottom Sheet",
|
|
4
4
|
tag: "BottomSheet",
|
|
@@ -11,16 +11,32 @@ export const SEED_DATA = {
|
|
|
11
11
|
label: "On settle",
|
|
12
12
|
description: "Action to execute when sheet settles on a snap point"
|
|
13
13
|
}),
|
|
14
|
-
|
|
15
|
-
label: "
|
|
16
|
-
description: "
|
|
17
|
-
defaultValue:
|
|
14
|
+
topSnapPosition: createStaticNumberProp({
|
|
15
|
+
label: "Top snap position",
|
|
16
|
+
description: "Top most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
17
|
+
defaultValue: "10%",
|
|
18
|
+
required: false,
|
|
19
|
+
formType: FORM_TYPES.numeric
|
|
18
20
|
}),
|
|
19
|
-
|
|
20
|
-
label: "
|
|
21
|
-
description: "
|
|
22
|
-
defaultValue:
|
|
23
|
-
required: false
|
|
21
|
+
middleSnapPosition: createStaticNumberProp({
|
|
22
|
+
label: "Middle snap position",
|
|
23
|
+
description: "Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
24
|
+
defaultValue: "50%",
|
|
25
|
+
required: false,
|
|
26
|
+
formType: FORM_TYPES.numeric
|
|
27
|
+
}),
|
|
28
|
+
bottomSnapPosition: createStaticNumberProp({
|
|
29
|
+
label: "Bottom snap position",
|
|
30
|
+
description: "Bottom most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
31
|
+
defaultValue: "80%",
|
|
32
|
+
required: false,
|
|
33
|
+
formType: FORM_TYPES.numeric
|
|
34
|
+
}),
|
|
35
|
+
initialSnapPosition: createTextEnumProp({
|
|
36
|
+
label: "Initial snap position",
|
|
37
|
+
description: "Initial snap position that bottom sheet will snap to",
|
|
38
|
+
options: ["top", "middle", "bottom"],
|
|
39
|
+
defaultValue: "bottom"
|
|
24
40
|
}),
|
|
25
41
|
showHandle: createStaticBoolProp({
|
|
26
42
|
label: "Show handle",
|
|
@@ -58,6 +74,18 @@ export const SEED_DATA = {
|
|
|
58
74
|
label: "Bounce",
|
|
59
75
|
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
60
76
|
defaultValue: true
|
|
77
|
+
}),
|
|
78
|
+
snapPoints: createArrayProp({
|
|
79
|
+
label: "Custom Snap points",
|
|
80
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to. Accepts numbers and percentages (minimum 2 snap points). Overrides snap position props",
|
|
81
|
+
defaultValue: null
|
|
82
|
+
}),
|
|
83
|
+
initialSnapIndex: createStaticNumberProp({
|
|
84
|
+
label: "Initial snap index",
|
|
85
|
+
description: "Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
86
|
+
defaultValue: null,
|
|
87
|
+
required: false,
|
|
88
|
+
group: GROUPS.advanced
|
|
61
89
|
})
|
|
62
90
|
}
|
|
63
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COMPONENT_TYPES","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","Triggers","createActionProp","createColorProp","createStaticNumberProp","createArrayProp","SEED_DATA","name","tag","description","category","bottomsheet","stylesPanelSections","triggers","OnSettle","props","onSettle","label","
|
|
1
|
+
{"version":3,"names":["COMPONENT_TYPES","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","Triggers","createActionProp","createColorProp","createStaticNumberProp","createArrayProp","GROUPS","createTextEnumProp","FORM_TYPES","SEED_DATA","name","tag","description","category","bottomsheet","stylesPanelSections","triggers","OnSettle","props","onSettle","label","topSnapPosition","defaultValue","required","formType","numeric","middleSnapPosition","bottomSnapPosition","initialSnapPosition","options","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","showsVerticalScrollIndicator","bounces","snapPoints","initialSnapIndex","group","advanced"],"sourceRoot":"../../../src","sources":["mappings/BottomSheet.ts"],"mappings":"AAAA,SACEA,eAAe,EACfC,oBAAoB,EACpBC,mCAAmC,EACnCC,QAAQ,EACRC,gBAAgB,EAChBC,eAAe,EACfC,sBAAsB,EACtBC,eAAe,EACfC,MAAM,EACNC,kBAAkB,EAClBC,UAAU,QACL,iBAAiB;AAExB,OAAO,MAAMC,SAAS,GAAG;EACvBC,IAAI,EAAE,cAAc;EACpBC,GAAG,EAAE,aAAa;EAClBC,WAAW,EACT,wFAAwF;EAC1FC,QAAQ,EAAEf,eAAe,CAACgB,WAAW;EACrCC,mBAAmB,EAAEf,mCAAmC;EACxDgB,QAAQ,EAAE,CAACf,QAAQ,CAACgB,QAAQ,CAAC;EAC7BC,KAAK,EAAE;IACLC,QAAQ,EAAEjB,gBAAgB,CAAC;MACzBkB,KAAK,EAAE,WAAW;MAClBR,WAAW,EAAE;IACf,CAAC,CAAC;IACFS,eAAe,EAAEjB,sBAAsB,CAAC;MACtCgB,KAAK,EAAE,mBAAmB;MAC1BR,WAAW,EACT,0GAA0G;MAC5GU,YAAY,EAAE,KAAK;MACnBC,QAAQ,EAAE,KAAK;MACfC,QAAQ,EAAEhB,UAAU,CAACiB;IACvB,CAAC,CAAC;IACFC,kBAAkB,EAAEtB,sBAAsB,CAAC;MACzCg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AAC,CAAC;IACFa,4BAA4B,EAAEpC,oBAAoB,CAAC;MACjDqB,KAAK,EAAE,gCAAgC;MACvCR,WAAW,EACT,0EAA0E;MAC5EU,YAAY,EAAE;IAChB,CAAC,CAAC;IACFc,OAAO,EAAErC,oBAAoB,CAAC;MAC5BqB,KAAK,EAAE,QAAQ;MACfR,WAAW,EACT,iKAAiK;MACnKU,YAAY,EAAE;IAChB,CAAC,CAAC;IACFe,UAAU,EAAEhC,eAAe,CAAC;MAC1Be,KAAK,EAAE,oBAAoB;MAC3BR,WAAW,EACT,4LAA4L;MAC9LU,YAAY,EAAE;IAChB,CAAC,CAAC;IACFgB,gBAAgB,EAAElC,sBAAsB,CAAC;MACvCgB,KAAK,EAAE,oBAAoB;MAC3BR,WAAW,EACT,0FAA0F;MAC5FU,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE,KAAK;MACfgB,KAAK,EAAEjC,MAAM,CAACkC;IAChB,CAAC;EACH;AACF,CAAC"}
|
|
@@ -5,9 +5,6 @@ export const SEED_DATA = {
|
|
|
5
5
|
description: "A basic List component",
|
|
6
6
|
category: COMPONENT_TYPES.data,
|
|
7
7
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
flex: 1
|
|
10
|
-
},
|
|
11
8
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
12
9
|
props: {
|
|
13
10
|
onRefresh: createActionProp(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COMPONENT_TYPES","createNumColumnsType","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","Triggers","createActionProp","createStaticNumberProp","createColorProp","SEED_DATA","name","tag","description","category","data","stylesPanelSections","
|
|
1
|
+
{"version":3,"names":["COMPONENT_TYPES","createNumColumnsType","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","Triggers","createActionProp","createStaticNumberProp","createColorProp","SEED_DATA","name","tag","description","category","data","stylesPanelSections","triggers","OnRefresh","OnEndReached","props","onRefresh","onEndReached","horizontal","label","inverted","numColumns","editable","initialNumToRender","defaultValue","onEndReachedThreshold","refreshColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator"],"sourceRoot":"../../../src","sources":["mappings/FlatList.ts"],"mappings":"AAAA,SACEA,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,mCAAmC,EACnCC,QAAQ,EACRC,gBAAgB,EAChBC,sBAAsB,EACtBC,eAAe,QACV,iBAAiB;AAExB,OAAO,MAAMC,SAAS,GAAG;EACvBC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,UAAU;EACfC,WAAW,EAAE,wBAAwB;EACrCC,QAAQ,EAAEZ,eAAe,CAACa,IAAI;EAC9BC,mBAAmB,EAAEX,mCAAmC;EACxDY,QAAQ,EAAE,CAACX,QAAQ,CAACY,SAAS,EAAEZ,QAAQ,CAACa,YAAY,CAAC;EACrDC,KAAK,EAAE;IACLC,SAAS,EAAEd,gBAAgB,EAAE;IAC7Be,YAAY,EAAEf,gBAAgB,EAAE;IAChCgB,UAAU,EAAEnB,oBAAoB,CAAC;MAC/BoB,KAAK,EAAE,YAAY;MACnBX,WAAW,EAAE;IACf,CAAC,CAAC;IACFY,QAAQ,EAAErB,oBAAoB,CAAC;MAC7BoB,KAAK,EAAE,UAAU;MACjBX,WAAW,EAAE;IACf,CAAC,CAAC;IACFa,UAAU,EAAEvB,oBAAoB,CAAC;MAC/BwB,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFC,kBAAkB,EAAEpB,sBAAsB,CAAC;MACzCgB,KAAK,EAAE,uBAAuB;MAC9BX,WAAW,EAAE,+CAA+C;MAC5DgB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFC,qBAAqB,EAAEtB,sBAAsB,CAAC;MAC5CgB,KAAK,EAAE,uBAAuB;MAC9BX,WAAW,EACT,8RAA8R;MAChSgB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFE,YAAY,EAAEtB,eAAe,CAAC;MAC5Be,KAAK,EAAE,kBAAkB;MACzBX,WAAW,EAAE;IACf,CAAC,CAAC;IACFmB,8BAA8B,EAAE5B,oBAAoB,CAAC;MACnDoB,KAAK,EAAE,kCAAkC;MACzCX,WAAW,EACT,4EAA4E;MAC9EgB,YAAY,EAAE;IAChB,CAAC,CAAC;IACFI,4BAA4B,EAAE7B,oBAAoB,CAAC;MACjDoB,KAAK,EAAE,gCAAgC;MACvCX,WAAW,EACT,0EAA0E;MAC5EgB,YAAY,EAAE;IAChB,CAAC;EACH;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COMPONENT_TYPES, createStaticNumberProp, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, StylesPanelSections, GROUPS, createBoolProp, createTextProp, createIconProp, createTextEnumProp, createColorProp, Triggers, createActionProp } from "@draftbit/types";
|
|
2
|
-
const
|
|
2
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
3
3
|
title: createTextProp({
|
|
4
4
|
label: "Title",
|
|
5
5
|
description: "Title of button/swipeable",
|
|
@@ -40,7 +40,7 @@ export const SEED_DATA = [{
|
|
|
40
40
|
tag: "SwipeableView",
|
|
41
41
|
doc_link: "https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
42
42
|
description: "A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
43
|
-
category: COMPONENT_TYPES.view
|
|
43
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
44
44
|
stylesPanelSections: [...CONTAINER_COMPONENT_STYLES_SECTIONS, StylesPanelSections.Typography],
|
|
45
45
|
layout: {
|
|
46
46
|
overflow: "hidden",
|
|
@@ -150,22 +150,22 @@ export const SEED_DATA = [{
|
|
|
150
150
|
name: "Swipeable View Button",
|
|
151
151
|
tag: "SwipeableViewButton",
|
|
152
152
|
description: "Button to be rendered under a Swipeable View",
|
|
153
|
-
category: COMPONENT_TYPES.view
|
|
153
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
154
154
|
stylesPanelSections: [],
|
|
155
155
|
triggers: [Triggers.OnPress],
|
|
156
156
|
props: {
|
|
157
|
-
...
|
|
157
|
+
...SHARED_SEED_DATA_PROPS,
|
|
158
158
|
onPress: createActionProp()
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
161
161
|
name: "Swipeable View Swipe Handler",
|
|
162
162
|
tag: "SwipeableViewSwipeHandler",
|
|
163
163
|
description: "Component that renders and handles swipe of Swipeable View",
|
|
164
|
-
category: COMPONENT_TYPES.view
|
|
164
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
165
165
|
stylesPanelSections: [],
|
|
166
166
|
triggers: [Triggers.OnSwipe],
|
|
167
167
|
props: {
|
|
168
|
-
...
|
|
168
|
+
...SHARED_SEED_DATA_PROPS,
|
|
169
169
|
onSwipe: createActionProp({
|
|
170
170
|
label: "On swipe",
|
|
171
171
|
description: "Called when Swipeable View swiped in the direction this is configured to"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COMPONENT_TYPES","createStaticNumberProp","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","StylesPanelSections","GROUPS","createBoolProp","createTextProp","createIconProp","createTextEnumProp","createColorProp","Triggers","createActionProp","
|
|
1
|
+
{"version":3,"names":["COMPONENT_TYPES","createStaticNumberProp","createStaticBoolProp","CONTAINER_COMPONENT_STYLES_SECTIONS","StylesPanelSections","GROUPS","createBoolProp","createTextProp","createIconProp","createTextEnumProp","createColorProp","Triggers","createActionProp","SHARED_SEED_DATA_PROPS","title","label","description","defaultValue","required","group","basic","side","options","icon","iconSize","backgroundColor","color","SEED_DATA","name","tag","doc_link","category","testing","stylesPanelSections","Typography","layout","overflow","flexDirection","alignItems","padding","props","closeOnPress","swipeActivationPercentage","disableLeftSwipe","disableRightSwipe","leftOpenValue","advanced","rightOpenValue","leftActivationValue","rightActivationValue","stopLeftSwipe","stopRightSwipe","directionalDistanceChangeThreshold","friction","tension","swipeToOpenVelocityContribution","swipeToOpenPercent","swipeToClosePercent","triggers","OnPress","onPress","OnSwipe","onSwipe"],"sourceRoot":"../../../src","sources":["mappings/SwipeableView.ts"],"mappings":"AAAA,SACEA,eAAe,EACfC,sBAAsB,EACtBC,oBAAoB,EACpBC,mCAAmC,EACnCC,mBAAmB,EACnBC,MAAM,EACNC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,eAAe,EACfC,QAAQ,EACRC,gBAAgB,QACX,iBAAiB;AAExB,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,KAAK,EAAEP,cAAc,CAAC;IACpBQ,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE,2BAA2B;IACxCC,YAAY,EAAE,WAAW;IACzBC,QAAQ,EAAE,IAAI;IACdC,KAAK,EAAEd,MAAM,CAACe;EAChB,CAAC,CAAC;EACFC,IAAI,EAAEZ,kBAAkB,CAAC;IACvBM,KAAK,EAAE,MAAM;IACbC,WAAW,EAAE,sCAAsC;IACnDM,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1BL,YAAY,EAAE,MAAM;IACpBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFK,IAAI,EAAEf,cAAc,CAAC;IACnBS,YAAY,EAAE,IAAI;IAClBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFM,QAAQ,EAAEvB,sBAAsB,CAAC;IAC/Bc,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,cAAc;IAC3BC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACFO,eAAe,EAAEf,eAAe,CAAC;IAC/BK,KAAK,EAAE,kBAAkB;IACzBC,WAAW,EAAE,sCAAsC;IACnDC,YAAY,EAAE;EAChB,CAAC,CAAC;EACFS,KAAK,EAAEhB,eAAe,CAAC;IACrBK,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE,4CAA4C;IACzDC,YAAY,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AC5BrB,KAAK,EAAE;IACL,GAAG3B,sBAAsB;IACzBiD,OAAO,EAAElD,gBAAgB,CAAC;MACxBG,KAAK,EAAE,UAAU;MACjBC,WAAW,EACT;IACJ,CAAC;EACH;AACF,CAAC,CACF"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, ScrollViewProps } from "react-native";
|
|
3
3
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
4
|
+
declare type SnapPosition = "top" | "middle" | "bottom";
|
|
4
5
|
export interface BottomSheetProps extends ScrollViewProps {
|
|
5
|
-
|
|
6
|
+
topSnapPosition?: string | number;
|
|
7
|
+
middleSnapPosition?: string | number;
|
|
8
|
+
bottomSnapPosition?: string | number;
|
|
9
|
+
snapPoints: (string | number)[];
|
|
6
10
|
initialSnapIndex?: number;
|
|
11
|
+
initialSnapPosition: SnapPosition;
|
|
7
12
|
showHandle?: boolean;
|
|
8
13
|
handleColor?: string;
|
|
9
14
|
topBorderRadius?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,aAAK,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAChD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,YAAY,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AAsHD,wBAAsC"}
|
|
@@ -16,18 +16,29 @@ export declare const SEED_DATA: {
|
|
|
16
16
|
defaultValue: null;
|
|
17
17
|
group: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
group: string;
|
|
19
|
+
topSnapPosition: {
|
|
21
20
|
label: string;
|
|
22
21
|
description: string;
|
|
22
|
+
formType: string;
|
|
23
|
+
propType: string;
|
|
24
|
+
group: string;
|
|
25
|
+
defaultValue: null;
|
|
23
26
|
editable: boolean;
|
|
24
27
|
required: boolean;
|
|
28
|
+
step: number;
|
|
29
|
+
};
|
|
30
|
+
middleSnapPosition: {
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
25
33
|
formType: string;
|
|
26
34
|
propType: string;
|
|
27
|
-
|
|
35
|
+
group: string;
|
|
28
36
|
defaultValue: null;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
required: boolean;
|
|
39
|
+
step: number;
|
|
29
40
|
};
|
|
30
|
-
|
|
41
|
+
bottomSnapPosition: {
|
|
31
42
|
label: string;
|
|
32
43
|
description: string;
|
|
33
44
|
formType: string;
|
|
@@ -38,6 +49,17 @@ export declare const SEED_DATA: {
|
|
|
38
49
|
required: boolean;
|
|
39
50
|
step: number;
|
|
40
51
|
};
|
|
52
|
+
initialSnapPosition: {
|
|
53
|
+
group: string;
|
|
54
|
+
label: string;
|
|
55
|
+
description: string;
|
|
56
|
+
editable: boolean;
|
|
57
|
+
required: boolean;
|
|
58
|
+
formType: string;
|
|
59
|
+
propType: string;
|
|
60
|
+
defaultValue: null;
|
|
61
|
+
options: never[];
|
|
62
|
+
};
|
|
41
63
|
showHandle: {
|
|
42
64
|
label: string;
|
|
43
65
|
description: string;
|
|
@@ -110,6 +132,28 @@ export declare const SEED_DATA: {
|
|
|
110
132
|
required: boolean;
|
|
111
133
|
group: string;
|
|
112
134
|
};
|
|
135
|
+
snapPoints: {
|
|
136
|
+
group: string;
|
|
137
|
+
label: string;
|
|
138
|
+
description: string;
|
|
139
|
+
editable: boolean;
|
|
140
|
+
required: boolean;
|
|
141
|
+
formType: string;
|
|
142
|
+
propType: string;
|
|
143
|
+
options: never[];
|
|
144
|
+
defaultValue: null;
|
|
145
|
+
};
|
|
146
|
+
initialSnapIndex: {
|
|
147
|
+
label: string;
|
|
148
|
+
description: string;
|
|
149
|
+
formType: string;
|
|
150
|
+
propType: string;
|
|
151
|
+
group: string;
|
|
152
|
+
defaultValue: null;
|
|
153
|
+
editable: boolean;
|
|
154
|
+
required: boolean;
|
|
155
|
+
step: number;
|
|
156
|
+
};
|
|
113
157
|
};
|
|
114
158
|
};
|
|
115
159
|
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"FlatList.d.ts","sourceRoot":"","sources":["../../../../src/mappings/FlatList.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDrB,CAAC"}
|
|
@@ -1,3 +1,58 @@
|
|
|
1
|
+
export declare const SHARED_SEED_DATA_PROPS: {
|
|
2
|
+
title: any;
|
|
3
|
+
side: {
|
|
4
|
+
group: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
editable: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
formType: string;
|
|
10
|
+
propType: string;
|
|
11
|
+
defaultValue: null;
|
|
12
|
+
options: never[];
|
|
13
|
+
};
|
|
14
|
+
icon: {
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
formType: string;
|
|
18
|
+
propType: string;
|
|
19
|
+
defaultValue: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
editable: boolean;
|
|
22
|
+
group: string;
|
|
23
|
+
};
|
|
24
|
+
iconSize: {
|
|
25
|
+
label: string;
|
|
26
|
+
description: string;
|
|
27
|
+
formType: string;
|
|
28
|
+
propType: string;
|
|
29
|
+
group: string;
|
|
30
|
+
defaultValue: null;
|
|
31
|
+
editable: boolean;
|
|
32
|
+
required: boolean;
|
|
33
|
+
step: number;
|
|
34
|
+
};
|
|
35
|
+
backgroundColor: {
|
|
36
|
+
group: string;
|
|
37
|
+
label: string;
|
|
38
|
+
description: string;
|
|
39
|
+
editable: boolean;
|
|
40
|
+
required: boolean;
|
|
41
|
+
defaultValue: null;
|
|
42
|
+
formType: string;
|
|
43
|
+
propType: string;
|
|
44
|
+
};
|
|
45
|
+
color: {
|
|
46
|
+
group: string;
|
|
47
|
+
label: string;
|
|
48
|
+
description: string;
|
|
49
|
+
editable: boolean;
|
|
50
|
+
required: boolean;
|
|
51
|
+
defaultValue: null;
|
|
52
|
+
formType: string;
|
|
53
|
+
propType: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
1
56
|
export declare const SEED_DATA: ({
|
|
2
57
|
name: string;
|
|
3
58
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwipeableView.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwipeableView.d.ts","sourceRoot":"","sources":["../../../../src/mappings/SwipeableView.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmClC,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4JrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.11.5-
|
|
3
|
+
"version": "46.11.5-f65e23.2+f65e23c",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.11.5-
|
|
44
|
+
"@draftbit/types": "^46.11.5-f65e23.2+f65e23c",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"node_modules/",
|
|
95
95
|
"lib/"
|
|
96
96
|
],
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "f65e23ca441debb8381407fb66af762da2593bc2"
|
|
98
98
|
}
|
|
@@ -2,10 +2,25 @@ import React from "react";
|
|
|
2
2
|
import { StyleSheet, View, } from "react-native";
|
|
3
3
|
import BottomSheetComponent from "./BottomSheetComponent";
|
|
4
4
|
import { withTheme } from "../../theming";
|
|
5
|
-
const BottomSheet = ({ theme, snapPoints =
|
|
5
|
+
const BottomSheet = ({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor = theme.colors.divider, topBorderRadius = 20, borderWidth = 1, borderColor = theme.colors.divider, onSettle, style, children, ...rest }) => {
|
|
6
6
|
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
7
|
+
const snapPoints = snapPointsProp || [
|
|
8
|
+
topSnapPosition,
|
|
9
|
+
middleSnapPosition,
|
|
10
|
+
bottomSnapPosition,
|
|
11
|
+
];
|
|
12
|
+
const getSnapIndexFromPosition = (position) => {
|
|
13
|
+
switch (position) {
|
|
14
|
+
case "top":
|
|
15
|
+
return 0;
|
|
16
|
+
case "middle":
|
|
17
|
+
return 1;
|
|
18
|
+
case "bottom":
|
|
19
|
+
return 2;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
7
22
|
return (React.createElement(View, { style: styles.parentContainer, pointerEvents: "box-none" },
|
|
8
|
-
React.createElement(BottomSheetComponent, { componentType: "ScrollView", snapPoints: snapPoints, initialSnapIndex: initialSnapIndex, renderHandle: () => (React.createElement(React.Fragment, null, showHandle && (React.createElement(View, { style: [
|
|
23
|
+
React.createElement(BottomSheetComponent, { componentType: "ScrollView", snapPoints: snapPoints, initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition), renderHandle: () => (React.createElement(React.Fragment, null, showHandle && (React.createElement(View, { style: [
|
|
9
24
|
styles.handleContainer,
|
|
10
25
|
{
|
|
11
26
|
backgroundColor,
|
|
@@ -11,9 +11,14 @@ import BottomSheetComponent from "./BottomSheetComponent";
|
|
|
11
11
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
12
12
|
import { withTheme } from "../../theming";
|
|
13
13
|
|
|
14
|
+
type SnapPosition = "top" | "middle" | "bottom";
|
|
14
15
|
export interface BottomSheetProps extends ScrollViewProps {
|
|
15
|
-
|
|
16
|
+
topSnapPosition?: string | number;
|
|
17
|
+
middleSnapPosition?: string | number;
|
|
18
|
+
bottomSnapPosition?: string | number;
|
|
19
|
+
snapPoints: (string | number)[];
|
|
16
20
|
initialSnapIndex?: number;
|
|
21
|
+
initialSnapPosition: SnapPosition;
|
|
17
22
|
showHandle?: boolean;
|
|
18
23
|
handleColor?: string;
|
|
19
24
|
topBorderRadius?: number;
|
|
@@ -26,8 +31,12 @@ export interface BottomSheetProps extends ScrollViewProps {
|
|
|
26
31
|
|
|
27
32
|
const BottomSheet: React.FC<React.PropsWithChildren<BottomSheetProps>> = ({
|
|
28
33
|
theme,
|
|
29
|
-
snapPoints
|
|
30
|
-
|
|
34
|
+
snapPoints: snapPointsProp,
|
|
35
|
+
topSnapPosition = "10%",
|
|
36
|
+
middleSnapPosition = "50%",
|
|
37
|
+
bottomSnapPosition = "80%",
|
|
38
|
+
initialSnapIndex,
|
|
39
|
+
initialSnapPosition = "bottom",
|
|
31
40
|
showHandle = true,
|
|
32
41
|
handleColor = theme.colors.divider,
|
|
33
42
|
topBorderRadius = 20,
|
|
@@ -41,12 +50,31 @@ const BottomSheet: React.FC<React.PropsWithChildren<BottomSheetProps>> = ({
|
|
|
41
50
|
const backgroundColor =
|
|
42
51
|
(style as ViewStyle)?.backgroundColor || theme.colors.background;
|
|
43
52
|
|
|
53
|
+
const snapPoints = snapPointsProp || [
|
|
54
|
+
topSnapPosition,
|
|
55
|
+
middleSnapPosition,
|
|
56
|
+
bottomSnapPosition,
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const getSnapIndexFromPosition = (position: SnapPosition) => {
|
|
60
|
+
switch (position) {
|
|
61
|
+
case "top":
|
|
62
|
+
return 0;
|
|
63
|
+
case "middle":
|
|
64
|
+
return 1;
|
|
65
|
+
case "bottom":
|
|
66
|
+
return 2;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
44
70
|
return (
|
|
45
71
|
<View style={styles.parentContainer} pointerEvents="box-none">
|
|
46
72
|
<BottomSheetComponent
|
|
47
73
|
componentType="ScrollView"
|
|
48
74
|
snapPoints={snapPoints}
|
|
49
|
-
initialSnapIndex={
|
|
75
|
+
initialSnapIndex={
|
|
76
|
+
initialSnapIndex ?? getSnapIndexFromPosition(initialSnapPosition)
|
|
77
|
+
}
|
|
50
78
|
renderHandle={() => (
|
|
51
79
|
<>
|
|
52
80
|
{showHandle && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, GROUPS, createTextEnumProp, FORM_TYPES, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Bottom Sheet",
|
|
4
4
|
tag: "BottomSheet",
|
|
@@ -11,16 +11,32 @@ export const SEED_DATA = {
|
|
|
11
11
|
label: "On settle",
|
|
12
12
|
description: "Action to execute when sheet settles on a snap point",
|
|
13
13
|
}),
|
|
14
|
-
|
|
15
|
-
label: "
|
|
16
|
-
description: "
|
|
17
|
-
defaultValue:
|
|
14
|
+
topSnapPosition: createStaticNumberProp({
|
|
15
|
+
label: "Top snap position",
|
|
16
|
+
description: "Top most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
17
|
+
defaultValue: "10%",
|
|
18
|
+
required: false,
|
|
19
|
+
formType: FORM_TYPES.numeric,
|
|
18
20
|
}),
|
|
19
|
-
|
|
20
|
-
label: "
|
|
21
|
-
description: "
|
|
22
|
-
defaultValue:
|
|
21
|
+
middleSnapPosition: createStaticNumberProp({
|
|
22
|
+
label: "Middle snap position",
|
|
23
|
+
description: "Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
24
|
+
defaultValue: "50%",
|
|
23
25
|
required: false,
|
|
26
|
+
formType: FORM_TYPES.numeric,
|
|
27
|
+
}),
|
|
28
|
+
bottomSnapPosition: createStaticNumberProp({
|
|
29
|
+
label: "Bottom snap position",
|
|
30
|
+
description: "Bottom most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
31
|
+
defaultValue: "80%",
|
|
32
|
+
required: false,
|
|
33
|
+
formType: FORM_TYPES.numeric,
|
|
34
|
+
}),
|
|
35
|
+
initialSnapPosition: createTextEnumProp({
|
|
36
|
+
label: "Initial snap position",
|
|
37
|
+
description: "Initial snap position that bottom sheet will snap to",
|
|
38
|
+
options: ["top", "middle", "bottom"],
|
|
39
|
+
defaultValue: "bottom",
|
|
24
40
|
}),
|
|
25
41
|
showHandle: createStaticBoolProp({
|
|
26
42
|
label: "Show handle",
|
|
@@ -59,5 +75,17 @@ export const SEED_DATA = {
|
|
|
59
75
|
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
60
76
|
defaultValue: true,
|
|
61
77
|
}),
|
|
78
|
+
snapPoints: createArrayProp({
|
|
79
|
+
label: "Custom Snap points",
|
|
80
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to. Accepts numbers and percentages (minimum 2 snap points). Overrides snap position props",
|
|
81
|
+
defaultValue: null,
|
|
82
|
+
}),
|
|
83
|
+
initialSnapIndex: createStaticNumberProp({
|
|
84
|
+
label: "Initial snap index",
|
|
85
|
+
description: "Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
86
|
+
defaultValue: null,
|
|
87
|
+
required: false,
|
|
88
|
+
group: GROUPS.advanced,
|
|
89
|
+
}),
|
|
62
90
|
},
|
|
63
91
|
};
|
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
createColorProp,
|
|
8
8
|
createStaticNumberProp,
|
|
9
9
|
createArrayProp,
|
|
10
|
+
GROUPS,
|
|
11
|
+
createTextEnumProp,
|
|
12
|
+
FORM_TYPES,
|
|
10
13
|
} from "@draftbit/types";
|
|
11
14
|
|
|
12
15
|
export const SEED_DATA = {
|
|
@@ -22,17 +25,35 @@ export const SEED_DATA = {
|
|
|
22
25
|
label: "On settle",
|
|
23
26
|
description: "Action to execute when sheet settles on a snap point",
|
|
24
27
|
}),
|
|
25
|
-
|
|
26
|
-
label: "
|
|
28
|
+
topSnapPosition: createStaticNumberProp({
|
|
29
|
+
label: "Top snap position",
|
|
27
30
|
description:
|
|
28
|
-
"
|
|
29
|
-
defaultValue:
|
|
31
|
+
"Top most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
32
|
+
defaultValue: "10%",
|
|
33
|
+
required: false,
|
|
34
|
+
formType: FORM_TYPES.numeric,
|
|
30
35
|
}),
|
|
31
|
-
|
|
32
|
-
label: "
|
|
33
|
-
description:
|
|
34
|
-
|
|
36
|
+
middleSnapPosition: createStaticNumberProp({
|
|
37
|
+
label: "Middle snap position",
|
|
38
|
+
description:
|
|
39
|
+
"Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
40
|
+
defaultValue: "50%",
|
|
35
41
|
required: false,
|
|
42
|
+
formType: FORM_TYPES.numeric,
|
|
43
|
+
}),
|
|
44
|
+
bottomSnapPosition: createStaticNumberProp({
|
|
45
|
+
label: "Bottom snap position",
|
|
46
|
+
description:
|
|
47
|
+
"Bottom most postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
48
|
+
defaultValue: "80%",
|
|
49
|
+
required: false,
|
|
50
|
+
formType: FORM_TYPES.numeric,
|
|
51
|
+
}),
|
|
52
|
+
initialSnapPosition: createTextEnumProp({
|
|
53
|
+
label: "Initial snap position",
|
|
54
|
+
description: "Initial snap position that bottom sheet will snap to",
|
|
55
|
+
options: ["top", "middle", "bottom"],
|
|
56
|
+
defaultValue: "bottom",
|
|
36
57
|
}),
|
|
37
58
|
showHandle: createStaticBoolProp({
|
|
38
59
|
label: "Show handle",
|
|
@@ -73,5 +94,19 @@ export const SEED_DATA = {
|
|
|
73
94
|
"When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
74
95
|
defaultValue: true,
|
|
75
96
|
}),
|
|
97
|
+
snapPoints: createArrayProp({
|
|
98
|
+
label: "Custom Snap points",
|
|
99
|
+
description:
|
|
100
|
+
"An array of numerical values (that represent distance from the top) where bottom sheet can snap to. Accepts numbers and percentages (minimum 2 snap points). Overrides snap position props",
|
|
101
|
+
defaultValue: null,
|
|
102
|
+
}),
|
|
103
|
+
initialSnapIndex: createStaticNumberProp({
|
|
104
|
+
label: "Initial snap index",
|
|
105
|
+
description:
|
|
106
|
+
"Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
107
|
+
defaultValue: null,
|
|
108
|
+
required: false,
|
|
109
|
+
group: GROUPS.advanced,
|
|
110
|
+
}),
|
|
76
111
|
},
|
|
77
112
|
};
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -5,9 +5,6 @@ export const SEED_DATA = {
|
|
|
5
5
|
description: "A basic List component",
|
|
6
6
|
category: COMPONENT_TYPES.data,
|
|
7
7
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
flex: 1,
|
|
10
|
-
},
|
|
11
8
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
12
9
|
props: {
|
|
13
10
|
onRefresh: createActionProp(),
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -15,9 +15,6 @@ export const SEED_DATA = {
|
|
|
15
15
|
description: "A basic List component",
|
|
16
16
|
category: COMPONENT_TYPES.data,
|
|
17
17
|
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
18
|
-
layout: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
},
|
|
21
18
|
triggers: [Triggers.OnRefresh, Triggers.OnEndReached],
|
|
22
19
|
props: {
|
|
23
20
|
onRefresh: createActionProp(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COMPONENT_TYPES, createStaticNumberProp, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, StylesPanelSections, GROUPS, createBoolProp, createTextProp, createIconProp, createTextEnumProp, createColorProp, Triggers, createActionProp, } from "@draftbit/types";
|
|
2
|
-
const
|
|
2
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
3
3
|
title: createTextProp({
|
|
4
4
|
label: "Title",
|
|
5
5
|
description: "Title of button/swipeable",
|
|
@@ -41,7 +41,7 @@ export const SEED_DATA = [
|
|
|
41
41
|
tag: "SwipeableView",
|
|
42
42
|
doc_link: "https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
43
43
|
description: "A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
44
|
-
category: COMPONENT_TYPES.view
|
|
44
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
45
45
|
stylesPanelSections: [
|
|
46
46
|
...CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
47
47
|
StylesPanelSections.Typography,
|
|
@@ -155,11 +155,11 @@ export const SEED_DATA = [
|
|
|
155
155
|
name: "Swipeable View Button",
|
|
156
156
|
tag: "SwipeableViewButton",
|
|
157
157
|
description: "Button to be rendered under a Swipeable View",
|
|
158
|
-
category: COMPONENT_TYPES.view
|
|
158
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
159
159
|
stylesPanelSections: [],
|
|
160
160
|
triggers: [Triggers.OnPress],
|
|
161
161
|
props: {
|
|
162
|
-
...
|
|
162
|
+
...SHARED_SEED_DATA_PROPS,
|
|
163
163
|
onPress: createActionProp(),
|
|
164
164
|
},
|
|
165
165
|
},
|
|
@@ -167,11 +167,11 @@ export const SEED_DATA = [
|
|
|
167
167
|
name: "Swipeable View Swipe Handler",
|
|
168
168
|
tag: "SwipeableViewSwipeHandler",
|
|
169
169
|
description: "Component that renders and handles swipe of Swipeable View",
|
|
170
|
-
category: COMPONENT_TYPES.view
|
|
170
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
171
171
|
stylesPanelSections: [],
|
|
172
172
|
triggers: [Triggers.OnSwipe],
|
|
173
173
|
props: {
|
|
174
|
-
...
|
|
174
|
+
...SHARED_SEED_DATA_PROPS,
|
|
175
175
|
onSwipe: createActionProp({
|
|
176
176
|
label: "On swipe",
|
|
177
177
|
description: "Called when Swipeable View swiped in the direction this is configured to",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
createActionProp,
|
|
15
15
|
} from "@draftbit/types";
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
export const SHARED_SEED_DATA_PROPS = {
|
|
18
18
|
title: createTextProp({
|
|
19
19
|
label: "Title",
|
|
20
20
|
description: "Title of button/swipeable",
|
|
@@ -59,7 +59,7 @@ export const SEED_DATA = [
|
|
|
59
59
|
"https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
60
60
|
description:
|
|
61
61
|
"A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
62
|
-
category: COMPONENT_TYPES.view
|
|
62
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
63
63
|
stylesPanelSections: [
|
|
64
64
|
...CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
65
65
|
StylesPanelSections.Typography,
|
|
@@ -183,11 +183,11 @@ export const SEED_DATA = [
|
|
|
183
183
|
name: "Swipeable View Button",
|
|
184
184
|
tag: "SwipeableViewButton",
|
|
185
185
|
description: "Button to be rendered under a Swipeable View",
|
|
186
|
-
category: COMPONENT_TYPES.view
|
|
186
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
187
187
|
stylesPanelSections: [],
|
|
188
188
|
triggers: [Triggers.OnPress],
|
|
189
189
|
props: {
|
|
190
|
-
...
|
|
190
|
+
...SHARED_SEED_DATA_PROPS,
|
|
191
191
|
onPress: createActionProp(),
|
|
192
192
|
},
|
|
193
193
|
},
|
|
@@ -195,11 +195,11 @@ export const SEED_DATA = [
|
|
|
195
195
|
name: "Swipeable View Swipe Handler",
|
|
196
196
|
tag: "SwipeableViewSwipeHandler",
|
|
197
197
|
description: "Component that renders and handles swipe of Swipeable View",
|
|
198
|
-
category: COMPONENT_TYPES.view
|
|
198
|
+
category: COMPONENT_TYPES.testing /*.view*/,
|
|
199
199
|
stylesPanelSections: [],
|
|
200
200
|
triggers: [Triggers.OnSwipe],
|
|
201
201
|
props: {
|
|
202
|
-
...
|
|
202
|
+
...SHARED_SEED_DATA_PROPS,
|
|
203
203
|
onSwipe: createActionProp({
|
|
204
204
|
label: "On swipe",
|
|
205
205
|
description:
|