import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { InputLabel } from '@material-ui/core';
import { ToggleButtonGroup, ToggleButton } from '@material-ui/lab';
import { DefaultOnOff } from "../../Form/Utilities/DefaultOnOff";
export const PropertyEditorOptionWithButtonGroup = (props) => {
    const onChange = (_event, newValue) => {
        Reflect.set(props.editObject, props.propertyName, newValue);
        props.updateCallback();
    };
    const { label } = props;
    const value = Reflect.get(props.editObject, props.propertyName);
    const options = props.options || [DefaultOnOff.DEFAULT, DefaultOnOff.Off, DefaultOnOff.On];
    return (_jsxs(_Fragment, { children: [label && _jsx(InputLabel, { children: label }, void 0),
            _jsx(ToggleButtonGroup, Object.assign({ value: value, exclusive: true, onChange: onChange, size: props.size || 'small' }, { children: options.map((option) => (_jsx(ToggleButton, Object.assign({ value: option, "aria-label": option }, { children: option }), option))) }), void 0)] }, void 0));
};
//# sourceMappingURL=PropertyEditorOptionWithButtonGroup.js.map