@draftbit/core 46.11.5-84e8d7.2 → 46.11.5-8cf2da.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 +3 -18
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +16 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +22 -5
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/commonjs/components/SwipeableView/SwipeableView.js +155 -0
- package/lib/commonjs/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/index.js +28 -0
- package/lib/commonjs/components/SwipeableView/index.js.map +1 -0
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/BottomSheet.js +9 -38
- package/lib/commonjs/mappings/BottomSheet.js.map +1 -1
- package/lib/commonjs/mappings/NumberInput.js.map +1 -1
- package/lib/commonjs/mappings/SwipeableView.js +182 -0
- package/lib/commonjs/mappings/SwipeableView.js.map +1 -0
- package/lib/commonjs/utilities.js +27 -2
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +3 -18
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/components/SwipeableView/SwipeableView.js +147 -0
- package/lib/module/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/module/components/SwipeableView/index.js +4 -0
- package/lib/module/components/SwipeableView/index.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/BottomSheet.js +10 -39
- package/lib/module/mappings/BottomSheet.js.map +1 -1
- package/lib/module/mappings/SwipeableView.js +175 -0
- package/lib/module/mappings/SwipeableView.js.map +1 -0
- package/lib/module/utilities.js +18 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +1 -6
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts +29 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts +4 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +4 -48
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwipeableView.d.ts +371 -0
- package/lib/typescript/src/mappings/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/utilities.d.ts +6 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/BottomSheet/BottomSheet.js +2 -17
- package/src/components/BottomSheet/BottomSheet.tsx +4 -32
- package/src/components/SwipeableView/SwipeableView.js +117 -0
- package/src/components/SwipeableView/SwipeableView.tsx +299 -0
- package/src/components/SwipeableView/SwipeableViewButton.js +5 -0
- package/src/components/SwipeableView/SwipeableViewButton.tsx +18 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.js +5 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx +20 -0
- package/src/components/SwipeableView/index.js +3 -0
- package/src/components/SwipeableView/index.tsx +3 -0
- package/src/index.js +1 -0
- package/src/index.tsx +6 -0
- package/src/mappings/BottomSheet.js +9 -38
- package/src/mappings/BottomSheet.ts +8 -44
- package/src/mappings/SwipeableView.js +181 -0
- package/src/mappings/SwipeableView.ts +210 -0
- package/src/utilities.js +41 -0
- package/src/utilities.ts +71 -0
package/lib/commonjs/index.js
CHANGED
|
@@ -333,6 +333,24 @@ Object.defineProperty(exports, "Surface", {
|
|
|
333
333
|
return _Surface.default;
|
|
334
334
|
}
|
|
335
335
|
});
|
|
336
|
+
Object.defineProperty(exports, "SwipeableView", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function () {
|
|
339
|
+
return _SwipeableView.SwipeableView;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "SwipeableViewButton", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _SwipeableView.SwipeableViewButton;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(exports, "SwipeableViewSwipeHandler", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () {
|
|
351
|
+
return _SwipeableView.SwipeableViewSwipeHandler;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
336
354
|
Object.defineProperty(exports, "Swiper", {
|
|
337
355
|
enumerable: true,
|
|
338
356
|
get: function () {
|
|
@@ -474,6 +492,7 @@ var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
|
474
492
|
var _BottomSheet = require("./components/BottomSheet");
|
|
475
493
|
var _YoutubePlayer = require("./components/YoutubePlayer");
|
|
476
494
|
var _Table = require("./components/Table");
|
|
495
|
+
var _SwipeableView = require("./components/SwipeableView");
|
|
477
496
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
478
497
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
479
498
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AAEA;AASA;AAOA;AAEA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAyD;AAAA;AAAA"}
|
|
@@ -17,32 +17,16 @@ 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: "10%",
|
|
24
|
-
required: false,
|
|
25
|
-
formType: _types.FORM_TYPES.numeric
|
|
26
|
-
}),
|
|
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
|
|
20
|
+
snapPoints: (0, _types.createArrayProp)({
|
|
21
|
+
label: "Snap points",
|
|
22
|
+
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
23
|
+
defaultValue: ["10%", "50%", "80%"]
|
|
40
24
|
}),
|
|
41
|
-
|
|
42
|
-
label: "Initial snap
|
|
43
|
-
description: "
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
26
|
+
label: "Initial snap index",
|
|
27
|
+
description: "Index of the snap point to be used as the initial point",
|
|
28
|
+
defaultValue: 0,
|
|
29
|
+
required: false
|
|
46
30
|
}),
|
|
47
31
|
showHandle: (0, _types.createStaticBoolProp)({
|
|
48
32
|
label: "Show handle",
|
|
@@ -80,19 +64,6 @@ const SEED_DATA = {
|
|
|
80
64
|
label: "Bounce",
|
|
81
65
|
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.",
|
|
82
66
|
defaultValue: true
|
|
83
|
-
}),
|
|
84
|
-
snapPoints: (0, _types.createArrayProp)({
|
|
85
|
-
label: "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
|
-
group: _types.GROUPS.advanced
|
|
89
|
-
}),
|
|
90
|
-
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
91
|
-
label: "Initial snap index",
|
|
92
|
-
description: "Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
93
|
-
defaultValue: null,
|
|
94
|
-
required: false,
|
|
95
|
-
group: _types.GROUPS.advanced
|
|
96
67
|
})
|
|
97
68
|
}
|
|
98
69
|
};
|
|
@@ -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","snapPoints","createArrayProp","defaultValue","initialSnapIndex","createStaticNumberProp","required","showHandle","createStaticBoolProp","handleColor","createColorProp","topBorderRadius","borderWidth","borderColor","showsVerticalScrollIndicator","bounces"],"sourceRoot":"../../../src","sources":["mappings/BottomSheet.ts"],"mappings":";;;;;;AAAA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MACfG,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFO,WAAW,EAAE,IAAAH,sBAAe,EAAC;MAC3BV,KAAK,EAAE,cAAc;MACrBZ,WAAW,EAAE,+BAA+B;MAC5Ce,YAAY,EAAE;IAChB,CAAC,CAAC;IACFW,4BAA4B,EAAE,IAAAN,2BAAoB,EAAC;MACjDR,KAAK,EAAE,gCAAgC;MACvCZ,WAAW,EACT,0EAA0E;MAC5Ee,YAAY,EAAE;IAChB,CAAC,CAAC;IACFY,OAAO,EAAE,IAAAP,2BAAoB,EAAC;MAC5BR,KAAK,EAAE,QAAQ;MACfZ,WAAW,EACT,iKAAiK;MACnKe,YAAY,EAAE;IAChB,CAAC;EACH;AACF,CAAC;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SEED_DATA_PROPS","style","group","GROUPS","basic","label","description","editable","required","formType","FORM_TYPES","typeStyle","propType","PROP_TYPES","THEME","defaultValue","clearButtonMode","options","flatArray","STRING","clearTextOnFocus","boolean","BOOLEAN","enablesReturnKeyAutomatically","underlineColorAndroid","color","fieldName","FIELD_NAME","handlerPropName","SEED_DATA","name","tag","category","COMPONENT_TYPES","input","stylesPanelSections","StylesPanelSections","Typography","Background","Size","MarginsAndPaddings","Position","Borders","Effects","preview_image_url","supports_list_render","layout","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderColor","paddingLeft","paddingRight","paddingTop","paddingBottom","borderRadius","triggers","Triggers","OnChangeText","props","allowFontScaling","advanced","autoFocus","caretHidden","contextMenuHidden","keyboardAppearance","keyboardType","maxLength","min","step","precision","number","NUMBER","placeholder","string","placeholderTextColor","returnKeyLabel","returnKeyType","selectionColor","selectTextOnFocus"],"sourceRoot":"../../../src","sources":["mappings/NumberInput.
|
|
1
|
+
{"version":3,"names":["SEED_DATA_PROPS","style","group","GROUPS","basic","label","description","editable","required","formType","FORM_TYPES","typeStyle","propType","PROP_TYPES","THEME","defaultValue","clearButtonMode","options","flatArray","STRING","clearTextOnFocus","boolean","BOOLEAN","enablesReturnKeyAutomatically","underlineColorAndroid","color","fieldName","FIELD_NAME","handlerPropName","SEED_DATA","name","tag","category","COMPONENT_TYPES","input","stylesPanelSections","StylesPanelSections","Typography","Background","Size","MarginsAndPaddings","Position","Borders","Effects","preview_image_url","supports_list_render","layout","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderColor","paddingLeft","paddingRight","paddingTop","paddingBottom","borderRadius","triggers","Triggers","OnChangeText","props","allowFontScaling","advanced","autoFocus","caretHidden","contextMenuHidden","keyboardAppearance","keyboardType","maxLength","min","step","precision","number","NUMBER","placeholder","string","placeholderTextColor","returnKeyLabel","returnKeyType","selectionColor","selectTextOnFocus"],"sourceRoot":"../../../src","sources":["mappings/NumberInput.ts"],"mappings":";;;;;;AAAA;AAUO,MAAMA,eAAe,GAAG;EAC7BC,KAAK,EAAE;IACLC,KAAK,EAAEC,aAAM,CAACC,KAAK;IACnBC,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE,YAAY;IACzBC,QAAQ,EAAE,KAAK;IACfC,QAAQ,EAAE,KAAK;IACfC,QAAQ,EAAEC,iBAAU,CAACC,SAAS;IAC9BC,QAAQ,EAAEC,iBAAU,CAACC,KAAK;IAC1BC,YAAY,EAAE;EAChB,CAAC;EACDC,eAAe,EAAE;IACfd,KAAK,EAAEC,aAAM,CAACC,KAAK;IACnBC,KAAK,EAAE,mBAAmB;IAC1BC,WAAW,EACT,iEAAiE;IACnEC,QAAQ,EAAE,IAAI;IACdC,QAAQ,EAAE,KAAK;IACfS,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,CAAC;IAC/DF,YAAY,EAAE,IAAI;IAClBN,QAAQ,EAAEC,iBAAU,CAACQ,SAAS;IAC9BN,QAAQ,EAAEC,iBAAU,CAACM;EACvB,CAAC;EACDC,gBAAgB,EAAE;IAChBlB,KAAK,EAAEC,aAAM,CAACC,KAAK;IACnBC,KA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+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SEED_DATA = void 0;
|
|
7
|
+
var _types = require("@draftbit/types");
|
|
8
|
+
const SHARED_SWIPEABLE_CHILDREN_PROPS = {
|
|
9
|
+
title: (0, _types.createTextProp)({
|
|
10
|
+
label: "Title",
|
|
11
|
+
description: "Title of button/swipeable",
|
|
12
|
+
defaultValue: "Swipeable",
|
|
13
|
+
required: true,
|
|
14
|
+
group: _types.GROUPS.basic
|
|
15
|
+
}),
|
|
16
|
+
side: (0, _types.createTextEnumProp)({
|
|
17
|
+
label: "Side",
|
|
18
|
+
description: "Side where button/swipeable is added",
|
|
19
|
+
options: ["left", "right"],
|
|
20
|
+
defaultValue: "left",
|
|
21
|
+
required: true
|
|
22
|
+
}),
|
|
23
|
+
icon: (0, _types.createIconProp)({
|
|
24
|
+
defaultValue: null,
|
|
25
|
+
required: false
|
|
26
|
+
}),
|
|
27
|
+
iconSize: (0, _types.createStaticNumberProp)({
|
|
28
|
+
label: "Icon size",
|
|
29
|
+
description: "Size of icon",
|
|
30
|
+
defaultValue: 25,
|
|
31
|
+
required: false
|
|
32
|
+
}),
|
|
33
|
+
backgroundColor: (0, _types.createColorProp)({
|
|
34
|
+
label: "Background color",
|
|
35
|
+
description: "Color of button/swipeable background",
|
|
36
|
+
defaultValue: "primary"
|
|
37
|
+
}),
|
|
38
|
+
color: (0, _types.createColorProp)({
|
|
39
|
+
label: "Color",
|
|
40
|
+
description: "Color of text and icon of button/swipeable",
|
|
41
|
+
defaultValue: "surface"
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
const SEED_DATA = [{
|
|
45
|
+
name: "Swipeable View",
|
|
46
|
+
tag: "SwipeableView",
|
|
47
|
+
doc_link: "https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md",
|
|
48
|
+
description: "A swipeable view that is able to show hidden buttons and/or handle swipe events",
|
|
49
|
+
category: _types.COMPONENT_TYPES.testing /*.view*/,
|
|
50
|
+
stylesPanelSections: [..._types.CONTAINER_COMPONENT_STYLES_SECTIONS, _types.StylesPanelSections.Typography],
|
|
51
|
+
layout: {
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
flexDirection: "row",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
padding: 10
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
closeOnPress: (0, _types.createStaticBoolProp)({
|
|
59
|
+
label: "Close on press",
|
|
60
|
+
description: "Whether the view should be closed/dismissed when pressed",
|
|
61
|
+
defaultValue: true
|
|
62
|
+
}),
|
|
63
|
+
swipeActivationPercentage: (0, _types.createStaticNumberProp)({
|
|
64
|
+
label: "Swipe activation percentage",
|
|
65
|
+
description: "Percentage of swipe completion needed to trigger onSwipe. Overriden by 'Left activation value' and 'Right activation value'",
|
|
66
|
+
defaultValue: 80,
|
|
67
|
+
required: false
|
|
68
|
+
}),
|
|
69
|
+
disableLeftSwipe: (0, _types.createBoolProp)({
|
|
70
|
+
label: "Disable left swipe",
|
|
71
|
+
description: "Whether left swipe is enabled or not",
|
|
72
|
+
defaultValue: true
|
|
73
|
+
}),
|
|
74
|
+
disableRightSwipe: (0, _types.createBoolProp)({
|
|
75
|
+
label: "Disable right swipe",
|
|
76
|
+
description: "Whether right swipe is enabled or not",
|
|
77
|
+
defaultValue: true
|
|
78
|
+
}),
|
|
79
|
+
leftOpenValue: (0, _types.createStaticNumberProp)({
|
|
80
|
+
label: "Left open value",
|
|
81
|
+
description: "The X translation value that left swipe snaps to (positive value). Defaults to half view width",
|
|
82
|
+
group: _types.GROUPS.advanced,
|
|
83
|
+
required: false
|
|
84
|
+
}),
|
|
85
|
+
rightOpenValue: (0, _types.createStaticNumberProp)({
|
|
86
|
+
label: "Right open value",
|
|
87
|
+
description: "The X translation value that right swipe snaps to (negative value). Defaults to negative half view width",
|
|
88
|
+
group: _types.GROUPS.advanced,
|
|
89
|
+
required: false
|
|
90
|
+
}),
|
|
91
|
+
leftActivationValue: (0, _types.createStaticNumberProp)({
|
|
92
|
+
label: "Left activation value",
|
|
93
|
+
description: "The X translation value that triggers onSwipe when surpassed (positive value). Defaults to 80% of half view width",
|
|
94
|
+
group: _types.GROUPS.advanced,
|
|
95
|
+
required: false
|
|
96
|
+
}),
|
|
97
|
+
rightActivationValue: (0, _types.createStaticNumberProp)({
|
|
98
|
+
label: "Right activation value",
|
|
99
|
+
description: "The X translation value that triggers onSwipe when surpassed (negative value). Defaults to negative 80% of half view width",
|
|
100
|
+
group: _types.GROUPS.advanced,
|
|
101
|
+
required: false
|
|
102
|
+
}),
|
|
103
|
+
stopLeftSwipe: (0, _types.createStaticNumberProp)({
|
|
104
|
+
label: "Stop left swipe",
|
|
105
|
+
description: "The maximum X translation value that is swipable from left (positive value). Defaults to half view width",
|
|
106
|
+
group: _types.GROUPS.advanced,
|
|
107
|
+
required: false
|
|
108
|
+
}),
|
|
109
|
+
stopRightSwipe: (0, _types.createStaticNumberProp)({
|
|
110
|
+
label: "Stop right swipe",
|
|
111
|
+
description: "The maximum X translation value that is swipable from right (negative value). Defaults to negative half view width",
|
|
112
|
+
group: _types.GROUPS.advanced,
|
|
113
|
+
required: false
|
|
114
|
+
}),
|
|
115
|
+
directionalDistanceChangeThreshold: (0, _types.createStaticNumberProp)({
|
|
116
|
+
label: "Change threshold",
|
|
117
|
+
description: "Change the sensitivity of the swipe on the view",
|
|
118
|
+
group: _types.GROUPS.advanced,
|
|
119
|
+
required: false
|
|
120
|
+
}),
|
|
121
|
+
friction: (0, _types.createStaticNumberProp)({
|
|
122
|
+
label: "Friction",
|
|
123
|
+
description: "Controls the 'bounciness' of the swipe animation",
|
|
124
|
+
defaultValue: 20,
|
|
125
|
+
group: _types.GROUPS.advanced,
|
|
126
|
+
required: false
|
|
127
|
+
}),
|
|
128
|
+
tension: (0, _types.createStaticNumberProp)({
|
|
129
|
+
label: "Change threshold",
|
|
130
|
+
description: "Controls the tension/speed of the swipe animation",
|
|
131
|
+
group: _types.GROUPS.advanced,
|
|
132
|
+
required: false
|
|
133
|
+
}),
|
|
134
|
+
swipeToOpenVelocityContribution: (0, _types.createStaticNumberProp)({
|
|
135
|
+
label: "Swipe Velocity Contribution",
|
|
136
|
+
description: "Describes how much the ending velocity of the gesture affects whether the swipe will result in the item being closed or open. A velocity factor of 0 (the default) means that the velocity will have no bearing on whether the swipe settles on a closed or open position and it'll just take into consideration the swipeToOpenPercent. Ideal values for this prop tend to be between 5 and 15",
|
|
137
|
+
group: _types.GROUPS.advanced,
|
|
138
|
+
required: false
|
|
139
|
+
}),
|
|
140
|
+
swipeToOpenPercent: (0, _types.createStaticNumberProp)({
|
|
141
|
+
label: "Swipe to open percentage",
|
|
142
|
+
description: "What % of the left/right does the user need to swipe past to trigger the view opening",
|
|
143
|
+
group: _types.GROUPS.advanced,
|
|
144
|
+
defaultValue: 50,
|
|
145
|
+
required: false
|
|
146
|
+
}),
|
|
147
|
+
swipeToClosePercent: (0, _types.createStaticNumberProp)({
|
|
148
|
+
label: "Swipe to close percentage",
|
|
149
|
+
description: "What % of the left/right does the user need to swipe past to trigger the view closing",
|
|
150
|
+
group: _types.GROUPS.advanced,
|
|
151
|
+
defaultValue: 50,
|
|
152
|
+
required: false
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
name: "Swipeable View Button",
|
|
157
|
+
tag: "SwipeableViewButton",
|
|
158
|
+
description: "Button to be rendered under a Swipeable View",
|
|
159
|
+
category: _types.COMPONENT_TYPES.view,
|
|
160
|
+
stylesPanelSections: [],
|
|
161
|
+
triggers: [_types.Triggers.OnPress],
|
|
162
|
+
props: {
|
|
163
|
+
...SHARED_SWIPEABLE_CHILDREN_PROPS,
|
|
164
|
+
onPress: (0, _types.createActionProp)()
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
name: "Swipeable View Swipe Handler",
|
|
168
|
+
tag: "SwipeableViewSwipeHandler",
|
|
169
|
+
description: "Component that renders and handles swipe of Swipeable View",
|
|
170
|
+
category: _types.COMPONENT_TYPES.view,
|
|
171
|
+
stylesPanelSections: [],
|
|
172
|
+
triggers: [_types.Triggers.OnSwipe],
|
|
173
|
+
props: {
|
|
174
|
+
...SHARED_SWIPEABLE_CHILDREN_PROPS,
|
|
175
|
+
onSwipe: (0, _types.createActionProp)({
|
|
176
|
+
label: "On swipe",
|
|
177
|
+
description: "Called when Swipeable View swiped in the direction this is configured to"
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
}];
|
|
181
|
+
exports.SEED_DATA = SEED_DATA;
|
|
182
|
+
//# sourceMappingURL=SwipeableView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SHARED_SWIPEABLE_CHILDREN_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","view","triggers","Triggers","OnPress","onPress","createActionProp","OnSwipe","onSwipe"],"sourceRoot":"../../../src","sources":["mappings/SwipeableView.ts"],"mappings":";;;;;;AAAA;AAgBA,MAAMA,+BAA+B,GAAG;EACtCC,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;IACvB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C;IACFiD,mBAAmB,EAAE,IAAAvC,6BAAsB,EAAC;MAC1Cb,KAAK,EAAE,2BAA2B;MAClCC,WAAW,EACT,uFAAuF;MACzFG,KAAK,EAAEC,aAAM,CAACoC,QAAQ;MACtBvC,YAAY,EAAE,EAAE;MAChBC,QAAQ,EAAE;IACZ,CAAC;EACH;AACF,CAAC,EACD;EACEe,IAAI,EAAE,uBAAuB;EAC7BC,GAAG,EAAE,qBAAqB;EAC1BlB,WAAW,EAAE,8CAA8C;EAC3DoB,QAAQ,EAAEC,sBAAe,CAAC+B,IAAI;EAC9B7B,mBAAmB,EAAE,EAAE;EACvB8B,QAAQ,EAAE,CAACC,eAAQ,CAACC,OAAO,CAAC;EAC5BvB,KAAK,EAAE;IACL,GAAGpC,+BAA+B;IAClC4D,OAAO,EAAE,IAAAC,uBAAgB;EAC3B;AACF,CAAC,EACD;EACExC,IAAI,EAAE,8BAA8B;EACpCC,GAAG,EAAE,2BAA2B;EAChClB,WAAW,EAAE,4DAA4D;EACzEoB,QAAQ,EAAEC,sBAAe,CAAC+B,IAAI;EAC9B7B,mBAAmB,EAAE,EAAE;EACvB8B,QAAQ,EAAE,CAACC,eAAQ,CAACI,OAAO,CAAC;EAC5B1B,KAAK,EAAE;IACL,GAAGpC,+BAA+B;IAClC+D,OAAO,EAAE,IAAAF,uBAAgB,EAAC;MACxB1D,KAAK,EAAE,UAAU;MACjBC,WAAW,EACT;IACJ,CAAC;EACH;AACF,CAAC,CACF;AAAC"}
|
|
@@ -4,12 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.applyStyles = applyStyles;
|
|
7
|
-
exports.borderStyleNames = void 0;
|
|
7
|
+
exports.effectsStyleNames = exports.borderStyleNames = void 0;
|
|
8
8
|
exports.extractBorderAndMarginStyles = extractBorderAndMarginStyles;
|
|
9
|
+
exports.extractEffectStyles = extractEffectStyles;
|
|
10
|
+
exports.extractFlexItemStyles = extractFlexItemStyles;
|
|
11
|
+
exports.extractPositionStyles = extractPositionStyles;
|
|
9
12
|
exports.extractSizeStyles = extractSizeStyles;
|
|
10
13
|
exports.extractStyles = extractStyles;
|
|
14
|
+
exports.flexItemStyleNames = void 0;
|
|
11
15
|
exports.getValueForRadioButton = getValueForRadioButton;
|
|
12
|
-
exports.sizeStyleNames = exports.marginStyleNames = void 0;
|
|
16
|
+
exports.sizeStyleNames = exports.positionStyleNames = exports.marginStyleNames = void 0;
|
|
13
17
|
var _reactNative = require("react-native");
|
|
14
18
|
var _lodash = require("lodash");
|
|
15
19
|
function extractStyles(style) {
|
|
@@ -58,6 +62,27 @@ function extractBorderAndMarginStyles(style, additionalBorderStyles, additionalM
|
|
|
58
62
|
marginStyles
|
|
59
63
|
};
|
|
60
64
|
}
|
|
65
|
+
const flexItemStyleNames = ["alignSelf", "flexBasis", "flexShrink", "flexGrow", "flex"];
|
|
66
|
+
exports.flexItemStyleNames = flexItemStyleNames;
|
|
67
|
+
function extractFlexItemStyles(style, additionalFlexItemStyles) {
|
|
68
|
+
const flatStyle = _reactNative.StyleSheet.flatten(style || {});
|
|
69
|
+
const flexItemStyles = (0, _lodash.pickBy)((0, _lodash.pick)(flatStyle, [...flexItemStyleNames, ...(additionalFlexItemStyles ? additionalFlexItemStyles : [])]), _lodash.identity);
|
|
70
|
+
return flexItemStyles;
|
|
71
|
+
}
|
|
72
|
+
const positionStyleNames = ["position", "left", "right", "top", "bottom", "zIndex", "overflow"];
|
|
73
|
+
exports.positionStyleNames = positionStyleNames;
|
|
74
|
+
function extractPositionStyles(style, additionalPositionStyles) {
|
|
75
|
+
const flatStyle = _reactNative.StyleSheet.flatten(style || {});
|
|
76
|
+
const positionStyles = (0, _lodash.pickBy)((0, _lodash.pick)(flatStyle, [...positionStyleNames, ...(additionalPositionStyles ? additionalPositionStyles : [])]), _lodash.identity);
|
|
77
|
+
return positionStyles;
|
|
78
|
+
}
|
|
79
|
+
const effectsStyleNames = ["opacity", "elevation"];
|
|
80
|
+
exports.effectsStyleNames = effectsStyleNames;
|
|
81
|
+
function extractEffectStyles(style, additionalEffectStyles) {
|
|
82
|
+
const flatStyle = _reactNative.StyleSheet.flatten(style || {});
|
|
83
|
+
const effectStyles = (0, _lodash.pickBy)((0, _lodash.pick)(flatStyle, [...effectsStyleNames, ...(additionalEffectStyles ? additionalEffectStyles : [])]), _lodash.identity);
|
|
84
|
+
return effectStyles;
|
|
85
|
+
}
|
|
61
86
|
const sizeStyleNames = ["width", "height"];
|
|
62
87
|
exports.sizeStyleNames = sizeStyleNames;
|
|
63
88
|
function extractSizeStyles(style, additionalSizeStyles) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","StyleSheet","flatten","textStyles","borderStyleNames","marginStyleNames","extractBorderAndMarginStyles","additionalBorderStyles","additionalMarginStyles","flatStyle","borderStyles","pickBy","pick","identity","marginStyles","sizeStyleNames","extractSizeStyles","additionalSizeStyles","sizeStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","isString","isNumber","String","Error"],"sourceRoot":"../../src","sources":["utilities.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","StyleSheet","flatten","textStyles","borderStyleNames","marginStyleNames","extractBorderAndMarginStyles","additionalBorderStyles","additionalMarginStyles","flatStyle","borderStyles","pickBy","pick","identity","marginStyles","flexItemStyleNames","extractFlexItemStyles","additionalFlexItemStyles","flexItemStyles","positionStyleNames","extractPositionStyles","additionalPositionStyles","positionStyles","effectsStyleNames","extractEffectStyles","additionalEffectStyles","effectStyles","sizeStyleNames","extractSizeStyles","additionalSizeStyles","sizeStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","isString","isNumber","String","Error"],"sourceRoot":"../../src","sources":["utilities.ts"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAEO,SAASA,aAAa,CAACC,KAAqB,EAAE;EACnD,MAAM;IACJC,KAAK;IACLC,UAAU;IACVC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,aAAa;IACbC,aAAa;IACbC,SAAS;IACTC,kBAAkB;IAClBC,mBAAmB;IACnBC,mBAAmB;IACnB,GAAGC;EACL,CAAC,GAAGC,uBAAU,CAACC,OAAO,CAACd,KAAK,IAAI,CAAC,CAAC,CAAC;EAEnC,MAAMe,UAAqB,GAAG;IAC5Bd,KAAK;IACLC,UAAU;IACVC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,aAAa;IACbC,aAAa;IACbC,SAAS;IACTC,kBAAkB;IAClBC,mBAAmB;IACnBC;EACF,CAAC;EAED,OAAO;IAAEC,UAAU;IAAEG;EAAW,CAAC;AACnC;AAEO,MAAMC,gBAAgB,GAAG,CAC9B,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,CACd;AAAC;AAEK,MAAMC,gBAAgB,GAAG,CAC9B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,gBAAgB,CACjB;AAAC;AAEK,SAASC,4BAA4B,CAC1ClB,KAAqB,EACrBmB,sBAAiC,EACjCC,sBAAiC,EACjC;EACA,MAAMC,SAAS,GAAGR,uBAA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G,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,aAAa,CAAC,EAAE;IACxD,IAAIG,KAAK,IAAI,IAAI,EAAE;MACjBF,eAAe,CAACC,GAAG,CAAC,GAAGC,KAAK;IAC9B;EACF;EAEA,OAAOF,eAAe;AACxB;AAEO,SAASK,sBAAsB,CAACH,KAAsB,EAAE;EAC7D,IAAI,IAAAI,gBAAQ,EAACJ,KAAK,CAAC,EAAE;IACnB,OAAOA,KAAK;EACd,CAAC,MAAM,IAAI,IAAAK,gBAAQ,EAACL,KAAK,CAAC,EAAE;IAC1B,OAAOM,MAAM,CAACN,KAAK,CAAC;EACtB,CAAC,MAAM;IACL,MAAM,IAAIO,KAAK,0BAAmBP,KAAK,EAAG;EAC5C;AACF"}
|
|
@@ -6,12 +6,8 @@ import { withTheme } from "../../theming";
|
|
|
6
6
|
const BottomSheet = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
theme,
|
|
9
|
-
snapPoints
|
|
10
|
-
|
|
11
|
-
middleSnapPosition = "50%",
|
|
12
|
-
bottomSnapPosition = "80%",
|
|
13
|
-
initialSnapIndex,
|
|
14
|
-
initialSnapPosition = "bottom",
|
|
9
|
+
snapPoints = ["10%", "50%", "80%"],
|
|
10
|
+
initialSnapIndex = 0,
|
|
15
11
|
showHandle = true,
|
|
16
12
|
handleColor = theme.colors.divider,
|
|
17
13
|
topBorderRadius = 20,
|
|
@@ -23,24 +19,13 @@ const BottomSheet = _ref => {
|
|
|
23
19
|
...rest
|
|
24
20
|
} = _ref;
|
|
25
21
|
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
|
-
};
|
|
37
22
|
return /*#__PURE__*/React.createElement(View, {
|
|
38
23
|
style: styles.parentContainer,
|
|
39
24
|
pointerEvents: "box-none"
|
|
40
25
|
}, /*#__PURE__*/React.createElement(BottomSheetComponent, _extends({
|
|
41
26
|
componentType: "ScrollView",
|
|
42
27
|
snapPoints: snapPoints,
|
|
43
|
-
initialSnapIndex: initialSnapIndex
|
|
28
|
+
initialSnapIndex: initialSnapIndex,
|
|
44
29
|
renderHandle: () => /*#__PURE__*/React.createElement(React.Fragment, null, showHandle && /*#__PURE__*/React.createElement(View, {
|
|
45
30
|
style: [styles.handleContainer, {
|
|
46
31
|
backgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","BottomSheetComponent","withTheme","BottomSheet","theme","snapPoints","
|
|
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","position","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;AAezC,MAAMC,WAAgE,GAAG,QAanE;EAAA,IAboE;IACxEC,KAAK;IACLC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAClCC,gBAAgB,GAAG,CAAC;IACpBC,UAAU,GAAG,IAAI;IACjBC,WAAW,GAAGJ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,EAAE,UAAU;IACpBC,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;EACDV,cAAc,EAAE;IACdW,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;AAEF,eAAezC,SAAS,CAACC,WAAW,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
import React from "react";
|
|
3
|
+
import { View, StyleSheet, Text } from "react-native";
|
|
4
|
+
import Pressable from "../Pressable";
|
|
5
|
+
import { extractBorderAndMarginStyles, extractEffectStyles, extractFlexItemStyles, extractPositionStyles, extractSizeStyles, extractStyles } from "../../utilities";
|
|
6
|
+
import { SwipeRow } from "react-native-swipe-list-view";
|
|
7
|
+
import { withTheme } from "../../theming";
|
|
8
|
+
const SwipeableView = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme,
|
|
11
|
+
style,
|
|
12
|
+
children,
|
|
13
|
+
Icon,
|
|
14
|
+
closeOnPress,
|
|
15
|
+
leftOpenValue,
|
|
16
|
+
rightOpenValue,
|
|
17
|
+
leftActivationValue,
|
|
18
|
+
rightActivationValue,
|
|
19
|
+
swipeActivationPercentage = 80,
|
|
20
|
+
stopLeftSwipe,
|
|
21
|
+
stopRightSwipe,
|
|
22
|
+
friction = 20,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
const instanceOfSwipeableViewButtonProps = object => {
|
|
26
|
+
return "title" in object && "side" in object && "onPress" in object;
|
|
27
|
+
};
|
|
28
|
+
const instanceOfSwipeableViewSwipeHandlerProps = object => {
|
|
29
|
+
return "title" in object && "side" in object && "onSwipe" in object;
|
|
30
|
+
};
|
|
31
|
+
const {
|
|
32
|
+
viewStyles,
|
|
33
|
+
textStyles
|
|
34
|
+
} = extractStyles(style);
|
|
35
|
+
const {
|
|
36
|
+
borderStyles,
|
|
37
|
+
marginStyles
|
|
38
|
+
} = extractBorderAndMarginStyles(viewStyles);
|
|
39
|
+
const parentContainerStyles = StyleSheet.flatten([borderStyles, marginStyles, extractFlexItemStyles(viewStyles), extractPositionStyles(viewStyles), extractEffectStyles(viewStyles), extractSizeStyles(viewStyles)]);
|
|
40
|
+
|
|
41
|
+
//Remove styles already consumed from viewStyles
|
|
42
|
+
Object.keys(parentContainerStyles).forEach(key => delete viewStyles[key]);
|
|
43
|
+
const surfaceContainerStyles = viewStyles;
|
|
44
|
+
const [componentWidth, setComponentWidth] = React.useState(null);
|
|
45
|
+
const leftButtons = React.useMemo(() => React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfSwipeableViewButtonProps(child.props) && child.props.side === "left"), [children]);
|
|
46
|
+
const rightButtons = React.useMemo(() => React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfSwipeableViewButtonProps(child.props) && child.props.side === "right"), [children]);
|
|
47
|
+
const leftSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfSwipeableViewSwipeHandlerProps(child.props) && child.props.side === "left"), [children]);
|
|
48
|
+
const rightSwipeHandlers = React.useMemo(() => React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfSwipeableViewSwipeHandlerProps(child.props) && child.props.side === "right"), [children]);
|
|
49
|
+
const remainingChildren = React.useMemo(() => React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && !instanceOfSwipeableViewSwipeHandlerProps(child.props) && !instanceOfSwipeableViewButtonProps(child.props)), [children]);
|
|
50
|
+
if (leftButtons.length > 2 || rightButtons.length > 2) {
|
|
51
|
+
throw Error("Cannot have more than 2 buttons per side");
|
|
52
|
+
}
|
|
53
|
+
if (leftSwipeHandlers.length > 1 || rightSwipeHandlers.length > 1) {
|
|
54
|
+
throw Error("Cannot have more than 1 swiper handler per side");
|
|
55
|
+
}
|
|
56
|
+
if (leftButtons.length && leftSwipeHandlers.length || rightButtons.length && rightSwipeHandlers.length) {
|
|
57
|
+
throw Error("Cannot combine swiper handler and buttons on the same side");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//Renders a single button/item. Used for both buttons and swipe handler
|
|
61
|
+
const renderBehindItem = (props, index) => /*#__PURE__*/React.createElement(Pressable, {
|
|
62
|
+
key: index.toString(),
|
|
63
|
+
onPress: props.onPress,
|
|
64
|
+
style: [styles.buttonContainer, {
|
|
65
|
+
backgroundColor: props.backgroundColor || theme.colors.primary
|
|
66
|
+
}]
|
|
67
|
+
}, props.icon && /*#__PURE__*/React.createElement(Icon, {
|
|
68
|
+
name: props.icon,
|
|
69
|
+
size: props.iconSize || 25,
|
|
70
|
+
color: props.color || theme.colors.surface
|
|
71
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
72
|
+
style: [textStyles, {
|
|
73
|
+
color: props.color || theme.colors.surface
|
|
74
|
+
}]
|
|
75
|
+
}, props.title));
|
|
76
|
+
const isLeftSwipeHandler = !!leftSwipeHandlers.length;
|
|
77
|
+
const isRightSwipeHandler = !!rightSwipeHandlers.length;
|
|
78
|
+
const defaultLeftOpenValue = componentWidth ? componentWidth / 2 : 0;
|
|
79
|
+
const defaultRightOpenValue = componentWidth ? -componentWidth / 2 : 0;
|
|
80
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
onLayout: event => {
|
|
82
|
+
setComponentWidth(event.nativeEvent.layout.width);
|
|
83
|
+
},
|
|
84
|
+
style: [styles.parentContainer, parentContainerStyles]
|
|
85
|
+
}, /*#__PURE__*/React.createElement(SwipeRow, _extends({
|
|
86
|
+
leftOpenValue: isLeftSwipeHandler ? 0 : leftOpenValue || defaultLeftOpenValue //If in swiping mode, don't keep open
|
|
87
|
+
,
|
|
88
|
+
|
|
89
|
+
rightOpenValue: isRightSwipeHandler ? 0 : rightOpenValue || defaultRightOpenValue,
|
|
90
|
+
leftActivationValue: leftActivationValue || isLeftSwipeHandler ? defaultLeftOpenValue * (swipeActivationPercentage / 100) //When swipe passes activation percentage then it should be considered activated (call onSwipe)
|
|
91
|
+
: defaultLeftOpenValue,
|
|
92
|
+
rightActivationValue: rightActivationValue || isRightSwipeHandler ? defaultRightOpenValue * (swipeActivationPercentage / 100) : defaultRightOpenValue,
|
|
93
|
+
stopLeftSwipe: stopLeftSwipe || defaultLeftOpenValue,
|
|
94
|
+
stopRightSwipe: stopRightSwipe || defaultRightOpenValue,
|
|
95
|
+
onLeftAction: isLeftSwipeHandler ? () => {
|
|
96
|
+
var _leftSwipeHandlers$0$, _leftSwipeHandlers$0$2;
|
|
97
|
+
return (_leftSwipeHandlers$0$ = (_leftSwipeHandlers$0$2 = leftSwipeHandlers[0].props).onSwipe) === null || _leftSwipeHandlers$0$ === void 0 ? void 0 : _leftSwipeHandlers$0$.call(_leftSwipeHandlers$0$2);
|
|
98
|
+
} : undefined,
|
|
99
|
+
onRightAction: isRightSwipeHandler ? () => {
|
|
100
|
+
var _rightSwipeHandlers$, _rightSwipeHandlers$2;
|
|
101
|
+
return (_rightSwipeHandlers$ = (_rightSwipeHandlers$2 = rightSwipeHandlers[0].props).onSwipe) === null || _rightSwipeHandlers$ === void 0 ? void 0 : _rightSwipeHandlers$.call(_rightSwipeHandlers$2);
|
|
102
|
+
} : undefined,
|
|
103
|
+
closeOnRowPress: closeOnPress,
|
|
104
|
+
friction: friction
|
|
105
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
106
|
+
style: styles.behindContainer
|
|
107
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
style: styles.behindContainerItem
|
|
109
|
+
}, (isLeftSwipeHandler ? leftSwipeHandlers : leftButtons).map((item, index) => renderBehindItem(item.props, index))), /*#__PURE__*/React.createElement(View, {
|
|
110
|
+
style: styles.behindContainerItem
|
|
111
|
+
}, (isRightSwipeHandler ? rightSwipeHandlers : rightButtons).map((item, index) => renderBehindItem(item.props, index)))), /*#__PURE__*/React.createElement(View, {
|
|
112
|
+
style: [styles.surfaceContainer, {
|
|
113
|
+
backgroundColor: theme.colors.background
|
|
114
|
+
}, surfaceContainerStyles]
|
|
115
|
+
}, remainingChildren)));
|
|
116
|
+
};
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
parentContainer: {
|
|
119
|
+
overflow: "hidden",
|
|
120
|
+
minHeight: 50
|
|
121
|
+
},
|
|
122
|
+
behindContainer: {
|
|
123
|
+
flex: 1,
|
|
124
|
+
width: "100%",
|
|
125
|
+
height: "100%",
|
|
126
|
+
flexDirection: "row"
|
|
127
|
+
},
|
|
128
|
+
behindContainerItem: {
|
|
129
|
+
flex: 1,
|
|
130
|
+
flexDirection: "row"
|
|
131
|
+
},
|
|
132
|
+
buttonContainer: {
|
|
133
|
+
flex: 1,
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
justifyContent: "center"
|
|
136
|
+
},
|
|
137
|
+
surfaceContainer: {
|
|
138
|
+
flexDirection: "row",
|
|
139
|
+
width: "100%",
|
|
140
|
+
height: "100%",
|
|
141
|
+
padding: 10,
|
|
142
|
+
alignItems: "center",
|
|
143
|
+
overflow: "hidden"
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
export default withTheme(SwipeableView);
|
|
147
|
+
//# sourceMappingURL=SwipeableView.js.map
|