import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__ from "../../../application/schema-initializer/SchemaInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__ from "../../../filter-provider/utils.mjs";
const associationFilterInitializer = new __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__.SchemaInitializer({
    name: 'AssociationFilter.Initializer',
    style: {
        marginTop: 16
    },
    icon: 'SettingOutlined',
    title: '{{t("Configure fields")}}',
    items: [
        {
            name: 'associationFields',
            type: 'itemGroup',
            title: '{{t("Association fields")}}',
            useChildren () {
                const associatedFields = (0, __WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.useAssociatedFields)();
                const children = associatedFields.map((field)=>{
                    var _field_uiSchema, _field_uiSchema1;
                    return {
                        type: 'item',
                        name: field.key,
                        title: null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title,
                        Component: 'AssociationFilterDesignerDisplayField',
                        schema: {
                            name: field.name,
                            title: null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title,
                            type: 'void',
                            'x-toolbar': 'CollapseItemSchemaToolbar',
                            'x-settings': 'fieldSettings:FilterCollapseItem',
                            'x-component': 'AssociationFilter.Item',
                            'x-use-component-props': 'useAssociationFilterProps',
                            'x-component-props': {
                                fieldNames: {
                                    label: field.targetKey || 'id'
                                }
                            },
                            properties: {}
                        }
                    };
                });
                return children;
            }
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            name: 'delete',
            title: '{{t("Delete")}}',
            Component: 'AssociationFilterDesignerDelete'
        }
    ]
});
export { associationFilterInitializer };
