Skip to content

Commit 06fac0e

Browse files
xiaoyatongtongen
andauthored
feat: 合并近期跨原生改动点,增加了无障碍,部分组件增加了新功能。 (#3420)
* fix: 修订导入方式,兼容五端处理 * fix: 兼容原生侧样式无法支持的属性处理 * feat(checkbox): 跟进最新设计规范,勾选态为白色背景,增加选中态自定义类名 * fix: 样式兼容原生侧 * feat(input): 增加native styles * feat(radio): 样式修订,增加无障碍 * feat(tabs): 修订原生侧样式兼容,临时方案 * feat(switch): 无障碍 * feat(popup): 增加top属性,无障碍等 * feat(dialog): 增加底部按钮上的角标,支持配置,修订dialog的最新的样式标量值 * fix: 补充多语言 * fix(toast): 增加无障碍,原生适配 * fix: 修复cr问题 * feat(noticebar): taro 版本优化 --------- Co-authored-by: tongen <tongen@jd.com>
1 parent 8af6041 commit 06fac0e

118 files changed

Lines changed: 4530 additions & 175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/locales/zh-UG.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ const zhUG: BaseLang = {
139139
watermark: {
140140
errorCanvasTips: 'Canvas نى قوللىمايدۇ',
141141
},
142-
mask: 'mask',
142+
mask: 'قاپلىما قەۋەت',
143143
}
144144
export default zhUG

src/packages/actionsheet/actionsheet.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
&-safe-area {
6363
display: block;
6464
width: 100%;
65+
/* #ifndef dynamic*/
6566
padding-bottom: constant(safe-area-inset-bottom);
6667
padding-bottom: env(safe-area-inset-bottom);
68+
/* #endif */
6769
}
6870
}

