import { observer, useForm } from '@formily/react'; import { action } from '@formily/reactive'; import { useActionContext, useAPIClient, useCollectionFieldFormValues, useCollectionManager, useCompile, useRequest, } from '@nocobase/client'; import { message, Select } from 'antd'; import omit from 'lodash/omit'; import React, { useContext, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { GraphCollectionContext } from './components/CollectionNodeProvder'; export const useValuesFromRecord = (options, data) => { const result = useRequest(() => Promise.resolve({ data }), { ...options, manual: true, }); const ctx = useActionContext(); useEffect(() => { if (ctx.visible) { result.run(); } }, [ctx.visible]); return result; }; export const SourceCollection = observer(() => { const { record } = useContext(GraphCollectionContext); const compile = useCompile(); return (