Browse Source

Merge pull request #8916 from vvlladd28/improvement/unit-input/clear-on-hover

Added on unit input to show the clear button when hovering the element
pull/8946/head
Igor Kulikov 3 years ago
committed by GitHub
parent
commit
b77e759252
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui-ngx/src/app/shared/components/unit-input.component.html
  2. 29
      ui-ngx/src/form.scss

3
ui-ngx/src/app/shared/components/unit-input.component.html

@ -15,13 +15,14 @@
limitations under the License. limitations under the License.
--> -->
<mat-form-field appearance="outline" class="tb-inline-field" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="tb-inline-field tb-suffix-show-on-hover" subscriptSizing="dynamic">
<input matInput #unitInput [formControl]="unitsFormControl" <input matInput #unitInput [formControl]="unitsFormControl"
placeholder="{{ 'widget-config.set' | translate }}" placeholder="{{ 'widget-config.set' | translate }}"
(focusin)="onFocus()" (focusin)="onFocus()"
[matAutocomplete]="unitsAutocomplete"> [matAutocomplete]="unitsAutocomplete">
<button *ngIf="unitsFormControl.value && !disabled" <button *ngIf="unitsFormControl.value && !disabled"
type="button" type="button"
class="tb-icon-24"
matSuffix mat-icon-button aria-label="Clear" matSuffix mat-icon-button aria-label="Clear"
(click)="clear()"> (click)="clear()">
<mat-icon class="material-icons">close</mat-icon> <mat-icon class="material-icons">close</mat-icon>

29
ui-ngx/src/form.scss

@ -224,6 +224,19 @@
height: 20px; height: 20px;
font-size: 20px; font-size: 20px;
} }
.mat-mdc-button-touch-target {
width: 40px;
height: 40px;
}
&.tb-icon-24 {
width: 24px;
height: 24px;
padding: 0;
.mat-mdc-button-touch-target {
width: 24px;
height: 24px;
}
}
} }
> .mat-icon { > .mat-icon {
width: 20px; width: 20px;
@ -274,6 +287,22 @@
} }
} }
} }
&.tb-suffix-show-on-hover {
.mat-mdc-text-field-wrapper {
.mat-mdc-form-field-icon-suffix {
padding: 0;
display: none;
}
}
&:hover {
.mat-mdc-text-field-wrapper {
.mat-mdc-form-field-icon-suffix {
display: flex;
align-items: center;
}
}
}
}
} }
.tb-form-table { .tb-form-table {

Loading…
Cancel
Save