diff --git a/src/packages/actionsheet/actionsheet.taro.tsx b/src/packages/actionsheet/actionsheet.taro.tsx index 5f2cb60c4c..dd4d819027 100644 --- a/src/packages/actionsheet/actionsheet.taro.tsx +++ b/src/packages/actionsheet/actionsheet.taro.tsx @@ -1,4 +1,5 @@ import React, { FunctionComponent, ReactNode } from 'react' +import { View } from '@tarojs/components' import Popup, { PopupProps } from '@/packages/popup/index.taro' import { ComponentDefaults } from '@/utils/typings' @@ -70,12 +71,12 @@ export const ActionSheet: FunctionComponent< onCancel && onCancel() }} > -
+ {options.length ? ( -
+ {options.map((item, index) => { return ( -
chooseItem(item, index)} > {item[optionKey.name]} -
+ {item[optionKey.description]} -
-
+
+ ) })} -
+
) : ( children )} {cancelText && ( -
cancelActionSheet()} > {cancelText} -
+ )} -
-
+ + ) } diff --git a/src/packages/actionsheet/demos/taro/demo1.tsx b/src/packages/actionsheet/demos/taro/demo1.tsx index 3cc99246ed..ae5c0377b5 100644 --- a/src/packages/actionsheet/demos/taro/demo1.tsx +++ b/src/packages/actionsheet/demos/taro/demo1.tsx @@ -1,5 +1,6 @@ import React, { useState } from 'react' import { ActionSheet, Cell } from '@nutui/nutui-react-taro' +import { View } from '@tarojs/components' const Demo1 = () => { const [val, setVal] = useState('') @@ -25,7 +26,7 @@ const Demo1 = () => { <> setIsVisible(!isVisible)}> 基础用法 -
{val}
+ {val}
{ const [isVisible, setIsVisible] = useState(false) @@ -23,7 +24,7 @@ const Demo2 = () => { <> setIsVisible(!isVisible)}> 展示取消按钮 -
{val}
+ {val}
{ const [isVisible, setIsVisible] = useState(false) @@ -24,7 +25,7 @@ const Demo3 = () => { <> setIsVisible(!isVisible)}> 展示描述信息 -
{val}
+ {val}
{ const [isVisible, setIsVisible] = useState(false) @@ -16,8 +17,12 @@ const Demo5 = () => { }} onCancel={() => setIsVisible(false)} > -
新建表格
-
新建文档
+ + 新建表格 + + + 新建文档 +
) diff --git a/src/packages/audio/audio.taro.tsx b/src/packages/audio/audio.taro.tsx index db9bb63dba..62df5dfc7c 100644 --- a/src/packages/audio/audio.taro.tsx +++ b/src/packages/audio/audio.taro.tsx @@ -7,6 +7,7 @@ import React, { import { createInnerAudioContext, InnerAudioContext } from '@tarojs/taro' import { Service } from '@nutui/icons-react-taro' +import { View } from '@tarojs/components' import Range from '@/packages/range/index.taro' import Button from '@/packages/button/index.taro' import { useConfig } from '@/packages/configprovider/configprovider.taro' @@ -169,8 +170,8 @@ export const Audio: FunctionComponent< const renderIcon = () => { return ( <> -
-
+ -
-
+
+ ) } @@ -188,9 +189,9 @@ export const Audio: FunctionComponent< const renderProgerss = () => { return ( <> -
-
{currentDuration}
-
+ + {currentDuration} + setPercent(val)} @@ -200,12 +201,12 @@ export const Audio: FunctionComponent< inactive-color="#cccccc" active-color="#FF0F23" /> -
-
+ + {formatSeconds(`${totalSeconds}`) || '00:00:00'} -
-
-
+ + {locale.audio.forward || '快进'} -
+ ) } const renderNone = () => { return ( -
{children} -
+ ) } @@ -261,9 +262,9 @@ export const Audio: FunctionComponent< } return ( -
+ {renderAudio()} -
+ ) } diff --git a/src/packages/avatarcropper/avatarcropper.taro.tsx b/src/packages/avatarcropper/avatarcropper.taro.tsx index 2f6b3f0a66..4fb1b17b32 100644 --- a/src/packages/avatarcropper/avatarcropper.taro.tsx +++ b/src/packages/avatarcropper/avatarcropper.taro.tsx @@ -7,7 +7,7 @@ import React, { } from 'react' import Taro, { useReady, createSelectorQuery } from '@tarojs/taro' import classNames from 'classnames' -import { Canvas } from '@tarojs/components' +import { Canvas, View } from '@tarojs/components' import { Button } from '@/packages/button/button.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { useTouch } from '@/utils/use-touch' @@ -662,17 +662,17 @@ export const AvatarCropper: FunctionComponent> = ( const actions = [cancel, reset, rotate, confirm] return ( <> -
+ {actions.map((action, index) => ( -
action()} > {toolbar[index]} -
+
))} -
+ ) } @@ -681,7 +681,7 @@ export const AvatarCropper: FunctionComponent> = ( const { canvasId } = canvasAll return ( <> -
@@ -698,24 +698,24 @@ export const AvatarCropper: FunctionComponent> = ( onTouchMove={onTouchMove} onTouchEnd={onTouchEnd} > -
+
-
+ -
-
+ + ) } return ( <> -
+ {children} -
+ {editText} -
-
+ + {CropperPopup()} ) diff --git a/src/packages/avatarcropper/demo.taro.tsx b/src/packages/avatarcropper/demo.taro.tsx index adb8ec3507..0aecc34d1b 100644 --- a/src/packages/avatarcropper/demo.taro.tsx +++ b/src/packages/avatarcropper/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -27,16 +28,16 @@ const AvatarCropperDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} - -

{translated.toolbar}

+ {translated.toolbar} - -

{translated.round}

+ {translated.round} -
+ ) } diff --git a/src/packages/calendar/demo.taro.tsx b/src/packages/calendar/demo.taro.tsx index 010e26bdef..c2cd3b94ac 100644 --- a/src/packages/calendar/demo.taro.tsx +++ b/src/packages/calendar/demo.taro.tsx @@ -1,9 +1,9 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import './demo.scss' - import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' import Demo3 from './demos/taro/demo3' @@ -92,37 +92,23 @@ const CalendarDemo = () => { return ( <>
-
-

{translated.ce5c5446}

- + + {translated.ce5c5446} - - - - - - -

