@sumaris-net/ngx-components 2.6.4-rc6 → 2.6.4-rc7

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.
@@ -23000,15 +23000,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
23000
23000
  type: Directive
23001
23001
  }], ctorParameters: function () { return [{ type: GraphqlService }, { type: PlatformService }, { type: undefined }, { type: undefined }, { type: undefined }]; } });
23002
23002
 
23003
- class NamedFilter extends Entity {
23003
+ let NamedFilter = class NamedFilter extends Entity {
23004
23004
  fromObject(source, opts) {
23005
23005
  this.name = source.name;
23006
23006
  this.entityName = source.entityName;
23007
- this.content = source.content;
23008
23007
  this.recorderPersonId = source.recorderPersonId;
23009
23008
  this.recorderDepartmentId = source.recorderDepartmentId;
23009
+ try {
23010
+ this.content = typeof source?.content === 'string' ? JSON.parse(source?.content) : source?.content || undefined;
23011
+ }
23012
+ catch (e) {
23013
+ console.error('[named-filter] can\'t parse content json', source);
23014
+ throw e;
23015
+ }
23010
23016
  }
23011
- }
23017
+ asObject(opts) {
23018
+ const target = super.asObject(opts);
23019
+ if (opts?.minify) {
23020
+ target.content = JSON.stringify(this.content);
23021
+ }
23022
+ return target;
23023
+ }
23024
+ };
23025
+ NamedFilter = __decorate([
23026
+ EntityClass({ typename: 'NamedFilterVO' })
23027
+ ], NamedFilter);
23012
23028
  let NamedFilterFilter = class NamedFilterFilter extends EntityFilter {
23013
23029
  constructor() {
23014
23030
  super(...arguments);