Skip to content

Commit

Permalink
feat(ui): display minimum and maximum values
Browse files Browse the repository at this point in the history
Feature request.

Refs springwolf#378
  • Loading branch information
aerfus committed Jan 1, 2024
1 parent dcb0420 commit 4a4a9da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
color: red;
}

.type-content {
display: flex;
}

.type {
color: #55a;
}
Expand All @@ -20,3 +24,11 @@
color: #6b6b6b;
font-style: italic;
}

.range {
background-color: rgb(128, 90, 213);
color: rgb(255, 255, 255);
margin: 0 8 0 8;
padding: 2 4 2 4;
border-radius: 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,19 @@
</table>

<ng-template #valueContent let-value="value">
<span class="type" *ngIf="value.type != 'array'">{{ value.type }}</span>
<div class="type-content">
<span class="type" *ngIf="value.type != 'array'">{{ value.type }}</span>

<ng-container
[ngTemplateOutlet]="rangeContent"
[ngTemplateOutletContext]="{
minimum: value.minimum,
maximum: value.maximum
}"
>
</ng-container>
</div>

<span class="type" *ngIf="value.refTitle">
<a [href]="value.anchorUrl">{{ value.refTitle }}</a>
</span>
Expand All @@ -56,3 +68,15 @@
</mat-option>
</mat-select>
</ng-template>

<ng-template #rangeContent let-minimum="minimum" let-maximum="maximum">
<span class="range" *ngIf="minimum !== undefined && maximum === undefined">
&gt;= {{ minimum }}
</span>
<span class="range" *ngIf="minimum === undefined && maximum !== undefined">
&lt;= {{ maximum }}
</span>
<span class="range" *ngIf="minimum !== undefined && maximum !== undefined">
[ {{ minimum }} .. {{ maximum }} ]
</span>
</ng-template>

0 comments on commit 4a4a9da

Please sign in to comment.