@umbraco/json-models-builders
Version:
Builders and models for Umbraco Sites
59 lines • 1.52 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DecimalDataTypeBuilder = void 0;
const dataTypeBuilder_1 = require("./dataTypeBuilder");
class DecimalDataTypeBuilder extends dataTypeBuilder_1.DataTypeBuilder {
step;
min;
max;
placeholder;
constructor() {
super();
this.editorAlias = 'Umbraco.Decimal';
this.editorUiAlias = 'Umb.PropertyEditorUi.Decimal';
}
withMin(min) {
this.min = min;
return this;
}
withMax(max) {
this.max = max;
return this;
}
withStep(step) {
this.step = step;
return this;
}
withPlaceholder(placeholder) {
this.placeholder = placeholder;
return this;
}
getValues() {
let values = [];
values.push({
alias: 'step',
value: this.step || 0.01
});
if (this.min !== undefined) {
values.push({
alias: 'min',
value: this.min
});
}
if (this.max !== undefined) {
values.push({
alias: 'max',
value: this.max
});
}
if (this.placeholder !== undefined) {
values.push({
alias: 'placeholder',
value: this.placeholder
});
}
return values;
}
}
exports.DecimalDataTypeBuilder = DecimalDataTypeBuilder;
//# sourceMappingURL=decimalDataTypeBuilder.js.map