tnx-shared 5.3.232 → 5.3.234
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/bundles/tnx-shared.umd.js +34 -26
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/data-form-base.d.ts +1 -1
- package/classes/base/data-form-base.d.ts.map +1 -1
- package/components/html-preview/html-preview.component.d.ts.map +1 -1
- package/esm2015/classes/base/data-form-base.js +4 -4
- package/esm2015/components/html-preview/html-preview.component.js +31 -23
- package/fesm2015/tnx-shared.js +34 -26
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
package/fesm2015/tnx-shared.js
CHANGED
|
@@ -15667,7 +15667,7 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
15667
15667
|
yield this.modifyDetailData(response.data);
|
|
15668
15668
|
}
|
|
15669
15669
|
yield this._processAfterGetData(response.data);
|
|
15670
|
-
yield this.onAfterGetDetail();
|
|
15670
|
+
yield this.onAfterGetDetail(response.data);
|
|
15671
15671
|
}
|
|
15672
15672
|
else {
|
|
15673
15673
|
if (this.crudForm) {
|
|
@@ -15694,7 +15694,7 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
15694
15694
|
}
|
|
15695
15695
|
yield this.modifyDetailData(resultCheck.data);
|
|
15696
15696
|
yield this._processAfterGetData(resultCheck.data);
|
|
15697
|
-
yield this.onAfterGetDetail();
|
|
15697
|
+
yield this.onAfterGetDetail(resultCheck.data);
|
|
15698
15698
|
}
|
|
15699
15699
|
else {
|
|
15700
15700
|
this.model.formState = FormState.ADD;
|
|
@@ -15945,7 +15945,7 @@ class DataFormBase extends ComponentBaseWithButton {
|
|
|
15945
15945
|
this.model.data.id = this._commonService.guid();
|
|
15946
15946
|
}
|
|
15947
15947
|
}
|
|
15948
|
-
onAfterGetDetail() {
|
|
15948
|
+
onAfterGetDetail(data) {
|
|
15949
15949
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15950
15950
|
});
|
|
15951
15951
|
}
|
|
@@ -47043,6 +47043,7 @@ class HtmlPreviewComponent {
|
|
|
47043
47043
|
this.content = '';
|
|
47044
47044
|
this.id = '';
|
|
47045
47045
|
this.id = this._commonService.guid();
|
|
47046
|
+
this.loadMathConfig();
|
|
47046
47047
|
}
|
|
47047
47048
|
// ngOnChanges(changes: SimpleChanges) {
|
|
47048
47049
|
// if (changes['content']) {
|
|
@@ -47074,28 +47075,36 @@ class HtmlPreviewComponent {
|
|
|
47074
47075
|
const $this = this;
|
|
47075
47076
|
const autoScrollBottom = !!((_a = $this.control) === null || _a === void 0 ? void 0 : _a.autoScrollBottom);
|
|
47076
47077
|
const output = $this.mathContent.nativeElement;
|
|
47077
|
-
|
|
47078
|
-
|
|
47079
|
-
|
|
47080
|
-
$this.mathJaxObject.
|
|
47081
|
-
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47087
|
-
|
|
47088
|
-
|
|
47089
|
-
|
|
47090
|
-
|
|
47091
|
-
|
|
47092
|
-
|
|
47093
|
-
|
|
47094
|
-
|
|
47095
|
-
|
|
47096
|
-
|
|
47097
|
-
|
|
47098
|
-
|
|
47078
|
+
let content = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
|
|
47079
|
+
content = content.replace(/\n/g, '<br>');
|
|
47080
|
+
output.innerHTML = content;
|
|
47081
|
+
if ($this.mathJaxObject.texReset) {
|
|
47082
|
+
$this.mathJaxObject.texReset();
|
|
47083
|
+
}
|
|
47084
|
+
if ($this.mathJaxObject.typesetClear) {
|
|
47085
|
+
$this.mathJaxObject.typesetClear();
|
|
47086
|
+
}
|
|
47087
|
+
if ($this.mathJaxObject.typesetPromise) {
|
|
47088
|
+
$this.mathJaxObject.typesetPromise([output]).catch(function (err) {
|
|
47089
|
+
output.innerHTML = '';
|
|
47090
|
+
output.appendChild(document.createTextNode(err.message));
|
|
47091
|
+
console.error(err);
|
|
47092
|
+
}).then(function () {
|
|
47093
|
+
var _a, _b, _c;
|
|
47094
|
+
// Do something after typeset
|
|
47095
|
+
if (autoScrollBottom) {
|
|
47096
|
+
const box = document.querySelector(`#math-preview-box-${$this.id}`);
|
|
47097
|
+
const elem = box.getElementsByClassName('ps--active-y')[0];
|
|
47098
|
+
if (elem) {
|
|
47099
|
+
elem.scrollTop = elem.scrollHeight;
|
|
47100
|
+
}
|
|
47101
|
+
}
|
|
47102
|
+
const value = (_c = (_b = (_a = document.getElementById(`mathPreview-${$this.id}`)) === null || _a === void 0 ? void 0 : _a.innerHTML) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
|
|
47103
|
+
$this.onChange(value);
|
|
47104
|
+
$this.onChanged.emit(value);
|
|
47105
|
+
});
|
|
47106
|
+
}
|
|
47107
|
+
return $this.mathJaxObject.startup.defaultPageReady ? $this.mathJaxObject.startup.defaultPageReady() : $this.mathJaxObject.startup.defaultPageReady;
|
|
47099
47108
|
});
|
|
47100
47109
|
}
|
|
47101
47110
|
loadMathConfig() {
|
|
@@ -47150,7 +47159,6 @@ class HtmlPreviewComponent {
|
|
|
47150
47159
|
document.head.appendChild(script);
|
|
47151
47160
|
}
|
|
47152
47161
|
ngOnInit() {
|
|
47153
|
-
this.loadMathConfig();
|
|
47154
47162
|
}
|
|
47155
47163
|
}
|
|
47156
47164
|
HtmlPreviewComponent.decorators = [
|