@fluentui-react-native/tester 0.139.0 → 0.141.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +91 -1
- package/CHANGELOG.md +28 -2
- package/assets/dismissIcon.svg +3 -0
- package/assets/filledIcon.svg +3 -0
- package/assets/outlineIcon.svg +3 -0
- package/lib/E2E/src/Input/consts.d.ts +6 -0
- package/lib/E2E/src/Input/consts.d.ts.map +1 -0
- package/lib/E2E/src/Input/consts.js +8 -0
- package/lib/E2E/src/Input/consts.js.map +1 -0
- package/lib/E2E/src/index.consts.d.ts +1 -0
- package/lib/E2E/src/index.consts.d.ts.map +1 -1
- package/lib/E2E/src/index.consts.js +1 -0
- package/lib/E2E/src/index.consts.js.map +1 -1
- package/lib/fluent-tester/src/FluentTester.d.ts.map +1 -1
- package/lib/fluent-tester/src/FluentTester.js +2 -1
- package/lib/fluent-tester/src/FluentTester.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Input/InputDefault.d.ts +7 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputDefault.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputDefault.js +26 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputDefault.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputTest.js +23 -0
- package/lib/fluent-tester/src/TestComponents/Input/InputTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Input/index.d.ts +2 -0
- package/lib/fluent-tester/src/TestComponents/Input/index.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Input/index.js +2 -0
- package/lib/fluent-tester/src/TestComponents/Input/index.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Menu/MenuTest.d.ts.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Menu/MenuTest.js +46 -28
- package/lib/fluent-tester/src/TestComponents/Menu/MenuTest.js.map +1 -1
- package/lib/fluent-tester/src/testPages.d.ts.map +1 -1
- package/lib/fluent-tester/src/testPages.js +8 -1
- package/lib/fluent-tester/src/testPages.js.map +1 -1
- package/lib-commonjs/E2E/src/Input/consts.d.ts +6 -0
- package/lib-commonjs/E2E/src/Input/consts.d.ts.map +1 -0
- package/lib-commonjs/E2E/src/Input/consts.js +11 -0
- package/lib-commonjs/E2E/src/Input/consts.js.map +1 -0
- package/lib-commonjs/E2E/src/index.consts.d.ts +1 -0
- package/lib-commonjs/E2E/src/index.consts.d.ts.map +1 -1
- package/lib-commonjs/E2E/src/index.consts.js +1 -0
- package/lib-commonjs/E2E/src/index.consts.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/FluentTester.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/FluentTester.js +2 -1
- package/lib-commonjs/fluent-tester/src/FluentTester.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputDefault.d.ts +7 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputDefault.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputDefault.js +31 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputDefault.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputTest.js +28 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/InputTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/index.d.ts +2 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/index.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/index.js +5 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Input/index.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Menu/MenuTest.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Menu/MenuTest.js +45 -27
- package/lib-commonjs/fluent-tester/src/TestComponents/Menu/MenuTest.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/testPages.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/testPages.js +8 -1
- package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
- package/package.json +10 -9
- package/src/FluentTester.tsx +1 -0
- package/src/TestComponents/Input/InputDefault.tsx +44 -0
- package/src/TestComponents/Input/InputTest.tsx +28 -0
- package/src/TestComponents/Input/index.ts +1 -0
- package/src/TestComponents/Menu/MenuTest.tsx +50 -28
- package/src/testPages.ts +8 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@fluentui-react-native/icon';
|
|
5
|
+
import { Input } from '@fluentui-react-native/input';
|
|
6
|
+
|
|
7
|
+
import DismissSvg from '../../../assets/dismissIcon.svg';
|
|
8
|
+
import FilledSvg from '../../../assets/filledIcon.svg';
|
|
9
|
+
import OutlineSvg from '../../../assets/outlineIcon.svg';
|
|
10
|
+
|
|
11
|
+
export const dismissIconProps: IconProps = { svgSource: { src: DismissSvg, viewBox: '0 0 20 20' } };
|
|
12
|
+
export const outlineIconProps: IconProps = { svgSource: { src: OutlineSvg, viewBox: '0 0 20 20' } };
|
|
13
|
+
export const filledIconProps: IconProps = { svgSource: { src: FilledSvg, viewBox: '0 0 20 20' } };
|
|
14
|
+
|
|
15
|
+
export const InputDefault: React.FunctionComponent = () => {
|
|
16
|
+
const [error, setError] = React.useState<string>('');
|
|
17
|
+
const [controlText, setControlText] = React.useState<string>('Controls other text input!');
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<View>
|
|
21
|
+
<Input onChange={(text) => setControlText(text)} defaultValue={controlText} />
|
|
22
|
+
<Input value={'Controlled text - ' + controlText} />
|
|
23
|
+
<Input placeholder="Enter text here!" type="decimal-pad" accessoryIcon={null} />
|
|
24
|
+
<Input placeholder="Custom dismiss icon" accessoryIcon={outlineIconProps} secondaryText="Secondary" type="email-address" />
|
|
25
|
+
<Input
|
|
26
|
+
placeholder="Enter text here!"
|
|
27
|
+
accessoryIcon={dismissIconProps}
|
|
28
|
+
label="Label"
|
|
29
|
+
assistiveText="Assistive Text"
|
|
30
|
+
secondaryText="Secondary"
|
|
31
|
+
/>
|
|
32
|
+
<Input
|
|
33
|
+
error={error}
|
|
34
|
+
icon={outlineIconProps}
|
|
35
|
+
placeholder="Only text up to 5 characters!"
|
|
36
|
+
label="Label"
|
|
37
|
+
onChange={(text) => {
|
|
38
|
+
if (text.length > 5) setError('Text must be less than 5 characters!');
|
|
39
|
+
else setError('');
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { InputDefault } from './InputDefault';
|
|
4
|
+
import { INPUT_TESTPAGE } from '../../../../E2E/src/Input/consts';
|
|
5
|
+
import type { TestSection, PlatformStatus } from '../Test';
|
|
6
|
+
import { Test } from '../Test';
|
|
7
|
+
|
|
8
|
+
const inputSections: TestSection[] = [
|
|
9
|
+
{
|
|
10
|
+
name: 'Input Page',
|
|
11
|
+
testID: INPUT_TESTPAGE,
|
|
12
|
+
component: InputDefault,
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export const InputTest: React.FunctionComponent = () => {
|
|
17
|
+
const status: PlatformStatus = {
|
|
18
|
+
win32Status: 'Backlog',
|
|
19
|
+
uwpStatus: 'Backlog',
|
|
20
|
+
iosStatus: 'Backlog',
|
|
21
|
+
macosStatus: 'Backlog',
|
|
22
|
+
androidStatus: 'Experimental',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const description = 'Input allows the user to enter and edit text.';
|
|
26
|
+
|
|
27
|
+
return <Test name="Input Test" description={description} sections={inputSections} status={status}></Test>;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InputTest';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { ButtonV1 as Button } from '@fluentui/react-native';
|
|
5
5
|
import type { MenuProps } from '@fluentui-react-native/menu';
|
|
@@ -86,8 +86,8 @@ const MenuCheckmarks: React.FunctionComponent = () => {
|
|
|
86
86
|
<MenuPopover>
|
|
87
87
|
<MenuList>
|
|
88
88
|
<MenuItem>A plain MenuItem</MenuItem>
|
|
89
|
-
<MenuItemCheckbox name="itemTwo">A MenuItem with checkmark</MenuItemCheckbox>
|
|
90
|
-
<MenuItemCheckbox name="itemThree">A MenuItem with checkmark</MenuItemCheckbox>
|
|
89
|
+
<MenuItemCheckbox name="itemTwo">A MenuItem with checkmark without alignment</MenuItemCheckbox>
|
|
90
|
+
<MenuItemCheckbox name="itemThree">A MenuItem with checkmark without alignment</MenuItemCheckbox>
|
|
91
91
|
</MenuList>
|
|
92
92
|
</MenuPopover>
|
|
93
93
|
</Menu>
|
|
@@ -181,17 +181,24 @@ const rootStackStyle = StyleSheet.create({ root: { ...(stackStyle as object), fl
|
|
|
181
181
|
|
|
182
182
|
const MenuControlledOpen: React.FunctionComponent = () => {
|
|
183
183
|
const [open, setOpen] = React.useState<boolean>(false);
|
|
184
|
+
|
|
185
|
+
const onOpenChange = () => {
|
|
186
|
+
setOpen(false);
|
|
187
|
+
};
|
|
188
|
+
|
|
184
189
|
return (
|
|
185
190
|
<Stack style={rootStackStyle.root}>
|
|
186
191
|
<Button onClick={() => setOpen(!open)}>Toggle open</Button>
|
|
187
|
-
|
|
192
|
+
{/* For Android Platform the Controlled trigger becomes unavailable because of the screen we show on the screen click on which closes the Menu , Hence we need to make the state change based on open change */}
|
|
193
|
+
|
|
194
|
+
<Menu {...(Platform.OS === 'android' && { onOpenChange })} open={open}>
|
|
188
195
|
<MenuTrigger>
|
|
189
196
|
<Button>Test</Button>
|
|
190
197
|
</MenuTrigger>
|
|
191
198
|
<MenuPopover>
|
|
192
199
|
<MenuList>
|
|
193
200
|
<MenuItem>A MenuItem</MenuItem>
|
|
194
|
-
<Submenu />
|
|
201
|
+
{Platform.OS !== 'android' && <Submenu />}
|
|
195
202
|
</MenuList>
|
|
196
203
|
</MenuPopover>
|
|
197
204
|
</Menu>
|
|
@@ -263,7 +270,7 @@ const MenuNofM: React.FunctionComponent = () => {
|
|
|
263
270
|
<MenuItem disabled>A disabled MenuItem</MenuItem>
|
|
264
271
|
<MenuItem accessibilityPositionInSet={9}>A plain MenuItem</MenuItem>
|
|
265
272
|
<MenuDivider />
|
|
266
|
-
<Submenu accessibilityPositionInSet={16} accessibilitySetSize={7} />
|
|
273
|
+
{Platform.OS !== 'android' && <Submenu accessibilityPositionInSet={16} accessibilitySetSize={7} />}
|
|
267
274
|
<MenuItem disabled accessibilitySetSize={2}>
|
|
268
275
|
A disabled MenuItem
|
|
269
276
|
</MenuItem>
|
|
@@ -296,7 +303,7 @@ const MenuWithCustomMenuTrigger: React.FunctionComponent = () => {
|
|
|
296
303
|
<MenuItem disabled>A disabled MenuItem</MenuItem>
|
|
297
304
|
<MenuItem accessibilityPositionInSet={9}>A plain MenuItem</MenuItem>
|
|
298
305
|
<MenuDivider />
|
|
299
|
-
<Submenu accessibilityPositionInSet={16} accessibilitySetSize={7} />
|
|
306
|
+
{Platform.OS !== 'android' && <Submenu accessibilityPositionInSet={16} accessibilitySetSize={7} />}
|
|
300
307
|
<MenuItem disabled accessibilitySetSize={2}>
|
|
301
308
|
A disabled MenuItem
|
|
302
309
|
</MenuItem>
|
|
@@ -322,26 +329,35 @@ const menuSections: TestSection[] = [
|
|
|
322
329
|
name: 'Menu Radioitem',
|
|
323
330
|
component: MenuRadioItem,
|
|
324
331
|
},
|
|
325
|
-
{
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
332
|
+
Platform.select({
|
|
333
|
+
android: null,
|
|
334
|
+
default: {
|
|
335
|
+
name: 'Menu open on hover',
|
|
336
|
+
component: MenuOpenOnHover,
|
|
337
|
+
},
|
|
338
|
+
}),
|
|
329
339
|
{
|
|
330
340
|
name: 'Menu open controlled',
|
|
331
341
|
component: MenuControlledOpen,
|
|
332
342
|
},
|
|
333
|
-
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
343
|
+
Platform.select({
|
|
344
|
+
android: null,
|
|
345
|
+
default: {
|
|
346
|
+
name: 'Menu with tooltips on items',
|
|
347
|
+
component: MenuTooltips,
|
|
348
|
+
},
|
|
349
|
+
}),
|
|
337
350
|
{
|
|
338
351
|
name: 'Menu with icons',
|
|
339
352
|
component: MenuIcons,
|
|
340
353
|
},
|
|
341
|
-
{
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
354
|
+
Platform.select({
|
|
355
|
+
android: null,
|
|
356
|
+
default: {
|
|
357
|
+
name: 'Menu Submenu',
|
|
358
|
+
component: MenuSubMenu,
|
|
359
|
+
},
|
|
360
|
+
}),
|
|
345
361
|
{
|
|
346
362
|
name: 'Menu with ScrollView',
|
|
347
363
|
component: MenuScrollView,
|
|
@@ -350,18 +366,24 @@ const menuSections: TestSection[] = [
|
|
|
350
366
|
name: 'Menu Trigger onClick Override',
|
|
351
367
|
component: MenuTriggerOnClickCallback,
|
|
352
368
|
},
|
|
353
|
-
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
369
|
+
Platform.select({
|
|
370
|
+
android: null,
|
|
371
|
+
default: {
|
|
372
|
+
name: 'Menu Trigger Hover Override',
|
|
373
|
+
component: MenuTriggerHoverCallback,
|
|
374
|
+
},
|
|
375
|
+
}),
|
|
357
376
|
{
|
|
358
377
|
name: 'Menu Customized',
|
|
359
378
|
component: MenuCustomized,
|
|
360
379
|
},
|
|
361
|
-
{
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
380
|
+
Platform.select({
|
|
381
|
+
android: null,
|
|
382
|
+
default: {
|
|
383
|
+
name: 'Menu Refs',
|
|
384
|
+
component: MenuTriggerChildRef,
|
|
385
|
+
},
|
|
386
|
+
}),
|
|
365
387
|
{
|
|
366
388
|
name: 'Menu N of M Override',
|
|
367
389
|
component: MenuNofM,
|
|
@@ -385,7 +407,7 @@ export const MenuTest: React.FunctionComponent = () => {
|
|
|
385
407
|
uwpStatus: 'Backlog',
|
|
386
408
|
iosStatus: 'Backlog',
|
|
387
409
|
macosStatus: 'Beta',
|
|
388
|
-
androidStatus: '
|
|
410
|
+
androidStatus: 'Experimental',
|
|
389
411
|
};
|
|
390
412
|
|
|
391
413
|
const description =
|
package/src/testPages.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { DropdownTest, HOMEPAGE_DROPDOWN_BUTTON } from './TestComponents/Dropdow
|
|
|
16
16
|
import { FocusTrapTest } from './TestComponents/FocusTrapZone';
|
|
17
17
|
import { FocusZoneTest } from './TestComponents/FocusZone';
|
|
18
18
|
import { IconTest } from './TestComponents/Icon';
|
|
19
|
+
import { InputTest } from './TestComponents/Input';
|
|
19
20
|
import { LinkLegacyTest } from './TestComponents/LinkLegacy';
|
|
20
21
|
import { LinkV1Test } from './TestComponents/LinkV1';
|
|
21
22
|
import { MenuTest } from './TestComponents/Menu';
|
|
@@ -159,6 +160,12 @@ export const tests: TestDescription[] = [
|
|
|
159
160
|
testPageButton: Constants.HOMEPAGE_ICON_BUTTON,
|
|
160
161
|
platforms: ['android', 'ios', 'macos', 'win32'],
|
|
161
162
|
},
|
|
163
|
+
{
|
|
164
|
+
name: 'Input',
|
|
165
|
+
component: InputTest,
|
|
166
|
+
testPageButton: Constants.HOMEPAGE_INPUT_BUTTON,
|
|
167
|
+
platforms: ['android'],
|
|
168
|
+
},
|
|
162
169
|
{
|
|
163
170
|
name: 'Link Legacy',
|
|
164
171
|
component: LinkLegacyTest,
|
|
@@ -175,7 +182,7 @@ export const tests: TestDescription[] = [
|
|
|
175
182
|
name: 'Menu',
|
|
176
183
|
component: MenuTest,
|
|
177
184
|
testPageButton: Constants.HOMEPAGE_MENU_BUTTON,
|
|
178
|
-
platforms: ['macos', 'win32'],
|
|
185
|
+
platforms: ['macos', 'win32', 'android'],
|
|
179
186
|
},
|
|
180
187
|
{
|
|
181
188
|
name: 'MenuButton Legacy',
|