import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__ from "../../../../application/schema-initializer/SchemaInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../../../data-source/index.mjs";
const gridCardItemActionInitializers = new __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__.SchemaInitializer({
    name: 'gridCard:configureItemActions',
    title: '{{t("Configure actions")}}',
    icon: 'SettingOutlined',
    items: [
        {
            type: 'itemGroup',
            title: '{{t("Enable actions")}}',
            name: 'enable-actions',
            children: [
                {
                    name: 'view',
                    title: '{{t("View")}}',
                    Component: 'ViewActionInitializer',
                    schema: {
                        'x-component': 'Action.Link',
                        'x-action': 'view',
                        'x-decorator': 'ACLActionProvider',
                        'x-align': 'left'
                    }
                },
                {
                    name: 'edit',
                    title: '{{t("Edit")}}',
                    Component: 'UpdateActionInitializer',
                    schema: {
                        'x-component': 'Action.Link',
                        'x-action': 'update',
                        'x-decorator': 'ACLActionProvider',
                        'x-align': 'left'
                    },
                    useVisible () {
                        const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
                        return ('view' !== collection.template || (null == collection ? void 0 : collection.writableView)) && 'sql' !== collection.template;
                    }
                },
                {
                    name: 'delete',
                    title: '{{t("Delete")}}',
                    Component: 'DestroyActionInitializer',
                    schema: {
                        'x-component': 'Action.Link',
                        'x-action': 'destroy',
                        'x-decorator': 'ACLActionProvider',
                        'x-align': 'left'
                    },
                    useVisible () {
                        const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
                        return 'sql' !== collection.template;
                    }
                }
            ]
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            type: 'subMenu',
            title: '{{t("Customize")}}',
            name: 'customize',
            children: [
                {
                    name: 'popup',
                    title: '{{t("Popup")}}',
                    Component: 'PopupActionInitializer',
                    useComponentProps () {
                        return {
                            'x-component': 'Action.Link'
                        };
                    }
                },
                {
                    name: 'update-record',
                    title: '{{t("Update record")}}',
                    Component: 'UpdateRecordActionInitializer',
                    useVisible () {
                        const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
                        return ('view' !== collection.template || (null == collection ? void 0 : collection.writableView)) && 'sql' !== collection.template;
                    }
                },
                {
                    name: 'customRequest',
                    title: '{{t("Custom request")}}',
                    Component: 'CustomRequestInitializer',
                    schema: {
                        'x-action': 'customize:table:request'
                    },
                    useVisible () {
                        const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
                        return ('view' !== collection.template || (null == collection ? void 0 : collection.writableView)) && 'sql' !== collection.template;
                    }
                }
            ]
        }
    ]
});
export { gridCardItemActionInitializers };
