"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HeadingStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const HeadingFormControl_1 = require("../Web/HeadingFormControl");
const Containers_1 = require("../../Containers");
const ExecutionData_1 = require("@appglue/common/dist/Common/Data/ExecutionData/ExecutionData");
const LabelFormControl_1 = require("../Web/LabelFormControl");
const StoryData_1 = require("../../../CommonUI/StoryBook/StoryData");
const UIStyleConstants_1 = require("@appglue/common/dist/Common/UIStyleConstants");
function getUI() {
    let ui = new FormConfiguration_1.FormConfiguration();
    let container = new Containers_1.XColumnContainer();
    let col = new Containers_1.XColumnContainerColumn();
    container.add(col);
    ui.add(container);
    let label = new LabelFormControl_1.LabelFormControl();
    label.text = "Heading";
    col.add(label);
    let Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h1";
    Heading.text = "h1";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h2";
    Heading.text = "h2";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h3";
    Heading.text = "h3";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h4";
    Heading.text = "h4";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h5";
    Heading.text = "h5";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "h6";
    Heading.text = "h6";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "subtitle1";
    Heading.text = "subtitle1";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "subtitle2";
    Heading.text = "subtitle2";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "body1";
    Heading.text = "body1";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "caption";
    Heading.text = "caption";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "button";
    Heading.text = "button";
    Heading.valueName = "value";
    col.add(Heading);
    Heading = new HeadingFormControl_1.HeadingFormControl();
    Heading.type = "overline";
    Heading.text = "overline";
    Heading.valueName = "value";
    col.add(Heading);
    return { form: ui };
}
exports.HeadingStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Heading", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        for (let c of ui.form.getAllControls()) {
            c.color = UIStyleConstants_1.UIStyleConstants.BLUE_COLOR;
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Heading", "Color"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        for (let c of ui.form.getAllControls()) {
            c.background = UIStyleConstants_1.UIStyleConstants.BLUE_COLOR;
            c.color = UIStyleConstants_1.UIStyleConstants.WHITE_COLOR;
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Heading", "Background Color"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        for (let c of ui.form.getAllControls()) {
            c.textAlign = "center";
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Heading", "Center"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        for (let c of ui.form.getAllControls()) {
            c.fromData = true;
        }
        let data = new ExecutionData_1.ExecutionData();
        data.values["value"] = "This is from form data";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Heading", "FromData"),
];
//# sourceMappingURL=XHeading-stories.js.map