"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__, {
    filterActionSettings: ()=>filterActionSettings
});
const schema_namespaceObject = require("@tachybase/schema");
const external_react_i18next_namespaceObject = require("react-i18next");
const SchemaSettings_js_namespaceObject = require("../../../application/schema-settings/SchemaSettings.js");
const Filter_Action_Designer_js_namespaceObject = require("../../../schema-component/antd/filter/Filter.Action.Designer.js");
const index_js_namespaceObject = require("../../../schema-component/hooks/index.js");
const filterActionSettings = new SchemaSettings_js_namespaceObject.SchemaSettings({
    name: 'actionSettings:filter',
    items: [
        {
            name: 'FilterableFields',
            Component: Filter_Action_Designer_js_namespaceObject.FilterableFieldsSchemaSettingsItem
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            name: 'EditButton',
            type: 'modal',
            useComponentProps () {
                var _fieldSchema_xcomponentprops;
                const field = (0, schema_namespaceObject.useField)();
                const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
                const { dn } = (0, index_js_namespaceObject.useDesignable)();
                const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
                return {
                    title: t('Edit button'),
                    schema: {
                        type: 'object',
                        title: t('Edit button'),
                        properties: {
                            title: {
                                'x-decorator': 'FormItem',
                                'x-component': 'Input',
                                title: t('Button title'),
                                default: fieldSchema.title,
                                'x-component-props': {}
                            },
                            icon: {
                                'x-decorator': 'FormItem',
                                'x-component': 'IconPicker',
                                title: t('Button icon'),
                                default: null == fieldSchema ? void 0 : null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops.icon,
                                'x-component-props': {}
                            }
                        }
                    },
                    onSubmit: (param)=>{
                        let { title, icon } = param;
                        fieldSchema.title = title;
                        field.title = title;
                        field.componentProps.icon = icon;
                        fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
                        fieldSchema['x-component-props'].icon = icon;
                        dn.emit('patch', {
                            schema: {
                                ['x-uid']: fieldSchema['x-uid'],
                                title,
                                'x-component-props': {
                                    ...fieldSchema['x-component-props']
                                }
                            }
                        });
                        dn.refresh();
                    }
                };
            }
        },
        {
            name: 'divider2',
            type: 'divider'
        },
        {
            name: 'delete',
            type: 'remove',
            componentProps: {
                removeParentsIfNoChildren: true,
                breakRemoveOn: (s)=>'Space' === s['x-component'] || 'ActionBar' === s['x-component']
            }
        }
    ]
});
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
});
