Skip to content

Commit

Permalink
feat: add formily-meet documents (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarK-AleX-alibaba authored Apr 17, 2020
1 parent ef10275 commit 03bbd0b
Show file tree
Hide file tree
Showing 8 changed files with 416 additions and 1,818 deletions.
23 changes: 11 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,33 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
---**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Please using Codesandbox

- [@formily/next bug report template](https://codesandbox.io/s/boring-dawn-tixps)
- [@formily/antd bug report template](https://codesandbox.io/s/lively-sky-pf5c3)


**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
---**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
Expand Down
4 changes: 2 additions & 2 deletions docs/zh-cn/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
- [next](../../packages/next/README.zh-cn.md)
- [next-components](../../packages/next-components/README.zh-cn.md)
- Rax Meet
- meet
- meet-components
- [meet](../../packages/meet/README.zh-cn.md)
- [meet-components](../../packages/meet-components/README.zh-cn.md)
- [GITHUB](https://github.com/alibaba/formily)
2 changes: 1 addition & 1 deletion packages/meet-components/README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ render(<App />, null, { driver: DriverUniversal })

- JSON Schema 方式

```jsx
```js
import { createElement, useState } from 'rax'
import { SchemaForm, SchemaMarkupField as Field } from '@formily/meet'
import { Upload } from '@formily/meet-components'
Expand Down
33 changes: 33 additions & 0 deletions packages/meet-components/src/radio-drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { connect } from '@formily/react-schema-renderer'
import MeetRadioDrawer from '@alife/meet-radio-drawer';
import { mapStyledProps, mapTextComponent } from '../shared'
import React, { useState, useMemo } from 'react';
import View from 'rax-view';

export const RadioDrawer =
connect({
getProps: mapStyledProps,
getComponent: mapTextComponent
})(({ value, onChange, data, ...props }) => {
const [visible, setVisible] = useState(false);
const onConfirm = (data) => {
setVisible(false);
onChange(data && data[0] && data[0].value);
}
const text = useMemo(() => {
const selected = data.find((item) => item.value === value) || {};
return selected.label || '请选择';
}, [visible, data]);

return visible ? (
<MeetRadioDrawer
visible={visible}
data={data}
onConfirm={onConfirm}
onCancel={() => setVisible(false)}
{...props} />
) : (
<View {...props} onClick={() => setVisible(true)}>{text}</View>
)
})

2 changes: 2 additions & 0 deletions packages/meet-components/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { NumberPicker } from './number-picker'
import { RadioGroup } from './radio'
import { Range } from './range'
import { Select } from './select'
// import { RadioDrawer } from './radio-drawer'

export const setup = () => {
registerFormFields({
Expand All @@ -18,5 +19,6 @@ export const setup = () => {
radio: RadioGroup,
range: Range,
select: Select
// radioDrawer: RadioDrawer
})
}
2 changes: 1 addition & 1 deletion packages/meet-components/src/select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect } from '@uform/react-schema-renderer'
import { connect } from '@formily/react-schema-renderer'
import { Select as MeetSelect } from '@alifd/meet';
import { mapStyledProps, mapTextComponent } from '../shared'

Expand Down
Loading

0 comments on commit 03bbd0b

Please sign in to comment.