@fluentui-react-native/focus-zone 0.21.14 → 0.22.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/lib/FocusZone.d.ts +5 -2
  3. package/lib/FocusZone.js +28 -30
  4. package/lib/FocusZone.js.map +1 -1
  5. package/lib/FocusZone.types.d.ts +74 -70
  6. package/lib/FocusZone.types.js +1 -1
  7. package/lib/FocusZoneNativeComponent.d.ts +10 -10
  8. package/lib/FocusZoneNativeComponent.d.ts.map +1 -1
  9. package/lib/FocusZoneNativeComponent.js +3 -3
  10. package/lib/FocusZoneNativeComponent.js.map +1 -1
  11. package/lib/__tests__/FocusZone.test.d.ts +1 -1
  12. package/lib/__tests__/FocusZone.test.js +134 -75
  13. package/lib/__tests__/FocusZone.test.js.map +1 -1
  14. package/lib/index.d.ts +13 -2
  15. package/lib/index.js +1 -1
  16. package/lib-commonjs/FocusZone.d.ts +5 -2
  17. package/lib-commonjs/FocusZone.js +91 -64
  18. package/lib-commonjs/FocusZone.js.map +1 -1
  19. package/lib-commonjs/FocusZone.types.d.ts +74 -70
  20. package/lib-commonjs/FocusZone.types.js +3 -3
  21. package/lib-commonjs/FocusZoneNativeComponent.d.ts +10 -10
  22. package/lib-commonjs/FocusZoneNativeComponent.d.ts.map +1 -1
  23. package/lib-commonjs/FocusZoneNativeComponent.js +5 -8
  24. package/lib-commonjs/FocusZoneNativeComponent.js.map +1 -1
  25. package/lib-commonjs/__tests__/FocusZone.test.d.ts +1 -1
  26. package/lib-commonjs/__tests__/FocusZone.test.js +194 -103
  27. package/lib-commonjs/__tests__/FocusZone.test.js.map +1 -1
  28. package/lib-commonjs/index.d.ts +13 -2
  29. package/lib-commonjs/index.js +17 -7
  30. package/lib-commonjs/index.js.map +1 -1
  31. package/package.json +62 -62
  32. package/src/FocusZoneNativeComponent.ts +3 -3
  33. package/src/__tests__/FocusZone.test.tsx +60 -48
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Change Log - @fluentui-react-native/focus-zone
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d7adbdd: # Migration from Beachball to Changesets
8
+
9
+ This changeset represents the migration from Beachball to Changesets for version management and consolidates all changes from 440+ beachball change files that were in the `change/` directory.
10
+
11
+ All 75 affected packages receive a minor version bump to acknowledge the accumulated changes from the beachball era.
12
+
13
+ ## What Changed
14
+
15
+ Going forward, all version management uses Changesets via `yarn changeset`. The following beachball infrastructure has been removed:
16
+
17
+ - ❌ 440+ beachball change files from `change/` directory
18
+ - ❌ `beachball` package dependency
19
+ - ❌ Beachball scripts from `package.json`
20
+ - ❌ `beachball.config.js` configuration file
21
+ - ❌ Beachball publish steps from Azure Pipelines
22
+
23
+ ## New Workflow
24
+
25
+ ✅ **Create changes**: Run `yarn changeset` to document changes
26
+ ✅ **Version bump PRs**: Automatically created by GitHub Actions
27
+ ✅ **Publishing**: Handled by Azure Pipelines using `changeset publish`
28
+ ✅ **Validation**: CI validates changesets and blocks major version bumps
29
+
30
+ For details, see `CHANGESETS_SETUP.md` and `CONTRIBUTING.md`.
31
+
32
+ ### Patch Changes
33
+
34
+ - d1d8c26: We were pinning @types/react and react-native-macos via resolutions. This fixes that which uncovered a bunch of type inconsistencies that needed to be addressed.
35
+ - Updated dependencies [d7adbdd]
36
+ - Updated dependencies [d1d8c26]
37
+ - Updated dependencies [d1d8c26]
38
+ - @fluentui-react-native/adapters@0.14.0
39
+ - @fluentui-react-native/interactive-hooks@0.28.0
40
+ - @uifabricshared/foundation-composable@0.14.0
41
+ - @uifabricshared/foundation-settings@0.16.0
42
+
3
43
  <!-- This log was last generated on Tue, 05 Aug 2025 18:50:43 GMT and should not be manually modified. -->
