"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextEntryFormControl = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const PropertyEditorBoolean_1 = require("../../CommonUI/PropertyEditing/PropertyEditorBoolean");
const core_1 = require("@material-ui/core");
const TextSelectionButtonGroups_1 = require("../../CommonUI/PropertyEditing/TextSelectionButtonGroups");
const PropertyEditorText_1 = require("../../CommonUI/PropertyEditing/PropertyEditorText");
const DataFormControl_1 = require("./DataFormControl");
const PropertyEditorInteger_1 = require("../../CommonUI/PropertyEditing/PropertyEditorInteger");
const DataUtilities_1 = require("@appglue/common/dist/Common/DataUtilities");
class TextEntryFormControl extends DataFormControl_1.DataFormControl {
    hintText;
    placeholderText;
    overrideStyle = false;
    style;
    size;
    fullWidth = true;
    // only show if not full width
    width;
    renderTextStyleSelectionEditor() {
        return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(PropertyEditorBoolean_1.PropertyEditorBoolean, { editObject: this, label: "Override Text Style", propertyName: "overrideStyle", updateCallback: this.controlUpdate }), (0, jsx_runtime_1.jsxs)(core_1.Collapse, { in: this.overrideStyle, children: [(0, jsx_runtime_1.jsx)(TextSelectionButtonGroups_1.PropertyEditorTextStyleSelection, { updateCallback: this.controlUpdate, propertyName: "style", editObject: this, parentDefaultValue: this.getFormContext()?.form.defaultTextStyle }), (0, jsx_runtime_1.jsx)(TextSelectionButtonGroups_1.PropertyEditorTextSizeSelection, { updateCallback: this.controlUpdate, propertyName: "size", editObject: this, parentDefaultValue: this.getFormContext()?.form.defaultTextSize })] })] }));
    }
    renderTextControlBasePropertyEditor() {
        return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(PropertyEditorText_1.PropertyEditorText, { label: "Hint Text", updateCallback: this.controlUpdate, propertyName: "hintText", editObject: this }), (0, jsx_runtime_1.jsx)(PropertyEditorText_1.PropertyEditorText, { label: "Placeholder Text", updateCallback: this.controlUpdate, propertyName: "placeholderText", editObject: this }), (0, jsx_runtime_1.jsx)(PropertyEditorBoolean_1.PropertyEditorBoolean, { label: "Full Width", updateCallback: this.controlUpdate, propertyName: "fullWidth", editObject: this }), (0, jsx_runtime_1.jsx)(core_1.Collapse, { in: !this.fullWidth, children: (0, jsx_runtime_1.jsx)(PropertyEditorInteger_1.PropertyEditorInteger, { label: "Width", updateCallback: this.controlUpdate, propertyName: "width", editObject: this }) })] }));
    }
    getStorageData() {
        let retData = super.getStorageData();
        retData = DataUtilities_1.DataUtilities.addStorageData(this, retData, "hintText", "placeholderText", "overrideStyle", "style", "size", "fullWidth", "width");
        return retData;
    }
    setStorageData(data) {
        super.setStorageData(data);
        DataUtilities_1.DataUtilities.setStorageData(this, data, "hintText", "placeholderText", "overrideStyle", "style", "size", "fullWidth", "width");
    }
}
exports.TextEntryFormControl = TextEntryFormControl;
//# sourceMappingURL=TextEntryFormControl.js.map