Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
87c4cb7d
N
nutui-react
项目概览
京东前端
/
nutui-react
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui-react
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
87c4cb7d
编写于
9月 06, 2022
作者:
O
oasis-cloud
提交者:
GitHub
9月 06, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 导入 taro 文件 (#273)
上级
7c19b449
变更
53
隐藏空白更改
内联
并排
Showing
53 changed file
with
347 addition
and
83 deletion
+347
-83
src/packages/actionsheet/actionsheet.taro.tsx
src/packages/actionsheet/actionsheet.taro.tsx
+1
-1
src/packages/address/address.taro.tsx
src/packages/address/address.taro.tsx
+3
-3
src/packages/avatar/avatar.taro.tsx
src/packages/avatar/avatar.taro.tsx
+1
-1
src/packages/backtop/backtop.taro.tsx
src/packages/backtop/backtop.taro.tsx
+1
-1
src/packages/badge/badge.taro.tsx
src/packages/badge/badge.taro.tsx
+1
-1
src/packages/button/button.taro.tsx
src/packages/button/button.taro.tsx
+1
-1
src/packages/calendar/calendar.taro.tsx
src/packages/calendar/calendar.taro.tsx
+2
-2
src/packages/calendaritem/calendaritem.taro.tsx
src/packages/calendaritem/calendaritem.taro.tsx
+1
-1
src/packages/card/card.taro.tsx
src/packages/card/card.taro.tsx
+2
-2
src/packages/cell/cell.taro.tsx
src/packages/cell/cell.taro.tsx
+1
-1
src/packages/checkbox/checkbox.taro.tsx
src/packages/checkbox/checkbox.taro.tsx
+2
-2
src/packages/collapseitem/collapseitem.taro.tsx
src/packages/collapseitem/collapseitem.taro.tsx
+154
-0
src/packages/countdown/countdown.taro.tsx
src/packages/countdown/countdown.taro.tsx
+1
-1
src/packages/dialog/dialog.taro.tsx
src/packages/dialog/dialog.taro.tsx
+2
-2
src/packages/empty/empty.taro.tsx
src/packages/empty/empty.taro.tsx
+1
-1
src/packages/fixednav/fixednav.taro.tsx
src/packages/fixednav/fixednav.taro.tsx
+4
-4
src/packages/grid/grid.taro.tsx
src/packages/grid/grid.taro.tsx
+1
-1
src/packages/griditem/griditem.taro.tsx
src/packages/griditem/griditem.taro.tsx
+2
-2
src/packages/imagepreview/imagepreview.taro.tsx
src/packages/imagepreview/imagepreview.taro.tsx
+4
-4
src/packages/infiniteloading/infiniteloading.taro.tsx
src/packages/infiniteloading/infiniteloading.taro.tsx
+2
-2
src/packages/input/input.taro.tsx
src/packages/input/input.taro.tsx
+2
-2
src/packages/inputnumber/inputnumber.taro.tsx
src/packages/inputnumber/inputnumber.taro.tsx
+1
-1
src/packages/menuitem/menuitem.taro.tsx
src/packages/menuitem/menuitem.taro.tsx
+1
-1
src/packages/navbar/navbar.taro.tsx
src/packages/navbar/navbar.taro.tsx
+1
-1
src/packages/noticebar/noticebar.taro.tsx
src/packages/noticebar/noticebar.taro.tsx
+1
-1
src/packages/numberkeyboard/numberkeyboard.taro.tsx
src/packages/numberkeyboard/numberkeyboard.taro.tsx
+2
-2
src/packages/pagination/pagination.taro.tsx
src/packages/pagination/pagination.taro.tsx
+1
-1
src/packages/picker/picker.taro.tsx
src/packages/picker/picker.taro.tsx
+1
-1
src/packages/popover/popover.taro.tsx
src/packages/popover/popover.taro.tsx
+2
-2
src/packages/popup/popup.taro.tsx
src/packages/popup/popup.taro.tsx
+6
-3
src/packages/progress/progress.taro.tsx
src/packages/progress/progress.taro.tsx
+1
-1
src/packages/pulltorefresh/pulltorefresh.taro.tsx
src/packages/pulltorefresh/pulltorefresh.taro.tsx
+1
-1
src/packages/radio/radio.taro.tsx
src/packages/radio/radio.taro.tsx
+2
-2
src/packages/radiogroup/index.taro.ts
src/packages/radiogroup/index.taro.ts
+1
-1
src/packages/radiogroup/radiogroup.taro.tsx
src/packages/radiogroup/radiogroup.taro.tsx
+109
-0
src/packages/range/range.taro.tsx
src/packages/range/range.taro.tsx
+2
-2
src/packages/rate/rate.taro.tsx
src/packages/rate/rate.taro.tsx
+1
-1
src/packages/searchbar/searchbar.taro.tsx
src/packages/searchbar/searchbar.taro.tsx
+2
-2
src/packages/shortpassword/shortpassword.taro.tsx
src/packages/shortpassword/shortpassword.taro.tsx
+3
-3
src/packages/sidenavbar/sidenavbar.taro.tsx
src/packages/sidenavbar/sidenavbar.taro.tsx
+2
-3
src/packages/sidenavbaritem/sidenavbaritem.taro.tsx
src/packages/sidenavbaritem/sidenavbaritem.taro.tsx
+0
-1
src/packages/signature/signature.taro.tsx
src/packages/signature/signature.taro.tsx
+2
-2
src/packages/skeleton/skeleton.taro.tsx
src/packages/skeleton/skeleton.taro.tsx
+1
-1
src/packages/tabbaritem/tabbaritem.taro.tsx
src/packages/tabbaritem/tabbaritem.taro.tsx
+1
-1
src/packages/table/table.taro.tsx
src/packages/table/table.taro.tsx
+2
-2
src/packages/tabs/tabs.taro.tsx
src/packages/tabs/tabs.taro.tsx
+1
-1
src/packages/tag/tag.taro.tsx
src/packages/tag/tag.taro.tsx
+1
-1
src/packages/textarea/textarea.taro.tsx
src/packages/textarea/textarea.taro.tsx
+1
-1
src/packages/timedetail/timedetail.taro.tsx
src/packages/timedetail/timedetail.taro.tsx
+1
-1
src/packages/timepannel/timepannel.taro.tsx
src/packages/timepannel/timepannel.taro.tsx
+1
-1
src/packages/timeselect/timeselect.taro.tsx
src/packages/timeselect/timeselect.taro.tsx
+5
-5
src/packages/uploader/uploader.taro.tsx
src/packages/uploader/uploader.taro.tsx
+1
-1
src/packages/virtuallist/virtuallist.taro.tsx
src/packages/virtuallist/virtuallist.taro.tsx
+1
-1
未找到文件。
src/packages/actionsheet/actionsheet.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
Popup
from
'
@/packages/popup
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
bem
from
'
@/utils/bem
'
export
type
ItemType
<
T
>
=
{
[
key
:
string
]:
T
}
...
...
src/packages/address/address.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -4,12 +4,12 @@ import React, {
useState
,
CSSProperties
,
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Popup
from
'
@/packages/popup
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
ExistRender
}
from
'
./existRender
'
import
{
CustomRender
}
from
'
./customRender
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
{
RegionData
,
NextListObj
,
...
...
src/packages/avatar/avatar.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -9,7 +9,7 @@ import React, {
import
classNames
from
'
classnames
'
import
{
AvatarContext
}
from
'
@/packages/avatargroup/AvatarContext
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
AvatarProps
{
size
:
string
...
...
src/packages/backtop/backtop.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
useRef
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
declare
const
window
:
any
export
interface
BackTopProps
{
...
...
src/packages/badge/badge.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
CSSProperties
,
FunctionComponent
,
ReactNode
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
BadgeProps
{
value
:
any
...
...
src/packages/button/button.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -5,7 +5,7 @@ import React, {
useEffect
,
useState
,
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
ButtonProps
{
className
:
string
...
...
src/packages/calendar/calendar.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
Popup
from
'
@/packages/popup
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
CalendarItem
from
'
@/packages/calendaritem/index.taro
'
import
Utils
from
'
@/utils/date
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
CalendarProps
{
type
?:
string
...
...
src/packages/calendaritem/calendaritem.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -3,7 +3,7 @@ import classNames from 'classnames'
import
bem
from
'
@/utils/bem
'
import
Utils
from
'
@/utils/date
'
import
requestAniFrame
from
'
@/utils/raf
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
{
getRectByTaro
}
from
'
../../utils/useClientRect
'
type
InputDate
=
string
|
string
[]
...
...
src/packages/card/card.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
Price
from
'
@/packages/price
'
import
Tag
from
'
@/packages/tag
'
import
Price
from
'
@/packages/price
/index.taro
'
import
Tag
from
'
@/packages/tag
/index.taro
'
import
bem
from
'
@/utils/bem
'
...
...
src/packages/cell/cell.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -2,7 +2,7 @@ import React, { FunctionComponent, ReactNode } from 'react'
import
{
useHistory
}
from
'
react-router-dom
'
import
Taro
from
'
@tarojs/taro
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
CellProps
{
title
:
ReactNode
...
...
src/packages/checkbox/checkbox.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
CheckboxGroup
from
'
@/packages/checkboxgroup
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
CheckboxGroup
from
'
@/packages/checkboxgroup
/index.taro
'
import
bem
from
'
@/utils/bem
'
...
...
src/packages/collapseitem/collapseitem.taro.tsx
0 → 100644
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
useCallback
,
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon/index.taro
'
export
interface
CollapseItemProps
{
title
:
string
name
:
string
isOpen
:
boolean
icon
:
string
iconSize
:
string
iconColor
:
string
disabled
:
boolean
rotate
:
number
subTitle
:
string
titleIcon
:
string
titleIconColor
:
string
titleIconPosition
:
string
titleIconSize
:
string
onToggle
:
(
isOpen
:
boolean
,
name
:
string
)
=>
void
}
const
defaultProps
=
{
title
:
''
,
name
:
''
,
isOpen
:
false
,
icon
:
''
,
iconSize
:
''
,
iconColor
:
''
,
disabled
:
false
,
rotate
:
180
,
subTitle
:
''
,
titleIcon
:
''
,
titleIconColor
:
''
,
titleIconPosition
:
''
,
titleIconSize
:
''
,
}
as
CollapseItemProps
export
const
CollapseItem
:
FunctionComponent
<
Partial
<
CollapseItemProps
>
&
React
.
HTMLAttributes
<
HTMLDivElement
>
>
=
(
props
)
=>
{
const
{
children
,
title
,
isOpen
,
onToggle
,
name
,
disabled
,
icon
,
rotate
,
subTitle
,
titleIcon
,
titleIconColor
,
titleIconPosition
,
titleIconSize
,
iconSize
,
iconColor
,
...
rest
}
=
{
...
defaultProps
,
...
props
,
}
const
[
domHeight
,
setDomHeight
]
=
useState
(
-
1
)
// 保存content的高度
const
[
currHeight
,
setCurrHeight
]
=
useState
(
'
auto
'
)
// 设置content的高度
const
[
update
,
setUpdate
]
=
useState
(
false
)
const
[
iconStyle
,
setIconStyle
]
=
useState
({
transform
:
'
translateY(-50%)
'
,
})
const
colBem
=
bem
(
'
collapse-item
'
)
useEffect
(()
=>
{
setCurrHeight
(
'
auto
'
)
setUpdate
(
!
update
)
},
[
children
])
const
measuredRef
=
useCallback
(
(
node
:
HTMLDivElement
)
=>
{
if
(
node
!==
null
)
{
setDomHeight
(
node
.
getBoundingClientRect
().
height
)
}
},
[
update
]
)
useEffect
(()
=>
{
// 一开始content都有高度,在这里根据isOpen,改变其高度
setTimeout
(()
=>
{
if
(
domHeight
!==
-
1
)
{
isOpen
?
setCurrHeight
(
`
${
domHeight
}
px`
)
:
setCurrHeight
(
'
0px
'
)
}
const
newIconStyle
=
isOpen
?
{
transform
:
`translateY(-50%) rotate(
${
rotate
}
deg)`
}
:
{
transform
:
'
translateY(-50%)
'
}
setIconStyle
(
newIconStyle
)
},
10
)
},
[
isOpen
,
domHeight
,
rotate
])
return
(
<
div
className
=
{
colBem
()
}
{
...
rest
}
>
<
div
className
=
{
colBem
(
'
header
'
,
{
disabled
})
}
onClick
=
{
()
=>
{
if
(
disabled
)
return
onToggle
&&
onToggle
(
isOpen
,
name
)
}
}
>
<
div
className
=
{
colBem
(
'
title
'
)
}
>
{
titleIcon
&&
titleIconPosition
===
'
left
'
&&
(
<
b
className
=
{
colBem
(
'
title-icon-left
'
)
}
>
<
Icon
name
=
{
titleIcon
}
size
=
{
titleIconSize
}
color
=
{
disabled
?
'
#C2C2C2
'
:
titleIconColor
}
/>
</
b
>
)
}
{
title
}
{
titleIcon
&&
titleIconPosition
===
'
right
'
&&
(
<
b
className
=
{
colBem
(
'
title-icon-right
'
)
}
>
<
Icon
name
=
{
titleIcon
}
size
=
{
titleIconSize
}
color
=
{
disabled
?
'
#C2C2C2
'
:
titleIconColor
}
/>
</
b
>
)
}
</
div
>
<
div
className
=
{
colBem
(
'
sub-title
'
)
}
>
{
subTitle
}
</
div
>
<
div
className
=
{
colBem
(
'
icon-box
'
)
}
>
<
div
className
=
{
colBem
(
'
icon
'
)
}
style
=
{
iconStyle
}
>
<
Icon
name
=
{
icon
}
size
=
{
iconSize
}
color
=
{
disabled
?
'
#C2C2C2
'
:
iconColor
}
/>
</
div
>
</
div
>
</
div
>
<
div
className
=
{
colBem
(
'
content
'
)
}
style
=
{
{
height
:
currHeight
}
}
ref
=
{
measuredRef
}
>
<
div
className
=
{
colBem
(
'
content-text
'
)
}
>
{
children
}
</
div
>
</
div
>
</
div
>
)
}
CollapseItem
.
defaultProps
=
defaultProps
CollapseItem
.
displayName
=
'
NutCollapseItem
'
src/packages/countdown/countdown.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,7 +6,7 @@ import React, {
useEffect
,
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
CountDownProps
{
className
?:
string
...
...
src/packages/dialog/dialog.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -4,7 +4,7 @@ import React, {
forwardRef
,
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Button
from
'
@/packages/button
'
import
Button
from
'
@/packages/button
/index.taro
'
import
{
DialogWrapper
}
from
'
./DialogWrapper
'
import
confirm
from
'
./Confirm
'
import
{
...
...
@@ -13,7 +13,7 @@ import {
DialogComponent
,
ConfirmProps
,
}
from
'
./config
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
type
DialogProps
=
IDialogProps
const
defaultProps
=
{
...
...
src/packages/empty/empty.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
,
ReactNode
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
type
statusOptions
=
{
[
key
:
string
]:
string
...
...
src/packages/fixednav/fixednav.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
MouseEvent
,
HTMLProps
}
from
'
react
'
import
React
,
{
FunctionComponent
,
MouseEvent
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Icon
from
'
@/packages/icon
'
import
Overlay
from
'
@/packages/overlay
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
Overlay
from
'
@/packages/overlay
/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
type
Direction
=
'
right
'
|
'
left
'
type
Position
=
{
...
...
src/packages/grid/grid.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
CSSProperties
,
FunctionComponent
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
bem
from
'
@/utils/bem
'
export
type
GridDirection
=
'
horizontal
'
|
'
vertical
'
...
...
src/packages/griditem/griditem.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
CSSProperties
,
FunctionComponent
,
ReactNode
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
type
GridDirection
=
'
horizontal
'
|
'
vertical
'
...
...
src/packages/imagepreview/imagepreview.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,10 +6,10 @@ import React, {
useRef
,
TouchEvent
,
}
from
'
react
'
import
Popup
from
'
@/packages/popup
'
import
Video
from
'
@/packages/video
'
import
Swiper
from
'
@/packages/swiper
'
import
SwiperItem
from
'
@/packages/swiperitem
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
Video
from
'
@/packages/video
/index.taro
'
import
Swiper
from
'
@/packages/swiper
/index.taro
'
import
SwiperItem
from
'
@/packages/swiperitem
/index.taro
'
interface
IStore
{
scale
:
number
...
...
src/packages/infiniteloading/infiniteloading.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
useState
,
useEffect
,
useRef
,
FunctionComponent
}
from
'
react
'
import
classNames
from
'
classnames
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
InfiniteloadingProps
{
hasMore
:
boolean
...
...
src/packages/input/input.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -11,8 +11,8 @@ import React, {
}
from
'
react
'
import
{
formatNumber
}
from
'
./util
'
import
Icon
from
'
@/packages/icon
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
type
InputAlignType
=
'
left
'
|
'
center
'
|
'
right
'
// text-align
export
type
InputFormatTrigger
=
'
onChange
'
|
'
onBlur
'
// onChange: 在输入时执行格式化 ; onBlur: 在失焦时执行格式化
...
...
src/packages/inputnumber/inputnumber.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,7 +6,7 @@ import React, {
FocusEvent
,
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
bem
from
'
@/utils/bem
'
export
interface
InputNumberProps
{
...
...
src/packages/menuitem/menuitem.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
classnames
from
'
classnames
'
import
{
CSSTransition
}
from
'
react-transition-group
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
Icon
from
'
@/packages/icon/index.taro
'
import
{
Overlay
}
from
'
../overlay/overlay.taro
'
...
...
src/packages/navbar/navbar.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
bem
from
'
@/utils/bem
'
export
interface
NavBarProps
{
...
...
src/packages/noticebar/noticebar.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -8,7 +8,7 @@ import React, {
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
getRectByTaro
}
from
'
../../utils/useClientRect
'
...
...
src/packages/numberkeyboard/numberkeyboard.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,8 +6,8 @@ import React, {
}
from
'
react
'
import
classNames
from
'
classnames
'
import
bem
from
'
@/utils/bem
'
import
Popup
from
'
@/packages/popup
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
NextListObj
{
type
:
string
...
...
src/packages/pagination/pagination.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
bem
from
'
@/utils/bem
'
export
interface
PaginationProps
{
...
...
src/packages/picker/picker.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -8,7 +8,7 @@ import React, {
import
Popup
from
'
@/packages/popup
'
import
PickerSlot
from
'
./pickerSlot.taro
'
import
useRefs
from
'
@/utils/useRefs
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
bem
from
'
@/utils/bem
'
export
interface
PickerOption
{
...
...
src/packages/popover/popover.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,8 +6,8 @@ import React, {
useState
,
}
from
'
react
'
import
Trigger
from
'
./Trigger
'
import
Icon
from
'
@/packages/icon
'
import
Overlay
from
'
@/packages/overlay
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
Overlay
from
'
@/packages/overlay
/index.taro
'
import
{
getRectByTaro
}
from
'
../../utils/useClientRect
'
export
type
PopoverTheme
=
'
light
'
|
'
dark
'
...
...
src/packages/popup/popup.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -11,9 +11,12 @@ import { createPortal } from 'react-dom'
import
{
CSSTransition
}
from
'
react-transition-group
'
import
classNames
from
'
classnames
'
import
{
EnterHandler
,
ExitHandler
}
from
'
react-transition-group/Transition
'
import
{
OverlayProps
,
defaultOverlayProps
}
from
'
@/packages/overlay/overlay
'
import
Icon
from
'
@/packages/icon
'
import
Overlay
from
'
@/packages/overlay
'
import
{
OverlayProps
,
defaultOverlayProps
,
}
from
'
@/packages/overlay/overlay.taro
'
import
Icon
from
'
@/packages/icon/index.taro
'
import
Overlay
from
'
@/packages/overlay/index.taro
'
import
bem
from
'
@/utils/bem
'
type
Teleport
=
HTMLElement
|
(()
=>
HTMLElement
)
|
null
...
...
src/packages/progress/progress.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
CSSProperties
,
ReactNode
}
from
'
react
'
import
classNames
from
'
classnames
'
import
{
Icon
}
from
'
@/packages/icon/icon
'
import
{
Icon
}
from
'
@/packages/icon/icon
.taro
'
import
bem
from
'
@/utils/bem
'
export
type
ProgressSize
=
'
small
'
|
'
base
'
|
'
large
'
...
...
src/packages/pulltorefresh/pulltorefresh.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -7,7 +7,7 @@ import React, {
}
from
'
react
'
import
{
useDrag
}
from
'
@use-gesture/react
'
import
{
animated
,
useSpring
}
from
'
@react-spring/web
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
{
getScrollParent
}
from
'
@/utils/get-scroll-parent
'
import
{
rubberbandIfOutOfBounds
}
from
'
@/utils/rubberband
'
import
{
sleep
}
from
'
@/utils/sleep
'
...
...
src/packages/radio/radio.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -5,10 +5,10 @@ import React, {
useEffect
,
useState
,
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
RadioContext
from
'
./context
'
import
RadioGroup
from
'
@/packages/radiogroup
'
import
RadioGroup
from
'
@/packages/radiogroup
/index.taro
'
type
Shape
=
'
button
'
|
'
round
'
type
Position
=
'
right
'
|
'
left
'
...
...
src/packages/radiogroup/index.taro.ts
浏览文件 @
87c4cb7d
import
{
RadioGroup
}
from
'
./radiogroup
'
import
{
RadioGroup
}
from
'
./radiogroup
.taro
'
export
default
RadioGroup
src/packages/radiogroup/radiogroup.taro.tsx
0 → 100644
浏览文件 @
87c4cb7d
import
React
,
{
useEffect
,
useState
}
from
'
react
'
import
RadioContext
from
'
../radio/context
'
import
bem
from
'
@/utils/bem
'
type
Position
=
'
left
'
|
'
right
'
type
Direction
=
'
horizontal
'
|
'
vertical
'
export
interface
RadioGroupProps
{
value
:
string
|
number
|
boolean
|
null
textPosition
:
Position
direction
:
Direction
onChange
:
(
value
:
string
|
number
|
boolean
)
=>
void
}
const
defaultProps
=
{
value
:
null
,
textPosition
:
'
right
'
,
onChange
:
(
value
:
string
|
number
|
boolean
)
=>
{},
direction
:
'
vertical
'
,
}
as
RadioGroupProps
export
const
RadioGroup
=
React
.
forwardRef
(
(
props
:
Partial
<
RadioGroupProps
>
&
Omit
<
React
.
HTMLAttributes
<
HTMLDivElement
>
,
'
onChange
'
>
,
ref
)
=>
{
const
{
children
}
=
{
...
defaultProps
,
...
props
}
const
b
=
bem
(
'
RadioGroup
'
)
const
{
className
,
value
,
onChange
,
textPosition
,
direction
,
...
rest
}
=
props
const
[
val2State
,
setVal2State
]
=
useState
(
value
)
// useImperativeHandle(ref, () => ({
// toggleAll(state: boolean) {
// console.log(state)
// if (state === false) {
// setInnerValue([])
// } else {
// const childrenLabel: string[] = []
// React.Children.map(children, (child) => {
// const childProps = (child as any).props
// childrenLabel.push(childProps.label || (child as any).children)
// })
// setInnerValue(childrenLabel)
// }
// },
// }))
useEffect
(()
=>
{
setVal2State
(
value
)
},
[
value
])
// function handleChildChange(state: boolean, label: string) {
// if (innerValue) {
// let clippedValue = []
// if (state) {
// clippedValue = [...innerValue, label]
// } else {
// innerValue?.splice(innerValue?.indexOf(label), 1)
// clippedValue = [...innerValue]
// }
// setInnerValue(clippedValue)
// onChange && onChange(clippedValue)
// }
// }
function
validateChildChecked
(
child
:
any
)
{
if
(
val2State
===
null
)
return
false
return
val2State
===
child
.
props
.
value
}
function
cloneChildren
()
{
return
React
.
Children
.
map
(
children
,
(
child
:
any
,
index
)
=>
{
const
childChecked
=
validateChildChecked
(
child
)
if
((
child
as
any
).
type
.
displayName
!==
'
NutRadio
'
)
{
return
React
.
cloneElement
(
child
)
}
return
React
.
cloneElement
(
child
,
{
textPosition
,
checked
:
childChecked
,
// onChange: handleChildChange,
})
})
}
return
(
<
RadioContext
.
Provider
value
=
{
{
onChange
:
(
val
)
=>
{
setVal2State
(
val
)
onChange
&&
onChange
(
val
)
},
}
}
>
<
div
className
=
{
`nut-radiogroup nut-radiogroup--
${
props
.
direction
}
`
}
{
...
rest
}
>
{
cloneChildren
()
}
</
div
>
</
RadioContext
.
Provider
>
)
}
)
RadioGroup
.
defaultProps
=
defaultProps
RadioGroup
.
displayName
=
'
NutRadioGroup
'
src/packages/range/range.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -8,8 +8,8 @@ import React, {
}
from
'
react
'
import
{
useTouch
}
from
'
../../utils/useTouch
'
import
{
getRectByTaro
}
from
'
../../utils/useClientRect
'
import
Toast
from
'
@/packages/toast
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Toast
from
'
@/packages/toast
/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
type
SliderValue
=
number
|
number
[]
export
interface
RangeProps
{
...
...
src/packages/rate/rate.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
RateProps
{
count
:
string
|
number
...
...
src/packages/searchbar/searchbar.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useRef
,
useState
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Icon
from
'
@/packages/icon
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
Icon
from
'
@/packages/icon
/index.taro
'
type
TIconDirection
=
'
in-left
'
|
'
out-left
'
|
'
in-right
'
|
'
out-right
'
export
interface
SearchBarProps
{
...
...
src/packages/shortpassword/shortpassword.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -6,9 +6,9 @@ import React, {
useState
,
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
Popup
from
'
@/packages/popup
'
import
Icon
from
'
@/packages/icon
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
ShortPasswordProps
{
title
:
string
...
...
src/packages/sidenavbar/sidenavbar.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
Popup
from
'
@/packages/popup
'
// import { SideNavBarProps } from './type'
import
{
useConfig
}
from
'
@/packages/configprovider/configprovider.taro
'
import
Popup
from
'
@/packages/popup/index.taro
'
import
{
handleClick
}
from
'
./utils
'
import
{
OffsetContext
}
from
'
./offsetContext
'
...
...
src/packages/sidenavbaritem/sidenavbaritem.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
MouseEventHandler
}
from
'
react
'
// import { SideNavBarItemProps } from '../sidenavbar/type'
export
type
SideNavBarItemProps
=
{
title
:
string
ikey
:
string
|
number
...
...
src/packages/signature/signature.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useRef
,
useState
,
useEffect
}
from
'
react
'
import
Button
from
'
@/packages/button
'
import
Button
from
'
@/packages/button
/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
SignatureProps
{
type
:
string
...
...
src/packages/skeleton/skeleton.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
classNames
from
'
classnames
'
import
Avatar
from
'
@/packages/avatar
'
import
Avatar
from
'
@/packages/avatar
/index.taro
'
import
bem
from
'
@/utils/bem
'
type
avatarShape
=
'
round
'
|
'
square
'
...
...
src/packages/tabbaritem/tabbaritem.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -2,7 +2,7 @@ import React, { FunctionComponent, useEffect } from 'react'
import
{
useHistory
}
from
'
react-router-dom
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
TabbarItemProps
{
dot
:
boolean
...
...
src/packages/table/table.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
classNames
from
'
classnames
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
import
{
ITableProps
,
TableColumnProps
}
from
'
./types
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
type
TableProps
=
ITableProps
const
defaultProps
=
{
...
...
src/packages/tabs/tabs.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useRef
,
useState
}
from
'
react
'
import
classNames
from
'
classnames
'
import
bem
from
'
@/utils/bem
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
class
Title
{
title
=
''
...
...
src/packages/tag/tag.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -4,7 +4,7 @@ import React, {
useEffect
,
useState
,
}
from
'
react
'
import
Icon
from
'
@/packages/icon
'
import
Icon
from
'
@/packages/icon
/index.taro
'
export
interface
TagProps
{
type
:
TagType
...
...
src/packages/textarea/textarea.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -4,7 +4,7 @@ import React, {
useState
,
CSSProperties
,
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
bem
from
'
@/utils/bem
'
export
interface
TextAreaProps
{
...
...
src/packages/timedetail/timedetail.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
TimeType
{
key
?:
string
|
number
...
...
src/packages/timepannel/timepannel.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
}
from
'
react
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
interface
TimePannelProps
{
date
:
string
...
...
src/packages/timeselect/timeselect.taro.tsx
浏览文件 @
87c4cb7d
import
React
,
{
FunctionComponent
,
useEffect
,
useState
}
from
'
react
'
import
Popup
from
'
@/packages/popup
'
import
TimePannel
from
'
@/packages/timepannel
'
import
TimeDetail
from
'
@/packages/timedetail
'
import
Popup
from
'
@/packages/popup
/index.taro
'
import
TimePannel
from
'
@/packages/timepannel
/index.taro
'
import
TimeDetail
from
'
@/packages/timedetail
/index.taro
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
TimeType
}
from
'
@/packages/timedetail/timedetail
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
{
TimeType
}
from
'
@/packages/timedetail/timedetail
.taro
'
export
interface
DateType
{
'
pannel-key
'
?:
string
|
number
...
...
src/packages/uploader/uploader.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -9,7 +9,7 @@ import classNames from 'classnames'
import
Icon
from
'
@/packages/icon
'
import
{
Upload
,
UploadOptions
}
from
'
./upload
'
import
bem
from
'
@/utils/bem
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
export
type
FileType
<
T
>
=
{
[
key
:
string
]:
T
}
...
...
src/packages/virtuallist/virtuallist.taro.tsx
浏览文件 @
87c4cb7d
...
...
@@ -5,7 +5,7 @@ import React, {
useRef
,
useState
,
}
from
'
react
'
import
{
useConfig
}
from
'
@/packages/configprovider
'
import
{
useConfig
}
from
'
@/packages/configprovider
/configprovider.taro
'
import
{
IVirtualListProps
,
VirtualListState
,
PositionType
}
from
'
./type
'
import
{
initPositinoCache
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录