@itfin/components 1.0.38 → 1.0.42
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
|
@@ -73,6 +73,8 @@
|
|
|
73
73
|
import { Vue, Component, Provide } from 'vue-property-decorator';
|
|
74
74
|
import Message from './message';
|
|
75
75
|
|
|
76
|
+
let globalApp = null;
|
|
77
|
+
|
|
76
78
|
export default @Component({
|
|
77
79
|
name: 'itfApp',
|
|
78
80
|
components: {}
|
|
@@ -80,10 +82,12 @@ export default @Component({
|
|
|
80
82
|
class itfApp extends Vue {
|
|
81
83
|
@Provide() globalApp = this;
|
|
82
84
|
@Provide() appendContext = function appendContext() {
|
|
83
|
-
return
|
|
85
|
+
return globalApp.$el;
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
created() {
|
|
89
|
+
globalApp = this;
|
|
90
|
+
Vue.prototype.$globalApp = this;
|
|
87
91
|
Vue.prototype.$showSuccess = this.showSuccess.bind(this);
|
|
88
92
|
Vue.prototype.$showError = this.showError.bind(this);
|
|
89
93
|
Vue.prototype.$showMessage = this.showMessage.bind(this);
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<input
|
|
11
|
+
ref="input"
|
|
11
12
|
autocomplete="off"
|
|
12
13
|
:placeholder="placeholder"
|
|
13
14
|
:class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
|
|
@@ -84,5 +85,13 @@ class itfTextField extends Vue {
|
|
|
84
85
|
isSuccess() {
|
|
85
86
|
return this.itemLabel && this.itemLabel.isHasSuccess();
|
|
86
87
|
}
|
|
88
|
+
|
|
89
|
+
insertTextToCurrentPosition(text) {
|
|
90
|
+
const position = this.$refs.input.selectionStart;
|
|
91
|
+
const value = this.value || '';
|
|
92
|
+
const startText = value.slice(0, position);
|
|
93
|
+
const endText = value.slice(position);
|
|
94
|
+
this.$emit('input', `${startText}${text}${endText}`);
|
|
95
|
+
}
|
|
87
96
|
}
|
|
88
97
|
</script>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div v-if="autogrow" class="itf-textarea__autogrow-text form-control">{{value}} </div>
|
|
10
10
|
<textarea
|
|
11
|
+
ref="input"
|
|
11
12
|
:rows="rows"
|
|
12
13
|
:readonly="readonly"
|
|
13
14
|
:disabled="disabled"
|
|
@@ -85,5 +86,13 @@ class itfTextarea extends Vue {
|
|
|
85
86
|
isSuccess() {
|
|
86
87
|
return this.itemLabel && this.itemLabel.isHasSuccess();
|
|
87
88
|
}
|
|
89
|
+
|
|
90
|
+
insertTextToCurrentPosition(text) {
|
|
91
|
+
const position = this.$refs.input.selectionStart;
|
|
92
|
+
const value = this.value || '';
|
|
93
|
+
const startText = value.slice(0, position);
|
|
94
|
+
const endText = value.slice(position);
|
|
95
|
+
this.$emit('input', `${startText}${text}${endText}`);
|
|
96
|
+
}
|
|
88
97
|
}
|
|
89
98
|
</script>
|
|
@@ -2,7 +2,14 @@ import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
|
|
|
2
2
|
import { deepEqual } from '../helpers/deepEqual';
|
|
3
3
|
|
|
4
4
|
export default
|
|
5
|
-
@Component({
|
|
5
|
+
@Component({
|
|
6
|
+
name: 'ValidatableMixin',
|
|
7
|
+
methods: {
|
|
8
|
+
validate(force = false, value) {
|
|
9
|
+
return this.doValidation(force, value);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
})
|
|
6
13
|
class ValidatableMixin extends Vue {
|
|
7
14
|
@Prop(Boolean) manualValidation;
|
|
8
15
|
@Prop(Boolean) disabled;
|