Browse Source

Merge pull request #22941 from abpframework/fix/inline-icon-label-wrap

Angular - Fixing inline icon-label wrapping problem
pull/22942/head
oykuermann 1 year ago
committed by GitHub
parent
commit
ee74ffe543
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 61
      npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html

61
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html

@ -1,15 +1,14 @@
<ng-container *abpPermission="prop.permission; runChangeDetection: false"> <ng-container *abpPermission="prop.permission; runChangeDetection: false">
@switch (getComponent(prop)) { @switch (getComponent(prop)) {
@case ('template') { @case ('template') {
<ng-container *ngComponentOutlet="prop.template; injector: injectorForCustomComponent"> <ng-container *ngComponentOutlet="prop.template; injector: injectorForCustomComponent" />
</ng-container>
} }
} }
<div [ngClass]="containerClassName" class="mb-2"> <div [ngClass]="containerClassName" class="mb-2">
@switch (getComponent(prop)) { @switch (getComponent(prop)) {
@case ('input') { @case ('input') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<input <input
#field #field
[id]="prop.id" [id]="prop.id"
@ -37,11 +36,11 @@
<ng-template <ng-template
[ngTemplateOutlet]="label" [ngTemplateOutlet]="label"
[ngTemplateOutletContext]="{ $implicit: 'form-check-label' }" [ngTemplateOutletContext]="{ $implicit: 'form-check-label' }"
></ng-template> />
</div> </div>
} }
@case ('select') { @case ('select') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<select <select
#field #field
[id]="prop.id" [id]="prop.id"
@ -61,7 +60,7 @@
</select> </select>
} }
@case ('multiselect') { @case ('multiselect') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<select <select
#field #field
[id]="prop.id" [id]="prop.id"
@ -82,7 +81,7 @@
</select> </select>
} }
@case ('typeahead') { @case ('typeahead') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<div #typeahead class="position-relative" validationStyle validationTarget> <div #typeahead class="position-relative" validationStyle validationTarget>
<input <input
#field #field
@ -104,7 +103,7 @@
</div> </div>
} }
@case ('date') { @case ('date') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<input <input
[id]="prop.id" [id]="prop.id"
[formControlName]="prop.name" [formControlName]="prop.name"
@ -117,15 +116,15 @@
/> />
} }
@case ('time') { @case ('time') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<ngb-timepicker [formControlName]="prop.name"></ngb-timepicker> <ngb-timepicker [formControlName]="prop.name" />
} }
@case ('dateTime') { @case ('dateTime') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<abp-extensible-date-time-picker [prop]="prop" [meridian]="meridian$ | async" /> <abp-extensible-date-time-picker [prop]="prop" [meridian]="meridian$ | async" />
} }
@case ('textarea') { @case ('textarea') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<textarea <textarea
#field #field
[id]="prop.id" [id]="prop.id"
@ -136,7 +135,7 @@
></textarea> ></textarea>
} }
@case ('passwordinputgroup') { @case ('passwordinputgroup') {
<ng-template [ngTemplateOutlet]="label"></ng-template> <ng-template [ngTemplateOutlet]="label" />
<div class="input-group form-group" validationTarget> <div class="input-group form-group" validationTarget>
<input <input
class="form-control" class="form-control"
@ -165,24 +164,26 @@
</ng-container> </ng-container>
<ng-template #label let-classes> <ng-template #label let-classes>
<label [htmlFor]="prop.id" [ngClass]="classes || 'form-label'"> <label [htmlFor]="prop.id" [ngClass]="classes || 'form-label d-inline-block'">
@if (prop.displayTextResolver) { <span class="d-inline-flex align-items-center gap-1 text-nowrap">
{{ prop.displayTextResolver(data) | abpLocalization }} @if (prop.displayTextResolver) {
} @else { {{ prop.displayTextResolver(data) | abpLocalization }}
@if (prop.isExtra) {
{{ '::' + prop.displayName | abpLocalization }}
} @else { } @else {
{{ prop.displayName | abpLocalization }} @if (prop.isExtra) {
{{ '::' + prop.displayName | abpLocalization }}
} @else {
{{ prop.displayName | abpLocalization }}
}
} }
} {{ asterisk }}
{{ asterisk }} @if (prop.tooltip) {
@if (prop.tooltip) { <i
<i [ngbTooltip]="prop.tooltip.text | abpLocalization"
[ngbTooltip]="prop.tooltip.text | abpLocalization" [placement]="prop.tooltip.placement || 'auto'"
[placement]="prop.tooltip.placement || 'auto'" container="body"
container="body" class="bi bi-info-circle"
class="bi bi-info-circle" ></i>
></i> }
} </span>
</label> </label>
</ng-template> </ng-template>

Loading…
Cancel
Save