-
Notifications
You must be signed in to change notification settings - Fork 7
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
FeatureFormView
& PopupView
- Add ._Title(_:)
#839
base: v.next
Are you sure you want to change the base?
Changes from 5 commits
35a2d4b
66017eb
0f36ca3
cc848b4
de3b55d
d60f0ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2024 Esri | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import SwiftUI | ||
|
||
public extension FeatureFormView { | ||
/// The visibility of the form title. | ||
/// - Since: 200.6 | ||
enum TitleVisibility: Sendable { | ||
/// The form title is hidden. | ||
case hidden | ||
/// The form title is visible. | ||
case visible | ||
} | ||
|
||
/// Specifies the visibility of the form title. | ||
/// - Parameter visibility: The preferred visibility of the form title. | ||
/// - Since: 200.6 | ||
func formTitle(_ visibility: TitleVisibility) -> FeatureFormView { | ||
var copy = self | ||
copy.titleVisibility = visibility | ||
return copy | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,10 @@ public extension FeatureFormView { | |
|
||
/// Specifies the visibility of validation errors in the form. | ||
/// - Parameter visibility: The preferred visibility of validation errors in the form. | ||
func validationErrors(_ visibility: ValidationErrorVisibility) -> some View { | ||
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. This needed to change to |
||
environment(\.validationErrorVisibility, visibility) | ||
func validationErrors(_ visibility: ValidationErrorVisibility) -> FeatureFormView { | ||
var copy = self | ||
copy.validationErrorVisibility = visibility | ||
return copy | ||
} | ||
} | ||
|
||
|
@@ -39,6 +41,6 @@ extension EnvironmentValues { | |
} | ||
|
||
/// The validation error visibility configuration of a form. | ||
private struct FormViewValidationErrorVisibility: EnvironmentKey { | ||
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. Changing this to internal allows |
||
struct FormViewValidationErrorVisibility: EnvironmentKey { | ||
static let defaultValue: FeatureFormView.ValidationErrorVisibility = .automatic | ||
} |
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.
Why an enum instead of a
Bool
?shouldShowTitle
, or something similar?