{translated.cfbdc781}

- + {translated.cfbdc781} - - -

{translated.d04fcbda}

- + {translated.d04fcbda} - - -

{translated.e51e4582}

- + {translated.e51e4582} -
+ ) } diff --git a/src/packages/calendar/demos/taro/demo6.tsx b/src/packages/calendar/demos/taro/demo6.tsx index 45ac299d91..93e78b6fff 100644 --- a/src/packages/calendar/demos/taro/demo6.tsx +++ b/src/packages/calendar/demos/taro/demo6.tsx @@ -5,6 +5,7 @@ import { DatePicker, CalendarDay, } from '@nutui/nutui-react-taro' +import { View } from '@tarojs/components' const padZero = (num: number | string, targetLength = 2) => { let str = `${num}` @@ -65,15 +66,15 @@ const Demo6 = () => { -
+ + {date && date.length ? `${date[0]} ${desc1}` : '请选择起始时间'} -
-
-
-
+ + - + {date && date.length ? `${date[1]} ${desc2}` : '请选择截止时间'} -
-
+ + } /> { onClose={closeSwitch} onConfirm={setChooseValue} > -
-
+ { showDatePicker(e, 1) }} > 开始时间:{desc1} -
+ - -
{ showDatePicker(e, 2) }} > 结束时间:{desc2} -
-
+ + { return ( -
+ {showTitle && ( -
+ {title || locale.calendaritem.title} -
+
)} {renderHeaderButtons && ( -
+ {renderHeaderButtons()} -
+ )} {showSubTitle && ( -
{yearMonthTitle}
+ {yearMonthTitle} )} -
+ {weeks.map((item: string) => ( -
+ {item} -
+
))} -
-
+ + ) } @@ -794,8 +794,8 @@ export const CalendarItem = React.forwardRef< onScroll={monthsViewScroll} ref={monthsRef} > -
-
+ { return ( -
-
+ + {month.title} -
-
+ + {month.monthData.map((day: CalendarDay, i: number) => ( -
-
+ {renderDay ? renderDay(day) : day.day} -
+ {!isStartTip(day, month) && renderDayTop && ( -
+ {renderDayTop(day)} -
+ )} {!isStartTip(day, month) && !isEndTip(day, month) && renderDayBottom && ( -
+ {renderDayBottom(day)} -
+ )} {!isStartTip(day, month) && !isEndTip(day, month) && !renderDayBottom && showToday && isCurrDay(month, day.day) && ( -
+ {locale.calendaritem.today} -
+ )} {isStartTip(day, month) && ( -
{startText || locale.calendaritem.start} -
+ )} {isEndTip(day, month) && ( -
+ {endText || locale.calendaritem.end} -
+ )} -
+
))} -
-
+
+ ) })} -
-
+ + ) } const renderFooter = () => { return ( -
+ {children} -
+ {confirmText || locale.confirm} -
-
+ + ) } return ( <> -
+ {renderHeader()} {renderContent()} {popup && !autoBackfill ? renderFooter() : ''} -
+ ) }) diff --git a/src/packages/cascader/cascader.taro.tsx b/src/packages/cascader/cascader.taro.tsx index cf8f94cab2..00a9d08f5e 100644 --- a/src/packages/cascader/cascader.taro.tsx +++ b/src/packages/cascader/cascader.taro.tsx @@ -9,7 +9,7 @@ import React, { } from 'react' import classNames from 'classnames' import { Loading, Checklist } from '@nutui/icons-react-taro' -import { ScrollView } from '@tarojs/components' +import { ScrollView, View } from '@tarojs/components' import { Popup, PopupProps } from '@/packages/popup/popup.taro' import { Tabs } from '@/packages/tabs/tabs.taro' import Tree, { convertListToOptions } from './utils' @@ -400,7 +400,7 @@ const InternalCascader: ForwardRefRenderFunction< } return ( -
-
{node.text}
+ {node.text} {node.loading ? ( ) : ( renderIcon() )} -
+ ) } const renderTabs = () => { return ( -
+ { return optionsData.map((pane, index) => ( -
{ setTabvalue(pane.paneKey) state.tabsCursor = index @@ -446,7 +446,7 @@ const InternalCascader: ForwardRefRenderFunction< {!(!state.initLoading && state.panes.length) && 'Loading...'} -
+
)) }} > @@ -462,11 +462,11 @@ const InternalCascader: ForwardRefRenderFunction< )) ) : ( -
+ )} -
+ ) } diff --git a/src/packages/cascader/demo.taro.tsx b/src/packages/cascader/demo.taro.tsx index 4227dbb103..2d889365c1 100644 --- a/src/packages/cascader/demo.taro.tsx +++ b/src/packages/cascader/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -40,20 +41,20 @@ const CascaderDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.title1}

+ {translated.title1} -

{translated.title2}

+ {translated.title2} -

{translated.title3}

+ {translated.title3} -

{translated.title4}

+ {translated.title4} -

{translated.title5}

+ {translated.title5} -
+ ) } diff --git a/src/packages/drag/demo.taro.tsx b/src/packages/drag/demo.taro.tsx index 3453ba2c45..26525bbe82 100644 --- a/src/packages/drag/demo.taro.tsx +++ b/src/packages/drag/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' @@ -35,19 +36,22 @@ const DragDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} - -

{translated.direction}

+ + {translated.direction} + - -

{translated.attract}

+ + {translated.attract} + - -

{translated.limitBoundaries}

