[Project] Updated strolch-wc-* versions

This commit is contained in:
Robert von Burg 2022-02-24 17:01:13 +01:00
parent 988c2bd896
commit d91a051266
2 changed files with 61 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "strolch-wc-reports", "name": "strolch-wc-reports",
"description": "Strolch WebComponent Reports", "description": "Strolch WebComponent Reports",
"version": "0.3.3", "version": "0.4.0",
"authors": [ "authors": [
"Robert von Burg" "Robert von Burg"
], ],
@ -19,11 +19,11 @@
"homepage": "https://github.com/strolch-li/strolch-wc-reports", "homepage": "https://github.com/strolch-li/strolch-wc-reports",
"ignore": [], "ignore": [],
"dependencies": { "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-styles": "strolch-li/strolch-wc-styles#^0.3.1",
"strolch-wc-badge": "strolch-li/strolch-wc-badge#^0.1.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-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", "polymer": "Polymer/polymer#^1.11.3",

View File

@ -124,7 +124,7 @@
width: calc(var(--facet-width) - 20px); 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; margin-bottom: 16px;
} }
@ -229,6 +229,18 @@
.bold { .bold {
font-weight: 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);
}
} }
</style> </style>
@ -352,6 +364,29 @@
facet-limit="[[facetLimit]]" facet-limit="[[facetLimit]]"
on-facet-loading="onFacetLoading"></strolch-wc-reports-facet> on-facet-loading="onFacetLoading"></strolch-wc-reports-facet>
</template> </template>
<paper-card raised>
<template is="dom-if" if="[[arrayEmpty(facets)]]">
<p><i>[[localize('noFacetsAvailable')]]</i></p>
</template>
<template is="dom-if" if="[[arrayFilled(facets)]]">
<template is="dom-if" if="[[trimFacetValues]]">
<p><i>[[localize('facetsAreBeingTrimmed')]]</i></p>
</template>
<template is="dom-if" if="[[!trimFacetValues]]">
<paper-input required
label="[[localize('facetLimit')]]"
type="number"
auto-validate
min="1"
max="100"
value="{{facetLimit}}">
</paper-input>
<paper-icon-button icon="refresh" on-tap="reloadFacets"></paper-icon-button>
</template>
</template>
</paper-card>
</div> </div>
<div id="tableContainer"> <div id="tableContainer">
@ -429,6 +464,10 @@
value: true, value: true,
observer: 'showFacetsChanged' observer: 'showFacetsChanged'
}, },
trimFacetValues: {
type: Boolean,
value: false
},
facets: { facets: {
type: Array, type: Array,
value: [] value: []
@ -505,6 +544,12 @@
_getParallel: function (parallel) { _getParallel: function (parallel) {
return parallel === true ? "p" : "s" return parallel === true ? "p" : "s"
}, },
arrayEmpty: function (arr) {
return arr == null || arr.length === 0;
},
arrayFilled: function (arr) {
return !this.arrayEmpty(arr);
},
/* Observers */ /* Observers */
observers: [ observers: [
@ -727,13 +772,19 @@
this.facets = []; this.facets = [];
// set the new report id // set the new report id
var reportId = this.reports[this.selectedReportIndex].id; var report = this.reports[this.selectedReportIndex];
this.reportId = reportId; this.reportId = report.id;
this.$.ajaxGetFacets.params = { this.trimFacetValues = report.trimFacetValues === true;
limit: 10 this.$.ajaxGetFacets.params.limit = this.facetLimit;
};
this.$.ajaxGetFacets.generateRequest(); 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) { onSelectionChanged: function (event) {