Skip to content
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

Expose combo filtering strategy 14.0.x #11844

Merged
merged 13 commits into from
Jul 12, 2022
Merged

Conversation

wnvko
Copy link
Contributor

@wnvko wnvko commented Jul 11, 2022

Closes #9884
Closes #11532
Closes #11810

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Sorry, something went wrong.

PlamenaMiteva and others added 6 commits July 11, 2022 19:57

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
# Conflicts:
#	projects/igniteui-angular/src/lib/combo/combo.common.ts
#	projects/igniteui-angular/src/lib/combo/combo.component.html
# Conflicts:
#	projects/igniteui-angular/src/lib/combo/combo.common.ts
# Conflicts:
#	CHANGELOG.md
Lipata
Lipata previously approved these changes Jul 11, 2022
@@ -875,13 +894,29 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
protected destroy$ = new Subject<any>();
protected _onTouchedCallback: () => void = noop;
protected _onChangeCallback: (_: any) => void = noop;
protected _defaultFilterFunction = (collection: any[], searchValue: any, matchCase: boolean): any[] => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define the default filtering function in the pipe and pass it as a default value for the transform method filterFunction parameter. This way when your combo input filterFunction is undefined, the default logic will be applied.

@wnvko wnvko changed the title Mvenkov/combo filtering 14.0.x Expose combo filtering strategy 14.0.x Jul 12, 2022
Lipata
Lipata previously approved these changes Jul 12, 2022
@Lipata Lipata added ✅ status: verified Applies to PRs that have passed manual verification and removed 💥 status: in-test PRs currently being tested labels Jul 12, 2022
* ```
*/
@Input()
public get filterFunction(): (collection: any[], searchValue: any, caseSensitive: boolean) => any[] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You no longer need a get and a set as well as a private variable!


public transform(
collection: any[],
filterFunction: (collection: any[], searchValue: any, caseSensitive: boolean) => any[],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the end and assign it in the function definition to _defaultFilterFunction

@Lipata Lipata added the squash-merge Merge PR with "Squash and Merge" option label Jul 12, 2022
@ChronosSF ChronosSF merged commit 6b837e2 into 14.0.x Jul 12, 2022
@ChronosSF ChronosSF deleted the mvenkov/combo-filtering-14.0.x branch July 12, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
combo filtering simple-combo squash-merge Merge PR with "Squash and Merge" option version: 14.0.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants