mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
<Text> module add textDecoration style attributes
Summary: This is simply a rebased and squashed version of @KJlmfe's PR over at https://github.com/facebook/react-native/pull/845 It was actually already squashed into one commit, but for some reason that was hard to see from the original PR. Closes https://github.com/facebook/react-native/pull/1869 Github Author: KJlmfe <kjlmfe@gmail.com>
This commit is contained in:
@@ -12,10 +12,12 @@
|
||||
|
||||
#import "Layout.h"
|
||||
#import "RCTAnimationType.h"
|
||||
#import "RCTTextDecorationLineType.h"
|
||||
#import "RCTDefines.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTPointerEvents.h"
|
||||
|
||||
|
||||
/**
|
||||
* This class provides a collection of conversion functions for mapping
|
||||
* JSON objects to native types and classes. These are useful when writing
|
||||
@@ -54,6 +56,7 @@ typedef NSURL RCTFileURL;
|
||||
+ (NSTimeInterval)NSTimeInterval:(id)json;
|
||||
|
||||
+ (NSTextAlignment)NSTextAlignment:(id)json;
|
||||
+ (NSUnderlineStyle)NSUnderlineStyle:(id)json;
|
||||
+ (NSWritingDirection)NSWritingDirection:(id)json;
|
||||
+ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json;
|
||||
+ (UITextFieldViewMode)UITextFieldViewMode:(id)json;
|
||||
@@ -126,6 +129,7 @@ typedef BOOL css_clip_t;
|
||||
|
||||
+ (RCTPointerEvents)RCTPointerEvents:(id)json;
|
||||
+ (RCTAnimationType)RCTAnimationType:(id)json;
|
||||
+ (RCTTextDecorationLineType)RCTTextDecorationLineType:(id)json;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -216,6 +216,20 @@ RCT_ENUM_CONVERTER(NSTextAlignment, (@{
|
||||
@"justify": @(NSTextAlignmentJustified),
|
||||
}), NSTextAlignmentNatural, integerValue)
|
||||
|
||||
RCT_ENUM_CONVERTER(NSUnderlineStyle, (@{
|
||||
@"solid": @(NSUnderlineStyleSingle),
|
||||
@"double": @(NSUnderlineStyleDouble),
|
||||
@"dotted": @(NSUnderlinePatternDot | NSUnderlineStyleSingle),
|
||||
@"dashed": @(NSUnderlinePatternDash | NSUnderlineStyleSingle),
|
||||
}), NSUnderlineStyleSingle, integerValue)
|
||||
|
||||
RCT_ENUM_CONVERTER(RCTTextDecorationLineType, (@{
|
||||
@"none": @(RCTTextDecorationLineTypeNone),
|
||||
@"underline": @(RCTTextDecorationLineTypeUnderline),
|
||||
@"line-through": @(RCTTextDecorationLineTypeStrikethrough),
|
||||
@"underline line-through": @(RCTTextDecorationLineTypeUnderlineStrikethrough),
|
||||
}), RCTTextDecorationLineTypeNone, integerValue)
|
||||
|
||||
RCT_ENUM_CONVERTER(NSWritingDirection, (@{
|
||||
@"auto": @(NSWritingDirectionNatural),
|
||||
@"ltr": @(NSWritingDirectionLeftToRight),
|
||||
|
||||
Reference in New Issue
Block a user