"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MultiInlineTextEditStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const MultiInlineTextEditFormControl_1 = require("../Web/MultiInlineTextEditFormControl");
const XColumnContainer_1 = require("../../Containers/XColumnContainer");
const LabelFormControl_1 = require("../Web/LabelFormControl");
const ExecutionData_1 = require("@appglue/common/dist/Common/Data/ExecutionData/ExecutionData");
const StoryData_1 = require("../../../CommonUI/StoryBook/StoryData");
function getUI() {
    let ui = new FormConfiguration_1.FormConfiguration();
    let container = new XColumnContainer_1.XColumnContainer();
    let col = new XColumnContainer_1.XColumnContainerColumn();
    container.add(col);
    ui.add(container);
    let label = new LabelFormControl_1.LabelFormControl();
    label.text = "MultiInline Text Edit";
    col.add(label);
    let InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h1";
    InlineTextEdit.type = "h1";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h2";
    InlineTextEdit.type = "h2";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h3";
    InlineTextEdit.type = "h3";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h4";
    InlineTextEdit.type = "h4";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h5";
    InlineTextEdit.type = "h5";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "h6";
    InlineTextEdit.type = "h6";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "subtitle1";
    InlineTextEdit.type = "subtitle1";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "subtitle2";
    InlineTextEdit.type = "subtitle2";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "body1";
    InlineTextEdit.type = "body1";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "caption";
    InlineTextEdit.type = "caption";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "button";
    InlineTextEdit.type = "button";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    InlineTextEdit = new MultiInlineTextEditFormControl_1.MultiInlineTextEditFormControl();
    InlineTextEdit.placeholderText = "overline";
    InlineTextEdit.type = "overline";
    InlineTextEdit.valueName = "value";
    InlineTextEdit.requiredOnAllOutcomes = false;
    col.add(InlineTextEdit);
    return { form: ui };
}
exports.MultiInlineTextEditStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Multi Inline Text Edit", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.hintText = "hint text";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Multi Inline Text Edit", "With Hint"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.placeholderText = "placeholder text";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Multi Inline Text Edit", "With Placeholder"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.requiredOnAllOutcomes = true;
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Multi Inline Text Edit", "With Validation"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let data = new ExecutionData_1.ExecutionData();
        data.values["value"] = "text value";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Multi Inline Text Edit", "With Value"),
];
//# sourceMappingURL=XMultiInlineTextEdit-stories.js.map