hy-app 0.4.13 → 0.5.0

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.
Files changed (211) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +155 -238
  2. package/components/hy-action-sheet/props.ts +68 -15
  3. package/components/hy-action-sheet/typing.d.ts +115 -115
  4. package/components/hy-address-picker/hy-address-picker.vue +185 -289
  5. package/components/hy-address-picker/props.ts +97 -21
  6. package/components/hy-address-picker/typing.d.ts +90 -89
  7. package/components/hy-avatar/hy-avatar.vue +121 -204
  8. package/components/hy-avatar/props.ts +76 -18
  9. package/components/hy-avatar/typing.d.ts +63 -62
  10. package/components/hy-back-top/hy-back-top.vue +65 -120
  11. package/components/hy-back-top/props.ts +57 -16
  12. package/components/hy-back-top/typing.d.ts +43 -42
  13. package/components/hy-badge/hy-badge.vue +66 -138
  14. package/components/hy-badge/props.ts +73 -17
  15. package/components/hy-badge/typing.d.ts +59 -58
  16. package/components/hy-button/hy-button.vue +226 -375
  17. package/components/hy-button/props.ts +129 -158
  18. package/components/hy-calendar/header.vue +48 -64
  19. package/components/hy-calendar/hy-calendar.vue +274 -438
  20. package/components/hy-calendar/month.vue +508 -516
  21. package/components/hy-calendar/props.ts +157 -35
  22. package/components/hy-calendar/typing.d.ts +129 -128
  23. package/components/hy-card/hy-card.vue +118 -240
  24. package/components/hy-card/index.scss +1 -2
  25. package/components/hy-card/props.ts +122 -27
  26. package/components/hy-card/typing.d.ts +119 -118
  27. package/components/hy-cell/hy-cell.vue +176 -258
  28. package/components/hy-cell/props.ts +71 -17
  29. package/components/hy-cell/typing.d.ts +87 -86
  30. package/components/hy-check-button/hy-check-button.vue +69 -139
  31. package/components/hy-check-button/props.ts +72 -18
  32. package/components/hy-check-button/typing.d.ts +74 -73
  33. package/components/hy-checkbox/hy-checkbox.vue +170 -263
  34. package/components/hy-checkbox/props.ts +94 -24
  35. package/components/hy-checkbox/typing.d.ts +72 -72
  36. package/components/hy-checkbox-group/hy-checkbox-group.vue +25 -100
  37. package/components/hy-checkbox-group/props.ts +80 -0
  38. package/components/hy-checkbox-group/typing.d.ts +65 -65
  39. package/components/hy-checkbox-item/hy-checkbox-item.vue +140 -177
  40. package/components/hy-checkbox-item/props.ts +24 -0
  41. package/components/hy-checkbox-item/typing.d.ts +4 -3
  42. package/components/hy-code-input/hy-code-input.vue +179 -262
  43. package/components/hy-code-input/props.ts +84 -18
  44. package/components/hy-code-input/typing.d.ts +71 -71
  45. package/components/hy-config-provider/hy-config-provider.vue +28 -50
  46. package/components/hy-config-provider/props.ts +26 -11
  47. package/components/hy-config-provider/typing.d.ts +20 -20
  48. package/components/hy-count-down/hy-count-down.vue +103 -131
  49. package/components/hy-count-down/props.ts +30 -8
  50. package/components/hy-count-down/typing.d.ts +25 -25
  51. package/components/hy-count-to/hy-count-to.vue +148 -213
  52. package/components/hy-count-to/props.ts +60 -15
  53. package/components/hy-count-to/typing.d.ts +46 -46
  54. package/components/hy-coupon/README.md +133 -0
  55. package/components/hy-coupon/hy-coupon.vue +180 -0
  56. package/components/hy-coupon/index.scss +553 -0
  57. package/components/hy-coupon/props.ts +129 -0
  58. package/components/hy-coupon/typing.d.ts +146 -0
  59. package/components/hy-datetime-picker/hy-datetime-picker.vue +415 -580
  60. package/components/hy-datetime-picker/props.ts +142 -32
  61. package/components/hy-datetime-picker/typing.d.ts +132 -132
  62. package/components/hy-divider/hy-divider.vue +90 -169
  63. package/components/hy-divider/props.ts +78 -19
  64. package/components/hy-divider/typing.d.ts +60 -60
  65. package/components/hy-dropdown/hy-dropdown.vue +37 -71
  66. package/components/hy-dropdown/props.ts +38 -15
  67. package/components/hy-dropdown/typing.d.ts +44 -44
  68. package/components/hy-dropdown-item/hy-dropdown-item.vue +141 -173
  69. package/components/hy-dropdown-item/props.ts +19 -8
  70. package/components/hy-empty/hy-empty.vue +75 -129
  71. package/components/hy-empty/props.ts +57 -15
  72. package/components/hy-empty/typing.d.ts +84 -84
  73. package/components/hy-flex/hy-flex.vue +33 -88
  74. package/components/hy-flex/props.ts +58 -0
  75. package/components/hy-flex/typing.d.ts +14 -16
  76. package/components/hy-float-button/hy-float-button.vue +289 -406
  77. package/components/hy-float-button/props.ts +109 -25
  78. package/components/hy-folding-panel/hy-folding-panel.vue +86 -374
  79. package/components/hy-folding-panel/props.ts +40 -15
  80. package/components/hy-folding-panel/typing.d.ts +52 -63
  81. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +186 -228
  82. package/components/hy-folding-panel-item/index.scss +87 -0
  83. package/components/hy-folding-panel-item/props.ts +81 -0
  84. package/components/hy-folding-panel-item/typing.d.ts +23 -0
  85. package/components/hy-form/hy-form.vue +172 -212
  86. package/components/hy-form/props.ts +37 -0
  87. package/components/hy-form/typing.d.ts +68 -61
  88. package/components/hy-form-group/typing.d.ts +74 -74
  89. package/components/hy-form-item/hy-form-item.vue +100 -129
  90. package/components/hy-form-item/props.ts +25 -0
  91. package/components/hy-form-item/typing.d.ts +40 -37
  92. package/components/hy-grid/hy-grid.vue +76 -132
  93. package/components/hy-grid/props.ts +58 -16
  94. package/components/hy-grid/typing.d.ts +66 -66
  95. package/components/hy-icon/hy-icon.vue +84 -161
  96. package/components/hy-icon/props.ts +76 -22
  97. package/components/hy-icon/typing.d.ts +83 -82
  98. package/components/hy-image/hy-image.vue +142 -272
  99. package/components/hy-image/props.ts +105 -23
  100. package/components/hy-image/typing.d.ts +84 -87
  101. package/components/hy-input/hy-input.vue +230 -421
  102. package/components/hy-input/props.ts +183 -35
  103. package/components/hy-input/typing.d.ts +169 -169
  104. package/components/hy-line/hy-line.vue +34 -72
  105. package/components/hy-line/props.ts +41 -10
  106. package/components/hy-line/typing.d.ts +29 -29
  107. package/components/hy-line-progress/hy-line-progress.vue +66 -101
  108. package/components/hy-line-progress/props.ts +31 -10
  109. package/components/hy-line-progress/typing.d.ts +29 -29
  110. package/components/hy-list/hy-list.vue +151 -220
  111. package/components/hy-list/props.ts +67 -16
  112. package/components/hy-list/typing.d.ts +52 -52
  113. package/components/hy-loading/hy-loading.vue +63 -119
  114. package/components/hy-loading/props.ts +63 -15
  115. package/components/hy-loading/typing.d.ts +49 -49
  116. package/components/hy-menu/hy-menu.vue +124 -166
  117. package/components/hy-menu/props.ts +42 -10
  118. package/components/hy-menu/typing.d.ts +60 -60
  119. package/components/hy-modal/hy-modal.vue +127 -218
  120. package/components/hy-modal/props.ts +89 -24
  121. package/components/hy-navbar/hy-navbar.vue +104 -177
  122. package/components/hy-navbar/props.ts +76 -22
  123. package/components/hy-navbar/typing.d.ts +81 -81
  124. package/components/hy-notice-bar/hy-notice-bar.vue +67 -144
  125. package/components/hy-notice-bar/props.ts +80 -19
  126. package/components/hy-notice-bar/typing.d.ts +62 -62
  127. package/components/hy-notify/hy-notify.vue +128 -177
  128. package/components/hy-notify/props.ts +49 -12
  129. package/components/hy-notify/typing.d.ts +45 -41
  130. package/components/hy-number-step/hy-number-step.vue +281 -394
  131. package/components/hy-number-step/props.ts +110 -27
  132. package/components/hy-number-step/typing.d.ts +120 -120
  133. package/components/hy-overlay/hy-overlay.vue +39 -66
  134. package/components/hy-overlay/props.ts +31 -8
  135. package/components/hy-pagination/hy-pagination.vue +100 -155
  136. package/components/hy-pagination/props.ts +53 -13
  137. package/components/hy-picker/hy-picker.vue +309 -430
  138. package/components/hy-picker/index.scss +8 -12
  139. package/components/hy-picker/props.ts +110 -26
  140. package/components/hy-popover/hy-popover.vue +190 -252
  141. package/components/hy-popover/props.ts +48 -10
  142. package/components/hy-popup/hy-popup.vue +162 -248
  143. package/components/hy-popup/props.ts +82 -18
  144. package/components/hy-price/hy-price.vue +45 -104
  145. package/components/hy-price/props.ts +52 -12
  146. package/components/hy-price/typing.d.ts +41 -36
  147. package/components/hy-qrcode/hy-qrcode.vue +115 -185
  148. package/components/hy-qrcode/props.ts +68 -18
  149. package/components/hy-qrcode/typing.d.ts +67 -66
  150. package/components/hy-radio/hy-radio.vue +161 -259
  151. package/components/hy-radio/props.ts +95 -25
  152. package/components/hy-radio/typing.d.ts +85 -84
  153. package/components/hy-rate/hy-rate.vue +185 -270
  154. package/components/hy-rate/props.ts +76 -18
  155. package/components/hy-rate/typing.d.ts +61 -60
  156. package/components/hy-read-more/hy-read-more.vue +93 -136
  157. package/components/hy-read-more/props.ts +43 -13
  158. package/components/hy-scroll-list/hy-scroll-list.vue +81 -102
  159. package/components/hy-scroll-list/props.ts +22 -11
  160. package/components/hy-search/hy-search.vue +155 -284
  161. package/components/hy-search/props.ts +130 -25
  162. package/components/hy-signature/hy-signature.vue +491 -635
  163. package/components/hy-signature/props.ts +115 -26
  164. package/components/hy-signature/typing.d.ts +138 -138
  165. package/components/hy-slider/hy-slider.vue +388 -477
  166. package/components/hy-slider/props.ts +75 -19
  167. package/components/hy-steps/hy-steps.vue +212 -279
  168. package/components/hy-steps/props.ts +47 -13
  169. package/components/hy-submit-bar/hy-submit-bar.vue +137 -222
  170. package/components/hy-submit-bar/props.ts +89 -20
  171. package/components/hy-submit-bar/typing.d.ts +86 -85
  172. package/components/hy-subsection/hy-subsection.vue +132 -185
  173. package/components/hy-subsection/props.ts +50 -17
  174. package/components/hy-subsection/typing.d.ts +52 -52
  175. package/components/hy-swipe-action/hy-swipe-action.vue +228 -283
  176. package/components/hy-swipe-action/props.ts +43 -18
  177. package/components/hy-swipe-action/typing.d.ts +46 -46
  178. package/components/hy-swiper/hy-swiper.vue +159 -286
  179. package/components/hy-swiper/props.ts +126 -28
  180. package/components/hy-swiper/typing.d.ts +115 -115
  181. package/components/hy-switch/hy-switch.vue +112 -176
  182. package/components/hy-switch/props.ts +60 -15
  183. package/components/hy-switch/typing.d.ts +63 -63
  184. package/components/hy-tabBar/hy-tabBar.vue +64 -60
  185. package/components/hy-tabs/hy-tabs.vue +277 -380
  186. package/components/hy-tabs/props.ts +75 -18
  187. package/components/hy-tag/hy-tag.vue +111 -204
  188. package/components/hy-tag/props.ts +81 -19
  189. package/components/hy-text/hy-text.vue +200 -322
  190. package/components/hy-text/props.ts +107 -28
  191. package/components/hy-textarea/hy-textarea.vue +147 -256
  192. package/components/hy-textarea/props.ts +112 -25
  193. package/components/hy-textarea/typing.d.ts +42 -42
  194. package/components/hy-toast/hy-toast.vue +135 -143
  195. package/components/hy-tooltip/hy-tooltip.vue +220 -306
  196. package/components/hy-tooltip/props.ts +79 -15
  197. package/components/hy-transition/hy-transition.vue +111 -138
  198. package/components/hy-transition/props.ts +30 -8
  199. package/components/hy-upload/hy-upload.vue +320 -469
  200. package/components/hy-upload/props.ts +130 -27
  201. package/components/hy-warn/hy-warn.vue +80 -129
  202. package/components/hy-warn/props.ts +47 -12
  203. package/components/hy-waterfall/hy-waterfall.vue +139 -163
  204. package/components/hy-waterfall/props.ts +19 -7
  205. package/components/hy-watermark/hy-watermark.vue +762 -870
  206. package/components/hy-watermark/props.ts +103 -22
  207. package/global.d.ts +2 -0
  208. package/libs/css/theme.scss +3 -3
  209. package/package.json +2 -2
  210. package/web-types.json +1 -1
  211. package/components/hy-folding-panel/index.scss +0 -9
