"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BarChartStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FormConfiguration_1 = require("../../FormConfiguration");
const Containers_1 = require("../../Containers");
const ObjectDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/ObjectDataDefinition");
const NumberDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/NumberDataDefinition");
const StringDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/StringDataDefinition");
const BarChartFormControl_1 = require("../Web/BarChartFormControl");
const ChartSameple_1 = require("../Testing/ChartSameple");
const StoryData_1 = require("../../../CommonUI/StoryBook/StoryData");
const FormRuntime_1 = require("../../FormRuntime");
function getUI() {
    let ui = new FormConfiguration_1.FormConfiguration();
    let dataDef = ui.getInputDefinition();
    const chartDataDef = new ObjectDataDefinition_1.ObjectDataDefinition("invoiceByMonth");
    chartDataDef.list = true;
    const labelDef = new StringDataDefinition_1.StringDataDefinition("label");
    const valueDef = new NumberDataDefinition_1.NumberDataDefinition("value");
    chartDataDef.fields.push(labelDef);
    chartDataDef.fields.push(valueDef);
    dataDef.fields.push(chartDataDef);
    const values = ChartSameple_1.chartNonSeries;
    dataDef.value["invoiceByMonth"] = values;
    ui.inputData = dataDef;
    let container = new Containers_1.XStackContainer();
    const chart = new BarChartFormControl_1.BarChartFormControl();
    container.add(chart);
    ui.add(container);
    return { form: ui, control: chart };
}
exports.BarChartStories = [
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "Default"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.showLegend = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Legend"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.render3D = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "3d"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.cursor = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Cursor"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.showTooltip = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Tooltip"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.xAxisLabel = "Month";
        ui.control.yAxisLabel = "Amount";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Axis Label"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.showXYAxis = false;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Hide XY Axis"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.setLowerBounds = true;
        ui.control.lowerBounds = 0;
        ui.control.setUpperBounds = true;
        ui.control.upperBounds = 5000;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Upper and Lower Bounds"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.dataName = "invoiceByMonth";
        ui.control.label = "Bar Chart";
        ui.control.numberFormatter = "BigNumber";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Number Formatter"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.stackBars = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (stacked)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.render3D = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (3d)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.stackBars = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (non nested data)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.colorType = "Mono";
        ui.control.color = "#545B64";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (mono)"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.colorType = "Custom";
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (custom color) - ??? HOW DO YOU SET COLOR"),
    new StoryData_1.StoryNode(() => {
        let ui = getUI();
        ui.control.label = "Bar Chart";
        ui.control.allowSeries = true;
        ui.control.cursor = true;
        return (0, jsx_runtime_1.jsx)(FormRuntime_1.FormRuntime, { form: ui.form });
    }, "Form Designer", "Controls", "Bar Chart", "With Multiple Series (with cursor) - ??? HOW DO YOU SET COLOR"),
];
//# sourceMappingURL=XBarChart-stories.js.map