Comparing version 2.5.2 to 2.5.3
@@ -110,2 +110,4 @@ import { LitElement, html, css } from 'lit'; | ||
hideErrorOnInput: { type: Boolean }, | ||
/** Additional query string data */ | ||
additionalQueryString: {type: Object }, | ||
}; | ||
@@ -298,3 +300,2 @@ } | ||
onTextInput(e) { | ||
console.log('onTextInput', e); | ||
this.keyword = e.detail.keyword; | ||
@@ -314,3 +315,5 @@ this.loadData(); | ||
this.ajaxError = false; | ||
fetch(`${this.endpoint}?${this.queryStringVariable}=${this.keyword}`) | ||
const url = this.computeRequestURL(); | ||
fetch(url) | ||
.then(response => response.json()) | ||
@@ -320,2 +323,17 @@ .then(json => this.registerData(json)) | ||
} | ||
computeRequestURL() { | ||
const baseUrl = `${this.endpoint}?${this.queryStringVariable}=${this.keyword}`; | ||
if (this.additionalQueryString && typeof this.additionalQueryString === 'object') { | ||
const additionalParams = Object.entries(this.additionalQueryString) | ||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) | ||
.join('&'); | ||
return `${baseUrl}&${additionalParams}`; | ||
} | ||
return baseUrl; | ||
} | ||
@@ -322,0 +340,0 @@ registerError(err) { |
{ | ||
"name": "@dile/ui", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"description": "UI Core components from dile-components.", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "ddbdaed2692688f0fcdb6d30bfae38fcda5a1e0c" | ||
"gitHead": "213421f317cd0fcaa7b6ca20834d292fce8ded7f" | ||
} |
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
235212
7471