mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 12:47:44 +08:00
chore: add API comments (#3919)
* chore: add API comments * refactor: rename
This commit is contained in:
parent
0a64855bfe
commit
2f40bfab2b
@ -28,7 +28,7 @@ import {
|
||||
import { DataBlockCollector } from '../filter-provider/FilterProvider';
|
||||
import { RecordProvider, useRecordIndex } from '../record-provider';
|
||||
import { useAssociationNames } from './hooks';
|
||||
import { useDataBlockParentRecord } from './hooks/useDataBlockSourceId';
|
||||
import { useDataBlockParentRecord } from './hooks/useDataBlockParentRecord';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
@ -53,11 +53,21 @@ export const BlockRequestContext_deprecated = createContext<{
|
||||
}>({});
|
||||
BlockRequestContext_deprecated.displayName = 'BlockRequestContext_deprecated';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `useDataBlockResource` instead
|
||||
* @returns
|
||||
*/
|
||||
export const useBlockResource = () => {
|
||||
const resource = useDataBlockResource();
|
||||
return useContext(BlockResourceContext) || resource;
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param props
|
||||
* @returns
|
||||
*/
|
||||
export const MaybeCollectionProvider = (props) => {
|
||||
const { collection } = props;
|
||||
return collection ? (
|
||||
@ -71,6 +81,7 @@ export const MaybeCollectionProvider = (props) => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `DataBlockRequestProvider` instead
|
||||
* @param props
|
||||
* @returns
|
||||
*/
|
||||
@ -115,11 +126,17 @@ export const BlockRequestProvider_deprecated = (props) => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `useDataBlockRequest` instead
|
||||
*/
|
||||
export const useBlockRequestContext = () => {
|
||||
return useContext(BlockRequestContext_deprecated);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param props
|
||||
* @returns
|
||||
*/
|
||||
export const RenderChildrenWithAssociationFilter: React.FC<any> = (props) => {
|
||||
const fieldSchema = useFieldSchema();
|
||||
const { findComponent } = useDesignable();
|
||||
@ -176,12 +193,19 @@ export const RenderChildrenWithAssociationFilter: React.FC<any> = (props) => {
|
||||
return props.children;
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const BlockContext = createContext<{
|
||||
/** 用以区分区块的标识 */
|
||||
name: string;
|
||||
}>(null);
|
||||
BlockContext.displayName = 'BlockContext';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @returns
|
||||
*/
|
||||
export const useBlockContext = () => {
|
||||
return useContext(BlockContext);
|
||||
};
|
||||
@ -203,7 +227,8 @@ const useCompatDataBlockParentRecord = (props) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated use `DataBlockProvider` instead
|
||||
* @deprecated
|
||||
* use `DataBlockProvider` instead
|
||||
*/
|
||||
export const BlockProvider = (props: {
|
||||
name: string;
|
||||
@ -248,6 +273,11 @@ export const BlockProvider = (props: {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `useDataBlockProps` instead
|
||||
* @returns
|
||||
*/
|
||||
export const useBlockAssociationContext = () => {
|
||||
const { association } = useDataBlockProps();
|
||||
return useContext(BlockAssociationContext) || association;
|
||||
@ -276,8 +306,6 @@ export const useFilterByTk = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* 已弃用,应使用 useSourceIdFromParentRecord
|
||||
* @returns
|
||||
*/
|
||||
export const useSourceIdFromRecord = () => {
|
||||
const record = useRecord();
|
||||
@ -289,6 +317,10 @@ export const useSourceIdFromRecord = () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @returns
|
||||
*/
|
||||
export const useSourceIdFromParentRecord = () => {
|
||||
const cm = useCollectionManager();
|
||||
const parentRecordData = useCollectionParentRecordData();
|
||||
@ -303,6 +335,10 @@ export const useSourceIdFromParentRecord = () => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @returns
|
||||
*/
|
||||
export const useParamsFromRecord = () => {
|
||||
const filterByTk = useFilterByTk();
|
||||
const record = useRecord();
|
||||
|
@ -3,13 +3,16 @@ import { useField } from '@formily/react';
|
||||
import { Spin } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
import { useCollectionParentRecord } from '../data-source/collection-record/CollectionRecordProvider';
|
||||
import { RecordProvider } from '../record-provider';
|
||||
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
import { useParsedFilter } from './hooks';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
import { TemplateBlockProvider } from './TemplateBlockProvider';
|
||||
import { useParsedFilter } from './hooks';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const DetailsBlockContext = createContext<any>({});
|
||||
DetailsBlockContext.displayName = 'DetailsBlockContext';
|
||||
|
||||
@ -74,7 +77,7 @@ export const DetailsBlockProvider = withDynamicSchemaProps((props) => {
|
||||
});
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @internal
|
||||
*/
|
||||
export const useDetailsBlockContext = () => {
|
||||
return useContext(DetailsBlockContext);
|
||||
@ -82,7 +85,7 @@ export const useDetailsBlockContext = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* 即将废弃,请用 useDetailsWithPaginationProps 或者 useDetailsProps
|
||||
* use `useDetailsWithPaginationProps` or `useDetailsProps` instead
|
||||
* @returns
|
||||
*/
|
||||
export const useDetailsBlockProps = () => {
|
||||
|
@ -2,6 +2,7 @@ import { createForm } from '@formily/core';
|
||||
import { RecursionField, Schema, useField, useFieldSchema } from '@formily/react';
|
||||
import { Spin } from 'antd';
|
||||
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
import { useCollection_deprecated } from '../collection-manager';
|
||||
import { CollectionRecord, useCollectionParentRecordData, useCollectionRecord } from '../data-source';
|
||||
import { RecordProvider, useRecord } from '../record-provider';
|
||||
@ -10,7 +11,6 @@ import { Templates as DataTemplateSelect } from '../schema-component/antd/form-v
|
||||
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
import { TemplateBlockProvider } from './TemplateBlockProvider';
|
||||
import { FormActiveFieldsProvider } from './hooks/useFormActiveFields';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
|
||||
export const FormBlockContext = createContext<{
|
||||
form?: any;
|
||||
@ -76,6 +76,7 @@ const InternalFormBlockProvider = (props) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* 获取表单区块的类型:update 表示是表单编辑区块,create 表示是表单新增区块
|
||||
* @returns
|
||||
*/
|
||||
@ -128,10 +129,17 @@ export const FormBlockProvider = withDynamicSchemaProps((props) => {
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @returns
|
||||
*/
|
||||
export const useFormBlockContext = () => {
|
||||
return useContext(FormBlockContext);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useFormBlockProps = () => {
|
||||
const ctx = useFormBlockContext();
|
||||
const record = useRecord();
|
||||
@ -169,6 +177,9 @@ const RenderChildrenWithDataTemplates = ({ form }) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const findFormBlock = (schema: Schema) => {
|
||||
while (schema) {
|
||||
if (schema['x-decorator'] === 'FormBlockProvider') {
|
||||
|
@ -9,6 +9,9 @@ import { RecordProvider } from '../record-provider';
|
||||
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
import { useFormBlockContext } from './FormBlockProvider';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const FormFieldContext = createContext<any>({});
|
||||
FormFieldContext.displayName = 'FormFieldContext';
|
||||
|
||||
@ -75,9 +78,15 @@ const InternalFormFieldProvider = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const WithoutFormFieldResource = createContext(null);
|
||||
WithoutFormFieldResource.displayName = 'WithoutFormFieldResource';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const FormFieldProvider = (props) => {
|
||||
return (
|
||||
<WithoutFormFieldResource.Provider value={false}>
|
||||
@ -88,10 +97,16 @@ export const FormFieldProvider = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useFormFieldContext = () => {
|
||||
return useContext(FormFieldContext);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useFormFieldProps = () => {
|
||||
const ctx = useFormFieldContext();
|
||||
useEffect(() => {
|
||||
|
@ -1,15 +1,21 @@
|
||||
import { createForm } from '@formily/core';
|
||||
import { FormContext, useField, useFieldSchema } from '@formily/react';
|
||||
import React, { createContext, useCallback, useContext, useMemo, useState } from 'react';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
import { useCollectionManager_deprecated } from '../collection-manager';
|
||||
import { useTableBlockParams } from '../modules/blocks/data-blocks/table';
|
||||
import { FixedBlockWrapper, SchemaComponentOptions } from '../schema-component';
|
||||
import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
|
||||
import { useTableBlockParams } from '../modules/blocks/data-blocks/table';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TableBlockContext = createContext<any>({});
|
||||
TableBlockContext.displayName = 'TableBlockContext';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getIdsWithChildren(nodes) {
|
||||
const ids = [];
|
||||
if (nodes) {
|
||||
@ -79,6 +85,7 @@ const InternalTableBlockProvider = (props: Props) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* 用于兼容旧版本的 schema,当不需要兼容时可直接移除该方法
|
||||
* @param props
|
||||
* @returns
|
||||
@ -138,6 +145,9 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => {
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useTableBlockContext = () => {
|
||||
return useContext(TableBlockContext);
|
||||
};
|
||||
|
@ -6,6 +6,9 @@ import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
import { useFormBlockContext } from './FormBlockProvider';
|
||||
import { useFormFieldContext } from './FormFieldProvider';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TableFieldContext = createContext<any>({});
|
||||
TableFieldContext.displayName = 'TableFieldContext';
|
||||
|
||||
@ -122,9 +125,15 @@ export class TableFieldResource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const WithoutTableFieldResource = createContext(null);
|
||||
WithoutTableFieldResource.displayName = 'WithoutTableFieldResource';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TableFieldProvider = (props) => {
|
||||
return (
|
||||
<WithoutTableFieldResource.Provider value={false}>
|
||||
@ -135,10 +144,16 @@ export const TableFieldProvider = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useTableFieldContext = () => {
|
||||
return useContext(TableFieldContext);
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useTableFieldProps = () => {
|
||||
const field = useField<ArrayField>();
|
||||
const ctx = useTableFieldContext();
|
||||
|
@ -3,6 +3,7 @@ import { Schema, useField, useFieldSchema } from '@formily/react';
|
||||
import _ from 'lodash';
|
||||
import uniq from 'lodash/uniq';
|
||||
import React, { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
import { useCollectionManager_deprecated } from '../collection-manager';
|
||||
import { useCollectionParentRecordData } from '../data-source/collection-record/CollectionRecordProvider';
|
||||
import { isInFilterFormBlock } from '../filter-provider';
|
||||
@ -11,7 +12,6 @@ import { RecordProvider, useRecord } from '../record-provider';
|
||||
import { SchemaComponentOptions } from '../schema-component';
|
||||
import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
|
||||
import { useParsedFilter } from './hooks';
|
||||
import { withDynamicSchemaProps } from '../application/hoc/withDynamicSchemaProps';
|
||||
|
||||
type Params = {
|
||||
filter?: any;
|
||||
@ -20,6 +20,9 @@ type Params = {
|
||||
sort?: any;
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TableSelectorContext = createContext<any>({});
|
||||
TableSelectorContext.displayName = 'TableSelectorContext';
|
||||
const TableSelectorParamsContext = createContext<Params>({}); // 用于传递参数
|
||||
|
@ -7,6 +7,9 @@ const TemplateBlockContext = createContext<{
|
||||
}>({});
|
||||
TemplateBlockContext.displayName = 'TemplateBlockContext';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const useTemplateBlockContext = () => {
|
||||
return useContext(TemplateBlockContext);
|
||||
};
|
||||
|
@ -34,9 +34,9 @@ import { useBlockRequestContext, useFilterByTk, useParamsFromRecord } from '../B
|
||||
import { useDetailsBlockContext } from '../DetailsBlockProvider';
|
||||
import { TableFieldResource } from '../TableFieldProvider';
|
||||
|
||||
export * from './useDataBlockParentRecord';
|
||||
export * from './useFormActiveFields';
|
||||
export * from './useParsedFilter';
|
||||
export * from './useDataBlockSourceId';
|
||||
|
||||
export const usePickActionProps = () => {
|
||||
const form = useForm();
|
||||
|
@ -15,6 +15,7 @@ interface ProviderProps extends Partial<FormActiveFieldsProviderValue> {
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* 用于提供获取和更新当前表单区块中已显示出来的字段
|
||||
* @param param0
|
||||
* @returns
|
||||
|
@ -8,6 +8,11 @@ import { getPath } from '../../variables/utils/getPath';
|
||||
import { getVariableName } from '../../variables/utils/getVariableName';
|
||||
import { isVariable } from '../../variables/utils/isVariable';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param param0
|
||||
* @returns
|
||||
*/
|
||||
export function useParsedFilter({ filterOption }: { filterOption: any }) {
|
||||
const { parseFilter, findVariable } = useParseDataScopeFilter();
|
||||
const [filter, setFilter] = useState({});
|
||||
|
@ -3,6 +3,7 @@ import { gridRowColWrap } from '../../../schema-initializer/utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `createFormBlockInitializers` instead
|
||||
*/
|
||||
export const createFormBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'CreateFormBlockInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { gridRowColWrap } from '../../../schema-initializer/utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `customizeCreateFormBlockInitializers` instead
|
||||
*/
|
||||
export const customizeCreateFormBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'CusomeizeCreateFormBlockInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '../../../../application/schema-init
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `detailsActionInitializers` instead
|
||||
* 表单的操作配置
|
||||
*/
|
||||
export const detailsActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -8,6 +8,7 @@ const useVisibleCollection = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `readPrettyFormActionInitializers` instead
|
||||
* 表单的操作配置
|
||||
*/
|
||||
export const readPrettyFormActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CompatibleSchemaInitializer } from '../../../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import { SchemaInitializerChildren } from '../../../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
import { useCompile } from '../../../../schema-component';
|
||||
import {
|
||||
gridRowColWrap,
|
||||
@ -8,7 +9,6 @@ import {
|
||||
useFormItemInitializerFields,
|
||||
useInheritsFormItemInitializerFields,
|
||||
} from '../../../../schema-initializer/utils';
|
||||
import { SchemaInitializerChildren } from '../../../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
|
||||
const ParentCollectionFields = () => {
|
||||
const inheritFields = useInheritsFormItemInitializerFields();
|
||||
@ -47,7 +47,7 @@ const AssociatedFields = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* 已弃用,请使用 readPrettyFormItemInitializers 代替
|
||||
* use `readPrettyFormItemInitializers` instead
|
||||
*/
|
||||
export const readPrettyFormItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'ReadPrettyFormItemInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '../../../../application/schema-init
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `createFormActionInitializers` instead
|
||||
*/
|
||||
export const createFormActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'CreateFormActionInitializers',
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { gridRowColWrap, useFormItemInitializerFields } from '../../../../schema-initializer/utils';
|
||||
import { ParentCollectionFields, AssociatedFields } from '../../../../schema-initializer/buttons/FormItemInitializers';
|
||||
import { CompatibleSchemaInitializer } from '../../../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import { AssociatedFields, ParentCollectionFields } from '../../../../schema-initializer/buttons/FormItemInitializers';
|
||||
import { gridRowColWrap, useFormItemInitializerFields } from '../../../../schema-initializer/utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `formItemInitializers` instead
|
||||
* 表单里配置字段
|
||||
*/
|
||||
export const formItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '../../../../application/schema-init
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `updateFormActionInitializers` instead
|
||||
*/
|
||||
export const updateFormActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'UpdateFormActionInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { useCollection_deprecated } from '../../../../collection-manager';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `gridCardActionInitializers` instead
|
||||
*/
|
||||
export const gridCardActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'GridCardActionInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { useCollection_deprecated } from '../../../../collection-manager';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `gridCardItemActionInitializers` instead
|
||||
*/
|
||||
export const gridCardItemActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'GridCardItemActionInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { useCollection_deprecated } from '../../../../collection-manager';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `listActionInitializers` instead
|
||||
* 表单的操作配置
|
||||
*/
|
||||
export const listActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -3,6 +3,7 @@ import { useCollection_deprecated } from '../../../../collection-manager';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `listItemActionInitializers` instead
|
||||
*/
|
||||
export const listItemActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'ListItemActionInitializers',
|
||||
|
@ -247,6 +247,7 @@ const commonOptions = {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `tableActionColumnInitializers` instead
|
||||
*/
|
||||
export const tableActionColumnInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'TableActionColumnInitializers',
|
||||
|
@ -4,6 +4,7 @@ import { useCollection_deprecated } from '../../../../collection-manager/hooks/u
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `tableActionInitializers` instead
|
||||
* 表格操作配置
|
||||
*/
|
||||
export const tableActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CompatibleSchemaInitializer } from '../../../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import { SchemaInitializerChildren } from '../../../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
import { useCompile } from '../../../../schema-component';
|
||||
import {
|
||||
useAssociatedTableColumnInitializerFields,
|
||||
useInheritsTableColumnInitializerFields,
|
||||
useTableColumnInitializerFields,
|
||||
} from '../../../../schema-initializer/utils';
|
||||
import { SchemaInitializerChildren } from '../../../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
import { CompatibleSchemaInitializer } from '../../../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
|
||||
// 表格列配置
|
||||
const ParentCollectionFields = () => {
|
||||
@ -49,6 +49,7 @@ const AssociatedFields = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `tableColumnInitializers` instead
|
||||
*/
|
||||
export const tableColumnInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'TableColumnInitializers',
|
||||
|
@ -81,6 +81,7 @@ export const associationFilterFilterBlockInitializer = new SchemaInitializer({
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `filterCollapseItemInitializer` instead
|
||||
*/
|
||||
export const filterCollapseItemInitializer_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AssociationFilterInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '../../../../application/schema-init
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `filterFormActionInitializers` instead
|
||||
* 表单的操作配置
|
||||
*/
|
||||
export const filterFormActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -1,12 +1,13 @@
|
||||
import { gridRowColWrap, useFilterFormItemInitializerFields } from '../../../../schema-initializer/utils';
|
||||
import {
|
||||
FilterParentCollectionFields,
|
||||
FilterAssociatedFields,
|
||||
} from '../../../../schema-initializer/buttons/FormItemInitializers';
|
||||
import { CompatibleSchemaInitializer } from '../../../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import {
|
||||
FilterAssociatedFields,
|
||||
FilterParentCollectionFields,
|
||||
} from '../../../../schema-initializer/buttons/FormItemInitializers';
|
||||
import { gridRowColWrap, useFilterFormItemInitializerFields } from '../../../../schema-initializer/utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `filterFormItemInitializers` instead
|
||||
*/
|
||||
export const filterFormItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'FilterFormItemInitializers',
|
||||
|
@ -84,6 +84,7 @@ const commonOptions = {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `tableSelectorInitializers` instead
|
||||
*/
|
||||
export const tableSelectorInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'TableSelectorInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { gridRowColWrap } from '../../schema-initializer/utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `blockInitializers` instead
|
||||
*/
|
||||
export const blockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'BlockInitializers',
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CompatibleSchemaInitializer } from '../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import { SchemaInitializerChildren } from '../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
import { useCompile } from '../../schema-component';
|
||||
import { gridRowColWrap, useCustomFormItemInitializerFields, useInheritsFormItemInitializerFields } from '../utils';
|
||||
import { SchemaInitializerChildren } from '../../application/schema-initializer/components/SchemaInitializerChildren';
|
||||
import { CompatibleSchemaInitializer } from '../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
|
||||
// 表单里配置字段
|
||||
const ParentCollectionFields = () => {
|
||||
@ -26,6 +26,7 @@ const ParentCollectionFields = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `customFormItemInitializers` instead
|
||||
*/
|
||||
export const customFormItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'CustomFormItemInitializers',
|
||||
|
@ -13,8 +13,8 @@ import {
|
||||
useCreateEditFormBlock,
|
||||
} from '../..';
|
||||
import { CompatibleSchemaInitializer } from '../../application/schema-initializer/CompatibleSchemaInitializer';
|
||||
import { gridRowColWrap } from '../utils';
|
||||
import { useCreateSingleDetailsSchema } from '../../modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer';
|
||||
import { gridRowColWrap } from '../utils';
|
||||
|
||||
const recursiveParent = (schema: Schema) => {
|
||||
if (!schema) return null;
|
||||
@ -259,6 +259,7 @@ function useRecordBlocks() {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `recordBlockInitializers` instead
|
||||
*/
|
||||
export const recordBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'RecordBlockInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '../../application/schema-initialize
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `subTableActionInitializers` instead
|
||||
* 表格操作配置
|
||||
*/
|
||||
export const subTableActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -40,6 +40,7 @@ export const CreateFormBulkEditBlockInitializers: SchemaInitializer = new Schema
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `bulkEditBlockInitializers` instead
|
||||
*/
|
||||
export const BulkEditBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'BulkEditBlockInitializers',
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { CompatibleSchemaInitializer, SchemaInitializer } from '@nocobase/client';
|
||||
import { CompatibleSchemaInitializer } from '@nocobase/client';
|
||||
import { BulkEditSubmitActionInitializer } from './BulkEditSubmitActionInitializer';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `bulkEditFormActionInitializers` instead
|
||||
*/
|
||||
export const BulkEditFormActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'BulkEditFormActionInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { useCustomBulkEditFormItemInitializerFields } from './utils';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `bulkEditFormItemInitializers` instead
|
||||
*/
|
||||
export const BulkEditFormItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'BulkEditFormItemInitializers',
|
||||
|
@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `auditLogsTableActionColumnInitializers` instead
|
||||
*/
|
||||
export const auditLogsTableActionColumnInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AuditLogsTableActionColumnInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer } from '@nocobase/client';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `auditLogsTableActionInitializers` instead
|
||||
* 操作记录表格操作配置
|
||||
*/
|
||||
export const auditLogsTableActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -46,6 +46,7 @@ const AssociatedFields = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `auditLogsTableColumnInitializers` instead
|
||||
*/
|
||||
export const auditLogsTableColumnInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AuditLogsTableColumnInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { generateNTemplate } from '../../../locale';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `calendarActionInitializers` instead
|
||||
* 日历的操作配置
|
||||
*/
|
||||
export const CalendarActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -52,6 +52,7 @@ const ChartInitializer = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `chartInitializers` instead
|
||||
*/
|
||||
export const chartInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'ChartInitializers',
|
||||
|
@ -125,6 +125,7 @@ const ChartFilterCollapseInitializer = (props) => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `chartFilterActionInitializers` instead
|
||||
*/
|
||||
export const chartFilterActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'ChartFilterActionInitializers',
|
||||
|
@ -9,15 +9,14 @@ import {
|
||||
CollectionFieldProvider,
|
||||
CollectionManagerProvider,
|
||||
CollectionProvider,
|
||||
DEFAULT_DATA_SOURCE_KEY,
|
||||
CompatibleSchemaInitializer,
|
||||
DEFAULT_DATA_SOURCE_KEY,
|
||||
FormDialog,
|
||||
HTMLEncode,
|
||||
SchemaComponent,
|
||||
SchemaComponentOptions,
|
||||
SchemaInitializerItem,
|
||||
gridRowColWrap,
|
||||
useCollectionManager_deprecated,
|
||||
useDataSourceManager,
|
||||
useDesignable,
|
||||
useGlobalTheme,
|
||||
@ -311,6 +310,7 @@ const filterItemInitializers = {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `chartFilterItemInitializers` instead
|
||||
*/
|
||||
export const chartFilterItemInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
...filterItemInitializers,
|
||||
|
@ -3,6 +3,7 @@ import { CompatibleSchemaInitializer, useCollection_deprecated } from '@nocobase
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `ganttActionInitializers` instead
|
||||
*/
|
||||
export const GanttActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'GanttActionInitializers',
|
||||
|
@ -61,6 +61,7 @@ export const KanbanCardDesigner = () => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `kanbanCardInitializers` instead
|
||||
*/
|
||||
export const kanbanCardInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'KanbanCardInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer, useCollection_deprecated } from '@nocobase
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `kanbanActionInitializers` instead
|
||||
*/
|
||||
export const kanbanActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'KanbanActionInitializers',
|
||||
|
@ -2,6 +2,7 @@ import { CompatibleSchemaInitializer, useCollection_deprecated } from '@nocobase
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `mapActionInitializers` instead
|
||||
* 表格操作配置
|
||||
*/
|
||||
export const mapActionInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
|
@ -3,6 +3,7 @@ import { generateNTemplate } from '../../../locale';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `mBlockInitializers` instead
|
||||
*/
|
||||
export const mBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'MBlockInitializers',
|
||||
|
@ -3,6 +3,7 @@ import { NAMESPACE } from '../../locale';
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `snapshotBlockInitializers` instead
|
||||
*/
|
||||
export const snapshotBlockInitializers_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'SnapshotBlockInitializers',
|
||||
|
@ -17,14 +17,12 @@ import {
|
||||
SchemaComponentContext,
|
||||
SchemaInitializerItem,
|
||||
SchemaInitializerItemType,
|
||||
SchemaSettingsBlockTitleItem,
|
||||
SchemaSettingsDivider,
|
||||
SchemaSettingsItem,
|
||||
SchemaSettingsRemove,
|
||||
VariableScopeProvider,
|
||||
css,
|
||||
gridRowColWrap,
|
||||
useCompile,
|
||||
useDataSourceManager,
|
||||
useFormActiveFields,
|
||||
useFormBlockContext,
|
||||
@ -34,8 +32,8 @@ import {
|
||||
useSchemaOptionsContext,
|
||||
} from '@nocobase/client';
|
||||
import WorkflowPlugin, {
|
||||
JOB_STATUS,
|
||||
DetailsBlockProvider,
|
||||
JOB_STATUS,
|
||||
SimpleDesigner,
|
||||
useAvailableUpstreams,
|
||||
useFlowContext,
|
||||
@ -108,6 +106,7 @@ const blockTypeNames = {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `addBlockButton` instead
|
||||
*/
|
||||
export const addBlockButton_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AddBlockButton',
|
||||
@ -421,6 +420,7 @@ function ActionInitializer() {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `addActionButton` instead
|
||||
*/
|
||||
export const addActionButton_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AddActionButton',
|
||||
|
@ -340,6 +340,7 @@ const CustomItemsComponent = (props) => {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* use `addCustomFormField` instead
|
||||
*/
|
||||
export const addCustomFormField_deprecated = new CompatibleSchemaInitializer({
|
||||
name: 'AddCustomFormField',
|
||||
|
Loading…
Reference in New Issue
Block a user