@mekari/pixel-autocomplete
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -48,2 +48,3 @@ 'use strict'; | ||
* @prop {boolean} isInfinityScroll - If true, autocomplete will enable infinity scroll. Get callback from `scroll-end`. | ||
* @prop {boolean} isManualFilter - If true, autocomplete filter data will handle manually. Useful when data is being filtered server side. | ||
*/ | ||
@@ -107,3 +108,4 @@ const useAutocompleteProps = { | ||
}, | ||
isInfinityScroll: [Boolean] | ||
isInfinityScroll: [Boolean], | ||
isManualFilter: [Boolean] | ||
}; | ||
@@ -180,10 +182,6 @@ | ||
getSuggestions() { | ||
if (this.currentSearch === this.currentLabel) { | ||
if (this.isManualFilter || this.currentSearch === this.currentLabel || this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
if (this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
return this.suggestions.filter(suggestion => { | ||
@@ -190,0 +188,0 @@ const search = this.currentSearch || ''; |
@@ -48,2 +48,3 @@ 'use strict'; | ||
* @prop {boolean} isInfinityScroll - If true, autocomplete will enable infinity scroll. Get callback from `scroll-end`. | ||
* @prop {boolean} isManualFilter - If true, autocomplete filter data will handle manually. Useful when data is being filtered server side. | ||
*/ | ||
@@ -107,3 +108,4 @@ const useAutocompleteProps = { | ||
}, | ||
isInfinityScroll: [Boolean] | ||
isInfinityScroll: [Boolean], | ||
isManualFilter: [Boolean] | ||
}; | ||
@@ -180,10 +182,6 @@ | ||
getSuggestions() { | ||
if (this.currentSearch === this.currentLabel) { | ||
if (this.isManualFilter || this.currentSearch === this.currentLabel || this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
if (this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
return this.suggestions.filter(suggestion => { | ||
@@ -190,0 +188,0 @@ const search = this.currentSearch || ''; |
@@ -44,2 +44,3 @@ import { MpInputGroup, MpInput, MpInputRightAddon } from '@mekari/pixel-input'; | ||
* @prop {boolean} isInfinityScroll - If true, autocomplete will enable infinity scroll. Get callback from `scroll-end`. | ||
* @prop {boolean} isManualFilter - If true, autocomplete filter data will handle manually. Useful when data is being filtered server side. | ||
*/ | ||
@@ -103,3 +104,4 @@ const useAutocompleteProps = { | ||
}, | ||
isInfinityScroll: [Boolean] | ||
isInfinityScroll: [Boolean], | ||
isManualFilter: [Boolean] | ||
}; | ||
@@ -176,10 +178,6 @@ | ||
getSuggestions() { | ||
if (this.currentSearch === this.currentLabel) { | ||
if (this.isManualFilter || this.currentSearch === this.currentLabel || this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
if (this.currentSearch === this.currentValue) { | ||
return this.suggestions; | ||
} | ||
return this.suggestions.filter(suggestion => { | ||
@@ -186,0 +184,0 @@ const search = this.currentSearch || ''; |
{ | ||
"name": "@mekari/pixel-autocomplete", | ||
"description": "Mekari Pixel | Selecting items in a list from a text input component", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"homepage": "https://mekari.design/", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -87,10 +87,10 @@ import { MpInput, MpInputGroup, MpInputRightAddon } from '@mekari/pixel-input' | ||
getSuggestions() { | ||
if (this.currentSearch === this.currentLabel) { | ||
if ( | ||
this.isManualFilter || | ||
this.currentSearch === this.currentLabel || | ||
this.currentSearch === this.currentValue | ||
) { | ||
return this.suggestions | ||
} | ||
if (this.currentSearch === this.currentValue) { | ||
return this.suggestions | ||
} | ||
return this.suggestions.filter((suggestion) => { | ||
@@ -97,0 +97,0 @@ const search = this.currentSearch || '' |
@@ -23,2 +23,3 @@ /** | ||
* @prop {boolean} isInfinityScroll - If true, autocomplete will enable infinity scroll. Get callback from `scroll-end`. | ||
* @prop {boolean} isManualFilter - If true, autocomplete filter data will handle manually. Useful when data is being filtered server side. | ||
*/ | ||
@@ -47,3 +48,4 @@ | ||
emptyText: { type: [String], default: 'No result found' }, | ||
isInfinityScroll: [Boolean] | ||
isInfinityScroll: [Boolean], | ||
isManualFilter: [Boolean] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57067