From d91a0512660ed2b9ea1ef3241831c8495fbac6dd Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 24 Feb 2022 17:01:13 +0100 Subject: [PATCH] [Project] Updated strolch-wc-* versions --- bower.json | 6 ++-- strolch-wc-reports.html | 65 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index eaf171e..cc7f2ba 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "strolch-wc-reports", "description": "Strolch WebComponent Reports", - "version": "0.3.3", + "version": "0.4.0", "authors": [ "Robert von Burg" ], @@ -19,11 +19,11 @@ "homepage": "https://github.com/strolch-li/strolch-wc-reports", "ignore": [], "dependencies": { - "strolchjs": "strolch-li/strolchjs#^0.5.0", + "strolchjs": "strolch-li/strolchjs#^0.5.1", "strolch-wc-styles": "strolch-li/strolch-wc-styles#^0.3.1", "strolch-wc-badge": "strolch-li/strolch-wc-badge#^0.1.1", "strolch-wc-debounced-input": "strolch-li/strolch-wc-debounced-input#^0.1.1", - "strolch-wc-localize-behavior": "strolch-li/strolch-wc-localize-behavior#^1.1.13", + "strolch-wc-localize-behavior": "strolch-li/strolch-wc-localize-behavior#^1.1.14", "polymer": "Polymer/polymer#^1.11.3", diff --git a/strolch-wc-reports.html b/strolch-wc-reports.html index a75a16a..5512040 100644 --- a/strolch-wc-reports.html +++ b/strolch-wc-reports.html @@ -124,7 +124,7 @@ width: calc(var(--facet-width) - 20px); } - #facetContainer > strolch-wc-reports-facet:not(:last-of-type) { + #facetContainer > strolch-wc-reports-facet:not(:last-child) { margin-bottom: 16px; } @@ -229,6 +229,18 @@ .bold { font-weight: bold; } + + paper-card { + background-color: white; + margin-right: 20px; + padding-left: 10px; + padding-right: 10px; + } + + paper-input { + display: inline-block; + width: calc(100% - 45px); + } } @@ -352,6 +364,29 @@ facet-limit="[[facetLimit]]" on-facet-loading="onFacetLoading"> + + + + + +
@@ -429,6 +464,10 @@ value: true, observer: 'showFacetsChanged' }, + trimFacetValues: { + type: Boolean, + value: false + }, facets: { type: Array, value: [] @@ -505,6 +544,12 @@ _getParallel: function (parallel) { return parallel === true ? "p" : "s" }, + arrayEmpty: function (arr) { + return arr == null || arr.length === 0; + }, + arrayFilled: function (arr) { + return !this.arrayEmpty(arr); + }, /* Observers */ observers: [ @@ -727,13 +772,19 @@ this.facets = []; // set the new report id - var reportId = this.reports[this.selectedReportIndex].id; - this.reportId = reportId; - this.$.ajaxGetFacets.params = { - limit: 10 - }; + var report = this.reports[this.selectedReportIndex]; + this.reportId = report.id; + this.trimFacetValues = report.trimFacetValues === true; + this.$.ajaxGetFacets.params.limit = this.facetLimit; this.$.ajaxGetFacets.generateRequest(); - Strolch.setQueryParamValue("reportId", reportId); + Strolch.setQueryParamValue("reportId", this.reportId); + }, + + reloadFacets: function () { + if (Strolch.isInteger(this.facetLimit)) { + this.$.ajaxGetFacets.params.limit = this.facetLimit; + this.$.ajaxGetFacets.generateRequest(); + } }, onSelectionChanged: function (event) {