4
44
 
5
45
  <!-- Start content -->
@@ -1456,7 +1496,7 @@ Thu, 16 Dec 2021 19:10:27 GMT
1456
1496
 
1457
1497
  ### Patches
1458
1498
 
1459
- - Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
1499
+ - Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
1460
1500
  - Bump @fluentui-react-native/interactive-hooks to v0.11.1
1461
1501
 
1462
1502
  ## 0.8.0
@@ -5,5 +5,8 @@
5
5
  */
6
6
  import * as React from 'react';
7
7
  import type { FocusZoneProps, FocusZoneSlotProps } from './FocusZone.types';
8
- export declare const FocusZone: import("@uifabricshared/foundation-composable").IWithComposable<React.FunctionComponent<FocusZoneProps>, import("@uifabricshared/foundation-composable").IComposable<FocusZoneProps, FocusZoneSlotProps, {}>>;
9
- //# sourceMappingURL=FocusZone.d.ts.map
8
+ export declare const FocusZone: import('@uifabricshared/foundation-composable').IWithComposable<
9
+ React.FunctionComponent<FocusZoneProps>,
10
+ import('@uifabricshared/foundation-composable').IComposable<FocusZoneProps, FocusZoneSlotProps, {}>
11
+ >;
12
+ //# sourceMappingURL=FocusZone.d.ts.map
package/lib/FocusZone.js CHANGED
@@ -11,34 +11,32 @@ import { mergeSettings } from '@uifabricshared/foundation-settings';
11
11
  import RCTFocusZone from './FocusZoneNativeComponent';
12
12
  const filterOutComponentRef = (propName) => propName !== 'componentRef';
13
13
  export const FocusZone = composable({
14
- usePrepareProps: (userProps, useStyling) => {
15
- const { componentRef, defaultTabbableElement, isCircularNavigation, ...rest } = userProps;
16
- const ftzRef = useViewCommandFocus(componentRef);
17
- const [targetFirstFocus, setTargetFirstFocus] = React.useState(undefined);
18
- React.useLayoutEffect(() => {
19
- if (typeof defaultTabbableElement === 'string') {
20
- setTargetFirstFocus(defaultTabbableElement);
21
- }
22
- else if (defaultTabbableElement?.current) {
23
- setTargetFirstFocus(findNodeHandle(defaultTabbableElement.current));
24
- }
25
- else {
26
- setTargetFirstFocus(undefined);
27
- }
28
- }, [defaultTabbableElement]);
29
- return {
30
- slotProps: mergeSettings(useStyling(userProps), {
31
- root: {
32
- navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds',
33
- ...rest,
34
- defaultTabbableElement: targetFirstFocus,
35
- ref: ftzRef,
36
- },
37
- }),
38
- };
39
- },
40
- slots: {
41
- root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
42
- },
14
+ usePrepareProps: (userProps, useStyling) => {
15
+ const { componentRef, defaultTabbableElement, isCircularNavigation, ...rest } = userProps;
16
+ const ftzRef = useViewCommandFocus(componentRef);
17
+ const [targetFirstFocus, setTargetFirstFocus] = React.useState(undefined);
18
+ React.useLayoutEffect(() => {
19
+ if (typeof defaultTabbableElement === 'string') {
20
+ setTargetFirstFocus(defaultTabbableElement);
21
+ } else if (defaultTabbableElement?.current) {
22
+ setTargetFirstFocus(findNodeHandle(defaultTabbableElement.current));
23
+ } else {
24
+ setTargetFirstFocus(undefined);
25
+ }
26
+ }, [defaultTabbableElement]);
27
+ return {
28
+ slotProps: mergeSettings(useStyling(userProps), {
29
+ root: {
30
+ navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', // let rest override
31
+ ...rest,
32
+ defaultTabbableElement: targetFirstFocus,
33
+ ref: ftzRef,
34
+ },
35
+ }),
36
+ };
37
+ },
38
+ slots: {
39
+ root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
40
+ },
43
41
  });
