"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    tableActionInitializers: ()=>tableActionInitializers
});
const schema_namespaceObject = require("@tachybase/schema");
const SchemaInitializer_js_namespaceObject = require("../../../../application/schema-initializer/SchemaInitializer.js");
const index_js_namespaceObject = require("../../../../data-source/index.js");
const tableActionInitializers = new SchemaInitializer_js_namespaceObject.SchemaInitializer({
    name: 'table:configureActions',
    title: "{{t('Configure actions')}}",
    icon: 'SettingOutlined',
    style: {
        marginLeft: 8
    },
    items: [
        {
            type: 'itemGroup',
            name: 'enableActions',
            title: "{{t('Enable actions')}}",
            children: [
                {
                    type: 'item',
                    name: 'filter',
                    title: "{{t('Filter')}}",
                    Component: 'FilterActionInitializer',
                    schema: {
                        'x-align': 'left'
                    }
                },
                {
                    type: 'item',
                    title: "{{t('Add new')}}",
                    name: 'addNew',
                    Component: 'CreateActionInitializer',
                    schema: {
                        'x-align': 'right',
                        'x-decorator': 'ACLActionProvider',
                        'x-acl-action-props': {
                            skipScopeCheck: true
                        }
                    },
                    useVisible () {
                        const collection = (0, index_js_namespaceObject.useCollection)();
                        return ![
                            'view',
                            'file',
                            'sql'
                        ].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
                    }
                },
                {
                    type: 'item',
                    title: "{{t('Delete')}}",
                    name: 'delete',
                    Component: 'BulkDestroyActionInitializer',
                    schema: {
                        'x-align': 'right',
                        'x-decorator': 'ACLActionProvider'
                    },
                    useVisible () {
                        const collection = (0, index_js_namespaceObject.useCollection)();
                        return ![
                            'view',
                            'sql'
                        ].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
                    }
                },
                {
                    type: 'item',
                    title: "{{t('Refresh')}}",
                    name: 'refresh',
                    Component: 'RefreshActionInitializer',
                    schema: {
                        'x-align': 'right'
                    }
                },
                {
                    name: 'toggle',
                    title: "{{t('Expand/Collapse')}}",
                    Component: 'ExpandableActionInitializer',
                    schema: {
                        'x-align': 'right'
                    },
                    useVisible () {
                        var _schema_parent;
                        const schema = (0, schema_namespaceObject.useFieldSchema)();
                        const collection = (0, index_js_namespaceObject.useCollection)();
                        const { treeTable } = (null == schema ? void 0 : null === (_schema_parent = schema.parent) || void 0 === _schema_parent ? void 0 : _schema_parent['x-decorator-props']) || {};
                        return collection.tree && false !== treeTable;
                    }
                }
            ]
        },
        {
            name: 'divider',
            type: 'divider',
            useVisible () {
                const collection = (0, index_js_namespaceObject.useCollection)();
                return ![
                    'view',
                    'sql'
                ].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
            }
        },
        {
            type: 'subMenu',
            name: 'customize',
            title: '{{t("Customize")}}',
            children: [
                {
                    type: 'item',
                    title: '{{t("Add record")}}',
                    name: 'addRecord',
                    Component: 'CustomizeAddRecordActionInitializer',
                    schema: {
                        'x-align': 'right',
                        'x-decorator': 'ACLActionProvider',
                        'x-acl-action': 'create',
                        'x-acl-action-props': {
                            skipScopeCheck: true
                        }
                    }
                }
            ],
            useVisible () {
                const collection = (0, index_js_namespaceObject.useCollection)();
                return ![
                    'view',
                    'sql'
                ].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
            }
        }
    ]
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
