mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 13:01:13 +00:00
7060141247
- [ReactNative] Move merge & mergeInto from downstream to vendor | Christopher Chedeau - [ReactNative] Replace all the call sites of mergeInto by Object.assign | Christopher Chedeau - [WIP] Migrated View Managers over to new architecture | Nick Lockwood - [ReactNative] Replace all the call sites of copyProperties by Object.assign | Christopher Chedeau - [ReactNative] Migrate navigator.geolocation to open source | Christopher Chedeau - [ReactNative] Remove README.md, LICENSE and .travis.yml from fbobjc | Christopher Chedeau - [react-packager] Better transform errors | Amjad Masad - [React Native][react-packager] Fix test runner and fialing tests | Amjad Masad
50 lines
1.5 KiB
Objective-C
50 lines
1.5 KiB
Objective-C
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#import "RCTTextFieldManager.h"
|
|
|
|
#import "RCTConvert.h"
|
|
#import "RCTShadowView.h"
|
|
#import "RCTSparseArray.h"
|
|
#import "RCTTextField.h"
|
|
|
|
@implementation RCTTextFieldManager
|
|
|
|
- (UIView *)view
|
|
{
|
|
return [[RCTTextField alloc] initWithEventDispatcher:self.eventDispatcher];
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(caretHidden)
|
|
RCT_EXPORT_VIEW_PROPERTY(autoCorrect)
|
|
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType)
|
|
RCT_EXPORT_VIEW_PROPERTY(enabled)
|
|
RCT_EXPORT_VIEW_PROPERTY(placeholder)
|
|
RCT_EXPORT_VIEW_PROPERTY(text)
|
|
RCT_EXPORT_VIEW_PROPERTY(font)
|
|
RCT_EXPORT_VIEW_PROPERTY(clearButtonMode)
|
|
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
|
|
RCT_REMAP_VIEW_PROPERTY(color, textColor)
|
|
RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField *)
|
|
{
|
|
view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
|
|
}
|
|
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField *)
|
|
{
|
|
view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO
|
|
}
|
|
RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField *)
|
|
{
|
|
view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName];
|
|
}
|
|
|
|
- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView
|
|
{
|
|
NSNumber *reactTag = shadowView.reactTag;
|
|
UIEdgeInsets padding = shadowView.paddingAsInsets;
|
|
return ^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
|
((RCTTextField *)viewRegistry[reactTag]).paddingEdgeInsets = padding;
|
|
};
|
|
}
|
|
|
|
@end
|