@fluentui-react-native/tester 0.58.2 → 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 +114 -3
- package/CHANGELOG.md +26 -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.js +8 -8
- 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.js +8 -8
- 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 +17 -17
- 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 +8 -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
|
@@ -6,7 +6,7 @@ import { Test, TestSection, PlatformStatus } from '../Test';
|
|
|
6
6
|
import { E2ECalloutTest } from './CalloutE2ETest';
|
|
7
7
|
import { fluentTesterStyles } from '../Common/styles';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const StandardCallout: React.FunctionComponent = () => {
|
|
10
10
|
const [showStandardCallout, setShowStandardCallout] = React.useState(false);
|
|
11
11
|
const [isStandardCalloutVisible, setIsStandardCalloutVisible] = React.useState(false);
|
|
12
12
|
|
|
@@ -23,29 +23,35 @@ const standardCallout: React.FunctionComponent = () => {
|
|
|
23
23
|
const [preventDismissOnClickOutside, setPreventDismissOnClickOutside] = React.useState(false);
|
|
24
24
|
const [calloutDismissBehaviors, setDismissBehaviors] = React.useState<DismissBehaviors[]>([]);
|
|
25
25
|
|
|
26
|
-
const onPreventDismissOnKeyDownChange = React.useCallback(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
value
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
26
|
+
const onPreventDismissOnKeyDownChange = React.useCallback(
|
|
27
|
+
(value) => {
|
|
28
|
+
setPreventDismissOnKeyDown(value);
|
|
29
|
+
if (value) {
|
|
30
|
+
setDismissBehaviors(calloutDismissBehaviors.concat('preventDismissOnKeyDown'));
|
|
31
|
+
} else {
|
|
32
|
+
const newDismissBehaviors = calloutDismissBehaviors.filter((value) => {
|
|
33
|
+
value != 'preventDismissOnKeyDown';
|
|
34
|
+
});
|
|
35
|
+
setDismissBehaviors(newDismissBehaviors);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
[calloutDismissBehaviors],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const onPreventDismissOnClickOutsideChange = React.useCallback(
|
|
42
|
+
(value) => {
|
|
43
|
+
setPreventDismissOnClickOutside(value);
|
|
44
|
+
if (value) {
|
|
45
|
+
setDismissBehaviors(calloutDismissBehaviors.concat('preventDismissOnClickOutside'));
|
|
46
|
+
} else {
|
|
47
|
+
const newDismissBehaviors = calloutDismissBehaviors.filter((value) => {
|
|
48
|
+
value != 'preventDismissOnClickOutside';
|
|
49
|
+
});
|
|
50
|
+
setDismissBehaviors(newDismissBehaviors);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
[calloutDismissBehaviors],
|
|
54
|
+
);
|
|
49
55
|
|
|
50
56
|
const redTargetRef = React.useRef<View>(null);
|
|
51
57
|
const blueTargetRef = React.useRef<View>(null);
|
|
@@ -113,7 +119,7 @@ const standardCallout: React.FunctionComponent = () => {
|
|
|
113
119
|
|
|
114
120
|
const addButton = React.useCallback(() => {
|
|
115
121
|
setScrollviewContents((arr) => [...arr, 1]);
|
|
116
|
-
}, [setScrollviewContents
|
|
122
|
+
}, [setScrollviewContents]);
|
|
117
123
|
|
|
118
124
|
return (
|
|
119
125
|
<View>
|
|
@@ -245,7 +251,7 @@ const standardCallout: React.FunctionComponent = () => {
|
|
|
245
251
|
);
|
|
246
252
|
};
|
|
247
253
|
|
|
248
|
-
const
|
|
254
|
+
const CustomCallout: React.FunctionComponent = () => {
|
|
249
255
|
const [showCustomizedCallout, setShowCustomizedCallout] = React.useState(false);
|
|
250
256
|
const [isCustomizedCalloutVisible, setIsCustomizedCalloutVisible] = React.useState(false);
|
|
251
257
|
|
|
@@ -304,11 +310,11 @@ const calloutSections: TestSection[] = [
|
|
|
304
310
|
{
|
|
305
311
|
name: 'Standard Usage',
|
|
306
312
|
testID: CALLOUT_TESTPAGE,
|
|
307
|
-
component:
|
|
313
|
+
component: StandardCallout,
|
|
308
314
|
},
|
|
309
315
|
{
|
|
310
316
|
name: 'Customized Usage',
|
|
311
|
-
component:
|
|
317
|
+
component: CustomCallout,
|
|
312
318
|
},
|
|
313
319
|
{
|
|
314
320
|
name: 'E2E Testing Callout',
|
|
@@ -11,7 +11,7 @@ function onChangeUncontrolled(isChecked: boolean) {
|
|
|
11
11
|
console.log(isChecked);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const BasicCheckbox: React.FunctionComponent = () => {
|
|
15
15
|
return (
|
|
16
16
|
<View>
|
|
17
17
|
<Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
|
|
@@ -29,7 +29,7 @@ const basicCheckbox: React.FunctionComponent = () => {
|
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const OtherCheckbox: React.FunctionComponent = () => {
|
|
33
33
|
const [isCheckedControlled1, setCheckedControlled1] = React.useState(false);
|
|
34
34
|
const onChangeControlled1 = React.useCallback((checked) => {
|
|
35
35
|
setCheckedControlled1(checked);
|
|
@@ -87,7 +87,7 @@ const HoverCheckbox = Checkbox.customize({
|
|
|
87
87
|
},
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
const
|
|
90
|
+
const TokenCheckbox: React.FunctionComponent = () => {
|
|
91
91
|
const [checkboxColor, setCheckboxColor] = React.useState('blue');
|
|
92
92
|
const [checkmarkColor, setCheckmarkColor] = React.useState('white');
|
|
93
93
|
|
|
@@ -148,15 +148,15 @@ const checkboxSections: TestSection[] = [
|
|
|
148
148
|
{
|
|
149
149
|
name: 'Basic Checkboxes',
|
|
150
150
|
testID: CHECKBOX_TESTPAGE,
|
|
151
|
-
component:
|
|
151
|
+
component: BasicCheckbox,
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
name: 'Other Implementations',
|
|
155
|
-
component:
|
|
155
|
+
component: OtherCheckbox,
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
name: 'Token Customized Checkboxes',
|
|
159
|
-
component:
|
|
159
|
+
component: TokenCheckbox,
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
name: 'Checkbox for E2E Testing',
|
|
@@ -12,7 +12,7 @@ function onChangeUncontrolled(_e: InteractionEvent, isChecked: boolean) {
|
|
|
12
12
|
console.log(isChecked);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const BasicCheckbox: React.FunctionComponent = () => {
|
|
16
16
|
return (
|
|
17
17
|
<View>
|
|
18
18
|
<Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
|
|
@@ -28,7 +28,7 @@ const basicCheckbox: React.FunctionComponent = () => {
|
|
|
28
28
|
);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const SizeCheckbox: React.FunctionComponent = () => {
|
|
32
32
|
return (
|
|
33
33
|
<View>
|
|
34
34
|
<Checkbox tooltip="Medium checkbox" size="medium" />
|
|
@@ -39,7 +39,7 @@ const sizeCheckbox: React.FunctionComponent = () => {
|
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const OtherCheckbox: React.FunctionComponent = () => {
|
|
43
43
|
const [isCheckedControlled1, setCheckedControlled1] = React.useState(false);
|
|
44
44
|
const onChangeControlled1 = React.useCallback((checked) => {
|
|
45
45
|
setCheckedControlled1(checked);
|
|
@@ -86,7 +86,7 @@ const HoverCheckbox = Checkbox.customize({
|
|
|
86
86
|
},
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
const
|
|
89
|
+
const TokenCheckbox: React.FunctionComponent = () => {
|
|
90
90
|
const [checkboxColor, setCheckboxColor] = React.useState('blue');
|
|
91
91
|
const [checkmarkColor, setCheckmarkColor] = React.useState('white');
|
|
92
92
|
|
|
@@ -147,19 +147,19 @@ const checkboxSections: TestSection[] = [
|
|
|
147
147
|
{
|
|
148
148
|
name: 'Basic Checkboxes',
|
|
149
149
|
testID: EXPERIMENTAL_CHECKBOX_TESTPAGE,
|
|
150
|
-
component:
|
|
150
|
+
component: BasicCheckbox,
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
name: 'Size Checkboxes',
|
|
154
|
-
component:
|
|
154
|
+
component: SizeCheckbox,
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
name: 'Other Implementations',
|
|
158
|
-
component:
|
|
158
|
+
component: OtherCheckbox,
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
name: 'Token Customized Checkboxes',
|
|
162
|
-
component:
|
|
162
|
+
component: TokenCheckbox,
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
name: 'E2E Testing for Experimental Checkbox',
|
|
@@ -121,7 +121,7 @@ export const Slider: React.FunctionComponent<ISliderProps> = (props: ISliderProp
|
|
|
121
121
|
setThumbLocation(initialThumbLocation);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
}, [ref
|
|
124
|
+
}, [ref, initialValue, maximum, minimum]);
|
|
125
125
|
|
|
126
126
|
return (
|
|
127
127
|
<View style={[userStyle, styles.root]}>
|
|
@@ -16,7 +16,7 @@ import { Test, TestSection, PlatformStatus } from '../Test';
|
|
|
16
16
|
import { svgProps, fontProps, testImage } from '../Common/iconExamples';
|
|
17
17
|
import { E2EContextualMenuTest } from './E2EContextualMenuTest';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const ContextualMenuMainTest: React.FunctionComponent = () => {
|
|
20
20
|
const stdBtnRef = React.useRef(null);
|
|
21
21
|
|
|
22
22
|
const [showContextualMenu, setShowContextualMenu] = React.useState(false);
|
|
@@ -114,7 +114,7 @@ const contextualMenu: React.FunctionComponent = () => {
|
|
|
114
114
|
);
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const NestedContextualMenu: React.FunctionComponent = () => {
|
|
118
118
|
const stdBtnRef = React.useRef(null);
|
|
119
119
|
|
|
120
120
|
const [showContextualMenu, setShowContextualMenu] = React.useState(false);
|
|
@@ -472,11 +472,11 @@ const contextualMenuSections: TestSection[] = [
|
|
|
472
472
|
{
|
|
473
473
|
name: 'Standard ContextualMenu',
|
|
474
474
|
testID: CONTEXTUALMENU_TESTPAGE,
|
|
475
|
-
component:
|
|
475
|
+
component: ContextualMenuMainTest,
|
|
476
476
|
},
|
|
477
477
|
{
|
|
478
478
|
name: 'Nested ContextualMenu',
|
|
479
|
-
component:
|
|
479
|
+
component: NestedContextualMenu,
|
|
480
480
|
},
|
|
481
481
|
{
|
|
482
482
|
name: 'IconButton with Customized ContextualMenu',
|
|
@@ -30,7 +30,7 @@ const CustomizedExpander = Expander.customize({
|
|
|
30
30
|
chevronBorderThickness: 2,
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const ExpanderMainTest: React.FunctionComponent = () => {
|
|
34
34
|
/** This test page has not yet been tested and does not currently build because
|
|
35
35
|
* the react-native-test-app does not yet support WinUI 2.6
|
|
36
36
|
* Filed issue in react-native-test-app: https://github.com/microsoft/react-native-test-app/issues/444
|
|
@@ -87,7 +87,7 @@ const expanderTest: React.FunctionComponent = () => {
|
|
|
87
87
|
);
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
const
|
|
90
|
+
const BasicExpander: React.FunctionComponent = () => {
|
|
91
91
|
return (
|
|
92
92
|
<Stack style={stackStyle}>
|
|
93
93
|
<View style={commonStyles.root}>
|
|
@@ -104,12 +104,12 @@ const expanderSections: TestSection[] = [
|
|
|
104
104
|
{
|
|
105
105
|
name: 'BaseExpander',
|
|
106
106
|
testID: EXPANDER_TESTPAGE,
|
|
107
|
-
component:
|
|
107
|
+
component: BasicExpander,
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
name: 'Expander',
|
|
111
111
|
testID: EXPANDER_TESTPAGE,
|
|
112
|
-
component:
|
|
112
|
+
component: ExpanderMainTest,
|
|
113
113
|
},
|
|
114
114
|
];
|
|
115
115
|
|
|
@@ -52,7 +52,7 @@ export const ComponentTwiddler: React.FunctionComponent<IComponentTwiddlerProps>
|
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const
|
|
55
|
+
const BasicFocusTrapZone: React.FunctionComponent = () => {
|
|
56
56
|
const [state, setState] = React.useState({
|
|
57
57
|
useTrapZone: false,
|
|
58
58
|
renderTrapZone: true,
|
|
@@ -133,7 +133,7 @@ const focusTrapZoneSections: TestSection[] = [
|
|
|
133
133
|
{
|
|
134
134
|
name: 'Basic FocusTrapZone Usage',
|
|
135
135
|
testID: FOCUSTRAPZONE_TESTPAGE,
|
|
136
|
-
component:
|
|
136
|
+
component: BasicFocusTrapZone,
|
|
137
137
|
},
|
|
138
138
|
];
|
|
139
139
|
|
|
@@ -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
|
|