forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move and Rename custom propType definitions in LayoutPropTypes (faceb…
…ook#21370) Summary: related facebook#21342 TODO * move LayoutPropType.js * fix flow error CheckList - [x] `yarn prettier` - [x] `yarn flow-check-android` - [x] `yarn flow-check-ios` All flow checks pass. [GENERAL] [ENHANCEMENT] [DeprecatedLayoutPropTypes.js] - Created. [GENERAL] [ENHANCEMENT] [StyleSheetTypes.js] - add comments. Pull Request resolved: facebook#21370 Differential Revision: D10099715 Pulled By: RSNara fbshipit-source-id: d0515fe0d56d9ed2fde50cc0bfb75b63aded1f5d
- Loading branch information
1 parent
d6f3d37
commit b6b0fc1
Showing
5 changed files
with
566 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 190 additions & 0 deletions
190
Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow strict | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const ReactPropTypes = require('prop-types'); | ||
|
||
const LayoutPropTypes = { | ||
display: ReactPropTypes.oneOf(['none', 'flex']), | ||
width: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
height: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
start: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
end: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), | ||
top: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), | ||
left: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
right: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
bottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
minWidth: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
maxWidth: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
minHeight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
maxHeight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
margin: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginVertical: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginHorizontal: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginTop: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginBottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginLeft: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginRight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginStart: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginEnd: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
padding: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingVertical: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingHorizontal: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingTop: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingBottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingLeft: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingRight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingStart: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingEnd: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
borderWidth: ReactPropTypes.number, | ||
borderTopWidth: ReactPropTypes.number, | ||
borderStartWidth: ReactPropTypes.number, | ||
borderEndWidth: ReactPropTypes.number, | ||
borderRightWidth: ReactPropTypes.number, | ||
borderBottomWidth: ReactPropTypes.number, | ||
borderLeftWidth: ReactPropTypes.number, | ||
position: ReactPropTypes.oneOf(['absolute', 'relative']), | ||
flexDirection: ReactPropTypes.oneOf([ | ||
'row', | ||
'row-reverse', | ||
'column', | ||
'column-reverse', | ||
]), | ||
flexWrap: ReactPropTypes.oneOf(['wrap', 'nowrap', 'wrap-reverse']), | ||
justifyContent: ReactPropTypes.oneOf([ | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'space-between', | ||
'space-around', | ||
'space-evenly', | ||
]), | ||
alignItems: ReactPropTypes.oneOf([ | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'baseline', | ||
]), | ||
alignSelf: ReactPropTypes.oneOf([ | ||
'auto', | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'baseline', | ||
]), | ||
alignContent: ReactPropTypes.oneOf([ | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'space-between', | ||
'space-around', | ||
]), | ||
overflow: ReactPropTypes.oneOf(['visible', 'hidden', 'scroll']), | ||
flex: ReactPropTypes.number, | ||
flexGrow: ReactPropTypes.number, | ||
flexShrink: ReactPropTypes.number, | ||
flexBasis: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
aspectRatio: ReactPropTypes.number, | ||
zIndex: ReactPropTypes.number, | ||
direction: ReactPropTypes.oneOf(['inherit', 'ltr', 'rtl']), | ||
}; | ||
|
||
module.exports = LayoutPropTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.