import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { TextField } from "@material-ui/core";
export const PropertyEditorSelect = (props) => {
    var _a;
    const onChange = (event) => {
        if (props.parentDefaultValue &&
            props.parentDefaultValue === event.target.value) {
            Reflect.set(props.editObject, props.propertyName, null);
        }
        else {
            Reflect.set(props.editObject, props.propertyName, event.target.value);
        }
        props.updateCallback();
    };
    return (_jsx(_Fragment, { children: _jsx(TextField, Object.assign({ "data-testid": `property-${props.propertyName}-select`, select: true, value: (_a = Reflect.get(props.editObject, props.propertyName)) !== null && _a !== void 0 ? _a : props.parentDefaultValue, label: props.label, onChange: onChange, fullWidth: true, variant: "outlined" }, { children: props.options.map((item, index) => {
                return (_jsx("option", Object.assign({ value: item }, { children: item }), index));
            }) }), void 0) }, void 0));
};
//# sourceMappingURL=PropertyEditorSelect.js.map