vxe-pc-ui 4.14.25 → 4.14.26
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/dist/all.esm.js +71 -27
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/textarea/src/textarea.js +70 -25
- package/es/textarea/style.css +11 -4
- package/es/textarea/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-textarea/style.css +11 -4
- package/es/vxe-textarea/style.min.css +1 -1
- package/lib/index.umd.js +83 -28
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +81 -26
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/textarea/style/style.css +11 -4
- package/lib/textarea/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -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-textarea/style/style.css +11 -4
- package/lib/vxe-textarea/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/textarea/src/textarea.ts +73 -28
- package/styles/components/textarea.scss +11 -4
- package/types/components/column.d.ts +1 -0
- package/types/components/table-plugins/extend-cell-area.d.ts +11 -0
- package/types/components/table.d.ts +4 -0
- package/types/components/textarea.d.ts +22 -1
- /package/es/icon/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
- /package/es/icon/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
- /package/es/icon/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
- /package/es/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
- /package/es/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
- /package/es/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
- /package/lib/icon/style/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
- /package/lib/{iconfont.1780114491819.ttf → iconfont.1780292459831.ttf} +0 -0
- /package/lib/{iconfont.1780114491819.woff → iconfont.1780292459831.woff} +0 -0
- /package/lib/{iconfont.1780114491819.woff2 → iconfont.1780292459831.woff2} +0 -0
|
@@ -3,6 +3,7 @@ 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
|
+
import { warnLog } from '../../ui/src/log';
|
|
6
7
|
let autoTxtElem;
|
|
7
8
|
export default defineVxeComponent({
|
|
8
9
|
name: 'VxeTextarea',
|
|
@@ -42,7 +43,18 @@ export default defineVxeComponent({
|
|
|
42
43
|
},
|
|
43
44
|
showWordCount: Boolean,
|
|
44
45
|
countMethod: Function,
|
|
45
|
-
|
|
46
|
+
/**
|
|
47
|
+
* 已废弃,被 auto-size 替换
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
autosize: {
|
|
51
|
+
type: [Boolean, Object],
|
|
52
|
+
default: null
|
|
53
|
+
},
|
|
54
|
+
autoSize: {
|
|
55
|
+
type: [Boolean, Object],
|
|
56
|
+
default: null
|
|
57
|
+
},
|
|
46
58
|
form: String,
|
|
47
59
|
resize: {
|
|
48
60
|
type: String,
|
|
@@ -77,6 +89,7 @@ export default defineVxeComponent({
|
|
|
77
89
|
});
|
|
78
90
|
const refElem = ref();
|
|
79
91
|
const refTextarea = ref();
|
|
92
|
+
const refContent = ref();
|
|
80
93
|
const refMaps = {
|
|
81
94
|
refElem,
|
|
82
95
|
refTextarea
|
|
@@ -137,19 +150,26 @@ export default defineVxeComponent({
|
|
|
137
150
|
return inpMaxLength && inputCount > XEUtils.toNumber(inpMaxLength);
|
|
138
151
|
});
|
|
139
152
|
const computeSizeOpts = computed(() => {
|
|
140
|
-
|
|
153
|
+
const { autosize, autoSize } = props;
|
|
154
|
+
if (autosize || getConfig().textarea.autosize) {
|
|
155
|
+
return Object.assign({ minRows: 1, maxRows: 10 }, getConfig().textarea.autosize, autosize);
|
|
156
|
+
}
|
|
157
|
+
return Object.assign({ minRows: 1, maxRows: 10 }, getConfig().textarea.autoSize, autoSize);
|
|
141
158
|
});
|
|
142
159
|
const updateAutoTxt = () => {
|
|
143
|
-
const { size, autosize } = props;
|
|
160
|
+
const { size, autosize, autoSize } = props;
|
|
144
161
|
const { inputValue } = reactData;
|
|
145
|
-
if (autosize) {
|
|
162
|
+
if (autosize || autoSize) {
|
|
163
|
+
const formReadonly = computeFormReadonly.value;
|
|
146
164
|
if (!autoTxtElem) {
|
|
147
165
|
autoTxtElem = document.createElement('div');
|
|
148
166
|
}
|
|
149
167
|
if (!autoTxtElem.parentNode) {
|
|
150
168
|
document.body.appendChild(autoTxtElem);
|
|
151
169
|
}
|
|
152
|
-
const
|
|
170
|
+
const taElem = refTextarea.value;
|
|
171
|
+
const ctElem = refContent.value;
|
|
172
|
+
const textElem = formReadonly ? ctElem : taElem;
|
|
153
173
|
if (!textElem) {
|
|
154
174
|
return;
|
|
155
175
|
}
|
|
@@ -161,11 +181,15 @@ export default defineVxeComponent({
|
|
|
161
181
|
}
|
|
162
182
|
};
|
|
163
183
|
const handleResize = () => {
|
|
164
|
-
|
|
184
|
+
const { autosize, autoSize } = props;
|
|
185
|
+
if (autosize || autoSize) {
|
|
165
186
|
nextTick(() => {
|
|
166
187
|
const sizeOpts = computeSizeOpts.value;
|
|
188
|
+
const formReadonly = computeFormReadonly.value;
|
|
167
189
|
const { minRows, maxRows } = sizeOpts;
|
|
168
|
-
const
|
|
190
|
+
const taElem = refTextarea.value;
|
|
191
|
+
const ctElem = refContent.value;
|
|
192
|
+
const textElem = formReadonly ? ctElem : taElem;
|
|
169
193
|
if (!textElem) {
|
|
170
194
|
return;
|
|
171
195
|
}
|
|
@@ -253,23 +277,8 @@ export default defineVxeComponent({
|
|
|
253
277
|
}
|
|
254
278
|
};
|
|
255
279
|
Object.assign($xeTextarea, textareaMethods);
|
|
256
|
-
watch(() => props.modelValue, (val) => {
|
|
257
|
-
reactData.inputValue = val;
|
|
258
|
-
updateAutoTxt();
|
|
259
|
-
});
|
|
260
|
-
watch(computeSizeOpts, () => {
|
|
261
|
-
updateAutoTxt();
|
|
262
|
-
handleResize();
|
|
263
|
-
});
|
|
264
|
-
nextTick(() => {
|
|
265
|
-
const { autosize } = props;
|
|
266
|
-
if (autosize) {
|
|
267
|
-
updateAutoTxt();
|
|
268
|
-
handleResize();
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
280
|
const renderVN = () => {
|
|
272
|
-
const { className, resize, autosize, showWordCount, countMethod, rows, cols } = props;
|
|
281
|
+
const { className, resize, autosize, autoSize, showWordCount, countMethod, rows, cols } = props;
|
|
273
282
|
const { inputValue } = reactData;
|
|
274
283
|
const vSize = computeSize.value;
|
|
275
284
|
const isDisabled = computeIsDisabled.value;
|
|
@@ -283,13 +292,18 @@ export default defineVxeComponent({
|
|
|
283
292
|
return h('div', {
|
|
284
293
|
ref: refElem,
|
|
285
294
|
class: ['vxe-textarea--readonly', className]
|
|
286
|
-
},
|
|
295
|
+
}, [
|
|
296
|
+
h('div', {
|
|
297
|
+
ref: refContent,
|
|
298
|
+
class: 'vxe-textarea--content'
|
|
299
|
+
}, inputValue)
|
|
300
|
+
]);
|
|
287
301
|
}
|
|
288
302
|
return h('div', {
|
|
289
303
|
ref: refElem,
|
|
290
304
|
class: ['vxe-textarea', className, {
|
|
291
305
|
[`size--${vSize}`]: vSize,
|
|
292
|
-
'is--autosize': autosize,
|
|
306
|
+
'is--autosize': autosize || autoSize,
|
|
293
307
|
'is--count': showWordCount,
|
|
294
308
|
'is--disabled': isDisabled,
|
|
295
309
|
'is--rows': !XEUtils.eqNull(rows),
|
|
@@ -330,6 +344,37 @@ export default defineVxeComponent({
|
|
|
330
344
|
: null
|
|
331
345
|
]);
|
|
332
346
|
};
|
|
347
|
+
watch(() => props.modelValue, (val) => {
|
|
348
|
+
reactData.inputValue = val;
|
|
349
|
+
updateAutoTxt();
|
|
350
|
+
});
|
|
351
|
+
const reFlag = ref(0);
|
|
352
|
+
watch(computeFormReadonly, () => {
|
|
353
|
+
reFlag.value++;
|
|
354
|
+
});
|
|
355
|
+
watch(computeSizeOpts, () => {
|
|
356
|
+
reFlag.value++;
|
|
357
|
+
});
|
|
358
|
+
watch(() => props.autoSize, () => {
|
|
359
|
+
reFlag.value++;
|
|
360
|
+
});
|
|
361
|
+
watch(() => props.autosize, () => {
|
|
362
|
+
reFlag.value++;
|
|
363
|
+
});
|
|
364
|
+
watch(reFlag, () => {
|
|
365
|
+
updateAutoTxt();
|
|
366
|
+
handleResize();
|
|
367
|
+
});
|
|
368
|
+
nextTick(() => {
|
|
369
|
+
const { autosize, autoSize } = props;
|
|
370
|
+
if (autosize) {
|
|
371
|
+
warnLog('vxe.error.delProp', ['autosize', 'auto-size']);
|
|
372
|
+
}
|
|
373
|
+
if (autosize || autoSize) {
|
|
374
|
+
updateAutoTxt();
|
|
375
|
+
handleResize();
|
|
376
|
+
}
|
|
377
|
+
});
|
|
333
378
|
$xeTextarea.renderVN = renderVN;
|
|
334
379
|
return $xeTextarea;
|
|
335
380
|
},
|
package/es/textarea/style.css
CHANGED
|
@@ -11,15 +11,21 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.vxe-textarea--readonly {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vxe-textarea--content {
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 0.3em 0.6em;
|
|
20
|
+
overflow: auto;
|
|
21
|
+
white-space: pre-wrap;
|
|
22
|
+
word-break: break-word;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
.vxe-textarea--inner {
|
|
19
26
|
border-radius: var(--vxe-ui-base-border-radius);
|
|
20
27
|
outline: 0;
|
|
21
28
|
font-size: inherit;
|
|
22
|
-
padding: 0 0.6em;
|
|
23
29
|
color: var(--vxe-ui-font-color);
|
|
24
30
|
line-height: inherit;
|
|
25
31
|
border: 1px solid var(--vxe-ui-input-border-color);
|
|
@@ -43,7 +49,8 @@
|
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
.vxe-textarea--inner,
|
|
46
|
-
.vxe-textarea--autosize
|
|
52
|
+
.vxe-textarea--autosize,
|
|
53
|
+
.vxe-textarea--content {
|
|
47
54
|
line-height: 1.5715;
|
|
48
55
|
color: var(--vxe-ui-font-color);
|
|
49
56
|
font-family: var(--vxe-ui-font-family);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-textarea{position:relative;display:inline-flex;flex-direction:row}.vxe-textarea:not(.is--cols){width:100%}.vxe-textarea:not(.is--cols) .vxe-textarea--inner{width:100%}.vxe-textarea--readonly{
|
|
1
|
+
.vxe-textarea{position:relative;display:inline-flex;flex-direction:row}.vxe-textarea:not(.is--cols){width:100%}.vxe-textarea:not(.is--cols) .vxe-textarea--inner{width:100%}.vxe-textarea--readonly{display:flex}.vxe-textarea--content{width:100%;padding:.3em .6em;overflow:auto;white-space:pre-wrap;word-break:break-word}.vxe-textarea--inner{border-radius:var(--vxe-ui-base-border-radius);outline:0;font-size:inherit;color:var(--vxe-ui-font-color);line-height:inherit;border:1px solid var(--vxe-ui-input-border-color);background-color:var(--vxe-ui-layout-background-color);display:block;padding:.3em .6em}.vxe-textarea--inner::-moz-placeholder{color:var(--vxe-ui-input-placeholder-color)}.vxe-textarea--inner::placeholder{color:var(--vxe-ui-input-placeholder-color)}.vxe-textarea--inner:focus{border:1px solid var(--vxe-ui-font-primary-color)}.vxe-textarea--inner[disabled]{cursor:not-allowed;color:var(--vxe-ui-font-disabled-color);background-color:var(--vxe-ui-input-disabled-background-color)}.vxe-textarea--autosize,.vxe-textarea--content,.vxe-textarea--inner{line-height:1.5715;color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family)}.vxe-textarea--autosize{display:block;position:fixed;top:0;left:0;width:100%;margin:0;padding:.3em .6em;word-wrap:break-word;white-space:pre-wrap;z-index:-1;visibility:hidden}.vxe-textarea--count{position:absolute;bottom:.2em;right:1.4em;padding-left:.2em;color:var(--vxe-ui-input-count-color);background-color:var(--vxe-ui-layout-background-color)}.vxe-textarea--count.is--error{color:var(--vxe-ui-input-count-error-color)}.vxe-textarea,.vxe-textarea--autosize{font-size:var(--vxe-ui-font-size-default)}.vxe-textarea--autosize.size--medium,.vxe-textarea.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-textarea--autosize.size--small,.vxe-textarea.size--small{font-size:var(--vxe-ui-font-size-small)}.vxe-textarea--autosize.size--mini,.vxe-textarea.size--mini{font-size:var(--vxe-ui-font-size-mini)}.vxe-textarea:not(.is--autosize){min-height:var(--vxe-ui-input-height-default)}.vxe-textarea.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-textarea.size--medium:not(.is--autosize){min-height:var(--vxe-ui-input-height-medium)}.vxe-textarea.size--small:not(.is--autosize){min-height:var(--vxe-ui-input-height-small)}.vxe-textarea.size--mini:not(.is--autosize){min-height:var(--vxe-ui-input-height-mini)}
|
package/es/ui/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VxeUI, setConfig, setIcon } from '@vxe-ui/core';
|
|
2
2
|
import { dynamicApp } from '../dynamics';
|
|
3
3
|
import { warnLog } from './src/log';
|
|
4
|
-
export const version = "4.14.
|
|
4
|
+
export const version = "4.14.26";
|
|
5
5
|
VxeUI.uiVersion = version;
|
|
6
6
|
VxeUI.dynamicApp = dynamicApp;
|
|
7
7
|
export function config(options) {
|
package/es/ui/src/log.js
CHANGED
|
@@ -11,15 +11,21 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.vxe-textarea--readonly {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.vxe-textarea--content {
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 0.3em 0.6em;
|
|
20
|
+
overflow: auto;
|
|
21
|
+
white-space: pre-wrap;
|
|
22
|
+
word-break: break-word;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
.vxe-textarea--inner {
|
|
19
26
|
border-radius: var(--vxe-ui-base-border-radius);
|
|
20
27
|
outline: 0;
|
|
21
28
|
font-size: inherit;
|
|
22
|
-
padding: 0 0.6em;
|
|
23
29
|
color: var(--vxe-ui-font-color);
|
|
24
30
|
line-height: inherit;
|
|
25
31
|
border: 1px solid var(--vxe-ui-input-border-color);
|
|
@@ -43,7 +49,8 @@
|
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
.vxe-textarea--inner,
|
|
46
|
-
.vxe-textarea--autosize
|
|
52
|
+
.vxe-textarea--autosize,
|
|
53
|
+
.vxe-textarea--content {
|
|
47
54
|
line-height: 1.5715;
|
|
48
55
|
color: var(--vxe-ui-font-color);
|
|
49
56
|
font-family: var(--vxe-ui-font-family);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-textarea{position:relative;display:inline-flex;flex-direction:row}.vxe-textarea:not(.is--cols){width:100%}.vxe-textarea:not(.is--cols) .vxe-textarea--inner{width:100%}.vxe-textarea--readonly{
|
|
1
|
+
.vxe-textarea{position:relative;display:inline-flex;flex-direction:row}.vxe-textarea:not(.is--cols){width:100%}.vxe-textarea:not(.is--cols) .vxe-textarea--inner{width:100%}.vxe-textarea--readonly{display:flex}.vxe-textarea--content{width:100%;padding:.3em .6em;overflow:auto;white-space:pre-wrap;word-break:break-word}.vxe-textarea--inner{border-radius:var(--vxe-ui-base-border-radius);outline:0;font-size:inherit;color:var(--vxe-ui-font-color);line-height:inherit;border:1px solid var(--vxe-ui-input-border-color);background-color:var(--vxe-ui-layout-background-color);display:block;padding:.3em .6em}.vxe-textarea--inner::-moz-placeholder{color:var(--vxe-ui-input-placeholder-color)}.vxe-textarea--inner::placeholder{color:var(--vxe-ui-input-placeholder-color)}.vxe-textarea--inner:focus{border:1px solid var(--vxe-ui-font-primary-color)}.vxe-textarea--inner[disabled]{cursor:not-allowed;color:var(--vxe-ui-font-disabled-color);background-color:var(--vxe-ui-input-disabled-background-color)}.vxe-textarea--autosize,.vxe-textarea--content,.vxe-textarea--inner{line-height:1.5715;color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family)}.vxe-textarea--autosize{display:block;position:fixed;top:0;left:0;width:100%;margin:0;padding:.3em .6em;word-wrap:break-word;white-space:pre-wrap;z-index:-1;visibility:hidden}.vxe-textarea--count{position:absolute;bottom:.2em;right:1.4em;padding-left:.2em;color:var(--vxe-ui-input-count-color);background-color:var(--vxe-ui-layout-background-color)}.vxe-textarea--count.is--error{color:var(--vxe-ui-input-count-error-color)}.vxe-textarea,.vxe-textarea--autosize{font-size:var(--vxe-ui-font-size-default)}.vxe-textarea--autosize.size--medium,.vxe-textarea.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-textarea--autosize.size--small,.vxe-textarea.size--small{font-size:var(--vxe-ui-font-size-small)}.vxe-textarea--autosize.size--mini,.vxe-textarea.size--mini{font-size:var(--vxe-ui-font-size-mini)}.vxe-textarea:not(.is--autosize){min-height:var(--vxe-ui-input-height-default)}.vxe-textarea.size--medium{font-size:var(--vxe-ui-font-size-medium)}.vxe-textarea.size--medium:not(.is--autosize){min-height:var(--vxe-ui-input-height-medium)}.vxe-textarea.size--small:not(.is--autosize){min-height:var(--vxe-ui-input-height-small)}.vxe-textarea.size--mini:not(.is--autosize){min-height:var(--vxe-ui-input-height-mini)}
|
package/lib/index.umd.js
CHANGED
|
@@ -4646,7 +4646,7 @@ function checkDynamic() {
|
|
|
4646
4646
|
}
|
|
4647
4647
|
;// ./packages/ui/src/log.ts
|
|
4648
4648
|
|
|
4649
|
-
const log_version = `ui v${"4.14.
|
|
4649
|
+
const log_version = `ui v${"4.14.26"}`;
|
|
4650
4650
|
const warnLog = log.create('warn', log_version);
|
|
4651
4651
|
const errLog = log.create('error', log_version);
|
|
4652
4652
|
;// ./packages/ui/index.ts
|
|
@@ -4654,7 +4654,7 @@ const errLog = log.create('error', log_version);
|
|
|
4654
4654
|
|
|
4655
4655
|
|
|
4656
4656
|
|
|
4657
|
-
const ui_version = "4.14.
|
|
4657
|
+
const ui_version = "4.14.26";
|
|
4658
4658
|
VxeUI.uiVersion = ui_version;
|
|
4659
4659
|
VxeUI.dynamicApp = dynamicApp;
|
|
4660
4660
|
function config(options) {
|
|
@@ -43429,6 +43429,7 @@ const Text = VxeText;
|
|
|
43429
43429
|
|
|
43430
43430
|
|
|
43431
43431
|
|
|
43432
|
+
|
|
43432
43433
|
let autoTxtElem;
|
|
43433
43434
|
/* harmony default export */ var src_textarea = (defineVxeComponent({
|
|
43434
43435
|
name: 'VxeTextarea',
|
|
@@ -43468,7 +43469,18 @@ let autoTxtElem;
|
|
|
43468
43469
|
},
|
|
43469
43470
|
showWordCount: Boolean,
|
|
43470
43471
|
countMethod: Function,
|
|
43471
|
-
|
|
43472
|
+
/**
|
|
43473
|
+
* 已废弃,被 auto-size 替换
|
|
43474
|
+
* @deprecated
|
|
43475
|
+
*/
|
|
43476
|
+
autosize: {
|
|
43477
|
+
type: [Boolean, Object],
|
|
43478
|
+
default: null
|
|
43479
|
+
},
|
|
43480
|
+
autoSize: {
|
|
43481
|
+
type: [Boolean, Object],
|
|
43482
|
+
default: null
|
|
43483
|
+
},
|
|
43472
43484
|
form: String,
|
|
43473
43485
|
resize: {
|
|
43474
43486
|
type: String,
|
|
@@ -43497,6 +43509,7 @@ let autoTxtElem;
|
|
|
43497
43509
|
});
|
|
43498
43510
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
43499
43511
|
const refTextarea = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
43512
|
+
const refContent = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
43500
43513
|
const refMaps = {
|
|
43501
43514
|
refElem,
|
|
43502
43515
|
refTextarea
|
|
@@ -43569,27 +43582,41 @@ let autoTxtElem;
|
|
|
43569
43582
|
return inpMaxLength && inputCount > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(inpMaxLength);
|
|
43570
43583
|
});
|
|
43571
43584
|
const computeSizeOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
43585
|
+
const {
|
|
43586
|
+
autosize,
|
|
43587
|
+
autoSize
|
|
43588
|
+
} = props;
|
|
43589
|
+
if (autosize || getConfig().textarea.autosize) {
|
|
43590
|
+
return Object.assign({
|
|
43591
|
+
minRows: 1,
|
|
43592
|
+
maxRows: 10
|
|
43593
|
+
}, getConfig().textarea.autosize, autosize);
|
|
43594
|
+
}
|
|
43572
43595
|
return Object.assign({
|
|
43573
43596
|
minRows: 1,
|
|
43574
43597
|
maxRows: 10
|
|
43575
|
-
}, getConfig().textarea.
|
|
43598
|
+
}, getConfig().textarea.autoSize, autoSize);
|
|
43576
43599
|
});
|
|
43577
43600
|
const updateAutoTxt = () => {
|
|
43578
43601
|
const {
|
|
43579
43602
|
size,
|
|
43580
|
-
autosize
|
|
43603
|
+
autosize,
|
|
43604
|
+
autoSize
|
|
43581
43605
|
} = props;
|
|
43582
43606
|
const {
|
|
43583
43607
|
inputValue
|
|
43584
43608
|
} = reactData;
|
|
43585
|
-
if (autosize) {
|
|
43609
|
+
if (autosize || autoSize) {
|
|
43610
|
+
const formReadonly = computeFormReadonly.value;
|
|
43586
43611
|
if (!autoTxtElem) {
|
|
43587
43612
|
autoTxtElem = document.createElement('div');
|
|
43588
43613
|
}
|
|
43589
43614
|
if (!autoTxtElem.parentNode) {
|
|
43590
43615
|
document.body.appendChild(autoTxtElem);
|
|
43591
43616
|
}
|
|
43592
|
-
const
|
|
43617
|
+
const taElem = refTextarea.value;
|
|
43618
|
+
const ctElem = refContent.value;
|
|
43619
|
+
const textElem = formReadonly ? ctElem : taElem;
|
|
43593
43620
|
if (!textElem) {
|
|
43594
43621
|
return;
|
|
43595
43622
|
}
|
|
@@ -43601,14 +43628,21 @@ let autoTxtElem;
|
|
|
43601
43628
|
}
|
|
43602
43629
|
};
|
|
43603
43630
|
const handleResize = () => {
|
|
43604
|
-
|
|
43631
|
+
const {
|
|
43632
|
+
autosize,
|
|
43633
|
+
autoSize
|
|
43634
|
+
} = props;
|
|
43635
|
+
if (autosize || autoSize) {
|
|
43605
43636
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
43606
43637
|
const sizeOpts = computeSizeOpts.value;
|
|
43638
|
+
const formReadonly = computeFormReadonly.value;
|
|
43607
43639
|
const {
|
|
43608
43640
|
minRows,
|
|
43609
43641
|
maxRows
|
|
43610
43642
|
} = sizeOpts;
|
|
43611
|
-
const
|
|
43643
|
+
const taElem = refTextarea.value;
|
|
43644
|
+
const ctElem = refContent.value;
|
|
43645
|
+
const textElem = formReadonly ? ctElem : taElem;
|
|
43612
43646
|
if (!textElem) {
|
|
43613
43647
|
return;
|
|
43614
43648
|
}
|
|
@@ -43714,28 +43748,12 @@ let autoTxtElem;
|
|
|
43714
43748
|
}
|
|
43715
43749
|
};
|
|
43716
43750
|
Object.assign($xeTextarea, textareaMethods);
|
|
43717
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
|
|
43718
|
-
reactData.inputValue = val;
|
|
43719
|
-
updateAutoTxt();
|
|
43720
|
-
});
|
|
43721
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSizeOpts, () => {
|
|
43722
|
-
updateAutoTxt();
|
|
43723
|
-
handleResize();
|
|
43724
|
-
});
|
|
43725
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
43726
|
-
const {
|
|
43727
|
-
autosize
|
|
43728
|
-
} = props;
|
|
43729
|
-
if (autosize) {
|
|
43730
|
-
updateAutoTxt();
|
|
43731
|
-
handleResize();
|
|
43732
|
-
}
|
|
43733
|
-
});
|
|
43734
43751
|
const renderVN = () => {
|
|
43735
43752
|
const {
|
|
43736
43753
|
className,
|
|
43737
43754
|
resize,
|
|
43738
43755
|
autosize,
|
|
43756
|
+
autoSize,
|
|
43739
43757
|
showWordCount,
|
|
43740
43758
|
countMethod,
|
|
43741
43759
|
rows,
|
|
@@ -43756,13 +43774,16 @@ let autoTxtElem;
|
|
|
43756
43774
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
43757
43775
|
ref: refElem,
|
|
43758
43776
|
class: ['vxe-textarea--readonly', className]
|
|
43759
|
-
},
|
|
43777
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
43778
|
+
ref: refContent,
|
|
43779
|
+
class: 'vxe-textarea--content'
|
|
43780
|
+
}, inputValue)]);
|
|
43760
43781
|
}
|
|
43761
43782
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
43762
43783
|
ref: refElem,
|
|
43763
43784
|
class: ['vxe-textarea', className, {
|
|
43764
43785
|
[`size--${vSize}`]: vSize,
|
|
43765
|
-
'is--autosize': autosize,
|
|
43786
|
+
'is--autosize': autosize || autoSize,
|
|
43766
43787
|
'is--count': showWordCount,
|
|
43767
43788
|
'is--disabled': isDisabled,
|
|
43768
43789
|
'is--rows': !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rows),
|
|
@@ -43798,6 +43819,40 @@ let autoTxtElem;
|
|
|
43798
43819
|
value: inputValue
|
|
43799
43820
|
})}` : `${inputCount}${inpMaxLength ? `/${inpMaxLength}` : ''}`) : null]);
|
|
43800
43821
|
};
|
|
43822
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
|
|
43823
|
+
reactData.inputValue = val;
|
|
43824
|
+
updateAutoTxt();
|
|
43825
|
+
});
|
|
43826
|
+
const reFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
43827
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeFormReadonly, () => {
|
|
43828
|
+
reFlag.value++;
|
|
43829
|
+
});
|
|
43830
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSizeOpts, () => {
|
|
43831
|
+
reFlag.value++;
|
|
43832
|
+
});
|
|
43833
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.autoSize, () => {
|
|
43834
|
+
reFlag.value++;
|
|
43835
|
+
});
|
|
43836
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.autosize, () => {
|
|
43837
|
+
reFlag.value++;
|
|
43838
|
+
});
|
|
43839
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reFlag, () => {
|
|
43840
|
+
updateAutoTxt();
|
|
43841
|
+
handleResize();
|
|
43842
|
+
});
|
|
43843
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
43844
|
+
const {
|
|
43845
|
+
autosize,
|
|
43846
|
+
autoSize
|
|
43847
|
+
} = props;
|
|
43848
|
+
if (autosize) {
|
|
43849
|
+
warnLog('vxe.error.delProp', ['autosize', 'auto-size']);
|
|
43850
|
+
}
|
|
43851
|
+
if (autosize || autoSize) {
|
|
43852
|
+
updateAutoTxt();
|
|
43853
|
+
handleResize();
|
|
43854
|
+
}
|
|
43855
|
+
});
|
|
43801
43856
|
$xeTextarea.renderVN = renderVN;
|
|
43802
43857
|
return $xeTextarea;
|
|
43803
43858
|
},
|