Browse Source

Merge branch 'js2css' into js2css-working

代强 3 years ago
parent
commit
b34f8a06bf

+ 1 - 1
packages/semi-foundation/tree/foundation.ts

@@ -300,7 +300,7 @@ export interface TreeAdapter extends DefaultAdapter<BasicTreeProps, BasicTreeInn
     updateInputValue: (value: string) => void;
     focusInput: () => void;
     updateState: (states: Partial<BasicTreeInnerData>) => void;
-    notifyExpand: (expandedKeys: Set<string>, { expanded: bool, node }: BasicExpandedOtherProps) => void;
+    notifyExpand: (expandedKeys: Set<string>, { expanded, node }: BasicExpandedOtherProps) => void;
     notifySelect: (selectKey: string, bool: boolean, node: BasicTreeNodeData) => void;
     notifyChange: (value: BasicValue) => void;
     notifySearch: (input: string) => void;

+ 1 - 0
packages/semi-ui/breadcrumb/item.tsx

@@ -89,6 +89,7 @@ export default class BreadcrumbItem extends BaseComponent<BreadcrumbItemProps, B
         const iconSize = compact ? 'small' : 'default';
         const className = `${clsPrefix}-item-icon`;
         if (React.isValidElement(iconType)) {
+            // @ts-ignore
             return React.cloneElement(iconType, { className, size: iconSize });
         }
         return iconType;

+ 1 - 0
packages/semi-ui/dropdown/index.tsx

@@ -242,6 +242,7 @@ class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
             >
                 {React.isValidElement(children) ?
                     React.cloneElement(children, {
+                        // @ts-ignore
                         className: classnames(get(children, 'props.className'), {
                             [`${prefixCls}-showing`]: popVisible,
                         }),

+ 1 - 3
packages/semi-ui/modal/Modal.tsx

@@ -15,9 +15,7 @@ import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } f
 import { Locale } from '../locale/interface';
 import useModal from './useModal';
 import { ButtonProps } from '../button/Button';
-import { MotionObject } from "@douyinfe/semi-foundation/utils/type";
-import CSSAnimation from "@douyinfe/semi-ui/_cssAnimation";
-import { SideSheetReactProps } from "@douyinfe/semi-ui/sideSheet";
+import CSSAnimation from "../_cssAnimation";
 
 export const destroyFns: any[] = [];
 export type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';

+ 1 - 14
packages/semi-ui/modal/confirm.tsx

@@ -36,22 +36,9 @@ export default function confirm<T>(props: ConfirmProps) {
         }
     };
 
-    const mergedMotion: Motion = typeof (props.motion) === 'undefined' || props.motion ? {
-        ...(props.motion as any),
-        didLeave: (...args: any) => {
-            const didLeave = get(props.motion, 'didLeave');
-
-            if (typeof didLeave === 'function') {
-                didLeave(...args);
-            }
-
-            destroy();
-        }
-
-    } : false;
 
     function render(renderProps: ConfirmProps) {
-        ReactDOM.render(<ConfirmModal {...renderProps} motion={mergedMotion}/>, div);
+        ReactDOM.render(<ConfirmModal {...renderProps} motion={props.motion}/>, div);
     }
 
     function close() {

+ 1 - 1
packages/semi-ui/notification/useNotification/index.tsx

@@ -5,7 +5,7 @@ import HookNotice from './HookNotice';
 import '@douyinfe/semi-foundation/notification/notification.scss';
 import getUuid from '@douyinfe/semi-foundation/utils/uuid';
 import { NoticeInstance, NoticePosition, NoticeProps } from '@douyinfe/semi-foundation/notification/notificationFoundation';
-import { NoticesInPosition } from '@douyinfe/semi-ui/notification/index';
+import { NoticesInPosition } from '../';
 // TODO: Automatic folding + unfolding function when there are more than N
 
 const defaultConfig = {

+ 1 - 1
packages/semi-ui/tabs/TabPane.tsx

@@ -6,7 +6,7 @@ import getDataAttr from '@douyinfe/semi-foundation/utils/getDataAttr';
 import TabsContext from './tabs-context';
 import {TabContextValue} from './interface';
 import {PlainTab, TabPaneProps} from './interface';
-import CSSAnimation from "@douyinfe/semi-ui/_cssAnimation";
+import CSSAnimation from "../_cssAnimation";
 
 class TabPane extends PureComponent<TabPaneProps> {
     static isTabPane = true;