mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
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:
@@ -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',
|
||||||
|
|||||||
@@ -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}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user