From 86c6f2e007717386fd6c633a8eaccb28a9fe95d9 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Wed, 29 May 2024 20:50:36 +0800 Subject: [PATCH 01/15] feat: toast rn --- src/packages/toast/demo.taro.tsx | 16 ++++---- src/packages/toast/demos/taro/demo2.tsx | 4 +- src/packages/toast/toast.harmony.css | 53 ++++++------------------- src/packages/toast/toast.scss | 17 ++++---- src/packages/toast/toast.taro.tsx | 24 +++++++---- 5 files changed, 48 insertions(+), 66 deletions(-) diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index a9c152c513..ceb3881757 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { Toast } from '@nutui/nutui-react-taro' import Header from '@/sites/components/header' import { useTranslate } from '@/sites/assets/locale/taro' @@ -44,20 +45,19 @@ const ToastDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.toastFunction}

+ {translated.toastFunction} - -

{translated.toastDuration}

+ {translated.toastDuration} -

{translated.toastCustomIcon}

+ {translated.toastCustomIcon} -

{translated.toastWordBreak}

+ {translated.toastWordBreak} -
+ ) } diff --git a/src/packages/toast/demos/taro/demo2.tsx b/src/packages/toast/demos/taro/demo2.tsx index dfb98d7658..2d058c6429 100644 --- a/src/packages/toast/demos/taro/demo2.tsx +++ b/src/packages/toast/demos/taro/demo2.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Jd } from '@nutui/icons-react-taro' +// import { Jd } from '@nutui/icons-react-taro' import { Cell, Toast } from '@nutui/nutui-react-taro' const Demo5 = () => { @@ -14,7 +14,7 @@ const Demo5 = () => { type: 'fail', duration: 2, position: 'center', - icon: , + // icon: , lockScroll: true, onClose: () => { console.log('close') diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index 6e8b76caea..32d0f7caac 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -6,42 +6,33 @@ -webkit-transform: rotate(360deg); } } - -.nut-toast-overlay-default { - background: rgba(0, 0, 0, 0); - z-index: 1300; -} - .nut-toast { - display: flex; - flex-direction: column; position: fixed; - top: 0; left: 0; - height: 100%; - width: 100%; - align-items: center; + top: 0; + display: flex; + flex-direction: row; justify-content: center; + width: 100%; + height: 100%; + text-align: center; + pointer-events: none; + z-index: 1300; +} +.nut-toast-overlay-default { + background: rgba(0, 0, 0, 0); z-index: 1300; } - - .nut-toast-small .nut-toast-inner { font-size: 12px; } - .nut-toast-large .nut-toast-inner { font-size: 16px; } - .nut-toast-inner { display: flex; flex-direction: column; - justify-content: center; - align-items: center; position: absolute; - left: 50%; - top: 50%; min-width: 30%; max-width: 95.7%; font-size: 14px; @@ -51,52 +42,38 @@ background: rgba(0, 0, 0, 0.7); border-radius: 16px; color: #ffffff; - transform: translate(-50%, -50%); } - .nut-toast-inner.normal { word-break: normal; word-wrap: normal; } - .nut-toast-inner.break-word { word-break: normal; word-wrap: break-word; } - .nut-toast-center { - top: 50%; + top: 42%; } - .nut-toast-bottom { top: 80%; } - .nut-toast-top { top: 20%; } - .nut-toast-text { - display: flex; color: #ffffff; - text-align: center; } - .nut-toast-text:empty { margin-bottom: -8px; } - .nut-toast-title { - display: flex; color: #ffffff; font-size: 16px; font-weight: 500; } - .nut-toast-title:empty { margin-bottom: -8px; } - .nut-toast-has-icon .nut-toast-icon-wrapper { width: 100%; display: flex; @@ -104,23 +81,19 @@ justify-content: center; margin-bottom: 8px; } - .nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon { width: 24px; height: 24px; } - .nut-toast-loading .nut-toast-inner { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; } - .nut-toast-loading .nut-toast-icon-wrapper { animation: rotation 2s linear infinite; } - .nut-toast-loading .nut-toast-icon-wrapper .nut-icon { width: 24px; height: 24px; @@ -131,12 +104,10 @@ left: auto; right: 0; } - [dir=rtl] .nut-toast-inner, .nut-rtl .nut-toast-inner { left: auto; right: 50%; - transform: translate(50%, -50%); } .toast-fade-enter-active { diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index f247aa4242..3ac4b36202 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -12,6 +12,9 @@ position: fixed; left: 0; top: 0; + display: flex; + flex-direction: row; + justify-content: center; width: 100%; height: 100%; text-align: center; @@ -19,8 +22,8 @@ z-index: 1300; &-overlay-default { - --nutui-overlay-bg-color: rgba(0, 0, 0, 0); - --nutui-overlay-zIndex: 1300; + background: rgba(0, 0, 0, 0); + z-index: 1300; } &-small { @@ -39,8 +42,8 @@ display: flex; flex-direction: column; position: absolute; - left: 50%; - top: $toast-inner-top; + // left: 50%; + // top: $toast-inner-top; min-width: 30%; max-width: 95.7%; font-size: $toast-text-font-size; @@ -50,7 +53,6 @@ background: $toast-inner-bg-color; border-radius: $toast-inner-border-radius; color: $toast-font-color; - transform: translate(-50%, -50%); &.normal { word-break: normal; @@ -64,7 +66,7 @@ } &-center { - top: var(--nutui-toast-inner-top, 50%); + top: var(--nutui-toast-inner-top, 42%); } &-bottom { @@ -76,6 +78,7 @@ } &-text { + color: #ffffff; &:empty { margin-bottom: -8px; } @@ -133,7 +136,7 @@ &-inner { left: auto; right: 50%; - transform: translate(50%, -50%); + // transform: translate(50%, -50%); } } diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index e4452fb9e8..32de8759a9 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -1,7 +1,7 @@ import React, { FunctionComponent, useEffect, useRef } from 'react' import classNames from 'classnames' -import { View } from '@tarojs/components' -import { Failure, Loading, Success, Tips } from '@nutui/icons-react-taro' +import { Text, View } from '@tarojs/components' +// import { Failure, Loading, Success, Tips } from '@nutui/icons-react-taro' import Overlay from '@/packages/overlay/index.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { @@ -165,11 +165,17 @@ export const Toast: FunctionComponent< return icon } return { - success: , - fail: , - warn: , - loading: , + success: success, + fail: fail, + warn: warn, + loading: loading, }[type] + // return { + // success: , + // fail: , + // warn: , + // loading: , + // }[type] } const classes = classNames({ @@ -195,12 +201,14 @@ export const Toast: FunctionComponent< style={contentStyle} > {hasIcon() ? ( -

{iconName()}