+ + {translated.limitBoundaries} + -
+ ) } diff --git a/src/packages/elevator/demo.taro.tsx b/src/packages/elevator/demo.taro.tsx index 8fffb3be63..bd564640be 100644 --- a/src/packages/elevator/demo.taro.tsx +++ b/src/packages/elevator/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -155,28 +156,18 @@ const ElevatorDemo = () => { return ( <>
-
-

{translated.basic}

-
- -
-

{translated.customIndex}

-
- -
-

{translated.showKeys}

-
- -
-

{translated.sticky}

-
- -
-

{translated.customContent}

-
- -
-
+ + {translated.basic} + + {translated.customIndex} + + {translated.showKeys} + + {translated.sticky} + + {translated.customContent} + + ) } diff --git a/src/packages/elevator/elevator.taro.tsx b/src/packages/elevator/elevator.taro.tsx index 354aee0bd7..9e1aa69d18 100644 --- a/src/packages/elevator/elevator.taro.tsx +++ b/src/packages/elevator/elevator.taro.tsx @@ -7,7 +7,7 @@ import React, { } from 'react' import Taro, { nextTick, createSelectorQuery } from '@tarojs/taro' -import { ScrollView } from '@tarojs/components' +import { ScrollView, View } from '@tarojs/components' import classNames from 'classnames' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -222,7 +222,7 @@ export const Elevator: FunctionComponent< return (
-
@@ -241,17 +241,17 @@ export const Elevator: FunctionComponent< > {list.map((item: any, idx: number) => { return ( -
-
+ {item[floorKey]} -
+ <> {item.list.map((subitem: ElevatorData) => { return ( -
+ ) })} -
+ ) })} -
+ {showKeys ? ( <> {list.length && scrollStart ? ( -
{list[codeIndex][floorKey]} -
+ ) : null} -
-
+ touchStart(event)} onTouchMove={(event) => touchMove(event)} @@ -301,7 +301,7 @@ export const Elevator: FunctionComponent< > {list.map((item: any, index: number) => { return ( -
handleClickIndex(item[floorKey])} > {item[floorKey]} -
+
) })} -
-
+ + ) : null} {sticky && scrollY > 0 ? ( -
+ {list[codeIndex][floorKey]} -
+ ) : null}
) diff --git a/src/packages/ellipsis/demo.taro.tsx b/src/packages/ellipsis/demo.taro.tsx index 7fe192afc4..c907aab0f9 100644 --- a/src/packages/ellipsis/demo.taro.tsx +++ b/src/packages/ellipsis/demo.taro.tsx @@ -1,8 +1,8 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' - import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' import Demo3 from './demos/taro/demo3' @@ -41,20 +41,20 @@ const EllipsisDemo = () => { return ( <>
-
-

{translated.header}

+ + {translated.header} -

{translated.end}

+ {translated.end} -

{translated.middle}

+ {translated.middle} -

{translated.rows}

+ {translated.rows} -

{translated.expandCollapse}

+ {translated.expandCollapse} -

{translated.width}

+ {translated.width} -
+ ) } diff --git a/src/packages/fixednav/demo.taro.tsx b/src/packages/fixednav/demo.taro.tsx index f9086afecd..c161ebe614 100644 --- a/src/packages/fixednav/demo.taro.tsx +++ b/src/packages/fixednav/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView } from '@tarojs/components' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' @@ -11,14 +12,14 @@ const FixedNavDemo = () => { return ( <>
-
+ {/* */} -
+ ) } diff --git a/src/packages/fixednav/fixednav.taro.tsx b/src/packages/fixednav/fixednav.taro.tsx index 1403ce2639..ae59d2b78d 100644 --- a/src/packages/fixednav/fixednav.taro.tsx +++ b/src/packages/fixednav/fixednav.taro.tsx @@ -1,6 +1,7 @@ import React, { FunctionComponent, MouseEvent } from 'react' import classNames from 'classnames' import { ArrowLeft } from '@nutui/icons-react-taro' +import { View } from '@tarojs/components' import Overlay from '@/packages/overlay/index.taro' import { useConfig } from '@/packages/configprovider/configprovider.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -97,12 +98,12 @@ export const FixedNav: FunctionComponent< onClick={() => onUpdateValue(false)} /> )} -
+ {children || ( -
+ {list.map((item: any, index) => { return ( -
handleClick(item, event)} key={item.id || index} @@ -112,27 +113,29 @@ export const FixedNav: FunctionComponent< ) : ( )} -
{item.text}
- {item.num &&
{item.num}
} -
+ + {item.text} + + {item.num && {item.num}} +
) })} -
+
)} -
+ -
onUpdateValue()}> + onUpdateValue()}> {content || ( <> -
+ {visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText} -
+
)} -
+
) } diff --git a/src/packages/form/demo.taro.tsx b/src/packages/form/demo.taro.tsx index 3881c4d845..f1a8072cb0 100644 --- a/src/packages/form/demo.taro.tsx +++ b/src/packages/form/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -35,22 +36,22 @@ const FormDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.title2}

+ {translated.title2} -

{translated.relatedDisplay}

+ {translated.relatedDisplay} -

{translated.title3}

+ {translated.title3} -

{translated.title4}

+ {translated.title4} -

{translated.validateTrigger}

+ {translated.validateTrigger} -

{translated.title5}

