import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
import * as __WEBPACK_EXTERNAL_MODULE__Select_Select_mjs__ from "../Select/Select.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__buildingBlocks_MenuList_mjs__ from "./buildingBlocks/MenuList.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__buildingBlocks_SingleValue_mjs__ from "./buildingBlocks/SingleValue.mjs";
const ColumnSelect = ({ headerColumns, singleValueText = {}, firstTextPosition = 'left', footer, ...props })=>{
    const templateColumns = 0 !== headerColumns.length ? headerColumns.map(()=>'minmax(0, 1fr)').join(' ') : 'minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)';
    return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__Select_Select_mjs__["default"], {
        ...props,
        chakraStyles: {
            option: (provided)=>({
                    ...provided
                })
        },
        components: {
            MenuList: (menuListProps)=>/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__buildingBlocks_MenuList_mjs__["default"], {
                    ...menuListProps,
                    headerColumns: headerColumns,
                    footer: footer
                }),
            SingleValue: (singleValueProps)=>/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__buildingBlocks_SingleValue_mjs__["default"], {
                    ...singleValueProps,
                    headerColumns: headerColumns,
                    singleValueText: singleValueText,
                    firstTextPosition: firstTextPosition
                })
        },
        selectedOptionStyle: "check",
        formatOptionLabel: (props)=>{
            const { label, value, ...otherProps } = props;
            const values = Object.values(otherProps);
            return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Grid, {
                templateColumns: templateColumns,
                flexGrow: 1
            }, values.map((value, index)=>/*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.GridItem, {
                    key: `${value}-${index}`
                }, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Text, null, value))));
        }
    });
};
/* ESM default export */ const ColumnSelect_rslib_entry_ = ColumnSelect;
export { ColumnSelect_rslib_entry_ as default };
