diff --git a/packages/common/src/editors/autoCompleteEditor.ts b/packages/common/src/editors/autoCompleteEditor.ts index 76816150f..23eb72602 100644 --- a/packages/common/src/editors/autoCompleteEditor.ts +++ b/packages/common/src/editors/autoCompleteEditor.ts @@ -149,7 +149,7 @@ export class AutoCompleteEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { diff --git a/packages/common/src/editors/checkboxEditor.ts b/packages/common/src/editors/checkboxEditor.ts index 98dee9d7d..ef54ad295 100644 --- a/packages/common/src/editors/checkboxEditor.ts +++ b/packages/common/src/editors/checkboxEditor.ts @@ -62,7 +62,7 @@ export class CheckboxEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init(): void { diff --git a/packages/common/src/editors/dualInputEditor.ts b/packages/common/src/editors/dualInputEditor.ts index 8902c162f..a8327e1cc 100644 --- a/packages/common/src/editors/dualInputEditor.ts +++ b/packages/common/src/editors/dualInputEditor.ts @@ -103,7 +103,7 @@ export class DualInputEditor implements Editor { /** Get the Shared Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { diff --git a/packages/common/src/editors/floatEditor.ts b/packages/common/src/editors/floatEditor.ts index d1eb4cf66..9866bf3cd 100644 --- a/packages/common/src/editors/floatEditor.ts +++ b/packages/common/src/editors/floatEditor.ts @@ -66,7 +66,7 @@ export class FloatEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { @@ -117,13 +117,7 @@ export class FloatEditor implements Editor { destroy() { this._bindEventService.unbindAll(); - if (this._input) { - setTimeout(() => { - if (this._input) { - this._input.remove(); - } - }); - } + this._input?.remove?.(); } disable(isDisabled = true) { diff --git a/packages/common/src/editors/integerEditor.ts b/packages/common/src/editors/integerEditor.ts index 42885a4e6..cdb7c4034 100644 --- a/packages/common/src/editors/integerEditor.ts +++ b/packages/common/src/editors/integerEditor.ts @@ -64,7 +64,7 @@ export class IntegerEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { @@ -114,15 +114,8 @@ export class IntegerEditor implements Editor { } destroy() { - if (this._input) { - this._bindEventService.unbindAll(); - setTimeout(() => { - if (this._input) { - this._input.remove(); - this._input = undefined; - } - }); - } + this._bindEventService.unbindAll(); + this._input?.remove?.(); } disable(isDisabled = true) { diff --git a/packages/common/src/editors/selectEditor.ts b/packages/common/src/editors/selectEditor.ts index dd506e8d9..0f45971f1 100644 --- a/packages/common/src/editors/selectEditor.ts +++ b/packages/common/src/editors/selectEditor.ts @@ -294,7 +294,7 @@ export class SelectEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { diff --git a/packages/common/src/editors/sliderEditor.ts b/packages/common/src/editors/sliderEditor.ts index 31dd99bcd..5a739279b 100644 --- a/packages/common/src/editors/sliderEditor.ts +++ b/packages/common/src/editors/sliderEditor.ts @@ -80,7 +80,7 @@ export class SliderEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init(): void { diff --git a/packages/common/src/editors/textEditor.ts b/packages/common/src/editors/textEditor.ts index 93b78355d..c6fb8a01b 100644 --- a/packages/common/src/editors/textEditor.ts +++ b/packages/common/src/editors/textEditor.ts @@ -64,7 +64,7 @@ export class TextEditor implements Editor { /** Get the Validator function, can be passed in Editor property or Column Definition */ get validator(): EditorValidator | undefined { - return (this.columnEditor && this.columnEditor.validator) || (this.columnDef && this.columnDef.validator); + return this.columnEditor?.validator ?? this.columnDef?.validator; } init() { @@ -106,15 +106,8 @@ export class TextEditor implements Editor { } destroy() { - if (this._input) { - this._bindEventService.unbindAll(); - setTimeout(() => { - if (this._input) { - this._input.remove(); - this._input = undefined; - } - }); - } + this._bindEventService.unbindAll(); + this._input?.remove?.(); } disable(isDisabled = true) {