瀏覽代碼

【2025】【综合】
1、组件库完善
2、UI测试问题修正

niehaoyu 3 月之前
父節點
當前提交
ed87eb0e24

+ 5 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Input/ComponentInput/ComponentInput.swift

@@ -218,12 +218,16 @@ public class ComponentInput: ComponentBaseXibView {
         placeLabel.isHidden = true
         if let rightText = properties.rightText {
             placeLabel.isHidden = false
-            placeLabel.stringValue = "12312312"
+            placeLabel.stringValue = rightText
             
             placeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-field/color-presuffix-dis")
             placeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-regular")
         }
         
+        if let img = properties.leftIcon {
+            leftIconImg.image = img
+        }
+        
         updateClearButtonState()
         
     }

+ 7 - 4
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Input/ComponentInput/ComponentInputProperty.swift

@@ -12,13 +12,14 @@ public class ComponentInputProperty: NSObject {
     
     public var size: ComponentSize = .m
     public var state: ComponentState = .normal
-    public var isError: Bool = false //错误提示
+    public var isError: Bool = false    //错误提示
     public var showPrefix: Bool = false //右侧icon
     public var showSuffix: Bool = false //左侧icon
-    public var showClear: Bool = false //clear icon
+    public var showClear: Bool = false  //clear icon
     public var isDisabled: Bool = false //禁用状态
-    public var placeholder: String? //提示文字
-    public var text: String = "" //默认文字
+    public var placeholder: String?     //提示文字
+    public var leftIcon: NSImage?       //左侧图标
+    public var text: String = ""        //默认文字
     public var alignment: NSTextAlignment = .left
     public var creatable: Bool = true            //输入框是否允许编辑
     public var rightText: String?
@@ -33,6 +34,7 @@ public class ComponentInputProperty: NSObject {
                 showClear: Bool = false,
                 isDisabled: Bool = false,
                 placeholder: String? = nil,
+                leftIcon: NSImage? = nil,
                 text: String = "",
                 alignment: NSTextAlignment = .left,
                 creatable: Bool = true,
@@ -46,6 +48,7 @@ public class ComponentInputProperty: NSObject {
         self.showClear = showClear
         self.isDisabled = isDisabled
         self.placeholder = placeholder
+        self.leftIcon = leftIcon
         self.text = text
         self.alignment = alignment
         self.creatable = creatable

+ 3 - 2
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Select/ComponentSelect.swift

@@ -255,12 +255,13 @@ public class ComponentSelect: ComponentBaseXibView {
         
         for item in menuitemPropertys {
             item.state = .normal
-            item.itemSelected = false
-            if item == selItemProperty {
+            if item == selItemProperty && selItemProperty?.text == properties.text {
                 item.itemSelected = true
             } else if item.text == properties.text {
                 item.itemSelected = true
                 selItemProperty = item
+            } else {
+                item.itemSelected = false
             }
             
             if item.type == .normal {

+ 8 - 7
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/KMLinkViewController/Views/KMLinkEmailView/KMLinkEmailView.swift

@@ -11,11 +11,11 @@ import KMComponentLibrary
 @objc public protocol KMLinkEmailViewDelegate: AnyObject {
     
     @objc optional func kmLinkEmailViewDidGo(_ view: KMLinkEmailView, _ emailString: String)
- 
+    
 }
 
 public class KMLinkEmailView: BaseXibView {
-
+    
     @IBOutlet var contendBox: NSBox!
     @IBOutlet var inputTextarea: ComponentTextarea!
     @IBOutlet var goButton: ComponentButton!
@@ -43,7 +43,7 @@ public class KMLinkEmailView: BaseXibView {
         
         self.setUpUI()
     }
-     
+    
     func setUpUI() {
         
         inputTextarea.properties = ComponentTextareaProperty(size: .m,
@@ -56,13 +56,14 @@ public class KMLinkEmailView: BaseXibView {
         inputTextarea.delegate = self
         
         goButton.properties = ComponentButtonProperty(type: .default_tertiary,
-                                                           size: .s,
-                                                           buttonText: KMLocalizedString("Go"))
+                                                      size: .s,
+                                                      buttonText: KMLocalizedString("Go"),
+                                                      keepPressState: false)
         goButton.setTarget(self, action: #selector(buttonClicked(_:)))
         goButton.isHidden = true
-
+        
     }
- 
+    
     @objc func buttonClicked(_ sender: NSView) {
         delegate?.kmLinkEmailViewDidGo?(self, inputTextarea.properties.text)
         

+ 5 - 4
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/KMLinkViewController/Views/KMLinkWebView/KMLinkWebView.swift

@@ -11,11 +11,11 @@ import KMComponentLibrary
 @objc public protocol KMLinkWebViewDelegate: AnyObject {
     
     @objc optional func kmLinkWebViewDidGo(_ view: KMLinkWebView, _ webString: String)
- 
+    
 }
 
 public class KMLinkWebView: BaseXibView {
-
+    
     @IBOutlet var contendBox: NSBox!
     @IBOutlet var inputTextarea: ComponentTextarea!
     @IBOutlet var goButton: ComponentButton!
@@ -58,8 +58,9 @@ public class KMLinkWebView: BaseXibView {
         inputTextarea.delegate = self
         
         goButton.properties = ComponentButtonProperty(type: .default_tertiary,
-                                                           size: .s,
-                                                           buttonText: KMLocalizedString("Go"))
+                                                      size: .s,
+                                                      buttonText: KMLocalizedString("Go"),
+                                                      keepPressState: false)
         goButton.setTarget(self, action: #selector(buttonClicked(_:)))
         goButton.isHidden = true
         

+ 2 - 2
PDF Office/PDF Master/KMClass/KMPDFViewController/KMNDisplayViewController/KMNDisplayViewController.swift

@@ -171,8 +171,8 @@ class KMNDisplayViewController: NSViewController {
         splitViewLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
         
         noSplitSelector.properties = ComponentCSelectorProperty.init(size: .m, state: .normal, text: KMLocalizedString("No Split"), iconImage: NSImage(named: "display_noSplit"))
-        verticalSelector.properties = ComponentCSelectorProperty.init(size: .m, state: .normal, text: KMLocalizedString("Vertical"), iconImage: NSImage(named: "display_horizontalSplit"))
-        horizontalSelector.properties = ComponentCSelectorProperty.init(size: .m, state: .normal, text: KMLocalizedString("Horizontal"), iconImage: NSImage(named: "display_verticalSplit"))
+        verticalSelector.properties = ComponentCSelectorProperty.init(size: .m, state: .normal, text: KMLocalizedString("Vertical"), iconImage: NSImage(named: "display_verticalSplit"))
+        horizontalSelector.properties = ComponentCSelectorProperty.init(size: .m, state: .normal, text: KMLocalizedString("Horizontal"), iconImage: NSImage(named: "display_horizontalSplit"))
         
         noSplitSelector.setTarget(self, action: #selector(selectorClicked(_:)))
         verticalSelector.setTarget(self, action: #selector(selectorClicked(_:)))

+ 0 - 12
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/Convert/convert_json.imageset/Contents.json

@@ -1,12 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "convert_json.pdf",
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 0 - 82
PDF Office/PDF Master/KMClass/KMPDFViewController/PDFImages.xcassets/Toolbar/Convert/convert_json.imageset/convert_json.pdf

@@ -1,82 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-1.000000 0.000000 -0.000000 1.000000 -0.666748 1.756065 cm
-0.062745 0.094118 0.156863 scn
-8.666666 1.822926 m
-4.794935 -0.764105 l
-4.281975 -1.106857 3.618720 -0.628944 3.781513 -0.033877 c
-5.021903 4.500187 l
-1.373622 7.438275 l
-0.895202 7.823564 1.148251 8.595985 1.761909 8.623499 c
-6.414078 8.832087 l
-8.041544 13.223736 l
-8.256485 13.803746 9.076848 13.803744 9.291789 13.223734 c
-10.919253 8.832087 l
-15.571422 8.623500 l
-16.185080 8.595985 16.438133 7.823565 15.959713 7.438277 c
-12.311430 4.500187 l
-13.551819 -0.033878 l
-13.714612 -0.628945 13.051358 -1.106857 12.538398 -0.764105 c
-8.666666 1.822926 l
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  651
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000034 00000 n
-0000000741 00000 n
-0000000763 00000 n
-0000000936 00000 n
-0000001010 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-1069
-%%EOF

+ 3 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/EditPDF/KMEditImageController.xib

@@ -72,7 +72,7 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Xa-fV-tFr">
                                     <rect key="frame" x="0.0" y="32" width="232" height="40"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4DO-V6-JUJ">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4DO-V6-JUJ">
                                             <rect key="frame" x="-2" y="12" width="30" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Size" id="BYF-9G-Zr2">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -140,7 +140,7 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="Sm5-0s-19e">
                                     <rect key="frame" x="0.0" y="32" width="232" height="40"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yEz-sB-7uR">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yEz-sB-7uR">
                                             <rect key="frame" x="-2" y="12" width="82" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Rotate &amp; Flip" id="N6G-fq-qFA">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -226,7 +226,7 @@
                                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="XM6-r1-dTE">
                                     <rect key="frame" x="0.0" y="32" width="232" height="40"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nL4-oY-ZBk">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nL4-oY-ZBk">
                                             <rect key="frame" x="-2" y="12" width="51" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Opacity" id="ru5-az-dPn">
                                                 <font key="font" usesAppearanceFont="YES"/>

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/RightSideController/Views/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -377,7 +377,7 @@ extension KMEditPDFTextPropertyViewController: ComponentSelectDelegate {
             if let string = view.properties.text {
                 let result = string.stringByDeleteCharString(" pt")
                 let size = result.stringToCGFloat()
-                let fontSize = max(size, 100)
+                let fontSize = min(size, 100)
                 
                 pdfView?.setEditingTextarea_FontSize(size: fontSize)
                 

文件差異過大導致無法顯示
+ 992 - 68
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist