"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DateRangeStories = 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 DateRangeFormControl_1 = require("../Web/DateRangeFormControl");
const Containers_1 = require("../../Containers");
const LabelFormControl_1 = require("../Web/LabelFormControl");
const FormDesignConstants_1 = require("../../Utilities/FormDesignConstants");
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 Size";
    col1.add(label);
    let datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.valueName = "value";
    datePicker.requiredOnAllOutcomes = false;
    col1.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.style = FormDesignConstants_1.TextControlStyle.OUTLINE;
    datePicker.valueName = "value";
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col1.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.style = FormDesignConstants_1.TextControlStyle.SHADED;
    datePicker.valueName = "value";
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col1.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.valueName = "value";
    datePicker.style = FormDesignConstants_1.TextControlStyle.UNDERLINED;
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col1.add(datePicker);
    label = new LabelFormControl_1.LabelFormControl();
    label.text = "Small Size";
    col2.add(label);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.valueName = "value";
    datePicker.requiredOnAllOutcomes = false;
    datePicker.size = FormDesignConstants_1.TextControlSize.SMALL;
    col2.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.style = FormDesignConstants_1.TextControlStyle.OUTLINE;
    datePicker.valueName = "value";
    datePicker.size = FormDesignConstants_1.TextControlSize.SMALL;
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col2.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.style = FormDesignConstants_1.TextControlStyle.SHADED;
    datePicker.valueName = "value";
    datePicker.size = FormDesignConstants_1.TextControlSize.SMALL;
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col2.add(datePicker);
    datePicker = new DateRangeFormControl_1.DateRangeFormControl();
    datePicker.label = "DatePicker Label";
    datePicker.style = FormDesignConstants_1.TextControlStyle.UNDERLINED;
    datePicker.valueName = "value";
    datePicker.size = FormDesignConstants_1.TextControlSize.SMALL;
    datePicker.requiredOnAllOutcomes = false;
    datePicker.overrideStyle = true;
    col2.add(datePicker);
    return { form: ui };
}
exports.DateRangeStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.hintText = "hint text";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "With Hint"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.placeholderText = "placeholder text";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "With Placeholder"),
    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", "Date Range", "With Validation"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.type = "past";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "Past"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.type = "future";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "Future"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.type = "both";
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "Any"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        let controls = ui.form.getAllControls();
        for (let c of controls) {
            let ctf = c;
            if (ctf) {
                ctf.showRange = false;
            }
        }
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Date Range", "Hide Range"),
];
//# sourceMappingURL=XDateRange-stories.js.map