"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckboxListStories = 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 CheckboxListFormControl_1 = require("../Web/CheckboxListFormControl");
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.XStackContainer();
    ui.add(container);
    let checkboxlist = new CheckboxListFormControl_1.CheckboxListFormControl();
    checkboxlist.valueName = "checkboxList";
    checkboxlist.list = [
        "Operator",
        "Manager",
        "Administration",
        "UX/UI designer",
        "Back-end developer",
        "Project-manager",
    ];
    container.add(checkboxlist);
    return { form: ui, control: checkboxlist };
}
exports.CheckboxListStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Default Control";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Checkbox List", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "With Values";
        let data = new ExecutionData_1.ExecutionData();
        data.values["checkboxList"] = {
            Operator: true,
        };
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Checkbox List", "With Values"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Required One Selection At Least";
        let data = new ExecutionData_1.ExecutionData();
        data.values["checkboxList"] = {
            Operator: false,
        };
        ui.control.requiredOneSelectionAtLeast = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form, formData: data });
    }, "Form Designer", "Controls", "Checkbox List", "Require One Selection"),
];
//# sourceMappingURL=XCheckboxList-stories.js.map