@draftbit/core 46.11.5-6c4be5.2 → 46.11.5-d49547.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/Elevation.js +2 -13
- package/lib/commonjs/components/Elevation.js.map +1 -1
- 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 +8 -34
- package/lib/commonjs/mappings/BottomSheet.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/StarRating.js +23 -4
- package/lib/module/components/StarRating.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 +9 -35
- 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 -35
- package/src/mappings/BottomSheet.ts +8 -40
- 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
|
@@ -17,30 +17,17 @@ 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
|
-
}),
|
|
26
|
-
middleSnapPosition: (0, _types.createStaticNumberProp)({
|
|
27
|
-
label: "Middle snap position",
|
|
28
|
-
description: "Middle postion where bottom sheet can snap to. A numerical value that represents distance from the top",
|
|
29
|
-
defaultValue: "10%",
|
|
30
|
-
required: false
|
|
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%"]
|
|
31
24
|
}),
|
|
32
|
-
|
|
33
|
-
label: "
|
|
34
|
-
description: "
|
|
35
|
-
defaultValue:
|
|
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,
|
|
36
29
|
required: false
|
|
37
30
|
}),
|
|
38
|
-
initialSnapPosition: (0, _types.createTextEnumProp)({
|
|
39
|
-
label: "Initial snap position",
|
|
40
|
-
description: "Initial snap position that bottom sheet will snap to",
|
|
41
|
-
options: ["top", "middle", "bottom"],
|
|
42
|
-
defaultValue: "bottom"
|
|
43
|
-
}),
|
|
44
31
|
showHandle: (0, _types.createStaticBoolProp)({
|
|
45
32
|
label: "Show handle",
|
|
46
33
|
description: "Whether to show the top sheet handle or not",
|
|
@@ -77,19 +64,6 @@ const SEED_DATA = {
|
|
|
77
64
|
label: "Bounce",
|
|
78
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.",
|
|
79
66
|
defaultValue: true
|
|
80
|
-
}),
|
|
81
|
-
snapPoints: (0, _types.createArrayProp)({
|
|
82
|
-
label: "Snap points",
|
|
83
|
-
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",
|
|
84
|
-
defaultValue: null,
|
|
85
|
-
group: _types.GROUPS.advanced
|
|
86
|
-
}),
|
|
87
|
-
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
88
|
-
label: "Initial snap index",
|
|
89
|
-
description: "Index of the snap point to be used as the initial point. Overrides initial snap position",
|
|
90
|
-
defaultValue: null,
|
|
91
|
-
required: false,
|
|
92
|
-
group: _types.GROUPS.advanced
|
|
93
67
|
})
|
|
94
68
|
}
|
|
95
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;AAWO,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,UAAU,EAAE,IAAAC,sBAAe,EAAC;MAC1BF,KAAK,EAAE,aAAa;MACpBZ,WAAW,EACT,mKAAmK;MACrKe,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK;IACpC,CAAC,CAAC;IACFC,gBAAgB,EAAE,IAAAC,6BAAsB,EAAC;MACvCL,KAAK,EAAE,oBAAoB;MAC3BZ,WAAW,EAAE,yDAAyD;MACtEe,YAAY,EAAE,CAAC;MACfG,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFC,UAAU,EAAE,IAAAC,2BAAoB,EAAC;MAC/BR,KAAK,EAAE,aAAa;MACpBZ,WAAW,EAAE,6CAA6C;MAC1De,YAAY,EAAE;IAChB,CAAC,CAAC;IACFM,WAAW,EAAE,IAAAC,sBAAe,EAAC;MAC3BV,KAAK,EAAE,cAAc;MACrBZ,WAAW,EAAE,yBAAyB;MACtCe,YAAY,EAAE;IAChB,CAAC,CAAC;IACFQ,eAAe,EAAE,IAAAN,6BAAsB,EAAC;MACtCL,KAAK,EAAE,mBAAmB;MAC1BZ,WAAW,EAAE,8BAA8B;MAC3Ce,YAAY,EAAE,EAAE;MAChBG,QAAQ,EAAE;IACZ,CAAC,CAAC;IACFM,WAAW,EAAE,IAAAP,6BAAsB,EAAC;MAClCL,KAAK,EAAE,cAAc;MACrBZ,WAAW,EAAE,+BAA+B;MAC5Ce,YAAY,EAAE,CAAC;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"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
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.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","view","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;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;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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G,EAAE,qBAAqB;EAC1BlB,WAAW,EAAE,8CAA8C;EAC3DoB,QAAQ,EAAEC,sBAAe,CAACC,IAAI;EAC9BC,mBAAmB,EAAE,EAAE;EACvB6B,QAAQ,EAAE,CAACC,eAAQ,CAACC,OAAO,CAAC;EAC5BtB,KAAK,EAAE;IACL,GAAGpC,+BAA+B;IAClC2D,OAAO,EAAE,IAAAC,uBAAgB;EAC3B;AACF,CAAC,EACD;EACEvC,IAAI,EAAE,8BAA8B;EACpCC,GAAG,EAAE,2BAA2B;EAChClB,WAAW,EAAE,4DAA4D;EACzEoB,QAAQ,EAAEC,sBAAe,CAACC,IAAI;EAC9BC,mBAAmB,EAAE,EAAE;EACvB6B,QAAQ,EAAE,CAACC,eAAQ,CAACI,OAAO,CAAC;EAC5BzB,KAAK,EAAE;IACL,GAAGpC,+BAA+B;IAClC8D,OAAO,EAAE,IAAAF,uBAAgB,EAAC;MACxBzD,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;IACT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J,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,KAAK,CAACK,MAAM,CAACC,OAAO;IAClCC,eAAe,GAAG,EAAE;IACpBC,WAAW,GAAG,CAAC;IACfC,WAAW,GAAGT,KAAK,CAACK,MAAM,CAACC,OAAO;IAClCI,QAAQ;IACRC,KAAK;IACLC,QAAQ;IACR,GAAGC;EACL,CAAC;EACC,MAAMC,eAAe,GACnB,CAACH,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAgBG,eAA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,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"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { View, StyleSheet, Pressable } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -32,9 +31,10 @@ const StarRating = _ref => {
|
|
|
32
31
|
!!onPress && onPress(r);
|
|
33
32
|
}, [onPress]);
|
|
34
33
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
35
|
-
return /*#__PURE__*/React.createElement(View,
|
|
36
|
-
style: [styles.container, style]
|
|
37
|
-
|
|
34
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: [styles.container, style],
|
|
36
|
+
...rest
|
|
37
|
+
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(View, {
|
|
38
38
|
key: i,
|
|
39
39
|
style: {
|
|
40
40
|
display: "flex"
|
|
@@ -75,4 +75,23 @@ 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);
|
|
78
97
|
//# 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","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.
|
|
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","createElement","styles","container","Array","map","_","i","key","display","name","size","color","touchContainer","pressable","create","flexDirection","alignItems","position","top","right","left","bottom","zIndex","flex","height","width"],"sourceRoot":"../../../src","sources":["components/StarRating.js"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,EAAEC,UAAU,EAAEC,SAAS,QAAS,cAAc;AAC3D,SAASC,SAAS,QAAQ,YAAY;AACtC,MAAMC,UAAU,GAAG,QAA8I;EAAA,IAA7I;IAAEC,IAAI;IAAEC,QAAQ,GAAG,EAAE;IAAEC,QAAQ,GAAG,CAAC;IAAEC,MAAM,GAAG,CAAC;IAAEC,YAAY;IAAEC,UAAU,GAAG,KAAK;IAAEC,WAAW;IAAEC,aAAa;IAAEC,KAAK;IAAEC,OAAO;IAAE,GAAGC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;IAAEI,IAAI,EAAE9B,QAAQ;IAAE+B,KAAK,EAAEd,aAAa,GAAGS,CAAC,GAAGrB,WAAW,GAAGC;EAAc,CAAC,CAAC,EACzGF,UAAU,iBAAKX,KAAK,CAAC2B,aAAa,CAAC1B,IAAI,EAAE;IAAEa,KAAK,EAAEc,MAAM,CAACW;EAAe,CAAC,eACrEvC,KAAK,CAAC2B,aAAa,CAACxB,SAAS,EAAE;IAAEW,KAAK,EAAEc,MAAM,CAACY,SAAS;IAAEzB,OAAO,EAAE,MAAMM,aAAa,CAACY,CAAC,GAAG,GAAG;EAAE,CAAC,CAAC,eAClGjC,KAAK,CAAC2B,aAAa,CAACxB,SAAS,EAAE;IAAEW,KAAK,EAAEc,MAAM,CAACY,SAAS;IAAEzB,OAAO,EAAE,MAAMM,aAAa,CAACY,CAAC,GAAG,CAAC;EAAE,CAAC,CAAC,CAAE,CAAE,CAAC,CAAC;AAClH,CAAC;AACD,MAAML,MAAM,GAAG1B,UAAU,CAACuC,MAAM,CAAC;EAC7BZ,SAAS,EAAE;IACPa,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EAChB,CAAC;EACDJ,cAAc,EAAE;IACZJ,OAAO,EAAE,MAAM;IACfO,aAAa,EAAE,KAAK;IACpBE,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACZ,CAAC;EACDT,SAAS,EAAE;IACPU,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACX;AACJ,CAAC,CAAC;AACF,eAAehD,SAAS,CAACC,UAAU,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","Text","Pressable","extractBorderAndMarginStyles","extractEffectStyles","extractFlexItemStyles","extractPositionStyles","extractSizeStyles","extractStyles","SwipeRow","withTheme","SwipeableView","theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","rest","instanceOfSwipeableViewButtonProps","object","instanceOfSwipeableViewSwipeHandlerProps","viewStyles","textStyles","borderStyles","marginStyles","parentContainerStyles","flatten","Object","keys","forEach","key","surfaceContainerStyles","componentWidth","setComponentWidth","useState","leftButtons","useMemo","Children","toArray","filter","child","isValidElement","props","side","rightButtons","leftSwipeHandlers","rightSwipeHandlers","remainingChildren","length","Error","renderBehindItem","index","toString","onPress","styles","buttonContainer","backgroundColor","colors","primary","icon","iconSize","color","surface","title","isLeftSwipeHandler","isRightSwipeHandler","defaultLeftOpenValue","defaultRightOpenValue","event","nativeEvent","layout","width","parentContainer","onSwipe","undefined","behindContainer","behindContainerItem","map","item","surfaceContainer","background","create","overflow","minHeight","flex","height","flexDirection","alignItems","justifyContent","padding"],"sourceRoot":"../../../../src","sources":["components/SwipeableView/SwipeableView.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EAIJC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,OAAOC,SAAS,MAAM,cAAc;AACpC,SACEC,4BAA4B,EAC5BC,mBAAmB,EACnBC,qBAAqB,EACrBC,qBAAqB,EACrBC,iBAAiB,EACjBC,aAAa,QACR,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,8BAA8B;AAGvD,SAASC,SAAS,QAAQ,eAAe;AAyBzC,MAAMC,aAAoE,GAAG,QAevE;EAAA,IAfwE;IAC5EC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,IAAI;IACJC,YAAY;IACZC,aAAa;IACbC,cAAc;IACdC,mBAAmB;IACnBC,oBAAoB;IACpBC,yBAAyB,GAAG,EAAE;IAC9BC,aAAa;IACbC,cAAc;IACdC,QAAQ,GAAG,EAAE;IACb,GAAGC;EACL,CAAC;EACC,MAAMC,kCAAkC,GACtCC,MAAW,IAC4B;IACvC,OAAO,OAAO,IAAIA,MAAM,IAAI,MAAM,IAAIA,MAAM,IAAI,SAAS,IAAIA,MAAM;EACrE,CAAC;EAED,MAAMC,wCAAwC,GAC5CD,MAAW,IACkC;IAC7C,OAAO,OAAO,IAAIA,MAAM,IAAI,MAAM,IAAIA,MAAM,IAAI,SAAS,IAAIA,MAAM;EACrE,CAAC;EAED,MAAM;IAAEE,UAAU;IAAEC;EAAW,CAAC,GAAGtB,aAAa,CAACK,KAAK,CAAC;EAEvD,MAAM;IAAEkB,YAAY;IAAEC;EAAa,CAAC,GAClC7B,4BAA4B,CAAC0B,UAAU,CAAC;EAE1C,MAAMI,qBAAqB,GAAGjC,UAAU,CAACkC,OAAO,CAAC,CAC/CH,YAAY,EACZC,YAAY,EACZ3B,qBAAqB,CAACwB,UAAU,CAAC,EACjCvB,qBAAqB,CAAC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