import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_useCompile_mjs__ from "../../hooks/useCompile.mjs";
const colors = {
    red: '{{t("Red")}}',
    magenta: '{{t("Magenta")}}',
    volcano: '{{t("Volcano")}}',
    orange: '{{t("Orange")}}',
    gold: '{{t("Gold")}}',
    lime: '{{t("Lime")}}',
    green: '{{t("Green")}}',
    cyan: '{{t("Cyan")}}',
    blue: '{{t("Blue")}}',
    geekblue: '{{t("Geek blue")}}',
    purple: '{{t("Purple")}}',
    default: '{{t("Default")}}'
};
const ColorSelect = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
    const compile = (0, __WEBPACK_EXTERNAL_MODULE__hooks_useCompile_mjs__.useCompile)();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Select, {
        ...props,
        children: Object.keys(colors).map((color)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Select.Option, {
                value: color,
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tag, {
                    color: color,
                    children: compile(colors[color] || colors.default)
                })
            }, color))
    });
}, (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapProps)((props, field)=>({
        ...props,
        suffix: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
            children: (null == field ? void 0 : field['loading']) || (null == field ? void 0 : field['validating']) ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.LoadingOutlined, {}) : props.suffix
        })
    })), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)((props)=>{
    const compile = (0, __WEBPACK_EXTERNAL_MODULE__hooks_useCompile_mjs__.useCompile)();
    const { value } = props;
    if (!colors[value]) return null;
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tag, {
        color: value,
        children: compile(colors[value] || colors.default)
    });
}));
const ColorSelect_rslib_entry_ = ColorSelect;
export { ColorSelect, ColorSelect_rslib_entry_ as default };
