fix(client): fix mistaken changed api (#3598)
This commit is contained in:
		
							parent
							
								
									488616f7fe
								
							
						
					
					
						commit
						87ed436f8c
					
				@ -12,7 +12,7 @@ export type AppendsTreeSelectProps = {
 | 
				
			|||||||
  multiple?: boolean;
 | 
					  multiple?: boolean;
 | 
				
			||||||
  filter?(field): boolean;
 | 
					  filter?(field): boolean;
 | 
				
			||||||
  collection?: string;
 | 
					  collection?: string;
 | 
				
			||||||
  useCollection_deprecated?(props: Pick<AppendsTreeSelectProps, 'collection'>): string;
 | 
					  useCollection?(props: Pick<AppendsTreeSelectProps, 'collection'>): string;
 | 
				
			||||||
  rootOption?: {
 | 
					  rootOption?: {
 | 
				
			||||||
    label: string;
 | 
					    label: string;
 | 
				
			||||||
    value: string;
 | 
					    value: string;
 | 
				
			||||||
@ -78,7 +78,7 @@ export const AppendsTreeSelect: React.FC<TreeSelectProps & AppendsTreeSelectProp
 | 
				
			|||||||
    value: propsValue,
 | 
					    value: propsValue,
 | 
				
			||||||
    onChange,
 | 
					    onChange,
 | 
				
			||||||
    collection,
 | 
					    collection,
 | 
				
			||||||
    useCollection_deprecated = usePropsCollection,
 | 
					    useCollection = usePropsCollection,
 | 
				
			||||||
    filter = trueFilter,
 | 
					    filter = trueFilter,
 | 
				
			||||||
    rootOption,
 | 
					    rootOption,
 | 
				
			||||||
    loadData: propsLoadData,
 | 
					    loadData: propsLoadData,
 | 
				
			||||||
@ -88,7 +88,7 @@ export const AppendsTreeSelect: React.FC<TreeSelectProps & AppendsTreeSelectProp
 | 
				
			|||||||
  const compile = useCompile();
 | 
					  const compile = useCompile();
 | 
				
			||||||
  const { t } = useTranslation();
 | 
					  const { t } = useTranslation();
 | 
				
			||||||
  const [optionsMap, setOptionsMap] = useState({});
 | 
					  const [optionsMap, setOptionsMap] = useState({});
 | 
				
			||||||
  const baseCollection = useCollection_deprecated({ collection });
 | 
					  const baseCollection = useCollection({ collection });
 | 
				
			||||||
  const treeData = Object.values(optionsMap);
 | 
					  const treeData = Object.values(optionsMap);
 | 
				
			||||||
  const value: string | DefaultOptionType[] = useMemo(() => {
 | 
					  const value: string | DefaultOptionType[] = useMemo(() => {
 | 
				
			||||||
    if (props.multiple) {
 | 
					    if (props.multiple) {
 | 
				
			||||||
@ -99,7 +99,7 @@ export const AppendsTreeSelect: React.FC<TreeSelectProps & AppendsTreeSelectProp
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const loadData = useCallback(
 | 
					  const loadData = useCallback(
 | 
				
			||||||
    async (option) => {
 | 
					    async (option) => {
 | 
				
			||||||
      if (propsLoadData !== null) {
 | 
					      if (propsLoadData != null) {
 | 
				
			||||||
        return propsLoadData(option);
 | 
					        return propsLoadData(option);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (!option.isLeaf && option.loadChildren) {
 | 
					      if (!option.isLeaf && option.loadChildren) {
 | 
				
			||||||
 | 
				
			|||||||
@ -176,7 +176,7 @@ export class SnapshotFieldInterface extends CollectionFieldInterface {
 | 
				
			|||||||
      'x-component': 'AppendsTreeSelect',
 | 
					      'x-component': 'AppendsTreeSelect',
 | 
				
			||||||
      'x-component-props': {
 | 
					      'x-component-props': {
 | 
				
			||||||
        multiple: true,
 | 
					        multiple: true,
 | 
				
			||||||
        useCollection_deprecated: useRecordCollection,
 | 
					        useCollection: useRecordCollection,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      'x-reactions': [
 | 
					      'x-reactions': [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
				
			|||||||
@ -44,7 +44,7 @@ export default class extends Trigger {
 | 
				
			|||||||
      'x-component-props': {
 | 
					      'x-component-props': {
 | 
				
			||||||
        title: 'Preload associations',
 | 
					        title: 'Preload associations',
 | 
				
			||||||
        multiple: true,
 | 
					        multiple: true,
 | 
				
			||||||
        useCollection_deprecated() {
 | 
					        useCollection() {
 | 
				
			||||||
          const { values } = useForm();
 | 
					          const { values } = useForm();
 | 
				
			||||||
          return values?.collection;
 | 
					          return values?.collection;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
				
			|||||||
@ -174,7 +174,7 @@ export const appends = {
 | 
				
			|||||||
  'x-component-props': {
 | 
					  'x-component-props': {
 | 
				
			||||||
    title: 'Preload associations',
 | 
					    title: 'Preload associations',
 | 
				
			||||||
    multiple: true,
 | 
					    multiple: true,
 | 
				
			||||||
    useCollection_deprecated() {
 | 
					    useCollection() {
 | 
				
			||||||
      const { values } = useForm();
 | 
					      const { values } = useForm();
 | 
				
			||||||
      return values?.collection;
 | 
					      return values?.collection;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user