Add initial components to proto message field

This commit is contained in:
2024-06-29 11:31:56 +09:30
parent 3606c360b4
commit ddc20daaa5
14 changed files with 175 additions and 36 deletions

View File

@@ -0,0 +1,34 @@
import { CommonModule } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
input,
model,
} from '@angular/core';
import { MatButton } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { ProtoFieldComponent } from '../proto-field/proto-field.component';
import {
EnumMessage,
ListMessage,
ProtoMessageField,
} from '../model/proto-message.model';
@Component({
selector: 'app-list-field',
standalone: true,
imports: [CommonModule, MatButton, MatIconModule, ProtoFieldComponent],
template: ` @for(value of values(); track values()) {
<app-proto-field
[configuration]="configuration().subConfiguration"
[value]="value"
></app-proto-field>
}
<button mat-icon-button><mat-icon>add</mat-icon></button>`,
styleUrl: './list-field.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ListFieldComponent {
configuration = input.required<ListMessage>();
values = model<any[]>();
}