-
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
feat: 🎸 sort & filter enhancement part 2 #820
Merged
billzhou0223
merged 9 commits into
SAP:main
from
restaurantt:main-IOSSDKBUG-347-enhancement
Oct 17, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b84cc94
feat: 🎸 sort & filter enhancement part 2
restaurantt 58440d5
feat: 🎸 sort & filter enhancement part 2
restaurantt f953c7c
feat: 🎸 sort & filter enhancement part 2
restaurantt 3a109ae
Merge branch 'main' into main-IOSSDKBUG-347-enhancement
dyongxu 4db8bef
feat: 🎸 sort & filter enhancement part 2
restaurantt 3e4f923
Merge branch 'main-IOSSDKBUG-347-enhancement' of https://github.com/r…
restaurantt ce195e4
Merge branch 'main' into main-IOSSDKBUG-347-enhancement
restaurantt 8191698
feat: 🎸 sort & filter enhancement part 2
restaurantt 71f2362
Merge branch 'main' into main-IOSSDKBUG-347-enhancement
restaurantt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ public enum SortFilterItem: Identifiable, Hashable { | |
/// | ||
/// 2. A section of view containing a SwiftUI Canlendar | ||
case datetime(item: DateTimeItem, showsOnFilterFeedbackBar: Bool) | ||
|
||
public var showsOnFilterFeedbackBar: Bool { | ||
switch self { | ||
case .picker(_, let showsOnFilterFeedbackBar): | ||
|
@@ -311,9 +311,23 @@ public extension SortFilterItem { | |
public let allowsEmptySelection: Bool | ||
public var showsValueForSingleSelected: Bool = true | ||
public let icon: String? | ||
/// itemLayout is used when listPickerMode is filterFormCell, otherwise is ignored. | ||
public var itemLayout: OptionListPickerItemLayoutType = .fixed | ||
|
||
public init(id: String = UUID().uuidString, name: String, value: [Int], valueOptions: [String], allowsMultipleSelection: Bool, allowsEmptySelection: Bool, showsValueForSingleSelected: Bool = true, icon: String? = nil, itemLayout: OptionListPickerItemLayoutType = .fixed) { | ||
public var displayMode: DisplayMode = .automatic | ||
|
||
/// Available OptionListPicker modes. Use this enum to define picker mode to present. | ||
public enum DisplayMode { | ||
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. Nesting Violation: Types should be nested at most 1 level deep (nesting) |
||
/// Decided by options count | ||
case automatic | ||
/// FilterFormCell | ||
case filterFormCell | ||
/// Menu | ||
case menu | ||
/// List | ||
case list | ||
} | ||
|
||
public init(id: String = UUID().uuidString, name: String, value: [Int], valueOptions: [String], allowsMultipleSelection: Bool, allowsEmptySelection: Bool, showsValueForSingleSelected: Bool = true, icon: String? = nil, itemLayout: OptionListPickerItemLayoutType = .fixed, displayMode: DisplayMode = .automatic) { | ||
self.id = id | ||
self.name = name | ||
self.value = value | ||
|
@@ -325,6 +339,7 @@ public extension SortFilterItem { | |
self.showsValueForSingleSelected = showsValueForSingleSelected | ||
self.icon = icon | ||
self.itemLayout = itemLayout | ||
self.displayMode = displayMode | ||
} | ||
|
||
mutating func onTap(option: String) { | ||
|
@@ -389,6 +404,15 @@ public extension SortFilterItem { | |
self.workingValue.contains(index) | ||
} | ||
|
||
mutating func selectAll(_ isAll: Bool) { | ||
self.workingValue.removeAll() | ||
if isAll { | ||
for i in 0 ..< self.valueOptions.count { | ||
self.workingValue.append(i) | ||
} | ||
} | ||
} | ||
|
||
var isChecked: Bool { | ||
!self.value.isEmpty | ||
} | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)