croco-html 2.0.0 → 2.0.1
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/esm2022/croco-html.mjs +4 -4
- package/esm2022/lib/components/add-files-btn/add-files-btn.component.mjs +53 -53
- package/esm2022/lib/components/editor/external-video-block/external-video-block.component.mjs +43 -43
- package/esm2022/lib/components/editor/html-raw-editor/html-raw-editor.component.mjs +25 -25
- package/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +46 -46
- package/esm2022/lib/components/editor/index.mjs +7 -7
- package/esm2022/lib/components/editor/main-editor/main-editor.component.mjs +76 -76
- package/esm2022/lib/components/editor/main-editor-block/main-editor-block.component.mjs +41 -41
- package/esm2022/lib/components/editor/text-editor/text-editor.component.mjs +30 -30
- package/esm2022/lib/components/editor/visual-editor/DefaultTags.mjs +27 -27
- package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +134 -134
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +58 -58
- package/esm2022/lib/components/html-view/html-view.component.mjs +18 -18
- package/esm2022/lib/components/index.mjs +6 -6
- package/esm2022/lib/components/upload-files-btn/upload-files-btn.component.mjs +54 -54
- package/esm2022/lib/components/xml-tags/html-raw-view/html-raw-view.component.mjs +22 -22
- package/esm2022/lib/components/xml-tags/index.mjs +9 -9
- package/esm2022/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.mjs +49 -49
- package/esm2022/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.mjs +17 -17
- package/esm2022/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.mjs +18 -18
- package/esm2022/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.mjs +16 -16
- package/esm2022/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.mjs +20 -20
- package/esm2022/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.mjs +20 -20
- package/esm2022/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.mjs +17 -17
- package/esm2022/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +22 -22
- package/esm2022/lib/croco-html.module.mjs +92 -92
- package/esm2022/lib/extensions/AngularMaterialTableMethods.mjs +64 -64
- package/esm2022/lib/extensions/BodyTagsExtensions.mjs +120 -120
- package/esm2022/lib/extensions/BootstrapTableMethods.mjs +67 -67
- package/esm2022/lib/extensions/HtmlExtractionMethods.mjs +63 -63
- package/esm2022/lib/extensions/HtmlRawTagDataConsts.mjs +3 -3
- package/esm2022/lib/extensions/ImageMethods.mjs +32 -32
- package/esm2022/lib/extensions/InterfaceBlock.mjs +1 -1
- package/esm2022/lib/extensions/TableBuilder.mjs +35 -35
- package/esm2022/lib/extensions/TableMethods.mjs +108 -108
- package/esm2022/lib/extensions/TextMethods.mjs +29 -29
- package/esm2022/lib/extensions/TextSimpleMethods.mjs +77 -77
- package/esm2022/lib/extensions/VideoMethods.mjs +19 -19
- package/esm2022/lib/extensions/XmlExtensions.mjs +25 -25
- package/esm2022/lib/extensions/index.mjs +12 -12
- package/esm2022/lib/index.mjs +117 -117
- package/esm2022/lib/models/models.mjs +1 -1
- package/esm2022/lib/pipes/RichTextToHtmlPipe.mjs +26 -26
- package/esm2022/lib/pipes/TagToSpanPipe.mjs +16 -16
- package/esm2022/lib/pipes/ToHtmlBodyTagsPipe.mjs +17 -17
- package/esm2022/lib/pipes/ToPreviewHtmlPipe.mjs +17 -17
- package/esm2022/lib/pipes/index.mjs +5 -5
- package/esm2022/lib/pipes/to-preview.pipe.mjs +20 -20
- package/esm2022/lib/services/file-upload.service.mjs +70 -70
- package/esm2022/lib/services/files-query.service.mjs +27 -27
- package/esm2022/public-api.mjs +7 -7
- package/fesm2022/croco-html.mjs +1488 -1488
- package/fesm2022/croco-html.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/components/add-files-btn/add-files-btn.component.d.ts +18 -18
- package/lib/components/editor/external-video-block/external-video-block.component.d.ts +17 -17
- package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +11 -11
- package/lib/components/editor/image-editor/image-editor.component.d.ts +18 -18
- package/lib/components/editor/index.d.ts +7 -7
- package/lib/components/editor/main-editor/main-editor.component.d.ts +27 -27
- package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +16 -16
- package/lib/components/editor/text-editor/text-editor.component.d.ts +12 -12
- package/lib/components/editor/visual-editor/DefaultTags.d.ts +6 -6
- package/lib/components/editor/visual-editor/visual-editor.component.d.ts +36 -36
- package/lib/components/file-id-select/file-id-select.component.d.ts +27 -27
- package/lib/components/html-view/html-view.component.d.ts +6 -6
- package/lib/components/index.d.ts +6 -6
- package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +24 -24
- package/lib/components/xml-tags/html-raw-view/html-raw-view.component.d.ts +13 -13
- package/lib/components/xml-tags/index.d.ts +9 -9
- package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +16 -16
- package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +10 -10
- package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +10 -10
- package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +7 -7
- package/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.d.ts +10 -10
- package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +7 -7
- package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +10 -10
- package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +8 -8
- package/lib/croco-html.module.d.ts +64 -64
- package/lib/extensions/AngularMaterialTableMethods.d.ts +7 -7
- package/lib/extensions/BodyTagsExtensions.d.ts +11 -11
- package/lib/extensions/BootstrapTableMethods.d.ts +9 -9
- package/lib/extensions/HtmlExtractionMethods.d.ts +73 -73
- package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -3
- package/lib/extensions/ImageMethods.d.ts +18 -18
- package/lib/extensions/InterfaceBlock.d.ts +4 -4
- package/lib/extensions/TableBuilder.d.ts +5 -5
- package/lib/extensions/TableMethods.d.ts +59 -59
- package/lib/extensions/TextMethods.d.ts +19 -19
- package/lib/extensions/TextSimpleMethods.d.ts +23 -23
- package/lib/extensions/VideoMethods.d.ts +19 -19
- package/lib/extensions/XmlExtensions.d.ts +5 -5
- package/lib/extensions/index.d.ts +10 -10
- package/lib/index.d.ts +21 -22
- package/lib/models/models.d.ts +14 -14
- package/lib/pipes/RichTextToHtmlPipe.d.ts +8 -8
- package/lib/pipes/TagToSpanPipe.d.ts +7 -7
- package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +8 -8
- package/lib/pipes/ToPreviewHtmlPipe.d.ts +9 -9
- package/lib/pipes/index.d.ts +5 -5
- package/lib/pipes/to-preview.pipe.d.ts +8 -8
- package/lib/services/file-upload.service.d.ts +34 -34
- package/lib/services/files-query.service.d.ts +42 -42
- package/package.json +2 -2
- package/public-api.d.ts +4 -4
package/fesm2022/croco-html.mjs
CHANGED
|
@@ -74,1578 +74,1578 @@ import { MatTreeModule } from '@angular/material/tree';
|
|
|
74
74
|
import * as i26 from '@angular/material/badge';
|
|
75
75
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
76
76
|
|
|
77
|
-
class FileImageTagDataConsts {
|
|
78
|
-
static { this.TagName = "file-image"; }
|
|
79
|
-
static { this.FileIdAttrName = "file-id"; }
|
|
80
|
-
}
|
|
81
|
-
class ImageMethods {
|
|
82
|
-
static buildUrl(fileId, options) {
|
|
83
|
-
var baseUrl = `/FileCopies/Images/Medium/${fileId}.jpg`;
|
|
84
|
-
if (!options.useCustomDomain) {
|
|
85
|
-
return baseUrl;
|
|
86
|
-
}
|
|
87
|
-
return `${options.domain}${baseUrl}`;
|
|
88
|
-
}
|
|
89
|
-
static buildSmallUrl(fileId, options) {
|
|
90
|
-
var baseUrl = `/FileCopies/Images/Small/${fileId}.jpg`;
|
|
91
|
-
if (!options.useCustomDomain) {
|
|
92
|
-
return baseUrl;
|
|
93
|
-
}
|
|
94
|
-
return `${options.domain}${baseUrl}`;
|
|
95
|
-
}
|
|
96
|
-
static ExtractImage(elem, options) {
|
|
97
|
-
let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
|
|
98
|
-
let src = ImageMethods.buildUrl(fileId, options);
|
|
99
|
-
return {
|
|
100
|
-
type: FileImageTagDataConsts.TagName,
|
|
101
|
-
data: {
|
|
102
|
-
src,
|
|
103
|
-
fileId: fileId,
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
77
|
+
class FileImageTagDataConsts {
|
|
78
|
+
static { this.TagName = "file-image"; }
|
|
79
|
+
static { this.FileIdAttrName = "file-id"; }
|
|
80
|
+
}
|
|
81
|
+
class ImageMethods {
|
|
82
|
+
static buildUrl(fileId, options) {
|
|
83
|
+
var baseUrl = `/FileCopies/Images/Medium/${fileId}.jpg`;
|
|
84
|
+
if (!options.useCustomDomain) {
|
|
85
|
+
return baseUrl;
|
|
86
|
+
}
|
|
87
|
+
return `${options.domain}${baseUrl}`;
|
|
88
|
+
}
|
|
89
|
+
static buildSmallUrl(fileId, options) {
|
|
90
|
+
var baseUrl = `/FileCopies/Images/Small/${fileId}.jpg`;
|
|
91
|
+
if (!options.useCustomDomain) {
|
|
92
|
+
return baseUrl;
|
|
93
|
+
}
|
|
94
|
+
return `${options.domain}${baseUrl}`;
|
|
95
|
+
}
|
|
96
|
+
static ExtractImage(elem, options) {
|
|
97
|
+
let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
|
|
98
|
+
let src = ImageMethods.buildUrl(fileId, options);
|
|
99
|
+
return {
|
|
100
|
+
type: FileImageTagDataConsts.TagName,
|
|
101
|
+
data: {
|
|
102
|
+
src,
|
|
103
|
+
fileId: fileId,
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
class FileUploadService {
|
|
110
|
-
constructor(_httpClient, baseUrl) {
|
|
111
|
-
this._httpClient = _httpClient;
|
|
112
|
-
this.baseUrl = baseUrl;
|
|
113
|
-
}
|
|
114
|
-
postFile(file, createLocalCopiesNow = false, withProgress = false) {
|
|
115
|
-
const formData = new FormData();
|
|
116
|
-
formData.append(`fileKey1`, file, file.name);
|
|
117
|
-
return this.postFilesInner(formData, createLocalCopiesNow, withProgress);
|
|
118
|
-
}
|
|
119
|
-
postFiles(files, createLocalCopiesNow = false) {
|
|
120
|
-
const formData = new FormData();
|
|
121
|
-
for (let i = 0; i < files.length; i++) {
|
|
122
|
-
var fileToUpload = files.item(i);
|
|
123
|
-
formData.append(`fileKey${i}`, fileToUpload, fileToUpload?.name);
|
|
124
|
-
}
|
|
125
|
-
return this.postFilesInner(formData, createLocalCopiesNow);
|
|
126
|
-
}
|
|
127
|
-
postFilesInner(formData, createLocalCopiesNow = false, withProgress = false) {
|
|
128
|
-
let endpoint = this.baseUrl + 'Api/Files/UploadFiles';
|
|
129
|
-
if (createLocalCopiesNow) {
|
|
130
|
-
endpoint += '/Now';
|
|
131
|
-
}
|
|
132
|
-
return this._httpClient.post(endpoint, formData, withProgress ? { reportProgress: true, observe: 'events' } : undefined);
|
|
133
|
-
}
|
|
134
|
-
uploadFileWithProgress(file, createLocalCopiesNow = false) {
|
|
135
|
-
let uploadingLoaded;
|
|
136
|
-
let uploadingTotal;
|
|
137
|
-
return this.postFile(file, createLocalCopiesNow, true).pipe(filter((event) => {
|
|
138
|
-
return event.type === HttpEventType.UploadProgress || event instanceof HttpResponse;
|
|
139
|
-
}), switchMap((event) => {
|
|
140
|
-
if (event.type === HttpEventType.UploadProgress) {
|
|
141
|
-
uploadingLoaded = event.loaded;
|
|
142
|
-
uploadingTotal = event.total;
|
|
143
|
-
return [{ loading: true, uploadingLoaded, uploadingTotal }];
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
if (event.body.responseObject?.[0]) {
|
|
147
|
-
return [
|
|
148
|
-
{
|
|
149
|
-
loading: false,
|
|
150
|
-
fileId: event.body.responseObject[0],
|
|
151
|
-
uploadingLoaded,
|
|
152
|
-
uploadingTotal,
|
|
153
|
-
},
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
return throwError(() => new Error(event.body.message));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
164
|
-
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
166
|
-
type: Injectable,
|
|
167
|
-
args: [{ providedIn: 'root' }]
|
|
168
|
-
}], ctorParameters:
|
|
169
|
-
type: Inject,
|
|
170
|
-
args: ['BASE_URL']
|
|
171
|
-
}] }]
|
|
109
|
+
class FileUploadService {
|
|
110
|
+
constructor(_httpClient, baseUrl) {
|
|
111
|
+
this._httpClient = _httpClient;
|
|
112
|
+
this.baseUrl = baseUrl;
|
|
113
|
+
}
|
|
114
|
+
postFile(file, createLocalCopiesNow = false, withProgress = false) {
|
|
115
|
+
const formData = new FormData();
|
|
116
|
+
formData.append(`fileKey1`, file, file.name);
|
|
117
|
+
return this.postFilesInner(formData, createLocalCopiesNow, withProgress);
|
|
118
|
+
}
|
|
119
|
+
postFiles(files, createLocalCopiesNow = false) {
|
|
120
|
+
const formData = new FormData();
|
|
121
|
+
for (let i = 0; i < files.length; i++) {
|
|
122
|
+
var fileToUpload = files.item(i);
|
|
123
|
+
formData.append(`fileKey${i}`, fileToUpload, fileToUpload?.name);
|
|
124
|
+
}
|
|
125
|
+
return this.postFilesInner(formData, createLocalCopiesNow);
|
|
126
|
+
}
|
|
127
|
+
postFilesInner(formData, createLocalCopiesNow = false, withProgress = false) {
|
|
128
|
+
let endpoint = this.baseUrl + 'Api/Files/UploadFiles';
|
|
129
|
+
if (createLocalCopiesNow) {
|
|
130
|
+
endpoint += '/Now';
|
|
131
|
+
}
|
|
132
|
+
return this._httpClient.post(endpoint, formData, withProgress ? { reportProgress: true, observe: 'events' } : undefined);
|
|
133
|
+
}
|
|
134
|
+
uploadFileWithProgress(file, createLocalCopiesNow = false) {
|
|
135
|
+
let uploadingLoaded;
|
|
136
|
+
let uploadingTotal;
|
|
137
|
+
return this.postFile(file, createLocalCopiesNow, true).pipe(filter((event) => {
|
|
138
|
+
return event.type === HttpEventType.UploadProgress || event instanceof HttpResponse;
|
|
139
|
+
}), switchMap((event) => {
|
|
140
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
141
|
+
uploadingLoaded = event.loaded;
|
|
142
|
+
uploadingTotal = event.total;
|
|
143
|
+
return [{ loading: true, uploadingLoaded, uploadingTotal }];
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
if (event.body.responseObject?.[0]) {
|
|
147
|
+
return [
|
|
148
|
+
{
|
|
149
|
+
loading: false,
|
|
150
|
+
fileId: event.body.responseObject[0],
|
|
151
|
+
uploadingLoaded,
|
|
152
|
+
uploadingTotal,
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return throwError(() => new Error(event.body.message));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
163
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, providedIn: 'root' }); }
|
|
164
|
+
}
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, decorators: [{
|
|
166
|
+
type: Injectable,
|
|
167
|
+
args: [{ providedIn: 'root' }]
|
|
168
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
169
|
+
type: Inject,
|
|
170
|
+
args: ['BASE_URL']
|
|
171
|
+
}] }] });
|
|
172
172
|
|
|
173
|
-
class UploadFilesBtnComponent {
|
|
174
|
-
constructor(_fileUploadService) {
|
|
175
|
-
this._fileUploadService = _fileUploadService;
|
|
176
|
-
this.extAccepts = "*/*";
|
|
177
|
-
this.isMultiple = true;
|
|
178
|
-
this.btnText = "Загрузить файлы";
|
|
179
|
-
this.createLocalCopiesNow = false;
|
|
180
|
-
this.hidden = false;
|
|
181
|
-
this.postFilesStarted = new EventEmitter();
|
|
182
|
-
this.onFilesUploaded = new EventEmitter();
|
|
183
|
-
}
|
|
184
|
-
handleFileInput(files) {
|
|
185
|
-
this.postFilesStarted.emit({
|
|
186
|
-
filesCount: files.length,
|
|
187
|
-
createLocalCopiesNow: this.createLocalCopiesNow
|
|
188
|
-
});
|
|
189
|
-
this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
|
|
190
|
-
this.onFilesUploaded.emit(data);
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
clickFileInput() {
|
|
194
|
-
this.fileInput.nativeElement.click();
|
|
195
|
-
}
|
|
196
|
-
ngOnInit() {
|
|
197
|
-
}
|
|
198
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
200
|
-
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
202
|
-
type: Component,
|
|
203
|
-
args: [{ selector: 'croco-app-upload-files-btn', template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\r\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />" }]
|
|
204
|
-
}], ctorParameters:
|
|
205
|
-
type: ViewChild,
|
|
206
|
-
args: ['filesInput']
|
|
207
|
-
}], extAccepts: [{
|
|
208
|
-
type: Input
|
|
209
|
-
}], isMultiple: [{
|
|
210
|
-
type: Input
|
|
211
|
-
}], btnText: [{
|
|
212
|
-
type: Input
|
|
213
|
-
}], createLocalCopiesNow: [{
|
|
214
|
-
type: Input
|
|
215
|
-
}], hidden: [{
|
|
216
|
-
type: Input
|
|
217
|
-
}], postFilesStarted: [{
|
|
218
|
-
type: Output
|
|
219
|
-
}], onFilesUploaded: [{
|
|
220
|
-
type: Output
|
|
173
|
+
class UploadFilesBtnComponent {
|
|
174
|
+
constructor(_fileUploadService) {
|
|
175
|
+
this._fileUploadService = _fileUploadService;
|
|
176
|
+
this.extAccepts = "*/*";
|
|
177
|
+
this.isMultiple = true;
|
|
178
|
+
this.btnText = "Загрузить файлы";
|
|
179
|
+
this.createLocalCopiesNow = false;
|
|
180
|
+
this.hidden = false;
|
|
181
|
+
this.postFilesStarted = new EventEmitter();
|
|
182
|
+
this.onFilesUploaded = new EventEmitter();
|
|
183
|
+
}
|
|
184
|
+
handleFileInput(files) {
|
|
185
|
+
this.postFilesStarted.emit({
|
|
186
|
+
filesCount: files.length,
|
|
187
|
+
createLocalCopiesNow: this.createLocalCopiesNow
|
|
188
|
+
});
|
|
189
|
+
this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
|
|
190
|
+
this.onFilesUploaded.emit(data);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
clickFileInput() {
|
|
194
|
+
this.fileInput.nativeElement.click();
|
|
195
|
+
}
|
|
196
|
+
ngOnInit() {
|
|
197
|
+
}
|
|
198
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: UploadFilesBtnComponent, selector: "croco-app-upload-files-btn", inputs: { extAccepts: "extAccepts", isMultiple: "isMultiple", btnText: "btnText", createLocalCopiesNow: "createLocalCopiesNow", hidden: "hidden" }, outputs: { postFilesStarted: "postFilesStarted", onFilesUploaded: "onFilesUploaded" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["filesInput"], descendants: true }], ngImport: i0, template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\r\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
200
|
+
}
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, decorators: [{
|
|
202
|
+
type: Component,
|
|
203
|
+
args: [{ selector: 'croco-app-upload-files-btn', template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\r\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />" }]
|
|
204
|
+
}], ctorParameters: () => [{ type: FileUploadService }], propDecorators: { fileInput: [{
|
|
205
|
+
type: ViewChild,
|
|
206
|
+
args: ['filesInput']
|
|
207
|
+
}], extAccepts: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], isMultiple: [{
|
|
210
|
+
type: Input
|
|
211
|
+
}], btnText: [{
|
|
212
|
+
type: Input
|
|
213
|
+
}], createLocalCopiesNow: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], hidden: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], postFilesStarted: [{
|
|
218
|
+
type: Output
|
|
219
|
+
}], onFilesUploaded: [{
|
|
220
|
+
type: Output
|
|
221
221
|
}] } });
|
|
222
222
|
|
|
223
|
-
class AddFilesBtnComponent {
|
|
224
|
-
constructor() {
|
|
225
|
-
this.postFilesStarted = new EventEmitter();
|
|
226
|
-
this.fileIds = [];
|
|
227
|
-
this.filesTagsReady = new EventEmitter();
|
|
228
|
-
}
|
|
229
|
-
postFilesStartedEventHandler(data) {
|
|
230
|
-
this.postFilesStarted.emit(data);
|
|
231
|
-
}
|
|
232
|
-
filesUploadedHandler(data) {
|
|
233
|
-
this.fileIds = data.responseObject;
|
|
234
|
-
let fileTags = [];
|
|
235
|
-
for (let i = 0; i < this.fileIds.length; i++) {
|
|
236
|
-
let fileTag = {
|
|
237
|
-
presentOrEdit: true,
|
|
238
|
-
tagDescription: {
|
|
239
|
-
tag: FileImageTagDataConsts.TagName,
|
|
240
|
-
displayValue: "Изображение"
|
|
241
|
-
},
|
|
242
|
-
attributes: {
|
|
243
|
-
[FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
|
|
244
|
-
},
|
|
245
|
-
innerHtml: ""
|
|
246
|
-
};
|
|
247
|
-
fileTags.push(fileTag);
|
|
248
|
-
}
|
|
249
|
-
this.filesTagsReady.emit(fileTags);
|
|
250
|
-
}
|
|
251
|
-
handleClick() {
|
|
252
|
-
this.fakeBtn.clickFileInput();
|
|
253
|
-
}
|
|
254
|
-
ngOnInit() {
|
|
255
|
-
}
|
|
256
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
257
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
258
|
-
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
260
|
-
type: Component,
|
|
261
|
-
args: [{ selector: 'croco-html-add-files-btn', template: "<div [hidden]=\"true\">\r\n <croco-app-upload-files-btn #fakeBtn \r\n (onFilesUploaded)=\"filesUploadedHandler($event)\" \r\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\r\n [createLocalCopiesNow]=\"true\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \r\n [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\r\n</div>\r\n\r\n<div>\r\n <button class=\"w-100\" \r\n (click)=\"handleClick()\"\r\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\r\n</div>" }]
|
|
262
|
-
}], ctorParameters:
|
|
263
|
-
type: Output
|
|
264
|
-
}], fakeBtn: [{
|
|
265
|
-
type: ViewChild,
|
|
266
|
-
args: ["fakeBtn"]
|
|
267
|
-
}], filesTagsReady: [{
|
|
268
|
-
type: Output
|
|
223
|
+
class AddFilesBtnComponent {
|
|
224
|
+
constructor() {
|
|
225
|
+
this.postFilesStarted = new EventEmitter();
|
|
226
|
+
this.fileIds = [];
|
|
227
|
+
this.filesTagsReady = new EventEmitter();
|
|
228
|
+
}
|
|
229
|
+
postFilesStartedEventHandler(data) {
|
|
230
|
+
this.postFilesStarted.emit(data);
|
|
231
|
+
}
|
|
232
|
+
filesUploadedHandler(data) {
|
|
233
|
+
this.fileIds = data.responseObject;
|
|
234
|
+
let fileTags = [];
|
|
235
|
+
for (let i = 0; i < this.fileIds.length; i++) {
|
|
236
|
+
let fileTag = {
|
|
237
|
+
presentOrEdit: true,
|
|
238
|
+
tagDescription: {
|
|
239
|
+
tag: FileImageTagDataConsts.TagName,
|
|
240
|
+
displayValue: "Изображение"
|
|
241
|
+
},
|
|
242
|
+
attributes: {
|
|
243
|
+
[FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
|
|
244
|
+
},
|
|
245
|
+
innerHtml: ""
|
|
246
|
+
};
|
|
247
|
+
fileTags.push(fileTag);
|
|
248
|
+
}
|
|
249
|
+
this.filesTagsReady.emit(fileTags);
|
|
250
|
+
}
|
|
251
|
+
handleClick() {
|
|
252
|
+
this.fakeBtn.clickFileInput();
|
|
253
|
+
}
|
|
254
|
+
ngOnInit() {
|
|
255
|
+
}
|
|
256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
257
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: AddFilesBtnComponent, selector: "croco-html-add-files-btn", outputs: { postFilesStarted: "postFilesStarted", filesTagsReady: "filesTagsReady" }, viewQueries: [{ propertyName: "fakeBtn", first: true, predicate: ["fakeBtn"], descendants: true }], ngImport: i0, template: "<div [hidden]=\"true\">\r\n <croco-app-upload-files-btn #fakeBtn \r\n (onFilesUploaded)=\"filesUploadedHandler($event)\" \r\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\r\n [createLocalCopiesNow]=\"true\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \r\n [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\r\n</div>\r\n\r\n<div>\r\n <button class=\"w-100\" \r\n (click)=\"handleClick()\"\r\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: UploadFilesBtnComponent, selector: "croco-app-upload-files-btn", inputs: ["extAccepts", "isMultiple", "btnText", "createLocalCopiesNow", "hidden"], outputs: ["postFilesStarted", "onFilesUploaded"] }] }); }
|
|
258
|
+
}
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, decorators: [{
|
|
260
|
+
type: Component,
|
|
261
|
+
args: [{ selector: 'croco-html-add-files-btn', template: "<div [hidden]=\"true\">\r\n <croco-app-upload-files-btn #fakeBtn \r\n (onFilesUploaded)=\"filesUploadedHandler($event)\" \r\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\r\n [createLocalCopiesNow]=\"true\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \r\n [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\r\n</div>\r\n\r\n<div>\r\n <button class=\"w-100\" \r\n (click)=\"handleClick()\"\r\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\r\n</div>" }]
|
|
262
|
+
}], ctorParameters: () => [], propDecorators: { postFilesStarted: [{
|
|
263
|
+
type: Output
|
|
264
|
+
}], fakeBtn: [{
|
|
265
|
+
type: ViewChild,
|
|
266
|
+
args: ["fakeBtn"]
|
|
267
|
+
}], filesTagsReady: [{
|
|
268
|
+
type: Output
|
|
269
269
|
}] } });
|
|
270
270
|
|
|
271
|
-
class ExternalVideoTagDataConsts {
|
|
272
|
-
static { this.TagName = "external-video"; }
|
|
273
|
-
static { this.VideoTypeAttrName = "type"; }
|
|
274
|
-
static { this.LinkAttrName = "link"; }
|
|
275
|
-
}
|
|
276
|
-
class ExternalVideoSupportedTypes {
|
|
277
|
-
static { this.Youtube = "youtube"; }
|
|
278
|
-
}
|
|
279
|
-
class VideoMethods {
|
|
280
|
-
static ExtractExternalVideoTag(elem) {
|
|
281
|
-
return {
|
|
282
|
-
type: ExternalVideoTagDataConsts.TagName,
|
|
283
|
-
data: {
|
|
284
|
-
type: elem.getAttribute(ExternalVideoTagDataConsts.VideoTypeAttrName),
|
|
285
|
-
link: elem.getAttribute(ExternalVideoTagDataConsts.LinkAttrName)
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}
|
|
271
|
+
class ExternalVideoTagDataConsts {
|
|
272
|
+
static { this.TagName = "external-video"; }
|
|
273
|
+
static { this.VideoTypeAttrName = "type"; }
|
|
274
|
+
static { this.LinkAttrName = "link"; }
|
|
275
|
+
}
|
|
276
|
+
class ExternalVideoSupportedTypes {
|
|
277
|
+
static { this.Youtube = "youtube"; }
|
|
278
|
+
}
|
|
279
|
+
class VideoMethods {
|
|
280
|
+
static ExtractExternalVideoTag(elem) {
|
|
281
|
+
return {
|
|
282
|
+
type: ExternalVideoTagDataConsts.TagName,
|
|
283
|
+
data: {
|
|
284
|
+
type: elem.getAttribute(ExternalVideoTagDataConsts.VideoTypeAttrName),
|
|
285
|
+
link: elem.getAttribute(ExternalVideoTagDataConsts.LinkAttrName)
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
class XmlTagExternalVideoComponent {
|
|
292
|
-
set data(value) {
|
|
293
|
-
this.tagData = value.data;
|
|
294
|
-
}
|
|
295
|
-
;
|
|
296
|
-
set tagData(value) {
|
|
297
|
-
this.videoId = this.getYouTubeId(value.link);
|
|
298
|
-
}
|
|
299
|
-
;
|
|
300
|
-
constructor(_domSanitizer) {
|
|
301
|
-
this._domSanitizer = _domSanitizer;
|
|
302
|
-
}
|
|
303
|
-
ngOnInit() {
|
|
304
|
-
const youtubeIframeApiUrl = 'https://www.youtube.com/iframe_api';
|
|
305
|
-
if (!document.querySelector(`script[src="${youtubeIframeApiUrl}"]`)) {
|
|
306
|
-
// This code loads the IFrame Player API code asynchronously, according to the instructions at
|
|
307
|
-
// https://developers.google.com/youtube/iframe_api_reference#Getting_Started
|
|
308
|
-
const tag = document.createElement('script');
|
|
309
|
-
tag.setAttribute('src', youtubeIframeApiUrl);
|
|
310
|
-
document.body.appendChild(tag);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
getYouTubeId(youtubeLink) {
|
|
314
|
-
//https://www.youtube.com/watch?v=l3KfbfkxJOU
|
|
315
|
-
if (youtubeLink.includes("watch?v=")) {
|
|
316
|
-
const url = new URL(youtubeLink);
|
|
317
|
-
return url.searchParams.get("v");
|
|
318
|
-
}
|
|
319
|
-
//https://youtu.be/jzBneaWSswY
|
|
320
|
-
const bits = youtubeLink.split('/');
|
|
321
|
-
return bits[bits.length - 1];
|
|
322
|
-
}
|
|
323
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
324
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
325
|
-
}
|
|
326
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
327
|
-
type: Component,
|
|
328
|
-
args: [{ selector: 'croco-html-xml-tag-external-video', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"d-flex justify-content-center\">\r\n <youtube-player height=\"100%\" width=\"100%\" class=\"y-video\" *ngIf=\"videoId\" [videoId]=\"videoId\"></youtube-player>\r\n</div>\r\n", styles: ["@media only screen and (min-width: 769px){.y-video{display:block;width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 827px){.y-video{display:block;width:100%;height:315px}}\n"] }]
|
|
329
|
-
}], ctorParameters:
|
|
330
|
-
type: Input
|
|
331
|
-
}], tagData: [{
|
|
332
|
-
type: Input
|
|
291
|
+
class XmlTagExternalVideoComponent {
|
|
292
|
+
set data(value) {
|
|
293
|
+
this.tagData = value.data;
|
|
294
|
+
}
|
|
295
|
+
;
|
|
296
|
+
set tagData(value) {
|
|
297
|
+
this.videoId = this.getYouTubeId(value.link);
|
|
298
|
+
}
|
|
299
|
+
;
|
|
300
|
+
constructor(_domSanitizer) {
|
|
301
|
+
this._domSanitizer = _domSanitizer;
|
|
302
|
+
}
|
|
303
|
+
ngOnInit() {
|
|
304
|
+
const youtubeIframeApiUrl = 'https://www.youtube.com/iframe_api';
|
|
305
|
+
if (!document.querySelector(`script[src="${youtubeIframeApiUrl}"]`)) {
|
|
306
|
+
// This code loads the IFrame Player API code asynchronously, according to the instructions at
|
|
307
|
+
// https://developers.google.com/youtube/iframe_api_reference#Getting_Started
|
|
308
|
+
const tag = document.createElement('script');
|
|
309
|
+
tag.setAttribute('src', youtubeIframeApiUrl);
|
|
310
|
+
document.body.appendChild(tag);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
getYouTubeId(youtubeLink) {
|
|
314
|
+
//https://www.youtube.com/watch?v=l3KfbfkxJOU
|
|
315
|
+
if (youtubeLink.includes("watch?v=")) {
|
|
316
|
+
const url = new URL(youtubeLink);
|
|
317
|
+
return url.searchParams.get("v");
|
|
318
|
+
}
|
|
319
|
+
//https://youtu.be/jzBneaWSswY
|
|
320
|
+
const bits = youtubeLink.split('/');
|
|
321
|
+
return bits[bits.length - 1];
|
|
322
|
+
}
|
|
323
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagExternalVideoComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
324
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: { data: "data", tagData: "tagData" }, ngImport: i0, template: "<div class=\"d-flex justify-content-center\">\r\n <youtube-player height=\"100%\" width=\"100%\" class=\"y-video\" *ngIf=\"videoId\" [videoId]=\"videoId\"></youtube-player>\r\n</div>\r\n", styles: ["@media only screen and (min-width: 769px){.y-video{display:block;width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 827px){.y-video{display:block;width:100%;height:315px}}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.YouTubePlayer, selector: "youtube-player", inputs: ["videoId", "height", "width", "startSeconds", "endSeconds", "suggestedQuality", "playerVars", "disableCookies", "loadApi", "disablePlaceholder", "showBeforeIframeApiLoads", "placeholderButtonLabel", "placeholderImageQuality"], outputs: ["ready", "stateChange", "error", "apiChange", "playbackQualityChange", "playbackRateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
325
|
+
}
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagExternalVideoComponent, decorators: [{
|
|
327
|
+
type: Component,
|
|
328
|
+
args: [{ selector: 'croco-html-xml-tag-external-video', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"d-flex justify-content-center\">\r\n <youtube-player height=\"100%\" width=\"100%\" class=\"y-video\" *ngIf=\"videoId\" [videoId]=\"videoId\"></youtube-player>\r\n</div>\r\n", styles: ["@media only screen and (min-width: 769px){.y-video{display:block;width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 827px){.y-video{display:block;width:100%;height:315px}}\n"] }]
|
|
329
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { data: [{
|
|
330
|
+
type: Input
|
|
331
|
+
}], tagData: [{
|
|
332
|
+
type: Input
|
|
333
333
|
}] } });
|
|
334
334
|
|
|
335
|
-
class ExternalVideoBlockComponent {
|
|
336
|
-
constructor() {
|
|
337
|
-
this.onTagUpdated = new EventEmitter();
|
|
338
|
-
this.defaultLink = "https://youtu.be/jzBneaWSswY";
|
|
339
|
-
this.data = {
|
|
340
|
-
youtubeLink: this.defaultLink
|
|
341
|
-
};
|
|
342
|
-
this.tagData = {
|
|
343
|
-
link: this.defaultLink,
|
|
344
|
-
type: ExternalVideoSupportedTypes.Youtube
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
linkChanged() {
|
|
348
|
-
this.tagData.link = this.data.youtubeLink;
|
|
349
|
-
this.tag.attributes = this.tagData;
|
|
350
|
-
}
|
|
351
|
-
ngOnInit() {
|
|
352
|
-
if (!this.tag?.attributes?.['link']) {
|
|
353
|
-
this.linkChanged();
|
|
354
|
-
}
|
|
355
|
-
this.tagData = this.tag.attributes;
|
|
356
|
-
this.data.youtubeLink = this.tagData.link;
|
|
357
|
-
}
|
|
358
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
359
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
360
|
-
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
362
|
-
type: Component,
|
|
363
|
-
args: [{ selector: 'croco-html-external-video-block', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n \r\n <div>\r\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\r\n </div>\r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\r\n </croco-html-xml-tag-external-video>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\r\n new-autocomplete=\"off\"\r\n autocomplete=\"off\"\r\n [(ngModel)]=\"data.youtubeLink\"\r\n (ngModelChange)=\"linkChanged()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n" }]
|
|
364
|
-
}], propDecorators: { tag: [{
|
|
365
|
-
type: Input
|
|
366
|
-
}], onTagUpdated: [{
|
|
367
|
-
type: Output
|
|
335
|
+
class ExternalVideoBlockComponent {
|
|
336
|
+
constructor() {
|
|
337
|
+
this.onTagUpdated = new EventEmitter();
|
|
338
|
+
this.defaultLink = "https://youtu.be/jzBneaWSswY";
|
|
339
|
+
this.data = {
|
|
340
|
+
youtubeLink: this.defaultLink
|
|
341
|
+
};
|
|
342
|
+
this.tagData = {
|
|
343
|
+
link: this.defaultLink,
|
|
344
|
+
type: ExternalVideoSupportedTypes.Youtube
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
linkChanged() {
|
|
348
|
+
this.tagData.link = this.data.youtubeLink;
|
|
349
|
+
this.tag.attributes = this.tagData;
|
|
350
|
+
}
|
|
351
|
+
ngOnInit() {
|
|
352
|
+
if (!this.tag?.attributes?.['link']) {
|
|
353
|
+
this.linkChanged();
|
|
354
|
+
}
|
|
355
|
+
this.tagData = this.tag.attributes;
|
|
356
|
+
this.data.youtubeLink = this.tagData.link;
|
|
357
|
+
}
|
|
358
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ExternalVideoBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
359
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n \r\n <div>\r\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\r\n </div>\r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\r\n </croco-html-xml-tag-external-video>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\r\n new-autocomplete=\"off\"\r\n autocomplete=\"off\"\r\n [(ngModel)]=\"data.youtubeLink\"\r\n (ngModelChange)=\"linkChanged()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }] }); }
|
|
360
|
+
}
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ExternalVideoBlockComponent, decorators: [{
|
|
362
|
+
type: Component,
|
|
363
|
+
args: [{ selector: 'croco-html-external-video-block', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n \r\n <div>\r\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\r\n </div>\r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\r\n </croco-html-xml-tag-external-video>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\r\n new-autocomplete=\"off\"\r\n autocomplete=\"off\"\r\n [(ngModel)]=\"data.youtubeLink\"\r\n (ngModelChange)=\"linkChanged()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n" }]
|
|
364
|
+
}], propDecorators: { tag: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], onTagUpdated: [{
|
|
367
|
+
type: Output
|
|
368
368
|
}] } });
|
|
369
369
|
|
|
370
|
-
class HtmlRawEditorComponent {
|
|
371
|
-
constructor() {
|
|
372
|
-
this.onTagUpdated = new EventEmitter();
|
|
373
|
-
}
|
|
374
|
-
ngOnInit() {
|
|
375
|
-
}
|
|
376
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
377
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
378
|
-
}
|
|
379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
380
|
-
type: Component,
|
|
381
|
-
args: [{ selector: 'croco-html-html-raw-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div [innerHTML]=\"tag.innerHtml\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n" }]
|
|
382
|
-
}], ctorParameters:
|
|
383
|
-
type: Input
|
|
384
|
-
}], onTagUpdated: [{
|
|
385
|
-
type: Output
|
|
370
|
+
class HtmlRawEditorComponent {
|
|
371
|
+
constructor() {
|
|
372
|
+
this.onTagUpdated = new EventEmitter();
|
|
373
|
+
}
|
|
374
|
+
ngOnInit() {
|
|
375
|
+
}
|
|
376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlRawEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
377
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div [innerHTML]=\"tag.innerHtml\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }] }); }
|
|
378
|
+
}
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlRawEditorComponent, decorators: [{
|
|
380
|
+
type: Component,
|
|
381
|
+
args: [{ selector: 'croco-html-html-raw-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div [innerHTML]=\"tag.innerHtml\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n" }]
|
|
382
|
+
}], ctorParameters: () => [], propDecorators: { tag: [{
|
|
383
|
+
type: Input
|
|
384
|
+
}], onTagUpdated: [{
|
|
385
|
+
type: Output
|
|
386
386
|
}] } });
|
|
387
387
|
|
|
388
|
-
class FilesQueryService {
|
|
389
|
-
constructor(_httpClient, baseUrl) {
|
|
390
|
-
this._httpClient = _httpClient;
|
|
391
|
-
this._baseControllerUrl = baseUrl + 'Api/Files/';
|
|
392
|
-
}
|
|
393
|
-
getFilesWithRelations(model) {
|
|
394
|
-
return this._httpClient.post(this._baseControllerUrl + `GetFiles/WithRelations`, model);
|
|
395
|
-
}
|
|
396
|
-
getFiles(model) {
|
|
397
|
-
return this._httpClient.post(this._baseControllerUrl + `GetFiles`, model);
|
|
398
|
-
}
|
|
399
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
400
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
401
|
-
}
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
403
|
-
type: Injectable,
|
|
404
|
-
args: [{
|
|
405
|
-
providedIn: 'root'
|
|
406
|
-
}]
|
|
407
|
-
}], ctorParameters:
|
|
408
|
-
type: Inject,
|
|
409
|
-
args: ['BASE_URL']
|
|
410
|
-
}] }]
|
|
388
|
+
class FilesQueryService {
|
|
389
|
+
constructor(_httpClient, baseUrl) {
|
|
390
|
+
this._httpClient = _httpClient;
|
|
391
|
+
this._baseControllerUrl = baseUrl + 'Api/Files/';
|
|
392
|
+
}
|
|
393
|
+
getFilesWithRelations(model) {
|
|
394
|
+
return this._httpClient.post(this._baseControllerUrl + `GetFiles/WithRelations`, model);
|
|
395
|
+
}
|
|
396
|
+
getFiles(model) {
|
|
397
|
+
return this._httpClient.post(this._baseControllerUrl + `GetFiles`, model);
|
|
398
|
+
}
|
|
399
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FilesQueryService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
400
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FilesQueryService, providedIn: 'root' }); }
|
|
401
|
+
}
|
|
402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FilesQueryService, decorators: [{
|
|
403
|
+
type: Injectable,
|
|
404
|
+
args: [{
|
|
405
|
+
providedIn: 'root'
|
|
406
|
+
}]
|
|
407
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
408
|
+
type: Inject,
|
|
409
|
+
args: ['BASE_URL']
|
|
410
|
+
}] }] });
|
|
411
411
|
|
|
412
|
-
class FileIdSelectComponent {
|
|
413
|
-
constructor(_fileService) {
|
|
414
|
-
this._fileService = _fileService;
|
|
415
|
-
this.labelText = "Поиск файлов";
|
|
416
|
-
this.loading = false;
|
|
417
|
-
this.files = [];
|
|
418
|
-
this.onFileIdChanged = new EventEmitter();
|
|
419
|
-
}
|
|
420
|
-
onModelChanged(fileId) {
|
|
421
|
-
this.onFileIdChanged.emit(fileId);
|
|
422
|
-
}
|
|
423
|
-
getSrc(fileId) {
|
|
424
|
-
return ImageMethods.buildSmallUrl(fileId, { useCustomDomain: false, domain: "" });
|
|
425
|
-
}
|
|
426
|
-
ngOnInit() {
|
|
427
|
-
this.loadFiles();
|
|
428
|
-
}
|
|
429
|
-
loadFiles() {
|
|
430
|
-
this.loading = true;
|
|
431
|
-
this._fileService.getFiles({
|
|
432
|
-
count: 10,
|
|
433
|
-
offSet: 0,
|
|
434
|
-
fileName: null,
|
|
435
|
-
q: this.q
|
|
436
|
-
}).subscribe(data => {
|
|
437
|
-
this.files = [...data.list];
|
|
438
|
-
this.loading = false;
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
onSearchChanged(q) {
|
|
442
|
-
this.q = q.term;
|
|
443
|
-
this.loadFiles();
|
|
444
|
-
}
|
|
445
|
-
ngOnChanges(changes) {
|
|
446
|
-
this.loadFiles();
|
|
447
|
-
}
|
|
448
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
449
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
450
|
-
}
|
|
451
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
452
|
-
type: Component,
|
|
453
|
-
args: [{ selector: 'croco-html-file-id-select', template: "<div>\r\n <div class=\"form-group\">\r\n <label for=\"fileName\">{{labelText}}</label>\r\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\r\n [items]=\"files\"\r\n #select\r\n bindLabel=\"fileName\"\r\n (search)=\"onSearchChanged($event)\"\r\n [loading]=\"loading\"\r\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\r\n dropdownPosition=\"auto\"\r\n bindValue=\"fileId\"\r\n labelForId=\"fileName\"\r\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\r\n [virtualScroll]=\"true\">\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <div>\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\r\n </div>\r\n <div>\r\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\r\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\r\n </div>\r\n <div>\r\n <small>\r\n <span>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\r\n </span>\r\n </small>\r\n </div>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n</div>\r\n\r\n<div>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\r\n</div>\r\n" }]
|
|
454
|
-
}], ctorParameters:
|
|
455
|
-
type: Input
|
|
456
|
-
}], fileId: [{
|
|
457
|
-
type: Input
|
|
458
|
-
}, {
|
|
459
|
-
type: Output
|
|
460
|
-
}], onFileIdChanged: [{
|
|
461
|
-
type: Output
|
|
412
|
+
class FileIdSelectComponent {
|
|
413
|
+
constructor(_fileService) {
|
|
414
|
+
this._fileService = _fileService;
|
|
415
|
+
this.labelText = "Поиск файлов";
|
|
416
|
+
this.loading = false;
|
|
417
|
+
this.files = [];
|
|
418
|
+
this.onFileIdChanged = new EventEmitter();
|
|
419
|
+
}
|
|
420
|
+
onModelChanged(fileId) {
|
|
421
|
+
this.onFileIdChanged.emit(fileId);
|
|
422
|
+
}
|
|
423
|
+
getSrc(fileId) {
|
|
424
|
+
return ImageMethods.buildSmallUrl(fileId, { useCustomDomain: false, domain: "" });
|
|
425
|
+
}
|
|
426
|
+
ngOnInit() {
|
|
427
|
+
this.loadFiles();
|
|
428
|
+
}
|
|
429
|
+
loadFiles() {
|
|
430
|
+
this.loading = true;
|
|
431
|
+
this._fileService.getFiles({
|
|
432
|
+
count: 10,
|
|
433
|
+
offSet: 0,
|
|
434
|
+
fileName: null,
|
|
435
|
+
q: this.q
|
|
436
|
+
}).subscribe(data => {
|
|
437
|
+
this.files = [...data.list];
|
|
438
|
+
this.loading = false;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
onSearchChanged(q) {
|
|
442
|
+
this.q = q.term;
|
|
443
|
+
this.loadFiles();
|
|
444
|
+
}
|
|
445
|
+
ngOnChanges(changes) {
|
|
446
|
+
this.loadFiles();
|
|
447
|
+
}
|
|
448
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileIdSelectComponent, deps: [{ token: FilesQueryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
449
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: { labelText: "labelText", fileId: "fileId" }, outputs: { fileId: "fileId", onFileIdChanged: "onFileIdChanged" }, usesOnChanges: true, ngImport: i0, template: "<div>\r\n <div class=\"form-group\">\r\n <label for=\"fileName\">{{labelText}}</label>\r\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\r\n [items]=\"files\"\r\n #select\r\n bindLabel=\"fileName\"\r\n (search)=\"onSearchChanged($event)\"\r\n [loading]=\"loading\"\r\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\r\n dropdownPosition=\"auto\"\r\n bindValue=\"fileId\"\r\n labelForId=\"fileName\"\r\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\r\n [virtualScroll]=\"true\">\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <div>\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\r\n </div>\r\n <div>\r\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\r\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\r\n </div>\r\n <div>\r\n <small>\r\n <span>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\r\n </span>\r\n </small>\r\n </div>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n</div>\r\n\r\n<div>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3$2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }] }); }
|
|
450
|
+
}
|
|
451
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileIdSelectComponent, decorators: [{
|
|
452
|
+
type: Component,
|
|
453
|
+
args: [{ selector: 'croco-html-file-id-select', template: "<div>\r\n <div class=\"form-group\">\r\n <label for=\"fileName\">{{labelText}}</label>\r\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\r\n [items]=\"files\"\r\n #select\r\n bindLabel=\"fileName\"\r\n (search)=\"onSearchChanged($event)\"\r\n [loading]=\"loading\"\r\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\r\n dropdownPosition=\"auto\"\r\n bindValue=\"fileId\"\r\n labelForId=\"fileName\"\r\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\r\n [virtualScroll]=\"true\">\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <div>\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\r\n </div>\r\n <div>\r\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\r\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\r\n </div>\r\n <div>\r\n <small>\r\n <span>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\r\n </span>\r\n </small>\r\n </div>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n</div>\r\n\r\n<div>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\r\n</div>\r\n" }]
|
|
454
|
+
}], ctorParameters: () => [{ type: FilesQueryService }], propDecorators: { labelText: [{
|
|
455
|
+
type: Input
|
|
456
|
+
}], fileId: [{
|
|
457
|
+
type: Input
|
|
458
|
+
}, {
|
|
459
|
+
type: Output
|
|
460
|
+
}], onFileIdChanged: [{
|
|
461
|
+
type: Output
|
|
462
462
|
}] } });
|
|
463
463
|
|
|
464
|
-
class ImageEditorComponent {
|
|
465
|
-
onErrorHandler() {
|
|
466
|
-
this.hasImageError = true;
|
|
467
|
-
}
|
|
468
|
-
constructor() {
|
|
469
|
-
this.hasImageError = false;
|
|
470
|
-
this.searchOrEdit = "search";
|
|
471
|
-
this.onTagUpdated = new EventEmitter();
|
|
472
|
-
}
|
|
473
|
-
getSrc() {
|
|
474
|
-
return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], { useCustomDomain: false, domain: "" });
|
|
475
|
-
}
|
|
476
|
-
hasFileId() {
|
|
477
|
-
return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
|
|
478
|
-
}
|
|
479
|
-
onFileIdChanged(fileId) {
|
|
480
|
-
this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
|
|
481
|
-
this.removeImageError();
|
|
482
|
-
}
|
|
483
|
-
removeImageError() {
|
|
484
|
-
this.hasImageError = false;
|
|
485
|
-
}
|
|
486
|
-
ngOnInit() {
|
|
487
|
-
}
|
|
488
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
489
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
490
|
-
}
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
492
|
-
type: Component,
|
|
493
|
-
args: [{ selector: 'croco-html-image-editor', template: "<div>\r\n <div style=\"height: 10px;\">\r\n </div>\r\n \r\n <div *ngIf=\"hasImageError\" class=\"error-block\">\r\n \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0444\u0430\u0439\u043B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\r\n </div>\r\n\r\n <div *ngIf=\"hasFileId() && !hasImageError\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\r\n </div>\r\n\r\n <div *ngIf=\"!hasFileId()\">\r\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div style=\"overflow-x:auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\r\n <mat-button-toggle value=\"search\">\r\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"edit\">\r\n \u0423\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443 <mat-icon>settings</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n \r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'search'\">\r\n <croco-html-file-id-select\r\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\r\n [(fileId)]=\"tag.attributes['file-id']\"\r\n (onFileIdChanged)=\"onFileIdChanged($event)\">\r\n </croco-html-file-id-select>\r\n </div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'edit'\">\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\" new-autocomplete=\"off\" autocomplete=\"off\"\r\n type=\"number\"\r\n [(ngModel)]=\"tag.attributes['file-id']\"\r\n (ngModelChange)=\"removeImageError()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"] }]
|
|
494
|
-
}], ctorParameters:
|
|
495
|
-
type: Input
|
|
496
|
-
}], onTagUpdated: [{
|
|
497
|
-
type: Output
|
|
464
|
+
class ImageEditorComponent {
|
|
465
|
+
onErrorHandler() {
|
|
466
|
+
this.hasImageError = true;
|
|
467
|
+
}
|
|
468
|
+
constructor() {
|
|
469
|
+
this.hasImageError = false;
|
|
470
|
+
this.searchOrEdit = "search";
|
|
471
|
+
this.onTagUpdated = new EventEmitter();
|
|
472
|
+
}
|
|
473
|
+
getSrc() {
|
|
474
|
+
return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], { useCustomDomain: false, domain: "" });
|
|
475
|
+
}
|
|
476
|
+
hasFileId() {
|
|
477
|
+
return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
|
|
478
|
+
}
|
|
479
|
+
onFileIdChanged(fileId) {
|
|
480
|
+
this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
|
|
481
|
+
this.removeImageError();
|
|
482
|
+
}
|
|
483
|
+
removeImageError() {
|
|
484
|
+
this.hasImageError = false;
|
|
485
|
+
}
|
|
486
|
+
ngOnInit() {
|
|
487
|
+
}
|
|
488
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImageEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
489
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div>\r\n <div style=\"height: 10px;\">\r\n </div>\r\n \r\n <div *ngIf=\"hasImageError\" class=\"error-block\">\r\n \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0444\u0430\u0439\u043B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\r\n </div>\r\n\r\n <div *ngIf=\"hasFileId() && !hasImageError\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\r\n </div>\r\n\r\n <div *ngIf=\"!hasFileId()\">\r\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div style=\"overflow-x:auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\r\n <mat-button-toggle value=\"search\">\r\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"edit\">\r\n \u0423\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443 <mat-icon>settings</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n \r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'search'\">\r\n <croco-html-file-id-select\r\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\r\n [(fileId)]=\"tag.attributes['file-id']\"\r\n (onFileIdChanged)=\"onFileIdChanged($event)\">\r\n </croco-html-file-id-select>\r\n </div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'edit'\">\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\" new-autocomplete=\"off\" autocomplete=\"off\"\r\n type=\"number\"\r\n [(ngModel)]=\"tag.attributes['file-id']\"\r\n (ngModelChange)=\"removeImageError()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: ["labelText", "fileId"], outputs: ["fileId", "onFileIdChanged"] }] }); }
|
|
490
|
+
}
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImageEditorComponent, decorators: [{
|
|
492
|
+
type: Component,
|
|
493
|
+
args: [{ selector: 'croco-html-image-editor', template: "<div>\r\n <div style=\"height: 10px;\">\r\n </div>\r\n \r\n <div *ngIf=\"hasImageError\" class=\"error-block\">\r\n \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0444\u0430\u0439\u043B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\r\n </div>\r\n\r\n <div *ngIf=\"hasFileId() && !hasImageError\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\r\n </div>\r\n\r\n <div *ngIf=\"!hasFileId()\">\r\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div style=\"overflow-x:auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\r\n <mat-button-toggle value=\"search\">\r\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"edit\">\r\n \u0423\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443 <mat-icon>settings</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n \r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'search'\">\r\n <croco-html-file-id-select\r\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\r\n [(fileId)]=\"tag.attributes['file-id']\"\r\n (onFileIdChanged)=\"onFileIdChanged($event)\">\r\n </croco-html-file-id-select>\r\n </div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'edit'\">\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\" new-autocomplete=\"off\" autocomplete=\"off\"\r\n type=\"number\"\r\n [(ngModel)]=\"tag.attributes['file-id']\"\r\n (ngModelChange)=\"removeImageError()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"] }]
|
|
494
|
+
}], ctorParameters: () => [], propDecorators: { tag: [{
|
|
495
|
+
type: Input
|
|
496
|
+
}], onTagUpdated: [{
|
|
497
|
+
type: Output
|
|
498
498
|
}] } });
|
|
499
499
|
|
|
500
|
-
class XmlTagHtmlViewComponent {
|
|
501
|
-
constructor() {
|
|
502
|
-
this.html = "";
|
|
503
|
-
}
|
|
504
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
505
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
506
|
-
}
|
|
507
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
508
|
-
type: Component,
|
|
509
|
-
args: [{ selector: 'croco-html-xml-tag-html-view', template: "<div class=\"col\" [innerHTML]=\"html\">\r\n</div>" }]
|
|
510
|
-
}], ctorParameters:
|
|
511
|
-
type: Input
|
|
500
|
+
class XmlTagHtmlViewComponent {
|
|
501
|
+
constructor() {
|
|
502
|
+
this.html = "";
|
|
503
|
+
}
|
|
504
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHtmlViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
505
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: { html: "html" }, ngImport: i0, template: "<div class=\"col\" [innerHTML]=\"html\">\r\n</div>", styles: [""] }); }
|
|
506
|
+
}
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHtmlViewComponent, decorators: [{
|
|
508
|
+
type: Component,
|
|
509
|
+
args: [{ selector: 'croco-html-xml-tag-html-view', template: "<div class=\"col\" [innerHTML]=\"html\">\r\n</div>" }]
|
|
510
|
+
}], ctorParameters: () => [], propDecorators: { html: [{
|
|
511
|
+
type: Input
|
|
512
512
|
}] } });
|
|
513
513
|
|
|
514
|
-
class XmlTagTextViewComponent {
|
|
515
|
-
constructor() { }
|
|
516
|
-
ngOnInit() {
|
|
517
|
-
}
|
|
518
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
519
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
520
|
-
}
|
|
521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
522
|
-
type: Component,
|
|
523
|
-
args: [{ selector: 'croco-html-xml-tag-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>" }]
|
|
524
|
-
}], ctorParameters:
|
|
525
|
-
type: Input
|
|
514
|
+
class XmlTagTextViewComponent {
|
|
515
|
+
constructor() { }
|
|
516
|
+
ngOnInit() {
|
|
517
|
+
}
|
|
518
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
519
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: { item: "item" }, ngImport: i0, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
520
|
+
}
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagTextViewComponent, decorators: [{
|
|
522
|
+
type: Component,
|
|
523
|
+
args: [{ selector: 'croco-html-xml-tag-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>" }]
|
|
524
|
+
}], ctorParameters: () => [], propDecorators: { item: [{
|
|
525
|
+
type: Input
|
|
526
526
|
}] } });
|
|
527
527
|
|
|
528
|
-
class XmlTagHeaderInnerTextViewComponent {
|
|
529
|
-
constructor() { }
|
|
530
|
-
ngOnInit() {
|
|
531
|
-
}
|
|
532
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
533
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
534
|
-
}
|
|
535
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
536
|
-
type: Component,
|
|
537
|
-
args: [{ selector: 'croco-html-xml-tag-header-inner-text-view', template: "<h1 *ngIf=\"item.type === 'h1'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h1>\r\n<h2 *ngIf=\"item.type === 'h2'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h2>\r\n<h3 *ngIf=\"item.type === 'h3'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h3>\r\n<h4 *ngIf=\"item.type === 'h4'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h4>\r\n<h5 *ngIf=\"item.type === 'h5'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h5>\r\n<h6 *ngIf=\"item.type === 'h6'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h6>" }]
|
|
538
|
-
}], ctorParameters:
|
|
539
|
-
type: Input
|
|
528
|
+
class XmlTagHeaderInnerTextViewComponent {
|
|
529
|
+
constructor() { }
|
|
530
|
+
ngOnInit() {
|
|
531
|
+
}
|
|
532
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
533
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: { item: "item" }, ngImport: i0, template: "<h1 *ngIf=\"item.type === 'h1'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h1>\r\n<h2 *ngIf=\"item.type === 'h2'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h2>\r\n<h3 *ngIf=\"item.type === 'h3'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h3>\r\n<h4 *ngIf=\"item.type === 'h4'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h4>\r\n<h5 *ngIf=\"item.type === 'h5'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h5>\r\n<h6 *ngIf=\"item.type === 'h6'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h6>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
534
|
+
}
|
|
535
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, decorators: [{
|
|
536
|
+
type: Component,
|
|
537
|
+
args: [{ selector: 'croco-html-xml-tag-header-inner-text-view', template: "<h1 *ngIf=\"item.type === 'h1'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h1>\r\n<h2 *ngIf=\"item.type === 'h2'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h2>\r\n<h3 *ngIf=\"item.type === 'h3'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h3>\r\n<h4 *ngIf=\"item.type === 'h4'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h4>\r\n<h5 *ngIf=\"item.type === 'h5'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h5>\r\n<h6 *ngIf=\"item.type === 'h6'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h6>" }]
|
|
538
|
+
}], ctorParameters: () => [], propDecorators: { item: [{
|
|
539
|
+
type: Input
|
|
540
540
|
}] } });
|
|
541
541
|
|
|
542
|
-
class XmlTagHeaderTextViewComponent {
|
|
543
|
-
constructor() { }
|
|
544
|
-
ngOnInit() {
|
|
545
|
-
}
|
|
546
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
547
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
548
|
-
}
|
|
549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
550
|
-
type: Component,
|
|
551
|
-
args: [{ selector: 'croco-html-xml-tag-header-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>" }]
|
|
552
|
-
}], ctorParameters:
|
|
553
|
-
type: Input
|
|
542
|
+
class XmlTagHeaderTextViewComponent {
|
|
543
|
+
constructor() { }
|
|
544
|
+
ngOnInit() {
|
|
545
|
+
}
|
|
546
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHeaderTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: { item: "item" }, ngImport: i0, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: ["item"] }] }); }
|
|
548
|
+
}
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagHeaderTextViewComponent, decorators: [{
|
|
550
|
+
type: Component,
|
|
551
|
+
args: [{ selector: 'croco-html-xml-tag-header-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\"> </span>\r\n\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 <text></h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>" }]
|
|
552
|
+
}], ctorParameters: () => [], propDecorators: { item: [{
|
|
553
|
+
type: Input
|
|
554
554
|
}] } });
|
|
555
555
|
|
|
556
|
-
class HtmlRawViewComponent {
|
|
557
|
-
constructor(_sanitizer) {
|
|
558
|
-
this._sanitizer = _sanitizer;
|
|
559
|
-
this.rawHtml = "";
|
|
560
|
-
this.isInitialized = false;
|
|
561
|
-
}
|
|
562
|
-
ngOnInit() {
|
|
563
|
-
this.safeHtml = this._sanitizer.bypassSecurityTrustHtml(this.rawHtml);
|
|
564
|
-
}
|
|
565
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
566
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
567
|
-
}
|
|
568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
569
|
-
type: Component,
|
|
570
|
-
args: [{ selector: 'croco-html-raw-view', template: "<div [innerHTML]=\"safeHtml\">\n</div>" }]
|
|
571
|
-
}], ctorParameters:
|
|
572
|
-
type: Input
|
|
556
|
+
class HtmlRawViewComponent {
|
|
557
|
+
constructor(_sanitizer) {
|
|
558
|
+
this._sanitizer = _sanitizer;
|
|
559
|
+
this.rawHtml = "";
|
|
560
|
+
this.isInitialized = false;
|
|
561
|
+
}
|
|
562
|
+
ngOnInit() {
|
|
563
|
+
this.safeHtml = this._sanitizer.bypassSecurityTrustHtml(this.rawHtml);
|
|
564
|
+
}
|
|
565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlRawViewComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: HtmlRawViewComponent, selector: "croco-html-raw-view", inputs: { rawHtml: "rawHtml" }, ngImport: i0, template: "<div [innerHTML]=\"safeHtml\">\n</div>", styles: [""] }); }
|
|
567
|
+
}
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlRawViewComponent, decorators: [{
|
|
569
|
+
type: Component,
|
|
570
|
+
args: [{ selector: 'croco-html-raw-view', template: "<div [innerHTML]=\"safeHtml\">\n</div>" }]
|
|
571
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { rawHtml: [{
|
|
572
|
+
type: Input
|
|
573
573
|
}] } });
|
|
574
574
|
|
|
575
|
-
class XmlTagViewComponent {
|
|
576
|
-
constructor() {
|
|
577
|
-
this.data = [];
|
|
578
|
-
}
|
|
579
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
580
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
581
|
-
}
|
|
582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
583
|
-
type: Component,
|
|
584
|
-
args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div>\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\">\r\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\">\r\n </croco-html-raw-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
|
|
585
|
-
}], ctorParameters:
|
|
586
|
-
type: Input
|
|
575
|
+
class XmlTagViewComponent {
|
|
576
|
+
constructor() {
|
|
577
|
+
this.data = [];
|
|
578
|
+
}
|
|
579
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
580
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div>\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\">\r\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\">\r\n </croco-html-raw-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { kind: "component", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }, { kind: "component", type: HtmlRawViewComponent, selector: "croco-html-raw-view", inputs: ["rawHtml"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagViewComponent, decorators: [{
|
|
583
|
+
type: Component,
|
|
584
|
+
args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div>\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\">\r\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\">\r\n </croco-html-raw-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
|
|
585
|
+
}], ctorParameters: () => [], propDecorators: { data: [{
|
|
586
|
+
type: Input
|
|
587
587
|
}] } });
|
|
588
588
|
|
|
589
|
-
class AngularMaterialTableMethods {
|
|
590
|
-
static getAngularMaterialTableData(columns, rows) {
|
|
591
|
-
let data = [];
|
|
592
|
-
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
593
|
-
const row = rows[rowIndex];
|
|
594
|
-
var elem = {};
|
|
595
|
-
for (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {
|
|
596
|
-
const column = columns[columnIndex];
|
|
597
|
-
elem[column] = row.columns[columnIndex].data.text;
|
|
598
|
-
}
|
|
599
|
-
data.push(elem);
|
|
600
|
-
}
|
|
601
|
-
return {
|
|
602
|
-
displayedColumns: columns,
|
|
603
|
-
data: data,
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
static checkHeaders(tableData) {
|
|
607
|
-
if (tableData.header === null) {
|
|
608
|
-
return {
|
|
609
|
-
isSucceeded: false,
|
|
610
|
-
message: "Необходимо указать заголовок таблицы"
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
let columns = tableData.header.columns;
|
|
614
|
-
var uniqueDislayedColumns = columns.filter((v, i, a) => a.indexOf(v) === i);
|
|
615
|
-
if (uniqueDislayedColumns.length !== columns.length) {
|
|
616
|
-
return {
|
|
617
|
-
isSucceeded: false,
|
|
618
|
-
message: "Ошибка при обработке разметки таблицы. Обнаружены дубликаты заголовков."
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
|
-
return {
|
|
622
|
-
isSucceeded: true,
|
|
623
|
-
message: "Ok"
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
static checkAngularMaterialTableData(tableData, checkHeaders = true) {
|
|
627
|
-
if (checkHeaders) {
|
|
628
|
-
var checkHeadersResult = this.checkHeaders(tableData);
|
|
629
|
-
if (!checkHeadersResult.isSucceeded) {
|
|
630
|
-
return checkHeadersResult;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
let rows = tableData.rows;
|
|
634
|
-
let columns = tableData.header.columns;
|
|
635
|
-
for (let i = 0; i < rows.length; i++) {
|
|
636
|
-
const row = rows[i];
|
|
637
|
-
if (row.columns.length !== columns.length) {
|
|
638
|
-
return {
|
|
639
|
-
isSucceeded: false,
|
|
640
|
-
message: `Ошибка при обработке разметки таблицы. `
|
|
641
|
-
+ `Количество колонок в каждой строке таблицы должно соотвествовать количеству колонок указанных в заголовке. `
|
|
642
|
-
+ `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а должно быть ${columns.length}.`
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
return {
|
|
647
|
-
isSucceeded: true,
|
|
648
|
-
message: "Ok"
|
|
649
|
-
};
|
|
650
|
-
}
|
|
589
|
+
class AngularMaterialTableMethods {
|
|
590
|
+
static getAngularMaterialTableData(columns, rows) {
|
|
591
|
+
let data = [];
|
|
592
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
593
|
+
const row = rows[rowIndex];
|
|
594
|
+
var elem = {};
|
|
595
|
+
for (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {
|
|
596
|
+
const column = columns[columnIndex];
|
|
597
|
+
elem[column] = row.columns[columnIndex].data.text;
|
|
598
|
+
}
|
|
599
|
+
data.push(elem);
|
|
600
|
+
}
|
|
601
|
+
return {
|
|
602
|
+
displayedColumns: columns,
|
|
603
|
+
data: data,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
static checkHeaders(tableData) {
|
|
607
|
+
if (tableData.header === null) {
|
|
608
|
+
return {
|
|
609
|
+
isSucceeded: false,
|
|
610
|
+
message: "Необходимо указать заголовок таблицы"
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
let columns = tableData.header.columns;
|
|
614
|
+
var uniqueDislayedColumns = columns.filter((v, i, a) => a.indexOf(v) === i);
|
|
615
|
+
if (uniqueDislayedColumns.length !== columns.length) {
|
|
616
|
+
return {
|
|
617
|
+
isSucceeded: false,
|
|
618
|
+
message: "Ошибка при обработке разметки таблицы. Обнаружены дубликаты заголовков."
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return {
|
|
622
|
+
isSucceeded: true,
|
|
623
|
+
message: "Ok"
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
static checkAngularMaterialTableData(tableData, checkHeaders = true) {
|
|
627
|
+
if (checkHeaders) {
|
|
628
|
+
var checkHeadersResult = this.checkHeaders(tableData);
|
|
629
|
+
if (!checkHeadersResult.isSucceeded) {
|
|
630
|
+
return checkHeadersResult;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
let rows = tableData.rows;
|
|
634
|
+
let columns = tableData.header.columns;
|
|
635
|
+
for (let i = 0; i < rows.length; i++) {
|
|
636
|
+
const row = rows[i];
|
|
637
|
+
if (row.columns.length !== columns.length) {
|
|
638
|
+
return {
|
|
639
|
+
isSucceeded: false,
|
|
640
|
+
message: `Ошибка при обработке разметки таблицы. `
|
|
641
|
+
+ `Количество колонок в каждой строке таблицы должно соотвествовать количеству колонок указанных в заголовке. `
|
|
642
|
+
+ `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а должно быть ${columns.length}.`
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return {
|
|
647
|
+
isSucceeded: true,
|
|
648
|
+
message: "Ok"
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
const TextTag = "text";
|
|
654
|
-
class TextSimpleMethods {
|
|
655
|
-
static { this.supportedTags = ["sup", "sub", "strong", "b", "i", "u"]; }
|
|
656
|
-
static ExtractTextTag(elem) {
|
|
657
|
-
var hAlignValue = elem.getAttribute("h-align") ?? "left";
|
|
658
|
-
var data = {
|
|
659
|
-
textTagName: elem.tagName.toLowerCase(),
|
|
660
|
-
text: elem.innerText.trim().replace('\n\t', ''),
|
|
661
|
-
html: elem.innerHTML.trim().replace('\n\t', ''),
|
|
662
|
-
horizontalAlignment: hAlignValue,
|
|
663
|
-
validationResult: {
|
|
664
|
-
isSucceeded: true,
|
|
665
|
-
message: "Ok"
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
let result = {
|
|
669
|
-
type: TextTag,
|
|
670
|
-
data: data
|
|
671
|
-
};
|
|
672
|
-
if (result.data.text === '\n') {
|
|
673
|
-
result.data.text = '';
|
|
674
|
-
}
|
|
675
|
-
if (result.data.html === '\n') {
|
|
676
|
-
result.data.html = '';
|
|
677
|
-
}
|
|
678
|
-
var alignmentVals = ["left", "right", "center"];
|
|
679
|
-
if (alignmentVals.indexOf(hAlignValue) < 0) {
|
|
680
|
-
result.data.validationResult = {
|
|
681
|
-
isSucceeded: false,
|
|
682
|
-
message: `Недопустимое значение атрибута h-align. Допустимые значения: ${alignmentVals.join(', ')}. `
|
|
683
|
-
+ 'Данный тег можно не указывать, по-умолчанию будет применено выравнивание слева.'
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
var html = result.data.html;
|
|
687
|
-
var htmlValidation = this.ValidateTextHtml(html);
|
|
688
|
-
if (!htmlValidation.isSucceeded) {
|
|
689
|
-
result.data.validationResult = htmlValidation;
|
|
690
|
-
}
|
|
691
|
-
return result;
|
|
692
|
-
}
|
|
693
|
-
static ValidateTextHtml(html) {
|
|
694
|
-
var p = document.createElement("p");
|
|
695
|
-
p.innerHTML = html;
|
|
696
|
-
for (let i = 0; i < p.children.length; i++) {
|
|
697
|
-
const element = p.children.item(i);
|
|
698
|
-
var validationResult = this.ValidateTag(element);
|
|
699
|
-
if (!validationResult.isSucceeded) {
|
|
700
|
-
return validationResult;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
return {
|
|
704
|
-
isSucceeded: true,
|
|
705
|
-
message: `Ok`
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
static ValidateTag(element) {
|
|
709
|
-
let lowerTag = element.tagName.toLowerCase();
|
|
710
|
-
if (!this.supportedTags.includes(lowerTag)) {
|
|
711
|
-
return {
|
|
712
|
-
isSucceeded: false,
|
|
713
|
-
message: `Тег <${lowerTag}> не поддерживается внутри тега <text>`
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
for (let i = 0; i < element.children.length; i++) {
|
|
717
|
-
const nElement = element.children.item(i);
|
|
718
|
-
var innerValidationResult = this.ValidateTag(nElement);
|
|
719
|
-
if (!innerValidationResult.isSucceeded) {
|
|
720
|
-
return innerValidationResult;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
return {
|
|
724
|
-
isSucceeded: true,
|
|
725
|
-
message: "Ok"
|
|
726
|
-
};
|
|
727
|
-
}
|
|
653
|
+
const TextTag = "text";
|
|
654
|
+
class TextSimpleMethods {
|
|
655
|
+
static { this.supportedTags = ["sup", "sub", "strong", "b", "i", "u"]; }
|
|
656
|
+
static ExtractTextTag(elem) {
|
|
657
|
+
var hAlignValue = elem.getAttribute("h-align") ?? "left";
|
|
658
|
+
var data = {
|
|
659
|
+
textTagName: elem.tagName.toLowerCase(),
|
|
660
|
+
text: elem.innerText.trim().replace('\n\t', ''),
|
|
661
|
+
html: elem.innerHTML.trim().replace('\n\t', ''),
|
|
662
|
+
horizontalAlignment: hAlignValue,
|
|
663
|
+
validationResult: {
|
|
664
|
+
isSucceeded: true,
|
|
665
|
+
message: "Ok"
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
let result = {
|
|
669
|
+
type: TextTag,
|
|
670
|
+
data: data
|
|
671
|
+
};
|
|
672
|
+
if (result.data.text === '\n') {
|
|
673
|
+
result.data.text = '';
|
|
674
|
+
}
|
|
675
|
+
if (result.data.html === '\n') {
|
|
676
|
+
result.data.html = '';
|
|
677
|
+
}
|
|
678
|
+
var alignmentVals = ["left", "right", "center"];
|
|
679
|
+
if (alignmentVals.indexOf(hAlignValue) < 0) {
|
|
680
|
+
result.data.validationResult = {
|
|
681
|
+
isSucceeded: false,
|
|
682
|
+
message: `Недопустимое значение атрибута h-align. Допустимые значения: ${alignmentVals.join(', ')}. `
|
|
683
|
+
+ 'Данный тег можно не указывать, по-умолчанию будет применено выравнивание слева.'
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
var html = result.data.html;
|
|
687
|
+
var htmlValidation = this.ValidateTextHtml(html);
|
|
688
|
+
if (!htmlValidation.isSucceeded) {
|
|
689
|
+
result.data.validationResult = htmlValidation;
|
|
690
|
+
}
|
|
691
|
+
return result;
|
|
692
|
+
}
|
|
693
|
+
static ValidateTextHtml(html) {
|
|
694
|
+
var p = document.createElement("p");
|
|
695
|
+
p.innerHTML = html;
|
|
696
|
+
for (let i = 0; i < p.children.length; i++) {
|
|
697
|
+
const element = p.children.item(i);
|
|
698
|
+
var validationResult = this.ValidateTag(element);
|
|
699
|
+
if (!validationResult.isSucceeded) {
|
|
700
|
+
return validationResult;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
return {
|
|
704
|
+
isSucceeded: true,
|
|
705
|
+
message: `Ok`
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
static ValidateTag(element) {
|
|
709
|
+
let lowerTag = element.tagName.toLowerCase();
|
|
710
|
+
if (!this.supportedTags.includes(lowerTag)) {
|
|
711
|
+
return {
|
|
712
|
+
isSucceeded: false,
|
|
713
|
+
message: `Тег <${lowerTag}> не поддерживается внутри тега <text>`
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
for (let i = 0; i < element.children.length; i++) {
|
|
717
|
+
const nElement = element.children.item(i);
|
|
718
|
+
var innerValidationResult = this.ValidateTag(nElement);
|
|
719
|
+
if (!innerValidationResult.isSucceeded) {
|
|
720
|
+
return innerValidationResult;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return {
|
|
724
|
+
isSucceeded: true,
|
|
725
|
+
message: "Ok"
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
728
|
}
|
|
729
729
|
|
|
730
|
-
class BootstrapTableMethods {
|
|
731
|
-
static BuildTable(data) {
|
|
732
|
-
let result = `<table class="table table-bordered">`;
|
|
733
|
-
result += this.BuildHeader(data.header);
|
|
734
|
-
result += this.BuildBody(data.rows);
|
|
735
|
-
result += "</table>";
|
|
736
|
-
return result;
|
|
737
|
-
}
|
|
738
|
-
static BuildHeader(data) {
|
|
739
|
-
if (data === null) {
|
|
740
|
-
return "";
|
|
741
|
-
}
|
|
742
|
-
let result = "<thead>";
|
|
743
|
-
result += "<tr>";
|
|
744
|
-
for (let index = 0; index < data.columns.length; index++) {
|
|
745
|
-
result += `<th>${data.columns[index]}</th>`;
|
|
746
|
-
}
|
|
747
|
-
result += "</tr>";
|
|
748
|
-
result += "</thead>";
|
|
749
|
-
return result;
|
|
750
|
-
}
|
|
751
|
-
static BuildBody(rows) {
|
|
752
|
-
let result = "<tbody>";
|
|
753
|
-
for (let i = 0; i < rows.length; i++) {
|
|
754
|
-
const row = rows[i];
|
|
755
|
-
result += "<tr>";
|
|
756
|
-
for (let j = 0; j < row.columns.length; j++) {
|
|
757
|
-
const col = row.columns[j];
|
|
758
|
-
result += `<td class="align-middle">${this.BuildInnerTags(col.data.children)}</td>`;
|
|
759
|
-
}
|
|
760
|
-
result += "</tr>";
|
|
761
|
-
}
|
|
762
|
-
result += "</tbody>";
|
|
763
|
-
return result;
|
|
764
|
-
}
|
|
765
|
-
static BuildInnerTags(tags) {
|
|
766
|
-
let result = "";
|
|
767
|
-
for (let i = 0; i < tags.length; i++) {
|
|
768
|
-
result += this.BuildInnerTag(tags[i]);
|
|
769
|
-
}
|
|
770
|
-
return result;
|
|
771
|
-
}
|
|
772
|
-
static BuildInnerTag(data) {
|
|
773
|
-
if (data.type === FileImageTagDataConsts.TagName) {
|
|
774
|
-
let fileImageTag = data;
|
|
775
|
-
return `<img src=${fileImageTag.data.src} class="mx-auto d-block img-fluid" />`;
|
|
776
|
-
}
|
|
777
|
-
else if (data.type === TextTag) {
|
|
778
|
-
let simpleTextTag = data;
|
|
779
|
-
var map = {
|
|
780
|
-
["left"]: "text-start",
|
|
781
|
-
["center"]: "text-center",
|
|
782
|
-
["right"]: "text-end"
|
|
783
|
-
};
|
|
784
|
-
if (!simpleTextTag.data.validationResult.isSucceeded) {
|
|
785
|
-
return `<span>Ошибка в тексте ${simpleTextTag.data.validationResult.message}</span>`;
|
|
786
|
-
}
|
|
787
|
-
return `<div class="${map[simpleTextTag.data.horizontalAlignment]}"><span>${simpleTextTag.data.html}</span></div>`;
|
|
788
|
-
}
|
|
789
|
-
else {
|
|
790
|
-
return `<p>Тег ${data.type} не поддерживается</p>`;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
730
|
+
class BootstrapTableMethods {
|
|
731
|
+
static BuildTable(data) {
|
|
732
|
+
let result = `<table class="table table-bordered">`;
|
|
733
|
+
result += this.BuildHeader(data.header);
|
|
734
|
+
result += this.BuildBody(data.rows);
|
|
735
|
+
result += "</table>";
|
|
736
|
+
return result;
|
|
737
|
+
}
|
|
738
|
+
static BuildHeader(data) {
|
|
739
|
+
if (data === null) {
|
|
740
|
+
return "";
|
|
741
|
+
}
|
|
742
|
+
let result = "<thead>";
|
|
743
|
+
result += "<tr>";
|
|
744
|
+
for (let index = 0; index < data.columns.length; index++) {
|
|
745
|
+
result += `<th>${data.columns[index]}</th>`;
|
|
746
|
+
}
|
|
747
|
+
result += "</tr>";
|
|
748
|
+
result += "</thead>";
|
|
749
|
+
return result;
|
|
750
|
+
}
|
|
751
|
+
static BuildBody(rows) {
|
|
752
|
+
let result = "<tbody>";
|
|
753
|
+
for (let i = 0; i < rows.length; i++) {
|
|
754
|
+
const row = rows[i];
|
|
755
|
+
result += "<tr>";
|
|
756
|
+
for (let j = 0; j < row.columns.length; j++) {
|
|
757
|
+
const col = row.columns[j];
|
|
758
|
+
result += `<td class="align-middle">${this.BuildInnerTags(col.data.children)}</td>`;
|
|
759
|
+
}
|
|
760
|
+
result += "</tr>";
|
|
761
|
+
}
|
|
762
|
+
result += "</tbody>";
|
|
763
|
+
return result;
|
|
764
|
+
}
|
|
765
|
+
static BuildInnerTags(tags) {
|
|
766
|
+
let result = "";
|
|
767
|
+
for (let i = 0; i < tags.length; i++) {
|
|
768
|
+
result += this.BuildInnerTag(tags[i]);
|
|
769
|
+
}
|
|
770
|
+
return result;
|
|
771
|
+
}
|
|
772
|
+
static BuildInnerTag(data) {
|
|
773
|
+
if (data.type === FileImageTagDataConsts.TagName) {
|
|
774
|
+
let fileImageTag = data;
|
|
775
|
+
return `<img src=${fileImageTag.data.src} class="mx-auto d-block img-fluid" />`;
|
|
776
|
+
}
|
|
777
|
+
else if (data.type === TextTag) {
|
|
778
|
+
let simpleTextTag = data;
|
|
779
|
+
var map = {
|
|
780
|
+
["left"]: "text-start",
|
|
781
|
+
["center"]: "text-center",
|
|
782
|
+
["right"]: "text-end"
|
|
783
|
+
};
|
|
784
|
+
if (!simpleTextTag.data.validationResult.isSucceeded) {
|
|
785
|
+
return `<span>Ошибка в тексте ${simpleTextTag.data.validationResult.message}</span>`;
|
|
786
|
+
}
|
|
787
|
+
return `<div class="${map[simpleTextTag.data.horizontalAlignment]}"><span>${simpleTextTag.data.html}</span></div>`;
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
return `<p>Тег ${data.type} не поддерживается</p>`;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
class TableTypes {
|
|
796
|
-
static { this.TableRowColumnData = "table-row-column-data"; }
|
|
797
|
-
static { this.Table = "table"; }
|
|
798
|
-
static { this.TableRowColumn = "table-row-column"; }
|
|
799
|
-
}
|
|
800
|
-
class TableMethods {
|
|
801
|
-
static getTableFromHtmlTag(tableTag, options) {
|
|
802
|
-
let tableData = {
|
|
803
|
-
header: TableMethods.getHeader(tableTag),
|
|
804
|
-
rows: TableMethods.getTableRows(tableTag, options)
|
|
805
|
-
};
|
|
806
|
-
var result = {
|
|
807
|
-
type: TableTypes.Table,
|
|
808
|
-
data: tableData,
|
|
809
|
-
validationResult: this.checkTable(tableData),
|
|
810
|
-
bootstrapHtml: ""
|
|
811
|
-
};
|
|
812
|
-
if (!result.validationResult) {
|
|
813
|
-
return result;
|
|
814
|
-
}
|
|
815
|
-
result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
|
|
816
|
-
var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
|
|
817
|
-
if (!angularMaterialTableDataCheck.isSucceeded) {
|
|
818
|
-
return {
|
|
819
|
-
...result,
|
|
820
|
-
angularMaterialTableDataCheck
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
return {
|
|
824
|
-
...result,
|
|
825
|
-
angularMaterialTableDataCheck,
|
|
826
|
-
html: tableTag.outerHTML,
|
|
827
|
-
angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows),
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
static checkTable(tableData) {
|
|
831
|
-
let rows = tableData.rows;
|
|
832
|
-
let prevRowCount = -1;
|
|
833
|
-
for (let i = 0; i < rows.length; i++) {
|
|
834
|
-
const row = rows[i];
|
|
835
|
-
if (row.columns.length !== prevRowCount && prevRowCount != -1) {
|
|
836
|
-
return {
|
|
837
|
-
isSucceeded: false,
|
|
838
|
-
message: `Ошибка при обработке разметки таблицы. `
|
|
839
|
-
+ `Количество колонок в каждой строке таблицы должно соотвествовать друг другу. `
|
|
840
|
-
+ `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а в строке выше ${prevRowCount}.`
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
prevRowCount = row.columns.length;
|
|
844
|
-
}
|
|
845
|
-
return {
|
|
846
|
-
isSucceeded: true,
|
|
847
|
-
message: "Ok"
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
static getHeader(tableTag) {
|
|
851
|
-
let header = tableTag.tHead;
|
|
852
|
-
if (header === null) {
|
|
853
|
-
return null;
|
|
854
|
-
}
|
|
855
|
-
let tr = header.children.item(0);
|
|
856
|
-
let headerColumns = [];
|
|
857
|
-
for (let j = 0; j < tr.children.length; j++) {
|
|
858
|
-
const jElement = tr.children.item(j);
|
|
859
|
-
headerColumns.push(jElement.innerHTML);
|
|
860
|
-
}
|
|
861
|
-
return {
|
|
862
|
-
type: "table-header",
|
|
863
|
-
columns: headerColumns
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
static getTableRows(tableTag, options) {
|
|
867
|
-
let tBody = tableTag.tBodies.item(0);
|
|
868
|
-
let rows = [];
|
|
869
|
-
for (let i = 0; i < tBody.children.length; i++) {
|
|
870
|
-
const iElement = tBody.children.item(i);
|
|
871
|
-
let rowColumns = [];
|
|
872
|
-
for (let j = 0; j < iElement.children.length; j++) {
|
|
873
|
-
const jElement = iElement.children.item(j);
|
|
874
|
-
let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement, options);
|
|
875
|
-
if (children.length === 0) {
|
|
876
|
-
var textTag = document.createElement("p");
|
|
877
|
-
textTag.innerHTML = jElement.innerHTML;
|
|
878
|
-
var textElem = TextSimpleMethods.ExtractTextTag(textTag);
|
|
879
|
-
children.push(textElem);
|
|
880
|
-
}
|
|
881
|
-
var result = {
|
|
882
|
-
type: TableTypes.TableRowColumnData,
|
|
883
|
-
data: {
|
|
884
|
-
text: jElement.innerHTML,
|
|
885
|
-
children
|
|
886
|
-
}
|
|
887
|
-
};
|
|
888
|
-
rowColumns.push(result);
|
|
889
|
-
}
|
|
890
|
-
rows.push({
|
|
891
|
-
type: TableTypes.TableRowColumn,
|
|
892
|
-
columns: rowColumns
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
return rows;
|
|
896
|
-
}
|
|
795
|
+
class TableTypes {
|
|
796
|
+
static { this.TableRowColumnData = "table-row-column-data"; }
|
|
797
|
+
static { this.Table = "table"; }
|
|
798
|
+
static { this.TableRowColumn = "table-row-column"; }
|
|
799
|
+
}
|
|
800
|
+
class TableMethods {
|
|
801
|
+
static getTableFromHtmlTag(tableTag, options) {
|
|
802
|
+
let tableData = {
|
|
803
|
+
header: TableMethods.getHeader(tableTag),
|
|
804
|
+
rows: TableMethods.getTableRows(tableTag, options)
|
|
805
|
+
};
|
|
806
|
+
var result = {
|
|
807
|
+
type: TableTypes.Table,
|
|
808
|
+
data: tableData,
|
|
809
|
+
validationResult: this.checkTable(tableData),
|
|
810
|
+
bootstrapHtml: ""
|
|
811
|
+
};
|
|
812
|
+
if (!result.validationResult) {
|
|
813
|
+
return result;
|
|
814
|
+
}
|
|
815
|
+
result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
|
|
816
|
+
var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
|
|
817
|
+
if (!angularMaterialTableDataCheck.isSucceeded) {
|
|
818
|
+
return {
|
|
819
|
+
...result,
|
|
820
|
+
angularMaterialTableDataCheck
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
return {
|
|
824
|
+
...result,
|
|
825
|
+
angularMaterialTableDataCheck,
|
|
826
|
+
html: tableTag.outerHTML,
|
|
827
|
+
angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows),
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
static checkTable(tableData) {
|
|
831
|
+
let rows = tableData.rows;
|
|
832
|
+
let prevRowCount = -1;
|
|
833
|
+
for (let i = 0; i < rows.length; i++) {
|
|
834
|
+
const row = rows[i];
|
|
835
|
+
if (row.columns.length !== prevRowCount && prevRowCount != -1) {
|
|
836
|
+
return {
|
|
837
|
+
isSucceeded: false,
|
|
838
|
+
message: `Ошибка при обработке разметки таблицы. `
|
|
839
|
+
+ `Количество колонок в каждой строке таблицы должно соотвествовать друг другу. `
|
|
840
|
+
+ `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а в строке выше ${prevRowCount}.`
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
prevRowCount = row.columns.length;
|
|
844
|
+
}
|
|
845
|
+
return {
|
|
846
|
+
isSucceeded: true,
|
|
847
|
+
message: "Ok"
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
static getHeader(tableTag) {
|
|
851
|
+
let header = tableTag.tHead;
|
|
852
|
+
if (header === null) {
|
|
853
|
+
return null;
|
|
854
|
+
}
|
|
855
|
+
let tr = header.children.item(0);
|
|
856
|
+
let headerColumns = [];
|
|
857
|
+
for (let j = 0; j < tr.children.length; j++) {
|
|
858
|
+
const jElement = tr.children.item(j);
|
|
859
|
+
headerColumns.push(jElement.innerHTML);
|
|
860
|
+
}
|
|
861
|
+
return {
|
|
862
|
+
type: "table-header",
|
|
863
|
+
columns: headerColumns
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
static getTableRows(tableTag, options) {
|
|
867
|
+
let tBody = tableTag.tBodies.item(0);
|
|
868
|
+
let rows = [];
|
|
869
|
+
for (let i = 0; i < tBody.children.length; i++) {
|
|
870
|
+
const iElement = tBody.children.item(i);
|
|
871
|
+
let rowColumns = [];
|
|
872
|
+
for (let j = 0; j < iElement.children.length; j++) {
|
|
873
|
+
const jElement = iElement.children.item(j);
|
|
874
|
+
let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement, options);
|
|
875
|
+
if (children.length === 0) {
|
|
876
|
+
var textTag = document.createElement("p");
|
|
877
|
+
textTag.innerHTML = jElement.innerHTML;
|
|
878
|
+
var textElem = TextSimpleMethods.ExtractTextTag(textTag);
|
|
879
|
+
children.push(textElem);
|
|
880
|
+
}
|
|
881
|
+
var result = {
|
|
882
|
+
type: TableTypes.TableRowColumnData,
|
|
883
|
+
data: {
|
|
884
|
+
text: jElement.innerHTML,
|
|
885
|
+
children
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
rowColumns.push(result);
|
|
889
|
+
}
|
|
890
|
+
rows.push({
|
|
891
|
+
type: TableTypes.TableRowColumn,
|
|
892
|
+
columns: rowColumns
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
return rows;
|
|
896
|
+
}
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
class TextMethods {
|
|
900
|
-
static { this.textTags = ["text", "h1", "h2", "h3", "h4", "h5", "h6"]; }
|
|
901
|
-
static ExtractRichTextData(elem) {
|
|
902
|
-
let children = [];
|
|
903
|
-
for (let i = 0; i < elem.children.length; i++) {
|
|
904
|
-
const child = elem.children.item(i);
|
|
905
|
-
if (child.tagName === "text-block".toUpperCase()) {
|
|
906
|
-
children.push({
|
|
907
|
-
type: "text-block",
|
|
908
|
-
data: {
|
|
909
|
-
text: child.innerHTML
|
|
910
|
-
}
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
else if (child.tagName === "line-break".toUpperCase()) {
|
|
914
|
-
children.push({
|
|
915
|
-
type: "line-break"
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return {
|
|
920
|
-
type: "rich-text",
|
|
921
|
-
data: {
|
|
922
|
-
children
|
|
923
|
-
}
|
|
924
|
-
};
|
|
925
|
-
}
|
|
899
|
+
class TextMethods {
|
|
900
|
+
static { this.textTags = ["text", "h1", "h2", "h3", "h4", "h5", "h6"]; }
|
|
901
|
+
static ExtractRichTextData(elem) {
|
|
902
|
+
let children = [];
|
|
903
|
+
for (let i = 0; i < elem.children.length; i++) {
|
|
904
|
+
const child = elem.children.item(i);
|
|
905
|
+
if (child.tagName === "text-block".toUpperCase()) {
|
|
906
|
+
children.push({
|
|
907
|
+
type: "text-block",
|
|
908
|
+
data: {
|
|
909
|
+
text: child.innerHTML
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
else if (child.tagName === "line-break".toUpperCase()) {
|
|
914
|
+
children.push({
|
|
915
|
+
type: "line-break"
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return {
|
|
920
|
+
type: "rich-text",
|
|
921
|
+
data: {
|
|
922
|
+
children
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
926
|
}
|
|
927
927
|
|
|
928
|
-
class HtmlExtractionMethods {
|
|
929
|
-
static ExtractHeaderTag(elem, tagName) {
|
|
930
|
-
var data = TextSimpleMethods.ExtractTextTag(elem);
|
|
931
|
-
data.type = tagName;
|
|
932
|
-
return data;
|
|
933
|
-
}
|
|
934
|
-
static { this.Extractors = {
|
|
935
|
-
["TEXT"]: (elem, options) => TextSimpleMethods.ExtractTextTag(elem),
|
|
936
|
-
["FILE-IMAGE"]: (elem, options) => ImageMethods.ExtractImage(elem, options),
|
|
937
|
-
["TABLE"]: (elem, options) => TableMethods.getTableFromHtmlTag(elem, options),
|
|
938
|
-
["RICH-TEXT"]: (elem, options) => TextMethods.ExtractRichTextData(elem),
|
|
939
|
-
["HTML-RAW"]: (elem, options) => ({
|
|
940
|
-
type: "html-raw",
|
|
941
|
-
data: {
|
|
942
|
-
innerHTML: elem.innerHTML
|
|
943
|
-
}
|
|
944
|
-
}),
|
|
945
|
-
["H1"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
|
|
946
|
-
["H2"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
|
|
947
|
-
["H3"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
|
|
948
|
-
["H4"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
|
|
949
|
-
["H5"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
|
|
950
|
-
["H6"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
|
|
951
|
-
[ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem, options) => VideoMethods.ExtractExternalVideoTag(elem)
|
|
952
|
-
}; }
|
|
953
|
-
static transformHtmlElementToBlocks(element, options) {
|
|
954
|
-
var data = [];
|
|
955
|
-
for (let i = 0; i < element.children.length; i++) {
|
|
956
|
-
var elem = element.children.item(i);
|
|
957
|
-
if (!HtmlExtractionMethods.Extractors.hasOwnProperty(elem.tagName)) {
|
|
958
|
-
data.push({
|
|
959
|
-
type: "unsupported-tag",
|
|
960
|
-
data: {
|
|
961
|
-
tagString: elem.outerHTML
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
else {
|
|
966
|
-
var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
|
|
967
|
-
var result = extractor(elem, options);
|
|
968
|
-
data.push(result);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
return data;
|
|
972
|
-
}
|
|
973
|
-
static transformHtmlStringToBlocks(value, options) {
|
|
974
|
-
if (value === undefined || value === null) {
|
|
975
|
-
return [];
|
|
976
|
-
}
|
|
977
|
-
value = value
|
|
978
|
-
.replace('\n', '')
|
|
979
|
-
.replace('\t', '');
|
|
980
|
-
var div = document.createElement("div");
|
|
981
|
-
div.innerHTML = value;
|
|
982
|
-
return this.transformHtmlElementToBlocks(div, options);
|
|
983
|
-
}
|
|
928
|
+
class HtmlExtractionMethods {
|
|
929
|
+
static ExtractHeaderTag(elem, tagName) {
|
|
930
|
+
var data = TextSimpleMethods.ExtractTextTag(elem);
|
|
931
|
+
data.type = tagName;
|
|
932
|
+
return data;
|
|
933
|
+
}
|
|
934
|
+
static { this.Extractors = {
|
|
935
|
+
["TEXT"]: (elem, options) => TextSimpleMethods.ExtractTextTag(elem),
|
|
936
|
+
["FILE-IMAGE"]: (elem, options) => ImageMethods.ExtractImage(elem, options),
|
|
937
|
+
["TABLE"]: (elem, options) => TableMethods.getTableFromHtmlTag(elem, options),
|
|
938
|
+
["RICH-TEXT"]: (elem, options) => TextMethods.ExtractRichTextData(elem),
|
|
939
|
+
["HTML-RAW"]: (elem, options) => ({
|
|
940
|
+
type: "html-raw",
|
|
941
|
+
data: {
|
|
942
|
+
innerHTML: elem.innerHTML
|
|
943
|
+
}
|
|
944
|
+
}),
|
|
945
|
+
["H1"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
|
|
946
|
+
["H2"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
|
|
947
|
+
["H3"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
|
|
948
|
+
["H4"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
|
|
949
|
+
["H5"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
|
|
950
|
+
["H6"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
|
|
951
|
+
[ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem, options) => VideoMethods.ExtractExternalVideoTag(elem)
|
|
952
|
+
}; }
|
|
953
|
+
static transformHtmlElementToBlocks(element, options) {
|
|
954
|
+
var data = [];
|
|
955
|
+
for (let i = 0; i < element.children.length; i++) {
|
|
956
|
+
var elem = element.children.item(i);
|
|
957
|
+
if (!HtmlExtractionMethods.Extractors.hasOwnProperty(elem.tagName)) {
|
|
958
|
+
data.push({
|
|
959
|
+
type: "unsupported-tag",
|
|
960
|
+
data: {
|
|
961
|
+
tagString: elem.outerHTML
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
|
|
967
|
+
var result = extractor(elem, options);
|
|
968
|
+
data.push(result);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
return data;
|
|
972
|
+
}
|
|
973
|
+
static transformHtmlStringToBlocks(value, options) {
|
|
974
|
+
if (value === undefined || value === null) {
|
|
975
|
+
return [];
|
|
976
|
+
}
|
|
977
|
+
value = value
|
|
978
|
+
.replace('\n', '')
|
|
979
|
+
.replace('\t', '');
|
|
980
|
+
var div = document.createElement("div");
|
|
981
|
+
div.innerHTML = value;
|
|
982
|
+
return this.transformHtmlElementToBlocks(div, options);
|
|
983
|
+
}
|
|
984
984
|
}
|
|
985
985
|
|
|
986
|
-
class HtmlRawTagDataConsts {
|
|
987
|
-
static { this.TagName = "html-raw"; }
|
|
986
|
+
class HtmlRawTagDataConsts {
|
|
987
|
+
static { this.TagName = "html-raw"; }
|
|
988
988
|
}
|
|
989
989
|
|
|
990
|
-
class BodyTagsExtensions {
|
|
991
|
-
static getDescription(tagName) {
|
|
992
|
-
var descriptions = {
|
|
993
|
-
"text": "Текст",
|
|
994
|
-
"h1": "Заголовок 1 уровня",
|
|
995
|
-
"h2": "Заголовок 2 уровня",
|
|
996
|
-
"h3": "Заголовок 3 уровня",
|
|
997
|
-
"h4": "Заголовок 4 уровня",
|
|
998
|
-
"h5": "Заголовок 5 уровня",
|
|
999
|
-
"h6": "Заголовок 6 уровня",
|
|
1000
|
-
[FileImageTagDataConsts.TagName]: "Изображение",
|
|
1001
|
-
[ExternalVideoTagDataConsts.TagName]: "Внешнее видео YouTube",
|
|
1002
|
-
[HtmlRawTagDataConsts.TagName]: "Html разметка"
|
|
1003
|
-
};
|
|
1004
|
-
return descriptions[tagName];
|
|
1005
|
-
}
|
|
1006
|
-
static toHtml(bodyTags) {
|
|
1007
|
-
let htmls = bodyTags.map(x => {
|
|
1008
|
-
if (TextMethods.textTags.includes(x.tagDescription.tag)) {
|
|
1009
|
-
return `<${x.tagDescription.tag} h-align="${x.attributes['h-align']}">${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1010
|
-
}
|
|
1011
|
-
if (x.tagDescription.tag === ExternalVideoTagDataConsts.TagName) {
|
|
1012
|
-
return `<${x.tagDescription.tag} type="${x.attributes['type']}" link="${x.attributes['link']}">${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1013
|
-
}
|
|
1014
|
-
if (x.tagDescription.tag === "html-raw") {
|
|
1015
|
-
return `<${x.tagDescription.tag}>${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1016
|
-
}
|
|
1017
|
-
return BodyTagsExtensions.imageTagToHtml(x);
|
|
1018
|
-
});
|
|
1019
|
-
let result = "";
|
|
1020
|
-
for (let index = 0; index < htmls.length; index++) {
|
|
1021
|
-
const element = htmls[index];
|
|
1022
|
-
result += element;
|
|
1023
|
-
}
|
|
1024
|
-
return result;
|
|
1025
|
-
}
|
|
1026
|
-
static imageTagToHtml(imageTag) {
|
|
1027
|
-
var attrStr = "";
|
|
1028
|
-
var attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
|
|
1029
|
-
if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
|
|
1030
|
-
attrStr = `${FileImageTagDataConsts.FileIdAttrName}="${attrValue}"`;
|
|
1031
|
-
}
|
|
1032
|
-
return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
|
|
1033
|
-
}
|
|
1034
|
-
static getBodyTags(html, options) {
|
|
1035
|
-
let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
|
|
1036
|
-
return result.map(x => BodyTagsExtensions.toBodyTag(x));
|
|
1037
|
-
}
|
|
1038
|
-
static sanitizeInnerHtml(html) {
|
|
1039
|
-
return html.trim().replace('\n\t', '');
|
|
1040
|
-
}
|
|
1041
|
-
static toBodyTag(data) {
|
|
1042
|
-
if (TextMethods.textTags.includes(data.type)) {
|
|
1043
|
-
let textTagData = data.data;
|
|
1044
|
-
return {
|
|
1045
|
-
presentOrEdit: true,
|
|
1046
|
-
tagDescription: {
|
|
1047
|
-
tag: textTagData.textTagName,
|
|
1048
|
-
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1049
|
-
},
|
|
1050
|
-
attributes: { "h-align": textTagData.horizontalAlignment },
|
|
1051
|
-
innerHtml: BodyTagsExtensions.sanitizeInnerHtml(textTagData.html)
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
if (data.type === FileImageTagDataConsts.TagName) {
|
|
1055
|
-
let fileData = data.data;
|
|
1056
|
-
let atts = {};
|
|
1057
|
-
if (fileData.fileId) {
|
|
1058
|
-
atts[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
|
|
1059
|
-
}
|
|
1060
|
-
return {
|
|
1061
|
-
presentOrEdit: true,
|
|
1062
|
-
tagDescription: {
|
|
1063
|
-
tag: FileImageTagDataConsts.TagName,
|
|
1064
|
-
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1065
|
-
},
|
|
1066
|
-
attributes: atts,
|
|
1067
|
-
innerHtml: ""
|
|
1068
|
-
};
|
|
1069
|
-
}
|
|
1070
|
-
if (data.type === ExternalVideoTagDataConsts.TagName) {
|
|
1071
|
-
let fileData = data.data;
|
|
1072
|
-
return {
|
|
1073
|
-
presentOrEdit: true,
|
|
1074
|
-
tagDescription: {
|
|
1075
|
-
tag: ExternalVideoTagDataConsts.TagName,
|
|
1076
|
-
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1077
|
-
},
|
|
1078
|
-
attributes: fileData,
|
|
1079
|
-
innerHtml: ""
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
if (data.type === HtmlRawTagDataConsts.TagName) {
|
|
1083
|
-
return {
|
|
1084
|
-
presentOrEdit: true,
|
|
1085
|
-
tagDescription: {
|
|
1086
|
-
tag: HtmlRawTagDataConsts.TagName,
|
|
1087
|
-
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1088
|
-
},
|
|
1089
|
-
attributes: {},
|
|
1090
|
-
innerHtml: BodyTagsExtensions.sanitizeInnerHtml(data.data["innerHTML"])
|
|
1091
|
-
};
|
|
1092
|
-
}
|
|
1093
|
-
return {
|
|
1094
|
-
presentOrEdit: true,
|
|
1095
|
-
tagDescription: {
|
|
1096
|
-
tag: "unsupported-tag",
|
|
1097
|
-
displayValue: "Неподдерживаемый тег"
|
|
1098
|
-
},
|
|
1099
|
-
attributes: {},
|
|
1100
|
-
innerHtml: JSON.stringify(data)
|
|
1101
|
-
};
|
|
1102
|
-
}
|
|
990
|
+
class BodyTagsExtensions {
|
|
991
|
+
static getDescription(tagName) {
|
|
992
|
+
var descriptions = {
|
|
993
|
+
"text": "Текст",
|
|
994
|
+
"h1": "Заголовок 1 уровня",
|
|
995
|
+
"h2": "Заголовок 2 уровня",
|
|
996
|
+
"h3": "Заголовок 3 уровня",
|
|
997
|
+
"h4": "Заголовок 4 уровня",
|
|
998
|
+
"h5": "Заголовок 5 уровня",
|
|
999
|
+
"h6": "Заголовок 6 уровня",
|
|
1000
|
+
[FileImageTagDataConsts.TagName]: "Изображение",
|
|
1001
|
+
[ExternalVideoTagDataConsts.TagName]: "Внешнее видео YouTube",
|
|
1002
|
+
[HtmlRawTagDataConsts.TagName]: "Html разметка"
|
|
1003
|
+
};
|
|
1004
|
+
return descriptions[tagName];
|
|
1005
|
+
}
|
|
1006
|
+
static toHtml(bodyTags) {
|
|
1007
|
+
let htmls = bodyTags.map(x => {
|
|
1008
|
+
if (TextMethods.textTags.includes(x.tagDescription.tag)) {
|
|
1009
|
+
return `<${x.tagDescription.tag} h-align="${x.attributes['h-align']}">${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1010
|
+
}
|
|
1011
|
+
if (x.tagDescription.tag === ExternalVideoTagDataConsts.TagName) {
|
|
1012
|
+
return `<${x.tagDescription.tag} type="${x.attributes['type']}" link="${x.attributes['link']}">${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1013
|
+
}
|
|
1014
|
+
if (x.tagDescription.tag === "html-raw") {
|
|
1015
|
+
return `<${x.tagDescription.tag}>${x.innerHtml}</${x.tagDescription.tag}>`;
|
|
1016
|
+
}
|
|
1017
|
+
return BodyTagsExtensions.imageTagToHtml(x);
|
|
1018
|
+
});
|
|
1019
|
+
let result = "";
|
|
1020
|
+
for (let index = 0; index < htmls.length; index++) {
|
|
1021
|
+
const element = htmls[index];
|
|
1022
|
+
result += element;
|
|
1023
|
+
}
|
|
1024
|
+
return result;
|
|
1025
|
+
}
|
|
1026
|
+
static imageTagToHtml(imageTag) {
|
|
1027
|
+
var attrStr = "";
|
|
1028
|
+
var attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
|
|
1029
|
+
if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
|
|
1030
|
+
attrStr = `${FileImageTagDataConsts.FileIdAttrName}="${attrValue}"`;
|
|
1031
|
+
}
|
|
1032
|
+
return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
|
|
1033
|
+
}
|
|
1034
|
+
static getBodyTags(html, options) {
|
|
1035
|
+
let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
|
|
1036
|
+
return result.map(x => BodyTagsExtensions.toBodyTag(x));
|
|
1037
|
+
}
|
|
1038
|
+
static sanitizeInnerHtml(html) {
|
|
1039
|
+
return html.trim().replace('\n\t', '');
|
|
1040
|
+
}
|
|
1041
|
+
static toBodyTag(data) {
|
|
1042
|
+
if (TextMethods.textTags.includes(data.type)) {
|
|
1043
|
+
let textTagData = data.data;
|
|
1044
|
+
return {
|
|
1045
|
+
presentOrEdit: true,
|
|
1046
|
+
tagDescription: {
|
|
1047
|
+
tag: textTagData.textTagName,
|
|
1048
|
+
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1049
|
+
},
|
|
1050
|
+
attributes: { "h-align": textTagData.horizontalAlignment },
|
|
1051
|
+
innerHtml: BodyTagsExtensions.sanitizeInnerHtml(textTagData.html)
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
if (data.type === FileImageTagDataConsts.TagName) {
|
|
1055
|
+
let fileData = data.data;
|
|
1056
|
+
let atts = {};
|
|
1057
|
+
if (fileData.fileId) {
|
|
1058
|
+
atts[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
|
|
1059
|
+
}
|
|
1060
|
+
return {
|
|
1061
|
+
presentOrEdit: true,
|
|
1062
|
+
tagDescription: {
|
|
1063
|
+
tag: FileImageTagDataConsts.TagName,
|
|
1064
|
+
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1065
|
+
},
|
|
1066
|
+
attributes: atts,
|
|
1067
|
+
innerHtml: ""
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
if (data.type === ExternalVideoTagDataConsts.TagName) {
|
|
1071
|
+
let fileData = data.data;
|
|
1072
|
+
return {
|
|
1073
|
+
presentOrEdit: true,
|
|
1074
|
+
tagDescription: {
|
|
1075
|
+
tag: ExternalVideoTagDataConsts.TagName,
|
|
1076
|
+
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1077
|
+
},
|
|
1078
|
+
attributes: fileData,
|
|
1079
|
+
innerHtml: ""
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
if (data.type === HtmlRawTagDataConsts.TagName) {
|
|
1083
|
+
return {
|
|
1084
|
+
presentOrEdit: true,
|
|
1085
|
+
tagDescription: {
|
|
1086
|
+
tag: HtmlRawTagDataConsts.TagName,
|
|
1087
|
+
displayValue: BodyTagsExtensions.getDescription(data.type)
|
|
1088
|
+
},
|
|
1089
|
+
attributes: {},
|
|
1090
|
+
innerHtml: BodyTagsExtensions.sanitizeInnerHtml(data.data["innerHTML"])
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
return {
|
|
1094
|
+
presentOrEdit: true,
|
|
1095
|
+
tagDescription: {
|
|
1096
|
+
tag: "unsupported-tag",
|
|
1097
|
+
displayValue: "Неподдерживаемый тег"
|
|
1098
|
+
},
|
|
1099
|
+
attributes: {},
|
|
1100
|
+
innerHtml: JSON.stringify(data)
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
|
-
class XmlExtensions {
|
|
1106
|
-
static formatXml(xml, tab = '\t') {
|
|
1107
|
-
var formatted = '', indent = '';
|
|
1108
|
-
tab = tab || '\t';
|
|
1109
|
-
xml.split(/>\s*</).forEach(function (node) {
|
|
1110
|
-
if (node.match(/^\/\w/))
|
|
1111
|
-
indent = indent.substring(tab.length); // decrease indent by one 'tab'
|
|
1112
|
-
formatted += indent + '<' + node + '>\r\n';
|
|
1113
|
-
if (node.match(/^<?\w[^>]*[^\/]$/))
|
|
1114
|
-
indent += tab; // increase indent
|
|
1115
|
-
});
|
|
1116
|
-
return formatted.substring(1, formatted.length - 3);
|
|
1117
|
-
}
|
|
1118
|
-
static tagsToLower(xml) {
|
|
1119
|
-
xml = this.replaceTagToLower(xml, "Body");
|
|
1120
|
-
xml = this.replaceTagToLower(xml, "Image");
|
|
1121
|
-
xml = this.replaceTagToLower(xml, "Text");
|
|
1122
|
-
return xml;
|
|
1123
|
-
}
|
|
1124
|
-
static replaceTagToLower(xml, tag) {
|
|
1125
|
-
return xml
|
|
1126
|
-
.replace(new RegExp(`<${tag}`, 'g'), `<${tag.toLowerCase()}`)
|
|
1127
|
-
.replace(new RegExp(`</${tag}>`, 'g'), `</${tag.toLowerCase()}>`);
|
|
1128
|
-
}
|
|
1105
|
+
class XmlExtensions {
|
|
1106
|
+
static formatXml(xml, tab = '\t') {
|
|
1107
|
+
var formatted = '', indent = '';
|
|
1108
|
+
tab = tab || '\t';
|
|
1109
|
+
xml.split(/>\s*</).forEach(function (node) {
|
|
1110
|
+
if (node.match(/^\/\w/))
|
|
1111
|
+
indent = indent.substring(tab.length); // decrease indent by one 'tab'
|
|
1112
|
+
formatted += indent + '<' + node + '>\r\n';
|
|
1113
|
+
if (node.match(/^<?\w[^>]*[^\/]$/))
|
|
1114
|
+
indent += tab; // increase indent
|
|
1115
|
+
});
|
|
1116
|
+
return formatted.substring(1, formatted.length - 3);
|
|
1117
|
+
}
|
|
1118
|
+
static tagsToLower(xml) {
|
|
1119
|
+
xml = this.replaceTagToLower(xml, "Body");
|
|
1120
|
+
xml = this.replaceTagToLower(xml, "Image");
|
|
1121
|
+
xml = this.replaceTagToLower(xml, "Text");
|
|
1122
|
+
return xml;
|
|
1123
|
+
}
|
|
1124
|
+
static replaceTagToLower(xml, tag) {
|
|
1125
|
+
return xml
|
|
1126
|
+
.replace(new RegExp(`<${tag}`, 'g'), `<${tag.toLowerCase()}`)
|
|
1127
|
+
.replace(new RegExp(`</${tag}>`, 'g'), `</${tag.toLowerCase()}>`);
|
|
1128
|
+
}
|
|
1129
1129
|
}
|
|
1130
1130
|
|
|
1131
|
-
class DefaultTags {
|
|
1132
|
-
static { this.tags = [
|
|
1133
|
-
{ tag: FileImageTagDataConsts.TagName, displayValue: 'Изображение' },
|
|
1134
|
-
{ tag: ExternalVideoTagDataConsts.TagName, displayValue: 'Внешнее видео Youtube' },
|
|
1135
|
-
{ tag: 'text', displayValue: 'Текст' },
|
|
1136
|
-
{ tag: 'h1', displayValue: 'Заголовок 1 уровня' },
|
|
1137
|
-
{ tag: 'h2', displayValue: 'Заголовок 2 уровня' },
|
|
1138
|
-
{ tag: 'h3', displayValue: 'Заголовок 3 уровня' },
|
|
1139
|
-
{ tag: 'h4', displayValue: 'Заголовок 4 уровня' },
|
|
1140
|
-
{ tag: 'h5', displayValue: 'Заголовок 5 уровня' },
|
|
1141
|
-
{ tag: 'h6', displayValue: 'Заголовок 6 уровня' },
|
|
1142
|
-
]; }
|
|
1143
|
-
static { this.htmlRawTag = {
|
|
1144
|
-
tag: HtmlRawTagDataConsts.TagName, displayValue: 'Html разметка'
|
|
1145
|
-
}; }
|
|
1146
|
-
static getTags(useHtmlRaw) {
|
|
1147
|
-
var result = [...DefaultTags.tags];
|
|
1148
|
-
if (useHtmlRaw) {
|
|
1149
|
-
result.push(DefaultTags.htmlRawTag);
|
|
1150
|
-
}
|
|
1151
|
-
return result;
|
|
1152
|
-
}
|
|
1131
|
+
class DefaultTags {
|
|
1132
|
+
static { this.tags = [
|
|
1133
|
+
{ tag: FileImageTagDataConsts.TagName, displayValue: 'Изображение' },
|
|
1134
|
+
{ tag: ExternalVideoTagDataConsts.TagName, displayValue: 'Внешнее видео Youtube' },
|
|
1135
|
+
{ tag: 'text', displayValue: 'Текст' },
|
|
1136
|
+
{ tag: 'h1', displayValue: 'Заголовок 1 уровня' },
|
|
1137
|
+
{ tag: 'h2', displayValue: 'Заголовок 2 уровня' },
|
|
1138
|
+
{ tag: 'h3', displayValue: 'Заголовок 3 уровня' },
|
|
1139
|
+
{ tag: 'h4', displayValue: 'Заголовок 4 уровня' },
|
|
1140
|
+
{ tag: 'h5', displayValue: 'Заголовок 5 уровня' },
|
|
1141
|
+
{ tag: 'h6', displayValue: 'Заголовок 6 уровня' },
|
|
1142
|
+
]; }
|
|
1143
|
+
static { this.htmlRawTag = {
|
|
1144
|
+
tag: HtmlRawTagDataConsts.TagName, displayValue: 'Html разметка'
|
|
1145
|
+
}; }
|
|
1146
|
+
static getTags(useHtmlRaw) {
|
|
1147
|
+
var result = [...DefaultTags.tags];
|
|
1148
|
+
if (useHtmlRaw) {
|
|
1149
|
+
result.push(DefaultTags.htmlRawTag);
|
|
1150
|
+
}
|
|
1151
|
+
return result;
|
|
1152
|
+
}
|
|
1153
1153
|
}
|
|
1154
1154
|
|
|
1155
|
-
class TextEditorComponent {
|
|
1156
|
-
constructor() {
|
|
1157
|
-
this.onTagUpdated = new EventEmitter();
|
|
1158
|
-
}
|
|
1159
|
-
ngOnInit() {
|
|
1160
|
-
}
|
|
1161
|
-
getInnerHtml() {
|
|
1162
|
-
return `<${this.tag.tagDescription.tag}>${this.tag.innerHtml}<${this.tag.tagDescription.tag}/>`;
|
|
1163
|
-
}
|
|
1164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1165
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1166
|
-
}
|
|
1167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1168
|
-
type: Component,
|
|
1169
|
-
args: [{ selector: 'croco-html-text-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n\r\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"overflow-x: auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\r\n <mat-button-toggle value=\"center\">\r\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"left\">\r\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"right\">\r\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>" }]
|
|
1170
|
-
}], ctorParameters:
|
|
1171
|
-
type: Input
|
|
1172
|
-
}], onTagUpdated: [{
|
|
1173
|
-
type: Output
|
|
1155
|
+
class TextEditorComponent {
|
|
1156
|
+
constructor() {
|
|
1157
|
+
this.onTagUpdated = new EventEmitter();
|
|
1158
|
+
}
|
|
1159
|
+
ngOnInit() {
|
|
1160
|
+
}
|
|
1161
|
+
getInnerHtml() {
|
|
1162
|
+
return `<${this.tag.tagDescription.tag}>${this.tag.innerHtml}<${this.tag.tagDescription.tag}/>`;
|
|
1163
|
+
}
|
|
1164
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n\r\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"overflow-x: auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\r\n <mat-button-toggle value=\"center\">\r\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"left\">\r\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"right\">\r\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }] }); }
|
|
1166
|
+
}
|
|
1167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TextEditorComponent, decorators: [{
|
|
1168
|
+
type: Component,
|
|
1169
|
+
args: [{ selector: 'croco-html-text-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n\r\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"overflow-x: auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\r\n <mat-button-toggle value=\"center\">\r\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"left\">\r\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"right\">\r\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>" }]
|
|
1170
|
+
}], ctorParameters: () => [], propDecorators: { tag: [{
|
|
1171
|
+
type: Input
|
|
1172
|
+
}], onTagUpdated: [{
|
|
1173
|
+
type: Output
|
|
1174
1174
|
}] } });
|
|
1175
1175
|
|
|
1176
|
-
class MainEditorBlockComponent {
|
|
1177
|
-
constructor() {
|
|
1178
|
-
this.textTags = TextMethods.textTags;
|
|
1179
|
-
this.onTagSaved = new EventEmitter();
|
|
1180
|
-
this.onTagRemoved = new EventEmitter();
|
|
1181
|
-
}
|
|
1182
|
-
tagUpdatedHandler(tag) {
|
|
1183
|
-
}
|
|
1184
|
-
save() {
|
|
1185
|
-
this.tag.presentOrEdit = true;
|
|
1186
|
-
this.onTagSaved.emit(this.tag);
|
|
1187
|
-
}
|
|
1188
|
-
deleteItem() {
|
|
1189
|
-
this.onTagRemoved.emit(this.tag);
|
|
1190
|
-
}
|
|
1191
|
-
ngOnInit() {
|
|
1192
|
-
}
|
|
1193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1194
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1195
|
-
}
|
|
1196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1197
|
-
type: Component,
|
|
1198
|
-
args: [{ selector: 'croco-html-main-editor-block', template: "<div>\r\n <div>\r\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\r\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-text-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \r\n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-image-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\r\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-external-video-block>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\r\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-html-raw-editor>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"d-flex justify-content-end align-self-center\">\r\n <div>\r\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>" }]
|
|
1199
|
-
}], ctorParameters:
|
|
1200
|
-
type: Input
|
|
1201
|
-
}], onTagSaved: [{
|
|
1202
|
-
type: Output
|
|
1203
|
-
}], onTagRemoved: [{
|
|
1204
|
-
type: Output
|
|
1176
|
+
class MainEditorBlockComponent {
|
|
1177
|
+
constructor() {
|
|
1178
|
+
this.textTags = TextMethods.textTags;
|
|
1179
|
+
this.onTagSaved = new EventEmitter();
|
|
1180
|
+
this.onTagRemoved = new EventEmitter();
|
|
1181
|
+
}
|
|
1182
|
+
tagUpdatedHandler(tag) {
|
|
1183
|
+
}
|
|
1184
|
+
save() {
|
|
1185
|
+
this.tag.presentOrEdit = true;
|
|
1186
|
+
this.onTagSaved.emit(this.tag);
|
|
1187
|
+
}
|
|
1188
|
+
deleteItem() {
|
|
1189
|
+
this.onTagRemoved.emit(this.tag);
|
|
1190
|
+
}
|
|
1191
|
+
ngOnInit() {
|
|
1192
|
+
}
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: MainEditorBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: { tag: "tag" }, outputs: { onTagSaved: "onTagSaved", onTagRemoved: "onTagRemoved" }, ngImport: i0, template: "<div>\r\n <div>\r\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\r\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-text-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \r\n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-image-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\r\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-external-video-block>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\r\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-html-raw-editor>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"d-flex justify-content-end align-self-center\">\r\n <div>\r\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { kind: "component", type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: ["tag"], outputs: ["onTagUpdated"] }, { kind: "component", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { kind: "component", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }] }); }
|
|
1195
|
+
}
|
|
1196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: MainEditorBlockComponent, decorators: [{
|
|
1197
|
+
type: Component,
|
|
1198
|
+
args: [{ selector: 'croco-html-main-editor-block', template: "<div>\r\n <div>\r\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\r\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-text-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \r\n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-image-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\r\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-external-video-block>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\r\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-html-raw-editor>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"d-flex justify-content-end align-self-center\">\r\n <div>\r\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>" }]
|
|
1199
|
+
}], ctorParameters: () => [], propDecorators: { tag: [{
|
|
1200
|
+
type: Input
|
|
1201
|
+
}], onTagSaved: [{
|
|
1202
|
+
type: Output
|
|
1203
|
+
}], onTagRemoved: [{
|
|
1204
|
+
type: Output
|
|
1205
1205
|
}] } });
|
|
1206
1206
|
|
|
1207
|
-
class VisualEditorComponent {
|
|
1208
|
-
isHtmlSet() {
|
|
1209
|
-
return this.html.startsWith("<body>");
|
|
1210
|
-
}
|
|
1211
|
-
clearHtml() {
|
|
1212
|
-
this.html = "";
|
|
1213
|
-
this.recalculateBodyTags();
|
|
1214
|
-
}
|
|
1215
|
-
getHtml() {
|
|
1216
|
-
this.recalculateHtml();
|
|
1217
|
-
return this.html;
|
|
1218
|
-
}
|
|
1219
|
-
constructor(_cdref) {
|
|
1220
|
-
this._cdref = _cdref;
|
|
1221
|
-
this.isLoading = false;
|
|
1222
|
-
this.loadingText = "Идёт загрузка";
|
|
1223
|
-
this.showMarkUp = true;
|
|
1224
|
-
this.tags = [];
|
|
1225
|
-
this.useHtmlRaw = false;
|
|
1226
|
-
this.html = "";
|
|
1227
|
-
this.onHtmlChanged = new EventEmitter();
|
|
1228
|
-
this.rendered = new EventEmitter();
|
|
1229
|
-
this.bodyTags = [];
|
|
1230
|
-
}
|
|
1231
|
-
ngAfterViewInit() {
|
|
1232
|
-
this.rendered.emit(true);
|
|
1233
|
-
}
|
|
1234
|
-
ngAfterContentChecked() {
|
|
1235
|
-
this._cdref.detectChanges();
|
|
1236
|
-
}
|
|
1237
|
-
addTag() {
|
|
1238
|
-
let tagDescription = this.tags
|
|
1239
|
-
.find(x => x.tag === this.selectedValue);
|
|
1240
|
-
let attrs = {};
|
|
1241
|
-
let innerHtml = "";
|
|
1242
|
-
if (TextMethods.textTags.includes(tagDescription.tag)) {
|
|
1243
|
-
attrs["h-align"] = "left";
|
|
1244
|
-
innerHtml = "Введите ваш текст";
|
|
1245
|
-
}
|
|
1246
|
-
else if (tagDescription.tag == ExternalVideoTagDataConsts.TagName) {
|
|
1247
|
-
attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = ExternalVideoSupportedTypes.Youtube;
|
|
1248
|
-
attrs[ExternalVideoTagDataConsts.LinkAttrName] = null;
|
|
1249
|
-
}
|
|
1250
|
-
else {
|
|
1251
|
-
attrs[FileImageTagDataConsts.FileIdAttrName] = null;
|
|
1252
|
-
}
|
|
1253
|
-
this.bodyTags.push({
|
|
1254
|
-
tagDescription,
|
|
1255
|
-
innerHtml,
|
|
1256
|
-
attributes: attrs,
|
|
1257
|
-
presentOrEdit: true
|
|
1258
|
-
});
|
|
1259
|
-
this.recalculateHtml();
|
|
1260
|
-
}
|
|
1261
|
-
postFilesStartedEventHandler(model) {
|
|
1262
|
-
this.loadingText = "Файлы загружаются на сервер";
|
|
1263
|
-
this.isLoading = true;
|
|
1264
|
-
}
|
|
1265
|
-
addTagCustom(tag) {
|
|
1266
|
-
this.bodyTags.push(tag);
|
|
1267
|
-
this.recalculateHtml();
|
|
1268
|
-
}
|
|
1269
|
-
filesTagsReadyHandler(tags) {
|
|
1270
|
-
for (let i = 0; i < tags.length; i++) {
|
|
1271
|
-
this.bodyTags.push(tags[i]);
|
|
1272
|
-
}
|
|
1273
|
-
this.recalculateHtml();
|
|
1274
|
-
this.isLoading = false;
|
|
1275
|
-
}
|
|
1276
|
-
drop(event) {
|
|
1277
|
-
moveItemInArray(this.bodyTags, event.previousIndex, event.currentIndex);
|
|
1278
|
-
this.recalculateHtml();
|
|
1279
|
-
}
|
|
1280
|
-
onTagSavedHandler(tag) {
|
|
1281
|
-
this.recalculateHtml();
|
|
1282
|
-
}
|
|
1283
|
-
onTagRemovedHandler(index) {
|
|
1284
|
-
this.bodyTags.splice(index, 1);
|
|
1285
|
-
this.recalculateHtml();
|
|
1286
|
-
}
|
|
1287
|
-
recalculateHtml() {
|
|
1288
|
-
let result = BodyTagsExtensions.toHtml(this.bodyTags);
|
|
1289
|
-
this.html = XmlExtensions.formatXml("<body>" + result + "</body>");
|
|
1290
|
-
this.onHtmlChanged.emit(this.html);
|
|
1291
|
-
}
|
|
1292
|
-
recalculateBodyTags() {
|
|
1293
|
-
this.bodyTags = BodyTagsExtensions.getBodyTags(this.html, { useCustomDomain: false, domain: "" });
|
|
1294
|
-
}
|
|
1295
|
-
ngOnInit() {
|
|
1296
|
-
this.recalculateBodyTags();
|
|
1297
|
-
this.tags = DefaultTags.getTags(this.useHtmlRaw);
|
|
1298
|
-
this.selectedValue = this.tags[0].tag;
|
|
1299
|
-
}
|
|
1300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1301
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1302
|
-
}
|
|
1303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1304
|
-
type: Component,
|
|
1305
|
-
args: [{ selector: 'croco-visual-editor', template: "<div *ngIf=\"isLoading\">\r\n <div>\r\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\r\n <div style=\"text-align: center;\">{{loadingText}}</div>\r\n </div>\r\n <div style=\"height: 10px;\"></div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"example-handle\" cdkDragHandle>\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path\r\n d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\">\r\n </path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n <div>\r\n <mat-chip-listbox aria-label=\"Tag display value\">\r\n <mat-chip-option color=\"primary\"\r\n selected>{{tag.tagDescription.displayValue}}</mat-chip-option>\r\n </mat-chip-listbox>\r\n </div>\r\n </div>\r\n\r\n <div style=\"height: 15px;\"></div>\r\n\r\n <croco-html-main-editor-block [tag]=\"tag\" (onTagSaved)=\"onTagSavedHandler($event)\"\r\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\r\n </croco-html-main-editor-block>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <mat-form-field class=\"w-100\" appearance=\"outline\">\r\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\r\n <mat-select [(ngModel)]=\"selectedValue\">\r\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\r\n {{tag.displayValue}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-12\">\r\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\r\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\r\n </button>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <croco-html-add-files-btn (filesTagsReady)=\"filesTagsReadyHandler($event)\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" class=\"w-100\">\r\n </croco-html-add-files-btn>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
1306
|
-
}], ctorParameters:
|
|
1307
|
-
type: Input
|
|
1308
|
-
}], useHtmlRaw: [{
|
|
1309
|
-
type: Input
|
|
1310
|
-
}], html: [{
|
|
1311
|
-
type: Input
|
|
1312
|
-
}, {
|
|
1313
|
-
type: Output
|
|
1314
|
-
}], onHtmlChanged: [{
|
|
1315
|
-
type: Output
|
|
1316
|
-
}], rendered: [{
|
|
1317
|
-
type: Output
|
|
1207
|
+
class VisualEditorComponent {
|
|
1208
|
+
isHtmlSet() {
|
|
1209
|
+
return this.html.startsWith("<body>");
|
|
1210
|
+
}
|
|
1211
|
+
clearHtml() {
|
|
1212
|
+
this.html = "";
|
|
1213
|
+
this.recalculateBodyTags();
|
|
1214
|
+
}
|
|
1215
|
+
getHtml() {
|
|
1216
|
+
this.recalculateHtml();
|
|
1217
|
+
return this.html;
|
|
1218
|
+
}
|
|
1219
|
+
constructor(_cdref) {
|
|
1220
|
+
this._cdref = _cdref;
|
|
1221
|
+
this.isLoading = false;
|
|
1222
|
+
this.loadingText = "Идёт загрузка";
|
|
1223
|
+
this.showMarkUp = true;
|
|
1224
|
+
this.tags = [];
|
|
1225
|
+
this.useHtmlRaw = false;
|
|
1226
|
+
this.html = "";
|
|
1227
|
+
this.onHtmlChanged = new EventEmitter();
|
|
1228
|
+
this.rendered = new EventEmitter();
|
|
1229
|
+
this.bodyTags = [];
|
|
1230
|
+
}
|
|
1231
|
+
ngAfterViewInit() {
|
|
1232
|
+
this.rendered.emit(true);
|
|
1233
|
+
}
|
|
1234
|
+
ngAfterContentChecked() {
|
|
1235
|
+
this._cdref.detectChanges();
|
|
1236
|
+
}
|
|
1237
|
+
addTag() {
|
|
1238
|
+
let tagDescription = this.tags
|
|
1239
|
+
.find(x => x.tag === this.selectedValue);
|
|
1240
|
+
let attrs = {};
|
|
1241
|
+
let innerHtml = "";
|
|
1242
|
+
if (TextMethods.textTags.includes(tagDescription.tag)) {
|
|
1243
|
+
attrs["h-align"] = "left";
|
|
1244
|
+
innerHtml = "Введите ваш текст";
|
|
1245
|
+
}
|
|
1246
|
+
else if (tagDescription.tag == ExternalVideoTagDataConsts.TagName) {
|
|
1247
|
+
attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = ExternalVideoSupportedTypes.Youtube;
|
|
1248
|
+
attrs[ExternalVideoTagDataConsts.LinkAttrName] = null;
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
attrs[FileImageTagDataConsts.FileIdAttrName] = null;
|
|
1252
|
+
}
|
|
1253
|
+
this.bodyTags.push({
|
|
1254
|
+
tagDescription,
|
|
1255
|
+
innerHtml,
|
|
1256
|
+
attributes: attrs,
|
|
1257
|
+
presentOrEdit: true
|
|
1258
|
+
});
|
|
1259
|
+
this.recalculateHtml();
|
|
1260
|
+
}
|
|
1261
|
+
postFilesStartedEventHandler(model) {
|
|
1262
|
+
this.loadingText = "Файлы загружаются на сервер";
|
|
1263
|
+
this.isLoading = true;
|
|
1264
|
+
}
|
|
1265
|
+
addTagCustom(tag) {
|
|
1266
|
+
this.bodyTags.push(tag);
|
|
1267
|
+
this.recalculateHtml();
|
|
1268
|
+
}
|
|
1269
|
+
filesTagsReadyHandler(tags) {
|
|
1270
|
+
for (let i = 0; i < tags.length; i++) {
|
|
1271
|
+
this.bodyTags.push(tags[i]);
|
|
1272
|
+
}
|
|
1273
|
+
this.recalculateHtml();
|
|
1274
|
+
this.isLoading = false;
|
|
1275
|
+
}
|
|
1276
|
+
drop(event) {
|
|
1277
|
+
moveItemInArray(this.bodyTags, event.previousIndex, event.currentIndex);
|
|
1278
|
+
this.recalculateHtml();
|
|
1279
|
+
}
|
|
1280
|
+
onTagSavedHandler(tag) {
|
|
1281
|
+
this.recalculateHtml();
|
|
1282
|
+
}
|
|
1283
|
+
onTagRemovedHandler(index) {
|
|
1284
|
+
this.bodyTags.splice(index, 1);
|
|
1285
|
+
this.recalculateHtml();
|
|
1286
|
+
}
|
|
1287
|
+
recalculateHtml() {
|
|
1288
|
+
let result = BodyTagsExtensions.toHtml(this.bodyTags);
|
|
1289
|
+
this.html = XmlExtensions.formatXml("<body>" + result + "</body>");
|
|
1290
|
+
this.onHtmlChanged.emit(this.html);
|
|
1291
|
+
}
|
|
1292
|
+
recalculateBodyTags() {
|
|
1293
|
+
this.bodyTags = BodyTagsExtensions.getBodyTags(this.html, { useCustomDomain: false, domain: "" });
|
|
1294
|
+
}
|
|
1295
|
+
ngOnInit() {
|
|
1296
|
+
this.recalculateBodyTags();
|
|
1297
|
+
this.tags = DefaultTags.getTags(this.useHtmlRaw);
|
|
1298
|
+
this.selectedValue = this.tags[0].tag;
|
|
1299
|
+
}
|
|
1300
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: VisualEditorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1301
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: VisualEditorComponent, selector: "croco-visual-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged", rendered: "rendered" }, ngImport: i0, template: "<div *ngIf=\"isLoading\">\r\n <div>\r\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\r\n <div style=\"text-align: center;\">{{loadingText}}</div>\r\n </div>\r\n <div style=\"height: 10px;\"></div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"example-handle\" cdkDragHandle>\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path\r\n d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\">\r\n </path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n <div>\r\n <mat-chip-listbox aria-label=\"Tag display value\">\r\n <mat-chip-option color=\"primary\"\r\n selected>{{tag.tagDescription.displayValue}}</mat-chip-option>\r\n </mat-chip-listbox>\r\n </div>\r\n </div>\r\n\r\n <div style=\"height: 15px;\"></div>\r\n\r\n <croco-html-main-editor-block [tag]=\"tag\" (onTagSaved)=\"onTagSavedHandler($event)\"\r\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\r\n </croco-html-main-editor-block>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <mat-form-field class=\"w-100\" appearance=\"outline\">\r\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\r\n <mat-select [(ngModel)]=\"selectedValue\">\r\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\r\n {{tag.displayValue}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-12\">\r\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\r\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\r\n </button>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <croco-html-add-files-btn (filesTagsReady)=\"filesTagsReadyHandler($event)\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" class=\"w-100\">\r\n </croco-html-add-files-btn>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i5$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i8.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i8.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i10.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i10.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i10.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: ["tag"], outputs: ["onTagSaved", "onTagRemoved"] }, { kind: "component", type: AddFilesBtnComponent, selector: "croco-html-add-files-btn", outputs: ["postFilesStarted", "filesTagsReady"] }] }); }
|
|
1302
|
+
}
|
|
1303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: VisualEditorComponent, decorators: [{
|
|
1304
|
+
type: Component,
|
|
1305
|
+
args: [{ selector: 'croco-visual-editor', template: "<div *ngIf=\"isLoading\">\r\n <div>\r\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\r\n <div style=\"text-align: center;\">{{loadingText}}</div>\r\n </div>\r\n <div style=\"height: 10px;\"></div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"example-handle\" cdkDragHandle>\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path\r\n d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\">\r\n </path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n <div>\r\n <mat-chip-listbox aria-label=\"Tag display value\">\r\n <mat-chip-option color=\"primary\"\r\n selected>{{tag.tagDescription.displayValue}}</mat-chip-option>\r\n </mat-chip-listbox>\r\n </div>\r\n </div>\r\n\r\n <div style=\"height: 15px;\"></div>\r\n\r\n <croco-html-main-editor-block [tag]=\"tag\" (onTagSaved)=\"onTagSavedHandler($event)\"\r\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\r\n </croco-html-main-editor-block>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <mat-form-field class=\"w-100\" appearance=\"outline\">\r\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\r\n <mat-select [(ngModel)]=\"selectedValue\">\r\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\r\n {{tag.displayValue}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-12\">\r\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\r\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\r\n </button>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card style=\"margin: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <croco-html-add-files-btn (filesTagsReady)=\"filesTagsReadyHandler($event)\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" class=\"w-100\">\r\n </croco-html-add-files-btn>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
1306
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { showMarkUp: [{
|
|
1307
|
+
type: Input
|
|
1308
|
+
}], useHtmlRaw: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}], html: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}, {
|
|
1313
|
+
type: Output
|
|
1314
|
+
}], onHtmlChanged: [{
|
|
1315
|
+
type: Output
|
|
1316
|
+
}], rendered: [{
|
|
1317
|
+
type: Output
|
|
1318
1318
|
}] } });
|
|
1319
1319
|
|
|
1320
|
-
class ToPreviewPipe {
|
|
1321
|
-
transform(value) {
|
|
1322
|
-
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
|
|
1323
|
-
useCustomDomain: false,
|
|
1324
|
-
domain: ""
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1328
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1329
|
-
}
|
|
1330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1331
|
-
type: Pipe,
|
|
1332
|
-
args: [{
|
|
1333
|
-
name: 'topreview'
|
|
1334
|
-
}]
|
|
1320
|
+
class ToPreviewPipe {
|
|
1321
|
+
transform(value) {
|
|
1322
|
+
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
|
|
1323
|
+
useCustomDomain: false,
|
|
1324
|
+
domain: ""
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1328
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewPipe, name: "topreview" }); }
|
|
1329
|
+
}
|
|
1330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewPipe, decorators: [{
|
|
1331
|
+
type: Pipe,
|
|
1332
|
+
args: [{
|
|
1333
|
+
name: 'topreview'
|
|
1334
|
+
}]
|
|
1335
1335
|
}] });
|
|
1336
1336
|
|
|
1337
|
-
class MainEditorComponent {
|
|
1338
|
-
constructor(_clipboardService, _snackBar, _cdref) {
|
|
1339
|
-
this._clipboardService = _clipboardService;
|
|
1340
|
-
this._snackBar = _snackBar;
|
|
1341
|
-
this._cdref = _cdref;
|
|
1342
|
-
this.visualEditorRendered = false;
|
|
1343
|
-
this.showMarkUp = true;
|
|
1344
|
-
this.useHtmlRaw = false;
|
|
1345
|
-
this.html = "";
|
|
1346
|
-
this.onHtmlChanged = new EventEmitter();
|
|
1347
|
-
}
|
|
1348
|
-
ngAfterViewInit() {
|
|
1349
|
-
this.recalculateBodyTags();
|
|
1350
|
-
}
|
|
1351
|
-
ngAfterContentChecked() {
|
|
1352
|
-
this._cdref.detectChanges();
|
|
1353
|
-
}
|
|
1354
|
-
visualEditorRenderedHandler() {
|
|
1355
|
-
this.visualEditorRendered = true;
|
|
1356
|
-
this.recalculateBodyTags();
|
|
1357
|
-
}
|
|
1358
|
-
onHtmlChangedHandler(html) {
|
|
1359
|
-
this.html = html;
|
|
1360
|
-
this.onHtmlChanged.emit(html);
|
|
1361
|
-
}
|
|
1362
|
-
textAreaModelChangedHandler() {
|
|
1363
|
-
this.recalculateBodyTags();
|
|
1364
|
-
this.onHtmlChangedHandler(this.html);
|
|
1365
|
-
}
|
|
1366
|
-
recalculateBodyTags() {
|
|
1367
|
-
this.visualEditor.html = this.html;
|
|
1368
|
-
this.visualEditor.recalculateBodyTags();
|
|
1369
|
-
}
|
|
1370
|
-
copyMarkUp() {
|
|
1371
|
-
this._snackBar.open("Разметка скопирована в буфер обмена", "Закрыть", { duration: 1500 });
|
|
1372
|
-
this._clipboardService.copy(this.html);
|
|
1373
|
-
}
|
|
1374
|
-
ngOnInit() {
|
|
1375
|
-
this.visualEditor.recalculateBodyTags();
|
|
1376
|
-
}
|
|
1377
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1378
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1379
|
-
}
|
|
1380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1381
|
-
type: Component,
|
|
1382
|
-
args: [{ selector: 'croco-html-main-editor', template: "<mat-tab-group>\r\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n <croco-visual-editor #visualEditor\r\n [useHtmlRaw]=\"useHtmlRaw\"\r\n [html]=\"html\"\r\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\r\n (rendered)=\"visualEditorRenderedHandler()\">\r\n </croco-visual-editor>\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n </mat-tab>\r\n\r\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\r\n <div style=\"height: 10px;\"></div>\r\n <div *ngIf=\"visualEditorRendered\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" [(ngModel)]=\"html\"\r\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <button (click)=\"copyMarkUp()\"\r\n mat-raised-button color=\"primary\">\r\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\r\n </button>\r\n </mat-tab>\r\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\r\n <mat-card style=\"padding: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <croco-html-xml-tag-view [data]=\"html | topreview\">\r\n </croco-html-xml-tag-view>\r\n </mat-card-content>\r\n </mat-card>\r\n </mat-tab>\r\n</mat-tab-group>\r\n", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
1383
|
-
}], ctorParameters:
|
|
1384
|
-
type: ViewChild,
|
|
1385
|
-
args: ["visualEditor", { static: true }]
|
|
1386
|
-
}], showMarkUp: [{
|
|
1387
|
-
type: Input
|
|
1388
|
-
}], useHtmlRaw: [{
|
|
1389
|
-
type: Input
|
|
1390
|
-
}], html: [{
|
|
1391
|
-
type: Input
|
|
1392
|
-
}, {
|
|
1393
|
-
type: Output
|
|
1394
|
-
}], onHtmlChanged: [{
|
|
1395
|
-
type: Output
|
|
1337
|
+
class MainEditorComponent {
|
|
1338
|
+
constructor(_clipboardService, _snackBar, _cdref) {
|
|
1339
|
+
this._clipboardService = _clipboardService;
|
|
1340
|
+
this._snackBar = _snackBar;
|
|
1341
|
+
this._cdref = _cdref;
|
|
1342
|
+
this.visualEditorRendered = false;
|
|
1343
|
+
this.showMarkUp = true;
|
|
1344
|
+
this.useHtmlRaw = false;
|
|
1345
|
+
this.html = "";
|
|
1346
|
+
this.onHtmlChanged = new EventEmitter();
|
|
1347
|
+
}
|
|
1348
|
+
ngAfterViewInit() {
|
|
1349
|
+
this.recalculateBodyTags();
|
|
1350
|
+
}
|
|
1351
|
+
ngAfterContentChecked() {
|
|
1352
|
+
this._cdref.detectChanges();
|
|
1353
|
+
}
|
|
1354
|
+
visualEditorRenderedHandler() {
|
|
1355
|
+
this.visualEditorRendered = true;
|
|
1356
|
+
this.recalculateBodyTags();
|
|
1357
|
+
}
|
|
1358
|
+
onHtmlChangedHandler(html) {
|
|
1359
|
+
this.html = html;
|
|
1360
|
+
this.onHtmlChanged.emit(html);
|
|
1361
|
+
}
|
|
1362
|
+
textAreaModelChangedHandler() {
|
|
1363
|
+
this.recalculateBodyTags();
|
|
1364
|
+
this.onHtmlChangedHandler(this.html);
|
|
1365
|
+
}
|
|
1366
|
+
recalculateBodyTags() {
|
|
1367
|
+
this.visualEditor.html = this.html;
|
|
1368
|
+
this.visualEditor.recalculateBodyTags();
|
|
1369
|
+
}
|
|
1370
|
+
copyMarkUp() {
|
|
1371
|
+
this._snackBar.open("Разметка скопирована в буфер обмена", "Закрыть", { duration: 1500 });
|
|
1372
|
+
this._clipboardService.copy(this.html);
|
|
1373
|
+
}
|
|
1374
|
+
ngOnInit() {
|
|
1375
|
+
this.visualEditor.recalculateBodyTags();
|
|
1376
|
+
}
|
|
1377
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: MainEditorComponent, deps: [{ token: i1$3.ClipboardService }, { token: i2$2.MatSnackBar }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1378
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: MainEditorComponent, selector: "croco-html-main-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged" }, viewQueries: [{ propertyName: "visualEditor", first: true, predicate: ["visualEditor"], descendants: true, static: true }], ngImport: i0, template: "<mat-tab-group>\r\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n <croco-visual-editor #visualEditor\r\n [useHtmlRaw]=\"useHtmlRaw\"\r\n [html]=\"html\"\r\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\r\n (rendered)=\"visualEditorRenderedHandler()\">\r\n </croco-visual-editor>\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n </mat-tab>\r\n\r\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\r\n <div style=\"height: 10px;\"></div>\r\n <div *ngIf=\"visualEditorRendered\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" [(ngModel)]=\"html\"\r\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <button (click)=\"copyMarkUp()\"\r\n mat-raised-button color=\"primary\">\r\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\r\n </button>\r\n </mat-tab>\r\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\r\n <mat-card style=\"padding: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <croco-html-xml-tag-view [data]=\"html | topreview\">\r\n </croco-html-xml-tag-view>\r\n </mat-card-content>\r\n </mat-card>\r\n </mat-tab>\r\n</mat-tab-group>\r\n", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i6$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i6$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i5$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$2.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: ["data"] }, { kind: "component", type: VisualEditorComponent, selector: "croco-visual-editor", inputs: ["showMarkUp", "useHtmlRaw", "html"], outputs: ["html", "onHtmlChanged", "rendered"] }, { kind: "pipe", type: ToPreviewPipe, name: "topreview" }] }); }
|
|
1379
|
+
}
|
|
1380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: MainEditorComponent, decorators: [{
|
|
1381
|
+
type: Component,
|
|
1382
|
+
args: [{ selector: 'croco-html-main-editor', template: "<mat-tab-group>\r\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n <croco-visual-editor #visualEditor\r\n [useHtmlRaw]=\"useHtmlRaw\"\r\n [html]=\"html\"\r\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\r\n (rendered)=\"visualEditorRenderedHandler()\">\r\n </croco-visual-editor>\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n </mat-tab>\r\n\r\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\r\n <div style=\"height: 10px;\"></div>\r\n <div *ngIf=\"visualEditorRendered\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" [(ngModel)]=\"html\"\r\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <button (click)=\"copyMarkUp()\"\r\n mat-raised-button color=\"primary\">\r\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\r\n </button>\r\n </mat-tab>\r\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\r\n <mat-card style=\"padding: 2px;\" class=\"mat-card\">\r\n <mat-card-content>\r\n <croco-html-xml-tag-view [data]=\"html | topreview\">\r\n </croco-html-xml-tag-view>\r\n </mat-card-content>\r\n </mat-card>\r\n </mat-tab>\r\n</mat-tab-group>\r\n", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:#fff;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
1383
|
+
}], ctorParameters: () => [{ type: i1$3.ClipboardService }, { type: i2$2.MatSnackBar }, { type: i0.ChangeDetectorRef }], propDecorators: { visualEditor: [{
|
|
1384
|
+
type: ViewChild,
|
|
1385
|
+
args: ["visualEditor", { static: true }]
|
|
1386
|
+
}], showMarkUp: [{
|
|
1387
|
+
type: Input
|
|
1388
|
+
}], useHtmlRaw: [{
|
|
1389
|
+
type: Input
|
|
1390
|
+
}], html: [{
|
|
1391
|
+
type: Input
|
|
1392
|
+
}, {
|
|
1393
|
+
type: Output
|
|
1394
|
+
}], onHtmlChanged: [{
|
|
1395
|
+
type: Output
|
|
1396
1396
|
}] } });
|
|
1397
1397
|
|
|
1398
|
-
class RichTextToHtmlPipe {
|
|
1399
|
-
transform(value) {
|
|
1400
|
-
let result = "";
|
|
1401
|
-
for (let i = 0; i < value.data.children.length; i++) {
|
|
1402
|
-
const child = value.data.children[i];
|
|
1403
|
-
if (child.type === "text-block") {
|
|
1404
|
-
result += `<span>${child.data.text}</span>`;
|
|
1405
|
-
}
|
|
1406
|
-
else if (child.type === "line-break") {
|
|
1407
|
-
result += "</br>";
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
return result;
|
|
1411
|
-
}
|
|
1412
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1413
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1414
|
-
}
|
|
1415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1416
|
-
type: Pipe,
|
|
1417
|
-
args: [{
|
|
1418
|
-
name: 'richTextToHtml'
|
|
1419
|
-
}]
|
|
1398
|
+
class RichTextToHtmlPipe {
|
|
1399
|
+
transform(value) {
|
|
1400
|
+
let result = "";
|
|
1401
|
+
for (let i = 0; i < value.data.children.length; i++) {
|
|
1402
|
+
const child = value.data.children[i];
|
|
1403
|
+
if (child.type === "text-block") {
|
|
1404
|
+
result += `<span>${child.data.text}</span>`;
|
|
1405
|
+
}
|
|
1406
|
+
else if (child.type === "line-break") {
|
|
1407
|
+
result += "</br>";
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
return result;
|
|
1411
|
+
}
|
|
1412
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: RichTextToHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1413
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: RichTextToHtmlPipe, name: "richTextToHtml" }); }
|
|
1414
|
+
}
|
|
1415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: RichTextToHtmlPipe, decorators: [{
|
|
1416
|
+
type: Pipe,
|
|
1417
|
+
args: [{
|
|
1418
|
+
name: 'richTextToHtml'
|
|
1419
|
+
}]
|
|
1420
1420
|
}] });
|
|
1421
1421
|
|
|
1422
|
-
class XmlTagRichTextViewComponent {
|
|
1423
|
-
constructor() {
|
|
1424
|
-
this.richTextData = null;
|
|
1425
|
-
}
|
|
1426
|
-
ngOnInit() {
|
|
1427
|
-
}
|
|
1428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1429
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1430
|
-
}
|
|
1431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1432
|
-
type: Component,
|
|
1433
|
-
args: [{ selector: 'croco-html-xml-tag-rich-text-view', template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>" }]
|
|
1434
|
-
}], ctorParameters:
|
|
1435
|
-
type: Input
|
|
1422
|
+
class XmlTagRichTextViewComponent {
|
|
1423
|
+
constructor() {
|
|
1424
|
+
this.richTextData = null;
|
|
1425
|
+
}
|
|
1426
|
+
ngOnInit() {
|
|
1427
|
+
}
|
|
1428
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagRichTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1429
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagRichTextViewComponent, selector: "croco-html-xml-tag-rich-text-view", inputs: { richTextData: "richTextData" }, ngImport: i0, template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: RichTextToHtmlPipe, name: "richTextToHtml" }] }); }
|
|
1430
|
+
}
|
|
1431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagRichTextViewComponent, decorators: [{
|
|
1432
|
+
type: Component,
|
|
1433
|
+
args: [{ selector: 'croco-html-xml-tag-rich-text-view', template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>" }]
|
|
1434
|
+
}], ctorParameters: () => [], propDecorators: { richTextData: [{
|
|
1435
|
+
type: Input
|
|
1436
1436
|
}] } });
|
|
1437
1437
|
|
|
1438
|
-
class XmlTagTableViewComponent {
|
|
1439
|
-
constructor() {
|
|
1440
|
-
this.displayedColumns = [];
|
|
1441
|
-
}
|
|
1442
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1443
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1444
|
-
}
|
|
1445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1446
|
-
type: Component,
|
|
1447
|
-
args: [{ selector: 'croco-html-xml-tag-table-view', template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\r\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>" }]
|
|
1448
|
-
}], propDecorators: { displayedColumns: [{
|
|
1449
|
-
type: Input
|
|
1450
|
-
}], data: [{
|
|
1451
|
-
type: Input
|
|
1438
|
+
class XmlTagTableViewComponent {
|
|
1439
|
+
constructor() {
|
|
1440
|
+
this.displayedColumns = [];
|
|
1441
|
+
}
|
|
1442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1443
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: XmlTagTableViewComponent, selector: "croco-html-xml-tag-table-view", inputs: { displayedColumns: "displayedColumns", data: "data" }, ngImport: i0, template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\r\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }] }); }
|
|
1444
|
+
}
|
|
1445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: XmlTagTableViewComponent, decorators: [{
|
|
1446
|
+
type: Component,
|
|
1447
|
+
args: [{ selector: 'croco-html-xml-tag-table-view', template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\r\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>" }]
|
|
1448
|
+
}], propDecorators: { displayedColumns: [{
|
|
1449
|
+
type: Input
|
|
1450
|
+
}], data: [{
|
|
1451
|
+
type: Input
|
|
1452
1452
|
}] } });
|
|
1453
1453
|
|
|
1454
|
-
class HtmlViewComponent {
|
|
1455
|
-
constructor() {
|
|
1456
|
-
this.html = "<body></body>";
|
|
1457
|
-
}
|
|
1458
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1459
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1460
|
-
}
|
|
1461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1462
|
-
type: Component,
|
|
1463
|
-
args: [{ selector: 'croco-html-view', template: "<croco-html-xml-tag-view [data]=\"html | topreview\"></croco-html-xml-tag-view>" }]
|
|
1464
|
-
}], propDecorators: { html: [{
|
|
1465
|
-
type: Input
|
|
1454
|
+
class HtmlViewComponent {
|
|
1455
|
+
constructor() {
|
|
1456
|
+
this.html = "<body></body>";
|
|
1457
|
+
}
|
|
1458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1459
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: HtmlViewComponent, selector: "croco-html-view", inputs: { html: "html" }, ngImport: i0, template: "<croco-html-xml-tag-view [data]=\"html | topreview\"></croco-html-xml-tag-view>", styles: [""], dependencies: [{ kind: "component", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: ["data"] }, { kind: "pipe", type: ToPreviewPipe, name: "topreview" }] }); }
|
|
1460
|
+
}
|
|
1461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: HtmlViewComponent, decorators: [{
|
|
1462
|
+
type: Component,
|
|
1463
|
+
args: [{ selector: 'croco-html-view', template: "<croco-html-xml-tag-view [data]=\"html | topreview\"></croco-html-xml-tag-view>" }]
|
|
1464
|
+
}], propDecorators: { html: [{
|
|
1465
|
+
type: Input
|
|
1466
1466
|
}] } });
|
|
1467
1467
|
|
|
1468
|
-
class TagToSpanPipe {
|
|
1469
|
-
transform(value) {
|
|
1470
|
-
return value.map(x => (`<b>${x}</b>`)).join(' | ');
|
|
1471
|
-
}
|
|
1472
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1473
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1474
|
-
}
|
|
1475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1476
|
-
type: Pipe,
|
|
1477
|
-
args: [{
|
|
1478
|
-
name: 'tagToSpan'
|
|
1479
|
-
}]
|
|
1468
|
+
class TagToSpanPipe {
|
|
1469
|
+
transform(value) {
|
|
1470
|
+
return value.map(x => (`<b>${x}</b>`)).join(' | ');
|
|
1471
|
+
}
|
|
1472
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TagToSpanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1473
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: TagToSpanPipe, name: "tagToSpan" }); }
|
|
1474
|
+
}
|
|
1475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: TagToSpanPipe, decorators: [{
|
|
1476
|
+
type: Pipe,
|
|
1477
|
+
args: [{
|
|
1478
|
+
name: 'tagToSpan'
|
|
1479
|
+
}]
|
|
1480
1480
|
}] });
|
|
1481
1481
|
|
|
1482
|
-
class ToHtmlBodyTagsPipe {
|
|
1483
|
-
transform(value) {
|
|
1484
|
-
return BodyTagsExtensions.getBodyTags(value, { useCustomDomain: false, domain: "" });
|
|
1485
|
-
}
|
|
1486
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1487
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1488
|
-
}
|
|
1489
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1490
|
-
type: Pipe,
|
|
1491
|
-
args: [{
|
|
1492
|
-
name: 'tohtmlbodytags'
|
|
1493
|
-
}]
|
|
1482
|
+
class ToHtmlBodyTagsPipe {
|
|
1483
|
+
transform(value) {
|
|
1484
|
+
return BodyTagsExtensions.getBodyTags(value, { useCustomDomain: false, domain: "" });
|
|
1485
|
+
}
|
|
1486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1487
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: ToHtmlBodyTagsPipe, name: "tohtmlbodytags" }); }
|
|
1488
|
+
}
|
|
1489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToHtmlBodyTagsPipe, decorators: [{
|
|
1490
|
+
type: Pipe,
|
|
1491
|
+
args: [{
|
|
1492
|
+
name: 'tohtmlbodytags'
|
|
1493
|
+
}]
|
|
1494
1494
|
}] });
|
|
1495
1495
|
|
|
1496
|
-
class ToPreviewHtmlPipe {
|
|
1497
|
-
transform(value, options) {
|
|
1498
|
-
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, options);
|
|
1499
|
-
}
|
|
1500
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1501
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1502
|
-
}
|
|
1503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1504
|
-
type: Pipe,
|
|
1505
|
-
args: [{
|
|
1506
|
-
name: 'topreviewhtml'
|
|
1507
|
-
}]
|
|
1496
|
+
class ToPreviewHtmlPipe {
|
|
1497
|
+
transform(value, options) {
|
|
1498
|
+
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, options);
|
|
1499
|
+
}
|
|
1500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1501
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewHtmlPipe, name: "topreviewhtml" }); }
|
|
1502
|
+
}
|
|
1503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ToPreviewHtmlPipe, decorators: [{
|
|
1504
|
+
type: Pipe,
|
|
1505
|
+
args: [{
|
|
1506
|
+
name: 'topreviewhtml'
|
|
1507
|
+
}]
|
|
1508
1508
|
}] });
|
|
1509
1509
|
|
|
1510
|
-
class TableBuilder {
|
|
1511
|
-
static getTableMarkUp(rows, cols, generateHeaders) {
|
|
1512
|
-
rows = +rows;
|
|
1513
|
-
cols = +cols;
|
|
1514
|
-
let result = "<table>";
|
|
1515
|
-
if (generateHeaders) {
|
|
1516
|
-
result += TableBuilder.getTableHeaderMarkUp(cols);
|
|
1517
|
-
}
|
|
1518
|
-
result += TableBuilder.getTableBodyMarkUp(cols, rows);
|
|
1519
|
-
result += "</table>";
|
|
1520
|
-
return XmlExtensions.formatXml(result);
|
|
1521
|
-
}
|
|
1522
|
-
static getTableHeaderMarkUp(cols) {
|
|
1523
|
-
let result = "<thead><tr>";
|
|
1524
|
-
for (let i = 0; i < cols; i++) {
|
|
1525
|
-
result += `<th>Колонка #${i + 1}</th>`;
|
|
1526
|
-
}
|
|
1527
|
-
result += "</tr></thead>";
|
|
1528
|
-
return result;
|
|
1529
|
-
}
|
|
1530
|
-
static getTableBodyMarkUp(cols, rows) {
|
|
1531
|
-
let result = "<tbody>";
|
|
1532
|
-
for (let row = 0; row < rows; row++) {
|
|
1533
|
-
result += "<tr>";
|
|
1534
|
-
for (let i = 0; i < cols; i++) {
|
|
1535
|
-
result += `<td>Ряд№${row + 1} Колонка #${i + 1}</td>`;
|
|
1536
|
-
}
|
|
1537
|
-
result += "</tr>";
|
|
1538
|
-
}
|
|
1539
|
-
result += "</tbody>";
|
|
1540
|
-
return result;
|
|
1541
|
-
}
|
|
1510
|
+
class TableBuilder {
|
|
1511
|
+
static getTableMarkUp(rows, cols, generateHeaders) {
|
|
1512
|
+
rows = +rows;
|
|
1513
|
+
cols = +cols;
|
|
1514
|
+
let result = "<table>";
|
|
1515
|
+
if (generateHeaders) {
|
|
1516
|
+
result += TableBuilder.getTableHeaderMarkUp(cols);
|
|
1517
|
+
}
|
|
1518
|
+
result += TableBuilder.getTableBodyMarkUp(cols, rows);
|
|
1519
|
+
result += "</table>";
|
|
1520
|
+
return XmlExtensions.formatXml(result);
|
|
1521
|
+
}
|
|
1522
|
+
static getTableHeaderMarkUp(cols) {
|
|
1523
|
+
let result = "<thead><tr>";
|
|
1524
|
+
for (let i = 0; i < cols; i++) {
|
|
1525
|
+
result += `<th>Колонка #${i + 1}</th>`;
|
|
1526
|
+
}
|
|
1527
|
+
result += "</tr></thead>";
|
|
1528
|
+
return result;
|
|
1529
|
+
}
|
|
1530
|
+
static getTableBodyMarkUp(cols, rows) {
|
|
1531
|
+
let result = "<tbody>";
|
|
1532
|
+
for (let row = 0; row < rows; row++) {
|
|
1533
|
+
result += "<tr>";
|
|
1534
|
+
for (let i = 0; i < cols; i++) {
|
|
1535
|
+
result += `<td>Ряд№${row + 1} Колонка #${i + 1}</td>`;
|
|
1536
|
+
}
|
|
1537
|
+
result += "</tr>";
|
|
1538
|
+
}
|
|
1539
|
+
result += "</tbody>";
|
|
1540
|
+
return result;
|
|
1541
|
+
}
|
|
1542
1542
|
}
|
|
1543
1543
|
|
|
1544
|
-
const EditorComponents = [
|
|
1545
|
-
MainEditorComponent,
|
|
1546
|
-
FileIdSelectComponent,
|
|
1547
|
-
TextEditorComponent,
|
|
1548
|
-
ExternalVideoBlockComponent,
|
|
1549
|
-
ImageEditorComponent,
|
|
1550
|
-
MainEditorBlockComponent,
|
|
1551
|
-
VisualEditorComponent,
|
|
1552
|
-
AddFilesBtnComponent,
|
|
1553
|
-
HtmlRawEditorComponent,
|
|
1554
|
-
];
|
|
1555
|
-
const XmlComponents = [
|
|
1556
|
-
XmlTagTableViewComponent,
|
|
1557
|
-
XmlTagViewComponent,
|
|
1558
|
-
XmlTagRichTextViewComponent,
|
|
1559
|
-
XmlTagHtmlViewComponent,
|
|
1560
|
-
XmlTagTextViewComponent,
|
|
1561
|
-
XmlTagHeaderTextViewComponent,
|
|
1562
|
-
XmlTagHeaderInnerTextViewComponent,
|
|
1563
|
-
XmlTagExternalVideoComponent,
|
|
1564
|
-
HtmlRawViewComponent
|
|
1565
|
-
];
|
|
1566
|
-
const CrocoPipes = [
|
|
1567
|
-
RichTextToHtmlPipe,
|
|
1568
|
-
TagToSpanPipe,
|
|
1569
|
-
ToPreviewPipe,
|
|
1570
|
-
ToHtmlBodyTagsPipe,
|
|
1571
|
-
ToPreviewHtmlPipe
|
|
1572
|
-
];
|
|
1573
|
-
const CrocoHtmlDeclarations = [
|
|
1574
|
-
UploadFilesBtnComponent,
|
|
1575
|
-
HtmlViewComponent,
|
|
1576
|
-
...XmlComponents,
|
|
1577
|
-
...EditorComponents,
|
|
1578
|
-
...CrocoPipes
|
|
1579
|
-
];
|
|
1580
|
-
const MaterialModules = [
|
|
1581
|
-
MatBadgeModule,
|
|
1582
|
-
MatTableModule,
|
|
1583
|
-
MatExpansionModule,
|
|
1584
|
-
MatFormFieldModule,
|
|
1585
|
-
MatSnackBarModule,
|
|
1586
|
-
MatProgressBarModule,
|
|
1587
|
-
MatProgressSpinnerModule,
|
|
1588
|
-
MatTabsModule,
|
|
1589
|
-
MatMenuModule,
|
|
1590
|
-
MatCardModule,
|
|
1591
|
-
MatSelectModule,
|
|
1592
|
-
MatTooltipModule,
|
|
1593
|
-
MatCheckboxModule,
|
|
1594
|
-
MatChipsModule,
|
|
1595
|
-
MatListModule,
|
|
1596
|
-
MatButtonModule,
|
|
1597
|
-
MatInputModule,
|
|
1598
|
-
MatDialogModule,
|
|
1599
|
-
MatPaginatorModule,
|
|
1600
|
-
MatDatepickerModule,
|
|
1601
|
-
MatGridListModule,
|
|
1602
|
-
MatSlideToggleModule,
|
|
1603
|
-
MatTreeModule,
|
|
1604
|
-
MatNativeDateModule,
|
|
1605
|
-
MatAutocompleteModule,
|
|
1606
|
-
MatSidenavModule,
|
|
1607
|
-
MatIconModule,
|
|
1608
|
-
DragDropModule,
|
|
1609
|
-
MatButtonToggleModule
|
|
1544
|
+
const EditorComponents = [
|
|
1545
|
+
MainEditorComponent,
|
|
1546
|
+
FileIdSelectComponent,
|
|
1547
|
+
TextEditorComponent,
|
|
1548
|
+
ExternalVideoBlockComponent,
|
|
1549
|
+
ImageEditorComponent,
|
|
1550
|
+
MainEditorBlockComponent,
|
|
1551
|
+
VisualEditorComponent,
|
|
1552
|
+
AddFilesBtnComponent,
|
|
1553
|
+
HtmlRawEditorComponent,
|
|
1554
|
+
];
|
|
1555
|
+
const XmlComponents = [
|
|
1556
|
+
XmlTagTableViewComponent,
|
|
1557
|
+
XmlTagViewComponent,
|
|
1558
|
+
XmlTagRichTextViewComponent,
|
|
1559
|
+
XmlTagHtmlViewComponent,
|
|
1560
|
+
XmlTagTextViewComponent,
|
|
1561
|
+
XmlTagHeaderTextViewComponent,
|
|
1562
|
+
XmlTagHeaderInnerTextViewComponent,
|
|
1563
|
+
XmlTagExternalVideoComponent,
|
|
1564
|
+
HtmlRawViewComponent
|
|
1565
|
+
];
|
|
1566
|
+
const CrocoPipes = [
|
|
1567
|
+
RichTextToHtmlPipe,
|
|
1568
|
+
TagToSpanPipe,
|
|
1569
|
+
ToPreviewPipe,
|
|
1570
|
+
ToHtmlBodyTagsPipe,
|
|
1571
|
+
ToPreviewHtmlPipe
|
|
1572
|
+
];
|
|
1573
|
+
const CrocoHtmlDeclarations = [
|
|
1574
|
+
UploadFilesBtnComponent,
|
|
1575
|
+
HtmlViewComponent,
|
|
1576
|
+
...XmlComponents,
|
|
1577
|
+
...EditorComponents,
|
|
1578
|
+
...CrocoPipes
|
|
1579
|
+
];
|
|
1580
|
+
const MaterialModules = [
|
|
1581
|
+
MatBadgeModule,
|
|
1582
|
+
MatTableModule,
|
|
1583
|
+
MatExpansionModule,
|
|
1584
|
+
MatFormFieldModule,
|
|
1585
|
+
MatSnackBarModule,
|
|
1586
|
+
MatProgressBarModule,
|
|
1587
|
+
MatProgressSpinnerModule,
|
|
1588
|
+
MatTabsModule,
|
|
1589
|
+
MatMenuModule,
|
|
1590
|
+
MatCardModule,
|
|
1591
|
+
MatSelectModule,
|
|
1592
|
+
MatTooltipModule,
|
|
1593
|
+
MatCheckboxModule,
|
|
1594
|
+
MatChipsModule,
|
|
1595
|
+
MatListModule,
|
|
1596
|
+
MatButtonModule,
|
|
1597
|
+
MatInputModule,
|
|
1598
|
+
MatDialogModule,
|
|
1599
|
+
MatPaginatorModule,
|
|
1600
|
+
MatDatepickerModule,
|
|
1601
|
+
MatGridListModule,
|
|
1602
|
+
MatSlideToggleModule,
|
|
1603
|
+
MatTreeModule,
|
|
1604
|
+
MatNativeDateModule,
|
|
1605
|
+
MatAutocompleteModule,
|
|
1606
|
+
MatSidenavModule,
|
|
1607
|
+
MatIconModule,
|
|
1608
|
+
DragDropModule,
|
|
1609
|
+
MatButtonToggleModule
|
|
1610
1610
|
];
|
|
1611
1611
|
|
|
1612
|
-
class CrocoHtmlModule {
|
|
1613
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1614
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1615
|
-
FormsModule,
|
|
1616
|
-
ReactiveFormsModule,
|
|
1617
|
-
NgSelectModule, i26.MatBadgeModule, i2$3.MatTableModule, i28.MatExpansionModule, i3$1.MatFormFieldModule, i2$2.MatSnackBarModule, i31.MatProgressBarModule, i4$1.MatProgressSpinnerModule, i6$2.MatTabsModule, i34.MatMenuModule, i5$2.MatCardModule, i6$1.MatSelectModule, i37.MatTooltipModule, i38.MatCheckboxModule, i8.MatChipsModule, i40.MatListModule, i2.MatButtonModule, i4.MatInputModule, i43.MatDialogModule, i44.MatPaginatorModule, i45.MatDatepickerModule, i46.MatGridListModule, i47.MatSlideToggleModule, i48.MatTreeModule, i7.MatNativeDateModule, i50.MatAutocompleteModule, i51.MatSidenavModule, i5$1.MatIconModule, i10.DragDropModule, i6.MatButtonToggleModule, YouTubePlayerModule], exports: [UploadFilesBtnComponent, HtmlViewComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, HtmlRawViewComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe] }); }
|
|
1618
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1619
|
-
FormsModule,
|
|
1620
|
-
ReactiveFormsModule,
|
|
1621
|
-
NgSelectModule, MaterialModules, YouTubePlayerModule] }); }
|
|
1622
|
-
}
|
|
1623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1624
|
-
type: NgModule,
|
|
1625
|
-
args: [{
|
|
1626
|
-
declarations: [
|
|
1627
|
-
...CrocoHtmlDeclarations,
|
|
1628
|
-
],
|
|
1629
|
-
exports: [
|
|
1630
|
-
...CrocoHtmlDeclarations,
|
|
1631
|
-
],
|
|
1632
|
-
imports: [
|
|
1633
|
-
CommonModule,
|
|
1634
|
-
FormsModule,
|
|
1635
|
-
ReactiveFormsModule,
|
|
1636
|
-
NgSelectModule,
|
|
1637
|
-
...MaterialModules,
|
|
1638
|
-
YouTubePlayerModule
|
|
1639
|
-
]
|
|
1640
|
-
}]
|
|
1612
|
+
class CrocoHtmlModule {
|
|
1613
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1614
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlModule, declarations: [UploadFilesBtnComponent, HtmlViewComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, HtmlRawViewComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe], imports: [CommonModule,
|
|
1615
|
+
FormsModule,
|
|
1616
|
+
ReactiveFormsModule,
|
|
1617
|
+
NgSelectModule, i26.MatBadgeModule, i2$3.MatTableModule, i28.MatExpansionModule, i3$1.MatFormFieldModule, i2$2.MatSnackBarModule, i31.MatProgressBarModule, i4$1.MatProgressSpinnerModule, i6$2.MatTabsModule, i34.MatMenuModule, i5$2.MatCardModule, i6$1.MatSelectModule, i37.MatTooltipModule, i38.MatCheckboxModule, i8.MatChipsModule, i40.MatListModule, i2.MatButtonModule, i4.MatInputModule, i43.MatDialogModule, i44.MatPaginatorModule, i45.MatDatepickerModule, i46.MatGridListModule, i47.MatSlideToggleModule, i48.MatTreeModule, i7.MatNativeDateModule, i50.MatAutocompleteModule, i51.MatSidenavModule, i5$1.MatIconModule, i10.DragDropModule, i6.MatButtonToggleModule, YouTubePlayerModule], exports: [UploadFilesBtnComponent, HtmlViewComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, HtmlRawViewComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe] }); }
|
|
1618
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlModule, imports: [CommonModule,
|
|
1619
|
+
FormsModule,
|
|
1620
|
+
ReactiveFormsModule,
|
|
1621
|
+
NgSelectModule, MaterialModules, YouTubePlayerModule] }); }
|
|
1622
|
+
}
|
|
1623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: CrocoHtmlModule, decorators: [{
|
|
1624
|
+
type: NgModule,
|
|
1625
|
+
args: [{
|
|
1626
|
+
declarations: [
|
|
1627
|
+
...CrocoHtmlDeclarations,
|
|
1628
|
+
],
|
|
1629
|
+
exports: [
|
|
1630
|
+
...CrocoHtmlDeclarations,
|
|
1631
|
+
],
|
|
1632
|
+
imports: [
|
|
1633
|
+
CommonModule,
|
|
1634
|
+
FormsModule,
|
|
1635
|
+
ReactiveFormsModule,
|
|
1636
|
+
NgSelectModule,
|
|
1637
|
+
...MaterialModules,
|
|
1638
|
+
YouTubePlayerModule
|
|
1639
|
+
]
|
|
1640
|
+
}]
|
|
1641
1641
|
}] });
|
|
1642
1642
|
|
|
1643
|
-
/*
|
|
1644
|
-
* Public API Surface of croco-html
|
|
1643
|
+
/*
|
|
1644
|
+
* Public API Surface of croco-html
|
|
1645
1645
|
*/
|
|
1646
1646
|
|
|
1647
|
-
/**
|
|
1648
|
-
* Generated bundle index. Do not edit.
|
|
1647
|
+
/**
|
|
1648
|
+
* Generated bundle index. Do not edit.
|
|
1649
1649
|
*/
|
|
1650
1650
|
|
|
1651
1651
|
export { AddFilesBtnComponent, AngularMaterialTableMethods, BodyTagsExtensions, BootstrapTableMethods, CrocoHtmlModule, ExternalVideoBlockComponent, ExternalVideoSupportedTypes, ExternalVideoTagDataConsts, FileIdSelectComponent, FileImageTagDataConsts, HtmlRawEditorComponent, HtmlRawViewComponent, HtmlViewComponent, ImageEditorComponent, ImageMethods, MainEditorBlockComponent, MainEditorComponent, RichTextToHtmlPipe, TableBuilder, TableMethods, TableTypes, TagToSpanPipe, TextEditorComponent, TextMethods, TextSimpleMethods, TextTag, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe, UploadFilesBtnComponent, VideoMethods, VisualEditorComponent, XmlExtensions, XmlTagExternalVideoComponent, XmlTagHeaderInnerTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHtmlViewComponent, XmlTagRichTextViewComponent, XmlTagTableViewComponent, XmlTagTextViewComponent, XmlTagViewComponent };
|