updating notification reset components
This commit is contained in:
parent
cc3d65bd0b
commit
d04f138da4
@ -8,6 +8,9 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
445BA07829C07B3D0036A7C5 /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 445BA07729C07B3D0036A7C5 /* Notification.swift */; };
|
||||
44604AD029CE17EC00E62B51 /* NotificationTitleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44604ACF29CE17EC00E62B51 /* NotificationTitleModel.swift */; };
|
||||
44604AD229CE180F00E62B51 /* NotificationSubTitleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44604AD129CE180F00E62B51 /* NotificationSubTitleModel.swift */; };
|
||||
44604AD429CE186A00E62B51 /* NotificationButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44604AD329CE186A00E62B51 /* NotificationButtonModel.swift */; };
|
||||
5F21D7BF28DCEB3D003E7CD6 /* Useable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F21D7BE28DCEB3D003E7CD6 /* Useable.swift */; };
|
||||
5FC35BE328D51405004EBEAC /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC35BE228D51405004EBEAC /* Button.swift */; };
|
||||
EA0FC2C62914222900DF80B4 /* ButtonGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0FC2C52914222900DF80B4 /* ButtonGroup.swift */; };
|
||||
@ -122,6 +125,9 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
445BA07729C07B3D0036A7C5 /* Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notification.swift; sourceTree = "<group>"; };
|
||||
44604ACF29CE17EC00E62B51 /* NotificationTitleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationTitleModel.swift; sourceTree = "<group>"; };
|
||||
44604AD129CE180F00E62B51 /* NotificationSubTitleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSubTitleModel.swift; sourceTree = "<group>"; };
|
||||
44604AD329CE186A00E62B51 /* NotificationButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationButtonModel.swift; sourceTree = "<group>"; };
|
||||
5F21D7BE28DCEB3D003E7CD6 /* Useable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Useable.swift; sourceTree = "<group>"; };
|
||||
5FC35BE228D51405004EBEAC /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = "<group>"; };
|
||||
EA0FC2C52914222900DF80B4 /* ButtonGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonGroup.swift; sourceTree = "<group>"; };
|
||||
@ -251,6 +257,9 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
445BA07729C07B3D0036A7C5 /* Notification.swift */,
|
||||
44604ACF29CE17EC00E62B51 /* NotificationTitleModel.swift */,
|
||||
44604AD129CE180F00E62B51 /* NotificationSubTitleModel.swift */,
|
||||
44604AD329CE186A00E62B51 /* NotificationButtonModel.swift */,
|
||||
);
|
||||
path = Notification;
|
||||
sourceTree = "<group>";
|
||||
@ -775,6 +784,7 @@
|
||||
EA33622E2891EA3C0071C351 /* DispatchQueue+Once.swift in Sources */,
|
||||
EA4DB2FD28D3D0CA00103EE3 /* AnyEquatable.swift in Sources */,
|
||||
EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */,
|
||||
44604AD029CE17EC00E62B51 /* NotificationTitleModel.swift in Sources */,
|
||||
EA5E305A29510F8B0082B959 /* EnumSubset.swift in Sources */,
|
||||
EA985BF7296C665E00F2FF2E /* IconName.swift in Sources */,
|
||||
EAF7F0AF289B144C00B287F5 /* UnderlineLabelAttribute.swift in Sources */,
|
||||
@ -801,6 +811,7 @@
|
||||
EAF7F13328A2A16500B287F5 /* AttachmentLabelAttributeModel.swift in Sources */,
|
||||
EA0FC2C62914222900DF80B4 /* ButtonGroup.swift in Sources */,
|
||||
EA89200628B526D6006B9984 /* CheckboxGroup.swift in Sources */,
|
||||
44604AD429CE186A00E62B51 /* NotificationButtonModel.swift in Sources */,
|
||||
EAD8D2C128BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift in Sources */,
|
||||
EAF7F0B9289C139800B287F5 /* ColorConfiguration.swift in Sources */,
|
||||
EA3361BD288B2C760071C351 /* TypeAlias.swift in Sources */,
|
||||
@ -808,6 +819,7 @@
|
||||
EAF7F09A2899B17200B287F5 /* CATransaction.swift in Sources */,
|
||||
EAF7F0A2289AFB3900B287F5 /* Errorable.swift in Sources */,
|
||||
EA985C7D297DAED300F2FF2E /* Primitive.swift in Sources */,
|
||||
44604AD229CE180F00E62B51 /* NotificationSubTitleModel.swift in Sources */,
|
||||
EAB5FEF829393A7200998C17 /* ButtonGroupConstants.swift in Sources */,
|
||||
EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */,
|
||||
EA5E3058295105A40082B959 /* Tilelet.swift in Sources */,
|
||||
|
||||
@ -12,16 +12,7 @@ import VDSColorTokens
|
||||
@objc(VDSNotification)
|
||||
/// A VDS Component that will render a view with information
|
||||
public class Notification: View {
|
||||
|
||||
public struct ButtonModel {
|
||||
public var text: String
|
||||
public var onClick: (Button) -> ()
|
||||
public init(text: String, onClick: @escaping (Button) -> Void) {
|
||||
self.text = text
|
||||
self.onClick = onClick
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Enums
|
||||
//--------------------------------------------------
|
||||
@ -95,8 +86,7 @@ public class Notification: View {
|
||||
open var buttonsView = ButtonGroup().with {
|
||||
$0.buttonPosition = .left
|
||||
}
|
||||
|
||||
#warning("we want to add only the things that are needed, everything else should be hidden, meaning don't access controls directly")
|
||||
|
||||
//Text
|
||||
open var titleText: String? { didSet{didChange()}}
|
||||
|
||||
@ -183,6 +173,13 @@ public class Notification: View {
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
|
||||
titleLabel.reset()
|
||||
subTitleLabel.reset()
|
||||
buttonsView.reset()
|
||||
primaryButton.reset()
|
||||
secondaryButton.reset()
|
||||
|
||||
type = .info
|
||||
typeIcon.name = .infoBold
|
||||
closeButton.name = .close
|
||||
@ -267,37 +264,5 @@ public class Notification: View {
|
||||
func didClickOnCloseButton() {
|
||||
print("Notification close button clicked!!!")
|
||||
}
|
||||
|
||||
///Temporary Place holder
|
||||
public struct TitleModel {
|
||||
public var text: String
|
||||
public var textAttributes: [any LabelAttributeModel]?
|
||||
public var textStyle: TextStyle = .boldBodySmall
|
||||
public var numberOfLines: Int
|
||||
|
||||
public init(text: String,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
numberOfLines: Int = 0) {
|
||||
self.text = text
|
||||
self.textAttributes = textAttributes
|
||||
self.numberOfLines = numberOfLines
|
||||
}
|
||||
}
|
||||
|
||||
public struct SubTitleModel {
|
||||
public var text: String
|
||||
public var textAttributes: [any LabelAttributeModel]?
|
||||
public var textStyle: TextStyle = .bodySmall
|
||||
public var numberOfLines: Int
|
||||
|
||||
public init(text: String,
|
||||
textColor: Use = .primary,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
numberOfLines: Int = 0) {
|
||||
self.text = text
|
||||
self.textAttributes = textAttributes
|
||||
self.numberOfLines = numberOfLines
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
VDS/Components/Notification/NotificationButtonModel.swift
Normal file
19
VDS/Components/Notification/NotificationButtonModel.swift
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// NotificationButtonModel.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Nadigadda, Sumanth on 24/03/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Notification {
|
||||
public struct ButtonModel {
|
||||
public var text: String
|
||||
public var onClick: (Button) -> ()
|
||||
public init(text: String, onClick: @escaping (Button) -> Void) {
|
||||
self.text = text
|
||||
self.onClick = onClick
|
||||
}
|
||||
}
|
||||
}
|
||||
26
VDS/Components/Notification/NotificationSubTitleModel.swift
Normal file
26
VDS/Components/Notification/NotificationSubTitleModel.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// NotificationSubTitleModel.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Nadigadda, Sumanth on 24/03/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Notification {
|
||||
public struct SubTitleModel {
|
||||
public var text: String
|
||||
public var textAttributes: [any LabelAttributeModel]?
|
||||
public var textStyle: TextStyle = .bodySmall
|
||||
public var numberOfLines: Int
|
||||
|
||||
public init(text: String,
|
||||
textColor: Use = .primary,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
numberOfLines: Int = 0) {
|
||||
self.text = text
|
||||
self.textAttributes = textAttributes
|
||||
self.numberOfLines = numberOfLines
|
||||
}
|
||||
}
|
||||
}
|
||||
25
VDS/Components/Notification/NotificationTitleModel.swift
Normal file
25
VDS/Components/Notification/NotificationTitleModel.swift
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// NotificationTitleModel.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Nadigadda, Sumanth on 24/03/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Notification {
|
||||
public struct TitleModel {
|
||||
public var text: String
|
||||
public var textAttributes: [any LabelAttributeModel]?
|
||||
public var textStyle: TextStyle = .boldBodySmall
|
||||
public var numberOfLines: Int
|
||||
|
||||
public init(text: String,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
numberOfLines: Int = 0) {
|
||||
self.text = text
|
||||
self.textAttributes = textAttributes
|
||||
self.numberOfLines = numberOfLines
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user