44
- //# sourceMappingURL=FocusZone.js.map
42
+ //# sourceMappingURL=FocusZone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusZone.js","sourceRoot":"","sources":["../src/FocusZone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD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B,UAAU,CAAC,SAAS,CAAC,EAAE;gBAClE,IAAI,EAAE;oBACJ,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,oBAAoB,EAAE,oBAAoB;oBACjG,GAAG,IAAI;oBACP,sBAAsB,EAAE,gBAAgB;oBACxC,GAAG,EAAE,MAAM;iBACZ;aACF,CAAC;SACH,CAAC;IAAA,CACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,qBAAqB,EAAE;KAChE;CACF,CAAC,CAAC"}
@@ -2,91 +2,95 @@ import type * as React from 'react';
2
2
  import type { IViewProps } from '@fluentui-react-native/adapters';
3
3
  import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
4
4
  import type { IRenderData } from '@uifabricshared/foundation-composable';
5
- export declare const focusZoneName = "FocusZone";
5
+ export declare const focusZoneName = 'FocusZone';
6
6
  type EmptyInterface = {};
7
7
  export type FocusZoneState = EmptyInterface;
8
8
  export type FocusZoneProps = IViewProps & {
9
- /**
10
- * A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
11
- */
12
- componentRef?: React.RefObject<IFocusable>;
13
- /**
14
- * Optionally defines the initial tabbable element inside the FocusZone
15
- */
16
- defaultTabbableElement?: React.RefObject<React.Component> | string;
17
- /**
18
- ** Defines which arrows to react to
19
- */
20
- focusZoneDirection?: FocusZoneDirection;
21
- /**
22
- ** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
23
- */
24
- disabled?: boolean;
25
- isCircularNavigation?: boolean;
26
- /**
9
+ /**
10
+ * A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
11
+ */
12
+ componentRef?: React.RefObject<IFocusable>;
13
+ /**
14
+ * Optionally defines the initial tabbable element inside the FocusZone
15
+ */
16
+ defaultTabbableElement?: React.RefObject<React.Component> | string;
17
+ /**
18
+ ** Defines which arrows to react to
19
+ */
20
+ focusZoneDirection?: FocusZoneDirection;
21
+ /**
22
+ ** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
23
+ */
24
+ disabled?: boolean;
25
+ isCircularNavigation?: boolean;
26
+ /**
27
27
  *Allows for 2D navigation. This navigation strategy takes into account the position of elements
28
28
  on screen, and navigates in the direction the user selects to the nearest element.
29
29
  */
30
- use2DNavigation?: boolean;
31
- /**
32
- * By default, pressing Tab within a FocusZone moves focus out of the FocusZone.
33
- * This prop allows you to change that behavior.
34
- *
35
- * "None" : Default
36
- * "NavigateWrap" : Tab allowed within FZ with circular navigation behavior
37
- * "NavigateStopAtEnds" : Tab allowed within FZ and stops at ends
38
- * "Normal" : Tab allowed within FZ, and focus is not trapped. Tabbing at the last element bring you out of the FZ.
39
- *
40
- * Recommended Usage - Moving focus OUT of the FocusZone - Custom Key Handlers
41
- * Example: Subscribe to key events. On the pressing of "Escape", move focus out of the FocusZone.
42
- *
43
- * Recommended Usage - Moving focus INTO the FocusZone
44
- * Let's take a CardList, for example. If a user is navigating through elements of the List, we don't want
45
- * focus to land within the FocusZone on initial focus. If it does, it will trap focus within the FocusZone and
46
- * ruin the user's workflow.
47
- * Instead, once focus lands on the parent of the FocusZone, implement a custom key handler that will enable
48
- * the FocusZone.
49
- */
50
- tabKeyNavigation?: FocusZoneTabNavigation;
51
- /**
52
- * Callback called when “focus” event triggered in FocusZone
53
- */
54
- onFocus?: (e?: any) => void;
55
- /**
56
- * @platform macos
57
- * By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
58
- * custom element overrides of navigation order, and positions in layout.
59
- *
60
- * Normally this produces the appropriate accessible experience for users, but occasionally we may need to
61
- * clarify the intended order of navigation. The navigationOrderInRenderOrder prop will have the FocusZone
62
- * establish the navigation order of its children according to their order in the UI tree
63
- * (i.e. as returned by accessibilityChildren).
64
- *
65
- * Note that to participate in the KeyView loop calculation, the FocusZone itself must be part of the
66
- * accessibility tree (i.e. 'accessible') with an appropriate role, e.g. 'group'.
67
- *
68
- * Extra note: This property is unlikely to perform well if changed from its initial value due to finer details
69
- * of the MacOS KeyView loop mechanics.
70
- */
71
- navigationOrderInRenderOrder?: boolean;
30
+ use2DNavigation?: boolean;
31
+ /**
32
+ * By default, pressing Tab within a FocusZone moves focus out of the FocusZone.
33
+ * This prop allows you to change that behavior.
34
+ *
35
+ * "None" : Default
36
+ * "NavigateWrap" : Tab allowed within FZ with circular navigation behavior
37
+ * "NavigateStopAtEnds" : Tab allowed within FZ and stops at ends
38
+ * "Normal" : Tab allowed within FZ, and focus is not trapped. Tabbing at the last element bring you out of the FZ.
39
+ *
40
+ * Recommended Usage - Moving focus OUT of the FocusZone - Custom Key Handlers
41
+ * Example: Subscribe to key events. On the pressing of "Escape", move focus out of the FocusZone.
42
+ *
43
+ * Recommended Usage - Moving focus INTO the FocusZone
44
+ * Let's take a CardList, for example. If a user is navigating through elements of the List, we don't want
45
+ * focus to land within the FocusZone on initial focus. If it does, it will trap focus within the FocusZone and
46
+ * ruin the user's workflow.
47
+ * Instead, once focus lands on the parent of the FocusZone, implement a custom key handler that will enable
48
+ * the FocusZone.
49
+ */
50
+ tabKeyNavigation?: FocusZoneTabNavigation;
51
+ /**
52
+ * Callback called when “focus” event triggered in FocusZone
53
+ */
54
+ onFocus?: (e?: any) => void;
55
+ /**
56
+ * @platform macos
57
+ * By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
58
+ * custom element overrides of navigation order, and positions in layout.
59
+ *
60
+ * Normally this produces the appropriate accessible experience for users, but occasionally we may need to
61
+ * clarify the intended order of navigation. The navigationOrderInRenderOrder prop will have the FocusZone
62
+ * establish the navigation order of its children according to their order in the UI tree
63
+ * (i.e. as returned by accessibilityChildren).
64
+ *
65
+ * Note that to participate in the KeyView loop calculation, the FocusZone itself must be part of the
66
+ * accessibility tree (i.e. 'accessible') with an appropriate role, e.g. 'group'.
67
+ *
68
+ * Extra note: This property is unlikely to perform well if changed from its initial value due to finer details
69
+ * of the MacOS KeyView loop mechanics.
70
+ */
71
+ navigationOrderInRenderOrder?: boolean;
72
72
  };
