@draftbit/core 43.2.3 → 43.2.4-aa029f.0
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/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +5 -16
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +4 -19
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +14 -2
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +4 -20
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Divider.js +3 -13
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +6 -20
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/TabView/TabView.js +103 -0
- package/lib/commonjs/components/TabView/TabView.js.map +1 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +27 -0
- package/lib/commonjs/components/TabView/TabViewItem.js.map +1 -0
- package/lib/commonjs/components/TabView/index.js +24 -0
- package/lib/commonjs/components/TabView/index.js.map +1 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheet.js.map +1 -1
- package/lib/commonjs/mappings/CardBlock.js.map +1 -1
- package/lib/commonjs/mappings/CheckboxGroup.js.map +1 -1
- package/lib/commonjs/mappings/CircleImage.js.map +1 -1
- package/lib/commonjs/mappings/Modal.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/StarRating.js +2 -6
- package/lib/commonjs/mappings/StarRating.js.map +1 -1
- package/lib/commonjs/mappings/TabView.js +80 -0
- package/lib/commonjs/mappings/TabView.js.map +1 -0
- package/lib/commonjs/mappings/Touchable.js.map +1 -1
- package/lib/commonjs/theming.js.map +1 -1
- package/lib/module/components/Accordion/AccordionItem.js +22 -5
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/TabView/TabView.js +88 -0
- package/lib/module/components/TabView/TabView.js.map +1 -0
- package/lib/module/components/TabView/TabViewItem.js +19 -0
- package/lib/module/components/TabView/TabViewItem.js.map +1 -0
- package/lib/module/components/TabView/index.js +3 -0
- package/lib/module/components/TabView/index.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/MapMarker.js.map +1 -1
- package/lib/module/mappings/TabView.js +71 -0
- package/lib/module/mappings/TabView.js.map +1 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
- package/lib/typescript/src/components/TabView/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/mappings/TabView.d.ts +111 -0
- package/package.json +4 -2
- package/src/components/TabView/TabView.js +33 -0
- package/src/components/TabView/TabView.tsx +97 -0
- package/src/components/TabView/TabViewItem.js +5 -0
- package/src/components/TabView/TabViewItem.tsx +21 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.ts +2 -0
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/TabView.js +73 -0
- package/src/mappings/TabView.ts +80 -0
|
@@ -0,0 +1,88 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,MA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,cALlB;AAME,IAAA,mBAAmB,EAAEC,mBANvB;AAOE,IAAA,YAAY,EAAEC;AAPhB,IADF;AAWD,CAtED;;AAwEA,eAAeJ,gBAAf","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"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
package/lib/module/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
27
27
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
28
28
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
|
|
29
29
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
30
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
30
31
|
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
31
32
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
32
33
|
/* Deprecated: Fix or Delete! */
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAqB,mBAArB;AACA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,qBAA3C;AACA,SAASL,OAAO,IAAIM,MAApB,QAAkC,0BAAlC;AACA,SAASN,OAAO,IAAIO,UAApB,QAAsC,yBAAtC;AACA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,mBAAhC;AACA,SAASR,OAAO,IAAIS,QAApB,QAAoC,uBAApC;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,WAAlC,QAAqD,uBAArD;AACA,SAASZ,OAAO,IAAIa,WAApB,QAAuC,0BAAvC;AACA,SAASb,OAAO,IAAIc,SAApB,QAAqC,wBAArC;AACA,SAASd,OAAO,IAAIe,OAApB,QAAmC,sBAAnC;AACA,SAASf,OAAO,IAAIgB,GAApB,QAA+B,kBAA/B;AACA,SAAShB,OAAO,IAAIiB,kBAApB,QAA8C,iCAA9C;AACA,SAASjB,OAAO,IAAIkB,UAApB,QAAsC,yBAAtC;AACA,SAASlB,OAAO,IAAImB,KAApB,QAAiC,oBAAjC;AACA,SAASnB,OAAO,IAAIoB,WAApB,QAAuC,0BAAvC;AACA,SAASpB,OAAO,IAAIqB,eAApB,QAA2C,8BAA3C;AACA,SAASrB,OAAO,IAAIsB,UAApB,QAAsC,yBAAtC;AACA,SAAStB,OAAO,IAAIuB,OAApB,QAAmC,sBAAnC;AACA,SAASvB,OAAO,IAAIwB,MAApB,EAA4BC,SAA5B,QAA6C,qBAA7C;AACA,SAASzB,OAAO,IAAI0B,SAApB,QAAqC,wBAArC;AACA,SAAS1B,OAAO,IAAI2B,YAApB,QAAwC,2BAAxC;AACA,SAAS3B,OAAO,IAAI4B,SAApB,QAAqC,wBAArC;AACA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,wBAA9C;AACA,SACEC,WADF,EAEEC,eAFF,EAGEC,iBAHF,QAIO,0BAJP;AAKA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,qBAAnC;AAEA,SACEC,MADF,EAEEC,MAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEC,KALF,EAMEC,MANF,QAOO,qBAPP;AASA,SACEC,WADF,EAEEC,gBAFF,EAGEC,cAHF,EAIEC,qBAJF,QAKO,gCALP;AAOA;;AACA,
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["injectIcon","withTheme","ThemeProvider","default","Provider","DefaultTheme","Link","ButtonSolid","ButtonOutline","Avatar","AvatarEdit","Card","Carousel","Checkbox","CheckboxGroup","CheckboxRow","CircleImage","Container","Divider","FAB","FieldSearchBarFull","IconButton","Image","NumberInput","ScreenContainer","StarRating","Surface","Switch","SwitchRow","TextField","ToggleButton","Touchable","AccordionGroup","AccordionItem","ActionSheet","ActionSheetItem","ActionSheetCancel","Swiper","SwiperItem","TabView","TabViewItem","Center","Circle","Square","Row","Stack","Spacer","RadioButton","RadioButtonGroup","RadioButtonRow","RadioButtonFieldGroup","Button","CardBlock","CardContainer","CardContainerRating","CardInline","DatePicker","HeaderLarge","HeaderMedium","HeaderOverline","Picker","ProgressBar","ProgressCircle","RowBodyIcon","RowHeadlineImageCaption","RowHeadlineImageIcon","Slider","Stepper","useAuthState"],"mappings":"AAAA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,SAAT,EAAoBC,aAApB,QAAyC,WAAzC;AACA,SAASC,OAAO,IAAIC,QAApB,QAAoC,YAApC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,uBAAxC;AAEA,SAASC,IAAT,QAAq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;AAEA,SACEC,MADF,EAEEC,MAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEC,KALF,EAMEC,MANF,QAOO,qBAPP;AASA,SACEC,WADF,EAEEC,gBAFF,EAGEC,cAHF,EAIEC,qBAJF,QAKO,gCALP;AAOA;;AACA,SAAS/C,OAAO,IAAIgD,MAApB,QAAkC,+BAAlC;AACA,SAAShD,OAAO,IAAIiD,SAApB,QAAqC,wBAArC;AACA,SAASjD,OAAO,IAAIkD,aAApB,QAAyC,4BAAzC;AACA,SAASlD,OAAO,IAAImD,mBAApB,QAA+C,kCAA/C;AACA,SAASnD,OAAO,IAAIoD,UAApB,QAAsC,yBAAtC;AACA,SAASpD,OAAO,IAAIqD,UAApB,QAAsC,oCAAtC;AACA,SAASrD,OAAO,IAAIsD,WAApB,QAAuC,0BAAvC;AACA,SAAStD,OAAO,IAAIuD,YAApB,QAAwC,2BAAxC;AACA,SAASvD,OAAO,IAAIwD,cAApB,QAA0C,6BAA1C;AACA,SAASxD,OAAO,IAAIyD,MAApB,QAAkC,4BAAlC;AACA,SAASzD,OAAO,IAAI0D,WAApB,QAAuC,0BAAvC;AACA,SAAS1D,OAAO,IAAI2D,cAApB,QAA0C,6BAA1C;AACA,SAAS3D,OAAO,IAAI4D,WAApB,QAAuC,0BAAvC;AACA,SAAS5D,OAAO,IAAI6D,uBAApB,QAAmD,sCAAnD;AACA,SAAS7D,OAAO,IAAI8D,oBAApB,QAAgD,mCAAhD;AACA,SAAS9D,OAAO,IAAI+D,MAApB,QAAkC,qBAAlC;AACA,SAAS/D,OAAO,IAAIgE,OAApB,QAAmC,sBAAnC;AACA,SAASC,YAAT,QAA6B,2BAA7B","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\nexport { TabView, TabViewItem } from \"./components/TabView\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MapMarker.
|
|
1
|
+
{"version":3,"sources":["MapMarker.js"],"names":["COMPONENT_TYPES","createBoolProp","createColorProp","createNumberProp","createTextProp","GROUPS","SEED_DATA","name","tag","description","category","deprecated","layout","props","latitude","label","required","precision","min","max","longitude","title","defaultValue","flat","group","basic","pinColor"],"mappings":"AAAA,SAASA,eAAT,EAA0BC,cAA1B,EAA0CC,eAA1C,EAA2DC,gBAA3D,EAA6EC,cAA7E,EAA6FC,MAA7F,QAA4G,iBAA5G;AACA,OAAO,MAAMC,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,YADe;AAErBC,EAAAA,GAAG,EAAE,WAFgB;AAGrBC,EAAAA,WAAW,EAAE,kCAHQ;AAIrBC,EAAAA,QAAQ,EAAEV,eAAe,CAACW,UAJL;AAKrBC,EAAAA,MAAM,EAAE,EALa;AAMrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,QAAQ,EAAEX,gBAAgB,CAAC;AACvBY,MAAAA,KAAK,EAAE,UADgB;AAEvBN,MAAAA,WAAW,EAAE,6CAFU;AAGvBO,MAAAA,QAAQ,EAAE,IAHa;AAIvBC,MAAAA,SAAS,EAAE,CAJY;AAKvBC,MAAAA,GAAG,EAAE,CAAC,EALiB;AAMvBC,MAAAA,GAAG,EAAE;AANkB,KAAD,CADvB;AASHC,IAAAA,SAAS,EAAEjB,gBAAgB,CAAC;AACxBY,MAAAA,KAAK,EAAE,WADiB;AAExBN,MAAAA,WAAW,EAAE,8CAFW;AAGxBO,MAAAA,QAAQ,EAAE,IAHc;AAIxBC,MAAAA,SAAS,EAAE,CAJa;AAKxBC,MAAAA,GAAG,EAAE,CAAC,GALkB;AAMxBC,MAAAA,GAAG,EAAE;AANmB,KAAD,CATxB;AAiBHE,IAAAA,KAAK,EAAEjB,cAAc,CAAC;AAClBW,MAAAA,KAAK,EAAE,OADW;AAElBN,MAAAA,WAAW,EAAE,qCAFK;AAGlBa,MAAAA,YAAY,EAAE;AAHI,KAAD,CAjBlB;AAsBHb,IAAAA,WAAW,EAAEL,cAAc,CAAC;AACxBW,MAAAA,KAAK,EAAE,aADiB;AAExBN,MAAAA,WAAW,EAAE,qCAFW;AAGxBa,MAAAA,YAAY,EAAE;AAHU,KAAD,CAtBxB;AA2BHC,IAAAA,IAAI,EAAEtB,cAAc,CAAC;AACjBc,MAAAA,KAAK,EAAE,MADU;AAEjBN,MAAAA,WAAW,EAAE,+GAFI;AAGjBe,MAAAA,KAAK,EAAEnB,MAAM,CAACoB,KAHG;AAIjBH,MAAAA,YAAY,EAAE;AAJG,KAAD,CA3BjB;AAiCHI,IAAAA,QAAQ,EAAExB,eAAe,CAAC;AACtBa,MAAAA,KAAK,EAAE,WADe;AAEtBN,MAAAA,WAAW,EAAE;AAFS,KAAD;AAjCtB;AANc,CAAlB","sourcesContent":["import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, GROUPS, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Map Marker\",\n tag: \"MapMarker\",\n description: \"A marker to show inside map view\",\n category: COMPONENT_TYPES.deprecated,\n layout: {},\n props: {\n latitude: createNumberProp({\n label: \"Latitude\",\n description: \"The latitude in which the marker is located\",\n required: true,\n precision: 6,\n min: -90,\n max: 90,\n }),\n longitude: createNumberProp({\n label: \"Longitude\",\n description: \"The longitude in which the marker is located\",\n required: true,\n precision: 6,\n min: -180,\n max: 180,\n }),\n title: createTextProp({\n label: \"Title\",\n description: \"Title to show along with the marker\",\n defaultValue: null,\n }),\n description: createTextProp({\n label: \"Description\",\n description: \"Optional description for the marker\",\n defaultValue: null,\n }),\n flat: createBoolProp({\n label: \"Flat\",\n description: \"Sets whether this marker should be flat against the map (if true) or a billboard facing the camera (if false)\",\n group: GROUPS.basic,\n defaultValue: false,\n }),\n pinColor: createColorProp({\n label: \"Pin Color\",\n description: \"Sets the color of the marker\",\n }),\n },\n};\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;A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E;AAHe,KAAD,CA5BzB;AAiCLM,IAAAA,UAAU,EAAElB,eAAe,CAAC;AAC1BS,MAAAA,KAAK,EAAE,aADmB;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"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -27,6 +27,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
27
27
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
28
28
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
29
29
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
30
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
30
31
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
31
32
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
32
33
|
export { default as Button } from "./components/DeprecatedButton";
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
})[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.2.
|
|
3
|
+
"version": "43.2.4-aa029f.0+aa029f8e",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
+
"react-native-pager-view": "^5.4.9",
|
|
57
|
+
"react-native-tab-view": "^3.1.1",
|
|
56
58
|
"react-native-typography": "^1.4.1",
|
|
57
59
|
"react-native-web-swiper": "^2.2.1"
|
|
58
60
|
},
|
|
@@ -79,5 +81,5 @@
|
|
|
79
81
|
]
|
|
80
82
|
]
|
|
81
83
|
},
|
|
82
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "aa029f8e3934e3717bc10f06e86131e0d9ef175d"
|
|
83
85
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
3
|
+
// import { withTheme } from "../../theming";
|
|
4
|
+
import TabViewItem from "./TabViewItem";
|
|
5
|
+
const TabViewComponent = ({ Icon, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, style, children, }) => {
|
|
6
|
+
const [index, setIndex] = React.useState(0);
|
|
7
|
+
const [routes, setRoutes] = React.useState([]);
|
|
8
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const newRoutes = [];
|
|
11
|
+
const scenes = {};
|
|
12
|
+
React.Children.toArray(children)
|
|
13
|
+
.filter((child) => child.type === TabViewItem)
|
|
14
|
+
.forEach((child) => {
|
|
15
|
+
if (child?.props?.id) {
|
|
16
|
+
newRoutes.push({
|
|
17
|
+
key: child?.props?.id,
|
|
18
|
+
...child?.props,
|
|
19
|
+
});
|
|
20
|
+
scenes[child?.props?.id] = () => child;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
setRoutes(newRoutes);
|
|
24
|
+
setTabScenes(scenes);
|
|
25
|
+
}, [children]);
|
|
26
|
+
const indexChangeHandler = (i) => setIndex(i);
|
|
27
|
+
const renderTabBar = (props) => {
|
|
28
|
+
console.log(props);
|
|
29
|
+
return (React.createElement(TabBar, { ...props, activeColor: activeColor, inactiveColor: inactiveColor, pressColor: pressColor, scrollEnabled: scrollEnabled, indicatorStyle: { backgroundColor: indicatorColor }, renderIcon: ({ route, color }) => route?.icon ? (React.createElement(Icon, { name: route.icon, color: color, size: 36 })) : null, style: style }));
|
|
30
|
+
};
|
|
31
|
+
return (React.createElement(TabView, { navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
|
|
32
|
+
};
|
|
33
|
+
export default TabViewComponent;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
4
|
+
|
|
5
|
+
// import { withTheme } from "../../theming";
|
|
6
|
+
import TabViewItem from "./TabViewItem";
|
|
7
|
+
import type { IconSlot } from "../../interfaces/Icon";
|
|
8
|
+
|
|
9
|
+
type TabBarPosition = "top" | "bottom";
|
|
10
|
+
type KeyboardDismissMode = "none" | "auto" | "on-drag";
|
|
11
|
+
|
|
12
|
+
type TabViewProps = {
|
|
13
|
+
tabBarPosition?: TabBarPosition;
|
|
14
|
+
keyboardDismissMode?: KeyboardDismissMode;
|
|
15
|
+
swipeEnabled?: boolean;
|
|
16
|
+
scrollEnabled?: boolean;
|
|
17
|
+
activeColor?: string;
|
|
18
|
+
inactiveColor?: string;
|
|
19
|
+
pressColor?: string;
|
|
20
|
+
indicatorColor?: string;
|
|
21
|
+
style?: StyleProp<TextStyle | ViewStyle>;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
} & IconSlot;
|
|
24
|
+
|
|
25
|
+
const TabViewComponent = ({
|
|
26
|
+
Icon,
|
|
27
|
+
tabBarPosition,
|
|
28
|
+
keyboardDismissMode,
|
|
29
|
+
swipeEnabled,
|
|
30
|
+
scrollEnabled,
|
|
31
|
+
activeColor,
|
|
32
|
+
inactiveColor,
|
|
33
|
+
pressColor,
|
|
34
|
+
indicatorColor,
|
|
35
|
+
style,
|
|
36
|
+
children,
|
|
37
|
+
}: TabViewProps) => {
|
|
38
|
+
const [index, setIndex] = React.useState(0);
|
|
39
|
+
const [routes, setRoutes] = React.useState([]);
|
|
40
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
41
|
+
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const newRoutes: any = [];
|
|
44
|
+
const scenes: any = {};
|
|
45
|
+
|
|
46
|
+
React.Children.toArray(children)
|
|
47
|
+
.filter((child: any) => child.type === TabViewItem)
|
|
48
|
+
.forEach((child: any) => {
|
|
49
|
+
if (child?.props?.id) {
|
|
50
|
+
newRoutes.push({
|
|
51
|
+
key: child?.props?.id,
|
|
52
|
+
...child?.props,
|
|
53
|
+
});
|
|
54
|
+
scenes[child?.props?.id] = () => child;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
setRoutes(newRoutes);
|
|
59
|
+
setTabScenes(scenes);
|
|
60
|
+
}, [children]);
|
|
61
|
+
|
|
62
|
+
const indexChangeHandler = (i: any) => setIndex(i);
|
|
63
|
+
|
|
64
|
+
const renderTabBar = (props: any) => {
|
|
65
|
+
console.log(props);
|
|
66
|
+
return (
|
|
67
|
+
<TabBar
|
|
68
|
+
{...props}
|
|
69
|
+
activeColor={activeColor}
|
|
70
|
+
inactiveColor={inactiveColor}
|
|
71
|
+
pressColor={pressColor}
|
|
72
|
+
scrollEnabled={scrollEnabled}
|
|
73
|
+
indicatorStyle={{ backgroundColor: indicatorColor }}
|
|
74
|
+
renderIcon={({ route, color }) =>
|
|
75
|
+
route?.icon ? (
|
|
76
|
+
<Icon name={route.icon} color={color} size={36} />
|
|
77
|
+
) : null
|
|
78
|
+
}
|
|
79
|
+
style={style}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<TabView
|
|
86
|
+
navigationState={{ index, routes }}
|
|
87
|
+
renderScene={SceneMap(tabScenes)}
|
|
88
|
+
renderTabBar={renderTabBar}
|
|
89
|
+
onIndexChange={indexChangeHandler}
|
|
90
|
+
tabBarPosition={tabBarPosition}
|
|
91
|
+
keyboardDismissMode={keyboardDismissMode}
|
|
92
|
+
swipeEnabled={swipeEnabled}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default TabViewComponent;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
|
|
10
|
+
const TabViewItem = ({
|
|
11
|
+
title,
|
|
12
|
+
id,
|
|
13
|
+
icon,
|
|
14
|
+
children,
|
|
15
|
+
accessibilityLabel,
|
|
16
|
+
}: TabViewItemProps) => {
|
|
17
|
+
console.log({ title, id, icon, accessibilityLabel });
|
|
18
|
+
return children;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default TabViewItem;
|