UI: Fixed typo; change logics clear units in panel
This commit is contained in:
parent
c2923c0f66
commit
53c41707bf
@ -139,7 +139,13 @@ export class UnitSettingsPanelComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearUnit() {
|
clearUnit() {
|
||||||
this.unitSettingsApplied.emit(null);
|
this.unitSettingForm.reset({
|
||||||
|
convertUnit: false
|
||||||
|
});
|
||||||
|
if (this.required) {
|
||||||
|
this.unitSettingForm.markAllAsTouched();
|
||||||
|
}
|
||||||
|
this.unitSettingForm.markAsDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
|
|||||||
@ -907,8 +907,6 @@ export abstract class ValueFormatProcessor {
|
|||||||
|
|
||||||
export class SimpleValueFormatProcessor extends ValueFormatProcessor {
|
export class SimpleValueFormatProcessor extends ValueFormatProcessor {
|
||||||
|
|
||||||
private readonly isDefinedUnit: boolean;
|
|
||||||
|
|
||||||
constructor(protected settings: ValueFormatSettings) {
|
constructor(protected settings: ValueFormatSettings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
this.unitSymbol = !settings.ignoreUnitSymbol && isNotEmptyStr(settings.units) ? (settings.units as string) : null;
|
this.unitSymbol = !settings.ignoreUnitSymbol && isNotEmptyStr(settings.units) ? (settings.units as string) : null;
|
||||||
@ -917,7 +915,7 @@ export class SimpleValueFormatProcessor extends ValueFormatProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
format(value: any): string {
|
format(value: any): string {
|
||||||
if (isDefinedAndNotNull(value) && isNumeric(value) && (this.isDefinedDecimals || this.isDefinedUnit || Number(value).toString() === value)) {
|
if (isDefinedAndNotNull(value) && isNumeric(value) && (this.isDefinedDecimals || this.unitSymbol || Number(value).toString() === value)) {
|
||||||
return this.formatValue(Number(value));
|
return this.formatValue(Number(value));
|
||||||
}
|
}
|
||||||
return value ?? '';
|
return value ?? '';
|
||||||
|
|||||||
@ -5924,7 +5924,7 @@
|
|||||||
"energy-density": "Energy density",
|
"energy-density": "Energy density",
|
||||||
"force": "Force",
|
"force": "Force",
|
||||||
"frequency": "Frequency",
|
"frequency": "Frequency",
|
||||||
"fuel-efficiency": "fuel efficiency",
|
"fuel-efficiency": "Fuel efficiency",
|
||||||
"heat-capacity": "Heat capacity",
|
"heat-capacity": "Heat capacity",
|
||||||
"illuminance": "Illuminance",
|
"illuminance": "Illuminance",
|
||||||
"inductance": "Inductance",
|
"inductance": "Inductance",
|
||||||
@ -6180,8 +6180,8 @@
|
|||||||
"volt": "Volt",
|
"volt": "Volt",
|
||||||
"kilovolt": "Kilovolt",
|
"kilovolt": "Kilovolt",
|
||||||
"megavolt": "Megavolt",
|
"megavolt": "Megavolt",
|
||||||
"dbmV": "dBmV",
|
"dbmV": "Decibel volt",
|
||||||
"dbm": "dBm",
|
"dbm": "Decibel-milliwatts",
|
||||||
"volt-meter": "Volt-Meter",
|
"volt-meter": "Volt-Meter",
|
||||||
"kilovolt-meter": "Kilovolt-Meter",
|
"kilovolt-meter": "Kilovolt-Meter",
|
||||||
"megavolt-meter": "Megavolt-Meter",
|
"megavolt-meter": "Megavolt-Meter",
|
||||||
@ -6216,7 +6216,7 @@
|
|||||||
"millimole": "Millimole",
|
"millimole": "Millimole",
|
||||||
"kilomole": "Kilomole",
|
"kilomole": "Kilomole",
|
||||||
"mole-per-cubic-meter": "Mole per Cubic Meter",
|
"mole-per-cubic-meter": "Mole per Cubic Meter",
|
||||||
"rssi": "RSSI",
|
"rssi": "Received signal strength indicator",
|
||||||
"ppm": "Parts Per Million",
|
"ppm": "Parts Per Million",
|
||||||
"ppb": "Parts Per Billion",
|
"ppb": "Parts Per Billion",
|
||||||
"micrograms-per-cubic-meter": "Micrograms per Cubic Meter",
|
"micrograms-per-cubic-meter": "Micrograms per Cubic Meter",
|
||||||
@ -6398,9 +6398,9 @@
|
|||||||
"radian-per-second": "Radian per second",
|
"radian-per-second": "Radian per second",
|
||||||
"radian-per-second-squared": "Radian per second squared",
|
"radian-per-second-squared": "Radian per second squared",
|
||||||
"revolutions-per-minute-per-second": "Angular acceleration",
|
"revolutions-per-minute-per-second": "Angular acceleration",
|
||||||
"deg-per-second": "deg/s",
|
"deg-per-second": "Degrees per second",
|
||||||
"rotation-per-minute": "Rotation per minute",
|
"rotation-per-minute": "Rotation per minute",
|
||||||
"degrees-brix": "Degrees Brix",
|
"degrees-brix": "Degrees brix",
|
||||||
"katal": "Katal",
|
"katal": "Katal",
|
||||||
"katal-per-cubic-metre": "Katal per Cubic Metre",
|
"katal-per-cubic-metre": "Katal per Cubic Metre",
|
||||||
"paris-inch": "Paris inch"
|
"paris-inch": "Paris inch"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user