vxe-pc-ui 4.17.0 → 4.17.2

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 (73) hide show
  1. package/dist/all.esm.js +297 -152
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/date-picker/src/date-picker.js +6 -2
  5. package/es/date-range-picker/src/date-range-picker.js +6 -2
  6. package/es/icon/style.css +1 -1
  7. package/es/input/src/input.js +79 -51
  8. package/es/number-input/src/number-input.js +31 -23
  9. package/es/password-input/src/password-input.js +133 -62
  10. package/es/password-input/style.css +5 -0
  11. package/es/password-input/style.min.css +1 -1
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/textarea/src/textarea.js +43 -13
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-password-input/style.css +5 -0
  18. package/es/vxe-password-input/style.min.css +1 -1
  19. package/lib/date-picker/src/date-picker.js +6 -1
  20. package/lib/date-picker/src/date-picker.min.js +1 -1
  21. package/lib/date-range-picker/src/date-range-picker.js +6 -1
  22. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  23. package/lib/icon/style/style.css +1 -1
  24. package/lib/icon/style/style.min.css +1 -1
  25. package/lib/index.umd.js +321 -168
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/input/src/input.js +83 -53
  28. package/lib/input/src/input.min.js +1 -1
  29. package/lib/number-input/src/number-input.js +35 -25
  30. package/lib/number-input/src/number-input.min.js +1 -1
  31. package/lib/password-input/src/password-input.js +140 -71
  32. package/lib/password-input/src/password-input.min.js +1 -1
  33. package/lib/password-input/style/style.css +5 -0
  34. package/lib/password-input/style/style.min.css +1 -1
  35. package/lib/style.css +1 -1
  36. package/lib/style.min.css +1 -1
  37. package/lib/textarea/src/textarea.js +46 -13
  38. package/lib/textarea/src/textarea.min.js +1 -1
  39. package/lib/ui/index.js +1 -1
  40. package/lib/ui/index.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/lib/vxe-password-input/style/style.css +5 -0
  44. package/lib/vxe-password-input/style/style.min.css +1 -1
  45. package/package.json +1 -1
  46. package/packages/date-picker/src/date-picker.ts +6 -2
  47. package/packages/date-range-picker/src/date-range-picker.ts +6 -2
  48. package/packages/input/src/input.ts +85 -56
  49. package/packages/number-input/src/number-input.ts +32 -25
  50. package/packages/password-input/src/password-input.ts +145 -69
  51. package/packages/textarea/src/textarea.ts +49 -17
  52. package/styles/components/password-input.scss +4 -0
  53. package/types/components/date-picker.d.ts +2 -0
  54. package/types/components/date-range-picker.d.ts +2 -0
  55. package/types/components/input.d.ts +2 -0
  56. package/types/components/number-input.d.ts +2 -0
  57. package/types/components/password-input.d.ts +4 -0
  58. package/types/components/table-module/edit.d.ts +37 -4
  59. package/types/components/table.d.ts +9 -2
  60. package/types/components/textarea.d.ts +2 -0
  61. package/types/ui/renderer.d.ts +9 -3
  62. /package/es/icon/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
  63. /package/es/icon/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
  64. /package/es/icon/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
  65. /package/es/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
  66. /package/es/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
  67. /package/es/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
  68. /package/lib/icon/style/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
  69. /package/lib/icon/style/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
  70. /package/lib/icon/style/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
  71. /package/lib/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
  72. /package/lib/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
  73. /package/lib/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
@@ -1,11 +1,11 @@
1
- import { h, ref, Ref, computed, reactive, inject, nextTick, watch, PropType } from 'vue'
1
+ import { h, ref, Ref, computed, reactive, inject, nextTick, watch, PropType, onMounted } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { getConfig, getIcon, getI18n, createEvent, useSize, renderEmptyElement } from '../../ui'
5
- import { getFuncText } from '../../ui/src/utils'
5
+ import { getFuncText, getText } from '../../ui/src/utils'
6
6
  import { getSlotVNs } from '../../ui/src/vn'
7
7
 