73
73
  export interface NativeProps extends Omit<FocusZoneProps, 'isCircularNavigation'> {
74
- navigateAtEnd?: NavigateAtEnd;
75
- tabKeyNavigation?: FocusZoneTabNavigation;
74
+ navigateAtEnd?: NavigateAtEnd;
75
+ tabKeyNavigation?: FocusZoneTabNavigation;
76
76
  }
77
- export type FocusZoneDirection = 'bidirectional' /** React to all arrows. */ | 'vertical' /** Only react to up/down arrows. */ | 'horizontal' /** Only react to left/right arrows. */ | 'none'; /** Doesn't respond to any arrow keys. */
77
+ export type FocusZoneDirection =
78
+ | 'bidirectional' /** React to all arrows. */
79
+ | 'vertical' /** Only react to up/down arrows. */
80
+ | 'horizontal' /** Only react to left/right arrows. */
81
+ | 'none'; /** Doesn't respond to any arrow keys. */
78
82
  export type NavigateAtEnd = 'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue';
79
83
  export type FocusZoneTabNavigation = 'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal';
80
84
  export type FocusZoneTokens = EmptyInterface;
81
85
  export interface FocusZoneSlotProps {
82
- root: NativeProps;
86
+ root: NativeProps;
83
87
  }
84
88
  export type FocusZoneRenderData = IRenderData<FocusZoneSlotProps, FocusZoneState>;
