Browse Source

fix(button): button type definition

走鹃 3 years ago
parent
commit
1a6f3789a8

+ 2 - 2
packages/semi-foundation/button/constants.ts

@@ -4,7 +4,7 @@ const cssClasses = {
     PREFIX: `${BASE_CLASS_PREFIX}-button`,
     PREFIX: `${BASE_CLASS_PREFIX}-button`,
 };
 };
 
 
-const strings: Record<string, any> = {
+const strings = {
     sizes: ['default', 'small', 'large'],
     sizes: ['default', 'small', 'large'],
     iconPositions: ['left', 'right'],
     iconPositions: ['left', 'right'],
     htmlTypes: ['button', 'reset', 'submit'],
     htmlTypes: ['button', 'reset', 'submit'],
@@ -12,7 +12,7 @@ const strings: Record<string, any> = {
     themes: ['solid', 'borderless', 'light'],
     themes: ['solid', 'borderless', 'light'],
     DEFAULT_ICON_SIZE: 'default',
     DEFAULT_ICON_SIZE: 'default',
     DEFAULT_ICON_POSITION: 'left',
     DEFAULT_ICON_POSITION: 'left',
-};
+} as const;
 
 
 const numbers = {};
 const numbers = {};
 
 

+ 1 - 1
packages/semi-foundation/icons/constants.ts

@@ -8,7 +8,7 @@ const strings = {
     SIZE: ['extra-small', 'small', 'default', 'large', 'extra-large', 'custom'],
     SIZE: ['extra-small', 'small', 'default', 'large', 'extra-large', 'custom'],
     // use in svg xhref. No need to respond to the change of prefixCls, always constant
     // use in svg xhref. No need to respond to the change of prefixCls, always constant
     ICON_PREFIX: 'semi-icon-',
     ICON_PREFIX: 'semi-icon-',
-};
+} as const;
 
 
 const numbers = {};
 const numbers = {};
 
 

+ 1 - 1
packages/semi-ui/button/index.tsx

@@ -12,7 +12,7 @@ export { ButtonGroupProps } from './buttonGroup';
 export { SplitButtonGroupProps } from './splitButtonGroup';
 export { SplitButtonGroupProps } from './splitButtonGroup';
 
 
 // eslint-disable-next-line 
 // eslint-disable-next-line 
-export interface ButtonProps extends IconButtonProps, BaseButtonProps {} // TODO check
+export interface ButtonProps extends IconButtonProps {} // TODO check
 class Button extends React.PureComponent<ButtonProps> {
 class Button extends React.PureComponent<ButtonProps> {
     static propTypes = {
     static propTypes = {
         ...BaseButton.propTypes,
         ...BaseButton.propTypes,

+ 1 - 1
packages/semi-ui/iconButton/index.tsx

@@ -20,7 +20,7 @@ export interface IconButtonProps extends ButtonProps {
     iconSize?: IconSize;
     iconSize?: IconSize;
     iconStyle?: React.CSSProperties;
     iconStyle?: React.CSSProperties;
     loading?: boolean;
     loading?: boolean;
-    theme?: Theme;
+    // theme?: Theme;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     className?: string;
     className?: string;
     disabled?: boolean;
     disabled?: boolean;