feat(web/dialog): precision prop for number input (#372)

* feat(web/input): added precision prop for number input

* fix(web/input): added missing disabled prop to checkbox

* fix(web/input): correct icon for debug data

* fix(web/input): remove step prop from typings

* fix(web/debug): remove step prop
This commit is contained in:
daZepelin
2023-07-27 12:44:08 +03:00
committed by GitHub
parent 95cdbd2ce2
commit 99519d3d8e
4 changed files with 11 additions and 0 deletions

View File

@@ -40,6 +40,14 @@ export const debugInput = () => {
max: 10, max: 10,
icon: 'receipt', icon: 'receipt',
}, },
{
type: 'number',
label: 'Price',
default: 6.5,
min: 0,
max: 10,
icon: 'receipt',
},
{ {
type: 'slider', type: 'slider',
label: 'Slide bar', label: 'Slide bar',

View File

@@ -16,6 +16,7 @@ const CheckboxField: React.FC<Props> = (props) => {
required={props.row.required} required={props.row.required}
label={props.row.label} label={props.row.label}
defaultChecked={props.row.checked} defaultChecked={props.row.checked}
disabled={props.row.disabled}
/> />
); );
}; };

View File

@@ -30,6 +30,7 @@ const NumberField: React.FC<Props> = (props) => {
defaultValue={props.row.default} defaultValue={props.row.default}
min={props.row.min} min={props.row.min}
max={props.row.max} max={props.row.max}
precision={props.row.precision}
disabled={props.row.disabled} disabled={props.row.disabled}
icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />} icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />}
withAsterisk={props.row.required} withAsterisk={props.row.required}

View File

@@ -40,6 +40,7 @@ export interface ISelect extends BaseField<'select' | 'multi-select', string | s
} }
export interface INumber extends BaseField<'number', number> { export interface INumber extends BaseField<'number', number> {
precision?: number;
min?: number; min?: number;
max?: number; max?: number;
} }