@veltra/mobile 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/cascade/style2.css +30 -3
- package/dist/components/checkbox/style2.css +36 -9
- package/dist/components/checkbox-group/style2.css +3 -3
- package/dist/components/date-picker/style2.css +30 -3
- package/dist/components/form-item/style2.css +19 -1
- package/dist/components/input/input.js +4 -1
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/style2.css +50 -4
- package/dist/components/list/style2.css +30 -3
- package/dist/components/multi-select/style2.css +30 -3
- package/dist/components/number-input/style2.css +10 -0
- package/dist/components/password-input/style2.css +10 -0
- package/dist/components/progress/progress.js +4 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/radio/style2.css +36 -9
- package/dist/components/segment/style2.css +30 -6
- package/dist/components/select/style2.css +30 -3
- package/dist/components/steps/style2.css +6 -6
- package/dist/components/switch/style2.css +30 -3
- package/dist/components/tabs/style2.css +27 -3
- package/dist/components/textarea/style2.css +27 -4
- package/dist/components/textarea/textarea.js +2 -1
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/time-picker/style2.css +30 -3
- package/dist/types/progress.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/cascade/style.scss +16 -2
- package/src/components/checkbox/style.scss +18 -6
- package/src/components/checkbox-group/style.scss +2 -2
- package/src/components/date-picker/style.scss +16 -2
- package/src/components/form-item/style.scss +16 -1
- package/src/components/input/input.vue +1 -1
- package/src/components/input/style.scss +43 -5
- package/src/components/list/style.scss +18 -3
- package/src/components/multi-select/style.scss +16 -2
- package/src/components/number-input/style.scss +13 -1
- package/src/components/password-input/style.scss +13 -1
- package/src/components/progress/progress.vue +1 -1
- package/src/components/radio/style.scss +18 -6
- package/src/components/segment/style.scss +15 -3
- package/src/components/select/style.scss +16 -2
- package/src/components/steps/style.scss +4 -5
- package/src/components/switch/style.scss +15 -3
- package/src/components/tabs/style.scss +15 -2
- package/src/components/textarea/style.scss +12 -3
- package/src/components/textarea/textarea.vue +1 -1
- package/src/components/time-picker/style.scss +16 -2
- package/src/types/progress.ts +1 -1
|
@@ -6,7 +6,7 @@ $root-name: list;
|
|
|
6
6
|
$item-name: $root-name + '-item';
|
|
7
7
|
|
|
8
8
|
// 移动端列表:无滚动包装层,原生 ul/li 直接承载滚动;
|
|
9
|
-
// 行高、字号、行间距走 --um-* 密度 token
|
|
9
|
+
// 行高、字号、行间距走 --um-* 密度 token,行高按控件高度档生效
|
|
10
10
|
@include m.b($root-name) {
|
|
11
11
|
margin: 0;
|
|
12
12
|
padding: 0;
|
|
@@ -29,7 +29,8 @@ $item-name: $root-name + '-item';
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// 尺寸档:行高按控件高度档生效,不足 44px 触控热区由 ::before 上下外扩
|
|
33
|
+
// 补足命中区域,不抬高视觉行高
|
|
33
34
|
@include m.size using ($size) {
|
|
34
35
|
@include m.bem($item-name) {
|
|
35
36
|
$padding: t.use-var(spacing-lg);
|
|
@@ -42,9 +43,23 @@ $item-name: $root-name + '-item';
|
|
|
42
43
|
$padding: t.use-var(spacing-xl);
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
$height: t.control-height($size);
|
|
47
|
+
$hit-offset: calc((#{t.use-var(touch-target)} - #{$height}) / -2);
|
|
48
|
+
|
|
49
|
+
position: relative;
|
|
45
50
|
padding: 0 $padding;
|
|
46
51
|
border-radius: t.control-radius($size);
|
|
47
|
-
min-height:
|
|
52
|
+
min-height: $height;
|
|
53
|
+
|
|
54
|
+
// 伪元素位于子元素之下,不拦截行内可点元素
|
|
55
|
+
&::before {
|
|
56
|
+
content: '';
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: $hit-offset;
|
|
59
|
+
bottom: $hit-offset;
|
|
60
|
+
left: 0;
|
|
61
|
+
right: 0;
|
|
62
|
+
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
50
65
|
}
|
|
@@ -22,9 +22,23 @@ $root-name: multi-select;
|
|
|
22
22
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
23
23
|
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// 视觉高度按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域,
|
|
26
|
+
// 不抬高视觉高度(伪元素位于子元素之下,不拦截标签关闭 / 清除等内部可点元素)
|
|
26
27
|
@include m.size using ($size) {
|
|
27
|
-
|
|
28
|
+
$height: t.control-height($size);
|
|
29
|
+
$hit-offset: calc((#{t.use-var('touch-target')} - #{$height}) / -2);
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
min-height: $height;
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: $hit-offset;
|
|
38
|
+
bottom: $hit-offset;
|
|
39
|
+
left: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
&:active {
|
|
@@ -29,7 +29,8 @@ $root-name: number-input;
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@include m.e(clear) {
|
|
32
|
-
// 清除按钮:宽度 44px
|
|
32
|
+
// 清除按钮:宽度 44px;高度撑满输入行内容盒
|
|
33
|
+
position: relative;
|
|
33
34
|
min-width: t.use-var('touch-target');
|
|
34
35
|
align-self: stretch;
|
|
35
36
|
display: inline-flex;
|
|
@@ -44,6 +45,17 @@ $root-name: number-input;
|
|
|
44
45
|
cursor: pointer;
|
|
45
46
|
-webkit-tap-highlight-color: transparent;
|
|
46
47
|
|
|
48
|
+
// 垂直居中的 44px 命中层:行高随密度档变化时热区高度不塌缩
|
|
49
|
+
&::after {
|
|
50
|
+
content: '';
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 50%;
|
|
53
|
+
height: t.use-var('touch-target');
|
|
54
|
+
transform: translateY(-50%);
|
|
55
|
+
left: 0;
|
|
56
|
+
right: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
svg {
|
|
48
60
|
width: 1em;
|
|
49
61
|
height: 1em;
|
|
@@ -12,7 +12,8 @@ $root-name: password-input;
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
@include m.e(clear, visibility-toggle) {
|
|
15
|
-
// 清除与明文切换按钮:宽度 44px
|
|
15
|
+
// 清除与明文切换按钮:宽度 44px;高度撑满输入行内容盒
|
|
16
|
+
position: relative;
|
|
16
17
|
min-width: t.use-var('touch-target');
|
|
17
18
|
align-self: stretch;
|
|
18
19
|
display: inline-flex;
|
|
@@ -27,6 +28,17 @@ $root-name: password-input;
|
|
|
27
28
|
cursor: pointer;
|
|
28
29
|
-webkit-tap-highlight-color: transparent;
|
|
29
30
|
|
|
31
|
+
// 垂直居中的 44px 命中层:行高随密度档变化时热区高度不塌缩
|
|
32
|
+
&::after {
|
|
33
|
+
content: '';
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 50%;
|
|
36
|
+
height: t.use-var('touch-target');
|
|
37
|
+
transform: translateY(-50%);
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
svg {
|
|
31
43
|
width: 1em;
|
|
32
44
|
height: 1em;
|
|
@@ -52,7 +52,7 @@ import type { ProgressProps } from '../../types/progress'
|
|
|
52
52
|
|
|
53
53
|
defineOptions({ name: 'UProgress' })
|
|
54
54
|
|
|
55
|
-
const props = defineProps<ProgressProps>()
|
|
55
|
+
const props = withDefaults(defineProps<ProgressProps>(), { type: 'primary' })
|
|
56
56
|
|
|
57
57
|
defineSlots<{
|
|
58
58
|
default: (props: {
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
$root-name: radio;
|
|
6
6
|
|
|
7
|
-
// 移动端单选框指示器下限:过小难以辨认选中状态
|
|
8
|
-
$indicator-min: 20px;
|
|
9
|
-
|
|
10
7
|
@include m.b($root-name) {
|
|
11
8
|
vertical-align: middle;
|
|
12
9
|
user-select: none;
|
|
@@ -16,12 +13,27 @@ $indicator-min: 20px;
|
|
|
16
13
|
gap: t.spacing(default);
|
|
17
14
|
|
|
18
15
|
@include m.size using ($size) {
|
|
19
|
-
//
|
|
20
|
-
|
|
16
|
+
// 视觉高度按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域
|
|
17
|
+
// (根是 label,外扩区点击照常选中;伪元素位于子元素之下不拦截点击)
|
|
18
|
+
$height: t.control-height($size);
|
|
19
|
+
$hit-offset: calc((#{t.use-var(touch-target)} - #{$height}) / -2);
|
|
20
|
+
|
|
21
|
+
position: relative;
|
|
22
|
+
min-height: $height;
|
|
21
23
|
min-width: t.use-var(touch-target);
|
|
22
24
|
|
|
25
|
+
&::before {
|
|
26
|
+
content: '';
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: $hit-offset;
|
|
29
|
+
bottom: $hit-offset;
|
|
30
|
+
left: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
@include m.bem($root-name, indicator) {
|
|
24
|
-
|
|
35
|
+
// 指示器按高度档的一半缩放(16 / 20 / 24),不设下限避免 small 与 default 等大
|
|
36
|
+
$indicator: calc(t.control-height($size) / 2);
|
|
25
37
|
|
|
26
38
|
width: $indicator;
|
|
27
39
|
height: $indicator;
|
|
@@ -34,13 +34,25 @@
|
|
|
34
34
|
border-radius: t.control-radius($size);
|
|
35
35
|
|
|
36
36
|
@include m.bem(segment, item) {
|
|
37
|
-
//
|
|
37
|
+
// 视觉尺寸按档生效(容器内缩 4px);触控热区不足 44px 时由 ::before
|
|
38
|
+
// 上下外扩补足命中区域,不抬高视觉高度
|
|
38
39
|
// (block 形态由更高特异性保持 min-width: 0 的弹性分配)
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
$hit-offset: calc((#{t.use-var('touch-target')} - (#{t.control-height($size)} - 4px)) / -2);
|
|
41
|
+
|
|
42
|
+
min-height: calc(#{t.control-height($size)} - 4px);
|
|
43
|
+
min-width: calc(#{t.control-height($size)} - 4px);
|
|
41
44
|
padding: 0 calc(#{t.spacing($size)} * 1.5);
|
|
42
45
|
border-radius: calc(#{t.control-radius($size)} - 2px);
|
|
43
46
|
font-size: t.use-var('font-size-main');
|
|
47
|
+
|
|
48
|
+
&::before {
|
|
49
|
+
content: '';
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: $hit-offset;
|
|
52
|
+
bottom: $hit-offset;
|
|
53
|
+
left: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
}
|
|
44
56
|
}
|
|
45
57
|
}
|
|
46
58
|
|
|
@@ -22,9 +22,23 @@ $root-name: select;
|
|
|
22
22
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
23
23
|
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// 视觉高度按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域,
|
|
26
|
+
// 不抬高视觉高度(伪元素位于子元素之下,不拦截清除 / 箭头等内部可点元素)
|
|
26
27
|
@include m.size using ($size) {
|
|
27
|
-
|
|
28
|
+
$height: t.control-height($size);
|
|
29
|
+
$hit-offset: calc((#{t.use-var('touch-target')} - #{$height}) / -2);
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
min-height: $height;
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: $hit-offset;
|
|
38
|
+
bottom: $hit-offset;
|
|
39
|
+
left: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
&:active {
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
// 方便拼接
|
|
7
7
|
$root-name: steps;
|
|
8
8
|
|
|
9
|
-
// 触控可读的下限:圆圈直径与点击热区不小于该值
|
|
10
|
-
$icon-min: 40px;
|
|
11
|
-
|
|
12
9
|
@include m.b($root-name) {
|
|
13
10
|
padding: 0;
|
|
14
11
|
margin: 0;
|
|
@@ -224,8 +221,10 @@ $icon-min: 40px;
|
|
|
224
221
|
@include m.size using ($size) {
|
|
225
222
|
@include m.bem($root-name, icon) {
|
|
226
223
|
font-size: t.use-var('font-size-main');
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
// 圆圈直径按高度档生效(32 / 40 / 48);点击热区由整个 item 保证 ≥44px,
|
|
225
|
+
// 图标本身不承担热区职责,不设下限避免 small 与 default 等大
|
|
226
|
+
width: t.control-height($size);
|
|
227
|
+
height: t.control-height($size);
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
230
|
}
|
|
@@ -13,13 +13,25 @@ $root-name: switch;
|
|
|
13
13
|
gap: t.spacing(default);
|
|
14
14
|
|
|
15
15
|
@include m.size using ($size) {
|
|
16
|
-
//
|
|
17
|
-
|
|
16
|
+
// 视觉行高按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域
|
|
17
|
+
// (整个 label 可点,根是 label 外扩区点击照常切换;轨道尺寸走 --um-* 移动档)
|
|
18
|
+
$height: t.control-height($size);
|
|
18
19
|
$track: t.switch-track($size);
|
|
20
|
+
$hit-offset: calc((#{t.use-var(touch-target)} - #{$height}) / -2);
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
position: relative;
|
|
23
|
+
min-height: $height;
|
|
21
24
|
min-width: t.use-var(touch-target);
|
|
22
25
|
|
|
26
|
+
&::before {
|
|
27
|
+
content: '';
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: $hit-offset;
|
|
30
|
+
bottom: $hit-offset;
|
|
31
|
+
left: 0;
|
|
32
|
+
right: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
@include m.bem($root-name, button) {
|
|
24
36
|
height: $track;
|
|
25
37
|
width: calc($track * 2);
|
|
@@ -249,13 +249,26 @@ $indicator-height: 3px;
|
|
|
249
249
|
align-self: stretch;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
//
|
|
252
|
+
// 视觉高度按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域,
|
|
253
|
+
// 不抬高视觉高度(::after 已被激活下划线占用,热区伪元素用 ::before)
|
|
253
254
|
@include m.size using ($size) {
|
|
254
255
|
@include m.bem(tabs-bar, item) {
|
|
255
|
-
|
|
256
|
+
$height: t.control-height($size);
|
|
257
|
+
$hit-offset: calc((#{t.use-var('touch-target')} - #{$height}) / -2);
|
|
258
|
+
|
|
259
|
+
min-height: $height;
|
|
256
260
|
min-width: t.use-var('touch-target');
|
|
257
261
|
padding: 0 t.spacing($size);
|
|
258
262
|
font-size: t.use-var('font-size-main');
|
|
263
|
+
|
|
264
|
+
&::before {
|
|
265
|
+
content: '';
|
|
266
|
+
position: absolute;
|
|
267
|
+
top: $hit-offset;
|
|
268
|
+
bottom: $hit-offset;
|
|
269
|
+
left: 0;
|
|
270
|
+
right: 0;
|
|
271
|
+
}
|
|
259
272
|
}
|
|
260
273
|
}
|
|
261
274
|
|
|
@@ -14,17 +14,26 @@ $root-name: textarea;
|
|
|
14
14
|
transition:
|
|
15
15
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
16
16
|
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
17
|
-
overflow: hidden;
|
|
18
17
|
vertical-align: middle;
|
|
19
18
|
|
|
20
19
|
@include m.size using ($size) {
|
|
21
20
|
border-radius: t.control-radius($size);
|
|
22
21
|
|
|
22
|
+
// 触控热区不足 44px 时由 ::before 上下外扩补足命中区域,不抬高视觉高度
|
|
23
|
+
&::before {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: calc((#{t.use-var('touch-target')} - #{t.control-height($size)}) / -2);
|
|
27
|
+
bottom: calc((#{t.use-var('touch-target')} - #{t.control-height($size)}) / -2);
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
@include m.bem($root-name, native) {
|
|
24
33
|
// 行高、内边距走移动端 token;右侧让位计数/清除 44px 热区
|
|
25
34
|
padding: t.spacing($size) t.use-var('touch-target') t.spacing($size) t.spacing($size);
|
|
26
|
-
//
|
|
27
|
-
min-height:
|
|
35
|
+
// 视觉高度按档生效;字号 16px(iOS 聚焦防视口缩放)
|
|
36
|
+
min-height: t.control-height($size);
|
|
28
37
|
font-size: t.use-var('font-size-main');
|
|
29
38
|
line-height: t.use-var('text-line-height');
|
|
30
39
|
}
|
|
@@ -22,9 +22,23 @@ $root-name: time-picker;
|
|
|
22
22
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
23
23
|
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// 视觉高度按档生效;触控热区不足 44px 时由 ::before 上下外扩补足命中区域,
|
|
26
|
+
// 不抬高视觉高度(伪元素位于子元素之下,不拦截清除 / 箭头等内部可点元素)
|
|
26
27
|
@include m.size using ($size) {
|
|
27
|
-
|
|
28
|
+
$height: t.control-height($size);
|
|
29
|
+
$hit-offset: calc((#{t.use-var('touch-target')} - #{$height}) / -2);
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
min-height: $height;
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: $hit-offset;
|
|
38
|
+
bottom: $hit-offset;
|
|
39
|
+
left: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
&:active {
|
package/src/types/progress.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ColorType, DeconstructValue } from '@veltra/utils'
|
|
|
3
3
|
/** progress组件属性 */
|
|
4
4
|
export interface ProgressProps {
|
|
5
5
|
/** 类型 */
|
|
6
|
-
type
|
|
6
|
+
type?: ColorType | ((percentage: number) => ColorType)
|
|
7
7
|
/** 圆形进度条尺寸 */
|
|
8
8
|
size?: number | string
|
|
9
9
|
/** 进度百分比 */
|