+ {translated.title5} -
+ ) } diff --git a/src/packages/form/demos/taro/demo4.tsx b/src/packages/form/demos/taro/demo4.tsx index ec294daa3f..57a9860995 100644 --- a/src/packages/form/demos/taro/demo4.tsx +++ b/src/packages/form/demos/taro/demo4.tsx @@ -6,6 +6,7 @@ import { Button, type FormItemRuleWithoutValidator, } from '@nutui/nutui-react-taro' +import { View } from '@tarojs/components' const Demo4 = () => { const submitFailed = (error: any) => { @@ -36,7 +37,7 @@ const Demo4 = () => { onFinish={(values) => submitSucceed(values)} onFinishFailed={(values, errors) => submitFailed(errors)} footer={ -
{ -
+ } > { const pickerOptions = [ @@ -37,7 +38,7 @@ const Demo7 = () => {
{ -
+ } onFinish={(values) => submitSucceed(values)} onFinishFailed={(values, errors) => submitFailed(errors)} diff --git a/src/packages/formitem/formitem.taro.tsx b/src/packages/formitem/formitem.taro.tsx index 5d7e982303..e1c459df51 100644 --- a/src/packages/formitem/formitem.taro.tsx +++ b/src/packages/formitem/formitem.taro.tsx @@ -1,4 +1,5 @@ import React, { ReactNode } from 'react' +import { View } from '@tarojs/components' import { BaseFormField } from './types' import { Context } from '../form/context' import Cell from '@/packages/cell/index.taro' @@ -223,13 +224,13 @@ export class FormItem extends React.Component< } > {label ? ( -
+ {renderLabel} -
+ ) : null} -
-
{childNode}
-
+ {childNode} + {item?.[0]?.message} -
-
+ + ) } diff --git a/src/packages/infiniteloading/demo.taro.tsx b/src/packages/infiniteloading/demo.taro.tsx index 0a0564be11..8d30c4895f 100644 --- a/src/packages/infiniteloading/demo.taro.tsx +++ b/src/packages/infiniteloading/demo.taro.tsx @@ -1,8 +1,8 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' - import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' import Demo3 from './demos/taro/demo3' @@ -40,16 +40,16 @@ const InfiniteLoadingDemo = () => { return ( <>
-
-

{translated['84aa6bce']}

+ + {translated['84aa6bce']} -

{translated.eb4236fe}

+ {translated.eb4236fe} -

{translated['9ed40460']}

+ {translated['9ed40460']} -

{translated['1254a90d']}

+ {translated['1254a90d']} -
+ ) } diff --git a/src/packages/infiniteloading/infiniteloading.taro.tsx b/src/packages/infiniteloading/infiniteloading.taro.tsx index f0807d2432..7b23661834 100644 --- a/src/packages/infiniteloading/infiniteloading.taro.tsx +++ b/src/packages/infiniteloading/infiniteloading.taro.tsx @@ -6,7 +6,7 @@ import React, { useState, } from 'react' import classNames from 'classnames' -import { ScrollView, ScrollViewProps } from '@tarojs/components' +import { ScrollView, ScrollViewProps, View } from '@tarojs/components' import { createSelectorQuery } from '@tarojs/taro' import { useConfig } from '@/packages/configprovider/configprovider.taro' @@ -179,25 +179,25 @@ export const InfiniteLoading: FunctionComponent< onTouchEnd={touchEnd} {...rest} > -
-
+ + {pullingText || locale.infiniteloading.pullRefreshText} -
-
-
{children}
-
+ + + {children} + {isInfiniting ? ( -
+ {loadingText || locale.infiniteloading.loadText} -
+
) : ( !hasMore && ( -
+ {loadMoreText || locale.infiniteloading.loadMoreText} -
+ ) )} -
+ ) } diff --git a/src/packages/loading/demo.taro.tsx b/src/packages/loading/demo.taro.tsx index 2b1ce91d7b..6c08246534 100644 --- a/src/packages/loading/demo.taro.tsx +++ b/src/packages/loading/demo.taro.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { ScrollView, View } from '@tarojs/components' import Header from '@/sites/components/header' import { useTranslate } from '../../sites/assets/locale/taro' import Demo1 from './demos/taro/demo1' @@ -47,24 +48,24 @@ const LoadingDemo = () => { return ( <>
-
-

{translated.title1}

+ + {translated.title1} -

{translated.title2}

+ {translated.title2} -

{translated.title3}

+ {translated.title3} -

{translated.title4}

+ {translated.title4} -

{translated.title5}

+ {translated.title5} -

{translated.title6}

+ {translated.title6} -

{translated.title7}

+ {translated.title7} -

{translated.title8}

+ {translated.title8} -
+ ) } diff --git a/src/packages/loading/loading.taro.tsx b/src/packages/loading/loading.taro.tsx index 48113beb98..8cd916d5ff 100644 --- a/src/packages/loading/loading.taro.tsx +++ b/src/packages/loading/loading.taro.tsx @@ -4,6 +4,7 @@ import { Loading as IconLoading, Loading1 as IconLoading1, } from '@nutui/icons-react-taro' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' export type LoadingType = 'spinner' | 'circular' @@ -39,7 +40,7 @@ export const Loading: FunctionComponent< const CurLoadingIcon = loadingMap[rest.type] || IconLoading1 return ( -
-
+ {icon || } -
- {children ?
{children}
: ''} -
+ + {children ? ( + {children} + ) : ( + '' + )} + ) } diff --git a/src/packages/menu/demo.taro.tsx b/src/packages/menu/demo.taro.tsx index 07c754965c..d1df6c6ae9 100644 --- a/src/packages/menu/demo.taro.tsx +++ b/src/packages/menu/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -38,24 +39,26 @@ const MenuDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.controlled}

+ {translated.controlled} -

{translated.customMenuContent}

+ {translated.customMenuContent} -

{translated.twoColsInOneLine}

+ {translated.twoColsInOneLine} -

{translated.customActiveColor}

+ {translated.customActiveColor} -

{translated.customIcons}

+ {translated.customIcons} -

{translated.expandDirection}

+ {translated.expandDirection} -

{translated.disableMenu}

+ {translated.disableMenu} -
+ ) } diff --git a/src/packages/menu/menu.taro.tsx b/src/packages/menu/menu.taro.tsx index 78f591e006..c517f0ea02 100644 --- a/src/packages/menu/menu.taro.tsx +++ b/src/packages/menu/menu.taro.tsx @@ -1,6 +1,7 @@ import React, { FunctionComponent, useEffect, useRef, useState } from 'react' import classNames from 'classnames' import { ArrowDown, ArrowUp } from '@nutui/icons-react-taro' +import { View } from '@tarojs/components' import { OptionItem, MenuItem } from '@/packages/menuitem/menuitem.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -134,7 +135,7 @@ export const Menu: FunctionComponent> & { return '' } return ( -
> & { !disabled && toggleMenuItem(index) }} > -
{finallyTitle()}
+ {finallyTitle()} {icon || (direction === 'up' ? ( ) : ( ))} -
+ ) } return null }) } return ( -
-
{menuTitle()} -
+ {cloneChildren()} -
+ ) } diff --git a/src/packages/navbar/demo.taro.tsx b/src/packages/navbar/demo.taro.tsx index 4fa0f9456c..f31e7f983e 100644 --- a/src/packages/navbar/demo.taro.tsx +++ b/src/packages/navbar/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import './demo.scss' @@ -28,14 +29,14 @@ const NavBarDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.title1}

+ {translated.title1} -

{translated.title2}

