Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
undo list-input changes
Browse files Browse the repository at this point in the history
clemiller committed Jul 10, 2024
1 parent 2174e54 commit 2394c3e
Showing 1 changed file with 46 additions and 53 deletions.
99 changes: 46 additions & 53 deletions nav-app/src/app/list-input/list-input.component.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,53 @@
<div class="list-container">
@for (item of list; track item; let i = $index) {
<div class="divider-container">
<!-- divider -->
@if (item.divider) {
<div class="divider" (click)="removeDivider(i)" matTooltipPosition="below" matTooltip="remove divider">
<mat-divider></mat-divider>
<mat-icon class="icon">remove</mat-icon>
<mat-divider></mat-divider>
</div>
}
@if (!item.divider && canAddDivider(i)) {
<div class="divider-option"
(click)="addDivider(i)"
matTooltipPosition="below"
matTooltip="add a divider">
<mat-divider></mat-divider>
<mat-icon class="icon">add</mat-icon>
<mat-divider></mat-divider>
</div>
}
<div *ngFor="let item of list; let i = index;" class="divider-container">
<!-- divider -->
<div class="divider" *ngIf="item.divider" (click)="removeDivider(i)" matTooltipPosition="below" matTooltip="remove divider">
<mat-divider></mat-divider>
<mat-icon class="icon">remove</mat-icon>
<mat-divider></mat-divider>
</div>
<div class="divider-option"
*ngIf="!item.divider && canAddDivider(i)"
(click)="addDivider(i)"
matTooltipPosition="below"
matTooltip="add a divider">
<mat-divider></mat-divider>
<mat-icon class="icon">add</mat-icon>
<mat-divider></mat-divider>
</div>
</div>

<!-- list item -->
@if (!item.divider) {
<div class="item-container hide-subscript">
<mat-form-field>
<mat-label>{{config.nameField}}</mat-label>
<input
matInput
matTextareaAutosize
[(ngModel)]="item[config.nameField]"
(input)="updateList()"/>
</mat-form-field>
<mat-form-field>
<mat-label>{{config.valueField}}</mat-label>
<input
matInput
matTextareaAutosize
[(ngModel)]="item[config.valueField]"
(input)="updateList()"/>
</mat-form-field>
@if (includeLinks && item.valid()) {
<span> trying something </span>
<a class="assigned-link"
href="{{ item[config.valueField] }}"
target="_blank"
rel="noopener noreferrer">
{{ item[config.nameField] }}
</a>
}
<div class="remove-button">
<button class="button" (click)="remove(i)">remove</button>
</div>
</div>
<!-- list item -->
<div *ngIf="!item.divider" class="item-container hide-subscript">
<mat-form-field>
<mat-label>{{config.nameField}}</mat-label>
<input
matInput
matTextareaAutosize
[(ngModel)]="item[config.nameField]"
(input)="updateList()"/>
</mat-form-field>
<mat-form-field>
<mat-label>{{config.valueField}}</mat-label>
<input
matInput
matTextareaAutosize
[(ngModel)]="item[config.valueField]"
(input)="updateList()"/>
</mat-form-field>
@if (includeLinks && item.valid()) {
<span> trying something </span>
<a class="assigned-link"
href="{{ item[config.valueField] }}"
target="_blank"
rel="noopener noreferrer">
{{ item[config.nameField] }}
</a>
}
}
<div class="remove-button">
<button class="button" (click)="remove(i)">remove</button>
</div>
</div>
</div>
<div class="add-more">
<button class="button" (click)="add()">add {{ config.type }}</button>

0 comments on commit 2394c3e

Please sign in to comment.