ngx-material-entity 18.2.2 → 18.2.3

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.
@@ -6332,10 +6332,10 @@ class NgxMatEntityInputComponent {
6332
6332
  }
6333
6333
  initEntityArray() {
6334
6334
  this.metadata = new EntityArrayDecoratorConfigInternal(this.metadata, this.globalConfig);
6335
- ReflectUtilities.defineMetadata('metadata', this.metadata, this.entity, this.propertyKey);
6336
6335
  this.metadataEntityArray = this.metadata;
6337
6336
  if (this.entity[this.propertyKey] == undefined) {
6338
6337
  this.entity[this.propertyKey] = [];
6338
+ ReflectUtilities.defineMetadata('metadata', this.metadata, this.entity, this.propertyKey);
6339
6339
  }
6340
6340
  if (!this.metadataEntityArray.createInline && !this.metadataEntityArray.createDialogData) {
6341
6341
  this.metadataEntityArray.createDialogData = {
@@ -6383,18 +6383,6 @@ class NgxMatEntityInputComponent {
6383
6383
  .withDefault('createButtonLabel', this.globalConfig.addLabel)
6384
6384
  .withDefault('title', this.globalConfig.addArrayItemTitle)
6385
6385
  .getResult();
6386
- this.editArrayItemFormContext = {
6387
- $implicit: {
6388
- entity: this.arrayItem,
6389
- tabs: EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true),
6390
- isReadOnly: (property, key) => this.isPropertyReadOnly(property, key),
6391
- inputChangeEvent: () => {
6392
- void this.checkArrayItem();
6393
- this.editArrayItemFormContext.$implicit.tabs = EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true);
6394
- },
6395
- hideOmitForEdit: true
6396
- }
6397
- };
6398
6386
  this.editArrayItemDialogData = this.metadataEntityArray.editDialogData;
6399
6387
  }
6400
6388
  async initDropdownObjectInput() {
@@ -6889,6 +6877,20 @@ class NgxMatEntityInputComponent {
6889
6877
  async addEntity() {
6890
6878
  await this.checkIsArrayItemValid();
6891
6879
  if (!this.metadataEntityArray.createInline) {
6880
+ this.arrayItem = new this.metadataEntityArray.EntityClass();
6881
+ this.arrayItemPriorChanges = LodashUtilities.cloneDeep(this.arrayItem);
6882
+ EntityUtilities.setDefaultValues(this.arrayItem);
6883
+ this.addArrayItemFormContext = {
6884
+ $implicit: {
6885
+ entity: this.arrayItem,
6886
+ tabs: EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true),
6887
+ inputChangeEvent: () => {
6888
+ void this.checkIsArrayItemValid();
6889
+ this.addArrayItemFormContext.$implicit.tabs = EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true);
6890
+ },
6891
+ hideOmitForCreate: true
6892
+ }
6893
+ };
6892
6894
  this.addArrayItemDialogRef = this.dialog.open(this.addArrayItemDialog, {
6893
6895
  minWidth: '60%',
6894
6896
  autoFocus: false,
@@ -6947,6 +6949,18 @@ class NgxMatEntityInputComponent {
6947
6949
  this.indexOfEditedArrayItem = this.entityArrayTableContext.$implicit.dataSource.data.indexOf(entity);
6948
6950
  this.arrayItem = new this.metadataEntityArray.EntityClass(entity);
6949
6951
  this.arrayItemPriorChanges = LodashUtilities.cloneDeep(this.arrayItem);
6952
+ this.editArrayItemFormContext = {
6953
+ $implicit: {
6954
+ entity: this.arrayItem,
6955
+ tabs: EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true),
6956
+ isReadOnly: (property, key) => this.isPropertyReadOnly(property, key),
6957
+ inputChangeEvent: () => {
6958
+ void this.checkArrayItem();
6959
+ this.editArrayItemFormContext.$implicit.tabs = EntityUtilities.getEntityTabs(this.arrayItem, this.injector, true);
6960
+ },
6961
+ hideOmitForEdit: true
6962
+ }
6963
+ };
6950
6964
  await this.checkArrayItem();
6951
6965
  this.editArrayItemDialogRef = this.dialog.open(this.editArrayItemDialog, {
6952
6966
  minWidth: '60%',