@draftbit/core 44.2.1 → 44.2.3-9cbaf6.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/Accordion/AccordionItem.js +21 -5
- package/lib/commonjs/components/Accordion/AccordionItem.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 +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.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/components/Typography.js.map +1 -1
- 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/Carousel.js +1 -1
- package/lib/commonjs/mappings/Carousel.js.map +1 -1
- package/lib/commonjs/mappings/DatePicker.js +42 -41
- package/lib/commonjs/mappings/DatePicker.js.map +1 -1
- package/lib/commonjs/mappings/TabView.js +80 -0
- package/lib/commonjs/mappings/TabView.js.map +1 -0
- package/lib/module/components/Accordion/AccordionItem.js +5 -22
- package/lib/module/components/Carousel.js +20 -5
- package/lib/module/components/Carousel.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/components/useAuthState.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/Carousel.js +1 -1
- package/lib/module/mappings/Carousel.js.map +1 -1
- package/lib/module/mappings/DatePicker.js +42 -41
- package/lib/module/mappings/DatePicker.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/DatePicker.d.ts +0 -41
- package/lib/typescript/src/mappings/TabView.d.ts +111 -0
- package/package.json +5 -3
- 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/Carousel.js +1 -1
- package/src/mappings/Carousel.ts +1 -1
- package/src/mappings/DatePicker.js +42 -41
- package/src/mappings/DatePicker.ts +42 -42
- package/src/mappings/TabView.js +73 -0
- package/src/mappings/TabView.ts +80 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DatePicker.ts"],"names":["COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","FIELD_NAME","GROUPS","Triggers","SEED_DATA_PROPS","label","description","formType","string","propType","STRING","defaultValue","editable","required","group","data","mode","flatArray","options","basic","assistiveText","
|
|
1
|
+
{"version":3,"sources":["DatePicker.ts"],"names":["COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","FIELD_NAME","GROUPS","Triggers","SEED_DATA_PROPS","label","description","formType","string","propType","STRING","defaultValue","editable","required","group","data","mode","flatArray","options","basic","assistiveText","disabled","boolean","BOOLEAN","leftIconName","icon","leftIconMode","rightIconName","fieldName","handlerPropName","valuePropName","SEED_D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AEZ,MAAM,CAACiB;AATV;AAFD;AAPT,CADuB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n FIELD_NAME,\n GROUPS,\n Triggers,\n} from \"@draftbit/types\";\n\nconst SEED_DATA_PROPS = {\n label: {\n label: \"Label\",\n description: \"The label to be displayed on the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Date\",\n editable: true,\n required: true,\n group: GROUPS.data,\n },\n mode: {\n label: \"Mode\",\n description: \"Choose between date, time and datetime\",\n defaultValue: \"date\",\n editable: true,\n required: true,\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n options: [\"date\", \"time\", \"datetime\"],\n group: GROUPS.basic,\n },\n assistiveText: {\n label: \"Assistive text\",\n description: \"Helper text to display below the picker\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // locale: {\n // label: \"Locale\",\n // description: \"Locale for the datepicker. Must be a valid Locale\",\n // formType: FORM_TYPES.string,\n // propType: PROP_TYPES.STRING,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // minuteInterval: {\n // label: \"Minute Interval\",\n // description: \"The interval at which minutes can be selected\",\n // formType: FORM_TYPES.flatArray,\n // propType: PROP_TYPES.NUMBER,\n // options: [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30],\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n // timeZoneOffsetInMinutes: {\n // label: \"Time zone offset\",\n // description:\n // \"By default, the datepicker uses the device's timezone. This will allow you to offset it\",\n // formType: FORM_TYPES.number,\n // propType: PROP_TYPES.NUMBER,\n // defaultValue: null,\n // editable: true,\n // required: false,\n // group: GROUPS.basic,\n // },\n disabled: {\n label: \"Disabled\",\n description:\n \"Whether the picker should be disabled. Will prevent selection and show a greyed out state.\",\n formType: FORM_TYPES.boolean,\n propType: PROP_TYPES.BOOLEAN,\n defaultValue: false,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n // error: {\n // label: \"Error\",\n // description: \"Whether the picker should display the error state\",\n // formType: FORM_TYPES.boolean,\n // propType: PROP_TYPES.BOOLEAN,\n // defaultValue: false,\n // editable: true,\n // required: false,\n // group: GROUPS.data,\n // },\n leftIconName: {\n label: \"Left icon name\",\n description: \"The icon to display on the left\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n leftIconMode: {\n label: \"Left icon mode\",\n description:\n \"The mode of the icon to display on the left. 'inset' or 'outset'.\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"inset\",\n options: [\"inset\", \"outset\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\n rightIconName: {\n label: \"Right icon name\",\n description: \"The icon to display on the right\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n editable: true,\n required: false,\n group: GROUPS.basic,\n },\n fieldName: {\n ...FIELD_NAME,\n handlerPropName: \"onDateChange\",\n valuePropName: \"date\",\n defaultValue: \"date\",\n },\n};\n\nexport const SEED_DATA = [\n {\n name: \"Date Picker\",\n tag: \"DatePicker\",\n description: \"A component used to select a date from a visual calendar\",\n category: COMPONENT_TYPES.input,\n layout: null,\n triggers: [Triggers.OnDateChange],\n props: {\n ...SEED_DATA_PROPS,\n type: {\n label: \"Appearance\",\n description: \"Type of Datepicker\",\n formType: FORM_TYPES.flatArray,\n propType: PROP_TYPES.STRING,\n defaultValue: \"solid\",\n options: [\"solid\", \"underline\"],\n editable: true,\n required: true,\n group: GROUPS.basic,\n },\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;AACEC,EAAAA,IAAI,EAAE,SADR;AAEEC,EAAAA,GAAG,EAAE,SAFP;AAGEC,EAAAA,QAAQ,EAAER,eAAe,CAACS,SAH5B;AAIEC,EAAAA,MAAM,EAAE,EAJV;AAKEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,cAAc,EAAEV,kBAAkB,CAAC;AACjCW,MAAAA,KAAK,EAAE,kBAD0B;AAEjCC,MAAAA,WAAW,EAAE,kBAFoB;AAGjCC,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,QAAR,CAHwB;AAIjCC,MAAAA,YAAY,EAAE;AAJmB,KAAD,CAD7B;AAOLC,IAAAA,mBAAmB,EAAEf,kBAAkB,CAAC;AACtCW,MAAAA,KAAK,E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Ae,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;
|
|
@@ -28,6 +28,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
28
28
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
29
29
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
30
30
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
31
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
31
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
32
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
33
34
|
export { default as Button } from "./components/DeprecatedButton";
|
|
@@ -48,37 +48,6 @@ export declare const SEED_DATA: {
|
|
|
48
48
|
required: boolean;
|
|
49
49
|
group: string;
|
|
50
50
|
};
|
|
51
|
-
locale: {
|
|
52
|
-
label: string;
|
|
53
|
-
description: string;
|
|
54
|
-
formType: string;
|
|
55
|
-
propType: string;
|
|
56
|
-
defaultValue: null;
|
|
57
|
-
editable: boolean;
|
|
58
|
-
required: boolean;
|
|
59
|
-
group: string;
|
|
60
|
-
};
|
|
61
|
-
minuteInterval: {
|
|
62
|
-
label: string;
|
|
63
|
-
description: string;
|
|
64
|
-
formType: string;
|
|
65
|
-
propType: string;
|
|
66
|
-
options: number[];
|
|
67
|
-
defaultValue: null;
|
|
68
|
-
editable: boolean;
|
|
69
|
-
required: boolean;
|
|
70
|
-
group: string;
|
|
71
|
-
};
|
|
72
|
-
timeZoneOffsetInMinutes: {
|
|
73
|
-
label: string;
|
|
74
|
-
description: string;
|
|
75
|
-
formType: string;
|
|
76
|
-
propType: string;
|
|
77
|
-
defaultValue: null;
|
|
78
|
-
editable: boolean;
|
|
79
|
-
required: boolean;
|
|
80
|
-
group: string;
|
|
81
|
-
};
|
|
82
51
|
disabled: {
|
|
83
52
|
label: string;
|
|
84
53
|
description: string;
|
|
@@ -89,16 +58,6 @@ export declare const SEED_DATA: {
|
|
|
89
58
|
required: boolean;
|
|
90
59
|
group: string;
|
|
91
60
|
};
|
|
92
|
-
error: {
|
|
93
|
-
label: string;
|
|
94
|
-
description: string;
|
|
95
|
-
formType: string;
|
|
96
|
-
propType: string;
|
|
97
|
-
defaultValue: boolean;
|
|
98
|
-
editable: boolean;
|
|
99
|
-
required: boolean;
|
|
100
|
-
group: string;
|
|
101
|
-
};
|
|
102
61
|
leftIconName: {
|
|
103
62
|
label: string;
|
|
104
63
|
description: string;
|
|
@@ -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": "44.2.
|
|
3
|
+
"version": "44.2.3-9cbaf6.2+9cbaf6f6",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.1.12",
|
|
48
|
-
"@react-native-picker/picker": "2.
|
|
48
|
+
"@react-native-picker/picker": "2.4.1",
|
|
49
49
|
"color": "^3.1.2",
|
|
50
50
|
"date-fns": "^2.16.1",
|
|
51
51
|
"dateformat": "^3.0.3",
|
|
@@ -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.3"
|
|
58
60
|
},
|
|
@@ -78,5 +80,5 @@
|
|
|
78
80
|
]
|
|
79
81
|
]
|
|
80
82
|
},
|
|
81
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "9cbaf6f6f2c36d960cdf3b98ffb7d7a6d79aeb29"
|
|
82
84
|
}
|
|
@@ -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;
|
package/src/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export { default as Touchable } from "./components/Touchable";
|
|
|
28
28
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
29
29
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/ActionSheet";
|
|
30
30
|
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
31
|
+
export { TabView, TabViewItem } from "./components/TabView";
|
|
31
32
|
export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
|
|
32
33
|
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
|
|
33
34
|
/* Deprecated: Fix or Delete! */
|
package/src/index.tsx
CHANGED
package/src/mappings/Carousel.js
CHANGED
package/src/mappings/Carousel.ts
CHANGED