Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发布alpha版本 #84

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,30 @@ npm i --save @kne/react-form-antd

```jsx
const {Button} = antd;
const {Form, Select, Input, Group, GroupList, SubmitButton, DatePickerToday, Rate, Slider} = reactFormAntd;
const {default: Form, Select, Input, Group, GroupList, SubmitButton, DatePickerToday, Rate, Slider} = reactFormAntd;
const {useRef} = React;

const Example = () => {
const addButton = useRef();
return <Form>
return <Form debug>
<Select name="select" label="哈哈哈" options={[{label: 'sss', value: 1}]}/>
<Input name="name" label="名称" realtime rule="REQ LEN-0-4"/>
<Input.Password name="password" label="密码"/>
<Rate name="rate" label="评分"/>
<Slider name="slider" label="滑动条"/>
<br/>
<Group name="target">
<Input name="name" label="名称"/>
<Input name="des" label="描述"/>
</Group>
<Group name="target">
<Input name="name" label="名称"/>
<Input name="des" label="描述"/>
</Group>
<Input name="target[0].name" label="名称"/>
<Input name="target[0].des" label="描述"/>
<Input name="target[1].name" label="名称"/>
<Input name="target[1].des" label="描述"/>
<br/>
<div>
<Button onClick={() => {
addButton.current.onAdd();
}}>添加</Button>
</div>
<GroupList name="list" ref={addButton}>
{(key, {onRemove}) => {
{({onRemove}) => {
return <div>
<Button onClick={onRemove}>删除</Button>
<Input name="name" label="名称"/>
Expand All @@ -74,7 +70,7 @@ const Example = () => {
</Form>
};

render(<Example />);
render(<Example/>);

```

Expand Down
20 changes: 8 additions & 12 deletions doc/base.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
const {Button} = antd;
const {Form, Select, Input, Group, GroupList, SubmitButton, DatePickerToday, Rate, Slider} = reactFormAntd;
const {default: Form, Select, Input, Group, GroupList, SubmitButton, DatePickerToday, Rate, Slider} = reactFormAntd;
const {useRef} = React;

const Example = () => {
const addButton = useRef();
return <Form>
return <Form debug>
<Select name="select" label="哈哈哈" options={[{label: 'sss', value: 1}]}/>
<Input name="name" label="名称" realtime rule="REQ LEN-0-4"/>
<Input.Password name="password" label="密码"/>
<Rate name="rate" label="评分"/>
<Slider name="slider" label="滑动条"/>
<br/>
<Group name="target">
<Input name="name" label="名称"/>
<Input name="des" label="描述"/>
</Group>
<Group name="target">
<Input name="name" label="名称"/>
<Input name="des" label="描述"/>
</Group>
<Input name="target[0].name" label="名称"/>
<Input name="target[0].des" label="描述"/>
<Input name="target[1].name" label="名称"/>
<Input name="target[1].des" label="描述"/>
<br/>
<div>
<Button onClick={() => {
addButton.current.onAdd();
}}>添加</Button>
</div>
<GroupList name="list" ref={addButton}>
{(key, {onRemove}) => {
{({onRemove}) => {
return <div>
<Button onClick={onRemove}>删除</Button>
<Input name="name" label="名称"/>
Expand All @@ -39,4 +35,4 @@ const Example = () => {
</Form>
};

render(<Example />);
render(<Example/>);
52 changes: 19 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kne/react-form-antd",
"version": "3.1.5",
"version": "4.0.0-alpha.0",
"syntax": {
"esmodules": true
},
Expand All @@ -9,21 +9,22 @@
"module": "dist/index.modern.js",
"source": "src/index.js",
"scripts": {
"init": "husky && npm run init-example",
"start": "run-p start:lib start:md start:example",
"build": "run-s build:lib build:md build:example",
"init-example": "modules-dev-libs-init",
"create-fields": "node ./scripts/createIndex.mjs",
"start": "run-p start:lib start:example",
"build": "run-s create-fields build:lib build:example",
"build:md": "npx @kne/md-doc",
"start:md": "npx @kne/md-doc --watch",
"build:lib": "microbundle --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment",
"start:lib": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment",
"test": "run-s test:unit test:lint test:build",
"build:example": "cd example && npm run build",
"start:example": "cd example && npm run start",
"test:build": "run-s build",
"test:lint": "eslint .",
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
"build:example": "cd example && npm run build",
"start:example": "cd example && npm run start",
"deploy": "gh-pages -d example/build",
"prettier": "prettier --config .prettierrc --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'"
"prettier": "prettier --config .prettierrc --write '{src/**/*,index,prompts}.{js,jsx,ts,tsx,json,css,scss}'",
"lint-staged": "npx lint-staged"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,40 +56,25 @@
},
"homepage": "https://github.com/kne-union/react-form-antd#readme",
"peerDependencies": {
"@kne/react-fetch": "1.x",
"antd": ">=5.x",
"prop-types": ">=15.x",
"react": ">=16.x"
"react": ">=18.x"
},
"dependencies": {
"@ant-design/icons": "^4.2.1",
"@babel/runtime": "^7.10.3",
"@kne/react-form": "^2.1.16",
"@kne/react-form-helper": "^1.0.36",
"@kne/react-form": "3.1.0-alpha.5",
"@kne/react-form-helper": "3.0.0-alpha.0",
"@kne/use-control-value": "^0.1.1",
"@kne/use-event": "^0.1.3",
"@kne/with-layer": "^0.1.5",
"classnames": "^2.2.6",
"dayjs": "^1.11.7",
"lodash": "^4.17.15",
"react-avatar-editor": "^13.0.0"
"lodash": "^4.17.15"
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@kne/microbundle": "^0.15.4",
"@kne/modules-dev": "^2.0.3",
"@kne/react-fetch": "^0.1.12",
"antd": "^5.0.2",
"axios": "^0.21.4",
"@kne/microbundle": "^0.15.5",
"@kne/modules-dev": "^2.0.19",
"@kne/react-form": "^3.1.0-alpha.4",
"cross-env": "^7.0.3",
"fs-extra": "^9.0.1",
"gh-pages": "^3.2.3",
"glob": "^10.3.3",
"husky": "^7.0.2",
"sass": "1.75.0",
"husky": "^9.0.11",
"npm-run-all": "^4.1.5",
"pify": "^5.0.0",
"prettier": "^2.4.1",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
5 changes: 0 additions & 5 deletions src/assets/full.js

This file was deleted.

44 changes: 0 additions & 44 deletions src/assets/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,6 @@
}
}

.react-form-avatar {
.preview {
width: 85px;
height: 85px;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;

img {
max-width: 100%;
max-height: 100%;
}
}
}

.data_range_picker {
color: rgba(0, 0, 0, 0.85);
position: relative;
Expand All @@ -258,31 +242,3 @@
}
}
}

.svg_box {
display: flex;
align-items: center;
color: rgba(0, 0, 0, 0.5);
margin: 0 4px;

svg {
width: 16px;
height: 16px;
}
}

.react-form-avatar-btn {
cursor: pointer;
padding: 5px;
box-sizing: content-box;
border-radius: 2px;
&:hover {
background: #F8F8F8;
}
}

.react-form-avatar-tips {
margin-bottom: 14px;
color: #999;
font-size: 12px;
}
5 changes: 0 additions & 5 deletions src/assets/rotate.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/common/getPopupContainer.js

This file was deleted.

85 changes: 0 additions & 85 deletions src/common/withFetch.js

This file was deleted.

Loading