@@ -1,38 +1,186 @@
1
- import type IProps from './typing'
1
+ import type { CSSProperties, PropType } from 'vue'
2
+ import type { InputConfirmType, InputType } from '@uni-helper/uni-types'
3
+ import type HyIconProps from '../hy-icon/typing'
2
4
 
3
- const defaultProps: IProps = {
4
- modelValue: '',
5
- type: 'text',
6
- fixed: false,
7
- disabled: false,
8
- disabledColor: '',
9
- clearable: false,
10
- password: false,
11
- maxlength: 140,
12
- placeholder: null,
13
- placeholderClass: 'input-placeholder',
14
- placeholderStyle: {},
15
- showWordLimit: false,
16
- confirmType: 'done',
17
- confirmHold: false,
18
- holdKeyboard: false,
19
- focus: false,
20
- autoBlur: false,
21
- disableDefaultPadding: false,
22
- cursor: -1,
23
- cursorSpacing: 30,
24
- selectionStart: -1,
25
- selectionEnd: -1,
26
- adjustPosition: true,
27
- inputAlign: 'left',
28
- fontSize: '15px',
29
- color: '',
30
- prefixIcon: {},
31
- suffixIcon: {},
32
- border: 'surround',
33
- readonly: false,
34
- shape: 'square',
35
- formatter: null,
5
+ const inputProps = {
6
+ /** 输入的值 */
7
+ modelValue: {
8
+ type: [String, Number],
9
+ required: true
10
+ },
11
+ /**
12
+ * 输入框类型,见上方说明
13
+ * @values text,idcard,number,digit,safe-password,tel,nickname
14
+ * */
15
+ type: {
16
+ type: String as PropType<InputType>,
17
+ default: 'text'
18
+ },
19
+ /** 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 */
20
+ fixed: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ /** 是否禁用输入框 */
25
+ disabled: {
26
+ type: Boolean,
27
+ default: false
28
+ },
29
+ /** 禁用状态时的背景色 */
30
+ disabledColor: {
31
+ type: String,
32
+ default: ''
33
+ },
34
+ /** 是否显示清除控件 */
35
+ clearable: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ /** 是否密码类型 */
40
+ password: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ /** 最大输入长度,设置为 -1 的时候不限制最大长度 */
45
+ maxlength: {
46
+ type: Number,
47
+ default: -1
48
+ },
49
+ /** 输入框为空时的占位符 */
50
+ placeholder: String,
51
+ /** 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ */
52
+ placeholderClass: {
53
+ type: String,
54
+ default: 'input-placeholder'
55
+ },
56
+ /** 指定placeholder的样式,字符串/对象形式,如"color: red;" */
57
+ placeholderStyle: {
58
+ type: Object as PropType<CSSProperties>,
59
+ default: () => ({})
60
+ },
61
+ /** 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效 */
62
+ showWordLimit: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ /** 设置右下角按钮的文字,兼容性详见uni-app文档 */
67
+ confirmType: {
68
+ type: String as PropType<InputConfirmType>,
69
+ default: 'done'
70
+ },
71
+ /** 点击键盘右下角按钮时是否保持键盘不收起,H5无效 */
72
+ confirmHold: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ /** focus时,点击页面的时候不收起键盘,微信小程序有效 */
77
+ holdKeyboard: {
78
+ type: Boolean,
79
+ default: false
80
+ },
81
+ /** 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 */
82
+ focus: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ /** 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 */
87
+ autoBlur: {
88
+ type: Boolean,
89
+ default: false
90
+ },
91
+ /** 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 */
92
+ disableDefaultPadding: {
93
+ type: Boolean,
94
+ default: false
95
+ },
96
+ /** 指定focus时光标的位置 */
97
+ cursor: {
98
+ type: Number,
99
+ default: 140
100
+ },
101
+ /** 输入框聚焦时底部与键盘的距离 */
102
+ cursorSpacing: {
103
+ type: Number,
104
+ default: 30
105
+ },
106
+ /** 光标起始位置,自动聚集时有效,需与selection-end搭配使用 */
107
+ selectionStart: {
108
+ type: Number,
109
+ default: -1
110
+ },
111
+ /** 光标结束位置,自动聚集时有效,需与selection-start搭配使用 */
112
+ selectionEnd: {
113
+ type: Number,
114
+ default: -1
115
+ },
116
+ /** 键盘弹起时,是否自动上推页面 */
117
+ adjustPosition: {
118
+ type: Boolean,
119
+ default: true
120
+ },
121
+ /**
122
+ * 输入框内容对齐方式
123
+ * @values left,center,right
124
+ * */
125
+ inputAlign: {
126
+ type: String as PropType<HyApp.RowCenterType>,
127
+ default: 'left'
128
+ },
129
+ /** 输入框字体的大小 */
130
+ fontSize: {
131
+ type: [String, Number],
132
+ default: '15px'
133
+ },
134
+ /** 输入框字体颜色 */
135
+ color: {
136
+ type: String,
137
+ default: ''
138
+ },
139
+ /** 输入框前置图标 */
140
+ prefixIcon: {
141
+ type: Object as PropType<HyIconProps>,
142
+ default: () => {}
143
+ },
144
+ /** 输入框后置图标 */
145
+ suffixIcon: {
146
+ type: Object as PropType<HyIconProps>,
147
+ default: () => {}
148
+ },
149
+ /**
150
+ * 边框类型
151
+ * @values surround,bottom,none
152
+ * */
153
+ border: {
154
+ type: String as PropType<HyApp.BorderType>,
155
+ default: 'surround'
156
+ },
157
+ /** 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 */
158
+ readonly: {
159
+ type: Boolean,
160
+ default: false
161
+ },
162
+ /**
163
+ * 输入框形状
164
+ * @values circle,square
165
+ * */
166
+ shape: {
167
+ type: String as PropType<HyApp.ShapeType>,
168
+ default: 'square'
169
+ },
170
+ /** 是否忽略组件内对文本合成系统事件的处理 */
171
+ ignoreCompositionEvent: {
172
+ type: Boolean,
173
+ default: false
174
+ },
175
+ /** 内容式化函数 */
176
+ formatter: Function,
177
+ /** 定义需要用到的外部样式 */
178
+ customStyle: {
179
+ type: Object as PropType<CSSProperties>,
180
+ default: () => {}
181
+ },
182
+ /** 自定义外部类名 */
183
+ customClass: String
36
184
  }
37
185
 
38
- export default defaultProps
186
+ export default inputProps
@@ -1,176 +1,176 @@
1
- import type { CSSProperties } from "vue";
2
- import type HyIconProps from "../hy-icon/typing";
1
+ import type { CSSProperties } from 'vue'
2
+ import type HyIconProps from '../hy-icon/typing'
3
3
  import type {
4
- InputOnBlurEvent,
5
- InputOnConfirmEvent,
6
- InputOnFocusEvent,
7
- InputOnKeyboardheightchange,
8
- } from "@uni-helper/uni-types";
4
+ InputOnBlurEvent,
5
+ InputOnConfirmEvent,
6
+ InputOnFocusEvent,
7
+ InputOnKeyboardheightchange
8
+ } from '@uni-helper/uni-types'
9
9
 
