const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
const require_withContainer = require("../../utils/withContainer.js");
const require_useColumns = require("./useColumns.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
//#region src/components/pisellDataSourceContainer/components/Table/index.tsx
const _excluded = [
	"serverActions",
	"refManager",
	"columns",
	"scopeId",
	"__id"
];
const WithTable = (0, react.forwardRef)((props) => {
	const { serverActions: { list: listAction }, refManager, columns, scopeId = "table", __id } = props, otherProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	const { data, loading } = listAction;
	const { visibleColumns } = require_useColumns.default({
		columns: columns || [],
		scopeId,
		refManager,
		__id
	});
	return /* @__PURE__ */ react.default.createElement(antd.Table, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, otherProps), {}, {
		columns: visibleColumns,
		pagination: false,
		dataSource: (data === null || data === void 0 ? void 0 : data.list) || [],
		loading,
		onRow: (record, index) => {
			var _otherProps$onRow;
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (otherProps === null || otherProps === void 0 || (_otherProps$onRow = otherProps.onRow) === null || _otherProps$onRow === void 0 ? void 0 : _otherProps$onRow.call(otherProps, record, index)) || {}), {}, {
				__is_group: record.__is_group,
				__is_drag_sort: otherProps.dragSort,
				className: record.__is_group ? "pisell-lowcode-table-group-row-wrap" : ""
			});
		}
	}));
});
var Table_default = require_withContainer.default(WithTable, "table");
//#endregion
exports.default = Table_default;
