import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
function createCreateFormBlockUISchema(options) {
    const { collectionName, association, dataSource, templateSchema, isCusomeizeCreate } = options;
    const resourceName = association || collectionName;
    if (!dataSource) throw new Error('dataSource are required');
    const schema = {
        type: 'void',
        'x-acl-action-props': {
            skipScopeCheck: true
        },
        'x-acl-action': "".concat(resourceName, ":create"),
        'x-decorator': 'FormBlockProvider',
        'x-use-decorator-props': 'useCreateFormBlockDecoratorProps',
        'x-decorator-props': {
            dataSource,
            collection: collectionName,
            association,
            isCusomeizeCreate
        },
        'x-toolbar': 'BlockSchemaToolbar',
        'x-settings': 'blockSettings:createForm',
        'x-component': 'CardItem',
        properties: {
            [(0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: {
                type: 'void',
                'x-component': 'FormV2',
                'x-use-component-props': 'useCreateFormBlockProps',
                properties: {
                    [(0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: {
                        type: 'void',
                        'x-initializer': 'createForm:configureActions',
                        'x-component': 'ActionBar',
                        'x-component-props': {
                            style: {
                                marginBottom: 24
                            }
                        }
                    },
                    grid: templateSchema || {
                        type: 'void',
                        'x-component': 'Grid',
                        'x-initializer': 'form:configureFields',
                        properties: {}
                    }
                }
            }
        }
    };
    return schema;
}
export { createCreateFormBlockUISchema };
