@draftbit/core 43.4.5-d442fc.1 → 43.4.5-e035fd.1
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/FAB.js +19 -5
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/Markdown.js +30 -0
- package/lib/commonjs/components/Markdown.js.map +1 -0
- package/lib/commonjs/index.js +8 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/Markdown.js +24 -0
- package/lib/commonjs/mappings/Markdown.js.map +1 -0
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js.map +1 -1
- package/lib/module/components/Markdown.js +13 -0
- package/lib/module/components/Markdown.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/LinearGradient.js.map +1 -1
- package/lib/module/mappings/Markdown.js +15 -0
- package/lib/module/mappings/Markdown.js.map +1 -0
- package/lib/typescript/src/components/Markdown.d.ts +12 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/mappings/Markdown.d.ts +9 -0
- package/package.json +3 -4
- package/src/components/Markdown.js +7 -0
- package/src/components/Markdown.tsx +14 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/src/mappings/Markdown.js +14 -0
- package/src/mappings/Markdown.ts +15 -0
- package/lib/commonjs/components/TabView/TabView.js +0 -103
- package/lib/commonjs/components/TabView/TabView.js.map +0 -1
- package/lib/commonjs/components/TabView/TabViewItem.js +0 -27
- package/lib/commonjs/components/TabView/TabViewItem.js.map +0 -1
- package/lib/commonjs/components/TabView/index.js +0 -24
- package/lib/commonjs/components/TabView/index.js.map +0 -1
- package/lib/commonjs/mappings/TabView.js +0 -80
- package/lib/commonjs/mappings/TabView.js.map +0 -1
- package/lib/module/components/TabView/TabView.js +0 -88
- package/lib/module/components/TabView/TabView.js.map +0 -1
- package/lib/module/components/TabView/TabViewItem.js +0 -19
- package/lib/module/components/TabView/TabViewItem.js.map +0 -1
- package/lib/module/components/TabView/index.js +0 -3
- package/lib/module/components/TabView/index.js.map +0 -1
- package/lib/module/mappings/TabView.js +0 -71
- package/lib/module/mappings/TabView.js.map +0 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
- package/lib/typescript/src/components/TabView/index.d.ts +0 -2
- package/lib/typescript/src/mappings/TabView.d.ts +0 -111
- package/src/components/TabView/TabView.js +0 -33
- package/src/components/TabView/TabView.tsx +0 -97
- package/src/components/TabView/TabViewItem.js +0 -5
- package/src/components/TabView/TabViewItem.tsx +0 -21
- package/src/components/TabView/index.js +0 -2
- package/src/components/TabView/index.ts +0 -2
- package/src/mappings/TabView.js +0 -73
- package/src/mappings/TabView.ts +0 -80
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNativeTabView = require("react-native-tab-view");
|
|
11
|
-
|
|
12
|
-
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
function _extends() { _extends = Object.assign || 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); }
|
|
21
|
-
|
|
22
|
-
const TabViewComponent = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
Icon,
|
|
25
|
-
tabBarPosition,
|
|
26
|
-
keyboardDismissMode,
|
|
27
|
-
swipeEnabled,
|
|
28
|
-
scrollEnabled,
|
|
29
|
-
activeColor,
|
|
30
|
-
inactiveColor,
|
|
31
|
-
pressColor,
|
|
32
|
-
indicatorColor,
|
|
33
|
-
style,
|
|
34
|
-
children
|
|
35
|
-
} = _ref;
|
|
36
|
-
const [index, setIndex] = React.useState(0);
|
|
37
|
-
const [routes, setRoutes] = React.useState([]);
|
|
38
|
-
const [tabScenes, setTabScenes] = React.useState({});
|
|
39
|
-
React.useEffect(() => {
|
|
40
|
-
const newRoutes = [];
|
|
41
|
-
const scenes = {};
|
|
42
|
-
React.Children.toArray(children).filter(child => child.type === _TabViewItem.default).forEach(child => {
|
|
43
|
-
var _child$props;
|
|
44
|
-
|
|
45
|
-
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
|
|
46
|
-
var _child$props2, _child$props3;
|
|
47
|
-
|
|
48
|
-
newRoutes.push({
|
|
49
|
-
key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
|
|
50
|
-
...(child === null || child === void 0 ? void 0 : child.props)
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
setRoutes(newRoutes);
|
|
57
|
-
setTabScenes(scenes);
|
|
58
|
-
}, [children]);
|
|
59
|
-
|
|
60
|
-
const indexChangeHandler = i => setIndex(i);
|
|
61
|
-
|
|
62
|
-
const renderTabBar = props => {
|
|
63
|
-
console.log(props);
|
|
64
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
|
|
65
|
-
activeColor: activeColor,
|
|
66
|
-
inactiveColor: inactiveColor,
|
|
67
|
-
pressColor: pressColor,
|
|
68
|
-
scrollEnabled: scrollEnabled,
|
|
69
|
-
indicatorStyle: {
|
|
70
|
-
backgroundColor: indicatorColor
|
|
71
|
-
},
|
|
72
|
-
renderIcon: _ref2 => {
|
|
73
|
-
let {
|
|
74
|
-
route,
|
|
75
|
-
color
|
|
76
|
-
} = _ref2;
|
|
77
|
-
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
78
|
-
name: route.icon,
|
|
79
|
-
color: color,
|
|
80
|
-
size: 36
|
|
81
|
-
}) : null;
|
|
82
|
-
},
|
|
83
|
-
style: style
|
|
84
|
-
}));
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabView, {
|
|
88
|
-
navigationState: {
|
|
89
|
-
index,
|
|
90
|
-
routes
|
|
91
|
-
},
|
|
92
|
-
renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
|
|
93
|
-
renderTabBar: renderTabBar,
|
|
94
|
-
onIndexChange: indexChangeHandler,
|
|
95
|
-
tabBarPosition: tabBarPosition,
|
|
96
|
-
keyboardDismissMode: keyboardDismissMode,
|
|
97
|
-
swipeEnabled: swipeEnabled
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var _default = TabViewComponent;
|
|
102
|
-
exports.default = _default;
|
|
103
|
-
//# sourceMappingURL=TabView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabView.tsx"],"names":["TabViewComponent","Icon","tabBarPosition","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indicatorColor","style","children","index","setIndex","React","useState","routes","setRoutes","tabScenes","setTabScenes","useEffect","newRoutes","scenes","Children","toArray","filter","child","type","TabViewItem","forEach","props","id","push","key","indexChangeHandler","i","renderTabBar","console","log","backgroundColor","route","color","icon"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;;;;;;;;;AAmBA,MAAMA,gBAAgB,GAAG,QAYL;AAAA,MAZM;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,cAFwB;AAGxBC,IAAAA,mBAHwB;AAIxBC,IAAAA,YAJwB;AAKxBC,IAAAA,aALwB;AAMxBC,IAAAA,WANwB;AAOxBC,IAAAA,aAPwB;AAQxBC,IAAAA,UARwB;AASxBC,IAAAA,cATwB;AAUxBC,IAAAA,KAVwB;AAWxBC,IAAAA;AAXwB,GAYN;AAClB,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBC,KAAK,CAACC,QAAN,CAAe,CAAf,CAA1B;AACA,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBH,KAAK,CAACC,QAAN,CAAe,EAAf,CAA5B;AACA,QAAM,CAACG,SAAD,EAAYC,YAAZ,IAA4BL,KAAK,CAACC,QAAN,CAAe,EAAf,CAAlC;AAEAD,EAAAA,KAAK,CAACM,SAAN,CAAgB,MAAM;AACpB,UAAMC,SAAc,GAAG,EAAvB;AACA,UAAMC,MAAW,GAAG,EAApB;AAEAR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AAA,KAAK,CAAEE,IAAP,gBACE,oBAAC,IAAD;AAAM,UAAA,IAAI,EAAEF,KAAK,CAACE,IAAlB;AAAwB,UAAA,KAAK,EAAED,KAA/B;AAAsC,UAAA,IAAI,EAAE;AAA5C,UADF,GAEI,IAHM;AAAA,OAPd;AAYE,MAAA,KAAK,EAAE/B;AAZT,OADF;AAgBD,GAlBD;;AAoBA,sBACE,oBAAC,2BAAD;AACE,IAAA,eAAe,EAAE;AAAEE,MAAAA,KAAF;AAASI,MAAAA;AAAT,KADnB;AAEE,IAAA,WAAW,EAAE,kCAASE,SAAT,CAFf;AAGE,IAAA,YAAY,EAAEkB,YAHhB;AAIE,IAAA,aAAa,EAAEF,kBAJjB;AAKE,IAAA,cAAc,EAAEhC,cALlB;AAME,IAAA,mBAAmB,EAAEC,mBANvB;AAOE,IAAA,YAAY,EAAEC;AAPhB,IADF;AAWD,CAtED;;eAwEeJ,gB","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, TextStyle, ViewStyle } from \"react-native\";\nimport { TabView, TabBar, SceneMap } from \"react-native-tab-view\";\n\n// import { withTheme } from \"../../theming\";\nimport TabViewItem from \"./TabViewItem\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\ntype TabBarPosition = \"top\" | \"bottom\";\ntype KeyboardDismissMode = \"none\" | \"auto\" | \"on-drag\";\n\ntype TabViewProps = {\n tabBarPosition?: TabBarPosition;\n keyboardDismissMode?: KeyboardDismissMode;\n swipeEnabled?: boolean;\n scrollEnabled?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n indicatorColor?: string;\n style?: StyleProp<TextStyle | ViewStyle>;\n children: React.ReactNode;\n} & IconSlot;\n\nconst TabViewComponent = ({\n Icon,\n tabBarPosition,\n keyboardDismissMode,\n swipeEnabled,\n scrollEnabled,\n activeColor,\n inactiveColor,\n pressColor,\n indicatorColor,\n style,\n children,\n}: TabViewProps) => {\n const [index, setIndex] = React.useState(0);\n const [routes, setRoutes] = React.useState([]);\n const [tabScenes, setTabScenes] = React.useState({});\n\n React.useEffect(() => {\n const newRoutes: any = [];\n const scenes: any = {};\n\n React.Children.toArray(children)\n .filter((child: any) => child.type === TabViewItem)\n .forEach((child: any) => {\n if (child?.props?.id) {\n newRoutes.push({\n key: child?.props?.id,\n ...child?.props,\n });\n scenes[child?.props?.id] = () => child;\n }\n });\n\n setRoutes(newRoutes);\n setTabScenes(scenes);\n }, [children]);\n\n const indexChangeHandler = (i: any) => setIndex(i);\n\n const renderTabBar = (props: any) => {\n console.log(props);\n return (\n <TabBar\n {...props}\n activeColor={activeColor}\n inactiveColor={inactiveColor}\n pressColor={pressColor}\n scrollEnabled={scrollEnabled}\n indicatorStyle={{ backgroundColor: indicatorColor }}\n renderIcon={({ route, color }) =>\n route?.icon ? (\n <Icon name={route.icon} color={color} size={36} />\n ) : null\n }\n style={style}\n />\n );\n };\n\n return (\n <TabView\n navigationState={{ index, routes }}\n renderScene={SceneMap(tabScenes)}\n renderTabBar={renderTabBar}\n onIndexChange={indexChangeHandler}\n tabBarPosition={tabBarPosition}\n keyboardDismissMode={keyboardDismissMode}\n swipeEnabled={swipeEnabled}\n />\n );\n};\n\nexport default TabViewComponent;\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const TabViewItem = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
title,
|
|
11
|
-
id,
|
|
12
|
-
icon,
|
|
13
|
-
children,
|
|
14
|
-
accessibilityLabel
|
|
15
|
-
} = _ref;
|
|
16
|
-
console.log({
|
|
17
|
-
title,
|
|
18
|
-
id,
|
|
19
|
-
icon,
|
|
20
|
-
accessibilityLabel
|
|
21
|
-
});
|
|
22
|
-
return children;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var _default = TabViewItem;
|
|
26
|
-
exports.default = _default;
|
|
27
|
-
//# sourceMappingURL=TabViewItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabViewItem.tsx"],"names":["TabViewItem","title","id","icon","children","accessibilityLabel","console","log"],"mappings":";;;;;;;AASA,MAAMA,WAAW,GAAG,QAMI;AAAA,MANH;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,EAFmB;AAGnBC,IAAAA,IAHmB;AAInBC,IAAAA,QAJmB;AAKnBC,IAAAA;AALmB,GAMG;AACtBC,EAAAA,OAAO,CAACC,GAAR,CAAY;AAAEN,IAAAA,KAAF;AAASC,IAAAA,EAAT;AAAaC,IAAAA,IAAb;AAAmBE,IAAAA;AAAnB,GAAZ;AACA,SAAOD,QAAP;AACD,CATD;;eAWeJ,W","sourcesContent":["import React from \"react\";\ninterface TabViewItemProps {\n title: string;\n id: string;\n icon: string;\n accessibilityLabel: string;\n children: React.ReactNode;\n}\n\nconst TabViewItem = ({\n title,\n id,\n icon,\n children,\n accessibilityLabel,\n}: TabViewItemProps) => {\n console.log({ title, id, icon, accessibilityLabel });\n return children;\n};\n\nexport default TabViewItem;\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "TabView", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _TabView.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TabViewItem", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _TabViewItem.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _TabView = _interopRequireDefault(require("./TabView"));
|
|
20
|
-
|
|
21
|
-
var _TabViewItem = _interopRequireDefault(require("./TabViewItem"));
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default as TabView } from \"./TabView\";\nexport { default as TabViewItem } from \"./TabViewItem\";\n"]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = void 0;
|
|
7
|
-
|
|
8
|
-
var _types = require("@draftbit/types");
|
|
9
|
-
|
|
10
|
-
const SEED_DATA = [{
|
|
11
|
-
name: "TabView",
|
|
12
|
-
tag: "TabView",
|
|
13
|
-
category: _types.COMPONENT_TYPES.container,
|
|
14
|
-
layout: {},
|
|
15
|
-
props: {
|
|
16
|
-
tabBarPosition: (0, _types.createTextEnumProp)({
|
|
17
|
-
label: "Tab Bar Position",
|
|
18
|
-
description: "Tab Bar Position",
|
|
19
|
-
options: ["top", "bottom"],
|
|
20
|
-
defaultValue: "top"
|
|
21
|
-
}),
|
|
22
|
-
keyboardDismissMode: (0, _types.createTextEnumProp)({
|
|
23
|
-
label: "Keyboard Dismiss Mode",
|
|
24
|
-
description: "Keyboard Dismiss Mode",
|
|
25
|
-
options: ["auto", "on-drag", "none"],
|
|
26
|
-
defaultValue: "auto"
|
|
27
|
-
}),
|
|
28
|
-
swipeEnabled: (0, _types.createBoolProp)({
|
|
29
|
-
label: "Swipe Enabled",
|
|
30
|
-
description: "Swipe Enabled",
|
|
31
|
-
defaultValue: true
|
|
32
|
-
}),
|
|
33
|
-
scrollEnabled: (0, _types.createBoolProp)({
|
|
34
|
-
label: "Scroll Enabled",
|
|
35
|
-
description: "Scroll Enabled",
|
|
36
|
-
defaultValue: true
|
|
37
|
-
}),
|
|
38
|
-
activeColor: (0, _types.createColorProp)({
|
|
39
|
-
label: "Active Color",
|
|
40
|
-
description: "Active Color",
|
|
41
|
-
defaultValue: "primary"
|
|
42
|
-
}),
|
|
43
|
-
inactiveColor: (0, _types.createColorProp)({
|
|
44
|
-
label: "Inactive Color",
|
|
45
|
-
description: "Inactive Color",
|
|
46
|
-
defaultValue: null
|
|
47
|
-
}),
|
|
48
|
-
pressColor: (0, _types.createColorProp)({
|
|
49
|
-
label: "Press Color",
|
|
50
|
-
description: "Press Color",
|
|
51
|
-
defaultValue: null
|
|
52
|
-
}),
|
|
53
|
-
indicatorColor: (0, _types.createColorProp)({
|
|
54
|
-
label: "Indicator Color",
|
|
55
|
-
description: "Indicator Color",
|
|
56
|
-
defaultValue: null
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
name: "TabViewItem",
|
|
61
|
-
tag: "TabViewItem",
|
|
62
|
-
category: _types.COMPONENT_TYPES.container,
|
|
63
|
-
layout: {},
|
|
64
|
-
props: {
|
|
65
|
-
title: (0, _types.createTextProp)({
|
|
66
|
-
label: "Title",
|
|
67
|
-
description: "Tab Title"
|
|
68
|
-
}),
|
|
69
|
-
id: (0, _types.createTextProp)({
|
|
70
|
-
label: "Id",
|
|
71
|
-
description: "Tab Id"
|
|
72
|
-
}),
|
|
73
|
-
accessibilityLabel: (0, _types.createTextProp)({
|
|
74
|
-
label: "Accessibility Label",
|
|
75
|
-
description: "Accessibility Label"
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
}];
|
|
79
|
-
exports.SEED_DATA = SEED_DATA;
|
|
80
|
-
//# sourceMappingURL=TabView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabView.ts"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","container","layout","props","tabBarPosition","label","description","options","defaultValue","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indic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,gBAFgB;AAG7BE,MAAAA,YAAY,EAAE;AAHe,KAAhB,CA5BV;AAiCLM,IAAAA,UAAU,EAAE,4BAAgB;AAC1BT,MAAAA,KAAK,EAAE,aADmB;AAE1BC,MAAAA,WAAW,EAAE,aAFa;AAG1BE,MAAAA,YAAY,EAAE;AAHY,KAAhB,CAjCP;AAsCLO,IAAAA,cAAc,EAAE,4BAAgB;AAC9BV,MAAAA,KAAK,EAAE,iBADuB;AAE9BC,MAAAA,WAAW,EAAE,iBAFiB;AAG9BE,MAAAA,YAAY,EAAE;AAHgB,KAAhB;AAtCX;AALT,CADuB,EAmDvB;AACEX,EAAAA,IAAI,EAAE,aADR;AAEEC,EAAAA,GAAG,EAAE,aAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLa,IAAAA,KAAK,EAAE,2BAAe;AACpBX,MAAAA,KAAK,EAAE,OADa;AAEpBC,MAAAA,WAAW,EAAE;AAFO,KAAf,CADF;AAKLW,IAAAA,EAAE,EAAE,2BAAe;AACjBZ,MAAAA,KAAK,EAAE,IADU;AAEjBC,MAAAA,WAAW,EAAE;AAFI,KAAf,CALC;AASLY,IAAAA,kBAAkB,EAAE,2BAAe;AACjCb,MAAAA,KAAK,EAAE,qBAD0B;AAEjCC,MAAAA,WAAW,EAAE;AAFoB,KAAf;AATf;AALT,CAnDuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createTextProp,\n createTextEnumProp,\n createBoolProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"TabView\",\n tag: \"TabView\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n tabBarPosition: createTextEnumProp({\n label: \"Tab Bar Position\",\n description: \"Tab Bar Position\",\n options: [\"top\", \"bottom\"],\n defaultValue: \"top\",\n }),\n keyboardDismissMode: createTextEnumProp({\n label: \"Keyboard Dismiss Mode\",\n description: \"Keyboard Dismiss Mode\",\n options: [\"auto\", \"on-drag\", \"none\"],\n defaultValue: \"auto\",\n }),\n swipeEnabled: createBoolProp({\n label: \"Swipe Enabled\",\n description: \"Swipe Enabled\",\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Scroll Enabled\",\n description: \"Scroll Enabled\",\n defaultValue: true,\n }),\n activeColor: createColorProp({\n label: \"Active Color\",\n description: \"Active Color\",\n defaultValue: \"primary\",\n }),\n inactiveColor: createColorProp({\n label: \"Inactive Color\",\n description: \"Inactive Color\",\n defaultValue: null,\n }),\n pressColor: createColorProp({\n label: \"Press Color\",\n description: \"Press Color\",\n defaultValue: null,\n }),\n indicatorColor: createColorProp({\n label: \"Indicator Color\",\n description: \"Indicator Color\",\n defaultValue: null,\n }),\n },\n },\n {\n name: \"TabViewItem\",\n tag: \"TabViewItem\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n title: createTextProp({\n label: \"Title\",\n description: \"Tab Title\",\n }),\n id: createTextProp({\n label: \"Id\",\n description: \"Tab Id\",\n }),\n accessibilityLabel: createTextProp({\n label: \"Accessibility Label\",\n description: \"Accessibility Label\",\n }),\n },\n },\n];\n"]}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || 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
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { TabView, TabBar, SceneMap } from "react-native-tab-view"; // import { withTheme } from "../../theming";
|
|
5
|
-
|
|
6
|
-
import TabViewItem from "./TabViewItem";
|
|
7
|
-
|
|
8
|
-
const TabViewComponent = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
Icon,
|
|
11
|
-
tabBarPosition,
|
|
12
|
-
keyboardDismissMode,
|
|
13
|
-
swipeEnabled,
|
|
14
|
-
scrollEnabled,
|
|
15
|
-
activeColor,
|
|
16
|
-
inactiveColor,
|
|
17
|
-
pressColor,
|
|
18
|
-
indicatorColor,
|
|
19
|
-
style,
|
|
20
|
-
children
|
|
21
|
-
} = _ref;
|
|
22
|
-
const [index, setIndex] = React.useState(0);
|
|
23
|
-
const [routes, setRoutes] = React.useState([]);
|
|
24
|
-
const [tabScenes, setTabScenes] = React.useState({});
|
|
25
|
-
React.useEffect(() => {
|
|
26
|
-
const newRoutes = [];
|
|
27
|
-
const scenes = {};
|
|
28
|
-
React.Children.toArray(children).filter(child => child.type === TabViewItem).forEach(child => {
|
|
29
|
-
var _child$props;
|
|
30
|
-
|
|
31
|
-
if (child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.id) {
|
|
32
|
-
var _child$props2, _child$props3;
|
|
33
|
-
|
|
34
|
-
newRoutes.push({
|
|
35
|
-
key: child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.id,
|
|
36
|
-
...(child === null || child === void 0 ? void 0 : child.props)
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
scenes[child === null || child === void 0 ? void 0 : (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.id] = () => child;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
setRoutes(newRoutes);
|
|
43
|
-
setTabScenes(scenes);
|
|
44
|
-
}, [children]);
|
|
45
|
-
|
|
46
|
-
const indexChangeHandler = i => setIndex(i);
|
|
47
|
-
|
|
48
|
-
const renderTabBar = props => {
|
|
49
|
-
console.log(props);
|
|
50
|
-
return /*#__PURE__*/React.createElement(TabBar, _extends({}, props, {
|
|
51
|
-
activeColor: activeColor,
|
|
52
|
-
inactiveColor: inactiveColor,
|
|
53
|
-
pressColor: pressColor,
|
|
54
|
-
scrollEnabled: scrollEnabled,
|
|
55
|
-
indicatorStyle: {
|
|
56
|
-
backgroundColor: indicatorColor
|
|
57
|
-
},
|
|
58
|
-
renderIcon: _ref2 => {
|
|
59
|
-
let {
|
|
60
|
-
route,
|
|
61
|
-
color
|
|
62
|
-
} = _ref2;
|
|
63
|
-
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
-
name: route.icon,
|
|
65
|
-
color: color,
|
|
66
|
-
size: 36
|
|
67
|
-
}) : null;
|
|
68
|
-
},
|
|
69
|
-
style: style
|
|
70
|
-
}));
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return /*#__PURE__*/React.createElement(TabView, {
|
|
74
|
-
navigationState: {
|
|
75
|
-
index,
|
|
76
|
-
routes
|
|
77
|
-
},
|
|
78
|
-
renderScene: SceneMap(tabScenes),
|
|
79
|
-
renderTabBar: renderTabBar,
|
|
80
|
-
onIndexChange: indexChangeHandler,
|
|
81
|
-
tabBarPosition: tabBarPosition,
|
|
82
|
-
keyboardDismissMode: keyboardDismissMode,
|
|
83
|
-
swipeEnabled: swipeEnabled
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export default TabViewComponent;
|
|
88
|
-
//# sourceMappingURL=TabView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabView.tsx"],"names":["React","TabView","TabBar","SceneMap","TabViewItem","TabViewComponent","Icon","tabBarPosition","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indicatorColor","style","children","index","setIndex","useState","routes","setRoutes","tabScenes","setTabScenes","useEffect","newRoutes","scenes","Children","toArray","filter","child","type","forEach","props","id","push","key","indexChangeHandler","i","renderTabBar","console","log","backgroundColor","route","color","icon"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,OAAT,EAAkBC,MAAlB,EAA0BC,QAA1B,QAA0C,uBAA1C,C,CAEA;;AACA,OAAOC,WAAP,MAAwB,eAAxB;;AAmBA,MAAMC,gBAAgB,GAAG,QAYL;AAAA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Content":["import * as React from \"react\";\nimport { StyleProp, TextStyle, ViewStyle } from \"react-native\";\nimport { TabView, TabBar, SceneMap } from \"react-native-tab-view\";\n\n// import { withTheme } from \"../../theming\";\nimport TabViewItem from \"./TabViewItem\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\ntype TabBarPosition = \"top\" | \"bottom\";\ntype KeyboardDismissMode = \"none\" | \"auto\" | \"on-drag\";\n\ntype TabViewProps = {\n tabBarPosition?: TabBarPosition;\n keyboardDismissMode?: KeyboardDismissMode;\n swipeEnabled?: boolean;\n scrollEnabled?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n indicatorColor?: string;\n style?: StyleProp<TextStyle | ViewStyle>;\n children: React.ReactNode;\n} & IconSlot;\n\nconst TabViewComponent = ({\n Icon,\n tabBarPosition,\n keyboardDismissMode,\n swipeEnabled,\n scrollEnabled,\n activeColor,\n inactiveColor,\n pressColor,\n indicatorColor,\n style,\n children,\n}: TabViewProps) => {\n const [index, setIndex] = React.useState(0);\n const [routes, setRoutes] = React.useState([]);\n const [tabScenes, setTabScenes] = React.useState({});\n\n React.useEffect(() => {\n const newRoutes: any = [];\n const scenes: any = {};\n\n React.Children.toArray(children)\n .filter((child: any) => child.type === TabViewItem)\n .forEach((child: any) => {\n if (child?.props?.id) {\n newRoutes.push({\n key: child?.props?.id,\n ...child?.props,\n });\n scenes[child?.props?.id] = () => child;\n }\n });\n\n setRoutes(newRoutes);\n setTabScenes(scenes);\n }, [children]);\n\n const indexChangeHandler = (i: any) => setIndex(i);\n\n const renderTabBar = (props: any) => {\n console.log(props);\n return (\n <TabBar\n {...props}\n activeColor={activeColor}\n inactiveColor={inactiveColor}\n pressColor={pressColor}\n scrollEnabled={scrollEnabled}\n indicatorStyle={{ backgroundColor: indicatorColor }}\n renderIcon={({ route, color }) =>\n route?.icon ? (\n <Icon name={route.icon} color={color} size={36} />\n ) : null\n }\n style={style}\n />\n );\n };\n\n return (\n <TabView\n navigationState={{ index, routes }}\n renderScene={SceneMap(tabScenes)}\n renderTabBar={renderTabBar}\n onIndexChange={indexChangeHandler}\n tabBarPosition={tabBarPosition}\n keyboardDismissMode={keyboardDismissMode}\n swipeEnabled={swipeEnabled}\n />\n );\n};\n\nexport default TabViewComponent;\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const TabViewItem = _ref => {
|
|
2
|
-
let {
|
|
3
|
-
title,
|
|
4
|
-
id,
|
|
5
|
-
icon,
|
|
6
|
-
children,
|
|
7
|
-
accessibilityLabel
|
|
8
|
-
} = _ref;
|
|
9
|
-
console.log({
|
|
10
|
-
title,
|
|
11
|
-
id,
|
|
12
|
-
icon,
|
|
13
|
-
accessibilityLabel
|
|
14
|
-
});
|
|
15
|
-
return children;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default TabViewItem;
|
|
19
|
-
//# sourceMappingURL=TabViewItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabViewItem.tsx"],"names":["TabViewItem","title","id","icon","children","accessibilityLabel","console","log"],"mappings":"AASA,MAAMA,WAAW,GAAG,QAMI;AAAA,MANH;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,EAFmB;AAGnBC,IAAAA,IAHmB;AAInBC,IAAAA,QAJmB;AAKnBC,IAAAA;AALmB,GAMG;AACtBC,EAAAA,OAAO,CAACC,GAAR,CAAY;AAAEN,IAAAA,KAAF;AAASC,IAAAA,EAAT;AAAaC,IAAAA,IAAb;AAAmBE,IAAAA;AAAnB,GAAZ;AACA,SAAOD,QAAP;AACD,CATD;;AAWA,eAAeJ,WAAf","sourcesContent":["import React from \"react\";\ninterface TabViewItemProps {\n title: string;\n id: string;\n icon: string;\n accessibilityLabel: string;\n children: React.ReactNode;\n}\n\nconst TabViewItem = ({\n title,\n id,\n icon,\n children,\n accessibilityLabel,\n}: TabViewItemProps) => {\n console.log({ title, id, icon, accessibilityLabel });\n return children;\n};\n\nexport default TabViewItem;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["default","TabView","TabViewItem"],"mappings":"AAAA,SAASA,OAAO,IAAIC,OAApB,QAAmC,WAAnC;AACA,SAASD,OAAO,IAAIE,WAApB,QAAuC,eAAvC","sourcesContent":["export { default as TabView } from \"./TabView\";\nexport { default as TabViewItem } from \"./TabViewItem\";\n"]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createTextProp, createTextEnumProp, createBoolProp, createColorProp } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = [{
|
|
3
|
-
name: "TabView",
|
|
4
|
-
tag: "TabView",
|
|
5
|
-
category: COMPONENT_TYPES.container,
|
|
6
|
-
layout: {},
|
|
7
|
-
props: {
|
|
8
|
-
tabBarPosition: createTextEnumProp({
|
|
9
|
-
label: "Tab Bar Position",
|
|
10
|
-
description: "Tab Bar Position",
|
|
11
|
-
options: ["top", "bottom"],
|
|
12
|
-
defaultValue: "top"
|
|
13
|
-
}),
|
|
14
|
-
keyboardDismissMode: createTextEnumProp({
|
|
15
|
-
label: "Keyboard Dismiss Mode",
|
|
16
|
-
description: "Keyboard Dismiss Mode",
|
|
17
|
-
options: ["auto", "on-drag", "none"],
|
|
18
|
-
defaultValue: "auto"
|
|
19
|
-
}),
|
|
20
|
-
swipeEnabled: createBoolProp({
|
|
21
|
-
label: "Swipe Enabled",
|
|
22
|
-
description: "Swipe Enabled",
|
|
23
|
-
defaultValue: true
|
|
24
|
-
}),
|
|
25
|
-
scrollEnabled: createBoolProp({
|
|
26
|
-
label: "Scroll Enabled",
|
|
27
|
-
description: "Scroll Enabled",
|
|
28
|
-
defaultValue: true
|
|
29
|
-
}),
|
|
30
|
-
activeColor: createColorProp({
|
|
31
|
-
label: "Active Color",
|
|
32
|
-
description: "Active Color",
|
|
33
|
-
defaultValue: "primary"
|
|
34
|
-
}),
|
|
35
|
-
inactiveColor: createColorProp({
|
|
36
|
-
label: "Inactive Color",
|
|
37
|
-
description: "Inactive Color",
|
|
38
|
-
defaultValue: null
|
|
39
|
-
}),
|
|
40
|
-
pressColor: createColorProp({
|
|
41
|
-
label: "Press Color",
|
|
42
|
-
description: "Press Color",
|
|
43
|
-
defaultValue: null
|
|
44
|
-
}),
|
|
45
|
-
indicatorColor: createColorProp({
|
|
46
|
-
label: "Indicator Color",
|
|
47
|
-
description: "Indicator Color",
|
|
48
|
-
defaultValue: null
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
name: "TabViewItem",
|
|
53
|
-
tag: "TabViewItem",
|
|
54
|
-
category: COMPONENT_TYPES.container,
|
|
55
|
-
layout: {},
|
|
56
|
-
props: {
|
|
57
|
-
title: createTextProp({
|
|
58
|
-
label: "Title",
|
|
59
|
-
description: "Tab Title"
|
|
60
|
-
}),
|
|
61
|
-
id: createTextProp({
|
|
62
|
-
label: "Id",
|
|
63
|
-
description: "Tab Id"
|
|
64
|
-
}),
|
|
65
|
-
accessibilityLabel: createTextProp({
|
|
66
|
-
label: "Accessibility Label",
|
|
67
|
-
description: "Accessibility Label"
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
}];
|
|
71
|
-
//# sourceMappingURL=TabView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["TabView.ts"],"names":["COMPONENT_TYPES","createTextProp","createTextEnumProp","createBoolProp","createColorProp","SEED_DATA","name","tag","category","container","layout","props","tabBarPosition","label","description","options","defaultValue","keyboardDismissMode","swipeEnabled","scrollEnabled","activeColor","inactiveColor","pressColor","indicatorColor","title","id","accessibilityLabel"],"mappings":"AAAA,SACEA,eADF,EAEEC,cAFF,EAGEC,kBAHF,EAIEC,cAJF,EAKEC,eALF,QAMO,iBANP;AAQA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,QAAQ,EAAER,eAAe,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B;AAE1BC,MAAAA,WAAW,EAAE,aAFa;AAG1BE,MAAAA,YAAY,EAAE;AAHY,KAAD,CAjCtB;AAsCLO,IAAAA,cAAc,EAAEnB,eAAe,CAAC;AAC9BS,MAAAA,KAAK,EAAE,iBADuB;AAE9BC,MAAAA,WAAW,EAAE,iBAFiB;AAG9BE,MAAAA,YAAY,EAAE;AAHgB,KAAD;AAtC1B;AALT,CADuB,EAmDvB;AACEV,EAAAA,IAAI,EAAE,aADR;AAEEC,EAAAA,GAAG,EAAE,aAFP;AAGEC,EAAAA,QAAQ,EAAER,eAAe,CAACS,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLa,IAAAA,KAAK,EAAEvB,cAAc,CAAC;AACpBY,MAAAA,KAAK,EAAE,OADa;AAEpBC,MAAAA,WAAW,EAAE;AAFO,KAAD,CADhB;AAKLW,IAAAA,EAAE,EAAExB,cAAc,CAAC;AACjBY,MAAAA,KAAK,EAAE,IADU;AAEjBC,MAAAA,WAAW,EAAE;AAFI,KAAD,CALb;AASLY,IAAAA,kBAAkB,EAAEzB,cAAc,CAAC;AACjCY,MAAAA,KAAK,EAAE,qBAD0B;AAEjCC,MAAAA,WAAW,EAAE;AAFoB,KAAD;AAT7B;AALT,CAnDuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createTextProp,\n createTextEnumProp,\n createBoolProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"TabView\",\n tag: \"TabView\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n tabBarPosition: createTextEnumProp({\n label: \"Tab Bar Position\",\n description: \"Tab Bar Position\",\n options: [\"top\", \"bottom\"],\n defaultValue: \"top\",\n }),\n keyboardDismissMode: createTextEnumProp({\n label: \"Keyboard Dismiss Mode\",\n description: \"Keyboard Dismiss Mode\",\n options: [\"auto\", \"on-drag\", \"none\"],\n defaultValue: \"auto\",\n }),\n swipeEnabled: createBoolProp({\n label: \"Swipe Enabled\",\n description: \"Swipe Enabled\",\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Scroll Enabled\",\n description: \"Scroll Enabled\",\n defaultValue: true,\n }),\n activeColor: createColorProp({\n label: \"Active Color\",\n description: \"Active Color\",\n defaultValue: \"primary\",\n }),\n inactiveColor: createColorProp({\n label: \"Inactive Color\",\n description: \"Inactive Color\",\n defaultValue: null,\n }),\n pressColor: createColorProp({\n label: \"Press Color\",\n description: \"Press Color\",\n defaultValue: null,\n }),\n indicatorColor: createColorProp({\n label: \"Indicator Color\",\n description: \"Indicator Color\",\n defaultValue: null,\n }),\n },\n },\n {\n name: \"TabViewItem\",\n tag: \"TabViewItem\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n title: createTextProp({\n label: \"Title\",\n description: \"Tab Title\",\n }),\n id: createTextProp({\n label: \"Id\",\n description: \"Tab Id\",\n }),\n accessibilityLabel: createTextProp({\n label: \"Accessibility Label\",\n description: \"Accessibility Label\",\n }),\n },\n },\n];\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
-
import type { IconSlot } from "../../interfaces/Icon";
|
|
4
|
-
declare type TabBarPosition = "top" | "bottom";
|
|
5
|
-
declare type KeyboardDismissMode = "none" | "auto" | "on-drag";
|
|
6
|
-
declare type TabViewProps = {
|
|
7
|
-
tabBarPosition?: TabBarPosition;
|
|
8
|
-
keyboardDismissMode?: KeyboardDismissMode;
|
|
9
|
-
swipeEnabled?: boolean;
|
|
10
|
-
scrollEnabled?: boolean;
|
|
11
|
-
activeColor?: string;
|
|
12
|
-
inactiveColor?: string;
|
|
13
|
-
pressColor?: string;
|
|
14
|
-
indicatorColor?: string;
|
|
15
|
-
style?: StyleProp<TextStyle | ViewStyle>;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
} & IconSlot;
|
|
18
|
-
declare const TabViewComponent: ({ Icon, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, style, children, }: TabViewProps) => JSX.Element;
|
|
19
|
-
export default TabViewComponent;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface TabViewItemProps {
|
|
3
|
-
title: string;
|
|
4
|
-
id: string;
|
|
5
|
-
icon: string;
|
|
6
|
-
accessibilityLabel: string;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
declare const TabViewItem: ({ title, id, icon, children, accessibilityLabel, }: TabViewItemProps) => React.ReactNode;
|
|
10
|
-
export default TabViewItem;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: ({
|
|
2
|
-
name: string;
|
|
3
|
-
tag: string;
|
|
4
|
-
category: string;
|
|
5
|
-
layout: {};
|
|
6
|
-
props: {
|
|
7
|
-
tabBarPosition: {
|
|
8
|
-
group: string;
|
|
9
|
-
label: string;
|
|
10
|
-
description: string;
|
|
11
|
-
editable: boolean;
|
|
12
|
-
required: boolean;
|
|
13
|
-
formType: string;
|
|
14
|
-
propType: string;
|
|
15
|
-
defaultValue: null;
|
|
16
|
-
options: never[];
|
|
17
|
-
};
|
|
18
|
-
keyboardDismissMode: {
|
|
19
|
-
group: string;
|
|
20
|
-
label: string;
|
|
21
|
-
description: string;
|
|
22
|
-
editable: boolean;
|
|
23
|
-
required: boolean;
|
|
24
|
-
formType: string;
|
|
25
|
-
propType: string;
|
|
26
|
-
defaultValue: null;
|
|
27
|
-
options: never[];
|
|
28
|
-
};
|
|
29
|
-
swipeEnabled: {
|
|
30
|
-
label: string;
|
|
31
|
-
description: string;
|
|
32
|
-
formType: string;
|
|
33
|
-
propType: string;
|
|
34
|
-
defaultValue: boolean;
|
|
35
|
-
editable: boolean;
|
|
36
|
-
required: boolean;
|
|
37
|
-
group: string;
|
|
38
|
-
};
|
|
39
|
-
scrollEnabled: {
|
|
40
|
-
label: string;
|
|
41
|
-
description: string;
|
|
42
|
-
formType: string;
|
|
43
|
-
propType: string;
|
|
44
|
-
defaultValue: boolean;
|
|
45
|
-
editable: boolean;
|
|
46
|
-
required: boolean;
|
|
47
|
-
group: string;
|
|
48
|
-
};
|
|
49
|
-
activeColor: {
|
|
50
|
-
group: string;
|
|
51
|
-
label: string;
|
|
52
|
-
description: string;
|
|
53
|
-
editable: boolean;
|
|
54
|
-
required: boolean;
|
|
55
|
-
defaultValue: null;
|
|
56
|
-
formType: string;
|
|
57
|
-
propType: string;
|
|
58
|
-
};
|
|
59
|
-
inactiveColor: {
|
|
60
|
-
group: string;
|
|
61
|
-
label: string;
|
|
62
|
-
description: string;
|
|
63
|
-
editable: boolean;
|
|
64
|
-
required: boolean;
|
|
65
|
-
defaultValue: null;
|
|
66
|
-
formType: string;
|
|
67
|
-
propType: string;
|
|
68
|
-
};
|
|
69
|
-
pressColor: {
|
|
70
|
-
group: string;
|
|
71
|
-
label: string;
|
|
72
|
-
description: string;
|
|
73
|
-
editable: boolean;
|
|
74
|
-
required: boolean;
|
|
75
|
-
defaultValue: null;
|
|
76
|
-
formType: string;
|
|
77
|
-
propType: string;
|
|
78
|
-
};
|
|
79
|
-
indicatorColor: {
|
|
80
|
-
group: string;
|
|
81
|
-
label: string;
|
|
82
|
-
description: string;
|
|
83
|
-
editable: boolean;
|
|
84
|
-
required: boolean;
|
|
85
|
-
defaultValue: null;
|
|
86
|
-
formType: string;
|
|
87
|
-
propType: string;
|
|
88
|
-
};
|
|
89
|
-
title?: undefined;
|
|
90
|
-
id?: undefined;
|
|
91
|
-
accessibilityLabel?: undefined;
|
|
92
|
-
};
|
|
93
|
-
} | {
|
|
94
|
-
name: string;
|
|
95
|
-
tag: string;
|
|
96
|
-
category: string;
|
|
97
|
-
layout: {};
|
|
98
|
-
props: {
|
|
99
|
-
title: any;
|
|
100
|
-
id: any;
|
|
101
|
-
accessibilityLabel: any;
|
|
102
|
-
tabBarPosition?: undefined;
|
|
103
|
-
keyboardDismissMode?: undefined;
|
|
104
|
-
swipeEnabled?: undefined;
|
|
105
|
-
scrollEnabled?: undefined;
|
|
106
|
-
activeColor?: undefined;
|
|
107
|
-
inactiveColor?: undefined;
|
|
108
|
-
pressColor?: undefined;
|
|
109
|
-
indicatorColor?: undefined;
|
|
110
|
-
};
|
|
111
|
-
})[];
|