10
10
  export default interface HyInputProps {
11
- /**
12
- * @description 输入的值
13
- * */
14
- modelValue: string | number;
15
- /**
16
- * @description 输入框类型,见上方说明 ( 默认 'text' )
17
- * */
18
- type?: HyApp.InputType;
19
- /**
20
- * @description 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
21
- * */
22
- fixed?: boolean;
23
- /**
24
- * @description 是否禁用输入框 ( 默认 false )
25
- * */
26
- disabled?: boolean;
27
- /**
28
- * @description 禁用状态时的背景色( 默认 '#f5f7fa' )
29
- * */
30
- disabledColor?: string;
31
- /**
32
- * @description 是否显示清除控件 ( 默认 false )
33
- * */
34
- clearable?: boolean;
35
- /**
36
- * @description 是否密码类型 ( 默认 false )
37
- * */
38
- password?: boolean;
39
- /**
40
- * @description 最大输入长度,设置为 -1 的时候不限制最大长度 ( 默认 -1 )
41
- * */
42
- maxlength?: number;
43
- /**
44
- * @description 输入框为空时的占位符
45
- * */
46
- placeholder?: string | null;
47
- /**
48
- * @description 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )
49
- * */
50
- placeholderClass?: string;
51
- /**
52
- * @description 指定placeholder的样式,字符串/对象形式,如"color: red;"
53
- * */
54
- placeholderStyle?: CSSProperties;
55
- /**
56
- * @description 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效 ( 默认 false )
57
- * */
58
- showWordLimit?: boolean;
59
- /**
60
- * @description 设置右下角按钮的文字,兼容性详见uni-app文档 ( 默认 'done' )
61
- * */
62
- confirmType?: string;
63
- /**
64
- * @description 点击键盘右下角按钮时是否保持键盘不收起,H5无效 ( 默认 false )
65
- * */
66
- confirmHold?: boolean;
67
- /**
68
- * @description focus时,点击页面的时候不收起键盘,微信小程序有效 ( 默认 false )
69
- * */
70
- holdKeyboard?: boolean;
71
- /**
72
- * @description 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 ( 默认 false )
73
- * */
74
- focus?: boolean;
75
- /**
76
- * @description 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 ( 默认 false )
77
- * */
78
- autoBlur?: boolean;
79
- /**
80
- * @description 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 ( 默认 false )
81
- * */
82
- disableDefaultPadding?: boolean;
83
- /**
84
- * @description 指定focus时光标的位置( 默认 140 )
85
- * */
86
- cursor?: number;
87
- /**
88
- * @description 输入框聚焦时底部与键盘的距离 ( 默认 30 )
89
- * */
90
- cursorSpacing?: number;
91
- /**
92
- * @description 光标起始位置,自动聚集时有效,需与selection-end搭配使用 ( 默认 -1 )
93
- * */
94
- selectionStart?: number;
95
- /**
96
- * @description 光标结束位置,自动聚集时有效,需与selection-start搭配使用 ( 默认 -1 )
97
- * */
98
- selectionEnd?: number;
99
- /**
100
- * @description 键盘弹起时,是否自动上推页面 ( 默认 true )
101
- * */
102
- adjustPosition?: boolean;
103
- /**
104
- * @description 输入框内容对齐方式( 默认 'left' )
105
- * */
106
- inputAlign?: HyApp.RowCenterType;
107
- /**
108
- * @description 输入框字体的大小 ( 默认 '15px' )
109
- * */
110
- fontSize?: string | number;
111
- /**
112
- * @description 输入框字体颜色 ( 默认 '#303133' )
113
- * */
114
- color?: string;
115
- /**
116
- * @description 输入框前置图标
117
- * */
118
- prefixIcon?: Partial<HyIconProps>;
119
- /**
120
- * @description 输入框后置图标
121
- * */
122
- suffixIcon?: Partial<HyIconProps>;
123
- /**
124
- * @description 边框类型,surround-四周边框,bottom-底部边框,none-无边框 ( 默认 'surround' )
125
- * */
126
- border?: HyApp.BorderType;
127
- /**
128
- * @description 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false )
129
- * */
130
- readonly?: boolean;
131
- /**
132
- * @description 输入框形状,circle-圆形,square-方形 ( 默认 'square' )
133
- * */
134
- shape?: HyApp.ShapeType;
135
- /**
136
- * @description 内容式化函数
137
- * */
138
- formatter?: Function | null;
139
- /**
140
- * @description 定义需要用到的外部样式
141
- * */
142
- customStyle?: CSSProperties;
143
- /**
144
- * @description 值变化事件
145
- * */
146
- onChange?: Function;
147
- /**
148
- * @description 失去焦点事件
149
- * */
150
- onBlur?: Function;
151
- /**
152
- * @description 是否忽略组件内对文本合成系统事件的处理。
153
- * */
154
- ignoreCompositionEvent?: boolean;
11
+ /**
12
+ * @description 输入的值
13
+ * */
14
+ modelValue: string | number
15
+ /**
16
+ * @description 输入框类型,见上方说明 ( 默认 'text' )
17
+ * */
18
+ type?: HyApp.InputType
19
+ /**
20
+ * @description 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
21
+ * */
22
+ fixed?: boolean
23
+ /**
24
+ * @description 是否禁用输入框 ( 默认 false )
25
+ * */
26
+ disabled?: boolean
27
+ /**
28
+ * @description 禁用状态时的背景色( 默认 '#f5f7fa' )
29
+ * */
30
+ disabledColor?: string
31
+ /**
32
+ * @description 是否显示清除控件 ( 默认 false )
33
+ * */
34
+ clearable?: boolean
35
+ /**
36
+ * @description 是否密码类型 ( 默认 false )
37
+ * */
38
+ password?: boolean
39
+ /**
40
+ * @description 最大输入长度,设置为 -1 的时候不限制最大长度 ( 默认 -1 )
41
+ * */
42
+ maxlength?: number
43
+ /**
44
+ * @description 输入框为空时的占位符
45
+ * */
46
+ placeholder?: string | null
47
+ /**
48
+ * @description 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )
49
+ * */
50
+ placeholderClass?: string
51
+ /**
52
+ * @description 指定placeholder的样式,字符串/对象形式,如"color: red;"
53
+ * */
54
+ placeholderStyle?: CSSProperties
55
+ /**
56
+ * @description 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效 ( 默认 false )
57
+ * */
58
+ showWordLimit?: boolean
59
+ /**
60
+ * @description 设置右下角按钮的文字,兼容性详见uni-app文档 ( 默认 'done' )
61
+ * */
62
+ confirmType?: string
63
+ /**
64
+ * @description 点击键盘右下角按钮时是否保持键盘不收起,H5无效 ( 默认 false )
65
+ * */
66
+ confirmHold?: boolean
67
+ /**
68
+ * @description focus时,点击页面的时候不收起键盘,微信小程序有效 ( 默认 false )
69
+ * */
70
+ holdKeyboard?: boolean
71
+ /**
72
+ * @description 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 ( 默认 false )
73
+ * */
74
+ focus?: boolean
75
+ /**
76
+ * @description 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 ( 默认 false )
77
+ * */
78
+ autoBlur?: boolean
79
+ /**
80
+ * @description 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 ( 默认 false )
81
+ * */
82
+ disableDefaultPadding?: boolean
83
+ /**
84
+ * @description 指定focus时光标的位置( 默认 140 )
85
+ * */
86
+ cursor?: number
87
+ /**
88
+ * @description 输入框聚焦时底部与键盘的距离 ( 默认 30 )
89
+ * */
90
+ cursorSpacing?: number
91
+ /**
92
+ * @description 光标起始位置,自动聚集时有效,需与selection-end搭配使用 ( 默认 -1 )
93
+ * */
94
+ selectionStart?: number
95
+ /**
96
+ * @description 光标结束位置,自动聚集时有效,需与selection-start搭配使用 ( 默认 -1 )
97
+ * */
98
+ selectionEnd?: number
99
+ /**
100
+ * @description 键盘弹起时,是否自动上推页面 ( 默认 true )
101
+ * */
102
+ adjustPosition?: boolean
103
+ /**
104
+ * @description 输入框内容对齐方式( 默认 'left' )
105
+ * */
106
+ inputAlign?: HyApp.RowCenterType
107
+ /**
108
+ * @description 输入框字体的大小 ( 默认 '15px' )
109
+ * */
110
+ fontSize?: string | number
111
+ /**
112
+ * @description 输入框字体颜色 ( 默认 '#303133' )
113
+ * */
114
+ color?: string
115
+ /**
116
+ * @description 输入框前置图标
117
+ * */
118
+ prefixIcon?: Partial<HyIconProps>
119
+ /**
120
+ * @description 输入框后置图标
121
+ * */
122
+ suffixIcon?: Partial<HyIconProps>
123
+ /**
124
+ * @description 边框类型,surround-四周边框,bottom-底部边框,none-无边框 ( 默认 'surround' )
125
+ * */
126
+ border?: HyApp.BorderType
127
+ /**
128
+ * @description 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false )
129
+ * */
130
+ readonly?: boolean
131
+ /**
132
+ * @description 输入框形状,circle-圆形,square-方形 ( 默认 'square' )
133
+ * */
134
+ shape?: HyApp.ShapeType
135
+ /**
136
+ * @description 内容式化函数
137
+ * */
138
+ formatter?: Function | null
139
+ /**
140
+ * @description 定义需要用到的外部样式
141
+ * */
142
+ customStyle?: CSSProperties
143
+ /**
144
+ * @description 值变化事件
145
+ * */
146
+ onChange?: Function
147
+ /**
148
+ * @description 失去焦点事件
149
+ * */
150
+ onBlur?: Function
151
+ /**
152
+ * @description 是否忽略组件内对文本合成系统事件的处理。
153
+ * */
154
+ ignoreCompositionEvent?: boolean
155
155
  }