+ {translated.title2} -
+ ) } diff --git a/src/packages/navbar/demos/taro/demo1.tsx b/src/packages/navbar/demos/taro/demo1.tsx index 3f9b4d5087..80a73e7d8a 100644 --- a/src/packages/navbar/demos/taro/demo1.tsx +++ b/src/packages/navbar/demos/taro/demo1.tsx @@ -2,6 +2,7 @@ import React from 'react' import { NavBar } from '@nutui/nutui-react-taro' import { Share, More, Cart, ArrowLeft, Close } from '@nutui/icons-react-taro' import Taro from '@tarojs/taro' +import { View } from '@tarojs/components' const Demo1 = () => { return ( @@ -33,12 +34,12 @@ const Demo1 = () => { back={} onBackClick={(e) => Taro.showToast({ title: '返回' })} > -
+ Taro.showToast({ title: '清空' })}> 浏览记录 浏览记录 -
+ } diff --git a/src/packages/navbar/demos/taro/demo2.tsx b/src/packages/navbar/demos/taro/demo2.tsx index 77104540ed..3ad124c61f 100644 --- a/src/packages/navbar/demos/taro/demo2.tsx +++ b/src/packages/navbar/demos/taro/demo2.tsx @@ -2,6 +2,7 @@ import React from 'react' import { NavBar } from '@nutui/nutui-react-taro' import { Share, More, Cart, ArrowLeft, Close } from '@nutui/icons-react-taro' import Taro from '@tarojs/taro' +import { View } from '@tarojs/components' const Demo2 = () => { return ( @@ -36,12 +37,12 @@ const Demo2 = () => { back={} onBackClick={(e) => Taro.showToast({ title: '返回' })} > -
+ Taro.showToast({ title: '清空' })}> 浏览记录 浏览记录 -
+
{ const [tab1value, setTab1value] = useState('0') @@ -26,7 +27,7 @@ const Demo3 = () => { } onBackClick={(e) => Taro.showToast({ title: '返回' })} > -
+ { @@ -41,7 +42,7 @@ const Demo3 = () => { Tab 3 Tab 4 -
+
{ return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.sidebar}

+ {translated.sidebar} -

{translated.randomKeyOrder}

+ {translated.randomKeyOrder} -

{translated.withTitle}

+ {translated.withTitle} -

{translated.idNumberKeyboard}

+ {translated.idNumberKeyboard} -

{translated.popup}

+ {translated.popup} -
+ ) } diff --git a/src/packages/numberkeyboard/numberkeyboard.taro.tsx b/src/packages/numberkeyboard/numberkeyboard.taro.tsx index 6b892ef90a..a82b0e9f15 100644 --- a/src/packages/numberkeyboard/numberkeyboard.taro.tsx +++ b/src/packages/numberkeyboard/numberkeyboard.taro.tsx @@ -114,8 +114,8 @@ export const NumberKeyboard: FunctionComponent< } } return ( -
-
+ onTouchEnd(item)} > {(item.type === 'num' || item.type === 'custom') && ( -
{item.id}
+ {item.id} )} {item.type === 'delete' && } {item.type === 'close' && } {item.type === 'confirm' && <>{confirmText || locale.done}} -
-
+ + ) } @@ -148,10 +148,10 @@ export const NumberKeyboard: FunctionComponent< overlayStyle={{ backgroundColor: 'rgba(0, 0, 0, 0)' }} {...rest} > -
+ {title && ( -
-
{title}
+ + {title} {type === 'default' && ( )} -
+
)} -
-
+ + {keysList?.map((item: any) => { return })} -
+ {type === 'rightColumn' && ( -
+ -
+ )} -
-
+ + ) } diff --git a/src/packages/picker/pickerpanel.taro.tsx b/src/packages/picker/pickerpanel.taro.tsx index 8a593f9eeb..8a5975c1c6 100644 --- a/src/packages/picker/pickerpanel.taro.tsx +++ b/src/packages/picker/pickerpanel.taro.tsx @@ -5,6 +5,7 @@ import React, { ForwardRefRenderFunction, useImperativeHandle, } from 'react' +import { View } from '@tarojs/components' import { PickerOption } from './types' import { useTouch } from '@/utils/use-touch' import { getRectByTaro } from '@/utils/get-rect-by-taro' @@ -264,8 +265,8 @@ const InternalPickerPanel: ForwardRefRenderFunction< }) return ( -
-
+ { return ( -
<>{item.text} -
+
) })} {/* 平铺 */} {!threeDimensional && options.map((item, index) => { return ( -
<>{item.text} -
+ ) })} -
-
-
-
+ + + + ) } const PickerPanel = React.forwardRef< diff --git a/src/packages/popover/popover.taro.tsx b/src/packages/popover/popover.taro.tsx index 7e6ffa60bf..4fcd3d5bb2 100644 --- a/src/packages/popover/popover.taro.tsx +++ b/src/packages/popover/popover.taro.tsx @@ -7,6 +7,7 @@ import React, { } from 'react' import classNames from 'classnames' import Taro, { createSelectorQuery } from '@tarojs/taro' +import { View } from '@tarojs/components' import Popup from '@/packages/popup/index.taro' import { PopupProps } from '@/packages/popup/popup.taro' import { getRectByTaro } from '@/utils/get-rect-by-taro' @@ -285,7 +286,7 @@ export const Popover: FunctionComponent< return ( <> {!targetId && ( -
{ @@ -299,9 +300,9 @@ export const Popover: FunctionComponent< style={style} > {Array.isArray(children) ? children[0] : children} -
+
)} -
+ -
+ {showArrow && ( -
+ )} {Array.isArray(children) ? children[1] : ''} {list.map((item, index) => { return ( -
handleSelect(item, index)} > {item.icon ? ( -
+ {item.icon} -
+ ) : null} -
{item.name}
+ + {item.name} + {item.action && item.action.icon ? ( -
item.action?.onClick?.(e)} > {item.action.icon} -
+ ) : null} -
+
) })} -
+
{showPopup && closeOnOutsideClick && ( -
)} -
+ ) } diff --git a/src/packages/shortpassword/demo.taro.tsx b/src/packages/shortpassword/demo.taro.tsx index cf8937ce31..3a7fc15acf 100644 --- a/src/packages/shortpassword/demo.taro.tsx +++ b/src/packages/shortpassword/demo.taro.tsx @@ -1,6 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' - +import { ScrollView, View } from '@tarojs/components' import Header from '@/sites/components/header' import { useTranslate } from '@/sites/assets/locale/taro' import Demo1 from './demos/taro/demo1' @@ -40,20 +40,20 @@ const ShortPasswordDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.displayPlain}

+ {translated.displayPlain} -

{translated.displayButton}

+ {translated.displayButton} -

{translated.customLength}

+ {translated.customLength} -

{translated.forgetPassword}

+ {translated.forgetPassword} -

{translated.autoFocus}