85
89
  export interface FocusZoneType {
86
- props: FocusZoneProps;
87
- tokens: FocusZoneTokens;
88
- slotProps: FocusZoneSlotProps;
89
- state: FocusZoneState;
90
+ props: FocusZoneProps;
91
+ tokens: FocusZoneTokens;
92
+ slotProps: FocusZoneSlotProps;
93
+ state: FocusZoneState;
90
94
  }
91
95
  export {};
92
- //# sourceMappingURL=FocusZone.types.d.ts.map
96
+ //# sourceMappingURL=FocusZone.types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export const focusZoneName = 'FocusZone';
2
- //# sourceMappingURL=FocusZone.types.js.map
2
+ //# sourceMappingURL=FocusZone.types.js.map
@@ -3,18 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import type { HostComponent, ViewProps } from 'react-native';
6
+ import type { ViewProps } from 'react-native';
7
7
  import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
8
8
  import type { UnsafeMixed } from './codegenTypes';
9
9
  export interface NativeProps extends ViewProps {
10
- navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
11
- defaultTabbableElement?: UnsafeMixed;
12
- focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
13
- use2DNavigation?: boolean;
14
- tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
15
- disabled?: boolean;
16
- isTabNavigation?: boolean;
10
+ navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
11
+ defaultTabbableElement?: UnsafeMixed;
12
+ focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
13
+ use2DNavigation?: boolean;
14
+ tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
15
+ disabled?: boolean;
16
+ isTabNavigation?: boolean;
17
17
  }
18
- declare const _default: HostComponent<NativeProps>;
18
+ declare const _default: import('react-native').HostComponent<NativeProps>;
19
19
  export default _default;
