UI: string autocomplete style addition and liquid level widget minor improvement
This commit is contained in:
parent
7f0d6ebc3c
commit
c9e684ef64
@ -192,7 +192,7 @@ export class LiquidLevelWidgetComponent implements OnInit {
|
|||||||
if (isDefinedAndNotNull(data) && data.length && typeof Number(data[1]) === 'number') {
|
if (isDefinedAndNotNull(data) && data.length && typeof Number(data[1]) === 'number') {
|
||||||
const percentage = this.convertInputData(Number(data[1]));
|
const percentage = this.convertInputData(Number(data[1]));
|
||||||
this.updateSvg(percentage);
|
this.updateSvg(percentage);
|
||||||
this.updateValueElement(this.convertOutputData(percentage));
|
this.updateValueElement(this.convertOutputData(percentage), percentage);
|
||||||
|
|
||||||
if (this.settings.showTooltip) {
|
if (this.settings.showTooltip) {
|
||||||
this.updateTooltip(data);
|
this.updateTooltip(data);
|
||||||
@ -382,7 +382,7 @@ export class LiquidLevelWidgetComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateValueElement(data: number): void {
|
private updateValueElement(data: number, percentage: number): void {
|
||||||
let content: string;
|
let content: string;
|
||||||
let container: JQuery<HTMLElement>;
|
let container: JQuery<HTMLElement>;
|
||||||
|
|
||||||
@ -390,13 +390,13 @@ export class LiquidLevelWidgetComponent implements OnInit {
|
|||||||
.toFixed(this.settings.decimals || 0);
|
.toFixed(this.settings.decimals || 0);
|
||||||
const valueTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.valueFont),
|
const valueTextStyle = cssTextFromInlineStyle({...inlineTextStyle(this.settings.valueFont),
|
||||||
color: this.valueColor.color});
|
color: this.valueColor.color});
|
||||||
this.backgroundOverlayColor.update(data);
|
this.backgroundOverlayColor.update(percentage);
|
||||||
if (this.overlayContainer) {
|
if (this.overlayContainer) {
|
||||||
this.overlayContainer.attr('fill', this.backgroundOverlayColor.color);
|
this.overlayContainer.attr('fill', this.backgroundOverlayColor.color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.settings.layout === LevelCardLayout.absolute) {
|
if (this.settings.layout === LevelCardLayout.absolute) {
|
||||||
this.volumeColor.update(data);
|
this.volumeColor.update(percentage);
|
||||||
|
|
||||||
const volumeInLiters: number = convertLiters(this.volume, this.settings.volumeUnits as CapacityUnits, ConversionType.to);
|
const volumeInLiters: number = convertLiters(this.volume, this.settings.volumeUnits as CapacityUnits, ConversionType.to);
|
||||||
const volume = convertLiters(volumeInLiters, this.widgetUnits as CapacityUnits, ConversionType.from)
|
const volume = convertLiters(volumeInLiters, this.widgetUnits as CapacityUnits, ConversionType.from)
|
||||||
|
|||||||
@ -14,24 +14,28 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
:host {
|
:host {
|
||||||
display: flex;
|
mat-form-field {
|
||||||
flex: 1 1 0%;
|
display: flex;
|
||||||
max-width: 100%;
|
flex: 1 1 0%;
|
||||||
box-sizing: border-box;
|
max-width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
.tb-autocomplete.tb-option-input-autocomplete {
|
.tb-autocomplete.tb-option-input-autocomplete {
|
||||||
.mat-mdc-option {
|
.mat-mdc-option {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
.mdc-list-item__primary-text {
|
|
||||||
flex: 1;
|
.mdc-list-item__primary-text {
|
||||||
display: flex;
|
flex: 1;
|
||||||
flex-direction: row;
|
display: flex;
|
||||||
gap: 8px;
|
flex-direction: row;
|
||||||
.tb-option {
|
gap: 8px;
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
.tb-option {
|
||||||
line-height: 20px;
|
font-size: 14px;
|
||||||
letter-spacing: 0.2px;
|
font-weight: 400;
|
||||||
|
line-height: 20px;
|
||||||
|
letter-spacing: 0.2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user