+ + {iconName()} + ) : null} {title ? ( {title} ) : null} - {content || msg} + {content || msg} From 9e4db059e0fccdaed3e8dcf0996b3dab444c8d3b Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Wed, 29 May 2024 20:57:16 +0800 Subject: [PATCH 02/15] feat: toast rn --- .../src/feedback/pages/toast/index.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx b/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx index b319b312b7..e06d50a69d 100644 --- a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx +++ b/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx @@ -1,7 +1,2 @@ -// TODO: 测试使用 -import { View } from "@tarojs/components"; - -const Demo = () => { - return (1111) -} - export default Demo; \ No newline at end of file +import Demo from '@/packages/toast/demo.taro' +export default Demo \ No newline at end of file From 319d094bf15e2b947c7a758d968f8cc00d2d3b06 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Thu, 30 May 2024 19:40:16 +0800 Subject: [PATCH 03/15] =?UTF-8?q?feat:=20toast=20=E9=80=82=E9=85=8D=20RN?= =?UTF-8?q?=20&=20=E9=B8=BF=E8=92=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/Notification.tsx | 12 ++++++-- src/packages/toast/toast.harmony.css | 25 +++++++++------ src/packages/toast/toast.scss | 32 ++++++++++--------- src/packages/toast/toast.taro.tsx | 46 ++++++++++++++++++---------- 4 files changed, 73 insertions(+), 42 deletions(-) diff --git a/src/packages/toast/Notification.tsx b/src/packages/toast/Notification.tsx index 8803f15aed..f84060a35a 100644 --- a/src/packages/toast/Notification.tsx +++ b/src/packages/toast/Notification.tsx @@ -151,13 +151,21 @@ export default class Notification extends React.PureComponent<
{this.renderIcon()} {title ? (
{title}
) : null} - {content} + + {content} +
diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index 32d0f7caac..f7542ae7a7 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -6,6 +6,11 @@ -webkit-transform: rotate(360deg); } } +.nut-overlay.nut-toast-overlay-default { + background: rgba(0, 0, 0, 0); + z-index: 1300; +} + .nut-toast { position: fixed; left: 0; @@ -13,16 +18,13 @@ display: flex; flex-direction: row; justify-content: center; + align-items: center; width: 100%; height: 100%; text-align: center; pointer-events: none; z-index: 1300; } -.nut-toast-overlay-default { - background: rgba(0, 0, 0, 0); - z-index: 1300; -} .nut-toast-small .nut-toast-inner { font-size: 12px; } @@ -52,7 +54,7 @@ word-wrap: break-word; } .nut-toast-center { - top: 42%; + top: 48%; } .nut-toast-bottom { top: 80%; @@ -63,7 +65,7 @@ .nut-toast-text { color: #ffffff; } -.nut-toast-text:empty { +.nut-toast-text-empty { margin-bottom: -8px; } .nut-toast-title { @@ -71,9 +73,6 @@ font-size: 16px; font-weight: 500; } -.nut-toast-title:empty { - margin-bottom: -8px; -} .nut-toast-has-icon .nut-toast-icon-wrapper { width: 100%; display: flex; @@ -98,6 +97,14 @@ width: 24px; height: 24px; } +.nut-toast-rtl { + left: auto; + right: 0; +} +.nut-toast-rtl-inner { + left: auto; + right: 50%; +} [dir=rtl] .nut-toast, .nut-rtl .nut-toast { diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index 3ac4b36202..fda608026e 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -8,6 +8,11 @@ } } +.nut-overlay.nut-toast-overlay-default { + background: rgba(0, 0, 0, 0); + z-index: 1300; +} + .nut-toast { position: fixed; left: 0; @@ -15,17 +20,13 @@ display: flex; flex-direction: row; justify-content: center; + align-items: center; width: 100%; height: 100%; text-align: center; pointer-events: none; z-index: 1300; - &-overlay-default { - background: rgba(0, 0, 0, 0); - z-index: 1300; - } - &-small { .nut-toast-inner { font-size: $font-size-small; @@ -42,8 +43,6 @@ display: flex; flex-direction: column; position: absolute; - // left: 50%; - // top: $toast-inner-top; min-width: 30%; max-width: 95.7%; font-size: $toast-text-font-size; @@ -66,7 +65,7 @@ } &-center { - top: var(--nutui-toast-inner-top, 42%); + top: var(--nutui-toast-inner-top, 48%); } &-bottom { @@ -79,7 +78,7 @@ &-text { color: #ffffff; - &:empty { + &-empty { margin-bottom: -8px; } } @@ -88,10 +87,6 @@ color: #ffffff; font-size: $toast-title-font-size; font-weight: 500; - - &:empty { - margin-bottom: -8px; - } } &-has-icon { @@ -126,6 +121,16 @@ } } } + + &-rtl { + left: auto; + right: 0; + + &-inner { + left: auto; + right: 50%; + } + } } [dir='rtl'] .nut-toast, @@ -136,7 +141,6 @@ &-inner { left: auto; right: 50%; - // transform: translate(50%, -50%); } } diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index 32de8759a9..8b351b6ec7 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -1,7 +1,8 @@ import React, { FunctionComponent, useEffect, useRef } from 'react' +import Taro from '@tarojs/taro' import classNames from 'classnames' import { Text, View } from '@tarojs/components' -// import { Failure, Loading, Success, Tips } from '@nutui/icons-react-taro' +import { Failure, Loading, Success, Tips } from '@nutui/icons-react-taro' import Overlay from '@/packages/overlay/index.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { @@ -11,6 +12,7 @@ import { useParams, } from '@/utils/use-custom-event' import { usePropsValue } from '@/utils/use-props-value' +import { useRtl } from '@/packages/configprovider/index.taro' export type ToastPosition = 'top' | 'bottom' | 'center' export type ToastSize = 'small' | 'base' | 'large' @@ -94,6 +96,7 @@ export const Toast: FunctionComponent< setParams, } = useParams({ ...defaultProps, ...props }) const timer = useRef(-1) + const rtl = useRtl() const [innerVisible, setInnerVisible] = usePropsValue({ value: visible, @@ -103,7 +106,6 @@ export const Toast: FunctionComponent< !v && onClose?.() }, }) - useEffect(() => { if (innerVisible) { autoClose() @@ -123,7 +125,6 @@ export const Toast: FunctionComponent< } } ) - const clearTimer = () => { if (timer.current) { clearTimeout(timer.current) @@ -164,24 +165,31 @@ export const Toast: FunctionComponent< if (icon) { return icon } - return { - success: success, - fail: fail, - warn: warn, - loading: loading, - }[type] - // return { - // success: , - // fail: , - // warn: , - // loading: , - // }[type] + + return Taro.getEnv() !== 'RN' && Taro.getEnv() !== 'HARMONY' + ? { + success: , + fail: , + warn: , + loading: , + }[type] + : { + success: success, + fail: fail, + warn: warn, + loading: loading, + }[type] } const classes = classNames({ 'nut-toast-has-icon': icon, [`nut-toast-${size}`]: true, + 'nut-toast-rtl': rtl, }) + const styles = + Taro.getEnv() !== 'RN' + ? { left: '50%', transform: 'translate(-50%, -50%)' } + : null return ( <> {innerVisible ? ( @@ -198,7 +206,7 @@ export const Toast: FunctionComponent< {hasIcon() ? ( @@ -208,7 +216,11 @@ export const Toast: FunctionComponent< {title ? ( {title} ) : null} - {content || msg} + + {content || msg} + From db48d4ed1e326629bd7bbff1e57f74a6d24c3606 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Thu, 30 May 2024 19:48:52 +0800 Subject: [PATCH 04/15] fix: adapted --- .../scripts/taro/adapted.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/nutui-taro-demo-rn/scripts/taro/adapted.js b/packages/nutui-taro-demo-rn/scripts/taro/adapted.js index c853cdb45c..4f592d418d 100644 --- a/packages/nutui-taro-demo-rn/scripts/taro/adapted.js +++ b/packages/nutui-taro-demo-rn/scripts/taro/adapted.js @@ -1 +1,22 @@ -exports = module.exports = ["cell", "cellgroup", "overlay", "button", "switch", "countdown", "empty","price","tag","layout","row","col","space", "grid", "griditem", "divider"]; +exports = module.exports = [ + 'cell', + 'cellgroup', + 'overlay', + 'button', + 'switch', + 'countdown', + 'empty', + 'price', + 'tag', + 'layout', + 'row', + 'col', + 'space', + 'grid', + 'griditem', + 'divider', + 'configprovider', + 'textarea', + 'rate', + 'toast', +] From 9d71e383a821e29e090b5326586f35449654040c Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Tue, 11 Jun 2024 15:57:35 +0800 Subject: [PATCH 05/15] =?UTF-8?q?fix:=20toast=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4,=E9=B8=BF=E8=92=99=E4=B8=8B=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/Notification.tsx | 5 +- src/packages/toast/demo.taro.tsx | 12 +---- src/packages/toast/demos/h5/demo1.tsx | 3 +- src/packages/toast/demos/h5/demo5.tsx | 1 + src/packages/toast/demos/taro/demo2.tsx | 4 +- src/packages/toast/demos/taro/demo5.tsx | 1 + src/packages/toast/toast.harmony.css | 44 ++++++++++------ src/packages/toast/toast.scss | 67 ++++++++++++++----------- src/packages/toast/toast.taro.tsx | 9 ++-- 9 files changed, 78 insertions(+), 68 deletions(-) diff --git a/src/packages/toast/Notification.tsx b/src/packages/toast/Notification.tsx index f84060a35a..d2773771c6 100644 --- a/src/packages/toast/Notification.tsx +++ b/src/packages/toast/Notification.tsx @@ -134,7 +134,6 @@ export default class Notification extends React.PureComponent< const classes = classNames({ 'nut-toast-has-icon': icon, - [`nut-toast-${size}`]: true, }) return ( <> @@ -150,10 +149,8 @@ export default class Notification extends React.PureComponent< >
diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index ceb3881757..0dd6831c58 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -32,20 +32,10 @@ const ToastDemo = () => { }, }) - function demoClass() { - if (Taro.getEnv() === 'WEB') { - return 'web' - } - if (Taro.getEnv() === 'HARMONY') { - return 'full' - } - return '' - } - return ( <>
- + {translated.basic} {translated.toastFunction} diff --git a/src/packages/toast/demos/h5/demo1.tsx b/src/packages/toast/demos/h5/demo1.tsx index b94099ed09..37016161ea 100644 --- a/src/packages/toast/demos/h5/demo1.tsx +++ b/src/packages/toast/demos/h5/demo1.tsx @@ -13,7 +13,8 @@ const Demo1 = () => { title="成功提示" onClick={() => Toast.show({ - content: '成功提示', + title: '成功提示', + content: '成功提示成功提示成功提示', icon: 'success', }) } diff --git a/src/packages/toast/demos/h5/demo5.tsx b/src/packages/toast/demos/h5/demo5.tsx index b7ecd444ba..e2a3e99cdd 100644 --- a/src/packages/toast/demos/h5/demo5.tsx +++ b/src/packages/toast/demos/h5/demo5.tsx @@ -6,6 +6,7 @@ const Demo5 = () => { Toast.show({ content: `Let's try ABCDEFGHIJKLMN here.`, wordBreak: mode, + contentStyle: { width: '200px' }, }) } return ( diff --git a/src/packages/toast/demos/taro/demo2.tsx b/src/packages/toast/demos/taro/demo2.tsx index 2d058c6429..04949831c9 100644 --- a/src/packages/toast/demos/taro/demo2.tsx +++ b/src/packages/toast/demos/taro/demo2.tsx @@ -9,8 +9,8 @@ const Demo5 = () => { title="函数调用" onClick={() => { Toast.show('test', { - title: '函数调用', - content: '函数调用', + title: '函数调用函数调用', + content: '函数调用函数调用函数调用函数调用函数', type: 'fail', duration: 2, position: 'center', diff --git a/src/packages/toast/demos/taro/demo5.tsx b/src/packages/toast/demos/taro/demo5.tsx index af1f601b21..4317a3c3fa 100644 --- a/src/packages/toast/demos/taro/demo5.tsx +++ b/src/packages/toast/demos/taro/demo5.tsx @@ -19,6 +19,7 @@ const Demo5 = () => { onClose={() => { setShow(false) }} + contentStyle={{ width: '200px' }} wordBreak={state.wordBreak} /> diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index f7542ae7a7..2a6997f0d7 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -6,13 +6,13 @@ -webkit-transform: rotate(360deg); } } -.nut-overlay.nut-toast-overlay-default { - background: rgba(0, 0, 0, 0); - z-index: 1300; -} - .nut-toast { + /* #ifdef rn */ + position: absolute; + /* #endif */ + /* #ifndef rn */ position: fixed; + /* #endif */ left: 0; top: 0; display: flex; @@ -21,20 +21,19 @@ align-items: center; width: 100%; height: 100%; - text-align: center; pointer-events: none; z-index: 1300; } -.nut-toast-small .nut-toast-inner { - font-size: 12px; -} -.nut-toast-large .nut-toast-inner { - font-size: 16px; +.nut-toast-overlay-default { + background: rgba(0, 0, 0, 0); + z-index: 1300; } .nut-toast-inner { + position: absolute; display: flex; flex-direction: column; - position: absolute; + justify-content: center; + align-items: center; min-width: 30%; max-width: 95.7%; font-size: 14px; @@ -45,16 +44,27 @@ border-radius: 16px; color: #ffffff; } -.nut-toast-inner.normal { +.nut-toast-inner-normal { word-break: normal; word-wrap: normal; } -.nut-toast-inner.break-word { +.nut-toast-inner-break-word { word-break: normal; word-wrap: break-word; } +.nut-toast-inner-small { + font-size: 12px; +} +.nut-toast-inner-large { + font-size: 16px; +} .nut-toast-center { + /* #ifdef rn */ + top: 38%; + /* #endif */ + /* #ifndef rn */ top: 48%; + /* #endif */ } .nut-toast-bottom { top: 80%; @@ -64,6 +74,7 @@ } .nut-toast-text { color: #ffffff; + text-align: center; } .nut-toast-text-empty { margin-bottom: -8px; @@ -72,15 +83,16 @@ color: #ffffff; font-size: 16px; font-weight: 500; + text-align: center; } -.nut-toast-has-icon .nut-toast-icon-wrapper { +.nut-toast-icon-wrapper { width: 100%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; } -.nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon { +.nut-toast-icon-wrapper .nut-icon { width: 24px; height: 24px; } diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index fda608026e..e1eb48bbff 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -8,13 +8,13 @@ } } -.nut-overlay.nut-toast-overlay-default { - background: rgba(0, 0, 0, 0); - z-index: 1300; -} - .nut-toast { + /* #ifdef rn */ + position: absolute; + /* #endif */ + /* #ifndef rn */ position: fixed; + /* #endif */ left: 0; top: 0; display: flex; @@ -23,26 +23,20 @@ align-items: center; width: 100%; height: 100%; - text-align: center; pointer-events: none; z-index: 1300; - &-small { - .nut-toast-inner { - font-size: $font-size-small; - } - } - - &-large { - .nut-toast-inner { - font-size: $font-size-large; - } + &-overlay-default { + background: rgba(0, 0, 0, 0); + z-index: 1300; } &-inner { + position: absolute; display: flex; flex-direction: column; - position: absolute; + justify-content: center; + align-items: center; min-width: 30%; max-width: 95.7%; font-size: $toast-text-font-size; @@ -53,19 +47,32 @@ border-radius: $toast-inner-border-radius; color: $toast-font-color; - &.normal { + &-normal { word-break: normal; word-wrap: normal; } - &.break-word { + &-break-word { word-break: normal; word-wrap: break-word; } + + &-small { + font-size: $font-size-small; + } + + &-large { + font-size: $font-size-large; + } } &-center { + /* #ifdef rn */ + top: var(--nutui-toast-inner-top, 38%); + /* #endif */ + /* #ifndef rn */ top: var(--nutui-toast-inner-top, 48%); + /* #endif */ } &-bottom { @@ -78,6 +85,7 @@ &-text { color: #ffffff; + text-align: $toast-inner-text-align; &-empty { margin-bottom: -8px; } @@ -87,20 +95,19 @@ color: #ffffff; font-size: $toast-title-font-size; font-weight: 500; + text-align: $toast-inner-text-align; } - &-has-icon { - .nut-toast-icon-wrapper { - width: 100%; - display: flex; - align-items: center; - justify-content: center; - margin-bottom: 8px; + &-icon-wrapper { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 8px; - .nut-icon { - width: 24px; - height: 24px; - } + .nut-icon { + width: 24px; + height: 24px; } } diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index 8b351b6ec7..4fc72437ac 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -183,13 +183,14 @@ export const Toast: FunctionComponent< const classes = classNames({ 'nut-toast-has-icon': icon, - [`nut-toast-${size}`]: true, 'nut-toast-rtl': rtl, }) + const styles = - Taro.getEnv() !== 'RN' + Taro.getEnv() === 'HARMONY' ? { left: '50%', transform: 'translate(-50%, -50%)' } : null + return ( <> {innerVisible ? ( @@ -205,7 +206,7 @@ export const Toast: FunctionComponent< > {hasIcon() ? ( @@ -214,7 +215,7 @@ export const Toast: FunctionComponent< ) : null} {title ? ( - {title} + {title} ) : null} Date: Tue, 11 Jun 2024 19:13:27 +0800 Subject: [PATCH 06/15] fix: demo for break all --- src/packages/toast/demo.taro.tsx | 11 +++++++++-- src/packages/toast/demos/taro/demo5.tsx | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index 0dd6831c58..93b1bc83ca 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -45,8 +45,15 @@ const ToastDemo = () => { {translated.toastCustomIcon} - {translated.toastWordBreak} - + {/* rn和 鸿蒙不支持 break-all */} + {Taro.getEnv() === Taro.ENV_TYPE.HARMONYHYBRID || + Taro.getEnv() === Taro.ENV_TYPE.HARMONY || + Taro.getEnv() === Taro.ENV_TYPE.RN ? null : ( + <> + {translated.toastWordBreak} + + + )} ) diff --git a/src/packages/toast/demos/taro/demo5.tsx b/src/packages/toast/demos/taro/demo5.tsx index 4317a3c3fa..1725efe181 100644 --- a/src/packages/toast/demos/taro/demo5.tsx +++ b/src/packages/toast/demos/taro/demo5.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react' import { Cell, Toast, ToastWordBreak } from '@nutui/nutui-react-taro' +import pxTransform from '@/utils/px-transform' const Demo5 = () => { const [state, setState] = useState<{ - content: string + content?: string wordBreak: ToastWordBreak }>({ content: `Let's try ABCDEFGHIJKLMN here.`, @@ -19,11 +20,20 @@ const Demo5 = () => { onClose={() => { setShow(false) }} - contentStyle={{ width: '200px' }} + contentStyle={{ width: pxTransform(200) }} wordBreak={state.wordBreak} /> - setShow(true)} /> + { + setState({ + content: `Let's try ABCDEFGHIJKLMN here.`, + wordBreak: 'break-all', + }) + setShow(true) + }} + /> { From 5518d85590e252412c7dca91f46a9a74feb58b52 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Wed, 24 Jul 2024 15:41:58 +0800 Subject: [PATCH 07/15] =?UTF-8?q?fix:=20=E7=AE=80=E5=8C=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/Notification.tsx | 23 ++++++-------------- src/packages/toast/toast.scss | 18 ---------------- src/packages/toast/toast.taro.tsx | 33 ++++++++++++++--------------- src/packages/toast/toast.tsx | 2 +- 4 files changed, 23 insertions(+), 53 deletions(-) diff --git a/src/packages/toast/Notification.tsx b/src/packages/toast/Notification.tsx index d2773771c6..905c33a536 100644 --- a/src/packages/toast/Notification.tsx +++ b/src/packages/toast/Notification.tsx @@ -83,23 +83,12 @@ export default class Notification extends React.PureComponent< renderIcon() { const { icon } = this.props if (typeof icon === 'string') { - let iconNode = null - switch (icon) { - case 'success': - iconNode = - break - case 'loading': - iconNode = - break - case 'fail': - iconNode = - break - case 'warn': - iconNode = - break - default: - break - } + const iconNode = { + success: , + fail: , + warn: , + loading: , + }[icon] return

{iconNode}

} return icon diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index e1eb48bbff..fb0b147890 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -111,24 +111,6 @@ } } - &-loading { - .nut-toast-inner { - display: inline-flex; - flex-direction: column; - justify-content: center; - align-items: center; - } - - .nut-toast-icon-wrapper { - animation: rotation 2s linear infinite; - - .nut-icon { - width: 24px; - height: 24px; - } - } - } - &-rtl { left: auto; right: 0; diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index 4fc72437ac..62a9582ed4 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -1,5 +1,4 @@ import React, { FunctionComponent, useEffect, useRef } from 'react' -import Taro from '@tarojs/taro' import classNames from 'classnames' import { Text, View } from '@tarojs/components' import { Failure, Loading, Success, Tips } from '@nutui/icons-react-taro' @@ -13,6 +12,7 @@ import { } from '@/utils/use-custom-event' import { usePropsValue } from '@/utils/use-props-value' import { useRtl } from '@/packages/configprovider/index.taro' +import { harmonyAndRn, harmony } from '@/utils/platform-taro' export type ToastPosition = 'top' | 'bottom' | 'center' export type ToastSize = 'small' | 'base' | 'large' @@ -20,19 +20,19 @@ export type ToastWordBreak = 'normal' | 'break-all' | 'break-word' export interface ToastProps extends BasicComponent { id?: string - maskClassName?: string - contentClassName?: string - contentStyle?: React.CSSProperties - icon: React.ReactNode - iconSize: string - content: React.ReactNode duration: number position?: ToastPosition - type: string title: string closeOnOverlayClick: boolean lockScroll: boolean size: ToastSize + icon: React.ReactNode + iconSize: string + maskClassName?: string + content: React.ReactNode + contentClassName?: string + contentStyle?: React.CSSProperties + type: string visible: boolean wordBreak?: ToastWordBreak onClose: () => void @@ -45,18 +45,18 @@ export interface ToastProps extends BasicComponent { const defaultProps = { ...ComponentDefaults, id: '', + duration: 2, // 时长,duration为0则一直展示 + position: 'center', + title: '', + size: 'base', // 设置字体大小,默认base,可选large\small\base icon: null, iconSize: '20', content: '', msg: '', - duration: 2, // 时长,duration为0则一直展示 - position: 'center', type: 'text', - title: '', closeOnOverlayClick: false, lockScroll: false, contentClassName: '', // 内容自定义样式名 - size: 'base', // 设置字体大小,默认base,可选large\small\base visible: false, wordBreak: 'break-all', onClose: () => {}, // 未实现 @@ -166,7 +166,7 @@ export const Toast: FunctionComponent< return icon } - return Taro.getEnv() !== 'RN' && Taro.getEnv() !== 'HARMONY' + return !harmonyAndRn() ? { success: , fail: , @@ -186,10 +186,9 @@ export const Toast: FunctionComponent< 'nut-toast-rtl': rtl, }) - const styles = - Taro.getEnv() === 'HARMONY' - ? { left: '50%', transform: 'translate(-50%, -50%)' } - : null + const styles = harmony() + ? { left: '50%', transform: 'translate(-50%, -50%)' } + : null return ( <> diff --git a/src/packages/toast/toast.tsx b/src/packages/toast/toast.tsx index 5e22741746..016a30ad42 100644 --- a/src/packages/toast/toast.tsx +++ b/src/packages/toast/toast.tsx @@ -37,11 +37,11 @@ let options: ToastProps = { title: '', size: 'base', // 设置字体大小,默认base,可选large\small\base icon: null, - onClose: () => {}, closeOnOverlayClick: false, // 是否点击遮罩可关闭 lockScroll: false, contentClassName: '', wordBreak: 'break-all', + onClose: () => {}, } function getInstance( From 1c87258427c7bf4dc331eb649bd509abc75c03e6 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Wed, 24 Jul 2024 17:19:43 +0800 Subject: [PATCH 08/15] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nutui-taro-demo-rn/src/app.config.ts | 4 ++-- .../pages/pulltorefresh/index.config.ts | 2 +- .../src/feedback/pages/toast/index.tsx | 4 ++-- .../src/nav/pages/backtop/index.config.ts | 2 +- src/packages/toast/Notification.tsx | 4 ++-- src/packages/toast/demo.taro.tsx | 5 ++--- src/packages/toast/toast.harmony.css | 21 +++++++------------ src/packages/toast/toast.scss | 9 +++++++- src/packages/toast/toast.taro.tsx | 16 +++++++++----- 9 files changed, 36 insertions(+), 31 deletions(-) diff --git a/packages/nutui-taro-demo-rn/src/app.config.ts b/packages/nutui-taro-demo-rn/src/app.config.ts index 1e4216f2c6..95ba9ce7c5 100644 --- a/packages/nutui-taro-demo-rn/src/app.config.ts +++ b/packages/nutui-taro-demo-rn/src/app.config.ts @@ -124,7 +124,7 @@ const subPackages = [ } ]; -export default defineAppConfig ({ +export default defineAppConfig({ pages: ['pages/index/index'], subPackages, window: { @@ -133,4 +133,4 @@ export default defineAppConfig ({ navigationBarTitleText: 'NutUI-React', navigationBarTextStyle: 'black' } -}) +}) \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts b/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts index 0f2566639f..350fc31c3f 100644 --- a/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts +++ b/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts @@ -1,3 +1,3 @@ export default { - navigationBarTitleText: 'Pulltorefresh' + navigationBarTitleText: 'PullToRefresh', } \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx b/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx index e06d50a69d..60274f68d9 100644 --- a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx +++ b/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx @@ -1,2 +1,2 @@ -import Demo from '@/packages/toast/demo.taro' -export default Demo \ No newline at end of file +import Demo from '@/packages/toast/demo.taro'; +export default Demo; \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts b/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts index af79567551..1402945aee 100644 --- a/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts +++ b/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts @@ -1,3 +1,3 @@ export default { - navigationBarTitleText: 'BackTop' + navigationBarTitleText: 'BackTop', } \ No newline at end of file diff --git a/src/packages/toast/Notification.tsx b/src/packages/toast/Notification.tsx index 905c33a536..4a7dddba22 100644 --- a/src/packages/toast/Notification.tsx +++ b/src/packages/toast/Notification.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import classNames from 'classnames' -import { Check, Loading, Failure, Tips } from '@nutui/icons-react' +import { Success, Loading, Failure, Tips } from '@nutui/icons-react' import { render, unmount } from '@/utils/render' import Overlay from '@/packages/overlay/index' import { BasicComponent } from '@/utils/typings' @@ -84,7 +84,7 @@ export default class Notification extends React.PureComponent< const { icon } = this.props if (typeof icon === 'string') { const iconNode = { - success: , + success: , fail: , warn: , loading: , diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index a9d876c709..e2f5421152 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -1,5 +1,4 @@ import React from 'react' -import Taro from '@tarojs/taro' import { ScrollView, View } from '@tarojs/components' import { Toast } from '@nutui/nutui-react-taro' import Header from '@/sites/components/header' @@ -9,7 +8,7 @@ import Demo2 from './demos/taro/demo2' import Demo3 from './demos/taro/demo3' import Demo4 from './demos/taro/demo4' import Demo5 from './demos/taro/demo5' -import { harmonyAndRn } from '@/utils/platform-taro' +import { harmonyAndRn, web } from '@/utils/platform-taro' const ToastDemo = () => { const [translated] = useTranslate({ @@ -36,7 +35,7 @@ const ToastDemo = () => { return ( <>
- + {translated.basic} {translated.toastFunction} diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index 2a6997f0d7..c05ab34fe4 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -85,27 +85,20 @@ font-weight: 500; text-align: center; } +.nut-toast-icon { + width: 24px; + height: 24px; + color: #ffffff; +} .nut-toast-icon-wrapper { width: 100%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; + color: #ffffff; } -.nut-toast-icon-wrapper .nut-icon { - width: 24px; - height: 24px; -} -.nut-toast-loading .nut-toast-inner { - display: inline-flex; - flex-direction: column; - justify-content: center; - align-items: center; -} -.nut-toast-loading .nut-toast-icon-wrapper { - animation: rotation 2s linear infinite; -} -.nut-toast-loading .nut-toast-icon-wrapper .nut-icon { +.nut-toast-icon-wrapper-icon { width: 24px; height: 24px; } diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index fb0b147890..d1a01ba0cd 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -98,14 +98,21 @@ text-align: $toast-inner-text-align; } + &-icon { + width: 24px; + height: 24px; + color: #ffffff; + } + &-icon-wrapper { width: 100%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; + color: #ffffff; - .nut-icon { + &-icon { width: 24px; height: 24px; } diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index 62a9582ed4..69447b3785 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -168,16 +168,22 @@ export const Toast: FunctionComponent< return !harmonyAndRn() ? { - success: , + success: ( + + ), fail: , warn: , loading: , }[type] : { - success: success, - fail: fail, - warn: warn, - loading: loading, + success: success, + fail: fail, + warn: warn, + loading: loading, }[type] } From 9354742370e8fd76373622f9b227e74e191c337e Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Thu, 31 Oct 2024 14:24:04 +0800 Subject: [PATCH 09/15] feat: tag icon --- src/packages/tag/demos/taro/demo2.tsx | 7 ++++--- src/packages/tag/tag.taro.tsx | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/packages/tag/demos/taro/demo2.tsx b/src/packages/tag/demos/taro/demo2.tsx index 09ba99c4a1..b23cc25211 100644 --- a/src/packages/tag/demos/taro/demo2.tsx +++ b/src/packages/tag/demos/taro/demo2.tsx @@ -2,6 +2,7 @@ import React from 'react' // import { Failure } from '@nutui/icons-react-taro' import { Cell, Tag } from '@nutui/nutui-react-taro' import Taro from '@tarojs/taro' +import { Icon } from '@tarojs/components' const Demo2 = () => { return ( @@ -32,7 +33,7 @@ const Demo2 = () => { onClose={() => Taro.showToast({ title: 'Tag closed' })} type="primary" > - 标签 + 标签0 } /> @@ -42,8 +43,8 @@ const Demo2 = () => { } + // closeIcon="C" + closeIcon={} onClose={() => Taro.showToast({ title: 'Tag closed' })} type="primary" > diff --git a/src/packages/tag/tag.taro.tsx b/src/packages/tag/tag.taro.tsx index b9ffcbe3d5..97efc2c750 100644 --- a/src/packages/tag/tag.taro.tsx +++ b/src/packages/tag/tag.taro.tsx @@ -5,7 +5,7 @@ import React, { ReactNode, } from 'react' import type { MouseEvent } from 'react' -import { View, ITouchEvent, Text } from '@tarojs/components' +import { View, ITouchEvent, Text, Icon } from '@tarojs/components' // import { Close } from '@nutui/icons-react-taro' import classNames from 'classnames' @@ -147,7 +147,8 @@ export const Tag: FunctionComponent> = (props) => { }} className={`${classPrefix}-custom-icon`} > - X + - + - )} From d718f7922e004e0207d53ebb2c37fd55b2d56199 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Wed, 6 Nov 2024 14:38:09 +0800 Subject: [PATCH 10/15] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4rn=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nutui-taro-demo-rn/src/app.config.ts | 136 ------------------ .../pages/pulltorefresh/index.config.ts | 3 - .../src/feedback/pages/toast/index.tsx | 2 - .../src/nav/pages/backtop/index.config.ts | 3 - 4 files changed, 144 deletions(-) delete mode 100644 packages/nutui-taro-demo-rn/src/app.config.ts delete mode 100644 packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts delete mode 100644 packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx delete mode 100644 packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts diff --git a/packages/nutui-taro-demo-rn/src/app.config.ts b/packages/nutui-taro-demo-rn/src/app.config.ts deleted file mode 100644 index 95ba9ce7c5..0000000000 --- a/packages/nutui-taro-demo-rn/src/app.config.ts +++ /dev/null @@ -1,136 +0,0 @@ - -const subPackages = [ - { - "root": "base", - "pages": [ - "pages/button/index", - "pages/cell/index", - "pages/configprovider/index", - "pages/icon/index", - "pages/image/index", - "pages/overlay/index" - ] - }, - { - "root": "layout", - "pages": [ - "pages/divider/index", - "pages/grid/index", - "pages/layout/index", - "pages/safearea/index", - "pages/space/index", - "pages/sticky/index" - ] - }, - { - "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" - ] - }, - { - "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": [ - "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": [ - "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" - ] - }, - { - "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": [ - "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'], - subPackages, - window: { - backgroundTextStyle: 'light', - navigationBarBackgroundColor: '#fff', - navigationBarTitleText: 'NutUI-React', - navigationBarTextStyle: 'black' - } -}) \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts b/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts deleted file mode 100644 index 350fc31c3f..0000000000 --- a/packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - navigationBarTitleText: 'PullToRefresh', -} \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx b/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx deleted file mode 100644 index 60274f68d9..0000000000 --- a/packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx +++ /dev/null @@ -1,2 +0,0 @@ -import Demo from '@/packages/toast/demo.taro'; -export default Demo; \ No newline at end of file diff --git a/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts b/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts deleted file mode 100644 index 1402945aee..0000000000 --- a/packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - navigationBarTitleText: 'BackTop', -} \ No newline at end of file From af347e32021adc1d7e77342a5ac0bda840b9753f Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Wed, 6 Nov 2024 14:51:05 +0800 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=E4=B8=8D=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=BB=84=E4=BB=B6=E5=93=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/overlay/overlay.harmony.css | 3 -- src/packages/tag/demos/taro/demo2.tsx | 7 ++-- src/packages/tag/tag.taro.tsx | 5 +-- src/packages/toast/toast.scss | 4 +- src/styles/variables-jrkf.scss | 48 +++++++++++------------- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/src/packages/overlay/overlay.harmony.css b/src/packages/overlay/overlay.harmony.css index 940e9f9f97..7dc90947a0 100644 --- a/src/packages/overlay/overlay.harmony.css +++ b/src/packages/overlay/overlay.harmony.css @@ -24,9 +24,6 @@ .nut-overflow-hidden { overflow: hidden !important; } -.nut-overflow-hidden .taro_page { - overflow: hidden !important; -} @keyframes nut-fade-in { 0% { diff --git a/src/packages/tag/demos/taro/demo2.tsx b/src/packages/tag/demos/taro/demo2.tsx index b23cc25211..09ba99c4a1 100644 --- a/src/packages/tag/demos/taro/demo2.tsx +++ b/src/packages/tag/demos/taro/demo2.tsx @@ -2,7 +2,6 @@ import React from 'react' // import { Failure } from '@nutui/icons-react-taro' import { Cell, Tag } from '@nutui/nutui-react-taro' import Taro from '@tarojs/taro' -import { Icon } from '@tarojs/components' const Demo2 = () => { return ( @@ -33,7 +32,7 @@ const Demo2 = () => { onClose={() => Taro.showToast({ title: 'Tag closed' })} type="primary" > - 标签0 + 标签 } /> @@ -43,8 +42,8 @@ const Demo2 = () => { } + closeIcon="C" + // closeIcon={} onClose={() => Taro.showToast({ title: 'Tag closed' })} type="primary" > diff --git a/src/packages/tag/tag.taro.tsx b/src/packages/tag/tag.taro.tsx index 97efc2c750..b9ffcbe3d5 100644 --- a/src/packages/tag/tag.taro.tsx +++ b/src/packages/tag/tag.taro.tsx @@ -5,7 +5,7 @@ import React, { ReactNode, } from 'react' import type { MouseEvent } from 'react' -import { View, ITouchEvent, Text, Icon } from '@tarojs/components' +import { View, ITouchEvent, Text } from '@tarojs/components' // import { Close } from '@nutui/icons-react-taro' import classNames from 'classnames' @@ -147,8 +147,7 @@ export const Tag: FunctionComponent> = (props) => { }} className={`${classPrefix}-custom-icon`} > - - - - + X )} diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index d1a01ba0cd..a3af6a9a7a 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -58,11 +58,11 @@ } &-small { - font-size: $font-size-small; + font-size: $font-size-s; } &-large { - font-size: $font-size-large; + font-size: $font-size-l; } } diff --git a/src/styles/variables-jrkf.scss b/src/styles/variables-jrkf.scss index ff65090025..7730842f40 100644 --- a/src/styles/variables-jrkf.scss +++ b/src/styles/variables-jrkf.scss @@ -192,9 +192,9 @@ $font-family: // Font $font-size-xxs: $font-text-mini !default; $font-size-xs: $font-text-xs !default; -$font-size-small: $font-text-small !default; +$font-size-s: $font-text-small !default; $font-size-base: $font-text !default; -$font-size-large: $font-text-large !default; +$font-size-l: $font-text-large !default; $font-size-xl: $font-h2 !default; $font-size-xxl: var(--nutui-font-size-8) !default; $font-size-xxxl: var(--nutui-font-size-10) !default; @@ -280,7 +280,7 @@ $button-large-padding: var( ) !default; $button-large-font-size: var( --nutui-button-large-font-size, - $font-size-large + $font-size-l ) !default; $button-large-font-weight: var( --nutui-button-large-font-weight, @@ -312,7 +312,7 @@ $button-mini-padding: var( $button-mini-height: var(--nutui-button-mini-height, 24px) !default; $button-mini-font-size: var( --nutui-button-mini-font-size, - $font-size-small + $font-size-s ) !default; $button-mini-border-radius: var( --nutui-button-mini-border-radius, @@ -408,7 +408,7 @@ $cell-title-font-size: var( ) !default; $cell-description-font-size: var( --nutui-cell-description-font-size, - $font-size-small + $font-size-s ) !default; $cell-description-color: var( --nutui-cell-description-color, @@ -461,7 +461,7 @@ $cell-group-description-color: var( ) !default; $cell-group-description-font-size: var( --nutui-cell-group-description-font-size, - $font-size-small + $font-size-s ) !default; $cell-group-description-line-height: var( --nutui-cell-group-description-line-height, @@ -478,7 +478,7 @@ $cell-group-wrap-margin: var(--nutui-cell-group-wrap-margin, 10px 0) !default; $divider-margin: var(--nutui-divider-margin, 16px 0) !default; $divider-text-font-size: var( --nutui-divider-text-font-size, - $font-size-small + $font-size-s ) !default; $divider-border-color: var( --nutui-divider-border-color, @@ -802,7 +802,7 @@ $numberkeyboard-key-color: var( ) !default; $numberkeyboard-key-confirm-font-size: var( --nutui-numberkeyboard-key-confirm-font-size, - $font-size-large + $font-size-l ) !default; $numberkeyboard-key-confirm-color: var( --nutui-numberkeyboard-key-confirm-color, @@ -1011,7 +1011,7 @@ $calendar-disable-color: var( ) !default; $calendar-base-font-size: var( --nutui-calendar-base-font-size, - $font-size-large + $font-size-l ) !default; $calendar-title-font-size: var( --nutui-calendar-title-font-size, @@ -1233,7 +1233,7 @@ $steps-base-icon-margin-bottom: var( ) !default; $steps-base-icon-font-size: var( --nutui-steps-base-icon-font-size, - $font-size-small + $font-size-s ) !default; $steps-base-line-width: var(--nutui-steps-base-line-width, 70%) !default; $steps-base-line-height: var(--nutui-steps-base-line-height, 1px) !default; @@ -1255,7 +1255,7 @@ $steps-base-title-margin-bottom: var( ) !default; $steps-base-description-font-size: var( --nutui-steps-base-description-font-size, - $font-size-small + $font-size-s ) !default; $steps-base-description-color: var( --nutui-steps-base-description-color, @@ -1392,7 +1392,7 @@ $dialog-footer-ok-max-width: var( ) !default; $dialog-header-font-size: var( --nutui-dialog-header-font-size, - $font-size-large + $font-size-l ) !default; $dialog-header-font-weight: var( --nutui-dialog-header-font-weight, @@ -1424,7 +1424,7 @@ $checkbox-label-font-size: var( ) !default; $checkbox-icon-font-size: var( --nutui-checkbox-icon-font-size, - $font-size-large + $font-size-l ) !default; $checkbox-button-font-size: var( --nutui-checkbox-button-font-size, @@ -1463,10 +1463,7 @@ $checkbox-list-item-padding: var( ) !default; //radio(✅) -$radio-icon-font-size: var( - --nutui-radio-icon-font-size, - $font-size-large -) !default; +$radio-icon-font-size: var(--nutui-radio-icon-font-size, $font-size-l) !default; $radio-label-color: var(--nutui-radio-label-color, $color-text) !default; $radio-label-disable-color: var( --nutui-radio-label-disable-color, @@ -1551,10 +1548,7 @@ $noticebar-background: var( rgba(251, 248, 220, 1) ) !default; $noticebar-color: var(--nutui-noticebar-color, #d9500b) !default; -$noticebar-font-size: var( - --nutui-noticebar-font-size, - $font-size-small -) !default; +$noticebar-font-size: var(--nutui-noticebar-font-size, $font-size-s) !default; $noticebar-line-height: var(--nutui-noticebar-line-height, 24px) !default; $noticebar-box-padding: var( --nutui-noticebar-box-padding, @@ -1790,7 +1784,7 @@ $tabs-titles-item-active-font-weight: var( ) !default; $tabs-titles-item-active-font-size: var( --nutui-tabs-titles-item-active-font-size, - $font-size-large + $font-size-l ) !default; $tabs-titles-item-active-background-color: var( --nutui-tabs-titles-item-active-background-color, @@ -2151,7 +2145,7 @@ $grid-item-text-color: var( ) !default; $grid-item-text-font-size: var( --nutui-grid-item-text-font-size, - $font-size-small + $font-size-s ) !default; // table(✅) @@ -2242,7 +2236,7 @@ $sidenavbar-sub-list-color: var( $elevator-list-bg-color: var(--nutui-elevator-list-bg-color, $white) !default; $elevator-list-font-size: var( --nutui-elevator-list-font-size, - $font-size-small + $font-size-s ) !default; $elevator-list-color: var( --nutui-elevator-list-color, @@ -2409,7 +2403,7 @@ $circleprogress-text-color: var( ) !default; $circleprogress-text-size: var( --nutui-circleprogress-text-size, - $font-size-large + $font-size-l ) !default; // Ellipsis @@ -2464,9 +2458,9 @@ $space-gap: var(--nutui-space-gap, 8px) !default; // loading $loading-icon-color: var(--nutui-loading-icon-color, $color-text-help) !default; -$loading-icon-size: var(--nutui-loading-icon-size, $font-size-small) !default; +$loading-icon-size: var(--nutui-loading-icon-size, $font-size-s) !default; $loading-color: var(--nutui-loading-color, $color-text-help) !default; -$loading-font-size: var(--nutui-loading-font-size, $font-size-small) !default; +$loading-font-size: var(--nutui-loading-font-size, $font-size-s) !default; // ResultPage $resultpage-width: var(--nutui-resultpage-width, 247px) !default; $resultpage-icon-size: var(--nutui-resultpage-icon-size, 48px) !default; From 60f47a2f7bcca8825f5b405fcc8304e1b21dd97e Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Wed, 6 Nov 2024 18:57:50 +0800 Subject: [PATCH 12/15] =?UTF-8?q?fix:=20=E7=AE=80=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81,=E4=BF=AE=E6=94=B9=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/__test__/toast.spec.tsx | 8 +++-- src/packages/toast/demos/taro/demo1.tsx | 16 ++++----- src/packages/toast/toast.taro.tsx | 41 ++++++++++------------ 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/packages/toast/__test__/toast.spec.tsx b/src/packages/toast/__test__/toast.spec.tsx index 426a945918..185f278bae 100644 --- a/src/packages/toast/__test__/toast.spec.tsx +++ b/src/packages/toast/__test__/toast.spec.tsx @@ -62,7 +62,9 @@ test('test toast props', async () => { fireEvent.click(getByTestId('emit-click')) expect(onClickToast).toBeCalled() expect(document.querySelector('.nut-toast-text')?.innerHTML).toBe('文案') - expect(document.querySelector('.nut-toast')).toHaveClass('nut-toast-small') + expect(document.querySelector('.nut-toast-inner')).toHaveClass( + 'nut-toast-inner-small' + ) expect(document.querySelector('.nut-toast')).toHaveClass( 'nut-toast-has-icon' ) @@ -83,7 +85,9 @@ test('event show-success-toast', async () => { await waitFor(() => { fireEvent.click(getByTestId('emit-click')) expect(onClickToast).toBeCalled() - expect(document.querySelector('.nut-icon')).toHaveClass('nut-icon-Check') + expect(document.querySelector('.nut-icon')).toHaveClass( + 'nut-icon nut-icon-Success' + ) expect(document.querySelector('.nut-toast-text')?.innerHTML).toBe('success') }) }) diff --git a/src/packages/toast/demos/taro/demo1.tsx b/src/packages/toast/demos/taro/demo1.tsx index e1dfca5484..c26eb81bcc 100644 --- a/src/packages/toast/demos/taro/demo1.tsx +++ b/src/packages/toast/demos/taro/demo1.tsx @@ -41,14 +41,14 @@ const Demo1 = () => { }} /> { openToast('text', '网络失败,请稍后再试~') setShowToast(true) }} /> { openToast( 'text', @@ -61,30 +61,30 @@ const Demo1 = () => { }} /> { - openToast('success', '成功提示') + openToast('success', '成功提示成功提示成功提示') setShowToast(true) }} /> { openToast('fail', '失败提示') setShowToast(true) }} /> { openToast('warn', '警告提示') setShowToast(true) }} /> { - openToast('loading', '加载中') + openToast('loading', '加载提示') setShowToast(true) }} /> diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index 2978f9292b..de345fa3dd 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -156,10 +156,7 @@ export const Toast: FunctionComponent< } const hasIcon = () => { - if (type !== 'text') { - return true - } - return !!icon + return type !== 'text' || !!icon } const iconName = () => { @@ -167,25 +164,23 @@ export const Toast: FunctionComponent< return icon } - return !harmonyAndRn() - ? { - success: ( - - ), - fail: , - warn: , - loading: , - }[type] - : { - success: success, - fail: fail, - warn: warn, - loading: loading, - }[type] + if (harmonyAndRn()) { + return { + success: success, + fail: fail, + warn: warn, + loading: loading, + }[type] + } + + return { + success: ( + + ), + fail: , + warn: , + loading: , + }[type] } const classes = classNames({ From 1100627ab3ae887ba628a7ffc9c3d62c7c17ca33 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Thu, 7 Nov 2024 13:34:02 +0800 Subject: [PATCH 13/15] =?UTF-8?q?fix:=20=E4=BF=AE=E8=AE=A2=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 64 +++++++++------------------- src/packages/toast/toast.harmony.css | 6 ++- src/packages/toast/toast.scss | 8 +++- src/packages/toast/toast.taro.tsx | 11 +---- 5 files changed, 35 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 05a417a4fa..20e8ea8076 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "dependencies": { "@babel/runtime": "^7.23.9", "@nutui/icons-react": "^1.0.5", - "@nutui/icons-react-taro": "^1.0.5", + "@nutui/icons-react-taro": "2.0.0-beta.0", "@nutui/jdesign-icons-react-taro": "1.0.6-beta.2", "@nutui/touch-emulator": "^1.0.0", "@react-spring/web": "~9.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6aea0aed2..7b08e62173 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,8 +19,8 @@ importers: specifier: ^1.0.5 version: 1.0.5 '@nutui/icons-react-taro': - specifier: ^1.0.5 - version: 1.0.5 + specifier: 2.0.0-beta.0 + version: 2.0.0-beta.0 '@nutui/jdesign-icons-react-taro': specifier: 1.0.6-beta.2 version: 1.0.6-beta.2 @@ -1615,8 +1615,8 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==, tarball: https://r2.cnpmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz} engines: {node: '>= 8'} - '@nutui/icons-react-taro@1.0.5': - resolution: {integrity: sha512-p7dCW29wASH/qQ1OaUGGKA6PRV33wDPb80+qrHnWtT40syIb0W+e92mpplbULWM01s+GYVGyUU3i8b7Iy7qfvw==} + '@nutui/icons-react-taro@2.0.0-beta.0': + resolution: {integrity: sha512-Wca6RWjy76fT9Co4T8PTjZCB/nzUxxyBR6efYl5tSKUJEvc6FPGHuA2FL6F0Gs9BBHo6ppTs02DRcSohX6UFWQ==} '@nutui/icons-react@1.0.5': resolution: {integrity: sha512-0TYl3Fk+sVz95DKqn/7isYAvaK5YGnaBwMMib4rqYLoqi9GGFwgU9rp2hYXu/X5IYdWgshj0xiuGMK75/vUYbQ==} @@ -1708,35 +1708,30 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-glibc@2.4.1': resolution: {integrity: sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.4.1': resolution: {integrity: sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.4.1': resolution: {integrity: sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.4.1': resolution: {integrity: sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-win32-arm64@2.4.1': resolution: {integrity: sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==} @@ -1987,55 +1982,46 @@ packages: resolution: {integrity: sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.24.3': resolution: {integrity: sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.24.3': resolution: {integrity: sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.24.3': resolution: {integrity: sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.24.3': resolution: {integrity: sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.24.3': resolution: {integrity: sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.24.3': resolution: {integrity: sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.24.3': resolution: {integrity: sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.24.3': resolution: {integrity: sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.24.3': resolution: {integrity: sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==} @@ -2145,56 +2131,48 @@ packages: engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [glibc] '@swc/core-linux-arm64-gnu@1.7.40': resolution: {integrity: sha512-v2fBlHJ/6Ovz0L2xFAI9TRiKyl9DTdx139PuAHD9gyzp16Utl/W0MPd4t2cYdkI6hPXE9PsJCSzMOrduh+YoDg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [glibc] '@swc/core-linux-arm64-musl@1.3.96': resolution: {integrity: sha512-i5/UTUwmJLri7zhtF6SAo/4QDQJDH2fhYJaBIUhrICmIkRO/ltURmpejqxsM/ye9Jqv5zG7VszMC0v/GYn/7BQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [musl] '@swc/core-linux-arm64-musl@1.7.40': resolution: {integrity: sha512-uMkduQuU4LFVkW6txv8AVArT8GjJVJ5IHoWloXaUBMT447iE8NALmpePdZWhMyj6KV7j0y23CM5rzV/I2eNGLg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [musl] '@swc/core-linux-x64-gnu@1.3.96': resolution: {integrity: sha512-USdaZu8lTIkm4Yf9cogct/j5eqtdZqTgcTib4I+NloUW0E/hySou3eSyp3V2UAA1qyuC72ld1otXuyKBna0YKQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [glibc] '@swc/core-linux-x64-gnu@1.7.40': resolution: {integrity: sha512-4LZdY1MBSnXyTpW5fpBU/+JGAhkuHT+VnFTDNegRboN5nSPh7y0Yvn4LmIioESV+sWzjKkEXujJPGjrp+oSp5w==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [glibc] '@swc/core-linux-x64-musl@1.3.96': resolution: {integrity: sha512-QYErutd+G2SNaCinUVobfL7jWWjGTI0QEoQ6hqTp7PxCJS/dmKmj3C5ZkvxRYcq7XcZt7ovrYCTwPTHzt6lZBg==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [musl] '@swc/core-linux-x64-musl@1.7.40': resolution: {integrity: sha512-FPjOwT3SgI6PAwH1O8bhOGBPzuvzOlzKeCtxLaCjruHJu9V8KKBrMTWOZT/FJyYC9mX5Ip1+l9j30UqUZdQxtA==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [musl] '@swc/core-win32-arm64-msvc@1.3.96': resolution: {integrity: sha512-hjGvvAduA3Un2cZ9iNP4xvTXOO4jL3G9iakhFsgVhpkU73SGmK7+LN8ZVBEu4oq2SUcHO6caWvnZ881cxGuSpg==} @@ -2403,7 +2381,7 @@ packages: resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==, tarball: https://r2.cnpmjs.org/@types/acorn/-/acorn-4.0.6.tgz} '@types/archy@0.0.31': - resolution: {integrity: sha512-v+dxizsFVyXgD3EpFuqT9YjdEjbJmPxNf1QIX9ohZOhxh1ZF2yhqv3vYaeum9lg3VghhxS5S0a6yldN9J9lPEQ==, tarball: https://r2.cnpmjs.org/@types/archy/-/archy-0.0.31.tgz} + resolution: {integrity: sha512-v+dxizsFVyXgD3EpFuqT9YjdEjbJmPxNf1QIX9ohZOhxh1ZF2yhqv3vYaeum9lg3VghhxS5S0a6yldN9J9lPEQ==} '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==, tarball: https://r2.cnpmjs.org/@types/argparse/-/argparse-1.0.38.tgz} @@ -2445,7 +2423,7 @@ packages: resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} '@types/glob@7.2.0': - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==, tarball: https://r2.cnpmjs.org/@types/glob/-/glob-7.2.0.tgz} + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} @@ -2777,10 +2755,10 @@ packages: resolution: {integrity: sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==} '@xtuc/ieee754@1.2.0': - resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==, tarball: https://r2.cnpmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz} + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} '@xtuc/long@4.2.2': - resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==, tarball: https://r2.cnpmjs.org/@xtuc/long/-/long-4.2.2.tgz} + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==, tarball: https://r2.cnpmjs.org/JSONStream/-/JSONStream-1.3.5.tgz} @@ -2927,7 +2905,7 @@ packages: resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==, tarball: https://r2.cnpmjs.org/arch/-/arch-2.2.0.tgz} archy@1.0.0: - resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==, tarball: https://r2.cnpmjs.org/archy/-/archy-1.0.0.tgz} + resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==, tarball: https://r2.cnpmjs.org/argparse/-/argparse-1.0.10.tgz} @@ -3523,7 +3501,7 @@ packages: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, tarball: https://r2.cnpmjs.org/commander/-/commander-2.20.3.tgz} commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==, tarball: https://r2.cnpmjs.org/commander/-/commander-4.1.1.tgz} + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} commander@6.2.1: @@ -4136,7 +4114,7 @@ packages: optional: true eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==, tarball: https://r2.cnpmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz} + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} eslint-scope@7.2.2: @@ -4171,7 +4149,7 @@ packages: engines: {node: '>=4.0'} estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==, tarball: https://r2.cnpmjs.org/estraverse/-/estraverse-4.3.0.tgz} + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} engines: {node: '>=4.0'} estraverse@5.3.0: @@ -4384,7 +4362,7 @@ packages: engines: {node: '>=18'} find-yarn-workspace-root@2.0.0: - resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==, tarball: https://r2.cnpmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz} + resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==} findup-sync@5.0.0: resolution: {integrity: sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==, tarball: https://r2.cnpmjs.org/findup-sync/-/findup-sync-5.0.0.tgz} @@ -4403,7 +4381,7 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==, tarball: https://r2.cnpmjs.org/flat/-/flat-5.0.2.tgz} + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true flatted@3.3.1: @@ -4573,7 +4551,7 @@ packages: engines: {node: '>=10.13.0'} glob-to-regexp@0.4.1: - resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==, tarball: https://r2.cnpmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz} + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} glob-watcher@6.0.0: resolution: {integrity: sha512-wGM28Ehmcnk2NqRORXFOTOR064L4imSw3EeOqU5bIwUf62eXGwg89WivH6VMahL8zlQHeodzvHpXplrqzrz3Nw==} @@ -4633,7 +4611,7 @@ packages: engines: {node: '>=18'} globs@0.1.4: - resolution: {integrity: sha512-D23dWbOq48vlOraoSigbcQV4tWrnhwk+E/Um2cMuDS3/5dwGmdFeA7L/vAvDhLFlQOTDqHcXh35m/71g2A2WzQ==, tarball: https://r2.cnpmjs.org/globs/-/globs-0.1.4.tgz} + resolution: {integrity: sha512-D23dWbOq48vlOraoSigbcQV4tWrnhwk+E/Um2cMuDS3/5dwGmdFeA7L/vAvDhLFlQOTDqHcXh35m/71g2A2WzQ==} glogg@2.2.0: resolution: {integrity: sha512-eWv1ds/zAlz+M1ioHsyKJomfY7jbDDPpwSkv14KQj89bycx1nvK5/2Cj/T9g7kzJcX5Bc7Yv22FjfBZS/jl94A==} @@ -5753,7 +5731,7 @@ packages: hasBin: true loglevel-plugin-prefix@0.8.4: - resolution: {integrity: sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==, tarball: https://r2.cnpmjs.org/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz} + resolution: {integrity: sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==} loglevel@1.9.2: resolution: {integrity: sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==} @@ -6828,7 +6806,7 @@ packages: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==, tarball: https://r2.cnpmjs.org/queue/-/queue-6.0.2.tgz} randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==, tarball: https://r2.cnpmjs.org/randombytes/-/randombytes-2.1.0.tgz} + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==, tarball: https://r2.cnpmjs.org/range-parser/-/range-parser-1.2.1.tgz} @@ -7220,7 +7198,7 @@ packages: engines: {node: '>= 10.13.0'} scss-bundle@3.1.2: - resolution: {integrity: sha512-lvxTwCKDLgzmRWhGwJ834ggtnEhs0G9FxSJRWte+NwlshVvBcQ/kOHHkpAGDpCxIMNGz/Utl0yd/MWyQAOBhqg==, tarball: https://r2.cnpmjs.org/scss-bundle/-/scss-bundle-3.1.2.tgz} + resolution: {integrity: sha512-lvxTwCKDLgzmRWhGwJ834ggtnEhs0G9FxSJRWte+NwlshVvBcQ/kOHHkpAGDpCxIMNGz/Utl0yd/MWyQAOBhqg==} hasBin: true semver-greatest-satisfied-range@2.0.0: @@ -7598,7 +7576,7 @@ packages: engines: {node: ^14.18.0 || >=16.0.0} tapable@2.2.1: - resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==, tarball: https://r2.cnpmjs.org/tapable/-/tapable-2.2.1.tgz} + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} teex@1.0.1: @@ -9936,7 +9914,7 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nutui/icons-react-taro@1.0.5': {} + '@nutui/icons-react-taro@2.0.0-beta.0': {} '@nutui/icons-react@1.0.5': {} diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index c05ab34fe4..96e6807670 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -25,8 +25,12 @@ z-index: 1300; } .nut-toast-overlay-default { - background: rgba(0, 0, 0, 0); + /* #ifndef harmony */ + /* #endif */ + /* #ifdef harmony */ + background-color: rgba(0, 0, 0, 0); z-index: 1300; + /* #endif */ } .nut-toast-inner { position: absolute; diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index a3af6a9a7a..357872e9f8 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -27,8 +27,14 @@ z-index: 1300; &-overlay-default { - background: rgba(0, 0, 0, 0); + /* #ifndef harmony */ + --nutui-overlay-bg-color: rgba(0, 0, 0, 0); + --nutui-overlay-zIndex: 1300; + /* #endif */ + /* #ifdef harmony */ + background-color: rgba(0, 0, 0, 0); z-index: 1300; + /* #endif */ } &-inner { diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index de345fa3dd..ea9f6b8176 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -12,7 +12,7 @@ import { } from '@/utils/use-custom-event' import { usePropsValue } from '@/utils/use-props-value' import { useRtl } from '@/packages/configprovider/index.taro' -import { harmonyAndRn, harmony } from '@/utils/platform-taro' +import { harmony } from '@/utils/platform-taro' import { mergeProps } from '@/utils/merge-props' export type ToastPosition = 'top' | 'bottom' | 'center' @@ -164,15 +164,6 @@ export const Toast: FunctionComponent< return icon } - if (harmonyAndRn()) { - return { - success: success, - fail: fail, - warn: warn, - loading: loading, - }[type] - } - return { success: ( From 0febed800ec7bfc178ac21e6b5e37f2c79931be5 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Thu, 7 Nov 2024 13:41:39 +0800 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=E6=94=BE=E5=87=BAicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/demos/taro/demo2.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/toast/demos/taro/demo2.tsx b/src/packages/toast/demos/taro/demo2.tsx index 04949831c9..580a801087 100644 --- a/src/packages/toast/demos/taro/demo2.tsx +++ b/src/packages/toast/demos/taro/demo2.tsx @@ -1,5 +1,5 @@ import React from 'react' -// import { Jd } from '@nutui/icons-react-taro' +import { Jd } from '@nutui/icons-react-taro' import { Cell, Toast } from '@nutui/nutui-react-taro' const Demo5 = () => { @@ -14,7 +14,7 @@ const Demo5 = () => { type: 'fail', duration: 2, position: 'center', - // icon: , + icon: , lockScroll: true, onClose: () => { console.log('close') From 03c12f82495531a202885dc2fe535e61cda05e57 Mon Sep 17 00:00:00 2001 From: hanyuxinting Date: Thu, 7 Nov 2024 17:16:49 +0800 Subject: [PATCH 15/15] =?UTF-8?q?fix:=20=E5=8C=BA=E5=88=86web=E5=92=8Ctaro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/toast/toast.harmony.css | 8 +++++--- src/packages/toast/toast.scss | 11 +++++++++-- src/packages/toast/toast.taro.tsx | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/packages/toast/toast.harmony.css b/src/packages/toast/toast.harmony.css index 96e6807670..3358c5816d 100644 --- a/src/packages/toast/toast.harmony.css +++ b/src/packages/toast/toast.harmony.css @@ -24,16 +24,18 @@ pointer-events: none; z-index: 1300; } -.nut-toast-overlay-default { - /* #ifndef harmony */ - /* #endif */ +.nut-toast-overlay-default-taro { /* #ifdef harmony */ background-color: rgba(0, 0, 0, 0); z-index: 1300; /* #endif */ + /* #ifndef harmony */ + /* #endif */ } .nut-toast-inner { position: absolute; + top: 50%; + transform: translate(0, -50%); display: flex; flex-direction: column; justify-content: center; diff --git a/src/packages/toast/toast.scss b/src/packages/toast/toast.scss index 357872e9f8..78af89391c 100644 --- a/src/packages/toast/toast.scss +++ b/src/packages/toast/toast.scss @@ -27,18 +27,25 @@ z-index: 1300; &-overlay-default { - /* #ifndef harmony */ --nutui-overlay-bg-color: rgba(0, 0, 0, 0); --nutui-overlay-zIndex: 1300; - /* #endif */ + } + + &-overlay-default-taro { /* #ifdef harmony */ background-color: rgba(0, 0, 0, 0); z-index: 1300; /* #endif */ + /* #ifndef harmony */ + --nutui-overlay-bg-color: rgba(0, 0, 0, 0); + --nutui-overlay-zIndex: 1300; + /* #endif */ } &-inner { position: absolute; + top: $toast-inner-top; + transform: translate(-0, -50%); display: flex; flex-direction: column; justify-content: center; diff --git a/src/packages/toast/toast.taro.tsx b/src/packages/toast/toast.taro.tsx index ea9f6b8176..2e3d059480 100644 --- a/src/packages/toast/toast.taro.tsx +++ b/src/packages/toast/toast.taro.tsx @@ -189,7 +189,7 @@ export const Toast: FunctionComponent< {