@office-iss/react-native-win32 0.71.0 → 0.71.1
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/.flowconfig +1 -0
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
- package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
- package/Libraries/Components/Button/ButtonWin32.js +6 -4
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
- package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
- package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
- package/Libraries/Components/Text/TextWin32.d.ts +1 -1
- package/Libraries/Components/Text/TextWin32.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
- package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
- package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
- package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
- package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
- package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
- package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
- package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
- package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
- package/Libraries/Components/View/ViewWin32.d.ts +30 -12
- package/Libraries/Components/View/ViewWin32.js +161 -71
- package/Libraries/Image/Image.win32.js +0 -1
- package/Libraries/Pressability/Pressability.win32.js +2 -2
- package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
- package/Libraries/__tests__/ButtonWin32-test.js +1 -1
- package/Libraries/platform-types.d.ts +7 -13
- package/index.win32.js +1 -1
- package/jest.config.js +2 -4
- package/overrides.json +38 -8
- package/package.json +5 -5
- package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
- package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
- package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
- package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
- package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
- package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
- package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
- package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
- package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
- package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
- package/src/Libraries/platform-types.d.ts +7 -13
- package/types/modules/BatchedBridge.d.ts +32 -0
- package/types/modules/Codegen.d.ts +74 -0
- package/types/modules/Devtools.d.ts +31 -0
- package/types/modules/LaunchScreen.d.ts +18 -0
- package/types/modules/globals.d.ts +577 -0
- package/types/private/TimerMixin.d.ts +19 -0
- package/types/private/Utilities.d.ts +10 -0
- package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
- package/types/public/Insets.d.ts +15 -0
- package/types/public/ReactNativeRenderer.d.ts +149 -0
- package/types/public/ReactNativeTypes.d.ts +143 -0
- package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
- package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
- package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
- package/Libraries/Components/View/ViewWin32.Props.js +0 -11
- package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
- package/Libraries/Components/View/ViewWin32.js.map +0 -1
- package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
- package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
- package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
- package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchableWin32.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAqF;AAcrF,iDAA8C;AAG9C,MAAM,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEvC,MAAM,EAAC,cAAc,EAAC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAErE;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,CAAc;IACxC,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IACpC,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,M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,CAAC,aAAa;YAChC,QAAQ;YACR,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,yBAAyB;YACzB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,MAAM;YACN,GAAG,EAAE,IAAI,CAAC,YAAY;YACtB,QAAQ;YACR,KAAK,EAAE,aAAa,IAEnB,KAAK,CACI,CACb,CAAC;IACJ,CAAC;CAuWF;AA1bD,wCA0bC","sourcesContent":["/**\n * This is primarily a fork of React Native's Touchable Mixin.\n * It has been repurposed as it's own standalone control for win32,\n * as it needs to support a richer set of functionality on the desktop.\n * The touchable variants can be rewritten as wrappers around TouchableWin32\n * by passing the correct set of props down and managing state correctly.\n *\n * React Native's Touchable.js file (https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/Touchable.js)\n * provides an overview over how touchables work and interact with the gesture responder system.\n */\n'use strict';\n\nimport React from 'react'\nimport { NativeSyntheticEvent, StyleProp, UIManager, ViewStyle } from 'react-native';\n\nimport { ITouchableWin32Props, ITouchableWin32State } from './TouchableWin32.Props';\nimport {\n IChildAsFunction,\n IDimensions,\n IPosition,\n IPressEvent,\n IPressInLocation,\n ISignal,\n IState,\n IStateConditions,\n ITransitions,\n} from './TouchableWin32.Types';\nimport { ViewWin32 } from '../View/ViewWin32';\nimport { IKeyboardEvent } from '../View/ViewWin32.Props';\n\nconst BoundingDimensions = require('./BoundingDimensions');\nconst Position = require('./Position');\n\nconst {findNodeHandle} = require('../../Renderer/shims/ReactNative');\n\n/**\n * Extracts a single touch, generally this is the active touch or touch that\n * has just ended\n * @param e - a press event containing information about the native event\n */\nfunction extractSingleTouch(e: IPressEvent) {\n const nativeEvent = e.nativeEvent;\n const touches = nativeEvent.touches;\n const changedTouches = nativeEvent.changedTouches;\n const hasTouches = touches && touches.length > 0;\n const hasChangedTouches = changedTouches && changedTouches.length > 0;\n\n return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;\n}\n\n/** Quick lookup maps for a variety of conditions */\nconst baseStatesCondition: IStateConditions = {\n NOT_RESPONDER: false,\n RESPONDER_INACTIVE_PRESS_IN: false,\n RESPONDER_INACTIVE_PRESS_OUT: false,\n RESPONDER_ACTIVE_PRESS_IN: false,\n RESPONDER_ACTIVE_PRESS_OUT: false,\n RESPONDER_ACTIVE_LONG_PRESS_IN: false,\n RESPONDER_ACTIVE_LONG_PRESS_OUT: false,\n ERROR: false,\n};\n\nconst IsActive: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_ACTIVE_PRESS_OUT: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n};\n\nconst IsPressingIn: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_INACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\nconst IsLongPressingIn: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\nconst transitions: ITransitions = {\n NOT_RESPONDER: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN',\n RESPONDER_RELEASE: 'ERROR',\n RESPONDER_TERMINATED: 'ERROR',\n ENTER_PRESS_RECT: 'ERROR',\n LEAVE_PRESS_RECT: 'ERROR',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_INACTIVE_PRESS_IN: {\n DELAY: 'RESPONDER_ACTIVE_PRESS_IN',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_INACTIVE_PRESS_OUT: {\n DELAY: 'RESPONDER_ACTIVE_PRESS_OUT',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_ACTIVE_PRESS_IN: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n },\n RESPONDER_ACTIVE_PRESS_OUT: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_ACTIVE_LONG_PRESS_IN: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n },\n RESPONDER_ACTIVE_LONG_PRESS_OUT: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n ERROR: {\n DELAY: 'NOT_RESPONDER',\n RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'NOT_RESPONDER',\n LEAVE_PRESS_RECT: 'NOT_RESPONDER',\n LONG_PRESS_DETECTED: 'NOT_RESPONDER',\n },\n};\n\n// Touchable maintains additional internal state to manage keypress interactions\n// This information is abstracted away when passed to children off the touchable\n// (function children) or styles. A keypressed state is equivalent to a normal\n// press state. If either a pointer, mouse, or special key (space/enter) is pressed\n// the touchable considers itself to be in a pressed state. Do note that key presses\n// will not invoke gesture responder hooksand are not subject to the passed in delays.\ninterface IInternalTouchableWin32State extends ITouchableWin32State {\n isKeyPressed: boolean;\n}\n\n/** Constants for integrating into UI Components */\nconst HIGHLIGHT_DELAY_MS = 130;\nconst PRESS_EXPAND_DIPS = 20; // Subject to change for win32 and desktop\nconst LONG_PRESS_THRESHOLD = 500;\nconst LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\nconst LONG_PRESS_ALLOWED_MOVEMENT = 10;\n\n/**\n * TouchableWin32 is a 'componentization' of the Touchable Mixin in React Native.\n * This means that instead of implementing components such as TouchableHighlight\n * via the mixin, they are merely implemented as wrappers around TouchableWin32,\n * forwarding the correct set of props. Additionally, TouchableWin32 supports hover\n * via onMouseEnter and onMouseLeave and focus/blur via onFocus/onBlur.\n * TouchableWin32 also allows for functions as child components (that use the internal\n * state of the touchable to conditionally render children) as well functions as styles\n * (that use internal state to conditionally calculate styles)\n */\nexport class TouchableWin32 extends React.Component<ITouchableWin32Props, IInternalTouchableWin32State> {\n private _longPressDelayTimeout: number;\n private _touchableDelayTimeout: number;\n private _pressOutDelayTimeout: number;\n private _pressInLocation: IPressInLocation;\n private _touchState: IState;\n private _responderID: number;\n private _positionOnActivate: IPosition;\n private _dimensionsOnActivate: IDimensions;\n\n private readonly _internalRef: React.RefObject<ViewWin32>\n\n constructor(props) {\n super(props);\n\n this.state = {\n isKeyPressed: false,\n isPressed: false,\n isFocused: false,\n isHovered: false,\n };\n\n this._internalRef = React.createRef<ViewWin32>();\n }\n\n public componentWillUnmount() {\n this._touchableDelayTimeout && clearTimeout(this._touchableDelayTimeout);\n this._longPressDelayTimeout && clearTimeout(this._longPressDelayTimeout);\n this._pressOutDelayTimeout && clearTimeout(this._pressOutDelayTimeout);\n }\n\n public render() {\n const { children, style, renderStyle, ...rest } = this.props;\n\n // The React Native touchables generally clone the child component\n // to apply additional styles to it. This approach allows children\n // to be passed in as functions (to be invoked with the current state),\n // it is handy for manipulating children as a result of the interaction\n // state (e.g. text color). A similar approach is taken for style\n let child: React.ReactNode;\n if (children) {\n child = typeof children === 'function' ?\n (children as IChildAsFunction<ITouchableWin32State>)(this._deriveStateFromInternalState()) : children;\n\n // Continue to enforce single child constraint\n child = React.Children.only(child);\n }\n\n let computedStyle: StyleProp<ViewStyle>;\n if (renderStyle) {\n computedStyle = renderStyle(this._deriveStateFromInternalState());\n } else if (style) {\n computedStyle = style;\n }\n\n return (\n <ViewWin32\n // Forward most of the props\n {...rest}\n // Hooks into Gesture Responder System\n onStartShouldSetResponder={this._touchableHandleStartShouldSetResponder}\n onResponderTerminationRequest={this._touchableHandleResponderTerminationRequest}\n onResponderGrant={this._touchableHandleResponderGrant}\n onResponderMove={this._touchableHandleResponderMove}\n onResponderRelease={this._touchableHandleResponderRelease}\n onResponderTerminate={this._touchableHandleResponderTerminate}\n // Hover\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n // Focus\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n // Key press interactions\n onKeyDown={this._onKeyDown}\n onKeyUp={this._onKeyUp}\n // Ref\n ref={this._internalRef}\n // Style\n style={computedStyle}\n >\n {child}\n </ViewWin32>\n );\n }\n\n public focus = () => {\n this._internalRef.current.focus();\n }\n\n /**\n * The rejectResponderTermination prop provides a way to accept/reject termination requests\n */\n private readonly _touchableHandleResponderTerminationRequest = (): boolean => {\n return !this.props.rejectResponderTermination;\n };\n\n /**\n * Only reject an opportunity to become the responder on bubble if disabled\n */\n private readonly _touchableHandleStartShouldSetResponder = (): boolean => {\n return !this.props.disabled;\n };\n\n /** TODO: Long press cancel as a prop may be a good idea */\n private readonly _touchableLongPressCancelsPress = (): boolean => {\n return true;\n };\n\n /**\n * On responder being granted, state and local data need to be set\n */\n private readonly _touchableHandleResponderGrant = (e: IPressEvent): void => {\n const dispatchID = findNodeHandle(e.currentTarget);\n e.persist();\n\n this._pressOutDelayTimeout && clearTimeout(this._pressOutDelayTimeout);\n this._pressOutDelayTimeout = null;\n\n this._touchState = 'NOT_RESPONDER';\n this._responderID = dispatchID;\n\n this._receiveSignal('RESPONDER_GRANT', e);\n let delayMS: number = this.props.touchableGetHighlightDelayMS\n ? Math.max(this.props.touchableGetHighlightDelayMS(), 0)\n : HIGHLIGHT_DELAY_MS;\n delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;\n\n if (delayMS !== 0) {\n this._touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);\n } else {\n this._handleDelay(e);\n }\n\n let longDelayMS: number = this.props.touchableGetLongPressDelayMS\n ? Math.max(this.props.touchableGetLongPressDelayMS(), 10)\n : LONG_PRESS_DELAY_MS;\n longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;\n this._longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);\n };\n\n /**\n * Handle responder release\n */\n private readonly _touchableHandleResponderRelease = (e: IPressEvent) => {\n this._pressInLocation = null;\n this._receiveSignal('RESPONDER_RELEASE', e);\n };\n\n /**\n * Handle responder terminate\n */\n private readonly _touchableHandleResponderTerminate = (e: IPressEvent) => {\n this._pressInLocation = null;\n this._receiveSignal('RESPONDER_TERMINATED', e);\n };\n\n /**\n * Handles move events\n */\n private readonly _touchableHandleResponderMove = (e: IPressEvent) => {\n if (!this._positionOnActivate) {\n return;\n }\n\n const positionOnActivate = this._positionOnActivate;\n const dimensionsOnActivate = this._dimensionsOnActivate;\n const pressRectOffset = this.props.touchableGetPressRectOffset\n ? this.props.touchableGetPressRectOffset()\n : {\n left: PRESS_EXPAND_DIPS,\n right: PRESS_EXPAND_DIPS,\n top: PRESS_EXPAND_DIPS,\n bottom: PRESS_EXPAND_DIPS,\n };\n\n let pressExpandLeft = pressRectOffset.left;\n let pressExpandTop = pressRectOffset.top;\n let pressExpandRight = pressRectOffset.right;\n let pressExpandBottom = pressRectOffset.bottom;\n\n // TODO implement touchableGetHitSlop natively\n const hitSlop = this.props.touchableGetHitSlop ? this.props.touchableGetHitSlop() : null;\n\n if (hitSlop) {\n pressExpandLeft += hitSlop.left || 0;\n pressExpandTop += hitSlop.top || 0;\n pressExpandRight += hitSlop.right || 0;\n pressExpandBottom += hitSlop.bottom || 0;\n }\n\n const touch = extractSingleTouch(e);\n const pageX = touch && touch.pageX;\n const pageY = touch && touch.pageY;\n\n if (this._pressInLocation) {\n const movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this._pressInLocation.pageX, this._pressInLocation.pageY);\n if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n this._cancelLongPressDelayTimeout();\n }\n }\n\n const isTouchWithinActive =\n pageX > positionOnActivate.left - pressExpandLeft &&\n pageY > positionOnActivate.top - pressExpandTop &&\n pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight &&\n pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;\n if (isTouchWithinActive) {\n const prevState = this._touchState;\n this._receiveSignal('ENTER_PRESS_RECT', e);\n const currState = this._touchState;\n if (currState === 'RESPONDER_INACTIVE_PRESS_IN' && prevState !== 'RESPONDER_INACTIVE_PRESS_IN') {\n this._cancelLongPressDelayTimeout();\n }\n } else {\n this._cancelLongPressDelayTimeout();\n this._receiveSignal('LEAVE_PRESS_RECT', e);\n }\n };\n\n /**\n * Used while performing side effects during state transitions,\n * to maintain proper bounding dimensions and positional information\n */\n private readonly _remeasureMetricsOnActivation = () => {\n const tag = this._responderID;\n if (tag === null) {\n return;\n }\n\n UIManager.measure(tag, this._handleQueryLayout);\n };\n\n /**\n * Callback into measure, see _remeasureMetricsOnActivation\n */\n private readonly _handleQueryLayout = (l: number, t: number, w: number, h: number, globalX: number, globalY: number) => {\n if (!l && !t && !w && !h && !globalX && !globalY) {\n return;\n }\n\n this._positionOnActivate = Position.getPooled(globalX, globalY);\n this._dimensionsOnActivate = BoundingDimensions.getPooled(w, h);\n };\n\n private readonly _handleDelay = (e: IPressEvent) => {\n this._touchableDelayTimeout = null;\n this._receiveSignal('DELAY', e);\n };\n\n private readonly _handleLongDelay = (e: IPressEvent) => {\n this._longPressDelayTimeout = null;\n const currState = this._touchState;\n\n if (currState !== 'RESPONDER_ACTIVE_PRESS_IN' && currState !== 'RESPONDER_ACTIVE_LONG_PRESS_IN') {\n const errorMessage =\n 'Attempted to transition from state ' +\n currState +\n ' to ' +\n 'RESPONDER_ACTIVE_LONG_PRESS_IN ' +\n 'which is not supported. This is most likely due to ' +\n 'Touchable.longPressDelayTimeout not being canceled.';\n console.error(errorMessage);\n } else {\n this._receiveSignal('LONG_PRESS_DETECTED', e);\n }\n };\n\n /**\n * Manages state transitions\n */\n private readonly _receiveSignal = (signal: ISignal, e: IPressEvent) => {\n const responderID = this._responderID;\n const currState = this._touchState;\n const nextState: IState = transitions[currState] ? transitions[currState][signal] : null;\n\n if (!nextState) {\n const errorMessage = 'Unrecognized signal ' + signal + ' or state ' + currState + ' for Touchable responder ' + responderID + '.';\n throw new Error(errorMessage);\n }\n if (nextState === 'ERROR') {\n const errorMessage = 'Touchable cannot transition from ' + currState + ' to ' + signal + ' for responder ' + responderID + '.';\n throw new Error(errorMessage);\n }\n\n if (currState !== nextState) {\n this._performSideEffectsForTransition(currState, nextState, signal, e);\n this._touchState = nextState;\n }\n };\n\n private readonly _cancelLongPressDelayTimeout = () => {\n this._longPressDelayTimeout && clearTimeout(this._longPressDelayTimeout);\n this._longPressDelayTimeout = null;\n };\n\n private readonly _isHighlight = (state: IState) => {\n return state === 'RESPONDER_ACTIVE_PRESS_IN' || state === 'RESPONDER_ACTIVE_LONG_PRESS_IN';\n };\n\n private readonly _savePressInLocation = (e: IPressEvent) => {\n const touch = extractSingleTouch(e);\n const pageX = touch && touch.pageX;\n const pageY = touch && touch.pageY;\n const locationX = touch && touch.locationX;\n const locationY = touch && touch.locationY;\n this._pressInLocation = { pageX, pageY, locationX, locationY };\n };\n\n private readonly _getDistanceBetweenPoints = (aX: number, aY: number, bX: number, bY: number): number => {\n const deltaX = aX - bX;\n const deltaY = aY - bY;\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n };\n\n /**\n * Any highlighting/visual effects is done here,\n * This is also where press callbacks are invoked from\n */\n // Existing high cyclomatic complexity\n \n private readonly _performSideEffectsForTransition = (currState: IState, nextState: IState, signal: ISignal, e: IPressEvent) => {\n const currIsHighlight = this._isHighlight(currState);\n const newIsHighlight = this._isHighlight(nextState);\n\n const isFinalSignal = signal === 'RESPONDER_TERMINATED' || signal === 'RESPONDER_RELEASE';\n\n if (isFinalSignal) {\n this._cancelLongPressDelayTimeout();\n }\n\n const isInitialTransition = currState === 'NOT_RESPONDER' && nextState === 'RESPONDER_INACTIVE_PRESS_IN';\n\n const isActiveTransition = !IsActive[currState] && IsActive[nextState];\n if (isInitialTransition || isActiveTransition) {\n this._remeasureMetricsOnActivation();\n }\n\n if (IsPressingIn[currState] && signal === 'LONG_PRESS_DETECTED') {\n this.props.touchableHandleLongPress && this.props.touchableHandleLongPress(e);\n }\n\n if (newIsHighlight && !currIsHighlight) {\n this._startHighlight(e);\n } else if (!newIsHighlight && currIsHighlight) {\n this._endHighlight(e);\n }\n\n if (IsPressingIn[currState] && signal === 'RESPONDER_RELEASE') {\n const hasLongPressHandler = !!this.props.onLongPress;\n const pressIsLongButStillCallOnPress = IsLongPressingIn[currState] && (!hasLongPressHandler || this._touchableLongPressCancelsPress);\n const shouldInvokePress = !IsLongPressingIn[currState] || pressIsLongButStillCallOnPress;\n\n if (shouldInvokePress && this.props.touchableHandlePress) {\n if (!newIsHighlight && !currIsHighlight) {\n // we never highlighted because of delay, but we should highlight now\n this._startHighlight(e);\n this._endHighlight(e);\n }\n\n this.props.touchableHandlePress(e);\n }\n }\n\n this._touchableDelayTimeout && clearTimeout(this._touchableDelayTimeout);\n this._touchableDelayTimeout = null;\n };\n\n private readonly _startHighlight = (e: IPressEvent) => {\n this._savePressInLocation(e);\n this.setState({ isPressed: true });\n this.props.touchableHandleActivePressIn && this.props.touchableHandleActivePressIn(e);\n };\n\n private readonly _endHighlight = (e: IPressEvent) => {\n function _handler() {\n this.props.touchableHandleActivePressOut(e);\n }\n\n this.setState({ isPressed: false });\n if (this.props.touchableHandleActivePressOut) {\n if (this.props.touchableGetPressOutDelayMS && this.props.touchableGetPressOutDelayMS()) {\n this._pressOutDelayTimeout = setTimeout(_handler.bind(this), this.props.touchableGetPressOutDelayMS());\n } else {\n this.props.touchableHandleActivePressOut(e);\n }\n }\n };\n\n private readonly _onMouseEnter = () => {\n this.setState({ isHovered: true });\n this.props.onMouseEnter && this.props.onMouseEnter();\n };\n\n private readonly _onMouseLeave = () => {\n this.setState({ isHovered: false });\n this.props.onMouseLeave && this.props.onMouseLeave();\n };\n\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>) => {\n this.setState({ isFocused: true });\n this.props.onFocus && this.props.onFocus(ev);\n };\n\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>) => {\n this.setState({ isFocused: false });\n this.props.onBlur && this.props.onBlur(ev);\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n if (this._filterOnKey(ev)) {\n this.setState({ isKeyPressed: true });\n this.props.touchableHandleKeyPressDown && this.props.touchableHandleKeyPressDown(ev);\n }\n\n this.props.onKeyDown && this.props.onKeyDown(ev);\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n if (this._filterOnKey(ev)) {\n this.setState({ isKeyPressed: false });\n this.props.touchableHandleKeyPress && this.props.touchableHandleKeyPress(ev);\n }\n\n this.props.onKeyUp && this.props.onKeyUp(ev);\n };\n\n private readonly _deriveStateFromInternalState = (): ITouchableWin32State => {\n return {\n isPressed: this.state.isPressed || this.state.isKeyPressed,\n isHovered: this.state.isHovered,\n isFocused: this.state.isFocused,\n };\n }\n\n private readonly _filterOnKey = (ev: IKeyboardEvent): boolean => {\n if (this.props.filterKeys) {\n return this.props.filterKeys(ev.nativeEvent.key);\n }\n\n // Otherwise fall back to handling space and enter only\n return ev.nativeEvent.key === ' ' || ev.nativeEvent.key === 'Enter';\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TouchableWin32.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAgG;AAgBhG,MAAM,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEvC,MAAM,EAAC,cAAc,EAAC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAErE;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,CAAc;IACxC,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IACpC,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAClD,MAAM,UAAU,GA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CAAkC;YAC7D,QAAQ;YACR,YAAY,EAAE,IAAI,CAAC,aAAa,EAChC,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,QAAQ;YACR,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,yBAAyB;YACzB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,MAAM;YACN,GAAG,EAAE,IAAI,CAAC,YAAY;YACtB,QAAQ;YACR,KAAK,EAAE,aAAa,IAEnB,KAAK,CACI,CACb,CAAC;IACJ,CAAC;CAuWF;AA1bD,wCA0bC","sourcesContent":["/**\n * This is primarily a fork of React Native's Touchable Mixin.\n * It has been repurposed as it's own standalone control for win32,\n * as it needs to support a richer set of functionality on the desktop.\n * The touchable variants can be rewritten as wrappers around TouchableWin32\n * by passing the correct set of props down and managing state correctly.\n *\n * React Native's Touchable.js file (https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/Touchable.js)\n * provides an overview over how touchables work and interact with the gesture responder system.\n */\n'use strict';\n\nimport React from 'react'\nimport { NativeSyntheticEvent, StyleProp, UIManager, ViewStyle, ViewWin32 } from 'react-native';\n\nimport { ITouchableWin32Props, ITouchableWin32State } from './TouchableWin32.Props';\nimport {\n IChildAsFunction,\n IDimensions,\n IPosition,\n IPressEvent,\n IPressInLocation,\n ISignal,\n IState,\n IStateConditions,\n ITransitions,\n} from './TouchableWin32.Types';\nimport { IKeyboardEvent } from '../View/ViewPropTypes.win32';\n\nconst BoundingDimensions = require('./BoundingDimensions');\nconst Position = require('./Position');\n\nconst {findNodeHandle} = require('../../Renderer/shims/ReactNative');\n\n/**\n * Extracts a single touch, generally this is the active touch or touch that\n * has just ended\n * @param e - a press event containing information about the native event\n */\nfunction extractSingleTouch(e: IPressEvent) {\n const nativeEvent = e.nativeEvent;\n const touches = nativeEvent.touches;\n const changedTouches = nativeEvent.changedTouches;\n const hasTouches = touches && touches.length > 0;\n const hasChangedTouches = changedTouches && changedTouches.length > 0;\n\n return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;\n}\n\n/** Quick lookup maps for a variety of conditions */\nconst baseStatesCondition: IStateConditions = {\n NOT_RESPONDER: false,\n RESPONDER_INACTIVE_PRESS_IN: false,\n RESPONDER_INACTIVE_PRESS_OUT: false,\n RESPONDER_ACTIVE_PRESS_IN: false,\n RESPONDER_ACTIVE_PRESS_OUT: false,\n RESPONDER_ACTIVE_LONG_PRESS_IN: false,\n RESPONDER_ACTIVE_LONG_PRESS_OUT: false,\n ERROR: false,\n};\n\nconst IsActive: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_ACTIVE_PRESS_OUT: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n};\n\nconst IsPressingIn: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_INACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\nconst IsLongPressingIn: IStateConditions = {\n ...baseStatesCondition,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true,\n};\n\nconst transitions: ITransitions = {\n NOT_RESPONDER: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN',\n RESPONDER_RELEASE: 'ERROR',\n RESPONDER_TERMINATED: 'ERROR',\n ENTER_PRESS_RECT: 'ERROR',\n LEAVE_PRESS_RECT: 'ERROR',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_INACTIVE_PRESS_IN: {\n DELAY: 'RESPONDER_ACTIVE_PRESS_IN',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_INACTIVE_PRESS_OUT: {\n DELAY: 'RESPONDER_ACTIVE_PRESS_OUT',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_ACTIVE_PRESS_IN: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n },\n RESPONDER_ACTIVE_PRESS_OUT: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n RESPONDER_ACTIVE_LONG_PRESS_IN: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n },\n RESPONDER_ACTIVE_LONG_PRESS_OUT: {\n DELAY: 'ERROR',\n RESPONDER_GRANT: 'ERROR',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n LONG_PRESS_DETECTED: 'ERROR',\n },\n ERROR: {\n DELAY: 'NOT_RESPONDER',\n RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN',\n RESPONDER_RELEASE: 'NOT_RESPONDER',\n RESPONDER_TERMINATED: 'NOT_RESPONDER',\n ENTER_PRESS_RECT: 'NOT_RESPONDER',\n LEAVE_PRESS_RECT: 'NOT_RESPONDER',\n LONG_PRESS_DETECTED: 'NOT_RESPONDER',\n },\n};\n\n// Touchable maintains additional internal state to manage keypress interactions\n// This information is abstracted away when passed to children off the touchable\n// (function children) or styles. A keypressed state is equivalent to a normal\n// press state. If either a pointer, mouse, or special key (space/enter) is pressed\n// the touchable considers itself to be in a pressed state. Do note that key presses\n// will not invoke gesture responder hooksand are not subject to the passed in delays.\ninterface IInternalTouchableWin32State extends ITouchableWin32State {\n isKeyPressed: boolean;\n}\n\n/** Constants for integrating into UI Components */\nconst HIGHLIGHT_DELAY_MS = 130;\nconst PRESS_EXPAND_DIPS = 20; // Subject to change for win32 and desktop\nconst LONG_PRESS_THRESHOLD = 500;\nconst LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\nconst LONG_PRESS_ALLOWED_MOVEMENT = 10;\n\n/**\n * TouchableWin32 is a 'componentization' of the Touchable Mixin in React Native.\n * This means that instead of implementing components such as TouchableHighlight\n * via the mixin, they are merely implemented as wrappers around TouchableWin32,\n * forwarding the correct set of props. Additionally, TouchableWin32 supports hover\n * via onMouseEnter and onMouseLeave and focus/blur via onFocus/onBlur.\n * TouchableWin32 also allows for functions as child components (that use the internal\n * state of the touchable to conditionally render children) as well functions as styles\n * (that use internal state to conditionally calculate styles)\n */\nexport class TouchableWin32 extends React.Component<ITouchableWin32Props, IInternalTouchableWin32State> {\n private _longPressDelayTimeout: number;\n private _touchableDelayTimeout: number;\n private _pressOutDelayTimeout: number;\n private _pressInLocation: IPressInLocation;\n private _touchState: IState;\n private _responderID: number;\n private _positionOnActivate: IPosition;\n private _dimensionsOnActivate: IDimensions;\n\n private readonly _internalRef: React.RefObject<ViewWin32>\n\n constructor(props) {\n super(props);\n\n this.state = {\n isKeyPressed: false,\n isPressed: false,\n isFocused: false,\n isHovered: false,\n };\n\n this._internalRef = React.createRef<ViewWin32>();\n }\n\n public componentWillUnmount() {\n this._touchableDelayTimeout && clearTimeout(this._touchableDelayTimeout);\n this._longPressDelayTimeout && clearTimeout(this._longPressDelayTimeout);\n this._pressOutDelayTimeout && clearTimeout(this._pressOutDelayTimeout);\n }\n\n public render() {\n const { children, style, renderStyle, ...rest } = this.props;\n\n // The React Native touchables generally clone the child component\n // to apply additional styles to it. This approach allows children\n // to be passed in as functions (to be invoked with the current state),\n // it is handy for manipulating children as a result of the interaction\n // state (e.g. text color). A similar approach is taken for style\n let child: React.ReactNode;\n if (children) {\n child = typeof children === 'function' ?\n (children as IChildAsFunction<ITouchableWin32State>)(this._deriveStateFromInternalState()) : children;\n\n // Continue to enforce single child constraint\n child = React.Children.only(child);\n }\n\n let computedStyle: StyleProp<ViewStyle>;\n if (renderStyle) {\n computedStyle = renderStyle(this._deriveStateFromInternalState());\n } else if (style) {\n computedStyle = style;\n }\n\n return (\n <ViewWin32\n // Forward most of the props\n {...rest}\n // Hooks into Gesture Responder System\n onStartShouldSetResponder={this._touchableHandleStartShouldSetResponder}\n onResponderTerminationRequest={this._touchableHandleResponderTerminationRequest}\n onResponderGrant={this._touchableHandleResponderGrant}\n onResponderMove={this._touchableHandleResponderMove}\n onResponderRelease={this._touchableHandleResponderRelease}\n onResponderTerminate={this._touchableHandleResponderTerminate}\n // Hover\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n // Focus\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n // Key press interactions\n onKeyDown={this._onKeyDown}\n onKeyUp={this._onKeyUp}\n // Ref\n ref={this._internalRef}\n // Style\n style={computedStyle}\n >\n {child}\n </ViewWin32>\n );\n }\n\n public focus = () => {\n this._internalRef.current.focus();\n }\n\n /**\n * The rejectResponderTermination prop provides a way to accept/reject termination requests\n */\n private readonly _touchableHandleResponderTerminationRequest = (): boolean => {\n return !this.props.rejectResponderTermination;\n };\n\n /**\n * Only reject an opportunity to become the responder on bubble if disabled\n */\n private readonly _touchableHandleStartShouldSetResponder = (): boolean => {\n return !this.props.disabled;\n };\n\n /** TODO: Long press cancel as a prop may be a good idea */\n private readonly _touchableLongPressCancelsPress = (): boolean => {\n return true;\n };\n\n /**\n * On responder being granted, state and local data need to be set\n */\n private readonly _touchableHandleResponderGrant = (e: IPressEvent): void => {\n const dispatchID = findNodeHandle(e.currentTarget);\n e.persist();\n\n this._pressOutDelayTimeout && clearTimeout(this._pressOutDelayTimeout);\n this._pressOutDelayTimeout = null;\n\n this._touchState = 'NOT_RESPONDER';\n this._responderID = dispatchID;\n\n this._receiveSignal('RESPONDER_GRANT', e);\n let delayMS: number = this.props.touchableGetHighlightDelayMS\n ? Math.max(this.props.touchableGetHighlightDelayMS(), 0)\n : HIGHLIGHT_DELAY_MS;\n delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;\n\n if (delayMS !== 0) {\n this._touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);\n } else {\n this._handleDelay(e);\n }\n\n let longDelayMS: number = this.props.touchableGetLongPressDelayMS\n ? Math.max(this.props.touchableGetLongPressDelayMS(), 10)\n : LONG_PRESS_DELAY_MS;\n longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;\n this._longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);\n };\n\n /**\n * Handle responder release\n */\n private readonly _touchableHandleResponderRelease = (e: IPressEvent) => {\n this._pressInLocation = null;\n this._receiveSignal('RESPONDER_RELEASE', e);\n };\n\n /**\n * Handle responder terminate\n */\n private readonly _touchableHandleResponderTerminate = (e: IPressEvent) => {\n this._pressInLocation = null;\n this._receiveSignal('RESPONDER_TERMINATED', e);\n };\n\n /**\n * Handles move events\n */\n private readonly _touchableHandleResponderMove = (e: IPressEvent) => {\n if (!this._positionOnActivate) {\n return;\n }\n\n const positionOnActivate = this._positionOnActivate;\n const dimensionsOnActivate = this._dimensionsOnActivate;\n const pressRectOffset = this.props.touchableGetPressRectOffset\n ? this.props.touchableGetPressRectOffset()\n : {\n left: PRESS_EXPAND_DIPS,\n right: PRESS_EXPAND_DIPS,\n top: PRESS_EXPAND_DIPS,\n bottom: PRESS_EXPAND_DIPS,\n };\n\n let pressExpandLeft = pressRectOffset.left;\n let pressExpandTop = pressRectOffset.top;\n let pressExpandRight = pressRectOffset.right;\n let pressExpandBottom = pressRectOffset.bottom;\n\n // TODO implement touchableGetHitSlop natively\n const hitSlop = this.props.touchableGetHitSlop ? this.props.touchableGetHitSlop() : null;\n\n if (hitSlop) {\n pressExpandLeft += hitSlop.left || 0;\n pressExpandTop += hitSlop.top || 0;\n pressExpandRight += hitSlop.right || 0;\n pressExpandBottom += hitSlop.bottom || 0;\n }\n\n const touch = extractSingleTouch(e);\n const pageX = touch && touch.pageX;\n const pageY = touch && touch.pageY;\n\n if (this._pressInLocation) {\n const movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this._pressInLocation.pageX, this._pressInLocation.pageY);\n if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n this._cancelLongPressDelayTimeout();\n }\n }\n\n const isTouchWithinActive =\n pageX > positionOnActivate.left - pressExpandLeft &&\n pageY > positionOnActivate.top - pressExpandTop &&\n pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight &&\n pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;\n if (isTouchWithinActive) {\n const prevState = this._touchState;\n this._receiveSignal('ENTER_PRESS_RECT', e);\n const currState = this._touchState;\n if (currState === 'RESPONDER_INACTIVE_PRESS_IN' && prevState !== 'RESPONDER_INACTIVE_PRESS_IN') {\n this._cancelLongPressDelayTimeout();\n }\n } else {\n this._cancelLongPressDelayTimeout();\n this._receiveSignal('LEAVE_PRESS_RECT', e);\n }\n };\n\n /**\n * Used while performing side effects during state transitions,\n * to maintain proper bounding dimensions and positional information\n */\n private readonly _remeasureMetricsOnActivation = () => {\n const tag = this._responderID;\n if (tag === null) {\n return;\n }\n\n UIManager.measure(tag, this._handleQueryLayout);\n };\n\n /**\n * Callback into measure, see _remeasureMetricsOnActivation\n */\n private readonly _handleQueryLayout = (l: number, t: number, w: number, h: number, globalX: number, globalY: number) => {\n if (!l && !t && !w && !h && !globalX && !globalY) {\n return;\n }\n\n this._positionOnActivate = Position.getPooled(globalX, globalY);\n this._dimensionsOnActivate = BoundingDimensions.getPooled(w, h);\n };\n\n private readonly _handleDelay = (e: IPressEvent) => {\n this._touchableDelayTimeout = null;\n this._receiveSignal('DELAY', e);\n };\n\n private readonly _handleLongDelay = (e: IPressEvent) => {\n this._longPressDelayTimeout = null;\n const currState = this._touchState;\n\n if (currState !== 'RESPONDER_ACTIVE_PRESS_IN' && currState !== 'RESPONDER_ACTIVE_LONG_PRESS_IN') {\n const errorMessage =\n 'Attempted to transition from state ' +\n currState +\n ' to ' +\n 'RESPONDER_ACTIVE_LONG_PRESS_IN ' +\n 'which is not supported. This is most likely due to ' +\n 'Touchable.longPressDelayTimeout not being canceled.';\n console.error(errorMessage);\n } else {\n this._receiveSignal('LONG_PRESS_DETECTED', e);\n }\n };\n\n /**\n * Manages state transitions\n */\n private readonly _receiveSignal = (signal: ISignal, e: IPressEvent) => {\n const responderID = this._responderID;\n const currState = this._touchState;\n const nextState: IState = transitions[currState] ? transitions[currState][signal] : null;\n\n if (!nextState) {\n const errorMessage = 'Unrecognized signal ' + signal + ' or state ' + currState + ' for Touchable responder ' + responderID + '.';\n throw new Error(errorMessage);\n }\n if (nextState === 'ERROR') {\n const errorMessage = 'Touchable cannot transition from ' + currState + ' to ' + signal + ' for responder ' + responderID + '.';\n throw new Error(errorMessage);\n }\n\n if (currState !== nextState) {\n this._performSideEffectsForTransition(currState, nextState, signal, e);\n this._touchState = nextState;\n }\n };\n\n private readonly _cancelLongPressDelayTimeout = () => {\n this._longPressDelayTimeout && clearTimeout(this._longPressDelayTimeout);\n this._longPressDelayTimeout = null;\n };\n\n private readonly _isHighlight = (state: IState) => {\n return state === 'RESPONDER_ACTIVE_PRESS_IN' || state === 'RESPONDER_ACTIVE_LONG_PRESS_IN';\n };\n\n private readonly _savePressInLocation = (e: IPressEvent) => {\n const touch = extractSingleTouch(e);\n const pageX = touch && touch.pageX;\n const pageY = touch && touch.pageY;\n const locationX = touch && touch.locationX;\n const locationY = touch && touch.locationY;\n this._pressInLocation = { pageX, pageY, locationX, locationY };\n };\n\n private readonly _getDistanceBetweenPoints = (aX: number, aY: number, bX: number, bY: number): number => {\n const deltaX = aX - bX;\n const deltaY = aY - bY;\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n };\n\n /**\n * Any highlighting/visual effects is done here,\n * This is also where press callbacks are invoked from\n */\n // Existing high cyclomatic complexity\n \n private readonly _performSideEffectsForTransition = (currState: IState, nextState: IState, signal: ISignal, e: IPressEvent) => {\n const currIsHighlight = this._isHighlight(currState);\n const newIsHighlight = this._isHighlight(nextState);\n\n const isFinalSignal = signal === 'RESPONDER_TERMINATED' || signal === 'RESPONDER_RELEASE';\n\n if (isFinalSignal) {\n this._cancelLongPressDelayTimeout();\n }\n\n const isInitialTransition = currState === 'NOT_RESPONDER' && nextState === 'RESPONDER_INACTIVE_PRESS_IN';\n\n const isActiveTransition = !IsActive[currState] && IsActive[nextState];\n if (isInitialTransition || isActiveTransition) {\n this._remeasureMetricsOnActivation();\n }\n\n if (IsPressingIn[currState] && signal === 'LONG_PRESS_DETECTED') {\n this.props.touchableHandleLongPress && this.props.touchableHandleLongPress(e);\n }\n\n if (newIsHighlight && !currIsHighlight) {\n this._startHighlight(e);\n } else if (!newIsHighlight && currIsHighlight) {\n this._endHighlight(e);\n }\n\n if (IsPressingIn[currState] && signal === 'RESPONDER_RELEASE') {\n const hasLongPressHandler = !!this.props.onLongPress;\n const pressIsLongButStillCallOnPress = IsLongPressingIn[currState] && (!hasLongPressHandler || this._touchableLongPressCancelsPress);\n const shouldInvokePress = !IsLongPressingIn[currState] || pressIsLongButStillCallOnPress;\n\n if (shouldInvokePress && this.props.touchableHandlePress) {\n if (!newIsHighlight && !currIsHighlight) {\n // we never highlighted because of delay, but we should highlight now\n this._startHighlight(e);\n this._endHighlight(e);\n }\n\n this.props.touchableHandlePress(e);\n }\n }\n\n this._touchableDelayTimeout && clearTimeout(this._touchableDelayTimeout);\n this._touchableDelayTimeout = null;\n };\n\n private readonly _startHighlight = (e: IPressEvent) => {\n this._savePressInLocation(e);\n this.setState({ isPressed: true });\n this.props.touchableHandleActivePressIn && this.props.touchableHandleActivePressIn(e);\n };\n\n private readonly _endHighlight = (e: IPressEvent) => {\n function _handler() {\n this.props.touchableHandleActivePressOut(e);\n }\n\n this.setState({ isPressed: false });\n if (this.props.touchableHandleActivePressOut) {\n if (this.props.touchableGetPressOutDelayMS && this.props.touchableGetPressOutDelayMS()) {\n this._pressOutDelayTimeout = setTimeout(_handler.bind(this), this.props.touchableGetPressOutDelayMS());\n } else {\n this.props.touchableHandleActivePressOut(e);\n }\n }\n };\n\n private readonly _onMouseEnter = (mouseEvent) => {\n this.setState({ isHovered: true });\n this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);\n };\n\n private readonly _onMouseLeave = (mouseEvent) => {\n this.setState({ isHovered: false });\n this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);\n };\n\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>) => {\n this.setState({ isFocused: true });\n this.props.onFocus && this.props.onFocus(ev);\n };\n\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>) => {\n this.setState({ isFocused: false });\n this.props.onBlur && this.props.onBlur(ev);\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n if (this._filterOnKey(ev)) {\n this.setState({ isKeyPressed: true });\n this.props.touchableHandleKeyPressDown && this.props.touchableHandleKeyPressDown(ev);\n }\n\n this.props.onKeyDown && this.props.onKeyDown(ev);\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n if (this._filterOnKey(ev)) {\n this.setState({ isKeyPressed: false });\n this.props.touchableHandleKeyPress && this.props.touchableHandleKeyPress(ev);\n }\n\n this.props.onKeyUp && this.props.onKeyUp(ev);\n };\n\n private readonly _deriveStateFromInternalState = (): ITouchableWin32State => {\n return {\n isPressed: this.state.isPressed || this.state.isKeyPressed,\n isHovered: this.state.isHovered,\n isFocused: this.state.isFocused,\n };\n }\n\n private readonly _filterOnKey = (ev: IKeyboardEvent): boolean => {\n if (this.props.filterKeys) {\n return this.props.filterKeys(ev.nativeEvent.key);\n }\n\n // Otherwise fall back to handling space and enter only\n return ev.nativeEvent.key === ' ' || ev.nativeEvent.key === 'Enter';\n }\n}\n"]}
|
|
@@ -35,21 +35,40 @@ const UIView = {
|
|
|
35
35
|
collapsable: true,
|
|
36
36
|
needsOffscreenAlphaCompositing: true,
|
|
37
37
|
style: ReactNativeStyleAttributes,
|
|
38
|
-
// [
|
|
38
|
+
// [Win32
|
|
39
39
|
accessibilityAccessKey: true,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
accessibilityAnnotation: true,
|
|
41
|
+
accessibilityControls: true,
|
|
42
|
+
accessibilityDescribedBy: true,
|
|
43
|
+
accessibilityDescription: true,
|
|
44
|
+
accessibilityItemType: true,
|
|
45
|
+
accessibilityLevel: true,
|
|
46
|
+
accessibilityPositionInSet: true,
|
|
47
|
+
accessibilitySetSize: true,
|
|
48
|
+
animationClass: true,
|
|
42
49
|
cursor: true,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
draggedTypes: true,
|
|
51
|
+
enableFocusRing: true,
|
|
52
|
+
focusable: true,
|
|
53
|
+
keyDownEvents: true,
|
|
54
|
+
keyUpEvents: true,
|
|
55
|
+
onBlur: true,
|
|
56
|
+
onBlurCapture: true,
|
|
48
57
|
onDragEnter: true,
|
|
49
58
|
onDragLeave: true,
|
|
50
59
|
onDrop: true,
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
onFocus: true,
|
|
61
|
+
onFocusCapture: true,
|
|
62
|
+
onKeyDown: true,
|
|
63
|
+
onKeyDownCapture: true,
|
|
64
|
+
onKeyUp: true,
|
|
65
|
+
onKeyUpCapture: true,
|
|
66
|
+
onMouseEnter: true,
|
|
67
|
+
onMouseLeave: true,
|
|
68
|
+
tabIndex: true,
|
|
69
|
+
textStyle: true, // Once we flush out our JS theming story this property will no longer be needed
|
|
70
|
+
tooltip: true,
|
|
71
|
+
// Win32]
|
|
53
72
|
};
|
|
54
73
|
|
|
55
74
|
const RCTView = {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.examples = exports.description = exports.displayName = exports.title = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_native_1 = require("react-native");
|
|
9
|
-
const
|
|
9
|
+
const react_native_win32_1 = require("@office-iss/react-native-win32");
|
|
10
10
|
const styles = react_native_1.StyleSheet.create({
|
|
11
11
|
border: {
|
|
12
12
|
borderStyle: 'dotted',
|
|
@@ -27,42 +27,22 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
27
27
|
},
|
|
28
28
|
blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },
|
|
29
29
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
this._onBlur = () => {
|
|
48
|
-
this.setState({
|
|
49
|
-
hasFocus: false,
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
this.state = {
|
|
53
|
-
hasFocus: false,
|
|
54
|
-
};
|
|
55
|
-
this._labeledBy = react_1.default.createRef();
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
return (react_1.default.createElement(ViewWin32_1.ViewWin32, null,
|
|
59
|
-
react_1.default.createElement(ViewWin32_1.ViewWin32, { ref: this._labeledBy, accessibilityLabel: "separate label for test", accessibilityItemType: "Comment" }),
|
|
60
|
-
react_1.default.createElement(ViewWin32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
|
|
61
|
-
react_1.default.createElement(react_native_1.TouchableHighlight, { onPress: this._onPress },
|
|
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, enableFocusRing: false },
|
|
64
|
-
react_1.default.createElement(react_native_1.Text, null, this.state.hasFocus ? 'Focus: Yes' : 'Focus: No')))));
|
|
65
|
-
}
|
|
30
|
+
function FocusMoverTestComponent() {
|
|
31
|
+
const [hasFocus, setHasFocus] = react_1.default.useState(false);
|
|
32
|
+
const labelId = react_1.default.useId();
|
|
33
|
+
const ref = react_1.default.useRef(null);
|
|
34
|
+
const onBtnPress = () => {
|
|
35
|
+
if (ref.current) {
|
|
36
|
+
ref.current.focus();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, null,
|
|
40
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { nativeID: labelId, accessibilityLabel: "separate label for test", accessibilityItemType: "Comment" }),
|
|
41
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
|
|
42
|
+
react_1.default.createElement(react_native_1.TouchableHighlight, { onPress: onBtnPress },
|
|
43
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { accessibilityLabelledBy: labelId, style: styles.blackbox })),
|
|
44
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { ref: ref, focusable: true, style: hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }, onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), enableFocusRing: false },
|
|
45
|
+
react_1.default.createElement(react_native_1.Text, null, hasFocus ? 'Focus: Yes' : 'Focus: No')))));
|
|
66
46
|
}
|
|
67
47
|
const handledNativeKeyboardEvents = [
|
|
68
48
|
{ key: 'ArrowDown' },
|
|
@@ -97,13 +77,13 @@ class KeyboardTestComponent extends react_1.default.Component {
|
|
|
97
77
|
};
|
|
98
78
|
}
|
|
99
79
|
render() {
|
|
100
|
-
return (react_1.default.createElement(
|
|
101
|
-
react_1.default.createElement(
|
|
102
|
-
react_1.default.createElement(
|
|
80
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { keyDownEvents: handledNativeKeyboardEvents, keyUpEvents: handledNativeKeyboardEvents },
|
|
81
|
+
react_1.default.createElement(react_native_win32_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 },
|
|
82
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { style: styles.keyEnterVisualizer },
|
|
103
83
|
react_1.default.createElement(react_native_1.Text, null, "OnKeyDown"),
|
|
104
84
|
react_1.default.createElement(react_native_1.Text, null, "----"),
|
|
105
85
|
react_1.default.createElement(react_native_1.Text, null, this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' ')),
|
|
106
|
-
react_1.default.createElement(
|
|
86
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { style: styles.keyEnterVisualizer },
|
|
107
87
|
react_1.default.createElement(react_native_1.Text, null, "OnKeyUp"),
|
|
108
88
|
react_1.default.createElement(react_native_1.Text, null, "----"),
|
|
109
89
|
react_1.default.createElement(react_native_1.Text, null, this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' ')))));
|
|
@@ -123,12 +103,12 @@ class HoverTestComponent extends react_1.default.Component {
|
|
|
123
103
|
};
|
|
124
104
|
}
|
|
125
105
|
render() {
|
|
126
|
-
return (react_1.default.createElement(
|
|
106
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { onMouseEnter: this._onMouseEnter, onMouseLeave: this._onMouseLeave, style: this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox }));
|
|
127
107
|
}
|
|
128
108
|
}
|
|
129
109
|
class HoverExample extends react_1.default.Component {
|
|
130
110
|
render() {
|
|
131
|
-
return (react_1.default.createElement(
|
|
111
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' } },
|
|
132
112
|
react_1.default.createElement(HoverTestComponent, { color: "red" }),
|
|
133
113
|
react_1.default.createElement(HoverTestComponent, { color: "orange" }),
|
|
134
114
|
react_1.default.createElement(HoverTestComponent, { color: "yellow" }),
|
|
@@ -139,19 +119,19 @@ class HoverExample extends react_1.default.Component {
|
|
|
139
119
|
}
|
|
140
120
|
}
|
|
141
121
|
const ToolTipExample = () => {
|
|
142
|
-
return (react_1.default.createElement(
|
|
122
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
|
|
143
123
|
backgroundColor: 'red',
|
|
144
124
|
height: 100,
|
|
145
125
|
width: 100,
|
|
146
126
|
}, tooltip: "Example tooltip", cursor: "pointer" }));
|
|
147
127
|
};
|
|
148
128
|
const CursorTestComponent = (props) => {
|
|
149
|
-
return (react_1.default.createElement(
|
|
129
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'column' } },
|
|
150
130
|
react_1.default.createElement(react_native_1.Text, null, props.cursor),
|
|
151
|
-
react_1.default.createElement(
|
|
131
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { cursor: props.cursor, style: styles.blackbox })));
|
|
152
132
|
};
|
|
153
133
|
const CursorExample = () => {
|
|
154
|
-
return (react_1.default.createElement(
|
|
134
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', justifyContent: 'space-around' } },
|
|
155
135
|
react_1.default.createElement(CursorTestComponent, { cursor: 'auto' }),
|
|
156
136
|
react_1.default.createElement(CursorTestComponent, { cursor: 'default' }),
|
|
157
137
|
react_1.default.createElement(CursorTestComponent, { cursor: 'help' }),
|
|
@@ -183,14 +163,14 @@ class EnableFocusRingExample extends react_1.default.Component {
|
|
|
183
163
|
};
|
|
184
164
|
}
|
|
185
165
|
render() {
|
|
186
|
-
return (react_1.default.createElement(
|
|
187
|
-
react_1.default.createElement(
|
|
166
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 } },
|
|
167
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
|
|
188
168
|
backgroundColor: 'pink',
|
|
189
169
|
height: 100,
|
|
190
170
|
width: 100,
|
|
191
171
|
}, enableFocusRing: true, focusable: true },
|
|
192
172
|
react_1.default.createElement(react_native_1.Text, null, "enableFocusRing set to true")),
|
|
193
|
-
react_1.default.createElement(
|
|
173
|
+
react_1.default.createElement(react_native_win32_1.ViewWin32, { style: {
|
|
194
174
|
backgroundColor: 'pink',
|
|
195
175
|
height: 100,
|
|
196
176
|
width: 100,
|
|
@@ -208,7 +188,7 @@ exports.examples = [
|
|
|
208
188
|
title: 'focus() method example',
|
|
209
189
|
description: 'Each of these black boxes moves focus to the ViewWin32 on the right',
|
|
210
190
|
render() {
|
|
211
|
-
return (react_1.default.createElement(
|
|
191
|
+
return (react_1.default.createElement(react_native_win32_1.ViewWin32, null,
|
|
212
192
|
react_1.default.createElement(FocusMoverTestComponent, null),
|
|
213
193
|
react_1.default.createElement(FocusMoverTestComponent, null),
|
|
214
194
|
react_1.default.createElement(FocusMoverTestComponent, null)));
|
|
@@ -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,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,YAAY;QAC7B,cAAc,EAAE,cAAc;KAC/B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,EAAE;KACd;IACD,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE;CAC1E,CAAC,CAAC;AAMH,MAAM,uBAAwB,SAAQ,eAAK,CAAC,SAAuC;IAIjF,YAAmB,KAAK;QACtB,KAAK,CAAC,KAAK,CAAC,CAAC;QAJP,iBAAY,GAAc,IAAI,CAAC;QAiCtB,YAAO,GAAG,CAAC,GAA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import { 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"]}
|
|
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,uEAA0G;AAE1G,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,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,YAAY;QAC7B,cAAc,EAAE,cAAc;KAC/B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,EAAE;KACd;IACD,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE;CAC1E,CAAC,CAAC;AAMH,SAAS,uBAAuB;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,eAAK,CAAC,KAAK,EAAE,CAAC;IAE9B,MAAM,GAAG,GAAG,eAAK,CAAC,MAAM,CAAY,IAAI,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,GAAG,CAAC,OAAO,EAAE;YACf,GAAG,CAAC,OAAO,CAA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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 { Cursor, IKeyboardEvent, IHandledKeyboardEvent, ViewWin32 } from '@office-iss/react-native-win32';\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\nfunction FocusMoverTestComponent() {\n const [hasFocus, setHasFocus] = React.useState<boolean>(false);\n\n const labelId = React.useId();\n\n const ref = React.useRef<ViewWin32>(null);\n const onBtnPress = () => {\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n return (\n <ViewWin32>\n <ViewWin32 nativeID={labelId} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={onBtnPress}>\n <ViewWin32 accessibilityLabelledBy={labelId} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={ref}\n focusable\n style={hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n enableFocusRing={false}\n >\n <Text>{hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\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"]}
|