@astarte-platform/react-bootstrap
Version:
React Bootstrap theme, fields and widgets for react-jsonschema-form, powered by react-bootstrap, this is a package from a fork of official project
21 lines • 892 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { rangeSpec } from '@rjsf/utils';
import FormRange from 'react-bootstrap/FormRange';
export default function RangeWidget(props) {
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
const _onChange = ({ target: { value } }) => onChange(value);
const _onBlur = ({ target: { value } }) => onBlur(id, value);
const _onFocus = ({ target: { value } }) => onFocus(id, value);
const rangeProps = {
value,
id,
name: id,
disabled,
onChange: _onChange,
onBlur: _onBlur,
onFocus: _onFocus,
...rangeSpec(schema),
};
return (_jsxs(_Fragment, { children: [_jsx(FormRange, { ...rangeProps }), _jsx("span", { className: 'range-view', children: value })] }));
}
//# sourceMappingURL=RangeWidget.js.map