@fluentui-react-native/tester 0.58.0 → 0.58.3
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/CHANGELOG.json +286 -1
- package/CHANGELOG.md +66 -2
- package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +6 -6
- package/lib/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Callout/CalloutTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/Callout/CalloutTest.js +7 -7
- package/lib/FluentTester/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Checkbox/CheckboxTest.js +6 -6
- package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +12 -10
- package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Common/Slider.js +1 -1
- package/lib/FluentTester/TestComponents/Common/Slider.js.map +1 -1
- package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +4 -4
- package/lib/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js +4 -4
- package/lib/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/FocusTrapZone/FocusTrapZoneTest.js +2 -2
- package/lib/FluentTester/TestComponents/FocusZone/FocusZoneTest.d.ts.map +1 -1
- package/lib/FluentTester/TestComponents/FocusZone/FocusZoneTest.js +24 -26
- package/lib/FluentTester/TestComponents/FocusZone/FocusZoneTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Icon/IconTest.js +2 -2
- package/lib/FluentTester/TestComponents/Link/LinkTest.js +2 -2
- package/lib/FluentTester/TestComponents/NativeDatePicker/NativeDatePickerTest.js +2 -2
- package/lib/FluentTester/TestComponents/NativeDatePicker/NativeDatePickerTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +1 -1
- package/lib/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
- package/lib/FluentTester/TestComponents/Pressable/PressableTest.js +2 -2
- package/lib/FluentTester/TestComponents/Pressable/PressableTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/RadioGroup/RadioGroupTest.js +2 -2
- package/lib/FluentTester/TestComponents/Separator/SeparatorTest.js +2 -2
- package/lib/FluentTester/TestComponents/Separator/SeparatorTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Svg/SvgTest.js +20 -20
- package/lib/FluentTester/TestComponents/Svg/SvgTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/Tabs/TabsTest.js +18 -18
- package/lib/FluentTester/TestComponents/Tabs/TabsTest.js.map +1 -1
- package/lib/FluentTester/TestComponents/TabsExperimental/TabsTest.js +16 -16
- package/lib/FluentTester/TestComponents/TabsExperimental/TabsTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js +6 -6
- package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Callout/CalloutTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Callout/CalloutTest.js +7 -7
- package/lib-commonjs/FluentTester/TestComponents/Callout/CalloutTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Checkbox/CheckboxTest.js +6 -6
- package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +12 -10
- package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Common/Slider.js +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Common/Slider.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js +4 -4
- package/lib-commonjs/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js +4 -4
- package/lib-commonjs/FluentTester/TestComponents/Expander/ExpanderTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/FocusTrapZone/FocusTrapZoneTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/FocusZone/FocusZoneTest.d.ts.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/FocusZone/FocusZoneTest.js +24 -26
- package/lib-commonjs/FluentTester/TestComponents/FocusZone/FocusZoneTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Icon/IconTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/Link/LinkTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/NativeDatePicker/NativeDatePickerTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/NativeDatePicker/NativeDatePickerTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js +1 -1
- package/lib-commonjs/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Pressable/PressableTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/Pressable/PressableTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/RadioGroup/RadioGroupTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/Separator/SeparatorTest.js +2 -2
- package/lib-commonjs/FluentTester/TestComponents/Separator/SeparatorTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Svg/SvgTest.js +20 -20
- package/lib-commonjs/FluentTester/TestComponents/Svg/SvgTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsTest.js +18 -18
- package/lib-commonjs/FluentTester/TestComponents/Tabs/TabsTest.js.map +1 -1
- package/lib-commonjs/FluentTester/TestComponents/TabsExperimental/TabsTest.js +16 -16
- package/lib-commonjs/FluentTester/TestComponents/TabsExperimental/TabsTest.js.map +1 -1
- package/package.json +24 -24
- package/src/FluentTester/TestComponents/ActivityIndicator/ActivityIndicatorTest.tsx +6 -6
- package/src/FluentTester/TestComponents/Callout/CalloutTest.tsx +34 -28
- package/src/FluentTester/TestComponents/Checkbox/CheckboxTest.tsx +6 -6
- package/src/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.tsx +10 -8
- package/src/FluentTester/TestComponents/Common/Slider.tsx +1 -1
- package/src/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.tsx +4 -4
- package/src/FluentTester/TestComponents/Expander/ExpanderTest.tsx +4 -4
- package/src/FluentTester/TestComponents/FocusTrapZone/FocusTrapZoneTest.tsx +2 -2
- package/src/FluentTester/TestComponents/FocusZone/FocusZoneTest.tsx +27 -25
- package/src/FluentTester/TestComponents/Icon/IconTest.tsx +2 -2
- package/src/FluentTester/TestComponents/Link/LinkTest.tsx +2 -2
- package/src/FluentTester/TestComponents/NativeDatePicker/NativeDatePickerTest.tsx +2 -2
- package/src/FluentTester/TestComponents/PersonaCoin/CustomizeUsage.mobile.tsx +1 -1
- package/src/FluentTester/TestComponents/Pressable/PressableTest.tsx +2 -2
- package/src/FluentTester/TestComponents/RadioGroup/RadioGroupTest.tsx +2 -2
- package/src/FluentTester/TestComponents/Separator/SeparatorTest.tsx +2 -2
- package/src/FluentTester/TestComponents/Svg/SvgTest.tsx +20 -20
- package/src/FluentTester/TestComponents/Tabs/TabsTest.tsx +18 -18
- package/src/FluentTester/TestComponents/TabsExperimental/TabsTest.tsx +16 -16
|
@@ -7,7 +7,7 @@ import { focusZoneTestStyles, stackStyleFocusZone } from './styles';
|
|
|
7
7
|
import { commonTestStyles } from '../Common/styles';
|
|
8
8
|
import { Stack } from '@fluentui-react-native/stack';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const DirectionalFocusZone: React.FunctionComponent = () => {
|
|
11
11
|
return (
|
|
12
12
|
<View>
|
|
13
13
|
<Button content="Outside FocusZone" />
|
|
@@ -55,7 +55,7 @@ const directionalFocusZone: React.FunctionComponent = () => {
|
|
|
55
55
|
);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const CommonUsageFocusZone: React.FunctionComponent = () => {
|
|
59
59
|
return (
|
|
60
60
|
<View>
|
|
61
61
|
<Button content="Outside FocusZone" />
|
|
@@ -79,42 +79,44 @@ const commonUsageFocusZone: React.FunctionComponent = () => {
|
|
|
79
79
|
);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const Navigation2DFocusZone: React.FunctionComponent = () => {
|
|
83
83
|
const buttonRefs = [];
|
|
84
|
-
const onClicks = [];
|
|
85
84
|
const [defaultTabbableElementIndex, setDefaultTabbableElementIndex] = React.useState<number>(5);
|
|
85
|
+
const onClick = React.useCallback(
|
|
86
|
+
(i: number) => {
|
|
87
|
+
setDefaultTabbableElementIndex(i);
|
|
88
|
+
},
|
|
89
|
+
[setDefaultTabbableElementIndex],
|
|
90
|
+
);
|
|
86
91
|
|
|
87
92
|
for (let i = 0; i <= 9; i++) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
setDefaultTabbableElementIndex(i);
|
|
92
|
-
}, [setDefaultTabbableElementIndex]),
|
|
93
|
-
);
|
|
93
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
94
|
+
const ref = React.useRef<View>(null);
|
|
95
|
+
buttonRefs.push(i == 0 ? undefined : ref);
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
return (
|
|
97
99
|
<View>
|
|
98
100
|
<View>
|
|
99
101
|
<Button content="Outside FocusZone" />
|
|
100
|
-
<Button content="Clear default tabble element" onClick={
|
|
102
|
+
<Button content="Clear default tabble element" onClick={() => onClick(0)} />
|
|
101
103
|
</View>
|
|
102
104
|
<FocusZone use2DNavigation={true} defaultTabbableElement={buttonRefs[defaultTabbableElementIndex]} isCircularNavigation={true}>
|
|
103
105
|
<View style={focusZoneTestStyles.focusZoneContainer}>
|
|
104
106
|
<View style={focusZoneTestStyles.focusZoneViewStyle}>
|
|
105
|
-
<Button content="#1" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[1]} onClick={
|
|
106
|
-
<Button content="#2" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[2]} onClick={
|
|
107
|
-
<Button content="#3" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[3]} onClick={
|
|
107
|
+
<Button content="#1" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[1]} onClick={() => onClick(1)} />
|
|
108
|
+
<Button content="#2" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[2]} onClick={() => onClick(2)} />
|
|
109
|
+
<Button content="#3" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[3]} onClick={() => onClick(3)} />
|
|
108
110
|
</View>
|
|
109
111
|
<View style={focusZoneTestStyles.focusZoneViewStyle}>
|
|
110
|
-
<Button content="#4" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[4]} onClick={
|
|
111
|
-
<Button content="#5" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[5]} onClick={
|
|
112
|
-
<Button content="#6" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[6]} onClick={
|
|
112
|
+
<Button content="#4" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[4]} onClick={() => onClick(4)} />
|
|
113
|
+
<Button content="#5" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[5]} onClick={() => onClick(5)} />
|
|
114
|
+
<Button content="#6" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[6]} onClick={() => onClick(6)} />
|
|
113
115
|
</View>
|
|
114
116
|
<View style={focusZoneTestStyles.focusZoneViewStyle}>
|
|
115
|
-
<Button content="#7" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[7]} onClick={
|
|
116
|
-
<Button content="#8" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[8]} onClick={
|
|
117
|
-
<Button content="#9" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[9]} onClick={
|
|
117
|
+
<Button content="#7" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[7]} onClick={() => onClick(7)} />
|
|
118
|
+
<Button content="#8" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[8]} onClick={() => onClick(8)} />
|
|
119
|
+
<Button content="#9" style={focusZoneTestStyles.focusZoneButton} componentRef={buttonRefs[9]} onClick={() => onClick(9)} />
|
|
118
120
|
</View>
|
|
119
121
|
</View>
|
|
120
122
|
</FocusZone>
|
|
@@ -143,7 +145,7 @@ function SwitchWithLabel(props: ISwitchWithLabelProps): React.ReactElement {
|
|
|
143
145
|
|
|
144
146
|
const focusZoneDirectionStrings = ['Bidirectional', 'Horizontal', 'Vertical', 'None'];
|
|
145
147
|
|
|
146
|
-
const
|
|
148
|
+
const CustomizableFocusZone: React.FunctionComponent = () => {
|
|
147
149
|
const [is2DNav, set2dNav] = React.useState(false);
|
|
148
150
|
const [isDisabled, setDisabled] = React.useState(false);
|
|
149
151
|
const [isCircularNav, setIsCircularNav] = React.useState(false);
|
|
@@ -223,19 +225,19 @@ const focusZoneSections: TestSection[] = [
|
|
|
223
225
|
{
|
|
224
226
|
name: 'Directional FocusZone Usage',
|
|
225
227
|
testID: FOCUSZONE_TESTPAGE,
|
|
226
|
-
component:
|
|
228
|
+
component: DirectionalFocusZone,
|
|
227
229
|
},
|
|
228
230
|
{
|
|
229
231
|
name: 'Common FocusZone Usage',
|
|
230
|
-
component:
|
|
232
|
+
component: CommonUsageFocusZone,
|
|
231
233
|
},
|
|
232
234
|
{
|
|
233
235
|
name: '2D Navigation with Default Tabbable Element (#5) FocusZone Usage',
|
|
234
|
-
component:
|
|
236
|
+
component: Navigation2DFocusZone,
|
|
235
237
|
},
|
|
236
238
|
{
|
|
237
239
|
name: 'Customizable FocusZone',
|
|
238
|
-
component:
|
|
240
|
+
component: CustomizableFocusZone,
|
|
239
241
|
},
|
|
240
242
|
];
|
|
241
243
|
|
|
@@ -11,7 +11,7 @@ const testImage = require('./../../../../assets/testicon.png');
|
|
|
11
11
|
const testTtf = require('./../../../../assets/Font_Awesome_900.otf');
|
|
12
12
|
import TestSvg from './assets/test.svg';
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const Icons: React.FunctionComponent = () => {
|
|
15
15
|
const fontCustomFontProps: FontIconProps = {
|
|
16
16
|
fontFamily: 'Font Awesome 5 Free',
|
|
17
17
|
fontSrcFile: testTtf,
|
|
@@ -94,7 +94,7 @@ const iconSections: TestSection[] = [
|
|
|
94
94
|
{
|
|
95
95
|
name: 'Icon',
|
|
96
96
|
testID: ICON_TESTPAGE,
|
|
97
|
-
component:
|
|
97
|
+
component: Icons,
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
name: 'Icon for E2E Testing',
|
|
@@ -7,7 +7,7 @@ import { LINK_TESTPAGE } from './consts';
|
|
|
7
7
|
import { Test, TestSection, PlatformStatus } from '../Test';
|
|
8
8
|
import { LinkE2ETest } from './E2ELinkTest';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const Links: React.FunctionComponent = () => {
|
|
11
11
|
const doPress = (): void => {
|
|
12
12
|
Alert.alert('Alert.', 'You have been alerted.');
|
|
13
13
|
};
|
|
@@ -24,7 +24,7 @@ const linkSections: TestSection[] = [
|
|
|
24
24
|
{
|
|
25
25
|
name: 'Navigation and Alert',
|
|
26
26
|
testID: LINK_TESTPAGE,
|
|
27
|
-
component:
|
|
27
|
+
component: Links,
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'Link E2E Test',
|
|
@@ -7,7 +7,7 @@ import { Stack } from '@fluentui-react-native/stack';
|
|
|
7
7
|
import { stackStyle } from '../Common/styles';
|
|
8
8
|
import { Text } from '@fluentui/react-native';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const NativeDatePickerMainTest: React.FunctionComponent = () => {
|
|
11
11
|
const [startDate, setStartDate] = React.useState<Date>(new Date());
|
|
12
12
|
const [endDate, setEndDate] = React.useState<Date>(null);
|
|
13
13
|
|
|
@@ -109,7 +109,7 @@ const nativeDatePickerSections: TestSection[] = [
|
|
|
109
109
|
{
|
|
110
110
|
name: 'Native Date Picker',
|
|
111
111
|
testID: NATIVEDATEPICKER_TESTPAGE,
|
|
112
|
-
component:
|
|
112
|
+
component: NativeDatePickerMainTest,
|
|
113
113
|
},
|
|
114
114
|
];
|
|
115
115
|
|
|
@@ -73,7 +73,7 @@ export const CustomizeUsage: React.FunctionComponent = () => {
|
|
|
73
73
|
iconStrokeWidth: iconStrokeWidth,
|
|
74
74
|
};
|
|
75
75
|
return PersonaCoin.customize({ tokens });
|
|
76
|
-
}, [coinColor, textColor,
|
|
76
|
+
}, [coinColor, textColor, coinSize, iconSize, iconStrokeWidth]);
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
79
|
<View style={{ flexDirection: 'column', padding: 10, backgroundColor: showColoredBackground ? 'gray' : 'transparent' }}>
|
|
@@ -92,7 +92,7 @@ const PressComponent: React.FunctionComponent<ViewProps> = (props: ViewProps) =>
|
|
|
92
92
|
);
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
const
|
|
95
|
+
const PressableMainTest: React.FunctionComponent = () => {
|
|
96
96
|
const [hoverProps, hoverState] = useHoverState({});
|
|
97
97
|
|
|
98
98
|
return (
|
|
@@ -126,7 +126,7 @@ const pressableSections: TestSection[] = [
|
|
|
126
126
|
{
|
|
127
127
|
name: 'Pressable Components',
|
|
128
128
|
testID: PRESSABLE_TESTPAGE,
|
|
129
|
-
component:
|
|
129
|
+
component: PressableMainTest,
|
|
130
130
|
},
|
|
131
131
|
];
|
|
132
132
|
|
|
@@ -5,7 +5,7 @@ import { RADIOGROUP_TESTPAGE } from './consts';
|
|
|
5
5
|
import { Test, TestSection, PlatformStatus } from '../Test';
|
|
6
6
|
import { E2ERadioGroupTest } from './RadioGroupE2ETest';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const BasicRadioGroup: React.FunctionComponent = () => {
|
|
9
9
|
// Client's example onChange function
|
|
10
10
|
const onChange = (key: string) => {
|
|
11
11
|
console.log(key);
|
|
@@ -56,7 +56,7 @@ const radioGroupSections: TestSection[] = [
|
|
|
56
56
|
{
|
|
57
57
|
name: 'Basic RadioGroup Usage',
|
|
58
58
|
testID: RADIOGROUP_TESTPAGE,
|
|
59
|
-
component:
|
|
59
|
+
component: BasicRadioGroup,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'RadioGroup for E2E Testing',
|
|
@@ -9,7 +9,7 @@ import { Test, TestSection, PlatformStatus } from '../Test';
|
|
|
9
9
|
const BlueSeparator = Separator.customize({ color: 'blue' });
|
|
10
10
|
const RedSeparator = Separator.customize({ color: 'red' });
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const SeparatorMainTest: React.FunctionComponent = () => {
|
|
13
13
|
return (
|
|
14
14
|
<Stack style={stackStyle} gap={5}>
|
|
15
15
|
<Stack gap={4} style={separatorStackStyle}>
|
|
@@ -31,7 +31,7 @@ const separatorSections: TestSection[] = [
|
|
|
31
31
|
{
|
|
32
32
|
name: 'Basic Button',
|
|
33
33
|
testID: SEPARATOR_TESTPAGE,
|
|
34
|
-
component:
|
|
34
|
+
component: SeparatorMainTest,
|
|
35
35
|
},
|
|
36
36
|
];
|
|
37
37
|
|
|
@@ -13,7 +13,7 @@ const styles = StyleSheet.create({
|
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const RectTest: React.FunctionComponent = () => {
|
|
17
17
|
const [useColorA, setUseColorA] = React.useState(false);
|
|
18
18
|
const colorA = 'red';
|
|
19
19
|
const colorB = 'green';
|
|
@@ -36,7 +36,7 @@ const rect: React.FunctionComponent = () => {
|
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const CircleTest: React.FunctionComponent = () => {
|
|
40
40
|
return (
|
|
41
41
|
<Svg width="50" height="50">
|
|
42
42
|
<Circle cx="25" cy="25" r="20" fill="red" stroke="black" />
|
|
@@ -44,7 +44,7 @@ const circle: React.FunctionComponent = () => {
|
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const
|
|
47
|
+
const LineTest: React.FunctionComponent = () => {
|
|
48
48
|
return (
|
|
49
49
|
<Svg width="50" height="50">
|
|
50
50
|
<Line x1="10" y1="10" x2="20" y2="20" fill="red" stroke="black" />
|
|
@@ -52,7 +52,7 @@ const line: React.FunctionComponent = () => {
|
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const
|
|
55
|
+
const PathTest: React.FunctionComponent = () => {
|
|
56
56
|
return (
|
|
57
57
|
<Svg width="100" height="100">
|
|
58
58
|
<Path d="M 0 0 A 10 10 0 0,1 0 100" fill="magenta" stroke="purple" id="path" />
|
|
@@ -60,7 +60,7 @@ const path: React.FunctionComponent = () => {
|
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const PolygonTest: React.FunctionComponent = () => {
|
|
64
64
|
return (
|
|
65
65
|
<Svg height="100" width="100">
|
|
66
66
|
<Polygon points="40,5 70,80 25,95" fill="lime" stroke="purple" strokeWidth="1" />
|
|
@@ -68,7 +68,7 @@ const polygon: React.FunctionComponent = () => {
|
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const LinearGradientTest: React.FunctionComponent = () => {
|
|
72
72
|
return (
|
|
73
73
|
<Svg height="100" width="100" style={{ backgroundColor: 'black' }} viewBox="0 0 10 10" color="yellow">
|
|
74
74
|
<Defs>
|
|
@@ -82,7 +82,7 @@ const linearGradient: React.FunctionComponent = () => {
|
|
|
82
82
|
);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const
|
|
85
|
+
const RadialGradientTest: React.FunctionComponent = () => {
|
|
86
86
|
return (
|
|
87
87
|
<Svg height="100" width="100" style={{ backgroundColor: 'black' }} viewBox="0 0 10 10" color="yellow">
|
|
88
88
|
<Defs>
|
|
@@ -96,7 +96,7 @@ const radialGradient: React.FunctionComponent = () => {
|
|
|
96
96
|
);
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
const
|
|
99
|
+
const RectCircleTest: React.FunctionComponent = () => {
|
|
100
100
|
return (
|
|
101
101
|
<Svg height="200" width="200">
|
|
102
102
|
<Defs>
|
|
@@ -113,11 +113,11 @@ const rectCircle: React.FunctionComponent = () => {
|
|
|
113
113
|
);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
const
|
|
116
|
+
const BundledSvgTest: React.FunctionComponent = () => {
|
|
117
117
|
return <TestSvg width={200} height={200} color="red" />;
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
const
|
|
120
|
+
const RemoteSvgTest: React.FunctionComponent = () => {
|
|
121
121
|
return (
|
|
122
122
|
<View>
|
|
123
123
|
<SvgCssUri
|
|
@@ -144,43 +144,43 @@ const svgSections: TestSection[] = [
|
|
|
144
144
|
{
|
|
145
145
|
name: 'Rect',
|
|
146
146
|
testID: SVG_TESTPAGE,
|
|
147
|
-
component:
|
|
147
|
+
component: RectTest,
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
name: 'Circle',
|
|
151
|
-
component:
|
|
151
|
+
component: CircleTest,
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
name: 'Line',
|
|
155
|
-
component:
|
|
155
|
+
component: LineTest,
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
name: 'Path',
|
|
159
|
-
component:
|
|
159
|
+
component: PathTest,
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
name: 'Polygon',
|
|
163
|
-
component:
|
|
163
|
+
component: PolygonTest,
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
name: 'Linear Gradient',
|
|
167
|
-
component:
|
|
167
|
+
component: LinearGradientTest,
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
name: 'Radial Gradient',
|
|
171
|
-
component:
|
|
171
|
+
component: RadialGradientTest,
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
name: 'Rect and Circle via Defs and Use',
|
|
175
|
-
component:
|
|
175
|
+
component: RectCircleTest,
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
name: 'Bundled Svg',
|
|
179
|
-
component:
|
|
179
|
+
component: BundledSvgTest,
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
name: 'Remotely Retrieved Svgs',
|
|
183
|
-
component:
|
|
183
|
+
component: RemoteSvgTest,
|
|
184
184
|
},
|
|
185
185
|
];
|
|
186
186
|
|
|
@@ -7,7 +7,7 @@ import { Test, TestSection, PlatformStatus } from '../Test';
|
|
|
7
7
|
import { E2ETabsTest } from './TabsE2ETest';
|
|
8
8
|
import TestSvg from './test.svg';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const TabsMainTest: React.FunctionComponent = () => {
|
|
11
11
|
return (
|
|
12
12
|
<View style={stackStyle}>
|
|
13
13
|
<Tabs label="Tabs">
|
|
@@ -25,7 +25,7 @@ const tabs: React.FunctionComponent = () => {
|
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const DisabledTabs: React.FunctionComponent = () => {
|
|
29
29
|
return (
|
|
30
30
|
<View style={stackStyle}>
|
|
31
31
|
<Tabs label="Tabs">
|
|
@@ -43,7 +43,7 @@ const disabledTabs: React.FunctionComponent = () => {
|
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const
|
|
46
|
+
const TabsCountIcon: React.FunctionComponent = () => {
|
|
47
47
|
const svgExample = {
|
|
48
48
|
svgSource: {
|
|
49
49
|
src: TestSvg,
|
|
@@ -70,7 +70,7 @@ const tabsCountIcon: React.FunctionComponent = () => {
|
|
|
70
70
|
);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const
|
|
73
|
+
const TabsClickEventTest: React.FunctionComponent = () => {
|
|
74
74
|
const [selectedKey, setSelectedKey] = React.useState('home_key');
|
|
75
75
|
|
|
76
76
|
const onTabsClick = (key: string) => {
|
|
@@ -95,7 +95,7 @@ const onTabsClickEvent: React.FunctionComponent = () => {
|
|
|
95
95
|
);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const TabsChangingViews: React.FunctionComponent = () => {
|
|
99
99
|
// If user wants to control what gets rendered example.
|
|
100
100
|
const [selectedKey, setSelectedKey] = React.useState('Tabs #1');
|
|
101
101
|
|
|
@@ -117,7 +117,7 @@ const tabsChangingViews: React.FunctionComponent = () => {
|
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
const
|
|
120
|
+
const TabsRenderSeparately: React.FunctionComponent = () => {
|
|
121
121
|
const [selectedKey, setSelectedKey] = React.useState('rectangleRed');
|
|
122
122
|
|
|
123
123
|
const onTabsClick = (key: string) => {
|
|
@@ -149,7 +149,7 @@ const tabsRenderSeparately: React.FunctionComponent = () => {
|
|
|
149
149
|
);
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
const
|
|
152
|
+
const TabsSettingSelectedKey: React.FunctionComponent = () => {
|
|
153
153
|
// If user wants to programmatically set the tab's selectedKey with a button example.
|
|
154
154
|
const [selectedKey, setSelectedKey] = React.useState('home');
|
|
155
155
|
const [currTabItemIndex, setCurrTabItemIndex] = React.useState(0);
|
|
@@ -179,7 +179,7 @@ const tabsSettingSelectedKey: React.FunctionComponent = () => {
|
|
|
179
179
|
);
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
const
|
|
182
|
+
const TabsShowHideItem: React.FunctionComponent = () => {
|
|
183
183
|
const [showFirstItem, setshowFirstItem] = React.useState(true);
|
|
184
184
|
|
|
185
185
|
const toggleShowFirstItem = React.useCallback(() => {
|
|
@@ -208,7 +208,7 @@ const tabsShowHideItem: React.FunctionComponent = () => {
|
|
|
208
208
|
);
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
const
|
|
211
|
+
const TabsWithFlexibility: React.FunctionComponent = () => {
|
|
212
212
|
const [selectedKey, setSelectedKey] = React.useState('home');
|
|
213
213
|
|
|
214
214
|
const goHomeTab = () => {
|
|
@@ -241,35 +241,35 @@ const tabsSections: TestSection[] = [
|
|
|
241
241
|
{
|
|
242
242
|
name: 'Default Tabs',
|
|
243
243
|
testID: TABS_TESTPAGE,
|
|
244
|
-
component:
|
|
244
|
+
component: TabsMainTest,
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: 'Tabs with disabled',
|
|
248
|
-
component:
|
|
248
|
+
component: DisabledTabs,
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
name: 'Trigger onTabsClick event',
|
|
252
|
-
component:
|
|
252
|
+
component: TabsClickEventTest,
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
name: 'User Custom Render',
|
|
256
|
-
component:
|
|
256
|
+
component: TabsChangingViews,
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
name: 'Render Content Separately',
|
|
260
|
-
component:
|
|
260
|
+
component: TabsRenderSeparately,
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
name: 'Override Selected Key',
|
|
264
|
-
component:
|
|
264
|
+
component: TabsSettingSelectedKey,
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
name: 'Show/Hide Tabs item',
|
|
268
|
-
component:
|
|
268
|
+
component: TabsShowHideItem,
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
name: 'More Flexibility',
|
|
272
|
-
component:
|
|
272
|
+
component: TabsWithFlexibility,
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
name: 'E2E Tabs Test',
|
|
@@ -280,7 +280,7 @@ const tabsSections: TestSection[] = [
|
|
|
280
280
|
if (Platform.OS !== 'windows') {
|
|
281
281
|
tabsSections.push({
|
|
282
282
|
name: 'Count and Icon',
|
|
283
|
-
component:
|
|
283
|
+
component: TabsCountIcon,
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
|
|
@@ -10,7 +10,7 @@ import { SvgIconProps } from '@fluentui-react-native/icon';
|
|
|
10
10
|
import TestSvg from './test.svg';
|
|
11
11
|
import { E2ETestExperimentalTabs } from './TabsExperimentalE2ETest';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const TabsMainTest: React.FunctionComponent = () => {
|
|
14
14
|
return (
|
|
15
15
|
<View style={stackStyle}>
|
|
16
16
|
<Tabs label="Tabs">
|
|
@@ -28,7 +28,7 @@ const tabs: React.FunctionComponent = () => {
|
|
|
28
28
|
);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const DisabledTabs: React.FunctionComponent = () => {
|
|
32
32
|
return (
|
|
33
33
|
<View style={stackStyle}>
|
|
34
34
|
<Tabs label="Tabs">
|
|
@@ -46,7 +46,7 @@ const disabledTabs: React.FunctionComponent = () => {
|
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const TabsCountIcon: React.FunctionComponent = () => {
|
|
50
50
|
const svgProps: SvgIconProps = {
|
|
51
51
|
src: TestSvg,
|
|
52
52
|
viewBox: '0 0 500 500',
|
|
@@ -69,7 +69,7 @@ const tabsCountIcon: React.FunctionComponent = () => {
|
|
|
69
69
|
);
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const
|
|
72
|
+
const TabsClickEventTest: React.FunctionComponent = () => {
|
|
73
73
|
const [selectedKey, setSelectedKey] = React.useState('home_key');
|
|
74
74
|
|
|
75
75
|
const onTabsClick = React.useCallback(
|
|
@@ -97,7 +97,7 @@ const onTabsClickEvent: React.FunctionComponent = () => {
|
|
|
97
97
|
);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const TabsChangingViews: React.FunctionComponent = () => {
|
|
101
101
|
// If User wants to control what gets rendered example
|
|
102
102
|
const [selectedKey, setSelectedKey] = React.useState('home');
|
|
103
103
|
|
|
@@ -124,7 +124,7 @@ const tabsChangingViews: React.FunctionComponent = () => {
|
|
|
124
124
|
);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
const
|
|
127
|
+
const TabsRenderSeparately: React.FunctionComponent = () => {
|
|
128
128
|
const [selectedKey, setSelectedKey] = React.useState('rectangleRed');
|
|
129
129
|
|
|
130
130
|
const onTabsClick = React.useCallback(
|
|
@@ -159,7 +159,7 @@ const tabsRenderSeparately: React.FunctionComponent = () => {
|
|
|
159
159
|
);
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
const
|
|
162
|
+
const TabsSettingSelectedKey: React.FunctionComponent = () => {
|
|
163
163
|
// If user wants to programmatically set the selectedKey to control the view
|
|
164
164
|
const [selectedKey, setSelectedKey] = React.useState('home');
|
|
165
165
|
const [currTabItemIndex, setCurrTabItemIndex] = React.useState(0);
|
|
@@ -189,7 +189,7 @@ const tabsSettingSelectedKey: React.FunctionComponent = () => {
|
|
|
189
189
|
);
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
const
|
|
192
|
+
const TabsWithFlexibility: React.FunctionComponent = () => {
|
|
193
193
|
const [selectedKey, setSelectedKey] = React.useState('home');
|
|
194
194
|
|
|
195
195
|
const goHomeTab = React.useCallback(() => {
|
|
@@ -225,31 +225,31 @@ const tabsSections: TestSection[] = [
|
|
|
225
225
|
{
|
|
226
226
|
name: 'Default Tabs',
|
|
227
227
|
testID: EXPERIMENTAL_TABS_TESTPAGE,
|
|
228
|
-
component:
|
|
228
|
+
component: TabsMainTest,
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
name: 'Tabs with disabled',
|
|
232
|
-
component:
|
|
232
|
+
component: DisabledTabs,
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
name: 'Trigger onTabsClick event',
|
|
236
|
-
component:
|
|
236
|
+
component: TabsClickEventTest,
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
name: 'User Custom Render',
|
|
240
|
-
component:
|
|
240
|
+
component: TabsChangingViews,
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
name: 'Render Content Separately',
|
|
244
|
-
component:
|
|
244
|
+
component: TabsRenderSeparately,
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: 'Override Selected Key',
|
|
248
|
-
component:
|
|
248
|
+
component: TabsSettingSelectedKey,
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
name: 'More Flexibility',
|
|
252
|
-
component:
|
|
252
|
+
component: TabsWithFlexibility,
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
name: 'E2E Testing Experimental Tabs',
|
|
@@ -260,7 +260,7 @@ const tabsSections: TestSection[] = [
|
|
|
260
260
|
if (Platform.OS !== 'windows') {
|
|
261
261
|
tabsSections.push({
|
|
262
262
|
name: 'Count and Icon',
|
|
263
|
-
component:
|
|
263
|
+
component: TabsCountIcon,
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
|