import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
const createTableSelectorUISchema = (options)=>{
    const { collectionName, dataSource, rowKey } = options;
    if (!collectionName || !dataSource || !rowKey) throw new Error('collectionName, dataSource, rowKey is required');
    return {
        type: 'void',
        'x-acl-action': "".concat(collectionName, ":list"),
        'x-decorator': 'TableSelectorProvider',
        'x-use-decorator-props': 'useTableSelectorDecoratorProps',
        'x-decorator-props': {
            collection: collectionName,
            dataSource,
            action: 'list',
            params: {
                pageSize: 20
            },
            rowKey
        },
        'x-toolbar': 'BlockSchemaToolbar',
        'x-settings': 'blockSettings:tableSelector',
        'x-component': 'CardItem',
        properties: {
            [(0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: {
                type: 'void',
                'x-initializer': 'table:configureActions',
                'x-component': 'ActionBar',
                'x-component-props': {
                    style: {
                        marginBottom: 'var(--tb-spacing)'
                    }
                }
            },
            value: {
                type: 'array',
                'x-initializer': 'table:configureColumns',
                'x-component': 'TableV2.Selector',
                'x-use-component-props': 'useTableSelectorProps',
                'x-component-props': {
                    rowSelection: {
                        type: 'checkbox'
                    }
                }
            }
        }
    };
};
export { createTableSelectorUISchema };
