Skip to content
Snippets Groups Projects
Commit 9e51768f authored by Martin Massenberg's avatar Martin Massenberg Committed by Volker Schukai
Browse files

feat: new options to define the markers that are used for the label template #203

parent dba09096
No related branches found
No related tags found
No related merge requests found
# Changelog
## 2024-06-22
- new options to define the markers that are used for the label template [#203](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/203)
## [3.66.0] - 2024-06-21
......
......@@ -215,6 +215,10 @@ class Filter extends CustomElement {
* @property {Object} templates Template definitions
* @property {string} templates.main Main template
* @property {Object} labels Label definitions
* @property {Object} formatter label Template Formatter definitions
* @property {Object} formatter.marker
* @property {Object} formatter.marker.open
* @property {Object} formatter.marker.close
* @property {string} labels.search Search button label
* @property {string} labels.reset Reset button label
* @property {Object} queries Query definitions
......@@ -227,8 +231,14 @@ class Filter extends CustomElement {
templates: {
main: getTemplate(),
},
formatter: {
marker: {
open: null,
close: null
}
},
labels: {
search: "Search",
reset: "Reset",
save: "Save",
......@@ -925,6 +935,7 @@ function buildSearchQuery(queries) {
*/
function collectSearchQueries() {
const currentHash = parseBracketedKeyValueHash(getGlobal().location.hash);
const self = this;
return new Promise((resolve, reject) => {
const query = [];
......@@ -1001,6 +1012,10 @@ function collectSearchQueries() {
},
});
if (self.getOption("formatter.marker.open")) {
formatter.setMarker(self.getOption("formatter.marker.open"),self.getOption("formatter.marker.close"));
}
let queryPart = formatter.format(template);
if (queryPart) {
if (isFunction(wrapCallback)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment