Browse Source

chore: import type scrollIntoView name, #1713

pointhalo 2 years ago
parent
commit
7bda34eec8
2 changed files with 4 additions and 4 deletions
  1. 2 2
      packages/semi-foundation/form/interface.ts
  2. 2 2
      packages/semi-ui/form/interface.ts

+ 2 - 2
packages/semi-foundation/form/interface.ts

@@ -1,6 +1,6 @@
 /* eslint-disable @typescript-eslint/ban-types */
 import { DefaultAdapter } from '../base/foundation';
-import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
+import { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
 
 export type BasicTriggerType = 'blur' | 'change' | 'custom' | 'mount';
 
@@ -65,7 +65,7 @@ export interface BaseFormApi<T extends object = any> {
     getValues: () => T;
     /** set value of multiple fields */
     setValues: (fieldsValue: Partial<T>, config?: setValuesConfig) => void;
-    scrollToField: <K extends keyof T>(field: K, scrollConfig?: scrollIntoViewOptions) => void
+    scrollToField: <K extends keyof T>(field: K, scrollConfig?: ScrollIntoViewOptions) => void
 }
 
 export interface CallOpts {

+ 2 - 2
packages/semi-ui/form/interface.ts

@@ -1,7 +1,7 @@
 import * as React from 'react';
 import { Subtract } from 'utility-types';
 import type { RuleItem } from 'async-validator';
-import type { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
+import type { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
 
 import type { BaseFormApi as FormApi, FormState, WithFieldOption, AllErrors } from '@douyinfe/semi-foundation/form/interface';
 import type { SelectProps } from '../select/index';
@@ -123,7 +123,7 @@ export interface BaseFormProps <Values extends Record<string, any> = any> extend
     render?: (internalProps: FormFCChild) => React.ReactNode;
     component?: React.FC<any> | React.ComponentClass<any>;
     children?: React.ReactNode | ((internalProps: FormFCChild) => React.ReactNode);
-    autoScrollToError?: boolean | scrollIntoViewOptions;
+    autoScrollToError?: boolean | ScrollIntoViewOptions;
     disabled?: boolean;
     showValidateIcon?: boolean;
     extraTextPosition?: 'middle' | 'bottom'