croco-html 4.2.1 → 4.2.3
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/fesm2022/croco-html.mjs +148 -133
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/visual-editor/visual-editor.component.d.ts +1 -2
- package/lib/extensions/AngularMaterialTableMethods.d.ts +3 -3
- package/lib/extensions/BootstrapTableMethods.d.ts +2 -2
- package/lib/extensions/HtmlExtractionMethods.d.ts +0 -22
- package/lib/extensions/InterfaceBlock.d.ts +0 -1
- package/lib/extensions/TableMethods.d.ts +4 -20
- package/lib/tag-services/HtmlRawTagService.d.ts +10 -0
- package/lib/tag-services/TableTagService.d.ts +12 -0
- package/package.json +1 -1
- package/lib/extensions/HtmlRawTagDataConsts.d.ts +0 -10
package/fesm2022/croco-html.mjs
CHANGED
|
@@ -87,14 +87,14 @@ class AngularMaterialTableMethods {
|
|
|
87
87
|
data: data,
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
static checkHeaders(
|
|
91
|
-
if (
|
|
90
|
+
static checkHeaders(header) {
|
|
91
|
+
if (header === null) {
|
|
92
92
|
return {
|
|
93
93
|
isSucceeded: false,
|
|
94
94
|
message: "Необходимо указать заголовок таблицы"
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
let columns =
|
|
97
|
+
let columns = header.columns;
|
|
98
98
|
var uniqueDislayedColumns = columns.filter((v, i, a) => a.indexOf(v) === i);
|
|
99
99
|
if (uniqueDislayedColumns.length !== columns.length) {
|
|
100
100
|
return {
|
|
@@ -107,15 +107,14 @@ class AngularMaterialTableMethods {
|
|
|
107
107
|
message: "Ok"
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
static checkAngularMaterialTableData(
|
|
110
|
+
static checkAngularMaterialTableData(header, rows, checkHeaders = true) {
|
|
111
111
|
if (checkHeaders) {
|
|
112
|
-
var checkHeadersResult = this.checkHeaders(
|
|
112
|
+
var checkHeadersResult = this.checkHeaders(header);
|
|
113
113
|
if (!checkHeadersResult.isSucceeded) {
|
|
114
114
|
return checkHeadersResult;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
let
|
|
118
|
-
let columns = tableData.header.columns;
|
|
117
|
+
let columns = header.columns;
|
|
119
118
|
for (let i = 0; i < rows.length; i++) {
|
|
120
119
|
const row = rows[i];
|
|
121
120
|
if (row.columns.length !== columns.length) {
|
|
@@ -134,6 +133,42 @@ class AngularMaterialTableMethods {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
136
|
+
class HtmlExtractionMethods {
|
|
137
|
+
static transformHtmlElementToBlocks(element, options) {
|
|
138
|
+
const data = [];
|
|
139
|
+
for (let i = 0; i < element.children.length; i++) {
|
|
140
|
+
const elem = element.children.item(i);
|
|
141
|
+
const loweredTagName = elem.tagName.toLowerCase();
|
|
142
|
+
if (BodyTagsExtensions.tagServices.hasOwnProperty(loweredTagName)) {
|
|
143
|
+
const tagService = BodyTagsExtensions.tagServices[loweredTagName];
|
|
144
|
+
const resultBlock = tagService.extractBlockFromHtmlElement(elem, options);
|
|
145
|
+
data.push(resultBlock);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
data.push({
|
|
150
|
+
tagName: "unsupported-tag",
|
|
151
|
+
data: {
|
|
152
|
+
tagString: elem.outerHTML
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return data;
|
|
158
|
+
}
|
|
159
|
+
static transformHtmlStringToBlocks(value, options) {
|
|
160
|
+
if (value === undefined || value === null) {
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
163
|
+
value = value
|
|
164
|
+
.replace('\n', '')
|
|
165
|
+
.replace('\t', '');
|
|
166
|
+
var div = document.createElement("div");
|
|
167
|
+
div.innerHTML = value;
|
|
168
|
+
return this.transformHtmlElementToBlocks(div, options);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
137
172
|
class FileImageTagDataConsts {
|
|
138
173
|
static { this.TagName = "file-image"; }
|
|
139
174
|
static { this.FileIdAttrName = "file-id"; }
|
|
@@ -405,7 +440,6 @@ class ExternalVideoTagService {
|
|
|
405
440
|
class HtmlRawTagDataConsts {
|
|
406
441
|
static { this.TagName = "html-raw"; }
|
|
407
442
|
}
|
|
408
|
-
|
|
409
443
|
class HtmlRawTagService {
|
|
410
444
|
constructor() {
|
|
411
445
|
this.tagName = HtmlRawTagDataConsts.TagName;
|
|
@@ -627,6 +661,62 @@ class CustomWidgetTagService {
|
|
|
627
661
|
}
|
|
628
662
|
}
|
|
629
663
|
|
|
664
|
+
class TextTags {
|
|
665
|
+
static { this.text = "text"; }
|
|
666
|
+
static { this.h1 = "h1"; }
|
|
667
|
+
static { this.h2 = "h2"; }
|
|
668
|
+
static { this.h3 = "h3"; }
|
|
669
|
+
static { this.h4 = "h4"; }
|
|
670
|
+
static { this.h5 = "h5"; }
|
|
671
|
+
static { this.h6 = "h6"; }
|
|
672
|
+
static { this.headerTextTags = [TextTags.h1, TextTags.h2, TextTags.h3, TextTags.h4, TextTags.h5, TextTags.h6]; }
|
|
673
|
+
static { this.allTextTags = [TextTags.text, ...TextTags.headerTextTags]; }
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
class ExternalVideoTagDataConsts {
|
|
677
|
+
static { this.TagName = "external-video"; }
|
|
678
|
+
static { this.VideoTypeAttrName = "type"; }
|
|
679
|
+
static { this.LinkAttrName = "link"; }
|
|
680
|
+
static { this.UseResponsiveWrapperAttrName = "use-responsive-wrapper"; }
|
|
681
|
+
static { this.IframeAttrName = "iframe"; }
|
|
682
|
+
}
|
|
683
|
+
class ExternalVideoSupportedTypes {
|
|
684
|
+
static { this.Youtube = "youtube"; }
|
|
685
|
+
static { this.VkVideo = "vk-video"; }
|
|
686
|
+
static { this.Code = "code"; }
|
|
687
|
+
}
|
|
688
|
+
const ExternalVideoPlayers = [
|
|
689
|
+
{
|
|
690
|
+
type: ExternalVideoSupportedTypes.Code,
|
|
691
|
+
displayValue: 'Встраиваемое Видео',
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
type: ExternalVideoSupportedTypes.Youtube,
|
|
695
|
+
displayValue: 'Youtube',
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
type: ExternalVideoSupportedTypes.VkVideo,
|
|
699
|
+
displayValue: 'Vk Video',
|
|
700
|
+
}
|
|
701
|
+
];
|
|
702
|
+
|
|
703
|
+
class Tags {
|
|
704
|
+
static { this.Text = TextTags.text; }
|
|
705
|
+
static { this.H1 = TextTags.h1; }
|
|
706
|
+
static { this.H2 = TextTags.h2; }
|
|
707
|
+
static { this.H3 = TextTags.h3; }
|
|
708
|
+
static { this.H4 = TextTags.h4; }
|
|
709
|
+
static { this.H5 = TextTags.h5; }
|
|
710
|
+
static { this.H6 = TextTags.h6; }
|
|
711
|
+
static { this.HtmlRaw = HtmlRawTagDataConsts.TagName; }
|
|
712
|
+
static { this.FileImage = FileImageTagDataConsts.TagName; }
|
|
713
|
+
static { this.Table = 'table'; }
|
|
714
|
+
static { this.RichText = 'rich-text'; }
|
|
715
|
+
static { this.ExternalVideo = ExternalVideoTagDataConsts.TagName; }
|
|
716
|
+
static { this.UnsupportedTag = 'unsupported-tag'; }
|
|
717
|
+
static { this.CustomWidget = CustomWidgetTagDataConsts.TagName; }
|
|
718
|
+
}
|
|
719
|
+
|
|
630
720
|
const TextTag = "text";
|
|
631
721
|
class TextSimpleMethods {
|
|
632
722
|
static { this.supportedTags = ["sup", "sub", "strong", "b", "i", "u"]; }
|
|
@@ -705,10 +795,10 @@ class TextSimpleMethods {
|
|
|
705
795
|
}
|
|
706
796
|
|
|
707
797
|
class BootstrapTableMethods {
|
|
708
|
-
static BuildTable(
|
|
798
|
+
static BuildTable(header, rows) {
|
|
709
799
|
let result = `<table class="table table-bordered">`;
|
|
710
|
-
result += this.BuildHeader(
|
|
711
|
-
result += this.BuildBody(
|
|
800
|
+
result += this.BuildHeader(header);
|
|
801
|
+
result += this.BuildBody(rows);
|
|
712
802
|
result += "</table>";
|
|
713
803
|
return result;
|
|
714
804
|
}
|
|
@@ -776,32 +866,19 @@ class TableTypes {
|
|
|
776
866
|
}
|
|
777
867
|
class TableMethods {
|
|
778
868
|
static getTableFromHtmlTag(tableTag, options) {
|
|
869
|
+
const tableHeader = TableMethods.getHeader(tableTag);
|
|
870
|
+
const tableRows = TableMethods.getTableRows(tableTag, options);
|
|
779
871
|
let tableData = {
|
|
780
|
-
header:
|
|
781
|
-
rows:
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
data: tableData,
|
|
786
|
-
validationResult: this.checkTable(tableData),
|
|
787
|
-
bootstrapHtml: ""
|
|
872
|
+
header: tableHeader,
|
|
873
|
+
rows: tableRows,
|
|
874
|
+
bootstrapHtml: BootstrapTableMethods.BuildTable(tableHeader, tableRows),
|
|
875
|
+
html: tableTag.outerHTML,
|
|
876
|
+
angularMaterialTableDataCheck: AngularMaterialTableMethods.checkAngularMaterialTableData(tableHeader, tableRows)
|
|
788
877
|
};
|
|
789
|
-
if (!result.validationResult) {
|
|
790
|
-
return result;
|
|
791
|
-
}
|
|
792
|
-
result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
|
|
793
|
-
var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
|
|
794
|
-
if (!angularMaterialTableDataCheck.isSucceeded) {
|
|
795
|
-
return {
|
|
796
|
-
...result,
|
|
797
|
-
angularMaterialTableDataCheck
|
|
798
|
-
};
|
|
799
|
-
}
|
|
800
878
|
return {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows),
|
|
879
|
+
tagName: TableTypes.Table,
|
|
880
|
+
data: tableData,
|
|
881
|
+
validationResult: this.checkTable(tableData)
|
|
805
882
|
};
|
|
806
883
|
}
|
|
807
884
|
static checkTable(tableData) {
|
|
@@ -873,105 +950,42 @@ class TableMethods {
|
|
|
873
950
|
}
|
|
874
951
|
}
|
|
875
952
|
|
|
876
|
-
class
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}; }
|
|
881
|
-
static transformHtmlElementToBlocks(element, options) {
|
|
882
|
-
var data = [];
|
|
883
|
-
for (let i = 0; i < element.children.length; i++) {
|
|
884
|
-
var elem = element.children.item(i);
|
|
885
|
-
var loweredTagName = elem.tagName.toLowerCase();
|
|
886
|
-
if (BodyTagsExtensions.tagServices.hasOwnProperty(loweredTagName)) {
|
|
887
|
-
var tagService = BodyTagsExtensions.tagServices[loweredTagName];
|
|
888
|
-
var resultBlock = tagService.extractBlockFromHtmlElement(elem, options);
|
|
889
|
-
data.push(resultBlock);
|
|
890
|
-
continue;
|
|
891
|
-
}
|
|
892
|
-
if (!HtmlExtractionMethods.Extractors.hasOwnProperty(loweredTagName)) {
|
|
893
|
-
data.push({
|
|
894
|
-
tagName: "unsupported-tag",
|
|
895
|
-
data: {
|
|
896
|
-
tagString: elem.outerHTML
|
|
897
|
-
}
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
else {
|
|
901
|
-
var extractor = HtmlExtractionMethods.Extractors[loweredTagName];
|
|
902
|
-
var result = extractor(elem, options);
|
|
903
|
-
data.push(result);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
return data;
|
|
953
|
+
class TableTagService {
|
|
954
|
+
constructor() {
|
|
955
|
+
this.tagName = TableTypes.Table;
|
|
956
|
+
this.shortDescription = "Таблица";
|
|
907
957
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
return [];
|
|
911
|
-
}
|
|
912
|
-
value = value
|
|
913
|
-
.replace('\n', '')
|
|
914
|
-
.replace('\t', '');
|
|
915
|
-
var div = document.createElement("div");
|
|
916
|
-
div.innerHTML = value;
|
|
917
|
-
return this.transformHtmlElementToBlocks(div, options);
|
|
958
|
+
bodyTagToHtmlStringConverter(bodyTag) {
|
|
959
|
+
return `<${this.tagName}>${bodyTag.innerHtml}</${this.tagName}>`;
|
|
918
960
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
{
|
|
947
|
-
type: ExternalVideoSupportedTypes.Code,
|
|
948
|
-
displayValue: 'Встраиваемое Видео',
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
type: ExternalVideoSupportedTypes.Youtube,
|
|
952
|
-
displayValue: 'Youtube',
|
|
953
|
-
},
|
|
954
|
-
{
|
|
955
|
-
type: ExternalVideoSupportedTypes.VkVideo,
|
|
956
|
-
displayValue: 'Vk Video',
|
|
961
|
+
extractBlockFromHtmlElement(elem, options) {
|
|
962
|
+
return TableMethods.getTableFromHtmlTag(elem, options);
|
|
963
|
+
}
|
|
964
|
+
toBodyTag(data) {
|
|
965
|
+
let tableData = data.data;
|
|
966
|
+
return {
|
|
967
|
+
presentOrEdit: true,
|
|
968
|
+
tagDescription: {
|
|
969
|
+
tag: data.tagName,
|
|
970
|
+
displayValue: this.shortDescription,
|
|
971
|
+
isCustom: false
|
|
972
|
+
},
|
|
973
|
+
attributes: tableData,
|
|
974
|
+
innerHtml: null
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
getDefaultValue(props) {
|
|
978
|
+
return {
|
|
979
|
+
tagDescription: {
|
|
980
|
+
tag: this.tagName,
|
|
981
|
+
displayValue: this.shortDescription,
|
|
982
|
+
isCustom: false
|
|
983
|
+
},
|
|
984
|
+
attributes: {},
|
|
985
|
+
presentOrEdit: false,
|
|
986
|
+
innerHtml: props.htmlRaw,
|
|
987
|
+
};
|
|
957
988
|
}
|
|
958
|
-
];
|
|
959
|
-
|
|
960
|
-
class Tags {
|
|
961
|
-
static { this.Text = TextTags.text; }
|
|
962
|
-
static { this.H1 = TextTags.h1; }
|
|
963
|
-
static { this.H2 = TextTags.h2; }
|
|
964
|
-
static { this.H3 = TextTags.h3; }
|
|
965
|
-
static { this.H4 = TextTags.h4; }
|
|
966
|
-
static { this.H5 = TextTags.h5; }
|
|
967
|
-
static { this.H6 = TextTags.h6; }
|
|
968
|
-
static { this.HtmlRaw = HtmlRawTagDataConsts.TagName; }
|
|
969
|
-
static { this.FileImage = FileImageTagDataConsts.TagName; }
|
|
970
|
-
static { this.Table = 'table'; }
|
|
971
|
-
static { this.RichText = 'rich-text'; }
|
|
972
|
-
static { this.ExternalVideo = ExternalVideoTagDataConsts.TagName; }
|
|
973
|
-
static { this.UnsupportedTag = 'unsupported-tag'; }
|
|
974
|
-
static { this.CustomWidget = CustomWidgetTagDataConsts.TagName; }
|
|
975
989
|
}
|
|
976
990
|
|
|
977
991
|
class BodyTagsExtensions {
|
|
@@ -987,7 +1001,8 @@ class BodyTagsExtensions {
|
|
|
987
1001
|
[ExternalVideoTagDataConsts.TagName]: new ExternalVideoTagService(),
|
|
988
1002
|
[HtmlRawTagDataConsts.TagName]: new HtmlRawTagService(),
|
|
989
1003
|
[DownloadButtonTagDataConsts.TagName]: new DownloadButtonTagService(),
|
|
990
|
-
[ButtonTagDataConsts.TagName]: new ButtonTagService()
|
|
1004
|
+
[ButtonTagDataConsts.TagName]: new ButtonTagService(),
|
|
1005
|
+
[TableTypes.Table]: new TableTagService()
|
|
991
1006
|
}; }
|
|
992
1007
|
static convertToHtmlString(bodyTag) {
|
|
993
1008
|
const tagName = bodyTag.tagDescription.tag;
|
|
@@ -1745,7 +1760,7 @@ class XmlTagViewComponent {
|
|
|
1745
1760
|
return this._options.definedCustomTags.includes(item.tagName);
|
|
1746
1761
|
}
|
|
1747
1762
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: XmlTagViewComponent, deps: [{ token: CrocoHtmlOptionsToken }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1748
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: XmlTagViewComponent, isStandalone: true, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div>\n @for (item of data; track $index) {\n <div class=\"row\">\n\n @if (item.tagName === 'text') {\n <div>\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n }\n\n @if (item.tagName === 'html-raw') {\n <div>\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\"></croco-html-raw-view>\n </div>\n }\n\n @if (isHeaderTextTag(item)) {\n <div>\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\n </div>\n }\n\n @if (item.tagName === 'file-image') {\n <div>\n <croco-html-file-image-tag-view [item]=\"item\"></croco-html-file-image-tag-view>\n </div>\n }\n\n @if (item.tagName === 'custom-widget') {\n <div>\n <croco-html-xml-tag-custom-widget [tagData]=\"item.data\"></croco-html-xml-tag-custom-widget>\n </div>\n }\n\n @if (item.tagName === 'table' && item.validationResult) {\n\n @if (item.validationResult.isSucceeded){\n <croco-html-xml-tag-html-view [html]=\"item.bootstrapHtml\">\n </croco-html-xml-tag-html-view>\n }\n @else {\n <croco-html-error-banner [message]=\"item.validationResult.message\">\n </croco-html-error-banner>\n }\n }\n\n @if (item.tagName === 'external-video') {\n <div>\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\n </div>\n }\n\n @if (item.tagName === 'download-file-button') {\n <div>\n <croco-html-xml-tag-download-file-button [data]=\"item\"></croco-html-xml-tag-download-file-button>\n </div>\n }\n\n @if (item.tagName === 'button') {\n <div>\n <croco-html-xml-tag-button [data]=\"item\"></croco-html-xml-tag-button>\n </div>\n }\n\n @if (item.tagName === 'unsupported-tag') {\n <div class=\"red\" style=\"margin-top: 10px;\">\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>\n <span>\n {{item.data.tagString}}\n </span>\n </div>\n }\n\n @if (isDefinedCustomTag(item)) {\n
|
|
1763
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: XmlTagViewComponent, isStandalone: true, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div>\n @for (item of data; track $index) {\n <div class=\"row\">\n\n @if (item.tagName === 'text') {\n <div>\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n }\n\n @if (item.tagName === 'html-raw') {\n <div>\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\"></croco-html-raw-view>\n </div>\n }\n\n @if (isHeaderTextTag(item)) {\n <div>\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\n </div>\n }\n\n @if (item.tagName === 'file-image') {\n <div>\n <croco-html-file-image-tag-view [item]=\"item\"></croco-html-file-image-tag-view>\n </div>\n }\n\n @if (item.tagName === 'custom-widget') {\n <div>\n <croco-html-xml-tag-custom-widget [tagData]=\"item.data\"></croco-html-xml-tag-custom-widget>\n </div>\n }\n\n @if (item.tagName === 'table' && item.validationResult) {\n\n @if (item.validationResult.isSucceeded){\n <croco-html-xml-tag-html-view [html]=\"item.data.bootstrapHtml\">\n </croco-html-xml-tag-html-view>\n }\n @else {\n <croco-html-error-banner [message]=\"item.validationResult.message\">\n </croco-html-error-banner>\n }\n }\n\n @if (item.tagName === 'external-video') {\n <div>\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\n </div>\n }\n\n @if (item.tagName === 'download-file-button') {\n <div>\n <croco-html-xml-tag-download-file-button [data]=\"item\"></croco-html-xml-tag-download-file-button>\n </div>\n }\n\n @if (item.tagName === 'button') {\n <div>\n <croco-html-xml-tag-button [data]=\"item\"></croco-html-xml-tag-button>\n </div>\n }\n\n @if (item.tagName === 'unsupported-tag') {\n <div class=\"red\" style=\"margin-top: 10px;\">\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>\n <span>\n {{item.data.tagString}}\n </span>\n </div>\n }\n\n @if (isDefinedCustomTag(item)) {\n <div>\n <croco-html-defined-custom-tag-view [data]=\"item\"></croco-html-defined-custom-tag-view>\n </div>\n }\n\n </div>\n }\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], dependencies: [{ kind: "component", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { kind: "component", type: HtmlRawViewComponent, selector: "croco-html-raw-view", inputs: ["rawHtml"] }, { kind: "component", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { kind: "component", type: FileImageTagViewComponent, selector: "croco-html-file-image-tag-view", inputs: ["item"] }, { kind: "component", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { kind: "component", type: ErrorBannerComponent, selector: "croco-html-error-banner", inputs: ["message"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }, { kind: "component", type: XmlTagDownloadFileButtonComponent, selector: "croco-html-xml-tag-download-file-button", inputs: ["data", "tagData"] }, { kind: "component", type: XmlTagButtonComponent, selector: "croco-html-xml-tag-button", inputs: ["data", "tagData"] }, { kind: "component", type: XmlTagCustomWidgetComponent, selector: "croco-html-xml-tag-custom-widget", inputs: ["tagData"] }, { kind: "component", type: DefinedCustomTagViewComponent, selector: "croco-html-defined-custom-tag-view", inputs: ["data"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1749
1764
|
}
|
|
1750
1765
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: XmlTagViewComponent, decorators: [{
|
|
1751
1766
|
type: Component,
|
|
@@ -1761,7 +1776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1761
1776
|
XmlTagButtonComponent,
|
|
1762
1777
|
XmlTagCustomWidgetComponent,
|
|
1763
1778
|
DefinedCustomTagViewComponent
|
|
1764
|
-
], template: "<div>\n @for (item of data; track $index) {\n <div class=\"row\">\n\n @if (item.tagName === 'text') {\n <div>\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n }\n\n @if (item.tagName === 'html-raw') {\n <div>\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\"></croco-html-raw-view>\n </div>\n }\n\n @if (isHeaderTextTag(item)) {\n <div>\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\n </div>\n }\n\n @if (item.tagName === 'file-image') {\n <div>\n <croco-html-file-image-tag-view [item]=\"item\"></croco-html-file-image-tag-view>\n </div>\n }\n\n @if (item.tagName === 'custom-widget') {\n <div>\n <croco-html-xml-tag-custom-widget [tagData]=\"item.data\"></croco-html-xml-tag-custom-widget>\n </div>\n }\n\n @if (item.tagName === 'table' && item.validationResult) {\n\n @if (item.validationResult.isSucceeded){\n <croco-html-xml-tag-html-view [html]=\"item.bootstrapHtml\">\n </croco-html-xml-tag-html-view>\n }\n @else {\n <croco-html-error-banner [message]=\"item.validationResult.message\">\n </croco-html-error-banner>\n }\n }\n\n @if (item.tagName === 'external-video') {\n <div>\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\n </div>\n }\n\n @if (item.tagName === 'download-file-button') {\n <div>\n <croco-html-xml-tag-download-file-button [data]=\"item\"></croco-html-xml-tag-download-file-button>\n </div>\n }\n\n @if (item.tagName === 'button') {\n <div>\n <croco-html-xml-tag-button [data]=\"item\"></croco-html-xml-tag-button>\n </div>\n }\n\n @if (item.tagName === 'unsupported-tag') {\n <div class=\"red\" style=\"margin-top: 10px;\">\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>\n <span>\n {{item.data.tagString}}\n </span>\n </div>\n }\n\n @if (isDefinedCustomTag(item)) {\n
|
|
1779
|
+
], template: "<div>\n @for (item of data; track $index) {\n <div class=\"row\">\n\n @if (item.tagName === 'text') {\n <div>\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n }\n\n @if (item.tagName === 'html-raw') {\n <div>\n <croco-html-raw-view [rawHtml]=\"item.data.innerHTML\"></croco-html-raw-view>\n </div>\n }\n\n @if (isHeaderTextTag(item)) {\n <div>\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\n </div>\n }\n\n @if (item.tagName === 'file-image') {\n <div>\n <croco-html-file-image-tag-view [item]=\"item\"></croco-html-file-image-tag-view>\n </div>\n }\n\n @if (item.tagName === 'custom-widget') {\n <div>\n <croco-html-xml-tag-custom-widget [tagData]=\"item.data\"></croco-html-xml-tag-custom-widget>\n </div>\n }\n\n @if (item.tagName === 'table' && item.validationResult) {\n\n @if (item.validationResult.isSucceeded){\n <croco-html-xml-tag-html-view [html]=\"item.data.bootstrapHtml\">\n </croco-html-xml-tag-html-view>\n }\n @else {\n <croco-html-error-banner [message]=\"item.validationResult.message\">\n </croco-html-error-banner>\n }\n }\n\n @if (item.tagName === 'external-video') {\n <div>\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\n </div>\n }\n\n @if (item.tagName === 'download-file-button') {\n <div>\n <croco-html-xml-tag-download-file-button [data]=\"item\"></croco-html-xml-tag-download-file-button>\n </div>\n }\n\n @if (item.tagName === 'button') {\n <div>\n <croco-html-xml-tag-button [data]=\"item\"></croco-html-xml-tag-button>\n </div>\n }\n\n @if (item.tagName === 'unsupported-tag') {\n <div class=\"red\" style=\"margin-top: 10px;\">\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>\n <span>\n {{item.data.tagString}}\n </span>\n </div>\n }\n\n @if (isDefinedCustomTag(item)) {\n <div>\n <croco-html-defined-custom-tag-view [data]=\"item\"></croco-html-defined-custom-tag-view>\n </div>\n }\n\n </div>\n }\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
|
|
1765
1780
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1766
1781
|
type: Inject,
|
|
1767
1782
|
args: [CrocoHtmlOptionsToken]
|