v-uni-app-ui 1.1.7 → 1.1.9
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/components/config/interface/basic-type.ts +10 -1
- package/components/config/interface/props/components/input-props.ts +112 -97
- package/components/config/interface/props/components/uni-input-props.ts +79 -28
- package/components/config/style/basic.js +2 -1
- package/components/config/style/components/input-style.js +30 -11
- package/components/config/style/components/uni-input-style.js +0 -48
- package/components/config/style/property-mapper.js +1 -1
- package/components/icon/iconfont.css +127 -86
- package/components/icon/iconfont.json +205 -135
- package/components/icon/iconfont.ttf +0 -0
- package/components/icon/iconfont.woff +0 -0
- package/components/icon/iconfont.woff2 +0 -0
- package/components/icon/test.html +613 -0
- package/components/model/{native → compound}/v-input/v-input.vue +294 -276
- package/components/model/native/v-uni-input/v-uni-input.vue +132 -0
- package/index.js +2 -2
- package/package.json +1 -1
- package/components/icon/iconfont.js +0 -1
- package/components/model/native/v-input/v-uni-input.vue +0 -119
|
@@ -9,9 +9,18 @@ export type BasicPosition = 'left' | 'right' | 'top' | 'bottom' | 'center'
|
|
|
9
9
|
|
|
10
10
|
// 交互类型
|
|
11
11
|
export type InteractionMode = 'hover' | 'active' | 'focus' | 'disabled'
|
|
12
|
+
export type validateTriggerType = 'input' | 'blur' | 'change'
|
|
12
13
|
|
|
13
14
|
//组件类型定义
|
|
15
|
+
//按钮形状
|
|
14
16
|
export type ButtonShape = 'default' | 'none' | 'circle'
|
|
17
|
+
|
|
18
|
+
//文本框类型
|
|
15
19
|
export type InputType = 'text' | 'id' | 'safe-password' | 'password' | 'number' | 'digit' | 'numeric' | 'decimal' |
|
|
16
20
|
'email' | 'phone' | 'url' | 'textarea' | 'name' | 'search' | 'none'
|
|
17
|
-
|
|
21
|
+
//文本框键盘按钮文字
|
|
22
|
+
export type confirmType = 'done' | 'send' | 'search' | 'next' | 'go'
|
|
23
|
+
//文本框键盘触发类型
|
|
24
|
+
export type inputKeyboardModel = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'
|
|
25
|
+
//文本框形状
|
|
26
|
+
export type InputShape = 'default' | 'none' | 'circle' | 'line'
|
|
@@ -1,97 +1,112 @@
|
|
|
1
|
-
import { extendWithBasicProps, ExtractPropTypes } from '../../../../config/interface/props/basic-props';
|
|
2
|
-
import {
|
|
3
|
-
InputType,
|
|
4
|
-
BasicSize,
|
|
5
|
-
BasicHorizontallyPosition,
|
|
6
|
-
validateTriggerType
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
import { extendWithBasicProps, ExtractPropTypes } from '../../../../config/interface/props/basic-props';
|
|
2
|
+
import {
|
|
3
|
+
InputType,
|
|
4
|
+
BasicSize,
|
|
5
|
+
BasicHorizontallyPosition,
|
|
6
|
+
validateTriggerType,
|
|
7
|
+
inputKeyboardModel,
|
|
8
|
+
InputShape
|
|
9
|
+
} from '../../../../config/interface/basic-type';
|
|
10
|
+
import { Validators } from '../../../../utils/validator';
|
|
11
|
+
import { PropTools } from '../../../../config/interface/props/props-tools';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 文本框组件 props 定义
|
|
15
|
+
*/
|
|
16
|
+
const inputProps = extendWithBasicProps(
|
|
17
|
+
{
|
|
18
|
+
value: PropTools.string(),
|
|
19
|
+
size: PropTools.enum<BasicSize>(['small', 'medium', 'large'], 'medium', 'inputSize'),
|
|
20
|
+
placeholder: PropTools.array([]),
|
|
21
|
+
placeholderStyle: PropTools.object({}),
|
|
22
|
+
placeholderTimeNumber: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0,
|
|
25
|
+
validator: Validators.numberRange(
|
|
26
|
+
0,
|
|
27
|
+
1_000_000,
|
|
28
|
+
'The prompt switching time must be between 0 and 1,000,000 milliseconds.'
|
|
29
|
+
)
|
|
30
|
+
},
|
|
31
|
+
maxlength: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 150,
|
|
34
|
+
validator: Validators.numberRange(-1, 100_0000, 'maxlength must be between -1 and 100,0000.')
|
|
35
|
+
},
|
|
36
|
+
disabled: PropTools.boolean(false),
|
|
37
|
+
type: PropTools.enum<InputType>(
|
|
38
|
+
[
|
|
39
|
+
'text',
|
|
40
|
+
'id',
|
|
41
|
+
'password',
|
|
42
|
+
'safe-password',
|
|
43
|
+
'number',
|
|
44
|
+
'digit',
|
|
45
|
+
'numeric',
|
|
46
|
+
'decimal',
|
|
47
|
+
'email',
|
|
48
|
+
'phone',
|
|
49
|
+
'url',
|
|
50
|
+
'textarea',
|
|
51
|
+
'name',
|
|
52
|
+
'search',
|
|
53
|
+
'none'
|
|
54
|
+
],
|
|
55
|
+
'text',
|
|
56
|
+
'inputType'
|
|
57
|
+
),
|
|
58
|
+
isWordCounter: PropTools.boolean(false),
|
|
59
|
+
textPosition: PropTools.enum<BasicHorizontallyPosition>(
|
|
60
|
+
['left', 'right', 'center'],
|
|
61
|
+
'left',
|
|
62
|
+
'inputTextPosition'
|
|
63
|
+
),
|
|
64
|
+
focus: PropTools.boolean(false),
|
|
65
|
+
validators: PropTools.string(),
|
|
66
|
+
validateTrigger: PropTools.enum<validateTriggerType>(['input', 'blur', 'change'], 'input', 'validateTrigger'),
|
|
67
|
+
selectionStart: PropTools.number(-1),
|
|
68
|
+
selectionEnd: PropTools.number(-1),
|
|
69
|
+
isIcon: PropTools.boolean(false),
|
|
70
|
+
iconName: PropTools.string(),
|
|
71
|
+
randomNumber: PropTools.boolean(false),
|
|
72
|
+
cursorColor: PropTools.string(),
|
|
73
|
+
autoBlur: PropTools.boolean(false),
|
|
74
|
+
cursorSpacing: PropTools.number(0),
|
|
75
|
+
autocomplete: PropTools.boolean(true),
|
|
76
|
+
confirmHold: PropTools.boolean(false),
|
|
77
|
+
cursor: PropTools.number(),
|
|
78
|
+
adjustPosition: PropTools.boolean(true),
|
|
79
|
+
ignoreComposition: PropTools.boolean(false),
|
|
80
|
+
alwaysEmbed: PropTools.boolean(false),
|
|
81
|
+
holdKeyboard: PropTools.boolean(false),
|
|
82
|
+
safePasswordCertPath: PropTools.string(),
|
|
83
|
+
safePasswordTimeStamp: PropTools.number(),
|
|
84
|
+
safePasswordNonce: PropTools.string(),
|
|
85
|
+
safePasswordSalt: PropTools.string(),
|
|
86
|
+
safePasswordCustomHash: PropTools.string(),
|
|
87
|
+
controlled: PropTools.boolean(false),
|
|
88
|
+
alwaysSystem: PropTools.boolean(false),
|
|
89
|
+
inputModel: PropTools.enum<inputKeyboardModel>(
|
|
90
|
+
['none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url'],
|
|
91
|
+
'text',
|
|
92
|
+
'inputModel'
|
|
93
|
+
),
|
|
94
|
+
shape: PropTools.enum<InputShape>(['default', 'none', 'circle', 'line'], 'default', 'inputShape'),
|
|
95
|
+
isTrim:PropTools.boolean(false),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
override: {
|
|
99
|
+
id: {
|
|
100
|
+
default: 'VInput'
|
|
101
|
+
},
|
|
102
|
+
className: {
|
|
103
|
+
default: 'v-input'
|
|
104
|
+
},
|
|
105
|
+
boxStyle: {
|
|
106
|
+
default: {}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
export default inputProps;
|
|
112
|
+
export type inputProps = ExtractPropTypes<typeof inputProps>;
|
|
@@ -1,30 +1,81 @@
|
|
|
1
|
-
import { ExtractPropTypes } from '../../../../config/interface/props/basic-props';
|
|
2
|
-
import { PropTools } from '../../../../config/interface/props/props-tools';
|
|
3
|
-
import { Validators } from '../../../../utils/validator';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { extendWithBasicProps, ExtractPropTypes } from '../../../../config/interface/props/basic-props';
|
|
2
|
+
import { PropTools } from '../../../../config/interface/props/props-tools';
|
|
3
|
+
import { Validators } from '../../../../utils/validator';
|
|
4
|
+
import {
|
|
5
|
+
BasicSize,
|
|
6
|
+
BasicHorizontallyPosition,
|
|
7
|
+
confirmType,
|
|
8
|
+
inputKeyboardModel
|
|
9
|
+
} from '../../../../config/interface/basic-type';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* uni-input 包装组件 props 定义
|
|
13
|
+
*/
|
|
14
|
+
const uniInputProps = extendWithBasicProps(
|
|
15
|
+
{
|
|
16
|
+
value: PropTools.string(),
|
|
17
|
+
type: PropTools.string('text'),
|
|
18
|
+
size: PropTools.enum<BasicSize>(['small', 'medium', 'large'], 'medium', 'inputSize'),
|
|
19
|
+
placeholder: PropTools.string(),
|
|
20
|
+
fontStyle: PropTools.object(),
|
|
21
|
+
placeholderStyle: PropTools.object({}),
|
|
22
|
+
placeholderClass: PropTools.string(),
|
|
23
|
+
disabled: PropTools.boolean(false),
|
|
24
|
+
maxlength: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: -1,
|
|
27
|
+
validator: Validators.numberRange(-1, 1_0000_0000, 'maxlength must be between -1 and 100,000,000.')
|
|
28
|
+
},
|
|
29
|
+
autocomplete: PropTools.boolean(false),
|
|
30
|
+
focus: PropTools.boolean(false),
|
|
31
|
+
textPosition: PropTools.enum<BasicHorizontallyPosition>(
|
|
32
|
+
['left', 'right', 'center'],
|
|
33
|
+
'left',
|
|
34
|
+
'inputTextPosition'
|
|
35
|
+
),
|
|
36
|
+
cursorSpacing: PropTools.number(0),
|
|
37
|
+
confirmType: PropTools.enum<confirmType>(['done', 'send', 'search', 'next', 'go'], 'done', 'confirmType'),
|
|
38
|
+
confirmHold: PropTools.boolean(false),
|
|
39
|
+
cursor: PropTools.number(),
|
|
40
|
+
cursorColor: PropTools.string(),
|
|
41
|
+
selectionStart: PropTools.number(-1),
|
|
42
|
+
selectionEnd: PropTools.number(-1),
|
|
43
|
+
adjustPosition: PropTools.boolean(true),
|
|
44
|
+
autoBlur: PropTools.boolean(false),
|
|
45
|
+
ignoreComposition: PropTools.boolean(false),
|
|
46
|
+
alwaysEmbed: PropTools.boolean(false),
|
|
47
|
+
holdKeyboard: PropTools.boolean(false),
|
|
48
|
+
safePasswordCertPath: PropTools.string(),
|
|
49
|
+
safePasswordTimeStamp: PropTools.number(),
|
|
50
|
+
safePasswordNonce: PropTools.string(),
|
|
51
|
+
safePasswordSalt: PropTools.string(),
|
|
52
|
+
safePasswordCustomHash: PropTools.string(),
|
|
53
|
+
randomNumber: PropTools.boolean(false),
|
|
54
|
+
controlled: PropTools.boolean(false),
|
|
55
|
+
alwaysSystem: PropTools.boolean(false),
|
|
56
|
+
inputMode: PropTools.enum<inputKeyboardModel>(
|
|
57
|
+
['none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url'],
|
|
58
|
+
'text',
|
|
59
|
+
'inputModel'
|
|
60
|
+
),
|
|
61
|
+
isTrim:PropTools.boolean(false),
|
|
62
|
+
filterRegex: PropTools.string()
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
override: {
|
|
66
|
+
id: {
|
|
67
|
+
default: 'VUniInput'
|
|
68
|
+
},
|
|
69
|
+
className: {
|
|
70
|
+
default: 'v-uni-input'
|
|
71
|
+
},
|
|
72
|
+
boxStyle: {
|
|
73
|
+
default: {
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
28
79
|
|
|
29
80
|
export default uniInputProps;
|
|
30
|
-
export type UniInputProps = ExtractPropTypes<typeof uniInputProps>;
|
|
81
|
+
export type UniInputProps = ExtractPropTypes<typeof uniInputProps>;
|
|
@@ -13,10 +13,28 @@ export default {
|
|
|
13
13
|
height: styleConfig.components.VInput.height.large
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
shape: {
|
|
17
|
+
'default': {
|
|
18
|
+
borderRadius: styleConfig.basic.borderRadius.default,
|
|
19
|
+
borderWidth: styleConfig.basic.border.width.primary,
|
|
20
|
+
},
|
|
21
|
+
'circle': {
|
|
22
|
+
borderRadius: styleConfig.basic.borderRadius.circle,
|
|
23
|
+
borderWidth: styleConfig.basic.border.width.primary,
|
|
24
|
+
},
|
|
25
|
+
'none': {
|
|
26
|
+
borderWidth: styleConfig.basic.border.width.none,
|
|
27
|
+
},
|
|
28
|
+
'line': {
|
|
29
|
+
borderRadius: styleConfig.basic.borderRadius.none,
|
|
30
|
+
borderTopWidth: styleConfig.basic.border.width.none,
|
|
31
|
+
borderLeftWidth: styleConfig.basic.border.width.none,
|
|
32
|
+
borderRightWidth: styleConfig.basic.border.width.none,
|
|
33
|
+
borderBottomWidth: styleConfig.basic.border.width.primary,
|
|
34
|
+
}
|
|
35
|
+
},
|
|
16
36
|
default: {
|
|
17
37
|
borderColor: styleConfig.basic.border.color.primary,
|
|
18
|
-
borderRadius: styleConfig.basic.borderRadius.default,
|
|
19
|
-
borderWidth: styleConfig.basic.border.width.primary,
|
|
20
38
|
borderStyle: styleConfig.basic.border.style.solid,
|
|
21
39
|
transition: styleConfig.basic.animation.transition.default,
|
|
22
40
|
display: 'flex',
|
|
@@ -24,7 +42,14 @@ export default {
|
|
|
24
42
|
_pseudo: {
|
|
25
43
|
'--focus': {
|
|
26
44
|
borderColor: styleConfig.basic.border.color.default,
|
|
27
|
-
boxShadow:
|
|
45
|
+
boxShadow: {
|
|
46
|
+
shape: {
|
|
47
|
+
default: styleConfig.basic.shadow.default,
|
|
48
|
+
circle: styleConfig.basic.shadow.default,
|
|
49
|
+
none: styleConfig.basic.shadow.none,
|
|
50
|
+
line: styleConfig.basic.shadow.none,
|
|
51
|
+
}
|
|
52
|
+
}
|
|
28
53
|
},
|
|
29
54
|
},
|
|
30
55
|
son: {
|
|
@@ -41,8 +66,8 @@ export default {
|
|
|
41
66
|
maxWidth: '95%',
|
|
42
67
|
width: '-webkit-fill-available',
|
|
43
68
|
height: '85%',
|
|
44
|
-
margin: 'auto
|
|
45
|
-
color: styleConfig.basic.fontColor.primary
|
|
69
|
+
margin: 'auto 15rpx',
|
|
70
|
+
color: styleConfig.basic.fontColor.primary,
|
|
46
71
|
}
|
|
47
72
|
},
|
|
48
73
|
rightSlot: {
|
|
@@ -53,11 +78,6 @@ export default {
|
|
|
53
78
|
alignItems: 'center',
|
|
54
79
|
}
|
|
55
80
|
},
|
|
56
|
-
placeholder: {
|
|
57
|
-
default: {
|
|
58
|
-
color: styleConfig.basic.fontColor.placeholder
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
81
|
icon: {
|
|
62
82
|
default: {
|
|
63
83
|
width: '100%',
|
|
@@ -90,7 +110,6 @@ export default {
|
|
|
90
110
|
'align-items': 'self-end',
|
|
91
111
|
'white-space': 'nowrap',
|
|
92
112
|
'padding-right': '20rpx',
|
|
93
|
-
'padding-left':'10rpx',
|
|
94
113
|
height: '100%',
|
|
95
114
|
}
|
|
96
115
|
}
|
|
@@ -12,54 +12,6 @@ export default {
|
|
|
12
12
|
margin: '0',
|
|
13
13
|
boxSizing: 'border-box',
|
|
14
14
|
son: {
|
|
15
|
-
h5PlaceholderInput: {
|
|
16
|
-
size: {
|
|
17
|
-
'small': {
|
|
18
|
-
fontSize: styleConfig.basic.fontSize.smallText
|
|
19
|
-
},
|
|
20
|
-
'medium': {
|
|
21
|
-
fontSize: styleConfig.basic.fontSize.mediumText
|
|
22
|
-
},
|
|
23
|
-
'large': {
|
|
24
|
-
fontSize: styleConfig.basic.fontSize.largeText
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
textPosition: {
|
|
28
|
-
'left': {
|
|
29
|
-
textAlign: "left"
|
|
30
|
-
},
|
|
31
|
-
'right': {
|
|
32
|
-
textAlign: "right"
|
|
33
|
-
},
|
|
34
|
-
'center': {
|
|
35
|
-
textAlign: "center"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
h5Input: {
|
|
40
|
-
size: {
|
|
41
|
-
'small': {
|
|
42
|
-
fontSize: styleConfig.basic.fontSize.smallText
|
|
43
|
-
},
|
|
44
|
-
'medium': {
|
|
45
|
-
fontSize: styleConfig.basic.fontSize.mediumText
|
|
46
|
-
},
|
|
47
|
-
'large': {
|
|
48
|
-
fontSize: styleConfig.basic.fontSize.largeText
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
textPosition: {
|
|
52
|
-
'left': {
|
|
53
|
-
textAlign: "left"
|
|
54
|
-
},
|
|
55
|
-
'right': {
|
|
56
|
-
textAlign: "right"
|
|
57
|
-
},
|
|
58
|
-
'center': {
|
|
59
|
-
textAlign: "center"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
15
|
uniInput: {
|
|
64
16
|
size: {
|
|
65
17
|
'small': {
|