Skip to content

Commit f8e2d4d

Browse files
authored
Merge branch 'main' into main-IOSSDKBUG-187
2 parents e045fb3 + b6aea46 commit f8e2d4d

31 files changed

+1392
-188
lines changed

Diff for: Apps/Examples/Examples/FioriSwiftUICore/Card/MobileCardExample.swift

+30-15
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ struct MobileCardExample: View {
2020
} label: {
2121
Text("Cards")
2222
}
23+
24+
NavigationLink {
25+
List {
26+
ForEach(0 ..< CardTests.cardFooterSamples.count, id: \.self) { i in
27+
CardTests.cardFooterSamples[i]
28+
}
29+
}
30+
.cardStyle(.card)
31+
.listStyle(.plain)
32+
.navigationBarTitle("Footers", displayMode: .inline)
33+
} label: {
34+
Text("Footers")
35+
}
2336

2437
NavigationLink {
2538
MasonryTestView()
@@ -90,24 +103,26 @@ struct CarouselTestView: View {
90103
}
91104

92105
var body: some View {
93-
Carousel(numberOfColumns: Int(self.numberOfColumns), spacing: self.spacing, alignment: self.alignment == 0 ? .top : (self.alignment == 1 ? .center : .bottom), isSnapping: self.isSnapping) {
94-
if self.contentType == 0 {
95-
ForEach(0 ..< CardTests.cardSamples.count, id: \.self) { i in
96-
CardTests.cardSamples[i]
97-
}
98-
} else {
99-
ForEach(0 ..< 20, id: \.self) { i in
100-
Text("Text \(i)")
101-
.font(.title)
102-
.padding()
103-
.frame(height: 100)
104-
.background(Color.gray)
106+
ScrollView(.vertical) {
107+
Carousel(numberOfColumns: Int(self.numberOfColumns), spacing: self.spacing, alignment: self.alignment == 0 ? .top : (self.alignment == 1 ? .center : .bottom), isSnapping: self.isSnapping) {
108+
if self.contentType == 0 {
109+
ForEach(0 ..< CardTests.cardSamples.count, id: \.self) { i in
110+
CardTests.cardSamples[i]
111+
}
112+
} else {
113+
ForEach(0 ..< 20, id: \.self) { i in
114+
Text("Text \(i)")
115+
.font(.title)
116+
.padding()
117+
.frame(height: 100)
118+
.background(Color.gray)
119+
}
105120
}
106121
}
122+
.cardStyle(.card)
123+
.padding(self.padding)
124+
.border(Color.gray)
107125
}
108-
.cardStyle(.card)
109-
.padding(self.padding)
110-
.border(Color.gray)
111126
.sheet(isPresented: self.$isPresented, content: {
112127
VStack {
113128
HStack {

Diff for: Apps/Examples/Examples/FioriSwiftUICore/FormViews/KeyValueFormViewExample.swift

+18-5
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ import SwiftUI
33

44
struct KeyValueFormViewExample: View {
55
var key1: AttributedString {
6-
var aString = AttributedString("Key 1")
6+
let aString = AttributedString("Key 1")
77
return aString
88
}
99

1010
var key1Long: AttributedString {
11-
var aString = AttributedString("Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 ")
11+
let aString = AttributedString("Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 Long Key 1 ")
1212
return aString
1313
}
1414

1515
@State var valueText1: String = "1234567890 12345678"
1616

1717
var key2: AttributedString {
18-
var aString = AttributedString("Key 2")
18+
let aString = AttributedString("Key 2")
1919
return aString
2020
}
2121

2222
@State var valueText2: String = "This is a test"
2323

2424
var key3: AttributedString {
25-
var aString = AttributedString("Key 3")
25+
let aString = AttributedString("Key 3")
2626
return aString
2727
}
2828

@@ -65,8 +65,13 @@ struct KeyValueFormViewExample: View {
6565
Toggle("Mandatory Field", isOn: self.$isRequired)
6666
.padding(.leading, 16)
6767
.padding(.trailing, 16)
68+
Button("Dismiss Keyboard") {
69+
hideKeyboard()
70+
}
71+
.padding(.leading, 16)
72+
.padding(.trailing, 16)
6873

69-
Text("Default KeyValueFormView")
74+
Text("Default KeyValueForm")
7075
KeyValueFormView(title: self.key1, text: self.$valueText1, placeholder: "KeyValueFormView", errorMessage: self.getErrorMessage(), maxTextLength: self.getMaxTextLength(), hintText: self.getHintText(), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: self.isRequired)
7176

7277
Text("Existing Text")
@@ -104,6 +109,14 @@ struct KeyValueFormViewExample: View {
104109
}
105110
}
106111

112+
#if canImport(UIKit)
113+
extension View {
114+
func hideKeyboard() {
115+
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
116+
}
117+
}
118+
#endif
119+
107120
// #Preview {
108121
// KeyValueFormViewExample()
109122
// }

Diff for: Apps/Examples/Examples/FioriSwiftUICore/FormViews/NoteFormViewExample.swift

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ struct NoteFormViewExample: View {
4343
Toggle("Hides Read-Only Hint", isOn: self.$hidesReadonlyHint)
4444
.padding(.leading, 16)
4545
.padding(.trailing, 16)
46+
Button("Dismiss Keyboard") {
47+
hideKeyboard()
48+
}
49+
.padding(.leading, 16)
50+
.padding(.trailing, 16)
4651

4752
Text("Default NoteForm")
4853
NoteFormView(text: self.$valueText1, placeholder: "NoteFormView", errorMessage: self.getErrorMessage(), maxTextLength: self.getMaxTextLength(), hintText: self.getHintText(), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit)

Diff for: Apps/Examples/Examples/FioriSwiftUICore/FormViews/TextFieldFormViewExample.swift

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ struct TextFieldFormViewExample: View {
6464
Toggle("Mandatory Field", isOn: self.$isRequired)
6565
.padding(.leading, 16)
6666
.padding(.trailing, 16)
67+
Button("Dismiss Keyboard") {
68+
hideKeyboard()
69+
}
70+
.padding(.leading, 16)
71+
.padding(.trailing, 16)
6772

6873
Text("Default TitleForm")
6974
TextFieldFormView(title: self.key1, text: self.$valueText1, placeholder: "TextFieldFormView", errorMessage: self.getErrorMessage(), maxTextLength: self.getMaxTextLength(), hintText: self.getHintText(), isCharCountEnabled: self.showsCharCount, allowsBeyondLimit: self.allowsBeyondLimit, isRequired: self.isRequired, actionIcon: self.getActionIcon(), action: self.getAction())

Diff for: Sources/FioriSwiftUICore/Utils/EqualWidthWithMaxWidthHStackLayout.swift

-108
This file was deleted.

Diff for: Sources/FioriSwiftUICore/_ComponentProtocols/BaseComponentProtocols.swift

+14
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ protocol _SecondaryActionComponent {
138138
var secondaryAction: FioriButton? { get }
139139
}
140140

141+
// sourcery: BaseComponent
142+
protocol _TertiaryActionComponent {
143+
// sourcery: @ViewBuilder
144+
var tertiaryAction: FioriButton? { get }
145+
}
146+
147+
// sourcery: BaseComponent
148+
protocol _OverflowActionComponent {
149+
// sourcery: @ViewBuilder
150+
// sourcery: defaultValue = "FioriButton { _ in Image(systemName: "ellipsis") }"
151+
// sourcery: resultBuilder.defaultValue = "{ FioriButton { _ in Image(systemName: "ellipsis") } }"
152+
var overflowAction: FioriButton? { get }
153+
}
154+
141155
// sourcery: BaseComponent
142156
protocol _Row1Component {
143157
// var numberOfLines: Int { get set }

Diff for: Sources/FioriSwiftUICore/_ComponentProtocols/CompositeComponentProtocols.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protocol _CardMainHeaderComponent: _TitleComponent, _SubtitleComponent, _IconsCo
2424
protocol _CardExtHeaderComponent: _Row1Component, _Row2Component, _Row3Component, _KpiComponent, _KpiCaptionComponent {}
2525

2626
// sourcery: CompositeComponent
27-
protocol _CardFooterComponent: _ActionComponent, _SecondaryActionComponent {}
27+
protocol _CardFooterComponent: _ActionComponent, _SecondaryActionComponent, _TertiaryActionComponent, _OverflowActionComponent {}
2828

2929
// sourcery: CompositeComponent
3030
protocol _CardHeaderComponent: _CardMediaComponent, _CardMainHeaderComponent, _CardExtHeaderComponent {}

0 commit comments

Comments
 (0)