|
|
@@ -8,7 +8,7 @@ import { Type, Size, ButtonProps } from './Button';
|
|
|
|
|
|
import '@douyinfe/semi-foundation/button/button.scss';
|
|
|
|
|
|
-export type Theme = 'solid' | 'borderless' | 'light';
|
|
|
+export type Theme = 'solid' | 'borderless' | 'light' | 'outline';
|
|
|
|
|
|
export interface ButtonGroupProps extends BaseProps {
|
|
|
disabled?: boolean;
|
|
|
@@ -42,14 +42,13 @@ export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
|
|
|
|
|
|
getInnerWithLine(inner) {
|
|
|
const innerWithLine: ReactNode[] = [];
|
|
|
- let lineCls = `${prefixCls}-group-line`;
|
|
|
if (inner.length > 1) {
|
|
|
inner.slice(0, -1).forEach((item, index) => {
|
|
|
const isButtonType = get(item, 'type.elementType') === 'Button';
|
|
|
const buttonProps = get(item, 'props') as ButtonProps;
|
|
|
- if (buttonProps) {
|
|
|
- const { type, theme, disabled } = buttonProps;
|
|
|
- lineCls = classNames(
|
|
|
+ const { type, theme, disabled } = buttonProps ?? {};
|
|
|
+ if (isButtonType && theme !== 'outline') {
|
|
|
+ const lineCls = classNames(
|
|
|
`${prefixCls}-group-line`,
|
|
|
`${prefixCls}-group-line-${theme ?? 'light'}`,
|
|
|
`${prefixCls}-group-line-${type ?? 'primary'}`,
|
|
|
@@ -57,8 +56,6 @@ export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
|
|
|
[`${prefixCls}-group-line-disabled`]: disabled,
|
|
|
}
|
|
|
);
|
|
|
- }
|
|
|
- if (isButtonType) {
|
|
|
innerWithLine.push(item, <span className={lineCls} key={`line-${index}`} />);
|
|
|
} else {
|
|
|
innerWithLine.push(item);
|