Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
929799b
fix: 为兼容 cpp 版本做的暂时性的牺牲改动 (#3325)
xiaoyatong Aug 7, 2025
7ee836a
Merge branch 'feat_v3.x' into feat_v3.x_cpp
xiaoyatong Aug 15, 2025
94c5073
chore: 升级版本号
xiaoyatong Aug 20, 2025
5dfd20f
feat(popup): 增加上下滑动修改高度
xiaoyatong Aug 20, 2025
bd12ee6
feat: 合并popup功能
xiaoyatong Aug 21, 2025
e47d0d4
feat(popup): 添加自定义顶部
xiaoyatong Aug 21, 2025
e7a4b1f
fix(input): taro 下只读可以点击
xiaoyatong Aug 21, 2025
75057e6
feat(popup): 增加一些新属性,顺便解决了下input的只读无法点击、焦点等问题 (#3342)
xiaoyatong Aug 21, 2025
7da9642
chore: 升级版本号
xiaoyatong Aug 29, 2025
08e97b5
feat: 新样式变量值更新,修订dialog暗黑问题
xiaoyatong Sep 3, 2025
3da0ec6
chore: 修改版本号
xiaoyatong Sep 20, 2025
e90b2b2
feat(popup): 增加top属性,支持自定义节点,,且不popup高度
xiaoyatong Sep 20, 2025
3cbfe75
chore: 修改版本号
xiaoyatong Sep 20, 2025
88462db
feat: 合并3.x 分支
xiaoyatong Sep 29, 2025
8ce8c51
Feat v3 cpp td (#3364)
xiaoyatong Sep 29, 2025
68c851b
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
32b4cea
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
4e6df5d
feat: 修订button在安卓下的问题
xiaoyatong Oct 3, 2025
cf0553a
fix(noticebar): 获取rect异常时不处理
xiaoyatong Oct 4, 2025
1509b39
feat(noticebar): 增加自定义children时的样式,重构部分代码
xiaoyatong Oct 5, 2025
710afd9
feat(input): 去掉lineheight
xiaoyatong Oct 5, 2025
2be0323
feat(checkbox): 增加选中态自定义类名
xiaoyatong Oct 5, 2025
2379441
fix: dialog规范及toast ios和安卓适配问题修订
xiaoyatong Oct 9, 2025
e7f84cc
fix(dialog): 适配ios和安卓,动效暂时屏蔽
xiaoyatong Oct 10, 2025
7054cee
fix(noticebar): 增加ref id
xiaoyatong Oct 13, 2025
93c518f
feat(dialog): demo
xiaoyatong Oct 13, 2025
1b997a4
fix: 去掉不支持的样式
xiaoyatong Oct 13, 2025
23dba7a
fix: 回跨不兼容样式处理
xiaoyatong Oct 14, 2025
0354507
fix: 回跨不兼容样式处理,不能暴露~~
xiaoyatong Oct 14, 2025
dadca5b
fix: setTimeout 改调 Taro.nextTick 调用,保证rect能够获取成功 (#3369)
aniwei Oct 15, 2025
77ae33b
feat: 修订 toast 鸿蒙下折行问题,noticebar 获取宽度问题
xiaoyatong Oct 15, 2025
01a2bca
fix: ios/安卓不支持属性增加判断
xiaoyatong Oct 21, 2025
3d88959
feat: dialog 底部按钮增加角标展示
xiaoyatong Oct 24, 2025
075b551
fix: hack 动效 tabs 安卓
xiaoyatong Oct 24, 2025
2e7cbd2
feat: 添加部分组件无障碍功能支持
yangyanAurora Nov 10, 2025
61863f5
Update checkbox.tsx
yangyanAurora Nov 10, 2025
7d0f814
Update src/packages/countdown/demos/h5/demo10.tsx
yangyanAurora Nov 10, 2025
0cdc8f4
Update demo.taro.tsx
yangyanAurora Nov 10, 2025
30d9fdf
Update demo.tsx
yangyanAurora Nov 10, 2025
76c0e2f
Update src/packages/noticebar/demos/h5/demo12.tsx
yangyanAurora Nov 10, 2025
3ce6c79
fix: update
yangyanAurora Nov 10, 2025
9d0911f
Update src/packages/price/price.taro.tsx
yangyanAurora Nov 10, 2025
7507379
Update price.taro.tsx
yangyanAurora Nov 11, 2025
858715d
Update price.tsx
yangyanAurora Nov 11, 2025
c8b6c1f
Update src/packages/radio/radio.taro.tsx
yangyanAurora Nov 11, 2025
cd4dd52
Update src/packages/radio/radio.tsx
yangyanAurora Nov 11, 2025
72a0e64
fix: update
yangyanAurora Nov 11, 2025
9954f35
fix: update
yangyanAurora Nov 12, 2025
e4f1ed9
Merge remote-tracking branch 'upstream/feat_v3.x_cpp' into feat_v3.x
yangyanAurora Nov 13, 2025
66092f4
feat: 添加组件无障碍支持
yangyanAurora Nov 13, 2025
57ad0d6
fix: update
yangyanAurora Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react-taro",
"version": "3.0.18",
"version": "3.0.19-cpp.16",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/es/packages/nutui.react.build.js",
Expand Down Expand Up @@ -109,7 +109,7 @@
"dependencies": {
"@babel/runtime": "^7.23.9",
"@nutui/icons-react": "^3.0.2-beta.5",
"@nutui/icons-react-taro": "^3.0.2-beta.3",
"@nutui/icons-react-taro": "^3.0.2-cpp.2",
"@nutui/jdesign-icons-react-taro": "1.0.6-beta.2",
"@nutui/touch-emulator": "^1.0.0",
"@nutui/lottie-miniprogram": "^1.0.2",
Expand Down Expand Up @@ -241,6 +241,7 @@
"@types/react-dom": "^18.2.19",
"sass": "1.77.6",
"@tarojs/api": "4.0.12",
"@tarojs/components": "4.0.12"
"@tarojs/components": "4.0.12",
"@nutui/icons-react-taro": "^3.0.2-cpp.1"
}
}
14,997 changes: 7,870 additions & 7,127 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/hooks/taro/use-custom-event.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useEffect, useRef } from 'react'
import isEqual from 'react-fast-compare'
import { Events, getCurrentInstance } from '@tarojs/taro'
import { eventCenter, getCurrentInstance } from '@tarojs/taro'
import { useForceUpdate } from '@/hooks/use-force-update'

export const customEvents = new Events()
// export const customEvents = new Events()
export const customEvents = eventCenter

export function useCustomEventsPath(selector?: string) {
selector = selector || ''
Expand Down
1 change: 1 addition & 0 deletions src/locales/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface BaseLang {
select: string
edit: string
reset: string
close?: string
video: {
errorTip: string
clickRetry: string
Expand Down
1 change: 1 addition & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const enUS: BaseLang = {
select: 'Select',
edit: 'Edit',
reset: 'Reset',
close: 'close',
video: {
errorTip: 'Error Tip',
clickRetry: 'Click Retry',
Expand Down
1 change: 1 addition & 0 deletions src/locales/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const idID: BaseLang = {
select: 'Pilih',
edit: 'Sunting',
reset: 'Mengatur Ulang',
close: 'Tutup',
video: {
errorTip: 'Terjadi Kesalahan',
clickRetry: 'Coba Lagi',
Expand Down
1 change: 1 addition & 0 deletions src/locales/tr-TR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const trTR: BaseLang = {
select: 'Seçiniz',
edit: 'düzenlemek',
reset: 'sıfırlama',
close: 'Kapat',
video: {
errorTip: 'Video yüklenemedi',
clickRetry: 'Yeniden Tıklayın',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const zhCN: BaseLang = {
select: '请选择',
edit: '编辑',
reset: '重置',
close: '关闭',
video: {
errorTip: '视频加载失败',
clickRetry: '点击重试',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const zhCN: BaseLang = {
select: '請選擇',
edit: '編輯',
reset: '重置',
close: '關閉',
video: {
errorTip: '視頻加載失敗',
clickRetry: '點擊重試',
Expand Down
2 changes: 2 additions & 0 deletions src/packages/actionsheet/actionsheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
&-safe-area {
display: block;
width: 100%;
/* #ifndef dynamic*/
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
}
}
5 changes: 5 additions & 0 deletions src/packages/animatingnumbers/countup.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.nut-countup {
&-list {
/* #ifdef dynamic*/
display: flex;
/* #endif */
/* #ifndef dynamic*/
display: inline-flex;
/* #endif */
height: $countup-height;
overflow: hidden;
direction: ltr;
Expand Down
2 changes: 2 additions & 0 deletions src/packages/avatarcropper/avatarcropper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@

&.top {
top: 0;
/* #ifndef dynamic*/
bottom: inherit;
/* #endif */
}

&-flex {
Expand Down
8 changes: 3 additions & 5 deletions src/packages/avatarcropper/avatarcropper.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import React, {
useMemo,
useCallback,
FunctionComponent,
useLayoutEffect,
} from 'react'
import Taro, { createSelectorQuery } from '@tarojs/taro'
import Taro, { useReady, createSelectorQuery } from '@tarojs/taro'
import classNames from 'classnames'
import { Canvas, CommonEventFunction, View } from '@tarojs/components'
import { getWindowInfo } from '@/utils/taro/get-system-info'
Expand Down Expand Up @@ -138,7 +137,7 @@ export const AvatarCropper: FunctionComponent<
cropperCanvasContext: null,
})

useLayoutEffect(() => {
useReady(() => {
if (showAlipayCanvas2D) {
const { canvasId } = canvasAll
createSelectorQuery()
Expand All @@ -150,7 +149,7 @@ export const AvatarCropper: FunctionComponent<
})
.exec()
}
}, [showAlipayCanvas2D, state.displayHeight, state.displayWidth])
})

useEffect(() => {
setCanvasAll({
Expand Down Expand Up @@ -694,5 +693,4 @@ export const AvatarCropper: FunctionComponent<
</>
)
}

AvatarCropper.displayName = 'NutAvatarCropper'
12 changes: 11 additions & 1 deletion src/packages/badge/badge.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
.nut-badge {
position: relative;
/* #ifdef dynamic*/
display: flex;
/* #endif */
/* #ifndef dynamic*/
display: inline-flex;
vertical-align: middle;
box-sizing: content-box;
/* #endif */
vertical-align: middle;
width: auto;

&-icon {
Expand Down Expand Up @@ -38,7 +43,12 @@
}

&-sup {
/* #ifdef dynamic*/
display: flex;
/* #endif */
/* #ifndef dynamic*/
display: inline-flex;
/* #endif */
text-align: center;
min-width: $badge-min-width;
padding: $badge-padding;
Expand Down
3 changes: 3 additions & 0 deletions src/packages/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
transform: translate(-50%, -50%);
opacity: 0;
content: ' ';
/* #ifdef dynamic*/
pointer-events: none;
/* #endif */
}

&::after {
Expand Down
40 changes: 23 additions & 17 deletions src/packages/button/button.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ import React, { CSSProperties, useCallback, useMemo } from 'react'
import type { MouseEvent } from 'react'
import classNames from 'classnames'
import {
ButtonProps as MiniProgramButtonProps,
// ButtonProps as MiniProgramButtonProps,
View,
Button as TaroButton,
// Button as TaroButton,
} from '@tarojs/components'
import { Loading } from '@nutui/icons-react-taro'
import { getEnv } from '@tarojs/taro'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
import { harmony } from '@/utils/taro/platform'

type OmitMiniProgramButtonProps = Omit<
MiniProgramButtonProps,
'size' | 'type' | 'onClick' | 'style'
>
// type OmitMiniProgramButtonProps = Omit<
// MiniProgramButtonProps,
// 'size' | 'type' | 'onClick' | 'style'
// >

export type ButtonType =
| 'default'
Expand All @@ -27,9 +26,11 @@ export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini'
export type ButtonShape = 'square' | 'round'
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none'

export interface ButtonProps
extends BasicComponent,
OmitMiniProgramButtonProps {
// export interface ButtonProps
// extends BasicComponent,
// OmitMiniProgramButtonProps {

export interface ButtonProps extends BasicComponent {
color: string
shape: ButtonShape
type: ButtonType
Expand Down Expand Up @@ -76,12 +77,13 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
children,
className,
style,
formType,
// formType,
nativeType,
onClick,
...rest
} = { ...defaultProps, ...props }

const role = 'button'
const getStyle = useMemo(() => {
const style: CSSProperties = {}
if (color) {
Expand Down Expand Up @@ -145,20 +147,23 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
className
)

if (getEnv() === 'WEB') {
;(rest as any).type = formType
}
// if (getEnv() === 'WEB') {
// ;(rest as any).type = formType
// }
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line react/button-has-type
<TaroButton
// <TaroButton
<View
{...rest}
ref={ref}
formType={formType || nativeType}
// formType={formType || nativeType}
className={buttonClassNames}
style={{ ...getStyle, ...style }}
onClick={(e) => handleClick(e as any)}
ariaRole={role}
ariaDisabled={disabled}
>
<View className="nut-button-wrap">
{loading && <Loading className="nut-icon-loading" />}
Expand All @@ -175,7 +180,8 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
)}
{rightIcon}
</View>
</TaroButton>
</View>
// </TaroButton>
)
}
)
Expand Down
2 changes: 2 additions & 0 deletions src/packages/cascader/cascader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
}

.nut-tabs-titles-item {
/* #ifndef dynamic*/
flex: initial;
min-width: auto;
/* #endif */
width: auto;
padding: $cascader-tabs-item-padding;
white-space: nowrap;
Expand Down
4 changes: 4 additions & 0 deletions src/packages/cellgroup/cellgroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
display: block;

&-title {
/* #ifndef dynamic*/
display: inherit;
/* #endif */
padding: $cell-group-title-padding;
color: $cell-group-title-color;
font-size: $cell-group-title-font-size;
Expand All @@ -12,7 +14,9 @@
}

&-description {
/* #ifndef dynamic*/
display: inherit;
/* #endif */
padding: $cell-group-description-padding;
color: $cell-group-description-color;
font-size: $cell-group-description-font-size;
Expand Down
5 changes: 5 additions & 0 deletions src/packages/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@

&-button {
position: relative;
/* #ifdef dynamic*/
display: flex;
/* #endif */
/* #ifndef dynamic*/
display: inline-flex;
/* #endif */
align-items: center;
min-height: 32px;
padding: $checkbox-button-padding;
Expand Down
4 changes: 4 additions & 0 deletions src/packages/checkbox/checkbox.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,15 @@ export const Checkbox: FC<
{
[`${classPrefix}-reverse`]: labelPosition === 'left',
'nut-checkbox-list-item': ctx?.list,
[`${classPrefix}-active`]: innerChecked,
},
className
)}
{...rest}
onClick={handleClick}
ariaRole="checkbox"
tabIndex={innerDisabled ? -1 : 0}
ariaChecked={innerIndeterminate ? 'mixed' : innerChecked}
>
{renderCheckboxItem()}
</View>
Expand Down
4 changes: 4 additions & 0 deletions src/packages/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,15 @@ export const Checkbox: FunctionComponent<
{
[`${classPrefix}-reverse`]: labelPosition === 'left',
'nut-checkbox-list-item': ctx?.list,
[`${classPrefix}-active`]: innerChecked,
},
className
)}
{...rest}
onClick={handleClick}
role="checkbox"
tabIndex={innerDisabled ? -1 : 0}
aria-checked={innerIndeterminate ? 'mixed' : innerChecked}
>
{renderCheckboxItem()}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/packages/checkboxgroup/checkboxgroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
flex-wrap: wrap;

.nut-checkbox {
/* #ifdef dynamic*/
display: flex;
/* #endif */
/* #ifndef dynamic*/
display: inline-flex;
/* #endif */
flex: 1;
margin-right: 20px;

Expand Down
Loading