"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PropertyEditorOptionWithButtonGroup = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("@material-ui/core");
const material_1 = require("@mui/material");
const DefaultOnOff_1 = require("../../Form/Utilities/DefaultOnOff");
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_1.DefaultOnOff.DEFAULT, DefaultOnOff_1.DefaultOnOff.Off, DefaultOnOff_1.DefaultOnOff.On];
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label && (0, jsx_runtime_1.jsx)(core_1.InputLabel, { children: label }), (0, jsx_runtime_1.jsx)(material_1.ToggleButtonGroup, { value: value, exclusive: true, onChange: onChange, size: props.size || "small", children: options.map((option) => ((0, jsx_runtime_1.jsx)(material_1.ToggleButton, { value: option, "aria-label": option, children: option }, option))) })] }));
};
exports.PropertyEditorOptionWithButtonGroup = PropertyEditorOptionWithButtonGroup;
//# sourceMappingURL=PropertyEditorOptionWithButtonGroup.js.map