-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 💡 [HCPSDKFIORIUIKIT-2879] KeyValueItem Refactor
- Loading branch information
1 parent
33d3788
commit 021bd17
Showing
37 changed files
with
891 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
Apps/Examples/Examples/FioriSwiftUICore/Views/_KeyValueItemExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import FioriSwiftUICore | ||
import SwiftUI | ||
|
||
struct _KeyValueItemExample: View { | ||
var body: some View { | ||
Text("_KeyValueItemExample") | ||
List { | ||
Text("Default Horizontal") | ||
_KeyValueItem { | ||
Text("Key 1") | ||
|
||
} value: { | ||
Text("Value 1") | ||
} | ||
|
||
Text("Vertical") | ||
_KeyValueItem(key: { | ||
Text("Vertical Axis") | ||
}, value: { | ||
Text("Value 2") | ||
}, axis: .vertical) | ||
|
||
Text("Custom Color and Font") | ||
_KeyValueItem { | ||
Text("Custom Color") | ||
.foregroundStyle(.red) | ||
.font(.fiori(forTextStyle: .title1)) | ||
} value: { | ||
Text("Value 3") | ||
.foregroundStyle(.brown) | ||
.font(.fiori(forTextStyle: .footnote)) | ||
} | ||
|
||
Text("Verticle Custom Color and Font") | ||
_KeyValueItem(key: { | ||
Text("Custom Color and Font Vertical Axis") | ||
.foregroundStyle(.red) | ||
.font(.fiori(forTextStyle: .title1)) | ||
}, value: { | ||
Text("Value 4") | ||
.foregroundStyle(.brown) | ||
.font(.fiori(forTextStyle: .footnote)) | ||
}, axis: .vertical) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
_KeyValueItemExample() | ||
} |
3 changes: 0 additions & 3 deletions
3
Sources/FioriCharts/Resources/sr-Latn-RS.lproj/Localizable.strings
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Sources/FioriSwiftUICore/_FioriStyles/KeyStyle.fiori.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import FioriThemeManager | ||
|
||
// Generated using Sourcery 2.1.7 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
import Foundation | ||
import SwiftUI | ||
|
||
/// ** | ||
// This file provides default fiori style for the component. | ||
// | ||
// 1. Uncomment the following code. | ||
// 2. Implement layout and style in corresponding places. | ||
// 3. Delete `.generated` from file name. | ||
// 4. Move this file to `_FioriStyles` folder under `FioriSwiftUICore`. | ||
// */ | ||
// | ||
// Base Layout style | ||
public struct KeyBaseStyle: KeyStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: KeyConfiguration) -> some View { | ||
// Add default layout here | ||
configuration.key | ||
} | ||
} | ||
|
||
// Default fiori styles | ||
public struct KeyFioriStyle: KeyStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: KeyConfiguration) -> some View { | ||
Key(configuration) | ||
// Add default style here | ||
// .foregroundStyle(Color.preferredColor(<#fiori color#>)) | ||
// .font(.fiori(forTextStyle: <#fiori font#>)) | ||
} | ||
} |
Oops, something went wrong.