From 498d4eeb6ae514de612eb80593986315e6da92f3 Mon Sep 17 00:00:00 2001 From: Hengyi Zhang Date: Thu, 9 Jan 2025 15:10:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20[JIRA:HCPSDKFIORIUIK?= =?UTF-8?q?IT-2882]=20TextInputField=20Enhancement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/ModelDefinitions.swift | 2 +- .../BaseComponentProtocols.swift | 14 ++--- .../TextInputFieldStyle.fiori.swift | 4 +- .../_FioriStyles/TextInputStyle.fiori.swift | 26 -------- .../PlaceholderTextField.generated.swift | 18 ++++-- .../PlaceholderTextFieldStyle.generated.swift | 2 + .../StepperField/StepperField.generated.swift | 18 ++++-- .../StepperFieldStyle.generated.swift | 2 + .../StepperView/StepperView.generated.swift | 18 ++++-- .../StepperViewStyle.generated.swift | 2 + .../TextFieldFormView.generated.swift | 18 ++++-- .../TextFieldFormViewStyle.generated.swift | 2 + .../TextInput/TextInput.generated.swift | 62 ------------------- .../TextInput/TextInputStyle.generated.swift | 27 -------- .../TextInputField.generated.swift | 15 ++++- .../TextInputFieldStyle.generated.swift | 2 + .../TitleFormView.generated.swift | 18 ++++-- .../TitleFormViewStyle.generated.swift | 2 + ...entStyleProtocol+Extension.generated.swift | 14 ----- .../EnvironmentVariables.generated.swift | 21 ------- .../ModifiedStyle.generated.swift | 28 --------- .../ResolvedStyle.generated.swift | 16 ----- ...yleConfiguration+Extension.generated.swift | 10 +-- .../View+Extension_.generated.swift | 17 ----- ...iewEmptyChecking+Extension.generated.swift | 6 -- 25 files changed, 108 insertions(+), 256 deletions(-) delete mode 100644 Sources/FioriSwiftUICore/_FioriStyles/TextInputStyle.fiori.swift delete mode 100644 Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInput.generated.swift delete mode 100644 Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInputStyle.generated.swift diff --git a/Sources/FioriSwiftUICore/Models/ModelDefinitions.swift b/Sources/FioriSwiftUICore/Models/ModelDefinitions.swift index ab3c168c6..d23e18df4 100644 --- a/Sources/FioriSwiftUICore/Models/ModelDefinitions.swift +++ b/Sources/FioriSwiftUICore/Models/ModelDefinitions.swift @@ -103,7 +103,7 @@ public protocol ActionModel: ActionComponent {} public protocol _TextInputModel: TextInputComponent {} /// Deprecated TextInputModel -@available(*, unavailable, renamed: "_TextInputModel", message: "Will be removed in the future release. Please create TextInput with other initializers instead.") +@available(*, unavailable, renamed: "_TextInputModel", message: "Will be removed in the future release. Please create TextInput with TextInputField instead.") public protocol TextInputModel {} // sourcery: generated_component diff --git a/Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift b/Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift index 2bd8aa05d..627fd7d39 100755 --- a/Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift +++ b/Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift @@ -244,7 +244,12 @@ protocol _MoreActionOverflowComponent { // sourcery: BaseComponent protocol _TextInputFieldComponent { // sourcery: @Binding + // sourcery: defaultValue = ".constant("")" var text: String { get } + // sourcery: defaultValue = """" + var prompt: String { get } + // sourcery: no_view + var onCommit: (() -> Void)? { get } } // sourcery: BaseComponent @@ -496,15 +501,6 @@ protocol _ActivityItemsComponent { var activityItems: [ActivityItemDataType] { get } } -// sourcery: BaseComponent -protocol _TextInputComponent { - // sourcery: @Binding - // sourcery: defaultValue = ".constant("")" - var textInputValue: String { get } - // sourcery: no_view - var onCommit: (() -> Void)? { get } -} - // sourcery: BaseComponent protocol _LowerThumbComponent { // sourcery: @ViewBuilder diff --git a/Sources/FioriSwiftUICore/_FioriStyles/TextInputFieldStyle.fiori.swift b/Sources/FioriSwiftUICore/_FioriStyles/TextInputFieldStyle.fiori.swift index ed57d2e32..090d52967 100644 --- a/Sources/FioriSwiftUICore/_FioriStyles/TextInputFieldStyle.fiori.swift +++ b/Sources/FioriSwiftUICore/_FioriStyles/TextInputFieldStyle.fiori.swift @@ -6,7 +6,9 @@ import SwiftUI public struct TextInputFieldBaseStyle: TextInputFieldStyle { @ViewBuilder public func makeBody(_ configuration: TextInputFieldConfiguration) -> some View { - TextField("", text: configuration.$text) + TextField(configuration.prompt, + text: configuration.$text, + onCommit: configuration.onCommit ?? {}) } } diff --git a/Sources/FioriSwiftUICore/_FioriStyles/TextInputStyle.fiori.swift b/Sources/FioriSwiftUICore/_FioriStyles/TextInputStyle.fiori.swift deleted file mode 100644 index 89f72b532..000000000 --- a/Sources/FioriSwiftUICore/_FioriStyles/TextInputStyle.fiori.swift +++ /dev/null @@ -1,26 +0,0 @@ -import FioriThemeManager -import Foundation -import SwiftUI - -// Base Layout style -public struct TextInputBaseStyle: TextInputStyle { - @ViewBuilder - public func makeBody(_ configuration: TextInputConfiguration) -> some View { - // Add default layout here - TextField("Default", - text: configuration.$textInputValue, - onCommit: configuration.onCommit ?? {}) - } -} - -// Default fiori styles -public struct TextInputFioriStyle: TextInputStyle { - @ViewBuilder - public func makeBody(_ configuration: TextInputConfiguration) -> some View { - TextInput(configuration) - .modifier(TextFieldClearButton(textValue: configuration.$textInputValue)) - .textFieldStyle(BottomTextFieldStyle()) - .font(.fiori(forTextStyle: .body)) - .foregroundColor(.preferredColor(.primaryLabel)) - } -} diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextField.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextField.generated.swift index 46fa2e817..3a5c06e58 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextField.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextField.generated.swift @@ -5,25 +5,33 @@ import SwiftUI public struct PlaceholderTextField { @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? let placeholder: any View @Environment(\.placeholderTextFieldStyle) var style fileprivate var _shouldApplyDefaultStyle = true - public init(text: Binding, + public init(text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil, @ViewBuilder placeholder: () -> any View = { EmptyView() }) { self._text = text + self.prompt = prompt + self.onCommit = onCommit self.placeholder = Placeholder(placeholder: placeholder) } } public extension PlaceholderTextField { init(text: Binding, + prompt: String = "", + onCommit: (() -> Void)? = nil, placeholder: AttributedString? = nil) { - self.init(text: text, placeholder: { OptionalText(placeholder) }) + self.init(text: text, prompt: prompt, onCommit: onCommit, placeholder: { OptionalText(placeholder) }) } } @@ -34,6 +42,8 @@ public extension PlaceholderTextField { internal init(_ configuration: PlaceholderTextFieldConfiguration, shouldApplyDefaultStyle: Bool) { self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self.placeholder = configuration.placeholder self._shouldApplyDefaultStyle = shouldApplyDefaultStyle } @@ -44,7 +54,7 @@ extension PlaceholderTextField: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(text: self.$text, placeholder: .init(self.placeholder))).typeErased + self.style.resolve(configuration: .init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder))).typeErased .transformEnvironment(\.placeholderTextFieldStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -62,7 +72,7 @@ private extension PlaceholderTextField { } func defaultStyle() -> some View { - PlaceholderTextField(.init(text: self.$text, placeholder: .init(self.placeholder))) + PlaceholderTextField(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder))) .shouldApplyDefaultStyle(false) .placeholderTextFieldStyle(PlaceholderTextFieldFioriStyle.ContentFioriStyle()) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextFieldStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextFieldStyle.generated.swift index 97e1f1c8c..a66d7155c 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextFieldStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/PlaceholderTextField/PlaceholderTextFieldStyle.generated.swift @@ -23,6 +23,8 @@ struct AnyPlaceholderTextFieldStyle: PlaceholderTextFieldStyle { public struct PlaceholderTextFieldConfiguration { @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? public let placeholder: Placeholder public typealias Placeholder = ConfigurationViewWrapper diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperField.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperField.generated.swift index b4e6e2a27..acfb34017 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperField.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperField.generated.swift @@ -8,6 +8,8 @@ import FioriThemeManager public struct StepperField { let decrementAction: any View @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? let incrementAction: any View /// The step value let step: Double @@ -21,7 +23,9 @@ public struct StepperField { fileprivate var _shouldApplyDefaultStyle = true public init(@ViewBuilder decrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.less } }, - text: Binding, + text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil, @ViewBuilder incrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.add } }, step: Double = 1, stepRange: ClosedRange, @@ -29,6 +33,8 @@ public struct StepperField { { self.decrementAction = DecrementAction(decrementAction: decrementAction) self._text = text + self.prompt = prompt + self.onCommit = onCommit self.incrementAction = IncrementAction(incrementAction: incrementAction) self.step = step self.stepRange = stepRange @@ -39,12 +45,14 @@ public struct StepperField { public extension StepperField { init(decrementAction: FioriButton? = FioriButton { _ in FioriIcon.actions.less }, text: Binding, + prompt: String = "", + onCommit: (() -> Void)? = nil, incrementAction: FioriButton? = FioriButton { _ in FioriIcon.actions.add }, step: Double = 1, stepRange: ClosedRange, isDecimalSupported: Bool = false) { - self.init(decrementAction: { decrementAction }, text: text, incrementAction: { incrementAction }, step: step, stepRange: stepRange, isDecimalSupported: isDecimalSupported) + self.init(decrementAction: { decrementAction }, text: text, prompt: prompt, onCommit: onCommit, incrementAction: { incrementAction }, step: step, stepRange: stepRange, isDecimalSupported: isDecimalSupported) } } @@ -56,6 +64,8 @@ public extension StepperField { internal init(_ configuration: StepperFieldConfiguration, shouldApplyDefaultStyle: Bool) { self.decrementAction = configuration.decrementAction self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self.incrementAction = configuration.incrementAction self.step = configuration.step self.stepRange = configuration.stepRange @@ -69,7 +79,7 @@ extension StepperField: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(decrementAction: .init(self.decrementAction), text: self.$text, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported)).typeErased + self.style.resolve(configuration: .init(decrementAction: .init(self.decrementAction), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported)).typeErased .transformEnvironment(\.stepperFieldStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -87,7 +97,7 @@ private extension StepperField { } func defaultStyle() -> some View { - StepperField(.init(decrementAction: .init(self.decrementAction), text: self.$text, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported)) + StepperField(.init(decrementAction: .init(self.decrementAction), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported)) .shouldApplyDefaultStyle(false) .stepperFieldStyle(StepperFieldFioriStyle.ContentFioriStyle()) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperFieldStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperFieldStyle.generated.swift index b0a8dfc77..c4b069d10 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperFieldStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperField/StepperFieldStyle.generated.swift @@ -24,6 +24,8 @@ struct AnyStepperFieldStyle: StepperFieldStyle { public struct StepperFieldConfiguration { public let decrementAction: DecrementAction @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? public let incrementAction: IncrementAction public let step: Double public let stepRange: ClosedRange diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperView.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperView.generated.swift index bbfba53fc..a60ff54af 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperView.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperView.generated.swift @@ -9,6 +9,8 @@ public struct StepperView { let title: any View let decrementAction: any View @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? let incrementAction: any View /// The step value let step: Double @@ -25,7 +27,9 @@ public struct StepperView { public init(@ViewBuilder title: () -> any View, @ViewBuilder decrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.less } }, - text: Binding, + text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil, @ViewBuilder incrementAction: () -> any View = { FioriButton { _ in FioriIcon.actions.add } }, step: Double = 1, stepRange: ClosedRange, @@ -36,6 +40,8 @@ public struct StepperView { self.title = Title(title: title) self.decrementAction = DecrementAction(decrementAction: decrementAction) self._text = text + self.prompt = prompt + self.onCommit = onCommit self.incrementAction = IncrementAction(incrementAction: incrementAction) self.step = step self.stepRange = stepRange @@ -49,6 +55,8 @@ public extension StepperView { init(title: AttributedString, decrementAction: FioriButton? = FioriButton { _ in FioriIcon.actions.less }, text: Binding, + prompt: String = "", + onCommit: (() -> Void)? = nil, incrementAction: FioriButton? = FioriButton { _ in FioriIcon.actions.add }, step: Double = 1, stepRange: ClosedRange, @@ -56,7 +64,7 @@ public extension StepperView { icon: Image? = nil, description: AttributedString? = nil) { - self.init(title: { Text(title) }, decrementAction: { decrementAction }, text: text, incrementAction: { incrementAction }, step: step, stepRange: stepRange, isDecimalSupported: isDecimalSupported, icon: { icon }, description: { OptionalText(description) }) + self.init(title: { Text(title) }, decrementAction: { decrementAction }, text: text, prompt: prompt, onCommit: onCommit, incrementAction: { incrementAction }, step: step, stepRange: stepRange, isDecimalSupported: isDecimalSupported, icon: { icon }, description: { OptionalText(description) }) } } @@ -69,6 +77,8 @@ public extension StepperView { self.title = configuration.title self.decrementAction = configuration.decrementAction self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self.incrementAction = configuration.incrementAction self.step = configuration.step self.stepRange = configuration.stepRange @@ -84,7 +94,7 @@ extension StepperView: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(title: .init(self.title), decrementAction: .init(self.decrementAction), text: self.$text, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported, icon: .init(self.icon), description: .init(self.description))).typeErased + self.style.resolve(configuration: .init(title: .init(self.title), decrementAction: .init(self.decrementAction), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported, icon: .init(self.icon), description: .init(self.description))).typeErased .transformEnvironment(\.stepperViewStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -102,7 +112,7 @@ private extension StepperView { } func defaultStyle() -> some View { - StepperView(.init(title: .init(self.title), decrementAction: .init(self.decrementAction), text: self.$text, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported, icon: .init(self.icon), description: .init(self.description))) + StepperView(.init(title: .init(self.title), decrementAction: .init(self.decrementAction), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported, icon: .init(self.icon), description: .init(self.description))) .shouldApplyDefaultStyle(false) .stepperViewStyle(StepperViewFioriStyle.ContentFioriStyle()) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperViewStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperViewStyle.generated.swift index 6ce477eb1..4034ff5e6 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperViewStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/StepperView/StepperViewStyle.generated.swift @@ -25,6 +25,8 @@ public struct StepperViewConfiguration { public let title: Title public let decrementAction: DecrementAction @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? public let incrementAction: IncrementAction public let step: Double public let stepRange: ClosedRange diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormView.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormView.generated.swift index cf5e33f38..2163c757c 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormView.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormView.generated.swift @@ -6,6 +6,8 @@ import SwiftUI public struct TextFieldFormView { let title: any View @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? let placeholder: any View /// The `ControlState` of the form view. The default is `normal` let controlState: ControlState @@ -39,7 +41,9 @@ public struct TextFieldFormView { fileprivate var _shouldApplyDefaultStyle = true public init(@ViewBuilder title: () -> any View, - text: Binding, + text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil, @ViewBuilder placeholder: () -> any View = { EmptyView() }, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, @@ -58,6 +62,8 @@ public struct TextFieldFormView { { self.title = Title(title: title) self._text = text + self.prompt = prompt + self.onCommit = onCommit self.placeholder = Placeholder(placeholder: placeholder) self.controlState = controlState self.errorMessage = errorMessage @@ -79,6 +85,8 @@ public struct TextFieldFormView { public extension TextFieldFormView { init(title: AttributedString, text: Binding, + prompt: String = "", + onCommit: (() -> Void)? = nil, placeholder: AttributedString? = nil, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, @@ -95,7 +103,7 @@ public extension TextFieldFormView { action: (() -> Void)? = nil, actionIconAccessibilityLabel: String? = nil) { - self.init(title: { Text(title) }, text: text, placeholder: { OptionalText(placeholder) }, controlState: controlState, errorMessage: errorMessage, maxTextLength: maxTextLength, hintText: hintText, hidesReadOnlyHint: hidesReadOnlyHint, isCharCountEnabled: isCharCountEnabled, allowsBeyondLimit: allowsBeyondLimit, charCountReachLimitMessage: charCountReachLimitMessage, charCountBeyondLimitMsg: charCountBeyondLimitMsg, mandatoryFieldIndicator: { TextOrIconView(mandatoryFieldIndicator) }, isRequired: isRequired, actionIcon: actionIcon, action: action, actionIconAccessibilityLabel: actionIconAccessibilityLabel) + self.init(title: { Text(title) }, text: text, prompt: prompt, onCommit: onCommit, placeholder: { OptionalText(placeholder) }, controlState: controlState, errorMessage: errorMessage, maxTextLength: maxTextLength, hintText: hintText, hidesReadOnlyHint: hidesReadOnlyHint, isCharCountEnabled: isCharCountEnabled, allowsBeyondLimit: allowsBeyondLimit, charCountReachLimitMessage: charCountReachLimitMessage, charCountBeyondLimitMsg: charCountBeyondLimitMsg, mandatoryFieldIndicator: { TextOrIconView(mandatoryFieldIndicator) }, isRequired: isRequired, actionIcon: actionIcon, action: action, actionIconAccessibilityLabel: actionIconAccessibilityLabel) } } @@ -107,6 +115,8 @@ public extension TextFieldFormView { internal init(_ configuration: TextFieldFormViewConfiguration, shouldApplyDefaultStyle: Bool) { self.title = configuration.title self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self.placeholder = configuration.placeholder self.controlState = configuration.controlState self.errorMessage = configuration.errorMessage @@ -131,7 +141,7 @@ extension TextFieldFormView: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(title: .init(self.title), text: self.$text, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg, mandatoryFieldIndicator: .init(self.mandatoryFieldIndicator), isRequired: self.isRequired, actionIcon: self.actionIcon, action: self.action, actionIconAccessibilityLabel: self.actionIconAccessibilityLabel)).typeErased + self.style.resolve(configuration: .init(title: .init(self.title), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg, mandatoryFieldIndicator: .init(self.mandatoryFieldIndicator), isRequired: self.isRequired, actionIcon: self.actionIcon, action: self.action, actionIconAccessibilityLabel: self.actionIconAccessibilityLabel)).typeErased .transformEnvironment(\.textFieldFormViewStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -149,7 +159,7 @@ private extension TextFieldFormView { } func defaultStyle() -> some View { - TextFieldFormView(.init(title: .init(self.title), text: self.$text, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg, mandatoryFieldIndicator: .init(self.mandatoryFieldIndicator), isRequired: self.isRequired, actionIcon: self.actionIcon, action: self.action, actionIconAccessibilityLabel: self.actionIconAccessibilityLabel)) + TextFieldFormView(.init(title: .init(self.title), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg, mandatoryFieldIndicator: .init(self.mandatoryFieldIndicator), isRequired: self.isRequired, actionIcon: self.actionIcon, action: self.action, actionIconAccessibilityLabel: self.actionIconAccessibilityLabel)) .shouldApplyDefaultStyle(false) .textFieldFormViewStyle(TextFieldFormViewFioriStyle.ContentFioriStyle()) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormViewStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormViewStyle.generated.swift index d7f78bc9f..43572a47e 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormViewStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextFieldFormView/TextFieldFormViewStyle.generated.swift @@ -24,6 +24,8 @@ struct AnyTextFieldFormViewStyle: TextFieldFormViewStyle { public struct TextFieldFormViewConfiguration { public let title: Title @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? public let placeholder: Placeholder public let controlState: ControlState public let errorMessage: AttributedString? diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInput.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInput.generated.swift deleted file mode 100644 index ddcabb5ef..000000000 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInput.generated.swift +++ /dev/null @@ -1,62 +0,0 @@ -// Generated using Sourcery 2.1.7 — https://github.com/krzysztofzablocki/Sourcery -// DO NOT EDIT -import Foundation -import SwiftUI - -public struct TextInput { - @Binding var textInputValue: String - let onCommit: (() -> Void)? - - @Environment(\.textInputStyle) var style - - fileprivate var _shouldApplyDefaultStyle = true - - public init(textInputValue: Binding = .constant(""), - onCommit: (() -> Void)? = nil) - { - self._textInputValue = textInputValue - self.onCommit = onCommit - } -} - -public extension TextInput { - init(_ configuration: TextInputConfiguration) { - self.init(configuration, shouldApplyDefaultStyle: false) - } - - internal init(_ configuration: TextInputConfiguration, shouldApplyDefaultStyle: Bool) { - self._textInputValue = configuration.$textInputValue - self.onCommit = configuration.onCommit - self._shouldApplyDefaultStyle = shouldApplyDefaultStyle - } -} - -extension TextInput: View { - public var body: some View { - if self._shouldApplyDefaultStyle { - self.defaultStyle() - } else { - self.style.resolve(configuration: .init(textInputValue: self.$textInputValue, onCommit: self.onCommit)).typeErased - .transformEnvironment(\.textInputStyleStack) { stack in - if !stack.isEmpty { - stack.removeLast() - } - } - } - } -} - -private extension TextInput { - func shouldApplyDefaultStyle(_ bool: Bool) -> some View { - var s = self - s._shouldApplyDefaultStyle = bool - return s - } - - func defaultStyle() -> some View { - TextInput(.init(textInputValue: self.$textInputValue, onCommit: self.onCommit)) - .shouldApplyDefaultStyle(false) - .textInputStyle(.fiori) - .typeErased - } -} diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInputStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInputStyle.generated.swift deleted file mode 100644 index bbb363d20..000000000 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInput/TextInputStyle.generated.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Generated using Sourcery 2.1.7 — https://github.com/krzysztofzablocki/Sourcery -// DO NOT EDIT -import Foundation -import SwiftUI - -public protocol TextInputStyle: DynamicProperty { - associatedtype Body: View - - func makeBody(_ configuration: TextInputConfiguration) -> Body -} - -struct AnyTextInputStyle: TextInputStyle { - let content: (TextInputConfiguration) -> any View - - init(@ViewBuilder _ content: @escaping (TextInputConfiguration) -> any View) { - self.content = content - } - - public func makeBody(_ configuration: TextInputConfiguration) -> some View { - self.content(configuration).typeErased - } -} - -public struct TextInputConfiguration { - @Binding public var textInputValue: String - public let onCommit: (() -> Void)? -} diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputField.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputField.generated.swift index 5d91f934f..d393c9ef8 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputField.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputField.generated.swift @@ -5,13 +5,20 @@ import SwiftUI public struct TextInputField { @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? @Environment(\.textInputFieldStyle) var style fileprivate var _shouldApplyDefaultStyle = true - public init(text: Binding) { + public init(text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil) + { self._text = text + self.prompt = prompt + self.onCommit = onCommit } } @@ -22,6 +29,8 @@ public extension TextInputField { internal init(_ configuration: TextInputFieldConfiguration, shouldApplyDefaultStyle: Bool) { self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self._shouldApplyDefaultStyle = shouldApplyDefaultStyle } } @@ -31,7 +40,7 @@ extension TextInputField: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(text: self.$text)).typeErased + self.style.resolve(configuration: .init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit)).typeErased .transformEnvironment(\.textInputFieldStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -49,7 +58,7 @@ private extension TextInputField { } func defaultStyle() -> some View { - TextInputField(.init(text: self.$text)) + TextInputField(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit)) .shouldApplyDefaultStyle(false) .textInputFieldStyle(.fiori) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputFieldStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputFieldStyle.generated.swift index 37fd43f8c..9e109c0b1 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputFieldStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TextInputField/TextInputFieldStyle.generated.swift @@ -23,4 +23,6 @@ struct AnyTextInputFieldStyle: TextInputFieldStyle { public struct TextInputFieldConfiguration { @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? } diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormView.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormView.generated.swift index 97c938d71..425fe29c3 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormView.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormView.generated.swift @@ -5,6 +5,8 @@ import SwiftUI public struct TitleFormView { @Binding var text: String + let prompt: String + let onCommit: (() -> Void)? let placeholder: any View /// The `ControlState` of the form view. The default is `normal` let controlState: ControlState @@ -29,7 +31,9 @@ public struct TitleFormView { fileprivate var _shouldApplyDefaultStyle = true - public init(text: Binding, + public init(text: Binding = .constant(""), + prompt: String = "", + onCommit: (() -> Void)? = nil, @ViewBuilder placeholder: () -> any View = { EmptyView() }, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, @@ -42,6 +46,8 @@ public struct TitleFormView { charCountBeyondLimitMsg: String? = nil) { self._text = text + self.prompt = prompt + self.onCommit = onCommit self.placeholder = Placeholder(placeholder: placeholder) self.controlState = controlState self.errorMessage = errorMessage @@ -57,6 +63,8 @@ public struct TitleFormView { public extension TitleFormView { init(text: Binding, + prompt: String = "", + onCommit: (() -> Void)? = nil, placeholder: AttributedString? = nil, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, @@ -68,7 +76,7 @@ public extension TitleFormView { charCountReachLimitMessage: String? = nil, charCountBeyondLimitMsg: String? = nil) { - self.init(text: text, placeholder: { OptionalText(placeholder) }, controlState: controlState, errorMessage: errorMessage, maxTextLength: maxTextLength, hintText: hintText, hidesReadOnlyHint: hidesReadOnlyHint, isCharCountEnabled: isCharCountEnabled, allowsBeyondLimit: allowsBeyondLimit, charCountReachLimitMessage: charCountReachLimitMessage, charCountBeyondLimitMsg: charCountBeyondLimitMsg) + self.init(text: text, prompt: prompt, onCommit: onCommit, placeholder: { OptionalText(placeholder) }, controlState: controlState, errorMessage: errorMessage, maxTextLength: maxTextLength, hintText: hintText, hidesReadOnlyHint: hidesReadOnlyHint, isCharCountEnabled: isCharCountEnabled, allowsBeyondLimit: allowsBeyondLimit, charCountReachLimitMessage: charCountReachLimitMessage, charCountBeyondLimitMsg: charCountBeyondLimitMsg) } } @@ -79,6 +87,8 @@ public extension TitleFormView { internal init(_ configuration: TitleFormViewConfiguration, shouldApplyDefaultStyle: Bool) { self._text = configuration.$text + self.prompt = configuration.prompt + self.onCommit = configuration.onCommit self.placeholder = configuration.placeholder self.controlState = configuration.controlState self.errorMessage = configuration.errorMessage @@ -98,7 +108,7 @@ extension TitleFormView: View { if self._shouldApplyDefaultStyle { self.defaultStyle() } else { - self.style.resolve(configuration: .init(text: self.$text, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg)).typeErased + self.style.resolve(configuration: .init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg)).typeErased .transformEnvironment(\.titleFormViewStyleStack) { stack in if !stack.isEmpty { stack.removeLast() @@ -116,7 +126,7 @@ private extension TitleFormView { } func defaultStyle() -> some View { - TitleFormView(.init(text: self.$text, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg)) + TitleFormView(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg)) .shouldApplyDefaultStyle(false) .titleFormViewStyle(TitleFormViewFioriStyle.ContentFioriStyle()) .typeErased diff --git a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormViewStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormViewStyle.generated.swift index 4222c27e8..d8aec0eb3 100644 --- a/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormViewStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/StyleableComponents/TitleFormView/TitleFormViewStyle.generated.swift @@ -23,6 +23,8 @@ struct AnyTitleFormViewStyle: TitleFormViewStyle { public struct TitleFormViewConfiguration { @Binding public var text: String + public let prompt: String + public let onCommit: (() -> Void)? public let placeholder: Placeholder public let controlState: ControlState public let errorMessage: AttributedString? diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ComponentStyleProtocol+Extension.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ComponentStyleProtocol+Extension.generated.swift index 1813af124..484e78cbd 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ComponentStyleProtocol+Extension.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ComponentStyleProtocol+Extension.generated.swift @@ -6121,20 +6121,6 @@ public extension TextFieldFormViewStyle where Self == TextFieldFormViewTitleForm } } -// MARK: TextInputStyle - -public extension TextInputStyle where Self == TextInputBaseStyle { - static var base: TextInputBaseStyle { - TextInputBaseStyle() - } -} - -public extension TextInputStyle where Self == TextInputFioriStyle { - static var fiori: TextInputFioriStyle { - TextInputFioriStyle() - } -} - // MARK: TextInputFieldStyle public extension TextInputFieldStyle where Self == TextInputFieldBaseStyle { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/EnvironmentVariables.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/EnvironmentVariables.generated.swift index 11c0aee6c..fcf264724 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/EnvironmentVariables.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/EnvironmentVariables.generated.swift @@ -2502,27 +2502,6 @@ extension EnvironmentValues { } } -// MARK: TextInputStyle - -struct TextInputStyleStackKey: EnvironmentKey { - static let defaultValue: [any TextInputStyle] = [] -} - -extension EnvironmentValues { - var textInputStyle: any TextInputStyle { - self.textInputStyleStack.last ?? .base - } - - var textInputStyleStack: [any TextInputStyle] { - get { - self[TextInputStyleStackKey.self] - } - set { - self[TextInputStyleStackKey.self] = newValue - } - } -} - // MARK: TextInputFieldStyle struct TextInputFieldStyleStackKey: EnvironmentKey { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ModifiedStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ModifiedStyle.generated.swift index c0b977e36..34b9be171 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ModifiedStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ModifiedStyle.generated.swift @@ -3340,34 +3340,6 @@ public extension TextFieldFormViewStyle { } } -// MARK: TextInputStyle - -extension ModifiedStyle: TextInputStyle where Style: TextInputStyle { - public func makeBody(_ configuration: TextInputConfiguration) -> some View { - TextInput(configuration) - .textInputStyle(self.style) - .modifier(self.modifier) - } -} - -public struct TextInputStyleModifier: ViewModifier { - let style: Style - - public func body(content: Content) -> some View { - content.textInputStyle(self.style) - } -} - -public extension TextInputStyle { - func modifier(_ modifier: some ViewModifier) -> some TextInputStyle { - ModifiedStyle(style: self, modifier: modifier) - } - - func concat(_ style: some TextInputStyle) -> some TextInputStyle { - style.modifier(TextInputStyleModifier(style: self)) - } -} - // MARK: TextInputFieldStyle extension ModifiedStyle: TextInputFieldStyle where Style: TextInputFieldStyle { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ResolvedStyle.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ResolvedStyle.generated.swift index 1d308dabf..91109ce3c 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ResolvedStyle.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ResolvedStyle.generated.swift @@ -1907,22 +1907,6 @@ extension TextFieldFormViewStyle { } } -// MARK: TextInputStyle - -struct ResolvedTextInputStyle: View { - let style: Style - let configuration: TextInputConfiguration - var body: some View { - self.style.makeBody(self.configuration) - } -} - -extension TextInputStyle { - func resolve(configuration: TextInputConfiguration) -> some View { - ResolvedTextInputStyle(style: self, configuration: configuration) - } -} - // MARK: TextInputFieldStyle struct ResolvedTextInputFieldStyle: View { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/StyleConfiguration+Extension.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/StyleConfiguration+Extension.generated.swift index 5ed6a2cd3..dbcf3c48b 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/StyleConfiguration+Extension.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/StyleConfiguration+Extension.generated.swift @@ -109,7 +109,7 @@ extension PlaceholderTextEditorConfiguration { extension PlaceholderTextFieldConfiguration { var _textInputField: TextInputField { - TextInputField(.init(text: self.$text), shouldApplyDefaultStyle: true) + TextInputField(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit), shouldApplyDefaultStyle: true) } } @@ -149,7 +149,7 @@ extension SideBarListItemConfiguration { extension StepperFieldConfiguration { var _textInputField: TextInputField { - TextInputField(.init(text: self.$text), shouldApplyDefaultStyle: true) + TextInputField(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit), shouldApplyDefaultStyle: true) } } @@ -157,7 +157,7 @@ extension StepperFieldConfiguration { extension StepperViewConfiguration { var _stepperField: StepperField { - StepperField(.init(decrementAction: .init(self.decrementAction), text: self.$text, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported), shouldApplyDefaultStyle: true) + StepperField(.init(decrementAction: .init(self.decrementAction), text: self.$text, prompt: self.prompt, onCommit: self.onCommit, incrementAction: .init(self.incrementAction), step: self.step, stepRange: self.stepRange, isDecimalSupported: self.isDecimalSupported), shouldApplyDefaultStyle: true) } var _informationView: InformationView { @@ -177,7 +177,7 @@ extension SwitchViewConfiguration { extension TextFieldFormViewConfiguration { var _titleFormView: TitleFormView { - TitleFormView(.init(text: self.$text, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg), shouldApplyDefaultStyle: true) + TitleFormView(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder), controlState: self.controlState, errorMessage: self.errorMessage, maxTextLength: self.maxTextLength, hintText: self.hintText, hidesReadOnlyHint: self.hidesReadOnlyHint, isCharCountEnabled: self.isCharCountEnabled, allowsBeyondLimit: self.allowsBeyondLimit, charCountReachLimitMessage: self.charCountReachLimitMessage, charCountBeyondLimitMsg: self.charCountBeyondLimitMsg), shouldApplyDefaultStyle: true) } } @@ -193,7 +193,7 @@ extension TextInputInfoViewConfiguration { extension TitleFormViewConfiguration { var _placeholderTextField: PlaceholderTextField { - PlaceholderTextField(.init(text: self.$text, placeholder: .init(self.placeholder)), shouldApplyDefaultStyle: true) + PlaceholderTextField(.init(text: self.$text, prompt: self.prompt, onCommit: self.onCommit, placeholder: .init(self.placeholder)), shouldApplyDefaultStyle: true) } var _formView: FormView { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/View+Extension_.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/View+Extension_.generated.swift index 1612694ed..8f2e807ee 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/View+Extension_.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/View+Extension_.generated.swift @@ -2026,23 +2026,6 @@ public extension View { } } -// MARK: TextInputStyle - -public extension View { - func textInputStyle(_ style: some TextInputStyle) -> some View { - self.transformEnvironment(\.textInputStyleStack) { stack in - stack.append(style) - } - } - - func textInputStyle(@ViewBuilder content: @escaping (TextInputConfiguration) -> some View) -> some View { - self.transformEnvironment(\.textInputStyleStack) { stack in - let style = AnyTextInputStyle(content) - stack.append(style) - } - } -} - // MARK: TextInputFieldStyle public extension View { diff --git a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ViewEmptyChecking+Extension.generated.swift b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ViewEmptyChecking+Extension.generated.swift index a5fbf255b..2e6668165 100755 --- a/Sources/FioriSwiftUICore/_generated/SupportingFiles/ViewEmptyChecking+Extension.generated.swift +++ b/Sources/FioriSwiftUICore/_generated/SupportingFiles/ViewEmptyChecking+Extension.generated.swift @@ -865,12 +865,6 @@ extension TextFieldFormView: _ViewEmptyChecking { } } -extension TextInput: _ViewEmptyChecking { - public var isEmpty: Bool { - false - } -} - extension TextInputField: _ViewEmptyChecking { public var isEmpty: Bool { false