Skip to content

Commit 72abec9

Browse files
shengxu7restaurantt
authored andcommitted
feat: 🎸 [jira: 2572] new card footer for Joule Object Card (#706)
* feat: 🎸 [jira: 2572] new card footer for Joule Object Card * fix: 🐛 [jira: 2572] change the backgroud of popup in footer
1 parent d47e85e commit 72abec9

24 files changed

+1332
-166
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: 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)