@@ -11,6 +11,7 @@ public struct SignatureCaptureView<StartActionView: View, RestartActionView: Vie
1111 @Environment ( \. saveActionModifier) private var saveActionModifier
1212
1313 let _title : String ?
14+ let _mandatoryIndicator : String ?
1415 let _startAction : StartActionView
1516 let _restartAction : RestartActionView
1617 let _cancelAction : CancelActionView
@@ -19,36 +20,39 @@ public struct SignatureCaptureView<StartActionView: View, RestartActionView: Vie
1920 let _signatureImage : UIImage ?
2021 let _onSave : ( ( UIImage ) -> Void ) ?
2122 let _onDelete : ( ( ) -> Void ) ?
23+ var watermarkText : String ?
24+ var titleFont = Font . fiori ( forTextStyle: . subheadline) . weight ( . semibold)
25+ var xmarkColor = Color . preferredColor ( . quaternaryLabel)
2226 public private( set) var _heightDidChangePublisher = CurrentValueSubject < CGFloat , Never > ( 0 )
2327 var drawingViewBackgroundColor = Color . preferredColor ( . primaryBackground)
24- @State var currentDrawing = Drawing ( )
25- var cropsImage = false
2628 var isRequired = false
27- @State var isSaved = false
28- @State var isEditing = false
29- @State var fullSignatureImage : UIImage ?
30- let _drawingViewMinHeight : CGFloat = 256
29+ var indicatorColor = Color . preferredColor ( . primaryLabel)
30+ @State var currentDrawing = Drawing ( )
3131 var watermarkTextFont : UIFont = . preferredFont( forTextStyle: . caption1)
3232 var hidesSignatureLine = false
33- var titleFont = Font . fiori ( forTextStyle: . subheadline) . weight ( . semibold)
34- var timestampFormatter : DateFormatter ?
35- var _drawingViewMaxHeight : CGFloat ?
33+ @State var isEditing = false
34+ var hidesXmark = false
35+ @State var drawings = [ Drawing] ( )
36+ var cropsImage = false
37+ @State var isReenterTapped = false
38+ var strokeWidth : CGFloat = 3.0
39+ let _drawingViewMinHeight : CGFloat = 256
40+ var strokeColor = Color . preferredColor ( . primaryLabel)
3641 var titleColor = Color . preferredColor ( . primaryLabel)
42+ @State var fullSignatureImage : UIImage ?
43+ var signatureLineColor = Color . preferredColor ( . quaternaryLabel)
44+ var timestampFormatter : DateFormatter ?
3745 var addsTimestampInImage : Bool = false
38- var strokeColor = Color . preferredColor ( . primaryLabel)
39- @State var isReenterTapped = false
40- var watermarkText : String ?
46+ @State var isSaved = false
47+ var _drawingViewMaxHeight : CGFloat ?
4148 var appliesTintColorToImage = true
42- var hidesXmark = false
4349 var watermarkTextColor : Color = . preferredColor( . tertiaryLabel)
44- var signatureLineColor = Color . preferredColor ( . quaternaryLabel)
45- @State var drawings = [ Drawing] ( )
46- var strokeWidth : CGFloat = 3.0
47- var xmarkColor = Color . preferredColor ( . quaternaryLabel)
4850 var watermarkTextAlignment : NSTextAlignment = . natural
51+ var indicatorFont = Font . fiori ( forTextStyle: . subheadline) . weight ( . semibold)
4952
5053 private var isModelInit : Bool = false
5154 private var isTitleNil : Bool = false
55+ private var isMandatoryIndicatorNil : Bool = false
5256 private var isStartActionNil : Bool = false
5357 private var isRestartActionNil : Bool = false
5458 private var isCancelActionNil : Bool = false
@@ -60,6 +64,7 @@ public struct SignatureCaptureView<StartActionView: View, RestartActionView: Vie
6064
6165 public init (
6266 title: String ? = nil ,
67+ mandatoryIndicator: String ? = " * " ,
6368 @ViewBuilder startAction: ( ) -> StartActionView ,
6469 @ViewBuilder restartAction: ( ) -> RestartActionView ,
6570 @ViewBuilder cancelAction: ( ) -> CancelActionView ,
@@ -70,6 +75,7 @@ public struct SignatureCaptureView<StartActionView: View, RestartActionView: Vie
7075 onDelete: ( ( ) -> Void ) ? = nil
7176 ) {
7277 self . _title = title
78+ self . _mandatoryIndicator = mandatoryIndicator
7379 self . _startAction = startAction ( )
7480 self . _restartAction = restartAction ( )
7581 self . _cancelAction = cancelAction ( )
@@ -144,11 +150,12 @@ extension SignatureCaptureView where StartActionView == _ConditionalContent<_Act
144150 SaveActionView == _ConditionalContent < _Action , EmptyView > {
145151
146152 public init ( model: SignatureCaptureViewModel ) {
147- self . init ( title: model. title, startAction: model. startAction != nil ? _Action ( model: model. startAction!) : nil , restartAction: model. restartAction != nil ? _Action ( model: model. restartAction!) : nil , cancelAction: model. cancelAction != nil ? _Action ( model: model. cancelAction!) : nil , clearAction: model. clearAction != nil ? _Action ( model: model. clearAction!) : nil , saveAction: model. saveAction != nil ? _Action ( model: model. saveAction!) : nil , signatureImage: model. signatureImage, onSave: model. onSave, onDelete: model. onDelete)
153+ self . init ( title: model. title, mandatoryIndicator : model . mandatoryIndicator , startAction: model. startAction != nil ? _Action ( model: model. startAction!) : nil , restartAction: model. restartAction != nil ? _Action ( model: model. restartAction!) : nil , cancelAction: model. cancelAction != nil ? _Action ( model: model. cancelAction!) : nil , clearAction: model. clearAction != nil ? _Action ( model: model. clearAction!) : nil , saveAction: model. saveAction != nil ? _Action ( model: model. saveAction!) : nil , signatureImage: model. signatureImage, onSave: model. onSave, onDelete: model. onDelete)
148154 }
149155
150- public init ( title: String ? = nil , startAction: _Action ? = _Action ( model: _TapToSignActionDefault ( ) ) , restartAction: _Action ? = _Action ( model: _ReEnterSignatureActionDefault ( ) ) , cancelAction: _Action ? = _Action ( model: _CancelActionDefault ( ) ) , clearAction: _Action ? = _Action ( model: _ClearActionDefault ( ) ) , saveAction: _Action ? = _Action ( model: _SaveActionDefault ( ) ) , signatureImage: UIImage ? = nil , onSave: ( ( UIImage ) -> Void ) ? = nil , onDelete: ( ( ) -> Void ) ? = nil ) {
156+ public init ( title: String ? = nil , mandatoryIndicator : String ? = " * " , startAction: _Action ? = _Action ( model: _TapToSignActionDefault ( ) ) , restartAction: _Action ? = _Action ( model: _ReEnterSignatureActionDefault ( ) ) , cancelAction: _Action ? = _Action ( model: _CancelActionDefault ( ) ) , clearAction: _Action ? = _Action ( model: _ClearActionDefault ( ) ) , saveAction: _Action ? = _Action ( model: _SaveActionDefault ( ) ) , signatureImage: UIImage ? = nil , onSave: ( ( UIImage ) -> Void ) ? = nil , onDelete: ( ( ) -> Void ) ? = nil ) {
151157 self . _title = title
158+ self . _mandatoryIndicator = mandatoryIndicator
152159 self . _startAction = startAction != nil ? ViewBuilder . buildEither ( first: startAction!) : ViewBuilder . buildEither ( second: EmptyView ( ) )
153160 self . _restartAction = restartAction != nil ? ViewBuilder . buildEither ( first: restartAction!) : ViewBuilder . buildEither ( second: EmptyView ( ) )
154161 self . _cancelAction = cancelAction != nil ? ViewBuilder . buildEither ( first: cancelAction!) : ViewBuilder . buildEither ( second: EmptyView ( ) )
@@ -160,6 +167,7 @@ extension SignatureCaptureView where StartActionView == _ConditionalContent<_Act
160167
161168 isModelInit = true
162169 isTitleNil = title == nil ? true : false
170+ isMandatoryIndicatorNil = mandatoryIndicator == nil ? true : false
163171 isStartActionNil = startAction == nil ? true : false
164172 isRestartActionNil = restartAction == nil ? true : false
165173 isCancelActionNil = cancelAction == nil ? true : false
0 commit comments