-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: 💡 step progress indicator #944
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,7 +433,7 @@ public protocol KPIHeaderItemModel {} | |
// sourcery: virtualPropStepState = "var state: StepProgressIndicatorState?" | ||
// sourcery: virtualPropIsLastStep = "var isLastStep: Bool = false" | ||
// sourcery: generated_component_composite | ||
public protocol SingleStepModel { | ||
public protocol _SingleStepModel { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) |
||
// sourcery: default.value = UUID().uuidString | ||
// sourcery: no_view | ||
var id: String { get set } | ||
|
@@ -446,17 +446,20 @@ public protocol SingleStepModel { | |
// sourcery: backingComponent=_StepsContainer | ||
// sourcery: customFunctionBuilder=IndexedViewBuilder | ||
// sourcery: genericParameter.type=IndexedViewContainer | ||
var substeps: [SingleStepModel] { get set } | ||
var substeps: [_SingleStepModel] { get set } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) |
||
} | ||
|
||
@available(*, unavailable, renamed: "_SingleStepModel", message: "Will be removed in the future release. Please use SingleStep instead.") | ||
public protocol SingleStepModel {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) |
||
|
||
// sourcery: add_env_props = "presentationMode" | ||
// sourcery: virtualPropAxis = "var axis: Axis = .horizontal" | ||
// sourcery: virtualPropStepsData = "var stepItems: [StepItem] = []" | ||
// sourcery: virtualPropIsPresented = "@State var isPresented: Bool = false" | ||
// sourcery: virtualPropStepFrames = "@State var stepFrames: [String: CGRect] = [:]" | ||
// sourcery: virtualPropScrollBounds = "@State var scrollBounds: CGRect = .zero" | ||
// sourcery: generated_component_composite | ||
public protocol StepProgressIndicatorModel: AnyObject { | ||
public protocol _StepProgressIndicatorModel: AnyObject { | ||
// sourcery: bindingProperty | ||
// sourcery: no_view | ||
var selection: String { get set } | ||
|
@@ -471,13 +474,16 @@ public protocol StepProgressIndicatorModel: AnyObject { | |
// sourcery: backingComponent=_StepsContainer | ||
// sourcery: customFunctionBuilder=IndexedViewBuilder | ||
// sourcery: genericParameter.type=IndexedViewContainer | ||
var steps: [SingleStepModel] { get } | ||
var steps: [_SingleStepModel] { get } | ||
|
||
// sourcery: genericParameter.name = CancelActionView | ||
// sourcery: default.value = _CancelActionDefault() | ||
var cancelAction: _ActionModel? { get } | ||
} | ||
|
||
@available(*, unavailable, renamed: "_StepProgressIndicatorModel", message: "Will be removed in the future release. Please use StepProgressIndicator instead.") | ||
public protocol StepProgressIndicatorModel {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Docs Violation: public declarations should be documented. (missing_docs) |
||
|
||
// sourcery: generated_component_composite | ||
public protocol FilterFeedbackBarModel: AnyObject { | ||
// sourcery: bindingProperty | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import SwiftUI | ||
|
||
struct StepsStack: View { | ||
var steps: [StepItem] | ||
var selection: Binding<String>? = nil | ||
/// :nodoc: | ||
init(_ steps: [StepItem], selection: Binding<String>? = nil) { | ||
self.steps = steps | ||
self.selection = selection | ||
} | ||
|
||
var body: some View { | ||
ForEach(0 ..< self.count, id: \.self) { index in | ||
self.view(at: index) | ||
} | ||
} | ||
} | ||
|
||
extension StepsStack: IndexedViewContainer { | ||
/// :nodoc: | ||
public var count: Int { | ||
self.steps.count | ||
} | ||
|
||
/// :nodoc: | ||
@ViewBuilder public func view(at index: Int) -> some View { | ||
if index < self.count { | ||
_DefaultSteps(stepItems: self.steps, selection: self.selection ?? .constant("")).view(at: index) | ||
} else { | ||
EmptyView() | ||
} | ||
} | ||
|
||
@ViewBuilder func titleView(for title: String?) -> some View { | ||
if let title { | ||
Text(title) | ||
} else { | ||
EmptyView() | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Docs Violation: public declarations should be documented. (missing_docs)