/**
 * amis-ui v6.14.0-beta.1
 * Copyright 2018-2025 fex
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var React = require('react');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
var zIndex = 1;
var BodyCell = /** @class */ (function (_super) {
    tslib.__extends(BodyCell, _super);
    function BodyCell() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    BodyCell.prototype.render = function () {
        var _a;
        var _b = this.props, fixed = _b.fixed, selfSticky = _b.selfSticky, rowSpan = _b.rowSpan, colSpan = _b.colSpan, children = _b.children, className = _b.className, column = _b.column, style = _b.style, depth = _b.depth, col = _b.col, Component = _b.wrapperComponent, cx = _b.classnames, testIdBuilder = _b.testIdBuilder;
        var _style = tslib.__assign({}, style);
        if (fixed || selfSticky) {
            _style = tslib.__assign({ position: 'sticky', zIndex: zIndex }, _style);
        }
        return (_J$X_(Component, tslib.__assign({ rowSpan: rowSpan && rowSpan > 1 ? rowSpan : null, colSpan: colSpan && colSpan > 1 ? colSpan : null, className: cx('Table-cell', className, (_a = {},
                _a[cx("Table-cell-fix-".concat(fixed))] = fixed,
                _a["Table-cell-self-sticky"] = selfSticky,
                _a["text-".concat(column === null || column === void 0 ? void 0 : column.align)] = column === null || column === void 0 ? void 0 : column.align,
                _a["align-".concat(column === null || column === void 0 ? void 0 : column.vAlign)] = column === null || column === void 0 ? void 0 : column.vAlign,
                _a)), style: _style, "data-depth": depth || null, "data-col": col }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getTestId()), children));
    };
    BodyCell.defaultProps = {
        fixed: '',
        selfSticky: false,
        wrapperComponent: 'td',
        rowSpan: null,
        colSpan: null
    };
    return BodyCell;
}(React__default["default"].PureComponent));

exports["default"] = BodyCell;
