@po-ui/ng-templates 20.1.0 → 20.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5086,12 +5086,14 @@ class PoPageDynamicSearchComponent extends PoPageDynamicSearchBaseComponent {
|
|
|
5086
5086
|
this.poAdvancedFilter.open();
|
|
5087
5087
|
}
|
|
5088
5088
|
onAdvancedSearch(filteredItems, isAdvancedSearch) {
|
|
5089
|
-
const {
|
|
5089
|
+
const { optionsService } = filteredItems;
|
|
5090
|
+
let { filter } = filteredItems;
|
|
5090
5091
|
const visibleFilters = this.visibleFixedFilters === false
|
|
5091
5092
|
? this.filters.filter(filter => !('fixed' in filter) || !filter.fixed)
|
|
5092
5093
|
: this.filters;
|
|
5093
5094
|
this._disclaimerGroup.disclaimers = this.setDisclaimers(filter, optionsService, visibleFilters);
|
|
5094
5095
|
this.setFilters(filter);
|
|
5096
|
+
filter = this.addComplexFilter(filter);
|
|
5095
5097
|
this.advancedSearch.emit(filter);
|
|
5096
5098
|
if (isAdvancedSearch) {
|
|
5097
5099
|
this.poPageList.clearInputSearch();
|
|
@@ -5161,7 +5163,7 @@ class PoPageDynamicSearchComponent extends PoPageDynamicSearchBaseComponent {
|
|
|
5161
5163
|
if (field.type === PoDynamicFieldType.Currency && value) {
|
|
5162
5164
|
return this.formatValueToCurrency(field, value);
|
|
5163
5165
|
}
|
|
5164
|
-
if (field.type === PoDynamicFieldType.Date) {
|
|
5166
|
+
if (field.type === PoDynamicFieldType.Date || field.type?.toLowerCase() === PoDynamicFieldType.DateTime) {
|
|
5165
5167
|
return field.range ? this.formatDate(value.start) + ' - ' + this.formatDate(value.end) : this.formatDate(value);
|
|
5166
5168
|
}
|
|
5167
5169
|
if (field.options && value) {
|
|
@@ -5271,6 +5273,25 @@ class PoPageDynamicSearchComponent extends PoPageDynamicSearchBaseComponent {
|
|
|
5271
5273
|
};
|
|
5272
5274
|
return this.poPageCustomizationService.getCustomOptions(onLoad, originalOption, pageOptionSchema);
|
|
5273
5275
|
}
|
|
5276
|
+
addComplexFilter(filter) {
|
|
5277
|
+
let complexFilter;
|
|
5278
|
+
Object.keys(filter).forEach(property => {
|
|
5279
|
+
if (filter[property].start && filter[property].end) {
|
|
5280
|
+
if (!complexFilter) {
|
|
5281
|
+
complexFilter = '';
|
|
5282
|
+
}
|
|
5283
|
+
else {
|
|
5284
|
+
complexFilter += ' and ';
|
|
5285
|
+
}
|
|
5286
|
+
complexFilter += `${property} ge '${filter[property].start}' and ${property} le '${filter[property].end}'`;
|
|
5287
|
+
delete filter[property];
|
|
5288
|
+
}
|
|
5289
|
+
});
|
|
5290
|
+
if (complexFilter) {
|
|
5291
|
+
filter = Object.assign(filter, { $filter: complexFilter });
|
|
5292
|
+
}
|
|
5293
|
+
return filter;
|
|
5294
|
+
}
|
|
5274
5295
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: PoPageDynamicSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5275
5296
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.7", type: PoPageDynamicSearchComponent, isStandalone: false, selector: "po-page-dynamic-search", viewQueries: [{ propertyName: "poAdvancedFilter", first: true, predicate: PoAdvancedFilterComponent, descendants: true, static: true }, { propertyName: "poPageList", first: true, predicate: PoPageListComponent, descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<po-page-list\n #poPageList\n [p-actions]=\"actions\"\n [p-breadcrumb]=\"breadcrumb\"\n [p-components-size]=\"componentsSize\"\n [p-disclaimer-group]=\"disclaimerGroup\"\n [p-filter]=\"filterSettings\"\n [p-title]=\"title\"\n [p-quick-search-value]=\"quickSearchValue\"\n>\n <po-advanced-filter\n [p-components-size]=\"componentsSize\"\n [p-filters]=\"filters\"\n [p-keep-filters]=\"keepFilters\"\n [p-literals]=\"advancedFilterLiterals\"\n (p-search-event)=\"onAdvancedSearch($event, true)\"\n >\n </po-advanced-filter>\n\n <ng-content></ng-content>\n</po-page-list>\n", dependencies: [{ kind: "component", type: i3.PoPageListComponent, selector: "po-page-list" }, { kind: "component", type: PoAdvancedFilterComponent, selector: "po-advanced-filter" }] });
|
|
5276
5297
|
}
|