"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinkStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const LinkFormControl_1 = require("../Web/LinkFormControl");
const Containers_1 = require("../../Containers");
const LabelFormControl_1 = require("../Web/LabelFormControl");
const FormDesignConstants_1 = require("../../Utilities/FormDesignConstants");
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 Containers_1.XColumnContainer();
    let col1 = new Containers_1.XColumnContainerColumn();
    let col2 = new Containers_1.XColumnContainerColumn();
    col2.interControlSpacing = 20;
    container.add(col1);
    container.add(col2);
    ui.add(container);
    let label = new LabelFormControl_1.LabelFormControl();
    label.text = "Large";
    col1.add(label);
    let link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.LARGE;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.HOVER;
    col1.add(link);
    link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.LARGE;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.ALWAYS;
    col1.add(link);
    link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.LARGE;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.NONE;
    col1.add(link);
    label = new LabelFormControl_1.LabelFormControl();
    label.text = "Small";
    col2.add(label);
    link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.SMALL;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.HOVER;
    col2.add(link);
    link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.SMALL;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.ALWAYS;
    col2.add(link);
    link = new LinkFormControl_1.LinkFormControl();
    link.label = "Link Label";
    link.valueName = "link";
    link.size = FormDesignConstants_1.ButtonControlSize.SMALL;
    link.type = FormDesignConstants_1.LinkControlType.ACTION;
    link.linkUnderline = FormDesignConstants_1.LinkControlUnderline.NONE;
    col2.add(link);
    container = new Containers_1.XColumnContainer();
    col1 = new Containers_1.XColumnContainerColumn();
    col2 = new Containers_1.XColumnContainerColumn();
    col2.interControlSpacing = 20;
    container.add(col1);
    container.add(col2);
    ui.add(container);
    return { form: ui };
}
exports.LinkStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Link", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            c.type = FormDesignConstants_1.LinkControlType.URL;
        }
        let data = new ExecutionData_1.ExecutionData();
        data.values["link"] = "https://google.com";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Link", "With Links"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            c.type = FormDesignConstants_1.LinkControlType.ACTION;
        }
        let data = new ExecutionData_1.ExecutionData();
        data.values["link"] = "https://google.com";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Link", "Action"),
];
//# sourceMappingURL=XLink-stories.js.map