This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 完善文档 - 修复 options bug
- Loading branch information
Showing
86 changed files
with
910 additions
and
170 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Node CI | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: yarn | ||
- run: yarn ci |
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 |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
.env.local | ||
|
||
# ide | ||
/.vscode | ||
/.idea | ||
coverage | ||
.eslintcache | ||
|
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,4 @@ | ||
{ | ||
"editor.defaultFormatter": "vscode.typescript-language-features", | ||
"prettier.embeddedLanguageFormatting": "off" | ||
} |
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,26 @@ | ||
{ | ||
"version": "0.1", | ||
"language": "en", | ||
"words": [ | ||
"rfdc", | ||
"ahooks", | ||
"antd", | ||
"Btns", | ||
"btns", | ||
"ahooksjs", | ||
"hoverable", | ||
"typeof", | ||
"classname", | ||
"cnpm", | ||
"tyarn", | ||
"testid", | ||
"rerender", | ||
"dumi", | ||
"umijs", | ||
"globby", | ||
"gitee", | ||
"Codecov", | ||
"browserslist" | ||
], | ||
"ignorePaths": ["node_modules/**", "**/*.snap", "coverage/**", "src/.umi/**"] | ||
} |
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,49 @@ | ||
import React, { FC } from 'react'; | ||
import type { ComponentType } from 'react'; | ||
import type { ComponentDecoratorType, SchemaParserType } from 'react-schema-render'; | ||
|
||
/** | ||
* Error 的类型 | ||
* | ||
* 既支持 Error 对象,也支持 { message: 'xx', errors: {} } 用于表单回显 | ||
*/ | ||
export type ErrorData = Error & { message?: string; errors?: Record<string, any> }; | ||
|
||
export interface ISuperProviderProps { | ||
/** 组件默认属性 */ | ||
componentProps?: Record<string, Record<any, any>>; | ||
/** 分隔符 */ | ||
delimiters?: [string, string]; | ||
/** 自定义过滤器 */ | ||
filters?: Record<string, Function>; | ||
|
||
/** Axios 实例 */ | ||
axios?: (options: any) => Promise<any>; | ||
/** 自定义错误通知 */ | ||
errorNotify?: (msg?: string, error?: ErrorData, params?: any) => void; | ||
/** 自定义请求成功通知 */ | ||
successNotify?: (msg?: string, data?: any, params?: any) => void; | ||
|
||
/** | ||
* 组件映射列表,同 react-schema-render | ||
* | ||
* @see https://dream2023.gitee.io/react-schema-render/ | ||
*/ | ||
components?: Record<string, ComponentType<any>>; | ||
/** | ||
* 自定义装饰器 | ||
* | ||
* @see https://dream2023.gitee.io/react-schema-render/decorator | ||
*/ | ||
componentDecorator?: ComponentDecoratorType; | ||
/** | ||
* 自定义解析器 | ||
* | ||
* @see https://dream2023.gitee.io/react-schema-render/parser | ||
*/ | ||
parsers?: SchemaParserType[]; | ||
} | ||
|
||
const Demo: FC<ISuperProviderProps> = () => <>Demo!</>; | ||
|
||
export default Demo; |
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 type { FC } from 'react'; | ||
import React from 'react'; | ||
|
||
export interface ISchemaRenderProps { | ||
/** Schema 对象。可以为数组或者对象。 例如 { component: 'input', name: 'foo', label: 'bar' } */ | ||
schema?: Record<any, any> | Record<any, any>[]; | ||
} | ||
|
||
const Demo: FC<ISchemaRenderProps> = () => <>Demo!</>; | ||
|
||
export default Demo; |
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,16 @@ | ||
--- | ||
order: 1 | ||
group: | ||
path: /common | ||
title: 基础组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
order: 1 | ||
--- | ||
|
||
# SuperProvider 全局配置 | ||
|
||
SuperProvider 用法在指南 [全局配置](/guide/concept/config) 章节已有详细描述。 | ||
|
||
<API src="./__demos__/provider.tsx"></API> |
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,16 @@ | ||
--- | ||
order: 2 | ||
group: | ||
path: /common | ||
title: 基础组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
order: 1 | ||
--- | ||
|
||
# SuperRender 动态渲染 | ||
|
||
SuperRender 用法在指南 [数据驱动](/guide/concept/schema) 章节已有详细描述。 | ||
|
||
<API src="./__demos__/render.tsx"></API> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
order: 2 | ||
group: | ||
path: /form | ||
title: 表单 | ||
title: 表单组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
order: 1 | ||
group: | ||
path: /form | ||
title: 表单 | ||
title: 表单组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
order: 0 | ||
group: | ||
path: /form | ||
title: 表单 | ||
title: 表单组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
order: 2 | ||
group: | ||
path: /form | ||
title: 表单 | ||
title: 表单组件 | ||
nav: | ||
title: 组件 | ||
path: /components | ||
|
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ const App = () => { | |
|
||
// 组件默认属性 | ||
const componentProps = { | ||
numer: { | ||
number: { | ||
min: 0, | ||
}, | ||
}; | ||
|
File renamed without changes.
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
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,17 +1,11 @@ | ||
import { ProFormColorPicker } from '@ant-design/pro-form'; | ||
import type { ProFormItemProps } from '@ant-design/pro-form/lib/interface'; | ||
import type { InputNumberProps } from 'antd/lib/input-number'; | ||
import type { ProFormColorPickerProps } from '@ant-design/pro-form/lib/components/ColorPicker'; | ||
|
||
import type { CreateSuperFormItemProps } from '../createSuperFormItem'; | ||
import { createSuperFormItem } from '../createSuperFormItem'; | ||
|
||
type ProFormColorProps = ProFormItemProps<InputNumberProps> & { | ||
min?: InputNumberProps['min']; | ||
max?: InputNumberProps['max']; | ||
}; | ||
|
||
export type SuperColorProps = CreateSuperFormItemProps<ProFormColorProps>; | ||
export const SuperColor = createSuperFormItem<ProFormColorProps>(ProFormColorPicker); | ||
export type SuperColorProps = CreateSuperFormItemProps<ProFormColorPickerProps>; | ||
export const SuperColor = createSuperFormItem<ProFormColorPickerProps>(ProFormColorPicker); | ||
SuperColor.displayName = 'SuperColor'; | ||
|
||
export default SuperColor; |
Oops, something went wrong.