8
- import type { VxePasswordInputConstructor, VxePasswordInputEmits, PasswordInputReactData, PasswordInputMethods, VxePasswordInputPropTypes, InputPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
8
+ import type { VxePasswordInputConstructor, VxePasswordInputEmits, PasswordInputReactData, PasswordInputMethods, VxePasswordInputPropTypes, InputPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf } from '../../../types'
9
9
 
10
10
  export default defineVxeComponent({
11
11
  name: 'VxePasswordInput',
@@ -29,6 +29,10 @@ export default defineVxeComponent({
29
29
  default: 'off'
30
30
  },
31
31
  className: String as PropType<VxePasswordInputPropTypes.ClassName>,
32
+ inputClassName: {
33
+ type: String as PropType<VxePasswordInputPropTypes.InputClassName>,
34
+ default: () => getConfig().passwordInput.inputClassName
35
+ },
32
36
  size: {
33
37
  type: String as PropType<VxePasswordInputPropTypes.Size>,
34
38
  default: () => getConfig().passwordInput.size || getConfig().size
@@ -39,6 +43,10 @@ export default defineVxeComponent({
39
43
  type: Boolean as PropType<VxePasswordInputPropTypes.Controls>,
40
44
  default: () => getConfig().passwordInput.controls
41
45
  },
46
+ editable: {
47
+ type: Boolean as PropType<VxePasswordInputPropTypes.Editable>,
48
+ default: true
49
+ },
42
50
 
43
51
  // 已废弃
44
52
  autocomplete: String as PropType<VxePasswordInputPropTypes.Autocomplete>
@@ -87,17 +95,10 @@ export default defineVxeComponent({
87
95
  getRefMaps: () => refMaps
88
96
  } as unknown as VxePasswordInputConstructor
89
97
 
90
- let passwordInputMethods = {} as PasswordInputMethods
91
-
92
98
  const computeIsClearable = computed(() => {
93
99
  return props.clearable
94
100
  })
95
101
 
96
- const computeInpReadonly = computed(() => {
97
- const { readonly } = props
98
- return readonly
99
- })
100
-
101
102
  const computeInpPlaceholder = computed(() => {
102
103
  const { placeholder } = props
103
104
  if (placeholder) {
@@ -110,6 +111,34 @@ export default defineVxeComponent({
110
111
  return getI18n('vxe.base.pleaseInput')
111
112
  })
112
113
 
114
+ const computeFormReadonly = computed(() => {
115
+ if (getConfig().inputReadonly === 'obsolete') {
116
+ if ($xeForm) {
117
+ return $xeForm.props.readonly
118
+ }
119
+ return false
120
+ }
121
+ const { readonly } = props
122
+ if (readonly === null) {
123
+ if ($xeForm) {
124
+ return $xeForm.props.readonly
125
+ }
126
+ return false
127
+ }
128
+ return readonly
129
+ })
130
+
131
+ const computeIsDisabled = computed(() => {
132
+ const { disabled } = props
133
+ if (disabled === null) {
134
+ if ($xeForm) {
135
+ return $xeForm.props.disabled
136
+ }
137
+ return false
138
+ }
139
+ return disabled
140
+ })
141
+
113
142
  const computeInputType = computed(() => {
114
143
  const { showPwd } = reactData
115
144
  if (showPwd) {
@@ -123,9 +152,32 @@ export default defineVxeComponent({
123
152
  return immediate
124
153
  })
125
154
 
155
+ const computeInputReadonly = computed(() => {
156
+ const { editable } = props
157
+ const formReadonly = computeFormReadonly.value
158
+ return formReadonly || !editable
159
+ })
160
+
161
+ const computeDomValue = computed(() => {
162
+ const { inputValue } = reactData
163
+ return inputValue
164
+ })
165
+
166
+ const dispatchEvent = (type: ValueOf<VxePasswordInputEmits>, params: Record<string, any>, evnt: Event | null) => {
167
+ emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params))
168
+ }
169
+
170
+ const updateDomValue = () => {
171
+ const domValue = computeDomValue.value
172
+ const inputElem = refInputTarget.value
173
+ if (inputElem) {
174
+ inputElem.value = XEUtils.eqNull(domValue) ? '' : ('' + domValue)
175
+ }
176
+ }
177
+
126
178
  const triggerEvent = (evnt: Event & { type: 'input' | 'change' | 'click' | 'focus' | 'blur' }) => {
127
179
  const { inputValue } = reactData
128
- passwordInputMethods.dispatchEvent(evnt.type, { value: inputValue }, evnt)
180
+ dispatchEvent(evnt.type, { value: inputValue }, evnt)
129
181
  }
130
182
 
131
183
  const emitInputEvent = (value: any, evnt: Event) => {
@@ -134,7 +186,7 @@ export default defineVxeComponent({
134
186
  if (inpImmediate) {
135
187
  handleChange(value, evnt)
136
188
  } else {
137
- passwordInputMethods.dispatchEvent('input', { value }, evnt)
189
+ dispatchEvent('input', { value }, evnt)
138
190
  }
139
191
  }
140
192
 
@@ -147,9 +199,9 @@ export default defineVxeComponent({
147
199
  const handleChange = (value: string, evnt: Event | { type: string }) => {
148
200
  reactData.inputValue = value
149
201
  emit('update:modelValue', value)
150
- passwordInputMethods.dispatchEvent('input', { value }, evnt as any)
202
+ dispatchEvent('input', { value }, evnt as any)
151
203
  if (XEUtils.toValueString(props.modelValue) !== value) {
152
- passwordInputMethods.dispatchEvent('change', { value }, evnt as any)
204
+ dispatchEvent('change', { value }, evnt as any)
153
205
  // 自动更新校验状态
154
206
  if ($xeForm && formItemInfo) {
155
207
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
@@ -159,7 +211,7 @@ export default defineVxeComponent({
159
211
 
160
212
  const changeEvent = (evnt: Event & { type: 'change' }) => {
161
213
  triggerEvent(evnt)
162
- $xePasswordInput.dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
214
+ dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
163
215
  // 自动更新校验状态
164
216
  if ($xeForm && formItemInfo) {
165
217
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, reactData.inputValue)
@@ -175,7 +227,7 @@ export default defineVxeComponent({
175
227
  const { inputValue } = reactData
176
228
  const value = inputValue
177
229
  reactData.isActivated = false
178
- $xePasswordInput.dispatchEvent('blur', { value }, evnt)
230
+ dispatchEvent('blur', { value }, evnt)
179
231
  // 自动更新校验状态
180
232
  if ($xeForm && formItemInfo) {
181
233
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
@@ -183,12 +235,13 @@ export default defineVxeComponent({
183
235
  }
184
236
 
185
237
  const passwordToggleEvent = (evnt: Event) => {
186
- const { readonly, disabled } = props
187
238
  const { showPwd } = reactData
188
- if (!disabled && !readonly) {
239
+ const isDisabled = computeIsDisabled.value
240
+ const formReadonly = computeFormReadonly.value
241
+ if (!isDisabled && !formReadonly) {
189
242
  reactData.showPwd = !showPwd
190
243
  }
191
- $xePasswordInput.dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt)
244
+ dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt)
192
245
  }
193
246
 
194
247
  const clickEvent = (evnt: Event & { type: 'click' }) => {
@@ -198,26 +251,50 @@ export default defineVxeComponent({
198
251
  const clearValueEvent = (evnt: Event, value: VxePasswordInputPropTypes.ModelValue) => {
199
252
  focus()
200
253
  handleChange('', evnt)
201
- $xePasswordInput.dispatchEvent('clear', { value }, evnt)
202
- $xePasswordInput.dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
254
+ dispatchEvent('clear', { value }, evnt)
255
+ dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
203
256
  }
204
257
 
205
258
  const clickSuffixEvent = (evnt: Event) => {
206
- const { disabled } = props
207
- if (!disabled) {
259
+ const isDisabled = computeIsDisabled.value
260
+ if (!isDisabled) {
208
261
  const { inputValue } = reactData
209
- $xePasswordInput.dispatchEvent('suffix-click', { value: inputValue }, evnt)
262
+ dispatchEvent('suffix-click', { value: inputValue }, evnt)
210
263
  }
211
264
  }
212
265
 
213
266
  const clickPrefixEvent = (evnt: Event) => {
214
- const { disabled } = props
215
- if (!disabled) {
267
+ const isDisabled = computeIsDisabled.value
268
+ if (!isDisabled) {
216
269
  const { inputValue } = reactData
217
- $xePasswordInput.dispatchEvent('prefix-click', { value: inputValue }, evnt)
270
+ dispatchEvent('prefix-click', { value: inputValue }, evnt)
271
+ }
272
+ }
273
+
274
+ const passwordInputMethods: PasswordInputMethods = {
275
+ dispatchEvent,
276
+ focus () {
277
+ const inputElem = refInputTarget.value
278
+ reactData.isActivated = true
279
+ inputElem.focus()
280
+ return nextTick()
281
+ },
282
+ blur () {
283
+ const inputElem = refInputTarget.value
284
+ inputElem.blur()
285
+ reactData.isActivated = false
286
+ return nextTick()
287
+ },
288
+ select () {
289
+ const inputElem = refInputTarget.value
290
+ inputElem.select()
291
+ reactData.isActivated = false
292
+ return nextTick()
218
293
  }
219
294
  }
220
295
 
296
+ Object.assign($xePasswordInput, passwordInputMethods)
297
+
221
298
  const renderPasswordIcon = () => {
222
299
  const { showPwd } = reactData
223
300
  return h('div', {
@@ -252,14 +329,15 @@ export default defineVxeComponent({
252
329
  }
253
330
 
254
331
  const renderSuffixIcon = () => {
255
- const { disabled, suffixIcon, controls } = props
332
+ const { suffixIcon, controls } = props
256
333
  const { inputValue } = reactData
257
- const suffixSlot = slots.suffix
334
+ const isDisabled = computeIsDisabled.value
258
335
  const isClearable = computeIsClearable.value
336
+ const suffixSlot = slots.suffix
259
337
  return isClearable || controls || suffixSlot || suffixIcon
260
338
  ? h('div', {
261
339
  class: ['vxe-password-input--suffix', {
262
- 'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
340
+ 'is--clear': isClearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
263
341
  }]
264
342
  }, [
265
343
  isClearable
@@ -289,45 +367,22 @@ export default defineVxeComponent({
289
367
  : null
290
368
  }
291
369
 
292
- passwordInputMethods = {
293
- dispatchEvent (type, params, evnt) {
294
- emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params))
295
- },
296
-
297
- focus () {
298
- const inputElem = refInputTarget.value
299
- reactData.isActivated = true
300
- inputElem.focus()
301
- return nextTick()
302
- },
303
- blur () {
304
- const inputElem = refInputTarget.value
305
- inputElem.blur()
306
- reactData.isActivated = false
307
- return nextTick()
308
- },
309
- select () {
310
- const inputElem = refInputTarget.value
311
- inputElem.select()
312
- reactData.isActivated = false
313
- return nextTick()
314
- }
315
- }
316
-
317
- Object.assign($xePasswordInput, passwordInputMethods)
318
-
319
- watch(() => props.modelValue, (val) => {
320
- reactData.inputValue = val
321
- })
322
-
323
370
  const renderVN = () => {
324
- const { className, name, disabled, readonly, autocomplete, autoComplete, maxLength } = props
371
+ const { className, inputClassName, name, readonly, autocomplete, autoComplete, maxLength } = props
325
372
  const { inputValue, isActivated } = reactData
373
+ const isDisabled = computeIsDisabled.value
374
+ const formReadonly = computeFormReadonly.value
375
+ if (formReadonly) {
376
+ return h('div', {
377
+ ref: refElem,
378
+ class: ['vxe-password-input--readonly', className]
379
+ }, getText(inputValue))
380
+ }
326
381
  const vSize = computeSize.value
327
- const inpReadonly = computeInpReadonly.value
328
382
  const inputType = computeInputType.value
329
383
  const inpPlaceholder = computeInpPlaceholder.value
330
384
  const isClearable = computeIsClearable.value
385
+ const inputReadonly = computeInputReadonly.value
331
386
  const prefix = renderPrefixIcon()
332
387
  const suffix = renderSuffixIcon()
333
388
  return h('div', {
@@ -337,9 +392,9 @@ export default defineVxeComponent({
337
392
  'is--prefix': !!prefix,
338
393
  'is--suffix': !!suffix,
339
394
  'is--readonly': readonly,
340
- 'is--disabled': disabled,
395
+ 'is--disabled': isDisabled,
341
396
  'is--active': isActivated,
342
- 'show--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
397
+ 'show--clear': isClearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
343
398
  }],
344
399
  spellcheck: false
345
400
  }, [
@@ -349,13 +404,12 @@ export default defineVxeComponent({
349
404
  }, [
350
405
  h('input', {
351
406
  ref: refInputTarget,
352
- class: 'vxe-password-input--inner',
353
- value: inputValue,
407
+ class: 'vxe-password-input--inner' + (inputClassName ? (' ' + inputClassName) : ''),
354
408
  name,
355
409
  type: inputType,
356
410
  placeholder: inpPlaceholder,
357
- readonly: inpReadonly,
358
- disabled,
411
+ readonly: inputReadonly,
412
+ disabled: isDisabled,
359
413
  autocomplete: autocomplete || autoComplete,
360
414
  maxlength: maxLength,
361
415
  onClick: clickEvent,
@@ -369,6 +423,28 @@ export default defineVxeComponent({
369
423
  ])
370
424
  }
371
425
 
426
+ watch(() => props.modelValue, (val) => {
427
+ reactData.inputValue = val
428
+ })
429
+
430
+ const rDvFlag = ref(0)
431
+ watch(computeFormReadonly, () => {
432
+ rDvFlag.value++
433
+ })
434
+ watch(computeDomValue, () => {
435
+ rDvFlag.value++
436
+ })
437
+ watch(rDvFlag, () => {
438
+ updateDomValue()
439
+ nextTick(() => {
440
+ updateDomValue()
441
+ })
442
+ })
443
+
444
+ onMounted(() => {
445
+ updateDomValue()
446
+ })
447
+
372
448
  $xePasswordInput.renderVN = renderVN
373
449
 
374
450
  return $xePasswordInput
@@ -1,11 +1,11 @@
1
- import { h, ref, Ref, computed, nextTick, watch, PropType, reactive, inject } from 'vue'
1
+ import { h, ref, Ref, computed, nextTick, watch, PropType, reactive, inject, onMounted } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { getConfig, getI18n, createEvent, useSize } from '../../ui'
5
5
  import { getFuncText } from '../../ui/src/utils'
6
6
  import { createComponentLog } from '../../ui/src/log'
7
7
 
8
- import type { VxeTextareaPropTypes, TextareaReactData, TextareaMethods, VxeTextareaConstructor, VxeTextareaEmits, TextareaPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
8
+ import type { VxeTextareaPropTypes, TextareaReactData, TextareaMethods, VxeTextareaConstructor, VxeTextareaEmits, TextareaPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf } from '../../../types'
9
9
 
10
10
  const { warnLog } = createComponentLog('textarea')
11
11
 
@@ -16,6 +16,10 @@ export default defineVxeComponent({
16
16
  props: {
17
17
  modelValue: [String, Number] as PropType<VxeTextareaPropTypes.ModelValue>,
18
18
  className: String as PropType<VxeTextareaPropTypes.ClassName>,
19
+ inputClassName: {
20
+ type: String as PropType<VxeTextareaPropTypes.InputClassName>,
21
+ default: () => getConfig().textarea.inputClassName
22
+ },
19
23
  immediate: {
20
24
  type: Boolean as PropType<VxeTextareaPropTypes.Immediate>,
21
25
  default: true
@@ -114,8 +118,6 @@ export default defineVxeComponent({
114
118
  getRefMaps: () => refMaps
115
119
  } as unknown as VxeTextareaConstructor
116
120
 
117
- let textareaMethods = {} as TextareaMethods
118
-
119
121
  const computeFormReadonly = computed(() => {
120
122
  const { readonly } = props
121
123
  if (readonly === null) {
@@ -178,6 +180,23 @@ export default defineVxeComponent({
178
180
  return Object.assign({ minRows: 1, maxRows: 10 }, getConfig().textarea.autoSize, autoSize)
179
181
  })
180
182
 
183
+ const computeDomValue = computed(() => {
184
+ const { inputValue } = reactData
185
+ return inputValue
186
+ })
187
+
188
+ const dispatchEvent = (type: ValueOf<VxeTextareaEmits>, params: Record<string, any>, evnt: Event | null) => {
189
+ emit(type, createEvent(evnt, { $textarea: $xeTextarea }, params))
190
+ }
191
+
192
+ const updateDomValue = () => {
193
+ const domValue = computeDomValue.value
194
+ const taElem = refTextarea.value
195
+ if (taElem) {
196
+ taElem.value = XEUtils.eqNull(domValue) ? '' : ('' + domValue)
197
+ }
198
+ }
199
+
181
200
  const updateAutoTxt = () => {
182
201
  const { size, autosize, autoSize } = props
183
202
  const { inputValue } = reactData
@@ -239,7 +258,7 @@ export default defineVxeComponent({
239
258
 
240
259
  const triggerEvent = (evnt: Event & { type: 'focus' | 'blur' | 'change' }) => {
241
260
  const value = reactData.inputValue
242
- $xeTextarea.dispatchEvent(evnt.type, { value }, evnt)
261
+ dispatchEvent(evnt.type, { value }, evnt)
243
262
  }
244
263
 
245
264
  const handleChange = (value: string, evnt: Event) => {
@@ -270,7 +289,7 @@ export default defineVxeComponent({
270
289
  $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
271
290
  }
272
291
  }
273
- $xeTextarea.dispatchEvent('input', { value }, evnt)
292
+ dispatchEvent('input', { value }, evnt)
274
293
  handleResize()
275
294
  }
276
295
 
@@ -281,7 +300,7 @@ export default defineVxeComponent({
281
300
  } else {
282
301
  handleChange(reactData.inputValue, evnt)
283
302
  }
284
- $xeTextarea.dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
303
+ dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
285
304
  }
286
305
 
287
306
  const blurEvent = (evnt: Event & { type: 'blur' }) => {
@@ -290,20 +309,16 @@ export default defineVxeComponent({
290
309
  if (!immediate) {
291
310
  handleChange(inputValue, evnt)
292
311
  }
293
- $xeTextarea.dispatchEvent('blur', { value: inputValue }, evnt)
312
+ dispatchEvent('blur', { value: inputValue }, evnt)
294
313
  }
295
314
 
296
- textareaMethods = {
297
- dispatchEvent (type, params, evnt) {
298
- emit(type, createEvent(evnt, { $textarea: $xeTextarea }, params))
299
- },
300
-
315
+ const textareaMethods: TextareaMethods = {
316
+ dispatchEvent,
301
317
  focus () {
302
318
  const textElem = refTextarea.value
303
319
  textElem.focus()
304
320
  return nextTick()
305
321
  },
306
-
307
322
  blur () {
308
323
  const textElem = refTextarea.value
309
324
  textElem.blur()
@@ -314,7 +329,7 @@ export default defineVxeComponent({
314
329
  Object.assign($xeTextarea, textareaMethods)
315
330
 
316
331
  const renderVN = () => {
317
- const { className, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props
332
+ const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props
318
333
  const { inputValue } = reactData
319
334
  const vSize = computeSize.value
320
335
  const isDisabled = computeIsDisabled.value
@@ -349,8 +364,7 @@ export default defineVxeComponent({
349
364
  }, [
350
365
  h('textarea', {
351
366
  ref: refTextarea,
352
- class: 'vxe-textarea--inner',
353
- value: inputValue,
367
+ class: 'vxe-textarea--inner' + (inputClassName ? (' ' + inputClassName) : ''),
354
368
  name: props.name,
355
369
  placeholder: inpPlaceholder,
356
370
  maxlength: inpMaxLength,
@@ -404,6 +418,24 @@ export default defineVxeComponent({
404
418
  handleResize()
405
419
  })
406
420
 
421
+ const rDvFlag = ref(0)
422
+ watch(computeFormReadonly, () => {
423
+ rDvFlag.value++
424
+ })
425
+ watch(computeDomValue, () => {
426
+ rDvFlag.value++
427
+ })
428
+ watch(rDvFlag, () => {
429
+ updateDomValue()
430
+ })
431
+
432
+ onMounted(() => {
433
+ updateDomValue()
434
+ nextTick(() => {
435
+ updateDomValue()
436
+ })
437
+ })
438
+
407
439
  nextTick(() => {
408
440
  const { autosize, autoSize } = props
409
441
  if (autosize) {
@@ -26,6 +26,10 @@
26
26
  }
27
27
  }
28
28
 
29
+ .vxe-password-input--readonly {
30
+ color: var(--vxe-ui-font-color);
31
+ display: inline-flex;
32
+ }
29
33
  .vxe-password-input--wrapper {
30
34
  flex-grow: 1;
31
35
  overflow: hidden;
@@ -30,6 +30,7 @@ export namespace VxeDatePickerPropTypes {
30
30
  export type Size = VxeComponentSizeType
31
31
  export type ModelValue = string | number | Date | null
32
32
  export type ClassName = string
33
+ export type InputClassName = string
33
34
  export type Immediate = boolean
34
35
  export type Name = string
35
36
  export type Type = VxeDatePanelPropTypes.Type
@@ -148,6 +149,7 @@ export interface VxeDatePickerProps {
148
149
  size?: VxeDatePickerPropTypes.Size
149
150
  modelValue?: VxeDatePickerPropTypes.ModelValue
150
151
  className?: VxeDatePickerPropTypes.ClassName
152
+ inputClassName?: VxeDatePickerPropTypes.InputClassName
151
153
  immediate?: VxeDatePickerPropTypes.Immediate
152
154
  name?: VxeDatePickerPropTypes.Name
153
155
  type?: VxeDatePickerPropTypes.Type
@@ -32,6 +32,7 @@ export namespace VxeDateRangePickerPropTypes {
32
32
  export type StartValue = string | number | Date | null
33
33
  export type EndValue = string | number | Date | null
34
34
  export type ClassName = string
35
+ export type InputClassName = string
35
36
  export type Immediate = boolean
36
37
  export type Name = string
37
38
  export type Type = VxeDatePanelPropTypes.Type
@@ -133,6 +134,7 @@ export interface VxeDateRangePickerProps {
133
134
  startValue?: VxeDateRangePickerPropTypes.StartValue
134
135
  endValue?: VxeDateRangePickerPropTypes.EndValue
135
136
  className?: VxeDateRangePickerPropTypes.ClassName
137
+ inputClassName?: VxeDateRangePickerPropTypes.InputClassName
136
138
  immediate?: VxeDateRangePickerPropTypes.Immediate
137
139
  name?: VxeDateRangePickerPropTypes.Name
138
140
  type?: VxeDateRangePickerPropTypes.Type
@@ -27,6 +27,7 @@ export namespace VxeInputPropTypes {
27
27
  export type Size = VxeComponentSizeType
28
28
  export type ModelValue = string | number | Date | undefined | null
29
29
  export type ClassName = string
30
+ export type InputClassName = string
30
31
  export type Immediate = boolean
31
32
  export type Name = string
32
33
  export type Title = string
@@ -94,6 +95,7 @@ export interface VxeInputProps {
94
95
  size?: VxeInputPropTypes.Size
95
96
  modelValue?: VxeInputPropTypes.ModelValue
96
97
  className?: VxeInputPropTypes.ClassName
98
+ inputClassName?: VxeInputPropTypes.InputClassName
97
99
  immediate?: VxeInputPropTypes.Immediate
98
100
  name?: VxeInputPropTypes.Name
99
101
  title?: VxeInputPropTypes.Title
@@ -26,6 +26,7 @@ export namespace VxeNumberInputPropTypes {
26
26
  export type Size = VxeComponentSizeType
27
27
  export type ModelValue = string | number | null
28
28
  export type ClassName = string
29
+ export type InputClassName = string
29
30
  export type Immediate = boolean
30
31
  export type Name = string
31
32
  export type Type = 'number' | 'integer' | 'float' | 'amount'
@@ -112,6 +113,7 @@ export interface VxeNumberInputProps {
112
113
  size?: VxeNumberInputPropTypes.Size
113
114
  modelValue?: VxeNumberInputPropTypes.ModelValue
114
115
  className?: VxeNumberInputPropTypes.ClassName
116
+ inputClassName?: VxeNumberInputPropTypes.InputClassName
115
117
  immediate?: VxeNumberInputPropTypes.Immediate
116
118
  name?: VxeNumberInputPropTypes.Name
117
119
  type?: VxeNumberInputPropTypes.Type
@@ -27,6 +27,7 @@ export namespace VxePasswordInputPropTypes {
27
27
  export type ModelValue = string | null
28
28
  export type Immediate = boolean
29
29
  export type ClassName = string
30
+ export type InputClassName = string
30
31
  export type Name = string
31
32
  export type Clearable = boolean
32
33
  export type Readonly = boolean
@@ -37,6 +38,7 @@ export namespace VxePasswordInputPropTypes {
37
38
  export type PrefixIcon = string
38
39
  export type SuffixIcon = string
39
40
  export type Controls = boolean
41
+ export type Editable = boolean
40
42
  /**
41
43
  * 请使用 AutoComplete
42
44
  * @deprecated
@@ -49,6 +51,7 @@ export interface VxePasswordInputProps {
49
51
  modelValue?: VxePasswordInputPropTypes.ModelValue
50
52
  immediate?: VxePasswordInputPropTypes.Immediate
51
53
  className?: VxePasswordInputPropTypes.ClassName
54
+ inputClassName?: VxePasswordInputPropTypes.InputClassName
52
55
  name?: VxePasswordInputPropTypes.Name
53
56
  clearable?: VxePasswordInputPropTypes.Clearable
54
57
  readonly?: VxePasswordInputPropTypes.Readonly
@@ -59,6 +62,7 @@ export interface VxePasswordInputProps {
59
62
  prefixIcon?: VxePasswordInputPropTypes.PrefixIcon
60
63
  suffixIcon?: VxePasswordInputPropTypes.SuffixIcon
61
64
  controls?: VxePasswordInputPropTypes.Controls
65
+ editable?: VxePasswordInputPropTypes.Editable
62
66
  /**
63
67
  * 请使用 AutoComplete
64
68
  * @deprecated
@@ -1,4 +1,4 @@
1
- import { VxeTableDefines } from '../table'
1
+ import { VxeTableConstructor, VxeTableDefines } from '../table'
2
2
 
3
3
  /* eslint-disable no-use-before-define */
4
4
 
@@ -206,7 +206,17 @@ export interface TableEditPrivateMethods<D = any> {
206
206
  /**
207
207
  * @private
208
208
  */
209
- handleEdit(params: any, evnt: any, options?: {
209
+ handleEdit(params: {
210
+ $table: VxeTableConstructor<D>
211
+ column: VxeTableDefines.ColumnInfo<D>
212
+ columnIndex: number
213
+ _columnIndex: number
214
+ $columnIndex: number
215
+ row: D
216
+ rowIndex: number
217
+ $rowIndex: number
218
+ _rowIndex: number
219
+ }, evnt: any, options?: {
210
220
  isClear?: boolean
211
221
  }): Promise<any>
212
222
  /**
@@ -216,11 +226,34 @@ export interface TableEditPrivateMethods<D = any> {
216
226
  /**
217
227
  * @private
218
228
  */
219
- handleFocus(params: any, evnt?: any): void
229
+ handleCellFocus(cell: HTMLElement, params: {
230
+ $table: VxeTableConstructor<D>
231
+ column: VxeTableDefines.ColumnInfo<D>
232
+ row: D
233
+ }): HTMLInputElement | null
234
+ /**
235
+ * @private
236
+ */
237
+ handleFocus(params: {
238
+ $table: VxeTableConstructor<D>
239
+ column: VxeTableDefines.ColumnInfo<D>
240
+ row: D
241
+ cell: HTMLElement
242
+ }, evnt?: Event | null): void
220
243
  /**
221
244
  * @private
222
245
  */
223
- handleSelected(params: any, evnt: any): Promise<any>
246
+ handleSelected(params: {
247
+ $table: VxeTableConstructor<D>
248
+ column: VxeTableDefines.ColumnInfo<D>
249
+ columnIndex: number
250
+ _columnIndex: number
251
+ $columnIndex: number
252
+ row: D
253
+ rowIndex: number
254
+ $rowIndex: number
255
+ _rowIndex: number
256
+ }, evnt: Event | null): Promise<any>
224
257
  /**
225
258
  * @private
226
259
  */