added more propeties

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-11 12:00:54 -05:00
parent 9e9a1ab853
commit c7a4bf72c3
2 changed files with 12 additions and 5 deletions

View File

@ -124,6 +124,8 @@ class TextViewEntryField: VDS.TextArea, VDSMoleculeViewProtocol, ObservingTextFi
isReadOnly = viewModel.readOnly
isRequired = viewModel.required
tooltipModel = viewModel.tooltip?.toVDSTooltipModel()
width = viewModel.width
transparentBackground = viewModel.transparentBackground
uiTextViewDelegate = delegateObject?.uiTextViewDelegate
observingTextViewDelegate = delegateObject?.observingTextFieldDelegate

View File

@ -20,7 +20,9 @@ class TextViewEntryFieldModel: TextEntryFieldModel {
public var editable: Bool = true
public var showsPlaceholder: Bool = false
public var tooltip: TooltipModel?
public var transparentBackground: Bool = false
public var width: CGFloat?
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
@ -29,6 +31,8 @@ class TextViewEntryFieldModel: TextEntryFieldModel {
case accessibilityText
case editable
case tooltip
case transparentBackground
case width
}
//--------------------------------------------------
@ -39,12 +43,11 @@ class TextViewEntryFieldModel: TextEntryFieldModel {
try super.init(from: decoder)
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
if let editable = try typeContainer.decodeIfPresent(Bool.self, forKey: .editable) {
self.editable = editable
}
editable = try typeContainer.decodeIfPresent(Bool.self, forKey: .editable) ?? true
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
tooltip = try typeContainer.decodeIfPresent(TooltipModel.self, forKey: .tooltip)
transparentBackground = try typeContainer.decodeIfPresent(Bool.self, forKey: .transparentBackground) ?? false
width = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .width)
}
public override func encode(to encoder: Encoder) throws {
@ -53,5 +56,7 @@ class TextViewEntryFieldModel: TextEntryFieldModel {
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
try container.encode(editable, forKey: .editable)
try container.encodeIfPresent(tooltip, forKey: .tooltip)
try container.encode(transparentBackground, forKey: .transparentBackground)
try container.encodeIfPresent(width, forKey: .width)
}
}