mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 05:59:25 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
c5d7f19a2a
@ -24,12 +24,22 @@ import {
|
|||||||
useCollectionRecordData,
|
useCollectionRecordData,
|
||||||
SchemaComponentContext,
|
SchemaComponentContext,
|
||||||
} from '../../../';
|
} from '../../../';
|
||||||
|
import { Action } from '../action';
|
||||||
import { isVariable } from '../../../variables/utils/isVariable';
|
import { isVariable } from '../../../variables/utils/isVariable';
|
||||||
import { getInnermostKeyAndValue } from '../../common/utils/uitls';
|
import { getInnermostKeyAndValue } from '../../common/utils/uitls';
|
||||||
import { RemoteSelect, RemoteSelectProps } from '../remote-select';
|
import { RemoteSelect, RemoteSelectProps } from '../remote-select';
|
||||||
import useServiceOptions, { useAssociationFieldContext } from './hooks';
|
import useServiceOptions, { useAssociationFieldContext } from './hooks';
|
||||||
import { VariablePopupRecordProvider } from '../../../modules/variable/variablesProvider/VariablePopupRecordProvider';
|
import { VariablePopupRecordProvider } from '../../../modules/variable/variablesProvider/VariablePopupRecordProvider';
|
||||||
|
|
||||||
|
export const AssociationFieldAddNewer = (props) => {
|
||||||
|
const schemaComponentCtxValue = useContext(SchemaComponentContext);
|
||||||
|
return (
|
||||||
|
<SchemaComponentContext.Provider value={{ ...schemaComponentCtxValue, draggable: true }}>
|
||||||
|
<Action.Container {...props} />
|
||||||
|
</SchemaComponentContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
|
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
|
||||||
addMode?: 'quickAdd' | 'modalAdd';
|
addMode?: 'quickAdd' | 'modalAdd';
|
||||||
action?: string;
|
action?: string;
|
||||||
@ -141,6 +151,7 @@ const InternalAssociationSelect = observer(
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
console.log(fieldSchema);
|
||||||
return (
|
return (
|
||||||
<div key={fieldSchema.name}>
|
<div key={fieldSchema.name}>
|
||||||
<Space.Compact style={{ display: 'flex' }}>
|
<Space.Compact style={{ display: 'flex' }}>
|
||||||
|
@ -15,6 +15,7 @@ import { InternalPicker } from './InternalPicker';
|
|||||||
import { Nester } from './Nester';
|
import { Nester } from './Nester';
|
||||||
import { ReadPretty } from './ReadPretty';
|
import { ReadPretty } from './ReadPretty';
|
||||||
import { SubTable } from './SubTable';
|
import { SubTable } from './SubTable';
|
||||||
|
import { AssociationFieldAddNewer } from './AssociationSelect';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AssociationFieldMode,
|
AssociationFieldMode,
|
||||||
@ -26,7 +27,7 @@ export const AssociationField: any = connect(Editable, mapReadPretty(ReadPretty)
|
|||||||
|
|
||||||
AssociationField.SubTable = SubTable;
|
AssociationField.SubTable = SubTable;
|
||||||
AssociationField.Nester = Nester;
|
AssociationField.Nester = Nester;
|
||||||
AssociationField.AddNewer = Action.Container;
|
AssociationField.AddNewer = AssociationFieldAddNewer;
|
||||||
AssociationField.Selector = Action.Container;
|
AssociationField.Selector = Action.Container;
|
||||||
AssociationField.Viewer = Action.Container;
|
AssociationField.Viewer = Action.Container;
|
||||||
AssociationField.InternalSelect = InternalPicker;
|
AssociationField.InternalSelect = InternalPicker;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user