goodteditor-ui 1.0.101 → 1.0.102
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
|
@@ -102,6 +102,10 @@ export default {
|
|
|
102
102
|
classes.push('is-edited');
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
if (this.isValid === false) {
|
|
106
|
+
classes.push('invalid');
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
return classes;
|
|
106
110
|
},
|
|
107
111
|
isValid() {
|
|
@@ -163,16 +167,18 @@ export default {
|
|
|
163
167
|
* @param {string} value
|
|
164
168
|
*/
|
|
165
169
|
setValue(value) {
|
|
166
|
-
if (value === this.valueLast) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
170
|
this.$el.textContent = value;
|
|
170
171
|
this.valueLast = value;
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
if (value !== this.valueLast) {
|
|
173
|
+
this.$emit('input', value);
|
|
174
|
+
this.$emit('change', value);
|
|
175
|
+
}
|
|
173
176
|
},
|
|
174
177
|
commitValue() {
|
|
175
|
-
|
|
178
|
+
if (this.isValid === false) {
|
|
179
|
+
this.valueDirty = this.valueLast;
|
|
180
|
+
}
|
|
181
|
+
this.setValue(this.valueDirty);
|
|
176
182
|
this.setIsEdited(false);
|
|
177
183
|
},
|
|
178
184
|
onFocus() {
|
|
@@ -236,6 +242,11 @@ export default {
|
|
|
236
242
|
|
|
237
243
|
&.is-edited {
|
|
238
244
|
white-space: pre-line;
|
|
245
|
+
|
|
246
|
+
&.invalid {
|
|
247
|
+
color: var(--color-red);
|
|
248
|
+
outline-color: var(--color-red);
|
|
249
|
+
}
|
|
239
250
|
}
|
|
240
251
|
}
|
|
241
252
|
</style>
|