issue-15 #21
@ -12,18 +12,24 @@ export class ScriptaccountConditionEditorComponent implements OnInit{
 | 
			
		||||
 | 
			
		||||
  @Input() conditions: ScriptAccountCondition[] = []
 | 
			
		||||
  @Input() scriptAccounts: ScriptAccount[] = []
 | 
			
		||||
  @Input() enableEditiong: boolean = false
 | 
			
		||||
  @Output() onCreateCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
 | 
			
		||||
  @Output() onDeleteCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
 | 
			
		||||
 | 
			
		||||
  dataSource: MatTableDataSource<ScriptAccountCondition> = new MatTableDataSource();
 | 
			
		||||
  displayedColumns = ['scriptAccount', 'minValue', 'maxValue', 'edit', 'delete']
 | 
			
		||||
  displayedColumns = ['scriptAccount', 'minValue', 'maxValue']
 | 
			
		||||
 | 
			
		||||
  editedCondition: ScriptAccountCondition | undefined
 | 
			
		||||
  addedCondition: ScriptAccountCondition | undefined
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.dataSource.data = this.conditions.concat();
 | 
			
		||||
 | 
			
		||||
    if(this.enableEditiong) {
 | 
			
		||||
      this.displayedColumns.push( 'edit', 'delete')
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  createCondition() {
 | 
			
		||||
    this.addedCondition = ScriptAccountCondition.constructScriptAccountCondition(new ScriptAccount("", ""), 0,0);
 | 
			
		||||
 | 
			
		||||
@ -32,7 +32,7 @@
 | 
			
		||||
        <td mat-cell *matCellDef="let element" [attr.colspan]="expandedColumns.length">
 | 
			
		||||
          <div class="example-element-detail"
 | 
			
		||||
               [@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
 | 
			
		||||
            <p>Expanded Row</p>
 | 
			
		||||
            <app-scriptaccount-condition-editor [conditions]="element.conditions" [enableEditiong]="false"></app-scriptaccount-condition-editor>
 | 
			
		||||
          </div>
 | 
			
		||||
        </td>
 | 
			
		||||
      </ng-container>
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,7 @@
 | 
			
		||||
            </mat-form-field>
 | 
			
		||||
 | 
			
		||||
            <div class="long-form">
 | 
			
		||||
              <app-scriptaccount-condition-editor [conditions]="element.conditions" [scriptAccounts]="scriptAccounts"
 | 
			
		||||
              <app-scriptaccount-condition-editor [conditions]="element.conditions" [scriptAccounts]="scriptAccounts" [enableEditiong]="true"
 | 
			
		||||
                                                  (onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
@ -45,7 +45,7 @@
 | 
			
		||||
                <app-scriptaccount-action-editor [transition]="element" [scriptAccounts]="scriptAccounts" [enableEditing]="true"></app-scriptaccount-action-editor>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="condition-container">
 | 
			
		||||
                <app-scriptaccount-condition-editor [conditions]="element.scriptAccountConditions" [scriptAccounts]="scriptAccounts"
 | 
			
		||||
                <app-scriptaccount-condition-editor [conditions]="element.scriptAccountConditions" [scriptAccounts]="scriptAccounts" [enableEditiong]="true"
 | 
			
		||||
                                                    (onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user