ActionModelProtocol
This commit is contained in:
parent
117c112b6b
commit
4d155b9f97
@ -22,13 +22,13 @@ public class ButtonModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "button"
|
||||
public var backgroundColor: Color?
|
||||
public var title: String
|
||||
public var action: ActionProtocol
|
||||
public var action: ActionModelProtocol
|
||||
public var style: ButtonStyle?
|
||||
public var size: ButtonSize? = .standard
|
||||
public var required: Bool?
|
||||
public var requiredGroups: [String]?
|
||||
|
||||
init(with title: String, action: ActionProtocol) {
|
||||
init(with title: String, action: ActionModelProtocol) {
|
||||
self.title = title
|
||||
self.action = action
|
||||
}
|
||||
|
||||
@ -13,12 +13,12 @@ public class CaretLinkModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "caretLink"
|
||||
public var backgroundColor: Color?
|
||||
public var title: String
|
||||
public var action: ActionProtocol
|
||||
public var action: ActionModelProtocol
|
||||
public var enabledColor: Color = Color(uiColor: .black)
|
||||
public var disabledColor: Color? = Color(uiColor: .mfSilver())
|
||||
public var enabled: Bool = true
|
||||
|
||||
public init(title: String, action: ActionProtocol) {
|
||||
public init(title: String, action: ActionModelProtocol) {
|
||||
self.title = title
|
||||
self.action = action
|
||||
}
|
||||
|
||||
@ -12,11 +12,11 @@ public class LinkModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "link"
|
||||
public var backgroundColor: Color?
|
||||
public var title: String
|
||||
public var action: ActionProtocol
|
||||
public var action: ActionModelProtocol
|
||||
public var enabled = true
|
||||
public var textColor = Color(uiColor: .mfTextButton())
|
||||
|
||||
public init(title: String, action: ActionProtocol) {
|
||||
public init(title: String, action: ActionModelProtocol) {
|
||||
self.title = title
|
||||
self.action = action
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
|
||||
public extension MFCustomButton {
|
||||
func set(with action: ActionProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
func set(with action: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
buttonDelegate = delegateObject?.buttonDelegate
|
||||
add({ [weak self] sender in
|
||||
guard let self = self else { return }
|
||||
|
||||
@ -12,7 +12,7 @@ class LabelAttributeActionModel: LabelAttributeModel {
|
||||
override public class var identifier: String {
|
||||
return "action"
|
||||
}
|
||||
var action: ActionProtocol
|
||||
var action: ActionModelProtocol
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
@ -13,7 +13,7 @@ public class ToggleModel: MoleculeModelProtocol {
|
||||
public var moleculeName: String?
|
||||
public var backgroundColor: Color?
|
||||
public var state: Bool = true
|
||||
public var action: ActionProtocol?
|
||||
public var action: ActionModelProtocol?
|
||||
public var required: Bool?
|
||||
public var fieldKey: String?
|
||||
|
||||
|
||||
@ -10,14 +10,14 @@ import Foundation
|
||||
|
||||
public protocol ListItemModelProtocol: ContainerModelProtocol, MoleculeModelProtocol {
|
||||
var line: LineModel? { get set }
|
||||
var action: ActionProtocol? { get set }
|
||||
var action: ActionModelProtocol? { get set }
|
||||
var hideArrow: Bool? { get set }
|
||||
var style: String? { get set }
|
||||
}
|
||||
|
||||
// Not a strict requirement.
|
||||
extension ListItemModelProtocol {
|
||||
public var action: ActionProtocol? {
|
||||
public var action: ActionModelProtocol? {
|
||||
get {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import MVMCore
|
||||
@objcMembers public class ListItemModel: MoleculeContainerModel, ListItemModelProtocol {
|
||||
public static var identifier: String = "listItem"
|
||||
public var backgroundColor: Color?
|
||||
public var action: ActionProtocol?
|
||||
public var action: ActionModelProtocol?
|
||||
public var hideArrow: Bool?
|
||||
public var line: LineModel?
|
||||
public var style: String? = "standard"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user