2019-01-03 18:03:44 +08:00
|
|
|
|
//
|
|
|
|
|
|
// CRBoxInputCellProperty.h
|
|
|
|
|
|
// CaiShenYe
|
|
|
|
|
|
//
|
|
|
|
|
|
// Created by Chobits on 2019/1/3.
|
|
|
|
|
|
// Copyright © 2019 Chobits. All rights reserved.
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2019-06-11 13:44:48 +08:00
|
|
|
|
#import <CRBoxInputView/CRLineView.h>
|
2019-01-03 18:03:44 +08:00
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
2019-01-04 16:51:30 +08:00
|
|
|
|
typedef NS_ENUM(NSInteger, CRBoxSecurityType) {
|
2019-01-07 15:50:20 +08:00
|
|
|
|
CRBoxSecuritySymbolType,
|
|
|
|
|
|
CRBoxSecurityCustomViewType,
|
2019-01-04 16:51:30 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2019-06-10 20:10:20 +08:00
|
|
|
|
typedef UIView *_Nonnull(^CustomSecurityViewBlock)(void);
|
2019-06-10 22:19:50 +08:00
|
|
|
|
typedef CRLineView *_Nonnull(^CustomLineViewBlock)(void);
|
2019-06-10 23:34:10 +08:00
|
|
|
|
typedef void(^ConfigCellShadowBlock)(CALayer *layer);
|
2019-06-10 20:10:20 +08:00
|
|
|
|
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@interface CRBoxInputCellProperty : NSObject <NSCopying>
|
2019-01-03 18:03:44 +08:00
|
|
|
|
|
2019-06-11 12:01:21 +08:00
|
|
|
|
#pragma mark - UI
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell边框宽度
|
|
|
|
|
|
默认:0.5
|
|
|
|
|
|
*/
|
|
|
|
|
|
@property (assign, nonatomic) CGFloat borderWidth;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell边框颜色
|
|
|
|
|
|
状态:未选中状态时
|
|
|
|
|
|
默认:[UIColor colorWithRed:228/255.0 green:228/255.0 blue:228/255.0 alpha:1]
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *cellBorderColorNormal;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell边框颜色
|
|
|
|
|
|
状态:选中状态时
|
|
|
|
|
|
默认:[UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *cellBorderColorSelected;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell边框颜色
|
|
|
|
|
|
状态:无填充文字,未选中状态时
|
|
|
|
|
|
默认:与cellBorderColorFilled相同
|
|
|
|
|
|
*/
|
2019-03-20 13:53:56 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *__nullable cellBorderColorFilled;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell背景颜色
|
|
|
|
|
|
状态:无填充文字,未选中状态时
|
|
|
|
|
|
默认:[UIColor whiteColor]
|
|
|
|
|
|
*/
|
2019-01-07 12:56:47 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *cellBgColorNormal;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell背景颜色
|
|
|
|
|
|
状态:选中状态时
|
|
|
|
|
|
默认:[UIColor whiteColor]
|
|
|
|
|
|
*/
|
2019-01-07 12:56:47 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *cellBgColorSelected;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
cell背景颜色
|
|
|
|
|
|
状态:填充文字后,未选中状态时
|
|
|
|
|
|
默认:与cellBgColorFilled相同
|
|
|
|
|
|
*/
|
2019-03-20 13:53:56 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *__nullable cellBgColorFilled;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
光标颜色
|
|
|
|
|
|
默认: [UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
|
|
|
|
|
|
*/
|
|
|
|
|
|
@property (copy, nonatomic) UIColor *cellCursorColor;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
光标宽度
|
|
|
|
|
|
默认: 2
|
|
|
|
|
|
*/
|
2019-01-07 12:30:15 +08:00
|
|
|
|
@property (assign, nonatomic) CGFloat cellCursorWidth;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
光标高度
|
|
|
|
|
|
默认: 32
|
|
|
|
|
|
*/
|
2019-01-07 12:30:15 +08:00
|
|
|
|
@property (assign, nonatomic) CGFloat cellCursorHeight;
|
2019-06-11 12:01:21 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
圆角
|
|
|
|
|
|
默认: 4
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (assign, nonatomic) CGFloat cornerRadius;
|
2019-01-03 18:03:44 +08:00
|
|
|
|
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - line
|
|
|
|
|
|
/**
|
|
|
|
|
|
显示下划线
|
|
|
|
|
|
默认: NO
|
|
|
|
|
|
*/
|
|
|
|
|
|
@property (assign, nonatomic) BOOL showLine;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-11 12:01:21 +08:00
|
|
|
|
#pragma mark - label
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
字体/字号
|
|
|
|
|
|
默认:[UIFont systemFontOfSize:20];
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) UIFont *cellFont;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
字体颜色
|
|
|
|
|
|
默认:[UIColor blackColor];
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) UIColor *cellTextColor;
|
|
|
|
|
|
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
2019-06-10 22:47:05 +08:00
|
|
|
|
|
2019-06-11 12:01:21 +08:00
|
|
|
|
#pragma mark - Security
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
是否密文显示
|
|
|
|
|
|
默认:NO
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (assign, nonatomic) BOOL ifShowSecurity;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
密文符号
|
|
|
|
|
|
默认:✱
|
|
|
|
|
|
说明:只有ifShowSecurity=YES时,有效
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) NSString *securitySymbol;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
默认填充值
|
|
|
|
|
|
默认:空
|
|
|
|
|
|
说明:在输入框没有内容时,会显示该值。
|
|
|
|
|
|
*/
|
2019-01-04 15:28:43 +08:00
|
|
|
|
@property (copy, nonatomic) NSString *originValue;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
2019-07-16 12:08:48 +08:00
|
|
|
|
@property (strong, nonatomic) NSString *placeholderText;
|
|
|
|
|
|
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
密文类型
|
|
|
|
|
|
默认:CRBoxSecuritySymbolType
|
|
|
|
|
|
类型说明:
|
|
|
|
|
|
CRBoxSecuritySymbolType 符号类型,根据securitySymbol,originValue的内容来显示
|
|
|
|
|
|
CRBoxSecurityCustomViewType 自定义View类型,可以自定义密文状态下的图片,View
|
|
|
|
|
|
*/
|
2019-01-04 16:51:30 +08:00
|
|
|
|
@property (assign, nonatomic) CRBoxSecurityType securityType;
|
2019-01-04 20:07:30 +08:00
|
|
|
|
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
2019-06-11 12:01:21 +08:00
|
|
|
|
#pragma mark - Block
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
自定义密文View回调
|
|
|
|
|
|
*/
|
2019-06-10 20:10:20 +08:00
|
|
|
|
@property (copy, nonatomic) CustomSecurityViewBlock customSecurityViewBlock;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
自定义下划线回调
|
|
|
|
|
|
*/
|
2019-06-10 20:10:20 +08:00
|
|
|
|
@property (copy, nonatomic) CustomLineViewBlock customLineViewBlock;
|
2019-06-11 12:09:18 +08:00
|
|
|
|
/**
|
|
|
|
|
|
自定义阴影回调
|
|
|
|
|
|
*/
|
2019-06-11 08:23:33 +08:00
|
|
|
|
@property (copy, nonatomic) ConfigCellShadowBlock __nullable configCellShadowBlock;
|
2019-06-10 20:10:20 +08:00
|
|
|
|
|
2019-06-11 12:09:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
2019-06-11 12:01:21 +08:00
|
|
|
|
#pragma mark - Test
|
2019-01-04 20:07:30 +08:00
|
|
|
|
@property (assign, nonatomic) NSInteger index;
|
2019-01-03 18:03:44 +08:00
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|