@office-iss/react-native-win32 0.67.0-preview.1 → 0.67.0-preview.2
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 +36 -0
- package/CHANGELOG.md +22 -5
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +1 -0
- package/Libraries/Components/View/Tests/ViewWin32Test.js +44 -2
- package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -0
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/package.json +1 -1
- package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +64 -0
- package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Mon, 15 Nov 2021 16:09:34 GMT",
|
|
6
|
+
"tag": "@office-iss/react-native-win32_v0.67.0-preview.2",
|
|
7
|
+
"version": "0.67.0-preview.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ruaraki@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "6a7a95e90c7f7a3a86efac63b24092232380ba1b",
|
|
14
|
+
"comment": "Add enableFocusRing prop for View and test"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 25 Oct 2021 15:07:48 GMT",
|
|
21
|
+
"tag": "@office-iss/react-native-win32_v0.67.0-preview.1",
|
|
22
|
+
"version": "0.67.0-preview.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"prerelease": [
|
|
25
|
+
{
|
|
26
|
+
"author": "ngerlem@microsoft.com",
|
|
27
|
+
"package": "@office-iss/react-native-win32",
|
|
28
|
+
"commit": "not available",
|
|
29
|
+
"comment": "Promote 0.67 to preview"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@office-iss/react-native-win32",
|
|
34
|
+
"comment": "Bump @react-native-windows/virtualized-list to v0.67.0-preview.1",
|
|
35
|
+
"commit": "666510e980ced292bffd23a44982e8a800f91444"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
4
40
|
{
|
|
5
41
|
"date": "Mon, 25 Oct 2021 15:07:19 GMT",
|
|
6
42
|
"tag": "@office-iss/react-native-win32_v0.67.0-preview.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 15 Nov 2021 16:09:34 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.67.0-preview.
|
|
7
|
+
## 0.67.0-preview.2
|
|
8
8
|
|
|
9
|
-
Mon,
|
|
9
|
+
Mon, 15 Nov 2021 16:09:34 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
- Bump @react-native-windows/virtualized-list to v0.67.0-preview.1
|
|
13
|
+
- Add enableFocusRing prop for View and test (ruaraki@microsoft.com)
|
|
15
14
|
|
|
15
|
+
## 0.67.0-preview.1
|
|
16
|
+
|
|
17
|
+
Mon, 25 Oct 2021 15:07:48 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- Promote 0.67 to preview (ngerlem@microsoft.com)
|
|
22
|
+
- Bump @react-native-windows/virtualized-list to v0.67.0-preview.1
|
|
23
|
+
|
|
24
|
+
## 0.67.0-preview.1
|
|
25
|
+
|
|
26
|
+
Mon, 25 Oct 2021 15:07:19 GMT
|
|
27
|
+
|
|
28
|
+
### Changes
|
|
29
|
+
|
|
30
|
+
- Promote 0.67 to preview (ngerlem@microsoft.com)
|
|
31
|
+
- Bump @react-native-windows/virtualized-list to v0.67.0-preview.1
|
|
32
|
+
|
|
16
33
|
## 0.0.0-canary.117
|
|
17
34
|
|
|
18
35
|
Thu, 21 Oct 2021 05:08:01 GMT
|
|
@@ -60,7 +60,7 @@ class FocusMoverTestComponent extends react_1.default.Component {
|
|
|
60
60
|
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
|
|
61
61
|
react_1.default.createElement(react_native_1.TouchableHighlight, { onPress: this._onPress },
|
|
62
62
|
react_1.default.createElement(ViewWin32_1.ViewWin32, { accessibilityLabeledBy: this._labeledBy, style: styles.blackbox })),
|
|
63
|
-
react_1.default.createElement(ViewWin32_1.ViewWin32, { ref: this._setRef, focusable: true, style: this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }, onFocus: this._onFocus, onBlur: this._onBlur },
|
|
63
|
+
react_1.default.createElement(ViewWin32_1.ViewWin32, { ref: this._setRef, focusable: true, style: this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }, onFocus: this._onFocus, onBlur: this._onBlur, enableFocusRing: false },
|
|
64
64
|
react_1.default.createElement(react_native_1.Text, null, this.state.hasFocus ? 'Focus: Yes' : 'Focus: No')))));
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -98,7 +98,7 @@ class KeyboardTestComponent extends react_1.default.Component {
|
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
100
|
return (react_1.default.createElement(ViewWin32_1.ViewWin32, { keyDownEvents: handledNativeKeyboardEvents, keyUpEvents: handledNativeKeyboardEvents },
|
|
101
|
-
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot, focusable: true, onKeyUp: this._onKeyUp, onKeyDown: this._onKeyDown, onFocus: this._onFocus, onBlur: this._onBlur },
|
|
101
|
+
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot, focusable: true, onKeyUp: this._onKeyUp, onKeyDown: this._onKeyDown, onFocus: this._onFocus, onBlur: this._onBlur, enableFocusRing: false },
|
|
102
102
|
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: styles.keyEnterVisualizer },
|
|
103
103
|
react_1.default.createElement(react_native_1.Text, null, "OnKeyDown"),
|
|
104
104
|
react_1.default.createElement(react_native_1.Text, null, "----"),
|
|
@@ -165,6 +165,41 @@ const CursorExample = () => {
|
|
|
165
165
|
react_1.default.createElement(CursorTestComponent, { cursor: 'text' }),
|
|
166
166
|
react_1.default.createElement(CursorTestComponent, { cursor: 'we-resize' })));
|
|
167
167
|
};
|
|
168
|
+
class EnableFocusRingExample extends react_1.default.Component {
|
|
169
|
+
constructor(props) {
|
|
170
|
+
super(props);
|
|
171
|
+
this._onFocus = () => {
|
|
172
|
+
this.setState({
|
|
173
|
+
hasFocus: true,
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
this._onBlur = () => {
|
|
177
|
+
this.setState({
|
|
178
|
+
hasFocus: false,
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
this.state = {
|
|
182
|
+
hasFocus: false,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
return (react_1.default.createElement(ViewWin32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
|
|
187
|
+
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: {
|
|
188
|
+
backgroundColor: 'pink',
|
|
189
|
+
height: 100,
|
|
190
|
+
width: 100,
|
|
191
|
+
}, enableFocusRing: true, focusable: true },
|
|
192
|
+
react_1.default.createElement(react_native_1.Text, null, "enableFocusRing set to true")),
|
|
193
|
+
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: {
|
|
194
|
+
backgroundColor: 'pink',
|
|
195
|
+
height: 100,
|
|
196
|
+
width: 100,
|
|
197
|
+
}, enableFocusRing: false, focusable: true, onFocus: this._onFocus, onBlur: this._onBlur },
|
|
198
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
199
|
+
react_1.default.createElement(react_native_1.Text, null, "enableFocusRing set to false"),
|
|
200
|
+
react_1.default.createElement(react_native_1.Text, null, this.state.hasFocus ? 'Focus: Yes' : 'Focus: No')))));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
168
203
|
exports.title = 'ViewWin32';
|
|
169
204
|
exports.displayName = 'ViewWin32 Example';
|
|
170
205
|
exports.description = 'All the stock View props plus Win32 specific ones';
|
|
@@ -207,5 +242,12 @@ exports.examples = [
|
|
|
207
242
|
return react_1.default.createElement(CursorExample, null);
|
|
208
243
|
},
|
|
209
244
|
},
|
|
245
|
+
{
|
|
246
|
+
title: 'EnableFocusRing example',
|
|
247
|
+
description: 'Displays focus visuals that are driven by native',
|
|
248
|
+
render() {
|
|
249
|
+
return react_1.default.createElement(EnableFocusRingExample, null);
|
|
250
|
+
},
|
|
251
|
+
},
|
|
210
252
|
];
|
|
211
253
|
//# sourceMappingURL=ViewWin32Test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/View/Tests/ViewWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,kDAAyB;AACzB,+CAAoE;AACpE,4CAAyC;AAGzC,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,OAAO;KACrB;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,aA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AAW,EAAE,iBAAiB;QAC9B,MAAM;YACJ,OAAO,8BAAC,YAAY,OAAG,CAAC;QAC1B,CAAC;KACF;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,MAAM;YACJ,OAAO,8BAAC,cAAc,OAAG,CAAC;QAC5B,CAAC;KACF;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,aAAa,OAAG,CAAC;QAC3B,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\nimport React from 'react'\nimport { StyleSheet, Text, TouchableHighlight } from 'react-native';\nimport { ViewWin32 } from '../ViewWin32';\nimport { Cursor, IKeyboardEvent, IHandledKeyboardEvent } from '../ViewWin32.Props';\n\nconst styles = StyleSheet.create({\n border: {\n borderStyle: 'dotted',\n borderColor: 'black',\n },\n keyComponentRoot: {\n borderWidth: 2,\n flexDirection: 'row',\n marginVertical: 5,\n backgroundColor: 'whitesmoke',\n justifyContent: 'space-around',\n },\n keyEnterVisualizer: {\n margin: 5,\n alignItems: 'center',\n minWidth: 100,\n minHeight: 30,\n },\n blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },\n});\n\ninterface IFocusableComponentState {\n hasFocus: boolean;\n}\n\nclass FocusMoverTestComponent extends React.Component<{}, IFocusableComponentState> {\n private _focusTarget: ViewWin32 = null;\n private readonly _labeledBy: React.RefObject<ViewWin32>;\n\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n this._labeledBy = React.createRef<ViewWin32>();\n }\n public render() {\n return (\n <ViewWin32>\n <ViewWin32 ref={this._labeledBy} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={this._onPress}>\n <ViewWin32 accessibilityLabeledBy={this._labeledBy} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={this._setRef}\n focusable\n style={this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _setRef = (ref: ViewWin32) => {\n this._focusTarget = ref;\n };\n\n private readonly _onPress = () => {\n if (this._focusTarget !== undefined) {\n this._focusTarget.focus();\n }\n };\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\ninterface IKeyboardableComponentState {\n lastKeyDown: string;\n lastKeyUp: string;\n}\n\nconst handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [\n { key: 'ArrowDown' },\n { key: 'ArrowUp' },\n { key: 'ArrowLeft' },\n { key: 'ArrowRight' },\n { key: 'Tab' },\n];\n\nclass KeyboardTestComponent extends React.Component<{}, IFocusableComponentState & IKeyboardableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n lastKeyDown: null,\n lastKeyUp: null,\n };\n }\n\n public render() {\n return (\n <ViewWin32 keyDownEvents={handledNativeKeyboardEvents} keyUpEvents={handledNativeKeyboardEvents}>\n <ViewWin32\n style={this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot}\n focusable\n onKeyUp={this._onKeyUp}\n onKeyDown={this._onKeyDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyDown</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' '}</Text>\n </ViewWin32>\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyUp</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' '}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });\n };\n}\n\ninterface IHoverComponentProps {\n color: string;\n}\nclass HoverTestComponent extends React.Component<IHoverComponentProps, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n\n public render() {\n return (\n <ViewWin32\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n style={this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox}\n />\n );\n }\n private readonly _onMouseLeave = () => {\n this.setState({ hasFocus: false });\n };\n private readonly _onMouseEnter = () => {\n this.setState({ hasFocus: true });\n };\n}\n\nclass HoverExample extends React.Component {\n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' }}>\n <HoverTestComponent color=\"red\" />\n <HoverTestComponent color=\"orange\" />\n <HoverTestComponent color=\"yellow\" />\n <HoverTestComponent color=\"green\" />\n <HoverTestComponent color=\"blue\" />\n <HoverTestComponent color=\"indigo\" />\n <HoverTestComponent color=\"violet\" />\n </ViewWin32>\n );\n }\n}\n\nconst ToolTipExample: React.FunctionComponent<{}> = () => {\n return (\n <ViewWin32\n style={{\n backgroundColor: 'red',\n height: 100,\n width: 100,\n }}\n tooltip=\"Example tooltip\"\n cursor=\"pointer\"\n />\n );\n};\n\ninterface ICursorTestComponentProps {\n cursor: Cursor\n}\n\nconst CursorTestComponent: React.FunctionComponent<ICursorTestComponentProps> = (props) => {\n return (\n <ViewWin32 style={{flexDirection: 'column'}}>\n <Text>{props.cursor}</Text>\n <ViewWin32 cursor={props.cursor} style={styles.blackbox} />\n </ViewWin32>\n )\n}\n\nconst CursorExample: React.FunctionComponent = () => {\n return (\n <ViewWin32 style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n <CursorTestComponent cursor='auto' />\n <CursorTestComponent cursor='default' />\n <CursorTestComponent cursor='help' />\n <CursorTestComponent cursor='nesw-resize' />\n <CursorTestComponent cursor='not-allowed' />\n <CursorTestComponent cursor='ns-resize' />\n <CursorTestComponent cursor='nwse-resize' />\n <CursorTestComponent cursor='pointer' />\n <CursorTestComponent cursor='wait' />\n <CursorTestComponent cursor='move' />\n <CursorTestComponent cursor='text' />\n <CursorTestComponent cursor='we-resize' />\n </ViewWin32>\n );\n}\n\nexport const title = 'ViewWin32';\nexport const displayName = 'ViewWin32 Example';\nexport const description = 'All the stock View props plus Win32 specific ones';\nexport const examples = [\n {\n title: 'focus() method example',\n description: 'Each of these black boxes moves focus to the ViewWin32 on the right',\n render(): JSX.Element {\n return (\n <ViewWin32>\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n </ViewWin32>\n );\n },\n },\n {\n title: 'KeyboardEvents example',\n description: 'Native keyboarding has been prevented',\n render(): JSX.Element {\n return <KeyboardTestComponent />;\n },\n },\n {\n title: 'Hover example',\n description: 'Hover a rainbow',\n render(): JSX.Element {\n return <HoverExample />;\n },\n },\n {\n title: 'Tooltip example',\n description: 'Displays a tooltip on hover',\n render(): JSX.Element {\n return <ToolTipExample />;\n },\n },\n {\n title: 'Cursor example',\n description: 'Each of these boxes should display a different cursor',\n render(): JSX.Element {\n return <CursorExample />;\n },\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"ViewWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/View/Tests/ViewWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,kDAAyB;AACzB,+CAAoE;AACpE,4C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G,CACjB,CACb,CAAC;QACJ,CAAC;KACF;IACD;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,uCAAuC;QACpD,MAAM;YACJ,OAAO,8BAAC,qBAAqB,OAAG,CAAC;QACnC,CAAC;KACF;IACD;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,iBAAiB;QAC9B,MAAM;YACJ,OAAO,8BAAC,YAAY,OAAG,CAAC;QAC1B,CAAC;KACF;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,MAAM;YACJ,OAAO,8BAAC,cAAc,OAAG,CAAC;QAC5B,CAAC;KACF;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,aAAa,OAAG,CAAC;QAC3B,CAAC;KACF;IACD;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,kDAAkD;QAC/D,MAAM;YACJ,OAAO,8BAAC,sBAAsB,OAAG,CAAC;QACpC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\nimport React from 'react'\nimport { StyleSheet, Text, TouchableHighlight } from 'react-native';\nimport { ViewWin32 } from '../ViewWin32';\nimport { Cursor, IKeyboardEvent, IHandledKeyboardEvent } from '../ViewWin32.Props';\n\nconst styles = StyleSheet.create({\n border: {\n borderStyle: 'dotted',\n borderColor: 'black',\n },\n keyComponentRoot: {\n borderWidth: 2,\n flexDirection: 'row',\n marginVertical: 5,\n backgroundColor: 'whitesmoke',\n justifyContent: 'space-around',\n },\n keyEnterVisualizer: {\n margin: 5,\n alignItems: 'center',\n minWidth: 100,\n minHeight: 30,\n },\n blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },\n});\n\ninterface IFocusableComponentState {\n hasFocus: boolean;\n}\n\nclass FocusMoverTestComponent extends React.Component<{}, IFocusableComponentState> {\n private _focusTarget: ViewWin32 = null;\n private readonly _labeledBy: React.RefObject<ViewWin32>;\n\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n this._labeledBy = React.createRef<ViewWin32>();\n }\n public render() {\n return (\n <ViewWin32>\n <ViewWin32 ref={this._labeledBy} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={this._onPress}>\n <ViewWin32 accessibilityLabeledBy={this._labeledBy} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={this._setRef}\n focusable\n style={this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n enableFocusRing={false}\n >\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _setRef = (ref: ViewWin32) => {\n this._focusTarget = ref;\n };\n\n private readonly _onPress = () => {\n if (this._focusTarget !== undefined) {\n this._focusTarget.focus();\n }\n };\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\ninterface IKeyboardableComponentState {\n lastKeyDown: string;\n lastKeyUp: string;\n}\n\nconst handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [\n { key: 'ArrowDown' },\n { key: 'ArrowUp' },\n { key: 'ArrowLeft' },\n { key: 'ArrowRight' },\n { key: 'Tab' },\n];\n\nclass KeyboardTestComponent extends React.Component<{}, IFocusableComponentState & IKeyboardableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n lastKeyDown: null,\n lastKeyUp: null,\n };\n }\n\n public render() {\n return (\n <ViewWin32 keyDownEvents={handledNativeKeyboardEvents} keyUpEvents={handledNativeKeyboardEvents}>\n <ViewWin32\n style={this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot}\n focusable\n onKeyUp={this._onKeyUp}\n onKeyDown={this._onKeyDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n enableFocusRing={false}\n >\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyDown</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' '}</Text>\n </ViewWin32>\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyUp</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' '}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });\n };\n}\n\ninterface IHoverComponentProps {\n color: string;\n}\nclass HoverTestComponent extends React.Component<IHoverComponentProps, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n\n public render() {\n return (\n <ViewWin32\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n style={this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox}\n />\n );\n }\n private readonly _onMouseLeave = () => {\n this.setState({ hasFocus: false });\n };\n private readonly _onMouseEnter = () => {\n this.setState({ hasFocus: true });\n };\n}\n\nclass HoverExample extends React.Component {\n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' }}>\n <HoverTestComponent color=\"red\" />\n <HoverTestComponent color=\"orange\" />\n <HoverTestComponent color=\"yellow\" />\n <HoverTestComponent color=\"green\" />\n <HoverTestComponent color=\"blue\" />\n <HoverTestComponent color=\"indigo\" />\n <HoverTestComponent color=\"violet\" />\n </ViewWin32>\n );\n }\n}\n\nconst ToolTipExample: React.FunctionComponent<{}> = () => {\n return (\n <ViewWin32\n style={{\n backgroundColor: 'red',\n height: 100,\n width: 100,\n }}\n tooltip=\"Example tooltip\"\n cursor=\"pointer\"\n />\n );\n};\n\ninterface ICursorTestComponentProps {\n cursor: Cursor\n}\n\nconst CursorTestComponent: React.FunctionComponent<ICursorTestComponentProps> = (props) => {\n return (\n <ViewWin32 style={{flexDirection: 'column'}}>\n <Text>{props.cursor}</Text>\n <ViewWin32 cursor={props.cursor} style={styles.blackbox} />\n </ViewWin32>\n )\n}\n\nconst CursorExample: React.FunctionComponent = () => {\n return (\n <ViewWin32 style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n <CursorTestComponent cursor='auto' />\n <CursorTestComponent cursor='default' />\n <CursorTestComponent cursor='help' />\n <CursorTestComponent cursor='nesw-resize' />\n <CursorTestComponent cursor='not-allowed' />\n <CursorTestComponent cursor='ns-resize' />\n <CursorTestComponent cursor='nwse-resize' />\n <CursorTestComponent cursor='pointer' />\n <CursorTestComponent cursor='wait' />\n <CursorTestComponent cursor='move' />\n <CursorTestComponent cursor='text' />\n <CursorTestComponent cursor='we-resize' />\n </ViewWin32>\n );\n}\nclass EnableFocusRingExample extends React.Component<{}, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n \n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={true}\n focusable\n >\n <Text>enableFocusRing set to true</Text>\n </ViewWin32>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={false}\n focusable\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <>\n <Text>enableFocusRing set to false</Text>\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\n\nexport const title = 'ViewWin32';\nexport const displayName = 'ViewWin32 Example';\nexport const description = 'All the stock View props plus Win32 specific ones';\nexport const examples = [\n {\n title: 'focus() method example',\n description: 'Each of these black boxes moves focus to the ViewWin32 on the right',\n render(): JSX.Element {\n return (\n <ViewWin32>\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n </ViewWin32>\n );\n },\n },\n {\n title: 'KeyboardEvents example',\n description: 'Native keyboarding has been prevented',\n render(): JSX.Element {\n return <KeyboardTestComponent />;\n },\n },\n {\n title: 'Hover example',\n description: 'Hover a rainbow',\n render(): JSX.Element {\n return <HoverExample />;\n },\n },\n {\n title: 'Tooltip example',\n description: 'Displays a tooltip on hover',\n render(): JSX.Element {\n return <ToolTipExample />;\n },\n },\n {\n title: 'Cursor example',\n description: 'Each of these boxes should display a different cursor',\n render(): JSX.Element {\n return <CursorExample />;\n },\n },\n {\n title: 'EnableFocusRing example',\n description: 'Displays focus visuals that are driven by native',\n render(): JSX.Element {\n return <EnableFocusRingExample />;\n },\n },\n];\n"]}
|
|
@@ -114,6 +114,7 @@ export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>,
|
|
|
114
114
|
accessibilitySetSize?: number;
|
|
115
115
|
animationClass?: string;
|
|
116
116
|
focusable?: boolean;
|
|
117
|
+
enableFocusRing?: boolean;
|
|
117
118
|
/**
|
|
118
119
|
* The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
|
|
119
120
|
* Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>; \n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string;\n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>; \n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string;\n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -54,6 +54,7 @@ class FocusMoverTestComponent extends React.Component<{}, IFocusableComponentSta
|
|
|
54
54
|
style={this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}
|
|
55
55
|
onFocus={this._onFocus}
|
|
56
56
|
onBlur={this._onBlur}
|
|
57
|
+
enableFocusRing={false}
|
|
57
58
|
>
|
|
58
59
|
<Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>
|
|
59
60
|
</ViewWin32>
|
|
@@ -118,6 +119,7 @@ class KeyboardTestComponent extends React.Component<{}, IFocusableComponentState
|
|
|
118
119
|
onKeyDown={this._onKeyDown}
|
|
119
120
|
onFocus={this._onFocus}
|
|
120
121
|
onBlur={this._onBlur}
|
|
122
|
+
enableFocusRing={false}
|
|
121
123
|
>
|
|
122
124
|
<ViewWin32 style={styles.keyEnterVisualizer}>
|
|
123
125
|
<Text>OnKeyDown</Text>
|
|
@@ -244,6 +246,61 @@ const CursorExample: React.FunctionComponent = () => {
|
|
|
244
246
|
</ViewWin32>
|
|
245
247
|
);
|
|
246
248
|
}
|
|
249
|
+
class EnableFocusRingExample extends React.Component<{}, IFocusableComponentState> {
|
|
250
|
+
public constructor(props) {
|
|
251
|
+
super(props);
|
|
252
|
+
this.state = {
|
|
253
|
+
hasFocus: false,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public render() {
|
|
258
|
+
return (
|
|
259
|
+
<ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>
|
|
260
|
+
<ViewWin32
|
|
261
|
+
style={{
|
|
262
|
+
backgroundColor: 'pink',
|
|
263
|
+
height: 100,
|
|
264
|
+
width: 100,
|
|
265
|
+
}}
|
|
266
|
+
enableFocusRing={true}
|
|
267
|
+
focusable
|
|
268
|
+
>
|
|
269
|
+
<Text>enableFocusRing set to true</Text>
|
|
270
|
+
</ViewWin32>
|
|
271
|
+
<ViewWin32
|
|
272
|
+
style={{
|
|
273
|
+
backgroundColor: 'pink',
|
|
274
|
+
height: 100,
|
|
275
|
+
width: 100,
|
|
276
|
+
}}
|
|
277
|
+
enableFocusRing={false}
|
|
278
|
+
focusable
|
|
279
|
+
onFocus={this._onFocus}
|
|
280
|
+
onBlur={this._onBlur}
|
|
281
|
+
>
|
|
282
|
+
<>
|
|
283
|
+
<Text>enableFocusRing set to false</Text>
|
|
284
|
+
<Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>
|
|
285
|
+
</>
|
|
286
|
+
</ViewWin32>
|
|
287
|
+
</ViewWin32>
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private readonly _onFocus = () => {
|
|
292
|
+
this.setState({
|
|
293
|
+
hasFocus: true,
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
private readonly _onBlur = () => {
|
|
298
|
+
this.setState({
|
|
299
|
+
hasFocus: false,
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
247
304
|
|
|
248
305
|
export const title = 'ViewWin32';
|
|
249
306
|
export const displayName = 'ViewWin32 Example';
|
|
@@ -290,4 +347,11 @@ export const examples = [
|
|
|
290
347
|
return <CursorExample />;
|
|
291
348
|
},
|
|
292
349
|
},
|
|
350
|
+
{
|
|
351
|
+
title: 'EnableFocusRing example',
|
|
352
|
+
description: 'Displays focus visuals that are driven by native',
|
|
353
|
+
render(): JSX.Element {
|
|
354
|
+
return <EnableFocusRingExample />;
|
|
355
|
+
},
|
|
356
|
+
},
|
|
293
357
|
];
|
|
@@ -211,6 +211,7 @@ export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>,
|
|
|
211
211
|
accessibilitySetSize?: number;
|
|
212
212
|
animationClass?: string;
|
|
213
213
|
focusable?: boolean;
|
|
214
|
+
enableFocusRing?: boolean;
|
|
214
215
|
|
|
215
216
|
/**
|
|
216
217
|
* The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
|