Skip to content

Commit 33266b1

Browse files
committed
refactor: 💡 [JIRA:HCPSDKFIORIUIKIT-2882] TextInputField Enhancement
1 parent 498d4ee commit 33266b1

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,10 @@ protocol _MoreActionOverflowComponent {
244244
// sourcery: BaseComponent
245245
protocol _TextInputFieldComponent {
246246
// sourcery: @Binding
247-
// sourcery: defaultValue = ".constant("")"
248247
var text: String { get }
249248
// sourcery: defaultValue = """"
250249
var prompt: String { get }
251-
// sourcery: no_view
250+
/// callback when return key is tapped
252251
var onCommit: (() -> Void)? { get }
253252
}
254253

Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextField.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import SwiftUI
66
public struct PlaceholderTextField {
77
@Binding var text: String
88
let prompt: String
9+
/// callback when return key is tapped
910
let onCommit: (() -> Void)?
1011
let placeholder: any View
1112

1213
@Environment(\.placeholderTextFieldStyle) var style
1314

1415
fileprivate var _shouldApplyDefaultStyle = true
1516

16-
public init(text: Binding<String> = .constant(""),
17+
public init(text: Binding<String>,
1718
prompt: String = "",
1819
onCommit: (() -> Void)? = nil,
1920
@ViewBuilder placeholder: () -> any View = { EmptyView() })

Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperField.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public struct StepperField {
99
let decrementAction: any View
1010
@Binding var text: String
1111
let prompt: String
12+
/// callback when return key is tapped
1213
let onCommit: (() -> Void)?
1314
let incrementAction: any View
1415
/// The step value
@@ -23,7 +24,7 @@ public struct StepperField {
2324
fileprivate var _shouldApplyDefaultStyle = true
2425

2526
public init(@ViewBuilder decrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.less } },
26-
text: Binding<String> = .constant(""),
27+
text: Binding<String>,
2728
prompt: String = "",
2829
onCommit: (() -> Void)? = nil,
2930
@ViewBuilder incrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.add } },

Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperView.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public struct StepperView {
1010
let decrementAction: any View
1111
@Binding var text: String
1212
let prompt: String
13+
/// callback when return key is tapped
1314
let onCommit: (() -> Void)?
1415
let incrementAction: any View
1516
/// The step value
@@ -27,7 +28,7 @@ public struct StepperView {
2728

2829
public init(@ViewBuilder title: () -> any View,
2930
@ViewBuilder decrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.less } },
30-
text: Binding<String> = .constant(""),
31+
text: Binding<String>,
3132
prompt: String = "",
3233
onCommit: (() -> Void)? = nil,
3334
@ViewBuilder incrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.add } },

Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormView.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public struct TextFieldFormView {
77
let title: any View
88
@Binding var text: String
99
let prompt: String
10+
/// callback when return key is tapped
1011
let onCommit: (() -> Void)?
1112
let placeholder: any View
1213
/// The `ControlState` of the form view. The default is `normal`
@@ -41,7 +42,7 @@ public struct TextFieldFormView {
4142
fileprivate var _shouldApplyDefaultStyle = true
4243

4344
public init(@ViewBuilder title: () -> any View,
44-
text: Binding<String> = .constant(""),
45+
text: Binding<String>,
4546
prompt: String = "",
4647
onCommit: (() -> Void)? = nil,
4748
@ViewBuilder placeholder: () -> any View = { EmptyView() },

Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputField.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import SwiftUI
66
public struct TextInputField {
77
@Binding var text: String
88
let prompt: String
9+
/// callback when return key is tapped
910
let onCommit: (() -> Void)?
1011

1112
@Environment(\.textInputFieldStyle) var style
1213

1314
fileprivate var _shouldApplyDefaultStyle = true
1415

15-
public init(text: Binding<String> = .constant(""),
16+
public init(text: Binding<String>,
1617
prompt: String = "",
1718
onCommit: (() -> Void)? = nil)
1819
{

Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormView.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import SwiftUI
66
public struct TitleFormView {
77
@Binding var text: String
88
let prompt: String
9+
/// callback when return key is tapped
910
let onCommit: (() -> Void)?
1011
let placeholder: any View
1112
/// The `ControlState` of the form view. The default is `normal`
@@ -31,7 +32,7 @@ public struct TitleFormView {
3132

3233
fileprivate var _shouldApplyDefaultStyle = true
3334

34-
public init(text: Binding<String> = .constant(""),
35+
public init(text: Binding<String>,
3536
prompt: String = "",
3637
onCommit: (() -> Void)? = nil,
3738
@ViewBuilder placeholder: () -> any View = { EmptyView() },

0 commit comments

Comments
 (0)