import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../application/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__ from "../../../application/schema-settings/SchemaSettings.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../../collection-manager/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__ from "../../../schema-component/antd/action/Action.Designer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_items_index_mjs__ from "../../../schema-items/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__ from "../../../schema-settings/SchemaSettings.mjs";
const associateActionSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__.SchemaSettings({
    name: 'actionSettings:associate',
    items: [
        {
            name: 'editButton',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.ButtonEditor,
            useComponentProps () {
                const { buttonEditorProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return buttonEditorProps;
            }
        },
        {
            name: 'openMode',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_items_index_mjs__.SchemaSettingOpenModeSchemaItems,
            componentProps: {
                openMode: true,
                openSize: true
            }
        },
        {
            name: 'enableChildCollections',
            Component: __WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__.SchemaSettingsEnableChildCollections,
            useComponentProps () {
                const { name } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
                return {
                    collectionName: name
                };
            },
            useVisible () {
                const { name } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
                const { getChildrenCollections } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
                const isChildCollectionAction = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>getChildrenCollections(name).length > 0, [
                    getChildrenCollections,
                    name
                ]);
                return isChildCollectionAction;
            }
        },
        {
            name: 'delete',
            sort: 100,
            Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.RemoveButton,
            useComponentProps () {
                const { removeButtonProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
                return removeButtonProps;
            }
        }
    ]
});
export { associateActionSettings };
