From 12a9a2e916cc734089d97ebe0e82bcb0981aa40f Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 11 Nov 2024 14:58:13 +0800 Subject: [PATCH 1/7] chore: support icon demo --- packages/nutui-taro-demo/src/app.config.ts | 104 ++------------------- scripts/rn/update-taro-entry.js | 10 +- src/packages/progress/demo.taro.tsx | 8 +- src/packages/progress/demos/taro/demo4.tsx | 5 +- src/packages/progress/demos/taro/demo6.tsx | 21 ++--- src/packages/progress/progress.scss | 2 +- src/packages/progress/progress.taro.tsx | 3 +- 7 files changed, 32 insertions(+), 121 deletions(-) diff --git a/packages/nutui-taro-demo/src/app.config.ts b/packages/nutui-taro-demo/src/app.config.ts index 7357a2dbf7..181715e1c6 100644 --- a/packages/nutui-taro-demo/src/app.config.ts +++ b/packages/nutui-taro-demo/src/app.config.ts @@ -2,125 +2,37 @@ const subPackages = [ { "root": "base", - "pages": [ - "pages/button/index", - "pages/cell/index", - "pages/configprovider/index", - "pages/icon/index", - "pages/image/index", - "pages/overlay/index" - ] + "pages": [] }, { "root": "layout", - "pages": [ - "pages/divider/index", - "pages/grid/index", - "pages/layout/index", - "pages/safearea/index", - "pages/space/index", - "pages/sticky/index" - ] + "pages": [] }, { "root": "nav", - "pages": [ - "pages/backtop/index", - "pages/elevator/index", - "pages/fixednav/index", - "pages/hoverbutton/index", - "pages/navbar/index", - "pages/sidenavbar/index", - "pages/tabbar/index", - "pages/tabs/index" - ] + "pages": [] }, { "root": "dentry", - "pages": [ - "pages/address/index", - "pages/calendar/index", - "pages/calendarcard/index", - "pages/cascader/index", - "pages/checkbox/index", - "pages/datepicker/index", - "pages/form/index", - "pages/input/index", - "pages/inputnumber/index" - ] + "pages": [] }, { "root": "dataentry", - "pages": [ - "pages/menu/index", - "pages/numberkeyboard/index", - "pages/picker/index", - "pages/radio/index", - "pages/range/index", - "pages/rate/index", - "pages/searchbar/index", - "pages/shortpassword/index", - "pages/signature/index", - "pages/switch/index", - "pages/textarea/index", - "pages/uploader/index" - ] + "pages": [] }, { "root": "feedback", - "pages": [ - "pages/actionsheet/index", - "pages/badge/index", - "pages/dialog/index", - "pages/drag/index", - "pages/empty/index", - "pages/infiniteloading/index", - "pages/loading/index", - "pages/noticebar/index", - "pages/notify/index", - "pages/popover/index", - "pages/popup/index", - "pages/pulltorefresh/index", - "pages/resultpage/index", - "pages/skeleton/index", - "pages/swipe/index", - "pages/toast/index" - ] + "pages": [] }, { "root": "exhibition", "pages": [ - "pages/animate/index", - "pages/animatingnumbers/index", - "pages/avatar/index", - "pages/circleprogress/index", - "pages/collapse/index", - "pages/countdown/index", - "pages/ellipsis/index", - "pages/imagepreview/index", - "pages/indicator/index", - "pages/pagination/index", - "pages/price/index", - "pages/progress/index", - "pages/steps/index", - "pages/swiper/index", - "pages/table/index", - "pages/tag/index", - "pages/tour/index", - "pages/video/index", - "pages/virtuallist/index" + "pages/progress/index" ] }, { "root": "business", - "pages": [ - "pages/avatarcropper/index", - "pages/barrage/index", - "pages/card/index", - "pages/timeselect/index", - "pages/trendarrow/index", - "pages/watermark/index" - ] + "pages": [] } ]; diff --git a/scripts/rn/update-taro-entry.js b/scripts/rn/update-taro-entry.js index 51ade031b8..d5e868e55e 100644 --- a/scripts/rn/update-taro-entry.js +++ b/scripts/rn/update-taro-entry.js @@ -4,6 +4,13 @@ const fse = require('fs-extra') const path = require('path') const config = require('../../src/config.json') +const param = process.env.C + +// C=radio pnpm dev:taro:jdharmonycpp + +function specialComponent(name) { + return param && name.toLowerCase() == param.toLowerCase() +} // 已适配组件对象 const adaptedArray = [] @@ -11,6 +18,7 @@ config.nav.map((item) => { item.packages.forEach((element) => { const { name, version } = element if (version !== '3.0.0') return // 未适配不导出 + if (specialComponent(name)) return adaptedArray.push({ ...element, lowercaseName: element.name.toLowerCase(), @@ -42,7 +50,7 @@ const createConfig = async () => { } item.packages.map((it) => { - if (!(it.exportEmpty == false) && it.show && it.taro) { + if (!(it.exportEmpty == false) && it.show && it.taro && specialComponent(it.name)) { co.pages.push(`pages/${it.name.toLowerCase()}/index`) } }) diff --git a/src/packages/progress/demo.taro.tsx b/src/packages/progress/demo.taro.tsx index 05faffc8cf..a312bb199f 100644 --- a/src/packages/progress/demo.taro.tsx +++ b/src/packages/progress/demo.taro.tsx @@ -56,12 +56,8 @@ const ProgressDemo = () => { {translated.noShowPercentage} - {!harmonyAndRn() && ( - <> - {translated.customContent} - - - )} + {translated.customContent} + {translated.customSize} {translated.statusDisplay} diff --git a/src/packages/progress/demos/taro/demo4.tsx b/src/packages/progress/demos/taro/demo4.tsx index 24d6b7995d..9a3a1000b9 100644 --- a/src/packages/progress/demos/taro/demo4.tsx +++ b/src/packages/progress/demos/taro/demo4.tsx @@ -1,13 +1,14 @@ import React from 'react' import { Progress, Image, Cell } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo4 = () => { return ( diff --git a/src/packages/progress/demos/taro/demo6.tsx b/src/packages/progress/demos/taro/demo6.tsx index 60ac132b88..ad91a1ac02 100644 --- a/src/packages/progress/demos/taro/demo6.tsx +++ b/src/packages/progress/demos/taro/demo6.tsx @@ -2,8 +2,14 @@ import React from 'react' import { Progress, Cell } from '@nutui/nutui-react-taro' import { Checked, Tips } from '@nutui/icons-react-taro' import { harmonyAndRn } from '@/utils/platform-taro' +import pxTransform from '@/utils/px-transform' const Demo6 = () => { + const iconStyle = { + marginTop: 0, + marginLeft: pxTransform(5), + marginRight: pxTransform(5), + } return ( <> @@ -19,22 +25,11 @@ const Demo6 = () => { - {!harmonyAndRn() && ( - - )} + - {!harmonyAndRn() && ( - - )} + ) diff --git a/src/packages/progress/progress.scss b/src/packages/progress/progress.scss index b7d865ad3a..acb3cbc779 100644 --- a/src/packages/progress/progress.scss +++ b/src/packages/progress/progress.scss @@ -39,7 +39,7 @@ top: $progress-text-position-top; bottom: $progress-text-position-bottom; transition: all 0.4s; - // transform: translate(-50%); + transform: translate(-50%); &-inner { display: flex; diff --git a/src/packages/progress/progress.taro.tsx b/src/packages/progress/progress.taro.tsx index b67949ab25..c13bf51692 100644 --- a/src/packages/progress/progress.taro.tsx +++ b/src/packages/progress/progress.taro.tsx @@ -160,8 +160,7 @@ export const Progress: FunctionComponent< } }, []) const getTextStyle = () => { - const value = harmony() ? '93%' : '99%' - return rtl ? { right: value } : { left: value } + return rtl ? { right: '100%' } : { left: '100%' } } const computeRight = () => { if (children) { From f5b0e93384a8ce360c04edd823b7c16fce22db63 Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 11 Nov 2024 15:02:43 +0800 Subject: [PATCH 2/7] chore: support icon demo --- packages/nutui-taro-demo/src/app.config.ts | 134 +++++++++++++++++---- scripts/rn/update-taro-entry.js | 10 +- 2 files changed, 109 insertions(+), 35 deletions(-) diff --git a/packages/nutui-taro-demo/src/app.config.ts b/packages/nutui-taro-demo/src/app.config.ts index 181715e1c6..06b2236af0 100644 --- a/packages/nutui-taro-demo/src/app.config.ts +++ b/packages/nutui-taro-demo/src/app.config.ts @@ -1,40 +1,125 @@ - const subPackages = [ { - "root": "base", - "pages": [] + root: 'base', + pages: [ + 'pages/button/index', + 'pages/cell/index', + 'pages/configprovider/index', + 'pages/icon/index', + 'pages/image/index', + 'pages/overlay/index', + ], }, { - "root": "layout", - "pages": [] + root: 'layout', + pages: [ + 'pages/divider/index', + 'pages/grid/index', + 'pages/layout/index', + 'pages/safearea/index', + 'pages/space/index', + 'pages/sticky/index', + ], }, { - "root": "nav", - "pages": [] + root: 'nav', + pages: [ + 'pages/backtop/index', + 'pages/elevator/index', + 'pages/fixednav/index', + 'pages/navbar/index', + 'pages/sidenavbar/index', + 'pages/tabbar/index', + 'pages/tabs/index', + ], }, { - "root": "dentry", - "pages": [] + root: 'dentry', + pages: [ + 'pages/address/index', + 'pages/calendar/index', + 'pages/calendarcard/index', + 'pages/cascader/index', + 'pages/checkbox/index', + 'pages/datepicker/index', + 'pages/form/index', + 'pages/input/index', + 'pages/inputnumber/index', + ], }, { - "root": "dataentry", - "pages": [] + root: 'dentry1', + pages: [ + 'pages/menu/index', + 'pages/numberkeyboard/index', + 'pages/picker/index', + 'pages/radio/index', + 'pages/range/index', + 'pages/rate/index', + 'pages/searchbar/index', + 'pages/shortpassword/index', + 'pages/signature/index', + 'pages/switch/index', + 'pages/textarea/index', + 'pages/uploader/index', + ], }, { - "root": "feedback", - "pages": [] + root: 'feedback', + pages: [ + 'pages/actionsheet/index', + 'pages/badge/index', + 'pages/dialog/index', + 'pages/drag/index', + 'pages/empty/index', + 'pages/infiniteloading/index', + 'pages/loading/index', + 'pages/noticebar/index', + 'pages/notify/index', + 'pages/popover/index', + 'pages/popup/index', + 'pages/pulltorefresh/index', + 'pages/skeleton/index', + 'pages/swipe/index', + 'pages/toast/index', + ], }, { - "root": "exhibition", - "pages": [ - "pages/progress/index" - ] + root: 'exhibition', + pages: [ + 'pages/animate/index', + 'pages/animatingnumbers/index', + 'pages/avatar/index', + 'pages/circleprogress/index', + 'pages/collapse/index', + 'pages/countdown/index', + 'pages/ellipsis/index', + 'pages/imagepreview/index', + 'pages/indicator/index', + 'pages/pagination/index', + 'pages/price/index', + 'pages/progress/index', + 'pages/steps/index', + 'pages/swiper/index', + 'pages/table/index', + 'pages/tag/index', + 'pages/tour/index', + 'pages/video/index', + 'pages/virtuallist/index', + ], }, { - "root": "business", - "pages": [] - } -]; + root: 'business', + pages: [ + 'pages/avatarcropper/index', + 'pages/barrage/index', + 'pages/card/index', + 'pages/timeselect/index', + 'pages/trendarrow/index', + 'pages/watermark/index', + ], + }, +] export default defineAppConfig({ pages: ['pages/index/index'], @@ -43,9 +128,6 @@ export default defineAppConfig({ backgroundTextStyle: 'light', navigationBarBackgroundColor: '#fff', navigationBarTitleText: 'NutUI-React', - navigationBarTextStyle: 'black' + navigationBarTextStyle: 'black', }, - components: ['pages/index/index', ...(subPackages.map(subPackage => { - return subPackage.pages.map(page => `${subPackage.root}/${page}`) - }).flat())] -}) \ No newline at end of file +}) diff --git a/scripts/rn/update-taro-entry.js b/scripts/rn/update-taro-entry.js index d5e868e55e..51ade031b8 100644 --- a/scripts/rn/update-taro-entry.js +++ b/scripts/rn/update-taro-entry.js @@ -4,13 +4,6 @@ const fse = require('fs-extra') const path = require('path') const config = require('../../src/config.json') -const param = process.env.C - -// C=radio pnpm dev:taro:jdharmonycpp - -function specialComponent(name) { - return param && name.toLowerCase() == param.toLowerCase() -} // 已适配组件对象 const adaptedArray = [] @@ -18,7 +11,6 @@ config.nav.map((item) => { item.packages.forEach((element) => { const { name, version } = element if (version !== '3.0.0') return // 未适配不导出 - if (specialComponent(name)) return adaptedArray.push({ ...element, lowercaseName: element.name.toLowerCase(), @@ -50,7 +42,7 @@ const createConfig = async () => { } item.packages.map((it) => { - if (!(it.exportEmpty == false) && it.show && it.taro && specialComponent(it.name)) { + if (!(it.exportEmpty == false) && it.show && it.taro) { co.pages.push(`pages/${it.name.toLowerCase()}/index`) } }) From 2e1b8784199cd173320a1def5c0acfec7e9e45a9 Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 11 Nov 2024 15:04:55 +0800 Subject: [PATCH 3/7] chore: support icon demo --- packages/nutui-taro-demo/src/app.config.ts | 186 ++++++++++----------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/packages/nutui-taro-demo/src/app.config.ts b/packages/nutui-taro-demo/src/app.config.ts index 06b2236af0..da650497e7 100644 --- a/packages/nutui-taro-demo/src/app.config.ts +++ b/packages/nutui-taro-demo/src/app.config.ts @@ -1,133 +1,133 @@ const subPackages = [ { - root: 'base', + root: "base", pages: [ - 'pages/button/index', - 'pages/cell/index', - 'pages/configprovider/index', - 'pages/icon/index', - 'pages/image/index', - 'pages/overlay/index', + "pages/button/index", + "pages/cell/index", + "pages/configprovider/index", + "pages/icon/index", + "pages/image/index", + "pages/overlay/index", ], }, { - root: 'layout', + root: "layout", pages: [ - 'pages/divider/index', - 'pages/grid/index', - 'pages/layout/index', - 'pages/safearea/index', - 'pages/space/index', - 'pages/sticky/index', + "pages/divider/index", + "pages/grid/index", + "pages/layout/index", + "pages/safearea/index", + "pages/space/index", + "pages/sticky/index", ], }, { - root: 'nav', + root: "nav", pages: [ - 'pages/backtop/index', - 'pages/elevator/index', - 'pages/fixednav/index', - 'pages/navbar/index', - 'pages/sidenavbar/index', - 'pages/tabbar/index', - 'pages/tabs/index', + "pages/backtop/index", + "pages/elevator/index", + "pages/fixednav/index", + "pages/navbar/index", + "pages/sidenavbar/index", + "pages/tabbar/index", + "pages/tabs/index", ], }, { - root: 'dentry', + root: "dentry", pages: [ - 'pages/address/index', - 'pages/calendar/index', - 'pages/calendarcard/index', - 'pages/cascader/index', - 'pages/checkbox/index', - 'pages/datepicker/index', - 'pages/form/index', - 'pages/input/index', - 'pages/inputnumber/index', + "pages/address/index", + "pages/calendar/index", + "pages/calendarcard/index", + "pages/cascader/index", + "pages/checkbox/index", + "pages/datepicker/index", + "pages/form/index", + "pages/input/index", + "pages/inputnumber/index", ], }, { - root: 'dentry1', + root: "dentry1", pages: [ - 'pages/menu/index', - 'pages/numberkeyboard/index', - 'pages/picker/index', - 'pages/radio/index', - 'pages/range/index', - 'pages/rate/index', - 'pages/searchbar/index', - 'pages/shortpassword/index', - 'pages/signature/index', - 'pages/switch/index', - 'pages/textarea/index', - 'pages/uploader/index', + "pages/menu/index", + "pages/numberkeyboard/index", + "pages/picker/index", + "pages/radio/index", + "pages/range/index", + "pages/rate/index", + "pages/searchbar/index", + "pages/shortpassword/index", + "pages/signature/index", + "pages/switch/index", + "pages/textarea/index", + "pages/uploader/index", ], }, { - root: 'feedback', + root: "feedback", pages: [ - 'pages/actionsheet/index', - 'pages/badge/index', - 'pages/dialog/index', - 'pages/drag/index', - 'pages/empty/index', - 'pages/infiniteloading/index', - 'pages/loading/index', - 'pages/noticebar/index', - 'pages/notify/index', - 'pages/popover/index', - 'pages/popup/index', - 'pages/pulltorefresh/index', - 'pages/skeleton/index', - 'pages/swipe/index', - 'pages/toast/index', + "pages/actionsheet/index", + "pages/badge/index", + "pages/dialog/index", + "pages/drag/index", + "pages/empty/index", + "pages/infiniteloading/index", + "pages/loading/index", + "pages/noticebar/index", + "pages/notify/index", + "pages/popover/index", + "pages/popup/index", + "pages/pulltorefresh/index", + "pages/skeleton/index", + "pages/swipe/index", + "pages/toast/index", ], }, { - root: 'exhibition', + root: "exhibition", pages: [ - 'pages/animate/index', - 'pages/animatingnumbers/index', - 'pages/avatar/index', - 'pages/circleprogress/index', - 'pages/collapse/index', - 'pages/countdown/index', - 'pages/ellipsis/index', - 'pages/imagepreview/index', - 'pages/indicator/index', - 'pages/pagination/index', - 'pages/price/index', - 'pages/progress/index', - 'pages/steps/index', - 'pages/swiper/index', - 'pages/table/index', - 'pages/tag/index', - 'pages/tour/index', - 'pages/video/index', - 'pages/virtuallist/index', + "pages/animate/index", + "pages/animatingnumbers/index", + "pages/avatar/index", + "pages/circleprogress/index", + "pages/collapse/index", + "pages/countdown/index", + "pages/ellipsis/index", + "pages/imagepreview/index", + "pages/indicator/index", + "pages/pagination/index", + "pages/price/index", + "pages/progress/index", + "pages/steps/index", + "pages/swiper/index", + "pages/table/index", + "pages/tag/index", + "pages/tour/index", + "pages/video/index", + "pages/virtuallist/index", ], }, { - root: 'business', + root: "business", pages: [ - 'pages/avatarcropper/index', - 'pages/barrage/index', - 'pages/card/index', - 'pages/timeselect/index', - 'pages/trendarrow/index', - 'pages/watermark/index', + "pages/avatarcropper/index", + "pages/barrage/index", + "pages/card/index", + "pages/timeselect/index", + "pages/trendarrow/index", + "pages/watermark/index", ], }, ] export default defineAppConfig({ - pages: ['pages/index/index'], + pages: ["pages/index/index"], subPackages, window: { - backgroundTextStyle: 'light', - navigationBarBackgroundColor: '#fff', - navigationBarTitleText: 'NutUI-React', - navigationBarTextStyle: 'black', + backgroundTextStyle: "light", + navigationBarBackgroundColor: "#fff", + navigationBarTitleText: "NutUI-React", + navigationBarTextStyle: "black", }, }) From 345bdb6e4bf04e391b24c9ab20359b01959dd048 Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 11 Nov 2024 22:39:47 +0800 Subject: [PATCH 4/7] chore: update --- src/packages/progress/demos/taro/demo4.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/packages/progress/demos/taro/demo4.tsx b/src/packages/progress/demos/taro/demo4.tsx index 9a3a1000b9..2740c9fdf7 100644 --- a/src/packages/progress/demos/taro/demo4.tsx +++ b/src/packages/progress/demos/taro/demo4.tsx @@ -1,14 +1,13 @@ import React from 'react' import { Progress, Image, Cell } from '@nutui/nutui-react-taro' -import pxTransform from '@/utils/px-transform' const Demo4 = () => { return ( From 5872f0b5bb04c4a80d8932abaedcd4f93ace337e Mon Sep 17 00:00:00 2001 From: "Alex.hxy" <1872591453@qq.com> Date: Mon, 11 Nov 2024 22:45:31 +0800 Subject: [PATCH 5/7] chore: update --- packages/nutui-taro-demo/src/app.config.ts | 86 ++++++++++++---------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/packages/nutui-taro-demo/src/app.config.ts b/packages/nutui-taro-demo/src/app.config.ts index da650497e7..7357a2dbf7 100644 --- a/packages/nutui-taro-demo/src/app.config.ts +++ b/packages/nutui-taro-demo/src/app.config.ts @@ -1,41 +1,43 @@ + const subPackages = [ { - root: "base", - pages: [ + "root": "base", + "pages": [ "pages/button/index", "pages/cell/index", "pages/configprovider/index", "pages/icon/index", "pages/image/index", - "pages/overlay/index", - ], + "pages/overlay/index" + ] }, { - root: "layout", - pages: [ + "root": "layout", + "pages": [ "pages/divider/index", "pages/grid/index", "pages/layout/index", "pages/safearea/index", "pages/space/index", - "pages/sticky/index", - ], + "pages/sticky/index" + ] }, { - root: "nav", - pages: [ + "root": "nav", + "pages": [ "pages/backtop/index", "pages/elevator/index", "pages/fixednav/index", + "pages/hoverbutton/index", "pages/navbar/index", "pages/sidenavbar/index", "pages/tabbar/index", - "pages/tabs/index", - ], + "pages/tabs/index" + ] }, { - root: "dentry", - pages: [ + "root": "dentry", + "pages": [ "pages/address/index", "pages/calendar/index", "pages/calendarcard/index", @@ -44,12 +46,12 @@ const subPackages = [ "pages/datepicker/index", "pages/form/index", "pages/input/index", - "pages/inputnumber/index", - ], + "pages/inputnumber/index" + ] }, { - root: "dentry1", - pages: [ + "root": "dataentry", + "pages": [ "pages/menu/index", "pages/numberkeyboard/index", "pages/picker/index", @@ -61,12 +63,12 @@ const subPackages = [ "pages/signature/index", "pages/switch/index", "pages/textarea/index", - "pages/uploader/index", - ], + "pages/uploader/index" + ] }, { - root: "feedback", - pages: [ + "root": "feedback", + "pages": [ "pages/actionsheet/index", "pages/badge/index", "pages/dialog/index", @@ -79,14 +81,15 @@ const subPackages = [ "pages/popover/index", "pages/popup/index", "pages/pulltorefresh/index", + "pages/resultpage/index", "pages/skeleton/index", "pages/swipe/index", - "pages/toast/index", - ], + "pages/toast/index" + ] }, { - root: "exhibition", - pages: [ + "root": "exhibition", + "pages": [ "pages/animate/index", "pages/animatingnumbers/index", "pages/avatar/index", @@ -105,29 +108,32 @@ const subPackages = [ "pages/tag/index", "pages/tour/index", "pages/video/index", - "pages/virtuallist/index", - ], + "pages/virtuallist/index" + ] }, { - root: "business", - pages: [ + "root": "business", + "pages": [ "pages/avatarcropper/index", "pages/barrage/index", "pages/card/index", "pages/timeselect/index", "pages/trendarrow/index", - "pages/watermark/index", - ], - }, -] + "pages/watermark/index" + ] + } +]; export default defineAppConfig({ - pages: ["pages/index/index"], + pages: ['pages/index/index'], subPackages, window: { - backgroundTextStyle: "light", - navigationBarBackgroundColor: "#fff", - navigationBarTitleText: "NutUI-React", - navigationBarTextStyle: "black", + backgroundTextStyle: 'light', + navigationBarBackgroundColor: '#fff', + navigationBarTitleText: 'NutUI-React', + navigationBarTextStyle: 'black' }, -}) + components: ['pages/index/index', ...(subPackages.map(subPackage => { + return subPackage.pages.map(page => `${subPackage.root}/${page}`) + }).flat())] +}) \ No newline at end of file From 1e8c5d8a8eb188bdcef1e5e5898c2a258c6f7762 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Wed, 20 Nov 2024 20:30:58 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/progress/demos/h5/demo4.tsx | 6 +++--- src/packages/progress/demos/h5/demo6.tsx | 2 +- src/packages/progress/demos/taro/demo6.tsx | 13 ++++++------- src/packages/progress/progress.scss | 2 +- src/packages/progress/progress.taro.tsx | 2 +- src/packages/progress/progress.tsx | 2 +- src/styles/variables.scss | 7 +++++-- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/packages/progress/demos/h5/demo4.tsx b/src/packages/progress/demos/h5/demo4.tsx index 393f2ec18b..d5251f632b 100644 --- a/src/packages/progress/demos/h5/demo4.tsx +++ b/src/packages/progress/demos/h5/demo4.tsx @@ -6,9 +6,9 @@ const Demo4 = () => { diff --git a/src/packages/progress/demos/h5/demo6.tsx b/src/packages/progress/demos/h5/demo6.tsx index 99a4c573b3..a3f94a16dc 100644 --- a/src/packages/progress/demos/h5/demo6.tsx +++ b/src/packages/progress/demos/h5/demo6.tsx @@ -8,7 +8,7 @@ const Demo6 = () => { diff --git a/src/packages/progress/demos/taro/demo6.tsx b/src/packages/progress/demos/taro/demo6.tsx index ad91a1ac02..57d07342bd 100644 --- a/src/packages/progress/demos/taro/demo6.tsx +++ b/src/packages/progress/demos/taro/demo6.tsx @@ -1,7 +1,6 @@ import React from 'react' import { Progress, Cell } from '@nutui/nutui-react-taro' import { Checked, Tips } from '@nutui/icons-react-taro' -import { harmonyAndRn } from '@/utils/platform-taro' import pxTransform from '@/utils/px-transform' const Demo6 = () => { @@ -15,11 +14,7 @@ const Demo6 = () => { @@ -28,7 +23,11 @@ const Demo6 = () => { - + diff --git a/src/packages/progress/progress.scss b/src/packages/progress/progress.scss index acb3cbc779..aaf0574783 100644 --- a/src/packages/progress/progress.scss +++ b/src/packages/progress/progress.scss @@ -29,7 +29,7 @@ justify-content: center; transition: all 0.4s; border-radius: $progress-border-radius; - background-color: $progress-color; + background: $progress-color; } &-text { diff --git a/src/packages/progress/progress.taro.tsx b/src/packages/progress/progress.taro.tsx index c13bf51692..3a34fbd1f3 100644 --- a/src/packages/progress/progress.taro.tsx +++ b/src/packages/progress/progress.taro.tsx @@ -65,7 +65,7 @@ export const Progress: FunctionComponent< const stylesInner: React.CSSProperties = { width: `${displayPercent}%`, - backgroundColor: color || '#FF0F23', + background: color || '#FF0F23', } if (strokeWidth) { diff --git a/src/packages/progress/progress.tsx b/src/packages/progress/progress.tsx index 902d6c3553..deba21e7de 100644 --- a/src/packages/progress/progress.tsx +++ b/src/packages/progress/progress.tsx @@ -61,7 +61,7 @@ export const Progress: FunctionComponent< const stylesInner: React.CSSProperties = { width: `${displayPercent}%`, - backgroundColor: color || '#FF0F23', + background: color || '#FF0F23', } useEffect(() => { diff --git a/src/styles/variables.scss b/src/styles/variables.scss index e00ca3545b..7cf2b897c1 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -1634,7 +1634,10 @@ $popover-menu-item-padding: var( //progress(✅) $progress-height: var(--nutui-progress-height, 10px) !default; -$progress-color: var(--nutui-progress-color, #ff0f23) !default; +$progress-color: var( + --nutui-progress-color, + $color-primary-gradient-1 +) !default; $progress-background: var( --nutui-progress-background, $color-background @@ -1646,7 +1649,7 @@ $progress-text-color: var( ) !default; $progress-text-background: var( --nutui-progress-text-background, - #ff0f23 + $color-primary-gradient-1 ) !default; $progress-text-padding: var(--nutui-progress-text-padding, 0 5px) !default; $progress-text-font-size: var(--nutui-progress-text-font-size, 9px) !default; From 14105a5d40e5603946288cfa78f3045ab8b1da69 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Wed, 20 Nov 2024 20:34:49 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../progress/__tests__/__snapshots__/progress.spec.tsx.snap | 2 +- src/packages/progress/__tests__/progress.spec.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap b/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap index 5d32ec69de..80701d06e4 100644 --- a/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap +++ b/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap @@ -10,7 +10,7 @@ exports[`should render progress when use props 1`] = ` >
diff --git a/src/packages/progress/__tests__/progress.spec.tsx b/src/packages/progress/__tests__/progress.spec.tsx index fde6ea03b2..81e0413f8b 100644 --- a/src/packages/progress/__tests__/progress.spec.tsx +++ b/src/packages/progress/__tests__/progress.spec.tsx @@ -13,9 +13,7 @@ test('should render different height and color when use color height props', asy ) const inner = container.querySelector('.nut-progress-inner') - expect(inner?.getAttribute('style')).toBe( - 'width: 50%; background-color: blue;' - ) + expect(inner?.getAttribute('style')).toBe('width: 50%; background: blue;') }) test('should show percent when use showText props', () => {