+ {translated.autoFocus} -
+ ) } diff --git a/src/packages/shortpassword/shortpassword.taro.tsx b/src/packages/shortpassword/shortpassword.taro.tsx index bb6d39f955..fd77534374 100644 --- a/src/packages/shortpassword/shortpassword.taro.tsx +++ b/src/packages/shortpassword/shortpassword.taro.tsx @@ -7,6 +7,7 @@ import React, { } from 'react' import { Tips } from '@nutui/icons-react-taro' import classNames from 'classnames' +import { View } from '@tarojs/components' import Popup from '@/packages/popup/index.taro' import { useConfig } from '@/packages/configprovider/index.taro' import { ComponentDefaults } from '@/utils/typings' @@ -133,55 +134,55 @@ export const InternalShortPassword: ForwardRefRenderFunction< onCloseIconClick={onClose} {...rest} > -
-
+ + {title || locale.shortpassword.title} -
-
+ + {description || locale.shortpassword.description} -
-
-
-
+ + + + {[...new Array(comLen).keys()].map((item, index) => { return ( -
+ {inputValue.length > index && ( <> {plain ? ( inputValue[index] ) : ( -
+ )} )} -
+
) })} -
-
-
-
{error}
-
+ + + + {error} + {tips || ( <> {locale.shortpassword.tips} )} -
-
+ + {!hideFooter && ( -
-
+ + {locale.cancel} -
-
+ + {locale.confirm} -
-
+ + )} -
+ ) } diff --git a/src/packages/sidenavbar/demo.taro.tsx b/src/packages/sidenavbar/demo.taro.tsx index 957fa2afef..ed46b557a2 100644 --- a/src/packages/sidenavbar/demo.taro.tsx +++ b/src/packages/sidenavbar/demo.taro.tsx @@ -1,6 +1,7 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -30,12 +31,12 @@ const SideNavBarDemo = () => { return ( <>
-
-

{text1}

+ + {text1} -

{text2}

+ {text2} -
+ ) } diff --git a/src/packages/sidenavbar/sidenavbar.taro.tsx b/src/packages/sidenavbar/sidenavbar.taro.tsx index 12edd53784..c2c89928bb 100644 --- a/src/packages/sidenavbar/sidenavbar.taro.tsx +++ b/src/packages/sidenavbar/sidenavbar.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, useState, ReactNode } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import Popup from '@/packages/popup/index.taro' import { OffsetContext } from './context' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -51,14 +52,14 @@ export const SideNavBar: FunctionComponent> = ( onClose={onClose} >
-
-
+ -
@@ -68,12 +69,12 @@ export const SideNavBar: FunctionComponent> = ( sidenavbarShow ? 'arrow-up' : 'arrow-down' }`} /> -
+
-
{children}
+ {children}
-
-
+ +
) diff --git a/src/packages/signature/demo.taro.tsx b/src/packages/signature/demo.taro.tsx index 65077cebad..4d87c33184 100644 --- a/src/packages/signature/demo.taro.tsx +++ b/src/packages/signature/demo.taro.tsx @@ -1,6 +1,7 @@ import './demo.scss' import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -25,16 +26,16 @@ const SignatureDemo = () => { return ( <>
-
-

{translated.basic}

+ {translated.basic} -

{translated.title}

+ {translated.title} -
+ ) } diff --git a/src/packages/signature/demos/taro/demo1.tsx b/src/packages/signature/demos/taro/demo1.tsx index 371f08cb23..857608f737 100644 --- a/src/packages/signature/demos/taro/demo1.tsx +++ b/src/packages/signature/demos/taro/demo1.tsx @@ -1,5 +1,6 @@ import React, { useRef } from 'react' import { Signature, Button } from '@nutui/nutui-react-taro' +import { View } from '@tarojs/components' const Demo1 = () => { const confirm = (dataurl: string, isSigned?: boolean) => { @@ -16,7 +17,7 @@ const Demo1 = () => { return ( <> -
+ -
+

Tips: 点击确认按钮,下方显示签名图片

) diff --git a/src/packages/signature/demos/taro/demo2.tsx b/src/packages/signature/demos/taro/demo2.tsx index fbaaebf8cd..500559e638 100644 --- a/src/packages/signature/demos/taro/demo2.tsx +++ b/src/packages/signature/demos/taro/demo2.tsx @@ -1,5 +1,6 @@ import React, { useRef } from 'react' import { Signature, Button } from '@nutui/nutui-react-taro' +import { View } from '@tarojs/components' const Demo2 = () => { const confirm = (dataurl: string) => { @@ -19,7 +20,7 @@ const Demo2 = () => { canvasId="testCanvas" ref={signatureRef1} /> -
+ -
+

Tips: 点击确认按钮,下方显示签名图片

) diff --git a/src/packages/signature/signature.taro.tsx b/src/packages/signature/signature.taro.tsx index e131733bab..2b4cde1761 100644 --- a/src/packages/signature/signature.taro.tsx +++ b/src/packages/signature/signature.taro.tsx @@ -13,6 +13,7 @@ import { canvasToTempFilePath, CanvasContext, } from '@tarojs/taro' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' export type SignatureType = 'jpg' | 'png' @@ -193,8 +194,8 @@ const InternalSignature: ForwardRefRenderFunction< }, []) return ( -
-
+ + {getEnv() === 'WEAPP' || getEnv() === 'JD' ? ( )} -
-
+ + ) } diff --git a/src/packages/sticky/sticky.taro.tsx b/src/packages/sticky/sticky.taro.tsx index d0a627aca4..46f53b757c 100644 --- a/src/packages/sticky/sticky.taro.tsx +++ b/src/packages/sticky/sticky.taro.tsx @@ -14,6 +14,7 @@ import { getSystemInfoSync, getEnv, } from '@tarojs/taro' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import useWatch from '@/utils/use-watch' import { getRectByTaro } from '@/utils/get-rect-by-taro' @@ -152,7 +153,7 @@ export const Sticky: FunctionComponent> = (props) => { className={classNames(classPrefix, className)} {...rest} > -
> = (props) => { style={stickyStyle} > {children} -
+
) } diff --git a/src/packages/subsidenavbar/subsidenavbar.taro.tsx b/src/packages/subsidenavbar/subsidenavbar.taro.tsx index 5b2e40409b..6597cbcd22 100644 --- a/src/packages/subsidenavbar/subsidenavbar.taro.tsx +++ b/src/packages/subsidenavbar/subsidenavbar.taro.tsx @@ -7,6 +7,7 @@ import React, { useContext, useState, } from 'react' +import { View } from '@tarojs/components' import { OffsetContext } from '../sidenavbar/context' export type SubSideNavBarProps = { @@ -89,10 +90,10 @@ export const SubSideNavBar: FunctionComponent = (props) => { return (
-
+ {title} -
-
{children}
+ + {children}
) } diff --git a/src/packages/tabbar/tabbar.taro.tsx b/src/packages/tabbar/tabbar.taro.tsx index 0fd5978f3e..bb9a938eb2 100644 --- a/src/packages/tabbar/tabbar.taro.tsx +++ b/src/packages/tabbar/tabbar.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { usePropsValue } from '@/utils/use-props-value' import TabbarItem from '../tabbaritem/index.taro' @@ -53,7 +54,7 @@ export const Tabbar: FunctionComponent> & { }) return ( -
> & { )} style={style} > -
+ > & { return React.cloneElement(child, { ...child.props, index }) })} -
- {(fixed || safeArea) &&
} -
+ + {(fixed || safeArea) && } + ) } diff --git a/src/packages/tabbaritem/tabbaritem.taro.tsx b/src/packages/tabbaritem/tabbaritem.taro.tsx index 4d6fdbfc0b..b6882312ee 100644 --- a/src/packages/tabbaritem/tabbaritem.taro.tsx +++ b/src/packages/tabbaritem/tabbaritem.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, ReactNode, useContext } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import Badge from '@/packages/badge/index.taro' import TabbarContext from '@/packages/tabbar/context' @@ -70,7 +71,7 @@ export const TabbarItem: FunctionComponent> = ( } return ( -
> = ( {icon ? ( <> -
{icon}
+ {icon}
-
{title}
+ {title} ) : ( -
{title}
+ {title}
)} -
+ ) } diff --git a/src/packages/table/demo.taro.tsx b/src/packages/table/demo.taro.tsx index 976466e994..06c4f5c2d9 100644 --- a/src/packages/table/demo.taro.tsx +++ b/src/packages/table/demo.taro.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react' import Taro from '@tarojs/taro' import { Toast } from '@nutui/nutui-react-taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -62,7 +63,7 @@ const TableDemo = () => { return ( <>
-
+ { setShow(false) }} /> -

{translated.basic}

+ {translated.basic} -

{translated.borderedAndAlign}

+ {translated.borderedAndAlign} -

{translated.summaryTitle}

+ {translated.summaryTitle} -

{translated.striped}

+ {translated.striped} -

{translated.hideHeader}

+ {translated.hideHeader} -

{translated.noDataTitle}

+ {translated.noDataTitle} -

{translated.customCell}

+ {translated.customCell} -

{translated.asynchronousRendering}

+ {translated.asynchronousRendering} -

{translated.sorting}

+ {translated.sorting} -

{translated.sorterIcon}

+ {translated.sorterIcon} -

{translated.stickyHeader}

+ {translated.stickyHeader} -

{translated.stickyLeftColumn}

+ {translated.stickyLeftColumn} -

{translated.stickyRightColumn}

+ {translated.stickyRightColumn} -

{translated.customRow}

+ {translated.customRow} -
+ ) } diff --git a/src/packages/table/table.taro.tsx b/src/packages/table/table.taro.tsx index 27cd843289..182de2ece7 100644 --- a/src/packages/table/table.taro.tsx +++ b/src/packages/table/table.taro.tsx @@ -1,6 +1,7 @@ import React, { FunctionComponent, useEffect, useRef } from 'react' import classNames from 'classnames' import { ArrowDown } from '@nutui/icons-react-taro' +import { View } from '@tarojs/components' import { BasicTableProps, TableColumnProps } from './types' import { useConfig, @@ -100,7 +101,7 @@ export const Table: FunctionComponent< const renderHeadCells = () => { return columns.map((item, index) => { return ( -
)} -
+ ) }) } @@ -131,7 +132,7 @@ export const Table: FunctionComponent< } return sortDataItem().map(([value, render]) => { return ( -
{typeof item[value] === 'function' || typeof render === 'function' ? ( -
{render ? render(item, rowIndex) : item[value](item)}
+ {render ? render(item, rowIndex) : item[value](item)} ) : ( item[value] )} -
+ ) }) } @@ -153,16 +154,16 @@ export const Table: FunctionComponent< const renderBodyTrs = () => { return innerValue.map((item, index) => { return ( -
+ {renderBodyTds(item, index)} -
+ ) }) } return (
-
-
{showHeader && ( -
-
{renderHeadCells()}
-
+ + {renderHeadCells()} + )} -
{renderBodyTrs()}
-
-
+ {renderBodyTrs()} + + {isSticky ? ( <> -
-
) : null} {(summary || innerValue.length === 0) && ( -
{summary || noData}
+ {summary || noData} )}
) diff --git a/src/packages/tabpane/tabpane.taro.tsx b/src/packages/tabpane/tabpane.taro.tsx index 45c000ae0f..8ed23089a7 100644 --- a/src/packages/tabpane/tabpane.taro.tsx +++ b/src/packages/tabpane/tabpane.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' interface TabPanelInnerProps { autoHeightClassName: string @@ -38,6 +39,6 @@ export const TabPane: FunctionComponent< ) return children ? ( -
{!disabled && children}
+ {!disabled && children} ) : null } diff --git a/src/packages/tabs/demos/taro/demo1.tsx b/src/packages/tabs/demos/taro/demo1.tsx index 2835e60e88..f28e4b1c88 100644 --- a/src/packages/tabs/demos/taro/demo1.tsx +++ b/src/packages/tabs/demos/taro/demo1.tsx @@ -4,18 +4,16 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo1 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo1 diff --git a/src/packages/tabs/demos/taro/demo2.tsx b/src/packages/tabs/demos/taro/demo2.tsx index 401008f4e4..51ed281ab1 100644 --- a/src/packages/tabs/demos/taro/demo2.tsx +++ b/src/packages/tabs/demos/taro/demo2.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo2 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - activeType="smile" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + activeType="smile" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo2 diff --git a/src/packages/tabs/demos/taro/demo3.tsx b/src/packages/tabs/demos/taro/demo3.tsx index 5f3e6ce2e9..ef31fa2c7d 100644 --- a/src/packages/tabs/demos/taro/demo3.tsx +++ b/src/packages/tabs/demos/taro/demo3.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo3 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - activeType="simple" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + activeType="simple" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo3 diff --git a/src/packages/tabs/demos/taro/demo4.tsx b/src/packages/tabs/demos/taro/demo4.tsx index e6396ad698..e52b95d172 100644 --- a/src/packages/tabs/demos/taro/demo4.tsx +++ b/src/packages/tabs/demos/taro/demo4.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo4 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - activeType="card" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + activeType="card" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo4 diff --git a/src/packages/tabs/demos/taro/demo5.tsx b/src/packages/tabs/demos/taro/demo5.tsx index dacdb8b418..9d220b42ad 100644 --- a/src/packages/tabs/demos/taro/demo5.tsx +++ b/src/packages/tabs/demos/taro/demo5.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo5 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - activeType="button" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + activeType="button" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo5 diff --git a/src/packages/tabs/demos/taro/demo6.tsx b/src/packages/tabs/demos/taro/demo6.tsx index cd26844a65..fac49ec462 100644 --- a/src/packages/tabs/demos/taro/demo6.tsx +++ b/src/packages/tabs/demos/taro/demo6.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo6 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - activeType="divider" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + activeType="divider" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo6 diff --git a/src/packages/tabs/demos/taro/demo7.tsx b/src/packages/tabs/demos/taro/demo7.tsx index 2d08cbd704..259657d358 100644 --- a/src/packages/tabs/demos/taro/demo7.tsx +++ b/src/packages/tabs/demos/taro/demo7.tsx @@ -4,19 +4,17 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo7 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - align="left" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + align="left" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo7 diff --git a/src/packages/tabs/demos/taro/demo8.tsx b/src/packages/tabs/demos/taro/demo8.tsx index 686413269b..49e3588b72 100644 --- a/src/packages/tabs/demos/taro/demo8.tsx +++ b/src/packages/tabs/demos/taro/demo8.tsx @@ -4,20 +4,18 @@ import { Tabs } from '@nutui/nutui-react-taro' const Demo8 = () => { const [tab1value, setTab1value] = useState('0') return ( - <> - { - setTab1value(value) - }} - align="left" - > - Tab 1 - Tab 2 - Tab 3 - - + { + setTab1value(value) + }} + align="left" + > + Tab 1 + Tab 2 + Tab 3 + ) } export default Demo8 diff --git a/src/packages/timedetail/timedetail.taro.tsx b/src/packages/timedetail/timedetail.taro.tsx index af8be2f105..afec88e42c 100644 --- a/src/packages/timedetail/timedetail.taro.tsx +++ b/src/packages/timedetail/timedetail.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, useCallback, useMemo } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { TimeType, @@ -60,9 +61,9 @@ export const TimeDetail: FunctionComponent< [activeTime, optionKey, activeDate] ) return ( -
+ {timeList[optionKey.childrenKey].map((item: TimeType) => ( - onSelect(item)} > {item[optionKey.textKey]} - + ))} -
+ ) } diff --git a/src/packages/timeselect/demo.taro.tsx b/src/packages/timeselect/demo.taro.tsx index c82b4bb155..309e5bcaee 100644 --- a/src/packages/timeselect/demo.taro.tsx +++ b/src/packages/timeselect/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -32,16 +33,16 @@ const TimeSelectDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.optionKey}

+ {translated.optionKey} -

{translated.multiple}

+ {translated.multiple} -

{translated.custom}

+ {translated.custom} -
+ ) } diff --git a/src/packages/timeselect/timeselect.taro.tsx b/src/packages/timeselect/timeselect.taro.tsx index f3bfe88d37..25724c3964 100644 --- a/src/packages/timeselect/timeselect.taro.tsx +++ b/src/packages/timeselect/timeselect.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, ReactNode, useState } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import Popup from '@/packages/popup/index.taro' import TimeDetail from '@/packages/timedetail/index.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -152,11 +153,11 @@ export const TimeSelect: FunctionComponent> = ( onClose={closeFun} {...rest} > -
-
-
+ + + {options.map((item: DateType) => ( -
> = ( onClick={() => handleChange(item)} > {item[optionKey.textKey]} -
+
))} -
+ > = ( activeTime={activeTime} onSelect={handleSelectTime} /> -
-
+ + ) } diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index 2536a579cb..d037fe8650 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import { Toast } from '@nutui/nutui-react-taro' +import { ScrollView, View } from '@tarojs/components' import Header from '@/sites/components/header' import { useTranslate } from '@/sites/assets/locale/taro' import Demo1 from './demos/taro/demo1' @@ -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/uploader/preview.taro.tsx b/src/packages/uploader/preview.taro.tsx index 1e79b66be9..6f9a39f7f5 100644 --- a/src/packages/uploader/preview.taro.tsx +++ b/src/packages/uploader/preview.taro.tsx @@ -5,7 +5,7 @@ import { Link as LinkIcon, Loading, } from '@nutui/icons-react-taro' -import { Image } from '@tarojs/components' +import { Image, View } from '@tarojs/components' import Progress from '@/packages/progress/index.taro' import { FileItem } from '@/packages/uploader/file-item.taro' import { ERROR } from '@/packages/uploader/utils' @@ -32,7 +32,7 @@ export const Preview: React.FunctionComponent = ({ {fileList.length !== 0 && fileList.map((item: any, index: number) => { return ( -
@@ -44,21 +44,21 @@ export const Preview: React.FunctionComponent = ({ /> )} {previewType === 'picture' && !children && ( -
+ {item.status === 'ready' ? ( -
-
+ + {item.message} -
-
+
+ ) : ( item.status !== 'success' && ( -
+ {renderIcon(item)} -
+ {item.message} -
-
+ + ) )} {item.type?.includes('image') ? ( @@ -83,33 +83,33 @@ export const Preview: React.FunctionComponent = ({ onClick={() => handleItemClick(item, index)} /> ) : ( -
-
+ handleItemClick(item, index)} className="nut-uploader-preview-img-file-name" >  {item.name} -
-
+ + )} )} {item.status === 'success' ? ( -
{item.name}
+ {item.name} ) : null} -
+ )} {previewType === 'list' && ( -
-
+ handleItemClick(item, index)} >  {item.name} -
+ {deletable && ( = ({ showText={false} /> )} -
+ )} -
+ ) })} diff --git a/src/packages/video/demo.taro.tsx b/src/packages/video/demo.taro.tsx index 3193c3df23..103a083e25 100644 --- a/src/packages/video/demo.taro.tsx +++ b/src/packages/video/demo.taro.tsx @@ -49,22 +49,16 @@ const VideoDemo = () => { > {translated.basic} - {translated.autoPlay} - {translated.muted} - {translated.cover} - {translated.inline} - {translated.background} - {translated.switch}