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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"name": "super-antd", | ||
"description": "super-antd 是一个简单且数据驱动友好的 React 组件库。", | ||
"license": "MIT", | ||
"version": "0.0.1-alpha", | ||
"version": "0.1.0", | ||
"author": { | ||
"name": "dream2023", | ||
"email": "[email protected]" | ||
|
@@ -14,10 +14,13 @@ | |
"build": "father-build && node scripts/replaceDeclaration.js && webpack-cli", | ||
"release": "npm run build && npm publish", | ||
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix --format=pretty ./src && npm run lint:prettier", | ||
"lint:all": "yarn eslint --ext .js,.jsx,.ts,.tsx --format=pretty ./src ", | ||
"lint:prettier": "npm run prettier && git diff && prettier --version && prettier --check \"packages/**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto", | ||
"prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", | ||
"test": "umi-test --watch", | ||
"test:coverage": "umi-test --coverage", | ||
"spell-check:all": "cspell \"**/*.{txt,ts,tsx,js,json,md}\"", | ||
"ci": "yarn tsc && yarn lint:all && yarn spell-check:all && umi-test --all", | ||
"tsc": "tsc --noEmit", | ||
"update:deps": "yarn upgrade-interactive --latest" | ||
}, | ||
|
@@ -51,12 +54,13 @@ | |
"dist" | ||
], | ||
"gitHooks": { | ||
"pre-commit": "npm run tsc && lint-staged && npm run umi-test", | ||
"pre-commit": "npm run tsc && yarn umi-test --onlyChanged && lint-staged", | ||
"commit-msg": "node scripts/verifyCommit.js" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,less,md,json}": [ | ||
"prettier --write" | ||
"prettier --write", | ||
"cspell" | ||
], | ||
"*.ts?(x)": [ | ||
"prettier --parser=typescript --write" | ||
|
@@ -84,6 +88,8 @@ | |
"map-obj": "^4.2.1", | ||
"react-router-dom": "^5.2.0", | ||
"react-schema-render": "^0.0.5", | ||
"react-use": "^17.2.4", | ||
"rfdc": "^1.3.0", | ||
"tiny-warning": "^1.0.3" | ||
}, | ||
"browserslist": [ | ||
|
@@ -93,7 +99,7 @@ | |
"ie >= 11" | ||
], | ||
"devDependencies": { | ||
"@ant-design/pro-form": "^1.22.1", | ||
"@ant-design/pro-form": "^1.28.0", | ||
"@testing-library/jest-dom": "^5.11.9", | ||
"@testing-library/react": "^11.2.5", | ||
"@testing-library/react-hooks": "^5.1.0", | ||
|
@@ -107,6 +113,7 @@ | |
"axios": "^0.21.1", | ||
"babel-plugin-import": "^1.13.3", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
"cspell": "^5.6.0", | ||
"css-loader": "^5.2.4", | ||
"dumi": "^1.0.13", | ||
"father-build": "^1.19.4", | ||
|
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.