156
156
 
157
157
  export interface IInputEmits {
158
- /** 输入框失去焦点时触发 */
159
- (e: "blur", event: InputOnBlurEvent, value: string | number): void;
160
- /** 输入框聚焦时触发 */
161
- (e: "focus", event: InputOnFocusEvent): void;
162
- /** 点击完成按钮时触发 */
163
- (e: "confirm", event: InputOnConfirmEvent, value: string | number): void;
164
- /** 键盘高度发生变化的时候触发此事件 */
165
- (e: "keyboardheightchange", event: InputOnKeyboardheightchange): void;
166
- /** 内容发生变化触发此事件 */
167
- (e: "change", value: string | number): void;
168
- /** 内容发生变化触发此事件 */
169
- (e: "update:modelValue", value: string | number): void;
170
- /** 点击清空内容 */
171
- (e: "clear"): void;
172
- /** 点击前缀触发 */
173
- (e: "onPrefix"): void;
174
- /** 点击后缀触发 */
175
- (e: "onSuffix"): void;
158
+ /** 输入框失去焦点时触发 */
159
+ (e: 'blur', event: InputOnBlurEvent, value: string | number): void
160
+ /** 输入框聚焦时触发 */
161
+ (e: 'focus', event: InputOnFocusEvent): void
162
+ /** 点击完成按钮时触发 */
163
+ (e: 'confirm', event: InputOnConfirmEvent, value: string | number): void
164
+ /** 键盘高度发生变化的时候触发此事件 */
165
+ (e: 'keyboardheightchange', event: InputOnKeyboardheightchange): void
166
+ /** 内容发生变化触发此事件 */
167
+ (e: 'change', value: string | number): void
168
+ /** 内容发生变化触发此事件 */
169
+ (e: 'update:modelValue', value: string | number): void
170
+ /** 点击清空内容 */
171
+ (e: 'clear'): void
172
+ /** 点击前缀触发 */
173
+ (e: 'onPrefix'): void
174
+ /** 点击后缀触发 */
175
+ (e: 'onSuffix'): void
176
176
  }