vxe-pc-ui 3.17.13 → 3.17.15
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/es/backtop/src/backtop.js +1 -4
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +1 -0
- package/es/input/style.css +2 -2
- package/es/input/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/textarea/src/textarea.js +48 -10
- package/es/textarea/style.css +23 -1
- package/es/textarea/style.min.css +1 -1
- package/es/ui/index.js +3 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-input/style.css +2 -2
- package/es/vxe-input/style.min.css +1 -1
- package/es/vxe-textarea/style.css +23 -1
- package/es/vxe-textarea/style.min.css +1 -1
- package/lib/backtop/src/backtop.js +1 -4
- package/lib/backtop/src/backtop.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +43 -11
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +2 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +2 -2
- package/lib/input/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +36 -4
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/textarea/style/style.css +23 -1
- package/lib/textarea/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-input/style/style.css +2 -2
- package/lib/vxe-input/style/style.min.css +1 -1
- package/lib/vxe-textarea/style/style.css +23 -1
- package/lib/vxe-textarea/style/style.min.css +1 -1
- package/package.json +3 -2
- package/packages/backtop/src/backtop.ts +1 -4
- package/packages/input/src/input.ts +1 -0
- package/packages/textarea/src/textarea.ts +49 -10
- package/packages/ui/index.ts +3 -0
- package/styles/components/input.scss +2 -2
- package/styles/components/textarea.scss +31 -1
- package/types/components/grid.d.ts +5 -5
- package/types/components/textarea.d.ts +5 -0
- package/types/ui/global-icon.d.ts +3 -0
- /package/es/icon/{iconfont.1787300561651.ttf → iconfont.1787558427558.ttf} +0 -0
- /package/es/icon/{iconfont.1787300561651.woff → iconfont.1787558427558.woff} +0 -0
- /package/es/icon/{iconfont.1787300561651.woff2 → iconfont.1787558427558.woff2} +0 -0
- /package/es/{iconfont.1787300561651.ttf → iconfont.1787558427558.ttf} +0 -0
- /package/es/{iconfont.1787300561651.woff → iconfont.1787558427558.woff} +0 -0
- /package/es/{iconfont.1787300561651.woff2 → iconfont.1787558427558.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1787300561651.ttf → iconfont.1787558427558.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1787300561651.woff → iconfont.1787558427558.woff} +0 -0
- /package/lib/icon/style/{iconfont.1787300561651.woff2 → iconfont.1787558427558.woff2} +0 -0
- /package/lib/{iconfont.1787300561651.ttf → iconfont.1787558427558.ttf} +0 -0
- /package/lib/{iconfont.1787300561651.woff → iconfont.1787558427558.woff} +0 -0
- /package/lib/{iconfont.1787300561651.woff2 → iconfont.1787558427558.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropType, CreateElement, VNode } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import { getConfig, getI18n, createEvent, globalMixins } from '../../ui'
|
|
4
|
+
import { getConfig, getIcon, getI18n, createEvent, globalMixins, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getFuncText } from '../../ui/src/utils'
|
|
6
6
|
import { createComponentLog } from '../../ui/src/log'
|
|
7
7
|
|
|
@@ -44,6 +44,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
44
44
|
type: Boolean as PropType<VxeTextareaPropTypes.Disabled>,
|
|
45
45
|
default: null
|
|
46
46
|
},
|
|
47
|
+
clearable: {
|
|
48
|
+
type: Boolean as PropType<VxeTextareaPropTypes.Clearable>,
|
|
49
|
+
default: () => getConfig().textarea.clearable
|
|
50
|
+
},
|
|
47
51
|
placeholder: String as PropType<VxeTextareaPropTypes.Placeholder>,
|
|
48
52
|
maxLength: [String, Number] as PropType<VxeTextareaPropTypes.MaxLength>,
|
|
49
53
|
trim: {
|
|
@@ -60,6 +64,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
60
64
|
},
|
|
61
65
|
showWordCount: Boolean as PropType<VxeTextareaPropTypes.ShowWordCount>,
|
|
62
66
|
countMethod: Function as PropType<VxeTextareaPropTypes.CountMethod>,
|
|
67
|
+
autoFocus: {
|
|
68
|
+
type: Boolean as PropType<VxeTextareaPropTypes.AutoFocus>,
|
|
69
|
+
default: null
|
|
70
|
+
},
|
|
63
71
|
/**
|
|
64
72
|
* 已废弃,被 auto-size 替换
|
|
65
73
|
* @deprecated
|
|
@@ -316,6 +324,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
316
324
|
}
|
|
317
325
|
}
|
|
318
326
|
},
|
|
327
|
+
clearValueEvent (evnt: Event, value: VxeTextareaPropTypes.ModelValue) {
|
|
328
|
+
const $xeTextarea = this
|
|
329
|
+
const props = $xeTextarea
|
|
330
|
+
|
|
331
|
+
const { autoFocus } = props
|
|
332
|
+
if (autoFocus || autoFocus === null) {
|
|
333
|
+
focus()
|
|
334
|
+
}
|
|
335
|
+
$xeTextarea.handleChange('', evnt)
|
|
336
|
+
$xeTextarea.dispatchEvent('clear', { value }, evnt)
|
|
337
|
+
},
|
|
319
338
|
inputEvent (evnt: InputEvent) {
|
|
320
339
|
const $xeTextarea = this
|
|
321
340
|
const props = $xeTextarea
|
|
@@ -372,7 +391,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
372
391
|
const props = $xeTextarea
|
|
373
392
|
const reactData = $xeTextarea.reactData
|
|
374
393
|
|
|
375
|
-
const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props
|
|
394
|
+
const { className, inputClassName, resize, autosize, autoSize, showWordCount, countMethod, rows, cols, clearable } = props
|
|
376
395
|
const { inputValue } = reactData
|
|
377
396
|
const vSize = $xeTextarea.computeSize
|
|
378
397
|
const isDisabled = $xeTextarea.computeIsDisabled
|
|
@@ -400,8 +419,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
400
419
|
'is--autosize': autosize || autoSize,
|
|
401
420
|
'is--count': showWordCount,
|
|
402
421
|
'is--disabled': isDisabled,
|
|
422
|
+
'is-clear': clearable,
|
|
403
423
|
'is--rows': !XEUtils.eqNull(rows),
|
|
404
|
-
'is--cols': !XEUtils.eqNull(cols)
|
|
424
|
+
'is--cols': !XEUtils.eqNull(cols),
|
|
425
|
+
'show--clear': clearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
|
|
405
426
|
}],
|
|
406
427
|
attrs: {
|
|
407
428
|
spellcheck: false
|
|
@@ -437,13 +458,31 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
437
458
|
blur: $xeTextarea.blurEvent
|
|
438
459
|
}
|
|
439
460
|
}),
|
|
440
|
-
showWordCount
|
|
441
|
-
? h('
|
|
442
|
-
class:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
461
|
+
clearable || showWordCount
|
|
462
|
+
? h('div', {
|
|
463
|
+
class: 'vxe-textarea--suffix'
|
|
464
|
+
}, [
|
|
465
|
+
clearable
|
|
466
|
+
? h('div', {
|
|
467
|
+
class: 'vxe-textarea--clear-icon',
|
|
468
|
+
on: {
|
|
469
|
+
click: $xeTextarea.clearValueEvent
|
|
470
|
+
}
|
|
471
|
+
}, [
|
|
472
|
+
h('i', {
|
|
473
|
+
class: getIcon().TEXTAREA_CLEAR
|
|
474
|
+
})
|
|
475
|
+
])
|
|
476
|
+
: renderEmptyElement($xeTextarea),
|
|
477
|
+
showWordCount
|
|
478
|
+
? h('span', {
|
|
479
|
+
class: ['vxe-textarea--count', {
|
|
480
|
+
'is--error': isCountError
|
|
481
|
+
}]
|
|
482
|
+
}, countMethod ? `${countMethod({ value: inputValue })}` : `${inputCount}${inpMaxLength ? `/${inpMaxLength}` : ''}`)
|
|
483
|
+
: renderEmptyElement($xeTextarea)
|
|
484
|
+
])
|
|
485
|
+
: renderEmptyElement($xeTextarea)
|
|
447
486
|
])
|
|
448
487
|
}
|
|
449
488
|
},
|
package/packages/ui/index.ts
CHANGED
|
@@ -550,6 +550,9 @@ setIcon({
|
|
|
550
550
|
CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
|
|
551
551
|
CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
|
|
552
552
|
|
|
553
|
+
// textarea
|
|
554
|
+
TEXTAREA_CLEAR: iconPrefix + 'error-circle-fill',
|
|
555
|
+
|
|
553
556
|
// input
|
|
554
557
|
INPUT_CLEAR: iconPrefix + 'error-circle-fill',
|
|
555
558
|
INPUT_SEARCH: iconPrefix + 'search',
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
&.show--clear {
|
|
111
111
|
&:hover {
|
|
112
112
|
.vxe-input--clear-icon {
|
|
113
|
-
|
|
113
|
+
visibility: visible;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
cursor: pointer;
|
|
159
159
|
}
|
|
160
160
|
.vxe-input--clear-icon {
|
|
161
|
-
|
|
161
|
+
visibility: hidden;
|
|
162
162
|
&:hover {
|
|
163
163
|
color: var(--vxe-ui-font-color);
|
|
164
164
|
}
|
|
@@ -43,6 +43,21 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
.vxe-textarea {
|
|
47
|
+
&.is-clear {
|
|
48
|
+
.vxe-textarea--inner {
|
|
49
|
+
padding-right: 2em;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&.show--clear {
|
|
53
|
+
&:hover {
|
|
54
|
+
.vxe-textarea--clear-icon {
|
|
55
|
+
visibility: visible;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
46
61
|
.vxe-textarea--inner,
|
|
47
62
|
.vxe-textarea--autosize,
|
|
48
63
|
.vxe-textarea--content {
|
|
@@ -67,7 +82,7 @@
|
|
|
67
82
|
|
|
68
83
|
.vxe-textarea--count {
|
|
69
84
|
position: absolute;
|
|
70
|
-
bottom: 0.
|
|
85
|
+
bottom: 0.3em;
|
|
71
86
|
right: 1.4em;
|
|
72
87
|
padding-left: 0.2em;
|
|
73
88
|
color: var(--vxe-ui-input-count-color);
|
|
@@ -77,6 +92,21 @@
|
|
|
77
92
|
}
|
|
78
93
|
}
|
|
79
94
|
|
|
95
|
+
.vxe-textarea--clear-icon {
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 0.3rem;
|
|
98
|
+
right: 1.4em;
|
|
99
|
+
color: var(--vxe-ui-input-placeholder-color);
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
visibility: hidden;
|
|
102
|
+
&:hover {
|
|
103
|
+
color: var(--vxe-ui-font-color);
|
|
104
|
+
}
|
|
105
|
+
&:active {
|
|
106
|
+
color: var(--vxe-ui-font-primary-color);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
80
110
|
.vxe-textarea,
|
|
81
111
|
.vxe-textarea--autosize {
|
|
82
112
|
font-size: var(--vxe-ui-font-size-default);
|
|
@@ -193,7 +193,7 @@ export namespace VxeGridPropTypes {
|
|
|
193
193
|
*/
|
|
194
194
|
ajax?: {
|
|
195
195
|
/**
|
|
196
|
-
*
|
|
196
|
+
* 查询列表数据之前方法,可以返回 false 阻止本次操作
|
|
197
197
|
*/
|
|
198
198
|
beforeQuery?(params: ProxyAjaxQueryParams<D>, ...args: any[]): boolean | Promise<boolean>
|
|
199
199
|
/**
|
|
@@ -214,7 +214,7 @@ export namespace VxeGridPropTypes {
|
|
|
214
214
|
queryError?(params: ProxyAjaxQueryParams<D> & ProxyAjaxResponseParams): void
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
-
*
|
|
217
|
+
* 查询全量数据之前方法,可以返回 false 阻止本次操作
|
|
218
218
|
*/
|
|
219
219
|
beforeQueryAll?(params: ProxyAjaxQueryAllParams<D>): boolean | Promise<boolean>
|
|
220
220
|
/**
|
|
@@ -235,7 +235,7 @@ export namespace VxeGridPropTypes {
|
|
|
235
235
|
queryAllError?(params: ProxyAjaxQueryAllParams<D> & ProxyAjaxResponseParams): void
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
238
|
+
* 查询表尾数据之前方法,可以返回 false 阻止本次操作
|
|
239
239
|
*/
|
|
240
240
|
beforeQueryFooter?(params: ProxyAjaxQueryFooterParams<D>, ...args: any[]): boolean | Promise<boolean>
|
|
241
241
|
/**
|
|
@@ -256,7 +256,7 @@ export namespace VxeGridPropTypes {
|
|
|
256
256
|
queryFooterError?(params: ProxyAjaxQueryFooterParams<D> & ProxyAjaxResponseParams): void
|
|
257
257
|
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
259
|
+
* 删除列表数据之前方法,可以返回 false 阻止本次操作
|
|
260
260
|
*/
|
|
261
261
|
beforeDelete?(params: ProxyAjaxDeleteParams<D>, ...args: any[]): boolean | Promise<boolean>
|
|
262
262
|
/**
|
|
@@ -277,7 +277,7 @@ export namespace VxeGridPropTypes {
|
|
|
277
277
|
deleteError?(params: ProxyAjaxDeleteParams<D> & ProxyAjaxResponseParams): void
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
|
-
*
|
|
280
|
+
* 保存数据之前方法,可以返回 false 阻止本次操作
|
|
281
281
|
*/
|
|
282
282
|
beforeSave?(params: ProxyAjaxSaveParams<D>, ...args: any[]): boolean | Promise<boolean>
|
|
283
283
|
/**
|
|
@@ -25,6 +25,8 @@ export namespace VxeTextareaPropTypes {
|
|
|
25
25
|
export type Readonly = boolean
|
|
26
26
|
export type Editable = boolean
|
|
27
27
|
export type Disabled = boolean
|
|
28
|
+
export type Clearable = boolean
|
|
29
|
+
export type AutoFocus = boolean
|
|
28
30
|
export type Placeholder = string
|
|
29
31
|
export type MaxLength = string | number | null
|
|
30
32
|
export type Trim = boolean
|
|
@@ -86,6 +88,8 @@ export interface VxeTextareaProps {
|
|
|
86
88
|
* 是否禁用
|
|
87
89
|
*/
|
|
88
90
|
disabled?: VxeTextareaPropTypes.Disabled
|
|
91
|
+
clearable?: VxeTextareaPropTypes.Clearable
|
|
92
|
+
autoFocus?: VxeTextareaPropTypes.AutoFocus
|
|
89
93
|
/**
|
|
90
94
|
* 当值为空时,显示的占位符
|
|
91
95
|
*/
|
|
@@ -172,6 +176,7 @@ export type VxeTextareaEmits = [
|
|
|
172
176
|
'change',
|
|
173
177
|
'focus',
|
|
174
178
|
'blur',
|
|
179
|
+
'clear',
|
|
175
180
|
'lazy-change'
|
|
176
181
|
]
|
|
177
182
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|