瀏覽代碼

更新组件 storybook,关于 Ant Design 关键字的声明.

fengweiyao 4 年之前
父節點
當前提交
eca375566a

+ 1 - 1
packages/semi-ui/table/_story/ChildrenData/index.js

@@ -3,7 +3,7 @@ import { Table, Button } from '@douyinfe/semi-ui/';
 import {IconArrowUp, IconArrowDown} from '@douyinfe/semi-icons';
 
 /**
- * see [antd-demo](https://codesandbox.io/s/great-mcclintock-14fl7)
+ * Aligned to Ant Design API,便于迁移。see [antd-demo](https://codesandbox.io/s/great-mcclintock-14fl7)
  */
 const Demo = () => {
     const childrenRecordName = 'children';

+ 0 - 111
packages/semi-ui/transfer/_story/demo.jsx

@@ -1,111 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-import 'antd/dist/antd.css';
-import './index.css';
-import { Transfer, Tree } from 'antd';
-
-const { TreeNode } = Tree;
-
-// Customize Table Transfer
-const isChecked = (selectedKeys, eventKey) => {
-    return selectedKeys.indexOf(eventKey) !== -1;
-};
-
-const generateTree = (treeNodes = [], checkedKeys = []) => {
-    return treeNodes.map(({ children, ...props }) => (
-        <TreeNode {...props} disabled={checkedKeys.includes(props.key)} key={props.key}>
-            {generateTree(children, checkedKeys)}
-        </TreeNode>
-    ));
-};
-
-const TreeTransfer = ({ dataSource, targetKeys, ...restProps }) => {
-    const transferDataSource = [];
-    function flatten(list = []) {
-        list.forEach(item => {
-            transferDataSource.push(item);
-            flatten(item.children);
-        });
-    }
-    flatten(dataSource);
-
-    return (
-        <Transfer
-            {...restProps}
-            targetKeys={targetKeys}
-            dataSource={transferDataSource}
-            className="tree-transfer"
-            render={item => item.title}
-            showSelectAll={false}
-        >
-            {({ direction, onItemSelect, selectedKeys }) => {
-                if (direction === 'left') {
-                    const checkedKeys = [...selectedKeys, ...targetKeys];
-                    return (
-                        <Tree
-                            blockNode
-                            checkable
-                            checkStrictly
-                            defaultExpandAll
-                            checkedKeys={checkedKeys}
-                            onCheck={(
-                                _,
-                                {
-                                    node: {
-                                        props: { eventKey },
-                                    },
-                                },
-                            ) => {
-                                onItemSelect(eventKey, !isChecked(checkedKeys, eventKey));
-                            }}
-                            onSelect={(s,
-                                _,
-                                {
-                                    node: {
-                                        props: { eventKey },
-                                    },
-                                },
-                            ) => {
-                                onItemSelect(eventKey, !isChecked(checkedKeys, eventKey));
-                            }}
-                        >
-                            {generateTree(dataSource, targetKeys)}
-                        </Tree>
-                    );
-                }
-            }}
-        </Transfer>
-    );
-};
-
-const treeData = [
-    { key: '0-0', title: '0-0' },
-    {
-        key: '0-1',
-        title: '0-1',
-        children: [{ key: '0-1-0', title: '0-1-0' }, { key: '0-1-1', title: '0-1-1' }],
-    },
-    { key: '0-2', title: '0-3' },
-];
-
-class App extends React.Component {
-    state = {
-        targetKeys: [],
-    };
-
-    onChange = targetKeys => {
-        console.log('Target Keys:', targetKeys);
-        this.setState({ targetKeys });
-    };
-
-    render() {
-        const { targetKeys } = this.state;
-        return (
-            <div>
-                <TreeTransfer dataSource={treeData} targetKeys={targetKeys} onChange={this.onChange} />
-            </div>
-        );
-    }
-}
-
-ReactDOM.render(<App />, document.getElementById('container'));

+ 1 - 1
packages/semi-ui/typography/_story/typography.stories.tsx

@@ -127,7 +127,7 @@ stories.add('Ellipsis', () => (
         </Paragraph>
         <br />
         <Paragraph ellipsis={{rows: 3}} style={{width: 300}}>
-        Ant Design system-level color system also comes from the "natural" design language. Designers abstract the natural scenes through the capture, combined with the technical gene of Ant Financial, forming a unique 12 colors. Further through a large number of observations, to capture the different colors of natural light under the law of change, with the art of drawing ideas, the 12 colors were derived. The definition of neutral color palette is balanced with readability, aesthetics and usability.
+        Inspired by Ant Design Typography. 更多细节:https://bytedance.feishu.cn/docs/doccnqovjjyoKm2U5O13bj30aTh
         </Paragraph>
         <br />
         <Paragraph ellipsis={{rows: 3, expandable: true}} style={{width: 250}}>