Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hy916 committed Apr 20, 2023
2 parents 7bb0605 + 2519bcd commit a0d0a98
Show file tree
Hide file tree
Showing 24 changed files with 269 additions and 66 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

- run: yarn install
- run: npm run build
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'

- name: 📦 @uiw/react-native-image-picker publish to NPM
- name: 📦 @uiw/react-native-image-picker publish to NPM
run: npm publish
working-directory: packages/react-native-image-picker
continue-on-error: true
Expand Down
14 changes: 7 additions & 7 deletions example/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/base",
"version": "3.2.3",
"version": "4.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand All @@ -10,16 +10,16 @@
"lint": "eslint ."
},
"dependencies": {
"@react-native-camera-roll/camera-roll": "5.3.1",
"@uiw/react-native": "4.0.1",
"@uiw/react-native-image-picker": "4.0.1",
"react": "18.0.0",
"react-native": "0.69.7",
"@uiw/react-native": "3.2.3",
"@uiw/react-native-image-picker": "3.2.3",
"react-native-svg": "13.0.0",
"react-native-gesture-handler": "2.8.0",
"react-native-root-siblings": "4.1.1",
"react-native-image-picker": "^5.3.1",
"react-native-image-viewing": "~0.2.2",
"@react-native-camera-roll/camera-roll": "5.3.1"
"react-native-root-siblings": "4.1.1",
"react-native-svg": "13.0.0"
},
"devDependencies": {
"@babel/core": "~7.20.7",
Expand All @@ -34,4 +34,4 @@
"jest": {
"preset": "react-native"
}
}
}
6 changes: 3 additions & 3 deletions example/examples/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ PODS:
- RNScreens (3.15.0):
- React-Core
- React-RCTImage
- RNSVG (12.1.1):
- React
- RNSVG (13.0.0):
- React-Core
- SocketRocket (0.6.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -587,7 +587,7 @@ SPEC CHECKSUMS:
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50
RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
RNSVG: 42a0c731b11179ebbd27a3eeeafa7201ebb476ff
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: 0b84a956f7393ef1f37f3bb213c516184e4a689d
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
Expand Down
16 changes: 8 additions & 8 deletions example/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "examples",
"version": "3.2.3",
"version": "4.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand All @@ -10,20 +10,20 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@react-native-camera-roll/camera-roll": "5.3.1",
"@react-native-community/masked-view": "~0.1.11",
"@react-navigation/native": "~6.0.11",
"@react-navigation/stack": "~6.2.2",
"@uiw/react-native": "3.2.3",
"@uiw/react-native": "4.0.1",
"@uiw/react-native-image-picker": "4.0.1",
"react": "18.0.0",
"react-native": "0.69.7",
"react-native-gesture-handler": "~2.5.0",
"react-native-safe-area-context": "~4.3.1",
"react-native-screens": "~3.15.0",
"react-native-svg": "13.0.0",
"react-native-image-picker": "^5.3.1",
"react-native-image-viewing": "~0.2.2",
"@uiw/react-native-image-picker": "3.2.3",
"@react-native-camera-roll/camera-roll": "5.3.1"
"react-native-safe-area-context": "~4.3.1",
"react-native-screens": "~3.15.0",
"react-native-svg": "13.0.0"
},
"devDependencies": {
"@babel/core": "~7.20.7",
Expand Down Expand Up @@ -53,4 +53,4 @@
"node"
]
}
}
}
43 changes: 43 additions & 0 deletions example/examples/src/routes/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,49 @@ const FormDemo = () => {
field: 'verificationCode',
name: '验证码倒计时',
},
{
type: 'tree',
field: 'tree',
name: '树形控件',
attr: {
options: [
{
label: '今天',
value: '01',
children: [
{
label: '上午',
value: '01-1',
children: [
{
label: '9点',
value: '01-1-1',
},
{
label: '10点',
value: '01-1-2',
},
{
label: '11点',
value: '01-1-3',
},
],
},
{
label: '下午',
value: '02-1',
children: [
{
label: '14点',
value: '02-1-1',
},
],
},
],
},
],
},
},
{
type: 'treeSelect',
field: 'treeSelect',
Expand Down
16 changes: 14 additions & 2 deletions example/examples/src/routes/Tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,24 @@ export default class TreeDemo extends React.Component<TreeViewProps> {
<Button onPress={() => this.setState({visible: true})}>打开</Button>
<Modal visible={this.state.visible} placement="bottom" onClosed={() => this.setState({visible: false})}>
<ScrollView style={{height: 500}}>
<Tree treeData={option} defaultExpandAll />
<Tree
treeData={option}
defaultExpandAll
onCheck={(value: any) => {
console.log('onCheck', value);
}}
/>
</ScrollView>
</Modal>
</Card>
<Card title="树形选择">
<Tree treeData={option} defaultExpandAll />
<Tree
treeData={option}
defaultExpandAll
onCheck={(value: any) => {
console.log('onCheck', value);
}}
/>
</Card>
</Body>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.2.3",
"version": "4.0.1",
"packages": ["example/*", "packages/*", "website"],
"npmClient": "yarn",
"npmClientArgs": ["--production", "--no-optional"],
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uiw/react-native",
"version": "3.2.3",
"version": "4.0.1",
"description": "UIW for React Native",
"homepage": "https://uiwjs.github.io/react-native-uiw/",
"main": "lib/index.js",
Expand Down Expand Up @@ -52,20 +52,20 @@
],
"dependencies": {
"@babel/runtime": "~7.20.7",
"@shopify/restyle": "~2.4.2",
"@types/color": "~3.0.3",
"@types/lodash": "~4.14.191",
"@types/react-native": "0.69.1",
"@uiw/icons": "2.5.3",
"@validator.tool/hook": "2.2.4",
"ahooks": "3.7.6",
"dayjs": "~1.11.7",
"color": "4.2.3",
"dayjs": "~1.11.7",
"lodash": "4.17.21",
"prop-types": "15.7.2",
"react-native-gesture-handler": "2.8.0",
"react-native-root-siblings": "4.1.1",
"react-native-svg": "13.0.0",
"@shopify/restyle": "~2.4.2"
"react-native-svg": "13.0.0"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand All @@ -79,4 +79,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}
11 changes: 6 additions & 5 deletions packages/core/src/DatePicker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ DatePicker
### 基础示例

```jsx
import { useState } from 'react'
import { Button } from '@uiw/react-native';
import React,{ useState } from 'react';
import { View,Text } from 'react-native';
import { DatePicker } from '@uiw/react-native';
import DatePicker from '@uiw/react-native/lib/DatePicker/date-picker';
function Demo() {
const [visible,setVisible] = useState(false)
const [formatDate,setFormatDate] = useState('')
Expand Down Expand Up @@ -63,9 +64,9 @@ DatePeriodInput
### 基础示例

```jsx
import { useState } from 'react'
import { View,Text } from 'react-native';
import { DatePeriodInput } from '@uiw/react-native';
import React,{ useState } from 'react';
import { View} from 'react-native';
import DatePeriodInput from '@uiw/react-native/lib/DatePicker/date-period-input';
function Demo() {
const [value,setValue] = useState(undefined)
return (
Expand Down
11 changes: 4 additions & 7 deletions packages/core/src/DatePicker/date-period-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const DatePeriodInput: FC<DatePeriodInputProps> = ({
<Icon name="date" size={16} color={theme.colors.primary_text || '#ccc'} />
<Text
color={disabled ? 'disabled' : 'text'}
style={{ ...theme.textVariants.p1, marginLeft: theme.spacing.x2 || 8 }}
style={[p1, { marginLeft: 8 }]} //...theme.textVariants.p1
>
{dates[0] ? dayjs(dates[0]).format(format) : placeholder[0]}
</Text>
Expand All @@ -103,8 +103,8 @@ const DatePeriodInput: FC<DatePeriodInputProps> = ({
</AnimatedTouchableIcon>
)}
</TouchableOpacity>
<View style={{ marginHorizontal: theme.spacing.x2 || 8 }}>
<Text color="text" style={{ ...(theme.textVariants.p1 || p1) }}>
<View style={{ marginHorizontal: 8 }}>
<Text color="text" style={p1}>
~
</Text>
</View>
Expand All @@ -126,10 +126,7 @@ const DatePeriodInput: FC<DatePeriodInputProps> = ({
>
<Flex style={{ alignItems: 'center' }}>
<Icon size={16} name="date" color={theme.colors.primary_text || '#ccc'} />
<Text
color={disabled ? 'disabled' : 'text'}
style={{ ...(theme.textVariants.p1 || p1), marginLeft: theme.spacing.x2 || 8 }}
>
<Text color={disabled ? 'disabled' : 'text'} style={[p1, { marginLeft: 8 }]}>
{dates[1] ? dayjs(dates[1]).format(format) : placeholder[1]}
</Text>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/DatePicker/date-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const DatePicker = forwardRef<DatePickerRef, DatePickerProps>((props, ref) => {
return (
<Modal visible={visible} onClosed={handleClose}>
<SafeAreaView>
<View style={{ padding: theme.spacing.x2 }}>
<View style={{ padding: 8 }}>
<Flex justify="between">
<Flex.Item>
<TouchableOpacity activeOpacity={0.5} onPress={handleClose}>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Form/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default FormDemo
| 参数 | 说明 | 类型 | 默认值 |
|------|------|-----|------|
| `field` | 字段名 | string | - |
| `type` | 字段类型(`input` \| `textArea` \| `slider` \| `rate` \| `radio` \| `search`\| `switch`\| `checkBox`\| `stepper`\| `picker`\| `treeSelect`\ | `datePicker`\ | `cardList`) | string | - |
| `type` | 字段类型(`input` \| `textArea` \| `slider` \| `rate` \| `radio` \| `search`\| `switch`\| `checkBox`\| `stepper`\| `picker`\| `treeSelect`\| `datePicker`\| `cardList`) | string | - |
| `name` | 标签名 | string | - |
| `validate` | 验证规则 | RulesOption['validate'] | - |
| `options` | 集合 | Array<{ label: string; value: KeyType }> | - |
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/Form/comps/datePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const FormDatePicker = ({
format = 'YYYY-MM-DD HH:mm:ss',
...attr
}: RnDatePickerProps) => {
console.log('format', format);
const [visible, setVisible] = useState(false);
const theme = useTheme<Theme>();
const style = createStyles({
Expand Down
Loading

0 comments on commit a0d0a98

Please sign in to comment.