src/packages/animatingnumbers/countup.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
.nut-countup {
22
&-list {
3+
/* #ifdef dynamic*/
4+
display: flex;
5+
/* #endif */
6+
/* #ifndef dynamic*/
37
display: inline-flex;
8+
/* #endif */
49
height: $countup-height;
510
overflow: hidden;
611
direction: ltr;

src/packages/avatarcropper/avatarcropper.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959

6060
&.top {
6161
top: 0;
62+
/* #ifndef dynamic*/
6263
bottom: inherit;
64+
/* #endif */
6365
}
6466

6567
&-flex {

src/packages/badge/badge.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
.nut-badge {
22
position: relative;
3+
/* #ifdef dynamic*/
4+
display: flex;
5+
/* #endif */
6+
/* #ifndef dynamic*/
37
display: inline-flex;
4-
vertical-align: middle;
58
box-sizing: content-box;
9+
/* #endif */
10+
vertical-align: middle;
611
width: auto;
712

813
&-icon {
@@ -38,7 +43,12 @@
3843
}
3944

4045
&-sup {
46+
/* #ifdef dynamic*/
47+
display: flex;
48+
/* #endif */
49+
/* #ifndef dynamic*/
4150
display: inline-flex;
51+
/* #endif */
4252
text-align: center;
4353
min-width: $badge-min-width;
4454
padding: $badge-padding;

src/packages/button/button.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
transform: translate(-50%, -50%);
5656
opacity: 0;
5757
content: ' ';
58+
/* #ifdef dynamic*/
59+
pointer-events: none;
60+
/* #endif */
61+
/* #ifndef dynamic*/
62+
pointer-events: auto;
63+
/* #endif */
5864
}
5965

6066
&::after {

src/packages/cascader/cascader.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
}
1212

1313
.nut-tabs-titles-item {
14+
/* #ifndef dynamic*/
1415
flex: initial;
1516
min-width: auto;
17+
/* #endif */
1618
width: auto;
1719
padding: $cascader-tabs-item-padding;
1820
white-space: nowrap;

src/packages/cellgroup/cellgroup.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
display: block;
33

44
&-title {
5+
/* #ifndef dynamic*/
56
display: inherit;
7+
/* #endif */
68
padding: $cell-group-title-padding;
79
color: $cell-group-title-color;
810
font-size: $cell-group-title-font-size;
@@ -12,7 +14,9 @@
1214
}
1315

1416
&-description {
17+
/* #ifndef dynamic*/
1518
display: inherit;
19+
/* #endif */
1620
padding: $cell-group-description-padding;
1721
color: $cell-group-description-color;
1822
font-size: $cell-group-description-font-size;

src/packages/checkbox/checkbox.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
&-icon-checked {
2121
color: $color-primary;
22+
background-color: $white;
2223
transition-duration: 0.3s;
2324
transition-property: color, border-color, background-color;
2425
border-radius: 50%;
@@ -41,6 +42,7 @@
4142

4243
&-icon-indeterminate {
4344
color: $color-primary;
45+
background-color: $white;
4446
box-shadow: 0px 2px 4px 0px #ff0f2333;
4547
border-radius: 50%;
4648

@@ -51,6 +53,8 @@
5153

5254
&-icon-disabled {
5355
color: $color-text-disabled;
56+
background-color: $white;
57+
border-radius: 50%;
5458
box-shadow: none;
5559
}
5660

@@ -65,7 +69,12 @@
6569

6670
&-button {
6771
position: relative;
72+
/* #ifdef dynamic */
73+
display: flex;
74+
/* #endif */
75+
/* #ifndef dynamic */
6876
display: inline-flex;
77+
/* #endif */
6978
align-items: center;
7079
min-height: 32px;
7180
padding: $checkbox-button-padding;

src/packages/checkbox/checkbox.taro.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,38 @@ export const Checkbox: FC<
7979
const renderIcon = () => {
8080
if (innerDisabled) {
8181
if (innerIndeterminate) {
82-
return <CheckDisabled className={color()} />
82+
// @ts-ignore
83+
return <CheckDisabled className={color()} ariaHidden />
8384
}
8485
if (innerChecked) {
85-
return <Checked className={color()} />
86+
// @ts-ignore
87+
return <Checked className={color()} ariaHidden />
8688
}
87-
return <CheckDisabled className={color()} />
89+
// @ts-ignore
90+
return <CheckDisabled className={color()} ariaHidden />
8891
}
8992
if (!innerChecked) {
9093
return React.isValidElement(icon) ? (
9194
icon
9295
) : (
93-
<CheckNormal className={color()} />
96+
// @ts-ignore
97+
<CheckNormal className={color()} ariaHidden />
9498
)
9599
}
96100
if (innerIndeterminate) {
97101
return React.isValidElement(indeterminateIcon) ? (
98102
indeterminateIcon
99103
) : (
100-
<CheckDisabled className={color()} />
104+
// @ts-ignore
105+
<CheckDisabled className={color()} ariaHidden />
101106
)
102107
}
103108
return React.isValidElement(activeIcon) ? (
104109
activeIcon
105110
) : (
106111
<View className={`${classPrefix}-icon-wrap`}>
107-
<Checked className={color()} />
112+
{/* @ts-ignore */}
113+
<Checked className={color()} ariaHidden />
108114
</View>
109115
)
110116
}
@@ -198,11 +204,15 @@ export const Checkbox: FC<
198204
{
199205
[`${classPrefix}-reverse`]: labelPosition === 'left',
200206
'nut-checkbox-list-item': ctx?.list,
207+
[`${classPrefix}-active`]: innerChecked,
201208
},
202209
className
203210
)}
204211
{...rest}
205212
onClick={handleClick}
213+
ariaRole="checkbox"
214+
tabIndex={innerDisabled ? -1 : 0}
215+
ariaChecked={innerIndeterminate ? 'mixed' : innerChecked}
206216
>
207217
{renderCheckboxItem()}
208218
</View>

0 commit comments

Comments
 (0)