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.
@@ -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
- export type validateTriggerType = 'input' | 'blur' | 'change'
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
- } from '../../../../config/interface/basic-type';
8
- import { Validators } from '../../../../utils/validator';
9
- import { PropTools } from '../../../../config/interface/props/props-tools';
10
-
11
- /**
12
- * 文本框组件 props 定义
13
- */
14
- const inputProps = extendWithBasicProps(
15
- {
16
- value: PropTools.string(),
17
- size: PropTools.enum<BasicSize>(['small', 'medium', 'large'], 'medium', 'inputSize'),
18
- placeholder: PropTools.array(),
19
- placeholderStyle: PropTools.object(),
20
- placeholderTimeNumber: {
21
- type: Number,
22
- default: 0,
23
- validator: Validators.numberRange(
24
- 0,
25
- 1_000_000,
26
- 'The prompt switching time must be between 0 and 1,000,000 milliseconds.'
27
- )
28
- },
29
- maxlength: {
30
- type: Number,
31
- default: 150,
32
- validator: Validators.numberRange(-1, 1_0000_0000, 'maxlength must be between -1 and 100,000,000.')
33
- },
34
- disabled: PropTools.boolean(false),
35
- type: PropTools.enum<InputType>(
36
- [
37
- 'text',
38
- 'id',
39
- 'safe-password',
40
- 'password',
41
- 'number',
42
- 'digit',
43
- 'numeric',
44
- 'decimal',
45
- 'email',
46
- 'phone',
47
- 'url',
48
- 'textarea',
49
- 'name',
50
- 'search',
51
- 'none'
52
- ],
53
- 'text',
54
- 'inputType'
55
- ),
56
- isWordCounter: PropTools.boolean(false),
57
- textPosition: PropTools.enum<BasicHorizontallyPosition>(
58
- ['left', 'right', 'center'],
59
- 'left',
60
- 'inputTextPosition'
61
- ),
62
- focus: PropTools.boolean(false),
63
- validators: PropTools.string(),
64
- validateTrigger: PropTools.enum<validateTriggerType>(['input', 'blur', 'change'], 'input', 'validateTrigger'),
65
- selectionStart: {
66
- type: Number,
67
- default: -1,
68
- validator: Validators.numberRange(-1, 10_000, 'selection start must be between -1 and 10,000 milliseconds.')
69
- },
70
- isIcon: PropTools.boolean(false),
71
- selectionEnd: {
72
- type: Number,
73
- default: -1,
74
- validator: Validators.numberRange(-1, 10_000, 'selection end must be between -1 and 10,000 milliseconds.')
75
- },
76
- randomNumber: PropTools.boolean(false),
77
- cursorColor: PropTools.string(),
78
- autoBlur: PropTools.boolean(false),
79
- cursorSpacing: PropTools.number(0),
80
- autocomplete: PropTools.boolean(true),
81
- },
82
- {
83
- override: {
84
- id: {
85
- default: 'VInput'
86
- },
87
- className: {
88
- default: 'v-input'
89
- },
90
- boxStyle: {
91
- default: {}
92
- }
93
- }
94
- }
95
- );
96
- export default inputProps;
97
- export type inputProps = ExtractPropTypes<typeof inputProps>;
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 { BasicSize, BasicHorizontallyPosition } from '../../../../config/interface/basic-type';
5
-
6
- /**
7
- * uni-input 包装组件 props 定义
8
- */
9
- const uniInputProps = {
10
- value: PropTools.string(),
11
- type: PropTools.string('text'),
12
- size: PropTools.enum<BasicSize>(['small', 'medium', 'large'], 'medium', 'inputSize'),
13
- placeholder: PropTools.string(),
14
- fontStyle: PropTools.object(),
15
- placeholderStyle: PropTools.object(),
16
- placeholderClass: PropTools.string(),
17
- disabled: PropTools.boolean(false),
18
- maxlength: {
19
- type: Number,
20
- default: -1,
21
- validator: Validators.numberRange(-1, 1_0000_0000, 'maxlength must be between -1 and 100,000,000.')
22
- },
23
- autocomplete: PropTools.boolean(false),
24
- focus: PropTools.boolean(false),
25
- textPosition: PropTools.enum<BasicHorizontallyPosition>(['left', 'right', 'center'], 'left', 'inputTextPosition'),
26
- isAppPlus: PropTools.boolean(false)
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>;
@@ -120,7 +120,8 @@ export const styleConfig = {
120
120
  primary: '1rpx', //主要宽度
121
121
  secondary: '2rpx', //次要宽度
122
122
  medium: '3rpx', //中等
123
- thick: '7.5rpx' //粗
123
+ thick: '7.5rpx' ,//粗
124
+ none:'0'//无边框
124
125
  },
125
126
 
126
127
  // 边框样式
@@ -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: styleConfig.basic.shadow.default
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 10rpx',
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': {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  styleConfig
3
- } from '../basic.js'
3
+ } from './basic.js'
4
4
  import {
5
5
  INPUT_COMPONENT_SKIP_PROPS
6
6
  } from './skip-props.js';