-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(POM-433): extend UI customization (#377)
* Support customizing text field prompt and icon. * Support customizing button icon. * Fix nAPM field validation error animation. * Fix stale information when changing payment method during DC. * Refactor UI modules configurations.
- Loading branch information
1 parent
eb08a01
commit abb8616
Showing
40 changed files
with
1,191 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
Sources/ProcessOutCoreUI/Sources/DesignSystem/TextField/POTextFieldViewModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// POTextFieldViewModel.swift | ||
// ProcessOut | ||
// | ||
// Created by Andrii Vysotskyi on 04.11.2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@_spi(PO) | ||
public struct POTextFieldViewModel: Identifiable { | ||
|
||
/// Item identifier. | ||
public let id: AnyHashable | ||
|
||
/// Current parameter's value text. | ||
@Binding | ||
public var value: String | ||
|
||
/// Parameter's placeholder. | ||
public let placeholder: String | ||
|
||
/// Input icon. | ||
public let icon: AnyView? | ||
|
||
/// Boolean value indicating whether value is valid. | ||
public let isInvalid: Bool | ||
|
||
/// Boolean value indicating whether input is currently enabled. | ||
public let isEnabled: Bool | ||
|
||
/// Formatter to use to format value if any. | ||
public let formatter: Formatter? | ||
|
||
/// Keyboard type. | ||
public let keyboard: UIKeyboardType | ||
|
||
/// Text content type. | ||
public let contentType: UITextContentType? | ||
|
||
/// Submit label. | ||
public let submitLabel: POBackport<Any>.SubmitLabel | ||
|
||
/// Action to perform when the user submits a value to this input. | ||
public let onSubmit: () -> Void | ||
|
||
public init( | ||
id: AnyHashable, | ||
value: Binding<String>, | ||
placeholder: String, | ||
icon: AnyView?, | ||
isInvalid: Bool, | ||
isEnabled: Bool, | ||
formatter: Formatter?, | ||
keyboard: UIKeyboardType, | ||
contentType: UITextContentType?, | ||
submitLabel: POBackport<Any>.SubmitLabel, | ||
onSubmit: @escaping () -> Void | ||
) { | ||
self.id = id | ||
self._value = value | ||
self.placeholder = placeholder | ||
self.icon = icon | ||
self.isInvalid = isInvalid | ||
self.isEnabled = isEnabled | ||
self.formatter = formatter | ||
self.keyboard = keyboard | ||
self.contentType = contentType | ||
self.submitLabel = submitLabel | ||
self.onSubmit = onSubmit | ||
} | ||
} |
Oops, something went wrong.