"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TagGroupStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FormConfiguration_1 = require("../../FormConfiguration");
const FormRuntime_1 = require("../../FormRuntime");
const TagGroupFormControl_1 = require("../Web/TagGroupFormControl");
const Containers_1 = require("../../Containers");
const LabelFormControl_1 = require("../Web/LabelFormControl");
const StoryData_1 = require("../../../CommonUI/StoryBook/StoryData");
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 = "Tag Selection";
    col.add(label);
    let textField = new TagGroupFormControl_1.TagGroupFormControl();
    textField.label = "Text Field Label";
    textField.valueName = "tag";
    textField.list = ["Upwork", "HubStaff", "Appglue"];
    textField.requiredOnAllOutcomes = false;
    col.add(textField);
    textField = new TagGroupFormControl_1.TagGroupFormControl();
    textField.label = "Text Field Label";
    textField.valueName = "tag";
    textField.list = ["Upwork", "HubStaff", "Appglue"];
    textField.requiredOnAllOutcomes = true;
    col.add(textField);
    return { form: ui };
}
exports.TagGroupStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.allowedNewTag = true;
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Tag Group", "Allow New Tag"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.allowedNewTag = false;
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Tag Group", "Not Allow New Tag"),
    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", "Tag Group", "With Validation"),
];
//# sourceMappingURL=XTagGroup-stories.js.map