@sumaris-net/ngx-components 2.6.23-beta1 → 2.6.23-beta10
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.
- package/esm2020/src/app/core/services/model/referential.model.mjs +11 -1
- package/esm2020/src/app/shared/named-filter/named-filter-selector.component.mjs +17 -9
- package/esm2020/src/app/shared/services.mjs +2 -2
- package/fesm2015/sumaris-net.ngx-components.mjs +23 -5
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +27 -9
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/named-filter/named-filter-selector.component.d.ts +2 -1
- package/src/app/shared/services.d.ts +1 -0
|
@@ -1171,7 +1171,7 @@ function suggestFromArray(items, value, opts) {
|
|
|
1171
1171
|
let filteredItems = items;
|
|
1172
1172
|
if (isNotNilOrBlank(value)) {
|
|
1173
1173
|
// If wildcard, search using regexp
|
|
1174
|
-
if (value.indexOf('*') !== -1) {
|
|
1174
|
+
if (opts?.anySearch || value.indexOf('*') !== -1) {
|
|
1175
1175
|
value = value.replace(/[*]+/g, '.*');
|
|
1176
1176
|
filteredItems = filteredItems.filter(v => keys.findIndex(key => matchUpperCase(getPropertyByPathAsString(v, key), value)) !== -1);
|
|
1177
1177
|
}
|
|
@@ -16367,6 +16367,16 @@ const StatusById = Object.freeze(splitById(StatusList));
|
|
|
16367
16367
|
class BaseReferential extends Entity {
|
|
16368
16368
|
constructor(__typename) {
|
|
16369
16369
|
super(__typename);
|
|
16370
|
+
this.label = null;
|
|
16371
|
+
this.name = null;
|
|
16372
|
+
this.description = null;
|
|
16373
|
+
this.comments = null;
|
|
16374
|
+
this.creationDate = null;
|
|
16375
|
+
this.statusId = null;
|
|
16376
|
+
this.validityStatusId = null;
|
|
16377
|
+
this.levelId = null;
|
|
16378
|
+
this.parentId = null;
|
|
16379
|
+
this.entityName = null;
|
|
16370
16380
|
}
|
|
16371
16381
|
asObject(opts) {
|
|
16372
16382
|
if (opts && opts.minify) {
|
|
@@ -21338,17 +21348,25 @@ class NamedFilterSelector extends AppForm {
|
|
|
21338
21348
|
return super.dirty || this.filterFormDirty;
|
|
21339
21349
|
}
|
|
21340
21350
|
ngOnInit() {
|
|
21341
|
-
super.ngOnInit();
|
|
21342
|
-
this.registerSubscription(this.form.controls.namedFilter.valueChanges.pipe(debounceTime(100), distinctUntilChanged()).subscribe((value) => this.onFilterChanges(value)));
|
|
21343
|
-
}
|
|
21344
|
-
setEntityName(entityName) {
|
|
21345
|
-
this._entityName = entityName;
|
|
21346
21351
|
this.registerAutocompleteField('namedFilter', {
|
|
21347
21352
|
suggestFn: (value, filter) => this.dataService.suggest(value, filter),
|
|
21348
21353
|
attributes: ['name'],
|
|
21349
|
-
filter:
|
|
21354
|
+
filter: this.getFilter(),
|
|
21350
21355
|
...this.autocompleteConfig
|
|
21351
21356
|
});
|
|
21357
|
+
this.registerSubscription(this.form.controls.namedFilter.valueChanges.pipe(debounceTime(100), distinctUntilChanged()).subscribe((value) => this.onFilterChanges(value)));
|
|
21358
|
+
}
|
|
21359
|
+
setEntityName(entityName) {
|
|
21360
|
+
if (!entityName || this._entityName === entityName)
|
|
21361
|
+
return;
|
|
21362
|
+
this._entityName = entityName;
|
|
21363
|
+
// Update autocomplete filter
|
|
21364
|
+
this.autocompleteField.filter = { ...this.autocompleteField.filter, ...this.getFilter() };
|
|
21365
|
+
}
|
|
21366
|
+
getFilter() {
|
|
21367
|
+
return {
|
|
21368
|
+
entityName: this.entityName,
|
|
21369
|
+
};
|
|
21352
21370
|
}
|
|
21353
21371
|
markForCheck() {
|
|
21354
21372
|
this.cd.markForCheck();
|
|
@@ -21472,10 +21490,10 @@ class NamedFilterSelector extends AppForm {
|
|
|
21472
21490
|
}
|
|
21473
21491
|
}
|
|
21474
21492
|
NamedFilterSelector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NamedFilterSelector, deps: [{ token: i0.Injector }, { token: i1$2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastController }, { token: i2$1.PopoverController }, { token: APP_NAMED_FILTER_SERVICE }], target: i0.ɵɵFactoryTarget.Component });
|
|
21475
|
-
NamedFilterSelector.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NamedFilterSelector, selector: "app-named-filter-selector
|
|
21493
|
+
NamedFilterSelector.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NamedFilterSelector, selector: "app-named-filter-selector", inputs: { entityName: "entityName", filterContentProvider: "filterContentProvider", filterImportCallback: "filterImportCallback", filterFormDirty: "filterFormDirty", showButtons: "showButtons", exportFileNamePrefix: "exportFileNamePrefix", autocompleteConfig: "autocompleteConfig" }, outputs: { filterSelected: "filterSelected", filterDeleted: "filterDeleted" }, viewQueries: [{ propertyName: "autocompleteField", first: true, predicate: MatAutocompleteField, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<form class=\"form-container\" [formGroup]=\"form\">\n <mat-autocomplete-field\n formControlName=\"namedFilter\"\n [config]=\"autocompleteFields.namedFilter\"\n [placeholder]=\"'COMMON.NAMED_FILTER.TITLE' | translate\"\n [clearable]=\"true\"\n >\n <ng-container matSuffix *ngIf=\"showButtons\">\n <button\n mat-icon-button\n [color]=\"'primary'\"\n [disabled]=\"saveDisabled\"\n [title]=\"'COMMON.NAMED_FILTER.SAVE' | translate\"\n (click)=\"save()\"\n >\n <mat-icon>save</mat-icon>\n <mat-icon *ngIf=\"isNew\" class=\"icon-secondary\" style=\"left: 12px; top: 0px\">add</mat-icon>\n </button>\n <button\n mat-icon-button\n [disabled]=\"deleteDisabled\"\n [title]=\"'COMMON.NAMED_FILTER.DELETE' | translate\"\n (click)=\"delete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"moreMenu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #moreMenu=\"matMenu\">\n <button mat-menu-item (click)=\"export()\" [disabled]=\"isNew\">\n <ion-label>\n <mat-icon>file_download</mat-icon>\n <span>{{ 'COMMON.NAMED_FILTER.EXPORT' | translate }}</span>\n </ion-label>\n </button>\n <button mat-menu-item (click)=\"import($event)\">\n <ion-label>\n <mat-icon>file_upload</mat-icon>\n <span>{{ 'COMMON.NAMED_FILTER.IMPORT' | translate }}</span>\n </ion-label>\n </button>\n </mat-menu>\n </ng-container>\n </mat-autocomplete-field>\n</form>\n", styles: [".filter-name-container{background:transparent!important;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: MatAutocompleteField, selector: "mat-autocomplete-field", inputs: ["equals", "logPrefix", "formControl", "formControlName", "floatLabel", "appearance", "placeholder", "suggestFn", "required", "mobile", "clearable", "debounceTime", "displayWith", "displayAttributes", "displayColumnSizes", "displayColumnNames", "highlightAccent", "showAllOnFocus", "showPanelOnFocus", "autofocus", "config", "i18nPrefix", "noResultMessage", "class", "panelWidth", "matAutocompletePosition", "multiple", "fetchMoreThreshold", "suggestLengthThreshold", "showLoadingSpinner", "debug", "showSearchBar", "stickySearchBar", "applyImplicitValue", "filter", "readonly", "tabindex", "items"], outputs: ["click", "blur", "focus", "dropButtonClick", "keydown.escape", "keyup.enter"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i6$1.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
21476
21494
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NamedFilterSelector, decorators: [{
|
|
21477
21495
|
type: Component,
|
|
21478
|
-
args: [{ selector: 'app-named-filter-selector
|
|
21496
|
+
args: [{ selector: 'app-named-filter-selector', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form class=\"form-container\" [formGroup]=\"form\">\n <mat-autocomplete-field\n formControlName=\"namedFilter\"\n [config]=\"autocompleteFields.namedFilter\"\n [placeholder]=\"'COMMON.NAMED_FILTER.TITLE' | translate\"\n [clearable]=\"true\"\n >\n <ng-container matSuffix *ngIf=\"showButtons\">\n <button\n mat-icon-button\n [color]=\"'primary'\"\n [disabled]=\"saveDisabled\"\n [title]=\"'COMMON.NAMED_FILTER.SAVE' | translate\"\n (click)=\"save()\"\n >\n <mat-icon>save</mat-icon>\n <mat-icon *ngIf=\"isNew\" class=\"icon-secondary\" style=\"left: 12px; top: 0px\">add</mat-icon>\n </button>\n <button\n mat-icon-button\n [disabled]=\"deleteDisabled\"\n [title]=\"'COMMON.NAMED_FILTER.DELETE' | translate\"\n (click)=\"delete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"moreMenu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #moreMenu=\"matMenu\">\n <button mat-menu-item (click)=\"export()\" [disabled]=\"isNew\">\n <ion-label>\n <mat-icon>file_download</mat-icon>\n <span>{{ 'COMMON.NAMED_FILTER.EXPORT' | translate }}</span>\n </ion-label>\n </button>\n <button mat-menu-item (click)=\"import($event)\">\n <ion-label>\n <mat-icon>file_upload</mat-icon>\n <span>{{ 'COMMON.NAMED_FILTER.IMPORT' | translate }}</span>\n </ion-label>\n </button>\n </mat-menu>\n </ng-container>\n </mat-autocomplete-field>\n</form>\n", styles: [".filter-name-container{background:transparent!important;overflow:hidden}\n"] }]
|
|
21479
21497
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$2.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastController }, { type: i2$1.PopoverController }, { type: undefined, decorators: [{
|
|
21480
21498
|
type: Inject,
|
|
21481
21499
|
args: [APP_NAMED_FILTER_SERVICE]
|