import * as __WEBPACK_EXTERNAL_MODULE__DataTable_mjs__ from "./DataTable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE_react_icons_md__ from "react-icons/md";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__Button_Button_mjs__ from "../Button/Button.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__storybook_addon_actions__ from "@storybook/addon-actions";
const meta = {
    title: 'Components/DataTable',
    component: __WEBPACK_EXTERNAL_MODULE__DataTable_mjs__["default"],
    argTypes: {
        showColumnSelector: {
            control: 'boolean'
        },
        size: {
            control: 'radio',
            options: [
                'sm',
                'md'
            ]
        }
    },
    parameters: {
        design: {
            type: 'figma',
            url: 'https://www.figma.com/file/bJcVrZNilxa06jYuVCGWYd/Redpanda-Design-System-2023?type=design&node-id=36-1193&mode=design'
        }
    }
};
/* ESM default export */ const DataTable_stories_rslib_entry_ = meta;
const mockColumns = [
    {
        header: 'Name',
        accessorKey: 'name'
    },
    {
        header: 'Number',
        accessorKey: 'number'
    },
    {
        header: 'Multiply',
        accessorKey: 'factor',
        size: 1 / 0
    }
];
const mockNestedColumns = [
    {
        header: 'Name',
        accessorKey: 'name'
    },
    {
        header: 'Nested',
        accessorKey: 'someOtherProperty'
    }
];
const mockData = Array(100).fill(0).map((_, i)=>({
        name: `Row ${i}`,
        number: `${10 * i}`,
        factor: 25.4 * i
    }));
const nestedMockData = Array(10).fill(0).map((_, i)=>({
        name: `Row ${i}`,
        nestedProperty: {
            someOtherProperty: `${20 * i}`
        }
    }));
const Default = {
    args: {
        columns: mockColumns,
        data: mockData
    }
};
const LoadingTable = {
    args: {
        columns: mockColumns,
        isLoading: true
    }
};
const EmptyTableWithButtonAction = {
    args: {
        columns: mockColumns,
        data: [],
        emptyAction: /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Button_Button_mjs__["default"], {
            onClick: (0, __WEBPACK_EXTERNAL_MODULE__storybook_addon_actions__.action)('onEmptyActionClick')
        }, "Create Item")
    }
};
const EmptyTableWithLinkAction = {
    args: {
        columns: mockColumns,
        data: [],
        emptyAction: /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Button_Button_mjs__["default"], {
            as: "a",
            href: "#"
        }, "Navigate Away")
    }
};
const JsxHeaders = {
    args: {
        columns: [
            {
                header: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Icon, {
                        as: __WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdPersonOutline
                    }), " Name"),
                accessorKey: 'name'
            },
            {
                header: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Icon, {
                        as: __WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdFavoriteBorder
                    }), " Number"),
                accessorKey: 'number'
            },
            {
                header: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Icon, {
                        as: __WEBPACK_EXTERNAL_MODULE_react_icons_md__.MdPayment
                    }), " Multiply"),
                accessorKey: 'factor'
            }
        ],
        data: mockData.slice(0, 3)
    }
};
const Pagination = {
    render: function() {
        const [pagination, onPaginationChange] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({
            pageIndex: 0,
            pageSize: 10
        });
        return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__DataTable_mjs__["default"], {
            columns: mockColumns,
            data: mockData,
            sorting: true,
            pagination: pagination,
            onPaginationChange: onPaginationChange
        });
    }
};
const ColumnFilters = {
    args: {
        // Enable filters
        enableColumnFilters: true,
        columns: [
            ...mockColumns,
            {
                header: 'Number',
                accessorKey: 'number',
                // Disable filter for a column
                enableColumnFilter: false
            }
        ],
        data: mockData.slice(0, 3)
    }
};
const ColumnResizing = {
    args: {
        enableColumnResizing: true,
        columns: mockColumns,
        data: mockData.slice(0, 3)
    }
};
const NestedObjectAsData = {
    args: {
        enableColumnResizing: true,
        columns: mockNestedColumns,
        data: nestedMockData
    }
};
const Expanded = {
    args: {
        columns: mockColumns,
        data: mockData.slice(0, 10),
        subComponent: (data)=>/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Box, {
                as: "pre",
                bg: "gray.50"
            }, /*#__PURE__*/ React.createElement("code", null, JSON.stringify(data, null, ' ')))
    }
};
export { ColumnFilters, ColumnResizing, Default, EmptyTableWithButtonAction, EmptyTableWithLinkAction, Expanded, JsxHeaders, LoadingTable, NestedObjectAsData, Pagination, DataTable_stories_rslib_entry_ as default };
