import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
const useCloseAction = ()=>{
    const { setVisible } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_client__.useActionContext)();
    const form = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useForm)();
    return {
        async run () {
            setVisible(false);
            form.submit((values)=>{
                console.log(values);
            });
        }
    };
};
const schema = {
    type: 'object',
    properties: {
        action1: {
            'x-component': 'Action',
            'x-component-props': {
                type: 'primary',
                popover: true,
                openMode: 'popover'
            },
            type: 'void',
            title: 'Open',
            properties: {
                popover: {
                    type: 'void',
                    'x-component': 'Action.Popover',
                    properties: {
                        hello: {
                            type: 'void',
                            'x-content': 'Hello'
                        }
                    }
                }
            }
        }
    }
};
const demo4_rslib_entry_ = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)(()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
        scope: {
            useCloseAction
        },
        components: {
            Form: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Form,
            Action: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Action,
            Input: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Input,
            FormItem: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.FormItem
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
            schema: schema
        })
    }));
export { demo4_rslib_entry_ as default };
