Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7ca10cd
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Aug 26, 2025
702196a
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Aug 26, 2025
3d3282d
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Aug 26, 2025
c6e706f
feat: 🎸 [HCPSDKFIORIUIKIT-2957] Generic AlphaNumeric
leoxiao-sap Aug 26, 2025
817d134
Merge branch 'main' into fix-2957
dyongxu Aug 27, 2025
0fd5804
Merge branch 'main' into fix-2957
leoxiao-sap Sep 4, 2025
9ed326a
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Sep 4, 2025
48e686c
Merge branch 'main' into fix-2957
dyongxu Sep 4, 2025
bc41d51
Merge branch 'main' into fix-2957
dyongxu Sep 15, 2025
469efa6
Merge branch 'main' into fix-2957
leoxiao-sap Sep 23, 2025
60778ec
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Sep 23, 2025
30d3012
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Sep 23, 2025
2eb5c97
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Sep 24, 2025
f80bf4b
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Sep 24, 2025
10fb188
Merge branch 'main' into fix-2957
leoxiao-sap Sep 29, 2025
64ff4f8
Merge branch 'main' into fix-2957
leoxiao-sap Oct 16, 2025
5c90615
feat: 🎸 [HCPSDKFIORIUIKIT-2957]Implement a generic AlphaNumeric
leoxiao-sap Oct 16, 2025
0dfd1cb
Merge branch 'main' into fix-2957
leoxiao-sap Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Apps/Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
64905D092C7693970062AAD4 /* DateTimePickerExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64905D082C7693970062AAD4 /* DateTimePickerExample.swift */; };
649C7F482CE531C8007B78A7 /* ProgressIndicatorExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649C7F472CE531C5007B78A7 /* ProgressIndicatorExample.swift */; };
64A3FF012D12527F00992B24 /* DimensionSelectorExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64A3FF002D12527B00992B24 /* DimensionSelectorExample.swift */; };
684E21D32E4D7921001823E2 /* TextInputExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 684E21D22E4D7921001823E2 /* TextInputExample.swift */; };
691DE21925F2A30B00094D4A /* KPIItemExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691DE21825F2A30B00094D4A /* KPIItemExample.swift */; };
692F338B26556A6A009B98DA /* SideBarExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 692F338A26556A6A009B98DA /* SideBarExample.swift */; };
69B2B5D9268A333C009AC6B3 /* KPIProgressViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69B2B5D8268A333C009AC6B3 /* KPIProgressViewExample.swift */; };
Expand Down Expand Up @@ -320,6 +321,7 @@
64905D082C7693970062AAD4 /* DateTimePickerExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTimePickerExample.swift; sourceTree = "<group>"; };
649C7F472CE531C5007B78A7 /* ProgressIndicatorExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressIndicatorExample.swift; sourceTree = "<group>"; };
64A3FF002D12527B00992B24 /* DimensionSelectorExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DimensionSelectorExample.swift; sourceTree = "<group>"; };
684E21D22E4D7921001823E2 /* TextInputExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextInputExample.swift; sourceTree = "<group>"; };
691DE21825F2A30B00094D4A /* KPIItemExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KPIItemExample.swift; sourceTree = "<group>"; };
692F338A26556A6A009B98DA /* SideBarExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideBarExample.swift; sourceTree = "<group>"; };
69B2B5D8268A333C009AC6B3 /* KPIProgressViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KPIProgressViewExample.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -671,6 +673,14 @@
path = AIUserFeedback;
sourceTree = "<group>";
};
684E21D12E4D78D5001823E2 /* TextInput */ = {
isa = PBXGroup;
children = (
684E21D22E4D7921001823E2 /* TextInputExample.swift */,
);
path = TextInput;
sourceTree = "<group>";
};
691DE21725F2A2F000094D4A /* KPI */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -846,6 +856,7 @@
8A5579C824C1293C0098003A /* FioriSwiftUICore */ = {
isa = PBXGroup;
children = (
684E21D12E4D78D5001823E2 /* TextInput */,
5A80A5EE2DE706B700950E40 /* AIUserFeedback */,
B163CD842DE54B9A00B011D8 /* WritingAssistant */,
87F70A662DDB9EC700B683B4 /* BarcodeScanner */,
Expand Down Expand Up @@ -1524,6 +1535,7 @@
6D6E86252C50D42000EDB6F4 /* FioriButtonInListExample.swift in Sources */,
B8D4377125F983730024EE7D /* ObjectCell_Rules_Alignment.swift in Sources */,
A65FB3BF2DE464A000930093 /* CurrencyInputExample.swift in Sources */,
684E21D32E4D7921001823E2 /* TextInputExample.swift in Sources */,
8A5579D524C1293C0098003A /* SettingsSeries.swift in Sources */,
6432FFA02C5164F8008ECE89 /* SegmentedControlExample.swift in Sources */,
9DEC27B52C3F3DB30070B571 /* KeyValueItemExample.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct CoreContentView: View {
MenuItem(title: "SectionHeader/Footer Example", section: "Headers", destination: SectionHeaderFooterExample()),

// Controls
MenuItem(title: "Format Text Input", section: "Controls", destination: TextInputExample()),
MenuItem(title: "Customized TabView", section: "Controls", destination: TabViewExample()),
MenuItem(title: "Customized Toolbar", section: "Controls", destination: ToolbarExample()),
MenuItem(title: "Dimension Selector", section: "Controls", destination: DimensionSelectorExample()),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import FioriSwiftUICore
import SwiftUI

struct TextInputExample: View {
@State var showsCharCount = true
@State var allowsBeyondLimit = true

@State private var phoneNumber: String = ""
@State private var price: String = ""
@State private var numeric: String = ""
@State private var date: String = ""
@State private var genericText: String = ""
@State private var genericText2: String = ""

@State private var valueText: String = ""

// the below ids used to scroll to related items
private var phoneNumberId = UUID()
private var priceId = UUID()
private var numericId = UUID()
private var dateId = UUID()
private var genericTextId = UUID()
private var genericText2Id = UUID()
private var valueTextId = UUID()

var body: some View {
ScrollViewReader { _ in
List {
Section {
TextFieldFormView(title: "Phone Number", text: self.$phoneNumber, formatter: self.phoneNumberFormatter, placeholder: "(123) 456-7890", errorMessage: AttributedString(""), maxTextLength: 13, hintText: AttributedString("(###) ###-####"), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.phoneNumberId)
} header: {
Text("Phone Number Formatter - Text field form view")
.font(.fiori(forTextStyle: .subheadline))
.foregroundStyle(Color.preferredColor(.secondaryLabel))
}
Section {
TextFieldFormView(title: "Price", text: self.$price, formatter: self.priceFormatter, placeholder: "$ 0.00", errorMessage: AttributedString(""), hintText: AttributedString(""), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.priceId)

TextFieldFormView(title: "Number", text: self.$numeric, formatter: self.numberFormatter, placeholder: "1.234lbs", errorMessage: AttributedString(""), hintText: AttributedString(""), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.numericId)
} header: {
Text("Custom Number Formatter - Text field form view")
.font(.fiori(forTextStyle: .subheadline))
.foregroundStyle(Color.preferredColor(.secondaryLabel))
}
Section {
TextFieldFormView(title: "Date", text: self.$date, formatter: self.dateFormatter, placeholder: "AA 2025/01/01", errorMessage: AttributedString(""), maxTextLength: 13, hintText: AttributedString("AA YYYY/MM/DD"), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.dateId)

TextFieldFormView(title: "Generic Text", text: self.$genericText, formatter: self.genericTextFormatter, placeholder: "+AA 123 456# a 2025/01/01 A*", errorMessage: AttributedString(""), maxTextLength: 28, hintText: AttributedString("+AA NNN NNNS X YYYY/MM/DD A*"), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.genericTextId)

TextFieldFormView(title: "Generic Text2", text: self.$genericText2, formatter: self.genericText2Formatter, placeholder: "123+A* 456 789 A*", errorMessage: AttributedString(""), maxTextLength: 18, hintText: AttributedString("NNN+A* NNN NNN A*"), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: false, actionIcon: nil, action: nil)
.id(self.genericText2Id)

} header: {
Text("Generic Text Formatter - Text field form view")
.font(.fiori(forTextStyle: .subheadline))
.foregroundStyle(Color.preferredColor(.secondaryLabel))
}
Section {
TitleFormView(text: self.$valueText, formatter: self.genericTextFormatter, placeholder: "+AA 123 456# a 2025/01/01 A*", hintText: AttributedString("+AA NNN NNNS X YYYY/MM/DD A*"), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit)
.padding(.leading, -4)
.padding(.trailing, -4)
.id(self.valueTextId)
} header: {
Text("Generic Text Formatter - Title form view")
.font(.fiori(forTextStyle: .subheadline))
.foregroundStyle(Color.preferredColor(.secondaryLabel))
}
.listRowSeparator(.hidden, edges: .bottom)
.environment(\.defaultMinListRowHeight, 0)
.environment(\.defaultMinListHeaderHeight, 0)
}
}
}

var phoneNumberFormatter: PhoneNumberFormatter {
let formatter = PhoneNumberFormatter()
return formatter
}

var priceFormatter: CustomNumberFormatter {
let formatter = CustomNumberFormatter()
formatter.numberStyle = .currency
return formatter
}

var numberFormatter: CustomNumberFormatter {
let formatter = CustomNumberFormatter()
formatter.numberStyle = .decimal
formatter.maximumFractionDigits = 3
formatter.positiveSuffix = "lbs"
return formatter
}

var dateFormatter: GenericTextFormatter {
let formatter = GenericTextFormatter()
formatter.format = "AA YYYY/MM/DD"
formatter.yearMinium = 1000
formatter.yearMaximum = 3000
return formatter
}

var numericFormatter: GenericTextFormatter {
let formatter = GenericTextFormatter()
formatter.format = "+\\A\\* NNN NNN \\A\\*"
return formatter
}

var genericTextFormatter: GenericTextFormatter {
let formatter = GenericTextFormatter()
formatter.format = "+AA NNN NNNS X YYYY/MM/DD \\A\\*"
return formatter
}

var genericText2Formatter: GenericTextFormatter {
let formatter = GenericTextFormatter()
formatter.format = "NNN+\\A\\* NNN NNN \\A\\*"
return formatter
}
}
Loading
Loading