"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageControlStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Containers_1 = require("../../Containers");
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const ImageFormControl_1 = require("../Web/ImageFormControl");
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.XHStackContainer();
    ui.add(container);
    let imageDisplayField = new ImageFormControl_1.ImageFormControl();
    imageDisplayField.valueName = "value";
    imageDisplayField.link = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg";
    imageDisplayField.fullWidth = true;
    container.add(imageDisplayField);
    return { form: ui };
}
exports.ImageControlStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Image Control", "Full Width"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let cic = c;
            if (cic) {
                cic.width = 300;
                cic.fullWidth = false;
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Image Control", "With Width"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let cic = c;
            if (cic) {
                cic.staticImageLink = false;
            }
        }
        let data = new ExecutionData_1.ExecutionData();
        data.values["value"] = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Image Control", "Static Image"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let cic = c;
            if (cic) {
                cic.tooltip = "Tooltip";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Image Control", "With Tooltip"),
];
//# sourceMappingURL=XImageControl-stories.js.map