@itfin/components 1.2.44 → 1.2.45
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/package.json
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="itf-textarea
|
|
4
|
-
<div class="
|
|
5
|
-
<slot
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<div class="itf-textarea" :class="{ 'with-addon addon-start': prependIcon, 'itf-textarea__autogrow': autogrow, 'p-0': !hasContent }">
|
|
4
|
+
<div class="p-2 itf-textarea__content" v-if="hasContent">
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="position-relative input-group">
|
|
9
|
+
<div class="addon" v-if="prependIcon">
|
|
10
|
+
<slot name="addon">
|
|
11
|
+
<itf-icon :name="prependIcon"/>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div v-if="autogrow" class="itf-textarea__autogrow-text form-control" :class="{'pt-5': hasContent}">{{value}} </div>
|
|
16
|
+
<textarea
|
|
17
|
+
ref="input"
|
|
18
|
+
:rows="rows"
|
|
19
|
+
:readonly="readonly"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:placeholder="placeholder"
|
|
22
|
+
:class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess(), 'pt-5': hasContent }"
|
|
23
|
+
class="itf-textarea__input form-control"
|
|
24
|
+
:value="value"
|
|
25
|
+
@input="onInput($event.target.value)"
|
|
26
|
+
@keydown="$emit('keydown', $event)"
|
|
27
|
+
@keyup="$emit('keyup', $event)"
|
|
28
|
+
@keypress="$emit('keypress', $event)"
|
|
29
|
+
@blur="$emit('blur', $event)"
|
|
30
|
+
@focus="$emit('focus', $event)"
|
|
31
|
+
/>
|
|
8
32
|
</div>
|
|
9
|
-
<div v-if="autogrow" class="itf-textarea__autogrow-text form-control">{{value}} </div>
|
|
10
|
-
<textarea
|
|
11
|
-
ref="input"
|
|
12
|
-
:rows="rows"
|
|
13
|
-
:readonly="readonly"
|
|
14
|
-
:disabled="disabled"
|
|
15
|
-
:placeholder="placeholder"
|
|
16
|
-
:class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
|
|
17
|
-
class="itf-textarea__input form-control"
|
|
18
|
-
:value="value"
|
|
19
|
-
@input="onInput($event.target.value)"
|
|
20
|
-
@keydown="$emit('keydown', $event)"
|
|
21
|
-
@keyup="$emit('keyup', $event)"
|
|
22
|
-
@keypress="$emit('keypress', $event)"
|
|
23
|
-
@blur="$emit('blur', $event)"
|
|
24
|
-
@focus="$emit('focus', $event)"
|
|
25
|
-
/>
|
|
26
33
|
</div>
|
|
27
34
|
|
|
28
35
|
</template>
|
|
@@ -52,6 +59,10 @@ class itfTextarea extends Vue {
|
|
|
52
59
|
|
|
53
60
|
onInput = null;
|
|
54
61
|
|
|
62
|
+
get hasContent() {
|
|
63
|
+
return !!this.$slots.default;
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
created() {
|
|
56
67
|
this.onInput = debounce((val) => this.$emit('input', val), Number(this.delayInput));
|
|
57
68
|
}
|