From 5fe6a2526f73cbe6231b25a4b774734146b8c8ca Mon Sep 17 00:00:00 2001 From: Dan Gilbert Date: Tue, 2 Feb 2016 16:14:50 -0600 Subject: [PATCH] Revert "Remove min/max Width/Height in the docs" This reverts commit 2529179769ff7f24f9b91acc5417e19983958ff6. --- Libraries/StyleSheet/LayoutPropTypes.js | 4 ++++ React/Views/RCTShadowView.h | 4 ++++ React/Views/RCTShadowView.m | 4 ++++ React/Views/RCTViewManager.m | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Libraries/StyleSheet/LayoutPropTypes.js b/Libraries/StyleSheet/LayoutPropTypes.js index 95414b33929143..825db546cafbd2 100644 --- a/Libraries/StyleSheet/LayoutPropTypes.js +++ b/Libraries/StyleSheet/LayoutPropTypes.js @@ -27,7 +27,11 @@ var ReactPropTypes = require('ReactPropTypes'); */ var LayoutPropTypes = { width: ReactPropTypes.number, + maxWidth: ReactPropTypes.number, + minWidth: ReactPropTypes.number, height: ReactPropTypes.number, + maxHeight: ReactPropTypes.number, + minHeight: ReactPropTypes.number, top: ReactPropTypes.number, left: ReactPropTypes.number, right: ReactPropTypes.number, diff --git a/React/Views/RCTShadowView.h b/React/Views/RCTShadowView.h index 77875ca60261b2..3472123a6ea179 100644 --- a/React/Views/RCTShadowView.h +++ b/React/Views/RCTShadowView.h @@ -63,6 +63,10 @@ typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry @property (nonatomic, assign) CGFloat width; @property (nonatomic, assign) CGFloat height; +@property (nonatomic, assign) CGFloat minWidth; +@property (nonatomic, assign) CGFloat minHeight; +@property (nonatomic, assign) CGFloat maxWidth; +@property (nonatomic, assign) CGFloat maxHeight; @property (nonatomic, assign) CGRect frame; - (void)setTopLeft:(CGPoint)topLeft; diff --git a/React/Views/RCTShadowView.m b/React/Views/RCTShadowView.m index d55e80c624c96e..10409521d5552f 100644 --- a/React/Views/RCTShadowView.m +++ b/React/Views/RCTShadowView.m @@ -467,6 +467,10 @@ - (CGFloat)getProp \ RCT_DIMENSIONS_PROPERTY(Width, width, WIDTH, dimensions) RCT_DIMENSIONS_PROPERTY(Height, height, HEIGHT, dimensions) +RCT_DIMENSIONS_PROPERTY(MinWidth, minWidth, WIDTH, minDimensions) +RCT_DIMENSIONS_PROPERTY(MinHeight, minHeight, HEIGHT, minDimensions) +RCT_DIMENSIONS_PROPERTY(MaxWidth, maxWidth, WIDTH, maxDimensions) +RCT_DIMENSIONS_PROPERTY(MaxHeight, maxHeight, HEIGHT, maxDimensions) // Position diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index eef814a2bf7958..ae8381b29096a3 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -253,6 +253,10 @@ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(__unused NSDictio RCT_EXPORT_SHADOW_PROPERTY(width, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(height, CGFloat) +RCT_EXPORT_SHADOW_PROPERTY(minWidth, CGFloat) +RCT_EXPORT_SHADOW_PROPERTY(minHeight, CGFloat) +RCT_EXPORT_SHADOW_PROPERTY(maxWidth, CGFloat) +RCT_EXPORT_SHADOW_PROPERTY(maxHeight, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderTopWidth, CGFloat) RCT_EXPORT_SHADOW_PROPERTY(borderRightWidth, CGFloat)