ref, clean

This commit is contained in:
Yuri Kuznetsov
2025-09-25 16:03:09 +03:00
parent 74cc701459
commit 2465a554f7
2 changed files with 9 additions and 17 deletions
-2
View File
@@ -172,8 +172,6 @@ class FloatFieldView extends IntFieldView {
return parts.join(this.decimalMark);
}
setupMaxLength() {}
validateFloat() {
const value = this.model.get(this.name);
+9 -15
View File
@@ -107,8 +107,6 @@ class IntFieldView extends BaseFieldView {
setup() {
super.setup();
this.setupMaxLength();
if (this.getPreferences().has('thousandSeparator')) {
this.thousandSeparator = this.getPreferences().get('thousandSeparator');
}
@@ -279,8 +277,11 @@ class IntFieldView extends BaseFieldView {
}
}
/**
* @return {number|null}
*/
getMaxValue() {
let maxValue = this.model.getFieldParam(this.name, 'max') || null;
let maxValue = this.model.getFieldParam(this.name, 'max') ?? null;
if (!maxValue && maxValue !== 0) {
maxValue = null;
@@ -293,10 +294,13 @@ class IntFieldView extends BaseFieldView {
return maxValue;
}
/**
* @return {number|null}
*/
getMinValue() {
let minValue = this.model.getFieldParam(this.name, 'min');
let minValue = this.model.getFieldParam(this.name, 'min') ?? null;
if (!minValue && minValue !== 0) {
if (minValue != null) {
minValue = null;
}
@@ -307,16 +311,6 @@ class IntFieldView extends BaseFieldView {
return minValue;
}
setupMaxLength() {
let maxValue = this.getMaxValue();
if (typeof max !== 'undefined' && max !== null) {
maxValue = this.formatNumber(maxValue);
this.params.maxLength = maxValue.toString().length;
}
}
// noinspection JSUnusedGlobalSymbols
validateInt() {
const value = this.model.get(this.name);