-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Pivot-Studio/featue-editor
线上ide组件
- Loading branch information
Showing
58 changed files
with
4,058 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const list = [] | ||
export const list = [{"h2":"基本用法","h3":[]},{"h2":"多文件模型","h3":[]}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { MultipleEditor } from 'pivot-design'; | ||
import React, { useState } from 'react'; | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<> | ||
<MultipleEditor style={{ marginTop: 24 }} /> | ||
</> | ||
); | ||
}; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const list = [{"h2":"基本用法","h3":[]},{"h2":"卡片样式","h3":[]}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Tabs } from 'pivot-design'; | ||
import React, { useState } from 'react'; | ||
|
||
const App: React.FC = () => { | ||
const items = [ | ||
{ | ||
key: '1', | ||
label: 'Tab 1', | ||
children: 'Content of Tab Pane 1', | ||
}, | ||
{ | ||
key: '2', | ||
label: 'Tab Second', | ||
children: 'Content of Tab Pane 2', | ||
}, | ||
{ | ||
key: '3', | ||
label: 'Tab 3', | ||
children: 'Content of Tab Pane 3', | ||
}, | ||
]; | ||
return ( | ||
<> | ||
<Tabs items={items} /> | ||
</> | ||
); | ||
}; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Tabs } from 'pivot-design'; | ||
import React, { useState } from 'react'; | ||
|
||
const App: React.FC = () => { | ||
const items = [ | ||
{ | ||
key: '1', | ||
label: 'Tab 1', | ||
children: 'Content of Tab Pane 1', | ||
}, | ||
{ | ||
key: '2', | ||
label: 'Tab Second', | ||
children: 'Content of Tab Pane 2', | ||
}, | ||
{ | ||
key: '3', | ||
label: 'Tab 3', | ||
children: 'Content of Tab Pane 3', | ||
}, | ||
]; | ||
return ( | ||
<> | ||
<Tabs items={items} type="card" /> | ||
</> | ||
); | ||
}; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Props from './props.mdx'; | ||
|
||
# Tabs | ||
|
||
## 基本用法 | ||
|
||
<CodeBlock id="基本示例"> | ||
<Base /> | ||
</CodeBlock> | ||
|
||
## 卡片样式 type = `'card'` | ||
|
||
<CodeBlock id="基本示例"> | ||
<CardType /> | ||
</CodeBlock> | ||
|
||
<Props /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { Tabs } from 'pivot-design'; | ||
import TabsMdx from '@/components/Tabs/index.mdx'; | ||
import CodeBlock from '@/components/_CodeBlock/codeBlock'; | ||
import { list } from '@/components/Input/.catalog'; | ||
import { renderCatalog } from '@/utils'; | ||
const TabsPage: React.FC = () => { | ||
return ( | ||
<> | ||
<TabsMdx components={{ Tabs, CodeBlock }} /> | ||
<div className="demo-component-catalogue">{renderCatalog(list)}</div> | ||
</> | ||
); | ||
}; | ||
export default TabsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
import { PivotDesignProps } from './'; | ||
export interface MultipleEditorProps extends PivotDesignProps { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { CSSProperties, ReactNode } from 'react'; | ||
import { PivotDesignProps } from './'; | ||
|
||
type UniqueId = string | number; | ||
|
||
export interface TabsItemProps { | ||
label: UniqueId; | ||
key: UniqueId; | ||
children?: ReactNode; | ||
[x: string]: any; | ||
} | ||
export interface TabsProps extends PivotDesignProps { | ||
/** | ||
* @version 1.0.0 | ||
* @description 自定义Tabs内容容器样式 | ||
*/ | ||
contentStyle?: CSSProperties; | ||
/** | ||
* @version 1.0.0 | ||
* @description 自定义渲染Tabs公共内容 | ||
*/ | ||
renderCommonContent?: (item: TabsItemProps) => ReactNode; | ||
/** | ||
* @version 1.0.0 | ||
* @description 标签页项最主要的数据,用于渲染标签页 | ||
* @default [] | ||
*/ | ||
items: TabsItemProps[]; | ||
/** | ||
* @version 1.0.0 | ||
* @description 标签种类样式 | ||
* @default "default" | ||
*/ | ||
type?: 'default' | 'card'; | ||
/** | ||
* @version 1.0.0 | ||
* @description 当前激活的标签页索引 | ||
* @default 0 | ||
*/ | ||
value?: UniqueId; | ||
/** | ||
* @version 1.0.0 | ||
* @description 标签页发生改变时触发的监听函数 | ||
* @default undefined | ||
*/ | ||
onChange?: (tab: UniqueId) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"printWidth": 120 | ||
"printWidth": 80 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
// 执行顺序由右往左,所以先处理ts,再处理jsx,最后再试一下babel转换为低版本语法 | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
// 设置兼容目标浏览器版本,这里可以不写,babel-loader会自动寻找上面配置好的文件.browserslistrc | ||
// "targets": { | ||
// "chrome": 35, | ||
// "ie": 9 | ||
// }, | ||
useBuiltIns: 'usage', // 根据配置的浏览器兼容,以及代码中使用到的api进行引入polyfill按需添加 | ||
corejs: 3, // 配置使用core-js低版本 | ||
}, | ||
], | ||
['@babel/preset-react', { runtime: 'automatic' }], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.