From 1d01287dc9ff63966d314b3b0ae9efd768dc1192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BC=9F=E8=B0=83=E8=B0=83?= Date: Thu, 30 Mar 2023 14:49:35 +0800 Subject: [PATCH 1/9] website: Update index.css --- website/src/index.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/src/index.css b/website/src/index.css index 5a6863d8c..30100bfbf 100644 --- a/website/src/index.css +++ b/website/src/index.css @@ -12,3 +12,7 @@ body { a { text-decoration: none; } + +ul li { + list-style: initial; +} From 3e36af00fc171dcc23306bf24872207b01973981 Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Tue, 18 Apr 2023 18:06:31 +0800 Subject: [PATCH 2/9] released v3.2.3 --- example/base/package.json | 6 +++--- example/examples/package.json | 6 +++--- lerna.json | 2 +- packages/core/package.json | 2 +- packages/core/src/Typography/Text.tsx | 2 +- packages/docs/package.json | 2 +- packages/react-native-image-picker/package.json | 2 +- website/package.json | 4 ++-- website/src/component/Preview/index.js | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/example/base/package.json b/example/base/package.json index 8ab20a254..b15ac02a6 100644 --- a/example/base/package.json +++ b/example/base/package.json @@ -1,6 +1,6 @@ { "name": "@example/base", - "version": "3.2.3", + "version": "4.0.0", "private": true, "scripts": { "android": "react-native run-android", @@ -12,8 +12,8 @@ "dependencies": { "react": "18.0.0", "react-native": "0.69.7", - "@uiw/react-native": "3.2.3", - "@uiw/react-native-image-picker": "3.2.3", + "@uiw/react-native": "4.0.0", + "@uiw/react-native-image-picker": "4.0.0", "react-native-svg": "13.0.0", "react-native-gesture-handler": "2.8.0", "react-native-root-siblings": "4.1.1", diff --git a/example/examples/package.json b/example/examples/package.json index ab9b6e2bc..9f9a7b04f 100644 --- a/example/examples/package.json +++ b/example/examples/package.json @@ -1,6 +1,6 @@ { "name": "examples", - "version": "3.2.3", + "version": "4.0.0", "private": true, "scripts": { "android": "react-native run-android", @@ -13,7 +13,7 @@ "@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.0", "react": "18.0.0", "react-native": "0.69.7", "react-native-gesture-handler": "~2.5.0", @@ -22,7 +22,7 @@ "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", + "@uiw/react-native-image-picker": "4.0.0", "@react-native-camera-roll/camera-roll": "5.3.1" }, "devDependencies": { diff --git a/lerna.json b/lerna.json index 868dd2c7a..379238f22 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "3.2.3", + "version": "4.0.0", "packages": ["example/*", "packages/*", "website"], "npmClient": "yarn", "npmClientArgs": ["--production", "--no-optional"], diff --git a/packages/core/package.json b/packages/core/package.json index 2fabfdc07..1bf952701 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native", - "version": "3.2.3", + "version": "4.0.0", "description": "UIW for React Native", "homepage": "https://uiwjs.github.io/react-native-uiw/", "main": "lib/index.js", diff --git a/packages/core/src/Typography/Text.tsx b/packages/core/src/Typography/Text.tsx index cf1ac3ee1..7d9736fd0 100644 --- a/packages/core/src/Typography/Text.tsx +++ b/packages/core/src/Typography/Text.tsx @@ -21,7 +21,7 @@ const Text = (props: BaseTextProps) => { return theme.colors; } return { - [color]: '#000', + [color]: '#ccc', }; }; diff --git a/packages/docs/package.json b/packages/docs/package.json index aed0c93ea..de94d211c 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native-doc", - "version": "3.2.3", + "version": "4.0.0", "license": "MIT", "homepage": "https://uiwjs.github.io/react-native-uiw/", "repository": { diff --git a/packages/react-native-image-picker/package.json b/packages/react-native-image-picker/package.json index 1e86bd966..ef164fd29 100644 --- a/packages/react-native-image-picker/package.json +++ b/packages/react-native-image-picker/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native-image-picker", - "version": "3.2.3", + "version": "4.0.0", "description": "基于 React Native 的上传图片组件", "homepage": "https://uiwjs.github.io/react-native-uiw/", "main": "lib/index.js", diff --git a/website/package.json b/website/package.json index 72558adcb..a220de10f 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "3.2.3", + "version": "4.0.0", "description": "Documentation site for React Native UIW.", "private": true, "scripts": { @@ -19,7 +19,7 @@ "@uiw/icons": "2.5.3", "@uiw/react-code-preview": "3.0.0", "@uiw/react-markdown-preview": "^4.1.6", - "@uiw/react-native": "3.2.3", + "@uiw/react-native": "4.0.0", "@uiw/react-native-template": "3.0.0", "@uiw/reset.css": "~1.0.6", "@validator.tool/hook": "2.2.4", diff --git a/website/src/component/Preview/index.js b/website/src/component/Preview/index.js index cc32182af..260db8d13 100644 --- a/website/src/component/Preview/index.js +++ b/website/src/component/Preview/index.js @@ -73,7 +73,7 @@ const Preview = ({ path, ...mdData }) => { - + {param.title || '示例'} From c9a2d81e796be52f05864f9c516e820082dddd86 Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Wed, 19 Apr 2023 08:43:10 +0800 Subject: [PATCH 3/9] released v4.0.1 --- example/base/package.json | 14 +++++++------- example/examples/package.json | 16 ++++++++-------- lerna.json | 2 +- packages/core/package.json | 10 +++++----- packages/docs/package.json | 2 +- .../react-native-image-picker/package.json | 18 +++++++++--------- website/package.json | 10 +++++----- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/example/base/package.json b/example/base/package.json index b15ac02a6..7732091a5 100644 --- a/example/base/package.json +++ b/example/base/package.json @@ -1,6 +1,6 @@ { "name": "@example/base", - "version": "4.0.0", + "version": "4.0.1", "private": true, "scripts": { "android": "react-native run-android", @@ -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": "4.0.0", - "@uiw/react-native-image-picker": "4.0.0", - "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", @@ -34,4 +34,4 @@ "jest": { "preset": "react-native" } -} \ No newline at end of file +} diff --git a/example/examples/package.json b/example/examples/package.json index 9f9a7b04f..14fc0f906 100644 --- a/example/examples/package.json +++ b/example/examples/package.json @@ -1,6 +1,6 @@ { "name": "examples", - "version": "4.0.0", + "version": "4.0.1", "private": true, "scripts": { "android": "react-native run-android", @@ -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": "4.0.0", + "@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": "4.0.0", - "@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", @@ -53,4 +53,4 @@ "node" ] } -} \ No newline at end of file +} diff --git a/lerna.json b/lerna.json index 379238f22..39d353298 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.0.0", + "version": "4.0.1", "packages": ["example/*", "packages/*", "website"], "npmClient": "yarn", "npmClientArgs": ["--production", "--no-optional"], diff --git a/packages/core/package.json b/packages/core/package.json index 1bf952701..9bb32601d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native", - "version": "4.0.0", + "version": "4.0.1", "description": "UIW for React Native", "homepage": "https://uiwjs.github.io/react-native-uiw/", "main": "lib/index.js", @@ -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", @@ -79,4 +79,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/packages/docs/package.json b/packages/docs/package.json index de94d211c..7a8d0f108 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native-doc", - "version": "4.0.0", + "version": "4.0.1", "license": "MIT", "homepage": "https://uiwjs.github.io/react-native-uiw/", "repository": { diff --git a/packages/react-native-image-picker/package.json b/packages/react-native-image-picker/package.json index ef164fd29..ca72800a0 100644 --- a/packages/react-native-image-picker/package.json +++ b/packages/react-native-image-picker/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-native-image-picker", - "version": "4.0.0", + "version": "4.0.1", "description": "基于 React Native 的上传图片组件", "homepage": "https://uiwjs.github.io/react-native-uiw/", "main": "lib/index.js", @@ -23,22 +23,22 @@ ], "dependencies": { "@babel/runtime": "~7.20.7", + "@react-native-camera-roll/camera-roll": "5.3.1", + "@shopify/restyle": "~2.4.2", "@types/react-native": "0.69.1", - "prop-types": "15.7.2", "@uiw/icons": "2.5.3", - "ahooks": "3.7.6", - "@shopify/restyle": "~2.4.2", "@uiw/react-native": "~3.2.3", - "react-native-svg": "13.0.0", + "ahooks": "3.7.6", + "prop-types": "15.7.2", "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-svg": "13.0.0" }, "peerDependencies": { "react": ">=16.9.0", "react-native": ">=0.60.0", - "react-native-svg": ">=9.9.3", - "react-native-image-picker": ">= 5.0.0" + "react-native-image-picker": ">= 5.0.0", + "react-native-svg": ">=9.9.3" }, "devDependencies": { "@babel/core": "~7.20.7", @@ -47,4 +47,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/website/package.json b/website/package.json index a220de10f..5fd832638 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "4.0.0", + "version": "4.0.1", "description": "Documentation site for React Native UIW.", "private": true, "scripts": { @@ -16,10 +16,11 @@ "@babel/plugin-syntax-jsx": "^7.18.6", "@babel/preset-react": "^7.18.6", "@babel/runtime": "~7.20.7", + "@shopify/restyle": "~2.4.2", "@uiw/icons": "2.5.3", "@uiw/react-code-preview": "3.0.0", "@uiw/react-markdown-preview": "^4.1.6", - "@uiw/react-native": "4.0.0", + "@uiw/react-native": "4.0.1", "@uiw/react-native-template": "3.0.0", "@uiw/reset.css": "~1.0.6", "@validator.tool/hook": "2.2.4", @@ -39,8 +40,7 @@ "react-router-dom": "6.2.1", "styled-components": "^5.3.6", "typescript": "^4.8.3", - "uiw": "4.21.25", - "@shopify/restyle": "~2.4.2" + "uiw": "4.21.25" }, "devDependencies": { "@babel/plugin-proposal-decorators": "~7.20.7", @@ -76,4 +76,4 @@ "last 1 safari version" ] } -} \ No newline at end of file +} From cb795a32c224761729a7f4dca4b0013159ad028c Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Wed, 19 Apr 2023 08:59:28 +0800 Subject: [PATCH 4/9] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dci=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40b39b955..649ea8520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,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 From f49ef3f93308d4aa7a2fd40e1d21cf73b18b3182 Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Wed, 19 Apr 2023 09:46:02 +0800 Subject: [PATCH 5/9] =?UTF-8?q?fix(Form):=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/Form/comps/datePicker.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/src/Form/comps/datePicker.tsx b/packages/core/src/Form/comps/datePicker.tsx index 9c2c96103..0f760be22 100644 --- a/packages/core/src/Form/comps/datePicker.tsx +++ b/packages/core/src/Form/comps/datePicker.tsx @@ -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(); const style = createStyles({ From c725c363e57b883ead3752ef86cb4701c40b2b58 Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Wed, 19 Apr 2023 13:27:49 +0800 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dci=20delay?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 649ea8520..8fcf201e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 From a598895c61d498ec08a9cb3f6b6c281e69dbf0b5 Mon Sep 17 00:00:00 2001 From: panbibi <1265629139@qq.com> Date: Wed, 19 Apr 2023 14:57:37 +0800 Subject: [PATCH 7/9] =?UTF-8?q?doc(DatePicker):=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=87=E6=A1=A3=E9=A2=84=E8=A7=88=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/examples/ios/Podfile.lock | 6 +++--- packages/core/src/DatePicker/README.md | 15 ++++++++------- .../src/DatePicker/date-period-input/index.tsx | 11 ++++------- .../core/src/DatePicker/date-picker/index.tsx | 2 +- packages/core/src/Form/README.md | 2 +- .../src/Picker/components/WheelPicker/index.tsx | 2 +- packages/core/src/Picker/index.tsx | 2 +- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/example/examples/ios/Podfile.lock b/example/examples/ios/Podfile.lock index c7fb9effe..4aa9a3709 100644 --- a/example/examples/ios/Podfile.lock +++ b/example/examples/ios/Podfile.lock @@ -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): @@ -587,7 +587,7 @@ SPEC CHECKSUMS: RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489 RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50 RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7 - RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f + RNSVG: 42a0c731b11179ebbd27a3eeeafa7201ebb476ff SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 Yoga: 0b84a956f7393ef1f37f3bb213c516184e4a689d YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/packages/core/src/DatePicker/README.md b/packages/core/src/DatePicker/README.md index c9f6f7650..4b805fd02 100644 --- a/packages/core/src/DatePicker/README.md +++ b/packages/core/src/DatePicker/README.md @@ -6,10 +6,11 @@ DatePicker ### 基础示例 -```jsx -import { useState } from 'react' +```jsx mdx:preview&background=#bebebe29 +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('') @@ -62,10 +63,10 @@ DatePeriodInput ### 基础示例 -```jsx -import { useState } from 'react' -import { View,Text } from 'react-native'; -import { DatePeriodInput } from '@uiw/react-native'; +```jsx mdx:preview&background=#bebebe29 +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 ( diff --git a/packages/core/src/DatePicker/date-period-input/index.tsx b/packages/core/src/DatePicker/date-period-input/index.tsx index b6872e809..cedae4a5a 100644 --- a/packages/core/src/DatePicker/date-period-input/index.tsx +++ b/packages/core/src/DatePicker/date-period-input/index.tsx @@ -88,7 +88,7 @@ const DatePeriodInput: FC = ({ {dates[0] ? dayjs(dates[0]).format(format) : placeholder[0]} @@ -103,8 +103,8 @@ const DatePeriodInput: FC = ({ )} - - + + ~ @@ -126,10 +126,7 @@ const DatePeriodInput: FC = ({ > - + {dates[1] ? dayjs(dates[1]).format(format) : placeholder[1]} diff --git a/packages/core/src/DatePicker/date-picker/index.tsx b/packages/core/src/DatePicker/date-picker/index.tsx index 6b7f097b0..a9896f572 100644 --- a/packages/core/src/DatePicker/date-picker/index.tsx +++ b/packages/core/src/DatePicker/date-picker/index.tsx @@ -67,7 +67,7 @@ const DatePicker = forwardRef((props, ref) => { return ( - + diff --git a/packages/core/src/Form/README.md b/packages/core/src/Form/README.md index e755eb94d..5cd18eaaf 100644 --- a/packages/core/src/Form/README.md +++ b/packages/core/src/Form/README.md @@ -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 }> | - | diff --git a/packages/core/src/Picker/components/WheelPicker/index.tsx b/packages/core/src/Picker/components/WheelPicker/index.tsx index c19b65bdc..d240864e7 100644 --- a/packages/core/src/Picker/components/WheelPicker/index.tsx +++ b/packages/core/src/Picker/components/WheelPicker/index.tsx @@ -78,7 +78,7 @@ export default function WheelPicker({ transform: [{ translateY: -itemHeight / 2 }], height: itemHeight, backgroundColor: indicatorBackgroundColor ?? theme.colors.gray100, - borderRadius: theme.borderRadii.x2 || 2, + borderRadius: 2, }, ]} /> diff --git a/packages/core/src/Picker/index.tsx b/packages/core/src/Picker/index.tsx index 79a94b339..7ead0b2ef 100644 --- a/packages/core/src/Picker/index.tsx +++ b/packages/core/src/Picker/index.tsx @@ -141,7 +141,7 @@ function Picker(props: ComPickerProps) { return ( - + From 6edd089704572a67dc7fd04b2c06e0deddf54fa9 Mon Sep 17 00:00:00 2001 From: WX <42308734@qq.com> Date: Wed, 19 Apr 2023 15:21:04 +0800 Subject: [PATCH 8/9] =?UTF-8?q?fix:=20@uiw/react-native-image-picker=20pac?= =?UTF-8?q?kage=20=E5=A2=9E=E5=8A=A0publishConfig=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-native-image-picker/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native-image-picker/package.json b/packages/react-native-image-picker/package.json index ca72800a0..fe9bd88c7 100644 --- a/packages/react-native-image-picker/package.json +++ b/packages/react-native-image-picker/package.json @@ -21,6 +21,9 @@ "src", "README.md" ], + "publishConfig":{ + "access": "public" + }, "dependencies": { "@babel/runtime": "~7.20.7", "@react-native-camera-roll/camera-roll": "5.3.1", From 644a5a0aeb62a298fde68ed6af5f93bcf2c97814 Mon Sep 17 00:00:00 2001 From: panbibi <1265629139@qq.com> Date: Thu, 20 Apr 2023 12:58:16 +0800 Subject: [PATCH 9/9] =?UTF-8?q?fix(Form):=20=E9=9B=86=E6=88=90tree?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/examples/src/routes/Form/index.tsx | 43 ++++++ example/examples/src/routes/Tree/index.tsx | 16 +- packages/core/src/DatePicker/README.md | 4 +- packages/core/src/Form/comps/tree.tsx | 142 ++++++++++++++++++ packages/core/src/Form/form.tsx | 2 + .../core/src/Tree/components/TreeNode.tsx | 9 +- 6 files changed, 207 insertions(+), 9 deletions(-) create mode 100644 packages/core/src/Form/comps/tree.tsx diff --git a/example/examples/src/routes/Form/index.tsx b/example/examples/src/routes/Form/index.tsx index 997d7bada..c732e6505 100644 --- a/example/examples/src/routes/Form/index.tsx +++ b/example/examples/src/routes/Form/index.tsx @@ -148,6 +148,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', diff --git a/example/examples/src/routes/Tree/index.tsx b/example/examples/src/routes/Tree/index.tsx index 1b9e90baf..9cb12a3dc 100644 --- a/example/examples/src/routes/Tree/index.tsx +++ b/example/examples/src/routes/Tree/index.tsx @@ -66,12 +66,24 @@ export default class TreeDemo extends React.Component { this.setState({visible: false})}> - + { + console.log('onCheck', value); + }} + /> - + { + console.log('onCheck', value); + }} + /> diff --git a/packages/core/src/DatePicker/README.md b/packages/core/src/DatePicker/README.md index 4b805fd02..fa7e33c0e 100644 --- a/packages/core/src/DatePicker/README.md +++ b/packages/core/src/DatePicker/README.md @@ -6,7 +6,7 @@ DatePicker ### 基础示例 -```jsx mdx:preview&background=#bebebe29 +```jsx import { Button } from '@uiw/react-native'; import React,{ useState } from 'react'; import { View,Text } from 'react-native'; @@ -63,7 +63,7 @@ DatePeriodInput ### 基础示例 -```jsx mdx:preview&background=#bebebe29 +```jsx import React,{ useState } from 'react'; import { View} from 'react-native'; import DatePeriodInput from '@uiw/react-native/lib/DatePicker/date-period-input'; diff --git a/packages/core/src/Form/comps/tree.tsx b/packages/core/src/Form/comps/tree.tsx new file mode 100644 index 000000000..2022005b9 --- /dev/null +++ b/packages/core/src/Form/comps/tree.tsx @@ -0,0 +1,142 @@ +import Tree from '../../Tree'; +import { KeyType } from '../types'; +import React, { useState } from 'react'; +import { Pressable, SafeAreaView, View, StyleSheet, ViewStyle, ScrollView } from 'react-native'; +import Ellipsis from '../../Ellipsis'; +import Modal from '../../Modal'; +import Icon from '../../Icon'; +import { Theme } from '../../theme'; +import { useTheme } from '@shopify/restyle'; + +interface FormTreeProps { + value?: any; + onChange?: (value: KeyType) => void; + options?: Array<{ label: string; value: KeyType }>; + disabled?: boolean; + placeholder?: string; + contentStyle?: ViewStyle; + extra?: JSX.Element; + showClear?: boolean; +} + +interface entity { + value: KeyType; + label: string; + children?: children[]; +} +interface children { + value: KeyType; + label: string; + children?: children[]; +} + +const FormTree = ({ + value, + onChange, + options = [], + // ...others, + disabled, + placeholder = '请选择', + contentStyle, + extra, + showClear, + ...attr +}: FormTreeProps) => { + const [visible, setVisible] = useState(false); + const theme = useTheme(); + const style = createStyles({ + disabled: theme.colors.disabled, + backgroundColor: theme.colors.mask, + title: theme.colors.primary_text, + }); + + function treeToArray(tree: any) { + var res: any = []; + for (const item of tree) { + const { children, ...i } = item; + if (children && children.length) { + res = res.concat(treeToArray(children)); + } + res.push(i); + } + return res; + } + let arrTools = treeToArray(options).filter((filItem: any) => + value?.some((somItem: any) => Object.is(filItem.value, somItem)), + ); + + const labelVal = arrTools.map((a: any) => { + return a.label; + }); + + const extraContent = React.useMemo(() => { + if (React.isValidElement(extra)) { + return extra; + } + if (value && showClear) { + return ( + onChange} style={{ paddingRight: 3 }} disabled={disabled}> + + + ); + } + return ; + }, [extra, value, showClear]); + return ( + + { + if (disabled) return; + setVisible(true); + }} + > + + + {(labelVal.length > 0 && labelVal) || placeholder} + + {extraContent} + + + setVisible(false)}> + + { + onChange?.(value); + }} + /> + + + + ); +}; + +export default FormTree; + +function createStyles({ backgroundColor = '#fff', disabled = '#f5f5f5', title = '#000' }) { + return StyleSheet.create({ + content: { + flexDirection: 'row', + height: 35, + alignItems: 'center', + justifyContent: 'space-between', + paddingRight: 5, + backgroundColor: backgroundColor, + paddingHorizontal: 16, + }, + disabled: { + flexDirection: 'row', + height: 35, + alignItems: 'center', + justifyContent: 'space-between', + paddingRight: 5, + backgroundColor: disabled, + paddingHorizontal: 16, + }, + contentTitle: { + fontSize: 16, + color: title, + }, + }); +} diff --git a/packages/core/src/Form/form.tsx b/packages/core/src/Form/form.tsx index a50089a51..308cf5594 100644 --- a/packages/core/src/Form/form.tsx +++ b/packages/core/src/Form/form.tsx @@ -17,6 +17,7 @@ import Switch from './comps/switch'; import CheckBox from './comps/checkBox'; import Picker from './comps/picker'; import DatePicker from './comps/datePicker'; +import Tree from './comps/tree'; const Form = (baseProps: FormProps) => { const { @@ -65,6 +66,7 @@ const Form = (baseProps: FormProps) => { datePicker: , datePeriodInput: , verificationCode: , + tree: , }, changeValidate: changeValidate, }; diff --git a/packages/core/src/Tree/components/TreeNode.tsx b/packages/core/src/Tree/components/TreeNode.tsx index e032ac372..b9f9ffb9a 100644 --- a/packages/core/src/Tree/components/TreeNode.tsx +++ b/packages/core/src/Tree/components/TreeNode.tsx @@ -29,11 +29,10 @@ const TreeNode: FC = (props) => { return customIcon(checked); } return ( - { - console.log(checked, 'checked'); - }} + ); };