20
- //# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
20
+ //# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,KAAK,EAAE,WAAW,E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AE,MAAM,CAAC,CAAC;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;;AAED,wBAAmE"}
@@ -3,6 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
- export default codegenNativeComponent('RCTFocusZone');
8
- //# sourceMappingURL=FocusZoneNativeComponent.js.map
6
+ import { requireNativeComponent } from 'react-native';
7
+ export default requireNativeComponent('RCTFocusZone');
8
+ //# sourceMappingURL=FocusZoneNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAgB7F,eAAe,sBAAsB,CAAc,cAAc,CAA+B,CAAC"}
1
+ {"version":3,"file":"FocusZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAgBtD,eAAe,sBAAsB,CAAc,cAAc,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusZone.test.d.ts.map
@@ -1,94 +1,153 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime';
2
+ import { act } from 'react';
2
3
  import { Button } from 'react-native';
3
4
  import * as renderer from 'react-test-renderer';
4
5
  import { FocusZone } from '..';
5
6
  const onPress = () => {
6
- return;
7
+ return;
7
8
  };
8
9
  describe('FocusZone No Props', () => {
9
- it('No children', () => {
10
- const tree = renderer.create(React.createElement(FocusZone, null)).toJSON();
11
- expect(tree).toMatchSnapshot();
10
+ it('No children', () => {
11
+ let component;
12
+ act(() => {
13
+ component = renderer.create(_jsx(FocusZone, {}));
12
14
  });
13
- it('One child', () => {
14
- const tree = renderer
15
- .create(React.createElement(FocusZone, null,
16
- React.createElement(Button, { title: "button", onPress: onPress })))
17
- .toJSON();
18
- expect(tree).toMatchSnapshot();
15
+ expect(component.toJSON()).toMatchSnapshot();
16
+ });
17
+ it('One child', () => {
18
+ let component;
19
+ act(() => {
20
+ component = renderer.create(_jsx(FocusZone, { children: _jsx(Button, { title: 'button', onPress: onPress }) }));
19
21
  });
20
- it('Two children', () => {
21
- const tree = renderer
22
- .create(React.createElement(FocusZone, null,
23
- React.createElement(Button, { title: "button", onPress: onPress }),
24
- React.createElement(Button, { title: "button", onPress: onPress })))
25
- .toJSON();
26
- expect(tree).toMatchSnapshot();
22
+ expect(component.toJSON()).toMatchSnapshot();
23
+ });
24
+ it('Two children', () => {
25
+ let component;
26
+ act(() => {
27
+ component = renderer.create(
28
+ _jsxs(FocusZone, {
29
+ children: [_jsx(Button, { title: 'button', onPress: onPress }), _jsx(Button, { title: 'button', onPress: onPress })],
30
+ }),
31
+ );
27
32
  });
28
- it('Three children', () => {
29
- const tree = renderer
30
- .create(React.createElement(FocusZone, null,
31
- React.createElement(Button, { title: "button", onPress: onPress }),
32
- React.createElement(Button, { title: "button", onPress: onPress }),
33
- React.createElement(Button, { title: "button", onPress: onPress })))
34
- .toJSON();
35
- expect(tree).toMatchSnapshot();
33
+ expect(component.toJSON()).toMatchSnapshot();
34
+ });
35
+ it('Three children', () => {
36
+ let component;
37
+ act(() => {
38
+ component = renderer.create(
39
+ _jsxs(FocusZone, {
40
+ children: [
41
+ _jsx(Button, { title: 'button', onPress: onPress }),
42
+ _jsx(Button, { title: 'button', onPress: onPress }),
43
+ _jsx(Button, { title: 'button', onPress: onPress }),
44
+ ],
45
+ }),
46
+ );
36
47
  });
48
+ expect(component.toJSON()).toMatchSnapshot();
49
+ });
37
50
  });
38
51
  describe('FocusZone With Props', () => {
39
- it('defaultTabbableElement Prop', () => {
40
- const tree = renderer
41
- .create(React.createElement(FocusZone, { defaultTabbableElement: null },
42
- React.createElement(Button, { title: "button", onPress: onPress }),
43
- React.createElement(Button, { title: "button", onPress: onPress }),
44
- React.createElement(Button, { title: "button", onPress: onPress })))
45
- .toJSON();
46
- expect(tree).toMatchSnapshot();
52
+ it('defaultTabbableElement Prop', () => {
53
+ let component;
54
+ act(() => {
55
+ component = renderer.create(
56
+ _jsxs(FocusZone, {
57
+ defaultTabbableElement: null,
58
+ children: [
59
+ _jsx(Button, { title: 'button', onPress: onPress }),
60
+ _jsx(Button, { title: 'button', onPress: onPress }),
61
+ _jsx(Button, { title: 'button', onPress: onPress }),
62
+ ],
63
+ }),
64
+ );
47
65
  });
48
- it('focusZoneDirection Prop', () => {
49
- const tree = renderer
50
- .create(React.createElement(FocusZone, { focusZoneDirection: "bidirectional" },
51
- React.createElement(Button, { title: "button", onPress: onPress }),
52
- React.createElement(Button, { title: "button", onPress: onPress }),
53
- React.createElement(Button, { title: "button", onPress: onPress })))
54
- .toJSON();
55
- expect(tree).toMatchSnapshot();
66
+ expect(component.toJSON()).toMatchSnapshot();
67
+ });
68
+ it('focusZoneDirection Prop', () => {
69
+ let component;
70
+ act(() => {
71
+ component = renderer.create(
72
+ _jsxs(FocusZone, {
73
+ focusZoneDirection: 'bidirectional',
74
+ children: [
75
+ _jsx(Button, { title: 'button', onPress: onPress }),
76
+ _jsx(Button, { title: 'button', onPress: onPress }),
77
+ _jsx(Button, { title: 'button', onPress: onPress }),
78
+ ],
79
+ }),
80
+ );
56
81
  });
57
- it('disabled Prop', () => {
58
- const tree = renderer
59
- .create(React.createElement(FocusZone, { disabled: true },
60
- React.createElement(Button, { title: "button", onPress: onPress }),
61
- React.createElement(Button, { title: "button", onPress: onPress }),
62
- React.createElement(Button, { title: "button", onPress: onPress })))
63
- .toJSON();
64
- expect(tree).toMatchSnapshot();
82
+ expect(component.toJSON()).toMatchSnapshot();
83
+ });
84
+ it('disabled Prop', () => {
85
+ let component;
86
+ act(() => {
87
+ component = renderer.create(
88
+ _jsxs(FocusZone, {
89
+ disabled: true,
90
+ children: [
91
+ _jsx(Button, { title: 'button', onPress: onPress }),
92
+ _jsx(Button, { title: 'button', onPress: onPress }),
93
+ _jsx(Button, { title: 'button', onPress: onPress }),
94
+ ],
95
+ }),
96
+ );
65
97
  });
66
- it('isCircularNavigation Prop', () => {
67
- const tree = renderer
68
- .create(React.createElement(FocusZone, { isCircularNavigation: true },
69
- React.createElement(Button, { title: "button", onPress: onPress }),
70
- React.createElement(Button, { title: "button", onPress: onPress }),
71
- React.createElement(Button, { title: "button", onPress: onPress })))
72
- .toJSON();
73
- expect(tree).toMatchSnapshot();
98
+ expect(component.toJSON()).toMatchSnapshot();
99
+ });
100
+ it('isCircularNavigation Prop', () => {
101
+ let component;
102
+ act(() => {
103
+ component = renderer.create(
104
+ _jsxs(FocusZone, {
105
+ isCircularNavigation: true,
106
+ children: [
107
+ _jsx(Button, { title: 'button', onPress: onPress }),
108
+ _jsx(Button, { title: 'button', onPress: onPress }),
109
+ _jsx(Button, { title: 'button', onPress: onPress }),
110
+ ],
111
+ }),
112
+ );
74
113
  });
75
- it('use2DNavigation Prop', () => {
76
- const tree = renderer
77
- .create(React.createElement(FocusZone, { use2DNavigation: true },
78
- React.createElement(Button, { title: "button", onPress: onPress }),
79
- React.createElement(Button, { title: "button", onPress: onPress }),
80
- React.createElement(Button, { title: "button", onPress: onPress })))
81
- .toJSON();
82
- expect(tree).toMatchSnapshot();
114
+ expect(component.toJSON()).toMatchSnapshot();
115
+ });
116
+ it('use2DNavigation Prop', () => {
117
+ let component;
118
+ act(() => {
119
+ component = renderer.create(
120
+ _jsxs(FocusZone, {
121
+ use2DNavigation: true,
122
+ children: [
123
+ _jsx(Button, { title: 'button', onPress: onPress }),
124
+ _jsx(Button, { title: 'button', onPress: onPress }),
125
+ _jsx(Button, { title: 'button', onPress: onPress }),
126
+ ],
127
+ }),
128
+ );
83
129
  });
84
- it('All Props', () => {
85
- const tree = renderer
86
- .create(React.createElement(FocusZone, { disabled: false, use2DNavigation: true, defaultTabbableElement: null, isCircularNavigation: false, focusZoneDirection: "vertical" },
87
- React.createElement(Button, { title: "button", onPress: onPress }),
88
- React.createElement(Button, { title: "button", onPress: onPress }),
89
- React.createElement(Button, { title: "button", onPress: onPress })))
90
- .toJSON();
91
- expect(tree).toMatchSnapshot();
130
+ expect(component.toJSON()).toMatchSnapshot();
131
+ });
132
+ it('All Props', () => {
133
+ let component;
134
+ act(() => {
135
+ component = renderer.create(
136
+ _jsxs(FocusZone, {
137
+ disabled: false,
138
+ use2DNavigation: true,
139
+ defaultTabbableElement: null,
140
+ isCircularNavigation: false,
141
+ focusZoneDirection: 'vertical',
142
+ children: [
143
+ _jsx(Button, { title: 'button', onPress: onPress }),
144
+ _jsx(Button, { title: 'button', onPress: onPress }),
145
+ _jsx(Button, { title: 'button', onPress: onPress }),
146
+ ],
147
+ }),
148
+ );
92
149
  });
150
+ expect(component.toJSON()).toMatchSnapshot();
151
+ });
93
152
  });
94
- //# sourceMappingURL=FocusZone.test.js.map
153
+ //# sourceMappingURL=FocusZone.test.js.map