@draftbit/core 46.8.2-fee87c.2 → 46.9.1-01e871.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 +89 -0
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +464 -0
- package/lib/commonjs/components/BottomSheet/index.js +13 -0
- package/lib/commonjs/components/CircleImage.js +15 -1
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Shadow.js +46 -0
- package/lib/commonjs/components/TabView/TabView.js +22 -6
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/mappings/BottomSheet.js +75 -0
- package/lib/commonjs/mappings/FlashList.js +2 -8
- package/lib/commonjs/mappings/Markdown.js +27 -0
- package/lib/commonjs/mappings/Shadow.js +102 -0
- package/lib/commonjs/mappings/TabView.js +6 -5
- package/lib/commonjs/mappings/TabViewItem.js +5 -3
- package/lib/module/components/BottomSheet/BottomSheet.js +81 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +470 -0
- package/lib/module/components/BottomSheet/index.js +1 -0
- package/lib/module/components/Markdown.js +20 -0
- package/lib/module/components/Shadow.js +38 -0
- package/lib/module/components/TabView/TabView.js +22 -5
- package/lib/module/index.js +3 -0
- package/lib/module/mappings/BottomSheet.js +68 -0
- package/lib/module/mappings/FlashList.js +3 -9
- package/lib/module/mappings/Markdown.js +20 -0
- package/lib/module/mappings/Shadow.js +95 -0
- package/lib/module/mappings/TabView.js +7 -6
- package/lib/module/mappings/TabViewItem.js +6 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +20 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +170 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Markdown.d.ts +8 -0
- package/lib/typescript/src/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/components/Shadow.d.ts +24 -0
- package/lib/typescript/src/components/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts.map +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +1 -1
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +120 -0
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/mappings/FlashList.d.ts +0 -6
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Markdown.d.ts +20 -0
- package/lib/typescript/src/mappings/Markdown.d.ts.map +1 -0
- package/lib/typescript/src/mappings/Shadow.d.ts +173 -0
- package/lib/typescript/src/mappings/Shadow.d.ts.map +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TabViewItem.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/components/BottomSheet/BottomSheet.js +57 -0
- package/src/components/BottomSheet/BottomSheet.tsx +121 -0
- package/src/components/BottomSheet/BottomSheetComponent.js +437 -0
- package/src/components/BottomSheet/BottomSheetComponent.tsx +895 -0
- package/src/components/BottomSheet/index.js +1 -0
- package/src/components/BottomSheet/index.ts +1 -0
- package/src/components/Markdown.js +10 -0
- package/src/components/Markdown.tsx +22 -0
- package/src/components/Shadow.js +16 -0
- package/src/components/Shadow.tsx +62 -0
- package/src/components/TabView/TabView.js +16 -7
- package/src/components/TabView/TabView.tsx +25 -7
- package/src/components/TabView/TabViewItem.tsx +1 -1
- package/src/index.js +3 -0
- package/src/index.tsx +5 -0
- package/src/mappings/BottomSheet.js +64 -0
- package/src/mappings/BottomSheet.ts +78 -0
- package/src/mappings/FlashList.js +9 -9
- package/src/mappings/FlashList.ts +9 -9
- package/src/mappings/Markdown.js +25 -0
- package/src/mappings/Markdown.ts +32 -0
- package/src/mappings/Shadow.js +95 -0
- package/src/mappings/Shadow.ts +104 -0
- package/src/mappings/TabView.js +11 -5
- package/src/mappings/TabView.ts +11 -5
- package/src/mappings/TabViewItem.js +4 -2
- package/src/mappings/TabViewItem.ts +4 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNativeShadow = require("react-native-shadow-2");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
const Shadow = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
offsetX = 0,
|
|
14
|
+
offsetY = 0,
|
|
15
|
+
showShadowSideStart = true,
|
|
16
|
+
showShadowSideEnd = true,
|
|
17
|
+
showShadowSideTop = true,
|
|
18
|
+
showShadowSideBottom = true,
|
|
19
|
+
showShadowCornerTopStart = true,
|
|
20
|
+
showShadowCornerTopEnd = true,
|
|
21
|
+
showShadowCornerBottomStart = true,
|
|
22
|
+
showShadowCornerBottomEnd = true,
|
|
23
|
+
paintInside = false,
|
|
24
|
+
style,
|
|
25
|
+
...rest
|
|
26
|
+
} = _ref;
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, _extends({
|
|
28
|
+
offset: [offsetX, offsetY],
|
|
29
|
+
sides: {
|
|
30
|
+
start: showShadowSideStart,
|
|
31
|
+
end: showShadowSideEnd,
|
|
32
|
+
top: showShadowSideTop,
|
|
33
|
+
bottom: showShadowSideBottom
|
|
34
|
+
},
|
|
35
|
+
corners: {
|
|
36
|
+
topStart: showShadowCornerTopStart,
|
|
37
|
+
topEnd: showShadowCornerTopEnd,
|
|
38
|
+
bottomStart: showShadowCornerBottomStart,
|
|
39
|
+
bottomEnd: showShadowCornerBottomEnd
|
|
40
|
+
},
|
|
41
|
+
containerStyle: style,
|
|
42
|
+
paintInside: paintInside
|
|
43
|
+
}, rest));
|
|
44
|
+
};
|
|
45
|
+
var _default = Shadow;
|
|
46
|
+
exports.default = _default;
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNativeTabView = require("react-native-tab-view");
|
|
9
|
-
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
10
9
|
var _theming = require("../../theming");
|
|
11
|
-
|
|
10
|
+
var _utilities = require("../../utilities");
|
|
12
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -33,12 +32,22 @@ const TabViewComponent = _ref => {
|
|
|
33
32
|
const [index, setIndex] = React.useState(0);
|
|
34
33
|
const [routes, setRoutes] = React.useState([]);
|
|
35
34
|
const [tabScenes, setTabScenes] = React.useState({});
|
|
35
|
+
const {
|
|
36
|
+
textStyles,
|
|
37
|
+
viewStyles
|
|
38
|
+
} = (0, _utilities.extractStyles)(style);
|
|
39
|
+
|
|
40
|
+
//Check type of child using props
|
|
41
|
+
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
42
|
+
const instanceOfTabViewItemProps = object => {
|
|
43
|
+
return "title" in object;
|
|
44
|
+
};
|
|
36
45
|
|
|
37
46
|
//Populate routes and scenes based on children
|
|
38
47
|
React.useEffect(() => {
|
|
39
48
|
const newRoutes = [];
|
|
40
49
|
const scenes = {};
|
|
41
|
-
React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && child.
|
|
50
|
+
React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child) && instanceOfTabViewItemProps(child.props)).forEach((item, idx) => {
|
|
42
51
|
const child = item;
|
|
43
52
|
newRoutes.push({
|
|
44
53
|
key: idx.toString(),
|
|
@@ -67,6 +76,7 @@ const TabViewComponent = _ref => {
|
|
|
67
76
|
indicatorStyle: {
|
|
68
77
|
backgroundColor: indicatorColor || theme.colors.primary
|
|
69
78
|
},
|
|
79
|
+
labelStyle: textStyles,
|
|
70
80
|
renderIcon: _ref2 => {
|
|
71
81
|
let {
|
|
72
82
|
route,
|
|
@@ -75,15 +85,21 @@ const TabViewComponent = _ref => {
|
|
|
75
85
|
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
76
86
|
name: route.icon,
|
|
77
87
|
color: color,
|
|
78
|
-
size:
|
|
88
|
+
size: 16
|
|
79
89
|
}) : null;
|
|
80
90
|
},
|
|
81
|
-
style:
|
|
91
|
+
style: {
|
|
82
92
|
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
83
|
-
}
|
|
93
|
+
}
|
|
84
94
|
}));
|
|
85
95
|
};
|
|
96
|
+
|
|
97
|
+
//Cannot render TabView without at least one tab
|
|
98
|
+
if (!routes.length) {
|
|
99
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
100
|
+
}
|
|
86
101
|
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
|
|
102
|
+
style: [viewStyles],
|
|
87
103
|
navigationState: {
|
|
88
104
|
index,
|
|
89
105
|
routes
|
package/lib/commonjs/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Banner", {
|
|
|
51
51
|
return _Banner.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "BottomSheet", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _BottomSheet.BottomSheet;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
Object.defineProperty(exports, "Button", {
|
|
55
61
|
enumerable: true,
|
|
56
62
|
get: function () {
|
|
@@ -177,6 +183,12 @@ Object.defineProperty(exports, "Link", {
|
|
|
177
183
|
return _Text.Link;
|
|
178
184
|
}
|
|
179
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "Markdown", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _Markdown.default;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
180
192
|
Object.defineProperty(exports, "NumberInput", {
|
|
181
193
|
enumerable: true,
|
|
182
194
|
get: function () {
|
|
@@ -273,6 +285,12 @@ Object.defineProperty(exports, "ScreenContainer", {
|
|
|
273
285
|
return _ScreenContainer.default;
|
|
274
286
|
}
|
|
275
287
|
});
|
|
288
|
+
Object.defineProperty(exports, "Shadow", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () {
|
|
291
|
+
return _Shadow.default;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
276
294
|
Object.defineProperty(exports, "Slider", {
|
|
277
295
|
enumerable: true,
|
|
278
296
|
get: function () {
|
|
@@ -425,8 +443,11 @@ var _ActionSheet = require("./components/ActionSheet");
|
|
|
425
443
|
var _Swiper = require("./components/Swiper");
|
|
426
444
|
var _Layout = require("./components/Layout");
|
|
427
445
|
var _index = require("./components/RadioButton/index");
|
|
446
|
+
var _Shadow = _interopRequireDefault(require("./components/Shadow"));
|
|
428
447
|
var _DeckSwiper = require("./components/DeckSwiper");
|
|
429
448
|
var _TabView = require("./components/TabView");
|
|
449
|
+
var _Markdown = _interopRequireDefault(require("./components/Markdown"));
|
|
450
|
+
var _BottomSheet = require("./components/BottomSheet");
|
|
430
451
|
var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
|
|
431
452
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
432
453
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
@@ -0,0 +1,75 @@
|
|
|
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 SEED_DATA = {
|
|
9
|
+
name: "Bottom Sheet",
|
|
10
|
+
tag: "BottomSheet",
|
|
11
|
+
description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
|
|
12
|
+
category: _types.COMPONENT_TYPES.bottomsheet,
|
|
13
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
+
layout: {
|
|
15
|
+
paddingHorizontal: 16,
|
|
16
|
+
paddingVertical: 10,
|
|
17
|
+
flex: 1
|
|
18
|
+
},
|
|
19
|
+
triggers: [_types.Triggers.OnSettle],
|
|
20
|
+
props: {
|
|
21
|
+
onSettle: (0, _types.createActionProp)({
|
|
22
|
+
label: "On settle",
|
|
23
|
+
description: "Action to execute when sheet settles on a snap point"
|
|
24
|
+
}),
|
|
25
|
+
snapPoints: (0, _types.createStaticArrayProp)({
|
|
26
|
+
label: "Snap points",
|
|
27
|
+
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)",
|
|
28
|
+
defaultValue: ["10%", "50%", "80%"]
|
|
29
|
+
}),
|
|
30
|
+
initialSnapIndex: (0, _types.createStaticNumberProp)({
|
|
31
|
+
label: "Initial snap index",
|
|
32
|
+
description: "Index of the snap point to be used as the initial point",
|
|
33
|
+
defaultValue: 0,
|
|
34
|
+
required: false
|
|
35
|
+
}),
|
|
36
|
+
showHandle: (0, _types.createStaticBoolProp)({
|
|
37
|
+
label: "Show handle",
|
|
38
|
+
description: "Whether to show the top handle or not",
|
|
39
|
+
defaultValue: true
|
|
40
|
+
}),
|
|
41
|
+
handleColor: (0, _types.createColorProp)({
|
|
42
|
+
label: "Handle color",
|
|
43
|
+
description: "Color of the top handle",
|
|
44
|
+
defaultValue: "divider"
|
|
45
|
+
}),
|
|
46
|
+
topBorderRadius: (0, _types.createStaticNumberProp)({
|
|
47
|
+
label: "Top border radius",
|
|
48
|
+
description: "Border radius of top corners",
|
|
49
|
+
defaultValue: 20,
|
|
50
|
+
required: false
|
|
51
|
+
}),
|
|
52
|
+
borderWidth: (0, _types.createStaticNumberProp)({
|
|
53
|
+
label: "Border width",
|
|
54
|
+
description: "Width of bottom sheet borders",
|
|
55
|
+
defaultValue: 1,
|
|
56
|
+
required: false
|
|
57
|
+
}),
|
|
58
|
+
borderColor: (0, _types.createColorProp)({
|
|
59
|
+
label: "Border color",
|
|
60
|
+
description: "Color of bottom sheet borders",
|
|
61
|
+
defaultValue: "divider"
|
|
62
|
+
}),
|
|
63
|
+
showsVerticalScrollIndicator: (0, _types.createStaticBoolProp)({
|
|
64
|
+
label: "Show Vertical Scroll Indicator",
|
|
65
|
+
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
66
|
+
defaultValue: true
|
|
67
|
+
}),
|
|
68
|
+
bounces: (0, _types.createStaticBoolProp)({
|
|
69
|
+
label: "Bounce",
|
|
70
|
+
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.",
|
|
71
|
+
defaultValue: true
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -11,10 +11,7 @@ const SEED_DATA = [{
|
|
|
11
11
|
description: "Masonry Flashlist by Shopify",
|
|
12
12
|
packageName: "@shopify/flash-list",
|
|
13
13
|
category: _types.COMPONENT_TYPES.data,
|
|
14
|
-
stylesPanelSections: _types.
|
|
15
|
-
layout: {
|
|
16
|
-
flex: 1
|
|
17
|
-
},
|
|
14
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
|
|
18
15
|
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
19
16
|
props: {
|
|
20
17
|
onRefresh: (0, _types.createActionProp)(),
|
|
@@ -61,10 +58,7 @@ const SEED_DATA = [{
|
|
|
61
58
|
description: "Flashlist by Shopify",
|
|
62
59
|
packageName: "@shopify/flash-list",
|
|
63
60
|
category: _types.COMPONENT_TYPES.data,
|
|
64
|
-
stylesPanelSections: _types.
|
|
65
|
-
layout: {
|
|
66
|
-
flex: 1
|
|
67
|
-
},
|
|
61
|
+
stylesPanelSections: [_types.StylesPanelSections.Background, _types.StylesPanelSections.MarginsAndPaddings],
|
|
68
62
|
triggers: [_types.Triggers.OnRefresh, _types.Triggers.OnEndReached],
|
|
69
63
|
props: {
|
|
70
64
|
onRefresh: (0, _types.createActionProp)(),
|
|
@@ -0,0 +1,27 @@
|
|
|
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 SEED_DATA = {
|
|
9
|
+
name: "Markdown",
|
|
10
|
+
tag: "Markdown",
|
|
11
|
+
description: "A component that renders markdown",
|
|
12
|
+
category: _types.COMPONENT_TYPES.text,
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Effects],
|
|
14
|
+
props: {
|
|
15
|
+
children: {
|
|
16
|
+
group: _types.GROUPS.data,
|
|
17
|
+
label: "Markdown Text",
|
|
18
|
+
description: "Markdown text to be rendered ",
|
|
19
|
+
editable: true,
|
|
20
|
+
required: true,
|
|
21
|
+
formType: _types.FORM_TYPES.string,
|
|
22
|
+
propType: _types.PROP_TYPES.STRING,
|
|
23
|
+
defaultValue: "### Markdown"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -0,0 +1,102 @@
|
|
|
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 SEED_DATA = {
|
|
9
|
+
name: "Shadow",
|
|
10
|
+
tag: "Shadow",
|
|
11
|
+
description: "A cross-platform, universal shadow.",
|
|
12
|
+
category: _types.COMPONENT_TYPES.view,
|
|
13
|
+
stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
14
|
+
props: {
|
|
15
|
+
disabled: (0, _types.createDisabledProp)({
|
|
16
|
+
description: "Disables the shadow."
|
|
17
|
+
}),
|
|
18
|
+
startColor: (0, _types.createColorProp)({
|
|
19
|
+
label: "Start Color",
|
|
20
|
+
description: "The initial gradient color of the shadow.",
|
|
21
|
+
defaultValue: null
|
|
22
|
+
}),
|
|
23
|
+
endColor: (0, _types.createColorProp)({
|
|
24
|
+
label: "End Color",
|
|
25
|
+
description: "The final gradient color of the shadow.",
|
|
26
|
+
defaultValue: null
|
|
27
|
+
}),
|
|
28
|
+
distance: (0, _types.createStaticNumberProp)({
|
|
29
|
+
label: "Distance",
|
|
30
|
+
description: "The distance of the shadow."
|
|
31
|
+
}),
|
|
32
|
+
paintInside: (0, _types.createStaticBoolProp)({
|
|
33
|
+
label: "Paint Inside",
|
|
34
|
+
description: "Apply the shadow below/inside the content.",
|
|
35
|
+
defaultValue: false
|
|
36
|
+
}),
|
|
37
|
+
stretch: (0, _types.createStaticBoolProp)({
|
|
38
|
+
label: "Stretch",
|
|
39
|
+
description: "Force children to occupy all available horizontal space.",
|
|
40
|
+
defaultValue: null
|
|
41
|
+
}),
|
|
42
|
+
offsetX: (0, _types.createStaticNumberProp)({
|
|
43
|
+
label: "Offset X",
|
|
44
|
+
description: "Moves the shadow in the x direction",
|
|
45
|
+
defeaultValue: 0
|
|
46
|
+
}),
|
|
47
|
+
offsetY: (0, _types.createStaticNumberProp)({
|
|
48
|
+
label: "Offset Y",
|
|
49
|
+
description: "Moves the shadow in the y direction",
|
|
50
|
+
defeaultValue: 0
|
|
51
|
+
}),
|
|
52
|
+
showShadowSideStart: (0, _types.createStaticBoolProp)({
|
|
53
|
+
label: "Show Shadow Start",
|
|
54
|
+
description: "Whether to show shadow on the start side or not",
|
|
55
|
+
defaultValue: true,
|
|
56
|
+
group: _types.GROUPS.advanced
|
|
57
|
+
}),
|
|
58
|
+
showShadowSideEnd: (0, _types.createStaticBoolProp)({
|
|
59
|
+
label: "Show Shadow End",
|
|
60
|
+
description: "Whether to show shadow on the end side or not",
|
|
61
|
+
defaultValue: true,
|
|
62
|
+
group: _types.GROUPS.advanced
|
|
63
|
+
}),
|
|
64
|
+
showShadowSideTop: (0, _types.createStaticBoolProp)({
|
|
65
|
+
label: "Show Shadow Top",
|
|
66
|
+
description: "Whether to show shadow on the top side or not",
|
|
67
|
+
defaultValue: true,
|
|
68
|
+
group: _types.GROUPS.advanced
|
|
69
|
+
}),
|
|
70
|
+
showShadowSideBottom: (0, _types.createStaticBoolProp)({
|
|
71
|
+
label: "Show Shadow Bottom",
|
|
72
|
+
description: "Whether to show shadow on the bottom side or not",
|
|
73
|
+
defaultValue: true,
|
|
74
|
+
group: _types.GROUPS.advanced
|
|
75
|
+
}),
|
|
76
|
+
showShadowCornerTopStart: (0, _types.createStaticBoolProp)({
|
|
77
|
+
label: "Show Shadow Top Start Corner",
|
|
78
|
+
description: "Whether to show shadow on the top start corner or not",
|
|
79
|
+
defaultValue: true,
|
|
80
|
+
group: _types.GROUPS.advanced
|
|
81
|
+
}),
|
|
82
|
+
showShadowCornerTopEnd: (0, _types.createStaticBoolProp)({
|
|
83
|
+
label: "Show Shadow Top End Corner",
|
|
84
|
+
description: "Whether to show shadow on the top end corner or not",
|
|
85
|
+
defaultValue: true,
|
|
86
|
+
group: _types.GROUPS.advanced
|
|
87
|
+
}),
|
|
88
|
+
showShadowCornerBottomStart: (0, _types.createStaticBoolProp)({
|
|
89
|
+
label: "Show Shadow Bottom Start Corner",
|
|
90
|
+
description: "Whether to show shadow on the bottom start corner or not",
|
|
91
|
+
defaultValue: true,
|
|
92
|
+
group: _types.GROUPS.advanced
|
|
93
|
+
}),
|
|
94
|
+
showShadowCornerBottomEnd: (0, _types.createStaticBoolProp)({
|
|
95
|
+
label: "Show Shadow Bottom End Corner",
|
|
96
|
+
description: "Whether to show shadow on the bottom end corner or not",
|
|
97
|
+
defaultValue: true,
|
|
98
|
+
group: _types.GROUPS.advanced
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.SEED_DATA = SEED_DATA;
|
|
@@ -10,7 +10,7 @@ const SEED_DATA = {
|
|
|
10
10
|
tag: "TabView",
|
|
11
11
|
description: "Tab view container",
|
|
12
12
|
category: _types.COMPONENT_TYPES.swiper,
|
|
13
|
-
stylesPanelSections: [
|
|
13
|
+
stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects, _types.StylesPanelSections.LayoutSelectedItem, _types.StylesPanelSections.Background, _types.StylesPanelSections.Typography],
|
|
14
14
|
triggers: [_types.Triggers.OnIndexChanged, _types.Triggers.OnEndReached],
|
|
15
15
|
props: {
|
|
16
16
|
onIndexChanged: (0, _types.createActionProp)({
|
|
@@ -39,9 +39,9 @@ const SEED_DATA = {
|
|
|
39
39
|
defaultValue: true
|
|
40
40
|
}),
|
|
41
41
|
scrollEnabled: (0, _types.createStaticBoolProp)({
|
|
42
|
-
label: "Scroll Enabled",
|
|
42
|
+
label: "Tab Scroll Enabled",
|
|
43
43
|
description: "Whether scrolling of tabs is enabled or not",
|
|
44
|
-
defaultValue:
|
|
44
|
+
defaultValue: false
|
|
45
45
|
}),
|
|
46
46
|
activeColor: (0, _types.createColorProp)({
|
|
47
47
|
label: "Active Color",
|
|
@@ -55,8 +55,9 @@ const SEED_DATA = {
|
|
|
55
55
|
}),
|
|
56
56
|
pressColor: (0, _types.createColorProp)({
|
|
57
57
|
label: "Press Color",
|
|
58
|
-
description: "Color of ripple when pressed
|
|
59
|
-
defaultValue: "primary"
|
|
58
|
+
description: "Color of ripple when pressed",
|
|
59
|
+
defaultValue: "primary",
|
|
60
|
+
group: _types.GROUPS.android
|
|
60
61
|
}),
|
|
61
62
|
indicatorColor: (0, _types.createColorProp)({
|
|
62
63
|
label: "Indicator Color",
|
|
@@ -18,8 +18,9 @@ const SEED_DATA = {
|
|
|
18
18
|
title: (0, _types.createTextProp)({
|
|
19
19
|
label: "Title",
|
|
20
20
|
description: "Title of tab item",
|
|
21
|
-
defaultValue:
|
|
22
|
-
required: true
|
|
21
|
+
defaultValue: "Title",
|
|
22
|
+
required: true,
|
|
23
|
+
group: _types.GROUPS.basic
|
|
23
24
|
}),
|
|
24
25
|
icon: (0, _types.createIconProp)({
|
|
25
26
|
defaultValue: null,
|
|
@@ -28,7 +29,8 @@ const SEED_DATA = {
|
|
|
28
29
|
accessibilityLabel: (0, _types.createTextProp)({
|
|
29
30
|
label: "Accessibility Label",
|
|
30
31
|
description: "Accessibility Label",
|
|
31
|
-
defaultValue: null
|
|
32
|
+
defaultValue: null,
|
|
33
|
+
group: _types.GROUPS.accessibility
|
|
32
34
|
})
|
|
33
35
|
}
|
|
34
36
|
};
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { StyleSheet, View } from "react-native";
|
|
4
|
+
import BottomSheetComponent from "./BottomSheetComponent";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
const BottomSheet = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme,
|
|
9
|
+
snapPoints = ["10%", "50%", "80%"],
|
|
10
|
+
initialSnapIndex = 0,
|
|
11
|
+
showHandle = true,
|
|
12
|
+
handleColor = theme.colors.divider,
|
|
13
|
+
topBorderRadius = 20,
|
|
14
|
+
borderWidth = 1,
|
|
15
|
+
borderColor = theme.colors.divider,
|
|
16
|
+
onSettle,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
} = _ref;
|
|
21
|
+
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
22
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
style: styles.parentContainer,
|
|
24
|
+
pointerEvents: "box-none"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(BottomSheetComponent, _extends({
|
|
26
|
+
componentType: "ScrollView",
|
|
27
|
+
snapPoints: snapPoints,
|
|
28
|
+
initialSnapIndex: initialSnapIndex,
|
|
29
|
+
renderHandle: () => /*#__PURE__*/React.createElement(React.Fragment, null, showHandle && /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
style: [styles.handleContainer, {
|
|
31
|
+
backgroundColor,
|
|
32
|
+
borderTopLeftRadius: topBorderRadius,
|
|
33
|
+
borderTopRightRadius: topBorderRadius
|
|
34
|
+
}]
|
|
35
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
style: [styles.handle, {
|
|
37
|
+
backgroundColor: handleColor
|
|
38
|
+
}]
|
|
39
|
+
}))),
|
|
40
|
+
contentContainerStyle: [styles.contentContainerStyle, style],
|
|
41
|
+
containerStyle: StyleSheet.flatten([styles.containerStyle, {
|
|
42
|
+
backgroundColor,
|
|
43
|
+
borderTopLeftRadius: topBorderRadius,
|
|
44
|
+
borderTopRightRadius: topBorderRadius,
|
|
45
|
+
borderWidth,
|
|
46
|
+
borderColor
|
|
47
|
+
}]),
|
|
48
|
+
onSettle: onSettle
|
|
49
|
+
}, rest), children));
|
|
50
|
+
};
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
//Render on top of everything
|
|
53
|
+
parentContainer: {
|
|
54
|
+
position: "absolute",
|
|
55
|
+
left: 0,
|
|
56
|
+
right: 0,
|
|
57
|
+
top: 0,
|
|
58
|
+
bottom: 0,
|
|
59
|
+
zIndex: 10,
|
|
60
|
+
overflow: "hidden"
|
|
61
|
+
},
|
|
62
|
+
contentContainerStyle: {
|
|
63
|
+
paddingHorizontal: 16,
|
|
64
|
+
paddingVertical: 10,
|
|
65
|
+
flex: 1
|
|
66
|
+
},
|
|
67
|
+
containerStyle: {
|
|
68
|
+
flex: 1,
|
|
69
|
+
overflow: "hidden"
|
|
70
|
+
},
|
|
71
|
+
handleContainer: {
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
paddingVertical: 20
|
|
74
|
+
},
|
|
75
|
+
handle: {
|
|
76
|
+
width: 40,
|
|
77
|
+
height: 2,
|
|
78
|
+
borderRadius: 4
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export default withTheme(BottomSheet);
|