"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = (0, tslib_1.__importStar)(require("react"));
var classnames_1 = (0, tslib_1.__importDefault)(require("../../../utils/classnames"));
require("./index.css");
var platform_1 = require("../../../utils/platform");
var tea_component_1 = require("tea-component");
function FormCell(_a) {
    var _b;
    var className = _a.className, style = _a.style, label = _a.label, layout = _a.layout, children = _a.children, multiCell = _a.multiCell, requiredFlag = _a.requiredFlag, size = _a.size;
    var platform = (0, platform_1.usePlatform)();
    var isFlex = layout !== 'vertical';
    if (platform === 'pc') {
        return (React.createElement(tea_component_1.ConfigProvider, { classPrefix: "wedatea2td" },
            React.createElement(tea_component_1.Form.Item, { style: style, className: (0, classnames_1.default)((_b = {
                        'weda-ui': true,
                        'weui-cells_forms': !multiCell,
                        'weui-cells_checkbox': multiCell,
                        'weda-formcells__pc': !!label,
                        'weda-formcells__full-width': size === 'full'
                    },
                    _b[layout] = layout,
                    _b[className] = [className],
                    _b)), labelVisible: !!label, label: label }, children)));
    }
    return (React.createElement("div", { className: className, style: style },
        React.createElement("div", { className: (0, classnames_1.default)({
                'weda-formcells': true,
                'weui-cells': true,
                'weui-cells_forms': !multiCell,
                'weui-cells_checkbox': multiCell,
                'weui-flex': isFlex,
            }) },
            label ? (React.createElement("div", { className: (0, classnames_1.default)({
                    'weda-formcells__label': true,
                    // 标题也采用使用weui-cell的样式
                    'weui-cell': true,
                }) },
                requiredFlag ? (React.createElement("label", { className: "weda-formcells__flag" }, "*")) : null,
                React.createElement("label", null, label))) : null,
            React.createElement("div", { className: (0, classnames_1.default)({
                    'weda-formcells__content': true,
                    'weui-flex__item': isFlex,
                }) }, children))));
}
exports.default = FormCell;
//# sourceMappingURL=index.js.map