import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import withContainer from "../../utils/withContainer.js";
import useColumns from "./useColumns.js";
import React, { forwardRef } from "react";
import { Table } from "antd";
//#region src/components/pisellDataSourceContainer/components/Table/index.tsx
const _excluded = [
	"serverActions",
	"refManager",
	"columns",
	"scopeId",
	"__id"
];
var Table_default = withContainer(forwardRef((props) => {
	const { serverActions: { list: listAction }, refManager, columns, scopeId = "table", __id } = props, otherProps = _objectWithoutProperties(props, _excluded);
	const { data, loading } = listAction;
	const { visibleColumns } = useColumns({
		columns: columns || [],
		scopeId,
		refManager,
		__id
	});
	return /* @__PURE__ */ React.createElement(Table, _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 _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" : ""
			});
		}
	}));
}), "table");
//#endregion
export { Table_default as default };
