Skip to content

Commit

Permalink
fix:(react-table)替换icon引用修改组件命名 (#900,#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
wj0990 authored Aug 6, 2022
1 parent 95f7edb commit d4e707a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 8 additions & 6 deletions packages/react-table/src/TableTr.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { useMemo, useState, useEffect } from 'react';
import Icon from '@uiw/react-icon';
import Table, { LocationWidth, TableColumns, TableProps } from './';
import { TableStyleCol, TableStyleColContent } from './style';
import './style/index.less';
// import Icon from '@uiw/react-icon';
import { MinusSquareO } from '@uiw/icons/lib/MinusSquareO';
import { PlusSquareO } from '@uiw/icons/lib/PlusSquareO';
import { LocationWidth, TableColumns, TableProps } from './';
import { TableStyleCol, TableStyleColContent, TableStyleDomIcon } from './style';
// import './style/index.less';
import { noop } from '@uiw/utils';
import { locationFixed } from './util';

Expand Down Expand Up @@ -52,8 +54,8 @@ export default function TableTr<T extends { [key: string]: any }>(props: TableTr
return (key: T[keyof T] | number, isOpacity: boolean) => {
const flag = expandIndex.includes(key);
return (
<Icon
type={flag ? 'minus-square-o' : 'plus-square-o'}
<TableStyleDomIcon
as={flag ? MinusSquareO : PlusSquareO}
style={{
marginRight: 10,
opacity: isOpacity ? 1 : 0,
Expand Down
6 changes: 5 additions & 1 deletion packages/react-table/src/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled, { css } from 'styled-components';
import { getThemeVariantValue, ThemeVariantValueOptions } from '@uiw/utils';
import { IconStyleBase, IconStyleBaseProps } from '@uiw/react-icon';

export interface TableStyleBaseProps
extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
Expand All @@ -11,6 +12,8 @@ export interface TableStyleWrapBaseProps extends TableStyleBaseProps {
};
}

export interface TableStyleDomIconProps extends IconStyleBaseProps {}

export interface TableStyleColProps extends TableStyleBaseProps {
params?: {
align?: 'left' | 'center' | 'right';
Expand Down Expand Up @@ -113,8 +116,9 @@ export const TableStyleWrap = styled.div<TableStyleWrapBaseProps>`
`;
TableStyleWrap.defaultProps = { defaultTheme: TableBaseDefaultTheme };

export const TableStyleDomIcon = styled(IconStyleBase)<TableStyleDomIconProps>``;
export const TableStyleTheadWrap = styled.thead``;
export const TableStyleTheadItem = styled.th``;
export const TheadItem = styled.th``;

// 单元格
export const TableStyleCol = styled.td<TableStyleColProps>`
Expand Down

0 comments on commit d4e707a

Please sign in to comment.