Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ export const manifest: ManifestPropertyEditorSchema = {
alias: 'minVal',
label: 'Minimum value',
description: '',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal',
config: [{ alias: 'step', value: '0.001' }],
},
{
alias: 'maxVal',
label: 'Maximum value',
description: '',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal',
config: [{ alias: 'step', value: '0.001' }],
},
],
defaultData: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,36 @@ export const manifests: Array<UmbExtensionManifest> = [
alias: 'initVal1',
label: 'Initial value',
description: '',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal',
config: [{ alias: 'step', value: '0.001' }],
Comment thread
engijlr marked this conversation as resolved.
Outdated
},
{
alias: 'initVal2',
label: 'Initial value 2',
description: 'Used when range is enabled',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal',
config: [{ alias: 'step', value: '0.001' }],
},
{
alias: 'step',
label: 'Step increments',
description: '',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal',
config: [{ alias: 'step', value: '0.001' }],
},
],
defaultData: [
{
alias: 'initVal1',
value: 0,
value: 0.0,
},
{
alias: 'initVal2',
value: 0,
value: 0.0,
},
{
alias: 'step',
value: 1,
value: 1.0,
Comment thread
jsandrae marked this conversation as resolved.
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class UmbPropertyEditorUISliderElement
const initVal2 = Number(config.getValueByAlias('initVal2'));
this._initVal2 = isNaN(initVal2) ? this._initVal1 + this._step : initVal2;

this._min = this.#parseInt(config.getValueByAlias('minVal')) || 0;
this._max = this.#parseInt(config.getValueByAlias('maxVal')) || 100;
this._min = this.#parseNumber(config.getValueByAlias('minVal')) || 0;
this._max = this.#parseNumber(config.getValueByAlias('maxVal')) || 100;

if (this._min === this._max) {
this._max = this._min + 100;
Expand Down Expand Up @@ -113,7 +113,7 @@ export class UmbPropertyEditorUISliderElement
}
}

#parseInt(input: unknown): number | undefined {
#parseNumber(input: unknown): number | undefined {
const num = Number(input);
return Number.isNaN(num) ? undefined : num;
Comment thread
jsandrae marked this conversation as resolved.
Outdated
}
Expand Down
Loading