"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * title: "多项选项卡（支持横纵布局）"
 * description: "使用 `<Checkbox.Group>` 渲染 `<Checkbox>` 分组,定制Checkbox的为卡片样式"
 */
var react_1 = __importStar(require("react"));
var console_components_1 = require("@alicloud/console-components");
var styled_components_1 = __importDefault(require("styled-components"));
var List = [
    {
        label: '文本信息A',
        value: 'A',
    },
    {
        label: '文本信息B',
        value: 'B',
    },
    {
        label: '文本信息C',
        value: 'C',
        disabled: true,
    },
    {
        label: '文本信息D',
        value: 'D',
    },
];
var disableStyle = {
    backgroundColor: '#f6f6f6',
};
var checkedStyle = {
    backgroundColor: '#eff3f8',
};
exports.default = (function () {
    var _a = (0, react_1.useState)([]), checkedList = _a[0], setCheckedList = _a[1];
    var getStyle = function (item) {
        if (item.disabled) {
            return disableStyle;
        }
        if (checkedList.find(function (i) { return i === item.value; })) {
            return checkedStyle;
        }
        return {};
    };
    return (react_1.default.createElement(console_components_1.Checkbox.Group, { value: checkedList, onChange: setCheckedList },
        react_1.default.createElement(Container, null, List.slice(0, 2).map(function (item) { return (react_1.default.createElement(CheckItem, { style: getStyle(item) },
            react_1.default.createElement(console_components_1.Checkbox, { value: item.value, disabled: item.disabled },
                item.label,
                react_1.default.createElement("br", null),
                react_1.default.createElement("span", { style: {
                        margin: '0 0 0 24px',
                        color: '#808080',
                        display: 'inline-block',
                        lineHeight: '16px',
                    } }, "\u5BF9\u4E8E\u9009\u9879\u7684\u63CF\u8FF0/\u89E3\u91CA\u6587\u6848\uFF0C\u5BF9\u4E8E\u9009\u9879\u7684\u63CF\u8FF0/\u89E3\u91CA\u6587\u6848")))); })),
        react_1.default.createElement(Container, null, List.slice(2, 4).map(function (item) { return (react_1.default.createElement(CheckItem, { style: getStyle(item) },
            react_1.default.createElement(console_components_1.Checkbox, { value: item.value, disabled: item.disabled },
                item.label,
                react_1.default.createElement("br", null),
                react_1.default.createElement("span", { style: {
                        margin: '0 0 0 24px',
                        color: '#808080',
                        display: 'inline-block',
                        lineHeight: '16px',
                    } }, "\u5BF9\u4E8E\u9009\u9879\u7684\u63CF\u8FF0/\u89E3\u91CA\u6587\u6848\uFF0C\u5BF9\u4E8E\u9009\u9879\u7684\u63CF\u8FF0/\u89E3\u91CA\u6587\u6848")))); }))));
});
var CheckItem = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border-radius: 4px;\n  border: 1px solid #e5e5e5;\n  padding: 16px;\n  margin: 4px;\n  width: 230px;\n  display: inline-block;\n  &:hover {\n    background-color: #f7f9fa;\n    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.16);\n  }\n"], ["\n  border-radius: 4px;\n  border: 1px solid #e5e5e5;\n  padding: 16px;\n  margin: 4px;\n  width: 230px;\n  display: inline-block;\n  &:hover {\n    background-color: #f7f9fa;\n    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.16);\n  }\n"])));
var Container = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  display: flex;\n  justify-content: space-between;\n  width: 100%;\n  max-width: 470px; /* 2 * (230px + 4px * 2) */\n"], ["\n  display: flex;\n  justify-content: space-between;\n  width: 100%;\n  max-width: 470px; /* 2 * (230px + 4px * 2) */\n"])));
var templateObject_1, templateObject_2;
