@festo-ui/angular 5.0.0-dev.156 → 5.0.0-dev.161
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/esm2020/lib/forms/text-editor/text-editor.component.mjs +16 -18
- package/fesm2015/festo-ui-angular.mjs +16 -17
- package/fesm2015/festo-ui-angular.mjs.map +1 -1
- package/fesm2020/festo-ui-angular.mjs +15 -17
- package/fesm2020/festo-ui-angular.mjs.map +1 -1
- package/lib/forms/text-editor/text-editor.component.d.ts +4 -3
- package/package.json +1 -1
|
@@ -6012,13 +6012,11 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6012
6012
|
set value(value) {
|
|
6013
6013
|
if (this.innerValue !== value) {
|
|
6014
6014
|
this.innerValue = value;
|
|
6015
|
-
|
|
6016
|
-
this.
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
});
|
|
6021
|
-
}
|
|
6015
|
+
this.changed.forEach(f => {
|
|
6016
|
+
this.fngChange.emit(this.innerValue);
|
|
6017
|
+
this.change.emit(this.innerValue);
|
|
6018
|
+
return f(value);
|
|
6019
|
+
});
|
|
6022
6020
|
}
|
|
6023
6021
|
}
|
|
6024
6022
|
get value() {
|
|
@@ -6045,7 +6043,8 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6045
6043
|
sanitizingFn: undefined,
|
|
6046
6044
|
skipDefaultSanitizing: false,
|
|
6047
6045
|
skipWhitespaceHandling: false
|
|
6048
|
-
}
|
|
6046
|
+
},
|
|
6047
|
+
focusCursorToEndOnWrite: true
|
|
6049
6048
|
};
|
|
6050
6049
|
this.fngChange = new EventEmitter();
|
|
6051
6050
|
this.change = new EventEmitter();
|
|
@@ -6088,11 +6087,9 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6088
6087
|
this.setEditorLabel();
|
|
6089
6088
|
this.addWhitespaceMatcher();
|
|
6090
6089
|
this.addImageMatcher();
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
this.quillEditor.getModule('history').clear();
|
|
6095
|
-
}
|
|
6090
|
+
const content = this.valueSetter(this.quillEditor, this.innerValue || '');
|
|
6091
|
+
this.quillEditor.setContents(content, 'silent');
|
|
6092
|
+
this.quillEditor.getModule('history').clear();
|
|
6096
6093
|
this.handle();
|
|
6097
6094
|
this.quillEditor.on('text-change', () => {
|
|
6098
6095
|
this.value = this.valueGetter(this.editorElem);
|
|
@@ -6111,15 +6108,16 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6111
6108
|
this.handle();
|
|
6112
6109
|
}
|
|
6113
6110
|
writeValue(value) {
|
|
6114
|
-
if (value === null || value === '') {
|
|
6115
|
-
return;
|
|
6116
|
-
}
|
|
6117
6111
|
this.innerValue = value;
|
|
6118
6112
|
if (!this.quillEditor) {
|
|
6119
6113
|
return;
|
|
6120
6114
|
}
|
|
6121
|
-
const content = this.valueSetter(this.quillEditor, value);
|
|
6115
|
+
const content = this.valueSetter(this.quillEditor, value || '');
|
|
6122
6116
|
this.quillEditor.setContents(content);
|
|
6117
|
+
if (this.config?.focusCursorToEndOnWrite) {
|
|
6118
|
+
// when new content gets written we always set cursor focus to end of text
|
|
6119
|
+
this.quillEditor.setSelection(Number.MAX_SAFE_INTEGER, 0);
|
|
6120
|
+
}
|
|
6123
6121
|
}
|
|
6124
6122
|
setDisabledState(isDisabled = this.disabled) {
|
|
6125
6123
|
this.disabled = isDisabled;
|