Skip to content

Commit

Permalink
chore: 🤖 Finish Deprecating ProgressIndicator (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
angiexyang authored Dec 2, 2024
1 parent ec6d23f commit c7dbd20
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ public protocol OptionListPickerComponent : AnyObject {
var hint: String? { get }
}

public protocol ProgressIndicatorComponent {
var progressIndicatorText: String? { get }
}

public protocol SliderPickerComponent : AnyObject {
// sourcery: bindingProperty
// sourcery: no_view
Expand Down Expand Up @@ -253,3 +249,7 @@ public protocol ActionComponent {
// sourcery: no_view
var didSelectAction: (() -> Void)? { get }
}

public protocol ProgressIndicatorComponent {
var progressIndicatorText: String? { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ struct ActionItemsModifierKey: EnvironmentKey {
public static let defaultValue = AnyViewModifier { $0 }
}

struct ProgressIndicatorTextModifierKey: EnvironmentKey {
struct TextInputValueModifierKey: EnvironmentKey {
public static let defaultValue = AnyViewModifier { $0 }
}

struct TextInputValueModifierKey: EnvironmentKey {
struct ActionTextModifierKey: EnvironmentKey {
public static let defaultValue = AnyViewModifier { $0 }
}

struct ActionTextModifierKey: EnvironmentKey {
struct ProgressIndicatorTextModifierKey: EnvironmentKey {
public static let defaultValue = AnyViewModifier { $0 }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ extension EnvironmentValues {
set { self[ActionItemsModifierKey.self] = newValue }
}

public var progressIndicatorTextModifier: AnyViewModifier {
get { return self[ProgressIndicatorTextModifierKey.self] }
set { self[ProgressIndicatorTextModifierKey.self] = newValue }
}

public var textInputValueModifier: AnyViewModifier {
get { return self[TextInputValueModifierKey.self] }
set { self[TextInputValueModifierKey.self] = newValue }
Expand All @@ -214,6 +209,11 @@ extension EnvironmentValues {
set { self[ActionTextModifierKey.self] = newValue }
}

public var progressIndicatorTextModifier: AnyViewModifier {
get { return self[ProgressIndicatorTextModifierKey.self] }
set { self[ProgressIndicatorTextModifierKey.self] = newValue }
}

public var actionModifier: AnyViewModifier {
get { return self[ActionModifierKey.self] }
set { self[ActionModifierKey.self] = newValue }
Expand Down Expand Up @@ -498,11 +498,6 @@ public extension View {
self.environment(\.actionItemsModifier, AnyViewModifier(transform))
}

@ViewBuilder
func progressIndicatorTextModifier<V: View>(_ transform: @escaping (AnyViewModifier.Content) -> V) -> some View {
self.environment(\.progressIndicatorTextModifier, AnyViewModifier(transform))
}

@ViewBuilder
func textInputValueModifier<V: View>(_ transform: @escaping (AnyViewModifier.Content) -> V) -> some View {
self.environment(\.textInputValueModifier, AnyViewModifier(transform))
Expand All @@ -513,6 +508,11 @@ public extension View {
self.environment(\.actionTextModifier, AnyViewModifier(transform))
}

@ViewBuilder
func progressIndicatorTextModifier<V: View>(_ transform: @escaping (AnyViewModifier.Content) -> V) -> some View {
self.environment(\.progressIndicatorTextModifier, AnyViewModifier(transform))
}

@ViewBuilder
func actionModifier<V: View>(_ transform: @escaping (AnyViewModifier.Content) -> V) -> some View {
self.environment(\.actionModifier, AnyViewModifier(transform))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated using Sourcery 2.1.7 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
//TODO: Copy commented code to new file: `FioriSwiftUICore/Views/ProgressIndicator+View.swift`
//TODO: Implement ProgressIndicator `View` body
//TODO: Copy commented code to new file: `FioriSwiftUICore/Views/_ProgressIndicator+View.swift`
//TODO: Implement _ProgressIndicator `View` body

/// - Important: to make `@Environment` properties (e.g. `horizontalSizeClass`), internally accessible
/// to extensions, add as sourcery annotation in `FioriSwiftUICore/Models/ModelDefinitions.swift`
Expand All @@ -13,21 +13,21 @@ import SwiftUI
// FIXME: - Implement Fiori style definitions
// FIXME: - Implement ProgressIndicator View body
// FIXME: - Implement _ProgressIndicator View body
extension ProgressIndicator: View {
extension _ProgressIndicator: View {
public var body: some View {
<# View body #>
}
}
// FIXME: - Implement ProgressIndicator specific LibraryContentProvider
// FIXME: - Implement _ProgressIndicator specific LibraryContentProvider
@available(iOS 14.0, macOS 11.0, *)
struct ProgressIndicatorLibraryContent: LibraryContentProvider {
struct _ProgressIndicatorLibraryContent: LibraryContentProvider {
@LibraryContentBuilder
var views: [LibraryItem] {
LibraryItem(ProgressIndicator(model: LibraryPreviewData.Person.laurelosborn),
LibraryItem(_ProgressIndicator(model: LibraryPreviewData.Person.laurelosborn),
category: .control)
}
}
Expand Down
3 changes: 2 additions & 1 deletion sourcery/.lib/Sources/utils/Type+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public extension Type {
"_ActionModel",
"_ObjectItemModel",
"_SideBarModel",
"_SideBarListItemModel"]
"_SideBarListItemModel",
"_ProgressIndicatorModel"]

if deprecatedComponents.contains(name) {
return name.replacingOccurrences(of: "Model", with: "")
Expand Down

0 comments on commit c7dbd20

Please sign in to comment.