@xhsreds/reds-rn-next 0.2.2 → 0.2.3-beta202411091721
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/coverage/.tmp/coverage-10.json +1 -1
- package/coverage/.tmp/coverage-11.json +1 -1
- package/coverage/.tmp/coverage-12.json +1 -1
- package/coverage/.tmp/coverage-13.json +1 -1
- package/coverage/.tmp/coverage-14.json +1 -1
- package/coverage/.tmp/coverage-16.json +1 -1
- package/coverage/.tmp/coverage-17.json +1 -1
- package/coverage/.tmp/coverage-18.json +1 -1
- package/coverage/.tmp/coverage-19.json +1 -1
- package/coverage/.tmp/coverage-20.json +1 -1
- package/coverage/.tmp/coverage-21.json +1 -1
- package/coverage/.tmp/coverage-22.json +1 -1
- package/coverage/.tmp/coverage-23.json +1 -1
- package/coverage/.tmp/coverage-24.json +1 -1
- package/coverage/.tmp/coverage-25.json +1 -1
- package/coverage/.tmp/coverage-26.json +1 -1
- package/coverage/.tmp/coverage-27.json +1 -1
- package/coverage/.tmp/coverage-28.json +1 -1
- package/coverage/.tmp/coverage-29.json +1 -1
- package/coverage/.tmp/coverage-30.json +1 -1
- package/coverage/.tmp/coverage-31.json +1 -1
- package/coverage/.tmp/coverage-32.json +1 -1
- package/coverage/.tmp/coverage-33.json +1 -1
- package/coverage/.tmp/coverage-34.json +1 -1
- package/coverage/.tmp/coverage-36.json +1 -1
- package/coverage/.tmp/coverage-37.json +1 -1
- package/coverage/.tmp/coverage-38.json +1 -1
- package/coverage/.tmp/coverage-5.json +1 -1
- package/coverage/.tmp/coverage-8.json +1 -1
- package/coverage/.tmp/coverage-9.json +1 -1
- package/lib/cjs/_chunks/1m42z2Mz.js.map +1 -1
- package/lib/cjs/_chunks/{BZY8fLHP.js → BRcYv_kj.js} +3 -2
- package/lib/cjs/_chunks/BRcYv_kj.js.map +1 -0
- package/lib/cjs/_chunks/{G5T1hGVo.js → BmmacXcR.js} +4 -2
- package/lib/cjs/_chunks/BmmacXcR.js.map +1 -0
- package/lib/cjs/_chunks/{ZbRoGP_k.js → DY75DWu0.js} +4 -2
- package/lib/cjs/_chunks/DY75DWu0.js.map +1 -0
- package/lib/cjs/_chunks/{CnvQUDZP.js → SPLAvS-C.js} +3 -2
- package/lib/cjs/_chunks/SPLAvS-C.js.map +1 -0
- package/lib/cjs/_chunks/{SEcsCrAk.js → aU6iuR1W.js} +2 -2
- package/lib/cjs/_chunks/aU6iuR1W.js.map +1 -0
- package/lib/cjs/_chunks/{CbnkUMH9.js → dM-QhrnE.js} +11 -9
- package/lib/cjs/_chunks/dM-QhrnE.js.map +1 -0
- package/lib/cjs/components/ActionSheets/ActionSheets.js +13 -7
- package/lib/cjs/components/ActionSheets/ActionSheets.js.map +1 -1
- package/lib/cjs/components/ActionSheets/index.js +1 -1
- package/lib/cjs/components/ActionSheets/styles.js +6 -3
- package/lib/cjs/components/ActionSheets/styles.js.map +1 -1
- package/lib/cjs/components/Alert/Alert.js +6 -6
- package/lib/cjs/components/Alert/hooks/alert.js +6 -6
- package/lib/cjs/components/Alert/index.js +6 -6
- package/lib/cjs/components/AvatarGroup/AvatarGroup.js +6 -6
- package/lib/cjs/components/AvatarGroup/index.js +6 -6
- package/lib/cjs/components/CheckBoxGroup/CheckBox.js +5 -1
- package/lib/cjs/components/CheckBoxGroup/CheckBox.js.map +1 -1
- package/lib/cjs/components/CheckBoxGroup/CheckBoxGroup.js +2 -1
- package/lib/cjs/components/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/lib/cjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/cjs/components/DatePicker/index.js +1 -1
- package/lib/cjs/components/Form/Form.js +21 -17
- package/lib/cjs/components/Form/Form.js.map +1 -1
- package/lib/cjs/components/Form/FormItem.js +4 -4
- package/lib/cjs/components/Form/FormItem.js.map +1 -1
- package/lib/cjs/components/Form/index.js +2 -2
- package/lib/cjs/components/Form/interface/index.js +1 -1
- package/lib/cjs/components/Form/styles.js +1 -1
- package/lib/cjs/components/Icon/Icon.js +3 -1
- package/lib/cjs/components/Icon/Icon.js.map +1 -1
- package/lib/cjs/components/ImagePreview/ImagePreview.js +6 -6
- package/lib/cjs/components/ImagePreview/index.js +6 -6
- package/lib/cjs/components/List/ListItem/ListItem.js +6 -6
- package/lib/cjs/components/List/index.js +6 -6
- package/lib/cjs/components/Picker/Picker.js +1 -1
- package/lib/cjs/components/Picker/index.js +1 -1
- package/lib/cjs/components/Radio/Radio.js +6 -6
- package/lib/cjs/components/Radio/RadioGroup.js +4 -2
- package/lib/cjs/components/Radio/RadioGroup.js.map +1 -1
- package/lib/cjs/components/Radio/index.js +6 -6
- package/lib/cjs/components/Radio/interface/index.js +1 -1
- package/lib/cjs/components/Rate/Rate.js +2 -2
- package/lib/cjs/components/Rate/Rate.js.map +1 -1
- package/lib/cjs/components/Rate/index.js +1 -1
- package/lib/cjs/components/Rate/interface/index.js +1 -1
- package/lib/cjs/components/Sheets/AnimatedSheets.js +4 -2
- package/lib/cjs/components/Sheets/AnimatedSheets.js.map +1 -1
- package/lib/cjs/components/Sheets/Sheets.js +22 -13
- package/lib/cjs/components/Sheets/Sheets.js.map +1 -1
- package/lib/cjs/components/Sheets/api.js +1 -1
- package/lib/cjs/components/Sheets/index.js +1 -1
- package/lib/cjs/components/Sheets/interface/index.js +1 -1
- package/lib/cjs/components/Stepper/Stepper.js +4 -2
- package/lib/cjs/components/Stepper/Stepper.js.map +1 -1
- package/lib/cjs/components/Stepper/index.js +1 -1
- package/lib/cjs/components/Stepper/interface/index.js +1 -1
- package/lib/cjs/components/Tab/Tabs.js +98 -35
- package/lib/cjs/components/Tab/Tabs.js.map +1 -1
- package/lib/cjs/components/Tab/styles.js +11 -10
- package/lib/cjs/components/Tab/styles.js.map +1 -1
- package/lib/cjs/components/Uploader/Uploader.js +6 -6
- package/lib/cjs/components/Uploader/Uploader.js.map +1 -1
- package/lib/cjs/components/Uploader/styles.js +8 -5
- package/lib/cjs/components/Uploader/styles.js.map +1 -1
- package/lib/cjs/index.js +6 -6
- package/lib/esm/_chunks/{BKfYslcc.js → B92MXD-p.js} +3 -2
- package/lib/esm/_chunks/B92MXD-p.js.map +1 -0
- package/lib/esm/_chunks/{DIXhEK8L.js → B_rJA32w.js} +11 -9
- package/lib/esm/_chunks/B_rJA32w.js.map +1 -0
- package/lib/esm/_chunks/{DGYdiQBr.js → BaWeXDzj.js} +4 -2
- package/lib/esm/_chunks/BaWeXDzj.js.map +1 -0
- package/lib/esm/_chunks/CC8nLpzS.js.map +1 -1
- package/lib/esm/_chunks/{ClyMQ8-p.js → CQDVLUyF.js} +3 -3
- package/lib/esm/_chunks/CQDVLUyF.js.map +1 -0
- package/lib/esm/_chunks/{CQokOKfj.js → CqcNLT67.js} +4 -2
- package/lib/esm/_chunks/CqcNLT67.js.map +1 -0
- package/lib/esm/_chunks/{DR1NAacd.js → DGI1A77J.js} +3 -2
- package/lib/esm/_chunks/DGI1A77J.js.map +1 -0
- package/lib/esm/components/ActionSheets/ActionSheets.js +13 -7
- package/lib/esm/components/ActionSheets/ActionSheets.js.map +1 -1
- package/lib/esm/components/ActionSheets/index.js +1 -1
- package/lib/esm/components/ActionSheets/styles.js +6 -3
- package/lib/esm/components/ActionSheets/styles.js.map +1 -1
- package/lib/esm/components/Alert/Alert.js +6 -6
- package/lib/esm/components/Alert/hooks/alert.js +6 -6
- package/lib/esm/components/Alert/index.js +7 -7
- package/lib/esm/components/AvatarGroup/AvatarGroup.js +6 -6
- package/lib/esm/components/AvatarGroup/index.js +6 -6
- package/lib/esm/components/CheckBoxGroup/CheckBox.js +5 -1
- package/lib/esm/components/CheckBoxGroup/CheckBox.js.map +1 -1
- package/lib/esm/components/CheckBoxGroup/CheckBoxGroup.js +2 -1
- package/lib/esm/components/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/lib/esm/components/DatePicker/DatePicker.js +1 -1
- package/lib/esm/components/DatePicker/index.js +1 -1
- package/lib/esm/components/Form/Form.js +22 -18
- package/lib/esm/components/Form/Form.js.map +1 -1
- package/lib/esm/components/Form/FormItem.js +4 -4
- package/lib/esm/components/Form/FormItem.js.map +1 -1
- package/lib/esm/components/Form/index.js +2 -2
- package/lib/esm/components/Form/interface/index.js +1 -1
- package/lib/esm/components/Form/styles.js +1 -1
- package/lib/esm/components/Icon/Icon.js +4 -2
- package/lib/esm/components/Icon/Icon.js.map +1 -1
- package/lib/esm/components/ImagePreview/ImagePreview.js +6 -6
- package/lib/esm/components/ImagePreview/index.js +6 -6
- package/lib/esm/components/List/ListItem/ListItem.js +6 -6
- package/lib/esm/components/List/index.js +6 -6
- package/lib/esm/components/Picker/Picker.js +1 -1
- package/lib/esm/components/Picker/index.js +1 -1
- package/lib/esm/components/Radio/Radio.js +6 -6
- package/lib/esm/components/Radio/RadioGroup.js +4 -2
- package/lib/esm/components/Radio/RadioGroup.js.map +1 -1
- package/lib/esm/components/Radio/index.js +6 -6
- package/lib/esm/components/Radio/interface/index.js +1 -1
- package/lib/esm/components/Rate/Rate.js +2 -2
- package/lib/esm/components/Rate/Rate.js.map +1 -1
- package/lib/esm/components/Rate/index.js +1 -1
- package/lib/esm/components/Rate/interface/index.js +1 -1
- package/lib/esm/components/Sheets/AnimatedSheets.js +4 -2
- package/lib/esm/components/Sheets/AnimatedSheets.js.map +1 -1
- package/lib/esm/components/Sheets/Sheets.js +22 -13
- package/lib/esm/components/Sheets/Sheets.js.map +1 -1
- package/lib/esm/components/Sheets/api.js +1 -1
- package/lib/esm/components/Sheets/index.js +1 -1
- package/lib/esm/components/Sheets/interface/index.js +1 -1
- package/lib/esm/components/Stepper/Stepper.js +4 -2
- package/lib/esm/components/Stepper/Stepper.js.map +1 -1
- package/lib/esm/components/Stepper/index.js +1 -1
- package/lib/esm/components/Stepper/interface/index.js +1 -1
- package/lib/esm/components/Tab/Tabs.js +100 -37
- package/lib/esm/components/Tab/Tabs.js.map +1 -1
- package/lib/esm/components/Tab/styles.js +11 -10
- package/lib/esm/components/Tab/styles.js.map +1 -1
- package/lib/esm/components/Uploader/Uploader.js +6 -6
- package/lib/esm/components/Uploader/Uploader.js.map +1 -1
- package/lib/esm/components/Uploader/styles.js +8 -5
- package/lib/esm/components/Uploader/styles.js.map +1 -1
- package/lib/esm/index.js +6 -6
- package/lib/types/components/ActionSheets/styles.d.ts +4 -1
- package/lib/types/components/CheckBoxGroup/interface/index.d.ts +1 -0
- package/lib/types/components/Form/Form.d.ts +1 -7
- package/lib/types/components/Form/interface/index.d.ts +15 -3
- package/lib/types/components/Radio/interface/index.d.ts +7 -0
- package/lib/types/components/Rate/Rate.d.ts +1 -0
- package/lib/types/components/Rate/interface/index.d.ts +2 -0
- package/lib/types/components/Sheets/AnimatedSheets.d.ts +2 -4
- package/lib/types/components/Sheets/Sheets.d.ts +1 -1
- package/lib/types/components/Sheets/interface/index.d.ts +2 -2
- package/lib/types/components/Stepper/Stepper.d.ts +1 -0
- package/lib/types/components/Stepper/interface/index.d.ts +2 -0
- package/lib/types/components/Tab/styles.d.ts +7 -6
- package/lib/types/components/Uploader/styles.d.ts +5 -2
- package/package.json +1 -1
- package/src/components/ActionSheets/ActionSheets.tsx +12 -9
- package/src/components/ActionSheets/demo/index.tsx +27 -1
- package/src/components/ActionSheets/styles.ts +4 -1
- package/src/components/CheckBoxGroup/CheckBox.tsx +5 -1
- package/src/components/CheckBoxGroup/CheckBoxGroup.tsx +1 -0
- package/src/components/CheckBoxGroup/interface/index.ts +1 -0
- package/src/components/Form/Form.tsx +24 -13
- package/src/components/Form/FormItem.tsx +8 -3
- package/src/components/Form/demo/index.tsx +63 -7
- package/src/components/Form/doc/index.mdx +9 -7
- package/src/components/Form/interface/index.ts +15 -3
- package/src/components/Icon/Icon.tsx +5 -3
- package/src/components/Icon/demo/index.tsx +0 -1
- package/src/components/Radio/Radio.tsx +8 -2
- package/src/components/Radio/RadioGroup.tsx +2 -1
- package/src/components/Radio/doc/index.mdx +11 -8
- package/src/components/Radio/interface/index.ts +7 -0
- package/src/components/Rate/Rate.tsx +1 -1
- package/src/components/Rate/doc/index.mdx +10 -9
- package/src/components/Rate/interface/index.ts +2 -0
- package/src/components/Sheets/AnimatedSheets.tsx +1 -1
- package/src/components/Sheets/Sheets.tsx +27 -13
- package/src/components/Sheets/demo/index.tsx +23 -0
- package/src/components/Sheets/doc/index.mdx +1 -1
- package/src/components/Sheets/interface/index.ts +2 -2
- package/src/components/Stepper/Stepper.tsx +11 -9
- package/src/components/Stepper/doc/index.mdx +7 -6
- package/src/components/Stepper/interface/index.ts +2 -0
- package/src/components/Tab/Tabs.tsx +147 -88
- package/src/components/Tab/demo/index.tsx +33 -11
- package/src/components/Tab/styles.ts +8 -6
- package/src/components/Uploader/Uploader.tsx +6 -6
- package/src/components/Uploader/styles.ts +5 -2
- package/types/src/components/ActionSheets/styles.d.ts +4 -1
- package/types/src/components/CheckBoxGroup/interface/index.d.ts +1 -0
- package/types/src/components/Form/Form.d.ts +1 -7
- package/types/src/components/Form/interface/index.d.ts +15 -3
- package/types/src/components/Radio/interface/index.d.ts +7 -0
- package/types/src/components/Rate/Rate.d.ts +1 -0
- package/types/src/components/Rate/interface/index.d.ts +2 -0
- package/types/src/components/Sheets/AnimatedSheets.d.ts +2 -4
- package/types/src/components/Sheets/Sheets.d.ts +1 -1
- package/types/src/components/Sheets/interface/index.d.ts +2 -2
- package/types/src/components/Stepper/Stepper.d.ts +1 -0
- package/types/src/components/Stepper/interface/index.d.ts +2 -0
- package/types/src/components/Tab/styles.d.ts +7 -6
- package/types/src/components/Uploader/styles.d.ts +5 -2
- package/lib/cjs/_chunks/BZY8fLHP.js.map +0 -1
- package/lib/cjs/_chunks/CbnkUMH9.js.map +0 -1
- package/lib/cjs/_chunks/CnvQUDZP.js.map +0 -1
- package/lib/cjs/_chunks/G5T1hGVo.js.map +0 -1
- package/lib/cjs/_chunks/SEcsCrAk.js.map +0 -1
- package/lib/cjs/_chunks/ZbRoGP_k.js.map +0 -1
- package/lib/esm/_chunks/BKfYslcc.js.map +0 -1
- package/lib/esm/_chunks/CQokOKfj.js.map +0 -1
- package/lib/esm/_chunks/ClyMQ8-p.js.map +0 -1
- package/lib/esm/_chunks/DGYdiQBr.js.map +0 -1
- package/lib/esm/_chunks/DIXhEK8L.js.map +0 -1
- package/lib/esm/_chunks/DR1NAacd.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState, useEffect, useMemo } from "react";
|
|
2
|
-
import { View, TouchableWithoutFeedback, Text, ScrollView } from "react-native";
|
|
1
|
+
import React, { useState, useEffect, useMemo, useRef } from "react";
|
|
2
|
+
import { View, TouchableWithoutFeedback, Text, ScrollView, Animated, Easing } from "react-native";
|
|
3
3
|
import { RedsTab, TabDefaultProps } from "./interface/index";
|
|
4
4
|
import styles, { getRedsDropDownVariantStyles } from "./styles";
|
|
5
5
|
import { TabItemType, TabThemeType, TabLayoutType, TabChild } from "./interface";
|
|
@@ -13,6 +13,16 @@ export const Tab = (props: TabChild) => {
|
|
|
13
13
|
const Tabs = (props: RedsTab) => {
|
|
14
14
|
const [activeIndex, setActiveIndex] = useState<number>(0);
|
|
15
15
|
|
|
16
|
+
const childRefs = useRef<any[]>([]);
|
|
17
|
+
|
|
18
|
+
const parentRef = useRef(null);
|
|
19
|
+
|
|
20
|
+
const [offsets, setOffsets] = useState<number[]>([]);
|
|
21
|
+
|
|
22
|
+
const [widths, setWidths] = useState<number[]>([]);
|
|
23
|
+
|
|
24
|
+
const offset = useRef(new Animated.Value(0)).current;
|
|
25
|
+
|
|
16
26
|
/**
|
|
17
27
|
* 列表数据
|
|
18
28
|
*/
|
|
@@ -41,15 +51,6 @@ const Tabs = (props: RedsTab) => {
|
|
|
41
51
|
];
|
|
42
52
|
}, [props?.layout]);
|
|
43
53
|
|
|
44
|
-
/**
|
|
45
|
-
* 不同layout tab样式
|
|
46
|
-
*/
|
|
47
|
-
const tabItemStyle = (item: TabItemType) => {
|
|
48
|
-
return props?.theme === TabThemeType.capsule && props.active === item.value
|
|
49
|
-
? [styles.tabItem, styles.capsule, getRedsDropDownVariantStyles().backgroundColor.fill1]
|
|
50
|
-
: [styles.tabItem];
|
|
51
|
-
};
|
|
52
|
-
|
|
53
54
|
/**
|
|
54
55
|
* text wrapper 样式
|
|
55
56
|
*/
|
|
@@ -66,6 +67,25 @@ const Tabs = (props: RedsTab) => {
|
|
|
66
67
|
};
|
|
67
68
|
}, [props.tabPadding, props.spaceWidth]);
|
|
68
69
|
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
let activeIdx = 0;
|
|
72
|
+
list.forEach((i, idx) => {
|
|
73
|
+
if (i.value === props.active) {
|
|
74
|
+
activeIdx = idx;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
setActiveIndex(activeIdx);
|
|
78
|
+
}, [list, props.active]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 不同layout tab样式
|
|
82
|
+
*/
|
|
83
|
+
const tabItemStyle = (item: TabItemType) => {
|
|
84
|
+
return props?.theme === TabThemeType.capsule && props.active === item.value
|
|
85
|
+
? [styles.tabItem, styles.capsule, getRedsDropDownVariantStyles().backgroundColor.fill1]
|
|
86
|
+
: [styles.tabItem];
|
|
87
|
+
};
|
|
88
|
+
|
|
69
89
|
/**
|
|
70
90
|
* 是否展示icon
|
|
71
91
|
*/
|
|
@@ -85,9 +105,7 @@ const Tabs = (props: RedsTab) => {
|
|
|
85
105
|
* Icon颜色
|
|
86
106
|
*/
|
|
87
107
|
const iconColor = (item: TabItemType) => {
|
|
88
|
-
return props.active === item.value
|
|
89
|
-
? item.iconProps?.fill || getRedsDropDownVariantStyles().iconColor.title
|
|
90
|
-
: getRedsDropDownVariantStyles().iconColor.description;
|
|
108
|
+
return props.active === item.value ? item.iconProps?.fill : "";
|
|
91
109
|
};
|
|
92
110
|
|
|
93
111
|
/**
|
|
@@ -95,18 +113,11 @@ const Tabs = (props: RedsTab) => {
|
|
|
95
113
|
*/
|
|
96
114
|
const Wrapper = (wrapperProps: any) => {
|
|
97
115
|
return props?.layout === TabLayoutType.left ? (
|
|
98
|
-
<ScrollView
|
|
99
|
-
style={[wrapperProps.style]}
|
|
100
|
-
horizontal={true}
|
|
101
|
-
testID={wrapperProps.testID}
|
|
102
|
-
showsHorizontalScrollIndicator={false}
|
|
103
|
-
>
|
|
116
|
+
<ScrollView horizontal={true} testID={wrapperProps.testID} showsHorizontalScrollIndicator={false}>
|
|
104
117
|
{wrapperProps.children}
|
|
105
118
|
</ScrollView>
|
|
106
119
|
) : (
|
|
107
|
-
|
|
108
|
-
{wrapperProps.children}
|
|
109
|
-
</View>
|
|
120
|
+
wrapperProps.children
|
|
110
121
|
);
|
|
111
122
|
};
|
|
112
123
|
|
|
@@ -116,8 +127,10 @@ const Tabs = (props: RedsTab) => {
|
|
|
116
127
|
|
|
117
128
|
const BadgeContainer = (badgeProps: { badgeProps: BadgeType.RedsBadge; key: string; children: React.ReactNode }) => {
|
|
118
129
|
return props?.badge ? (
|
|
119
|
-
<Badge {...badgeProps.badgeProps}>
|
|
120
|
-
<View style={[styles.flexCenter, { height: "100%" }]}
|
|
130
|
+
<Badge {...badgeProps.badgeProps} key={badgeProps.key}>
|
|
131
|
+
<View style={[styles.flexCenter, { height: "100%" }]} key={badgeProps.key}>
|
|
132
|
+
{badgeProps.children}
|
|
133
|
+
</View>
|
|
121
134
|
</Badge>
|
|
122
135
|
) : (
|
|
123
136
|
badgeProps.children
|
|
@@ -125,51 +138,98 @@ const Tabs = (props: RedsTab) => {
|
|
|
125
138
|
};
|
|
126
139
|
|
|
127
140
|
useEffect(() => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
console.log("offsets?.[activeIndex]", offsets?.[activeIndex]);
|
|
142
|
+
if (offsets?.[activeIndex]) {
|
|
143
|
+
Animated.timing(offset, {
|
|
144
|
+
toValue: (offsets?.[activeIndex] || 0) + 1,
|
|
145
|
+
duration: 500,
|
|
146
|
+
useNativeDriver: false,
|
|
147
|
+
}).start(() => {
|
|
148
|
+
offset.setValue((offsets?.[activeIndex] || 0) + 1);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}, [activeIndex, offsets, offset]);
|
|
136
152
|
|
|
137
153
|
return (
|
|
138
|
-
|
|
139
|
-
<Wrapper
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
<>
|
|
155
|
+
<Wrapper testID="TabContainer">
|
|
156
|
+
<View style={{ position: "relative" }}>
|
|
157
|
+
{/* 下划线 */}
|
|
158
|
+
{props.theme === TabThemeType.underline ? (
|
|
159
|
+
<Animated.View
|
|
160
|
+
style={[
|
|
161
|
+
styles.underline,
|
|
162
|
+
{ width: (widths?.[activeIndex] || 0) - 2 },
|
|
163
|
+
{ transform: [{ translateX: offset }] },
|
|
164
|
+
getRedsDropDownVariantStyles().backgroundColor.primary,
|
|
165
|
+
]}
|
|
166
|
+
></Animated.View>
|
|
167
|
+
) : (
|
|
168
|
+
<></>
|
|
169
|
+
)}
|
|
170
|
+
<View style={[...containerStyle, props.containerStyle]} ref={parentRef}>
|
|
171
|
+
{list.map((item: TabItemType, index: number) => {
|
|
172
|
+
return (
|
|
173
|
+
<BadgeContainer badgeProps={item?.badgeProps} key={`${item.name}${item.value}`}>
|
|
174
|
+
<TouchableWithoutFeedback
|
|
175
|
+
onPress={() => {
|
|
176
|
+
setActiveIndex(index);
|
|
177
|
+
props?.onChange?.(item.value, index);
|
|
178
|
+
}}
|
|
179
|
+
key={item.value}
|
|
180
|
+
>
|
|
181
|
+
<View style={[tabItemStyle(item), tabItemStyles]} testID={`TabItemContainer${index}`}>
|
|
182
|
+
{/* 左侧icon */}
|
|
183
|
+
{showIcon("leftIcon", item) ? (
|
|
184
|
+
<View style={[styles.leftIcon, iconStyle(item)]}>
|
|
185
|
+
<Icon
|
|
186
|
+
icon={item.iconProps?.icon}
|
|
187
|
+
fill={iconColor(item)}
|
|
188
|
+
size={item.iconProps?.size || 12}
|
|
189
|
+
type={item.iconProps?.type}
|
|
190
|
+
/>
|
|
191
|
+
</View>
|
|
192
|
+
) : (
|
|
193
|
+
<></>
|
|
194
|
+
)}
|
|
161
195
|
{/* 中间文字 */}
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
196
|
+
<Text
|
|
197
|
+
ref={(el: any) => (childRefs.current[index] = el)}
|
|
198
|
+
style={[
|
|
199
|
+
styles.tabItemTextWrapper,
|
|
200
|
+
props.active === item.value
|
|
201
|
+
? [styles.activeText, getRedsDropDownVariantStyles().color.title]
|
|
202
|
+
: [styles.normalText, getRedsDropDownVariantStyles().color.description],
|
|
203
|
+
]}
|
|
204
|
+
onLayout={() => {
|
|
205
|
+
childRefs.current[index].measureLayout(
|
|
206
|
+
parentRef.current,
|
|
207
|
+
(x: number, y: number, width: number, height: number) => {
|
|
208
|
+
if (offsets.filter((i) => i).length !== list.length) {
|
|
209
|
+
setOffsets((offsets) => {
|
|
210
|
+
if (!offsets[index]) {
|
|
211
|
+
offsets[index] = x;
|
|
212
|
+
}
|
|
213
|
+
return [...offsets];
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (widths.filter((i) => i).length !== list.length) {
|
|
217
|
+
setWidths((widths) => {
|
|
218
|
+
if (!widths[index]) {
|
|
219
|
+
widths[index] = width;
|
|
220
|
+
}
|
|
221
|
+
return [...widths];
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
(error: any) => {
|
|
226
|
+
console.error("error", error);
|
|
227
|
+
},
|
|
228
|
+
);
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
{item.name}
|
|
232
|
+
</Text>
|
|
173
233
|
{/* 右侧文字样式 */}
|
|
174
234
|
{item.labelNumber ? (
|
|
175
235
|
<View style={styles.labelNumber}>
|
|
@@ -193,30 +253,29 @@ const Tabs = (props: RedsTab) => {
|
|
|
193
253
|
) : (
|
|
194
254
|
<></>
|
|
195
255
|
)}
|
|
256
|
+
{/* 右侧icon */}
|
|
257
|
+
{showIcon("rightIcon", item) ? (
|
|
258
|
+
<View style={[styles.rightIcon, iconStyle(item)]}>
|
|
259
|
+
<Icon
|
|
260
|
+
icon={item.iconProps?.icon}
|
|
261
|
+
fill={iconColor(item)}
|
|
262
|
+
size={item.iconProps?.size || 12}
|
|
263
|
+
type={item.iconProps?.type}
|
|
264
|
+
/>
|
|
265
|
+
</View>
|
|
266
|
+
) : (
|
|
267
|
+
<></>
|
|
268
|
+
)}
|
|
196
269
|
</View>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
</View>
|
|
204
|
-
{/* 右侧icon */}
|
|
205
|
-
{showIcon("rightIcon", item) ? (
|
|
206
|
-
<View style={[styles.rightIcon, iconStyle(item)]}>
|
|
207
|
-
<Icon icon={item.iconProps?.icon} size={item.iconProps?.size || 12} type={item.iconProps?.type} />
|
|
208
|
-
</View>
|
|
209
|
-
) : (
|
|
210
|
-
<></>
|
|
211
|
-
)}
|
|
212
|
-
</View>
|
|
213
|
-
</TouchableWithoutFeedback>
|
|
214
|
-
</BadgeContainer>
|
|
215
|
-
);
|
|
216
|
-
})}
|
|
270
|
+
</TouchableWithoutFeedback>
|
|
271
|
+
</BadgeContainer>
|
|
272
|
+
);
|
|
273
|
+
})}
|
|
274
|
+
</View>
|
|
275
|
+
</View>
|
|
217
276
|
</Wrapper>
|
|
218
277
|
{props.children[activeIndex]}
|
|
219
|
-
|
|
278
|
+
</>
|
|
220
279
|
);
|
|
221
280
|
};
|
|
222
281
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Text, StyleSheet, ScrollView, View } from "react-native";
|
|
3
3
|
import { Tab, TabType, Tabs } from "@xhs/reds-rn-next";
|
|
4
|
-
import {
|
|
4
|
+
import { Activity } from "@xhs/reder-icon-svg-ReDs_icon";
|
|
5
5
|
|
|
6
6
|
const { TabThemeType, TabSizeType, TabLabelType, TabLayoutType } = TabType;
|
|
7
7
|
|
|
@@ -27,21 +27,30 @@ const iconData = [
|
|
|
27
27
|
name: "标签",
|
|
28
28
|
key: "0",
|
|
29
29
|
iconProps: {
|
|
30
|
-
icon:
|
|
30
|
+
icon: Activity,
|
|
31
|
+
type: "svg",
|
|
32
|
+
size: 24,
|
|
33
|
+
fill: "#000",
|
|
31
34
|
},
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
name: "标签",
|
|
35
38
|
key: "1",
|
|
36
39
|
iconProps: {
|
|
37
|
-
icon:
|
|
40
|
+
icon: Activity,
|
|
41
|
+
type: "svg",
|
|
42
|
+
size: 24,
|
|
43
|
+
fill: "#000",
|
|
38
44
|
},
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
47
|
name: "标签",
|
|
42
48
|
key: "2",
|
|
43
49
|
iconProps: {
|
|
44
|
-
icon:
|
|
50
|
+
icon: Activity,
|
|
51
|
+
type: "svg",
|
|
52
|
+
size: 24,
|
|
53
|
+
fill: "#000",
|
|
45
54
|
},
|
|
46
55
|
},
|
|
47
56
|
];
|
|
@@ -162,7 +171,10 @@ const badgeData2 = [
|
|
|
162
171
|
name: "标签",
|
|
163
172
|
key: "0",
|
|
164
173
|
iconProps: {
|
|
165
|
-
icon:
|
|
174
|
+
icon: Activity,
|
|
175
|
+
type: "svg",
|
|
176
|
+
size: 24,
|
|
177
|
+
fill: "#000",
|
|
166
178
|
},
|
|
167
179
|
badgeProps: {
|
|
168
180
|
max: 99,
|
|
@@ -173,7 +185,10 @@ const badgeData2 = [
|
|
|
173
185
|
name: "标签",
|
|
174
186
|
key: "1",
|
|
175
187
|
iconProps: {
|
|
176
|
-
icon:
|
|
188
|
+
icon: Activity,
|
|
189
|
+
type: "svg",
|
|
190
|
+
size: 24,
|
|
191
|
+
fill: "#000",
|
|
177
192
|
},
|
|
178
193
|
badgeProps: {
|
|
179
194
|
position: "centerRight",
|
|
@@ -184,7 +199,10 @@ const badgeData2 = [
|
|
|
184
199
|
name: "标签",
|
|
185
200
|
key: "2",
|
|
186
201
|
iconProps: {
|
|
187
|
-
icon:
|
|
202
|
+
icon: Activity,
|
|
203
|
+
type: "svg",
|
|
204
|
+
size: 24,
|
|
205
|
+
fill: "#000",
|
|
188
206
|
},
|
|
189
207
|
badgeProps: {
|
|
190
208
|
offset: [30, -30],
|
|
@@ -202,7 +220,7 @@ export default function App() {
|
|
|
202
220
|
|
|
203
221
|
return (
|
|
204
222
|
<ScrollView style={styles.container}>
|
|
205
|
-
<Desc>纯文字选项卡</Desc>
|
|
223
|
+
{/* <Desc>纯文字选项卡</Desc>
|
|
206
224
|
<Tabs active={active} onChange={handleChange} theme={TabThemeType.text} layout={TabLayoutType.space}>
|
|
207
225
|
{data.map((item, index) => {
|
|
208
226
|
return (
|
|
@@ -213,7 +231,7 @@ export default function App() {
|
|
|
213
231
|
</Tab>
|
|
214
232
|
);
|
|
215
233
|
})}
|
|
216
|
-
</Tabs>
|
|
234
|
+
</Tabs> */}
|
|
217
235
|
|
|
218
236
|
<Desc>指示线选项卡</Desc>
|
|
219
237
|
<Tabs active={active} onChange={handleChange} layout={TabLayoutType.space}>
|
|
@@ -228,7 +246,7 @@ export default function App() {
|
|
|
228
246
|
})}
|
|
229
247
|
</Tabs>
|
|
230
248
|
|
|
231
|
-
<Desc>胶囊选项卡</Desc>
|
|
249
|
+
{/* <Desc>胶囊选项卡</Desc>
|
|
232
250
|
<Tabs active={active} onChange={handleChange} theme={TabThemeType.capsule} layout={TabLayoutType.space}>
|
|
233
251
|
{data.map((item, index) => {
|
|
234
252
|
return (
|
|
@@ -271,6 +289,7 @@ export default function App() {
|
|
|
271
289
|
>
|
|
272
290
|
{iconData.map((item, index) => {
|
|
273
291
|
return (
|
|
292
|
+
// @ts-expect-error
|
|
274
293
|
<Tab name={item.name} value={item.key} iconProps={item.iconProps}>
|
|
275
294
|
<View style={{ backgroundColor: "pink", height: 100, width: "100%" }}>
|
|
276
295
|
<Text>内容{index}</Text>
|
|
@@ -291,6 +310,7 @@ export default function App() {
|
|
|
291
310
|
>
|
|
292
311
|
{iconData.map((item, index) => {
|
|
293
312
|
return (
|
|
313
|
+
// @ts-expect-error
|
|
294
314
|
<Tab name={item.name} value={item.key} iconProps={item.iconProps}>
|
|
295
315
|
<View style={{ backgroundColor: "pink", height: 100, width: "100%" }}>
|
|
296
316
|
<Text>内容{index}</Text>
|
|
@@ -426,6 +446,7 @@ export default function App() {
|
|
|
426
446
|
>
|
|
427
447
|
{iconData.map((item, index) => {
|
|
428
448
|
return (
|
|
449
|
+
// @ts-expect-error
|
|
429
450
|
<Tab name={item.name} value={item.key} iconProps={item.iconProps}>
|
|
430
451
|
<View style={{ backgroundColor: "pink", height: 100, width: "100%" }}>
|
|
431
452
|
<Text>内容{index}</Text>
|
|
@@ -469,6 +490,7 @@ export default function App() {
|
|
|
469
490
|
>
|
|
470
491
|
{iconData.map((item, index) => {
|
|
471
492
|
return (
|
|
493
|
+
// @ts-expect-error
|
|
472
494
|
<Tab name={item.name} value={item.key} iconProps={item.iconProps}>
|
|
473
495
|
<View style={{ backgroundColor: "pink", height: 100, width: "100%" }}>
|
|
474
496
|
<Text>内容{index}</Text>
|
|
@@ -488,7 +510,7 @@ export default function App() {
|
|
|
488
510
|
</Tab>
|
|
489
511
|
);
|
|
490
512
|
})}
|
|
491
|
-
</Tabs>
|
|
513
|
+
</Tabs> */}
|
|
492
514
|
</ScrollView>
|
|
493
515
|
);
|
|
494
516
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { alwaysColor } from "@xhs/reds-token-next";
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
3
|
import { useThemeColor } from "../ConfigProvider";
|
|
4
|
+
import { relative } from "path";
|
|
4
5
|
|
|
5
6
|
const styles = StyleSheet.create({
|
|
6
7
|
tabCenterContainer: {
|
|
@@ -9,10 +10,15 @@ const styles = StyleSheet.create({
|
|
|
9
10
|
flexDirection: "row",
|
|
10
11
|
alignItems: "center",
|
|
11
12
|
justifyContent: "center",
|
|
13
|
+
width: "100%",
|
|
12
14
|
},
|
|
13
15
|
tabLeftContainer: {
|
|
14
16
|
width: "100%",
|
|
15
17
|
height: 44,
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "flex-start",
|
|
16
22
|
},
|
|
17
23
|
tabSpaceContainer: {
|
|
18
24
|
width: "100%",
|
|
@@ -33,9 +39,10 @@ const styles = StyleSheet.create({
|
|
|
33
39
|
},
|
|
34
40
|
underline: {
|
|
35
41
|
height: 2,
|
|
36
|
-
width: "90%",
|
|
37
42
|
borderRadius: 2,
|
|
38
43
|
paddingHorizontal: 2,
|
|
44
|
+
position: "absolute",
|
|
45
|
+
bottom: 2,
|
|
39
46
|
},
|
|
40
47
|
smallText: {
|
|
41
48
|
fontSize: 14,
|
|
@@ -68,7 +75,6 @@ const styles = StyleSheet.create({
|
|
|
68
75
|
flexDirection: "column",
|
|
69
76
|
justifyContent: "center",
|
|
70
77
|
alignItems: "center",
|
|
71
|
-
position: "relative",
|
|
72
78
|
},
|
|
73
79
|
leftIcon: {
|
|
74
80
|
marginRight: 2,
|
|
@@ -103,10 +109,6 @@ const styles = StyleSheet.create({
|
|
|
103
109
|
alignItems: "center",
|
|
104
110
|
flexDirection: "row",
|
|
105
111
|
},
|
|
106
|
-
columnFlex: {
|
|
107
|
-
display: "flex",
|
|
108
|
-
alignItems: "center",
|
|
109
|
-
},
|
|
110
112
|
});
|
|
111
113
|
|
|
112
114
|
export const getRedsDropDownVariantStyles = () => {
|
|
@@ -218,17 +218,17 @@ const Uploader = (props: RedsUploader) => {
|
|
|
218
218
|
{item.status && item.status !== "success" ? (
|
|
219
219
|
<View style={styles.progressIndicator}>
|
|
220
220
|
{/** initial */}
|
|
221
|
-
{item.status === "initial" ? <ProgressIndicator size={18} strokeColor={
|
|
221
|
+
{item.status === "initial" ? <ProgressIndicator size={18} strokeColor={"#fff"} /> : <></>}
|
|
222
222
|
{/** uploading */}
|
|
223
223
|
{item.status === "uploading" ? (
|
|
224
224
|
<ProgressIndicator
|
|
225
225
|
size={item.statusNumber === undefined ? 18 : 40}
|
|
226
226
|
showPercent={!!item.statusNumber}
|
|
227
227
|
type="progress"
|
|
228
|
-
strokeColor={
|
|
228
|
+
strokeColor={"#fff"}
|
|
229
229
|
percent={item.statusNumber}
|
|
230
230
|
textStyle={{
|
|
231
|
-
color:
|
|
231
|
+
color: "#fff",
|
|
232
232
|
fontSize: 10,
|
|
233
233
|
}}
|
|
234
234
|
/>
|
|
@@ -290,17 +290,17 @@ const Uploader = (props: RedsUploader) => {
|
|
|
290
290
|
{item.status && item.status !== "success" ? (
|
|
291
291
|
<View style={styles.identityProgressIndicator}>
|
|
292
292
|
{/** initial */}
|
|
293
|
-
{item.status === "initial" ? <ProgressIndicator size={18} strokeColor={
|
|
293
|
+
{item.status === "initial" ? <ProgressIndicator size={18} strokeColor={"#fff"} /> : <></>}
|
|
294
294
|
{/** uploading */}
|
|
295
295
|
{item.status === "uploading" ? (
|
|
296
296
|
<ProgressIndicator
|
|
297
297
|
size={item.statusNumber === undefined ? 18 : 40}
|
|
298
298
|
showPercent={!!item.statusNumber}
|
|
299
299
|
type="progress"
|
|
300
|
-
strokeColor={
|
|
300
|
+
strokeColor={"#fff"}
|
|
301
301
|
percent={item.statusNumber}
|
|
302
302
|
textStyle={{
|
|
303
|
-
color:
|
|
303
|
+
color: "#fff",
|
|
304
304
|
fontSize: 10,
|
|
305
305
|
}}
|
|
306
306
|
/>
|
|
@@ -22,6 +22,7 @@ function getUploaderStyle(props: RedsUploader, themeColor: any) {
|
|
|
22
22
|
height: uploadSizeMap[props.size || UploaderSize.NORMAL],
|
|
23
23
|
marginRight: 10,
|
|
24
24
|
marginTop: 10,
|
|
25
|
+
borderRadius: 6,
|
|
25
26
|
},
|
|
26
27
|
identityView: {
|
|
27
28
|
position: "relative",
|
|
@@ -57,10 +58,12 @@ function getUploaderStyle(props: RedsUploader, themeColor: any) {
|
|
|
57
58
|
identityImage: {
|
|
58
59
|
width: 170,
|
|
59
60
|
height: 85,
|
|
61
|
+
borderRadius: 6,
|
|
60
62
|
},
|
|
61
63
|
image: {
|
|
62
64
|
width: "100%",
|
|
63
65
|
height: "100%",
|
|
66
|
+
borderRadius: 6,
|
|
64
67
|
},
|
|
65
68
|
close: {
|
|
66
69
|
width: 16,
|
|
@@ -128,7 +131,7 @@ function getUploaderStyle(props: RedsUploader, themeColor: any) {
|
|
|
128
131
|
flexDirection: "column",
|
|
129
132
|
alignItems: "center",
|
|
130
133
|
justifyContent: "center",
|
|
131
|
-
backgroundColor:
|
|
134
|
+
backgroundColor: "rgba(48,48,52,0.5)",
|
|
132
135
|
},
|
|
133
136
|
identityProgressIndicator: {
|
|
134
137
|
width: 170,
|
|
@@ -142,7 +145,7 @@ function getUploaderStyle(props: RedsUploader, themeColor: any) {
|
|
|
142
145
|
flexDirection: "column",
|
|
143
146
|
alignItems: "center",
|
|
144
147
|
justifyContent: "center",
|
|
145
|
-
backgroundColor:
|
|
148
|
+
backgroundColor: "rgba(48,48,52,0.5)",
|
|
146
149
|
},
|
|
147
150
|
progressDesc: {
|
|
148
151
|
color: themeColor.White,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
2
|
ActionSheetsContainer: {
|
|
3
3
|
width: "100%";
|
|
4
|
-
overflowY: string;
|
|
5
4
|
borderTopLeftRadius: number;
|
|
6
5
|
borderTopRightRadius: number;
|
|
6
|
+
display: "flex";
|
|
7
|
+
height: "100%";
|
|
8
|
+
flexDirection: "column";
|
|
7
9
|
};
|
|
8
10
|
description: {
|
|
9
11
|
height: number;
|
|
@@ -16,6 +18,7 @@ declare const styles: {
|
|
|
16
18
|
justifyContent: "center";
|
|
17
19
|
borderTopLeftRadius: number;
|
|
18
20
|
borderTopRightRadius: number;
|
|
21
|
+
flexShrink: number;
|
|
19
22
|
};
|
|
20
23
|
descriptionText: {
|
|
21
24
|
fontSize: number;
|
|
@@ -53,6 +53,7 @@ export interface RedsCheckBox {
|
|
|
53
53
|
style?: ViewStyle;
|
|
54
54
|
size?: CheckBoxGroupSize;
|
|
55
55
|
onChange?: (value: string | number, checked: boolean) => void;
|
|
56
|
+
isControl?: boolean;
|
|
56
57
|
}
|
|
57
58
|
export declare const RedsCheckBoxDefaultProps: {
|
|
58
59
|
placement: CheckBoxPlacement;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RedsForm } from "./interface/index";
|
|
3
|
-
declare const Form:
|
|
4
|
-
(props: RedsForm): React.JSX.Element;
|
|
5
|
-
defaultProps: {
|
|
6
|
-
layout: import("./interface/index").LAYOUT;
|
|
7
|
-
align: import("./interface/index").ALIGN;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
3
|
+
declare const Form: React.ForwardRefExoticComponent<RedsForm & React.RefAttributes<unknown>>;
|
|
10
4
|
export default Form;
|
|
@@ -23,14 +23,18 @@ export interface RedsForm {
|
|
|
23
23
|
data: FormData;
|
|
24
24
|
rules: FormRules;
|
|
25
25
|
onSubmit?: (value: FormData) => any;
|
|
26
|
-
children: ReactNode[];
|
|
26
|
+
children: ReactNode[] | ReactNode;
|
|
27
27
|
layout?: LAYOUT;
|
|
28
28
|
align?: ALIGN;
|
|
29
|
+
showSubmit?: boolean;
|
|
30
|
+
submitText?: string;
|
|
29
31
|
}
|
|
30
32
|
export interface RedsFormEvent {}
|
|
31
33
|
export declare const FormDefaultProps: {
|
|
32
34
|
layout: LAYOUT;
|
|
33
35
|
align: ALIGN;
|
|
36
|
+
showSubmit: boolean;
|
|
37
|
+
submitText: string;
|
|
34
38
|
};
|
|
35
39
|
export interface RedsFormItem {
|
|
36
40
|
/**
|
|
@@ -52,7 +56,7 @@ export interface RedsFormItem {
|
|
|
52
56
|
/**
|
|
53
57
|
* label
|
|
54
58
|
*/
|
|
55
|
-
label
|
|
59
|
+
label?: string;
|
|
56
60
|
/**
|
|
57
61
|
* value
|
|
58
62
|
*/
|
|
@@ -76,11 +80,19 @@ export interface RedsFormItem {
|
|
|
76
80
|
/**
|
|
77
81
|
* label styles
|
|
78
82
|
*/
|
|
79
|
-
labelStyle?:
|
|
83
|
+
labelStyle?: ViewStyle;
|
|
84
|
+
/**
|
|
85
|
+
* label text styles
|
|
86
|
+
*/
|
|
87
|
+
labelTextStyle?: TextStyle;
|
|
80
88
|
/**
|
|
81
89
|
* formItem slot styles
|
|
82
90
|
*/
|
|
83
91
|
formItemSlotStyles?: ViewStyle;
|
|
92
|
+
/**
|
|
93
|
+
* label slot
|
|
94
|
+
*/
|
|
95
|
+
LabelComponent?: ReactNode;
|
|
84
96
|
}
|
|
85
97
|
export interface RedsFormItemEvent {
|
|
86
98
|
(e: "validate", value: Event): any;
|