Browse Source

【2025】【组件库】Alert组件补充

niehaoyu 2 months ago
parent
commit
bc5282ffdf

+ 2 - 2
PDF Office/KMComponentLibrary/KMComponentLibrary.xcodeproj/project.pbxproj

@@ -715,8 +715,8 @@
 		BB5A9BFB2CB64D4700F64C1F /* Notification */ = {
 			isa = PBXGroup;
 			children = (
-				BB5A9BFC2CB64D4700F64C1F /* ComponentNotification.xib */,
 				BB5A9BFD2CB64D4700F64C1F /* ComponentNotification.swift */,
+				BB5A9BFC2CB64D4700F64C1F /* ComponentNotification.xib */,
 				BB5A9BFE2CB64D4700F64C1F /* ComponentNotificationProperty.swift */,
 			);
 			path = Notification;
@@ -725,9 +725,9 @@
 		BB5A9BFF2CB64D4700F64C1F /* Alert */ = {
 			isa = PBXGroup;
 			children = (
+				BB5A9C022CB64D4700F64C1F /* ComponentAlertProperty.swift */,
 				BB5A9C002CB64D4700F64C1F /* ComponentAlert.swift */,
 				BB5A9C012CB64D4700F64C1F /* ComponentAlert.xib */,
-				BB5A9C022CB64D4700F64C1F /* ComponentAlertProperty.swift */,
 			);
 			path = Alert;
 			sourceTree = "<group>";

+ 4 - 0
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Alert/ComponentAlert.swift

@@ -115,6 +115,10 @@ public class ComponentAlert: ComponentBaseXibView {
             self.iconImage.image = ComponentLibrary.shared.image(forResource: "message_warning")
         } else if self.properties.messageType == .error {
             self.iconImage.image = ComponentLibrary.shared.image(forResource: "message_error")
+        } else if properties.messageType == .normal_custom {
+            if let iconImage = properties.iconImage {
+                self.iconImage.image = iconImage
+            }
         }
         
         self.configSubViewsUI()

+ 3 - 0
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Alert/ComponentAlertProperty.swift

@@ -13,6 +13,7 @@ public class ComponentAlertProperty: NSObject {
     public var messageType: ComponentMessageType = .info
     public var title: String? //传nil时表示不显示Title
     public var subTitle: String? //副文本信息
+    public var iconImage: NSImage?
     public var detailButtonString: String? //传nil时表示不显示
     public var cancelButtonString: String? //传nil时表示不显示
         
@@ -21,12 +22,14 @@ public class ComponentAlertProperty: NSObject {
     public init(messageType: ComponentMessageType = .info,
                 title: String? = nil,
                 subTitle: String? = nil,
+                iconImage: NSImage?
                 detailButtonString: String? = nil,
                 cancelButtonString: String? = nil) {
         
         self.messageType = messageType
         self.title = title
         self.subTitle = subTitle
+        self.iconImage = iconImage
         self.detailButtonString = detailButtonString
         self.cancelButtonString = cancelButtonString
          

+ 2 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFConfig.swift

@@ -74,6 +74,8 @@ import Cocoa
     case fill_date
     case fill_sign
     
+    case Redact
+    case Digital_Sign
     
 }